/* alarm-row.c generated by valac 0.56.19, the Vala compiler
 * generated from alarm-row.vala, do not modify */

/*
 * Copyright (C) 2013  Paolo Borelli <pborelli@gnome.org>
 * Copyright (C) 2020  Zander Brown <zbrown@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 <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.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_ALARM_TYPE_ROW (clocks_alarm_row_get_type ())
#define CLOCKS_ALARM_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_ALARM_TYPE_ROW, ClocksAlarmRow))
#define CLOCKS_ALARM_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_ALARM_TYPE_ROW, ClocksAlarmRowClass))
#define CLOCKS_ALARM_IS_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_ALARM_TYPE_ROW))
#define CLOCKS_ALARM_IS_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_ALARM_TYPE_ROW))
#define CLOCKS_ALARM_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_ALARM_TYPE_ROW, ClocksAlarmRowClass))

typedef struct _ClocksAlarmRow ClocksAlarmRow;
typedef struct _ClocksAlarmRowClass ClocksAlarmRowClass;
typedef struct _ClocksAlarmRowPrivate ClocksAlarmRowPrivate;

#define CLOCKS_ALARM_TYPE_ITEM (clocks_alarm_item_get_type ())
#define CLOCKS_ALARM_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItem))
#define CLOCKS_ALARM_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItemClass))
#define CLOCKS_ALARM_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_ALARM_TYPE_ITEM))
#define CLOCKS_ALARM_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_ALARM_TYPE_ITEM))
#define CLOCKS_ALARM_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_ALARM_TYPE_ITEM, ClocksAlarmItemClass))

typedef struct _ClocksAlarmItem ClocksAlarmItem;
typedef struct _ClocksAlarmItemClass ClocksAlarmItemClass;
enum  {
	CLOCKS_ALARM_ROW_0_PROPERTY,
	CLOCKS_ALARM_ROW_ALARM_PROPERTY,
	CLOCKS_ALARM_ROW_NUM_PROPERTIES
};
static GParamSpec* clocks_alarm_row_properties[CLOCKS_ALARM_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))

#define CLOCKS_TYPE_CONTENT_ITEM (clocks_content_item_get_type ())
#define CLOCKS_CONTENT_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TYPE_CONTENT_ITEM, ClocksContentItem))
#define CLOCKS_IS_CONTENT_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TYPE_CONTENT_ITEM))
#define CLOCKS_CONTENT_ITEM_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLOCKS_TYPE_CONTENT_ITEM, ClocksContentItemIface))

typedef struct _ClocksContentItem ClocksContentItem;
typedef struct _ClocksContentItemIface ClocksContentItemIface;
typedef enum  {
	CLOCKS_ALARM_ITEM_STATE_READY,
	CLOCKS_ALARM_ITEM_STATE_RINGING,
	CLOCKS_ALARM_ITEM_STATE_SNOOZING,
	CLOCKS_ALARM_ITEM_STATE_MISSED
} ClocksAlarmItemState;

#define CLOCKS_ALARM_ITEM_TYPE_STATE (clocks_alarm_item_state_get_type ())

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

typedef struct _ClocksUtilsWeekdays ClocksUtilsWeekdays;
typedef struct _ClocksUtilsWeekdaysClass ClocksUtilsWeekdaysClass;
#define _clocks_utils_weekdays_unref0(var) ((var == NULL) ? NULL : (var = (clocks_utils_weekdays_unref (var), NULL)))
enum  {
	CLOCKS_ALARM_ROW_REMOVE_ALARM_SIGNAL,
	CLOCKS_ALARM_ROW_NUM_SIGNALS
};
static guint clocks_alarm_row_signals[CLOCKS_ALARM_ROW_NUM_SIGNALS] = {0};

struct _ClocksAlarmRow {
	GtkListBoxRow parent_instance;
	ClocksAlarmRowPrivate * priv;
};

struct _ClocksAlarmRowClass {
	GtkListBoxRowClass parent_class;
};

struct _ClocksAlarmRowPrivate {
	ClocksAlarmItem* _alarm;
	GtkSwitch* toggle;
	GtkLabel* title;
	GtkRevealer* title_reveal;
	GtkLabel* time;
	GtkLabel* repeats;
	GtkRevealer* repeats_reveal;
	GBindingGroup* alarm_binds;
};

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

static gint ClocksAlarmRow_private_offset;
static gpointer clocks_alarm_row_parent_class = NULL;

VALA_EXTERN GType clocks_alarm_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClocksAlarmRow, g_object_unref)
VALA_EXTERN GType clocks_alarm_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClocksAlarmItem, g_object_unref)
VALA_EXTERN ClocksAlarmRow* clocks_alarm_row_new (ClocksAlarmItem* alarm);
VALA_EXTERN ClocksAlarmRow* clocks_alarm_row_construct (GType object_type,
                                            ClocksAlarmItem* alarm);
static void clocks_alarm_row_update (ClocksAlarmRow* self);
static void _clocks_alarm_row_update_g_object_notify (GObject* _sender,
                                               GParamSpec* pspec,
                                               gpointer self);
VALA_EXTERN ClocksAlarmItem* clocks_alarm_row_get_alarm (ClocksAlarmRow* self);
VALA_EXTERN gboolean clocks_alarm_item_get_active (ClocksAlarmItem* self);
VALA_EXTERN gchar* clocks_alarm_item_get_time_label (ClocksAlarmItem* self);
VALA_EXTERN GType clocks_content_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClocksContentItem, g_object_unref)
VALA_EXTERN const gchar* clocks_content_item_get_name (ClocksContentItem* self);
VALA_EXTERN GType clocks_alarm_item_state_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ClocksAlarmItemState clocks_alarm_item_get_state (ClocksAlarmItem* self);
VALA_EXTERN gchar* clocks_alarm_item_get_ring_time_label (ClocksAlarmItem* self);
static void clocks_alarm_row_delete (ClocksAlarmRow* self);
static void _clocks_alarm_row_delete_gtk_button_clicked (GtkButton* _sender,
                                                  gpointer self);
static void clocks_alarm_row_set_alarm (ClocksAlarmRow* self,
                                 ClocksAlarmItem* value);
static GObject * clocks_alarm_row_constructor (GType type,
                                        guint n_construct_properties,
                                        GObjectConstructParam * construct_properties);
static gboolean _clocks_alarm_row___lambda89_ (ClocksAlarmRow* self,
                                        GBinding* binding,
                                        GValue* src,
                                        GValue* target);
VALA_EXTERN gpointer clocks_utils_weekdays_ref (gpointer instance);
VALA_EXTERN void clocks_utils_weekdays_unref (gpointer instance);
VALA_EXTERN GParamSpec* clocks_utils_param_spec_weekdays (const gchar* name,
                                              const gchar* nick,
                                              const gchar* blurb,
                                              GType object_type,
                                              GParamFlags flags);
VALA_EXTERN void clocks_utils_value_set_weekdays (GValue* value,
                                      gpointer v_object);
VALA_EXTERN void clocks_utils_value_take_weekdays (GValue* value,
                                       gpointer v_object);
VALA_EXTERN gpointer clocks_utils_value_get_weekdays (const GValue* value);
VALA_EXTERN GType clocks_utils_weekdays_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClocksUtilsWeekdays, clocks_utils_weekdays_unref)
VALA_EXTERN gboolean clocks_utils_weekdays_get_empty (ClocksUtilsWeekdays* self);
static gboolean __clocks_alarm_row___lambda89__gbinding_transform_func (GBinding* binding,
                                                                 GValue* from_value,
                                                                 GValue* to_value,
                                                                 gpointer self);
static gboolean _clocks_alarm_row___lambda90_ (ClocksAlarmRow* self,
                                        GBinding* binding,
                                        GValue* src,
                                        GValue* target);
static gboolean __clocks_alarm_row___lambda90__gbinding_transform_func (GBinding* binding,
                                                                 GValue* from_value,
                                                                 GValue* to_value,
                                                                 gpointer self);
static void clocks_alarm_row_finalize (GObject * obj);
static GType clocks_alarm_row_get_type_once (void);
static void _vala_clocks_alarm_row_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec);
static void _vala_clocks_alarm_row_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec);

static inline gpointer
clocks_alarm_row_get_instance_private (ClocksAlarmRow* self)
{
	return G_STRUCT_MEMBER_P (self, ClocksAlarmRow_private_offset);
}

static void
_clocks_alarm_row_update_g_object_notify (GObject* _sender,
                                          GParamSpec* pspec,
                                          gpointer self)
{
	clocks_alarm_row_update ((ClocksAlarmRow*) self);
}

ClocksAlarmRow*
clocks_alarm_row_construct (GType object_type,
                            ClocksAlarmItem* alarm)
{
	ClocksAlarmRow * self = NULL;
	g_return_val_if_fail (alarm != NULL, NULL);
	self = (ClocksAlarmRow*) g_object_new (object_type, "alarm", alarm, NULL);
	g_signal_connect_object ((GObject*) alarm, "notify::name", (GCallback) _clocks_alarm_row_update_g_object_notify, self, 0);
	g_signal_connect_object ((GObject*) alarm, "notify::state", (GCallback) _clocks_alarm_row_update_g_object_notify, self, 0);
	g_signal_connect_object ((GObject*) alarm, "notify::time", (GCallback) _clocks_alarm_row_update_g_object_notify, self, 0);
	g_signal_connect_object ((GObject*) alarm, "notify::ring_time", (GCallback) _clocks_alarm_row_update_g_object_notify, self, 0);
	clocks_alarm_row_update (self);
	return self;
}

ClocksAlarmRow*
clocks_alarm_row_new (ClocksAlarmItem* alarm)
{
	return clocks_alarm_row_construct (CLOCKS_ALARM_TYPE_ROW, alarm);
}

static void
clocks_alarm_row_update (ClocksAlarmRow* self)
{
	ClocksAlarmItem* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GtkLabel* _tmp3_;
	ClocksAlarmItem* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* label = NULL;
	ClocksAlarmItem* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	ClocksAlarmItem* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	ClocksAlarmItem* _tmp15_;
	ClocksAlarmItemState _tmp16_;
	ClocksAlarmItemState _tmp17_;
	ClocksAlarmItem* _tmp34_;
	ClocksAlarmItemState _tmp35_;
	ClocksAlarmItemState _tmp36_;
	GtkLabel* _tmp47_;
	const gchar* _tmp48_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_alarm;
	_tmp1_ = clocks_alarm_item_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		gtk_widget_add_css_class ((GtkWidget*) self, "active");
	} else {
		gtk_widget_remove_css_class ((GtkWidget*) self, "active");
	}
	_tmp3_ = self->priv->time;
	_tmp4_ = self->priv->_alarm;
	_tmp5_ = clocks_alarm_item_get_time_label (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp6_;
	gtk_label_set_label (_tmp3_, _tmp7_);
	_g_free0 (_tmp7_);
	_tmp8_ = self->priv->_alarm;
	_tmp9_ = clocks_content_item_get_name ((ClocksContentItem*) _tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = g_strdup (_tmp10_);
	label = _tmp11_;
	_tmp12_ = self->priv->_alarm;
	_tmp13_ = clocks_content_item_get_name ((ClocksContentItem*) _tmp12_);
	_tmp14_ = _tmp13_;
	if (g_strcmp0 (_tmp14_, _ ("Alarm")) == 0) {
		_g_free0 (label);
		label = NULL;
	}
	_tmp15_ = self->priv->_alarm;
	_tmp16_ = clocks_alarm_item_get_state (_tmp15_);
	_tmp17_ = _tmp16_;
	if (_tmp17_ == CLOCKS_ALARM_ITEM_STATE_SNOOZING) {
		gboolean _tmp18_ = FALSE;
		const gchar* _tmp19_;
		_tmp19_ = label;
		if (_tmp19_ != NULL) {
			const gchar* _tmp20_;
			gint _tmp21_;
			gint _tmp22_;
			_tmp20_ = label;
			_tmp21_ = strlen ((const gchar*) _tmp20_);
			_tmp22_ = _tmp21_;
			_tmp18_ = _tmp22_ > 0;
		} else {
			_tmp18_ = FALSE;
		}
		if (_tmp18_) {
			const gchar* _tmp23_;
			ClocksAlarmItem* _tmp24_;
			gchar* _tmp25_;
			gchar* _tmp26_;
			gchar* _tmp27_;
			gchar* _tmp28_;
			_tmp23_ = label;
			_tmp24_ = self->priv->_alarm;
			_tmp25_ = clocks_alarm_item_get_ring_time_label (_tmp24_);
			_tmp26_ = _tmp25_;
			_tmp27_ = _tmp26_;
			_tmp28_ = g_strdup_printf (_ ("%s: Snoozed until %s"), (const gchar*) _tmp23_, _tmp27_);
			_g_free0 (label);
			label = _tmp28_;
			_g_free0 (_tmp27_);
		} else {
			ClocksAlarmItem* _tmp29_;
			gchar* _tmp30_;
			gchar* _tmp31_;
			gchar* _tmp32_;
			gchar* _tmp33_;
			_tmp29_ = self->priv->_alarm;
			_tmp30_ = clocks_alarm_item_get_ring_time_label (_tmp29_);
			_tmp31_ = _tmp30_;
			_tmp32_ = _tmp31_;
			_tmp33_ = g_strdup_printf (_ ("Snoozed until %s"), _tmp32_);
			_g_free0 (label);
			label = _tmp33_;
			_g_free0 (_tmp32_);
		}
	}
	_tmp34_ = self->priv->_alarm;
	_tmp35_ = clocks_alarm_item_get_state (_tmp34_);
	_tmp36_ = _tmp35_;
	if (_tmp36_ == CLOCKS_ALARM_ITEM_STATE_MISSED) {
		gboolean _tmp37_ = FALSE;
		const gchar* _tmp38_;
		GtkLabel* _tmp45_;
		_tmp38_ = label;
		if (_tmp38_ != NULL) {
			const gchar* _tmp39_;
			gint _tmp40_;
			gint _tmp41_;
			_tmp39_ = label;
			_tmp40_ = strlen ((const gchar*) _tmp39_);
			_tmp41_ = _tmp40_;
			_tmp37_ = _tmp41_ > 0;
		} else {
			_tmp37_ = FALSE;
		}
		if (_tmp37_) {
			const gchar* _tmp42_;
			gchar* _tmp43_;
			_tmp42_ = label;
			_tmp43_ = g_strdup_printf (_ ("Alarm %s was missed"), (const gchar*) _tmp42_);
			_g_free0 (label);
			label = _tmp43_;
		} else {
			gchar* _tmp44_;
			_tmp44_ = g_strdup (_ ("Alarm was missed"));
			_g_free0 (label);
			label = _tmp44_;
		}
		_tmp45_ = self->priv->title;
		gtk_widget_add_css_class ((GtkWidget*) _tmp45_, "error");
	} else {
		GtkLabel* _tmp46_;
		_tmp46_ = self->priv->title;
		gtk_widget_remove_css_class ((GtkWidget*) _tmp46_, "error");
	}
	_tmp47_ = self->priv->title;
	_tmp48_ = label;
	gtk_label_set_label (_tmp47_, (const gchar*) _tmp48_);
	_g_free0 (label);
}

static void
clocks_alarm_row_delete (ClocksAlarmRow* self)
{
	g_return_if_fail (self != NULL);
	g_signal_emit (self, clocks_alarm_row_signals[CLOCKS_ALARM_ROW_REMOVE_ALARM_SIGNAL], 0);
}

static void
_clocks_alarm_row_delete_gtk_button_clicked (GtkButton* _sender,
                                             gpointer self)
{
	clocks_alarm_row_delete ((ClocksAlarmRow*) self);
}

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

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

static void
clocks_alarm_row_set_alarm (ClocksAlarmRow* self,
                            ClocksAlarmItem* value)
{
	ClocksAlarmItem* old_value;
	g_return_if_fail (self != NULL);
	old_value = clocks_alarm_row_get_alarm (self);
	if (old_value != value) {
		ClocksAlarmItem* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_alarm);
		self->priv->_alarm = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, clocks_alarm_row_properties[CLOCKS_ALARM_ROW_ALARM_PROPERTY]);
	}
}

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

static gboolean
_clocks_alarm_row___lambda89_ (ClocksAlarmRow* self,
                               GBinding* binding,
                               GValue* src,
                               GValue* target)
{
	ClocksUtilsWeekdays* days = NULL;
	GValue _tmp0_;
	ClocksUtilsWeekdays* _tmp1_;
	ClocksUtilsWeekdays* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	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_ = _clocks_utils_weekdays_ref0 (clocks_utils_value_get_weekdays (&_tmp0_));
	days = _tmp1_;
	_tmp2_ = days;
	_tmp3_ = clocks_utils_weekdays_get_empty (_tmp2_);
	_tmp4_ = _tmp3_;
	g_value_set_boolean (target, !_tmp4_);
	result = TRUE;
	_clocks_utils_weekdays_unref0 (days);
	return result;
}

static gboolean
__clocks_alarm_row___lambda89__gbinding_transform_func (GBinding* binding,
                                                        GValue* from_value,
                                                        GValue* to_value,
                                                        gpointer self)
{
	gboolean result;
	result = _clocks_alarm_row___lambda89_ ((ClocksAlarmRow*) self, binding, from_value, to_value);
	return result;
}

static gboolean
_clocks_alarm_row___lambda90_ (ClocksAlarmRow* self,
                               GBinding* binding,
                               GValue* src,
                               GValue* target)
{
	gchar* label = NULL;
	GValue _tmp0_;
	gchar* _tmp1_;
	gboolean _tmp2_ = FALSE;
	const gchar* _tmp3_;
	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_));
	label = _tmp1_;
	_tmp3_ = label;
	if (_tmp3_ != NULL) {
		const gchar* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		_tmp4_ = label;
		_tmp5_ = strlen ((const gchar*) _tmp4_);
		_tmp6_ = _tmp5_;
		_tmp2_ = _tmp6_ > 0;
	} else {
		_tmp2_ = FALSE;
	}
	g_value_set_boolean (target, _tmp2_);
	result = TRUE;
	_g_free0 (label);
	return result;
}

static gboolean
__clocks_alarm_row___lambda90__gbinding_transform_func (GBinding* binding,
                                                        GValue* from_value,
                                                        GValue* to_value,
                                                        gpointer self)
{
	gboolean result;
	result = _clocks_alarm_row___lambda90_ ((ClocksAlarmRow*) self, binding, from_value, to_value);
	return result;
}

static GObject *
clocks_alarm_row_constructor (GType type,
                              guint n_construct_properties,
                              GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ClocksAlarmRow * self;
	GBindingGroup* _tmp0_;
	GtkSwitch* _tmp1_;
	GBindingGroup* _tmp2_;
	GtkLabel* _tmp3_;
	GBindingGroup* _tmp4_;
	GtkRevealer* _tmp5_;
	GtkLabel* _tmp6_;
	GtkRevealer* _tmp7_;
	parent_class = G_OBJECT_CLASS (clocks_alarm_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_ALARM_TYPE_ROW, ClocksAlarmRow);
	_tmp0_ = self->priv->alarm_binds;
	_tmp1_ = self->priv->toggle;
	g_binding_group_bind (_tmp0_, "active", (GObject*) _tmp1_, "active", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
	_tmp2_ = self->priv->alarm_binds;
	_tmp3_ = self->priv->repeats;
	g_binding_group_bind (_tmp2_, "days-label", (GObject*) _tmp3_, "label", G_BINDING_SYNC_CREATE);
	_tmp4_ = self->priv->alarm_binds;
	_tmp5_ = self->priv->repeats_reveal;
	g_binding_group_bind_with_closures (_tmp4_, "days", (GObject*) _tmp5_, "reveal-child", G_BINDING_SYNC_CREATE, (GClosure*) ((__clocks_alarm_row___lambda89__gbinding_transform_func == NULL) ? NULL : g_cclosure_new ((GCallback) __clocks_alarm_row___lambda89__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->title;
	_tmp7_ = self->priv->title_reveal;
	g_object_bind_property_with_closures ((GObject*) _tmp6_, "label", (GObject*) _tmp7_, "reveal-child", G_BINDING_SYNC_CREATE, (GClosure*) ((__clocks_alarm_row___lambda90__gbinding_transform_func == NULL) ? NULL : g_cclosure_new ((GCallback) __clocks_alarm_row___lambda90__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_alarm_row_class_init (ClocksAlarmRowClass * klass,
                             gpointer klass_data)
{
	clocks_alarm_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ClocksAlarmRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_clocks_alarm_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_clocks_alarm_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = clocks_alarm_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = clocks_alarm_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_ALARM_ROW_ALARM_PROPERTY, clocks_alarm_row_properties[CLOCKS_ALARM_ROW_ALARM_PROPERTY] = g_param_spec_object ("alarm", "alarm", "alarm", CLOCKS_ALARM_TYPE_ITEM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/clocks/ui/alarm-row.ui");
	clocks_alarm_row_signals[CLOCKS_ALARM_ROW_REMOVE_ALARM_SIGNAL] = g_signal_new ("remove-alarm", CLOCKS_ALARM_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), "toggle", FALSE, ClocksAlarmRow_private_offset + G_STRUCT_OFFSET (ClocksAlarmRowPrivate, toggle));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "title", FALSE, ClocksAlarmRow_private_offset + G_STRUCT_OFFSET (ClocksAlarmRowPrivate, title));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "title_reveal", FALSE, ClocksAlarmRow_private_offset + G_STRUCT_OFFSET (ClocksAlarmRowPrivate, title_reveal));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "time", FALSE, ClocksAlarmRow_private_offset + G_STRUCT_OFFSET (ClocksAlarmRowPrivate, time));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "repeats", FALSE, ClocksAlarmRow_private_offset + G_STRUCT_OFFSET (ClocksAlarmRowPrivate, repeats));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "repeats_reveal", FALSE, ClocksAlarmRow_private_offset + G_STRUCT_OFFSET (ClocksAlarmRowPrivate, repeats_reveal));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "alarm_binds", FALSE, ClocksAlarmRow_private_offset + G_STRUCT_OFFSET (ClocksAlarmRowPrivate, alarm_binds));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "delete", G_CALLBACK(_clocks_alarm_row_delete_gtk_button_clicked));
}

static void
clocks_alarm_row_instance_init (ClocksAlarmRow * self,
                                gpointer klass)
{
	self->priv = clocks_alarm_row_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
clocks_alarm_row_finalize (GObject * obj)
{
	ClocksAlarmRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_ALARM_TYPE_ROW, ClocksAlarmRow);
	_g_object_unref0 (self->priv->_alarm);
	G_OBJECT_CLASS (clocks_alarm_row_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
clocks_alarm_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ClocksAlarmRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_alarm_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksAlarmRow), 0, (GInstanceInitFunc) clocks_alarm_row_instance_init, NULL };
	GType clocks_alarm_row_type_id;
	clocks_alarm_row_type_id = g_type_register_static (gtk_list_box_row_get_type (), "ClocksAlarmRow", &g_define_type_info, 0);
	ClocksAlarmRow_private_offset = g_type_add_instance_private (clocks_alarm_row_type_id, sizeof (ClocksAlarmRowPrivate));
	return clocks_alarm_row_type_id;
}

GType
clocks_alarm_row_get_type (void)
{
	static gsize clocks_alarm_row_type_id__once = 0;
	if (g_once_init_enter (&clocks_alarm_row_type_id__once)) {
		GType clocks_alarm_row_type_id;
		clocks_alarm_row_type_id = clocks_alarm_row_get_type_once ();
		g_once_init_leave (&clocks_alarm_row_type_id__once, clocks_alarm_row_type_id);
	}
	return clocks_alarm_row_type_id__once;
}

static void
_vala_clocks_alarm_row_get_property (GObject * object,
                                     guint property_id,
                                     GValue * value,
                                     GParamSpec * pspec)
{
	ClocksAlarmRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_ALARM_TYPE_ROW, ClocksAlarmRow);
	switch (property_id) {
		case CLOCKS_ALARM_ROW_ALARM_PROPERTY:
		g_value_set_object (value, clocks_alarm_row_get_alarm (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_clocks_alarm_row_set_property (GObject * object,
                                     guint property_id,
                                     const GValue * value,
                                     GParamSpec * pspec)
{
	ClocksAlarmRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_ALARM_TYPE_ROW, ClocksAlarmRow);
	switch (property_id) {
		case CLOCKS_ALARM_ROW_ALARM_PROPERTY:
		clocks_alarm_row_set_alarm (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

