/* display-page.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from display-page.vala, do not modify */

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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <handy.h>
#include <glib.h>
#include <gdk/gdk.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <cairo-gobject.h>
#include <float.h>
#include <math.h>

#define BOXES_DISPLAY_PAGE_SCREEN_EDGE_WIDTH ((guint8) 100)
#define BOXES_APP_WINDOW_TRANSITION_DURATION ((guint) 400)
#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 BOXES_TYPE_DISPLAY_PAGE (boxes_display_page_get_type ())
#define BOXES_DISPLAY_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_DISPLAY_PAGE, BoxesDisplayPage))
#define BOXES_DISPLAY_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_DISPLAY_PAGE, BoxesDisplayPageClass))
#define BOXES_IS_DISPLAY_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_DISPLAY_PAGE))
#define BOXES_IS_DISPLAY_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_DISPLAY_PAGE))
#define BOXES_DISPLAY_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_DISPLAY_PAGE, BoxesDisplayPageClass))

typedef struct _BoxesDisplayPage BoxesDisplayPage;
typedef struct _BoxesDisplayPageClass BoxesDisplayPageClass;
typedef struct _BoxesDisplayPagePrivate BoxesDisplayPagePrivate;

#define BOXES_TYPE_DISPLAY_TOOLBAR (boxes_display_toolbar_get_type ())
#define BOXES_DISPLAY_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_DISPLAY_TOOLBAR, BoxesDisplayToolbar))
#define BOXES_DISPLAY_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_DISPLAY_TOOLBAR, BoxesDisplayToolbarClass))
#define BOXES_IS_DISPLAY_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_DISPLAY_TOOLBAR))
#define BOXES_IS_DISPLAY_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_DISPLAY_TOOLBAR))
#define BOXES_DISPLAY_TOOLBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_DISPLAY_TOOLBAR, BoxesDisplayToolbarClass))

typedef struct _BoxesDisplayToolbar BoxesDisplayToolbar;
typedef struct _BoxesDisplayToolbarClass BoxesDisplayToolbarClass;

#define BOXES_TYPE_TRANSFER_POPOVER (boxes_transfer_popover_get_type ())
#define BOXES_TRANSFER_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_TRANSFER_POPOVER, BoxesTransferPopover))
#define BOXES_TRANSFER_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_TRANSFER_POPOVER, BoxesTransferPopoverClass))
#define BOXES_IS_TRANSFER_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_TRANSFER_POPOVER))
#define BOXES_IS_TRANSFER_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_TRANSFER_POPOVER))
#define BOXES_TRANSFER_POPOVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_TRANSFER_POPOVER, BoxesTransferPopoverClass))

typedef struct _BoxesTransferPopover BoxesTransferPopover;
typedef struct _BoxesTransferPopoverClass BoxesTransferPopoverClass;

#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;

#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;
enum  {
	BOXES_DISPLAY_PAGE_0_PROPERTY,
	BOXES_DISPLAY_PAGE_NUM_PROPERTIES
};
static GParamSpec* boxes_display_page_properties[BOXES_DISPLAY_PAGE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define BOXES_TYPE_UI (boxes_ui_get_type ())
#define BOXES_UI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_UI, BoxesUI))
#define BOXES_IS_UI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_UI))
#define BOXES_UI_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), BOXES_TYPE_UI, BoxesUIIface))

typedef struct _BoxesUI BoxesUI;
typedef struct _BoxesUIIface BoxesUIIface;
typedef enum  {
	BOXES_UI_STATE_NONE,
	BOXES_UI_STATE_COLLECTION,
	BOXES_UI_STATE_CREDS,
	BOXES_UI_STATE_DISPLAY,
	BOXES_UI_STATE_WIZARD,
	BOXES_UI_STATE_PROPERTIES,
	BOXES_UI_STATE_TROUBLESHOOT
} BoxesUIState;

#define BOXES_TYPE_UI_STATE (boxes_ui_state_get_type ())
typedef struct _BoxesAppWindowPrivate BoxesAppWindowPrivate;

#define BOXES_TYPE_SEARCHBAR (boxes_searchbar_get_type ())
#define BOXES_SEARCHBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SEARCHBAR, BoxesSearchbar))
#define BOXES_SEARCHBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SEARCHBAR, BoxesSearchbarClass))
#define BOXES_IS_SEARCHBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SEARCHBAR))
#define BOXES_IS_SEARCHBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SEARCHBAR))
#define BOXES_SEARCHBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SEARCHBAR, BoxesSearchbarClass))

typedef struct _BoxesSearchbar BoxesSearchbar;
typedef struct _BoxesSearchbarClass BoxesSearchbarClass;

#define BOXES_TYPE_TOPBAR (boxes_topbar_get_type ())
#define BOXES_TOPBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_TOPBAR, BoxesTopbar))
#define BOXES_TOPBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_TOPBAR, BoxesTopbarClass))
#define BOXES_IS_TOPBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_TOPBAR))
#define BOXES_IS_TOPBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_TOPBAR))
#define BOXES_TOPBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_TOPBAR, BoxesTopbarClass))

typedef struct _BoxesTopbar BoxesTopbar;
typedef struct _BoxesTopbarClass BoxesTopbarClass;

#define BOXES_TYPE_TOAST_OVERLAY (boxes_toast_overlay_get_type ())
#define BOXES_TOAST_OVERLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_TOAST_OVERLAY, BoxesToastOverlay))
#define BOXES_TOAST_OVERLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_TOAST_OVERLAY, BoxesToastOverlayClass))
#define BOXES_IS_TOAST_OVERLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_TOAST_OVERLAY))
#define BOXES_IS_TOAST_OVERLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_TOAST_OVERLAY))
#define BOXES_TOAST_OVERLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_TOAST_OVERLAY, BoxesToastOverlayClass))

typedef struct _BoxesToastOverlay BoxesToastOverlay;
typedef struct _BoxesToastOverlayClass BoxesToastOverlayClass;

#define BOXES_TYPE_TROUBLESHOOT_VIEW (boxes_troubleshoot_view_get_type ())
#define BOXES_TROUBLESHOOT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_TROUBLESHOOT_VIEW, BoxesTroubleshootView))
#define BOXES_TROUBLESHOOT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_TROUBLESHOOT_VIEW, BoxesTroubleshootViewClass))
#define BOXES_IS_TROUBLESHOOT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_TROUBLESHOOT_VIEW))
#define BOXES_IS_TROUBLESHOOT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_TROUBLESHOOT_VIEW))
#define BOXES_TROUBLESHOOT_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_TROUBLESHOOT_VIEW, BoxesTroubleshootViewClass))

typedef struct _BoxesTroubleshootView BoxesTroubleshootView;
typedef struct _BoxesTroubleshootViewClass BoxesTroubleshootViewClass;
typedef struct _BoxesTopbarPrivate BoxesTopbarPrivate;

#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 _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block24Data Block24Data;

struct _BoxesDisplayPage {
	GtkBox parent_instance;
	BoxesDisplayPagePrivate * priv;
	BoxesDisplayToolbar* toolbar;
	GtkLabel* size_label;
	GtkBox* transfer_message_box;
	BoxesTransferPopover* transfer_popover;
};

struct _BoxesDisplayPageClass {
	GtkBoxClass parent_class;
};

struct _BoxesDisplayPagePrivate {
	GtkEventBox* event_box;
	BoxesDisplayToolbar* overlay_toolbar;
	GtkEventBox* overlay_toolbar_box;
	guint toolbar_hide_id;
	guint toolbar_show_id;
	gulong cursor_id;
	gulong widget_drag_motion_id;
	gulong transfer_message_box_drag_leave_id;
	gulong transfer_message_box_drag_motion_id;
	guint overlay_toolbar_invisible_timeout;
	guint size_label_timeout;
	BoxesAppWindow* window;
	BoxesDisplay* display;
	gulong can_grab_mouse_id;
	gulong mouse_grabbed_id;
	gulong keyboard_grabbed_id;
	gint width;
	gint height;
};

struct _BoxesUIIface {
	GTypeInterface parent_iface;
	BoxesUIState (*get_previous_ui_state) (BoxesUI* self);
	void (*set_previous_ui_state) (BoxesUI* self, BoxesUIState value);
	BoxesUIState (*get_ui_state) (BoxesUI* self);
	void (*set_ui_state) (BoxesUI* self, BoxesUIState value);
};

struct _BoxesAppWindow {
	HdyApplicationWindow parent_instance;
	BoxesAppWindowPrivate * priv;
	BoxesSearchbar* searchbar;
	BoxesTopbar* topbar;
	BoxesToastOverlay* toast_overlay;
	BoxesDisplayPage* display_page;
	HdyStatusPage* empty_boxes;
	BoxesTroubleshootView* troubleshoot_view;
	GtkStack* below_bin;
	GSettings* settings;
};

struct _BoxesAppWindowClass {
	HdyApplicationWindowClass parent_class;
};

struct _BoxesTopbar {
	GtkStack parent_instance;
	BoxesTopbarPrivate * priv;
	BoxesDisplayToolbar* display_toolbar;
	gchar* _status;
};

struct _BoxesTopbarClass {
	GtkStackClass parent_class;
};

struct _Block24Data {
	int _ref_count_;
	BoxesDisplayPage* self;
	gulong draw_id;
	GtkWidget* widget;
};

static gint BoxesDisplayPage_private_offset;
static gpointer boxes_display_page_parent_class = NULL;

VALA_EXTERN GType boxes_display_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesDisplayPage, g_object_unref)
VALA_EXTERN GType boxes_display_toolbar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesDisplayToolbar, g_object_unref)
VALA_EXTERN GType boxes_transfer_popover_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesTransferPopover, g_object_unref)
VALA_EXTERN GType boxes_app_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesAppWindow, g_object_unref)
VALA_EXTERN GType boxes_display_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesDisplay, g_object_unref)
static void boxes_display_page_toolbar_event_stop (BoxesDisplayPage* self);
VALA_EXTERN void boxes_display_page_setup_ui (BoxesDisplayPage* self,
                                  BoxesAppWindow* window);
static gboolean __lambda51_ (BoxesDisplayPage* self,
                      GdkEventWindowState* event);
static void boxes_display_page_update_toolbar_visible (BoxesDisplayPage* self);
static gboolean ___lambda51__gtk_widget_window_state_event (GtkWidget* _sender,
                                                     GdkEventWindowState* event,
                                                     gpointer self);
VALA_EXTERN void boxes_display_toolbar_setup_ui (BoxesDisplayToolbar* self,
                                     BoxesAppWindow* window);
static void _vala_array_add3 (GtkTargetEntry* * array,
                       gint* length,
                       gint* size,
                       const GtkTargetEntry* value);
VALA_EXTERN GType boxes_ui_state_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType boxes_ui_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesUI, g_object_unref)
VALA_EXTERN GType boxes_searchbar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesSearchbar, g_object_unref)
VALA_EXTERN GType boxes_topbar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesTopbar, g_object_unref)
VALA_EXTERN GType boxes_toast_overlay_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesToastOverlay, g_object_unref)
VALA_EXTERN GType boxes_troubleshoot_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesTroubleshootView, g_object_unref)
VALA_EXTERN BoxesTransferPopover* boxes_transfer_popover_new (BoxesDisplayToolbar* toolbar);
VALA_EXTERN BoxesTransferPopover* boxes_transfer_popover_construct (GType object_type,
                                                        BoxesDisplayToolbar* toolbar);
VALA_EXTERN gboolean boxes_app_window_get_fullscreened (BoxesAppWindow* self);
static gboolean boxes_display_page_get_can_grab_mouse (BoxesDisplayPage* self);
static void boxes_display_page_set_overlay_toolbar_visible (BoxesDisplayPage* self,
                                                     gboolean visible);
VALA_EXTERN void boxes_display_page_add_transfer (BoxesDisplayPage* self,
                                      GObject* transfer_task);
VALA_EXTERN void boxes_transfer_popover_add_transfer (BoxesTransferPopover* self,
                                          GObject* transfer_task);
VALA_EXTERN void boxes_display_page_update_subtitle (BoxesDisplayPage* self);
VALA_EXTERN GType boxes_collection_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesCollectionItem, g_object_unref)
VALA_EXTERN GType boxes_machine_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesMachine, g_object_unref)
VALA_EXTERN BoxesCollectionItem* boxes_app_window_get_current_item (BoxesAppWindow* self);
static gboolean boxes_display_page_get_mouse_grabbed (BoxesDisplayPage* self);
static gboolean boxes_display_page_get_keyboard_grabbed (BoxesDisplayPage* self);
VALA_EXTERN void boxes_display_page_show_display (BoxesDisplayPage* self,
                                      BoxesDisplay* display,
                                      GtkWidget* widget);
VALA_EXTERN void boxes_display_page_replace_display (BoxesDisplayPage* self,
                                         BoxesDisplay* display,
                                         GtkWidget* widget);
static Block24Data* block24_data_ref (Block24Data* _data24_);
static void block24_data_unref (void * _userdata_);
VALA_EXTERN GtkWidget* boxes_display_page_remove_display (BoxesDisplayPage* self);
VALA_EXTERN gboolean boxes_display_get_can_transfer_files (BoxesDisplay* self);
static gboolean ___lambda92_ (BoxesDisplayPage* self);
static gboolean ____lambda92__gtk_widget_drag_motion (GtkWidget* _sender,
                                               GdkDragContext* context,
                                               gint x,
                                               gint y,
                                               guint time_,
                                               gpointer self);
static gboolean ___lambda93_ (BoxesDisplayPage* self);
static gboolean ____lambda93__gtk_widget_drag_motion (GtkWidget* _sender,
                                               GdkDragContext* context,
                                               gint x,
                                               gint y,
                                               guint time_,
                                               gpointer self);
static void ___lambda94_ (BoxesDisplayPage* self);
static void ____lambda94__gtk_widget_drag_leave (GtkWidget* _sender,
                                          GdkDragContext* context,
                                          guint time_,
                                          gpointer self);
static void __lambda95_ (BoxesDisplayPage* self);
static gboolean __lambda96_ (BoxesDisplayPage* self);
static gboolean ___lambda96__gsource_func (gpointer self);
static void ___lambda95__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
static void __lambda97_ (BoxesDisplayPage* self);
static gboolean __lambda98_ (BoxesDisplayPage* self);
static gboolean ___lambda98__gsource_func (gpointer self);
static void ___lambda97__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
static void __lambda99_ (BoxesDisplayPage* self);
static void ___lambda99__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
static gboolean __lambda100_ (BoxesDisplayPage* self);
static gboolean ___lambda100__gsource_func (gpointer self);
static gboolean __lambda101_ (Block24Data* _data24_);
static void __lambda102_ (Block24Data* _data24_);
static void ___lambda102__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static gboolean ___lambda101__gtk_widget_draw (GtkWidget* _sender,
                                        cairo_t* cr,
                                        gpointer self);
static gboolean boxes_display_page_on_event_box_event (BoxesDisplayPage* self,
                                                GdkEvent* event);
static gboolean _____lambda103_ (BoxesDisplayPage* self);
static gboolean ______lambda103__gsource_func (gpointer self);
static gboolean _____lambda104_ (BoxesDisplayPage* self);
static gboolean ______lambda104__gsource_func (gpointer self);
static gboolean _boxes_display_page_on_event_box_event_gtk_widget_event (GtkWidget* _sender,
                                                                  GdkEvent* event,
                                                                  gpointer self);
static void boxes_display_page_on_size_allocate (BoxesDisplayPage* self,
                                          GtkAllocation* allocation);
static gboolean __lambda105_ (BoxesDisplayPage* self);
static void boxes_display_page_show_size_allocation (BoxesDisplayPage* self);
static gboolean ___lambda105__gsource_func (gpointer self);
static void _boxes_display_page_on_size_allocate_gtk_widget_size_allocate (GtkWidget* _sender,
                                                                    GtkAllocation* allocation,
                                                                    gpointer self);
static gboolean __lambda106_ (BoxesDisplayPage* self);
static gboolean ___lambda106__gsource_func (gpointer self);
VALA_EXTERN BoxesDisplayPage* boxes_display_page_new (void);
VALA_EXTERN BoxesDisplayPage* boxes_display_page_construct (GType object_type);
VALA_EXTERN gboolean boxes_display_get_can_grab_mouse (BoxesDisplay* self);
VALA_EXTERN gboolean boxes_display_get_mouse_grabbed (BoxesDisplay* self);
VALA_EXTERN gboolean boxes_display_get_keyboard_grabbed (BoxesDisplay* self);
static void boxes_display_page_finalize (GObject * obj);
static GType boxes_display_page_get_type_once (void);
static void _vala_boxes_display_page_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec);

static inline gpointer
boxes_display_page_get_instance_private (BoxesDisplayPage* self)
{
	return G_STRUCT_MEMBER_P (self, BoxesDisplayPage_private_offset);
}

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

static gboolean
__lambda51_ (BoxesDisplayPage* self,
             GdkEventWindowState* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	boxes_display_page_update_toolbar_visible (self);
	result = FALSE;
	return result;
}

static gboolean
___lambda51__gtk_widget_window_state_event (GtkWidget* _sender,
                                            GdkEventWindowState* event,
                                            gpointer self)
{
	gboolean result;
	result = __lambda51_ ((BoxesDisplayPage*) self, event);
	return result;
}

static void
_vala_array_add3 (GtkTargetEntry* * array,
                  gint* length,
                  gint* size,
                  const GtkTargetEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkTargetEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

void
boxes_display_page_setup_ui (BoxesDisplayPage* self,
                             BoxesAppWindow* window)
{
	BoxesAppWindow* _tmp0_;
	GtkEventBox* _tmp1_;
	BoxesDisplayToolbar* _tmp2_;
	BoxesDisplayToolbar* _tmp3_;
	BoxesDisplayToolbar* _tmp4_;
	BoxesDisplayToolbar* _tmp5_;
	BoxesDisplayToolbar* _tmp6_;
	BoxesDisplayToolbar* _tmp7_;
	GtkTargetEntry* target_list = NULL;
	GtkTargetEntry* _tmp8_;
	gint target_list_length1;
	gint _target_list_size_;
	GtkTargetEntry urilist_entry = {0};
	GtkTargetEntry _tmp9_ = {0};
	GtkTargetEntry _tmp10_;
	GtkBox* _tmp11_;
	GtkTargetEntry* _tmp12_;
	gint _tmp12__length1;
	BoxesTopbar* _tmp13_;
	BoxesDisplayToolbar* _tmp14_;
	BoxesTransferPopover* _tmp15_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (window != NULL);
	_tmp0_ = _g_object_ref0 (window);
	_g_object_unref0 (self->priv->window);
	self->priv->window = _tmp0_;
	self->priv->overlay_toolbar_invisible_timeout = BOXES_APP_WINDOW_TRANSITION_DURATION;
	_tmp1_ = self->priv->event_box;
	gtk_widget_set_events ((GtkWidget*) _tmp1_, (gint) (GDK_POINTER_MOTION_MASK | GDK_SCROLL_MASK));
	g_signal_connect_object ((GtkWidget*) window, "window-state-event", (GCallback) ___lambda51__gtk_widget_window_state_event, self, 0);
	_tmp2_ = self->toolbar;
	_tmp3_ = self->priv->overlay_toolbar;
	g_object_bind_property_with_closures ((GObject*) _tmp2_, "title", (GObject*) _tmp3_, "title", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp4_ = self->toolbar;
	_tmp5_ = self->priv->overlay_toolbar;
	g_object_bind_property_with_closures ((GObject*) _tmp4_, "subtitle", (GObject*) _tmp5_, "subtitle", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp6_ = self->toolbar;
	boxes_display_toolbar_setup_ui (_tmp6_, window);
	_tmp7_ = self->priv->overlay_toolbar;
	boxes_display_toolbar_setup_ui (_tmp7_, window);
	_tmp8_ = g_new0 (GtkTargetEntry, 0);
	target_list = _tmp8_;
	target_list_length1 = 0;
	_target_list_size_ = target_list_length1;
	_tmp9_.target = "text/uri-list";
	_tmp9_.flags = (guint) 0;
	_tmp9_.info = (guint) 0;
	urilist_entry = _tmp9_;
	_tmp10_ = urilist_entry;
	_vala_array_add3 (&target_list, &target_list_length1, &_target_list_size_, &_tmp10_);
	_tmp11_ = self->transfer_message_box;
	_tmp12_ = target_list;
	_tmp12__length1 = target_list_length1;
	gtk_drag_dest_set ((GtkWidget*) _tmp11_, GTK_DEST_DEFAULT_DROP, _tmp12_, (gint) _tmp12__length1, GDK_ACTION_ASK);
	_tmp13_ = window->topbar;
	_tmp14_ = _tmp13_->display_toolbar;
	_tmp15_ = boxes_transfer_popover_new (_tmp14_);
	g_object_ref_sink (_tmp15_);
	_g_object_unref0 (self->transfer_popover);
	self->transfer_popover = _tmp15_;
	target_list = (g_free (target_list), NULL);
}

static void
boxes_display_page_update_toolbar_visible (BoxesDisplayPage* self)
{
	gboolean _tmp0_ = FALSE;
	BoxesAppWindow* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->window;
	_tmp2_ = boxes_app_window_get_fullscreened (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		gboolean _tmp4_;
		gboolean _tmp5_;
		_tmp4_ = boxes_display_page_get_can_grab_mouse (self);
		_tmp5_ = _tmp4_;
		_tmp0_ = _tmp5_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		BoxesDisplayToolbar* _tmp6_;
		_tmp6_ = self->toolbar;
		gtk_widget_set_visible ((GtkWidget*) _tmp6_, TRUE);
	} else {
		BoxesDisplayToolbar* _tmp7_;
		_tmp7_ = self->toolbar;
		gtk_widget_set_visible ((GtkWidget*) _tmp7_, FALSE);
	}
	boxes_display_page_set_overlay_toolbar_visible (self, FALSE);
}

void
boxes_display_page_add_transfer (BoxesDisplayPage* self,
                                 GObject* transfer_task)
{
	BoxesTransferPopover* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (transfer_task != NULL);
	_tmp0_ = self->transfer_popover;
	boxes_transfer_popover_add_transfer (_tmp0_, transfer_task);
}

static void
boxes_display_page_set_overlay_toolbar_visible (BoxesDisplayPage* self,
                                                gboolean visible)
{
	gboolean _tmp0_ = FALSE;
	GtkEventBox* _tmp4_;
	g_return_if_fail (self != NULL);
	if (visible) {
		BoxesDisplayToolbar* _tmp1_;
		gboolean _tmp2_;
		gboolean _tmp3_;
		_tmp1_ = self->toolbar;
		_tmp2_ = gtk_widget_get_visible ((GtkWidget*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp0_ = _tmp3_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		g_debug ("display-page.vala:100: toolbar is visible, don't show overlay toolbar");
		return;
	}
	_tmp4_ = self->priv->overlay_toolbar_box;
	gtk_widget_set_visible ((GtkWidget*) _tmp4_, visible);
}

static void
boxes_display_page_toolbar_event_stop (BoxesDisplayPage* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->toolbar_hide_id != ((guint) 0)) {
		g_source_remove (self->priv->toolbar_hide_id);
	}
	self->priv->toolbar_hide_id = (guint) 0;
	if (self->priv->toolbar_show_id != ((guint) 0)) {
		g_source_remove (self->priv->toolbar_show_id);
	}
	self->priv->toolbar_show_id = (guint) 0;
}

void
boxes_display_page_update_subtitle (BoxesDisplayPage* self)
{
	BoxesMachine* machine = NULL;
	BoxesAppWindow* _tmp0_;
	BoxesCollectionItem* _tmp1_;
	BoxesCollectionItem* _tmp2_;
	BoxesMachine* _tmp3_;
	BoxesMachine* _tmp4_;
	gchar* hint = NULL;
	gboolean _tmp5_;
	gboolean _tmp6_;
	BoxesDisplayToolbar* _tmp13_;
	const gchar* _tmp14_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->window;
	_tmp1_ = boxes_app_window_get_current_item (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (BOXES_IS_MACHINE (_tmp2_) ? ((BoxesMachine*) _tmp2_) : NULL);
	machine = _tmp3_;
	_tmp4_ = machine;
	g_return_if_fail (_tmp4_ != NULL);
	hint = NULL;
	_tmp5_ = boxes_display_page_get_can_grab_mouse (self);
	_tmp6_ = _tmp5_;
	if (_tmp6_) {
		gboolean _tmp7_;
		gboolean _tmp8_;
		_tmp7_ = boxes_display_page_get_mouse_grabbed (self);
		_tmp8_ = _tmp7_;
		if (_tmp8_) {
			gchar* _tmp9_;
			_tmp9_ = g_strdup (_ ("Press (left) Ctrl+Alt to ungrab"));
			_g_free0 (hint);
			hint = _tmp9_;
		}
	} else {
		gboolean _tmp10_;
		gboolean _tmp11_;
		_tmp10_ = boxes_display_page_get_keyboard_grabbed (self);
		_tmp11_ = _tmp10_;
		if (_tmp11_) {
			gchar* _tmp12_;
			_tmp12_ = g_strdup (_ ("Press & release (left) Ctrl+Alt to ungrab keyboard."));
			_g_free0 (hint);
			hint = _tmp12_;
		}
	}
	_tmp13_ = self->toolbar;
	_tmp14_ = hint;
	hdy_header_bar_set_subtitle ((HdyHeaderBar*) _tmp13_, _tmp14_);
	_g_free0 (hint);
	_g_object_unref0 (machine);
}

void
boxes_display_page_show_display (BoxesDisplayPage* self,
                                 BoxesDisplay* display,
                                 GtkWidget* widget)
{
	BoxesAppWindow* _tmp0_;
	GtkStack* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (display != NULL);
	g_return_if_fail (widget != NULL);
	boxes_display_page_replace_display (self, display, widget);
	_tmp0_ = self->priv->window;
	_tmp1_ = _tmp0_->below_bin;
	gtk_stack_set_visible_child_name (_tmp1_, "display-page");
	gtk_widget_grab_focus (widget);
}

static Block24Data*
block24_data_ref (Block24Data* _data24_)
{
	g_atomic_int_inc (&_data24_->_ref_count_);
	return _data24_;
}

static void
block24_data_unref (void * _userdata_)
{
	Block24Data* _data24_;
	_data24_ = (Block24Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data24_->_ref_count_)) {
		BoxesDisplayPage* self;
		self = _data24_->self;
		_g_object_unref0 (_data24_->widget);
		_g_object_unref0 (self);
		g_slice_free (Block24Data, _data24_);
	}
}

static gboolean
___lambda92_ (BoxesDisplayPage* self)
{
	GtkBox* _tmp0_;
	gboolean result;
	_tmp0_ = self->transfer_message_box;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, TRUE);
	result = TRUE;
	return result;
}

static gboolean
____lambda92__gtk_widget_drag_motion (GtkWidget* _sender,
                                      GdkDragContext* context,
                                      gint x,
                                      gint y,
                                      guint time_,
                                      gpointer self)
{
	gboolean result;
	result = ___lambda92_ ((BoxesDisplayPage*) self);
	return result;
}

static gboolean
___lambda93_ (BoxesDisplayPage* self)
{
	gboolean result;
	result = TRUE;
	return result;
}

static gboolean
____lambda93__gtk_widget_drag_motion (GtkWidget* _sender,
                                      GdkDragContext* context,
                                      gint x,
                                      gint y,
                                      guint time_,
                                      gpointer self)
{
	gboolean result;
	result = ___lambda93_ ((BoxesDisplayPage*) self);
	return result;
}

static void
___lambda94_ (BoxesDisplayPage* self)
{
	GtkBox* _tmp0_;
	_tmp0_ = self->transfer_message_box;
	gtk_widget_hide ((GtkWidget*) _tmp0_);
}

static void
____lambda94__gtk_widget_drag_leave (GtkWidget* _sender,
                                     GdkDragContext* context,
                                     guint time_,
                                     gpointer self)
{
	___lambda94_ ((BoxesDisplayPage*) self);
}

static gboolean
__lambda96_ (BoxesDisplayPage* self)
{
	gboolean result;
	boxes_display_page_update_subtitle (self);
	result = FALSE;
	return result;
}

static gboolean
___lambda96__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda96_ ((BoxesDisplayPage*) self);
	return result;
}

static void
__lambda95_ (BoxesDisplayPage* self)
{
	g_idle_add_full (G_PRIORITY_HIGH, ___lambda96__gsource_func, g_object_ref (self), g_object_unref);
}

static void
___lambda95__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda95_ ((BoxesDisplayPage*) self);
}

static gboolean
__lambda98_ (BoxesDisplayPage* self)
{
	gboolean result;
	boxes_display_page_update_subtitle (self);
	result = FALSE;
	return result;
}

static gboolean
___lambda98__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda98_ ((BoxesDisplayPage*) self);
	return result;
}

static void
__lambda97_ (BoxesDisplayPage* self)
{
	g_idle_add_full (G_PRIORITY_HIGH, ___lambda98__gsource_func, g_object_ref (self), g_object_unref);
}

static void
___lambda97__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda97_ ((BoxesDisplayPage*) self);
}

static void
__lambda99_ (BoxesDisplayPage* self)
{
	boxes_display_page_update_toolbar_visible (self);
}

static void
___lambda99__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda99_ ((BoxesDisplayPage*) self);
}

static gboolean
__lambda100_ (BoxesDisplayPage* self)
{
	BoxesAppWindow* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean result;
	boxes_display_page_update_toolbar_visible (self);
	self->priv->overlay_toolbar_invisible_timeout = (guint) 1000;
	_tmp0_ = self->priv->window;
	_tmp1_ = boxes_app_window_get_fullscreened (_tmp0_);
	_tmp2_ = _tmp1_;
	boxes_display_page_set_overlay_toolbar_visible (self, _tmp2_);
	result = FALSE;
	return result;
}

static gboolean
___lambda100__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda100_ ((BoxesDisplayPage*) self);
	return result;
}

static void
__lambda102_ (Block24Data* _data24_)
{
	BoxesDisplayPage* self;
	GtkEventBox* _tmp0_;
	GdkWindow* _tmp1_;
	GdkWindow* _tmp2_;
	GdkCursor* _tmp3_;
	GdkCursor* _tmp4_;
	self = _data24_->self;
	_tmp0_ = self->priv->event_box;
	_tmp1_ = gtk_widget_get_window ((GtkWidget*) _tmp0_);
	_tmp2_ = gtk_widget_get_window (_data24_->widget);
	_tmp3_ = gdk_window_get_cursor (_tmp2_);
	_tmp4_ = _tmp3_;
	gdk_window_set_cursor (_tmp1_, _tmp4_);
}

static void
___lambda102__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda102_ (self);
}

static gboolean
__lambda101_ (Block24Data* _data24_)
{
	BoxesDisplayPage* self;
	GdkWindow* _tmp0_;
	gulong _tmp1_;
	gboolean result;
	self = _data24_->self;
	g_signal_handler_disconnect ((GObject*) _data24_->widget, _data24_->draw_id);
	_tmp0_ = gtk_widget_get_window (_data24_->widget);
	_tmp1_ = g_signal_connect_data ((GObject*) _tmp0_, "notify::cursor", (GCallback) ___lambda102__g_object_notify, block24_data_ref (_data24_), (GClosureNotify) block24_data_unref, 0);
	self->priv->cursor_id = _tmp1_;
	result = FALSE;
	return result;
}

static gboolean
___lambda101__gtk_widget_draw (GtkWidget* _sender,
                               cairo_t* cr,
                               gpointer self)
{
	gboolean result;
	result = __lambda101_ (self);
	return result;
}

void
boxes_display_page_replace_display (BoxesDisplayPage* self,
                                    BoxesDisplay* display,
                                    GtkWidget* widget)
{
	Block24Data* _data24_;
	GtkWidget* _tmp0_;
	GtkEventBox* _tmp1_;
	GtkWidget* _tmp2_;
	GtkWidget* _tmp3_;
	GtkWidget* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	BoxesDisplay* _tmp12_;
	gulong _tmp13_;
	gulong _tmp14_;
	gulong _tmp15_;
	GtkEventBox* _tmp16_;
	GtkEventBox* _tmp17_;
	gulong _tmp18_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (display != NULL);
	g_return_if_fail (widget != NULL);
	_data24_ = g_slice_new0 (Block24Data);
	_data24_->_ref_count_ = 1;
	_data24_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (widget);
	_g_object_unref0 (_data24_->widget);
	_data24_->widget = _tmp0_;
	_tmp1_ = self->priv->event_box;
	_tmp2_ = gtk_bin_get_child ((GtkBin*) _tmp1_);
	if (_tmp2_ == _data24_->widget) {
		block24_data_unref (_data24_);
		_data24_ = NULL;
		return;
	}
	_tmp3_ = boxes_display_page_remove_display (self);
	_tmp4_ = _tmp3_;
	_g_object_unref0 (_tmp4_);
	_tmp5_ = boxes_display_get_can_transfer_files (display);
	_tmp6_ = _tmp5_;
	if (_tmp6_) {
		gulong _tmp7_;
		GtkBox* _tmp8_;
		gulong _tmp9_;
		GtkBox* _tmp10_;
		gulong _tmp11_;
		_tmp7_ = g_signal_connect_object (_data24_->widget, "drag-motion", (GCallback) ____lambda92__gtk_widget_drag_motion, self, 0);
		self->priv->widget_drag_motion_id = _tmp7_;
		_tmp8_ = self->transfer_message_box;
		_tmp9_ = g_signal_connect_object ((GtkWidget*) _tmp8_, "drag-motion", (GCallback) ____lambda93__gtk_widget_drag_motion, self, 0);
		self->priv->transfer_message_box_drag_motion_id = _tmp9_;
		_tmp10_ = self->transfer_message_box;
		_tmp11_ = g_signal_connect_object ((GtkWidget*) _tmp10_, "drag-leave", (GCallback) ____lambda94__gtk_widget_drag_leave, self, 0);
		self->priv->transfer_message_box_drag_leave_id = _tmp11_;
	}
	_tmp12_ = _g_object_ref0 (display);
	_g_object_unref0 (self->priv->display);
	self->priv->display = _tmp12_;
	_tmp13_ = g_signal_connect_object ((GObject*) display, "notify::mouse-grabbed", (GCallback) ___lambda95__g_object_notify, self, 0);
	self->priv->mouse_grabbed_id = _tmp13_;
	_tmp14_ = g_signal_connect_object ((GObject*) display, "notify::keyboard-grabbed", (GCallback) ___lambda97__g_object_notify, self, 0);
	self->priv->keyboard_grabbed_id = _tmp14_;
	boxes_display_page_update_toolbar_visible (self);
	_tmp15_ = g_signal_connect_object ((GObject*) display, "notify::can-grab-mouse", (GCallback) ___lambda99__g_object_notify, self, 0);
	self->priv->can_grab_mouse_id = _tmp15_;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda100__gsource_func, g_object_ref (self), g_object_unref);
	boxes_display_page_update_subtitle (self);
	gtk_widget_set_events (_data24_->widget, gtk_widget_get_events (_data24_->widget) & (~GDK_POINTER_MOTION_MASK));
	_tmp16_ = self->priv->event_box;
	gtk_container_add ((GtkContainer*) _tmp16_, _data24_->widget);
	_tmp17_ = self->priv->event_box;
	gtk_widget_show_all ((GtkWidget*) _tmp17_);
	_data24_->draw_id = (gulong) 0;
	_tmp18_ = g_signal_connect_data (_data24_->widget, "draw", (GCallback) ___lambda101__gtk_widget_draw, block24_data_ref (_data24_), (GClosureNotify) block24_data_unref, 0);
	_data24_->draw_id = _tmp18_;
	block24_data_unref (_data24_);
	_data24_ = NULL;
}

GtkWidget*
boxes_display_page_remove_display (BoxesDisplayPage* self)
{
	GtkWidget* widget = NULL;
	GtkEventBox* _tmp3_;
	GtkWidget* _tmp4_;
	GtkWidget* _tmp5_;
	GtkWidget* _tmp10_;
	GtkWidget* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (self->priv->mouse_grabbed_id != ((gulong) 0)) {
		BoxesDisplay* _tmp0_;
		_tmp0_ = self->priv->display;
		g_signal_handler_disconnect ((GObject*) _tmp0_, self->priv->mouse_grabbed_id);
		self->priv->mouse_grabbed_id = (gulong) 0;
	}
	if (self->priv->can_grab_mouse_id != ((gulong) 0)) {
		BoxesDisplay* _tmp1_;
		_tmp1_ = self->priv->display;
		g_signal_handler_disconnect ((GObject*) _tmp1_, self->priv->can_grab_mouse_id);
		self->priv->can_grab_mouse_id = (gulong) 0;
	}
	if (self->priv->keyboard_grabbed_id != ((gulong) 0)) {
		BoxesDisplay* _tmp2_;
		_tmp2_ = self->priv->display;
		g_signal_handler_disconnect ((GObject*) _tmp2_, self->priv->keyboard_grabbed_id);
		self->priv->keyboard_grabbed_id = (gulong) 0;
	}
	_g_object_unref0 (self->priv->display);
	self->priv->display = NULL;
	_tmp3_ = self->priv->event_box;
	_tmp4_ = gtk_bin_get_child ((GtkBin*) _tmp3_);
	_tmp5_ = _g_object_ref0 (_tmp4_);
	widget = _tmp5_;
	if (self->priv->cursor_id != ((gulong) 0)) {
		GtkWidget* _tmp6_;
		GdkWindow* _tmp7_;
		_tmp6_ = widget;
		_tmp7_ = gtk_widget_get_window (_tmp6_);
		g_signal_handler_disconnect ((GObject*) _tmp7_, self->priv->cursor_id);
		self->priv->cursor_id = (gulong) 0;
	}
	if (self->priv->transfer_message_box_drag_leave_id != ((gulong) 0)) {
		GtkBox* _tmp8_;
		_tmp8_ = self->transfer_message_box;
		g_signal_handler_disconnect ((GObject*) _tmp8_, self->priv->transfer_message_box_drag_leave_id);
		self->priv->transfer_message_box_drag_leave_id = (gulong) 0;
	}
	if (self->priv->transfer_message_box_drag_motion_id != ((gulong) 0)) {
		GtkBox* _tmp9_;
		_tmp9_ = self->transfer_message_box;
		g_signal_handler_disconnect ((GObject*) _tmp9_, self->priv->transfer_message_box_drag_motion_id);
		self->priv->transfer_message_box_drag_motion_id = (gulong) 0;
	}
	_tmp10_ = widget;
	if (_tmp10_ != NULL) {
		GtkEventBox* _tmp12_;
		GtkWidget* _tmp13_;
		if (self->priv->widget_drag_motion_id != ((gulong) 0)) {
			GtkWidget* _tmp11_;
			_tmp11_ = widget;
			g_signal_handler_disconnect ((GObject*) _tmp11_, self->priv->widget_drag_motion_id);
			self->priv->widget_drag_motion_id = (gulong) 0;
		}
		_tmp12_ = self->priv->event_box;
		_tmp13_ = widget;
		gtk_container_remove ((GtkContainer*) _tmp12_, _tmp13_);
	}
	result = widget;
	return result;
}

static gboolean
_____lambda103_ (BoxesDisplayPage* self)
{
	gboolean result;
	boxes_display_page_set_overlay_toolbar_visible (self, TRUE);
	self->priv->toolbar_show_id = (guint) 0;
	result = FALSE;
	return result;
}

static gboolean
______lambda103__gsource_func (gpointer self)
{
	gboolean result;
	result = _____lambda103_ ((BoxesDisplayPage*) self);
	return result;
}

static gboolean
_____lambda104_ (BoxesDisplayPage* self)
{
	gboolean result;
	boxes_display_page_set_overlay_toolbar_visible (self, FALSE);
	self->priv->toolbar_hide_id = (guint) 0;
	self->priv->overlay_toolbar_invisible_timeout = BOXES_APP_WINDOW_TRANSITION_DURATION;
	result = FALSE;
	return result;
}

static gboolean
______lambda104__gsource_func (gpointer self)
{
	gboolean result;
	result = _____lambda104_ ((BoxesDisplayPage*) self);
	return result;
}

static gboolean
boxes_display_page_on_event_box_event (BoxesDisplayPage* self,
                                       GdkEvent* event)
{
	gboolean _tmp0_ = FALSE;
	BoxesAppWindow* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GtkEventBox* _tmp14_;
	GtkWidget* _tmp15_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp1_ = self->priv->window;
	_tmp2_ = boxes_app_window_get_fullscreened (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		_tmp0_ = event->type == GDK_MOTION_NOTIFY;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gdouble x = 0.0;
		GdkEventMotion* _tmp4_;
		GdkEventMotion* _tmp5_;
		gdouble y = 0.0;
		GdkEventMotion* _tmp6_;
		GdkEventMotion* _tmp7_;
		gboolean _tmp8_ = FALSE;
		gboolean _tmp9_ = FALSE;
		gboolean _tmp10_ = FALSE;
		_tmp4_ = (GdkEventMotion *) (event);
		_tmp5_ = _tmp4_;
		x = _tmp5_->x;
		_tmp6_ = (GdkEventMotion *) (event);
		_tmp7_ = _tmp6_;
		y = _tmp7_->y;
		if (x >= ((gdouble) BOXES_DISPLAY_PAGE_SCREEN_EDGE_WIDTH)) {
			_tmp10_ = x <= ((gdouble) (gtk_widget_get_allocated_width ((GtkWidget*) self) - BOXES_DISPLAY_PAGE_SCREEN_EDGE_WIDTH));
		} else {
			_tmp10_ = FALSE;
		}
		if (_tmp10_) {
			_tmp9_ = y <= ((gdouble) 0);
		} else {
			_tmp9_ = FALSE;
		}
		if (_tmp9_) {
			_tmp8_ = self->priv->toolbar_show_id == ((guint) 0);
		} else {
			_tmp8_ = FALSE;
		}
		if (_tmp8_) {
			GdkEventMotion* _tmp11_;
			GdkEventMotion* _tmp12_;
			boxes_display_page_toolbar_event_stop (self);
			_tmp11_ = (GdkEventMotion *) (event);
			_tmp12_ = _tmp11_;
			if ((_tmp12_->state & ((((((((((GDK_SHIFT_MASK | GDK_CONTROL_MASK) | GDK_MOD1_MASK) | GDK_SUPER_MASK) | GDK_HYPER_MASK) | GDK_META_MASK) | GDK_BUTTON1_MASK) | GDK_BUTTON2_MASK) | GDK_BUTTON3_MASK) | GDK_BUTTON4_MASK) | GDK_BUTTON5_MASK)) == 0) {
				self->priv->toolbar_show_id = g_timeout_add_full (G_PRIORITY_DEFAULT, BOXES_APP_WINDOW_TRANSITION_DURATION, ______lambda103__gsource_func, g_object_ref (self), g_object_unref);
			}
		} else {
			gboolean _tmp13_ = FALSE;
			if (y > ((gdouble) 5)) {
				_tmp13_ = self->priv->toolbar_hide_id == ((guint) 0);
			} else {
				_tmp13_ = FALSE;
			}
			if (_tmp13_) {
				boxes_display_page_toolbar_event_stop (self);
				self->priv->toolbar_hide_id = g_timeout_add_full (G_PRIORITY_DEFAULT, self->priv->overlay_toolbar_invisible_timeout, ______lambda104__gsource_func, g_object_ref (self), g_object_unref);
			}
		}
	}
	if (event->type == GDK_GRAB_BROKEN) {
		result = FALSE;
		return result;
	}
	_tmp14_ = self->priv->event_box;
	_tmp15_ = gtk_bin_get_child ((GtkBin*) _tmp14_);
	if (_tmp15_ != NULL) {
		GtkWidget* child = NULL;
		GtkEventBox* _tmp16_;
		GtkWidget* _tmp17_;
		GtkWidget* _tmp18_;
		gdouble offset_x = 0.0;
		GtkWidget* _tmp19_;
		gdouble offset_y = 0.0;
		GtkWidget* _tmp20_;
		GtkWidget* _tmp29_;
		_tmp16_ = self->priv->event_box;
		_tmp17_ = gtk_bin_get_child ((GtkBin*) _tmp16_);
		_tmp18_ = _g_object_ref0 (_tmp17_);
		child = _tmp18_;
		_tmp19_ = child;
		offset_x = (gtk_widget_get_allocated_width ((GtkWidget*) self) - gtk_widget_get_allocated_width (_tmp19_)) / 2.0;
		_tmp20_ = child;
		offset_y = (gtk_widget_get_allocated_height ((GtkWidget*) self) - gtk_widget_get_allocated_height (_tmp20_)) / 2.0;
		switch (gdk_event_get_event_type (event)) {
			case GDK_MOTION_NOTIFY:
			{
				GdkEventMotion* _tmp21_;
				GdkEventMotion* _tmp22_;
				GdkEventMotion* _tmp23_;
				GdkEventMotion* _tmp24_;
				GdkEventMotion* _tmp25_;
				GdkEventMotion* _tmp26_;
				GdkEventMotion* _tmp27_;
				GdkEventMotion* _tmp28_;
				_tmp21_ = (GdkEventMotion *) (event);
				_tmp22_ = _tmp21_;
				_tmp23_ = (GdkEventMotion *) (event);
				_tmp24_ = _tmp23_;
				_tmp24_->x = _tmp24_->x - offset_x;
				_tmp25_ = (GdkEventMotion *) (event);
				_tmp26_ = _tmp25_;
				_tmp27_ = (GdkEventMotion *) (event);
				_tmp28_ = _tmp27_;
				_tmp28_->y = _tmp28_->y - offset_y;
				break;
			}
			default:
			{
				break;
			}
		}
		_tmp29_ = child;
		gtk_widget_event (_tmp29_, event);
		_g_object_unref0 (child);
	}
	result = FALSE;
	return result;
}

static gboolean
_boxes_display_page_on_event_box_event_gtk_widget_event (GtkWidget* _sender,
                                                         GdkEvent* event,
                                                         gpointer self)
{
	gboolean result;
	result = boxes_display_page_on_event_box_event ((BoxesDisplayPage*) self, event);
	return result;
}

static gboolean
__lambda105_ (BoxesDisplayPage* self)
{
	gboolean result;
	boxes_display_page_show_size_allocation (self);
	result = FALSE;
	return result;
}

static gboolean
___lambda105__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda105_ ((BoxesDisplayPage*) self);
	return result;
}

static void
boxes_display_page_on_size_allocate (BoxesDisplayPage* self,
                                     GtkAllocation* allocation)
{
	gboolean _tmp0_ = FALSE;
	GtkAllocation _tmp1_;
	GtkAllocation _tmp3_;
	GtkAllocation _tmp4_;
	GtkLabel* _tmp5_;
	GtkAllocation _tmp6_;
	GtkAllocation _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (allocation != NULL);
	_tmp1_ = *allocation;
	if (self->priv->width == _tmp1_.width) {
		GtkAllocation _tmp2_;
		_tmp2_ = *allocation;
		_tmp0_ = self->priv->height == _tmp2_.height;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		return;
	}
	_tmp3_ = *allocation;
	self->priv->width = _tmp3_.width;
	_tmp4_ = *allocation;
	self->priv->height = _tmp4_.height;
	_tmp5_ = self->size_label;
	_tmp6_ = *allocation;
	_tmp7_ = *allocation;
	_tmp8_ = g_strdup_printf (_ ("%d×%d"), _tmp6_.width, _tmp7_.height);
	_tmp9_ = _tmp8_;
	gtk_label_set_label (_tmp5_, _tmp9_);
	_g_free0 (_tmp9_);
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda105__gsource_func, g_object_ref (self), g_object_unref);
}

static void
_boxes_display_page_on_size_allocate_gtk_widget_size_allocate (GtkWidget* _sender,
                                                               GtkAllocation* allocation,
                                                               gpointer self)
{
	boxes_display_page_on_size_allocate ((BoxesDisplayPage*) self, allocation);
}

static gboolean
__lambda106_ (BoxesDisplayPage* self)
{
	GtkLabel* _tmp0_;
	gboolean result;
	_tmp0_ = self->size_label;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, FALSE);
	self->priv->size_label_timeout = (guint) 0;
	result = FALSE;
	return result;
}

static gboolean
___lambda106__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda106_ ((BoxesDisplayPage*) self);
	return result;
}

static void
boxes_display_page_show_size_allocation (BoxesDisplayPage* self)
{
	GtkLabel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->size_label;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, TRUE);
	if (self->priv->size_label_timeout != ((guint) 0)) {
		g_source_remove (self->priv->size_label_timeout);
		self->priv->size_label_timeout = (guint) 0;
	}
	self->priv->size_label_timeout = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 3, ___lambda106__gsource_func, g_object_ref (self), g_object_unref);
}

BoxesDisplayPage*
boxes_display_page_construct (GType object_type)
{
	BoxesDisplayPage * self = NULL;
	self = (BoxesDisplayPage*) g_object_new (object_type, NULL);
	return self;
}

BoxesDisplayPage*
boxes_display_page_new (void)
{
	return boxes_display_page_construct (BOXES_TYPE_DISPLAY_PAGE);
}

static gboolean
boxes_display_page_get_can_grab_mouse (BoxesDisplayPage* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	BoxesDisplay* _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->display;
	if (_tmp1_ != NULL) {
		BoxesDisplay* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = self->priv->display;
		_tmp3_ = boxes_display_get_can_grab_mouse (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gboolean
boxes_display_page_get_mouse_grabbed (BoxesDisplayPage* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	BoxesDisplay* _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->display;
	if (_tmp1_ != NULL) {
		BoxesDisplay* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = self->priv->display;
		_tmp3_ = boxes_display_get_mouse_grabbed (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gboolean
boxes_display_page_get_keyboard_grabbed (BoxesDisplayPage* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	BoxesDisplay* _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->display;
	if (_tmp1_ != NULL) {
		BoxesDisplay* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = self->priv->display;
		_tmp3_ = boxes_display_get_keyboard_grabbed (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static void
boxes_display_page_class_init (BoxesDisplayPageClass * klass,
                               gpointer klass_data)
{
	boxes_display_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BoxesDisplayPage_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_display_page_get_property;
	G_OBJECT_CLASS (klass)->finalize = boxes_display_page_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Boxes/ui/display-page.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "toolbar", FALSE, G_STRUCT_OFFSET (BoxesDisplayPage, toolbar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "size_label", FALSE, G_STRUCT_OFFSET (BoxesDisplayPage, size_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "transfer_message_box", FALSE, G_STRUCT_OFFSET (BoxesDisplayPage, transfer_message_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "event_box", FALSE, BoxesDisplayPage_private_offset + G_STRUCT_OFFSET (BoxesDisplayPagePrivate, event_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "overlay_toolbar", FALSE, BoxesDisplayPage_private_offset + G_STRUCT_OFFSET (BoxesDisplayPagePrivate, overlay_toolbar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "overlay_toolbar_box", FALSE, BoxesDisplayPage_private_offset + G_STRUCT_OFFSET (BoxesDisplayPagePrivate, overlay_toolbar_box));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_event_box_event", G_CALLBACK(_boxes_display_page_on_event_box_event_gtk_widget_event));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_size_allocate", G_CALLBACK(_boxes_display_page_on_size_allocate_gtk_widget_size_allocate));
}

static void
boxes_display_page_instance_init (BoxesDisplayPage * self,
                                  gpointer klass)
{
	self->priv = boxes_display_page_get_instance_private (self);
	self->priv->widget_drag_motion_id = (gulong) 0;
	self->priv->transfer_message_box_drag_leave_id = (gulong) 0;
	self->priv->transfer_message_box_drag_motion_id = (gulong) 0;
	self->priv->width = -1;
	self->priv->height = -1;
	g_type_ensure (BOXES_TYPE_DISPLAY_TOOLBAR);
	g_type_ensure (BOXES_TYPE_DISPLAY_TOOLBAR);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
boxes_display_page_finalize (GObject * obj)
{
	BoxesDisplayPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_DISPLAY_PAGE, BoxesDisplayPage);
	boxes_display_page_toolbar_event_stop (self);
	_g_object_unref0 (self->transfer_popover);
	_g_object_unref0 (self->priv->window);
	_g_object_unref0 (self->priv->display);
	G_OBJECT_CLASS (boxes_display_page_parent_class)->finalize (obj);
}

static GType
boxes_display_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BoxesDisplayPageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_display_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesDisplayPage), 0, (GInstanceInitFunc) boxes_display_page_instance_init, NULL };
	GType boxes_display_page_type_id;
	boxes_display_page_type_id = g_type_register_static (gtk_box_get_type (), "BoxesDisplayPage", &g_define_type_info, 0);
	BoxesDisplayPage_private_offset = g_type_add_instance_private (boxes_display_page_type_id, sizeof (BoxesDisplayPagePrivate));
	return boxes_display_page_type_id;
}

GType
boxes_display_page_get_type (void)
{
	static volatile gsize boxes_display_page_type_id__once = 0;
	if (g_once_init_enter (&boxes_display_page_type_id__once)) {
		GType boxes_display_page_type_id;
		boxes_display_page_type_id = boxes_display_page_get_type_once ();
		g_once_init_leave (&boxes_display_page_type_id__once, boxes_display_page_type_id);
	}
	return boxes_display_page_type_id__once;
}

static void
_vala_boxes_display_page_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec)
{
	BoxesDisplayPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_DISPLAY_PAGE, BoxesDisplayPage);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

