[gedit/gnome-2-28] Basic mac OS X integration (menu, dock, bundle)



commit e79e97dc87860039f65842de698c2c710cbd2975
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date:   Mon Nov 9 16:17:42 2009 +0100

    Basic mac OS X integration (menu, dock, bundle)

 Makefile.am                                     |    6 +-
 configure.ac                                    |   39 ++-
 data/gedit.schemas.in.in                        |    4 +-
 gedit/Makefile.am                               |   17 +-
 gedit/gedit-app.c                               |   83 ++++-
 gedit/gedit-commands-file.c                     |   58 +++-
 gedit/gedit-dirs.c                              |   83 ++++-
 gedit/gedit-help.c                              |   15 +
 gedit/gedit-prefs-manager.h                     |   11 +
 gedit/gedit-ui.h                                |   13 +-
 gedit/gedit-window-private.h                    |    1 +
 gedit/gedit-window.c                            |   98 ++++--
 gedit/gedit-window.h                            |    2 +
 gedit/gedit.c                                   |   14 +-
 gedit/osx/Makefile.am                           |   23 ++
 gedit/osx/gedit-osx-delegate.h                  |   16 +
 gedit/osx/gedit-osx-delegate.m                  |   83 +++++
 gedit/osx/gedit-osx.c                           |   94 +++++
 gedit/osx/gedit-osx.h                           |   17 +
 gedit/smclient/Makefile.am                      |    2 +-
 osx/Info.plist                                  |  260 ++++++++++++++
 osx/dmg-data/background.png                     |  Bin 0 -> 31115 bytes
 osx/dmg-data/background.svg                     |  395 +++++++++++++++++++++
 osx/gedit.bundle                                |  111 ++++++
 osx/gedit.icns                                  |  Bin 0 -> 175597 bytes
 osx/gtkrc                                       |  428 +++++++++++++++++++++++
 osx/launcher.sh                                 |   56 +++
 osx/makebundle.sh                               |   12 +
 osx/makedmg.sh                                  |   64 ++++
 osx/template.dmg                                |  Bin 0 -> 19345408 bytes
 plugins/checkupdate/gedit-check-update-plugin.c |   24 +-
 31 files changed, 1950 insertions(+), 79 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 013a721..1cb0dea 100644
--- a/configure.ac
+++ b/configure.ac
@@ -87,7 +87,6 @@ AC_MSG_CHECKING([for Mac OS X platform])
 case "$host" in
   *-*-darwin*)
     platform_osx=yes
-    ACTIVE_PLUGINS="${ACTIVE_PLUGINS},checkupdate"
     ;;
   *)
     platform_osx=no
@@ -96,8 +95,41 @@ esac
 AC_MSG_RESULT([$platform_osx])
 AM_CONDITIONAL(PLATFORM_OSX, test "$platform_osx" = "yes")
 
+dnl check for native osx
+gdk_windowing=`$PKG_CONFIG --variable=target gdk-2.0`
+
+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")
+
 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"
+else
+	DEFAULT_FONT="Monospace 12"
+	DEFAULT_PRINT_FONT="Monospace 9"
+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)
+	
+	AC_PROG_OBJC
 fi
 
 dnl ===============================================================
@@ -149,7 +181,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
@@ -261,7 +293,7 @@ fi
 
 AM_CONDITIONAL(BUILD_MESSAGE_AREA, test "$gtkatleast" = "no")
 
-if test "$platform_osx" = "no" &&
+if test "$os_osx" = "no" &&
    test "$os_win32" = no; then
 	PKG_CHECK_MODULES(EGG_SMCLIENT, [
 		sm >= 1.0.0
@@ -446,6 +478,7 @@ docs/Makefile
 docs/reference/Makefile
 gedit/dialogs/Makefile
 gedit/smclient/Makefile
+gedit/osx/Makefile
 gedit/Makefile
 help/Makefile
 pixmaps/Makefile
diff --git a/data/gedit.schemas.in.in b/data/gedit.schemas.in.in
index aef60f5..48c864d 100644
--- a/data/gedit.schemas.in.in
+++ b/data/gedit.schemas.in.in
@@ -22,7 +22,7 @@
       <type>string</type>
       <locale name="C">
         <default><!-- Translators: This is the Editor Font.
-	This is a Pango font-->Monospace 12</default>
+	This is a Pango font-->@DEFAULT_FONT@</default>
 	<short>Editor Font</short>
 	<long>A custom font that will be used for the editing area.
 	This will only take effect if the "Use Default Font" option is
@@ -394,7 +394,7 @@
       <type>string</type>
       <locale name="C">
         <default><!-- Translators: This is the Body font for printing. 
-        This is a Pango font.-->Monospace 9</default>
+        This is a Pango font.-->@DEFAULT_PRINT_FONT@</default>
 	<short>Body Font for Printing</short>
 	<long>Specifies the font to use for a document's body when
 	printing documents.</long>
diff --git a/gedit/Makefile.am b/gedit/Makefile.am
index 35ea707..0be9b2e 100644
--- a/gedit/Makefile.am
+++ b/gedit/Makefile.am
@@ -1,6 +1,10 @@
 ## Process this file with automake to produce Makefile.in
 SUBDIRS = dialogs smclient
 
+if OS_OSX
+SUBDIRS += osx
+endif
+
 bin_PROGRAMS = gedit
 
 noinst_LTLIBRARIES = libgedit.la
@@ -10,6 +14,7 @@ INCLUDES =								\
 	-I$(srcdir)							\
 	-I$(srcdir)/smclient						\
 	$(GEDIT_CFLAGS)							\
+	$(IGE_MAC_CFLAGS)							\
 	$(WARN_CFLAGS)							\
 	$(DISABLE_DEPRECATED_CFLAGS)					\
 	-DDATADIR=\""$(datadir)"\"					\
@@ -18,7 +23,7 @@ INCLUDES =								\
 gedit_SOURCES = \
 	gedit.c
 
-gedit_LDADD = libgedit.la $(GEDIT_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
@@ -26,10 +31,6 @@ else
 gedit_LDFLAGS = -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*"
 endif
 
-if PLATFORM_OSX
-gedit_LDFLAGS += -framework Carbon
-endif
-
 libgedit_la_LDFLAGS = -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*"
 
 libgedit_la_LIBADD = \
@@ -39,6 +40,12 @@ libgedit_la_LIBADD = \
 # GEDIT_LIBS must be the last to ensure correct order on some platforms
 libgedit_la_LIBADD += $(GEDIT_LIBS)
 
+if OS_OSX
+gedit_LDFLAGS += -framework Carbon
+
+libgedit_la_LIBADD += osx/libosx.la
+endif
+
 BUILT_SOURCES = 			\
 	gedit-enum-types.c		\
 	gedit-enum-types.h		\
diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c
index db52a18..9cb1833 100644
--- a/gedit/gedit-app.c
+++ b/gedit/gedit-app.c
@@ -46,6 +46,9 @@
 #include "gedit-enum-types.h"
 #include "gedit-dirs.h"
 
+#ifdef OS_OSX
+#include <ige-mac-integration.h>
+#endif
 
 #define GEDIT_PAGE_SETUP_FILE		"gedit-page-setup"
 #define GEDIT_PRINT_SETTINGS_FILE	"gedit-print-settings"
@@ -372,6 +375,60 @@ gedit_app_get_default (void)
 	return app;
 }
 
+#ifdef OS_OSX
+static GtkMenuItem *
+ui_manager_menu_item (GtkUIManager *uimanager,
+                      const gchar  *path)
+{
+	return GTK_MENU_ITEM (gtk_ui_manager_get_widget (uimanager, path));
+}
+
+static void
+osx_switch_menubar (GeditApp    *app,
+                    GeditWindow *window)
+{
+	GtkWidget *menubar;
+
+	if (window != NULL && app->priv->active_window != window)
+	{
+		GtkUIManager *uimanager;
+		IgeMacMenuGroup *group;
+		GtkAction *action;
+
+		menubar = _gedit_window_get_menu_bar (window);
+		uimanager = gedit_window_get_ui_manager (window);
+
+		gtk_widget_hide (menubar);
+		action = gtk_ui_manager_get_action (uimanager, "/ui/MenuBar/HelpMenu/HelpAboutMenu");
+
+		gtk_action_set_label (action, _("About gedit"));
+
+		ige_mac_menu_set_menu_bar (GTK_MENU_SHELL (menubar));
+
+		ige_mac_menu_set_quit_menu_item (ui_manager_menu_item (uimanager, "/ui/MenuBar/FileMenu/FileQuitMenu"));
+
+		group = ige_mac_menu_add_app_menu_group ();
+
+		ige_mac_menu_add_app_menu_item (group,
+		                                ui_manager_menu_item (uimanager, "/ui/MenuBar/HelpMenu/HelpAboutMenu"),
+		                                NULL);
+
+		ige_mac_menu_set_preferences_menu_item (ui_manager_menu_item (uimanager, "/ui/MenuBar/EditMenu/EditPreferencesMenu"));
+	}
+}
+#endif
+
+static void
+set_active_window (GeditApp    *app,
+                   GeditWindow *window)
+{
+#ifdef OS_OSX
+	osx_switch_menubar (app, window);
+#endif
+
+	app->priv->active_window = window;
+}
+
 static gboolean
 window_focus_in_event (GeditWindow   *window, 
 		       GdkEventFocus *event, 
@@ -380,7 +437,7 @@ window_focus_in_event (GeditWindow   *window,
 	/* updates active_view and active_child when a new toplevel receives focus */
 	g_return_val_if_fail (GEDIT_IS_WINDOW (window), FALSE);
 
-	app->priv->active_window = window;
+	set_active_window (app, window);
 
 	return FALSE;
 }
@@ -415,8 +472,7 @@ window_destroy (GeditWindow *window,
 
 	if (window == app->priv->active_window)
 	{
-		app->priv->active_window = app->priv->windows != NULL ?
-					   app->priv->windows->data : NULL;
+		set_active_window (app, app->priv->windows != NULL ? app->priv->windows->data : NULL);
 	}
 
 /* CHECK: I don't think we have to disconnect this function, since windows
@@ -428,11 +484,20 @@ window_destroy (GeditWindow *window,
 	g_signal_handlers_disconnect_by_func (window, 
 					      G_CALLBACK (window_destroy),
 					      app);
-*/					      
+*/
 	if (app->priv->windows == NULL)
 	{
-		/* Last window is gone... save some settings and exit */
+#ifdef OS_OSX
+		if (!GPOINTER_TO_INT (g_object_get_data (G_OBJECT (window), "gedit-is-quitting-all")))
+		{
+			GeditWindow *hidden;
 
+			/* create new hidden window */
+			hidden = gedit_app_create_window (app, NULL);
+			return;
+		}
+#endif
+		/* Last window is gone... save some settings and exit */
 		ensure_user_config_dir ();
 
 		save_accels ();
@@ -476,8 +541,8 @@ gedit_app_create_window_real (GeditApp    *app,
 	 */
 	if (app->priv->windows == NULL)
 	{
-		app->priv->active_window = window = g_object_new (GEDIT_TYPE_WINDOW,
-								  NULL);
+		window = g_object_new (GEDIT_TYPE_WINDOW, NULL);
+		set_active_window (app, window);
 	}
 	else
 	{
@@ -541,6 +606,10 @@ gedit_app_create_window_real (GeditApp    *app,
 			  G_CALLBACK (window_destroy),
 			  app);
 
+#ifdef OS_OSX
+	gtk_widget_hide (_gedit_window_get_menu_bar (window));
+#endif
+
 	return window;
 }
 
diff --git a/gedit/gedit-commands-file.c b/gedit/gedit-commands-file.c
index 23767fc..b8f6de3 100644
--- a/gedit/gedit-commands-file.c
+++ b/gedit/gedit-commands-file.c
@@ -57,7 +57,7 @@
 #define GEDIT_IS_CLOSING_ALL            "gedit-is-closing-all"
 #define GEDIT_IS_QUITTING 	        "gedit-is-quitting"
 #define GEDIT_IS_CLOSING_TAB		"gedit-is-closing-tab"
-
+#define GEDIT_IS_QUITTING_ALL		"gedit-is-quitting-all"
 
 static void tab_state_changed_while_saving (GeditTab    *tab,
 					    GParamSpec  *pspec,
@@ -1643,6 +1643,12 @@ close_confirmation_dialog_response_handler (GeditCloseConfirmationDialog *dlg,
 			g_object_set_data (G_OBJECT (window),
 					   GEDIT_IS_QUITTING,
 					   GBOOLEAN_TO_POINTER (FALSE));
+
+#ifdef OS_OSX
+			g_object_set_data (G_OBJECT (window),
+			                   GEDIT_IS_QUITTING_ALL,
+			                   GINT_TO_POINTER (FALSE));
+#endif
 			break;
 	}
 
@@ -1704,6 +1710,11 @@ _gedit_cmd_file_close_tab (GeditTab    *tab,
 			   GEDIT_IS_QUITTING,
 			   GBOOLEAN_TO_POINTER (FALSE));
 
+	g_object_set_data (G_OBJECT (window), 
+	                   GEDIT_IS_QUITTING_ALL, 
+	                   GINT_TO_POINTER (FALSE));
+
+
 	if (tab_can_close (tab, GTK_WINDOW (window)))
 		gedit_window_close_tab (window, tab);
 }
@@ -1717,8 +1728,15 @@ _gedit_cmd_file_close (GtkAction   *action,
 	gedit_debug (DEBUG_COMMANDS);
 
 	active_tab = gedit_window_get_active_tab (window);
+
 	if (active_tab == NULL)
+	{
+#ifdef OS_OSX
+		/* Close the window on OS X */
+		gtk_widget_destroy (GTK_WIDGET (window));
+#endif
 		return;
+	}
 
 	_gedit_cmd_file_close_tab (active_tab, window);
 }
@@ -1809,12 +1827,50 @@ _gedit_cmd_file_close_all (GtkAction   *action,
 }
 
 /* Quit */
+#ifdef OS_OSX
+static void
+quit_all ()
+{
+	GList *windows;
+	GList *item;
+	GeditApp *app;
+
+	app = gedit_app_get_default ();
+	windows = g_list_copy ((GList *)gedit_app_get_windows (app));
+
+	for (item = windows; item; item = g_list_next (item))
+	{
+		GeditWindow *window = GEDIT_WINDOW (item->data);
+	
+		g_object_set_data (G_OBJECT (window),
+		                   GEDIT_IS_QUITTING_ALL,
+		                   GINT_TO_POINTER (TRUE));
+
+		if (!(gedit_window_get_state (window) &
+		                    (GEDIT_WINDOW_STATE_SAVING |
+		                     GEDIT_WINDOW_STATE_PRINTING |
+		                     GEDIT_WINDOW_STATE_SAVING_SESSION)))
+		{
+			file_close_all (window, TRUE);
+		}
+	}
+}
+#endif
+
 void
 _gedit_cmd_file_quit (GtkAction   *action,
 		     GeditWindow *window)
 {
 	gedit_debug (DEBUG_COMMANDS);
 
+#ifdef OS_OSX
+	if (action != NULL)
+	{
+		quit_all ();
+		return;
+	}
+#endif
+
 	g_return_if_fail (!(gedit_window_get_state (window) &
 	                    (GEDIT_WINDOW_STATE_SAVING |
 	                     GEDIT_WINDOW_STATE_PRINTING |
diff --git a/gedit/gedit-dirs.c b/gedit/gedit-dirs.c
index da9fec5..75c59a2 100644
--- a/gedit/gedit-dirs.c
+++ b/gedit/gedit-dirs.c
@@ -20,8 +20,16 @@
  * Boston, MA 02111-1307, USA. 
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "gedit-dirs.h"
 
+#ifdef OS_OSX
+#include <ige-mac-bundle.h>
+#endif
+
 gchar *
 gedit_dirs_get_user_config_dir (void)
 {
@@ -119,11 +127,7 @@ gedit_dirs_get_gedit_data_dir (void)
 {
 	gchar *data_dir;
 
-#ifndef G_OS_WIN32
-	data_dir = g_build_filename (DATADIR,
-				     "gedit-2",
-				     NULL);
-#else
+#ifdef G_OS_WIN32
 	gchar *win32_dir;
 	
 	win32_dir = g_win32_get_package_installation_directory_of_module (NULL);
@@ -134,6 +138,25 @@ gedit_dirs_get_gedit_data_dir (void)
 				     NULL);
 	
 	g_free (win32_dir);
+#elif defined (OS_OSX)
+	IgeMacBundle *bundle = ige_mac_bundle_get_default ();
+
+	if (ige_mac_bundle_get_is_app_bundle (bundle))
+	{
+		const gchar *bundle_data_dir = ige_mac_bundle_get_datadir (bundle);
+
+		data_dir = g_build_filename (bundle_data_dir,
+		                             "gedit-2",
+	                                     NULL);
+	}
+	else
+	{
+		data_dir = g_build_filename (DATADIR, "gedit-2", NULL);
+	}
+#else
+	data_dir = g_build_filename (DATADIR,
+	                             "gedit-2",
+	                             NULL);
 #endif
 
 	return data_dir;
@@ -144,11 +167,7 @@ gedit_dirs_get_gedit_locale_dir (void)
 {
 	gchar *locale_dir;
 
-#ifndef G_OS_WIN32
-	locale_dir = g_build_filename (DATADIR,
-				       "locale",
-				       NULL);
-#else
+#ifdef G_OS_WIN32
 	gchar *win32_dir;
 	
 	win32_dir = g_win32_get_package_installation_directory_of_module (NULL);
@@ -159,6 +178,23 @@ gedit_dirs_get_gedit_locale_dir (void)
 				       NULL);
 	
 	g_free (win32_dir);
+#elif defined (OS_OSX)
+	IgeMacBundle *bundle = ige_mac_bundle_get_default ();
+
+	if (ige_mac_bundle_get_is_app_bundle (bundle))
+	{
+		locale_dir = g_strdup (ige_mac_bundle_get_localedir (bundle));
+	}
+	else
+	{
+		locale_dir = g_build_filename (DATADIR,
+		                               "locale",
+		                               NULL);
+	}
+#else
+	locale_dir = g_build_filename (DATADIR,
+				       "locale",
+				       NULL);
 #endif
 
 	return locale_dir;
@@ -169,11 +205,7 @@ gedit_dirs_get_gedit_lib_dir (void)
 {
 	gchar *lib_dir;
 
-#ifndef G_OS_WIN32
-	lib_dir = g_build_filename (LIBDIR,
-				    "gedit-2",
-				    NULL);
-#else
+#ifdef G_OS_WIN32
 	gchar *win32_dir;
 	
 	win32_dir = g_win32_get_package_installation_directory_of_module (NULL);
@@ -184,6 +216,27 @@ gedit_dirs_get_gedit_lib_dir (void)
 				    NULL);
 	
 	g_free (win32_dir);
+#elif defined (OS_OSX)
+	IgeMacBundle *bundle = ige_mac_bundle_get_default ();
+
+	if (ige_mac_bundle_get_is_app_bundle (bundle))
+	{
+ 		const gchar *path = ige_mac_bundle_get_resourcesdir (bundle);
+		lib_dir = g_build_filename (path,
+	                            	"lib",
+	                            	"gedit-2",
+	                            	NULL);
+	}
+	else
+	{
+		lib_dir = g_build_filename (LIBDIR,
+					    "gedit-2",
+					    NULL);
+	}
+#else
+	lib_dir = g_build_filename (LIBDIR,
+				    "gedit-2",
+				    NULL);
 #endif
 
 	return lib_dir;
diff --git a/gedit/gedit-help.c b/gedit/gedit-help.c
index 5df9dc6..744afb5 100644
--- a/gedit/gedit-help.c
+++ b/gedit/gedit-help.c
@@ -38,6 +38,10 @@
 #include <string.h>
 #include <gtk/gtk.h>
 
+#ifdef OS_OSX
+#include "osx/gedit-osx.h"
+#endif
+
 gboolean    
 gedit_help_display (GtkWindow   *parent,
 		    const gchar *name, /* "gedit" if NULL */
@@ -49,6 +53,17 @@ gedit_help_display (GtkWindow   *parent,
 	
 	g_return_val_if_fail ((parent == NULL) || GTK_IS_WINDOW (parent), FALSE);
 
+#ifdef OS_OSX
+	if (name == NULL || strcmp(name, "gedit.xml") == NULL || strcmp(name, "gedit") == 0)
+	{
+		return gedit_osx_show_help (link_id);
+	}
+	else
+	{
+		return FALSE;
+	}
+#endif
+
 	if (name == NULL)
 		name = "gedit";
 	else if (strcmp (name, "gedit.xml") == 0)
diff --git a/gedit/gedit-prefs-manager.h b/gedit/gedit-prefs-manager.h
index b9b14b3..c001f12 100644
--- a/gedit/gedit-prefs-manager.h
+++ b/gedit/gedit-prefs-manager.h
@@ -145,8 +145,14 @@
 /* Fallback default values. Keep in sync with gedit.schemas */
 
 #define GPM_DEFAULT_USE_DEFAULT_FONT 	1 /* TRUE */
+
+#ifndef PLATFORM_OSX
 #define GPM_DEFAULT_EDITOR_FONT 	(const gchar*) "Monospace 12"
 #define GPM_DEFAULT_SYSTEM_FONT 	(const gchar*) "Monospace 10"
+#else
+#define GPM_DEFAULT_EDITOR_FONT		(const gchar*) "Monaco 12"
+#define GPM_DEFAULT_SYSTEM_FONT		(const gchar*) "Monaco 12"
+#endif
 
 #define GPM_DEFAULT_CREATE_BACKUP_COPY	1 /* TRUE */
 #define GPM_DEFAULT_BACKUP_COPY_EXTENSION (const gchar*) "~"
@@ -180,7 +186,12 @@
 #define GPM_DEFAULT_PRINT_WRAP_MODE	"GTK_WRAP_WORD"
 #define GPM_DEFAULT_PRINT_LINE_NUMBERS	0 /* No numbers */
 
+#ifndef PLATFORM_OSX
 #define GPM_DEFAULT_PRINT_FONT_BODY 	(const gchar*) "Monospace 9"
+#else
+#define GPM_DEFAULT_PRINT_FONT_BODY	(const gchar*) "Monaco 10"
+#endif
+
 #define GPM_DEFAULT_PRINT_FONT_HEADER	(const gchar*) "Sans 11"
 #define GPM_DEFAULT_PRINT_FONT_NUMBERS	(const gchar*) "Sans 8"
 
diff --git a/gedit/gedit-ui.h b/gedit/gedit-ui.h
index 121688e..f007182 100644
--- a/gedit/gedit-ui.h
+++ b/gedit/gedit-ui.h
@@ -57,6 +57,11 @@ static const GtkActionEntry gedit_always_sensitive_menu_entries[] =
 	  N_("Create a new document"), G_CALLBACK (_gedit_cmd_file_new) },
 	{ "FileOpen", GTK_STOCK_OPEN, N_("_Open..."), "<control>O",
 	  N_("Open a file"), G_CALLBACK (_gedit_cmd_file_open) },
+
+#ifdef OS_OSX
+	{ "FileClose", GTK_STOCK_CLOSE, NULL, "<control>W",
+	  N_("Close the current file"), G_CALLBACK (_gedit_cmd_file_close) },
+#endif
 	
 	/* Edit menu */
 	{ "EditPreferences", GTK_STOCK_PREFERENCES, N_("Pr_eferences"), NULL,
@@ -91,9 +96,10 @@ 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 OS_OSX
 	{ "FileClose", GTK_STOCK_CLOSE, NULL, "<control>W",
 	  N_("Close the current file"), G_CALLBACK (_gedit_cmd_file_close) },
-
+#endif
 	/* Edit menu */
 	{ "EditUndo", GTK_STOCK_UNDO, NULL, "<control>Z",
 	  N_("Undo the last action"), G_CALLBACK (_gedit_cmd_edit_undo) },
@@ -120,8 +126,13 @@ 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 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
+	{ "SearchReplace", GTK_STOCK_FIND_AND_REPLACE, N_("_Replace..."), "<control><alt>F",
+	  N_("Search for and replace text"), G_CALLBACK (_gedit_cmd_search_replace) },
+#endif
 	{ "SearchClearHighlight", NULL, N_("_Clear Highlight"), "<shift><control>K",
 	  N_("Clear highlighting of search matches"), G_CALLBACK (_gedit_cmd_search_clear_highlight) },
 	{ "SearchGoToLine", GTK_STOCK_JUMP_TO, N_("Go to _Line..."), "<control>I",
diff --git a/gedit/gedit-window-private.h b/gedit/gedit-window-private.h
index 0467d8e..a364874 100644
--- a/gedit/gedit-window-private.h
+++ b/gedit/gedit-window-private.h
@@ -78,6 +78,7 @@ struct _GeditWindowPrivate
 	guint           documents_list_menu_ui_id;
 	GtkWidget      *toolbar;
 	GtkWidget      *toolbar_recent_menu;
+	GtkWidget      *menubar;
 	GeditToolbarSetting toolbar_style;
 
 	/* recent files */
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index 680393c..4a808e9 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -57,6 +57,10 @@
 #include "gedit-dirs.h"
 #include "gedit-status-combo-box.h"
 
+#ifdef OS_OSX
+#include "osx/gedit-osx.h"
+#endif
+
 #define LANGUAGE_NONE (const gchar *)"LangNone"
 #define GEDIT_UIFILE "gedit-ui.xml"
 #define TAB_WIDTH_DATA "GeditWindowTabWidthData"
@@ -718,7 +722,7 @@ set_sensitivity_according_to_tab (GeditWindow *window,
 				  (state == GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW)) &&
 				  !(lockdown & GEDIT_LOCKDOWN_PRINTING));
 				  
-	action = gtk_action_group_get_action (window->priv->action_group,
+	action = gtk_action_group_get_action (window->priv->always_sensitive_action_group,
 					      "FileClose");
 
 	gtk_action_set_sensitive (action,
@@ -1408,7 +1412,6 @@ create_menu_bar_and_toolbar (GeditWindow *window,
 	GtkActionGroup *action_group;
 	GtkAction *action;
 	GtkUIManager *manager;
-	GtkWidget *menubar;
 	GtkRecentManager *recent_manager;
 	GError *error = NULL;
 	gchar *ui_file;
@@ -1557,9 +1560,9 @@ create_menu_bar_and_toolbar (GeditWindow *window,
 	gtk_ui_manager_insert_action_group (manager, action_group, 0);
 	g_object_unref (action_group);
 
-	menubar = gtk_ui_manager_get_widget (manager, "/MenuBar");
+	window->priv->menubar = gtk_ui_manager_get_widget (manager, "/MenuBar");
 	gtk_box_pack_start (GTK_BOX (main_box), 
-			    menubar, 
+			    window->priv->menubar,
 			    FALSE, 
 			    FALSE, 
 			    0);
@@ -2126,7 +2129,11 @@ set_title (GeditWindow *window)
 
 	if (window->priv->active_tab == NULL)
 	{
+#ifdef OS_OSX
+		gedit_osx_set_window_title (window, "gedit", NULL);
+#else
 		gtk_window_set_title (GTK_WINDOW (window), "gedit");
+#endif
 		return;
 	}
 
@@ -2206,7 +2213,11 @@ set_title (GeditWindow *window)
 						 name);
 	}
 
+#ifdef OS_OSX
+	gedit_osx_set_window_title (window, title, doc);
+#else
 	gtk_window_set_title (GTK_WINDOW (window), title);
+#endif
 
 	g_free (dirname);
 	g_free (name);
@@ -3113,13 +3124,35 @@ editable_changed (GeditView  *view,
 }
 
 static void
+update_sensitivity (GeditWindow *window)
+{
+	GtkAction *action;
+
+	/* Set sensitivity */
+	gtk_action_group_set_sensitive (window->priv->action_group,
+					window->priv->num_tabs != 0);
+
+	action = gtk_action_group_get_action (window->priv->action_group,
+					     "DocumentsMoveToNewWindow");
+	gtk_action_set_sensitive (action,
+				  window->priv->num_tabs > 1);
+
+	/* Set sensitivity */
+	if (window->priv->num_tabs == 0)
+	{
+		action = gtk_action_group_get_action (window->priv->action_group,
+						      "ViewHighlightMode");
+		gtk_action_set_sensitive (action, FALSE);
+	}
+}
+
+static void
 notebook_tab_added (GeditNotebook *notebook,
 		    GeditTab      *tab,
 		    GeditWindow   *window)
 {
 	GeditView *view;
 	GeditDocument *doc;
-	GtkAction *action;
 
 	gedit_debug (DEBUG_WINDOW);
 
@@ -3127,15 +3160,7 @@ notebook_tab_added (GeditNotebook *notebook,
 	
 	++window->priv->num_tabs;
 
-	/* Set sensitivity */
-	if (!gtk_action_group_get_sensitive (window->priv->action_group))
-		gtk_action_group_set_sensitive (window->priv->action_group,
-						TRUE);
-
-	action = gtk_action_group_get_action (window->priv->action_group,
-					     "DocumentsMoveToNewWindow");
-	gtk_action_set_sensitive (action,
-				  window->priv->num_tabs > 1);
+	update_sensitivity (window);
 
 	view = gedit_tab_get_view (tab);
 	doc = gedit_tab_get_document (tab);
@@ -3204,7 +3229,6 @@ notebook_tab_removed (GeditNotebook *notebook,
 {
 	GeditView     *view;
 	GeditDocument *doc;
-	GtkAction     *action;
 
 	gedit_debug (DEBUG_WINDOW);
 
@@ -3302,29 +3326,14 @@ notebook_tab_removed (GeditNotebook *notebook,
 		}
 	}
 
-	/* Set sensitivity */
+	update_sensitivity (window);
+
 	if (window->priv->num_tabs == 0)
 	{
-		if (gtk_action_group_get_sensitive (window->priv->action_group))
-			gtk_action_group_set_sensitive (window->priv->action_group,
-							FALSE);
-
-		action = gtk_action_group_get_action (window->priv->action_group,
-						      "ViewHighlightMode");
-		gtk_action_set_sensitive (action, FALSE);
-
 		gedit_plugins_engine_update_plugins_ui (gedit_plugins_engine_get_default (),
 							 window);
 	}
 
-	if (window->priv->num_tabs <= 1)
-	{
-		action = gtk_action_group_get_action (window->priv->action_group,
-						     "DocumentsMoveToNewWindow");
-		gtk_action_set_sensitive (action,
-					  FALSE);
-	}
-
 	update_window_state (window);
 
 	g_signal_emit (G_OBJECT (window), signals[TAB_REMOVED], 0, tab);	
@@ -3913,6 +3922,8 @@ gedit_window_init (GeditWindow *window)
 	 * This needs to be done after plugins activatation */
 	init_panels_visibility (window);
 
+	update_sensitivity (window);
+
 	gedit_debug_message (DEBUG_WINDOW, "END");
 }
 
@@ -3995,6 +4006,11 @@ gedit_window_create_tab (GeditWindow *window,
 				-1,
 				jump_to);
 
+	if (!GTK_WIDGET_VISIBLE (window))
+	{
+		gtk_window_present (GTK_WINDOW (window));
+	}
+
 	return tab;
 }
 
@@ -4040,7 +4056,13 @@ gedit_window_create_tab_from_uri (GeditWindow         *window,
 				GEDIT_TAB (tab),
 				-1,
 				jump_to);
-				
+
+
+	if (!GTK_WIDGET_VISIBLE (window))
+	{
+		gtk_window_present (GTK_WINDOW (window));
+	}
+
 	return GEDIT_TAB (tab);
 }				  
 
@@ -4470,8 +4492,7 @@ _gedit_window_fullscreen (GeditWindow *window)
 	g_signal_connect (window->priv->notebook, "notify::show-tabs",
 			  G_CALLBACK (hide_notebook_tabs_on_fullscreen), window);
 	
-	gtk_widget_hide (gtk_ui_manager_get_widget (window->priv->manager,
-			 "/MenuBar"));
+	gtk_widget_hide (window->priv->menubar);
 	
 	g_signal_handlers_block_by_func (window->priv->toolbar,
 					 toolbar_visibility_changed,
@@ -4504,7 +4525,7 @@ _gedit_window_unfullscreen (GeditWindow *window)
 					      hide_notebook_tabs_on_fullscreen,
 					      window);
 	gtk_notebook_set_show_tabs (GTK_NOTEBOOK (window->priv->notebook), TRUE);
-	gtk_widget_show (gtk_ui_manager_get_widget (window->priv->manager, "/MenuBar"));
+	gtk_widget_show (window->priv->menubar);
 	
 	action = gtk_action_group_get_action (window->priv->always_sensitive_action_group,
 					      "ViewToolbar");
@@ -4632,3 +4653,8 @@ gedit_window_get_tab_from_uri (GeditWindow *window,
 	return tab;
 }
 
+GtkWidget *
+_gedit_window_get_menu_bar (GeditWindow *window)
+{
+	return window->priv->menubar;
+}
\ No newline at end of file
diff --git a/gedit/gedit-window.h b/gedit/gedit-window.h
index e8c7eef..4b30cf8 100644
--- a/gedit/gedit-window.h
+++ b/gedit/gedit-window.h
@@ -190,6 +190,8 @@ void		 _gedit_recent_add			(GeditWindow	     *window,
 void		 _gedit_recent_remove			(GeditWindow         *window,
 							 const gchar         *uri);
 
+GtkWidget 	*_gedit_window_get_menu_bar		(GeditWindow         *window);
+
 G_END_DECLS
 
 #endif  /* __GEDIT_WINDOW_H__  */
diff --git a/gedit/gedit.c b/gedit/gedit.c
index 03a1705..f07d45d 100644
--- a/gedit/gedit.c
+++ b/gedit/gedit.c
@@ -71,6 +71,11 @@
 #undef SAVE_DATADIR
 #endif
 
+#ifdef OS_OSX
+#include <ige-mac-dock.h>
+#include "osx/gedit-osx.h"
+#endif
+
 static guint32 startup_timestamp = 0;
 
 #ifndef G_OS_WIN32
@@ -548,6 +553,9 @@ main (int argc, char *argv[])
 	gchar *dir;
 	gchar *icon_dir;
 
+	/* Init type system as soon as possible */
+	g_type_init ();
+
 	/* Init glib threads asap */
 	g_thread_init (NULL);
 
@@ -725,7 +733,11 @@ main (int argc, char *argv[])
 		free_command_line_data ();
 	}
 
-	gedit_debug_message (DEBUG_APP, "Start gtk-main");		
+	gedit_debug_message (DEBUG_APP, "Start gtk-main");
+	
+#ifdef OS_OSX
+	gedit_osx_init(gedit_app_get_default ());
+#endif
 	gtk_main();
 
 #ifndef G_OS_WIN32
diff --git a/gedit/osx/Makefile.am b/gedit/osx/Makefile.am
new file mode 100644
index 0000000..4d73416
--- /dev/null
+++ b/gedit/osx/Makefile.am
@@ -0,0 +1,23 @@
+INCLUDES = 							\
+	-I$(top_srcdir)						\
+	-I$(top_builddir)					\
+	-I$(top_srcdir)/gedit 					\
+	-I$(top_builddir)/gedit					\
+	$(GEDIT_CFLAGS) 					\
+	$(IGE_MAC_CFLAGS)					\
+	$(WARN_CFLAGS)						\
+	$(DISABLE_DEPRECATED_CFLAGS)
+
+noinst_LTLIBRARIES = libosx.la
+
+libosx_la_LDFLAGS = -framework Carbon -framework ApplicationServices -framework Cocoa
+libosx_la_LIBADD = -lobjc
+libosx_la_CFLAGS = -xobjective-c
+
+libosx_la_SOURCES = 		\
+	gedit-osx.c 		\
+	gedit-osx.h		\
+	gedit-osx-delegate.m 	\
+	gedit-osx-delegate.h
+
+-include $(top_srcdir)/git.mk
diff --git a/gedit/osx/gedit-osx-delegate.h b/gedit/osx/gedit-osx-delegate.h
new file mode 100644
index 0000000..0b4411e
--- /dev/null
+++ b/gedit/osx/gedit-osx-delegate.h
@@ -0,0 +1,16 @@
+#ifndef GEDIT_OSX_DELEGATE_H_
+#define GEDIT_OSX_DELEGATE_H_
+
+#import <Foundation/NSAppleEventManager.h>
+
+ interface GeditOSXDelegate : NSObject
+{
+}
+
+-(id) init;
+-(void) openFiles:(NSAppleEventDescriptor*)event
+        withReply:(NSAppleEventDescriptor*)reply;
+
+ end
+
+#endif /* GEDIT_OSX_DELEGATE_H_ */
diff --git a/gedit/osx/gedit-osx-delegate.m b/gedit/osx/gedit-osx-delegate.m
new file mode 100644
index 0000000..f7a90f2
--- /dev/null
+++ b/gedit/osx/gedit-osx-delegate.m
@@ -0,0 +1,83 @@
+#import "gedit-osx-delegate.h"
+#import <Foundation/NSAppleEventManager.h>
+#import <Foundation/NSAppleEventDescriptor.h>
+#import <Foundation/NSData.h>
+#include <glib.h>
+#include <gedit/gedit-app.h>
+
+ implementation GeditOSXDelegate
+-(id)init
+{
+	if ((self = [super init]))
+	{
+		NSAppleEventManager* em = [NSAppleEventManager sharedAppleEventManager];
+
+	    [em setEventHandler:self
+	            andSelector:@selector(openFiles:withReply:)
+	          forEventClass:kCoreEventClass
+	             andEventID:kAEOpenDocuments];
+	}
+	
+	return self;
+}
+
+static GeditWindow *
+get_window(NSAppleEventDescriptor *event)
+{
+	GeditApp *app = gedit_app_get_default ();
+	return gedit_app_get_active_window (app);
+}
+
+- (void)openFiles:(NSAppleEventDescriptor*)event
+        withReply:(NSAppleEventDescriptor*)reply
+{
+	NSAppleEventDescriptor *fileList = [event paramDescriptorForKeyword:keyDirectObject];
+	NSInteger i;
+	GSList *uris = NULL;
+	
+	if (!fileList)
+	{
+		return;
+	}
+	
+	for (i = 1; i <= [fileList numberOfItems]; ++i)
+	{
+		NSAppleEventDescriptor *fileAliasDesc = [fileList descriptorAtIndex:i];
+		NSAppleEventDescriptor *fileURLDesc;
+		NSData *fileURLData;
+		gchar *url;
+		
+		if (!fileAliasDesc)
+		{
+			continue;
+		}
+		
+		fileURLDesc = [fileAliasDesc coerceToDescriptorType:typeFileURL];
+		
+		if (!fileURLDesc)
+		{
+			continue;
+		}
+		
+		fileURLData = [fileURLDesc data];
+		
+		if (!fileURLData)
+		{
+			continue;
+		}
+		
+		url = g_strndup([fileURLData bytes], [fileURLData length]);
+		uris = g_slist_prepend (uris, url);
+	}
+	
+	if (uris != NULL)
+	{
+		GeditWindow *window = get_window (event);
+		gedit_commands_load_uris (window, uris, NULL, 0);
+
+		g_slist_foreach (uris, (GFunc)g_free, NULL);
+		g_slist_free (uris);
+	}
+}
+
+ end
\ No newline at end of file
diff --git a/gedit/osx/gedit-osx.c b/gedit/osx/gedit-osx.c
new file mode 100644
index 0000000..9f150e2
--- /dev/null
+++ b/gedit/osx/gedit-osx.c
@@ -0,0 +1,94 @@
+#include "gedit-osx.h"
+#include <gdk/gdkquartz.h>
+#include <Carbon/Carbon.h>
+
+#import "gedit-osx-delegate.h"
+
+void
+gedit_osx_set_window_title (GeditWindow   *window, 
+			    gchar const   *title,
+			    GeditDocument *document)
+{
+	NSWindow *native;
+
+	g_return_if_fail (GEDIT_IS_WINDOW (window));
+
+	if (GTK_WIDGET (window)->window == NULL)
+	{
+		return;
+	}
+
+	native = gdk_quartz_window_get_nswindow (GTK_WIDGET (window)->window);
+
+	if (document)
+	{
+		bool ismodified;
+
+		if (gedit_document_is_untitled (document))
+		{
+			[native setRepresentedURL:nil];
+		}
+		else
+		{
+			const gchar *uri = gedit_document_get_uri (document);
+			NSURL *nsurl = [NSURL URLWithString:[NSString stringWithUTF8String:uri]];
+			
+			[native setRepresentedURL:nsurl];
+		}
+
+		ismodified = !gedit_document_is_untouched (document); 
+		[native setDocumentEdited:ismodified];
+	}
+	else
+	{
+		[native setRepresentedURL:nil];
+		[native setDocumentEdited:false];
+	}
+
+	gtk_window_set_title (GTK_WINDOW (window), title);
+}
+
+gboolean
+gedit_osx_show_url (const gchar *url)
+{
+ 	return [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithUTF8String:url]]];
+}
+
+gboolean
+gedit_osx_show_help (const gchar *link_id)
+{
+	gchar *link;
+	gboolean ret;
+
+	if (link_id)
+	{
+		link = g_strdup_printf ("http://library.gnome.org/users/gedit/stable/%s";,
+					link_id);
+	}
+	else
+	{
+		link = g_strdup ("http://library.gnome.org/users/gedit/stable/";);
+	}
+
+	ret = gedit_osx_show_url (link);
+	g_free (link);
+
+	return ret;
+}
+
+static void
+destroy_delegate (GeditOSXDelegate *delegate)
+{
+	[delegate dealloc];
+}
+
+void
+gedit_osx_init(GeditApp *app)
+{
+	GeditOSXDelegate *delegate = [[GeditOSXDelegate alloc] init];
+	
+	g_object_set_data_full (G_OBJECT (app),
+	                        "GeditOSXDelegate",
+	                        delegate,
+							(GDestroyNotify)destroy_delegate);
+}
\ No newline at end of file
diff --git a/gedit/osx/gedit-osx.h b/gedit/osx/gedit-osx.h
new file mode 100644
index 0000000..82f0120
--- /dev/null
+++ b/gedit/osx/gedit-osx.h
@@ -0,0 +1,17 @@
+#ifndef __GEDIT_OSX_H__
+#define __GEDIT_OSX_H__
+
+#include <gtk/gtk.h>
+#include <gedit/gedit-window.h>
+#include <gedit/gedit-app.h>
+
+void	gedit_osx_init (GeditApp *app);
+
+void 	gedit_osx_set_window_title 	(GeditWindow   *window, 
+					 gchar const   *title,
+					 GeditDocument *document);
+
+gboolean gedit_osx_show_url 		(const gchar *url);
+gboolean gedit_osx_show_help		(const gchar *link_id);
+
+#endif /* __GEDIT_OSX_H__ */
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
diff --git a/osx/Info.plist b/osx/Info.plist
new file mode 100644
index 0000000..e926859
--- /dev/null
+++ b/osx/Info.plist
@@ -0,0 +1,260 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>English</string>
+	<key>CFBundleExecutable</key>
+	<string>gedit</string>
+	<key>CFBundleGetInfoString</key>
+	<string>2.26.2 Copyright 2009, gedit</string>
+	<key>CFBundleIconFile</key>
+	<string>gedit.icns</string>
+	<key>CFBundleIdentifier</key>
+	<string>org.gnome.gedit</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+	<key>CFBundleShortVersionString</key>
+	<string>2.26.2</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleVersion</key>
+	<string>2.26.2</string>
+	<key>NSHumanReadableCopyright</key>
+	<string>Copyright 2009 gedit, GNU General Public License.</string>
+	<key>LSMinimumSystemVersion</key>
+	<string>10.4</string>
+	<key>CFBundleDocumentTypes</key>
+	<array>
+		<dict>
+			<key>CFBundleTypeExtensions</key>
+			<array>
+				<string>*</string>
+				<string>F</string>
+				<string>F90</string>
+				<string>Filemaker</string>
+				<string>M</string>
+				<string>act3</string>
+				<string>ada</string>
+				<string>applescript</string>
+				<string>as</string>
+				<string>asm</string>
+				<string>asp</string>
+				<string>awk</string>
+				<string>bak</string>
+				<string>bash</string>
+				<string>b</string>
+				<string>bf</string>
+				<string>brainfuck</string>
+				<string>c</string>
+				<string>cgi</string>
+				<string>c++</string>
+				<string>cfm</string>
+				<string>cob</string>
+				<string>conf</string>
+				<string>cp</string>
+				<string>cpp</string>
+				<string>cs</string>
+				<string>csh</string>
+				<string>css</string>
+				<string>CSS</string>
+				<string>csv</string>
+				<string>custom</string>
+				<string>cxx</string>
+				<string>def</string>
+				<string>default</string>
+				<string>do</string>
+				<string>dtd</string>
+				<string>dxf</string>
+				<string>enc</string>
+				<string>eps</string>
+				<string>err</string>
+				<string>f</string>
+				<string>f90</string>
+				<string>fcgi</string>
+				<string>for</string>
+				<string>fs</string>
+				<string>fscript</string>
+				<string>gcc</string>
+				<string>h</string>
+				<string>hpgl</string>
+				<string>htm</string>
+				<string>HTM</string>
+				<string>html</string>
+				<string>ics</string>
+				<string>idl</string>
+				<string>inc</string>
+				<string>ini</string>
+				<string>java</string>
+				<string>javascript</string>
+				<string>js</string>
+				<string>las</string>
+				<string>lasso</string>
+				<string>latex</string>
+				<string>lgt</string>
+				<string>lisp</string>
+				<string>log</string>
+				<string>ltx</string>
+				<string>lua</string>
+				<string>m</string>
+				<string>m1s</string>
+				<string>mel</string>
+				<string>m4</string>
+				<string>mk</string>
+				<string>mm</string>
+				<string>msl</string>
+				<string>mtl</string>
+				<string>mws</string>
+				<string>mx</string>
+				<string>mxo</string>
+				<string>mysql</string>
+				<string>njs</string>
+				<string>p</string>
+				<string>ps</string>
+				<string>pas</string>
+				<string>pch</string>
+				<string>php</string>
+				<string>php3</string>
+				<string>php4</string>
+				<string>phtml</string>
+				<string>pl</string>
+				<string>plist</string>
+				<string>pm</string>
+				<string>pod</string>
+				<string>postgresql</string>
+				<string>pike</string>
+				<string>pp</string>
+				<string>pro</string>
+				<string>py</string>
+				<string>python</string>
+				<string>pyw</string>
+				<string>r</string>
+				<string>rb</string>
+				<string>rc</string>
+				<string>reb</string>
+				<string>rebol</string>
+				<string>rsp</string>
+				<string>rtf</string>
+				<string>ruby</string>
+				<string>rxp</string>
+				<string>s</string>
+				<string>sgml</string>
+				<string>sh</string>
+				<string>shtm</string>
+				<string>shtml</string>
+				<string>sieve</string>
+				<string>sl</string>
+				<string>strings</string>
+				<string>sty</string>
+				<string>sps</string>
+				<string>spss</string>
+				<string>sql</string>
+				<string>SQL</string>
+				<string>st</string>
+				<string>svg</string>
+				<string>tab</string>
+				<string>tcl</string>
+				<string>tcsh</string>
+				<string>tex</string>
+				<string>text</string>
+				<string>txt</string>
+				<string>types</string>
+				<string>uue</string>
+				<string>v</string>
+				<string>vbs</string>
+				<string>vcard</string>
+				<string>vcs</string>
+				<string>verilog</string>
+				<string>vhd</string>
+				<string>vhdl</string>
+				<string>vrm</string>
+				<string>vrml</string>
+				<string>wmk</string>
+				<string>x</string>
+				<string>xhtml</string>
+				<string>xml</string>
+				<string>xsl</string>
+				<string>xslt</string>
+				<string>yaml</string>
+			</array>
+			<key>CFBundleTypeIconFile</key>
+			<string>geditdoc</string>
+			<key>CFBundleTypeMIMETypes</key>
+			<array>
+				<string>application/base64</string>
+				<string>application/dxf</string>
+				<string>application/php</string>
+				<string>application/plain</string>
+				<string>application/postscript</string>
+				<string>application/rtf</string>
+				<string>application/vnd.hp-hpgl</string>
+				<string>application/x-bsh</string>
+				<string>application/x-csh</string>
+				<string>application/x-javascript</string>
+				<string>application/x-latex</string>
+				<string>application/x-meme</string>
+				<string>application/x-pointplus</string>
+				<string>application/x-rtf</string>
+				<string>application/x-seelogo</string>
+				<string>application/x-sh</string>
+				<string>application/x-shar</string>
+				<string>application/x-tcl</string>
+				<string>application/x-tex</string>
+				<string>application/x-vrml</string>
+				<string>application/xml</string>
+				<string>image/svg+xml</string>
+				<string>image/svg-xml</string>
+				<string>image/vnd.dwg</string>
+				<string>image/x-dwg</string>
+				<string>image/x-xpixmap</string>
+				<string>model/vrml</string>
+				<string>text/asp</string>
+				<string>text/calendar</string>
+				<string>text/css</string>
+				<string>text/directory</string>
+				<string>text/html</string>
+				<string>text/javascript</string>
+				<string>text/pascal</string>
+				<string>text/php</string>
+				<string>text/plain</string>
+				<string>text/richtext</string>
+				<string>text/sgml</string>
+				<string>text/vcard</string>
+				<string>text/x-asm</string>
+				<string>text/x-c</string>
+				<string>text/x-fortran</string>
+				<string>text/x-h</string>
+				<string>text/x-java-source</string>
+				<string>text/x-m</string>
+				<string>text/x-pascal</string>
+				<string>text/x-perl-script</string>
+				<string>text/x-php-script</string>
+				<string>text/x-script.csh</string>
+				<string>text/x-script.perl-module</string>
+				<string>text/x-script.perl</string>
+				<string>text/x-script.phyton</string>
+				<string>text/x-script.sh</string>
+				<string>text/x-script.tcl</string>
+				<string>text/x-script.tcsh</string>
+				<string>text/x-server-parsed-html</string>
+				<string>text/x-sgml</string>
+				<string>text/x-uuencode</string>
+				<string>text/x-vcalendar</string>
+				<string>text/x-vcard</string>
+				<string>text/xml</string>
+				<string>x-world/x-vrml</string>
+			</array>
+			<key>CFBundleTypeName</key>
+			<string>Gedit Document</string>
+			<key>CFBundleTypeOSTypes</key>
+			<array>
+				<string>****</string>
+			</array>
+			<key>CFBundleTypeRole</key>
+			<string>Editor</string>
+		</dict>
+	</array>
+</dict>
+</plist>
diff --git a/osx/dmg-data/background.png b/osx/dmg-data/background.png
new file mode 100644
index 0000000..6d0626f
Binary files /dev/null and b/osx/dmg-data/background.png differ
diff --git a/osx/dmg-data/background.svg b/osx/dmg-data/background.svg
new file mode 100644
index 0000000..0f92752
--- /dev/null
+++ b/osx/dmg-data/background.svg
@@ -0,0 +1,395 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:xlink="http://www.w3.org/1999/xlink";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="744.09448819"
+   height="1052.3622047"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   sodipodi:docname="background.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   inkscape:export-filename="/Users/jesse/gtk/source/gedit/osx/dmg-data/background.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs4">
+    <linearGradient
+       id="linearGradient9545">
+      <stop
+         style="stop-color:#a6d1ef;stop-opacity:1;"
+         offset="0"
+         id="stop9547" />
+      <stop
+         style="stop-color:#a8c5eb;stop-opacity:0;"
+         offset="1"
+         id="stop9549" />
+    </linearGradient>
+    <marker
+       inkscape:stockid="Arrow1Send"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Send"
+       style="overflow:visible;">
+      <path
+         id="path3874"
+         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;"
+         transform="scale(0.2) rotate(180) translate(6,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="TriangleOutM"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="TriangleOutM"
+       style="overflow:visible">
+      <path
+         id="path4005"
+         d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+         transform="scale(0.4)" />
+    </marker>
+    <marker
+       inkscape:stockid="TriangleOutS"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="TriangleOutS"
+       style="overflow:visible">
+      <path
+         id="path4008"
+         d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+         transform="scale(0.2)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Mend"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Mend"
+       style="overflow:visible;">
+      <path
+         id="path3868"
+         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;"
+         transform="scale(0.4) rotate(180) translate(10,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow2Mend"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow2Mend"
+       style="overflow:visible;">
+      <path
+         id="path3886"
+         style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
+         d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
+         transform="scale(0.6) rotate(180) translate(0,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow2Lend"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow2Lend"
+       style="overflow:visible;">
+      <path
+         id="path3880"
+         style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
+         d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
+         transform="scale(1.1) rotate(180) translate(1,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lend"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Lend"
+       style="overflow:visible;">
+      <path
+         id="path3862"
+         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;"
+         transform="scale(0.8) rotate(180) translate(12.5,0)" />
+    </marker>
+    <linearGradient
+       id="linearGradient3155">
+      <stop
+         style="stop-color:#dae6fe;stop-opacity:1;"
+         offset="0"
+         id="stop3157" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop3159" />
+    </linearGradient>
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3155"
+       id="linearGradient3161"
+       x1="406.21429"
+       y1="621.43317"
+       x2="408.21429"
+       y2="321.4332"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(3,1)" />
+    <inkscape:perspective
+       id="perspective3251"
+       inkscape:persp3d-origin="571.97833 : 136.13385 : 1"
+       inkscape:vp_z="1143.9567 : 204.20078 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 204.20078 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <linearGradient
+       id="linearGradient2791">
+      <stop
+         id="stop2793"
+         offset="0"
+         style="stop-color:#555753;stop-opacity:1;" />
+      <stop
+         style="stop-color:#cccdcb;stop-opacity:1;"
+         offset="0.5"
+         id="stop2799" />
+      <stop
+         id="stop2795"
+         offset="1"
+         style="stop-color:#555753;stop-opacity:1" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient2804">
+      <stop
+         id="stop2806"
+         offset="0"
+         style="stop-color:white;stop-opacity:1" />
+      <stop
+         id="stop2808"
+         offset="1"
+         style="stop-color:#d3d7cf;stop-opacity:1" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient3415">
+      <stop
+         id="stop3417"
+         offset="0"
+         style="stop-color:black;stop-opacity:0;" />
+      <stop
+         style="stop-color:black;stop-opacity:1;"
+         offset="0.5"
+         id="stop3423" />
+      <stop
+         id="stop3419"
+         offset="1"
+         style="stop-color:black;stop-opacity:0;" />
+    </linearGradient>
+    <inkscape:perspective
+       id="perspective3591"
+       inkscape:persp3d-origin="24 : 16 : 1"
+       inkscape:vp_z="48 : 24 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 24 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient9545"
+       id="linearGradient9551"
+       x1="450"
+       y1="454.36218"
+       x2="271"
+       y2="521.36218"
+       gradientUnits="userSpaceOnUse" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1"
+     inkscape:cx="452"
+     inkscape:cy="587"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1183"
+     inkscape:window-height="674"
+     inkscape:window-x="95"
+     inkscape:window-y="197" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <rect
+       style="fill:url(#linearGradient3161);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+       id="rect2383"
+       width="499.49338"
+       height="299.49338"
+       x="132.46759"
+       y="322.68649" />
+    <g
+       id="g3254"
+       transform="matrix(0.157227,0,0,0.157227,466.1613,513.07606)"
+       style="fill:#0e3b76;fill-opacity:1">
+      <g
+         id="g15041"
+         transform="matrix(1.293235,0,0,1.293235,-4878.321,-1224.915)"
+         style="fill:#0e3b76;fill-opacity:1">
+        <g
+           id="g15043"
+           style="fill:#0e3b76;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-miterlimit:4"
+           transform="matrix(2.438586,0,0,2.438586,3659.952,1113.451)">
+          <g
+             id="g15045"
+             style="fill:#0e3b76;fill-opacity:1">
+            <path
+               id="path15047"
+               style="fill:#0e3b76;fill-opacity:1"
+               d="M 86.068,0 C 61.466,0 56.851,35.041 70.691,35.041 C 84.529,35.041 110.671,0 86.068,0 z" />
+            <path
+               id="path15049"
+               style="fill:#0e3b76;fill-opacity:1"
+               d="M 45.217,30.699 C 52.586,31.149 60.671,2.577 46.821,4.374 C 32.976,6.171 37.845,30.249 45.217,30.699 z" />
+            <path
+               id="path15051"
+               style="fill:#0e3b76;fill-opacity:1"
+               d="M 11.445,48.453 C 16.686,46.146 12.12,23.581 3.208,29.735 C -5.7,35.89 6.204,50.759 11.445,48.453 z" />
+            <path
+               id="path15053"
+               style="fill:#0e3b76;fill-opacity:1"
+               d="M 26.212,36.642 C 32.451,35.37 32.793,9.778 21.667,14.369 C 10.539,18.961 19.978,37.916 26.212,36.642 L 26.212,36.642 z" />
+            <path
+               id="path15055"
+               style="fill:#0e3b76;fill-opacity:1"
+               d="M 58.791,93.913 C 59.898,102.367 52.589,106.542 45.431,101.092 C 22.644,83.743 83.16,75.088 79.171,51.386 C 75.86,31.712 15.495,37.769 8.621,68.553 C 3.968,89.374 27.774,118.26 52.614,118.26 C 64.834,118.26 78.929,107.226 81.566,93.248 C 83.58,82.589 57.867,86.86 58.791,93.913 L 58.791,93.913 z" />
+          </g>
+        </g>
+        <g
+           id="g15057"
+           style="fill:#0e3b76;fill-opacity:1">
+          <path
+             id="path15059"
+             style="font-size:148.69964600000000132px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#0e3b76;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+             d="M 4176.2963,1214.4401 C 4161.1885,1214.847 4149.2577,1220.2768 4140.4837,1230.6901 C 4131.3976,1241.527 4126.8275,1256.5005 4126.8275,1275.5964 C 4126.8275,1294.6396 4131.3978,1309.5721 4140.4837,1320.4088 C 4149.6142,1331.2457 4162.1501,1336.6588 4178.14,1336.6588 C 4194.174,1336.6588 4206.7414,1331.2457 4215.8275,1320.4088 C 4224.9134,1309.5721 4229.4526,1294.6396 4229.4525,1275.5964 C 4229.4524,1256.5005 4224.9134,1241.527 4215.8275,1230.6901 C 4206.7414,1219.8535 4194.1739,1214.4402 4178.14,1214.4401 C 4177.5154,1214.4401 4176.9104,1214.4236 4176.2963,1214.4401 z M 4177.4213,1236.4401 C 4177.6628,1236.4334 4177.895,1236.4401 4178.14,1236.4401 C 4186.0233,1236.4402 4192.1319,1239.8515 4196.4525,1246.6901 C 4200.7728,1253.5289 4202.9524,1263.1814 4202.9525,1275.5964 C 4202.9525,1287.9587 4200.7726,1297.5391 4196.4525,1304.3776 C 4192.1321,1311.2165 4186.0232,1314.6588 4178.14,1314.6588 C 4170.3009,1314.6588 4164.2417,1311.2165 4159.9213,1304.3776 C 4155.600
 9,1297.5391 4153.4214,1287.9587 4153.4213,1275.5964 C 4153.4213,1263.1815 4155.6011,1253.5289 4159.9213,1246.6901 C 4164.1065,1240.0652 4169.9336,1236.6473 4177.4213,1236.4401 z" />
+          <path
+             id="path15061"
+             style="font-size:148.69964600000000132px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#0e3b76;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+             d="M 4005.6293,1325.612 C 3992.3217,1336.7877 3972.5226,1336.6592 3964.2744,1336.6592 C 3947.6611,1336.6592 3934.4997,1331.1882 3924.7902,1320.2462 C 3915.0805,1309.2516 3910.2258,1294.3643 3910.2258,1275.584 C 3910.2258,1256.5934 3915.1696,1241.6535 3925.0574,1230.764 C 3934.9452,1219.8748 3948.4851,1214.4301 3965.6774,1214.43 C 3972.3137,1214.4301 3978.6605,1215.1666 3984.718,1216.6394 C 3990.8199,1218.1124 3996.5655,1220.2956 4001.9548,1223.1888 L 3995.0338,1243.6496 C 3992.004,1241.991 3988.5351,1240.3564 3985.3193,1239.2072 C 3979.8409,1237.3661 3974.3403,1236.4455 3968.8175,1236.4454 C 3958.5733,1236.4455 3950.6675,1239.8386 3945.1002,1246.6246 C 3939.5772,1253.3582 3936.8158,1263.0113 3936.8158,1275.584 C 3936.8158,1288.0516 3939.4881,1297.6785 3944.833,1304.4646 C 3950.1776,1311.2507 3958.2098,1314.6437 3967.6148,1314.6437 C 3977.1696,1314.6437 3983.0876,1312.2353 3986.2439,1309.6976 L 3986.2439,1289.3141 L 3965.5438,1289.3141 L 3965.5438,1268.9557 L 400
 5.6293,1268.9557" />
+          <path
+             id="path15063"
+             style="font-size:148.69964600000000132px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#0e3b76;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+             d="M 4023.2108,1216.5605 L 4039.4387,1216.5605 L 4090.7162,1287.3627 L 4090.7162,1216.5605 L 4112.6015,1216.5605 L 4112.6015,1334.3708 L 4096.3736,1334.3708 L 4045.0962,1263.5686 L 4045.0962,1334.3708 L 4023.2108,1334.3708 L 4023.2108,1216.5605" />
+          <path
+             id="path15065"
+             style="font-size:148.69964600000000132px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#0e3b76;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+             d="M 4246.3361,1216.5605 L 4279.0727,1216.5605 L 4301.7878,1290.1084 L 4324.6365,1216.5605 L 4352.3063,1216.5605 L 4364.8063,1334.3708 L 4340.4877,1334.3708 L 4332.9877,1260.7028 L 4310.0054,1334.7241 L 4293.7039,1334.7241 L 4270.7215,1258.2028 L 4263.2215,1334.3708 L 4238.8361,1334.3708 L 4251.3361,1216.5605" />
+          <path
+             id="path15067"
+             style="font-size:148.69964600000000132px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#0e3b76;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+             d="M 4382.3597,1216.5605 L 4451.7744,1216.5605 L 4451.7744,1239.5229 L 4408.0811,1239.5229 L 4408.0811,1263.9594 L 4441.6688,1263.9594 L 4441.6688,1284.4217 L 4408.0811,1284.4217 L 4408.0811,1311.4085 L 4453.2442,1311.4085 L 4453.2442,1334.3708 L 4382.3597,1334.3708 L 4382.3597,1216.5605" />
+          <text
+             xml:space="preserve"
+             id="text15069"
+             style="font-size:30.68958854999999986px;font-style:normal;font-weight:normal;fill:#0e3b76;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+             y="1215.743"
+             x="4474.6182"><tspan
+               id="tspan15072"
+               style="letter-spacing:11.06259632000000082;fill:#0e3b76;fill-opacity:1"
+               y="1215.743"
+               x="4474.6182"><tspan
+                 id="tspan15074"
+                 style="letter-spacing:0.25238149999999998;fill:#0e3b76;fill-opacity:1">TM</tspan></tspan></text>
+        </g>
+      </g>
+    </g>
+    <g
+       id="g3798"
+       transform="translate(-17.129471,0)">
+      <text
+         id="text3790"
+         y="384.36218"
+         x="264"
+         style="font-size:40px;font-style:normal;font-weight:normal;fill:#c5c5c5;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+         xml:space="preserve"><tspan
+           style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#c5c5c5;fill-opacity:1;font-family:Sans;-inkscape-font-specification:Sans Bold"
+           y="384.36218"
+           x="264"
+           id="tspan3792"
+           sodipodi:role="line">Install gedit</tspan></text>
+      <text
+         xml:space="preserve"
+         style="font-size:40px;font-style:normal;font-weight:normal;fill:#0e3b76;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+         x="260"
+         y="382.36218"
+         id="text3794"><tspan
+           sodipodi:role="line"
+           id="tspan3796"
+           x="260"
+           y="382.36218"
+           style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#0e3b76;fill-opacity:1;font-family:Sans;-inkscape-font-specification:Sans Bold">Install gedit</tspan></text>
+    </g>
+    <text
+       xml:space="preserve"
+       style="font-size:40px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="169"
+       y="437.36218"
+       id="text9527"><tspan
+         sodipodi:role="line"
+         id="tspan9529"
+         x="169"
+         y="437.36218"
+         style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#505050;fill-opacity:1;font-family:Sans;-inkscape-font-specification:Sans">Drag this...</tspan></text>
+    <text
+       id="text9531"
+       y="527.36218"
+       x="380"
+       style="font-size:40px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       xml:space="preserve"><tspan
+         style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#505050;fill-opacity:1;font-family:Sans;-inkscape-font-specification:Sans"
+         y="527.36218"
+         x="380"
+         id="tspan9533"
+         sodipodi:role="line">... onto this</tspan></text>
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:url(#linearGradient9551);stroke-width:20;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;fill-opacity:1"
+       d="M 262,517.36218 C 262,517.36218 337,457.36218 435,457.36218"
+       id="path9535"
+       sodipodi:nodetypes="cs" />
+    <path
+       style="fill:#a6d1ef;fill-opacity:1;stroke:#4178ce;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="M 434.32487,429.73325 L 462.53555,457.94393 L 434.32487,486.15461 L 434.32487,429.73325 z"
+       id="rect9553"
+       sodipodi:nodetypes="cccc" />
+  </g>
+</svg>
diff --git a/osx/gedit.bundle b/osx/gedit.bundle
new file mode 100644
index 0000000..8004911
--- /dev/null
+++ b/osx/gedit.bundle
@@ -0,0 +1,111 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<app-bundle>
+
+  <meta>
+    <!-- Where to pick up the GTK+ installation, icon themes,
+         etc. Note that "${env:JHBUILD_PREFIX}" is evaluated to the
+         value of the environment variable JHBUILD_PREFIX. You can
+         define additional prefixes and refer to them in paths
+         throughout this file on the form "${prefix:name}". This is
+         useful for installing certain libraries or even the
+         application itself separately. Note that JHBUILD_PREFIX is
+         defined by jhbuild, so it you are not using jhbuild you can
+         either define your own or just hardcode the path here.
+    -->
+    <prefix name="default">${env:JHBUILD_PREFIX}</prefix>
+
+    <!-- The project directory is the default location of the created
+         app. If you leave out the path, the current directory is
+         used. Note the usage of an environment variable here again.
+    <destination overwrite="yes">${env:HOME}/Desktop</destination>
+    -->
+    
+    <image>
+      <!-- Not implemented yet (DMG image). -->
+    </image>
+
+    <!-- Optionally specify a launcher script to use. If the
+         application sets up everything needed itself, like
+         environment variable, linker paths, etc, a launcher script is
+         not needed. If the source path is left out, the default
+         script will be used.
+    -->
+    <launcher-script>${project}/launcher.sh</launcher-script>
+  </meta>
+
+  <!-- The special macro "${project}" refers to the directory where
+       this bundle file is located. The application name and bundle
+       identifier are taken from the plist file.
+  -->
+  <plist>${project}/Info.plist</plist>
+
+  <main-binary>${prefix}/bin/gedit</main-binary>
+
+  <!-- Copy in GTK+ modules -->
+  <binary>${prefix}/lib/gtk-2.0/${pkg:gtk+-2.0:gtk_binary_version}/loaders/*.so</binary>
+
+  <!-- Copy in GTK+ theme engines -->
+  <binary>${prefix}/lib/gtk-2.0/${pkg:gtk+-2.0:gtk_binary_version}/engines/*.so</binary>
+
+  <!-- Copy in GTK+ printer backends -->
+  <binary>${prefix}/lib/gtk-2.0/${pkg:gtk+-2.0:gtk_binary_version}/printbackends/*.so</binary>
+
+  <!-- Copy in GTK+ im modules -->
+  <binary>${prefix}/lib/gtk-2.0/${pkg:gtk+-2.0:gtk_binary_version}/immodules/*.so</binary>
+
+  <!-- Copy in plugins and plugin loaders -->
+  <binary>${prefix}/lib/gedit-2/plugin-loaders/*.so</binary>
+  <binary>${prefix}/lib/gedit-2/plugins/*.so</binary>
+
+  <!-- Python gtk binaries -->
+  <binary>${prefix}/lib/python2.5/site-packages/*.so</binary>
+  <binary>${prefix}/lib/python2.5/site-packages/cairo/*.so</binary>
+  <binary>${prefix}/lib/python2.5/site-packages/gtk-2.0/*.so</binary>
+  <binary>${prefix}/lib/python2.5/site-packages/gtk-2.0/gio/*.so</binary>
+  <binary>${prefix}/lib/python2.5/site-packages/gtk-2.0/glib/*.so</binary>
+  <binary>${prefix}/lib/python2.5/site-packages/gtk-2.0/gobject/*.so</binary>
+  <binary>${prefix}/lib/python2.5/site-packages/gtk-2.0/gtk/*.so</binary>
+
+  <!-- Python others -->
+  <data>${prefix}/lib/python2.5/site-packages</data>
+
+  <!-- gconf -->
+  <data>${prefix}/etc/gconf/2</data>
+  <data>${prefix}/etc/gconf/schemas</data>
+  <data>${prefix}/etc/gconf/*.xml</data>
+  <data>${prefix}/libexec/gconfd-2</data>
+  <data>${prefix}/libexec/gedit-2</data>
+  <data>${prefix}/lib/GConf</data>
+
+  <!-- gtksourceview -->
+  <data>${prefix}/share/gtksourceview-2.0</data>
+
+  <!-- gtkengines -->
+  <data>${prefix}/share/gtk-engines</data>
+
+  <!-- gedit -->
+  <data>${prefix}/share/gedit-2</data>
+  <data>${prefix}/lib/gedit-2</data>
+
+  <!-- locale (TODO: trim) -->
+  <data>${prefix}/share/locale</data>
+  <data>${prefix}/lib/charset.alias</data>
+
+  <!-- Themes (TODO: trim files) -->
+  <data>${prefix}/share/themes</data>
+
+  <!-- App icon -->
+  <data dest="${bundle}/Contents/Resources">${project}/gedit.icns</data>
+  <data dest="${bundle}/Contents/Resources">${project}/geditdoc.icns</data>
+
+  <!-- Custom theme settings -->
+  <data dest="${bundle}/Contents/Resources/etc/gtk-2.0/gtkrc">${project}/gtkrc</data>
+
+  <!-- Icon theme -->
+  <icon-theme icons="auto">Tango</icon-theme>
+  <data>${prefix}/share/icons/gnome/16x16/apps/system-file-manager.png</data>
+  <data>${prefix}/share/icons/gnome/22x22/apps/system-file-manager.png</data>
+  <data>${prefix}/share/icons/gnome/24x24/apps/system-file-manager.png</data>
+  <data>${prefix}/share/icons/gnome/32x32/apps/system-file-manager.png</data>
+  <data>${prefix}/share/icons/gnome/scalable/apps/system-file-manager.svg</data>
+</app-bundle>
diff --git a/osx/gedit.icns b/osx/gedit.icns
new file mode 100644
index 0000000..ccd50be
Binary files /dev/null and b/osx/gedit.icns differ
diff --git a/osx/gtkrc b/osx/gtkrc
new file mode 100644
index 0000000..bcc2542
--- /dev/null
+++ b/osx/gtkrc
@@ -0,0 +1,428 @@
+
+# Please keep this gtkrc in sync with the other ones from Clearlooks based themes.
+
+gtk-color-scheme = "base_color:#ffffff\nfg_color:#000000\ntooltip_fg_color:#000000\nselected_bg_color:#86ABD9\nselected_fg_color:#ffffff\ntext_color:#1A1A1A\nbg_color:#EDECEB\ntooltip_bg_color:#F5F5B5"
+
+gtk-icon-theme-name = "Tango"
+
+gtk-toolbar-style = GTK_TOOLBAR_ICONS
+
+style "default" {
+	xthickness = 1
+	ythickness = 1
+
+	#######################
+	# Style Properties
+	#######################
+	GtkButton::child-displacement-x = 1
+	GtkButton::child-displacement-y = 1
+	GtkButton::default-border = { 0, 0, 0, 0 }
+
+	GtkCheckButton::indicator-size = 14
+
+	GtkPaned::handle-size = 6
+
+	GtkRange::trough-border = 0
+	GtkRange::slider-width = 15
+	GtkRange::stepper-size = 15
+
+	GtkScale::slider-length = 23
+	GtkScale::trough-side-details = 1
+
+	GtkScrollbar::min-slider-length = 30
+	GtkMenuBar::internal-padding = 0
+	GtkExpander::expander-size = 16
+	GtkToolbar::internal-padding = 1
+	GtkTreeView::expander-size = 14
+	GtkTreeView::vertical-separator = 0
+
+	GtkMenu::horizontal-padding = 0
+	GtkMenu::vertical-padding = 0
+
+	WnckTasklist::fade-overlay-rect = 0
+	# The following line hints to gecko (and possibly other appliations)
+	# that the entry should be drawn transparently on the canvas.
+	# Without this, gecko will fill in the background of the entry.
+	GtkEntry::honors-transparent-bg-hint = 1
+
+	GtkEntry::progress-border = { 2, 2, 2, 2 }
+
+	####################
+	# Color Definitions
+	####################
+	bg[NORMAL]        = @bg_color
+	bg[PRELIGHT]      = shade (1.02, @bg_color)
+	bg[SELECTED]      = @selected_bg_color
+	bg[INSENSITIVE]   = @bg_color
+	bg[ACTIVE]        = shade (0.9, @bg_color)
+
+	fg[NORMAL]        = @fg_color
+	fg[PRELIGHT]      = @fg_color
+	fg[SELECTED]      = @selected_fg_color
+	fg[INSENSITIVE]   = darker (@bg_color)
+	fg[ACTIVE]        = @fg_color
+
+	text[NORMAL]      = @text_color
+	text[PRELIGHT]    = @text_color
+	text[SELECTED]    = @selected_fg_color
+	text[INSENSITIVE] = darker (@bg_color)
+	text[ACTIVE]      = @selected_fg_color
+
+	base[NORMAL]      = @base_color
+	base[PRELIGHT]    = shade (0.95, @bg_color)
+	base[SELECTED]    = @selected_bg_color
+	base[INSENSITIVE] = @bg_color
+	base[ACTIVE]      = shade (0.9, @selected_bg_color)
+
+	engine "clearlooks" {
+		colorize_scrollbar = TRUE
+		reliefstyle = 1
+		menubarstyle = 2
+		toolbarstyle = 1
+		animation = FALSE
+		radius = 3.0
+		style = GUMMY
+
+		# Set a hint to disable backward compatibility fallbacks.
+		hint = "use-hints"
+	}
+}
+
+style "wide" {
+	xthickness = 2
+	ythickness = 2
+}
+
+style "wider" {
+	xthickness = 3
+	ythickness = 3
+}
+
+style "entry" {
+	xthickness = 3
+	ythickness = 3
+
+	bg[SELECTED] = mix (0.4, @selected_bg_color, @base_color)
+	fg[SELECTED] = @text_color
+
+	engine "clearlooks" {
+		focus_color = shade (0.65, @selected_bg_color)
+	}
+}
+
+style "spinbutton" {
+
+	engine "clearlooks" {
+		hint = "spinbutton"
+	}
+}
+
+style "scale" {
+	xthickness = 2
+	ythickness = 2
+
+	engine "clearlooks" {
+		hint = "scale"
+	}
+}
+
+style "vscale" {
+
+	engine "clearlooks" {
+		hint = "vscale"
+	}
+}
+
+style "hscale" {
+
+	engine "clearlooks" {
+		hint = "hscale"
+	}
+}
+
+style "scrollbar" {
+	xthickness = 2
+	ythickness = 2
+
+	engine "clearlooks" {
+		hint = "scrollbar"
+	}
+}
+
+style "hscrollbar" {
+
+	engine "clearlooks" {
+		hint = "hscrollbar"
+	}
+}
+
+style "vscrollbar" {
+
+	engine "clearlooks" {
+		hint = "vscrollbar"
+	}
+}
+
+style "notebook_bg" {
+
+	bg[NORMAL]        = shade (1.02, @bg_color)
+}
+
+style "button" {
+	xthickness = 3
+	ythickness = 3
+
+	bg[NORMAL]        = shade (1.04, @bg_color)
+	bg[PRELIGHT]      = shade (1.06, @bg_color)
+	bg[ACTIVE]        = shade (0.85, @bg_color)
+}
+
+# The color is changed by the notebook_bg style, this style
+# changes the x/ythickness
+style "notebook" {
+	xthickness = 3
+	ythickness = 3
+}
+
+style "statusbar" {
+
+	engine "clearlooks" {
+		hint = "statusbar"
+	}
+}
+
+style "comboboxentry" {
+
+	engine "clearlooks" {
+		# Note:
+		# If you set the appears-as-list option on comboboxes in the theme,
+		# then you should set this hint on the combobox instead.
+		hint = "comboboxentry"
+	}
+}
+
+style "menubar" {
+
+	engine "clearlooks" {
+		hint = "menubar"
+	}
+}
+
+style "menu" {
+	xthickness = 0
+	ythickness = 0
+
+	bg[NORMAL]        = shade (1.08, @bg_color)
+
+	engine "clearlooks" {
+		radius = 0.0
+	}
+}
+
+style "menu_item" {
+	xthickness = 2
+	ythickness = 3
+
+	fg[PRELIGHT]      = @selected_fg_color
+}
+
+# This style is there to modify the separator menu items. The goals are:
+# 1. Get a specific height.
+# 2. The line should go to the edges (ie. no border at the left/right)
+style "separator_menu_item" {
+	xthickness = 1
+	ythickness = 0
+
+	GtkSeparatorMenuItem::horizontal-padding = 0
+	GtkWidget::wide-separators = 1
+	GtkWidget::separator-width = 1
+	GtkWidget::separator-height = 7
+}
+
+style "frame_title" {
+
+	fg[NORMAL]        = lighter (@fg_color)
+}
+
+style "treeview" {
+
+	engine "clearlooks" {
+		hint = "treeview"
+	}
+}
+
+# The almost useless progress bar style
+style "progressbar" {
+	xthickness = 1
+	ythickness = 1
+
+	fg[PRELIGHT]      = @selected_fg_color
+
+	engine "clearlooks" {
+		# Explicitly set the radius for the progress bars inside menu items.
+		radius = 3.0
+
+		hint = "progressbar"
+	}
+}
+
+# This style is based on the default style, so that the colors from the button
+# style are overriden again.
+style "treeview_header" = "default" {
+	xthickness = 2
+	ythickness = 1
+
+	engine "clearlooks" {
+		hint = "treeview-header"
+	}
+}
+
+style "tooltips" {
+	xthickness = 4
+	ythickness = 4
+
+	bg[NORMAL]        = @tooltip_bg_color
+	fg[NORMAL]        = @tooltip_fg_color
+}
+
+style "nautilus_location" {
+
+	bg[NORMAL]        = mix (0.60, shade (1.05, @bg_color), @selected_bg_color)
+}
+
+# Wrokaroudn style for places where the text color is used instead of the fg color.
+style "text_is_fg_color_workaround" {
+
+	text[NORMAL]      = @fg_color
+	text[PRELIGHT]    = @fg_color
+	text[SELECTED]    = @selected_fg_color
+	text[ACTIVE]      = @fg_color
+	text[INSENSITIVE] = darker (@bg_color)
+}
+
+# Workaround style for menus where the text color is used instead of the fg color.
+style "menuitem_text_is_fg_color_workaround" {
+
+	text[NORMAL]      = @fg_color
+	text[PRELIGHT]    = @selected_fg_color
+	text[SELECTED]    = @selected_fg_color
+	text[ACTIVE]      = @fg_color
+	text[INSENSITIVE] = darker (@bg_color)
+}
+
+# Workaround style for places where the fg color is used instead of the text color.
+style "fg_is_text_color_workaround" {
+
+	fg[NORMAL]        = @text_color
+	fg[PRELIGHT]      = @text_color
+	fg[SELECTED]      = @selected_fg_color
+	fg[ACTIVE]        = @selected_fg_color
+	fg[INSENSITIVE]   = darker (@bg_color)
+}
+
+# Style to set the toolbar to use a flat style. This is because the "New" button in
+# Evolution is not drawn transparent. So if there is a gradient in the background it will
+# look really wrong.
+# See http://bugzilla.gnome.org/show_bug.cgi?id=446953.
+style "evo_new_button_workaround" {
+
+	engine "clearlooks" {
+		toolbarstyle = 0
+	}
+}
+
+
+###############################################################################
+# The following part of the gtkrc applies the different styles to the widgets.
+###############################################################################
+
+# The default style is applied to every widget
+class "GtkWidget" style "default"
+
+class "GtkSeparator" style "wide"
+class "GtkFrame" style "wide"
+class "GtkCalendar" style "wide"
+class "GtkEntry" style "entry"
+
+class "GtkSpinButton" style "spinbutton"
+class "GtkScale" style "scale"
+class "GtkVScale" style "vscale"
+class "GtkHScale" style "hscale"
+class "GtkScrollbar" style "scrollbar"
+class "GtkHScrollbar" style "hscrollbar"
+class "GtkVScrollbar" style "vscrollbar"
+
+# General matching follows. The order is choosen so that the right styles override
+# each other. EG. progressbar needs to be more important than the menu match.
+widget_class "*<GtkNotebook>" style "notebook_bg"
+# This is not perfect, it could be done better.
+# (That is modify *every* widget in the notebook, and change those back that
+# we really don't want changed)
+widget_class "*<GtkNotebook>*<GtkEventBox>" style "notebook_bg"
+widget_class "*<GtkNotebook>*<GtkDrawingArea>" style "notebook_bg"
+widget_class "*<GtkNotebook>*<GtkLayout>" style "notebook_bg"
+widget_class "*<GtkNotebook>*<GtkViewport>" style "notebook_bg"
+widget_class "*<GtkNotebook>*<GtkScrolledWindow>" style "notebook_bg"
+
+widget_class "*<GtkButton>" style "button"
+widget_class "*<GtkNotebook>" style "notebook"
+widget_class "*<GtkStatusbar>*" style "statusbar"
+
+widget_class "*<GtkComboBoxEntry>*" style "comboboxentry"
+widget_class "*<GtkCombo>*" style "comboboxentry"
+
+widget_class "*<GtkMenuBar>*" style "menubar"
+widget_class "*<GtkMenu>*" style "menu"
+widget_class "*<GtkMenuItem>*" style "menu_item"
+widget_class "*<GtkSeparatorMenuItem>*" style "separator_menu_item"
+
+widget_class "*.<GtkFrame>.<GtkLabel>" style "frame_title"
+widget_class "*.<GtkTreeView>*" style "treeview"
+
+widget_class "*<GtkProgress>" style "progressbar"
+
+# Treeview headers (and similar stock GTK+ widgets)
+widget_class "*.<GtkTreeView>.<GtkButton>" style "treeview_header"
+widget_class "*.<GtkCTree>.<GtkButton>" style "treeview_header"
+widget_class "*.<GtkList>.<GtkButton>" style "treeview_header"
+widget_class "*.<GtkCList>.<GtkButton>" style "treeview_header"
+
+# The window of the tooltip is called "gtk-tooltip"
+##################################################################
+# FIXME:
+# This will not work if one embeds eg. a button into the tooltip.
+# As far as I can tell right now we will need to rework the theme
+# quite a bit to get this working correctly.
+# (It will involve setting different priorities, etc.)
+##################################################################
+widget "gtk-tooltip*" style "tooltips"
+
+##########################################################################
+# Following are special cases and workarounds for issues in applications.
+##########################################################################
+
+# Workaround for the evolution ETable (bug #527532)
+widget_class "*.ETable.ECanvas" style "treeview_header"
+# Workaround for the evolution ETree
+widget_class "*.ETree.ECanvas" style "treeview_header"
+
+# Special case the nautilus-extra-view-widget
+# ToDo: A more generic approach for all applications that have a widget like this.
+widget "*.nautilus-extra-view-widget" style : highest "nautilus_location"
+
+# Work around for http://bugzilla.gnome.org/show_bug.cgi?id=382646
+# Note that this work around assumes that the combobox is _not_ in appears-as-list mode.
+widget_class "*.<GtkComboBox>.<GtkCellView>" style "text_is_fg_color_workaround"
+# This is the part of the workaround that fixes the menus
+widget "*.gtk-combobox-popup-menu.*" style "menuitem_text_is_fg_color_workaround"
+
+# Work around the usage of GtkLabel inside GtkListItems to display text.
+# This breaks because the label is shown on a background that is based on the base color.
+widget_class "*<GtkListItem>*" style "fg_is_text_color_workaround"
+# GtkCList also uses the fg color to draw text on top of the base colors.
+widget_class "*<GtkCList>" style "fg_is_text_color_workaround"
+# Nautilus when renaming files, and maybe other places.
+widget_class "*<EelEditableLabel>" style "fg_is_text_color_workaround"
+
+# See the documentation of the style.
+widget_class "EShellWindow.GtkVBox.BonoboDock.BonoboDockBand.BonoboDockItem*" style "evo_new_button_workaround"
diff --git a/osx/launcher.sh b/osx/launcher.sh
new file mode 100755
index 0000000..b2ca694
--- /dev/null
+++ b/osx/launcher.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+if test "x$IGE_DEBUG_LAUNCHER" != x; then
+    set -x
+fi
+
+if test "x$IGE_DEBUG_GDB" != x; then
+    EXEC="gdb --args"
+else
+    EXEC=exec
+fi
+
+name=$(basename "$0")
+bundle=$(cd $(dirname "$0")/../../ && pwd)
+bundle_contents="$bundle"/Contents
+bundle_res="$bundle_contents"/Resources
+bundle_lib="$bundle_res"/lib
+bundle_bin="$bundle_res"/bin
+bundle_data="$bundle_res"/share
+bundle_etc="$bundle_res"/etc
+
+export DYLD_LIBRARY_PATH="$bundle_lib:$DYLD_LIBRARY_PATH"
+export XDG_CONFIG_DIRS="$bundle_etc/xdg:$XDG_CONFIG_DIRS"
+export XDG_DATA_DIRS="$bundle_data:$XDG_DATA_DIRS"
+export GTK_DATA_PREFIX="$bundle_res"
+export GTK_EXE_PREFIX="$bundle_res"
+export GTK_PATH="$bundle_res"
+export GCONF_PREFIX="$bundle_res"
+
+export GTK2_RC_FILES="$bundle_etc/gtk-2.0/gtkrc"
+export GTK_IM_MODULE_FILE="$bundle_etc/gtk-2.0/gtk.immodules"
+export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-2.0/gdk-pixbuf.loaders"
+export PANGO_RC_FILE="$bundle_etc/pango/pangorc"
+
+# Python path
+export PYTHONPATH="$bundle_lib/python2.5/site-packages:$bundle_lib/python2.5/site-packages/gtk-2.0:$PYTHONPATH"
+
+if test -f "$bundle_lib/charset.alias"; then
+    export CHARSETALIASDIR="$bundle_lib"
+fi
+
+# Extra arguments can be added in environment.sh.
+EXTRA_ARGS=
+if test -f "$bundle_res/environment.sh"; then
+  source "$bundle_res/environment.sh"
+fi
+
+# Strip out the argument added by the OS.
+if [ x`echo "x$1" | sed -e "s/^x-psn_.*//"` == x ]; then
+    shift 1
+fi
+
+# Start gconf first
+$bundle_res/libexec/gconfd-2 &
+
+$EXEC "$bundle_contents/MacOS/$name-bin" $* $EXTRA_ARGS
diff --git a/osx/makebundle.sh b/osx/makebundle.sh
new file mode 100755
index 0000000..493c336
--- /dev/null
+++ b/osx/makebundle.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+if [ -d gedit.app ] && [ "$1x" = "-fx" ]; then
+	rm -rf gedit.app
+fi
+
+ige-mac-bundler gedit.bundle
+
+# Strip debug symbols
+find gedit.app/Contents/Resources | grep -E '\.(so|dylib)' | xargs strip -S
+find gedit.app/Contents/Resources/bin | xargs strip -S
+strip -S gedit.app/Contents/MacOS/gedit-bin
\ No newline at end of file
diff --git a/osx/makedmg.sh b/osx/makedmg.sh
new file mode 100755
index 0000000..d8ecb23
--- /dev/null
+++ b/osx/makedmg.sh
@@ -0,0 +1,64 @@
+#!/bin/bash
+
+# Copied and modified from Banshee
+
+pushd $(dirname $0) &>/dev/null
+
+echo "Generating bundle..."
+./makebundle.sh -f
+
+VOLUME_NAME=gedit
+
+if [ "$1x" = "x" ]; then
+	DMG_FILE=$VOLUME_NAME.dmg
+else
+	DMG_FILE=$1.dmg
+fi
+
+DMG_APP=gedit.app
+MOUNT_POINT=$VOLUME_NAME.mounted
+
+rm -f $DMG_FILE
+rm -f $DMG_FILE.master
+
+# Compute an approximated image size in MB, and bloat by 10 MB
+image_size=$(du -ck $DMG_APP dmg-data | tail -n1 | cut -f1)
+image_size=$((($image_size + 10000) / 1000))
+
+echo "Creating disk image (${image_size}MB)..."
+#hdiutil create $DMG_FILE -megabytes $image_size -volname $VOLUME_NAME -fs HFS+ -quiet || exit $?
+cp template.dmg tmp.dmg
+hdiutil resize -size ${image_size}m tmp.dmg
+
+echo "Attaching to disk image..."
+hdiutil attach tmp.dmg -readwrite -noautoopen -mountpoint $MOUNT_POINT -quiet
+
+echo "Populating image..."
+cp -r $DMG_APP $MOUNT_POINT
+
+echo "Detaching from disk image..."
+hdiutil detach $MOUNT_POINT -quiet
+
+rm -rf $DMG_APP
+
+#mv $DMG_FILE $DMG_FILE.master
+
+#echo "Creating distributable image..."
+#hdiutil convert -quiet -format UDBZ -o $DMG_FILE $DMG_FILE.master
+
+#echo "Installing end user license agreement..."
+#hdiutil flatten -quiet $DMG_FILE
+#/Developer/Tools/Rez /Developer/Headers/FlatCarbon/*.r dmg-data/license.r -a -o $DMG_FILE
+#hdiutil unflatten -quiet $DMG_FILE
+
+echo "Converting to final image..."
+hdiutil convert -quiet -format UDBZ -o $DMG_FILE tmp.dmg
+rm tmp.dmg
+
+echo "Done."
+
+#if [ ! "x$1" = "x-m" ]; then
+#	rm $DMG_FILE.master
+#fi
+
+popd &>/dev/null
diff --git a/osx/template.dmg b/osx/template.dmg
new file mode 100644
index 0000000..b71c47d
Binary files /dev/null and b/osx/template.dmg differ
diff --git a/plugins/checkupdate/gedit-check-update-plugin.c b/plugins/checkupdate/gedit-check-update-plugin.c
index 6171c6f..e8669bb 100644
--- a/plugins/checkupdate/gedit-check-update-plugin.c
+++ b/plugins/checkupdate/gedit-check-update-plugin.c
@@ -37,7 +37,7 @@
 
 #define VERSION_PLACE "<a href=\"[0-9]\\.[0-9]+/\">"
 
-#ifndef G_OS_WIN32
+#ifdef G_OS_WIN32
 #define GEDIT_URL "http://ftp.acc.umu.se/pub/gnome/binaries/win32/gedit/";
 #define FILE_REGEX "gedit\\-setup\\-[0-9]+\\.[0-9]+\\.[0-9]+(\\-[0-9]+)?\\.exe"
 #else
@@ -45,6 +45,10 @@
 #define FILE_REGEX "gedit\\-[0-9]+\\.[0-9]+\\.[0-9]+(\\-[0-9]+)?\\.dmg"
 #endif
 
+#ifdef OS_OSX
+#include "gedit/osx/gedit-osx.h"
+#endif
+
 #define GEDIT_CHECK_UPDATE_PLUGIN_GET_PRIVATE(object) \
 				(G_TYPE_INSTANCE_GET_PRIVATE ((object),	\
 				GEDIT_TYPE_CHECK_UPDATE_PLUGIN,		\
@@ -175,12 +179,15 @@ on_response_cb (GtkWidget   *infobar,
 		gchar *url;
 		
 		url = g_object_get_data (G_OBJECT (window), WINDOW_DATA_KEY);
-	
+
+#ifdef OS_OSX
+		gedit_osx_show_url (url);
+#else
 		gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (window)),
 			      url, 
 			      GDK_CURRENT_TIME,
 			      &error);
-
+#endif
 		if (error != NULL)
 		{
 			GtkWidget *dialog;
@@ -211,9 +218,11 @@ on_response_cb (GtkWidget   *infobar,
 }
 
 static GtkWidget *
-create_infobar (GeditWindow *window)
+create_infobar (GeditWindow *window,
+                const gchar *version)
 {
 	GtkWidget *infobar;
+	gchar *message;
 
 #if !GTK_CHECK_VERSION (2, 17, 1)
 	infobar = gedit_message_area_new ();
@@ -245,12 +254,15 @@ create_infobar (GeditWindow *window)
 				       GTK_MESSAGE_INFO);
 #endif
 
+	message = g_strdup_printf ("%s (%s)", _("There is a new version of gedit"), version);
 	set_message_area_text_and_icon (infobar,
 					"gtk-dialog-info",
-					_("There is a new version of gedit"),
+					message,
 					_("You can download the new version of gedit"
 					  " by pressing on the download button"));
 
+	g_free (message);
+
 	g_signal_connect (infobar, "response",
 			  G_CALLBACK (on_response_cb),
 			  window);
@@ -402,7 +414,7 @@ parse_page_file (SoupSession *session,
 						file_url,
 						g_free);
 		
-			infobar = create_infobar (window);
+			infobar = create_infobar (window, file_version);
 			pack_infobar (GTK_WIDGET (window), infobar);
 			gtk_widget_show (infobar);
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]