Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2007-01-23 22:14:22 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2007-01-23 22:14:22 (GMT)
commit997a90d7cc9b458ec1c94821a12f9dd6f120ba10 (patch)
treef1a61c0c6940fe1107be3ae1523e95145e6bbba1 /lib
parent94d7f94534695206afb160b47f46f370c70a713d (diff)
Actually make it work on 1.9. Had to disable some stuff, temporarily.
Diffstat (limited to 'lib')
-rw-r--r--lib/python/Makefile.am4
-rw-r--r--lib/python/_sugarmodule.c4
-rw-r--r--lib/src/sugar-browser.cpp18
3 files changed, 22 insertions, 4 deletions
diff --git a/lib/python/Makefile.am b/lib/python/Makefile.am
index fb16653..7d24950 100644
--- a/lib/python/Makefile.am
+++ b/lib/python/Makefile.am
@@ -20,7 +20,9 @@ _sugar_la_LIBADD = \
$(top_builddir)/lib/src/libsugarprivate.la
_sugar_la_SOURCES = \
- _sugarmodule.c
+ _sugarmodule.c \
+ xulrunner.cpp \
+ xulrunner.h
nodist__sugar_la_SOURCES = _sugar.c
diff --git a/lib/python/_sugarmodule.c b/lib/python/_sugarmodule.c
index c576efb..01b4e69 100644
--- a/lib/python/_sugarmodule.c
+++ b/lib/python/_sugarmodule.c
@@ -2,6 +2,8 @@
#include "config.h"
#endif
+#include "xulrunner.h"
+
/* include this first, before NO_IMPORT_PYGOBJECT is defined */
#include <pygobject.h>
@@ -17,6 +19,8 @@ init_sugar(void)
{
PyObject *m, *d;
+ xulrunner_startup();
+
init_pygobject ();
Pycairo_IMPORT;
diff --git a/lib/src/sugar-browser.cpp b/lib/src/sugar-browser.cpp
index eec10df..fe94378 100644
--- a/lib/src/sugar-browser.cpp
+++ b/lib/src/sugar-browser.cpp
@@ -17,6 +17,8 @@
* Boston, MA 02111-1307, USA.
*/
+#include <config.h>
+
#include "sugar-browser.h"
#include "GeckoContentHandler.h"
#include "GeckoDownload.h"
@@ -35,9 +37,6 @@
#include <nsIComponentRegistrar.h>
#include <nsIComponentManager.h>
-NS_GENERIC_FACTORY_CONSTRUCTOR(GeckoContentHandler)
-NS_GENERIC_FACTORY_CONSTRUCTOR(GeckoDownload)
-
enum {
PROP_0,
PROP_PROGRESS,
@@ -48,6 +47,11 @@ enum {
PROP_LOADING
};
+#ifndef HAVE_GECKO_1_9
+
+NS_GENERIC_FACTORY_CONSTRUCTOR(GeckoContentHandler)
+NS_GENERIC_FACTORY_CONSTRUCTOR(GeckoDownload)
+
static const nsModuleComponentInfo sSugarComponents[] = {
{
"Gecko Content Handler",
@@ -63,6 +67,8 @@ static const nsModuleComponentInfo sSugarComponents[] = {
}
};
+#endif
+
gboolean
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);
}
+#ifndef HAVE_GECKO_1_9
+
/* Register our components */
nsCOMPtr<nsIComponentRegistrar> componentRegistrar;
NS_GetComponentRegistrar(getter_AddRefs(componentRegistrar));
@@ -135,6 +143,8 @@ sugar_browser_startup(const char *profile_path, const char *profile_name)
}
}
}
+
+#endif
return TRUE;
}
@@ -370,6 +380,7 @@ sugar_browser_scroll_pixels(SugarBrowser *browser,
int dx,
int dy)
{
+#ifndef HAVE_GECKO_1_9
nsCOMPtr<nsIWebBrowser> webBrowser;
gtk_moz_embed_get_nsIWebBrowser (GTK_MOZ_EMBED(browser),
getter_AddRefs(webBrowser));
@@ -387,6 +398,7 @@ sugar_browser_scroll_pixels(SugarBrowser *browser,
NS_ENSURE_TRUE (DOMWindow, );
DOMWindow->ScrollBy (dx, dy);
+#endif
}
void