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
This commit is contained in:
Emmanuele Bassi
2013-06-11 00:29:58 +01:00
parent aba80eea6c
commit 32747def4b
76 changed files with 387 additions and 730 deletions

View File

@@ -56,13 +56,13 @@ enum {
PROP_CLOSE_HANDLE
};
G_DEFINE_TYPE (GWin32InputStream, g_win32_input_stream, G_TYPE_INPUT_STREAM);
struct _GWin32InputStreamPrivate {
HANDLE handle;
gboolean close_handle;
};
G_DEFINE_TYPE_WITH_PRIVATE (GWin32InputStream, g_win32_input_stream, G_TYPE_INPUT_STREAM)
static void g_win32_input_stream_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@ -80,23 +80,14 @@ static gboolean g_win32_input_stream_close (GInputStream *stream,
GCancellable *cancellable,
GError **error);
static void
g_win32_input_stream_finalize (GObject *object)
{
G_OBJECT_CLASS (g_win32_input_stream_parent_class)->finalize (object);
}
static void
g_win32_input_stream_class_init (GWin32InputStreamClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GInputStreamClass *stream_class = G_INPUT_STREAM_CLASS (klass);
g_type_class_add_private (klass, sizeof (GWin32InputStreamPrivate));
gobject_class->get_property = g_win32_input_stream_get_property;
gobject_class->set_property = g_win32_input_stream_set_property;
gobject_class->finalize = g_win32_input_stream_finalize;
stream_class->read_fn = g_win32_input_stream_read;
stream_class->close_fn = g_win32_input_stream_close;
@@ -181,10 +172,7 @@ g_win32_input_stream_get_property (GObject *object,
static void
g_win32_input_stream_init (GWin32InputStream *win32_stream)
{
win32_stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (win32_stream,
G_TYPE_WIN32_INPUT_STREAM,
GWin32InputStreamPrivate);
win32_stream->priv = g_win32_input_stream_get_private (win32_stream);
win32_stream->priv->handle = NULL;
win32_stream->priv->close_handle = TRUE;
}