/* InputManager.c generated by valac 0.56.19, the Vala compiler
 * generated from InputManager.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 <gio/gio.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_INPUT_MANAGER (gala_daemon_input_manager_get_type ())
#define GALA_DAEMON_INPUT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_DAEMON_TYPE_INPUT_MANAGER, GalaDaemonInputManager))
#define GALA_DAEMON_INPUT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_DAEMON_TYPE_INPUT_MANAGER, GalaDaemonInputManagerClass))
#define GALA_DAEMON_IS_INPUT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_DAEMON_TYPE_INPUT_MANAGER))
#define GALA_DAEMON_IS_INPUT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_DAEMON_TYPE_INPUT_MANAGER))
#define GALA_DAEMON_INPUT_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_DAEMON_TYPE_INPUT_MANAGER, GalaDaemonInputManagerClass))

typedef struct _GalaDaemonInputManager GalaDaemonInputManager;
typedef struct _GalaDaemonInputManagerClass GalaDaemonInputManagerClass;
typedef struct _GalaDaemonInputManagerPrivate GalaDaemonInputManagerPrivate;

#define GALA_DAEMON_TYPE_OSK_SERVICE (gala_daemon_osk_service_get_type ())
#define GALA_DAEMON_OSK_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_DAEMON_TYPE_OSK_SERVICE, GalaDaemonOSKService))
#define GALA_DAEMON_OSK_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GALA_DAEMON_TYPE_OSK_SERVICE, GalaDaemonOSKServiceClass))
#define GALA_DAEMON_IS_OSK_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_DAEMON_TYPE_OSK_SERVICE))
#define GALA_DAEMON_IS_OSK_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GALA_DAEMON_TYPE_OSK_SERVICE))
#define GALA_DAEMON_OSK_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GALA_DAEMON_TYPE_OSK_SERVICE, GalaDaemonOSKServiceClass))

typedef struct _GalaDaemonOSKService GalaDaemonOSKService;
typedef struct _GalaDaemonOSKServiceClass GalaDaemonOSKServiceClass;
enum  {
	GALA_DAEMON_INPUT_MANAGER_0_PROPERTY,
	GALA_DAEMON_INPUT_MANAGER_SERVICE_PROPERTY,
	GALA_DAEMON_INPUT_MANAGER_NUM_PROPERTIES
};
static GParamSpec* gala_daemon_input_manager_properties[GALA_DAEMON_INPUT_MANAGER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _GalaDaemonInputManager {
	GObject parent_instance;
	GalaDaemonInputManagerPrivate * priv;
};

struct _GalaDaemonInputManagerClass {
	GObjectClass parent_class;
};

struct _GalaDaemonInputManagerPrivate {
	GalaDaemonOSKService* _service;
};

static gint GalaDaemonInputManager_private_offset;
static gpointer gala_daemon_input_manager_parent_class = NULL;

VALA_EXTERN GType gala_daemon_input_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaDaemonInputManager, g_object_unref)
VALA_EXTERN GType gala_daemon_osk_service_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaDaemonOSKService, g_object_unref)
VALA_EXTERN guint gala_daemon_osk_service_register_object (void* object,
                                               GDBusConnection* connection,
                                               const gchar* path,
                                               GError** error);
VALA_EXTERN GalaDaemonInputManager* gala_daemon_input_manager_new (GalaDaemonOSKService* service);
VALA_EXTERN GalaDaemonInputManager* gala_daemon_input_manager_construct (GType object_type,
                                                             GalaDaemonOSKService* service);
VALA_EXTERN void gala_daemon_input_manager_send_keyval (GalaDaemonInputManager* self,
                                            guint keyval);
static GalaDaemonOSKService* gala_daemon_input_manager_get_service (GalaDaemonInputManager* self);
VALA_EXTERN void gala_daemon_input_manager_press_keyval (GalaDaemonInputManager* self,
                                             guint keyval);
VALA_EXTERN void gala_daemon_input_manager_release_keyval (GalaDaemonInputManager* self,
                                               guint keyval);
VALA_EXTERN void gala_daemon_input_manager_request_hide (GalaDaemonInputManager* self);
static void gala_daemon_input_manager_set_service (GalaDaemonInputManager* self,
                                            GalaDaemonOSKService* value);
static void gala_daemon_input_manager_finalize (GObject * obj);
static GType gala_daemon_input_manager_get_type_once (void);
static void _vala_gala_daemon_input_manager_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec);
static void _vala_gala_daemon_input_manager_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec);

static inline gpointer
gala_daemon_input_manager_get_instance_private (GalaDaemonInputManager* self)
{
	return G_STRUCT_MEMBER_P (self, GalaDaemonInputManager_private_offset);
}

GalaDaemonInputManager*
gala_daemon_input_manager_construct (GType object_type,
                                     GalaDaemonOSKService* service)
{
	GalaDaemonInputManager * self = NULL;
	g_return_val_if_fail (service != NULL, NULL);
	self = (GalaDaemonInputManager*) g_object_new (object_type, "service", service, NULL);
	return self;
}

GalaDaemonInputManager*
gala_daemon_input_manager_new (GalaDaemonOSKService* service)
{
	return gala_daemon_input_manager_construct (GALA_DAEMON_TYPE_INPUT_MANAGER, service);
}

void
gala_daemon_input_manager_send_keyval (GalaDaemonInputManager* self,
                                       guint keyval)
{
	GalaDaemonOSKService* _tmp0_;
	GalaDaemonOSKService* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_service;
	g_signal_emit_by_name (_tmp0_, "keyval-pressed", keyval);
	_tmp1_ = self->priv->_service;
	g_signal_emit_by_name (_tmp1_, "keyval-released", keyval);
}

void
gala_daemon_input_manager_press_keyval (GalaDaemonInputManager* self,
                                        guint keyval)
{
	GalaDaemonOSKService* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_service;
	g_signal_emit_by_name (_tmp0_, "keyval-pressed", keyval);
}

void
gala_daemon_input_manager_release_keyval (GalaDaemonInputManager* self,
                                          guint keyval)
{
	GalaDaemonOSKService* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_service;
	g_signal_emit_by_name (_tmp0_, "keyval-released", keyval);
}

void
gala_daemon_input_manager_request_hide (GalaDaemonInputManager* self)
{
	GalaDaemonOSKService* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_service;
	g_signal_emit_by_name (_tmp0_, "hide-requested");
}

static GalaDaemonOSKService*
gala_daemon_input_manager_get_service (GalaDaemonInputManager* self)
{
	GalaDaemonOSKService* result;
	GalaDaemonOSKService* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_service;
	result = _tmp0_;
	return result;
}

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

static void
gala_daemon_input_manager_set_service (GalaDaemonInputManager* self,
                                       GalaDaemonOSKService* value)
{
	GalaDaemonOSKService* old_value;
	g_return_if_fail (self != NULL);
	old_value = gala_daemon_input_manager_get_service (self);
	if (old_value != value) {
		GalaDaemonOSKService* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_service);
		self->priv->_service = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gala_daemon_input_manager_properties[GALA_DAEMON_INPUT_MANAGER_SERVICE_PROPERTY]);
	}
}

static void
gala_daemon_input_manager_class_init (GalaDaemonInputManagerClass * klass,
                                      gpointer klass_data)
{
	gala_daemon_input_manager_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GalaDaemonInputManager_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gala_daemon_input_manager_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gala_daemon_input_manager_set_property;
	G_OBJECT_CLASS (klass)->finalize = gala_daemon_input_manager_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GALA_DAEMON_INPUT_MANAGER_SERVICE_PROPERTY, gala_daemon_input_manager_properties[GALA_DAEMON_INPUT_MANAGER_SERVICE_PROPERTY] = g_param_spec_object ("service", "service", "service", GALA_DAEMON_TYPE_OSK_SERVICE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
gala_daemon_input_manager_instance_init (GalaDaemonInputManager * self,
                                         gpointer klass)
{
	self->priv = gala_daemon_input_manager_get_instance_private (self);
}

static void
gala_daemon_input_manager_finalize (GObject * obj)
{
	GalaDaemonInputManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GALA_DAEMON_TYPE_INPUT_MANAGER, GalaDaemonInputManager);
	_g_object_unref0 (self->priv->_service);
	G_OBJECT_CLASS (gala_daemon_input_manager_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gala_daemon_input_manager_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GalaDaemonInputManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gala_daemon_input_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GalaDaemonInputManager), 0, (GInstanceInitFunc) gala_daemon_input_manager_instance_init, NULL };
	GType gala_daemon_input_manager_type_id;
	gala_daemon_input_manager_type_id = g_type_register_static (G_TYPE_OBJECT, "GalaDaemonInputManager", &g_define_type_info, G_TYPE_FLAG_NONE);
	GalaDaemonInputManager_private_offset = g_type_add_instance_private (gala_daemon_input_manager_type_id, sizeof (GalaDaemonInputManagerPrivate));
	return gala_daemon_input_manager_type_id;
}

GType
gala_daemon_input_manager_get_type (void)
{
	static gsize gala_daemon_input_manager_type_id__once = 0;
	if (g_once_init_enter (&gala_daemon_input_manager_type_id__once)) {
		GType gala_daemon_input_manager_type_id;
		gala_daemon_input_manager_type_id = gala_daemon_input_manager_get_type_once ();
		g_once_init_leave (&gala_daemon_input_manager_type_id__once, gala_daemon_input_manager_type_id);
	}
	return gala_daemon_input_manager_type_id__once;
}

static void
_vala_gala_daemon_input_manager_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec)
{
	GalaDaemonInputManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_DAEMON_TYPE_INPUT_MANAGER, GalaDaemonInputManager);
	switch (property_id) {
		case GALA_DAEMON_INPUT_MANAGER_SERVICE_PROPERTY:
		g_value_set_object (value, gala_daemon_input_manager_get_service (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gala_daemon_input_manager_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec)
{
	GalaDaemonInputManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GALA_DAEMON_TYPE_INPUT_MANAGER, GalaDaemonInputManager);
	switch (property_id) {
		case GALA_DAEMON_INPUT_MANAGER_SERVICE_PROPERTY:
		gala_daemon_input_manager_set_service (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

