Use G_DEFINE_INTERFACE in gio

Note: Since we export types with Iface in the name rather than
Interface we have to use some typedefs to make this work. New
interfaces should probably use Interface as the public name.
This commit is contained in:
Dan Winship
2009-12-01 10:42:58 +01:00
committed by Alexander Larsson
parent 91d96350a7
commit 39cd766e8e
10 changed files with 160 additions and 559 deletions

View File

@@ -86,50 +86,11 @@
*
**/
static void g_app_info_base_init (gpointer g_class);
static void g_app_info_class_init (gpointer g_class,
gpointer class_data);
GType
g_app_info_get_type (void)
{
static volatile gsize g_define_type_id__volatile = 0;
if (g_once_init_enter (&g_define_type_id__volatile))
{
const GTypeInfo app_info_info =
{
sizeof (GAppInfoIface), /* class_size */
g_app_info_base_init, /* base_init */
NULL, /* base_finalize */
g_app_info_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
0,
0, /* n_preallocs */
NULL
};
GType g_define_type_id =
g_type_register_static (G_TYPE_INTERFACE, I_("GAppInfo"),
&app_info_info, 0);
g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_OBJECT);
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
return g_define_type_id__volatile;
}
typedef GAppInfoIface GAppInfoInterface;
G_DEFINE_INTERFACE (GAppInfo, g_app_info, G_TYPE_OBJECT)
static void
g_app_info_class_init (gpointer g_class,
gpointer class_data)
{
}
static void
g_app_info_base_init (gpointer g_class)
g_app_info_default_init (GAppInfoInterface *iface)
{
}