Commit 6f47f69e authored by Jesse van den Kieboom's avatar Jesse van den Kieboom

Update OS X support for gnome 3

parent aa8d90a6
......@@ -134,10 +134,10 @@ 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)
PKG_CHECK_MODULES(GTK_MAC, gtk-mac-integration)
AC_SUBST(IGE_MAC_CFLAGS)
AC_SUBST(IGE_MAC_LIBS)
AC_SUBST(GTK_MAC_CFLAGS)
AC_SUBST(GTK_MAC_LIBS)
fi
dnl ===============================================================
......@@ -174,7 +174,7 @@ dnl ================================================================
dnl Use gvfs metadata or the old xml file store.
dnl ================================================================
if test "x$os_osx" != "xno" || test "x$os_win32" != "xno"; then
if test "x$os_win32" != "xno"; then
gvfs_metadata_default="no"
else
gvfs_metadata_default="yes"
......
......@@ -26,16 +26,28 @@ gsettings_SCHEMAS = org.gnome.gedit.gschema.xml
@GSETTINGS_RULES@
if OS_OSX
gsettingsschema_DATA = gedit-osx.gschema.override
endif
convertdir = $(datadir)/GConf/gsettings
convert_DATA = gedit.convert
if OS_OSX
geditdatadir = $(datadir)/gedit
geditdata_DATA = osx.accels osx.css
endif
EXTRA_DIST = \
$(desktop_in_files) \
$(service_in_files) \
$(man_MANS) \
gedit.pc.in \
org.gnome.gedit.gschema.xml.in.in \
gedit.convert
gedit.convert \
osx.accels \
osx.css \
gedit-osx.gschema.override
CLEANFILES = \
$(desktop_DATA) \
......
[org.gnome.desktop.interface]
monospace-font-name = 'Monaco 12'
[org.gnome.gedit.preferences.editor]
editor-font = 'Monaco 12'
\ No newline at end of file
(gtk_accel_path "<Actions>/GeditWindowActions/EditCut" "<primary>x")
(gtk_accel_path "<Actions>/GeditWindowActions/DocumentsNextDocument" "<primary><alt>page_down")
(gtk_accel_path "<Actions>/GeditBookmarksPluginActions/ToggleBookmark" "<primary><alt>b")
(gtk_accel_path "<Actions>/GeditWindowActions/SearchFindPrevious" "<shift><primary>g")
(gtk_accel_path "<Actions>/GeditWindowPanelsActions/ViewSidePanel" "F9")
(gtk_accel_path "<Actions>/GeditWindowActions/DocumentsPreviousTabGroup" "<shift><primary><alt>page_up")
(gtk_accel_path "<Actions>/GeditWindowActions/FilePrint" "<primary>p")
(gtk_accel_path "<Actions>/GeditCommanderPluginActions/CommanderModeAction" "<primary>period")
(gtk_accel_path "<Actions>/GeditWindowAlwaysSensitiveActions/HelpContents" "f1")
(gtk_accel_path "<Actions>/GeditBookmarksPluginActions/NextBookmark" "<primary>b")
(gtk_accel_path "<Actions>/GeditWindowActions/EditRedo" "<shift><primary>z")
(gtk_accel_path "<Actions>/GeditTextSizePluginActions/IncreaseFontSizeAction" "<primary>plus")
(gtk_accel_path "<Actions>/FileBrowserWidgetBookmarkActionGroup/BookmarkOpen" "<primary>o")
(gtk_accel_path "<Actions>/GeditSpellPluginActions/CheckSpell" "<shift>f7")
(gtk_accel_path "<Actions>/GeditTextSizePluginActions/ResetFontSizeAction" "<primary>0")
(gtk_accel_path "<Actions>/GeditWindowActions/FileCloseAll" "<shift><primary>w")
(gtk_accel_path "<Actions>/GeditWindowActions/SearchFind" "<primary>f")
(gtk_accel_path "<Actions>/GeditWindowActions/FileSave" "<primary>s")
(gtk_accel_path "<Actions>/GeditQuitWindowActions/FileQuit" "<primary>q")
(gtk_accel_path "<Actions>/GeditWindowAlwaysSensitiveActions/FileOpen" "<primary>o")
(gtk_accel_path "<Actions>/GeditWindowActions/SearchGoToLine" "<primary>i")
(gtk_accel_path "<Actions>/GeditWindowActions/SearchReplace" "<primary><alt>f")
(gtk_accel_path "<Actions>/GeditBookmarksPluginActions/PreviousBookmark" "<shift><primary>b")
(gtk_accel_path "<Actions>/GeditWindowActions/FileSaveAs" "<shift><primary>s")
(gtk_accel_path "<Actions>/GeditWindowActions/SearchClearHighlight" "<shift><primary>k")
(gtk_accel_path "<Actions>/GeditWindowActions/FilePrintPreview" "<shift><primary>p")
(gtk_accel_path "<Actions>/GeditWindowActions/EditUndo" "<primary>z")
(gtk_accel_path "<Actions>/GeditTextSizePluginActions/DecreaseFontSizeAction" "<primary>minus")
(gtk_accel_path "<Actions>/GeditCloseWindowActions/FileClose" "<primary>w")
(gtk_accel_path "<Actions>/GeditWindowActions/EditPaste" "<primary>v")
(gtk_accel_path "<Actions>/GeditWindowActions/FileSaveAll" "<shift><primary>l")
(gtk_accel_path "<Actions>/FileBrowserWidgetSingleMostSelectionActionGroup/FileNew" "<primary>n")
(gtk_accel_path "<Actions>/FileBrowserWidgetSensitiveActionGroup/DirectoryOpen" "<primary>o")
(gtk_accel_path "<Actions>/GeditWindowActions/SearchFindNext" "<primary>g")
(gtk_accel_path "<Actions>/GeditWindowPanelsActions/ViewBottomPanel" "<primary>f9")
(gtk_accel_path "<Actions>/GeditWindowActions/DocumentsNextTabGroup" "<shift><primary><alt>page_down")
(gtk_accel_path "<Actions>/GeditWindowAlwaysSensitiveActions/ViewFullscreen" "f11")
(gtk_accel_path "<Actions>/GeditWindowActions/EditCopy" "<primary>c")
(gtk_accel_path "<Actions>/GeditWindowAlwaysSensitiveActions/FileNew" "<primary>n")
(gtk_accel_path "<Actions>/GeditWindowActions/DocumentsPreviousDocument" "<primary><alt>page_up")
(gtk_accel_path "<Actions>/GeditWindowActions/DocumentsNewTabGroup" "<primary><alt>n")
(gtk_accel_path "<Actions>/GeditWindowActions/EditSelectAll" "<primary>a")
(gtk_accel_path "<Actions>/FileBrowserWidgetFileSelectionActionGroup/FileOpen" "<primary>o")
(gtk_accel_path "<Actions>/GeditWindowAlwaysSensitiveActions/EditPreferences" "<primary>comma")
@binding-set gtk-osx-editable {
bind "<primary>c" { "copy-clipboard" () };
bind "<primary>x" { "cut-clipboard" () };
bind "<primary>v" { "paste-clipboard" () };
unbind "<control>c";
unbind "<control>x";
unbind "<control>v";
bind "<primary>Left" { "move-cursor" (display-line-ends, -1, 0) };
bind "<primary>KP_Left" { "move-cursor" (display-line-ends, -1, 0) };
bind "<primary><shift>Left" { "move-cursor" (display-line-ends, -1, 1) };
bind "<primary><shift>KP_Left" { "move-cursor" (display-line-ends, -1, 1) };
bind "<primary>Right" { "move-cursor" (display-line-ends, 1, 0) };
bind "<primary>KP_Right" { "move-cursor" (display-line-ends, 1, 0) };
bind "<primary><shift>Right" { "move-cursor" (display-line-ends, 1, 1) };
bind "<primary><shift>KP_Right" { "move-cursor" (display-line-ends, 1, 1) };
unbind "<control>Left";
unbind "<control>KP_Left";
unbind "<control><shift>Left";
unbind "<control><shift>KP_Left";
unbind "<control>Right";
unbind "<control>KP_Right";
unbind "<control><shift>Right";
unbind "<control><shift>KP_Right";
bind "<alt>Right" { "move-cursor" (words, 1, 0) };
bind "<alt>KP_Right" { "move-cursor" (words, 1, 0) };
bind "<alt>Left" { "move-cursor" (words, -1, 0) };
bind "<alt>KP_Left" { "move-cursor" (words, -1, 0) };
bind "<shift><alt>Right" { "move-cursor" (words, 1, 1) };
bind "<shift><alt>KP_Right" { "move-cursor" (words, 1, 1) };
bind "<shift><alt>Left" { "move-cursor" (words, -1, 1) };
bind "<shift><alt>KP_Left" { "move-cursor" (words, -1, 1) };
bind "<alt>delete" { "delete-from-cursor" (word-ends, 1) };
bind "<alt>KP_delete" { "delete-from-cursor" (word-ends, 1) };
bind "<alt>backspace" { "delete-from-cursor" (word-ends, -1) };
bind "<primary>Down" { "move-cursor" (buffer-ends, 1, 0) };
bind "<primary><shift>Down" { "move-cursor" (buffer-ends, 1, 1) };
bind "<primary>KP_Down" { "move-cursor" (buffer-ends, 1, 0) };
bind "<primary><shift>KP_Down" { "move-cursor" (buffer-ends, 1, 1) };
bind "<primary>Up" { "move-cursor" (buffer-ends, -1, 0) };
bind "<primary><shift>Up" { "move-cursor" (buffer-ends, -1, 1) };
bind "<primary>KP_Up" { "move-cursor" (buffer-ends, -1, 0) };
bind "<primary><shift>KP_Up" { "move-cursor" (buffer-ends, -1, 1) };
unbind "<control>Down";
unbind "<control>KP_Down";
unbind "<control><shift>Down";
unbind "<control><shift>KP_Down";
unbind "<control>Up";
unbind "<control>KP_Up";
unbind "<control><shift>Up";
unbind "<control><shift>KP_Up";
}
@binding-set gtk-osx-text-entry {
bind "<primary>a" {
"move-cursor" (buffer-ends, -1, 0)
"move-cursor" (buffer-ends, 1, 1)
};
unbind "<control>a";
}
@binding-set gtk-osx-text-view {
bind "<primary>a" { "select-all" (1) };
unbind "<control>a";
}
@binding-set gtk-osx-tree-view {
bind "<primary>s" { "start-interactive-search" () };
unbind "<control>s";
}
@binding-set gtk-osx-source-view {
bind "<primary>z" { "undo" () };
unbind "<control>z";
bind "<primary><shift>z" { "redo" () };
unbind "<control><shift>z";
}
@binding-set gedit-osx-view {
bind "<primary>d" { "delete-from-cursor" (GTK_DELETE_PARAGRAPHS, 1) };
unbind "<control>d";
}
GtkEntry {
gtk-key-bindings: gtk-osx-editable, gtk-osx-text-entry;
}
GtkTextView {
gtk-key-bindings: gtk-osx-editable, gtk-osx-text-view;
}
GtkSourceView {
gtk-key-bindings: gtk-osx-editable, gtk-osx-text-view, gtk-osx-source-view;
}
GeditView {
gtk-key-bindings: gtk-osx-editable, gtk-osx-text-view, gtk-osx-source-view, gedit-osx-view;
}
GtkTreeView {
gtk-key-bindings: gtk-osx-tree-view;
}
GtkNotebook
{
padding: 0;
}
GtkNotebook tab
{
padding: 4 2 2 2;
}
GtkWidget
{
font-family: "Lucida Grande";
}
GtkEntry
{
font-family: "Helvetica";
}
\ No newline at end of file
......@@ -12,7 +12,7 @@ INCLUDES = \
-I$(srcdir) \
-I$(srcdir)/smclient \
$(GEDIT_CFLAGS) \
$(IGE_MAC_CFLAGS) \
$(GTK_MAC_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS) \
$(INTROSPECTION_CFLAGS) \
......@@ -26,7 +26,7 @@ gedit_LDADD = \
libgedit.la \
libgedit-private.la \
$(GEDIT_LIBS) \
$(IGE_MAC_LIBS) \
$(GTK_MAC_LIBS) \
$(EGG_SMCLIENT_LIBS) \
$(INTROSPECTION_LIBS)
......@@ -44,23 +44,19 @@ libgedit_la_LIBADD = \
theatrics/libtheatrics.la
# GEDIT_LIBS must be the last to ensure correct order on some platforms
libgedit_la_LIBADD += $(GEDIT_LIBS)
libgedit_la_LIBADD += $(GEDIT_LIBS) $(GTK_MAC_LIBS)
# Mac OSX convenience library and ldflags
if OS_OSX
gedit_LDFLAGS += -framework Carbon
noinst_LTLIBRARIES += libosx.la
libosx_la_LDFLAGS = -framework Carbon -framework ApplicationServices -framework Cocoa
libosx_la_LDFLAGS = -framework Cocoa
libosx_la_LIBADD = -lobjc
libosx_la_CFLAGS = -xobjective-c
libosx_la_SOURCES = \
gedit-app-osx.c \
gedit-app-osx.h \
gedit-osx-delegate.m \
gedit-osx-delegate.h
gedit-app-osx.h
libgedit_la_LIBADD += libosx.la
endif
......
......@@ -21,11 +21,15 @@
*/
#include "gedit-app-osx.h"
#include <gedit/gedit-dirs.h>
#include <gedit/gedit-debug.h>
#include <gdk/gdkquartz.h>
#include <Carbon/Carbon.h>
#include <gtkosxapplication.h>
#include <string.h>
#include <glib/gi18n.h>
#import "gedit-osx-delegate.h"
#include "gedit-commands.h"
#include <AvailabilityMacros.h>
G_DEFINE_TYPE (GeditAppOSX, gedit_app_osx, GEDIT_TYPE_APP)
......@@ -36,7 +40,8 @@ gedit_app_osx_finalize (GObject *object)
}
static gboolean
gedit_app_osx_last_window_destroyed_impl (GeditApp *app)
gedit_app_osx_last_window_destroyed_impl (GeditApp *app,
GeditWindow *window)
{
if (!GPOINTER_TO_INT (g_object_get_data (G_OBJECT (window), "gedit-is-quitting-all")))
{
......@@ -45,10 +50,10 @@ gedit_app_osx_last_window_destroyed_impl (GeditApp *app)
return FALSE;
}
return GEDIT_APP_CLASS (gedit_app_osx_parent_class)->last_window_destroyed (app);
return GEDIT_APP_CLASS (gedit_app_osx_parent_class)->last_window_destroyed (app, window);
}
static gboolean
gboolean
gedit_app_osx_show_url (GeditAppOSX *app,
const gchar *url)
{
......@@ -63,7 +68,7 @@ gedit_app_osx_show_help_impl (GeditApp *app,
{
gboolean ret = FALSE;
if (name == NULL || strcmp (name, "gedit.xml") == NULL || strcmp (name, "gedit") == 0)
if (name == NULL || g_strcmp0 (name, "gedit.xml") == 0 || g_strcmp0 (name, "gedit") == 0)
{
gchar *link;
......@@ -77,7 +82,7 @@ gedit_app_osx_show_help_impl (GeditApp *app,
link = g_strdup ("http://library.gnome.org/users/gedit/stable/");
}
ret = gedit_osx_show_url (link);
ret = gedit_app_osx_show_url (GEDIT_APP_OSX (app), link);
g_free (link);
}
......@@ -91,16 +96,19 @@ gedit_app_osx_set_window_title_impl (GeditApp *app,
{
NSWindow *native;
GeditDocument *document;
GdkWindow *wnd;
g_return_if_fail (GEDIT_IS_WINDOW (window));
if (GTK_WIDGET (window)->window == NULL)
wnd = gtk_widget_get_window (GTK_WIDGET (window));
if (wnd == NULL)
{
return;
}
native = gdk_quartz_window_get_nswindow (GTK_WIDGET (window)->window);
document = gedit_app_get_active_document (app);
native = gdk_quartz_window_get_nswindow (wnd);
document = gedit_window_get_active_document (window);
if (document)
{
......@@ -108,14 +116,36 @@ gedit_app_osx_set_window_title_impl (GeditApp *app,
if (gedit_document_is_untitled (document))
{
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
[native setRepresentedURL:nil];
#else
[native setRepresentedFilename:nil];
#endif
}
else
{
const gchar *uri = gedit_document_get_uri (document);
GFile *location;
gchar *uri;
location = gedit_document_get_location (document);
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
uri = g_file_get_uri (location);
g_object_unref (location);
NSURL *nsurl = [NSURL URLWithString:[NSString stringWithUTF8String:uri]];
[native setRepresentedURL:nsurl];
g_free (uri);
#else
if (g_file_has_uri_scheme (location, "file"))
{
uri = g_file_get_path (location);
[native setRepresentedFilename:[NSString stringWithUTF8String:uri]];
g_free (uri);
}
#endif
}
ismodified = !gedit_document_is_untouched (document);
......@@ -123,11 +153,188 @@ gedit_app_osx_set_window_title_impl (GeditApp *app,
}
else
{
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
[native setRepresentedURL:nil];
#else
[native setRepresentedFilename:nil];
#endif
[native setDocumentEdited:false];
}
GEDIT_APP (gedit_app_osx_parent_class)->set_window_title (app, window, title);
GEDIT_APP_CLASS (gedit_app_osx_parent_class)->set_window_title (app, window, title);
}
static void
gedit_app_osx_quit_impl (GeditApp *app)
{
GtkOSXApplication *osxapp;
osxapp = g_object_new (GTK_TYPE_OSX_APPLICATION, NULL);
gtk_osxapplication_cleanup (osxapp);
GEDIT_APP_CLASS (gedit_app_osx_parent_class)->quit (app);
}
static void
load_accels (void)
{
gchar *filename;
filename = g_build_filename (gedit_dirs_get_gedit_data_dir (),
"osx.accels",
NULL);
if (filename != NULL)
{
gedit_debug_message (DEBUG_APP, "Loading accels from %s\n", filename);
gtk_accel_map_load (filename);
g_free (filename);
}
}
static void
load_keybindings (void)
{
gchar *filename;
filename = g_build_filename (gedit_dirs_get_gedit_data_dir (),
"osx.css",
NULL);
if (filename != NULL)
{
GtkCssProvider *provider;
GError *error = NULL;
gedit_debug_message (DEBUG_APP, "Loading keybindings from %s\n", filename);
provider = gtk_css_provider_new ();
if (!gtk_css_provider_load_from_path (provider,
filename,
&error))
{
g_warning ("Failed to load osx keybindings from `%s':\n%s",
filename,
error->message);
g_error_free (error);
}
else
{
gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_SETTINGS);
}
g_object_unref (provider);
g_free (filename);
}
}
static void
gedit_app_osx_constructed (GObject *object)
{
/* First load the osx specific accel overrides */
load_accels ();
load_keybindings ();
if (G_OBJECT_CLASS (gedit_app_osx_parent_class)->constructed)
{
/* Then chain up to load the user specific accels */
G_OBJECT_CLASS (gedit_app_osx_parent_class)->constructed (object);
}
}
static GtkMenuItem *
ui_manager_menu_item (GtkUIManager *uimanager,
const gchar *path)
{
return GTK_MENU_ITEM (gtk_ui_manager_get_widget (uimanager, path));
}
static void
setup_mac_menu (GeditWindow *window)
{
GtkAction *action;
GtkOSXApplication *osxapp;
GtkUIManager *manager;
GtkWidget *menu;
manager = gedit_window_get_ui_manager (window);
/* Hide the menu bar */
menu = gtk_ui_manager_get_widget (manager, "/MenuBar");
gtk_widget_hide (menu);
osxapp = g_object_new (GTK_TYPE_OSX_APPLICATION, NULL);
action = gtk_ui_manager_get_action (manager, "/ui/MenuBar/HelpMenu/HelpAboutMenu");
gtk_action_set_label (action, _("About gedit"));
gtk_widget_hide (GTK_WIDGET (ui_manager_menu_item (manager,
"/ui/MenuBar/FileMenu/FileQuitMenu")));
gtk_osxapplication_set_menu_bar (osxapp,
GTK_MENU_SHELL (menu));
gtk_osxapplication_set_help_menu (osxapp,
ui_manager_menu_item (manager,
"/ui/MenuBar/HelpMenu"));
gtk_osxapplication_set_window_menu (osxapp, NULL);
gtk_osxapplication_insert_app_menu_item (osxapp,
GTK_WIDGET (ui_manager_menu_item (manager,
"/ui/MenuBar/HelpMenu/HelpAboutMenu")),
0);
gtk_osxapplication_insert_app_menu_item (osxapp,
g_object_ref (gtk_separator_menu_item_new ()),
1);
gtk_osxapplication_insert_app_menu_item (osxapp,
GTK_WIDGET (ui_manager_menu_item (manager,
"/ui/MenuBar/EditMenu/EditPreferencesMenu")),
2);
/* We remove the accel group of the uimanager from the window */
gtk_window_remove_accel_group (GTK_WINDOW (window),
gtk_ui_manager_get_accel_group (manager));
}
static GeditWindow *
gedit_app_osx_create_window_impl (GeditApp *app)
{
GeditWindow *window;
window = GEDIT_APP_CLASS (gedit_app_osx_parent_class)->create_window (app);
setup_mac_menu (window);
return window;
}
static gboolean
gedit_app_osx_process_window_event_impl (GeditApp *app,
GeditWindow *window,
GdkEvent *event)
{
NSEvent *nsevent;
/* For OS X we will propagate the event to NSApp, which handles some OS X
* specific keybindings and the accelerators for the menu
*/
nsevent = gdk_quartz_event_get_nsevent (event);
[NSApp sendEvent:nsevent];
/* It does not really matter what we return here since it's the last thing
* in the chain. Also we can't get from sendEvent whether the event was
* actually handled by NSApp anyway
*/
return TRUE;
}
static void
......@@ -137,32 +344,82 @@ gedit_app_osx_class_init (GeditAppOSXClass *klass)
GeditAppClass *app_class = GEDIT_APP_CLASS (klass);
object_class->finalize = gedit_app_osx_finalize;
object_class->constructed = gedit_app_osx_constructed;
app_class->last_window_destroyed = gedit_app_osx_last_window_destroyed_impl;
app_class->show_help = gedit_app_show_help_impl;
app_class->show_help = gedit_app_osx_show_help_impl;
app_class->set_window_title = gedit_app_osx_set_window_title_impl;
app_class->quit = gedit_app_osx_quit_impl;
app_class->create_window = gedit_app_osx_create_window_impl;
app_class->process_window_event = gedit_app_osx_process_window_event_impl;
}
static void
destroy_delegate (GeditOSXDelegate *delegate)
on_osx_will_terminate (GtkOSXApplication *osxapp,
GeditAppOSX *app)
{
[delegate dealloc];
_gedit_app_quit (GEDIT_APP (app));
}
static void
gedit_app_osx_init (GeditAppOSX *self)
static gboolean
on_osx_open_files (GtkOSXApplication *osxapp,
gchar const **paths,
GeditAppOSX *app)
{
GeditOSXDelegate *delegate = [[GeditOSXDelegate alloc] init];
GSList *locations = NULL;
while (paths && *paths)
{
locations = g_slist_prepend (locations,
g_file_new_for_uri (*paths));
++paths;
}
locations = g_slist_reverse (locations);
if (locations != NULL)
{
GSList *files;
GeditWindow *window;
window = gedit_app_get_active_window (GEDIT_APP (app));
g_object_set_data_full (G_OBJECT (app),
"GeditOSXDelegate",
delegate,
(GDestroyNotify)destroy_delegate);
files = gedit_commands_load_locations (window,
locations,
NULL,
0,
0);
ige_mac_menu_set_global_key_handler_enabled (FALSE);
g_slist_free_full (locations, g_object_unref);
}
return TRUE;
}
static void
gedit_app_osx_init (GeditAppOSX *app)
{
GtkOSXApplication *osxapp;
/* This is a singleton */
osxapp = g_object_new (GTK_TYPE_OSX_APPLICATION, NULL);
/* manually set name and icon */
g_set_application_name ("gedit");
gtk_window_set_default_icon_name ("accessories-text-editor");
g_signal_connect (osxapp,
"NSApplicationWillTerminate",
G_CALLBACK (on_osx_will_terminate),
app);
g_signal_connect (osxapp,
"NSApplicationOpenFiles",
G_CALLBACK (on_osx_open_files),
app);
gtk_osxapplication_set_use_quartz_accelerators (osxapp, FALSE);
gtk_osxapplication_ready (osxapp);
}
/* ex:set ts=8 noet: */
......@@ -24,7 +24,6 @@
#define __GEDIT_APP_OSX_H__
#include "gedit-app.h"
#include <ige-mac-integration.h>
G_BEGIN_DECLS
......@@ -51,14 +50,14 @@ struct _GeditAppOSXClass
};
GType gedit_app_osx_get_type (void) G_GNUC_CONST;
void gedit_app_osx_set_window_title (GeditAppOSX *app,
GeditWindow *window,
const gchar *title,
GeditDocument *document);
gboolean gedit_app_osx_show_url (GeditAppOSX *app,
const gchar *url);
gboolean gedit_app_osx_show_help (GeditAppOSX *app,
const gchar *link_id);
gboolean gedit_app_osx_show_url (GeditAppOSX *app,
const gchar *url);
G_END_DECLS
......
......@@ -175,7 +175,8 @@ gedit_app_constructor (GType gtype,
}
static gboolean
gedit_app_last_window_destroyed_impl (GeditApp *app)
gedit_app_last_window_destroyed_impl (GeditApp *app,
GeditWindow *window)
{
return TRUE;
}
......@@ -260,34 +261,6 @@ gedit_app_set_window_title_impl (GeditApp *app,
gtk_window_set_title (GTK_WINDOW (window), title);
}
static void
gedit_app_class_init (GeditAppClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gedit_app_finalize;
object_class->dispose = gedit_app_dispose;
object_class->get_property = gedit_app_get_property;
object_class->constructor = gedit_app_constructor;
klass->last_window_destroyed = gedit_app_last_window_destroyed_impl;
klass->show_help = gedit_app_show_help_impl;
klass->help_link_id = gedit_app_help_link_id_impl;
klass->set_window_title = gedit_app_set_window_title_impl;
g_object_class_install_property (object_class,
PROP_LOCKDOWN,
g_param_spec_flags ("lockdown",
"Lockdown",