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

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

#include "ft_plugin_sni.h"
#include <gio/gio.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <glib-object.h>
#include "ft_core.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  {
	SNI_INDICATOR_ACTION_GROUP_0_PROPERTY,
	SNI_INDICATOR_ACTION_GROUP_NUM_PROPERTIES
};
static GParamSpec* sni_indicator_action_group_properties[SNI_INDICATOR_ACTION_GROUP_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block1Data Block1Data;
#define _g_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_variant_builder_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_builder_unref (var), NULL)))

struct _SniIndicatorActionGroupPrivate {
	GActionGroup* application_action_group;
	GActionGroup* timer_action_group;
	GActionGroup* session_manager_action_group;
	GHashTable* actions;
};

struct _Block1Data {
	int _ref_count_;
	GDBusConnection* connection;
	gchar* action_name;
};

static gint SniIndicatorActionGroup_private_offset;
static gpointer sni_indicator_action_group_parent_class = NULL;
static GActionGroupInterface * sni_indicator_action_group_g_action_group_parent_iface = NULL;
static GRemoteActionGroupInterface * sni_indicator_action_group_g_remote_action_group_parent_iface = NULL;
static GType sni_indicator_action_group_type_id = 0;

static inline void sni_indicator_action_group_split_name (SniIndicatorActionGroup* self,
                                            const gchar* action_name,
                                            gchar** prefix,
                                            gchar** name);
static GActionGroup* sni_indicator_action_group_lookup_group (SniIndicatorActionGroup* self,
                                                       const gchar* prefix);
static void sni_indicator_action_group_real_activate_action (GActionGroup* base,
                                                      const gchar* action_name,
                                                      GVariant* parameter);
static void sni_indicator_action_group_real_change_action_state (GActionGroup* base,
                                                          const gchar* action_name,
                                                          GVariant* value);
static gchar** sni_indicator_action_group_real_list_actions (GActionGroup* base);
static void _vala_array_add1 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void _vala_array_add2 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void _vala_array_add3 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void _vala_array_add4 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void sni_indicator_action_group_activate_action_remote (const gchar* action_name,
                                                        GVariant* parameter,
                                                        GVariant* platform_data,
                                                        gint timeout,
                                                        GCancellable* cancellable);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static void __lambda4_ (Block1Data* _data1_,
                 GObject* obj,
                 GAsyncResult* res);
static void ___lambda4__gasync_ready_callback (GObject* source_object,
                                        GAsyncResult* res,
                                        gpointer self);
static void sni_indicator_action_group_real_activate_action_full (GRemoteActionGroup* base,
                                                           const gchar* action_name,
                                                           GVariant* parameter,
                                                           GVariant* platform_data);
static void sni_indicator_action_group_real_change_action_state_full (GRemoteActionGroup* base,
                                                               const gchar* action_name,
                                                               GVariant* value,
                                                               GVariant* platform_data);
static void sni_indicator_action_group_activate_quit (SniIndicatorActionGroup* self,
                                               GSimpleAction* action,
                                               GVariant* parameter);
static gboolean __lambda5_ (SniIndicatorActionGroup* self);
static gboolean ___lambda5__gsource_func (gpointer self);
static GObject * sni_indicator_action_group_constructor (GType type,
                                                  guint n_construct_properties,
                                                  GObjectConstructParam * construct_properties);
static void _g_free0_ (gpointer var);
static void _g_object_unref0_ (gpointer var);
static void _sni_indicator_action_group_activate_quit_g_simple_action_activate (GSimpleAction* _sender,
                                                                         GVariant* parameter,
                                                                         gpointer self);
static void sni_indicator_action_group_finalize (GObject * obj);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static inline gpointer
sni_indicator_action_group_get_instance_private (SniIndicatorActionGroup* self)
{
	return G_STRUCT_MEMBER_P (self, SniIndicatorActionGroup_private_offset);
}

static inline void
sni_indicator_action_group_split_name (SniIndicatorActionGroup* self,
                                       const gchar* action_name,
                                       gchar** prefix,
                                       gchar** name)
{
	gchar* _vala_prefix = NULL;
	gchar* _vala_name = NULL;
	gchar** action_name_parts = NULL;
	gchar** _tmp0_;
	gchar** _tmp1_;
	gint action_name_parts_length1;
	gint _action_name_parts_size_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action_name != NULL);
	_tmp1_ = _tmp0_ = g_strsplit (action_name, ".", 2);
	action_name_parts = _tmp1_;
	action_name_parts_length1 = _vala_array_length (_tmp0_);
	_action_name_parts_size_ = action_name_parts_length1;
	_tmp2_ = action_name_parts;
	_tmp2__length1 = action_name_parts_length1;
	if (_tmp2__length1 < 2) {
		gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp3_ = g_strdup ("indicator");
		_g_free0 (_vala_prefix);
		_vala_prefix = _tmp3_;
		_tmp4_ = g_strdup (action_name);
		_g_free0 (_vala_name);
		_vala_name = _tmp4_;
	} else {
		gchar** _tmp5_;
		gint _tmp5__length1;
		const gchar* _tmp6_;
		gchar* _tmp7_;
		gchar** _tmp8_;
		gint _tmp8__length1;
		const gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp5_ = action_name_parts;
		_tmp5__length1 = action_name_parts_length1;
		_tmp6_ = _tmp5_[0];
		_tmp7_ = g_strdup (_tmp6_);
		_g_free0 (_vala_prefix);
		_vala_prefix = _tmp7_;
		_tmp8_ = action_name_parts;
		_tmp8__length1 = action_name_parts_length1;
		_tmp9_ = _tmp8_[1];
		_tmp10_ = g_strdup (_tmp9_);
		_g_free0 (_vala_name);
		_vala_name = _tmp10_;
	}
	action_name_parts = (_vala_array_free (action_name_parts, action_name_parts_length1, (GDestroyNotify) g_free), NULL);
	if (prefix) {
		*prefix = _vala_prefix;
	} else {
		_g_free0 (_vala_prefix);
	}
	if (name) {
		*name = _vala_name;
	} else {
		_g_free0 (_vala_name);
	}
}

static GActionGroup*
sni_indicator_action_group_lookup_group (SniIndicatorActionGroup* self,
                                         const gchar* prefix)
{
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
	static GQuark _tmp1_label0 = 0;
	static GQuark _tmp1_label1 = 0;
	static GQuark _tmp1_label2 = 0;
	static GQuark _tmp1_label3 = 0;
	GActionGroup* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (prefix != NULL, NULL);
	_tmp0_ = prefix;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("indicator")))) {
		switch (0) {
			default:
			{
				result = (GActionGroup*) self;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("app")))) {
		switch (0) {
			default:
			{
				GActionGroup* _tmp3_;
				_tmp3_ = self->priv->application_action_group;
				result = _tmp3_;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label2) ? _tmp1_label2 : (_tmp1_label2 = g_quark_from_static_string ("timer")))) {
		switch (0) {
			default:
			{
				GActionGroup* _tmp4_;
				_tmp4_ = self->priv->timer_action_group;
				result = _tmp4_;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label3) ? _tmp1_label3 : (_tmp1_label3 = g_quark_from_static_string ("session-manager")))) {
		switch (0) {
			default:
			{
				GActionGroup* _tmp5_;
				_tmp5_ = self->priv->session_manager_action_group;
				result = _tmp5_;
				return result;
			}
		}
	} else {
		switch (0) {
			default:
			{
				result = NULL;
				return result;
			}
		}
	}
}

static void
sni_indicator_action_group_real_activate_action (GActionGroup* base,
                                                 const gchar* action_name,
                                                 GVariant* parameter)
{
	SniIndicatorActionGroup * self;
	gchar* prefix = NULL;
	gchar* action_name_ = NULL;
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	GActionGroup* action_group = NULL;
	const gchar* _tmp2_;
	GActionGroup* _tmp3_;
	GActionGroup* _tmp4_;
	self = (SniIndicatorActionGroup*) base;
	g_return_if_fail (action_name != NULL);
	sni_indicator_action_group_split_name (self, action_name, &_tmp0_, &_tmp1_);
	_g_free0 (prefix);
	prefix = _tmp0_;
	_g_free0 (action_name_);
	action_name_ = _tmp1_;
	_tmp2_ = prefix;
	_tmp3_ = sni_indicator_action_group_lookup_group (self, _tmp2_);
	action_group = _tmp3_;
	_tmp4_ = action_group;
	if (_tmp4_ == G_TYPE_CHECK_INSTANCE_CAST (self, g_action_group_get_type (), GActionGroup)) {
		GAction* action = NULL;
		GHashTable* _tmp5_;
		const gchar* _tmp6_;
		gconstpointer _tmp7_;
		GAction* _tmp8_ = NULL;
		GAction* _tmp9_;
		_tmp5_ = self->priv->actions;
		_tmp6_ = action_name_;
		_tmp7_ = g_hash_table_lookup (_tmp5_, _tmp6_);
		action = (GAction*) _tmp7_;
		_tmp9_ = action;
		_tmp8_ = _tmp9_;
		if (_tmp8_ != NULL) {
			g_action_activate (_tmp8_, parameter);
		}
	} else {
		GActionGroup* _tmp10_;
		_tmp10_ = action_group;
		if (_tmp10_ != NULL) {
			GActionGroup* _tmp11_;
			const gchar* _tmp12_;
			_tmp11_ = action_group;
			_tmp12_ = action_name_;
			g_action_group_activate_action (_tmp11_, _tmp12_, parameter);
		}
	}
	_g_free0 (action_name_);
	_g_free0 (prefix);
}

static void
sni_indicator_action_group_real_change_action_state (GActionGroup* base,
                                                     const gchar* action_name,
                                                     GVariant* value)
{
	SniIndicatorActionGroup * self;
	gchar* prefix = NULL;
	gchar* action_name_ = NULL;
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	GActionGroup* action_group = NULL;
	const gchar* _tmp2_;
	GActionGroup* _tmp3_;
	GActionGroup* _tmp4_;
	self = (SniIndicatorActionGroup*) base;
	g_return_if_fail (action_name != NULL);
	g_return_if_fail (value != NULL);
	sni_indicator_action_group_split_name (self, action_name, &_tmp0_, &_tmp1_);
	_g_free0 (prefix);
	prefix = _tmp0_;
	_g_free0 (action_name_);
	action_name_ = _tmp1_;
	_tmp2_ = prefix;
	_tmp3_ = sni_indicator_action_group_lookup_group (self, _tmp2_);
	action_group = _tmp3_;
	_tmp4_ = action_group;
	if (_tmp4_ == G_TYPE_CHECK_INSTANCE_CAST (self, g_action_group_get_type (), GActionGroup)) {
		GAction* action = NULL;
		GHashTable* _tmp5_;
		const gchar* _tmp6_;
		gconstpointer _tmp7_;
		GAction* _tmp8_ = NULL;
		GAction* _tmp9_;
		_tmp5_ = self->priv->actions;
		_tmp6_ = action_name_;
		_tmp7_ = g_hash_table_lookup (_tmp5_, _tmp6_);
		action = (GAction*) _tmp7_;
		_tmp9_ = action;
		_tmp8_ = _tmp9_;
		if (_tmp8_ != NULL) {
			g_action_change_state (_tmp8_, value);
		}
	} else {
		GActionGroup* _tmp10_;
		_tmp10_ = action_group;
		if (_tmp10_ != NULL) {
			GActionGroup* _tmp11_;
			const gchar* _tmp12_;
			_tmp11_ = action_group;
			_tmp12_ = action_name_;
			g_action_group_change_action_state (_tmp11_, _tmp12_, value);
		}
	}
	_g_free0 (action_name_);
	_g_free0 (prefix);
}

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

void
sni_indicator_action_group_add_action (SniIndicatorActionGroup* self,
                                       GAction* action)
{
	gchar* prefix = NULL;
	gchar* action_name = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	GActionGroup* action_group = NULL;
	const gchar* _tmp4_;
	GActionGroup* _tmp5_;
	GActionGroup* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	_tmp0_ = g_action_get_name (action);
	_tmp1_ = _tmp0_;
	sni_indicator_action_group_split_name (self, _tmp1_, &_tmp2_, &_tmp3_);
	_g_free0 (prefix);
	prefix = _tmp2_;
	_g_free0 (action_name);
	action_name = _tmp3_;
	_tmp4_ = prefix;
	_tmp5_ = sni_indicator_action_group_lookup_group (self, _tmp4_);
	action_group = _tmp5_;
	_tmp6_ = action_group;
	if (_tmp6_ == G_TYPE_CHECK_INSTANCE_CAST (self, g_action_group_get_type (), GActionGroup)) {
		GHashTable* _tmp7_;
		const gchar* _tmp8_;
		gchar* _tmp9_;
		GAction* _tmp10_;
		_tmp7_ = self->priv->actions;
		_tmp8_ = action_name;
		_tmp9_ = g_strdup (_tmp8_);
		_tmp10_ = _g_object_ref0 (action);
		g_hash_table_insert (_tmp7_, _tmp9_, _tmp10_);
	} else {
		GActionGroup* _tmp11_;
		_tmp11_ = action_group;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp11_, g_action_map_get_type ())) {
			GActionGroup* _tmp12_;
			_tmp12_ = action_group;
			g_action_map_add_action ((GActionMap*) _tmp12_, action);
		} else {
			const gchar* _tmp13_;
			const gchar* _tmp14_;
			_tmp13_ = g_action_get_name (action);
			_tmp14_ = _tmp13_;
			g_warning ("indicator-action-group.vala:128: Unable to add action '%s'", _tmp14_);
		}
	}
	_g_free0 (action_name);
	_g_free0 (prefix);
}

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
_vala_array_add1 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add2 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add3 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add4 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static gchar**
sni_indicator_action_group_real_list_actions (GActionGroup* base)
{
	SniIndicatorActionGroup * self;
	gchar** action_names = NULL;
	gchar** _tmp0_;
	gint action_names_length1;
	gint _action_names_size_;
	GHashTable* _tmp1_;
	guint _tmp2_ = 0;
	gconstpointer* _tmp3_;
	GActionGroup* _tmp7_;
	gchar** _tmp8_;
	gchar** _tmp9_;
	GActionGroup* _tmp14_;
	gchar** _tmp15_;
	gchar** _tmp16_;
	GActionGroup* _tmp21_;
	gchar** _tmp22_;
	gchar** _tmp23_;
	gchar** result;
	self = (SniIndicatorActionGroup*) base;
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	action_names = _tmp0_;
	action_names_length1 = 0;
	_action_names_size_ = action_names_length1;
	_tmp1_ = self->priv->actions;
	_tmp3_ = g_hash_table_get_keys_as_array (_tmp1_, &_tmp2_);
	{
		const gchar** action_name_collection = NULL;
		gint action_name_collection_length1 = 0;
		gint _action_name_collection_size_ = 0;
		gint action_name_it = 0;
		action_name_collection = _tmp3_;
		action_name_collection_length1 = _tmp2_;
		for (action_name_it = 0; action_name_it < action_name_collection_length1; action_name_it = action_name_it + 1) {
			const gchar* action_name = NULL;
			action_name = action_name_collection[action_name_it];
			{
				const gchar* _tmp4_;
				const gchar* _tmp5_;
				gchar* _tmp6_;
				_tmp4_ = action_name;
				_tmp5_ = string_to_string (_tmp4_);
				_tmp6_ = g_strconcat ("indicator.", _tmp5_, NULL);
				_vala_array_add1 (&action_names, &action_names_length1, &_action_names_size_, _tmp6_);
			}
		}
		action_name_collection = (g_free (action_name_collection), NULL);
	}
	_tmp7_ = self->priv->application_action_group;
	_tmp9_ = _tmp8_ = g_action_group_list_actions (_tmp7_);
	{
		gchar** action_name_collection = NULL;
		gint action_name_collection_length1 = 0;
		gint _action_name_collection_size_ = 0;
		gint action_name_it = 0;
		action_name_collection = _tmp9_;
		action_name_collection_length1 = _vala_array_length (_tmp8_);
		for (action_name_it = 0; action_name_it < action_name_collection_length1; action_name_it = action_name_it + 1) {
			gchar* _tmp10_;
			gchar* action_name = NULL;
			_tmp10_ = g_strdup (action_name_collection[action_name_it]);
			action_name = _tmp10_;
			{
				const gchar* _tmp11_;
				const gchar* _tmp12_;
				gchar* _tmp13_;
				_tmp11_ = action_name;
				_tmp12_ = string_to_string (_tmp11_);
				_tmp13_ = g_strconcat ("app.", _tmp12_, NULL);
				_vala_array_add2 (&action_names, &action_names_length1, &_action_names_size_, _tmp13_);
				_g_free0 (action_name);
			}
		}
		action_name_collection = (_vala_array_free (action_name_collection, action_name_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp14_ = self->priv->timer_action_group;
	_tmp16_ = _tmp15_ = g_action_group_list_actions (_tmp14_);
	{
		gchar** action_name_collection = NULL;
		gint action_name_collection_length1 = 0;
		gint _action_name_collection_size_ = 0;
		gint action_name_it = 0;
		action_name_collection = _tmp16_;
		action_name_collection_length1 = _vala_array_length (_tmp15_);
		for (action_name_it = 0; action_name_it < action_name_collection_length1; action_name_it = action_name_it + 1) {
			gchar* _tmp17_;
			gchar* action_name = NULL;
			_tmp17_ = g_strdup (action_name_collection[action_name_it]);
			action_name = _tmp17_;
			{
				const gchar* _tmp18_;
				const gchar* _tmp19_;
				gchar* _tmp20_;
				_tmp18_ = action_name;
				_tmp19_ = string_to_string (_tmp18_);
				_tmp20_ = g_strconcat ("timer.", _tmp19_, NULL);
				_vala_array_add3 (&action_names, &action_names_length1, &_action_names_size_, _tmp20_);
				_g_free0 (action_name);
			}
		}
		action_name_collection = (_vala_array_free (action_name_collection, action_name_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp21_ = self->priv->session_manager_action_group;
	_tmp23_ = _tmp22_ = g_action_group_list_actions (_tmp21_);
	{
		gchar** action_name_collection = NULL;
		gint action_name_collection_length1 = 0;
		gint _action_name_collection_size_ = 0;
		gint action_name_it = 0;
		action_name_collection = _tmp23_;
		action_name_collection_length1 = _vala_array_length (_tmp22_);
		for (action_name_it = 0; action_name_it < action_name_collection_length1; action_name_it = action_name_it + 1) {
			gchar* _tmp24_;
			gchar* action_name = NULL;
			_tmp24_ = g_strdup (action_name_collection[action_name_it]);
			action_name = _tmp24_;
			{
				const gchar* _tmp25_;
				const gchar* _tmp26_;
				gchar* _tmp27_;
				_tmp25_ = action_name;
				_tmp26_ = string_to_string (_tmp25_);
				_tmp27_ = g_strconcat ("session-manager.", _tmp26_, NULL);
				_vala_array_add4 (&action_names, &action_names_length1, &_action_names_size_, _tmp27_);
				_g_free0 (action_name);
			}
		}
		action_name_collection = (_vala_array_free (action_name_collection, action_name_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	result = action_names;
	return result;
}

static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}

static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		_g_object_unref0 (_data1_->connection);
		_g_free0 (_data1_->action_name);
		g_slice_free (Block1Data, _data1_);
	}
}

static gpointer
_g_variant_ref0 (gpointer self)
{
	return self ? g_variant_ref (self) : NULL;
}

static void
__lambda4_ (Block1Data* _data1_,
            GObject* obj,
            GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (res != NULL);
	{
		GDBusConnection* _tmp0_;
		GVariant* _tmp1_;
		GVariant* _tmp2_;
		_tmp0_ = _data1_->connection;
		_tmp1_ = g_dbus_connection_call_finish (_tmp0_, res, &_inner_error0_);
		_tmp2_ = _tmp1_;
		_g_variant_unref0 (_tmp2_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp3_ = _error_;
		_tmp4_ = _tmp3_->message;
		g_warning ("indicator-action-group.vala:196: Failed to activate action '%s': %s", _data1_->action_name, _tmp4_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda4__gasync_ready_callback (GObject* source_object,
                                   GAsyncResult* res,
                                   gpointer self)
{
	__lambda4_ (self, source_object, res);
	block1_data_unref (self);
}

static void
sni_indicator_action_group_activate_action_remote (const gchar* action_name,
                                                   GVariant* parameter,
                                                   GVariant* platform_data,
                                                   gint timeout,
                                                   GCancellable* cancellable)
{
	Block1Data* _data1_;
	gchar* _tmp0_;
	GApplication* application = NULL;
	GApplication* _tmp1_;
	GApplication* _tmp2_;
	GApplication* _tmp3_ = NULL;
	GApplication* _tmp4_;
	GDBusConnection* _tmp5_ = NULL;
	GDBusConnection* _tmp7_;
	GDBusConnection* _tmp8_;
	GVariantBuilder* parameters = NULL;
	GVariantType* _tmp9_;
	GVariantType* _tmp10_;
	GVariantBuilder* _tmp11_;
	GVariantBuilder* _tmp12_;
	GDBusConnection* _tmp16_;
	GApplication* _tmp17_;
	const gchar* _tmp18_;
	GApplication* _tmp19_;
	const gchar* _tmp20_;
	GVariant* _tmp21_;
	GVariantBuilder* _tmp22_;
	GVariant* _tmp23_;
	GVariant* _tmp24_;
	GVariant** _tmp25_;
	GVariant** _tmp26_;
	gint _tmp26__length1;
	GVariant* _tmp27_;
	GVariant* _tmp28_;
	g_return_if_fail (action_name != NULL);
	g_return_if_fail (platform_data != NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_tmp0_ = g_strdup (action_name);
	_g_free0 (_data1_->action_name);
	_data1_->action_name = _tmp0_;
	_tmp1_ = g_application_get_default ();
	_tmp2_ = _g_object_ref0 (_tmp1_);
	application = _tmp2_;
	_tmp4_ = application;
	_tmp3_ = _tmp4_;
	_tmp5_ = NULL;
	if (_tmp3_ != NULL) {
		GDBusConnection* _tmp6_;
		_tmp6_ = g_application_get_dbus_connection (_tmp3_);
		_tmp5_ = _tmp6_;
	}
	_tmp7_ = _g_object_ref0 (_tmp5_);
	_data1_->connection = _tmp7_;
	_tmp8_ = _data1_->connection;
	if (_tmp8_ == NULL) {
		_g_object_unref0 (application);
		block1_data_unref (_data1_);
		_data1_ = NULL;
		return;
	}
	_tmp9_ = g_variant_type_new ("av");
	_tmp10_ = _tmp9_;
	_tmp11_ = g_variant_builder_new (_tmp10_);
	_tmp12_ = _tmp11_;
	_g_variant_type_free0 (_tmp10_);
	parameters = _tmp12_;
	if (parameter != NULL) {
		GVariantBuilder* _tmp13_;
		GVariant* _tmp14_;
		GVariant* _tmp15_;
		_tmp13_ = parameters;
		_tmp14_ = g_variant_new_variant (parameter);
		g_variant_ref_sink (_tmp14_);
		_tmp15_ = _tmp14_;
		g_variant_builder_add_value (_tmp13_, _tmp15_);
		_g_variant_unref0 (_tmp15_);
	}
	_tmp16_ = _data1_->connection;
	_tmp17_ = application;
	_tmp18_ = g_application_get_application_id (_tmp17_);
	_tmp19_ = application;
	_tmp20_ = g_application_get_dbus_object_path (_tmp19_);
	_tmp21_ = g_variant_new_string (_data1_->action_name);
	g_variant_ref_sink (_tmp21_);
	_tmp22_ = parameters;
	_tmp23_ = g_variant_builder_end (_tmp22_);
	g_variant_ref_sink (_tmp23_);
	_tmp24_ = _g_variant_ref0 (platform_data);
	_tmp25_ = g_new0 (GVariant*, 3 + 1);
	_tmp25_[0] = _tmp21_;
	_tmp25_[1] = _tmp23_;
	_tmp25_[2] = _tmp24_;
	_tmp26_ = _tmp25_;
	_tmp26__length1 = 3;
	_tmp27_ = g_variant_new_tuple (_tmp26_, 3);
	g_variant_ref_sink (_tmp27_);
	_tmp28_ = _tmp27_;
	g_dbus_connection_call (_tmp16_, _tmp18_, _tmp20_, "org.freedesktop.Application", "ActivateAction", _tmp28_, NULL, G_DBUS_CALL_FLAGS_NONE, timeout, cancellable, ___lambda4__gasync_ready_callback, block1_data_ref (_data1_));
	_g_variant_unref0 (_tmp28_);
	_tmp26_ = (_vala_array_free (_tmp26_, _tmp26__length1, (GDestroyNotify) g_variant_unref), NULL);
	_g_variant_builder_unref0 (parameters);
	_g_object_unref0 (application);
	block1_data_unref (_data1_);
	_data1_ = NULL;
}

static void
sni_indicator_action_group_real_activate_action_full (GRemoteActionGroup* base,
                                                      const gchar* action_name,
                                                      GVariant* parameter,
                                                      GVariant* platform_data)
{
	SniIndicatorActionGroup * self;
	gchar** action_name_parts = NULL;
	gchar** _tmp0_;
	gchar** _tmp1_;
	gint action_name_parts_length1;
	gint _action_name_parts_size_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	gchar** _tmp3_;
	gint _tmp3__length1;
	const gchar* _tmp4_;
	self = (SniIndicatorActionGroup*) base;
	g_return_if_fail (action_name != NULL);
	g_return_if_fail (platform_data != NULL);
	_tmp1_ = _tmp0_ = g_strsplit (action_name, ".", 2);
	action_name_parts = _tmp1_;
	action_name_parts_length1 = _vala_array_length (_tmp0_);
	_action_name_parts_size_ = action_name_parts_length1;
	_tmp2_ = action_name_parts;
	_tmp2__length1 = action_name_parts_length1;
	if (_tmp2__length1 == 1) {
		sni_indicator_action_group_activate_action_remote (action_name, parameter, platform_data, -1, NULL);
		action_name_parts = (_vala_array_free (action_name_parts, action_name_parts_length1, (GDestroyNotify) g_free), NULL);
		return;
	}
	_tmp3_ = action_name_parts;
	_tmp3__length1 = action_name_parts_length1;
	_tmp4_ = _tmp3_[0];
	if (g_strcmp0 (_tmp4_, "app") == 0) {
		gchar** _tmp5_;
		gint _tmp5__length1;
		const gchar* _tmp6_;
		_tmp5_ = action_name_parts;
		_tmp5__length1 = action_name_parts_length1;
		_tmp6_ = _tmp5_[1];
		sni_indicator_action_group_activate_action_remote (_tmp6_, parameter, platform_data, -1, NULL);
		action_name_parts = (_vala_array_free (action_name_parts, action_name_parts_length1, (GDestroyNotify) g_free), NULL);
		return;
	}
	g_action_group_activate_action ((GActionGroup*) self, action_name, parameter);
	action_name_parts = (_vala_array_free (action_name_parts, action_name_parts_length1, (GDestroyNotify) g_free), NULL);
}

static void
sni_indicator_action_group_real_change_action_state_full (GRemoteActionGroup* base,
                                                          const gchar* action_name,
                                                          GVariant* value,
                                                          GVariant* platform_data)
{
	SniIndicatorActionGroup * self;
	self = (SniIndicatorActionGroup*) base;
	g_return_if_fail (action_name != NULL);
	g_return_if_fail (value != NULL);
	g_return_if_fail (platform_data != NULL);
	g_action_group_change_action_state ((GActionGroup*) self, action_name, value);
}

static gboolean
__lambda5_ (SniIndicatorActionGroup* self)
{
	gboolean result;
	g_action_group_activate_action ((GActionGroup*) self, "app.quit", NULL);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda5__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda5_ ((SniIndicatorActionGroup*) self);
	return result;
}

static void
sni_indicator_action_group_activate_quit (SniIndicatorActionGroup* self,
                                          GSimpleAction* action,
                                          GVariant* parameter)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda5__gsource_func, g_object_ref (self), g_object_unref);
}

SniIndicatorActionGroup*
sni_indicator_action_group_construct (GType object_type)
{
	SniIndicatorActionGroup * self = NULL;
	self = (SniIndicatorActionGroup*) g_object_new (object_type, NULL);
	return self;
}

SniIndicatorActionGroup*
sni_indicator_action_group_new (void)
{
	return sni_indicator_action_group_construct (SNI_TYPE_INDICATOR_ACTION_GROUP);
}

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

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static void
_sni_indicator_action_group_activate_quit_g_simple_action_activate (GSimpleAction* _sender,
                                                                    GVariant* parameter,
                                                                    gpointer self)
{
	sni_indicator_action_group_activate_quit ((SniIndicatorActionGroup*) self, _sender, parameter);
}

static GObject *
sni_indicator_action_group_constructor (GType type,
                                        guint n_construct_properties,
                                        GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SniIndicatorActionGroup * self;
	GApplication* _tmp0_;
	GActionGroup* _tmp1_;
	FtTimerActionGroup* _tmp2_;
	FtSessionManagerActionGroup* _tmp3_;
	GHashFunc _tmp4_;
	GEqualFunc _tmp5_;
	GHashTable* _tmp6_;
	GSimpleAction* quit_action = NULL;
	GSimpleAction* _tmp7_;
	GSimpleAction* _tmp8_;
	GSimpleAction* _tmp9_;
	parent_class = G_OBJECT_CLASS (sni_indicator_action_group_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SNI_TYPE_INDICATOR_ACTION_GROUP, SniIndicatorActionGroup);
	_tmp0_ = g_application_get_default ();
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, g_action_group_get_type (), GActionGroup));
	_g_object_unref0 (self->priv->application_action_group);
	self->priv->application_action_group = _tmp1_;
	_tmp2_ = ft_timer_action_group_new ();
	_g_object_unref0 (self->priv->timer_action_group);
	self->priv->timer_action_group = (GActionGroup*) _tmp2_;
	_tmp3_ = ft_session_manager_action_group_new ();
	_g_object_unref0 (self->priv->session_manager_action_group);
	self->priv->session_manager_action_group = (GActionGroup*) _tmp3_;
	_tmp4_ = g_str_hash;
	_tmp5_ = g_str_equal;
	_tmp6_ = g_hash_table_new_full (_tmp4_, _tmp5_, _g_free0_, _g_object_unref0_);
	_g_hash_table_unref0 (self->priv->actions);
	self->priv->actions = _tmp6_;
	_tmp7_ = g_simple_action_new ("quit", NULL);
	quit_action = _tmp7_;
	_tmp8_ = quit_action;
	g_signal_connect_object (_tmp8_, "activate", (GCallback) _sni_indicator_action_group_activate_quit_g_simple_action_activate, self, 0);
	_tmp9_ = quit_action;
	sni_indicator_action_group_add_action (self, (GAction*) _tmp9_);
	_g_object_unref0 (quit_action);
	return obj;
}

static void
sni_indicator_action_group_class_init (SniIndicatorActionGroupClass * klass,
                                       gpointer klass_data)
{
	sni_indicator_action_group_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SniIndicatorActionGroup_private_offset);
	G_OBJECT_CLASS (klass)->constructor = sni_indicator_action_group_constructor;
	G_OBJECT_CLASS (klass)->finalize = sni_indicator_action_group_finalize;
}

static void
sni_indicator_action_group_g_action_group_interface_init (GActionGroupInterface * iface,
                                                          gpointer iface_data)
{
	sni_indicator_action_group_g_action_group_parent_iface = g_type_interface_peek_parent (iface);
	iface->activate_action = (void (*) (GActionGroup*, const gchar*, GVariant*)) sni_indicator_action_group_real_activate_action;
	iface->change_action_state = (void (*) (GActionGroup*, const gchar*, GVariant*)) sni_indicator_action_group_real_change_action_state;
	iface->list_actions = (gchar** (*) (GActionGroup*)) sni_indicator_action_group_real_list_actions;
}

static void
sni_indicator_action_group_g_remote_action_group_interface_init (GRemoteActionGroupInterface * iface,
                                                                 gpointer iface_data)
{
	sni_indicator_action_group_g_remote_action_group_parent_iface = g_type_interface_peek_parent (iface);
	iface->activate_action_full = (void (*) (GRemoteActionGroup*, const gchar*, GVariant*, GVariant*)) sni_indicator_action_group_real_activate_action_full;
	iface->change_action_state_full = (void (*) (GRemoteActionGroup*, const gchar*, GVariant*, GVariant*)) sni_indicator_action_group_real_change_action_state_full;
}

static void
sni_indicator_action_group_instance_init (SniIndicatorActionGroup * self,
                                          gpointer klass)
{
	self->priv = sni_indicator_action_group_get_instance_private (self);
	self->priv->application_action_group = NULL;
	self->priv->timer_action_group = NULL;
	self->priv->session_manager_action_group = NULL;
}

static void
sni_indicator_action_group_finalize (GObject * obj)
{
	SniIndicatorActionGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SNI_TYPE_INDICATOR_ACTION_GROUP, SniIndicatorActionGroup);
	_g_object_unref0 (self->priv->application_action_group);
	_g_object_unref0 (self->priv->timer_action_group);
	_g_object_unref0 (self->priv->session_manager_action_group);
	_g_hash_table_unref0 (self->priv->actions);
	G_OBJECT_CLASS (sni_indicator_action_group_parent_class)->finalize (obj);
}

GType
sni_indicator_action_group_get_type (void)
{
	return sni_indicator_action_group_type_id;
}

GType
sni_indicator_action_group_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (SniIndicatorActionGroupClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sni_indicator_action_group_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SniIndicatorActionGroup), 0, (GInstanceInitFunc) sni_indicator_action_group_instance_init, NULL };
	static const GInterfaceInfo g_action_group_info = { (GInterfaceInitFunc) sni_indicator_action_group_g_action_group_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo g_remote_action_group_info = { (GInterfaceInitFunc) sni_indicator_action_group_g_remote_action_group_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	sni_indicator_action_group_type_id = g_type_module_register_type (module, G_TYPE_OBJECT, "SniIndicatorActionGroup", &g_define_type_info, 0);
	g_type_module_add_interface (module, sni_indicator_action_group_type_id, g_action_group_get_type (), &g_action_group_info);
	g_type_module_add_interface (module, sni_indicator_action_group_type_id, g_remote_action_group_get_type (), &g_remote_action_group_info);
	SniIndicatorActionGroup_private_offset = sizeof (SniIndicatorActionGroupPrivate);
	return sni_indicator_action_group_type_id;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

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

