Back to index

lightning-sunbird  0.9+nobinonly
Functions | Variables
nsGtkMain.cpp File Reference
#include <gtk/gtk.h>
#include "nsViewerApp.h"
#include "nsBrowserWindow.h"
#include "nsGtkMenu.h"
#include "nsIServiceManager.h"
#include "nsIThread.h"
#include "plevent.h"
#include "prinit.h"
#include "prlog.h"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 The Xalan testcases app.

Variables

static nsNativeViewerAppgTheApp
static GtkWidget * sgHackMenuBar = nsnull

Function Documentation

int main ( int  argc,
char **  argv 
)

The Xalan testcases app.

Definition at line 169 of file nsGtkMain.cpp.

{
#ifdef NS_TRACE_MALLOC
  argc = NS_TraceMallocStartupArgs(argc, argv);
#endif

#ifdef CRAWL_STACK_ON_SIGSEGV
  strcpy(_progname,argv[0]);
  signal(SIGSEGV, ah_crap_handler);
  signal(SIGILL, ah_crap_handler);
  signal(SIGABRT, ah_crap_handler);
#endif // CRAWL_STACK_ON_SIGSEGV

#ifdef MOZ_WIDGET_GTK
  gtk_set_locale();
#endif
  gtk_init(&argc, &argv);

  // Initialize XPCOM
  nsresult rv = NS_InitXPCOM2(nsnull, nsnull, nsnull);
  NS_ASSERTION(NS_SUCCEEDED(rv), "NS_InitXPCOM failed");
  if (NS_SUCCEEDED(rv)) {
    // The toolkit service in mozilla will look in the environment
    // to determine which toolkit to use.  Yes, it is a dumb hack to
    // force it here, but we have no choice because of toolkit specific
    // code linked into the viewer.
    putenv("MOZ_TOOLKIT=gtk");

    gTheApp = new nsNativeViewerApp();
    gTheApp->Initialize(argc, argv);
    gTheApp->Run();
    delete gTheApp;

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

    // XXX This is disabled because sometimes it hangs waiting for a
    // netlib thread to exit, which isn't exiting :-(. Need more
    // shutdown logic in necko first.
#if 0
    // Shutdown NSPR
    PR_LogFlush();
    PR_Cleanup();
#endif
  }

  return 0;
}

Here is the call graph for this function:


Variable Documentation

Definition at line 53 of file nsGtkMain.cpp.

GtkWidget* sgHackMenuBar = nsnull [static]

Definition at line 95 of file nsGtkMain.cpp.