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

/*
 * Copyright 2026 elementary, Inc. (https://elementary.io)
 * SPDX-License-Identifier: GPL-3.0-or-later
 *
 * Authored by: Leonhard Kargl <leo.kargl@proton.me>
 */

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define GALA_DAEMON_TYPE_CANDIDATE (gala_daemon_candidate_get_type ())
#define GALA_DAEMON_CANDIDATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_DAEMON_TYPE_CANDIDATE, GalaDaemonCandidate))
#define GALA_DAEMON_CANDIDATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_DAEMON_TYPE_CANDIDATE, GalaDaemonCandidateClass))
#define GALA_DAEMON_IS_CANDIDATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_DAEMON_TYPE_CANDIDATE))
#define GALA_DAEMON_IS_CANDIDATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_DAEMON_TYPE_CANDIDATE))
#define GALA_DAEMON_CANDIDATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_DAEMON_TYPE_CANDIDATE, GalaDaemonCandidateClass))

typedef struct _GalaDaemonCandidate GalaDaemonCandidate;
typedef struct _GalaDaemonCandidateClass GalaDaemonCandidateClass;
typedef struct _GalaDaemonCandidatePrivate GalaDaemonCandidatePrivate;
enum  {
	GALA_DAEMON_CANDIDATE_0_PROPERTY,
	GALA_DAEMON_CANDIDATE_LABEL_PROPERTY,
	GALA_DAEMON_CANDIDATE_CANDIDATE_PROPERTY,
	GALA_DAEMON_CANDIDATE_NUM_PROPERTIES
};
static GParamSpec* gala_daemon_candidate_properties[GALA_DAEMON_CANDIDATE_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

struct _GalaDaemonCandidate {
	GObject parent_instance;
	GalaDaemonCandidatePrivate * priv;
};

struct _GalaDaemonCandidateClass {
	GObjectClass parent_class;
};

struct _GalaDaemonCandidatePrivate {
	gchar* _label;
	gchar* _candidate;
};

static gint GalaDaemonCandidate_private_offset;
static gpointer gala_daemon_candidate_parent_class = NULL;

VALA_EXTERN GType gala_daemon_candidate_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaDaemonCandidate, g_object_unref)
VALA_EXTERN GalaDaemonCandidate* gala_daemon_candidate_new (const gchar* label,
                                                const gchar* candidate);
VALA_EXTERN GalaDaemonCandidate* gala_daemon_candidate_construct (GType object_type,
                                                      const gchar* label,
                                                      const gchar* candidate);
VALA_EXTERN const gchar* gala_daemon_candidate_get_label (GalaDaemonCandidate* self);
static void gala_daemon_candidate_set_label (GalaDaemonCandidate* self,
                                      const gchar* value);
VALA_EXTERN const gchar* gala_daemon_candidate_get_candidate (GalaDaemonCandidate* self);
static void gala_daemon_candidate_set_candidate (GalaDaemonCandidate* self,
                                          const gchar* value);
static void gala_daemon_candidate_finalize (GObject * obj);
static GType gala_daemon_candidate_get_type_once (void);
static void _vala_gala_daemon_candidate_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_gala_daemon_candidate_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec);

static inline gpointer
gala_daemon_candidate_get_instance_private (GalaDaemonCandidate* self)
{
	return G_STRUCT_MEMBER_P (self, GalaDaemonCandidate_private_offset);
}

GalaDaemonCandidate*
gala_daemon_candidate_construct (GType object_type,
                                 const gchar* label,
                                 const gchar* candidate)
{
	GalaDaemonCandidate * self = NULL;
	self = (GalaDaemonCandidate*) g_object_new (object_type, "label", label, "candidate", candidate, NULL);
	return self;
}

GalaDaemonCandidate*
gala_daemon_candidate_new (const gchar* label,
                           const gchar* candidate)
{
	return gala_daemon_candidate_construct (GALA_DAEMON_TYPE_CANDIDATE, label, candidate);
}

const gchar*
gala_daemon_candidate_get_label (GalaDaemonCandidate* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_label;
	result = _tmp0_;
	return result;
}

static void
gala_daemon_candidate_set_label (GalaDaemonCandidate* self,
                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = gala_daemon_candidate_get_label (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_label);
		self->priv->_label = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gala_daemon_candidate_properties[GALA_DAEMON_CANDIDATE_LABEL_PROPERTY]);
	}
}

const gchar*
gala_daemon_candidate_get_candidate (GalaDaemonCandidate* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_candidate;
	result = _tmp0_;
	return result;
}

static void
gala_daemon_candidate_set_candidate (GalaDaemonCandidate* self,
                                     const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = gala_daemon_candidate_get_candidate (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_candidate);
		self->priv->_candidate = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gala_daemon_candidate_properties[GALA_DAEMON_CANDIDATE_CANDIDATE_PROPERTY]);
	}
}

static void
gala_daemon_candidate_class_init (GalaDaemonCandidateClass * klass,
                                  gpointer klass_data)
{
	gala_daemon_candidate_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GalaDaemonCandidate_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gala_daemon_candidate_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gala_daemon_candidate_set_property;
	G_OBJECT_CLASS (klass)->finalize = gala_daemon_candidate_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_DAEMON_CANDIDATE_LABEL_PROPERTY, gala_daemon_candidate_properties[GALA_DAEMON_CANDIDATE_LABEL_PROPERTY] = g_param_spec_string ("label", "label", "label", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_DAEMON_CANDIDATE_CANDIDATE_PROPERTY, gala_daemon_candidate_properties[GALA_DAEMON_CANDIDATE_CANDIDATE_PROPERTY] = g_param_spec_string ("candidate", "candidate", "candidate", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
gala_daemon_candidate_instance_init (GalaDaemonCandidate * self,
                                     gpointer klass)
{
	self->priv = gala_daemon_candidate_get_instance_private (self);
}

static void
gala_daemon_candidate_finalize (GObject * obj)
{
	GalaDaemonCandidate * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_DAEMON_TYPE_CANDIDATE, GalaDaemonCandidate);
	_g_free0 (self->priv->_label);
	_g_free0 (self->priv->_candidate);
	G_OBJECT_CLASS (gala_daemon_candidate_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gala_daemon_candidate_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GalaDaemonCandidateClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gala_daemon_candidate_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GalaDaemonCandidate), 0, (GInstanceInitFunc) gala_daemon_candidate_instance_init, NULL };
	GType gala_daemon_candidate_type_id;
	gala_daemon_candidate_type_id = g_type_register_static (G_TYPE_OBJECT, "GalaDaemonCandidate", &g_define_type_info, G_TYPE_FLAG_NONE);
	GalaDaemonCandidate_private_offset = g_type_add_instance_private (gala_daemon_candidate_type_id, sizeof (GalaDaemonCandidatePrivate));
	return gala_daemon_candidate_type_id;
}

GType
gala_daemon_candidate_get_type (void)
{
	static gsize gala_daemon_candidate_type_id__once = 0;
	if (g_once_init_enter (&gala_daemon_candidate_type_id__once)) {
		GType gala_daemon_candidate_type_id;
		gala_daemon_candidate_type_id = gala_daemon_candidate_get_type_once ();
		g_once_init_leave (&gala_daemon_candidate_type_id__once, gala_daemon_candidate_type_id);
	}
	return gala_daemon_candidate_type_id__once;
}

static void
_vala_gala_daemon_candidate_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	GalaDaemonCandidate * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_DAEMON_TYPE_CANDIDATE, GalaDaemonCandidate);
	switch (property_id) {
		case GALA_DAEMON_CANDIDATE_LABEL_PROPERTY:
		g_value_set_string (value, gala_daemon_candidate_get_label (self));
		break;
		case GALA_DAEMON_CANDIDATE_CANDIDATE_PROPERTY:
		g_value_set_string (value, gala_daemon_candidate_get_candidate (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gala_daemon_candidate_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	GalaDaemonCandidate * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_DAEMON_TYPE_CANDIDATE, GalaDaemonCandidate);
	switch (property_id) {
		case GALA_DAEMON_CANDIDATE_LABEL_PROPERTY:
		gala_daemon_candidate_set_label (self, g_value_get_string (value));
		break;
		case GALA_DAEMON_CANDIDATE_CANDIDATE_PROPERTY:
		gala_daemon_candidate_set_candidate (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

