Commit e90717a5 authored by John Ralls's avatar John Ralls

[Glade Bug 663492] Update Mac integration bindings to GtkOSXApplication

parent 7bd1d1b6
......@@ -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
......
......@@ -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
......
......@@ -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);
......
......@@ -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 \
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment