зеркало из https://github.com/mozilla/gecko-dev.git
Fix for bug 27287 -- get Apple Events working again on Mac. r=scc
This commit is contained in:
Родитель
2b7a425ab6
Коммит
862c03f913
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -22,4 +22,77 @@
|
|||
|
||||
// Special stuff for the Macintosh implementation of command-line service.
|
||||
|
||||
void InitializeMacCommandLine(int& argc, char**& argv);
|
||||
#ifndef nsCommandLineServiceMac_h_
|
||||
#define nsCommandLineServiceMac_h_
|
||||
|
||||
#include <Files.h>
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsError.h"
|
||||
|
||||
#include "nsAEDefs.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
class nsMacCommandLine
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
kMaxBufferSize = 512,
|
||||
kMaxTokens = 20
|
||||
};
|
||||
|
||||
nsMacCommandLine();
|
||||
~nsMacCommandLine();
|
||||
|
||||
nsresult Initialize(int& argc, char**& argv);
|
||||
|
||||
PRBool EnsureCommandLine();
|
||||
nsresult AddToCommandLine(const char* inArgText);
|
||||
nsresult AddToCommandLine(const char* inOptionString, const FSSpec& inFileSpec);
|
||||
nsresult AddToEnvironmentVars(const char* inArgText);
|
||||
|
||||
OSErr HandleOpenOneDoc(const FSSpec& inFileSpec, OSType inFileType);
|
||||
OSErr HandlePrintOneDoc(const FSSpec& inFileSpec, OSType fileType);
|
||||
|
||||
OSErr DispatchURLToNewBrowser(const char* url);
|
||||
|
||||
OSErr Quit(TAskSave askSave);
|
||||
|
||||
protected:
|
||||
|
||||
nsresult OpenWindow(const char *chrome, const PRUnichar *url);
|
||||
|
||||
char* mArgBuffer; // the command line itself
|
||||
char** mArgs; // array of pointers into argBuffer
|
||||
|
||||
PRBool mStartedUp;
|
||||
|
||||
public:
|
||||
|
||||
static nsMacCommandLine& GetMacCommandLine() { return sMacCommandLine; }
|
||||
|
||||
private:
|
||||
|
||||
static nsMacCommandLine sMacCommandLine;
|
||||
|
||||
};
|
||||
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
nsresult InitializeMacCommandLine(int& argc, char**& argv);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif // nsCommandLineServiceMac_h_
|
||||
|
|
|
@ -470,15 +470,13 @@ static nsresult main1(int argc, char* argv[], nsISplashScreen *splashScreen )
|
|||
#if XP_MAC
|
||||
stTSMCloser tsmCloser;
|
||||
|
||||
InitializeMacCommandLine( argc, argv);
|
||||
|
||||
rv = InitializeMacCommandLine( argc, argv);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Initializing AppleEvents failed");
|
||||
#endif
|
||||
|
||||
// XXX: This call will be replaced by a registry initialization...
|
||||
NS_SetupRegistry_1();
|
||||
|
||||
// Start up the core services:
|
||||
|
||||
// Initialize the cmd line service
|
||||
NS_WITH_SERVICE(nsICmdLineService, cmdLineArgs, kCmdLineServiceCID, &rv);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get command line service");
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -22,4 +22,77 @@
|
|||
|
||||
// Special stuff for the Macintosh implementation of command-line service.
|
||||
|
||||
void InitializeMacCommandLine(int& argc, char**& argv);
|
||||
#ifndef nsCommandLineServiceMac_h_
|
||||
#define nsCommandLineServiceMac_h_
|
||||
|
||||
#include <Files.h>
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsError.h"
|
||||
|
||||
#include "nsAEDefs.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
class nsMacCommandLine
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
kMaxBufferSize = 512,
|
||||
kMaxTokens = 20
|
||||
};
|
||||
|
||||
nsMacCommandLine();
|
||||
~nsMacCommandLine();
|
||||
|
||||
nsresult Initialize(int& argc, char**& argv);
|
||||
|
||||
PRBool EnsureCommandLine();
|
||||
nsresult AddToCommandLine(const char* inArgText);
|
||||
nsresult AddToCommandLine(const char* inOptionString, const FSSpec& inFileSpec);
|
||||
nsresult AddToEnvironmentVars(const char* inArgText);
|
||||
|
||||
OSErr HandleOpenOneDoc(const FSSpec& inFileSpec, OSType inFileType);
|
||||
OSErr HandlePrintOneDoc(const FSSpec& inFileSpec, OSType fileType);
|
||||
|
||||
OSErr DispatchURLToNewBrowser(const char* url);
|
||||
|
||||
OSErr Quit(TAskSave askSave);
|
||||
|
||||
protected:
|
||||
|
||||
nsresult OpenWindow(const char *chrome, const PRUnichar *url);
|
||||
|
||||
char* mArgBuffer; // the command line itself
|
||||
char** mArgs; // array of pointers into argBuffer
|
||||
|
||||
PRBool mStartedUp;
|
||||
|
||||
public:
|
||||
|
||||
static nsMacCommandLine& GetMacCommandLine() { return sMacCommandLine; }
|
||||
|
||||
private:
|
||||
|
||||
static nsMacCommandLine sMacCommandLine;
|
||||
|
||||
};
|
||||
|
||||
#endif //__cplusplus
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
nsresult InitializeMacCommandLine(int& argc, char**& argv);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif // nsCommandLineServiceMac_h_
|
||||
|
|
Загрузка…
Ссылка в новой задаче