Logo Search packages:      
Sourcecode: caribou version File versions  Download package

caribou-gtk-module.c

/* caribou-gtk-module.c generated by valac 0.13.3, the Vala compiler
 * generated from caribou-gtk-module.vala, do not modify */


#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <string.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <stdio.h>
#include <gdk/gdkx.h>
#include <atk/atk.h>
#include <gobject/gvaluecollector.h>


#define CARIBOU_TYPE_KEYBOARD (caribou_keyboard_get_type ())
#define CARIBOU_KEYBOARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CARIBOU_TYPE_KEYBOARD, CaribouKeyboard))
#define CARIBOU_IS_KEYBOARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CARIBOU_TYPE_KEYBOARD))
#define CARIBOU_KEYBOARD_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CARIBOU_TYPE_KEYBOARD, CaribouKeyboardIface))

typedef struct _CaribouKeyboard CaribouKeyboard;
typedef struct _CaribouKeyboardIface CaribouKeyboardIface;

#define CARIBOU_TYPE_KEYBOARD_PROXY (caribou_keyboard_proxy_get_type ())
typedef GDBusProxy CaribouKeyboardProxy;
typedef GDBusProxyClass CaribouKeyboardProxyClass;

#define CARIBOU_TYPE_GTK_MODULE (caribou_gtk_module_get_type ())
#define CARIBOU_GTK_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CARIBOU_TYPE_GTK_MODULE, CaribouGtkModule))
#define CARIBOU_GTK_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CARIBOU_TYPE_GTK_MODULE, CaribouGtkModuleClass))
#define CARIBOU_IS_GTK_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CARIBOU_TYPE_GTK_MODULE))
#define CARIBOU_IS_GTK_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CARIBOU_TYPE_GTK_MODULE))
#define CARIBOU_GTK_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CARIBOU_TYPE_GTK_MODULE, CaribouGtkModuleClass))

typedef struct _CaribouGtkModule CaribouGtkModule;
typedef struct _CaribouGtkModuleClass CaribouGtkModuleClass;
typedef struct _CaribouGtkModulePrivate CaribouGtkModulePrivate;
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
typedef struct _Block1Data Block1Data;
#define _caribou_gtk_module_unref0(var) ((var == NULL) ? NULL : (var = (caribou_gtk_module_unref (var), NULL)))
typedef struct _CaribouParamSpecGtkModule CaribouParamSpecGtkModule;

struct _CaribouKeyboardIface {
      GTypeInterface parent_iface;
      void (*set_cursor_location) (CaribouKeyboard* self, gint x, gint y, gint w, gint h, GError** error);
      void (*set_entry_location) (CaribouKeyboard* self, gint x, gint y, gint w, gint h, GError** error);
      void (*show) (CaribouKeyboard* self, guint32 timestamp, GError** error);
      void (*hide) (CaribouKeyboard* self, guint32 timestamp, GError** error);
};

struct _CaribouGtkModule {
      GTypeInstance parent_instance;
      volatile int ref_count;
      CaribouGtkModulePrivate * priv;
};

struct _CaribouGtkModuleClass {
      GTypeClass parent_class;
      void (*finalize) (CaribouGtkModule *self);
};

struct _CaribouGtkModulePrivate {
      GHashTable* windows;
      CaribouKeyboard* keyboard;
      GdkDisplay* display;
};

struct _Block1Data {
      int _ref_count_;
      CaribouGtkModule * self;
      GtkWindow* window;
};

struct _CaribouParamSpecGtkModule {
      GParamSpec parent_instance;
};


static gpointer caribou_gtk_module_parent_class = NULL;

GType caribou_keyboard_proxy_get_type (void) G_GNUC_CONST;
guint caribou_keyboard_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
GType caribou_keyboard_get_type (void) G_GNUC_CONST;
void caribou_keyboard_set_cursor_location (CaribouKeyboard* self, gint x, gint y, gint w, gint h, GError** error);
void caribou_keyboard_set_entry_location (CaribouKeyboard* self, gint x, gint y, gint w, gint h, GError** error);
void caribou_keyboard_show (CaribouKeyboard* self, guint32 timestamp, GError** error);
void caribou_keyboard_hide (CaribouKeyboard* self, guint32 timestamp, GError** error);
static void caribou_keyboard_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters);
static void caribou_keyboard_proxy_set_cursor_location (CaribouKeyboard* self, gint x, gint y, gint w, gint h, GError** error);
static void caribou_keyboard_proxy_set_entry_location (CaribouKeyboard* self, gint x, gint y, gint w, gint h, GError** error);
static void caribou_keyboard_proxy_show (CaribouKeyboard* self, guint32 timestamp, GError** error);
static void caribou_keyboard_proxy_hide (CaribouKeyboard* self, guint32 timestamp, GError** error);
static void caribou_keyboard_proxy_caribou_keyboard_interface_init (CaribouKeyboardIface* iface);
static void _dbus_caribou_keyboard_set_cursor_location (CaribouKeyboard* self, GVariant* parameters, GDBusMethodInvocation* invocation);
static void _dbus_caribou_keyboard_set_entry_location (CaribouKeyboard* self, GVariant* parameters, GDBusMethodInvocation* invocation);
static void _dbus_caribou_keyboard_show (CaribouKeyboard* self, GVariant* parameters, GDBusMethodInvocation* invocation);
static void _dbus_caribou_keyboard_hide (CaribouKeyboard* self, GVariant* parameters, GDBusMethodInvocation* invocation);
static void caribou_keyboard_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* caribou_keyboard_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 caribou_keyboard_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 _caribou_keyboard_unregister_object (gpointer user_data);
gpointer caribou_gtk_module_ref (gpointer instance);
void caribou_gtk_module_unref (gpointer instance);
GParamSpec* caribou_param_spec_gtk_module (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void caribou_value_set_gtk_module (GValue* value, gpointer v_object);
void caribou_value_take_gtk_module (GValue* value, gpointer v_object);
gpointer caribou_value_get_gtk_module (const GValue* value);
GType caribou_gtk_module_get_type (void) G_GNUC_CONST;
#define CARIBOU_GTK_MODULE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CARIBOU_TYPE_GTK_MODULE, CaribouGtkModulePrivate))
enum  {
      CARIBOU_GTK_MODULE_DUMMY_PROPERTY
};
CaribouGtkModule* caribou_gtk_module_new (void);
CaribouGtkModule* caribou_gtk_module_construct (GType object_type);
static void _g_object_unref0_ (gpointer var);
static void caribou_gtk_module_callback (CaribouGtkModule* self, GObject* obj, GAsyncResult* res);
static void _caribou_gtk_module_callback_gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static GdkFilterReturn caribou_gtk_module_event_filter (CaribouGtkModule* self, GdkXEvent* xevent, GdkEvent* evt);
static GdkFilterReturn _caribou_gtk_module_event_filter_gdk_filter_func (GdkXEvent* xevent, GdkEvent* event, gpointer self);
static void caribou_gtk_module_do_focus_change (CaribouGtkModule* self, GtkWidget* widget);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (Block1Data* _data1_);
static void caribou_gtk_module_toplevel_focus_changed (CaribouGtkModule* self, GObject* obj, GParamSpec* prop);
static void _caribou_gtk_module_toplevel_focus_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void caribou_gtk_module_window_focus_changed (CaribouGtkModule* self, GtkWindow* window, GtkWidget* widget);
static void _caribou_gtk_module_window_focus_changed_gtk_window_set_focus (GtkWindow* _sender, GtkWidget* focus, gpointer self);
static void ___lambda0_ (Block1Data* _data1_);
static void ____lambda0__gtk_widget_destroy (GtkWidget* _sender, gpointer self);
static void caribou_gtk_module_get_origin_geometry (CaribouGtkModule* self, GdkWindow* window, gint* x, gint* y, gint* w, gint* h);
void caribou_gtk_module_unload (CaribouGtkModule* self);
static void caribou_gtk_module_finalize (CaribouGtkModule* obj);

static const GDBusArgInfo _caribou_keyboard_dbus_arg_info_set_cursor_location_x = {-1, "x", "i"};
static const GDBusArgInfo _caribou_keyboard_dbus_arg_info_set_cursor_location_y = {-1, "y", "i"};
static const GDBusArgInfo _caribou_keyboard_dbus_arg_info_set_cursor_location_w = {-1, "w", "i"};
static const GDBusArgInfo _caribou_keyboard_dbus_arg_info_set_cursor_location_h = {-1, "h", "i"};
static const GDBusArgInfo * const _caribou_keyboard_dbus_arg_info_set_cursor_location_in[] = {&_caribou_keyboard_dbus_arg_info_set_cursor_location_x, &_caribou_keyboard_dbus_arg_info_set_cursor_location_y, &_caribou_keyboard_dbus_arg_info_set_cursor_location_w, &_caribou_keyboard_dbus_arg_info_set_cursor_location_h, NULL};
static const GDBusArgInfo * const _caribou_keyboard_dbus_arg_info_set_cursor_location_out[] = {NULL};
static const GDBusMethodInfo _caribou_keyboard_dbus_method_info_set_cursor_location = {-1, "SetCursorLocation", (GDBusArgInfo **) (&_caribou_keyboard_dbus_arg_info_set_cursor_location_in), (GDBusArgInfo **) (&_caribou_keyboard_dbus_arg_info_set_cursor_location_out)};
static const GDBusArgInfo _caribou_keyboard_dbus_arg_info_set_entry_location_x = {-1, "x", "i"};
static const GDBusArgInfo _caribou_keyboard_dbus_arg_info_set_entry_location_y = {-1, "y", "i"};
static const GDBusArgInfo _caribou_keyboard_dbus_arg_info_set_entry_location_w = {-1, "w", "i"};
static const GDBusArgInfo _caribou_keyboard_dbus_arg_info_set_entry_location_h = {-1, "h", "i"};
static const GDBusArgInfo * const _caribou_keyboard_dbus_arg_info_set_entry_location_in[] = {&_caribou_keyboard_dbus_arg_info_set_entry_location_x, &_caribou_keyboard_dbus_arg_info_set_entry_location_y, &_caribou_keyboard_dbus_arg_info_set_entry_location_w, &_caribou_keyboard_dbus_arg_info_set_entry_location_h, NULL};
static const GDBusArgInfo * const _caribou_keyboard_dbus_arg_info_set_entry_location_out[] = {NULL};
static const GDBusMethodInfo _caribou_keyboard_dbus_method_info_set_entry_location = {-1, "SetEntryLocation", (GDBusArgInfo **) (&_caribou_keyboard_dbus_arg_info_set_entry_location_in), (GDBusArgInfo **) (&_caribou_keyboard_dbus_arg_info_set_entry_location_out)};
static const GDBusArgInfo _caribou_keyboard_dbus_arg_info_show_timestamp = {-1, "timestamp", "u"};
static const GDBusArgInfo * const _caribou_keyboard_dbus_arg_info_show_in[] = {&_caribou_keyboard_dbus_arg_info_show_timestamp, NULL};
static const GDBusArgInfo * const _caribou_keyboard_dbus_arg_info_show_out[] = {NULL};
static const GDBusMethodInfo _caribou_keyboard_dbus_method_info_show = {-1, "Show", (GDBusArgInfo **) (&_caribou_keyboard_dbus_arg_info_show_in), (GDBusArgInfo **) (&_caribou_keyboard_dbus_arg_info_show_out)};
static const GDBusArgInfo _caribou_keyboard_dbus_arg_info_hide_timestamp = {-1, "timestamp", "u"};
static const GDBusArgInfo * const _caribou_keyboard_dbus_arg_info_hide_in[] = {&_caribou_keyboard_dbus_arg_info_hide_timestamp, NULL};
static const GDBusArgInfo * const _caribou_keyboard_dbus_arg_info_hide_out[] = {NULL};
static const GDBusMethodInfo _caribou_keyboard_dbus_method_info_hide = {-1, "Hide", (GDBusArgInfo **) (&_caribou_keyboard_dbus_arg_info_hide_in), (GDBusArgInfo **) (&_caribou_keyboard_dbus_arg_info_hide_out)};
static const GDBusMethodInfo * const _caribou_keyboard_dbus_method_info[] = {&_caribou_keyboard_dbus_method_info_set_cursor_location, &_caribou_keyboard_dbus_method_info_set_entry_location, &_caribou_keyboard_dbus_method_info_show, &_caribou_keyboard_dbus_method_info_hide, NULL};
static const GDBusSignalInfo * const _caribou_keyboard_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _caribou_keyboard_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _caribou_keyboard_dbus_interface_info = {-1, "org.gnome.Caribou.Keyboard", (GDBusMethodInfo **) (&_caribou_keyboard_dbus_method_info), (GDBusSignalInfo **) (&_caribou_keyboard_dbus_signal_info), (GDBusPropertyInfo **) (&_caribou_keyboard_dbus_property_info)};
static const GDBusInterfaceVTable _caribou_keyboard_dbus_interface_vtable = {caribou_keyboard_dbus_interface_method_call, caribou_keyboard_dbus_interface_get_property, caribou_keyboard_dbus_interface_set_property};

void caribou_keyboard_set_cursor_location (CaribouKeyboard* self, gint x, gint y, gint w, gint h, GError** error) {
      CARIBOU_KEYBOARD_GET_INTERFACE (self)->set_cursor_location (self, x, y, w, h, error);
}


void caribou_keyboard_set_entry_location (CaribouKeyboard* self, gint x, gint y, gint w, gint h, GError** error) {
      CARIBOU_KEYBOARD_GET_INTERFACE (self)->set_entry_location (self, x, y, w, h, error);
}


void caribou_keyboard_show (CaribouKeyboard* self, guint32 timestamp, GError** error) {
      CARIBOU_KEYBOARD_GET_INTERFACE (self)->show (self, timestamp, error);
}


void caribou_keyboard_hide (CaribouKeyboard* self, guint32 timestamp, GError** error) {
      CARIBOU_KEYBOARD_GET_INTERFACE (self)->hide (self, timestamp, error);
}


static void caribou_keyboard_base_init (CaribouKeyboardIface * iface) {
      static gboolean initialized = FALSE;
      if (!initialized) {
            initialized = TRUE;
      }
}


GType caribou_keyboard_get_type (void) {
      static volatile gsize caribou_keyboard_type_id__volatile = 0;
      if (g_once_init_enter (&caribou_keyboard_type_id__volatile)) {
            static const GTypeInfo g_define_type_info = { sizeof (CaribouKeyboardIface), (GBaseInitFunc) caribou_keyboard_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
            GType caribou_keyboard_type_id;
            caribou_keyboard_type_id = g_type_register_static (G_TYPE_INTERFACE, "CaribouKeyboard", &g_define_type_info, 0);
            g_type_interface_add_prerequisite (caribou_keyboard_type_id, G_TYPE_OBJECT);
            g_type_set_qdata (caribou_keyboard_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) caribou_keyboard_proxy_get_type);
            g_type_set_qdata (caribou_keyboard_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.gnome.Caribou.Keyboard");
            g_type_set_qdata (caribou_keyboard_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) caribou_keyboard_register_object);
            g_once_init_leave (&caribou_keyboard_type_id__volatile, caribou_keyboard_type_id);
      }
      return caribou_keyboard_type_id__volatile;
}


G_DEFINE_TYPE_EXTENDED (CaribouKeyboardProxy, caribou_keyboard_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (CARIBOU_TYPE_KEYBOARD, caribou_keyboard_proxy_caribou_keyboard_interface_init) )
static void caribou_keyboard_proxy_class_init (CaribouKeyboardProxyClass* klass) {
      G_DBUS_PROXY_CLASS (klass)->g_signal = caribou_keyboard_proxy_g_signal;
}


static void caribou_keyboard_proxy_g_signal (GDBusProxy* proxy, const gchar* sender_name, const gchar* signal_name, GVariant* parameters) {
}


static void caribou_keyboard_proxy_init (CaribouKeyboardProxy* self) {
}


static void caribou_keyboard_proxy_set_cursor_location (CaribouKeyboard* self, gint x, gint y, gint w, gint h, GError** error) {
      GDBusMessage *_message;
      GVariant *_arguments;
      GVariantBuilder _arguments_builder;
      GDBusMessage *_reply_message;
      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), "org.gnome.Caribou.Keyboard", "SetCursorLocation");
      g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
      g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (x));
      g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (y));
      g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (w));
      g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (h));
      _arguments = g_variant_builder_end (&_arguments_builder);
      g_dbus_message_set_body (_message, _arguments);
      _reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
      g_object_unref (_message);
      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 caribou_keyboard_proxy_set_entry_location (CaribouKeyboard* self, gint x, gint y, gint w, gint h, GError** error) {
      GDBusMessage *_message;
      GVariant *_arguments;
      GVariantBuilder _arguments_builder;
      GDBusMessage *_reply_message;
      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), "org.gnome.Caribou.Keyboard", "SetEntryLocation");
      g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
      g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (x));
      g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (y));
      g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (w));
      g_variant_builder_add_value (&_arguments_builder, g_variant_new_int32 (h));
      _arguments = g_variant_builder_end (&_arguments_builder);
      g_dbus_message_set_body (_message, _arguments);
      _reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
      g_object_unref (_message);
      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 caribou_keyboard_proxy_show (CaribouKeyboard* self, guint32 timestamp, GError** error) {
      GDBusMessage *_message;
      GVariant *_arguments;
      GVariantBuilder _arguments_builder;
      GDBusMessage *_reply_message;
      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), "org.gnome.Caribou.Keyboard", "Show");
      g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
      g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (timestamp));
      _arguments = g_variant_builder_end (&_arguments_builder);
      g_dbus_message_set_body (_message, _arguments);
      _reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
      g_object_unref (_message);
      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 caribou_keyboard_proxy_hide (CaribouKeyboard* self, guint32 timestamp, GError** error) {
      GDBusMessage *_message;
      GVariant *_arguments;
      GVariantBuilder _arguments_builder;
      GDBusMessage *_reply_message;
      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), "org.gnome.Caribou.Keyboard", "Hide");
      g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
      g_variant_builder_add_value (&_arguments_builder, g_variant_new_uint32 (timestamp));
      _arguments = g_variant_builder_end (&_arguments_builder);
      g_dbus_message_set_body (_message, _arguments);
      _reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
      g_object_unref (_message);
      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 caribou_keyboard_proxy_caribou_keyboard_interface_init (CaribouKeyboardIface* iface) {
      iface->set_cursor_location = caribou_keyboard_proxy_set_cursor_location;
      iface->set_entry_location = caribou_keyboard_proxy_set_entry_location;
      iface->show = caribou_keyboard_proxy_show;
      iface->hide = caribou_keyboard_proxy_hide;
}


static void _dbus_caribou_keyboard_set_cursor_location (CaribouKeyboard* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
      GError* error = NULL;
      GVariantIter _arguments_iter;
      gint x = 0;
      GVariant* _tmp0_;
      gint y = 0;
      GVariant* _tmp1_;
      gint w = 0;
      GVariant* _tmp2_;
      gint h = 0;
      GVariant* _tmp3_;
      GDBusMessage* _reply_message;
      GVariant* _reply;
      GVariantBuilder _reply_builder;
      g_variant_iter_init (&_arguments_iter, parameters);
      _tmp0_ = g_variant_iter_next_value (&_arguments_iter);
      x = g_variant_get_int32 (_tmp0_);
      g_variant_unref (_tmp0_);
      _tmp1_ = g_variant_iter_next_value (&_arguments_iter);
      y = g_variant_get_int32 (_tmp1_);
      g_variant_unref (_tmp1_);
      _tmp2_ = g_variant_iter_next_value (&_arguments_iter);
      w = g_variant_get_int32 (_tmp2_);
      g_variant_unref (_tmp2_);
      _tmp3_ = g_variant_iter_next_value (&_arguments_iter);
      h = g_variant_get_int32 (_tmp3_);
      g_variant_unref (_tmp3_);
      caribou_keyboard_set_cursor_location (self, x, y, w, h, &error);
      if (error) {
            g_dbus_method_invocation_return_gerror (invocation, error);
            return;
      }
      _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);
}


static void _dbus_caribou_keyboard_set_entry_location (CaribouKeyboard* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
      GError* error = NULL;
      GVariantIter _arguments_iter;
      gint x = 0;
      GVariant* _tmp4_;
      gint y = 0;
      GVariant* _tmp5_;
      gint w = 0;
      GVariant* _tmp6_;
      gint h = 0;
      GVariant* _tmp7_;
      GDBusMessage* _reply_message;
      GVariant* _reply;
      GVariantBuilder _reply_builder;
      g_variant_iter_init (&_arguments_iter, parameters);
      _tmp4_ = g_variant_iter_next_value (&_arguments_iter);
      x = g_variant_get_int32 (_tmp4_);
      g_variant_unref (_tmp4_);
      _tmp5_ = g_variant_iter_next_value (&_arguments_iter);
      y = g_variant_get_int32 (_tmp5_);
      g_variant_unref (_tmp5_);
      _tmp6_ = g_variant_iter_next_value (&_arguments_iter);
      w = g_variant_get_int32 (_tmp6_);
      g_variant_unref (_tmp6_);
      _tmp7_ = g_variant_iter_next_value (&_arguments_iter);
      h = g_variant_get_int32 (_tmp7_);
      g_variant_unref (_tmp7_);
      caribou_keyboard_set_entry_location (self, x, y, w, h, &error);
      if (error) {
            g_dbus_method_invocation_return_gerror (invocation, error);
            return;
      }
      _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);
}


static void _dbus_caribou_keyboard_show (CaribouKeyboard* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
      GError* error = NULL;
      GVariantIter _arguments_iter;
      guint32 timestamp = 0U;
      GVariant* _tmp8_;
      GDBusMessage* _reply_message;
      GVariant* _reply;
      GVariantBuilder _reply_builder;
      g_variant_iter_init (&_arguments_iter, parameters);
      _tmp8_ = g_variant_iter_next_value (&_arguments_iter);
      timestamp = g_variant_get_uint32 (_tmp8_);
      g_variant_unref (_tmp8_);
      caribou_keyboard_show (self, timestamp, &error);
      if (error) {
            g_dbus_method_invocation_return_gerror (invocation, error);
            return;
      }
      _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);
}


static void _dbus_caribou_keyboard_hide (CaribouKeyboard* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
      GError* error = NULL;
      GVariantIter _arguments_iter;
      guint32 timestamp = 0U;
      GVariant* _tmp9_;
      GDBusMessage* _reply_message;
      GVariant* _reply;
      GVariantBuilder _reply_builder;
      g_variant_iter_init (&_arguments_iter, parameters);
      _tmp9_ = g_variant_iter_next_value (&_arguments_iter);
      timestamp = g_variant_get_uint32 (_tmp9_);
      g_variant_unref (_tmp9_);
      caribou_keyboard_hide (self, timestamp, &error);
      if (error) {
            g_dbus_method_invocation_return_gerror (invocation, error);
            return;
      }
      _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);
}


static void caribou_keyboard_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, "SetCursorLocation") == 0) {
            _dbus_caribou_keyboard_set_cursor_location (object, parameters, invocation);
      } else if (strcmp (method_name, "SetEntryLocation") == 0) {
            _dbus_caribou_keyboard_set_entry_location (object, parameters, invocation);
      } else if (strcmp (method_name, "Show") == 0) {
            _dbus_caribou_keyboard_show (object, parameters, invocation);
      } else if (strcmp (method_name, "Hide") == 0) {
            _dbus_caribou_keyboard_hide (object, parameters, invocation);
      } else {
            g_object_unref (invocation);
      }
}


static GVariant* caribou_keyboard_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) {
      gpointer* data;
      gpointer object;
      data = user_data;
      object = data[0];
      return NULL;
}


static gboolean caribou_keyboard_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) {
      gpointer* data;
      gpointer object;
      data = user_data;
      object = data[0];
      return FALSE;
}


guint caribou_keyboard_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 *) (&_caribou_keyboard_dbus_interface_info), &_caribou_keyboard_dbus_interface_vtable, data, _caribou_keyboard_unregister_object, error);
      if (!result) {
            return 0;
      }
      return result;
}


static void _caribou_keyboard_unregister_object (gpointer user_data) {
      gpointer* data;
      data = user_data;
      g_object_unref (data[0]);
      g_object_unref (data[1]);
      g_free (data[2]);
      g_free (data);
}


static void _g_object_unref0_ (gpointer var) {
      (var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}


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


static void _caribou_gtk_module_callback_gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
      caribou_gtk_module_callback (self, source_object, res);
      caribou_gtk_module_unref (self);
}


CaribouGtkModule* caribou_gtk_module_construct (GType object_type) {
      CaribouGtkModule* self = NULL;
      GHashTable* _tmp0_;
      GdkDisplay* _tmp1_ = NULL;
      GdkDisplay* _tmp2_;
      GError * _inner_error_ = NULL;
      self = (CaribouGtkModule*) g_type_create_instance (object_type);
      _tmp0_ = g_hash_table_new_full (NULL, NULL, _g_object_unref0_, NULL);
      _g_hash_table_unref0 (self->priv->windows);
      self->priv->windows = _tmp0_;
      _tmp1_ = gdk_display_get_default ();
      _tmp2_ = _g_object_ref0 (_tmp1_);
      _g_object_unref0 (self->priv->display);
      self->priv->display = _tmp2_;
      g_async_initable_new_async (CARIBOU_TYPE_KEYBOARD_PROXY, 0, NULL, _caribou_gtk_module_callback_gasync_ready_callback, caribou_gtk_module_ref (self), "g-flags", 0, "g-name", "org.gnome.Caribou.Keyboard", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/gnome/Caribou/Keyboard", "g-interface-name", "org.gnome.Caribou.Keyboard", NULL);
      return self;
}


CaribouGtkModule* caribou_gtk_module_new (void) {
      return caribou_gtk_module_construct (CARIBOU_TYPE_GTK_MODULE);
}


static GdkFilterReturn _caribou_gtk_module_event_filter_gdk_filter_func (GdkXEvent* xevent, GdkEvent* event, gpointer self) {
      GdkFilterReturn result;
      result = caribou_gtk_module_event_filter (self, xevent, event);
      return result;
}


static void caribou_gtk_module_callback (CaribouGtkModule* self, GObject* obj, GAsyncResult* res) {
      GList* _tmp7_ = NULL;
      GList* toplevels;
      GList* _tmp8_;
      GError * _inner_error_ = NULL;
      g_return_if_fail (self != NULL);
      g_return_if_fail (res != NULL);
      {
            GAsyncResult* _tmp0_;
            CaribouKeyboard* _tmp1_ = NULL;
            CaribouKeyboard* _tmp2_ = NULL;
            CaribouKeyboard* _tmp3_;
            _tmp0_ = res;
            _tmp1_ = g_async_result_get_source_object (_tmp0_);
            _tmp2_ = g_async_initable_new_finish (_tmp1_, _tmp0_, &_inner_error_);
            g_object_unref (_tmp1_);
            _tmp3_ = (CaribouKeyboard*) _tmp2_;
            if (_inner_error_ != NULL) {
                  goto __catch0_g_error;
            }
            _g_object_unref0 (self->priv->keyboard);
            self->priv->keyboard = _tmp3_;
      }
      goto __finally0;
      __catch0_g_error:
      {
            GError* e = NULL;
            FILE* _tmp4_;
            GError* _tmp5_;
            const gchar* _tmp6_;
            e = _inner_error_;
            _inner_error_ = NULL;
            _tmp4_ = stderr;
            _tmp5_ = e;
            _tmp6_ = _tmp5_->message;
            fprintf (_tmp4_, "%s\n", _tmp6_);
            _g_error_free0 (e);
            return;
      }
      __finally0:
      if (_inner_error_ != NULL) {
            g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
            g_clear_error (&_inner_error_);
            return;
      }
      gdk_window_add_filter (NULL, _caribou_gtk_module_event_filter_gdk_filter_func, self);
      _tmp7_ = gtk_window_list_toplevels ();
      toplevels = _tmp7_;
      _tmp8_ = toplevels;
      {
            GList* w_collection = NULL;
            GList* w_it = NULL;
            w_collection = _tmp8_;
            for (w_it = w_collection; w_it != NULL; w_it = w_it->next) {
                  GtkWindow* w = NULL;
                  w = (GtkWindow*) w_it->data;
                  {
                        GtkWindow* _tmp9_;
                        gboolean _tmp10_ = FALSE;
                        gboolean _tmp11_;
                        _tmp9_ = w;
                        g_object_get (_tmp9_, "has-toplevel-focus", &_tmp10_, NULL);
                        _tmp11_ = _tmp10_;
                        if (_tmp11_) {
                              GtkWindow* _tmp12_;
                              GtkWidget* _tmp13_ = NULL;
                              _tmp12_ = w;
                              _tmp13_ = gtk_window_get_focus (_tmp12_);
                              caribou_gtk_module_do_focus_change (self, _tmp13_);
                              break;
                        }
                  }
            }
      }
      _g_list_free0 (toplevels);
}


static Block1Data* block1_data_ref (Block1Data* _data1_) {
      g_atomic_int_inc (&_data1_->_ref_count_);
      return _data1_;
}


static void block1_data_unref (Block1Data* _data1_) {
      if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
            _caribou_gtk_module_unref0 (_data1_->self);
            _g_object_unref0 (_data1_->window);
            g_slice_free (Block1Data, _data1_);
      }
}


static void _caribou_gtk_module_toplevel_focus_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
      caribou_gtk_module_toplevel_focus_changed (self, _sender, pspec);
}


static void _caribou_gtk_module_window_focus_changed_gtk_window_set_focus (GtkWindow* _sender, GtkWidget* focus, gpointer self) {
      caribou_gtk_module_window_focus_changed (self, _sender, focus);
}


static void ___lambda0_ (Block1Data* _data1_) {
      CaribouGtkModule * self;
      GHashTable* _tmp0_;
      GtkWindow* _tmp1_;
      self = _data1_->self;
      _tmp0_ = self->priv->windows;
      _tmp1_ = _data1_->window;
      g_hash_table_remove (_tmp0_, _tmp1_);
}


static void ____lambda0__gtk_widget_destroy (GtkWidget* _sender, gpointer self) {
      ___lambda0_ (self);
}


static GdkFilterReturn caribou_gtk_module_event_filter (CaribouGtkModule* self, GdkXEvent* xevent, GdkEvent* evt) {
      GdkFilterReturn result = 0;
      Block1Data* _data1_;
      GdkWindow* gdkwindow = NULL;
      void* data = NULL;
      GdkEvent* _tmp0_;
      GdkEventAny _tmp1_;
      GdkWindow* _tmp2_;
      GdkWindow* _tmp3_;
      gboolean _tmp4_ = FALSE;
      GdkWindow* _tmp5_;
      gboolean _tmp8_;
      GdkWindow* _tmp9_;
      void* _tmp10_ = NULL;
      gboolean _tmp11_ = FALSE;
      void* _tmp12_;
      gboolean _tmp14_;
      void* _tmp15_;
      GtkWindow* _tmp16_;
      GHashTable* _tmp17_;
      GtkWindow* _tmp18_;
      gconstpointer _tmp19_ = NULL;
      g_return_val_if_fail (self != NULL, 0);
      g_return_val_if_fail (xevent != NULL, 0);
      g_return_val_if_fail (evt != NULL, 0);
      _data1_ = g_slice_new0 (Block1Data);
      _data1_->_ref_count_ = 1;
      _data1_->self = caribou_gtk_module_ref (self);
      _tmp0_ = evt;
      _tmp1_ = _tmp0_->any;
      _tmp2_ = _tmp1_.window;
      _tmp3_ = _g_object_ref0 (_tmp2_);
      _g_object_unref0 (gdkwindow);
      gdkwindow = _tmp3_;
      _tmp5_ = gdkwindow;
      if (_tmp5_ == NULL) {
            _tmp4_ = TRUE;
      } else {
            GdkWindow* _tmp6_;
            GdkWindowType _tmp7_ = 0;
            _tmp6_ = gdkwindow;
            _tmp7_ = gdk_window_get_window_type (_tmp6_);
            _tmp4_ = _tmp7_ != GDK_WINDOW_TOPLEVEL;
      }
      _tmp8_ = _tmp4_;
      if (_tmp8_) {
            result = GDK_FILTER_CONTINUE;
            _g_object_unref0 (gdkwindow);
            block1_data_unref (_data1_);
            _data1_ = NULL;
            return result;
      }
      _tmp9_ = gdkwindow;
      gdk_window_get_user_data (_tmp9_, &_tmp10_);
      data = _tmp10_;
      _tmp12_ = data;
      if (_tmp12_ == NULL) {
            _tmp11_ = TRUE;
      } else {
            void* _tmp13_;
            _tmp13_ = data;
            _tmp11_ = !GTK_IS_WINDOW (_tmp13_);
      }
      _tmp14_ = _tmp11_;
      if (_tmp14_) {
            result = GDK_FILTER_CONTINUE;
            _g_object_unref0 (gdkwindow);
            block1_data_unref (_data1_);
            _data1_ = NULL;
            return result;
      }
      _tmp15_ = data;
      _tmp16_ = _g_object_ref0 ((GtkWindow*) _tmp15_);
      _g_object_unref0 (_data1_->window);
      _data1_->window = _tmp16_;
      _tmp17_ = self->priv->windows;
      _tmp18_ = _data1_->window;
      _tmp19_ = g_hash_table_lookup (_tmp17_, _tmp18_);
      if (!GPOINTER_TO_INT (_tmp19_)) {
            GHashTable* _tmp20_;
            GtkWindow* _tmp21_;
            GtkWindow* _tmp22_;
            GtkWindow* _tmp23_;
            GtkWindow* _tmp24_;
            GtkWindow* _tmp25_;
            _tmp20_ = self->priv->windows;
            _tmp21_ = _data1_->window;
            _tmp22_ = _g_object_ref0 (_tmp21_);
            g_hash_table_insert (_tmp20_, _tmp22_, GINT_TO_POINTER (TRUE));
            _tmp23_ = _data1_->window;
            g_signal_connect ((GObject*) _tmp23_, "notify::has-toplevel-focus", (GCallback) _caribou_gtk_module_toplevel_focus_changed_g_object_notify, self);
            _tmp24_ = _data1_->window;
            g_signal_connect (_tmp24_, "set-focus", (GCallback) _caribou_gtk_module_window_focus_changed_gtk_window_set_focus, self);
            _tmp25_ = _data1_->window;
            g_signal_connect_data ((GtkWidget*) _tmp25_, "destroy", (GCallback) ____lambda0__gtk_widget_destroy, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
      }
      result = GDK_FILTER_CONTINUE;
      _g_object_unref0 (gdkwindow);
      block1_data_unref (_data1_);
      _data1_ = NULL;
      return result;
}


static void caribou_gtk_module_toplevel_focus_changed (CaribouGtkModule* self, GObject* obj, GParamSpec* prop) {
      GObject* _tmp0_;
      GtkWindow* _tmp1_;
      GtkWindow* window;
      GtkWindow* _tmp2_;
      gboolean _tmp3_ = FALSE;
      gboolean _tmp4_;
      g_return_if_fail (self != NULL);
      g_return_if_fail (obj != NULL);
      g_return_if_fail (prop != NULL);
      _tmp0_ = obj;
      _tmp1_ = _g_object_ref0 (GTK_WINDOW (_tmp0_));
      window = _tmp1_;
      _tmp2_ = window;
      g_object_get (_tmp2_, "has-toplevel-focus", &_tmp3_, NULL);
      _tmp4_ = _tmp3_;
      if (_tmp4_) {
            GtkWindow* _tmp5_;
            GtkWidget* _tmp6_ = NULL;
            _tmp5_ = window;
            _tmp6_ = gtk_window_get_focus (_tmp5_);
            caribou_gtk_module_do_focus_change (self, _tmp6_);
      }
      _g_object_unref0 (window);
}


static void caribou_gtk_module_window_focus_changed (CaribouGtkModule* self, GtkWindow* window, GtkWidget* widget) {
      GtkWidget* _tmp0_;
      g_return_if_fail (self != NULL);
      g_return_if_fail (window != NULL);
      _tmp0_ = widget;
      caribou_gtk_module_do_focus_change (self, _tmp0_);
}


static void caribou_gtk_module_do_focus_change (CaribouGtkModule* self, GtkWidget* widget) {
      GdkDisplay* _tmp0_;
      guint32 _tmp1_ = 0U;
      guint32 timestamp;
      gboolean _tmp2_ = FALSE;
      gboolean _tmp3_ = FALSE;
      GtkWidget* _tmp4_;
      gboolean _tmp7_;
      gboolean _tmp13_;
      GError * _inner_error_ = NULL;
      g_return_if_fail (self != NULL);
      _tmp0_ = self->priv->display;
      _tmp1_ = gdk_x11_display_get_user_time (_tmp0_);
      timestamp = _tmp1_;
      _tmp4_ = widget;
      if (GTK_IS_EDITABLE (_tmp4_)) {
            GtkWidget* _tmp5_;
            gboolean _tmp6_ = FALSE;
            _tmp5_ = widget;
            _tmp6_ = gtk_editable_get_editable (GTK_EDITABLE (_tmp5_));
            _tmp3_ = _tmp6_;
      } else {
            _tmp3_ = FALSE;
      }
      _tmp7_ = _tmp3_;
      if (_tmp7_) {
            _tmp2_ = TRUE;
      } else {
            gboolean _tmp8_ = FALSE;
            GtkWidget* _tmp9_;
            gboolean _tmp12_;
            _tmp9_ = widget;
            if (GTK_IS_TEXT_VIEW (_tmp9_)) {
                  GtkWidget* _tmp10_;
                  gboolean _tmp11_ = FALSE;
                  _tmp10_ = widget;
                  _tmp11_ = gtk_text_view_get_editable (GTK_TEXT_VIEW (_tmp10_));
                  _tmp8_ = _tmp11_;
            } else {
                  _tmp8_ = FALSE;
            }
            _tmp12_ = _tmp8_;
            _tmp2_ = _tmp12_;
      }
      _tmp13_ = _tmp2_;
      if (_tmp13_) {
            GtkWidget* _tmp14_;
            GdkWindow* _tmp15_ = NULL;
            GdkWindow* _tmp16_;
            GdkWindow* current_window;
            GtkWidget* _tmp17_;
            AtkObject* _tmp18_ = NULL;
            AtkObject* _tmp19_;
            AtkObject* object;
            gint x;
            gint y;
            gint w;
            gint h;
            gint caret_offset;
            AtkObject* _tmp20_;
            _tmp14_ = widget;
            _tmp15_ = gtk_widget_get_window (_tmp14_);
            _tmp16_ = _g_object_ref0 (_tmp15_);
            current_window = _tmp16_;
            _tmp17_ = widget;
            _tmp18_ = gtk_widget_get_accessible (_tmp17_);
            _tmp19_ = _g_object_ref0 (_tmp18_);
            object = _tmp19_;
            x = 0;
            y = 0;
            w = 0;
            h = 0;
            caret_offset = 0;
            _tmp20_ = object;
            if (ATK_IS_TEXT (_tmp20_)) {
                  AtkObject* _tmp21_;
                  gint _tmp22_ = 0;
                  AtkObject* _tmp23_;
                  gint _tmp24_;
                  gint _tmp25_ = 0;
                  gint _tmp26_ = 0;
                  gint _tmp27_ = 0;
                  gint _tmp28_ = 0;
                  _tmp21_ = object;
                  _tmp22_ = atk_text_get_caret_offset (ATK_TEXT (_tmp21_));
                  caret_offset = _tmp22_;
                  _tmp23_ = object;
                  _tmp24_ = caret_offset;
                  atk_text_get_character_extents (ATK_TEXT (_tmp23_), _tmp24_, &_tmp25_, &_tmp26_, &_tmp27_, &_tmp28_, ATK_XY_SCREEN);
                  x = _tmp25_;
                  y = _tmp26_;
                  w = _tmp27_;
                  h = _tmp28_;
            } else {
                  GdkWindow* _tmp29_;
                  _tmp29_ = current_window;
                  if (_tmp29_ != NULL) {
                        GdkWindow* _tmp30_;
                        gint _tmp31_ = 0;
                        gint _tmp32_ = 0;
                        gint _tmp33_ = 0;
                        gint _tmp34_ = 0;
                        _tmp30_ = current_window;
                        caribou_gtk_module_get_origin_geometry (self, _tmp30_, &_tmp31_, &_tmp32_, &_tmp33_, &_tmp34_);
                        x = _tmp31_;
                        y = _tmp32_;
                        w = _tmp33_;
                        h = _tmp34_;
                  }
            }
            {
                  CaribouKeyboard* _tmp35_;
                  guint32 _tmp36_;
                  CaribouKeyboard* _tmp37_;
                  gint _tmp38_;
                  gint _tmp39_;
                  gint _tmp40_;
                  gint _tmp41_;
                  _tmp35_ = self->priv->keyboard;
                  _tmp36_ = timestamp;
                  caribou_keyboard_show (_tmp35_, _tmp36_, &_inner_error_);
                  if (_inner_error_ != NULL) {
                        if (_inner_error_->domain == G_IO_ERROR) {
                              goto __catch1_g_io_error;
                        }
                        _g_object_unref0 (object);
                        _g_object_unref0 (current_window);
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
                        g_clear_error (&_inner_error_);
                        return;
                  }
                  _tmp37_ = self->priv->keyboard;
                  _tmp38_ = x;
                  _tmp39_ = y;
                  _tmp40_ = w;
                  _tmp41_ = h;
                  caribou_keyboard_set_cursor_location (_tmp37_, _tmp38_, _tmp39_, _tmp40_, _tmp41_, &_inner_error_);
                  if (_inner_error_ != NULL) {
                        if (_inner_error_->domain == G_IO_ERROR) {
                              goto __catch1_g_io_error;
                        }
                        _g_object_unref0 (object);
                        _g_object_unref0 (current_window);
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
                        g_clear_error (&_inner_error_);
                        return;
                  }
            }
            goto __finally1;
            __catch1_g_io_error:
            {
                  GError* e = NULL;
                  FILE* _tmp42_;
                  GError* _tmp43_;
                  const gchar* _tmp44_;
                  e = _inner_error_;
                  _inner_error_ = NULL;
                  _tmp42_ = stderr;
                  _tmp43_ = e;
                  _tmp44_ = _tmp43_->message;
                  fprintf (_tmp42_, "%s\n", _tmp44_);
                  _g_error_free0 (e);
            }
            __finally1:
            if (_inner_error_ != NULL) {
                  _g_object_unref0 (object);
                  _g_object_unref0 (current_window);
                  g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
                  g_clear_error (&_inner_error_);
                  return;
            }
            _g_object_unref0 (object);
            _g_object_unref0 (current_window);
      } else {
            {
                  CaribouKeyboard* _tmp45_;
                  guint32 _tmp46_;
                  _tmp45_ = self->priv->keyboard;
                  _tmp46_ = timestamp;
                  caribou_keyboard_hide (_tmp45_, _tmp46_, &_inner_error_);
                  if (_inner_error_ != NULL) {
                        if (_inner_error_->domain == G_IO_ERROR) {
                              goto __catch2_g_io_error;
                        }
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
                        g_clear_error (&_inner_error_);
                        return;
                  }
            }
            goto __finally2;
            __catch2_g_io_error:
            {
                  GError* e = NULL;
                  FILE* _tmp47_;
                  GError* _tmp48_;
                  const gchar* _tmp49_;
                  e = _inner_error_;
                  _inner_error_ = NULL;
                  _tmp47_ = stderr;
                  _tmp48_ = e;
                  _tmp49_ = _tmp48_->message;
                  fprintf (_tmp47_, "%s\n", _tmp49_);
                  _g_error_free0 (e);
            }
            __finally2:
            if (_inner_error_ != NULL) {
                  g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
                  g_clear_error (&_inner_error_);
                  return;
            }
      }
}


static void caribou_gtk_module_get_origin_geometry (CaribouGtkModule* self, GdkWindow* window, gint* x, gint* y, gint* w, gint* h) {
      gint _vala_x = 0;
      gint _vala_y = 0;
      gint _vala_w = 0;
      gint _vala_h = 0;
      GdkWindow* _tmp0_;
      gint _tmp1_ = 0;
      gint _tmp2_ = 0;
      GdkWindow* _tmp3_;
      gint _tmp4_ = 0;
      gint _tmp5_ = 0;
      g_return_if_fail (self != NULL);
      g_return_if_fail (window != NULL);
      _tmp0_ = window;
      gdk_window_get_origin (_tmp0_, &_tmp1_, &_tmp2_);
      _vala_x = _tmp1_;
      _vala_y = _tmp2_;
      _tmp3_ = window;
      gdk_window_get_geometry (_tmp3_, NULL, NULL, &_tmp4_, &_tmp5_);
      _vala_w = _tmp4_;
      _vala_h = _tmp5_;
      if (x) {
            *x = _vala_x;
      }
      if (y) {
            *y = _vala_y;
      }
      if (w) {
            *w = _vala_w;
      }
      if (h) {
            *h = _vala_h;
      }
}


void caribou_gtk_module_unload (CaribouGtkModule* self) {
      GHashTable* _tmp0_;
      GList* _tmp1_ = NULL;
      g_return_if_fail (self != NULL);
      gdk_window_remove_filter (NULL, _caribou_gtk_module_event_filter_gdk_filter_func, self);
      _tmp0_ = self->priv->windows;
      _tmp1_ = g_hash_table_get_keys (_tmp0_);
      {
            GList* window_collection = NULL;
            GList* window_it = NULL;
            window_collection = _tmp1_;
            for (window_it = window_collection; window_it != NULL; window_it = window_it->next) {
                  GtkWindow* _tmp2_;
                  GtkWindow* window = NULL;
                  _tmp2_ = _g_object_ref0 ((GtkWindow*) window_it->data);
                  window = _tmp2_;
                  {
                        GtkWindow* _tmp3_;
                        guint _tmp4_ = 0U;
                        GQuark _tmp5_ = 0U;
                        _tmp3_ = window;
                        g_signal_parse_name ("notify::has-toplevel-focus", G_TYPE_OBJECT, &_tmp4_, &_tmp5_, TRUE);
                        g_signal_handlers_disconnect_matched ((GObject*) _tmp3_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, _tmp5_, NULL, (GCallback) _caribou_gtk_module_toplevel_focus_changed_g_object_notify, self);
                        _g_object_unref0 (window);
                  }
            }
            _g_list_free0 (window_collection);
      }
}


static void caribou_value_gtk_module_init (GValue* value) {
      value->data[0].v_pointer = NULL;
}


static void caribou_value_gtk_module_free_value (GValue* value) {
      if (value->data[0].v_pointer) {
            caribou_gtk_module_unref (value->data[0].v_pointer);
      }
}


static void caribou_value_gtk_module_copy_value (const GValue* src_value, GValue* dest_value) {
      if (src_value->data[0].v_pointer) {
            dest_value->data[0].v_pointer = caribou_gtk_module_ref (src_value->data[0].v_pointer);
      } else {
            dest_value->data[0].v_pointer = NULL;
      }
}


static gpointer caribou_value_gtk_module_peek_pointer (const GValue* value) {
      return value->data[0].v_pointer;
}


static gchar* caribou_value_gtk_module_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
      if (collect_values[0].v_pointer) {
            CaribouGtkModule* object;
            object = collect_values[0].v_pointer;
            if (object->parent_instance.g_class == NULL) {
                  return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
            } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
                  return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
            }
            value->data[0].v_pointer = caribou_gtk_module_ref (object);
      } else {
            value->data[0].v_pointer = NULL;
      }
      return NULL;
}


static gchar* caribou_value_gtk_module_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
      CaribouGtkModule** object_p;
      object_p = collect_values[0].v_pointer;
      if (!object_p) {
            return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
      }
      if (!value->data[0].v_pointer) {
            *object_p = NULL;
      } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
            *object_p = value->data[0].v_pointer;
      } else {
            *object_p = caribou_gtk_module_ref (value->data[0].v_pointer);
      }
      return NULL;
}


GParamSpec* caribou_param_spec_gtk_module (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
      CaribouParamSpecGtkModule* spec;
      g_return_val_if_fail (g_type_is_a (object_type, CARIBOU_TYPE_GTK_MODULE), NULL);
      spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
      G_PARAM_SPEC (spec)->value_type = object_type;
      return G_PARAM_SPEC (spec);
}


gpointer caribou_value_get_gtk_module (const GValue* value) {
      g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, CARIBOU_TYPE_GTK_MODULE), NULL);
      return value->data[0].v_pointer;
}


void caribou_value_set_gtk_module (GValue* value, gpointer v_object) {
      CaribouGtkModule* old;
      g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, CARIBOU_TYPE_GTK_MODULE));
      old = value->data[0].v_pointer;
      if (v_object) {
            g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, CARIBOU_TYPE_GTK_MODULE));
            g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
            value->data[0].v_pointer = v_object;
            caribou_gtk_module_ref (value->data[0].v_pointer);
      } else {
            value->data[0].v_pointer = NULL;
      }
      if (old) {
            caribou_gtk_module_unref (old);
      }
}


void caribou_value_take_gtk_module (GValue* value, gpointer v_object) {
      CaribouGtkModule* old;
      g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, CARIBOU_TYPE_GTK_MODULE));
      old = value->data[0].v_pointer;
      if (v_object) {
            g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, CARIBOU_TYPE_GTK_MODULE));
            g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
            value->data[0].v_pointer = v_object;
      } else {
            value->data[0].v_pointer = NULL;
      }
      if (old) {
            caribou_gtk_module_unref (old);
      }
}


static void caribou_gtk_module_class_init (CaribouGtkModuleClass * klass) {
      caribou_gtk_module_parent_class = g_type_class_peek_parent (klass);
      CARIBOU_GTK_MODULE_CLASS (klass)->finalize = caribou_gtk_module_finalize;
      g_type_class_add_private (klass, sizeof (CaribouGtkModulePrivate));
}


static void caribou_gtk_module_instance_init (CaribouGtkModule * self) {
      self->priv = CARIBOU_GTK_MODULE_GET_PRIVATE (self);
      self->ref_count = 1;
}


static void caribou_gtk_module_finalize (CaribouGtkModule* obj) {
      CaribouGtkModule * self;
      self = CARIBOU_GTK_MODULE (obj);
      _g_hash_table_unref0 (self->priv->windows);
      _g_object_unref0 (self->priv->keyboard);
      _g_object_unref0 (self->priv->display);
}


GType caribou_gtk_module_get_type (void) {
      static volatile gsize caribou_gtk_module_type_id__volatile = 0;
      if (g_once_init_enter (&caribou_gtk_module_type_id__volatile)) {
            static const GTypeValueTable g_define_type_value_table = { caribou_value_gtk_module_init, caribou_value_gtk_module_free_value, caribou_value_gtk_module_copy_value, caribou_value_gtk_module_peek_pointer, "p", caribou_value_gtk_module_collect_value, "p", caribou_value_gtk_module_lcopy_value };
            static const GTypeInfo g_define_type_info = { sizeof (CaribouGtkModuleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) caribou_gtk_module_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CaribouGtkModule), 0, (GInstanceInitFunc) caribou_gtk_module_instance_init, &g_define_type_value_table };
            static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
            GType caribou_gtk_module_type_id;
            caribou_gtk_module_type_id = g_type_register_fundamental (g_type_fundamental_next (), "CaribouGtkModule", &g_define_type_info, &g_define_type_fundamental_info, 0);
            g_once_init_leave (&caribou_gtk_module_type_id__volatile, caribou_gtk_module_type_id);
      }
      return caribou_gtk_module_type_id__volatile;
}


gpointer caribou_gtk_module_ref (gpointer instance) {
      CaribouGtkModule* self;
      self = instance;
      g_atomic_int_inc (&self->ref_count);
      return instance;
}


void caribou_gtk_module_unref (gpointer instance) {
      CaribouGtkModule* self;
      self = instance;
      if (g_atomic_int_dec_and_test (&self->ref_count)) {
            CARIBOU_GTK_MODULE_GET_CLASS (self)->finalize (self);
            g_type_free_instance ((GTypeInstance *) self);
      }
}




Generated by  Doxygen 1.6.0   Back to index