/* advanced-options-group.c generated by valac 0.56.19, the Vala compiler
 * generated from advanced-options-group.vala, do not modify */

#include "protonplus_core.h"
#include <glib-object.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <adwaita.h>
#include <glib/gi18n-lib.h>
#include <string.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_GROUPS_ADVANCED_OPTIONS_GROUP_0_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_ADVANCED_OPTIONS_GROUP_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_ADVANCED_OPTIONS_GROUP_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroupPrivate {
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionArgumentList* custom_arguments;
};

static gint ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup_private_offset;
static gpointer proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_parent_class = NULL;

static void __lambda120_ (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup* self);
static void ___lambda120__proton_plus_widgets_games_launch_options_editor_launch_option_argument_list_changed (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionArgumentList* _sender,
                                                                                                        gpointer self);
static void proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_finalize (GObject * obj);
static GType proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_get_instance_private (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup_private_offset);
}

static void
__lambda120_ (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup* self)
{
	g_signal_emit_by_name ((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*) self, "changed");
}

static void
___lambda120__proton_plus_widgets_games_launch_options_editor_launch_option_argument_list_changed (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionArgumentList* _sender,
                                                                                                   gpointer self)
{
	__lambda120_ ((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup*) self);
}

ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup*
proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_construct (GType object_type,
                                                                                         ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* launch_option_handlers,
                                                                                         ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* presentation_registry)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup * self = NULL;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionArgumentList* _tmp0_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionArgumentList* _tmp1_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionArgumentList* _tmp2_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionArgumentList* _tmp3_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionArgumentList* _tmp4_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionArgumentList* _tmp5_;
	g_return_val_if_fail (launch_option_handlers != NULL, NULL);
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup*) proton_plus_widgets_games_launch_options_editor_groups_base_options_group_construct (object_type, launch_option_handlers, FALSE, presentation_registry, TRUE);
	gtk_widget_set_margin_bottom ((GtkWidget*) self, 15);
	adw_preferences_group_set_title ((AdwPreferencesGroup*) self, _ ("Advanced options"));
	adw_preferences_group_set_description ((AdwPreferencesGroup*) self, _ ("Extra control over the final Steam launch command."));
	_tmp0_ = proton_plus_widgets_games_launch_options_editor_launch_option_argument_list_new (_ ("Custom game arguments"), _ ("Unknown arguments are imported here and preserved exactly as loaded."));
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->custom_arguments);
	self->priv->custom_arguments = _tmp0_;
	_tmp1_ = self->priv->custom_arguments;
	g_signal_connect_object (_tmp1_, "changed", (GCallback) ___lambda120__proton_plus_widgets_games_launch_options_editor_launch_option_argument_list_changed, self, 0);
	_tmp2_ = self->priv->custom_arguments;
	proton_plus_widgets_games_launch_options_editor_launch_options_list_add (launch_option_handlers, (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) _tmp2_);
	_tmp3_ = self->priv->custom_arguments;
	_tmp4_ = self->priv->custom_arguments;
	proton_plus_widgets_games_launch_options_editor_groups_base_options_group_register_option ((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*) self, "custom-game-arguments", (GtkWidget*) _tmp3_, (ProtonPlusWidgetsGamesLaunchOptionsEditorILaunchOption*) _tmp4_);
	_tmp5_ = self->priv->custom_arguments;
	adw_preferences_group_add ((AdwPreferencesGroup*) self, (GtkWidget*) _tmp5_);
	return self;
}

ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup*
proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_new (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* launch_option_handlers,
                                                                                   ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* presentation_registry)
{
	return proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_construct (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_TYPE_ADVANCED_OPTIONS_GROUP, launch_option_handlers, presentation_registry);
}

void
proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_load_custom_arguments (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup* self,
                                                                                                     ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchCommandParseResult* parsed)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionArgumentList* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (parsed != NULL);
	_tmp0_ = self->priv->custom_arguments;
	proton_plus_widgets_games_launch_options_editor_launch_option_argument_list_load_from_parse_result (_tmp0_, parsed);
}

static void
proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_class_init (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroupClass * klass,
                                                                                          gpointer klass_data)
{
	proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup_private_offset);
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_finalize;
}

static void
proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_instance_init (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup * self,
                                                                                             gpointer klass)
{
	self->priv = proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_get_instance_private (self);
}

static void
proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_finalize (GObject * obj)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_TYPE_ADVANCED_OPTIONS_GROUP, ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup);
	_g_object_unref0 (self->priv->custom_arguments);
	G_OBJECT_CLASS (proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroupClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup), 0, (GInstanceInitFunc) proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_instance_init, NULL };
	GType proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_type_id;
	proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_type_id = g_type_register_static (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_TYPE_BASE_OPTIONS_GROUP, "ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup", &g_define_type_info, 0);
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroup_private_offset = g_type_add_instance_private (proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_type_id, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsAdvancedOptionsGroupPrivate));
	return proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_type_id;
}

GType
proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_get_type (void)
{
	static volatile gsize proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_type_id__once)) {
		GType proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_type_id;
		proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_type_id = proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_type_id__once, proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_type_id);
	}
	return proton_plus_widgets_games_launch_options_editor_groups_advanced_options_group_type_id__once;
}

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

