/* tagclouditem.c generated by valac 0.12.1.1-323029-dirty, the Vala compiler
 * generated from tagclouditem.vala, do not modify */

/* tagclouditem.vala
 *
 * Copyright (C) 2010  Andrea Del Signore
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library 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
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Andrea Del Signore <sejerpz@tin.it>
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>


#define VALA_TYPE_SELECT_STATUS (vala_select_status_get_type ())

#define VALA_TYPE_TAG_CLOUD_ITEM (vala_tag_cloud_item_get_type ())
#define VALA_TAG_CLOUD_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_TAG_CLOUD_ITEM, ValaTagCloudItem))
#define VALA_TAG_CLOUD_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_TAG_CLOUD_ITEM, ValaTagCloudItemClass))
#define VALA_IS_TAG_CLOUD_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_TAG_CLOUD_ITEM))
#define VALA_IS_TAG_CLOUD_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_TAG_CLOUD_ITEM))
#define VALA_TAG_CLOUD_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_TAG_CLOUD_ITEM, ValaTagCloudItemClass))

typedef struct _ValaTagCloudItem ValaTagCloudItem;
typedef struct _ValaTagCloudItemClass ValaTagCloudItemClass;
typedef struct _ValaTagCloudItemPrivate ValaTagCloudItemPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))

typedef enum  {
	VALA_SELECT_STATUS_SELECTED,
	VALA_SELECT_STATUS_EXCLUDED,
	VALA_SELECT_STATUS_NOT_SELECTED
} ValaSelectStatus;

struct _ValaTagCloudItem {
	GObject parent_instance;
	ValaTagCloudItemPrivate * priv;
	gint x;
	gint y;
	gint width;
	gint height;
};

struct _ValaTagCloudItemClass {
	GObjectClass parent_class;
};

struct _ValaTagCloudItemPrivate {
	gchar* _text;
	gint _occourrences;
	ValaSelectStatus _select_status;
	gboolean _hilighted;
};


static gpointer vala_tag_cloud_item_parent_class = NULL;

GType vala_select_status_get_type (void) G_GNUC_CONST;
GType vala_tag_cloud_item_get_type (void) G_GNUC_CONST;
#define VALA_TAG_CLOUD_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VALA_TYPE_TAG_CLOUD_ITEM, ValaTagCloudItemPrivate))
enum  {
	VALA_TAG_CLOUD_ITEM_DUMMY_PROPERTY,
	VALA_TAG_CLOUD_ITEM_TEXT,
	VALA_TAG_CLOUD_ITEM_OCCOURRENCES,
	VALA_TAG_CLOUD_ITEM_SELECT_STATUS,
	VALA_TAG_CLOUD_ITEM_HILIGHTED
};
ValaTagCloudItem* vala_tag_cloud_item_new (const gchar* text, gint occourrences, ValaSelectStatus select_status);
ValaTagCloudItem* vala_tag_cloud_item_construct (GType object_type, const gchar* text, gint occourrences, ValaSelectStatus select_status);
const gchar* vala_tag_cloud_item_get_text (ValaTagCloudItem* self);
void vala_tag_cloud_item_set_text (ValaTagCloudItem* self, const gchar* value);
gint vala_tag_cloud_item_get_occourrences (ValaTagCloudItem* self);
void vala_tag_cloud_item_set_occourrences (ValaTagCloudItem* self, gint value);
ValaSelectStatus vala_tag_cloud_item_get_select_status (ValaTagCloudItem* self);
void vala_tag_cloud_item_set_select_status (ValaTagCloudItem* self, ValaSelectStatus value);
gboolean vala_tag_cloud_item_get_hilighted (ValaTagCloudItem* self);
void vala_tag_cloud_item_set_hilighted (ValaTagCloudItem* self, gboolean value);
static void vala_tag_cloud_item_finalize (GObject* obj);
static void _vala_vala_tag_cloud_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_vala_tag_cloud_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


GType vala_select_status_get_type (void) {
	static volatile gsize vala_select_status_type_id__volatile = 0;
	if (g_once_init_enter (&vala_select_status_type_id__volatile)) {
		static const GEnumValue values[] = {{VALA_SELECT_STATUS_SELECTED, "VALA_SELECT_STATUS_SELECTED", "selected"}, {VALA_SELECT_STATUS_EXCLUDED, "VALA_SELECT_STATUS_EXCLUDED", "excluded"}, {VALA_SELECT_STATUS_NOT_SELECTED, "VALA_SELECT_STATUS_NOT_SELECTED", "not-selected"}, {0, NULL, NULL}};
		GType vala_select_status_type_id;
		vala_select_status_type_id = g_enum_register_static ("ValaSelectStatus", values);
		g_once_init_leave (&vala_select_status_type_id__volatile, vala_select_status_type_id);
	}
	return vala_select_status_type_id__volatile;
}


ValaTagCloudItem* vala_tag_cloud_item_construct (GType object_type, const gchar* text, gint occourrences, ValaSelectStatus select_status) {
	ValaTagCloudItem * self = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (text != NULL, NULL);
	self = (ValaTagCloudItem*) g_object_new (object_type, NULL);
	_tmp0_ = g_strdup (text);
	_g_free0 (self->priv->_text);
	self->priv->_text = _tmp0_;
	self->priv->_occourrences = occourrences;
	self->priv->_select_status = select_status;
	return self;
}


ValaTagCloudItem* vala_tag_cloud_item_new (const gchar* text, gint occourrences, ValaSelectStatus select_status) {
	return vala_tag_cloud_item_construct (VALA_TYPE_TAG_CLOUD_ITEM, text, occourrences, select_status);
}


const gchar* vala_tag_cloud_item_get_text (ValaTagCloudItem* self) {
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self->priv->_text;
	return result;
}


void vala_tag_cloud_item_set_text (ValaTagCloudItem* self, const gchar* value) {
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_text);
	self->priv->_text = _tmp0_;
	g_object_notify ((GObject *) self, "text");
}


gint vala_tag_cloud_item_get_occourrences (ValaTagCloudItem* self) {
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_occourrences;
	return result;
}


void vala_tag_cloud_item_set_occourrences (ValaTagCloudItem* self, gint value) {
	g_return_if_fail (self != NULL);
	self->priv->_occourrences = value;
	g_object_notify ((GObject *) self, "occourrences");
}


ValaSelectStatus vala_tag_cloud_item_get_select_status (ValaTagCloudItem* self) {
	ValaSelectStatus result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_select_status;
	return result;
}


void vala_tag_cloud_item_set_select_status (ValaTagCloudItem* self, ValaSelectStatus value) {
	g_return_if_fail (self != NULL);
	if (self->priv->_select_status != value) {
		self->priv->_select_status = value;
		g_signal_emit_by_name (self, "select-status-changed");
	}
	g_object_notify ((GObject *) self, "select-status");
}


gboolean vala_tag_cloud_item_get_hilighted (ValaTagCloudItem* self) {
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_hilighted;
	return result;
}


void vala_tag_cloud_item_set_hilighted (ValaTagCloudItem* self, gboolean value) {
	g_return_if_fail (self != NULL);
	self->priv->_hilighted = value;
	g_object_notify ((GObject *) self, "hilighted");
}


static void vala_tag_cloud_item_class_init (ValaTagCloudItemClass * klass) {
	vala_tag_cloud_item_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ValaTagCloudItemPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_vala_tag_cloud_item_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_vala_tag_cloud_item_set_property;
	G_OBJECT_CLASS (klass)->finalize = vala_tag_cloud_item_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALA_TAG_CLOUD_ITEM_TEXT, g_param_spec_string ("text", "text", "text", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALA_TAG_CLOUD_ITEM_OCCOURRENCES, g_param_spec_int ("occourrences", "occourrences", "occourrences", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALA_TAG_CLOUD_ITEM_SELECT_STATUS, g_param_spec_enum ("select-status", "select-status", "select-status", VALA_TYPE_SELECT_STATUS, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALA_TAG_CLOUD_ITEM_HILIGHTED, g_param_spec_boolean ("hilighted", "hilighted", "hilighted", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_signal_new ("select_status_changed", VALA_TYPE_TAG_CLOUD_ITEM, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}


static void vala_tag_cloud_item_instance_init (ValaTagCloudItem * self) {
	gchar* _tmp0_;
	self->priv = VALA_TAG_CLOUD_ITEM_GET_PRIVATE (self);
	_tmp0_ = g_strdup ("");
	self->priv->_text = _tmp0_;
	self->priv->_occourrences = 0;
	self->priv->_select_status = VALA_SELECT_STATUS_NOT_SELECTED;
	self->priv->_hilighted = FALSE;
	self->x = 0;
	self->y = 0;
	self->width = 0;
	self->height = 0;
}


static void vala_tag_cloud_item_finalize (GObject* obj) {
	ValaTagCloudItem * self;
	self = VALA_TAG_CLOUD_ITEM (obj);
	_g_free0 (self->priv->_text);
	G_OBJECT_CLASS (vala_tag_cloud_item_parent_class)->finalize (obj);
}


GType vala_tag_cloud_item_get_type (void) {
	static volatile gsize vala_tag_cloud_item_type_id__volatile = 0;
	if (g_once_init_enter (&vala_tag_cloud_item_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ValaTagCloudItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_tag_cloud_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaTagCloudItem), 0, (GInstanceInitFunc) vala_tag_cloud_item_instance_init, NULL };
		GType vala_tag_cloud_item_type_id;
		vala_tag_cloud_item_type_id = g_type_register_static (G_TYPE_OBJECT, "ValaTagCloudItem", &g_define_type_info, 0);
		g_once_init_leave (&vala_tag_cloud_item_type_id__volatile, vala_tag_cloud_item_type_id);
	}
	return vala_tag_cloud_item_type_id__volatile;
}


static void _vala_vala_tag_cloud_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ValaTagCloudItem * self;
	self = VALA_TAG_CLOUD_ITEM (object);
	switch (property_id) {
		case VALA_TAG_CLOUD_ITEM_TEXT:
		g_value_set_string (value, vala_tag_cloud_item_get_text (self));
		break;
		case VALA_TAG_CLOUD_ITEM_OCCOURRENCES:
		g_value_set_int (value, vala_tag_cloud_item_get_occourrences (self));
		break;
		case VALA_TAG_CLOUD_ITEM_SELECT_STATUS:
		g_value_set_enum (value, vala_tag_cloud_item_get_select_status (self));
		break;
		case VALA_TAG_CLOUD_ITEM_HILIGHTED:
		g_value_set_boolean (value, vala_tag_cloud_item_get_hilighted (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_vala_tag_cloud_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	ValaTagCloudItem * self;
	self = VALA_TAG_CLOUD_ITEM (object);
	switch (property_id) {
		case VALA_TAG_CLOUD_ITEM_TEXT:
		vala_tag_cloud_item_set_text (self, g_value_get_string (value));
		break;
		case VALA_TAG_CLOUD_ITEM_OCCOURRENCES:
		vala_tag_cloud_item_set_occourrences (self, g_value_get_int (value));
		break;
		case VALA_TAG_CLOUD_ITEM_SELECT_STATUS:
		vala_tag_cloud_item_set_select_status (self, g_value_get_enum (value));
		break;
		case VALA_TAG_CLOUD_ITEM_HILIGHTED:
		vala_tag_cloud_item_set_hilighted (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



