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

/*
 * Copyright (c) 2016-2025 focus-timer contributors
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#include "ft_core.h"
#include <gio/gio.h>
#include <glib.h>
#include <glib-object.h>
#include <stdlib.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_SESSION_MANAGER_ACTION_GROUP_0_PROPERTY,
	FT_SESSION_MANAGER_ACTION_GROUP_SESSION_MANAGER_PROPERTY,
	FT_SESSION_MANAGER_ACTION_GROUP_NUM_PROPERTIES
};
static GParamSpec* ft_session_manager_action_group_properties[FT_SESSION_MANAGER_ACTION_GROUP_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 _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

struct _FtSessionManagerActionGroupPrivate {
	FtSessionManager* _session_manager;
	GSimpleAction* state_action;
	GSimpleAction* start_short_break_action;
	GSimpleAction* start_long_break_action;
	GSimpleAction* start_break_action;
	gulong notify_current_time_block_id;
	gulong session_expired_id;
};

static gint FtSessionManagerActionGroup_private_offset;
static gpointer ft_session_manager_action_group_parent_class = NULL;

static gchar* ft_session_manager_action_group_get_current_state (FtSessionManagerActionGroup* self);
static void ft_session_manager_action_group_activate_advance (FtSessionManagerActionGroup* self,
                                                       GSimpleAction* action,
                                                       GVariant* parameter);
static void ft_session_manager_action_group_activate_reset (FtSessionManagerActionGroup* self,
                                                     GSimpleAction* action,
                                                     GVariant* parameter);
static void ft_session_manager_action_group_activate_state (FtSessionManagerActionGroup* self,
                                                     GSimpleAction* action,
                                                     GVariant* parameter);
static void ft_session_manager_action_group_activate_start_pomodoro (FtSessionManagerActionGroup* self,
                                                              GSimpleAction* action,
                                                              GVariant* parameter);
static void ft_session_manager_action_group_activate_start_short_break (FtSessionManagerActionGroup* self,
                                                                 GSimpleAction* action,
                                                                 GVariant* parameter);
static void ft_session_manager_action_group_activate_start_long_break (FtSessionManagerActionGroup* self,
                                                                GSimpleAction* action,
                                                                GVariant* parameter);
static void ft_session_manager_action_group_activate_start_break (FtSessionManagerActionGroup* self,
                                                           GSimpleAction* action,
                                                           GVariant* parameter);
static void ft_session_manager_action_group_on_notify_current_time_block (FtSessionManagerActionGroup* self);
static void ft_session_manager_action_group_on_session_expired (FtSessionManagerActionGroup* self,
                                                         FtSession* session,
                                                         gint64 timestamp);
static void ft_session_manager_action_group_real_dispose (GObject* base);
static void _ft_session_manager_action_group_on_notify_current_time_block_g_object_notify (GObject* _sender,
                                                                                    GParamSpec* pspec,
                                                                                    gpointer self);
static void _ft_session_manager_action_group_on_session_expired_ft_session_manager_session_expired (FtSessionManager* _sender,
                                                                                             FtSession* session,
                                                                                             gint64 timestamp,
                                                                                             gpointer self);
static GObject * ft_session_manager_action_group_constructor (GType type,
                                                       guint n_construct_properties,
                                                       GObjectConstructParam * construct_properties);
static void _ft_session_manager_action_group_activate_advance_g_simple_action_activate (GSimpleAction* _sender,
                                                                                 GVariant* parameter,
                                                                                 gpointer self);
static void _ft_session_manager_action_group_activate_reset_g_simple_action_activate (GSimpleAction* _sender,
                                                                               GVariant* parameter,
                                                                               gpointer self);
static void _ft_session_manager_action_group_activate_state_g_simple_action_activate (GSimpleAction* _sender,
                                                                               GVariant* parameter,
                                                                               gpointer self);
static void _ft_session_manager_action_group_activate_start_pomodoro_g_simple_action_activate (GSimpleAction* _sender,
                                                                                        GVariant* parameter,
                                                                                        gpointer self);
static void _ft_session_manager_action_group_activate_start_short_break_g_simple_action_activate (GSimpleAction* _sender,
                                                                                           GVariant* parameter,
                                                                                           gpointer self);
static void _ft_session_manager_action_group_activate_start_long_break_g_simple_action_activate (GSimpleAction* _sender,
                                                                                          GVariant* parameter,
                                                                                          gpointer self);
static void _ft_session_manager_action_group_activate_start_break_g_simple_action_activate (GSimpleAction* _sender,
                                                                                     GVariant* parameter,
                                                                                     gpointer self);
static void ft_session_manager_action_group_finalize (GObject * obj);
static GType ft_session_manager_action_group_get_type_once (void);
static void _vala_ft_session_manager_action_group_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec);
static void _vala_ft_session_manager_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_session_manager_action_group_get_instance_private (FtSessionManagerActionGroup* self)
{
	return G_STRUCT_MEMBER_P (self, FtSessionManagerActionGroup_private_offset);
}

FtSessionManagerActionGroup*
ft_session_manager_action_group_construct (GType object_type)
{
	FtSessionManagerActionGroup * self = NULL;
	FtSessionManager* _tmp0_;
	_tmp0_ = ft_session_manager_get_default ();
	self = (FtSessionManagerActionGroup*) g_object_new (object_type, "session-manager", _tmp0_, NULL);
	return self;
}

FtSessionManagerActionGroup*
ft_session_manager_action_group_new (void)
{
	return ft_session_manager_action_group_construct (FT_TYPE_SESSION_MANAGER_ACTION_GROUP);
}

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

static gchar*
ft_session_manager_action_group_get_current_state (FtSessionManagerActionGroup* self)
{
	FtTimeBlock* current_time_block = NULL;
	FtSessionManager* _tmp0_;
	FtSessionManager* _tmp1_;
	FtTimeBlock* _tmp2_;
	FtTimeBlock* _tmp3_;
	FtTimeBlock* _tmp4_;
	FtState _tmp5_ = 0;
	FtTimeBlock* _tmp6_;
	FtState current_state = 0;
	gchar* _tmp10_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = ft_session_manager_action_group_get_session_manager (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = ft_session_manager_get_current_time_block (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	current_time_block = _tmp4_;
	_tmp6_ = current_time_block;
	if (_tmp6_ != NULL) {
		FtTimeBlock* _tmp7_;
		FtState _tmp8_;
		FtState _tmp9_;
		_tmp7_ = current_time_block;
		_tmp8_ = ft_time_block_get_state (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp5_ = _tmp9_;
	} else {
		_tmp5_ = FT_STATE_STOPPED;
	}
	current_state = _tmp5_;
	_tmp10_ = ft_state_to_string (current_state);
	result = _tmp10_;
	_g_object_unref0 (current_time_block);
	return result;
}

static void
ft_session_manager_action_group_activate_advance (FtSessionManagerActionGroup* self,
                                                  GSimpleAction* action,
                                                  GVariant* parameter)
{
	FtSessionManager* _tmp0_;
	FtSessionManager* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	ft_context_set_event_source ("session-manager.advance", FT_TIMESTAMP_UNDEFINED);
	_tmp0_ = ft_session_manager_action_group_get_session_manager (self);
	_tmp1_ = _tmp0_;
	ft_session_manager_advance (_tmp1_, FT_TIMESTAMP_UNDEFINED);
}

static void
ft_session_manager_action_group_activate_reset (FtSessionManagerActionGroup* self,
                                                GSimpleAction* action,
                                                GVariant* parameter)
{
	FtSessionManager* _tmp0_;
	FtSessionManager* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	ft_context_set_event_source ("session-manager.reset", FT_TIMESTAMP_UNDEFINED);
	_tmp0_ = ft_session_manager_action_group_get_session_manager (self);
	_tmp1_ = _tmp0_;
	ft_session_manager_reset (_tmp1_, FT_TIMESTAMP_UNDEFINED);
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

static void
ft_session_manager_action_group_activate_state (FtSessionManagerActionGroup* self,
                                                GSimpleAction* action,
                                                GVariant* parameter)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	FtSessionManager* _tmp4_;
	FtSessionManager* _tmp5_;
	const gchar* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	if (parameter == NULL) {
		return;
	}
	_tmp0_ = g_variant_get_string (parameter, NULL);
	_tmp1_ = string_to_string (_tmp0_);
	_tmp2_ = g_strconcat ("session-manager.state:", _tmp1_, NULL);
	_tmp3_ = _tmp2_;
	ft_context_set_event_source (_tmp3_, FT_TIMESTAMP_UNDEFINED);
	_g_free0 (_tmp3_);
	_tmp4_ = ft_session_manager_action_group_get_session_manager (self);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_variant_get_string (parameter, NULL);
	ft_session_manager_advance_to_state (_tmp5_, ft_state_from_string (_tmp6_), FT_TIMESTAMP_UNDEFINED);
}

static void
ft_session_manager_action_group_activate_start_pomodoro (FtSessionManagerActionGroup* self,
                                                         GSimpleAction* action,
                                                         GVariant* parameter)
{
	FtSessionManager* _tmp0_;
	FtSessionManager* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	ft_context_set_event_source ("session-manager.start-pomodoro", FT_TIMESTAMP_UNDEFINED);
	_tmp0_ = ft_session_manager_action_group_get_session_manager (self);
	_tmp1_ = _tmp0_;
	ft_session_manager_advance_to_state (_tmp1_, FT_STATE_POMODORO, FT_TIMESTAMP_UNDEFINED);
}

static void
ft_session_manager_action_group_activate_start_short_break (FtSessionManagerActionGroup* self,
                                                            GSimpleAction* action,
                                                            GVariant* parameter)
{
	FtSessionManager* _tmp0_;
	FtSessionManager* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	ft_context_set_event_source ("session-manager.start-short-break", FT_TIMESTAMP_UNDEFINED);
	_tmp0_ = ft_session_manager_action_group_get_session_manager (self);
	_tmp1_ = _tmp0_;
	ft_session_manager_advance_to_state (_tmp1_, FT_STATE_SHORT_BREAK, FT_TIMESTAMP_UNDEFINED);
}

static void
ft_session_manager_action_group_activate_start_long_break (FtSessionManagerActionGroup* self,
                                                           GSimpleAction* action,
                                                           GVariant* parameter)
{
	FtSessionManager* _tmp0_;
	FtSessionManager* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	ft_context_set_event_source ("session-manager.start-long-break", FT_TIMESTAMP_UNDEFINED);
	_tmp0_ = ft_session_manager_action_group_get_session_manager (self);
	_tmp1_ = _tmp0_;
	ft_session_manager_advance_to_state (_tmp1_, FT_STATE_LONG_BREAK, FT_TIMESTAMP_UNDEFINED);
}

static void
ft_session_manager_action_group_activate_start_break (FtSessionManagerActionGroup* self,
                                                      GSimpleAction* action,
                                                      GVariant* parameter)
{
	FtSessionManager* _tmp0_;
	FtSessionManager* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	ft_context_set_event_source ("session-manager.start-break", FT_TIMESTAMP_UNDEFINED);
	_tmp0_ = ft_session_manager_action_group_get_session_manager (self);
	_tmp1_ = _tmp0_;
	ft_session_manager_advance_to_state (_tmp1_, FT_STATE_BREAK, FT_TIMESTAMP_UNDEFINED);
}

static void
ft_session_manager_action_group_on_notify_current_time_block (FtSessionManagerActionGroup* self)
{
	GSimpleAction* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	GVariant* _tmp3_;
	GVariant* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->state_action;
	_tmp1_ = ft_session_manager_action_group_get_current_state (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_variant_new_string (_tmp2_);
	g_variant_ref_sink (_tmp3_);
	_tmp4_ = _tmp3_;
	g_simple_action_set_state (_tmp0_, _tmp4_);
	_g_variant_unref0 (_tmp4_);
	_g_free0 (_tmp2_);
}

static void
ft_session_manager_action_group_on_session_expired (FtSessionManagerActionGroup* self,
                                                    FtSession* session,
                                                    gint64 timestamp)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (session != NULL);
	ft_context_set_event_source ("session-manager.session-expired", timestamp);
}

static void
ft_session_manager_action_group_real_dispose (GObject* base)
{
	FtSessionManagerActionGroup * self;
	self = (FtSessionManagerActionGroup*) base;
	if (self->priv->notify_current_time_block_id != ((gulong) 0)) {
		FtSessionManager* _tmp0_;
		_tmp0_ = self->priv->_session_manager;
		g_signal_handler_disconnect ((GObject*) _tmp0_, self->priv->notify_current_time_block_id);
		self->priv->notify_current_time_block_id = (gulong) 0;
	}
	if (self->priv->session_expired_id != ((gulong) 0)) {
		FtSessionManager* _tmp1_;
		_tmp1_ = self->priv->_session_manager;
		g_signal_handler_disconnect ((GObject*) _tmp1_, self->priv->session_expired_id);
		self->priv->session_expired_id = (gulong) 0;
	}
	_g_object_unref0 (self->priv->state_action);
	self->priv->state_action = NULL;
	_g_object_unref0 (self->priv->start_short_break_action);
	self->priv->start_short_break_action = NULL;
	_g_object_unref0 (self->priv->start_long_break_action);
	self->priv->start_long_break_action = NULL;
	_g_object_unref0 (self->priv->start_break_action);
	self->priv->start_break_action = NULL;
	_g_object_unref0 (self->priv->_session_manager);
	self->priv->_session_manager = NULL;
	G_OBJECT_CLASS (ft_session_manager_action_group_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, g_simple_action_group_get_type (), GSimpleActionGroup));
}

FtSessionManager*
ft_session_manager_action_group_get_session_manager (FtSessionManagerActionGroup* self)
{
	FtSessionManager* result;
	FtSessionManager* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_session_manager;
	result = _tmp0_;
	return result;
}

static void
_ft_session_manager_action_group_on_notify_current_time_block_g_object_notify (GObject* _sender,
                                                                               GParamSpec* pspec,
                                                                               gpointer self)
{
	ft_session_manager_action_group_on_notify_current_time_block ((FtSessionManagerActionGroup*) self);
}

static void
_ft_session_manager_action_group_on_session_expired_ft_session_manager_session_expired (FtSessionManager* _sender,
                                                                                        FtSession* session,
                                                                                        gint64 timestamp,
                                                                                        gpointer self)
{
	ft_session_manager_action_group_on_session_expired ((FtSessionManagerActionGroup*) self, session, timestamp);
}

static void
ft_session_manager_action_group_set_session_manager (FtSessionManagerActionGroup* self,
                                                     FtSessionManager* value)
{
	FtSessionManager* _tmp0_;
	FtSessionManager* _tmp1_;
	gulong _tmp2_;
	FtSessionManager* _tmp3_;
	gulong _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_session_manager);
	self->priv->_session_manager = _tmp0_;
	_tmp1_ = self->priv->_session_manager;
	_tmp2_ = g_signal_connect_object ((GObject*) _tmp1_, "notify::current-time-block", (GCallback) _ft_session_manager_action_group_on_notify_current_time_block_g_object_notify, self, 0);
	self->priv->notify_current_time_block_id = _tmp2_;
	_tmp3_ = self->priv->_session_manager;
	_tmp4_ = g_signal_connect_object (_tmp3_, "session-expired", (GCallback) _ft_session_manager_action_group_on_session_expired_ft_session_manager_session_expired, self, 0);
	self->priv->session_expired_id = _tmp4_;
	g_object_notify_by_pspec ((GObject *) self, ft_session_manager_action_group_properties[FT_SESSION_MANAGER_ACTION_GROUP_SESSION_MANAGER_PROPERTY]);
}

static void
_ft_session_manager_action_group_activate_advance_g_simple_action_activate (GSimpleAction* _sender,
                                                                            GVariant* parameter,
                                                                            gpointer self)
{
	ft_session_manager_action_group_activate_advance ((FtSessionManagerActionGroup*) self, _sender, parameter);
}

static void
_ft_session_manager_action_group_activate_reset_g_simple_action_activate (GSimpleAction* _sender,
                                                                          GVariant* parameter,
                                                                          gpointer self)
{
	ft_session_manager_action_group_activate_reset ((FtSessionManagerActionGroup*) self, _sender, parameter);
}

static void
_ft_session_manager_action_group_activate_state_g_simple_action_activate (GSimpleAction* _sender,
                                                                          GVariant* parameter,
                                                                          gpointer self)
{
	ft_session_manager_action_group_activate_state ((FtSessionManagerActionGroup*) self, _sender, parameter);
}

static void
_ft_session_manager_action_group_activate_start_pomodoro_g_simple_action_activate (GSimpleAction* _sender,
                                                                                   GVariant* parameter,
                                                                                   gpointer self)
{
	ft_session_manager_action_group_activate_start_pomodoro ((FtSessionManagerActionGroup*) self, _sender, parameter);
}

static void
_ft_session_manager_action_group_activate_start_short_break_g_simple_action_activate (GSimpleAction* _sender,
                                                                                      GVariant* parameter,
                                                                                      gpointer self)
{
	ft_session_manager_action_group_activate_start_short_break ((FtSessionManagerActionGroup*) self, _sender, parameter);
}

static void
_ft_session_manager_action_group_activate_start_long_break_g_simple_action_activate (GSimpleAction* _sender,
                                                                                     GVariant* parameter,
                                                                                     gpointer self)
{
	ft_session_manager_action_group_activate_start_long_break ((FtSessionManagerActionGroup*) self, _sender, parameter);
}

static void
_ft_session_manager_action_group_activate_start_break_g_simple_action_activate (GSimpleAction* _sender,
                                                                                GVariant* parameter,
                                                                                gpointer self)
{
	ft_session_manager_action_group_activate_start_break ((FtSessionManagerActionGroup*) self, _sender, parameter);
}

static GObject *
ft_session_manager_action_group_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	FtSessionManagerActionGroup * self;
	GSimpleAction* advance_action = NULL;
	GSimpleAction* _tmp0_;
	GSimpleAction* _tmp1_;
	GSimpleAction* _tmp2_;
	GSimpleAction* reset_action = NULL;
	GSimpleAction* _tmp3_;
	GSimpleAction* _tmp4_;
	GSimpleAction* _tmp5_;
	GSimpleAction* state_action = NULL;
	const GVariantType* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	GVariant* _tmp9_;
	GVariant* _tmp10_;
	GSimpleAction* _tmp11_;
	GSimpleAction* _tmp12_;
	GSimpleAction* _tmp13_;
	GSimpleAction* _tmp14_;
	GSimpleAction* start_pomodoro_action = NULL;
	GSimpleAction* _tmp15_;
	GSimpleAction* _tmp16_;
	GSimpleAction* _tmp17_;
	GSimpleAction* start_short_break_action = NULL;
	GSimpleAction* _tmp18_;
	GSimpleAction* _tmp19_;
	GSimpleAction* _tmp20_;
	GSimpleAction* start_long_break_action = NULL;
	GSimpleAction* _tmp21_;
	GSimpleAction* _tmp22_;
	GSimpleAction* _tmp23_;
	GSimpleAction* start_break_action = NULL;
	GSimpleAction* _tmp24_;
	GSimpleAction* _tmp25_;
	GSimpleAction* _tmp26_;
	GSimpleAction* _tmp27_;
	GSimpleAction* _tmp28_;
	GSimpleAction* _tmp29_;
	GSimpleAction* _tmp30_;
	GSimpleAction* _tmp31_;
	GSimpleAction* _tmp32_;
	GSimpleAction* _tmp33_;
	GSimpleAction* _tmp34_;
	parent_class = G_OBJECT_CLASS (ft_session_manager_action_group_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_SESSION_MANAGER_ACTION_GROUP, FtSessionManagerActionGroup);
	_tmp0_ = g_simple_action_new ("advance", NULL);
	advance_action = _tmp0_;
	_tmp1_ = advance_action;
	g_signal_connect_object (_tmp1_, "activate", (GCallback) _ft_session_manager_action_group_activate_advance_g_simple_action_activate, self, 0);
	_tmp2_ = advance_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_session_manager_action_group_activate_reset_g_simple_action_activate, self, 0);
	_tmp5_ = reset_action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp5_);
	_tmp6_ = G_VARIANT_TYPE_STRING;
	_tmp7_ = ft_session_manager_action_group_get_current_state (self);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_variant_new_string (_tmp8_);
	g_variant_ref_sink (_tmp9_);
	_tmp10_ = _tmp9_;
	_tmp11_ = g_simple_action_new_stateful ("state", _tmp6_, _tmp10_);
	_tmp12_ = _tmp11_;
	_g_variant_unref0 (_tmp10_);
	_g_free0 (_tmp8_);
	state_action = _tmp12_;
	_tmp13_ = state_action;
	g_signal_connect_object (_tmp13_, "activate", (GCallback) _ft_session_manager_action_group_activate_state_g_simple_action_activate, self, 0);
	_tmp14_ = state_action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp14_);
	_tmp15_ = g_simple_action_new ("start-pomodoro", NULL);
	start_pomodoro_action = _tmp15_;
	_tmp16_ = start_pomodoro_action;
	g_signal_connect_object (_tmp16_, "activate", (GCallback) _ft_session_manager_action_group_activate_start_pomodoro_g_simple_action_activate, self, 0);
	_tmp17_ = start_pomodoro_action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp17_);
	_tmp18_ = g_simple_action_new ("start-short-break", NULL);
	start_short_break_action = _tmp18_;
	_tmp19_ = start_short_break_action;
	g_signal_connect_object (_tmp19_, "activate", (GCallback) _ft_session_manager_action_group_activate_start_short_break_g_simple_action_activate, self, 0);
	_tmp20_ = start_short_break_action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp20_);
	_tmp21_ = g_simple_action_new ("start-long-break", NULL);
	start_long_break_action = _tmp21_;
	_tmp22_ = start_long_break_action;
	g_signal_connect_object (_tmp22_, "activate", (GCallback) _ft_session_manager_action_group_activate_start_long_break_g_simple_action_activate, self, 0);
	_tmp23_ = start_long_break_action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp23_);
	_tmp24_ = g_simple_action_new ("start-break", NULL);
	start_break_action = _tmp24_;
	_tmp25_ = start_break_action;
	g_signal_connect_object (_tmp25_, "activate", (GCallback) _ft_session_manager_action_group_activate_start_break_g_simple_action_activate, self, 0);
	_tmp26_ = start_break_action;
	g_action_map_add_action ((GActionMap*) self, (GAction*) _tmp26_);
	_tmp27_ = state_action;
	_tmp28_ = _g_object_ref0 (_tmp27_);
	_g_object_unref0 (self->priv->state_action);
	self->priv->state_action = _tmp28_;
	_tmp29_ = start_short_break_action;
	_tmp30_ = _g_object_ref0 (_tmp29_);
	_g_object_unref0 (self->priv->start_short_break_action);
	self->priv->start_short_break_action = _tmp30_;
	_tmp31_ = start_long_break_action;
	_tmp32_ = _g_object_ref0 (_tmp31_);
	_g_object_unref0 (self->priv->start_long_break_action);
	self->priv->start_long_break_action = _tmp32_;
	_tmp33_ = start_break_action;
	_tmp34_ = _g_object_ref0 (_tmp33_);
	_g_object_unref0 (self->priv->start_break_action);
	self->priv->start_break_action = _tmp34_;
	_g_object_unref0 (start_break_action);
	_g_object_unref0 (start_long_break_action);
	_g_object_unref0 (start_short_break_action);
	_g_object_unref0 (start_pomodoro_action);
	_g_object_unref0 (state_action);
	_g_object_unref0 (reset_action);
	_g_object_unref0 (advance_action);
	return obj;
}

static void
ft_session_manager_action_group_class_init (FtSessionManagerActionGroupClass * klass,
                                            gpointer klass_data)
{
	ft_session_manager_action_group_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FtSessionManagerActionGroup_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) ft_session_manager_action_group_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_ft_session_manager_action_group_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_ft_session_manager_action_group_set_property;
	G_OBJECT_CLASS (klass)->constructor = ft_session_manager_action_group_constructor;
	G_OBJECT_CLASS (klass)->finalize = ft_session_manager_action_group_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_SESSION_MANAGER_ACTION_GROUP_SESSION_MANAGER_PROPERTY, ft_session_manager_action_group_properties[FT_SESSION_MANAGER_ACTION_GROUP_SESSION_MANAGER_PROPERTY] = g_param_spec_object ("session-manager", "session-manager", "session-manager", FT_TYPE_SESSION_MANAGER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
ft_session_manager_action_group_instance_init (FtSessionManagerActionGroup * self,
                                               gpointer klass)
{
	self->priv = ft_session_manager_action_group_get_instance_private (self);
	self->priv->notify_current_time_block_id = (gulong) 0;
	self->priv->session_expired_id = (gulong) 0;
}

static void
ft_session_manager_action_group_finalize (GObject * obj)
{
	FtSessionManagerActionGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_SESSION_MANAGER_ACTION_GROUP, FtSessionManagerActionGroup);
	_g_object_unref0 (self->priv->_session_manager);
	_g_object_unref0 (self->priv->state_action);
	_g_object_unref0 (self->priv->start_short_break_action);
	_g_object_unref0 (self->priv->start_long_break_action);
	_g_object_unref0 (self->priv->start_break_action);
	G_OBJECT_CLASS (ft_session_manager_action_group_parent_class)->finalize (obj);
}

static GType
ft_session_manager_action_group_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtSessionManagerActionGroupClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_session_manager_action_group_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtSessionManagerActionGroup), 0, (GInstanceInitFunc) ft_session_manager_action_group_instance_init, NULL };
	GType ft_session_manager_action_group_type_id;
	ft_session_manager_action_group_type_id = g_type_register_static (g_simple_action_group_get_type (), "FtSessionManagerActionGroup", &g_define_type_info, 0);
	FtSessionManagerActionGroup_private_offset = g_type_add_instance_private (ft_session_manager_action_group_type_id, sizeof (FtSessionManagerActionGroupPrivate));
	return ft_session_manager_action_group_type_id;
}

GType
ft_session_manager_action_group_get_type (void)
{
	static volatile gsize ft_session_manager_action_group_type_id__once = 0;
	if (g_once_init_enter (&ft_session_manager_action_group_type_id__once)) {
		GType ft_session_manager_action_group_type_id;
		ft_session_manager_action_group_type_id = ft_session_manager_action_group_get_type_once ();
		g_once_init_leave (&ft_session_manager_action_group_type_id__once, ft_session_manager_action_group_type_id);
	}
	return ft_session_manager_action_group_type_id__once;
}

static void
_vala_ft_session_manager_action_group_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec)
{
	FtSessionManagerActionGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_SESSION_MANAGER_ACTION_GROUP, FtSessionManagerActionGroup);
	switch (property_id) {
		case FT_SESSION_MANAGER_ACTION_GROUP_SESSION_MANAGER_PROPERTY:
		g_value_set_object (value, ft_session_manager_action_group_get_session_manager (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_ft_session_manager_action_group_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec)
{
	FtSessionManagerActionGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_SESSION_MANAGER_ACTION_GROUP, FtSessionManagerActionGroup);
	switch (property_id) {
		case FT_SESSION_MANAGER_ACTION_GROUP_SESSION_MANAGER_PROPERTY:
		ft_session_manager_action_group_set_session_manager (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;
}

