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

#include <glib-object.h>
#include "protonplus_core.h"
#include <glib.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_VKD3D_DEFINITIONS (proton_plus_models_providers_vkd3d_definitions_get_type ())
#define PROTON_PLUS_MODELS_PROVIDERS_VKD3D_DEFINITIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_PROVIDERS_TYPE_VKD3D_DEFINITIONS, ProtonPlusModelsProvidersVkd3dDefinitions))
#define PROTON_PLUS_MODELS_PROVIDERS_VKD3D_DEFINITIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_PROVIDERS_TYPE_VKD3D_DEFINITIONS, ProtonPlusModelsProvidersVkd3dDefinitionsClass))
#define PROTON_PLUS_MODELS_PROVIDERS_IS_VKD3D_DEFINITIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_PROVIDERS_TYPE_VKD3D_DEFINITIONS))
#define PROTON_PLUS_MODELS_PROVIDERS_IS_VKD3D_DEFINITIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_PROVIDERS_TYPE_VKD3D_DEFINITIONS))
#define PROTON_PLUS_MODELS_PROVIDERS_VKD3D_DEFINITIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_PROVIDERS_TYPE_VKD3D_DEFINITIONS, ProtonPlusModelsProvidersVkd3dDefinitionsClass))

typedef struct _ProtonPlusModelsProvidersVkd3dDefinitions ProtonPlusModelsProvidersVkd3dDefinitions;
typedef struct _ProtonPlusModelsProvidersVkd3dDefinitionsClass ProtonPlusModelsProvidersVkd3dDefinitionsClass;
typedef struct _ProtonPlusModelsProvidersVkd3dDefinitionsPrivate ProtonPlusModelsProvidersVkd3dDefinitionsPrivate;
enum  {
	PROTON_PLUS_MODELS_PROVIDERS_VKD3D_DEFINITIONS_0_PROPERTY,
	PROTON_PLUS_MODELS_PROVIDERS_VKD3D_DEFINITIONS_NUM_PROPERTIES
};
static GParamSpec* proton_plus_models_providers_vkd3d_definitions_properties[PROTON_PLUS_MODELS_PROVIDERS_VKD3D_DEFINITIONS_NUM_PROPERTIES];

struct _ProtonPlusModelsProvidersVkd3dDefinitions {
	GObject parent_instance;
	ProtonPlusModelsProvidersVkd3dDefinitionsPrivate * priv;
};

struct _ProtonPlusModelsProvidersVkd3dDefinitionsClass {
	GObjectClass parent_class;
};

static gpointer proton_plus_models_providers_vkd3d_definitions_parent_class = NULL;

VALA_EXTERN GType proton_plus_models_providers_vkd3d_definitions_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusModelsProvidersProviderDefinition** proton_plus_models_providers_vkd3d_definitions_create (gint* result_length1);
VALA_EXTERN ProtonPlusModelsProvidersVkd3dDefinitions* proton_plus_models_providers_vkd3d_definitions_new (void);
VALA_EXTERN ProtonPlusModelsProvidersVkd3dDefinitions* proton_plus_models_providers_vkd3d_definitions_construct (GType object_type);
static GType proton_plus_models_providers_vkd3d_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_vkd3d_definitions_create (gint* result_length1)
{
	ProtonPlusModelsProvidersVariantDefinition* _tmp0_;
	ProtonPlusModelsProvidersVariantDefinition** _tmp1_;
	ProtonPlusModelsProvidersVariantDefinition** _tmp2_;
	gint _tmp2__length1;
	ProtonPlusModelsProvidersInstallLayout* _tmp3_;
	ProtonPlusModelsProvidersInstallLayout** _tmp4_;
	ProtonPlusModelsProvidersInstallLayout** _tmp5_;
	gint _tmp5__length1;
	ProtonPlusModelsProvidersProviderDefinition* _tmp6_;
	ProtonPlusModelsProvidersVariantDefinition* _tmp7_;
	ProtonPlusModelsProvidersVariantDefinition** _tmp8_;
	ProtonPlusModelsProvidersVariantDefinition** _tmp9_;
	gint _tmp9__length1;
	ProtonPlusModelsProvidersInstallLayout* _tmp10_;
	ProtonPlusModelsProvidersInstallLayout** _tmp11_;
	ProtonPlusModelsProvidersInstallLayout** _tmp12_;
	gint _tmp12__length1;
	ProtonPlusModelsProvidersProviderDefinition* _tmp13_;
	ProtonPlusModelsProvidersProviderDefinition** _tmp14_;
	ProtonPlusModelsProvidersProviderDefinition** _tmp15_;
	gint _tmp15__length1;
	ProtonPlusModelsProvidersProviderDefinition** _tmp16_;
	gint _tmp16__length1;
	ProtonPlusModelsProvidersProviderDefinition** result;
	_tmp0_ = proton_plus_models_providers_variant_definition_new ("standard", "default", "vkd3d-proton-$release_version", TRUE, NULL, NULL, 0);
	_tmp1_ = g_new0 (ProtonPlusModelsProvidersVariantDefinition*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = 1;
	_tmp3_ = proton_plus_models_providers_install_layout_replace ("default", "$release_name", "v", "vkd3d-proton-");
	_tmp4_ = g_new0 (ProtonPlusModelsProvidersInstallLayout*, 1 + 1);
	_tmp4_[0] = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp5__length1 = 1;
	_tmp6_ = proton_plus_models_providers_provider_definition_new (PROTON_PLUS_MODELS_PROVIDERS_CATEGORY_VKD3D, PROTON_PLUS_MODELS_PROVIDERS_SOURCE_TYPE_GITHUB, "vkd3d-proton", "VKD3D-Proton", "", "https://api.github.com/repos/HansKristian-Work/vkd3d-proton/releases", "https://github.com/HansKristian-Work/vkd3d-proton", 1, _tmp2_, 1, _tmp5_, 1, NULL, 0, NULL, 0, "", FALSE, "", PROTON_PLUS_MODELS_PROVIDERS_ARCHIVE_INSTALL_REQUIREMENT_STANDARD, TRUE, NULL, 0);
	_tmp7_ = proton_plus_models_providers_variant_definition_new ("standard", "default", "vkd3d-$release_version", TRUE, NULL, NULL, 0);
	_tmp8_ = g_new0 (ProtonPlusModelsProvidersVariantDefinition*, 1 + 1);
	_tmp8_[0] = _tmp7_;
	_tmp9_ = _tmp8_;
	_tmp9__length1 = 1;
	_tmp10_ = proton_plus_models_providers_install_layout_template ("default", "$release_name");
	_tmp11_ = g_new0 (ProtonPlusModelsProvidersInstallLayout*, 1 + 1);
	_tmp11_[0] = _tmp10_;
	_tmp12_ = _tmp11_;
	_tmp12__length1 = 1;
	_tmp13_ = proton_plus_models_providers_provider_definition_new (PROTON_PLUS_MODELS_PROVIDERS_CATEGORY_VKD3D, PROTON_PLUS_MODELS_PROVIDERS_SOURCE_TYPE_GITHUB, "vkd3d-lutris", "VKD3D-Lutris", "", "https://api.github.com/repos/lutris/vkd3d/releases", "https://github.com/lutris/vkd3d", 2, _tmp9_, 1, _tmp12_, 1, NULL, 0, NULL, 0, "", FALSE, "", PROTON_PLUS_MODELS_PROVIDERS_ARCHIVE_INSTALL_REQUIREMENT_STANDARD, TRUE, NULL, 0);
	_tmp14_ = g_new0 (ProtonPlusModelsProvidersProviderDefinition*, 2 + 1);
	_tmp14_[0] = _tmp6_;
	_tmp14_[1] = _tmp13_;
	_tmp15_ = _tmp14_;
	_tmp15__length1 = 2;
	_tmp12_ = (_vala_array_free (_tmp12_, _tmp12__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp9_ = (_vala_array_free (_tmp9_, _tmp9__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp5_ = (_vala_array_free (_tmp5_, _tmp5__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp2_ = (_vala_array_free (_tmp2_, _tmp2__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp16_ = _tmp15_;
	_tmp16__length1 = _tmp15__length1;
	if (result_length1) {
		*result_length1 = _tmp16__length1;
	}
	result = _tmp16_;
	return result;
}

ProtonPlusModelsProvidersVkd3dDefinitions*
proton_plus_models_providers_vkd3d_definitions_construct (GType object_type)
{
	ProtonPlusModelsProvidersVkd3dDefinitions * self = NULL;
	self = (ProtonPlusModelsProvidersVkd3dDefinitions*) g_object_new (object_type, NULL);
	return self;
}

ProtonPlusModelsProvidersVkd3dDefinitions*
proton_plus_models_providers_vkd3d_definitions_new (void)
{
	return proton_plus_models_providers_vkd3d_definitions_construct (PROTON_PLUS_MODELS_PROVIDERS_TYPE_VKD3D_DEFINITIONS);
}

static void
proton_plus_models_providers_vkd3d_definitions_class_init (ProtonPlusModelsProvidersVkd3dDefinitionsClass * klass,
                                                           gpointer klass_data)
{
	proton_plus_models_providers_vkd3d_definitions_parent_class = g_type_class_peek_parent (klass);
}

static void
proton_plus_models_providers_vkd3d_definitions_instance_init (ProtonPlusModelsProvidersVkd3dDefinitions * self,
                                                              gpointer klass)
{
}

static GType
proton_plus_models_providers_vkd3d_definitions_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusModelsProvidersVkd3dDefinitionsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_models_providers_vkd3d_definitions_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusModelsProvidersVkd3dDefinitions), 0, (GInstanceInitFunc) proton_plus_models_providers_vkd3d_definitions_instance_init, NULL };
	GType proton_plus_models_providers_vkd3d_definitions_type_id;
	proton_plus_models_providers_vkd3d_definitions_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusModelsProvidersVkd3dDefinitions", &g_define_type_info, 0);
	return proton_plus_models_providers_vkd3d_definitions_type_id;
}

GType
proton_plus_models_providers_vkd3d_definitions_get_type (void)
{
	static volatile gsize proton_plus_models_providers_vkd3d_definitions_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_models_providers_vkd3d_definitions_type_id__once)) {
		GType proton_plus_models_providers_vkd3d_definitions_type_id;
		proton_plus_models_providers_vkd3d_definitions_type_id = proton_plus_models_providers_vkd3d_definitions_get_type_once ();
		g_once_init_leave (&proton_plus_models_providers_vkd3d_definitions_type_id__once, proton_plus_models_providers_vkd3d_definitions_type_id);
	}
	return proton_plus_models_providers_vkd3d_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;
}

