Commit 46b86887 authored by Paul Ramsey's avatar Paul Ramsey

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
parent 4253c92e
......@@ -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])
......
......@@ -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@
......
......@@ -17,6 +17,9 @@
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#ifdef MAC_INTEGRATION
#include <ige-mac-integration.h>
#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
*/
......
......@@ -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
])
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