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

typedef struct _Block16Data Block16Data;
#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_bytes_unref0(var) ((var == NULL) ? NULL : (var = (g_bytes_unref (var), NULL)))
typedef struct _Block17Data Block17Data;
typedef struct _Block18Data Block18Data;
#define _g_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (var), NULL)))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))
typedef struct _Block19Data Block19Data;

struct _Block16Data {
	int _ref_count_;
	GraphsApplication* application;
};

struct _Block17Data {
	int _ref_count_;
	GraphsData* data;
	GeeArrayList* modes;
	GraphsWindow* window;
};

struct _Block18Data {
	int _ref_count_;
	Block17Data * _data17_;
	gchar* current_mode;
};

struct _Block19Data {
	int _ref_count_;
	Block17Data * _data17_;
	GtkFileDialog* dialog;
};

static Block16Data* block16_data_ref (Block16Data* _data16_);
static void block16_data_unref (void * _userdata_);
static void _graphs_application_quit_action_g_simple_action_activate (GSimpleAction* _sender,
                                                               GVariant* parameter,
                                                               gpointer self);
static void __lambda71_ (Block16Data* _data16_);
static void ___lambda71__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda72_ (Block16Data* _data16_);
static void ___lambda72__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda73_ (Block16Data* _data16_);
static void ___lambda73__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda74_ (Block16Data* _data16_);
static void ___lambda74__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static Block17Data* block17_data_ref (Block17Data* _data17_);
static void block17_data_unref (void * _userdata_);
static void __lambda42_ (Block17Data* _data17_);
static void ___lambda42__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static Block18Data* block18_data_ref (Block18Data* _data18_);
static void block18_data_unref (void * _userdata_);
static void ____lambda43_ (Block18Data* _data18_);
static void _____lambda43__g_simple_action_activate (GSimpleAction* _sender,
                                              GVariant* parameter,
                                              gpointer self);
static void __lambda44_ (Block17Data* _data17_,
                  GSimpleAction* a,
                  GVariant* target);
static void ___lambda44__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda45_ (Block17Data* _data17_);
static void ___lambda45__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda46_ (Block17Data* _data17_);
static void ___lambda46__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda47_ (Block17Data* _data17_);
static void ___lambda47__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda48_ (Block17Data* _data17_);
static void ___lambda48__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda49_ (Block17Data* _data17_);
static void ___lambda49__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda50_ (Block17Data* _data17_);
static void ___lambda50__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda51_ (Block17Data* _data17_);
static void ___lambda51__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda52_ (Block17Data* _data17_);
static void ___lambda52__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda53_ (Block17Data* _data17_);
static void _vala_array_add1 (GraphsItem** * array,
                       gint* length,
                       gint* size,
                       GraphsItem* value);
static void ___lambda53__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda54_ (Block17Data* _data17_);
static void ___lambda54__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda55_ (Block17Data* _data17_);
static void ___lambda55__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda56_ (Block17Data* _data17_);
static void ___lambda56__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda57_ (Block17Data* _data17_);
static void ___lambda57__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda60_ (Block17Data* _data17_);
static Block19Data* block19_data_ref (Block19Data* _data19_);
static void block19_data_unref (void * _userdata_);
static void __lambda61_ (Block19Data* _data19_,
                  GObject* d,
                  GAsyncResult* response);
static void ___lambda61__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void ___lambda60__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda62_ (Block17Data* _data17_);
static void ___lambda62__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda65_ (Block17Data* _data17_);
static void ___lambda65__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda66_ (Block17Data* _data17_);
static void ___lambda66__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda67_ (Block17Data* _data17_);
static void ___lambda67__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda68_ (Block17Data* _data17_);
static void ___lambda68__g_simple_action_activate (GSimpleAction* _sender,
                                            GVariant* parameter,
                                            gpointer self);
static void __lambda70_ (Block17Data* _data17_);
static void ___lambda70__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);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static Block16Data*
block16_data_ref (Block16Data* _data16_)
{
	g_atomic_int_inc (&_data16_->_ref_count_);
	return _data16_;
}

static void
block16_data_unref (void * _userdata_)
{
	Block16Data* _data16_;
	_data16_ = (Block16Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data16_->_ref_count_)) {
		_g_object_unref0 (_data16_->application);
		g_slice_free (Block16Data, _data16_);
	}
}

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

static void
_graphs_application_quit_action_g_simple_action_activate (GSimpleAction* _sender,
                                                          GVariant* parameter,
                                                          gpointer self)
{
	graphs_application_quit_action ((GraphsApplication*) self);
}

static void
__lambda71_ (Block16Data* _data16_)
{
	GFile* file = NULL;
	GFile* _tmp0_;
	gchar* release_notes = NULL;
	AdwAboutDialog* dialog = NULL;
	gchar* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar** _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gchar** _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	const gchar* _tmp26_;
	gchar* _tmp27_;
	AdwAboutDialog* _tmp28_ = NULL;
	GtkWindow* _tmp29_;
	GtkWindow* _tmp30_;
	GError* _inner_error0_ = NULL;
	_tmp0_ = g_file_new_for_uri ("resource:///se/sjoerd/Graphs/whats_new");
	file = _tmp0_;
	{
		GBytes* _tmp1_ = NULL;
		GBytes* _tmp2_;
		gsize _tmp3_ = 0;
		guint8* _tmp4_;
		gchar* _tmp5_;
		_tmp2_ = g_file_load_bytes (file, NULL, NULL, &_inner_error0_);
		_tmp1_ = _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp4_ = g_bytes_get_data (_tmp1_, &_tmp3_);
		_tmp5_ = g_strdup ((const gchar*) _tmp4_);
		_g_free0 (release_notes);
		release_notes = _tmp5_;
		_g_bytes_unref0 (_tmp1_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		gchar* _tmp6_;
		g_clear_error (&_inner_error0_);
		_tmp6_ = g_strdup ("");
		_g_free0 (release_notes);
		release_notes = _tmp6_;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (release_notes);
		_g_object_unref0 (file);
		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;
	}
	_tmp7_ = g_strdup (_ ("Graphs"));
	_tmp8_ = g_application_get_application_id ((GApplication*) _data16_->application);
	_tmp9_ = _tmp8_;
	_tmp10_ = g_strdup (_tmp9_);
	_tmp11_ = g_strdup (HOMEPAGE_URL);
	_tmp12_ = g_strdup (_ ("The Graphs Developers"));
	_tmp13_ = g_strdup (ISSUE_URL);
	_tmp14_ = g_application_get_version ((GApplication*) _data16_->application);
	_tmp15_ = _tmp14_;
	_tmp16_ = g_strdup (_tmp15_);
	_tmp17_ = g_strdup ("Sjoerd Stendahl <contact@sjoerd.se>");
	_tmp18_ = g_strdup ("Christoph Matthias Kohnen <mail@cmkohnen.de>");
	_tmp19_ = g_new0 (gchar*, 2 + 1);
	_tmp19_[0] = _tmp17_;
	_tmp19_[1] = _tmp18_;
	_tmp20_ = g_strdup ("Sjoerd Stendahl <contact@sjoerd.se>");
	_tmp21_ = g_strdup ("Christoph Matthias Kohnen <mail@cmkohnen.de>");
	_tmp22_ = g_strdup ("Tobias Bernard <tbernard@gnome.org>");
	_tmp23_ = g_new0 (gchar*, 3 + 1);
	_tmp23_[0] = _tmp20_;
	_tmp23_[1] = _tmp21_;
	_tmp23_[2] = _tmp22_;
	_tmp24_ = g_strdup ("© " COPYRIGHT);
	_tmp25_ = g_strdup (_ ("translator-credits"));
	_tmp26_ = release_notes;
	_tmp27_ = g_strdup (_tmp26_);
	_tmp28_ = (AdwAboutDialog*) adw_about_dialog_new ();
	adw_about_dialog_set_application_name (_tmp28_, _tmp7_);
	_g_free0 (_tmp7_);
	adw_about_dialog_set_application_icon (_tmp28_, _tmp10_);
	_g_free0 (_tmp10_);
	adw_about_dialog_set_website (_tmp28_, _tmp11_);
	_g_free0 (_tmp11_);
	adw_about_dialog_set_developer_name (_tmp28_, _tmp12_);
	_g_free0 (_tmp12_);
	adw_about_dialog_set_issue_url (_tmp28_, _tmp13_);
	_g_free0 (_tmp13_);
	adw_about_dialog_set_version (_tmp28_, _tmp16_);
	_g_free0 (_tmp16_);
	adw_about_dialog_set_developers (_tmp28_, _tmp19_);
	_tmp19_ = (_vala_array_free (_tmp19_, 2, (GDestroyNotify) g_free), NULL);
	adw_about_dialog_set_designers (_tmp28_, _tmp23_);
	_tmp23_ = (_vala_array_free (_tmp23_, 3, (GDestroyNotify) g_free), NULL);
	adw_about_dialog_set_copyright (_tmp28_, _tmp24_);
	_g_free0 (_tmp24_);
	adw_about_dialog_set_license_type (_tmp28_, GTK_LICENSE_GPL_3_0);
	adw_about_dialog_set_translator_credits (_tmp28_, _tmp25_);
	_g_free0 (_tmp25_);
	adw_about_dialog_set_release_notes (_tmp28_, _tmp27_);
	_g_free0 (_tmp27_);
	g_object_ref_sink (_tmp28_);
	dialog = _tmp28_;
	_tmp29_ = gtk_application_get_active_window ((GtkApplication*) _data16_->application);
	_tmp30_ = _tmp29_;
	adw_dialog_present ((AdwDialog*) dialog, (GtkWidget*) _tmp30_);
	_g_object_unref0 (dialog);
	_g_free0 (release_notes);
	_g_object_unref0 (file);
}

static void
___lambda71__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda71_ (self);
}

static void
__lambda72_ (Block16Data* _data16_)
{
	GError* _inner_error0_ = NULL;
	{
		GtkWindow* _tmp0_;
		GtkWindow* _tmp1_;
		GdkDisplay* _tmp2_;
		GdkAppLaunchContext* _tmp3_;
		GdkAppLaunchContext* _tmp4_;
		_tmp0_ = gtk_application_get_active_window ((GtkApplication*) _data16_->application);
		_tmp1_ = _tmp0_;
		_tmp2_ = gtk_root_get_display ((GtkRoot*) _tmp1_);
		_tmp3_ = gdk_display_get_app_launch_context (_tmp2_);
		_tmp4_ = _tmp3_;
		g_app_info_launch_default_for_uri ("help:graphs", (GAppLaunchContext*) _tmp4_, &_inner_error0_);
		_g_object_unref0 (_tmp4_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__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
___lambda72__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda72_ (self);
}

static void
__lambda73_ (Block16Data* _data16_)
{
	GraphsWindow* window = NULL;
	GraphsWindow* _tmp0_;
	_tmp0_ = graphs_application_create_main_window (_data16_->application);
	window = _tmp0_;
	gtk_window_present ((GtkWindow*) window);
	_g_object_unref0 (window);
}

static void
___lambda73__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda73_ (self);
}

static void
__lambda74_ (Block16Data* _data16_)
{
	GraphsStyleEditor* style_editor = NULL;
	GraphsStyleEditor* _tmp0_;
	_tmp0_ = graphs_application_create_style_editor (_data16_->application);
	style_editor = _tmp0_;
	gtk_window_present ((GtkWindow*) style_editor);
	_g_object_unref0 (style_editor);
}

static void
___lambda74__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda74_ (self);
}

void
graphs_actions_setup_global (void)
{
	Block16Data* _data16_;
	GApplication* _tmp0_;
	GraphsApplication* _tmp1_;
	GSimpleAction* quit_action = NULL;
	GSimpleAction* _tmp2_;
	gchar* _tmp3_;
	gchar** _tmp4_;
	gchar** _tmp5_;
	gint _tmp5__length1;
	GSimpleAction* about_action = NULL;
	GSimpleAction* _tmp6_;
	GSimpleAction* help_action = NULL;
	GSimpleAction* _tmp7_;
	gchar* _tmp8_;
	gchar** _tmp9_;
	gchar** _tmp10_;
	gint _tmp10__length1;
	GSimpleAction* new_window_action = NULL;
	GSimpleAction* _tmp11_;
	GSimpleAction* style_editor_action = NULL;
	GSimpleAction* _tmp12_;
	_data16_ = g_slice_new0 (Block16Data);
	_data16_->_ref_count_ = 1;
	_tmp0_ = g_application_get_default ();
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GRAPHS_TYPE_APPLICATION, GraphsApplication));
	_data16_->application = _tmp1_;
	_tmp2_ = g_simple_action_new ("quit", NULL);
	quit_action = _tmp2_;
	g_signal_connect_object (quit_action, "activate", (GCallback) _graphs_application_quit_action_g_simple_action_activate, _data16_->application, 0);
	g_action_map_add_action ((GActionMap*) _data16_->application, (GAction*) quit_action);
	_tmp3_ = g_strdup ("<control>q");
	_tmp4_ = g_new0 (gchar*, 1 + 1);
	_tmp4_[0] = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp5__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) _data16_->application, "app.quit", _tmp5_);
	_tmp5_ = (_vala_array_free (_tmp5_, _tmp5__length1, (GDestroyNotify) g_free), NULL);
	_tmp6_ = g_simple_action_new ("about", NULL);
	about_action = _tmp6_;
	g_signal_connect_data (about_action, "activate", (GCallback) ___lambda71__g_simple_action_activate, block16_data_ref (_data16_), (GClosureNotify) block16_data_unref, 0);
	g_action_map_add_action ((GActionMap*) _data16_->application, (GAction*) about_action);
	_tmp7_ = g_simple_action_new ("help", NULL);
	help_action = _tmp7_;
	g_signal_connect_data (help_action, "activate", (GCallback) ___lambda72__g_simple_action_activate, block16_data_ref (_data16_), (GClosureNotify) block16_data_unref, 0);
	g_action_map_add_action ((GActionMap*) _data16_->application, (GAction*) help_action);
	_tmp8_ = g_strdup ("F1");
	_tmp9_ = g_new0 (gchar*, 1 + 1);
	_tmp9_[0] = _tmp8_;
	_tmp10_ = _tmp9_;
	_tmp10__length1 = 1;
	gtk_application_set_accels_for_action ((GtkApplication*) _data16_->application, "app.help", _tmp10_);
	_tmp10_ = (_vala_array_free (_tmp10_, _tmp10__length1, (GDestroyNotify) g_free), NULL);
	_tmp11_ = g_simple_action_new ("new-window", NULL);
	new_window_action = _tmp11_;
	g_signal_connect_data (new_window_action, "activate", (GCallback) ___lambda73__g_simple_action_activate, block16_data_ref (_data16_), (GClosureNotify) block16_data_unref, 0);
	g_action_map_add_action ((GActionMap*) _data16_->application, (GAction*) new_window_action);
	_tmp12_ = g_simple_action_new ("style-editor", NULL);
	style_editor_action = _tmp12_;
	g_signal_connect_data (style_editor_action, "activate", (GCallback) ___lambda74__g_simple_action_activate, block16_data_ref (_data16_), (GClosureNotify) block16_data_unref, 0);
	g_action_map_add_action ((GActionMap*) _data16_->application, (GAction*) style_editor_action);
	_g_object_unref0 (style_editor_action);
	_g_object_unref0 (new_window_action);
	_g_object_unref0 (help_action);
	_g_object_unref0 (about_action);
	_g_object_unref0 (quit_action);
	block16_data_unref (_data16_);
	_data16_ = NULL;
}

static Block17Data*
block17_data_ref (Block17Data* _data17_)
{
	g_atomic_int_inc (&_data17_->_ref_count_);
	return _data17_;
}

static void
block17_data_unref (void * _userdata_)
{
	Block17Data* _data17_;
	_data17_ = (Block17Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data17_->_ref_count_)) {
		_g_object_unref0 (_data17_->modes);
		_g_object_unref0 (_data17_->data);
		_g_object_unref0 (_data17_->window);
		g_slice_free (Block17Data, _data17_);
	}
}

static void
__lambda42_ (Block17Data* _data17_)
{
	AdwOverlaySplitView* split_view = NULL;
	AdwOverlaySplitView* _tmp0_;
	AdwOverlaySplitView* _tmp1_;
	AdwOverlaySplitView* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	_tmp0_ = graphs_window_get_overlay_split_view (_data17_->window);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	split_view = _tmp2_;
	_tmp3_ = adw_overlay_split_view_get_show_sidebar (split_view);
	_tmp4_ = _tmp3_;
	adw_overlay_split_view_set_show_sidebar (split_view, !_tmp4_);
	_g_object_unref0 (split_view);
}

static void
___lambda42__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda42_ (self);
}

static Block18Data*
block18_data_ref (Block18Data* _data18_)
{
	g_atomic_int_inc (&_data18_->_ref_count_);
	return _data18_;
}

static void
block18_data_unref (void * _userdata_)
{
	Block18Data* _data18_;
	_data18_ = (Block18Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data18_->_ref_count_)) {
		_g_free0 (_data18_->current_mode);
		block17_data_unref (_data18_->_data17_);
		_data18_->_data17_ = NULL;
		g_slice_free (Block18Data, _data18_);
	}
}

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
____lambda43_ (Block18Data* _data18_)
{
	Block17Data* _data17_;
	GraphsCanvas* _tmp0_;
	GraphsCanvas* _tmp1_;
	GeeArrayList* _tmp2_;
	const gchar* _tmp3_;
	_data17_ = _data18_->_data17_;
	_tmp0_ = graphs_window_get_canvas (_data17_->window);
	_tmp1_ = _tmp0_;
	_tmp2_ = _data17_->modes;
	_tmp3_ = _data18_->current_mode;
	graphs_canvas_set_mode (_tmp1_, (GraphsMode) gee_abstract_list_index_of ((GeeAbstractList*) _tmp2_, _tmp3_));
	graphs_window_on_selection_changed (_data17_->window);
}

static void
_____lambda43__g_simple_action_activate (GSimpleAction* _sender,
                                         GVariant* parameter,
                                         gpointer self)
{
	____lambda43_ (self);
}

static void
__lambda44_ (Block17Data* _data17_,
             GSimpleAction* a,
             GVariant* target)
{
	const gchar* _tmp0_;
	g_return_if_fail (a != NULL);
	_tmp0_ = g_variant_get_string (target, NULL);
	graphs_python_helper_perform_operation (_data17_->window, _tmp0_);
}

static void
___lambda44__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda44_ (self, _sender, parameter);
}

static void
__lambda45_ (Block17Data* _data17_)
{
	GraphsData* _tmp0_;
	_tmp0_ = _data17_->data;
	graphs_data_optimize_limits (_tmp0_);
}

static void
___lambda45__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda45_ (self);
}

static void
__lambda46_ (Block17Data* _data17_)
{
	GraphsSmoothenDialog* _tmp0_;
	GraphsSmoothenDialog* _tmp1_;
	_tmp0_ = graphs_smoothen_dialog_new (_data17_->window);
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	_g_object_unref0 (_tmp1_);
}

static void
___lambda46__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda46_ (self);
}

static void
__lambda47_ (Block17Data* _data17_)
{
	GraphsData* _tmp0_;
	GraphsData* _tmp1_;
	_tmp0_ = _data17_->data;
	gtk_selection_model_select_all ((GtkSelectionModel*) _tmp0_);
	_tmp1_ = _data17_->data;
	graphs_data_add_history_state (_tmp1_);
}

static void
___lambda47__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda47_ (self);
}

static void
__lambda48_ (Block17Data* _data17_)
{
	GraphsData* _tmp0_;
	GraphsData* _tmp1_;
	_tmp0_ = _data17_->data;
	gtk_selection_model_unselect_all ((GtkSelectionModel*) _tmp0_);
	_tmp1_ = _data17_->data;
	graphs_data_add_history_state (_tmp1_);
}

static void
___lambda48__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda48_ (self);
}

static void
__lambda49_ (Block17Data* _data17_)
{
	GraphsData* _tmp0_;
	_tmp0_ = _data17_->data;
	graphs_data_undo (_tmp0_);
}

static void
___lambda49__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda49_ (self);
}

static void
__lambda50_ (Block17Data* _data17_)
{
	GraphsData* _tmp0_;
	_tmp0_ = _data17_->data;
	graphs_data_redo (_tmp0_);
}

static void
___lambda50__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda50_ (self);
}

static void
__lambda51_ (Block17Data* _data17_)
{
	GraphsData* _tmp0_;
	_tmp0_ = _data17_->data;
	graphs_data_view_back (_tmp0_);
}

static void
___lambda51__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda51_ (self);
}

static void
__lambda52_ (Block17Data* _data17_)
{
	GraphsData* _tmp0_;
	_tmp0_ = _data17_->data;
	graphs_data_view_forward (_tmp0_);
}

static void
___lambda52__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda52_ (self);
}

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

static gchar*
string_slice (const gchar* self,
              glong start,
              glong end)
{
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	if (start < ((glong) 0)) {
		start = string_length + start;
	}
	if (end < ((glong) 0)) {
		end = string_length + end;
	}
	if (start >= ((glong) 0)) {
		_tmp2_ = start <= string_length;
	} else {
		_tmp2_ = FALSE;
	}
	g_return_val_if_fail (_tmp2_, NULL);
	if (end >= ((glong) 0)) {
		_tmp3_ = end <= string_length;
	} else {
		_tmp3_ = FALSE;
	}
	g_return_val_if_fail (_tmp3_, NULL);
	g_return_val_if_fail (start <= end, NULL);
	_tmp4_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
	result = _tmp4_;
	return result;
}

static void
__lambda53_ (Block17Data* _data17_)
{
	GraphsItem** items = NULL;
	GraphsItem** _tmp0_;
	gint items_length1;
	gint _items_size_;
	GString* name_builder = NULL;
	GString* _tmp1_;
	GraphsData* _tmp17_;
	GraphsItem** _tmp18_;
	gint _tmp18__length1;
	gchar* names = NULL;
	GString* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	_tmp0_ = g_new0 (GraphsItem*, 0 + 1);
	items = _tmp0_;
	items_length1 = 0;
	_items_size_ = items_length1;
	_tmp1_ = g_string_new ("");
	name_builder = _tmp1_;
	{
		GeeIterator* _item_it = NULL;
		GraphsData* _tmp2_;
		GeeIterator* _tmp3_;
		_tmp2_ = _data17_->data;
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
		_item_it = _tmp3_;
		while (TRUE) {
			GeeIterator* _tmp4_;
			GraphsItem* item = NULL;
			GeeIterator* _tmp5_;
			gpointer _tmp6_;
			GraphsItem* _tmp7_;
			gboolean _tmp8_;
			gboolean _tmp9_;
			_tmp4_ = _item_it;
			if (!gee_iterator_next (_tmp4_)) {
				break;
			}
			_tmp5_ = _item_it;
			_tmp6_ = gee_iterator_get (_tmp5_);
			item = (GraphsItem*) _tmp6_;
			_tmp7_ = item;
			_tmp8_ = graphs_item_get_selected (_tmp7_);
			_tmp9_ = _tmp8_;
			if (_tmp9_) {
				GraphsItem* _tmp10_;
				GraphsItem* _tmp11_;
				GString* _tmp12_;
				GraphsItem* _tmp13_;
				const gchar* _tmp14_;
				const gchar* _tmp15_;
				GString* _tmp16_;
				_tmp10_ = item;
				_tmp11_ = _g_object_ref0 (_tmp10_);
				_vala_array_add1 (&items, &items_length1, &_items_size_, _tmp11_);
				_tmp12_ = name_builder;
				_tmp13_ = item;
				_tmp14_ = graphs_item_get_name (_tmp13_);
				_tmp15_ = _tmp14_;
				g_string_append (_tmp12_, _tmp15_);
				_tmp16_ = name_builder;
				g_string_append (_tmp16_, ", ");
			}
			_g_object_unref0 (item);
		}
		_g_object_unref0 (_item_it);
	}
	_tmp17_ = _data17_->data;
	_tmp18_ = items;
	_tmp18__length1 = items_length1;
	graphs_data_delete_items (_tmp17_, _tmp18_, (gint) _tmp18__length1);
	_tmp19_ = name_builder;
	name_builder = NULL;
	_tmp20_ = g_string_free_and_steal (_tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = string_slice (_tmp21_, (glong) 0, (glong) -2);
	_tmp23_ = _tmp22_;
	_g_free0 (_tmp21_);
	names = _tmp23_;
	_tmp24_ = g_strdup_printf (_ ("Deleted %s"), names);
	_tmp25_ = _tmp24_;
	graphs_window_add_undo_toast (_data17_->window, _tmp25_);
	_g_free0 (_tmp25_);
	_g_free0 (names);
	_g_string_free0 (name_builder);
	items = (_vala_array_free (items, items_length1, (GDestroyNotify) g_object_unref), NULL);
}

static void
___lambda53__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda53_ (self);
}

static void
__lambda54_ (Block17Data* _data17_)
{
	graphs_project_save (_data17_->window, FALSE, NULL, NULL);
}

static void
___lambda54__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda54_ (self);
}

static void
__lambda55_ (Block17Data* _data17_)
{
	graphs_project_save (_data17_->window, TRUE, NULL, NULL);
}

static void
___lambda55__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda55_ (self);
}

static void
__lambda56_ (Block17Data* _data17_)
{
	graphs_project_open (_data17_->window, NULL, NULL);
}

static void
___lambda56__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda56_ (self);
}

static void
__lambda57_ (Block17Data* _data17_)
{
	graphs_project_close (_data17_->window);
}

static void
___lambda57__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda57_ (self);
}

static Block19Data*
block19_data_ref (Block19Data* _data19_)
{
	g_atomic_int_inc (&_data19_->_ref_count_);
	return _data19_;
}

static void
block19_data_unref (void * _userdata_)
{
	Block19Data* _data19_;
	_data19_ = (Block19Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data19_->_ref_count_)) {
		_g_object_unref0 (_data19_->dialog);
		block17_data_unref (_data19_->_data17_);
		_data19_->_data17_ = NULL;
		g_slice_free (Block19Data, _data19_);
	}
}

static void
__lambda61_ (Block19Data* _data19_,
             GObject* d,
             GAsyncResult* response)
{
	Block17Data* _data17_;
	GError* _inner_error0_ = NULL;
	_data17_ = _data19_->_data17_;
	g_return_if_fail (response != NULL);
	{
		GListModel* files_list_model = NULL;
		GListModel* _tmp0_;
		GListStore* settings_list = NULL;
		GListStore* _tmp1_;
		GListStore* _tmp11_;
		GraphsImportDialog* _tmp12_;
		GraphsImportDialog* _tmp13_;
		_tmp0_ = gtk_file_dialog_open_multiple_finish (_data19_->dialog, response, &_inner_error0_);
		files_list_model = _tmp0_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp1_ = g_list_store_new (GRAPHS_TYPE_IMPORT_SETTINGS);
		settings_list = _tmp1_;
		{
			guint i = 0U;
			i = (guint) 0;
			{
				gboolean _tmp2_ = FALSE;
				_tmp2_ = TRUE;
				while (TRUE) {
					GListModel* _tmp4_;
					GFile* file = NULL;
					GListModel* _tmp5_;
					GObject* _tmp6_;
					GraphsImportSettings* settings = NULL;
					GFile* _tmp7_;
					GraphsImportSettings* _tmp8_;
					GListStore* _tmp9_;
					GraphsImportSettings* _tmp10_;
					if (!_tmp2_) {
						guint _tmp3_;
						_tmp3_ = i;
						i = _tmp3_ + 1;
					}
					_tmp2_ = FALSE;
					_tmp4_ = files_list_model;
					if (!(i < g_list_model_get_n_items (_tmp4_))) {
						break;
					}
					_tmp5_ = files_list_model;
					_tmp6_ = g_list_model_get_item (_tmp5_, i);
					file = G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, g_file_get_type (), GFile);
					_tmp7_ = file;
					_tmp8_ = graphs_data_importer_get_settings_for_file (_tmp7_);
					settings = _tmp8_;
					_tmp9_ = settings_list;
					_tmp10_ = settings;
					g_list_store_append (_tmp9_, (GObject*) _tmp10_);
					_g_object_unref0 (settings);
					_g_object_unref0 (file);
				}
			}
		}
		_tmp11_ = settings_list;
		_tmp12_ = graphs_import_dialog_new (_data17_->window, _tmp11_);
		g_object_ref_sink (_tmp12_);
		_tmp13_ = _tmp12_;
		_g_object_unref0 (_tmp13_);
		_g_object_unref0 (settings_list);
		_g_object_unref0 (files_list_model);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__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
___lambda61__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda61_ (self, source_object, res);
	block19_data_unref (self);
}

static void
__lambda60_ (Block17Data* _data17_)
{
	Block19Data* _data19_;
	GtkFileDialog* _tmp0_;
	GListStore* _tmp1_;
	GListStore* _tmp2_;
	GraphsWindow* _tmp3_;
	_data19_ = g_slice_new0 (Block19Data);
	_data19_->_ref_count_ = 1;
	_data19_->_data17_ = block17_data_ref (_data17_);
	_tmp0_ = gtk_file_dialog_new ();
	_data19_->dialog = _tmp0_;
	_tmp1_ = graphs_data_importer_get_file_filters ();
	_tmp2_ = _tmp1_;
	gtk_file_dialog_set_filters (_data19_->dialog, (GListModel*) _tmp2_);
	_tmp3_ = _data17_->window;
	gtk_file_dialog_open_multiple (_data19_->dialog, (GtkWindow*) _tmp3_, NULL, ___lambda61__gasync_ready_callback, block19_data_ref (_data19_));
	block19_data_unref (_data19_);
	_data19_ = NULL;
}

static void
___lambda60__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda60_ (self);
}

static void
__lambda62_ (Block17Data* _data17_)
{
	graphs_export_export_items (_data17_->window);
}

static void
___lambda62__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda62_ (self);
}

static void
__lambda65_ (Block17Data* _data17_)
{
	graphs_window_open_figure_settings (_data17_->window, NULL);
}

static void
___lambda65__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda65_ (self);
}

static void
__lambda66_ (Block17Data* _data17_)
{
	GraphsAddEquationDialog* _tmp0_;
	GraphsAddEquationDialog* _tmp1_;
	_tmp0_ = graphs_add_equation_dialog_new (_data17_->window);
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	_g_object_unref0 (_tmp1_);
}

static void
___lambda66__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda66_ (self);
}

static void
__lambda67_ (Block17Data* _data17_)
{
	GraphsGenerateDataDialog* _tmp0_;
	GraphsGenerateDataDialog* _tmp1_;
	_tmp0_ = graphs_generate_data_dialog_new (_data17_->window);
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	_g_object_unref0 (_tmp1_);
}

static void
___lambda67__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda67_ (self);
}

static void
__lambda68_ (Block17Data* _data17_)
{
	GraphsExportFigureDialog* _tmp0_;
	GraphsExportFigureDialog* _tmp1_;
	_tmp0_ = graphs_export_figure_dialog_new (_data17_->window);
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	_g_object_unref0 (_tmp1_);
}

static void
___lambda68__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda68_ (self);
}

static void
__lambda70_ (Block17Data* _data17_)
{
	gchar* path = NULL;
	gchar* _tmp0_;
	GtkBuilder* builder = NULL;
	GtkBuilder* _tmp1_;
	AdwShortcutsDialog* shortcuts_dialog = NULL;
	GObject* _tmp2_;
	AdwShortcutsDialog* _tmp3_;
	_tmp0_ = g_strdup ("/se/sjoerd/Graphs/ui/window-shortcuts.ui");
	path = _tmp0_;
	_tmp1_ = gtk_builder_new_from_resource (path);
	builder = _tmp1_;
	_tmp2_ = gtk_builder_get_object (builder, "shortcuts");
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, adw_shortcuts_dialog_get_type (), AdwShortcutsDialog));
	shortcuts_dialog = _tmp3_;
	adw_dialog_present ((AdwDialog*) shortcuts_dialog, (GtkWidget*) _data17_->window);
	_g_object_unref0 (shortcuts_dialog);
	_g_object_unref0 (builder);
	_g_free0 (path);
}

static void
___lambda70__g_simple_action_activate (GSimpleAction* _sender,
                                       GVariant* parameter,
                                       gpointer self)
{
	__lambda70_ (self);
}

void
graphs_actions_setup_local (GraphsWindow* window)
{
	Block17Data* _data17_;
	GraphsWindow* _tmp0_;
	GraphsData* _tmp1_;
	GraphsData* _tmp2_;
	GraphsData* _tmp3_;
	GSimpleAction* toggle_sidebar_action = NULL;
	GSimpleAction* _tmp4_;
	GSimpleAction* _tmp5_;
	AdwOverlaySplitView* _tmp6_;
	AdwOverlaySplitView* _tmp7_;
	GSimpleAction* _tmp8_;
	GSimpleAction* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar** _tmp13_;
	GeeArrayList* _tmp14_;
	gchar** settings_actions = NULL;
	gchar* _tmp33_;
	gchar* _tmp34_;
	gchar** _tmp35_;
	gint settings_actions_length1;
	gint _settings_actions_size_;
	GSettings* actions_settings = NULL;
	GSettings* _tmp36_;
	gchar** _tmp37_;
	gint _tmp37__length1;
	GSimpleAction* operation_action = NULL;
	GVariantType* _tmp43_;
	GVariantType* _tmp44_;
	GSimpleAction* _tmp45_;
	GSimpleAction* _tmp46_;
	GSimpleAction* optimize_limits_action = NULL;
	GSimpleAction* _tmp47_;
	GSimpleAction* smoothen_settings_action = NULL;
	GSimpleAction* _tmp48_;
	GSimpleAction* select_all_action = NULL;
	GSimpleAction* _tmp49_;
	GSimpleAction* select_none_action = NULL;
	GSimpleAction* _tmp50_;
	GSimpleAction* undo_action = NULL;
	GSimpleAction* _tmp51_;
	GSimpleAction* redo_action = NULL;
	GSimpleAction* _tmp52_;
	GSimpleAction* view_back_action = NULL;
	GSimpleAction* _tmp53_;
	GraphsData* _tmp54_;
	GSimpleAction* view_forward_action = NULL;
	GSimpleAction* _tmp55_;
	GraphsData* _tmp56_;
	GSimpleAction* delete_selected_action = NULL;
	GSimpleAction* _tmp57_;
	GSimpleAction* save_project_action = NULL;
	GSimpleAction* _tmp58_;
	GSimpleAction* save_project_as_action = NULL;
	GSimpleAction* _tmp59_;
	GSimpleAction* open_project_action = NULL;
	GSimpleAction* _tmp60_;
	GSimpleAction* close_project_action = NULL;
	GSimpleAction* _tmp61_;
	GSimpleAction* add_data_action = NULL;
	GSimpleAction* _tmp62_;
	GSimpleAction* export_data_action = NULL;
	GSimpleAction* _tmp63_;
	GSimpleAction* figure_settings_action = NULL;
	GSimpleAction* _tmp64_;
	GSimpleAction* add_equation_action = NULL;
	GSimpleAction* _tmp65_;
	GSimpleAction* generate_data_action = NULL;
	GSimpleAction* _tmp66_;
	GSimpleAction* export_figure_action = NULL;
	GSimpleAction* _tmp67_;
	GSimpleAction* _tmp68_;
	GSimpleAction* _tmp69_;
	GSimpleAction* _tmp70_;
	GSimpleAction* _tmp71_;
	GSimpleAction* show_shortcuts_action = NULL;
	GSimpleAction* _tmp72_;
	g_return_if_fail (window != NULL);
	_data17_ = g_slice_new0 (Block17Data);
	_data17_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (window);
	_g_object_unref0 (_data17_->window);
	_data17_->window = _tmp0_;
	_tmp1_ = graphs_window_get_data (_data17_->window);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_data17_->data = _tmp3_;
	_tmp4_ = g_simple_action_new ("toggle-sidebar", NULL);
	toggle_sidebar_action = _tmp4_;
	_tmp5_ = toggle_sidebar_action;
	g_signal_connect_data (_tmp5_, "activate", (GCallback) ___lambda42__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	_tmp6_ = graphs_window_get_overlay_split_view (_data17_->window);
	_tmp7_ = _tmp6_;
	_tmp8_ = toggle_sidebar_action;
	g_object_bind_property_with_closures ((GObject*) _tmp7_, "collapsed", (GObject*) _tmp8_, "enabled", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp9_ = toggle_sidebar_action;
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) _tmp9_);
	_tmp10_ = g_strdup ("pan");
	_tmp11_ = g_strdup ("zoom");
	_tmp12_ = g_strdup ("select");
	_tmp13_ = g_new0 (gchar*, 3 + 1);
	_tmp13_[0] = _tmp10_;
	_tmp13_[1] = _tmp11_;
	_tmp13_[2] = _tmp12_;
	_tmp14_ = gee_array_list_new_wrap (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp13_, 3, NULL, NULL, NULL);
	_data17_->modes = _tmp14_;
	{
		GeeArrayList* _mode_list = NULL;
		GeeArrayList* _tmp15_;
		gint _mode_size = 0;
		GeeArrayList* _tmp16_;
		gint _tmp17_;
		gint _tmp18_;
		gint _mode_index = 0;
		_tmp15_ = _data17_->modes;
		_mode_list = _tmp15_;
		_tmp16_ = _mode_list;
		_tmp17_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp16_);
		_tmp18_ = _tmp17_;
		_mode_size = _tmp18_;
		_mode_index = -1;
		while (TRUE) {
			Block18Data* _data18_;
			gint _tmp19_;
			gint _tmp20_;
			gchar* mode = NULL;
			GeeArrayList* _tmp21_;
			gpointer _tmp22_;
			const gchar* _tmp23_;
			gchar* _tmp24_;
			GSimpleAction* action = NULL;
			const gchar* _tmp25_;
			const gchar* _tmp26_;
			gchar* _tmp27_;
			gchar* _tmp28_;
			GSimpleAction* _tmp29_;
			GSimpleAction* _tmp30_;
			GSimpleAction* _tmp31_;
			GSimpleAction* _tmp32_;
			_data18_ = g_slice_new0 (Block18Data);
			_data18_->_ref_count_ = 1;
			_data18_->_data17_ = block17_data_ref (_data17_);
			_mode_index = _mode_index + 1;
			_tmp19_ = _mode_index;
			_tmp20_ = _mode_size;
			if (!(_tmp19_ < _tmp20_)) {
				block18_data_unref (_data18_);
				_data18_ = NULL;
				break;
			}
			_tmp21_ = _mode_list;
			_tmp22_ = gee_abstract_list_get ((GeeAbstractList*) _tmp21_, _mode_index);
			mode = (gchar*) _tmp22_;
			_tmp23_ = mode;
			_tmp24_ = g_strdup (_tmp23_);
			_data18_->current_mode = _tmp24_;
			_tmp25_ = _data18_->current_mode;
			_tmp26_ = string_to_string (_tmp25_);
			_tmp27_ = g_strconcat ("mode-", _tmp26_, NULL);
			_tmp28_ = _tmp27_;
			_tmp29_ = g_simple_action_new (_tmp28_, NULL);
			_tmp30_ = _tmp29_;
			_g_free0 (_tmp28_);
			action = _tmp30_;
			_tmp31_ = action;
			g_signal_connect_data (_tmp31_, "activate", (GCallback) _____lambda43__g_simple_action_activate, block18_data_ref (_data18_), (GClosureNotify) block18_data_unref, 0);
			_tmp32_ = action;
			g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) _tmp32_);
			_g_object_unref0 (action);
			_g_free0 (mode);
			block18_data_unref (_data18_);
			_data18_ = NULL;
		}
	}
	_tmp33_ = g_strdup ("center");
	_tmp34_ = g_strdup ("smoothen");
	_tmp35_ = g_new0 (gchar*, 2 + 1);
	_tmp35_[0] = _tmp33_;
	_tmp35_[1] = _tmp34_;
	settings_actions = _tmp35_;
	settings_actions_length1 = 2;
	_settings_actions_size_ = settings_actions_length1;
	_tmp36_ = graphs_application_get_settings_child ("actions");
	actions_settings = _tmp36_;
	_tmp37_ = settings_actions;
	_tmp37__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 = _tmp37_;
		settings_action_collection_length1 = _tmp37__length1;
		for (settings_action_it = 0; settings_action_it < settings_action_collection_length1; settings_action_it = settings_action_it + 1) {
			gchar* _tmp38_;
			gchar* settings_action = NULL;
			_tmp38_ = g_strdup (settings_action_collection[settings_action_it]);
			settings_action = _tmp38_;
			{
				GSettings* _tmp39_;
				const gchar* _tmp40_;
				GAction* _tmp41_;
				GAction* _tmp42_;
				_tmp39_ = actions_settings;
				_tmp40_ = settings_action;
				_tmp41_ = g_settings_create_action (_tmp39_, _tmp40_);
				_tmp42_ = _tmp41_;
				g_action_map_add_action ((GActionMap*) _data17_->window, _tmp42_);
				_g_object_unref0 (_tmp42_);
				_g_free0 (settings_action);
			}
		}
	}
	_tmp43_ = g_variant_type_new ("s");
	_tmp44_ = _tmp43_;
	_tmp45_ = g_simple_action_new ("perform_operation", _tmp44_);
	_tmp46_ = _tmp45_;
	_g_variant_type_free0 (_tmp44_);
	operation_action = _tmp46_;
	g_signal_connect_data (operation_action, "activate", (GCallback) ___lambda44__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) operation_action);
	_tmp47_ = g_simple_action_new ("optimize-limits", NULL);
	optimize_limits_action = _tmp47_;
	g_signal_connect_data (optimize_limits_action, "activate", (GCallback) ___lambda45__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) optimize_limits_action);
	_tmp48_ = g_simple_action_new ("smoothen-settings", NULL);
	smoothen_settings_action = _tmp48_;
	g_signal_connect_data (smoothen_settings_action, "activate", (GCallback) ___lambda46__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) smoothen_settings_action);
	_tmp49_ = g_simple_action_new ("select-all", NULL);
	select_all_action = _tmp49_;
	g_signal_connect_data (select_all_action, "activate", (GCallback) ___lambda47__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	g_object_bind_property_with_closures ((GObject*) _data17_->window, "is_main_view", (GObject*) select_all_action, "enabled", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) select_all_action);
	_tmp50_ = g_simple_action_new ("select-none", NULL);
	select_none_action = _tmp50_;
	g_signal_connect_data (select_none_action, "activate", (GCallback) ___lambda48__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	g_object_bind_property_with_closures ((GObject*) _data17_->window, "is_main_view", (GObject*) select_none_action, "enabled", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) select_none_action);
	_tmp51_ = g_simple_action_new ("undo", NULL);
	undo_action = _tmp51_;
	g_signal_connect_data (undo_action, "activate", (GCallback) ___lambda49__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) undo_action);
	_tmp52_ = g_simple_action_new ("redo", NULL);
	redo_action = _tmp52_;
	g_signal_connect_data (redo_action, "activate", (GCallback) ___lambda50__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) redo_action);
	_tmp53_ = g_simple_action_new ("view-back", NULL);
	view_back_action = _tmp53_;
	g_signal_connect_data (view_back_action, "activate", (GCallback) ___lambda51__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	_tmp54_ = _data17_->data;
	g_object_bind_property_with_closures ((GObject*) _tmp54_, "can_view_back", (GObject*) view_back_action, "enabled", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) view_back_action);
	_tmp55_ = g_simple_action_new ("view-forward", NULL);
	view_forward_action = _tmp55_;
	g_signal_connect_data (view_forward_action, "activate", (GCallback) ___lambda52__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	_tmp56_ = _data17_->data;
	g_object_bind_property_with_closures ((GObject*) _tmp56_, "can_view_forward", (GObject*) view_forward_action, "enabled", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) view_forward_action);
	_tmp57_ = g_simple_action_new ("delete-selected", NULL);
	delete_selected_action = _tmp57_;
	g_signal_connect_data (delete_selected_action, "activate", (GCallback) ___lambda53__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	g_object_bind_property_with_closures ((GObject*) _data17_->window, "is_main_view", (GObject*) delete_selected_action, "enabled", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) delete_selected_action);
	_tmp58_ = g_simple_action_new ("save-project", NULL);
	save_project_action = _tmp58_;
	g_signal_connect_data (save_project_action, "activate", (GCallback) ___lambda54__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	g_simple_action_set_enabled (save_project_action, FALSE);
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) save_project_action);
	_tmp59_ = g_simple_action_new ("save-project-as", NULL);
	save_project_as_action = _tmp59_;
	g_signal_connect_data (save_project_as_action, "activate", (GCallback) ___lambda55__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	g_simple_action_set_enabled (save_project_as_action, FALSE);
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) save_project_as_action);
	_tmp60_ = g_simple_action_new ("open-project", NULL);
	open_project_action = _tmp60_;
	g_signal_connect_data (open_project_action, "activate", (GCallback) ___lambda56__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	g_object_bind_property_with_closures ((GObject*) _data17_->window, "is_main_view", (GObject*) open_project_action, "enabled", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) open_project_action);
	_tmp61_ = g_simple_action_new ("close-project", NULL);
	close_project_action = _tmp61_;
	g_signal_connect_data (close_project_action, "activate", (GCallback) ___lambda57__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) close_project_action);
	_tmp62_ = g_simple_action_new ("add-data", NULL);
	add_data_action = _tmp62_;
	g_signal_connect_data (add_data_action, "activate", (GCallback) ___lambda60__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	g_object_bind_property_with_closures ((GObject*) _data17_->window, "is_main_view", (GObject*) add_data_action, "enabled", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) add_data_action);
	_tmp63_ = g_simple_action_new ("export-data", NULL);
	export_data_action = _tmp63_;
	g_signal_connect_data (export_data_action, "activate", (GCallback) ___lambda62__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	g_object_bind_property_with_closures ((GObject*) _data17_->window, "is_main_view", (GObject*) export_data_action, "enabled", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) export_data_action);
	_tmp64_ = g_simple_action_new ("figure-settings", NULL);
	figure_settings_action = _tmp64_;
	g_signal_connect_data (figure_settings_action, "activate", (GCallback) ___lambda65__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	g_object_bind_property_with_closures ((GObject*) _data17_->window, "is_main_view", (GObject*) figure_settings_action, "enabled", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) figure_settings_action);
	_tmp65_ = g_simple_action_new ("add-equation", NULL);
	add_equation_action = _tmp65_;
	g_signal_connect_data (add_equation_action, "activate", (GCallback) ___lambda66__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	g_object_bind_property_with_closures ((GObject*) _data17_->window, "is_main_view", (GObject*) add_equation_action, "enabled", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) add_equation_action);
	_tmp66_ = g_simple_action_new ("generate-data", NULL);
	generate_data_action = _tmp66_;
	g_signal_connect_data (generate_data_action, "activate", (GCallback) ___lambda67__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	g_object_bind_property_with_closures ((GObject*) _data17_->window, "is_main_view", (GObject*) generate_data_action, "enabled", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) generate_data_action);
	_tmp67_ = g_simple_action_new ("export-figure", NULL);
	export_figure_action = _tmp67_;
	g_signal_connect_data (export_figure_action, "activate", (GCallback) ___lambda68__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	g_object_bind_property_with_closures ((GObject*) _data17_->window, "is_main_view", (GObject*) export_figure_action, "enabled", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) export_figure_action);
	_tmp68_ = g_simple_action_new ("zoom-in", NULL);
	_tmp69_ = _tmp68_;
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) _tmp69_);
	_g_object_unref0 (_tmp69_);
	_tmp70_ = g_simple_action_new ("zoom-out", NULL);
	_tmp71_ = _tmp70_;
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) _tmp71_);
	_g_object_unref0 (_tmp71_);
	_tmp72_ = g_simple_action_new ("show-shortcuts", NULL);
	show_shortcuts_action = _tmp72_;
	g_signal_connect_data (show_shortcuts_action, "activate", (GCallback) ___lambda70__g_simple_action_activate, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
	g_action_map_add_action ((GActionMap*) _data17_->window, (GAction*) show_shortcuts_action);
	_g_object_unref0 (show_shortcuts_action);
	_g_object_unref0 (export_figure_action);
	_g_object_unref0 (generate_data_action);
	_g_object_unref0 (add_equation_action);
	_g_object_unref0 (figure_settings_action);
	_g_object_unref0 (export_data_action);
	_g_object_unref0 (add_data_action);
	_g_object_unref0 (close_project_action);
	_g_object_unref0 (open_project_action);
	_g_object_unref0 (save_project_as_action);
	_g_object_unref0 (save_project_action);
	_g_object_unref0 (delete_selected_action);
	_g_object_unref0 (view_forward_action);
	_g_object_unref0 (view_back_action);
	_g_object_unref0 (redo_action);
	_g_object_unref0 (undo_action);
	_g_object_unref0 (select_none_action);
	_g_object_unref0 (select_all_action);
	_g_object_unref0 (smoothen_settings_action);
	_g_object_unref0 (optimize_limits_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 (toggle_sidebar_action);
	block17_data_unref (_data17_);
	_data17_ = 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);
}

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

