mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 15:06:14 +01:00
Drop trailing semi-colon from G_DEFINE_ macro
It's unnecessary, and only adds visual noise; we have been fairly inconsistent in the past, but the semi-colon-less version clearly dominates in the code base. https://bugzilla.gnome.org/show_bug.cgi?id=669355
This commit is contained in:
parent
fb7d2184a6
commit
f952fdf3fc
@ -715,7 +715,7 @@ viewer_file_editable_interface_init (ViewerEditableInterface *iface)
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (ViewerFile, viewer_file, VIEWER_TYPE_FILE,
|
||||
G_IMPLEMENT_INTERFACE (VIEWER_TYPE_EDITABLE,
|
||||
viewer_file_editable_interface_init));
|
||||
viewer_file_editable_interface_init))
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
|
||||
@ -836,7 +836,7 @@ struct _GInterfaceInfo
|
||||
<link linkend="G-DEFINE-INTERFACE:CAPS">G_DEFINE_INTERFACE</link>
|
||||
which can be used to define the interface:
|
||||
<informalexample><programlisting>
|
||||
G_DEFINE_INTERFACE (ViewerEditable, viewer_editable, G_TYPE_OBJECT);
|
||||
G_DEFINE_INTERFACE (ViewerEditable, viewer_editable, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
viewer_editable_default_init (ViewerEditableInterface *iface)
|
||||
|
@ -938,7 +938,7 @@ G_END_DECLS
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
<informalexample><programlisting>
|
||||
G_DEFINE_INTERFACE (ViewerEditable, viewer_editable, G_TYPE_OBJECT);
|
||||
G_DEFINE_INTERFACE (ViewerEditable, viewer_editable, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
viewer_editable_default_init (ViewerEditableInterface *iface)
|
||||
@ -1091,7 +1091,7 @@ viewer_file_init (ViewerFile *self)
|
||||
the GObject equivalent:
|
||||
<informalexample><programlisting>
|
||||
/* Make the ViewerEditableLossy interface require ViewerEditable interface. */
|
||||
G_DEFINE_INTERFACE (ViewerEditableLossy, viewer_editable_lossy, VIEWER_TYPE_EDITABLE);
|
||||
G_DEFINE_INTERFACE (ViewerEditableLossy, viewer_editable_lossy, VIEWER_TYPE_EDITABLE)
|
||||
</programlisting></informalexample>
|
||||
In the <function><link linkend="G-DEFINE-INTERFACE:CAPS">G_DEFINE_INTERFACE</link></function>
|
||||
call above, the third parameter defines the prerequisite type. This
|
||||
|
@ -113,7 +113,7 @@ struct _GCredentialsClass
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GCredentials, g_credentials, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (GCredentials, g_credentials, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
g_credentials_finalize (GObject *object)
|
||||
|
@ -1062,7 +1062,7 @@ class CodeGenerator:
|
||||
self.c.write('\n')
|
||||
|
||||
self.c.write('typedef %sIface %sInterface;\n'%(i.camel_name, i.camel_name))
|
||||
self.c.write('G_DEFINE_INTERFACE (%s, %s, G_TYPE_OBJECT);\n'%(i.camel_name, i.name_lower))
|
||||
self.c.write('G_DEFINE_INTERFACE (%s, %s, G_TYPE_OBJECT)\n'%(i.camel_name, i.name_lower))
|
||||
self.c.write('\n')
|
||||
|
||||
self.c.write('static void\n'
|
||||
@ -1604,10 +1604,10 @@ class CodeGenerator:
|
||||
self.c.write('#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38\n')
|
||||
self.c.write('G_DEFINE_TYPE_WITH_CODE (%sProxy, %s_proxy, G_TYPE_DBUS_PROXY,\n'%(i.camel_name, i.name_lower))
|
||||
self.c.write(' G_ADD_PRIVATE (%sProxy)\n'%(i.camel_name))
|
||||
self.c.write(' G_IMPLEMENT_INTERFACE (%sTYPE_%s, %s_proxy_iface_init));\n\n'%(i.ns_upper, i.name_upper, i.name_lower))
|
||||
self.c.write(' G_IMPLEMENT_INTERFACE (%sTYPE_%s, %s_proxy_iface_init))\n\n'%(i.ns_upper, i.name_upper, i.name_lower))
|
||||
self.c.write('#else\n')
|
||||
self.c.write('G_DEFINE_TYPE_WITH_CODE (%sProxy, %s_proxy, G_TYPE_DBUS_PROXY,\n'%(i.camel_name, i.name_lower))
|
||||
self.c.write(' G_IMPLEMENT_INTERFACE (%sTYPE_%s, %s_proxy_iface_init));\n\n'%(i.ns_upper, i.name_upper, i.name_lower))
|
||||
self.c.write(' G_IMPLEMENT_INTERFACE (%sTYPE_%s, %s_proxy_iface_init))\n\n'%(i.ns_upper, i.name_upper, i.name_lower))
|
||||
self.c.write('#endif\n')
|
||||
|
||||
# finalize
|
||||
@ -2391,10 +2391,10 @@ class CodeGenerator:
|
||||
self.c.write('#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38\n')
|
||||
self.c.write('G_DEFINE_TYPE_WITH_CODE (%sSkeleton, %s_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,\n'%(i.camel_name, i.name_lower))
|
||||
self.c.write(' G_ADD_PRIVATE (%sSkeleton)\n'%(i.camel_name))
|
||||
self.c.write(' G_IMPLEMENT_INTERFACE (%sTYPE_%s, %s_skeleton_iface_init));\n\n'%(i.ns_upper, i.name_upper, i.name_lower))
|
||||
self.c.write(' G_IMPLEMENT_INTERFACE (%sTYPE_%s, %s_skeleton_iface_init))\n\n'%(i.ns_upper, i.name_upper, i.name_lower))
|
||||
self.c.write('#else\n')
|
||||
self.c.write('G_DEFINE_TYPE_WITH_CODE (%sSkeleton, %s_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,\n'%(i.camel_name, i.name_lower))
|
||||
self.c.write(' G_IMPLEMENT_INTERFACE (%sTYPE_%s, %s_skeleton_iface_init));\n\n'%(i.ns_upper, i.name_upper, i.name_lower))
|
||||
self.c.write(' G_IMPLEMENT_INTERFACE (%sTYPE_%s, %s_skeleton_iface_init))\n\n'%(i.ns_upper, i.name_upper, i.name_lower))
|
||||
self.c.write('#endif\n')
|
||||
|
||||
# finalize
|
||||
@ -2726,7 +2726,7 @@ class CodeGenerator:
|
||||
self.c.write('\n')
|
||||
|
||||
self.c.write('typedef %sObjectIface %sObjectInterface;\n'%(self.namespace, self.namespace))
|
||||
self.c.write('G_DEFINE_INTERFACE_WITH_CODE (%sObject, %sobject, G_TYPE_OBJECT, g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_DBUS_OBJECT));\n'%(self.namespace, self.ns_lower))
|
||||
self.c.write('G_DEFINE_INTERFACE_WITH_CODE (%sObject, %sobject, G_TYPE_OBJECT, g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_DBUS_OBJECT);)\n'%(self.namespace, self.ns_lower))
|
||||
self.c.write('\n')
|
||||
self.c.write('static void\n'
|
||||
'%sobject_default_init (%sObjectIface *iface)\n'
|
||||
@ -2846,7 +2846,7 @@ class CodeGenerator:
|
||||
self.c.write('\n')
|
||||
self.c.write('G_DEFINE_TYPE_WITH_CODE (%sObjectProxy, %sobject_proxy, G_TYPE_DBUS_OBJECT_PROXY,\n'
|
||||
' G_IMPLEMENT_INTERFACE (%sTYPE_OBJECT, %sobject_proxy__%sobject_iface_init)\n'
|
||||
' G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, %sobject_proxy__g_dbus_object_iface_init));\n'
|
||||
' G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, %sobject_proxy__g_dbus_object_iface_init))\n'
|
||||
'\n'
|
||||
%(self.namespace, self.ns_lower, self.ns_upper, self.ns_lower, self.ns_lower, self.ns_lower))
|
||||
# class boilerplate
|
||||
@ -2966,7 +2966,7 @@ class CodeGenerator:
|
||||
%(self.ns_lower, self.ns_lower, self.ns_lower))
|
||||
self.c.write('G_DEFINE_TYPE_WITH_CODE (%sObjectSkeleton, %sobject_skeleton, G_TYPE_DBUS_OBJECT_SKELETON,\n'
|
||||
' G_IMPLEMENT_INTERFACE (%sTYPE_OBJECT, %sobject_skeleton__%sobject_iface_init)\n'
|
||||
' G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, %sobject_skeleton__g_dbus_object_iface_init));\n'
|
||||
' G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, %sobject_skeleton__g_dbus_object_iface_init))\n'
|
||||
'\n'
|
||||
%(self.namespace, self.ns_lower, self.ns_upper, self.ns_lower, self.ns_lower, self.ns_lower))
|
||||
# class boilerplate
|
||||
@ -3129,7 +3129,7 @@ class CodeGenerator:
|
||||
self.c.write('\n')
|
||||
|
||||
# class boilerplate
|
||||
self.c.write('G_DEFINE_TYPE (%sObjectManagerClient, %sobject_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT);\n'
|
||||
self.c.write('G_DEFINE_TYPE (%sObjectManagerClient, %sobject_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT)\n'
|
||||
'\n'
|
||||
%(self.namespace, self.ns_lower))
|
||||
|
||||
|
@ -117,7 +117,7 @@ enum
|
||||
|
||||
static guint signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
G_DEFINE_TYPE (GDBusAuthObserver, g_dbus_auth_observer, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (GDBusAuthObserver, g_dbus_auth_observer, G_TYPE_OBJECT)
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -75,7 +75,7 @@ static void g_dbus_daemon_iface_init (_GFreedesktopDBusIface *iface);
|
||||
#define g_dbus_daemon_get_type _g_dbus_daemon_get_type
|
||||
G_DEFINE_TYPE_WITH_CODE (GDBusDaemon, g_dbus_daemon, _G_TYPE_FREEDESKTOP_DBUS_SKELETON,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init)
|
||||
G_IMPLEMENT_INTERFACE (_G_TYPE_FREEDESKTOP_DBUS, g_dbus_daemon_iface_init));
|
||||
G_IMPLEMENT_INTERFACE (_G_TYPE_FREEDESKTOP_DBUS, g_dbus_daemon_iface_init))
|
||||
|
||||
typedef struct {
|
||||
GDBusDaemon *daemon;
|
||||
|
@ -46,13 +46,15 @@
|
||||
#define _MY_DEFINE_BOXED_TYPE(TypeName, type_name) \
|
||||
G_DEFINE_BOXED_TYPE (TypeName, type_name, type_name##_ref, type_name##_unref)
|
||||
|
||||
_MY_DEFINE_BOXED_TYPE (GDBusNodeInfo, g_dbus_node_info);
|
||||
_MY_DEFINE_BOXED_TYPE (GDBusInterfaceInfo, g_dbus_interface_info);
|
||||
_MY_DEFINE_BOXED_TYPE (GDBusMethodInfo, g_dbus_method_info);
|
||||
_MY_DEFINE_BOXED_TYPE (GDBusSignalInfo, g_dbus_signal_info);
|
||||
_MY_DEFINE_BOXED_TYPE (GDBusPropertyInfo, g_dbus_property_info);
|
||||
_MY_DEFINE_BOXED_TYPE (GDBusArgInfo, g_dbus_arg_info);
|
||||
_MY_DEFINE_BOXED_TYPE (GDBusAnnotationInfo, g_dbus_annotation_info);
|
||||
_MY_DEFINE_BOXED_TYPE (GDBusNodeInfo, g_dbus_node_info)
|
||||
_MY_DEFINE_BOXED_TYPE (GDBusInterfaceInfo, g_dbus_interface_info)
|
||||
_MY_DEFINE_BOXED_TYPE (GDBusMethodInfo, g_dbus_method_info)
|
||||
_MY_DEFINE_BOXED_TYPE (GDBusSignalInfo, g_dbus_signal_info)
|
||||
_MY_DEFINE_BOXED_TYPE (GDBusPropertyInfo, g_dbus_property_info)
|
||||
_MY_DEFINE_BOXED_TYPE (GDBusArgInfo, g_dbus_arg_info)
|
||||
_MY_DEFINE_BOXED_TYPE (GDBusAnnotationInfo, g_dbus_annotation_info)
|
||||
|
||||
#undef _MY_DEFINE_BOXED_TYPE
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -474,7 +474,7 @@ enum
|
||||
PROP_LOCKED
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GDBusMessage, g_dbus_message, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (GDBusMessage, g_dbus_message, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
g_dbus_message_finalize (GObject *object)
|
||||
|
@ -92,7 +92,7 @@ struct _GDBusMethodInvocation
|
||||
gpointer user_data;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GDBusMethodInvocation, g_dbus_method_invocation, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (GDBusMethodInvocation, g_dbus_method_invocation, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
g_dbus_method_invocation_finalize (GObject *object)
|
||||
|
@ -173,7 +173,7 @@ G_DEFINE_TYPE_WITH_CODE (GDBusObjectManagerClient, g_dbus_object_manager_client,
|
||||
G_ADD_PRIVATE (GDBusObjectManagerClient)
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init)
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, async_initable_iface_init)
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT_MANAGER, dbus_object_manager_interface_init));
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT_MANAGER, dbus_object_manager_interface_init))
|
||||
|
||||
static void maybe_unsubscribe_signals (GDBusObjectManagerClient *manager);
|
||||
|
||||
|
@ -154,8 +154,7 @@ static guint _signals[LAST_SIGNAL] = {0};
|
||||
static void initable_iface_init (GInitableIface *initable_iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GDBusServer, g_dbus_server, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init)
|
||||
);
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init))
|
||||
|
||||
static void
|
||||
g_dbus_server_finalize (GObject *object)
|
||||
|
@ -68,7 +68,7 @@
|
||||
* Since: 2.48
|
||||
*/
|
||||
|
||||
G_DEFINE_INTERFACE (GDtlsConnection, g_dtls_connection, G_TYPE_DATAGRAM_BASED);
|
||||
G_DEFINE_INTERFACE (GDtlsConnection, g_dtls_connection, G_TYPE_DATAGRAM_BASED)
|
||||
|
||||
enum {
|
||||
ACCEPT_CERTIFICATE,
|
||||
|
@ -61,7 +61,7 @@ G_DEFINE_TYPE_WITH_CODE (GDummyTlsBackend, g_dummy_tls_backend, G_TYPE_OBJECT,
|
||||
g_io_extension_point_implement (G_TLS_BACKEND_EXTENSION_POINT_NAME,
|
||||
g_define_type_id,
|
||||
"dummy",
|
||||
-100))
|
||||
-100);)
|
||||
|
||||
static void
|
||||
g_dummy_tls_backend_init (GDummyTlsBackend *dummy)
|
||||
@ -143,7 +143,7 @@ static void g_dummy_tls_certificate_initable_iface_init (GInitableIface *iface);
|
||||
#define g_dummy_tls_certificate_get_type _g_dummy_tls_certificate_get_type
|
||||
G_DEFINE_TYPE_WITH_CODE (GDummyTlsCertificate, g_dummy_tls_certificate, G_TYPE_TLS_CERTIFICATE,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
|
||||
g_dummy_tls_certificate_initable_iface_init);)
|
||||
g_dummy_tls_certificate_initable_iface_init))
|
||||
|
||||
static void
|
||||
g_dummy_tls_certificate_get_property (GObject *object,
|
||||
@ -242,10 +242,10 @@ static void g_dummy_tls_connection_initable_iface_init (GInitableIface *iface);
|
||||
|
||||
#define g_dummy_tls_connection_get_type _g_dummy_tls_connection_get_type
|
||||
G_DEFINE_TYPE_WITH_CODE (GDummyTlsConnection, g_dummy_tls_connection, G_TYPE_TLS_CONNECTION,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_TLS_CLIENT_CONNECTION, NULL);
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_TLS_SERVER_CONNECTION, NULL);
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_TLS_CLIENT_CONNECTION, NULL)
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_TLS_SERVER_CONNECTION, NULL)
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
|
||||
g_dummy_tls_connection_initable_iface_init);)
|
||||
g_dummy_tls_connection_initable_iface_init))
|
||||
|
||||
static void
|
||||
g_dummy_tls_connection_get_property (GObject *object,
|
||||
@ -453,9 +453,9 @@ static void g_dummy_tls_database_initable_iface_init (GInitableIface *iface);
|
||||
#define g_dummy_tls_database_get_type _g_dummy_tls_database_get_type
|
||||
G_DEFINE_TYPE_WITH_CODE (GDummyTlsDatabase, g_dummy_tls_database, G_TYPE_TLS_DATABASE,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_TLS_FILE_DATABASE,
|
||||
g_dummy_tls_database_file_database_iface_init);
|
||||
g_dummy_tls_database_file_database_iface_init)
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
|
||||
g_dummy_tls_database_initable_iface_init);)
|
||||
g_dummy_tls_database_initable_iface_init))
|
||||
|
||||
|
||||
static void
|
||||
|
@ -83,7 +83,7 @@ struct _GFileInfoClass
|
||||
};
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GFileInfo, g_file_info, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (GFileInfo, g_file_info, G_TYPE_OBJECT)
|
||||
|
||||
typedef struct {
|
||||
guint32 id;
|
||||
|
@ -68,7 +68,7 @@ struct _GFilenameCompleter {
|
||||
LoadBasenamesData *basename_loader;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GFilenameCompleter, g_filename_completer, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (GFilenameCompleter, g_filename_completer, G_TYPE_OBJECT)
|
||||
|
||||
static void cancel_load_basenames (GFilenameCompleter *completer);
|
||||
|
||||
|
@ -96,7 +96,7 @@
|
||||
*
|
||||
* |[<!-- language="C" -->
|
||||
* // Implement an extension point
|
||||
* G_DEFINE_TYPE (MyExampleImpl, my_example_impl, MY_TYPE_EXAMPLE);
|
||||
* G_DEFINE_TYPE (MyExampleImpl, my_example_impl, MY_TYPE_EXAMPLE)
|
||||
* g_io_extension_point_implement ("my-extension-point",
|
||||
* my_example_impl_get_type (),
|
||||
* "my-example",
|
||||
@ -261,7 +261,7 @@ struct _GIOExtensionPoint {
|
||||
static GHashTable *extension_points = NULL;
|
||||
G_LOCK_DEFINE_STATIC(extension_points);
|
||||
|
||||
G_DEFINE_TYPE (GIOModule, g_io_module, G_TYPE_TYPE_MODULE);
|
||||
G_DEFINE_TYPE (GIOModule, g_io_module, G_TYPE_TYPE_MODULE)
|
||||
|
||||
static void
|
||||
g_io_module_class_init (GIOModuleClass *class)
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "glistmodel.h"
|
||||
#include "glibintl.h"
|
||||
|
||||
G_DEFINE_INTERFACE (GListModel, g_list_model, G_TYPE_OBJECT);
|
||||
G_DEFINE_INTERFACE (GListModel, g_list_model, G_TYPE_OBJECT)
|
||||
|
||||
/**
|
||||
* SECTION:glistmodel
|
||||
|
@ -76,7 +76,7 @@ struct _GLocalFileEnumerator
|
||||
};
|
||||
|
||||
#define g_local_file_enumerator_get_type _g_local_file_enumerator_get_type
|
||||
G_DEFINE_TYPE (GLocalFileEnumerator, g_local_file_enumerator, G_TYPE_FILE_ENUMERATOR);
|
||||
G_DEFINE_TYPE (GLocalFileEnumerator, g_local_file_enumerator, G_TYPE_FILE_ENUMERATOR)
|
||||
|
||||
static GFileInfo *g_local_file_enumerator_next_file (GFileEnumerator *enumerator,
|
||||
GCancellable *cancellable,
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
|
||||
#define g_local_file_io_stream_get_type _g_local_file_io_stream_get_type
|
||||
G_DEFINE_TYPE (GLocalFileIOStream, g_local_file_io_stream, G_TYPE_FILE_IO_STREAM);
|
||||
G_DEFINE_TYPE (GLocalFileIOStream, g_local_file_io_stream, G_TYPE_FILE_IO_STREAM)
|
||||
|
||||
static void
|
||||
g_local_file_io_stream_finalize (GObject *object)
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "gnativevolumemonitor.h"
|
||||
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE (GNativeVolumeMonitor, g_native_volume_monitor, G_TYPE_VOLUME_MONITOR);
|
||||
G_DEFINE_ABSTRACT_TYPE (GNativeVolumeMonitor, g_native_volume_monitor, G_TYPE_VOLUME_MONITOR)
|
||||
|
||||
static void
|
||||
g_native_volume_monitor_finalize (GObject *object)
|
||||
|
@ -86,7 +86,7 @@ typedef struct
|
||||
GVariant *target;
|
||||
} Button;
|
||||
|
||||
G_DEFINE_TYPE (GNotification, g_notification, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (GNotification, g_notification, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
button_free (gpointer data)
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "gactiongroup.h"
|
||||
#include "giomodule-priv.h"
|
||||
|
||||
G_DEFINE_TYPE (GNotificationBackend, g_notification_backend, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (GNotificationBackend, g_notification_backend, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
g_notification_backend_class_init (GNotificationBackendClass *class)
|
||||
|
@ -96,7 +96,7 @@ G_DEFINE_TYPE_WITH_CODE (GResourceFile, g_resource_file, G_TYPE_OBJECT,
|
||||
g_resource_file_file_iface_init))
|
||||
|
||||
#define g_resource_file_enumerator_get_type _g_resource_file_enumerator_get_type
|
||||
G_DEFINE_TYPE (GResourceFileEnumerator, g_resource_file_enumerator, G_TYPE_FILE_ENUMERATOR);
|
||||
G_DEFINE_TYPE (GResourceFileEnumerator, g_resource_file_enumerator, G_TYPE_FILE_ENUMERATOR)
|
||||
|
||||
static GFileEnumerator *_g_resource_file_enumerator_new (GResourceFile *file,
|
||||
const char *attributes,
|
||||
@ -778,7 +778,7 @@ struct _GResourceFileInputStreamClass
|
||||
};
|
||||
|
||||
#define g_resource_file_input_stream_get_type _g_resource_file_input_stream_get_type
|
||||
G_DEFINE_TYPE (GResourceFileInputStream, g_resource_file_input_stream, G_TYPE_FILE_INPUT_STREAM);
|
||||
G_DEFINE_TYPE (GResourceFileInputStream, g_resource_file_input_stream, G_TYPE_FILE_INPUT_STREAM)
|
||||
|
||||
static gssize g_resource_file_input_stream_read (GInputStream *stream,
|
||||
void *buffer,
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "gtask.h"
|
||||
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE (GSocketAddressEnumerator, g_socket_address_enumerator, G_TYPE_OBJECT);
|
||||
G_DEFINE_ABSTRACT_TYPE (GSocketAddressEnumerator, g_socket_address_enumerator, G_TYPE_OBJECT)
|
||||
|
||||
static void g_socket_address_enumerator_real_next_async (GSocketAddressEnumerator *enumerator,
|
||||
GCancellable *cancellable,
|
||||
|
@ -54,9 +54,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE (GSocketControlMessage,
|
||||
g_socket_control_message,
|
||||
G_TYPE_OBJECT);
|
||||
G_DEFINE_ABSTRACT_TYPE (GSocketControlMessage, g_socket_control_message, G_TYPE_OBJECT)
|
||||
|
||||
/**
|
||||
* g_socket_control_message_get_size:
|
||||
|
@ -169,7 +169,7 @@ struct _GSubprocess
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GSubprocess, g_subprocess, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init));
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init))
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -54,7 +54,7 @@
|
||||
|
||||
typedef GObjectClass GSubprocessLauncherClass;
|
||||
|
||||
G_DEFINE_TYPE (GSubprocessLauncher, g_subprocess_launcher, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (GSubprocessLauncher, g_subprocess_launcher, G_TYPE_OBJECT)
|
||||
|
||||
static gboolean
|
||||
verify_disposition (const gchar *stream_name,
|
||||
|
@ -82,7 +82,7 @@
|
||||
* Since: 2.28
|
||||
*/
|
||||
|
||||
G_DEFINE_INTERFACE (GTlsBackend, g_tls_backend, G_TYPE_OBJECT);
|
||||
G_DEFINE_INTERFACE (GTlsBackend, g_tls_backend, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
g_tls_backend_default_init (GTlsBackendInterface *iface)
|
||||
|
@ -50,7 +50,7 @@
|
||||
* Since: 2.28
|
||||
*/
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE (GTlsCertificate, g_tls_certificate, G_TYPE_OBJECT);
|
||||
G_DEFINE_ABSTRACT_TYPE (GTlsCertificate, g_tls_certificate, G_TYPE_OBJECT)
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -89,7 +89,7 @@
|
||||
* Since: 2.30
|
||||
*/
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE (GTlsDatabase, g_tls_database, G_TYPE_OBJECT);
|
||||
G_DEFINE_ABSTRACT_TYPE (GTlsDatabase, g_tls_database, G_TYPE_OBJECT)
|
||||
|
||||
enum {
|
||||
UNLOCK_REQUIRED,
|
||||
|
@ -48,7 +48,7 @@ static void g_union_volume_monitor_remove_monitor (GUnionVolumeMonitor *union_mo
|
||||
|
||||
|
||||
#define g_union_volume_monitor_get_type _g_union_volume_monitor_get_type
|
||||
G_DEFINE_TYPE (GUnionVolumeMonitor, g_union_volume_monitor, G_TYPE_VOLUME_MONITOR);
|
||||
G_DEFINE_TYPE (GUnionVolumeMonitor, g_union_volume_monitor, G_TYPE_VOLUME_MONITOR)
|
||||
|
||||
static GRecMutex the_volume_monitor_mutex;
|
||||
|
||||
|
@ -1557,7 +1557,7 @@ struct _GUnixMountMonitorClass {
|
||||
};
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GUnixMountMonitor, g_unix_mount_monitor, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (GUnixMountMonitor, g_unix_mount_monitor, G_TYPE_OBJECT)
|
||||
|
||||
static GContextSpecificGroup mount_monitor_group;
|
||||
static GFileMonitor *fstab_monitor;
|
||||
|
@ -54,7 +54,7 @@ typedef struct {
|
||||
GDestroyNotify parse_name_destroy;
|
||||
} GVfsURISchemeData;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (GVfs, g_vfs, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (GVfs, g_vfs, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
g_vfs_dispose (GObject *object)
|
||||
|
@ -45,7 +45,7 @@
|
||||
* thread-default-context active.
|
||||
**/
|
||||
|
||||
G_DEFINE_TYPE (GVolumeMonitor, g_volume_monitor, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (GVolumeMonitor, g_volume_monitor, G_TYPE_OBJECT)
|
||||
|
||||
enum {
|
||||
VOLUME_ADDED,
|
||||
|
@ -35,8 +35,8 @@ typedef GFilterInputStreamClass TestFilterInputStreamClass;
|
||||
typedef GFilterOutputStream TestFilterOutputStream;
|
||||
typedef GFilterOutputStreamClass TestFilterOutputStreamClass;
|
||||
|
||||
G_DEFINE_TYPE (TestFilterInputStream, test_filter_input_stream, G_TYPE_FILTER_INPUT_STREAM);
|
||||
G_DEFINE_TYPE (TestFilterOutputStream, test_filter_output_stream, G_TYPE_FILTER_OUTPUT_STREAM);
|
||||
G_DEFINE_TYPE (TestFilterInputStream, test_filter_input_stream, G_TYPE_FILTER_INPUT_STREAM)
|
||||
G_DEFINE_TYPE (TestFilterOutputStream, test_filter_output_stream, G_TYPE_FILTER_OUTPUT_STREAM)
|
||||
|
||||
static void
|
||||
test_filter_input_stream_init (TestFilterInputStream *stream)
|
||||
|
@ -40,7 +40,7 @@ typedef struct {
|
||||
|
||||
GType my_object_get_type (void) G_GNUC_CONST;
|
||||
|
||||
G_DEFINE_TYPE (MyObject, my_object, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (MyObject, my_object, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
my_object_init (MyObject *object)
|
||||
|
@ -28,7 +28,7 @@ enum
|
||||
};
|
||||
|
||||
static GType my_object_get_type (void);
|
||||
G_DEFINE_TYPE (MyObject, my_object, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (MyObject, my_object, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
my_object_finalize (GObject *object)
|
||||
|
@ -108,7 +108,7 @@ enum
|
||||
|
||||
static guint signals[LAST_SIGNAL] = {0};
|
||||
|
||||
G_DEFINE_TYPE (AccountsUser, accounts_user, G_TYPE_DBUS_PROXY);
|
||||
G_DEFINE_TYPE (AccountsUser, accounts_user, G_TYPE_DBUS_PROXY)
|
||||
|
||||
static void
|
||||
accounts_user_finalize (GObject *object)
|
||||
|
@ -38,7 +38,7 @@ typedef struct {
|
||||
} MockInterfaceClass;
|
||||
|
||||
static GType mock_interface_get_type (void);
|
||||
G_DEFINE_TYPE (MockInterface, mock_interface, G_TYPE_DBUS_INTERFACE_SKELETON);
|
||||
G_DEFINE_TYPE (MockInterface, mock_interface, G_TYPE_DBUS_INTERFACE_SKELETON)
|
||||
|
||||
static void
|
||||
mock_interface_init (MockInterface *self)
|
||||
|
@ -170,7 +170,7 @@ typedef struct {
|
||||
typedef GMenuModelClass RandomMenuClass;
|
||||
|
||||
static GType random_menu_get_type (void);
|
||||
G_DEFINE_TYPE (RandomMenu, random_menu, G_TYPE_MENU_MODEL);
|
||||
G_DEFINE_TYPE (RandomMenu, random_menu, G_TYPE_MENU_MODEL)
|
||||
|
||||
static gboolean
|
||||
random_menu_is_mutable (GMenuModel *model)
|
||||
@ -346,7 +346,7 @@ typedef struct {
|
||||
typedef GMenuModelClass MirrorMenuClass;
|
||||
|
||||
static GType mirror_menu_get_type (void);
|
||||
G_DEFINE_TYPE (MirrorMenu, mirror_menu, G_TYPE_MENU_MODEL);
|
||||
G_DEFINE_TYPE (MirrorMenu, mirror_menu, G_TYPE_MENU_MODEL)
|
||||
|
||||
static gboolean
|
||||
mirror_menu_is_mutable (GMenuModel *model)
|
||||
|
@ -37,7 +37,7 @@ struct _GNotificationServer
|
||||
GHashTable *applications;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GNotificationServer, g_notification_server, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (GNotificationServer, g_notification_server, G_TYPE_OBJECT)
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -39,7 +39,7 @@ G_DEFINE_TYPE_WITH_CODE (GTestTlsBackend, g_test_tls_backend, G_TYPE_OBJECT,
|
||||
g_io_extension_point_implement (G_TLS_BACKEND_EXTENSION_POINT_NAME,
|
||||
g_define_type_id,
|
||||
"test",
|
||||
999))
|
||||
999);)
|
||||
|
||||
static void
|
||||
g_test_tls_backend_init (GTestTlsBackend *backend)
|
||||
@ -91,7 +91,7 @@ static void g_test_tls_certificate_initable_iface_init (GInitableIface *iface);
|
||||
#define g_test_tls_certificate_get_type _g_test_tls_certificate_get_type
|
||||
G_DEFINE_TYPE_WITH_CODE (GTestTlsCertificate, g_test_tls_certificate, G_TYPE_TLS_CERTIFICATE,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
|
||||
g_test_tls_certificate_initable_iface_init);)
|
||||
g_test_tls_certificate_initable_iface_init))
|
||||
|
||||
static GTlsCertificateFlags
|
||||
g_test_tls_certificate_verify (GTlsCertificate *cert,
|
||||
@ -242,10 +242,10 @@ static void g_test_tls_connection_initable_iface_init (GInitableIface *iface);
|
||||
|
||||
#define g_test_tls_connection_get_type _g_test_tls_connection_get_type
|
||||
G_DEFINE_TYPE_WITH_CODE (GTestTlsConnection, g_test_tls_connection, G_TYPE_TLS_CONNECTION,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_TLS_CLIENT_CONNECTION, NULL);
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_TLS_SERVER_CONNECTION, NULL);
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_TLS_CLIENT_CONNECTION, NULL)
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_TLS_SERVER_CONNECTION, NULL)
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
|
||||
g_test_tls_connection_initable_iface_init);)
|
||||
g_test_tls_connection_initable_iface_init))
|
||||
|
||||
static void
|
||||
g_test_tls_connection_get_property (GObject *object,
|
||||
|
@ -36,7 +36,7 @@
|
||||
* functions like getpass() and does lazy things with threads.
|
||||
*/
|
||||
|
||||
G_DEFINE_TYPE (GTlsConsoleInteraction, g_tls_console_interaction, G_TYPE_TLS_INTERACTION);
|
||||
G_DEFINE_TYPE (GTlsConsoleInteraction, g_tls_console_interaction, G_TYPE_TLS_INTERACTION)
|
||||
|
||||
#if defined(G_OS_WIN32) || defined(__BIONIC__)
|
||||
/* win32 doesn't have getpass() */
|
||||
|
@ -105,7 +105,7 @@ GType test_threaded_socket_service_get_type (void);
|
||||
typedef GThreadedSocketService TestThreadedSocketService;
|
||||
typedef GThreadedSocketServiceClass TestThreadedSocketServiceClass;
|
||||
|
||||
G_DEFINE_TYPE (TestThreadedSocketService, test_threaded_socket_service, G_TYPE_THREADED_SOCKET_SERVICE);
|
||||
G_DEFINE_TYPE (TestThreadedSocketService, test_threaded_socket_service, G_TYPE_THREADED_SOCKET_SERVICE)
|
||||
|
||||
static void
|
||||
test_threaded_socket_service_init (TestThreadedSocketService *service)
|
||||
|
@ -63,7 +63,7 @@ typedef struct {
|
||||
} TestInteractionClass;
|
||||
|
||||
static GType test_interaction_get_type (void);
|
||||
G_DEFINE_TYPE (TestInteraction, test_interaction, G_TYPE_TLS_INTERACTION);
|
||||
G_DEFINE_TYPE (TestInteraction, test_interaction, G_TYPE_TLS_INTERACTION)
|
||||
|
||||
#define TEST_TYPE_INTERACTION (test_interaction_get_type ())
|
||||
#define TEST_INTERACTION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TEST_TYPE_INTERACTION, TestInteraction))
|
||||
|
@ -45,7 +45,7 @@ struct _GWinHttpFileInputStreamClass
|
||||
};
|
||||
|
||||
#define g_winhttp_file_input_stream_get_type _g_winhttp_file_input_stream_get_type
|
||||
G_DEFINE_TYPE (GWinHttpFileInputStream, g_winhttp_file_input_stream, G_TYPE_FILE_INPUT_STREAM);
|
||||
G_DEFINE_TYPE (GWinHttpFileInputStream, g_winhttp_file_input_stream, G_TYPE_FILE_INPUT_STREAM)
|
||||
|
||||
static gssize g_winhttp_file_input_stream_read (GInputStream *stream,
|
||||
void *buffer,
|
||||
|
@ -44,7 +44,7 @@ struct _GWinHttpFileOutputStreamClass
|
||||
};
|
||||
|
||||
#define g_winhttp_file_output_stream_get_type _g_winhttp_file_output_stream_get_type
|
||||
G_DEFINE_TYPE (GWinHttpFileOutputStream, g_winhttp_file_output_stream, G_TYPE_FILE_OUTPUT_STREAM);
|
||||
G_DEFINE_TYPE (GWinHttpFileOutputStream, g_winhttp_file_output_stream, G_TYPE_FILE_OUTPUT_STREAM)
|
||||
|
||||
static gssize g_winhttp_file_output_stream_write (GOutputStream *stream,
|
||||
const void *buffer,
|
||||
|
@ -193,7 +193,7 @@ enum
|
||||
|
||||
static guint gobject_notify_signal_id;
|
||||
|
||||
G_DEFINE_TYPE (GBinding, g_binding, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (GBinding, g_binding, G_TYPE_OBJECT)
|
||||
|
||||
/* the basic assumption is that if either the source or the target
|
||||
* goes away then the binding does not exist any more and it should
|
||||
|
@ -137,7 +137,7 @@ G_DEFINE_BOXED_TYPE (GHashTable, g_hash_table, g_hash_table_ref, g_hash_table_un
|
||||
G_DEFINE_BOXED_TYPE (GArray, g_array, g_array_ref, g_array_unref)
|
||||
G_DEFINE_BOXED_TYPE (GPtrArray, g_ptr_array,g_ptr_array_ref, g_ptr_array_unref)
|
||||
G_DEFINE_BOXED_TYPE (GByteArray, g_byte_array, g_byte_array_ref, g_byte_array_unref)
|
||||
G_DEFINE_BOXED_TYPE (GBytes, g_bytes, g_bytes_ref, g_bytes_unref);
|
||||
G_DEFINE_BOXED_TYPE (GBytes, g_bytes, g_bytes_ref, g_bytes_unref)
|
||||
|
||||
G_DEFINE_BOXED_TYPE (GRegex, g_regex, g_regex_ref, g_regex_unref)
|
||||
G_DEFINE_BOXED_TYPE (GMatchInfo, g_match_info, g_match_info_ref, g_match_info_unref)
|
||||
@ -151,8 +151,8 @@ G_DEFINE_BOXED_TYPE (GVariantDict, g_variant_dict, g_variant_dict_ref, g_variant
|
||||
|
||||
G_DEFINE_BOXED_TYPE (GError, g_error, g_error_copy, g_error_free)
|
||||
|
||||
G_DEFINE_BOXED_TYPE (GDateTime, g_date_time, g_date_time_ref, g_date_time_unref);
|
||||
G_DEFINE_BOXED_TYPE (GTimeZone, g_time_zone, g_time_zone_ref, g_time_zone_unref);
|
||||
G_DEFINE_BOXED_TYPE (GDateTime, g_date_time, g_date_time_ref, g_date_time_unref)
|
||||
G_DEFINE_BOXED_TYPE (GTimeZone, g_time_zone, g_time_zone_ref, g_time_zone_unref)
|
||||
G_DEFINE_BOXED_TYPE (GKeyFile, g_key_file, g_key_file_ref, g_key_file_unref)
|
||||
G_DEFINE_BOXED_TYPE (GMappedFile, g_mapped_file, g_mapped_file_ref, g_mapped_file_unref)
|
||||
|
||||
|
@ -4232,7 +4232,7 @@ g_object_compat_control (gsize what,
|
||||
}
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE (GInitiallyUnowned, g_initially_unowned, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (GInitiallyUnowned, g_initially_unowned, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
g_initially_unowned_init (GInitiallyUnowned *object)
|
||||
|
@ -28,7 +28,7 @@ enum
|
||||
};
|
||||
|
||||
static GType binding_source_get_type (void);
|
||||
G_DEFINE_TYPE (BindingSource, binding_source, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (BindingSource, binding_source, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
binding_source_set_property (GObject *gobject,
|
||||
@ -150,7 +150,7 @@ enum
|
||||
};
|
||||
|
||||
static GType binding_target_get_type (void);
|
||||
G_DEFINE_TYPE (BindingTarget, binding_target, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (BindingTarget, binding_target, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
binding_target_set_property (GObject *gobject,
|
||||
|
@ -130,7 +130,7 @@ struct _DynamicObjectClass
|
||||
};
|
||||
|
||||
static GType dynamic_object_get_type (void);
|
||||
G_DEFINE_DYNAMIC_TYPE(DynamicObject, dynamic_object, G_TYPE_OBJECT);
|
||||
G_DEFINE_DYNAMIC_TYPE(DynamicObject, dynamic_object, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
dynamic_object_class_init (DynamicObjectClass *class)
|
||||
|
@ -410,19 +410,19 @@ test_value_transform (void)
|
||||
|
||||
static GType test_object_a_get_type (void);
|
||||
typedef GObject TestObjectA; typedef GObjectClass TestObjectAClass;
|
||||
G_DEFINE_TYPE (TestObjectA, test_object_a, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (TestObjectA, test_object_a, G_TYPE_OBJECT)
|
||||
static void test_object_a_class_init (TestObjectAClass *class) { }
|
||||
static void test_object_a_init (TestObjectA *a) { }
|
||||
|
||||
static GType test_object_b_get_type (void);
|
||||
typedef GObject TestObjectB; typedef GObjectClass TestObjectBClass;
|
||||
G_DEFINE_TYPE (TestObjectB, test_object_b, test_object_a_get_type ());
|
||||
G_DEFINE_TYPE (TestObjectB, test_object_b, test_object_a_get_type ())
|
||||
static void test_object_b_class_init (TestObjectBClass *class) { }
|
||||
static void test_object_b_init (TestObjectB *b) { }
|
||||
|
||||
static GType test_object_c_get_type (void);
|
||||
typedef GObject TestObjectC; typedef GObjectClass TestObjectCClass;
|
||||
G_DEFINE_TYPE (TestObjectC, test_object_c, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (TestObjectC, test_object_c, G_TYPE_OBJECT)
|
||||
static void test_object_c_class_init (TestObjectCClass *class) { }
|
||||
static void test_object_c_init (TestObjectC *c) { }
|
||||
|
||||
|
@ -19,7 +19,7 @@ enum { PROP_0, PROP_FOO, PROP_BAR, PROP_BAZ, PROP_QUUX, N_PROPERTIES };
|
||||
static GParamSpec *properties[N_PROPERTIES] = { NULL, };
|
||||
|
||||
static GType test_object_get_type (void);
|
||||
G_DEFINE_TYPE (TestObject, test_object, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (TestObject, test_object, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
test_object_set_foo (TestObject *obj,
|
||||
|
@ -48,11 +48,11 @@ static void interface_per_class_init (void) { call_counter_init (NULL); }
|
||||
/* define 3 test interfaces */
|
||||
typedef GTypeInterface MyFace0Interface;
|
||||
static GType my_face0_get_type (void);
|
||||
G_DEFINE_INTERFACE (MyFace0, my_face0, G_TYPE_OBJECT);
|
||||
G_DEFINE_INTERFACE (MyFace0, my_face0, G_TYPE_OBJECT)
|
||||
static void my_face0_default_init (MyFace0Interface *iface) { call_counter_init (iface); }
|
||||
typedef GTypeInterface MyFace1Interface;
|
||||
static GType my_face1_get_type (void);
|
||||
G_DEFINE_INTERFACE (MyFace1, my_face1, G_TYPE_OBJECT);
|
||||
G_DEFINE_INTERFACE (MyFace1, my_face1, G_TYPE_OBJECT)
|
||||
static void my_face1_default_init (MyFace1Interface *iface) { call_counter_init (iface); }
|
||||
|
||||
/* define 3 test objects, adding interfaces 0 & 1, and adding interface 2 after class initialization */
|
||||
@ -60,9 +60,8 @@ typedef GObject MyTester0;
|
||||
typedef GObjectClass MyTester0Class;
|
||||
static GType my_tester0_get_type (void);
|
||||
G_DEFINE_TYPE_WITH_CODE (MyTester0, my_tester0, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (my_face0_get_type(), interface_per_class_init);
|
||||
G_IMPLEMENT_INTERFACE (my_face1_get_type(), interface_per_class_init);
|
||||
);
|
||||
G_IMPLEMENT_INTERFACE (my_face0_get_type(), interface_per_class_init)
|
||||
G_IMPLEMENT_INTERFACE (my_face1_get_type(), interface_per_class_init))
|
||||
static void my_tester0_init (MyTester0*t) {}
|
||||
static void my_tester0_class_init (MyTester0Class*c) { call_counter_init (c); }
|
||||
typedef GObject MyTester1;
|
||||
@ -72,23 +71,21 @@ typedef GObjectClass MyTester1Class;
|
||||
#if 0
|
||||
typedef GTypeInterface MyFace2Interface;
|
||||
static GType my_face2_get_type (void);
|
||||
G_DEFINE_INTERFACE (MyFace2, my_face2, G_TYPE_OBJECT);
|
||||
G_DEFINE_INTERFACE (MyFace2, my_face2, G_TYPE_OBJECT)
|
||||
static void my_face2_default_init (MyFace2Interface *iface) { call_counter_init (iface); }
|
||||
|
||||
static GType my_tester1_get_type (void);
|
||||
G_DEFINE_TYPE_WITH_CODE (MyTester1, my_tester1, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (my_face0_get_type(), interface_per_class_init);
|
||||
G_IMPLEMENT_INTERFACE (my_face1_get_type(), interface_per_class_init);
|
||||
);
|
||||
G_IMPLEMENT_INTERFACE (my_face0_get_type(), interface_per_class_init)
|
||||
G_IMPLEMENT_INTERFACE (my_face1_get_type(), interface_per_class_init))
|
||||
static void my_tester1_init (MyTester1*t) {}
|
||||
static void my_tester1_class_init (MyTester1Class*c) { call_counter_init (c); }
|
||||
typedef GObject MyTester2;
|
||||
typedef GObjectClass MyTester2Class;
|
||||
static GType my_tester2_get_type (void);
|
||||
G_DEFINE_TYPE_WITH_CODE (MyTester2, my_tester2, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (my_face0_get_type(), interface_per_class_init);
|
||||
G_IMPLEMENT_INTERFACE (my_face1_get_type(), interface_per_class_init);
|
||||
);
|
||||
G_IMPLEMENT_INTERFACE (my_face0_get_type(), interface_per_class_init)
|
||||
G_IMPLEMENT_INTERFACE (my_face1_get_type(), interface_per_class_init))
|
||||
static void my_tester2_init (MyTester2*t) {}
|
||||
static void my_tester2_class_init (MyTester2Class*c) { call_counter_init (c); }
|
||||
|
||||
@ -152,7 +149,7 @@ typedef struct {
|
||||
} PropTester;
|
||||
typedef GObjectClass PropTesterClass;
|
||||
static GType prop_tester_get_type (void);
|
||||
G_DEFINE_TYPE (PropTester, prop_tester, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (PropTester, prop_tester, G_TYPE_OBJECT)
|
||||
#define PROP_NAME 1
|
||||
static void
|
||||
prop_tester_init (PropTester* t)
|
||||
|
@ -181,7 +181,7 @@ struct _SimpleObjectClass
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (SimpleObject, simple_object, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (SimpleObject, simple_object, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
simple_object_finalize (GObject *object)
|
||||
@ -265,17 +265,11 @@ static void complex_test_iface_init (gpointer g_iface,
|
||||
|
||||
G_DEFINE_TYPE_EXTENDED (ComplexObject, complex_object,
|
||||
G_TYPE_OBJECT, 0,
|
||||
G_IMPLEMENT_INTERFACE (TEST_TYPE_IFACE1,
|
||||
complex_test_iface_init)
|
||||
G_IMPLEMENT_INTERFACE (TEST_TYPE_IFACE2,
|
||||
complex_test_iface_init)
|
||||
G_IMPLEMENT_INTERFACE (TEST_TYPE_IFACE3,
|
||||
complex_test_iface_init)
|
||||
G_IMPLEMENT_INTERFACE (TEST_TYPE_IFACE4,
|
||||
complex_test_iface_init)
|
||||
G_IMPLEMENT_INTERFACE (TEST_TYPE_IFACE5,
|
||||
complex_test_iface_init)
|
||||
);
|
||||
G_IMPLEMENT_INTERFACE (TEST_TYPE_IFACE1, complex_test_iface_init)
|
||||
G_IMPLEMENT_INTERFACE (TEST_TYPE_IFACE2, complex_test_iface_init)
|
||||
G_IMPLEMENT_INTERFACE (TEST_TYPE_IFACE3, complex_test_iface_init)
|
||||
G_IMPLEMENT_INTERFACE (TEST_TYPE_IFACE4, complex_test_iface_init)
|
||||
G_IMPLEMENT_INTERFACE (TEST_TYPE_IFACE5, complex_test_iface_init))
|
||||
|
||||
#define COMPLEX_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), COMPLEX_TYPE_OBJECT, ComplexObject))
|
||||
|
||||
|
@ -56,7 +56,7 @@ struct _TestObjectClass
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (TestObject, test_object, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (TestObject, test_object, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
test_object_finalize (GObject *object)
|
||||
|
@ -35,7 +35,7 @@ static GType my_singleton_get_type (void);
|
||||
#define MY_IS_SINGLETON_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), MY_TYPE_SINGLETON))
|
||||
#define MY_SINGLETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MY_TYPE_SINGLETON, MySingletonClass))
|
||||
|
||||
G_DEFINE_TYPE (MySingleton, my_singleton, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (MySingleton, my_singleton, G_TYPE_OBJECT)
|
||||
|
||||
static MySingleton *the_one_and_only = NULL;
|
||||
|
||||
|
@ -47,7 +47,7 @@ typedef struct {
|
||||
#define MY_TEST_GET_CLASS(test) (G_TYPE_INSTANCE_GET_CLASS ((test), G_TYPE_TEST, GTestClass))
|
||||
|
||||
static GType my_test_get_type (void);
|
||||
G_DEFINE_TYPE (GTest, my_test, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (GTest, my_test, G_TYPE_OBJECT)
|
||||
|
||||
/* --- variables --- */
|
||||
static volatile gboolean stopping = FALSE;
|
||||
|
@ -32,7 +32,7 @@ struct _GTestClass
|
||||
};
|
||||
|
||||
static GType my_test_get_type (void);
|
||||
G_DEFINE_TYPE (GTest, my_test, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (GTest, my_test, G_TYPE_OBJECT)
|
||||
|
||||
static volatile gboolean stopping;
|
||||
|
||||
|
@ -30,7 +30,7 @@ struct _MyBadgerClass
|
||||
};
|
||||
|
||||
static GType my_badger_get_type (void);
|
||||
G_DEFINE_TYPE (MyBadger, my_badger, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE (MyBadger, my_badger, G_TYPE_OBJECT)
|
||||
|
||||
static void my_badger_dispose (GObject * object);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user