/* ToolPlugin.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from ToolPlugin.vala, do not modify */

/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 2 -*-
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 * SPDX-FileCopyrightText: Michael Terry
 */

#include "deja.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  {
	DEJA_DUP_TOOL_PLUGIN_0_PROPERTY,
	DEJA_DUP_TOOL_PLUGIN_NAME_PROPERTY,
	DEJA_DUP_TOOL_PLUGIN_NUM_PROPERTIES
};
static GParamSpec* deja_dup_tool_plugin_properties[DEJA_DUP_TOOL_PLUGIN_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

struct _DejaDupToolPluginPrivate {
	gchar* _name;
};

static gint DejaDupToolPlugin_private_offset;
static gpointer deja_dup_tool_plugin_parent_class = NULL;

static gchar* deja_dup_tool_plugin_real_get_version (DejaDupToolPlugin* self,
                                              GError** error);
static gchar** deja_dup_tool_plugin_real_get_dependencies (DejaDupToolPlugin* self,
                                                    gint* result_length1);
static gboolean deja_dup_tool_plugin_real_needs_dependencies (DejaDupToolPlugin* self);
static DejaDupToolJob* deja_dup_tool_plugin_real_create_job (DejaDupToolPlugin* self,
                                                      GError** error);
static gboolean deja_dup_tool_plugin_real_supports_backend (DejaDupToolPlugin* self,
                                                     DejaDupBackendKind kind,
                                                     gchar** explanation);
static gboolean deja_dup_tool_plugin_real_supports_mount (DejaDupToolPlugin* self);
static void deja_dup_tool_plugin_finalize (GObject * obj);
static GType deja_dup_tool_plugin_get_type_once (void);
static void _vala_deja_dup_tool_plugin_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec);
static void _vala_deja_dup_tool_plugin_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec);

static inline gpointer
deja_dup_tool_plugin_get_instance_private (DejaDupToolPlugin* self)
{
	return G_STRUCT_MEMBER_P (self, DejaDupToolPlugin_private_offset);
}

static gchar*
deja_dup_tool_plugin_real_get_version (DejaDupToolPlugin* self,
                                       GError** error)
{
	g_critical ("Type `%s' does not implement abstract method `deja_dup_tool_plugin_get_version'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

gchar*
deja_dup_tool_plugin_get_version (DejaDupToolPlugin* self,
                                  GError** error)
{
	DejaDupToolPluginClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = DEJA_DUP_TOOL_PLUGIN_GET_CLASS (self);
	if (_klass_->get_version) {
		return _klass_->get_version (self, error);
	}
	return NULL;
}

static gchar**
deja_dup_tool_plugin_real_get_dependencies (DejaDupToolPlugin* self,
                                            gint* result_length1)
{
	gchar** _tmp0_;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gchar** result;
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	_tmp1_ = _tmp0_;
	_tmp1__length1 = 0;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}

gchar**
deja_dup_tool_plugin_get_dependencies (DejaDupToolPlugin* self,
                                       gint* result_length1)
{
	DejaDupToolPluginClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = DEJA_DUP_TOOL_PLUGIN_GET_CLASS (self);
	if (_klass_->get_dependencies) {
		return _klass_->get_dependencies (self, result_length1);
	}
	return NULL;
}

static gboolean
deja_dup_tool_plugin_real_needs_dependencies (DejaDupToolPlugin* self)
{
	gboolean result;
	result = TRUE;
	return result;
}

gboolean
deja_dup_tool_plugin_needs_dependencies (DejaDupToolPlugin* self)
{
	DejaDupToolPluginClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = DEJA_DUP_TOOL_PLUGIN_GET_CLASS (self);
	if (_klass_->needs_dependencies) {
		return _klass_->needs_dependencies (self);
	}
	return FALSE;
}

static DejaDupToolJob*
deja_dup_tool_plugin_real_create_job (DejaDupToolPlugin* self,
                                      GError** error)
{
	g_critical ("Type `%s' does not implement abstract method `deja_dup_tool_plugin_create_job'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

DejaDupToolJob*
deja_dup_tool_plugin_create_job (DejaDupToolPlugin* self,
                                 GError** error)
{
	DejaDupToolPluginClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = DEJA_DUP_TOOL_PLUGIN_GET_CLASS (self);
	if (_klass_->create_job) {
		return _klass_->create_job (self, error);
	}
	return NULL;
}

static gboolean
deja_dup_tool_plugin_real_supports_backend (DejaDupToolPlugin* self,
                                            DejaDupBackendKind kind,
                                            gchar** explanation)
{
	gboolean _tmp0_ = FALSE;
	g_critical ("Type `%s' does not implement abstract method `deja_dup_tool_plugin_supports_backend'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return _tmp0_;
}

gboolean
deja_dup_tool_plugin_supports_backend (DejaDupToolPlugin* self,
                                       DejaDupBackendKind kind,
                                       gchar** explanation)
{
	DejaDupToolPluginClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = DEJA_DUP_TOOL_PLUGIN_GET_CLASS (self);
	if (_klass_->supports_backend) {
		return _klass_->supports_backend (self, kind, explanation);
	}
	return FALSE;
}

static gboolean
deja_dup_tool_plugin_real_supports_mount (DejaDupToolPlugin* self)
{
	gboolean result;
	result = FALSE;
	return result;
}

gboolean
deja_dup_tool_plugin_supports_mount (DejaDupToolPlugin* self)
{
	DejaDupToolPluginClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = DEJA_DUP_TOOL_PLUGIN_GET_CLASS (self);
	if (_klass_->supports_mount) {
		return _klass_->supports_mount (self);
	}
	return FALSE;
}

DejaDupToolPlugin*
deja_dup_tool_plugin_construct (GType object_type)
{
	DejaDupToolPlugin * self = NULL;
	self = (DejaDupToolPlugin*) g_object_new (object_type, NULL);
	return self;
}

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

void
deja_dup_tool_plugin_set_name (DejaDupToolPlugin* self,
                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = deja_dup_tool_plugin_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, deja_dup_tool_plugin_properties[DEJA_DUP_TOOL_PLUGIN_NAME_PROPERTY]);
	}
}

static void
deja_dup_tool_plugin_class_init (DejaDupToolPluginClass * klass,
                                 gpointer klass_data)
{
	deja_dup_tool_plugin_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DejaDupToolPlugin_private_offset);
	((DejaDupToolPluginClass *) klass)->get_version = (gchar* (*) (DejaDupToolPlugin*, GError**)) deja_dup_tool_plugin_real_get_version;
	((DejaDupToolPluginClass *) klass)->get_dependencies = (gchar** (*) (DejaDupToolPlugin*, gint*)) deja_dup_tool_plugin_real_get_dependencies;
	((DejaDupToolPluginClass *) klass)->needs_dependencies = (gboolean (*) (DejaDupToolPlugin*)) deja_dup_tool_plugin_real_needs_dependencies;
	((DejaDupToolPluginClass *) klass)->create_job = (DejaDupToolJob* (*) (DejaDupToolPlugin*, GError**)) deja_dup_tool_plugin_real_create_job;
	((DejaDupToolPluginClass *) klass)->supports_backend = (gboolean (*) (DejaDupToolPlugin*, DejaDupBackendKind, gchar**)) deja_dup_tool_plugin_real_supports_backend;
	((DejaDupToolPluginClass *) klass)->supports_mount = (gboolean (*) (DejaDupToolPlugin*)) deja_dup_tool_plugin_real_supports_mount;
	G_OBJECT_CLASS (klass)->get_property = _vala_deja_dup_tool_plugin_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_deja_dup_tool_plugin_set_property;
	G_OBJECT_CLASS (klass)->finalize = deja_dup_tool_plugin_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DEJA_DUP_TOOL_PLUGIN_NAME_PROPERTY, deja_dup_tool_plugin_properties[DEJA_DUP_TOOL_PLUGIN_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
deja_dup_tool_plugin_instance_init (DejaDupToolPlugin * self,
                                    gpointer klass)
{
	self->priv = deja_dup_tool_plugin_get_instance_private (self);
}

static void
deja_dup_tool_plugin_finalize (GObject * obj)
{
	DejaDupToolPlugin * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DEJA_DUP_TYPE_TOOL_PLUGIN, DejaDupToolPlugin);
	_g_free0 (self->priv->_name);
	G_OBJECT_CLASS (deja_dup_tool_plugin_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
deja_dup_tool_plugin_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DejaDupToolPluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) deja_dup_tool_plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DejaDupToolPlugin), 0, (GInstanceInitFunc) deja_dup_tool_plugin_instance_init, NULL };
	GType deja_dup_tool_plugin_type_id;
	deja_dup_tool_plugin_type_id = g_type_register_static (G_TYPE_OBJECT, "DejaDupToolPlugin", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	DejaDupToolPlugin_private_offset = g_type_add_instance_private (deja_dup_tool_plugin_type_id, sizeof (DejaDupToolPluginPrivate));
	return deja_dup_tool_plugin_type_id;
}

GType
deja_dup_tool_plugin_get_type (void)
{
	static gsize deja_dup_tool_plugin_type_id__once = 0;
	if (g_once_init_enter (&deja_dup_tool_plugin_type_id__once)) {
		GType deja_dup_tool_plugin_type_id;
		deja_dup_tool_plugin_type_id = deja_dup_tool_plugin_get_type_once ();
		g_once_init_leave (&deja_dup_tool_plugin_type_id__once, deja_dup_tool_plugin_type_id);
	}
	return deja_dup_tool_plugin_type_id__once;
}

static void
_vala_deja_dup_tool_plugin_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec)
{
	DejaDupToolPlugin * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DEJA_DUP_TYPE_TOOL_PLUGIN, DejaDupToolPlugin);
	switch (property_id) {
		case DEJA_DUP_TOOL_PLUGIN_NAME_PROPERTY:
		g_value_set_string (value, deja_dup_tool_plugin_get_name (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_deja_dup_tool_plugin_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec)
{
	DejaDupToolPlugin * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DEJA_DUP_TYPE_TOOL_PLUGIN, DejaDupToolPlugin);
	switch (property_id) {
		case DEJA_DUP_TOOL_PLUGIN_NAME_PROPERTY:
		deja_dup_tool_plugin_set_name (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

