extern "C" void gecko_utils_shutdown(void) { gtk_moz_embed_pop_startup(); #ifdef XPCOM_GLUE NS_LogTerm(); #endif }
extern "C" void gecko_shutdown (void) { NS_IF_RELEASE (gPrefBranch); gPrefBranch = nsnull; #ifdef XPCOM_GLUE XPCOMGlueShutdown(); NS_ShutdownXPCOM (nsnull); #else gtk_moz_embed_pop_startup (); #endif #ifdef HAVE_GECKO_1_9 NS_LogTerm (); #endif }
int mozembed_main(int argc, char **argv) { if (argc > 1) { if (strstr(argv[1], "-port=")) { int port = atoi(&(argv[1][6])); gMessenger.SetPort(port); gMessenger.CreateServerSocket(); } else if (strcmp(argv[1], "-test") == 0) { gTestMode = 1; } } if (!gTestMode && gMessenger.IsFailed()) { ReportError("Failed to create server socket!"); exit(1); } gtk_set_locale(); gtk_init(&argc, &argv); // force the startup code to be executed because we need to start // the profile in a different way gtk_moz_embed_push_startup(); if (NS_FAILED(InitializeProfile())) { ReportError("Failed to initialize profile!"); exit(1); } gMsgLock = PR_NewLock(); if (!gTestMode) { PRThread *socketListenThread = PR_CreateThread(PR_USER_THREAD, PortListening, (void*)SocketMsgHandler, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, 0); if (!socketListenThread) { ReportError("Failed to create socket listening thread!"); exit(1); } // add event source to process socket messages #ifdef MOZ_WIDGET_GTK g_source_add (GDK_PRIORITY_EVENTS, TRUE, &event_funcs, NULL, NULL, NULL); #endif #ifdef MOZ_WIDGET_GTK2 GSource *newsource = g_source_new(&event_funcs, sizeof(GSource)); g_source_attach(newsource, NULL); #endif } else { GtkBrowser *browser = new_gtk_browser(GTK_MOZ_EMBED_FLAG_DEFAULTCHROME); // set our minimum size gtk_widget_set_usize(browser->mozEmbed, 400, 400); set_browser_visibility(browser, TRUE); } // get the singleton object and hook up to its new window callback // so we can create orphaned windows. GtkMozEmbedSingle *single; single = gtk_moz_embed_single_get(); if (!single) { ReportError("Failed to get singleton embed object!"); exit(1); } gtk_signal_connect(GTK_OBJECT(single), "new_window_orphan", GTK_SIGNAL_FUNC(new_window_orphan_cb), NULL); gtk_main(); gtk_moz_embed_pop_startup(); PR_DestroyLock(gMsgLock); return 0; }
/** * Stop the Gecko engine (must call after gtk_main()) */ void GeckoEmbed::tearDown() { gtk_moz_embed_pop_startup(); }
MozillaRenderer::~MozillaRenderer() { gtk_moz_embed_pop_startup(); }