From: Paul Ramsey Date: Tue, 6 Apr 2010 23:37:07 +0000 (+0000) Subject: Add support for command-q shutdown in Mac GTK build X-Git-Tag: 2.0.0alpha1~3063 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46b86887f52117f04f752ec3c9dc4987f7607984;p=postgis Add support for command-q shutdown in Mac GTK build git-svn-id: http://svn.osgeo.org/postgis/trunk@5505 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/configure.ac b/configure.ac index a86f5cffd..cefb3ccbc 100644 --- a/configure.ac +++ b/configure.ac @@ -567,23 +567,8 @@ AC_ARG_WITH([gui], if test "x$GUI" = "xyes"; then AC_MSG_RESULT([GUI: Build requested, checking for dependencies (GKT+2.0)]) - case $host in - *darwin10.1*) - for frmwrk [ in Cairo GLib Gtk ]; do - if test -d /Library/Frameworks/${frmwrk}.framework; then - GTK_CFLAGS="$GTK_CFLAGS -I/Library/Frameworks/${frmwrk}.framework/Headers" - GTK_LIBS="$GTK_LIBS -framework $frmwrk" - AC_MSG_RESULT([GUI: Found /Library/Frameworks/${frmwrk}.framework]) - else - AC_MSG_ERROR([GUI: Mac OS/X build requires the GTK+2.0 frameworks available from http://www.gtk-osx.org]) - fi - done - GTK_BUILD="gui" - ;; - *) - dnl Try to find the GTK libs with pkgconfig - AM_PATH_GTK_2_0([2.8.0], [GTK_BUILD="gui"], [GTK_BUILD=""]) - esac + dnl Try to find the GTK libs with pkgconfig + AM_PATH_GTK_2_0([2.8.0], [GTK_BUILD="gui"], [GTK_BUILD=""]) dnl Add -mwindows to MinGW GUI build case $host in @@ -602,6 +587,8 @@ AC_SUBST([GTK_LIBS]) AC_SUBST([GTK_WIN32_FLAGS]) AC_SUBST([GTK_WIN32_RES]) AC_SUBST([GTK_BUILD]) +AC_SUBST([IGE_MAC_CFLAGS]) +AC_SUBST([IGE_MAC_LIBS]) diff --git a/loader/Makefile.in b/loader/Makefile.in index 3692dc9b4..39d1c299b 100644 --- a/loader/Makefile.in +++ b/loader/Makefile.in @@ -42,8 +42,8 @@ ICONV_CFLAGS=@ICONV_CFLAGS@ LIBLWGEOM=../liblwgeom/liblwgeom.a # GTK includes and libraries -GTK_CFLAGS = @GTK_CFLAGS@ -GTK_LIBS = @GTK_LIBS@ +GTK_CFLAGS = @GTK_CFLAGS@ @IGE_MAC_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ @IGE_MAC_LIBS@ GTK_WIN32_FLAGS = @GTK_WIN32_FLAGS@ GTK_WIN32_RES = @GTK_WIN32_RES@ diff --git a/loader/shp2pgsql-gui.c b/loader/shp2pgsql-gui.c index cfc7f255d..4c7356002 100644 --- a/loader/shp2pgsql-gui.c +++ b/loader/shp2pgsql-gui.c @@ -17,6 +17,9 @@ #include #include #include +#ifdef MAC_INTEGRATION +#include +#endif #include "libpq-fe.h" #include "shp2pgsql-core.h" @@ -1158,6 +1161,15 @@ pgui_create_main_window(const SHPCONNECTIONCONFIG *conn) gtk_container_add (GTK_CONTAINER (scrolledwindow_log), textview_log); gtk_container_add (GTK_CONTAINER (frame_log), scrolledwindow_log); +#ifdef MAC_INTEGRATION + /* + ** OS/X menu integration for command-Q + */ + menu_item_quit = gtk_menu_item_new(); + g_signal_connect (G_OBJECT (menu_item_quit), "activate", G_CALLBACK (pgui_action_cancel), NULL); + ige_mac_menu_set_quit_menu_item (GTK_MENU_ITEM (menu_item_quit)); +#endif + /* ** Main window */ diff --git a/macros/gtk-2.0.m4 b/macros/gtk-2.0.m4 index 3deba01be..70fc60a54 100644 --- a/macros/gtk-2.0.m4 +++ b/macros/gtk-2.0.m4 @@ -192,5 +192,33 @@ main () fi AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) + +dnl +dnl test for OS/X GTK installation +dnl + _gdk_tgt=`$PKG_CONFIG --variable=target gdk-2.0` + if test "x$_gdk_tgt" = xquartz; then + AC_MSG_CHECKING([for ige-mac-integration]) + if $PKG_CONFIG --exists "ige-mac-integration" ; then + AC_MSG_RESULT([yes]) + + AC_MSG_CHECKING([for IGE_MAC_CFLAGS]) + IGE_MAC_CFLAGS=`$PKG_CONFIG --cflags "ige-mac-integration"` + AC_MSG_RESULT($IGE_MAC_CFLAGS) + + AC_MSG_CHECKING([for IGE_MAC_LIBS]) + IGE_MAC_LIBS=`$PKG_CONFIG --libs "ige-mac-integration"` + AC_MSG_RESULT($IGE_MAC_LIBS) + + else + IGE_MAC_CFLAGS="" + IGE_MAC_LIBS="" + AC_MSG_RESULT([no]) + fi + + fi + AC_SUBST(IGE_MAC_CFLAGS) + AC_SUBST(IGE_MAC_LIBS) + rm -f conf.gtktest ])