diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2015-07-20 13:00:12 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2015-07-20 13:00:12 +0100 |
commit | 9d40fafa2a62db1a7bab5d339a0211b5cbce962e (patch) | |
tree | 23f300428bdaecbca7eade7413b82ad5b9aa537a /clutter | |
parent | c2e63cf16b41f5cec8b742eb1fd56deed1789a41 (diff) | |
download | clutter-9d40fafa2a62db1a7bab5d339a0211b5cbce962e.tar.gz |
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.
Diffstat (limited to 'clutter')
-rw-r--r-- | clutter/Makefile.am | 2 | ||||
-rw-r--r-- | clutter/x11/clutter-backend-x11.c | 25 | ||||
-rw-r--r-- | clutter/x11/clutter-x11.h | 3 |
3 files changed, 28 insertions, 2 deletions
diff --git a/clutter/Makefile.am b/clutter/Makefile.am index 775b456c6..de06cac1d 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 243c73eab..c8a13e739 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 ecba1dba4..96e6f84f4 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 */ |