]> git.decadent.org.uk Git - videolink.git/blobdiff - browser_widget.cpp
Update version checks for XULRunner 2.0 (beta)
[videolink.git] / browser_widget.cpp
index 07df0d0e86250c72957526144c57b27f1b23b769..d45970aa045f6a1c3051dbafb182c0e42c3cc0c1 100644 (file)
@@ -8,10 +8,13 @@
 
 #include <limits.h>
 
+#include "videolink.hpp"
+#include "wchar_t_short.h"
 #include <gtkmozembed_internal.h>
-#if MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR == 9
+#if MOZ_VERSION_GE(1,9,0)
 #include <gtkmozembed_glue.cpp>
 #endif
+#include "wchar_t_default.h"
 
 #include "xpcom_support.hpp"
 
@@ -528,10 +531,20 @@ Glib::ObjectBase * browser_widget::wrap_new(GObject * gobject)
 
 browser_widget::initialiser::initialiser()
 {
-#if MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR == 9
+#if MOZ_VERSION_GE(1,9,0)
     static const GREVersionRange gre_versions = {
+#if MOZ_VERSION_EQ(1,9,0)
        "1.9a", PR_TRUE,
-       "1.9.*", PR_TRUE
+       "1.9.1", PR_FALSE
+#elif MOZ_VERSION_EQ(1,9,1)
+       "1.9.1", PR_TRUE,
+       "1.9.2", PR_FALSE
+#elif MOZ_VERSION_EQ(2,0,-1) || MOZ_VERSION_EQ(2,0,0)
+       "2.0b", PR_TRUE,
+       "2.0.1", PR_FALSE
+#else
+#error "version is unsupported, but you could try continuing the pattern above"
+#endif
     };
     char path[PATH_MAX];
     check(GRE_GetGREPathWithProperties(&gre_versions, 1, 0, 0,
@@ -539,6 +552,7 @@ browser_widget::initialiser::initialiser()
 
     check(XPCOMGlueStartup(path));
     check(GTKEmbedGlueStartup());
+    check(GTKEmbedGlueStartupInternal());
 
     char * last_slash = std::strrchr(path, '/');
     if (last_slash != path)
@@ -557,7 +571,7 @@ browser_widget::initialiser::~initialiser()
 {
     gtk_moz_embed_pop_startup();
 
-#if MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR == 9
+#if MOZ_VERSION_GE(1,9,0)
     XPCOMGlueShutdown();
 #endif
 }