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.
This commit is contained in:
Emmanuele Bassi 2015-07-20 13:00:12 +01:00
parent c2e63cf16b
commit 9d40fafa2a
3 changed files with 28 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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
*/