/* alarm.c generated by valac 0.19.0.3-f335-dirty, the Vala compiler
 * generated from alarm.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 <stdlib.h>
#include <string.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <glib/gi18n-lib.h>
#include <float.h>
#include <math.h>
#include <gtk/gtk.h>
#include <libgd/gd.h>
#include <gio/gio.h>


#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_ALARM_TYPE_ITEM (clocks_alarm_item_get_type ())
#define CLOCKS_ALARM_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem))
#define CLOCKS_ALARM_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItemClass))
#define CLOCKS_ALARM_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_ALARM_TYPE_ITEM))
#define CLOCKS_ALARM_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_ALARM_TYPE_ITEM))
#define CLOCKS_ALARM_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItemClass))

typedef struct _ClocksAlarmItem ClocksAlarmItem;
typedef struct _ClocksAlarmItemClass ClocksAlarmItemClass;
typedef struct _ClocksAlarmItemPrivate ClocksAlarmItemPrivate;

#define CLOCKS_UTILS_TYPE_WEEKDAYS (clocks_utils_weekdays_get_type ())
#define CLOCKS_UTILS_WEEKDAYS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_UTILS_TYPE_WEEKDAYS, ClocksUtilsWeekdays))
#define CLOCKS_UTILS_WEEKDAYS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_UTILS_TYPE_WEEKDAYS, ClocksUtilsWeekdaysClass))
#define CLOCKS_UTILS_IS_WEEKDAYS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_UTILS_TYPE_WEEKDAYS))
#define CLOCKS_UTILS_IS_WEEKDAYS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_UTILS_TYPE_WEEKDAYS))
#define CLOCKS_UTILS_WEEKDAYS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_UTILS_TYPE_WEEKDAYS, ClocksUtilsWeekdaysClass))

typedef struct _ClocksUtilsWeekdays ClocksUtilsWeekdays;
typedef struct _ClocksUtilsWeekdaysClass ClocksUtilsWeekdaysClass;

#define CLOCKS_ALARM_ITEM_TYPE_STATE (clocks_alarm_item_state_get_type ())

#define CLOCKS_UTILS_TYPE_BELL (clocks_utils_bell_get_type ())
#define CLOCKS_UTILS_BELL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_UTILS_TYPE_BELL, ClocksUtilsBell))
#define CLOCKS_UTILS_BELL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_UTILS_TYPE_BELL, ClocksUtilsBellClass))
#define CLOCKS_UTILS_IS_BELL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_UTILS_TYPE_BELL))
#define CLOCKS_UTILS_IS_BELL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_UTILS_TYPE_BELL))
#define CLOCKS_UTILS_BELL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_UTILS_TYPE_BELL, ClocksUtilsBellClass))

typedef struct _ClocksUtilsBell ClocksUtilsBell;
typedef struct _ClocksUtilsBellClass ClocksUtilsBellClass;
#define _clocks_utils_weekdays_unref0(var) ((var == NULL) ? NULL : (var = (clocks_utils_weekdays_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define CLOCKS_UTILS_TYPE_WALL_CLOCK (clocks_utils_wall_clock_get_type ())
#define CLOCKS_UTILS_WALL_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_UTILS_TYPE_WALL_CLOCK, ClocksUtilsWallClock))
#define CLOCKS_UTILS_WALL_CLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_UTILS_TYPE_WALL_CLOCK, ClocksUtilsWallClockClass))
#define CLOCKS_UTILS_IS_WALL_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_UTILS_TYPE_WALL_CLOCK))
#define CLOCKS_UTILS_IS_WALL_CLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_UTILS_TYPE_WALL_CLOCK))
#define CLOCKS_UTILS_WALL_CLOCK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_UTILS_TYPE_WALL_CLOCK, ClocksUtilsWallClockClass))

typedef struct _ClocksUtilsWallClock ClocksUtilsWallClock;
typedef struct _ClocksUtilsWallClockClass ClocksUtilsWallClockClass;

#define CLOCKS_UTILS_WEEKDAYS_TYPE_DAY (clocks_utils_weekdays_day_get_type ())
#define _g_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (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)))

#define CLOCKS_ALARM_TYPE_SETUP_DIALOG (clocks_alarm_setup_dialog_get_type ())
#define CLOCKS_ALARM_SETUP_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_ALARM_TYPE_SETUP_DIALOG, ClocksAlarmSetupDialog))
#define CLOCKS_ALARM_SETUP_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_ALARM_TYPE_SETUP_DIALOG, ClocksAlarmSetupDialogClass))
#define CLOCKS_ALARM_IS_SETUP_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_ALARM_TYPE_SETUP_DIALOG))
#define CLOCKS_ALARM_IS_SETUP_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_ALARM_TYPE_SETUP_DIALOG))
#define CLOCKS_ALARM_SETUP_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_ALARM_TYPE_SETUP_DIALOG, ClocksAlarmSetupDialogClass))

typedef struct _ClocksAlarmSetupDialog ClocksAlarmSetupDialog;
typedef struct _ClocksAlarmSetupDialogClass ClocksAlarmSetupDialogClass;
typedef struct _ClocksAlarmSetupDialogPrivate ClocksAlarmSetupDialogPrivate;

#define CLOCKS_UTILS_WALL_CLOCK_TYPE_FORMAT (clocks_utils_wall_clock_format_get_type ())

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

#define CLOCKS_AM_PM_TOGGLE_BUTTON_TYPE_AM_PM (clocks_am_pm_toggle_button_am_pm_get_type ())

#define CLOCKS_ALARM_TYPE_RINGING_PANEL (clocks_alarm_ringing_panel_get_type ())
#define CLOCKS_ALARM_RINGING_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_ALARM_TYPE_RINGING_PANEL, ClocksAlarmRingingPanel))
#define CLOCKS_ALARM_RINGING_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_ALARM_TYPE_RINGING_PANEL, ClocksAlarmRingingPanelClass))
#define CLOCKS_ALARM_IS_RINGING_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_ALARM_TYPE_RINGING_PANEL))
#define CLOCKS_ALARM_IS_RINGING_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_ALARM_TYPE_RINGING_PANEL))
#define CLOCKS_ALARM_RINGING_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_ALARM_TYPE_RINGING_PANEL, ClocksAlarmRingingPanelClass))

typedef struct _ClocksAlarmRingingPanel ClocksAlarmRingingPanel;
typedef struct _ClocksAlarmRingingPanelClass ClocksAlarmRingingPanelClass;
typedef struct _ClocksAlarmRingingPanelPrivate ClocksAlarmRingingPanelPrivate;

#define CLOCKS_TYPE_CLOCK (clocks_clock_get_type ())
#define CLOCKS_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TYPE_CLOCK, ClocksClock))
#define CLOCKS_IS_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TYPE_CLOCK))
#define CLOCKS_CLOCK_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLOCKS_TYPE_CLOCK, ClocksClockIface))

typedef struct _ClocksClock ClocksClock;
typedef struct _ClocksClockIface ClocksClockIface;

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

#define CLOCKS_ALARM_TYPE_MAIN_PANEL (clocks_alarm_main_panel_get_type ())
#define CLOCKS_ALARM_MAIN_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_ALARM_TYPE_MAIN_PANEL, ClocksAlarmMainPanel))
#define CLOCKS_ALARM_MAIN_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_ALARM_TYPE_MAIN_PANEL, ClocksAlarmMainPanelClass))
#define CLOCKS_ALARM_IS_MAIN_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_ALARM_TYPE_MAIN_PANEL))
#define CLOCKS_ALARM_IS_MAIN_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_ALARM_TYPE_MAIN_PANEL))
#define CLOCKS_ALARM_MAIN_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_ALARM_TYPE_MAIN_PANEL, ClocksAlarmMainPanelClass))

typedef struct _ClocksAlarmMainPanel ClocksAlarmMainPanel;
typedef struct _ClocksAlarmMainPanelClass ClocksAlarmMainPanelClass;
typedef struct _ClocksAlarmMainPanelPrivate ClocksAlarmMainPanelPrivate;

#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;
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
typedef struct _Block3Data Block3Data;

#define CLOCKS_HEADER_BAR_TYPE_MODE (clocks_header_bar_mode_get_type ())
#define _g_variant_builder_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_builder_unref (var), NULL)))
typedef struct _Block4Data Block4Data;

struct _ClocksContentItemIface {
	GTypeInterface parent_iface;
	void (*get_thumb_properties) (ClocksContentItem* self, gchar** text, gchar** subtext, GdkPixbuf** pixbuf, gchar** css_class);
	const gchar* (*get_name) (ClocksContentItem* self);
	void (*set_name) (ClocksContentItem* self, const gchar* value);
};

struct _ClocksAlarmItem {
	GObject parent_instance;
	ClocksAlarmItemPrivate * priv;
};

struct _ClocksAlarmItemClass {
	GObjectClass parent_class;
	void (*ring) (ClocksAlarmItem* self);
};

typedef enum  {
	CLOCKS_ALARM_ITEM_STATE_READY,
	CLOCKS_ALARM_ITEM_STATE_RINGING,
	CLOCKS_ALARM_ITEM_STATE_SNOOZING
} ClocksAlarmItemState;

struct _ClocksAlarmItemPrivate {
	gint _hour;
	gint _minute;
	ClocksUtilsWeekdays* _days;
	ClocksAlarmItemState _state;
	gchar* _name;
	gboolean _active;
	GDateTime* alarm_time;
	GDateTime* snooze_time;
	GDateTime* ring_end_time;
	ClocksUtilsBell* bell;
};

typedef void (*ClocksUtilsBellActionCallback) (void* user_data);
typedef enum  {
	CLOCKS_UTILS_WEEKDAYS_DAY_MON,
	CLOCKS_UTILS_WEEKDAYS_DAY_TUE,
	CLOCKS_UTILS_WEEKDAYS_DAY_WED,
	CLOCKS_UTILS_WEEKDAYS_DAY_THU,
	CLOCKS_UTILS_WEEKDAYS_DAY_FRI,
	CLOCKS_UTILS_WEEKDAYS_DAY_SAT,
	CLOCKS_UTILS_WEEKDAYS_DAY_SUN
} ClocksUtilsWeekdaysDay;

struct _ClocksAlarmSetupDialog {
	GtkDialog parent_instance;
	ClocksAlarmSetupDialogPrivate * priv;
};

struct _ClocksAlarmSetupDialogClass {
	GtkDialogClass parent_class;
};

typedef enum  {
	CLOCKS_UTILS_WALL_CLOCK_FORMAT_TWELVE,
	CLOCKS_UTILS_WALL_CLOCK_FORMAT_TWENTYFOUR
} ClocksUtilsWallClockFormat;

struct _ClocksAlarmSetupDialogPrivate {
	ClocksUtilsWallClockFormat format;
	GtkSpinButton* h_spinbutton;
	GtkSpinButton* m_spinbutton;
	GtkEntry* name_entry;
	ClocksAmPmToggleButton* am_pm_button;
	GtkToggleButton** day_buttons;
	gint day_buttons_length1;
	gint _day_buttons_size_;
	GtkSwitch* active_switch;
};

typedef enum  {
	CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_AM,
	CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_PM
} ClocksAmPmToggleButtonAmPm;

struct _ClocksAlarmRingingPanel {
	GtkEventBox parent_instance;
	ClocksAlarmRingingPanelPrivate * priv;
};

struct _ClocksAlarmRingingPanelClass {
	GtkEventBoxClass parent_class;
	void (*dismiss) (ClocksAlarmRingingPanel* self);
};

struct _ClocksAlarmRingingPanelPrivate {
	ClocksAlarmItem* _alarm;
	gulong alarm_state_handler;
	GtkLabel* time_label;
	GtkButton* stop_button;
	GtkButton* snooze_button;
};

struct _ClocksClockIface {
	GTypeInterface parent_iface;
	void (*activate_new) (ClocksClock* self);
	void (*activate_select_all) (ClocksClock* self);
	void (*activate_select_none) (ClocksClock* self);
	gboolean (*escape_pressed) (ClocksClock* self);
	void (*update_header_bar) (ClocksClock* self);
	const gchar* (*get_label) (ClocksClock* self);
	void (*set_label) (ClocksClock* self, const gchar* value);
	ClocksHeaderBar* (*get_header_bar) (ClocksClock* self);
	void (*set_header_bar) (ClocksClock* self, ClocksHeaderBar* value);
};

struct _ClocksAlarmMainPanel {
	GdStack parent_instance;
	ClocksAlarmMainPanelPrivate * priv;
};

struct _ClocksAlarmMainPanelClass {
	GdStackClass parent_class;
};

struct _ClocksAlarmMainPanelPrivate {
	gchar* _label;
	ClocksHeaderBar* _header_bar;
	GList* alarms;
	GSettings* settings;
	GdHeaderSimpleButton* new_button;
	ClocksContentView* content_view;
	ClocksAlarmRingingPanel* ringing_panel;
};

struct _Block3Data {
	int _ref_count_;
	ClocksAlarmMainPanel * self;
	ClocksHeaderBar* header_bar;
};

typedef enum  {
	CLOCKS_HEADER_BAR_MODE_NORMAL,
	CLOCKS_HEADER_BAR_MODE_SELECTION,
	CLOCKS_HEADER_BAR_MODE_STANDALONE
} ClocksHeaderBarMode;

struct _Block4Data {
	int _ref_count_;
	ClocksAlarmMainPanel * self;
	gboolean saved_active;
	ClocksAlarmItem* alarm;
};


static gpointer clocks_alarm_item_parent_class = NULL;
static ClocksContentItemIface* clocks_alarm_item_clocks_content_item_parent_iface = NULL;
static gpointer clocks_alarm_setup_dialog_parent_class = NULL;
static gpointer clocks_alarm_ringing_panel_parent_class = NULL;
static gpointer clocks_alarm_main_panel_parent_class = NULL;
static ClocksClockIface* clocks_alarm_main_panel_clocks_clock_parent_iface = NULL;

GType clocks_content_item_get_type (void) G_GNUC_CONST;
GType clocks_alarm_item_get_type (void) G_GNUC_CONST;
gpointer clocks_utils_weekdays_ref (gpointer instance);
void clocks_utils_weekdays_unref (gpointer instance);
GParamSpec* clocks_utils_param_spec_weekdays (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void clocks_utils_value_set_weekdays (GValue* value, gpointer v_object);
void clocks_utils_value_take_weekdays (GValue* value, gpointer v_object);
gpointer clocks_utils_value_get_weekdays (const GValue* value);
GType clocks_utils_weekdays_get_type (void) G_GNUC_CONST;
GType clocks_alarm_item_state_get_type (void) G_GNUC_CONST;
GType clocks_utils_bell_get_type (void) G_GNUC_CONST;
#define CLOCKS_ALARM_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItemPrivate))
enum  {
	CLOCKS_ALARM_ITEM_DUMMY_PROPERTY,
	CLOCKS_ALARM_ITEM_NAME,
	CLOCKS_ALARM_ITEM_HOUR,
	CLOCKS_ALARM_ITEM_MINUTE,
	CLOCKS_ALARM_ITEM_DAYS,
	CLOCKS_ALARM_ITEM_REPEAT_LABEL,
	CLOCKS_ALARM_ITEM_STATE,
	CLOCKS_ALARM_ITEM_TIME_LABEL,
	CLOCKS_ALARM_ITEM_SNOOZE_TIME_LABEL,
	CLOCKS_ALARM_ITEM_ACTIVE
};
#define CLOCKS_ALARM_ITEM_SNOOZE_MINUTES 9
#define CLOCKS_ALARM_ITEM_RING_MINUTES 3
ClocksAlarmItem* clocks_alarm_item_new (void);
ClocksAlarmItem* clocks_alarm_item_construct (GType object_type);
ClocksUtilsWeekdays* clocks_utils_weekdays_new (void);
ClocksUtilsWeekdays* clocks_utils_weekdays_construct (GType object_type);
void clocks_alarm_item_set_days (ClocksAlarmItem* self, ClocksUtilsWeekdays* value);
ClocksAlarmItem* clocks_alarm_item_new_with_data (const gchar* name, gboolean active, gint hour, gint minute, ClocksUtilsWeekdays* days);
ClocksAlarmItem* clocks_alarm_item_construct_with_data (GType object_type, const gchar* name, gboolean active, gint hour, gint minute, ClocksUtilsWeekdays* days);
static void clocks_alarm_item_setup_bell (ClocksAlarmItem* self);
void clocks_alarm_item_reset (ClocksAlarmItem* self);
const gchar* clocks_content_item_get_name (ClocksContentItem* self);
ClocksUtilsBell* clocks_utils_bell_new (const gchar* soundid, const gchar* title, const gchar* msg);
ClocksUtilsBell* clocks_utils_bell_construct (GType object_type, const gchar* soundid, const gchar* title, const gchar* msg);
void clocks_utils_bell_add_action (ClocksUtilsBell* self, const gchar* action, const gchar* label, ClocksUtilsBellActionCallback callback, void* callback_target, GDestroyNotify callback_target_destroy_notify);
static void __lambda31_ (ClocksAlarmItem* self);
void clocks_alarm_item_stop (ClocksAlarmItem* self);
static void ___lambda31__clocks_utils_bell_action_callback (gpointer self);
static void __lambda32_ (ClocksAlarmItem* self);
void clocks_alarm_item_snooze (ClocksAlarmItem* self);
static void ___lambda32__clocks_utils_bell_action_callback (gpointer self);
static void clocks_alarm_item_update_alarm_time (ClocksAlarmItem* self);
static void clocks_alarm_item_update_snooze_time (ClocksAlarmItem* self, GDateTime* start_time);
static void clocks_alarm_item_set_state (ClocksAlarmItem* self, ClocksAlarmItemState value);
GType clocks_utils_wall_clock_get_type (void) G_GNUC_CONST;
ClocksUtilsWallClock* clocks_utils_wall_clock_get_default (void);
GDateTime* clocks_utils_wall_clock_get_date_time (ClocksUtilsWallClock* self);
GTimeZone* clocks_utils_wall_clock_get_timezone (ClocksUtilsWallClock* self);
gint clocks_alarm_item_get_hour (ClocksAlarmItem* self);
gint clocks_alarm_item_get_minute (ClocksAlarmItem* self);
ClocksUtilsWeekdays* clocks_alarm_item_get_days (ClocksAlarmItem* self);
gboolean clocks_utils_weekdays_get_empty (ClocksUtilsWeekdays* self);
GType clocks_utils_weekdays_day_get_type (void) G_GNUC_CONST;
gboolean clocks_utils_weekdays_get (ClocksUtilsWeekdays* self, ClocksUtilsWeekdaysDay d);
static void clocks_alarm_item_start_ringing (ClocksAlarmItem* self, GDateTime* now);
void clocks_utils_bell_stop (ClocksUtilsBell* self);
gboolean clocks_alarm_item_tick (ClocksAlarmItem* self);
gboolean clocks_alarm_item_get_active (ClocksAlarmItem* self);
ClocksAlarmItemState clocks_alarm_item_get_state (ClocksAlarmItem* self);
static void clocks_alarm_item_real_get_thumb_properties (ClocksContentItem* base, gchar** text, gchar** subtext, GdkPixbuf** pixbuf, gchar** css_class);
gchar* clocks_alarm_item_get_snooze_time_label (ClocksAlarmItem* self);
gchar* clocks_alarm_item_get_time_label (ClocksAlarmItem* self);
gchar* clocks_alarm_item_get_repeat_label (ClocksAlarmItem* self);
void clocks_alarm_item_serialize (ClocksAlarmItem* self, GVariantBuilder* builder);
GVariant* clocks_utils_weekdays_serialize (ClocksUtilsWeekdays* self);
ClocksAlarmItem* clocks_alarm_item_deserialize (GVariant* alarm_variant);
ClocksUtilsWeekdays* clocks_utils_weekdays_deserialize (GVariant* days_variant);
void clocks_alarm_item_set_hour (ClocksAlarmItem* self, gint value);
void clocks_alarm_item_set_minute (ClocksAlarmItem* self, gint value);
gchar* clocks_utils_weekdays_get_label (ClocksUtilsWeekdays* self);
gchar* clocks_utils_wall_clock_format_time (ClocksUtilsWallClock* self, GDateTime* date_time);
void clocks_alarm_item_set_active (ClocksAlarmItem* self, gboolean value);
static void clocks_alarm_item_real_ring (ClocksAlarmItem* self);
void clocks_utils_bell_ring (ClocksUtilsBell* self);
static void clocks_alarm_item_finalize (GObject* obj);
static void _vala_clocks_alarm_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
void clocks_content_item_set_name (ClocksContentItem* self, const gchar* value);
static void _vala_clocks_alarm_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType clocks_alarm_setup_dialog_get_type (void) G_GNUC_CONST;
GType clocks_utils_wall_clock_format_get_type (void) G_GNUC_CONST;
GType clocks_am_pm_toggle_button_get_type (void) G_GNUC_CONST;
#define CLOCKS_ALARM_SETUP_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLOCKS_ALARM_TYPE_SETUP_DIALOG, ClocksAlarmSetupDialogPrivate))
enum  {
	CLOCKS_ALARM_SETUP_DIALOG_DUMMY_PROPERTY
};
ClocksAlarmSetupDialog* clocks_alarm_setup_dialog_new (GtkWindow* parent, ClocksAlarmItem* alarm);
ClocksAlarmSetupDialog* clocks_alarm_setup_dialog_construct (GType object_type, GtkWindow* parent, ClocksAlarmItem* alarm);
ClocksUtilsWallClockFormat clocks_utils_wall_clock_get_format (ClocksUtilsWallClock* self);
ClocksAmPmToggleButton* clocks_am_pm_toggle_button_new (void);
ClocksAmPmToggleButton* clocks_am_pm_toggle_button_construct (GType object_type);
GtkBuilder* clocks_utils_load_ui (const gchar* ui);
static gboolean clocks_alarm_setup_dialog_show_leading_zeros (ClocksAlarmSetupDialog* self, GtkSpinButton* spin_button);
static gboolean _clocks_alarm_setup_dialog_show_leading_zeros_gtk_spin_button_output (GtkSpinButton* _sender, gpointer self);
gchar* clocks_utils_weekdays_abbreviation (ClocksUtilsWeekdaysDay d);
ClocksUtilsWeekdaysDay clocks_utils_weekdays_get_first_weekday (void);
void clocks_alarm_setup_dialog_set_from_alarm (ClocksAlarmSetupDialog* self, ClocksAlarmItem* alarm);
GType clocks_am_pm_toggle_button_am_pm_get_type (void) G_GNUC_CONST;
void clocks_am_pm_toggle_button_set_choice (ClocksAmPmToggleButton* self, ClocksAmPmToggleButtonAmPm value);
void clocks_alarm_setup_dialog_apply_to_alarm (ClocksAlarmSetupDialog* self, ClocksAlarmItem* alarm);
ClocksAmPmToggleButtonAmPm clocks_am_pm_toggle_button_get_choice (ClocksAmPmToggleButton* self);
void clocks_utils_weekdays_set (ClocksUtilsWeekdays* self, ClocksUtilsWeekdaysDay d, gboolean on);
static void clocks_alarm_setup_dialog_finalize (GObject* obj);
GType clocks_alarm_ringing_panel_get_type (void) G_GNUC_CONST;
#define CLOCKS_ALARM_RINGING_PANEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLOCKS_ALARM_TYPE_RINGING_PANEL, ClocksAlarmRingingPanelPrivate))
enum  {
	CLOCKS_ALARM_RINGING_PANEL_DUMMY_PROPERTY,
	CLOCKS_ALARM_RINGING_PANEL_ALARM
};
ClocksAlarmRingingPanel* clocks_alarm_ringing_panel_new (void);
ClocksAlarmRingingPanel* clocks_alarm_ringing_panel_construct (GType object_type);
static void __lambda33_ (ClocksAlarmRingingPanel* self);
ClocksAlarmItem* clocks_alarm_ringing_panel_get_alarm (ClocksAlarmRingingPanel* self);
static void ___lambda33__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda35_ (ClocksAlarmRingingPanel* self);
static void ___lambda35__gtk_button_clicked (GtkButton* _sender, gpointer self);
void clocks_alarm_ringing_panel_update (ClocksAlarmRingingPanel* self);
void clocks_alarm_ringing_panel_set_alarm (ClocksAlarmRingingPanel* self, ClocksAlarmItem* value);
static void _clocks_alarm_ringing_panel_alarm____lambda34_ (ClocksAlarmRingingPanel* self);
static void __clocks_alarm_ringing_panel_alarm____lambda34__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void clocks_alarm_ringing_panel_real_dismiss (ClocksAlarmRingingPanel* self);
static void clocks_alarm_ringing_panel_finalize (GObject* obj);
static void _vala_clocks_alarm_ringing_panel_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_clocks_alarm_ringing_panel_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType clocks_header_bar_get_type (void) G_GNUC_CONST;
GType clocks_clock_get_type (void) G_GNUC_CONST;
GType clocks_alarm_main_panel_get_type (void) G_GNUC_CONST;
GType clocks_content_view_get_type (void) G_GNUC_CONST;
#define CLOCKS_ALARM_MAIN_PANEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLOCKS_ALARM_TYPE_MAIN_PANEL, ClocksAlarmMainPanelPrivate))
enum  {
	CLOCKS_ALARM_MAIN_PANEL_DUMMY_PROPERTY,
	CLOCKS_ALARM_MAIN_PANEL_LABEL,
	CLOCKS_ALARM_MAIN_PANEL_HEADER_BAR
};
static void _g_object_unref0_ (gpointer var);
static void _g_list_free__g_object_unref0_ (GList* self);
ClocksAlarmMainPanel* clocks_alarm_main_panel_new (ClocksHeaderBar* header_bar);
ClocksAlarmMainPanel* clocks_alarm_main_panel_construct (GType object_type, ClocksHeaderBar* header_bar);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
ClocksContentView* clocks_content_view_new (GtkWidget* e, ClocksHeaderBar* b);
ClocksContentView* clocks_content_view_construct (GType object_type, GtkWidget* e, ClocksHeaderBar* b);
static void __lambda36_ (ClocksAlarmMainPanel* self, GObject* item);
static void clocks_alarm_main_panel_show_ringing_panel (ClocksAlarmMainPanel* self, ClocksAlarmItem* alarm);
static void clocks_alarm_main_panel_edit (ClocksAlarmMainPanel* self, ClocksAlarmItem* alarm);
static void ___lambda36__clocks_content_view_item_activated (ClocksContentView* _sender, GObject* item, gpointer self);
static void __lambda39_ (ClocksAlarmMainPanel* self);
GList* clocks_content_view_get_selected_items (ClocksContentView* self);
static void clocks_alarm_main_panel_save (ClocksAlarmMainPanel* self);
static void ___lambda39__clocks_content_view_delete_selected (ClocksContentView* _sender, gpointer self);
static void __lambda40_ (ClocksAlarmMainPanel* self);
static void ___lambda40__clocks_alarm_ringing_panel_dismiss (ClocksAlarmRingingPanel* _sender, gpointer self);
static void clocks_alarm_main_panel_load (ClocksAlarmMainPanel* self);
static void __lambda41_ (Block3Data* _data3_);
GType clocks_header_bar_mode_get_type (void) G_GNUC_CONST;
void clocks_header_bar_set_mode (ClocksHeaderBar* self, ClocksHeaderBarMode value);
static void ___lambda41__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void __lambda42_ (ClocksAlarmMainPanel* self);
static void ___lambda42__clocks_utils_wall_clock_tick (ClocksUtilsWallClock* _sender, gpointer self);
void clocks_content_view_add_item (ClocksContentView* self, ClocksContentItem* item);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (void * _userdata_);
static void __lambda38_ (Block4Data* _data4_, GtkDialog* dialog, gint response);
static void ___lambda38__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
static void clocks_alarm_main_panel_real_activate_new (ClocksClock* base);
static void __lambda43_ (ClocksAlarmMainPanel* self, GtkDialog* dialog, gint response);
static void ___lambda43__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
static void clocks_alarm_main_panel_real_activate_select_all (ClocksClock* base);
void clocks_content_view_select_all (ClocksContentView* self);
static void clocks_alarm_main_panel_real_activate_select_none (ClocksClock* base);
void clocks_content_view_unselect_all (ClocksContentView* self);
static gboolean clocks_alarm_main_panel_real_escape_pressed (ClocksClock* base);
gboolean clocks_content_view_escape_pressed (ClocksContentView* self);
static void clocks_alarm_main_panel_real_update_header_bar (ClocksClock* base);
ClocksHeaderBar* clocks_clock_get_header_bar (ClocksClock* self);
ClocksHeaderBarMode clocks_header_bar_get_mode (ClocksHeaderBar* self);
void clocks_content_view_update_header_bar (ClocksContentView* self);
static void clocks_alarm_main_panel_finalize (GObject* obj);
const gchar* clocks_clock_get_label (ClocksClock* self);
static void _vala_clocks_alarm_main_panel_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
void clocks_clock_set_label (ClocksClock* self, const gchar* value);
void clocks_clock_set_header_bar (ClocksClock* self, ClocksHeaderBar* value);
static void _vala_clocks_alarm_main_panel_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
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_alarm_item_state_get_type (void) {
	static volatile gsize clocks_alarm_item_state_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_alarm_item_state_type_id__volatile)) {
		static const GEnumValue values[] = {{CLOCKS_ALARM_ITEM_STATE_READY, "CLOCKS_ALARM_ITEM_STATE_READY", "ready"}, {CLOCKS_ALARM_ITEM_STATE_RINGING, "CLOCKS_ALARM_ITEM_STATE_RINGING", "ringing"}, {CLOCKS_ALARM_ITEM_STATE_SNOOZING, "CLOCKS_ALARM_ITEM_STATE_SNOOZING", "snoozing"}, {0, NULL, NULL}};
		GType clocks_alarm_item_state_type_id;
		clocks_alarm_item_state_type_id = g_enum_register_static ("ClocksAlarmItemState", values);
		g_once_init_leave (&clocks_alarm_item_state_type_id__volatile, clocks_alarm_item_state_type_id);
	}
	return clocks_alarm_item_state_type_id__volatile;
}


ClocksAlarmItem* clocks_alarm_item_construct (GType object_type) {
	ClocksAlarmItem * self = NULL;
	ClocksUtilsWeekdays* _tmp0_;
	ClocksUtilsWeekdays* _tmp1_;
	self = (ClocksAlarmItem*) g_object_new (object_type, NULL);
	_tmp0_ = clocks_utils_weekdays_new ();
	_tmp1_ = _tmp0_;
	clocks_alarm_item_set_days (self, _tmp1_);
	_clocks_utils_weekdays_unref0 (_tmp1_);
	return self;
}


ClocksAlarmItem* clocks_alarm_item_new (void) {
	return clocks_alarm_item_construct (CLOCKS_ALARM_TYPE_ITEM);
}


ClocksAlarmItem* clocks_alarm_item_construct_with_data (GType object_type, const gchar* name, gboolean active, gint hour, gint minute, ClocksUtilsWeekdays* days) {
	ClocksAlarmItem * self = NULL;
	const gchar* _tmp0_;
	gboolean _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	ClocksUtilsWeekdays* _tmp4_;
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (days != NULL, NULL);
	_tmp0_ = name;
	_tmp1_ = active;
	_tmp2_ = hour;
	_tmp3_ = minute;
	_tmp4_ = days;
	self = (ClocksAlarmItem*) g_object_new (object_type, "name", _tmp0_, "active", _tmp1_, "hour", _tmp2_, "minute", _tmp3_, "days", _tmp4_, NULL);
	clocks_alarm_item_setup_bell (self);
	clocks_alarm_item_reset (self);
	return self;
}


ClocksAlarmItem* clocks_alarm_item_new_with_data (const gchar* name, gboolean active, gint hour, gint minute, ClocksUtilsWeekdays* days) {
	return clocks_alarm_item_construct_with_data (CLOCKS_ALARM_TYPE_ITEM, name, active, hour, minute, days);
}


static void __lambda31_ (ClocksAlarmItem* self) {
	clocks_alarm_item_stop (self);
}


static void ___lambda31__clocks_utils_bell_action_callback (gpointer self) {
	__lambda31_ (self);
}


static void __lambda32_ (ClocksAlarmItem* self) {
	clocks_alarm_item_snooze (self);
}


static void ___lambda32__clocks_utils_bell_action_callback (gpointer self) {
	__lambda32_ (self);
}


static void clocks_alarm_item_setup_bell (ClocksAlarmItem* self) {
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	ClocksUtilsBell* _tmp3_;
	ClocksUtilsBell* _tmp4_;
	const gchar* _tmp5_ = NULL;
	ClocksUtilsBell* _tmp6_;
	const gchar* _tmp7_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = _ ("Alarm");
	_tmp1_ = clocks_content_item_get_name ((ClocksContentItem*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = clocks_utils_bell_new ("alarm-clock-elapsed", _tmp0_, _tmp2_);
	_g_object_unref0 (self->priv->bell);
	self->priv->bell = _tmp3_;
	_tmp4_ = self->priv->bell;
	_tmp5_ = _ ("Stop");
	clocks_utils_bell_add_action (_tmp4_, "stop", _tmp5_, ___lambda31__clocks_utils_bell_action_callback, g_object_ref (self), g_object_unref);
	_tmp6_ = self->priv->bell;
	_tmp7_ = _ ("Snooze");
	clocks_utils_bell_add_action (_tmp6_, "snooze", _tmp7_, ___lambda32__clocks_utils_bell_action_callback, g_object_ref (self), g_object_unref);
}


void clocks_alarm_item_reset (ClocksAlarmItem* self) {
	GDateTime* _tmp0_;
	g_return_if_fail (self != NULL);
	clocks_alarm_item_update_alarm_time (self);
	_tmp0_ = self->priv->alarm_time;
	clocks_alarm_item_update_snooze_time (self, _tmp0_);
	clocks_alarm_item_set_state (self, CLOCKS_ALARM_ITEM_STATE_READY);
}


static gpointer _g_date_time_ref0 (gpointer self) {
	return self ? g_date_time_ref (self) : NULL;
}


static void clocks_alarm_item_update_alarm_time (ClocksAlarmItem* self) {
	ClocksUtilsWallClock* _tmp0_ = NULL;
	ClocksUtilsWallClock* wallclock;
	ClocksUtilsWallClock* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	GDateTime* _tmp4_;
	GDateTime* now;
	ClocksUtilsWallClock* _tmp5_;
	GTimeZone* _tmp6_;
	GTimeZone* _tmp7_;
	GDateTime* _tmp8_;
	gint _tmp9_ = 0;
	GDateTime* _tmp10_;
	gint _tmp11_ = 0;
	GDateTime* _tmp12_;
	gint _tmp13_ = 0;
	gint _tmp14_;
	gint _tmp15_;
	GDateTime* _tmp16_;
	GDateTime* dt;
	ClocksUtilsWeekdays* _tmp17_;
	gboolean _tmp18_;
	gboolean _tmp19_;
	GDateTime* _tmp36_;
	GDateTime* _tmp37_;
	g_return_if_fail (self != NULL);
	_tmp0_ = clocks_utils_wall_clock_get_default ();
	wallclock = _tmp0_;
	_tmp1_ = wallclock;
	_tmp2_ = clocks_utils_wall_clock_get_date_time (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _g_date_time_ref0 (_tmp3_);
	now = _tmp4_;
	_tmp5_ = wallclock;
	_tmp6_ = clocks_utils_wall_clock_get_timezone (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = now;
	_tmp9_ = g_date_time_get_year (_tmp8_);
	_tmp10_ = now;
	_tmp11_ = g_date_time_get_month (_tmp10_);
	_tmp12_ = now;
	_tmp13_ = g_date_time_get_day_of_month (_tmp12_);
	_tmp14_ = self->priv->_hour;
	_tmp15_ = self->priv->_minute;
	_tmp16_ = g_date_time_new (_tmp7_, _tmp9_, _tmp11_, _tmp13_, _tmp14_, _tmp15_, (gdouble) 0);
	dt = _tmp16_;
	_tmp17_ = self->priv->_days;
	_tmp18_ = clocks_utils_weekdays_get_empty (_tmp17_);
	_tmp19_ = _tmp18_;
	if (_tmp19_) {
		GDateTime* _tmp20_;
		GDateTime* _tmp21_;
		gint _tmp22_ = 0;
		_tmp20_ = dt;
		_tmp21_ = now;
		_tmp22_ = g_date_time_compare (_tmp20_, _tmp21_);
		if (_tmp22_ <= 0) {
			GDateTime* _tmp23_;
			GDateTime* _tmp24_ = NULL;
			_tmp23_ = dt;
			_tmp24_ = g_date_time_add_days (_tmp23_, 1);
			_g_date_time_unref0 (dt);
			dt = _tmp24_;
		}
	} else {
		while (TRUE) {
			gboolean _tmp25_ = FALSE;
			GDateTime* _tmp26_;
			GDateTime* _tmp27_;
			gint _tmp28_ = 0;
			gboolean _tmp33_;
			GDateTime* _tmp34_;
			GDateTime* _tmp35_ = NULL;
			_tmp26_ = dt;
			_tmp27_ = now;
			_tmp28_ = g_date_time_compare (_tmp26_, _tmp27_);
			if (_tmp28_ <= 0) {
				_tmp25_ = TRUE;
			} else {
				ClocksUtilsWeekdays* _tmp29_;
				GDateTime* _tmp30_;
				gint _tmp31_ = 0;
				gboolean _tmp32_ = FALSE;
				_tmp29_ = self->priv->_days;
				_tmp30_ = dt;
				_tmp31_ = g_date_time_get_day_of_week (_tmp30_);
				_tmp32_ = clocks_utils_weekdays_get (_tmp29_, (ClocksUtilsWeekdaysDay) (_tmp31_ - 1));
				_tmp25_ = !_tmp32_;
			}
			_tmp33_ = _tmp25_;
			if (!_tmp33_) {
				break;
			}
			_tmp34_ = dt;
			_tmp35_ = g_date_time_add_days (_tmp34_, 1);
			_g_date_time_unref0 (dt);
			dt = _tmp35_;
		}
	}
	_tmp36_ = dt;
	_tmp37_ = _g_date_time_ref0 (_tmp36_);
	_g_date_time_unref0 (self->priv->alarm_time);
	self->priv->alarm_time = _tmp37_;
	_g_date_time_unref0 (dt);
	_g_date_time_unref0 (now);
	_g_object_unref0 (wallclock);
}


static void clocks_alarm_item_update_snooze_time (ClocksAlarmItem* self, GDateTime* start_time) {
	GDateTime* _tmp0_;
	GDateTime* _tmp1_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (start_time != NULL);
	_tmp0_ = start_time;
	_tmp1_ = g_date_time_add_minutes (_tmp0_, CLOCKS_ALARM_ITEM_SNOOZE_MINUTES);
	_g_date_time_unref0 (self->priv->snooze_time);
	self->priv->snooze_time = _tmp1_;
}


static void clocks_alarm_item_start_ringing (ClocksAlarmItem* self, GDateTime* now) {
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (now != NULL);
	_tmp0_ = now;
	clocks_alarm_item_update_snooze_time (self, _tmp0_);
	_tmp1_ = now;
	_tmp2_ = g_date_time_add_minutes (_tmp1_, CLOCKS_ALARM_ITEM_RING_MINUTES);
	_g_date_time_unref0 (self->priv->ring_end_time);
	self->priv->ring_end_time = _tmp2_;
	clocks_alarm_item_set_state (self, CLOCKS_ALARM_ITEM_STATE_RINGING);
	g_signal_emit_by_name (self, "ring");
}


void clocks_alarm_item_snooze (ClocksAlarmItem* self) {
	ClocksUtilsBell* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->bell;
	clocks_utils_bell_stop (_tmp0_);
	clocks_alarm_item_set_state (self, CLOCKS_ALARM_ITEM_STATE_SNOOZING);
}


void clocks_alarm_item_stop (ClocksAlarmItem* self) {
	ClocksUtilsBell* _tmp0_;
	GDateTime* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->bell;
	clocks_utils_bell_stop (_tmp0_);
	_tmp1_ = self->priv->alarm_time;
	clocks_alarm_item_update_snooze_time (self, _tmp1_);
	clocks_alarm_item_set_state (self, CLOCKS_ALARM_ITEM_STATE_READY);
}


gboolean clocks_alarm_item_tick (ClocksAlarmItem* self) {
	gboolean result = FALSE;
	gboolean _tmp0_;
	gboolean _tmp1_;
	ClocksAlarmItemState _tmp2_;
	ClocksAlarmItemState last_state;
	ClocksUtilsWallClock* _tmp3_ = NULL;
	ClocksUtilsWallClock* wallclock;
	ClocksUtilsWallClock* _tmp4_;
	GDateTime* _tmp5_;
	GDateTime* _tmp6_;
	GDateTime* _tmp7_;
	GDateTime* now;
	gboolean _tmp8_ = FALSE;
	ClocksAlarmItemState _tmp9_;
	gboolean _tmp13_;
	gboolean _tmp14_ = FALSE;
	ClocksAlarmItemState _tmp15_;
	gboolean _tmp19_;
	gboolean _tmp21_ = FALSE;
	ClocksAlarmItemState _tmp22_;
	gboolean _tmp26_;
	ClocksAlarmItemState _tmp28_;
	ClocksAlarmItemState _tmp29_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = clocks_alarm_item_get_active (self);
	_tmp1_ = _tmp0_;
	if (!_tmp1_) {
		result = FALSE;
		return result;
	}
	_tmp2_ = self->priv->_state;
	last_state = _tmp2_;
	_tmp3_ = clocks_utils_wall_clock_get_default ();
	wallclock = _tmp3_;
	_tmp4_ = wallclock;
	_tmp5_ = clocks_utils_wall_clock_get_date_time (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = _g_date_time_ref0 (_tmp6_);
	now = _tmp7_;
	_tmp9_ = self->priv->_state;
	if (_tmp9_ == CLOCKS_ALARM_ITEM_STATE_RINGING) {
		GDateTime* _tmp10_;
		GDateTime* _tmp11_;
		gint _tmp12_ = 0;
		_tmp10_ = now;
		_tmp11_ = self->priv->ring_end_time;
		_tmp12_ = g_date_time_compare (_tmp10_, _tmp11_);
		_tmp8_ = _tmp12_ > 0;
	} else {
		_tmp8_ = FALSE;
	}
	_tmp13_ = _tmp8_;
	if (_tmp13_) {
		clocks_alarm_item_stop (self);
	}
	_tmp15_ = self->priv->_state;
	if (_tmp15_ == CLOCKS_ALARM_ITEM_STATE_SNOOZING) {
		GDateTime* _tmp16_;
		GDateTime* _tmp17_;
		gint _tmp18_ = 0;
		_tmp16_ = now;
		_tmp17_ = self->priv->snooze_time;
		_tmp18_ = g_date_time_compare (_tmp16_, _tmp17_);
		_tmp14_ = _tmp18_ > 0;
	} else {
		_tmp14_ = FALSE;
	}
	_tmp19_ = _tmp14_;
	if (_tmp19_) {
		GDateTime* _tmp20_;
		_tmp20_ = now;
		clocks_alarm_item_start_ringing (self, _tmp20_);
	}
	_tmp22_ = self->priv->_state;
	if (_tmp22_ == CLOCKS_ALARM_ITEM_STATE_READY) {
		GDateTime* _tmp23_;
		GDateTime* _tmp24_;
		gint _tmp25_ = 0;
		_tmp23_ = now;
		_tmp24_ = self->priv->alarm_time;
		_tmp25_ = g_date_time_compare (_tmp23_, _tmp24_);
		_tmp21_ = _tmp25_ > 0;
	} else {
		_tmp21_ = FALSE;
	}
	_tmp26_ = _tmp21_;
	if (_tmp26_) {
		GDateTime* _tmp27_;
		_tmp27_ = now;
		clocks_alarm_item_start_ringing (self, _tmp27_);
		clocks_alarm_item_update_alarm_time (self);
	}
	_tmp28_ = self->priv->_state;
	_tmp29_ = last_state;
	result = _tmp28_ != _tmp29_;
	_g_date_time_unref0 (now);
	_g_object_unref0 (wallclock);
	return result;
}


static void clocks_alarm_item_real_get_thumb_properties (ClocksContentItem* base, gchar** text, gchar** subtext, GdkPixbuf** pixbuf, gchar** css_class) {
	ClocksAlarmItem * self;
	gchar* _vala_text = NULL;
	gchar* _vala_subtext = NULL;
	GdkPixbuf* _vala_pixbuf = NULL;
	gchar* _vala_css_class = NULL;
	ClocksAlarmItemState _tmp0_;
	self = (ClocksAlarmItem*) base;
	_tmp0_ = self->priv->_state;
	if (_tmp0_ == CLOCKS_ALARM_ITEM_STATE_SNOOZING) {
		gchar* _tmp1_;
		gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_ = NULL;
		gchar* _tmp7_;
		_tmp1_ = clocks_alarm_item_get_snooze_time_label (self);
		_tmp2_ = _tmp1_;
		_g_free0 (_vala_text);
		_vala_text = _tmp2_;
		_tmp3_ = clocks_alarm_item_get_time_label (self);
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_;
		_tmp6_ = g_strdup_printf ("(%s)", _tmp5_);
		_g_free0 (_vala_subtext);
		_vala_subtext = _tmp6_;
		_g_free0 (_tmp5_);
		_tmp7_ = g_strdup ("snoozing");
		_g_free0 (_vala_css_class);
		_vala_css_class = _tmp7_;
	} else {
		gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		const gchar* _tmp12_ = NULL;
		gboolean _tmp13_;
		gboolean _tmp14_;
		const gchar* _tmp15_;
		gchar* _tmp16_;
		_tmp8_ = clocks_alarm_item_get_time_label (self);
		_tmp9_ = _tmp8_;
		_g_free0 (_vala_text);
		_vala_text = _tmp9_;
		_tmp10_ = clocks_alarm_item_get_repeat_label (self);
		_tmp11_ = _tmp10_;
		_g_free0 (_vala_subtext);
		_vala_subtext = _tmp11_;
		_tmp13_ = clocks_alarm_item_get_active (self);
		_tmp14_ = _tmp13_;
		if (_tmp14_) {
			_tmp12_ = "active";
		} else {
			_tmp12_ = "inactive";
		}
		_tmp15_ = _tmp12_;
		_tmp16_ = g_strdup (_tmp15_);
		_g_free0 (_vala_css_class);
		_vala_css_class = _tmp16_;
	}
	_g_object_unref0 (_vala_pixbuf);
	_vala_pixbuf = NULL;
	if (text) {
		*text = _vala_text;
	} else {
		_g_free0 (_vala_text);
	}
	if (subtext) {
		*subtext = _vala_subtext;
	} else {
		_g_free0 (_vala_subtext);
	}
	if (pixbuf) {
		*pixbuf = _vala_pixbuf;
	} else {
		_g_object_unref0 (_vala_pixbuf);
	}
	if (css_class) {
		*css_class = _vala_css_class;
	} else {
		_g_free0 (_vala_css_class);
	}
}


void clocks_alarm_item_serialize (ClocksAlarmItem* self, GVariantBuilder* builder) {
	GVariantBuilder* _tmp0_;
	GVariantType* _tmp1_;
	GVariantType* _tmp2_;
	GVariantBuilder* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	GVariant* _tmp6_;
	GVariant* _tmp7_;
	GVariantBuilder* _tmp8_;
	gboolean _tmp9_;
	gboolean _tmp10_;
	GVariant* _tmp11_;
	GVariant* _tmp12_;
	GVariantBuilder* _tmp13_;
	gint _tmp14_;
	GVariant* _tmp15_;
	GVariant* _tmp16_;
	GVariantBuilder* _tmp17_;
	gint _tmp18_;
	GVariant* _tmp19_;
	GVariant* _tmp20_;
	GVariantBuilder* _tmp21_;
	ClocksUtilsWeekdays* _tmp22_;
	GVariant* _tmp23_ = NULL;
	GVariant* _tmp24_;
	GVariantBuilder* _tmp25_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (builder != NULL);
	_tmp0_ = builder;
	_tmp1_ = g_variant_type_new ("a{sv}");
	_tmp2_ = _tmp1_;
	g_variant_builder_open (_tmp0_, _tmp2_);
	_g_variant_type_free0 (_tmp2_);
	_tmp3_ = builder;
	_tmp4_ = clocks_content_item_get_name ((ClocksContentItem*) self);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_variant_new_string (_tmp5_);
	g_variant_ref_sink (_tmp6_);
	_tmp7_ = _tmp6_;
	g_variant_builder_add (_tmp3_, "{sv}", "name", _tmp7_, NULL);
	_g_variant_unref0 (_tmp7_);
	_tmp8_ = builder;
	_tmp9_ = clocks_alarm_item_get_active (self);
	_tmp10_ = _tmp9_;
	_tmp11_ = g_variant_new_boolean (_tmp10_);
	g_variant_ref_sink (_tmp11_);
	_tmp12_ = _tmp11_;
	g_variant_builder_add (_tmp8_, "{sv}", "active", _tmp12_, NULL);
	_g_variant_unref0 (_tmp12_);
	_tmp13_ = builder;
	_tmp14_ = self->priv->_hour;
	_tmp15_ = g_variant_new_int32 ((gint32) _tmp14_);
	g_variant_ref_sink (_tmp15_);
	_tmp16_ = _tmp15_;
	g_variant_builder_add (_tmp13_, "{sv}", "hour", _tmp16_, NULL);
	_g_variant_unref0 (_tmp16_);
	_tmp17_ = builder;
	_tmp18_ = self->priv->_minute;
	_tmp19_ = g_variant_new_int32 ((gint32) _tmp18_);
	g_variant_ref_sink (_tmp19_);
	_tmp20_ = _tmp19_;
	g_variant_builder_add (_tmp17_, "{sv}", "minute", _tmp20_, NULL);
	_g_variant_unref0 (_tmp20_);
	_tmp21_ = builder;
	_tmp22_ = self->priv->_days;
	_tmp23_ = clocks_utils_weekdays_serialize (_tmp22_);
	_tmp24_ = _tmp23_;
	g_variant_builder_add (_tmp21_, "{sv}", "days", _tmp24_, NULL);
	_g_variant_unref0 (_tmp24_);
	_tmp25_ = builder;
	g_variant_builder_close (_tmp25_);
}


ClocksAlarmItem* clocks_alarm_item_deserialize (GVariant* alarm_variant) {
	ClocksAlarmItem* result = NULL;
	gchar* name;
	gboolean active;
	gint hour;
	gint minute;
	ClocksUtilsWeekdays* _tmp0_;
	ClocksUtilsWeekdays* days;
	gboolean _tmp48_ = FALSE;
	gboolean _tmp49_ = FALSE;
	const gchar* _tmp50_;
	gboolean _tmp52_;
	gboolean _tmp54_;
	g_return_val_if_fail (alarm_variant != NULL, NULL);
	name = NULL;
	active = TRUE;
	hour = -1;
	minute = -1;
	_tmp0_ = clocks_utils_weekdays_new ();
	days = _tmp0_;
	{
		GVariant* _tmp1_;
		GVariantIter* _tmp2_ = NULL;
		GVariantIter* _v_it;
		GVariant* v = NULL;
		_tmp1_ = alarm_variant;
		_tmp2_ = g_variant_iter_new (_tmp1_);
		_v_it = _tmp2_;
		while (TRUE) {
			GVariantIter* _tmp3_;
			GVariant* _tmp4_ = NULL;
			GVariant* _tmp5_;
			GVariant* _tmp6_;
			GVariant* _tmp7_ = NULL;
			GVariant* _tmp8_;
			const gchar* _tmp9_ = NULL;
			gchar* _tmp10_;
			gchar* _tmp11_;
			gchar* key;
			const gchar* _tmp12_;
			_tmp3_ = _v_it;
			_tmp4_ = g_variant_iter_next_value (_tmp3_);
			_g_variant_unref0 (v);
			v = _tmp4_;
			_tmp5_ = v;
			if (!(_tmp5_ != NULL)) {
				break;
			}
			_tmp6_ = v;
			_tmp7_ = g_variant_get_child_value (_tmp6_, (gsize) 0);
			_tmp8_ = _tmp7_;
			_tmp9_ = g_variant_get_string (_tmp8_, NULL);
			_tmp10_ = g_strdup (_tmp9_);
			_tmp11_ = _tmp10_;
			_g_variant_unref0 (_tmp8_);
			key = _tmp11_;
			_tmp12_ = key;
			if (g_strcmp0 (_tmp12_, "name") == 0) {
				GVariant* _tmp13_;
				GVariant* _tmp14_ = NULL;
				GVariant* _tmp15_;
				GVariant* _tmp16_ = NULL;
				GVariant* _tmp17_;
				const gchar* _tmp18_ = NULL;
				gchar* _tmp19_;
				_tmp13_ = v;
				_tmp14_ = g_variant_get_child_value (_tmp13_, (gsize) 1);
				_tmp15_ = _tmp14_;
				_tmp16_ = g_variant_get_child_value (_tmp15_, (gsize) 0);
				_tmp17_ = _tmp16_;
				_tmp18_ = g_variant_get_string (_tmp17_, NULL);
				_tmp19_ = g_strdup (_tmp18_);
				_g_free0 (name);
				name = _tmp19_;
				_g_variant_unref0 (_tmp17_);
				_g_variant_unref0 (_tmp15_);
			} else {
				const gchar* _tmp20_;
				_tmp20_ = key;
				if (g_strcmp0 (_tmp20_, "active") == 0) {
					GVariant* _tmp21_;
					GVariant* _tmp22_ = NULL;
					GVariant* _tmp23_;
					GVariant* _tmp24_ = NULL;
					GVariant* _tmp25_;
					gboolean _tmp26_ = FALSE;
					_tmp21_ = v;
					_tmp22_ = g_variant_get_child_value (_tmp21_, (gsize) 1);
					_tmp23_ = _tmp22_;
					_tmp24_ = g_variant_get_child_value (_tmp23_, (gsize) 0);
					_tmp25_ = _tmp24_;
					_tmp26_ = g_variant_get_boolean (_tmp25_);
					active = _tmp26_;
					_g_variant_unref0 (_tmp25_);
					_g_variant_unref0 (_tmp23_);
				} else {
					const gchar* _tmp27_;
					_tmp27_ = key;
					if (g_strcmp0 (_tmp27_, "hour") == 0) {
						GVariant* _tmp28_;
						GVariant* _tmp29_ = NULL;
						GVariant* _tmp30_;
						GVariant* _tmp31_ = NULL;
						GVariant* _tmp32_;
						gint32 _tmp33_ = 0;
						_tmp28_ = v;
						_tmp29_ = g_variant_get_child_value (_tmp28_, (gsize) 1);
						_tmp30_ = _tmp29_;
						_tmp31_ = g_variant_get_child_value (_tmp30_, (gsize) 0);
						_tmp32_ = _tmp31_;
						_tmp33_ = g_variant_get_int32 (_tmp32_);
						hour = (gint) _tmp33_;
						_g_variant_unref0 (_tmp32_);
						_g_variant_unref0 (_tmp30_);
					} else {
						const gchar* _tmp34_;
						_tmp34_ = key;
						if (g_strcmp0 (_tmp34_, "minute") == 0) {
							GVariant* _tmp35_;
							GVariant* _tmp36_ = NULL;
							GVariant* _tmp37_;
							GVariant* _tmp38_ = NULL;
							GVariant* _tmp39_;
							gint32 _tmp40_ = 0;
							_tmp35_ = v;
							_tmp36_ = g_variant_get_child_value (_tmp35_, (gsize) 1);
							_tmp37_ = _tmp36_;
							_tmp38_ = g_variant_get_child_value (_tmp37_, (gsize) 0);
							_tmp39_ = _tmp38_;
							_tmp40_ = g_variant_get_int32 (_tmp39_);
							minute = (gint) _tmp40_;
							_g_variant_unref0 (_tmp39_);
							_g_variant_unref0 (_tmp37_);
						} else {
							const gchar* _tmp41_;
							_tmp41_ = key;
							if (g_strcmp0 (_tmp41_, "days") == 0) {
								GVariant* _tmp42_;
								GVariant* _tmp43_ = NULL;
								GVariant* _tmp44_;
								GVariant* _tmp45_ = NULL;
								GVariant* _tmp46_;
								ClocksUtilsWeekdays* _tmp47_ = NULL;
								_tmp42_ = v;
								_tmp43_ = g_variant_get_child_value (_tmp42_, (gsize) 1);
								_tmp44_ = _tmp43_;
								_tmp45_ = g_variant_get_child_value (_tmp44_, (gsize) 0);
								_tmp46_ = _tmp45_;
								_tmp47_ = clocks_utils_weekdays_deserialize (_tmp46_);
								_clocks_utils_weekdays_unref0 (days);
								days = _tmp47_;
								_g_variant_unref0 (_tmp46_);
								_g_variant_unref0 (_tmp44_);
							}
						}
					}
				}
			}
			_g_free0 (key);
		}
		_g_variant_unref0 (v);
		_g_variant_iter_free0 (_v_it);
	}
	_tmp50_ = name;
	if (_tmp50_ != NULL) {
		gint _tmp51_;
		_tmp51_ = hour;
		_tmp49_ = _tmp51_ >= 0;
	} else {
		_tmp49_ = FALSE;
	}
	_tmp52_ = _tmp49_;
	if (_tmp52_) {
		gint _tmp53_;
		_tmp53_ = minute;
		_tmp48_ = _tmp53_ >= 0;
	} else {
		_tmp48_ = FALSE;
	}
	_tmp54_ = _tmp48_;
	if (_tmp54_) {
		const gchar* _tmp55_;
		gboolean _tmp56_;
		gint _tmp57_;
		gint _tmp58_;
		ClocksUtilsWeekdays* _tmp59_;
		ClocksAlarmItem* _tmp60_;
		_tmp55_ = name;
		_tmp56_ = active;
		_tmp57_ = hour;
		_tmp58_ = minute;
		_tmp59_ = days;
		_tmp60_ = clocks_alarm_item_new_with_data (_tmp55_, _tmp56_, _tmp57_, _tmp58_, _tmp59_);
		result = _tmp60_;
		_clocks_utils_weekdays_unref0 (days);
		_g_free0 (name);
		return result;
	} else {
		const gchar* _tmp61_ = NULL;
		const gchar* _tmp62_;
		const gchar* _tmp64_;
		_tmp62_ = name;
		if (_tmp62_ != NULL) {
			const gchar* _tmp63_;
			_tmp63_ = name;
			_tmp61_ = _tmp63_;
		} else {
			_tmp61_ = "name missing";
		}
		_tmp64_ = _tmp61_;
		g_warning ("alarm.vala:249: Invalid alarm %s", _tmp64_);
	}
	result = NULL;
	_clocks_utils_weekdays_unref0 (days);
	_g_free0 (name);
	return result;
}


static const gchar* clocks_alarm_item_real_get_name (ClocksContentItem* base) {
	const gchar* result;
	ClocksAlarmItem* self;
	const gchar* _tmp0_;
	self = (ClocksAlarmItem*) base;
	_tmp0_ = self->priv->_name;
	result = _tmp0_;
	return result;
}


static void clocks_alarm_item_real_set_name (ClocksContentItem* base, const gchar* value) {
	ClocksAlarmItem* self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	self = (ClocksAlarmItem*) base;
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_name);
	self->priv->_name = _tmp1_;
	clocks_alarm_item_setup_bell (self);
	g_object_notify ((GObject *) self, "name");
}


gint clocks_alarm_item_get_hour (ClocksAlarmItem* self) {
	gint result;
	gint _tmp0_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->_hour;
	result = _tmp0_;
	return result;
}


void clocks_alarm_item_set_hour (ClocksAlarmItem* self, gint value) {
	gint _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_hour = _tmp0_;
	g_object_notify ((GObject *) self, "hour");
}


gint clocks_alarm_item_get_minute (ClocksAlarmItem* self) {
	gint result;
	gint _tmp0_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->_minute;
	result = _tmp0_;
	return result;
}


void clocks_alarm_item_set_minute (ClocksAlarmItem* self, gint value) {
	gint _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_minute = _tmp0_;
	g_object_notify ((GObject *) self, "minute");
}


ClocksUtilsWeekdays* clocks_alarm_item_get_days (ClocksAlarmItem* self) {
	ClocksUtilsWeekdays* result;
	ClocksUtilsWeekdays* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_days;
	result = _tmp0_;
	return result;
}


static gpointer _clocks_utils_weekdays_ref0 (gpointer self) {
	return self ? clocks_utils_weekdays_ref (self) : NULL;
}


void clocks_alarm_item_set_days (ClocksAlarmItem* self, ClocksUtilsWeekdays* value) {
	ClocksUtilsWeekdays* _tmp0_;
	ClocksUtilsWeekdays* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _clocks_utils_weekdays_ref0 (_tmp0_);
	_clocks_utils_weekdays_unref0 (self->priv->_days);
	self->priv->_days = _tmp1_;
	g_object_notify ((GObject *) self, "days");
}


gchar* clocks_alarm_item_get_repeat_label (ClocksAlarmItem* self) {
	gchar* result;
	ClocksUtilsWeekdays* _tmp0_;
	gchar* _tmp1_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_days;
	_tmp1_ = clocks_utils_weekdays_get_label (_tmp0_);
	result = _tmp1_;
	return result;
}


ClocksAlarmItemState clocks_alarm_item_get_state (ClocksAlarmItem* self) {
	ClocksAlarmItemState result;
	ClocksAlarmItemState _tmp0_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->_state;
	result = _tmp0_;
	return result;
}


static void clocks_alarm_item_set_state (ClocksAlarmItem* self, ClocksAlarmItemState value) {
	ClocksAlarmItemState _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_state = _tmp0_;
	g_object_notify ((GObject *) self, "state");
}


gchar* clocks_alarm_item_get_time_label (ClocksAlarmItem* self) {
	gchar* result;
	ClocksUtilsWallClock* _tmp0_ = NULL;
	ClocksUtilsWallClock* _tmp1_;
	GDateTime* _tmp2_;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = clocks_utils_wall_clock_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->alarm_time;
	_tmp3_ = clocks_utils_wall_clock_format_time (_tmp1_, _tmp2_);
	_tmp4_ = _tmp3_;
	_g_object_unref0 (_tmp1_);
	result = _tmp4_;
	return result;
}


gchar* clocks_alarm_item_get_snooze_time_label (ClocksAlarmItem* self) {
	gchar* result;
	ClocksUtilsWallClock* _tmp0_ = NULL;
	ClocksUtilsWallClock* _tmp1_;
	GDateTime* _tmp2_;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = clocks_utils_wall_clock_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->snooze_time;
	_tmp3_ = clocks_utils_wall_clock_format_time (_tmp1_, _tmp2_);
	_tmp4_ = _tmp3_;
	_g_object_unref0 (_tmp1_);
	result = _tmp4_;
	return result;
}


gboolean clocks_alarm_item_get_active (ClocksAlarmItem* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_active;
	result = _tmp0_;
	return result;
}


void clocks_alarm_item_set_active (ClocksAlarmItem* self, gboolean value) {
	gboolean _tmp0_;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = self->priv->_active;
	if (_tmp0_ != _tmp1_) {
		gboolean _tmp2_;
		gboolean _tmp3_;
		_tmp2_ = value;
		self->priv->_active = _tmp2_;
		_tmp3_ = self->priv->_active;
		if (_tmp3_) {
			clocks_alarm_item_reset (self);
		} else {
			ClocksAlarmItemState _tmp4_;
			_tmp4_ = self->priv->_state;
			if (_tmp4_ == CLOCKS_ALARM_ITEM_STATE_RINGING) {
				clocks_alarm_item_stop (self);
			}
		}
	}
	g_object_notify ((GObject *) self, "active");
}


static void clocks_alarm_item_real_ring (ClocksAlarmItem* self) {
	ClocksUtilsBell* _tmp0_;
	_tmp0_ = self->priv->bell;
	clocks_utils_bell_ring (_tmp0_);
}


static void clocks_alarm_item_class_init (ClocksAlarmItemClass * klass) {
	clocks_alarm_item_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ClocksAlarmItemPrivate));
	CLOCKS_ALARM_ITEM_CLASS (klass)->ring = clocks_alarm_item_real_ring;
	G_OBJECT_CLASS (klass)->get_property = _vala_clocks_alarm_item_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_clocks_alarm_item_set_property;
	G_OBJECT_CLASS (klass)->finalize = clocks_alarm_item_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_ALARM_ITEM_NAME, 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_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_ALARM_ITEM_HOUR, g_param_spec_int ("hour", "hour", "hour", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_ALARM_ITEM_MINUTE, g_param_spec_int ("minute", "minute", "minute", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_ALARM_ITEM_DAYS, clocks_utils_param_spec_weekdays ("days", "days", "days", CLOCKS_UTILS_TYPE_WEEKDAYS, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_ALARM_ITEM_REPEAT_LABEL, g_param_spec_string ("repeat-label", "repeat-label", "repeat-label", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_ALARM_ITEM_STATE, g_param_spec_enum ("state", "state", "state", CLOCKS_ALARM_ITEM_TYPE_STATE, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_ALARM_ITEM_TIME_LABEL, g_param_spec_string ("time-label", "time-label", "time-label", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_ALARM_ITEM_SNOOZE_TIME_LABEL, g_param_spec_string ("snooze-time-label", "snooze-time-label", "snooze-time-label", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_ALARM_ITEM_ACTIVE, g_param_spec_boolean ("active", "active", "active", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_signal_new ("ring", CLOCKS_ALARM_TYPE_ITEM, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ClocksAlarmItemClass, ring), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}


static void clocks_alarm_item_clocks_content_item_interface_init (ClocksContentItemIface * iface) {
	clocks_alarm_item_clocks_content_item_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_thumb_properties = (void (*)(ClocksContentItem*, gchar**, gchar**, GdkPixbuf**, gchar**)) clocks_alarm_item_real_get_thumb_properties;
	iface->get_name = clocks_alarm_item_real_get_name;
	iface->set_name = clocks_alarm_item_real_set_name;
}


static void clocks_alarm_item_instance_init (ClocksAlarmItem * self) {
	self->priv = CLOCKS_ALARM_ITEM_GET_PRIVATE (self);
}


static void clocks_alarm_item_finalize (GObject* obj) {
	ClocksAlarmItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem);
	_clocks_utils_weekdays_unref0 (self->priv->_days);
	_g_free0 (self->priv->_name);
	_g_date_time_unref0 (self->priv->alarm_time);
	_g_date_time_unref0 (self->priv->snooze_time);
	_g_date_time_unref0 (self->priv->ring_end_time);
	_g_object_unref0 (self->priv->bell);
	G_OBJECT_CLASS (clocks_alarm_item_parent_class)->finalize (obj);
}


GType clocks_alarm_item_get_type (void) {
	static volatile gsize clocks_alarm_item_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_alarm_item_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ClocksAlarmItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_alarm_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksAlarmItem), 0, (GInstanceInitFunc) clocks_alarm_item_instance_init, NULL };
		static const GInterfaceInfo clocks_content_item_info = { (GInterfaceInitFunc) clocks_alarm_item_clocks_content_item_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType clocks_alarm_item_type_id;
		clocks_alarm_item_type_id = g_type_register_static (G_TYPE_OBJECT, "ClocksAlarmItem", &g_define_type_info, 0);
		g_type_add_interface_static (clocks_alarm_item_type_id, CLOCKS_TYPE_CONTENT_ITEM, &clocks_content_item_info);
		g_once_init_leave (&clocks_alarm_item_type_id__volatile, clocks_alarm_item_type_id);
	}
	return clocks_alarm_item_type_id__volatile;
}


static void _vala_clocks_alarm_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ClocksAlarmItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem);
	switch (property_id) {
		case CLOCKS_ALARM_ITEM_NAME:
		g_value_set_string (value, clocks_content_item_get_name ((ClocksContentItem*) self));
		break;
		case CLOCKS_ALARM_ITEM_HOUR:
		g_value_set_int (value, clocks_alarm_item_get_hour (self));
		break;
		case CLOCKS_ALARM_ITEM_MINUTE:
		g_value_set_int (value, clocks_alarm_item_get_minute (self));
		break;
		case CLOCKS_ALARM_ITEM_DAYS:
		clocks_utils_value_set_weekdays (value, clocks_alarm_item_get_days (self));
		break;
		case CLOCKS_ALARM_ITEM_REPEAT_LABEL:
		g_value_take_string (value, clocks_alarm_item_get_repeat_label (self));
		break;
		case CLOCKS_ALARM_ITEM_STATE:
		g_value_set_enum (value, clocks_alarm_item_get_state (self));
		break;
		case CLOCKS_ALARM_ITEM_TIME_LABEL:
		g_value_take_string (value, clocks_alarm_item_get_time_label (self));
		break;
		case CLOCKS_ALARM_ITEM_SNOOZE_TIME_LABEL:
		g_value_take_string (value, clocks_alarm_item_get_snooze_time_label (self));
		break;
		case CLOCKS_ALARM_ITEM_ACTIVE:
		g_value_set_boolean (value, clocks_alarm_item_get_active (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_clocks_alarm_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	ClocksAlarmItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem);
	switch (property_id) {
		case CLOCKS_ALARM_ITEM_NAME:
		clocks_content_item_set_name ((ClocksContentItem*) self, g_value_get_string (value));
		break;
		case CLOCKS_ALARM_ITEM_HOUR:
		clocks_alarm_item_set_hour (self, g_value_get_int (value));
		break;
		case CLOCKS_ALARM_ITEM_MINUTE:
		clocks_alarm_item_set_minute (self, g_value_get_int (value));
		break;
		case CLOCKS_ALARM_ITEM_DAYS:
		clocks_alarm_item_set_days (self, clocks_utils_value_get_weekdays (value));
		break;
		case CLOCKS_ALARM_ITEM_STATE:
		clocks_alarm_item_set_state (self, g_value_get_enum (value));
		break;
		case CLOCKS_ALARM_ITEM_ACTIVE:
		clocks_alarm_item_set_active (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


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


static gboolean _clocks_alarm_setup_dialog_show_leading_zeros_gtk_spin_button_output (GtkSpinButton* _sender, gpointer self) {
	gboolean result;
	result = clocks_alarm_setup_dialog_show_leading_zeros (self, _sender);
	return result;
}


ClocksAlarmSetupDialog* clocks_alarm_setup_dialog_construct (GType object_type, GtkWindow* parent, ClocksAlarmItem* alarm) {
	ClocksAlarmSetupDialog * self = NULL;
	const gchar* _tmp0_ = NULL;
	ClocksAlarmItem* _tmp1_;
	GtkWindow* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_ = NULL;
	ClocksUtilsWallClock* _tmp7_ = NULL;
	ClocksUtilsWallClock* _tmp8_;
	ClocksUtilsWallClockFormat _tmp9_;
	ClocksUtilsWallClockFormat _tmp10_;
	ClocksAmPmToggleButton* _tmp11_;
	GtkBuilder* _tmp12_ = NULL;
	GtkBuilder* builder;
	GtkBuilder* _tmp13_;
	GObject* _tmp14_ = NULL;
	GtkGrid* _tmp15_;
	GtkGrid* grid;
	GtkBuilder* _tmp16_;
	GObject* _tmp17_ = NULL;
	GtkAlignment* _tmp18_;
	GtkAlignment* am_pm_alignment;
	GtkBuilder* _tmp19_;
	GObject* _tmp20_ = NULL;
	GtkSizeGroup* _tmp21_;
	GtkSizeGroup* am_pm_sizegroup;
	GtkBuilder* _tmp22_;
	GObject* _tmp23_ = NULL;
	GtkBox* _tmp24_;
	GtkBox* day_buttons_box;
	GtkBuilder* _tmp25_;
	GObject* _tmp26_ = NULL;
	GtkSpinButton* _tmp27_;
	GtkBuilder* _tmp28_;
	GObject* _tmp29_ = NULL;
	GtkSpinButton* _tmp30_;
	GtkBuilder* _tmp31_;
	GObject* _tmp32_ = NULL;
	GtkEntry* _tmp33_;
	GtkBuilder* _tmp34_;
	GObject* _tmp35_ = NULL;
	GtkSwitch* _tmp36_;
	GtkSpinButton* _tmp37_;
	GtkSpinButton* _tmp38_;
	ClocksUtilsWallClockFormat _tmp39_;
	GtkToggleButton** _tmp49_ = NULL;
	ClocksUtilsWeekdaysDay _tmp64_ = 0;
	ClocksUtilsWeekdaysDay first_weekday;
	GtkBox* _tmp75_ = NULL;
	GtkGrid* _tmp76_;
	ClocksAlarmItem* _tmp77_;
	g_return_val_if_fail (parent != NULL, NULL);
	_tmp1_ = alarm;
	if (_tmp1_ != NULL) {
		const gchar* _tmp2_ = NULL;
		_tmp2_ = _ ("Edit Alarm");
		_tmp0_ = _tmp2_;
	} else {
		const gchar* _tmp3_ = NULL;
		_tmp3_ = _ ("New Alarm");
		_tmp0_ = _tmp3_;
	}
	_tmp4_ = parent;
	_tmp5_ = _tmp0_;
	self = (ClocksAlarmSetupDialog*) g_object_new (object_type, "transient-for", _tmp4_, "modal", TRUE, "title", _tmp5_, NULL);
	_tmp6_ = _ ("_Done");
	gtk_dialog_add_buttons ((GtkDialog*) self, GTK_STOCK_CANCEL, 0, _tmp6_, 1, NULL);
	gtk_dialog_set_default_response ((GtkDialog*) self, 1);
	_tmp7_ = clocks_utils_wall_clock_get_default ();
	_tmp8_ = _tmp7_;
	_tmp9_ = clocks_utils_wall_clock_get_format (_tmp8_);
	_tmp10_ = _tmp9_;
	self->priv->format = _tmp10_;
	_g_object_unref0 (_tmp8_);
	_tmp11_ = clocks_am_pm_toggle_button_new ();
	g_object_ref_sink (_tmp11_);
	_g_object_unref0 (self->priv->am_pm_button);
	self->priv->am_pm_button = _tmp11_;
	_tmp12_ = clocks_utils_load_ui ("alarm.ui");
	builder = _tmp12_;
	_tmp13_ = builder;
	_tmp14_ = gtk_builder_get_object (_tmp13_, "setup_dialog_content");
	_tmp15_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, GTK_TYPE_GRID) ? ((GtkGrid*) _tmp14_) : NULL);
	grid = _tmp15_;
	_tmp16_ = builder;
	_tmp17_ = gtk_builder_get_object (_tmp16_, "am_pm_alignment");
	_tmp18_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, GTK_TYPE_ALIGNMENT) ? ((GtkAlignment*) _tmp17_) : NULL);
	am_pm_alignment = _tmp18_;
	_tmp19_ = builder;
	_tmp20_ = gtk_builder_get_object (_tmp19_, "am_pm_sizegroup");
	_tmp21_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp20_, GTK_TYPE_SIZE_GROUP) ? ((GtkSizeGroup*) _tmp20_) : NULL);
	am_pm_sizegroup = _tmp21_;
	_tmp22_ = builder;
	_tmp23_ = gtk_builder_get_object (_tmp22_, "day_buttons_box");
	_tmp24_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp23_, GTK_TYPE_BOX) ? ((GtkBox*) _tmp23_) : NULL);
	day_buttons_box = _tmp24_;
	_tmp25_ = builder;
	_tmp26_ = gtk_builder_get_object (_tmp25_, "h_spinbutton");
	_tmp27_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp26_, GTK_TYPE_SPIN_BUTTON) ? ((GtkSpinButton*) _tmp26_) : NULL);
	_g_object_unref0 (self->priv->h_spinbutton);
	self->priv->h_spinbutton = _tmp27_;
	_tmp28_ = builder;
	_tmp29_ = gtk_builder_get_object (_tmp28_, "m_spinbutton");
	_tmp30_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp29_, GTK_TYPE_SPIN_BUTTON) ? ((GtkSpinButton*) _tmp29_) : NULL);
	_g_object_unref0 (self->priv->m_spinbutton);
	self->priv->m_spinbutton = _tmp30_;
	_tmp31_ = builder;
	_tmp32_ = gtk_builder_get_object (_tmp31_, "name_entry");
	_tmp33_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp32_, GTK_TYPE_ENTRY) ? ((GtkEntry*) _tmp32_) : NULL);
	_g_object_unref0 (self->priv->name_entry);
	self->priv->name_entry = _tmp33_;
	_tmp34_ = builder;
	_tmp35_ = gtk_builder_get_object (_tmp34_, "active_switch");
	_tmp36_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp35_, GTK_TYPE_SWITCH) ? ((GtkSwitch*) _tmp35_) : NULL);
	_g_object_unref0 (self->priv->active_switch);
	self->priv->active_switch = _tmp36_;
	_tmp37_ = self->priv->h_spinbutton;
	g_signal_connect_object (_tmp37_, "output", (GCallback) _clocks_alarm_setup_dialog_show_leading_zeros_gtk_spin_button_output, self, 0);
	_tmp38_ = self->priv->m_spinbutton;
	g_signal_connect_object (_tmp38_, "output", (GCallback) _clocks_alarm_setup_dialog_show_leading_zeros_gtk_spin_button_output, self, 0);
	_tmp39_ = self->priv->format;
	if (_tmp39_ == CLOCKS_UTILS_WALL_CLOCK_FORMAT_TWENTYFOUR) {
		GtkSpinButton* _tmp40_;
		_tmp40_ = self->priv->h_spinbutton;
		gtk_spin_button_set_range (_tmp40_, (gdouble) 0, (gdouble) 23);
	} else {
		GtkSpinButton* _tmp41_;
		GtkSizeGroup* _tmp42_;
		ClocksAmPmToggleButton* _tmp43_;
		GtkAlignment* _tmp44_;
		GtkAlignment* _tmp45_;
		GtkWidget* _tmp46_ = NULL;
		GtkAlignment* _tmp47_;
		ClocksAmPmToggleButton* _tmp48_;
		_tmp41_ = self->priv->h_spinbutton;
		gtk_spin_button_set_range (_tmp41_, (gdouble) 1, (gdouble) 12);
		_tmp42_ = am_pm_sizegroup;
		_tmp43_ = self->priv->am_pm_button;
		gtk_size_group_add_widget (_tmp42_, (GtkWidget*) _tmp43_);
		_tmp44_ = am_pm_alignment;
		_tmp45_ = am_pm_alignment;
		_tmp46_ = gtk_bin_get_child ((GtkBin*) _tmp45_);
		gtk_container_remove ((GtkContainer*) _tmp44_, _tmp46_);
		_tmp47_ = am_pm_alignment;
		_tmp48_ = self->priv->am_pm_button;
		gtk_container_add ((GtkContainer*) _tmp47_, (GtkWidget*) _tmp48_);
	}
	_tmp49_ = g_new0 (GtkToggleButton*, 7 + 1);
	self->priv->day_buttons = (_vala_array_free (self->priv->day_buttons, self->priv->day_buttons_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->day_buttons = _tmp49_;
	self->priv->day_buttons_length1 = 7;
	self->priv->_day_buttons_size_ = self->priv->day_buttons_length1;
	{
		gint i;
		i = 0;
		{
			gboolean _tmp50_;
			_tmp50_ = TRUE;
			while (TRUE) {
				gboolean _tmp51_;
				gint _tmp53_;
				gint _tmp54_;
				gchar* _tmp55_ = NULL;
				gchar* _tmp56_;
				GtkToggleButton* _tmp57_;
				GtkToggleButton* _tmp58_;
				GtkToggleButton* button;
				GtkToggleButton** _tmp59_;
				gint _tmp59__length1;
				gint _tmp60_;
				GtkToggleButton* _tmp61_;
				GtkToggleButton* _tmp62_;
				GtkToggleButton* _tmp63_;
				_tmp51_ = _tmp50_;
				if (!_tmp51_) {
					gint _tmp52_;
					_tmp52_ = i;
					i = _tmp52_ + 1;
				}
				_tmp50_ = FALSE;
				_tmp53_ = i;
				if (!(_tmp53_ < 7)) {
					break;
				}
				_tmp54_ = i;
				_tmp55_ = clocks_utils_weekdays_abbreviation ((ClocksUtilsWeekdaysDay) _tmp54_);
				_tmp56_ = _tmp55_;
				_tmp57_ = (GtkToggleButton*) gtk_toggle_button_new_with_label (_tmp56_);
				g_object_ref_sink (_tmp57_);
				_tmp58_ = _tmp57_;
				_g_free0 (_tmp56_);
				button = _tmp58_;
				_tmp59_ = self->priv->day_buttons;
				_tmp59__length1 = self->priv->day_buttons_length1;
				_tmp60_ = i;
				_tmp61_ = button;
				_tmp62_ = _g_object_ref0 (_tmp61_);
				_g_object_unref0 (_tmp59_[_tmp60_]);
				_tmp59_[_tmp60_] = _tmp62_;
				_tmp63_ = _tmp59_[_tmp60_];
				_g_object_unref0 (button);
			}
		}
	}
	_tmp64_ = clocks_utils_weekdays_get_first_weekday ();
	first_weekday = _tmp64_;
	{
		gint i;
		i = 0;
		{
			gboolean _tmp65_;
			_tmp65_ = TRUE;
			while (TRUE) {
				gboolean _tmp66_;
				gint _tmp68_;
				ClocksUtilsWeekdaysDay _tmp69_;
				gint _tmp70_;
				ClocksUtilsWeekdaysDay day_number;
				GtkBox* _tmp71_;
				GtkToggleButton** _tmp72_;
				gint _tmp72__length1;
				ClocksUtilsWeekdaysDay _tmp73_;
				GtkToggleButton* _tmp74_;
				_tmp66_ = _tmp65_;
				if (!_tmp66_) {
					gint _tmp67_;
					_tmp67_ = i;
					i = _tmp67_ + 1;
				}
				_tmp65_ = FALSE;
				_tmp68_ = i;
				if (!(_tmp68_ < 7)) {
					break;
				}
				_tmp69_ = first_weekday;
				_tmp70_ = i;
				day_number = (_tmp69_ + _tmp70_) % 7;
				_tmp71_ = day_buttons_box;
				_tmp72_ = self->priv->day_buttons;
				_tmp72__length1 = self->priv->day_buttons_length1;
				_tmp73_ = day_number;
				_tmp74_ = _tmp72_[_tmp73_];
				gtk_box_pack_start (_tmp71_, (GtkWidget*) _tmp74_, TRUE, TRUE, (guint) 0);
			}
		}
	}
	_tmp75_ = gtk_dialog_get_content_area ((GtkDialog*) self);
	_tmp76_ = grid;
	gtk_container_add ((GtkContainer*) _tmp75_, (GtkWidget*) _tmp76_);
	_tmp77_ = alarm;
	clocks_alarm_setup_dialog_set_from_alarm (self, _tmp77_);
	_g_object_unref0 (day_buttons_box);
	_g_object_unref0 (am_pm_sizegroup);
	_g_object_unref0 (am_pm_alignment);
	_g_object_unref0 (grid);
	_g_object_unref0 (builder);
	return self;
}


ClocksAlarmSetupDialog* clocks_alarm_setup_dialog_new (GtkWindow* parent, ClocksAlarmItem* alarm) {
	return clocks_alarm_setup_dialog_construct (CLOCKS_ALARM_TYPE_SETUP_DIALOG, parent, alarm);
}


void clocks_alarm_setup_dialog_set_from_alarm (ClocksAlarmSetupDialog* self, ClocksAlarmItem* alarm) {
	gchar* name = NULL;
	gboolean active = FALSE;
	gint hour = 0;
	gint minute = 0;
	ClocksUtilsWeekdays* days = NULL;
	ClocksAlarmItem* _tmp0_;
	ClocksUtilsWallClockFormat _tmp28_;
	GtkSpinButton* _tmp34_;
	gint _tmp35_;
	GtkSpinButton* _tmp36_;
	gint _tmp37_;
	GtkEntry* _tmp38_;
	const gchar* _tmp39_;
	ClocksUtilsWeekdays* _tmp40_;
	GtkSwitch* _tmp51_;
	gboolean _tmp52_;
	g_return_if_fail (self != NULL);
	_tmp0_ = alarm;
	if (_tmp0_ == NULL) {
		ClocksUtilsWallClock* _tmp1_ = NULL;
		ClocksUtilsWallClock* wc;
		const gchar* _tmp2_ = NULL;
		gchar* _tmp3_;
		ClocksUtilsWallClock* _tmp4_;
		GDateTime* _tmp5_;
		GDateTime* _tmp6_;
		gint _tmp7_ = 0;
		ClocksUtilsWallClock* _tmp8_;
		GDateTime* _tmp9_;
		GDateTime* _tmp10_;
		gint _tmp11_ = 0;
		_tmp1_ = clocks_utils_wall_clock_get_default ();
		wc = _tmp1_;
		_tmp2_ = _ ("Alarm");
		_tmp3_ = g_strdup (_tmp2_);
		_g_free0 (name);
		name = _tmp3_;
		_tmp4_ = wc;
		_tmp5_ = clocks_utils_wall_clock_get_date_time (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = g_date_time_get_hour (_tmp6_);
		hour = _tmp7_;
		_tmp8_ = wc;
		_tmp9_ = clocks_utils_wall_clock_get_date_time (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = g_date_time_get_minute (_tmp10_);
		minute = _tmp11_;
		days = NULL;
		active = TRUE;
		_g_object_unref0 (wc);
	} else {
		ClocksAlarmItem* _tmp12_;
		const gchar* _tmp13_;
		const gchar* _tmp14_;
		gchar* _tmp15_;
		ClocksAlarmItem* _tmp16_;
		gint _tmp17_;
		gint _tmp18_;
		ClocksAlarmItem* _tmp19_;
		gint _tmp20_;
		gint _tmp21_;
		ClocksAlarmItem* _tmp22_;
		ClocksUtilsWeekdays* _tmp23_;
		ClocksUtilsWeekdays* _tmp24_;
		ClocksAlarmItem* _tmp25_;
		gboolean _tmp26_;
		gboolean _tmp27_;
		_tmp12_ = alarm;
		_tmp13_ = clocks_content_item_get_name ((ClocksContentItem*) _tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = g_strdup (_tmp14_);
		_g_free0 (name);
		name = _tmp15_;
		_tmp16_ = alarm;
		_tmp17_ = clocks_alarm_item_get_hour (_tmp16_);
		_tmp18_ = _tmp17_;
		hour = _tmp18_;
		_tmp19_ = alarm;
		_tmp20_ = clocks_alarm_item_get_minute (_tmp19_);
		_tmp21_ = _tmp20_;
		minute = _tmp21_;
		_tmp22_ = alarm;
		_tmp23_ = clocks_alarm_item_get_days (_tmp22_);
		_tmp24_ = _tmp23_;
		days = _tmp24_;
		_tmp25_ = alarm;
		_tmp26_ = clocks_alarm_item_get_active (_tmp25_);
		_tmp27_ = _tmp26_;
		active = _tmp27_;
	}
	_tmp28_ = self->priv->format;
	if (_tmp28_ == CLOCKS_UTILS_WALL_CLOCK_FORMAT_TWELVE) {
		gint _tmp29_;
		gint _tmp33_;
		_tmp29_ = hour;
		if (_tmp29_ < 12) {
			ClocksAmPmToggleButton* _tmp30_;
			_tmp30_ = self->priv->am_pm_button;
			clocks_am_pm_toggle_button_set_choice (_tmp30_, CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_AM);
		} else {
			ClocksAmPmToggleButton* _tmp31_;
			gint _tmp32_;
			_tmp31_ = self->priv->am_pm_button;
			clocks_am_pm_toggle_button_set_choice (_tmp31_, CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_PM);
			_tmp32_ = hour;
			hour = _tmp32_ - 12;
		}
		_tmp33_ = hour;
		if (_tmp33_ == 0) {
			hour = 12;
		}
	}
	_tmp34_ = self->priv->h_spinbutton;
	_tmp35_ = hour;
	gtk_spin_button_set_value (_tmp34_, (gdouble) _tmp35_);
	_tmp36_ = self->priv->m_spinbutton;
	_tmp37_ = minute;
	gtk_spin_button_set_value (_tmp36_, (gdouble) _tmp37_);
	_tmp38_ = self->priv->name_entry;
	_tmp39_ = name;
	gtk_entry_set_text (_tmp38_, _tmp39_);
	_tmp40_ = days;
	if (_tmp40_ != NULL) {
		{
			gint i;
			i = 0;
			{
				gboolean _tmp41_;
				_tmp41_ = TRUE;
				while (TRUE) {
					gboolean _tmp42_;
					gint _tmp44_;
					GtkToggleButton** _tmp45_;
					gint _tmp45__length1;
					gint _tmp46_;
					GtkToggleButton* _tmp47_;
					ClocksUtilsWeekdays* _tmp48_;
					gint _tmp49_;
					gboolean _tmp50_ = FALSE;
					_tmp42_ = _tmp41_;
					if (!_tmp42_) {
						gint _tmp43_;
						_tmp43_ = i;
						i = _tmp43_ + 1;
					}
					_tmp41_ = FALSE;
					_tmp44_ = i;
					if (!(_tmp44_ < 7)) {
						break;
					}
					_tmp45_ = self->priv->day_buttons;
					_tmp45__length1 = self->priv->day_buttons_length1;
					_tmp46_ = i;
					_tmp47_ = _tmp45_[_tmp46_];
					_tmp48_ = days;
					_tmp49_ = i;
					_tmp50_ = clocks_utils_weekdays_get (_tmp48_, (ClocksUtilsWeekdaysDay) _tmp49_);
					gtk_toggle_button_set_active (_tmp47_, _tmp50_);
				}
			}
		}
	}
	_tmp51_ = self->priv->active_switch;
	_tmp52_ = active;
	gtk_switch_set_active (_tmp51_, _tmp52_);
	_g_free0 (name);
}


void clocks_alarm_setup_dialog_apply_to_alarm (ClocksAlarmSetupDialog* self, ClocksAlarmItem* alarm) {
	GtkEntry* _tmp0_;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_;
	gchar* name;
	GtkSwitch* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	gboolean active;
	GtkSpinButton* _tmp6_;
	gint _tmp7_ = 0;
	gint hour;
	GtkSpinButton* _tmp8_;
	gint _tmp9_ = 0;
	gint minute;
	ClocksUtilsWallClockFormat _tmp10_;
	ClocksAlarmItem* _tmp23_;
	const gchar* _tmp24_;
	ClocksAlarmItem* _tmp25_;
	gboolean _tmp26_;
	ClocksAlarmItem* _tmp27_;
	gint _tmp28_;
	ClocksAlarmItem* _tmp29_;
	gint _tmp30_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (alarm != NULL);
	_tmp0_ = self->priv->name_entry;
	_tmp1_ = gtk_entry_get_text (_tmp0_);
	_tmp2_ = g_strdup (_tmp1_);
	name = _tmp2_;
	_tmp3_ = self->priv->active_switch;
	_tmp4_ = gtk_switch_get_active (_tmp3_);
	_tmp5_ = _tmp4_;
	active = _tmp5_;
	_tmp6_ = self->priv->h_spinbutton;
	_tmp7_ = gtk_spin_button_get_value_as_int (_tmp6_);
	hour = _tmp7_;
	_tmp8_ = self->priv->m_spinbutton;
	_tmp9_ = gtk_spin_button_get_value_as_int (_tmp8_);
	minute = _tmp9_;
	_tmp10_ = self->priv->format;
	if (_tmp10_ == CLOCKS_UTILS_WALL_CLOCK_FORMAT_TWELVE) {
		ClocksAmPmToggleButton* _tmp11_;
		ClocksAmPmToggleButtonAmPm _tmp12_;
		ClocksAmPmToggleButtonAmPm _tmp13_;
		ClocksAmPmToggleButtonAmPm choice;
		gboolean _tmp14_ = FALSE;
		ClocksAmPmToggleButtonAmPm _tmp15_;
		gboolean _tmp17_;
		_tmp11_ = self->priv->am_pm_button;
		_tmp12_ = clocks_am_pm_toggle_button_get_choice (_tmp11_);
		_tmp13_ = _tmp12_;
		choice = _tmp13_;
		_tmp15_ = choice;
		if (_tmp15_ == CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_AM) {
			gint _tmp16_;
			_tmp16_ = hour;
			_tmp14_ = _tmp16_ == 12;
		} else {
			_tmp14_ = FALSE;
		}
		_tmp17_ = _tmp14_;
		if (_tmp17_) {
			hour = 0;
		} else {
			gboolean _tmp18_ = FALSE;
			ClocksAmPmToggleButtonAmPm _tmp19_;
			gboolean _tmp21_;
			_tmp19_ = choice;
			if (_tmp19_ == CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_PM) {
				gint _tmp20_;
				_tmp20_ = hour;
				_tmp18_ = _tmp20_ != 12;
			} else {
				_tmp18_ = FALSE;
			}
			_tmp21_ = _tmp18_;
			if (_tmp21_) {
				gint _tmp22_;
				_tmp22_ = hour;
				hour = _tmp22_ + 12;
			}
		}
	}
	_tmp23_ = alarm;
	_tmp24_ = name;
	clocks_content_item_set_name ((ClocksContentItem*) _tmp23_, _tmp24_);
	_tmp25_ = alarm;
	_tmp26_ = active;
	clocks_alarm_item_set_active (_tmp25_, _tmp26_);
	_tmp27_ = alarm;
	_tmp28_ = hour;
	clocks_alarm_item_set_hour (_tmp27_, _tmp28_);
	_tmp29_ = alarm;
	_tmp30_ = minute;
	clocks_alarm_item_set_minute (_tmp29_, _tmp30_);
	{
		gint i;
		i = 0;
		{
			gboolean _tmp31_;
			_tmp31_ = TRUE;
			while (TRUE) {
				gboolean _tmp32_;
				gint _tmp34_;
				ClocksAlarmItem* _tmp35_;
				ClocksUtilsWeekdays* _tmp36_;
				ClocksUtilsWeekdays* _tmp37_;
				gint _tmp38_;
				GtkToggleButton** _tmp39_;
				gint _tmp39__length1;
				gint _tmp40_;
				GtkToggleButton* _tmp41_;
				gboolean _tmp42_;
				gboolean _tmp43_;
				_tmp32_ = _tmp31_;
				if (!_tmp32_) {
					gint _tmp33_;
					_tmp33_ = i;
					i = _tmp33_ + 1;
				}
				_tmp31_ = FALSE;
				_tmp34_ = i;
				if (!(_tmp34_ < 7)) {
					break;
				}
				_tmp35_ = alarm;
				_tmp36_ = clocks_alarm_item_get_days (_tmp35_);
				_tmp37_ = _tmp36_;
				_tmp38_ = i;
				_tmp39_ = self->priv->day_buttons;
				_tmp39__length1 = self->priv->day_buttons_length1;
				_tmp40_ = i;
				_tmp41_ = _tmp39_[_tmp40_];
				_tmp42_ = gtk_toggle_button_get_active (_tmp41_);
				_tmp43_ = _tmp42_;
				clocks_utils_weekdays_set (_tmp37_, (ClocksUtilsWeekdaysDay) _tmp38_, _tmp43_);
			}
		}
	}
	_g_free0 (name);
}


static gboolean clocks_alarm_setup_dialog_show_leading_zeros (ClocksAlarmSetupDialog* self, GtkSpinButton* spin_button) {
	gboolean result = FALSE;
	GtkSpinButton* _tmp0_;
	GtkSpinButton* _tmp1_;
	gint _tmp2_ = 0;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (spin_button != NULL, FALSE);
	_tmp0_ = spin_button;
	_tmp1_ = spin_button;
	_tmp2_ = gtk_spin_button_get_value_as_int (_tmp1_);
	_tmp3_ = g_strdup_printf ("%02i", _tmp2_);
	_tmp4_ = _tmp3_;
	gtk_entry_set_text ((GtkEntry*) _tmp0_, _tmp4_);
	_g_free0 (_tmp4_);
	result = TRUE;
	return result;
}


static void clocks_alarm_setup_dialog_class_init (ClocksAlarmSetupDialogClass * klass) {
	clocks_alarm_setup_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ClocksAlarmSetupDialogPrivate));
	G_OBJECT_CLASS (klass)->finalize = clocks_alarm_setup_dialog_finalize;
}


static void clocks_alarm_setup_dialog_instance_init (ClocksAlarmSetupDialog * self) {
	self->priv = CLOCKS_ALARM_SETUP_DIALOG_GET_PRIVATE (self);
}


static void clocks_alarm_setup_dialog_finalize (GObject* obj) {
	ClocksAlarmSetupDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_ALARM_TYPE_SETUP_DIALOG, ClocksAlarmSetupDialog);
	_g_object_unref0 (self->priv->h_spinbutton);
	_g_object_unref0 (self->priv->m_spinbutton);
	_g_object_unref0 (self->priv->name_entry);
	_g_object_unref0 (self->priv->am_pm_button);
	self->priv->day_buttons = (_vala_array_free (self->priv->day_buttons, self->priv->day_buttons_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (self->priv->active_switch);
	G_OBJECT_CLASS (clocks_alarm_setup_dialog_parent_class)->finalize (obj);
}


GType clocks_alarm_setup_dialog_get_type (void) {
	static volatile gsize clocks_alarm_setup_dialog_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_alarm_setup_dialog_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ClocksAlarmSetupDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_alarm_setup_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksAlarmSetupDialog), 0, (GInstanceInitFunc) clocks_alarm_setup_dialog_instance_init, NULL };
		GType clocks_alarm_setup_dialog_type_id;
		clocks_alarm_setup_dialog_type_id = g_type_register_static (GTK_TYPE_DIALOG, "ClocksAlarmSetupDialog", &g_define_type_info, 0);
		g_once_init_leave (&clocks_alarm_setup_dialog_type_id__volatile, clocks_alarm_setup_dialog_type_id);
	}
	return clocks_alarm_setup_dialog_type_id__volatile;
}


static void __lambda33_ (ClocksAlarmRingingPanel* self) {
	ClocksAlarmItem* _tmp0_;
	ClocksAlarmItem* _tmp1_;
	_tmp0_ = clocks_alarm_ringing_panel_get_alarm (self);
	_tmp1_ = _tmp0_;
	clocks_alarm_item_stop (_tmp1_);
}


static void ___lambda33__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda33_ (self);
}


static void __lambda35_ (ClocksAlarmRingingPanel* self) {
	ClocksAlarmItem* _tmp0_;
	ClocksAlarmItem* _tmp1_;
	_tmp0_ = clocks_alarm_ringing_panel_get_alarm (self);
	_tmp1_ = _tmp0_;
	clocks_alarm_item_snooze (_tmp1_);
}


static void ___lambda35__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda35_ (self);
}


ClocksAlarmRingingPanel* clocks_alarm_ringing_panel_construct (GType object_type) {
	ClocksAlarmRingingPanel * self = NULL;
	GtkStyleContext* _tmp0_ = NULL;
	GtkStyleContext* _tmp1_ = NULL;
	GtkBuilder* _tmp2_ = NULL;
	GtkBuilder* builder;
	GObject* _tmp3_ = NULL;
	GtkGrid* _tmp4_;
	GtkGrid* grid;
	GObject* _tmp5_ = NULL;
	GtkLabel* _tmp6_;
	GObject* _tmp7_ = NULL;
	GtkButton* _tmp8_;
	GObject* _tmp9_ = NULL;
	GtkButton* _tmp10_;
	GtkButton* _tmp11_;
	GtkButton* _tmp12_;
	self = (ClocksAlarmRingingPanel*) g_object_new (object_type, NULL);
	_tmp0_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_add_class (_tmp0_, "view");
	_tmp1_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_add_class (_tmp1_, "content-view");
	_tmp2_ = clocks_utils_load_ui ("alarm.ui");
	builder = _tmp2_;
	_tmp3_ = gtk_builder_get_object (builder, "ringing_panel");
	_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, GTK_TYPE_GRID) ? ((GtkGrid*) _tmp3_) : NULL);
	grid = _tmp4_;
	_tmp5_ = gtk_builder_get_object (builder, "time_label");
	_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, GTK_TYPE_LABEL) ? ((GtkLabel*) _tmp5_) : NULL);
	_g_object_unref0 (self->priv->time_label);
	self->priv->time_label = _tmp6_;
	_tmp7_ = gtk_builder_get_object (builder, "stop_button");
	_tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, GTK_TYPE_BUTTON) ? ((GtkButton*) _tmp7_) : NULL);
	_g_object_unref0 (self->priv->stop_button);
	self->priv->stop_button = _tmp8_;
	_tmp9_ = gtk_builder_get_object (builder, "snooze_button");
	_tmp10_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, GTK_TYPE_BUTTON) ? ((GtkButton*) _tmp9_) : NULL);
	_g_object_unref0 (self->priv->snooze_button);
	self->priv->snooze_button = _tmp10_;
	_tmp11_ = self->priv->stop_button;
	g_signal_connect_object (_tmp11_, "clicked", (GCallback) ___lambda33__gtk_button_clicked, self, 0);
	_tmp12_ = self->priv->snooze_button;
	g_signal_connect_object (_tmp12_, "clicked", (GCallback) ___lambda35__gtk_button_clicked, self, 0);
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) grid);
	_g_object_unref0 (grid);
	_g_object_unref0 (builder);
	return self;
}


ClocksAlarmRingingPanel* clocks_alarm_ringing_panel_new (void) {
	return clocks_alarm_ringing_panel_construct (CLOCKS_ALARM_TYPE_RINGING_PANEL);
}


void clocks_alarm_ringing_panel_update (ClocksAlarmRingingPanel* self) {
	ClocksAlarmItem* _tmp0_;
	ClocksAlarmItem* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = clocks_alarm_ringing_panel_get_alarm (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		ClocksAlarmItem* _tmp2_;
		ClocksAlarmItem* _tmp3_;
		ClocksAlarmItemState _tmp4_;
		ClocksAlarmItemState _tmp5_;
		_tmp2_ = clocks_alarm_ringing_panel_get_alarm (self);
		_tmp3_ = _tmp2_;
		_tmp4_ = clocks_alarm_item_get_state (_tmp3_);
		_tmp5_ = _tmp4_;
		if (_tmp5_ == CLOCKS_ALARM_ITEM_STATE_SNOOZING) {
			GtkLabel* _tmp6_;
			ClocksAlarmItem* _tmp7_;
			ClocksAlarmItem* _tmp8_;
			gchar* _tmp9_;
			gchar* _tmp10_;
			gchar* _tmp11_;
			_tmp6_ = self->priv->time_label;
			_tmp7_ = clocks_alarm_ringing_panel_get_alarm (self);
			_tmp8_ = _tmp7_;
			_tmp9_ = clocks_alarm_item_get_snooze_time_label (_tmp8_);
			_tmp10_ = _tmp9_;
			_tmp11_ = _tmp10_;
			gtk_label_set_text (_tmp6_, _tmp11_);
			_g_free0 (_tmp11_);
		} else {
			GtkLabel* _tmp12_;
			ClocksAlarmItem* _tmp13_;
			ClocksAlarmItem* _tmp14_;
			gchar* _tmp15_;
			gchar* _tmp16_;
			gchar* _tmp17_;
			_tmp12_ = self->priv->time_label;
			_tmp13_ = clocks_alarm_ringing_panel_get_alarm (self);
			_tmp14_ = _tmp13_;
			_tmp15_ = clocks_alarm_item_get_time_label (_tmp14_);
			_tmp16_ = _tmp15_;
			_tmp17_ = _tmp16_;
			gtk_label_set_text (_tmp12_, _tmp17_);
			_g_free0 (_tmp17_);
		}
	}
}


ClocksAlarmItem* clocks_alarm_ringing_panel_get_alarm (ClocksAlarmRingingPanel* self) {
	ClocksAlarmItem* result;
	ClocksAlarmItem* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_alarm;
	result = _tmp0_;
	return result;
}


static void _clocks_alarm_ringing_panel_alarm____lambda34_ (ClocksAlarmRingingPanel* self) {
	ClocksAlarmItem* _tmp0_;
	ClocksAlarmItem* _tmp1_;
	ClocksAlarmItemState _tmp2_;
	ClocksAlarmItemState _tmp3_;
	_tmp0_ = clocks_alarm_ringing_panel_get_alarm (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = clocks_alarm_item_get_state (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != CLOCKS_ALARM_ITEM_STATE_RINGING) {
		g_signal_emit_by_name (self, "dismiss");
	}
}


static void __clocks_alarm_ringing_panel_alarm____lambda34__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	_clocks_alarm_ringing_panel_alarm____lambda34_ (self);
}


void clocks_alarm_ringing_panel_set_alarm (ClocksAlarmRingingPanel* self, ClocksAlarmItem* value) {
	ClocksAlarmItem* _tmp0_;
	ClocksAlarmItem* _tmp3_;
	ClocksAlarmItem* _tmp4_;
	ClocksAlarmItem* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_alarm;
	if (_tmp0_ != NULL) {
		ClocksAlarmItem* _tmp1_;
		gulong _tmp2_;
		_tmp1_ = self->priv->_alarm;
		_tmp2_ = self->priv->alarm_state_handler;
		g_signal_handler_disconnect ((GObject*) _tmp1_, _tmp2_);
	}
	_tmp3_ = value;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (self->priv->_alarm);
	self->priv->_alarm = _tmp4_;
	_tmp5_ = self->priv->_alarm;
	if (_tmp5_ != NULL) {
		ClocksAlarmItem* _tmp6_;
		gulong _tmp7_ = 0UL;
		_tmp6_ = self->priv->_alarm;
		_tmp7_ = g_signal_connect_object ((GObject*) _tmp6_, "notify::state", (GCallback) __clocks_alarm_ringing_panel_alarm____lambda34__g_object_notify, self, 0);
		self->priv->alarm_state_handler = _tmp7_;
	}
	g_object_notify ((GObject *) self, "alarm");
}


static void clocks_alarm_ringing_panel_real_dismiss (ClocksAlarmRingingPanel* self) {
	clocks_alarm_ringing_panel_set_alarm (self, NULL);
}


static void clocks_alarm_ringing_panel_class_init (ClocksAlarmRingingPanelClass * klass) {
	clocks_alarm_ringing_panel_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ClocksAlarmRingingPanelPrivate));
	CLOCKS_ALARM_RINGING_PANEL_CLASS (klass)->dismiss = clocks_alarm_ringing_panel_real_dismiss;
	G_OBJECT_CLASS (klass)->get_property = _vala_clocks_alarm_ringing_panel_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_clocks_alarm_ringing_panel_set_property;
	G_OBJECT_CLASS (klass)->finalize = clocks_alarm_ringing_panel_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_ALARM_RINGING_PANEL_ALARM, g_param_spec_object ("alarm", "alarm", "alarm", CLOCKS_ALARM_TYPE_ITEM, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_signal_new ("dismiss", CLOCKS_ALARM_TYPE_RINGING_PANEL, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ClocksAlarmRingingPanelClass, dismiss), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}


static void clocks_alarm_ringing_panel_instance_init (ClocksAlarmRingingPanel * self) {
	self->priv = CLOCKS_ALARM_RINGING_PANEL_GET_PRIVATE (self);
}


static void clocks_alarm_ringing_panel_finalize (GObject* obj) {
	ClocksAlarmRingingPanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_ALARM_TYPE_RINGING_PANEL, ClocksAlarmRingingPanel);
	_g_object_unref0 (self->priv->_alarm);
	_g_object_unref0 (self->priv->time_label);
	_g_object_unref0 (self->priv->stop_button);
	_g_object_unref0 (self->priv->snooze_button);
	G_OBJECT_CLASS (clocks_alarm_ringing_panel_parent_class)->finalize (obj);
}


GType clocks_alarm_ringing_panel_get_type (void) {
	static volatile gsize clocks_alarm_ringing_panel_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_alarm_ringing_panel_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ClocksAlarmRingingPanelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_alarm_ringing_panel_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksAlarmRingingPanel), 0, (GInstanceInitFunc) clocks_alarm_ringing_panel_instance_init, NULL };
		GType clocks_alarm_ringing_panel_type_id;
		clocks_alarm_ringing_panel_type_id = g_type_register_static (GTK_TYPE_EVENT_BOX, "ClocksAlarmRingingPanel", &g_define_type_info, 0);
		g_once_init_leave (&clocks_alarm_ringing_panel_type_id__volatile, clocks_alarm_ringing_panel_type_id);
	}
	return clocks_alarm_ringing_panel_type_id__volatile;
}


static void _vala_clocks_alarm_ringing_panel_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ClocksAlarmRingingPanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_ALARM_TYPE_RINGING_PANEL, ClocksAlarmRingingPanel);
	switch (property_id) {
		case CLOCKS_ALARM_RINGING_PANEL_ALARM:
		g_value_set_object (value, clocks_alarm_ringing_panel_get_alarm (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_clocks_alarm_ringing_panel_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	ClocksAlarmRingingPanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_ALARM_TYPE_RINGING_PANEL, ClocksAlarmRingingPanel);
	switch (property_id) {
		case CLOCKS_ALARM_RINGING_PANEL_ALARM:
		clocks_alarm_ringing_panel_set_alarm (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _g_object_unref0_ (gpointer var) {
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}


static void _g_list_free__g_object_unref0_ (GList* self) {
	g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
	g_list_free (self);
}


static Block3Data* block3_data_ref (Block3Data* _data3_) {
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}


static void block3_data_unref (void * _userdata_) {
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		ClocksAlarmMainPanel * self;
		self = _data3_->self;
		_g_object_unref0 (_data3_->header_bar);
		_g_object_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}


static void __lambda36_ (ClocksAlarmMainPanel* self, GObject* item) {
	GObject* _tmp0_;
	ClocksAlarmItem* _tmp1_;
	ClocksAlarmItem* alarm;
	ClocksAlarmItem* _tmp2_;
	ClocksAlarmItemState _tmp3_;
	ClocksAlarmItemState _tmp4_;
	g_return_if_fail (item != NULL);
	_tmp0_ = item;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem));
	alarm = _tmp1_;
	_tmp2_ = alarm;
	_tmp3_ = clocks_alarm_item_get_state (_tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_ == CLOCKS_ALARM_ITEM_STATE_SNOOZING) {
		ClocksAlarmItem* _tmp5_;
		_tmp5_ = alarm;
		clocks_alarm_main_panel_show_ringing_panel (self, _tmp5_);
	} else {
		ClocksAlarmItem* _tmp6_;
		_tmp6_ = alarm;
		clocks_alarm_main_panel_edit (self, _tmp6_);
	}
	_g_object_unref0 (alarm);
}


static void ___lambda36__clocks_content_view_item_activated (ClocksContentView* _sender, GObject* item, gpointer self) {
	__lambda36_ (self, item);
}


static void __lambda39_ (ClocksAlarmMainPanel* self) {
	ClocksContentView* _tmp0_;
	GList* _tmp1_ = NULL;
	_tmp0_ = self->priv->content_view;
	_tmp1_ = clocks_content_view_get_selected_items (_tmp0_);
	{
		GList* i_collection = NULL;
		GList* i_it = NULL;
		i_collection = _tmp1_;
		for (i_it = i_collection; i_it != NULL; i_it = i_it->next) {
			GObject* _tmp2_;
			GObject* i = NULL;
			_tmp2_ = _g_object_ref0 ((GObject*) i_it->data);
			i = _tmp2_;
			{
				GObject* _tmp3_;
				_tmp3_ = i;
				self->priv->alarms = g_list_remove (self->priv->alarms, G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem));
				_g_object_unref0 (i);
			}
		}
		__g_list_free__g_object_unref0_0 (i_collection);
	}
	clocks_alarm_main_panel_save (self);
}


static void ___lambda39__clocks_content_view_delete_selected (ClocksContentView* _sender, gpointer self) {
	__lambda39_ (self);
}


static void __lambda40_ (ClocksAlarmMainPanel* self) {
	ClocksContentView* _tmp0_;
	_tmp0_ = self->priv->content_view;
	gd_stack_set_visible_child ((GdStack*) self, (GtkWidget*) _tmp0_);
}


static void ___lambda40__clocks_alarm_ringing_panel_dismiss (ClocksAlarmRingingPanel* _sender, gpointer self) {
	__lambda40_ (self);
}


static void __lambda41_ (Block3Data* _data3_) {
	ClocksAlarmMainPanel * self;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	ClocksContentView* _tmp2_;
	self = _data3_->self;
	_tmp0_ = gd_stack_get_visible_child ((GdStack*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->content_view;
	if (_tmp1_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GTK_TYPE_WIDGET, GtkWidget)) {
		ClocksHeaderBar* _tmp3_;
		_tmp3_ = _data3_->header_bar;
		clocks_header_bar_set_mode (_tmp3_, CLOCKS_HEADER_BAR_MODE_NORMAL);
	} else {
		GtkWidget* _tmp4_;
		GtkWidget* _tmp5_;
		ClocksAlarmRingingPanel* _tmp6_;
		_tmp4_ = gd_stack_get_visible_child ((GdStack*) self);
		_tmp5_ = _tmp4_;
		_tmp6_ = self->priv->ringing_panel;
		if (_tmp5_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GTK_TYPE_WIDGET, GtkWidget)) {
			ClocksHeaderBar* _tmp7_;
			_tmp7_ = _data3_->header_bar;
			clocks_header_bar_set_mode (_tmp7_, CLOCKS_HEADER_BAR_MODE_STANDALONE);
		}
	}
}


static void ___lambda41__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda41_ (self);
}


static void __lambda42_ (ClocksAlarmMainPanel* self) {
	GList* _tmp0_;
	_tmp0_ = self->priv->alarms;
	{
		GList* a_collection = NULL;
		GList* a_it = NULL;
		a_collection = _tmp0_;
		for (a_it = a_collection; a_it != NULL; a_it = a_it->next) {
			ClocksAlarmItem* _tmp1_;
			ClocksAlarmItem* a = NULL;
			_tmp1_ = _g_object_ref0 ((ClocksAlarmItem*) a_it->data);
			a = _tmp1_;
			{
				ClocksAlarmItem* _tmp2_;
				gboolean _tmp3_ = FALSE;
				_tmp2_ = a;
				_tmp3_ = clocks_alarm_item_tick (_tmp2_);
				if (_tmp3_) {
					ClocksAlarmItem* _tmp4_;
					ClocksAlarmItemState _tmp5_;
					ClocksAlarmItemState _tmp6_;
					_tmp4_ = a;
					_tmp5_ = clocks_alarm_item_get_state (_tmp4_);
					_tmp6_ = _tmp5_;
					if (_tmp6_ == CLOCKS_ALARM_ITEM_STATE_RINGING) {
						ClocksAlarmItem* _tmp7_;
						_tmp7_ = a;
						clocks_alarm_main_panel_show_ringing_panel (self, _tmp7_);
						g_signal_emit_by_name (self, "ring");
					} else {
						ClocksAlarmRingingPanel* _tmp8_;
						ClocksAlarmItem* _tmp9_;
						ClocksAlarmItem* _tmp10_;
						ClocksAlarmItem* _tmp11_;
						_tmp8_ = self->priv->ringing_panel;
						_tmp9_ = clocks_alarm_ringing_panel_get_alarm (_tmp8_);
						_tmp10_ = _tmp9_;
						_tmp11_ = a;
						if (_tmp10_ == _tmp11_) {
							ClocksAlarmRingingPanel* _tmp12_;
							_tmp12_ = self->priv->ringing_panel;
							clocks_alarm_ringing_panel_update (_tmp12_);
						}
					}
				}
				_g_object_unref0 (a);
			}
		}
	}
}


static void ___lambda42__clocks_utils_wall_clock_tick (ClocksUtilsWallClock* _sender, gpointer self) {
	__lambda42_ (self);
}


ClocksAlarmMainPanel* clocks_alarm_main_panel_construct (GType object_type, ClocksHeaderBar* header_bar) {
	ClocksAlarmMainPanel * self = NULL;
	Block3Data* _data3_;
	ClocksHeaderBar* _tmp0_;
	ClocksHeaderBar* _tmp1_;
	const gchar* _tmp2_ = NULL;
	ClocksHeaderBar* _tmp3_;
	GSettings* _tmp4_;
	GdHeaderSimpleButton* _tmp5_;
	GdHeaderSimpleButton* _tmp6_;
	const gchar* _tmp7_ = NULL;
	GdHeaderSimpleButton* _tmp8_;
	GdHeaderSimpleButton* _tmp9_;
	ClocksHeaderBar* _tmp10_;
	GdHeaderSimpleButton* _tmp11_;
	GtkBuilder* _tmp12_ = NULL;
	GtkBuilder* builder;
	GObject* _tmp13_ = NULL;
	GtkWidget* _tmp14_;
	GtkWidget* empty_view;
	ClocksHeaderBar* _tmp15_;
	ClocksContentView* _tmp16_;
	ClocksContentView* _tmp17_;
	ClocksContentView* _tmp18_;
	ClocksContentView* _tmp19_;
	ClocksAlarmRingingPanel* _tmp20_;
	ClocksAlarmRingingPanel* _tmp21_;
	ClocksAlarmRingingPanel* _tmp22_;
	ClocksContentView* _tmp23_;
	ClocksUtilsWallClock* _tmp24_ = NULL;
	ClocksUtilsWallClock* _tmp25_;
	g_return_val_if_fail (header_bar != NULL, NULL);
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	_tmp0_ = header_bar;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data3_->header_bar);
	_data3_->header_bar = _tmp1_;
	_tmp2_ = _ ("Alarm");
	_tmp3_ = _data3_->header_bar;
	self = (ClocksAlarmMainPanel*) g_object_new (object_type, "label", _tmp2_, "header-bar", _tmp3_, NULL);
	_data3_->self = g_object_ref (self);
	__g_list_free__g_object_unref0_0 (self->priv->alarms);
	self->priv->alarms = NULL;
	_tmp4_ = g_settings_new ("org.gnome.clocks");
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp4_;
	_tmp5_ = (GdHeaderSimpleButton*) gd_header_simple_button_new ();
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->priv->new_button);
	self->priv->new_button = _tmp5_;
	_tmp6_ = self->priv->new_button;
	_tmp7_ = _ ("New");
	g_object_set ((GdHeaderButton*) _tmp6_, "label", _tmp7_, NULL);
	_tmp8_ = self->priv->new_button;
	gtk_widget_set_no_show_all ((GtkWidget*) _tmp8_, TRUE);
	_tmp9_ = self->priv->new_button;
	gtk_actionable_set_action_name ((GtkActionable*) _tmp9_, "win.new");
	_tmp10_ = _data3_->header_bar;
	_tmp11_ = self->priv->new_button;
	gd_header_bar_pack_start ((GdHeaderBar*) _tmp10_, (GtkWidget*) _tmp11_);
	_tmp12_ = clocks_utils_load_ui ("alarm.ui");
	builder = _tmp12_;
	_tmp13_ = gtk_builder_get_object (builder, "empty_panel");
	_tmp14_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp13_, GTK_TYPE_WIDGET) ? ((GtkWidget*) _tmp13_) : NULL);
	empty_view = _tmp14_;
	_tmp15_ = _data3_->header_bar;
	_tmp16_ = clocks_content_view_new (empty_view, _tmp15_);
	g_object_ref_sink (_tmp16_);
	_g_object_unref0 (self->priv->content_view);
	self->priv->content_view = _tmp16_;
	_tmp17_ = self->priv->content_view;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp17_);
	_tmp18_ = self->priv->content_view;
	g_signal_connect_object (_tmp18_, "item-activated", (GCallback) ___lambda36__clocks_content_view_item_activated, self, 0);
	_tmp19_ = self->priv->content_view;
	g_signal_connect_object (_tmp19_, "delete-selected", (GCallback) ___lambda39__clocks_content_view_delete_selected, self, 0);
	_tmp20_ = clocks_alarm_ringing_panel_new ();
	g_object_ref_sink (_tmp20_);
	_g_object_unref0 (self->priv->ringing_panel);
	self->priv->ringing_panel = _tmp20_;
	_tmp21_ = self->priv->ringing_panel;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp21_);
	_tmp22_ = self->priv->ringing_panel;
	g_signal_connect_object (_tmp22_, "dismiss", (GCallback) ___lambda40__clocks_alarm_ringing_panel_dismiss, self, 0);
	clocks_alarm_main_panel_load (self);
	g_signal_connect_data ((GObject*) self, "notify::visible-child", (GCallback) ___lambda41__g_object_notify, block3_data_ref (_data3_), (GClosureNotify) block3_data_unref, 0);
	_tmp23_ = self->priv->content_view;
	gd_stack_set_visible_child ((GdStack*) self, (GtkWidget*) _tmp23_);
	gtk_widget_show_all ((GtkWidget*) self);
	_tmp24_ = clocks_utils_wall_clock_get_default ();
	_tmp25_ = _tmp24_;
	g_signal_connect_object (_tmp25_, "tick", (GCallback) ___lambda42__clocks_utils_wall_clock_tick, self, 0);
	_g_object_unref0 (_tmp25_);
	_g_object_unref0 (empty_view);
	_g_object_unref0 (builder);
	block3_data_unref (_data3_);
	_data3_ = NULL;
	return self;
}


ClocksAlarmMainPanel* clocks_alarm_main_panel_new (ClocksHeaderBar* header_bar) {
	return clocks_alarm_main_panel_construct (CLOCKS_ALARM_TYPE_MAIN_PANEL, header_bar);
}


static void clocks_alarm_main_panel_load (ClocksAlarmMainPanel* self) {
	g_return_if_fail (self != NULL);
	{
		GSettings* _tmp0_;
		GVariant* _tmp1_ = NULL;
		GVariant* _tmp2_;
		GVariantIter* _tmp3_ = NULL;
		GVariantIter* _tmp4_;
		GVariantIter* _a_it;
		GVariant* a = NULL;
		_tmp0_ = self->priv->settings;
		_tmp1_ = g_settings_get_value (_tmp0_, "alarms");
		_tmp2_ = _tmp1_;
		_tmp3_ = g_variant_iter_new (_tmp2_);
		_tmp4_ = _tmp3_;
		_g_variant_unref0 (_tmp2_);
		_a_it = _tmp4_;
		while (TRUE) {
			GVariantIter* _tmp5_;
			GVariant* _tmp6_ = NULL;
			GVariant* _tmp7_;
			GVariant* _tmp8_;
			ClocksAlarmItem* _tmp9_ = NULL;
			ClocksAlarmItem* alarm;
			ClocksAlarmItem* _tmp10_;
			_tmp5_ = _a_it;
			_tmp6_ = g_variant_iter_next_value (_tmp5_);
			_g_variant_unref0 (a);
			a = _tmp6_;
			_tmp7_ = a;
			if (!(_tmp7_ != NULL)) {
				break;
			}
			_tmp8_ = a;
			_tmp9_ = clocks_alarm_item_deserialize (_tmp8_);
			alarm = _tmp9_;
			_tmp10_ = alarm;
			if (_tmp10_ != NULL) {
				ClocksAlarmItem* _tmp11_;
				ClocksAlarmItem* _tmp12_;
				ClocksContentView* _tmp13_;
				ClocksAlarmItem* _tmp14_;
				_tmp11_ = alarm;
				_tmp12_ = _g_object_ref0 (_tmp11_);
				self->priv->alarms = g_list_prepend (self->priv->alarms, _tmp12_);
				_tmp13_ = self->priv->content_view;
				_tmp14_ = alarm;
				clocks_content_view_add_item (_tmp13_, (ClocksContentItem*) _tmp14_);
			}
			_g_object_unref0 (alarm);
		}
		_g_variant_unref0 (a);
		_g_variant_iter_free0 (_a_it);
	}
	self->priv->alarms = g_list_reverse (self->priv->alarms);
}


static void clocks_alarm_main_panel_save (ClocksAlarmMainPanel* self) {
	GVariantType* _tmp0_;
	GVariantType* _tmp1_;
	GVariantBuilder* _tmp2_;
	GVariantBuilder* _tmp3_;
	GVariantBuilder* builder;
	GList* _tmp4_;
	GSettings* _tmp8_;
	GVariantBuilder* _tmp9_;
	GVariant* _tmp10_ = NULL;
	GVariant* _tmp11_;
	g_return_if_fail (self != 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->alarms;
	{
		GList* i_collection = NULL;
		GList* i_it = NULL;
		i_collection = _tmp4_;
		for (i_it = i_collection; i_it != NULL; i_it = i_it->next) {
			ClocksAlarmItem* _tmp5_;
			ClocksAlarmItem* i = NULL;
			_tmp5_ = _g_object_ref0 ((ClocksAlarmItem*) i_it->data);
			i = _tmp5_;
			{
				ClocksAlarmItem* _tmp6_;
				GVariantBuilder* _tmp7_;
				_tmp6_ = i;
				_tmp7_ = builder;
				clocks_alarm_item_serialize (_tmp6_, _tmp7_);
				_g_object_unref0 (i);
			}
		}
	}
	_tmp8_ = self->priv->settings;
	_tmp9_ = builder;
	_tmp10_ = g_variant_builder_end (_tmp9_);
	g_variant_ref_sink (_tmp10_);
	_tmp11_ = _tmp10_;
	g_settings_set_value (_tmp8_, "alarms", _tmp11_);
	_g_variant_unref0 (_tmp11_);
	_g_variant_builder_unref0 (builder);
}


static Block4Data* block4_data_ref (Block4Data* _data4_) {
	g_atomic_int_inc (&_data4_->_ref_count_);
	return _data4_;
}


static void block4_data_unref (void * _userdata_) {
	Block4Data* _data4_;
	_data4_ = (Block4Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
		ClocksAlarmMainPanel * self;
		self = _data4_->self;
		_g_object_unref0 (_data4_->alarm);
		_g_object_unref0 (self);
		g_slice_free (Block4Data, _data4_);
	}
}


static void __lambda38_ (Block4Data* _data4_, GtkDialog* dialog, gint response) {
	ClocksAlarmMainPanel * self;
	gint _tmp0_;
	GtkDialog* _tmp5_;
	self = _data4_->self;
	g_return_if_fail (dialog != NULL);
	_tmp0_ = response;
	if (_tmp0_ == 1) {
		GtkDialog* _tmp1_;
		ClocksAlarmItem* _tmp2_;
		ClocksAlarmItem* _tmp3_;
		_tmp1_ = dialog;
		_tmp2_ = _data4_->alarm;
		clocks_alarm_setup_dialog_apply_to_alarm (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, CLOCKS_ALARM_TYPE_SETUP_DIALOG, ClocksAlarmSetupDialog), _tmp2_);
		_tmp3_ = _data4_->alarm;
		clocks_alarm_item_reset (_tmp3_);
		clocks_alarm_main_panel_save (self);
	} else {
		ClocksAlarmItem* _tmp4_;
		_tmp4_ = _data4_->alarm;
		clocks_alarm_item_set_active (_tmp4_, _data4_->saved_active);
	}
	_tmp5_ = dialog;
	gtk_widget_destroy ((GtkWidget*) _tmp5_);
}


static void ___lambda38__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
	__lambda38_ (self, _sender, response_id);
}


static void clocks_alarm_main_panel_edit (ClocksAlarmMainPanel* self, ClocksAlarmItem* alarm) {
	Block4Data* _data4_;
	ClocksAlarmItem* _tmp0_;
	ClocksAlarmItem* _tmp1_;
	GtkWidget* _tmp2_ = NULL;
	ClocksAlarmItem* _tmp3_;
	ClocksAlarmSetupDialog* _tmp4_;
	ClocksAlarmSetupDialog* dialog;
	ClocksAlarmItem* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	ClocksAlarmItem* _tmp8_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (alarm != NULL);
	_data4_ = g_slice_new0 (Block4Data);
	_data4_->_ref_count_ = 1;
	_data4_->self = g_object_ref (self);
	_tmp0_ = alarm;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data4_->alarm);
	_data4_->alarm = _tmp1_;
	_tmp2_ = gtk_widget_get_toplevel ((GtkWidget*) self);
	_tmp3_ = _data4_->alarm;
	_tmp4_ = clocks_alarm_setup_dialog_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GTK_TYPE_WINDOW, GtkWindow), _tmp3_);
	g_object_ref_sink (_tmp4_);
	dialog = _tmp4_;
	_tmp5_ = _data4_->alarm;
	_tmp6_ = clocks_alarm_item_get_active (_tmp5_);
	_tmp7_ = _tmp6_;
	_data4_->saved_active = _tmp7_;
	_tmp8_ = _data4_->alarm;
	clocks_alarm_item_set_active (_tmp8_, FALSE);
	g_signal_connect_data ((GtkDialog*) dialog, "response", (GCallback) ___lambda38__gtk_dialog_response, block4_data_ref (_data4_), (GClosureNotify) block4_data_unref, 0);
	gtk_widget_show_all ((GtkWidget*) dialog);
	_g_object_unref0 (dialog);
	block4_data_unref (_data4_);
	_data4_ = NULL;
}


static void clocks_alarm_main_panel_show_ringing_panel (ClocksAlarmMainPanel* self, ClocksAlarmItem* alarm) {
	ClocksAlarmRingingPanel* _tmp0_;
	ClocksAlarmItem* _tmp1_;
	ClocksAlarmRingingPanel* _tmp2_;
	ClocksAlarmRingingPanel* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (alarm != NULL);
	_tmp0_ = self->priv->ringing_panel;
	_tmp1_ = alarm;
	clocks_alarm_ringing_panel_set_alarm (_tmp0_, _tmp1_);
	_tmp2_ = self->priv->ringing_panel;
	clocks_alarm_ringing_panel_update (_tmp2_);
	_tmp3_ = self->priv->ringing_panel;
	gd_stack_set_visible_child ((GdStack*) self, (GtkWidget*) _tmp3_);
}


static void __lambda43_ (ClocksAlarmMainPanel* self, GtkDialog* dialog, gint response) {
	gint _tmp0_;
	GtkDialog* _tmp9_;
	g_return_if_fail (dialog != NULL);
	_tmp0_ = response;
	if (_tmp0_ == 1) {
		ClocksAlarmItem* _tmp1_;
		ClocksAlarmItem* alarm;
		GtkDialog* _tmp2_;
		ClocksAlarmItem* _tmp3_;
		ClocksAlarmItem* _tmp4_;
		ClocksAlarmItem* _tmp5_;
		ClocksContentView* _tmp6_;
		ClocksAlarmItem* _tmp7_;
		ClocksAlarmItem* _tmp8_;
		_tmp1_ = clocks_alarm_item_new ();
		alarm = _tmp1_;
		_tmp2_ = dialog;
		_tmp3_ = alarm;
		clocks_alarm_setup_dialog_apply_to_alarm (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, CLOCKS_ALARM_TYPE_SETUP_DIALOG, ClocksAlarmSetupDialog), _tmp3_);
		_tmp4_ = alarm;
		_tmp5_ = _g_object_ref0 (_tmp4_);
		self->priv->alarms = g_list_append (self->priv->alarms, _tmp5_);
		_tmp6_ = self->priv->content_view;
		_tmp7_ = alarm;
		clocks_content_view_add_item (_tmp6_, (ClocksContentItem*) _tmp7_);
		_tmp8_ = alarm;
		clocks_alarm_item_reset (_tmp8_);
		clocks_alarm_main_panel_save (self);
		_g_object_unref0 (alarm);
	}
	_tmp9_ = dialog;
	gtk_widget_destroy ((GtkWidget*) _tmp9_);
}


static void ___lambda43__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
	__lambda43_ (self, _sender, response_id);
}


static void clocks_alarm_main_panel_real_activate_new (ClocksClock* base) {
	ClocksAlarmMainPanel * self;
	GtkWidget* _tmp0_ = NULL;
	ClocksAlarmSetupDialog* _tmp1_;
	ClocksAlarmSetupDialog* dialog;
	self = (ClocksAlarmMainPanel*) base;
	_tmp0_ = gtk_widget_get_toplevel ((GtkWidget*) self);
	_tmp1_ = clocks_alarm_setup_dialog_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GTK_TYPE_WINDOW, GtkWindow), NULL);
	g_object_ref_sink (_tmp1_);
	dialog = _tmp1_;
	g_signal_connect_object ((GtkDialog*) dialog, "response", (GCallback) ___lambda43__gtk_dialog_response, self, 0);
	gtk_widget_show_all ((GtkWidget*) dialog);
	_g_object_unref0 (dialog);
}


static void clocks_alarm_main_panel_real_activate_select_all (ClocksClock* base) {
	ClocksAlarmMainPanel * self;
	ClocksContentView* _tmp0_;
	self = (ClocksAlarmMainPanel*) base;
	_tmp0_ = self->priv->content_view;
	clocks_content_view_select_all (_tmp0_);
}


static void clocks_alarm_main_panel_real_activate_select_none (ClocksClock* base) {
	ClocksAlarmMainPanel * self;
	ClocksContentView* _tmp0_;
	self = (ClocksAlarmMainPanel*) base;
	_tmp0_ = self->priv->content_view;
	clocks_content_view_unselect_all (_tmp0_);
}


static gboolean clocks_alarm_main_panel_real_escape_pressed (ClocksClock* base) {
	ClocksAlarmMainPanel * self;
	gboolean result = FALSE;
	ClocksContentView* _tmp0_;
	gboolean _tmp1_ = FALSE;
	self = (ClocksAlarmMainPanel*) base;
	_tmp0_ = self->priv->content_view;
	_tmp1_ = clocks_content_view_escape_pressed (_tmp0_);
	result = _tmp1_;
	return result;
}


static void clocks_alarm_main_panel_real_update_header_bar (ClocksClock* base) {
	ClocksAlarmMainPanel * self;
	ClocksHeaderBar* _tmp0_;
	ClocksHeaderBar* _tmp1_;
	ClocksHeaderBarMode _tmp2_;
	ClocksHeaderBarMode _tmp3_;
	self = (ClocksAlarmMainPanel*) base;
	_tmp0_ = clocks_clock_get_header_bar ((ClocksClock*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = clocks_header_bar_get_mode (_tmp1_);
	_tmp3_ = _tmp2_;
	switch (_tmp3_) {
		case CLOCKS_HEADER_BAR_MODE_NORMAL:
		{
			GdHeaderSimpleButton* _tmp4_;
			ClocksContentView* _tmp5_;
			_tmp4_ = self->priv->new_button;
			gtk_widget_show ((GtkWidget*) _tmp4_);
			_tmp5_ = self->priv->content_view;
			clocks_content_view_update_header_bar (_tmp5_);
			break;
		}
		case CLOCKS_HEADER_BAR_MODE_SELECTION:
		{
			ClocksContentView* _tmp6_;
			_tmp6_ = self->priv->content_view;
			clocks_content_view_update_header_bar (_tmp6_);
			break;
		}
		case CLOCKS_HEADER_BAR_MODE_STANDALONE:
		{
			ClocksHeaderBar* _tmp7_;
			ClocksHeaderBar* _tmp8_;
			ClocksAlarmRingingPanel* _tmp9_;
			ClocksAlarmItem* _tmp10_;
			ClocksAlarmItem* _tmp11_;
			const gchar* _tmp12_;
			const gchar* _tmp13_;
			gchar* _tmp14_ = NULL;
			gchar* _tmp15_;
			_tmp7_ = clocks_clock_get_header_bar ((ClocksClock*) self);
			_tmp8_ = _tmp7_;
			_tmp9_ = self->priv->ringing_panel;
			_tmp10_ = clocks_alarm_ringing_panel_get_alarm (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = clocks_content_item_get_name ((ClocksContentItem*) _tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = g_markup_escape_text (_tmp13_, (gssize) (-1));
			_tmp15_ = _tmp14_;
			gd_header_bar_set_title ((GdHeaderBar*) _tmp8_, _tmp15_);
			_g_free0 (_tmp15_);
			break;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}


static const gchar* clocks_alarm_main_panel_real_get_label (ClocksClock* base) {
	const gchar* result;
	ClocksAlarmMainPanel* self;
	const gchar* _tmp0_;
	self = (ClocksAlarmMainPanel*) base;
	_tmp0_ = self->priv->_label;
	result = _tmp0_;
	return result;
}


static void clocks_alarm_main_panel_real_set_label (ClocksClock* base, const gchar* value) {
	ClocksAlarmMainPanel* self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	self = (ClocksAlarmMainPanel*) base;
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_label);
	self->priv->_label = _tmp1_;
	g_object_notify ((GObject *) self, "label");
}


static ClocksHeaderBar* clocks_alarm_main_panel_real_get_header_bar (ClocksClock* base) {
	ClocksHeaderBar* result;
	ClocksAlarmMainPanel* self;
	ClocksHeaderBar* _tmp0_;
	self = (ClocksAlarmMainPanel*) base;
	_tmp0_ = self->priv->_header_bar;
	result = _tmp0_;
	return result;
}


static void clocks_alarm_main_panel_real_set_header_bar (ClocksClock* base, ClocksHeaderBar* value) {
	ClocksAlarmMainPanel* self;
	ClocksHeaderBar* _tmp0_;
	ClocksHeaderBar* _tmp1_;
	self = (ClocksAlarmMainPanel*) base;
	_tmp0_ = value;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_header_bar);
	self->priv->_header_bar = _tmp1_;
	g_object_notify ((GObject *) self, "header-bar");
}


static void clocks_alarm_main_panel_class_init (ClocksAlarmMainPanelClass * klass) {
	clocks_alarm_main_panel_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ClocksAlarmMainPanelPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_clocks_alarm_main_panel_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_clocks_alarm_main_panel_set_property;
	G_OBJECT_CLASS (klass)->finalize = clocks_alarm_main_panel_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_ALARM_MAIN_PANEL_LABEL, g_param_spec_string ("label", "label", "label", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_ALARM_MAIN_PANEL_HEADER_BAR, g_param_spec_object ("header-bar", "header-bar", "header-bar", CLOCKS_TYPE_HEADER_BAR, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_signal_new ("ring", CLOCKS_ALARM_TYPE_MAIN_PANEL, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}


static void clocks_alarm_main_panel_clocks_clock_interface_init (ClocksClockIface * iface) {
	clocks_alarm_main_panel_clocks_clock_parent_iface = g_type_interface_peek_parent (iface);
	iface->activate_new = (void (*)(ClocksClock*)) clocks_alarm_main_panel_real_activate_new;
	iface->activate_select_all = (void (*)(ClocksClock*)) clocks_alarm_main_panel_real_activate_select_all;
	iface->activate_select_none = (void (*)(ClocksClock*)) clocks_alarm_main_panel_real_activate_select_none;
	iface->escape_pressed = (gboolean (*)(ClocksClock*)) clocks_alarm_main_panel_real_escape_pressed;
	iface->update_header_bar = (void (*)(ClocksClock*)) clocks_alarm_main_panel_real_update_header_bar;
	iface->get_label = clocks_alarm_main_panel_real_get_label;
	iface->set_label = clocks_alarm_main_panel_real_set_label;
	iface->get_header_bar = clocks_alarm_main_panel_real_get_header_bar;
	iface->set_header_bar = clocks_alarm_main_panel_real_set_header_bar;
}


static void clocks_alarm_main_panel_instance_init (ClocksAlarmMainPanel * self) {
	self->priv = CLOCKS_ALARM_MAIN_PANEL_GET_PRIVATE (self);
}


static void clocks_alarm_main_panel_finalize (GObject* obj) {
	ClocksAlarmMainPanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_ALARM_TYPE_MAIN_PANEL, ClocksAlarmMainPanel);
	_g_free0 (self->priv->_label);
	_g_object_unref0 (self->priv->_header_bar);
	__g_list_free__g_object_unref0_0 (self->priv->alarms);
	_g_object_unref0 (self->priv->settings);
	_g_object_unref0 (self->priv->new_button);
	_g_object_unref0 (self->priv->content_view);
	_g_object_unref0 (self->priv->ringing_panel);
	G_OBJECT_CLASS (clocks_alarm_main_panel_parent_class)->finalize (obj);
}


GType clocks_alarm_main_panel_get_type (void) {
	static volatile gsize clocks_alarm_main_panel_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_alarm_main_panel_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ClocksAlarmMainPanelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_alarm_main_panel_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksAlarmMainPanel), 0, (GInstanceInitFunc) clocks_alarm_main_panel_instance_init, NULL };
		static const GInterfaceInfo clocks_clock_info = { (GInterfaceInitFunc) clocks_alarm_main_panel_clocks_clock_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType clocks_alarm_main_panel_type_id;
		clocks_alarm_main_panel_type_id = g_type_register_static (gd_stack_get_type (), "ClocksAlarmMainPanel", &g_define_type_info, 0);
		g_type_add_interface_static (clocks_alarm_main_panel_type_id, CLOCKS_TYPE_CLOCK, &clocks_clock_info);
		g_once_init_leave (&clocks_alarm_main_panel_type_id__volatile, clocks_alarm_main_panel_type_id);
	}
	return clocks_alarm_main_panel_type_id__volatile;
}


static void _vala_clocks_alarm_main_panel_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ClocksAlarmMainPanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_ALARM_TYPE_MAIN_PANEL, ClocksAlarmMainPanel);
	switch (property_id) {
		case CLOCKS_ALARM_MAIN_PANEL_LABEL:
		g_value_set_string (value, clocks_clock_get_label ((ClocksClock*) self));
		break;
		case CLOCKS_ALARM_MAIN_PANEL_HEADER_BAR:
		g_value_set_object (value, clocks_clock_get_header_bar ((ClocksClock*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_clocks_alarm_main_panel_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	ClocksAlarmMainPanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_ALARM_TYPE_MAIN_PANEL, ClocksAlarmMainPanel);
	switch (property_id) {
		case CLOCKS_ALARM_MAIN_PANEL_LABEL:
		clocks_clock_set_label ((ClocksClock*) self, g_value_get_string (value));
		break;
		case CLOCKS_ALARM_MAIN_PANEL_HEADER_BAR:
		clocks_clock_set_header_bar ((ClocksClock*) self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


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



