[clutter] Do not generate backend-specific enumeration types



commit 9d40fafa2a62db1a7bab5d339a0211b5cbce962e
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Jul 20 13:00:12 2015 +0100

    Do not generate backend-specific enumeration types
    
    They should be part of the backend-specific API.
    
    The only backend that has an enumeration type is the X11 one, and it's
    small, so we can simply put it there.
    
    This is not an ABI change: the backend-specific symbols are still in
    the same SO. You'll be required to import clutter-x11.h to have access
    to the GType method at the source level, whereas before just importing
    clutter.h would have sufficed. The only user of that enumeration was a
    function declared in clutter-x11.h, anyway.

 clutter/Makefile.am               |    2 +-
 clutter/x11/clutter-backend-x11.c |   25 ++++++++++++++++++++++++-
 clutter/x11/clutter-x11.h         |    3 +++
 3 files changed, 28 insertions(+), 2 deletions(-)
---
diff --git a/clutter/Makefile.am b/clutter/Makefile.am
index 775b456..de06cac 100644
--- a/clutter/Makefile.am
+++ b/clutter/Makefile.am
@@ -827,7 +827,7 @@ include $(top_srcdir)/build/autotools/Makefile.am.marshal
 # glib-mkenums rules
 glib_enum_h = clutter-enum-types.h
 glib_enum_c = clutter-enum-types.c
-glib_enum_headers = $(source_h) $(deprecated_h) $(backend_source_h)
+glib_enum_headers = $(source_h) $(deprecated_h)
 include $(top_srcdir)/build/autotools/Makefile.am.enums
 
 pkgconfigdir = $(libdir)/pkgconfig
diff --git a/clutter/x11/clutter-backend-x11.c b/clutter/x11/clutter-backend-x11.c
index 243c73e..c8a13e7 100644
--- a/clutter/x11/clutter-backend-x11.c
+++ b/clutter/x11/clutter-backend-x11.c
@@ -67,7 +67,30 @@
 
 #define clutter_backend_x11_get_type    _clutter_backend_x11_get_type
 
-G_DEFINE_TYPE (ClutterBackendX11, clutter_backend_x11, CLUTTER_TYPE_BACKEND);
+G_DEFINE_TYPE (ClutterBackendX11, clutter_backend_x11, CLUTTER_TYPE_BACKEND)
+
+GType
+clutter_x11_filter_return_get_type (void)
+{
+  static volatile gsize g_define_type__volatile;
+
+  if (g_once_init_enter (&g_define_type__volatile))
+    {
+      static const GEnumValue values[] = {
+        { CLUTTER_X11_FILTER_CONTINUE, "CLUTTER_X11_FILTER_CONTINUE", "continue" },
+        { CLUTTER_X11_FILTER_TRANSLATE, "CLUTTER_X11_FILTER_TRANSLATE", "translate" },
+        { CLUTTER_X11_FILTER_REMOVE, "CLUTTER_X11_FILTER_REMOVE", "remove" },
+        { 0, NULL, NULL },
+      };
+
+      GType g_define_type =
+        g_enum_register_static (g_intern_static_string ("ClutterX11FilterReturn"), values);
+
+      g_once_init_leave (&g_define_type__volatile, g_define_type);
+    }
+
+  return g_define_type__volatile;
+}
 
 /* atoms; remember to add the code that assigns the atom value to
  * the member of the ClutterBackendX11 structure if you add an
diff --git a/clutter/x11/clutter-x11.h b/clutter/x11/clutter-x11.h
index ecba1db..96e6f84 100644
--- a/clutter/x11/clutter-x11.h
+++ b/clutter/x11/clutter-x11.h
@@ -64,6 +64,9 @@ typedef enum {
   CLUTTER_X11_FILTER_REMOVE
 } ClutterX11FilterReturn;
 
+CLUTTER_AVAILABLE_IN_ALL
+GType clutter_x11_filter_return_get_type (void) G_GNUC_CONST;
+
 /*
  * This is an internal only enumeration; it should really be private
  */


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