r7223 - in dumbhippo/trunk/client: common/firefox/src linux



Author: walters
Date: 2008-01-17 13:51:11 -0600 (Thu, 17 Jan 2008)
New Revision: 7223

Modified:
   dumbhippo/trunk/client/common/firefox/src/hippoControl.cpp
   dumbhippo/trunk/client/common/firefox/src/hippoModule.cpp
   dumbhippo/trunk/client/linux/Makefile-libhippofirefox.am
   dumbhippo/trunk/client/linux/configure.ac
Log:
Add some ifdefs so we work again on Firefox 2.



Modified: dumbhippo/trunk/client/common/firefox/src/hippoControl.cpp
===================================================================
--- dumbhippo/trunk/client/common/firefox/src/hippoControl.cpp	2008-01-17 19:23:19 UTC (rev 7222)
+++ dumbhippo/trunk/client/common/firefox/src/hippoControl.cpp	2008-01-17 19:51:11 UTC (rev 7223)
@@ -28,17 +28,24 @@
 #include "nsServiceManagerUtils.h"
 #include "nsStringAPI.h"
 #include "hippoControl.h"
+#ifdef HAVE_XULRUNNER
 #include "nsIClassInfoImpl.h"
+#else
+#include "nsISupportsImpl.h"
+#endif
 
 #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"
+// For Firefox 2, this is "internal API".
+#ifdef HAVE_XULRUNNER
+#include "nsIDocument.h"
+#include "nsPIDOMWindow.h"
 #endif
+#endif
 
 hippoControl::hippoControl()
 {
@@ -137,18 +144,44 @@
 
 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;
+    /* The window ID that we want to pass to the Mugshot client is 
+     * the window ID that corresponds to the frame that the chat is
+     * in. If the Mugshot client needs the toplevel, it can walk up
+     * the hierarchy and find it, but passing the inner window allows
+     * more intelligence in knowing if the chat is actually visible.
+     *
+     * To switch to passing the toplevel, simply insert a call to
+     * gdk_window_toplevel() ... much easier than walking up the 
+     * Mozilla hierarchy.
+     */	
+#ifndef WITH_MAEMO	
+#ifdef HAVE_XULRUNNER
+	// 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;	
+#else
+	nsCOMPtr<nsIScriptGlobalObject> global = do_QueryInterface(aWindow);
+	 
+	nsCOMPtr<nsIBaseWindow> baseWindow;
+	if (global)
+	    baseWindow = do_QueryInterface(global->GetDocShell());   
+	nsCOMPtr<nsIWidget> widget;
+	if (baseWindow)
+	    baseWindow->GetMainWidget(getter_AddRefs(widget));
+	return widget;
+#endif /* HAVE_XULRUNNER */
+#else
+  return NULL;
+#endif
 }
 
 /* void setListener (in hippoIControlListener listener); */
@@ -160,17 +193,7 @@
 
 #ifdef HIPPO_OS_LINUX
     HippoWindowId windowId = 0;
-    
-    /* The window ID that we want to pass to the Mugshot client is 
-     * the window ID that corresponds to the frame that the chat is
-     * in. If the Mugshot client needs the toplevel, it can walk up
-     * the hierarchy and find it, but passing the inner window allows
-     * more intelligence in knowing if the chat is actually visible.
-     *
-     * To switch to passing the toplevel, simply insert a call to
-     * gdk_window_toplevel() ... much easier than walking up the 
-     * Mozilla hierarchy.
-     */
+
     nsCOMPtr<nsIWidget> widget = GetMainWidget(window);
 
     GdkWindow *nativeWindow = NULL;

Modified: dumbhippo/trunk/client/common/firefox/src/hippoModule.cpp
===================================================================
--- dumbhippo/trunk/client/common/firefox/src/hippoModule.cpp	2008-01-17 19:23:19 UTC (rev 7222)
+++ dumbhippo/trunk/client/common/firefox/src/hippoModule.cpp	2008-01-17 19:51:11 UTC (rev 7223)
@@ -10,7 +10,7 @@
 #include "nsIServiceManager.h"
 #include "nsISupportsUtils.h"
 #include "nsServiceManagerUtils.h"
-#include "nsIClassInfoImpl.h"
+#include "nsISupportsImpl.h"
 
 #include "hippoControl.h"
 #include "hippoExtension.h"

Modified: dumbhippo/trunk/client/linux/Makefile-libhippofirefox.am
===================================================================
--- dumbhippo/trunk/client/linux/Makefile-libhippofirefox.am	2008-01-17 19:23:19 UTC (rev 7222)
+++ dumbhippo/trunk/client/linux/Makefile-libhippofirefox.am	2008-01-17 19:51:11 UTC (rev 7223)
@@ -67,10 +67,12 @@
 libhippofirefox_la_CPPFLAGS +=			\
 	-I $(GECKO_INCLUDEDIR)			\
 	-I $(GECKO_INCLUDEDIR)/caps		\
+    -I $(GECKO_INCLUDEDIR)/content     \	
 	-I $(GECKO_INCLUDEDIR)/docshell		\
 	-I $(GECKO_INCLUDEDIR)/dom		\
 	-I $(GECKO_INCLUDEDIR)/gfx		\
 	-I $(GECKO_INCLUDEDIR)/js		\
+    -I $(GECKO_INCLUDEDIR)/layout     \	
 	-I $(GECKO_INCLUDEDIR)/necko		\
 	-I $(GECKO_INCLUDEDIR)/string		\
 	-I $(GECKO_INCLUDEDIR)/widget		\

Modified: dumbhippo/trunk/client/linux/configure.ac
===================================================================
--- dumbhippo/trunk/client/linux/configure.ac	2008-01-17 19:23:19 UTC (rev 7222)
+++ dumbhippo/trunk/client/linux/configure.ac	2008-01-17 19:51:11 UTC (rev 7223)
@@ -561,7 +561,7 @@
 fi
 
 AC_MSG_CHECKING([for libxul-unstable])
-HIPPO_PKG_CHECK_EXISTS(libxul-unstable, have_xulrunner=true, have_xulrunner=false)
+HIPPO_PKG_CHECK_EXISTS(libxul-unstable >= 1.9, 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])
@@ -629,6 +629,7 @@
 fi
 
 if test "x${have_xulrunner}" != xtrue; then
+   AC_DEFINE(HAVE_PRE_XULRUNNER_SDK, 1, [Define if not using XULRunner])
 if test "x$GECKO_INCLUDEDIR" != x ; then
    AC_MSG_CHECKING([for "full gecko" style includes])
    if test -f "$GECKO_INCLUDEDIR/caps/nsIScriptSecurityManager.h" ; then



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