removing code after move to mozilla/minimo

git-svn-id: svn://10.0.0.236/trunk@177147 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dougt%meer.net 2005-08-05 00:09:54 +00:00
parent d9b52cd905
commit ee4f6be558
20 changed files with 1 additions and 1573 deletions

View File

@ -1,130 +0,0 @@
# ***** 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):
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MOZILLA_INTERNAL_API = 1
PROGRAM = minimo$(BIN_SUFFIX)
MODULE = minimo
REQUIRES = xpcom \
appshell \
string \
embed_base \
webbrwsr \
webshell \
windowwatcher \
profile \
necko \
docshell \
dom \
widget \
uriloader \
shistory \
webbrowserpersist \
gfx \
layout \
content \
profdirserviceprovider \
pref \
embedcomponents \
appcomps \
phone \
$(NULL)
CPPSRCS = \
winEmbed.cpp \
WindowCreator.cpp \
SplashScreen.cpp \
nsConsoleWriter.cpp \
$(NULL)
# this should move into the toolkit!
CPPSRCS += nsBrowserStatusFilter.cpp
RCINCLUDE = SplashScreen.rc
EXTRA_DSO_LIBS = embed_base_s profdirserviceprovider_s
LIBS = \
$(EXTRA_DSO_LIBS) \
$(MOZ_UNICHARUTIL_LIBS) \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \
$(MOZ_JS_LIBS) \
$(NULL)
LOCAL_INCLUDES = -I$(srcdir) -I$(topsrcdir)/xpfe/browser/src/
include $(topsrcdir)/config/config.mk
ifdef WINCE
OS_LIBS += $(call EXPAND_LIBNAME, aygshell cellcore)
endif
ifdef BUILD_STATIC_LIBS
FINAL_LINK_COMPS=$(topsrcdir)/embedding/minimo/wince/minimo-link-comps
FINAL_LINK_COMP_NAMES=$(topsrcdir)/embedding/minimo/wince/minimo-link-names
FINAL_LINK_LIBS=$(topsrcdir)/embedding/minimo/wince/minimo-link-libs
include $(topsrcdir)/config/static-config.mk
EXTRA_DEPS += $(STATIC_EXTRA_DEPS)
EXTRA_DSO_LIBS += $(STATIC_EXTRA_DSO_LIBS)
EXTRA_LIBS += $(EXTRA_DSO_LIBS) $(STATIC_EXTRA_LIBS)
DEFINES += $(STATIC_DEFINES)
CPPSRCS += $(STATIC_CPPSRCS)
endif # BUILD_STATIC_LIBS
include $(topsrcdir)/config/rules.mk
ifdef BUILD_STATIC_LIBS
include $(topsrcdir)/config/static-rules.mk
endif # BUILD_STATIC_LIBS
export::
$(NSINSTALL) $(topsrcdir)/xpfe/browser/src/nsBrowserStatusFilter.cpp .
GARBAGE += nsBrowserStatusFilter.cpp
installer::
bash $(srcdir)/package.sh $(MOZ_BUILD_ROOT) $(srcdir)

View File

@ -1,94 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* 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 Minimo.
*
* The Initial Developer of the Original Code is
* Doug Turner <dougt@meer.net>.
* Portions created by the Initial Developer are Copyright (C) 2005
* 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 MPL, 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 MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef MINIMO_PRIVATE_H
#define MINIMO_PRIVATE_H
// C RunTime Header Files
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
// Mozilla header files
#include "nsAppDirectoryServiceDefs.h"
#include "nsAppShellCID.h"
#include "nsDirectoryService.h"
#include "nsDirectoryServiceDefs.h"
#include "nsEmbedAPI.h"
#include "nsEmbedCID.h"
#include "nsIAppShell.h"
#include "nsIAppShellService.h"
#include "nsIAppStartupNotifier.h"
#include "nsIClipboardCommands.h"
#include "nsIComponentRegistrar.h"
#include "nsIDOMWindow.h"
#include "nsIEventQueueService.h"
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIObserver.h"
#include "nsIObserverService.h"
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"
#include "nsIPromptService.h"
#include "nsITimelineService.h"
#include "nsIURI.h"
#include "nsIWebBrowserChrome.h"
#include "nsIWebBrowserFocus.h"
#include "nsIWebBrowserPersist.h"
#include "nsIWidget.h"
#include "nsIWindowCreator.h"
#include "nsIWindowCreator2.h"
#include "nsIWindowWatcher.h"
#include "nsIXULWindow.h"
#include "nsProfileDirServiceProvider.h"
#include "nsWidgetsCID.h"
#include "nsXPIDLString.h"
#include "plstr.h"
// Local header files
#include "WindowCreator.h"
void CreateSplashScreen();
void KillSplashScreen();
void GetScreenSize(unsigned long* x, unsigned long* y);
void WriteConsoleLog();
#include "nsBrowserStatusFilter.h"
#endif // MINIMO_PRIVATE_H

View File

@ -0,0 +1 @@
Moved to mozilla/minimo.

View File

@ -1,144 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* 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 Minimo.
*
* The Initial Developer of the Original Code is
* Doug Turner <dougt@meer.net>.
* Portions created by the Initial Developer are Copyright (C) 2005
* 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 MPL, 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 MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "MinimoPrivate.h"
#ifdef WINCE
#include "resource.h"
static HWND gSplashScreenDialog = NULL;
BOOL CALLBACK
SplashScreenDialogProc( HWND dlg, UINT msg, WPARAM wp, LPARAM lp )
{
if ( msg == WM_INITDIALOG )
{
SetWindowText(dlg, "Minimo");
gSplashScreenDialog = dlg;
HWND bitmapControl = GetDlgItem( dlg, IDC_SPLASHBMP );
if ( bitmapControl )
{
HBITMAP hbitmap = (HBITMAP)SendMessage( bitmapControl,
STM_GETIMAGE,
IMAGE_BITMAP,
0 );
if ( hbitmap )
{
BITMAP bitmap;
if ( GetObject( hbitmap, sizeof bitmap, &bitmap ) )
{
SetWindowPos( dlg,
NULL,
GetSystemMetrics(SM_CXSCREEN)/2 - bitmap.bmWidth/2,
GetSystemMetrics(SM_CYSCREEN)/2 - bitmap.bmHeight/2,
bitmap.bmWidth,
bitmap.bmHeight,
SWP_NOZORDER );
ShowWindow( dlg, SW_SHOW );
}
}
}
return 1;
}
else if (msg == WM_CLOSE)
{
NS_TIMELINE_MARK_FUNCTION("SplashScreenDialogProc Close");
EndDialog(dlg, 0);
gSplashScreenDialog = NULL;
}
return 0;
}
DWORD WINAPI SplashScreenThreadProc(LPVOID notused)
{
DialogBoxParamW( GetModuleHandle( 0 ),
MAKEINTRESOURCE( IDD_SPLASHSCREEN ),
HWND_DESKTOP,
(DLGPROC)SplashScreenDialogProc,
NULL );
return 0;
}
void KillSplashScreen()
{
NS_TIMELINE_MARK_FUNCTION("KillSplashScreen");
if (gSplashScreenDialog)
{
EndDialog((HWND)gSplashScreenDialog, 0);
gSplashScreenDialog = NULL;
}
}
void CreateSplashScreen()
{
NS_TIMELINE_MARK_FUNCTION("CreateSplashScreen");
DWORD threadID;
HANDLE handle = CreateThread( 0,
0,
(LPTHREAD_START_ROUTINE)SplashScreenThreadProc,
0,
0,
&threadID );
CloseHandle(handle);
}
void GetScreenSize(unsigned long* x, unsigned long* y)
{
RECT workarea;
SystemParametersInfo(SPI_GETWORKAREA, 0, &workarea, 0);
*x = workarea.right - workarea.left;
*y = workarea.bottom - workarea.top;
}
#else
void CreateSplashScreen() {}
void KillSplashScreen() {}
void GetScreenSize(unsigned long* x, unsigned long* y)
{
*x = *y = 0;
}
#endif // WINCE

View File

@ -1,13 +0,0 @@
#include "resource.h"
#include "newres.h"
IDD_SPLASHSCREEN DIALOG DISCARDABLE 0, 0, 31, 27
STYLE DS_MODALFRAME | WS_POPUP
FONT 8, "System"
BEGIN
CONTROL 104,IDC_SPLASHBMP,"Static",SS_BITMAP,7,7,15,13
END
IDB_BITMAP1 BITMAP DISCARDABLE "splashscreen.bmp"

View File

@ -1,102 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* 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 Minimo.
*
* The Initial Developer of the Original Code is
* Doug Turner <dougt@meer.net>.
* Portions created by the Initial Developer are Copyright (C) 2005
* 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 MPL, 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 MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "MinimoPrivate.h"
NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
WindowCreator::WindowCreator(nsIAppShell* aAppShell)
{
mAppShell = aAppShell;
}
WindowCreator::~WindowCreator()
{
}
NS_IMPL_ISUPPORTS2(WindowCreator, nsIWindowCreator, nsIWindowCreator2)
NS_IMETHODIMP
WindowCreator::CreateChromeWindow(nsIWebBrowserChrome *aParent,
PRUint32 aChromeFlags,
nsIWebBrowserChrome **_retval)
{
PRBool cancel;
return CreateChromeWindow2(aParent, aChromeFlags, 0, 0, &cancel, _retval);
}
NS_IMETHODIMP
WindowCreator::CreateChromeWindow2(nsIWebBrowserChrome *aParent,
PRUint32 aChromeFlags,
PRUint32 aContextFlags,
nsIURI *aURI,
PRBool *aCancel,
nsIWebBrowserChrome **aNewWindow)
{
*aCancel = PR_FALSE;
if (!mAppShell)
return NS_ERROR_NOT_INITIALIZED;
nsCOMPtr<nsIXULWindow> newWindow;
nsCOMPtr<nsIAppShellService> appShell(do_GetService(NS_APPSHELLSERVICE_CONTRACTID));
if (!appShell)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIXULWindow> xulParent(do_GetInterface(aParent));
unsigned long x, y;
GetScreenSize(&x, &y);
appShell->CreateTopLevelWindow(xulParent,
0,
aChromeFlags,
x,
y,
mAppShell,
getter_AddRefs(newWindow));
// if anybody gave us anything to work with, use it
if (newWindow) {
newWindow->SetContextFlags(aContextFlags);
nsCOMPtr<nsIInterfaceRequestor> thing(do_QueryInterface(newWindow));
if (thing)
CallGetInterface(thing.get(), aNewWindow);
}
return *aNewWindow ? NS_OK : NS_ERROR_FAILURE;
}

View File

@ -1,57 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* 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 Minimo.
*
* The Initial Developer of the Original Code is
* Doug Turner <dougt@meer.net>.
* Portions created by the Initial Developer are Copyright (C) 2005
* 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 MPL, 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 MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __WindowCreator_h_
#define __WindowCreator_h_
#include "MinimoPrivate.h"
class WindowCreator : public nsIWindowCreator2
{
public:
WindowCreator(nsIAppShell* aAppShell);
virtual ~WindowCreator();
NS_DECL_ISUPPORTS
NS_DECL_NSIWINDOWCREATOR
NS_DECL_NSIWINDOWCREATOR2
nsCOMPtr<nsIAppShell> mAppShell;
};
#endif

View File

@ -1,156 +0,0 @@
pref("general.useragent.extra.minimo", "Minimo/0.007");
pref("browser.active_color", "#EE0000");
pref("browser.anchor_color", "#0000EE");
pref("browser.blink_allowed", true);
pref("browser.block.target_new_window", false);
pref("browser.cache.check_doc_frequency", 3);
pref("browser.cache.memory.capacity", 256);
pref("browser.cache.memory.enable", true);
pref("browser.display.background_color", "#FFFFFF");
pref("browser.display.focus_background_color", "#117722");
pref("browser.display.focus_ring_on_anything", false);
pref("browser.display.focus_ring_width", 1);
pref("browser.display.focus_text_color", "#ffffff");
pref("browser.display.force_inline_alttext", false);
pref("browser.display.foreground_color", "#000000");
pref("browser.display.normal_lineheight_calc_control", 2);
pref("browser.display.show_image_placeholders", true);
pref("browser.display.use_document_colors", true);
pref("browser.display.use_document_fonts", 1);
pref("browser.display.use_focus_colors", false);
pref("browser.display.use_system_colors", false);
pref("browser.enable_automatic_image_resizing", false);
pref("browser.fixup.alternate.enabled", true);
pref("browser.fixup.alternate.prefix", "www.");
pref("browser.fixup.alternate.suffix", ".com");
pref("browser.fixup.hide_user_pass", true);
pref("browser.forms.submit.backwards_compatible", true);
pref("browser.frames.enabled", true);
pref("browser.sessionhistory.max_entries", 4);
pref("browser.throbber.url","chrome://navigator-region/locale/region.properties");
pref("browser.underline_anchors", true);
pref("browser.visited_color", "#551A8B");
pref("clipboard.autocopy", false);
pref("dom.allow_scripts_to_close_windows", false);
pref("dom.disable_image_src_set", false);
pref("dom.disable_open_during_load", false);
pref("dom.disable_window_flip", false);
pref("dom.disable_window_move_resize", false);
pref("dom.disable_window_open_feature.close", false);
pref("dom.disable_window_open_feature.directories", false);
pref("dom.disable_window_open_feature.location", false);
pref("dom.disable_window_open_feature.menubar", false);
pref("dom.disable_window_open_feature.minimizable", false);
pref("dom.disable_window_open_feature.personalbar", false);
pref("dom.disable_window_open_feature.resizable", false);
pref("dom.disable_window_open_feature.scrollbars", false);
pref("dom.disable_window_open_feature.status", false);
pref("dom.disable_window_open_feature.titlebar", false);
pref("dom.disable_window_open_feature.toolbar", false);
pref("dom.disable_window_status_change", false);
pref("image.animation_mode", "normal");
pref("images.dither", "auto");
pref("intl.accept_charsets", "iso-8859-1,*,utf-8");
pref("intl.accept_languages", "chrome://navigator/locale/navigator.properties");
pref("intl.accept_languages", "chrome://navigator/locale/navigator.properties");
pref("intl.charset.default", "chrome://navigator-platform/locale/navigator.properties");
pref("intl.charset.detector", "chrome://navigator/locale/navigator.properties");
pref("intl.collationOption", "chrome://navigator-platform/locale/navigator.properties");
pref("intl.content.langcode", "chrome://communicator-region/locale/region.properties");
pref("intl.fallbackCharsetList.ISO-8859-1", "windows-1252");
pref("intl.locale.matchOS", false);
pref("intl.menuitems.alwaysappendaccesskeys","chrome://navigator/locale/navigator.properties");
pref("intl.menuitems.insertseparatorbeforeaccesskeys","chrome://navigator/locale/navigator.properties");
pref("javascript.enabled", true);
pref("javascript.options.showInConsole", true);
pref("javascript.options.strict", false);
pref("keyword.enabled", true);
pref("layout.frames.force_resizability", false);
pref("layout.word_select.eat_space_to_next_word", false);
pref("layout.word_select.stop_at_punctuation", true);
pref("network.cookie.cookieBehavior", 0);
pref("network.cookie.disableCookieForMailNews", true);
pref("network.cookie.lifetime.behavior", 0);
pref("network.cookie.lifetime.days", 90);
pref("network.cookie.lifetime.enabled", false);
pref("network.cookie.warnAboutCookies", false);
pref("network.enableIDN", false);
pref("network.http.accept-encoding" ,"gzip,deflate");
pref("network.http.accept.default", "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1");
pref("network.http.default-socket-type", "");
pref("network.http.keep-alive", false);
pref("network.http.keep-alive.timeout", 300);
pref("network.http.max-connections", 2);
pref("network.http.max-connections-per-server", 2);
pref("network.http.max-persistent-connections-per-proxy", 2);
pref("network.http.max-persistent-connections-per-server", 2);
pref("network.http.pipelining" , false);
pref("network.http.pipelining.firstrequest", false);
pref("network.http.pipelining.maxrequests" , 4);
pref("network.http.proxy.keep-alive", true);
pref("network.http.proxy.pipelining", false);
pref("network.http.proxy.version", "1.1");
pref("network.http.redirection-limit", 20);
pref("network.http.request.max-start-delay", 10);
pref("network.http.sendRefererHeader", 2);
pref("network.http.sendSecureXSiteReferrer", true);
pref("network.http.use-cache", false);
pref("network.http.version", "1.1");
pref("network.image.imageBehavior", 0);
pref("network.image.warnAboutImages", false);
pref("network.online", true);
pref("network.prefetch-next", false);
pref("network.protocol-handler.expose-all", true);
pref("network.protocol-handler.external-default", true);
pref("network.protocol-handler.external.data", false);
pref("network.protocol-handler.external.disk", false);
pref("network.protocol-handler.external.hcp", false);
pref("network.protocol-handler.external.help", false);
pref("network.protocol-handler.external.javascript", false);
pref("network.protocol-handler.external.ms-help", false);
pref("network.protocol-handler.external.vbscript", false);
pref("network.protocol-handler.external.vnd.ms.radio", false);
pref("network.protocol-handler.warn-external-default", true);
pref("network.proxy.autoconfig_url", "");
pref("network.proxy.ftp", "");
pref("network.proxy.ftp_port", 0);
pref("network.proxy.gopher", "");
pref("network.proxy.gopher_port", 0);
pref("network.proxy.http", "");
pref("network.proxy.http_port", 0);
pref("network.proxy.no_proxies_on", "localhost, 127.0.0.1");
pref("network.proxy.socks", "");
pref("network.proxy.socks_port", 0);
pref("network.proxy.socks_version", 5);
pref("network.proxy.ssl", "");
pref("network.proxy.ssl_port", 0);
pref("network.proxy.type", 0);
pref("network.standard-url.escape-utf8", true);
pref("nglayout.debug.enable_xbl_forms", false);
pref("nglayout.events.dispatchLeftClickOnly", true);
pref("prefs.converted-to-utf8",false);
pref("security.checkloaduri", true);
pref("security.enable_java", false);
pref("security.xpconnect.plugin.unrestricted", true);
pref("signed.applets.codebase_principal_support", false);
pref("slider.snapMultiplier", 0);
pref("ui.key.accelKey", 17);
pref("ui.key.generalAccessKey", 18);
pref("ui.key.menuAccessKey", 18);
pref("ui.key.menuAccessKeyFocuses", false);
pref("ui.key.saveLink.shift", true);
pref("viewmanager.do_doublebuffering", true);
pref("security.warn_entering_secure", false);
pref("security.warn_entering_weak", false);
pref("security.warn_leaving_secure", false);
pref("security.warn_submit_insecure", false);
pref("network.autodial-helper.enabled", true);
pref("config.wince.useOKBtn", true);

View File

@ -1,32 +0,0 @@
xpconect
mozuconv
i18n
necko
jar50
rdf
pref
caps
gkparser
gkgfxwin
imglib2
gkwidget
gklayout
docshell
embedcmp
webbrwsr
texteditor
txmgr
appshell
chrome
mork
tkitcmps
xmlextra
t8iix
websrvcs
gkplugin
softkey
pipboot
pipnss
pippki
phone
snav

View File

@ -1,4 +0,0 @@
unicharutil_s
ucvutil_s
gfxshared_s
gkgfx

View File

@ -1,32 +0,0 @@
xpconnect
nsUConvModule
nsI18nModule
necko_core_and_primary_protocols
nsJarModule
nsPrefModule
nsSecurityManagerModule
nsRDFModule
nsParserModule
nsGfxModule
nsImageLib2Module
nsPluginModule
nsWidgetModule
nsLayoutModule
docshell_provider
embedcomponents
Browser_Embedding_Module
nsEditorModule
nsTransactionManagerModule
appshell
nsChromeModule
nsMorkModule
nsToolkitCompsModule
nsXMLExtrasModule
TransformiixModule
nsWebServicesModule
SoftKeyBoardModule
BOOT
NSS
PKI
nsPhoneSupportModule
SpatialNavigationModule

View File

@ -1,35 +0,0 @@
mk_add_options NSPR_CO_TAG=NSPRPUB_PRE_4_2_WINCE_BRANCH
mk_add_options NSS_CO_TAG=NSS_WINCE_CLIENT_TAG
mk_add_options MOZ_CO_PROJECT=minimo
ac_add_options --enable-application=minimo
CROSS_COMPILE=1
CXX=arm-wince-gcc
LD=arm-wince-link
AR=arm-wince-lib
AS=arm-wince-as
mk_add_options AR=arm-wince-lib
ac_add_options --target=arm-wince
ac_add_options --enable-win32-target=WINCE
ac_add_options --enable-default-toolkit=windows
WINCE=1
mk_add_options WINCE=1
TARGET_DEVICE=device
mk_add_options TARGET_DEVICE=device
# code generation options (optimize for size)
ac_add_options --enable-strip
ac_add_options --disable-debug
ac_add_options --enable-optimize=-O1
# enable static build
ac_add_options --disable-shared
ac_add_options --enable-static
# ac_add_options --enable-timeline

View File

@ -1,36 +0,0 @@
mk_add_options NSPR_CO_TAG=NSPRPUB_PRE_4_2_WINCE_BRANCH
mk_add_options NSS_CO_TAG=NSS_WINCE_CLIENT_TAG
mk_add_options MOZ_CO_PROJECT=minimo
ac_add_options --enable-application=minimo
CROSS_COMPILE=1
CXX=arm-wince-gcc
LD=arm-wince-link
AR=arm-wince-lib
AS=arm-wince-as
mk_add_options AR=arm-wince-lib
ac_add_options --target=arm-wince
ac_add_options --enable-win32-target=WINCE
ac_add_options --enable-default-toolkit=windows
WINCE=1
mk_add_options WINCE=1
TARGET_DEVICE=emulator
mk_add_options TARGET_DEVICE=emulator
# code generation options (optimize for size)
ac_add_options --enable-strip
ac_add_options --disable-debug
ac_add_options --enable-optimize
# enable static build
ac_add_options --disable-shared
ac_add_options --enable-static
#xptcall busted
ac_add_options --disable-jsloader

View File

@ -1,41 +0,0 @@
#ifndef __NEWRES_H__
#define __NEWRES_H__
#if !defined(UNDER_CE)
#define UNDER_CE _WIN32_WCE
#endif
#if defined(_WIN32_WCE)
#if !defined(WCEOLE_ENABLE_DIALOGEX)
#define DIALOGEX DIALOG DISCARDABLE
#endif
#include <commctrl.h>
#define SHMENUBAR RCDATA
#if defined(WIN32_PLATFORM_PSPC) && (_WIN32_WCE >= 300)
#include <aygshell.h>
#define AFXCE_IDR_SCRATCH_SHMENU 28700
#else
#define I_IMAGENONE (-2)
#define NOMENU 0xFFFF
#define IDS_SHNEW 1
#define IDM_SHAREDNEW 10
#define IDM_SHAREDNEWDEFAULT 11
#endif // _WIN32_WCE_PSPC
#define AFXCE_IDD_SAVEMODIFIEDDLG 28701
#endif // _WIN32_WCE
#ifdef RC_INVOKED
#ifndef _INC_WINDOWS
#define _INC_WINDOWS
#include "winuser.h" // extract from windows header
#include "winver.h"
#endif
#endif
#ifdef IDC_STATIC
#undef IDC_STATIC
#endif
#define IDC_STATIC (-1)
#endif //__NEWRES_H__

View File

@ -1,118 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* 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 Toolkit.
*
* The Initial Developer of the Original Code is
* Benjamin Smedberg <benjamin@smedbergs.us>
* Portions created by the Initial Developer are Copyright (C) 2005
* 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 MPL, 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 MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "prio.h"
#include "prprf.h"
#include "prtime.h"
#include "prenv.h"
#include "nsCOMPtr.h"
#include "nsCRT.h"
#include "nsNativeCharsetUtils.h"
#include "nsString.h"
#include "nsILocalFile.h"
#include "nsIConsoleService.h"
#include "nsIConsoleMessage.h"
#include "nsDirectoryServiceDefs.h"
#include "nsDirectoryServiceUtils.h"
void
WriteConsoleLog()
{
nsresult rv;
nsCOMPtr<nsIFile> file;
NS_GetSpecialDirectory(NS_OS_CURRENT_PROCESS_DIR, getter_AddRefs(file));
if (!file)
return;
file->Append(NS_LITERAL_STRING("jsconsole.log"));
nsCOMPtr<nsILocalFile> lfile = do_QueryInterface(file);
PRFileDesc *fdesc;
rv = lfile->OpenNSPRFileDesc(PR_WRONLY | PR_APPEND | PR_CREATE_FILE, 0660, &fdesc);
if (NS_FAILED(rv))
return;
nsCOMPtr<nsIConsoleService> csrv
(do_GetService(NS_CONSOLESERVICE_CONTRACTID));
if (!csrv) {
PR_Close(fdesc);
return;
}
nsIConsoleMessage** messages;
PRUint32 mcount;
rv = csrv->GetMessageArray(&messages, &mcount);
if (NS_FAILED(rv)) {
PR_Close(fdesc);
return;
}
if (mcount) {
PRExplodedTime etime;
PR_ExplodeTime(PR_Now(), PR_LocalTimeParameters, &etime);
char datetime[512];
PR_FormatTimeUSEnglish(datetime, sizeof(datetime),
"%Y-%m-%d %H:%M:%S", &etime);
PR_fprintf(fdesc, NS_LINEBREAK
"*** Console log: %s ***" NS_LINEBREAK,
datetime);
}
// From this point on, we have to release all the messages, and free
// the memory allocated for the messages array. XPCOM arrays suck.
nsXPIDLString msg;
nsCAutoString nativemsg;
for (PRUint32 i = 0; i < mcount; ++i) {
rv = messages[i]->GetMessage(getter_Copies(msg));
if (NS_SUCCEEDED(rv)) {
NS_CopyUnicodeToNative(msg, nativemsg);
PR_fprintf(fdesc, "%s" NS_LINEBREAK, nativemsg.get());
}
NS_IF_RELEASE(messages[i]);
}
PR_Close(fdesc);
NS_Free(messages);
}

View File

@ -1,132 +0,0 @@
#!/bin/bash
if [ $# -ne 2 ]
then
echo "Usage: `basename $0` OBJDIR SRCDIR"
exit $E_BADARGS
fi
OBJDIR=$1
SRCDIR=$2
echo ---------------------------------------------------
echo OBJDIR = $OBJDIR
echo SRCDIR = $SRCDIR
echo ---------------------------------------------------
pushd $OBJDIR/dist
rm -rf wince
rm -f wince.zip
echo Copying over files from OBJDIR
mkdir wince
cp -a bin/js3250.dll wince
cp -a bin/minimo.exe wince
cp -a bin/nspr4.dll wince
cp -a bin/plc4.dll wince
cp -a bin/plds4.dll wince
cp -a bin/xpcom.dll wince
cp -a bin/xpcom_core.dll wince
cp -a bin/nss3.dll wince
cp -a bin/nssckbi.dll wince
cp -a bin/smime3.dll wince
cp -a bin/softokn3.dll wince
cp -a bin/ssl3.dll wince
mkdir -p wince/chrome
cp -a bin/chrome/classic.jar wince/chrome
cp -a bin/chrome/classic.manifest wince/chrome
cp -a bin/chrome/en-US.jar wince/chrome
cp -a bin/chrome/en-US.manifest wince/chrome
cp -a bin/chrome/minimo.jar wince/chrome
cp -a bin/chrome/toolkit.jar wince/chrome
cp -a bin/chrome/toolkit.manifest wince/chrome
cp -a bin/chrome/pippki.jar wince/chrome
cp -a bin/chrome/pippki.manifest wince/chrome
cp -a bin/chrome/installed-chrome.txt wince/chrome
mkdir -p wince/components
cp -a bin/components/nsHelperAppDlg.js wince/components
cp -a bin/components/nsProgressDialog.js wince/components
cp -a bin/components/nsDictionary.js wince/components
cp -a bin/components/nsInterfaceInfoToIDL.js wince/components
cp -a bin/components/nsXmlRpcClient.js wince/components
cp -a bin/extensions/spatial-navigation@extensions.mozilla.org/components/* wince/components
mkdir -p wince/greprefs
cp -a bin/greprefs/* wince/greprefs
mkdir -p wince/res
cp -a bin/res/* wince/res
rm -rf wince/res/samples
rm -rf wince/res/throbber
mkdir -p wince/plugins
echo Linking XPT files.
host/bin/host_xpt_link wince/components/all.xpt bin/components/*.xpt
echo Chewing on chrome
cd wince/chrome
unzip classic.jar
rm -rf classic.jar
rm -rf skin/classic/communicator
rm -rf skin/classic/editor
rm -rf skin/classic/messenger
rm -rf skin/classic/navigator
zip -r classic.jar skin
rm -rf skin
unzip en-US.jar
rm -rf en-US.jar
rm -rf locale/en-US/communicator
rm -rf locale/en-US/navigator
zip -r en-US.jar locale
rm -rf locale
echo Copying over customized files
popd
pushd $SRCDIR
cp -a all.js $OBJDIR/dist/wince/greprefs
echo Applying SSR
cat ../smallScreen.css >> $OBJDIR/dist/wince/res/ua.css
echo Copying ARM shunt lib. Adjust if you are not building ARM
cp -a ../../../build/wince/shunt/build/ARMV4Rel/shunt.dll $OBJDIR/dist/wince
echo Rebasing
pushd $OBJDIR/dist/wince
rebase -b 0x0100000 -R . -v *.dll components/*.dll
echo Zipping
zip -r $OBJDIR/dist/wince.zip $OBJDIR/dist/wince
popd
echo Done.

View File

@ -1,41 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* 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 Minimo.
*
* The Initial Developer of the Original Code is
* Doug Turner <dougt@meer.net>.
* Portions created by the Initial Developer are Copyright (C) 2005
* 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 MPL, 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 MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#define IDD_SPLASHSCREEN 101
#define IDB_BITMAP1 104
#define IDC_SPLASHBMP 1001

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

View File

@ -1 +0,0 @@
0.007

View File

@ -1,405 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* 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 Minimo.
*
* The Initial Developer of the Original Code is
* Doug Turner <dougt@meer.net>.
* Portions created by the Initial Developer are Copyright (C) 2005
* 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 MPL, 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 MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "MinimoPrivate.h"
#ifdef _BUILD_STATIC_BIN
#include "nsStaticComponents.h"
#endif
// Global variables
const static char* start_url = "chrome://minimo/content/minimo.xul";
//const static char* start_url = "http://www.meer.net/~dougt/test.html";
//const static char* start_url = "resource://gre/res/start.html";
PRBool gDumpJSConsole = PR_FALSE;
static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
class nsBrowserStatusFilterFactory : public nsIFactory
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIFACTORY
nsBrowserStatusFilterFactory();
~nsBrowserStatusFilterFactory() { }
};
nsBrowserStatusFilterFactory::nsBrowserStatusFilterFactory()
{
}
NS_IMPL_ISUPPORTS1(nsBrowserStatusFilterFactory, nsIFactory)
NS_IMETHODIMP
nsBrowserStatusFilterFactory::CreateInstance(nsISupports* aOuter,
const nsIID& aIID,
void* *aResult)
{
NS_ENSURE_NO_AGGREGATION(aOuter);
nsBrowserStatusFilter* filter = new nsBrowserStatusFilter();
if (!filter)
return NS_ERROR_OUT_OF_MEMORY;
nsresult rv = filter->QueryInterface(aIID, aResult);
if (NS_FAILED(rv))
delete filter;
return rv;
}
NS_IMETHODIMP
nsBrowserStatusFilterFactory::LockFactory(PRBool)
{
return NS_OK;
}
class ApplicationObserver: public nsIObserver
{
public:
ApplicationObserver(nsIAppShell* aAppShell);
~ApplicationObserver();
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
nsCOMPtr<nsIAppShell> mAppShell;
int mWindowCount;
};
ApplicationObserver::ApplicationObserver(nsIAppShell* aAppShell)
{
mAppShell = aAppShell;
mWindowCount = 0;
nsCOMPtr<nsIObserverService> os = do_GetService("@mozilla.org/observer-service;1");
os->AddObserver(this, "nsIEventQueueActivated", PR_FALSE);
os->AddObserver(this, "nsIEventQueueDestroyed", PR_FALSE);
os->AddObserver(this, "xul-window-registered", PR_FALSE);
os->AddObserver(this, "xul-window-destroyed", PR_FALSE);
os->AddObserver(this, "xul-window-visible", PR_FALSE);
}
ApplicationObserver::~ApplicationObserver()
{
}
NS_IMPL_ISUPPORTS1(ApplicationObserver, nsIObserver)
NS_IMETHODIMP
ApplicationObserver::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData)
{
if (!strcmp(aTopic, "nsIEventQueueActivated"))
{
nsCOMPtr<nsIEventQueue> eq(do_QueryInterface(aSubject));
if (eq)
{
PRBool isNative = PR_TRUE;
// we only add native event queues to the appshell
eq->IsQueueNative(&isNative);
if (isNative)
mAppShell->ListenToEventQueue(eq, PR_TRUE);
}
}
else if (!strcmp(aTopic, "nsIEventQueueDestroyed"))
{
nsCOMPtr<nsIEventQueue> eq(do_QueryInterface(aSubject));
if (eq)
{
PRBool isNative = PR_TRUE;
// we only remove native event queues from the appshell
eq->IsQueueNative(&isNative);
if (isNative)
mAppShell->ListenToEventQueue(eq, PR_FALSE);
}
}
else if (!strcmp(aTopic, "xul-window-visible"))
{
KillSplashScreen();
}
else if (!strcmp(aTopic, "xul-window-registered"))
{
mWindowCount++;
}
else if (!strcmp(aTopic, "xul-window-destroyed"))
{
mWindowCount--;
if (mWindowCount == 0)
mAppShell->Exit();
}
return NS_OK;
}
nsresult StartupProfile()
{
NS_TIMELINE_MARK_FUNCTION("Profile Startup");
nsCOMPtr<nsIFile> appDataDir;
nsresult rv = NS_GetSpecialDirectory(NS_APP_APPLICATION_REGISTRY_DIR, getter_AddRefs(appDataDir));
if (NS_FAILED(rv))
return rv;
rv = appDataDir->Append(NS_LITERAL_STRING("minimo"));
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsILocalFile> localAppDataDir(do_QueryInterface(appDataDir));
nsCOMPtr<nsProfileDirServiceProvider> locProvider;
NS_NewProfileDirServiceProvider(PR_TRUE, getter_AddRefs(locProvider));
if (!locProvider)
return NS_ERROR_FAILURE;
rv = locProvider->Register();
if (NS_FAILED(rv))
return rv;
return locProvider->SetProfileDir(localAppDataDir);
}
void DoPreferences()
{
nsCOMPtr<nsIPrefBranch> prefBranch = do_GetService(NS_PREFSERVICE_CONTRACTID);
if (!prefBranch)
return;
prefBranch->SetIntPref("snav.keyCode.modifier", 0);
prefBranch->GetBoolPref("config.wince.dumpJSConsole", &gDumpJSConsole);
}
void OverrideComponents()
{
static NS_DEFINE_CID(kBrowserStatusFilter, NS_BROWSERSTATUSFILTER_CID);
nsCOMPtr<nsIComponentRegistrar> registrar;
NS_GetComponentRegistrar(getter_AddRefs(registrar));
nsBrowserStatusFilterFactory* factory = new nsBrowserStatusFilterFactory();
if (!factory)
return;
if (registrar)
registrar->RegisterFactory(kBrowserStatusFilter,
NS_BROWSERSTATUSFILTER_CLASSNAME,
NS_BROWSERSTATUSFILTER_CONTRACTID,
factory);
}
#ifdef WINCE
typedef struct FindAppStruct
{
HWND hwnd;
} FindAppStruct;
BOOL CALLBACK FindApplicationWindowProc(HWND hwnd, LPARAM lParam)
{
FindAppStruct* findApp = (FindAppStruct*) lParam;
unsigned short windowName[MAX_PATH];
GetWindowTextW(hwnd, windowName, MAX_PATH);
if (wcsstr(windowName, L"Minimo"))
{
findApp->hwnd = hwnd;
return FALSE;
}
return TRUE;
}
PRBool DoesProcessAlreadyExist()
{
const HANDLE hMutex = CreateMutexW(0, 0, L"_MINIMO_EXE_MUTEX_");
if(hMutex)
{
if(ERROR_ALREADY_EXISTS == GetLastError())
{
FindAppStruct findApp;
findApp.hwnd = NULL;
EnumWindows(FindApplicationWindowProc, (LPARAM)&findApp);
if (findApp.hwnd)
{
SetForegroundWindow(findApp.hwnd);
return TRUE;
}
MessageBox(0, "Minimo is running, but can't be switched to.", "Unexpected Error", 0);
return TRUE;
}
return FALSE;
}
MessageBox(0, "Can not start Minimo", "Unexpected Error", 0);
return TRUE;
}
#else
PRBool DoesProcessAlreadyExist() {return PR_FALSE;}
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Complete hack below. We to ensure that the layout of all
* of the shared libaries are at tightly packed as possible.
* We do this by explictly loading all of the modules we
* know about at compile time. This seams to work for our
* purposes. Ultimately, we should statically link all of
* these libraries.
*
* If you are building this to put on a ROM where XIP exists.
*
* For more information:
* 1) http://msdn.microsoft.com/library/default.asp?url=/ \
library/en-us/dncenet/html/advmemmgmt.asp
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifdef WINCE
#define HACKY_PRE_LOAD_LIBRARY 1
#endif
#ifdef HACKY_PRE_LOAD_LIBRARY
typedef struct _library
{
const unsigned short* name;
HMODULE module;
} _library;
_library Libraries[] =
{
{ L"js3250.dll", NULL },
{ L"nspr4.dll", NULL },
{ L"nss3.dll", NULL },
{ L"nssckbi.dll", NULL },
{ L"plc4.dll", NULL },
{ L"plds4.dll", NULL },
{ L"shunt.dll", NULL },
{ L"smime3.dll", NULL },
{ L"softokn3.dll", NULL },
{ L"ssl3.dll", NULL },
{ L"xpcom.dll", NULL },
{ L"xpcom_core.dll", NULL },
{ NULL, NULL },
};
void LoadKnownLibs()
{
for (int i=0; Libraries[i].name; i++)
Libraries[i].module = LoadLibraryW(Libraries[i].name);
}
void UnloadKnownLibs()
{
for (int i=0; Libraries[i].name; i++)
if (Libraries[i].module)
FreeLibrary(Libraries[i].module);
}
#endif // HACKY_PRE_LOAD_LIBRARY
int main(int argc, char *argv[])
{
if (DoesProcessAlreadyExist())
return 0;
CreateSplashScreen();
#ifdef HACKY_PRE_LOAD_LIBRARY
LoadKnownLibs();
#endif
#ifdef _BUILD_STATIC_BIN
NS_InitEmbedding(nsnull, nsnull, kPStaticModules, kStaticModuleCount);
#else
NS_InitEmbedding(nsnull, nsnull);
#endif
// Choose the new profile
if (NS_FAILED(StartupProfile()))
return 1;
DoPreferences();
OverrideComponents();
NS_TIMELINE_ENTER("appStartup");
nsCOMPtr<nsIAppShell> appShell = do_CreateInstance(kAppShellCID);
appShell->Create(nsnull, nsnull);
ApplicationObserver *appObserver = new ApplicationObserver(appShell);
if (!appObserver)
return 1;
NS_ADDREF(appObserver);
WindowCreator *creatorCallback = new WindowCreator(appShell);
if (!creatorCallback)
return 1;
nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
wwatch->SetWindowCreator(creatorCallback);
nsCOMPtr<nsIDOMWindow> newWindow;
wwatch->OpenWindow(nsnull, start_url, "_blank", "chrome,dialog=no,all", nsnull, getter_AddRefs(newWindow));
appShell->Run();
appShell = nsnull;
wwatch = nsnull;
newWindow = nsnull;
delete appObserver;
delete creatorCallback;
if (gDumpJSConsole)
WriteConsoleLog();
// Close down Embedding APIs
NS_TermEmbedding();
#ifdef HACKY_PRE_LOAD_LIBRARY
UnloadKnownLibs();
#endif
return NS_OK;
}