/* BackendUnsupported.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from BackendUnsupported.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_BACKEND_UNSUPPORTED_0_PROPERTY,
	DEJA_DUP_BACKEND_UNSUPPORTED_KEY_PROPERTY,
	DEJA_DUP_BACKEND_UNSUPPORTED_NUM_PROPERTIES
};
static GParamSpec* deja_dup_backend_unsupported_properties[DEJA_DUP_BACKEND_UNSUPPORTED_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

struct _DejaDupBackendUnsupportedPrivate {
	gchar* _key;
};

static gint DejaDupBackendUnsupported_private_offset;
static gpointer deja_dup_backend_unsupported_parent_class = NULL;

static gboolean deja_dup_backend_unsupported_real_is_native (DejaDupBackend* base);
static gchar* deja_dup_backend_unsupported_real_get_location_pretty (DejaDupBackend* base);
static gchar* deja_dup_backend_unsupported_real_get_unique_location (DejaDupBackend* base);
static void deja_dup_backend_unsupported_finalize (GObject * obj);
static GType deja_dup_backend_unsupported_get_type_once (void);
static void _vala_deja_dup_backend_unsupported_get_property (GObject * object,
                                                      guint property_id,
                                                      GValue * value,
                                                      GParamSpec * pspec);
static void _vala_deja_dup_backend_unsupported_set_property (GObject * object,
                                                      guint property_id,
                                                      const GValue * value,
                                                      GParamSpec * pspec);

static inline gpointer
deja_dup_backend_unsupported_get_instance_private (DejaDupBackendUnsupported* self)
{
	return G_STRUCT_MEMBER_P (self, DejaDupBackendUnsupported_private_offset);
}

DejaDupBackendUnsupported*
deja_dup_backend_unsupported_construct (GType object_type,
                                        const gchar* key)
{
	DejaDupBackendUnsupported * self = NULL;
	g_return_val_if_fail (key != NULL, NULL);
	self = (DejaDupBackendUnsupported*) g_object_new (object_type, "key", key, NULL);
	return self;
}

DejaDupBackendUnsupported*
deja_dup_backend_unsupported_new (const gchar* key)
{
	return deja_dup_backend_unsupported_construct (DEJA_DUP_TYPE_BACKEND_UNSUPPORTED, key);
}

static gboolean
deja_dup_backend_unsupported_real_is_native (DejaDupBackend* base)
{
	DejaDupBackendUnsupported * self;
	gboolean result;
	self = (DejaDupBackendUnsupported*) base;
	result = TRUE;
	return result;
}

static gchar*
deja_dup_backend_unsupported_real_get_location_pretty (DejaDupBackend* base)
{
	DejaDupBackendUnsupported * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	self = (DejaDupBackendUnsupported*) base;
	_tmp0_ = self->priv->_key;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static gchar*
deja_dup_backend_unsupported_real_get_unique_location (DejaDupBackend* base)
{
	DejaDupBackendUnsupported * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	self = (DejaDupBackendUnsupported*) base;
	_tmp0_ = self->priv->_key;
	_tmp1_ = g_strconcat ("unsupported:", _tmp0_, NULL);
	result = _tmp1_;
	return result;
}

const gchar*
deja_dup_backend_unsupported_get_key (DejaDupBackendUnsupported* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_key;
	result = _tmp0_;
	return result;
}

static void
deja_dup_backend_unsupported_set_key (DejaDupBackendUnsupported* self,
                                      const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = deja_dup_backend_unsupported_get_key (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_key);
		self->priv->_key = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, deja_dup_backend_unsupported_properties[DEJA_DUP_BACKEND_UNSUPPORTED_KEY_PROPERTY]);
	}
}

static void
deja_dup_backend_unsupported_class_init (DejaDupBackendUnsupportedClass * klass,
                                         gpointer klass_data)
{
	deja_dup_backend_unsupported_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DejaDupBackendUnsupported_private_offset);
	((DejaDupBackendClass *) klass)->is_native = (gboolean (*) (DejaDupBackend*)) deja_dup_backend_unsupported_real_is_native;
	((DejaDupBackendClass *) klass)->get_location_pretty = (gchar* (*) (DejaDupBackend*)) deja_dup_backend_unsupported_real_get_location_pretty;
	((DejaDupBackendClass *) klass)->get_unique_location = (gchar* (*) (DejaDupBackend*)) deja_dup_backend_unsupported_real_get_unique_location;
	G_OBJECT_CLASS (klass)->get_property = _vala_deja_dup_backend_unsupported_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_deja_dup_backend_unsupported_set_property;
	G_OBJECT_CLASS (klass)->finalize = deja_dup_backend_unsupported_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DEJA_DUP_BACKEND_UNSUPPORTED_KEY_PROPERTY, deja_dup_backend_unsupported_properties[DEJA_DUP_BACKEND_UNSUPPORTED_KEY_PROPERTY] = g_param_spec_string ("key", "key", "key", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
deja_dup_backend_unsupported_instance_init (DejaDupBackendUnsupported * self,
                                            gpointer klass)
{
	self->priv = deja_dup_backend_unsupported_get_instance_private (self);
}

static void
deja_dup_backend_unsupported_finalize (GObject * obj)
{
	DejaDupBackendUnsupported * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DEJA_DUP_TYPE_BACKEND_UNSUPPORTED, DejaDupBackendUnsupported);
	_g_free0 (self->priv->_key);
	G_OBJECT_CLASS (deja_dup_backend_unsupported_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
deja_dup_backend_unsupported_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DejaDupBackendUnsupportedClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) deja_dup_backend_unsupported_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DejaDupBackendUnsupported), 0, (GInstanceInitFunc) deja_dup_backend_unsupported_instance_init, NULL };
	GType deja_dup_backend_unsupported_type_id;
	deja_dup_backend_unsupported_type_id = g_type_register_static (DEJA_DUP_TYPE_BACKEND, "DejaDupBackendUnsupported", &g_define_type_info, 0);
	DejaDupBackendUnsupported_private_offset = g_type_add_instance_private (deja_dup_backend_unsupported_type_id, sizeof (DejaDupBackendUnsupportedPrivate));
	return deja_dup_backend_unsupported_type_id;
}

GType
deja_dup_backend_unsupported_get_type (void)
{
	static gsize deja_dup_backend_unsupported_type_id__once = 0;
	if (g_once_init_enter (&deja_dup_backend_unsupported_type_id__once)) {
		GType deja_dup_backend_unsupported_type_id;
		deja_dup_backend_unsupported_type_id = deja_dup_backend_unsupported_get_type_once ();
		g_once_init_leave (&deja_dup_backend_unsupported_type_id__once, deja_dup_backend_unsupported_type_id);
	}
	return deja_dup_backend_unsupported_type_id__once;
}

static void
_vala_deja_dup_backend_unsupported_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec)
{
	DejaDupBackendUnsupported * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DEJA_DUP_TYPE_BACKEND_UNSUPPORTED, DejaDupBackendUnsupported);
	switch (property_id) {
		case DEJA_DUP_BACKEND_UNSUPPORTED_KEY_PROPERTY:
		g_value_set_string (value, deja_dup_backend_unsupported_get_key (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_deja_dup_backend_unsupported_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec)
{
	DejaDupBackendUnsupported * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DEJA_DUP_TYPE_BACKEND_UNSUPPORTED, DejaDupBackendUnsupported);
	switch (property_id) {
		case DEJA_DUP_BACKEND_UNSUPPORTED_KEY_PROPERTY:
		deja_dup_backend_unsupported_set_key (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

