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

#include "protonplus_core.h"
#include <adwaita.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>

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

#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE (proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_type ())
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTileClass))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_LAUNCH_OPTION_TILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_IS_LAUNCH_OPTION_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE))
#define PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_TILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_TILE, ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTileClass))

typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile;
typedef struct _ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTileClass ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTileClass;
enum  {
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_GPU_VENDOR_INTEL_OPTIONS_GROUP_0_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_GPU_VENDOR_INTEL_OPTIONS_GROUP_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_GPU_VENDOR_INTEL_OPTIONS_GROUP_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroupPrivate {
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* _intel_xess_upgrade_tile;
};

static gint ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup_private_offset;
static gpointer proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_parent_class = NULL;

VALA_EXTERN GType proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* proton_plus_widgets_games_launch_options_editor_groups_base_options_group_create_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup* self,
                                                                                                                                                  const gchar* title,
                                                                                                                                                  const gchar* subtitle,
                                                                                                                                                  gchar** tokens,
                                                                                                                                                  gint tokens_length1,
                                                                                                                                                  gboolean is_advanced,
                                                                                                                                                  ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchLineType type,
                                                                                                                                                  const gchar* id);
static void proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_set_intel_xess_upgrade_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup* self,
                                                                                                                        ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* value);
static ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_get_intel_xess_upgrade_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup* self);
VALA_EXTERN void proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_reset_controls (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup* self);
VALA_EXTERN GtkSwitch* proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_toggle (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* self);
static void proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_finalize (GObject * obj);
static GType proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_get_type_once (void);
static void _vala_proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_get_property (GObject * object,
                                                                                                               guint property_id,
                                                                                                               GValue * value,
                                                                                                               GParamSpec * pspec);
static void _vala_proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_set_property (GObject * object,
                                                                                                               guint property_id,
                                                                                                               const GValue * value,
                                                                                                               GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_get_instance_private (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup_private_offset);
}

ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup*
proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_construct (GType object_type,
                                                                                                 ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* launch_option_handlers,
                                                                                                 ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* presentation_registry)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup * self = NULL;
	gchar* _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* _tmp3_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* _tmp4_;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* _tmp5_;
	g_return_val_if_fail (launch_option_handlers != NULL, NULL);
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup*) proton_plus_widgets_games_launch_options_editor_groups_base_options_group_construct (object_type, launch_option_handlers, TRUE, presentation_registry, FALSE);
	_tmp0_ = g_strdup ("PROTON_XESS_UPGRADE=1");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = 1;
	_tmp3_ = proton_plus_widgets_games_launch_options_editor_groups_base_options_group_create_tile ((ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsBaseOptionsGroup*) self, _ ("XeSS component upgrade"), _ ("Upgrades XeSS in supported games."), _tmp2_, (gint) 1, FALSE, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_LINE_TYPE_ENVIRONMENT, "intel-xess");
	_tmp4_ = _tmp3_;
	proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_set_intel_xess_upgrade_tile (self, _tmp4_);
	_g_object_unref0 (_tmp4_);
	_tmp2_ = (_vala_array_free (_tmp2_, _tmp2__length1, (GDestroyNotify) g_free), NULL);
	_tmp5_ = self->priv->_intel_xess_upgrade_tile;
	adw_preferences_group_add ((AdwPreferencesGroup*) self, (GtkWidget*) _tmp5_);
	return self;
}

ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup*
proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_new (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionsList* launch_option_handlers,
                                                                                           ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionPresentationRegistry* presentation_registry)
{
	return proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_construct (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_TYPE_GPU_VENDOR_INTEL_OPTIONS_GROUP, launch_option_handlers, presentation_registry);
}

void
proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_reset_controls (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* _tmp0_;
	GtkSwitch* _tmp1_;
	GtkSwitch* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_intel_xess_upgrade_tile;
	_tmp1_ = proton_plus_widgets_games_launch_options_editor_launch_option_tile_get_toggle (_tmp0_);
	_tmp2_ = _tmp1_;
	gtk_switch_set_active (_tmp2_, FALSE);
}

static ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile*
proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_get_intel_xess_upgrade_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup* self)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* result;
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_intel_xess_upgrade_tile;
	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_groups_gpu_vendor_intel_options_group_set_intel_xess_upgrade_tile (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup* self,
                                                                                                                   ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* value)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionTile* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_intel_xess_upgrade_tile);
	self->priv->_intel_xess_upgrade_tile = _tmp0_;
}

static void
proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_class_init (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroupClass * klass,
                                                                                                  gpointer klass_data)
{
	proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_finalize;
}

static void
proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_instance_init (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup * self,
                                                                                                     gpointer klass)
{
	self->priv = proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_get_instance_private (self);
}

static void
proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_finalize (GObject * obj)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_TYPE_GPU_VENDOR_INTEL_OPTIONS_GROUP, ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup);
	_g_object_unref0 (self->priv->_intel_xess_upgrade_tile);
	G_OBJECT_CLASS (proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroupClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup), 0, (GInstanceInitFunc) proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_instance_init, NULL };
	GType proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_type_id;
	proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_type_id = g_type_register_static (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_TYPE_BASE_OPTIONS_GROUP, "ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup", &g_define_type_info, 0);
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup_private_offset = g_type_add_instance_private (proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_type_id, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroupPrivate));
	return proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_type_id;
}

GType
proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_get_type (void)
{
	static volatile gsize proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_type_id__once)) {
		GType proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_type_id;
		proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_type_id = proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_type_id__once, proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_type_id);
	}
	return proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_type_id__once;
}

static void
_vala_proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_get_property (GObject * object,
                                                                                                          guint property_id,
                                                                                                          GValue * value,
                                                                                                          GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_TYPE_GPU_VENDOR_INTEL_OPTIONS_GROUP, ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_widgets_games_launch_options_editor_groups_gpu_vendor_intel_options_group_set_property (GObject * object,
                                                                                                          guint property_id,
                                                                                                          const GValue * value,
                                                                                                          GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_GROUPS_TYPE_GPU_VENDOR_INTEL_OPTIONS_GROUP, ProtonPlusWidgetsGamesLaunchOptionsEditorGroupsGpuVendorIntelOptionsGroup);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

