/* KeyboardView.c generated by valac 0.56.19, the Vala compiler
 * generated from KeyboardView.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>
#include <gio/gio.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_KEYBOARD_VIEW (gala_daemon_keyboard_view_get_type ())
#define GALA_DAEMON_KEYBOARD_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_DAEMON_TYPE_KEYBOARD_VIEW, GalaDaemonKeyboardView))
#define GALA_DAEMON_KEYBOARD_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_DAEMON_TYPE_KEYBOARD_VIEW, GalaDaemonKeyboardViewClass))
#define GALA_DAEMON_IS_KEYBOARD_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_DAEMON_TYPE_KEYBOARD_VIEW))
#define GALA_DAEMON_IS_KEYBOARD_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_DAEMON_TYPE_KEYBOARD_VIEW))
#define GALA_DAEMON_KEYBOARD_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_DAEMON_TYPE_KEYBOARD_VIEW, GalaDaemonKeyboardViewClass))

typedef struct _GalaDaemonKeyboardView GalaDaemonKeyboardView;
typedef struct _GalaDaemonKeyboardViewClass GalaDaemonKeyboardViewClass;
typedef struct _GalaDaemonKeyboardViewPrivate GalaDaemonKeyboardViewPrivate;
enum  {
	GALA_DAEMON_KEYBOARD_VIEW_0_PROPERTY,
	GALA_DAEMON_KEYBOARD_VIEW_NAME_PROPERTY,
	GALA_DAEMON_KEYBOARD_VIEW_ROWS_PROPERTY,
	GALA_DAEMON_KEYBOARD_VIEW_IS_DEFAULT_PROPERTY,
	GALA_DAEMON_KEYBOARD_VIEW_NUM_PROPERTIES
};
static GParamSpec* gala_daemon_keyboard_view_properties[GALA_DAEMON_KEYBOARD_VIEW_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 _GalaDaemonKeyboardView {
	GObject parent_instance;
	GalaDaemonKeyboardViewPrivate * priv;
};

struct _GalaDaemonKeyboardViewClass {
	GObjectClass parent_class;
};

struct _GalaDaemonKeyboardViewPrivate {
	gchar* _name;
	GListModel* _rows;
	gboolean _is_default;
};

static gint GalaDaemonKeyboardView_private_offset;
static gpointer gala_daemon_keyboard_view_parent_class = NULL;

VALA_EXTERN GType gala_daemon_keyboard_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaDaemonKeyboardView, g_object_unref)
VALA_EXTERN GalaDaemonKeyboardView* gala_daemon_keyboard_view_new (const gchar* name,
                                                       GListModel* rows,
                                                       gboolean is_default);
VALA_EXTERN GalaDaemonKeyboardView* gala_daemon_keyboard_view_construct (GType object_type,
                                                             const gchar* name,
                                                             GListModel* rows,
                                                             gboolean is_default);
VALA_EXTERN const gchar* gala_daemon_keyboard_view_get_name (GalaDaemonKeyboardView* self);
static void gala_daemon_keyboard_view_set_name (GalaDaemonKeyboardView* self,
                                         const gchar* value);
VALA_EXTERN GListModel* gala_daemon_keyboard_view_get_rows (GalaDaemonKeyboardView* self);
static void gala_daemon_keyboard_view_set_rows (GalaDaemonKeyboardView* self,
                                         GListModel* value);
VALA_EXTERN gboolean gala_daemon_keyboard_view_get_is_default (GalaDaemonKeyboardView* self);
static void gala_daemon_keyboard_view_set_is_default (GalaDaemonKeyboardView* self,
                                               gboolean value);
static void gala_daemon_keyboard_view_finalize (GObject * obj);
static GType gala_daemon_keyboard_view_get_type_once (void);
static void _vala_gala_daemon_keyboard_view_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec);
static void _vala_gala_daemon_keyboard_view_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec);

static inline gpointer
gala_daemon_keyboard_view_get_instance_private (GalaDaemonKeyboardView* self)
{
	return G_STRUCT_MEMBER_P (self, GalaDaemonKeyboardView_private_offset);
}

GalaDaemonKeyboardView*
gala_daemon_keyboard_view_construct (GType object_type,
                                     const gchar* name,
                                     GListModel* rows,
                                     gboolean is_default)
{
	GalaDaemonKeyboardView * self = NULL;
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (rows != NULL, NULL);
	self = (GalaDaemonKeyboardView*) g_object_new (object_type, "name", name, "rows", rows, "is-default", is_default, NULL);
	return self;
}

GalaDaemonKeyboardView*
gala_daemon_keyboard_view_new (const gchar* name,
                               GListModel* rows,
                               gboolean is_default)
{
	return gala_daemon_keyboard_view_construct (GALA_DAEMON_TYPE_KEYBOARD_VIEW, name, rows, is_default);
}

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

static void
gala_daemon_keyboard_view_set_name (GalaDaemonKeyboardView* self,
                                    const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = gala_daemon_keyboard_view_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, gala_daemon_keyboard_view_properties[GALA_DAEMON_KEYBOARD_VIEW_NAME_PROPERTY]);
	}
}

GListModel*
gala_daemon_keyboard_view_get_rows (GalaDaemonKeyboardView* self)
{
	GListModel* result;
	GListModel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_rows;
	result = _tmp0_;
	return result;
}

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

static void
gala_daemon_keyboard_view_set_rows (GalaDaemonKeyboardView* self,
                                    GListModel* value)
{
	GListModel* old_value;
	g_return_if_fail (self != NULL);
	old_value = gala_daemon_keyboard_view_get_rows (self);
	if (old_value != value) {
		GListModel* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_rows);
		self->priv->_rows = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gala_daemon_keyboard_view_properties[GALA_DAEMON_KEYBOARD_VIEW_ROWS_PROPERTY]);
	}
}

gboolean
gala_daemon_keyboard_view_get_is_default (GalaDaemonKeyboardView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_default;
	return result;
}

static void
gala_daemon_keyboard_view_set_is_default (GalaDaemonKeyboardView* self,
                                          gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = gala_daemon_keyboard_view_get_is_default (self);
	if (old_value != value) {
		self->priv->_is_default = value;
		g_object_notify_by_pspec ((GObject *) self, gala_daemon_keyboard_view_properties[GALA_DAEMON_KEYBOARD_VIEW_IS_DEFAULT_PROPERTY]);
	}
}

static void
gala_daemon_keyboard_view_class_init (GalaDaemonKeyboardViewClass * klass,
                                      gpointer klass_data)
{
	gala_daemon_keyboard_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GalaDaemonKeyboardView_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gala_daemon_keyboard_view_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gala_daemon_keyboard_view_set_property;
	G_OBJECT_CLASS (klass)->finalize = gala_daemon_keyboard_view_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_DAEMON_KEYBOARD_VIEW_NAME_PROPERTY, gala_daemon_keyboard_view_properties[GALA_DAEMON_KEYBOARD_VIEW_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", 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_KEYBOARD_VIEW_ROWS_PROPERTY, gala_daemon_keyboard_view_properties[GALA_DAEMON_KEYBOARD_VIEW_ROWS_PROPERTY] = g_param_spec_object ("rows", "rows", "rows", g_list_model_get_type (), 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_KEYBOARD_VIEW_IS_DEFAULT_PROPERTY, gala_daemon_keyboard_view_properties[GALA_DAEMON_KEYBOARD_VIEW_IS_DEFAULT_PROPERTY] = g_param_spec_boolean ("is-default", "is-default", "is-default", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
gala_daemon_keyboard_view_instance_init (GalaDaemonKeyboardView * self,
                                         gpointer klass)
{
	self->priv = gala_daemon_keyboard_view_get_instance_private (self);
}

static void
gala_daemon_keyboard_view_finalize (GObject * obj)
{
	GalaDaemonKeyboardView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_DAEMON_TYPE_KEYBOARD_VIEW, GalaDaemonKeyboardView);
	_g_free0 (self->priv->_name);
	_g_object_unref0 (self->priv->_rows);
	G_OBJECT_CLASS (gala_daemon_keyboard_view_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gala_daemon_keyboard_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GalaDaemonKeyboardViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gala_daemon_keyboard_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GalaDaemonKeyboardView), 0, (GInstanceInitFunc) gala_daemon_keyboard_view_instance_init, NULL };
	GType gala_daemon_keyboard_view_type_id;
	gala_daemon_keyboard_view_type_id = g_type_register_static (G_TYPE_OBJECT, "GalaDaemonKeyboardView", &g_define_type_info, G_TYPE_FLAG_NONE);
	GalaDaemonKeyboardView_private_offset = g_type_add_instance_private (gala_daemon_keyboard_view_type_id, sizeof (GalaDaemonKeyboardViewPrivate));
	return gala_daemon_keyboard_view_type_id;
}

GType
gala_daemon_keyboard_view_get_type (void)
{
	static gsize gala_daemon_keyboard_view_type_id__once = 0;
	if (g_once_init_enter (&gala_daemon_keyboard_view_type_id__once)) {
		GType gala_daemon_keyboard_view_type_id;
		gala_daemon_keyboard_view_type_id = gala_daemon_keyboard_view_get_type_once ();
		g_once_init_leave (&gala_daemon_keyboard_view_type_id__once, gala_daemon_keyboard_view_type_id);
	}
	return gala_daemon_keyboard_view_type_id__once;
}

static void
_vala_gala_daemon_keyboard_view_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec)
{
	GalaDaemonKeyboardView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_DAEMON_TYPE_KEYBOARD_VIEW, GalaDaemonKeyboardView);
	switch (property_id) {
		case GALA_DAEMON_KEYBOARD_VIEW_NAME_PROPERTY:
		g_value_set_string (value, gala_daemon_keyboard_view_get_name (self));
		break;
		case GALA_DAEMON_KEYBOARD_VIEW_ROWS_PROPERTY:
		g_value_set_object (value, gala_daemon_keyboard_view_get_rows (self));
		break;
		case GALA_DAEMON_KEYBOARD_VIEW_IS_DEFAULT_PROPERTY:
		g_value_set_boolean (value, gala_daemon_keyboard_view_get_is_default (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gala_daemon_keyboard_view_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec)
{
	GalaDaemonKeyboardView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_DAEMON_TYPE_KEYBOARD_VIEW, GalaDaemonKeyboardView);
	switch (property_id) {
		case GALA_DAEMON_KEYBOARD_VIEW_NAME_PROPERTY:
		gala_daemon_keyboard_view_set_name (self, g_value_get_string (value));
		break;
		case GALA_DAEMON_KEYBOARD_VIEW_ROWS_PROPERTY:
		gala_daemon_keyboard_view_set_rows (self, g_value_get_object (value));
		break;
		case GALA_DAEMON_KEYBOARD_VIEW_IS_DEFAULT_PROPERTY:
		gala_daemon_keyboard_view_set_is_default (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

