[glade] [Glade Bug 663492] Update Mac integration bindings to GtkOSXApplication
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade] [Glade Bug 663492] Update Mac integration bindings to GtkOSXApplication
- Date: Wed, 9 Nov 2011 05:18:43 +0000 (UTC)
commit e90717a501d3e99509c0e6ade83e3876d4a84f68
Author: John Ralls <jralls ceridwen us>
Date: Tue Nov 8 13:26:24 2011 -0800
[Glade Bug 663492] Update Mac integration bindings to GtkOSXApplication
configure.ac | 14 +++++++-------
gladeui/Makefile.am | 10 +++++-----
gladeui/glade-app.c | 7 ++-----
src/Makefile.am | 4 ++--
src/glade-window.c | 33 ++++++++++++++++++++++++++++-----
5 files changed, 44 insertions(+), 24 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index faa003d..9652f71 100644
--- a/configure.ac
+++ b/configure.ac
@@ -222,12 +222,12 @@ fi
dnl ================================================================
dnl Check for GDK Quartz and MacOSX integration package
dnl ================================================================
-_gdk_tgt=`$PKG_CONFIG --variable=target gdk-3.0`
+_gdk_tgt=`$PKG_CONFIG --variable=targets gdk-3.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)
+ PKG_CHECK_MODULES(GTK_MAC, gtk-mac-integration)
- IGE_MAC_BUNDLE_FLAG=
+ GTK_MAC_BUNDLE_FLAG=
AC_ARG_ENABLE(mac-bundle,
AS_HELP_STRING([--enable-mac-bundle], [enable mac bundling]),
@@ -236,12 +236,12 @@ if test "x$_gdk_tgt" = xquartz; then
if test "x$build_bundle" = xyes; then
AC_MSG_NOTICE([enableing mac bundle..])
- IGE_MAC_BUNDLE_FLAG=-DMAC_BUNDLE
+ GTK_MAC_BUNDLE_FLAG=-DMAC_BUNDLE
fi
- AC_SUBST(IGE_MAC_BUNDLE_FLAG)
- AC_SUBST(IGE_MAC_LIBS)
- AC_SUBST(IGE_MAC_CFLAGS)
+ AC_SUBST(GTK_MAC_BUNDLE_FLAG)
+ AC_SUBST(GTK_MAC_LIBS)
+ AC_SUBST(GTK_MAC_CFLAGS)
fi
diff --git a/gladeui/Makefile.am b/gladeui/Makefile.am
index 76fef97..7563f99 100644
--- a/gladeui/Makefile.am
+++ b/gladeui/Makefile.am
@@ -8,7 +8,7 @@ glade_previewer_CPPFLAGS = \
-I$(top_builddir) \
-DGLADE_GNOMEHELPDIR="\"$(HELP_DIR)\"" \
$(GTK_CFLAGS) \
- $(IGE_MAC_CFLAGS) \
+ $(GTK_MAC_CFLAGS) \
$(WARN_CFLAGS) \
$(AM_CPPFLAGS)
@@ -17,7 +17,7 @@ glade_previewer_CFLAGS = \
glade_previewer_LDFLAGS = $(AM_LDFLAGS)
-glade_previewer_LDADD = libgladeui-2.la $(IGE_MAC_LIBS)
+glade_previewer_LDADD = libgladeui-2.la $(GTK_MAC_LIBS)
glade_previewer_SOURCES = \
glade-previewer.c
@@ -95,8 +95,8 @@ libgladeui_2_la_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_builddir) \
$(GTK_CFLAGS) \
- $(IGE_MAC_BUNDLE_FLAG) \
- $(IGE_MAC_CFLAGS) \
+ $(GTK_MAC_BUNDLE_FLAG) \
+ $(GTK_MAC_CFLAGS) \
$(WARN_CFLAGS) \
$(AM_CPPFLAGS)
@@ -104,7 +104,7 @@ libgladeui_2_la_CFLAGS = \
$(AM_CFLAGS)
libgladeui_2_la_LDFLAGS = -version-info $(GLADE_CURRENT):$(GLADE_REVISION):$(GLADE_AGE) $(AM_LDFLAGS)
-libgladeui_2_la_LIBADD = $(GTK_LIBS) $(IGE_MAC_LIBS)
+libgladeui_2_la_LIBADD = $(GTK_LIBS) $(GTK_MAC_LIBS)
libgladeuiincludedir=$(includedir)/libgladeui-2.0/gladeui
diff --git a/gladeui/glade-app.c b/gladeui/glade-app.c
index c7ca694..3f906fb 100644
--- a/gladeui/glade-app.c
+++ b/gladeui/glade-app.c
@@ -48,7 +48,7 @@
#include <gtk/gtk.h>
#ifdef MAC_INTEGRATION
-# include <ige-mac-integration.h>
+# include <gtkosxapplication.h>
#endif
#define GLADE_CONFIG_FILENAME "glade.conf"
@@ -225,11 +225,8 @@ build_package_paths (void)
prefix = g_win32_get_package_installation_directory_of_module (NULL);
# else // defined (MAC_INTEGRATION) && defined (MAC_BUNDLE)
- IgeMacBundle *bundle = ige_mac_bundle_get_default ();
+ prefix = quartz_application_get_resource_path ();
- prefix =
- g_build_filename (ige_mac_bundle_get_path (bundle), "Contents",
- "Resources", NULL);
# endif
pixmaps_dir = g_build_filename (prefix, "share", PACKAGE, "pixmaps", NULL);
diff --git a/src/Makefile.am b/src/Makefile.am
index 52db167..cddaeec 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -7,7 +7,7 @@ glade_CPPFLAGS = \
-I$(top_builddir) \
-DGLADE_GNOMEHELPDIR="\"$(HELP_DIR)\"" \
$(GTK_CFLAGS) \
- $(IGE_MAC_CFLAGS) \
+ $(GTK_MAC_CFLAGS) \
$(WARN_CFLAGS) \
$(AM_CPPFLAGS)
@@ -16,7 +16,7 @@ glade_CFLAGS = \
glade_LDFLAGS = $(AM_LDFLAGS)
-glade_LDADD = $(top_builddir)/gladeui/libgladeui-2.la $(IGE_MAC_LIBS)
+glade_LDADD = $(top_builddir)/gladeui/libgladeui-2.la $(GTK_MAC_LIBS)
glade_SOURCES = \
glade-window.c \
diff --git a/src/glade-window.c b/src/glade-window.c
index eb564c0..368c007 100644
--- a/src/glade-window.c
+++ b/src/glade-window.c
@@ -41,7 +41,7 @@
#include <gtk/gtk.h>
#ifdef MAC_INTEGRATION
-# include <ige-mac-integration.h>
+# include <gtkosxapplication.h>
#endif
@@ -2453,7 +2453,7 @@ drag_data_received (GtkWidget * widget,
g_warning ("Could not convert uri to local path: %s", error->message);
g_error_free (error);
- }
+ }
g_free (path);
}
g_strfreev (uris);
@@ -3519,12 +3519,35 @@ glade_window_init (GladeWindow * window)
#ifdef MAC_INTEGRATION
{
/* Fix up the menubar for MacOSX Quartz builds */
+ GtkWidget *sep;
+ GtkOSXApplication *theApp = g_object_new(GTK_TYPE_OSX_APPLICATION, NULL);
gtk_widget_hide (menubar);
- ige_mac_menu_set_menu_bar (GTK_MENU_SHELL (menubar));
-
+ gtk_osxapplication_set_menu_bar(theApp, 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));
+ gtk_widget_hide (widget);
+ widget =
+ gtk_ui_manager_get_widget (window->priv->ui, "/MenuBar/HelpMenu/About");
+ gtk_osxapplication_insert_app_menu_item (theApp, widget, 0);
+ sep = gtk_separator_menu_item_new();
+ g_object_ref(sep);
+ gtk_osxapplication_insert_app_menu_item (theApp, sep, 1);
+
+ widget =
+ gtk_ui_manager_get_widget (window->priv->ui, "/MenuBar/FileMenu/Properties");
+ gtk_osxapplication_insert_app_menu_item (theApp, widget, 2);
+ sep = gtk_separator_menu_item_new();
+ g_object_ref(sep);
+ gtk_osxapplication_insert_app_menu_item (theApp, sep, 3);
+
+ widget =
+ gtk_ui_manager_get_widget (window->priv->ui, "/MenuBar/HelpMenu");
+ gtk_osxapplication_set_help_menu(theApp, GTK_MENU_ITEM(widget));
+
+ g_signal_connect(theApp, "NSApplicationWillTerminate",
+ G_CALLBACK(quit_cb), window);
+
+ gtk_osxapplication_ready(theApp);
}
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]