[gedit] Fixed OS X native vs X11 built
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gedit] Fixed OS X native vs X11 built
- Date: Sun, 8 Nov 2009 15:16:58 +0000 (UTC)
commit be77564a70f8966ba7140e4a133e6512689912cc
Author: Jesse van den Kieboom <jessevdk gnome org>
Date: Sun Nov 8 16:16:15 2009 +0100
Fixed OS X native vs X11 built
At some point gedit was fixed for the native
built which broke the non-native X11 built. This
patch fixes that problem so that gedit is now
able to built in X11 mode on OS X again. See also
bug #567464
Makefile.am | 6 +++++-
configure.ac | 32 ++++++++++++++++++++++++--------
gedit/Makefile.am | 8 ++++----
gedit/gedit-app.c | 10 +++++-----
gedit/gedit-commands-file.c | 8 ++++----
gedit/gedit-dirs.c | 8 ++++----
gedit/gedit-help.c | 4 ++--
gedit/gedit-ui.h | 6 +++---
gedit/gedit-window.c | 6 +++---
gedit/gedit.c | 2 +-
gedit/osx/Makefile.am | 1 +
gedit/smclient/Makefile.am | 2 +-
12 files changed, 57 insertions(+), 36 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 9d771ea..c5dc2a5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,11 @@
## Process this file with automake to produce Makefile.in
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = gedit pixmaps po help data plugin-loaders plugins docs win32
+SUBDIRS = gedit pixmaps po data plugin-loaders plugins docs win32
+
+if !OS_OSX
+SUBDIRS += help
+endif
distuninstallcheck_listfiles = find . -type f -print | grep -v scrollkeeper
diff --git a/configure.ac b/configure.ac
index a0c7468..cfd3693 100644
--- a/configure.ac
+++ b/configure.ac
@@ -91,7 +91,6 @@ AC_MSG_CHECKING([for Mac OS X platform])
case "$host" in
*-*-darwin*)
platform_osx=yes
- ACTIVE_PLUGINS="${ACTIVE_PLUGINS},checkupdate"
;;
*)
platform_osx=no
@@ -100,13 +99,21 @@ esac
AC_MSG_RESULT([$platform_osx])
AM_CONDITIONAL(PLATFORM_OSX, test "$platform_osx" = "yes")
-if test "$platform_osx" = "yes"; then
- AC_DEFINE([PLATFORM_OSX],[1],[Defined if platform is Mac OSX])
+dnl check for native osx
+gdk_windowing=`$PKG_CONFIG --variable=target gdk-2.0`
- PKG_CHECK_MODULES(OSX, ige-mac-integration)
+AC_MSG_CHECKING([for native Mac OS X])
+if test "$gdk_windowing" = "quartz"; then
+ os_osx=yes
+ ACTIVE_PLUGINS="${ACTIVE_PLUGINS},checkupdate"
+else
+ os_osx=no
+fi
+AC_MSG_RESULT([$os_osx])
+AM_CONDITIONAL(OS_OSX, test "$os_osx" = "yes")
- AC_SUBST(OSX_CFLAGS)
- AC_SUBST(OSX_LIBS)
+if test "$platform_osx" = "yes"; then
+ AC_DEFINE([PLATFORM_OSX],[1],[Defined if platform is Mac OSX])
DEFAULT_FONT="Monaco 12"
DEFAULT_PRINT_FONT="Monaco 10"
@@ -118,6 +125,15 @@ fi
AC_SUBST(DEFAULT_FONT)
AC_SUBST(DEFAULT_PRINT_FONT)
+if test "$os_osx" = "yes"; then
+ AC_DEFINE([OS_OSX],[1],[Defined if os is Mac OSX])
+
+ PKG_CHECK_MODULES(IGE_MAC, ige-mac-integration)
+
+ AC_SUBST(IGE_MAC_CFLAGS)
+ AC_SUBST(IGE_MAC_LIBS)
+fi
+
dnl ===============================================================
dnl Expanded dirs
dnl ===============================================================
@@ -167,7 +183,7 @@ if test "x$enable_updater" != "xno"; then
if test "x$have_libsoup" = "xyes"; then
if test "x$platform_win32" = "xyes"; then
enable_updater=yes
- elif test "x$platform_osx" = "xyes"; then
+ elif test "x$os_osx" = "xyes"; then
enable_updater=yes
else
enable_updater=no
@@ -292,7 +308,7 @@ if test "$gtkatleast" = "no"; then
AC_DEFINE([BUILD_SPINNER],[1],[Whether to use GeditSpinner instead of GtkSpinner])
fi
-if test "$platform_osx" = "no" &&
+if test "$os_osx" = "no" &&
test "$os_win32" = no; then
PKG_CHECK_MODULES(EGG_SMCLIENT, [
sm >= 1.0.0
diff --git a/gedit/Makefile.am b/gedit/Makefile.am
index b2fefaa..ddba2c8 100644
--- a/gedit/Makefile.am
+++ b/gedit/Makefile.am
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = dialogs smclient
-if PLATFORM_OSX
+if OS_OSX
SUBDIRS += osx
endif
@@ -14,7 +14,7 @@ INCLUDES = \
-I$(srcdir) \
-I$(srcdir)/smclient \
$(GEDIT_CFLAGS) \
- $(OSX_CFLAGS) \
+ $(IGE_MAC_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS) \
-DDATADIR=\""$(datadir)"\" \
@@ -23,7 +23,7 @@ INCLUDES = \
gedit_SOURCES = \
gedit.c
-gedit_LDADD = libgedit.la $(GEDIT_LIBS) $(OSX_LIBS) $(EGG_SMCLIENT_LIBS)
+gedit_LDADD = libgedit.la $(GEDIT_LIBS) $(IGE_MAC_LIBS) $(EGG_SMCLIENT_LIBS)
if PLATFORM_WIN32
gedit_LDFLAGS = -Wl,--export-all-symbols -mwindows -Wl,--out-implib,libgedit-$(GEDIT_API_VERSION).a
@@ -40,7 +40,7 @@ libgedit_la_LIBADD = \
# GEDIT_LIBS must be the last to ensure correct order on some platforms
libgedit_la_LIBADD += $(GEDIT_LIBS)
-if PLATFORM_OSX
+if OS_OSX
gedit_LDFLAGS += -framework Carbon
libgedit_la_LIBADD += osx/libosx.la
diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c
index 557bcad..9cb1833 100644
--- a/gedit/gedit-app.c
+++ b/gedit/gedit-app.c
@@ -46,7 +46,7 @@
#include "gedit-enum-types.h"
#include "gedit-dirs.h"
-#ifdef PLATFORM_OSX
+#ifdef OS_OSX
#include <ige-mac-integration.h>
#endif
@@ -375,7 +375,7 @@ gedit_app_get_default (void)
return app;
}
-#ifdef PLATFORM_OSX
+#ifdef OS_OSX
static GtkMenuItem *
ui_manager_menu_item (GtkUIManager *uimanager,
const gchar *path)
@@ -422,7 +422,7 @@ static void
set_active_window (GeditApp *app,
GeditWindow *window)
{
-#ifdef PLATFORM_OSX
+#ifdef OS_OSX
osx_switch_menubar (app, window);
#endif
@@ -487,7 +487,7 @@ window_destroy (GeditWindow *window,
*/
if (app->priv->windows == NULL)
{
-#ifdef PLATFORM_OSX
+#ifdef OS_OSX
if (!GPOINTER_TO_INT (g_object_get_data (G_OBJECT (window), "gedit-is-quitting-all")))
{
GeditWindow *hidden;
@@ -606,7 +606,7 @@ gedit_app_create_window_real (GeditApp *app,
G_CALLBACK (window_destroy),
app);
-#ifdef PLATFORM_OSX
+#ifdef OS_OSX
gtk_widget_hide (_gedit_window_get_menu_bar (window));
#endif
diff --git a/gedit/gedit-commands-file.c b/gedit/gedit-commands-file.c
index d7f7b46..b8f6de3 100644
--- a/gedit/gedit-commands-file.c
+++ b/gedit/gedit-commands-file.c
@@ -1644,7 +1644,7 @@ close_confirmation_dialog_response_handler (GeditCloseConfirmationDialog *dlg,
GEDIT_IS_QUITTING,
GBOOLEAN_TO_POINTER (FALSE));
-#ifdef PLATFORM_OSX
+#ifdef OS_OSX
g_object_set_data (G_OBJECT (window),
GEDIT_IS_QUITTING_ALL,
GINT_TO_POINTER (FALSE));
@@ -1731,7 +1731,7 @@ _gedit_cmd_file_close (GtkAction *action,
if (active_tab == NULL)
{
-#ifdef PLATFORM_OSX
+#ifdef OS_OSX
/* Close the window on OS X */
gtk_widget_destroy (GTK_WIDGET (window));
#endif
@@ -1827,7 +1827,7 @@ _gedit_cmd_file_close_all (GtkAction *action,
}
/* Quit */
-#ifdef PLATFORM_OSX
+#ifdef OS_OSX
static void
quit_all ()
{
@@ -1863,7 +1863,7 @@ _gedit_cmd_file_quit (GtkAction *action,
{
gedit_debug (DEBUG_COMMANDS);
-#ifdef PLATFORM_OSX
+#ifdef OS_OSX
if (action != NULL)
{
quit_all ();
diff --git a/gedit/gedit-dirs.c b/gedit/gedit-dirs.c
index 3ef491b..d76f402 100644
--- a/gedit/gedit-dirs.c
+++ b/gedit/gedit-dirs.c
@@ -26,7 +26,7 @@
#include "gedit-dirs.h"
-#ifdef PLATFORM_OSX
+#ifdef OS_OSX
#include <ige-mac-bundle.h>
#endif
@@ -139,7 +139,7 @@ gedit_dirs_get_gedit_data_dir (void)
g_free (win32_dir);
#else
-#ifdef PLATFORM_OSX
+#ifdef OS_OSX
IgeMacBundle *bundle = ige_mac_bundle_get_default ();
if (ige_mac_bundle_get_is_app_bundle (bundle))
@@ -181,7 +181,7 @@ gedit_dirs_get_gedit_locale_dir (void)
g_free (win32_dir);
#else
-#ifdef PLATFORM_OSX
+#ifdef OS_OSX
IgeMacBundle *bundle = ige_mac_bundle_get_default ();
if (ige_mac_bundle_get_is_app_bundle (bundle))
@@ -227,7 +227,7 @@ gedit_dirs_get_gedit_lib_dir (void)
g_free (win32_dir);
#else
-#ifdef PLATFORM_OSX
+#ifdef OS_OSX
IgeMacBundle *bundle = ige_mac_bundle_get_default ();
if (ige_mac_bundle_get_is_app_bundle (bundle))
diff --git a/gedit/gedit-help.c b/gedit/gedit-help.c
index 750e9af..744afb5 100644
--- a/gedit/gedit-help.c
+++ b/gedit/gedit-help.c
@@ -38,7 +38,7 @@
#include <string.h>
#include <gtk/gtk.h>
-#ifdef PLATFORM_OSX
+#ifdef OS_OSX
#include "osx/gedit-osx.h"
#endif
@@ -53,7 +53,7 @@ gedit_help_display (GtkWindow *parent,
g_return_val_if_fail ((parent == NULL) || GTK_IS_WINDOW (parent), FALSE);
-#ifdef PLATFORM_OSX
+#ifdef OS_OSX
if (name == NULL || strcmp(name, "gedit.xml") == NULL || strcmp(name, "gedit") == 0)
{
return gedit_osx_show_help (link_id);
diff --git a/gedit/gedit-ui.h b/gedit/gedit-ui.h
index b1e5bf7..f007182 100644
--- a/gedit/gedit-ui.h
+++ b/gedit/gedit-ui.h
@@ -58,7 +58,7 @@ static const GtkActionEntry gedit_always_sensitive_menu_entries[] =
{ "FileOpen", GTK_STOCK_OPEN, N_("_Open..."), "<control>O",
N_("Open a file"), G_CALLBACK (_gedit_cmd_file_open) },
-#ifdef PLATFORM_OSX
+#ifdef OS_OSX
{ "FileClose", GTK_STOCK_CLOSE, NULL, "<control>W",
N_("Close the current file"), G_CALLBACK (_gedit_cmd_file_close) },
#endif
@@ -96,7 +96,7 @@ static const GtkActionEntry gedit_menu_entries[] =
N_("Print preview"), G_CALLBACK (_gedit_cmd_file_print_preview) },
{ "FilePrint", GTK_STOCK_PRINT, N_("_Print..."), "<control>P",
N_("Print the current page"), G_CALLBACK (_gedit_cmd_file_print) },
-#ifndef PLATFORM_OSX
+#ifndef OS_OSX
{ "FileClose", GTK_STOCK_CLOSE, NULL, "<control>W",
N_("Close the current file"), G_CALLBACK (_gedit_cmd_file_close) },
#endif
@@ -126,7 +126,7 @@ static const GtkActionEntry gedit_menu_entries[] =
N_("Search forwards for the same text"), G_CALLBACK (_gedit_cmd_search_find_next) },
{ "SearchFindPrevious", NULL, N_("Find Pre_vious"), "<shift><control>G",
N_("Search backwards for the same text"), G_CALLBACK (_gedit_cmd_search_find_prev) },
-#ifndef PLATFORM_OSX
+#ifndef OS_OSX
{ "SearchReplace", GTK_STOCK_FIND_AND_REPLACE, N_("_Replace..."), "<control>H",
N_("Search for and replace text"), G_CALLBACK (_gedit_cmd_search_replace) },
#else
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index 64c61a8..4a808e9 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -57,7 +57,7 @@
#include "gedit-dirs.h"
#include "gedit-status-combo-box.h"
-#ifdef PLATFORM_OSX
+#ifdef OS_OSX
#include "osx/gedit-osx.h"
#endif
@@ -2129,7 +2129,7 @@ set_title (GeditWindow *window)
if (window->priv->active_tab == NULL)
{
-#ifdef PLATFORM_OSX
+#ifdef OS_OSX
gedit_osx_set_window_title (window, "gedit", NULL);
#else
gtk_window_set_title (GTK_WINDOW (window), "gedit");
@@ -2213,7 +2213,7 @@ set_title (GeditWindow *window)
name);
}
-#ifdef PLATFORM_OSX
+#ifdef OS_OSX
gedit_osx_set_window_title (window, title, doc);
#else
gtk_window_set_title (GTK_WINDOW (window), title);
diff --git a/gedit/gedit.c b/gedit/gedit.c
index 33ee3d9..217e4b4 100644
--- a/gedit/gedit.c
+++ b/gedit/gedit.c
@@ -71,7 +71,7 @@
#undef SAVE_DATADIR
#endif
-#ifdef PLATFORM_OSX
+#ifdef OS_OSX
#include <ige-mac-dock.h>
#endif
diff --git a/gedit/osx/Makefile.am b/gedit/osx/Makefile.am
index 6e4dc0a..f085115 100644
--- a/gedit/osx/Makefile.am
+++ b/gedit/osx/Makefile.am
@@ -4,6 +4,7 @@ INCLUDES = \
-I$(top_srcdir)/gedit \
-I$(top_builddir)/gedit \
$(GEDIT_CFLAGS) \
+ $(IGE_MAC_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS)
diff --git a/gedit/smclient/Makefile.am b/gedit/smclient/Makefile.am
index fe4b3ba..8ec0ef7 100644
--- a/gedit/smclient/Makefile.am
+++ b/gedit/smclient/Makefile.am
@@ -2,7 +2,7 @@ if OS_WIN32
platform_sources = eggsmclient-win32.c
platform_logout_test_ldflags = -mwindows
else
-if PLATFORM_OSX
+if OS_OSX
platform_defines = -xobjective-c
platform_ldflags = -framework Carbon
platform_sources = eggsmclient-osx.c
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]