/* game.c generated by valac 0.56.19, the Vala compiler
 * generated from game.vala, do not modify */

#include "protonplus_core.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.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_MODELS_GAME_0_PROPERTY,
	PROTON_PLUS_MODELS_GAME_NAME_PROPERTY,
	PROTON_PLUS_MODELS_GAME_INSTALLDIR_PROPERTY,
	PROTON_PLUS_MODELS_GAME_PREFIXDIR_PROPERTY,
	PROTON_PLUS_MODELS_GAME_PREFIX_PROPERTY,
	PROTON_PLUS_MODELS_GAME_COMPATIBILITY_TOOL_PROPERTY,
	PROTON_PLUS_MODELS_GAME_LAUNCHER_PROPERTY,
	PROTON_PLUS_MODELS_GAME_IS_NATIVE_PROPERTY,
	PROTON_PLUS_MODELS_GAME_NUM_PROPERTIES
};
static GParamSpec* proton_plus_models_game_properties[PROTON_PLUS_MODELS_GAME_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _ProtonPlusModelsGamePrivate {
	gchar* _name;
	gchar* _installdir;
	gchar* _prefixdir;
	guint _prefix;
	gchar* _compatibility_tool;
	ProtonPlusModelsLauncher* _launcher;
	gboolean _is_native;
};

static gint ProtonPlusModelsGame_private_offset;
static gpointer proton_plus_models_game_parent_class = NULL;

VALA_EXTERN ProtonPlusModelsGame* proton_plus_models_game_construct (GType object_type,
                                                         const gchar* name,
                                                         const gchar* installdir,
                                                         const gchar* prefixdir,
                                                         guint prefix,
                                                         ProtonPlusModelsLauncher* launcher);
static gboolean proton_plus_models_game_real_change_compatibility_tool (ProtonPlusModelsGame* self,
                                                                 const gchar* compat_tool);
static void proton_plus_models_game_finalize (GObject * obj);
static GType proton_plus_models_game_get_type_once (void);
static void _vala_proton_plus_models_game_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_proton_plus_models_game_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_models_game_get_instance_private (ProtonPlusModelsGame* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusModelsGame_private_offset);
}

ProtonPlusModelsGame*
proton_plus_models_game_construct (GType object_type,
                                   const gchar* name,
                                   const gchar* installdir,
                                   const gchar* prefixdir,
                                   guint prefix,
                                   ProtonPlusModelsLauncher* launcher)
{
	ProtonPlusModelsGame * self = NULL;
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (installdir != NULL, NULL);
	g_return_val_if_fail (prefixdir != NULL, NULL);
	g_return_val_if_fail (launcher != NULL, NULL);
	self = (ProtonPlusModelsGame*) g_object_new (object_type, NULL);
	proton_plus_models_game_set_name (self, name);
	proton_plus_models_game_set_installdir (self, installdir);
	proton_plus_models_game_set_prefixdir (self, prefixdir);
	proton_plus_models_game_set_prefix (self, prefix);
	proton_plus_models_game_set_launcher (self, launcher);
	return self;
}

static gboolean
proton_plus_models_game_real_change_compatibility_tool (ProtonPlusModelsGame* self,
                                                        const gchar* compat_tool)
{
	gboolean _tmp0_ = FALSE;
	g_critical ("Type `%s' does not implement abstract method `proton_plus_models_game_change_compatibility_tool'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return _tmp0_;
}

gboolean
proton_plus_models_game_change_compatibility_tool (ProtonPlusModelsGame* self,
                                                   const gchar* compat_tool)
{
	ProtonPlusModelsGameClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = PROTON_PLUS_MODELS_GAME_GET_CLASS (self);
	if (_klass_->change_compatibility_tool) {
		return _klass_->change_compatibility_tool (self, compat_tool);
	}
	return FALSE;
}

const gchar*
proton_plus_models_game_get_name (ProtonPlusModelsGame* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_name;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_game_set_name (ProtonPlusModelsGame* self,
                                  const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_game_get_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_name);
		self->priv->_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_game_properties[PROTON_PLUS_MODELS_GAME_NAME_PROPERTY]);
	}
}

const gchar*
proton_plus_models_game_get_installdir (ProtonPlusModelsGame* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_installdir;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_game_set_installdir (ProtonPlusModelsGame* self,
                                        const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_game_get_installdir (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_installdir);
		self->priv->_installdir = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_game_properties[PROTON_PLUS_MODELS_GAME_INSTALLDIR_PROPERTY]);
	}
}

const gchar*
proton_plus_models_game_get_prefixdir (ProtonPlusModelsGame* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_prefixdir;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_game_set_prefixdir (ProtonPlusModelsGame* self,
                                       const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_game_get_prefixdir (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_prefixdir);
		self->priv->_prefixdir = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_game_properties[PROTON_PLUS_MODELS_GAME_PREFIXDIR_PROPERTY]);
	}
}

guint
proton_plus_models_game_get_prefix (ProtonPlusModelsGame* self)
{
	guint result;
	g_return_val_if_fail (self != NULL, 0U);
	result = self->priv->_prefix;
	return result;
}

void
proton_plus_models_game_set_prefix (ProtonPlusModelsGame* self,
                                    guint value)
{
	guint old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_game_get_prefix (self);
	if (old_value != value) {
		self->priv->_prefix = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_game_properties[PROTON_PLUS_MODELS_GAME_PREFIX_PROPERTY]);
	}
}

const gchar*
proton_plus_models_game_get_compatibility_tool (ProtonPlusModelsGame* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_compatibility_tool;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_game_set_compatibility_tool (ProtonPlusModelsGame* self,
                                                const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_game_get_compatibility_tool (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_compatibility_tool);
		self->priv->_compatibility_tool = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_game_properties[PROTON_PLUS_MODELS_GAME_COMPATIBILITY_TOOL_PROPERTY]);
	}
}

ProtonPlusModelsLauncher*
proton_plus_models_game_get_launcher (ProtonPlusModelsGame* self)
{
	ProtonPlusModelsLauncher* result;
	ProtonPlusModelsLauncher* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_launcher;
	result = _tmp0_;
	return result;
}

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

void
proton_plus_models_game_set_launcher (ProtonPlusModelsGame* self,
                                      ProtonPlusModelsLauncher* value)
{
	ProtonPlusModelsLauncher* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_game_get_launcher (self);
	if (old_value != value) {
		ProtonPlusModelsLauncher* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_launcher);
		self->priv->_launcher = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_game_properties[PROTON_PLUS_MODELS_GAME_LAUNCHER_PROPERTY]);
	}
}

gboolean
proton_plus_models_game_get_is_native (ProtonPlusModelsGame* self)
{
	ProtonPlusModelsGameClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = PROTON_PLUS_MODELS_GAME_GET_CLASS (self);
	if (_klass_->get_is_native) {
		return _klass_->get_is_native (self);
	}
	return FALSE;
}

static gboolean
proton_plus_models_game_real_get_is_native (ProtonPlusModelsGame* base)
{
	gboolean result;
	ProtonPlusModelsGame* self;
	self = base;
	result = self->priv->_is_native;
	return result;
}

void
proton_plus_models_game_set_is_native (ProtonPlusModelsGame* self,
                                       gboolean value)
{
	ProtonPlusModelsGameClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = PROTON_PLUS_MODELS_GAME_GET_CLASS (self);
	if (_klass_->set_is_native) {
		_klass_->set_is_native (self, value);
	}
}

static void
proton_plus_models_game_real_set_is_native (ProtonPlusModelsGame* base,
                                            gboolean value)
{
	ProtonPlusModelsGame* self;
	gboolean old_value;
	self = base;
	old_value = proton_plus_models_game_real_get_is_native (base);
	if (old_value != value) {
		self->priv->_is_native = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_game_properties[PROTON_PLUS_MODELS_GAME_IS_NATIVE_PROPERTY]);
	}
}

static void
proton_plus_models_game_class_init (ProtonPlusModelsGameClass * klass,
                                    gpointer klass_data)
{
	proton_plus_models_game_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusModelsGame_private_offset);
	((ProtonPlusModelsGameClass *) klass)->change_compatibility_tool = (gboolean (*) (ProtonPlusModelsGame*, const gchar*)) proton_plus_models_game_real_change_compatibility_tool;
	PROTON_PLUS_MODELS_GAME_CLASS (klass)->get_is_native = (gboolean (*) (ProtonPlusModelsGame*)) proton_plus_models_game_real_get_is_native;
	PROTON_PLUS_MODELS_GAME_CLASS (klass)->set_is_native = (void (*) (ProtonPlusModelsGame*, gboolean)) proton_plus_models_game_real_set_is_native;
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_models_game_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_models_game_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_models_game_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_GAME_NAME_PROPERTY, proton_plus_models_game_properties[PROTON_PLUS_MODELS_GAME_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_GAME_INSTALLDIR_PROPERTY, proton_plus_models_game_properties[PROTON_PLUS_MODELS_GAME_INSTALLDIR_PROPERTY] = g_param_spec_string ("installdir", "installdir", "installdir", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_GAME_PREFIXDIR_PROPERTY, proton_plus_models_game_properties[PROTON_PLUS_MODELS_GAME_PREFIXDIR_PROPERTY] = g_param_spec_string ("prefixdir", "prefixdir", "prefixdir", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_GAME_PREFIX_PROPERTY, proton_plus_models_game_properties[PROTON_PLUS_MODELS_GAME_PREFIX_PROPERTY] = g_param_spec_uint ("prefix", "prefix", "prefix", 0, G_MAXUINT, 0U, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_GAME_COMPATIBILITY_TOOL_PROPERTY, proton_plus_models_game_properties[PROTON_PLUS_MODELS_GAME_COMPATIBILITY_TOOL_PROPERTY] = g_param_spec_string ("compatibility-tool", "compatibility-tool", "compatibility-tool", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_GAME_LAUNCHER_PROPERTY, proton_plus_models_game_properties[PROTON_PLUS_MODELS_GAME_LAUNCHER_PROPERTY] = g_param_spec_object ("launcher", "launcher", "launcher", PROTON_PLUS_MODELS_TYPE_LAUNCHER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_GAME_IS_NATIVE_PROPERTY, proton_plus_models_game_properties[PROTON_PLUS_MODELS_GAME_IS_NATIVE_PROPERTY] = g_param_spec_boolean ("is-native", "is-native", "is-native", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
proton_plus_models_game_instance_init (ProtonPlusModelsGame * self,
                                       gpointer klass)
{
	self->priv = proton_plus_models_game_get_instance_private (self);
	self->priv->_is_native = FALSE;
}

static void
proton_plus_models_game_finalize (GObject * obj)
{
	ProtonPlusModelsGame * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_MODELS_TYPE_GAME, ProtonPlusModelsGame);
	_g_free0 (self->priv->_name);
	_g_free0 (self->priv->_installdir);
	_g_free0 (self->priv->_prefixdir);
	_g_free0 (self->priv->_compatibility_tool);
	_g_object_unref0 (self->priv->_launcher);
	G_OBJECT_CLASS (proton_plus_models_game_parent_class)->finalize (obj);
}

static GType
proton_plus_models_game_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusModelsGameClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_models_game_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusModelsGame), 0, (GInstanceInitFunc) proton_plus_models_game_instance_init, NULL };
	GType proton_plus_models_game_type_id;
	proton_plus_models_game_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusModelsGame", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	ProtonPlusModelsGame_private_offset = g_type_add_instance_private (proton_plus_models_game_type_id, sizeof (ProtonPlusModelsGamePrivate));
	return proton_plus_models_game_type_id;
}

GType
proton_plus_models_game_get_type (void)
{
	static volatile gsize proton_plus_models_game_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_models_game_type_id__once)) {
		GType proton_plus_models_game_type_id;
		proton_plus_models_game_type_id = proton_plus_models_game_get_type_once ();
		g_once_init_leave (&proton_plus_models_game_type_id__once, proton_plus_models_game_type_id);
	}
	return proton_plus_models_game_type_id__once;
}

static void
_vala_proton_plus_models_game_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	ProtonPlusModelsGame * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_MODELS_TYPE_GAME, ProtonPlusModelsGame);
	switch (property_id) {
		case PROTON_PLUS_MODELS_GAME_NAME_PROPERTY:
		g_value_set_string (value, proton_plus_models_game_get_name (self));
		break;
		case PROTON_PLUS_MODELS_GAME_INSTALLDIR_PROPERTY:
		g_value_set_string (value, proton_plus_models_game_get_installdir (self));
		break;
		case PROTON_PLUS_MODELS_GAME_PREFIXDIR_PROPERTY:
		g_value_set_string (value, proton_plus_models_game_get_prefixdir (self));
		break;
		case PROTON_PLUS_MODELS_GAME_PREFIX_PROPERTY:
		g_value_set_uint (value, proton_plus_models_game_get_prefix (self));
		break;
		case PROTON_PLUS_MODELS_GAME_COMPATIBILITY_TOOL_PROPERTY:
		g_value_set_string (value, proton_plus_models_game_get_compatibility_tool (self));
		break;
		case PROTON_PLUS_MODELS_GAME_LAUNCHER_PROPERTY:
		g_value_set_object (value, proton_plus_models_game_get_launcher (self));
		break;
		case PROTON_PLUS_MODELS_GAME_IS_NATIVE_PROPERTY:
		g_value_set_boolean (value, proton_plus_models_game_get_is_native (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_models_game_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	ProtonPlusModelsGame * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_MODELS_TYPE_GAME, ProtonPlusModelsGame);
	switch (property_id) {
		case PROTON_PLUS_MODELS_GAME_NAME_PROPERTY:
		proton_plus_models_game_set_name (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_GAME_INSTALLDIR_PROPERTY:
		proton_plus_models_game_set_installdir (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_GAME_PREFIXDIR_PROPERTY:
		proton_plus_models_game_set_prefixdir (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_GAME_PREFIX_PROPERTY:
		proton_plus_models_game_set_prefix (self, g_value_get_uint (value));
		break;
		case PROTON_PLUS_MODELS_GAME_COMPATIBILITY_TOOL_PROPERTY:
		proton_plus_models_game_set_compatibility_tool (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_GAME_LAUNCHER_PROPERTY:
		proton_plus_models_game_set_launcher (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_MODELS_GAME_IS_NATIVE_PROPERTY:
		proton_plus_models_game_set_is_native (self, g_value_get_boolean (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;
}

