/* built-in-provider-definitions.c generated by valac 0.56.19, the Vala compiler
 * generated from built-in-provider-definitions.vala, do not modify */

#include <glib-object.h>
#include "protonplus_core.h"
#include <glib.h>
#include <gee.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

#define PROTON_PLUS_MODELS_PROVIDERS_TYPE_BUILT_IN_PROVIDER_DEFINITIONS (proton_plus_models_providers_built_in_provider_definitions_get_type ())
#define PROTON_PLUS_MODELS_PROVIDERS_BUILT_IN_PROVIDER_DEFINITIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_PROVIDERS_TYPE_BUILT_IN_PROVIDER_DEFINITIONS, ProtonPlusModelsProvidersBuiltInProviderDefinitions))
#define PROTON_PLUS_MODELS_PROVIDERS_BUILT_IN_PROVIDER_DEFINITIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_PROVIDERS_TYPE_BUILT_IN_PROVIDER_DEFINITIONS, ProtonPlusModelsProvidersBuiltInProviderDefinitionsClass))
#define PROTON_PLUS_MODELS_PROVIDERS_IS_BUILT_IN_PROVIDER_DEFINITIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_PROVIDERS_TYPE_BUILT_IN_PROVIDER_DEFINITIONS))
#define PROTON_PLUS_MODELS_PROVIDERS_IS_BUILT_IN_PROVIDER_DEFINITIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_PROVIDERS_TYPE_BUILT_IN_PROVIDER_DEFINITIONS))
#define PROTON_PLUS_MODELS_PROVIDERS_BUILT_IN_PROVIDER_DEFINITIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_PROVIDERS_TYPE_BUILT_IN_PROVIDER_DEFINITIONS, ProtonPlusModelsProvidersBuiltInProviderDefinitionsClass))

typedef struct _ProtonPlusModelsProvidersBuiltInProviderDefinitions ProtonPlusModelsProvidersBuiltInProviderDefinitions;
typedef struct _ProtonPlusModelsProvidersBuiltInProviderDefinitionsClass ProtonPlusModelsProvidersBuiltInProviderDefinitionsClass;
typedef struct _ProtonPlusModelsProvidersBuiltInProviderDefinitionsPrivate ProtonPlusModelsProvidersBuiltInProviderDefinitionsPrivate;
enum  {
	PROTON_PLUS_MODELS_PROVIDERS_BUILT_IN_PROVIDER_DEFINITIONS_0_PROPERTY,
	PROTON_PLUS_MODELS_PROVIDERS_BUILT_IN_PROVIDER_DEFINITIONS_NUM_PROPERTIES
};
static GParamSpec* proton_plus_models_providers_built_in_provider_definitions_properties[PROTON_PLUS_MODELS_PROVIDERS_BUILT_IN_PROVIDER_DEFINITIONS_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _ProtonPlusModelsProvidersBuiltInProviderDefinitions {
	GObject parent_instance;
	ProtonPlusModelsProvidersBuiltInProviderDefinitionsPrivate * priv;
};

struct _ProtonPlusModelsProvidersBuiltInProviderDefinitionsClass {
	GObjectClass parent_class;
};

static gpointer proton_plus_models_providers_built_in_provider_definitions_parent_class = NULL;

VALA_EXTERN GType proton_plus_models_providers_built_in_provider_definitions_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusModelsProvidersProviderDefinition** proton_plus_models_providers_built_in_provider_definitions_create_all (gint* result_length1);
static void proton_plus_models_providers_built_in_provider_definitions_append (GeeArrayList* target,
                                                                        ProtonPlusModelsProvidersProviderDefinition** values,
                                                                        gint values_length1);
VALA_EXTERN ProtonPlusModelsProvidersProviderDefinition** proton_plus_models_providers_dxvk_definitions_create (gint* result_length1);
VALA_EXTERN ProtonPlusModelsProvidersProviderDefinition** proton_plus_models_providers_vkd3d_definitions_create (gint* result_length1);
VALA_EXTERN ProtonPlusModelsProvidersProviderDefinition** proton_plus_models_providers_proton_definitions_create (gint* result_length1);
VALA_EXTERN ProtonPlusModelsProvidersProviderDefinition** proton_plus_models_providers_wine_definitions_create (gint* result_length1);
static ProtonPlusModelsProvidersProviderDefinition** proton_plus_models_providers_built_in_provider_definitions_copy_definitions (GeeCollection* values,
                                                                                                                           gint* result_length1);
VALA_EXTERN ProtonPlusModelsProvidersBuiltInProviderDefinitions* proton_plus_models_providers_built_in_provider_definitions_new (void);
VALA_EXTERN ProtonPlusModelsProvidersBuiltInProviderDefinitions* proton_plus_models_providers_built_in_provider_definitions_construct (GType object_type);
static GType proton_plus_models_providers_built_in_provider_definitions_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);

ProtonPlusModelsProvidersProviderDefinition**
proton_plus_models_providers_built_in_provider_definitions_create_all (gint* result_length1)
{
	GeeArrayList* definitions = NULL;
	GeeArrayList* _tmp0_;
	gint _tmp1_ = 0;
	ProtonPlusModelsProvidersProviderDefinition** _tmp2_;
	ProtonPlusModelsProvidersProviderDefinition** _tmp3_;
	gint _tmp3__length1;
	gint _tmp4_ = 0;
	ProtonPlusModelsProvidersProviderDefinition** _tmp5_;
	ProtonPlusModelsProvidersProviderDefinition** _tmp6_;
	gint _tmp6__length1;
	gint _tmp7_ = 0;
	ProtonPlusModelsProvidersProviderDefinition** _tmp8_;
	ProtonPlusModelsProvidersProviderDefinition** _tmp9_;
	gint _tmp9__length1;
	gint _tmp10_ = 0;
	ProtonPlusModelsProvidersProviderDefinition** _tmp11_;
	ProtonPlusModelsProvidersProviderDefinition** _tmp12_;
	gint _tmp12__length1;
	gint _tmp13_ = 0;
	ProtonPlusModelsProvidersProviderDefinition** _tmp14_;
	ProtonPlusModelsProvidersProviderDefinition** _tmp15_;
	gint _tmp15__length1;
	ProtonPlusModelsProvidersProviderDefinition** result;
	_tmp0_ = gee_array_list_new (PROTON_PLUS_MODELS_PROVIDERS_TYPE_PROVIDER_DEFINITION, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	definitions = _tmp0_;
	_tmp2_ = proton_plus_models_providers_dxvk_definitions_create (&_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp3__length1 = _tmp1_;
	proton_plus_models_providers_built_in_provider_definitions_append (definitions, _tmp3_, (gint) _tmp1_);
	_tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp5_ = proton_plus_models_providers_vkd3d_definitions_create (&_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp6__length1 = _tmp4_;
	proton_plus_models_providers_built_in_provider_definitions_append (definitions, _tmp6_, (gint) _tmp4_);
	_tmp6_ = (_vala_array_free (_tmp6_, _tmp6__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp8_ = proton_plus_models_providers_proton_definitions_create (&_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp9__length1 = _tmp7_;
	proton_plus_models_providers_built_in_provider_definitions_append (definitions, _tmp9_, (gint) _tmp7_);
	_tmp9_ = (_vala_array_free (_tmp9_, _tmp9__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp11_ = proton_plus_models_providers_wine_definitions_create (&_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp12__length1 = _tmp10_;
	proton_plus_models_providers_built_in_provider_definitions_append (definitions, _tmp12_, (gint) _tmp10_);
	_tmp12_ = (_vala_array_free (_tmp12_, _tmp12__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp14_ = proton_plus_models_providers_built_in_provider_definitions_copy_definitions ((GeeCollection*) definitions, &_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp15__length1 = _tmp13_;
	if (result_length1) {
		*result_length1 = _tmp15__length1;
	}
	result = _tmp15_;
	_g_object_unref0 (definitions);
	return result;
}

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

static void
proton_plus_models_providers_built_in_provider_definitions_append (GeeArrayList* target,
                                                                   ProtonPlusModelsProvidersProviderDefinition** values,
                                                                   gint values_length1)
{
	g_return_if_fail (target != NULL);
	{
		ProtonPlusModelsProvidersProviderDefinition** value_collection = NULL;
		gint value_collection_length1 = 0;
		gint _value_collection_size_ = 0;
		gint value_it = 0;
		value_collection = values;
		value_collection_length1 = values_length1;
		for (value_it = 0; value_it < value_collection_length1; value_it = value_it + 1) {
			ProtonPlusModelsProvidersProviderDefinition* _tmp0_;
			ProtonPlusModelsProvidersProviderDefinition* value = NULL;
			_tmp0_ = _g_object_ref0 (value_collection[value_it]);
			value = _tmp0_;
			{
				ProtonPlusModelsProvidersProviderDefinition* _tmp1_;
				_tmp1_ = value;
				gee_abstract_collection_add ((GeeAbstractCollection*) target, _tmp1_);
				_g_object_unref0 (value);
			}
		}
	}
}

static ProtonPlusModelsProvidersProviderDefinition**
proton_plus_models_providers_built_in_provider_definitions_copy_definitions (GeeCollection* values,
                                                                             gint* result_length1)
{
	ProtonPlusModelsProvidersProviderDefinition** copied = NULL;
	gint _tmp0_;
	gint _tmp1_;
	ProtonPlusModelsProvidersProviderDefinition** _tmp2_;
	gint copied_length1;
	gint _copied_size_;
	gint index = 0;
	ProtonPlusModelsProvidersProviderDefinition** _tmp11_;
	gint _tmp11__length1;
	ProtonPlusModelsProvidersProviderDefinition** result;
	g_return_val_if_fail (values != NULL, NULL);
	_tmp0_ = gee_collection_get_size (values);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_new0 (ProtonPlusModelsProvidersProviderDefinition*, _tmp1_ + 1);
	copied = _tmp2_;
	copied_length1 = _tmp1_;
	_copied_size_ = copied_length1;
	index = 0;
	{
		GeeIterator* _value_it = NULL;
		GeeIterator* _tmp3_;
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) values);
		_value_it = _tmp3_;
		while (TRUE) {
			GeeIterator* _tmp4_;
			ProtonPlusModelsProvidersProviderDefinition* value = NULL;
			GeeIterator* _tmp5_;
			gpointer _tmp6_;
			ProtonPlusModelsProvidersProviderDefinition** _tmp7_;
			gint _tmp7__length1;
			gint _tmp8_;
			ProtonPlusModelsProvidersProviderDefinition* _tmp9_;
			ProtonPlusModelsProvidersProviderDefinition* _tmp10_;
			_tmp4_ = _value_it;
			if (!gee_iterator_next (_tmp4_)) {
				break;
			}
			_tmp5_ = _value_it;
			_tmp6_ = gee_iterator_get (_tmp5_);
			value = (ProtonPlusModelsProvidersProviderDefinition*) _tmp6_;
			_tmp7_ = copied;
			_tmp7__length1 = copied_length1;
			_tmp8_ = index;
			index = _tmp8_ + 1;
			_tmp9_ = value;
			_tmp10_ = _g_object_ref0 (_tmp9_);
			_g_object_unref0 (_tmp7_[_tmp8_]);
			_tmp7_[_tmp8_] = _tmp10_;
			_g_object_unref0 (value);
		}
		_g_object_unref0 (_value_it);
	}
	_tmp11_ = copied;
	_tmp11__length1 = copied_length1;
	if (result_length1) {
		*result_length1 = _tmp11__length1;
	}
	result = _tmp11_;
	return result;
}

ProtonPlusModelsProvidersBuiltInProviderDefinitions*
proton_plus_models_providers_built_in_provider_definitions_construct (GType object_type)
{
	ProtonPlusModelsProvidersBuiltInProviderDefinitions * self = NULL;
	self = (ProtonPlusModelsProvidersBuiltInProviderDefinitions*) g_object_new (object_type, NULL);
	return self;
}

ProtonPlusModelsProvidersBuiltInProviderDefinitions*
proton_plus_models_providers_built_in_provider_definitions_new (void)
{
	return proton_plus_models_providers_built_in_provider_definitions_construct (PROTON_PLUS_MODELS_PROVIDERS_TYPE_BUILT_IN_PROVIDER_DEFINITIONS);
}

static void
proton_plus_models_providers_built_in_provider_definitions_class_init (ProtonPlusModelsProvidersBuiltInProviderDefinitionsClass * klass,
                                                                       gpointer klass_data)
{
	proton_plus_models_providers_built_in_provider_definitions_parent_class = g_type_class_peek_parent (klass);
}

static void
proton_plus_models_providers_built_in_provider_definitions_instance_init (ProtonPlusModelsProvidersBuiltInProviderDefinitions * self,
                                                                          gpointer klass)
{
}

static GType
proton_plus_models_providers_built_in_provider_definitions_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusModelsProvidersBuiltInProviderDefinitionsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_models_providers_built_in_provider_definitions_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusModelsProvidersBuiltInProviderDefinitions), 0, (GInstanceInitFunc) proton_plus_models_providers_built_in_provider_definitions_instance_init, NULL };
	GType proton_plus_models_providers_built_in_provider_definitions_type_id;
	proton_plus_models_providers_built_in_provider_definitions_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusModelsProvidersBuiltInProviderDefinitions", &g_define_type_info, 0);
	return proton_plus_models_providers_built_in_provider_definitions_type_id;
}

GType
proton_plus_models_providers_built_in_provider_definitions_get_type (void)
{
	static volatile gsize proton_plus_models_providers_built_in_provider_definitions_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_models_providers_built_in_provider_definitions_type_id__once)) {
		GType proton_plus_models_providers_built_in_provider_definitions_type_id;
		proton_plus_models_providers_built_in_provider_definitions_type_id = proton_plus_models_providers_built_in_provider_definitions_get_type_once ();
		g_once_init_leave (&proton_plus_models_providers_built_in_provider_definitions_type_id__once, proton_plus_models_providers_built_in_provider_definitions_type_id);
	}
	return proton_plus_models_providers_built_in_provider_definitions_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;
}

