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

#include <adwaita.h>
#include "protonplus_core.h"
#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include <glib/gi18n-lib.h>
#include <errno.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_SPIN_TILE (proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_type ())
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTileClass))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_LAUNCH_OPTION_SPIN_TILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_LAUNCH_OPTION_SPIN_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTileClass))

typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile;
typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTileClass ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTileClass;
typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTilePrivate ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTilePrivate;
enum  {
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_0_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_TOGGLE_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_VALUE_ENTRY_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_APPLY_BUTTON_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_IS_ADVANCED_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_LINE_TYPE_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_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))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
enum  {
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_VALUE_APPLIED_SIGNAL,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_NUM_SIGNALS
};
static guint proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_signals[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_NUM_SIGNALS] = {0};

struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile {
	AdwActionRow parent_instance;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTilePrivate * priv;
};

struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTileClass {
	AdwActionRowClass parent_class;
};

struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTilePrivate {
	GtkSwitch* _toggle;
	GtkEntry* _value_entry;
	GtkButton* _apply_button;
	GtkBox* value_box;
	gint lower_value;
	gint upper_value;
	gint committed_value;
	gboolean _is_advanced;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType _line_type;
	GeeList* _children;
	gchar* env_prefix;
};

static gint ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile_private_offset;
static gpointer proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_parent_class = NULL;
static ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOptionIface * proton_plus_widgets_games_launch_options_editor_launch_option_spin_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_spin_tile_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_new (const gchar* title,
                                                                                                                                            const gchar* subtitle,
                                                                                                                                            const gchar* value_label,
                                                                                                                                            gdouble lower,
                                                                                                                                            gdouble upper,
                                                                                                                                            gint default_value,
                                                                                                                                            const gchar* env_prefix);
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_construct (GType object_type,
                                                                                                                                                  const gchar* title,
                                                                                                                                                  const gchar* subtitle,
                                                                                                                                                  const gchar* value_label,
                                                                                                                                                  gdouble lower,
                                                                                                                                                  gdouble upper,
                                                                                                                                                  gint default_value,
                                                                                                                                                  const gchar* env_prefix);
static void proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_set_value_entry (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self,
                                                                                              GtkEntry* value);
VALA_EXTERN GtkEntry* proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_value_entry (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self);
static void proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_apply_pending_value (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self);
static void _proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_apply_pending_value_gtk_entry_activate (GtkEntry* _sender,
                                                                                                                      gpointer self);
static void proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_set_apply_button (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self,
                                                                                               GtkButton* value);
VALA_EXTERN GtkButton* proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_apply_button (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self);
static void _proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_apply_pending_value_gtk_button_clicked (GtkButton* _sender,
                                                                                                                      gpointer self);
static void proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_set_toggle (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self,
                                                                                         GtkSwitch* value);
VALA_EXTERN GtkSwitch* proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_toggle (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self);
static void proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_refresh_value_state (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self);
static void _proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_refresh_value_state_gtk_editable_changed (GtkEditable* _sender,
                                                                                                                        gpointer self);
static void _proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_refresh_value_state_g_object_notify (GObject* _sender,
                                                                                                                   GParamSpec* pspec,
                                                                                                                   gpointer self);
VALA_EXTERN gint proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_value_as_int (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self);
VALA_EXTERN void proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_set_value (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self,
                                                                                        gint value);
static gboolean proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_pending_value (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self,
                                                                                                    gint* value);
static void proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_real_clear (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base);
static gboolean proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_real_is_active (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base);
static void proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_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_spin_tile_real_append_command_segments (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base,
                                                                                                           GeeLinkedList* segments);
static void proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_real_add_child (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base,
                                                                                             ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* child);
static void proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_finalize (GObject * obj);
static GType proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_type_once (void);
static void _vala_proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_property (GObject * object,
                                                                                                 guint property_id,
                                                                                                 GValue * value,
                                                                                                 GParamSpec * pspec);
static void _vala_proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_set_property (GObject * object,
                                                                                                 guint property_id,
                                                                                                 const GValue * value,
                                                                                                 GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_instance_private (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile_private_offset);
}

static void
_proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_apply_pending_value_gtk_entry_activate (GtkEntry* _sender,
                                                                                                                 gpointer self)
{
	proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_apply_pending_value ((ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile*) self);
}

static void
_proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_apply_pending_value_gtk_button_clicked (GtkButton* _sender,
                                                                                                                 gpointer self)
{
	proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_apply_pending_value ((ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile*) self);
}

static void
_proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_refresh_value_state_gtk_editable_changed (GtkEditable* _sender,
                                                                                                                   gpointer self)
{
	proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_refresh_value_state ((ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile*) self);
}

static void
_proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_refresh_value_state_g_object_notify (GObject* _sender,
                                                                                                              GParamSpec* pspec,
                                                                                                              gpointer self)
{
	proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_refresh_value_state ((ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile*) self);
}

ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile*
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_construct (GType object_type,
                                                                                   const gchar* title,
                                                                                   const gchar* subtitle,
                                                                                   const gchar* value_label,
                                                                                   gdouble lower,
                                                                                   gdouble upper,
                                                                                   gint default_value,
                                                                                   const gchar* env_prefix)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile * self = NULL;
	GeeArrayList* _tmp0_;
	gchar* _tmp1_;
	GtkBox* _tmp2_;
	GtkBox* _tmp3_;
	GtkLabel* value_caption = NULL;
	GtkLabel* _tmp4_;
	GtkEntry* _tmp5_;
	GtkEntry* _tmp6_;
	GtkEntry* _tmp7_;
	GtkEntry* _tmp8_;
	GtkEntry* _tmp9_;
	GtkEntry* _tmp10_;
	GtkEntry* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	GtkEntry* _tmp14_;
	GtkEntry* _tmp15_;
	GtkButton* _tmp16_;
	GtkButton* _tmp17_;
	GtkButton* _tmp18_;
	GtkButton* _tmp19_;
	GtkBox* _tmp20_;
	GtkBox* _tmp21_;
	GtkEntry* _tmp22_;
	GtkBox* _tmp23_;
	GtkButton* _tmp24_;
	GtkSwitch* _tmp25_;
	GtkSwitch* _tmp26_;
	GtkSwitch* _tmp27_;
	GtkSwitch* _tmp28_;
	GtkBox* _tmp29_;
	GtkSwitch* _tmp30_;
	GtkSwitch* _tmp31_;
	GtkEntry* _tmp32_;
	GtkSwitch* _tmp33_;
	g_return_val_if_fail (title != NULL, NULL);
	g_return_val_if_fail (subtitle != NULL, NULL);
	g_return_val_if_fail (value_label != NULL, NULL);
	g_return_val_if_fail (env_prefix != NULL, NULL);
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile*) g_object_new (object_type, "title", title, "subtitle", subtitle, NULL);
	_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_;
	_tmp1_ = g_strdup (env_prefix);
	_g_free0 (self->priv->env_prefix);
	self->priv->env_prefix = _tmp1_;
	adw_action_row_set_subtitle_lines ((AdwActionRow*) self, 0);
	gtk_widget_set_tooltip_text ((GtkWidget*) self, subtitle);
	self->priv->lower_value = (gint) lower;
	self->priv->upper_value = (gint) upper;
	self->priv->committed_value = default_value;
	_tmp2_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->value_box);
	self->priv->value_box = _tmp2_;
	_tmp3_ = self->priv->value_box;
	gtk_widget_set_valign ((GtkWidget*) _tmp3_, GTK_ALIGN_CENTER);
	_tmp4_ = (GtkLabel*) gtk_label_new (value_label);
	g_object_ref_sink (_tmp4_);
	value_caption = _tmp4_;
	gtk_label_set_xalign (value_caption, (gfloat) 0);
	gtk_widget_add_css_class ((GtkWidget*) value_caption, "dim-label");
	_tmp5_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp5_);
	_tmp6_ = _tmp5_;
	proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_set_value_entry (self, _tmp6_);
	_g_object_unref0 (_tmp6_);
	_tmp7_ = self->priv->_value_entry;
	proton_plus_utils_text_input_metadata_policy_apply ((GtkWidget*) _tmp7_, PROTON_PLUS_UTILS_TEXT_INPUT_FIELD_KIND_DIGITS);
	_tmp8_ = self->priv->_value_entry;
	gtk_editable_set_width_chars ((GtkEditable*) _tmp8_, 5);
	_tmp9_ = self->priv->_value_entry;
	gtk_editable_set_max_width_chars ((GtkEditable*) _tmp9_, 5);
	_tmp10_ = self->priv->_value_entry;
	gtk_widget_set_halign ((GtkWidget*) _tmp10_, GTK_ALIGN_START);
	_tmp11_ = self->priv->_value_entry;
	_tmp12_ = g_strdup_printf ("%i", default_value);
	_tmp13_ = _tmp12_;
	gtk_editable_set_text ((GtkEditable*) _tmp11_, _tmp13_);
	_g_free0 (_tmp13_);
	_tmp14_ = self->priv->_value_entry;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp14_, subtitle);
	_tmp15_ = self->priv->_value_entry;
	g_signal_connect_object (_tmp15_, "activate", (GCallback) _proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_apply_pending_value_gtk_entry_activate, self, 0);
	_tmp16_ = (GtkButton*) gtk_button_new_with_label (_ ("Set"));
	g_object_ref_sink (_tmp16_);
	_tmp17_ = _tmp16_;
	proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_set_apply_button (self, _tmp17_);
	_g_object_unref0 (_tmp17_);
	_tmp18_ = self->priv->_apply_button;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp18_, subtitle);
	_tmp19_ = self->priv->_apply_button;
	g_signal_connect_object (_tmp19_, "clicked", (GCallback) _proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_apply_pending_value_gtk_button_clicked, self, 0);
	_tmp20_ = self->priv->value_box;
	gtk_box_append (_tmp20_, (GtkWidget*) value_caption);
	_tmp21_ = self->priv->value_box;
	_tmp22_ = self->priv->_value_entry;
	gtk_box_append (_tmp21_, (GtkWidget*) _tmp22_);
	_tmp23_ = self->priv->value_box;
	_tmp24_ = self->priv->_apply_button;
	gtk_box_append (_tmp23_, (GtkWidget*) _tmp24_);
	_tmp25_ = (GtkSwitch*) gtk_switch_new ();
	g_object_ref_sink (_tmp25_);
	_tmp26_ = _tmp25_;
	proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_set_toggle (self, _tmp26_);
	_g_object_unref0 (_tmp26_);
	_tmp27_ = self->priv->_toggle;
	gtk_widget_set_valign ((GtkWidget*) _tmp27_, GTK_ALIGN_CENTER);
	_tmp28_ = self->priv->_toggle;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp28_, subtitle);
	_tmp29_ = self->priv->value_box;
	adw_action_row_add_suffix ((AdwActionRow*) self, (GtkWidget*) _tmp29_);
	_tmp30_ = self->priv->_toggle;
	adw_action_row_add_suffix ((AdwActionRow*) self, (GtkWidget*) _tmp30_);
	_tmp31_ = self->priv->_toggle;
	adw_action_row_set_activatable_widget ((AdwActionRow*) self, (GtkWidget*) _tmp31_);
	_tmp32_ = self->priv->_value_entry;
	g_signal_connect_object ((GtkEditable*) _tmp32_, "changed", (GCallback) _proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_refresh_value_state_gtk_editable_changed, self, 0);
	_tmp33_ = self->priv->_toggle;
	g_signal_connect_object ((GObject*) _tmp33_, "notify::active", (GCallback) _proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_refresh_value_state_g_object_notify, self, 0);
	proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_refresh_value_state (self);
	_g_object_unref0 (value_caption);
	return self;
}

ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile*
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_new (const gchar* title,
                                                                             const gchar* subtitle,
                                                                             const gchar* value_label,
                                                                             gdouble lower,
                                                                             gdouble upper,
                                                                             gint default_value,
                                                                             const gchar* env_prefix)
{
	return proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_construct (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE, title, subtitle, value_label, lower, upper, default_value, env_prefix);
}

gint
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_value_as_int (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->committed_value;
	return result;
}

void
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_set_value (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self,
                                                                                   gint value)
{
	GtkEntry* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	self->priv->committed_value = MAX (self->priv->lower_value, MIN (self->priv->upper_value, value));
	_tmp0_ = self->priv->_value_entry;
	_tmp1_ = g_strdup_printf ("%i", self->priv->committed_value);
	_tmp2_ = _tmp1_;
	gtk_editable_set_text ((GtkEditable*) _tmp0_, _tmp2_);
	_g_free0 (_tmp2_);
	proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_refresh_value_state (self);
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_apply_pending_value (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self)
{
	gint pending_value = 0;
	gint _tmp0_ = 0;
	gboolean _tmp1_;
	GtkEntry* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp1_ = proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_pending_value (self, &_tmp0_);
	pending_value = _tmp0_;
	if (!_tmp1_) {
		return;
	}
	self->priv->committed_value = pending_value;
	_tmp2_ = self->priv->_value_entry;
	_tmp3_ = g_strdup_printf ("%i", self->priv->committed_value);
	_tmp4_ = _tmp3_;
	gtk_editable_set_text ((GtkEditable*) _tmp2_, _tmp4_);
	_g_free0 (_tmp4_);
	proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_refresh_value_state (self);
	g_signal_emit (self, proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_signals[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_VALUE_APPLIED_SIGNAL], 0);
}

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 gboolean
int_try_parse (const gchar* str,
               gint* _result_,
               const gchar** unparsed,
               guint _base)
{
	gint _vala__result_ = 0;
	const gchar* _vala_unparsed = NULL;
	gchar* endptr = NULL;
	glong long_result = 0L;
	gchar* _tmp0_ = NULL;
	glong _tmp1_;
	gchar* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	glong _tmp6_;
	gboolean result;
	g_return_val_if_fail (str != NULL, FALSE);
	errno = 0;
	_tmp1_ = strtol (str, &_tmp0_, (gint) _base);
	endptr = _tmp0_;
	long_result = _tmp1_;
	_tmp2_ = endptr;
	_tmp3_ = strlen (str);
	_tmp4_ = _tmp3_;
	if (_tmp2_ == (((gchar*) str) + _tmp4_)) {
		_vala_unparsed = "";
	} else {
		gchar* _tmp5_;
		_tmp5_ = endptr;
		_vala_unparsed = (const gchar*) _tmp5_;
	}
	_tmp6_ = long_result;
	if ((((glong) G_MININT) <= _tmp6_) && (_tmp6_ <= ((glong) G_MAXINT))) {
		gboolean _tmp7_ = FALSE;
		gboolean _tmp8_ = FALSE;
		_vala__result_ = (gint) long_result;
		if (errno != ERANGE) {
			_tmp8_ = errno != EINVAL;
		} else {
			_tmp8_ = FALSE;
		}
		if (_tmp8_) {
			const gchar* _tmp9_;
			gchar* _tmp10_;
			_tmp9_ = _vala_unparsed;
			_tmp10_ = endptr;
			_tmp7_ = _tmp9_ != _tmp10_;
		} else {
			_tmp7_ = FALSE;
		}
		result = _tmp7_;
		if (_result_) {
			*_result_ = _vala__result_;
		}
		if (unparsed) {
			*unparsed = _vala_unparsed;
		}
		return result;
	} else {
		_vala__result_ = G_MAXINT;
		result = FALSE;
		if (_result_) {
			*_result_ = _vala__result_;
		}
		if (unparsed) {
			*unparsed = _vala_unparsed;
		}
		return result;
	}
}

static gboolean
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_pending_value (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self,
                                                                                           gint* value)
{
	gint _vala_value = 0;
	gchar* text = NULL;
	GtkEntry* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	gint parsed_value = 0;
	const gchar* _tmp4_;
	gint _tmp5_ = 0;
	gboolean _tmp6_;
	gboolean _tmp7_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_vala_value = self->priv->committed_value;
	_tmp0_ = self->priv->_value_entry;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
	_tmp2_ = string_strip (_tmp1_);
	text = _tmp2_;
	_tmp3_ = text;
	if (g_strcmp0 (_tmp3_, "") == 0) {
		result = FALSE;
		_g_free0 (text);
		if (value) {
			*value = _vala_value;
		}
		return result;
	}
	_tmp4_ = text;
	_tmp6_ = int_try_parse (_tmp4_, &_tmp5_, NULL, (guint) 0);
	parsed_value = _tmp5_;
	if (!_tmp6_) {
		result = FALSE;
		_g_free0 (text);
		if (value) {
			*value = _vala_value;
		}
		return result;
	}
	if (parsed_value < self->priv->lower_value) {
		_tmp7_ = TRUE;
	} else {
		_tmp7_ = parsed_value > self->priv->upper_value;
	}
	if (_tmp7_) {
		result = FALSE;
		_g_free0 (text);
		if (value) {
			*value = _vala_value;
		}
		return result;
	}
	_vala_value = parsed_value;
	result = TRUE;
	_g_free0 (text);
	if (value) {
		*value = _vala_value;
	}
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_refresh_value_state (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self)
{
	gboolean is_active = FALSE;
	GtkSwitch* _tmp0_;
	GtkBox* _tmp1_;
	GtkEntry* _tmp2_;
	gint pending_value = 0;
	gboolean has_pending_value = FALSE;
	gint _tmp3_ = 0;
	gboolean _tmp4_;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
	GtkButton* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_toggle;
	is_active = gtk_switch_get_active (_tmp0_);
	_tmp1_ = self->priv->value_box;
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, is_active);
	_tmp2_ = self->priv->_value_entry;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp2_, is_active);
	_tmp4_ = proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_pending_value (self, &_tmp3_);
	pending_value = _tmp3_;
	has_pending_value = _tmp4_;
	if (is_active) {
		_tmp6_ = has_pending_value;
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		_tmp5_ = pending_value != self->priv->committed_value;
	} else {
		_tmp5_ = FALSE;
	}
	_tmp7_ = self->priv->_apply_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp7_, _tmp5_);
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_real_clear (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile * self;
	GtkSwitch* _tmp0_;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile*) base;
	_tmp0_ = self->priv->_toggle;
	gtk_switch_set_active (_tmp0_, FALSE);
	proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_set_value (self, self->priv->committed_value);
	{
		GeeList* _child_list = NULL;
		GeeList* _tmp1_;
		gint _child_size = 0;
		GeeList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _child_index = 0;
		_tmp1_ = self->priv->_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_spin_tile_real_is_active (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile * self;
	GtkSwitch* _tmp0_;
	gboolean result;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile*) base;
	_tmp0_ = self->priv->_toggle;
	result = gtk_switch_get_active (_tmp0_);
	return result;
}

static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	if ((*((gchar*) self)) == '\0') {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = (*((gchar*) old)) == '\0';
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
	}
	if (_tmp0_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (self);
		result = _tmp2_;
		return result;
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp3_ = g_regex_escape_string (old, -1);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		regex = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp8_ = regex;
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp10_ = _tmp7_;
		_tmp7_ = NULL;
		result = _tmp10_;
		_g_free0 (_tmp7_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
	g_clear_error (&_inner_error0_);
	return NULL;
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_real_parse_tokens (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base,
                                                                                           gchar** tokens,
                                                                                           gint tokens_length1,
                                                                                           gboolean* consumed,
                                                                                           gint consumed_length1)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile * self;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile*) base;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				gboolean _tmp2_;
				const gchar* _tmp3_;
				const gchar* _tmp4_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				if (!(i < tokens_length1)) {
					break;
				}
				_tmp2_ = consumed[i];
				if (_tmp2_) {
					continue;
				}
				_tmp3_ = tokens[i];
				_tmp4_ = self->priv->env_prefix;
				if (g_str_has_prefix (_tmp3_, _tmp4_)) {
					gchar* val_str = NULL;
					const gchar* _tmp5_;
					const gchar* _tmp6_;
					gchar* _tmp7_;
					gint val_int = 0;
					const gchar* _tmp8_;
					gint _tmp9_ = 0;
					gboolean _tmp10_;
					_tmp5_ = tokens[i];
					_tmp6_ = self->priv->env_prefix;
					_tmp7_ = string_replace (_tmp5_, _tmp6_, "");
					val_str = _tmp7_;
					_tmp8_ = val_str;
					_tmp10_ = int_try_parse (_tmp8_, &_tmp9_, NULL, (guint) 0);
					val_int = _tmp9_;
					if (_tmp10_) {
						GtkSwitch* _tmp11_;
						_tmp11_ = self->priv->_toggle;
						gtk_switch_set_active (_tmp11_, TRUE);
						proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_set_value (self, val_int);
						consumed[i] = TRUE;
						_g_free0 (val_str);
						break;
					}
					_g_free0 (val_str);
				}
			}
		}
	}
	{
		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);
		}
	}
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_real_append_command_segments (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base,
                                                                                                      GeeLinkedList* segments)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile * self;
	GtkSwitch* _tmp0_;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile*) base;
	g_return_if_fail (segments != NULL);
	_tmp0_ = self->priv->_toggle;
	if (gtk_switch_get_active (_tmp0_)) {
		const gchar* _tmp1_;
		gchar* _tmp2_;
		gchar* _tmp3_;
		_tmp1_ = self->priv->env_prefix;
		_tmp2_ = g_strdup_printf ("%s%d", _tmp1_, proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_value_as_int (self));
		_tmp3_ = _tmp2_;
		gee_abstract_collection_add ((GeeAbstractCollection*) segments, _tmp3_);
		_g_free0 (_tmp3_);
		{
			GeeList* _child_list = NULL;
			GeeList* _tmp4_;
			gint _child_size = 0;
			GeeList* _tmp5_;
			gint _tmp6_;
			gint _tmp7_;
			gint _child_index = 0;
			_tmp4_ = self->priv->_children;
			_child_list = _tmp4_;
			_tmp5_ = _child_list;
			_tmp6_ = gee_collection_get_size ((GeeCollection*) _tmp5_);
			_tmp7_ = _tmp6_;
			_child_size = _tmp7_;
			_child_index = -1;
			while (TRUE) {
				gint _tmp8_;
				gint _tmp9_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* child = NULL;
				GeeList* _tmp10_;
				gpointer _tmp11_;
				ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* _tmp12_;
				_child_index = _child_index + 1;
				_tmp8_ = _child_index;
				_tmp9_ = _child_size;
				if (!(_tmp8_ < _tmp9_)) {
					break;
				}
				_tmp10_ = _child_list;
				_tmp11_ = gee_list_get (_tmp10_, _child_index);
				child = (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) _tmp11_;
				_tmp12_ = child;
				if (proton_plus_widgets_games_launch_options_editor_ilaunch_option_is_active (_tmp12_)) {
					ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* _tmp13_;
					_tmp13_ = child;
					proton_plus_widgets_games_launch_options_editor_ilaunch_option_append_command_segments (_tmp13_, segments);
				}
				_g_object_unref0 (child);
			}
		}
	}
}

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

GtkSwitch*
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_toggle (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* 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_spin_tile_set_toggle (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self,
                                                                                    GtkSwitch* value)
{
	GtkSwitch* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_games_launch_options_editor_launch_option_spin_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_spin_tile_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_TOGGLE_PROPERTY]);
	}
}

GtkEntry*
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_value_entry (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self)
{
	GtkEntry* result;
	GtkEntry* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_value_entry;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_set_value_entry (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self,
                                                                                         GtkEntry* value)
{
	GtkEntry* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_value_entry (self);
	if (old_value != value) {
		GtkEntry* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_value_entry);
		self->priv->_value_entry = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_VALUE_ENTRY_PROPERTY]);
	}
}

GtkButton*
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_apply_button (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self)
{
	GtkButton* result;
	GtkButton* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_apply_button;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_set_apply_button (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self,
                                                                                          GtkButton* value)
{
	GtkButton* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_apply_button (self);
	if (old_value != value) {
		GtkButton* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_apply_button);
		self->priv->_apply_button = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_APPLY_BUTTON_PROPERTY]);
	}
}

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

static void
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_real_set_is_advanced (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base,
                                                                                              gboolean value)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self;
	gboolean old_value;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile*) base;
	old_value = proton_plus_widgets_games_launch_options_editor_launch_option_spin_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_spin_tile_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_IS_ADVANCED_PROPERTY]);
	}
}

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

static void
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_real_set_line_type (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption* base,
                                                                                            ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType value)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile* self;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType old_value;
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile*) base;
	old_value = proton_plus_widgets_games_launch_options_editor_launch_option_spin_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_spin_tile_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_LINE_TYPE_PROPERTY]);
	}
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_class_init (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTileClass * klass,
                                                                                    gpointer klass_data)
{
	proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_TOGGLE_PROPERTY, proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_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_SPIN_TILE_VALUE_ENTRY_PROPERTY, proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_VALUE_ENTRY_PROPERTY] = g_param_spec_object ("value-entry", "value-entry", "value-entry", gtk_entry_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_SPIN_TILE_APPLY_BUTTON_PROPERTY, proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_APPLY_BUTTON_PROPERTY] = g_param_spec_object ("apply-button", "apply-button", "apply-button", gtk_button_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_SPIN_TILE_IS_ADVANCED_PROPERTY, proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_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));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_LINE_TYPE_PROPERTY, proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_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, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_signals[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_VALUE_APPLIED_SIGNAL] = g_signal_new ("value-applied", PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_spin_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_spin_tile_proton_plus_widgets_games_launch_options_editor_ilaunch_option_parent_iface = g_type_interface_peek_parent (iface);
	iface->clear = (void (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*)) proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_real_clear;
	iface->is_active = (gboolean (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*)) proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_real_is_active;
	iface->parse_tokens = (void (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*, gchar**, gint, gboolean*, gint)) proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_real_parse_tokens;
	iface->append_command_segments = (void (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*, GeeLinkedList*)) proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_real_append_command_segments;
	iface->add_child = (void (*) (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*, ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*)) proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_real_add_child;
	iface->get_is_advanced = proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_real_get_is_advanced;
	iface->set_is_advanced = proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_real_set_is_advanced;
	iface->get_line_type = proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_real_get_line_type;
	iface->set_line_type = proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_real_set_line_type;
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_instance_init (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile * self,
                                                                                       gpointer klass)
{
	self->priv = proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_instance_private (self);
	self->priv->_is_advanced = FALSE;
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_finalize (GObject * obj)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile);
	_g_object_unref0 (self->priv->_toggle);
	_g_object_unref0 (self->priv->_value_entry);
	_g_object_unref0 (self->priv->_apply_button);
	_g_object_unref0 (self->priv->value_box);
	_g_object_unref0 (self->priv->_children);
	_g_free0 (self->priv->env_prefix);
	G_OBJECT_CLASS (proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTileClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile), 0, (GInstanceInitFunc) proton_plus_widgets_games_launch_options_editor_launch_option_spin_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_spin_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_spin_tile_type_id;
	proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_type_id = g_type_register_static (adw_action_row_get_type (), "ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile", &g_define_type_info, 0);
	g_type_add_interface_static (proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_type_id, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_ILAUNCH_OPTION, &proton_plus_widgets_games_launch_options_editor_ilaunch_option_info);
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile_private_offset = g_type_add_instance_private (proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_type_id, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTilePrivate));
	return proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_type_id;
}

GType
proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_type (void)
{
	static volatile gsize proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_type_id__once)) {
		GType proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_type_id;
		proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_type_id = proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_type_id__once, proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_type_id);
	}
	return proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_type_id__once;
}

static void
_vala_proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_property (GObject * object,
                                                                                            guint property_id,
                                                                                            GValue * value,
                                                                                            GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_TOGGLE_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_toggle (self));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_VALUE_ENTRY_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_value_entry (self));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_APPLY_BUTTON_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_get_apply_button (self));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_IS_ADVANCED_PROPERTY:
		g_value_set_boolean (value, proton_plus_widgets_games_launch_options_editor_ilaunch_option_get_is_advanced ((ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) self));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_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_spin_tile_set_property (GObject * object,
                                                                                            guint property_id,
                                                                                            const GValue * value,
                                                                                            GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_SPIN_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionSpinTile);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_TOGGLE_PROPERTY:
		proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_set_toggle (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_VALUE_ENTRY_PROPERTY:
		proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_set_value_entry (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_APPLY_BUTTON_PROPERTY:
		proton_plus_widgets_games_launch_options_editor_launch_option_spin_tile_set_apply_button (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_IS_ADVANCED_PROPERTY:
		proton_plus_widgets_games_launch_options_editor_ilaunch_option_set_is_advanced ((ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) self, g_value_get_boolean (value));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_SPIN_TILE_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 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;
}

