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


#define CLOCKS_ALARM_TYPE_ALARM_TIME (clocks_alarm_alarm_time_get_type ())
typedef struct _ClocksAlarmAlarmTime ClocksAlarmAlarmTime;

#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;
enum  {
	CLOCKS_ALARM_ITEM_0_PROPERTY,
	CLOCKS_ALARM_ITEM_TITLE_ICON_PROPERTY,
	CLOCKS_ALARM_ITEM_SELECTABLE_PROPERTY,
	CLOCKS_ALARM_ITEM_SELECTED_PROPERTY,
	CLOCKS_ALARM_ITEM_ID_PROPERTY,
	CLOCKS_ALARM_ITEM_NAME_PROPERTY,
	CLOCKS_ALARM_ITEM_TIME_PROPERTY,
	CLOCKS_ALARM_ITEM_DAYS_PROPERTY,
	CLOCKS_ALARM_ITEM_STATE_PROPERTY,
	CLOCKS_ALARM_ITEM_TIME_LABEL_PROPERTY,
	CLOCKS_ALARM_ITEM_SNOOZE_TIME_LABEL_PROPERTY,
	CLOCKS_ALARM_ITEM_DAYS_LABEL_PROPERTY,
	CLOCKS_ALARM_ITEM_ACTIVE_PROPERTY,
	CLOCKS_ALARM_ITEM_NUM_PROPERTIES
};
static GParamSpec* clocks_alarm_item_properties[CLOCKS_ALARM_ITEM_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _clocks_utils_weekdays_unref0(var) ((var == NULL) ? NULL : (var = (clocks_utils_weekdays_unref (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_TYPE_APPLICATION (clocks_application_get_type ())
#define CLOCKS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TYPE_APPLICATION, ClocksApplication))
#define CLOCKS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_TYPE_APPLICATION, ClocksApplicationClass))
#define CLOCKS_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TYPE_APPLICATION))
#define CLOCKS_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_TYPE_APPLICATION))
#define CLOCKS_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_TYPE_APPLICATION, ClocksApplicationClass))

typedef struct _ClocksApplication ClocksApplication;
typedef struct _ClocksApplicationClass ClocksApplicationClass;
enum  {
	CLOCKS_ALARM_ITEM_RING_SIGNAL,
	CLOCKS_ALARM_ITEM_NUM_SIGNALS
};
static guint clocks_alarm_item_signals[CLOCKS_ALARM_ITEM_NUM_SIGNALS] = {0};

#define CLOCKS_ALARM_TYPE_TILE (clocks_alarm_tile_get_type ())
#define CLOCKS_ALARM_TILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_ALARM_TYPE_TILE, ClocksAlarmTile))
#define CLOCKS_ALARM_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_ALARM_TYPE_TILE, ClocksAlarmTileClass))
#define CLOCKS_ALARM_IS_TILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_ALARM_TYPE_TILE))
#define CLOCKS_ALARM_IS_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_ALARM_TYPE_TILE))
#define CLOCKS_ALARM_TILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_ALARM_TYPE_TILE, ClocksAlarmTileClass))

typedef struct _ClocksAlarmTile ClocksAlarmTile;
typedef struct _ClocksAlarmTileClass ClocksAlarmTileClass;
typedef struct _ClocksAlarmTilePrivate ClocksAlarmTilePrivate;
enum  {
	CLOCKS_ALARM_TILE_0_PROPERTY,
	CLOCKS_ALARM_TILE_ALARM_PROPERTY,
	CLOCKS_ALARM_TILE_NUM_PROPERTIES
};
static GParamSpec* clocks_alarm_tile_properties[CLOCKS_ALARM_TILE_NUM_PROPERTIES];

#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;
enum  {
	CLOCKS_ALARM_SETUP_DIALOG_0_PROPERTY,
	CLOCKS_ALARM_SETUP_DIALOG_NUM_PROPERTIES
};
static GParamSpec* clocks_alarm_setup_dialog_properties[CLOCKS_ALARM_SETUP_DIALOG_NUM_PROPERTIES];
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))

#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;
enum  {
	CLOCKS_ALARM_RINGING_PANEL_0_PROPERTY,
	CLOCKS_ALARM_RINGING_PANEL_ALARM_PROPERTY,
	CLOCKS_ALARM_RINGING_PANEL_NUM_PROPERTIES
};
static GParamSpec* clocks_alarm_ringing_panel_properties[CLOCKS_ALARM_RINGING_PANEL_NUM_PROPERTIES];
enum  {
	CLOCKS_ALARM_RINGING_PANEL_DISMISS_SIGNAL,
	CLOCKS_ALARM_RINGING_PANEL_NUM_SIGNALS
};
static guint clocks_alarm_ringing_panel_signals[CLOCKS_ALARM_RINGING_PANEL_NUM_SIGNALS] = {0};

#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_TYPE_PANEL_ID (clocks_panel_id_get_type ())

#define CLOCKS_ALARM_TYPE_FACE (clocks_alarm_face_get_type ())
#define CLOCKS_ALARM_FACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_ALARM_TYPE_FACE, ClocksAlarmFace))
#define CLOCKS_ALARM_FACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_ALARM_TYPE_FACE, ClocksAlarmFaceClass))
#define CLOCKS_ALARM_IS_FACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_ALARM_TYPE_FACE))
#define CLOCKS_ALARM_IS_FACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_ALARM_TYPE_FACE))
#define CLOCKS_ALARM_FACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_ALARM_TYPE_FACE, ClocksAlarmFaceClass))

typedef struct _ClocksAlarmFace ClocksAlarmFace;
typedef struct _ClocksAlarmFaceClass ClocksAlarmFaceClass;
typedef struct _ClocksAlarmFacePrivate ClocksAlarmFacePrivate;

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

typedef struct _ClocksContentStore ClocksContentStore;
typedef struct _ClocksContentStoreClass ClocksContentStoreClass;

#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;
enum  {
	CLOCKS_ALARM_FACE_0_PROPERTY,
	CLOCKS_ALARM_FACE_LABEL_PROPERTY,
	CLOCKS_ALARM_FACE_HEADER_BAR_PROPERTY,
	CLOCKS_ALARM_FACE_PANEL_ID_PROPERTY,
	CLOCKS_ALARM_FACE_NUM_PROPERTIES
};
static GParamSpec* clocks_alarm_face_properties[CLOCKS_ALARM_FACE_NUM_PROPERTIES];
typedef struct _Block1Data Block1Data;
typedef struct _Block2Data Block2Data;

#define CLOCKS_HEADER_BAR_TYPE_MODE (clocks_header_bar_mode_get_type ())
typedef struct _Block3Data Block3Data;
enum  {
	CLOCKS_ALARM_FACE_RING_SIGNAL,
	CLOCKS_ALARM_FACE_NUM_SIGNALS
};
static guint clocks_alarm_face_signals[CLOCKS_ALARM_FACE_NUM_SIGNALS] = {0};

struct _ClocksAlarmAlarmTime {
	gint hour;
	gint minute;
};

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

struct _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 {
	gchar* _title_icon;
	gboolean _selectable;
	gboolean _selected;
	gchar* _id;
	ClocksAlarmAlarmTime _time;
	ClocksUtilsWeekdays* _days;
	ClocksAlarmItemState _state;
	gchar* _name;
	gboolean _active;
	GDateTime* alarm_time;
	GDateTime* snooze_time;
	GDateTime* ring_end_time;
	ClocksUtilsBell* bell;
	GNotification* notification;
};

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 _ClocksAlarmTile {
	GtkGrid parent_instance;
	ClocksAlarmTilePrivate * priv;
};

struct _ClocksAlarmTileClass {
	GtkGridClass parent_class;
};

struct _ClocksAlarmTilePrivate {
	ClocksAlarmItem* _alarm;
	GtkLabel* time_label;
	GtkWidget* name_label;
};

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;
	GtkGrid* time_grid;
	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;
	GtkBox* day_buttons_box;
	GtkStack* am_pm_stack;
	GtkRevealer* label_revealer;
	GList* other_alarms;
};

typedef enum  {
	CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_AM,
	CLOCKS_AM_PM_TOGGLE_BUTTON_AM_PM_PM
} ClocksAmPmToggleButtonAmPm;

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

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

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

typedef enum  {
	CLOCKS_PANEL_ID_WORLD,
	CLOCKS_PANEL_ID_ALARM,
	CLOCKS_PANEL_ID_STOPWATCH,
	CLOCKS_PANEL_ID_TIMER
} ClocksPanelId;

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 (*back) (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);
	ClocksPanelId (*get_panel_id) (ClocksClock* self);
	void (*set_panel_id) (ClocksClock* self, ClocksPanelId value);
};

struct _ClocksAlarmFace {
	GtkStack parent_instance;
	ClocksAlarmFacePrivate * priv;
};

struct _ClocksAlarmFaceClass {
	GtkStackClass parent_class;
};

struct _ClocksAlarmFacePrivate {
	gchar* _label;
	ClocksHeaderBar* _header_bar;
	ClocksPanelId _panel_id;
	ClocksContentStore* alarms;
	GSettings* settings;
	GtkButton* new_button;
	GtkWidget* empty_view;
	ClocksContentView* content_view;
	ClocksAlarmRingingPanel* ringing_panel;
};

struct _Block1Data {
	int _ref_count_;
	ClocksAlarmFace* self;
	GVariant* param;
};

typedef gboolean (*ClocksContentStoreFindFunc) (ClocksContentItem* item, void* user_data);
struct _Block2Data {
	int _ref_count_;
	ClocksAlarmFace* self;
	GVariant* param;
};

typedef GtkWidget* (*ClocksContentViewContentViewCreateWidgetFunc) (ClocksContentItem* item, void* user_data);
typedef void (*ClocksContentStoreForeachFunc) (ClocksContentItem* item, void* user_data);
typedef enum  {
	CLOCKS_HEADER_BAR_MODE_NORMAL,
	CLOCKS_HEADER_BAR_MODE_SELECTION,
	CLOCKS_HEADER_BAR_MODE_STANDALONE
} ClocksHeaderBarMode;

typedef ClocksContentItem* (*ClocksContentStoreDeserializeItemFunc) (GVariant* v, void* user_data);
struct _Block3Data {
	int _ref_count_;
	ClocksAlarmFace* 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_tile_parent_class = NULL;
static gpointer clocks_alarm_setup_dialog_parent_class = NULL;
static gpointer clocks_alarm_ringing_panel_parent_class = NULL;
static gpointer clocks_alarm_face_parent_class = NULL;
static ClocksClockIface * clocks_alarm_face_clocks_clock_parent_iface = NULL;

GType clocks_alarm_alarm_time_get_type (void) G_GNUC_CONST;
ClocksAlarmAlarmTime* clocks_alarm_alarm_time_dup (const ClocksAlarmAlarmTime* self);
void clocks_alarm_alarm_time_free (ClocksAlarmAlarmTime* self);
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))
#define CLOCKS_ALARM_ITEM_SNOOZE_MINUTES 9
#define CLOCKS_ALARM_ITEM_RING_MINUTES 3
ClocksAlarmItem* clocks_alarm_item_new (const gchar* id);
ClocksAlarmItem* clocks_alarm_item_construct (GType object_type, const gchar* id);
static void clocks_alarm_item_setup_bell (ClocksAlarmItem* self);
ClocksUtilsBell* clocks_utils_bell_new (const gchar* soundid);
ClocksUtilsBell* clocks_utils_bell_construct (GType object_type, const gchar* soundid);
const gchar* clocks_content_item_get_name (ClocksContentItem* self);
const gchar* clocks_alarm_item_get_id (ClocksAlarmItem* self);
void clocks_alarm_item_reset (ClocksAlarmItem* 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);
void clocks_alarm_item_get_time (ClocksAlarmItem* self, ClocksAlarmAlarmTime * result);
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_alarm_item_snooze (ClocksAlarmItem* self);
void clocks_utils_bell_stop (ClocksUtilsBell* self);
void clocks_alarm_item_stop (ClocksAlarmItem* self);
static gboolean clocks_alarm_item_compare_with_item (ClocksAlarmItem* self, ClocksAlarmItem* i);
gboolean clocks_alarm_item_get_active (ClocksAlarmItem* self);
gboolean clocks_alarm_item_check_duplicate_alarm (ClocksAlarmItem* self, GList* alarms);
gboolean clocks_alarm_item_tick (ClocksAlarmItem* self);
ClocksAlarmItemState clocks_alarm_item_get_state (ClocksAlarmItem* self);
static void clocks_alarm_item_real_serialize (ClocksContentItem* base, GVariantBuilder* builder);
GVariant* clocks_utils_weekdays_serialize (ClocksUtilsWeekdays* self);
ClocksContentItem* clocks_alarm_item_deserialize (GVariant* alarm_variant);
ClocksUtilsWeekdays* clocks_utils_weekdays_deserialize (GVariant* days_variant);
void clocks_content_item_set_name (ClocksContentItem* self, const gchar* value);
void clocks_alarm_item_set_active (ClocksAlarmItem* self, gboolean value);
void clocks_alarm_item_set_time (ClocksAlarmItem* self, ClocksAlarmAlarmTime * value);
void clocks_alarm_item_set_days (ClocksAlarmItem* self, ClocksUtilsWeekdays* value);
const gchar* clocks_alarm_item_get_title_icon (ClocksAlarmItem* self);
void clocks_alarm_item_set_title_icon (ClocksAlarmItem* self, const gchar* value);
void clocks_alarm_item_set_id (ClocksAlarmItem* self, const gchar* value);
static gboolean _clocks_alarm_alarm_time_equal (const ClocksAlarmAlarmTime * s1, const ClocksAlarmAlarmTime * s2);
gchar* clocks_alarm_item_get_time_label (ClocksAlarmItem* self);
gchar* clocks_utils_wall_clock_format_time (ClocksUtilsWallClock* self, GDateTime* date_time);
gchar* clocks_alarm_item_get_snooze_time_label (ClocksAlarmItem* self);
gchar* clocks_alarm_item_get_days_label (ClocksAlarmItem* self);
gchar* clocks_utils_weekdays_get_label (ClocksUtilsWeekdays* self);
static void clocks_alarm_item_real_ring (ClocksAlarmItem* self);
GType clocks_application_get_type (void) G_GNUC_CONST;
void clocks_application_send_notification (ClocksApplication* self, const gchar* notification_id, GNotification* notification);
void clocks_utils_bell_ring (ClocksUtilsBell* self);
static void clocks_alarm_item_finalize (GObject * obj);
gboolean clocks_content_item_get_selectable (ClocksContentItem* self);
gboolean clocks_content_item_get_selected (ClocksContentItem* self);
static void _vala_clocks_alarm_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
void clocks_content_item_set_selectable (ClocksContentItem* self, gboolean value);
void clocks_content_item_set_selected (ClocksContentItem* self, gboolean value);
static void _vala_clocks_alarm_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType clocks_alarm_tile_get_type (void) G_GNUC_CONST;
#define CLOCKS_ALARM_TILE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLOCKS_ALARM_TYPE_TILE, ClocksAlarmTilePrivate))
ClocksAlarmTile* clocks_alarm_tile_new (ClocksAlarmItem* alarm);
ClocksAlarmTile* clocks_alarm_tile_construct (GType object_type, ClocksAlarmItem* alarm);
static void clocks_alarm_tile_update (ClocksAlarmTile* self);
static void _clocks_alarm_tile_update_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
ClocksAlarmItem* clocks_alarm_tile_get_alarm (ClocksAlarmTile* self);
void clocks_alarm_tile_set_alarm (ClocksAlarmTile* self, ClocksAlarmItem* value);
static void clocks_alarm_tile_finalize (GObject * obj);
static void _vala_clocks_alarm_tile_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_clocks_alarm_tile_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))
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
ClocksAlarmSetupDialog* clocks_alarm_setup_dialog_new (GtkWindow* parent, ClocksAlarmItem* alarm, GListModel* all_alarms);
ClocksAlarmSetupDialog* clocks_alarm_setup_dialog_construct (GType object_type, GtkWindow* parent, ClocksAlarmItem* alarm, GListModel* all_alarms);
gchar* clocks_utils_weekdays_abbreviation (ClocksUtilsWeekdaysDay d);
static void _____lambda39_ (ClocksAlarmSetupDialog* self);
static void clocks_alarm_setup_dialog_avoid_duplicate_alarm (ClocksAlarmSetupDialog* self);
static void ______lambda39__gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
ClocksUtilsWeekdaysDay clocks_utils_weekdays_get_first_weekday (void);
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);
static void __lambda40_ (ClocksAlarmSetupDialog* self);
static void ___lambda40__gtk_button_clicked (GtkButton* _sender, gpointer self);
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);
ClocksUtilsWeekdays* clocks_utils_weekdays_new (void);
ClocksUtilsWeekdays* clocks_utils_weekdays_construct (GType object_type);
void clocks_utils_weekdays_set (ClocksUtilsWeekdays* self, ClocksUtilsWeekdaysDay d, gboolean on);
static void clocks_alarm_setup_dialog_entry_changed (ClocksAlarmSetupDialog* self, GtkEditable* editable);
static void _clocks_alarm_setup_dialog_entry_changed_gtk_editable_changed (GtkEditable* _sender, gpointer self);
static void clocks_alarm_setup_dialog_spinbuttons_changed (ClocksAlarmSetupDialog* self, GtkEditable* editable);
static void _clocks_alarm_setup_dialog_spinbuttons_changed_gtk_editable_changed (GtkEditable* _sender, gpointer self);
static void clocks_alarm_setup_dialog_active_changed (ClocksAlarmSetupDialog* self);
static void _clocks_alarm_setup_dialog_active_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
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);
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))
static void clocks_alarm_ringing_panel_stop_clicked (ClocksAlarmRingingPanel* self);
ClocksAlarmItem* clocks_alarm_ringing_panel_get_alarm (ClocksAlarmRingingPanel* self);
static void _clocks_alarm_ringing_panel_stop_clicked_gtk_button_clicked (GtkButton* _sender, gpointer self);
static void clocks_alarm_ringing_panel_snooze_clicked (ClocksAlarmRingingPanel* self);
static void _clocks_alarm_ringing_panel_snooze_clicked_gtk_button_clicked (GtkButton* _sender, gpointer self);
void clocks_alarm_ringing_panel_update (ClocksAlarmRingingPanel* self);
ClocksAlarmRingingPanel* clocks_alarm_ringing_panel_new (void);
ClocksAlarmRingingPanel* clocks_alarm_ringing_panel_construct (GType object_type);
void clocks_alarm_ringing_panel_set_alarm (ClocksAlarmRingingPanel* self, ClocksAlarmItem* value);
static void _clocks_alarm_ringing_panel_alarm____lambda29_ (ClocksAlarmRingingPanel* self);
static void __clocks_alarm_ringing_panel_alarm____lambda29__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_panel_id_get_type (void) G_GNUC_CONST;
GType clocks_clock_get_type (void) G_GNUC_CONST;
GType clocks_alarm_face_get_type (void) G_GNUC_CONST;
GType clocks_content_store_get_type (void) G_GNUC_CONST;
GType clocks_content_view_get_type (void) G_GNUC_CONST;
#define CLOCKS_ALARM_FACE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLOCKS_ALARM_TYPE_FACE, ClocksAlarmFacePrivate))
ClocksAlarmFace* clocks_alarm_face_new (ClocksHeaderBar* header_bar);
ClocksAlarmFace* clocks_alarm_face_construct (GType object_type, ClocksHeaderBar* header_bar);
ClocksContentStore* clocks_content_store_new (void);
ClocksContentStore* clocks_content_store_construct (GType object_type);
static void __lambda30_ (ClocksAlarmFace* self, GSimpleAction* action, GVariant* param);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
ClocksContentItem* clocks_content_store_find (ClocksContentStore* self, ClocksContentStoreFindFunc func, void* func_target);
static gboolean __lambda31_ (Block1Data* _data1_, ClocksContentItem* a);
static gboolean ___lambda31__clocks_content_store_find_func (ClocksContentItem* item, gpointer self);
static void ___lambda30__g_simple_action_activate (GSimpleAction* _sender, GVariant* parameter, gpointer self);
static void __lambda32_ (ClocksAlarmFace* self, GSimpleAction* action, GVariant* param);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static gboolean __lambda33_ (Block2Data* _data2_, ClocksContentItem* a);
static gboolean ___lambda33__clocks_content_store_find_func (ClocksContentItem* item, gpointer self);
static void ___lambda32__g_simple_action_activate (GSimpleAction* _sender, GVariant* parameter, gpointer self);
void clocks_content_view_bind_model (ClocksContentView* self, ClocksContentStore* store, ClocksContentViewContentViewCreateWidgetFunc create_func, void* create_func_target, GDestroyNotify create_func_target_destroy_notify);
static GtkWidget* __lambda34_ (ClocksAlarmFace* self, ClocksContentItem* item);
static GtkWidget* ___lambda34__clocks_content_view_content_view_create_widget_func (ClocksContentItem* item, gpointer self);
void clocks_content_view_set_header_bar (ClocksContentView* self, ClocksHeaderBar* bar);
static void clocks_alarm_face_load (ClocksAlarmFace* self);
static void __lambda35_ (ClocksAlarmFace* self, guint position, guint removed, guint added);
static void clocks_alarm_face_save (ClocksAlarmFace* self);
static void clocks_alarm_face_reset_view (ClocksAlarmFace* self);
static void ___lambda35__g_list_model_items_changed (GListModel* _sender, guint position, guint removed, guint added, gpointer self);
static void __lambda36_ (ClocksAlarmFace* self);
void clocks_content_store_foreach (ClocksContentStore* self, ClocksContentStoreForeachFunc func, void* func_target);
static void __lambda37_ (ClocksAlarmFace* self, ClocksContentItem* i);
static void clocks_alarm_face_show_ringing_panel (ClocksAlarmFace* self, ClocksAlarmItem* alarm);
static void ___lambda37__clocks_content_store_foreach_func (ClocksContentItem* item, gpointer self);
static void ___lambda36__clocks_utils_wall_clock_tick (ClocksUtilsWallClock* _sender, gpointer self);
static void clocks_alarm_face_item_activated (ClocksAlarmFace* self, ClocksContentItem* item);
static void clocks_alarm_face_edit (ClocksAlarmFace* self, ClocksAlarmItem* alarm);
static void _clocks_alarm_face_item_activated_clocks_content_view_item_activated (ClocksContentView* _sender, ClocksContentItem* item, gpointer self);
static void clocks_alarm_face_dismiss_ringing_panel (ClocksAlarmFace* self);
static void _clocks_alarm_face_dismiss_ringing_panel_clocks_alarm_ringing_panel_dismiss (ClocksAlarmRingingPanel* _sender, gpointer self);
static void clocks_alarm_face_visible_child_changed (ClocksAlarmFace* self);
ClocksHeaderBar* clocks_clock_get_header_bar (ClocksClock* self);
GType clocks_header_bar_mode_get_type (void) G_GNUC_CONST;
void clocks_header_bar_set_mode (ClocksHeaderBar* self, ClocksHeaderBarMode value);
static void _clocks_alarm_face_visible_child_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
void clocks_content_store_deserialize (ClocksContentStore* self, GVariant* variant, ClocksContentStoreDeserializeItemFunc deserialize_item, void* deserialize_item_target);
static ClocksContentItem* _clocks_alarm_item_deserialize_clocks_content_store_deserialize_item_func (GVariant* v, gpointer self);
GVariant* clocks_content_store_serialize (ClocksContentStore* self);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static void __lambda41_ (Block3Data* _data3_, GtkDialog* dialog, gint response);
static void ___lambda41__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
static void clocks_alarm_face_real_activate_new (ClocksClock* base);
static void __lambda42_ (ClocksAlarmFace* self, GtkDialog* dialog, gint response);
void clocks_content_store_add (ClocksContentStore* self, ClocksContentItem* item);
static void ___lambda42__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
static void clocks_alarm_face_real_activate_select_all (ClocksClock* base);
void clocks_content_view_select_all (ClocksContentView* self);
static void clocks_alarm_face_real_activate_select_none (ClocksClock* base);
void clocks_content_view_unselect_all (ClocksContentView* self);
static gboolean clocks_alarm_face_real_escape_pressed (ClocksClock* base);
gboolean clocks_content_view_escape_pressed (ClocksContentView* self);
static void clocks_alarm_face_real_update_header_bar (ClocksClock* base);
ClocksHeaderBarMode clocks_header_bar_get_mode (ClocksHeaderBar* self);
void clocks_content_view_update_header_bar (ClocksContentView* self);
static void clocks_alarm_face_finalize (GObject * obj);
const gchar* clocks_clock_get_label (ClocksClock* self);
ClocksPanelId clocks_clock_get_panel_id (ClocksClock* self);
static void _vala_clocks_alarm_face_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);
void clocks_clock_set_panel_id (ClocksClock* self, ClocksPanelId value);
static void _vala_clocks_alarm_face_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);


ClocksAlarmAlarmTime* clocks_alarm_alarm_time_dup (const ClocksAlarmAlarmTime* self) {
	ClocksAlarmAlarmTime* dup;
	dup = g_new0 (ClocksAlarmAlarmTime, 1);
	memcpy (dup, self, sizeof (ClocksAlarmAlarmTime));
	return dup;
}


void clocks_alarm_alarm_time_free (ClocksAlarmAlarmTime* self) {
	g_free (self);
}


GType clocks_alarm_alarm_time_get_type (void) {
	static volatile gsize clocks_alarm_alarm_time_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_alarm_alarm_time_type_id__volatile)) {
		GType clocks_alarm_alarm_time_type_id;
		clocks_alarm_alarm_time_type_id = g_boxed_type_register_static ("ClocksAlarmAlarmTime", (GBoxedCopyFunc) clocks_alarm_alarm_time_dup, (GBoxedFreeFunc) clocks_alarm_alarm_time_free);
		g_once_init_leave (&clocks_alarm_alarm_time_type_id__volatile, clocks_alarm_alarm_time_type_id);
	}
	return clocks_alarm_alarm_time_type_id__volatile;
}


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, const gchar* id) {
	ClocksAlarmItem * self = NULL;
	gchar* _tmp0_ = NULL;
	const gchar* _tmp1_;
	gchar* guid = NULL;
	gchar* _tmp5_;
	_tmp1_ = id;
	if (_tmp1_ != NULL) {
		const gchar* _tmp2_;
		gchar* _tmp3_;
		_tmp2_ = id;
		_tmp3_ = g_strdup (_tmp2_);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp3_;
	} else {
		gchar* _tmp4_;
		_tmp4_ = g_dbus_generate_guid ();
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp4_;
	}
	_tmp5_ = g_strdup (_tmp0_);
	guid = _tmp5_;
	self = (ClocksAlarmItem*) g_object_new (object_type, "id", guid, NULL);
	_g_free0 (guid);
	_g_free0 (_tmp0_);
	return self;
}


ClocksAlarmItem* clocks_alarm_item_new (const gchar* id) {
	return clocks_alarm_item_construct (CLOCKS_ALARM_TYPE_ITEM, id);
}


static void clocks_alarm_item_setup_bell (ClocksAlarmItem* self) {
	ClocksUtilsBell* _tmp0_;
	GNotification* _tmp1_;
	GNotification* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	GNotification* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	GNotification* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp0_ = clocks_utils_bell_new ("alarm-clock-elapsed");
	_g_object_unref0 (self->priv->bell);
	self->priv->bell = _tmp0_;
	_tmp1_ = g_notification_new (_ ("Alarm"));
	_g_object_unref0 (self->priv->notification);
	self->priv->notification = _tmp1_;
	_tmp2_ = self->priv->notification;
	_tmp3_ = clocks_content_item_get_name ((ClocksContentItem*) self);
	_tmp4_ = _tmp3_;
	g_notification_set_body (_tmp2_, _tmp4_);
	_tmp5_ = self->priv->notification;
	_tmp6_ = self->priv->_id;
	_tmp7_ = g_strconcat ("app.stop-alarm::", _tmp6_, NULL);
	_tmp8_ = _tmp7_;
	g_notification_add_button (_tmp5_, _ ("Stop"), _tmp8_);
	_g_free0 (_tmp8_);
	_tmp9_ = self->priv->notification;
	_tmp10_ = self->priv->_id;
	_tmp11_ = g_strconcat ("app.snooze-alarm::", _tmp10_, NULL);
	_tmp12_ = _tmp11_;
	g_notification_add_button (_tmp9_, _ ("Snooze"), _tmp12_);
	_g_free0 (_tmp12_);
}


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* wallclock = NULL;
	ClocksUtilsWallClock* _tmp0_;
	GDateTime* now = NULL;
	ClocksUtilsWallClock* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	GDateTime* _tmp4_;
	GDateTime* dt = NULL;
	ClocksUtilsWallClock* _tmp5_;
	GTimeZone* _tmp6_;
	GTimeZone* _tmp7_;
	GDateTime* _tmp8_;
	gint _tmp9_;
	GDateTime* _tmp10_;
	gint _tmp11_;
	GDateTime* _tmp12_;
	gint _tmp13_;
	ClocksAlarmAlarmTime _tmp14_;
	gint _tmp15_;
	ClocksAlarmAlarmTime _tmp16_;
	gint _tmp17_;
	GDateTime* _tmp18_;
	gboolean _tmp19_ = FALSE;
	ClocksUtilsWeekdays* _tmp20_;
	GDateTime* _tmp39_;
	GDateTime* _tmp40_;
	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->_time;
	_tmp15_ = _tmp14_.hour;
	_tmp16_ = self->priv->_time;
	_tmp17_ = _tmp16_.minute;
	_tmp18_ = g_date_time_new (_tmp7_, _tmp9_, _tmp11_, _tmp13_, _tmp15_, _tmp17_, (gdouble) 0);
	dt = _tmp18_;
	_tmp20_ = self->priv->_days;
	if (_tmp20_ == NULL) {
		_tmp19_ = TRUE;
	} else {
		ClocksUtilsWeekdays* _tmp21_;
		gboolean _tmp22_;
		gboolean _tmp23_;
		_tmp21_ = self->priv->_days;
		_tmp22_ = clocks_utils_weekdays_get_empty (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp19_ = _tmp23_;
	}
	if (_tmp19_) {
		GDateTime* _tmp24_;
		GDateTime* _tmp25_;
		gint _tmp26_;
		_tmp24_ = dt;
		_tmp25_ = now;
		_tmp26_ = g_date_time_compare (_tmp24_, _tmp25_);
		if (_tmp26_ <= 0) {
			GDateTime* _tmp27_;
			GDateTime* _tmp28_;
			_tmp27_ = dt;
			_tmp28_ = g_date_time_add_days (_tmp27_, 1);
			_g_date_time_unref0 (dt);
			dt = _tmp28_;
		}
	} else {
		while (TRUE) {
			gboolean _tmp29_ = FALSE;
			GDateTime* _tmp30_;
			GDateTime* _tmp31_;
			gint _tmp32_;
			GDateTime* _tmp37_;
			GDateTime* _tmp38_;
			_tmp30_ = dt;
			_tmp31_ = now;
			_tmp32_ = g_date_time_compare (_tmp30_, _tmp31_);
			if (_tmp32_ <= 0) {
				_tmp29_ = TRUE;
			} else {
				ClocksUtilsWeekdays* _tmp33_;
				GDateTime* _tmp34_;
				gint _tmp35_;
				gboolean _tmp36_;
				_tmp33_ = self->priv->_days;
				_tmp34_ = dt;
				_tmp35_ = g_date_time_get_day_of_week (_tmp34_);
				_tmp36_ = clocks_utils_weekdays_get (_tmp33_, (ClocksUtilsWeekdaysDay) (_tmp35_ - 1));
				_tmp29_ = !_tmp36_;
			}
			if (!_tmp29_) {
				break;
			}
			_tmp37_ = dt;
			_tmp38_ = g_date_time_add_days (_tmp37_, 1);
			_g_date_time_unref0 (dt);
			dt = _tmp38_;
		}
	}
	_tmp39_ = dt;
	_tmp40_ = _g_date_time_ref0 (_tmp39_);
	_g_date_time_unref0 (self->priv->alarm_time);
	self->priv->alarm_time = _tmp40_;
	_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_;
	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_;
	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 (self, clocks_alarm_item_signals[CLOCKS_ALARM_ITEM_RING_SIGNAL], 0);
}


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


static gboolean clocks_alarm_item_compare_with_item (ClocksAlarmItem* self, ClocksAlarmItem* i) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GDateTime* _tmp2_;
	ClocksAlarmItem* _tmp3_;
	GDateTime* _tmp4_;
	gint _tmp5_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (i != NULL, FALSE);
	_tmp2_ = self->priv->alarm_time;
	_tmp3_ = i;
	_tmp4_ = _tmp3_->priv->alarm_time;
	_tmp5_ = g_date_time_compare (_tmp2_, _tmp4_);
	if (_tmp5_ == 0) {
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp6_ = clocks_alarm_item_get_active (self);
		_tmp7_ = _tmp6_;
		_tmp1_ = _tmp7_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		ClocksAlarmItem* _tmp8_;
		gboolean _tmp9_;
		gboolean _tmp10_;
		_tmp8_ = i;
		_tmp9_ = clocks_alarm_item_get_active (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp0_ = _tmp10_;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}


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


gboolean clocks_alarm_item_check_duplicate_alarm (ClocksAlarmItem* self, GList* alarms) {
	gboolean result = FALSE;
	GList* _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	clocks_alarm_item_update_alarm_time (self);
	_tmp0_ = alarms;
	{
		GList* item_collection = NULL;
		GList* item_it = NULL;
		item_collection = _tmp0_;
		for (item_it = item_collection; item_it != NULL; item_it = item_it->next) {
			ClocksAlarmItem* _tmp1_;
			ClocksAlarmItem* item = NULL;
			_tmp1_ = _g_object_ref0 ((ClocksAlarmItem*) item_it->data);
			item = _tmp1_;
			{
				ClocksAlarmItem* _tmp2_;
				gboolean _tmp3_;
				_tmp2_ = item;
				_tmp3_ = clocks_alarm_item_compare_with_item (self, _tmp2_);
				if (_tmp3_) {
					result = TRUE;
					_g_object_unref0 (item);
					return result;
				}
				_g_object_unref0 (item);
			}
		}
	}
	result = FALSE;
	return result;
}


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


static void clocks_alarm_item_real_serialize (ClocksContentItem* base, GVariantBuilder* builder) {
	ClocksAlarmItem * self;
	GVariantBuilder* _tmp0_;
	GVariantType* _tmp1_;
	GVariantType* _tmp2_;
	GVariantBuilder* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	GVariant* _tmp6_;
	GVariant* _tmp7_;
	GVariantBuilder* _tmp8_;
	const gchar* _tmp9_;
	GVariant* _tmp10_;
	GVariant* _tmp11_;
	GVariantBuilder* _tmp12_;
	gboolean _tmp13_;
	gboolean _tmp14_;
	GVariant* _tmp15_;
	GVariant* _tmp16_;
	GVariantBuilder* _tmp17_;
	ClocksAlarmAlarmTime _tmp18_;
	gint _tmp19_;
	GVariant* _tmp20_;
	GVariant* _tmp21_;
	GVariantBuilder* _tmp22_;
	ClocksAlarmAlarmTime _tmp23_;
	gint _tmp24_;
	GVariant* _tmp25_;
	GVariant* _tmp26_;
	GVariantBuilder* _tmp27_;
	ClocksUtilsWeekdays* _tmp28_;
	GVariant* _tmp29_;
	GVariant* _tmp30_;
	GVariantBuilder* _tmp31_;
	self = (ClocksAlarmItem*) base;
	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_ = self->priv->_id;
	_tmp10_ = g_variant_new_string (_tmp9_);
	g_variant_ref_sink (_tmp10_);
	_tmp11_ = _tmp10_;
	g_variant_builder_add (_tmp8_, "{sv}", "id", _tmp11_, NULL);
	_g_variant_unref0 (_tmp11_);
	_tmp12_ = builder;
	_tmp13_ = clocks_alarm_item_get_active (self);
	_tmp14_ = _tmp13_;
	_tmp15_ = g_variant_new_boolean (_tmp14_);
	g_variant_ref_sink (_tmp15_);
	_tmp16_ = _tmp15_;
	g_variant_builder_add (_tmp12_, "{sv}", "active", _tmp16_, NULL);
	_g_variant_unref0 (_tmp16_);
	_tmp17_ = builder;
	_tmp18_ = self->priv->_time;
	_tmp19_ = _tmp18_.hour;
	_tmp20_ = g_variant_new_int32 ((gint32) _tmp19_);
	g_variant_ref_sink (_tmp20_);
	_tmp21_ = _tmp20_;
	g_variant_builder_add (_tmp17_, "{sv}", "hour", _tmp21_, NULL);
	_g_variant_unref0 (_tmp21_);
	_tmp22_ = builder;
	_tmp23_ = self->priv->_time;
	_tmp24_ = _tmp23_.minute;
	_tmp25_ = g_variant_new_int32 ((gint32) _tmp24_);
	g_variant_ref_sink (_tmp25_);
	_tmp26_ = _tmp25_;
	g_variant_builder_add (_tmp22_, "{sv}", "minute", _tmp26_, NULL);
	_g_variant_unref0 (_tmp26_);
	_tmp27_ = builder;
	_tmp28_ = self->priv->_days;
	_tmp29_ = clocks_utils_weekdays_serialize (_tmp28_);
	_tmp30_ = _tmp29_;
	g_variant_builder_add (_tmp27_, "{sv}", "days", _tmp30_, NULL);
	_g_variant_unref0 (_tmp30_);
	_tmp31_ = builder;
	g_variant_builder_close (_tmp31_);
}


ClocksContentItem* clocks_alarm_item_deserialize (GVariant* alarm_variant) {
	ClocksContentItem* result = NULL;
	gchar* name = NULL;
	gchar* id = NULL;
	gboolean active = FALSE;
	gint hour = 0;
	gint minute = 0;
	ClocksUtilsWeekdays* days = NULL;
	gboolean _tmp55_ = FALSE;
	gboolean _tmp56_ = FALSE;
	const gchar* _tmp57_;
	g_return_val_if_fail (alarm_variant != NULL, NULL);
	name = NULL;
	id = NULL;
	active = TRUE;
	hour = -1;
	minute = -1;
	days = NULL;
	{
		GVariantIter* _v_it = NULL;
		GVariant* _tmp0_;
		GVariantIter* _tmp1_;
		GVariant* v = NULL;
		_tmp0_ = alarm_variant;
		_tmp1_ = g_variant_iter_new (_tmp0_);
		_v_it = _tmp1_;
		while (TRUE) {
			GVariantIter* _tmp2_;
			GVariant* _tmp3_;
			GVariant* _tmp4_;
			gchar* key = NULL;
			GVariant* _tmp5_;
			GVariant* _tmp6_;
			GVariant* _tmp7_;
			const gchar* _tmp8_;
			gchar* _tmp9_;
			gchar* _tmp10_;
			const gchar* _tmp11_;
			_tmp2_ = _v_it;
			_tmp3_ = g_variant_iter_next_value (_tmp2_);
			_g_variant_unref0 (v);
			v = _tmp3_;
			_tmp4_ = v;
			if (!(_tmp4_ != NULL)) {
				break;
			}
			_tmp5_ = v;
			_tmp6_ = g_variant_get_child_value (_tmp5_, (gsize) 0);
			_tmp7_ = _tmp6_;
			_tmp8_ = g_variant_get_string (_tmp7_, NULL);
			_tmp9_ = g_strdup (_tmp8_);
			_tmp10_ = _tmp9_;
			_g_variant_unref0 (_tmp7_);
			key = _tmp10_;
			_tmp11_ = key;
			if (g_strcmp0 (_tmp11_, "name") == 0) {
				GVariant* _tmp12_;
				GVariant* _tmp13_;
				GVariant* _tmp14_;
				GVariant* _tmp15_;
				GVariant* _tmp16_;
				const gchar* _tmp17_;
				gchar* _tmp18_;
				_tmp12_ = v;
				_tmp13_ = g_variant_get_child_value (_tmp12_, (gsize) 1);
				_tmp14_ = _tmp13_;
				_tmp15_ = g_variant_get_child_value (_tmp14_, (gsize) 0);
				_tmp16_ = _tmp15_;
				_tmp17_ = g_variant_get_string (_tmp16_, NULL);
				_tmp18_ = g_strdup (_tmp17_);
				_g_free0 (name);
				name = _tmp18_;
				_g_variant_unref0 (_tmp16_);
				_g_variant_unref0 (_tmp14_);
			} else {
				const gchar* _tmp19_;
				_tmp19_ = key;
				if (g_strcmp0 (_tmp19_, "id") == 0) {
					GVariant* _tmp20_;
					GVariant* _tmp21_;
					GVariant* _tmp22_;
					GVariant* _tmp23_;
					GVariant* _tmp24_;
					const gchar* _tmp25_;
					gchar* _tmp26_;
					_tmp20_ = v;
					_tmp21_ = g_variant_get_child_value (_tmp20_, (gsize) 1);
					_tmp22_ = _tmp21_;
					_tmp23_ = g_variant_get_child_value (_tmp22_, (gsize) 0);
					_tmp24_ = _tmp23_;
					_tmp25_ = g_variant_get_string (_tmp24_, NULL);
					_tmp26_ = g_strdup (_tmp25_);
					_g_free0 (id);
					id = _tmp26_;
					_g_variant_unref0 (_tmp24_);
					_g_variant_unref0 (_tmp22_);
				} else {
					const gchar* _tmp27_;
					_tmp27_ = key;
					if (g_strcmp0 (_tmp27_, "active") == 0) {
						GVariant* _tmp28_;
						GVariant* _tmp29_;
						GVariant* _tmp30_;
						GVariant* _tmp31_;
						GVariant* _tmp32_;
						gboolean _tmp33_;
						_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_boolean (_tmp32_);
						active = _tmp33_;
						_g_variant_unref0 (_tmp32_);
						_g_variant_unref0 (_tmp30_);
					} else {
						const gchar* _tmp34_;
						_tmp34_ = key;
						if (g_strcmp0 (_tmp34_, "hour") == 0) {
							GVariant* _tmp35_;
							GVariant* _tmp36_;
							GVariant* _tmp37_;
							GVariant* _tmp38_;
							GVariant* _tmp39_;
							gint32 _tmp40_;
							_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_);
							hour = (gint) _tmp40_;
							_g_variant_unref0 (_tmp39_);
							_g_variant_unref0 (_tmp37_);
						} else {
							const gchar* _tmp41_;
							_tmp41_ = key;
							if (g_strcmp0 (_tmp41_, "minute") == 0) {
								GVariant* _tmp42_;
								GVariant* _tmp43_;
								GVariant* _tmp44_;
								GVariant* _tmp45_;
								GVariant* _tmp46_;
								gint32 _tmp47_;
								_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_ = g_variant_get_int32 (_tmp46_);
								minute = (gint) _tmp47_;
								_g_variant_unref0 (_tmp46_);
								_g_variant_unref0 (_tmp44_);
							} else {
								const gchar* _tmp48_;
								_tmp48_ = key;
								if (g_strcmp0 (_tmp48_, "days") == 0) {
									GVariant* _tmp49_;
									GVariant* _tmp50_;
									GVariant* _tmp51_;
									GVariant* _tmp52_;
									GVariant* _tmp53_;
									ClocksUtilsWeekdays* _tmp54_;
									_tmp49_ = v;
									_tmp50_ = g_variant_get_child_value (_tmp49_, (gsize) 1);
									_tmp51_ = _tmp50_;
									_tmp52_ = g_variant_get_child_value (_tmp51_, (gsize) 0);
									_tmp53_ = _tmp52_;
									_tmp54_ = clocks_utils_weekdays_deserialize (_tmp53_);
									_clocks_utils_weekdays_unref0 (days);
									days = _tmp54_;
									_g_variant_unref0 (_tmp53_);
									_g_variant_unref0 (_tmp51_);
								}
							}
						}
					}
				}
			}
			_g_free0 (key);
		}
		_g_variant_unref0 (v);
		_g_variant_iter_free0 (_v_it);
	}
	_tmp57_ = name;
	if (_tmp57_ != NULL) {
		gint _tmp58_;
		_tmp58_ = hour;
		_tmp56_ = _tmp58_ >= 0;
	} else {
		_tmp56_ = FALSE;
	}
	if (_tmp56_) {
		gint _tmp59_;
		_tmp59_ = minute;
		_tmp55_ = _tmp59_ >= 0;
	} else {
		_tmp55_ = FALSE;
	}
	if (_tmp55_) {
		ClocksAlarmItem* alarm = NULL;
		const gchar* _tmp60_;
		ClocksAlarmItem* _tmp61_;
		ClocksAlarmItem* _tmp62_;
		const gchar* _tmp63_;
		ClocksAlarmItem* _tmp64_;
		gboolean _tmp65_;
		ClocksAlarmItem* _tmp66_;
		gint _tmp67_;
		gint _tmp68_;
		ClocksAlarmAlarmTime _tmp69_ = {0};
		ClocksAlarmItem* _tmp70_;
		ClocksUtilsWeekdays* _tmp71_;
		ClocksAlarmItem* _tmp72_;
		_tmp60_ = id;
		_tmp61_ = clocks_alarm_item_new (_tmp60_);
		alarm = _tmp61_;
		_tmp62_ = alarm;
		_tmp63_ = name;
		clocks_content_item_set_name ((ClocksContentItem*) _tmp62_, _tmp63_);
		_tmp64_ = alarm;
		_tmp65_ = active;
		clocks_alarm_item_set_active (_tmp64_, _tmp65_);
		_tmp66_ = alarm;
		_tmp67_ = hour;
		_tmp68_ = minute;
		_tmp69_.hour = _tmp67_;
		_tmp69_.minute = _tmp68_;
		clocks_alarm_item_set_time (_tmp66_, &_tmp69_);
		_tmp70_ = alarm;
		_tmp71_ = days;
		clocks_alarm_item_set_days (_tmp70_, _tmp71_);
		_tmp72_ = alarm;
		clocks_alarm_item_reset (_tmp72_);
		result = (ClocksContentItem*) alarm;
		_clocks_utils_weekdays_unref0 (days);
		_g_free0 (id);
		_g_free0 (name);
		return result;
	} else {
		const gchar* _tmp73_ = NULL;
		const gchar* _tmp74_;
		_tmp74_ = name;
		if (_tmp74_ != NULL) {
			const gchar* _tmp75_;
			_tmp75_ = name;
			_tmp73_ = _tmp75_;
		} else {
			_tmp73_ = "name missing";
		}
		g_warning ("alarm.vala:271: Invalid alarm %s", _tmp73_);
	}
	result = NULL;
	_clocks_utils_weekdays_unref0 (days);
	_g_free0 (id);
	_g_free0 (name);
	return result;
}


const gchar* clocks_alarm_item_get_title_icon (ClocksAlarmItem* self) {
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_title_icon;
	result = _tmp0_;
	return result;
}


void clocks_alarm_item_set_title_icon (ClocksAlarmItem* self, const gchar* value) {
	g_return_if_fail (self != NULL);
	if (g_strcmp0 (value, clocks_alarm_item_get_title_icon (self)) != 0) {
		const gchar* _tmp0_;
		gchar* _tmp1_;
		_tmp0_ = value;
		_tmp1_ = g_strdup (_tmp0_);
		_g_free0 (self->priv->_title_icon);
		self->priv->_title_icon = _tmp1_;
		g_object_notify_by_pspec ((GObject *) self, clocks_alarm_item_properties[CLOCKS_ALARM_ITEM_TITLE_ICON_PROPERTY]);
	}
}


static gboolean clocks_alarm_item_real_get_selectable (ClocksContentItem* base) {
	gboolean result;
	ClocksAlarmItem* self;
	gboolean _tmp0_;
	self = (ClocksAlarmItem*) base;
	_tmp0_ = self->priv->_selectable;
	result = _tmp0_;
	return result;
}


static void clocks_alarm_item_real_set_selectable (ClocksContentItem* base, gboolean value) {
	ClocksAlarmItem* self;
	self = (ClocksAlarmItem*) base;
	if (clocks_alarm_item_real_get_selectable (base) != value) {
		gboolean _tmp0_;
		_tmp0_ = value;
		self->priv->_selectable = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, clocks_alarm_item_properties[CLOCKS_ALARM_ITEM_SELECTABLE_PROPERTY]);
	}
}


static gboolean clocks_alarm_item_real_get_selected (ClocksContentItem* base) {
	gboolean result;
	ClocksAlarmItem* self;
	gboolean _tmp0_;
	self = (ClocksAlarmItem*) base;
	_tmp0_ = self->priv->_selected;
	result = _tmp0_;
	return result;
}


static void clocks_alarm_item_real_set_selected (ClocksContentItem* base, gboolean value) {
	ClocksAlarmItem* self;
	self = (ClocksAlarmItem*) base;
	if (clocks_alarm_item_real_get_selected (base) != value) {
		gboolean _tmp0_;
		_tmp0_ = value;
		self->priv->_selected = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, clocks_alarm_item_properties[CLOCKS_ALARM_ITEM_SELECTED_PROPERTY]);
	}
}


const gchar* clocks_alarm_item_get_id (ClocksAlarmItem* self) {
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_id;
	result = _tmp0_;
	return result;
}


void clocks_alarm_item_set_id (ClocksAlarmItem* self, const gchar* value) {
	g_return_if_fail (self != NULL);
	if (g_strcmp0 (value, clocks_alarm_item_get_id (self)) != 0) {
		const gchar* _tmp0_;
		gchar* _tmp1_;
		_tmp0_ = value;
		_tmp1_ = g_strdup (_tmp0_);
		_g_free0 (self->priv->_id);
		self->priv->_id = _tmp1_;
		g_object_notify_by_pspec ((GObject *) self, clocks_alarm_item_properties[CLOCKS_ALARM_ITEM_ID_PROPERTY]);
	}
}


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_by_pspec ((GObject *) self, clocks_alarm_item_properties[CLOCKS_ALARM_ITEM_NAME_PROPERTY]);
}


void clocks_alarm_item_get_time (ClocksAlarmItem* self, ClocksAlarmAlarmTime * result) {
	ClocksAlarmAlarmTime _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_time;
	*result = _tmp0_;
	return;
}


static gboolean _clocks_alarm_alarm_time_equal (const ClocksAlarmAlarmTime * s1, const ClocksAlarmAlarmTime * s2) {
	if (s1 == s2) {
		return TRUE;
	}
	if (s1 == NULL) {
		return FALSE;
	}
	if (s2 == NULL) {
		return FALSE;
	}
	if (s1->hour != s2->hour) {
		return FALSE;
	}
	if (s1->minute != s2->minute) {
		return FALSE;
	}
	return TRUE;
}


void clocks_alarm_item_set_time (ClocksAlarmItem* self, ClocksAlarmAlarmTime * value) {
	ClocksAlarmAlarmTime old_value;
	g_return_if_fail (self != NULL);
	if (_clocks_alarm_alarm_time_equal (value, (clocks_alarm_item_get_time (self, &old_value), &old_value)) != TRUE) {
		ClocksAlarmAlarmTime _tmp0_;
		_tmp0_ = *value;
		self->priv->_time = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, clocks_alarm_item_properties[CLOCKS_ALARM_ITEM_TIME_PROPERTY]);
	}
}


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) {
	g_return_if_fail (self != NULL);
	if (clocks_alarm_item_get_days (self) != value) {
		ClocksUtilsWeekdays* _tmp0_;
		ClocksUtilsWeekdays* _tmp1_;
		_tmp0_ = value;
		_tmp1_ = _clocks_utils_weekdays_ref0 (_tmp0_);
		_clocks_utils_weekdays_unref0 (self->priv->_days);
		self->priv->_days = _tmp1_;
		g_object_notify_by_pspec ((GObject *) self, clocks_alarm_item_properties[CLOCKS_ALARM_ITEM_DAYS_PROPERTY]);
	}
}


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) {
	g_return_if_fail (self != NULL);
	if (clocks_alarm_item_get_state (self) != value) {
		ClocksAlarmItemState _tmp0_;
		_tmp0_ = value;
		self->priv->_state = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, clocks_alarm_item_properties[CLOCKS_ALARM_ITEM_STATE_PROPERTY]);
	}
}


gchar* clocks_alarm_item_get_time_label (ClocksAlarmItem* self) {
	gchar* result;
	ClocksUtilsWallClock* _tmp0_;
	ClocksUtilsWallClock* _tmp1_;
	GDateTime* _tmp2_;
	gchar* _tmp3_;
	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_;
	ClocksUtilsWallClock* _tmp1_;
	GDateTime* _tmp2_;
	gchar* _tmp3_;
	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;
}


gchar* clocks_alarm_item_get_days_label (ClocksAlarmItem* self) {
	gchar* result;
	gchar* _tmp0_ = NULL;
	ClocksUtilsWeekdays* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->_days;
	if (_tmp1_ != NULL) {
		ClocksUtilsWeekdays* _tmp2_;
		gchar* _tmp3_;
		_tmp2_ = self->priv->_days;
		_tmp3_ = clocks_utils_weekdays_get_label (_tmp2_);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp3_;
	} else {
		_g_free0 (_tmp0_);
		_tmp0_ = NULL;
	}
	result = _tmp0_;
	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) {
	ClocksApplication* app = NULL;
	GApplication* _tmp0_;
	ClocksApplication* _tmp1_;
	GNotification* _tmp2_;
	ClocksUtilsBell* _tmp3_;
	_tmp0_ = g_application_get_default ();
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, CLOCKS_TYPE_APPLICATION) ? ((ClocksApplication*) _tmp0_) : NULL);
	app = _tmp1_;
	_tmp2_ = self->priv->notification;
	clocks_application_send_notification (app, "alarm-clock-elapsed", _tmp2_);
	_tmp3_ = self->priv->bell;
	clocks_utils_bell_ring (_tmp3_);
	_g_object_unref0 (app);
}


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));
	((ClocksAlarmItemClass *) 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_TITLE_ICON_PROPERTY, clocks_alarm_item_properties[CLOCKS_ALARM_ITEM_TITLE_ICON_PROPERTY] = g_param_spec_string ("title-icon", "title-icon", "title-icon", 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_SELECTABLE_PROPERTY, clocks_alarm_item_properties[CLOCKS_ALARM_ITEM_SELECTABLE_PROPERTY] = g_param_spec_boolean ("selectable", "selectable", "selectable", TRUE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_ALARM_ITEM_SELECTED_PROPERTY, clocks_alarm_item_properties[CLOCKS_ALARM_ITEM_SELECTED_PROPERTY] = g_param_spec_boolean ("selected", "selected", "selected", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_ALARM_ITEM_ID_PROPERTY, clocks_alarm_item_properties[CLOCKS_ALARM_ITEM_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", 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_ITEM_NAME_PROPERTY, clocks_alarm_item_properties[CLOCKS_ALARM_ITEM_NAME_PROPERTY] = 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_TIME_PROPERTY, clocks_alarm_item_properties[CLOCKS_ALARM_ITEM_TIME_PROPERTY] = g_param_spec_boxed ("time", "time", "time", CLOCKS_ALARM_TYPE_ALARM_TIME, 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_PROPERTY, clocks_alarm_item_properties[CLOCKS_ALARM_ITEM_DAYS_PROPERTY] = 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_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_ALARM_ITEM_STATE_PROPERTY, clocks_alarm_item_properties[CLOCKS_ALARM_ITEM_STATE_PROPERTY] = 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_PROPERTY, clocks_alarm_item_properties[CLOCKS_ALARM_ITEM_TIME_LABEL_PROPERTY] = 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_PROPERTY, clocks_alarm_item_properties[CLOCKS_ALARM_ITEM_SNOOZE_TIME_LABEL_PROPERTY] = 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_DAYS_LABEL_PROPERTY, clocks_alarm_item_properties[CLOCKS_ALARM_ITEM_DAYS_LABEL_PROPERTY] = g_param_spec_string ("days-label", "days-label", "days-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_PROPERTY, clocks_alarm_item_properties[CLOCKS_ALARM_ITEM_ACTIVE_PROPERTY] = 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));
	clocks_alarm_item_signals[CLOCKS_ALARM_ITEM_RING_SIGNAL] = 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->serialize = (void (*) (ClocksContentItem *, GVariantBuilder*)) clocks_alarm_item_real_serialize;
	iface->get_selectable = clocks_alarm_item_real_get_selectable;
	iface->set_selectable = clocks_alarm_item_real_set_selectable;
	iface->get_selected = clocks_alarm_item_real_get_selected;
	iface->set_selected = clocks_alarm_item_real_set_selected;
	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);
	self->priv->_title_icon = NULL;
	self->priv->_selectable = TRUE;
	self->priv->_selected = FALSE;
}


static void clocks_alarm_item_finalize (GObject * obj) {
	ClocksAlarmItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem);
	_g_free0 (self->priv->_title_icon);
	_g_free0 (self->priv->_id);
	_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_unref0 (self->priv->notification);
	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_TITLE_ICON_PROPERTY:
		g_value_set_string (value, clocks_alarm_item_get_title_icon (self));
		break;
		case CLOCKS_ALARM_ITEM_SELECTABLE_PROPERTY:
		g_value_set_boolean (value, clocks_content_item_get_selectable ((ClocksContentItem*) self));
		break;
		case CLOCKS_ALARM_ITEM_SELECTED_PROPERTY:
		g_value_set_boolean (value, clocks_content_item_get_selected ((ClocksContentItem*) self));
		break;
		case CLOCKS_ALARM_ITEM_ID_PROPERTY:
		g_value_set_string (value, clocks_alarm_item_get_id (self));
		break;
		case CLOCKS_ALARM_ITEM_NAME_PROPERTY:
		g_value_set_string (value, clocks_content_item_get_name ((ClocksContentItem*) self));
		break;
		case CLOCKS_ALARM_ITEM_TIME_PROPERTY:
		{
			ClocksAlarmAlarmTime boxed;
			clocks_alarm_item_get_time (self, &boxed);
			g_value_set_boxed (value, &boxed);
		}
		break;
		case CLOCKS_ALARM_ITEM_DAYS_PROPERTY:
		clocks_utils_value_set_weekdays (value, clocks_alarm_item_get_days (self));
		break;
		case CLOCKS_ALARM_ITEM_STATE_PROPERTY:
		g_value_set_enum (value, clocks_alarm_item_get_state (self));
		break;
		case CLOCKS_ALARM_ITEM_TIME_LABEL_PROPERTY:
		g_value_take_string (value, clocks_alarm_item_get_time_label (self));
		break;
		case CLOCKS_ALARM_ITEM_SNOOZE_TIME_LABEL_PROPERTY:
		g_value_take_string (value, clocks_alarm_item_get_snooze_time_label (self));
		break;
		case CLOCKS_ALARM_ITEM_DAYS_LABEL_PROPERTY:
		g_value_take_string (value, clocks_alarm_item_get_days_label (self));
		break;
		case CLOCKS_ALARM_ITEM_ACTIVE_PROPERTY:
		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_TITLE_ICON_PROPERTY:
		clocks_alarm_item_set_title_icon (self, g_value_get_string (value));
		break;
		case CLOCKS_ALARM_ITEM_SELECTABLE_PROPERTY:
		clocks_content_item_set_selectable ((ClocksContentItem*) self, g_value_get_boolean (value));
		break;
		case CLOCKS_ALARM_ITEM_SELECTED_PROPERTY:
		clocks_content_item_set_selected ((ClocksContentItem*) self, g_value_get_boolean (value));
		break;
		case CLOCKS_ALARM_ITEM_ID_PROPERTY:
		clocks_alarm_item_set_id (self, g_value_get_string (value));
		break;
		case CLOCKS_ALARM_ITEM_NAME_PROPERTY:
		clocks_content_item_set_name ((ClocksContentItem*) self, g_value_get_string (value));
		break;
		case CLOCKS_ALARM_ITEM_TIME_PROPERTY:
		clocks_alarm_item_set_time (self, g_value_get_boxed (value));
		break;
		case CLOCKS_ALARM_ITEM_DAYS_PROPERTY:
		clocks_alarm_item_set_days (self, clocks_utils_value_get_weekdays (value));
		break;
		case CLOCKS_ALARM_ITEM_STATE_PROPERTY:
		clocks_alarm_item_set_state (self, g_value_get_enum (value));
		break;
		case CLOCKS_ALARM_ITEM_ACTIVE_PROPERTY:
		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 void _clocks_alarm_tile_update_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	clocks_alarm_tile_update ((ClocksAlarmTile*) self);
}


ClocksAlarmTile* clocks_alarm_tile_construct (GType object_type, ClocksAlarmItem* alarm) {
	ClocksAlarmTile * self = NULL;
	ClocksAlarmItem* _tmp0_;
	ClocksAlarmItem* _tmp1_;
	GtkWidget* _tmp2_;
	ClocksAlarmItem* _tmp3_;
	ClocksAlarmItem* _tmp4_;
	ClocksAlarmItem* _tmp5_;
	ClocksAlarmItem* _tmp6_;
	g_return_val_if_fail (alarm != NULL, NULL);
	_tmp0_ = alarm;
	self = (ClocksAlarmTile*) g_object_new (object_type, "alarm", _tmp0_, NULL);
	_tmp1_ = alarm;
	_tmp2_ = self->priv->name_label;
	g_object_bind_property_with_closures ((GObject*) _tmp1_, "name", (GObject*) _tmp2_, "label", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp3_ = alarm;
	g_signal_connect_object ((GObject*) _tmp3_, "notify::active", (GCallback) _clocks_alarm_tile_update_g_object_notify, self, 0);
	_tmp4_ = alarm;
	g_signal_connect_object ((GObject*) _tmp4_, "notify::state", (GCallback) _clocks_alarm_tile_update_g_object_notify, self, 0);
	_tmp5_ = alarm;
	g_signal_connect_object ((GObject*) _tmp5_, "notify::time", (GCallback) _clocks_alarm_tile_update_g_object_notify, self, 0);
	_tmp6_ = alarm;
	g_signal_connect_object ((GObject*) _tmp6_, "notify::days", (GCallback) _clocks_alarm_tile_update_g_object_notify, self, 0);
	clocks_alarm_tile_update (self);
	return self;
}


ClocksAlarmTile* clocks_alarm_tile_new (ClocksAlarmItem* alarm) {
	return clocks_alarm_tile_construct (CLOCKS_ALARM_TYPE_TILE, alarm);
}


static void clocks_alarm_tile_update (ClocksAlarmTile* self) {
	gchar* text = NULL;
	gchar* sub_text = NULL;
	ClocksAlarmItem* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	ClocksAlarmItem* _tmp5_;
	ClocksAlarmItemState _tmp6_;
	ClocksAlarmItemState _tmp7_;
	gboolean _tmp24_ = FALSE;
	const gchar* _tmp25_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_alarm;
	_tmp1_ = clocks_alarm_item_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GtkStyleContext* _tmp3_;
		_tmp3_ = gtk_widget_get_style_context ((GtkWidget*) self);
		gtk_style_context_add_class (_tmp3_, "active");
	} else {
		GtkStyleContext* _tmp4_;
		_tmp4_ = gtk_widget_get_style_context ((GtkWidget*) self);
		gtk_style_context_remove_class (_tmp4_, "active");
	}
	_tmp5_ = self->priv->_alarm;
	_tmp6_ = clocks_alarm_item_get_state (_tmp5_);
	_tmp7_ = _tmp6_;
	if (_tmp7_ == CLOCKS_ALARM_ITEM_STATE_SNOOZING) {
		GtkStyleContext* _tmp8_;
		ClocksAlarmItem* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		ClocksAlarmItem* _tmp12_;
		gchar* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		gchar* _tmp16_;
		_tmp8_ = gtk_widget_get_style_context ((GtkWidget*) self);
		gtk_style_context_add_class (_tmp8_, "snoozing");
		_tmp9_ = self->priv->_alarm;
		_tmp10_ = clocks_alarm_item_get_snooze_time_label (_tmp9_);
		_tmp11_ = _tmp10_;
		_g_free0 (text);
		text = _tmp11_;
		_tmp12_ = self->priv->_alarm;
		_tmp13_ = clocks_alarm_item_get_time_label (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = _tmp14_;
		_tmp16_ = g_strdup_printf ("(%s)", _tmp15_);
		_g_free0 (sub_text);
		sub_text = _tmp16_;
		_g_free0 (_tmp15_);
	} else {
		GtkStyleContext* _tmp17_;
		ClocksAlarmItem* _tmp18_;
		gchar* _tmp19_;
		gchar* _tmp20_;
		ClocksAlarmItem* _tmp21_;
		gchar* _tmp22_;
		gchar* _tmp23_;
		_tmp17_ = gtk_widget_get_style_context ((GtkWidget*) self);
		gtk_style_context_remove_class (_tmp17_, "snoozing");
		_tmp18_ = self->priv->_alarm;
		_tmp19_ = clocks_alarm_item_get_time_label (_tmp18_);
		_tmp20_ = _tmp19_;
		_g_free0 (text);
		text = _tmp20_;
		_tmp21_ = self->priv->_alarm;
		_tmp22_ = clocks_alarm_item_get_days_label (_tmp21_);
		_tmp23_ = _tmp22_;
		_g_free0 (sub_text);
		sub_text = _tmp23_;
	}
	_tmp25_ = sub_text;
	if (_tmp25_ != NULL) {
		const gchar* _tmp26_;
		_tmp26_ = sub_text;
		_tmp24_ = g_strcmp0 (_tmp26_, "") != 0;
	} else {
		_tmp24_ = FALSE;
	}
	if (_tmp24_) {
		GtkLabel* _tmp27_;
		const gchar* _tmp28_;
		const gchar* _tmp29_;
		gchar* _tmp30_;
		gchar* _tmp31_;
		_tmp27_ = self->priv->time_label;
		_tmp28_ = text;
		_tmp29_ = sub_text;
		_tmp30_ = g_strdup_printf ("%s\n<span size='xx-small'>%s</span>", _tmp28_, _tmp29_);
		_tmp31_ = _tmp30_;
		gtk_label_set_label (_tmp27_, _tmp31_);
		_g_free0 (_tmp31_);
	} else {
		GtkLabel* _tmp32_;
		const gchar* _tmp33_;
		_tmp32_ = self->priv->time_label;
		_tmp33_ = text;
		gtk_label_set_label (_tmp32_, _tmp33_);
	}
	_g_free0 (sub_text);
	_g_free0 (text);
}


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


void clocks_alarm_tile_set_alarm (ClocksAlarmTile* self, ClocksAlarmItem* value) {
	g_return_if_fail (self != NULL);
	if (clocks_alarm_tile_get_alarm (self) != value) {
		ClocksAlarmItem* _tmp0_;
		ClocksAlarmItem* _tmp1_;
		_tmp0_ = value;
		_tmp1_ = _g_object_ref0 (_tmp0_);
		_g_object_unref0 (self->priv->_alarm);
		self->priv->_alarm = _tmp1_;
		g_object_notify_by_pspec ((GObject *) self, clocks_alarm_tile_properties[CLOCKS_ALARM_TILE_ALARM_PROPERTY]);
	}
}


static void clocks_alarm_tile_class_init (ClocksAlarmTileClass * klass) {
	gint ClocksAlarmTile_private_offset;
	clocks_alarm_tile_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ClocksAlarmTilePrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_clocks_alarm_tile_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_clocks_alarm_tile_set_property;
	G_OBJECT_CLASS (klass)->finalize = clocks_alarm_tile_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_ALARM_TILE_ALARM_PROPERTY, clocks_alarm_tile_properties[CLOCKS_ALARM_TILE_ALARM_PROPERTY] = 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_PARAM_CONSTRUCT));
	ClocksAlarmTile_private_offset = g_type_class_get_instance_private_offset (klass);
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/clocks/ui/alarmtile.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "time_label", FALSE, ClocksAlarmTile_private_offset + G_STRUCT_OFFSET (ClocksAlarmTilePrivate, time_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "name_label", FALSE, ClocksAlarmTile_private_offset + G_STRUCT_OFFSET (ClocksAlarmTilePrivate, name_label));
}


static void clocks_alarm_tile_instance_init (ClocksAlarmTile * self) {
	self->priv = CLOCKS_ALARM_TILE_GET_PRIVATE (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}


static void clocks_alarm_tile_finalize (GObject * obj) {
	ClocksAlarmTile * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_ALARM_TYPE_TILE, ClocksAlarmTile);
	_g_object_unref0 (self->priv->_alarm);
	_g_object_unref0 (self->priv->time_label);
	_g_object_unref0 (self->priv->name_label);
	G_OBJECT_CLASS (clocks_alarm_tile_parent_class)->finalize (obj);
}


GType clocks_alarm_tile_get_type (void) {
	static volatile gsize clocks_alarm_tile_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_alarm_tile_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ClocksAlarmTileClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_alarm_tile_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksAlarmTile), 0, (GInstanceInitFunc) clocks_alarm_tile_instance_init, NULL };
		GType clocks_alarm_tile_type_id;
		clocks_alarm_tile_type_id = g_type_register_static (gtk_grid_get_type (), "ClocksAlarmTile", &g_define_type_info, 0);
		g_once_init_leave (&clocks_alarm_tile_type_id__volatile, clocks_alarm_tile_type_id);
	}
	return clocks_alarm_tile_type_id__volatile;
}


static void _vala_clocks_alarm_tile_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ClocksAlarmTile * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_ALARM_TYPE_TILE, ClocksAlarmTile);
	switch (property_id) {
		case CLOCKS_ALARM_TILE_ALARM_PROPERTY:
		g_value_set_object (value, clocks_alarm_tile_get_alarm (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_clocks_alarm_tile_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	ClocksAlarmTile * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_ALARM_TYPE_TILE, ClocksAlarmTile);
	switch (property_id) {
		case CLOCKS_ALARM_TILE_ALARM_PROPERTY:
		clocks_alarm_tile_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 inline void _g_list_free__g_object_unref0_ (GList* self) {
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
}


static void _____lambda39_ (ClocksAlarmSetupDialog* self) {
	clocks_alarm_setup_dialog_avoid_duplicate_alarm (self);
}


static void ______lambda39__gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
	_____lambda39_ ((ClocksAlarmSetupDialog*) self);
}


static void __lambda40_ (ClocksAlarmSetupDialog* self) {
	clocks_alarm_setup_dialog_avoid_duplicate_alarm (self);
}


static void ___lambda40__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda40_ ((ClocksAlarmSetupDialog*) self);
}


ClocksAlarmSetupDialog* clocks_alarm_setup_dialog_construct (GType object_type, GtkWindow* parent, ClocksAlarmItem* alarm, GListModel* all_alarms) {
	ClocksAlarmSetupDialog * self = NULL;
	const gchar* _tmp0_ = NULL;
	ClocksAlarmItem* _tmp1_;
	GtkWindow* _tmp2_;
	guint n = 0U;
	GListModel* _tmp3_;
	guint _tmp4_;
	GtkGrid* _tmp19_;
	GtkToggleButton** _tmp20_;
	ClocksUtilsWeekdaysDay first_weekday = 0;
	ClocksUtilsWeekdaysDay _tmp37_;
	ClocksUtilsWallClock* _tmp47_;
	ClocksUtilsWallClock* _tmp48_;
	ClocksUtilsWallClockFormat _tmp49_;
	ClocksUtilsWallClockFormat _tmp50_;
	ClocksAmPmToggleButton* _tmp51_;
	ClocksAmPmToggleButton* _tmp52_;
	ClocksUtilsWallClockFormat _tmp53_;
	ClocksAlarmItem* _tmp64_;
	g_return_val_if_fail (parent != NULL, NULL);
	g_return_val_if_fail (all_alarms != NULL, NULL);
	_tmp1_ = alarm;
	if (_tmp1_ != NULL) {
		_tmp0_ = _ ("Edit Alarm");
	} else {
		_tmp0_ = _ ("New Alarm");
	}
	_tmp2_ = parent;
	self = (ClocksAlarmSetupDialog*) g_object_new (object_type, "transient-for", _tmp2_, "title", _tmp0_, "use-header-bar", 1, NULL);
	__g_list_free__g_object_unref0_0 (self->priv->other_alarms);
	self->priv->other_alarms = NULL;
	_tmp3_ = all_alarms;
	_tmp4_ = g_list_model_get_n_items (_tmp3_);
	n = _tmp4_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp5_ = FALSE;
			_tmp5_ = TRUE;
			while (TRUE) {
				gint _tmp7_;
				guint _tmp8_;
				ClocksAlarmItem* item = NULL;
				GListModel* _tmp9_;
				gint _tmp10_;
				GObject* _tmp11_;
				ClocksAlarmItem* _tmp12_;
				ClocksAlarmItem* _tmp13_;
				ClocksAlarmItem* _tmp14_;
				if (!_tmp5_) {
					gint _tmp6_;
					_tmp6_ = i;
					i = _tmp6_ + 1;
				}
				_tmp5_ = FALSE;
				_tmp7_ = i;
				_tmp8_ = n;
				if (!(((guint) _tmp7_) < _tmp8_)) {
					break;
				}
				_tmp9_ = all_alarms;
				_tmp10_ = i;
				_tmp11_ = g_list_model_get_object (_tmp9_, (guint) _tmp10_);
				_tmp12_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp11_, CLOCKS_ALARM_TYPE_ITEM) ? ((ClocksAlarmItem*) _tmp11_) : NULL;
				if (_tmp12_ == NULL) {
					_g_object_unref0 (_tmp11_);
				}
				item = _tmp12_;
				_tmp13_ = alarm;
				_tmp14_ = item;
				if (_tmp13_ != _tmp14_) {
					GListModel* _tmp15_;
					gint _tmp16_;
					GObject* _tmp17_;
					ClocksAlarmItem* _tmp18_;
					_tmp15_ = all_alarms;
					_tmp16_ = i;
					_tmp17_ = g_list_model_get_object (_tmp15_, (guint) _tmp16_);
					_tmp18_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, CLOCKS_ALARM_TYPE_ITEM) ? ((ClocksAlarmItem*) _tmp17_) : NULL;
					if (_tmp18_ == NULL) {
						_g_object_unref0 (_tmp17_);
					}
					self->priv->other_alarms = g_list_prepend (self->priv->other_alarms, _tmp18_);
				}
				_g_object_unref0 (item);
			}
		}
	}
	_tmp19_ = self->priv->time_grid;
	gtk_widget_set_direction ((GtkWidget*) _tmp19_, GTK_TEXT_DIR_LTR);
	_tmp20_ = 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 = _tmp20_;
	self->priv->day_buttons_length1 = 7;
	self->priv->_day_buttons_size_ = self->priv->day_buttons_length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp21_ = FALSE;
			_tmp21_ = TRUE;
			while (TRUE) {
				gint _tmp23_;
				GtkToggleButton* button = NULL;
				gint _tmp24_;
				gchar* _tmp25_;
				gchar* _tmp26_;
				GtkToggleButton* _tmp27_;
				GtkToggleButton* _tmp28_;
				GtkToggleButton** _tmp29_;
				gint _tmp29__length1;
				gint _tmp30_;
				GtkToggleButton* _tmp31_;
				GtkToggleButton* _tmp32_;
				GtkToggleButton* _tmp33_;
				GtkToggleButton** _tmp34_;
				gint _tmp34__length1;
				gint _tmp35_;
				GtkToggleButton* _tmp36_;
				if (!_tmp21_) {
					gint _tmp22_;
					_tmp22_ = i;
					i = _tmp22_ + 1;
				}
				_tmp21_ = FALSE;
				_tmp23_ = i;
				if (!(_tmp23_ < 7)) {
					break;
				}
				_tmp24_ = i;
				_tmp25_ = clocks_utils_weekdays_abbreviation ((ClocksUtilsWeekdaysDay) _tmp24_);
				_tmp26_ = _tmp25_;
				_tmp27_ = (GtkToggleButton*) gtk_toggle_button_new_with_label (_tmp26_);
				g_object_ref_sink (_tmp27_);
				_tmp28_ = _tmp27_;
				_g_free0 (_tmp26_);
				button = _tmp28_;
				_tmp29_ = self->priv->day_buttons;
				_tmp29__length1 = self->priv->day_buttons_length1;
				_tmp30_ = i;
				_tmp31_ = button;
				_tmp32_ = _g_object_ref0 (_tmp31_);
				_g_object_unref0 (_tmp29_[_tmp30_]);
				_tmp29_[_tmp30_] = _tmp32_;
				_tmp33_ = _tmp29_[_tmp30_];
				_tmp34_ = self->priv->day_buttons;
				_tmp34__length1 = self->priv->day_buttons_length1;
				_tmp35_ = i;
				_tmp36_ = _tmp34_[_tmp35_];
				g_signal_connect_object (_tmp36_, "toggled", (GCallback) ______lambda39__gtk_toggle_button_toggled, self, 0);
				_g_object_unref0 (button);
			}
		}
	}
	_tmp37_ = clocks_utils_weekdays_get_first_weekday ();
	first_weekday = _tmp37_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp38_ = FALSE;
			_tmp38_ = TRUE;
			while (TRUE) {
				gint _tmp40_;
				ClocksUtilsWeekdaysDay day_number = 0;
				ClocksUtilsWeekdaysDay _tmp41_;
				gint _tmp42_;
				GtkBox* _tmp43_;
				GtkToggleButton** _tmp44_;
				gint _tmp44__length1;
				ClocksUtilsWeekdaysDay _tmp45_;
				GtkToggleButton* _tmp46_;
				if (!_tmp38_) {
					gint _tmp39_;
					_tmp39_ = i;
					i = _tmp39_ + 1;
				}
				_tmp38_ = FALSE;
				_tmp40_ = i;
				if (!(_tmp40_ < 7)) {
					break;
				}
				_tmp41_ = first_weekday;
				_tmp42_ = i;
				day_number = (_tmp41_ + _tmp42_) % 7;
				_tmp43_ = self->priv->day_buttons_box;
				_tmp44_ = self->priv->day_buttons;
				_tmp44__length1 = self->priv->day_buttons_length1;
				_tmp45_ = day_number;
				_tmp46_ = _tmp44_[_tmp45_];
				gtk_box_pack_start (_tmp43_, (GtkWidget*) _tmp46_, TRUE, TRUE, (guint) 0);
			}
		}
	}
	_tmp47_ = clocks_utils_wall_clock_get_default ();
	_tmp48_ = _tmp47_;
	_tmp49_ = clocks_utils_wall_clock_get_format (_tmp48_);
	_tmp50_ = _tmp49_;
	self->priv->format = _tmp50_;
	_g_object_unref0 (_tmp48_);
	_tmp51_ = clocks_am_pm_toggle_button_new ();
	g_object_ref_sink (_tmp51_);
	_g_object_unref0 (self->priv->am_pm_button);
	self->priv->am_pm_button = _tmp51_;
	_tmp52_ = self->priv->am_pm_button;
	g_signal_connect_object ((GtkButton*) _tmp52_, "clicked", (GCallback) ___lambda40__gtk_button_clicked, self, 0);
	_tmp53_ = self->priv->format;
	if (_tmp53_ == CLOCKS_UTILS_WALL_CLOCK_FORMAT_TWENTYFOUR) {
		GtkSpinButton* _tmp54_;
		_tmp54_ = self->priv->h_spinbutton;
		gtk_spin_button_set_range (_tmp54_, (gdouble) 0, (gdouble) 23);
	} else {
		GtkSpinButton* _tmp55_;
		ClocksAmPmToggleButton* _tmp56_;
		ClocksAmPmToggleButton* _tmp57_;
		ClocksAmPmToggleButton* _tmp58_;
		ClocksAmPmToggleButton* _tmp59_;
		GtkStack* _tmp60_;
		ClocksAmPmToggleButton* _tmp61_;
		GtkStack* _tmp62_;
		ClocksAmPmToggleButton* _tmp63_;
		_tmp55_ = self->priv->h_spinbutton;
		gtk_spin_button_set_range (_tmp55_, (gdouble) 1, (gdouble) 12);
		_tmp56_ = self->priv->am_pm_button;
		gtk_widget_set_hexpand ((GtkWidget*) _tmp56_, FALSE);
		_tmp57_ = self->priv->am_pm_button;
		gtk_widget_set_vexpand ((GtkWidget*) _tmp57_, FALSE);
		_tmp58_ = self->priv->am_pm_button;
		gtk_widget_set_halign ((GtkWidget*) _tmp58_, GTK_ALIGN_CENTER);
		_tmp59_ = self->priv->am_pm_button;
		gtk_widget_set_valign ((GtkWidget*) _tmp59_, GTK_ALIGN_CENTER);
		_tmp60_ = self->priv->am_pm_stack;
		_tmp61_ = self->priv->am_pm_button;
		gtk_container_add ((GtkContainer*) _tmp60_, (GtkWidget*) _tmp61_);
		_tmp62_ = self->priv->am_pm_stack;
		_tmp63_ = self->priv->am_pm_button;
		gtk_stack_set_visible_child (_tmp62_, (GtkWidget*) _tmp63_);
	}
	_tmp64_ = alarm;
	clocks_alarm_setup_dialog_set_from_alarm (self, _tmp64_);
	return self;
}


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


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


static void clocks_alarm_setup_dialog_avoid_duplicate_alarm (ClocksAlarmSetupDialog* self) {
	ClocksAlarmItem* alarm = NULL;
	ClocksAlarmItem* _tmp0_;
	gboolean duplicate = FALSE;
	GList* _tmp1_;
	gboolean _tmp2_;
	GtkRevealer* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = clocks_alarm_item_new (NULL);
	alarm = _tmp0_;
	clocks_alarm_setup_dialog_apply_to_alarm (self, alarm);
	_tmp1_ = self->priv->other_alarms;
	_tmp2_ = clocks_alarm_item_check_duplicate_alarm (alarm, _tmp1_);
	duplicate = _tmp2_;
	gtk_dialog_set_response_sensitive ((GtkDialog*) self, 1, !duplicate);
	_tmp3_ = self->priv->label_revealer;
	gtk_revealer_set_reveal_child (_tmp3_, duplicate);
	_g_object_unref0 (alarm);
}


static void clocks_alarm_setup_dialog_entry_changed (ClocksAlarmSetupDialog* self, GtkEditable* editable) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (editable != NULL);
	clocks_alarm_setup_dialog_avoid_duplicate_alarm (self);
}


static void _clocks_alarm_setup_dialog_entry_changed_gtk_editable_changed (GtkEditable* _sender, gpointer self) {
	clocks_alarm_setup_dialog_entry_changed ((ClocksAlarmSetupDialog*) self, _sender);
}


static void clocks_alarm_setup_dialog_spinbuttons_changed (ClocksAlarmSetupDialog* self, GtkEditable* editable) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (editable != NULL);
	clocks_alarm_setup_dialog_avoid_duplicate_alarm (self);
}


static void _clocks_alarm_setup_dialog_spinbuttons_changed_gtk_editable_changed (GtkEditable* _sender, gpointer self) {
	clocks_alarm_setup_dialog_spinbuttons_changed ((ClocksAlarmSetupDialog*) self, _sender);
}


static void clocks_alarm_setup_dialog_active_changed (ClocksAlarmSetupDialog* self) {
	g_return_if_fail (self != NULL);
	clocks_alarm_setup_dialog_avoid_duplicate_alarm (self);
}


static void _clocks_alarm_setup_dialog_active_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	clocks_alarm_setup_dialog_active_changed ((ClocksAlarmSetupDialog*) self);
}


static gboolean clocks_alarm_setup_dialog_show_leading_zeros (ClocksAlarmSetupDialog* self, GtkSpinButton* spin_button) {
	gboolean result = FALSE;
	GtkSpinButton* _tmp0_;
	GtkSpinButton* _tmp1_;
	gint _tmp2_;
	gchar* _tmp3_;
	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 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 ((ClocksAlarmSetupDialog*) self, _sender);
	return result;
}


static void clocks_alarm_setup_dialog_class_init (ClocksAlarmSetupDialogClass * klass) {
	gint ClocksAlarmSetupDialog_private_offset;
	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;
	ClocksAlarmSetupDialog_private_offset = g_type_class_get_instance_private_offset (klass);
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/clocks/ui/alarmsetupdialog.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "time_grid", FALSE, ClocksAlarmSetupDialog_private_offset + G_STRUCT_OFFSET (ClocksAlarmSetupDialogPrivate, time_grid));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "h_spinbutton", FALSE, ClocksAlarmSetupDialog_private_offset + G_STRUCT_OFFSET (ClocksAlarmSetupDialogPrivate, h_spinbutton));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "m_spinbutton", FALSE, ClocksAlarmSetupDialog_private_offset + G_STRUCT_OFFSET (ClocksAlarmSetupDialogPrivate, m_spinbutton));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "name_entry", FALSE, ClocksAlarmSetupDialog_private_offset + G_STRUCT_OFFSET (ClocksAlarmSetupDialogPrivate, name_entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "active_switch", FALSE, ClocksAlarmSetupDialog_private_offset + G_STRUCT_OFFSET (ClocksAlarmSetupDialogPrivate, active_switch));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "day_buttons_box", FALSE, ClocksAlarmSetupDialog_private_offset + G_STRUCT_OFFSET (ClocksAlarmSetupDialogPrivate, day_buttons_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "am_pm_stack", FALSE, ClocksAlarmSetupDialog_private_offset + G_STRUCT_OFFSET (ClocksAlarmSetupDialogPrivate, am_pm_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "label_revealer", FALSE, ClocksAlarmSetupDialog_private_offset + G_STRUCT_OFFSET (ClocksAlarmSetupDialogPrivate, label_revealer));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "entry_changed", G_CALLBACK(_clocks_alarm_setup_dialog_entry_changed_gtk_editable_changed));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "spinbuttons_changed", G_CALLBACK(_clocks_alarm_setup_dialog_spinbuttons_changed_gtk_editable_changed));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "active_changed", G_CALLBACK(_clocks_alarm_setup_dialog_active_changed_g_object_notify));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "show_leading_zeros", G_CALLBACK(_clocks_alarm_setup_dialog_show_leading_zeros_gtk_spin_button_output));
}


static void clocks_alarm_setup_dialog_instance_init (ClocksAlarmSetupDialog * self) {
	self->priv = CLOCKS_ALARM_SETUP_DIALOG_GET_PRIVATE (self);
	gtk_widget_init_template (GTK_WIDGET (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->time_grid);
	_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_unref0 (self->priv->day_buttons_box);
	_g_object_unref0 (self->priv->am_pm_stack);
	_g_object_unref0 (self->priv->label_revealer);
	__g_list_free__g_object_unref0_0 (self->priv->other_alarms);
	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_dialog_get_type (), "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 clocks_alarm_ringing_panel_stop_clicked (ClocksAlarmRingingPanel* self) {
	ClocksAlarmItem* _tmp0_;
	ClocksAlarmItem* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = clocks_alarm_ringing_panel_get_alarm (self);
	_tmp1_ = _tmp0_;
	clocks_alarm_item_stop (_tmp1_);
}


static void _clocks_alarm_ringing_panel_stop_clicked_gtk_button_clicked (GtkButton* _sender, gpointer self) {
	clocks_alarm_ringing_panel_stop_clicked ((ClocksAlarmRingingPanel*) self);
}


static void clocks_alarm_ringing_panel_snooze_clicked (ClocksAlarmRingingPanel* self) {
	ClocksAlarmItem* _tmp0_;
	ClocksAlarmItem* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = clocks_alarm_ringing_panel_get_alarm (self);
	_tmp1_ = _tmp0_;
	clocks_alarm_item_snooze (_tmp1_);
}


static void _clocks_alarm_ringing_panel_snooze_clicked_gtk_button_clicked (GtkButton* _sender, gpointer self) {
	clocks_alarm_ringing_panel_snooze_clicked ((ClocksAlarmRingingPanel*) self);
}


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_label (_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_label (_tmp12_, _tmp17_);
			_g_free0 (_tmp17_);
		}
	}
}


ClocksAlarmRingingPanel* clocks_alarm_ringing_panel_construct (GType object_type) {
	ClocksAlarmRingingPanel * self = NULL;
	self = (ClocksAlarmRingingPanel*) g_object_new (object_type, NULL);
	return self;
}


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


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____lambda29_ (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 (self, clocks_alarm_ringing_panel_signals[CLOCKS_ALARM_RINGING_PANEL_DISMISS_SIGNAL], 0);
	}
}


static void __clocks_alarm_ringing_panel_alarm____lambda29__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	_clocks_alarm_ringing_panel_alarm____lambda29_ ((ClocksAlarmRingingPanel*) 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_;
		_tmp6_ = self->priv->_alarm;
		_tmp7_ = g_signal_connect_object ((GObject*) _tmp6_, "notify::state", (GCallback) __clocks_alarm_ringing_panel_alarm____lambda29__g_object_notify, self, 0);
		self->priv->alarm_state_handler = _tmp7_;
	}
	g_object_notify_by_pspec ((GObject *) self, clocks_alarm_ringing_panel_properties[CLOCKS_ALARM_RINGING_PANEL_ALARM_PROPERTY]);
}


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) {
	gint ClocksAlarmRingingPanel_private_offset;
	clocks_alarm_ringing_panel_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ClocksAlarmRingingPanelPrivate));
	((ClocksAlarmRingingPanelClass *) 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_PROPERTY, clocks_alarm_ringing_panel_properties[CLOCKS_ALARM_RINGING_PANEL_ALARM_PROPERTY] = 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));
	ClocksAlarmRingingPanel_private_offset = g_type_class_get_instance_private_offset (klass);
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/clocks/ui/alarmringing.ui");
	clocks_alarm_ringing_panel_signals[CLOCKS_ALARM_RINGING_PANEL_DISMISS_SIGNAL] = 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);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "time_label", FALSE, ClocksAlarmRingingPanel_private_offset + G_STRUCT_OFFSET (ClocksAlarmRingingPanelPrivate, time_label));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "stop_clicked", G_CALLBACK(_clocks_alarm_ringing_panel_stop_clicked_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "snooze_clicked", G_CALLBACK(_clocks_alarm_ringing_panel_snooze_clicked_gtk_button_clicked));
}


static void clocks_alarm_ringing_panel_instance_init (ClocksAlarmRingingPanel * self) {
	self->priv = CLOCKS_ALARM_RINGING_PANEL_GET_PRIVATE (self);
	gtk_widget_init_template (GTK_WIDGET (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_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_grid_get_type (), "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_PROPERTY:
		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_PROPERTY:
		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 gpointer _g_variant_ref0 (gpointer self) {
	return self ? g_variant_ref (self) : NULL;
}


static Block1Data* block1_data_ref (Block1Data* _data1_) {
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}


static void block1_data_unref (void * _userdata_) {
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		ClocksAlarmFace* self;
		self = _data1_->self;
		_g_variant_unref0 (_data1_->param);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}


static gboolean __lambda31_ (Block1Data* _data1_, ClocksContentItem* a) {
	ClocksAlarmFace* self;
	gboolean result = FALSE;
	ClocksContentItem* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GVariant* _tmp3_;
	const gchar* _tmp4_;
	self = _data1_->self;
	g_return_val_if_fail (a != NULL, FALSE);
	_tmp0_ = a;
	_tmp1_ = clocks_alarm_item_get_id (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem));
	_tmp2_ = _tmp1_;
	_tmp3_ = _data1_->param;
	_tmp4_ = g_variant_get_string (_tmp3_, NULL);
	result = g_strcmp0 (_tmp2_, _tmp4_) == 0;
	return result;
}


static gboolean ___lambda31__clocks_content_store_find_func (ClocksContentItem* item, gpointer self) {
	gboolean result;
	result = __lambda31_ (self, item);
	return result;
}


static void __lambda30_ (ClocksAlarmFace* self, GSimpleAction* action, GVariant* param) {
	Block1Data* _data1_;
	GVariant* _tmp0_;
	GVariant* _tmp1_;
	ClocksAlarmItem* a = NULL;
	ClocksContentStore* _tmp2_;
	ClocksContentItem* _tmp3_;
	ClocksAlarmItem* _tmp4_;
	g_return_if_fail (action != NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->self = g_object_ref (self);
	_tmp0_ = param;
	_tmp1_ = _g_variant_ref0 (_tmp0_);
	_g_variant_unref0 (_data1_->param);
	_data1_->param = _tmp1_;
	_tmp2_ = self->priv->alarms;
	_tmp3_ = clocks_content_store_find (_tmp2_, ___lambda31__clocks_content_store_find_func, _data1_);
	a = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem);
	_tmp4_ = a;
	if (_tmp4_ != NULL) {
		ClocksAlarmItem* _tmp5_;
		_tmp5_ = a;
		clocks_alarm_item_stop (_tmp5_);
	}
	_g_object_unref0 (a);
	block1_data_unref (_data1_);
	_data1_ = NULL;
}


static void ___lambda30__g_simple_action_activate (GSimpleAction* _sender, GVariant* parameter, gpointer self) {
	__lambda30_ ((ClocksAlarmFace*) self, _sender, parameter);
}


static Block2Data* block2_data_ref (Block2Data* _data2_) {
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}


static void block2_data_unref (void * _userdata_) {
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		ClocksAlarmFace* self;
		self = _data2_->self;
		_g_variant_unref0 (_data2_->param);
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}


static gboolean __lambda33_ (Block2Data* _data2_, ClocksContentItem* a) {
	ClocksAlarmFace* self;
	gboolean result = FALSE;
	ClocksContentItem* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GVariant* _tmp3_;
	const gchar* _tmp4_;
	self = _data2_->self;
	g_return_val_if_fail (a != NULL, FALSE);
	_tmp0_ = a;
	_tmp1_ = clocks_alarm_item_get_id (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem));
	_tmp2_ = _tmp1_;
	_tmp3_ = _data2_->param;
	_tmp4_ = g_variant_get_string (_tmp3_, NULL);
	result = g_strcmp0 (_tmp2_, _tmp4_) == 0;
	return result;
}


static gboolean ___lambda33__clocks_content_store_find_func (ClocksContentItem* item, gpointer self) {
	gboolean result;
	result = __lambda33_ (self, item);
	return result;
}


static void __lambda32_ (ClocksAlarmFace* self, GSimpleAction* action, GVariant* param) {
	Block2Data* _data2_;
	GVariant* _tmp0_;
	GVariant* _tmp1_;
	ClocksAlarmItem* a = NULL;
	ClocksContentStore* _tmp2_;
	ClocksContentItem* _tmp3_;
	ClocksAlarmItem* _tmp4_;
	g_return_if_fail (action != NULL);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_data2_->self = g_object_ref (self);
	_tmp0_ = param;
	_tmp1_ = _g_variant_ref0 (_tmp0_);
	_g_variant_unref0 (_data2_->param);
	_data2_->param = _tmp1_;
	_tmp2_ = self->priv->alarms;
	_tmp3_ = clocks_content_store_find (_tmp2_, ___lambda33__clocks_content_store_find_func, _data2_);
	a = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem);
	_tmp4_ = a;
	if (_tmp4_ != NULL) {
		ClocksAlarmItem* _tmp5_;
		_tmp5_ = a;
		clocks_alarm_item_snooze (_tmp5_);
	}
	_g_object_unref0 (a);
	block2_data_unref (_data2_);
	_data2_ = NULL;
}


static void ___lambda32__g_simple_action_activate (GSimpleAction* _sender, GVariant* parameter, gpointer self) {
	__lambda32_ ((ClocksAlarmFace*) self, _sender, parameter);
}


static GtkWidget* __lambda34_ (ClocksAlarmFace* self, ClocksContentItem* item) {
	GtkWidget* result = NULL;
	ClocksContentItem* _tmp0_;
	ClocksAlarmTile* _tmp1_;
	g_return_val_if_fail (item != NULL, NULL);
	_tmp0_ = item;
	_tmp1_ = clocks_alarm_tile_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem));
	g_object_ref_sink (_tmp1_);
	result = (GtkWidget*) _tmp1_;
	return result;
}


static GtkWidget* ___lambda34__clocks_content_view_content_view_create_widget_func (ClocksContentItem* item, gpointer self) {
	GtkWidget* result;
	result = __lambda34_ ((ClocksAlarmFace*) self, item);
	return result;
}


static void __lambda35_ (ClocksAlarmFace* self, guint position, guint removed, guint added) {
	clocks_alarm_face_save (self);
	clocks_alarm_face_reset_view (self);
}


static void ___lambda35__g_list_model_items_changed (GListModel* _sender, guint position, guint removed, guint added, gpointer self) {
	__lambda35_ ((ClocksAlarmFace*) self, position, removed, added);
}


static void __lambda37_ (ClocksAlarmFace* self, ClocksContentItem* i) {
	ClocksAlarmItem* a = NULL;
	ClocksContentItem* _tmp0_;
	ClocksAlarmItem* _tmp1_;
	ClocksAlarmItem* _tmp2_;
	gboolean _tmp3_;
	g_return_if_fail (i != NULL);
	_tmp0_ = i;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem));
	a = _tmp1_;
	_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_face_show_ringing_panel (self, _tmp7_);
			g_signal_emit (self, clocks_alarm_face_signals[CLOCKS_ALARM_FACE_RING_SIGNAL], 0);
		} 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 ___lambda37__clocks_content_store_foreach_func (ClocksContentItem* item, gpointer self) {
	__lambda37_ ((ClocksAlarmFace*) self, item);
}


static void __lambda36_ (ClocksAlarmFace* self) {
	ClocksContentStore* _tmp0_;
	_tmp0_ = self->priv->alarms;
	clocks_content_store_foreach (_tmp0_, ___lambda37__clocks_content_store_foreach_func, self);
}


static void ___lambda36__clocks_utils_wall_clock_tick (ClocksUtilsWallClock* _sender, gpointer self) {
	__lambda36_ ((ClocksAlarmFace*) self);
}


ClocksAlarmFace* clocks_alarm_face_construct (GType object_type, ClocksHeaderBar* header_bar) {
	ClocksAlarmFace * self = NULL;
	ClocksHeaderBar* _tmp0_;
	ClocksContentStore* _tmp1_;
	GSettings* _tmp2_;
	GApplication* app = NULL;
	GApplication* _tmp3_;
	GApplication* _tmp4_;
	GAction* action = NULL;
	GAction* _tmp5_;
	GAction* _tmp6_;
	GAction* _tmp7_;
	GAction* _tmp8_;
	GAction* _tmp9_;
	GAction* _tmp10_;
	GtkButton* _tmp11_;
	GtkButton* _tmp12_;
	GtkButton* _tmp13_;
	GtkButton* _tmp14_;
	ClocksHeaderBar* _tmp15_;
	GtkButton* _tmp16_;
	ClocksContentView* _tmp17_;
	ClocksContentStore* _tmp18_;
	ClocksContentView* _tmp19_;
	ClocksHeaderBar* _tmp20_;
	ClocksContentStore* _tmp21_;
	ClocksUtilsWallClock* _tmp22_;
	ClocksUtilsWallClock* _tmp23_;
	g_return_val_if_fail (header_bar != NULL, NULL);
	_tmp0_ = header_bar;
	self = (ClocksAlarmFace*) g_object_new (object_type, "label", _ ("Alarm"), "header-bar", _tmp0_, "panel-id", CLOCKS_PANEL_ID_ALARM, NULL);
	_tmp1_ = clocks_content_store_new ();
	_g_object_unref0 (self->priv->alarms);
	self->priv->alarms = _tmp1_;
	_tmp2_ = g_settings_new ("org.gnome.clocks");
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp2_;
	_tmp3_ = g_application_get_default ();
	_tmp4_ = _g_object_ref0 (_tmp3_);
	app = _tmp4_;
	_tmp5_ = g_action_map_lookup_action ((GActionMap*) app, "stop-alarm");
	_tmp6_ = _g_object_ref0 (_tmp5_);
	action = _tmp6_;
	_tmp7_ = action;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, g_simple_action_get_type (), GSimpleAction), "activate", (GCallback) ___lambda30__g_simple_action_activate, self, 0);
	_tmp8_ = g_action_map_lookup_action ((GActionMap*) app, "snooze-alarm");
	_tmp9_ = _g_object_ref0 (_tmp8_);
	_g_object_unref0 (action);
	action = _tmp9_;
	_tmp10_ = action;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, g_simple_action_get_type (), GSimpleAction), "activate", (GCallback) ___lambda32__g_simple_action_activate, self, 0);
	_tmp11_ = (GtkButton*) gtk_button_new_with_label (C_ ("Alarm", "New"));
	g_object_ref_sink (_tmp11_);
	_g_object_unref0 (self->priv->new_button);
	self->priv->new_button = _tmp11_;
	_tmp12_ = self->priv->new_button;
	gtk_widget_set_valign ((GtkWidget*) _tmp12_, GTK_ALIGN_CENTER);
	_tmp13_ = self->priv->new_button;
	gtk_widget_set_no_show_all ((GtkWidget*) _tmp13_, TRUE);
	_tmp14_ = self->priv->new_button;
	gtk_actionable_set_action_name ((GtkActionable*) _tmp14_, "win.new");
	_tmp15_ = header_bar;
	_tmp16_ = self->priv->new_button;
	gtk_header_bar_pack_start ((GtkHeaderBar*) _tmp15_, (GtkWidget*) _tmp16_);
	_tmp17_ = self->priv->content_view;
	_tmp18_ = self->priv->alarms;
	clocks_content_view_bind_model (_tmp17_, _tmp18_, ___lambda34__clocks_content_view_content_view_create_widget_func, g_object_ref (self), g_object_unref);
	_tmp19_ = self->priv->content_view;
	_tmp20_ = header_bar;
	clocks_content_view_set_header_bar (_tmp19_, _tmp20_);
	clocks_alarm_face_load (self);
	gtk_widget_show_all ((GtkWidget*) self);
	_tmp21_ = self->priv->alarms;
	g_signal_connect_object ((GListModel*) _tmp21_, "items-changed", (GCallback) ___lambda35__g_list_model_items_changed, self, 0);
	clocks_alarm_face_reset_view (self);
	_tmp22_ = clocks_utils_wall_clock_get_default ();
	_tmp23_ = _tmp22_;
	g_signal_connect_object (_tmp23_, "tick", (GCallback) ___lambda36__clocks_utils_wall_clock_tick, self, 0);
	_g_object_unref0 (_tmp23_);
	_g_object_unref0 (action);
	_g_object_unref0 (app);
	return self;
}


ClocksAlarmFace* clocks_alarm_face_new (ClocksHeaderBar* header_bar) {
	return clocks_alarm_face_construct (CLOCKS_ALARM_TYPE_FACE, header_bar);
}


static void clocks_alarm_face_item_activated (ClocksAlarmFace* self, ClocksContentItem* item) {
	ClocksAlarmItem* alarm = NULL;
	ClocksContentItem* _tmp0_;
	ClocksAlarmItem* _tmp1_;
	ClocksAlarmItem* _tmp2_;
	ClocksAlarmItemState _tmp3_;
	ClocksAlarmItemState _tmp4_;
	g_return_if_fail (self != NULL);
	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_face_show_ringing_panel (self, _tmp5_);
	} else {
		ClocksAlarmItem* _tmp6_;
		_tmp6_ = alarm;
		clocks_alarm_face_edit (self, _tmp6_);
	}
	_g_object_unref0 (alarm);
}


static void _clocks_alarm_face_item_activated_clocks_content_view_item_activated (ClocksContentView* _sender, ClocksContentItem* item, gpointer self) {
	clocks_alarm_face_item_activated ((ClocksAlarmFace*) self, item);
}


static void clocks_alarm_face_dismiss_ringing_panel (ClocksAlarmFace* self) {
	g_return_if_fail (self != NULL);
	clocks_alarm_face_reset_view (self);
}


static void _clocks_alarm_face_dismiss_ringing_panel_clocks_alarm_ringing_panel_dismiss (ClocksAlarmRingingPanel* _sender, gpointer self) {
	clocks_alarm_face_dismiss_ringing_panel ((ClocksAlarmFace*) self);
}


static void clocks_alarm_face_visible_child_changed (ClocksAlarmFace* self) {
	gboolean _tmp0_ = FALSE;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GtkWidget* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp1_ = gtk_stack_get_visible_child ((GtkStack*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->empty_view;
	if (_tmp2_ == _tmp3_) {
		_tmp0_ = TRUE;
	} else {
		GtkWidget* _tmp4_;
		GtkWidget* _tmp5_;
		ClocksContentView* _tmp6_;
		_tmp4_ = gtk_stack_get_visible_child ((GtkStack*) self);
		_tmp5_ = _tmp4_;
		_tmp6_ = self->priv->content_view;
		_tmp0_ = _tmp5_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget);
	}
	if (_tmp0_) {
		ClocksHeaderBar* _tmp7_;
		ClocksHeaderBar* _tmp8_;
		_tmp7_ = clocks_clock_get_header_bar ((ClocksClock*) self);
		_tmp8_ = _tmp7_;
		clocks_header_bar_set_mode (_tmp8_, CLOCKS_HEADER_BAR_MODE_NORMAL);
	} else {
		GtkWidget* _tmp9_;
		GtkWidget* _tmp10_;
		ClocksAlarmRingingPanel* _tmp11_;
		_tmp9_ = gtk_stack_get_visible_child ((GtkStack*) self);
		_tmp10_ = _tmp9_;
		_tmp11_ = self->priv->ringing_panel;
		if (_tmp10_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_widget_get_type (), GtkWidget)) {
			ClocksHeaderBar* _tmp12_;
			ClocksHeaderBar* _tmp13_;
			_tmp12_ = clocks_clock_get_header_bar ((ClocksClock*) self);
			_tmp13_ = _tmp12_;
			clocks_header_bar_set_mode (_tmp13_, CLOCKS_HEADER_BAR_MODE_STANDALONE);
		}
	}
}


static void _clocks_alarm_face_visible_child_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	clocks_alarm_face_visible_child_changed ((ClocksAlarmFace*) self);
}


static ClocksContentItem* _clocks_alarm_item_deserialize_clocks_content_store_deserialize_item_func (GVariant* v, gpointer self) {
	ClocksContentItem* result;
	result = clocks_alarm_item_deserialize (v);
	return result;
}


static void clocks_alarm_face_load (ClocksAlarmFace* self) {
	ClocksContentStore* _tmp0_;
	GSettings* _tmp1_;
	GVariant* _tmp2_;
	GVariant* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->alarms;
	_tmp1_ = self->priv->settings;
	_tmp2_ = g_settings_get_value (_tmp1_, "alarms");
	_tmp3_ = _tmp2_;
	clocks_content_store_deserialize (_tmp0_, _tmp3_, _clocks_alarm_item_deserialize_clocks_content_store_deserialize_item_func, NULL);
	_g_variant_unref0 (_tmp3_);
}


static void clocks_alarm_face_save (ClocksAlarmFace* self) {
	GSettings* _tmp0_;
	ClocksContentStore* _tmp1_;
	GVariant* _tmp2_;
	GVariant* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->settings;
	_tmp1_ = self->priv->alarms;
	_tmp2_ = clocks_content_store_serialize (_tmp1_);
	_tmp3_ = _tmp2_;
	g_settings_set_value (_tmp0_, "alarms", _tmp3_);
	_g_variant_unref0 (_tmp3_);
}


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_)) {
		ClocksAlarmFace* self;
		self = _data3_->self;
		_g_object_unref0 (_data3_->alarm);
		_g_object_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}


static void __lambda41_ (Block3Data* _data3_, GtkDialog* dialog, gint response) {
	ClocksAlarmFace* self;
	gint _tmp0_;
	GtkDialog* _tmp4_;
	self = _data3_->self;
	g_return_if_fail (dialog != NULL);
	_tmp0_ = response;
	if (_tmp0_ == 1) {
		GtkDialog* _tmp1_;
		ClocksAlarmItem* _tmp2_;
		_tmp1_ = dialog;
		_tmp2_ = _data3_->alarm;
		clocks_alarm_setup_dialog_apply_to_alarm (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, CLOCKS_ALARM_TYPE_SETUP_DIALOG, ClocksAlarmSetupDialog), _tmp2_);
		clocks_alarm_face_save (self);
	} else {
		ClocksAlarmItem* _tmp3_;
		_tmp3_ = _data3_->alarm;
		clocks_alarm_item_set_active (_tmp3_, _data3_->saved_active);
	}
	_tmp4_ = dialog;
	gtk_widget_destroy ((GtkWidget*) _tmp4_);
}


static void ___lambda41__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
	__lambda41_ (self, _sender, response_id);
}


static void clocks_alarm_face_edit (ClocksAlarmFace* self, ClocksAlarmItem* alarm) {
	Block3Data* _data3_;
	ClocksAlarmItem* _tmp0_;
	ClocksAlarmItem* _tmp1_;
	ClocksAlarmSetupDialog* dialog = NULL;
	GtkWidget* _tmp2_;
	ClocksAlarmItem* _tmp3_;
	ClocksContentStore* _tmp4_;
	ClocksAlarmSetupDialog* _tmp5_;
	ClocksAlarmItem* _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	ClocksAlarmItem* _tmp9_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (alarm != NULL);
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	_data3_->self = g_object_ref (self);
	_tmp0_ = alarm;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data3_->alarm);
	_data3_->alarm = _tmp1_;
	_tmp2_ = gtk_widget_get_toplevel ((GtkWidget*) self);
	_tmp3_ = _data3_->alarm;
	_tmp4_ = self->priv->alarms;
	_tmp5_ = clocks_alarm_setup_dialog_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_window_get_type (), GtkWindow), _tmp3_, (GListModel*) _tmp4_);
	g_object_ref_sink (_tmp5_);
	dialog = _tmp5_;
	_tmp6_ = _data3_->alarm;
	_tmp7_ = clocks_alarm_item_get_active (_tmp6_);
	_tmp8_ = _tmp7_;
	_data3_->saved_active = _tmp8_;
	_tmp9_ = _data3_->alarm;
	clocks_alarm_item_set_active (_tmp9_, FALSE);
	g_signal_connect_data ((GtkDialog*) dialog, "response", (GCallback) ___lambda41__gtk_dialog_response, block3_data_ref (_data3_), (GClosureNotify) block3_data_unref, 0);
	gtk_widget_show_all ((GtkWidget*) dialog);
	_g_object_unref0 (dialog);
	block3_data_unref (_data3_);
	_data3_ = NULL;
}


static void clocks_alarm_face_show_ringing_panel (ClocksAlarmFace* 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;
	gtk_stack_set_visible_child ((GtkStack*) self, (GtkWidget*) _tmp3_);
}


static void clocks_alarm_face_reset_view (ClocksAlarmFace* self) {
	GtkWidget* _tmp0_ = NULL;
	ClocksContentStore* _tmp1_;
	guint _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->alarms;
	_tmp2_ = g_list_model_get_n_items ((GListModel*) _tmp1_);
	if (_tmp2_ == ((guint) 0)) {
		GtkWidget* _tmp3_;
		_tmp3_ = self->priv->empty_view;
		_tmp0_ = _tmp3_;
	} else {
		ClocksContentView* _tmp4_;
		_tmp4_ = self->priv->content_view;
		_tmp0_ = (GtkWidget*) _tmp4_;
	}
	gtk_stack_set_visible_child ((GtkStack*) self, _tmp0_);
	g_signal_emit_by_name ((ClocksClock*) self, "request-header-bar-update");
}


static void __lambda42_ (ClocksAlarmFace* self, GtkDialog* dialog, gint response) {
	gint _tmp0_;
	GtkDialog* _tmp6_;
	g_return_if_fail (dialog != NULL);
	_tmp0_ = response;
	if (_tmp0_ == 1) {
		ClocksAlarmItem* alarm = NULL;
		ClocksAlarmItem* _tmp1_;
		GtkDialog* _tmp2_;
		ClocksAlarmItem* _tmp3_;
		ClocksContentStore* _tmp4_;
		ClocksAlarmItem* _tmp5_;
		_tmp1_ = clocks_alarm_item_new (NULL);
		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_ = self->priv->alarms;
		_tmp5_ = alarm;
		clocks_content_store_add (_tmp4_, (ClocksContentItem*) _tmp5_);
		clocks_alarm_face_save (self);
		_g_object_unref0 (alarm);
	}
	_tmp6_ = dialog;
	gtk_widget_destroy ((GtkWidget*) _tmp6_);
}


static void ___lambda42__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
	__lambda42_ ((ClocksAlarmFace*) self, _sender, response_id);
}


static void clocks_alarm_face_real_activate_new (ClocksClock* base) {
	ClocksAlarmFace * self;
	ClocksAlarmSetupDialog* dialog = NULL;
	GtkWidget* _tmp0_;
	ClocksContentStore* _tmp1_;
	ClocksAlarmSetupDialog* _tmp2_;
	self = (ClocksAlarmFace*) base;
	_tmp0_ = gtk_widget_get_toplevel ((GtkWidget*) self);
	_tmp1_ = self->priv->alarms;
	_tmp2_ = clocks_alarm_setup_dialog_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_window_get_type (), GtkWindow), NULL, (GListModel*) _tmp1_);
	g_object_ref_sink (_tmp2_);
	dialog = _tmp2_;
	g_signal_connect_object ((GtkDialog*) dialog, "response", (GCallback) ___lambda42__gtk_dialog_response, self, 0);
	gtk_widget_show_all ((GtkWidget*) dialog);
	_g_object_unref0 (dialog);
}


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


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


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


static void clocks_alarm_face_real_update_header_bar (ClocksClock* base) {
	ClocksAlarmFace * self;
	ClocksHeaderBar* _tmp0_;
	ClocksHeaderBar* _tmp1_;
	ClocksHeaderBarMode _tmp2_;
	ClocksHeaderBarMode _tmp3_;
	self = (ClocksAlarmFace*) 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:
		{
			GtkButton* _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_;
			_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_;
			gtk_header_bar_set_title ((GtkHeaderBar*) _tmp8_, _tmp13_);
			break;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}


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


static void clocks_alarm_face_real_set_label (ClocksClock* base, const gchar* value) {
	ClocksAlarmFace* self;
	self = (ClocksAlarmFace*) base;
	if (g_strcmp0 (value, clocks_alarm_face_real_get_label (base)) != 0) {
		const gchar* _tmp0_;
		gchar* _tmp1_;
		_tmp0_ = value;
		_tmp1_ = g_strdup (_tmp0_);
		_g_free0 (self->priv->_label);
		self->priv->_label = _tmp1_;
		g_object_notify_by_pspec ((GObject *) self, clocks_alarm_face_properties[CLOCKS_ALARM_FACE_LABEL_PROPERTY]);
	}
}


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


static void clocks_alarm_face_real_set_header_bar (ClocksClock* base, ClocksHeaderBar* value) {
	ClocksAlarmFace* self;
	self = (ClocksAlarmFace*) base;
	if (clocks_alarm_face_real_get_header_bar (base) != value) {
		ClocksHeaderBar* _tmp0_;
		ClocksHeaderBar* _tmp1_;
		_tmp0_ = value;
		_tmp1_ = _g_object_ref0 (_tmp0_);
		_g_object_unref0 (self->priv->_header_bar);
		self->priv->_header_bar = _tmp1_;
		g_object_notify_by_pspec ((GObject *) self, clocks_alarm_face_properties[CLOCKS_ALARM_FACE_HEADER_BAR_PROPERTY]);
	}
}


static ClocksPanelId clocks_alarm_face_real_get_panel_id (ClocksClock* base) {
	ClocksPanelId result;
	ClocksAlarmFace* self;
	ClocksPanelId _tmp0_;
	self = (ClocksAlarmFace*) base;
	_tmp0_ = self->priv->_panel_id;
	result = _tmp0_;
	return result;
}


static void clocks_alarm_face_real_set_panel_id (ClocksClock* base, ClocksPanelId value) {
	ClocksAlarmFace* self;
	self = (ClocksAlarmFace*) base;
	if (clocks_alarm_face_real_get_panel_id (base) != value) {
		ClocksPanelId _tmp0_;
		_tmp0_ = value;
		self->priv->_panel_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, clocks_alarm_face_properties[CLOCKS_ALARM_FACE_PANEL_ID_PROPERTY]);
	}
}


static void clocks_alarm_face_class_init (ClocksAlarmFaceClass * klass) {
	gint ClocksAlarmFace_private_offset;
	clocks_alarm_face_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ClocksAlarmFacePrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_clocks_alarm_face_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_clocks_alarm_face_set_property;
	G_OBJECT_CLASS (klass)->finalize = clocks_alarm_face_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_ALARM_FACE_LABEL_PROPERTY, clocks_alarm_face_properties[CLOCKS_ALARM_FACE_LABEL_PROPERTY] = 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_FACE_HEADER_BAR_PROPERTY, clocks_alarm_face_properties[CLOCKS_ALARM_FACE_HEADER_BAR_PROPERTY] = 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_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_ALARM_FACE_PANEL_ID_PROPERTY, clocks_alarm_face_properties[CLOCKS_ALARM_FACE_PANEL_ID_PROPERTY] = g_param_spec_enum ("panel-id", "panel-id", "panel-id", CLOCKS_TYPE_PANEL_ID, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	ClocksAlarmFace_private_offset = g_type_class_get_instance_private_offset (klass);
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/clocks/ui/alarm.ui");
	clocks_alarm_face_signals[CLOCKS_ALARM_FACE_RING_SIGNAL] = g_signal_new ("ring", CLOCKS_ALARM_TYPE_FACE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "empty_view", FALSE, ClocksAlarmFace_private_offset + G_STRUCT_OFFSET (ClocksAlarmFacePrivate, empty_view));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "content_view", FALSE, ClocksAlarmFace_private_offset + G_STRUCT_OFFSET (ClocksAlarmFacePrivate, content_view));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "ringing_panel", FALSE, ClocksAlarmFace_private_offset + G_STRUCT_OFFSET (ClocksAlarmFacePrivate, ringing_panel));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "item_activated", G_CALLBACK(_clocks_alarm_face_item_activated_clocks_content_view_item_activated));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "dismiss_ringing_panel", G_CALLBACK(_clocks_alarm_face_dismiss_ringing_panel_clocks_alarm_ringing_panel_dismiss));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "visible_child_changed", G_CALLBACK(_clocks_alarm_face_visible_child_changed_g_object_notify));
}


static void clocks_alarm_face_clocks_clock_interface_init (ClocksClockIface * iface) {
	clocks_alarm_face_clocks_clock_parent_iface = g_type_interface_peek_parent (iface);
	iface->activate_new = (void (*) (ClocksClock *)) clocks_alarm_face_real_activate_new;
	iface->activate_select_all = (void (*) (ClocksClock *)) clocks_alarm_face_real_activate_select_all;
	iface->activate_select_none = (void (*) (ClocksClock *)) clocks_alarm_face_real_activate_select_none;
	iface->escape_pressed = (gboolean (*) (ClocksClock *)) clocks_alarm_face_real_escape_pressed;
	iface->update_header_bar = (void (*) (ClocksClock *)) clocks_alarm_face_real_update_header_bar;
	iface->get_label = clocks_alarm_face_real_get_label;
	iface->set_label = clocks_alarm_face_real_set_label;
	iface->get_header_bar = clocks_alarm_face_real_get_header_bar;
	iface->set_header_bar = clocks_alarm_face_real_set_header_bar;
	iface->get_panel_id = clocks_alarm_face_real_get_panel_id;
	iface->set_panel_id = clocks_alarm_face_real_set_panel_id;
}


static void clocks_alarm_face_instance_init (ClocksAlarmFace * self) {
	self->priv = CLOCKS_ALARM_FACE_GET_PRIVATE (self);
	g_type_ensure (CLOCKS_TYPE_CONTENT_VIEW);
	g_type_ensure (CLOCKS_ALARM_TYPE_RINGING_PANEL);
	gtk_widget_init_template (GTK_WIDGET (self));
}


static void clocks_alarm_face_finalize (GObject * obj) {
	ClocksAlarmFace * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_ALARM_TYPE_FACE, ClocksAlarmFace);
	_g_free0 (self->priv->_label);
	_g_object_unref0 (self->priv->_header_bar);
	_g_object_unref0 (self->priv->alarms);
	_g_object_unref0 (self->priv->settings);
	_g_object_unref0 (self->priv->new_button);
	_g_object_unref0 (self->priv->empty_view);
	_g_object_unref0 (self->priv->content_view);
	_g_object_unref0 (self->priv->ringing_panel);
	G_OBJECT_CLASS (clocks_alarm_face_parent_class)->finalize (obj);
}


GType clocks_alarm_face_get_type (void) {
	static volatile gsize clocks_alarm_face_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_alarm_face_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ClocksAlarmFaceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_alarm_face_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksAlarmFace), 0, (GInstanceInitFunc) clocks_alarm_face_instance_init, NULL };
		static const GInterfaceInfo clocks_clock_info = { (GInterfaceInitFunc) clocks_alarm_face_clocks_clock_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType clocks_alarm_face_type_id;
		clocks_alarm_face_type_id = g_type_register_static (gtk_stack_get_type (), "ClocksAlarmFace", &g_define_type_info, 0);
		g_type_add_interface_static (clocks_alarm_face_type_id, CLOCKS_TYPE_CLOCK, &clocks_clock_info);
		g_once_init_leave (&clocks_alarm_face_type_id__volatile, clocks_alarm_face_type_id);
	}
	return clocks_alarm_face_type_id__volatile;
}


static void _vala_clocks_alarm_face_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ClocksAlarmFace * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_ALARM_TYPE_FACE, ClocksAlarmFace);
	switch (property_id) {
		case CLOCKS_ALARM_FACE_LABEL_PROPERTY:
		g_value_set_string (value, clocks_clock_get_label ((ClocksClock*) self));
		break;
		case CLOCKS_ALARM_FACE_HEADER_BAR_PROPERTY:
		g_value_set_object (value, clocks_clock_get_header_bar ((ClocksClock*) self));
		break;
		case CLOCKS_ALARM_FACE_PANEL_ID_PROPERTY:
		g_value_set_enum (value, clocks_clock_get_panel_id ((ClocksClock*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_clocks_alarm_face_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	ClocksAlarmFace * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_ALARM_TYPE_FACE, ClocksAlarmFace);
	switch (property_id) {
		case CLOCKS_ALARM_FACE_LABEL_PROPERTY:
		clocks_clock_set_label ((ClocksClock*) self, g_value_get_string (value));
		break;
		case CLOCKS_ALARM_FACE_HEADER_BAR_PROPERTY:
		clocks_clock_set_header_bar ((ClocksClock*) self, g_value_get_object (value));
		break;
		case CLOCKS_ALARM_FACE_PANEL_ID_PROPERTY:
		clocks_clock_set_panel_id ((ClocksClock*) self, g_value_get_enum (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);
}



