/* OSKProxy.c generated by valac 0.56.19, the Vala compiler
 * generated from OSKProxy.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>
#include <ibus.h>
#include <string.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_TYPE_OSK_PROXY (gala_osk_proxy_get_type ())
#define GALA_OSK_PROXY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GALA_TYPE_OSK_PROXY, GalaOSKProxy))
#define GALA_IS_OSK_PROXY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GALA_TYPE_OSK_PROXY))
#define GALA_OSK_PROXY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GALA_TYPE_OSK_PROXY, GalaOSKProxyIface))

typedef struct _GalaOSKProxy GalaOSKProxy;
typedef struct _GalaOSKProxyIface GalaOSKProxyIface;

#define GALA_TYPE_OSK_PROXY_PROXY (gala_osk_proxy_proxy_get_type ())
enum  {
	GALA_OSK_PROXY_HIDE_REQUESTED_SIGNAL,
	GALA_OSK_PROXY_KEYVAL_PRESSED_SIGNAL,
	GALA_OSK_PROXY_KEYVAL_RELEASED_SIGNAL,
	GALA_OSK_PROXY_NUM_SIGNALS
};
static guint gala_osk_proxy_signals[GALA_OSK_PROXY_NUM_SIGNALS] = {0};
typedef GDBusProxy GalaOSKProxyProxy;
typedef GDBusProxyClass GalaOSKProxyProxyClass;
typedef struct _GalaOskProxySetEnabledReadyData GalaOskProxySetEnabledReadyData;
typedef struct _GalaOskProxyResetReadyData GalaOskProxyResetReadyData;
typedef struct _GalaOskProxySetInputPurposeReadyData GalaOskProxySetInputPurposeReadyData;

struct _GalaOSKProxyIface {
	GTypeInterface parent_iface;
	void (*set_enabled) (GalaOSKProxy* self, gboolean enabled, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*set_enabled_finish) (GalaOSKProxy* self, GAsyncResult* _res_, GError** error);
	void (*reset) (GalaOSKProxy* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*reset_finish) (GalaOSKProxy* self, GAsyncResult* _res_, GError** error);
	void (*set_input_purpose) (GalaOSKProxy* self, IBusInputPurpose input_purpose, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*set_input_purpose_finish) (GalaOSKProxy* self, GAsyncResult* _res_, GError** error);
};

struct _GalaOskProxySetEnabledReadyData {
	GDBusMethodInvocation* _invocation_;
	gboolean enabled;
};

struct _GalaOskProxyResetReadyData {
	GDBusMethodInvocation* _invocation_;
};

struct _GalaOskProxySetInputPurposeReadyData {
	GDBusMethodInvocation* _invocation_;
	IBusInputPurpose input_purpose;
};

VALA_EXTERN GType gala_osk_proxy_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint gala_osk_proxy_register_object (void* object,
                                      GDBusConnection* connection,
                                      const gchar* path,
                                      GError** error);
VALA_EXTERN GType gala_osk_proxy_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GalaOSKProxy, g_object_unref)
VALA_EXTERN void gala_osk_proxy_set_enabled (GalaOSKProxy* self,
                                 gboolean enabled,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_);
VALA_EXTERN void gala_osk_proxy_set_enabled_finish (GalaOSKProxy* self,
                                        GAsyncResult* _res_,
                                        GError** error);
VALA_EXTERN void gala_osk_proxy_reset (GalaOSKProxy* self,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_);
VALA_EXTERN void gala_osk_proxy_reset_finish (GalaOSKProxy* self,
                                  GAsyncResult* _res_,
                                  GError** error);
VALA_EXTERN void gala_osk_proxy_set_input_purpose (GalaOSKProxy* self,
                                       IBusInputPurpose input_purpose,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_);
VALA_EXTERN void gala_osk_proxy_set_input_purpose_finish (GalaOSKProxy* self,
                                              GAsyncResult* _res_,
                                              GError** error);
static GType gala_osk_proxy_get_type_once (void);
static void gala_osk_proxy_proxy_g_signal (GDBusProxy* proxy,
                                    const gchar* sender_name,
                                    const gchar* signal_name,
                                    GVariant* parameters);
static void _dbus_handle_gala_osk_proxy_hide_requested (GalaOSKProxy* self,
                                                 GVariant* parameters);
static void _dbus_handle_gala_osk_proxy_keyval_pressed (GalaOSKProxy* self,
                                                 GVariant* parameters);
static void _dbus_handle_gala_osk_proxy_keyval_released (GalaOSKProxy* self,
                                                  GVariant* parameters);
static void _vala_g_async_ready_callback (GObject *source_object,
                                   GAsyncResult *res,
                                   void *user_data);
static void gala_osk_proxy_proxy_set_enabled_async (GalaOSKProxy* self,
                                             gboolean enabled,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
static void gala_osk_proxy_proxy_set_enabled_finish (GalaOSKProxy* self,
                                              GAsyncResult* _res_,
                                              GError** error);
static void gala_osk_proxy_proxy_reset_async (GalaOSKProxy* self,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_);
static void gala_osk_proxy_proxy_reset_finish (GalaOSKProxy* self,
                                        GAsyncResult* _res_,
                                        GError** error);
static void gala_osk_proxy_proxy_set_input_purpose_async (GalaOSKProxy* self,
                                                   IBusInputPurpose input_purpose,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
static void gala_osk_proxy_proxy_set_input_purpose_finish (GalaOSKProxy* self,
                                                    GAsyncResult* _res_,
                                                    GError** error);
static void gala_osk_proxy_proxy_gala_osk_proxy_interface_init (GalaOSKProxyIface* iface);
static void _dbus_gala_osk_proxy_set_enabled (GalaOSKProxy* self,
                                       GVariant* _parameters_,
                                       GDBusMethodInvocation* invocation);
static void _dbus_gala_osk_proxy_set_enabled_ready (GObject * source_object,
                                             GAsyncResult * _res_,
                                             gpointer _user_data_);
static void _dbus_gala_osk_proxy_reset (GalaOSKProxy* self,
                                 GVariant* _parameters_,
                                 GDBusMethodInvocation* invocation);
static void _dbus_gala_osk_proxy_reset_ready (GObject * source_object,
                                       GAsyncResult * _res_,
                                       gpointer _user_data_);
static void _dbus_gala_osk_proxy_set_input_purpose (GalaOSKProxy* self,
                                             GVariant* _parameters_,
                                             GDBusMethodInvocation* invocation);
static void _dbus_gala_osk_proxy_set_input_purpose_ready (GObject * source_object,
                                                   GAsyncResult * _res_,
                                                   gpointer _user_data_);
static void gala_osk_proxy_dbus_interface_method_call (GDBusConnection* connection,
                                                const gchar* sender,
                                                const gchar* object_path,
                                                const gchar* interface_name,
                                                const gchar* method_name,
                                                GVariant* parameters,
                                                GDBusMethodInvocation* invocation,
                                                gpointer user_data);
static GVariant* gala_osk_proxy_dbus_interface_get_property (GDBusConnection* connection,
                                                      const gchar* sender,
                                                      const gchar* object_path,
                                                      const gchar* interface_name,
                                                      const gchar* property_name,
                                                      GError** error,
                                                      gpointer user_data);
static gboolean gala_osk_proxy_dbus_interface_set_property (GDBusConnection* connection,
                                                     const gchar* sender,
                                                     const gchar* object_path,
                                                     const gchar* interface_name,
                                                     const gchar* property_name,
                                                     GVariant* value,
                                                     GError** error,
                                                     gpointer user_data);
static void _dbus_gala_osk_proxy_hide_requested (GObject* _sender,
                                          gpointer* _data);
static void _dbus_gala_osk_proxy_keyval_pressed (GObject* _sender,
                                          guint keyval,
                                          gpointer* _data);
static void _dbus_gala_osk_proxy_keyval_released (GObject* _sender,
                                           guint keyval,
                                           gpointer* _data);
static void _gala_osk_proxy_unregister_object (gpointer user_data);

static const GDBusArgInfo _gala_osk_proxy_dbus_arg_info_set_enabled_enabled = {-1, "enabled", "b", NULL};
static const GDBusArgInfo * const _gala_osk_proxy_dbus_arg_info_set_enabled_in[] = {&_gala_osk_proxy_dbus_arg_info_set_enabled_enabled, NULL};
static const GDBusArgInfo * const _gala_osk_proxy_dbus_arg_info_set_enabled_out[] = {NULL};
static const GDBusMethodInfo _gala_osk_proxy_dbus_method_info_set_enabled = {-1, "SetEnabled", (GDBusArgInfo **) (&_gala_osk_proxy_dbus_arg_info_set_enabled_in), (GDBusArgInfo **) (&_gala_osk_proxy_dbus_arg_info_set_enabled_out), NULL};
static const GDBusArgInfo * const _gala_osk_proxy_dbus_arg_info_reset_in[] = {NULL};
static const GDBusArgInfo * const _gala_osk_proxy_dbus_arg_info_reset_out[] = {NULL};
static const GDBusMethodInfo _gala_osk_proxy_dbus_method_info_reset = {-1, "Reset", (GDBusArgInfo **) (&_gala_osk_proxy_dbus_arg_info_reset_in), (GDBusArgInfo **) (&_gala_osk_proxy_dbus_arg_info_reset_out), NULL};
static const GDBusArgInfo _gala_osk_proxy_dbus_arg_info_set_input_purpose_input_purpose = {-1, "input_purpose", "i", NULL};
static const GDBusArgInfo * const _gala_osk_proxy_dbus_arg_info_set_input_purpose_in[] = {&_gala_osk_proxy_dbus_arg_info_set_input_purpose_input_purpose, NULL};
static const GDBusArgInfo * const _gala_osk_proxy_dbus_arg_info_set_input_purpose_out[] = {NULL};
static const GDBusMethodInfo _gala_osk_proxy_dbus_method_info_set_input_purpose = {-1, "SetInputPurpose", (GDBusArgInfo **) (&_gala_osk_proxy_dbus_arg_info_set_input_purpose_in), (GDBusArgInfo **) (&_gala_osk_proxy_dbus_arg_info_set_input_purpose_out), NULL};
static const GDBusMethodInfo * const _gala_osk_proxy_dbus_method_info[] = {&_gala_osk_proxy_dbus_method_info_set_enabled, &_gala_osk_proxy_dbus_method_info_reset, &_gala_osk_proxy_dbus_method_info_set_input_purpose, NULL};
static const GDBusArgInfo * const _gala_osk_proxy_dbus_arg_info_hide_requested[] = {NULL};
static const GDBusSignalInfo _gala_osk_proxy_dbus_signal_info_hide_requested = {-1, "HideRequested", (GDBusArgInfo **) (&_gala_osk_proxy_dbus_arg_info_hide_requested), NULL};
static const GDBusArgInfo _gala_osk_proxy_dbus_arg_info_keyval_pressed_keyval = {-1, "keyval", "u", NULL};
static const GDBusArgInfo * const _gala_osk_proxy_dbus_arg_info_keyval_pressed[] = {&_gala_osk_proxy_dbus_arg_info_keyval_pressed_keyval, NULL};
static const GDBusSignalInfo _gala_osk_proxy_dbus_signal_info_keyval_pressed = {-1, "KeyvalPressed", (GDBusArgInfo **) (&_gala_osk_proxy_dbus_arg_info_keyval_pressed), NULL};
static const GDBusArgInfo _gala_osk_proxy_dbus_arg_info_keyval_released_keyval = {-1, "keyval", "u", NULL};
static const GDBusArgInfo * const _gala_osk_proxy_dbus_arg_info_keyval_released[] = {&_gala_osk_proxy_dbus_arg_info_keyval_released_keyval, NULL};
static const GDBusSignalInfo _gala_osk_proxy_dbus_signal_info_keyval_released = {-1, "KeyvalReleased", (GDBusArgInfo **) (&_gala_osk_proxy_dbus_arg_info_keyval_released), NULL};
static const GDBusSignalInfo * const _gala_osk_proxy_dbus_signal_info[] = {&_gala_osk_proxy_dbus_signal_info_hide_requested, &_gala_osk_proxy_dbus_signal_info_keyval_pressed, &_gala_osk_proxy_dbus_signal_info_keyval_released, NULL};
static const GDBusPropertyInfo * const _gala_osk_proxy_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _gala_osk_proxy_dbus_interface_info = {-1, "io.elementary.OSK", (GDBusMethodInfo **) (&_gala_osk_proxy_dbus_method_info), (GDBusSignalInfo **) (&_gala_osk_proxy_dbus_signal_info), (GDBusPropertyInfo **) (&_gala_osk_proxy_dbus_property_info), NULL};
static const GDBusInterfaceVTable _gala_osk_proxy_dbus_interface_vtable = {gala_osk_proxy_dbus_interface_method_call, gala_osk_proxy_dbus_interface_get_property, gala_osk_proxy_dbus_interface_set_property};

void
gala_osk_proxy_set_enabled (GalaOSKProxy* self,
                            gboolean enabled,
                            GAsyncReadyCallback _callback_,
                            gpointer _user_data_)
{
	GalaOSKProxyIface* _iface_;
	_iface_ = GALA_OSK_PROXY_GET_INTERFACE (self);
	if (_iface_->set_enabled) {
		_iface_->set_enabled (self, enabled, _callback_, _user_data_);
	}
}

void
gala_osk_proxy_set_enabled_finish (GalaOSKProxy* self,
                                   GAsyncResult* _res_,
                                   GError** error)
{
	GalaOSKProxyIface* _iface_;
	_iface_ = GALA_OSK_PROXY_GET_INTERFACE (self);
	if (_iface_->set_enabled_finish) {
		_iface_->set_enabled_finish (self, _res_, error);
	}
}

void
gala_osk_proxy_reset (GalaOSKProxy* self,
                      GAsyncReadyCallback _callback_,
                      gpointer _user_data_)
{
	GalaOSKProxyIface* _iface_;
	_iface_ = GALA_OSK_PROXY_GET_INTERFACE (self);
	if (_iface_->reset) {
		_iface_->reset (self, _callback_, _user_data_);
	}
}

void
gala_osk_proxy_reset_finish (GalaOSKProxy* self,
                             GAsyncResult* _res_,
                             GError** error)
{
	GalaOSKProxyIface* _iface_;
	_iface_ = GALA_OSK_PROXY_GET_INTERFACE (self);
	if (_iface_->reset_finish) {
		_iface_->reset_finish (self, _res_, error);
	}
}

void
gala_osk_proxy_set_input_purpose (GalaOSKProxy* self,
                                  IBusInputPurpose input_purpose,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	GalaOSKProxyIface* _iface_;
	_iface_ = GALA_OSK_PROXY_GET_INTERFACE (self);
	if (_iface_->set_input_purpose) {
		_iface_->set_input_purpose (self, input_purpose, _callback_, _user_data_);
	}
}

void
gala_osk_proxy_set_input_purpose_finish (GalaOSKProxy* self,
                                         GAsyncResult* _res_,
                                         GError** error)
{
	GalaOSKProxyIface* _iface_;
	_iface_ = GALA_OSK_PROXY_GET_INTERFACE (self);
	if (_iface_->set_input_purpose_finish) {
		_iface_->set_input_purpose_finish (self, _res_, error);
	}
}

static void
gala_osk_proxy_default_init (GalaOSKProxyIface * iface,
                             gpointer iface_data)
{
	gala_osk_proxy_signals[GALA_OSK_PROXY_HIDE_REQUESTED_SIGNAL] = g_signal_new ("hide-requested", GALA_TYPE_OSK_PROXY, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gala_osk_proxy_signals[GALA_OSK_PROXY_KEYVAL_PRESSED_SIGNAL] = g_signal_new ("keyval-pressed", GALA_TYPE_OSK_PROXY, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__UINT, G_TYPE_NONE, 1, G_TYPE_UINT);
	gala_osk_proxy_signals[GALA_OSK_PROXY_KEYVAL_RELEASED_SIGNAL] = g_signal_new ("keyval-released", GALA_TYPE_OSK_PROXY, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__UINT, G_TYPE_NONE, 1, G_TYPE_UINT);
}

 G_GNUC_NO_INLINE static GType
gala_osk_proxy_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GalaOSKProxyIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gala_osk_proxy_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType gala_osk_proxy_type_id;
	gala_osk_proxy_type_id = g_type_register_static (G_TYPE_INTERFACE, "GalaOSKProxy", &g_define_type_info, G_TYPE_FLAG_NONE);
	g_type_interface_add_prerequisite (gala_osk_proxy_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (gala_osk_proxy_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) gala_osk_proxy_proxy_get_type);
	g_type_set_qdata (gala_osk_proxy_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "io.elementary.OSK");
	g_type_set_qdata (gala_osk_proxy_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_gala_osk_proxy_dbus_interface_info));
	g_type_set_qdata (gala_osk_proxy_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) gala_osk_proxy_register_object);
	return gala_osk_proxy_type_id;
}

GType
gala_osk_proxy_get_type (void)
{
	static gsize gala_osk_proxy_type_id__once = 0;
	if (g_once_init_enter (&gala_osk_proxy_type_id__once)) {
		GType gala_osk_proxy_type_id;
		gala_osk_proxy_type_id = gala_osk_proxy_get_type_once ();
		g_once_init_leave (&gala_osk_proxy_type_id__once, gala_osk_proxy_type_id);
	}
	return gala_osk_proxy_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (GalaOSKProxyProxy, gala_osk_proxy_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (GALA_TYPE_OSK_PROXY, gala_osk_proxy_proxy_gala_osk_proxy_interface_init) )
static void
gala_osk_proxy_proxy_class_init (GalaOSKProxyProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = gala_osk_proxy_proxy_g_signal;
}

static void
_dbus_handle_gala_osk_proxy_hide_requested (GalaOSKProxy* self,
                                            GVariant* parameters)
{
	GVariantIter _arguments_iter;
	g_variant_iter_init (&_arguments_iter, parameters);
	g_signal_emit_by_name (self, "hide-requested");
}

static void
_dbus_handle_gala_osk_proxy_keyval_pressed (GalaOSKProxy* self,
                                            GVariant* parameters)
{
	GVariantIter _arguments_iter;
	guint keyval = 0U;
	GVariant* _tmp89_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp89_ = g_variant_iter_next_value (&_arguments_iter);
	keyval = g_variant_get_uint32 (_tmp89_);
	g_variant_unref (_tmp89_);
	g_signal_emit_by_name (self, "keyval-pressed", keyval);
}

static void
_dbus_handle_gala_osk_proxy_keyval_released (GalaOSKProxy* self,
                                             GVariant* parameters)
{
	GVariantIter _arguments_iter;
	guint keyval = 0U;
	GVariant* _tmp90_;
	g_variant_iter_init (&_arguments_iter, parameters);
	_tmp90_ = g_variant_iter_next_value (&_arguments_iter);
	keyval = g_variant_get_uint32 (_tmp90_);
	g_variant_unref (_tmp90_);
	g_signal_emit_by_name (self, "keyval-released", keyval);
}

static void
gala_osk_proxy_proxy_g_signal (GDBusProxy* proxy,
                               const gchar* sender_name,
                               const gchar* signal_name,
                               GVariant* parameters)
{
	if (strcmp (signal_name, "HideRequested") == 0) {
		_dbus_handle_gala_osk_proxy_hide_requested ((GalaOSKProxy*) proxy, parameters);
	} else if (strcmp (signal_name, "KeyvalPressed") == 0) {
		_dbus_handle_gala_osk_proxy_keyval_pressed ((GalaOSKProxy*) proxy, parameters);
	} else if (strcmp (signal_name, "KeyvalReleased") == 0) {
		_dbus_handle_gala_osk_proxy_keyval_released ((GalaOSKProxy*) proxy, parameters);
	}
}

static void
gala_osk_proxy_proxy_init (GalaOSKProxyProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_gala_osk_proxy_dbus_interface_info));
}

static void
_vala_g_async_ready_callback (GObject *source_object,
                              GAsyncResult *res,
                              void *user_data)
{
	g_task_return_pointer (user_data, g_object_ref (res), g_object_unref);
	g_object_unref (user_data);
}

static void
gala_osk_proxy_proxy_set_enabled_async (GalaOSKProxy* self,
                                        gboolean enabled,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	G_DBUS_ERROR;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "io.elementary.OSK", "SetEnabled");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (enabled));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static void
gala_osk_proxy_proxy_set_enabled_finish (GalaOSKProxy* self,
                                         GAsyncResult* _res_,
                                         GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	g_object_unref (_reply_message);
}

static void
gala_osk_proxy_proxy_reset_async (GalaOSKProxy* self,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	G_DBUS_ERROR;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "io.elementary.OSK", "Reset");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static void
gala_osk_proxy_proxy_reset_finish (GalaOSKProxy* self,
                                   GAsyncResult* _res_,
                                   GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	g_object_unref (_reply_message);
}

static void
gala_osk_proxy_proxy_set_input_purpose_async (GalaOSKProxy* self,
                                              IBusInputPurpose input_purpose,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	G_DBUS_ERROR;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "io.elementary.OSK", "SetInputPurpose");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (input_purpose));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static void
gala_osk_proxy_proxy_set_input_purpose_finish (GalaOSKProxy* self,
                                               GAsyncResult* _res_,
                                               GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	g_object_unref (_reply_message);
}

static void
gala_osk_proxy_proxy_gala_osk_proxy_interface_init (GalaOSKProxyIface* iface)
{
	iface->set_enabled = gala_osk_proxy_proxy_set_enabled_async;
	iface->set_enabled_finish = gala_osk_proxy_proxy_set_enabled_finish;
	iface->reset = gala_osk_proxy_proxy_reset_async;
	iface->reset_finish = gala_osk_proxy_proxy_reset_finish;
	iface->set_input_purpose = gala_osk_proxy_proxy_set_input_purpose_async;
	iface->set_input_purpose_finish = gala_osk_proxy_proxy_set_input_purpose_finish;
}

static void
_dbus_gala_osk_proxy_set_enabled (GalaOSKProxy* self,
                                  GVariant* _parameters_,
                                  GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	GalaOskProxySetEnabledReadyData* _ready_data;
	GVariant* _tmp91_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (GalaOskProxySetEnabledReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp91_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->enabled = g_variant_get_boolean (_tmp91_);
	g_variant_unref (_tmp91_);
	gala_osk_proxy_set_enabled (self, _ready_data->enabled, (GAsyncReadyCallback) _dbus_gala_osk_proxy_set_enabled_ready, _ready_data);
}

static void
_dbus_gala_osk_proxy_set_enabled_ready (GObject * source_object,
                                        GAsyncResult * _res_,
                                        gpointer _user_data_)
{
	GalaOskProxySetEnabledReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	gala_osk_proxy_set_enabled_finish ((GalaOSKProxy*) source_object, _res_, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	g_slice_free (GalaOskProxySetEnabledReadyData, _ready_data);
}

static void
_dbus_gala_osk_proxy_reset (GalaOSKProxy* self,
                            GVariant* _parameters_,
                            GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	GalaOskProxyResetReadyData* _ready_data;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (GalaOskProxyResetReadyData);
	_ready_data->_invocation_ = invocation;
	gala_osk_proxy_reset (self, (GAsyncReadyCallback) _dbus_gala_osk_proxy_reset_ready, _ready_data);
}

static void
_dbus_gala_osk_proxy_reset_ready (GObject * source_object,
                                  GAsyncResult * _res_,
                                  gpointer _user_data_)
{
	GalaOskProxyResetReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	gala_osk_proxy_reset_finish ((GalaOSKProxy*) source_object, _res_, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	g_slice_free (GalaOskProxyResetReadyData, _ready_data);
}

static void
_dbus_gala_osk_proxy_set_input_purpose (GalaOSKProxy* self,
                                        GVariant* _parameters_,
                                        GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	GalaOskProxySetInputPurposeReadyData* _ready_data;
	GVariant* _tmp92_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (GalaOskProxySetInputPurposeReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp92_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->input_purpose = g_variant_get_int32 (_tmp92_);
	g_variant_unref (_tmp92_);
	gala_osk_proxy_set_input_purpose (self, _ready_data->input_purpose, (GAsyncReadyCallback) _dbus_gala_osk_proxy_set_input_purpose_ready, _ready_data);
}

static void
_dbus_gala_osk_proxy_set_input_purpose_ready (GObject * source_object,
                                              GAsyncResult * _res_,
                                              gpointer _user_data_)
{
	GalaOskProxySetInputPurposeReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	gala_osk_proxy_set_input_purpose_finish ((GalaOSKProxy*) source_object, _res_, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	g_slice_free (GalaOskProxySetInputPurposeReadyData, _ready_data);
}

static void
gala_osk_proxy_dbus_interface_method_call (GDBusConnection* connection,
                                           const gchar* sender,
                                           const gchar* object_path,
                                           const gchar* interface_name,
                                           const gchar* method_name,
                                           GVariant* parameters,
                                           GDBusMethodInvocation* invocation,
                                           gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "SetEnabled") == 0) {
		_dbus_gala_osk_proxy_set_enabled (object, parameters, invocation);
	} else if (strcmp (method_name, "Reset") == 0) {
		_dbus_gala_osk_proxy_reset (object, parameters, invocation);
	} else if (strcmp (method_name, "SetInputPurpose") == 0) {
		_dbus_gala_osk_proxy_set_input_purpose (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
gala_osk_proxy_dbus_interface_get_property (GDBusConnection* connection,
                                            const gchar* sender,
                                            const gchar* object_path,
                                            const gchar* interface_name,
                                            const gchar* property_name,
                                            GError** error,
                                            gpointer user_data)
{
	return NULL;
}

static gboolean
gala_osk_proxy_dbus_interface_set_property (GDBusConnection* connection,
                                            const gchar* sender,
                                            const gchar* object_path,
                                            const gchar* interface_name,
                                            const gchar* property_name,
                                            GVariant* value,
                                            GError** error,
                                            gpointer user_data)
{
	return FALSE;
}

static void
_dbus_gala_osk_proxy_hide_requested (GObject* _sender,
                                     gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "io.elementary.OSK", "HideRequested", _arguments, NULL);
}

static void
_dbus_gala_osk_proxy_keyval_pressed (GObject* _sender,
                                     guint keyval,
                                     gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (keyval));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "io.elementary.OSK", "KeyvalPressed", _arguments, NULL);
}

static void
_dbus_gala_osk_proxy_keyval_released (GObject* _sender,
                                      guint keyval,
                                      gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (keyval));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "io.elementary.OSK", "KeyvalReleased", _arguments, NULL);
}

guint
gala_osk_proxy_register_object (gpointer object,
                                GDBusConnection* connection,
                                const gchar* path,
                                GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_gala_osk_proxy_dbus_interface_info), &_gala_osk_proxy_dbus_interface_vtable, data, _gala_osk_proxy_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "hide-requested", (GCallback) _dbus_gala_osk_proxy_hide_requested, data);
	g_signal_connect (object, "keyval-pressed", (GCallback) _dbus_gala_osk_proxy_keyval_pressed, data);
	g_signal_connect (object, "keyval-released", (GCallback) _dbus_gala_osk_proxy_keyval_released, data);
	return result;
}

static void
_gala_osk_proxy_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_gala_osk_proxy_hide_requested, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_gala_osk_proxy_keyval_pressed, data);
	g_signal_handlers_disconnect_by_func (data[0], _dbus_gala_osk_proxy_keyval_released, data);
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

