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

/*
 * Copyright (C) 2013  Paolo Borelli <pborelli@gnome.org>
 *
 * 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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

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

#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 CLOCKS_TYPE_CONTENT_ITEM (clocks_content_item_get_type ())
#define CLOCKS_CONTENT_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TYPE_CONTENT_ITEM, ClocksContentItem))
#define CLOCKS_IS_CONTENT_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TYPE_CONTENT_ITEM))
#define CLOCKS_CONTENT_ITEM_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLOCKS_TYPE_CONTENT_ITEM, ClocksContentItemIface))

typedef struct _ClocksContentItem ClocksContentItem;
typedef struct _ClocksContentItemIface ClocksContentItemIface;

#define CLOCKS_TYPE_CONTENT_STORE (clocks_content_store_get_type ())
#define CLOCKS_CONTENT_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TYPE_CONTENT_STORE, ClocksContentStore))
#define CLOCKS_CONTENT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_TYPE_CONTENT_STORE, ClocksContentStoreClass))
#define CLOCKS_IS_CONTENT_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TYPE_CONTENT_STORE))
#define CLOCKS_IS_CONTENT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_TYPE_CONTENT_STORE))
#define CLOCKS_CONTENT_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_TYPE_CONTENT_STORE, ClocksContentStoreClass))

typedef struct _ClocksContentStore ClocksContentStore;
typedef struct _ClocksContentStoreClass ClocksContentStoreClass;
typedef struct _ClocksContentStorePrivate ClocksContentStorePrivate;
enum  {
	CLOCKS_CONTENT_STORE_0_PROPERTY,
	CLOCKS_CONTENT_STORE_NUM_PROPERTIES
};
static GParamSpec* clocks_content_store_properties[CLOCKS_CONTENT_STORE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef void (*ClocksContentStoreForeachFunc) (ClocksContentItem* item, gpointer user_data);
typedef gboolean (*ClocksContentStoreFindFunc) (ClocksContentItem* item, gpointer user_data);
typedef struct _Block11Data Block11Data;
#define _g_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (var), NULL)))
#define _g_variant_builder_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_builder_unref (var), NULL)))
typedef ClocksContentItem* (*ClocksContentStoreDeserializeItemFunc) (GVariant* v, gpointer user_data);
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_variant_iter_free0(var) ((var == NULL) ? NULL : (var = (g_variant_iter_free (var), NULL)))

#define CLOCKS_TYPE_AM_PM_TOGGLE_BUTTON (clocks_am_pm_toggle_button_get_type ())
#define CLOCKS_AM_PM_TOGGLE_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TYPE_AM_PM_TOGGLE_BUTTON, ClocksAmPmToggleButton))
#define CLOCKS_AM_PM_TOGGLE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_TYPE_AM_PM_TOGGLE_BUTTON, ClocksAmPmToggleButtonClass))
#define CLOCKS_IS_AM_PM_TOGGLE_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TYPE_AM_PM_TOGGLE_BUTTON))
#define CLOCKS_IS_AM_PM_TOGGLE_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_TYPE_AM_PM_TOGGLE_BUTTON))
#define CLOCKS_AM_PM_TOGGLE_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_TYPE_AM_PM_TOGGLE_BUTTON, ClocksAmPmToggleButtonClass))

typedef struct _ClocksAmPmToggleButton ClocksAmPmToggleButton;
typedef struct _ClocksAmPmToggleButtonClass ClocksAmPmToggleButtonClass;
typedef struct _ClocksAmPmToggleButtonPrivate ClocksAmPmToggleButtonPrivate;
typedef enum  {
	CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_AM,
	CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_PM
} ClocksAmPmToggleButtonAmPm;

#define CLOCKS_AM_PM_TOGGLE_BUTTON_TYPE_AM_PM (clocks_am_pm_toggle_button_am_pm_get_type ())
enum  {
	CLOCKS_AM_PM_TOGGLE_BUTTON_0_PROPERTY,
	CLOCKS_AM_PM_TOGGLE_BUTTON_CHOICE_PROPERTY,
	CLOCKS_AM_PM_TOGGLE_BUTTON_NUM_PROPERTIES
};
static GParamSpec* clocks_am_pm_toggle_button_properties[CLOCKS_AM_PM_TOGGLE_BUTTON_NUM_PROPERTIES];
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _ClocksContentItemIface {
	GTypeInterface parent_iface;
	void (*serialize) (ClocksContentItem* self, GVariantBuilder* builder);
	const gchar* (*get_name) (ClocksContentItem* self);
	void (*set_name) (ClocksContentItem* self, const gchar* value);
};

struct _ClocksContentStore {
	GObject parent_instance;
	ClocksContentStorePrivate * priv;
};

struct _ClocksContentStoreClass {
	GObjectClass parent_class;
};

struct _ClocksContentStorePrivate {
	GListStore* store;
};

struct _Block11Data {
	int _ref_count_;
	ClocksContentStore* self;
	ClocksContentStoreFindFunc func;
	gpointer func_target;
};

struct _ClocksAmPmToggleButton {
	GtkButton parent_instance;
	ClocksAmPmToggleButtonPrivate * priv;
};

struct _ClocksAmPmToggleButtonClass {
	GtkButtonClass parent_class;
};

struct _ClocksAmPmToggleButtonPrivate {
	ClocksAmPmToggleButtonAmPm _choice;
	GtkStack* stack;
	GtkLabel* am_label;
	GtkLabel* pm_label;
};

static gint ClocksContentStore_private_offset;
static gpointer clocks_content_store_parent_class = NULL;
static GListModelInterface * clocks_content_store_g_list_model_parent_iface = NULL;
static gint ClocksAmPmToggleButton_private_offset;
static gpointer clocks_am_pm_toggle_button_parent_class = NULL;

VALA_EXTERN GType clocks_content_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClocksContentItem, g_object_unref)
VALA_EXTERN void clocks_content_item_serialize (ClocksContentItem* self,
                                    GVariantBuilder* builder);
VALA_EXTERN const gchar* clocks_content_item_get_name (ClocksContentItem* self);
VALA_EXTERN void clocks_content_item_set_name (ClocksContentItem* self,
                                   const gchar* value);
static GType clocks_content_item_get_type_once (void);
VALA_EXTERN GType clocks_content_store_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClocksContentStore, g_object_unref)
static GType clocks_content_store_real_get_item_type (GListModel* base);
static guint clocks_content_store_real_get_n_items (GListModel* base);
static GObject* clocks_content_store_real_get_item (GListModel* base,
                                             guint position);
VALA_EXTERN void clocks_content_store_add (ClocksContentStore* self,
                               ClocksContentItem* item);
VALA_EXTERN void clocks_content_store_remove (ClocksContentStore* self,
                                  ClocksContentItem* item);
VALA_EXTERN void clocks_content_store_foreach (ClocksContentStore* self,
                                   ClocksContentStoreForeachFunc func,
                                   gpointer func_target);
VALA_EXTERN ClocksContentItem* clocks_content_store_find (ClocksContentStore* self,
                                              ClocksContentStoreFindFunc func,
                                              gpointer func_target);
static Block11Data* block11_data_ref (Block11Data* _data11_);
static void block11_data_unref (void * _userdata_);
static gboolean __lambda4_ (Block11Data* _data11_,
                     GObject* item);
static gboolean ___lambda4__gequal_func_full (gconstpointer a,
                                       gconstpointer b,
                                       gpointer self);
VALA_EXTERN GVariant* clocks_content_store_serialize (ClocksContentStore* self);
VALA_EXTERN void clocks_content_store_deserialize (ClocksContentStore* self,
                                       GVariant* variant,
                                       ClocksContentStoreDeserializeItemFunc deserialize_item,
                                       gpointer deserialize_item_target);
VALA_EXTERN ClocksContentStore* clocks_content_store_new (void);
VALA_EXTERN ClocksContentStore* clocks_content_store_construct (GType object_type);
static GObject * clocks_content_store_constructor (GType type,
                                            guint n_construct_properties,
                                            GObjectConstructParam * construct_properties);
static void _clocks_content_store___lambda5_ (ClocksContentStore* self,
                                       guint position,
                                       guint removed,
                                       guint added);
static void __clocks_content_store___lambda5__g_list_model_items_changed (GListModel* _sender,
                                                                   guint position,
                                                                   guint removed,
                                                                   guint added,
                                                                   gpointer self);
static void clocks_content_store_finalize (GObject * obj);
static GType clocks_content_store_get_type_once (void);
VALA_EXTERN GType clocks_am_pm_toggle_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClocksAmPmToggleButton, g_object_unref)
VALA_EXTERN GType clocks_am_pm_toggle_button_am_pm_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ClocksAmPmToggleButton* clocks_am_pm_toggle_button_new (void);
VALA_EXTERN ClocksAmPmToggleButton* clocks_am_pm_toggle_button_construct (GType object_type);
static void __lambda71_ (ClocksAmPmToggleButton* self);
VALA_EXTERN ClocksAmPmToggleButtonAmPm clocks_am_pm_toggle_button_get_choice (ClocksAmPmToggleButton* self);
VALA_EXTERN void clocks_am_pm_toggle_button_set_choice (ClocksAmPmToggleButton* self,
                                            ClocksAmPmToggleButtonAmPm value);
static void ___lambda71__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void clocks_am_pm_toggle_button_finalize (GObject * obj);
static GType clocks_am_pm_toggle_button_get_type_once (void);
static void _vala_clocks_am_pm_toggle_button_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
static void _vala_clocks_am_pm_toggle_button_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec);

void
clocks_content_item_serialize (ClocksContentItem* self,
                               GVariantBuilder* builder)
{
	ClocksContentItemIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = CLOCKS_CONTENT_ITEM_GET_INTERFACE (self);
	if (_iface_->serialize) {
		_iface_->serialize (self, builder);
	}
}

const gchar*
clocks_content_item_get_name (ClocksContentItem* self)
{
	ClocksContentItemIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = CLOCKS_CONTENT_ITEM_GET_INTERFACE (self);
	if (_iface_->get_name) {
		return _iface_->get_name (self);
	}
	return NULL;
}

void
clocks_content_item_set_name (ClocksContentItem* self,
                              const gchar* value)
{
	ClocksContentItemIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = CLOCKS_CONTENT_ITEM_GET_INTERFACE (self);
	if (_iface_->set_name) {
		_iface_->set_name (self, value);
	}
}

static void
clocks_content_item_default_init (ClocksContentItemIface * iface,
                                  gpointer iface_data)
{
	g_object_interface_install_property (iface, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

 G_GNUC_NO_INLINE static GType
clocks_content_item_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ClocksContentItemIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_content_item_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType clocks_content_item_type_id;
	clocks_content_item_type_id = g_type_register_static (G_TYPE_INTERFACE, "ClocksContentItem", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (clocks_content_item_type_id, G_TYPE_OBJECT);
	return clocks_content_item_type_id;
}

GType
clocks_content_item_get_type (void)
{
	static gsize clocks_content_item_type_id__once = 0;
	if (g_once_init_enter (&clocks_content_item_type_id__once)) {
		GType clocks_content_item_type_id;
		clocks_content_item_type_id = clocks_content_item_get_type_once ();
		g_once_init_leave (&clocks_content_item_type_id__once, clocks_content_item_type_id);
	}
	return clocks_content_item_type_id__once;
}

static inline gpointer
clocks_content_store_get_instance_private (ClocksContentStore* self)
{
	return G_STRUCT_MEMBER_P (self, ClocksContentStore_private_offset);
}

static GType
clocks_content_store_real_get_item_type (GListModel* base)
{
	ClocksContentStore * self;
	GListStore* _tmp0_;
	GType result;
	self = (ClocksContentStore*) base;
	_tmp0_ = self->priv->store;
	result = g_list_model_get_item_type ((GListModel*) _tmp0_);
	return result;
}

static guint
clocks_content_store_real_get_n_items (GListModel* base)
{
	ClocksContentStore * self;
	GListStore* _tmp0_;
	guint result;
	self = (ClocksContentStore*) base;
	_tmp0_ = self->priv->store;
	result = g_list_model_get_n_items ((GListModel*) _tmp0_);
	return result;
}

static GObject*
clocks_content_store_real_get_item (GListModel* base,
                                    guint position)
{
	ClocksContentStore * self;
	GListStore* _tmp0_;
	GObject* _tmp1_;
	GObject* result;
	self = (ClocksContentStore*) base;
	_tmp0_ = self->priv->store;
	_tmp1_ = g_list_model_get_item ((GListModel*) _tmp0_, position);
	result = _tmp1_;
	return result;
}

void
clocks_content_store_add (ClocksContentStore* self,
                          ClocksContentItem* item)
{
	GListStore* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	_tmp0_ = self->priv->store;
	g_list_store_append (_tmp0_, (GObject*) item);
}

void
clocks_content_store_remove (ClocksContentStore* self,
                             ClocksContentItem* item)
{
	guint position = 0U;
	GListStore* _tmp0_;
	guint _tmp1_ = 0U;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	position = GTK_INVALID_LIST_POSITION;
	_tmp0_ = self->priv->store;
	_tmp2_ = g_list_store_find (_tmp0_, (GObject*) item, &_tmp1_);
	position = _tmp1_;
	if (_tmp2_) {
		GListStore* _tmp3_;
		_tmp3_ = self->priv->store;
		g_list_store_remove (_tmp3_, position);
	}
}

void
clocks_content_store_foreach (ClocksContentStore* self,
                              ClocksContentStoreForeachFunc func,
                              gpointer func_target)
{
	guint n = 0U;
	GListStore* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->store;
	n = g_list_model_get_n_items ((GListModel*) _tmp0_);
	{
		guint i = 0U;
		i = (guint) 0;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				GListStore* _tmp3_;
				GObject* _tmp4_;
				ClocksContentItem* _tmp5_;
				if (!_tmp1_) {
					guint _tmp2_;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp1_ = FALSE;
				if (!(i < n)) {
					break;
				}
				_tmp3_ = self->priv->store;
				_tmp4_ = g_list_model_get_object ((GListModel*) _tmp3_, i);
				_tmp5_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, CLOCKS_TYPE_CONTENT_ITEM, ClocksContentItem);
				func (_tmp5_, func_target);
				_g_object_unref0 (_tmp5_);
			}
		}
	}
}

static Block11Data*
block11_data_ref (Block11Data* _data11_)
{
	g_atomic_int_inc (&_data11_->_ref_count_);
	return _data11_;
}

static void
block11_data_unref (void * _userdata_)
{
	Block11Data* _data11_;
	_data11_ = (Block11Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data11_->_ref_count_)) {
		ClocksContentStore* self;
		self = _data11_->self;
		_g_object_unref0 (self);
		g_slice_free (Block11Data, _data11_);
	}
}

static gboolean
__lambda4_ (Block11Data* _data11_,
            GObject* item)
{
	ClocksContentStore* self;
	gboolean result;
	self = _data11_->self;
	g_return_val_if_fail (item != NULL, FALSE);
	result = _data11_->func (G_TYPE_CHECK_INSTANCE_CAST (item, CLOCKS_TYPE_CONTENT_ITEM, ClocksContentItem), _data11_->func_target);
	return result;
}

static gboolean
___lambda4__gequal_func_full (gconstpointer a,
                              gconstpointer b,
                              gpointer self)
{
	gboolean result;
	result = __lambda4_ (self, (GObject*) a);
	return result;
}

ClocksContentItem*
clocks_content_store_find (ClocksContentStore* self,
                           ClocksContentStoreFindFunc func,
                           gpointer func_target)
{
	Block11Data* _data11_;
	guint position = 0U;
	GListStore* _tmp0_;
	guint _tmp1_ = 0U;
	gboolean _tmp2_;
	ClocksContentItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	_data11_ = g_slice_new0 (Block11Data);
	_data11_->_ref_count_ = 1;
	_data11_->self = g_object_ref (self);
	_data11_->func = func;
	_data11_->func_target = func_target;
	position = GTK_INVALID_LIST_POSITION;
	_tmp0_ = self->priv->store;
	_tmp2_ = g_list_store_find_with_equal_func_full (_tmp0_, NULL, ___lambda4__gequal_func_full, _data11_, &_tmp1_);
	position = _tmp1_;
	if (_tmp2_) {
		GListStore* _tmp3_;
		GObject* _tmp4_;
		_tmp3_ = self->priv->store;
		_tmp4_ = g_list_model_get_object ((GListModel*) _tmp3_, position);
		result = G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, CLOCKS_TYPE_CONTENT_ITEM, ClocksContentItem);
		block11_data_unref (_data11_);
		_data11_ = NULL;
		return result;
	}
	result = NULL;
	block11_data_unref (_data11_);
	_data11_ = NULL;
	return result;
}

GVariant*
clocks_content_store_serialize (ClocksContentStore* self)
{
	GVariantBuilder* builder = NULL;
	GVariantType* _tmp0_;
	GVariantType* _tmp1_;
	GVariantBuilder* _tmp2_;
	GVariantBuilder* _tmp3_;
	guint n = 0U;
	GListStore* _tmp4_;
	GVariantBuilder* _tmp11_;
	GVariant* _tmp12_;
	GVariant* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_variant_type_new ("aa{sv}");
	_tmp1_ = _tmp0_;
	_tmp2_ = g_variant_builder_new (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_variant_type_free0 (_tmp1_);
	builder = _tmp3_;
	_tmp4_ = self->priv->store;
	n = g_list_model_get_n_items ((GListModel*) _tmp4_);
	{
		guint i = 0U;
		i = (guint) 0;
		{
			gboolean _tmp5_ = FALSE;
			_tmp5_ = TRUE;
			while (TRUE) {
				GListStore* _tmp7_;
				GObject* _tmp8_;
				ClocksContentItem* _tmp9_;
				GVariantBuilder* _tmp10_;
				if (!_tmp5_) {
					guint _tmp6_;
					_tmp6_ = i;
					i = _tmp6_ + 1;
				}
				_tmp5_ = FALSE;
				if (!(i < n)) {
					break;
				}
				_tmp7_ = self->priv->store;
				_tmp8_ = g_list_model_get_object ((GListModel*) _tmp7_, i);
				_tmp9_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, CLOCKS_TYPE_CONTENT_ITEM, ClocksContentItem);
				_tmp10_ = builder;
				clocks_content_item_serialize (_tmp9_, _tmp10_);
				_g_object_unref0 (_tmp9_);
			}
		}
	}
	_tmp11_ = builder;
	_tmp12_ = g_variant_builder_end (_tmp11_);
	g_variant_ref_sink (_tmp12_);
	result = _tmp12_;
	_g_variant_builder_unref0 (builder);
	return result;
}

void
clocks_content_store_deserialize (ClocksContentStore* self,
                                  GVariant* variant,
                                  ClocksContentStoreDeserializeItemFunc deserialize_item,
                                  gpointer deserialize_item_target)
{
	GVariant* item = NULL;
	GVariantIter* iter = NULL;
	GVariantIter* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (variant != NULL);
	_tmp0_ = g_variant_iter_new (variant);
	iter = _tmp0_;
	while (TRUE) {
		GVariantIter* _tmp1_;
		GVariant* _tmp2_ = NULL;
		gboolean _tmp3_;
		ClocksContentItem* i = NULL;
		GVariant* _tmp4_;
		ClocksContentItem* _tmp5_;
		ClocksContentItem* _tmp6_;
		_tmp1_ = iter;
		_tmp3_ = g_variant_iter_next (_tmp1_, "@a{sv}", &_tmp2_, NULL);
		_g_variant_unref0 (item);
		item = _tmp2_;
		if (!_tmp3_) {
			break;
		}
		_tmp4_ = item;
		_tmp5_ = deserialize_item (_tmp4_, deserialize_item_target);
		i = _tmp5_;
		_tmp6_ = i;
		if (_tmp6_ != NULL) {
			ClocksContentItem* _tmp7_;
			_tmp7_ = i;
			clocks_content_store_add (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, CLOCKS_TYPE_CONTENT_ITEM, ClocksContentItem));
		}
		_g_object_unref0 (i);
	}
	_g_variant_iter_free0 (iter);
	_g_variant_unref0 (item);
}

ClocksContentStore*
clocks_content_store_construct (GType object_type)
{
	ClocksContentStore * self = NULL;
	self = (ClocksContentStore*) g_object_new (object_type, NULL);
	return self;
}

ClocksContentStore*
clocks_content_store_new (void)
{
	return clocks_content_store_construct (CLOCKS_TYPE_CONTENT_STORE);
}

static void
_clocks_content_store___lambda5_ (ClocksContentStore* self,
                                  guint position,
                                  guint removed,
                                  guint added)
{
	g_list_model_items_changed ((GListModel*) self, position, removed, added);
}

static void
__clocks_content_store___lambda5__g_list_model_items_changed (GListModel* _sender,
                                                              guint position,
                                                              guint removed,
                                                              guint added,
                                                              gpointer self)
{
	_clocks_content_store___lambda5_ ((ClocksContentStore*) self, position, removed, added);
}

static GObject *
clocks_content_store_constructor (GType type,
                                  guint n_construct_properties,
                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ClocksContentStore * self;
	GListStore* _tmp0_;
	GListStore* _tmp1_;
	parent_class = G_OBJECT_CLASS (clocks_content_store_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_TYPE_CONTENT_STORE, ClocksContentStore);
	_tmp0_ = g_list_store_new (CLOCKS_TYPE_CONTENT_ITEM);
	_g_object_unref0 (self->priv->store);
	self->priv->store = _tmp0_;
	_tmp1_ = self->priv->store;
	g_signal_connect_object ((GListModel*) _tmp1_, "items-changed", (GCallback) __clocks_content_store___lambda5__g_list_model_items_changed, self, 0);
	return obj;
}

static void
clocks_content_store_class_init (ClocksContentStoreClass * klass,
                                 gpointer klass_data)
{
	clocks_content_store_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ClocksContentStore_private_offset);
	G_OBJECT_CLASS (klass)->constructor = clocks_content_store_constructor;
	G_OBJECT_CLASS (klass)->finalize = clocks_content_store_finalize;
}

static void
clocks_content_store_g_list_model_interface_init (GListModelInterface * iface,
                                                  gpointer iface_data)
{
	clocks_content_store_g_list_model_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_item_type = (GType (*) (GListModel*)) clocks_content_store_real_get_item_type;
	iface->get_n_items = (guint (*) (GListModel*)) clocks_content_store_real_get_n_items;
	iface->get_item = (GObject* (*) (GListModel*, guint)) clocks_content_store_real_get_item;
}

static void
clocks_content_store_instance_init (ClocksContentStore * self,
                                    gpointer klass)
{
	self->priv = clocks_content_store_get_instance_private (self);
}

static void
clocks_content_store_finalize (GObject * obj)
{
	ClocksContentStore * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_TYPE_CONTENT_STORE, ClocksContentStore);
	_g_object_unref0 (self->priv->store);
	G_OBJECT_CLASS (clocks_content_store_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
clocks_content_store_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ClocksContentStoreClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_content_store_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksContentStore), 0, (GInstanceInitFunc) clocks_content_store_instance_init, NULL };
	static const GInterfaceInfo g_list_model_info = { (GInterfaceInitFunc) clocks_content_store_g_list_model_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType clocks_content_store_type_id;
	clocks_content_store_type_id = g_type_register_static (G_TYPE_OBJECT, "ClocksContentStore", &g_define_type_info, 0);
	g_type_add_interface_static (clocks_content_store_type_id, g_list_model_get_type (), &g_list_model_info);
	ClocksContentStore_private_offset = g_type_add_instance_private (clocks_content_store_type_id, sizeof (ClocksContentStorePrivate));
	return clocks_content_store_type_id;
}

GType
clocks_content_store_get_type (void)
{
	static gsize clocks_content_store_type_id__once = 0;
	if (g_once_init_enter (&clocks_content_store_type_id__once)) {
		GType clocks_content_store_type_id;
		clocks_content_store_type_id = clocks_content_store_get_type_once ();
		g_once_init_leave (&clocks_content_store_type_id__once, clocks_content_store_type_id);
	}
	return clocks_content_store_type_id__once;
}

static inline gpointer
clocks_am_pm_toggle_button_get_instance_private (ClocksAmPmToggleButton* self)
{
	return G_STRUCT_MEMBER_P (self, ClocksAmPmToggleButton_private_offset);
}

 G_GNUC_NO_INLINE static GType
clocks_am_pm_toggle_button_am_pm_get_type_once (void)
{
	static const GEnumValue values[] = {{CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_AM, "CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_AM", "am"}, {CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_PM, "CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_PM", "pm"}, {0, NULL, NULL}};
	GType clocks_am_pm_toggle_button_am_pm_type_id;
	clocks_am_pm_toggle_button_am_pm_type_id = g_enum_register_static ("ClocksAmPmToggleButtonAmPm", values);
	return clocks_am_pm_toggle_button_am_pm_type_id;
}

GType
clocks_am_pm_toggle_button_am_pm_get_type (void)
{
	static gsize clocks_am_pm_toggle_button_am_pm_type_id__once = 0;
	if (g_once_init_enter (&clocks_am_pm_toggle_button_am_pm_type_id__once)) {
		GType clocks_am_pm_toggle_button_am_pm_type_id;
		clocks_am_pm_toggle_button_am_pm_type_id = clocks_am_pm_toggle_button_am_pm_get_type_once ();
		g_once_init_leave (&clocks_am_pm_toggle_button_am_pm_type_id__once, clocks_am_pm_toggle_button_am_pm_type_id);
	}
	return clocks_am_pm_toggle_button_am_pm_type_id__once;
}

static void
__lambda71_ (ClocksAmPmToggleButton* self)
{
	ClocksAmPmToggleButtonAmPm _tmp0_ = 0;
	ClocksAmPmToggleButtonAmPm _tmp1_;
	ClocksAmPmToggleButtonAmPm _tmp2_;
	_tmp1_ = clocks_am_pm_toggle_button_get_choice (self);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_AM) {
		_tmp0_ = CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_PM;
	} else {
		_tmp0_ = CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_AM;
	}
	clocks_am_pm_toggle_button_set_choice (self, _tmp0_);
}

static void
___lambda71__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda71_ ((ClocksAmPmToggleButton*) self);
}

ClocksAmPmToggleButton*
clocks_am_pm_toggle_button_construct (GType object_type)
{
	ClocksAmPmToggleButton * self = NULL;
	GtkStack* _tmp0_;
	gchar* str = NULL;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	GtkLabel* _tmp6_;
	GDateTime* _tmp7_;
	GDateTime* _tmp8_;
	gchar* _tmp9_;
	const gchar* _tmp10_;
	GtkLabel* _tmp11_;
	GtkStack* _tmp12_;
	GtkLabel* _tmp13_;
	GtkStack* _tmp14_;
	GtkLabel* _tmp15_;
	GtkStack* _tmp16_;
	GtkStack* _tmp17_;
	GtkLabel* _tmp18_;
	self = (ClocksAmPmToggleButton*) g_object_new (object_type, NULL);
	_tmp0_ = (GtkStack*) gtk_stack_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->stack);
	self->priv->stack = _tmp0_;
	gtk_widget_add_css_class ((GtkWidget*) self, "clocks-ampm-toggle-button");
	_tmp1_ = g_date_time_new_utc (1, 1, 1, 0, 0, (gdouble) 0);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_date_time_format (_tmp2_, "%p");
	_tmp4_ = _tmp3_;
	_g_date_time_unref0 (_tmp2_);
	str = _tmp4_;
	_tmp5_ = str;
	_tmp6_ = (GtkLabel*) gtk_label_new (_tmp5_);
	g_object_ref_sink (_tmp6_);
	_g_object_unref0 (self->priv->am_label);
	self->priv->am_label = _tmp6_;
	_tmp7_ = g_date_time_new_utc (1, 1, 1, 12, 0, (gdouble) 0);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_date_time_format (_tmp8_, "%p");
	_g_free0 (str);
	str = _tmp9_;
	_g_date_time_unref0 (_tmp8_);
	_tmp10_ = str;
	_tmp11_ = (GtkLabel*) gtk_label_new (_tmp10_);
	g_object_ref_sink (_tmp11_);
	_g_object_unref0 (self->priv->pm_label);
	self->priv->pm_label = _tmp11_;
	_tmp12_ = self->priv->stack;
	_tmp13_ = self->priv->am_label;
	gtk_stack_add_child (_tmp12_, (GtkWidget*) _tmp13_);
	_tmp14_ = self->priv->stack;
	_tmp15_ = self->priv->pm_label;
	gtk_stack_add_child (_tmp14_, (GtkWidget*) _tmp15_);
	_tmp16_ = self->priv->stack;
	gtk_button_set_child ((GtkButton*) self, (GtkWidget*) _tmp16_);
	g_signal_connect_object ((GtkButton*) self, "clicked", (GCallback) ___lambda71__gtk_button_clicked, self, 0);
	clocks_am_pm_toggle_button_set_choice (self, CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_AM);
	_tmp17_ = self->priv->stack;
	_tmp18_ = self->priv->am_label;
	gtk_stack_set_visible_child (_tmp17_, (GtkWidget*) _tmp18_);
	_g_free0 (str);
	return self;
}

ClocksAmPmToggleButton*
clocks_am_pm_toggle_button_new (void)
{
	return clocks_am_pm_toggle_button_construct (CLOCKS_TYPE_AM_PM_TOGGLE_BUTTON);
}

ClocksAmPmToggleButtonAmPm
clocks_am_pm_toggle_button_get_choice (ClocksAmPmToggleButton* self)
{
	ClocksAmPmToggleButtonAmPm result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_choice;
	return result;
}

void
clocks_am_pm_toggle_button_set_choice (ClocksAmPmToggleButton* self,
                                       ClocksAmPmToggleButtonAmPm value)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_choice != value) {
		GtkLabel* _tmp0_ = NULL;
		GtkStack* _tmp3_;
		self->priv->_choice = value;
		if (self->priv->_choice == CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_AM) {
			GtkLabel* _tmp1_;
			_tmp1_ = self->priv->am_label;
			_tmp0_ = _tmp1_;
		} else {
			GtkLabel* _tmp2_;
			_tmp2_ = self->priv->pm_label;
			_tmp0_ = _tmp2_;
		}
		_tmp3_ = self->priv->stack;
		gtk_stack_set_visible_child (_tmp3_, (GtkWidget*) _tmp0_);
	}
	g_object_notify_by_pspec ((GObject *) self, clocks_am_pm_toggle_button_properties[CLOCKS_AM_PM_TOGGLE_BUTTON_CHOICE_PROPERTY]);
}

static void
clocks_am_pm_toggle_button_class_init (ClocksAmPmToggleButtonClass * klass,
                                       gpointer klass_data)
{
	clocks_am_pm_toggle_button_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ClocksAmPmToggleButton_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_clocks_am_pm_toggle_button_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_clocks_am_pm_toggle_button_set_property;
	G_OBJECT_CLASS (klass)->finalize = clocks_am_pm_toggle_button_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_AM_PM_TOGGLE_BUTTON_CHOICE_PROPERTY, clocks_am_pm_toggle_button_properties[CLOCKS_AM_PM_TOGGLE_BUTTON_CHOICE_PROPERTY] = g_param_spec_enum ("choice", "choice", "choice", CLOCKS_AM_PM_TOGGLE_BUTTON_TYPE_AM_PM, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
clocks_am_pm_toggle_button_instance_init (ClocksAmPmToggleButton * self,
                                          gpointer klass)
{
	self->priv = clocks_am_pm_toggle_button_get_instance_private (self);
}

static void
clocks_am_pm_toggle_button_finalize (GObject * obj)
{
	ClocksAmPmToggleButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_TYPE_AM_PM_TOGGLE_BUTTON, ClocksAmPmToggleButton);
	_g_object_unref0 (self->priv->stack);
	_g_object_unref0 (self->priv->am_label);
	_g_object_unref0 (self->priv->pm_label);
	G_OBJECT_CLASS (clocks_am_pm_toggle_button_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
clocks_am_pm_toggle_button_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ClocksAmPmToggleButtonClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_am_pm_toggle_button_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksAmPmToggleButton), 0, (GInstanceInitFunc) clocks_am_pm_toggle_button_instance_init, NULL };
	GType clocks_am_pm_toggle_button_type_id;
	clocks_am_pm_toggle_button_type_id = g_type_register_static (gtk_button_get_type (), "ClocksAmPmToggleButton", &g_define_type_info, 0);
	ClocksAmPmToggleButton_private_offset = g_type_add_instance_private (clocks_am_pm_toggle_button_type_id, sizeof (ClocksAmPmToggleButtonPrivate));
	return clocks_am_pm_toggle_button_type_id;
}

GType
clocks_am_pm_toggle_button_get_type (void)
{
	static gsize clocks_am_pm_toggle_button_type_id__once = 0;
	if (g_once_init_enter (&clocks_am_pm_toggle_button_type_id__once)) {
		GType clocks_am_pm_toggle_button_type_id;
		clocks_am_pm_toggle_button_type_id = clocks_am_pm_toggle_button_get_type_once ();
		g_once_init_leave (&clocks_am_pm_toggle_button_type_id__once, clocks_am_pm_toggle_button_type_id);
	}
	return clocks_am_pm_toggle_button_type_id__once;
}

static void
_vala_clocks_am_pm_toggle_button_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	ClocksAmPmToggleButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_TYPE_AM_PM_TOGGLE_BUTTON, ClocksAmPmToggleButton);
	switch (property_id) {
		case CLOCKS_AM_PM_TOGGLE_BUTTON_CHOICE_PROPERTY:
		g_value_set_enum (value, clocks_am_pm_toggle_button_get_choice (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_clocks_am_pm_toggle_button_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec)
{
	ClocksAmPmToggleButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_TYPE_AM_PM_TOGGLE_BUTTON, ClocksAmPmToggleButton);
	switch (property_id) {
		case CLOCKS_AM_PM_TOGGLE_BUTTON_CHOICE_PROPERTY:
		clocks_am_pm_toggle_button_set_choice (self, g_value_get_enum (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

