/* tool.c generated by valac 0.56.19, the Vala compiler
 * generated from tool.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_TOOL_0_PROPERTY,
	PROTON_PLUS_MODELS_TOOL_ID_PROPERTY,
	PROTON_PLUS_MODELS_TOOL_PROVIDER_ID_PROPERTY,
	PROTON_PLUS_MODELS_TOOL_SOURCE_ID_PROPERTY,
	PROTON_PLUS_MODELS_TOOL_TITLE_PROPERTY,
	PROTON_PLUS_MODELS_TOOL_DESCRIPTION_PROPERTY,
	PROTON_PLUS_MODELS_TOOL_REPOSITORY_URL_PROPERTY,
	PROTON_PLUS_MODELS_TOOL_GROUP_PROPERTY,
	PROTON_PLUS_MODELS_TOOL_LEGACY_PROPERTY,
	PROTON_PLUS_MODELS_TOOL_SORT_PRIORITY_PROPERTY,
	PROTON_PLUS_MODELS_TOOL_INSTALLED_PROPERTY,
	PROTON_PLUS_MODELS_TOOL_USED_PROPERTY,
	PROTON_PLUS_MODELS_TOOL_RESOLVED_INSTALLED_ENTRY_PROPERTY,
	PROTON_PLUS_MODELS_TOOL_RESOLVED_USAGE_IDENTIFIER_PROPERTY,
	PROTON_PLUS_MODELS_TOOL_RELEASE_CATALOG_PROPERTY,
	PROTON_PLUS_MODELS_TOOL_LAST_VERSION_PROPERTY,
	PROTON_PLUS_MODELS_TOOL_NUM_PROPERTIES
};
static GParamSpec* proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_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 _ProtonPlusModelsToolPrivate {
	gchar* _id;
	gchar* _provider_id;
	gchar* _source_id;
	gchar* _title;
	gchar* _description;
	gchar* _repository_url;
	ProtonPlusModelsGroup* _group;
	gboolean _legacy;
	gint _sort_priority;
	gboolean _installed;
	gboolean _used;
	ProtonPlusModelsInstalledToolEntry* _resolved_installed_entry;
	gchar* _resolved_usage_identifier;
	ProtonPlusModelsReleaseCatalog* _release_catalog;
};

static gint ProtonPlusModelsTool_private_offset;
static gpointer proton_plus_models_tool_parent_class = NULL;

VALA_EXTERN void proton_plus_models_tool_set_identity (ProtonPlusModelsTool* self,
                                           const gchar* provider_id,
                                           const gchar* source_id);
VALA_EXTERN void proton_plus_models_tool_set_provider_id (ProtonPlusModelsTool* self,
                                              const gchar* value);
VALA_EXTERN void proton_plus_models_tool_set_source_id (ProtonPlusModelsTool* self,
                                            const gchar* value);
VALA_EXTERN void proton_plus_models_tool_set_id (ProtonPlusModelsTool* self,
                                     const gchar* value);
static void proton_plus_models_tool_set_release_catalog (ProtonPlusModelsTool* self,
                                                  ProtonPlusModelsReleaseCatalog* value);
VALA_EXTERN void proton_plus_models_tool_set_resolved_installation_state (ProtonPlusModelsTool* self,
                                                              ProtonPlusModelsInstalledToolEntry* entry,
                                                              const gchar* usage_identifier,
                                                              gboolean is_used);
static void proton_plus_models_tool_set_resolved_installed_entry (ProtonPlusModelsTool* self,
                                                           ProtonPlusModelsInstalledToolEntry* value);
static void proton_plus_models_tool_set_resolved_usage_identifier (ProtonPlusModelsTool* self,
                                                            const gchar* value);
static void proton_plus_models_tool_set_installed (ProtonPlusModelsTool* self,
                                            gboolean value);
static void proton_plus_models_tool_set_used (ProtonPlusModelsTool* self,
                                       gboolean value);
VALA_EXTERN const gchar* proton_plus_models_tool_get_resolved_usage_identifier (ProtonPlusModelsTool* self);
static void proton_plus_models_tool_finalize (GObject * obj);
static GType proton_plus_models_tool_get_type_once (void);
static void _vala_proton_plus_models_tool_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_proton_plus_models_tool_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_tool_get_instance_private (ProtonPlusModelsTool* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusModelsTool_private_offset);
}

void
proton_plus_models_tool_set_identity (ProtonPlusModelsTool* self,
                                      const gchar* provider_id,
                                      const gchar* source_id)
{
	ProtonPlusModelsGroup* _tmp0_;
	ProtonPlusModelsLauncher* _tmp1_;
	ProtonPlusModelsLauncher* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	ProtonPlusModelsGroup* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (provider_id != NULL);
	g_return_if_fail (source_id != NULL);
	proton_plus_models_tool_set_provider_id (self, provider_id);
	proton_plus_models_tool_set_source_id (self, source_id);
	_tmp0_ = self->priv->_group;
	_tmp1_ = proton_plus_models_group_get_launcher (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = proton_plus_models_launcher_get_tool_target_id (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->_group;
	_tmp6_ = proton_plus_models_group_get_id (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = g_strdup_printf ("%s/%s/%s", _tmp4_, _tmp7_, provider_id);
	_tmp9_ = _tmp8_;
	proton_plus_models_tool_set_id (self, _tmp9_);
	_g_free0 (_tmp9_);
}

void
proton_plus_models_tool_initialize_release_catalog (ProtonPlusModelsTool* self,
                                                    ProtonPlusModelsReleaseCatalog* catalog)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (catalog != NULL);
	proton_plus_models_tool_set_release_catalog (self, catalog);
}

gboolean
proton_plus_models_tool_is_installed (ProtonPlusModelsTool* self)
{
	gboolean _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_installed;
	result = _tmp0_;
	return result;
}

gboolean
proton_plus_models_tool_is_used (ProtonPlusModelsTool* self)
{
	gboolean _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_used;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_tool_set_resolved_installation_state (ProtonPlusModelsTool* self,
                                                         ProtonPlusModelsInstalledToolEntry* entry,
                                                         const gchar* usage_identifier,
                                                         gboolean is_used)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	proton_plus_models_tool_set_resolved_installed_entry (self, entry);
	proton_plus_models_tool_set_resolved_usage_identifier (self, usage_identifier);
	proton_plus_models_tool_set_installed (self, entry != NULL);
	_tmp1_ = self->priv->_installed;
	if (_tmp1_) {
		_tmp0_ = is_used;
	} else {
		_tmp0_ = FALSE;
	}
	proton_plus_models_tool_set_used (self, _tmp0_);
}

ProtonPlusModelsTool*
proton_plus_models_tool_construct (GType object_type)
{
	ProtonPlusModelsTool * self = NULL;
	self = (ProtonPlusModelsTool*) g_object_new (object_type, NULL);
	return self;
}

const gchar*
proton_plus_models_tool_get_id (ProtonPlusModelsTool* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_id;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_tool_set_id (ProtonPlusModelsTool* self,
                                const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_tool_get_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_id);
		self->priv->_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_ID_PROPERTY]);
	}
}

const gchar*
proton_plus_models_tool_get_provider_id (ProtonPlusModelsTool* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_provider_id;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_tool_set_provider_id (ProtonPlusModelsTool* self,
                                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_tool_get_provider_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_provider_id);
		self->priv->_provider_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_PROVIDER_ID_PROPERTY]);
	}
}

const gchar*
proton_plus_models_tool_get_source_id (ProtonPlusModelsTool* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_source_id;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_tool_set_source_id (ProtonPlusModelsTool* self,
                                       const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_tool_get_source_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_source_id);
		self->priv->_source_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_SOURCE_ID_PROPERTY]);
	}
}

const gchar*
proton_plus_models_tool_get_title (ProtonPlusModelsTool* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_title;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_tool_set_title (ProtonPlusModelsTool* self,
                                   const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_tool_get_title (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_title);
		self->priv->_title = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_TITLE_PROPERTY]);
	}
}

const gchar*
proton_plus_models_tool_get_description (ProtonPlusModelsTool* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_description;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_tool_set_description (ProtonPlusModelsTool* self,
                                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_tool_get_description (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_description);
		self->priv->_description = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_DESCRIPTION_PROPERTY]);
	}
}

const gchar*
proton_plus_models_tool_get_repository_url (ProtonPlusModelsTool* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_repository_url;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_tool_set_repository_url (ProtonPlusModelsTool* self,
                                            const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_tool_get_repository_url (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_repository_url);
		self->priv->_repository_url = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_REPOSITORY_URL_PROPERTY]);
	}
}

ProtonPlusModelsGroup*
proton_plus_models_tool_get_group (ProtonPlusModelsTool* self)
{
	ProtonPlusModelsGroup* result;
	ProtonPlusModelsGroup* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_group;
	result = _tmp0_;
	return result;
}

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

void
proton_plus_models_tool_set_group (ProtonPlusModelsTool* self,
                                   ProtonPlusModelsGroup* value)
{
	ProtonPlusModelsGroup* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_tool_get_group (self);
	if (old_value != value) {
		ProtonPlusModelsGroup* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_group);
		self->priv->_group = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_GROUP_PROPERTY]);
	}
}

gboolean
proton_plus_models_tool_get_legacy (ProtonPlusModelsTool* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_legacy;
	return result;
}

void
proton_plus_models_tool_set_legacy (ProtonPlusModelsTool* self,
                                    gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_tool_get_legacy (self);
	if (old_value != value) {
		self->priv->_legacy = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_LEGACY_PROPERTY]);
	}
}

gint
proton_plus_models_tool_get_sort_priority (ProtonPlusModelsTool* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_sort_priority;
	return result;
}

void
proton_plus_models_tool_set_sort_priority (ProtonPlusModelsTool* self,
                                           gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_tool_get_sort_priority (self);
	if (old_value != value) {
		self->priv->_sort_priority = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_SORT_PRIORITY_PROPERTY]);
	}
}

gboolean
proton_plus_models_tool_get_installed (ProtonPlusModelsTool* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_installed;
	return result;
}

static void
proton_plus_models_tool_set_installed (ProtonPlusModelsTool* self,
                                       gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_tool_get_installed (self);
	if (old_value != value) {
		self->priv->_installed = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_INSTALLED_PROPERTY]);
	}
}

gboolean
proton_plus_models_tool_get_used (ProtonPlusModelsTool* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_used;
	return result;
}

static void
proton_plus_models_tool_set_used (ProtonPlusModelsTool* self,
                                  gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_tool_get_used (self);
	if (old_value != value) {
		self->priv->_used = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_USED_PROPERTY]);
	}
}

ProtonPlusModelsInstalledToolEntry*
proton_plus_models_tool_get_resolved_installed_entry (ProtonPlusModelsTool* self)
{
	ProtonPlusModelsInstalledToolEntry* result;
	ProtonPlusModelsInstalledToolEntry* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_resolved_installed_entry;
	result = _tmp0_;
	return result;
}

static void
proton_plus_models_tool_set_resolved_installed_entry (ProtonPlusModelsTool* self,
                                                      ProtonPlusModelsInstalledToolEntry* value)
{
	ProtonPlusModelsInstalledToolEntry* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_tool_get_resolved_installed_entry (self);
	if (old_value != value) {
		ProtonPlusModelsInstalledToolEntry* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_resolved_installed_entry);
		self->priv->_resolved_installed_entry = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_RESOLVED_INSTALLED_ENTRY_PROPERTY]);
	}
}

const gchar*
proton_plus_models_tool_get_resolved_usage_identifier (ProtonPlusModelsTool* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_resolved_usage_identifier;
	result = _tmp0_;
	return result;
}

static void
proton_plus_models_tool_set_resolved_usage_identifier (ProtonPlusModelsTool* self,
                                                       const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_tool_get_resolved_usage_identifier (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_resolved_usage_identifier);
		self->priv->_resolved_usage_identifier = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_RESOLVED_USAGE_IDENTIFIER_PROPERTY]);
	}
}

ProtonPlusModelsReleaseCatalog*
proton_plus_models_tool_get_release_catalog (ProtonPlusModelsTool* self)
{
	ProtonPlusModelsReleaseCatalog* result;
	ProtonPlusModelsReleaseCatalog* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_release_catalog;
	result = _tmp0_;
	return result;
}

static void
proton_plus_models_tool_set_release_catalog (ProtonPlusModelsTool* self,
                                             ProtonPlusModelsReleaseCatalog* value)
{
	ProtonPlusModelsReleaseCatalog* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_tool_get_release_catalog (self);
	if (old_value != value) {
		ProtonPlusModelsReleaseCatalog* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_release_catalog);
		self->priv->_release_catalog = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_RELEASE_CATALOG_PROPERTY]);
	}
}

gchar*
proton_plus_models_tool_get_last_version (ProtonPlusModelsTool* self)
{
	gchar* result;
	gchar* _tmp0_ = NULL;
	ProtonPlusModelsReleaseCatalog* _tmp1_;
	gchar* _tmp6_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->_release_catalog;
	if (_tmp1_ != NULL) {
		ProtonPlusModelsReleaseCatalog* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp2_ = self->priv->_release_catalog;
		_tmp3_ = proton_plus_models_release_catalog_get_last_version (_tmp2_);
		_tmp4_ = _tmp3_;
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp4_;
	} else {
		gchar* _tmp5_;
		_tmp5_ = g_strdup ("");
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp5_;
	}
	_tmp6_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp6_;
	_g_free0 (_tmp0_);
	return result;
}

static void
proton_plus_models_tool_class_init (ProtonPlusModelsToolClass * klass,
                                    gpointer klass_data)
{
	proton_plus_models_tool_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusModelsTool_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_models_tool_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_models_tool_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_models_tool_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOL_ID_PROPERTY, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOL_PROVIDER_ID_PROPERTY, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_PROVIDER_ID_PROPERTY] = g_param_spec_string ("provider-id", "provider-id", "provider-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOL_SOURCE_ID_PROPERTY, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_SOURCE_ID_PROPERTY] = g_param_spec_string ("source-id", "source-id", "source-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOL_TITLE_PROPERTY, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_TITLE_PROPERTY] = g_param_spec_string ("title", "title", "title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOL_DESCRIPTION_PROPERTY, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_DESCRIPTION_PROPERTY] = g_param_spec_string ("description", "description", "description", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOL_REPOSITORY_URL_PROPERTY, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_REPOSITORY_URL_PROPERTY] = g_param_spec_string ("repository-url", "repository-url", "repository-url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOL_GROUP_PROPERTY, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_GROUP_PROPERTY] = g_param_spec_object ("group", "group", "group", PROTON_PLUS_MODELS_TYPE_GROUP, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOL_LEGACY_PROPERTY, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_LEGACY_PROPERTY] = g_param_spec_boolean ("legacy", "legacy", "legacy", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOL_SORT_PRIORITY_PROPERTY, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_SORT_PRIORITY_PROPERTY] = g_param_spec_int ("sort-priority", "sort-priority", "sort-priority", G_MININT, G_MAXINT, 1000, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOL_INSTALLED_PROPERTY, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_INSTALLED_PROPERTY] = g_param_spec_boolean ("installed", "installed", "installed", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOL_USED_PROPERTY, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_USED_PROPERTY] = g_param_spec_boolean ("used", "used", "used", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOL_RESOLVED_INSTALLED_ENTRY_PROPERTY, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_RESOLVED_INSTALLED_ENTRY_PROPERTY] = g_param_spec_object ("resolved-installed-entry", "resolved-installed-entry", "resolved-installed-entry", PROTON_PLUS_MODELS_TYPE_INSTALLED_TOOL_ENTRY, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOL_RESOLVED_USAGE_IDENTIFIER_PROPERTY, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_RESOLVED_USAGE_IDENTIFIER_PROPERTY] = g_param_spec_string ("resolved-usage-identifier", "resolved-usage-identifier", "resolved-usage-identifier", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOL_RELEASE_CATALOG_PROPERTY, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_RELEASE_CATALOG_PROPERTY] = g_param_spec_object ("release-catalog", "release-catalog", "release-catalog", PROTON_PLUS_MODELS_TYPE_RELEASE_CATALOG, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_TOOL_LAST_VERSION_PROPERTY, proton_plus_models_tool_properties[PROTON_PLUS_MODELS_TOOL_LAST_VERSION_PROPERTY] = g_param_spec_string ("last-version", "last-version", "last-version", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
proton_plus_models_tool_instance_init (ProtonPlusModelsTool * self,
                                       gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	self->priv = proton_plus_models_tool_get_instance_private (self);
	_tmp0_ = g_strdup ("");
	self->priv->_id = _tmp0_;
	_tmp1_ = g_strdup ("");
	self->priv->_provider_id = _tmp1_;
	_tmp2_ = g_strdup ("");
	self->priv->_source_id = _tmp2_;
	_tmp3_ = g_strdup ("");
	self->priv->_repository_url = _tmp3_;
	self->priv->_sort_priority = 1000;
	self->priv->_installed = FALSE;
	self->priv->_used = FALSE;
	self->priv->_resolved_installed_entry = NULL;
	self->priv->_resolved_usage_identifier = NULL;
	self->priv->_release_catalog = NULL;
}

static void
proton_plus_models_tool_finalize (GObject * obj)
{
	ProtonPlusModelsTool * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_MODELS_TYPE_TOOL, ProtonPlusModelsTool);
	_g_free0 (self->priv->_id);
	_g_free0 (self->priv->_provider_id);
	_g_free0 (self->priv->_source_id);
	_g_free0 (self->priv->_title);
	_g_free0 (self->priv->_description);
	_g_free0 (self->priv->_repository_url);
	_g_object_unref0 (self->priv->_group);
	_g_object_unref0 (self->priv->_resolved_installed_entry);
	_g_free0 (self->priv->_resolved_usage_identifier);
	_g_object_unref0 (self->priv->_release_catalog);
	G_OBJECT_CLASS (proton_plus_models_tool_parent_class)->finalize (obj);
}

static GType
proton_plus_models_tool_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusModelsToolClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_models_tool_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusModelsTool), 0, (GInstanceInitFunc) proton_plus_models_tool_instance_init, NULL };
	GType proton_plus_models_tool_type_id;
	proton_plus_models_tool_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusModelsTool", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	ProtonPlusModelsTool_private_offset = g_type_add_instance_private (proton_plus_models_tool_type_id, sizeof (ProtonPlusModelsToolPrivate));
	return proton_plus_models_tool_type_id;
}

GType
proton_plus_models_tool_get_type (void)
{
	static volatile gsize proton_plus_models_tool_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_models_tool_type_id__once)) {
		GType proton_plus_models_tool_type_id;
		proton_plus_models_tool_type_id = proton_plus_models_tool_get_type_once ();
		g_once_init_leave (&proton_plus_models_tool_type_id__once, proton_plus_models_tool_type_id);
	}
	return proton_plus_models_tool_type_id__once;
}

static void
_vala_proton_plus_models_tool_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	ProtonPlusModelsTool * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_MODELS_TYPE_TOOL, ProtonPlusModelsTool);
	switch (property_id) {
		case PROTON_PLUS_MODELS_TOOL_ID_PROPERTY:
		g_value_set_string (value, proton_plus_models_tool_get_id (self));
		break;
		case PROTON_PLUS_MODELS_TOOL_PROVIDER_ID_PROPERTY:
		g_value_set_string (value, proton_plus_models_tool_get_provider_id (self));
		break;
		case PROTON_PLUS_MODELS_TOOL_SOURCE_ID_PROPERTY:
		g_value_set_string (value, proton_plus_models_tool_get_source_id (self));
		break;
		case PROTON_PLUS_MODELS_TOOL_TITLE_PROPERTY:
		g_value_set_string (value, proton_plus_models_tool_get_title (self));
		break;
		case PROTON_PLUS_MODELS_TOOL_DESCRIPTION_PROPERTY:
		g_value_set_string (value, proton_plus_models_tool_get_description (self));
		break;
		case PROTON_PLUS_MODELS_TOOL_REPOSITORY_URL_PROPERTY:
		g_value_set_string (value, proton_plus_models_tool_get_repository_url (self));
		break;
		case PROTON_PLUS_MODELS_TOOL_GROUP_PROPERTY:
		g_value_set_object (value, proton_plus_models_tool_get_group (self));
		break;
		case PROTON_PLUS_MODELS_TOOL_LEGACY_PROPERTY:
		g_value_set_boolean (value, proton_plus_models_tool_get_legacy (self));
		break;
		case PROTON_PLUS_MODELS_TOOL_SORT_PRIORITY_PROPERTY:
		g_value_set_int (value, proton_plus_models_tool_get_sort_priority (self));
		break;
		case PROTON_PLUS_MODELS_TOOL_INSTALLED_PROPERTY:
		g_value_set_boolean (value, proton_plus_models_tool_get_installed (self));
		break;
		case PROTON_PLUS_MODELS_TOOL_USED_PROPERTY:
		g_value_set_boolean (value, proton_plus_models_tool_get_used (self));
		break;
		case PROTON_PLUS_MODELS_TOOL_RESOLVED_INSTALLED_ENTRY_PROPERTY:
		g_value_set_object (value, proton_plus_models_tool_get_resolved_installed_entry (self));
		break;
		case PROTON_PLUS_MODELS_TOOL_RESOLVED_USAGE_IDENTIFIER_PROPERTY:
		g_value_set_string (value, proton_plus_models_tool_get_resolved_usage_identifier (self));
		break;
		case PROTON_PLUS_MODELS_TOOL_RELEASE_CATALOG_PROPERTY:
		g_value_set_object (value, proton_plus_models_tool_get_release_catalog (self));
		break;
		case PROTON_PLUS_MODELS_TOOL_LAST_VERSION_PROPERTY:
		g_value_take_string (value, proton_plus_models_tool_get_last_version (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_models_tool_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	ProtonPlusModelsTool * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_MODELS_TYPE_TOOL, ProtonPlusModelsTool);
	switch (property_id) {
		case PROTON_PLUS_MODELS_TOOL_ID_PROPERTY:
		proton_plus_models_tool_set_id (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_TOOL_PROVIDER_ID_PROPERTY:
		proton_plus_models_tool_set_provider_id (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_TOOL_SOURCE_ID_PROPERTY:
		proton_plus_models_tool_set_source_id (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_TOOL_TITLE_PROPERTY:
		proton_plus_models_tool_set_title (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_TOOL_DESCRIPTION_PROPERTY:
		proton_plus_models_tool_set_description (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_TOOL_REPOSITORY_URL_PROPERTY:
		proton_plus_models_tool_set_repository_url (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_TOOL_GROUP_PROPERTY:
		proton_plus_models_tool_set_group (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_MODELS_TOOL_LEGACY_PROPERTY:
		proton_plus_models_tool_set_legacy (self, g_value_get_boolean (value));
		break;
		case PROTON_PLUS_MODELS_TOOL_SORT_PRIORITY_PROPERTY:
		proton_plus_models_tool_set_sort_priority (self, g_value_get_int (value));
		break;
		case PROTON_PLUS_MODELS_TOOL_INSTALLED_PROPERTY:
		proton_plus_models_tool_set_installed (self, g_value_get_boolean (value));
		break;
		case PROTON_PLUS_MODELS_TOOL_USED_PROPERTY:
		proton_plus_models_tool_set_used (self, g_value_get_boolean (value));
		break;
		case PROTON_PLUS_MODELS_TOOL_RESOLVED_INSTALLED_ENTRY_PROPERTY:
		proton_plus_models_tool_set_resolved_installed_entry (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_MODELS_TOOL_RESOLVED_USAGE_IDENTIFIER_PROPERTY:
		proton_plus_models_tool_set_resolved_usage_identifier (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_TOOL_RELEASE_CATALOG_PROPERTY:
		proton_plus_models_tool_set_release_catalog (self, g_value_get_object (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;
}

