r7221 - in dumbhippo/trunk/client: common/firefox/extension common/firefox/src linux



Author: walters
Date: 2008-01-16 16:40:01 -0600 (Wed, 16 Jan 2008)
New Revision: 7221

Modified:
   dumbhippo/trunk/client/common/firefox/extension/install.rdf
   dumbhippo/trunk/client/common/firefox/src/hippoControl.cpp
   dumbhippo/trunk/client/common/firefox/src/hippoModule.cpp
   dumbhippo/trunk/client/linux/configure.ac
   dumbhippo/trunk/client/linux/firefox-update.sh
Log:
Firefox 3 support:

Bump supported version in install.rdf.

Add a link in new "system extensions" directory.

Port code from startup-notification patch to get native
widget for a window.

Add configury goo using new libxul-unstable.pc file.

Include various headers that are necessary now.



Modified: dumbhippo/trunk/client/common/firefox/extension/install.rdf
===================================================================
--- dumbhippo/trunk/client/common/firefox/extension/install.rdf	2008-01-16 22:38:36 UTC (rev 7220)
+++ dumbhippo/trunk/client/common/firefox/extension/install.rdf	2008-01-16 22:40:01 UTC (rev 7221)
@@ -16,7 +16,7 @@
                     <Description>
                         <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
                         <em:minVersion>1.5</em:minVersion>
-                        <em:maxVersion>2.0.0.*</em:maxVersion>
+                        <em:maxVersion>3.0b3pre</em:maxVersion>
                     </Description>
                 </em:targetApplication>
  

Modified: dumbhippo/trunk/client/common/firefox/src/hippoControl.cpp
===================================================================
--- dumbhippo/trunk/client/common/firefox/src/hippoControl.cpp	2008-01-16 22:38:36 UTC (rev 7220)
+++ dumbhippo/trunk/client/common/firefox/src/hippoControl.cpp	2008-01-16 22:40:01 UTC (rev 7221)
@@ -28,10 +28,13 @@
 #include "nsServiceManagerUtils.h"
 #include "nsStringAPI.h"
 #include "hippoControl.h"
+#include "nsIClassInfoImpl.h"
 
 #ifdef HIPPO_OS_LINUX
 // These headers are used for finding the GdkWindow for a DOM window
 #include "nsIBaseWindow.h"
+#include "nsIDocument.h"
+#include "nsPIDOMWindow.h"
 #include "nsIDocShell.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIWidget.h"
@@ -132,6 +135,22 @@
     return NS_OK;
 }
 
+static nsIWidget* GetMainWidget(nsIDOMWindow* aWindow)
+{
+  // get the native window for this instance
+  nsCOMPtr<nsPIDOMWindow> window(do_QueryInterface(aWindow));
+  NS_ENSURE_TRUE(window, nsnull);
+  nsCOMPtr<nsIDocument> doc(do_QueryInterface(window->GetExtantDocument()));
+  NS_ENSURE_TRUE(doc, nsnull);
+  nsCOMPtr<nsISupports> container = doc->GetContainer();
+  nsCOMPtr<nsIBaseWindow> baseWindow(do_QueryInterface(container));
+  NS_ENSURE_TRUE(baseWindow, nsnull);
+ 
+  nsCOMPtr<nsIWidget> mainWidget;
+  baseWindow->GetMainWidget(getter_AddRefs(mainWidget));
+  return mainWidget;
+}
+
 /* void setListener (in hippoIControlListener listener); */
 NS_IMETHODIMP hippoControl::SetWindow(nsIDOMWindow *window)
 {
@@ -152,16 +171,8 @@
      * gdk_window_toplevel() ... much easier than walking up the 
      * Mozilla hierarchy.
      */
-    nsCOMPtr<nsIScriptGlobalObject> global = do_QueryInterface(window);
+    nsCOMPtr<nsIWidget> widget = GetMainWidget(window);
 
-    nsCOMPtr<nsIBaseWindow> baseWindow;
-    if (global)
-        baseWindow = do_QueryInterface(global->GetDocShell());
-    
-    nsCOMPtr<nsIWidget> widget;
-    if (baseWindow)
-        baseWindow->GetMainWidget(getter_AddRefs(widget));
-    
     GdkWindow *nativeWindow = NULL;
     if (widget)
         nativeWindow = (GdkWindow *)widget->GetNativeData(NS_NATIVE_WINDOW);

Modified: dumbhippo/trunk/client/common/firefox/src/hippoModule.cpp
===================================================================
--- dumbhippo/trunk/client/common/firefox/src/hippoModule.cpp	2008-01-16 22:38:36 UTC (rev 7220)
+++ dumbhippo/trunk/client/common/firefox/src/hippoModule.cpp	2008-01-16 22:40:01 UTC (rev 7221)
@@ -10,6 +10,7 @@
 #include "nsIServiceManager.h"
 #include "nsISupportsUtils.h"
 #include "nsServiceManagerUtils.h"
+#include "nsIClassInfoImpl.h"
 
 #include "hippoControl.h"
 #include "hippoExtension.h"
@@ -66,3 +67,4 @@
 };
 
 NS_IMPL_NSGETMODULE(hippoModule, components)
+

Modified: dumbhippo/trunk/client/linux/configure.ac
===================================================================
--- dumbhippo/trunk/client/linux/configure.ac	2008-01-16 22:38:36 UTC (rev 7220)
+++ dumbhippo/trunk/client/linux/configure.ac	2008-01-16 22:40:01 UTC (rev 7221)
@@ -549,6 +549,19 @@
     XPIDL="$with_xpidl"
 fi
 
+AC_MSG_CHECKING([for libxul-unstable])
+HIPPO_PKG_CHECK_EXISTS(libxul-unstable, have_xulrunner=true, have_xulrunner=false)
+if test "x${have_xulrunner}" = "xtrue"; then
+    AC_MSG_RESULT([yes])
+    AC_DEFINE(HAVE_XULRUNNER, 1, [whether we have XULRunner])
+    idldir=`pkg-config --variable=idldir libxul-unstable`
+    GECKO_IDLDIR="${idldir}"
+    GECKO_INCLUDEDIR=`pkg-config --variable=includedir libxul-unstable`
+    XPIDL=`pkg-config --variable=sdkdir libxul-unstable`/bin/xpidl
+else
+    AC_MSG_RESULT([no])
+fi
+
 # if the firefox-devel RPM is installed, set paths from that
 if test \( x"$GECKO_IDLDIR" = x -o "x$GECKO_INCLUDEDIR" = x -o "x$XPIDL" = x \) -a -x /bin/rpm ; then
    AC_MSG_CHECKING([for Gecko SDK via the firefox-devel package])
@@ -604,17 +617,21 @@
     AC_MSG_ERROR([Must either specify --with-gecko-sdk=DIR or --with-gecko-idl=DIR])
 fi
 
+if test "x${have_xulrunner}" != xtrue; then
 if test "x$GECKO_INCLUDEDIR" != x ; then
+   AC_MSG_CHECKING([for "full gecko" style includes])
    if test -f "$GECKO_INCLUDEDIR/caps/nsIScriptSecurityManager.h" ; then
-	have_full_gecko=true
+       have_full_gecko=true
+       AC_MSG_RESULT([yes])
    elif test -f "$GECKO_INCLUDEDIR/nsIURI.h" ; then
-	:
+       AC_MSG_RESULT([no])
    else
        AC_MSG_ERROR([Cannot find Gecko headers in $GECKO_INCLUDEDIR])
    fi
 else
     AC_MSG_ERROR([Must either specify --with-gecko-sdk=DIR or --with-gecko-headers=DIR])
 fi
+fi
 
 # If we are using the cut-and-paste version of nsIXPCSecurityManager.h, we don't
 # need the Javascript headers, otherwise we do. Debian packages the Javascript
@@ -668,10 +685,17 @@
 
 PKG_CHECK_MODULES(LIBHIPPOFIREFOX, gobject-2.0 dbus-1 >= $DBUS_REQUIRED dbus-glib-1 >= $DBUS_REQUIRED $NSPR_PACKAGES $JS_PACKAGES gtk+-2.0)
 
+if test "x${have_xulrunner}"; then
+  LIBHIPPOFIREFOX_CFLAGS="`pkg-config --cflags libxul-unstable` ${LIBHIPPOFIREFOX_CFLAGS}"
+fi
 # Should have -lxpcom here, but that upsets libtool for unknown reasons. Or
 # should we use -lxpcomglue instead? We don't actually link to anything private, though
 # we use some private interfaces
 LIBHIPPOFIREFOX_LIBS="$LIBHIPPOFIREFOX_LIBS $NSPR_LIBS"
+if test "x${have_xulrunner}" = "xtrue"; then
+  # We need to match the mozilla version by compiling with short-wchar
+  LIBHIPPOFIREFOX_LIBS="${LIBHIPPOFIREFOX_LIBS} `pkg-config --libs libxul-unstable`"
+fi
 
 #### define absolute path to srcdir for debugging-only code
 ABSOLUTE_TOP_SRCDIR=`cd ${srcdir} && pwd`
@@ -705,10 +729,12 @@
         LIBHIPPO_CFLAGS:          ${LIBHIPPO_CFLAGS}
         LIBDDM_CFLAGS:            ${LIBDDM_CFLAGS}
         MUGSHOT_CFLAGS:           ${MUGSHOT_CFLAGS}
+        LIBHIPPOFIREFOX_CFLAGS:   ${LIBHIPPOFIREFOX_CFLAGS}
 
         LIBHIPPO_LIBS:            ${LIBHIPPO_LIBS}
         LIBDDM_LIBS:              ${LIBDDM_LIBS}
         MUGSHOT_LIBS:             ${MUGSHOT_LIBS}
+        LIBHIPPOFIREFOX_LIBS:     ${LIBHIPPOFIREFOX_LIBS}
 
         Now type 'make' to build $PACKAGE
 "

Modified: dumbhippo/trunk/client/linux/firefox-update.sh
===================================================================
--- dumbhippo/trunk/client/linux/firefox-update.sh	2008-01-16 22:38:36 UTC (rev 7220)
+++ dumbhippo/trunk/client/linux/firefox-update.sh	2008-01-16 22:40:01 UTC (rev 7221)
@@ -5,6 +5,8 @@
 # upgraded, as well as when our package is installed. It is needed because
 # Firefox is installed into versioned directories in /usr/lib[64]/firefox
 #
+
+EXT_ID=firefox mugshot org
 if [ "$1" = "install" ] ; then
     for libdir in /usr/lib /usr/lib64 ; do
 	# Add symlinks to any firefox directory that looks like it is part of a
@@ -13,12 +15,16 @@
 	    if [ "$d" = "$libdir/firefox*" -o "$d" = "$libdir/iceweasel*" ] ; then
 		continue
 	    fi
-	    link=$d/extensions/firefox mugshot org
+	    link=$d/extensions/$EXT_ID
 	    target=$libdir/mugshot/firefox
 	    if [ -e $target -a \( -e $d/firefox-bin -o -e $d/firefox \) -a -d $d/extensions -a ! -L $link ] ; then
 		ln -s $target $link
 	    fi
 	done
+        link="$libdir/mozilla/extensions/$EXT_ID"
+        if [ -d $libdir/mozilla/extensions -a ! -L "$link" ]; then
+            ln -s $libdir/mugshot/firefox "$link"
+        fi
     done
 elif [ "$1" = "remove" ] ; then
     for libdir in /usr/lib /usr/lib64 ; do
@@ -27,12 +33,16 @@
 	    if [ "$d" = "$libdir/firefox*" -o "$d" = "$libdir/iceweasel*" ] ; then
 		continue
 	    fi
-	    link=$d/extensions/firefox mugshot org
+	    link=$d/extensions/$EXT_ID
 	    if [ -L $link ] ; then
 		rm $link
 	    fi
 	done
      done
+     if [ -d $libdir/mozilla/extensions ]; then
+        rm $libdir/mozilla/extensions/$EXT_ID
+     fi
 else
     echo "Usage firefox-update.sh [install/remove]"
 fi
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]