/* ColorItem.c generated by valac 0.56.18, the Vala compiler
 * generated from ColorItem.vala, do not modify */

/*
* Copyright (c) 2016 Felipe Escoto (https://github.com/Philip-Scott/Spice-up)
*
* 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Authored by: Felipe Escoto <felescoto95@hotmail.com>
*/

#include <gtk/gtk.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <json-glib/json-glib.h>

#define SPICE_COLOR_ITEM_TEXT_STYLE_CSS "\n" \
"        .colored {\n" \
"            background: %s;\n" \
"            border-radius: %d%;\n" \
"        }\n" \
"    "
#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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define SPICE_TYPE_CANVAS_ITEM (spice_canvas_item_get_type ())
#define SPICE_CANVAS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_TYPE_CANVAS_ITEM, SpiceCanvasItem))
#define SPICE_CANVAS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_TYPE_CANVAS_ITEM, SpiceCanvasItemClass))
#define SPICE_IS_CANVAS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPICE_TYPE_CANVAS_ITEM))
#define SPICE_IS_CANVAS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_TYPE_CANVAS_ITEM))
#define SPICE_CANVAS_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_TYPE_CANVAS_ITEM, SpiceCanvasItemClass))

typedef struct _SpiceCanvasItem SpiceCanvasItem;
typedef struct _SpiceCanvasItemClass SpiceCanvasItemClass;
typedef struct _SpiceCanvasItemPrivate SpiceCanvasItemPrivate;

#define SPICE_TYPE_COLOR_ITEM (spice_color_item_get_type ())
#define SPICE_COLOR_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_TYPE_COLOR_ITEM, SpiceColorItem))
#define SPICE_COLOR_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_TYPE_COLOR_ITEM, SpiceColorItemClass))
#define SPICE_IS_COLOR_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPICE_TYPE_COLOR_ITEM))
#define SPICE_IS_COLOR_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_TYPE_COLOR_ITEM))
#define SPICE_COLOR_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_TYPE_COLOR_ITEM, SpiceColorItemClass))

typedef struct _SpiceColorItem SpiceColorItem;
typedef struct _SpiceColorItemClass SpiceColorItemClass;
typedef struct _SpiceColorItemPrivate SpiceColorItemPrivate;
enum  {
	SPICE_COLOR_ITEM_0_PROPERTY,
	SPICE_COLOR_ITEM_BACKGROUND_COLOR_PROPERTY,
	SPICE_COLOR_ITEM_BORDER_RADIUS_PROPERTY,
	SPICE_COLOR_ITEM_NUM_PROPERTIES
};
static GParamSpec* spice_color_item_properties[SPICE_COLOR_ITEM_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

#define SPICE_TYPE_CANVAS (spice_canvas_get_type ())
#define SPICE_CANVAS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_TYPE_CANVAS, SpiceCanvas))
#define SPICE_CANVAS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_TYPE_CANVAS, SpiceCanvasClass))
#define SPICE_IS_CANVAS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPICE_TYPE_CANVAS))
#define SPICE_IS_CANVAS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_TYPE_CANVAS))
#define SPICE_CANVAS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_TYPE_CANVAS, SpiceCanvasClass))

typedef struct _SpiceCanvas SpiceCanvas;
typedef struct _SpiceCanvasClass SpiceCanvasClass;

struct _SpiceCanvasItem {
	GtkEventBox parent_instance;
	SpiceCanvasItemPrivate * priv;
	gdouble start_x;
	gdouble start_y;
	gint start_w;
	gint start_h;
	gboolean holding;
	gint holding_id;
	gint real_width;
	gint real_height;
	gint real_x;
	gint real_y;
	GtkGrid* grid;
	GtkRevealer* grabber_revealer;
};

struct _SpiceCanvasItemClass {
	GtkEventBoxClass parent_class;
	gchar* (*serialise_item) (SpiceCanvasItem* self);
	void (*load_item_data) (SpiceCanvasItem* self);
	void (*style) (SpiceCanvasItem* self);
};

struct _SpiceColorItem {
	SpiceCanvasItem parent_instance;
	SpiceColorItemPrivate * priv;
};

struct _SpiceColorItemClass {
	SpiceCanvasItemClass parent_class;
};

struct _SpiceColorItemPrivate {
	gchar* _background_color;
	gint _border_radius;
};

static gint SpiceColorItem_private_offset;
static gpointer spice_color_item_parent_class = NULL;

VALA_EXTERN GType spice_canvas_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpiceCanvasItem, g_object_unref)
VALA_EXTERN GType spice_color_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpiceColorItem, g_object_unref)
VALA_EXTERN gchar* spice_canvas_item_serialise_item (SpiceCanvasItem* self);
VALA_EXTERN void spice_canvas_item_load_item_data (SpiceCanvasItem* self);
VALA_EXTERN void spice_canvas_item_style (SpiceCanvasItem* self);
VALA_EXTERN GType spice_canvas_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpiceCanvas, g_object_unref)
VALA_EXTERN SpiceColorItem* spice_color_item_new (SpiceCanvas* _canvas,
                                      JsonObject* _save_data);
VALA_EXTERN SpiceColorItem* spice_color_item_construct (GType object_type,
                                            SpiceCanvas* _canvas,
                                            JsonObject* _save_data);
VALA_EXTERN void spice_canvas_item_load_data (SpiceCanvasItem* self);
VALA_EXTERN SpiceCanvas* spice_canvas_item_get_canvas (SpiceCanvasItem* self);
static gchar* spice_color_item_real_serialise_item (SpiceCanvasItem* base);
VALA_EXTERN const gchar* spice_color_item_get_background_color (SpiceColorItem* self);
VALA_EXTERN gint spice_color_item_get_border_radius (SpiceColorItem* self);
static void spice_color_item_real_load_item_data (SpiceCanvasItem* base);
VALA_EXTERN JsonObject* spice_canvas_item_get_save_data (SpiceCanvasItem* self);
VALA_EXTERN void spice_color_item_set_background_color (SpiceColorItem* self,
                                            const gchar* value);
VALA_EXTERN void spice_color_item_set_border_radius (SpiceColorItem* self,
                                         gint value);
static void spice_color_item_real_style (SpiceCanvasItem* base);
VALA_EXTERN void spice_utils_set_style (GtkWidget* widget,
                            const gchar* css);
static void spice_color_item_finalize (GObject * obj);
static GType spice_color_item_get_type_once (void);
static void _vala_spice_color_item_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec);
static void _vala_spice_color_item_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec);

static inline gpointer
spice_color_item_get_instance_private (SpiceColorItem* self)
{
	return G_STRUCT_MEMBER_P (self, SpiceColorItem_private_offset);
}

SpiceColorItem*
spice_color_item_construct (GType object_type,
                            SpiceCanvas* _canvas,
                            JsonObject* _save_data)
{
	SpiceColorItem * self = NULL;
	SpiceCanvas* _tmp0_;
	SpiceCanvas* _tmp1_;
#line 34 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	self = (SpiceColorItem*) g_object_new (object_type, "canvas", _canvas, "save-data", _save_data, NULL);
#line 35 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	spice_canvas_item_load_data ((SpiceCanvasItem*) self);
#line 37 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	_tmp0_ = spice_canvas_item_get_canvas ((SpiceCanvasItem*) self);
#line 37 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	_tmp1_ = _tmp0_;
#line 37 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	if (_tmp1_ != NULL) {
#line 37 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		spice_canvas_item_style ((SpiceCanvasItem*) self);
#line 200 "ColorItem.c"
	}
#line 33 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	return self;
#line 204 "ColorItem.c"
}

SpiceColorItem*
spice_color_item_new (SpiceCanvas* _canvas,
                      JsonObject* _save_data)
{
#line 33 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	return spice_color_item_construct (SPICE_TYPE_COLOR_ITEM, _canvas, _save_data);
#line 213 "ColorItem.c"
}

static gchar*
spice_color_item_real_serialise_item (SpiceCanvasItem* base)
{
	SpiceColorItem * self;
	gchar* data = NULL;
	const gchar* _tmp0_;
	gint _tmp1_;
	gchar* _tmp2_;
	gchar* result;
#line 40 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	self = (SpiceColorItem*) base;
#line 41 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	_tmp0_ = self->priv->_background_color;
#line 41 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	_tmp1_ = self->priv->_border_radius;
#line 41 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	_tmp2_ = g_strdup_printf (" \"type\": \"color\", \"background_color\": \"%s\", \"border-radius\":" \
" %d ", _tmp0_, _tmp1_);
#line 41 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	data = _tmp2_;
#line 43 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	result = data;
#line 43 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	return result;
#line 239 "ColorItem.c"
}

static void
spice_color_item_real_load_item_data (SpiceCanvasItem* base)
{
	SpiceColorItem * self;
	JsonObject* _tmp0_;
	JsonObject* _tmp1_;
	const gchar* _tmp2_;
	JsonObject* _tmp3_;
	JsonObject* _tmp4_;
#line 46 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	self = (SpiceColorItem*) base;
#line 47 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	_tmp0_ = spice_canvas_item_get_save_data ((SpiceCanvasItem*) self);
#line 47 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	_tmp1_ = _tmp0_;
#line 47 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	_tmp2_ = json_object_get_string_member (_tmp1_, "background_color");
#line 47 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	spice_color_item_set_background_color (self, _tmp2_);
#line 49 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	_tmp3_ = spice_canvas_item_get_save_data ((SpiceCanvasItem*) self);
#line 49 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	_tmp4_ = _tmp3_;
#line 49 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	if (json_object_has_member (_tmp4_, "border-radius")) {
#line 267 "ColorItem.c"
		JsonObject* _tmp5_;
		JsonObject* _tmp6_;
#line 50 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		_tmp5_ = spice_canvas_item_get_save_data ((SpiceCanvasItem*) self);
#line 50 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		_tmp6_ = _tmp5_;
#line 50 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		spice_color_item_set_border_radius (self, (gint) json_object_get_int_member (_tmp6_, "border-radius"));
#line 276 "ColorItem.c"
	}
}

static void
spice_color_item_real_style (SpiceCanvasItem* base)
{
	SpiceColorItem * self;
	const gchar* _tmp0_;
	gint _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
#line 54 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	self = (SpiceColorItem*) base;
#line 55 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	_tmp0_ = self->priv->_background_color;
#line 55 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	_tmp1_ = self->priv->_border_radius;
#line 55 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	_tmp2_ = g_strdup_printf (SPICE_COLOR_ITEM_TEXT_STYLE_CSS, _tmp0_, _tmp1_);
#line 55 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	_tmp3_ = _tmp2_;
#line 55 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	spice_utils_set_style ((GtkWidget*) self, _tmp3_);
#line 55 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	_g_free0 (_tmp3_);
#line 302 "ColorItem.c"
}

const gchar*
spice_color_item_get_background_color (SpiceColorItem* self)
{
	const gchar* result;
	const gchar* _tmp0_;
#line 23 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 23 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	_tmp0_ = self->priv->_background_color;
#line 23 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	result = _tmp0_;
#line 23 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	return result;
#line 318 "ColorItem.c"
}

void
spice_color_item_set_background_color (SpiceColorItem* self,
                                       const gchar* value)
{
	gchar* old_value;
#line 23 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	g_return_if_fail (self != NULL);
#line 23 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	old_value = spice_color_item_get_background_color (self);
#line 23 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	if (g_strcmp0 (value, old_value) != 0) {
#line 332 "ColorItem.c"
		gchar* _tmp0_;
#line 23 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		_tmp0_ = g_strdup (value);
#line 23 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		_g_free0 (self->priv->_background_color);
#line 23 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		self->priv->_background_color = _tmp0_;
#line 23 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		g_object_notify_by_pspec ((GObject *) self, spice_color_item_properties[SPICE_COLOR_ITEM_BACKGROUND_COLOR_PROPERTY]);
#line 342 "ColorItem.c"
	}
}

gint
spice_color_item_get_border_radius (SpiceColorItem* self)
{
	gint result;
#line 24 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	g_return_val_if_fail (self != NULL, 0);
#line 24 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	result = self->priv->_border_radius;
#line 24 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	return result;
#line 356 "ColorItem.c"
}

void
spice_color_item_set_border_radius (SpiceColorItem* self,
                                    gint value)
{
	gint old_value;
#line 24 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	g_return_if_fail (self != NULL);
#line 24 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	old_value = spice_color_item_get_border_radius (self);
#line 24 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	if (old_value != value) {
#line 24 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		self->priv->_border_radius = value;
#line 24 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		g_object_notify_by_pspec ((GObject *) self, spice_color_item_properties[SPICE_COLOR_ITEM_BORDER_RADIUS_PROPERTY]);
#line 374 "ColorItem.c"
	}
}

static void
spice_color_item_class_init (SpiceColorItemClass * klass,
                             gpointer klass_data)
{
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	spice_color_item_parent_class = g_type_class_peek_parent (klass);
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	g_type_class_adjust_private_offset (klass, &SpiceColorItem_private_offset);
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	((SpiceCanvasItemClass *) klass)->serialise_item = (gchar* (*) (SpiceCanvasItem*)) spice_color_item_real_serialise_item;
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	((SpiceCanvasItemClass *) klass)->load_item_data = (void (*) (SpiceCanvasItem*)) spice_color_item_real_load_item_data;
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	((SpiceCanvasItemClass *) klass)->style = (void (*) (SpiceCanvasItem*)) spice_color_item_real_style;
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_spice_color_item_get_property;
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	G_OBJECT_CLASS (klass)->set_property = _vala_spice_color_item_set_property;
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	G_OBJECT_CLASS (klass)->finalize = spice_color_item_finalize;
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), SPICE_COLOR_ITEM_BACKGROUND_COLOR_PROPERTY, spice_color_item_properties[SPICE_COLOR_ITEM_BACKGROUND_COLOR_PROPERTY] = g_param_spec_string ("background-color", "background-color", "background-color", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), SPICE_COLOR_ITEM_BORDER_RADIUS_PROPERTY, spice_color_item_properties[SPICE_COLOR_ITEM_BORDER_RADIUS_PROPERTY] = g_param_spec_int ("border-radius", "border-radius", "border-radius", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
#line 402 "ColorItem.c"
}

static void
spice_color_item_instance_init (SpiceColorItem * self,
                                gpointer klass)
{
	gchar* _tmp0_;
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	self->priv = spice_color_item_get_instance_private (self);
#line 23 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	_tmp0_ = g_strdup ("linear-gradient(to bottom, #e00 0%, #e00 100%);");
#line 23 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	self->priv->_background_color = _tmp0_;
#line 24 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	self->priv->_border_radius = 0;
#line 418 "ColorItem.c"
}

static void
spice_color_item_finalize (GObject * obj)
{
	SpiceColorItem * self;
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SPICE_TYPE_COLOR_ITEM, SpiceColorItem);
#line 23 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	_g_free0 (self->priv->_background_color);
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	G_OBJECT_CLASS (spice_color_item_parent_class)->finalize (obj);
#line 431 "ColorItem.c"
}

static GType
spice_color_item_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SpiceColorItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) spice_color_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SpiceColorItem), 0, (GInstanceInitFunc) spice_color_item_instance_init, NULL };
	GType spice_color_item_type_id;
	spice_color_item_type_id = g_type_register_static (SPICE_TYPE_CANVAS_ITEM, "SpiceColorItem", &g_define_type_info, 0);
	SpiceColorItem_private_offset = g_type_add_instance_private (spice_color_item_type_id, sizeof (SpiceColorItemPrivate));
	return spice_color_item_type_id;
}

GType
spice_color_item_get_type (void)
{
	static volatile gsize spice_color_item_type_id__once = 0;
	if (g_once_init_enter (&spice_color_item_type_id__once)) {
		GType spice_color_item_type_id;
		spice_color_item_type_id = spice_color_item_get_type_once ();
		g_once_init_leave (&spice_color_item_type_id__once, spice_color_item_type_id);
	}
	return spice_color_item_type_id__once;
}

static void
_vala_spice_color_item_get_property (GObject * object,
                                     guint property_id,
                                     GValue * value,
                                     GParamSpec * pspec)
{
	SpiceColorItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SPICE_TYPE_COLOR_ITEM, SpiceColorItem);
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	switch (property_id) {
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		case SPICE_COLOR_ITEM_BACKGROUND_COLOR_PROPERTY:
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		g_value_set_string (value, spice_color_item_get_background_color (self));
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		break;
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		case SPICE_COLOR_ITEM_BORDER_RADIUS_PROPERTY:
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		g_value_set_int (value, spice_color_item_get_border_radius (self));
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		break;
#line 478 "ColorItem.c"
		default:
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		break;
#line 484 "ColorItem.c"
	}
}

static void
_vala_spice_color_item_set_property (GObject * object,
                                     guint property_id,
                                     const GValue * value,
                                     GParamSpec * pspec)
{
	SpiceColorItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SPICE_TYPE_COLOR_ITEM, SpiceColorItem);
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
	switch (property_id) {
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		case SPICE_COLOR_ITEM_BACKGROUND_COLOR_PROPERTY:
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		spice_color_item_set_background_color (self, g_value_get_string (value));
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		break;
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		case SPICE_COLOR_ITEM_BORDER_RADIUS_PROPERTY:
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		spice_color_item_set_border_radius (self, g_value_get_int (value));
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		break;
#line 510 "ColorItem.c"
		default:
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 22 "../Spice-up-1.9.1/src/Widgets/CanvasItems/ColorItem.vala"
		break;
#line 516 "ColorItem.c"
	}
}

