/* baobab-cellrenderers.c generated by valac 0.17.1.35-814b, the Vala compiler
 * generated from baobab-cellrenderers.vala, do not modify */

/* -*- indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* Baobab - disk usage analyzer
 *
 * Copyright (C) 2012  Ryan Lortie <desrt@desrt.ca>
 *
 * 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 Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <cairo.h>
#include <gdk/gdk.h>


#define BAOBAB_TYPE_CELL_RENDERER_PERCENT (baobab_cell_renderer_percent_get_type ())
#define BAOBAB_CELL_RENDERER_PERCENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAOBAB_TYPE_CELL_RENDERER_PERCENT, BaobabCellRendererPercent))
#define BAOBAB_CELL_RENDERER_PERCENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BAOBAB_TYPE_CELL_RENDERER_PERCENT, BaobabCellRendererPercentClass))
#define BAOBAB_IS_CELL_RENDERER_PERCENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAOBAB_TYPE_CELL_RENDERER_PERCENT))
#define BAOBAB_IS_CELL_RENDERER_PERCENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BAOBAB_TYPE_CELL_RENDERER_PERCENT))
#define BAOBAB_CELL_RENDERER_PERCENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BAOBAB_TYPE_CELL_RENDERER_PERCENT, BaobabCellRendererPercentClass))

typedef struct _BaobabCellRendererPercent BaobabCellRendererPercent;
typedef struct _BaobabCellRendererPercentClass BaobabCellRendererPercentClass;
typedef struct _BaobabCellRendererPercentPrivate BaobabCellRendererPercentPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))

#define BAOBAB_TYPE_CELL_RENDERER_SIZE (baobab_cell_renderer_size_get_type ())
#define BAOBAB_CELL_RENDERER_SIZE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAOBAB_TYPE_CELL_RENDERER_SIZE, BaobabCellRendererSize))
#define BAOBAB_CELL_RENDERER_SIZE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BAOBAB_TYPE_CELL_RENDERER_SIZE, BaobabCellRendererSizeClass))
#define BAOBAB_IS_CELL_RENDERER_SIZE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAOBAB_TYPE_CELL_RENDERER_SIZE))
#define BAOBAB_IS_CELL_RENDERER_SIZE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BAOBAB_TYPE_CELL_RENDERER_SIZE))
#define BAOBAB_CELL_RENDERER_SIZE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BAOBAB_TYPE_CELL_RENDERER_SIZE, BaobabCellRendererSizeClass))

typedef struct _BaobabCellRendererSize BaobabCellRendererSize;
typedef struct _BaobabCellRendererSizeClass BaobabCellRendererSizeClass;
typedef struct _BaobabCellRendererSizePrivate BaobabCellRendererSizePrivate;

#define BAOBAB_TYPE_CELL_RENDERER_ITEMS (baobab_cell_renderer_items_get_type ())
#define BAOBAB_CELL_RENDERER_ITEMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAOBAB_TYPE_CELL_RENDERER_ITEMS, BaobabCellRendererItems))
#define BAOBAB_CELL_RENDERER_ITEMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BAOBAB_TYPE_CELL_RENDERER_ITEMS, BaobabCellRendererItemsClass))
#define BAOBAB_IS_CELL_RENDERER_ITEMS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAOBAB_TYPE_CELL_RENDERER_ITEMS))
#define BAOBAB_IS_CELL_RENDERER_ITEMS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BAOBAB_TYPE_CELL_RENDERER_ITEMS))
#define BAOBAB_CELL_RENDERER_ITEMS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BAOBAB_TYPE_CELL_RENDERER_ITEMS, BaobabCellRendererItemsClass))

typedef struct _BaobabCellRendererItems BaobabCellRendererItems;
typedef struct _BaobabCellRendererItemsClass BaobabCellRendererItemsClass;
typedef struct _BaobabCellRendererItemsPrivate BaobabCellRendererItemsPrivate;

#define BAOBAB_TYPE_CELL_RENDERER_PROGRESS (baobab_cell_renderer_progress_get_type ())
#define BAOBAB_CELL_RENDERER_PROGRESS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAOBAB_TYPE_CELL_RENDERER_PROGRESS, BaobabCellRendererProgress))
#define BAOBAB_CELL_RENDERER_PROGRESS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BAOBAB_TYPE_CELL_RENDERER_PROGRESS, BaobabCellRendererProgressClass))
#define BAOBAB_IS_CELL_RENDERER_PROGRESS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAOBAB_TYPE_CELL_RENDERER_PROGRESS))
#define BAOBAB_IS_CELL_RENDERER_PROGRESS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BAOBAB_TYPE_CELL_RENDERER_PROGRESS))
#define BAOBAB_CELL_RENDERER_PROGRESS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BAOBAB_TYPE_CELL_RENDERER_PROGRESS, BaobabCellRendererProgressClass))

typedef struct _BaobabCellRendererProgress BaobabCellRendererProgress;
typedef struct _BaobabCellRendererProgressClass BaobabCellRendererProgressClass;
typedef struct _BaobabCellRendererProgressPrivate BaobabCellRendererProgressPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _BaobabCellRendererPercent {
	GtkCellRendererText parent_instance;
	BaobabCellRendererPercentPrivate * priv;
};

struct _BaobabCellRendererPercentClass {
	GtkCellRendererTextClass parent_class;
};

struct _BaobabCellRendererSize {
	GtkCellRendererText parent_instance;
	BaobabCellRendererSizePrivate * priv;
};

struct _BaobabCellRendererSizeClass {
	GtkCellRendererTextClass parent_class;
};

struct _BaobabCellRendererSizePrivate {
	gboolean _show_allocated_size;
};

struct _BaobabCellRendererItems {
	GtkCellRendererText parent_instance;
	BaobabCellRendererItemsPrivate * priv;
};

struct _BaobabCellRendererItemsClass {
	GtkCellRendererTextClass parent_class;
};

struct _BaobabCellRendererProgress {
	GtkCellRendererProgress parent_instance;
	BaobabCellRendererProgressPrivate * priv;
};

struct _BaobabCellRendererProgressClass {
	GtkCellRendererProgressClass parent_class;
};


static gpointer baobab_cell_renderer_percent_parent_class = NULL;
static gpointer baobab_cell_renderer_size_parent_class = NULL;
static gpointer baobab_cell_renderer_items_parent_class = NULL;
static gpointer baobab_cell_renderer_progress_parent_class = NULL;

GType baobab_cell_renderer_percent_get_type (void) G_GNUC_CONST;
enum  {
	BAOBAB_CELL_RENDERER_PERCENT_DUMMY_PROPERTY,
	BAOBAB_CELL_RENDERER_PERCENT_PERCENT
};
BaobabCellRendererPercent* baobab_cell_renderer_percent_new (void);
BaobabCellRendererPercent* baobab_cell_renderer_percent_construct (GType object_type);
void baobab_cell_renderer_percent_set_percent (BaobabCellRendererPercent* self, gdouble value);
static void _vala_baobab_cell_renderer_percent_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType baobab_cell_renderer_size_get_type (void) G_GNUC_CONST;
#define BAOBAB_CELL_RENDERER_SIZE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BAOBAB_TYPE_CELL_RENDERER_SIZE, BaobabCellRendererSizePrivate))
enum  {
	BAOBAB_CELL_RENDERER_SIZE_DUMMY_PROPERTY,
	BAOBAB_CELL_RENDERER_SIZE_SIZE,
	BAOBAB_CELL_RENDERER_SIZE_ALLOC_SIZE,
	BAOBAB_CELL_RENDERER_SIZE_SHOW_ALLOCATED_SIZE
};
BaobabCellRendererSize* baobab_cell_renderer_size_new (void);
BaobabCellRendererSize* baobab_cell_renderer_size_construct (GType object_type);
void baobab_cell_renderer_size_set_size (BaobabCellRendererSize* self, guint64 value);
static gboolean baobab_cell_renderer_size_get_show_allocated_size (BaobabCellRendererSize* self);
void baobab_cell_renderer_size_set_alloc_size (BaobabCellRendererSize* self, guint64 value);
void baobab_cell_renderer_size_set_show_allocated_size (BaobabCellRendererSize* self, gboolean value);
static void baobab_cell_renderer_size_finalize (GObject* obj);
static void _vala_baobab_cell_renderer_size_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_baobab_cell_renderer_size_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType baobab_cell_renderer_items_get_type (void) G_GNUC_CONST;
enum  {
	BAOBAB_CELL_RENDERER_ITEMS_DUMMY_PROPERTY,
	BAOBAB_CELL_RENDERER_ITEMS_ITEMS
};
BaobabCellRendererItems* baobab_cell_renderer_items_new (void);
BaobabCellRendererItems* baobab_cell_renderer_items_construct (GType object_type);
void baobab_cell_renderer_items_set_items (BaobabCellRendererItems* self, gint value);
static void _vala_baobab_cell_renderer_items_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType baobab_cell_renderer_progress_get_type (void) G_GNUC_CONST;
enum  {
	BAOBAB_CELL_RENDERER_PROGRESS_DUMMY_PROPERTY
};
static void baobab_cell_renderer_progress_real_render (GtkCellRenderer* base, cairo_t* cr, GtkWidget* widget, GdkRectangle* background_area, GdkRectangle* cell_area, GtkCellRendererState flags);
BaobabCellRendererProgress* baobab_cell_renderer_progress_new (void);
BaobabCellRendererProgress* baobab_cell_renderer_progress_construct (GType object_type);


BaobabCellRendererPercent* baobab_cell_renderer_percent_construct (GType object_type) {
	BaobabCellRendererPercent * self = NULL;
	self = (BaobabCellRendererPercent*) g_object_new (object_type, NULL);
	return self;
}


BaobabCellRendererPercent* baobab_cell_renderer_percent_new (void) {
	return baobab_cell_renderer_percent_construct (BAOBAB_TYPE_CELL_RENDERER_PERCENT);
}


void baobab_cell_renderer_percent_set_percent (BaobabCellRendererPercent* self, gdouble value) {
	gdouble _tmp0_;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = g_strdup_printf ("%.1f %%", _tmp0_);
	_tmp2_ = _tmp1_;
	g_object_set ((GtkCellRendererText*) self, "text", _tmp2_, NULL);
	_g_free0 (_tmp2_);
	g_object_notify ((GObject *) self, "percent");
}


static void baobab_cell_renderer_percent_class_init (BaobabCellRendererPercentClass * klass) {
	baobab_cell_renderer_percent_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->set_property = _vala_baobab_cell_renderer_percent_set_property;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BAOBAB_CELL_RENDERER_PERCENT_PERCENT, g_param_spec_double ("percent", "percent", "percent", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE));
}


static void baobab_cell_renderer_percent_instance_init (BaobabCellRendererPercent * self) {
}


GType baobab_cell_renderer_percent_get_type (void) {
	static volatile gsize baobab_cell_renderer_percent_type_id__volatile = 0;
	if (g_once_init_enter (&baobab_cell_renderer_percent_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BaobabCellRendererPercentClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) baobab_cell_renderer_percent_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BaobabCellRendererPercent), 0, (GInstanceInitFunc) baobab_cell_renderer_percent_instance_init, NULL };
		GType baobab_cell_renderer_percent_type_id;
		baobab_cell_renderer_percent_type_id = g_type_register_static (GTK_TYPE_CELL_RENDERER_TEXT, "BaobabCellRendererPercent", &g_define_type_info, 0);
		g_once_init_leave (&baobab_cell_renderer_percent_type_id__volatile, baobab_cell_renderer_percent_type_id);
	}
	return baobab_cell_renderer_percent_type_id__volatile;
}


static void _vala_baobab_cell_renderer_percent_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	BaobabCellRendererPercent * self;
	self = BAOBAB_CELL_RENDERER_PERCENT (object);
	switch (property_id) {
		case BAOBAB_CELL_RENDERER_PERCENT_PERCENT:
		baobab_cell_renderer_percent_set_percent (self, g_value_get_double (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


BaobabCellRendererSize* baobab_cell_renderer_size_construct (GType object_type) {
	BaobabCellRendererSize * self = NULL;
	self = (BaobabCellRendererSize*) g_object_new (object_type, NULL);
	return self;
}


BaobabCellRendererSize* baobab_cell_renderer_size_new (void) {
	return baobab_cell_renderer_size_construct (BAOBAB_TYPE_CELL_RENDERER_SIZE);
}


void baobab_cell_renderer_size_set_size (BaobabCellRendererSize* self, guint64 value) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_show_allocated_size;
	if (!_tmp0_) {
		guint64 _tmp1_;
		gchar* _tmp2_ = NULL;
		gchar* _tmp3_;
		_tmp1_ = value;
		_tmp2_ = g_format_size_full (_tmp1_, G_FORMAT_SIZE_DEFAULT);
		_tmp3_ = _tmp2_;
		g_object_set ((GtkCellRendererText*) self, "text", _tmp3_, NULL);
		_g_free0 (_tmp3_);
	}
	g_object_notify ((GObject *) self, "size");
}


void baobab_cell_renderer_size_set_alloc_size (BaobabCellRendererSize* self, guint64 value) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_show_allocated_size;
	if (_tmp0_) {
		guint64 _tmp1_;
		gchar* _tmp2_ = NULL;
		gchar* _tmp3_;
		_tmp1_ = value;
		_tmp2_ = g_format_size_full (_tmp1_, G_FORMAT_SIZE_DEFAULT);
		_tmp3_ = _tmp2_;
		g_object_set ((GtkCellRendererText*) self, "text", _tmp3_, NULL);
		_g_free0 (_tmp3_);
	}
	g_object_notify ((GObject *) self, "alloc-size");
}


static gboolean baobab_cell_renderer_size_get_show_allocated_size (BaobabCellRendererSize* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_show_allocated_size;
	result = _tmp0_;
	return result;
}


void baobab_cell_renderer_size_set_show_allocated_size (BaobabCellRendererSize* self, gboolean value) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_show_allocated_size = _tmp0_;
	g_object_notify ((GObject *) self, "show-allocated-size");
}


static void baobab_cell_renderer_size_class_init (BaobabCellRendererSizeClass * klass) {
	baobab_cell_renderer_size_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (BaobabCellRendererSizePrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_baobab_cell_renderer_size_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_baobab_cell_renderer_size_set_property;
	G_OBJECT_CLASS (klass)->finalize = baobab_cell_renderer_size_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BAOBAB_CELL_RENDERER_SIZE_SIZE, g_param_spec_uint64 ("size", "size", "size", 0, G_MAXUINT64, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BAOBAB_CELL_RENDERER_SIZE_ALLOC_SIZE, g_param_spec_uint64 ("alloc-size", "alloc-size", "alloc-size", 0, G_MAXUINT64, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BAOBAB_CELL_RENDERER_SIZE_SHOW_ALLOCATED_SIZE, g_param_spec_boolean ("show-allocated-size", "show-allocated-size", "show-allocated-size", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE));
}


static void baobab_cell_renderer_size_instance_init (BaobabCellRendererSize * self) {
	self->priv = BAOBAB_CELL_RENDERER_SIZE_GET_PRIVATE (self);
}


static void baobab_cell_renderer_size_finalize (GObject* obj) {
	BaobabCellRendererSize * self;
	self = BAOBAB_CELL_RENDERER_SIZE (obj);
	G_OBJECT_CLASS (baobab_cell_renderer_size_parent_class)->finalize (obj);
}


GType baobab_cell_renderer_size_get_type (void) {
	static volatile gsize baobab_cell_renderer_size_type_id__volatile = 0;
	if (g_once_init_enter (&baobab_cell_renderer_size_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BaobabCellRendererSizeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) baobab_cell_renderer_size_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BaobabCellRendererSize), 0, (GInstanceInitFunc) baobab_cell_renderer_size_instance_init, NULL };
		GType baobab_cell_renderer_size_type_id;
		baobab_cell_renderer_size_type_id = g_type_register_static (GTK_TYPE_CELL_RENDERER_TEXT, "BaobabCellRendererSize", &g_define_type_info, 0);
		g_once_init_leave (&baobab_cell_renderer_size_type_id__volatile, baobab_cell_renderer_size_type_id);
	}
	return baobab_cell_renderer_size_type_id__volatile;
}


static void _vala_baobab_cell_renderer_size_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	BaobabCellRendererSize * self;
	self = BAOBAB_CELL_RENDERER_SIZE (object);
	switch (property_id) {
		case BAOBAB_CELL_RENDERER_SIZE_SHOW_ALLOCATED_SIZE:
		g_value_set_boolean (value, baobab_cell_renderer_size_get_show_allocated_size (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_baobab_cell_renderer_size_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	BaobabCellRendererSize * self;
	self = BAOBAB_CELL_RENDERER_SIZE (object);
	switch (property_id) {
		case BAOBAB_CELL_RENDERER_SIZE_SIZE:
		baobab_cell_renderer_size_set_size (self, g_value_get_uint64 (value));
		break;
		case BAOBAB_CELL_RENDERER_SIZE_ALLOC_SIZE:
		baobab_cell_renderer_size_set_alloc_size (self, g_value_get_uint64 (value));
		break;
		case BAOBAB_CELL_RENDERER_SIZE_SHOW_ALLOCATED_SIZE:
		baobab_cell_renderer_size_set_show_allocated_size (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


BaobabCellRendererItems* baobab_cell_renderer_items_construct (GType object_type) {
	BaobabCellRendererItems * self = NULL;
	self = (BaobabCellRendererItems*) g_object_new (object_type, NULL);
	return self;
}


BaobabCellRendererItems* baobab_cell_renderer_items_new (void) {
	return baobab_cell_renderer_items_construct (BAOBAB_TYPE_CELL_RENDERER_ITEMS);
}


void baobab_cell_renderer_items_set_items (BaobabCellRendererItems* self, gint value) {
	gchar* _tmp0_ = NULL;
	gint _tmp1_;
	const gchar* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp1_ = value;
	if (_tmp1_ >= 0) {
		gint _tmp2_;
		const gchar* _tmp3_ = NULL;
		gint _tmp4_;
		gchar* _tmp5_ = NULL;
		_tmp2_ = value;
		_tmp3_ = ngettext ("%d item", "%d items", (gulong) _tmp2_);
		_tmp4_ = value;
		_tmp5_ = g_strdup_printf (_tmp3_, _tmp4_);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp5_;
	} else {
		gchar* _tmp6_;
		_tmp6_ = g_strdup ("");
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp6_;
	}
	_tmp7_ = _tmp0_;
	g_object_set ((GtkCellRendererText*) self, "text", _tmp7_, NULL);
	_g_free0 (_tmp0_);
	g_object_notify ((GObject *) self, "items");
}


static void baobab_cell_renderer_items_class_init (BaobabCellRendererItemsClass * klass) {
	baobab_cell_renderer_items_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->set_property = _vala_baobab_cell_renderer_items_set_property;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BAOBAB_CELL_RENDERER_ITEMS_ITEMS, g_param_spec_int ("items", "items", "items", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE));
}


static void baobab_cell_renderer_items_instance_init (BaobabCellRendererItems * self) {
}


GType baobab_cell_renderer_items_get_type (void) {
	static volatile gsize baobab_cell_renderer_items_type_id__volatile = 0;
	if (g_once_init_enter (&baobab_cell_renderer_items_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BaobabCellRendererItemsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) baobab_cell_renderer_items_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BaobabCellRendererItems), 0, (GInstanceInitFunc) baobab_cell_renderer_items_instance_init, NULL };
		GType baobab_cell_renderer_items_type_id;
		baobab_cell_renderer_items_type_id = g_type_register_static (GTK_TYPE_CELL_RENDERER_TEXT, "BaobabCellRendererItems", &g_define_type_info, 0);
		g_once_init_leave (&baobab_cell_renderer_items_type_id__volatile, baobab_cell_renderer_items_type_id);
	}
	return baobab_cell_renderer_items_type_id__volatile;
}


static void _vala_baobab_cell_renderer_items_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	BaobabCellRendererItems * self;
	self = BAOBAB_CELL_RENDERER_ITEMS (object);
	switch (property_id) {
		case BAOBAB_CELL_RENDERER_ITEMS_ITEMS:
		baobab_cell_renderer_items_set_items (self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


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


static void baobab_cell_renderer_progress_real_render (GtkCellRenderer* base, cairo_t* cr, GtkWidget* widget, GdkRectangle* background_area, GdkRectangle* cell_area, GtkCellRendererState flags) {
	BaobabCellRendererProgress * self;
	gint xpad = 0;
	gint ypad = 0;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	GdkRectangle _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gint x;
	GdkRectangle _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	gint y;
	GdkRectangle _tmp8_;
	gint _tmp9_;
	gint _tmp10_;
	gint w;
	GdkRectangle _tmp11_;
	gint _tmp12_;
	gint _tmp13_;
	gint h;
	cairo_t* _tmp14_;
	gint _tmp15_;
	gint _tmp16_;
	gint _tmp17_;
	gint _tmp18_;
	cairo_t* _tmp19_;
	cairo_t* _tmp20_;
	GtkWidget* _tmp21_;
	GtkStyle* _tmp22_ = NULL;
	GtkStyle* _tmp23_;
	GtkStyle* style;
	gint _tmp24_;
	GtkStyle* _tmp25_;
	gint _tmp26_;
	gint _tmp27_;
	GtkStyle* _tmp28_;
	gint _tmp29_;
	gint _tmp30_;
	GtkStyle* _tmp31_;
	gint _tmp32_;
	gint _tmp33_;
	GtkStyle* _tmp34_;
	gint _tmp35_;
	cairo_t* _tmp36_;
	gint _tmp37_;
	gint _tmp38_;
	gint _tmp39_;
	gint _tmp40_;
	cairo_t* _tmp41_;
	cairo_t* _tmp42_;
	gint _tmp43_ = 0;
	gint _tmp44_;
	gint percent;
	gint _tmp45_;
	gint _tmp46_;
	gint perc_w;
	GtkWidget* _tmp47_;
	GtkTextDirection _tmp48_ = 0;
	cairo_t* _tmp52_;
	gint _tmp53_;
	gint _tmp54_;
	gint _tmp55_;
	gint _tmp56_;
	gint _tmp57_;
	cairo_t* _tmp62_;
	self = (BaobabCellRendererProgress*) base;
	g_return_if_fail (cr != NULL);
	g_return_if_fail (widget != NULL);
	g_return_if_fail (background_area != NULL);
	g_return_if_fail (cell_area != NULL);
	gtk_cell_renderer_get_padding ((GtkCellRenderer*) self, &_tmp0_, &_tmp1_);
	xpad = _tmp0_;
	ypad = _tmp1_;
	_tmp2_ = *cell_area;
	_tmp3_ = _tmp2_.x;
	_tmp4_ = xpad;
	x = _tmp3_ + _tmp4_;
	_tmp5_ = *cell_area;
	_tmp6_ = _tmp5_.y;
	_tmp7_ = ypad;
	y = _tmp6_ + _tmp7_;
	_tmp8_ = *cell_area;
	_tmp9_ = _tmp8_.width;
	_tmp10_ = xpad;
	w = _tmp9_ - (_tmp10_ * 2);
	_tmp11_ = *cell_area;
	_tmp12_ = _tmp11_.height;
	_tmp13_ = ypad;
	h = _tmp12_ - (_tmp13_ * 2);
	_tmp14_ = cr;
	_tmp15_ = x;
	_tmp16_ = y;
	_tmp17_ = w;
	_tmp18_ = h;
	cairo_rectangle (_tmp14_, (gdouble) _tmp15_, (gdouble) _tmp16_, (gdouble) _tmp17_, (gdouble) _tmp18_);
	_tmp19_ = cr;
	cairo_set_source_rgb (_tmp19_, (gdouble) 0, (gdouble) 0, (gdouble) 0);
	_tmp20_ = cr;
	cairo_fill (_tmp20_);
	_tmp21_ = widget;
	_tmp22_ = gtk_widget_get_style (_tmp21_);
	_tmp23_ = _g_object_ref0 (_tmp22_);
	style = _tmp23_;
	_tmp24_ = x;
	_tmp25_ = style;
	_tmp26_ = _tmp25_->xthickness;
	x = _tmp24_ + _tmp26_;
	_tmp27_ = y;
	_tmp28_ = style;
	_tmp29_ = _tmp28_->xthickness;
	y = _tmp27_ + _tmp29_;
	_tmp30_ = w;
	_tmp31_ = style;
	_tmp32_ = _tmp31_->xthickness;
	w = _tmp30_ - (_tmp32_ * 2);
	_tmp33_ = h;
	_tmp34_ = style;
	_tmp35_ = _tmp34_->xthickness;
	h = _tmp33_ - (_tmp35_ * 2);
	_tmp36_ = cr;
	_tmp37_ = x;
	_tmp38_ = y;
	_tmp39_ = w;
	_tmp40_ = h;
	cairo_rectangle (_tmp36_, (gdouble) _tmp37_, (gdouble) _tmp38_, (gdouble) _tmp39_, (gdouble) _tmp40_);
	_tmp41_ = cr;
	cairo_set_source_rgb (_tmp41_, (gdouble) 1, (gdouble) 1, (gdouble) 1);
	_tmp42_ = cr;
	cairo_fill (_tmp42_);
	g_object_get ((GtkCellRendererProgress*) self, "value", &_tmp43_, NULL);
	_tmp44_ = _tmp43_;
	percent = _tmp44_;
	_tmp45_ = w;
	_tmp46_ = percent;
	perc_w = (_tmp45_ * _tmp46_) / 100;
	_tmp47_ = widget;
	_tmp48_ = gtk_widget_get_direction (_tmp47_);
	if (_tmp48_ == GTK_TEXT_DIR_RTL) {
		gint _tmp49_;
		gint _tmp50_;
		gint _tmp51_;
		_tmp49_ = x;
		_tmp50_ = w;
		_tmp51_ = perc_w;
		x = _tmp49_ + (_tmp50_ - _tmp51_);
	}
	_tmp52_ = cr;
	_tmp53_ = x;
	_tmp54_ = y;
	_tmp55_ = perc_w;
	_tmp56_ = h;
	cairo_rectangle (_tmp52_, (gdouble) _tmp53_, (gdouble) _tmp54_, (gdouble) _tmp55_, (gdouble) _tmp56_);
	_tmp57_ = percent;
	if (_tmp57_ <= 33) {
		cairo_t* _tmp58_;
		_tmp58_ = cr;
		cairo_set_source_rgb (_tmp58_, 0x73 / 255.0, 0xd2 / 255.0, 0x16 / 255.0);
	} else {
		gint _tmp59_;
		_tmp59_ = percent;
		if (_tmp59_ <= 66) {
			cairo_t* _tmp60_;
			_tmp60_ = cr;
			cairo_set_source_rgb (_tmp60_, 0xed / 255.0, 0xd4 / 255.0, 0x00 / 255.0);
		} else {
			cairo_t* _tmp61_;
			_tmp61_ = cr;
			cairo_set_source_rgb (_tmp61_, 0xcc / 255.0, 0x00 / 255.0, 0x00 / 255.0);
		}
	}
	_tmp62_ = cr;
	cairo_fill (_tmp62_);
	_g_object_unref0 (style);
}


BaobabCellRendererProgress* baobab_cell_renderer_progress_construct (GType object_type) {
	BaobabCellRendererProgress * self = NULL;
	self = (BaobabCellRendererProgress*) g_object_new (object_type, NULL);
	return self;
}


BaobabCellRendererProgress* baobab_cell_renderer_progress_new (void) {
	return baobab_cell_renderer_progress_construct (BAOBAB_TYPE_CELL_RENDERER_PROGRESS);
}


static void baobab_cell_renderer_progress_class_init (BaobabCellRendererProgressClass * klass) {
	baobab_cell_renderer_progress_parent_class = g_type_class_peek_parent (klass);
	GTK_CELL_RENDERER_CLASS (klass)->render = baobab_cell_renderer_progress_real_render;
}


static void baobab_cell_renderer_progress_instance_init (BaobabCellRendererProgress * self) {
}


GType baobab_cell_renderer_progress_get_type (void) {
	static volatile gsize baobab_cell_renderer_progress_type_id__volatile = 0;
	if (g_once_init_enter (&baobab_cell_renderer_progress_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BaobabCellRendererProgressClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) baobab_cell_renderer_progress_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BaobabCellRendererProgress), 0, (GInstanceInitFunc) baobab_cell_renderer_progress_instance_init, NULL };
		GType baobab_cell_renderer_progress_type_id;
		baobab_cell_renderer_progress_type_id = g_type_register_static (GTK_TYPE_CELL_RENDERER_PROGRESS, "BaobabCellRendererProgress", &g_define_type_info, 0);
		g_once_init_leave (&baobab_cell_renderer_progress_type_id__volatile, baobab_cell_renderer_progress_type_id);
	}
	return baobab_cell_renderer_progress_type_id__volatile;
}



