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

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

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

enum  {
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_RADV_DEBUG_0_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_RADV_DEBUG_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_RADV_DEBUG_NUM_PROPERTIES];
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))

static gpointer proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_parent_class = NULL;

static void _g_free0_ (gpointer var);
static GType proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_get_type_once (void);
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 void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionRadvDebug*
proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_construct (GType object_type)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionRadvDebug * self = NULL;
	gchar** keys = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar** _tmp9_;
	gint keys_length1;
	gint _keys_size_;
	gchar** display_opts = NULL;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar** _tmp12_;
	gint display_opts_length1;
	gint _display_opts_size_;
	gchar** value_opts = NULL;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar** _tmp15_;
	gint value_opts_length1;
	gint _value_opts_size_;
	GHashTable* tooltips = NULL;
	GHashFunc _tmp16_;
	GEqualFunc _tmp17_;
	GHashTable* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	gchar* _tmp33_;
	gchar* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	_tmp0_ = g_strdup ("nocng");
	_tmp1_ = g_strdup ("noabin");
	_tmp2_ = g_strdup ("nobg");
	_tmp3_ = g_strdup ("nodcc");
	_tmp4_ = g_strdup ("novrs");
	_tmp5_ = g_strdup ("nogpl");
	_tmp6_ = g_strdup ("noexecbuf2");
	_tmp7_ = g_strdup ("precompile");
	_tmp8_ = g_strdup ("noatc");
	_tmp9_ = g_new0 (gchar*, 9 + 1);
	_tmp9_[0] = _tmp0_;
	_tmp9_[1] = _tmp1_;
	_tmp9_[2] = _tmp2_;
	_tmp9_[3] = _tmp3_;
	_tmp9_[4] = _tmp4_;
	_tmp9_[5] = _tmp5_;
	_tmp9_[6] = _tmp6_;
	_tmp9_[7] = _tmp7_;
	_tmp9_[8] = _tmp8_;
	keys = _tmp9_;
	keys_length1 = 9;
	_keys_size_ = keys_length1;
	_tmp10_ = g_strdup (_ ("Disabled"));
	_tmp11_ = g_strdup (_ ("Enabled (Enforce)"));
	_tmp12_ = g_new0 (gchar*, 2 + 1);
	_tmp12_[0] = _tmp10_;
	_tmp12_[1] = _tmp11_;
	display_opts = _tmp12_;
	display_opts_length1 = 2;
	_display_opts_size_ = display_opts_length1;
	_tmp13_ = g_strdup ("");
	_tmp14_ = g_strdup ("1");
	_tmp15_ = g_new0 (gchar*, 2 + 1);
	_tmp15_[0] = _tmp13_;
	_tmp15_[1] = _tmp14_;
	value_opts = _tmp15_;
	value_opts_length1 = 2;
	_value_opts_size_ = value_opts_length1;
	_tmp16_ = g_str_hash;
	_tmp17_ = g_str_equal;
	_tmp18_ = g_hash_table_new_full (_tmp16_, _tmp17_, _g_free0_, _g_free0_);
	tooltips = _tmp18_;
	_tmp19_ = g_strdup ("nocng");
	_tmp20_ = g_strdup (_ ("Disables Next-Gen Geometry (NGG). Fixes crashes in older Vulkan games."));
	g_hash_table_insert (tooltips, _tmp19_, _tmp20_);
	_tmp21_ = g_strdup ("noabin");
	_tmp22_ = g_strdup (_ ("Disables internal application binary interface caching."));
	g_hash_table_insert (tooltips, _tmp21_, _tmp22_);
	_tmp23_ = g_strdup ("nobg");
	_tmp24_ = g_strdup (_ ("Disables background shader compilation."));
	g_hash_table_insert (tooltips, _tmp23_, _tmp24_);
	_tmp25_ = g_strdup ("nodcc");
	_tmp26_ = g_strdup (_ ("Disables Delta Color Compression. Can fix specific rendering artifacts" \
"."));
	g_hash_table_insert (tooltips, _tmp25_, _tmp26_);
	_tmp27_ = g_strdup ("novrs");
	_tmp28_ = g_strdup (_ ("Disables Variable Rate Shading (VRS). Fixes UI artifacts in some games" \
"."));
	g_hash_table_insert (tooltips, _tmp27_, _tmp28_);
	_tmp29_ = g_strdup ("nogpl");
	_tmp30_ = g_strdup (_ ("Disables Graphics Pipeline Library (GPL) to troubleshoot startup crash" \
"es."));
	g_hash_table_insert (tooltips, _tmp29_, _tmp30_);
	_tmp31_ = g_strdup ("noexecbuf2");
	_tmp32_ = g_strdup (_ ("Forces fallback command submission mode. Helps diagnosing GPU hangs."));
	g_hash_table_insert (tooltips, _tmp31_, _tmp32_);
	_tmp33_ = g_strdup ("novrs");
	_tmp34_ = g_strdup (_ ("Disables Vertex Runtime Shading. Can fix specific rendering artifacts."));
	g_hash_table_insert (tooltips, _tmp33_, _tmp34_);
	_tmp35_ = g_strdup ("precompile");
	_tmp36_ = g_strdup (_ ("Precompiles shaders during loading screens to reduce in-game stutterin" \
"g."));
	g_hash_table_insert (tooltips, _tmp35_, _tmp36_);
	_tmp37_ = g_strdup ("noatc");
	_tmp38_ = g_strdup (_ ("Disables AMD Texture Compression. Fixes texture glitches on APUs and S" \
"team Deck."));
	g_hash_table_insert (tooltips, _tmp37_, _tmp38_);
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionRadvDebug*) proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_construct (object_type, _ ("AMD RADV Debug Options"), _ ("Fine-tune AMD Radeon Vulkan driver behavior"), _ ("Enable RADV Debug"), _ ("Apply low-level driver bugfixes and overrides"), keys, (gint) keys_length1, display_opts, (gint) display_opts_length1, value_opts, (gint) value_opts_length1, tooltips, ",", "RADV_DEBUG");
	_g_hash_table_unref0 (tooltips);
	value_opts = (_vala_array_free (value_opts, value_opts_length1, (GDestroyNotify) g_free), NULL);
	display_opts = (_vala_array_free (display_opts, display_opts_length1, (GDestroyNotify) g_free), NULL);
	keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
	return self;
}

ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionRadvDebug*
proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_new (void)
{
	return proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_construct (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_RADV_DEBUG);
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_class_init (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionRadvDebugClass * klass,
                                                                                     gpointer klass_data)
{
	proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_parent_class = g_type_class_peek_parent (klass);
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_instance_init (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionRadvDebug * self,
                                                                                        gpointer klass)
{
}

static GType
proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionRadvDebugClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionRadvDebug), 0, (GInstanceInitFunc) proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_instance_init, NULL };
	GType proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_type_id;
	proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_type_id = g_type_register_static (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_CUSTOM_PAIRS, "ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionRadvDebug", &g_define_type_info, 0);
	return proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_type_id;
}

GType
proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_get_type (void)
{
	static volatile gsize proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_type_id__once)) {
		GType proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_type_id;
		proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_type_id = proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_type_id__once, proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_type_id);
	}
	return proton_plus_widgets_games_launch_options_editor_launch_option_radv_debug_type_id__once;
}

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

