/* baobab-chart.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from baobab-chart.vala, do not modify */

/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* Baobab - disk usage analyzer
 *
 * Copyright (C) 2006, 2007, 2008  Igalia
 * Copyright (C) 2013  Stefano Facchini <stefano.facchini@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA  02110-1301  USA
 *
 * Authors of the original code:
 *   Felipe Erias <femorandeira@igalia.com>
 *   Pablo Santamaria <psantamaria@igalia.com>
 *   Jacobo Aragunde <jaragunde@igalia.com>
 *   Eduardo Lima <elima@igalia.com>
 *   Mario Sanchez <msanchez@igalia.com>
 *   Miguel Gomez <magomez@igalia.com>
 *   Henrique Ferreiro <hferreiro@igalia.com>
 *   Alejandro Pinheiro <apinheiro@igalia.com>
 *   Carlos Sanmartin <csanmartin@igalia.com>
 *   Alejandro Garcia <alex@igalia.com>
 */

#include "baobab.h"
#include <glib-object.h>
#include <gobject/gvaluecollector.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <gio/gio.h>
#include <cairo-gobject.h>
#include <float.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>

#define BAOBAB_CHART_NUM_COLORS 6
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _BaobabParamSpecChartItem BaobabParamSpecChartItem;
enum  {
	BAOBAB_CHART_0_PROPERTY,
	BAOBAB_CHART_LOCATION_PROPERTY,
	BAOBAB_CHART_MAX_DEPTH_PROPERTY,
	BAOBAB_CHART_MODEL_PROPERTY,
	BAOBAB_CHART_TREE_ROOT_PROPERTY,
	BAOBAB_CHART_HIGHLIGHTED_ITEM_PROPERTY,
	BAOBAB_CHART_NUM_PROPERTIES
};
static GParamSpec* baobab_chart_properties[BAOBAB_CHART_NUM_PROPERTIES];
#define _baobab_chart_item_unref0(var) ((var == NULL) ? NULL : (var = (baobab_chart_item_unref (var), NULL)))
#define _baobab_location_unref0(var) ((var == NULL) ? NULL : (var = (baobab_location_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	BAOBAB_CHART_ITEM_ACTIVATED_SIGNAL,
	BAOBAB_CHART_NUM_SIGNALS
};
static guint baobab_chart_signals[BAOBAB_CHART_NUM_SIGNALS] = {0};

struct _BaobabParamSpecChartItem {
	GParamSpec parent_instance;
};

struct _BaobabChartPrivate {
	gboolean model_changed;
	GtkPopoverMenu* context_menu;
	GtkEventControllerScroll* scroll_controller;
	GtkEventControllerMotion* motion_controller;
	GtkGestureClick* primary_click_gesture;
	GtkGestureClick* secondary_click_gesture;
	GtkGestureClick* middle_click_gesture;
	GdkRGBA chart_colors[BAOBAB_CHART_NUM_COLORS];
	GList* items;
	BaobabChartItem* popover_item;
	BaobabLocation* location_;
	guint max_depth_;
	GtkTreeListModel* model_;
	BaobabScannerResults* root_;
	BaobabChartItem* highlighted_item_;
	GSimpleActionGroup* action_group;
};

static gpointer baobab_chart_item_parent_class = NULL;
static gint BaobabChart_private_offset;
static gpointer baobab_chart_parent_class = NULL;

static void baobab_chart_item_finalize (BaobabChartItem * obj);
static GType baobab_chart_item_get_type_once (void);
static void _baobab_chart_open_file_gsimple_action_activate_callback (GSimpleAction* action,
                                                               GVariant* parameter,
                                                               gpointer self);
static void _baobab_chart_copy_path_gsimple_action_activate_callback (GSimpleAction* action,
                                                               GVariant* parameter,
                                                               gpointer self);
static void _baobab_chart_trash_file_gsimple_action_activate_callback (GSimpleAction* action,
                                                                GVariant* parameter,
                                                                gpointer self);
static void _baobab_chart_move_up_root_gsimple_action_activate_callback (GSimpleAction* action,
                                                                  GVariant* parameter,
                                                                  gpointer self);
static void _baobab_chart_zoom_in_gsimple_action_activate_callback (GSimpleAction* action,
                                                             GVariant* parameter,
                                                             gpointer self);
static void _baobab_chart_zoom_out_gsimple_action_activate_callback (GSimpleAction* action,
                                                              GVariant* parameter,
                                                              gpointer self);
static void _baobab_chart_item_unref0_ (gpointer var);
static inline void _g_list_free__baobab_chart_item_unref0_ (GList* self);
static void baobab_chart_real_post_draw (BaobabChart* self,
                                  cairo_t* cr);
static void baobab_chart_real_draw_item (BaobabChart* self,
                                  cairo_t* cr,
                                  BaobabChartItem* item,
                                  gboolean highlighted);
static void baobab_chart_real_calculate_item_geometry (BaobabChart* self,
                                                BaobabChartItem* item);
static gboolean baobab_chart_real_is_point_over_item (BaobabChart* self,
                                               BaobabChartItem* item,
                                               gdouble x,
                                               gdouble y);
static void baobab_chart_real_get_item_rectangle (BaobabChart* self,
                                           BaobabChartItem* item);
static gboolean baobab_chart_real_can_zoom_in (BaobabChart* self);
static gboolean baobab_chart_real_can_zoom_out (BaobabChart* self);
static BaobabChartItem* baobab_chart_real_create_new_chartitem (BaobabChart* self);
static void baobab_chart_real_size_allocate (GtkWidget* base,
                                      gint width,
                                      gint height,
                                      gint baseline);
static gboolean baobab_chart_highlight_item_at_point (BaobabChart* self,
                                               gdouble x,
                                               gdouble y);
static void baobab_chart_motion_cb (BaobabChart* self,
                             gdouble x,
                             gdouble y);
static void baobab_chart_enter_cb (BaobabChart* self,
                            gdouble x,
                            gdouble y);
static GList* baobab_chart_add_item (BaobabChart* self,
                              guint depth,
                              gdouble rel_start,
                              gdouble rel_size,
                              BaobabScannerResults* results);
static void baobab_chart_get_items (BaobabChart* self,
                             BaobabScannerResults* root_path);
static gint _____lambda13_ (BaobabChart* self,
                     BaobabScannerResults* a,
                     BaobabScannerResults* b);
static gint ______lambda13__gcompare_data_func (gconstpointer a,
                                         gconstpointer b,
                                         gpointer self);
static void baobab_chart_draw_chart (BaobabChart* self,
                              cairo_t* cr);
static void baobab_chart_update_draw (BaobabChart* self);
static void baobab_chart_items_changed (BaobabChart* self,
                                 guint position,
                                 guint removed,
                                 guint added);
static void baobab_chart_draw_func (BaobabChart* self,
                             GtkDrawingArea* da,
                             cairo_t* cr,
                             gint width,
                             gint height);
static void baobab_chart_interpolate_colors (BaobabChart* self,
                                      GdkRGBA* colora,
                                      GdkRGBA* colorb,
                                      gfloat percentage,
                                      GdkRGBA* result);
static gboolean baobab_chart_scroll_cb (BaobabChart* self,
                                 gdouble dx,
                                 gdouble dy);
static void baobab_chart_build_context_menu (BaobabChart* self);
static void baobab_chart_show_popover_at (BaobabChart* self,
                                   gint x,
                                   gint y);
static void baobab_chart_connect_model_signals (BaobabChart* self,
                                         GtkTreeListModel* m);
static void _baobab_chart_items_changed_g_list_model_items_changed (GListModel* _sender,
                                                             guint position,
                                                             guint removed,
                                                             guint added,
                                                             gpointer self);
static void baobab_chart_disconnect_model_signals (BaobabChart* self,
                                            GtkTreeListModel* m);
static gboolean baobab_chart_real_query_tooltip (GtkWidget* base,
                                          gint x,
                                          gint y,
                                          gboolean keyboard_tooltip,
                                          GtkTooltip* tooltip);
static GObject * baobab_chart_constructor (GType type,
                                    guint n_construct_properties,
                                    GObjectConstructParam * construct_properties);
static gboolean _baobab_chart_scroll_cb_gtk_event_controller_scroll_scroll (GtkEventControllerScroll* _sender,
                                                                     gdouble dx,
                                                                     gdouble dy,
                                                                     gpointer self);
static void _baobab_chart_motion_cb_gtk_event_controller_motion_motion (GtkEventControllerMotion* _sender,
                                                                 gdouble x,
                                                                 gdouble y,
                                                                 gpointer self);
static void _baobab_chart_enter_cb_gtk_event_controller_motion_enter (GtkEventControllerMotion* _sender,
                                                               gdouble x,
                                                               gdouble y,
                                                               gpointer self);
static void _baobab_chart___lambda14_ (BaobabChart* self,
                                gint _,
                                gdouble x,
                                gdouble y);
static void __baobab_chart___lambda14__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                           gint n_press,
                                                           gdouble x,
                                                           gdouble y,
                                                           gpointer self);
static void _baobab_chart___lambda15_ (BaobabChart* self,
                                gint _,
                                gdouble x,
                                gdouble y);
static void __baobab_chart___lambda15__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                           gint n_press,
                                                           gdouble x,
                                                           gdouble y,
                                                           gpointer self);
static void _baobab_chart___lambda16_ (BaobabChart* self,
                                gint _,
                                gdouble x,
                                gdouble y);
static void __baobab_chart___lambda16__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                           gint n_press,
                                                           gdouble x,
                                                           gdouble y,
                                                           gpointer self);
static void _baobab_chart_draw_func_gtk_drawing_area_draw_func (GtkDrawingArea* drawing_area,
                                                         cairo_t* cr,
                                                         gint width,
                                                         gint height,
                                                         gpointer self);
static void baobab_chart_finalize (GObject * obj);
static GType baobab_chart_get_type_once (void);
static void _vala_baobab_chart_get_property (GObject * object,
                                      guint property_id,
                                      GValue * value,
                                      GParamSpec * pspec);
static void _vala_baobab_chart_set_property (GObject * object,
                                      guint property_id,
                                      const GValue * value,
                                      GParamSpec * pspec);

static const GActionEntry BAOBAB_CHART_action_entries[6] = {{"open-file", _baobab_chart_open_file_gsimple_action_activate_callback}, {"copy-path", _baobab_chart_copy_path_gsimple_action_activate_callback}, {"trash-file", _baobab_chart_trash_file_gsimple_action_activate_callback}, {"move-up", _baobab_chart_move_up_root_gsimple_action_activate_callback}, {"zoom-in", _baobab_chart_zoom_in_gsimple_action_activate_callback}, {"zoom-out", _baobab_chart_zoom_out_gsimple_action_activate_callback}};

BaobabChartItem*
baobab_chart_item_construct (GType object_type)
{
	BaobabChartItem* self = NULL;
	self = (BaobabChartItem*) g_type_create_instance (object_type);
	return self;
}

static void
baobab_value_chart_item_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
baobab_value_chart_item_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		baobab_chart_item_unref (value->data[0].v_pointer);
	}
}

static void
baobab_value_chart_item_copy_value (const GValue* src_value,
                                    GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = baobab_chart_item_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
baobab_value_chart_item_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
baobab_value_chart_item_collect_value (GValue* value,
                                       guint n_collect_values,
                                       GTypeCValue* collect_values,
                                       guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		BaobabChartItem * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = baobab_chart_item_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
baobab_value_chart_item_lcopy_value (const GValue* value,
                                     guint n_collect_values,
                                     GTypeCValue* collect_values,
                                     guint collect_flags)
{
	BaobabChartItem ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = baobab_chart_item_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
baobab_param_spec_chart_item (const gchar* name,
                              const gchar* nick,
                              const gchar* blurb,
                              GType object_type,
                              GParamFlags flags)
{
	BaobabParamSpecChartItem* spec;
	g_return_val_if_fail (g_type_is_a (object_type, BAOBAB_TYPE_CHART_ITEM), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
baobab_value_get_chart_item (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, BAOBAB_TYPE_CHART_ITEM), NULL);
	return value->data[0].v_pointer;
}

void
baobab_value_set_chart_item (GValue* value,
                             gpointer v_object)
{
	BaobabChartItem * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, BAOBAB_TYPE_CHART_ITEM));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, BAOBAB_TYPE_CHART_ITEM));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		baobab_chart_item_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		baobab_chart_item_unref (old);
	}
}

void
baobab_value_take_chart_item (GValue* value,
                              gpointer v_object)
{
	BaobabChartItem * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, BAOBAB_TYPE_CHART_ITEM));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, BAOBAB_TYPE_CHART_ITEM));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		baobab_chart_item_unref (old);
	}
}

static void
baobab_chart_item_class_init (BaobabChartItemClass * klass,
                              gpointer klass_data)
{
	baobab_chart_item_parent_class = g_type_class_peek_parent (klass);
	((BaobabChartItemClass *) klass)->finalize = baobab_chart_item_finalize;
}

static void
baobab_chart_item_instance_init (BaobabChartItem * self,
                                 gpointer klass)
{
	self->ref_count = 1;
}

static void
baobab_chart_item_finalize (BaobabChartItem * obj)
{
	BaobabChartItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BAOBAB_TYPE_CHART_ITEM, BaobabChartItem);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->results);
}

static GType
baobab_chart_item_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { baobab_value_chart_item_init, baobab_value_chart_item_free_value, baobab_value_chart_item_copy_value, baobab_value_chart_item_peek_pointer, "p", baobab_value_chart_item_collect_value, "p", baobab_value_chart_item_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (BaobabChartItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) baobab_chart_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BaobabChartItem), 0, (GInstanceInitFunc) baobab_chart_item_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType baobab_chart_item_type_id;
	baobab_chart_item_type_id = g_type_register_fundamental (g_type_fundamental_next (), "BaobabChartItem", &g_define_type_info, &g_define_type_fundamental_info, G_TYPE_FLAG_ABSTRACT);
	return baobab_chart_item_type_id;
}

GType
baobab_chart_item_get_type (void)
{
	static volatile gsize baobab_chart_item_type_id__once = 0;
	if (g_once_init_enter (&baobab_chart_item_type_id__once)) {
		GType baobab_chart_item_type_id;
		baobab_chart_item_type_id = baobab_chart_item_get_type_once ();
		g_once_init_leave (&baobab_chart_item_type_id__once, baobab_chart_item_type_id);
	}
	return baobab_chart_item_type_id__once;
}

gpointer
baobab_chart_item_ref (gpointer instance)
{
	BaobabChartItem * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
baobab_chart_item_unref (gpointer instance)
{
	BaobabChartItem * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		BAOBAB_CHART_ITEM_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
baobab_chart_get_instance_private (BaobabChart* self)
{
	return G_STRUCT_MEMBER_P (self, BaobabChart_private_offset);
}

static void
_baobab_chart_open_file_gsimple_action_activate_callback (GSimpleAction* action,
                                                          GVariant* parameter,
                                                          gpointer self)
{
	baobab_chart_open_file ((BaobabChart*) self);
}

static void
_baobab_chart_copy_path_gsimple_action_activate_callback (GSimpleAction* action,
                                                          GVariant* parameter,
                                                          gpointer self)
{
	baobab_chart_copy_path ((BaobabChart*) self);
}

static void
_baobab_chart_trash_file_gsimple_action_activate_callback (GSimpleAction* action,
                                                           GVariant* parameter,
                                                           gpointer self)
{
	baobab_chart_trash_file ((BaobabChart*) self);
}

static void
_baobab_chart_move_up_root_gsimple_action_activate_callback (GSimpleAction* action,
                                                             GVariant* parameter,
                                                             gpointer self)
{
	baobab_chart_move_up_root ((BaobabChart*) self);
}

static void
_baobab_chart_zoom_in_gsimple_action_activate_callback (GSimpleAction* action,
                                                        GVariant* parameter,
                                                        gpointer self)
{
	baobab_chart_zoom_in ((BaobabChart*) self);
}

static void
_baobab_chart_zoom_out_gsimple_action_activate_callback (GSimpleAction* action,
                                                         GVariant* parameter,
                                                         gpointer self)
{
	baobab_chart_zoom_out ((BaobabChart*) self);
}

static void
_baobab_chart_item_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (baobab_chart_item_unref (var), NULL));
}

static inline void
_g_list_free__baobab_chart_item_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _baobab_chart_item_unref0_);
}

static void
baobab_chart_real_post_draw (BaobabChart* self,
                             cairo_t* cr)
{
	g_return_if_fail (cr != NULL);
}

void
baobab_chart_post_draw (BaobabChart* self,
                        cairo_t* cr)
{
	BaobabChartClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = BAOBAB_CHART_GET_CLASS (self);
	if (_klass_->post_draw) {
		_klass_->post_draw (self, cr);
	}
}

static void
baobab_chart_real_draw_item (BaobabChart* self,
                             cairo_t* cr,
                             BaobabChartItem* item,
                             gboolean highlighted)
{
	g_critical ("Type `%s' does not implement abstract method `baobab_chart_draw_item'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
baobab_chart_draw_item (BaobabChart* self,
                        cairo_t* cr,
                        BaobabChartItem* item,
                        gboolean highlighted)
{
	BaobabChartClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = BAOBAB_CHART_GET_CLASS (self);
	if (_klass_->draw_item) {
		_klass_->draw_item (self, cr, item, highlighted);
	}
}

static void
baobab_chart_real_calculate_item_geometry (BaobabChart* self,
                                           BaobabChartItem* item)
{
	g_critical ("Type `%s' does not implement abstract method `baobab_chart_calculate_item_geometry'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
baobab_chart_calculate_item_geometry (BaobabChart* self,
                                      BaobabChartItem* item)
{
	BaobabChartClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = BAOBAB_CHART_GET_CLASS (self);
	if (_klass_->calculate_item_geometry) {
		_klass_->calculate_item_geometry (self, item);
	}
}

static gboolean
baobab_chart_real_is_point_over_item (BaobabChart* self,
                                      BaobabChartItem* item,
                                      gdouble x,
                                      gdouble y)
{
	gboolean _tmp0_ = FALSE;
	g_critical ("Type `%s' does not implement abstract method `baobab_chart_is_point_over_item'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return _tmp0_;
}

gboolean
baobab_chart_is_point_over_item (BaobabChart* self,
                                 BaobabChartItem* item,
                                 gdouble x,
                                 gdouble y)
{
	BaobabChartClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = BAOBAB_CHART_GET_CLASS (self);
	if (_klass_->is_point_over_item) {
		return _klass_->is_point_over_item (self, item, x, y);
	}
	return FALSE;
}

static void
baobab_chart_real_get_item_rectangle (BaobabChart* self,
                                      BaobabChartItem* item)
{
	g_critical ("Type `%s' does not implement abstract method `baobab_chart_get_item_rectangle'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
baobab_chart_get_item_rectangle (BaobabChart* self,
                                 BaobabChartItem* item)
{
	BaobabChartClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = BAOBAB_CHART_GET_CLASS (self);
	if (_klass_->get_item_rectangle) {
		_klass_->get_item_rectangle (self, item);
	}
}

static gboolean
baobab_chart_real_can_zoom_in (BaobabChart* self)
{
	gboolean _tmp0_ = FALSE;
	g_critical ("Type `%s' does not implement abstract method `baobab_chart_can_zoom_in'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return _tmp0_;
}

gboolean
baobab_chart_can_zoom_in (BaobabChart* self)
{
	BaobabChartClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = BAOBAB_CHART_GET_CLASS (self);
	if (_klass_->can_zoom_in) {
		return _klass_->can_zoom_in (self);
	}
	return FALSE;
}

static gboolean
baobab_chart_real_can_zoom_out (BaobabChart* self)
{
	gboolean _tmp0_ = FALSE;
	g_critical ("Type `%s' does not implement abstract method `baobab_chart_can_zoom_out'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return _tmp0_;
}

gboolean
baobab_chart_can_zoom_out (BaobabChart* self)
{
	BaobabChartClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = BAOBAB_CHART_GET_CLASS (self);
	if (_klass_->can_zoom_out) {
		return _klass_->can_zoom_out (self);
	}
	return FALSE;
}

static BaobabChartItem*
baobab_chart_real_create_new_chartitem (BaobabChart* self)
{
	g_critical ("Type `%s' does not implement abstract method `baobab_chart_create_new_chartitem'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

BaobabChartItem*
baobab_chart_create_new_chartitem (BaobabChart* self)
{
	BaobabChartClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = BAOBAB_CHART_GET_CLASS (self);
	if (_klass_->create_new_chartitem) {
		return _klass_->create_new_chartitem (self);
	}
	return NULL;
}

static gpointer
_baobab_chart_item_ref0 (gpointer self)
{
	return self ? baobab_chart_item_ref (self) : NULL;
}

static void
baobab_chart_real_size_allocate (GtkWidget* base,
                                 gint width,
                                 gint height,
                                 gint baseline)
{
	BaobabChart * self;
	GList* _tmp0_;
	self = (BaobabChart*) base;
	GTK_WIDGET_CLASS (baobab_chart_parent_class)->size_allocate ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_drawing_area_get_type (), GtkDrawingArea), width, height, baseline);
	_tmp0_ = self->priv->items;
	{
		GList* item_collection = NULL;
		GList* item_it = NULL;
		item_collection = _tmp0_;
		for (item_it = item_collection; item_it != NULL; item_it = item_it->next) {
			BaobabChartItem* _tmp1_;
			BaobabChartItem* item = NULL;
			_tmp1_ = _baobab_chart_item_ref0 ((BaobabChartItem*) item_it->data);
			item = _tmp1_;
			{
				BaobabChartItem* _tmp2_;
				BaobabChartItem* _tmp3_;
				BaobabChartItem* _tmp4_;
				_tmp2_ = item;
				_tmp2_->has_visible_children = FALSE;
				_tmp3_ = item;
				_tmp3_->visible = FALSE;
				_tmp4_ = item;
				baobab_chart_calculate_item_geometry (self, _tmp4_);
				_baobab_chart_item_unref0 (item);
			}
		}
	}
}

static gboolean
baobab_chart_highlight_item_at_point (BaobabChart* self,
                                      gdouble x,
                                      gdouble y)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	{
		GList* node = NULL;
		GList* _tmp0_;
		GList* _tmp1_;
		_tmp0_ = self->priv->items;
		_tmp1_ = g_list_last (_tmp0_);
		node = _tmp1_;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				GList* _tmp5_;
				BaobabChartItem* item = NULL;
				GList* _tmp6_;
				gconstpointer _tmp7_;
				BaobabChartItem* _tmp8_;
				gboolean _tmp9_ = FALSE;
				BaobabChartItem* _tmp10_;
				if (!_tmp2_) {
					GList* _tmp3_;
					GList* _tmp4_;
					_tmp3_ = node;
					_tmp4_ = _tmp3_->prev;
					node = _tmp4_;
				}
				_tmp2_ = FALSE;
				_tmp5_ = node;
				if (!(_tmp5_ != NULL)) {
					break;
				}
				_tmp6_ = node;
				_tmp7_ = _tmp6_->data;
				_tmp8_ = _baobab_chart_item_ref0 ((BaobabChartItem*) _tmp7_);
				item = _tmp8_;
				_tmp10_ = item;
				if (_tmp10_->visible) {
					BaobabChartItem* _tmp11_;
					_tmp11_ = item;
					_tmp9_ = baobab_chart_is_point_over_item (self, _tmp11_, x, y);
				} else {
					_tmp9_ = FALSE;
				}
				if (_tmp9_) {
					BaobabChartItem* _tmp12_;
					_tmp12_ = item;
					baobab_chart_set_highlighted_item (self, _tmp12_);
					result = TRUE;
					_baobab_chart_item_unref0 (item);
					return result;
				}
				_baobab_chart_item_unref0 (item);
			}
		}
	}
	baobab_chart_set_highlighted_item (self, NULL);
	result = FALSE;
	return result;
}

static void
baobab_chart_motion_cb (BaobabChart* self,
                        gdouble x,
                        gdouble y)
{
	g_return_if_fail (self != NULL);
	gtk_widget_set_has_tooltip ((GtkWidget*) self, baobab_chart_highlight_item_at_point (self, x, y));
}

static void
baobab_chart_enter_cb (BaobabChart* self,
                       gdouble x,
                       gdouble y)
{
	GtkPopoverMenu* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->context_menu;
	_tmp1_ = gtk_widget_get_visible ((GtkWidget*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		gtk_widget_set_has_tooltip ((GtkWidget*) self, baobab_chart_highlight_item_at_point (self, x, y));
	}
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static GList*
baobab_chart_add_item (BaobabChart* self,
                       guint depth,
                       gdouble rel_start,
                       gdouble rel_size,
                       BaobabScannerResults* results)
{
	BaobabChartItem* item = NULL;
	BaobabChartItem* _tmp0_;
	BaobabScannerResults* _tmp1_;
	BaobabChartItem* _tmp2_;
	GList* ret = NULL;
	GList* _tmp3_;
	GList* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (results != NULL, NULL);
	_tmp0_ = baobab_chart_create_new_chartitem (self);
	item = _tmp0_;
	item->depth = depth;
	item->rel_start = rel_start;
	item->rel_size = rel_size;
	item->visible = FALSE;
	item->has_visible_children = FALSE;
	_tmp1_ = _g_object_ref0 (results);
	_g_object_unref0 (item->results);
	item->results = _tmp1_;
	item->parent = NULL;
	_tmp2_ = _baobab_chart_item_ref0 (item);
	self->priv->items = g_list_prepend (self->priv->items, _tmp2_);
	_tmp3_ = self->priv->items;
	ret = _tmp3_;
	result = ret;
	_baobab_chart_item_unref0 (item);
	return result;
}

static gint
_____lambda13_ (BaobabChart* self,
                BaobabScannerResults* a,
                BaobabScannerResults* b)
{
	gint _tmp0_ = 0;
	guint64 _tmp1_;
	guint64 _tmp2_;
	guint64 _tmp3_;
	guint64 _tmp4_;
	gint result;
	g_return_val_if_fail (a != NULL, 0);
	g_return_val_if_fail (b != NULL, 0);
	_tmp1_ = baobab_scanner_results_get_size (a);
	_tmp2_ = _tmp1_;
	_tmp3_ = baobab_scanner_results_get_size (b);
	_tmp4_ = _tmp3_;
	if (_tmp2_ < _tmp4_) {
		_tmp0_ = 1;
	} else {
		gint _tmp5_ = 0;
		guint64 _tmp6_;
		guint64 _tmp7_;
		guint64 _tmp8_;
		guint64 _tmp9_;
		_tmp6_ = baobab_scanner_results_get_size (a);
		_tmp7_ = _tmp6_;
		_tmp8_ = baobab_scanner_results_get_size (b);
		_tmp9_ = _tmp8_;
		if (_tmp7_ > _tmp9_) {
			_tmp5_ = -1;
		} else {
			_tmp5_ = 0;
		}
		_tmp0_ = _tmp5_;
	}
	result = _tmp0_;
	return result;
}

static gint
______lambda13__gcompare_data_func (gconstpointer a,
                                    gconstpointer b,
                                    gpointer self)
{
	gint result;
	result = _____lambda13_ ((BaobabChart*) self, (BaobabScannerResults*) a, (BaobabScannerResults*) b);
	return result;
}

static void
baobab_chart_get_items (BaobabChart* self,
                        BaobabScannerResults* root_path)
{
	GList* node = NULL;
	GList* _tmp0_;
	g_return_if_fail (self != NULL);
	(self->priv->items == NULL) ? NULL : (self->priv->items = (_g_list_free__baobab_chart_item_unref0_ (self->priv->items), NULL));
	self->priv->items = NULL;
	if (root_path == NULL) {
		self->priv->model_changed = FALSE;
		return;
	}
	_tmp0_ = baobab_chart_add_item (self, (guint) 0, (gdouble) 0, (gdouble) 100, root_path);
	node = _tmp0_;
	{
		gboolean _tmp1_ = FALSE;
		_tmp1_ = TRUE;
		while (TRUE) {
			BaobabChartItem* item = NULL;
			GList* _tmp3_;
			gconstpointer _tmp4_;
			BaobabChartItem* _tmp5_;
			BaobabChartItem* _tmp6_;
			BaobabChartItem* _tmp7_;
			gboolean _tmp10_ = FALSE;
			BaobabChartItem* _tmp11_;
			BaobabScannerResults* _tmp12_;
			gboolean _tmp13_;
			gboolean _tmp14_;
			GList* _tmp50_;
			GList* _tmp51_;
			if (!_tmp1_) {
				GList* _tmp2_;
				_tmp2_ = node;
				if (!(_tmp2_ != NULL)) {
					break;
				}
			}
			_tmp1_ = FALSE;
			_tmp3_ = node;
			_tmp4_ = _tmp3_->data;
			_tmp5_ = _baobab_chart_item_ref0 ((BaobabChartItem*) _tmp4_);
			item = _tmp5_;
			_tmp6_ = item;
			baobab_chart_calculate_item_geometry (self, _tmp6_);
			_tmp7_ = item;
			if (!_tmp7_->visible) {
				GList* _tmp8_;
				GList* _tmp9_;
				_tmp8_ = node;
				_tmp9_ = _tmp8_->prev;
				node = _tmp9_;
				_baobab_chart_item_unref0 (item);
				continue;
			}
			_tmp11_ = item;
			_tmp12_ = _tmp11_->results;
			_tmp13_ = baobab_scanner_results_get_is_empty (_tmp12_);
			_tmp14_ = _tmp13_;
			if (!_tmp14_) {
				BaobabChartItem* _tmp15_;
				guint _tmp16_;
				guint _tmp17_;
				_tmp15_ = item;
				_tmp16_ = baobab_chart_get_max_depth (self);
				_tmp17_ = _tmp16_;
				_tmp10_ = _tmp15_->depth < (_tmp17_ + 1);
			} else {
				_tmp10_ = FALSE;
			}
			if (_tmp10_) {
				gdouble rel_start = 0.0;
				GCompareDataFunc reverse_size_cmp = NULL;
				gpointer reverse_size_cmp_target;
				GDestroyNotify reverse_size_cmp_target_destroy_notify;
				GtkCustomSorter* sorter = NULL;
				GCompareDataFunc _tmp18_;
				gpointer _tmp18__target;
				GtkCustomSorter* _tmp19_;
				GtkSortListModel* sorted = NULL;
				BaobabChartItem* _tmp20_;
				BaobabScannerResults* _tmp21_;
				GListStore* _tmp22_;
				GListStore* _tmp23_;
				GListModel* _tmp24_;
				GtkCustomSorter* _tmp25_;
				GtkSorter* _tmp26_;
				GtkSortListModel* _tmp27_;
				rel_start = (gdouble) 0;
				reverse_size_cmp = ______lambda13__gcompare_data_func;
				reverse_size_cmp_target = g_object_ref (self);
				reverse_size_cmp_target_destroy_notify = g_object_unref;
				_tmp18_ = reverse_size_cmp;
				_tmp18__target = reverse_size_cmp_target;
				_tmp19_ = gtk_custom_sorter_new (_tmp18_, _tmp18__target, NULL);
				sorter = _tmp19_;
				_tmp20_ = item;
				_tmp21_ = _tmp20_->results;
				_tmp22_ = baobab_scanner_results_get_children_list_store (_tmp21_);
				_tmp23_ = _tmp22_;
				_tmp24_ = _g_object_ref0 ((GListModel*) _tmp23_);
				_tmp25_ = sorter;
				_tmp26_ = _g_object_ref0 ((GtkSorter*) _tmp25_);
				_tmp27_ = gtk_sort_list_model_new (_tmp24_, _tmp26_);
				sorted = _tmp27_;
				{
					gint i = 0;
					i = 0;
					{
						gboolean _tmp28_ = FALSE;
						_tmp28_ = TRUE;
						while (TRUE) {
							GtkSortListModel* _tmp30_;
							guint _tmp31_;
							guint _tmp32_;
							BaobabScannerResults* child_iter = NULL;
							GtkSortListModel* _tmp33_;
							GObject* _tmp34_;
							BaobabScannerResults* _tmp35_;
							GList* child_node = NULL;
							BaobabChartItem* _tmp36_;
							BaobabScannerResults* _tmp37_;
							gdouble _tmp38_;
							gdouble _tmp39_;
							BaobabScannerResults* _tmp40_;
							GList* _tmp41_;
							BaobabChartItem* child = NULL;
							GList* _tmp42_;
							gconstpointer _tmp43_;
							BaobabChartItem* _tmp44_;
							BaobabChartItem* _tmp45_;
							GList* _tmp46_;
							BaobabScannerResults* _tmp47_;
							gdouble _tmp48_;
							gdouble _tmp49_;
							if (!_tmp28_) {
								gint _tmp29_;
								_tmp29_ = i;
								i = _tmp29_ + 1;
							}
							_tmp28_ = FALSE;
							_tmp30_ = sorted;
							g_object_get (_tmp30_, "n-items", &_tmp31_, NULL);
							_tmp32_ = _tmp31_;
							if (!(((guint) i) < _tmp32_)) {
								break;
							}
							_tmp33_ = sorted;
							_tmp34_ = g_list_model_get_object ((GListModel*) _tmp33_, (guint) i);
							_tmp35_ = BAOBAB_SCANNER_IS_RESULTS (_tmp34_) ? ((BaobabScannerResults*) _tmp34_) : NULL;
							if (_tmp35_ == NULL) {
								_g_object_unref0 (_tmp34_);
							}
							child_iter = _tmp35_;
							_tmp36_ = item;
							_tmp37_ = child_iter;
							_tmp38_ = baobab_scanner_results_get_percent (_tmp37_);
							_tmp39_ = _tmp38_;
							_tmp40_ = child_iter;
							_tmp41_ = baobab_chart_add_item (self, _tmp36_->depth + 1, rel_start, _tmp39_, _tmp40_);
							child_node = _tmp41_;
							_tmp42_ = child_node;
							_tmp43_ = _tmp42_->data;
							_tmp44_ = _baobab_chart_item_ref0 ((BaobabChartItem*) _tmp43_);
							child = _tmp44_;
							_tmp45_ = child;
							_tmp46_ = node;
							_tmp45_->parent = _tmp46_;
							_tmp47_ = child_iter;
							_tmp48_ = baobab_scanner_results_get_percent (_tmp47_);
							_tmp49_ = _tmp48_;
							rel_start += _tmp49_;
							_baobab_chart_item_unref0 (child);
							_g_object_unref0 (child_iter);
						}
					}
				}
				_g_object_unref0 (sorted);
				_g_object_unref0 (sorter);
				(reverse_size_cmp_target_destroy_notify == NULL) ? NULL : (reverse_size_cmp_target_destroy_notify (reverse_size_cmp_target), NULL);
				reverse_size_cmp = NULL;
				reverse_size_cmp_target = NULL;
				reverse_size_cmp_target_destroy_notify = NULL;
			}
			_tmp50_ = node;
			_tmp51_ = _tmp50_->prev;
			node = _tmp51_;
			_baobab_chart_item_unref0 (item);
		}
	}
	self->priv->items = g_list_reverse (self->priv->items);
	self->priv->model_changed = FALSE;
}

static void
baobab_chart_draw_chart (BaobabChart* self,
                         cairo_t* cr)
{
	GList* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (cr != NULL);
	cairo_save (cr);
	_tmp0_ = self->priv->items;
	{
		GList* item_collection = NULL;
		GList* item_it = NULL;
		item_collection = _tmp0_;
		for (item_it = item_collection; item_it != NULL; item_it = item_it->next) {
			BaobabChartItem* _tmp1_;
			BaobabChartItem* item = NULL;
			_tmp1_ = _baobab_chart_item_ref0 ((BaobabChartItem*) item_it->data);
			item = _tmp1_;
			{
				gboolean _tmp2_ = FALSE;
				BaobabChartItem* _tmp3_;
				_tmp3_ = item;
				if (_tmp3_->visible) {
					BaobabChartItem* _tmp4_;
					guint _tmp5_;
					guint _tmp6_;
					_tmp4_ = item;
					_tmp5_ = baobab_chart_get_max_depth (self);
					_tmp6_ = _tmp5_;
					_tmp2_ = _tmp4_->depth <= _tmp6_;
				} else {
					_tmp2_ = FALSE;
				}
				if (_tmp2_) {
					gboolean highlighted = FALSE;
					BaobabChartItem* _tmp7_;
					BaobabChartItem* _tmp8_;
					BaobabChartItem* _tmp9_;
					BaobabChartItem* _tmp10_;
					_tmp7_ = item;
					_tmp8_ = baobab_chart_get_highlighted_item (self);
					_tmp9_ = _tmp8_;
					highlighted = _tmp7_ == _tmp9_;
					_tmp10_ = item;
					baobab_chart_draw_item (self, cr, _tmp10_, highlighted);
				}
				_baobab_chart_item_unref0 (item);
			}
		}
	}
	cairo_restore (cr);
	baobab_chart_post_draw (self, cr);
}

static void
baobab_chart_update_draw (BaobabChart* self)
{
	g_return_if_fail (self != NULL);
	if (!gtk_widget_get_realized ((GtkWidget*) self)) {
		return;
	}
	gtk_widget_queue_draw ((GtkWidget*) self);
}

static void
baobab_chart_items_changed (BaobabChart* self,
                            guint position,
                            guint removed,
                            guint added)
{
	g_return_if_fail (self != NULL);
	self->priv->model_changed = TRUE;
	baobab_chart_update_draw (self);
}

static void
baobab_chart_draw_func (BaobabChart* self,
                        GtkDrawingArea* da,
                        cairo_t* cr,
                        gint width,
                        gint height)
{
	GtkTreeListModel* _tmp0_;
	GtkTreeListModel* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (da != NULL);
	g_return_if_fail (cr != NULL);
	_tmp0_ = baobab_chart_get_model (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		gboolean _tmp2_ = FALSE;
		if (self->priv->model_changed) {
			_tmp2_ = TRUE;
		} else {
			GList* _tmp3_;
			_tmp3_ = self->priv->items;
			_tmp2_ = _tmp3_ == NULL;
		}
		if (_tmp2_) {
			BaobabScannerResults* _tmp4_;
			BaobabScannerResults* _tmp5_;
			BaobabScannerResults* _tmp6_;
			_tmp4_ = baobab_chart_get_tree_root (self);
			_tmp5_ = _tmp4_;
			_tmp6_ = _tmp5_;
			baobab_chart_get_items (self, _tmp6_);
			_g_object_unref0 (_tmp6_);
		} else {
			BaobabScannerResults* current_path = NULL;
			GList* _tmp7_;
			gconstpointer _tmp8_;
			BaobabScannerResults* _tmp9_;
			BaobabScannerResults* _tmp10_;
			BaobabScannerResults* _tmp11_;
			BaobabScannerResults* _tmp12_;
			BaobabScannerResults* _tmp13_;
			BaobabScannerResults* _tmp14_;
			gboolean _tmp15_;
			_tmp7_ = self->priv->items;
			_tmp8_ = _tmp7_->data;
			_tmp9_ = ((BaobabChartItem*) _tmp8_)->results;
			_tmp10_ = _g_object_ref0 (_tmp9_);
			current_path = _tmp10_;
			_tmp11_ = baobab_chart_get_tree_root (self);
			_tmp12_ = _tmp11_;
			_tmp13_ = _tmp12_;
			_tmp14_ = current_path;
			_tmp15_ = _tmp13_ != _tmp14_;
			_g_object_unref0 (_tmp13_);
			if (_tmp15_) {
				BaobabScannerResults* _tmp16_;
				BaobabScannerResults* _tmp17_;
				BaobabScannerResults* _tmp18_;
				_tmp16_ = baobab_chart_get_tree_root (self);
				_tmp17_ = _tmp16_;
				_tmp18_ = _tmp17_;
				baobab_chart_get_items (self, _tmp18_);
				_g_object_unref0 (_tmp18_);
			}
			_g_object_unref0 (current_path);
		}
		baobab_chart_draw_chart (self, cr);
	}
}

static void
baobab_chart_interpolate_colors (BaobabChart* self,
                                 GdkRGBA* colora,
                                 GdkRGBA* colorb,
                                 gfloat percentage,
                                 GdkRGBA* result)
{
	GdkRGBA color = {0};
	gfloat diff = 0.0F;
	GdkRGBA _tmp0_;
	GdkRGBA _tmp1_;
	GdkRGBA _tmp2_;
	GdkRGBA _tmp3_;
	GdkRGBA _tmp4_;
	GdkRGBA _tmp5_;
	GdkRGBA _tmp6_;
	GdkRGBA _tmp7_;
	GdkRGBA _tmp8_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (colora != NULL);
	g_return_if_fail (colorb != NULL);
	memset (&color, 0, sizeof (GdkRGBA));
	_tmp0_ = *colora;
	_tmp1_ = *colorb;
	diff = _tmp0_.red - _tmp1_.red;
	_tmp2_ = *colora;
	color.red = _tmp2_.red - (diff * percentage);
	_tmp3_ = *colora;
	_tmp4_ = *colorb;
	diff = _tmp3_.green - _tmp4_.green;
	_tmp5_ = *colora;
	color.green = _tmp5_.green - (diff * percentage);
	_tmp6_ = *colora;
	_tmp7_ = *colorb;
	diff = _tmp6_.blue - _tmp7_.blue;
	_tmp8_ = *colora;
	color.blue = _tmp8_.blue - (diff * percentage);
	color.alpha = (gfloat) 1.0;
	*result = color;
	return;
}

void
baobab_chart_get_item_color (BaobabChart* self,
                             gdouble rel_position,
                             guint depth,
                             gboolean highlighted,
                             GdkRGBA* result)
{
	GdkRGBA color = {0};
	gfloat intensity = 0.0F;
	g_return_if_fail (self != NULL);
	memset (&color, 0, sizeof (GdkRGBA));
	intensity = (gfloat) (1 - (((depth - 1) * 0.3) / BAOBAB_CHART_MAX_DEPTH));
	if (depth == ((guint) 0)) {
		gdk_rgba_parse (&color, "#d3d6d1");
	} else {
		GdkRGBA color_a = {0};
		GdkRGBA color_b = {0};
		gint color_number = 0;
		gint next_color_number = 0;
		GdkRGBA _tmp0_;
		GdkRGBA _tmp1_;
		GdkRGBA _tmp2_;
		GdkRGBA _tmp3_;
		GdkRGBA _tmp4_ = {0};
		memset (&color_a, 0, sizeof (GdkRGBA));
		memset (&color_b, 0, sizeof (GdkRGBA));
		color_number = (gint) (rel_position / (100.0 / 3));
		next_color_number = (color_number + 1) % BAOBAB_CHART_NUM_COLORS;
		_tmp0_ = self->priv->chart_colors[color_number];
		color_a = _tmp0_;
		_tmp1_ = self->priv->chart_colors[next_color_number];
		color_b = _tmp1_;
		_tmp2_ = color_a;
		_tmp3_ = color_b;
		baobab_chart_interpolate_colors (self, &_tmp2_, &_tmp3_, ((gfloat) (rel_position - ((color_number * 100) / 3))) / (100 / 3), &_tmp4_);
		color = _tmp4_;
		color.red = color.red * intensity;
		color.green = color.green * intensity;
		color.blue = color.blue * intensity;
	}
	if (highlighted) {
		if (depth == ((guint) 0)) {
			gdk_rgba_parse (&color, "#e0e2dd");
		} else {
			gfloat maximum = 0.0F;
			GdkRGBA _tmp5_;
			GdkRGBA _tmp6_;
			GdkRGBA _tmp7_;
			_tmp5_ = color;
			_tmp6_ = color;
			_tmp7_ = color;
			maximum = MAX (_tmp5_.red, MAX (_tmp6_.green, _tmp7_.blue));
			color.red = color.red / maximum;
			color.green = color.green / maximum;
			color.blue = color.blue / maximum;
		}
	}
	*result = color;
	return;
}

static gboolean
baobab_chart_scroll_cb (BaobabChart* self,
                        gdouble dx,
                        gdouble dy)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (dx > 0.0) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = dy < 0.0;
	}
	if (_tmp0_) {
		baobab_chart_zoom_out (self);
		result = TRUE;
		return result;
	} else {
		gboolean _tmp1_ = FALSE;
		if (dx < 0.0) {
			_tmp1_ = TRUE;
		} else {
			_tmp1_ = dy > 0.0;
		}
		if (_tmp1_) {
			baobab_chart_zoom_in (self);
			result = TRUE;
			return result;
		}
	}
	result = FALSE;
	return result;
}

void
baobab_chart_open_file (BaobabChart* self)
{
	GtkRoot* _tmp0_;
	BaobabChartItem* _tmp1_;
	BaobabScannerResults* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_widget_get_root ((GtkWidget*) self);
	_tmp1_ = self->priv->popover_item;
	_tmp2_ = _tmp1_->results;
	baobab_window_open_item (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, BAOBAB_TYPE_WINDOW, BaobabWindow), _tmp2_);
}

void
baobab_chart_copy_path (BaobabChart* self)
{
	GtkRoot* _tmp0_;
	BaobabChartItem* _tmp1_;
	BaobabScannerResults* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_widget_get_root ((GtkWidget*) self);
	_tmp1_ = self->priv->popover_item;
	_tmp2_ = _tmp1_->results;
	baobab_window_copy_path (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, BAOBAB_TYPE_WINDOW, BaobabWindow), _tmp2_);
}

void
baobab_chart_trash_file (BaobabChart* self)
{
	GtkRoot* _tmp0_;
	BaobabChartItem* _tmp1_;
	BaobabScannerResults* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_widget_get_root ((GtkWidget*) self);
	_tmp1_ = self->priv->popover_item;
	_tmp2_ = _tmp1_->results;
	baobab_window_trash_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, BAOBAB_TYPE_WINDOW, BaobabWindow), _tmp2_);
}

gboolean
baobab_chart_can_move_up_root (BaobabChart* self)
{
	BaobabScannerResults* _tmp0_;
	BaobabScannerResults* _tmp1_;
	BaobabScannerResults* _tmp2_;
	BaobabScannerResults* _tmp3_;
	BaobabScannerResults* _tmp4_;
	gboolean _tmp5_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = baobab_chart_get_tree_root (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = baobab_scanner_results_get_parent (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_ != NULL;
	_g_object_unref0 (_tmp2_);
	result = _tmp5_;
	return result;
}

void
baobab_chart_move_up_root (BaobabChart* self)
{
	BaobabScannerResults* _tmp0_;
	BaobabScannerResults* _tmp1_;
	BaobabScannerResults* _tmp2_;
	BaobabScannerResults* _tmp3_;
	BaobabScannerResults* _tmp4_;
	gboolean _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = baobab_chart_get_tree_root (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = baobab_scanner_results_get_parent (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_ != NULL;
	_g_object_unref0 (_tmp2_);
	if (_tmp5_) {
		BaobabScannerResults* _tmp6_;
		BaobabScannerResults* _tmp7_;
		BaobabScannerResults* _tmp8_;
		BaobabScannerResults* _tmp9_;
		BaobabScannerResults* _tmp10_;
		BaobabScannerResults* _tmp11_;
		BaobabScannerResults* _tmp12_;
		BaobabScannerResults* _tmp13_;
		_tmp6_ = baobab_chart_get_tree_root (self);
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_;
		_tmp9_ = baobab_scanner_results_get_parent (_tmp8_);
		_tmp10_ = _tmp9_;
		baobab_chart_set_tree_root (self, _tmp10_);
		_g_object_unref0 (_tmp8_);
		_tmp11_ = baobab_chart_get_tree_root (self);
		_tmp12_ = _tmp11_;
		_tmp13_ = _tmp12_;
		g_signal_emit (self, baobab_chart_signals[BAOBAB_CHART_ITEM_ACTIVATED_SIGNAL], 0, _tmp13_);
		_g_object_unref0 (_tmp13_);
	}
}

void
baobab_chart_zoom_in (BaobabChart* self)
{
	g_return_if_fail (self != NULL);
	if (baobab_chart_can_zoom_in (self)) {
		guint _tmp0_;
		guint _tmp1_;
		_tmp0_ = baobab_chart_get_max_depth (self);
		_tmp1_ = _tmp0_;
		baobab_chart_set_max_depth (self, _tmp1_ - 1);
	}
}

void
baobab_chart_zoom_out (BaobabChart* self)
{
	g_return_if_fail (self != NULL);
	if (baobab_chart_can_zoom_out (self)) {
		guint _tmp0_;
		guint _tmp1_;
		_tmp0_ = baobab_chart_get_max_depth (self);
		_tmp1_ = _tmp0_;
		baobab_chart_set_max_depth (self, _tmp1_ + 1);
	}
}

static void
baobab_chart_build_context_menu (BaobabChart* self)
{
	GMenu* menu_model = NULL;
	BaobabApplication* _tmp0_;
	BaobabApplication* _tmp1_;
	GMenu* _tmp2_;
	GMenu* _tmp3_;
	GMenu* _tmp4_;
	GtkPopoverMenu* _tmp5_;
	GtkPopoverMenu* _tmp6_;
	GtkPopoverMenu* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = baobab_application_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = gtk_application_get_menu_by_id ((GtkApplication*) _tmp1_, "chartmenu");
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_tmp4_ = _tmp3_;
	_g_object_unref0 (_tmp1_);
	menu_model = _tmp4_;
	_tmp5_ = (GtkPopoverMenu*) gtk_popover_menu_new_from_model ((GMenuModel*) menu_model);
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->priv->context_menu);
	self->priv->context_menu = _tmp5_;
	_tmp6_ = self->priv->context_menu;
	gtk_widget_set_parent ((GtkWidget*) _tmp6_, (GtkWidget*) self);
	_tmp7_ = self->priv->context_menu;
	gtk_popover_set_position ((GtkPopover*) _tmp7_, GTK_POS_BOTTOM);
	_g_object_unref0 (menu_model);
}

static void
baobab_chart_show_popover_at (BaobabChart* self,
                              gint x,
                              gint y)
{
	gboolean enable = FALSE;
	BaobabChartItem* _tmp0_;
	BaobabChartItem* _tmp1_;
	BaobabChartItem* _tmp2_;
	BaobabChartItem* _tmp3_;
	BaobabChartItem* _tmp4_;
	GSimpleAction* action = NULL;
	GSimpleActionGroup* _tmp5_;
	GAction* _tmp6_;
	GSimpleAction* _tmp7_;
	GSimpleAction* _tmp8_;
	GSimpleActionGroup* _tmp9_;
	GAction* _tmp10_;
	GSimpleAction* _tmp11_;
	GSimpleAction* _tmp12_;
	GSimpleActionGroup* _tmp13_;
	GAction* _tmp14_;
	GSimpleAction* _tmp15_;
	GSimpleAction* _tmp16_;
	GSimpleActionGroup* _tmp17_;
	GAction* _tmp18_;
	GSimpleAction* _tmp19_;
	GSimpleAction* _tmp20_;
	GSimpleActionGroup* _tmp21_;
	GAction* _tmp22_;
	GSimpleAction* _tmp23_;
	GSimpleAction* _tmp24_;
	GSimpleActionGroup* _tmp25_;
	GAction* _tmp26_;
	GSimpleAction* _tmp27_;
	GSimpleAction* _tmp28_;
	GdkRectangle rect = {0};
	GdkRectangle _tmp29_ = {0};
	GtkPopoverMenu* _tmp30_;
	GdkRectangle _tmp31_;
	GtkPopoverMenu* _tmp32_;
	g_return_if_fail (self != NULL);
	_tmp0_ = baobab_chart_get_highlighted_item (self);
	_tmp1_ = _tmp0_;
	enable = _tmp1_ != NULL;
	_tmp2_ = baobab_chart_get_highlighted_item (self);
	_tmp3_ = _tmp2_;
	_tmp4_ = _baobab_chart_item_ref0 (_tmp3_);
	_baobab_chart_item_unref0 (self->priv->popover_item);
	self->priv->popover_item = _tmp4_;
	_tmp5_ = self->priv->action_group;
	_tmp6_ = g_action_map_lookup_action ((GActionMap*) _tmp5_, "open-file");
	_tmp7_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp6_) : NULL);
	action = _tmp7_;
	_tmp8_ = action;
	g_simple_action_set_enabled (_tmp8_, enable);
	_tmp9_ = self->priv->action_group;
	_tmp10_ = g_action_map_lookup_action ((GActionMap*) _tmp9_, "copy-path");
	_tmp11_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp10_) : NULL);
	_g_object_unref0 (action);
	action = _tmp11_;
	_tmp12_ = action;
	g_simple_action_set_enabled (_tmp12_, enable);
	_tmp13_ = self->priv->action_group;
	_tmp14_ = g_action_map_lookup_action ((GActionMap*) _tmp13_, "trash-file");
	_tmp15_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp14_) : NULL);
	_g_object_unref0 (action);
	action = _tmp15_;
	_tmp16_ = action;
	g_simple_action_set_enabled (_tmp16_, enable);
	_tmp17_ = self->priv->action_group;
	_tmp18_ = g_action_map_lookup_action ((GActionMap*) _tmp17_, "move-up");
	_tmp19_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp18_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp18_) : NULL);
	_g_object_unref0 (action);
	action = _tmp19_;
	_tmp20_ = action;
	g_simple_action_set_enabled (_tmp20_, baobab_chart_can_move_up_root (self));
	_tmp21_ = self->priv->action_group;
	_tmp22_ = g_action_map_lookup_action ((GActionMap*) _tmp21_, "zoom-in");
	_tmp23_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp22_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp22_) : NULL);
	_g_object_unref0 (action);
	action = _tmp23_;
	_tmp24_ = action;
	g_simple_action_set_enabled (_tmp24_, baobab_chart_can_zoom_in (self));
	_tmp25_ = self->priv->action_group;
	_tmp26_ = g_action_map_lookup_action ((GActionMap*) _tmp25_, "zoom-out");
	_tmp27_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp26_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp26_) : NULL);
	_g_object_unref0 (action);
	action = _tmp27_;
	_tmp28_ = action;
	g_simple_action_set_enabled (_tmp28_, baobab_chart_can_zoom_out (self));
	_tmp29_.x = x;
	_tmp29_.y = y;
	_tmp29_.width = 0;
	_tmp29_.height = 0;
	rect = _tmp29_;
	_tmp30_ = self->priv->context_menu;
	_tmp31_ = rect;
	gtk_popover_set_pointing_to ((GtkPopover*) _tmp30_, &_tmp31_);
	_tmp32_ = self->priv->context_menu;
	gtk_popover_popup ((GtkPopover*) _tmp32_);
	_g_object_unref0 (action);
}

static void
_baobab_chart_items_changed_g_list_model_items_changed (GListModel* _sender,
                                                        guint position,
                                                        guint removed,
                                                        guint added,
                                                        gpointer self)
{
	baobab_chart_items_changed ((BaobabChart*) self, position, removed, added);
}

static void
baobab_chart_connect_model_signals (BaobabChart* self,
                                    GtkTreeListModel* m)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (m != NULL);
	g_signal_connect_object ((GListModel*) m, "items-changed", (GCallback) _baobab_chart_items_changed_g_list_model_items_changed, self, 0);
}

static void
baobab_chart_disconnect_model_signals (BaobabChart* self,
                                       GtkTreeListModel* m)
{
	guint _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (m != NULL);
	g_signal_parse_name ("items-changed", g_list_model_get_type (), &_tmp0_, NULL, FALSE);
	g_signal_handlers_disconnect_matched ((GListModel*) m, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, 0, NULL, (GCallback) _baobab_chart_items_changed_g_list_model_items_changed, self);
}

static gboolean
baobab_chart_real_query_tooltip (GtkWidget* base,
                                 gint x,
                                 gint y,
                                 gboolean keyboard_tooltip,
                                 GtkTooltip* tooltip)
{
	BaobabChart * self;
	BaobabChartItem* _tmp0_;
	BaobabChartItem* _tmp1_;
	BaobabChartItem* _tmp2_;
	BaobabChartItem* _tmp3_;
	GdkRectangle _tmp4_;
	gchar* size = NULL;
	BaobabChartItem* _tmp5_;
	BaobabChartItem* _tmp6_;
	BaobabScannerResults* _tmp7_;
	guint64 _tmp8_;
	guint64 _tmp9_;
	gchar* _tmp10_;
	gchar* markup = NULL;
	BaobabChartItem* _tmp11_;
	BaobabChartItem* _tmp12_;
	BaobabScannerResults* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	const gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	const gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	gboolean result;
	self = (BaobabChart*) base;
	g_return_val_if_fail (tooltip != NULL, FALSE);
	_tmp0_ = baobab_chart_get_highlighted_item (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp2_ = baobab_chart_get_highlighted_item (self);
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_->rect;
	gtk_tooltip_set_tip_area (tooltip, &_tmp4_);
	_tmp5_ = baobab_chart_get_highlighted_item (self);
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp6_->results;
	_tmp8_ = baobab_scanner_results_get_size (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = g_format_size_full (_tmp9_, G_FORMAT_SIZE_DEFAULT);
	size = _tmp10_;
	_tmp11_ = baobab_chart_get_highlighted_item (self);
	_tmp12_ = _tmp11_;
	_tmp13_ = _tmp12_->results;
	_tmp14_ = baobab_scanner_results_get_display_name (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = g_strconcat (_tmp15_, "\n", NULL);
	_tmp17_ = _tmp16_;
	_tmp18_ = size;
	_tmp19_ = g_strconcat (_tmp17_, _tmp18_, NULL);
	_tmp20_ = _tmp19_;
	_g_free0 (_tmp17_);
	markup = _tmp20_;
	_tmp21_ = markup;
	_tmp22_ = g_markup_escape_text (_tmp21_, (gssize) -1);
	_tmp23_ = _tmp22_;
	gtk_tooltip_set_markup (tooltip, _tmp23_);
	_g_free0 (_tmp23_);
	result = TRUE;
	_g_free0 (markup);
	_g_free0 (size);
	return result;
}

BaobabChart*
baobab_chart_construct (GType object_type)
{
	BaobabChart * self = NULL;
	self = (BaobabChart*) g_object_new (object_type, NULL);
	return self;
}

BaobabLocation*
baobab_chart_get_location (BaobabChart* self)
{
	BaobabLocation* result;
	BaobabLocation* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->location_;
	result = _tmp0_;
	return result;
}

static gpointer
_baobab_location_ref0 (gpointer self)
{
	return self ? baobab_location_ref (self) : NULL;
}

void
baobab_chart_set_location (BaobabChart* self,
                           BaobabLocation* value)
{
	BaobabLocation* _tmp0_;
	BaobabLocation* _tmp1_;
	BaobabScanner* _tmp2_;
	BaobabScanner* _tmp3_;
	BaobabScannerResults* _tmp4_;
	BaobabScannerResults* _tmp5_;
	GtkTreeListModel* _tmp6_;
	GtkTreeListModel* _tmp7_;
	BaobabLocation* _tmp8_;
	BaobabScanner* _tmp9_;
	BaobabScanner* _tmp10_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _baobab_location_ref0 (value);
	_baobab_location_unref0 (self->priv->location_);
	self->priv->location_ = _tmp0_;
	_tmp1_ = self->priv->location_;
	_tmp2_ = baobab_location_get_scanner (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = baobab_scanner_get_root (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = baobab_scanner_results_create_tree_model (_tmp5_);
	_tmp7_ = _tmp6_;
	baobab_chart_set_model (self, _tmp7_);
	_g_object_unref0 (_tmp7_);
	_tmp8_ = self->priv->location_;
	_tmp9_ = baobab_location_get_scanner (_tmp8_);
	_tmp10_ = _tmp9_;
	g_object_bind_property_with_closures ((GObject*) _tmp10_, "max-depth", (GObject*) self, "max-depth", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_object_notify_by_pspec ((GObject *) self, baobab_chart_properties[BAOBAB_CHART_LOCATION_PROPERTY]);
}

guint
baobab_chart_get_max_depth (BaobabChart* self)
{
	guint result;
	g_return_val_if_fail (self != NULL, 0U);
	result = self->priv->max_depth_;
	return result;
}

void
baobab_chart_set_max_depth (BaobabChart* self,
                            guint value)
{
	guint m = 0U;
	g_return_if_fail (self != NULL);
	m = CLAMP (value, BAOBAB_CHART_MIN_DEPTH, BAOBAB_CHART_MAX_DEPTH);
	if (self->priv->max_depth_ == m) {
		return;
	}
	self->priv->max_depth_ = m;
	self->priv->model_changed = TRUE;
	gtk_widget_queue_draw ((GtkWidget*) self);
	g_object_notify_by_pspec ((GObject *) self, baobab_chart_properties[BAOBAB_CHART_MAX_DEPTH_PROPERTY]);
}

GtkTreeListModel*
baobab_chart_get_model (BaobabChart* self)
{
	GtkTreeListModel* result;
	GtkTreeListModel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->model_;
	result = _tmp0_;
	return result;
}

void
baobab_chart_set_model (BaobabChart* self,
                        GtkTreeListModel* value)
{
	GtkTreeListModel* _tmp0_;
	GtkTreeListModel* _tmp1_;
	GtkTreeListModel* _tmp3_;
	GtkTreeListModel* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->model_;
	if (_tmp0_ == value) {
		return;
	}
	_tmp1_ = self->priv->model_;
	if (_tmp1_ != NULL) {
		GtkTreeListModel* _tmp2_;
		_tmp2_ = self->priv->model_;
		baobab_chart_disconnect_model_signals (self, _tmp2_);
	}
	_tmp3_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->model_);
	self->priv->model_ = _tmp3_;
	self->priv->model_changed = TRUE;
	baobab_chart_set_tree_root (self, NULL);
	_tmp4_ = self->priv->model_;
	baobab_chart_connect_model_signals (self, _tmp4_);
	gtk_widget_queue_draw ((GtkWidget*) self);
	g_object_notify_by_pspec ((GObject *) self, baobab_chart_properties[BAOBAB_CHART_MODEL_PROPERTY]);
}

BaobabScannerResults*
baobab_chart_get_tree_root (BaobabChart* self)
{
	BaobabScannerResults* result;
	BaobabScannerResults* _tmp0_;
	gboolean _tmp3_ = FALSE;
	BaobabLocation* _tmp4_;
	BaobabLocation* _tmp5_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->root_;
	if (_tmp0_ != NULL) {
		BaobabScannerResults* _tmp1_;
		BaobabScannerResults* _tmp2_;
		_tmp1_ = self->priv->root_;
		_tmp2_ = _g_object_ref0 (_tmp1_);
		result = _tmp2_;
		return result;
	}
	_tmp4_ = baobab_chart_get_location (self);
	_tmp5_ = _tmp4_;
	if (_tmp5_ != NULL) {
		BaobabLocation* _tmp6_;
		BaobabScanner* _tmp7_;
		BaobabScanner* _tmp8_;
		_tmp6_ = self->priv->location_;
		_tmp7_ = baobab_location_get_scanner (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp3_ = _tmp8_ != NULL;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		BaobabLocation* _tmp9_;
		BaobabScanner* _tmp10_;
		BaobabScanner* _tmp11_;
		BaobabScannerResults* _tmp12_;
		BaobabScannerResults* _tmp13_;
		BaobabScannerResults* _tmp14_;
		_tmp9_ = self->priv->location_;
		_tmp10_ = baobab_location_get_scanner (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = baobab_scanner_get_root (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = _g_object_ref0 (_tmp13_);
		result = _tmp14_;
		return result;
	}
	result = NULL;
	return result;
}

void
baobab_chart_set_tree_root (BaobabChart* self,
                            BaobabScannerResults* value)
{
	GtkTreeListModel* _tmp0_;
	GtkTreeListModel* _tmp1_;
	BaobabScannerResults* _tmp2_;
	BaobabScannerResults* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = baobab_chart_get_model (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		return;
	}
	_tmp2_ = self->priv->root_;
	if (_tmp2_ == value) {
		return;
	}
	_tmp3_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->root_);
	self->priv->root_ = _tmp3_;
	baobab_chart_set_highlighted_item (self, NULL);
	gtk_widget_queue_draw ((GtkWidget*) self);
	g_object_notify_by_pspec ((GObject *) self, baobab_chart_properties[BAOBAB_CHART_TREE_ROOT_PROPERTY]);
}

BaobabChartItem*
baobab_chart_get_highlighted_item (BaobabChart* self)
{
	BaobabChartItem* result;
	BaobabChartItem* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->highlighted_item_;
	result = _tmp0_;
	return result;
}

void
baobab_chart_set_highlighted_item (BaobabChart* self,
                                   BaobabChartItem* value)
{
	BaobabChartItem* _tmp0_;
	BaobabChartItem* _tmp1_;
	BaobabChartItem* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->highlighted_item_;
	if (_tmp0_ == value) {
		return;
	}
	_tmp1_ = self->priv->highlighted_item_;
	if (_tmp1_ != NULL) {
		gtk_widget_queue_draw ((GtkWidget*) self);
	}
	if (value != NULL) {
		gtk_widget_queue_draw ((GtkWidget*) self);
	}
	_tmp2_ = _baobab_chart_item_ref0 (value);
	_baobab_chart_item_unref0 (self->priv->highlighted_item_);
	self->priv->highlighted_item_ = _tmp2_;
	g_object_notify_by_pspec ((GObject *) self, baobab_chart_properties[BAOBAB_CHART_HIGHLIGHTED_ITEM_PROPERTY]);
}

static gboolean
_baobab_chart_scroll_cb_gtk_event_controller_scroll_scroll (GtkEventControllerScroll* _sender,
                                                            gdouble dx,
                                                            gdouble dy,
                                                            gpointer self)
{
	gboolean result;
	result = baobab_chart_scroll_cb ((BaobabChart*) self, dx, dy);
	return result;
}

static void
_baobab_chart_motion_cb_gtk_event_controller_motion_motion (GtkEventControllerMotion* _sender,
                                                            gdouble x,
                                                            gdouble y,
                                                            gpointer self)
{
	baobab_chart_motion_cb ((BaobabChart*) self, x, y);
}

static void
_baobab_chart_enter_cb_gtk_event_controller_motion_enter (GtkEventControllerMotion* _sender,
                                                          gdouble x,
                                                          gdouble y,
                                                          gpointer self)
{
	baobab_chart_enter_cb ((BaobabChart*) self, x, y);
}

static void
_baobab_chart___lambda14_ (BaobabChart* self,
                           gint _,
                           gdouble x,
                           gdouble y)
{
	if (baobab_chart_highlight_item_at_point (self, x, y)) {
		BaobabScannerResults* _tmp0_;
		BaobabScannerResults* _tmp1_;
		BaobabScannerResults* _tmp2_;
		BaobabChartItem* _tmp3_;
		BaobabChartItem* _tmp4_;
		BaobabScannerResults* _tmp5_;
		gboolean _tmp6_;
		_tmp0_ = baobab_chart_get_tree_root (self);
		_tmp1_ = _tmp0_;
		_tmp2_ = _tmp1_;
		_tmp3_ = baobab_chart_get_highlighted_item (self);
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_->results;
		_tmp6_ = _tmp2_ == _tmp5_;
		_g_object_unref0 (_tmp2_);
		if (_tmp6_) {
			baobab_chart_move_up_root (self);
		} else {
			BaobabChartItem* _tmp7_;
			BaobabChartItem* _tmp8_;
			BaobabScannerResults* _tmp9_;
			_tmp7_ = baobab_chart_get_highlighted_item (self);
			_tmp8_ = _tmp7_;
			_tmp9_ = _tmp8_->results;
			g_signal_emit (self, baobab_chart_signals[BAOBAB_CHART_ITEM_ACTIVATED_SIGNAL], 0, _tmp9_);
		}
	}
}

static void
__baobab_chart___lambda14__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                      gint n_press,
                                                      gdouble x,
                                                      gdouble y,
                                                      gpointer self)
{
	_baobab_chart___lambda14_ ((BaobabChart*) self, n_press, x, y);
}

static void
_baobab_chart___lambda15_ (BaobabChart* self,
                           gint _,
                           gdouble x,
                           gdouble y)
{
	baobab_chart_show_popover_at (self, (gint) x, (gint) y);
}

static void
__baobab_chart___lambda15__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                      gint n_press,
                                                      gdouble x,
                                                      gdouble y,
                                                      gpointer self)
{
	_baobab_chart___lambda15_ ((BaobabChart*) self, n_press, x, y);
}

static void
_baobab_chart___lambda16_ (BaobabChart* self,
                           gint _,
                           gdouble x,
                           gdouble y)
{
	baobab_chart_move_up_root (self);
}

static void
__baobab_chart___lambda16__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                      gint n_press,
                                                      gdouble x,
                                                      gdouble y,
                                                      gpointer self)
{
	_baobab_chart___lambda16_ ((BaobabChart*) self, n_press, x, y);
}

static void
_baobab_chart_draw_func_gtk_drawing_area_draw_func (GtkDrawingArea* drawing_area,
                                                    cairo_t* cr,
                                                    gint width,
                                                    gint height,
                                                    gpointer self)
{
	baobab_chart_draw_func ((BaobabChart*) self, drawing_area, cr, width, height);
}

static GObject *
baobab_chart_constructor (GType type,
                          guint n_construct_properties,
                          GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	BaobabChart * self;
	GtkEventControllerScroll* _tmp0_;
	GtkEventControllerScroll* _tmp1_;
	GtkEventControllerScroll* _tmp2_;
	GtkEventController* _tmp3_;
	GtkEventControllerMotion* _tmp4_;
	GtkEventControllerMotion* _tmp5_;
	GtkEventControllerMotion* _tmp6_;
	GtkEventControllerMotion* _tmp7_;
	GtkEventController* _tmp8_;
	GtkGestureClick* _tmp9_;
	GtkGestureClick* _tmp10_;
	GtkGestureClick* _tmp11_;
	GtkGestureClick* _tmp12_;
	GtkEventController* _tmp13_;
	GtkGestureClick* _tmp14_;
	GtkGestureClick* _tmp15_;
	GtkGestureClick* _tmp16_;
	GtkGestureClick* _tmp17_;
	GtkEventController* _tmp18_;
	GtkGestureClick* _tmp19_;
	GtkGestureClick* _tmp20_;
	GtkGestureClick* _tmp21_;
	GtkGestureClick* _tmp22_;
	GtkEventController* _tmp23_;
	GSimpleActionGroup* _tmp24_;
	GSimpleActionGroup* _tmp25_;
	GSimpleActionGroup* _tmp26_;
	parent_class = G_OBJECT_CLASS (baobab_chart_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BAOBAB_TYPE_CHART, BaobabChart);
	_tmp0_ = (GtkEventControllerScroll*) gtk_event_controller_scroll_new (GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES);
	_g_object_unref0 (self->priv->scroll_controller);
	self->priv->scroll_controller = _tmp0_;
	_tmp1_ = self->priv->scroll_controller;
	g_signal_connect_object (_tmp1_, "scroll", (GCallback) _baobab_chart_scroll_cb_gtk_event_controller_scroll_scroll, self, 0);
	_tmp2_ = self->priv->scroll_controller;
	_tmp3_ = _g_object_ref0 ((GtkEventController*) _tmp2_);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp3_);
	_tmp4_ = (GtkEventControllerMotion*) gtk_event_controller_motion_new ();
	_g_object_unref0 (self->priv->motion_controller);
	self->priv->motion_controller = _tmp4_;
	_tmp5_ = self->priv->motion_controller;
	g_signal_connect_object (_tmp5_, "motion", (GCallback) _baobab_chart_motion_cb_gtk_event_controller_motion_motion, self, 0);
	_tmp6_ = self->priv->motion_controller;
	g_signal_connect_object (_tmp6_, "enter", (GCallback) _baobab_chart_enter_cb_gtk_event_controller_motion_enter, self, 0);
	_tmp7_ = self->priv->motion_controller;
	_tmp8_ = _g_object_ref0 ((GtkEventController*) _tmp7_);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp8_);
	_tmp9_ = (GtkGestureClick*) gtk_gesture_click_new ();
	_g_object_unref0 (self->priv->primary_click_gesture);
	self->priv->primary_click_gesture = _tmp9_;
	_tmp10_ = self->priv->primary_click_gesture;
	gtk_gesture_single_set_button ((GtkGestureSingle*) _tmp10_, (guint) GDK_BUTTON_PRIMARY);
	_tmp11_ = self->priv->primary_click_gesture;
	g_signal_connect_object (_tmp11_, "pressed", (GCallback) __baobab_chart___lambda14__gtk_gesture_click_pressed, self, 0);
	_tmp12_ = self->priv->primary_click_gesture;
	_tmp13_ = _g_object_ref0 ((GtkEventController*) _tmp12_);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp13_);
	_tmp14_ = (GtkGestureClick*) gtk_gesture_click_new ();
	_g_object_unref0 (self->priv->secondary_click_gesture);
	self->priv->secondary_click_gesture = _tmp14_;
	_tmp15_ = self->priv->secondary_click_gesture;
	gtk_gesture_single_set_button ((GtkGestureSingle*) _tmp15_, (guint) GDK_BUTTON_SECONDARY);
	_tmp16_ = self->priv->secondary_click_gesture;
	g_signal_connect_object (_tmp16_, "pressed", (GCallback) __baobab_chart___lambda15__gtk_gesture_click_pressed, self, 0);
	_tmp17_ = self->priv->secondary_click_gesture;
	_tmp18_ = _g_object_ref0 ((GtkEventController*) _tmp17_);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp18_);
	_tmp19_ = (GtkGestureClick*) gtk_gesture_click_new ();
	_g_object_unref0 (self->priv->middle_click_gesture);
	self->priv->middle_click_gesture = _tmp19_;
	_tmp20_ = self->priv->middle_click_gesture;
	gtk_gesture_single_set_button ((GtkGestureSingle*) _tmp20_, (guint) GDK_BUTTON_MIDDLE);
	_tmp21_ = self->priv->middle_click_gesture;
	g_signal_connect_object (_tmp21_, "pressed", (GCallback) __baobab_chart___lambda16__gtk_gesture_click_pressed, self, 0);
	_tmp22_ = self->priv->middle_click_gesture;
	_tmp23_ = _g_object_ref0 ((GtkEventController*) _tmp22_);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp23_);
	_tmp24_ = g_simple_action_group_new ();
	_g_object_unref0 (self->priv->action_group);
	self->priv->action_group = _tmp24_;
	_tmp25_ = self->priv->action_group;
	g_action_map_add_action_entries ((GActionMap*) _tmp25_, BAOBAB_CHART_action_entries, (gint) G_N_ELEMENTS (BAOBAB_CHART_action_entries), self);
	_tmp26_ = self->priv->action_group;
	gtk_widget_insert_action_group ((GtkWidget*) self, "chart", (GActionGroup*) _tmp26_);
	baobab_chart_build_context_menu (self);
	gdk_rgba_parse (&self->priv->chart_colors[0], "#e01b24");
	gdk_rgba_parse (&self->priv->chart_colors[1], "#ff7800");
	gdk_rgba_parse (&self->priv->chart_colors[2], "#f6d32d");
	gdk_rgba_parse (&self->priv->chart_colors[3], "#33d17a");
	gdk_rgba_parse (&self->priv->chart_colors[4], "#3584e4");
	gdk_rgba_parse (&self->priv->chart_colors[5], "#9141ac");
	gtk_drawing_area_set_draw_func ((GtkDrawingArea*) self, _baobab_chart_draw_func_gtk_drawing_area_draw_func, g_object_ref (self), g_object_unref);
	return obj;
}

static void
baobab_chart_class_init (BaobabChartClass * klass,
                         gpointer klass_data)
{
	baobab_chart_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BaobabChart_private_offset);
	((BaobabChartClass *) klass)->post_draw = (void (*) (BaobabChart*, cairo_t*)) baobab_chart_real_post_draw;
	((BaobabChartClass *) klass)->draw_item = (void (*) (BaobabChart*, cairo_t*, BaobabChartItem*, gboolean)) baobab_chart_real_draw_item;
	((BaobabChartClass *) klass)->calculate_item_geometry = (void (*) (BaobabChart*, BaobabChartItem*)) baobab_chart_real_calculate_item_geometry;
	((BaobabChartClass *) klass)->is_point_over_item = (gboolean (*) (BaobabChart*, BaobabChartItem*, gdouble, gdouble)) baobab_chart_real_is_point_over_item;
	((BaobabChartClass *) klass)->get_item_rectangle = (void (*) (BaobabChart*, BaobabChartItem*)) baobab_chart_real_get_item_rectangle;
	((BaobabChartClass *) klass)->can_zoom_in = (gboolean (*) (BaobabChart*)) baobab_chart_real_can_zoom_in;
	((BaobabChartClass *) klass)->can_zoom_out = (gboolean (*) (BaobabChart*)) baobab_chart_real_can_zoom_out;
	((BaobabChartClass *) klass)->create_new_chartitem = (BaobabChartItem* (*) (BaobabChart*)) baobab_chart_real_create_new_chartitem;
	((GtkWidgetClass *) klass)->size_allocate = (void (*) (GtkWidget*, gint, gint, gint)) baobab_chart_real_size_allocate;
	((GtkWidgetClass *) klass)->query_tooltip = (gboolean (*) (GtkWidget*, gint, gint, gboolean, GtkTooltip*)) baobab_chart_real_query_tooltip;
	G_OBJECT_CLASS (klass)->get_property = _vala_baobab_chart_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_baobab_chart_set_property;
	G_OBJECT_CLASS (klass)->constructor = baobab_chart_constructor;
	G_OBJECT_CLASS (klass)->finalize = baobab_chart_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BAOBAB_CHART_LOCATION_PROPERTY, baobab_chart_properties[BAOBAB_CHART_LOCATION_PROPERTY] = baobab_param_spec_location ("location", "location", "location", BAOBAB_TYPE_LOCATION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BAOBAB_CHART_MAX_DEPTH_PROPERTY, baobab_chart_properties[BAOBAB_CHART_MAX_DEPTH_PROPERTY] = g_param_spec_uint ("max-depth", "max-depth", "max-depth", 0, G_MAXUINT, 0U, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BAOBAB_CHART_MODEL_PROPERTY, baobab_chart_properties[BAOBAB_CHART_MODEL_PROPERTY] = g_param_spec_object ("model", "model", "model", gtk_tree_list_model_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BAOBAB_CHART_TREE_ROOT_PROPERTY, baobab_chart_properties[BAOBAB_CHART_TREE_ROOT_PROPERTY] = g_param_spec_object ("tree-root", "tree-root", "tree-root", BAOBAB_SCANNER_TYPE_RESULTS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BAOBAB_CHART_HIGHLIGHTED_ITEM_PROPERTY, baobab_chart_properties[BAOBAB_CHART_HIGHLIGHTED_ITEM_PROPERTY] = baobab_param_spec_chart_item ("highlighted-item", "highlighted-item", "highlighted-item", BAOBAB_TYPE_CHART_ITEM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	baobab_chart_signals[BAOBAB_CHART_ITEM_ACTIVATED_SIGNAL] = g_signal_new ("item-activated", BAOBAB_TYPE_CHART, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, BAOBAB_SCANNER_TYPE_RESULTS);
}

static void
baobab_chart_instance_init (BaobabChart * self,
                            gpointer klass)
{
	self->priv = baobab_chart_get_instance_private (self);
	self->priv->context_menu = NULL;
	self->priv->popover_item = NULL;
	self->priv->max_depth_ = BAOBAB_CHART_MAX_DEPTH;
	self->priv->highlighted_item_ = NULL;
}

static void
baobab_chart_finalize (GObject * obj)
{
	BaobabChart * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BAOBAB_TYPE_CHART, BaobabChart);
	_g_object_unref0 (self->priv->context_menu);
	_g_object_unref0 (self->priv->scroll_controller);
	_g_object_unref0 (self->priv->motion_controller);
	_g_object_unref0 (self->priv->primary_click_gesture);
	_g_object_unref0 (self->priv->secondary_click_gesture);
	_g_object_unref0 (self->priv->middle_click_gesture);
	(self->priv->items == NULL) ? NULL : (self->priv->items = (_g_list_free__baobab_chart_item_unref0_ (self->priv->items), NULL));
	_baobab_chart_item_unref0 (self->priv->popover_item);
	_baobab_location_unref0 (self->priv->location_);
	_g_object_unref0 (self->priv->model_);
	_g_object_unref0 (self->priv->root_);
	_baobab_chart_item_unref0 (self->priv->highlighted_item_);
	_g_object_unref0 (self->priv->action_group);
	G_OBJECT_CLASS (baobab_chart_parent_class)->finalize (obj);
}

static GType
baobab_chart_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BaobabChartClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) baobab_chart_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BaobabChart), 0, (GInstanceInitFunc) baobab_chart_instance_init, NULL };
	GType baobab_chart_type_id;
	baobab_chart_type_id = g_type_register_static (gtk_drawing_area_get_type (), "BaobabChart", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	BaobabChart_private_offset = g_type_add_instance_private (baobab_chart_type_id, sizeof (BaobabChartPrivate));
	return baobab_chart_type_id;
}

GType
baobab_chart_get_type (void)
{
	static volatile gsize baobab_chart_type_id__once = 0;
	if (g_once_init_enter (&baobab_chart_type_id__once)) {
		GType baobab_chart_type_id;
		baobab_chart_type_id = baobab_chart_get_type_once ();
		g_once_init_leave (&baobab_chart_type_id__once, baobab_chart_type_id);
	}
	return baobab_chart_type_id__once;
}

static void
_vala_baobab_chart_get_property (GObject * object,
                                 guint property_id,
                                 GValue * value,
                                 GParamSpec * pspec)
{
	BaobabChart * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BAOBAB_TYPE_CHART, BaobabChart);
	switch (property_id) {
		case BAOBAB_CHART_LOCATION_PROPERTY:
		baobab_value_set_location (value, baobab_chart_get_location (self));
		break;
		case BAOBAB_CHART_MAX_DEPTH_PROPERTY:
		g_value_set_uint (value, baobab_chart_get_max_depth (self));
		break;
		case BAOBAB_CHART_MODEL_PROPERTY:
		g_value_set_object (value, baobab_chart_get_model (self));
		break;
		case BAOBAB_CHART_TREE_ROOT_PROPERTY:
		g_value_take_object (value, baobab_chart_get_tree_root (self));
		break;
		case BAOBAB_CHART_HIGHLIGHTED_ITEM_PROPERTY:
		baobab_value_set_chart_item (value, baobab_chart_get_highlighted_item (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_baobab_chart_set_property (GObject * object,
                                 guint property_id,
                                 const GValue * value,
                                 GParamSpec * pspec)
{
	BaobabChart * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BAOBAB_TYPE_CHART, BaobabChart);
	switch (property_id) {
		case BAOBAB_CHART_LOCATION_PROPERTY:
		baobab_chart_set_location (self, baobab_value_get_location (value));
		break;
		case BAOBAB_CHART_MAX_DEPTH_PROPERTY:
		baobab_chart_set_max_depth (self, g_value_get_uint (value));
		break;
		case BAOBAB_CHART_MODEL_PROPERTY:
		baobab_chart_set_model (self, g_value_get_object (value));
		break;
		case BAOBAB_CHART_TREE_ROOT_PROPERTY:
		baobab_chart_set_tree_root (self, g_value_get_object (value));
		break;
		case BAOBAB_CHART_HIGHLIGHTED_ITEM_PROPERTY:
		baobab_chart_set_highlighted_item (self, baobab_value_get_chart_item (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

