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

/*
 * Copyright (C) 2013  Paolo Borelli <pborelli@gnome.org>
 * Copyright (C) 2020  Bilal Elmoussaoui <bilal.elmoussaoui@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 <adwaita.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.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_TIMER_TYPE_ROW (clocks_timer_row_get_type ())
#define CLOCKS_TIMER_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TIMER_TYPE_ROW, ClocksTimerRow))
#define CLOCKS_TIMER_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_TIMER_TYPE_ROW, ClocksTimerRowClass))
#define CLOCKS_TIMER_IS_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TIMER_TYPE_ROW))
#define CLOCKS_TIMER_IS_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_TIMER_TYPE_ROW))
#define CLOCKS_TIMER_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_TIMER_TYPE_ROW, ClocksTimerRowClass))

typedef struct _ClocksTimerRow ClocksTimerRow;
typedef struct _ClocksTimerRowClass ClocksTimerRowClass;
typedef struct _ClocksTimerRowPrivate ClocksTimerRowPrivate;

#define CLOCKS_TIMER_TYPE_ITEM (clocks_timer_item_get_type ())
#define CLOCKS_TIMER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLOCKS_TIMER_TYPE_ITEM, ClocksTimerItem))
#define CLOCKS_TIMER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLOCKS_TIMER_TYPE_ITEM, ClocksTimerItemClass))
#define CLOCKS_TIMER_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLOCKS_TIMER_TYPE_ITEM))
#define CLOCKS_TIMER_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLOCKS_TIMER_TYPE_ITEM))
#define CLOCKS_TIMER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLOCKS_TIMER_TYPE_ITEM, ClocksTimerItemClass))

typedef struct _ClocksTimerItem ClocksTimerItem;
typedef struct _ClocksTimerItemClass ClocksTimerItemClass;
enum  {
	CLOCKS_TIMER_ROW_0_PROPERTY,
	CLOCKS_TIMER_ROW_ITEM_PROPERTY,
	CLOCKS_TIMER_ROW_NUM_PROPERTIES
};
static GParamSpec* clocks_timer_row_properties[CLOCKS_TIMER_ROW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef enum  {
	CLOCKS_TIMER_ITEM_STATE_STOPPED,
	CLOCKS_TIMER_ITEM_STATE_RUNNING,
	CLOCKS_TIMER_ITEM_STATE_PAUSED
} ClocksTimerItemState;

#define CLOCKS_TIMER_ITEM_TYPE_STATE (clocks_timer_item_state_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	CLOCKS_TIMER_ROW_DELETED_SIGNAL,
	CLOCKS_TIMER_ROW_NUM_SIGNALS
};
static guint clocks_timer_row_signals[CLOCKS_TIMER_ROW_NUM_SIGNALS] = {0};

struct _ClocksTimerRow {
	GtkListBoxRow parent_instance;
	ClocksTimerRowPrivate * priv;
};

struct _ClocksTimerRowClass {
	GtkListBoxRowClass parent_class;
};

struct _ClocksTimerRowPrivate {
	ClocksTimerItem* _item;
	GBinding* name_binding;
	GBinding* entry_binding;
	AdwTimedAnimation* paused_animation;
	GtkLabel* countdown_label;
	GtkLabel* timer_name;
	GtkStack* name_stack;
	GtkRevealer* name_revealer;
	GtkStack* start_stack;
	GtkStack* reset_stack;
	GtkStack* delete_stack;
	GtkButton* delete_button;
	GtkEntry* title;
};

static gint ClocksTimerRow_private_offset;
static gpointer clocks_timer_row_parent_class = NULL;

VALA_EXTERN GType clocks_timer_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClocksTimerRow, g_object_unref)
VALA_EXTERN GType clocks_timer_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClocksTimerItem, g_object_unref)
VALA_EXTERN ClocksTimerRow* clocks_timer_row_new (ClocksTimerItem* item);
VALA_EXTERN ClocksTimerRow* clocks_timer_row_construct (GType object_type,
                                            ClocksTimerItem* item);
static void clocks_timer_row_on_start_button_clicked (ClocksTimerRow* self);
VALA_EXTERN ClocksTimerItem* clocks_timer_row_get_item (ClocksTimerRow* self);
VALA_EXTERN GType clocks_timer_item_state_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void clocks_timer_item_set_state (ClocksTimerItem* self,
                                  ClocksTimerItemState value);
static void _clocks_timer_row_on_start_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                   gpointer self);
static void clocks_timer_row_on_pause_button_clicked (ClocksTimerRow* self);
static void _clocks_timer_row_on_pause_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                   gpointer self);
static void clocks_timer_row_on_reset_button_clicked (ClocksTimerRow* self);
static void _clocks_timer_row_on_reset_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                   gpointer self);
static void clocks_timer_row_update_state (ClocksTimerRow* self);
VALA_EXTERN ClocksTimerItemState clocks_timer_item_get_state (ClocksTimerItem* self);
static void clocks_timer_row_update_countdown (ClocksTimerRow* self,
                                        gint h,
                                        gint m,
                                        gint s);
VALA_EXTERN gint clocks_timer_item_get_stored_hour (ClocksTimerItem* self);
VALA_EXTERN gint clocks_timer_item_get_stored_minute (ClocksTimerItem* self);
VALA_EXTERN gint clocks_timer_item_get_stored_second (ClocksTimerItem* self);
static void clocks_timer_row_animation_target (ClocksTimerRow* self,
                                        gdouble val);
static void clocks_timer_row_set_item (ClocksTimerRow* self,
                                ClocksTimerItem* value);
static void _clocks_timer_row_update_countdown_clocks_timer_item_countdown_updated (ClocksTimerItem* _sender,
                                                                             gint hours,
                                                                             gint minutes,
                                                                             gint seconds,
                                                                             gpointer self);
static void _clocks_timer_row_update_state_g_object_notify (GObject* _sender,
                                                     GParamSpec* pspec,
                                                     gpointer self);
static GObject * clocks_timer_row_constructor (GType type,
                                        guint n_construct_properties,
                                        GObjectConstructParam * construct_properties);
static void _clocks_timer_row___lambda53_ (ClocksTimerRow* self);
static void __clocks_timer_row___lambda53__gtk_button_clicked (GtkButton* _sender,
                                                        gpointer self);
static void _clocks_timer_row_animation_target_adw_animation_target_func (gdouble value,
                                                                   gpointer self);
static void clocks_timer_row_finalize (GObject * obj);
static GType clocks_timer_row_get_type_once (void);
static void _vala_clocks_timer_row_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec);
static void _vala_clocks_timer_row_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec);

static inline gpointer
clocks_timer_row_get_instance_private (ClocksTimerRow* self)
{
	return G_STRUCT_MEMBER_P (self, ClocksTimerRow_private_offset);
}

ClocksTimerRow*
clocks_timer_row_construct (GType object_type,
                            ClocksTimerItem* item)
{
	ClocksTimerRow * self = NULL;
	g_return_val_if_fail (item != NULL, NULL);
	self = (ClocksTimerRow*) g_object_new (object_type, "item", item, NULL);
	return self;
}

ClocksTimerRow*
clocks_timer_row_new (ClocksTimerItem* item)
{
	return clocks_timer_row_construct (CLOCKS_TIMER_TYPE_ROW, item);
}

static void
clocks_timer_row_on_start_button_clicked (ClocksTimerRow* self)
{
	ClocksTimerItem* _tmp0_;
	ClocksTimerItem* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = clocks_timer_row_get_item (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		ClocksTimerItem* _tmp2_;
		ClocksTimerItem* _tmp3_;
		_tmp2_ = clocks_timer_row_get_item (self);
		_tmp3_ = _tmp2_;
		clocks_timer_item_set_state (_tmp3_, CLOCKS_TIMER_ITEM_STATE_RUNNING);
	}
}

static void
_clocks_timer_row_on_start_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                              gpointer self)
{
	clocks_timer_row_on_start_button_clicked ((ClocksTimerRow*) self);
}

static void
clocks_timer_row_on_pause_button_clicked (ClocksTimerRow* self)
{
	ClocksTimerItem* _tmp0_;
	ClocksTimerItem* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = clocks_timer_row_get_item (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		ClocksTimerItem* _tmp2_;
		ClocksTimerItem* _tmp3_;
		_tmp2_ = clocks_timer_row_get_item (self);
		_tmp3_ = _tmp2_;
		clocks_timer_item_set_state (_tmp3_, CLOCKS_TIMER_ITEM_STATE_PAUSED);
	}
}

static void
_clocks_timer_row_on_pause_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                              gpointer self)
{
	clocks_timer_row_on_pause_button_clicked ((ClocksTimerRow*) self);
}

static void
clocks_timer_row_on_reset_button_clicked (ClocksTimerRow* self)
{
	ClocksTimerItem* _tmp0_;
	ClocksTimerItem* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = clocks_timer_row_get_item (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		ClocksTimerItem* _tmp2_;
		ClocksTimerItem* _tmp3_;
		_tmp2_ = clocks_timer_row_get_item (self);
		_tmp3_ = _tmp2_;
		clocks_timer_item_set_state (_tmp3_, CLOCKS_TIMER_ITEM_STATE_STOPPED);
	}
}

static void
_clocks_timer_row_on_reset_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                              gpointer self)
{
	clocks_timer_row_on_reset_button_clicked ((ClocksTimerRow*) self);
}

static void
clocks_timer_row_update_state (ClocksTimerRow* self)
{
	gboolean _tmp0_ = FALSE;
	ClocksTimerItem* _tmp1_;
	ClocksTimerItem* _tmp2_;
	AdwTimedAnimation* _tmp40_;
	ClocksTimerItem* _tmp50_;
	ClocksTimerItem* _tmp51_;
	g_return_if_fail (self != NULL);
	_tmp1_ = clocks_timer_row_get_item (self);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		ClocksTimerItem* _tmp3_;
		ClocksTimerItem* _tmp4_;
		ClocksTimerItemState _tmp5_;
		ClocksTimerItemState _tmp6_;
		_tmp3_ = clocks_timer_row_get_item (self);
		_tmp4_ = _tmp3_;
		_tmp5_ = clocks_timer_item_get_state (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp0_ = _tmp6_ == CLOCKS_TIMER_ITEM_STATE_STOPPED;
	}
	if (_tmp0_) {
		GtkStack* _tmp7_;
		GtkRevealer* _tmp8_;
		GtkStack* _tmp9_;
		GtkStack* _tmp10_;
		GtkStack* _tmp11_;
		GtkLabel* _tmp12_;
		GtkLabel* _tmp13_;
		_tmp7_ = self->priv->delete_stack;
		gtk_stack_set_visible_child_name (_tmp7_, "button");
		_tmp8_ = self->priv->name_revealer;
		gtk_revealer_set_reveal_child (_tmp8_, TRUE);
		_tmp9_ = self->priv->name_stack;
		gtk_stack_set_visible_child_name (_tmp9_, "edit");
		_tmp10_ = self->priv->reset_stack;
		gtk_stack_set_visible_child_name (_tmp10_, "empty");
		_tmp11_ = self->priv->start_stack;
		gtk_stack_set_visible_child_name (_tmp11_, "start");
		_tmp12_ = self->priv->countdown_label;
		gtk_widget_add_css_class ((GtkWidget*) _tmp12_, "dimmed");
		_tmp13_ = self->priv->countdown_label;
		gtk_widget_remove_css_class ((GtkWidget*) _tmp13_, "accent");
	} else {
		ClocksTimerItem* _tmp14_;
		ClocksTimerItem* _tmp15_;
		ClocksTimerItemState _tmp16_;
		ClocksTimerItemState _tmp17_;
		_tmp14_ = clocks_timer_row_get_item (self);
		_tmp15_ = _tmp14_;
		_tmp16_ = clocks_timer_item_get_state (_tmp15_);
		_tmp17_ = _tmp16_;
		if (_tmp17_ == CLOCKS_TIMER_ITEM_STATE_PAUSED) {
			GtkStack* _tmp18_;
			GtkRevealer* _tmp19_;
			GtkLabel* _tmp20_;
			const gchar* _tmp21_;
			const gchar* _tmp22_;
			GtkStack* _tmp23_;
			GtkStack* _tmp24_;
			GtkStack* _tmp25_;
			_tmp18_ = self->priv->delete_stack;
			gtk_stack_set_visible_child_name (_tmp18_, "button");
			_tmp19_ = self->priv->name_revealer;
			_tmp20_ = self->priv->timer_name;
			_tmp21_ = gtk_label_get_label (_tmp20_);
			_tmp22_ = _tmp21_;
			gtk_revealer_set_reveal_child (_tmp19_, g_strcmp0 (_tmp22_, "") != 0);
			_tmp23_ = self->priv->name_stack;
			gtk_stack_set_visible_child_name (_tmp23_, "display");
			_tmp24_ = self->priv->reset_stack;
			gtk_stack_set_visible_child_name (_tmp24_, "button");
			_tmp25_ = self->priv->start_stack;
			gtk_stack_set_visible_child_name (_tmp25_, "start");
		} else {
			ClocksTimerItem* _tmp26_;
			ClocksTimerItem* _tmp27_;
			ClocksTimerItemState _tmp28_;
			ClocksTimerItemState _tmp29_;
			_tmp26_ = clocks_timer_row_get_item (self);
			_tmp27_ = _tmp26_;
			_tmp28_ = clocks_timer_item_get_state (_tmp27_);
			_tmp29_ = _tmp28_;
			if (_tmp29_ == CLOCKS_TIMER_ITEM_STATE_RUNNING) {
				GtkStack* _tmp30_;
				GtkRevealer* _tmp31_;
				GtkLabel* _tmp32_;
				const gchar* _tmp33_;
				const gchar* _tmp34_;
				GtkStack* _tmp35_;
				GtkStack* _tmp36_;
				GtkStack* _tmp37_;
				GtkLabel* _tmp38_;
				GtkLabel* _tmp39_;
				_tmp30_ = self->priv->delete_stack;
				gtk_stack_set_visible_child_name (_tmp30_, "empty");
				_tmp31_ = self->priv->name_revealer;
				_tmp32_ = self->priv->timer_name;
				_tmp33_ = gtk_label_get_label (_tmp32_);
				_tmp34_ = _tmp33_;
				gtk_revealer_set_reveal_child (_tmp31_, g_strcmp0 (_tmp34_, "") != 0);
				_tmp35_ = self->priv->name_stack;
				gtk_stack_set_visible_child_name (_tmp35_, "display");
				_tmp36_ = self->priv->reset_stack;
				gtk_stack_set_visible_child_name (_tmp36_, "empty");
				_tmp37_ = self->priv->start_stack;
				gtk_stack_set_visible_child_name (_tmp37_, "pause");
				_tmp38_ = self->priv->countdown_label;
				gtk_widget_add_css_class ((GtkWidget*) _tmp38_, "accent");
				_tmp39_ = self->priv->countdown_label;
				gtk_widget_remove_css_class ((GtkWidget*) _tmp39_, "dimmed");
			}
		}
	}
	_tmp40_ = self->priv->paused_animation;
	if (_tmp40_ != NULL) {
		gboolean _tmp41_ = FALSE;
		ClocksTimerItem* _tmp42_;
		ClocksTimerItem* _tmp43_;
		_tmp42_ = clocks_timer_row_get_item (self);
		_tmp43_ = _tmp42_;
		if (_tmp43_ != NULL) {
			ClocksTimerItem* _tmp44_;
			ClocksTimerItem* _tmp45_;
			ClocksTimerItemState _tmp46_;
			ClocksTimerItemState _tmp47_;
			_tmp44_ = clocks_timer_row_get_item (self);
			_tmp45_ = _tmp44_;
			_tmp46_ = clocks_timer_item_get_state (_tmp45_);
			_tmp47_ = _tmp46_;
			_tmp41_ = _tmp47_ == CLOCKS_TIMER_ITEM_STATE_PAUSED;
		} else {
			_tmp41_ = FALSE;
		}
		if (_tmp41_) {
			AdwTimedAnimation* _tmp48_;
			_tmp48_ = self->priv->paused_animation;
			adw_animation_play ((AdwAnimation*) _tmp48_);
		} else {
			AdwTimedAnimation* _tmp49_;
			_tmp49_ = self->priv->paused_animation;
			adw_animation_pause ((AdwAnimation*) _tmp49_);
		}
	}
	_tmp50_ = clocks_timer_row_get_item (self);
	_tmp51_ = _tmp50_;
	if (_tmp51_ != NULL) {
		ClocksTimerItem* _tmp52_;
		ClocksTimerItem* _tmp53_;
		ClocksTimerItem* _tmp54_;
		ClocksTimerItem* _tmp55_;
		ClocksTimerItem* _tmp56_;
		ClocksTimerItem* _tmp57_;
		_tmp52_ = clocks_timer_row_get_item (self);
		_tmp53_ = _tmp52_;
		_tmp54_ = clocks_timer_row_get_item (self);
		_tmp55_ = _tmp54_;
		_tmp56_ = clocks_timer_row_get_item (self);
		_tmp57_ = _tmp56_;
		clocks_timer_row_update_countdown (self, clocks_timer_item_get_stored_hour (_tmp53_), clocks_timer_item_get_stored_minute (_tmp55_), clocks_timer_item_get_stored_second (_tmp57_));
	} else {
		clocks_timer_row_update_countdown (self, 0, 0, 0);
	}
}

static void
clocks_timer_row_update_countdown (ClocksTimerRow* self,
                                   gint h,
                                   gint m,
                                   gint s)
{
	GtkLabel* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->countdown_label;
	_tmp1_ = g_strdup_printf ("%02i ∶ %02i ∶ %02i", h, m, s);
	_tmp2_ = _tmp1_;
	gtk_label_set_text (_tmp0_, _tmp2_);
	_g_free0 (_tmp2_);
}

static void
clocks_timer_row_animation_target (ClocksTimerRow* self,
                                   gdouble val)
{
	g_return_if_fail (self != NULL);
	if (val < 1.0) {
		GtkLabel* _tmp0_;
		GtkLabel* _tmp1_;
		_tmp0_ = self->priv->countdown_label;
		gtk_widget_add_css_class ((GtkWidget*) _tmp0_, "dimmed");
		_tmp1_ = self->priv->countdown_label;
		gtk_widget_remove_css_class ((GtkWidget*) _tmp1_, "accent");
	} else {
		GtkLabel* _tmp2_;
		GtkLabel* _tmp3_;
		_tmp2_ = self->priv->countdown_label;
		gtk_widget_add_css_class ((GtkWidget*) _tmp2_, "accent");
		_tmp3_ = self->priv->countdown_label;
		gtk_widget_remove_css_class ((GtkWidget*) _tmp3_, "dimmed");
	}
}

ClocksTimerItem*
clocks_timer_row_get_item (ClocksTimerRow* self)
{
	ClocksTimerItem* result;
	ClocksTimerItem* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_item;
	result = _tmp0_;
	return result;
}

static void
_clocks_timer_row_update_countdown_clocks_timer_item_countdown_updated (ClocksTimerItem* _sender,
                                                                        gint hours,
                                                                        gint minutes,
                                                                        gint seconds,
                                                                        gpointer self)
{
	clocks_timer_row_update_countdown ((ClocksTimerRow*) self, hours, minutes, seconds);
}

static void
_clocks_timer_row_update_state_g_object_notify (GObject* _sender,
                                                GParamSpec* pspec,
                                                gpointer self)
{
	clocks_timer_row_update_state ((ClocksTimerRow*) self);
}

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

static void
clocks_timer_row_set_item (ClocksTimerRow* self,
                           ClocksTimerItem* value)
{
	ClocksTimerItem* _tmp0_;
	ClocksTimerItem* _tmp1_;
	ClocksTimerItem* _tmp11_;
	ClocksTimerItem* _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_item;
	if (_tmp0_ == value) {
		return;
	}
	_tmp1_ = self->priv->_item;
	if (_tmp1_ != NULL) {
		ClocksTimerItem* _tmp2_;
		guint _tmp3_;
		ClocksTimerItem* _tmp4_;
		guint _tmp5_;
		GQuark _tmp6_;
		GBinding* _tmp7_;
		GBinding* _tmp8_;
		GBinding* _tmp9_;
		GBinding* _tmp10_;
		_tmp2_ = self->priv->_item;
		g_signal_parse_name ("countdown-updated", CLOCKS_TIMER_TYPE_ITEM, &_tmp3_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _clocks_timer_row_update_countdown_clocks_timer_item_countdown_updated, self);
		_tmp4_ = self->priv->_item;
		g_signal_parse_name ("notify::state", G_TYPE_OBJECT, &_tmp5_, &_tmp6_, TRUE);
		g_signal_handlers_disconnect_matched ((GObject*) _tmp4_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, _tmp6_, NULL, (GCallback) _clocks_timer_row_update_state_g_object_notify, self);
		_tmp7_ = self->priv->name_binding;
		_tmp8_ = _g_object_ref0 (_tmp7_);
		g_binding_unbind (_tmp8_);
		_tmp9_ = self->priv->entry_binding;
		_tmp10_ = _g_object_ref0 (_tmp9_);
		g_binding_unbind (_tmp10_);
	}
	_tmp11_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_item);
	self->priv->_item = _tmp11_;
	_tmp12_ = self->priv->_item;
	if (_tmp12_ != NULL) {
		ClocksTimerItem* _tmp13_;
		ClocksTimerItem* _tmp14_;
		ClocksTimerItem* _tmp15_;
		GtkLabel* _tmp16_;
		GBinding* _tmp17_;
		GBinding* _tmp18_;
		ClocksTimerItem* _tmp19_;
		GtkEntry* _tmp20_;
		GBinding* _tmp21_;
		GBinding* _tmp22_;
		_tmp13_ = self->priv->_item;
		g_signal_connect_object (_tmp13_, "countdown-updated", (GCallback) _clocks_timer_row_update_countdown_clocks_timer_item_countdown_updated, self, 0);
		_tmp14_ = self->priv->_item;
		g_signal_connect_object ((GObject*) _tmp14_, "notify::state", (GCallback) _clocks_timer_row_update_state_g_object_notify, self, 0);
		_tmp15_ = self->priv->_item;
		_tmp16_ = self->priv->timer_name;
		_tmp17_ = g_object_bind_property_with_closures ((GObject*) _tmp15_, "name", (GObject*) _tmp16_, "label", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp18_ = _g_object_ref0 (_tmp17_);
		_g_object_unref0 (self->priv->name_binding);
		self->priv->name_binding = _tmp18_;
		_tmp19_ = self->priv->_item;
		_tmp20_ = self->priv->title;
		_tmp21_ = g_object_bind_property_with_closures ((GObject*) _tmp19_, "name", (GObject*) _tmp20_, "text", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp22_ = _g_object_ref0 (_tmp21_);
		_g_object_unref0 (self->priv->entry_binding);
		self->priv->entry_binding = _tmp22_;
	}
	clocks_timer_row_update_state (self);
	g_object_notify_by_pspec ((GObject *) self, clocks_timer_row_properties[CLOCKS_TIMER_ROW_ITEM_PROPERTY]);
}

static void
_clocks_timer_row___lambda53_ (ClocksTimerRow* self)
{
	g_signal_emit (self, clocks_timer_row_signals[CLOCKS_TIMER_ROW_DELETED_SIGNAL], 0);
}

static void
__clocks_timer_row___lambda53__gtk_button_clicked (GtkButton* _sender,
                                                   gpointer self)
{
	_clocks_timer_row___lambda53_ ((ClocksTimerRow*) self);
}

static void
_clocks_timer_row_animation_target_adw_animation_target_func (gdouble value,
                                                              gpointer self)
{
	clocks_timer_row_animation_target ((ClocksTimerRow*) self, value);
}

static GObject *
clocks_timer_row_constructor (GType type,
                              guint n_construct_properties,
                              GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ClocksTimerRow * self;
	GtkLabel* _tmp0_;
	GtkButton* _tmp1_;
	AdwCallbackAnimationTarget* target = NULL;
	AdwCallbackAnimationTarget* _tmp2_;
	AdwCallbackAnimationTarget* _tmp3_;
	AdwAnimationTarget* _tmp4_;
	AdwTimedAnimation* _tmp5_;
	AdwTimedAnimation* _tmp6_;
	AdwTimedAnimation* _tmp7_;
	parent_class = G_OBJECT_CLASS (clocks_timer_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_TIMER_TYPE_ROW, ClocksTimerRow);
	_tmp0_ = self->priv->countdown_label;
	gtk_widget_set_direction ((GtkWidget*) _tmp0_, GTK_TEXT_DIR_LTR);
	_tmp1_ = self->priv->delete_button;
	g_signal_connect_object (_tmp1_, "clicked", (GCallback) __clocks_timer_row___lambda53__gtk_button_clicked, self, 0);
	_tmp2_ = (AdwCallbackAnimationTarget*) adw_callback_animation_target_new (_clocks_timer_row_animation_target_adw_animation_target_func, g_object_ref (self), g_object_unref);
	target = _tmp2_;
	_tmp3_ = target;
	_tmp4_ = _g_object_ref0 ((AdwAnimationTarget*) _tmp3_);
	_tmp5_ = (AdwTimedAnimation*) adw_timed_animation_new ((GtkWidget*) self, (gdouble) 0, (gdouble) 2, (guint) 2000, _tmp4_);
	_g_object_unref0 (self->priv->paused_animation);
	self->priv->paused_animation = _tmp5_;
	_tmp6_ = self->priv->paused_animation;
	adw_timed_animation_set_repeat_count (_tmp6_, ADW_DURATION_INFINITE);
	_tmp7_ = self->priv->paused_animation;
	adw_timed_animation_set_easing (_tmp7_, ADW_LINEAR);
	clocks_timer_row_update_state (self);
	_g_object_unref0 (target);
	return obj;
}

static void
clocks_timer_row_class_init (ClocksTimerRowClass * klass,
                             gpointer klass_data)
{
	clocks_timer_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ClocksTimerRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_clocks_timer_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_clocks_timer_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = clocks_timer_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = clocks_timer_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CLOCKS_TIMER_ROW_ITEM_PROPERTY, clocks_timer_row_properties[CLOCKS_TIMER_ROW_ITEM_PROPERTY] = g_param_spec_object ("item", "item", "item", CLOCKS_TIMER_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/timer-row.ui");
	clocks_timer_row_signals[CLOCKS_TIMER_ROW_DELETED_SIGNAL] = g_signal_new ("deleted", CLOCKS_TIMER_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), "countdown_label", FALSE, ClocksTimerRow_private_offset + G_STRUCT_OFFSET (ClocksTimerRowPrivate, countdown_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "timer_name", FALSE, ClocksTimerRow_private_offset + G_STRUCT_OFFSET (ClocksTimerRowPrivate, timer_name));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "name_stack", FALSE, ClocksTimerRow_private_offset + G_STRUCT_OFFSET (ClocksTimerRowPrivate, name_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "name_revealer", FALSE, ClocksTimerRow_private_offset + G_STRUCT_OFFSET (ClocksTimerRowPrivate, name_revealer));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "start_stack", FALSE, ClocksTimerRow_private_offset + G_STRUCT_OFFSET (ClocksTimerRowPrivate, start_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "reset_stack", FALSE, ClocksTimerRow_private_offset + G_STRUCT_OFFSET (ClocksTimerRowPrivate, reset_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "delete_stack", FALSE, ClocksTimerRow_private_offset + G_STRUCT_OFFSET (ClocksTimerRowPrivate, delete_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "delete_button", FALSE, ClocksTimerRow_private_offset + G_STRUCT_OFFSET (ClocksTimerRowPrivate, delete_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "title", FALSE, ClocksTimerRow_private_offset + G_STRUCT_OFFSET (ClocksTimerRowPrivate, title));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_start_button_clicked", G_CALLBACK(_clocks_timer_row_on_start_button_clicked_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_pause_button_clicked", G_CALLBACK(_clocks_timer_row_on_pause_button_clicked_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_reset_button_clicked", G_CALLBACK(_clocks_timer_row_on_reset_button_clicked_gtk_button_clicked));
}

static void
clocks_timer_row_instance_init (ClocksTimerRow * self,
                                gpointer klass)
{
	self->priv = clocks_timer_row_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
clocks_timer_row_finalize (GObject * obj)
{
	ClocksTimerRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CLOCKS_TIMER_TYPE_ROW, ClocksTimerRow);
	_g_object_unref0 (self->priv->_item);
	_g_object_unref0 (self->priv->name_binding);
	_g_object_unref0 (self->priv->entry_binding);
	_g_object_unref0 (self->priv->paused_animation);
	G_OBJECT_CLASS (clocks_timer_row_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
clocks_timer_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ClocksTimerRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clocks_timer_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ClocksTimerRow), 0, (GInstanceInitFunc) clocks_timer_row_instance_init, NULL };
	GType clocks_timer_row_type_id;
	clocks_timer_row_type_id = g_type_register_static (gtk_list_box_row_get_type (), "ClocksTimerRow", &g_define_type_info, 0);
	ClocksTimerRow_private_offset = g_type_add_instance_private (clocks_timer_row_type_id, sizeof (ClocksTimerRowPrivate));
	return clocks_timer_row_type_id;
}

GType
clocks_timer_row_get_type (void)
{
	static gsize clocks_timer_row_type_id__once = 0;
	if (g_once_init_enter (&clocks_timer_row_type_id__once)) {
		GType clocks_timer_row_type_id;
		clocks_timer_row_type_id = clocks_timer_row_get_type_once ();
		g_once_init_leave (&clocks_timer_row_type_id__once, clocks_timer_row_type_id);
	}
	return clocks_timer_row_type_id__once;
}

static void
_vala_clocks_timer_row_get_property (GObject * object,
                                     guint property_id,
                                     GValue * value,
                                     GParamSpec * pspec)
{
	ClocksTimerRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_TIMER_TYPE_ROW, ClocksTimerRow);
	switch (property_id) {
		case CLOCKS_TIMER_ROW_ITEM_PROPERTY:
		g_value_set_object (value, clocks_timer_row_get_item (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_clocks_timer_row_set_property (GObject * object,
                                     guint property_id,
                                     const GValue * value,
                                     GParamSpec * pspec)
{
	ClocksTimerRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CLOCKS_TIMER_TYPE_ROW, ClocksTimerRow);
	switch (property_id) {
		case CLOCKS_TIMER_ROW_ITEM_PROPERTY:
		clocks_timer_row_set_item (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

