Commit be77564a authored by Jesse van den Kieboom's avatar Jesse van den Kieboom

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
parent 5e764a41
## 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
......
......@@ -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
......
## 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
......
......@@ -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
......
......@@ -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 ();
......
......@@ -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))
......
......@@ -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);
......
......@@ -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
......
......@@ -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);
......
......@@ -71,7 +71,7 @@
#undef SAVE_DATADIR
#endif
#ifdef PLATFORM_OSX
#ifdef OS_OSX
#include <ige-mac-dock.h>
#endif
......
......@@ -4,6 +4,7 @@ INCLUDES = \
-I$(top_srcdir)/gedit \
-I$(top_builddir)/gedit \
$(GEDIT_CFLAGS) \
$(IGE_MAC_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS)
......
......@@ -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
......
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