mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
DCCK - initial checkin, not part of the build
This commit is contained in:
parent
c0f611dfc8
commit
fd2a2e2e91
57
embedding/tests/winEmbed/Makefile
Normal file
57
embedding/tests/winEmbed/Makefile
Normal file
@ -0,0 +1,57 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is the Mozilla browser.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications, Inc. Portions created by Netscape are
|
||||
# Copyright (C) 2001, Mozilla. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = ../..
|
||||
srcdir = .
|
||||
VPATH = .
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
PROGRAM = dcck$(BIN_SUFFIX)
|
||||
RESFILE = dcck.res
|
||||
|
||||
CPPSRCS = \
|
||||
customize.cpp \
|
||||
$(NULL)
|
||||
|
||||
LIBS = \
|
||||
../toolkit/dcck.lib \
|
||||
$(NULL)
|
||||
|
||||
OS_LIBS += \
|
||||
ole32.lib \
|
||||
comdlg32.lib \
|
||||
shell32.lib \
|
||||
version.lib \
|
||||
$(NULL)
|
||||
|
||||
#
|
||||
# Control the default heap size.
|
||||
# This is the heap returned by GetProcessHeap().
|
||||
# As we use the CRT heap, the default size is too large and wastes VM.
|
||||
#
|
||||
# The default heap size is 1MB on Win32.
|
||||
# The heap will grow if need be.
|
||||
#
|
||||
# Set it to 256k. See bug 127069.
|
||||
#
|
||||
LDFLAGS += /HEAP:0x40000
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
228
embedding/tests/winEmbed/customize.cpp
Normal file
228
embedding/tests/winEmbed/customize.cpp
Normal file
@ -0,0 +1,228 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: Mozilla-sample-code 1.0
|
||||
*
|
||||
* Copyright (c) 2002 Netscape Communications Corporation and
|
||||
* other contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this Mozilla sample software and associated documentation files
|
||||
* (the "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
* persons to whom the Software is furnished to do so, subject to the
|
||||
* following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Doug Turner <dougt@netscape.com>
|
||||
* Adam Lock <adamlock@netscape.com>
|
||||
* J.Betak <jbetak@netscape.com>
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "dcck.h"
|
||||
|
||||
typedef unsigned int PRUint32;
|
||||
typedef PRUint32 nsresult;
|
||||
typedef int PRIntn;
|
||||
typedef PRIntn PRBool;
|
||||
|
||||
#define PR_TRUE 1
|
||||
#define PR_FALSE 0
|
||||
#define PR_fprintf printf
|
||||
#define NS_FAILED(_nsresult) ((_nsresult) & 0x80000000)
|
||||
#define NS_SUCCEEDED(_nsresult) (!((_nsresult) & 0x80000000))
|
||||
#define HELP_SPACER_1 "\t"
|
||||
#define HELP_SPACER_2 "\t\t"
|
||||
#define HELP_SPACER_4 "\t\t\t\t"
|
||||
#define NS_OK 0
|
||||
|
||||
static const unsigned char uc[] =
|
||||
{
|
||||
'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007',
|
||||
'\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017',
|
||||
'\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027',
|
||||
'\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037',
|
||||
' ', '!', '"', '#', '$', '%', '&', '\'',
|
||||
'(', ')', '*', '+', ',', '-', '.', '/',
|
||||
'0', '1', '2', '3', '4', '5', '6', '7',
|
||||
'8', '9', ':', ';', '<', '=', '>', '?',
|
||||
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
|
||||
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
|
||||
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
|
||||
'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
|
||||
'`', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
|
||||
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
|
||||
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
|
||||
'X', 'Y', 'Z', '{', '|', '}', '~', '\177',
|
||||
'\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
|
||||
'\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217',
|
||||
'\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227',
|
||||
'\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237',
|
||||
'\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247',
|
||||
'\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
|
||||
'\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
|
||||
'\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
|
||||
'\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307',
|
||||
'\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317',
|
||||
'\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327',
|
||||
'\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337',
|
||||
'\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
|
||||
'\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
|
||||
'\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
|
||||
'\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'
|
||||
};
|
||||
|
||||
|
||||
PRIntn
|
||||
PL_strcasecmp(const char *a, const char *b);
|
||||
|
||||
|
||||
PRIntn
|
||||
PL_strcasecmp(const char *a, const char *b)
|
||||
{
|
||||
const unsigned char *ua = (const unsigned char *)a;
|
||||
const unsigned char *ub = (const unsigned char *)b;
|
||||
|
||||
if( ((const char *)0 == a) || (const char *)0 == b )
|
||||
return (PRIntn)(a-b);
|
||||
|
||||
while( (uc[*ua] == uc[*ub]) && ('\0' != *a) )
|
||||
{
|
||||
a++;
|
||||
ua++;
|
||||
ub++;
|
||||
}
|
||||
|
||||
return (PRIntn)(uc[*ua] - uc[*ub]);
|
||||
}
|
||||
|
||||
static void DumpHelp(char *appname)
|
||||
{
|
||||
printf("\n");
|
||||
printf("Usage: %s [ options ... ]\n", appname);
|
||||
printf(" where options include:\n");
|
||||
printf("\n");
|
||||
|
||||
printf("-h or -help %sPrint this message.\n",HELP_SPACER_1);
|
||||
printf("\n");
|
||||
printf("-appDir %sreturn absolute application installation path\n",HELP_SPACER_1);
|
||||
printf("-Profile <Profile> %sreturn absolute path to the given user profile\n",HELP_SPACER_1);
|
||||
printf("-currentProfile %sreturn absolute path to the current user profile\n",HELP_SPACER_1);
|
||||
printf("-defaultPref %sappend \"isp.js\" to application defaults in \"all-ns\".\n",HELP_SPACER_1);
|
||||
printf("-userPref <Profile>%sappend \"isp.js\" to user defaults in \"prefs.js\"\n",HELP_SPACER_1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
for (int i=1; i<argc; i++) {
|
||||
|
||||
if ((PL_strcasecmp(argv[i], "-h") == 0)
|
||||
|| (PL_strcasecmp(argv[i], "-help") == 0)
|
||||
|| (PL_strcasecmp(argv[i], "--help") == 0)
|
||||
|| (PL_strcasecmp(argv[i], "/h") == 0)
|
||||
|| (PL_strcasecmp(argv[i], "/help") == 0)
|
||||
|| (PL_strcasecmp(argv[i], "/?") == 0)
|
||||
) {
|
||||
DumpHelp(argv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((PL_strcasecmp(argv[i], "-appDir") == 0)
|
||||
|| (PL_strcasecmp(argv[i], "--appDir") == 0)
|
||||
|| (PL_strcasecmp(argv[i], "/appDir") == 0)
|
||||
) {
|
||||
char* retBuf;
|
||||
retBuf = GetNSInstallDir();
|
||||
printf("\n%s\n", retBuf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((PL_strcasecmp(argv[i], "-Profile") == 0)
|
||||
|| (PL_strcasecmp(argv[i], "--Profile") == 0)
|
||||
|| (PL_strcasecmp(argv[i], "/Profile") == 0)
|
||||
) {
|
||||
char* retBuf;
|
||||
if ((i+1)<argc) {
|
||||
retBuf = GetNSUserProfile(argv[i+1]);
|
||||
printf("\n%s\n", retBuf);
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ((PL_strcasecmp(argv[i], "-currentProfile") == 0)
|
||||
|| (PL_strcasecmp(argv[i], "--currentProfile") == 0)
|
||||
|| (PL_strcasecmp(argv[i], "/currentProfile") == 0)
|
||||
) {
|
||||
char* retBuf;
|
||||
retBuf = GetNSCurrentProfile();
|
||||
printf("\n%s\n", retBuf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((PL_strcasecmp(argv[i], "-defaultPref") == 0)
|
||||
|| (PL_strcasecmp(argv[i], "--defaultPref") == 0)
|
||||
|| (PL_strcasecmp(argv[i], "/defaultPref") == 0)
|
||||
) {
|
||||
if NS_SUCCEEDED(AppendDefaultPref(GetPrefTemplateFilePath(),
|
||||
GetNSPrefDefaultsFilePath())) {
|
||||
printf("Netscape account defaults have been modified.\n");
|
||||
} else {
|
||||
printf("Error.\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((PL_strcasecmp(argv[i], "-userPrefJS") == 0)
|
||||
|| (PL_strcasecmp(argv[i], "--userPrefJS") == 0)
|
||||
|| (PL_strcasecmp(argv[i], "/userPrefJS") == 0)
|
||||
) {
|
||||
if ((i+1)<argc) {
|
||||
char* retBuf;
|
||||
retBuf = GetNSUserProfileJS(argv[i+1]);
|
||||
printf("\n%s\n", retBuf);
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ((PL_strcasecmp(argv[i], "-userPref") == 0)
|
||||
|| (PL_strcasecmp(argv[i], "--userPref") == 0)
|
||||
|| (PL_strcasecmp(argv[i], "/userPref") == 0)
|
||||
) {
|
||||
if ((i+1)<argc) {
|
||||
if NS_SUCCEEDED(AppendUserPref(GetPrefTemplateFilePath(),
|
||||
argv[i+1])) {
|
||||
printf("Netscape account defaults have been modified.\n");
|
||||
} else {
|
||||
printf("Error.\n");
|
||||
}
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int rv = 0;
|
||||
return rv;
|
||||
}
|
||||
|
65
embedding/tests/winEmbed/dcck.h
Normal file
65
embedding/tests/winEmbed/dcck.h
Normal file
@ -0,0 +1,65 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
|
||||
//returns the location of N7.x install directory
|
||||
extern "C" _declspec(dllexport) char* GetNSInstallDir();
|
||||
|
||||
//returns absolute path to all-ns.js pref default file
|
||||
extern "C" _declspec(dllexport) char* GetPrefTemplateFilePath();
|
||||
|
||||
//returns absolute path to all.js pref default file
|
||||
extern "C" _declspec(dllexport) char* GetNSPrefDefaultsFilePath();
|
||||
|
||||
//returns the location of the current profile [user-profile-dir]
|
||||
extern "C" _declspec(dllexport) char* GetNSCurrentProfile();
|
||||
|
||||
//returns the location of profile-name, [user-profile-dir]
|
||||
extern "C" _declspec(dllexport) char* GetNSUserProfile(char* profileName);
|
||||
|
||||
//returns absolute path to pref.js in [user-profile-dir]
|
||||
extern "C" _declspec(dllexport) char* GetNSUserProfileJS(char* profileName);
|
||||
|
||||
//appends "path_to_isp.js" to "[install-dir]\defaults\pref\target-default-pref-filename".
|
||||
//When "target-default-pref-filename" is not specified, i.e., "null", the default is "all-ns.js".
|
||||
extern "C" _declspec(dllexport) int AppendDefaultPref(char* templateFileAbsoutePath, char* prefDefaultFileName);
|
||||
|
||||
//appends "path_to_isp.js" to "[user-profile-dir]\target-default-user-filename".
|
||||
//When "target-default-user-filename" is not specified, i.e., "null", the default is
|
||||
//"prefs.js". Npte that the JS function. "pref()" in "isp.js" needs to be converted
|
||||
//into "user_pref()" before appended to "target-user-pref-filename".
|
||||
extern "C" _declspec(dllexport) int AppendUserPref(char* templateFileAbsoutePath, char* profileName);
|
18
embedding/tests/winEmbed/dcck.rc
Normal file
18
embedding/tests/winEmbed/dcck.rc
Normal file
@ -0,0 +1,18 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#define IDI_DCCK 1
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_DCCK ICON DISCARDABLE "setup.ICO"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
67
embedding/tests/winEmbed/isp.js
Normal file
67
embedding/tests/winEmbed/isp.js
Normal file
@ -0,0 +1,67 @@
|
||||
//append mail and news accounts, establish internal server IDs
|
||||
user_pref("mail.accountmanager.appendaccounts", "vendor_mail_account,vendor_news_account");
|
||||
user_pref("mail.account.vendor_mail_account.identities", "vendor_mail");
|
||||
user_pref("mail.account.vendor_news_account.identities", "vendor_news");
|
||||
|
||||
|
||||
//server IDs
|
||||
user_pref("mail.account.vendor_mail_account.server", "vendor_mail_server");
|
||||
user_pref("mail.identity.vendor_mail.smtpServer", "vendor_smtp_server");
|
||||
user_pref("mail.smtpservers.appendsmtpservers", "vendor_smtp_server");
|
||||
user_pref("mail.smtp.defaultserver", "vendor_smtp_server");
|
||||
user_pref("mail.account.vendor_news_account.server", "vendor_news_server");
|
||||
|
||||
|
||||
//------------------------ server settigs ------------------------------
|
||||
|
||||
//mail
|
||||
user_pref("mail.server.vendor_mail_server.name", "Vendor Mail");
|
||||
user_pref("mail.server.vendor_mail_server.hostname", "vendor-mail-host-name");
|
||||
user_pref("mail.server.vendor_mail_server.type", "imap");
|
||||
user_pref("mail.smtpserver.vendor_smtp_server.hostname", "vendor-smtp-host-name");
|
||||
|
||||
//news
|
||||
user_pref("mail.server.vendor_news_server.name", "Vendor News Account");
|
||||
user_pref("mail.server.vendor_news_server.type", "nntp");
|
||||
user_pref("mail.server.vendor_news_server.hostname", "vendor-news-host-name");
|
||||
|
||||
//------------------------ server settigs ------------------------------
|
||||
|
||||
|
||||
//account setup wizard settings
|
||||
user_pref("mail.identity.vendor_mail.smtpRequiresUsername", true);
|
||||
user_pref("mail.identity.vendor_mail.wizardSkipPanels", true);
|
||||
user_pref("mail.identity.vendor_mail.valid", false);
|
||||
|
||||
|
||||
//news setup wizard settings
|
||||
user_pref("mail.identity.vendor_news.valid", false);
|
||||
user_pref("mail.identity.vendor_news.wizardSkipPanels", true);
|
||||
|
||||
|
||||
//mail account functional settings
|
||||
user_pref("mail.server.vendor_mail_server.login_at_startup", false);
|
||||
user_pref("mail.server.vendor_mail_server.capability", 97087);
|
||||
user_pref("mail.server.vendor_mail_server.max_cached_connections", 5);
|
||||
|
||||
|
||||
//mail folder settings
|
||||
user_pref("mail.identity.vendor_mail.drafts_folder_picker_mode", "0");
|
||||
user_pref("mail.identity.vendor_mail.fcc_folder_picker_mode", "0");
|
||||
user_pref("mail.identity.vendor_mail.tmpl_folder_picker_mode", "0");
|
||||
|
||||
|
||||
//news account functional settings
|
||||
user_pref("mail.server.vendor_news_server.login_at_startup", true);
|
||||
user_pref("mail.identity.vendor_news.compose_html", false);
|
||||
|
||||
|
||||
//configuration file. please replace both "netscp" and
|
||||
//"netscp.cfg" by "vendor" and "vendor.cfg", if needed
|
||||
user_pref("general.config.vendor", "netscp");
|
||||
user_pref("general.config.filename", "netscp.cfg");
|
||||
|
||||
|
||||
//DO NOT MODIFY THIS SECTION
|
||||
user_pref("mail.preconfigaccounts.added", false);
|
||||
user_pref("mail.preconfigsmtpservers.added", false);
|
BIN
embedding/tests/winEmbed/setup.ICO
Normal file
BIN
embedding/tests/winEmbed/setup.ICO
Normal file
Binary file not shown.
After Width: | Height: | Size: 766 B |
Loading…
Reference in New Issue
Block a user