Back to index

lightning-sunbird  0.9+nobinonly
Typedefs | Enumerations | Functions | Variables
nsMacMain.cpp File Reference
#include <stdlib.h>
#include "nsViewerApp.h"
#include "nsBrowserWindow.h"
#include "nsIWidget.h"
#include "nsIServiceManager.h"
#include "resources.h"
#include <ToolUtils.h>
#include <Menus.h>
#include <Windows.h>
#include <Devices.h>
#include <Resources.h>
#include <Dialogs.h>
#include "nsMacMessagePump.h"
#include "macstdlibextras.h"

Go to the source code of this file.

Typedefs

typedef SInt32 MessageT
typedef PRUint32 Uint32

Enumerations

enum  {
  menu_First = 128, menu_Apple = menu_First, menu_File, menu_Edit,
  menu_Sample, menu_Debug, menu_Tools, menu_URLS,
  menu_Last = menu_URLS, submenu_Print = 16, submenu_CompatibilityMode = 32, cmd_Sample0 = 1000,
  cmd_FirstXPToolkitSample = 1100, cmd_PrintOneColumn = 2000, cmd_Find = 3000, cmd_ViewSource = 2200,
  cmd_PrintSetup, cmd_DebugMode = 4000, cmd_ReflowTest, cmd_DumpContents,
  cmd_DumpFrames, cmd_DumpViews, cmd_DumpStyleSheets, cmd_DumpStyleContexts,
  cmd_DebugSave, cmd_DebugOutputText, cmd_DebugOutputHTML, cmd_DebugToggleSelection,
  cmd_DebugRobot, cmd_GFXWidgetMode, cmd_NativeWidgetMode, cmd_GFXScrollBars,
  cmd_NativeScrollBars, cmd_DumpLeaks, item_GFXWidgetMode = 24, item_NativeWidgetMode,
  cmd_Compatibility_UseDTD = 4200, cmd_Compatibility_NavQuirks, cmd_Compatibility_Standard, cmd_JSConsole = 5000,
  cmd_EditorMode, cmd_Top100, cmd_TableInspector, cmd_ImageInspector,
  cmd_SaveURL1 = 6000, cmd_SaveURL2, cmd_LoadURL1, cmd_LoadURL2
}

Functions

static void CloseFrontWindow ()
static pascal OSErr handleQuitApplication (const AppleEvent *, AppleEvent *, long)
 Quit AppleEvent handler.
int main (int argc, char **argv)
 The Xalan testcases app.

Variables

const MessageT cmd_Undo = 11
const MessageT cmd_Cut = 12
const MessageT cmd_Copy = 13
const MessageT cmd_Paste = 14
const MessageT cmd_Clear = 15
const MessageT cmd_SelectAll = 16
const MessageT cmd_About = 1
const MessageT cmd_New = 2
const MessageT cmd_Open = 3
const MessageT cmd_Close = 4
const MessageT cmd_Save = 5
const MessageT cmd_SaveAs = 6
const MessageT cmd_Revert = 7
const MessageT cmd_PageSetup = 8
const MessageT cmd_Print = 9
const MessageT cmd_PrintOne = 17
const MessageT cmd_Quit = 10
const MessageT cmd_Preferences = 27
static nsNativeViewerAppgTheApp

Typedef Documentation

typedef SInt32 MessageT

Definition at line 61 of file nsMacMain.cpp.

typedef PRUint32 Uint32

Definition at line 62 of file nsMacMain.cpp.


Enumeration Type Documentation

anonymous enum
Enumerator:
menu_First 
menu_Apple 
menu_File 
menu_Edit 
menu_Sample 
menu_Debug 
menu_Tools 
menu_URLS 
menu_Last 
submenu_Print 
submenu_CompatibilityMode 
cmd_Sample0 
cmd_FirstXPToolkitSample 
cmd_PrintOneColumn 
cmd_Find 
cmd_ViewSource 
cmd_PrintSetup 
cmd_DebugMode 
cmd_ReflowTest 
cmd_DumpContents 
cmd_DumpFrames 
cmd_DumpViews 
cmd_DumpStyleSheets 
cmd_DumpStyleContexts 
cmd_DebugSave 
cmd_DebugOutputText 
cmd_DebugOutputHTML 
cmd_DebugToggleSelection 
cmd_DebugRobot 
cmd_GFXWidgetMode 
cmd_NativeWidgetMode 
cmd_GFXScrollBars 
cmd_NativeScrollBars 
cmd_DumpLeaks 
item_GFXWidgetMode 
item_NativeWidgetMode 
cmd_Compatibility_UseDTD 
cmd_Compatibility_NavQuirks 
cmd_Compatibility_Standard 
cmd_JSConsole 
cmd_EditorMode 
cmd_Top100 
cmd_TableInspector 
cmd_ImageInspector 
cmd_SaveURL1 
cmd_SaveURL2 
cmd_LoadURL1 
cmd_LoadURL2 

Definition at line 86 of file nsMacMain.cpp.


Function Documentation

static void CloseFrontWindow ( ) [static]

Definition at line 237 of file nsMacMain.cpp.

{
    WindowPtr       wind = ::FrontWindow();
    if (!wind) return;
    
    nsBrowserWindow     *browserWindow = (nsBrowserWindow *)GetWRefCon(wind);
    if (!browserWindow) return;
    
    browserWindow->Destroy();
}
static pascal OSErr handleQuitApplication ( const AppleEvent *  ,
AppleEvent *  ,
long   
) [static]

Quit AppleEvent handler.

Definition at line 425 of file nsMacMain.cpp.

{
    if (gTheApp != nsnull) {
        gTheApp->Exit();
    } else {
        ExitToShell();
    }
    return noErr;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( int  argc,
char **  argv 
)

The Xalan testcases app.

Definition at line 437 of file nsMacMain.cpp.

{
#if !TARGET_CARBON
    // Set up the toolbox and (if DEBUG) the console
    InitializeMacToolbox();
#endif

    // Install a Quit AppleEvent handler.
#ifdef DEBUG
  OSErr err =
#endif
    AEInstallEventHandler(kCoreEventClass, kAEQuitApplication,
                          NewAEEventHandlerUPP(handleQuitApplication), 0,
                          false);
    NS_ASSERTION((err==noErr), "AEInstallEventHandler failed");

#ifdef XP_MACOSX
    // use the location of the executable to learn where everything is, this
    // is because the current working directory is ill-defined when the
    // application is double-clicked from the Finder.
    {
        char* path = strdup(argv[0]);
        char* lastSlash = strrchr(path, '/');
        if (lastSlash) {
            *lastSlash = '\0';
            setenv("MOZILLA_FIVE_HOME", path, 1);
        }
        free(path);
    }
#endif

    // Start up XPCOM?
    nsresult rv = NS_InitXPCOM2(nsnull, nsnull, nsnull);
    NS_ASSERTION(NS_SUCCEEDED(rv), "NS_InitXPCOM failed");

    gTheApp = new nsNativeViewerApp();
    if (gTheApp != nsnull) {
        NS_ADDREF(gTheApp);
        if (gTheApp->Initialize(argc, argv) == NS_OK)
            gTheApp->Run();
        NS_RELEASE(gTheApp);
    }

    // Shutdown XPCOM?
    rv = NS_ShutdownXPCOM(nsnull);
    NS_ASSERTION(NS_SUCCEEDED(rv), "NS_ShutdownXPCOM failed");

    return 0;
}

Here is the call graph for this function:


Variable Documentation

Definition at line 70 of file nsMacMain.cpp.

Definition at line 67 of file nsMacMain.cpp.

Definition at line 75 of file nsMacMain.cpp.

Definition at line 65 of file nsMacMain.cpp.

Definition at line 64 of file nsMacMain.cpp.

Definition at line 73 of file nsMacMain.cpp.

Definition at line 74 of file nsMacMain.cpp.

Definition at line 79 of file nsMacMain.cpp.

Definition at line 66 of file nsMacMain.cpp.

Definition at line 83 of file nsMacMain.cpp.

Definition at line 80 of file nsMacMain.cpp.

Definition at line 81 of file nsMacMain.cpp.

Definition at line 82 of file nsMacMain.cpp.

Definition at line 78 of file nsMacMain.cpp.

Definition at line 76 of file nsMacMain.cpp.

Definition at line 77 of file nsMacMain.cpp.

Definition at line 68 of file nsMacMain.cpp.

Definition at line 63 of file nsMacMain.cpp.

Definition at line 147 of file nsMacMain.cpp.