[glade3] * configure.ac, src/Makefile.am, src/glade-window.c: Use ige-mac-integration



commit 1e3d5d6598b38a19461a4060636081b908330f2f
Author: Tristan Van Berkom <vantr TheBully local>
Date:   Thu Jun 11 13:17:34 2009 -0400

    	* configure.ac, src/Makefile.am, src/glade-window.c: Use ige-mac-integration
    	if available for quartz builds (set the menubar as the application menu and
    	correctly handle the quit button).

 ChangeLog          |    6 ++++++
 configure.ac       |   14 ++++++++++++++
 src/Makefile.am    |    3 ++-
 src/glade-window.c |   18 ++++++++++++++++++
 4 files changed, 40 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c4f79c1..6d3684a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-06-11  Tristan Van Berkom <tvb gnome org>
+
+	* configure.ac, src/Makefile.am, src/glade-window.c: Use ige-mac-integration
+	if available for quartz builds (set the menubar as the application menu and
+	correctly handle the quit button).
+
 2009-06-06  Tristan Van Berkom <tvb gnome org>
 
 	* NEWS: Rolling Glade 3.6.4
diff --git a/configure.ac b/configure.ac
index ed95b87..2d8ad1a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -145,6 +145,7 @@ fi
 
 AM_CONDITIONAL(BUILD_GNOME, test x"$have_gnome" = "xyes")
 
+
 dnl ================================================================
 dnl Python for optional python dev libs
 dnl ================================================================
@@ -218,6 +219,17 @@ if test "$native_win32" = "yes"; then
   fi
 fi
 
+dnl ================================================================
+dnl Check for GDK Quartz and MacOSX integration package 
+dnl ================================================================
+_gdk_tgt=`$PKG_CONFIG --variable=target gdk-2.0`
+AM_CONDITIONAL([GDK_TARGET_QUARTZ], [test x$_gdk_tgt = xquartz])
+if test "x$_gdk_tgt" = xquartz; then 
+   PKG_CHECK_MODULES(IGE_MAC, ige-mac-integration)
+   AC_SUBST(IGE_MAC_LIBS)
+   AC_SUBST(IGE_MAC_CFLAGS)
+fi
+
 AC_SUBST([AM_CPPFLAGS])
 AC_SUBST([AM_CFLAGS])
 AC_SUBST([AM_CXXFLAGS])
@@ -273,4 +285,6 @@ Configuration:
 	GTK+ UNIX Print Widgets: ${have_unix_print}
 	GNOME UI Widgets:	 ${have_gnome}
 	PYTHON Widgets support:	 ${have_python}
+
+	Build Reference Manual:  ${enable_gtk_doc}
 "
diff --git a/src/Makefile.am b/src/Makefile.am
index c783532..4202205 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -10,12 +10,13 @@ glade_3_CPPFLAGS = \
 
 glade_3_CFLAGS =           \
 	$(GTK_CFLAGS)      \
+	$(IGE_MAC_CFLAGS)  \
 	$(WARN_CFLAGS)     \
 	$(AM_CFLAGS)
 
 glade_3_LDFLAGS = $(AM_LDFLAGS)
 
-glade_3_LDADD = $(top_builddir)/gladeui/libgladeui-1.la
+glade_3_LDADD = $(top_builddir)/gladeui/libgladeui-1.la $(IGE_MAC_LIBS)
 
 glade_3_SOURCES = \
 	glade-window.c \
diff --git a/src/glade-window.c b/src/glade-window.c
index 3b8c2d5..53420d7 100644
--- a/src/glade-window.c
+++ b/src/glade-window.c
@@ -38,6 +38,11 @@
 #include <gdk/gdkkeysyms.h>
 #include <gtk/gtk.h>
 
+#ifdef MAC_INTEGRATION
+#  include <ige-mac-integration.h>
+#endif
+
+
 #define ACTION_GROUP_STATIC             "GladeStatic"
 #define ACTION_GROUP_PROJECT            "GladeProject"
 #define ACTION_GROUP_PROJECTS_LIST_MENU "GladeProjectsList"
@@ -3172,6 +3177,19 @@ glade_window_init (GladeWindow *window)
 	
 	/* Load widget state */
 	glade_window_config_load (window);
+
+#ifdef MAC_INTEGRATION
+	{
+		/* Fix up the menubar for MacOSX Quartz builds */
+		gtk_widget_hide (menubar);
+		ige_mac_menu_set_menu_bar (GTK_MENU_SHELL (menubar));
+		
+		widget = gtk_ui_manager_get_widget (window->priv->ui, "/MenuBar/FileMenu/Quit");
+		ige_mac_menu_set_quit_menu_item (GTK_MENU_ITEM (widget));
+	}
+#endif
+
+
 }
 
 static void



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