Skip to content
Permalink
Browse files

Avoid deprecated g_type_class_add_private

Changed MateBgCrossfade, MateColorbutton and MateDesktopThumbnail
  • Loading branch information...
yetist authored and lukefromdc committed Jan 26, 2019
1 parent 6d30b65 commit 46950f4bbedb593a4dc792b88c15977953904e2b
@@ -66,10 +66,7 @@ enum {

static guint signals[NUMBER_OF_SIGNALS] = { 0 };

G_DEFINE_TYPE (MateBGCrossfade, mate_bg_crossfade, G_TYPE_OBJECT)
#define MATE_BG_CROSSFADE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o),\
MATE_TYPE_BG_CROSSFADE,\
MateBGCrossfadePrivate))
G_DEFINE_TYPE_WITH_PRIVATE (MateBGCrossfade, mate_bg_crossfade, G_TYPE_OBJECT)

static void
mate_bg_crossfade_set_property (GObject *object,
@@ -201,14 +198,12 @@ mate_bg_crossfade_class_init (MateBGCrossfadeClass *fade_class)
G_SIGNAL_RUN_LAST, 0, NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1, G_TYPE_OBJECT);

g_type_class_add_private (gobject_class, sizeof (MateBGCrossfadePrivate));
}

static void
mate_bg_crossfade_init (MateBGCrossfade *fade)
{
fade->priv = MATE_BG_CROSSFADE_GET_PRIVATE (fade);
fade->priv = mate_bg_crossfade_get_instance_private (fade);

fade->priv->window = NULL;
fade->priv->widget = NULL;
@@ -44,8 +44,6 @@
#define CHECK_DARK (1.0 / 3.0)
#define CHECK_LIGHT (2.0 / 3.0)

#define MATE_COLOR_BUTTON_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), MATE_TYPE_COLOR_BUTTON, MateColorButtonPrivate))

struct _MateColorButtonPrivate
{
GtkWidget *draw_area; /* Widget where we draw the color sample */
@@ -120,7 +118,7 @@ static guint color_button_signals[LAST_SIGNAL] = { 0 };

static const GtkTargetEntry drop_types[] = { { "application/x-color", 0, 0 } };

G_DEFINE_TYPE (MateColorButton, mate_color_button, GTK_TYPE_BUTTON)
G_DEFINE_TYPE_WITH_PRIVATE (MateColorButton, mate_color_button, GTK_TYPE_BUTTON)

static void
mate_color_button_class_init (MateColorButtonClass *klass)
@@ -222,8 +220,6 @@ mate_color_button_class_init (MateColorButtonClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);

g_type_class_add_private (gobject_class, sizeof (MateColorButtonPrivate));
}

static gboolean
@@ -414,7 +410,7 @@ mate_color_button_init (MateColorButton *color_button)
_mate_desktop_init_i18n ();

/* Create the widgets */
color_button->priv = MATE_COLOR_BUTTON_GET_PRIVATE (color_button);
color_button->priv = mate_color_button_get_instance_private (color_button);

alignment = gtk_alignment_new (0.5, 0.5, 0.5, 1.0);
gtk_container_set_border_width (GTK_CONTAINER (alignment), 1);
@@ -67,14 +67,11 @@ static const char *appname = "mate-thumbnail-factory";
static void mate_desktop_thumbnail_factory_init (MateDesktopThumbnailFactory *factory);
static void mate_desktop_thumbnail_factory_class_init (MateDesktopThumbnailFactoryClass *class);

G_DEFINE_TYPE (MateDesktopThumbnailFactory,
G_DEFINE_TYPE_WITH_PRIVATE (MateDesktopThumbnailFactory,
mate_desktop_thumbnail_factory,
G_TYPE_OBJECT)
#define parent_class mate_desktop_thumbnail_factory_parent_class

#define MATE_DESKTOP_THUMBNAIL_FACTORY_GET_PRIVATE(object) \
(G_TYPE_INSTANCE_GET_PRIVATE ((object), MATE_DESKTOP_TYPE_THUMBNAIL_FACTORY, MateDesktopThumbnailFactoryPrivate))

typedef struct {
gint width;
gint height;
@@ -777,7 +774,7 @@ mate_desktop_thumbnail_factory_init (MateDesktopThumbnailFactory *factory)
{
MateDesktopThumbnailFactoryPrivate *priv;

factory->priv = MATE_DESKTOP_THUMBNAIL_FACTORY_GET_PRIVATE (factory);
factory->priv = mate_desktop_thumbnail_factory_get_instance_private (factory);

priv = factory->priv;

@@ -816,8 +813,6 @@ mate_desktop_thumbnail_factory_class_init (MateDesktopThumbnailFactoryClass *cla
gobject_class = G_OBJECT_CLASS (class);

gobject_class->finalize = mate_desktop_thumbnail_factory_finalize;

g_type_class_add_private (class, sizeof (MateDesktopThumbnailFactoryPrivate));
}

/**

0 comments on commit 46950f4

Please sign in to comment.
You can’t perform that action at this time.