summaryrefslogtreecommitdiff
path: root/src/gpm-brightness.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-08-14 17:51:14 +0200
committerVictor Kareh <[email protected]>2019-08-20 13:34:13 -0400
commit7c79590fb5794592fff764b0e718a7e4e1103e3c (patch)
treea142e4c7280e5e742a9cf5111bbcc666f4981548 /src/gpm-brightness.c
parent2c4e0084e084c8c96ef5d595d5553b65f62a3c56 (diff)
downloadmate-power-manager-7c79590fb5794592fff764b0e718a7e4e1103e3c.tar.bz2
mate-power-manager-7c79590fb5794592fff764b0e718a7e4e1103e3c.tar.xz
gpm-brightness: avoid 'g_type_class_add_private'
Diffstat (limited to 'src/gpm-brightness.c')
-rw-r--r--src/gpm-brightness.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gpm-brightness.c b/src/gpm-brightness.c
index e2a1649..d749d96 100644
--- a/src/gpm-brightness.c
+++ b/src/gpm-brightness.c
@@ -47,7 +47,6 @@
#include "gpm-common.h"
#include "gpm-marshal.h"
-#define GPM_BRIGHTNESS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_BRIGHTNESS, GpmBrightnessPrivate))
#define GPM_SOLE_SETTER_USE_CACHE TRUE /* this may be insanity */
struct GpmBrightnessPrivate
@@ -80,7 +79,8 @@ typedef enum {
ACTION_BACKLIGHT_DEC
} GpmXRandROp;
-G_DEFINE_TYPE (GpmBrightness, gpm_brightness, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GpmBrightness, gpm_brightness, G_TYPE_OBJECT)
+
static guint signals [LAST_SIGNAL] = { 0 };
static gpointer gpm_brightness_object = NULL;
@@ -912,8 +912,6 @@ gpm_brightness_class_init (GpmBrightnessClass *klass)
G_STRUCT_OFFSET (GpmBrightnessClass, brightness_changed),
NULL, NULL, g_cclosure_marshal_VOID__UINT,
G_TYPE_NONE, 1, G_TYPE_UINT);
-
- g_type_class_add_private (klass, sizeof (GpmBrightnessPrivate));
}
/**
@@ -928,7 +926,7 @@ gpm_brightness_init (GpmBrightness *brightness)
int event_base;
int ignore;
- brightness->priv = GPM_BRIGHTNESS_GET_PRIVATE (brightness);
+ brightness->priv = gpm_brightness_get_instance_private (brightness);
brightness->priv->cache_trusted = FALSE;
brightness->priv->has_changed_events = FALSE;