From 9aea1fe882e71b77f99a1e8049abfb5ffa327f5a Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 21 Apr 2013 11:41:59 -0400 Subject: Updates to compile with latest GTK-OSX. This fixes Fn key recognition. --- core/keys.lua | 2 -- doc/12_Compiling.md | 2 +- src/Makefile | 3 ++- src/textadept.c | 18 +++++++++--------- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/core/keys.lua b/core/keys.lua index 794c3001..080ce400 100644 --- a/core/keys.lua +++ b/core/keys.lua @@ -182,8 +182,6 @@ M.KEYSYMS = { [0xFFBE] = 'f1', [0xFFBF] = 'f2', [0xFFC0] = 'f3', [0xFFC1] = 'f4', [0xFFC2] = 'f5', [0xFFC3] = 'f6', [0xFFC4] = 'f7', [0xFFC5] = 'f8', [0xFFC6] = 'f9', [0xFFC7] = 'f10', [0xFFC8] = 'f11', [0xFFC9] = 'f12', - -- Mac OSX. - [16777232] = 'fn', -- GTKOSX does not recognize Fn-key combinations, just this } -- The current key sequence. diff --git a/doc/12_Compiling.md b/doc/12_Compiling.md index f45cf88e..276b33b8 100644 --- a/doc/12_Compiling.md +++ b/doc/12_Compiling.md @@ -55,7 +55,7 @@ Compiling Textadept on Mac OSX is no longer supported. The preferred way is cross-compiling from Linux. To do so, you will need my [GTK+ for OSX bundle][] and the [Apple Cross-compiler][] binaries. -[GTK+ for OSX bundle]: download/gtkosx-2.24.9.zip +[GTK+ for OSX bundle]: download/gtkosx-2.24.16.zip [Apple Cross-compiler]: https://launchpad.net/~flosoft/+archive/cross-apple ## Compiling diff --git a/src/Makefile b/src/Makefile index a1bf2ebe..f222f0fd 100644 --- a/src/Makefile +++ b/src/Makefile @@ -58,7 +58,8 @@ ifneq (, $(or $(findstring Linux, $(kernel)), $(findstring BSD, $(kernel)))) --cflags gtk+-2.0) gtk_libs = $(shell PKG_CONFIG_PATH=`pwd`/gtkosx/lib/pkgconfig \ pkg-config --define-variable=prefix=gtkosx \ - --libs gtk+-2.0) -framework Cocoa -lgtkmacintegration + --libs gtk+-2.0 gmodule-2.0 gtk-mac-integration) \ + -framework Cocoa else plat_flag = -DCURSES curses_libs = -lncurses diff --git a/src/textadept.c b/src/textadept.c index e58a0cf1..f13d4e0d 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -78,7 +78,7 @@ static Scintilla *focused_view; static GtkWidget *window, *menubar, *statusbar[2]; static GtkAccelGroup *accel; #if __APPLE__ -static GtkOSXApplication *osxapp; +static GtkosxApplication *osxapp; #endif #elif (CURSES && !_WIN32) static struct termios term; @@ -982,7 +982,7 @@ static int lgui__newindex(lua_State *L) { gtk_box_reorder_child(GTK_BOX(vbox), new_menubar, 0); gtk_widget_show_all(new_menubar); #if (__APPLE__ && !CURSES) - gtk_osxapplication_set_menu_bar(osxapp, GTK_MENU_SHELL(new_menubar)); + gtkosx_application_set_menu_bar(osxapp, GTK_MENU_SHELL(new_menubar)); gtk_widget_hide(new_menubar); #endif #endif @@ -1713,7 +1713,7 @@ static int w_exit(GtkWidget*_, GdkEventAny*__, void*___) { * Signal for opening files from OSX. * Generates an 'appleevent_odoc' event for each document sent. */ -static int w_open_osx(GtkOSXApplication*_, char *path, void*__) { +static int w_open_osx(GtkosxApplication*_, char *path, void*__) { return (lL_event(lua, "appleevent_odoc", LUA_TSTRING, path, -1), TRUE); } @@ -1721,7 +1721,7 @@ static int w_open_osx(GtkOSXApplication*_, char *path, void*__) { * Signal for block terminating Textadept from OSX. * Generates a 'quit' event. */ -static int w_exit_osx(GtkOSXApplication*_, void*__) { +static int w_exit_osx(GtkosxApplication*_, void*__) { return !lL_event(lua, "quit", -1); } @@ -1730,7 +1730,7 @@ static int w_exit_osx(GtkOSXApplication*_, void*__) { * Closes the Lua state and releases resources. * @see l_close */ -static void w_quit_osx(GtkOSXApplication*_, void*__) { +static void w_quit_osx(GtkosxApplication*_, void*__) { l_close(lua); scintilla_release_resources(); g_object_unref(osxapp); @@ -2144,7 +2144,7 @@ static void new_window() { accel = gtk_accel_group_new(); #if (__APPLE__ && !CURSES) - gtk_osxapplication_set_use_quartz_accelerators(osxapp, FALSE); + gtkosx_application_set_use_quartz_accelerators(osxapp, FALSE); osx_signal(osxapp, "NSApplicationOpenFile", w_open_osx); osx_signal(osxapp, "NSApplicationBlockTermination", w_exit_osx); osx_signal(osxapp, "NSApplicationWillTerminate", w_quit_osx); @@ -2253,8 +2253,8 @@ int main(int argc, char **argv) { GetModuleFileName(0, textadept_home, FILENAME_MAX); if ((last_slash = strrchr(textadept_home, '\\'))) *last_slash = '\0'; #elif (__APPLE__ && !CURSES) - osxapp = g_object_new(GTK_TYPE_OSX_APPLICATION, NULL); - char *path = quartz_application_get_resource_path(); + osxapp = g_object_new(GTKOSX_TYPE_APPLICATION, NULL); + char *path = gtkosx_application_get_resource_path(); textadept_home = g_filename_from_utf8((const char *)path, -1, NULL, NULL, NULL); g_free(path); @@ -2294,7 +2294,7 @@ int main(int argc, char **argv) { new_window(); lL_dofile(lua, "init.lua"); #if (__APPLE__ && !CURSES) - gtk_osxapplication_ready(osxapp); + gtkosx_application_ready(osxapp); #endif #if GTK -- cgit v1.2.3