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

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

enum  {
	PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_0_PROPERTY,
	PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_DEFINITION_PROPERTY,
	PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_ENDPOINT_PROPERTY,
	PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_ARCHIVE_INSTALL_REQUIREMENT_PROPERTY,
	PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_INSTALL_LAYOUT_PROPERTY,
	PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_TAG_PROPERTY,
	PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_VARIANTS_PROPERTY,
	PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_NUM_PROPERTIES
};
static GParamSpec* proton_plus_models_tools_provider_tool_properties[PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _ProtonPlusModelsToolsProviderToolPrivate {
	ProtonPlusModelsProvidersProviderDefinition* _definition;
	ProtonPlusModelsProvidersArchiveInstallRequirement _archive_install_requirement;
	ProtonPlusModelsProvidersInstallLayout* _install_layout;
	GeeLinkedList* _variants;
};

static gint ProtonPlusModelsToolsProviderTool_private_offset;
static gpointer proton_plus_models_tools_provider_tool_parent_class = NULL;

static void proton_plus_models_tools_provider_tool_set_install_layout (ProtonPlusModelsToolsProviderTool* self,
                                                                ProtonPlusModelsProvidersInstallLayout* value);
static void proton_plus_models_tools_provider_tool_set_archive_install_requirement (ProtonPlusModelsToolsProviderTool* self,
                                                                             ProtonPlusModelsProvidersArchiveInstallRequirement value);
VALA_EXTERN void proton_plus_models_tool_set_identity (ProtonPlusModelsTool* self,
                                           const gchar* provider_id,
                                           const gchar* source_id);
VALA_EXTERN ProtonPlusModelsProvidersInstallLayout* proton_plus_models_tools_provider_tool_get_install_layout (ProtonPlusModelsToolsProviderTool* self);
static void proton_plus_models_tools_provider_tool_set_variants (ProtonPlusModelsToolsProviderTool* self,
                                                          GeeLinkedList* value);
static void proton_plus_models_tools_provider_tool_finalize (GObject * obj);
static GType proton_plus_models_tools_provider_tool_get_type_once (void);
static void _vala_proton_plus_models_tools_provider_tool_get_property (GObject * object,
                                                                guint property_id,
                                                                GValue * value,
                                                                GParamSpec * pspec);
static void _vala_proton_plus_models_tools_provider_tool_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_models_tools_provider_tool_get_instance_private (ProtonPlusModelsToolsProviderTool* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusModelsToolsProviderTool_private_offset);
}

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

ProtonPlusModelsToolsProviderTool*
proton_plus_models_tools_provider_tool_construct_with_catalog (GType object_type,
                                                               ProtonPlusModelsProvidersProviderDefinition* definition,
                                                               ProtonPlusProvidersSourcesReleaseSource* release_source,
                                                               ProtonPlusModelsGroup* group,
                                                               ProtonPlusModelsProvidersInstallLayout* install_layout)
{
	ProtonPlusModelsToolsProviderTool * self = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	gboolean _tmp8_;
	gboolean _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	ProtonPlusModelsProvidersArchiveInstallRequirement _tmp12_;
	ProtonPlusModelsProvidersArchiveInstallRequirement _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	const gchar* _tmp22_;
	ProtonPlusModelsReleaseCatalog* _tmp23_;
	ProtonPlusModelsReleaseCatalog* _tmp24_;
	gint _tmp25_ = 0;
	ProtonPlusModelsProvidersVariantDefinition** _tmp26_;
	g_return_val_if_fail (definition != NULL, NULL);
	g_return_val_if_fail (release_source != NULL, NULL);
	g_return_val_if_fail (group != NULL, NULL);
	g_return_val_if_fail (install_layout != NULL, NULL);
	self = (ProtonPlusModelsToolsProviderTool*) g_object_new (object_type, "group", group, "definition", definition, NULL);
	proton_plus_models_tools_provider_tool_set_install_layout (self, install_layout);
	_tmp0_ = proton_plus_models_providers_provider_definition_get_title (definition);
	_tmp1_ = _tmp0_;
	proton_plus_models_tool_set_title ((ProtonPlusModelsTool*) self, _tmp1_);
	_tmp2_ = proton_plus_models_providers_provider_definition_get_description (definition);
	_tmp3_ = _tmp2_;
	_tmp4_ = proton_plus_utils_safe_translate (_tmp3_);
	_tmp5_ = _tmp4_;
	proton_plus_models_tool_set_description ((ProtonPlusModelsTool*) self, _tmp5_);
	_g_free0 (_tmp5_);
	_tmp6_ = proton_plus_models_providers_provider_definition_get_repository_url (definition);
	_tmp7_ = _tmp6_;
	proton_plus_models_tool_set_repository_url ((ProtonPlusModelsTool*) self, _tmp7_);
	_tmp8_ = proton_plus_models_providers_provider_definition_get_legacy (definition);
	_tmp9_ = _tmp8_;
	proton_plus_models_tool_set_legacy ((ProtonPlusModelsTool*) self, _tmp9_);
	_tmp10_ = proton_plus_models_providers_provider_definition_get_sort_priority (definition);
	_tmp11_ = _tmp10_;
	proton_plus_models_tool_set_sort_priority ((ProtonPlusModelsTool*) self, _tmp11_);
	_tmp12_ = proton_plus_models_providers_provider_definition_get_archive_install_requirement (definition);
	_tmp13_ = _tmp12_;
	proton_plus_models_tools_provider_tool_set_archive_install_requirement (self, _tmp13_);
	_tmp14_ = proton_plus_models_providers_provider_definition_get_provider_id (definition);
	_tmp15_ = _tmp14_;
	_tmp16_ = proton_plus_models_providers_provider_definition_get_source_id (definition);
	_tmp17_ = _tmp16_;
	_tmp18_ = _tmp17_;
	proton_plus_models_tool_set_identity ((ProtonPlusModelsTool*) self, _tmp15_, _tmp18_);
	_g_free0 (_tmp18_);
	_tmp19_ = proton_plus_models_tool_get_id ((ProtonPlusModelsTool*) self);
	_tmp20_ = _tmp19_;
	_tmp21_ = proton_plus_models_tool_get_title ((ProtonPlusModelsTool*) self);
	_tmp22_ = _tmp21_;
	_tmp23_ = proton_plus_models_release_catalog_new (_tmp20_, _tmp22_, definition, release_source);
	_tmp24_ = _tmp23_;
	proton_plus_models_tool_initialize_release_catalog ((ProtonPlusModelsTool*) self, _tmp24_);
	_g_object_unref0 (_tmp24_);
	_tmp26_ = proton_plus_models_providers_provider_definition_get_variants (definition, &_tmp25_);
	{
		ProtonPlusModelsProvidersVariantDefinition** configured_variant_collection = NULL;
		gint configured_variant_collection_length1 = 0;
		gint _configured_variant_collection_size_ = 0;
		gint configured_variant_it = 0;
		configured_variant_collection = _tmp26_;
		configured_variant_collection_length1 = _tmp25_;
		for (configured_variant_it = 0; configured_variant_it < configured_variant_collection_length1; configured_variant_it = configured_variant_it + 1) {
			ProtonPlusModelsProvidersVariantDefinition* _tmp27_;
			ProtonPlusModelsProvidersVariantDefinition* configured_variant = NULL;
			_tmp27_ = _g_object_ref0 (configured_variant_collection[configured_variant_it]);
			configured_variant = _tmp27_;
			{
				GeeLinkedList* _tmp28_;
				ProtonPlusModelsProvidersVariantDefinition* _tmp29_;
				const gchar* _tmp30_;
				const gchar* _tmp31_;
				ProtonPlusModelsProvidersVariantDefinition* _tmp32_;
				const gchar* _tmp33_;
				const gchar* _tmp34_;
				ProtonPlusModelsProvidersVariantDefinition* _tmp35_;
				const gchar* _tmp36_;
				const gchar* _tmp37_;
				ProtonPlusModelsProvidersVariantDefinition* _tmp38_;
				gboolean _tmp39_;
				gboolean _tmp40_;
				ProtonPlusModelsProvidersVariantDefinition* _tmp41_;
				ProtonPlusModelsVariantCompatibility* _tmp42_;
				ProtonPlusModelsVariantCompatibility* _tmp43_;
				ProtonPlusModelsVariant* _tmp44_;
				ProtonPlusModelsVariant* _tmp45_;
				_tmp28_ = self->priv->_variants;
				_tmp29_ = configured_variant;
				_tmp30_ = proton_plus_models_providers_variant_definition_get_id (_tmp29_);
				_tmp31_ = _tmp30_;
				_tmp32_ = configured_variant;
				_tmp33_ = proton_plus_models_providers_variant_definition_get_name (_tmp32_);
				_tmp34_ = _tmp33_;
				_tmp35_ = configured_variant;
				_tmp36_ = proton_plus_models_providers_variant_definition_get_format (_tmp35_);
				_tmp37_ = _tmp36_;
				_tmp38_ = configured_variant;
				_tmp39_ = proton_plus_models_providers_variant_definition_get_is_default (_tmp38_);
				_tmp40_ = _tmp39_;
				_tmp41_ = configured_variant;
				_tmp42_ = proton_plus_models_providers_variant_definition_get_compatibility (_tmp41_);
				_tmp43_ = _tmp42_;
				_tmp44_ = proton_plus_models_variant_new (_tmp31_, _tmp34_, _tmp37_, _tmp40_, NULL, _tmp43_, NULL);
				_tmp45_ = _tmp44_;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp28_, _tmp45_);
				_g_object_unref0 (_tmp45_);
				_g_object_unref0 (configured_variant);
			}
		}
		configured_variant_collection = (_vala_array_free (configured_variant_collection, configured_variant_collection_length1, (GDestroyNotify) g_object_unref), NULL);
	}
	return self;
}

ProtonPlusModelsToolsProviderTool*
proton_plus_models_tools_provider_tool_new_with_catalog (ProtonPlusModelsProvidersProviderDefinition* definition,
                                                         ProtonPlusProvidersSourcesReleaseSource* release_source,
                                                         ProtonPlusModelsGroup* group,
                                                         ProtonPlusModelsProvidersInstallLayout* install_layout)
{
	return proton_plus_models_tools_provider_tool_construct_with_catalog (PROTON_PLUS_MODELS_TOOLS_TYPE_PROVIDER_TOOL, definition, release_source, group, install_layout);
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

gchar*
proton_plus_models_tools_provider_tool_get_directory_name (ProtonPlusModelsToolsProviderTool* self,
                                                           const gchar* release_name)
{
	ProtonPlusModelsProvidersInstallLayout* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (release_name != NULL, NULL);
	if (string_contains (release_name, "Latest")) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (release_name);
		result = _tmp0_;
		return result;
	}
	_tmp1_ = self->priv->_install_layout;
	_tmp2_ = proton_plus_models_tool_get_title ((ProtonPlusModelsTool*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = proton_plus_models_providers_install_layout_render (_tmp1_, _tmp3_, release_name);
	result = _tmp4_;
	return result;
}

ProtonPlusModelsToolsProviderTool*
proton_plus_models_tools_provider_tool_construct (GType object_type)
{
	ProtonPlusModelsToolsProviderTool * self = NULL;
	self = (ProtonPlusModelsToolsProviderTool*) proton_plus_models_tool_construct (object_type);
	return self;
}

ProtonPlusModelsToolsProviderTool*
proton_plus_models_tools_provider_tool_new (void)
{
	return proton_plus_models_tools_provider_tool_construct (PROTON_PLUS_MODELS_TOOLS_TYPE_PROVIDER_TOOL);
}

ProtonPlusModelsProvidersProviderDefinition*
proton_plus_models_tools_provider_tool_get_definition (ProtonPlusModelsToolsProviderTool* self)
{
	ProtonPlusModelsProvidersProviderDefinition* result;
	ProtonPlusModelsProvidersProviderDefinition* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_definition;
	result = _tmp0_;
	return result;
}

static void
proton_plus_models_tools_provider_tool_set_definition (ProtonPlusModelsToolsProviderTool* self,
                                                       ProtonPlusModelsProvidersProviderDefinition* value)
{
	ProtonPlusModelsProvidersProviderDefinition* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_tools_provider_tool_get_definition (self);
	if (old_value != value) {
		ProtonPlusModelsProvidersProviderDefinition* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_definition);
		self->priv->_definition = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_tools_provider_tool_properties[PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_DEFINITION_PROPERTY]);
	}
}

gchar*
proton_plus_models_tools_provider_tool_get_endpoint (ProtonPlusModelsToolsProviderTool* self)
{
	gchar* result;
	ProtonPlusModelsProvidersProviderDefinition* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_definition;
	_tmp1_ = proton_plus_models_providers_provider_definition_get_endpoint (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup (_tmp2_);
	result = _tmp3_;
	return result;
}

ProtonPlusModelsProvidersArchiveInstallRequirement
proton_plus_models_tools_provider_tool_get_archive_install_requirement (ProtonPlusModelsToolsProviderTool* self)
{
	ProtonPlusModelsProvidersArchiveInstallRequirement result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_archive_install_requirement;
	return result;
}

static void
proton_plus_models_tools_provider_tool_set_archive_install_requirement (ProtonPlusModelsToolsProviderTool* self,
                                                                        ProtonPlusModelsProvidersArchiveInstallRequirement value)
{
	ProtonPlusModelsProvidersArchiveInstallRequirement old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_tools_provider_tool_get_archive_install_requirement (self);
	if (old_value != value) {
		self->priv->_archive_install_requirement = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_tools_provider_tool_properties[PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_ARCHIVE_INSTALL_REQUIREMENT_PROPERTY]);
	}
}

ProtonPlusModelsProvidersInstallLayout*
proton_plus_models_tools_provider_tool_get_install_layout (ProtonPlusModelsToolsProviderTool* self)
{
	ProtonPlusModelsProvidersInstallLayout* result;
	ProtonPlusModelsProvidersInstallLayout* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_install_layout;
	result = _tmp0_;
	return result;
}

static void
proton_plus_models_tools_provider_tool_set_install_layout (ProtonPlusModelsToolsProviderTool* self,
                                                           ProtonPlusModelsProvidersInstallLayout* value)
{
	ProtonPlusModelsProvidersInstallLayout* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_tools_provider_tool_get_install_layout (self);
	if (old_value != value) {
		ProtonPlusModelsProvidersInstallLayout* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_install_layout);
		self->priv->_install_layout = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_tools_provider_tool_properties[PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_INSTALL_LAYOUT_PROPERTY]);
	}
}

gchar*
proton_plus_models_tools_provider_tool_get_tag (ProtonPlusModelsToolsProviderTool* self)
{
	gchar* result;
	ProtonPlusModelsProvidersProviderDefinition* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_definition;
	_tmp1_ = proton_plus_models_providers_provider_definition_get_tag (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup (_tmp2_);
	result = _tmp3_;
	return result;
}

GeeLinkedList*
proton_plus_models_tools_provider_tool_get_variants (ProtonPlusModelsToolsProviderTool* self)
{
	GeeLinkedList* result;
	GeeLinkedList* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_variants;
	result = _tmp0_;
	return result;
}

static void
proton_plus_models_tools_provider_tool_set_variants (ProtonPlusModelsToolsProviderTool* self,
                                                     GeeLinkedList* value)
{
	GeeLinkedList* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_tools_provider_tool_get_variants (self);
	if (old_value != value) {
		GeeLinkedList* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_variants);
		self->priv->_variants = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_tools_provider_tool_properties[PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_VARIANTS_PROPERTY]);
	}
}

static void
proton_plus_models_tools_provider_tool_class_init (ProtonPlusModelsToolsProviderToolClass * klass,
                                                   gpointer klass_data)
{
	proton_plus_models_tools_provider_tool_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusModelsToolsProviderTool_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_models_tools_provider_tool_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_models_tools_provider_tool_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_models_tools_provider_tool_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_DEFINITION_PROPERTY, proton_plus_models_tools_provider_tool_properties[PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_DEFINITION_PROPERTY] = g_param_spec_object ("definition", "definition", "definition", PROTON_PLUS_MODELS_PROVIDERS_TYPE_PROVIDER_DEFINITION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_ENDPOINT_PROPERTY, proton_plus_models_tools_provider_tool_properties[PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_ENDPOINT_PROPERTY] = g_param_spec_string ("endpoint", "endpoint", "endpoint", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_ARCHIVE_INSTALL_REQUIREMENT_PROPERTY, proton_plus_models_tools_provider_tool_properties[PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_ARCHIVE_INSTALL_REQUIREMENT_PROPERTY] = g_param_spec_enum ("archive-install-requirement", "archive-install-requirement", "archive-install-requirement", PROTON_PLUS_MODELS_PROVIDERS_TYPE_ARCHIVE_INSTALL_REQUIREMENT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_INSTALL_LAYOUT_PROPERTY, proton_plus_models_tools_provider_tool_properties[PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_INSTALL_LAYOUT_PROPERTY] = g_param_spec_object ("install-layout", "install-layout", "install-layout", PROTON_PLUS_MODELS_PROVIDERS_TYPE_INSTALL_LAYOUT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_TAG_PROPERTY, proton_plus_models_tools_provider_tool_properties[PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_TAG_PROPERTY] = g_param_spec_string ("tag", "tag", "tag", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_VARIANTS_PROPERTY, proton_plus_models_tools_provider_tool_properties[PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_VARIANTS_PROPERTY] = g_param_spec_object ("variants", "variants", "variants", GEE_TYPE_LINKED_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
proton_plus_models_tools_provider_tool_instance_init (ProtonPlusModelsToolsProviderTool * self,
                                                      gpointer klass)
{
	GeeLinkedList* _tmp0_;
	self->priv = proton_plus_models_tools_provider_tool_get_instance_private (self);
	_tmp0_ = gee_linked_list_new (PROTON_PLUS_MODELS_TYPE_VARIANT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->priv->_variants = _tmp0_;
}

static void
proton_plus_models_tools_provider_tool_finalize (GObject * obj)
{
	ProtonPlusModelsToolsProviderTool * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_MODELS_TOOLS_TYPE_PROVIDER_TOOL, ProtonPlusModelsToolsProviderTool);
	_g_object_unref0 (self->priv->_definition);
	_g_object_unref0 (self->priv->_install_layout);
	_g_object_unref0 (self->priv->_variants);
	G_OBJECT_CLASS (proton_plus_models_tools_provider_tool_parent_class)->finalize (obj);
}

static GType
proton_plus_models_tools_provider_tool_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusModelsToolsProviderToolClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_models_tools_provider_tool_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusModelsToolsProviderTool), 0, (GInstanceInitFunc) proton_plus_models_tools_provider_tool_instance_init, NULL };
	GType proton_plus_models_tools_provider_tool_type_id;
	proton_plus_models_tools_provider_tool_type_id = g_type_register_static (PROTON_PLUS_MODELS_TYPE_TOOL, "ProtonPlusModelsToolsProviderTool", &g_define_type_info, 0);
	ProtonPlusModelsToolsProviderTool_private_offset = g_type_add_instance_private (proton_plus_models_tools_provider_tool_type_id, sizeof (ProtonPlusModelsToolsProviderToolPrivate));
	return proton_plus_models_tools_provider_tool_type_id;
}

GType
proton_plus_models_tools_provider_tool_get_type (void)
{
	static volatile gsize proton_plus_models_tools_provider_tool_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_models_tools_provider_tool_type_id__once)) {
		GType proton_plus_models_tools_provider_tool_type_id;
		proton_plus_models_tools_provider_tool_type_id = proton_plus_models_tools_provider_tool_get_type_once ();
		g_once_init_leave (&proton_plus_models_tools_provider_tool_type_id__once, proton_plus_models_tools_provider_tool_type_id);
	}
	return proton_plus_models_tools_provider_tool_type_id__once;
}

static void
_vala_proton_plus_models_tools_provider_tool_get_property (GObject * object,
                                                           guint property_id,
                                                           GValue * value,
                                                           GParamSpec * pspec)
{
	ProtonPlusModelsToolsProviderTool * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_MODELS_TOOLS_TYPE_PROVIDER_TOOL, ProtonPlusModelsToolsProviderTool);
	switch (property_id) {
		case PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_DEFINITION_PROPERTY:
		g_value_set_object (value, proton_plus_models_tools_provider_tool_get_definition (self));
		break;
		case PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_ENDPOINT_PROPERTY:
		g_value_take_string (value, proton_plus_models_tools_provider_tool_get_endpoint (self));
		break;
		case PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_ARCHIVE_INSTALL_REQUIREMENT_PROPERTY:
		g_value_set_enum (value, proton_plus_models_tools_provider_tool_get_archive_install_requirement (self));
		break;
		case PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_INSTALL_LAYOUT_PROPERTY:
		g_value_set_object (value, proton_plus_models_tools_provider_tool_get_install_layout (self));
		break;
		case PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_TAG_PROPERTY:
		g_value_take_string (value, proton_plus_models_tools_provider_tool_get_tag (self));
		break;
		case PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_VARIANTS_PROPERTY:
		g_value_set_object (value, proton_plus_models_tools_provider_tool_get_variants (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_models_tools_provider_tool_set_property (GObject * object,
                                                           guint property_id,
                                                           const GValue * value,
                                                           GParamSpec * pspec)
{
	ProtonPlusModelsToolsProviderTool * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_MODELS_TOOLS_TYPE_PROVIDER_TOOL, ProtonPlusModelsToolsProviderTool);
	switch (property_id) {
		case PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_DEFINITION_PROPERTY:
		proton_plus_models_tools_provider_tool_set_definition (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_ARCHIVE_INSTALL_REQUIREMENT_PROPERTY:
		proton_plus_models_tools_provider_tool_set_archive_install_requirement (self, g_value_get_enum (value));
		break;
		case PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_INSTALL_LAYOUT_PROPERTY:
		proton_plus_models_tools_provider_tool_set_install_layout (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_MODELS_TOOLS_PROVIDER_TOOL_VARIANTS_PROPERTY:
		proton_plus_models_tools_provider_tool_set_variants (self, g_value_get_object (value));
		break;
		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;
}

