[dfb,422221] Gtk/DirectFB misc build stuff
authorVladimir Vukicevic <vladimir@pobox.com>
Wed, 06 Aug 2008 13:48:55 -0700
changeset 16450 5df6cd3f820fe8d0edf248de93c28760060c88ef
parent 16449 d883ab4b8f41e13f8800a8af2b5526d5d107c4de
child 16451 4a81e6e5f362cf56f6f6fb2819ddfd3f73def4fb
push idunknown
push userunknown
push dateunknown
bugs422221
milestone1.9.1a2pre
[dfb,422221] Gtk/DirectFB misc build stuff
config/autoconf.mk.in
config/system-headers
toolkit/library/libxul-config.mk
toolkit/toolkit-tiers.mk
toolkit/xre/nsAppRunner.cpp
toolkit/xre/nsNativeAppSupportUnix.cpp
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -79,18 +79,21 @@ LIBXUL_DIST = $(DIST)
 endif
 
 XULRUNNER_STUB_NAME = @XULRUNNER_STUB_NAME@
 
 MOZ_CHROME_FILE_FORMAT	= @MOZ_CHROME_FILE_FORMAT@
 
 MOZ_WIDGET_TOOLKIT	= @MOZ_WIDGET_TOOLKIT@
 MOZ_GFX_TOOLKIT		= @MOZ_GFX_TOOLKIT@
+MOZ_DFB			= @MOZ_DFB@
 MOZ_X11			= @MOZ_X11@
 
+MOZ_PANGO = @MOZ_PANGO@
+
 MOZ_JS_LIBS		   = @MOZ_JS_LIBS@
 
 MOZ_DEBUG	= @MOZ_DEBUG@
 MOZ_DEBUG_MODULES = @MOZ_DEBUG_MODULES@
 MOZ_PROFILE_MODULES = @MOZ_PROFILE_MODULES@
 MOZ_DEBUG_ENABLE_DEFS		= @MOZ_DEBUG_ENABLE_DEFS@
 MOZ_DEBUG_DISABLE_DEFS	= @MOZ_DEBUG_DISABLE_DEFS@
 MOZ_DEBUG_FLAGS	= @MOZ_DEBUG_FLAGS@
--- a/config/system-headers
+++ b/config/system-headers
@@ -75,24 +75,25 @@ byteswap.h
 #define WRAP_CAIRO_HEADERS
 #endif
 #ifdef WRAP_CAIRO_HEADERS
 cairo.h
 cairo-atsui.h
 cairo-beos.h
 cairo-ft.h
 cairo-glitz.h
-cairo-nquartz.h
 cairo-os2.h
 cairo-pdf.h
 cairo-ps.h
 cairo-quartz.h
 cairo-win32.h
 cairo-xlib.h
 cairo-xlib-xrender.h
+cairo-directfb.h
+cairo-qpainter.h
 #endif
 callconv.h
 Carbon/Carbon.h
 CarbonEvents.h
 Carbon.h
 cassert
 c_asm.h
 cctype
--- a/toolkit/library/libxul-config.mk
+++ b/toolkit/library/libxul-config.mk
@@ -272,18 +272,20 @@ endif
 ifdef MOZ_ENABLE_GTK2
 COMPONENT_LIBS += widget_gtk2
 ifdef MOZ_PREF_EXTENSIONS
 COMPONENT_LIBS += system-pref
 endif
 endif
 
 ifdef MOZ_ENABLE_GTK2
+ifdef MOZ_X11
 STATIC_LIBS += gtkxtbin
 endif
+endif
 
 ifdef MOZ_IPCD
 DEFINES += -DMOZ_IPCD
 COMPONENT_LIBS += ipcdc
 endif
 
 ifdef MOZ_ENABLE_POSTSCRIPT
 DEFINES += -DMOZ_ENABLE_POSTSCRIPT
--- a/toolkit/toolkit-tiers.mk
+++ b/toolkit/toolkit-tiers.mk
@@ -79,18 +79,20 @@ endif
 #
 
 tier_gecko_dirs += \
 		js/src/xpconnect \
 		intl/chardet \
 		$(NULL)
 
 ifdef MOZ_ENABLE_GTK2
+ifdef MOZ_X11
 tier_gecko_dirs     += widget/src/gtkxtbin
 endif
+endif
 
 ifdef MOZ_IPCD
 tier_gecko_dirs += ipc/ipcd
 endif
 
 tier_gecko_dirs	+= \
 		modules/libutil \
 		modules/libjar \
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -264,17 +264,19 @@ char **gArgv;
 static char gToolkitVersion[20];
 static char gToolkitBuildID[40];
 
 static int    gRestartArgc;
 static char **gRestartArgv;
 
 #if defined(MOZ_WIDGET_GTK2)
 #include <gtk/gtk.h>
+#ifdef MOZ_X11
 #include <gdk/gdkx.h>
+#endif /* MOZ_X11 */
 #include "nsGTKToolkit.h"
 #endif
 
 // Save the given word to the specified environment variable.
 static void
 SaveWordToEnv(const char *name, const nsACString & word)
 {
   char *expr = PR_smprintf("%s=%s", name, PromiseFlatCString(word).get());
@@ -2381,23 +2383,27 @@ static void MOZ_gdk_display_close(GdkDis
     g_free(theme_name);
   }
 
   // gdk_display_close was broken prior to gtk+-2.10.0.
   // (http://bugzilla.gnome.org/show_bug.cgi?id=85715)
   // gdk_display_manager_set_default_display (gdk_display_manager_get(), NULL)
   // was also broken.
   if (gtk_check_version(2,10,0) != NULL) {
+#ifdef MOZ_X11
     // Version check failed - broken gdk_display_close.
     //
     // Let the gdk structures leak but at least close the Display,
     // assuming that gdk will not use it again.
     Display* dpy = GDK_DISPLAY_XDISPLAY(display);
     if (!theme_is_qt)
       XCloseDisplay(dpy);
+#else
+    gdk_display_close(display);
+#endif /* MOZ_X11 */
   }
   else {
     if (!theme_is_qt)
       gdk_display_close(display);
 #if GTK_CHECK_VERSION(2,8,0) && \
   (defined(DEBUG) || defined(NS_BUILD_REFCNT_LOGGING) || defined(NS_TRACE_MALLOC))
     cairo_debug_reset_static_data();
 #endif
--- a/toolkit/xre/nsNativeAppSupportUnix.cpp
+++ b/toolkit/xre/nsNativeAppSupportUnix.cpp
@@ -292,16 +292,18 @@ nsNativeAppSupportUnix::Start(PRBool *aR
                        nsnull,
                        OssoHardwareCallback,
                        &m_hw_state);
 
 #endif
 
   *aRetVal = PR_TRUE;
 
+#ifdef MOZ_X11
+
   PRLibrary *gnomeuiLib = PR_LoadLibrary("libgnomeui-2.so.0");
   if (!gnomeuiLib)
     return NS_OK;
 
   PRLibrary *gnomeLib = PR_LoadLibrary("libgnome-2.so.0");
   if (!gnomeLib) {
     PR_UnloadLibrary(gnomeuiLib);
     return NS_OK;
@@ -311,52 +313,58 @@ nsNativeAppSupportUnix::Start(PRBool *aR
     (_gnome_program_init_fn)PR_FindFunctionSymbol(gnomeLib, "gnome_program_init");
   _libgnomeui_module_info_get_fn libgnomeui_module_info_get = (_libgnomeui_module_info_get_fn)PR_FindFunctionSymbol(gnomeuiLib, "libgnomeui_module_info_get");
   if (!gnome_program_init || !libgnomeui_module_info_get) {
     PR_UnloadLibrary(gnomeuiLib);
     PR_UnloadLibrary(gnomeLib);
     return NS_OK;
   }
 
+#endif /* MOZ_X11 */
+
 #ifdef ACCESSIBILITY
   // We will load gail, atk-bridge by ourself later
   // We can't run atk-bridge init here, because gail get the control
   // Set GNOME_ACCESSIBILITY to 0 can avoid this
   static const char *accEnv = "GNOME_ACCESSIBILITY";
   const char *accOldValue = getenv(accEnv);
   setenv(accEnv, "0", 1);
 #endif
 
+#ifdef MOZ_X11
   gnome_program_init("Gecko", "1.0", libgnomeui_module_info_get(), gArgc, gArgv, NULL);
+#endif /* MOZ_X11 */
 
 #ifdef ACCESSIBILITY
   if (accOldValue) { 
     setenv(accEnv, accOldValue, 1);
   } else {
     unsetenv(accEnv);
   }
 #endif
 
   // Careful! These libraries cannot be unloaded after this point because
   // gnome_program_init causes atexit handlers to be registered. Strange
   // crashes will occur if these libraries are unloaded.
 
+#ifdef MOZ_X11
   gnome_client_request_interaction = (_gnome_client_request_interaction_fn)
     PR_FindFunctionSymbol(gnomeuiLib, "gnome_client_request_interaction");
   gnome_interaction_key_return = (_gnome_interaction_key_return_fn)
     PR_FindFunctionSymbol(gnomeuiLib, "gnome_interaction_key_return");
   gnome_client_set_restart_command = (_gnome_client_set_restart_command_fn)
     PR_FindFunctionSymbol(gnomeuiLib, "gnome_client_set_restart_command");
 
   _gnome_master_client_fn gnome_master_client = (_gnome_master_client_fn)
     PR_FindFunctionSymbol(gnomeuiLib, "gnome_master_client");
 
   GnomeClient *client = gnome_master_client();
   g_signal_connect(client, "save-yourself", G_CALLBACK(save_yourself_cb), NULL);
   g_signal_connect(client, "die", G_CALLBACK(die_cb), NULL);
+#endif /* MOZ_X11 */
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNativeAppSupportUnix::Stop( PRBool *aResult )
 {
   NS_ENSURE_ARG( aResult );