/* window.c generated by valac 0.21.1.1-0d6f, the Vala compiler
 * generated from window.vala, do not modify */

/*
 * Copyright (C) 2013  Paolo Borelli <pborelli@gnome.org>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <gdk/gdk.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include "config.h"


#define CLOCKS_TYPE_WINDOW (clocks_window_get_type ())
#define CLOCKS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TYPE_WINDOW, ClocksWindow))
#define CLOCKS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_TYPE_WINDOW, ClocksWindowClass))
#define CLOCKS_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TYPE_WINDOW))
#define CLOCKS_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_TYPE_WINDOW))
#define CLOCKS_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_TYPE_WINDOW, ClocksWindowClass))

typedef struct _ClocksWindow ClocksWindow;
typedef struct _ClocksWindowClass ClocksWindowClass;
typedef struct _ClocksWindowPrivate ClocksWindowPrivate;

#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 _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (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;
typedef struct _Block1Data Block1Data;

#define CLOCKS_TYPE_PANEL_ID (clocks_panel_id_get_type ())

#define CLOCKS_WORLD_TYPE_MAIN_PANEL (clocks_world_main_panel_get_type ())
#define CLOCKS_WORLD_MAIN_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_WORLD_TYPE_MAIN_PANEL, ClocksWorldMainPanel))
#define CLOCKS_WORLD_MAIN_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_WORLD_TYPE_MAIN_PANEL, ClocksWorldMainPanelClass))
#define CLOCKS_WORLD_IS_MAIN_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_WORLD_TYPE_MAIN_PANEL))
#define CLOCKS_WORLD_IS_MAIN_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_WORLD_TYPE_MAIN_PANEL))
#define CLOCKS_WORLD_MAIN_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_WORLD_TYPE_MAIN_PANEL, ClocksWorldMainPanelClass))

typedef struct _ClocksWorldMainPanel ClocksWorldMainPanel;
typedef struct _ClocksWorldMainPanelClass ClocksWorldMainPanelClass;

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

typedef struct _ClocksAlarmMainPanel ClocksAlarmMainPanel;
typedef struct _ClocksAlarmMainPanelClass ClocksAlarmMainPanelClass;

#define CLOCKS_STOPWATCH_TYPE_MAIN_PANEL (clocks_stopwatch_main_panel_get_type ())
#define CLOCKS_STOPWATCH_MAIN_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_STOPWATCH_TYPE_MAIN_PANEL, ClocksStopwatchMainPanel))
#define CLOCKS_STOPWATCH_MAIN_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_STOPWATCH_TYPE_MAIN_PANEL, ClocksStopwatchMainPanelClass))
#define CLOCKS_STOPWATCH_IS_MAIN_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_STOPWATCH_TYPE_MAIN_PANEL))
#define CLOCKS_STOPWATCH_IS_MAIN_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_STOPWATCH_TYPE_MAIN_PANEL))
#define CLOCKS_STOPWATCH_MAIN_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_STOPWATCH_TYPE_MAIN_PANEL, ClocksStopwatchMainPanelClass))

typedef struct _ClocksStopwatchMainPanel ClocksStopwatchMainPanel;
typedef struct _ClocksStopwatchMainPanelClass ClocksStopwatchMainPanelClass;

#define CLOCKS_TIMER_TYPE_MAIN_PANEL (clocks_timer_main_panel_get_type ())
#define CLOCKS_TIMER_MAIN_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TIMER_TYPE_MAIN_PANEL, ClocksTimerMainPanel))
#define CLOCKS_TIMER_MAIN_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_TIMER_TYPE_MAIN_PANEL, ClocksTimerMainPanelClass))
#define CLOCKS_TIMER_IS_MAIN_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TIMER_TYPE_MAIN_PANEL))
#define CLOCKS_TIMER_IS_MAIN_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_TIMER_TYPE_MAIN_PANEL))
#define CLOCKS_TIMER_MAIN_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_TIMER_TYPE_MAIN_PANEL, ClocksTimerMainPanelClass))

typedef struct _ClocksTimerMainPanel ClocksTimerMainPanel;
typedef struct _ClocksTimerMainPanelClass ClocksTimerMainPanelClass;

#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_HEADER_BAR_TYPE_MODE (clocks_header_bar_mode_get_type ())

struct _ClocksWindow {
	GtkApplicationWindow parent_instance;
	ClocksWindowPrivate * priv;
};

struct _ClocksWindowClass {
	GtkApplicationWindowClass parent_class;
};

struct _ClocksWindowPrivate {
	ClocksHeaderBar* header_bar;
	GtkStack* stack;
	GtkStackSwitcher* stack_switcher;
	GSettings* settings;
	GtkWidget** panels;
	gint panels_length1;
	gint _panels_size_;
	GtkSeparator* separator;
	GtkButton* close_button;
};

struct _Block1Data {
	int _ref_count_;
	ClocksWindow * self;
	gulong stack_id;
	gulong header_bar_id;
};

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

typedef enum  {
	CLOCKS_HEADER_BAR_MODE_NORMAL,
	CLOCKS_HEADER_BAR_MODE_SELECTION,
	CLOCKS_HEADER_BAR_MODE_STANDALONE
} ClocksHeaderBarMode;


static gpointer clocks_window_parent_class = NULL;

GType clocks_window_get_type (void) G_GNUC_CONST;
GType clocks_header_bar_get_type (void) G_GNUC_CONST;
#define CLOCKS_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLOCKS_TYPE_WINDOW, ClocksWindowPrivate))
enum  {
	CLOCKS_WINDOW_DUMMY_PROPERTY
};
static void clocks_window_on_new_activate (ClocksWindow* self);
static void _clocks_window_on_new_activate_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void clocks_window_on_about_activate (ClocksWindow* self);
static void _clocks_window_on_about_activate_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void clocks_window_on_select_all_activate (ClocksWindow* self);
static void _clocks_window_on_select_all_activate_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void clocks_window_on_select_none_activate (ClocksWindow* self);
static void _clocks_window_on_select_none_activate_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
GType clocks_application_get_type (void) G_GNUC_CONST;
ClocksWindow* clocks_window_new (ClocksApplication* app);
ClocksWindow* clocks_window_construct (GType object_type, ClocksApplication* app);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
#define CLOCKS_N_PANELS 4
GType clocks_panel_id_get_type (void) G_GNUC_CONST;
ClocksWorldMainPanel* clocks_world_main_panel_new (ClocksHeaderBar* header_bar);
ClocksWorldMainPanel* clocks_world_main_panel_construct (GType object_type, ClocksHeaderBar* header_bar);
GType clocks_world_main_panel_get_type (void) G_GNUC_CONST;
ClocksAlarmMainPanel* clocks_alarm_main_panel_new (ClocksHeaderBar* header_bar);
ClocksAlarmMainPanel* clocks_alarm_main_panel_construct (GType object_type, ClocksHeaderBar* header_bar);
GType clocks_alarm_main_panel_get_type (void) G_GNUC_CONST;
ClocksStopwatchMainPanel* clocks_stopwatch_main_panel_new (ClocksHeaderBar* header_bar);
ClocksStopwatchMainPanel* clocks_stopwatch_main_panel_construct (GType object_type, ClocksHeaderBar* header_bar);
GType clocks_stopwatch_main_panel_get_type (void) G_GNUC_CONST;
ClocksTimerMainPanel* clocks_timer_main_panel_new (ClocksHeaderBar* header_bar);
ClocksTimerMainPanel* clocks_timer_main_panel_construct (GType object_type, ClocksHeaderBar* header_bar);
GType clocks_timer_main_panel_get_type (void) G_GNUC_CONST;
GType clocks_clock_get_type (void) G_GNUC_CONST;
const gchar* clocks_clock_get_label (ClocksClock* self);
static void __lambda44_ (ClocksWindow* self);
static void ___lambda44__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda45_ (ClocksWindow* self);
static void clocks_window_update_header_bar (ClocksWindow* self);
static void ___lambda45__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void __lambda46_ (ClocksWindow* self);
static void ___lambda46__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void __lambda47_ (Block1Data* _data1_);
static void ___lambda47__gtk_widget_destroy (GtkWidget* _sender, gpointer self);
static void __lambda48_ (ClocksWindow* self, ClocksAlarmMainPanel* w);
static void ___lambda48__clocks_alarm_main_panel_ring (ClocksAlarmMainPanel* _sender, gpointer self);
static void __lambda49_ (ClocksWindow* self, ClocksTimerMainPanel* w);
static void ___lambda49__clocks_timer_main_panel_ring (ClocksTimerMainPanel* _sender, gpointer self);
void clocks_clock_activate_new (ClocksClock* self);
void clocks_clock_activate_select_all (ClocksClock* self);
void clocks_clock_activate_select_none (ClocksClock* self);
static gboolean clocks_window_real_key_press_event (GtkWidget* base, GdkEventKey* event);
gboolean clocks_clock_escape_pressed (ClocksClock* self);
static gboolean clocks_window_real_configure_event (GtkWidget* base, GdkEventConfigure* event);
static gboolean clocks_window_real_window_state_event (GtkWidget* base, GdkEventWindowState* event);
void clocks_header_bar_clear (ClocksHeaderBar* self);
ClocksPanelId clocks_clock_get_panel_id (ClocksClock* self);
void clocks_clock_update_header_bar (ClocksClock* self);
GType clocks_header_bar_mode_get_type (void) G_GNUC_CONST;
ClocksHeaderBarMode clocks_header_bar_get_mode (ClocksHeaderBar* self);
static void clocks_window_finalize (GObject* obj);
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);

static const GActionEntry CLOCKS_WINDOW_action_entries[4] = {{"new", _clocks_window_on_new_activate_gsimple_action_activate_callback}, {"about", _clocks_window_on_about_activate_gsimple_action_activate_callback}, {"select-all", _clocks_window_on_select_all_activate_gsimple_action_activate_callback}, {"select-none", _clocks_window_on_select_none_activate_gsimple_action_activate_callback}};

static void _clocks_window_on_new_activate_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	clocks_window_on_new_activate (self);
}


static void _clocks_window_on_about_activate_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	clocks_window_on_about_activate (self);
}


static void _clocks_window_on_select_all_activate_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	clocks_window_on_select_all_activate (self);
}


static void _clocks_window_on_select_none_activate_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
	clocks_window_on_select_none_activate (self);
}


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_)) {
		ClocksWindow * self;
		self = _data1_->self;
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}


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


static void __lambda44_ (ClocksWindow* self) {
	gtk_window_close ((GtkWindow*) self);
}


static void ___lambda44__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda44_ (self);
}


static void __lambda45_ (ClocksWindow* self) {
	clocks_window_update_header_bar (self);
}


static void ___lambda45__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda45_ (self);
}


static void __lambda46_ (ClocksWindow* self) {
	clocks_window_update_header_bar (self);
}


static void ___lambda46__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda46_ (self);
}


static void __lambda47_ (Block1Data* _data1_) {
	ClocksWindow * self;
	ClocksHeaderBar* _tmp0_ = NULL;
	GtkStack* _tmp1_ = NULL;
	self = _data1_->self;
	_tmp0_ = self->priv->header_bar;
	g_signal_handler_disconnect ((GObject*) _tmp0_, _data1_->header_bar_id);
	_data1_->header_bar_id = (gulong) 0;
	_tmp1_ = self->priv->stack;
	g_signal_handler_disconnect ((GObject*) _tmp1_, _data1_->stack_id);
	_data1_->stack_id = (gulong) 0;
}


static void ___lambda47__gtk_widget_destroy (GtkWidget* _sender, gpointer self) {
	__lambda47_ (self);
}


static void __lambda48_ (ClocksWindow* self, ClocksAlarmMainPanel* w) {
	GtkStack* _tmp0_ = NULL;
	ClocksAlarmMainPanel* _tmp1_ = NULL;
	g_return_if_fail (w != NULL);
	_tmp0_ = self->priv->stack;
	_tmp1_ = w;
	gtk_stack_set_visible_child (_tmp0_, (GtkWidget*) _tmp1_);
}


static void ___lambda48__clocks_alarm_main_panel_ring (ClocksAlarmMainPanel* _sender, gpointer self) {
	__lambda48_ (self, _sender);
}


static void __lambda49_ (ClocksWindow* self, ClocksTimerMainPanel* w) {
	GtkStack* _tmp0_ = NULL;
	ClocksTimerMainPanel* _tmp1_ = NULL;
	g_return_if_fail (w != NULL);
	_tmp0_ = self->priv->stack;
	_tmp1_ = w;
	gtk_stack_set_visible_child (_tmp0_, (GtkWidget*) _tmp1_);
}


static void ___lambda49__clocks_timer_main_panel_ring (ClocksTimerMainPanel* _sender, gpointer self) {
	__lambda49_ (self, _sender);
}


ClocksWindow* clocks_window_construct (GType object_type, ClocksApplication* app) {
	ClocksWindow * self = NULL;
	Block1Data* _data1_;
	ClocksApplication* _tmp0_ = NULL;
	GSettings* _tmp1_ = NULL;
	GdkWindowState window_state = 0;
	GSettings* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	GdkWindowState _tmp4_ = 0;
	gint width = 0;
	gint height = 0;
	GSettings* _tmp5_ = NULL;
	gint _tmp6_ = 0;
	gint _tmp7_ = 0;
	GtkWidget** _tmp8_ = NULL;
	GtkWidget** _tmp9_ = NULL;
	gint _tmp9__length1 = 0;
	ClocksHeaderBar* _tmp10_ = NULL;
	ClocksWorldMainPanel* _tmp11_ = NULL;
	GtkWidget* _tmp12_ = NULL;
	GtkWidget** _tmp13_ = NULL;
	gint _tmp13__length1 = 0;
	ClocksHeaderBar* _tmp14_ = NULL;
	ClocksAlarmMainPanel* _tmp15_ = NULL;
	GtkWidget* _tmp16_ = NULL;
	GtkWidget** _tmp17_ = NULL;
	gint _tmp17__length1 = 0;
	ClocksHeaderBar* _tmp18_ = NULL;
	ClocksStopwatchMainPanel* _tmp19_ = NULL;
	GtkWidget* _tmp20_ = NULL;
	GtkWidget** _tmp21_ = NULL;
	gint _tmp21__length1 = 0;
	ClocksHeaderBar* _tmp22_ = NULL;
	ClocksTimerMainPanel* _tmp23_ = NULL;
	GtkWidget* _tmp24_ = NULL;
	GtkWidget** _tmp25_ = NULL;
	gint _tmp25__length1 = 0;
	GtkStackSwitcher* _tmp35_ = NULL;
	GtkStack* _tmp36_ = NULL;
	GtkSeparator* _tmp37_ = NULL;
	GtkSeparator* _tmp38_ = NULL;
	GtkSeparator* _tmp39_ = NULL;
	ClocksHeaderBar* _tmp40_ = NULL;
	GtkSeparator* _tmp41_ = NULL;
	GtkButton* _tmp42_ = NULL;
	GtkImage* close_image = NULL;
	GtkImage* _tmp43_ = NULL;
	GtkButton* _tmp44_ = NULL;
	GtkButton* _tmp45_ = NULL;
	GtkStyleContext* _tmp46_ = NULL;
	GtkButton* _tmp47_ = NULL;
	GtkButton* _tmp48_ = NULL;
	GtkButton* _tmp49_ = NULL;
	GtkButton* _tmp50_ = NULL;
	ClocksHeaderBar* _tmp51_ = NULL;
	GtkButton* _tmp52_ = NULL;
	GtkStack* _tmp53_ = NULL;
	gulong _tmp54_ = 0UL;
	ClocksHeaderBar* _tmp55_ = NULL;
	gulong _tmp56_ = 0UL;
	GtkStack* _tmp57_ = NULL;
	GtkWidget** _tmp58_ = NULL;
	gint _tmp58__length1 = 0;
	GtkWidget* _tmp59_ = NULL;
	GtkWidget** _tmp60_ = NULL;
	gint _tmp60__length1 = 0;
	GtkWidget* _tmp61_ = NULL;
	GtkStack* _tmp62_ = NULL;
	GtkWidget** _tmp63_ = NULL;
	gint _tmp63__length1 = 0;
	GSettings* _tmp64_ = NULL;
	gint _tmp65_ = 0;
	GtkWidget* _tmp66_ = NULL;
	g_return_val_if_fail (app != NULL, NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_tmp0_ = app;
	self = (ClocksWindow*) g_object_new (object_type, "application", _tmp0_, NULL);
	_data1_->self = g_object_ref (self);
	g_action_map_add_action_entries ((GActionMap*) self, CLOCKS_WINDOW_action_entries, G_N_ELEMENTS (CLOCKS_WINDOW_action_entries), self);
	_tmp1_ = g_settings_new ("org.gnome.clocks.state.window");
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp1_;
	_tmp2_ = self->priv->settings;
	_tmp3_ = g_settings_get_int (_tmp2_, "state");
	window_state = (GdkWindowState) _tmp3_;
	_tmp4_ = window_state;
	if ((_tmp4_ & GDK_WINDOW_STATE_MAXIMIZED) == GDK_WINDOW_STATE_MAXIMIZED) {
		gtk_window_maximize ((GtkWindow*) self);
	}
	_tmp5_ = self->priv->settings;
	g_settings_get (_tmp5_, "size", "(ii)", &width, &height);
	_tmp6_ = width;
	_tmp7_ = height;
	gtk_window_resize ((GtkWindow*) self, _tmp6_, _tmp7_);
	_tmp8_ = g_new0 (GtkWidget*, CLOCKS_N_PANELS + 1);
	self->priv->panels = (_vala_array_free (self->priv->panels, self->priv->panels_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->panels = _tmp8_;
	self->priv->panels_length1 = CLOCKS_N_PANELS;
	self->priv->_panels_size_ = self->priv->panels_length1;
	_tmp9_ = self->priv->panels;
	_tmp9__length1 = self->priv->panels_length1;
	_tmp10_ = self->priv->header_bar;
	_tmp11_ = clocks_world_main_panel_new (_tmp10_);
	g_object_ref_sink (_tmp11_);
	_g_object_unref0 (_tmp9_[CLOCKS_PANEL_ID_WORLD]);
	_tmp9_[CLOCKS_PANEL_ID_WORLD] = (GtkWidget*) _tmp11_;
	_tmp12_ = _tmp9_[CLOCKS_PANEL_ID_WORLD];
	_tmp13_ = self->priv->panels;
	_tmp13__length1 = self->priv->panels_length1;
	_tmp14_ = self->priv->header_bar;
	_tmp15_ = clocks_alarm_main_panel_new (_tmp14_);
	g_object_ref_sink (_tmp15_);
	_g_object_unref0 (_tmp13_[CLOCKS_PANEL_ID_ALARM]);
	_tmp13_[CLOCKS_PANEL_ID_ALARM] = (GtkWidget*) _tmp15_;
	_tmp16_ = _tmp13_[CLOCKS_PANEL_ID_ALARM];
	_tmp17_ = self->priv->panels;
	_tmp17__length1 = self->priv->panels_length1;
	_tmp18_ = self->priv->header_bar;
	_tmp19_ = clocks_stopwatch_main_panel_new (_tmp18_);
	g_object_ref_sink (_tmp19_);
	_g_object_unref0 (_tmp17_[CLOCKS_PANEL_ID_STOPWATCH]);
	_tmp17_[CLOCKS_PANEL_ID_STOPWATCH] = (GtkWidget*) _tmp19_;
	_tmp20_ = _tmp17_[CLOCKS_PANEL_ID_STOPWATCH];
	_tmp21_ = self->priv->panels;
	_tmp21__length1 = self->priv->panels_length1;
	_tmp22_ = self->priv->header_bar;
	_tmp23_ = clocks_timer_main_panel_new (_tmp22_);
	g_object_ref_sink (_tmp23_);
	_g_object_unref0 (_tmp21_[CLOCKS_PANEL_ID_TIMER]);
	_tmp21_[CLOCKS_PANEL_ID_TIMER] = (GtkWidget*) _tmp23_;
	_tmp24_ = _tmp21_[CLOCKS_PANEL_ID_TIMER];
	_tmp25_ = self->priv->panels;
	_tmp25__length1 = self->priv->panels_length1;
	{
		GtkWidget** clock_collection = NULL;
		gint clock_collection_length1 = 0;
		gint _clock_collection_size_ = 0;
		gint clock_it = 0;
		clock_collection = _tmp25_;
		clock_collection_length1 = _tmp25__length1;
		for (clock_it = 0; clock_it < _tmp25__length1; clock_it = clock_it + 1) {
			GtkWidget* _tmp26_ = NULL;
			GtkWidget* clock = NULL;
			_tmp26_ = _g_object_ref0 (clock_collection[clock_it]);
			clock = _tmp26_;
			{
				GtkStack* _tmp27_ = NULL;
				GtkWidget* _tmp28_ = NULL;
				GtkWidget* _tmp29_ = NULL;
				const gchar* _tmp30_ = NULL;
				const gchar* _tmp31_ = NULL;
				GtkWidget* _tmp32_ = NULL;
				const gchar* _tmp33_ = NULL;
				const gchar* _tmp34_ = NULL;
				_tmp27_ = self->priv->stack;
				_tmp28_ = clock;
				_tmp29_ = clock;
				_tmp30_ = clocks_clock_get_label (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, CLOCKS_TYPE_CLOCK, ClocksClock));
				_tmp31_ = _tmp30_;
				_tmp32_ = clock;
				_tmp33_ = clocks_clock_get_label (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, CLOCKS_TYPE_CLOCK, ClocksClock));
				_tmp34_ = _tmp33_;
				gtk_stack_add_titled (_tmp27_, _tmp28_, _tmp31_, _tmp34_);
				_g_object_unref0 (clock);
			}
		}
	}
	_tmp35_ = self->priv->stack_switcher;
	_tmp36_ = self->priv->stack;
	gtk_stack_switcher_set_stack (_tmp35_, _tmp36_);
	_tmp37_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_VERTICAL);
	g_object_ref_sink (_tmp37_);
	_g_object_unref0 (self->priv->separator);
	self->priv->separator = _tmp37_;
	_tmp38_ = self->priv->separator;
	gtk_widget_set_no_show_all ((GtkWidget*) _tmp38_, TRUE);
	_tmp39_ = self->priv->separator;
	gtk_widget_set_valign ((GtkWidget*) _tmp39_, GTK_ALIGN_FILL);
	_tmp40_ = self->priv->header_bar;
	_tmp41_ = self->priv->separator;
	gtk_header_bar_pack_end ((GtkHeaderBar*) _tmp40_, (GtkWidget*) _tmp41_);
	_tmp42_ = (GtkButton*) gtk_button_new ();
	g_object_ref_sink (_tmp42_);
	_g_object_unref0 (self->priv->close_button);
	self->priv->close_button = _tmp42_;
	_tmp43_ = (GtkImage*) gtk_image_new_from_icon_name ("window-close-symbolic", GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp43_);
	close_image = _tmp43_;
	_tmp44_ = self->priv->close_button;
	gtk_button_set_image (_tmp44_, (GtkWidget*) close_image);
	_tmp45_ = self->priv->close_button;
	_tmp46_ = gtk_widget_get_style_context ((GtkWidget*) _tmp45_);
	gtk_style_context_add_class (_tmp46_, "image-button");
	_tmp47_ = self->priv->close_button;
	gtk_widget_set_no_show_all ((GtkWidget*) _tmp47_, TRUE);
	_tmp48_ = self->priv->close_button;
	gtk_button_set_relief (_tmp48_, GTK_RELIEF_NONE);
	_tmp49_ = self->priv->close_button;
	gtk_widget_set_valign ((GtkWidget*) _tmp49_, GTK_ALIGN_CENTER);
	_tmp50_ = self->priv->close_button;
	g_signal_connect_object (_tmp50_, "clicked", (GCallback) ___lambda44__gtk_button_clicked, self, 0);
	_tmp51_ = self->priv->header_bar;
	_tmp52_ = self->priv->close_button;
	gtk_header_bar_pack_end ((GtkHeaderBar*) _tmp51_, (GtkWidget*) _tmp52_);
	_tmp53_ = self->priv->stack;
	_tmp54_ = g_signal_connect_object ((GObject*) _tmp53_, "notify::visible-child", (GCallback) ___lambda45__g_object_notify, self, 0);
	_data1_->stack_id = _tmp54_;
	_tmp55_ = self->priv->header_bar;
	_tmp56_ = g_signal_connect_object ((GObject*) _tmp55_, "notify::mode", (GCallback) ___lambda46__g_object_notify, self, 0);
	_data1_->header_bar_id = _tmp56_;
	_tmp57_ = self->priv->stack;
	g_signal_connect_data ((GtkWidget*) _tmp57_, "destroy", (GCallback) ___lambda47__gtk_widget_destroy, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	_tmp58_ = self->priv->panels;
	_tmp58__length1 = self->priv->panels_length1;
	_tmp59_ = _tmp58_[CLOCKS_PANEL_ID_ALARM];
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp59_, CLOCKS_ALARM_TYPE_MAIN_PANEL, ClocksAlarmMainPanel), "ring", (GCallback) ___lambda48__clocks_alarm_main_panel_ring, self, 0);
	_tmp60_ = self->priv->panels;
	_tmp60__length1 = self->priv->panels_length1;
	_tmp61_ = _tmp60_[CLOCKS_PANEL_ID_TIMER];
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp61_, CLOCKS_TIMER_TYPE_MAIN_PANEL, ClocksTimerMainPanel), "ring", (GCallback) ___lambda49__clocks_timer_main_panel_ring, self, 0);
	_tmp62_ = self->priv->stack;
	_tmp63_ = self->priv->panels;
	_tmp63__length1 = self->priv->panels_length1;
	_tmp64_ = self->priv->settings;
	_tmp65_ = g_settings_get_enum (_tmp64_, "panel-id");
	_tmp66_ = _tmp63_[_tmp65_];
	gtk_stack_set_visible_child (_tmp62_, _tmp66_);
	clocks_window_update_header_bar (self);
	gtk_widget_show_all ((GtkWidget*) self);
	_g_object_unref0 (close_image);
	block1_data_unref (_data1_);
	_data1_ = NULL;
	return self;
}


ClocksWindow* clocks_window_new (ClocksApplication* app) {
	return clocks_window_construct (CLOCKS_TYPE_WINDOW, app);
}


static void clocks_window_on_new_activate (ClocksWindow* self) {
	GtkStack* _tmp0_ = NULL;
	GtkWidget* _tmp1_ = NULL;
	GtkWidget* _tmp2_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->stack;
	_tmp1_ = gtk_stack_get_visible_child (_tmp0_);
	_tmp2_ = _tmp1_;
	clocks_clock_activate_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, CLOCKS_TYPE_CLOCK, ClocksClock));
}


static void clocks_window_on_select_all_activate (ClocksWindow* self) {
	GtkStack* _tmp0_ = NULL;
	GtkWidget* _tmp1_ = NULL;
	GtkWidget* _tmp2_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->stack;
	_tmp1_ = gtk_stack_get_visible_child (_tmp0_);
	_tmp2_ = _tmp1_;
	clocks_clock_activate_select_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, CLOCKS_TYPE_CLOCK, ClocksClock));
}


static void clocks_window_on_select_none_activate (ClocksWindow* self) {
	GtkStack* _tmp0_ = NULL;
	GtkWidget* _tmp1_ = NULL;
	GtkWidget* _tmp2_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->stack;
	_tmp1_ = gtk_stack_get_visible_child (_tmp0_);
	_tmp2_ = _tmp1_;
	clocks_clock_activate_select_none (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, CLOCKS_TYPE_CLOCK, ClocksClock));
}


static gboolean clocks_window_real_key_press_event (GtkWidget* base, GdkEventKey* event) {
	ClocksWindow * self;
	gboolean result = FALSE;
	guint keyval = 0U;
	gboolean _tmp0_ = FALSE;
	guint _tmp1_ = 0U;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp4_ = FALSE;
	GdkEventKey _tmp9_ = {0};
	gboolean _tmp10_ = FALSE;
	self = (ClocksWindow*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp2_ = gdk_event_get_keyval ((GdkEvent*) (event), &_tmp1_);
	keyval = _tmp1_;
	if (_tmp2_) {
		guint _tmp3_ = 0U;
		_tmp3_ = keyval;
		_tmp0_ = _tmp3_ == ((guint) GDK_KEY_Escape);
	} else {
		_tmp0_ = FALSE;
	}
	_tmp4_ = _tmp0_;
	if (_tmp4_) {
		GtkStack* _tmp5_ = NULL;
		GtkWidget* _tmp6_ = NULL;
		GtkWidget* _tmp7_ = NULL;
		gboolean _tmp8_ = FALSE;
		_tmp5_ = self->priv->stack;
		_tmp6_ = gtk_stack_get_visible_child (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = clocks_clock_escape_pressed (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, CLOCKS_TYPE_CLOCK, ClocksClock));
		result = _tmp8_;
		return result;
	}
	_tmp9_ = *event;
	_tmp10_ = GTK_WIDGET_CLASS (clocks_window_parent_class)->key_press_event ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, GTK_TYPE_APPLICATION_WINDOW, GtkApplicationWindow), &_tmp9_);
	result = _tmp10_;
	return result;
}


static gboolean clocks_window_real_configure_event (GtkWidget* base, GdkEventConfigure* event) {
	ClocksWindow * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp4_ = FALSE;
	GdkEventConfigure _tmp10_ = {0};
	gboolean _tmp11_ = FALSE;
	self = (ClocksWindow*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp1_ = gtk_widget_get_realized ((GtkWidget*) self);
	if (_tmp1_) {
		GdkWindow* _tmp2_ = NULL;
		GdkWindowState _tmp3_ = 0;
		_tmp2_ = gtk_widget_get_window ((GtkWidget*) self);
		_tmp3_ = gdk_window_get_state (_tmp2_);
		_tmp0_ = !((_tmp3_ & GDK_WINDOW_STATE_MAXIMIZED) == GDK_WINDOW_STATE_MAXIMIZED);
	} else {
		_tmp0_ = FALSE;
	}
	_tmp4_ = _tmp0_;
	if (_tmp4_) {
		GSettings* _tmp5_ = NULL;
		GdkEventConfigure _tmp6_ = {0};
		gint _tmp7_ = 0;
		GdkEventConfigure _tmp8_ = {0};
		gint _tmp9_ = 0;
		_tmp5_ = self->priv->settings;
		_tmp6_ = *event;
		_tmp7_ = _tmp6_.width;
		_tmp8_ = *event;
		_tmp9_ = _tmp8_.height;
		g_settings_set (_tmp5_, "size", "(ii)", _tmp7_, _tmp9_);
	}
	_tmp10_ = *event;
	_tmp11_ = GTK_WIDGET_CLASS (clocks_window_parent_class)->configure_event ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, GTK_TYPE_APPLICATION_WINDOW, GtkApplicationWindow), &_tmp10_);
	result = _tmp11_;
	return result;
}


static gboolean clocks_window_real_window_state_event (GtkWidget* base, GdkEventWindowState* event) {
	ClocksWindow * self;
	gboolean result = FALSE;
	GSettings* _tmp0_ = NULL;
	GdkEventWindowState _tmp1_ = {0};
	GdkWindowState _tmp2_ = 0;
	GdkEventWindowState _tmp3_ = {0};
	gboolean _tmp4_ = FALSE;
	self = (ClocksWindow*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = self->priv->settings;
	_tmp1_ = *event;
	_tmp2_ = _tmp1_.new_window_state;
	g_settings_set_int (_tmp0_, "state", (gint) _tmp2_);
	_tmp3_ = *event;
	_tmp4_ = GTK_WIDGET_CLASS (clocks_window_parent_class)->window_state_event ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, GTK_TYPE_APPLICATION_WINDOW, GtkApplicationWindow), &_tmp3_);
	result = _tmp4_;
	return result;
}


static void clocks_window_on_about_activate (ClocksWindow* self) {
	static const char copyright[] = "Copyright \xc2\xa9 2011 Collabora Ltd.\n" "Copyright \xc2\xa9 2012-2013 Collabora Ltd., Seif Lotfy, Emily Gonyer\n" "Eslam Mostafa, Paolo Borelli, Volker Sobek\n";
	static const gchar* authors[] = {"Alex Anthony", "Paolo Borelli", "Allan Day", "Piotr Drąg", "Emily Gonyer", "Evgeny Bobkin", "Maël Lavault", "Seif Lotfy", "William Jon McCann", "Eslam Mostafa", "Bastien Nocera", "Volker Sobek", "Jakub Steiner", NULL};
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = _ ("Clocks");
	_tmp1_ = _ ("Utilities to help you with the time.");
	_tmp2_ = _ ("translator-credits");
	gtk_show_about_dialog ((GtkWindow*) self, "program-name", _tmp0_, "logo-icon-name", "gnome-clocks", "version", VERSION, "comments", _tmp1_, "copyright", copyright, "authors", authors, "license-type", GTK_LICENSE_GPL_2_0, "wrap-license", FALSE, "translator-credits", _tmp2_, NULL, NULL);
}


static void clocks_window_update_header_bar (ClocksWindow* self) {
	ClocksHeaderBar* _tmp0_ = NULL;
	ClocksClock* clock = NULL;
	GtkStack* _tmp1_ = NULL;
	GtkWidget* _tmp2_ = NULL;
	GtkWidget* _tmp3_ = NULL;
	ClocksClock* _tmp4_ = NULL;
	ClocksClock* _tmp5_ = NULL;
	ClocksHeaderBar* _tmp12_ = NULL;
	ClocksHeaderBarMode _tmp13_ = 0;
	ClocksHeaderBarMode _tmp14_ = 0;
	ClocksHeaderBar* _tmp17_ = NULL;
	ClocksHeaderBarMode _tmp18_ = 0;
	ClocksHeaderBarMode _tmp19_ = 0;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->header_bar;
	clocks_header_bar_clear (_tmp0_);
	_tmp1_ = self->priv->stack;
	_tmp2_ = gtk_stack_get_visible_child (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, CLOCKS_TYPE_CLOCK, ClocksClock));
	clock = _tmp4_;
	_tmp5_ = clock;
	if (_tmp5_ != NULL) {
		GSettings* _tmp6_ = NULL;
		ClocksClock* _tmp7_ = NULL;
		ClocksPanelId _tmp8_ = 0;
		ClocksPanelId _tmp9_ = 0;
		ClocksClock* _tmp10_ = NULL;
		ClocksClock* _tmp11_ = NULL;
		_tmp6_ = self->priv->settings;
		_tmp7_ = clock;
		_tmp8_ = clocks_clock_get_panel_id (_tmp7_);
		_tmp9_ = _tmp8_;
		g_settings_set_enum (_tmp6_, "panel-id", (gint) _tmp9_);
		_tmp10_ = clock;
		clocks_clock_update_header_bar (_tmp10_);
		_tmp11_ = clock;
		gtk_widget_grab_focus (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GTK_TYPE_WIDGET, GtkWidget));
	}
	_tmp12_ = self->priv->header_bar;
	_tmp13_ = clocks_header_bar_get_mode (_tmp12_);
	_tmp14_ = _tmp13_;
	if (_tmp14_ == CLOCKS_HEADER_BAR_MODE_NORMAL) {
		ClocksHeaderBar* _tmp15_ = NULL;
		GtkStackSwitcher* _tmp16_ = NULL;
		_tmp15_ = self->priv->header_bar;
		_tmp16_ = self->priv->stack_switcher;
		gtk_header_bar_set_custom_title ((GtkHeaderBar*) _tmp15_, (GtkWidget*) _tmp16_);
	}
	_tmp17_ = self->priv->header_bar;
	_tmp18_ = clocks_header_bar_get_mode (_tmp17_);
	_tmp19_ = _tmp18_;
	if (_tmp19_ != CLOCKS_HEADER_BAR_MODE_SELECTION) {
		GtkSeparator* _tmp20_ = NULL;
		GtkButton* _tmp21_ = NULL;
		_tmp20_ = self->priv->separator;
		gtk_widget_show ((GtkWidget*) _tmp20_);
		_tmp21_ = self->priv->close_button;
		gtk_widget_show ((GtkWidget*) _tmp21_);
	}
	_g_object_unref0 (clock);
}


static void clocks_window_class_init (ClocksWindowClass * klass) {
	gint ClocksWindow_private_offset;
	clocks_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ClocksWindowPrivate));
	GTK_WIDGET_CLASS (klass)->key_press_event = clocks_window_real_key_press_event;
	GTK_WIDGET_CLASS (klass)->configure_event = clocks_window_real_configure_event;
	GTK_WIDGET_CLASS (klass)->window_state_event = clocks_window_real_window_state_event;
	G_OBJECT_CLASS (klass)->finalize = clocks_window_finalize;
	ClocksWindow_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/window.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "header_bar", FALSE, ClocksWindow_private_offset + G_STRUCT_OFFSET (ClocksWindowPrivate, header_bar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "stack", FALSE, ClocksWindow_private_offset + G_STRUCT_OFFSET (ClocksWindowPrivate, stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "stack_switcher", FALSE, ClocksWindow_private_offset + G_STRUCT_OFFSET (ClocksWindowPrivate, stack_switcher));
}


static void clocks_window_instance_init (ClocksWindow * self) {
	self->priv = CLOCKS_WINDOW_GET_PRIVATE (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}


static void clocks_window_finalize (GObject* obj) {
	ClocksWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_TYPE_WINDOW, ClocksWindow);
	_g_object_unref0 (self->priv->header_bar);
	_g_object_unref0 (self->priv->stack);
	_g_object_unref0 (self->priv->stack_switcher);
	_g_object_unref0 (self->priv->settings);
	self->priv->panels = (_vala_array_free (self->priv->panels, self->priv->panels_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (self->priv->separator);
	_g_object_unref0 (self->priv->close_button);
	G_OBJECT_CLASS (clocks_window_parent_class)->finalize (obj);
}


GType clocks_window_get_type (void) {
	static volatile gsize clocks_window_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_window_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ClocksWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksWindow), 0, (GInstanceInitFunc) clocks_window_instance_init, NULL };
		GType clocks_window_type_id;
		clocks_window_type_id = g_type_register_static (GTK_TYPE_APPLICATION_WINDOW, "ClocksWindow", &g_define_type_info, 0);
		g_once_init_leave (&clocks_window_type_id__volatile, clocks_window_type_id);
	}
	return clocks_window_type_id__volatile;
}


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


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



