/* keys-input-popover.c generated by valac 0.36.1.38-6532, the Vala compiler
 * generated from keys-input-popover.vala, do not modify */

/* This file is part of GNOME Boxes. License: LGPLv2+*/

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <atk/atk.h>
#include <gdk/gdk.h>
#include <stdlib.h>
#include <string.h>


#define BOXES_TYPE_KEYS_INPUT_POPOVER (boxes_keys_input_popover_get_type ())
#define BOXES_KEYS_INPUT_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_KEYS_INPUT_POPOVER, BoxesKeysInputPopover))
#define BOXES_KEYS_INPUT_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_KEYS_INPUT_POPOVER, BoxesKeysInputPopoverClass))
#define BOXES_IS_KEYS_INPUT_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_KEYS_INPUT_POPOVER))
#define BOXES_IS_KEYS_INPUT_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_KEYS_INPUT_POPOVER))
#define BOXES_KEYS_INPUT_POPOVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_KEYS_INPUT_POPOVER, BoxesKeysInputPopoverClass))

typedef struct _BoxesKeysInputPopover BoxesKeysInputPopover;
typedef struct _BoxesKeysInputPopoverClass BoxesKeysInputPopoverClass;
typedef struct _BoxesKeysInputPopoverPrivate BoxesKeysInputPopoverPrivate;

#define BOXES_TYPE_APP_WINDOW (boxes_app_window_get_type ())
#define BOXES_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_APP_WINDOW, BoxesAppWindow))
#define BOXES_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_APP_WINDOW, BoxesAppWindowClass))
#define BOXES_IS_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_APP_WINDOW))
#define BOXES_IS_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_APP_WINDOW))
#define BOXES_APP_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_APP_WINDOW, BoxesAppWindowClass))

typedef struct _BoxesAppWindow BoxesAppWindow;
typedef struct _BoxesAppWindowClass BoxesAppWindowClass;
enum  {
	BOXES_KEYS_INPUT_POPOVER_DUMMY_PROPERTY,
	BOXES_KEYS_INPUT_POPOVER_LAST_PROPERTY
};
static GParamSpec* boxes_keys_input_popover_properties[BOXES_KEYS_INPUT_POPOVER_LAST_PROPERTY];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define BOXES_TYPE_COLLECTION_ITEM (boxes_collection_item_get_type ())
#define BOXES_COLLECTION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItem))
#define BOXES_COLLECTION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItemClass))
#define BOXES_IS_COLLECTION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION_ITEM))
#define BOXES_IS_COLLECTION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION_ITEM))
#define BOXES_COLLECTION_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItemClass))

typedef struct _BoxesCollectionItem BoxesCollectionItem;
typedef struct _BoxesCollectionItemClass BoxesCollectionItemClass;

#define BOXES_TYPE_MACHINE (boxes_machine_get_type ())
#define BOXES_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_MACHINE, BoxesMachine))
#define BOXES_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_MACHINE, BoxesMachineClass))
#define BOXES_IS_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_MACHINE))
#define BOXES_IS_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_MACHINE))
#define BOXES_MACHINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_MACHINE, BoxesMachineClass))

typedef struct _BoxesMachine BoxesMachine;
typedef struct _BoxesMachineClass BoxesMachineClass;

#define BOXES_TYPE_DISPLAY (boxes_display_get_type ())
#define BOXES_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_DISPLAY, BoxesDisplay))
#define BOXES_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_DISPLAY, BoxesDisplayClass))
#define BOXES_IS_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_DISPLAY))
#define BOXES_IS_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_DISPLAY))
#define BOXES_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_DISPLAY, BoxesDisplayClass))

typedef struct _BoxesDisplay BoxesDisplay;
typedef struct _BoxesDisplayClass BoxesDisplayClass;

struct _BoxesKeysInputPopover {
	GtkPopover parent_instance;
	BoxesKeysInputPopoverPrivate * priv;
};

struct _BoxesKeysInputPopoverClass {
	GtkPopoverClass parent_class;
};

struct _BoxesKeysInputPopoverPrivate {
	BoxesAppWindow* window;
	GSimpleActionGroup* action_group;
};


static gpointer boxes_keys_input_popover_parent_class = NULL;

GType boxes_keys_input_popover_get_type (void) G_GNUC_CONST;
GType boxes_app_window_get_type (void) G_GNUC_CONST;
#define BOXES_KEYS_INPUT_POPOVER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_KEYS_INPUT_POPOVER, BoxesKeysInputPopoverPrivate))
static void boxes_keys_input_popover_ctrl_alt_backspace_activated (BoxesKeysInputPopover* self);
static void _boxes_keys_input_popover_ctrl_alt_backspace_activated_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void boxes_keys_input_popover_ctrl_alt_del_activated (BoxesKeysInputPopover* self);
static void _boxes_keys_input_popover_ctrl_alt_del_activated_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
static void boxes_keys_input_popover_ctrl_alt_fn_activated (BoxesKeysInputPopover* self, GSimpleAction* action);
static void _boxes_keys_input_popover_ctrl_alt_fn_activated_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self);
BoxesKeysInputPopover* boxes_keys_input_popover_new (BoxesAppWindow* window);
BoxesKeysInputPopover* boxes_keys_input_popover_construct (GType object_type, BoxesAppWindow* window);
static void boxes_keys_input_popover_send_keys (BoxesKeysInputPopover* self, guint* keyvals, int keyvals_length1);
GType boxes_collection_item_get_type (void) G_GNUC_CONST;
GType boxes_machine_get_type (void) G_GNUC_CONST;
BoxesCollectionItem* boxes_app_window_get_current_item (BoxesAppWindow* self);
GType boxes_display_get_type (void) G_GNUC_CONST;
BoxesDisplay* boxes_machine_get_display (BoxesMachine* self);
void boxes_display_send_keys (BoxesDisplay* self, guint* keyvals, int keyvals_length1);
static void boxes_keys_input_popover_finalize (GObject * obj);

static const GActionEntry BOXES_KEYS_INPUT_POPOVER_action_entries[6] = {{"ctrl+alt+backspace", _boxes_keys_input_popover_ctrl_alt_backspace_activated_gsimple_action_activate_callback}, {"ctrl+alt+del", _boxes_keys_input_popover_ctrl_alt_del_activated_gsimple_action_activate_callback}, {"ctrl+alt+f1", _boxes_keys_input_popover_ctrl_alt_fn_activated_gsimple_action_activate_callback}, {"ctrl+alt+f2", _boxes_keys_input_popover_ctrl_alt_fn_activated_gsimple_action_activate_callback}, {"ctrl+alt+f3", _boxes_keys_input_popover_ctrl_alt_fn_activated_gsimple_action_activate_callback}, {"ctrl+alt+f7", _boxes_keys_input_popover_ctrl_alt_fn_activated_gsimple_action_activate_callback}};

static void _boxes_keys_input_popover_ctrl_alt_backspace_activated_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
#line 4 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	boxes_keys_input_popover_ctrl_alt_backspace_activated ((BoxesKeysInputPopover*) self);
#line 117 "keys-input-popover.c"
}


static void _boxes_keys_input_popover_ctrl_alt_del_activated_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
#line 4 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	boxes_keys_input_popover_ctrl_alt_del_activated ((BoxesKeysInputPopover*) self);
#line 124 "keys-input-popover.c"
}


static void _boxes_keys_input_popover_ctrl_alt_fn_activated_gsimple_action_activate_callback (GSimpleAction* action, GVariant* parameter, gpointer self) {
#line 4 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	boxes_keys_input_popover_ctrl_alt_fn_activated ((BoxesKeysInputPopover*) self, action);
#line 131 "keys-input-popover.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 18 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	return self ? g_object_ref (self) : NULL;
#line 138 "keys-input-popover.c"
}


BoxesKeysInputPopover* boxes_keys_input_popover_construct (GType object_type, BoxesAppWindow* window) {
	BoxesKeysInputPopover * self = NULL;
	BoxesAppWindow* _tmp0_;
	BoxesAppWindow* _tmp1_;
	GSimpleActionGroup* _tmp2_;
	GSimpleActionGroup* _tmp3_;
	GSimpleActionGroup* _tmp4_;
	GMenu* menu = NULL;
	GMenu* _tmp5_;
	GMenu* section = NULL;
	GMenu* _tmp6_;
	AtkObject* a11y = NULL;
	AtkObject* _tmp7_;
	AtkObject* _tmp8_;
#line 17 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	g_return_val_if_fail (window != NULL, NULL);
#line 17 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	self = (BoxesKeysInputPopover*) g_object_new (object_type, NULL);
#line 18 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp0_ = window;
#line 18 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 18 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_g_object_unref0 (self->priv->window);
#line 18 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	self->priv->window = _tmp1_;
#line 20 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp2_ = g_simple_action_group_new ();
#line 20 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_g_object_unref0 (self->priv->action_group);
#line 20 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	self->priv->action_group = _tmp2_;
#line 21 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp3_ = self->priv->action_group;
#line 21 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	g_action_map_add_action_entries ((GActionMap*) _tmp3_, BOXES_KEYS_INPUT_POPOVER_action_entries, G_N_ELEMENTS (BOXES_KEYS_INPUT_POPOVER_action_entries), self);
#line 22 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp4_ = self->priv->action_group;
#line 22 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	gtk_widget_insert_action_group ((GtkWidget*) self, "key", (GActionGroup*) _tmp4_);
#line 24 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp5_ = g_menu_new ();
#line 24 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	menu = _tmp5_;
#line 26 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	g_menu_append (menu, _ ("Ctrl + Alt + Backspace"), "key.ctrl+alt+backspace");
#line 27 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	g_menu_append (menu, _ ("Ctrl + Alt + Del"), "key.ctrl+alt+del");
#line 30 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp6_ = g_menu_new ();
#line 30 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	section = _tmp6_;
#line 31 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	g_menu_append (section, _ ("Ctrl + Alt + F1"), "key.ctrl+alt+f1");
#line 32 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	g_menu_append (section, _ ("Ctrl + Alt + F2"), "key.ctrl+alt+f2");
#line 33 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	g_menu_append (section, _ ("Ctrl + Alt + F3"), "key.ctrl+alt+f2");
#line 34 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	g_menu_append (section, _ ("Ctrl + Alt + F7"), "key.ctrl+alt+f7");
#line 35 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	g_menu_append_section (menu, NULL, (GMenuModel*) section);
#line 37 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	gtk_popover_bind_model ((GtkPopover*) self, (GMenuModel*) menu, NULL);
#line 39 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp7_ = gtk_widget_get_accessible ((GtkWidget*) self);
#line 39 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp8_ = _g_object_ref0 (_tmp7_);
#line 39 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	a11y = _tmp8_;
#line 40 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	a11y->role = ATK_ROLE_POPUP_MENU;
#line 43 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	a11y->name = _ ("Send key combinations");
#line 17 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_g_object_unref0 (a11y);
#line 17 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_g_object_unref0 (section);
#line 17 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_g_object_unref0 (menu);
#line 17 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	return self;
#line 224 "keys-input-popover.c"
}


BoxesKeysInputPopover* boxes_keys_input_popover_new (BoxesAppWindow* window) {
#line 17 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	return boxes_keys_input_popover_construct (BOXES_TYPE_KEYS_INPUT_POPOVER, window);
#line 231 "keys-input-popover.c"
}


static void boxes_keys_input_popover_ctrl_alt_backspace_activated (BoxesKeysInputPopover* self) {
	guint* keyvals = NULL;
	guint* _tmp0_;
	gint keyvals_length1;
	gint _keyvals_size_;
#line 46 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	g_return_if_fail (self != NULL);
#line 47 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp0_ = g_new0 (guint, 3);
#line 47 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp0_[0] = (guint) GDK_KEY_Control_L;
#line 47 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp0_[1] = (guint) GDK_KEY_Alt_L;
#line 47 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp0_[2] = (guint) GDK_KEY_BackSpace;
#line 47 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	keyvals = _tmp0_;
#line 47 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	keyvals_length1 = 3;
#line 47 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_keyvals_size_ = keyvals_length1;
#line 49 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	boxes_keys_input_popover_send_keys (self, keyvals, keyvals_length1);
#line 46 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	keyvals = (g_free (keyvals), NULL);
#line 260 "keys-input-popover.c"
}


static void boxes_keys_input_popover_ctrl_alt_del_activated (BoxesKeysInputPopover* self) {
	guint* keyvals = NULL;
	guint* _tmp0_;
	gint keyvals_length1;
	gint _keyvals_size_;
#line 52 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	g_return_if_fail (self != NULL);
#line 53 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp0_ = g_new0 (guint, 3);
#line 53 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp0_[0] = (guint) GDK_KEY_Control_L;
#line 53 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp0_[1] = (guint) GDK_KEY_Alt_L;
#line 53 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp0_[2] = (guint) GDK_KEY_Delete;
#line 53 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	keyvals = _tmp0_;
#line 53 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	keyvals_length1 = 3;
#line 53 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_keyvals_size_ = keyvals_length1;
#line 55 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	boxes_keys_input_popover_send_keys (self, keyvals, keyvals_length1);
#line 52 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	keyvals = (g_free (keyvals), NULL);
#line 289 "keys-input-popover.c"
}


static gchar string_get (const gchar* self, glong index) {
	gchar result = '\0';
	glong _tmp0_;
	gchar _tmp1_;
#line 1110 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, '\0');
#line 1111 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp0_ = index;
#line 1111 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp1_ = ((gchar*) self)[_tmp0_];
#line 1111 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	result = _tmp1_;
#line 1111 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	return result;
#line 307 "keys-input-popover.c"
}


static void boxes_keys_input_popover_ctrl_alt_fn_activated (BoxesKeysInputPopover* self, GSimpleAction* action) {
	guint* keyvals = NULL;
	guint* _tmp0_;
	gint keyvals_length1;
	gint _keyvals_size_;
	GSimpleAction* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	GSimpleAction* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	gchar _tmp9_;
	guint* _tmp45_;
	gint _tmp45__length1;
#line 58 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	g_return_if_fail (self != NULL);
#line 58 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	g_return_if_fail (action != NULL);
#line 59 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp0_ = g_new0 (guint, 3);
#line 59 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp0_[0] = (guint) GDK_KEY_Control_L;
#line 59 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp0_[1] = (guint) GDK_KEY_Alt_L;
#line 59 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp0_[2] = (guint) 0;
#line 59 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	keyvals = _tmp0_;
#line 59 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	keyvals_length1 = 3;
#line 59 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_keyvals_size_ = keyvals_length1;
#line 61 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp1_ = action;
#line 61 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp2_ = g_action_get_name ((GAction*) _tmp1_);
#line 61 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp3_ = _tmp2_;
#line 61 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp4_ = action;
#line 61 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp5_ = g_action_get_name ((GAction*) _tmp4_);
#line 61 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp6_ = _tmp5_;
#line 61 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp7_ = strlen (_tmp6_);
#line 61 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp8_ = _tmp7_;
#line 61 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp9_ = string_get (_tmp3_, (glong) (_tmp8_ - 1));
#line 61 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	if (_tmp9_ == '1') {
#line 365 "keys-input-popover.c"
		guint* _tmp10_;
		gint _tmp10__length1;
		guint _tmp11_;
#line 62 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
		_tmp10_ = keyvals;
#line 62 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
		_tmp10__length1 = keyvals_length1;
#line 62 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
		_tmp10_[2] = (guint) GDK_KEY_F1;
#line 62 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
		_tmp11_ = _tmp10_[2];
#line 377 "keys-input-popover.c"
	} else {
		GSimpleAction* _tmp12_;
		const gchar* _tmp13_;
		const gchar* _tmp14_;
		GSimpleAction* _tmp15_;
		const gchar* _tmp16_;
		const gchar* _tmp17_;
		gint _tmp18_;
		gint _tmp19_;
		gchar _tmp20_;
#line 63 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
		_tmp12_ = action;
#line 63 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
		_tmp13_ = g_action_get_name ((GAction*) _tmp12_);
#line 63 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
		_tmp14_ = _tmp13_;
#line 63 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
		_tmp15_ = action;
#line 63 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
		_tmp16_ = g_action_get_name ((GAction*) _tmp15_);
#line 63 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
		_tmp17_ = _tmp16_;
#line 63 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
		_tmp18_ = strlen (_tmp17_);
#line 63 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
		_tmp19_ = _tmp18_;
#line 63 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
		_tmp20_ = string_get (_tmp14_, (glong) (_tmp19_ - 1));
#line 63 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
		if (_tmp20_ == '2') {
#line 408 "keys-input-popover.c"
			guint* _tmp21_;
			gint _tmp21__length1;
			guint _tmp22_;
#line 64 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
			_tmp21_ = keyvals;
#line 64 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
			_tmp21__length1 = keyvals_length1;
#line 64 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
			_tmp21_[2] = (guint) GDK_KEY_F2;
#line 64 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
			_tmp22_ = _tmp21_[2];
#line 420 "keys-input-popover.c"
		} else {
			GSimpleAction* _tmp23_;
			const gchar* _tmp24_;
			const gchar* _tmp25_;
			GSimpleAction* _tmp26_;
			const gchar* _tmp27_;
			const gchar* _tmp28_;
			gint _tmp29_;
			gint _tmp30_;
			gchar _tmp31_;
#line 65 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
			_tmp23_ = action;
#line 65 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
			_tmp24_ = g_action_get_name ((GAction*) _tmp23_);
#line 65 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
			_tmp25_ = _tmp24_;
#line 65 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
			_tmp26_ = action;
#line 65 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
			_tmp27_ = g_action_get_name ((GAction*) _tmp26_);
#line 65 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
			_tmp28_ = _tmp27_;
#line 65 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
			_tmp29_ = strlen (_tmp28_);
#line 65 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
			_tmp30_ = _tmp29_;
#line 65 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
			_tmp31_ = string_get (_tmp25_, (glong) (_tmp30_ - 1));
#line 65 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
			if (_tmp31_ == '3') {
#line 451 "keys-input-popover.c"
				guint* _tmp32_;
				gint _tmp32__length1;
				guint _tmp33_;
#line 66 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
				_tmp32_ = keyvals;
#line 66 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
				_tmp32__length1 = keyvals_length1;
#line 66 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
				_tmp32_[3] = (guint) GDK_KEY_F3;
#line 66 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
				_tmp33_ = _tmp32_[3];
#line 463 "keys-input-popover.c"
			} else {
				GSimpleAction* _tmp34_;
				const gchar* _tmp35_;
				const gchar* _tmp36_;
				GSimpleAction* _tmp37_;
				const gchar* _tmp38_;
				const gchar* _tmp39_;
				gint _tmp40_;
				gint _tmp41_;
				gchar _tmp42_;
#line 67 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
				_tmp34_ = action;
#line 67 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
				_tmp35_ = g_action_get_name ((GAction*) _tmp34_);
#line 67 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
				_tmp36_ = _tmp35_;
#line 67 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
				_tmp37_ = action;
#line 67 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
				_tmp38_ = g_action_get_name ((GAction*) _tmp37_);
#line 67 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
				_tmp39_ = _tmp38_;
#line 67 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
				_tmp40_ = strlen (_tmp39_);
#line 67 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
				_tmp41_ = _tmp40_;
#line 67 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
				_tmp42_ = string_get (_tmp36_, (glong) (_tmp41_ - 1));
#line 67 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
				if (_tmp42_ == '7') {
#line 494 "keys-input-popover.c"
					guint* _tmp43_;
					gint _tmp43__length1;
					guint _tmp44_;
#line 68 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
					_tmp43_ = keyvals;
#line 68 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
					_tmp43__length1 = keyvals_length1;
#line 68 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
					_tmp43_[2] = (guint) GDK_KEY_F7;
#line 68 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
					_tmp44_ = _tmp43_[2];
#line 506 "keys-input-popover.c"
				} else {
#line 70 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
					g_warn_if_reached ();
#line 72 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
					keyvals = (g_free (keyvals), NULL);
#line 72 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
					return;
#line 514 "keys-input-popover.c"
				}
			}
		}
	}
#line 75 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp45_ = keyvals;
#line 75 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp45__length1 = keyvals_length1;
#line 75 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	boxes_keys_input_popover_send_keys (self, _tmp45_, _tmp45__length1);
#line 58 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	keyvals = (g_free (keyvals), NULL);
#line 527 "keys-input-popover.c"
}


static void boxes_keys_input_popover_send_keys (BoxesKeysInputPopover* self, guint* keyvals, int keyvals_length1) {
	BoxesMachine* machine = NULL;
	BoxesAppWindow* _tmp0_;
	BoxesCollectionItem* _tmp1_;
	BoxesCollectionItem* _tmp2_;
	BoxesMachine* _tmp3_;
	gboolean _tmp4_ = FALSE;
	BoxesMachine* _tmp5_;
	BoxesMachine* _tmp9_;
	BoxesDisplay* _tmp10_;
	BoxesDisplay* _tmp11_;
	guint* _tmp12_;
	gint _tmp12__length1;
#line 78 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	g_return_if_fail (self != NULL);
#line 79 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp0_ = self->priv->window;
#line 79 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp1_ = boxes_app_window_get_current_item (_tmp0_);
#line 79 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp2_ = _tmp1_;
#line 79 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, BOXES_TYPE_MACHINE) ? ((BoxesMachine*) _tmp2_) : NULL);
#line 79 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	machine = _tmp3_;
#line 80 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp5_ = machine;
#line 80 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	if (_tmp5_ != NULL) {
#line 560 "keys-input-popover.c"
		BoxesMachine* _tmp6_;
		BoxesDisplay* _tmp7_;
		BoxesDisplay* _tmp8_;
#line 80 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
		_tmp6_ = machine;
#line 80 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
		_tmp7_ = boxes_machine_get_display (_tmp6_);
#line 80 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
		_tmp8_ = _tmp7_;
#line 80 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
		_tmp4_ = _tmp8_ != NULL;
#line 572 "keys-input-popover.c"
	} else {
#line 80 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
		_tmp4_ = FALSE;
#line 576 "keys-input-popover.c"
	}
#line 80 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	g_return_if_fail (_tmp4_);
#line 82 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp9_ = machine;
#line 82 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp10_ = boxes_machine_get_display (_tmp9_);
#line 82 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp11_ = _tmp10_;
#line 82 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp12_ = keyvals;
#line 82 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_tmp12__length1 = keyvals_length1;
#line 82 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	boxes_display_send_keys (_tmp11_, _tmp12_, _tmp12__length1);
#line 78 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_g_object_unref0 (machine);
#line 594 "keys-input-popover.c"
}


static void boxes_keys_input_popover_class_init (BoxesKeysInputPopoverClass * klass) {
#line 3 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	boxes_keys_input_popover_parent_class = g_type_class_peek_parent (klass);
#line 3 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	g_type_class_add_private (klass, sizeof (BoxesKeysInputPopoverPrivate));
#line 3 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	G_OBJECT_CLASS (klass)->finalize = boxes_keys_input_popover_finalize;
#line 605 "keys-input-popover.c"
}


static void boxes_keys_input_popover_instance_init (BoxesKeysInputPopover * self) {
#line 3 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	self->priv = BOXES_KEYS_INPUT_POPOVER_GET_PRIVATE (self);
#line 612 "keys-input-popover.c"
}


static void boxes_keys_input_popover_finalize (GObject * obj) {
	BoxesKeysInputPopover * self;
#line 3 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_KEYS_INPUT_POPOVER, BoxesKeysInputPopover);
#line 14 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_g_object_unref0 (self->priv->window);
#line 15 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	_g_object_unref0 (self->priv->action_group);
#line 3 "/home/fborges/checkout/gnome-boxes/src/keys-input-popover.vala"
	G_OBJECT_CLASS (boxes_keys_input_popover_parent_class)->finalize (obj);
#line 626 "keys-input-popover.c"
}


GType boxes_keys_input_popover_get_type (void) {
	static volatile gsize boxes_keys_input_popover_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_keys_input_popover_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesKeysInputPopoverClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_keys_input_popover_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesKeysInputPopover), 0, (GInstanceInitFunc) boxes_keys_input_popover_instance_init, NULL };
		GType boxes_keys_input_popover_type_id;
		boxes_keys_input_popover_type_id = g_type_register_static (gtk_popover_get_type (), "BoxesKeysInputPopover", &g_define_type_info, 0);
		g_once_init_leave (&boxes_keys_input_popover_type_id__volatile, boxes_keys_input_popover_type_id);
	}
	return boxes_keys_input_popover_type_id__volatile;
}



