Commit 32747def authored by Emmanuele Bassi's avatar Emmanuele Bassi

gio: Use the new private instance data declaration

Use the newly added macros, and remove the explicit calls to
g_type_class_add_private().

https://bugzilla.gnome.org/show_bug.cgi?id=700035
parent aba80eea
......@@ -788,14 +788,14 @@ enum {
LAST_SIGNAL
};
guint signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (GAppLaunchContext, g_app_launch_context, G_TYPE_OBJECT);
struct _GAppLaunchContextPrivate {
char **envp;
};
static guint signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE_WITH_PRIVATE (GAppLaunchContext, g_app_launch_context, G_TYPE_OBJECT)
/**
* g_app_launch_context_new:
*
......@@ -825,8 +825,6 @@ g_app_launch_context_class_init (GAppLaunchContextClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (GAppLaunchContextPrivate));
object_class->finalize = g_app_launch_context_finalize;
/*
......@@ -873,7 +871,7 @@ g_app_launch_context_class_init (GAppLaunchContextClass *klass)
static void
g_app_launch_context_init (GAppLaunchContext *context)
{
context->priv = G_TYPE_INSTANCE_GET_PRIVATE (context, G_TYPE_APP_LAUNCH_CONTEXT, GAppLaunchContextPrivate);
context->priv = g_app_launch_context_get_private (context);
}
/**
......
......@@ -278,6 +278,7 @@ static guint g_application_signals[NR_SIGNALS];
static void g_application_action_group_iface_init (GActionGroupInterface *);
static void g_application_action_map_iface_init (GActionMapInterface *);
G_DEFINE_TYPE_WITH_CODE (GApplication, g_application, G_TYPE_OBJECT,
G_ADD_PRIVATE (GApplication)
G_IMPLEMENT_INTERFACE (G_TYPE_ACTION_GROUP, g_application_action_group_iface_init)
G_IMPLEMENT_INTERFACE (G_TYPE_ACTION_MAP, g_application_action_map_iface_init))
......@@ -692,9 +693,7 @@ g_application_finalize (GObject *object)
static void
g_application_init (GApplication *application)
{
application->priv = G_TYPE_INSTANCE_GET_PRIVATE (application,
G_TYPE_APPLICATION,
GApplicationPrivate);
application->priv = g_application_get_private (application);
application->priv->actions = g_application_exported_actions_new (application);
......@@ -845,8 +844,6 @@ g_application_class_init (GApplicationClass *class)
g_signal_accumulator_first_wins, NULL,
NULL,
G_TYPE_INT, 1, G_TYPE_APPLICATION_COMMAND_LINE);
g_type_class_add_private (class, sizeof (GApplicationPrivate));
}
static GVariant *
......
......@@ -39,8 +39,6 @@
#include "gwin32inputstream.h"
#endif
G_DEFINE_TYPE (GApplicationCommandLine, g_application_command_line, G_TYPE_OBJECT)
/**
* SECTION:gapplicationcommandline
* @title: GApplicationCommandLine
......@@ -156,6 +154,8 @@ struct _GApplicationCommandLinePrivate
gint exit_status;
};
G_DEFINE_TYPE_WITH_PRIVATE (GApplicationCommandLine, g_application_command_line, G_TYPE_OBJECT)
/* All subclasses represent remote invocations of some kind. */
#define IS_REMOTE(cmdline) (G_TYPE_FROM_INSTANCE (cmdline) != \
G_TYPE_APPLICATION_COMMAND_LINE)
......@@ -282,10 +282,7 @@ g_application_command_line_finalize (GObject *object)
static void
g_application_command_line_init (GApplicationCommandLine *cmdline)
{
cmdline->priv =
G_TYPE_INSTANCE_GET_PRIVATE (cmdline,
G_TYPE_APPLICATION_COMMAND_LINE,
GApplicationCommandLinePrivate);
cmdline->priv = g_application_command_line_get_private (cmdline);
}
static void
......@@ -340,8 +337,6 @@ g_application_command_line_class_init (GApplicationCommandLineClass *class)
P_("TRUE if this is a remote commandline"),
FALSE,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_type_class_add_private (class, sizeof (GApplicationCommandLinePrivate));
}
......
......@@ -136,6 +136,7 @@ static void compact_buffer (GBufferedInputStream *stream);
G_DEFINE_TYPE_WITH_CODE (GBufferedInputStream,
g_buffered_input_stream,
G_TYPE_FILTER_INPUT_STREAM,
G_ADD_PRIVATE (GBufferedInputStream)
G_IMPLEMENT_INTERFACE (G_TYPE_SEEKABLE,
g_buffered_input_stream_seekable_iface_init))
......@@ -146,8 +147,6 @@ g_buffered_input_stream_class_init (GBufferedInputStreamClass *klass)
GInputStreamClass *istream_class;
GBufferedInputStreamClass *bstream_class;
g_type_class_add_private (klass, sizeof (GBufferedInputStreamPrivate));
object_class = G_OBJECT_CLASS (klass);
object_class->get_property = g_buffered_input_stream_get_property;
object_class->set_property = g_buffered_input_stream_set_property;
......@@ -317,9 +316,7 @@ g_buffered_input_stream_seekable_iface_init (GSeekableIface *iface)
static void
g_buffered_input_stream_init (GBufferedInputStream *stream)
{
stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream,
G_TYPE_BUFFERED_INPUT_STREAM,
GBufferedInputStreamPrivate);
stream->priv = g_buffered_input_stream_get_private (stream);
}
......
......@@ -124,6 +124,7 @@ static gboolean g_buffered_output_stream_truncate (GSeekable *s
G_DEFINE_TYPE_WITH_CODE (GBufferedOutputStream,
g_buffered_output_stream,
G_TYPE_FILTER_OUTPUT_STREAM,
G_ADD_PRIVATE (GBufferedOutputStream)
G_IMPLEMENT_INTERFACE (G_TYPE_SEEKABLE,
g_buffered_output_stream_seekable_iface_init))
......@@ -133,8 +134,6 @@ g_buffered_output_stream_class_init (GBufferedOutputStreamClass *klass)
{
GObjectClass *object_class;
GOutputStreamClass *ostream_class;
g_type_class_add_private (klass, sizeof (GBufferedOutputStreamPrivate));
object_class = G_OBJECT_CLASS (klass);
object_class->get_property = g_buffered_output_stream_get_property;
......@@ -345,10 +344,7 @@ g_buffered_output_stream_finalize (GObject *object)
static void
g_buffered_output_stream_init (GBufferedOutputStream *stream)
{
stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream,
G_TYPE_BUFFERED_OUTPUT_STREAM,
GBufferedOutputStreamPrivate);
stream->priv = g_buffered_output_stream_get_private (stream);
}
static void
......
......@@ -55,7 +55,7 @@ struct _GCancellablePrivate
static guint signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (GCancellable, g_cancellable, G_TYPE_OBJECT);
G_DEFINE_TYPE_WITH_PRIVATE (GCancellable, g_cancellable, G_TYPE_OBJECT)
static GPrivate current_cancellable;
static GMutex cancellable_mutex;
......@@ -77,8 +77,6 @@ g_cancellable_class_init (GCancellableClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (GCancellablePrivate));
gobject_class->finalize = g_cancellable_finalize;
/**
......@@ -153,9 +151,7 @@ g_cancellable_class_init (GCancellableClass *klass)
static void
g_cancellable_init (GCancellable *cancellable)
{
cancellable->priv = G_TYPE_INSTANCE_GET_PRIVATE (cancellable,
G_TYPE_CANCELLABLE,
GCancellablePrivate);
cancellable->priv = g_cancellable_get_private (cancellable);
}
/**
......
......@@ -99,9 +99,9 @@ static void g_converter_input_stream_pollable_iface_init (GPollableInputStreamI
G_DEFINE_TYPE_WITH_CODE (GConverterInputStream,
g_converter_input_stream,
G_TYPE_FILTER_INPUT_STREAM,
G_ADD_PRIVATE (GConverterInputStream)
G_IMPLEMENT_INTERFACE (G_TYPE_POLLABLE_INPUT_STREAM,
g_converter_input_stream_pollable_iface_init);
)
g_converter_input_stream_pollable_iface_init))
static void
g_converter_input_stream_class_init (GConverterInputStreamClass *klass)
......@@ -109,8 +109,6 @@ g_converter_input_stream_class_init (GConverterInputStreamClass *klass)
GObjectClass *object_class;
GInputStreamClass *istream_class;
g_type_class_add_private (klass, sizeof (GConverterInputStreamPrivate));
object_class = G_OBJECT_CLASS (klass);
object_class->get_property = g_converter_input_stream_get_property;
object_class->set_property = g_converter_input_stream_set_property;
......@@ -207,9 +205,7 @@ g_converter_input_stream_get_property (GObject *object,
static void
g_converter_input_stream_init (GConverterInputStream *stream)
{
stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream,
G_TYPE_CONVERTER_INPUT_STREAM,
GConverterInputStreamPrivate);
stream->priv = g_converter_input_stream_get_private (stream);
}
/**
......
......@@ -114,9 +114,9 @@ static void g_converter_output_stream_pollable_iface_init (GPollableOutputStream
G_DEFINE_TYPE_WITH_CODE (GConverterOutputStream,
g_converter_output_stream,
G_TYPE_FILTER_OUTPUT_STREAM,
G_ADD_PRIVATE (GConverterOutputStream)
G_IMPLEMENT_INTERFACE (G_TYPE_POLLABLE_OUTPUT_STREAM,
g_converter_output_stream_pollable_iface_init);
)
g_converter_output_stream_pollable_iface_init))
static void
g_converter_output_stream_class_init (GConverterOutputStreamClass *klass)
......@@ -124,8 +124,6 @@ g_converter_output_stream_class_init (GConverterOutputStreamClass *klass)
GObjectClass *object_class;
GOutputStreamClass *istream_class;
g_type_class_add_private (klass, sizeof (GConverterOutputStreamPrivate));
object_class = G_OBJECT_CLASS (klass);
object_class->get_property = g_converter_output_stream_get_property;
object_class->set_property = g_converter_output_stream_set_property;
......@@ -223,9 +221,7 @@ g_converter_output_stream_get_property (GObject *object,
static void
g_converter_output_stream_init (GConverterOutputStream *stream)
{
stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream,
G_TYPE_CONVERTER_OUTPUT_STREAM,
GConverterOutputStreamPrivate);
stream->priv = g_converter_output_stream_get_private (stream);
}
/**
......
......@@ -63,9 +63,9 @@ static void g_data_input_stream_get_property (GObject *object,
GValue *value,
GParamSpec *pspec);
G_DEFINE_TYPE (GDataInputStream,
g_data_input_stream,
G_TYPE_BUFFERED_INPUT_STREAM)
G_DEFINE_TYPE_WITH_PRIVATE (GDataInputStream,
g_data_input_stream,
G_TYPE_BUFFERED_INPUT_STREAM)
static void
......@@ -73,8 +73,6 @@ g_data_input_stream_class_init (GDataInputStreamClass *klass)
{
GObjectClass *object_class;
g_type_class_add_private (klass, sizeof (GDataInputStreamPrivate));
object_class = G_OBJECT_CLASS (klass);
object_class->get_property = g_data_input_stream_get_property;
object_class->set_property = g_data_input_stream_set_property;
......@@ -169,10 +167,7 @@ g_data_input_stream_get_property (GObject *object,
static void
g_data_input_stream_init (GDataInputStream *stream)
{
stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream,
G_TYPE_DATA_INPUT_STREAM,
GDataInputStreamPrivate);
stream->priv = g_data_input_stream_get_private (stream);
stream->priv->byte_order = G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN;
stream->priv->newline_type = G_DATA_STREAM_NEWLINE_TYPE_LF;
}
......
......@@ -77,6 +77,7 @@ static gboolean g_data_output_stream_truncate (GSeekable *seeka
G_DEFINE_TYPE_WITH_CODE (GDataOutputStream,
g_data_output_stream,
G_TYPE_FILTER_OUTPUT_STREAM,
G_ADD_PRIVATE (GDataOutputStream)
G_IMPLEMENT_INTERFACE (G_TYPE_SEEKABLE,
g_data_output_stream_seekable_iface_init))
......@@ -86,8 +87,6 @@ g_data_output_stream_class_init (GDataOutputStreamClass *klass)
{
GObjectClass *object_class;
g_type_class_add_private (klass, sizeof (GDataOutputStreamPrivate));
object_class = G_OBJECT_CLASS (klass);
object_class->get_property = g_data_output_stream_get_property;
object_class->set_property = g_data_output_stream_set_property;
......@@ -158,10 +157,7 @@ g_data_output_stream_get_property (GObject *object,
static void
g_data_output_stream_init (GDataOutputStream *stream)
{
stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream,
G_TYPE_DATA_OUTPUT_STREAM,
GDataOutputStreamPrivate);
stream->priv = g_data_output_stream_get_private (stream);
stream->priv->byte_order = G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN;
}
......
......@@ -1570,6 +1570,7 @@ class CodeGenerator:
self.c.write('static void %s_proxy_iface_init (%sIface *iface);\n'
'\n'%(i.name_lower, i.camel_name))
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))
# finalize
......@@ -1794,12 +1795,12 @@ class CodeGenerator:
self.c.write('static void\n'
'%s_proxy_init (%sProxy *proxy)\n'
'{\n'
' proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, %sTYPE_%s_PROXY, %sProxyPrivate);\n'
' proxy->priv = %s_proxy_get_private (proxy);\n'
' g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), %s_interface_info ());\n'
'}\n'
'\n'
%(i.name_lower, i.camel_name,
i.ns_upper, i.name_upper, i.camel_name,
i.name_lower,
i.name_lower))
self.c.write('static void\n'
'%s_proxy_class_init (%sProxyClass *klass)\n'
......@@ -1807,8 +1808,6 @@ class CodeGenerator:
' GObjectClass *gobject_class;\n'
' GDBusProxyClass *proxy_class;\n'
'\n'
' g_type_class_add_private (klass, sizeof (%sProxyPrivate));\n'
'\n'
' gobject_class = G_OBJECT_CLASS (klass);\n'
' gobject_class->finalize = %s_proxy_finalize;\n'
' gobject_class->get_property = %s_proxy_get_property;\n'
......@@ -1818,7 +1817,6 @@ class CodeGenerator:
' proxy_class->g_signal = %s_proxy_g_signal;\n'
' proxy_class->g_properties_changed = %s_proxy_g_properties_changed;\n'
'\n'%(i.name_lower, i.camel_name,
i.camel_name,
i.name_lower, i.name_lower, i.name_lower, i.name_lower, i.name_lower))
if len(i.properties) > 0:
self.c.write('\n'
......@@ -2341,6 +2339,7 @@ class CodeGenerator:
%(i.name_lower, i.camel_name))
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))
# finalize
......@@ -2534,8 +2533,9 @@ class CodeGenerator:
self.c.write('static void\n'
'%s_skeleton_init (%sSkeleton *skeleton)\n'
'{\n'
' skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, %sTYPE_%s_SKELETON, %sSkeletonPrivate);\n'
%(i.name_lower, i.camel_name, i.ns_upper, i.name_upper, i.camel_name))
' skeleton->priv = %s_skeleton_get_private (skeleton);\n'
%(i.name_lower, i.camel_name,
i.name_lower))
self.c.write(' g_mutex_init (&skeleton->priv->lock);\n')
self.c.write(' skeleton->priv->context = g_main_context_ref_thread_default ();\n')
if len(i.properties) > 0:
......@@ -2571,11 +2571,9 @@ class CodeGenerator:
' GObjectClass *gobject_class;\n'
' GDBusInterfaceSkeletonClass *skeleton_class;\n'
'\n'
' g_type_class_add_private (klass, sizeof (%sSkeletonPrivate));\n'
'\n'
' gobject_class = G_OBJECT_CLASS (klass);\n'
' gobject_class->finalize = %s_skeleton_finalize;\n'
%(i.name_lower, i.camel_name, i.camel_name, i.name_lower))
%(i.name_lower, i.camel_name, i.name_lower))
if len(i.properties) > 0:
self.c.write(' gobject_class->get_property = %s_skeleton_get_property;\n'
' gobject_class->set_property = %s_skeleton_set_property;\n'
......
......@@ -104,7 +104,7 @@ enum
PROP_STREAM
};
G_DEFINE_TYPE (GDBusAuth, _g_dbus_auth, G_TYPE_OBJECT);
G_DEFINE_TYPE_WITH_PRIVATE (GDBusAuth, _g_dbus_auth, G_TYPE_OBJECT)
/* ---------------------------------------------------------------------------------------------------- */
......@@ -166,8 +166,6 @@ _g_dbus_auth_class_init (GDBusAuthClass *klass)
{
GObjectClass *gobject_class;
g_type_class_add_private (klass, sizeof (GDBusAuthPrivate));
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->get_property = _g_dbus_auth_get_property;
gobject_class->set_property = _g_dbus_auth_set_property;
......@@ -226,8 +224,7 @@ mech_compare_func (Mechanism *a, Mechanism *b)
static void
_g_dbus_auth_init (GDBusAuth *auth)
{
auth->priv = G_TYPE_INSTANCE_GET_PRIVATE (auth, G_TYPE_DBUS_AUTH, GDBusAuthPrivate);
auth->priv = _g_dbus_auth_get_private (auth);
}
static void
......
......@@ -45,7 +45,7 @@ enum
PROP_CREDENTIALS
};
G_DEFINE_ABSTRACT_TYPE (GDBusAuthMechanism, _g_dbus_auth_mechanism, G_TYPE_OBJECT);
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GDBusAuthMechanism, _g_dbus_auth_mechanism, G_TYPE_OBJECT)
/* ---------------------------------------------------------------------------------------------------- */
......@@ -115,8 +115,6 @@ _g_dbus_auth_mechanism_class_init (GDBusAuthMechanismClass *klass)
{
GObjectClass *gobject_class;
g_type_class_add_private (klass, sizeof (GDBusAuthMechanismPrivate));
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->get_property = _g_dbus_auth_mechanism_get_property;
gobject_class->set_property = _g_dbus_auth_mechanism_set_property;
......@@ -161,10 +159,7 @@ _g_dbus_auth_mechanism_class_init (GDBusAuthMechanismClass *klass)
static void
_g_dbus_auth_mechanism_init (GDBusAuthMechanism *mechanism)
{
/* not used for now */
mechanism->priv = G_TYPE_INSTANCE_GET_PRIVATE (mechanism,
G_TYPE_DBUS_AUTH_MECHANISM,
GDBusAuthMechanismPrivate);
mechanism->priv = _g_dbus_auth_mechanism_get_private (mechanism);
}
/* ---------------------------------------------------------------------------------------------------- */
......
......@@ -70,7 +70,7 @@ static void mechanism_client_shutdown (GDBusAuthMe
/* ---------------------------------------------------------------------------------------------------- */
G_DEFINE_TYPE (GDBusAuthMechanismAnon, _g_dbus_auth_mechanism_anon, G_TYPE_DBUS_AUTH_MECHANISM);
G_DEFINE_TYPE_WITH_PRIVATE (GDBusAuthMechanismAnon, _g_dbus_auth_mechanism_anon, G_TYPE_DBUS_AUTH_MECHANISM)
/* ---------------------------------------------------------------------------------------------------- */
......@@ -89,8 +89,6 @@ _g_dbus_auth_mechanism_anon_class_init (GDBusAuthMechanismAnonClass *klass)
GObjectClass *gobject_class;
GDBusAuthMechanismClass *mechanism_class;
g_type_class_add_private (klass, sizeof (GDBusAuthMechanismAnonPrivate));
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = _g_dbus_auth_mechanism_anon_finalize;
......@@ -116,9 +114,7 @@ _g_dbus_auth_mechanism_anon_class_init (GDBusAuthMechanismAnonClass *klass)
static void
_g_dbus_auth_mechanism_anon_init (GDBusAuthMechanismAnon *mechanism)
{
mechanism->priv = G_TYPE_INSTANCE_GET_PRIVATE (mechanism,
G_TYPE_DBUS_AUTH_MECHANISM_ANON,
GDBusAuthMechanismAnonPrivate);
mechanism->priv = _g_dbus_auth_mechanism_anon_get_private (mechanism);
}
/* ---------------------------------------------------------------------------------------------------- */
......
......@@ -77,7 +77,7 @@ static void mechanism_client_shutdown (GDBusAuthMe
/* ---------------------------------------------------------------------------------------------------- */
G_DEFINE_TYPE (GDBusAuthMechanismExternal, _g_dbus_auth_mechanism_external, G_TYPE_DBUS_AUTH_MECHANISM);
G_DEFINE_TYPE_WITH_PRIVATE (GDBusAuthMechanismExternal, _g_dbus_auth_mechanism_external, G_TYPE_DBUS_AUTH_MECHANISM)
/* ---------------------------------------------------------------------------------------------------- */
......@@ -96,8 +96,6 @@ _g_dbus_auth_mechanism_external_class_init (GDBusAuthMechanismExternalClass *kla
GObjectClass *gobject_class;
GDBusAuthMechanismClass *mechanism_class;
g_type_class_add_private (klass, sizeof (GDBusAuthMechanismExternalPrivate));
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = _g_dbus_auth_mechanism_external_finalize;
......@@ -123,9 +121,7 @@ _g_dbus_auth_mechanism_external_class_init (GDBusAuthMechanismExternalClass *kla
static void
_g_dbus_auth_mechanism_external_init (GDBusAuthMechanismExternal *mechanism)
{
mechanism->priv = G_TYPE_INSTANCE_GET_PRIVATE (mechanism,
G_TYPE_DBUS_AUTH_MECHANISM_EXTERNAL,
GDBusAuthMechanismExternalPrivate);
mechanism->priv = _g_dbus_auth_mechanism_external_get_private (mechanism);
}
/* ---------------------------------------------------------------------------------------------------- */
......
......@@ -93,7 +93,7 @@ static void mechanism_client_shutdown (GDBusAuthMe
/* ---------------------------------------------------------------------------------------------------- */
G_DEFINE_TYPE (GDBusAuthMechanismSha1, _g_dbus_auth_mechanism_sha1, G_TYPE_DBUS_AUTH_MECHANISM);
G_DEFINE_TYPE_WITH_PRIVATE (GDBusAuthMechanismSha1, _g_dbus_auth_mechanism_sha1, G_TYPE_DBUS_AUTH_MECHANISM)
/* ---------------------------------------------------------------------------------------------------- */
......@@ -117,8 +117,6 @@ _g_dbus_auth_mechanism_sha1_class_init (GDBusAuthMechanismSha1Class *klass)
GObjectClass *gobject_class;
GDBusAuthMechanismClass *mechanism_class;
g_type_class_add_private (klass, sizeof (GDBusAuthMechanismSha1Private));
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = _g_dbus_auth_mechanism_sha1_finalize;
......@@ -144,9 +142,7 @@ _g_dbus_auth_mechanism_sha1_class_init (GDBusAuthMechanismSha1Class *klass)
static void
_g_dbus_auth_mechanism_sha1_init (GDBusAuthMechanismSha1 *mechanism)
{
mechanism->priv = G_TYPE_INSTANCE_GET_PRIVATE (mechanism,
G_TYPE_DBUS_AUTH_MECHANISM_SHA1,
GDBusAuthMechanismSha1Private);
mechanism->priv = _g_dbus_auth_mechanism_sha1_get_private (mechanism);
}
/* ---------------------------------------------------------------------------------------------------- */
......
......@@ -91,7 +91,8 @@ static void skeleton_intercept_handle_method_call (GDBusConnect
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GDBusInterfaceSkeleton, g_dbus_interface_skeleton, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_INTERFACE, dbus_interface_interface_init));
G_ADD_PRIVATE (GDBusInterfaceSkeleton)
G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_INTERFACE, dbus_interface_interface_init))
static void
g_dbus_interface_skeleton_finalize (GObject *object)
......@@ -253,14 +254,12 @@ g_dbus_interface_skeleton_class_init (GDBusInterfaceSkeletonClass *klass)
G_TYPE_BOOLEAN,
1,
G_TYPE_DBUS_METHOD_INVOCATION);
g_type_class_add_private (klass, sizeof (GDBusInterfaceSkeletonPrivate));
}
static void
g_dbus_interface_skeleton_init (GDBusInterfaceSkeleton *interface)
{
interface->priv = G_TYPE_INSTANCE_GET_PRIVATE (interface, G_TYPE_DBUS_INTERFACE_SKELETON, GDBusInterfaceSkeletonPrivate);
interface->priv = g_dbus_interface_skeleton_get_private (interface);
g_mutex_init (&interface->priv->lock);
}
......
......@@ -174,6 +174,7 @@ static void async_initable_iface_init (GAsyncInitableIface *async_initable_iface
static void dbus_object_manager_interface_init (GDBusObjectManagerIface *iface);
G_DEFINE_TYPE_WITH_CODE (GDBusObjectManagerClient, g_dbus_object_manager_client, G_TYPE_OBJECT,
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));
......@@ -564,16 +565,12 @@ g_dbus_object_manager_client_class_init (GDBusObjectManagerClientClass *klass)
G_TYPE_DBUS_PROXY,
G_TYPE_VARIANT,
G_TYPE_STRV);
g_type_class_add_private (klass, sizeof (GDBusObjectManagerClientPrivate));
}
static void
g_dbus_object_manager_client_init (GDBusObjectManagerClient *manager)
{
manager->priv = G_TYPE_INSTANCE_GET_PRIVATE (manager,
G_TYPE_DBUS_OBJECT_MANAGER_CLIENT,
GDBusObjectManagerClientPrivate);
manager->priv = g_dbus_object_manager_client_get_private (manager);
g_mutex_init (&manager->priv->lock);
manager->priv->map_object_path_to_object_proxy = g_hash_table_new_full (g_str_hash,
g_str_equal,
......
......@@ -99,7 +99,8 @@ enum
static void dbus_object_manager_interface_init (GDBusObjectManagerIface *iface);
G_DEFINE_TYPE_WITH_CODE (GDBusObjectManagerServer, g_dbus_object_manager_server, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT_MANAGER, dbus_object_manager_interface_init));
G_ADD_PRIVATE (GDBusObjectManagerServer)
G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT_MANAGER, dbus_object_manager_interface_init))
static void g_dbus_object_manager_server_constructed (GObject *object);
......@@ -220,16 +221,12 @@ g_dbus_object_manager_server_class_init (GDBusObjectManagerServerClass *klass)
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
g_type_class_add_private (klass, sizeof (GDBusObjectManagerServerPrivate));
}
static void
g_dbus_object_manager_server_init (GDBusObjectManagerServer *manager)
{
manager->priv = G_TYPE_INSTANCE_GET_PRIVATE (manager,
G_TYPE_DBUS_OBJECT_MANAGER_SERVER,
GDBusObjectManagerServerPrivate);
manager->priv = g_dbus_object_manager_server_get_private (manager);
g_mutex_init (&manager->priv->lock);
manager->priv->map_object_path_to_data = g_hash_table_new_full (g_str_hash,
g_str_equal,
......
......@@ -62,7 +62,8 @@ enum
static void dbus_object_interface_init (GDBusObjectIface *iface);
G_DEFINE_TYPE_WITH_CODE (GDBusObjectProxy, g_dbus_object_proxy, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, dbus_object_interface_init));
G_ADD_PRIVATE (GDBusObjectProxy)
G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, dbus_object_interface_init))
static void
g_dbus_object_proxy_finalize (GObject *object)
......@@ -177,16 +178,12 @@ g_dbus_object_proxy_class_init (GDBusObjectProxyClass *klass)
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
g_type_class_add_private (klass, sizeof (GDBusObjectProxyPrivate));
}
static void
g_dbus_object_proxy_init (GDBusObjectProxy *proxy)
{
proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy,
G_TYPE_DBUS_OBJECT_PROXY,
GDBusObjectProxyPrivate);
proxy->priv = g_dbus_object_proxy_get_private (proxy);
g_mutex_init (&proxy->priv->lock);
proxy->priv->map_name_to_iface = g_hash_table_new_full (g_str_hash,
g_str_equal,
......
......@@ -69,7 +69,8 @@ static guint signals[LAST_SIGNAL] = {0};
static void dbus_object_interface_init (GDBusObjectIface *iface);
G_DEFINE_TYPE_WITH_CODE (GDBusObjectSkeleton, g_dbus_object_skeleton, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, dbus_object_interface_init));
G_ADD_PRIVATE (GDBusObjectSkeleton)
G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, dbus_object_interface_init))
static void
......@@ -196,14 +197,12 @@ g_dbus_object_skeleton_class_init (GDBusObjectSkeletonClass *klass)
2,
G_TYPE_DBUS_INTERFACE_SKELETON,
G_TYPE_DBUS_METHOD_INVOCATION);
g_type_class_add_private (klass, sizeof (GDBusObjectSkeletonPrivate));
}
static void
g_dbus_object_skeleton_init (GDBusObjectSkeleton *object)
{
object->priv = G_TYPE_INSTANCE_GET_PRIVATE (object, G_TYPE_DBUS_OBJECT_SKELETON, GDBusObjectSkeletonPrivate);
object->priv = g_dbus_object_skeleton_get_private (object);
g_mutex_init (&object->priv->lock);
object->priv->map_name_to_iface = g_hash_table_new_full (g_str_hash,
g_str_equal,
......
......@@ -187,10 +187,10 @@ static void initable_iface_init (GInitableIface *initable_iface);
static void async_initable_iface_init (GAsyncInitableIface *async_initable_iface);
G_DEFINE_TYPE_WITH_CODE (GDBusProxy, g_dbus_proxy, G_TYPE_OBJECT,
G_ADD_PRIVATE (GDBusProxy)
G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_INTERFACE, dbus_interface_iface_init)
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_ASYNC_INITABLE, async_initable_iface_init))
static void
g_dbus_proxy_dispose (GObject *object)
......@@ -633,14 +633,12 @@ g_dbus_proxy_class_init (GDBusProxyClass *klass)
G_TYPE_STRING,
G_TYPE_VARIANT);
g_type_class_add_private (klass, sizeof (GDBusProxyPrivate));
}
static void
g_dbus_proxy_init (GDBusProxy *proxy)
{
proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, G_TYPE_DBUS_PROXY, GDBusProxyPrivate);
proxy->priv = g_dbus_proxy_get_private (proxy);
proxy->priv->signal_subscription_data = g_slice_new0 (SignalSubscriptionData);
proxy->priv->signal_subscription_data->ref_count = 1;
proxy->priv->signal_subscription_data->proxy = proxy;
......
......@@ -37,9 +37,9 @@ struct _GDelayedSettingsBackendPrivate
gpointer owner;
};
G_DEFINE_TYPE (GDelayedSettingsBackend,
g_delayed_settings_backend,
G_TYPE_SETTINGS_BACKEND)
G_DEFINE_TYPE_WITH_PRIVATE (GDelayedSettingsBackend,
g_delayed_settings_backend,
G_TYPE_SETTINGS_BACKEND)
static gboolean
invoke_notify_unapplied (gpointer data)
......@@ -428,8 +428,6 @@ g_delayed_settings_backend_class_init (GDelayedSettingsBackendClass *class)
GSettingsBackendClass *backend_class = G_SETTINGS_BACKEND_CLASS (class);
GObjectClass *object_class = G_OBJECT_CLASS (class);
g_type_class_add_private (class, sizeof (GDelayedSettingsBackendPrivate));
backend_class->read = g_delayed_settings_backend_read;
backend_class->write = g_delayed_settings_backend_write;
backend_class->write_tree = g_delayed_settings_backend_write_tree;
......@@ -445,10 +443,7 @@ g_delayed_settings_backend_class_init (GDelayedSettingsBackendClass *class)