summaryrefslogtreecommitdiff
path: root/gio/gloadableicon.c
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2009-12-01 10:42:58 +0100
committerAlexander Larsson <alexl@redhat.com>2009-12-01 10:44:42 +0100
commit39cd766e8ef6901c097fdf2d3148fdc952f06b0e (patch)
tree34dade0099ac7219c2ba16dc9d06a8234dbe31f6 /gio/gloadableicon.c
parent91d96350a7eed2e2acfc0c254b6dfc4e6fe81a8b (diff)
downloadglib-39cd766e8ef6901c097fdf2d3148fdc952f06b0e.tar.gz
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.
Diffstat (limited to 'gio/gloadableicon.c')
-rw-r--r--gio/gloadableicon.c45
1 files changed, 3 insertions, 42 deletions
diff --git a/gio/gloadableicon.c b/gio/gloadableicon.c
index b5ba6f568..9221d353c 100644
--- a/gio/gloadableicon.c
+++ b/gio/gloadableicon.c
@@ -48,56 +48,17 @@ static GInputStream *g_loadable_icon_real_load_finish (GLoadableIcon *ico
GAsyncResult *res,
char **type,
GError **error);
-static void g_loadable_icon_base_init (gpointer g_class);
-static void g_loadable_icon_class_init (gpointer g_class,
- gpointer class_data);
-GType
-g_loadable_icon_get_type (void)
-{
- static volatile gsize g_define_type_id__volatile = 0;
-
- if (g_once_init_enter (&g_define_type_id__volatile))
- {
- const GTypeInfo loadable_icon_info =
- {
- sizeof (GLoadableIconIface), /* class_size */
- g_loadable_icon_base_init, /* base_init */
- NULL, /* base_finalize */
- g_loadable_icon_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_("GLoadableIcon"),
- &loadable_icon_info, 0);
-
- g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_ICON);
-
- g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
- }
-
- return g_define_type_id__volatile;
-}
+typedef GLoadableIconIface GLoadableIconInterface;
+G_DEFINE_INTERFACE(GLoadableIcon, g_loadable_icon, G_TYPE_ICON)
static void
-g_loadable_icon_class_init (gpointer g_class,
- gpointer class_data)
+g_loadable_icon_default_init (GLoadableIconIface *iface)
{
- GLoadableIconIface *iface = g_class;
-
iface->load_async = g_loadable_icon_real_load_async;
iface->load_finish = g_loadable_icon_real_load_finish;
}
-static void
-g_loadable_icon_base_init (gpointer g_class)
-{
-}
-
/**
* g_loadable_icon_load:
* @icon: a #GLoadableIcon.