Enabled building of embedding/browser/qt and widget/src/qt modules for cairo-qt build configuration
authorromaxa@romaxa.research.nokia.com
Sat, 19 Apr 2008 16:21:59 +0300
changeset 16759 121613a0b6ffdd0b3ec069de3bc68aeff783f4ea
parent 16758 6cfa2d695051115e8507d209ebebe8337178cf9b
child 16760 5a8341256ca9d11157eb0a26b8b303d03426b76a
push idunknown
push userunknown
push dateunknown
milestone2.0a1pre
Enabled building of embedding/browser/qt and widget/src/qt modules for cairo-qt build configuration
toolkit/Makefile.in
toolkit/components/remote/Makefile.in
toolkit/library/Makefile.in
toolkit/library/libxul-config.mk
toolkit/library/nsStaticXULComponents.cpp
toolkit/toolkit-tiers.mk
toolkit/xre/nsAppRunner.cpp
--- a/toolkit/Makefile.in
+++ b/toolkit/Makefile.in
@@ -50,16 +50,20 @@ DIRS	= \
 		profile \
 		themes \
 		$(NULL)
 
 ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
 DIRS += system/unixproxy
 endif
 
+ifneq (,$(filter qt,$(MOZ_WIDGET_TOOLKIT)))
+DIRS += system/unixproxy
+endif
+
 ifdef MOZ_CRASHREPORTER
 DIRS += crashreporter
 endif
 
 ifndef MINIMO
 DIRS += \
 	xre \
         mozapps \
--- a/toolkit/components/remote/Makefile.in
+++ b/toolkit/components/remote/Makefile.in
@@ -72,16 +72,20 @@ XPIDLSRCS = nsIRemoteService.idl
 ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
 CPPSRCS += nsGTKRemoteService.cpp
 endif
 
 ifeq (photon,$(MOZ_WIDGET_TOOLKIT))
 CPPSRCS += nsPhRemoteService.cpp
 endif
 
+ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
+CPPSRCS += nsQtRemoteService.cpp
+endif
+
 include $(topsrcdir)/config/rules.mk
 
 EXTRA_DSO_LDOPTS += $(MOZ_COMPONENT_LIBS) $(TK_LIBS)
 CXXFLAGS += $(TK_CFLAGS)
 
 # Add explicit X11 dependency when building against X11 toolkits
 ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
 EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS)
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -83,16 +83,23 @@ CPPSRCS += dlldeps-xul.cpp
 endif
 
 # dependent libraries
 ifneq (,$(MOZ_ENABLE_GTK2))
 SHARED_LIBRARY_LIBS += \
   $(DEPTH)/embedding/browser/gtk/src/$(LIB_PREFIX)gtkembedmoz.$(LIB_SUFFIX)
 DEFINES += -DMOZ_ENABLE_GTK2
 endif
+ifneq (,$(MOZ_ENABLE_QT))
+ifdef MOZ_ENABLE_LIBXUL
+SHARED_LIBRARY_LIBS += \
+  $(DEPTH)/embedding/browser/qt/src/$(LIB_PREFIX)qgeckoembed.$(LIB_SUFFIX)
+DEFINES += -DMOZ_ENABLE_QT
+endif
+endif
 
 SHARED_LIBRARY_LIBS += \
 	$(DEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX) \
 	$(NULL)
 
 SHARED_LIBRARY_LIBS += \
 	$(foreach component,$(COMPONENT_LIBS),$(DEPTH)/staticlib/components/$(LIB_PREFIX)$(component).$(LIB_SUFFIX)) \
 	$(foreach lib,$(STATIC_LIBS),$(DEPTH)/staticlib/$(LIB_PREFIX)$(lib).$(LIB_SUFFIX)) \
@@ -213,16 +220,21 @@ EXTRA_DSO_LDOPTS += \
 	$(NULL)
 endif
 
 ifeq (gtk2,$(MOZ_WIDGET_TOOLKIT))
 EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) $(MOZ_XFT_LIBS) $(MOZ_GTK2_LIBS) $(XT_LIBS) -lgthread-2.0
 EXTRA_DSO_LDOPTS += $(FT2_LIBS)
 endif
 
+ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
+EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) $(MOZ_XFT_LIBS) $(XT_LIBS) $(MOZ_QT_LIBS) -lgthread-2.0
+EXTRA_DSO_LDOPTS += $(FT2_LIBS)
+endif
+
 ifdef MOZ_ENABLE_STARTUP_NOTIFICATION
 EXTRA_DSO_LDOPTS += $(MOZ_STARTUP_NOTIFICATION_LIBS)
 endif
 
 ifeq ($(OS_ARCH),BeOS)
 EXTRA_DSO_LDOPTS += -lbe -ltracker
 endif
 
@@ -240,16 +252,20 @@ ifeq ($(OS_ARCH),WINCE)
 EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME, aygshell cellcore uuid ole32 oleaut32 )
 endif
 
 
 ifdef MOZ_JPROF
 EXTRA_DSO_LDOPTS += -ljprof
 endif
 
+ifdef MOZ_ENABLE_QT
+EXTRA_DSO_LDOPTS += $(MOZ_QT_LDFLAGS)
+endif
+
 ifdef MOZ_JAVAXPCOM
 dlldeps-javaxpcom.cpp: $(topsrcdir)/extensions/java/xpcom/src/dlldeps-javaxpcom.cpp
 	$(INSTALL) $^ .
 endif
 
 ifneq (,$(filter layout-debug,$(MOZ_EXTENSIONS)))
 DEFINES += -DMOZ_ENABLE_EXTENSION_LAYOUT_DEBUG
 endif
--- a/toolkit/library/libxul-config.mk
+++ b/toolkit/library/libxul-config.mk
@@ -150,16 +150,24 @@ endif
 ifdef MOZ_XUL
 ifdef MOZ_ENABLE_GTK2
 COMPONENT_LIBS += \
         unixproxy \
         $(NULL)
 endif
 endif
 
+ifdef MOZ_XUL
+ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
+COMPONENT_LIBS += \
+        unixproxy \
+        $(NULL)
+endif
+endif
+
 ifdef MOZ_PERF_METRICS
 EXTRA_DSO_LIBS  += mozutil_s
 endif
 
 ifdef MOZ_XPINSTALL
 DEFINES += -DMOZ_XPINSTALL
 COMPONENT_LIBS += \
 	xpinstall \
@@ -301,16 +309,19 @@ ifeq (beos,$(MOZ_WIDGET_TOOLKIT))
 COMPONENT_LIBS += widget_beos
 endif
 ifeq (os2,$(MOZ_WIDGET_TOOLKIT))
 COMPONENT_LIBS += wdgtos2
 endif
 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
 COMPONENT_LIBS += widget_mac
 endif
+ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
+COMPONENT_LIBS += widget_qt
+endif
 
 ifdef MOZ_ENABLE_PHOTON
 COMPONENT_LIBS += widget_photon
 endif
 
 ifdef MOZ_OJI
 STATIC_LIBS += jsj
 COMPONENT_LIBS += oji
--- a/toolkit/library/nsStaticXULComponents.cpp
+++ b/toolkit/library/nsStaticXULComponents.cpp
@@ -88,16 +88,18 @@
 #elif defined(XP_BEOS)
 #  define WIDGET_MODULES MODULE(nsWidgetBeOSModule)
 #elif defined(XP_OS2)
 #  define WIDGET_MODULES MODULE(nsWidgetOS2Module)
 #elif defined(MOZ_WIDGET_GTK2)
 #  define WIDGET_MODULES MODULE(nsWidgetGtk2Module)
 #elif defined(MOZ_WIDGET_PHOTON)
 #  define WIDGET_MODULES MODULE(nsWidgetPhModule)
+#elif defined(MOZ_WIDGET_QT)
+#  define WIDGET_MODULES MODULE(nsWidgetQtModule)
 #else
 #  error Unknown widget module.
 #endif
 
 #ifdef ICON_DECODER
 #define ICON_MODULE MODULE(nsIconDecoderModule)
 #else
 #define ICON_MODULE
@@ -245,16 +247,19 @@
 #else
 #define XMLEXTRAS_MODULE
 #endif
 
 #ifdef MOZ_XUL
 #ifdef MOZ_ENABLE_GTK2
 #define UNIXPROXY_MODULE MODULE(nsUnixProxyModule)
 #endif
+#if defined(MOZ_WIDGET_QT)
+#define UNIXPROXY_MODULE MODULE(nsUnixProxyModule)
+#endif
 #endif
 #ifndef UNIXPROXY_MODULE
 #define UNIXPROXY_MODULE
 #endif
 
 #define XUL_MODULES                          \
     MODULE(xpconnect)                        \
     MATHML_MODULES                           \
--- a/toolkit/toolkit-tiers.mk
+++ b/toolkit/toolkit-tiers.mk
@@ -240,29 +240,51 @@ ifdef MOZ_JAVAXPCOM
 tier_toolkit_dirs += extensions/java/xpcom/src
 endif
 
 ifndef BUILD_STATIC_LIBS
 ifdef MOZ_XUL_APP
 ifneq (,$(MOZ_ENABLE_GTK2))
 tier_toolkit_dirs += embedding/browser/gtk
 endif
+ifdef MOZ_ENABLE_LIBXUL
+ifneq (,$(MOZ_ENABLE_QT))
+tier_toolkit_dirs += embedding/browser/qt
+endif
+endif
 endif
 endif
 
 ifdef MOZ_XUL_APP
 ifndef BUILD_STATIC_LIBS
 tier_toolkit_dirs += toolkit/library
 endif
 endif
 
+ifndef BUILD_STATIC_LIBS
+ifdef MOZ_XUL_APP
+ifndef MOZ_ENABLE_LIBXUL
+#ifneq (,$(MOZ_ENABLE_GTK2))
+#tier_toolkit_dirs += embedding/browser/gtk
+#endif
+ifneq (,$(MOZ_ENABLE_QT))
+tier_toolkit_dirs += embedding/browser/qt
+endif
+endif
+endif
+endif
+
 ifdef MOZ_ENABLE_LIBXUL
 tier_toolkit_dirs += xpcom/stub
 endif
 
+ifneq (,$(MOZ_ENABLE_QT))
+tier_toolkit_dirs += embedding/browser/qt/tests
+endif
+
 ifdef NS_TRACE_MALLOC
 tier_toolkit_dirs += tools/trace-malloc
 endif
 
 ifdef MOZ_LDAP_XPCOM
 tier_toolkit_staticdirs += directory/c-sdk
 tier_toolkit_dirs	+= directory/xpcom
 endif
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -46,16 +46,21 @@
 #include <os2safe.h>
 #endif
 
 #define XPCOM_TRANSLATE_NSGM_ENTRY_POINT 1
 
 #include "nsAppRunner.h"
 #include "nsUpdateDriver.h"
 
+#if defined(MOZ_WIDGET_QT)
+#include <qwidget.h>
+#include <qapplication.h>
+#endif
+
 #ifdef XP_MACOSX
 #include "MacLaunchHelper.h"
 #include "MacApplicationDelegate.h"
 #endif
 
 #ifdef XP_OS2
 #include "private/pprthred.h"
 #endif
@@ -2769,16 +2774,19 @@ XRE_main(int argc, char* argv[], const n
 #define HAVE_DESKTOP_STARTUP_ID
     const char* desktopStartupIDEnv = PR_GetEnv("DESKTOP_STARTUP_ID");
     nsCAutoString desktopStartupID;
     if (desktopStartupIDEnv) {
       desktopStartupID.Assign(desktopStartupIDEnv);
     }
 #endif
 
+#if defined(MOZ_WIDGET_QT)
+    QApplication app(gArgc, gArgv);
+#endif
 #if defined(MOZ_WIDGET_GTK2)
     g_thread_init(NULL);
     // setup for private colormap.  Ideally we'd like to do this
     // in nsAppShell::Create, but we need to get in before gtk
     // has been initialized to make sure everything is running
     // consistently.
     if (CheckArg("install"))
       gdk_rgb_set_install(TRUE);