X-Git-Url: https://git.decadent.org.uk/gitweb/?p=videolink.git;a=blobdiff_plain;f=browser_widget.cpp;h=3b7a2d442709ccd34fa37048c0cc33ae4f18e4c5;hp=46d1fb5e0ba97706c4d72414b9dad053464c9046;hb=e1f43b883bb767bc7f50b7c96b1579c0dd5b9290;hpb=74dbe6d5a31bbffaceb99c5a28c482a898ba1e37 diff --git a/browser_widget.cpp b/browser_widget.cpp index 46d1fb5..3b7a2d4 100644 --- a/browser_widget.cpp +++ b/browser_widget.cpp @@ -1,11 +1,21 @@ -// Copyright 2005 Ben Hutchings . +// Copyright 2005-8 Ben Hutchings . // See the file "COPYING" for licence details. #include "browser_widget.hpp" #include +#include + +#include #include +#if MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR == 9 +#include +#endif + +#include "xpcom_support.hpp" + +using xpcom_support::check; browser_widget::browser_widget() : Gtk::Bin(GTK_BIN(gtk_moz_embed_new())) @@ -518,7 +528,27 @@ Glib::ObjectBase * browser_widget::wrap_new(GObject * gobject) browser_widget::initialiser::initialiser() { +#if MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR == 9 + static const GREVersionRange gre_versions = { + "1.9a", PR_TRUE, + "1.9.*", PR_TRUE + }; + char path[PATH_MAX]; + check(GRE_GetGREPathWithProperties(&gre_versions, 1, 0, 0, + path, sizeof(path))); + + check(XPCOMGlueStartup(path)); + check(GTKEmbedGlueStartup()); + check(GTKEmbedGlueStartupInternal()); + + char * last_slash = std::strrchr(path, '/'); + if (last_slash != path) + *last_slash = '\0'; + gtk_moz_embed_set_path(path); +#else gtk_moz_embed_set_comp_path(MOZ_LIB_DIR); +#endif + gtk_moz_embed_push_startup(); wrap_register(gtk_moz_embed_get_type(), wrap_new); @@ -527,6 +557,10 @@ browser_widget::initialiser::initialiser() browser_widget::initialiser::~initialiser() { gtk_moz_embed_pop_startup(); + +#if MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR == 9 + XPCOMGlueShutdown(); +#endif } namespace Glib