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

/* SPDX-License-Identifier: GPL-3.0-or-later*/

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "graphs.h"
#include <gee.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <adwaita.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

#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block1Data Block1Data;
typedef struct _Block2Data Block2Data;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
typedef struct _Block3Data Block3Data;
typedef struct _Block4Data Block4Data;
#define _g_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (var), NULL)))

struct _Block1Data {
	int _ref_count_;
	GeeArrayList* modes;
	GraphsFigureSettings* figure_settings;
	GraphsApplication* application;
};

struct _Block2Data {
	int _ref_count_;
	Block1Data * _data1_;
	gchar* name;
};

struct _Block3Data {
	int _ref_count_;
	Block1Data * _data1_;
	gchar* mode;
};

struct _Block4Data {
	int _ref_count_;
	Block1Data * _data1_;
	gchar* dir;
	gchar* val;
	GSimpleAction* action;
};

static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void ____lambda13_ (Block2Data* _data2_);
static void _____lambda13__g_simple_action_activate (GSimpleAction* _sender,
                                              GVariant* parameter,
                                              gpointer self);
static void __lambda14_ (Block1Data* _data1_);
static void ___lambda14__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static void ____lambda15_ (Block3Data* _data3_);
static void _____lambda15__g_simple_action_activate (GSimpleAction* _sender,
                                              GVariant* parameter,
                                              gpointer self);
static Block4Data* block4_data_ref (Block4Data* _data4_);
static void block4_data_unref (void * _userdata_);
static void ____lambda16_ (Block4Data* _data4_,
                    GSimpleAction* a,
                    GVariant* target);
static gboolean _vala_string_array_contains (const gchar* * stack,
                                      gssize stack_length,
                                      const const gchar* needle);
static gchar** _vala_array_dup1 (gchar** self,
                          gssize length);
static gchar** _vala_array_dup2 (gchar** self,
                          gssize length);
static void _____lambda16__g_simple_action_activate (GSimpleAction* _sender,
                                              GVariant* parameter,
                                              gpointer self);
static void ____lambda17_ (Block4Data* _data4_);
static void _____lambda17__g_object_notify (GObject* _sender,
                                     GParamSpec* pspec,
                                     gpointer self);
static void __lambda18_ (Block1Data* _data1_,
                  GSimpleAction* a,
                  GVariant* target);
static void ___lambda18__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
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);

const gchar* GRAPHS_X_DIRECTIONS[2] = {"top", "bottom"};
const gchar* GRAPHS_Y_DIRECTIONS[2] = {"left", "right"};
VALA_EXTERN const gchar* GRAPHS_ACTION_NAMES[23];
VALA_EXTERN const gchar* GRAPHS_DIRECTION_NAMES[4];

/**
     * Setup actions.
     *
     * @param application Application
     */
static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

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_->figure_settings);
		_g_object_unref0 (_data1_->modes);
		_g_object_unref0 (_data1_->application);
		g_slice_free (Block1Data, _data1_);
	}
}

static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		_g_free0 (_data2_->name);
		block1_data_unref (_data2_->_data1_);
		_data2_->_data1_ = NULL;
		g_slice_free (Block2Data, _data2_);
	}
}

static void
____lambda13_ (Block2Data* _data2_)
{
	Block1Data* _data1_;
	const gchar* _tmp0_;
	_data1_ = _data2_->_data1_;
	_tmp0_ = _data2_->name;
	g_signal_emit_by_name (_data1_->application, "action-invoked", _tmp0_);
}

static void
_____lambda13__g_simple_action_activate (GSimpleAction* _sender,
                                         GVariant* parameter,
                                         gpointer self)
{
	____lambda13_ (self);
}

static void
__lambda14_ (Block1Data* _data1_)
{
	AdwOverlaySplitView* split_view = NULL;
	GraphsWindow* _tmp0_;
	GraphsWindow* _tmp1_;
	AdwOverlaySplitView* _tmp2_;
	AdwOverlaySplitView* _tmp3_;
	AdwOverlaySplitView* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	_tmp0_ = graphs_application_get_window (_data1_->application);
	_tmp1_ = _tmp0_;
	_tmp2_ = graphs_window_get_split_view (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	split_view = _tmp4_;
	_tmp5_ = adw_overlay_split_view_get_collapsed (split_view);
	_tmp6_ = _tmp5_;
	adw_overlay_split_view_set_collapsed (split_view, !_tmp6_);
	_g_object_unref0 (split_view);
}

static void
___lambda14__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda14_ (self);
}

static Block3Data*
block3_data_ref (Block3Data* _data3_)
{
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}

static void
block3_data_unref (void * _userdata_)
{
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		_g_free0 (_data3_->mode);
		block1_data_unref (_data3_->_data1_);
		_data3_->_data1_ = NULL;
		g_slice_free (Block3Data, _data3_);
	}
}

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
____lambda15_ (Block3Data* _data3_)
{
	Block1Data* _data1_;
	GraphsWindow* _tmp0_;
	GraphsWindow* _tmp1_;
	GraphsCanvas* _tmp2_;
	GraphsCanvas* _tmp3_;
	GeeArrayList* _tmp4_;
	const gchar* _tmp5_;
	_data1_ = _data3_->_data1_;
	_tmp0_ = graphs_application_get_window (_data1_->application);
	_tmp1_ = _tmp0_;
	_tmp2_ = graphs_window_get_canvas (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _data1_->modes;
	_tmp5_ = _data3_->mode;
	graphs_canvas_set_mode (_tmp3_, gee_abstract_list_index_of ((GeeAbstractList*) _tmp4_, _tmp5_));
}

static void
_____lambda15__g_simple_action_activate (GSimpleAction* _sender,
                                         GVariant* parameter,
                                         gpointer self)
{
	____lambda15_ (self);
}

static Block4Data*
block4_data_ref (Block4Data* _data4_)
{
	g_atomic_int_inc (&_data4_->_ref_count_);
	return _data4_;
}

static void
block4_data_unref (void * _userdata_)
{
	Block4Data* _data4_;
	_data4_ = (Block4Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
		_g_object_unref0 (_data4_->action);
		_g_free0 (_data4_->val);
		_g_free0 (_data4_->dir);
		block1_data_unref (_data4_->_data1_);
		_data4_->_data1_ = NULL;
		g_slice_free (Block4Data, _data4_);
	}
}

static gboolean
_vala_string_array_contains (const gchar* * stack,
                             gssize stack_length,
                             const const gchar* needle)
{
	gssize i;
	for (i = 0; i < stack_length; i++) {
		if (g_strcmp0 (stack[i], needle) == 0) {
			return TRUE;
		}
	}
	return FALSE;
}

static gchar**
_vala_array_dup1 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static gchar**
_vala_array_dup2 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static void
____lambda16_ (Block4Data* _data4_,
               GSimpleAction* a,
               GVariant* target)
{
	Block1Data* _data1_;
	gchar** directions = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar** _tmp2_;
	gint directions_length1;
	gint _directions_size_;
	gboolean* visible_axes = NULL;
	GraphsData* _tmp3_;
	GraphsData* _tmp4_;
	gint _tmp5_ = 0;
	gboolean* _tmp6_;
	gint visible_axes_length1;
	gint _visible_axes_size_;
	gboolean _tmp7_ = FALSE;
	const gchar* _tmp8_;
	gboolean _tmp14_ = FALSE;
	const gchar* _tmp15_;
	gchar** _tmp21_;
	gint _tmp21__length1;
	GraphsData* _tmp26_;
	GraphsData* _tmp27_;
	_data1_ = _data4_->_data1_;
	g_return_if_fail (a != NULL);
	_tmp0_ = _data4_->dir;
	_tmp1_ = g_strdup (_tmp0_);
	_tmp2_ = g_new0 (gchar*, 1 + 1);
	_tmp2_[0] = _tmp1_;
	directions = _tmp2_;
	directions_length1 = 1;
	_directions_size_ = directions_length1;
	_tmp3_ = graphs_application_get_data (_data1_->application);
	_tmp4_ = _tmp3_;
	_tmp6_ = graphs_data_get_used_positions (_tmp4_, &_tmp5_);
	visible_axes = _tmp6_;
	visible_axes_length1 = _tmp5_;
	_visible_axes_size_ = visible_axes_length1;
	_tmp8_ = _data4_->dir;
	if (_vala_string_array_contains (GRAPHS_X_DIRECTIONS, G_N_ELEMENTS (GRAPHS_X_DIRECTIONS), _tmp8_)) {
		gboolean* _tmp9_;
		gint _tmp9__length1;
		gboolean _tmp10_;
		gboolean* _tmp11_;
		gint _tmp11__length1;
		gboolean _tmp12_;
		_tmp9_ = visible_axes;
		_tmp9__length1 = visible_axes_length1;
		_tmp10_ = _tmp9_[0];
		_tmp11_ = visible_axes;
		_tmp11__length1 = visible_axes_length1;
		_tmp12_ = _tmp11_[1];
		_tmp7_ = _tmp10_ ^ _tmp12_;
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		gchar** _tmp13_;
		gint _tmp13__length1;
		_tmp13_ = _vala_array_dup1 (GRAPHS_X_DIRECTIONS, G_N_ELEMENTS (GRAPHS_X_DIRECTIONS));
		_tmp13__length1 = G_N_ELEMENTS (GRAPHS_X_DIRECTIONS);
		directions = (_vala_array_free (directions, directions_length1, (GDestroyNotify) g_free), NULL);
		directions = _tmp13_;
		directions_length1 = _tmp13__length1;
		_directions_size_ = directions_length1;
	}
	_tmp15_ = _data4_->dir;
	if (_vala_string_array_contains (GRAPHS_Y_DIRECTIONS, G_N_ELEMENTS (GRAPHS_Y_DIRECTIONS), _tmp15_)) {
		gboolean* _tmp16_;
		gint _tmp16__length1;
		gboolean _tmp17_;
		gboolean* _tmp18_;
		gint _tmp18__length1;
		gboolean _tmp19_;
		_tmp16_ = visible_axes;
		_tmp16__length1 = visible_axes_length1;
		_tmp17_ = _tmp16_[2];
		_tmp18_ = visible_axes;
		_tmp18__length1 = visible_axes_length1;
		_tmp19_ = _tmp18_[3];
		_tmp14_ = _tmp17_ ^ _tmp19_;
	} else {
		_tmp14_ = FALSE;
	}
	if (_tmp14_) {
		gchar** _tmp20_;
		gint _tmp20__length1;
		_tmp20_ = _vala_array_dup2 (GRAPHS_Y_DIRECTIONS, G_N_ELEMENTS (GRAPHS_Y_DIRECTIONS));
		_tmp20__length1 = G_N_ELEMENTS (GRAPHS_Y_DIRECTIONS);
		directions = (_vala_array_free (directions, directions_length1, (GDestroyNotify) g_free), NULL);
		directions = _tmp20_;
		directions_length1 = _tmp20__length1;
		_directions_size_ = directions_length1;
	}
	_tmp21_ = directions;
	_tmp21__length1 = directions_length1;
	{
		gchar** target_dir_collection = NULL;
		gint target_dir_collection_length1 = 0;
		gint _target_dir_collection_size_ = 0;
		gint target_dir_it = 0;
		target_dir_collection = _tmp21_;
		target_dir_collection_length1 = _tmp21__length1;
		for (target_dir_it = 0; target_dir_it < target_dir_collection_length1; target_dir_it = target_dir_it + 1) {
			gchar* _tmp22_;
			gchar* target_dir = NULL;
			_tmp22_ = g_strdup (target_dir_collection[target_dir_it]);
			target_dir = _tmp22_;
			{
				GraphsFigureSettings* _tmp23_;
				const gchar* _tmp24_;
				const gchar* _tmp25_;
				_tmp23_ = _data1_->figure_settings;
				_tmp24_ = _data4_->val;
				_tmp25_ = g_variant_get_string (target, NULL);
				g_object_set ((GObject*) _tmp23_, _tmp24_, atoi (_tmp25_), NULL);
				_g_free0 (target_dir);
			}
		}
	}
	_tmp26_ = graphs_application_get_data (_data1_->application);
	_tmp27_ = _tmp26_;
	g_signal_emit_by_name (_tmp27_, "add-history-state-request");
	visible_axes = (g_free (visible_axes), NULL);
	directions = (_vala_array_free (directions, directions_length1, (GDestroyNotify) g_free), NULL);
}

static void
_____lambda16__g_simple_action_activate (GSimpleAction* _sender,
                                         GVariant* parameter,
                                         gpointer self)
{
	____lambda16_ (self, _sender, parameter);
}

static void
____lambda17_ (Block4Data* _data4_)
{
	Block1Data* _data1_;
	gint scale = 0;
	GraphsFigureSettings* _tmp0_;
	const gchar* _tmp1_;
	gint _tmp2_ = 0;
	GSimpleAction* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GVariant* _tmp6_;
	GVariant* _tmp7_;
	_data1_ = _data4_->_data1_;
	_tmp0_ = _data1_->figure_settings;
	_tmp1_ = _data4_->val;
	g_object_get ((GObject*) _tmp0_, _tmp1_, &_tmp2_, NULL);
	scale = _tmp2_;
	_tmp3_ = _data4_->action;
	_tmp4_ = g_strdup_printf ("%i", scale);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_variant_new_string (_tmp5_);
	g_variant_ref_sink (_tmp6_);
	_tmp7_ = _tmp6_;
	g_simple_action_set_state (_tmp3_, _tmp7_);
	_g_variant_unref0 (_tmp7_);
	_g_free0 (_tmp5_);
}

static void
_____lambda17__g_object_notify (GObject* _sender,
                                GParamSpec* pspec,
                                gpointer self)
{
	____lambda17_ (self);
}

static void
__lambda18_ (Block1Data* _data1_,
             GSimpleAction* a,
             GVariant* target)
{
	const gchar* _tmp0_;
	g_return_if_fail (a != NULL);
	_tmp0_ = g_variant_get_string (target, NULL);
	g_signal_emit_by_name (_data1_->application, "operation-invoked", _tmp0_);
}

static void
___lambda18__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda18_ (self, _sender, parameter);
}

void
graphs_setup_actions (GraphsApplication* application)
{
	Block1Data* _data1_;
	GraphsApplication* _tmp0_;
	gchar* _tmp6_;
	gchar** _tmp7_;
	gchar** _tmp8_;
	gint _tmp8__length1;
	GSimpleAction* toggle_sidebar_action = NULL;
	GVariant* _tmp9_;
	GVariant* _tmp10_;
	GSimpleAction* _tmp11_;
	GSimpleAction* _tmp12_;
	GSimpleAction* _tmp13_;
	GSimpleAction* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar** _tmp18_;
	GeeArrayList* _tmp19_;
	GSettings* settings = NULL;
	GSettings* _tmp36_;
	GraphsData* _tmp37_;
	GraphsData* _tmp38_;
	GraphsFigureSettings* _tmp39_;
	GraphsFigureSettings* _tmp40_;
	GraphsFigureSettings* _tmp41_;
	gchar** settings_actions = NULL;
	gchar* _tmp65_;
	gchar* _tmp66_;
	gchar** _tmp67_;
	gint settings_actions_length1;
	gint _settings_actions_size_;
	GSettings* actions_settings = NULL;
	GSettings* _tmp68_;
	GSettings* _tmp69_;
	GSettings* _tmp70_;
	gchar** _tmp71_;
	gint _tmp71__length1;
	GSimpleAction* operation_action = NULL;
	GVariantType* _tmp77_;
	GVariantType* _tmp78_;
	GSimpleAction* _tmp79_;
	GSimpleAction* _tmp80_;
	g_return_if_fail (application != NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (application);
	_g_object_unref0 (_data1_->application);
	_data1_->application = _tmp0_;
	{
		const gchar** name_collection = NULL;
		gint name_collection_length1 = 0;
		gint _name_collection_size_ = 0;
		gint name_it = 0;
		name_collection = GRAPHS_ACTION_NAMES;
		name_collection_length1 = G_N_ELEMENTS (GRAPHS_ACTION_NAMES);
		for (name_it = 0; name_it < name_collection_length1; name_it = name_it + 1) {
			gchar* _tmp1_;
			gchar* name = NULL;
			_tmp1_ = g_strdup (name_collection[name_it]);
			name = _tmp1_;
			{
				Block2Data* _data2_;
				GSimpleAction* action = NULL;
				const gchar* _tmp2_;
				GSimpleAction* _tmp3_;
				GSimpleAction* _tmp4_;
				GSimpleAction* _tmp5_;
				_data2_ = g_slice_new0 (Block2Data);
				_data2_->_ref_count_ = 1;
				_data2_->_data1_ = block1_data_ref (_data1_);
				_data2_->name = name;
				_tmp2_ = _data2_->name;
				_tmp3_ = g_simple_action_new (_tmp2_, NULL);
				action = _tmp3_;
				_tmp4_ = action;
				g_signal_connect_data (_tmp4_, "activate", (GCallback) _____lambda13__g_simple_action_activate, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
				_tmp5_ = action;
				g_action_map_add_action ((GActionMap*) _data1_->application, (GAction*) _tmp5_);
				_g_object_unref0 (action);
				block2_data_unref (_data2_);
				_data2_ = NULL;
			}
		}
	}
	_tmp6_ = g_strdup ("F1");
	_tmp7_ = g_new0 (gchar*, 1 + 1);
	_tmp7_[0] = _tmp6_;
	_tmp8_ = _tmp7_;
	_tmp8__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) _data1_->application, "app.help", _tmp8_);
	_tmp8_ = (_vala_array_free (_tmp8_, _tmp8__length1, (GDestroyNotify) g_free), NULL);
	_tmp9_ = g_variant_new_boolean (TRUE);
	g_variant_ref_sink (_tmp9_);
	_tmp10_ = _tmp9_;
	_tmp11_ = g_simple_action_new_stateful ("toggle_sidebar", NULL, _tmp10_);
	_tmp12_ = _tmp11_;
	_g_variant_unref0 (_tmp10_);
	toggle_sidebar_action = _tmp12_;
	_tmp13_ = toggle_sidebar_action;
	g_signal_connect_data (_tmp13_, "activate", (GCallback) ___lambda14__g_simple_action_activate, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	_tmp14_ = toggle_sidebar_action;
	g_action_map_add_action ((GActionMap*) _data1_->application, (GAction*) _tmp14_);
	_tmp15_ = g_strdup ("pan");
	_tmp16_ = g_strdup ("zoom");
	_tmp17_ = g_strdup ("select");
	_tmp18_ = g_new0 (gchar*, 3 + 1);
	_tmp18_[0] = _tmp15_;
	_tmp18_[1] = _tmp16_;
	_tmp18_[2] = _tmp17_;
	_tmp19_ = gee_array_list_new_wrap (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp18_, 3, NULL, NULL, NULL);
	_data1_->modes = _tmp19_;
	{
		GeeArrayList* _mode_list = NULL;
		GeeArrayList* _tmp20_;
		gint _mode_size = 0;
		GeeArrayList* _tmp21_;
		gint _tmp22_;
		gint _tmp23_;
		gint _mode_index = 0;
		_tmp20_ = _data1_->modes;
		_mode_list = _tmp20_;
		_tmp21_ = _mode_list;
		_tmp22_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp21_);
		_tmp23_ = _tmp22_;
		_mode_size = _tmp23_;
		_mode_index = -1;
		while (TRUE) {
			Block3Data* _data3_;
			gint _tmp24_;
			gint _tmp25_;
			GeeArrayList* _tmp26_;
			gpointer _tmp27_;
			GSimpleAction* action = NULL;
			const gchar* _tmp28_;
			const gchar* _tmp29_;
			gchar* _tmp30_;
			gchar* _tmp31_;
			GSimpleAction* _tmp32_;
			GSimpleAction* _tmp33_;
			GSimpleAction* _tmp34_;
			GSimpleAction* _tmp35_;
			_data3_ = g_slice_new0 (Block3Data);
			_data3_->_ref_count_ = 1;
			_data3_->_data1_ = block1_data_ref (_data1_);
			_mode_index = _mode_index + 1;
			_tmp24_ = _mode_index;
			_tmp25_ = _mode_size;
			if (!(_tmp24_ < _tmp25_)) {
				block3_data_unref (_data3_);
				_data3_ = NULL;
				break;
			}
			_tmp26_ = _mode_list;
			_tmp27_ = gee_abstract_list_get ((GeeAbstractList*) _tmp26_, _mode_index);
			_data3_->mode = (gchar*) _tmp27_;
			_tmp28_ = _data3_->mode;
			_tmp29_ = string_to_string (_tmp28_);
			_tmp30_ = g_strconcat ("mode_", _tmp29_, NULL);
			_tmp31_ = _tmp30_;
			_tmp32_ = g_simple_action_new (_tmp31_, NULL);
			_tmp33_ = _tmp32_;
			_g_free0 (_tmp31_);
			action = _tmp33_;
			_tmp34_ = action;
			g_signal_connect_data (_tmp34_, "activate", (GCallback) _____lambda15__g_simple_action_activate, block3_data_ref (_data3_), (GClosureNotify) block3_data_unref, 0);
			_tmp35_ = action;
			g_action_map_add_action ((GActionMap*) _data1_->application, (GAction*) _tmp35_);
			_g_object_unref0 (action);
			block3_data_unref (_data3_);
			_data3_ = NULL;
		}
	}
	_tmp36_ = graphs_application_get_settings_child (_data1_->application, "figure");
	settings = _tmp36_;
	_tmp37_ = graphs_application_get_data (_data1_->application);
	_tmp38_ = _tmp37_;
	_tmp39_ = graphs_data_get_figure_settings (_tmp38_);
	_tmp40_ = _tmp39_;
	_tmp41_ = _g_object_ref0 (_tmp40_);
	_data1_->figure_settings = _tmp41_;
	{
		const gchar** dir_collection = NULL;
		gint dir_collection_length1 = 0;
		gint _dir_collection_size_ = 0;
		gint dir_it = 0;
		dir_collection = GRAPHS_DIRECTION_NAMES;
		dir_collection_length1 = G_N_ELEMENTS (GRAPHS_DIRECTION_NAMES);
		for (dir_it = 0; dir_it < dir_collection_length1; dir_it = dir_it + 1) {
			gchar* _tmp42_;
			gchar* dir = NULL;
			_tmp42_ = g_strdup (dir_collection[dir_it]);
			dir = _tmp42_;
			{
				Block4Data* _data4_;
				const gchar* _tmp43_;
				const gchar* _tmp44_;
				gchar* _tmp45_;
				const gchar* _tmp46_;
				const gchar* _tmp47_;
				gchar* _tmp48_;
				gchar* _tmp49_;
				GVariantType* _tmp50_;
				GVariantType* _tmp51_;
				GSettings* _tmp52_;
				const gchar* _tmp53_;
				gchar* _tmp54_;
				gchar* _tmp55_;
				GVariant* _tmp56_;
				GVariant* _tmp57_;
				GSimpleAction* _tmp58_;
				GSimpleAction* _tmp59_;
				GSimpleAction* _tmp60_;
				GraphsFigureSettings* _tmp61_;
				const gchar* _tmp62_;
				gchar* _tmp63_;
				GSimpleAction* _tmp64_;
				_data4_ = g_slice_new0 (Block4Data);
				_data4_->_ref_count_ = 1;
				_data4_->_data1_ = block1_data_ref (_data1_);
				_data4_->dir = dir;
				_tmp43_ = _data4_->dir;
				_tmp44_ = string_to_string (_tmp43_);
				_tmp45_ = g_strconcat (_tmp44_, "-scale", NULL);
				_data4_->val = _tmp45_;
				_tmp46_ = _data4_->val;
				_tmp47_ = string_to_string (_tmp46_);
				_tmp48_ = g_strconcat ("change-", _tmp47_, NULL);
				_tmp49_ = _tmp48_;
				_tmp50_ = g_variant_type_new ("s");
				_tmp51_ = _tmp50_;
				_tmp52_ = settings;
				_tmp53_ = _data4_->val;
				_tmp54_ = g_strdup_printf ("%i", g_settings_get_enum (_tmp52_, _tmp53_));
				_tmp55_ = _tmp54_;
				_tmp56_ = g_variant_new_string (_tmp55_);
				g_variant_ref_sink (_tmp56_);
				_tmp57_ = _tmp56_;
				_tmp58_ = g_simple_action_new_stateful (_tmp49_, _tmp51_, _tmp57_);
				_tmp59_ = _tmp58_;
				_g_variant_unref0 (_tmp57_);
				_g_free0 (_tmp55_);
				_g_variant_type_free0 (_tmp51_);
				_g_free0 (_tmp49_);
				_data4_->action = _tmp59_;
				_tmp60_ = _data4_->action;
				g_signal_connect_data (_tmp60_, "activate", (GCallback) _____lambda16__g_simple_action_activate, block4_data_ref (_data4_), (GClosureNotify) block4_data_unref, 0);
				_tmp61_ = _data1_->figure_settings;
				_tmp62_ = _data4_->val;
				_tmp63_ = g_strconcat ("notify::", _tmp62_, NULL);
				g_signal_connect_data ((GObject*) _tmp61_, _tmp63_, (GCallback) _____lambda17__g_object_notify, block4_data_ref (_data4_), (GClosureNotify) block4_data_unref, 0);
				_g_free0 (_tmp63_);
				_tmp64_ = _data4_->action;
				g_action_map_add_action ((GActionMap*) _data1_->application, (GAction*) _tmp64_);
				block4_data_unref (_data4_);
				_data4_ = NULL;
			}
		}
	}
	_tmp65_ = g_strdup ("center");
	_tmp66_ = g_strdup ("smoothen");
	_tmp67_ = g_new0 (gchar*, 2 + 1);
	_tmp67_[0] = _tmp65_;
	_tmp67_[1] = _tmp66_;
	settings_actions = _tmp67_;
	settings_actions_length1 = 2;
	_settings_actions_size_ = settings_actions_length1;
	_tmp68_ = graphs_application_get_settings (_data1_->application);
	_tmp69_ = _tmp68_;
	_tmp70_ = g_settings_get_child (_tmp69_, "actions");
	actions_settings = _tmp70_;
	_tmp71_ = settings_actions;
	_tmp71__length1 = settings_actions_length1;
	{
		gchar** settings_action_collection = NULL;
		gint settings_action_collection_length1 = 0;
		gint _settings_action_collection_size_ = 0;
		gint settings_action_it = 0;
		settings_action_collection = _tmp71_;
		settings_action_collection_length1 = _tmp71__length1;
		for (settings_action_it = 0; settings_action_it < settings_action_collection_length1; settings_action_it = settings_action_it + 1) {
			gchar* _tmp72_;
			gchar* settings_action = NULL;
			_tmp72_ = g_strdup (settings_action_collection[settings_action_it]);
			settings_action = _tmp72_;
			{
				GSettings* _tmp73_;
				const gchar* _tmp74_;
				GAction* _tmp75_;
				GAction* _tmp76_;
				_tmp73_ = actions_settings;
				_tmp74_ = settings_action;
				_tmp75_ = g_settings_create_action (_tmp73_, _tmp74_);
				_tmp76_ = _tmp75_;
				g_action_map_add_action ((GActionMap*) _data1_->application, _tmp76_);
				_g_object_unref0 (_tmp76_);
				_g_free0 (settings_action);
			}
		}
	}
	_tmp77_ = g_variant_type_new ("s");
	_tmp78_ = _tmp77_;
	_tmp79_ = g_simple_action_new ("app.perform_operation", _tmp78_);
	_tmp80_ = _tmp79_;
	_g_variant_type_free0 (_tmp78_);
	operation_action = _tmp80_;
	g_signal_connect_data (operation_action, "activate", (GCallback) ___lambda18__g_simple_action_activate, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	g_action_map_add_action ((GActionMap*) _data1_->application, (GAction*) operation_action);
	_g_object_unref0 (operation_action);
	_g_object_unref0 (actions_settings);
	settings_actions = (_vala_array_free (settings_actions, settings_actions_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (settings);
	_g_object_unref0 (toggle_sidebar_action);
	block1_data_unref (_data1_);
	_data1_ = NULL;
}

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);
}

