diff options
author | Wu Xiaotian <[email protected]> | 2019-01-09 22:08:17 +0800 |
---|---|---|
committer | lukefromdc <[email protected]> | 2019-01-12 01:43:18 +0000 |
commit | 3eb0ff8e1f03d27d7fd5ea6c3f8e699a54d31a4c (patch) | |
tree | 6ec60c398e7c536658b67b08d43dbb63b62c8a13 /eel/eel-background.c | |
parent | 9fc6f1f3314f2511249af0a7ce04a255a57c0066 (diff) | |
download | caja-3eb0ff8e1f03d27d7fd5ea6c3f8e699a54d31a4c.tar.bz2 caja-3eb0ff8e1f03d27d7fd5ea6c3f8e699a54d31a4c.tar.xz |
[eel] Avoid deprecated g_type_class_add_private
With minimal changes to avoid deprecated g_type_class_add_private
Diffstat (limited to 'eel/eel-background.c')
-rw-r--r-- | eel/eel-background.c | 14 |
1 files changed, 5 insertions, 9 deletions
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 <stdio.h> #include <libcaja-private/caja-global-preferences.h> -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; |