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

#include <adwaita.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "protonplus_core.h"
#include <gdk/gdk.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_ENTRY_FIELD (proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_get_type ())
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_ENTRY_FIELD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_ENTRY_FIELD, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_ENTRY_FIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_ENTRY_FIELD, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryFieldClass))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_LAUNCH_OPTION_ENTRY_FIELD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_ENTRY_FIELD))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_LAUNCH_OPTION_ENTRY_FIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_ENTRY_FIELD))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_ENTRY_FIELD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_ENTRY_FIELD, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryFieldClass))

typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField;
typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryFieldClass ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryFieldClass;
typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryFieldPrivate ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryFieldPrivate;
enum  {
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_ENTRY_FIELD_0_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_ENTRY_FIELD_APPLY_BUTTON_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_ENTRY_FIELD_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_ENTRY_FIELD_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))
enum  {
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_ENTRY_FIELD_VALUE_APPLIED_SIGNAL,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_ENTRY_FIELD_NUM_SIGNALS
};
static guint proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_signals[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_ENTRY_FIELD_NUM_SIGNALS] = {0};

struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField {
	AdwEntryRow parent_instance;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryFieldPrivate * priv;
};

struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryFieldClass {
	AdwEntryRowClass parent_class;
};

struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryFieldPrivate {
	GtkButton* _apply_button;
	gchar* committed_text;
	GtkEventControllerKey* key_controller;
};

static gint ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField_private_offset;
static gpointer proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_parent_class = NULL;

VALA_EXTERN GType proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField* proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_new (const gchar* title,
                                                                                                                                                const gchar* subtitle,
                                                                                                                                                const gchar* placeholder);
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField* proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_construct (GType object_type,
                                                                                                                                                      const gchar* title,
                                                                                                                                                      const gchar* subtitle,
                                                                                                                                                      const gchar* placeholder);
static void proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_set_apply_button (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField* self,
                                                                                                 GtkButton* value);
VALA_EXTERN GtkButton* proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_get_apply_button (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField* self);
static void proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_apply_pending_text (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField* self);
static void _proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_apply_pending_text_gtk_button_clicked (GtkButton* _sender,
                                                                                                                       gpointer self);
static gboolean __lambda113_ (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField* self,
                       guint keyval,
                       guint keycode,
                       GdkModifierType state);
static gboolean ___lambda113__gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                             guint keyval,
                                                             guint keycode,
                                                             GdkModifierType state,
                                                             gpointer self);
static void __lambda114_ (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField* self);
static void ___lambda114__gtk_list_box_row_activate (GtkListBoxRow* _sender,
                                              gpointer self);
static void proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_refresh_apply_state (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField* self);
static void _proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_refresh_apply_state_gtk_editable_changed (GtkEditable* _sender,
                                                                                                                          gpointer self);
VALA_EXTERN gchar* proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_get_text (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField* self);
VALA_EXTERN void proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_set_text (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField* self,
                                                                                         const gchar* text);
static void proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_finalize (GObject * obj);
static GType proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_get_type_once (void);
static void _vala_proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_get_property (GObject * object,
                                                                                                   guint property_id,
                                                                                                   GValue * value,
                                                                                                   GParamSpec * pspec);
static void _vala_proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_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_entry_field_get_instance_private (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField_private_offset);
}

static void
_proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_apply_pending_text_gtk_button_clicked (GtkButton* _sender,
                                                                                                                  gpointer self)
{
	proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_apply_pending_text ((ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField*) self);
}

static gboolean
__lambda113_ (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField* self,
              guint keyval,
              guint keycode,
              GdkModifierType state)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	if (keyval == GDK_KEY_Return) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = keyval == GDK_KEY_KP_Enter;
	}
	if (_tmp0_) {
		proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_apply_pending_text (self);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

static gboolean
___lambda113__gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                    guint keyval,
                                                    guint keycode,
                                                    GdkModifierType state,
                                                    gpointer self)
{
	gboolean result;
	result = __lambda113_ ((ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField*) self, keyval, keycode, state);
	return result;
}

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

static void
__lambda114_ (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField* self)
{
	proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_apply_pending_text (self);
}

static void
___lambda114__gtk_list_box_row_activate (GtkListBoxRow* _sender,
                                         gpointer self)
{
	__lambda114_ ((ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField*) self);
}

static void
_proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_refresh_apply_state_gtk_editable_changed (GtkEditable* _sender,
                                                                                                                     gpointer self)
{
	proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_refresh_apply_state ((ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField*) self);
}

ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField*
proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_construct (GType object_type,
                                                                                     const gchar* title,
                                                                                     const gchar* subtitle,
                                                                                     const gchar* placeholder)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField * self = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	GtkButton* _tmp2_;
	GtkButton* _tmp3_;
	GtkButton* _tmp4_;
	GtkButton* _tmp5_;
	GtkButton* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	GtkButton* _tmp9_;
	GtkButton* _tmp10_;
	GtkEventControllerKey* _tmp11_;
	GtkEventControllerKey* _tmp12_;
	GtkEventControllerKey* _tmp13_;
	GtkEventControllerKey* _tmp14_;
	GtkEventController* _tmp15_;
	g_return_val_if_fail (title != NULL, NULL);
	g_return_val_if_fail (subtitle != NULL, NULL);
	g_return_val_if_fail (placeholder != NULL, NULL);
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField*) g_object_new (object_type, NULL);
	adw_preferences_row_set_title ((AdwPreferencesRow*) self, title);
	if (g_strcmp0 (subtitle, "") != 0) {
		_tmp0_ = subtitle;
	} else {
		_tmp0_ = placeholder;
	}
	gtk_widget_set_tooltip_text ((GtkWidget*) self, _tmp0_);
	proton_plus_utils_text_input_metadata_policy_apply ((GtkWidget*) self, PROTON_PLUS_UTILS_TEXT_INPUT_FIELD_KIND_COMMAND);
	_tmp1_ = g_strdup ("");
	_g_free0 (self->priv->committed_text);
	self->priv->committed_text = _tmp1_;
	_tmp2_ = (GtkButton*) gtk_button_new_from_icon_name ("object-select-symbolic");
	g_object_ref_sink (_tmp2_);
	_tmp3_ = _tmp2_;
	proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_set_apply_button (self, _tmp3_);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = self->priv->_apply_button;
	gtk_widget_set_valign ((GtkWidget*) _tmp4_, GTK_ALIGN_CENTER);
	_tmp5_ = self->priv->_apply_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp5_, "flat");
	_tmp6_ = self->priv->_apply_button;
	_tmp7_ = gtk_widget_get_tooltip_text ((GtkWidget*) self);
	_tmp8_ = _tmp7_;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp6_, _tmp8_);
	_tmp9_ = self->priv->_apply_button;
	g_signal_connect_object (_tmp9_, "clicked", (GCallback) _proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_apply_pending_text_gtk_button_clicked, self, 0);
	_tmp10_ = self->priv->_apply_button;
	adw_entry_row_add_suffix ((AdwEntryRow*) self, (GtkWidget*) _tmp10_);
	adw_entry_row_set_activates_default ((AdwEntryRow*) self, FALSE);
	_tmp11_ = (GtkEventControllerKey*) gtk_event_controller_key_new ();
	_g_object_unref0 (self->priv->key_controller);
	self->priv->key_controller = _tmp11_;
	_tmp12_ = self->priv->key_controller;
	gtk_event_controller_set_propagation_phase ((GtkEventController*) _tmp12_, GTK_PHASE_CAPTURE);
	_tmp13_ = self->priv->key_controller;
	g_signal_connect_object (_tmp13_, "key-pressed", (GCallback) ___lambda113__gtk_event_controller_key_key_pressed, self, 0);
	_tmp14_ = self->priv->key_controller;
	_tmp15_ = _g_object_ref0 ((GtkEventController*) _tmp14_);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp15_);
	g_signal_connect_object ((GtkListBoxRow*) self, "activate", (GCallback) ___lambda114__gtk_list_box_row_activate, self, 0);
	g_signal_connect_object ((GtkEditable*) self, "changed", (GCallback) _proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_refresh_apply_state_gtk_editable_changed, self, 0);
	proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_refresh_apply_state (self);
	return self;
}

ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField*
proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_new (const gchar* title,
                                                                               const gchar* subtitle,
                                                                               const gchar* placeholder)
{
	return proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_construct (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_ENTRY_FIELD, title, subtitle, placeholder);
}

gchar*
proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_get_text (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->committed_text;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

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

void
proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_set_text (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField* self,
                                                                                    const gchar* text)
{
	gchar* _tmp0_;
	const gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (text != NULL);
	_tmp0_ = string_strip (text);
	_g_free0 (self->priv->committed_text);
	self->priv->committed_text = _tmp0_;
	_tmp1_ = self->priv->committed_text;
	gtk_editable_set_text ((GtkEditable*) self, _tmp1_);
	proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_refresh_apply_state (self);
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_apply_pending_text (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField* self)
{
	gchar* pending_text = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	const gchar* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_editable_get_text ((GtkEditable*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = string_strip (_tmp1_);
	pending_text = _tmp2_;
	_tmp3_ = pending_text;
	_tmp4_ = self->priv->committed_text;
	if (g_strcmp0 (_tmp3_, _tmp4_) == 0) {
		_g_free0 (pending_text);
		return;
	}
	_tmp5_ = pending_text;
	_tmp6_ = g_strdup (_tmp5_);
	_g_free0 (self->priv->committed_text);
	self->priv->committed_text = _tmp6_;
	_tmp7_ = self->priv->committed_text;
	gtk_editable_set_text ((GtkEditable*) self, _tmp7_);
	proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_refresh_apply_state (self);
	g_signal_emit (self, proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_signals[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_ENTRY_FIELD_VALUE_APPLIED_SIGNAL], 0);
	_g_free0 (pending_text);
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_refresh_apply_state (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField* self)
{
	GtkButton* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_apply_button;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = string_strip (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->committed_text;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, g_strcmp0 (_tmp4_, _tmp5_) != 0);
	_g_free0 (_tmp4_);
}

GtkButton*
proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_get_apply_button (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField* 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_entry_field_set_apply_button (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField* self,
                                                                                            GtkButton* value)
{
	GtkButton* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_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_entry_field_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_ENTRY_FIELD_APPLY_BUTTON_PROPERTY]);
	}
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_class_init (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryFieldClass * klass,
                                                                                      gpointer klass_data)
{
	proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_ENTRY_FIELD_APPLY_BUTTON_PROPERTY, proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_ENTRY_FIELD_APPLY_BUTTON_PROPERTY] = g_param_spec_object ("apply-button", "apply-button", "apply-button", gtk_button_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_signals[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_ENTRY_FIELD_VALUE_APPLIED_SIGNAL] = g_signal_new ("value-applied", PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_ENTRY_FIELD, 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_entry_field_instance_init (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField * self,
                                                                                         gpointer klass)
{
	self->priv = proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_get_instance_private (self);
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_finalize (GObject * obj)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_ENTRY_FIELD, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField);
	_g_object_unref0 (self->priv->_apply_button);
	_g_free0 (self->priv->committed_text);
	_g_object_unref0 (self->priv->key_controller);
	G_OBJECT_CLASS (proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryFieldClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField), 0, (GInstanceInitFunc) proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_instance_init, NULL };
	GType proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_type_id;
	proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_type_id = g_type_register_static (adw_entry_row_get_type (), "ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField", &g_define_type_info, 0);
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField_private_offset = g_type_add_instance_private (proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_type_id, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryFieldPrivate));
	return proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_type_id;
}

GType
proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_get_type (void)
{
	static volatile gsize proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_type_id__once)) {
		GType proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_type_id;
		proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_type_id = proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_type_id__once, proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_type_id);
	}
	return proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_type_id__once;
}

static void
_vala_proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_get_property (GObject * object,
                                                                                              guint property_id,
                                                                                              GValue * value,
                                                                                              GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_ENTRY_FIELD, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_ENTRY_FIELD_APPLY_BUTTON_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_get_apply_button (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_entry_field_set_property (GObject * object,
                                                                                              guint property_id,
                                                                                              const GValue * value,
                                                                                              GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_ENTRY_FIELD, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionEntryField);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_ENTRY_FIELD_APPLY_BUTTON_PROPERTY:
		proton_plus_widgets_games_launch_options_editor_launch_option_entry_field_set_apply_button (self, g_value_get_object (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;
}

