summaryrefslogtreecommitdiff
path: root/src/gpm-dpms.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-08-14 14:00:57 +0200
committerVictor Kareh <[email protected]>2019-08-20 13:34:13 -0400
commit4815980393f19872fc21dfe200392160b9cb33bd (patch)
tree390df8ba07a34b2445de9dd529684fc58598a732 /src/gpm-dpms.c
parent45db2c0ab4de576e6bad5686a7144e6cfdf19150 (diff)
downloadmate-power-manager-4815980393f19872fc21dfe200392160b9cb33bd.tar.bz2
mate-power-manager-4815980393f19872fc21dfe200392160b9cb33bd.tar.xz
gpm-dpms: avoid 'g_type_class_add_private'
Diffstat (limited to 'src/gpm-dpms.c')
-rw-r--r--src/gpm-dpms.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/gpm-dpms.c b/src/gpm-dpms.c
index bb1e718..d0e4434 100644
--- a/src/gpm-dpms.c
+++ b/src/gpm-dpms.c
@@ -45,8 +45,6 @@
static void gpm_dpms_finalize (GObject *object);
-#define GPM_DPMS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_DPMS, GpmDpmsPrivate))
-
/* until we get a nice event-emitting DPMS extension, we have to poll... */
#define GPM_DPMS_POLL_TIME 10
@@ -66,7 +64,7 @@ enum {
static guint signals [LAST_SIGNAL] = { 0 };
static gpointer gpm_dpms_object = NULL;
-G_DEFINE_TYPE (GpmDpms, gpm_dpms, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GpmDpms, gpm_dpms, G_TYPE_OBJECT)
/**
* gpm_dpms_error_quark:
@@ -285,8 +283,6 @@ gpm_dpms_class_init (GpmDpmsClass *klass)
G_STRUCT_OFFSET (GpmDpmsClass, mode_changed),
NULL, NULL, g_cclosure_marshal_VOID__UINT,
G_TYPE_NONE, 1, G_TYPE_UINT);
-
- g_type_class_add_private (klass, sizeof (GpmDpmsPrivate));
}
/**
@@ -295,7 +291,7 @@ gpm_dpms_class_init (GpmDpmsClass *klass)
static void
gpm_dpms_init (GpmDpms *dpms)
{
- dpms->priv = GPM_DPMS_GET_PRIVATE (dpms);
+ dpms->priv = gpm_dpms_get_instance_private (dpms);
/* DPMSCapable() can never change for a given display */
dpms->priv->display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default());