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

default-model.c

/* default-model.c generated by valac, the Vala compiler
 * generated from default-model.vala, do not modify */

/*
 * Copyright (C) 2009 Canonical Ltd
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3 as
 * published by the Free Software Foundation.
 *
 * 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, see <http://www.gnu.org/licenses/>.
 *
 * Authored by Mirco "MacSlow" Müller <mirco.mueller@canonical.com>
 *
 */

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


#define UNITY_PLACES_DEFAULT_TYPE_MODEL (unity_places_default_model_get_type ())
#define UNITY_PLACES_DEFAULT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_PLACES_DEFAULT_TYPE_MODEL, UnityPlacesDefaultModel))
#define UNITY_PLACES_DEFAULT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_PLACES_DEFAULT_TYPE_MODEL, UnityPlacesDefaultModelClass))
#define UNITY_PLACES_DEFAULT_IS_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_PLACES_DEFAULT_TYPE_MODEL))
#define UNITY_PLACES_DEFAULT_IS_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_PLACES_DEFAULT_TYPE_MODEL))
#define UNITY_PLACES_DEFAULT_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_PLACES_DEFAULT_TYPE_MODEL, UnityPlacesDefaultModelClass))

typedef struct _UnityPlacesDefaultModel UnityPlacesDefaultModel;
typedef struct _UnityPlacesDefaultModelClass UnityPlacesDefaultModelClass;
typedef struct _UnityPlacesDefaultModelPrivate UnityPlacesDefaultModelPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _UnityPlacesDefaultModel {
      GObject parent_instance;
      UnityPlacesDefaultModelPrivate * priv;
      char* icon_name;
      char* primary_text;
      char* secondary_text;
};

struct _UnityPlacesDefaultModelClass {
      GObjectClass parent_class;
};


static gpointer unity_places_default_model_parent_class = NULL;

GType unity_places_default_model_get_type (void);
enum  {
      UNITY_PLACES_DEFAULT_MODEL_DUMMY_PROPERTY
};
UnityPlacesDefaultModel* unity_places_default_model_new (const char* icon_name, const char* primary_text, const char* secondary_text);
UnityPlacesDefaultModel* unity_places_default_model_construct (GType object_type, const char* icon_name, const char* primary_text, const char* secondary_text);
static GObject * unity_places_default_model_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void unity_places_default_model_finalize (GObject* obj);



UnityPlacesDefaultModel* unity_places_default_model_construct (GType object_type, const char* icon_name, const char* primary_text, const char* secondary_text) {
      UnityPlacesDefaultModel * self;
      char* _tmp0_;
      char* _tmp1_;
      char* _tmp2_;
      g_return_val_if_fail (icon_name != NULL, NULL);
      g_return_val_if_fail (primary_text != NULL, NULL);
      g_return_val_if_fail (secondary_text != NULL, NULL);
      self = g_object_newv (object_type, 0, NULL);
      self->icon_name = (_tmp0_ = g_strdup (icon_name), _g_free0 (self->icon_name), _tmp0_);
      self->primary_text = (_tmp1_ = g_strdup (primary_text), _g_free0 (self->primary_text), _tmp1_);
      self->secondary_text = (_tmp2_ = g_strdup (secondary_text), _g_free0 (self->secondary_text), _tmp2_);
      return self;
}


UnityPlacesDefaultModel* unity_places_default_model_new (const char* icon_name, const char* primary_text, const char* secondary_text) {
      return unity_places_default_model_construct (UNITY_PLACES_DEFAULT_TYPE_MODEL, icon_name, primary_text, secondary_text);
}


static GObject * unity_places_default_model_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
      GObject * obj;
      GObjectClass * parent_class;
      UnityPlacesDefaultModel * self;
      parent_class = G_OBJECT_CLASS (unity_places_default_model_parent_class);
      obj = parent_class->constructor (type, n_construct_properties, construct_properties);
      self = UNITY_PLACES_DEFAULT_MODEL (obj);
      {
      }
      return obj;
}


static void unity_places_default_model_class_init (UnityPlacesDefaultModelClass * klass) {
      unity_places_default_model_parent_class = g_type_class_peek_parent (klass);
      G_OBJECT_CLASS (klass)->constructor = unity_places_default_model_constructor;
      G_OBJECT_CLASS (klass)->finalize = unity_places_default_model_finalize;
}


static void unity_places_default_model_instance_init (UnityPlacesDefaultModel * self) {
}


static void unity_places_default_model_finalize (GObject* obj) {
      UnityPlacesDefaultModel * self;
      self = UNITY_PLACES_DEFAULT_MODEL (obj);
      _g_free0 (self->icon_name);
      _g_free0 (self->primary_text);
      _g_free0 (self->secondary_text);
      G_OBJECT_CLASS (unity_places_default_model_parent_class)->finalize (obj);
}


GType unity_places_default_model_get_type (void) {
      static volatile gsize unity_places_default_model_type_id__volatile = 0;
      if (g_once_init_enter (&unity_places_default_model_type_id__volatile)) {
            static const GTypeInfo g_define_type_info = { sizeof (UnityPlacesDefaultModelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_places_default_model_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityPlacesDefaultModel), 0, (GInstanceInitFunc) unity_places_default_model_instance_init, NULL };
            GType unity_places_default_model_type_id;
            unity_places_default_model_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityPlacesDefaultModel", &g_define_type_info, 0);
            g_once_init_leave (&unity_places_default_model_type_id__volatile, unity_places_default_model_type_id);
      }
      return unity_places_default_model_type_id__volatile;
}





Generated by  Doxygen 1.6.0   Back to index