/* world-row.c generated by valac 0.56.19, the Vala compiler
 * generated from world-row.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 <adwaita.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include <glib/gi18n-lib.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define CLOCKS_WORLD_TYPE_ROW (clocks_world_row_get_type ())
#define CLOCKS_WORLD_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_WORLD_TYPE_ROW, ClocksWorldRow))
#define CLOCKS_WORLD_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_WORLD_TYPE_ROW, ClocksWorldRowClass))
#define CLOCKS_WORLD_IS_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_WORLD_TYPE_ROW))
#define CLOCKS_WORLD_IS_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_WORLD_TYPE_ROW))
#define CLOCKS_WORLD_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_WORLD_TYPE_ROW, ClocksWorldRowClass))

typedef struct _ClocksWorldRow ClocksWorldRow;
typedef struct _ClocksWorldRowClass ClocksWorldRowClass;
typedef struct _ClocksWorldRowPrivate ClocksWorldRowPrivate;

#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;
enum  {
	CLOCKS_WORLD_ROW_0_PROPERTY,
	CLOCKS_WORLD_ROW_LOCATION_PROPERTY,
	CLOCKS_WORLD_ROW_NUM_PROPERTIES
};
static GParamSpec* clocks_world_row_properties[CLOCKS_WORLD_ROW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef enum  {
	CLOCKS_WORLD_SUN_STATE_NONE,
	CLOCKS_WORLD_SUN_STATE_NIGHT,
	CLOCKS_WORLD_SUN_STATE_ASTRO,
	CLOCKS_WORLD_SUN_STATE_NAUT,
	CLOCKS_WORLD_SUN_STATE_CIVIL,
	CLOCKS_WORLD_SUN_STATE_DAY
} ClocksWorldSunState;

#define CLOCKS_WORLD_TYPE_SUN_STATE (clocks_world_sun_state_get_type ())
#define _g_array_unref0(var) ((var == NULL) ? NULL : (var = (g_array_unref (var), NULL)))
enum  {
	CLOCKS_WORLD_ROW_REMOVE_CLOCK_SIGNAL,
	CLOCKS_WORLD_ROW_NUM_SIGNALS
};
static guint clocks_world_row_signals[CLOCKS_WORLD_ROW_NUM_SIGNALS] = {0};

struct _ClocksWorldRow {
	AdwActionRow parent_instance;
	ClocksWorldRowPrivate * priv;
};

struct _ClocksWorldRowClass {
	AdwActionRowClass parent_class;
};

struct _ClocksWorldRowPrivate {
	ClocksWorldItem* _location;
	GtkLabel* time_label;
	GtkWidget* delete_button;
	GBindingGroup* location_binds;
};

static gint ClocksWorldRow_private_offset;
static gpointer clocks_world_row_parent_class = NULL;

VALA_EXTERN GType clocks_world_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClocksWorldRow, g_object_unref)
VALA_EXTERN GType clocks_world_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClocksWorldItem, g_object_unref)
VALA_EXTERN ClocksWorldRow* clocks_world_row_new (ClocksWorldItem* location);
VALA_EXTERN ClocksWorldRow* clocks_world_row_construct (GType object_type,
                                            ClocksWorldItem* location);
static void clocks_world_row_delete (ClocksWorldRow* self);
static void _clocks_world_row_delete_gtk_button_clicked (GtkButton* _sender,
                                                  gpointer self);
VALA_EXTERN ClocksWorldItem* clocks_world_row_get_location (ClocksWorldRow* self);
VALA_EXTERN void clocks_world_row_set_location (ClocksWorldRow* self,
                                    ClocksWorldItem* value);
static GObject * clocks_world_row_constructor (GType type,
                                        guint n_construct_properties,
                                        GObjectConstructParam * construct_properties);
static gboolean _clocks_world_row___lambda14_ (ClocksWorldRow* self,
                                        GBinding* binding,
                                        GValue* src,
                                        GValue* target);
VALA_EXTERN gchar* clocks_utils_get_time_difference_message (gdouble offset);
VALA_EXTERN GTimeSpan clocks_world_item_get_local_offset (ClocksWorldItem* self);
VALA_EXTERN gboolean clocks_world_item_get_automatic (ClocksWorldItem* self);
static gboolean __clocks_world_row___lambda14__gbinding_transform_func (GBinding* binding,
                                                                 GValue* from_value,
                                                                 GValue* to_value,
                                                                 gpointer self);
static gboolean _clocks_world_row___lambda15_ (ClocksWorldRow* self,
                                        GBinding* binding,
                                        GValue* src,
                                        GValue* target);
static gboolean __clocks_world_row___lambda15__gbinding_transform_func (GBinding* binding,
                                                                 GValue* from_value,
                                                                 GValue* to_value,
                                                                 gpointer self);
static gboolean _clocks_world_row___lambda16_ (ClocksWorldRow* self,
                                        GBinding* binding,
                                        GValue* src,
                                        GValue* target);
static void _g_free0_ (gpointer var);
static void _vala_gchar_free_function_content_of (gpointer data);
VALA_EXTERN GType clocks_world_sun_state_get_type (void) G_GNUC_CONST ;
static gboolean _vala_string_array_contains (const gchar* * stack,
                                      gssize stack_length,
                                      const const gchar* needle);
VALA_EXTERN gchar* clocks_world_sun_state_as_css (ClocksWorldSunState self);
static gboolean __clocks_world_row___lambda16__gbinding_transform_func (GBinding* binding,
                                                                 GValue* from_value,
                                                                 GValue* to_value,
                                                                 gpointer self);
static void clocks_world_row_finalize (GObject * obj);
static GType clocks_world_row_get_type_once (void);
static void _vala_clocks_world_row_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec);
static void _vala_clocks_world_row_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

VALA_EXTERN const gchar* CLOCKS_WORLD_STATE_CLASSES[6];

static inline gpointer
clocks_world_row_get_instance_private (ClocksWorldRow* self)
{
	return G_STRUCT_MEMBER_P (self, ClocksWorldRow_private_offset);
}

ClocksWorldRow*
clocks_world_row_construct (GType object_type,
                            ClocksWorldItem* location)
{
	ClocksWorldRow * self = NULL;
	g_return_val_if_fail (location != NULL, NULL);
	self = (ClocksWorldRow*) g_object_new (object_type, "location", location, NULL);
	return self;
}

ClocksWorldRow*
clocks_world_row_new (ClocksWorldItem* location)
{
	return clocks_world_row_construct (CLOCKS_WORLD_TYPE_ROW, location);
}

static void
clocks_world_row_delete (ClocksWorldRow* self)
{
	g_return_if_fail (self != NULL);
	g_signal_emit (self, clocks_world_row_signals[CLOCKS_WORLD_ROW_REMOVE_CLOCK_SIGNAL], 0);
}

static void
_clocks_world_row_delete_gtk_button_clicked (GtkButton* _sender,
                                             gpointer self)
{
	clocks_world_row_delete ((ClocksWorldRow*) self);
}

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

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

void
clocks_world_row_set_location (ClocksWorldRow* self,
                               ClocksWorldItem* value)
{
	ClocksWorldItem* old_value;
	g_return_if_fail (self != NULL);
	old_value = clocks_world_row_get_location (self);
	if (old_value != value) {
		ClocksWorldItem* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_location);
		self->priv->_location = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, clocks_world_row_properties[CLOCKS_WORLD_ROW_LOCATION_PROPERTY]);
	}
}

static gboolean
_clocks_world_row___lambda14_ (ClocksWorldRow* self,
                               GBinding* binding,
                               GValue* src,
                               GValue* target)
{
	gchar* day_label = NULL;
	GValue _tmp0_;
	gchar* _tmp1_;
	gchar* message = NULL;
	ClocksWorldItem* _tmp2_;
	GTimeSpan _tmp3_;
	GTimeSpan _tmp4_;
	gchar* _tmp5_;
	gchar* subtitle = NULL;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gboolean _tmp8_ = FALSE;
	const gchar* _tmp9_;
	const gchar* _tmp18_;
	gboolean result;
	g_return_val_if_fail (binding != NULL, FALSE);
	g_return_val_if_fail (src != NULL, FALSE);
	g_return_val_if_fail (target != NULL, FALSE);
	_tmp0_ = *src;
	_tmp1_ = g_strdup (g_value_get_string (&_tmp0_));
	day_label = _tmp1_;
	_tmp2_ = self->priv->_location;
	_tmp3_ = clocks_world_item_get_local_offset (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = clocks_utils_get_time_difference_message ((gdouble) _tmp4_);
	message = _tmp5_;
	_tmp6_ = message;
	_tmp7_ = g_strdup (_tmp6_);
	subtitle = _tmp7_;
	_tmp9_ = day_label;
	if (_tmp9_ != NULL) {
		const gchar* _tmp10_;
		_tmp10_ = day_label;
		_tmp8_ = g_strcmp0 (_tmp10_, "") != 0;
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		gchar* _tmp13_;
		_tmp11_ = day_label;
		_tmp12_ = message;
		_tmp13_ = g_strdup_printf ("%s • %s", (const gchar*) _tmp11_, _tmp12_);
		_g_free0 (subtitle);
		subtitle = _tmp13_;
	} else {
		ClocksWorldItem* _tmp14_;
		gboolean _tmp15_;
		gboolean _tmp16_;
		_tmp14_ = self->priv->_location;
		_tmp15_ = clocks_world_item_get_automatic (_tmp14_);
		_tmp16_ = _tmp15_;
		if (_tmp16_) {
			gchar* _tmp17_;
			_tmp17_ = g_strdup (_ ("Current location"));
			_g_free0 (subtitle);
			subtitle = _tmp17_;
		}
	}
	_tmp18_ = subtitle;
	g_value_set_string (target, _tmp18_);
	result = TRUE;
	_g_free0 (subtitle);
	_g_free0 (message);
	_g_free0 (day_label);
	return result;
}

static gboolean
__clocks_world_row___lambda14__gbinding_transform_func (GBinding* binding,
                                                        GValue* from_value,
                                                        GValue* to_value,
                                                        gpointer self)
{
	gboolean result;
	result = _clocks_world_row___lambda14_ ((ClocksWorldRow*) self, binding, from_value, to_value);
	return result;
}

static gboolean
_clocks_world_row___lambda15_ (ClocksWorldRow* self,
                               GBinding* binding,
                               GValue* src,
                               GValue* target)
{
	gboolean is_automatic = FALSE;
	GValue _tmp0_;
	gboolean result;
	g_return_val_if_fail (binding != NULL, FALSE);
	g_return_val_if_fail (src != NULL, FALSE);
	g_return_val_if_fail (target != NULL, FALSE);
	_tmp0_ = *src;
	is_automatic = g_value_get_boolean (&_tmp0_);
	g_value_set_boolean (target, !is_automatic);
	if (is_automatic) {
		GtkWidget* _tmp1_;
		_tmp1_ = self->priv->delete_button;
		gtk_widget_add_css_class (_tmp1_, "hidden");
	} else {
		GtkWidget* _tmp2_;
		_tmp2_ = self->priv->delete_button;
		gtk_widget_remove_css_class (_tmp2_, "hidden");
	}
	result = TRUE;
	return result;
}

static gboolean
__clocks_world_row___lambda15__gbinding_transform_func (GBinding* binding,
                                                        GValue* from_value,
                                                        GValue* to_value,
                                                        gpointer self)
{
	gboolean result;
	result = _clocks_world_row___lambda15_ ((ClocksWorldRow*) self, binding, from_value, to_value);
	return result;
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static void
_vala_gchar_free_function_content_of (gpointer data)
{
	gchar* self;
	self = *((gchar**) data);
	_g_free0_ (self);
}

static gboolean
_vala_string_array_contains (const gchar* * stack,
                             gssize stack_length,
                             const const gchar* needle)
{
	gssize i;
	for (i = 0; i < stack_length; i++) {
		if (g_strcmp0 (stack[i], needle) == 0) {
			return TRUE;
		}
	}
	return FALSE;
}

static gboolean
_clocks_world_row___lambda16_ (ClocksWorldRow* self,
                               GBinding* binding,
                               GValue* src,
                               GValue* target)
{
	gchar** current = NULL;
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gint current_length1;
	gint _current_size_;
	GArray* updated = NULL;
	GArray* _tmp2_;
	ClocksWorldSunState state = 0;
	GValue _tmp3_;
	gchar** _tmp4_;
	gint _tmp4__length1;
	GArray* _tmp10_;
	gchar* _tmp11_;
	GArray* _tmp12_;
	gsize _tmp13_ = 0;
	gpointer* _tmp14_;
	gboolean result;
	g_return_val_if_fail (binding != NULL, FALSE);
	g_return_val_if_fail (src != NULL, FALSE);
	g_return_val_if_fail (target != NULL, FALSE);
	_tmp0_ = gtk_widget_get_css_classes ((GtkWidget*) self);
	_tmp0__length1 = _vala_array_length (_tmp0_);
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	current = _tmp1_;
	current_length1 = _tmp1__length1;
	_current_size_ = current_length1;
	_tmp2_ = g_array_new (TRUE, TRUE, sizeof (gchar*));
	g_array_set_clear_func (_tmp2_, (GDestroyNotify) _vala_gchar_free_function_content_of);
	updated = _tmp2_;
	_tmp3_ = *src;
	state = g_value_get_enum (&_tmp3_);
	_tmp4_ = current;
	_tmp4__length1 = current_length1;
	{
		gchar** css_class_collection = NULL;
		gint css_class_collection_length1 = 0;
		gint _css_class_collection_size_ = 0;
		gint css_class_it = 0;
		css_class_collection = _tmp4_;
		css_class_collection_length1 = _tmp4__length1;
		for (css_class_it = 0; css_class_it < css_class_collection_length1; css_class_it = css_class_it + 1) {
			gchar* _tmp5_;
			gchar* css_class = NULL;
			_tmp5_ = g_strdup (css_class_collection[css_class_it]);
			css_class = _tmp5_;
			{
				const gchar* _tmp6_;
				_tmp6_ = css_class;
				if (!_vala_string_array_contains (CLOCKS_WORLD_STATE_CLASSES, G_N_ELEMENTS (CLOCKS_WORLD_STATE_CLASSES), _tmp6_)) {
					GArray* _tmp7_;
					const gchar* _tmp8_;
					gchar* _tmp9_;
					_tmp7_ = updated;
					_tmp8_ = css_class;
					_tmp9_ = g_strdup (_tmp8_);
					g_array_append_val (_tmp7_, _tmp9_);
				}
				_g_free0 (css_class);
			}
		}
	}
	_tmp10_ = updated;
	_tmp11_ = clocks_world_sun_state_as_css (state);
	g_array_append_val (_tmp10_, _tmp11_);
	_tmp12_ = updated;
	_tmp14_ = g_array_steal (_tmp12_, &_tmp13_);
	g_value_set_boxed (target, _tmp14_);
	result = TRUE;
	_g_array_unref0 (updated);
	current = (_vala_array_free (current, current_length1, (GDestroyNotify) g_free), NULL);
	return result;
}

static gboolean
__clocks_world_row___lambda16__gbinding_transform_func (GBinding* binding,
                                                        GValue* from_value,
                                                        GValue* to_value,
                                                        gpointer self)
{
	gboolean result;
	result = _clocks_world_row___lambda16_ ((ClocksWorldRow*) self, binding, from_value, to_value);
	return result;
}

static GObject *
clocks_world_row_constructor (GType type,
                              guint n_construct_properties,
                              GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ClocksWorldRow * self;
	GBindingGroup* _tmp0_;
	GBindingGroup* _tmp1_;
	GBindingGroup* _tmp2_;
	GtkLabel* _tmp3_;
	GBindingGroup* _tmp4_;
	GtkWidget* _tmp5_;
	GBindingGroup* _tmp6_;
	parent_class = G_OBJECT_CLASS (clocks_world_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_WORLD_TYPE_ROW, ClocksWorldRow);
	_tmp0_ = self->priv->location_binds;
	g_binding_group_bind (_tmp0_, "city-name", (GObject*) self, "title", G_BINDING_SYNC_CREATE);
	_tmp1_ = self->priv->location_binds;
	g_binding_group_bind_with_closures (_tmp1_, "day-label", (GObject*) self, "subtitle", G_BINDING_SYNC_CREATE, (GClosure*) ((__clocks_world_row___lambda14__gbinding_transform_func == NULL) ? NULL : g_cclosure_new ((GCallback) __clocks_world_row___lambda14__gbinding_transform_func, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp2_ = self->priv->location_binds;
	_tmp3_ = self->priv->time_label;
	g_binding_group_bind (_tmp2_, "time-label", (GObject*) _tmp3_, "label", G_BINDING_SYNC_CREATE);
	_tmp4_ = self->priv->location_binds;
	_tmp5_ = self->priv->delete_button;
	g_binding_group_bind_with_closures (_tmp4_, "automatic", (GObject*) _tmp5_, "sensitive", G_BINDING_SYNC_CREATE, (GClosure*) ((__clocks_world_row___lambda15__gbinding_transform_func == NULL) ? NULL : g_cclosure_new ((GCallback) __clocks_world_row___lambda15__gbinding_transform_func, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp6_ = self->priv->location_binds;
	g_binding_group_bind_with_closures (_tmp6_, "sun-state", (GObject*) self, "css-classes", G_BINDING_SYNC_CREATE, (GClosure*) ((__clocks_world_row___lambda16__gbinding_transform_func == NULL) ? NULL : g_cclosure_new ((GCallback) __clocks_world_row___lambda16__gbinding_transform_func, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	return obj;
}

static void
clocks_world_row_class_init (ClocksWorldRowClass * klass,
                             gpointer klass_data)
{
	clocks_world_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ClocksWorldRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_clocks_world_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_clocks_world_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = clocks_world_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = clocks_world_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_WORLD_ROW_LOCATION_PROPERTY, clocks_world_row_properties[CLOCKS_WORLD_ROW_LOCATION_PROPERTY] = g_param_spec_object ("location", "location", "location", CLOCKS_WORLD_TYPE_ITEM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/clocks/ui/world-row.ui");
	clocks_world_row_signals[CLOCKS_WORLD_ROW_REMOVE_CLOCK_SIGNAL] = g_signal_new ("remove-clock", CLOCKS_WORLD_TYPE_ROW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "time_label", FALSE, ClocksWorldRow_private_offset + G_STRUCT_OFFSET (ClocksWorldRowPrivate, time_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "delete_button", FALSE, ClocksWorldRow_private_offset + G_STRUCT_OFFSET (ClocksWorldRowPrivate, delete_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "location_binds", FALSE, ClocksWorldRow_private_offset + G_STRUCT_OFFSET (ClocksWorldRowPrivate, location_binds));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "delete", G_CALLBACK(_clocks_world_row_delete_gtk_button_clicked));
}

static void
clocks_world_row_instance_init (ClocksWorldRow * self,
                                gpointer klass)
{
	self->priv = clocks_world_row_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
clocks_world_row_finalize (GObject * obj)
{
	ClocksWorldRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_WORLD_TYPE_ROW, ClocksWorldRow);
	_g_object_unref0 (self->priv->_location);
	G_OBJECT_CLASS (clocks_world_row_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
clocks_world_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ClocksWorldRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_world_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksWorldRow), 0, (GInstanceInitFunc) clocks_world_row_instance_init, NULL };
	GType clocks_world_row_type_id;
	clocks_world_row_type_id = g_type_register_static (adw_action_row_get_type (), "ClocksWorldRow", &g_define_type_info, 0);
	ClocksWorldRow_private_offset = g_type_add_instance_private (clocks_world_row_type_id, sizeof (ClocksWorldRowPrivate));
	return clocks_world_row_type_id;
}

GType
clocks_world_row_get_type (void)
{
	static gsize clocks_world_row_type_id__once = 0;
	if (g_once_init_enter (&clocks_world_row_type_id__once)) {
		GType clocks_world_row_type_id;
		clocks_world_row_type_id = clocks_world_row_get_type_once ();
		g_once_init_leave (&clocks_world_row_type_id__once, clocks_world_row_type_id);
	}
	return clocks_world_row_type_id__once;
}

static void
_vala_clocks_world_row_get_property (GObject * object,
                                     guint property_id,
                                     GValue * value,
                                     GParamSpec * pspec)
{
	ClocksWorldRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_WORLD_TYPE_ROW, ClocksWorldRow);
	switch (property_id) {
		case CLOCKS_WORLD_ROW_LOCATION_PROPERTY:
		g_value_set_object (value, clocks_world_row_get_location (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_clocks_world_row_set_property (GObject * object,
                                     guint property_id,
                                     const GValue * value,
                                     GParamSpec * pspec)
{
	ClocksWorldRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_WORLD_TYPE_ROW, ClocksWorldRow);
	switch (property_id) {
		case CLOCKS_WORLD_ROW_LOCATION_PROPERTY:
		clocks_world_row_set_location (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize 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,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

