/* widgets.c generated by valac 0.38.7, 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.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <gdk/gdk.h>
#include <float.h>
#include <math.h>
#include <cairo.h>


#define CLOCKS_TYPE_HEADER_BAR (clocks_header_bar_get_type ())
#define CLOCKS_HEADER_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TYPE_HEADER_BAR, ClocksHeaderBar))
#define CLOCKS_HEADER_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_TYPE_HEADER_BAR, ClocksHeaderBarClass))
#define CLOCKS_IS_HEADER_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TYPE_HEADER_BAR))
#define CLOCKS_IS_HEADER_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_TYPE_HEADER_BAR))
#define CLOCKS_HEADER_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_TYPE_HEADER_BAR, ClocksHeaderBarClass))

typedef struct _ClocksHeaderBar ClocksHeaderBar;
typedef struct _ClocksHeaderBarClass ClocksHeaderBarClass;
typedef struct _ClocksHeaderBarPrivate ClocksHeaderBarPrivate;

#define CLOCKS_HEADER_BAR_TYPE_MODE (clocks_header_bar_mode_get_type ())
enum  {
	CLOCKS_HEADER_BAR_0_PROPERTY,
	CLOCKS_HEADER_BAR_MODE_PROPERTY,
	CLOCKS_HEADER_BAR_NUM_PROPERTIES
};
static GParamSpec* clocks_header_bar_properties[CLOCKS_HEADER_BAR_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))

#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_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)))
#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)))
enum  {
	CLOCKS_CONTENT_STORE_SELECTION_CHANGED_SIGNAL,
	CLOCKS_CONTENT_STORE_NUM_SIGNALS
};
static guint clocks_content_store_signals[CLOCKS_CONTENT_STORE_NUM_SIGNALS] = {0};

#define CLOCKS_TYPE_SELECTION_MENU_BUTTON (clocks_selection_menu_button_get_type ())
#define CLOCKS_SELECTION_MENU_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TYPE_SELECTION_MENU_BUTTON, ClocksSelectionMenuButton))
#define CLOCKS_SELECTION_MENU_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_TYPE_SELECTION_MENU_BUTTON, ClocksSelectionMenuButtonClass))
#define CLOCKS_IS_SELECTION_MENU_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TYPE_SELECTION_MENU_BUTTON))
#define CLOCKS_IS_SELECTION_MENU_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_TYPE_SELECTION_MENU_BUTTON))
#define CLOCKS_SELECTION_MENU_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_TYPE_SELECTION_MENU_BUTTON, ClocksSelectionMenuButtonClass))

typedef struct _ClocksSelectionMenuButton ClocksSelectionMenuButton;
typedef struct _ClocksSelectionMenuButtonClass ClocksSelectionMenuButtonClass;
typedef struct _ClocksSelectionMenuButtonPrivate ClocksSelectionMenuButtonPrivate;
enum  {
	CLOCKS_SELECTION_MENU_BUTTON_0_PROPERTY,
	CLOCKS_SELECTION_MENU_BUTTON_N_ITEMS_PROPERTY,
	CLOCKS_SELECTION_MENU_BUTTON_NUM_PROPERTIES
};
static GParamSpec* clocks_selection_menu_button_properties[CLOCKS_SELECTION_MENU_BUTTON_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

#define CLOCKS_TYPE_CONTENT_VIEW (clocks_content_view_get_type ())
#define CLOCKS_CONTENT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TYPE_CONTENT_VIEW, ClocksContentView))
#define CLOCKS_CONTENT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_TYPE_CONTENT_VIEW, ClocksContentViewClass))
#define CLOCKS_IS_CONTENT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TYPE_CONTENT_VIEW))
#define CLOCKS_IS_CONTENT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_TYPE_CONTENT_VIEW))
#define CLOCKS_CONTENT_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_TYPE_CONTENT_VIEW, ClocksContentViewClass))

typedef struct _ClocksContentView ClocksContentView;
typedef struct _ClocksContentViewClass ClocksContentViewClass;
typedef struct _ClocksContentViewPrivate ClocksContentViewPrivate;

#define CLOCKS_CONTENT_VIEW_TYPE_MODE (clocks_content_view_mode_get_type ())
enum  {
	CLOCKS_CONTENT_VIEW_0_PROPERTY,
	CLOCKS_CONTENT_VIEW_MODE_PROPERTY,
	CLOCKS_CONTENT_VIEW_NUM_PROPERTIES
};
static GParamSpec* clocks_content_view_properties[CLOCKS_CONTENT_VIEW_NUM_PROPERTIES];
typedef struct _Block6Data Block6Data;
typedef struct _Block7Data Block7Data;
enum  {
	CLOCKS_CONTENT_VIEW_ITEM_ACTIVATED_SIGNAL,
	CLOCKS_CONTENT_VIEW_NUM_SIGNALS
};
static guint clocks_content_view_signals[CLOCKS_CONTENT_VIEW_NUM_SIGNALS] = {0};

#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;

#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 CLOCKS_TYPE_ANALOG_FRAME (clocks_analog_frame_get_type ())
#define CLOCKS_ANALOG_FRAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TYPE_ANALOG_FRAME, ClocksAnalogFrame))
#define CLOCKS_ANALOG_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_TYPE_ANALOG_FRAME, ClocksAnalogFrameClass))
#define CLOCKS_IS_ANALOG_FRAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TYPE_ANALOG_FRAME))
#define CLOCKS_IS_ANALOG_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_TYPE_ANALOG_FRAME))
#define CLOCKS_ANALOG_FRAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_TYPE_ANALOG_FRAME, ClocksAnalogFrameClass))

typedef struct _ClocksAnalogFrame ClocksAnalogFrame;
typedef struct _ClocksAnalogFrameClass ClocksAnalogFrameClass;
typedef struct _ClocksAnalogFramePrivate ClocksAnalogFramePrivate;
enum  {
	CLOCKS_ANALOG_FRAME_0_PROPERTY,
	CLOCKS_ANALOG_FRAME_NUM_PROPERTIES
};
static GParamSpec* clocks_analog_frame_properties[CLOCKS_ANALOG_FRAME_NUM_PROPERTIES];
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _ClocksHeaderBar {
	GtkHeaderBar parent_instance;
	ClocksHeaderBarPrivate * priv;
};

struct _ClocksHeaderBarClass {
	GtkHeaderBarClass parent_class;
};

typedef enum  {
	CLOCKS_HEADER_BAR_MODE_NORMAL,
	CLOCKS_HEADER_BAR_MODE_SELECTION,
	CLOCKS_HEADER_BAR_MODE_STANDALONE
} ClocksHeaderBarMode;

struct _ClocksHeaderBarPrivate {
	ClocksHeaderBarMode _mode;
};

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);
	gboolean (*get_selectable) (ClocksContentItem* self);
	void (*set_selectable) (ClocksContentItem* self, gboolean value);
	gboolean (*get_selected) (ClocksContentItem* self);
	void (*set_selected) (ClocksContentItem* self, gboolean value);
};

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

struct _ClocksContentStoreClass {
	GObjectClass parent_class;
};

struct _ClocksContentStorePrivate {
	GListStore* store;
	GCompareDataFunc sort_func;
	gpointer sort_func_target;
	GDestroyNotify sort_func_target_destroy_notify;
};

typedef void (*ClocksContentStoreForeachFunc) (ClocksContentItem* item, void* user_data);
typedef gboolean (*ClocksContentStoreFindFunc) (ClocksContentItem* item, void* user_data);
typedef ClocksContentItem* (*ClocksContentStoreDeserializeItemFunc) (GVariant* v, void* user_data);
struct _ClocksSelectionMenuButton {
	GtkMenuButton parent_instance;
	ClocksSelectionMenuButtonPrivate * priv;
};

struct _ClocksSelectionMenuButtonClass {
	GtkMenuButtonClass parent_class;
};

struct _ClocksSelectionMenuButtonPrivate {
	guint _n_items;
	GtkLabel* menubutton_label;
};

struct _ClocksContentView {
	GtkBin parent_instance;
	ClocksContentViewPrivate * priv;
};

struct _ClocksContentViewClass {
	GtkBinClass parent_class;
};

typedef enum  {
	CLOCKS_CONTENT_VIEW_MODE_NORMAL,
	CLOCKS_CONTENT_VIEW_MODE_SELECTION
} ClocksContentViewMode;

struct _ClocksContentViewPrivate {
	ClocksContentViewMode _mode;
	ClocksContentStore* model;
	GtkFlowBox* flow_box;
	GtkButton* select_button;
	GtkButton* cancel_button;
	ClocksSelectionMenuButton* selection_menubutton;
	GtkGrid* grid;
	GtkActionBar* action_bar;
	GtkButton* delete_button;
	ClocksHeaderBar* header_bar;
};

typedef GtkWidget* (*ClocksContentViewContentViewCreateWidgetFunc) (ClocksContentItem* item, void* user_data);
struct _Block6Data {
	int _ref_count_;
	ClocksContentView* self;
	ClocksContentViewContentViewCreateWidgetFunc create_func;
	gpointer create_func_target;
	GDestroyNotify create_func_target_destroy_notify;
};

struct _Block7Data {
	int _ref_count_;
	Block6Data * _data6_;
	ClocksContentItem* item;
	GtkFlowBoxChild* flow_box_child;
};

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

struct _ClocksAmPmToggleButtonClass {
	GtkButtonClass parent_class;
};

typedef enum  {
	CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_AM,
	CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_PM
} ClocksAmPmToggleButtonAmPm;

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

struct _ClocksAnalogFrame {
	GtkBin parent_instance;
	ClocksAnalogFramePrivate * priv;
};

struct _ClocksAnalogFrameClass {
	GtkBinClass parent_class;
	void (*draw_progress) (ClocksAnalogFrame* self, cairo_t* cr, gint center_x, gint center_y, gint radius);
};


static gpointer clocks_header_bar_parent_class = NULL;
static gpointer clocks_content_store_parent_class = NULL;
static GListModelInterface * clocks_content_store_g_list_model_parent_iface = NULL;
static gpointer clocks_selection_menu_button_parent_class = NULL;
static gpointer clocks_content_view_parent_class = NULL;
static gpointer clocks_am_pm_toggle_button_parent_class = NULL;
static gpointer clocks_analog_frame_parent_class = NULL;

GType clocks_header_bar_get_type (void) G_GNUC_CONST;
GType clocks_header_bar_mode_get_type (void) G_GNUC_CONST;
#define CLOCKS_HEADER_BAR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLOCKS_TYPE_HEADER_BAR, ClocksHeaderBarPrivate))
void clocks_header_bar_clear (ClocksHeaderBar* self);
ClocksHeaderBar* clocks_header_bar_new (void);
ClocksHeaderBar* clocks_header_bar_construct (GType object_type);
ClocksHeaderBarMode clocks_header_bar_get_mode (ClocksHeaderBar* self);
void clocks_header_bar_set_mode (ClocksHeaderBar* self, ClocksHeaderBarMode value);
static void clocks_header_bar_finalize (GObject * obj);
static void _vala_clocks_header_bar_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_clocks_header_bar_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType clocks_content_item_get_type (void) G_GNUC_CONST;
void clocks_content_item_serialize (ClocksContentItem* self, GVariantBuilder* builder);
const gchar* clocks_content_item_get_name (ClocksContentItem* self);
void clocks_content_item_set_name (ClocksContentItem* self, const gchar* value);
gboolean clocks_content_item_get_selectable (ClocksContentItem* self);
void clocks_content_item_set_selectable (ClocksContentItem* self, gboolean value);
gboolean clocks_content_item_get_selected (ClocksContentItem* self);
void clocks_content_item_set_selected (ClocksContentItem* self, gboolean value);
GType clocks_content_store_get_type (void) G_GNUC_CONST;
#define CLOCKS_CONTENT_STORE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLOCKS_TYPE_CONTENT_STORE, ClocksContentStorePrivate))
ClocksContentStore* clocks_content_store_new (void);
ClocksContentStore* clocks_content_store_construct (GType object_type);
static void __lambda9_ (ClocksContentStore* self, guint position, guint removed, guint added);
static void ___lambda9__g_list_model_items_changed (GListModel* _sender, guint position, guint removed, guint added, gpointer self);
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);
void clocks_content_store_set_sorting (ClocksContentStore* self, GCompareDataFunc sort, void* sort_target, GDestroyNotify sort_target_destroy_notify);
static void clocks_content_store_on_item_selection_toggle (ClocksContentStore* self, GObject* o, GParamSpec* p);
void clocks_content_store_add (ClocksContentStore* self, ClocksContentItem* item);
static void _clocks_content_store_on_item_selection_toggle_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
void clocks_content_store_foreach (ClocksContentStore* self, ClocksContentStoreForeachFunc func, void* func_target);
ClocksContentItem* clocks_content_store_find (ClocksContentStore* self, ClocksContentStoreFindFunc func, void* func_target);
guint clocks_content_store_get_n_selected (ClocksContentStore* self);
void clocks_content_store_delete_selected (ClocksContentStore* self);
static void _vala_array_add4 (GObject** * array, int* length, int* size, GObject* value);
static void clocks_content_store_select_unselect_all (ClocksContentStore* self, gboolean select);
void clocks_content_store_select_all (ClocksContentStore* self);
void clocks_content_store_unselect_all (ClocksContentStore* self);
GVariant* clocks_content_store_serialize (ClocksContentStore* self);
void clocks_content_store_deserialize (ClocksContentStore* self, GVariant* variant, ClocksContentStoreDeserializeItemFunc deserialize_item, void* deserialize_item_target);
static void clocks_content_store_finalize (GObject * obj);
GType clocks_selection_menu_button_get_type (void) G_GNUC_CONST;
#define CLOCKS_SELECTION_MENU_BUTTON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLOCKS_TYPE_SELECTION_MENU_BUTTON, ClocksSelectionMenuButtonPrivate))
ClocksSelectionMenuButton* clocks_selection_menu_button_new (void);
ClocksSelectionMenuButton* clocks_selection_menu_button_construct (GType object_type);
guint clocks_selection_menu_button_get_n_items (ClocksSelectionMenuButton* self);
void clocks_selection_menu_button_set_n_items (ClocksSelectionMenuButton* self, guint value);
static void clocks_selection_menu_button_finalize (GObject * obj);
static void _vala_clocks_selection_menu_button_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_clocks_selection_menu_button_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType clocks_content_view_get_type (void) G_GNUC_CONST;
GType clocks_content_view_mode_get_type (void) G_GNUC_CONST;
#define CLOCKS_CONTENT_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLOCKS_TYPE_CONTENT_VIEW, ClocksContentViewPrivate))
void clocks_content_view_bind_model (ClocksContentView* self, ClocksContentStore* store, ClocksContentViewContentViewCreateWidgetFunc create_func, void* create_func_target, GDestroyNotify create_func_target_destroy_notify);
static Block6Data* block6_data_ref (Block6Data* _data6_);
static void block6_data_unref (void * _userdata_);
static void __lambda10_ (ClocksContentView* self);
static void ___lambda10__clocks_content_store_selection_changed (ClocksContentStore* _sender, gpointer self);
static GtkWidget* __lambda11_ (Block6Data* _data6_, GObject* object);
static Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (void * _userdata_);
static gboolean __lambda12_ (Block7Data* _data7_, GdkEventButton* event);
static void clocks_content_view_set_mode (ClocksContentView* self, ClocksContentViewMode value);
ClocksContentViewMode clocks_content_view_get_mode (ClocksContentView* self);
static gboolean ___lambda12__gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self);
static gboolean __lambda13_ (Block7Data* _data7_, GBinding* binding, GValue* selectable, GValue* visible);
static gboolean ___lambda13__gbinding_transform_func (GBinding* binding, GValue* source_value, GValue* target_value, gpointer self);
static gboolean __lambda14_ (Block7Data* _data7_, GBinding* binding, GValue* mode, GValue* visible);
static gboolean ___lambda14__gbinding_transform_func (GBinding* binding, GValue* source_value, GValue* target_value, gpointer self);
static gboolean __lambda15_ (Block7Data* _data7_, GdkEventCrossing* event);
static gboolean ___lambda15__gtk_widget_enter_notify_event (GtkWidget* _sender, GdkEventCrossing* event, gpointer self);
static gboolean __lambda16_ (Block7Data* _data7_, GdkEventCrossing* event);
static gboolean ___lambda16__gtk_widget_leave_notify_event (GtkWidget* _sender, GdkEventCrossing* event, gpointer self);
static GtkWidget* ___lambda11__gtk_flow_box_create_widget_func (GObject* item, gpointer self);
void clocks_content_view_select_all (ClocksContentView* self);
void clocks_content_view_unselect_all (ClocksContentView* self);
gboolean clocks_content_view_escape_pressed (ClocksContentView* self);
void clocks_content_view_set_header_bar (ClocksContentView* self, ClocksHeaderBar* bar);
static void __lambda17_ (ClocksContentView* self);
static void ___lambda17__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda18_ (ClocksContentView* self);
static void ___lambda18__gtk_button_clicked (GtkButton* _sender, gpointer self);
void clocks_content_view_update_header_bar (ClocksContentView* self);
static gboolean ___lambda19_ (ClocksContentView* self, ClocksContentItem* i);
static gboolean ____lambda19__clocks_content_store_find_func (ClocksContentItem* item, gpointer self);
ClocksContentView* clocks_content_view_new (void);
ClocksContentView* clocks_content_view_construct (GType object_type);
static GObject * clocks_content_view_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void _clocks_content_view___lambda20_ (ClocksContentView* self, GtkFlowBoxChild* child);
static void __clocks_content_view___lambda20__gtk_flow_box_child_activated (GtkFlowBox* _sender, GtkFlowBoxChild* child, gpointer self);
static void _clocks_content_view___lambda21_ (ClocksContentView* self);
static void __clocks_content_view___lambda21__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void clocks_content_view_finalize (GObject * obj);
static void _vala_clocks_content_view_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_clocks_content_view_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType clocks_am_pm_toggle_button_get_type (void) G_GNUC_CONST;
GType clocks_am_pm_toggle_button_am_pm_get_type (void) G_GNUC_CONST;
#define CLOCKS_AM_PM_TOGGLE_BUTTON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLOCKS_TYPE_AM_PM_TOGGLE_BUTTON, ClocksAmPmToggleButtonPrivate))
ClocksAmPmToggleButton* clocks_am_pm_toggle_button_new (void);
ClocksAmPmToggleButton* clocks_am_pm_toggle_button_construct (GType object_type);
static void __lambda38_ (ClocksAmPmToggleButton* self);
ClocksAmPmToggleButtonAmPm clocks_am_pm_toggle_button_get_choice (ClocksAmPmToggleButton* self);
void clocks_am_pm_toggle_button_set_choice (ClocksAmPmToggleButton* self, ClocksAmPmToggleButtonAmPm value);
static void ___lambda38__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void clocks_am_pm_toggle_button_finalize (GObject * obj);
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);
GType clocks_analog_frame_get_type (void) G_GNUC_CONST;
#define CLOCKS_ANALOG_FRAME_LINE_WIDTH 6
#define CLOCKS_ANALOG_FRAME_RADIUS_PAD 48
static gint clocks_analog_frame_calculate_diameter (ClocksAnalogFrame* self);
static void clocks_analog_frame_real_get_preferred_width (GtkWidget* base, gint* min_w, gint* natural_w);
static void clocks_analog_frame_real_get_preferred_height (GtkWidget* base, gint* min_h, gint* natural_h);
static void clocks_analog_frame_real_size_allocate (GtkWidget* base, GtkAllocation* allocation);
static gboolean clocks_analog_frame_real_draw (GtkWidget* base, cairo_t* cr);
void clocks_analog_frame_draw_progress (ClocksAnalogFrame* self, cairo_t* cr, gint center_x, gint center_y, gint radius);
static void clocks_analog_frame_real_draw_progress (ClocksAnalogFrame* self, cairo_t* cr, gint center_x, gint center_y, gint radius);
ClocksAnalogFrame* clocks_analog_frame_new (void);
ClocksAnalogFrame* clocks_analog_frame_construct (GType object_type);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


GType clocks_header_bar_mode_get_type (void) {
	static volatile gsize clocks_header_bar_mode_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_header_bar_mode_type_id__volatile)) {
		static const GEnumValue values[] = {{CLOCKS_HEADER_BAR_MODE_NORMAL, "CLOCKS_HEADER_BAR_MODE_NORMAL", "normal"}, {CLOCKS_HEADER_BAR_MODE_SELECTION, "CLOCKS_HEADER_BAR_MODE_SELECTION", "selection"}, {CLOCKS_HEADER_BAR_MODE_STANDALONE, "CLOCKS_HEADER_BAR_MODE_STANDALONE", "standalone"}, {0, NULL, NULL}};
		GType clocks_header_bar_mode_type_id;
		clocks_header_bar_mode_type_id = g_enum_register_static ("ClocksHeaderBarMode", values);
		g_once_init_leave (&clocks_header_bar_mode_type_id__volatile, clocks_header_bar_mode_type_id);
	}
	return clocks_header_bar_mode_type_id__volatile;
}


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


void clocks_header_bar_clear (ClocksHeaderBar* self) {
	GList* _tmp0_;
	g_return_if_fail (self != NULL);
	gtk_header_bar_set_custom_title ((GtkHeaderBar*) self, NULL);
	_tmp0_ = gtk_container_get_children ((GtkContainer*) self);
	{
		GList* w_collection = NULL;
		GList* w_it = NULL;
		w_collection = _tmp0_;
		for (w_it = w_collection; w_it != NULL; w_it = w_it->next) {
			GtkWidget* _tmp1_;
			GtkWidget* w = NULL;
			_tmp1_ = _g_object_ref0 ((GtkWidget*) w_it->data);
			w = _tmp1_;
			{
				GtkWidget* _tmp2_;
				_tmp2_ = w;
				gtk_widget_hide (_tmp2_);
				_g_object_unref0 (w);
			}
		}
		_g_list_free0 (w_collection);
	}
}


ClocksHeaderBar* clocks_header_bar_construct (GType object_type) {
	ClocksHeaderBar * self = NULL;
	self = (ClocksHeaderBar*) g_object_new (object_type, NULL);
	return self;
}


ClocksHeaderBar* clocks_header_bar_new (void) {
	return clocks_header_bar_construct (CLOCKS_TYPE_HEADER_BAR);
}


ClocksHeaderBarMode clocks_header_bar_get_mode (ClocksHeaderBar* self) {
	ClocksHeaderBarMode result;
	ClocksHeaderBarMode _tmp0_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->_mode;
	result = _tmp0_;
	return result;
}


void clocks_header_bar_set_mode (ClocksHeaderBar* self, ClocksHeaderBarMode value) {
	ClocksHeaderBarMode _tmp0_;
	ClocksHeaderBarMode _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_mode;
	_tmp1_ = value;
	if (_tmp0_ != _tmp1_) {
		ClocksHeaderBarMode _tmp2_;
		ClocksHeaderBarMode _tmp3_;
		_tmp2_ = value;
		self->priv->_mode = _tmp2_;
		_tmp3_ = self->priv->_mode;
		if (_tmp3_ == CLOCKS_HEADER_BAR_MODE_SELECTION) {
			GtkStyleContext* _tmp4_;
			_tmp4_ = gtk_widget_get_style_context ((GtkWidget*) self);
			gtk_style_context_add_class (_tmp4_, "selection-mode");
		} else {
			GtkStyleContext* _tmp5_;
			_tmp5_ = gtk_widget_get_style_context ((GtkWidget*) self);
			gtk_style_context_remove_class (_tmp5_, "selection-mode");
		}
		g_object_notify ((GObject*) self, "mode");
	}
}


static void clocks_header_bar_class_init (ClocksHeaderBarClass * klass) {
	clocks_header_bar_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ClocksHeaderBarPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_clocks_header_bar_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_clocks_header_bar_set_property;
	G_OBJECT_CLASS (klass)->finalize = clocks_header_bar_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_HEADER_BAR_MODE_PROPERTY, clocks_header_bar_properties[CLOCKS_HEADER_BAR_MODE_PROPERTY] = g_param_spec_enum ("mode", "mode", "mode", CLOCKS_HEADER_BAR_TYPE_MODE, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
}


static void clocks_header_bar_instance_init (ClocksHeaderBar * self) {
	self->priv = CLOCKS_HEADER_BAR_GET_PRIVATE (self);
}


static void clocks_header_bar_finalize (GObject * obj) {
	ClocksHeaderBar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_TYPE_HEADER_BAR, ClocksHeaderBar);
	G_OBJECT_CLASS (clocks_header_bar_parent_class)->finalize (obj);
}


GType clocks_header_bar_get_type (void) {
	static volatile gsize clocks_header_bar_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_header_bar_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ClocksHeaderBarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_header_bar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksHeaderBar), 0, (GInstanceInitFunc) clocks_header_bar_instance_init, NULL };
		GType clocks_header_bar_type_id;
		clocks_header_bar_type_id = g_type_register_static (gtk_header_bar_get_type (), "ClocksHeaderBar", &g_define_type_info, 0);
		g_once_init_leave (&clocks_header_bar_type_id__volatile, clocks_header_bar_type_id);
	}
	return clocks_header_bar_type_id__volatile;
}


static void _vala_clocks_header_bar_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ClocksHeaderBar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_TYPE_HEADER_BAR, ClocksHeaderBar);
	switch (property_id) {
		case CLOCKS_HEADER_BAR_MODE_PROPERTY:
		g_value_set_enum (value, clocks_header_bar_get_mode (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_clocks_header_bar_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	ClocksHeaderBar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_TYPE_HEADER_BAR, ClocksHeaderBar);
	switch (property_id) {
		case CLOCKS_HEADER_BAR_MODE_PROPERTY:
		clocks_header_bar_set_mode (self, g_value_get_enum (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


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


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


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


gboolean clocks_content_item_get_selectable (ClocksContentItem* self) {
	g_return_val_if_fail (self != NULL, FALSE);
	return CLOCKS_CONTENT_ITEM_GET_INTERFACE (self)->get_selectable (self);
}


void clocks_content_item_set_selectable (ClocksContentItem* self, gboolean value) {
	g_return_if_fail (self != NULL);
	CLOCKS_CONTENT_ITEM_GET_INTERFACE (self)->set_selectable (self, value);
}


gboolean clocks_content_item_get_selected (ClocksContentItem* self) {
	g_return_val_if_fail (self != NULL, FALSE);
	return CLOCKS_CONTENT_ITEM_GET_INTERFACE (self)->get_selected (self);
}


void clocks_content_item_set_selected (ClocksContentItem* self, gboolean value) {
	g_return_if_fail (self != NULL);
	CLOCKS_CONTENT_ITEM_GET_INTERFACE (self)->set_selected (self, value);
}


static void clocks_content_item_base_init (ClocksContentItemIface * iface) {
	static gboolean initialized = FALSE;
	if (!initialized) {
		initialized = TRUE;
		g_object_interface_install_property (iface, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
		g_object_interface_install_property (iface, g_param_spec_boolean ("selectable", "selectable", "selectable", TRUE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
		g_object_interface_install_property (iface, 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));
	}
}


GType clocks_content_item_get_type (void) {
	static volatile gsize clocks_content_item_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_content_item_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ClocksContentItemIface), (GBaseInitFunc) clocks_content_item_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (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);
		g_once_init_leave (&clocks_content_item_type_id__volatile, clocks_content_item_type_id);
	}
	return clocks_content_item_type_id__volatile;
}


static void __lambda9_ (ClocksContentStore* self, guint position, guint removed, guint added) {
	guint _tmp0_;
	guint _tmp1_;
	guint _tmp2_;
	_tmp0_ = position;
	_tmp1_ = removed;
	_tmp2_ = added;
	g_list_model_items_changed ((GListModel*) self, _tmp0_, _tmp1_, _tmp2_);
}


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


ClocksContentStore* clocks_content_store_construct (GType object_type) {
	ClocksContentStore * self = NULL;
	GListStore* _tmp0_;
	GListStore* _tmp1_;
	self = (ClocksContentStore*) g_object_new (object_type, NULL);
	_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) ___lambda9__g_list_model_items_changed, self, 0);
	return self;
}


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


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


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


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


void clocks_content_store_set_sorting (ClocksContentStore* self, GCompareDataFunc sort, void* sort_target, GDestroyNotify sort_target_destroy_notify) {
	GCompareDataFunc _tmp0_;
	void* _tmp0__target;
	GDestroyNotify _tmp0__target_destroy_notify;
	GListStore* _tmp1_;
	guint _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = sort;
	_tmp0__target = sort_target;
	_tmp0__target_destroy_notify = sort_target_destroy_notify;
	sort = NULL;
	sort_target = NULL;
	sort_target_destroy_notify = NULL;
	(self->priv->sort_func_target_destroy_notify == NULL) ? NULL : (self->priv->sort_func_target_destroy_notify (self->priv->sort_func_target), NULL);
	self->priv->sort_func = NULL;
	self->priv->sort_func_target = NULL;
	self->priv->sort_func_target_destroy_notify = NULL;
	self->priv->sort_func = _tmp0_;
	self->priv->sort_func_target = _tmp0__target;
	self->priv->sort_func_target_destroy_notify = _tmp0__target_destroy_notify;
	_tmp1_ = self->priv->store;
	_tmp2_ = g_list_model_get_n_items ((GListModel*) _tmp1_);
	_vala_assert (_tmp2_ == ((guint) 0), "store.get_n_items () == 0");
	(sort_target_destroy_notify == NULL) ? NULL : (sort_target_destroy_notify (sort_target), NULL);
	sort = NULL;
	sort_target = NULL;
	sort_target_destroy_notify = NULL;
}


static void clocks_content_store_on_item_selection_toggle (ClocksContentStore* self, GObject* o, GParamSpec* p) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (o != NULL);
	g_return_if_fail (p != NULL);
	g_signal_emit (self, clocks_content_store_signals[CLOCKS_CONTENT_STORE_SELECTION_CHANGED_SIGNAL], 0);
}


static void _clocks_content_store_on_item_selection_toggle_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	clocks_content_store_on_item_selection_toggle ((ClocksContentStore*) self, _sender, pspec);
}


void clocks_content_store_add (ClocksContentStore* self, ClocksContentItem* item) {
	GCompareDataFunc _tmp0_;
	void* _tmp0__target;
	ClocksContentItem* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	_tmp0_ = self->priv->sort_func;
	_tmp0__target = self->priv->sort_func_target;
	if (_tmp0_ == NULL) {
		GListStore* _tmp1_;
		ClocksContentItem* _tmp2_;
		_tmp1_ = self->priv->store;
		_tmp2_ = item;
		g_list_store_append (_tmp1_, (GObject*) _tmp2_);
	} else {
		GListStore* _tmp3_;
		ClocksContentItem* _tmp4_;
		GCompareDataFunc _tmp5_;
		void* _tmp5__target;
		_tmp3_ = self->priv->store;
		_tmp4_ = item;
		_tmp5_ = self->priv->sort_func;
		_tmp5__target = self->priv->sort_func_target;
		g_list_store_insert_sorted (_tmp3_, (GObject*) _tmp4_, _tmp5_, _tmp5__target);
	}
	_tmp6_ = item;
	g_signal_connect_object ((GObject*) _tmp6_, "notify::selected", (GCallback) _clocks_content_store_on_item_selection_toggle_g_object_notify, self, 0);
}


void clocks_content_store_foreach (ClocksContentStore* self, ClocksContentStoreForeachFunc func, void* func_target) {
	guint n = 0U;
	GListStore* _tmp0_;
	guint _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->store;
	_tmp1_ = g_list_model_get_n_items ((GListModel*) _tmp0_);
	n = _tmp1_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				gint _tmp4_;
				guint _tmp5_;
				ClocksContentStoreForeachFunc _tmp6_;
				void* _tmp6__target;
				GListStore* _tmp7_;
				gint _tmp8_;
				GObject* _tmp9_;
				ClocksContentItem* _tmp10_;
				ClocksContentItem* _tmp11_;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = i;
				_tmp5_ = n;
				if (!(((guint) _tmp4_) < _tmp5_)) {
					break;
				}
				_tmp6_ = func;
				_tmp6__target = func_target;
				_tmp7_ = self->priv->store;
				_tmp8_ = i;
				_tmp9_ = g_list_model_get_object ((GListModel*) _tmp7_, (guint) _tmp8_);
				_tmp10_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, CLOCKS_TYPE_CONTENT_ITEM) ? ((ClocksContentItem*) _tmp9_) : NULL;
				if (_tmp10_ == NULL) {
					_g_object_unref0 (_tmp9_);
				}
				_tmp11_ = _tmp10_;
				_tmp6_ (_tmp11_, _tmp6__target);
				_g_object_unref0 (_tmp11_);
			}
		}
	}
}


ClocksContentItem* clocks_content_store_find (ClocksContentStore* self, ClocksContentStoreFindFunc func, void* func_target) {
	ClocksContentItem* result = NULL;
	guint n = 0U;
	GListStore* _tmp0_;
	guint _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->store;
	_tmp1_ = g_list_model_get_n_items ((GListModel*) _tmp0_);
	n = _tmp1_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				gint _tmp4_;
				guint _tmp5_;
				ClocksContentItem* item = NULL;
				GListStore* _tmp6_;
				gint _tmp7_;
				GObject* _tmp8_;
				ClocksContentItem* _tmp9_;
				ClocksContentStoreFindFunc _tmp10_;
				void* _tmp10__target;
				ClocksContentItem* _tmp11_;
				gboolean _tmp12_;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = i;
				_tmp5_ = n;
				if (!(((guint) _tmp4_) < _tmp5_)) {
					break;
				}
				_tmp6_ = self->priv->store;
				_tmp7_ = i;
				_tmp8_ = g_list_model_get_object ((GListModel*) _tmp6_, (guint) _tmp7_);
				_tmp9_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, CLOCKS_TYPE_CONTENT_ITEM) ? ((ClocksContentItem*) _tmp8_) : NULL;
				if (_tmp9_ == NULL) {
					_g_object_unref0 (_tmp8_);
				}
				item = _tmp9_;
				_tmp10_ = func;
				_tmp10__target = func_target;
				_tmp11_ = item;
				_tmp12_ = _tmp10_ (_tmp11_, _tmp10__target);
				if (_tmp12_) {
					result = item;
					return result;
				}
				_g_object_unref0 (item);
			}
		}
	}
	result = NULL;
	return result;
}


guint clocks_content_store_get_n_selected (ClocksContentStore* self) {
	guint result = 0U;
	guint n_selected = 0U;
	guint n = 0U;
	GListStore* _tmp0_;
	guint _tmp1_;
	g_return_val_if_fail (self != NULL, 0U);
	n_selected = (guint) 0;
	_tmp0_ = self->priv->store;
	_tmp1_ = g_list_model_get_n_items ((GListModel*) _tmp0_);
	n = _tmp1_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				gint _tmp4_;
				guint _tmp5_;
				ClocksContentItem* item = NULL;
				GListStore* _tmp6_;
				gint _tmp7_;
				GObject* _tmp8_;
				ClocksContentItem* _tmp9_;
				ClocksContentItem* _tmp10_;
				gboolean _tmp11_;
				gboolean _tmp12_;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = i;
				_tmp5_ = n;
				if (!(((guint) _tmp4_) < _tmp5_)) {
					break;
				}
				_tmp6_ = self->priv->store;
				_tmp7_ = i;
				_tmp8_ = g_list_model_get_object ((GListModel*) _tmp6_, (guint) _tmp7_);
				_tmp9_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, CLOCKS_TYPE_CONTENT_ITEM) ? ((ClocksContentItem*) _tmp8_) : NULL;
				if (_tmp9_ == NULL) {
					_g_object_unref0 (_tmp8_);
				}
				item = _tmp9_;
				_tmp10_ = item;
				_tmp11_ = clocks_content_item_get_selected (_tmp10_);
				_tmp12_ = _tmp11_;
				if (_tmp12_) {
					guint _tmp13_;
					_tmp13_ = n_selected;
					n_selected = _tmp13_ + 1;
				}
				_g_object_unref0 (item);
			}
		}
	}
	result = n_selected;
	return result;
}


static void _vala_array_add4 (GObject** * array, int* length, int* size, GObject* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GObject*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


void clocks_content_store_delete_selected (ClocksContentStore* self) {
	guint n_deleted = 0U;
	GObject** not_selected = NULL;
	GObject** _tmp0_;
	gint not_selected_length1;
	gint _not_selected_size_;
	guint n = 0U;
	GListStore* _tmp1_;
	guint _tmp2_;
	guint _tmp18_;
	g_return_if_fail (self != NULL);
	n_deleted = (guint) 0;
	_tmp0_ = g_new0 (GObject*, 0 + 1);
	not_selected = _tmp0_;
	not_selected_length1 = 0;
	_not_selected_size_ = not_selected_length1;
	_tmp1_ = self->priv->store;
	_tmp2_ = g_list_model_get_n_items ((GListModel*) _tmp1_);
	n = _tmp2_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp3_ = FALSE;
			_tmp3_ = TRUE;
			while (TRUE) {
				gint _tmp5_;
				guint _tmp6_;
				GObject* o = NULL;
				GListStore* _tmp7_;
				gint _tmp8_;
				GObject* _tmp9_;
				GObject* _tmp10_;
				gboolean _tmp11_;
				gboolean _tmp12_;
				if (!_tmp3_) {
					gint _tmp4_;
					_tmp4_ = i;
					i = _tmp4_ + 1;
				}
				_tmp3_ = FALSE;
				_tmp5_ = i;
				_tmp6_ = n;
				if (!(((guint) _tmp5_) < _tmp6_)) {
					break;
				}
				_tmp7_ = self->priv->store;
				_tmp8_ = i;
				_tmp9_ = g_list_model_get_object ((GListModel*) _tmp7_, (guint) _tmp8_);
				o = _tmp9_;
				_tmp10_ = o;
				_tmp11_ = clocks_content_item_get_selected (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, CLOCKS_TYPE_CONTENT_ITEM, ClocksContentItem));
				_tmp12_ = _tmp11_;
				if (!_tmp12_) {
					GObject** _tmp13_;
					gint _tmp13__length1;
					GObject* _tmp14_;
					GObject* _tmp15_;
					_tmp13_ = not_selected;
					_tmp13__length1 = not_selected_length1;
					_tmp14_ = o;
					_tmp15_ = _g_object_ref0 (_tmp14_);
					_vala_array_add4 (&not_selected, &not_selected_length1, &_not_selected_size_, _tmp15_);
				} else {
					guint _tmp16_;
					GObject* _tmp17_;
					_tmp16_ = n_deleted;
					n_deleted = _tmp16_ + 1;
					_tmp17_ = o;
					g_signal_handlers_disconnect_by_func (_tmp17_, (void*) clocks_content_store_on_item_selection_toggle, (void*) self);
				}
				_g_object_unref0 (o);
			}
		}
	}
	_tmp18_ = n_deleted;
	if (_tmp18_ > ((guint) 0)) {
		GListStore* _tmp19_;
		guint _tmp20_;
		GObject** _tmp21_;
		gint _tmp21__length1;
		GCompareDataFunc _tmp22_;
		void* _tmp22__target;
		_tmp19_ = self->priv->store;
		_tmp20_ = n;
		_tmp21_ = not_selected;
		_tmp21__length1 = not_selected_length1;
		g_list_store_splice (_tmp19_, (guint) 0, _tmp20_, _tmp21_, (guint) _tmp21__length1);
		_tmp22_ = self->priv->sort_func;
		_tmp22__target = self->priv->sort_func_target;
		if (_tmp22_ != NULL) {
			GListStore* _tmp23_;
			GCompareDataFunc _tmp24_;
			void* _tmp24__target;
			_tmp23_ = self->priv->store;
			_tmp24_ = self->priv->sort_func;
			_tmp24__target = self->priv->sort_func_target;
			g_list_store_sort (_tmp23_, _tmp24_, _tmp24__target);
		}
		g_signal_emit (self, clocks_content_store_signals[CLOCKS_CONTENT_STORE_SELECTION_CHANGED_SIGNAL], 0);
	}
	not_selected = (_vala_array_free (not_selected, not_selected_length1, (GDestroyNotify) g_object_unref), NULL);
}


static void clocks_content_store_select_unselect_all (ClocksContentStore* self, gboolean select) {
	guint n_toggled = 0U;
	guint n = 0U;
	GListStore* _tmp0_;
	guint _tmp1_;
	guint _tmp24_;
	g_return_if_fail (self != NULL);
	n_toggled = (guint) 0;
	_tmp0_ = self->priv->store;
	_tmp1_ = g_list_model_get_n_items ((GListModel*) _tmp0_);
	n = _tmp1_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				gint _tmp4_;
				guint _tmp5_;
				ClocksContentItem* item = NULL;
				GListStore* _tmp6_;
				gint _tmp7_;
				GObject* _tmp8_;
				ClocksContentItem* _tmp9_;
				gboolean _tmp10_ = FALSE;
				ClocksContentItem* _tmp11_;
				gboolean _tmp12_;
				gboolean _tmp13_;
				gboolean selected = FALSE;
				gboolean _tmp15_;
				ClocksContentItem* _tmp16_;
				gboolean _tmp17_;
				gboolean _tmp18_;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = i;
				_tmp5_ = n;
				if (!(((guint) _tmp4_) < _tmp5_)) {
					break;
				}
				_tmp6_ = self->priv->store;
				_tmp7_ = i;
				_tmp8_ = g_list_model_get_object ((GListModel*) _tmp6_, (guint) _tmp7_);
				_tmp9_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, CLOCKS_TYPE_CONTENT_ITEM) ? ((ClocksContentItem*) _tmp8_) : NULL;
				if (_tmp9_ == NULL) {
					_g_object_unref0 (_tmp8_);
				}
				item = _tmp9_;
				_tmp11_ = item;
				_tmp12_ = clocks_content_item_get_selectable (_tmp11_);
				_tmp13_ = _tmp12_;
				if (_tmp13_) {
					gboolean _tmp14_;
					_tmp14_ = select;
					_tmp10_ = _tmp14_;
				} else {
					_tmp10_ = FALSE;
				}
				selected = _tmp10_;
				_tmp15_ = selected;
				_tmp16_ = item;
				_tmp17_ = clocks_content_item_get_selected (_tmp16_);
				_tmp18_ = _tmp17_;
				if (_tmp15_ != _tmp18_) {
					ClocksContentItem* _tmp19_;
					ClocksContentItem* _tmp20_;
					gboolean _tmp21_;
					ClocksContentItem* _tmp22_;
					guint _tmp23_;
					_tmp19_ = item;
					g_signal_handlers_block_by_func (_tmp19_, (void*) clocks_content_store_on_item_selection_toggle, (void*) self);
					_tmp20_ = item;
					_tmp21_ = selected;
					clocks_content_item_set_selected (_tmp20_, _tmp21_);
					_tmp22_ = item;
					g_signal_handlers_unblock_by_func (_tmp22_, (void*) clocks_content_store_on_item_selection_toggle, (void*) self);
					_tmp23_ = n_toggled;
					n_toggled = _tmp23_ + 1;
				}
				_g_object_unref0 (item);
			}
		}
	}
	_tmp24_ = n_toggled;
	if (_tmp24_ > ((guint) 0)) {
		g_signal_emit (self, clocks_content_store_signals[CLOCKS_CONTENT_STORE_SELECTION_CHANGED_SIGNAL], 0);
	}
}


void clocks_content_store_select_all (ClocksContentStore* self) {
	g_return_if_fail (self != NULL);
	clocks_content_store_select_unselect_all (self, TRUE);
}


void clocks_content_store_unselect_all (ClocksContentStore* self) {
	g_return_if_fail (self != NULL);
	clocks_content_store_select_unselect_all (self, FALSE);
}


GVariant* clocks_content_store_serialize (ClocksContentStore* self) {
	GVariant* result = NULL;
	GVariantBuilder* builder = NULL;
	GVariantType* _tmp0_;
	GVariantType* _tmp1_;
	GVariantBuilder* _tmp2_;
	GVariantBuilder* _tmp3_;
	guint n = 0U;
	GListStore* _tmp4_;
	guint _tmp5_;
	GVariantBuilder* _tmp16_;
	GVariant* _tmp17_;
	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;
	_tmp5_ = g_list_model_get_n_items ((GListModel*) _tmp4_);
	n = _tmp5_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp6_ = FALSE;
			_tmp6_ = TRUE;
			while (TRUE) {
				gint _tmp8_;
				guint _tmp9_;
				ClocksContentItem* item = NULL;
				GListStore* _tmp10_;
				gint _tmp11_;
				GObject* _tmp12_;
				ClocksContentItem* _tmp13_;
				ClocksContentItem* _tmp14_;
				GVariantBuilder* _tmp15_;
				if (!_tmp6_) {
					gint _tmp7_;
					_tmp7_ = i;
					i = _tmp7_ + 1;
				}
				_tmp6_ = FALSE;
				_tmp8_ = i;
				_tmp9_ = n;
				if (!(((guint) _tmp8_) < _tmp9_)) {
					break;
				}
				_tmp10_ = self->priv->store;
				_tmp11_ = i;
				_tmp12_ = g_list_model_get_object ((GListModel*) _tmp10_, (guint) _tmp11_);
				_tmp13_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, CLOCKS_TYPE_CONTENT_ITEM) ? ((ClocksContentItem*) _tmp12_) : NULL;
				if (_tmp13_ == NULL) {
					_g_object_unref0 (_tmp12_);
				}
				item = _tmp13_;
				_tmp14_ = item;
				_tmp15_ = builder;
				clocks_content_item_serialize (_tmp14_, _tmp15_);
				_g_object_unref0 (item);
			}
		}
	}
	_tmp16_ = builder;
	_tmp17_ = g_variant_builder_end (_tmp16_);
	g_variant_ref_sink (_tmp17_);
	result = _tmp17_;
	_g_variant_builder_unref0 (builder);
	return result;
}


void clocks_content_store_deserialize (ClocksContentStore* self, GVariant* variant, ClocksContentStoreDeserializeItemFunc deserialize_item, void* deserialize_item_target) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (variant != NULL);
	{
		GVariantIter* _v_it = NULL;
		GVariant* _tmp0_;
		GVariantIter* _tmp1_;
		GVariant* v = NULL;
		_tmp0_ = variant;
		_tmp1_ = g_variant_iter_new (_tmp0_);
		_v_it = _tmp1_;
		while (TRUE) {
			GVariantIter* _tmp2_;
			GVariant* _tmp3_;
			GVariant* _tmp4_;
			ClocksContentItem* i = NULL;
			ClocksContentStoreDeserializeItemFunc _tmp5_;
			void* _tmp5__target;
			GVariant* _tmp6_;
			ClocksContentItem* _tmp7_;
			ClocksContentItem* _tmp8_;
			_tmp2_ = _v_it;
			_tmp3_ = g_variant_iter_next_value (_tmp2_);
			_g_variant_unref0 (v);
			v = _tmp3_;
			_tmp4_ = v;
			if (!(_tmp4_ != NULL)) {
				break;
			}
			_tmp5_ = deserialize_item;
			_tmp5__target = deserialize_item_target;
			_tmp6_ = v;
			_tmp7_ = _tmp5_ (_tmp6_, _tmp5__target);
			i = _tmp7_;
			_tmp8_ = i;
			if (_tmp8_ != NULL) {
				ClocksContentItem* _tmp9_;
				_tmp9_ = i;
				clocks_content_store_add (self, _tmp9_);
			}
			_g_object_unref0 (i);
		}
		_g_variant_unref0 (v);
		_g_variant_iter_free0 (_v_it);
	}
}


static void clocks_content_store_class_init (ClocksContentStoreClass * klass) {
	clocks_content_store_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ClocksContentStorePrivate));
	G_OBJECT_CLASS (klass)->finalize = clocks_content_store_finalize;
	clocks_content_store_signals[CLOCKS_CONTENT_STORE_SELECTION_CHANGED_SIGNAL] = g_signal_new ("selection-changed", CLOCKS_TYPE_CONTENT_STORE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}


static void clocks_content_store_g_list_model_interface_init (GListModelInterface * iface) {
	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) {
	self->priv = CLOCKS_CONTENT_STORE_GET_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);
	(self->priv->sort_func_target_destroy_notify == NULL) ? NULL : (self->priv->sort_func_target_destroy_notify (self->priv->sort_func_target), NULL);
	self->priv->sort_func = NULL;
	self->priv->sort_func_target = NULL;
	self->priv->sort_func_target_destroy_notify = NULL;
	G_OBJECT_CLASS (clocks_content_store_parent_class)->finalize (obj);
}


GType clocks_content_store_get_type (void) {
	static volatile gsize clocks_content_store_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_content_store_type_id__volatile)) {
		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);
		g_once_init_leave (&clocks_content_store_type_id__volatile, clocks_content_store_type_id);
	}
	return clocks_content_store_type_id__volatile;
}


ClocksSelectionMenuButton* clocks_selection_menu_button_construct (GType object_type) {
	ClocksSelectionMenuButton * self = NULL;
	GtkApplication* app = NULL;
	GApplication* _tmp0_;
	GtkApplication* _tmp1_;
	GMenu* _tmp2_;
	GtkLabel* _tmp3_;
	GtkImage* arrow = NULL;
	GtkImage* _tmp4_;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp5_;
	GtkLabel* _tmp6_;
	GtkStyleContext* _tmp7_;
	self = (ClocksSelectionMenuButton*) g_object_new (object_type, NULL);
	_tmp0_ = g_application_get_default ();
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_application_get_type (), GtkApplication));
	app = _tmp1_;
	_tmp2_ = gtk_application_get_menu_by_id (app, "selection-menu");
	gtk_menu_button_set_menu_model ((GtkMenuButton*) self, (GMenuModel*) _tmp2_);
	_tmp3_ = (GtkLabel*) gtk_label_new (_ ("Click on items to select them"));
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->menubutton_label);
	self->priv->menubutton_label = _tmp3_;
	_tmp4_ = (GtkImage*) gtk_image_new_from_icon_name ("pan-down-symbolic", GTK_ICON_SIZE_BUTTON);
	g_object_ref_sink (_tmp4_);
	arrow = _tmp4_;
	_tmp5_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp5_);
	grid = _tmp5_;
	gtk_grid_set_column_spacing (grid, (guint) 6);
	_tmp6_ = self->priv->menubutton_label;
	gtk_grid_attach (grid, (GtkWidget*) _tmp6_, 0, 0, 1, 1);
	gtk_grid_attach (grid, (GtkWidget*) arrow, 1, 0, 1, 1);
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) grid);
	gtk_widget_set_valign ((GtkWidget*) self, GTK_ALIGN_CENTER);
	_tmp7_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_add_class (_tmp7_, "selection-menu");
	gtk_widget_show_all ((GtkWidget*) self);
	_g_object_unref0 (grid);
	_g_object_unref0 (arrow);
	_g_object_unref0 (app);
	return self;
}


ClocksSelectionMenuButton* clocks_selection_menu_button_new (void) {
	return clocks_selection_menu_button_construct (CLOCKS_TYPE_SELECTION_MENU_BUTTON);
}


guint clocks_selection_menu_button_get_n_items (ClocksSelectionMenuButton* self) {
	guint result;
	guint _tmp0_;
	g_return_val_if_fail (self != NULL, 0U);
	_tmp0_ = self->priv->_n_items;
	result = _tmp0_;
	return result;
}


void clocks_selection_menu_button_set_n_items (ClocksSelectionMenuButton* self, guint value) {
	guint _tmp0_;
	guint _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_n_items;
	_tmp1_ = value;
	if (_tmp0_ != _tmp1_) {
		guint _tmp2_;
		gchar* label = NULL;
		guint _tmp3_;
		guint _tmp4_;
		GtkLabel* _tmp11_;
		const gchar* _tmp12_;
		_tmp2_ = value;
		self->priv->_n_items = _tmp2_;
		_tmp3_ = clocks_selection_menu_button_get_n_items (self);
		_tmp4_ = _tmp3_;
		if (_tmp4_ == ((guint) 0)) {
			gchar* _tmp5_;
			_tmp5_ = g_strdup (_ ("Click on items to select them"));
			_g_free0 (label);
			label = _tmp5_;
		} else {
			guint _tmp6_;
			guint _tmp7_;
			guint _tmp8_;
			guint _tmp9_;
			gchar* _tmp10_;
			_tmp6_ = clocks_selection_menu_button_get_n_items (self);
			_tmp7_ = _tmp6_;
			_tmp8_ = clocks_selection_menu_button_get_n_items (self);
			_tmp9_ = _tmp8_;
			_tmp10_ = g_strdup_printf (ngettext ("%u selected", "%u selected", (gulong) _tmp7_), _tmp9_);
			_g_free0 (label);
			label = _tmp10_;
		}
		_tmp11_ = self->priv->menubutton_label;
		_tmp12_ = label;
		gtk_label_set_label (_tmp11_, _tmp12_);
		_g_free0 (label);
	}
	g_object_notify_by_pspec ((GObject *) self, clocks_selection_menu_button_properties[CLOCKS_SELECTION_MENU_BUTTON_N_ITEMS_PROPERTY]);
}


static void clocks_selection_menu_button_class_init (ClocksSelectionMenuButtonClass * klass) {
	clocks_selection_menu_button_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ClocksSelectionMenuButtonPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_clocks_selection_menu_button_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_clocks_selection_menu_button_set_property;
	G_OBJECT_CLASS (klass)->finalize = clocks_selection_menu_button_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_SELECTION_MENU_BUTTON_N_ITEMS_PROPERTY, clocks_selection_menu_button_properties[CLOCKS_SELECTION_MENU_BUTTON_N_ITEMS_PROPERTY] = g_param_spec_uint ("n-items", "n-items", "n-items", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
}


static void clocks_selection_menu_button_instance_init (ClocksSelectionMenuButton * self) {
	self->priv = CLOCKS_SELECTION_MENU_BUTTON_GET_PRIVATE (self);
}


static void clocks_selection_menu_button_finalize (GObject * obj) {
	ClocksSelectionMenuButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_TYPE_SELECTION_MENU_BUTTON, ClocksSelectionMenuButton);
	_g_object_unref0 (self->priv->menubutton_label);
	G_OBJECT_CLASS (clocks_selection_menu_button_parent_class)->finalize (obj);
}


GType clocks_selection_menu_button_get_type (void) {
	static volatile gsize clocks_selection_menu_button_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_selection_menu_button_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ClocksSelectionMenuButtonClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_selection_menu_button_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksSelectionMenuButton), 0, (GInstanceInitFunc) clocks_selection_menu_button_instance_init, NULL };
		GType clocks_selection_menu_button_type_id;
		clocks_selection_menu_button_type_id = g_type_register_static (gtk_menu_button_get_type (), "ClocksSelectionMenuButton", &g_define_type_info, 0);
		g_once_init_leave (&clocks_selection_menu_button_type_id__volatile, clocks_selection_menu_button_type_id);
	}
	return clocks_selection_menu_button_type_id__volatile;
}


static void _vala_clocks_selection_menu_button_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ClocksSelectionMenuButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_TYPE_SELECTION_MENU_BUTTON, ClocksSelectionMenuButton);
	switch (property_id) {
		case CLOCKS_SELECTION_MENU_BUTTON_N_ITEMS_PROPERTY:
		g_value_set_uint (value, clocks_selection_menu_button_get_n_items (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_clocks_selection_menu_button_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	ClocksSelectionMenuButton * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_TYPE_SELECTION_MENU_BUTTON, ClocksSelectionMenuButton);
	switch (property_id) {
		case CLOCKS_SELECTION_MENU_BUTTON_N_ITEMS_PROPERTY:
		clocks_selection_menu_button_set_n_items (self, g_value_get_uint (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


GType clocks_content_view_mode_get_type (void) {
	static volatile gsize clocks_content_view_mode_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_content_view_mode_type_id__volatile)) {
		static const GEnumValue values[] = {{CLOCKS_CONTENT_VIEW_MODE_NORMAL, "CLOCKS_CONTENT_VIEW_MODE_NORMAL", "normal"}, {CLOCKS_CONTENT_VIEW_MODE_SELECTION, "CLOCKS_CONTENT_VIEW_MODE_SELECTION", "selection"}, {0, NULL, NULL}};
		GType clocks_content_view_mode_type_id;
		clocks_content_view_mode_type_id = g_enum_register_static ("ClocksContentViewMode", values);
		g_once_init_leave (&clocks_content_view_mode_type_id__volatile, clocks_content_view_mode_type_id);
	}
	return clocks_content_view_mode_type_id__volatile;
}


static Block6Data* block6_data_ref (Block6Data* _data6_) {
	g_atomic_int_inc (&_data6_->_ref_count_);
	return _data6_;
}


static void block6_data_unref (void * _userdata_) {
	Block6Data* _data6_;
	_data6_ = (Block6Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
		ClocksContentView* self;
		self = _data6_->self;
		(_data6_->create_func_target_destroy_notify == NULL) ? NULL : (_data6_->create_func_target_destroy_notify (_data6_->create_func_target), NULL);
		_data6_->create_func = NULL;
		_data6_->create_func_target = NULL;
		_data6_->create_func_target_destroy_notify = NULL;
		_g_object_unref0 (self);
		g_slice_free (Block6Data, _data6_);
	}
}


static void __lambda10_ (ClocksContentView* self) {
	guint n_items = 0U;
	ClocksContentStore* _tmp0_;
	guint _tmp1_;
	ClocksSelectionMenuButton* _tmp2_;
	guint _tmp3_;
	guint _tmp4_;
	_tmp0_ = self->priv->model;
	_tmp1_ = clocks_content_store_get_n_selected (_tmp0_);
	n_items = _tmp1_;
	_tmp2_ = self->priv->selection_menubutton;
	_tmp3_ = n_items;
	clocks_selection_menu_button_set_n_items (_tmp2_, _tmp3_);
	_tmp4_ = n_items;
	if (_tmp4_ != ((guint) 0)) {
		GtkButton* _tmp5_;
		_tmp5_ = self->priv->delete_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp5_, TRUE);
	} else {
		GtkButton* _tmp6_;
		_tmp6_ = self->priv->delete_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp6_, FALSE);
	}
}


static void ___lambda10__clocks_content_store_selection_changed (ClocksContentStore* _sender, gpointer self) {
	__lambda10_ ((ClocksContentView*) self);
}


static Block7Data* block7_data_ref (Block7Data* _data7_) {
	g_atomic_int_inc (&_data7_->_ref_count_);
	return _data7_;
}


static void block7_data_unref (void * _userdata_) {
	Block7Data* _data7_;
	_data7_ = (Block7Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
		ClocksContentView* self;
		self = _data7_->_data6_->self;
		_g_object_unref0 (_data7_->flow_box_child);
		_g_object_unref0 (_data7_->item);
		block6_data_unref (_data7_->_data6_);
		_data7_->_data6_ = NULL;
		g_slice_free (Block7Data, _data7_);
	}
}


static gboolean __lambda12_ (Block7Data* _data7_, GdkEventButton* event) {
	Block6Data* _data6_;
	ClocksContentView* self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_;
	gboolean _tmp7_;
	_data6_ = _data7_->_data6_;
	self = _data6_->self;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp1_ = clocks_content_item_get_selectable (_data7_->item);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GdkEventButton* _tmp3_;
		guint _tmp4_;
		_tmp3_ = event;
		_tmp4_ = _tmp3_->button;
		_tmp0_ = _tmp4_ == ((guint) GDK_BUTTON_SECONDARY);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		clocks_content_view_set_mode (self, CLOCKS_CONTENT_VIEW_MODE_SELECTION);
	}
	_tmp6_ = clocks_content_item_get_selectable (_data7_->item);
	_tmp7_ = _tmp6_;
	if (_tmp7_) {
		ClocksContentViewMode _tmp8_;
		ClocksContentViewMode _tmp9_;
		_tmp8_ = clocks_content_view_get_mode (self);
		_tmp9_ = _tmp8_;
		_tmp5_ = _tmp9_ == CLOCKS_CONTENT_VIEW_MODE_SELECTION;
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		gboolean _tmp10_;
		gboolean _tmp11_;
		_tmp10_ = clocks_content_item_get_selected (_data7_->item);
		_tmp11_ = _tmp10_;
		clocks_content_item_set_selected (_data7_->item, !_tmp11_);
		result = TRUE;
		return result;
	} else {
		GdkEventButton* _tmp12_;
		guint _tmp13_;
		_tmp12_ = event;
		_tmp13_ = _tmp12_->button;
		if (_tmp13_ == ((guint) GDK_BUTTON_PRIMARY)) {
			g_signal_emit (self, clocks_content_view_signals[CLOCKS_CONTENT_VIEW_ITEM_ACTIVATED_SIGNAL], 0, _data7_->item);
			result = TRUE;
			return result;
		}
	}
	result = FALSE;
	return result;
}


static gboolean ___lambda12__gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) {
	gboolean result;
	result = __lambda12_ (self, event);
	return result;
}


static gboolean __lambda13_ (Block7Data* _data7_, GBinding* binding, GValue* selectable, GValue* visible) {
	Block6Data* _data6_;
	ClocksContentView* self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	ClocksContentViewMode _tmp1_;
	ClocksContentViewMode _tmp2_;
	GValue _tmp5_ = {0};
	_data6_ = _data7_->_data6_;
	self = _data6_->self;
	g_return_val_if_fail (binding != NULL, FALSE);
	g_return_val_if_fail (selectable != NULL, FALSE);
	g_return_val_if_fail (visible != NULL, FALSE);
	_tmp1_ = clocks_content_view_get_mode (self);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == CLOCKS_CONTENT_VIEW_MODE_SELECTION) {
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp3_ = clocks_content_item_get_selectable (_data7_->item);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_;
	} else {
		_tmp0_ = FALSE;
	}
	g_value_init (&_tmp5_, G_TYPE_BOOLEAN);
	g_value_set_boolean (&_tmp5_, _tmp0_);
	G_IS_VALUE (visible) ? (g_value_unset (visible), NULL) : NULL;
	*visible = _tmp5_;
	result = TRUE;
	return result;
}


static gboolean ___lambda13__gbinding_transform_func (GBinding* binding, GValue* source_value, GValue* target_value, gpointer self) {
	gboolean result;
	result = __lambda13_ (self, binding, source_value, target_value);
	return result;
}


static gboolean __lambda14_ (Block7Data* _data7_, GBinding* binding, GValue* mode, GValue* visible) {
	Block6Data* _data6_;
	ClocksContentView* self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	GValue _tmp1_;
	GValue _tmp4_ = {0};
	_data6_ = _data7_->_data6_;
	self = _data6_->self;
	g_return_val_if_fail (binding != NULL, FALSE);
	g_return_val_if_fail (mode != NULL, FALSE);
	g_return_val_if_fail (visible != NULL, FALSE);
	_tmp1_ = *mode;
	if (g_value_get_enum (&_tmp1_) == CLOCKS_CONTENT_VIEW_MODE_SELECTION) {
		gboolean _tmp2_;
		gboolean _tmp3_;
		_tmp2_ = clocks_content_item_get_selectable (_data7_->item);
		_tmp3_ = _tmp2_;
		_tmp0_ = _tmp3_;
	} else {
		_tmp0_ = FALSE;
	}
	g_value_init (&_tmp4_, G_TYPE_BOOLEAN);
	g_value_set_boolean (&_tmp4_, _tmp0_);
	G_IS_VALUE (visible) ? (g_value_unset (visible), NULL) : NULL;
	*visible = _tmp4_;
	result = TRUE;
	return result;
}


static gboolean ___lambda14__gbinding_transform_func (GBinding* binding, GValue* source_value, GValue* target_value, gpointer self) {
	gboolean result;
	result = __lambda14_ (self, binding, source_value, target_value);
	return result;
}


static gboolean __lambda15_ (Block7Data* _data7_, GdkEventCrossing* event) {
	Block6Data* _data6_;
	ClocksContentView* self;
	gboolean result = FALSE;
	GtkStyleContext* _tmp0_;
	_data6_ = _data7_->_data6_;
	self = _data6_->self;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = gtk_widget_get_style_context ((GtkWidget*) _data7_->flow_box_child);
	gtk_style_context_add_class (_tmp0_, "prelight");
	result = FALSE;
	return result;
}


static gboolean ___lambda15__gtk_widget_enter_notify_event (GtkWidget* _sender, GdkEventCrossing* event, gpointer self) {
	gboolean result;
	result = __lambda15_ (self, event);
	return result;
}


static gboolean __lambda16_ (Block7Data* _data7_, GdkEventCrossing* event) {
	Block6Data* _data6_;
	ClocksContentView* self;
	gboolean result = FALSE;
	GdkEventCrossing* _tmp0_;
	GdkNotifyType _tmp1_;
	_data6_ = _data7_->_data6_;
	self = _data6_->self;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = event;
	_tmp1_ = _tmp0_->detail;
	if (_tmp1_ != GDK_NOTIFY_INFERIOR) {
		GtkStyleContext* _tmp2_;
		_tmp2_ = gtk_widget_get_style_context ((GtkWidget*) _data7_->flow_box_child);
		gtk_style_context_remove_class (_tmp2_, "prelight");
	}
	result = FALSE;
	return result;
}


static gboolean ___lambda16__gtk_widget_leave_notify_event (GtkWidget* _sender, GdkEventCrossing* event, gpointer self) {
	gboolean result;
	result = __lambda16_ (self, event);
	return result;
}


static GtkWidget* __lambda11_ (Block6Data* _data6_, GObject* object) {
	ClocksContentView* self;
	GtkWidget* result = NULL;
	Block7Data* _data7_;
	GObject* _tmp0_;
	ClocksContentItem* _tmp1_;
	GtkWidget* inner = NULL;
	ClocksContentViewContentViewCreateWidgetFunc _tmp2_;
	void* _tmp2__target;
	GtkWidget* _tmp3_;
	GtkEventBox* event_box = NULL;
	GtkEventBox* _tmp4_;
	GtkOverlay* overlay = NULL;
	GtkOverlay* _tmp5_;
	GtkCheckButton* check = NULL;
	GtkCheckButton* _tmp6_;
	GtkFlowBoxChild* _tmp7_;
	GtkStyleContext* _tmp8_;
	GtkWidget* _tmp9_;
	self = _data6_->self;
	g_return_val_if_fail (object != NULL, NULL);
	_data7_ = g_slice_new0 (Block7Data);
	_data7_->_ref_count_ = 1;
	_data7_->_data6_ = block6_data_ref (_data6_);
	_tmp0_ = object;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, CLOCKS_TYPE_CONTENT_ITEM, ClocksContentItem));
	_data7_->item = _tmp1_;
	_tmp2_ = _data6_->create_func;
	_tmp2__target = _data6_->create_func_target;
	_tmp3_ = _tmp2_ (_data7_->item, _tmp2__target);
	inner = _tmp3_;
	_tmp4_ = (GtkEventBox*) gtk_event_box_new ();
	g_object_ref_sink (_tmp4_);
	event_box = _tmp4_;
	gtk_container_add ((GtkContainer*) event_box, inner);
	g_signal_connect_data ((GtkWidget*) event_box, "button-press-event", (GCallback) ___lambda12__gtk_widget_button_press_event, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
	_tmp5_ = (GtkOverlay*) gtk_overlay_new ();
	g_object_ref_sink (_tmp5_);
	overlay = _tmp5_;
	gtk_widget_set_halign ((GtkWidget*) overlay, GTK_ALIGN_START);
	gtk_widget_set_valign ((GtkWidget*) overlay, GTK_ALIGN_START);
	gtk_container_add ((GtkContainer*) overlay, (GtkWidget*) event_box);
	_tmp6_ = (GtkCheckButton*) gtk_check_button_new ();
	g_object_ref_sink (_tmp6_);
	check = _tmp6_;
	gtk_widget_set_no_show_all ((GtkWidget*) check, TRUE);
	gtk_widget_set_halign ((GtkWidget*) check, GTK_ALIGN_END);
	gtk_widget_set_valign ((GtkWidget*) check, GTK_ALIGN_END);
	gtk_widget_set_margin_bottom ((GtkWidget*) check, 8);
	gtk_widget_set_margin_end ((GtkWidget*) check, 8);
	g_object_bind_property_with_closures ((GObject*) _data7_->item, "selected", (GObject*) check, "active", (G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE) | G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_object_bind_property_with_closures ((GObject*) _data7_->item, "selectable", (GObject*) check, "visible", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE, (GClosure*) ((___lambda13__gbinding_transform_func == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda13__gbinding_transform_func, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_object_bind_property_with_closures ((GObject*) self, "mode", (GObject*) check, "visible", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE, (GClosure*) ((___lambda14__gbinding_transform_func == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda14__gbinding_transform_func, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	gtk_overlay_add_overlay (overlay, (GtkWidget*) check);
	_tmp7_ = (GtkFlowBoxChild*) gtk_flow_box_child_new ();
	g_object_ref_sink (_tmp7_);
	_data7_->flow_box_child = _tmp7_;
	gtk_widget_set_halign ((GtkWidget*) _data7_->flow_box_child, GTK_ALIGN_START);
	gtk_widget_set_valign ((GtkWidget*) _data7_->flow_box_child, GTK_ALIGN_START);
	gtk_container_add ((GtkContainer*) _data7_->flow_box_child, (GtkWidget*) overlay);
	_tmp8_ = gtk_widget_get_style_context ((GtkWidget*) _data7_->flow_box_child);
	gtk_style_context_add_class (_tmp8_, "tile");
	g_signal_connect_data ((GtkWidget*) event_box, "enter-notify-event", (GCallback) ___lambda15__gtk_widget_enter_notify_event, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
	g_signal_connect_data ((GtkWidget*) event_box, "leave-notify-event", (GCallback) ___lambda16__gtk_widget_leave_notify_event, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
	gtk_widget_show_all ((GtkWidget*) _data7_->flow_box_child);
	_tmp9_ = _g_object_ref0 ((GtkWidget*) _data7_->flow_box_child);
	result = _tmp9_;
	_g_object_unref0 (check);
	_g_object_unref0 (overlay);
	_g_object_unref0 (event_box);
	_g_object_unref0 (inner);
	block7_data_unref (_data7_);
	_data7_ = NULL;
	return result;
}


static GtkWidget* ___lambda11__gtk_flow_box_create_widget_func (GObject* item, gpointer self) {
	GtkWidget* result;
	result = __lambda11_ (self, item);
	return result;
}


void clocks_content_view_bind_model (ClocksContentView* self, ClocksContentStore* store, ClocksContentViewContentViewCreateWidgetFunc create_func, void* create_func_target, GDestroyNotify create_func_target_destroy_notify) {
	Block6Data* _data6_;
	ClocksContentViewContentViewCreateWidgetFunc _tmp0_;
	void* _tmp0__target;
	ClocksContentStore* _tmp1_;
	ClocksContentStore* _tmp2_;
	ClocksContentStore* _tmp3_;
	GtkFlowBox* _tmp4_;
	ClocksContentStore* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (store != NULL);
	_data6_ = g_slice_new0 (Block6Data);
	_data6_->_ref_count_ = 1;
	_data6_->self = g_object_ref (self);
	_tmp0_ = create_func;
	_tmp0__target = create_func_target;
	(_data6_->create_func_target_destroy_notify == NULL) ? NULL : (_data6_->create_func_target_destroy_notify (_data6_->create_func_target), NULL);
	_data6_->create_func = NULL;
	_data6_->create_func_target = NULL;
	_data6_->create_func_target_destroy_notify = NULL;
	_data6_->create_func = _tmp0_;
	_data6_->create_func_target = _tmp0__target;
	_data6_->create_func_target_destroy_notify = create_func_target_destroy_notify;
	_tmp1_ = store;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (self->priv->model);
	self->priv->model = _tmp2_;
	_tmp3_ = self->priv->model;
	g_signal_connect_object (_tmp3_, "selection-changed", (GCallback) ___lambda10__clocks_content_store_selection_changed, self, 0);
	_tmp4_ = self->priv->flow_box;
	_tmp5_ = self->priv->model;
	gtk_flow_box_bind_model (_tmp4_, (GListModel*) _tmp5_, ___lambda11__gtk_flow_box_create_widget_func, block6_data_ref (_data6_), block6_data_unref);
	block6_data_unref (_data6_);
	_data6_ = NULL;
}


void clocks_content_view_select_all (ClocksContentView* self) {
	ClocksContentStore* _tmp0_;
	g_return_if_fail (self != NULL);
	clocks_content_view_set_mode (self, CLOCKS_CONTENT_VIEW_MODE_SELECTION);
	_tmp0_ = self->priv->model;
	clocks_content_store_select_all (_tmp0_);
}


void clocks_content_view_unselect_all (ClocksContentView* self) {
	ClocksContentStore* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->model;
	clocks_content_store_unselect_all (_tmp0_);
}


gboolean clocks_content_view_escape_pressed (ClocksContentView* self) {
	gboolean result = FALSE;
	ClocksContentViewMode _tmp0_;
	ClocksContentViewMode _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = clocks_content_view_get_mode (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == CLOCKS_CONTENT_VIEW_MODE_SELECTION) {
		clocks_content_view_set_mode (self, CLOCKS_CONTENT_VIEW_MODE_NORMAL);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}


static void __lambda17_ (ClocksContentView* self) {
	clocks_content_view_set_mode (self, CLOCKS_CONTENT_VIEW_MODE_SELECTION);
}


static void ___lambda17__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda17_ ((ClocksContentView*) self);
}


static void __lambda18_ (ClocksContentView* self) {
	clocks_content_view_set_mode (self, CLOCKS_CONTENT_VIEW_MODE_NORMAL);
}


static void ___lambda18__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda18_ ((ClocksContentView*) self);
}


void clocks_content_view_set_header_bar (ClocksContentView* self, ClocksHeaderBar* bar) {
	ClocksHeaderBar* _tmp0_;
	ClocksHeaderBar* _tmp1_;
	GtkButton* _tmp2_;
	GtkImage* select_button_image = NULL;
	GtkImage* _tmp3_;
	GtkButton* _tmp4_;
	GtkButton* _tmp5_;
	GtkButton* _tmp6_;
	GtkButton* _tmp7_;
	ClocksHeaderBar* _tmp8_;
	GtkButton* _tmp9_;
	GtkButton* _tmp10_;
	GtkButton* _tmp11_;
	GtkButton* _tmp12_;
	GtkButton* _tmp13_;
	ClocksHeaderBar* _tmp14_;
	GtkButton* _tmp15_;
	ClocksSelectionMenuButton* _tmp16_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (bar != NULL);
	_tmp0_ = bar;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->header_bar);
	self->priv->header_bar = _tmp1_;
	_tmp2_ = (GtkButton*) gtk_button_new ();
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->select_button);
	self->priv->select_button = _tmp2_;
	_tmp3_ = (GtkImage*) gtk_image_new_from_icon_name ("object-select-symbolic", GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp3_);
	select_button_image = _tmp3_;
	_tmp4_ = self->priv->select_button;
	gtk_button_set_image (_tmp4_, (GtkWidget*) select_button_image);
	_tmp5_ = self->priv->select_button;
	gtk_widget_set_valign ((GtkWidget*) _tmp5_, GTK_ALIGN_CENTER);
	_tmp6_ = self->priv->select_button;
	gtk_widget_set_no_show_all ((GtkWidget*) _tmp6_, TRUE);
	_tmp7_ = self->priv->select_button;
	g_signal_connect_object (_tmp7_, "clicked", (GCallback) ___lambda17__gtk_button_clicked, self, 0);
	_tmp8_ = self->priv->header_bar;
	_tmp9_ = self->priv->select_button;
	gtk_header_bar_pack_end ((GtkHeaderBar*) _tmp8_, (GtkWidget*) _tmp9_);
	_tmp10_ = (GtkButton*) gtk_button_new_with_label (_ ("Cancel"));
	g_object_ref_sink (_tmp10_);
	_g_object_unref0 (self->priv->cancel_button);
	self->priv->cancel_button = _tmp10_;
	_tmp11_ = self->priv->cancel_button;
	gtk_widget_set_no_show_all ((GtkWidget*) _tmp11_, TRUE);
	_tmp12_ = self->priv->cancel_button;
	gtk_widget_set_valign ((GtkWidget*) _tmp12_, GTK_ALIGN_CENTER);
	_tmp13_ = self->priv->cancel_button;
	g_signal_connect_object (_tmp13_, "clicked", (GCallback) ___lambda18__gtk_button_clicked, self, 0);
	_tmp14_ = self->priv->header_bar;
	_tmp15_ = self->priv->cancel_button;
	gtk_header_bar_pack_end ((GtkHeaderBar*) _tmp14_, (GtkWidget*) _tmp15_);
	_tmp16_ = clocks_selection_menu_button_new ();
	g_object_ref_sink (_tmp16_);
	_g_object_unref0 (self->priv->selection_menubutton);
	self->priv->selection_menubutton = _tmp16_;
	_g_object_unref0 (select_button_image);
}


static gboolean ___lambda19_ (ClocksContentView* self, ClocksContentItem* i) {
	gboolean result = FALSE;
	ClocksContentItem* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_val_if_fail (i != NULL, FALSE);
	_tmp0_ = i;
	_tmp1_ = clocks_content_item_get_selectable (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}


static gboolean ____lambda19__clocks_content_store_find_func (ClocksContentItem* item, gpointer self) {
	gboolean result;
	result = ___lambda19_ ((ClocksContentView*) self, item);
	return result;
}


void clocks_content_view_update_header_bar (ClocksContentView* self) {
	ClocksHeaderBar* _tmp0_;
	ClocksHeaderBarMode _tmp1_;
	ClocksHeaderBarMode _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->header_bar;
	_tmp1_ = clocks_header_bar_get_mode (_tmp0_);
	_tmp2_ = _tmp1_;
	switch (_tmp2_) {
		case CLOCKS_HEADER_BAR_MODE_SELECTION:
		{
			ClocksHeaderBar* _tmp3_;
			ClocksSelectionMenuButton* _tmp4_;
			GtkButton* _tmp5_;
			_tmp3_ = self->priv->header_bar;
			_tmp4_ = self->priv->selection_menubutton;
			gtk_header_bar_set_custom_title ((GtkHeaderBar*) _tmp3_, (GtkWidget*) _tmp4_);
			_tmp5_ = self->priv->cancel_button;
			gtk_widget_show ((GtkWidget*) _tmp5_);
			break;
		}
		case CLOCKS_HEADER_BAR_MODE_NORMAL:
		{
			ClocksContentItem* first_selectable = NULL;
			ClocksContentStore* _tmp6_;
			ClocksContentItem* _tmp7_;
			GtkButton* _tmp8_;
			ClocksContentItem* _tmp9_;
			_tmp6_ = self->priv->model;
			_tmp7_ = clocks_content_store_find (_tmp6_, ____lambda19__clocks_content_store_find_func, self);
			first_selectable = _tmp7_;
			_tmp8_ = self->priv->select_button;
			_tmp9_ = first_selectable;
			gtk_widget_set_visible ((GtkWidget*) _tmp8_, _tmp9_ != NULL);
			_g_object_unref0 (first_selectable);
			break;
		}
		default:
		break;
	}
}


ClocksContentView* clocks_content_view_construct (GType object_type) {
	ClocksContentView * self = NULL;
	self = (ClocksContentView*) g_object_new (object_type, NULL);
	return self;
}


ClocksContentView* clocks_content_view_new (void) {
	return clocks_content_view_construct (CLOCKS_TYPE_CONTENT_VIEW);
}


ClocksContentViewMode clocks_content_view_get_mode (ClocksContentView* self) {
	ClocksContentViewMode result;
	ClocksContentViewMode _tmp0_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->_mode;
	result = _tmp0_;
	return result;
}


static void clocks_content_view_set_mode (ClocksContentView* self, ClocksContentViewMode value) {
	ClocksContentViewMode _tmp0_;
	ClocksContentViewMode _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_mode;
	_tmp1_ = value;
	if (_tmp0_ != _tmp1_) {
		ClocksContentViewMode _tmp2_;
		ClocksContentViewMode _tmp3_;
		_tmp2_ = value;
		self->priv->_mode = _tmp2_;
		_tmp3_ = self->priv->_mode;
		switch (_tmp3_) {
			case CLOCKS_CONTENT_VIEW_MODE_SELECTION:
			{
				ClocksHeaderBar* _tmp4_;
				GtkActionBar* _tmp5_;
				_tmp4_ = self->priv->header_bar;
				clocks_header_bar_set_mode (_tmp4_, CLOCKS_HEADER_BAR_MODE_SELECTION);
				_tmp5_ = self->priv->action_bar;
				gtk_widget_show ((GtkWidget*) _tmp5_);
				break;
			}
			case CLOCKS_CONTENT_VIEW_MODE_NORMAL:
			{
				ClocksHeaderBar* _tmp6_;
				GtkActionBar* _tmp7_;
				ClocksContentStore* _tmp8_;
				_tmp6_ = self->priv->header_bar;
				clocks_header_bar_set_mode (_tmp6_, CLOCKS_HEADER_BAR_MODE_NORMAL);
				_tmp7_ = self->priv->action_bar;
				gtk_widget_hide ((GtkWidget*) _tmp7_);
				_tmp8_ = self->priv->model;
				clocks_content_store_unselect_all (_tmp8_);
				break;
			}
			default:
			{
				g_assert_not_reached ();
			}
		}
	}
	g_object_notify_by_pspec ((GObject *) self, clocks_content_view_properties[CLOCKS_CONTENT_VIEW_MODE_PROPERTY]);
}


static void _clocks_content_view___lambda20_ (ClocksContentView* self, GtkFlowBoxChild* child) {
	ClocksContentItem* item = NULL;
	ClocksContentStore* _tmp0_;
	GtkFlowBoxChild* _tmp1_;
	gint _tmp2_;
	GObject* _tmp3_;
	ClocksContentItem* _tmp4_;
	ClocksContentItem* _tmp5_;
	g_return_if_fail (child != NULL);
	_tmp0_ = self->priv->model;
	_tmp1_ = child;
	_tmp2_ = gtk_flow_box_child_get_index (_tmp1_);
	_tmp3_ = g_list_model_get_item ((GListModel*) _tmp0_, (guint) _tmp2_);
	_tmp4_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, CLOCKS_TYPE_CONTENT_ITEM) ? ((ClocksContentItem*) _tmp3_) : NULL;
	if (_tmp4_ == NULL) {
		_g_object_unref0 (_tmp3_);
	}
	item = _tmp4_;
	_tmp5_ = item;
	if (_tmp5_ != NULL) {
		ClocksContentItem* _tmp6_;
		_tmp6_ = item;
		g_signal_emit (self, clocks_content_view_signals[CLOCKS_CONTENT_VIEW_ITEM_ACTIVATED_SIGNAL], 0, _tmp6_);
	}
	_g_object_unref0 (item);
}


static void __clocks_content_view___lambda20__gtk_flow_box_child_activated (GtkFlowBox* _sender, GtkFlowBoxChild* child, gpointer self) {
	_clocks_content_view___lambda20_ ((ClocksContentView*) self, child);
}


static void _clocks_content_view___lambda21_ (ClocksContentView* self) {
	ClocksContentStore* _tmp0_;
	_tmp0_ = self->priv->model;
	clocks_content_store_delete_selected (_tmp0_);
	clocks_content_view_set_mode (self, CLOCKS_CONTENT_VIEW_MODE_NORMAL);
}


static void __clocks_content_view___lambda21__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	_clocks_content_view___lambda21_ ((ClocksContentView*) self);
}


static GObject * clocks_content_view_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	ClocksContentView * self;
	GtkStyleContext* _tmp0_;
	GtkFlowBox* _tmp1_;
	GtkFlowBox* _tmp2_;
	GtkFlowBox* _tmp3_;
	GtkFlowBox* _tmp4_;
	GtkScrolledWindow* scrolled_window = NULL;
	GtkScrolledWindow* _tmp5_;
	GtkScrolledWindow* _tmp6_;
	GtkFlowBox* _tmp7_;
	GtkScrolledWindow* _tmp8_;
	GtkScrolledWindow* _tmp9_;
	GtkScrolledWindow* _tmp10_;
	GtkScrolledWindow* _tmp11_;
	GtkGrid* _tmp12_;
	GtkGrid* _tmp13_;
	GtkScrolledWindow* _tmp14_;
	GtkActionBar* _tmp15_;
	GtkActionBar* _tmp16_;
	GtkGrid* _tmp17_;
	GtkActionBar* _tmp18_;
	GtkButton* _tmp19_;
	GtkButton* _tmp20_;
	GtkButton* _tmp21_;
	GtkButton* _tmp22_;
	GtkButton* _tmp23_;
	GtkButton* _tmp24_;
	GtkButton* _tmp25_;
	GtkActionBar* _tmp26_;
	GtkButton* _tmp27_;
	GtkGrid* _tmp28_;
	GtkGrid* _tmp29_;
	parent_class = G_OBJECT_CLASS (clocks_content_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_TYPE_CONTENT_VIEW, ClocksContentView);
	_tmp0_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_add_class (_tmp0_, "content-view");
	_tmp1_ = (GtkFlowBox*) gtk_flow_box_new ();
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->flow_box);
	self->priv->flow_box = _tmp1_;
	_tmp2_ = self->priv->flow_box;
	gtk_flow_box_set_selection_mode (_tmp2_, GTK_SELECTION_NONE);
	_tmp3_ = self->priv->flow_box;
	gtk_flow_box_set_min_children_per_line (_tmp3_, (guint) 3);
	_tmp4_ = self->priv->flow_box;
	g_signal_connect_object (_tmp4_, "child-activated", (GCallback) __clocks_content_view___lambda20__gtk_flow_box_child_activated, self, 0);
	_tmp5_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_ref_sink (_tmp5_);
	scrolled_window = _tmp5_;
	_tmp6_ = scrolled_window;
	_tmp7_ = self->priv->flow_box;
	gtk_container_add ((GtkContainer*) _tmp6_, (GtkWidget*) _tmp7_);
	_tmp8_ = scrolled_window;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp8_, TRUE);
	_tmp9_ = scrolled_window;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp9_, TRUE);
	_tmp10_ = scrolled_window;
	gtk_widget_set_halign ((GtkWidget*) _tmp10_, GTK_ALIGN_FILL);
	_tmp11_ = scrolled_window;
	gtk_widget_set_valign ((GtkWidget*) _tmp11_, GTK_ALIGN_FILL);
	_tmp12_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp12_);
	_g_object_unref0 (self->priv->grid);
	self->priv->grid = _tmp12_;
	_tmp13_ = self->priv->grid;
	_tmp14_ = scrolled_window;
	gtk_grid_attach (_tmp13_, (GtkWidget*) _tmp14_, 0, 0, 1, 1);
	_tmp15_ = (GtkActionBar*) gtk_action_bar_new ();
	g_object_ref_sink (_tmp15_);
	_g_object_unref0 (self->priv->action_bar);
	self->priv->action_bar = _tmp15_;
	_tmp16_ = self->priv->action_bar;
	gtk_widget_set_no_show_all ((GtkWidget*) _tmp16_, TRUE);
	_tmp17_ = self->priv->grid;
	_tmp18_ = self->priv->action_bar;
	gtk_grid_attach (_tmp17_, (GtkWidget*) _tmp18_, 0, 1, 1, 1);
	_tmp19_ = (GtkButton*) gtk_button_new ();
	g_object_ref_sink (_tmp19_);
	_g_object_unref0 (self->priv->delete_button);
	self->priv->delete_button = _tmp19_;
	_tmp20_ = self->priv->delete_button;
	gtk_button_set_label (_tmp20_, _ ("Delete"));
	_tmp21_ = self->priv->delete_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp21_, TRUE);
	_tmp22_ = self->priv->delete_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp22_, FALSE);
	_tmp23_ = self->priv->delete_button;
	gtk_widget_set_halign ((GtkWidget*) _tmp23_, GTK_ALIGN_END);
	_tmp24_ = self->priv->delete_button;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp24_, TRUE);
	_tmp25_ = self->priv->delete_button;
	g_signal_connect_object (_tmp25_, "clicked", (GCallback) __clocks_content_view___lambda21__gtk_button_clicked, self, 0);
	_tmp26_ = self->priv->action_bar;
	_tmp27_ = self->priv->delete_button;
	gtk_action_bar_pack_end (_tmp26_, (GtkWidget*) _tmp27_);
	_tmp28_ = self->priv->grid;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp28_);
	_tmp29_ = self->priv->grid;
	gtk_widget_show_all ((GtkWidget*) _tmp29_);
	_g_object_unref0 (scrolled_window);
	return obj;
}


static void clocks_content_view_class_init (ClocksContentViewClass * klass) {
	clocks_content_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ClocksContentViewPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_clocks_content_view_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_clocks_content_view_set_property;
	G_OBJECT_CLASS (klass)->constructor = clocks_content_view_constructor;
	G_OBJECT_CLASS (klass)->finalize = clocks_content_view_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_CONTENT_VIEW_MODE_PROPERTY, clocks_content_view_properties[CLOCKS_CONTENT_VIEW_MODE_PROPERTY] = g_param_spec_enum ("mode", "mode", "mode", CLOCKS_CONTENT_VIEW_TYPE_MODE, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	clocks_content_view_signals[CLOCKS_CONTENT_VIEW_ITEM_ACTIVATED_SIGNAL] = g_signal_new ("item-activated", CLOCKS_TYPE_CONTENT_VIEW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, CLOCKS_TYPE_CONTENT_ITEM);
}


static void clocks_content_view_instance_init (ClocksContentView * self) {
	self->priv = CLOCKS_CONTENT_VIEW_GET_PRIVATE (self);
}


static void clocks_content_view_finalize (GObject * obj) {
	ClocksContentView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_TYPE_CONTENT_VIEW, ClocksContentView);
	_g_object_unref0 (self->priv->model);
	_g_object_unref0 (self->priv->flow_box);
	_g_object_unref0 (self->priv->select_button);
	_g_object_unref0 (self->priv->cancel_button);
	_g_object_unref0 (self->priv->selection_menubutton);
	_g_object_unref0 (self->priv->grid);
	_g_object_unref0 (self->priv->action_bar);
	_g_object_unref0 (self->priv->delete_button);
	_g_object_unref0 (self->priv->header_bar);
	G_OBJECT_CLASS (clocks_content_view_parent_class)->finalize (obj);
}


GType clocks_content_view_get_type (void) {
	static volatile gsize clocks_content_view_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_content_view_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ClocksContentViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_content_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksContentView), 0, (GInstanceInitFunc) clocks_content_view_instance_init, NULL };
		GType clocks_content_view_type_id;
		clocks_content_view_type_id = g_type_register_static (gtk_bin_get_type (), "ClocksContentView", &g_define_type_info, 0);
		g_once_init_leave (&clocks_content_view_type_id__volatile, clocks_content_view_type_id);
	}
	return clocks_content_view_type_id__volatile;
}


static void _vala_clocks_content_view_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ClocksContentView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_TYPE_CONTENT_VIEW, ClocksContentView);
	switch (property_id) {
		case CLOCKS_CONTENT_VIEW_MODE_PROPERTY:
		g_value_set_enum (value, clocks_content_view_get_mode (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_clocks_content_view_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	ClocksContentView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_TYPE_CONTENT_VIEW, ClocksContentView);
	switch (property_id) {
		case CLOCKS_CONTENT_VIEW_MODE_PROPERTY:
		clocks_content_view_set_mode (self, g_value_get_enum (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


GType clocks_am_pm_toggle_button_am_pm_get_type (void) {
	static volatile gsize clocks_am_pm_toggle_button_am_pm_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_am_pm_toggle_button_am_pm_type_id__volatile)) {
		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);
		g_once_init_leave (&clocks_am_pm_toggle_button_am_pm_type_id__volatile, clocks_am_pm_toggle_button_am_pm_type_id);
	}
	return clocks_am_pm_toggle_button_am_pm_type_id__volatile;
}


static void __lambda38_ (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 ___lambda38__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda38_ ((ClocksAmPmToggleButton*) self);
}


ClocksAmPmToggleButton* clocks_am_pm_toggle_button_construct (GType object_type) {
	ClocksAmPmToggleButton * self = NULL;
	GtkStack* _tmp0_;
	GtkStyleContext* _tmp1_;
	gchar* str = NULL;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	GtkLabel* _tmp7_;
	GDateTime* _tmp8_;
	GDateTime* _tmp9_;
	gchar* _tmp10_;
	const gchar* _tmp11_;
	GtkLabel* _tmp12_;
	GtkStack* _tmp13_;
	GtkLabel* _tmp14_;
	GtkStack* _tmp15_;
	GtkLabel* _tmp16_;
	GtkStack* _tmp17_;
	GtkStack* _tmp18_;
	GtkLabel* _tmp19_;
	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_;
	_tmp1_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_add_class (_tmp1_, "clocks-ampm-toggle-button");
	_tmp2_ = g_date_time_new_utc (1, 1, 1, 0, 0, (gdouble) 0);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_date_time_format (_tmp3_, "%p");
	_tmp5_ = _tmp4_;
	_g_date_time_unref0 (_tmp3_);
	str = _tmp5_;
	_tmp6_ = str;
	_tmp7_ = (GtkLabel*) gtk_label_new (_tmp6_);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->am_label);
	self->priv->am_label = _tmp7_;
	_tmp8_ = g_date_time_new_utc (1, 1, 1, 12, 0, (gdouble) 0);
	_tmp9_ = _tmp8_;
	_tmp10_ = g_date_time_format (_tmp9_, "%p");
	_g_free0 (str);
	str = _tmp10_;
	_g_date_time_unref0 (_tmp9_);
	_tmp11_ = str;
	_tmp12_ = (GtkLabel*) gtk_label_new (_tmp11_);
	g_object_ref_sink (_tmp12_);
	_g_object_unref0 (self->priv->pm_label);
	self->priv->pm_label = _tmp12_;
	_tmp13_ = self->priv->stack;
	_tmp14_ = self->priv->am_label;
	gtk_container_add ((GtkContainer*) _tmp13_, (GtkWidget*) _tmp14_);
	_tmp15_ = self->priv->stack;
	_tmp16_ = self->priv->pm_label;
	gtk_container_add ((GtkContainer*) _tmp15_, (GtkWidget*) _tmp16_);
	_tmp17_ = self->priv->stack;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp17_);
	g_signal_connect_object ((GtkButton*) self, "clicked", (GCallback) ___lambda38__gtk_button_clicked, self, 0);
	clocks_am_pm_toggle_button_set_choice (self, CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_AM);
	_tmp18_ = self->priv->stack;
	_tmp19_ = self->priv->am_label;
	gtk_stack_set_visible_child (_tmp18_, (GtkWidget*) _tmp19_);
	gtk_widget_show_all ((GtkWidget*) self);
	_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;
	ClocksAmPmToggleButtonAmPm _tmp0_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->_choice;
	result = _tmp0_;
	return result;
}


void clocks_am_pm_toggle_button_set_choice (ClocksAmPmToggleButton* self, ClocksAmPmToggleButtonAmPm value) {
	ClocksAmPmToggleButtonAmPm _tmp0_;
	ClocksAmPmToggleButtonAmPm _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_choice;
	_tmp1_ = value;
	if (_tmp0_ != _tmp1_) {
		ClocksAmPmToggleButtonAmPm _tmp2_;
		GtkLabel* _tmp3_ = NULL;
		ClocksAmPmToggleButtonAmPm _tmp4_;
		GtkStack* _tmp7_;
		_tmp2_ = value;
		self->priv->_choice = _tmp2_;
		_tmp4_ = self->priv->_choice;
		if (_tmp4_ == CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_AM) {
			GtkLabel* _tmp5_;
			_tmp5_ = self->priv->am_label;
			_tmp3_ = _tmp5_;
		} else {
			GtkLabel* _tmp6_;
			_tmp6_ = self->priv->pm_label;
			_tmp3_ = _tmp6_;
		}
		_tmp7_ = self->priv->stack;
		gtk_stack_set_visible_child (_tmp7_, (GtkWidget*) _tmp3_);
	}
	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) {
	clocks_am_pm_toggle_button_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ClocksAmPmToggleButtonPrivate));
	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_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
}


static void clocks_am_pm_toggle_button_instance_init (ClocksAmPmToggleButton * self) {
	self->priv = CLOCKS_AM_PM_TOGGLE_BUTTON_GET_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);
}


GType clocks_am_pm_toggle_button_get_type (void) {
	static volatile gsize clocks_am_pm_toggle_button_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_am_pm_toggle_button_type_id__volatile)) {
		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);
		g_once_init_leave (&clocks_am_pm_toggle_button_type_id__volatile, clocks_am_pm_toggle_button_type_id);
	}
	return clocks_am_pm_toggle_button_type_id__volatile;
}


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;
	}
}


static gint clocks_analog_frame_calculate_diameter (ClocksAnalogFrame* self) {
	gint result = 0;
	gint ret = 0;
	GtkWidget* child = NULL;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	gboolean _tmp2_ = FALSE;
	GtkWidget* _tmp3_;
	g_return_val_if_fail (self != NULL, 0);
	ret = 2 * CLOCKS_ANALOG_FRAME_RADIUS_PAD;
	_tmp0_ = gtk_bin_get_child ((GtkBin*) self);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	child = _tmp1_;
	_tmp3_ = child;
	if (_tmp3_ != NULL) {
		GtkWidget* _tmp4_;
		gboolean _tmp5_;
		gboolean _tmp6_;
		_tmp4_ = child;
		_tmp5_ = gtk_widget_get_visible (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp2_ = _tmp6_;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		gint w = 0;
		gint h = 0;
		GtkWidget* _tmp7_;
		gint _tmp8_ = 0;
		GtkWidget* _tmp9_;
		gint _tmp10_ = 0;
		gint _tmp11_;
		gint _tmp12_;
		gint _tmp13_;
		gint _tmp14_;
		gint _tmp15_;
		gdouble _tmp16_;
		_tmp7_ = child;
		gtk_widget_get_preferred_width (_tmp7_, &_tmp8_, NULL);
		w = _tmp8_;
		_tmp9_ = child;
		gtk_widget_get_preferred_height (_tmp9_, &_tmp10_, NULL);
		h = _tmp10_;
		_tmp11_ = ret;
		_tmp12_ = w;
		_tmp13_ = w;
		_tmp14_ = h;
		_tmp15_ = h;
		_tmp16_ = sqrt ((gdouble) ((_tmp12_ * _tmp13_) + (_tmp14_ * _tmp15_)));
		ret = _tmp11_ + ((gint) _tmp16_);
	}
	result = ret;
	_g_object_unref0 (child);
	return result;
}


static void clocks_analog_frame_real_get_preferred_width (GtkWidget* base, gint* min_w, gint* natural_w) {
	ClocksAnalogFrame * self;
	gint _vala_min_w = 0;
	gint _vala_natural_w = 0;
	gint d = 0;
	gint _tmp0_;
	self = (ClocksAnalogFrame*) base;
	_tmp0_ = clocks_analog_frame_calculate_diameter (self);
	d = _tmp0_;
	_vala_min_w = d;
	_vala_natural_w = d;
	if (min_w) {
		*min_w = _vala_min_w;
	}
	if (natural_w) {
		*natural_w = _vala_natural_w;
	}
}


static void clocks_analog_frame_real_get_preferred_height (GtkWidget* base, gint* min_h, gint* natural_h) {
	ClocksAnalogFrame * self;
	gint _vala_min_h = 0;
	gint _vala_natural_h = 0;
	gint d = 0;
	gint _tmp0_;
	self = (ClocksAnalogFrame*) base;
	_tmp0_ = clocks_analog_frame_calculate_diameter (self);
	d = _tmp0_;
	_vala_min_h = d;
	_vala_natural_h = d;
	if (min_h) {
		*min_h = _vala_min_h;
	}
	if (natural_h) {
		*natural_h = _vala_natural_h;
	}
}


static void clocks_analog_frame_real_size_allocate (GtkWidget* base, GtkAllocation* allocation) {
	ClocksAnalogFrame * self;
	GtkAllocation _tmp0_;
	self = (ClocksAnalogFrame*) base;
	g_return_if_fail (allocation != NULL);
	_tmp0_ = *allocation;
	GTK_WIDGET_CLASS (clocks_analog_frame_parent_class)->size_allocate ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_bin_get_type (), GtkBin), &_tmp0_);
}


static gboolean clocks_analog_frame_real_draw (GtkWidget* base, cairo_t* cr) {
	ClocksAnalogFrame * self;
	gboolean result = FALSE;
	GtkStyleContext* context = NULL;
	GtkStyleContext* _tmp0_;
	GtkStyleContext* _tmp1_;
	GtkAllocation allocation = {0};
	GtkAllocation _tmp2_ = {0};
	gint center_x = 0;
	GtkAllocation _tmp3_;
	gint _tmp4_;
	gint center_y = 0;
	GtkAllocation _tmp5_;
	gint _tmp6_;
	gint radius = 0;
	gint _tmp7_;
	cairo_t* _tmp8_;
	cairo_t* _tmp9_;
	GdkRGBA color = {0};
	GtkStateFlags _tmp10_;
	GdkRGBA _tmp11_ = {0};
	cairo_t* _tmp12_;
	cairo_t* _tmp13_;
	GdkRGBA _tmp14_;
	cairo_t* _tmp15_;
	cairo_t* _tmp16_;
	cairo_t* _tmp17_;
	cairo_t* _tmp18_;
	cairo_t* _tmp19_;
	gboolean _tmp20_;
	self = (ClocksAnalogFrame*) base;
	g_return_val_if_fail (cr != NULL, FALSE);
	_tmp0_ = gtk_widget_get_style_context ((GtkWidget*) self);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	context = _tmp1_;
	gtk_widget_get_allocation ((GtkWidget*) self, &_tmp2_);
	allocation = _tmp2_;
	_tmp3_ = allocation;
	_tmp4_ = _tmp3_.width;
	center_x = _tmp4_ / 2;
	_tmp5_ = allocation;
	_tmp6_ = _tmp5_.height;
	center_y = _tmp6_ / 2;
	_tmp7_ = clocks_analog_frame_calculate_diameter (self);
	radius = _tmp7_ / 2;
	_tmp8_ = cr;
	cairo_save (_tmp8_);
	_tmp9_ = cr;
	cairo_move_to (_tmp9_, (gdouble) (center_x + radius), (gdouble) center_y);
	gtk_style_context_save (context);
	gtk_style_context_add_class (context, "clocks-analog-frame");
	gtk_style_context_save (context);
	gtk_style_context_add_class (context, GTK_STYLE_CLASS_TROUGH);
	_tmp10_ = gtk_style_context_get_state (context);
	gtk_style_context_get_color (context, _tmp10_, &_tmp11_);
	color = _tmp11_;
	_tmp12_ = cr;
	cairo_set_line_width (_tmp12_, (gdouble) CLOCKS_ANALOG_FRAME_LINE_WIDTH);
	_tmp13_ = cr;
	_tmp14_ = color;
	gdk_cairo_set_source_rgba (_tmp13_, &_tmp14_);
	_tmp15_ = cr;
	cairo_arc (_tmp15_, (gdouble) center_x, (gdouble) center_y, (gdouble) (radius - (CLOCKS_ANALOG_FRAME_LINE_WIDTH / 2)), (gdouble) 0, 2 * G_PI);
	_tmp16_ = cr;
	cairo_stroke (_tmp16_);
	gtk_style_context_restore (context);
	_tmp17_ = cr;
	clocks_analog_frame_draw_progress (self, _tmp17_, center_x, center_y, radius);
	gtk_style_context_restore (context);
	_tmp18_ = cr;
	cairo_restore (_tmp18_);
	_tmp19_ = cr;
	_tmp20_ = GTK_WIDGET_CLASS (clocks_analog_frame_parent_class)->draw ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_bin_get_type (), GtkBin), _tmp19_);
	result = _tmp20_;
	_g_object_unref0 (context);
	return result;
}


static void clocks_analog_frame_real_draw_progress (ClocksAnalogFrame* self, cairo_t* cr, gint center_x, gint center_y, gint radius) {
	g_return_if_fail (cr != NULL);
}


void clocks_analog_frame_draw_progress (ClocksAnalogFrame* self, cairo_t* cr, gint center_x, gint center_y, gint radius) {
	g_return_if_fail (self != NULL);
	CLOCKS_ANALOG_FRAME_GET_CLASS (self)->draw_progress (self, cr, center_x, center_y, radius);
}


ClocksAnalogFrame* clocks_analog_frame_construct (GType object_type) {
	ClocksAnalogFrame * self = NULL;
	self = (ClocksAnalogFrame*) g_object_new (object_type, NULL);
	return self;
}


ClocksAnalogFrame* clocks_analog_frame_new (void) {
	return clocks_analog_frame_construct (CLOCKS_TYPE_ANALOG_FRAME);
}


static void clocks_analog_frame_class_init (ClocksAnalogFrameClass * klass) {
	clocks_analog_frame_parent_class = g_type_class_peek_parent (klass);
	((GtkWidgetClass *) klass)->get_preferred_width = (void (*) (GtkWidget *, gint*, gint*)) clocks_analog_frame_real_get_preferred_width;
	((GtkWidgetClass *) klass)->get_preferred_height = (void (*) (GtkWidget *, gint*, gint*)) clocks_analog_frame_real_get_preferred_height;
	((GtkWidgetClass *) klass)->size_allocate = (void (*) (GtkWidget *, GtkAllocation*)) clocks_analog_frame_real_size_allocate;
	((GtkWidgetClass *) klass)->draw = (gboolean (*) (GtkWidget *, cairo_t*)) clocks_analog_frame_real_draw;
	((ClocksAnalogFrameClass *) klass)->draw_progress = (void (*) (ClocksAnalogFrame *, cairo_t*, gint, gint, gint)) clocks_analog_frame_real_draw_progress;
}


static void clocks_analog_frame_instance_init (ClocksAnalogFrame * self) {
}


GType clocks_analog_frame_get_type (void) {
	static volatile gsize clocks_analog_frame_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_analog_frame_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ClocksAnalogFrameClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_analog_frame_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksAnalogFrame), 0, (GInstanceInitFunc) clocks_analog_frame_instance_init, NULL };
		GType clocks_analog_frame_type_id;
		clocks_analog_frame_type_id = g_type_register_static (gtk_bin_get_type (), "ClocksAnalogFrame", &g_define_type_info, 0);
		g_once_init_leave (&clocks_analog_frame_type_id__volatile, clocks_analog_frame_type_id);
	}
	return clocks_analog_frame_type_id__volatile;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



