mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-27 01:26:52 +02:00
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:
parent
91d96350a7
commit
39cd766e8e
@ -86,50 +86,11 @@
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void g_app_info_base_init (gpointer g_class);
|
typedef GAppInfoIface GAppInfoInterface;
|
||||||
static void g_app_info_class_init (gpointer g_class,
|
G_DEFINE_INTERFACE (GAppInfo, g_app_info, G_TYPE_OBJECT)
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
g_app_info_class_init (gpointer g_class,
|
g_app_info_default_init (GAppInfoInterface *iface)
|
||||||
gpointer class_data)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
g_app_info_base_init (gpointer g_class)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,49 +108,11 @@
|
|||||||
* truly need asynchronous operations, make sure to initialize #GThread.
|
* truly need asynchronous operations, make sure to initialize #GThread.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void g_async_result_base_init (gpointer g_class);
|
typedef GAsyncResultIface GAsyncResultInterface;
|
||||||
static void g_async_result_class_init (gpointer g_class,
|
G_DEFINE_INTERFACE (GAsyncResult, g_async_result, G_TYPE_OBJECT)
|
||||||
gpointer class_data);
|
|
||||||
|
|
||||||
GType
|
|
||||||
g_async_result_get_type (void)
|
|
||||||
{
|
|
||||||
static volatile gsize g_define_type_id__volatile = 0;
|
|
||||||
|
|
||||||
if (g_once_init_enter (&g_define_type_id__volatile))
|
|
||||||
{
|
|
||||||
const GTypeInfo async_result_info =
|
|
||||||
{
|
|
||||||
sizeof (GAsyncResultIface), /* class_size */
|
|
||||||
g_async_result_base_init, /* base_init */
|
|
||||||
NULL, /* base_finalize */
|
|
||||||
g_async_result_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_("GAsyncResult"),
|
|
||||||
&async_result_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;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
g_async_result_class_init (gpointer g_class,
|
g_async_result_default_init (GAsyncResultInterface *iface)
|
||||||
gpointer class_data)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
g_async_result_base_init (gpointer g_class)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2639,49 +2639,11 @@ get_all_desktop_entries_for_mime_type (const char *base_mime_type,
|
|||||||
|
|
||||||
/* GDesktopAppInfoLookup interface: */
|
/* GDesktopAppInfoLookup interface: */
|
||||||
|
|
||||||
static void g_desktop_app_info_lookup_base_init (gpointer g_class);
|
typedef GDesktopAppInfoLookupIface GDesktopAppInfoLookupInterface;
|
||||||
static void g_desktop_app_info_lookup_class_init (gpointer g_class,
|
G_DEFINE_INTERFACE (GDesktopAppInfoLookup, g_desktop_app_info_lookup, G_TYPE_OBJECT)
|
||||||
gpointer class_data);
|
|
||||||
|
|
||||||
GType
|
|
||||||
g_desktop_app_info_lookup_get_type (void)
|
|
||||||
{
|
|
||||||
static volatile gsize g_define_type_id__volatile = 0;
|
|
||||||
|
|
||||||
if (g_once_init_enter (&g_define_type_id__volatile))
|
|
||||||
{
|
|
||||||
const GTypeInfo desktop_app_info_lookup_info =
|
|
||||||
{
|
|
||||||
sizeof (GDesktopAppInfoLookupIface), /* class_size */
|
|
||||||
g_desktop_app_info_lookup_base_init, /* base_init */
|
|
||||||
NULL, /* base_finalize */
|
|
||||||
g_desktop_app_info_lookup_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_("GDesktopAppInfoLookup"),
|
|
||||||
&desktop_app_info_lookup_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;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
g_desktop_app_info_lookup_class_init (gpointer g_class,
|
g_desktop_app_info_lookup_default_init (GDesktopAppInfoLookupInterface *iface)
|
||||||
gpointer class_data)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
g_desktop_app_info_lookup_base_init (gpointer g_class)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
51
gio/gdrive.c
51
gio/gdrive.c
@ -63,53 +63,11 @@
|
|||||||
* #GDrive in that API.
|
* #GDrive in that API.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void g_drive_base_init (gpointer g_class);
|
typedef GDriveIface GDriveInterface;
|
||||||
static void g_drive_class_init (gpointer g_class,
|
G_DEFINE_INTERFACE(GDrive, g_drive, G_TYPE_OBJECT)
|
||||||
gpointer class_data);
|
|
||||||
|
|
||||||
GType
|
|
||||||
g_drive_get_type (void)
|
|
||||||
{
|
|
||||||
static volatile gsize g_define_type_id__volatile = 0;
|
|
||||||
|
|
||||||
if (g_once_init_enter (&g_define_type_id__volatile))
|
|
||||||
{
|
|
||||||
const GTypeInfo drive_info =
|
|
||||||
{
|
|
||||||
sizeof (GDriveIface), /* class_size */
|
|
||||||
g_drive_base_init, /* base_init */
|
|
||||||
NULL, /* base_finalize */
|
|
||||||
g_drive_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_("GDrive"),
|
|
||||||
&drive_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;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
g_drive_class_init (gpointer g_class,
|
g_drive_default_init (GDriveInterface *iface)
|
||||||
gpointer class_data)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
g_drive_base_init (gpointer g_class)
|
|
||||||
{
|
|
||||||
static gboolean initialized = FALSE;
|
|
||||||
|
|
||||||
if (! initialized)
|
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* GDrive::changed:
|
* GDrive::changed:
|
||||||
@ -173,9 +131,6 @@ g_drive_base_init (gpointer g_class)
|
|||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
g_cclosure_marshal_VOID__VOID,
|
g_cclosure_marshal_VOID__VOID,
|
||||||
G_TYPE_NONE, 0);
|
G_TYPE_NONE, 0);
|
||||||
|
|
||||||
initialized = TRUE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
46
gio/gfile.c
46
gio/gfile.c
@ -121,10 +121,6 @@
|
|||||||
* </para>
|
* </para>
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void g_file_base_init (gpointer g_class);
|
|
||||||
static void g_file_class_init (gpointer g_class,
|
|
||||||
gpointer class_data);
|
|
||||||
|
|
||||||
static void g_file_real_query_info_async (GFile *file,
|
static void g_file_real_query_info_async (GFile *file,
|
||||||
const char *attributes,
|
const char *attributes,
|
||||||
GFileQueryInfoFlags flags,
|
GFileQueryInfoFlags flags,
|
||||||
@ -265,43 +261,12 @@ static gboolean g_file_real_copy_finish (GFile
|
|||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
GType
|
typedef GFileIface GFileInterface;
|
||||||
g_file_get_type (void)
|
G_DEFINE_INTERFACE (GFile, g_file, G_TYPE_OBJECT)
|
||||||
{
|
|
||||||
static volatile gsize g_define_type_id__volatile = 0;
|
|
||||||
|
|
||||||
if (g_once_init_enter (&g_define_type_id__volatile))
|
|
||||||
{
|
|
||||||
const GTypeInfo file_info =
|
|
||||||
{
|
|
||||||
sizeof (GFileIface), /* class_size */
|
|
||||||
g_file_base_init, /* base_init */
|
|
||||||
NULL, /* base_finalize */
|
|
||||||
g_file_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_("GFile"),
|
|
||||||
&file_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;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
g_file_class_init (gpointer g_class,
|
g_file_default_init (GFileIface *iface)
|
||||||
gpointer class_data)
|
|
||||||
{
|
{
|
||||||
GFileIface *iface = g_class;
|
|
||||||
|
|
||||||
iface->enumerate_children_async = g_file_real_enumerate_children_async;
|
iface->enumerate_children_async = g_file_real_enumerate_children_async;
|
||||||
iface->enumerate_children_finish = g_file_real_enumerate_children_finish;
|
iface->enumerate_children_finish = g_file_real_enumerate_children_finish;
|
||||||
iface->set_display_name_async = g_file_real_set_display_name_async;
|
iface->set_display_name_async = g_file_real_set_display_name_async;
|
||||||
@ -333,11 +298,6 @@ g_file_class_init (gpointer g_class,
|
|||||||
iface->copy_finish = g_file_real_copy_finish;
|
iface->copy_finish = g_file_real_copy_finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
g_file_base_init (gpointer g_class)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* g_file_is_native:
|
* g_file_is_native:
|
||||||
|
44
gio/gicon.c
44
gio/gicon.c
@ -63,49 +63,11 @@
|
|||||||
* with the type system prior to calling g_icon_new_for_string().
|
* with the type system prior to calling g_icon_new_for_string().
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void g_icon_base_init (gpointer g_class);
|
typedef GIconIface GIconInterface;
|
||||||
static void g_icon_class_init (gpointer g_class,
|
G_DEFINE_INTERFACE(GIcon, g_icon, G_TYPE_OBJECT)
|
||||||
gpointer class_data);
|
|
||||||
|
|
||||||
GType
|
|
||||||
g_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 icon_info =
|
|
||||||
{
|
|
||||||
sizeof (GIconIface), /* class_size */
|
|
||||||
g_icon_base_init, /* base_init */
|
|
||||||
NULL, /* base_finalize */
|
|
||||||
g_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_("GIcon"),
|
|
||||||
&icon_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;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
g_icon_class_init (gpointer g_class,
|
g_icon_default_init (GIconInterface *iface)
|
||||||
gpointer class_data)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
g_icon_base_init (gpointer g_class)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,56 +48,17 @@ static GInputStream *g_loadable_icon_real_load_finish (GLoadableIcon *ico
|
|||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
char **type,
|
char **type,
|
||||||
GError **error);
|
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
|
typedef GLoadableIconIface GLoadableIconInterface;
|
||||||
g_loadable_icon_get_type (void)
|
G_DEFINE_INTERFACE(GLoadableIcon, g_loadable_icon, G_TYPE_ICON)
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
g_loadable_icon_class_init (gpointer g_class,
|
g_loadable_icon_default_init (GLoadableIconIface *iface)
|
||||||
gpointer class_data)
|
|
||||||
{
|
{
|
||||||
GLoadableIconIface *iface = g_class;
|
|
||||||
|
|
||||||
iface->load_async = g_loadable_icon_real_load_async;
|
iface->load_async = g_loadable_icon_real_load_async;
|
||||||
iface->load_finish = g_loadable_icon_real_load_finish;
|
iface->load_finish = g_loadable_icon_real_load_finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
g_loadable_icon_base_init (gpointer g_class)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* g_loadable_icon_load:
|
* g_loadable_icon_load:
|
||||||
* @icon: a #GLoadableIcon.
|
* @icon: a #GLoadableIcon.
|
||||||
|
51
gio/gmount.c
51
gio/gmount.c
@ -63,53 +63,11 @@
|
|||||||
* is called, then it will be filled with any error information.
|
* is called, then it will be filled with any error information.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
static void g_mount_base_init (gpointer g_class);
|
typedef GMountIface GMountInterface;
|
||||||
static void g_mount_class_init (gpointer g_class,
|
G_DEFINE_INTERFACE (GMount, g_mount, G_TYPE_OBJECT)
|
||||||
gpointer class_data);
|
|
||||||
|
|
||||||
GType
|
|
||||||
g_mount_get_type (void)
|
|
||||||
{
|
|
||||||
static volatile gsize g_define_type_id__volatile = 0;
|
|
||||||
|
|
||||||
if (g_once_init_enter (&g_define_type_id__volatile))
|
|
||||||
{
|
|
||||||
const GTypeInfo mount_info =
|
|
||||||
{
|
|
||||||
sizeof (GMountIface), /* class_size */
|
|
||||||
g_mount_base_init, /* base_init */
|
|
||||||
NULL, /* base_finalize */
|
|
||||||
g_mount_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_("GMount"),
|
|
||||||
&mount_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;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
g_mount_class_init (gpointer g_class,
|
g_mount_default_init (GMountInterface *iface)
|
||||||
gpointer class_data)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
g_mount_base_init (gpointer g_class)
|
|
||||||
{
|
|
||||||
static gboolean initialized = FALSE;
|
|
||||||
|
|
||||||
if (! initialized)
|
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* GMount::changed:
|
* GMount::changed:
|
||||||
@ -157,9 +115,6 @@ g_mount_base_init (gpointer g_class)
|
|||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
g_cclosure_marshal_VOID__VOID,
|
g_cclosure_marshal_VOID__VOID,
|
||||||
G_TYPE_NONE, 0);
|
G_TYPE_NONE, 0);
|
||||||
|
|
||||||
initialized = TRUE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,43 +37,11 @@
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
typedef GSeekableIface GSeekableInterface;
|
||||||
static void g_seekable_base_init (gpointer g_class);
|
G_DEFINE_INTERFACE (GSeekable, g_seekable, G_TYPE_OBJECT)
|
||||||
|
|
||||||
|
|
||||||
GType
|
|
||||||
g_seekable_get_type (void)
|
|
||||||
{
|
|
||||||
static volatile gsize g_define_type_id__volatile = 0;
|
|
||||||
|
|
||||||
if (g_once_init_enter (&g_define_type_id__volatile))
|
|
||||||
{
|
|
||||||
const GTypeInfo seekable_info =
|
|
||||||
{
|
|
||||||
sizeof (GSeekableIface), /* class_size */
|
|
||||||
g_seekable_base_init, /* base_init */
|
|
||||||
NULL, /* base_finalize */
|
|
||||||
NULL,
|
|
||||||
NULL, /* class_finalize */
|
|
||||||
NULL, /* class_data */
|
|
||||||
0,
|
|
||||||
0, /* n_preallocs */
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
GType g_define_type_id =
|
|
||||||
g_type_register_static (G_TYPE_INTERFACE, I_("GSeekable"),
|
|
||||||
&seekable_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;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
g_seekable_base_init (gpointer g_class)
|
g_seekable_default_init (GSeekableInterface *iface)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,53 +79,11 @@
|
|||||||
* libhal_manger_find_device_string_match().
|
* libhal_manger_find_device_string_match().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void g_volume_base_init (gpointer g_class);
|
typedef GVolumeIface GVolumeInterface;
|
||||||
static void g_volume_class_init (gpointer g_class,
|
G_DEFINE_INTERFACE(GVolume, g_volume, G_TYPE_OBJECT)
|
||||||
gpointer class_data);
|
|
||||||
|
|
||||||
GType
|
|
||||||
g_volume_get_type (void)
|
|
||||||
{
|
|
||||||
static volatile gsize g_define_type_id__volatile = 0;
|
|
||||||
|
|
||||||
if (g_once_init_enter (&g_define_type_id__volatile))
|
|
||||||
{
|
|
||||||
const GTypeInfo volume_info =
|
|
||||||
{
|
|
||||||
sizeof (GVolumeIface), /* class_size */
|
|
||||||
g_volume_base_init, /* base_init */
|
|
||||||
NULL, /* base_finalize */
|
|
||||||
g_volume_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_("GVolume"),
|
|
||||||
&volume_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;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
g_volume_class_init (gpointer g_class,
|
g_volume_default_init (GVolumeInterface *iface)
|
||||||
gpointer class_data)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
g_volume_base_init (gpointer g_class)
|
|
||||||
{
|
|
||||||
static gboolean initialized = FALSE;
|
|
||||||
|
|
||||||
if (! initialized)
|
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* GVolume::changed:
|
* GVolume::changed:
|
||||||
@ -154,9 +112,6 @@ g_volume_base_init (gpointer g_class)
|
|||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
g_cclosure_marshal_VOID__VOID,
|
g_cclosure_marshal_VOID__VOID,
|
||||||
G_TYPE_NONE, 0);
|
G_TYPE_NONE, 0);
|
||||||
|
|
||||||
initialized = TRUE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user