diff options
author | Pablo Barciela <[email protected]> | 2019-08-14 13:58:42 +0200 |
---|---|---|
committer | Victor Kareh <[email protected]> | 2019-08-20 13:34:13 -0400 |
commit | 45db2c0ab4de576e6bad5686a7144e6cfdf19150 (patch) | |
tree | 39e0b92b2c8b36c8b79da51283948060979aa3a4 /src | |
parent | f6b0397130aba9b854090205f468a488dbd509b3 (diff) | |
download | mate-power-manager-45db2c0ab4de576e6bad5686a7144e6cfdf19150.tar.bz2 mate-power-manager-45db2c0ab4de576e6bad5686a7144e6cfdf19150.tar.xz |
gpm-button: avoid 'g_type_class_add_private'
Diffstat (limited to 'src')
-rw-r--r-- | src/gpm-button.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gpm-button.c b/src/gpm-button.c index 80a97bf..f1ac8e9 100644 --- a/src/gpm-button.c +++ b/src/gpm-button.c @@ -38,8 +38,6 @@ static void gpm_button_finalize (GObject *object); -#define GPM_BUTTON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_BUTTON, GpmButtonPrivate)) - struct GpmButtonPrivate { GdkScreen *screen; @@ -59,7 +57,7 @@ enum { static guint signals [LAST_SIGNAL] = { 0 }; static gpointer gpm_button_object = NULL; -G_DEFINE_TYPE (GpmButton, gpm_button, G_TYPE_OBJECT) +G_DEFINE_TYPE_WITH_PRIVATE (GpmButton, gpm_button, G_TYPE_OBJECT) #define GPM_BUTTON_DUPLICATE_TIMEOUT 0.125f @@ -239,7 +237,6 @@ gpm_button_class_init (GpmButtonClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); object_class->finalize = gpm_button_finalize; - g_type_class_add_private (klass, sizeof (GpmButtonPrivate)); signals [BUTTON_PRESSED] = g_signal_new ("button-pressed", @@ -358,7 +355,7 @@ gpm_button_client_changed_cb (UpClient *client, GpmButton *button) static void gpm_button_init (GpmButton *button) { - button->priv = GPM_BUTTON_GET_PRIVATE (button); + button->priv = gpm_button_get_instance_private (button); button->priv->screen = gdk_screen_get_default (); button->priv->window = gdk_screen_get_root_window (button->priv->screen); @@ -411,7 +408,7 @@ gpm_button_finalize (GObject *object) g_return_if_fail (GPM_IS_BUTTON (object)); button = GPM_BUTTON (object); - button->priv = GPM_BUTTON_GET_PRIVATE (button); + button->priv = gpm_button_get_instance_private (button); g_object_unref (button->priv->client); g_free (button->priv->last_button); |