Logo Search packages:      
Sourcecode: valatoys version File versions  Download package

tagclouditem.c

/* tagclouditem.c generated by valac 0.10.0, 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_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))

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

struct _ValaTagCloudItemClass {
      GObjectClass parent_class;
};

00057 struct _ValaTagCloudItemPrivate {
      char* _text;
      gint _occourrences;
      gboolean _selected;
      gboolean _hilighted;
};


static gpointer vala_tag_cloud_item_parent_class = NULL;

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_SELECTED,
      VALA_TAG_CLOUD_ITEM_HILIGHTED
};
ValaTagCloudItem* vala_tag_cloud_item_new (const char* text, gint occourrences, gboolean selected);
ValaTagCloudItem* vala_tag_cloud_item_construct (GType object_type, const char* text, gint occourrences, gboolean selected);
const char* vala_tag_cloud_item_get_text (ValaTagCloudItem* self);
void vala_tag_cloud_item_set_text (ValaTagCloudItem* self, const char* value);
gint vala_tag_cloud_item_get_occourrences (ValaTagCloudItem* self);
void vala_tag_cloud_item_set_occourrences (ValaTagCloudItem* self, gint value);
gboolean vala_tag_cloud_item_get_selected (ValaTagCloudItem* self);
void vala_tag_cloud_item_set_selected (ValaTagCloudItem* self, gboolean 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_tag_cloud_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void vala_tag_cloud_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);



ValaTagCloudItem* vala_tag_cloud_item_construct (GType object_type, const char* text, gint occourrences, gboolean selected) {
      ValaTagCloudItem * self;
      char* _tmp0_;
      g_return_val_if_fail (text != NULL, NULL);
      self = (ValaTagCloudItem*) g_object_new (object_type, NULL);
      self->priv->_text = (_tmp0_ = g_strdup (text), _g_free0 (self->priv->_text), _tmp0_);
      self->priv->_occourrences = occourrences;
      self->priv->_selected = selected;
      return self;
}


ValaTagCloudItem* vala_tag_cloud_item_new (const char* text, gint occourrences, gboolean selected) {
      return vala_tag_cloud_item_construct (VALA_TYPE_TAG_CLOUD_ITEM, text, occourrences, selected);
}


const char* vala_tag_cloud_item_get_text (ValaTagCloudItem* self) {
      const char* 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 char* value) {
      char* _tmp0_;
      g_return_if_fail (self != NULL);
      self->priv->_text = (_tmp0_ = g_strdup (value), _g_free0 (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");
}


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


void vala_tag_cloud_item_set_selected (ValaTagCloudItem* self, gboolean value) {
      g_return_if_fail (self != NULL);
      self->priv->_selected = value;
      g_object_notify ((GObject *) self, "selected");
}


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_tag_cloud_item_get_property;
      G_OBJECT_CLASS (klass)->set_property = 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_SELECTED, g_param_spec_boolean ("selected", "selected", "selected", FALSE, 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));
}


static void vala_tag_cloud_item_instance_init (ValaTagCloudItem * self) {
      self->priv = VALA_TAG_CLOUD_ITEM_GET_PRIVATE (self);
      self->priv->_text = g_strdup ("");
      self->priv->_occourrences = 0;
      self->priv->_selected = FALSE;
      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_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_SELECTED:
            g_value_set_boolean (value, vala_tag_cloud_item_get_selected (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_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_SELECTED:
            vala_tag_cloud_item_set_selected (self, g_value_get_boolean (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;
      }
}





Generated by  Doxygen 1.6.0   Back to index