summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-08-14 04:31:42 +0200
committerVictor Kareh <[email protected]>2019-08-20 13:34:13 -0400
commite5500ce4be1bf71a45b5521003775493ddc353ba (patch)
treeb2621b5bd617c2271cc2ef96ffc3edc635667469 /src
parent13098cb55071a3945c7f675028ce73a5c560ca4b (diff)
downloadmate-power-manager-e5500ce4be1bf71a45b5521003775493ddc353ba.tar.bz2
mate-power-manager-e5500ce4be1bf71a45b5521003775493ddc353ba.tar.xz
gpm-graph-widget: avoid 'g_type_class_add_private'
Diffstat (limited to 'src')
-rw-r--r--src/gpm-graph-widget.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gpm-graph-widget.c b/src/gpm-graph-widget.c
index a8acf46..3809d2b 100644
--- a/src/gpm-graph-widget.c
+++ b/src/gpm-graph-widget.c
@@ -34,8 +34,6 @@
#include "egg-color.h"
#include "egg-precision.h"
-G_DEFINE_TYPE (GpmGraphWidget, gpm_graph_widget, GTK_TYPE_DRAWING_AREA);
-#define GPM_GRAPH_WIDGET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPM_TYPE_GRAPH_WIDGET, GpmGraphWidgetPrivate))
#define GPM_GRAPH_WIDGET_FONT "Sans 8"
struct GpmGraphWidgetPrivate
@@ -70,6 +68,8 @@ struct GpmGraphWidgetPrivate
GPtrArray *plot_list;
};
+G_DEFINE_TYPE_WITH_PRIVATE (GpmGraphWidget, gpm_graph_widget, GTK_TYPE_DRAWING_AREA);
+
static gboolean gpm_graph_widget_draw (GtkWidget *graph, cairo_t *cr);
static void gpm_graph_widget_finalize (GObject *object);
@@ -239,8 +239,6 @@ gpm_graph_widget_class_init (GpmGraphWidgetClass *class)
object_class->set_property = up_graph_set_property;
object_class->finalize = gpm_graph_widget_finalize;
- g_type_class_add_private (class, sizeof (GpmGraphWidgetPrivate));
-
/* properties */
g_object_class_install_property (object_class,
PROP_USE_LEGEND,
@@ -309,7 +307,7 @@ gpm_graph_widget_init (GpmGraphWidget *graph)
PangoContext *context;
PangoFontDescription *desc;
- graph->priv = GPM_GRAPH_WIDGET_GET_PRIVATE (graph);
+ graph->priv = gpm_graph_widget_get_instance_private (graph);
graph->priv->start_x = 0;
graph->priv->start_y = 0;
graph->priv->stop_x = 60;