Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions | Variables
nsBeOSMain.cpp File Reference
#include <signal.h>
#include <be/app/Application.h>
#include "nsIAppShell.h"
#include "nsViewerApp.h"
#include "nsBrowserWindow.h"
#include <stdlib.h>
#include "plevent.h"

Go to the source code of this file.

Classes

class  nsBeOSApp

Functions

static void beos_signal_handler (int signum)
static nsresult InitializeBeOSApp (void)
int main (int argc, char **argv)
 The Xalan testcases app.

Variables

static nsNativeViewerAppNVApp = 0

Function Documentation

static void beos_signal_handler ( int  signum) [static]

Definition at line 141 of file nsBeOSMain.cpp.

                                            {
#ifdef DEBUG
       fprintf(stderr, "beos_signal_handler: %d\n", signum);
#endif

       // Exit native appshell loop so that viewer will shutdown normally
       if (NVApp)
              NVApp->Exit();
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsresult InitializeBeOSApp ( void  ) [static]

Definition at line 151 of file nsBeOSMain.cpp.

{
       nsresult rv = NS_OK;

       sem_id initsem = create_sem(0, "beapp init");
       if (initsem < B_OK)
              return NS_ERROR_FAILURE;

       thread_id tid = spawn_thread(nsBeOSApp::Main, "BApplication", 
                                   B_NORMAL_PRIORITY, (void *)initsem);
       if (tid < B_OK || B_OK != resume_thread(tid))
              rv = NS_ERROR_FAILURE;

       if (B_OK != acquire_sem(initsem))
              rv = NS_ERROR_FAILURE;
       if (B_OK != delete_sem(initsem))
              rv = NS_ERROR_FAILURE;

       return rv;
}

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 173 of file nsBeOSMain.cpp.

{
       signal(SIGTERM, beos_signal_handler);

       if (NS_OK != InitializeBeOSApp())
              return 1;

       // Init XPCOM
       nsresult rv = NS_InitXPCOM2(nsnull, nsnull, nsnull);
       NS_ASSERTION(NS_SUCCEEDED(rv), "NS_InitXPCOM failed");
       if (NS_SUCCEEDED(rv)) {

              // Run viewer app
              NVApp = new nsNativeViewerApp();
              if (!NVApp) {
#ifdef DEBUG
                     fprintf(stderr, "Could not allocate mem for nsNativeViewerApp\n");
#endif
                     // Shutdown XPCOM
                     rv = NS_ShutdownXPCOM(nsnull);
                     return 1;
              }
              NVApp->Initialize(argc,argv);
              NVApp->Run();
              delete NVApp;
              NVApp = 0;

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

       // Delete BApplication
       if (be_app->Lock())
              be_app->Quit();
       delete be_app;

       return 0;
}

Here is the call graph for this function:


Variable Documentation

nsNativeViewerApp* NVApp = 0 [static]

Definition at line 139 of file nsBeOSMain.cpp.