bug 287943 - Rebrand bootstrap's Windows bits, using the configure vars where possible, no real brand change happening there yet. r=biesi sr=Neil a=asa

This commit is contained in:
kairo%kairo.at 2005-04-15 16:08:13 +00:00
Родитель ff437dc535
Коммит 676c660dcd
3 изменённых файлов: 62 добавлений и 123 удалений

Просмотреть файл

@ -1 +1,6 @@
WIN32_MODULE_DESCRIPTION=Mozilla
WIN32_MODULE_COMPANYNAME=mozilla.org
WIN32_MODULE_COPYRIGHT=©Mozilla Developers, according to the MPL 1.1/GPL 2.0/LGPL 2.1 licenses, as applicable.
WIN32_MODULE_TRADEMARKS=Mozilla is a trademark of The Mozilla Foundation.
WIN32_MODULE_DESCRIPTION=@MOZ_APP_DISPLAYNAME@
WIN32_MODULE_PRODUCTNAME=@MOZ_APP_DISPLAYNAME@
WIN32_MODULE_NAME=@MOZ_APP_DISPLAYNAME@

Просмотреть файл

@ -262,31 +262,33 @@ private:
/* DDE Notes
*
* This section describes the Win32 DDE service implementation for
* Mozilla. DDE is used on Win32 platforms to communicate between
* separate instances of mozilla.exe (or other Mozilla-based
* executables), or, between the Win32 desktop shell and Mozilla.
* SeaMonkey. DDE is used on Win32 platforms to communicate between
* separate instances of seamonkey.exe (or other Mozilla-based
* executables), or, between the Win32 desktop shell and SeaMonkey.
*
* The first instance of Mozilla will become the "server" and
* The first instance of SeaMonkey will become the "server" and
* subsequent executables (and the shell) will use DDE to send
* requests to that process. The requests are DDE "execute" requests
* that pass the command line arguments.
*
* Mozilla registers the DDE application "Mozilla" and currently
* SeaMonkey registers the DDE application "SeaMonkey" and currently
* supports only the "WWW_OpenURL" topic. This should be reasonably
* compatible with applications that interfaced with Netscape
* Communicator (and its predecessors?). Note that even that topic
* may not be supported in a compatible fashion as the command-line
* options for Mozilla are different than for Communiator.
* options for SeaMonkey are different than for Communiator.
*
* It is imperative that at most one instance of Mozilla execute in
* "server mode" at any one time. The "native app support" in Mozilla
* Note: The DDE application name is set via splash.rc
*
* It is imperative that at most one instance of SeaMonkey execute in
* "server mode" at any one time. The "native app support" in SeaMonkey
* on Win32 ensures that only the server process performs XPCOM
* initialization (that is not required for subsequent client processes
* to communicate with the server process).
*
* To guarantee that only one server starts up, a Win32 "mutex" is used
* to ensure only one process executes the server-detection code. That
* code consists of initializing DDE and doing a DdeConnect to Mozilla's
* code consists of initializing DDE and doing a DdeConnect to SeaMonkey's
* application/topic. If that connection succeeds, then a server process
* must be running already.
*
@ -299,7 +301,7 @@ private:
* 1. It is imperative that DdeInitialize be called only after the mutex
* lock has been obtained. The reason is that at shutdown, DDE
* notifications go out to all initialized DDE processes. Thus, if
* the mutex is owned by a terminating intance of Mozilla, then
* the mutex is owned by a terminating intance of SeaMonkey, then
* calling DdeInitialize and then WaitForSingleObject will cause the
* DdeUninitialize from the terminating process to "hang" until the
* process waiting for the mutex times out (and can then service the
@ -310,12 +312,12 @@ private:
* are designed to "fail safe" (i.e., a timeout is treated as failure).
*
* 3. An attempt has been made to minimize the degree to which the main
* Mozilla application logic needs to be aware of the DDE mechanisms
* SeaMonkey application logic needs to be aware of the DDE mechanisms
* implemented herein. As a result, this module surfaces a very
* large-grained interface, consisting of simple start/stop methods.
* As a consequence, details of certain scenarios can be "lost."
* Particularly, incoming DDE requests can arrive after this module
* initiates the DDE server, but before Mozilla is initialized to the
* initiates the DDE server, but before SeaMonkey is initialized to the
* point where those requests can be serviced (e.g., open a browser
* window to a particular URL). Since the client process sends the
* request early on, it may not be prepared to respond to that error.
@ -326,18 +328,18 @@ private:
/* Update 2001 March
*
* A significant DDE bug in Windows is causing Mozilla to get wedged at
* A significant DDE bug in Windows is causing SeaMonkey to get wedged at
* startup. This is detailed in Bugzill bug 53952
* (http://bugzilla.mozilla.org/show_bug.cgi?id=53952).
*
* To resolve this, we are using a new strategy:
* o Use a "message window" to detect that Mozilla is already running and
* o Use a "message window" to detect that SeaMonkey is already running and
* to pass requests from a second instance back to the first;
* o Run only as a "DDE server" (not as DDE client); this avoids the
* problematic call to DDEConnect().
*
* We still use the mutex semaphore to protect the code that detects
* whether Mozilla is already running.
* whether SeaMonkey is already running.
*/
class nsNativeAppSupportWin : public nsNativeAppSupportBase {
@ -734,7 +736,6 @@ NS_CreateSplashScreen( nsISplashScreen **aResult ) {
}
// Constants
#define MOZ_DDE_APPLICATION "Mozilla"
#define MOZ_STARTUP_MUTEX_NAME "StartupMutex"
#define MOZ_DDE_START_TIMEOUT 30000
#define MOZ_DDE_STOP_TIMEOUT 15000
@ -897,19 +898,19 @@ struct MessageWindow {
switch (selectedItem) {
case TURBO_NAVIGATOR:
(void)nsNativeAppSupportWin::HandleRequest( (LPBYTE)"mozilla -browser" );
(void)nsNativeAppSupportWin::HandleRequest( (LPBYTE)(NS_STRINGIFY(MOZ_APP_NAME) " -browser") );
break;
case TURBO_MAIL:
(void)nsNativeAppSupportWin::HandleRequest( (LPBYTE)"mozilla -mail" );
(void)nsNativeAppSupportWin::HandleRequest( (LPBYTE)(NS_STRINGIFY(MOZ_APP_NAME) " -mail") );
break;
case TURBO_EDITOR:
(void)nsNativeAppSupportWin::HandleRequest( (LPBYTE)"mozilla -editor" );
(void)nsNativeAppSupportWin::HandleRequest( (LPBYTE)(NS_STRINGIFY(MOZ_APP_NAME) " -editor") );
break;
case TURBO_ADDRESSBOOK:
(void)nsNativeAppSupportWin::HandleRequest( (LPBYTE)"mozilla -addressbook" );
(void)nsNativeAppSupportWin::HandleRequest( (LPBYTE)(NS_STRINGIFY(MOZ_APP_NAME) " -addressbook") );
break;
case TURBO_EXIT:
(void)nsNativeAppSupportWin::HandleRequest( (LPBYTE)"mozilla -kill" );
(void)nsNativeAppSupportWin::HandleRequest( (LPBYTE)(NS_STRINGIFY(MOZ_APP_NAME) " -kill") );
break;
case TURBO_DISABLE:
nsresult rv;
@ -967,7 +968,7 @@ struct MessageWindow {
// Dbl-click will open nav/mailnews/composer based on prefs
// (if no windows are open), or, open nav (if some windows are
// already open). That's done in HandleRequest.
(void)nsNativeAppSupportWin::HandleRequest( (LPBYTE)"mozilla" );
(void)nsNativeAppSupportWin::HandleRequest( (LPBYTE)NS_STRINGIFY(MOZ_APP_NAME) );
}
return TRUE;
#endif
@ -1009,12 +1010,12 @@ static char nameBuffer[128] = { 0 };
char *nsNativeAppSupportWin::mAppName = nameBuffer;
/* Start: Tries to find the "message window" to determine if it
* exists. If so, then Mozilla is already running. In that
* exists. If so, then SeaMonkey is already running. In that
* case, we use the handle to the "message" window and send
* a request corresponding to this process's command line
* options.
*
* If not, then this is the first instance of Mozilla. In
* If not, then this is the first instance of SeaMonkey. In
* that case, we create and set up the message window.
*
* The checking for existance of the message window must
@ -1191,7 +1192,7 @@ static DWORD deleteKey( HKEY baseKey, const char *keyName ) {
// Start DDE server.
//
// This used to be the Start() method when we were using DDE as the
// primary IPC mechanism between secondary Mozilla processes and the
// primary IPC mechanism between secondary SeaMonkey processes and the
// initial "server" process.
//
// Now, it simply initializes the DDE server. The caller must check
@ -1434,7 +1435,7 @@ nsNativeAppSupportWin::HandleDDENotification( UINT uType, // transaction t
}
// Make it look like command line args.
url.Insert( "mozilla -url ", 0 );
url.Insert( NS_STRINGIFY(MOZ_APP_NAME) " -url ", 0 );
#if MOZ_DEBUG_DDE
printf( "Handling dde XTYP_REQUEST request: [%s]...\n", url.get() );
#endif
@ -1608,7 +1609,7 @@ nsNativeAppSupportWin::HandleDDENotification( UINT uType, // transaction t
}
// Make it look like command line args.
url.Insert( "mozilla -url ", 0 );
url.Insert( NS_STRINGIFY(MOZ_APP_NAME) " -url ", 0 );
#if MOZ_DEBUG_DDE
printf( "Handling dde XTYP_REQUEST request: [%s]...\n", url.get() );
#endif
@ -1848,7 +1849,7 @@ nsNativeAppSupportWin::HandleRequest( LPBYTE request, PRBool newWindow ) {
// logic in DoCommandLines changes. Note that we cover this case below
// by opening a navigator window if DoCommandLines doesn't open one. We
// have to cover that case anyway, because DoCommandLines won't open a
// window when given "mozilla -foobar" or the like.
// window when given "seamonkey -foobar" or the like.
PRBool heedStartupPrefs = PR_FALSE;
PRInt32 argc = 0;
args->GetArgc( &argc );
@ -2067,26 +2068,29 @@ nsNativeAppSupportWin::EnsureProfile(nsICmdLineService* args)
printf( "Setting ddexec subkey entries\n" );
#endif
// Set ddeexec default value.
const char ddeexec[] = "\"%1\",,-1,0,,,,";
::RegSetValue( HKEY_CLASSES_ROOT,
"http\\shell\\open\\ddeexec",
REG_SZ,
ddeexec,
sizeof ddeexec );
const BYTE ddeexec[] = "\"%1\",,-1,0,,,,";
::RegSetValueEx( HKEY_CLASSES_ROOT,
"http\\shell\\open\\ddeexec",
0,
REG_SZ,
ddeexec,
sizeof ddeexec );
// Set application/topic (while we're running), reset at exit.
::RegSetValue( HKEY_CLASSES_ROOT,
"http\\shell\\open\\ddeexec\\application",
REG_SZ,
mAppName,
::strlen( mAppName ) );
::RegSetValueEx( HKEY_CLASSES_ROOT,
"http\\shell\\open\\ddeexec\\application",
0,
REG_SZ,
(unsigned char *)mAppName,
::strlen( mAppName ) + 1 );
const char topic[] = "WWW_OpenURL";
::RegSetValue( HKEY_CLASSES_ROOT,
"http\\shell\\open\\ddeexec\\topic",
REG_SZ,
topic,
sizeof topic );
const BYTE topic[] = "WWW_OpenURL";
::RegSetValueEx( HKEY_CLASSES_ROOT,
"http\\shell\\open\\ddeexec\\topic",
0,
REG_SZ,
topic,
sizeof topic );
// Remember we need to undo this.
mSupportingDDEExec = PR_TRUE;
@ -2157,10 +2161,10 @@ static char procPropertyName[] = "MozillaProcProperty";
// Subclass procedure used to filter out WM_SETFOCUS messages while reparenting.
static LRESULT CALLBACK focusFilterProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) {
if ( uMsg == WM_SETFOCUS ) {
// Don't let Mozilla's window procedure see this.
// Don't let SeaMonkey's window procedure see this.
return 0;
} else {
// Pass on all other messages to Mozilla's window proc.
// Pass on all other messages to SeaMonkey's window proc.
HANDLE oldProc = ::GetProp( hwnd, procPropertyName );
if ( oldProc ) {
return ::CallWindowProc( (WNDPROC)oldProc, hwnd, uMsg, wParam, lParam );
@ -2413,8 +2417,10 @@ nsNativeAppSupportWin::SetupSysTrayIcon() {
addressbookText = text;
}
if ( exitText.IsEmpty() )
exitText.Assign( NS_LITERAL_STRING("E&xit Mozilla") );
if ( exitText.IsEmpty() ) {
exitText.Assign( NS_LITERAL_STRING( "E&xit " ) );
exitText.Append( NS_LITERAL_STRING( NS_STRINGIFY(MOZ_APP_DISPLAYNAME) ) );
}
if ( disableText.IsEmpty() )
disableText.Assign( NS_LITERAL_STRING("&Disable Quick Launch") );
@ -2496,7 +2502,7 @@ nsNativeAppSupportWin::StartServerMode() {
return NS_OK;
} else {
// Sometimes a window will have been opened even though mShouldShowUI is false
// (e.g., mozilla -mail -turbo). Detect that by testing whether there's a
// (e.g., seamonkey -mail -turbo). Detect that by testing whether there's a
// window already open.
nsCOMPtr<nsIDOMWindowInternal> win;
GetMostRecentWindow( 0, getter_AddRefs( win ) );

Просмотреть файл

@ -1,72 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** 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 Mozilla Communicator client 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):
* Bill Law law@netscape.com
*
* Alternatively, the contents of this file may be used under the terms of
* either of 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 <windows.h>
#include "nsNativeAppSupportWin.h"
#include "nsINativeAppSupportWin.h"
1 24 "mozilla.manifest"
// Program icon.
IDI_APPLICATION ICON
"mozilla.ico"
// Splash screen dialog.
IDD_SPLASH DIALOGEX
DISCARDABLE
0,0,0,0
STYLE DS_SETFOREGROUND | DS_CENTER | WS_POPUP
EXSTYLE WS_EX_TOOLWINDOW
FONT 8, "MS Sans Serif"
BEGIN
CONTROL
IDB_SPLASH,
IDB_SPLASH,
"Static",
SS_BITMAP,
0,0,0,0
END
// Splash screen bitmap.
IDB_SPLASH BITMAP
"splash.bmp"
STRINGTABLE DISCARDABLE
BEGIN
ID_DDE_APPLICATION_NAME, "Mozilla"
IDS_STARTMENU_APPNAME, "Mozilla"
END