/* launch-options-editor-binding.c generated by valac 0.56.19, the Vala compiler
 * generated from launch-options-editor-binding.vala, do not modify */

#include <glib-object.h>
#include <gee.h>
#include "protonplus_core.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gtk/gtk.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 PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_BASE_BINDING (proton_plus_widgets_games_launch_options_editor_base_binding_get_type ())
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BASE_BINDING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_BASE_BINDING, ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBinding))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BASE_BINDING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_BASE_BINDING, ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBindingClass))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_BASE_BINDING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_BASE_BINDING))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_BASE_BINDING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_BASE_BINDING))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_BASE_BINDING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_BASE_BINDING, ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBindingClass))

typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBinding ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBinding;
typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBindingClass ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBindingClass;
typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBindingPrivate ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBindingPrivate;

#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_BINDING (proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_type ())
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_BINDING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_BINDING, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_BINDING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_BINDING, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBindingClass))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_LAUNCH_OPTION_BINDING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_BINDING))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_LAUNCH_OPTION_BINDING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_BINDING))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_BINDING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_BINDING, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBindingClass))

typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding;
typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBindingClass ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBindingClass;
typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBindingPrivate ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBindingPrivate;
enum  {
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_BINDING_0_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_BINDING_TOKENS_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_BINDING_TOGGLE_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_BINDING_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_games_launch_options_editor_launch_option_binding_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_BINDING_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBinding {
	GObject parent_instance;
	ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBindingPrivate * priv;
	GeeList* _children;
};

struct _ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBindingClass {
	GObjectClass parent_class;
};

struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding {
	ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBinding parent_instance;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBindingPrivate * priv;
};

struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBindingClass {
	ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBindingClass parent_class;
};

struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBindingPrivate {
	gchar** _tokens;
	gint _tokens_length1;
	gint __tokens_size_;
	GtkSwitch* _toggle;
};

static gint ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding_private_offset;
static gpointer proton_plus_widgets_games_launch_options_editor_launch_option_binding_parent_class = NULL;
static ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOptionIface * proton_plus_widgets_games_launch_options_editor_launch_option_binding_proton_plus_widgets_games_launch_options_editor_ilaunch_option_parent_iface = NULL;

VALA_EXTERN GType proton_plus_widgets_games_launch_options_editor_base_binding_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding* proton_plus_widgets_games_launch_options_editor_launch_option_binding_new (gchar** tokens,
                                                                                                                                         gint tokens_length1,
                                                                                                                                         GtkSwitch* toggle,
                                                                                                                                         gboolean is_advanced,
                                                                                                                                         ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType line_type);
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding* proton_plus_widgets_games_launch_options_editor_launch_option_binding_construct (GType object_type,
                                                                                                                                               gchar** tokens,
                                                                                                                                               gint tokens_length1,
                                                                                                                                               GtkSwitch* toggle,
                                                                                                                                               gboolean is_advanced,
                                                                                                                                               ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType line_type);
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBinding* proton_plus_widgets_games_launch_options_editor_base_binding_construct (GType object_type,
                                                                                                                              gboolean is_advanced,
                                                                                                                              ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType line_type);
VALA_EXTERN void proton_plus_widgets_games_launch_options_editor_launch_option_binding_set_tokens (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding* self,
                                                                                       gchar** value,
                                                                                       gint value_length1);
VALA_EXTERN void proton_plus_widgets_games_launch_options_editor_launch_option_binding_set_toggle (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding* self,
                                                                                       GtkSwitch* value);
static void proton_plus_widgets_games_launch_options_editor_launch_option_binding_real_parse_tokens (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base,
                                                                                              gchar** tokens_pool,
                                                                                              gint tokens_pool_length1,
                                                                                              gboolean* consumed,
                                                                                              gint consumed_length1);
VALA_EXTERN gchar** proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_tokens (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding* self,
                                                                                          gint* result_length1);
static gint proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_unconsumed_token_index (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding* self,
                                                                                                       gchar** tokens_pool,
                                                                                                       gint tokens_pool_length1,
                                                                                                       const gchar* token,
                                                                                                       gboolean* consumed,
                                                                                                       gint consumed_length1);
VALA_EXTERN GtkSwitch* proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_toggle (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding* self);
static void proton_plus_widgets_games_launch_options_editor_launch_option_binding_real_append_command_segments (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base,
                                                                                                         GeeLinkedList* segments);
static void proton_plus_widgets_games_launch_options_editor_launch_option_binding_real_clear (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base);
static gboolean proton_plus_widgets_games_launch_options_editor_launch_option_binding_real_is_active (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base);
static gchar** _vala_array_dup24 (gchar** self,
                           gssize length);
VALA_EXTERN void proton_plus_widgets_games_launch_options_editor_base_binding_add_child (ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBinding* self,
                                                                             ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* child);
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType proton_plus_widgets_games_launch_options_editor_base_binding_get_line_type (ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBinding* self);
VALA_EXTERN void proton_plus_widgets_games_launch_options_editor_base_binding_set_line_type (ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBinding* self,
                                                                                 ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType value);
VALA_EXTERN gboolean proton_plus_widgets_games_launch_options_editor_base_binding_get_is_advanced (ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBinding* self);
VALA_EXTERN void proton_plus_widgets_games_launch_options_editor_base_binding_set_is_advanced (ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBinding* self,
                                                                                   gboolean value);
static void proton_plus_widgets_games_launch_options_editor_launch_option_binding_finalize (GObject * obj);
static GType proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_type_once (void);
static void _vala_proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_property (GObject * object,
                                                                                               guint property_id,
                                                                                               GValue * value,
                                                                                               GParamSpec * pspec);
static void _vala_proton_plus_widgets_games_launch_options_editor_launch_option_binding_set_property (GObject * object,
                                                                                               guint property_id,
                                                                                               const GValue * value,
                                                                                               GParamSpec * pspec);
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 inline gpointer
proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_instance_private (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding_private_offset);
}

ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding*
proton_plus_widgets_games_launch_options_editor_launch_option_binding_construct (GType object_type,
                                                                                 gchar** tokens,
                                                                                 gint tokens_length1,
                                                                                 GtkSwitch* toggle,
                                                                                 gboolean is_advanced,
                                                                                 ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType line_type)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding * self = NULL;
	g_return_val_if_fail (toggle != NULL, NULL);
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding*) proton_plus_widgets_games_launch_options_editor_base_binding_construct (object_type, is_advanced, line_type);
	proton_plus_widgets_games_launch_options_editor_launch_option_binding_set_tokens (self, tokens, tokens_length1);
	proton_plus_widgets_games_launch_options_editor_launch_option_binding_set_toggle (self, toggle);
	return self;
}

ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding*
proton_plus_widgets_games_launch_options_editor_launch_option_binding_new (gchar** tokens,
                                                                           gint tokens_length1,
                                                                           GtkSwitch* toggle,
                                                                           gboolean is_advanced,
                                                                           ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType line_type)
{
	return proton_plus_widgets_games_launch_options_editor_launch_option_binding_construct (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_BINDING, tokens, tokens_length1, toggle, is_advanced, line_type);
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_binding_real_parse_tokens (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base,
                                                                                         gchar** tokens_pool,
                                                                                         gint tokens_pool_length1,
                                                                                         gboolean* consumed,
                                                                                         gint consumed_length1)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding * self;
	GeeLinkedList* token_indexes = NULL;
	GeeLinkedList* _tmp0_;
	gboolean all_tokens_present = FALSE;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gint _tmp2_ = 0;
	gchar** _tmp3_;
	gint _tmp3__length1;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding*) base;
	if (tokens_pool_length1 != consumed_length1) {
		return;
	}
	_tmp0_ = gee_linked_list_new (G_TYPE_INT, NULL, NULL, NULL, NULL, NULL);
	token_indexes = _tmp0_;
	all_tokens_present = TRUE;
	_tmp1_ = proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_tokens (self, &_tmp2_);
	_tmp1__length1 = _tmp2_;
	_tmp3_ = _tmp1_;
	_tmp3__length1 = _tmp1__length1;
	{
		gchar** token_collection = NULL;
		gint token_collection_length1 = 0;
		gint _token_collection_size_ = 0;
		gint token_it = 0;
		token_collection = _tmp3_;
		token_collection_length1 = _tmp3__length1;
		for (token_it = 0; token_it < token_collection_length1; token_it = token_it + 1) {
			gchar* _tmp4_;
			gchar* token = NULL;
			_tmp4_ = g_strdup (token_collection[token_it]);
			token = _tmp4_;
			{
				gint token_index = 0;
				const gchar* _tmp5_;
				GeeLinkedList* _tmp6_;
				_tmp5_ = token;
				token_index = proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_unconsumed_token_index (self, tokens_pool, (gint) tokens_pool_length1, _tmp5_, consumed, (gint) consumed_length1);
				if (token_index < 0) {
					all_tokens_present = FALSE;
					_g_free0 (token);
					break;
				}
				_tmp6_ = token_indexes;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp6_, (gpointer) ((gintptr) token_index));
				_g_free0 (token);
			}
		}
	}
	if (all_tokens_present) {
		GtkSwitch* _tmp7_;
		_tmp7_ = self->priv->_toggle;
		gtk_switch_set_active (_tmp7_, TRUE);
		{
			GeeLinkedList* _token_index_list = NULL;
			GeeLinkedList* _tmp8_;
			gint _token_index_size = 0;
			GeeLinkedList* _tmp9_;
			gint _tmp10_;
			gint _tmp11_;
			gint _token_index_index = 0;
			_tmp8_ = token_indexes;
			_token_index_list = _tmp8_;
			_tmp9_ = _token_index_list;
			_tmp10_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp9_);
			_tmp11_ = _tmp10_;
			_token_index_size = _tmp11_;
			_token_index_index = -1;
			while (TRUE) {
				gint _tmp12_;
				gint _tmp13_;
				gint token_index = 0;
				GeeLinkedList* _tmp14_;
				gpointer _tmp15_;
				_token_index_index = _token_index_index + 1;
				_tmp12_ = _token_index_index;
				_tmp13_ = _token_index_size;
				if (!(_tmp12_ < _tmp13_)) {
					break;
				}
				_tmp14_ = _token_index_list;
				_tmp15_ = gee_abstract_list_get ((GeeAbstractList*) _tmp14_, _token_index_index);
				token_index = (gint) ((gintptr) _tmp15_);
				consumed[token_index] = TRUE;
			}
		}
	}
	{
		GeeList* _child_list = NULL;
		GeeList* _tmp16_;
		gint _child_size = 0;
		GeeList* _tmp17_;
		gint _tmp18_;
		gint _tmp19_;
		gint _child_index = 0;
		_tmp16_ = ((ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBinding*) self)->_children;
		_child_list = _tmp16_;
		_tmp17_ = _child_list;
		_tmp18_ = gee_collection_get_size ((GeeCollection*) _tmp17_);
		_tmp19_ = _tmp18_;
		_child_size = _tmp19_;
		_child_index = -1;
		while (TRUE) {
			gint _tmp20_;
			gint _tmp21_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* child = NULL;
			GeeList* _tmp22_;
			gpointer _tmp23_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* _tmp24_;
			_child_index = _child_index + 1;
			_tmp20_ = _child_index;
			_tmp21_ = _child_size;
			if (!(_tmp20_ < _tmp21_)) {
				break;
			}
			_tmp22_ = _child_list;
			_tmp23_ = gee_list_get (_tmp22_, _child_index);
			child = (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) _tmp23_;
			_tmp24_ = child;
			proton_plus_widgets_games_launch_options_editor_ilaunch_option_parse_tokens (_tmp24_, tokens_pool, (gint) tokens_pool_length1, consumed, (gint) consumed_length1);
			_g_object_unref0 (child);
		}
	}
	_g_object_unref0 (token_indexes);
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_binding_real_append_command_segments (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base,
                                                                                                    GeeLinkedList* segments)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding * self;
	GtkSwitch* _tmp0_;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gint _tmp2_ = 0;
	gchar** _tmp3_;
	gint _tmp3__length1;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding*) base;
	g_return_if_fail (segments != NULL);
	_tmp0_ = self->priv->_toggle;
	if (!gtk_switch_get_active (_tmp0_)) {
		return;
	}
	_tmp1_ = proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_tokens (self, &_tmp2_);
	_tmp1__length1 = _tmp2_;
	_tmp3_ = _tmp1_;
	_tmp3__length1 = _tmp1__length1;
	{
		gchar** token_collection = NULL;
		gint token_collection_length1 = 0;
		gint _token_collection_size_ = 0;
		gint token_it = 0;
		token_collection = _tmp3_;
		token_collection_length1 = _tmp3__length1;
		for (token_it = 0; token_it < token_collection_length1; token_it = token_it + 1) {
			gchar* _tmp4_;
			gchar* token = NULL;
			_tmp4_ = g_strdup (token_collection[token_it]);
			token = _tmp4_;
			{
				const gchar* _tmp5_;
				_tmp5_ = token;
				gee_abstract_collection_add ((GeeAbstractCollection*) segments, _tmp5_);
				_g_free0 (token);
			}
		}
	}
	{
		GeeList* _child_list = NULL;
		GeeList* _tmp6_;
		gint _child_size = 0;
		GeeList* _tmp7_;
		gint _tmp8_;
		gint _tmp9_;
		gint _child_index = 0;
		_tmp6_ = ((ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBinding*) self)->_children;
		_child_list = _tmp6_;
		_tmp7_ = _child_list;
		_tmp8_ = gee_collection_get_size ((GeeCollection*) _tmp7_);
		_tmp9_ = _tmp8_;
		_child_size = _tmp9_;
		_child_index = -1;
		while (TRUE) {
			gint _tmp10_;
			gint _tmp11_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* child = NULL;
			GeeList* _tmp12_;
			gpointer _tmp13_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* _tmp14_;
			_child_index = _child_index + 1;
			_tmp10_ = _child_index;
			_tmp11_ = _child_size;
			if (!(_tmp10_ < _tmp11_)) {
				break;
			}
			_tmp12_ = _child_list;
			_tmp13_ = gee_list_get (_tmp12_, _child_index);
			child = (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) _tmp13_;
			_tmp14_ = child;
			if (proton_plus_widgets_games_launch_options_editor_ilaunch_option_is_active (_tmp14_)) {
				ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* _tmp15_;
				_tmp15_ = child;
				proton_plus_widgets_games_launch_options_editor_ilaunch_option_append_command_segments (_tmp15_, segments);
			}
			_g_object_unref0 (child);
		}
	}
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_binding_real_clear (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding * self;
	GtkSwitch* _tmp0_;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding*) base;
	_tmp0_ = self->priv->_toggle;
	gtk_switch_set_active (_tmp0_, FALSE);
	{
		GeeList* _child_list = NULL;
		GeeList* _tmp1_;
		gint _child_size = 0;
		GeeList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _child_index = 0;
		_tmp1_ = ((ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBinding*) self)->_children;
		_child_list = _tmp1_;
		_tmp2_ = _child_list;
		_tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_child_size = _tmp4_;
		_child_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* child = NULL;
			GeeList* _tmp7_;
			gpointer _tmp8_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* _tmp9_;
			_child_index = _child_index + 1;
			_tmp5_ = _child_index;
			_tmp6_ = _child_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _child_list;
			_tmp8_ = gee_list_get (_tmp7_, _child_index);
			child = (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) _tmp8_;
			_tmp9_ = child;
			proton_plus_widgets_games_launch_options_editor_ilaunch_option_clear (_tmp9_);
			_g_object_unref0 (child);
		}
	}
}

static gint
proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_unconsumed_token_index (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding* self,
                                                                                                  gchar** tokens_pool,
                                                                                                  gint tokens_pool_length1,
                                                                                                  const gchar* token,
                                                                                                  gboolean* consumed,
                                                                                                  gint consumed_length1)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (token != NULL, -1);
	{
		gint index = 0;
		index = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				gboolean _tmp2_ = FALSE;
				gboolean _tmp3_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = index;
					index = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				if (!(index < tokens_pool_length1)) {
					break;
				}
				_tmp3_ = consumed[index];
				if (!_tmp3_) {
					const gchar* _tmp4_;
					_tmp4_ = tokens_pool[index];
					_tmp2_ = g_strcmp0 (_tmp4_, token) == 0;
				} else {
					_tmp2_ = FALSE;
				}
				if (_tmp2_) {
					result = index;
					return result;
				}
			}
		}
	}
	result = -1;
	return result;
}

static gboolean
proton_plus_widgets_games_launch_options_editor_launch_option_binding_real_is_active (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding * self;
	GtkSwitch* _tmp0_;
	gboolean result;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding*) base;
	_tmp0_ = self->priv->_toggle;
	result = gtk_switch_get_active (_tmp0_);
	return result;
}

gchar**
proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_tokens (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding* self,
                                                                                  gint* result_length1)
{
	gchar** result;
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar** _tmp1_;
	gint _tmp1__length1;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_tokens;
	_tmp0__length1 = self->priv->_tokens_length1;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}

static gchar**
_vala_array_dup24 (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;
}

void
proton_plus_widgets_games_launch_options_editor_launch_option_binding_set_tokens (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding* self,
                                                                                  gchar** value,
                                                                                  gint value_length1)
{
	gchar** old_value;
	gint old_value_length;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_tokens (self, &old_value_length);
	if (old_value != value) {
		gchar** _tmp0_;
		gint _tmp0__length1;
		_tmp0_ = (value != NULL) ? _vala_array_dup24 (value, value_length1) : value;
		_tmp0__length1 = value_length1;
		self->priv->_tokens = (_vala_array_free (self->priv->_tokens, self->priv->_tokens_length1, (GDestroyNotify) g_free), NULL);
		self->priv->_tokens = _tmp0_;
		self->priv->_tokens_length1 = _tmp0__length1;
		self->priv->__tokens_size_ = self->priv->_tokens_length1;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_games_launch_options_editor_launch_option_binding_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_BINDING_TOKENS_PROPERTY]);
	}
}

GtkSwitch*
proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_toggle (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding* self)
{
	GtkSwitch* result;
	GtkSwitch* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_toggle;
	result = _tmp0_;
	return result;
}

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

void
proton_plus_widgets_games_launch_options_editor_launch_option_binding_set_toggle (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding* self,
                                                                                  GtkSwitch* value)
{
	GtkSwitch* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_toggle (self);
	if (old_value != value) {
		GtkSwitch* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_toggle);
		self->priv->_toggle = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_games_launch_options_editor_launch_option_binding_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_BINDING_TOGGLE_PROPERTY]);
	}
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_binding_class_init (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBindingClass * klass,
                                                                                  gpointer klass_data)
{
	proton_plus_widgets_games_launch_options_editor_launch_option_binding_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_games_launch_options_editor_launch_option_binding_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_games_launch_options_editor_launch_option_binding_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_BINDING_TOKENS_PROPERTY, proton_plus_widgets_games_launch_options_editor_launch_option_binding_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_BINDING_TOKENS_PROPERTY] = g_param_spec_boxed ("tokens", "tokens", "tokens", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_BINDING_TOGGLE_PROPERTY, proton_plus_widgets_games_launch_options_editor_launch_option_binding_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_BINDING_TOGGLE_PROPERTY] = g_param_spec_object ("toggle", "toggle", "toggle", gtk_switch_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_binding_proton_plus_widgets_games_launch_options_editor_ilaunch_option_interface_init (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOptionIface * iface,
                                                                                                                                                     gpointer iface_data)
{
	proton_plus_widgets_games_launch_options_editor_launch_option_binding_proton_plus_widgets_games_launch_options_editor_ilaunch_option_parent_iface = g_type_interface_peek_parent (iface);
	iface->parse_tokens = (void (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*, gchar**, gint, gboolean*, gint)) proton_plus_widgets_games_launch_options_editor_launch_option_binding_real_parse_tokens;
	iface->append_command_segments = (void (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*, GeeLinkedList*)) proton_plus_widgets_games_launch_options_editor_launch_option_binding_real_append_command_segments;
	iface->clear = (void (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*)) proton_plus_widgets_games_launch_options_editor_launch_option_binding_real_clear;
	iface->is_active = (gboolean (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*)) proton_plus_widgets_games_launch_options_editor_launch_option_binding_real_is_active;
	iface->add_child = (void (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*, ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*)) proton_plus_widgets_games_launch_options_editor_base_binding_add_child;
	iface->get_line_type = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBinding*)) proton_plus_widgets_games_launch_options_editor_base_binding_get_line_type;
	iface->set_line_type = (void (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBinding*, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType)) proton_plus_widgets_games_launch_options_editor_base_binding_set_line_type;
	iface->get_is_advanced = (gboolean (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBinding*)) proton_plus_widgets_games_launch_options_editor_base_binding_get_is_advanced;
	iface->set_is_advanced = (void (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorBaseBinding*, gboolean)) proton_plus_widgets_games_launch_options_editor_base_binding_set_is_advanced;
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_binding_instance_init (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding * self,
                                                                                     gpointer klass)
{
	self->priv = proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_instance_private (self);
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_binding_finalize (GObject * obj)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_BINDING, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding);
	self->priv->_tokens = (_vala_array_free (self->priv->_tokens, self->priv->_tokens_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (self->priv->_toggle);
	G_OBJECT_CLASS (proton_plus_widgets_games_launch_options_editor_launch_option_binding_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBindingClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_games_launch_options_editor_launch_option_binding_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding), 0, (GInstanceInitFunc) proton_plus_widgets_games_launch_options_editor_launch_option_binding_instance_init, NULL };
	static const GInterfaceInfo proton_plus_widgets_games_launch_options_editor_ilaunch_option_info = { (GInterfaceInitFunc) proton_plus_widgets_games_launch_options_editor_launch_option_binding_proton_plus_widgets_games_launch_options_editor_ilaunch_option_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType proton_plus_widgets_games_launch_options_editor_launch_option_binding_type_id;
	proton_plus_widgets_games_launch_options_editor_launch_option_binding_type_id = g_type_register_static (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_BASE_BINDING, "ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding", &g_define_type_info, 0);
	g_type_add_interface_static (proton_plus_widgets_games_launch_options_editor_launch_option_binding_type_id, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_ILAUNCH_OPTION, &proton_plus_widgets_games_launch_options_editor_ilaunch_option_info);
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding_private_offset = g_type_add_instance_private (proton_plus_widgets_games_launch_options_editor_launch_option_binding_type_id, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBindingPrivate));
	return proton_plus_widgets_games_launch_options_editor_launch_option_binding_type_id;
}

GType
proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_type (void)
{
	static volatile gsize proton_plus_widgets_games_launch_options_editor_launch_option_binding_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_games_launch_options_editor_launch_option_binding_type_id__once)) {
		GType proton_plus_widgets_games_launch_options_editor_launch_option_binding_type_id;
		proton_plus_widgets_games_launch_options_editor_launch_option_binding_type_id = proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_games_launch_options_editor_launch_option_binding_type_id__once, proton_plus_widgets_games_launch_options_editor_launch_option_binding_type_id);
	}
	return proton_plus_widgets_games_launch_options_editor_launch_option_binding_type_id__once;
}

static void
_vala_proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_property (GObject * object,
                                                                                          guint property_id,
                                                                                          GValue * value,
                                                                                          GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_BINDING, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_BINDING_TOKENS_PROPERTY:
		{
			int length;
			g_value_set_boxed (value, proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_tokens (self, &length));
		}
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_BINDING_TOGGLE_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_games_launch_options_editor_launch_option_binding_get_toggle (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_widgets_games_launch_options_editor_launch_option_binding_set_property (GObject * object,
                                                                                          guint property_id,
                                                                                          const GValue * value,
                                                                                          GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_BINDING, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionBinding);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_BINDING_TOKENS_PROPERTY:
		{
			gpointer boxed;
			boxed = g_value_get_boxed (value);
			proton_plus_widgets_games_launch_options_editor_launch_option_binding_set_tokens (self, boxed, (boxed == NULL) ? 0 : g_strv_length (boxed));
		}
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_BINDING_TOGGLE_PROPERTY:
		proton_plus_widgets_games_launch_options_editor_launch_option_binding_set_toggle (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

