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

/*  This file is part of corebird, a Gtk+ linux Twitter client.
 *  Copyright (C) 2013 Timm Bäder
 *
 *  corebird 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 3 of the License, or
 *  (at your option) any later version.
 *
 *  corebird 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 corebird.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>


#define TYPE_ITWITTER_ITEM (itwitter_item_get_type ())
#define ITWITTER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ITWITTER_ITEM, ITwitterItem))
#define IS_ITWITTER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ITWITTER_ITEM))
#define ITWITTER_ITEM_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_ITWITTER_ITEM, ITwitterItemIface))

typedef struct _ITwitterItem ITwitterItem;
typedef struct _ITwitterItemIface ITwitterItemIface;

#define TYPE_PROGRESS_ENTRY (progress_entry_get_type ())
#define PROGRESS_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PROGRESS_ENTRY, ProgressEntry))
#define PROGRESS_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PROGRESS_ENTRY, ProgressEntryClass))
#define IS_PROGRESS_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PROGRESS_ENTRY))
#define IS_PROGRESS_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PROGRESS_ENTRY))
#define PROGRESS_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PROGRESS_ENTRY, ProgressEntryClass))

typedef struct _ProgressEntry ProgressEntry;
typedef struct _ProgressEntryClass ProgressEntryClass;
typedef struct _ProgressEntryPrivate ProgressEntryPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _ITwitterItemIface {
	GTypeInterface parent_iface;
	gint (*update_time_delta) (ITwitterItem* self, GDateTime* now);
	gint64 (*get_sort_factor) (ITwitterItem* self);
	gboolean (*get_seen) (ITwitterItem* self);
	void (*set_seen) (ITwitterItem* self, gboolean value);
};

struct _ProgressEntry {
	GtkListBoxRow parent_instance;
	ProgressEntryPrivate * priv;
};

struct _ProgressEntryClass {
	GtkListBoxRowClass parent_class;
};


static gpointer progress_entry_parent_class = NULL;
static ITwitterItemIface* progress_entry_itwitter_item_parent_iface = NULL;

GType itwitter_item_get_type (void) G_GNUC_CONST;
GType progress_entry_get_type (void) G_GNUC_CONST;
enum  {
	PROGRESS_ENTRY_DUMMY_PROPERTY,
	PROGRESS_ENTRY_SORT_FACTOR,
	PROGRESS_ENTRY_SEEN
};
ProgressEntry* progress_entry_new (void);
ProgressEntry* progress_entry_construct (GType object_type);
static gint progress_entry_real_update_time_delta (ITwitterItem* base, GDateTime* now);
gint64 itwitter_item_get_sort_factor (ITwitterItem* self);
gboolean itwitter_item_get_seen (ITwitterItem* self);
static void _vala_progress_entry_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
void itwitter_item_set_seen (ITwitterItem* self, gboolean value);
static void _vala_progress_entry_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


ProgressEntry* progress_entry_construct (GType object_type) {
	ProgressEntry * self = NULL;
	GtkSpinner* spinner = NULL;
	GtkSpinner* _tmp0_ = NULL;
	GtkLabel* l = NULL;
	const gchar* _tmp1_ = NULL;
	GtkLabel* _tmp2_ = NULL;
	GtkBox* box = NULL;
	GtkBox* _tmp3_ = NULL;
	self = (ProgressEntry*) g_object_new (object_type, NULL);
	gtk_list_box_row_set_activatable (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_list_box_row_get_type (), GtkListBoxRow), FALSE);
	_tmp0_ = (GtkSpinner*) gtk_spinner_new ();
	g_object_ref_sink (_tmp0_);
	spinner = _tmp0_;
	_tmp1_ = _ ("Loading more data...");
	_tmp2_ = (GtkLabel*) gtk_label_new (_tmp1_);
	g_object_ref_sink (_tmp2_);
	l = _tmp2_;
	_tmp3_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
	g_object_ref_sink (_tmp3_);
	box = _tmp3_;
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (l, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_START);
	gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (l, gtk_widget_get_type (), GtkWidget), TRUE);
	gtk_widget_set_size_request (G_TYPE_CHECK_INSTANCE_CAST (spinner, gtk_widget_get_type (), GtkWidget), 16, 16);
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (spinner, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_END);
	gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (spinner, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_CENTER);
	gtk_widget_set_margin_top (G_TYPE_CHECK_INSTANCE_CAST (spinner, gtk_widget_get_type (), GtkWidget), 12);
	gtk_widget_set_margin_bottom (G_TYPE_CHECK_INSTANCE_CAST (spinner, gtk_widget_get_type (), GtkWidget), 12);
	gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (spinner, gtk_widget_get_type (), GtkWidget), TRUE);
	gtk_spinner_start (spinner);
	gtk_box_pack_start (box, G_TYPE_CHECK_INSTANCE_CAST (spinner, gtk_widget_get_type (), GtkWidget), TRUE, TRUE, (guint) 0);
	gtk_box_pack_start (box, G_TYPE_CHECK_INSTANCE_CAST (l, gtk_widget_get_type (), GtkWidget), TRUE, TRUE, (guint) 0);
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (box, gtk_widget_get_type (), GtkWidget));
	_g_object_unref0 (box);
	_g_object_unref0 (l);
	_g_object_unref0 (spinner);
	return self;
}


ProgressEntry* progress_entry_new (void) {
	return progress_entry_construct (TYPE_PROGRESS_ENTRY);
}


static gint progress_entry_real_update_time_delta (ITwitterItem* base, GDateTime* now) {
	ProgressEntry * self;
	gint result = 0;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PROGRESS_ENTRY, ProgressEntry);
	result = 0;
	return result;
}


static gint64 progress_entry_real_get_sort_factor (ITwitterItem* base) {
	gint64 result;
	ProgressEntry* self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PROGRESS_ENTRY, ProgressEntry);
	result = (gint64) 0;
	return result;
}


static gboolean progress_entry_real_get_seen (ITwitterItem* base) {
	gboolean result;
	ProgressEntry* self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PROGRESS_ENTRY, ProgressEntry);
	result = TRUE;
	return result;
}


static void progress_entry_real_set_seen (ITwitterItem* base, gboolean value) {
	ProgressEntry* self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PROGRESS_ENTRY, ProgressEntry);
	g_object_notify ((GObject *) self, "seen");
}


static void progress_entry_class_init (ProgressEntryClass * klass) {
	progress_entry_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->get_property = _vala_progress_entry_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_progress_entry_set_property;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROGRESS_ENTRY_SORT_FACTOR, g_param_spec_int64 ("sort-factor", "sort-factor", "sort-factor", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROGRESS_ENTRY_SEEN, g_param_spec_boolean ("seen", "seen", "seen", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
}


static void progress_entry_itwitter_item_interface_init (ITwitterItemIface * iface) {
	progress_entry_itwitter_item_parent_iface = g_type_interface_peek_parent (iface);
	iface->update_time_delta = (gint (*)(ITwitterItem*, GDateTime*)) progress_entry_real_update_time_delta;
	iface->get_sort_factor = progress_entry_real_get_sort_factor;
	iface->get_seen = progress_entry_real_get_seen;
	iface->set_seen = progress_entry_real_set_seen;
}


static void progress_entry_instance_init (ProgressEntry * self) {
}


GType progress_entry_get_type (void) {
	static volatile gsize progress_entry_type_id__volatile = 0;
	if (g_once_init_enter (&progress_entry_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ProgressEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) progress_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProgressEntry), 0, (GInstanceInitFunc) progress_entry_instance_init, NULL };
		static const GInterfaceInfo itwitter_item_info = { (GInterfaceInitFunc) progress_entry_itwitter_item_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType progress_entry_type_id;
		progress_entry_type_id = g_type_register_static (gtk_list_box_row_get_type (), "ProgressEntry", &g_define_type_info, 0);
		g_type_add_interface_static (progress_entry_type_id, TYPE_ITWITTER_ITEM, &itwitter_item_info);
		g_once_init_leave (&progress_entry_type_id__volatile, progress_entry_type_id);
	}
	return progress_entry_type_id__volatile;
}


static void _vala_progress_entry_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ProgressEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_PROGRESS_ENTRY, ProgressEntry);
	switch (property_id) {
		case PROGRESS_ENTRY_SORT_FACTOR:
		g_value_set_int64 (value, itwitter_item_get_sort_factor (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_ITWITTER_ITEM, ITwitterItem)));
		break;
		case PROGRESS_ENTRY_SEEN:
		g_value_set_boolean (value, itwitter_item_get_seen (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_ITWITTER_ITEM, ITwitterItem)));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_progress_entry_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	ProgressEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_PROGRESS_ENTRY, ProgressEntry);
	switch (property_id) {
		case PROGRESS_ENTRY_SEEN:
		itwitter_item_set_seen (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_ITWITTER_ITEM, ITwitterItem), g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



