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

/*
 * Copyright (c) 2016-2025 focus-timer contributors
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 *
 * Authors: Kamil Prusko <kamilprusko@gmail.com>
 */

#include "ft_core.h"
#include <glib-object.h>
#include <glib.h>
#include <gio/gio.h>
#include <string.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

enum  {
	FT_TIMER_ACTION_GROUP_0_PROPERTY,
	FT_TIMER_ACTION_GROUP_TIMER_PROPERTY,
	FT_TIMER_ACTION_GROUP_NUM_PROPERTIES
};
static GParamSpec* ft_timer_action_group_properties[FT_TIMER_ACTION_GROUP_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _FtTimerActionGroupPrivate {
	FtTimer* _timer;
};

static gint FtTimerActionGroup_private_offset;
static gpointer ft_timer_action_group_parent_class = NULL;

static gboolean ft_timer_action_group_confirm_advance (FtTimerActionGroup* self);
static void ft_timer_action_group_activate_start (FtTimerActionGroup* self,
                                           GSimpleAction* action,
                                           GVariant* parameter);
static void ft_timer_action_group_activate_reset (FtTimerActionGroup* self,
                                           GSimpleAction* action,
                                           GVariant* parameter);
static void ft_timer_action_group_activate_pause (FtTimerActionGroup* self,
                                           GSimpleAction* action,
                                           GVariant* parameter);
static void ft_timer_action_group_activate_resume (FtTimerActionGroup* self,
                                            GSimpleAction* action,
                                            GVariant* parameter);
static void ft_timer_action_group_activate_rewind (FtTimerActionGroup* self,
                                            GSimpleAction* action,
                                            GVariant* parameter);
static void ft_timer_action_group_activate_start_stop (FtTimerActionGroup* self,
                                                GSimpleAction* action,
                                                GVariant* parameter);
static void ft_timer_action_group_activate_start_pause_resume (FtTimerActionGroup* self,
                                                        GSimpleAction* action,
                                                        GVariant* parameter);
static void ft_timer_action_group_activate_shorten (FtTimerActionGroup* self,
                                             GSimpleAction* action,
                                             GVariant* parameter);
static void ft_timer_action_group_activate_extend (FtTimerActionGroup* self,
                                            GSimpleAction* action,
                                            GVariant* parameter);
static GObject * ft_timer_action_group_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties);
static void _ft_timer_action_group_activate_start_g_simple_action_activate (GSimpleAction* _sender,
                                                                     GVariant* parameter,
                                                                     gpointer self);
static void _ft_timer_action_group_activate_reset_g_simple_action_activate (GSimpleAction* _sender,
                                                                     GVariant* parameter,
                                                                     gpointer self);
static void _ft_timer_action_group_activate_pause_g_simple_action_activate (GSimpleAction* _sender,
                                                                     GVariant* parameter,
                                                                     gpointer self);
static void _ft_timer_action_group_activate_resume_g_simple_action_activate (GSimpleAction* _sender,
                                                                      GVariant* parameter,
                                                                      gpointer self);
static void _ft_timer_action_group_activate_rewind_g_simple_action_activate (GSimpleAction* _sender,
                                                                      GVariant* parameter,
                                                                      gpointer self);
static void _ft_timer_action_group_activate_start_stop_g_simple_action_activate (GSimpleAction* _sender,
                                                                          GVariant* parameter,
                                                                          gpointer self);
static void _ft_timer_action_group_activate_start_pause_resume_g_simple_action_activate (GSimpleAction* _sender,
                                                                                  GVariant* parameter,
                                                                                  gpointer self);
static void _ft_timer_action_group_activate_shorten_g_simple_action_activate (GSimpleAction* _sender,
                                                                       GVariant* parameter,
                                                                       gpointer self);
static void _ft_timer_action_group_activate_extend_g_simple_action_activate (GSimpleAction* _sender,
                                                                      GVariant* parameter,
                                                                      gpointer self);
static void ft_timer_action_group_finalize (GObject * obj);
static GType ft_timer_action_group_get_type_once (void);
static void _vala_ft_timer_action_group_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_ft_timer_action_group_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
ft_timer_action_group_get_instance_private (FtTimerActionGroup* self)
{
	return G_STRUCT_MEMBER_P (self, FtTimerActionGroup_private_offset);
}

FtTimerActionGroup*
ft_timer_action_group_construct (GType object_type)
{
	FtTimerActionGroup * self = NULL;
	FtTimer* _tmp0_;
	_tmp0_ = ft_timer_get_default ();
	self = (FtTimerActionGroup*) g_object_new (object_type, "timer", _tmp0_, NULL);
	return self;
}

FtTimerActionGroup*
ft_timer_action_group_new (void)
{
	return ft_timer_action_group_construct (FT_TYPE_TIMER_ACTION_GROUP);
}

FtTimerActionGroup*
ft_timer_action_group_construct_with_timer (GType object_type,
                                            FtTimer* timer)
{
	FtTimerActionGroup * self = NULL;
	g_return_val_if_fail (timer != NULL, NULL);
	self = (FtTimerActionGroup*) g_object_new (object_type, "timer", timer, NULL);
	return self;
}

FtTimerActionGroup*
ft_timer_action_group_new_with_timer (FtTimer* timer)
{
	return ft_timer_action_group_construct_with_timer (FT_TYPE_TIMER_ACTION_GROUP, timer);
}

/**
         * Make exception for confirming advancement - treat it as resuming/starting timer.
         *
         * Not very elegant, but convenient to have this behaviour centralized.
         */
static gboolean
ft_timer_action_group_confirm_advance (FtTimerActionGroup* self)
{
	FtTimer* _tmp0_;
	FtSessionManager* session_manager = NULL;
	FtSessionManager* _tmp1_;
	FtSessionManager* _tmp2_ = NULL;
	FtSessionManager* _tmp3_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_timer;
	if (!ft_timer_is_finished (_tmp0_)) {
		result = FALSE;
		return result;
	}
	_tmp1_ = ft_session_manager_get_default ();
	session_manager = _tmp1_;
	ft_context_set_event_source ("session-manager.advance", FT_TIMESTAMP_UNDEFINED);
	_tmp3_ = session_manager;
	_tmp2_ = _tmp3_;
	if (_tmp2_ != NULL) {
		ft_session_manager_advance (_tmp2_, FT_TIMESTAMP_UNDEFINED);
	}
	result = TRUE;
	return result;
}

static void
ft_timer_action_group_activate_start (FtTimerActionGroup* self,
                                      GSimpleAction* action,
                                      GVariant* parameter)
{
	FtTimer* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	if (ft_timer_action_group_confirm_advance (self)) {
		return;
	}
	ft_context_set_event_source ("timer.start", FT_TIMESTAMP_UNDEFINED);
	_tmp0_ = self->priv->_timer;
	ft_timer_start (_tmp0_, FT_TIMESTAMP_UNDEFINED);
}

static void
ft_timer_action_group_activate_reset (FtTimerActionGroup* self,
                                      GSimpleAction* action,
                                      GVariant* parameter)
{
	FtTimer* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	ft_context_set_event_source ("timer.reset", FT_TIMESTAMP_UNDEFINED);
	_tmp0_ = self->priv->_timer;
	ft_timer_reset (_tmp0_, (gint64) 0, NULL, FT_TIMESTAMP_UNDEFINED);
}

static void
ft_timer_action_group_activate_pause (FtTimerActionGroup* self,
                                      GSimpleAction* action,
                                      GVariant* parameter)
{
	FtTimer* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	ft_context_set_event_source ("timer.pause", FT_TIMESTAMP_UNDEFINED);
	_tmp0_ = self->priv->_timer;
	ft_timer_pause (_tmp0_, FT_TIMESTAMP_UNDEFINED);
}

static void
ft_timer_action_group_activate_resume (FtTimerActionGroup* self,
                                       GSimpleAction* action,
                                       GVariant* parameter)
{
	FtTimer* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	ft_context_set_event_source ("timer.resume", FT_TIMESTAMP_UNDEFINED);
	_tmp0_ = self->priv->_timer;
	ft_timer_resume (_tmp0_, FT_TIMESTAMP_UNDEFINED);
}

static void
ft_timer_action_group_activate_rewind (FtTimerActionGroup* self,
                                       GSimpleAction* action,
                                       GVariant* parameter)
{
	gint64 _tmp0_ = 0LL;
	gint64 interval = 0LL;
	FtTimer* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	if (parameter != NULL) {
		_tmp0_ = g_variant_get_int32 (parameter) * FT_INTERVAL_SECOND;
	} else {
		_tmp0_ = FT_INTERVAL_MINUTE;
	}
	interval = _tmp0_;
	ft_context_set_event_source ("timer.rewind", FT_TIMESTAMP_UNDEFINED);
	_tmp1_ = self->priv->_timer;
	ft_timer_rewind (_tmp1_, interval, FT_TIMESTAMP_UNDEFINED);
}

static void
ft_timer_action_group_activate_start_stop (FtTimerActionGroup* self,
                                           GSimpleAction* action,
                                           GVariant* parameter)
{
	FtTimer* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	if (ft_timer_action_group_confirm_advance (self)) {
		return;
	}
	_tmp0_ = self->priv->_timer;
	if (!ft_timer_is_started (_tmp0_)) {
		FtTimer* _tmp1_;
		ft_context_set_event_source ("timer.start", FT_TIMESTAMP_UNDEFINED);
		_tmp1_ = self->priv->_timer;
		ft_timer_start (_tmp1_, FT_TIMESTAMP_UNDEFINED);
	} else {
		FtTimer* _tmp2_;
		ft_context_set_event_source ("timer.reset", FT_TIMESTAMP_UNDEFINED);
		_tmp2_ = self->priv->_timer;
		ft_timer_reset (_tmp2_, (gint64) 0, NULL, FT_TIMESTAMP_UNDEFINED);
	}
}

/**
         * This action mimics the primary button in the timer controls
         */
static void
ft_timer_action_group_activate_start_pause_resume (FtTimerActionGroup* self,
                                                   GSimpleAction* action,
                                                   GVariant* parameter)
{
	FtTimer* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	if (ft_timer_action_group_confirm_advance (self)) {
		return;
	}
	_tmp0_ = self->priv->_timer;
	if (!ft_timer_is_started (_tmp0_)) {
		FtTimer* _tmp1_;
		ft_context_set_event_source ("timer.start", FT_TIMESTAMP_UNDEFINED);
		_tmp1_ = self->priv->_timer;
		ft_timer_start (_tmp1_, FT_TIMESTAMP_UNDEFINED);
	} else {
		FtTimer* _tmp2_;
		_tmp2_ = self->priv->_timer;
		if (ft_timer_is_paused (_tmp2_)) {
			FtTimer* _tmp3_;
			ft_context_set_event_source ("timer.resume", FT_TIMESTAMP_UNDEFINED);
			_tmp3_ = self->priv->_timer;
			ft_timer_resume (_tmp3_, FT_TIMESTAMP_UNDEFINED);
		} else {
			FtTimer* _tmp4_;
			ft_context_set_event_source ("timer.pause", FT_TIMESTAMP_UNDEFINED);
			_tmp4_ = self->priv->_timer;
			ft_timer_pause (_tmp4_, FT_TIMESTAMP_UNDEFINED);
		}
	}
}

static void
ft_timer_action_group_activate_shorten (FtTimerActionGroup* self,
                                        GSimpleAction* action,
                                        GVariant* parameter)
{
	gint64 _tmp0_ = 0LL;
	gint64 interval = 0LL;
	FtTimer* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	if (parameter != NULL) {
		_tmp0_ = g_variant_get_int32 (parameter) * FT_INTERVAL_SECOND;
	} else {
		_tmp0_ = FT_INTERVAL_MINUTE;
	}
	interval = _tmp0_;
	ft_context_set_event_source ("timer.extend", FT_TIMESTAMP_UNDEFINED);
	_tmp1_ = self->priv->_timer;
	ft_timer_extend (_tmp1_, -interval, FT_TIMESTAMP_UNDEFINED);
}

static void
ft_timer_action_group_activate_extend (FtTimerActionGroup* self,
                                       GSimpleAction* action,
                                       GVariant* parameter)
{
	gint64 _tmp0_ = 0LL;
	gint64 interval = 0LL;
	FtTimer* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	if (parameter != NULL) {
		_tmp0_ = g_variant_get_int32 (parameter) * FT_INTERVAL_SECOND;
	} else {
		_tmp0_ = FT_INTERVAL_MINUTE;
	}
	interval = _tmp0_;
	ft_context_set_event_source ("timer.extend", FT_TIMESTAMP_UNDEFINED);
	_tmp1_ = self->priv->_timer;
	ft_timer_extend (_tmp1_, interval, FT_TIMESTAMP_UNDEFINED);
}

FtTimer*
ft_timer_action_group_get_timer (FtTimerActionGroup* self)
{
	FtTimer* result;
	FtTimer* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_timer;
	result = _tmp0_;
	return result;
}

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

static void
ft_timer_action_group_set_timer (FtTimerActionGroup* self,
                                 FtTimer* value)
{
	FtTimer* old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_timer_action_group_get_timer (self);
	if (old_value != value) {
		FtTimer* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_timer);
		self->priv->_timer = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, ft_timer_action_group_properties[FT_TIMER_ACTION_GROUP_TIMER_PROPERTY]);
	}
}

static void
_ft_timer_action_group_activate_start_g_simple_action_activate (GSimpleAction* _sender,
                                                                GVariant* parameter,
                                                                gpointer self)
{
	ft_timer_action_group_activate_start ((FtTimerActionGroup*) self, _sender, parameter);
}

static void
_ft_timer_action_group_activate_reset_g_simple_action_activate (GSimpleAction* _sender,
                                                                GVariant* parameter,
                                                                gpointer self)
{
	ft_timer_action_group_activate_reset ((FtTimerActionGroup*) self, _sender, parameter);
}

static void
_ft_timer_action_group_activate_pause_g_simple_action_activate (GSimpleAction* _sender,
                                                                GVariant* parameter,
                                                                gpointer self)
{
	ft_timer_action_group_activate_pause ((FtTimerActionGroup*) self, _sender, parameter);
}

static void
_ft_timer_action_group_activate_resume_g_simple_action_activate (GSimpleAction* _sender,
                                                                 GVariant* parameter,
                                                                 gpointer self)
{
	ft_timer_action_group_activate_resume ((FtTimerActionGroup*) self, _sender, parameter);
}

static void
_ft_timer_action_group_activate_rewind_g_simple_action_activate (GSimpleAction* _sender,
                                                                 GVariant* parameter,
                                                                 gpointer self)
{
	ft_timer_action_group_activate_rewind ((FtTimerActionGroup*) self, _sender, parameter);
}

static void
_ft_timer_action_group_activate_start_stop_g_simple_action_activate (GSimpleAction* _sender,
                                                                     GVariant* parameter,
                                                                     gpointer self)
{
	ft_timer_action_group_activate_start_stop ((FtTimerActionGroup*) self, _sender, parameter);
}

static void
_ft_timer_action_group_activate_start_pause_resume_g_simple_action_activate (GSimpleAction* _sender,
                                                                             GVariant* parameter,
                                                                             gpointer self)
{
	ft_timer_action_group_activate_start_pause_resume ((FtTimerActionGroup*) self, _sender, parameter);
}

static void
_ft_timer_action_group_activate_shorten_g_simple_action_activate (GSimpleAction* _sender,
                                                                  GVariant* parameter,
                                                                  gpointer self)
{
	ft_timer_action_group_activate_shorten ((FtTimerActionGroup*) self, _sender, parameter);
}

static void
_ft_timer_action_group_activate_extend_g_simple_action_activate (GSimpleAction* _sender,
                                                                 GVariant* parameter,
                                                                 gpointer self)
{
	ft_timer_action_group_activate_extend ((FtTimerActionGroup*) self, _sender, parameter);
}

static GObject *
ft_timer_action_group_constructor (GType type,
                                   guint n_construct_properties,
                                   GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	FtTimerActionGroup * self;
	GSimpleAction* start_action = NULL;
	GSimpleAction* _tmp0_;
	GSimpleAction* _tmp1_;
	GSimpleAction* _tmp2_;
	GSimpleAction* reset_action = NULL;
	GSimpleAction* _tmp3_;
	GSimpleAction* _tmp4_;
	GSimpleAction* _tmp5_;
	GSimpleAction* pause_action = NULL;
	GSimpleAction* _tmp6_;
	GSimpleAction* _tmp7_;
	GSimpleAction* _tmp8_;
	GSimpleAction* resume_action = NULL;
	GSimpleAction* _tmp9_;
	GSimpleAction* _tmp10_;
	GSimpleAction* _tmp11_;
	GSimpleAction* rewind_action = NULL;
	GSimpleAction* _tmp12_;
	GSimpleAction* _tmp13_;
	GSimpleAction* _tmp14_;
	GSimpleAction* rewind_by_action = NULL;
	const GVariantType* _tmp15_;
	GSimpleAction* _tmp16_;
	GSimpleAction* _tmp17_;
	GSimpleAction* _tmp18_;
	GSimpleAction* toggle_action = NULL;
	GSimpleAction* _tmp19_;
	GSimpleAction* _tmp20_;
	GSimpleAction* _tmp21_;
	GSimpleAction* start_stop_action = NULL;
	GSimpleAction* _tmp22_;
	GSimpleAction* _tmp23_;
	GSimpleAction* _tmp24_;
	GSimpleAction* start_pause_resume_action = NULL;
	GSimpleAction* _tmp25_;
	GSimpleAction* _tmp26_;
	GSimpleAction* _tmp27_;
	GSimpleAction* shorten_action = NULL;
	GSimpleAction* _tmp28_;
	GSimpleAction* _tmp29_;
	GSimpleAction* _tmp30_;
	GSimpleAction* extend_action = NULL;
	GSimpleAction* _tmp31_;
	GSimpleAction* _tmp32_;
	GSimpleAction* _tmp33_;
	GSimpleAction* extend_by_action = NULL;
	const GVariantType* _tmp34_;
	GSimpleAction* _tmp35_;
	GSimpleAction* _tmp36_;
	GSimpleAction* _tmp37_;
	parent_class = G_OBJECT_CLASS (ft_timer_action_group_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_TIMER_ACTION_GROUP, FtTimerActionGroup);
	_tmp0_ = g_simple_action_new ("start", NULL);
	start_action = _tmp0_;
	_tmp1_ = start_action;
	g_signal_connect_object (_tmp1_, "activate", (GCallback) _ft_timer_action_group_activate_start_g_simple_action_activate, self, 0);
	_tmp2_ = start_action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp2_);
	_tmp3_ = g_simple_action_new ("reset", NULL);
	reset_action = _tmp3_;
	_tmp4_ = reset_action;
	g_signal_connect_object (_tmp4_, "activate", (GCallback) _ft_timer_action_group_activate_reset_g_simple_action_activate, self, 0);
	_tmp5_ = reset_action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp5_);
	_tmp6_ = g_simple_action_new ("pause", NULL);
	pause_action = _tmp6_;
	_tmp7_ = pause_action;
	g_signal_connect_object (_tmp7_, "activate", (GCallback) _ft_timer_action_group_activate_pause_g_simple_action_activate, self, 0);
	_tmp8_ = pause_action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp8_);
	_tmp9_ = g_simple_action_new ("resume", NULL);
	resume_action = _tmp9_;
	_tmp10_ = resume_action;
	g_signal_connect_object (_tmp10_, "activate", (GCallback) _ft_timer_action_group_activate_resume_g_simple_action_activate, self, 0);
	_tmp11_ = resume_action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp11_);
	_tmp12_ = g_simple_action_new ("rewind", NULL);
	rewind_action = _tmp12_;
	_tmp13_ = rewind_action;
	g_signal_connect_object (_tmp13_, "activate", (GCallback) _ft_timer_action_group_activate_rewind_g_simple_action_activate, self, 0);
	_tmp14_ = rewind_action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp14_);
	_tmp15_ = G_VARIANT_TYPE_INT32;
	_tmp16_ = g_simple_action_new ("rewind-by", _tmp15_);
	rewind_by_action = _tmp16_;
	_tmp17_ = rewind_by_action;
	g_signal_connect_object (_tmp17_, "activate", (GCallback) _ft_timer_action_group_activate_rewind_g_simple_action_activate, self, 0);
	_tmp18_ = rewind_by_action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp18_);
	_tmp19_ = g_simple_action_new ("toggle", NULL);
	toggle_action = _tmp19_;
	_tmp20_ = toggle_action;
	g_signal_connect_object (_tmp20_, "activate", (GCallback) _ft_timer_action_group_activate_start_stop_g_simple_action_activate, self, 0);
	_tmp21_ = toggle_action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp21_);
	_tmp22_ = g_simple_action_new ("start-stop", NULL);
	start_stop_action = _tmp22_;
	_tmp23_ = start_stop_action;
	g_signal_connect_object (_tmp23_, "activate", (GCallback) _ft_timer_action_group_activate_start_stop_g_simple_action_activate, self, 0);
	_tmp24_ = start_stop_action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp24_);
	_tmp25_ = g_simple_action_new ("start-pause-resume", NULL);
	start_pause_resume_action = _tmp25_;
	_tmp26_ = start_pause_resume_action;
	g_signal_connect_object (_tmp26_, "activate", (GCallback) _ft_timer_action_group_activate_start_pause_resume_g_simple_action_activate, self, 0);
	_tmp27_ = start_pause_resume_action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp27_);
	_tmp28_ = g_simple_action_new ("shorten", NULL);
	shorten_action = _tmp28_;
	_tmp29_ = shorten_action;
	g_signal_connect_object (_tmp29_, "activate", (GCallback) _ft_timer_action_group_activate_shorten_g_simple_action_activate, self, 0);
	_tmp30_ = shorten_action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp30_);
	_tmp31_ = g_simple_action_new ("extend", NULL);
	extend_action = _tmp31_;
	_tmp32_ = extend_action;
	g_signal_connect_object (_tmp32_, "activate", (GCallback) _ft_timer_action_group_activate_extend_g_simple_action_activate, self, 0);
	_tmp33_ = extend_action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp33_);
	_tmp34_ = G_VARIANT_TYPE_INT32;
	_tmp35_ = g_simple_action_new ("extend-by", _tmp34_);
	extend_by_action = _tmp35_;
	_tmp36_ = extend_by_action;
	g_signal_connect_object (_tmp36_, "activate", (GCallback) _ft_timer_action_group_activate_extend_g_simple_action_activate, self, 0);
	_tmp37_ = extend_by_action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp37_);
	_g_object_unref0 (extend_by_action);
	_g_object_unref0 (extend_action);
	_g_object_unref0 (shorten_action);
	_g_object_unref0 (start_pause_resume_action);
	_g_object_unref0 (start_stop_action);
	_g_object_unref0 (toggle_action);
	_g_object_unref0 (rewind_by_action);
	_g_object_unref0 (rewind_action);
	_g_object_unref0 (resume_action);
	_g_object_unref0 (pause_action);
	_g_object_unref0 (reset_action);
	_g_object_unref0 (start_action);
	return obj;
}

static void
ft_timer_action_group_class_init (FtTimerActionGroupClass * klass,
                                  gpointer klass_data)
{
	ft_timer_action_group_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FtTimerActionGroup_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_ft_timer_action_group_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_ft_timer_action_group_set_property;
	G_OBJECT_CLASS (klass)->constructor = ft_timer_action_group_constructor;
	G_OBJECT_CLASS (klass)->finalize = ft_timer_action_group_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_TIMER_ACTION_GROUP_TIMER_PROPERTY, ft_timer_action_group_properties[FT_TIMER_ACTION_GROUP_TIMER_PROPERTY] = g_param_spec_object ("timer", "timer", "timer", FT_TYPE_TIMER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
ft_timer_action_group_instance_init (FtTimerActionGroup * self,
                                     gpointer klass)
{
	self->priv = ft_timer_action_group_get_instance_private (self);
}

static void
ft_timer_action_group_finalize (GObject * obj)
{
	FtTimerActionGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_TIMER_ACTION_GROUP, FtTimerActionGroup);
	_g_object_unref0 (self->priv->_timer);
	G_OBJECT_CLASS (ft_timer_action_group_parent_class)->finalize (obj);
}

static GType
ft_timer_action_group_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtTimerActionGroupClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_timer_action_group_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtTimerActionGroup), 0, (GInstanceInitFunc) ft_timer_action_group_instance_init, NULL };
	GType ft_timer_action_group_type_id;
	ft_timer_action_group_type_id = g_type_register_static (g_simple_action_group_get_type (), "FtTimerActionGroup", &g_define_type_info, 0);
	FtTimerActionGroup_private_offset = g_type_add_instance_private (ft_timer_action_group_type_id, sizeof (FtTimerActionGroupPrivate));
	return ft_timer_action_group_type_id;
}

GType
ft_timer_action_group_get_type (void)
{
	static volatile gsize ft_timer_action_group_type_id__once = 0;
	if (g_once_init_enter (&ft_timer_action_group_type_id__once)) {
		GType ft_timer_action_group_type_id;
		ft_timer_action_group_type_id = ft_timer_action_group_get_type_once ();
		g_once_init_leave (&ft_timer_action_group_type_id__once, ft_timer_action_group_type_id);
	}
	return ft_timer_action_group_type_id__once;
}

static void
_vala_ft_timer_action_group_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	FtTimerActionGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_TIMER_ACTION_GROUP, FtTimerActionGroup);
	switch (property_id) {
		case FT_TIMER_ACTION_GROUP_TIMER_PROPERTY:
		g_value_set_object (value, ft_timer_action_group_get_timer (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_ft_timer_action_group_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	FtTimerActionGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_TIMER_ACTION_GROUP, FtTimerActionGroup);
	switch (property_id) {
		case FT_TIMER_ACTION_GROUP_TIMER_PROPERTY:
		ft_timer_action_group_set_timer (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

