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

#include "protonplus_core.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <glib-object.h>
#include <adwaita.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_0_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_VALUE_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_ENVIRONMENT_VARIABLE_PREFIX_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_ENVIRONMENT_VARIABLE_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_LINE_TYPE_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairsPrivate {
	gboolean is_updating;
	gchar* separator;
	gchar* _environment_variable_prefix;
	gchar* _environment_variable;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType _line_type;
	GeeList* _children;
};

static gint ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs_private_offset;
static gpointer proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_parent_class = NULL;
static ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOptionIface * proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_proton_plus_widgets_games_launch_options_editor_ilaunch_option_parent_iface = NULL;

static void proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_real_add_child (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base,
                                                                                                ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* child);
static void proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_set_initial_value (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs* self,
                                                                                                   const gchar* raw_value);
static gchar* proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_get_formatted_value (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs* self);
static void _vala_array_add4 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void _vala_array_add5 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_real_trigger_changed_if_ready (ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow* base);
static void proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_real_parse_tokens (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base,
                                                                                                   gchar** tokens,
                                                                                                   gint tokens_length1,
                                                                                                   gboolean* consumed,
                                                                                                   gint consumed_length1);
static void proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_real_clear (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base);
static void proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_real_append_command_segments (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs* self,
                                                                                                              GeeLinkedList* segments);
static void proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_finalize (GObject * obj);
static GType proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_get_type_once (void);
static void _vala_proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_get_property (GObject * object,
                                                                                                    guint property_id,
                                                                                                    GValue * value,
                                                                                                    GParamSpec * pspec);
static void _vala_proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_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 gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_get_instance_private (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs_private_offset);
}

ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs*
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_construct (GType object_type,
                                                                                      const gchar* group_title,
                                                                                      const gchar* group_description,
                                                                                      const gchar* switch_title,
                                                                                      const gchar* switch_subtitle,
                                                                                      gchar** predefined_keys,
                                                                                      gint predefined_keys_length1,
                                                                                      gchar** options_display,
                                                                                      gint options_display_length1,
                                                                                      gchar** options_values,
                                                                                      gint options_values_length1,
                                                                                      GHashTable* tooltips,
                                                                                      const gchar* separator,
                                                                                      const gchar* environment_variable)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs * self = NULL;
	GeeArrayList* _tmp0_;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_;
	gchar* _tmp3_ = NULL;
	g_return_val_if_fail (group_title != NULL, NULL);
	g_return_val_if_fail (group_description != NULL, NULL);
	g_return_val_if_fail (switch_title != NULL, NULL);
	g_return_val_if_fail (switch_subtitle != NULL, NULL);
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs*) proton_plus_widgets_games_launch_options_editor_custom_expander_row_construct (object_type, switch_title, switch_subtitle, options_display, (gint) options_display_length1, options_values, (gint) options_values_length1, tooltips);
	_tmp0_ = 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->priv->_children);
	self->priv->_children = (GeeList*) _tmp0_;
	if (separator != NULL) {
		_tmp1_ = separator;
	} else {
		_tmp1_ = ",";
	}
	_tmp2_ = g_strdup (_tmp1_);
	_g_free0 (self->priv->separator);
	self->priv->separator = _tmp2_;
	proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_set_environment_variable (self, environment_variable);
	if (environment_variable != NULL) {
		gchar* _tmp4_;
		_tmp4_ = g_strconcat (environment_variable, "=", NULL);
		_g_free0 (_tmp3_);
		_tmp3_ = _tmp4_;
	} else {
		_g_free0 (_tmp3_);
		_tmp3_ = NULL;
	}
	proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_set_environment_variable_prefix (self, _tmp3_);
	self->priv->is_updating = FALSE;
	proton_plus_widgets_games_launch_options_editor_custom_expander_row_init_predefined_keys ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self, predefined_keys, (gint) predefined_keys_length1);
	_g_free0 (_tmp3_);
	return self;
}

ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs*
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_new (const gchar* group_title,
                                                                                const gchar* group_description,
                                                                                const gchar* switch_title,
                                                                                const gchar* switch_subtitle,
                                                                                gchar** predefined_keys,
                                                                                gint predefined_keys_length1,
                                                                                gchar** options_display,
                                                                                gint options_display_length1,
                                                                                gchar** options_values,
                                                                                gint options_values_length1,
                                                                                GHashTable* tooltips,
                                                                                const gchar* separator,
                                                                                const gchar* environment_variable)
{
	return proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_construct (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_CUSTOM_PAIRS, group_title, group_description, switch_title, switch_subtitle, predefined_keys, predefined_keys_length1, options_display, options_display_length1, options_values, options_values_length1, tooltips, separator, environment_variable);
}

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

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	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_custom_pairs_set_initial_value (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs* self,
                                                                                              const gchar* raw_value)
{
	const gchar* _tmp0_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp8_ = FALSE;
	gchar** _tmp9_;
	gint _tmp9__length1;
	gboolean is_flag_list = FALSE;
	gchar** parts = NULL;
	const gchar* _tmp12_;
	gchar** _tmp13_;
	gchar** _tmp14_;
	gint parts_length1;
	gint _parts_size_;
	gchar** _tmp15_;
	gint _tmp15__length1;
	g_return_if_fail (self != NULL);
	g_return_if_fail (raw_value != NULL);
	if (self->priv->is_updating) {
		return;
	}
	self->priv->is_updating = TRUE;
	_tmp0_ = self->priv->separator;
	if (_tmp0_ == NULL) {
		gchar* _tmp1_;
		_tmp1_ = g_strdup (",");
		_g_free0 (self->priv->separator);
		self->priv->separator = _tmp1_;
	}
	if (raw_value == NULL) {
		_tmp2_ = TRUE;
	} else {
		_tmp2_ = g_strcmp0 (raw_value, "") == 0;
	}
	if (_tmp2_) {
		GHashTable* _tmp3_;
		adw_expander_row_set_enable_expansion ((AdwExpanderRow*) self, FALSE);
		proton_plus_widgets_games_launch_options_editor_custom_expander_row_clear_custom_items ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self);
		_tmp3_ = ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self)->rows_map;
		if (_tmp3_ != NULL) {
			GHashTable* _tmp4_;
			GList* _tmp5_;
			_tmp4_ = ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self)->rows_map;
			_tmp5_ = g_hash_table_get_values (_tmp4_);
			{
				GList* row_collection = NULL;
				GList* row_it = NULL;
				row_collection = _tmp5_;
				for (row_it = row_collection; row_it != NULL; row_it = row_it->next) {
					AdwComboRow* row = NULL;
					row = (AdwComboRow*) row_it->data;
					{
						AdwComboRow* _tmp6_;
						_tmp6_ = row;
						if (_tmp6_ != NULL) {
							AdwComboRow* _tmp7_;
							_tmp7_ = row;
							adw_combo_row_set_selected (_tmp7_, (guint) 0);
						}
					}
				}
				(row_collection == NULL) ? NULL : (row_collection = (g_list_free (row_collection), NULL));
			}
		}
		self->priv->is_updating = FALSE;
		return;
	}
	adw_expander_row_set_enable_expansion ((AdwExpanderRow*) self, TRUE);
	_tmp9_ = ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self)->options_values;
	_tmp9__length1 = ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self)->options_values_length1;
	if (_tmp9__length1 > 1) {
		gchar** _tmp10_;
		gint _tmp10__length1;
		const gchar* _tmp11_;
		_tmp10_ = ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self)->options_values;
		_tmp10__length1 = ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self)->options_values_length1;
		_tmp11_ = _tmp10_[1];
		_tmp8_ = g_strcmp0 (_tmp11_, "1") == 0;
	} else {
		_tmp8_ = FALSE;
	}
	is_flag_list = _tmp8_;
	_tmp12_ = self->priv->separator;
	_tmp14_ = _tmp13_ = g_strsplit (raw_value, _tmp12_, 0);
	parts = _tmp14_;
	parts_length1 = _vala_array_length (_tmp13_);
	_parts_size_ = parts_length1;
	_tmp15_ = parts;
	_tmp15__length1 = parts_length1;
	{
		gchar** part_collection = NULL;
		gint part_collection_length1 = 0;
		gint _part_collection_size_ = 0;
		gint part_it = 0;
		part_collection = _tmp15_;
		part_collection_length1 = _tmp15__length1;
		for (part_it = 0; part_it < part_collection_length1; part_it = part_it + 1) {
			gchar* _tmp16_;
			gchar* part = NULL;
			_tmp16_ = g_strdup (part_collection[part_it]);
			part = _tmp16_;
			{
				gchar* clean_part = NULL;
				const gchar* _tmp17_;
				gchar* _tmp18_;
				gchar* _tmp19_;
				gchar* _tmp20_;
				gchar* _tmp21_;
				const gchar* _tmp22_;
				gchar** kv = NULL;
				const gchar* _tmp23_;
				gchar** _tmp24_;
				gchar** _tmp25_;
				gint kv_length1;
				gint _kv_size_;
				gchar* key = NULL;
				gchar* _tmp26_;
				gchar* val = NULL;
				gchar* _tmp27_;
				gchar** _tmp28_;
				gint _tmp28__length1;
				const gchar* _tmp38_;
				_tmp17_ = part;
				_tmp18_ = string_strip (_tmp17_);
				_tmp19_ = _tmp18_;
				_tmp20_ = g_utf8_strdown (_tmp19_, (gssize) -1);
				_tmp21_ = _tmp20_;
				_g_free0 (_tmp19_);
				clean_part = _tmp21_;
				_tmp22_ = clean_part;
				if (g_strcmp0 (_tmp22_, "") == 0) {
					_g_free0 (clean_part);
					_g_free0 (part);
					continue;
				}
				_tmp23_ = clean_part;
				_tmp25_ = _tmp24_ = g_strsplit (_tmp23_, "=", 0);
				kv = _tmp25_;
				kv_length1 = _vala_array_length (_tmp24_);
				_kv_size_ = kv_length1;
				_tmp26_ = g_strdup ("");
				key = _tmp26_;
				_tmp27_ = g_strdup ("");
				val = _tmp27_;
				_tmp28_ = kv;
				_tmp28__length1 = kv_length1;
				if (_tmp28__length1 == 2) {
					gchar** _tmp29_;
					gint _tmp29__length1;
					const gchar* _tmp30_;
					gchar* _tmp31_;
					gchar** _tmp32_;
					gint _tmp32__length1;
					const gchar* _tmp33_;
					gchar* _tmp34_;
					_tmp29_ = kv;
					_tmp29__length1 = kv_length1;
					_tmp30_ = _tmp29_[0];
					_tmp31_ = string_strip (_tmp30_);
					_g_free0 (key);
					key = _tmp31_;
					_tmp32_ = kv;
					_tmp32__length1 = kv_length1;
					_tmp33_ = _tmp32_[1];
					_tmp34_ = string_strip (_tmp33_);
					_g_free0 (val);
					val = _tmp34_;
				} else {
					if (is_flag_list) {
						const gchar* _tmp35_;
						gchar* _tmp36_;
						gchar* _tmp37_;
						_tmp35_ = clean_part;
						_tmp36_ = g_strdup (_tmp35_);
						_g_free0 (key);
						key = _tmp36_;
						_tmp37_ = g_strdup ("1");
						_g_free0 (val);
						val = _tmp37_;
					}
				}
				_tmp38_ = key;
				if (g_strcmp0 (_tmp38_, "") != 0) {
					GHashTable* _tmp39_;
					const gchar* _tmp40_;
					_tmp39_ = ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self)->rows_map;
					_tmp40_ = key;
					if (!g_hash_table_contains (_tmp39_, _tmp40_)) {
						const gchar* _tmp41_;
						const gchar* _tmp42_;
						_tmp41_ = key;
						_tmp42_ = val;
						proton_plus_widgets_games_launch_options_editor_custom_expander_row_force_add_custom_row ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self, _tmp41_, _tmp42_);
					} else {
						AdwComboRow* row = NULL;
						GHashTable* _tmp43_;
						const gchar* _tmp44_;
						gconstpointer _tmp45_;
						AdwComboRow* _tmp46_;
						_tmp43_ = ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self)->rows_map;
						_tmp44_ = key;
						_tmp45_ = g_hash_table_lookup (_tmp43_, _tmp44_);
						_tmp46_ = _g_object_ref0 ((AdwComboRow*) _tmp45_);
						row = _tmp46_;
						{
							guint i = 0U;
							i = (guint) 0;
							{
								gboolean _tmp47_ = FALSE;
								_tmp47_ = TRUE;
								while (TRUE) {
									gchar** _tmp49_;
									gint _tmp49__length1;
									gchar** _tmp50_;
									gint _tmp50__length1;
									const gchar* _tmp51_;
									const gchar* _tmp52_;
									if (!_tmp47_) {
										guint _tmp48_;
										_tmp48_ = i;
										i = _tmp48_ + 1;
									}
									_tmp47_ = FALSE;
									_tmp49_ = ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self)->options_values;
									_tmp49__length1 = ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self)->options_values_length1;
									if (!(i < ((guint) _tmp49__length1))) {
										break;
									}
									_tmp50_ = ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self)->options_values;
									_tmp50__length1 = ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self)->options_values_length1;
									_tmp51_ = _tmp50_[i];
									_tmp52_ = val;
									if (g_strcmp0 (_tmp51_, _tmp52_) == 0) {
										AdwComboRow* _tmp53_;
										_tmp53_ = row;
										adw_combo_row_set_selected (_tmp53_, i);
										break;
									}
								}
							}
						}
						_g_object_unref0 (row);
					}
				}
				_g_free0 (val);
				_g_free0 (key);
				kv = (_vala_array_free (kv, kv_length1, (GDestroyNotify) g_free), NULL);
				_g_free0 (clean_part);
				_g_free0 (part);
			}
		}
	}
	self->priv->is_updating = FALSE;
	parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
}

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

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

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

static gchar*
_vala_g_strjoinv (const gchar* separator,
                  gchar** str_array,
                  gint str_array_length1)
{
	gboolean _tmp0_ = FALSE;
	gchar* result;
	if (separator == NULL) {
		separator = "";
	}
	if (str_array != NULL) {
		gboolean _tmp1_ = FALSE;
		if (str_array_length1 > 0) {
			_tmp1_ = TRUE;
		} else {
			gboolean _tmp2_ = FALSE;
			if (str_array_length1 == -1) {
				const gchar* _tmp3_;
				_tmp3_ = str_array[0];
				_tmp2_ = _tmp3_ != NULL;
			} else {
				_tmp2_ = FALSE;
			}
			_tmp1_ = _tmp2_;
		}
		_tmp0_ = _tmp1_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gint i = 0;
		gsize len = 0UL;
		gint _tmp16_;
		gint _tmp17_;
		const gchar* res = NULL;
		void* _tmp18_;
		const gchar* _tmp19_ = NULL;
		const gchar* _tmp20_;
		void* ptr = NULL;
		const gchar* _tmp22_;
		void* _tmp23_;
		const gchar* _tmp33_;
		len = (gsize) 1;
		{
			gboolean _tmp4_ = FALSE;
			i = 0;
			_tmp4_ = TRUE;
			while (TRUE) {
				gboolean _tmp6_ = FALSE;
				gboolean _tmp7_ = FALSE;
				gint _tmp10_ = 0;
				const gchar* _tmp11_;
				if (!_tmp4_) {
					gint _tmp5_;
					_tmp5_ = i;
					i = _tmp5_ + 1;
				}
				_tmp4_ = FALSE;
				if (str_array_length1 != -1) {
					_tmp7_ = i < str_array_length1;
				} else {
					_tmp7_ = FALSE;
				}
				if (_tmp7_) {
					_tmp6_ = TRUE;
				} else {
					gboolean _tmp8_ = FALSE;
					if (str_array_length1 == -1) {
						const gchar* _tmp9_;
						_tmp9_ = str_array[i];
						_tmp8_ = _tmp9_ != NULL;
					} else {
						_tmp8_ = FALSE;
					}
					_tmp6_ = _tmp8_;
				}
				if (!_tmp6_) {
					break;
				}
				_tmp11_ = str_array[i];
				if (_tmp11_ != NULL) {
					const gchar* _tmp12_;
					gint _tmp13_;
					gint _tmp14_;
					_tmp12_ = str_array[i];
					_tmp13_ = strlen ((const gchar*) _tmp12_);
					_tmp14_ = _tmp13_;
					_tmp10_ = _tmp14_;
				} else {
					_tmp10_ = 0;
				}
				len += (gsize) _tmp10_;
			}
		}
		if (i == 0) {
			gchar* _tmp15_;
			_tmp15_ = g_strdup ("");
			result = _tmp15_;
			return result;
		}
		str_array_length1 = i;
		_tmp16_ = strlen ((const gchar*) separator);
		_tmp17_ = _tmp16_;
		len += (gsize) (_tmp17_ * (i - 1));
		_tmp18_ = g_malloc (len);
		res = _tmp18_;
		_tmp20_ = str_array[0];
		if (_tmp20_ != NULL) {
			const gchar* _tmp21_;
			_tmp21_ = str_array[0];
			_tmp19_ = (const gchar*) _tmp21_;
		} else {
			_tmp19_ = "";
		}
		_tmp22_ = res;
		_tmp23_ = g_stpcpy ((void*) _tmp22_, _tmp19_);
		ptr = _tmp23_;
		{
			gboolean _tmp24_ = FALSE;
			i = 1;
			_tmp24_ = TRUE;
			while (TRUE) {
				void* _tmp26_;
				void* _tmp27_;
				const gchar* _tmp28_ = NULL;
				const gchar* _tmp29_;
				void* _tmp31_;
				void* _tmp32_;
				if (!_tmp24_) {
					gint _tmp25_;
					_tmp25_ = i;
					i = _tmp25_ + 1;
				}
				_tmp24_ = FALSE;
				if (!(i < str_array_length1)) {
					break;
				}
				_tmp26_ = ptr;
				_tmp27_ = g_stpcpy (_tmp26_, (const gchar*) separator);
				ptr = _tmp27_;
				_tmp29_ = str_array[i];
				if (_tmp29_ != NULL) {
					const gchar* _tmp30_;
					_tmp30_ = str_array[i];
					_tmp28_ = (const gchar*) _tmp30_;
				} else {
					_tmp28_ = "";
				}
				_tmp31_ = ptr;
				_tmp32_ = g_stpcpy (_tmp31_, _tmp28_);
				ptr = _tmp32_;
			}
		}
		_tmp33_ = res;
		res = NULL;
		result = (gchar*) _tmp33_;
		return result;
	} else {
		gchar* _tmp34_;
		_tmp34_ = g_strdup ("");
		result = _tmp34_;
		return result;
	}
}

static gchar*
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_get_formatted_value (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs* self)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	gchar** final_parts = NULL;
	gchar** _tmp3_;
	gint final_parts_length1;
	gint _final_parts_size_;
	gboolean _tmp4_ = FALSE;
	gchar** _tmp5_;
	gint _tmp5__length1;
	gboolean is_flag_list = FALSE;
	GHashTable* _tmp8_;
	const gchar* _tmp38_;
	gchar** _tmp39_;
	gint _tmp39__length1;
	gchar* _tmp40_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = adw_expander_row_get_enable_expansion ((AdwExpanderRow*) self);
	_tmp1_ = _tmp0_;
	if (!_tmp1_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup ("");
		result = _tmp2_;
		return result;
	}
	_tmp3_ = g_new0 (gchar*, 0 + 1);
	final_parts = _tmp3_;
	final_parts_length1 = 0;
	_final_parts_size_ = final_parts_length1;
	_tmp5_ = ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self)->options_values;
	_tmp5__length1 = ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self)->options_values_length1;
	if (_tmp5__length1 > 1) {
		gchar** _tmp6_;
		gint _tmp6__length1;
		const gchar* _tmp7_;
		_tmp6_ = ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self)->options_values;
		_tmp6__length1 = ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self)->options_values_length1;
		_tmp7_ = _tmp6_[1];
		_tmp4_ = g_strcmp0 (_tmp7_, "1") == 0;
	} else {
		_tmp4_ = FALSE;
	}
	is_flag_list = _tmp4_;
	_tmp8_ = ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self)->rows_map;
	if (_tmp8_ != NULL) {
		{
			GeeArrayList* _key_list = NULL;
			GeeArrayList* _tmp9_;
			gint _key_size = 0;
			GeeArrayList* _tmp10_;
			gint _tmp11_;
			gint _tmp12_;
			gint _key_index = 0;
			_tmp9_ = ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self)->row_order;
			_key_list = _tmp9_;
			_tmp10_ = _key_list;
			_tmp11_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp10_);
			_tmp12_ = _tmp11_;
			_key_size = _tmp12_;
			_key_index = -1;
			while (TRUE) {
				gint _tmp13_;
				gint _tmp14_;
				gchar* key = NULL;
				GeeArrayList* _tmp15_;
				gpointer _tmp16_;
				AdwComboRow* combo_row = NULL;
				GHashTable* _tmp17_;
				const gchar* _tmp18_;
				gconstpointer _tmp19_;
				AdwComboRow* _tmp20_;
				AdwComboRow* _tmp21_;
				guint selected = 0U;
				AdwComboRow* _tmp22_;
				guint _tmp23_;
				guint _tmp24_;
				gchar* val = NULL;
				gchar** _tmp25_;
				gint _tmp25__length1;
				const gchar* _tmp26_;
				gchar* _tmp27_;
				const gchar* _tmp28_;
				_key_index = _key_index + 1;
				_tmp13_ = _key_index;
				_tmp14_ = _key_size;
				if (!(_tmp13_ < _tmp14_)) {
					break;
				}
				_tmp15_ = _key_list;
				_tmp16_ = gee_abstract_list_get ((GeeAbstractList*) _tmp15_, _key_index);
				key = (gchar*) _tmp16_;
				_tmp17_ = ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self)->rows_map;
				_tmp18_ = key;
				_tmp19_ = g_hash_table_lookup (_tmp17_, _tmp18_);
				_tmp20_ = _g_object_ref0 ((AdwComboRow*) _tmp19_);
				combo_row = _tmp20_;
				_tmp21_ = combo_row;
				if (_tmp21_ == NULL) {
					_g_object_unref0 (combo_row);
					_g_free0 (key);
					continue;
				}
				_tmp22_ = combo_row;
				_tmp23_ = adw_combo_row_get_selected (_tmp22_);
				_tmp24_ = _tmp23_;
				selected = _tmp24_;
				_tmp25_ = ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self)->options_values;
				_tmp25__length1 = ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self)->options_values_length1;
				_tmp26_ = _tmp25_[selected];
				_tmp27_ = g_strdup (_tmp26_);
				val = _tmp27_;
				_tmp28_ = val;
				if (g_strcmp0 (_tmp28_, "") != 0) {
					if (is_flag_list) {
						AdwComboRow* _tmp29_;
						const gchar* _tmp30_;
						const gchar* _tmp31_;
						gchar* _tmp32_;
						_tmp29_ = combo_row;
						_tmp30_ = adw_preferences_row_get_title ((AdwPreferencesRow*) _tmp29_);
						_tmp31_ = _tmp30_;
						_tmp32_ = g_strdup (_tmp31_);
						_vala_array_add4 (&final_parts, &final_parts_length1, &_final_parts_size_, _tmp32_);
					} else {
						const gchar* _tmp33_;
						const gchar* _tmp34_;
						const gchar* _tmp35_;
						const gchar* _tmp36_;
						gchar* _tmp37_;
						_tmp33_ = key;
						_tmp34_ = string_to_string (_tmp33_);
						_tmp35_ = val;
						_tmp36_ = string_to_string (_tmp35_);
						_tmp37_ = g_strconcat (_tmp34_, "=", _tmp36_, NULL);
						_vala_array_add5 (&final_parts, &final_parts_length1, &_final_parts_size_, _tmp37_);
					}
				}
				_g_free0 (val);
				_g_object_unref0 (combo_row);
				_g_free0 (key);
			}
		}
	}
	_tmp38_ = self->priv->separator;
	_tmp39_ = final_parts;
	_tmp39__length1 = final_parts_length1;
	_tmp40_ = _vala_g_strjoinv (_tmp38_, _tmp39_, (gint) _tmp39__length1);
	result = _tmp40_;
	final_parts = (_vala_array_free (final_parts, final_parts_length1, (GDestroyNotify) g_free), NULL);
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_real_trigger_changed_if_ready (ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow* base)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs * self;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs*) base;
	if (!self->priv->is_updating) {
		g_signal_emit_by_name ((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*) self, "changed");
	}
}

static glong
string_strnlen (gchar* str,
                glong maxlen)
{
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	glong result;
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
	end = _tmp0_;
	_tmp1_ = end;
	if (_tmp1_ == NULL) {
		result = maxlen;
		return result;
	} else {
		gchar* _tmp2_;
		_tmp2_ = end;
		result = (glong) (_tmp2_ - str);
		return result;
	}
}

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

static void
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_real_parse_tokens (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base,
                                                                                              gchar** tokens,
                                                                                              gint tokens_length1,
                                                                                              gboolean* consumed,
                                                                                              gint consumed_length1)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs * self;
	gchar* raw = NULL;
	gchar* _tmp0_;
	const gchar* _tmp11_;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs*) base;
	_tmp0_ = g_strdup ("");
	raw = _tmp0_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				gboolean _tmp3_;
				const gchar* _tmp4_;
				const gchar* _tmp5_;
				if (!_tmp1_) {
					gint _tmp2_;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp1_ = FALSE;
				if (!(i < tokens_length1)) {
					break;
				}
				_tmp3_ = consumed[i];
				if (_tmp3_) {
					continue;
				}
				_tmp4_ = tokens[i];
				_tmp5_ = self->priv->_environment_variable_prefix;
				if (g_str_has_prefix (_tmp4_, _tmp5_)) {
					const gchar* _tmp6_;
					const gchar* _tmp7_;
					gint _tmp8_;
					gint _tmp9_;
					gchar* _tmp10_;
					_tmp6_ = tokens[i];
					_tmp7_ = self->priv->_environment_variable_prefix;
					_tmp8_ = strlen (_tmp7_);
					_tmp9_ = _tmp8_;
					_tmp10_ = string_substring (_tmp6_, (glong) _tmp9_, (glong) -1);
					_g_free0 (raw);
					raw = _tmp10_;
					consumed[i] = TRUE;
					break;
				}
			}
		}
	}
	_tmp11_ = raw;
	proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_set_value (self, _tmp11_);
	{
		GeeList* _child_list = NULL;
		GeeList* _tmp12_;
		gint _child_size = 0;
		GeeList* _tmp13_;
		gint _tmp14_;
		gint _tmp15_;
		gint _child_index = 0;
		_tmp12_ = self->priv->_children;
		_child_list = _tmp12_;
		_tmp13_ = _child_list;
		_tmp14_ = gee_collection_get_size ((GeeCollection*) _tmp13_);
		_tmp15_ = _tmp14_;
		_child_size = _tmp15_;
		_child_index = -1;
		while (TRUE) {
			gint _tmp16_;
			gint _tmp17_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* child = NULL;
			GeeList* _tmp18_;
			gpointer _tmp19_;
			ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* _tmp20_;
			_child_index = _child_index + 1;
			_tmp16_ = _child_index;
			_tmp17_ = _child_size;
			if (!(_tmp16_ < _tmp17_)) {
				break;
			}
			_tmp18_ = _child_list;
			_tmp19_ = gee_list_get (_tmp18_, _child_index);
			child = (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) _tmp19_;
			_tmp20_ = child;
			proton_plus_widgets_games_launch_options_editor_ilaunch_option_parse_tokens (_tmp20_, tokens, (gint) tokens_length1, consumed, (gint) consumed_length1);
			_g_object_unref0 (child);
		}
	}
	_g_free0 (raw);
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_real_clear (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs * self;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs*) base;
	proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_set_value (self, "");
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_real_append_command_segments (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs* self,
                                                                                                         GeeLinkedList* segments)
{
	gchar* val = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (segments != NULL);
	_tmp0_ = proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_get_value (self);
	_tmp1_ = _tmp0_;
	val = _tmp1_;
	_tmp2_ = val;
	if (g_strcmp0 (_tmp2_, "") != 0) {
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		_tmp3_ = self->priv->_environment_variable_prefix;
		_tmp4_ = val;
		_tmp5_ = g_strconcat (_tmp3_, _tmp4_, NULL);
		_tmp6_ = _tmp5_;
		gee_abstract_collection_add ((GeeAbstractCollection*) segments, _tmp6_);
		_g_free0 (_tmp6_);
		{
			GeeList* _child_list = NULL;
			GeeList* _tmp7_;
			gint _child_size = 0;
			GeeList* _tmp8_;
			gint _tmp9_;
			gint _tmp10_;
			gint _child_index = 0;
			_tmp7_ = self->priv->_children;
			_child_list = _tmp7_;
			_tmp8_ = _child_list;
			_tmp9_ = gee_collection_get_size ((GeeCollection*) _tmp8_);
			_tmp10_ = _tmp9_;
			_child_size = _tmp10_;
			_child_index = -1;
			while (TRUE) {
				gint _tmp11_;
				gint _tmp12_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* child = NULL;
				GeeList* _tmp13_;
				gpointer _tmp14_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* _tmp15_;
				_child_index = _child_index + 1;
				_tmp11_ = _child_index;
				_tmp12_ = _child_size;
				if (!(_tmp11_ < _tmp12_)) {
					break;
				}
				_tmp13_ = _child_list;
				_tmp14_ = gee_list_get (_tmp13_, _child_index);
				child = (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) _tmp14_;
				_tmp15_ = child;
				if (proton_plus_widgets_games_launch_options_editor_ilaunch_option_is_active (_tmp15_)) {
					ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* _tmp16_;
					_tmp16_ = child;
					proton_plus_widgets_games_launch_options_editor_ilaunch_option_append_command_segments (_tmp16_, segments);
				}
				_g_object_unref0 (child);
			}
		}
	}
	_g_free0 (val);
}

void
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_append_command_segments (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs* self,
                                                                                                    GeeLinkedList* segments)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairsClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_GET_CLASS (self);
	if (_klass_->append_command_segments) {
		_klass_->append_command_segments (self, segments);
	}
}

gchar*
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_get_value (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs* self)
{
	gchar* result;
	gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_get_formatted_value (self);
	result = _tmp0_;
	return result;
}

void
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_set_value (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs* self,
                                                                                      const gchar* value)
{
	g_return_if_fail (self != NULL);
	proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_set_initial_value (self, value);
	g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_VALUE_PROPERTY]);
}

const gchar*
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_get_environment_variable_prefix (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_environment_variable_prefix;
	result = _tmp0_;
	return result;
}

void
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_set_environment_variable_prefix (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs* self,
                                                                                                            const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_get_environment_variable_prefix (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_environment_variable_prefix);
		self->priv->_environment_variable_prefix = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_ENVIRONMENT_VARIABLE_PREFIX_PROPERTY]);
	}
}

const gchar*
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_get_environment_variable (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_environment_variable;
	result = _tmp0_;
	return result;
}

void
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_set_environment_variable (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs* self,
                                                                                                     const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_get_environment_variable (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_environment_variable);
		self->priv->_environment_variable = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_ENVIRONMENT_VARIABLE_PROPERTY]);
	}
}

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

static void
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_real_set_line_type (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base,
                                                                                               ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType value)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs* self;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType old_value;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs*) base;
	old_value = proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_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_custom_pairs_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_LINE_TYPE_PROPERTY]);
	}
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_class_init (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairsClass * klass,
                                                                                       gpointer klass_data)
{
	proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs_private_offset);
	((ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRowClass *) klass)->trigger_changed_if_ready = (void (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*)) proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_real_trigger_changed_if_ready;
	((ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairsClass *) klass)->append_command_segments = (void (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs*, GeeLinkedList*)) proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_real_append_command_segments;
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_VALUE_PROPERTY, proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_VALUE_PROPERTY] = g_param_spec_string ("value", "value", "value", NULL, 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_CUSTOM_PAIRS_ENVIRONMENT_VARIABLE_PREFIX_PROPERTY, proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_ENVIRONMENT_VARIABLE_PREFIX_PROPERTY] = g_param_spec_string ("environment-variable-prefix", "environment-variable-prefix", "environment-variable-prefix", NULL, 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_CUSTOM_PAIRS_ENVIRONMENT_VARIABLE_PROPERTY, proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_ENVIRONMENT_VARIABLE_PROPERTY] = g_param_spec_string ("environment-variable", "environment-variable", "environment-variable", NULL, 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_CUSTOM_PAIRS_LINE_TYPE_PROPERTY, proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_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));
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_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_custom_pairs_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_custom_pairs_real_add_child;
	iface->parse_tokens = (void (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*, gchar**, gint, gboolean*, gint)) proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_real_parse_tokens;
	iface->clear = (void (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*)) proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_real_clear;
	iface->append_command_segments = (void (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*, GeeLinkedList*)) proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_append_command_segments;
	iface->is_active = (gboolean (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*)) proton_plus_widgets_games_launch_options_editor_custom_expander_row_is_active;
	iface->get_line_type = proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_real_get_line_type;
	iface->set_line_type = proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_real_set_line_type;
	iface->get_is_advanced = (gboolean (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*)) proton_plus_widgets_games_launch_options_editor_custom_expander_row_get_is_advanced;
	iface->set_is_advanced = (void (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorCustomExpanderRow*, gboolean)) proton_plus_widgets_games_launch_options_editor_custom_expander_row_set_is_advanced;
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_instance_init (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs * self,
                                                                                          gpointer klass)
{
	self->priv = proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_get_instance_private (self);
	self->priv->is_updating = FALSE;
	self->priv->_line_type = PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_LINE_TYPE_ENVIRONMENT;
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_finalize (GObject * obj)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_CUSTOM_PAIRS, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs);
	_g_free0 (self->priv->separator);
	_g_free0 (self->priv->_environment_variable_prefix);
	_g_free0 (self->priv->_environment_variable);
	_g_object_unref0 (self->priv->_children);
	G_OBJECT_CLASS (proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs), 0, (GInstanceInitFunc) proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_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_custom_pairs_proton_plus_widgets_games_launch_options_editor_ilaunch_option_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_type_id;
	proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_type_id = g_type_register_static (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_CUSTOM_EXPANDER_ROW, "ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs", &g_define_type_info, 0);
	g_type_add_interface_static (proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_type_id, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_ILAUNCH_OPTION, &proton_plus_widgets_games_launch_options_editor_ilaunch_option_info);
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs_private_offset = g_type_add_instance_private (proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_type_id, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairsPrivate));
	return proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_type_id;
}

GType
proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_get_type (void)
{
	static volatile gsize proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_type_id__once)) {
		GType proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_type_id;
		proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_type_id = proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_type_id__once, proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_type_id);
	}
	return proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_type_id__once;
}

static void
_vala_proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_get_property (GObject * object,
                                                                                               guint property_id,
                                                                                               GValue * value,
                                                                                               GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_CUSTOM_PAIRS, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_VALUE_PROPERTY:
		g_value_take_string (value, proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_get_value (self));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_ENVIRONMENT_VARIABLE_PREFIX_PROPERTY:
		g_value_set_string (value, proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_get_environment_variable_prefix (self));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_ENVIRONMENT_VARIABLE_PROPERTY:
		g_value_set_string (value, proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_get_environment_variable (self));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_LINE_TYPE_PROPERTY:
		g_value_set_enum (value, proton_plus_widgets_games_launch_options_editor_ilaunch_option_get_line_type ((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_custom_pairs_set_property (GObject * object,
                                                                                               guint property_id,
                                                                                               const GValue * value,
                                                                                               GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_CUSTOM_PAIRS, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionCustomPairs);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_VALUE_PROPERTY:
		proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_set_value (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_ENVIRONMENT_VARIABLE_PREFIX_PROPERTY:
		proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_set_environment_variable_prefix (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_ENVIRONMENT_VARIABLE_PROPERTY:
		proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_set_environment_variable (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_CUSTOM_PAIRS_LINE_TYPE_PROPERTY:
		proton_plus_widgets_games_launch_options_editor_ilaunch_option_set_line_type ((ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) self, g_value_get_enum (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 gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

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

