Actually make it work on 1.9. Had to disable some stuff, temporarily.

This commit is contained in:
Marco Pesenti Gritti 2007-01-23 23:14:22 +01:00
parent 94d7f94534
commit 997a90d7cc
4 changed files with 23 additions and 5 deletions

View File

@ -43,7 +43,7 @@ if test "x$with_libxul_sdk" != x ; then
# xulrunner 1.9 # xulrunner 1.9
GECKO_CFLAGS="-I$with_libxul_sdk/sdk/include" GECKO_CFLAGS="-I$with_libxul_sdk/sdk/include -DXPCOM_GLUE"
XPCOMGLUE_LIBS="-L$with_libxul_sdk/sdk/lib -lxpcomglue" XPCOMGLUE_LIBS="-L$with_libxul_sdk/sdk/lib -lxpcomglue"
MOZILLA_INCLUDE_DIR="$with_libxul_sdk/include" MOZILLA_INCLUDE_DIR="$with_libxul_sdk/include"

View File

@ -20,7 +20,9 @@ _sugar_la_LIBADD = \
$(top_builddir)/lib/src/libsugarprivate.la $(top_builddir)/lib/src/libsugarprivate.la
_sugar_la_SOURCES = \ _sugar_la_SOURCES = \
_sugarmodule.c _sugarmodule.c \
xulrunner.cpp \
xulrunner.h
nodist__sugar_la_SOURCES = _sugar.c nodist__sugar_la_SOURCES = _sugar.c

View File

@ -2,6 +2,8 @@
#include "config.h" #include "config.h"
#endif #endif
#include "xulrunner.h"
/* include this first, before NO_IMPORT_PYGOBJECT is defined */ /* include this first, before NO_IMPORT_PYGOBJECT is defined */
#include <pygobject.h> #include <pygobject.h>
@ -17,6 +19,8 @@ init_sugar(void)
{ {
PyObject *m, *d; PyObject *m, *d;
xulrunner_startup();
init_pygobject (); init_pygobject ();
Pycairo_IMPORT; Pycairo_IMPORT;

View File

@ -17,6 +17,8 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#include <config.h>
#include "sugar-browser.h" #include "sugar-browser.h"
#include "GeckoContentHandler.h" #include "GeckoContentHandler.h"
#include "GeckoDownload.h" #include "GeckoDownload.h"
@ -35,9 +37,6 @@
#include <nsIComponentRegistrar.h> #include <nsIComponentRegistrar.h>
#include <nsIComponentManager.h> #include <nsIComponentManager.h>
NS_GENERIC_FACTORY_CONSTRUCTOR(GeckoContentHandler)
NS_GENERIC_FACTORY_CONSTRUCTOR(GeckoDownload)
enum { enum {
PROP_0, PROP_0,
PROP_PROGRESS, PROP_PROGRESS,
@ -48,6 +47,11 @@ enum {
PROP_LOADING PROP_LOADING
}; };
#ifndef HAVE_GECKO_1_9
NS_GENERIC_FACTORY_CONSTRUCTOR(GeckoContentHandler)
NS_GENERIC_FACTORY_CONSTRUCTOR(GeckoDownload)
static const nsModuleComponentInfo sSugarComponents[] = { static const nsModuleComponentInfo sSugarComponents[] = {
{ {
"Gecko Content Handler", "Gecko Content Handler",
@ -63,6 +67,8 @@ static const nsModuleComponentInfo sSugarComponents[] = {
} }
}; };
#endif
gboolean gboolean
sugar_browser_startup(const char *profile_path, const char *profile_name) sugar_browser_startup(const char *profile_path, const char *profile_name)
{ {
@ -97,6 +103,8 @@ sugar_browser_startup(const char *profile_path, const char *profile_name)
g_warning ("failed to read user preferences, error: %x", rv); g_warning ("failed to read user preferences, error: %x", rv);
} }
#ifndef HAVE_GECKO_1_9
/* Register our components */ /* Register our components */
nsCOMPtr<nsIComponentRegistrar> componentRegistrar; nsCOMPtr<nsIComponentRegistrar> componentRegistrar;
NS_GetComponentRegistrar(getter_AddRefs(componentRegistrar)); NS_GetComponentRegistrar(getter_AddRefs(componentRegistrar));
@ -136,6 +144,8 @@ sugar_browser_startup(const char *profile_path, const char *profile_name)
} }
} }
#endif
return TRUE; return TRUE;
} }
@ -370,6 +380,7 @@ sugar_browser_scroll_pixels(SugarBrowser *browser,
int dx, int dx,
int dy) int dy)
{ {
#ifndef HAVE_GECKO_1_9
nsCOMPtr<nsIWebBrowser> webBrowser; nsCOMPtr<nsIWebBrowser> webBrowser;
gtk_moz_embed_get_nsIWebBrowser (GTK_MOZ_EMBED(browser), gtk_moz_embed_get_nsIWebBrowser (GTK_MOZ_EMBED(browser),
getter_AddRefs(webBrowser)); getter_AddRefs(webBrowser));
@ -387,6 +398,7 @@ sugar_browser_scroll_pixels(SugarBrowser *browser,
NS_ENSURE_TRUE (DOMWindow, ); NS_ENSURE_TRUE (DOMWindow, );
DOMWindow->ScrollBy (dx, dy); DOMWindow->ScrollBy (dx, dy);
#endif
} }
void void