diff --git a/m4/moo-flags.m4 b/m4/moo-flags.m4 index d77825ad..11b01b9f 100644 --- a/m4/moo-flags.m4 +++ b/m4/moo-flags.m4 @@ -44,6 +44,12 @@ AC_DEFUN_ONCE([MOO_AC_FLAGS],[ ]) AC_MSG_RESULT([$_moo_ac_have_carbon]) + if "$GDK_QUARTZ"; then + PKG_CHECK_MODULES(IGE_MAC,ige-mac-integration) + GTK_CFLAGS="$IGE_MAC_CFLAGS" + GTK_LIBS="$IGE_MAC_LIBS" + fi + AC_CHECK_LIB(Xrender, XRenderFindFormat,[ AC_SUBST(RENDER_LIBS, "-lXrender -lXext") AC_DEFINE(HAVE_RENDER, 1, [Define if libXrender is available.]) diff --git a/moo/mooapp/mooapp.c b/moo/mooapp/mooapp.c index 66f8b69c..ef482680 100644 --- a/moo/mooapp/mooapp.c +++ b/moo/mooapp/mooapp.c @@ -42,6 +42,10 @@ #include #include +#ifdef GDK_WINDOWING_QUARTZ +#include +#endif + #ifdef HAVE_SIGNAL_H #include #endif @@ -98,6 +102,10 @@ struct _MooAppPrivate { guint quit_handler_id; gboolean use_editor; gboolean quit_on_editor_close; + +#ifdef GDK_WINDOWING_QUARTZ + IgeMacDock *dock; +#endif }; @@ -867,6 +875,47 @@ moo_app_init_ui (MooApp *app) } +#ifdef GDK_WINDOWING_QUARTZ + +static void +dock_open_documents (MooApp *app, + char **files) +{ + moo_app_open_files (app, files, 0, 0, 0); +} + +static void +dock_clicked (G_GNUC_UNUSED MooApp *app) +{ + /* XXX */ + g_print ("dock_clicked\n"); +} + +static void +dock_quit_activate (MooApp *app) +{ + moo_app_quit (app); +} + +static void +moo_app_init_mac (MooApp *app) +{ + app->priv->dock = ige_mac_dock_get_default (); + g_signal_connect_swapped (app->priv->dock, "clicked", + G_CALLBACK (dock_clicked), app); + g_signal_connect_swapped (app->priv->dock, "open-documents", + G_CALLBACK (dock_open_documents), app); + g_signal_connect_swapped (app->priv->dock, "quit-activate", + G_CALLBACK (dock_quit_activate), app); +} + +#else /* !GDK_WINDOWING_QUARTZ */ +static void +moo_app_init_mac (G_GNUC_UNUSED MooApp *app) +{ +} +#endif + static gboolean moo_app_init_real (MooApp *app) { @@ -877,6 +926,7 @@ moo_app_init_real (MooApp *app) moo_app_load_prefs (app); moo_app_init_ui (app); + moo_app_init_mac (app); #ifdef MOO_BUILD_EDIT if (app->priv->use_editor)