[Mac][clutter-gtk]Make it support osx backend
- From: cee1 <fykcee1 gmail com>
- To: clutter-list gnome org
- Subject: [Mac][clutter-gtk]Make it support osx backend
- Date: Mon, 2 Dec 2013 16:19:47 +0800
Hi all,
I'm trying to add some code to make clutter-gtk support osx
backend[1][2], but there's on clutter_osx_disable_event_retrieval in
clutter, I'm planning to implement it as win32 backend did -- set a
variable and check it in _clutter_backend_osx_events_init:
if (!_no_event_retrieval)
_clutter_osx_event_loop_init ();
Does the above make sense?
----
[1] The gdk backend doesn't work -- "Unable to initialize Clutter:
Could not find a suitable CoglWinsys for a GdkDisplay of type
GdkQuartzDisplay"
[2] Changes to make it support osx backend:
diff --git a/clutter-gtk/Makefile.am b/clutter-gtk/Makefile.am
index 9a35919..363e0ec 100644
--- a/clutter-gtk/Makefile.am
+++ b/clutter-gtk/Makefile.am
@@ -15,6 +15,7 @@ AM_CPPFLAGS = \
-DCLUTTER_GTK_COMPILATION \
$(CLUTTER_GTK_DEPRECATED_CFLAGS) \
$(CLUTTER_GTK_DEBUG_CFLAGS) \
+ "-xobjective-c" \
$(NULL)
AM_CFLAGS = $(MAINTAINER_CFLAGS) $(CLUTTER_GTK_DEPS_CFLAGS)
diff --git a/clutter-gtk/gtk-clutter-util.c b/clutter-gtk/gtk-clutter-util.c
index d4a9fa5..e4fe061 100644
--- a/clutter-gtk/gtk-clutter-util.c
+++ b/clutter-gtk/gtk-clutter-util.c
@@ -23,6 +23,10 @@
#include <clutter/win32/clutter-win32.h>
#endif
+#if defined(CLUTTER_WINDOWING_OSX)
+#include <clutter/osx/clutter-osx.h>
+#endif
+
#if defined(GDK_WINDOWING_X11)
#include <gdk/gdkx.h>
#endif
@@ -31,6 +35,10 @@
#include <gdk/gdkwin32.h>
#endif
+#if defined(GDK_WINDOWING_QUARTZ)
+#include <gdk/gdkquartz.h>
+#endif
+
/**
* SECTION:gtk-clutter-util
* @Title: Utility Functions
@@ -96,6 +104,14 @@ post_parse_hook (GOptionContext *context,
}
else
#endif
+#if defined(GDK_WINDOWING_QUARTZ) && defined(CLUTTER_WINDOWING_OSX)
+ if (clutter_check_windowing_backend (CLUTTER_WINDOWING_OSX) &&
+ GDK_IS_QUARTZ_DISPLAY (display))
+ {
+ /* let GTK+ be in charge of the event handling */
+ }
+ else
+#endif
g_error ("*** Unsupported backend.");
/* this is required since parsing clutter's option group did not
--
Regards,
- cee1
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]