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

#include <adwaita.h>
#include "protonplus_core.h"
#include <glib-object.h>
#include <gee.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_LAUNCH_OPTION_TILE (proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_type ())
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTileClass))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_LAUNCH_OPTION_TILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_LAUNCH_OPTION_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTileClass))

typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile;
typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTileClass ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTileClass;
typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTilePrivate ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTilePrivate;
enum  {
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_0_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_TOKENS_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_TOGGLE_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_LINE_TYPE_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_IS_ADVANCED_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_games_launch_options_editor_launch_option_tile_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_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 _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile {
	AdwActionRow parent_instance;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTilePrivate * priv;
	GeeList* _children;
};

struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTileClass {
	AdwActionRowClass parent_class;
};

struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTilePrivate {
	gchar** _tokens;
	gint _tokens_length1;
	gint __tokens_size_;
	GtkSwitch* _toggle;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType _line_type;
	gboolean _is_advanced;
};

static gint ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile_private_offset;
static gpointer proton_plus_widgets_games_launch_options_editor_launch_option_tile_parent_class = NULL;
static ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOptionIface * proton_plus_widgets_games_launch_options_editor_launch_option_tile_proton_plus_widgets_games_launch_options_editor_ilaunch_option_parent_iface = NULL;

VALA_EXTERN GType proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* proton_plus_widgets_games_launch_options_editor_launch_option_tile_new (const gchar* title,
                                                                                                                                   const gchar* subtitle,
                                                                                                                                   gchar** tokens,
                                                                                                                                   gint tokens_length1,
                                                                                                                                   gboolean is_advanced,
                                                                                                                                   ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType line_type);
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* proton_plus_widgets_games_launch_options_editor_launch_option_tile_construct (GType object_type,
                                                                                                                                         const gchar* title,
                                                                                                                                         const gchar* subtitle,
                                                                                                                                         gchar** tokens,
                                                                                                                                         gint tokens_length1,
                                                                                                                                         gboolean is_advanced,
                                                                                                                                         ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType line_type);
VALA_EXTERN void proton_plus_widgets_games_launch_options_editor_launch_option_tile_set_tokens (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* self,
                                                                                    gchar** value,
                                                                                    gint value_length1);
static void proton_plus_widgets_games_launch_options_editor_launch_option_tile_set_toggle (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* self,
                                                                                    GtkSwitch* value);
VALA_EXTERN GtkSwitch* proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_toggle (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* self);
static void proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_add_child (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base,
                                                                                        ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* child);
static void proton_plus_widgets_games_launch_options_editor_launch_option_tile_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_tile_get_tokens (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* self,
                                                                                       gint* result_length1);
static gint proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_unconsumed_token_index (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* self,
                                                                                                    gchar** tokens_pool,
                                                                                                    gint tokens_pool_length1,
                                                                                                    const gchar* token,
                                                                                                    gboolean* consumed,
                                                                                                    gint consumed_length1);
static void proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_append_command_segments (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base,
                                                                                                      GeeLinkedList* segments);
static void proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_clear (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base);
static gboolean proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_is_active (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base);
static gchar** _vala_array_dup49 (gchar** self,
                           gssize length);
static void proton_plus_widgets_games_launch_options_editor_launch_option_tile_finalize (GObject * obj);
static GType proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_type_once (void);
static void _vala_proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_property (GObject * object,
                                                                                            guint property_id,
                                                                                            GValue * value,
                                                                                            GParamSpec * pspec);
static void _vala_proton_plus_widgets_games_launch_options_editor_launch_option_tile_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_tile_get_instance_private (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile_private_offset);
}

ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile*
proton_plus_widgets_games_launch_options_editor_launch_option_tile_construct (GType object_type,
                                                                              const gchar* title,
                                                                              const gchar* subtitle,
                                                                              gchar** tokens,
                                                                              gint tokens_length1,
                                                                              gboolean is_advanced,
                                                                              ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType line_type)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile * self = NULL;
	GtkSwitch* _tmp0_;
	GtkSwitch* _tmp1_;
	GtkSwitch* _tmp2_;
	GtkSwitch* _tmp3_;
	GtkSwitch* _tmp4_;
	GtkSwitch* _tmp5_;
	GeeArrayList* _tmp6_;
	g_return_val_if_fail (title != NULL, NULL);
	g_return_val_if_fail (subtitle != NULL, NULL);
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile*) g_object_new (object_type, NULL);
	adw_preferences_row_set_title ((AdwPreferencesRow*) self, title);
	adw_action_row_set_subtitle ((AdwActionRow*) self, subtitle);
	adw_action_row_set_subtitle_lines ((AdwActionRow*) self, 0);
	gtk_widget_set_tooltip_text ((GtkWidget*) self, subtitle);
	proton_plus_widgets_games_launch_options_editor_launch_option_tile_set_tokens (self, tokens, tokens_length1);
	_tmp0_ = (GtkSwitch*) gtk_switch_new ();
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	proton_plus_widgets_games_launch_options_editor_launch_option_tile_set_toggle (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = self->priv->_toggle;
	gtk_widget_set_valign ((GtkWidget*) _tmp2_, GTK_ALIGN_CENTER);
	_tmp3_ = self->priv->_toggle;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp3_, subtitle);
	_tmp4_ = self->priv->_toggle;
	adw_action_row_add_suffix ((AdwActionRow*) self, (GtkWidget*) _tmp4_);
	_tmp5_ = self->priv->_toggle;
	adw_action_row_set_activatable_widget ((AdwActionRow*) self, (GtkWidget*) _tmp5_);
	proton_plus_widgets_games_launch_options_editor_ilaunch_option_set_is_advanced ((ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) self, is_advanced);
	proton_plus_widgets_games_launch_options_editor_ilaunch_option_set_line_type ((ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) self, line_type);
	_tmp6_ = gee_array_list_new (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_ILAUNCH_OPTION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_g_object_unref0 (self->_children);
	self->_children = (GeeList*) _tmp6_;
	return self;
}

ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile*
proton_plus_widgets_games_launch_options_editor_launch_option_tile_new (const gchar* title,
                                                                        const gchar* subtitle,
                                                                        gchar** tokens,
                                                                        gint tokens_length1,
                                                                        gboolean is_advanced,
                                                                        ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType line_type)
{
	return proton_plus_widgets_games_launch_options_editor_launch_option_tile_construct (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE, title, subtitle, tokens, tokens_length1, is_advanced, line_type);
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_add_child (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base,
                                                                                   ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* child)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile * self;
	GeeList* _tmp0_;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile*) base;
	g_return_if_fail (child != NULL);
	_tmp0_ = self->_children;
	gee_collection_add ((GeeCollection*) _tmp0_, child);
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_parse_tokens (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base,
                                                                                      gchar** tokens_pool,
                                                                                      gint tokens_pool_length1,
                                                                                      gboolean* consumed,
                                                                                      gint consumed_length1)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile * self;
	gchar** _tmp0_;
	gint _tmp0__length1;
	gint _tmp1_ = 0;
	gchar** _tmp2_;
	gint _tmp2__length1;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile*) base;
	if (tokens_pool_length1 != consumed_length1) {
		return;
	}
	_tmp0_ = proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_tokens (self, &_tmp1_);
	_tmp0__length1 = _tmp1_;
	_tmp2_ = _tmp0_;
	_tmp2__length1 = _tmp0__length1;
	if (_tmp2__length1 == 2) {
		gchar* off_token = NULL;
		gchar** _tmp3_;
		gint _tmp3__length1;
		gint _tmp4_ = 0;
		gchar** _tmp5_;
		gint _tmp5__length1;
		const gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* on_token = NULL;
		gchar** _tmp8_;
		gint _tmp8__length1;
		gint _tmp9_ = 0;
		gchar** _tmp10_;
		gint _tmp10__length1;
		const gchar* _tmp11_;
		gchar* _tmp12_;
		gint on_index = 0;
		const gchar* _tmp13_;
		_tmp3_ = proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_tokens (self, &_tmp4_);
		_tmp3__length1 = _tmp4_;
		_tmp5_ = _tmp3_;
		_tmp5__length1 = _tmp3__length1;
		_tmp6_ = _tmp5_[0];
		_tmp7_ = g_strdup (_tmp6_);
		off_token = _tmp7_;
		_tmp8_ = proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_tokens (self, &_tmp9_);
		_tmp8__length1 = _tmp9_;
		_tmp10_ = _tmp8_;
		_tmp10__length1 = _tmp8__length1;
		_tmp11_ = _tmp10_[1];
		_tmp12_ = g_strdup (_tmp11_);
		on_token = _tmp12_;
		_tmp13_ = on_token;
		on_index = proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_unconsumed_token_index (self, tokens_pool, (gint) tokens_pool_length1, _tmp13_, consumed, (gint) consumed_length1);
		if (on_index >= 0) {
			GtkSwitch* _tmp14_;
			_tmp14_ = self->priv->_toggle;
			gtk_switch_set_active (_tmp14_, TRUE);
			consumed[on_index] = TRUE;
		} else {
			gint off_index = 0;
			const gchar* _tmp15_;
			_tmp15_ = off_token;
			off_index = proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_unconsumed_token_index (self, tokens_pool, (gint) tokens_pool_length1, _tmp15_, consumed, (gint) consumed_length1);
			if (off_index >= 0) {
				GtkSwitch* _tmp16_;
				_tmp16_ = self->priv->_toggle;
				gtk_switch_set_active (_tmp16_, FALSE);
				consumed[off_index] = TRUE;
			}
		}
		_g_free0 (on_token);
		_g_free0 (off_token);
	} else {
		GeeLinkedList* token_indexes = NULL;
		GeeLinkedList* _tmp17_;
		gboolean all_tokens_present = FALSE;
		gchar** _tmp18_;
		gint _tmp18__length1;
		gint _tmp19_ = 0;
		gchar** _tmp20_;
		gint _tmp20__length1;
		gboolean _tmp24_ = FALSE;
		_tmp17_ = gee_linked_list_new (G_TYPE_INT, NULL, NULL, NULL, NULL, NULL);
		token_indexes = _tmp17_;
		all_tokens_present = TRUE;
		_tmp18_ = proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_tokens (self, &_tmp19_);
		_tmp18__length1 = _tmp19_;
		_tmp20_ = _tmp18_;
		_tmp20__length1 = _tmp18__length1;
		{
			gchar** token_collection = NULL;
			gint token_collection_length1 = 0;
			gint _token_collection_size_ = 0;
			gint token_it = 0;
			token_collection = _tmp20_;
			token_collection_length1 = _tmp20__length1;
			for (token_it = 0; token_it < token_collection_length1; token_it = token_it + 1) {
				gchar* _tmp21_;
				gchar* token = NULL;
				_tmp21_ = g_strdup (token_collection[token_it]);
				token = _tmp21_;
				{
					gint token_index = 0;
					const gchar* _tmp22_;
					GeeLinkedList* _tmp23_;
					_tmp22_ = token;
					token_index = proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_unconsumed_token_index (self, tokens_pool, (gint) tokens_pool_length1, _tmp22_, consumed, (gint) consumed_length1);
					if (token_index < 0) {
						all_tokens_present = FALSE;
						_g_free0 (token);
						break;
					}
					_tmp23_ = token_indexes;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp23_, (gpointer) ((gintptr) token_index));
					_g_free0 (token);
				}
			}
		}
		if (all_tokens_present) {
			GtkSwitch* _tmp25_;
			_tmp25_ = self->priv->_toggle;
			_tmp24_ = _tmp25_ != NULL;
		} else {
			_tmp24_ = FALSE;
		}
		if (_tmp24_) {
			GtkSwitch* _tmp26_;
			_tmp26_ = self->priv->_toggle;
			gtk_switch_set_active (_tmp26_, TRUE);
			{
				GeeLinkedList* _token_index_list = NULL;
				GeeLinkedList* _tmp27_;
				gint _token_index_size = 0;
				GeeLinkedList* _tmp28_;
				gint _tmp29_;
				gint _tmp30_;
				gint _token_index_index = 0;
				_tmp27_ = token_indexes;
				_token_index_list = _tmp27_;
				_tmp28_ = _token_index_list;
				_tmp29_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp28_);
				_tmp30_ = _tmp29_;
				_token_index_size = _tmp30_;
				_token_index_index = -1;
				while (TRUE) {
					gint _tmp31_;
					gint _tmp32_;
					gint token_index = 0;
					GeeLinkedList* _tmp33_;
					gpointer _tmp34_;
					_token_index_index = _token_index_index + 1;
					_tmp31_ = _token_index_index;
					_tmp32_ = _token_index_size;
					if (!(_tmp31_ < _tmp32_)) {
						break;
					}
					_tmp33_ = _token_index_list;
					_tmp34_ = gee_abstract_list_get ((GeeAbstractList*) _tmp33_, _token_index_index);
					token_index = (gint) ((gintptr) _tmp34_);
					consumed[token_index] = TRUE;
				}
			}
		}
		_g_object_unref0 (token_indexes);
	}
	{
		GeeList* _child_list = NULL;
		GeeList* _tmp35_;
		gint _child_size = 0;
		GeeList* _tmp36_;
		gint _tmp37_;
		gint _tmp38_;
		gint _child_index = 0;
		_tmp35_ = self->_children;
		_child_list = _tmp35_;
		_tmp36_ = _child_list;
		_tmp37_ = gee_collection_get_size ((GeeCollection*) _tmp36_);
		_tmp38_ = _tmp37_;
		_child_size = _tmp38_;
		_child_index = -1;
		while (TRUE) {
			gint _tmp39_;
			gint _tmp40_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* child = NULL;
			GeeList* _tmp41_;
			gpointer _tmp42_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* _tmp43_;
			_child_index = _child_index + 1;
			_tmp39_ = _child_index;
			_tmp40_ = _child_size;
			if (!(_tmp39_ < _tmp40_)) {
				break;
			}
			_tmp41_ = _child_list;
			_tmp42_ = gee_list_get (_tmp41_, _child_index);
			child = (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) _tmp42_;
			_tmp43_ = child;
			proton_plus_widgets_games_launch_options_editor_ilaunch_option_parse_tokens (_tmp43_, tokens_pool, (gint) tokens_pool_length1, consumed, (gint) consumed_length1);
			_g_object_unref0 (child);
		}
	}
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_append_command_segments (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base,
                                                                                                 GeeLinkedList* segments)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile * self;
	GtkSwitch* _tmp0_;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gint _tmp2_ = 0;
	gchar** _tmp3_;
	gint _tmp3__length1;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile*) 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_tile_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_ = 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_tile_real_clear (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile * self;
	GtkSwitch* _tmp0_;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile*) 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_ = 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 gboolean
proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_is_active (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile * self;
	GtkSwitch* _tmp0_;
	gboolean result;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile*) base;
	_tmp0_ = self->priv->_toggle;
	result = gtk_switch_get_active (_tmp0_);
	return result;
}

static gint
proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_unconsumed_token_index (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* 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;
}

gchar**
proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_tokens (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* 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_dup49 (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_tile_set_tokens (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* 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_tile_get_tokens (self, &old_value_length);
	if (old_value != value) {
		gchar** _tmp0_;
		gint _tmp0__length1;
		_tmp0_ = (value != NULL) ? _vala_array_dup49 (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_tile_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_TOKENS_PROPERTY]);
	}
}

GtkSwitch*
proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_toggle (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* 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;
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_tile_set_toggle (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* self,
                                                                               GtkSwitch* value)
{
	GtkSwitch* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_games_launch_options_editor_launch_option_tile_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_tile_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_TOGGLE_PROPERTY]);
	}
}

static ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType
proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_get_line_type (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* self;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile*) base;
	result = self->priv->_line_type;
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_set_line_type (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base,
                                                                                       ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType value)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* self;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType old_value;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile*) base;
	old_value = proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_get_line_type (base);
	if (old_value != value) {
		self->priv->_line_type = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_games_launch_options_editor_launch_option_tile_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_LINE_TYPE_PROPERTY]);
	}
}

static gboolean
proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_get_is_advanced (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base)
{
	gboolean result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* self;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile*) base;
	result = self->priv->_is_advanced;
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_set_is_advanced (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base,
                                                                                         gboolean value)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* self;
	gboolean old_value;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile*) base;
	old_value = proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_get_is_advanced (base);
	if (old_value != value) {
		self->priv->_is_advanced = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_games_launch_options_editor_launch_option_tile_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_IS_ADVANCED_PROPERTY]);
	}
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_tile_class_init (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTileClass * klass,
                                                                               gpointer klass_data)
{
	proton_plus_widgets_games_launch_options_editor_launch_option_tile_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_games_launch_options_editor_launch_option_tile_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_games_launch_options_editor_launch_option_tile_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_TOKENS_PROPERTY, proton_plus_widgets_games_launch_options_editor_launch_option_tile_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_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_TILE_TOGGLE_PROPERTY, proton_plus_widgets_games_launch_options_editor_launch_option_tile_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_TOGGLE_PROPERTY] = g_param_spec_object ("toggle", "toggle", "toggle", gtk_switch_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_LINE_TYPE_PROPERTY, proton_plus_widgets_games_launch_options_editor_launch_option_tile_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_LINE_TYPE_PROPERTY] = g_param_spec_enum ("line-type", "line-type", "line-type", PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_LINE_TYPE, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_LINE_TYPE_ENVIRONMENT, 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_TILE_IS_ADVANCED_PROPERTY, proton_plus_widgets_games_launch_options_editor_launch_option_tile_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_IS_ADVANCED_PROPERTY] = g_param_spec_boolean ("is-advanced", "is-advanced", "is-advanced", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_tile_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_tile_proton_plus_widgets_games_launch_options_editor_ilaunch_option_parent_iface = g_type_interface_peek_parent (iface);
	iface->add_child = (void (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*, ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*)) proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_add_child;
	iface->parse_tokens = (void (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*, gchar**, gint, gboolean*, gint)) proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_parse_tokens;
	iface->append_command_segments = (void (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*, GeeLinkedList*)) proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_append_command_segments;
	iface->clear = (void (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*)) proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_clear;
	iface->is_active = (gboolean (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*)) proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_is_active;
	iface->get_line_type = proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_get_line_type;
	iface->set_line_type = proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_set_line_type;
	iface->get_is_advanced = proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_get_is_advanced;
	iface->set_is_advanced = proton_plus_widgets_games_launch_options_editor_launch_option_tile_real_set_is_advanced;
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_tile_instance_init (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile * self,
                                                                                  gpointer klass)
{
	self->priv = proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_instance_private (self);
	self->priv->_line_type = PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_LINE_TYPE_ENVIRONMENT;
	self->priv->_is_advanced = FALSE;
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_tile_finalize (GObject * obj)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile);
	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_unref0 (self->_children);
	G_OBJECT_CLASS (proton_plus_widgets_games_launch_options_editor_launch_option_tile_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTileClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_games_launch_options_editor_launch_option_tile_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile), 0, (GInstanceInitFunc) proton_plus_widgets_games_launch_options_editor_launch_option_tile_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_tile_proton_plus_widgets_games_launch_options_editor_ilaunch_option_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType proton_plus_widgets_games_launch_options_editor_launch_option_tile_type_id;
	proton_plus_widgets_games_launch_options_editor_launch_option_tile_type_id = g_type_register_static (adw_action_row_get_type (), "ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile", &g_define_type_info, 0);
	g_type_add_interface_static (proton_plus_widgets_games_launch_options_editor_launch_option_tile_type_id, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_ILAUNCH_OPTION, &proton_plus_widgets_games_launch_options_editor_ilaunch_option_info);
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile_private_offset = g_type_add_instance_private (proton_plus_widgets_games_launch_options_editor_launch_option_tile_type_id, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTilePrivate));
	return proton_plus_widgets_games_launch_options_editor_launch_option_tile_type_id;
}

GType
proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_type (void)
{
	static volatile gsize proton_plus_widgets_games_launch_options_editor_launch_option_tile_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_games_launch_options_editor_launch_option_tile_type_id__once)) {
		GType proton_plus_widgets_games_launch_options_editor_launch_option_tile_type_id;
		proton_plus_widgets_games_launch_options_editor_launch_option_tile_type_id = proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_games_launch_options_editor_launch_option_tile_type_id__once, proton_plus_widgets_games_launch_options_editor_launch_option_tile_type_id);
	}
	return proton_plus_widgets_games_launch_options_editor_launch_option_tile_type_id__once;
}

static void
_vala_proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_property (GObject * object,
                                                                                       guint property_id,
                                                                                       GValue * value,
                                                                                       GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_TOKENS_PROPERTY:
		{
			int length;
			g_value_set_boxed (value, proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_tokens (self, &length));
		}
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_TOGGLE_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_toggle (self));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_LINE_TYPE_PROPERTY:
		g_value_set_enum (value, proton_plus_widgets_games_launch_options_editor_ilaunch_option_get_line_type ((ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) self));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_IS_ADVANCED_PROPERTY:
		g_value_set_boolean (value, proton_plus_widgets_games_launch_options_editor_ilaunch_option_get_is_advanced ((ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) 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_tile_set_property (GObject * object,
                                                                                       guint property_id,
                                                                                       const GValue * value,
                                                                                       GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_TOKENS_PROPERTY:
		{
			gpointer boxed;
			boxed = g_value_get_boxed (value);
			proton_plus_widgets_games_launch_options_editor_launch_option_tile_set_tokens (self, boxed, (boxed == NULL) ? 0 : g_strv_length (boxed));
		}
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_TOGGLE_PROPERTY:
		proton_plus_widgets_games_launch_options_editor_launch_option_tile_set_toggle (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_LINE_TYPE_PROPERTY:
		proton_plus_widgets_games_launch_options_editor_ilaunch_option_set_line_type ((ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) self, g_value_get_enum (value));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_IS_ADVANCED_PROPERTY:
		proton_plus_widgets_games_launch_options_editor_ilaunch_option_set_is_advanced ((ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) self, g_value_get_boolean (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;
}

