/* world.c generated by valac 0.18.0.77-c8a68, the Vala compiler
 * generated from world.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 "libgweather/gweather.h"
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <gdk/gdk.h>
#include <libgd/gd.h>
#include <gdk-pixbuf/gdk-pixbuf.h>

#define __vala_GWeatherLocation_free0(var) ((var == NULL) ? NULL : (var = (_vala_GWeatherLocation_free (var), NULL)))

#define CLOCKS_WORLD_TYPE_ITEM (clocks_world_item_get_type ())
#define CLOCKS_WORLD_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_WORLD_TYPE_ITEM, ClocksWorldItem))
#define CLOCKS_WORLD_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_WORLD_TYPE_ITEM, ClocksWorldItemClass))
#define CLOCKS_WORLD_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_WORLD_TYPE_ITEM))
#define CLOCKS_WORLD_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_WORLD_TYPE_ITEM))
#define CLOCKS_WORLD_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_WORLD_TYPE_ITEM, ClocksWorldItemClass))

typedef struct _ClocksWorldItem ClocksWorldItem;
typedef struct _ClocksWorldItemClass ClocksWorldItemClass;
typedef struct _ClocksWorldItemPrivate ClocksWorldItemPrivate;
#define _g_time_zone_unref0(var) ((var == NULL) ? NULL : (var = (g_time_zone_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 __vala_GWeatherTimezone_free0(var) ((var == NULL) ? NULL : (var = (_vala_GWeatherTimezone_free (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 _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_free0(var) (var = (g_free (var), NULL))
#define _g_variant_iter_free0(var) ((var == NULL) ? NULL : (var = (g_variant_iter_free (var), NULL)))

#define CLOCKS_WORLD_TYPE_LOCATION_DIALOG (clocks_world_location_dialog_get_type ())
#define CLOCKS_WORLD_LOCATION_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_WORLD_TYPE_LOCATION_DIALOG, ClocksWorldLocationDialog))
#define CLOCKS_WORLD_LOCATION_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_WORLD_TYPE_LOCATION_DIALOG, ClocksWorldLocationDialogClass))
#define CLOCKS_WORLD_IS_LOCATION_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_WORLD_TYPE_LOCATION_DIALOG))
#define CLOCKS_WORLD_IS_LOCATION_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_WORLD_TYPE_LOCATION_DIALOG))
#define CLOCKS_WORLD_LOCATION_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_WORLD_TYPE_LOCATION_DIALOG, ClocksWorldLocationDialogClass))

typedef struct _ClocksWorldLocationDialog ClocksWorldLocationDialog;
typedef struct _ClocksWorldLocationDialogClass ClocksWorldLocationDialogClass;
typedef struct _ClocksWorldLocationDialogPrivate ClocksWorldLocationDialogPrivate;

#define CLOCKS_WORLD_TYPE_STANDALONE_PANEL (clocks_world_standalone_panel_get_type ())
#define CLOCKS_WORLD_STANDALONE_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_WORLD_TYPE_STANDALONE_PANEL, ClocksWorldStandalonePanel))
#define CLOCKS_WORLD_STANDALONE_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_WORLD_TYPE_STANDALONE_PANEL, ClocksWorldStandalonePanelClass))
#define CLOCKS_WORLD_IS_STANDALONE_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_WORLD_TYPE_STANDALONE_PANEL))
#define CLOCKS_WORLD_IS_STANDALONE_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_WORLD_TYPE_STANDALONE_PANEL))
#define CLOCKS_WORLD_STANDALONE_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_WORLD_TYPE_STANDALONE_PANEL, ClocksWorldStandalonePanelClass))

typedef struct _ClocksWorldStandalonePanel ClocksWorldStandalonePanel;
typedef struct _ClocksWorldStandalonePanelClass ClocksWorldStandalonePanelClass;
typedef struct _ClocksWorldStandalonePanelPrivate ClocksWorldStandalonePanelPrivate;

#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_TOOLBAR (clocks_toolbar_get_type ())
#define CLOCKS_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TYPE_TOOLBAR, ClocksToolbar))
#define CLOCKS_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_TYPE_TOOLBAR, ClocksToolbarClass))
#define CLOCKS_IS_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TYPE_TOOLBAR))
#define CLOCKS_IS_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_TYPE_TOOLBAR))
#define CLOCKS_TOOLBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_TYPE_TOOLBAR, ClocksToolbarClass))

typedef struct _ClocksToolbar ClocksToolbar;
typedef struct _ClocksToolbarClass ClocksToolbarClass;

#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;
typedef struct _ClocksWorldMainPanelPrivate ClocksWorldMainPanelPrivate;

#define CLOCKS_TYPE_ICON_VIEW (clocks_icon_view_get_type ())
#define CLOCKS_ICON_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TYPE_ICON_VIEW, ClocksIconView))
#define CLOCKS_ICON_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_TYPE_ICON_VIEW, ClocksIconViewClass))
#define CLOCKS_IS_ICON_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TYPE_ICON_VIEW))
#define CLOCKS_IS_ICON_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_TYPE_ICON_VIEW))
#define CLOCKS_ICON_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_TYPE_ICON_VIEW, ClocksIconViewClass))

typedef struct _ClocksIconView ClocksIconView;
typedef struct _ClocksIconViewClass ClocksIconViewClass;

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

typedef struct _ClocksContentView ClocksContentView;
typedef struct _ClocksContentViewClass ClocksContentViewClass;
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
typedef struct _Block2Data Block2Data;

#define CLOCKS_ICON_VIEW_TYPE_COLUMN (clocks_icon_view_column_get_type ())

#define CLOCKS_TYPE_DIGITAL_CLOCK_RENDERER (clocks_digital_clock_renderer_get_type ())
#define CLOCKS_DIGITAL_CLOCK_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TYPE_DIGITAL_CLOCK_RENDERER, ClocksDigitalClockRenderer))
#define CLOCKS_DIGITAL_CLOCK_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_TYPE_DIGITAL_CLOCK_RENDERER, ClocksDigitalClockRendererClass))
#define CLOCKS_IS_DIGITAL_CLOCK_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TYPE_DIGITAL_CLOCK_RENDERER))
#define CLOCKS_IS_DIGITAL_CLOCK_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_TYPE_DIGITAL_CLOCK_RENDERER))
#define CLOCKS_DIGITAL_CLOCK_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_TYPE_DIGITAL_CLOCK_RENDERER, ClocksDigitalClockRendererClass))

typedef struct _ClocksDigitalClockRenderer ClocksDigitalClockRenderer;
typedef struct _ClocksDigitalClockRendererClass ClocksDigitalClockRendererClass;
#define _gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)))
#define __g_list_free__gtk_tree_path_free0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__gtk_tree_path_free0_ (var), NULL)))

#define CLOCKS_TOOLBAR_TYPE_MODE (clocks_toolbar_mode_get_type ())
#define _g_variant_builder_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_builder_unref (var), NULL)))

struct _ClocksWorldItem {
	GObject parent_instance;
	ClocksWorldItemPrivate * priv;
};

struct _ClocksWorldItemClass {
	GObjectClass parent_class;
};

struct _ClocksWorldItemPrivate {
	GWeatherLocation* _location;
	GTimeZone* time_zone;
	GDateTime* local_time;
	GDateTime* date_time;
	GWeatherInfo* weather_info;
};

struct _ClocksWorldLocationDialog {
	GtkDialog parent_instance;
	ClocksWorldLocationDialogPrivate * priv;
};

struct _ClocksWorldLocationDialogClass {
	GtkDialogClass parent_class;
};

struct _ClocksWorldLocationDialogPrivate {
	GWeatherLocationEntry* entry;
	GThemedIcon* find_icon;
	GThemedIcon* clear_icon;
};

struct _ClocksWorldStandalonePanel {
	GtkEventBox parent_instance;
	ClocksWorldStandalonePanelPrivate * priv;
};

struct _ClocksWorldStandalonePanelClass {
	GtkEventBoxClass parent_class;
};

struct _ClocksWorldStandalonePanelPrivate {
	ClocksWorldItem* _location;
	GtkLabel* time_label;
	GtkLabel* day_label;
	GtkLabel* sunrise_label;
	GtkLabel* sunset_label;
};

struct _ClocksClockIface {
	GTypeInterface parent_iface;
	void (*activate_new) (ClocksClock* self);
	void (*activate_select_all) (ClocksClock* self);
	void (*activate_select_none) (ClocksClock* self);
	void (*update_toolbar) (ClocksClock* self);
	const gchar* (*get_label) (ClocksClock* self);
	void (*set_label) (ClocksClock* self, const gchar* value);
	ClocksToolbar* (*get_toolbar) (ClocksClock* self);
	void (*set_toolbar) (ClocksClock* self, ClocksToolbar* value);
};

struct _ClocksWorldMainPanel {
	GdStack parent_instance;
	ClocksWorldMainPanelPrivate * priv;
};

struct _ClocksWorldMainPanelClass {
	GdStackClass parent_class;
};

struct _ClocksWorldMainPanelPrivate {
	gchar* _label;
	ClocksToolbar* _toolbar;
	GList* locations;
	GSettings* settings;
	GdkPixbuf* day_pixbuf;
	GdkPixbuf* night_pixbuf;
	ClocksIconView* icon_view;
	ClocksContentView* content_view;
	ClocksWorldStandalonePanel* standalone;
};

struct _Block2Data {
	int _ref_count_;
	ClocksWorldMainPanel * self;
	gulong id;
	ClocksToolbar* toolbar;
};

typedef enum  {
	CLOCKS_ICON_VIEW_COLUMN_SELECTED,
	CLOCKS_ICON_VIEW_COLUMN_LABEL,
	CLOCKS_ICON_VIEW_COLUMN_ITEM,
	CLOCKS_ICON_VIEW_COLUMN_COLUMNS
} ClocksIconViewColumn;

typedef enum  {
	CLOCKS_TOOLBAR_MODE_NORMAL,
	CLOCKS_TOOLBAR_MODE_SELECTION,
	CLOCKS_TOOLBAR_MODE_STANDALONE
} ClocksToolbarMode;


extern GWeatherLocation* clocks_world_gweather_world;
GWeatherLocation* clocks_world_gweather_world = NULL;
static gpointer clocks_world_item_parent_class = NULL;
static gpointer clocks_world_location_dialog_parent_class = NULL;
static gpointer clocks_world_standalone_panel_parent_class = NULL;
static gpointer clocks_world_main_panel_parent_class = NULL;
static ClocksClockIface* clocks_world_main_panel_clocks_clock_parent_iface = NULL;

GWeatherLocation* clocks_world_get_world_location (void);
static void _vala_GWeatherLocation_free (GWeatherLocation* self);
static GWeatherLocation* _vala_GWeatherLocation_copy (GWeatherLocation* self);
GType clocks_world_item_get_type (void) G_GNUC_CONST;
#define CLOCKS_WORLD_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLOCKS_WORLD_TYPE_ITEM, ClocksWorldItemPrivate))
enum  {
	CLOCKS_WORLD_ITEM_DUMMY_PROPERTY,
	CLOCKS_WORLD_ITEM_LOCATION,
	CLOCKS_WORLD_ITEM_NAME,
	CLOCKS_WORLD_ITEM_IS_DAYTIME,
	CLOCKS_WORLD_ITEM_SUNRISE_LABEL,
	CLOCKS_WORLD_ITEM_SUNSET_LABEL,
	CLOCKS_WORLD_ITEM_TIME_LABEL,
	CLOCKS_WORLD_ITEM_DAY_LABEL
};
ClocksWorldItem* clocks_world_item_new (GWeatherLocation* location);
ClocksWorldItem* clocks_world_item_construct (GType object_type, GWeatherLocation* location);
static GWeatherTimezone* _vala_GWeatherTimezone_copy (GWeatherTimezone* self);
static void clocks_world_item_tick (ClocksWorldItem* self);
static void _vala_GWeatherTimezone_free (GWeatherTimezone* self);
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);
GWeatherLocation* clocks_world_item_get_location (ClocksWorldItem* self);
void clocks_world_item_serialize (ClocksWorldItem* self, GVariantBuilder* builder);
ClocksWorldItem* clocks_world_item_deserialize (GVariant* location_variant);
void clocks_world_item_set_location (ClocksWorldItem* self, GWeatherLocation* value);
gchar* clocks_world_item_get_name (ClocksWorldItem* self);
gboolean clocks_world_item_get_is_daytime (ClocksWorldItem* self);
gchar* clocks_world_item_get_sunrise_label (ClocksWorldItem* self);
gchar* clocks_world_item_get_sunset_label (ClocksWorldItem* self);
gchar* clocks_world_item_get_time_label (ClocksWorldItem* self);
gchar* clocks_utils_wall_clock_format_time (ClocksUtilsWallClock* self, GDateTime* date_time);
const gchar* clocks_world_item_get_day_label (ClocksWorldItem* self);
static void clocks_world_item_finalize (GObject* obj);
static void _vala_clocks_world_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_clocks_world_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType clocks_world_location_dialog_get_type (void) G_GNUC_CONST;
#define CLOCKS_WORLD_LOCATION_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLOCKS_WORLD_TYPE_LOCATION_DIALOG, ClocksWorldLocationDialogPrivate))
enum  {
	CLOCKS_WORLD_LOCATION_DIALOG_DUMMY_PROPERTY
};
ClocksWorldLocationDialog* clocks_world_location_dialog_new (GtkWindow* parent);
ClocksWorldLocationDialog* clocks_world_location_dialog_construct (GType object_type, GtkWindow* parent);
GtkBuilder* clocks_utils_load_ui (const gchar* ui);
static void __lambda21_ (ClocksWorldLocationDialog* self);
static void clocks_world_location_dialog_location_changed (ClocksWorldLocationDialog* self);
static void ___lambda21__gtk_editable_changed (GtkEditable* _sender, gpointer self);
static void __lambda22_ (ClocksWorldLocationDialog* self);
static void ___lambda22__gtk_entry_activate (GtkEntry* _sender, gpointer self);
static void __lambda23_ (ClocksWorldLocationDialog* self);
static void ___lambda23__gtk_entry_icon_release (GtkEntry* _sender, GtkEntryIconPosition p0, GdkEvent* p1, gpointer self);
ClocksWorldItem* clocks_world_location_dialog_get_location (ClocksWorldLocationDialog* self);
static void clocks_world_location_dialog_finalize (GObject* obj);
GType clocks_world_standalone_panel_get_type (void) G_GNUC_CONST;
#define CLOCKS_WORLD_STANDALONE_PANEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLOCKS_WORLD_TYPE_STANDALONE_PANEL, ClocksWorldStandalonePanelPrivate))
enum  {
	CLOCKS_WORLD_STANDALONE_PANEL_DUMMY_PROPERTY,
	CLOCKS_WORLD_STANDALONE_PANEL_LOCATION
};
ClocksWorldStandalonePanel* clocks_world_standalone_panel_new (void);
ClocksWorldStandalonePanel* clocks_world_standalone_panel_construct (GType object_type);
void clocks_world_standalone_panel_update (ClocksWorldStandalonePanel* self);
ClocksWorldItem* clocks_world_standalone_panel_get_location (ClocksWorldStandalonePanel* self);
void clocks_world_standalone_panel_set_location (ClocksWorldStandalonePanel* self, ClocksWorldItem* value);
static void clocks_world_standalone_panel_finalize (GObject* obj);
static void _vala_clocks_world_standalone_panel_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_clocks_world_standalone_panel_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType clocks_toolbar_get_type (void) G_GNUC_CONST;
GType clocks_clock_get_type (void) G_GNUC_CONST;
GType clocks_world_main_panel_get_type (void) G_GNUC_CONST;
GType clocks_icon_view_get_type (void) G_GNUC_CONST;
GType clocks_content_view_get_type (void) G_GNUC_CONST;
#define CLOCKS_WORLD_MAIN_PANEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLOCKS_WORLD_TYPE_MAIN_PANEL, ClocksWorldMainPanelPrivate))
enum  {
	CLOCKS_WORLD_MAIN_PANEL_DUMMY_PROPERTY,
	CLOCKS_WORLD_MAIN_PANEL_LABEL,
	CLOCKS_WORLD_MAIN_PANEL_TOOLBAR
};
static void _g_object_unref0_ (gpointer var);
static void _g_list_free__g_object_unref0_ (GList* self);
ClocksWorldMainPanel* clocks_world_main_panel_new (ClocksToolbar* toolbar);
ClocksWorldMainPanel* clocks_world_main_panel_construct (GType object_type, ClocksToolbar* toolbar);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
GdkPixbuf* clocks_utils_load_image (const gchar* image);
static void __lambda16_ (ClocksWorldMainPanel* self, GtkCellLayout* column, GtkCellRenderer* cell, GtkTreeModel* model, GtkTreeIter* iter);
GType clocks_icon_view_column_get_type (void) G_GNUC_CONST;
GType clocks_digital_clock_renderer_get_type (void) G_GNUC_CONST;
void clocks_digital_clock_renderer_set_text (ClocksDigitalClockRenderer* self, const gchar* value);
void clocks_digital_clock_renderer_set_subtext (ClocksDigitalClockRenderer* self, const gchar* value);
void clocks_digital_clock_renderer_set_css_class (ClocksDigitalClockRenderer* self, const gchar* value);
static void ___lambda16__gtk_cell_layout_data_func (GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self);
ClocksIconView* clocks_icon_view_new (GtkCellLayoutDataFunc thumb_data_func, void* thumb_data_func_target, GDestroyNotify thumb_data_func_target_destroy_notify);
ClocksIconView* clocks_icon_view_construct (GType object_type, GtkCellLayoutDataFunc thumb_data_func, void* thumb_data_func_target, GDestroyNotify thumb_data_func_target_destroy_notify);
static void __lambda17_ (ClocksWorldMainPanel* self, GtkTreePath* path);
static void ___lambda17__gtk_icon_view_item_activated (GtkIconView* _sender, GtkTreePath* path, gpointer self);
ClocksContentView* clocks_content_view_new (GtkWidget* e, ClocksIconView* iv, ClocksToolbar* t);
ClocksContentView* clocks_content_view_construct (GType object_type, GtkWidget* e, ClocksIconView* iv, ClocksToolbar* t);
static void __lambda18_ (ClocksWorldMainPanel* self);
GList* clocks_icon_view_get_selected_items (ClocksIconView* self);
static void _gtk_tree_path_free0_ (gpointer var);
static void _g_list_free__gtk_tree_path_free0_ (GList* self);
void clocks_icon_view_remove_selected (ClocksIconView* self);
static void clocks_world_main_panel_save (ClocksWorldMainPanel* self);
static void ___lambda18__clocks_content_view_delete_selected (ClocksContentView* _sender, gpointer self);
static void clocks_world_main_panel_load (ClocksWorldMainPanel* self);
static void __lambda19_ (Block2Data* _data2_);
GType clocks_toolbar_mode_get_type (void) G_GNUC_CONST;
void clocks_toolbar_set_mode (ClocksToolbar* self, ClocksToolbarMode value);
static void ___lambda19__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void __lambda20_ (Block2Data* _data2_);
static void ___lambda20__gtk_widget_destroy (GtkWidget* _sender, gpointer self);
void clocks_icon_view_add_item (ClocksIconView* self, const gchar* name, GObject* item);
static void clocks_world_main_panel_real_activate_new (ClocksClock* base);
static void __lambda24_ (ClocksWorldMainPanel* self, GtkDialog* dialog, gint response);
static void ___lambda24__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
static void clocks_world_main_panel_real_activate_select_all (ClocksClock* base);
void clocks_icon_view_select_all (ClocksIconView* self);
static void clocks_world_main_panel_real_activate_select_none (ClocksClock* base);
void clocks_icon_view_unselect_all (ClocksIconView* self);
static void clocks_world_main_panel_real_update_toolbar (ClocksClock* base);
ClocksToolbar* clocks_clock_get_toolbar (ClocksClock* self);
void clocks_toolbar_clear (ClocksToolbar* self);
ClocksToolbarMode clocks_toolbar_get_mode (ClocksToolbar* self);
GtkButton* clocks_toolbar_add_button (ClocksToolbar* self, const gchar* icon_name, const gchar* label, gboolean pack_start);
static void ___lambda25_ (ClocksWorldMainPanel* self);
void clocks_clock_activate_new (ClocksClock* self);
static void ____lambda25__gtk_button_clicked (GtkButton* _sender, gpointer self);
void clocks_content_view_update_toolbar (ClocksContentView* self);
static void ___lambda26_ (ClocksWorldMainPanel* self);
static void ____lambda26__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void clocks_world_main_panel_finalize (GObject* obj);
const gchar* clocks_clock_get_label (ClocksClock* self);
static void _vala_clocks_world_main_panel_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
void clocks_clock_set_label (ClocksClock* self, const gchar* value);
void clocks_clock_set_toolbar (ClocksClock* self, ClocksToolbar* value);
static void _vala_clocks_world_main_panel_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


static void _vala_GWeatherLocation_free (GWeatherLocation* self) {
	g_boxed_free (gweather_location_get_type (), self);
}


static GWeatherLocation* _vala_GWeatherLocation_copy (GWeatherLocation* self) {
	return g_boxed_copy (gweather_location_get_type (), self);
}


static gpointer __vala_GWeatherLocation_copy0 (gpointer self) {
	return self ? _vala_GWeatherLocation_copy (self) : NULL;
}


GWeatherLocation* clocks_world_get_world_location (void) {
	GWeatherLocation* result = NULL;
	GWeatherLocation* _tmp0_;
	GWeatherLocation* _tmp2_;
	GWeatherLocation* _tmp3_;
	_tmp0_ = clocks_world_gweather_world;
	if (_tmp0_ == NULL) {
		GWeatherLocation* _tmp1_;
		_tmp1_ = gweather_location_new_world (TRUE);
		__vala_GWeatherLocation_free0 (clocks_world_gweather_world);
		clocks_world_gweather_world = _tmp1_;
	}
	_tmp2_ = clocks_world_gweather_world;
	_tmp3_ = __vala_GWeatherLocation_copy0 (_tmp2_);
	result = _tmp3_;
	return result;
}


static GWeatherTimezone* _vala_GWeatherTimezone_copy (GWeatherTimezone* self) {
	return g_boxed_copy (gweather_timezone_get_type (), self);
}


static gpointer __vala_GWeatherTimezone_copy0 (gpointer self) {
	return self ? _vala_GWeatherTimezone_copy (self) : NULL;
}


static void _vala_GWeatherTimezone_free (GWeatherTimezone* self) {
	g_boxed_free (gweather_timezone_get_type (), self);
}


ClocksWorldItem* clocks_world_item_construct (GType object_type, GWeatherLocation* location) {
	ClocksWorldItem * self = NULL;
	GWeatherLocation* _tmp0_;
	GWeatherLocation* _tmp1_;
	GWeatherTimezone* _tmp2_ = NULL;
	GWeatherTimezone* _tmp3_;
	GWeatherTimezone* weather_time_zone;
	const gchar* _tmp4_ = NULL;
	GTimeZone* _tmp5_;
	g_return_val_if_fail (location != NULL, NULL);
	_tmp0_ = location;
	self = (ClocksWorldItem*) g_object_new (object_type, "location", _tmp0_, NULL);
	_tmp1_ = location;
	_tmp2_ = gweather_location_get_timezone (_tmp1_);
	_tmp3_ = __vala_GWeatherTimezone_copy0 (_tmp2_);
	weather_time_zone = _tmp3_;
	_tmp4_ = gweather_timezone_get_tzid (weather_time_zone);
	_tmp5_ = g_time_zone_new (_tmp4_);
	_g_time_zone_unref0 (self->priv->time_zone);
	self->priv->time_zone = _tmp5_;
	clocks_world_item_tick (self);
	__vala_GWeatherTimezone_free0 (weather_time_zone);
	return self;
}


ClocksWorldItem* clocks_world_item_new (GWeatherLocation* location) {
	return clocks_world_item_construct (CLOCKS_WORLD_TYPE_ITEM, location);
}


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


static void clocks_world_item_tick (ClocksWorldItem* self) {
	ClocksUtilsWallClock* _tmp0_ = NULL;
	ClocksUtilsWallClock* wallclock;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	GDateTime* _tmp4_;
	GTimeZone* _tmp5_;
	GDateTime* _tmp6_ = NULL;
	GWeatherLocation* _tmp7_ = NULL;
	GWeatherLocation* _tmp8_;
	GWeatherLocation* _tmp9_;
	GWeatherInfo* _tmp10_;
	g_return_if_fail (self != NULL);
	_tmp0_ = clocks_utils_wall_clock_get_default ();
	wallclock = _tmp0_;
	_tmp1_ = clocks_utils_wall_clock_get_date_time (wallclock);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_date_time_ref0 (_tmp2_);
	_g_date_time_unref0 (self->priv->local_time);
	self->priv->local_time = _tmp3_;
	_tmp4_ = self->priv->local_time;
	_tmp5_ = self->priv->time_zone;
	_tmp6_ = g_date_time_to_timezone (_tmp4_, _tmp5_);
	_g_date_time_unref0 (self->priv->date_time);
	self->priv->date_time = _tmp6_;
	_tmp7_ = clocks_world_get_world_location ();
	_tmp8_ = _tmp7_;
	_tmp9_ = self->priv->_location;
	_tmp10_ = gweather_info_new_for_world (_tmp8_, _tmp9_, GWEATHER_FORECAST_LIST);
	_g_object_unref0 (self->priv->weather_info);
	self->priv->weather_info = _tmp10_;
	__vala_GWeatherLocation_free0 (_tmp8_);
	_g_object_unref0 (wallclock);
}


void clocks_world_item_serialize (ClocksWorldItem* self, GVariantBuilder* builder) {
	GVariantBuilder* _tmp0_;
	GVariantType* _tmp1_;
	GVariantType* _tmp2_;
	GVariantBuilder* _tmp3_;
	GWeatherLocation* _tmp4_;
	GVariant* _tmp5_ = NULL;
	GVariantBuilder* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (builder != NULL);
	_tmp0_ = builder;
	_tmp1_ = g_variant_type_new ("a{sv}");
	_tmp2_ = _tmp1_;
	g_variant_builder_open (_tmp0_, _tmp2_);
	_g_variant_type_free0 (_tmp2_);
	_tmp3_ = builder;
	_tmp4_ = self->priv->_location;
	_tmp5_ = gweather_location_serialize (_tmp4_);
	g_variant_builder_add (_tmp3_, "{sv}", "location", _tmp5_, NULL);
	_tmp6_ = builder;
	g_variant_builder_close (_tmp6_);
}


ClocksWorldItem* clocks_world_item_deserialize (GVariant* location_variant) {
	ClocksWorldItem* result = NULL;
	GWeatherLocation* location;
	ClocksWorldItem* _tmp20_ = NULL;
	GWeatherLocation* _tmp21_;
	g_return_val_if_fail (location_variant != NULL, NULL);
	location = NULL;
	{
		GVariant* _tmp0_;
		GVariantIter* _tmp1_ = NULL;
		GVariantIter* _v_it;
		GVariant* v = NULL;
		_tmp0_ = location_variant;
		_tmp1_ = g_variant_iter_new (_tmp0_);
		_v_it = _tmp1_;
		while (TRUE) {
			GVariantIter* _tmp2_;
			GVariant* _tmp3_ = NULL;
			GVariant* _tmp4_;
			GVariant* _tmp5_;
			GVariant* _tmp6_ = NULL;
			GVariant* _tmp7_;
			const gchar* _tmp8_ = NULL;
			gchar* _tmp9_;
			gchar* _tmp10_;
			gchar* key;
			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_, "location") == 0) {
				GWeatherLocation* _tmp12_ = NULL;
				GWeatherLocation* _tmp13_;
				GVariant* _tmp14_;
				GVariant* _tmp15_ = NULL;
				GVariant* _tmp16_;
				GVariant* _tmp17_ = NULL;
				GVariant* _tmp18_;
				GWeatherLocation* _tmp19_ = NULL;
				_tmp12_ = clocks_world_get_world_location ();
				_tmp13_ = _tmp12_;
				_tmp14_ = v;
				_tmp15_ = g_variant_get_child_value (_tmp14_, (gsize) 1);
				_tmp16_ = _tmp15_;
				_tmp17_ = g_variant_get_child_value (_tmp16_, (gsize) 0);
				_tmp18_ = _tmp17_;
				_tmp19_ = gweather_location_deserialize (_tmp13_, _tmp18_);
				__vala_GWeatherLocation_free0 (location);
				location = _tmp19_;
				_g_variant_unref0 (_tmp18_);
				_g_variant_unref0 (_tmp16_);
				__vala_GWeatherLocation_free0 (_tmp13_);
			}
			_g_free0 (key);
		}
		_g_variant_unref0 (v);
		_g_variant_iter_free0 (_v_it);
	}
	_tmp21_ = location;
	if (_tmp21_ != NULL) {
		GWeatherLocation* _tmp22_;
		ClocksWorldItem* _tmp23_;
		_tmp22_ = location;
		_tmp23_ = clocks_world_item_new (_tmp22_);
		_g_object_unref0 (_tmp20_);
		_tmp20_ = _tmp23_;
	} else {
		_g_object_unref0 (_tmp20_);
		_tmp20_ = NULL;
	}
	result = _tmp20_;
	__vala_GWeatherLocation_free0 (location);
	return result;
}


GWeatherLocation* clocks_world_item_get_location (ClocksWorldItem* self) {
	GWeatherLocation* result;
	GWeatherLocation* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_location;
	result = _tmp0_;
	return result;
}


void clocks_world_item_set_location (ClocksWorldItem* self, GWeatherLocation* value) {
	GWeatherLocation* _tmp0_;
	GWeatherLocation* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = __vala_GWeatherLocation_copy0 (_tmp0_);
	__vala_GWeatherLocation_free0 (self->priv->_location);
	self->priv->_location = _tmp1_;
	g_object_notify ((GObject *) self, "location");
}


gchar* clocks_world_item_get_name (ClocksWorldItem* self) {
	gchar* result;
	GWeatherLocation* _tmp0_;
	GWeatherLocation* _tmp1_;
	GWeatherLocation* nation;
	GWeatherLocation* _tmp10_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_location;
	_tmp1_ = __vala_GWeatherLocation_copy0 (_tmp0_);
	nation = _tmp1_;
	while (TRUE) {
		gboolean _tmp2_ = FALSE;
		GWeatherLocation* _tmp3_;
		gboolean _tmp6_;
		GWeatherLocation* _tmp7_;
		GWeatherLocation* _tmp8_ = NULL;
		GWeatherLocation* _tmp9_;
		_tmp3_ = nation;
		if (_tmp3_ != NULL) {
			GWeatherLocation* _tmp4_;
			GWeatherLocationLevel _tmp5_ = 0;
			_tmp4_ = nation;
			_tmp5_ = gweather_location_get_level (_tmp4_);
			_tmp2_ = _tmp5_ != GWEATHER_LOCATION_COUNTRY;
		} else {
			_tmp2_ = FALSE;
		}
		_tmp6_ = _tmp2_;
		if (!_tmp6_) {
			break;
		}
		_tmp7_ = nation;
		_tmp8_ = gweather_location_get_parent (_tmp7_);
		_tmp9_ = __vala_GWeatherLocation_copy0 (_tmp8_);
		__vala_GWeatherLocation_free0 (nation);
		nation = _tmp9_;
	}
	_tmp10_ = nation;
	if (_tmp10_ != NULL) {
		GWeatherLocation* _tmp11_;
		gchar* _tmp12_ = NULL;
		gchar* _tmp13_;
		GWeatherLocation* _tmp14_;
		const gchar* _tmp15_ = NULL;
		gchar* _tmp16_ = NULL;
		gchar* _tmp17_;
		_tmp11_ = self->priv->_location;
		_tmp12_ = gweather_location_get_city_name (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = nation;
		_tmp15_ = gweather_location_get_name (_tmp14_);
		_tmp16_ = g_strdup_printf ("%s, %s", _tmp13_, _tmp15_);
		_tmp17_ = _tmp16_;
		_g_free0 (_tmp13_);
		result = _tmp17_;
		__vala_GWeatherLocation_free0 (nation);
		return result;
	} else {
		GWeatherLocation* _tmp18_;
		gchar* _tmp19_ = NULL;
		_tmp18_ = self->priv->_location;
		_tmp19_ = gweather_location_get_city_name (_tmp18_);
		result = _tmp19_;
		__vala_GWeatherLocation_free0 (nation);
		return result;
	}
	__vala_GWeatherLocation_free0 (nation);
}


gboolean clocks_world_item_get_is_daytime (ClocksWorldItem* self) {
	gboolean result;
	GWeatherInfo* _tmp0_;
	gboolean _tmp1_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->weather_info;
	_tmp1_ = gweather_info_is_daytime (_tmp0_);
	result = _tmp1_;
	return result;
}


gchar* clocks_world_item_get_sunrise_label (ClocksWorldItem* self) {
	gchar* result;
	GWeatherInfo* _tmp0_;
	gchar* _tmp1_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->weather_info;
	_tmp1_ = gweather_info_get_sunrise (_tmp0_);
	result = _tmp1_;
	return result;
}


gchar* clocks_world_item_get_sunset_label (ClocksWorldItem* self) {
	gchar* result;
	GWeatherInfo* _tmp0_;
	gchar* _tmp1_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->weather_info;
	_tmp1_ = gweather_info_get_sunset (_tmp0_);
	result = _tmp1_;
	return result;
}


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


const gchar* clocks_world_item_get_day_label (ClocksWorldItem* self) {
	const gchar* result;
	GDateTime* _tmp0_;
	gint _tmp1_ = 0;
	gint d;
	GDateTime* _tmp2_;
	gint _tmp3_ = 0;
	gint t;
	gint _tmp4_;
	gint _tmp5_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->date_time;
	_tmp1_ = g_date_time_get_day_of_year (_tmp0_);
	d = _tmp1_;
	_tmp2_ = self->priv->local_time;
	_tmp3_ = g_date_time_get_day_of_year (_tmp2_);
	t = _tmp3_;
	_tmp4_ = d;
	_tmp5_ = t;
	if (_tmp4_ < _tmp5_) {
		const gchar* _tmp6_ = NULL;
		gint _tmp7_;
		const gchar* _tmp10_;
		_tmp7_ = d;
		if (_tmp7_ == 1) {
			const gchar* _tmp8_ = NULL;
			_tmp8_ = _ ("Tomorrow");
			_tmp6_ = _tmp8_;
		} else {
			const gchar* _tmp9_ = NULL;
			_tmp9_ = _ ("Yesterday");
			_tmp6_ = _tmp9_;
		}
		_tmp10_ = _tmp6_;
		result = _tmp10_;
		return result;
	} else {
		gint _tmp11_;
		gint _tmp12_;
		_tmp11_ = d;
		_tmp12_ = t;
		if (_tmp11_ > _tmp12_) {
			const gchar* _tmp13_ = NULL;
			gint _tmp14_;
			const gchar* _tmp17_;
			_tmp14_ = t;
			if (_tmp14_ == 1) {
				const gchar* _tmp15_ = NULL;
				_tmp15_ = _ ("Yesterday");
				_tmp13_ = _tmp15_;
			} else {
				const gchar* _tmp16_ = NULL;
				_tmp16_ = _ ("Tomorrow");
				_tmp13_ = _tmp16_;
			}
			_tmp17_ = _tmp13_;
			result = _tmp17_;
			return result;
		} else {
			result = NULL;
			return result;
		}
	}
}


static void clocks_world_item_class_init (ClocksWorldItemClass * klass) {
	clocks_world_item_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ClocksWorldItemPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_clocks_world_item_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_clocks_world_item_set_property;
	G_OBJECT_CLASS (klass)->finalize = clocks_world_item_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_WORLD_ITEM_LOCATION, g_param_spec_boxed ("location", "location", "location", gweather_location_get_type (), 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_WORLD_ITEM_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_WORLD_ITEM_IS_DAYTIME, g_param_spec_boolean ("is-daytime", "is-daytime", "is-daytime", FALSE, 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_WORLD_ITEM_SUNRISE_LABEL, g_param_spec_string ("sunrise-label", "sunrise-label", "sunrise-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_WORLD_ITEM_SUNSET_LABEL, g_param_spec_string ("sunset-label", "sunset-label", "sunset-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_WORLD_ITEM_TIME_LABEL, g_param_spec_string ("time-label", "time-label", "time-label", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_WORLD_ITEM_DAY_LABEL, g_param_spec_string ("day-label", "day-label", "day-label", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void clocks_world_item_instance_init (ClocksWorldItem * self) {
	self->priv = CLOCKS_WORLD_ITEM_GET_PRIVATE (self);
}


static void clocks_world_item_finalize (GObject* obj) {
	ClocksWorldItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_WORLD_TYPE_ITEM, ClocksWorldItem);
	__vala_GWeatherLocation_free0 (self->priv->_location);
	_g_time_zone_unref0 (self->priv->time_zone);
	_g_date_time_unref0 (self->priv->local_time);
	_g_date_time_unref0 (self->priv->date_time);
	_g_object_unref0 (self->priv->weather_info);
	G_OBJECT_CLASS (clocks_world_item_parent_class)->finalize (obj);
}


GType clocks_world_item_get_type (void) {
	static volatile gsize clocks_world_item_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_world_item_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ClocksWorldItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_world_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksWorldItem), 0, (GInstanceInitFunc) clocks_world_item_instance_init, NULL };
		GType clocks_world_item_type_id;
		clocks_world_item_type_id = g_type_register_static (G_TYPE_OBJECT, "ClocksWorldItem", &g_define_type_info, 0);
		g_once_init_leave (&clocks_world_item_type_id__volatile, clocks_world_item_type_id);
	}
	return clocks_world_item_type_id__volatile;
}


static void _vala_clocks_world_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ClocksWorldItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_WORLD_TYPE_ITEM, ClocksWorldItem);
	switch (property_id) {
		case CLOCKS_WORLD_ITEM_LOCATION:
		g_value_set_boxed (value, clocks_world_item_get_location (self));
		break;
		case CLOCKS_WORLD_ITEM_NAME:
		g_value_take_string (value, clocks_world_item_get_name (self));
		break;
		case CLOCKS_WORLD_ITEM_IS_DAYTIME:
		g_value_set_boolean (value, clocks_world_item_get_is_daytime (self));
		break;
		case CLOCKS_WORLD_ITEM_SUNRISE_LABEL:
		g_value_take_string (value, clocks_world_item_get_sunrise_label (self));
		break;
		case CLOCKS_WORLD_ITEM_SUNSET_LABEL:
		g_value_take_string (value, clocks_world_item_get_sunset_label (self));
		break;
		case CLOCKS_WORLD_ITEM_TIME_LABEL:
		g_value_take_string (value, clocks_world_item_get_time_label (self));
		break;
		case CLOCKS_WORLD_ITEM_DAY_LABEL:
		g_value_set_string (value, clocks_world_item_get_day_label (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_clocks_world_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	ClocksWorldItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_WORLD_TYPE_ITEM, ClocksWorldItem);
	switch (property_id) {
		case CLOCKS_WORLD_ITEM_LOCATION:
		clocks_world_item_set_location (self, g_value_get_boxed (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


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


static void __lambda21_ (ClocksWorldLocationDialog* self) {
	clocks_world_location_dialog_location_changed (self);
}


static void ___lambda21__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
	__lambda21_ (self);
}


static void __lambda22_ (ClocksWorldLocationDialog* self) {
	clocks_world_location_dialog_location_changed (self);
}


static void ___lambda22__gtk_entry_activate (GtkEntry* _sender, gpointer self) {
	__lambda22_ (self);
}


static void __lambda23_ (ClocksWorldLocationDialog* self) {
	GWeatherLocationEntry* _tmp0_;
	GIcon* _tmp1_ = NULL;
	GThemedIcon* _tmp2_;
	_tmp0_ = self->priv->entry;
	_tmp1_ = gtk_entry_get_icon_gicon ((GtkEntry*) _tmp0_, GTK_ENTRY_ICON_SECONDARY);
	_tmp2_ = self->priv->clear_icon;
	if (_tmp1_ == _tmp2_) {
		GWeatherLocationEntry* _tmp3_;
		_tmp3_ = self->priv->entry;
		gtk_entry_set_text ((GtkEntry*) _tmp3_, "");
	}
}


static void ___lambda23__gtk_entry_icon_release (GtkEntry* _sender, GtkEntryIconPosition p0, GdkEvent* p1, gpointer self) {
	__lambda23_ (self);
}


ClocksWorldLocationDialog* clocks_world_location_dialog_construct (GType object_type, GtkWindow* parent) {
	ClocksWorldLocationDialog * self = NULL;
	GtkWindow* _tmp0_;
	const gchar* _tmp1_ = NULL;
	GtkBuilder* _tmp2_ = NULL;
	GtkBuilder* builder;
	GObject* _tmp3_ = NULL;
	GtkGrid* _tmp4_;
	GtkGrid* grid;
	GtkBox* _tmp5_ = NULL;
	GWeatherLocation* _tmp6_ = NULL;
	GWeatherLocation* _tmp7_;
	GWeatherLocationEntry* _tmp8_;
	GWeatherLocationEntry* _tmp9_;
	GThemedIcon* _tmp10_;
	GThemedIcon* _tmp11_;
	GWeatherLocationEntry* _tmp12_;
	GThemedIcon* _tmp13_;
	GWeatherLocationEntry* _tmp14_;
	GWeatherLocationEntry* _tmp15_;
	GWeatherLocationEntry* _tmp16_;
	GWeatherLocationEntry* _tmp17_;
	GWeatherLocationEntry* _tmp18_;
	GWeatherLocationEntry* _tmp19_;
	g_return_val_if_fail (parent != NULL, NULL);
	_tmp0_ = parent;
	_tmp1_ = _ ("Add a New World Clock");
	self = (ClocksWorldLocationDialog*) g_object_new (object_type, "transient-for", _tmp0_, "modal", TRUE, "title", _tmp1_, NULL);
	gtk_dialog_add_buttons ((GtkDialog*) self, GTK_STOCK_CANCEL, 0, GTK_STOCK_ADD, 1, NULL);
	gtk_dialog_set_default_response ((GtkDialog*) self, 1);
	gtk_dialog_set_response_sensitive ((GtkDialog*) self, 1, FALSE);
	_tmp2_ = clocks_utils_load_ui ("world.ui");
	builder = _tmp2_;
	_tmp3_ = gtk_builder_get_object (builder, "location_dialog_content");
	_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, GTK_TYPE_GRID) ? ((GtkGrid*) _tmp3_) : NULL);
	grid = _tmp4_;
	_tmp5_ = gtk_dialog_get_content_area ((GtkDialog*) self);
	gtk_container_add ((GtkContainer*) _tmp5_, (GtkWidget*) grid);
	_tmp6_ = clocks_world_get_world_location ();
	_tmp7_ = _tmp6_;
	_tmp8_ = (GWeatherLocationEntry*) gweather_location_entry_new (_tmp7_);
	g_object_ref_sink (_tmp8_);
	_g_object_unref0 (self->priv->entry);
	self->priv->entry = _tmp8_;
	__vala_GWeatherLocation_free0 (_tmp7_);
	_tmp9_ = self->priv->entry;
	gtk_widget_set_size_request ((GtkWidget*) _tmp9_, 400, -1);
	_tmp10_ = (GThemedIcon*) g_themed_icon_new_with_default_fallbacks ("edit-find-symbolic");
	_g_object_unref0 (self->priv->find_icon);
	self->priv->find_icon = _tmp10_;
	_tmp11_ = (GThemedIcon*) g_themed_icon_new_with_default_fallbacks ("edit-clear-symbolic");
	_g_object_unref0 (self->priv->clear_icon);
	self->priv->clear_icon = _tmp11_;
	_tmp12_ = self->priv->entry;
	_tmp13_ = self->priv->find_icon;
	gtk_entry_set_icon_from_gicon ((GtkEntry*) _tmp12_, GTK_ENTRY_ICON_SECONDARY, (GIcon*) _tmp13_);
	_tmp14_ = self->priv->entry;
	gtk_entry_set_activates_default ((GtkEntry*) _tmp14_, TRUE);
	_tmp15_ = self->priv->entry;
	gtk_widget_show ((GtkWidget*) _tmp15_);
	_tmp16_ = self->priv->entry;
	gtk_grid_attach (grid, (GtkWidget*) _tmp16_, 0, 1, 1, 1);
	_tmp17_ = self->priv->entry;
	g_signal_connect_object ((GtkEditable*) _tmp17_, "changed", (GCallback) ___lambda21__gtk_editable_changed, self, 0);
	_tmp18_ = self->priv->entry;
	g_signal_connect_object ((GtkEntry*) _tmp18_, "activate", (GCallback) ___lambda22__gtk_entry_activate, self, 0);
	_tmp19_ = self->priv->entry;
	g_signal_connect_object ((GtkEntry*) _tmp19_, "icon-release", (GCallback) ___lambda23__gtk_entry_icon_release, self, 0);
	_g_object_unref0 (grid);
	_g_object_unref0 (builder);
	return self;
}


ClocksWorldLocationDialog* clocks_world_location_dialog_new (GtkWindow* parent) {
	return clocks_world_location_dialog_construct (CLOCKS_WORLD_TYPE_LOCATION_DIALOG, parent);
}


static void clocks_world_location_dialog_location_changed (ClocksWorldLocationDialog* self) {
	GWeatherLocation* l;
	GWeatherLocationEntry* _tmp0_;
	const gchar* _tmp1_ = NULL;
	GWeatherLocation* _tmp8_;
	g_return_if_fail (self != NULL);
	l = NULL;
	_tmp0_ = self->priv->entry;
	_tmp1_ = gtk_entry_get_text ((GtkEntry*) _tmp0_);
	if (g_strcmp0 (_tmp1_, "") == 0) {
		GWeatherLocationEntry* _tmp2_;
		GThemedIcon* _tmp3_;
		_tmp2_ = self->priv->entry;
		_tmp3_ = self->priv->find_icon;
		gtk_entry_set_icon_from_gicon ((GtkEntry*) _tmp2_, GTK_ENTRY_ICON_SECONDARY, (GIcon*) _tmp3_);
	} else {
		GWeatherLocationEntry* _tmp4_;
		GThemedIcon* _tmp5_;
		GWeatherLocationEntry* _tmp6_;
		GWeatherLocation* _tmp7_ = NULL;
		_tmp4_ = self->priv->entry;
		_tmp5_ = self->priv->clear_icon;
		gtk_entry_set_icon_from_gicon ((GtkEntry*) _tmp4_, GTK_ENTRY_ICON_SECONDARY, (GIcon*) _tmp5_);
		_tmp6_ = self->priv->entry;
		_tmp7_ = gweather_location_entry_get_location (_tmp6_);
		__vala_GWeatherLocation_free0 (l);
		l = _tmp7_;
	}
	_tmp8_ = l;
	gtk_dialog_set_response_sensitive ((GtkDialog*) self, 1, _tmp8_ != NULL);
	__vala_GWeatherLocation_free0 (l);
}


ClocksWorldItem* clocks_world_location_dialog_get_location (ClocksWorldLocationDialog* self) {
	ClocksWorldItem* result = NULL;
	GWeatherLocationEntry* _tmp0_;
	GWeatherLocation* _tmp1_ = NULL;
	GWeatherLocation* location;
	ClocksWorldItem* _tmp2_ = NULL;
	GWeatherLocation* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->entry;
	_tmp1_ = gweather_location_entry_get_location (_tmp0_);
	location = _tmp1_;
	_tmp3_ = location;
	if (_tmp3_ != NULL) {
		GWeatherLocation* _tmp4_;
		ClocksWorldItem* _tmp5_;
		_tmp4_ = location;
		_tmp5_ = clocks_world_item_new (_tmp4_);
		_g_object_unref0 (_tmp2_);
		_tmp2_ = _tmp5_;
	} else {
		_g_object_unref0 (_tmp2_);
		_tmp2_ = NULL;
	}
	result = _tmp2_;
	__vala_GWeatherLocation_free0 (location);
	return result;
}


static void clocks_world_location_dialog_class_init (ClocksWorldLocationDialogClass * klass) {
	clocks_world_location_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ClocksWorldLocationDialogPrivate));
	G_OBJECT_CLASS (klass)->finalize = clocks_world_location_dialog_finalize;
}


static void clocks_world_location_dialog_instance_init (ClocksWorldLocationDialog * self) {
	self->priv = CLOCKS_WORLD_LOCATION_DIALOG_GET_PRIVATE (self);
}


static void clocks_world_location_dialog_finalize (GObject* obj) {
	ClocksWorldLocationDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_WORLD_TYPE_LOCATION_DIALOG, ClocksWorldLocationDialog);
	_g_object_unref0 (self->priv->entry);
	_g_object_unref0 (self->priv->find_icon);
	_g_object_unref0 (self->priv->clear_icon);
	G_OBJECT_CLASS (clocks_world_location_dialog_parent_class)->finalize (obj);
}


GType clocks_world_location_dialog_get_type (void) {
	static volatile gsize clocks_world_location_dialog_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_world_location_dialog_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ClocksWorldLocationDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_world_location_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksWorldLocationDialog), 0, (GInstanceInitFunc) clocks_world_location_dialog_instance_init, NULL };
		GType clocks_world_location_dialog_type_id;
		clocks_world_location_dialog_type_id = g_type_register_static (GTK_TYPE_DIALOG, "ClocksWorldLocationDialog", &g_define_type_info, 0);
		g_once_init_leave (&clocks_world_location_dialog_type_id__volatile, clocks_world_location_dialog_type_id);
	}
	return clocks_world_location_dialog_type_id__volatile;
}


ClocksWorldStandalonePanel* clocks_world_standalone_panel_construct (GType object_type) {
	ClocksWorldStandalonePanel * self = NULL;
	GtkStyleContext* _tmp0_ = NULL;
	GtkStyleContext* _tmp1_ = NULL;
	GtkBuilder* _tmp2_ = NULL;
	GtkBuilder* builder;
	GObject* _tmp3_ = NULL;
	GtkGrid* _tmp4_;
	GtkGrid* grid;
	GObject* _tmp5_ = NULL;
	GtkLabel* _tmp6_;
	GObject* _tmp7_ = NULL;
	GtkLabel* _tmp8_;
	GObject* _tmp9_ = NULL;
	GtkLabel* _tmp10_;
	GObject* _tmp11_ = NULL;
	GtkLabel* _tmp12_;
	self = (ClocksWorldStandalonePanel*) g_object_new (object_type, NULL);
	_tmp0_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_add_class (_tmp0_, "view");
	_tmp1_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_add_class (_tmp1_, "content-view");
	_tmp2_ = clocks_utils_load_ui ("world.ui");
	builder = _tmp2_;
	_tmp3_ = gtk_builder_get_object (builder, "standalone_content");
	_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, GTK_TYPE_GRID) ? ((GtkGrid*) _tmp3_) : NULL);
	grid = _tmp4_;
	_tmp5_ = gtk_builder_get_object (builder, "time_label");
	_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, GTK_TYPE_LABEL) ? ((GtkLabel*) _tmp5_) : NULL);
	_g_object_unref0 (self->priv->time_label);
	self->priv->time_label = _tmp6_;
	_tmp7_ = gtk_builder_get_object (builder, "day_label");
	_tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, GTK_TYPE_LABEL) ? ((GtkLabel*) _tmp7_) : NULL);
	_g_object_unref0 (self->priv->day_label);
	self->priv->day_label = _tmp8_;
	_tmp9_ = gtk_builder_get_object (builder, "sunrise_label");
	_tmp10_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, GTK_TYPE_LABEL) ? ((GtkLabel*) _tmp9_) : NULL);
	_g_object_unref0 (self->priv->sunrise_label);
	self->priv->sunrise_label = _tmp10_;
	_tmp11_ = gtk_builder_get_object (builder, "sunset_label");
	_tmp12_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp11_, GTK_TYPE_LABEL) ? ((GtkLabel*) _tmp11_) : NULL);
	_g_object_unref0 (self->priv->sunset_label);
	self->priv->sunset_label = _tmp12_;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) grid);
	_g_object_unref0 (grid);
	_g_object_unref0 (builder);
	return self;
}


ClocksWorldStandalonePanel* clocks_world_standalone_panel_new (void) {
	return clocks_world_standalone_panel_construct (CLOCKS_WORLD_TYPE_STANDALONE_PANEL);
}


void clocks_world_standalone_panel_update (ClocksWorldStandalonePanel* self) {
	ClocksWorldItem* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_location;
	if (_tmp0_ != NULL) {
		GtkLabel* _tmp1_;
		ClocksWorldItem* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		GtkLabel* _tmp6_;
		ClocksWorldItem* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		GtkLabel* _tmp10_;
		ClocksWorldItem* _tmp11_;
		gchar* _tmp12_;
		gchar* _tmp13_;
		gchar* _tmp14_;
		GtkLabel* _tmp15_;
		ClocksWorldItem* _tmp16_;
		gchar* _tmp17_;
		gchar* _tmp18_;
		gchar* _tmp19_;
		_tmp1_ = self->priv->time_label;
		_tmp2_ = self->priv->_location;
		_tmp3_ = clocks_world_item_get_time_label (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_;
		gtk_label_set_label (_tmp1_, _tmp5_);
		_g_free0 (_tmp5_);
		_tmp6_ = self->priv->day_label;
		_tmp7_ = self->priv->_location;
		_tmp8_ = clocks_world_item_get_day_label (_tmp7_);
		_tmp9_ = _tmp8_;
		gtk_label_set_label (_tmp6_, _tmp9_);
		_tmp10_ = self->priv->sunrise_label;
		_tmp11_ = self->priv->_location;
		_tmp12_ = clocks_world_item_get_sunrise_label (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = _tmp13_;
		gtk_label_set_label (_tmp10_, _tmp14_);
		_g_free0 (_tmp14_);
		_tmp15_ = self->priv->sunset_label;
		_tmp16_ = self->priv->_location;
		_tmp17_ = clocks_world_item_get_sunset_label (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp19_ = _tmp18_;
		gtk_label_set_label (_tmp15_, _tmp19_);
		_g_free0 (_tmp19_);
	}
}


ClocksWorldItem* clocks_world_standalone_panel_get_location (ClocksWorldStandalonePanel* self) {
	ClocksWorldItem* result;
	ClocksWorldItem* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_location;
	result = _tmp0_;
	return result;
}


void clocks_world_standalone_panel_set_location (ClocksWorldStandalonePanel* self, ClocksWorldItem* value) {
	ClocksWorldItem* _tmp0_;
	ClocksWorldItem* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_location);
	self->priv->_location = _tmp1_;
	g_object_notify ((GObject *) self, "location");
}


static void clocks_world_standalone_panel_class_init (ClocksWorldStandalonePanelClass * klass) {
	clocks_world_standalone_panel_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ClocksWorldStandalonePanelPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_clocks_world_standalone_panel_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_clocks_world_standalone_panel_set_property;
	G_OBJECT_CLASS (klass)->finalize = clocks_world_standalone_panel_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_WORLD_STANDALONE_PANEL_LOCATION, g_param_spec_object ("location", "location", "location", CLOCKS_WORLD_TYPE_ITEM, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
}


static void clocks_world_standalone_panel_instance_init (ClocksWorldStandalonePanel * self) {
	self->priv = CLOCKS_WORLD_STANDALONE_PANEL_GET_PRIVATE (self);
}


static void clocks_world_standalone_panel_finalize (GObject* obj) {
	ClocksWorldStandalonePanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_WORLD_TYPE_STANDALONE_PANEL, ClocksWorldStandalonePanel);
	_g_object_unref0 (self->priv->_location);
	_g_object_unref0 (self->priv->time_label);
	_g_object_unref0 (self->priv->day_label);
	_g_object_unref0 (self->priv->sunrise_label);
	_g_object_unref0 (self->priv->sunset_label);
	G_OBJECT_CLASS (clocks_world_standalone_panel_parent_class)->finalize (obj);
}


GType clocks_world_standalone_panel_get_type (void) {
	static volatile gsize clocks_world_standalone_panel_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_world_standalone_panel_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ClocksWorldStandalonePanelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_world_standalone_panel_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksWorldStandalonePanel), 0, (GInstanceInitFunc) clocks_world_standalone_panel_instance_init, NULL };
		GType clocks_world_standalone_panel_type_id;
		clocks_world_standalone_panel_type_id = g_type_register_static (GTK_TYPE_EVENT_BOX, "ClocksWorldStandalonePanel", &g_define_type_info, 0);
		g_once_init_leave (&clocks_world_standalone_panel_type_id__volatile, clocks_world_standalone_panel_type_id);
	}
	return clocks_world_standalone_panel_type_id__volatile;
}


static void _vala_clocks_world_standalone_panel_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ClocksWorldStandalonePanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_WORLD_TYPE_STANDALONE_PANEL, ClocksWorldStandalonePanel);
	switch (property_id) {
		case CLOCKS_WORLD_STANDALONE_PANEL_LOCATION:
		g_value_set_object (value, clocks_world_standalone_panel_get_location (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_clocks_world_standalone_panel_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	ClocksWorldStandalonePanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_WORLD_TYPE_STANDALONE_PANEL, ClocksWorldStandalonePanel);
	switch (property_id) {
		case CLOCKS_WORLD_STANDALONE_PANEL_LOCATION:
		clocks_world_standalone_panel_set_location (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


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


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


static 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_)) {
		ClocksWorldMainPanel * self;
		self = _data2_->self;
		_g_object_unref0 (_data2_->toolbar);
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}


static void __lambda16_ (ClocksWorldMainPanel* self, GtkCellLayout* column, GtkCellRenderer* cell, GtkTreeModel* model, GtkTreeIter* iter) {
	ClocksWorldItem* location = NULL;
	GtkTreeModel* _tmp0_;
	GtkTreeIter _tmp1_;
	GtkCellRenderer* _tmp2_;
	ClocksDigitalClockRenderer* _tmp3_;
	ClocksDigitalClockRenderer* renderer;
	ClocksDigitalClockRenderer* _tmp4_;
	ClocksWorldItem* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	ClocksDigitalClockRenderer* _tmp9_;
	ClocksWorldItem* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	ClocksWorldItem* _tmp13_;
	gboolean _tmp14_;
	gboolean _tmp15_;
	g_return_if_fail (column != NULL);
	g_return_if_fail (cell != NULL);
	g_return_if_fail (model != NULL);
	g_return_if_fail (iter != NULL);
	_tmp0_ = model;
	_tmp1_ = *iter;
	gtk_tree_model_get (_tmp0_, &_tmp1_, CLOCKS_ICON_VIEW_COLUMN_ITEM, &location, -1);
	_tmp2_ = cell;
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, CLOCKS_TYPE_DIGITAL_CLOCK_RENDERER, ClocksDigitalClockRenderer));
	renderer = _tmp3_;
	_tmp4_ = renderer;
	_tmp5_ = location;
	_tmp6_ = clocks_world_item_get_time_label (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_;
	clocks_digital_clock_renderer_set_text (_tmp4_, _tmp8_);
	_g_free0 (_tmp8_);
	_tmp9_ = renderer;
	_tmp10_ = location;
	_tmp11_ = clocks_world_item_get_day_label (_tmp10_);
	_tmp12_ = _tmp11_;
	clocks_digital_clock_renderer_set_subtext (_tmp9_, _tmp12_);
	_tmp13_ = location;
	_tmp14_ = clocks_world_item_get_is_daytime (_tmp13_);
	_tmp15_ = _tmp14_;
	if (_tmp15_) {
		ClocksDigitalClockRenderer* _tmp16_;
		GdkPixbuf* _tmp17_;
		ClocksDigitalClockRenderer* _tmp18_;
		_tmp16_ = renderer;
		_tmp17_ = self->priv->day_pixbuf;
		g_object_set ((GtkCellRendererPixbuf*) _tmp16_, "pixbuf", _tmp17_, NULL);
		_tmp18_ = renderer;
		clocks_digital_clock_renderer_set_css_class (_tmp18_, "light");
	} else {
		ClocksDigitalClockRenderer* _tmp19_;
		GdkPixbuf* _tmp20_;
		ClocksDigitalClockRenderer* _tmp21_;
		_tmp19_ = renderer;
		_tmp20_ = self->priv->night_pixbuf;
		g_object_set ((GtkCellRendererPixbuf*) _tmp19_, "pixbuf", _tmp20_, NULL);
		_tmp21_ = renderer;
		clocks_digital_clock_renderer_set_css_class (_tmp21_, "dark");
	}
	_g_object_unref0 (renderer);
	_g_object_unref0 (location);
}


static void ___lambda16__gtk_cell_layout_data_func (GtkCellLayout* cell_layout, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self) {
	__lambda16_ (self, cell_layout, cell, tree_model, iter);
}


static void __lambda17_ (ClocksWorldMainPanel* self, GtkTreePath* path) {
	ClocksIconView* _tmp0_;
	GtkTreeModel* _tmp1_;
	GtkTreeModel* _tmp2_;
	GtkListStore* _tmp3_;
	GtkListStore* list_store;
	GtkTreeIter i = {0};
	GtkListStore* _tmp4_;
	GtkTreePath* _tmp5_;
	GtkTreeIter _tmp6_ = {0};
	gboolean _tmp7_ = FALSE;
	g_return_if_fail (path != NULL);
	_tmp0_ = self->priv->icon_view;
	_tmp1_ = gtk_icon_view_get_model ((GtkIconView*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GTK_TYPE_LIST_STORE, GtkListStore));
	list_store = _tmp3_;
	_tmp4_ = list_store;
	_tmp5_ = path;
	_tmp7_ = gtk_tree_model_get_iter ((GtkTreeModel*) _tmp4_, &_tmp6_, _tmp5_);
	i = _tmp6_;
	if (_tmp7_) {
		ClocksWorldItem* location = NULL;
		GtkListStore* _tmp8_;
		GtkTreeIter _tmp9_;
		ClocksWorldStandalonePanel* _tmp10_;
		ClocksWorldItem* _tmp11_;
		ClocksWorldStandalonePanel* _tmp12_;
		ClocksWorldStandalonePanel* _tmp13_;
		_tmp8_ = list_store;
		_tmp9_ = i;
		gtk_tree_model_get ((GtkTreeModel*) _tmp8_, &_tmp9_, CLOCKS_ICON_VIEW_COLUMN_ITEM, &location, -1);
		_tmp10_ = self->priv->standalone;
		_tmp11_ = location;
		clocks_world_standalone_panel_set_location (_tmp10_, _tmp11_);
		_tmp12_ = self->priv->standalone;
		clocks_world_standalone_panel_update (_tmp12_);
		_tmp13_ = self->priv->standalone;
		gd_stack_set_visible_child ((GdStack*) self, (GtkWidget*) _tmp13_);
		_g_object_unref0 (location);
	}
	_g_object_unref0 (list_store);
}


static void ___lambda17__gtk_icon_view_item_activated (GtkIconView* _sender, GtkTreePath* path, gpointer self) {
	__lambda17_ (self, path);
}


static gpointer _gtk_tree_path_copy0 (gpointer self) {
	return self ? gtk_tree_path_copy (self) : NULL;
}


static void _gtk_tree_path_free0_ (gpointer var) {
	(var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL));
}


static void _g_list_free__gtk_tree_path_free0_ (GList* self) {
	g_list_foreach (self, (GFunc) _gtk_tree_path_free0_, NULL);
	g_list_free (self);
}


static void __lambda18_ (ClocksWorldMainPanel* self) {
	ClocksIconView* _tmp0_;
	GtkTreeModel* _tmp1_;
	GtkTreeModel* _tmp2_;
	GtkListStore* _tmp3_;
	GtkListStore* list_store;
	ClocksIconView* _tmp4_;
	GList* _tmp5_ = NULL;
	ClocksIconView* _tmp14_;
	_tmp0_ = self->priv->icon_view;
	_tmp1_ = gtk_icon_view_get_model ((GtkIconView*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GTK_TYPE_LIST_STORE, GtkListStore));
	list_store = _tmp3_;
	_tmp4_ = self->priv->icon_view;
	_tmp5_ = clocks_icon_view_get_selected_items (_tmp4_);
	{
		GList* path_collection = NULL;
		GList* path_it = NULL;
		path_collection = _tmp5_;
		for (path_it = path_collection; path_it != NULL; path_it = path_it->next) {
			GtkTreePath* _tmp6_;
			GtkTreePath* path = NULL;
			_tmp6_ = _gtk_tree_path_copy0 ((GtkTreePath*) path_it->data);
			path = _tmp6_;
			{
				GtkTreeIter i = {0};
				GtkListStore* _tmp7_;
				GtkTreePath* _tmp8_;
				GtkTreeIter _tmp9_ = {0};
				gboolean _tmp10_ = FALSE;
				_tmp7_ = list_store;
				_tmp8_ = path;
				_tmp10_ = gtk_tree_model_get_iter ((GtkTreeModel*) _tmp7_, &_tmp9_, _tmp8_);
				i = _tmp9_;
				if (_tmp10_) {
					ClocksWorldItem* location = NULL;
					GtkListStore* _tmp11_;
					GtkTreeIter _tmp12_;
					ClocksWorldItem* _tmp13_;
					_tmp11_ = list_store;
					_tmp12_ = i;
					gtk_tree_model_get ((GtkTreeModel*) _tmp11_, &_tmp12_, CLOCKS_ICON_VIEW_COLUMN_ITEM, &location, -1);
					_tmp13_ = location;
					self->priv->locations = g_list_remove (self->priv->locations, _tmp13_);
					_g_object_unref0 (location);
				}
				_gtk_tree_path_free0 (path);
			}
		}
		__g_list_free__gtk_tree_path_free0_0 (path_collection);
	}
	_tmp14_ = self->priv->icon_view;
	clocks_icon_view_remove_selected (_tmp14_);
	clocks_world_main_panel_save (self);
	_g_object_unref0 (list_store);
}


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


static void __lambda19_ (Block2Data* _data2_) {
	ClocksWorldMainPanel * self;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	ClocksContentView* _tmp2_;
	self = _data2_->self;
	_tmp0_ = gd_stack_get_visible_child ((GdStack*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->content_view;
	if (_tmp1_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GTK_TYPE_WIDGET, GtkWidget)) {
		ClocksToolbar* _tmp3_;
		_tmp3_ = _data2_->toolbar;
		clocks_toolbar_set_mode (_tmp3_, CLOCKS_TOOLBAR_MODE_NORMAL);
	} else {
		GtkWidget* _tmp4_;
		GtkWidget* _tmp5_;
		ClocksWorldStandalonePanel* _tmp6_;
		_tmp4_ = gd_stack_get_visible_child ((GdStack*) self);
		_tmp5_ = _tmp4_;
		_tmp6_ = self->priv->standalone;
		if (_tmp5_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GTK_TYPE_WIDGET, GtkWidget)) {
			ClocksToolbar* _tmp7_;
			_tmp7_ = _data2_->toolbar;
			clocks_toolbar_set_mode (_tmp7_, CLOCKS_TOOLBAR_MODE_STANDALONE);
		}
	}
}


static void ___lambda19__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda19_ (self);
}


static void __lambda20_ (Block2Data* _data2_) {
	ClocksWorldMainPanel * self;
	self = _data2_->self;
	g_signal_handler_disconnect ((GObject*) self, _data2_->id);
	_data2_->id = (gulong) 0;
}


static void ___lambda20__gtk_widget_destroy (GtkWidget* _sender, gpointer self) {
	__lambda20_ (self);
}


ClocksWorldMainPanel* clocks_world_main_panel_construct (GType object_type, ClocksToolbar* toolbar) {
	ClocksWorldMainPanel * self = NULL;
	Block2Data* _data2_;
	ClocksToolbar* _tmp0_;
	ClocksToolbar* _tmp1_;
	const gchar* _tmp2_ = NULL;
	ClocksToolbar* _tmp3_;
	GSettings* _tmp4_;
	GdkPixbuf* _tmp5_ = NULL;
	GdkPixbuf* _tmp6_ = NULL;
	ClocksIconView* _tmp7_;
	ClocksIconView* _tmp8_;
	GtkBuilder* _tmp9_ = NULL;
	GtkBuilder* builder;
	GObject* _tmp10_ = NULL;
	GtkWidget* _tmp11_;
	GtkWidget* empty_view;
	ClocksIconView* _tmp12_;
	ClocksToolbar* _tmp13_;
	ClocksContentView* _tmp14_;
	ClocksContentView* _tmp15_;
	ClocksContentView* _tmp16_;
	ClocksWorldStandalonePanel* _tmp17_;
	ClocksWorldStandalonePanel* _tmp18_;
	gulong _tmp19_ = 0UL;
	ClocksToolbar* _tmp20_;
	ClocksContentView* _tmp21_;
	g_return_val_if_fail (toolbar != NULL, NULL);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_tmp0_ = toolbar;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data2_->toolbar);
	_data2_->toolbar = _tmp1_;
	_tmp2_ = _ ("World");
	_tmp3_ = _data2_->toolbar;
	self = (ClocksWorldMainPanel*) g_object_new (object_type, "label", _tmp2_, "toolbar", _tmp3_, "homogeneous", TRUE, NULL);
	_data2_->self = g_object_ref (self);
	__g_list_free__g_object_unref0_0 (self->priv->locations);
	self->priv->locations = NULL;
	_tmp4_ = g_settings_new ("org.gnome.clocks");
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp4_;
	_tmp5_ = clocks_utils_load_image ("day.png");
	_g_object_unref0 (self->priv->day_pixbuf);
	self->priv->day_pixbuf = _tmp5_;
	_tmp6_ = clocks_utils_load_image ("night.png");
	_g_object_unref0 (self->priv->night_pixbuf);
	self->priv->night_pixbuf = _tmp6_;
	_tmp7_ = clocks_icon_view_new (___lambda16__gtk_cell_layout_data_func, g_object_ref (self), g_object_unref);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->icon_view);
	self->priv->icon_view = _tmp7_;
	_tmp8_ = self->priv->icon_view;
	g_signal_connect_object ((GtkIconView*) _tmp8_, "item-activated", (GCallback) ___lambda17__gtk_icon_view_item_activated, self, 0);
	_tmp9_ = clocks_utils_load_ui ("world.ui");
	builder = _tmp9_;
	_tmp10_ = gtk_builder_get_object (builder, "empty_panel");
	_tmp11_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp10_, GTK_TYPE_WIDGET) ? ((GtkWidget*) _tmp10_) : NULL);
	empty_view = _tmp11_;
	_tmp12_ = self->priv->icon_view;
	_tmp13_ = _data2_->toolbar;
	_tmp14_ = clocks_content_view_new (empty_view, _tmp12_, _tmp13_);
	g_object_ref_sink (_tmp14_);
	_g_object_unref0 (self->priv->content_view);
	self->priv->content_view = _tmp14_;
	_tmp15_ = self->priv->content_view;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp15_);
	_tmp16_ = self->priv->content_view;
	g_signal_connect_object (_tmp16_, "delete-selected", (GCallback) ___lambda18__clocks_content_view_delete_selected, self, 0);
	_tmp17_ = clocks_world_standalone_panel_new ();
	g_object_ref_sink (_tmp17_);
	_g_object_unref0 (self->priv->standalone);
	self->priv->standalone = _tmp17_;
	_tmp18_ = self->priv->standalone;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp18_);
	clocks_world_main_panel_load (self);
	_tmp19_ = g_signal_connect_data ((GObject*) self, "notify::visible-child", (GCallback) ___lambda19__g_object_notify, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
	_data2_->id = _tmp19_;
	_tmp20_ = _data2_->toolbar;
	g_signal_connect_data ((GtkWidget*) _tmp20_, "destroy", (GCallback) ___lambda20__gtk_widget_destroy, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
	_tmp21_ = self->priv->content_view;
	gd_stack_set_visible_child ((GdStack*) self, (GtkWidget*) _tmp21_);
	gtk_widget_show_all ((GtkWidget*) self);
	_g_object_unref0 (empty_view);
	_g_object_unref0 (builder);
	block2_data_unref (_data2_);
	_data2_ = NULL;
	return self;
}


ClocksWorldMainPanel* clocks_world_main_panel_new (ClocksToolbar* toolbar) {
	return clocks_world_main_panel_construct (CLOCKS_WORLD_TYPE_MAIN_PANEL, toolbar);
}


static void clocks_world_main_panel_load (ClocksWorldMainPanel* self) {
	g_return_if_fail (self != NULL);
	{
		GSettings* _tmp0_;
		GVariant* _tmp1_ = NULL;
		GVariant* _tmp2_;
		GVariantIter* _tmp3_ = NULL;
		GVariantIter* _tmp4_;
		GVariantIter* _l_it;
		GVariant* l = NULL;
		_tmp0_ = self->priv->settings;
		_tmp1_ = g_settings_get_value (_tmp0_, "world-clocks");
		_tmp2_ = _tmp1_;
		_tmp3_ = g_variant_iter_new (_tmp2_);
		_tmp4_ = _tmp3_;
		_g_variant_unref0 (_tmp2_);
		_l_it = _tmp4_;
		while (TRUE) {
			GVariantIter* _tmp5_;
			GVariant* _tmp6_ = NULL;
			GVariant* _tmp7_;
			GVariant* _tmp8_;
			ClocksWorldItem* _tmp9_ = NULL;
			ClocksWorldItem* location;
			ClocksWorldItem* _tmp10_;
			_tmp5_ = _l_it;
			_tmp6_ = g_variant_iter_next_value (_tmp5_);
			_g_variant_unref0 (l);
			l = _tmp6_;
			_tmp7_ = l;
			if (!(_tmp7_ != NULL)) {
				break;
			}
			_tmp8_ = l;
			_tmp9_ = clocks_world_item_deserialize (_tmp8_);
			location = _tmp9_;
			_tmp10_ = location;
			if (_tmp10_ != NULL) {
				ClocksWorldItem* _tmp11_;
				ClocksWorldItem* _tmp12_;
				ClocksIconView* _tmp13_;
				ClocksWorldItem* _tmp14_;
				gchar* _tmp15_;
				gchar* _tmp16_;
				gchar* _tmp17_;
				ClocksWorldItem* _tmp18_;
				_tmp11_ = location;
				_tmp12_ = _g_object_ref0 (_tmp11_);
				self->priv->locations = g_list_prepend (self->priv->locations, _tmp12_);
				_tmp13_ = self->priv->icon_view;
				_tmp14_ = location;
				_tmp15_ = clocks_world_item_get_name (_tmp14_);
				_tmp16_ = _tmp15_;
				_tmp17_ = _tmp16_;
				_tmp18_ = location;
				clocks_icon_view_add_item (_tmp13_, _tmp17_, (GObject*) _tmp18_);
				_g_free0 (_tmp17_);
			}
			_g_object_unref0 (location);
		}
		_g_variant_unref0 (l);
		_g_variant_iter_free0 (_l_it);
	}
	self->priv->locations = g_list_reverse (self->priv->locations);
}


static void clocks_world_main_panel_save (ClocksWorldMainPanel* self) {
	GVariantType* _tmp0_;
	GVariantType* _tmp1_;
	GVariantBuilder* _tmp2_;
	GVariantBuilder* _tmp3_;
	GVariantBuilder* builder;
	GList* _tmp4_;
	GSettings* _tmp8_;
	GVariantBuilder* _tmp9_;
	GVariant* _tmp10_ = NULL;
	GVariant* _tmp11_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_variant_type_new ("aa{sv}");
	_tmp1_ = _tmp0_;
	_tmp2_ = g_variant_builder_new (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_variant_type_free0 (_tmp1_);
	builder = _tmp3_;
	_tmp4_ = self->priv->locations;
	{
		GList* i_collection = NULL;
		GList* i_it = NULL;
		i_collection = _tmp4_;
		for (i_it = i_collection; i_it != NULL; i_it = i_it->next) {
			ClocksWorldItem* _tmp5_;
			ClocksWorldItem* i = NULL;
			_tmp5_ = _g_object_ref0 ((ClocksWorldItem*) i_it->data);
			i = _tmp5_;
			{
				ClocksWorldItem* _tmp6_;
				GVariantBuilder* _tmp7_;
				_tmp6_ = i;
				_tmp7_ = builder;
				clocks_world_item_serialize (_tmp6_, _tmp7_);
				_g_object_unref0 (i);
			}
		}
	}
	_tmp8_ = self->priv->settings;
	_tmp9_ = builder;
	_tmp10_ = g_variant_builder_end (_tmp9_);
	g_variant_ref_sink (_tmp10_);
	_tmp11_ = _tmp10_;
	g_settings_set_value (_tmp8_, "world-clocks", _tmp11_);
	_g_variant_unref0 (_tmp11_);
	_g_variant_builder_unref0 (builder);
}


static void __lambda24_ (ClocksWorldMainPanel* self, GtkDialog* dialog, gint response) {
	gint _tmp0_;
	GtkDialog* _tmp11_;
	g_return_if_fail (dialog != NULL);
	_tmp0_ = response;
	if (_tmp0_ == 1) {
		GtkDialog* _tmp1_;
		ClocksWorldItem* _tmp2_ = NULL;
		ClocksWorldItem* location;
		ClocksWorldItem* _tmp3_;
		ClocksWorldItem* _tmp4_;
		ClocksIconView* _tmp5_;
		ClocksWorldItem* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		ClocksWorldItem* _tmp10_;
		_tmp1_ = dialog;
		_tmp2_ = clocks_world_location_dialog_get_location (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, CLOCKS_WORLD_TYPE_LOCATION_DIALOG, ClocksWorldLocationDialog));
		location = _tmp2_;
		_tmp3_ = location;
		_tmp4_ = _g_object_ref0 (_tmp3_);
		self->priv->locations = g_list_append (self->priv->locations, _tmp4_);
		_tmp5_ = self->priv->icon_view;
		_tmp6_ = location;
		_tmp7_ = clocks_world_item_get_name (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = _tmp8_;
		_tmp10_ = location;
		clocks_icon_view_add_item (_tmp5_, _tmp9_, (GObject*) _tmp10_);
		_g_free0 (_tmp9_);
		clocks_world_main_panel_save (self);
		_g_object_unref0 (location);
	}
	_tmp11_ = dialog;
	gtk_widget_destroy ((GtkWidget*) _tmp11_);
}


static void ___lambda24__gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
	__lambda24_ (self, _sender, response_id);
}


static void clocks_world_main_panel_real_activate_new (ClocksClock* base) {
	ClocksWorldMainPanel * self;
	GtkWidget* _tmp0_ = NULL;
	ClocksWorldLocationDialog* _tmp1_;
	ClocksWorldLocationDialog* dialog;
	self = (ClocksWorldMainPanel*) base;
	_tmp0_ = gtk_widget_get_toplevel ((GtkWidget*) self);
	_tmp1_ = clocks_world_location_dialog_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GTK_TYPE_WINDOW, GtkWindow));
	g_object_ref_sink (_tmp1_);
	dialog = _tmp1_;
	g_signal_connect_object ((GtkDialog*) dialog, "response", (GCallback) ___lambda24__gtk_dialog_response, self, 0);
	gtk_widget_show ((GtkWidget*) dialog);
	_g_object_unref0 (dialog);
}


static void clocks_world_main_panel_real_activate_select_all (ClocksClock* base) {
	ClocksWorldMainPanel * self;
	ClocksIconView* _tmp0_;
	self = (ClocksWorldMainPanel*) base;
	_tmp0_ = self->priv->icon_view;
	clocks_icon_view_select_all (_tmp0_);
}


static void clocks_world_main_panel_real_activate_select_none (ClocksClock* base) {
	ClocksWorldMainPanel * self;
	ClocksIconView* _tmp0_;
	self = (ClocksWorldMainPanel*) base;
	_tmp0_ = self->priv->icon_view;
	clocks_icon_view_unselect_all (_tmp0_);
}


static void ___lambda25_ (ClocksWorldMainPanel* self) {
	clocks_clock_activate_new ((ClocksClock*) self);
}


static void ____lambda25__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	___lambda25_ (self);
}


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


static void ____lambda26__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	___lambda26_ (self);
}


static void clocks_world_main_panel_real_update_toolbar (ClocksClock* base) {
	ClocksWorldMainPanel * self;
	ClocksToolbar* _tmp0_;
	ClocksToolbar* _tmp1_;
	ClocksToolbar* _tmp2_;
	ClocksToolbar* _tmp3_;
	ClocksToolbarMode _tmp4_;
	ClocksToolbarMode _tmp5_;
	self = (ClocksWorldMainPanel*) base;
	_tmp0_ = clocks_clock_get_toolbar ((ClocksClock*) self);
	_tmp1_ = _tmp0_;
	clocks_toolbar_clear (_tmp1_);
	_tmp2_ = clocks_clock_get_toolbar ((ClocksClock*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = clocks_toolbar_get_mode (_tmp3_);
	_tmp5_ = _tmp4_;
	switch (_tmp5_) {
		case CLOCKS_TOOLBAR_MODE_NORMAL:
		{
			ClocksToolbar* _tmp6_;
			ClocksToolbar* _tmp7_;
			const gchar* _tmp8_ = NULL;
			GtkButton* _tmp9_ = NULL;
			GtkButton* new_button;
			GtkButton* _tmp10_;
			ClocksContentView* _tmp11_;
			_tmp6_ = clocks_clock_get_toolbar ((ClocksClock*) self);
			_tmp7_ = _tmp6_;
			_tmp8_ = _ ("New");
			_tmp9_ = clocks_toolbar_add_button (_tmp7_, NULL, _tmp8_, TRUE);
			new_button = _tmp9_;
			_tmp10_ = new_button;
			g_signal_connect_object (_tmp10_, "clicked", (GCallback) ____lambda25__gtk_button_clicked, self, 0);
			_tmp11_ = self->priv->content_view;
			clocks_content_view_update_toolbar (_tmp11_);
			_g_object_unref0 (new_button);
			break;
		}
		case CLOCKS_TOOLBAR_MODE_SELECTION:
		{
			ClocksContentView* _tmp12_;
			_tmp12_ = self->priv->content_view;
			clocks_content_view_update_toolbar (_tmp12_);
			break;
		}
		case CLOCKS_TOOLBAR_MODE_STANDALONE:
		{
			ClocksToolbar* _tmp13_;
			ClocksToolbar* _tmp14_;
			ClocksToolbar* _tmp15_;
			ClocksToolbar* _tmp16_;
			ClocksWorldStandalonePanel* _tmp17_;
			ClocksWorldItem* _tmp18_;
			ClocksWorldItem* _tmp19_;
			gchar* _tmp20_;
			gchar* _tmp21_;
			gchar* _tmp22_;
			gchar* _tmp23_ = NULL;
			gchar* _tmp24_;
			ClocksToolbar* _tmp25_;
			ClocksToolbar* _tmp26_;
			GtkButton* _tmp27_ = NULL;
			GtkButton* back_button;
			GtkButton* _tmp28_;
			_tmp13_ = clocks_clock_get_toolbar ((ClocksClock*) self);
			_tmp14_ = _tmp13_;
			gd_main_toolbar_set_labels_menu ((GdMainToolbar*) _tmp14_, NULL);
			_tmp15_ = clocks_clock_get_toolbar ((ClocksClock*) self);
			_tmp16_ = _tmp15_;
			_tmp17_ = self->priv->standalone;
			_tmp18_ = clocks_world_standalone_panel_get_location (_tmp17_);
			_tmp19_ = _tmp18_;
			_tmp20_ = clocks_world_item_get_name (_tmp19_);
			_tmp21_ = _tmp20_;
			_tmp22_ = _tmp21_;
			_tmp23_ = g_markup_escape_text (_tmp22_, (gssize) (-1));
			_tmp24_ = _tmp23_;
			gd_main_toolbar_set_labels ((GdMainToolbar*) _tmp16_, _tmp24_, NULL);
			_g_free0 (_tmp24_);
			_g_free0 (_tmp22_);
			_tmp25_ = clocks_clock_get_toolbar ((ClocksClock*) self);
			_tmp26_ = _tmp25_;
			_tmp27_ = clocks_toolbar_add_button (_tmp26_, "go-previous-symbolic", NULL, TRUE);
			back_button = _tmp27_;
			_tmp28_ = back_button;
			g_signal_connect_object (_tmp28_, "clicked", (GCallback) ____lambda26__gtk_button_clicked, self, 0);
			_g_object_unref0 (back_button);
			break;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}


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


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


static ClocksToolbar* clocks_world_main_panel_real_get_toolbar (ClocksClock* base) {
	ClocksToolbar* result;
	ClocksWorldMainPanel* self;
	ClocksToolbar* _tmp0_;
	self = (ClocksWorldMainPanel*) base;
	_tmp0_ = self->priv->_toolbar;
	result = _tmp0_;
	return result;
}


static void clocks_world_main_panel_real_set_toolbar (ClocksClock* base, ClocksToolbar* value) {
	ClocksWorldMainPanel* self;
	ClocksToolbar* _tmp0_;
	ClocksToolbar* _tmp1_;
	self = (ClocksWorldMainPanel*) base;
	_tmp0_ = value;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_toolbar);
	self->priv->_toolbar = _tmp1_;
	g_object_notify ((GObject *) self, "toolbar");
}


static void clocks_world_main_panel_class_init (ClocksWorldMainPanelClass * klass) {
	clocks_world_main_panel_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ClocksWorldMainPanelPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_clocks_world_main_panel_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_clocks_world_main_panel_set_property;
	G_OBJECT_CLASS (klass)->finalize = clocks_world_main_panel_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_WORLD_MAIN_PANEL_LABEL, g_param_spec_string ("label", "label", "label", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_WORLD_MAIN_PANEL_TOOLBAR, g_param_spec_object ("toolbar", "toolbar", "toolbar", CLOCKS_TYPE_TOOLBAR, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
}


static void clocks_world_main_panel_clocks_clock_interface_init (ClocksClockIface * iface) {
	clocks_world_main_panel_clocks_clock_parent_iface = g_type_interface_peek_parent (iface);
	iface->activate_new = (void (*)(ClocksClock*)) clocks_world_main_panel_real_activate_new;
	iface->activate_select_all = (void (*)(ClocksClock*)) clocks_world_main_panel_real_activate_select_all;
	iface->activate_select_none = (void (*)(ClocksClock*)) clocks_world_main_panel_real_activate_select_none;
	iface->update_toolbar = (void (*)(ClocksClock*)) clocks_world_main_panel_real_update_toolbar;
	iface->get_label = clocks_world_main_panel_real_get_label;
	iface->set_label = clocks_world_main_panel_real_set_label;
	iface->get_toolbar = clocks_world_main_panel_real_get_toolbar;
	iface->set_toolbar = clocks_world_main_panel_real_set_toolbar;
}


static void clocks_world_main_panel_instance_init (ClocksWorldMainPanel * self) {
	self->priv = CLOCKS_WORLD_MAIN_PANEL_GET_PRIVATE (self);
}


static void clocks_world_main_panel_finalize (GObject* obj) {
	ClocksWorldMainPanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_WORLD_TYPE_MAIN_PANEL, ClocksWorldMainPanel);
	_g_free0 (self->priv->_label);
	_g_object_unref0 (self->priv->_toolbar);
	__g_list_free__g_object_unref0_0 (self->priv->locations);
	_g_object_unref0 (self->priv->settings);
	_g_object_unref0 (self->priv->day_pixbuf);
	_g_object_unref0 (self->priv->night_pixbuf);
	_g_object_unref0 (self->priv->icon_view);
	_g_object_unref0 (self->priv->content_view);
	_g_object_unref0 (self->priv->standalone);
	G_OBJECT_CLASS (clocks_world_main_panel_parent_class)->finalize (obj);
}


GType clocks_world_main_panel_get_type (void) {
	static volatile gsize clocks_world_main_panel_type_id__volatile = 0;
	if (g_once_init_enter (&clocks_world_main_panel_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ClocksWorldMainPanelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_world_main_panel_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksWorldMainPanel), 0, (GInstanceInitFunc) clocks_world_main_panel_instance_init, NULL };
		static const GInterfaceInfo clocks_clock_info = { (GInterfaceInitFunc) clocks_world_main_panel_clocks_clock_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType clocks_world_main_panel_type_id;
		clocks_world_main_panel_type_id = g_type_register_static (gd_stack_get_type (), "ClocksWorldMainPanel", &g_define_type_info, 0);
		g_type_add_interface_static (clocks_world_main_panel_type_id, CLOCKS_TYPE_CLOCK, &clocks_clock_info);
		g_once_init_leave (&clocks_world_main_panel_type_id__volatile, clocks_world_main_panel_type_id);
	}
	return clocks_world_main_panel_type_id__volatile;
}


static void _vala_clocks_world_main_panel_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ClocksWorldMainPanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_WORLD_TYPE_MAIN_PANEL, ClocksWorldMainPanel);
	switch (property_id) {
		case CLOCKS_WORLD_MAIN_PANEL_LABEL:
		g_value_set_string (value, clocks_clock_get_label ((ClocksClock*) self));
		break;
		case CLOCKS_WORLD_MAIN_PANEL_TOOLBAR:
		g_value_set_object (value, clocks_clock_get_toolbar ((ClocksClock*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_clocks_world_main_panel_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	ClocksWorldMainPanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_WORLD_TYPE_MAIN_PANEL, ClocksWorldMainPanel);
	switch (property_id) {
		case CLOCKS_WORLD_MAIN_PANEL_LABEL:
		clocks_clock_set_label ((ClocksClock*) self, g_value_get_string (value));
		break;
		case CLOCKS_WORLD_MAIN_PANEL_TOOLBAR:
		clocks_clock_set_toolbar ((ClocksClock*) self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



