4
4
* Copyright (C) 2004-2007 Lars Lindner <lars.lindner@gmail.com>
5
5
* Copyright (C) 2004-2006 Nathan J. Conrad <t98502@users.sourceforge.net>
6
* Copyright (C) 2008 Alexander Sack <asac@ubuntu.com>
7
8
* The preference handling was taken from the Galeon source
29
30
# include <config.h>
32
#define MOZILLA_INTERNAL_API
33
// for GLUE we _must_ not use MOZILLA_INTERNAL_API
35
# define MOZILLA_INTERNAL_API
34
38
#include "mozsupport.h"
35
39
#include <gtk/gtk.h>
36
41
#include <gtkmozembed.h>
37
42
#include <gtkmozembed_internal.h>
39
#include "nsIWebBrowser.h"
40
#include "nsIDOMMouseEvent.h"
41
#include "dom/nsIDOMKeyEvent.h"
42
#include "nsIDOMWindow.h"
43
#include "nsIPrefService.h"
44
#include "nsIServiceManager.h"
45
#include "nsIIOService.h"
46
#include "necko/nsNetCID.h"
44
// if we use the glue (since 1.9), we must explicitly get the gtkmozembed symbols
46
# include <gtkmozembed_glue.cpp>
49
// some includes were moved with 1.9, so we need to switch here
51
#include <nsIDOMKeyEvent.h>
54
#include <dom/nsIDOMKeyEvent.h>
55
#include <necko/nsNetCID.h>
58
#include <nsIWebBrowser.h>
59
#include <nsIDOMMouseEvent.h>
60
#include <nsIDOMWindow.h>
61
#include <nsIPrefService.h>
62
#include <nsIServiceManager.h>
63
#include <nsIIOService.h>
66
#include <nsServiceManagerUtils.h>
311
/* helpers for binaries linked against XPCOM_GLUE */
315
* load xpcom through glue.
316
* When using the glue you have to call this method before doing
317
* anything else. It finds the GRE, loads the xpcom libs,
318
* maps the gtkmozbemd symbols and intializes xpcom by setting
319
* the path and component path.
321
* the caller still has to call gtk_moz_embed_push_startup ()
324
mozsupport_xpcom_init ()
326
static const GREVersionRange greVersion = {
330
char xpcomLocation[4096];
331
nsresult rv = GRE_GetGREPathWithProperties (&greVersion, 1, nsnull, 0, xpcomLocation, 4096);
332
NS_ENSURE_SUCCESS (rv, NS_SUCCEEDED (rv));
333
// Startup the XPCOM Glue that links us up with XPCOM.
334
rv = XPCOMGlueStartup(xpcomLocation);
335
NS_ENSURE_SUCCESS (rv, NS_SUCCEEDED (rv));
336
rv = GTKEmbedGlueStartup();
337
NS_ENSURE_SUCCESS (rv, NS_SUCCEEDED (rv));
338
rv = GTKEmbedGlueStartupInternal();
339
NS_ENSURE_SUCCESS (rv, NS_SUCCEEDED (rv));
340
char *lastSlash = strrchr (xpcomLocation, '/');
343
gtk_moz_embed_set_path (xpcomLocation);
349
mozsupport_xpcom_shutdown ()
351
return NS_SUCCEEDED (XPCOMGlueShutdown ());