From 3eb0ff8e1f03d27d7fd5ea6c3f8e699a54d31a4c Mon Sep 17 00:00:00 2001 From: Wu Xiaotian Date: Wed, 9 Jan 2019 22:08:17 +0800 Subject: [eel] Avoid deprecated g_type_class_add_private With minimal changes to avoid deprecated g_type_class_add_private --- eel/eel-background.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'eel/eel-background.c') diff --git a/eel/eel-background.c b/eel/eel-background.c index cb4ac2ae..e107f7db 100644 --- a/eel/eel-background.c +++ b/eel/eel-background.c @@ -38,8 +38,6 @@ #include #include -G_DEFINE_TYPE (EelBackground, eel_background, G_TYPE_OBJECT); - enum { APPEARANCE_CHANGED, @@ -50,7 +48,7 @@ enum static guint signals[LAST_SIGNAL] = { 0 }; -struct EelBackgroundDetails +struct EelBackgroundPrivate { GtkWidget *widget; GtkWidget *front_widget; @@ -82,6 +80,9 @@ struct EelBackgroundDetails static GList *desktop_bg_objects = NULL; +G_DEFINE_TYPE_WITH_CODE (EelBackground, eel_background, G_TYPE_OBJECT, + G_ADD_PRIVATE (EelBackground)) + static void free_fade (EelBackground *self) { @@ -794,17 +795,12 @@ eel_background_class_init (EelBackgroundClass *klass) NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); object_class->finalize = eel_background_finalize; - - g_type_class_add_private (klass, sizeof (EelBackgroundDetails)); } static void eel_background_init (EelBackground *self) { - self->details = - G_TYPE_INSTANCE_GET_PRIVATE (self, - EEL_TYPE_BACKGROUND, - EelBackgroundDetails); + self->details = eel_background_get_instance_private(self); self->details->bg = mate_bg_new (); self->details->default_color.red = 1.0; -- cgit v1.2.1