summaryrefslogtreecommitdiff
path: root/baobab/src
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-08-23 15:31:39 +0200
committerlukefromdc <[email protected]>2019-09-02 23:58:10 +0000
commit86f3072999742cbaa961c7ec5e1325c0bf84d35e (patch)
treef1c934f5d23ef6eaf94fce5c7529026798eef94b /baobab/src
parent7331754ff707f1b494fa1b77b1bedab15ec0ae7f (diff)
downloadmate-utils-86f3072999742cbaa961c7ec5e1325c0bf84d35e.tar.bz2
mate-utils-86f3072999742cbaa961c7ec5e1325c0bf84d35e.tar.xz
baobab-treemap: avoid 'g_type_class_add_private'
Diffstat (limited to 'baobab/src')
-rw-r--r--baobab/src/baobab-treemap.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/baobab/src/baobab-treemap.c b/baobab/src/baobab-treemap.c
index 3acbf83d..787a5cc5 100644
--- a/baobab/src/baobab-treemap.c
+++ b/baobab/src/baobab-treemap.c
@@ -36,10 +36,6 @@
#include "baobab-chart.h"
#include "baobab-treemap.h"
-#define BAOBAB_TREEMAP_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- BAOBAB_TREEMAP_TYPE, \
- BaobabTreemapPrivate))
-
#define ITEM_TEXT_PADDING 3
#define ITEM_BORDER_WIDTH 1
#define ITEM_PADDING 6
@@ -49,14 +45,14 @@
#define ITEM_SHOW_LABEL TRUE
-G_DEFINE_TYPE (BaobabTreemap, baobab_treemap, BAOBAB_CHART_TYPE);
-
struct _BaobabTreemapPrivate
{
guint max_visible_depth;
gboolean more_visible_childs;
};
+G_DEFINE_TYPE_WITH_PRIVATE (BaobabTreemap, baobab_treemap, BAOBAB_CHART_TYPE);
+
static void baobab_treemap_class_init (BaobabTreemapClass *class);
static void baobab_treemap_init (BaobabTreemap *object);
static void baobab_treemap_draw_rectangle (GtkWidget *chart,
@@ -83,10 +79,8 @@ guint baobab_treemap_can_zoom_out (GtkWidget *chart);
static void
baobab_treemap_class_init (BaobabTreemapClass *class)
{
- GObjectClass *obj_class;
BaobabChartClass *chart_class;
- obj_class = G_OBJECT_CLASS (class);
chart_class = BAOBAB_CHART_CLASS (class);
/* BaobabChart abstract methods */
@@ -96,8 +90,6 @@ baobab_treemap_class_init (BaobabTreemapClass *class)
chart_class->get_item_rectangle = baobab_treemap_get_item_rectangle;
chart_class->can_zoom_in = baobab_treemap_can_zoom_in;
chart_class->can_zoom_out = baobab_treemap_can_zoom_out;
-
- g_type_class_add_private (obj_class, sizeof (BaobabTreemapPrivate));
}
static void
@@ -105,7 +97,7 @@ baobab_treemap_init (BaobabTreemap *chart)
{
BaobabTreemapPrivate *priv;
- priv = BAOBAB_TREEMAP_GET_PRIVATE (chart);
+ priv = baobab_treemap_get_instance_private (chart);
chart->priv = priv;
}