/* display-page.c generated by valac 0.17.1.6-d284, the Vala compiler
 * generated from display-page.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 <stdlib.h>
#include <string.h>
#include <gdk/gdk.h>
#include <float.h>
#include <math.h>
#include <clutter/clutter.h>
#include <clutter-gtk/clutter-gtk.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <cairo.h>


#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;
typedef struct _BoxesDisplayToolbarPrivate BoxesDisplayToolbarPrivate;
#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_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_UI, BoxesUIClass))
#define BOXES_IS_UI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_UI))
#define BOXES_IS_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_UI))
#define BOXES_UI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_UI, BoxesUIClass))

typedef struct _BoxesUI BoxesUI;
typedef struct _BoxesUIClass BoxesUIClass;

#define BOXES_TYPE_APP (boxes_app_get_type ())
#define BOXES_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_APP, BoxesApp))
#define BOXES_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_APP, BoxesAppClass))
#define BOXES_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_APP))
#define BOXES_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_APP))
#define BOXES_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_APP, BoxesAppClass))

typedef struct _BoxesApp BoxesApp;
typedef struct _BoxesAppClass BoxesAppClass;
typedef struct _Block6Data Block6Data;

#define BOXES_TYPE_UI_STATE (boxes_ui_state_get_type ())

#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 (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;
typedef struct _Block7Data Block7Data;
typedef struct _BoxesUIPrivate BoxesUIPrivate;
typedef struct _BoxesAppPrivate BoxesAppPrivate;

#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_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_NOTIFICATIONBAR (boxes_notificationbar_get_type ())
#define BOXES_NOTIFICATIONBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_NOTIFICATIONBAR, BoxesNotificationbar))
#define BOXES_NOTIFICATIONBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_NOTIFICATIONBAR, BoxesNotificationbarClass))
#define BOXES_IS_NOTIFICATIONBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_NOTIFICATIONBAR))
#define BOXES_IS_NOTIFICATIONBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_NOTIFICATIONBAR))
#define BOXES_NOTIFICATIONBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_NOTIFICATIONBAR, BoxesNotificationbarClass))

typedef struct _BoxesNotificationbar BoxesNotificationbar;
typedef struct _BoxesNotificationbarClass BoxesNotificationbarClass;

#define BOXES_TYPE_SIDEBAR (boxes_sidebar_get_type ())
#define BOXES_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SIDEBAR, BoxesSidebar))
#define BOXES_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SIDEBAR, BoxesSidebarClass))
#define BOXES_IS_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SIDEBAR))
#define BOXES_IS_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SIDEBAR))
#define BOXES_SIDEBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SIDEBAR, BoxesSidebarClass))

typedef struct _BoxesSidebar BoxesSidebar;
typedef struct _BoxesSidebarClass BoxesSidebarClass;

#define BOXES_TYPE_SELECTIONBAR (boxes_selectionbar_get_type ())
#define BOXES_SELECTIONBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SELECTIONBAR, BoxesSelectionbar))
#define BOXES_SELECTIONBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SELECTIONBAR, BoxesSelectionbarClass))
#define BOXES_IS_SELECTIONBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SELECTIONBAR))
#define BOXES_IS_SELECTIONBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SELECTIONBAR))
#define BOXES_SELECTIONBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SELECTIONBAR, BoxesSelectionbarClass))

typedef struct _BoxesSelectionbar BoxesSelectionbar;
typedef struct _BoxesSelectionbarClass BoxesSelectionbarClass;

#define BOXES_TYPE_WIZARD (boxes_wizard_get_type ())
#define BOXES_WIZARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_WIZARD, BoxesWizard))
#define BOXES_WIZARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_WIZARD, BoxesWizardClass))
#define BOXES_IS_WIZARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_WIZARD))
#define BOXES_IS_WIZARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_WIZARD))
#define BOXES_WIZARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_WIZARD, BoxesWizardClass))

typedef struct _BoxesWizard BoxesWizard;
typedef struct _BoxesWizardClass BoxesWizardClass;

#define BOXES_TYPE_PROPERTIES (boxes_properties_get_type ())
#define BOXES_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_PROPERTIES, BoxesProperties))
#define BOXES_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_PROPERTIES, BoxesPropertiesClass))
#define BOXES_IS_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_PROPERTIES))
#define BOXES_IS_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_PROPERTIES))
#define BOXES_PROPERTIES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_PROPERTIES, BoxesPropertiesClass))

typedef struct _BoxesProperties BoxesProperties;
typedef struct _BoxesPropertiesClass BoxesPropertiesClass;

#define BOXES_TYPE_COLLECTION (boxes_collection_get_type ())
#define BOXES_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION, BoxesCollection))
#define BOXES_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION, BoxesCollectionClass))
#define BOXES_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION))
#define BOXES_IS_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION))
#define BOXES_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION, BoxesCollectionClass))

typedef struct _BoxesCollection BoxesCollection;
typedef struct _BoxesCollectionClass BoxesCollectionClass;

#define BOXES_TYPE_APP_PAGE (boxes_app_page_get_type ())

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

struct _BoxesDisplayToolbar {
	GtkToolbar parent_instance;
	BoxesDisplayToolbarPrivate * priv;
};

struct _BoxesDisplayToolbarClass {
	GtkToolbarClass parent_class;
};

struct _BoxesDisplayToolbarPrivate {
	GtkLabel* label;
};

struct _Block6Data {
	int _ref_count_;
	BoxesDisplayToolbar * self;
	BoxesApp* app;
};

typedef enum  {
	BOXES_UI_STATE_NONE,
	BOXES_UI_STATE_COLLECTION,
	BOXES_UI_STATE_CREDS,
	BOXES_UI_STATE_DISPLAY,
	BOXES_UI_STATE_SETTINGS,
	BOXES_UI_STATE_WIZARD,
	BOXES_UI_STATE_PROPERTIES
} BoxesUIState;

struct _BoxesDisplayPage {
	GObject parent_instance;
	BoxesDisplayPagePrivate * priv;
};

struct _BoxesDisplayPageClass {
	GObjectClass parent_class;
};

struct _BoxesDisplayPagePrivate {
	GtkOverlay* overlay;
	BoxesApp* app;
	GtkEventBox* event_box;
	GtkBox* box;
	BoxesDisplayToolbar* overlay_toolbar;
	BoxesDisplayToolbar* toolbar;
	guint toolbar_hide_id;
	gulong display_id;
	gulong cursor_id;
	BoxesDisplay* display;
	gulong display_can_grab_id;
	gulong display_grabbed_id;
};

struct _Block7Data {
	int _ref_count_;
	BoxesDisplayPage * self;
	BoxesApp* app;
};

struct _BoxesUI {
	GObject parent_instance;
	BoxesUIPrivate * priv;
	BoxesUIState previous_ui_state;
};

struct _BoxesUIClass {
	GObjectClass parent_class;
	void (*ui_state_changed) (BoxesUI* self);
	ClutterActor* (*get_actor) (BoxesUI* self);
};

struct _BoxesApp {
	BoxesUI parent_instance;
	BoxesAppPrivate * priv;
	GtkApplicationWindow* window;
	GtkNotebook* notebook;
	GtkClutterEmbed* embed;
	ClutterStage* stage;
	ClutterState* state;
	ClutterBox* box;
	BoxesCollectionItem* current_item;
	BoxesTopbar* topbar;
	BoxesNotificationbar* notificationbar;
	BoxesSidebar* sidebar;
	BoxesSelectionbar* selectionbar;
	guint duration;
	GSettings* settings;
	BoxesWizard* wizard;
	BoxesProperties* properties;
	BoxesDisplayPage* display_page;
	BoxesCollection* collection;
	GSimpleAction* action_properties;
	GSimpleAction* action_fullscreen;
};

struct _BoxesAppClass {
	BoxesUIClass parent_class;
};

typedef enum  {
	BOXES_APP_PAGE_MAIN,
	BOXES_APP_PAGE_DISPLAY
} BoxesAppPage;

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


static gpointer boxes_display_toolbar_parent_class = NULL;
static gpointer boxes_display_page_parent_class = NULL;

GType boxes_display_toolbar_get_type (void) G_GNUC_CONST;
#define BOXES_DISPLAY_TOOLBAR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_DISPLAY_TOOLBAR, BoxesDisplayToolbarPrivate))
enum  {
	BOXES_DISPLAY_TOOLBAR_DUMMY_PROPERTY,
	BOXES_DISPLAY_TOOLBAR_TITLE
};
GType boxes_ui_get_type (void) G_GNUC_CONST;
GType boxes_app_get_type (void) G_GNUC_CONST;
BoxesDisplayToolbar* boxes_display_toolbar_new (BoxesApp* app);
BoxesDisplayToolbar* boxes_display_toolbar_construct (GType object_type, BoxesApp* app);
static Block6Data* block6_data_ref (Block6Data* _data6_);
static void block6_data_unref (void * _userdata_);
static void __lambda20_ (Block6Data* _data6_, GtkButton* button);
GType boxes_ui_state_get_type (void) G_GNUC_CONST;
void boxes_ui_set_ui_state (BoxesUI* self, BoxesUIState value);
static void ___lambda20__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda21_ (Block6Data* _data6_, GtkButton* button);
gboolean boxes_app_get_fullscreen (BoxesApp* self);
void boxes_app_set_fullscreen (BoxesApp* self, gboolean value);
static void ___lambda21__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda22_ (Block6Data* _data6_, GtkButton* button);
static void ___lambda22__gtk_button_clicked (GtkButton* _sender, gpointer self);
void boxes_display_toolbar_set_title (BoxesDisplayToolbar* self, const gchar* value);
static void boxes_display_toolbar_finalize (GObject* obj);
static void _vala_boxes_display_toolbar_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType boxes_display_page_get_type (void) G_GNUC_CONST;
GType boxes_display_get_type (void) G_GNUC_CONST;
#define BOXES_DISPLAY_PAGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_DISPLAY_PAGE, BoxesDisplayPagePrivate))
enum  {
	BOXES_DISPLAY_PAGE_DUMMY_PROPERTY,
	BOXES_DISPLAY_PAGE_WIDGET
};
static void boxes_display_page_toolbar_event_stop (BoxesDisplayPage* self);
BoxesDisplayPage* boxes_display_page_new (BoxesApp* app);
BoxesDisplayPage* boxes_display_page_construct (GType object_type, BoxesApp* app);
static Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (void * _userdata_);
static gboolean __lambda23_ (Block7Data* _data7_, GdkEvent* event);
static void boxes_display_page_set_overlay_toolbar_visible (BoxesDisplayPage* self, gboolean visible);
GType boxes_collection_item_get_type (void) G_GNUC_CONST;
GType boxes_topbar_get_type (void) G_GNUC_CONST;
GType boxes_notificationbar_get_type (void) G_GNUC_CONST;
GType boxes_sidebar_get_type (void) G_GNUC_CONST;
GType boxes_selectionbar_get_type (void) G_GNUC_CONST;
GType boxes_wizard_get_type (void) G_GNUC_CONST;
GType boxes_properties_get_type (void) G_GNUC_CONST;
GType boxes_collection_get_type (void) G_GNUC_CONST;
static gboolean _____lambda24_ (BoxesDisplayPage* self);
static gboolean ______lambda24__gsource_func (gpointer self);
static gboolean ___lambda23__gtk_widget_event (GtkWidget* _sender, GdkEvent* event, gpointer self);
static gboolean __lambda25_ (BoxesDisplayPage* self, GdkEventWindowState* event);
static void boxes_display_page_update_toolbar_visible (BoxesDisplayPage* self);
static gboolean ___lambda25__gtk_widget_window_state_event (GtkWidget* _sender, GdkEventWindowState* event, gpointer self);
void boxes_display_page_get_size (BoxesDisplayPage* self, gint* width, gint* height);
static gboolean boxes_display_page_get_can_grab_mouse (BoxesDisplayPage* self);
void boxes_display_page_show (BoxesDisplayPage* self);
GType boxes_app_page_get_type (void) G_GNUC_CONST;
void boxes_display_page_update_title (BoxesDisplayPage* self);
GType boxes_machine_get_type (void) G_GNUC_CONST;
const gchar* boxes_collection_item_get_name (BoxesCollectionItem* self);
static gboolean boxes_display_page_get_grabbed (BoxesDisplayPage* self);
void boxes_display_page_show_display (BoxesDisplayPage* self, BoxesDisplay* display, GtkWidget* widget);
static Block8Data* block8_data_ref (Block8Data* _data8_);
static void block8_data_unref (void * _userdata_);
GtkWidget* boxes_display_page_remove_display (BoxesDisplayPage* self);
static void __lambda26_ (BoxesDisplayPage* self);
static void ___lambda26__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void __lambda27_ (BoxesDisplayPage* self);
static void ___lambda27__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static gboolean __lambda28_ (BoxesDisplayPage* self, GdkEvent* event);
static gboolean ___lambda28__gtk_widget_event (GtkWidget* _sender, GdkEvent* event, gpointer self);
static gboolean __lambda29_ (Block8Data* _data8_);
static void __lambda30_ (Block8Data* _data8_);
static void ___lambda30__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static gboolean ___lambda29__gtk_widget_draw (GtkWidget* _sender, cairo_t* cr, gpointer self);
GtkWidget* boxes_display_page_get_widget (BoxesDisplayPage* self);
gboolean boxes_display_get_can_grab_mouse (BoxesDisplay* self);
gboolean boxes_display_get_mouse_grabbed (BoxesDisplay* self);
static void boxes_display_page_finalize (GObject* obj);
static void _vala_boxes_display_page_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);


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


static Block6Data* block6_data_ref (Block6Data* _data6_) {
	g_atomic_int_inc (&_data6_->_ref_count_);
	return _data6_;
}


static void block6_data_unref (void * _userdata_) {
	Block6Data* _data6_;
	_data6_ = (Block6Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
		BoxesDisplayToolbar * self;
		self = _data6_->self;
		_g_object_unref0 (_data6_->app);
		_g_object_unref0 (self);
		g_slice_free (Block6Data, _data6_);
	}
}


static void __lambda20_ (Block6Data* _data6_, GtkButton* button) {
	BoxesDisplayToolbar * self;
	BoxesApp* _tmp0_;
	self = _data6_->self;
	g_return_if_fail (button != NULL);
	_tmp0_ = _data6_->app;
	boxes_ui_set_ui_state ((BoxesUI*) _tmp0_, BOXES_UI_STATE_COLLECTION);
}


static void ___lambda20__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda20_ (self, _sender);
}


static void __lambda21_ (Block6Data* _data6_, GtkButton* button) {
	BoxesDisplayToolbar * self;
	BoxesApp* _tmp0_;
	BoxesApp* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	self = _data6_->self;
	g_return_if_fail (button != NULL);
	_tmp0_ = _data6_->app;
	_tmp1_ = _data6_->app;
	_tmp2_ = boxes_app_get_fullscreen (_tmp1_);
	_tmp3_ = _tmp2_;
	boxes_app_set_fullscreen (_tmp0_, !_tmp3_);
}


static void ___lambda21__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda21_ (self, _sender);
}


static void __lambda22_ (Block6Data* _data6_, GtkButton* button) {
	BoxesDisplayToolbar * self;
	BoxesApp* _tmp0_;
	self = _data6_->self;
	g_return_if_fail (button != NULL);
	_tmp0_ = _data6_->app;
	boxes_ui_set_ui_state ((BoxesUI*) _tmp0_, BOXES_UI_STATE_PROPERTIES);
}


static void ___lambda22__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda22_ (self, _sender);
}


BoxesDisplayToolbar* boxes_display_toolbar_construct (GType object_type, BoxesApp* app) {
	BoxesDisplayToolbar * self = NULL;
	Block6Data* _data6_;
	BoxesApp* _tmp0_;
	BoxesApp* _tmp1_;
	GtkStyleContext* _tmp2_ = NULL;
	GtkToolItem* _tmp3_;
	GtkToolItem* _tmp4_;
	GtkToolItem* left_group;
	GtkToolItem* _tmp5_;
	GtkToolItem* _tmp6_;
	GtkToolItem* center_group;
	GtkToolItem* _tmp7_;
	GtkToolItem* _tmp8_;
	GtkToolItem* right_group;
	GtkSizeGroup* _tmp9_;
	GtkSizeGroup* size_group;
	GtkBox* _tmp10_;
	GtkBox* _tmp11_;
	GtkBox* left_box;
	GtkButton* _tmp12_;
	GtkButton* _tmp13_;
	GtkButton* back;
	GtkImage* _tmp14_;
	GtkImage* _tmp15_;
	GtkStyleContext* _tmp16_ = NULL;
	GtkLabel* _tmp17_;
	GtkLabel* _tmp18_;
	GtkLabel* _tmp19_;
	GtkLabel* _tmp20_;
	GtkBox* _tmp21_;
	GtkBox* _tmp22_;
	GtkBox* right_box;
	GtkButton* _tmp23_;
	GtkButton* _tmp24_;
	GtkButton* btn;
	GtkImage* _tmp25_;
	GtkImage* _tmp26_;
	GtkStyleContext* _tmp27_ = NULL;
	GtkButton* _tmp28_;
	GtkButton* _tmp29_;
	GtkButton* props;
	GtkImage* _tmp30_;
	GtkImage* _tmp31_;
	GtkStyleContext* _tmp32_ = NULL;
	g_return_val_if_fail (app != NULL, NULL);
	_data6_ = g_slice_new0 (Block6Data);
	_data6_->_ref_count_ = 1;
	_tmp0_ = app;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_data6_->app = _tmp1_;
	self = (BoxesDisplayToolbar*) g_object_new (object_type, NULL);
	_data6_->self = g_object_ref (self);
	gtk_toolbar_set_icon_size ((GtkToolbar*) self, (gint) GTK_ICON_SIZE_MENU);
	_tmp2_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_add_class (_tmp2_, GTK_STYLE_CLASS_MENUBAR);
	gtk_toolbar_set_show_arrow ((GtkToolbar*) self, FALSE);
	_tmp3_ = gtk_tool_item_new ();
	_tmp4_ = g_object_ref_sink (_tmp3_);
	left_group = _tmp4_;
	gtk_toolbar_insert ((GtkToolbar*) self, left_group, 0);
	_tmp5_ = gtk_tool_item_new ();
	_tmp6_ = g_object_ref_sink (_tmp5_);
	center_group = _tmp6_;
	gtk_tool_item_set_expand (center_group, TRUE);
	gtk_toolbar_insert ((GtkToolbar*) self, center_group, -1);
	_tmp7_ = gtk_tool_item_new ();
	_tmp8_ = g_object_ref_sink (_tmp7_);
	right_group = _tmp8_;
	gtk_toolbar_insert ((GtkToolbar*) self, right_group, -1);
	_tmp9_ = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
	size_group = _tmp9_;
	gtk_size_group_add_widget (size_group, (GtkWidget*) left_group);
	gtk_size_group_add_widget (size_group, (GtkWidget*) right_group);
	_tmp10_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	_tmp11_ = g_object_ref_sink (_tmp10_);
	left_box = _tmp11_;
	gtk_container_add ((GtkContainer*) left_group, (GtkWidget*) left_box);
	_tmp12_ = (GtkButton*) gtk_button_new ();
	_tmp13_ = g_object_ref_sink (_tmp12_);
	back = _tmp13_;
	_tmp14_ = (GtkImage*) gtk_image_new_from_icon_name ("go-previous-symbolic", GTK_ICON_SIZE_MENU);
	_tmp15_ = g_object_ref_sink (_tmp14_);
	gtk_container_add ((GtkContainer*) back, (GtkWidget*) _tmp15_);
	_g_object_unref0 (_tmp15_);
	_tmp16_ = gtk_widget_get_style_context ((GtkWidget*) back);
	gtk_style_context_add_class (_tmp16_, "raised");
	g_signal_connect_data (back, "clicked", (GCallback) ___lambda20__gtk_button_clicked, block6_data_ref (_data6_), (GClosureNotify) block6_data_unref, 0);
	gtk_box_pack_start (left_box, (GtkWidget*) back, FALSE, FALSE, (guint) 0);
	_tmp17_ = (GtkLabel*) gtk_label_new ("Display");
	_tmp18_ = g_object_ref_sink (_tmp17_);
	_g_object_unref0 (self->priv->label);
	self->priv->label = _tmp18_;
	_tmp19_ = self->priv->label;
	gtk_label_set_use_markup (_tmp19_, TRUE);
	_tmp20_ = self->priv->label;
	gtk_container_add ((GtkContainer*) center_group, (GtkWidget*) _tmp20_);
	_tmp21_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
	_tmp22_ = g_object_ref_sink (_tmp21_);
	right_box = _tmp22_;
	gtk_container_add ((GtkContainer*) right_group, (GtkWidget*) right_box);
	_tmp23_ = (GtkButton*) gtk_button_new ();
	_tmp24_ = g_object_ref_sink (_tmp23_);
	btn = _tmp24_;
	_tmp25_ = (GtkImage*) gtk_image_new_from_icon_name ("view-fullscreen-symbolic", GTK_ICON_SIZE_MENU);
	_tmp26_ = g_object_ref_sink (_tmp25_);
	gtk_container_add ((GtkContainer*) btn, (GtkWidget*) _tmp26_);
	_g_object_unref0 (_tmp26_);
	_tmp27_ = gtk_widget_get_style_context ((GtkWidget*) btn);
	gtk_style_context_add_class (_tmp27_, "raised");
	g_signal_connect_data (btn, "clicked", (GCallback) ___lambda21__gtk_button_clicked, block6_data_ref (_data6_), (GClosureNotify) block6_data_unref, 0);
	gtk_box_pack_start (right_box, (GtkWidget*) btn, FALSE, FALSE, (guint) 0);
	_tmp28_ = (GtkButton*) gtk_button_new ();
	_tmp29_ = g_object_ref_sink (_tmp28_);
	props = _tmp29_;
	_tmp30_ = (GtkImage*) gtk_image_new_from_icon_name ("utilities-system-monitor-symbolic", GTK_ICON_SIZE_MENU);
	_tmp31_ = g_object_ref_sink (_tmp30_);
	gtk_container_add ((GtkContainer*) props, (GtkWidget*) _tmp31_);
	_g_object_unref0 (_tmp31_);
	_tmp32_ = gtk_widget_get_style_context ((GtkWidget*) props);
	gtk_style_context_add_class (_tmp32_, "raised");
	g_signal_connect_data (props, "clicked", (GCallback) ___lambda22__gtk_button_clicked, block6_data_ref (_data6_), (GClosureNotify) block6_data_unref, 0);
	gtk_box_pack_start (right_box, (GtkWidget*) props, FALSE, FALSE, (guint) 0);
	_g_object_unref0 (props);
	_g_object_unref0 (btn);
	_g_object_unref0 (right_box);
	_g_object_unref0 (back);
	_g_object_unref0 (left_box);
	_g_object_unref0 (size_group);
	_g_object_unref0 (right_group);
	_g_object_unref0 (center_group);
	_g_object_unref0 (left_group);
	block6_data_unref (_data6_);
	_data6_ = NULL;
	return self;
}


BoxesDisplayToolbar* boxes_display_toolbar_new (BoxesApp* app) {
	return boxes_display_toolbar_construct (BOXES_TYPE_DISPLAY_TOOLBAR, app);
}


void boxes_display_toolbar_set_title (BoxesDisplayToolbar* self, const gchar* value) {
	GtkLabel* _tmp0_;
	const gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->label;
	_tmp1_ = value;
	gtk_label_set_markup (_tmp0_, _tmp1_);
	g_object_notify ((GObject *) self, "title");
}


static void boxes_display_toolbar_class_init (BoxesDisplayToolbarClass * klass) {
	boxes_display_toolbar_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (BoxesDisplayToolbarPrivate));
	G_OBJECT_CLASS (klass)->set_property = _vala_boxes_display_toolbar_set_property;
	G_OBJECT_CLASS (klass)->finalize = boxes_display_toolbar_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_DISPLAY_TOOLBAR_TITLE, g_param_spec_string ("title", "title", "title", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE));
}


static void boxes_display_toolbar_instance_init (BoxesDisplayToolbar * self) {
	self->priv = BOXES_DISPLAY_TOOLBAR_GET_PRIVATE (self);
}


static void boxes_display_toolbar_finalize (GObject* obj) {
	BoxesDisplayToolbar * self;
	self = BOXES_DISPLAY_TOOLBAR (obj);
	_g_object_unref0 (self->priv->label);
	G_OBJECT_CLASS (boxes_display_toolbar_parent_class)->finalize (obj);
}


GType boxes_display_toolbar_get_type (void) {
	static volatile gsize boxes_display_toolbar_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_display_toolbar_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesDisplayToolbarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_display_toolbar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesDisplayToolbar), 0, (GInstanceInitFunc) boxes_display_toolbar_instance_init, NULL };
		GType boxes_display_toolbar_type_id;
		boxes_display_toolbar_type_id = g_type_register_static (GTK_TYPE_TOOLBAR, "BoxesDisplayToolbar", &g_define_type_info, 0);
		g_once_init_leave (&boxes_display_toolbar_type_id__volatile, boxes_display_toolbar_type_id);
	}
	return boxes_display_toolbar_type_id__volatile;
}


static void _vala_boxes_display_toolbar_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	BoxesDisplayToolbar * self;
	self = BOXES_DISPLAY_TOOLBAR (object);
	switch (property_id) {
		case BOXES_DISPLAY_TOOLBAR_TITLE:
		boxes_display_toolbar_set_title (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static Block7Data* block7_data_ref (Block7Data* _data7_) {
	g_atomic_int_inc (&_data7_->_ref_count_);
	return _data7_;
}


static void block7_data_unref (void * _userdata_) {
	Block7Data* _data7_;
	_data7_ = (Block7Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
		BoxesDisplayPage * self;
		self = _data7_->self;
		_g_object_unref0 (_data7_->app);
		_g_object_unref0 (self);
		g_slice_free (Block7Data, _data7_);
	}
}


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


static gboolean ______lambda24__gsource_func (gpointer self) {
	gboolean result;
	result = _____lambda24_ (self);
	return result;
}


static gboolean __lambda23_ (Block7Data* _data7_, GdkEvent* event) {
	BoxesDisplayPage * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	BoxesApp* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp6_;
	GdkEvent* _tmp21_;
	GdkEventType _tmp22_;
	GtkEventBox* _tmp23_;
	GtkWidget* _tmp24_ = NULL;
	self = _data7_->self;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp1_ = _data7_->app;
	_tmp2_ = boxes_app_get_fullscreen (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		GdkEvent* _tmp4_;
		GdkEventType _tmp5_;
		_tmp4_ = event;
		_tmp5_ = _tmp4_->type;
		_tmp0_ = _tmp5_ == GDK_MOTION_NOTIFY;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp6_ = _tmp0_;
	if (_tmp6_) {
		GdkEvent* _tmp7_;
		GdkEventMotion _tmp8_;
		gdouble _tmp9_;
		gdouble y;
		gdouble _tmp10_;
		_tmp7_ = event;
		_tmp8_ = _tmp7_->motion;
		_tmp9_ = _tmp8_.y;
		y = _tmp9_;
		_tmp10_ = y;
		if (_tmp10_ <= ((gdouble) 0)) {
			GdkEvent* _tmp11_;
			GdkEventMotion _tmp12_;
			GdkModifierType _tmp13_;
			boxes_display_page_toolbar_event_stop (self);
			_tmp11_ = event;
			_tmp12_ = _tmp11_->motion;
			_tmp13_ = _tmp12_.state;
			if ((_tmp13_ & ((((((((((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) {
				boxes_display_page_set_overlay_toolbar_visible (self, TRUE);
			}
		} else {
			gboolean _tmp14_ = FALSE;
			gdouble _tmp15_;
			gboolean _tmp17_;
			_tmp15_ = y;
			if (_tmp15_ > ((gdouble) 5)) {
				guint _tmp16_;
				_tmp16_ = self->priv->toolbar_hide_id;
				_tmp14_ = _tmp16_ == ((guint) 0);
			} else {
				_tmp14_ = FALSE;
			}
			_tmp17_ = _tmp14_;
			if (_tmp17_) {
				BoxesApp* _tmp18_;
				guint _tmp19_;
				guint _tmp20_ = 0U;
				boxes_display_page_toolbar_event_stop (self);
				_tmp18_ = _data7_->app;
				_tmp19_ = _tmp18_->duration;
				_tmp20_ = g_timeout_add_full (G_PRIORITY_DEFAULT, _tmp19_, ______lambda24__gsource_func, g_object_ref (self), g_object_unref);
				self->priv->toolbar_hide_id = _tmp20_;
			}
		}
	}
	_tmp21_ = event;
	_tmp22_ = _tmp21_->type;
	if (_tmp22_ == GDK_GRAB_BROKEN) {
		result = FALSE;
		return result;
	}
	_tmp23_ = self->priv->event_box;
	_tmp24_ = gtk_bin_get_child ((GtkBin*) _tmp23_);
	if (_tmp24_ != NULL) {
		GtkEventBox* _tmp25_;
		GtkWidget* _tmp26_ = NULL;
		GdkEvent* _tmp27_;
		_tmp25_ = self->priv->event_box;
		_tmp26_ = gtk_bin_get_child ((GtkBin*) _tmp25_);
		_tmp27_ = event;
		gtk_widget_event (_tmp26_, _tmp27_);
	}
	result = FALSE;
	return result;
}


static gboolean ___lambda23__gtk_widget_event (GtkWidget* _sender, GdkEvent* event, gpointer self) {
	gboolean result;
	result = __lambda23_ (self, event);
	return result;
}


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


static gboolean ___lambda25__gtk_widget_window_state_event (GtkWidget* _sender, GdkEventWindowState* event, gpointer self) {
	gboolean result;
	result = __lambda25_ (self, event);
	return result;
}


BoxesDisplayPage* boxes_display_page_construct (GType object_type, BoxesApp* app) {
	BoxesDisplayPage * self = NULL;
	Block7Data* _data7_;
	BoxesApp* _tmp0_;
	BoxesApp* _tmp1_;
	BoxesApp* _tmp2_;
	BoxesApp* _tmp3_;
	GtkEventBox* _tmp4_;
	GtkEventBox* _tmp5_;
	GtkEventBox* _tmp6_;
	GtkEventBox* _tmp7_;
	GtkEventBox* _tmp8_;
	BoxesApp* _tmp9_;
	BoxesDisplayToolbar* _tmp10_;
	BoxesDisplayToolbar* _tmp11_;
	GtkBox* _tmp12_;
	GtkBox* _tmp13_;
	GtkBox* _tmp14_;
	BoxesDisplayToolbar* _tmp15_;
	GtkBox* _tmp16_;
	GtkEventBox* _tmp17_;
	GtkOverlay* _tmp18_;
	GtkOverlay* _tmp19_;
	BoxesApp* _tmp20_;
	GtkApplicationWindow* _tmp21_;
	GtkOverlay* _tmp22_;
	GtkOverlay* _tmp23_;
	GtkBox* _tmp24_;
	BoxesApp* _tmp25_;
	BoxesDisplayToolbar* _tmp26_;
	BoxesDisplayToolbar* _tmp27_;
	BoxesDisplayToolbar* _tmp28_;
	GtkOverlay* _tmp29_;
	BoxesDisplayToolbar* _tmp30_;
	GtkOverlay* _tmp31_;
	g_return_val_if_fail (app != NULL, NULL);
	_data7_ = g_slice_new0 (Block7Data);
	_data7_->_ref_count_ = 1;
	_tmp0_ = app;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_data7_->app = _tmp1_;
	self = (BoxesDisplayPage*) g_object_new (object_type, NULL);
	_data7_->self = g_object_ref (self);
	_tmp2_ = _data7_->app;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_g_object_unref0 (self->priv->app);
	self->priv->app = _tmp3_;
	_tmp4_ = (GtkEventBox*) gtk_event_box_new ();
	_tmp5_ = g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->event_box);
	self->priv->event_box = _tmp5_;
	_tmp6_ = self->priv->event_box;
	gtk_widget_set_events ((GtkWidget*) _tmp6_, (gint) (GDK_POINTER_MOTION_MASK | GDK_SCROLL_MASK));
	_tmp7_ = self->priv->event_box;
	gtk_event_box_set_above_child (_tmp7_, TRUE);
	_tmp8_ = self->priv->event_box;
	g_signal_connect_data ((GtkWidget*) _tmp8_, "event", (GCallback) ___lambda23__gtk_widget_event, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
	_tmp9_ = _data7_->app;
	_tmp10_ = boxes_display_toolbar_new (_tmp9_);
	_tmp11_ = g_object_ref_sink (_tmp10_);
	_g_object_unref0 (self->priv->toolbar);
	self->priv->toolbar = _tmp11_;
	_tmp12_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	_tmp13_ = g_object_ref_sink (_tmp12_);
	_g_object_unref0 (self->priv->box);
	self->priv->box = _tmp13_;
	_tmp14_ = self->priv->box;
	_tmp15_ = self->priv->toolbar;
	gtk_box_pack_start (_tmp14_, (GtkWidget*) _tmp15_, FALSE, FALSE, (guint) 0);
	_tmp16_ = self->priv->box;
	_tmp17_ = self->priv->event_box;
	gtk_box_pack_start (_tmp16_, (GtkWidget*) _tmp17_, TRUE, TRUE, (guint) 0);
	_tmp18_ = (GtkOverlay*) gtk_overlay_new ();
	_tmp19_ = g_object_ref_sink (_tmp18_);
	_g_object_unref0 (self->priv->overlay);
	self->priv->overlay = _tmp19_;
	_tmp20_ = _data7_->app;
	_tmp21_ = _tmp20_->window;
	g_signal_connect_object ((GtkWidget*) _tmp21_, "window-state-event", (GCallback) ___lambda25__gtk_widget_window_state_event, self, 0);
	_tmp22_ = self->priv->overlay;
	g_object_set ((GtkWidget*) _tmp22_, "margin", 0, NULL);
	_tmp23_ = self->priv->overlay;
	_tmp24_ = self->priv->box;
	gtk_container_add ((GtkContainer*) _tmp23_, (GtkWidget*) _tmp24_);
	_tmp25_ = _data7_->app;
	_tmp26_ = boxes_display_toolbar_new (_tmp25_);
	_tmp27_ = g_object_ref_sink (_tmp26_);
	_g_object_unref0 (self->priv->overlay_toolbar);
	self->priv->overlay_toolbar = _tmp27_;
	_tmp28_ = self->priv->overlay_toolbar;
	gtk_widget_set_valign ((GtkWidget*) _tmp28_, GTK_ALIGN_START);
	_tmp29_ = self->priv->overlay;
	_tmp30_ = self->priv->overlay_toolbar;
	gtk_overlay_add_overlay (_tmp29_, (GtkWidget*) _tmp30_);
	_tmp31_ = self->priv->overlay;
	gtk_widget_show_all ((GtkWidget*) _tmp31_);
	block7_data_unref (_data7_);
	_data7_ = NULL;
	return self;
}


BoxesDisplayPage* boxes_display_page_new (BoxesApp* app) {
	return boxes_display_page_construct (BOXES_TYPE_DISPLAY_PAGE, app);
}


void boxes_display_page_get_size (BoxesDisplayPage* self, gint* width, gint* height) {
	gint _vala_width = 0;
	gint _vala_height = 0;
	gint tb_height = 0;
	BoxesApp* _tmp0_;
	GtkApplicationWindow* _tmp1_;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	BoxesApp* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->app;
	_tmp1_ = _tmp0_->window;
	gtk_window_get_size ((GtkWindow*) _tmp1_, &_tmp2_, &_tmp3_);
	_vala_width = _tmp2_;
	_vala_height = _tmp3_;
	_tmp4_ = self->priv->app;
	_tmp5_ = boxes_app_get_fullscreen (_tmp4_);
	_tmp6_ = _tmp5_;
	if (!_tmp6_) {
		BoxesDisplayToolbar* _tmp7_;
		gint _tmp8_ = 0;
		gint _tmp9_;
		gint _tmp10_;
		_tmp7_ = self->priv->toolbar;
		gtk_widget_get_preferred_height ((GtkWidget*) _tmp7_, NULL, &_tmp8_);
		tb_height = _tmp8_;
		_tmp9_ = _vala_height;
		_tmp10_ = tb_height;
		_vala_height = _tmp9_ - _tmp10_;
	}
	if (width) {
		*width = _vala_width;
	}
	if (height) {
		*height = _vala_height;
	}
}


static void boxes_display_page_update_toolbar_visible (BoxesDisplayPage* self) {
	gboolean _tmp0_ = FALSE;
	BoxesApp* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->app;
	_tmp2_ = boxes_app_get_fullscreen (_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;
	}
	_tmp6_ = _tmp0_;
	if (_tmp6_) {
		BoxesDisplayToolbar* _tmp7_;
		_tmp7_ = self->priv->toolbar;
		gtk_widget_set_visible ((GtkWidget*) _tmp7_, FALSE);
	} else {
		BoxesDisplayToolbar* _tmp8_;
		_tmp8_ = self->priv->toolbar;
		gtk_widget_set_visible ((GtkWidget*) _tmp8_, TRUE);
	}
	boxes_display_page_set_overlay_toolbar_visible (self, FALSE);
}


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


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


void boxes_display_page_show (BoxesDisplayPage* self) {
	BoxesApp* _tmp0_;
	GtkNotebook* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->app;
	_tmp1_ = _tmp0_->notebook;
	g_object_set (_tmp1_, "page", (gint) BOXES_APP_PAGE_DISPLAY, NULL);
}


void boxes_display_page_update_title (BoxesDisplayPage* self) {
	BoxesApp* _tmp0_;
	BoxesCollectionItem* _tmp1_;
	BoxesMachine* _tmp2_;
	BoxesMachine* machine;
	BoxesMachine* _tmp3_;
	BoxesMachine* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* title;
	gboolean _tmp8_;
	gboolean _tmp9_;
	BoxesDisplayToolbar* _tmp13_;
	BoxesDisplayToolbar* _tmp14_;
	const gchar* _tmp15_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->app;
	_tmp1_ = _tmp0_->current_item;
	_tmp2_ = _g_object_ref0 (BOXES_IS_MACHINE (_tmp1_) ? ((BoxesMachine*) _tmp1_) : NULL);
	machine = _tmp2_;
	_tmp3_ = machine;
	g_return_if_fail (_tmp3_ != NULL);
	_tmp4_ = machine;
	_tmp5_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_strdup (_tmp6_);
	title = _tmp7_;
	_tmp8_ = boxes_display_page_get_grabbed (self);
	_tmp9_ = _tmp8_;
	if (_tmp9_) {
		const gchar* _tmp10_ = NULL;
		const gchar* _tmp11_;
		gchar* _tmp12_ = NULL;
		_tmp10_ = _ ("%s <b>(press Ctrl+Alt keys to ungrab)</b>");
		_tmp11_ = title;
		_tmp12_ = g_strdup_printf (_tmp10_, _tmp11_);
		_g_free0 (title);
		title = _tmp12_;
	}
	_tmp13_ = self->priv->overlay_toolbar;
	_tmp14_ = self->priv->toolbar;
	_tmp15_ = title;
	boxes_display_toolbar_set_title (_tmp14_, _tmp15_);
	boxes_display_toolbar_set_title (_tmp13_, _tmp15_);
	_g_free0 (title);
	_g_object_unref0 (machine);
}


static Block8Data* block8_data_ref (Block8Data* _data8_) {
	g_atomic_int_inc (&_data8_->_ref_count_);
	return _data8_;
}


static void block8_data_unref (void * _userdata_) {
	Block8Data* _data8_;
	_data8_ = (Block8Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data8_->_ref_count_)) {
		BoxesDisplayPage * self;
		self = _data8_->self;
		_g_object_unref0 (_data8_->widget);
		_g_object_unref0 (self);
		g_slice_free (Block8Data, _data8_);
	}
}


static void __lambda26_ (BoxesDisplayPage* self) {
	boxes_display_page_update_title (self);
}


static void ___lambda26__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda26_ (self);
}


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


static void ___lambda27__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda27_ (self);
}


static gboolean __lambda28_ (BoxesDisplayPage* self, GdkEvent* event) {
	gboolean result = FALSE;
	GdkEvent* _tmp0_;
	GdkEventType _tmp1_;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = event;
	_tmp1_ = _tmp0_->type;
	switch (_tmp1_) {
		case GDK_LEAVE_NOTIFY:
		{
			boxes_display_page_toolbar_event_stop (self);
			break;
		}
		case GDK_ENTER_NOTIFY:
		{
			boxes_display_page_toolbar_event_stop (self);
			break;
		}
		default:
		break;
	}
	result = FALSE;
	return result;
}


static gboolean ___lambda28__gtk_widget_event (GtkWidget* _sender, GdkEvent* event, gpointer self) {
	gboolean result;
	result = __lambda28_ (self, event);
	return result;
}


static void __lambda30_ (Block8Data* _data8_) {
	BoxesDisplayPage * self;
	GtkEventBox* _tmp0_;
	GdkWindow* _tmp1_ = NULL;
	GtkWidget* _tmp2_;
	GdkWindow* _tmp3_ = NULL;
	GdkCursor* _tmp4_;
	GdkCursor* _tmp5_;
	self = _data8_->self;
	_tmp0_ = self->priv->event_box;
	_tmp1_ = gtk_widget_get_window ((GtkWidget*) _tmp0_);
	_tmp2_ = _data8_->widget;
	_tmp3_ = gtk_widget_get_window (_tmp2_);
	_tmp4_ = gdk_window_get_cursor (_tmp3_);
	_tmp5_ = _tmp4_;
	gdk_window_set_cursor (_tmp1_, _tmp5_);
}


static void ___lambda30__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda30_ (self);
}


static gboolean __lambda29_ (Block8Data* _data8_) {
	BoxesDisplayPage * self;
	gboolean result = FALSE;
	GtkWidget* _tmp0_;
	gulong _tmp1_;
	GtkWidget* _tmp2_;
	GdkWindow* _tmp3_ = NULL;
	gulong _tmp4_ = 0UL;
	self = _data8_->self;
	_tmp0_ = _data8_->widget;
	_tmp1_ = _data8_->draw_id;
	g_signal_handler_disconnect ((GObject*) _tmp0_, _tmp1_);
	_tmp2_ = _data8_->widget;
	_tmp3_ = gtk_widget_get_window (_tmp2_);
	_tmp4_ = g_signal_connect_data ((GObject*) _tmp3_, "notify::cursor", (GCallback) ___lambda30__g_object_notify, block8_data_ref (_data8_), (GClosureNotify) block8_data_unref, 0);
	self->priv->cursor_id = _tmp4_;
	result = FALSE;
	return result;
}


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


void boxes_display_page_show_display (BoxesDisplayPage* self, BoxesDisplay* display, GtkWidget* widget) {
	Block8Data* _data8_;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_ = NULL;
	GtkWidget* _tmp3_;
	BoxesDisplay* _tmp4_;
	BoxesDisplay* _tmp5_;
	BoxesDisplay* _tmp6_;
	gulong _tmp7_ = 0UL;
	BoxesDisplay* _tmp8_;
	gulong _tmp9_ = 0UL;
	GtkWidget* _tmp10_;
	GtkWidget* _tmp11_;
	gint _tmp12_ = 0;
	GtkEventBox* _tmp13_;
	GtkWidget* _tmp14_;
	GtkEventBox* _tmp15_;
	GtkWidget* _tmp16_;
	gulong _tmp17_ = 0UL;
	GtkWidget* _tmp18_;
	gulong _tmp19_ = 0UL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (display != NULL);
	g_return_if_fail (widget != NULL);
	_data8_ = g_slice_new0 (Block8Data);
	_data8_->_ref_count_ = 1;
	_data8_->self = g_object_ref (self);
	_tmp0_ = widget;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_data8_->widget = _tmp1_;
	_tmp2_ = boxes_display_page_remove_display (self);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (_tmp3_);
	_tmp4_ = display;
	_tmp5_ = _g_object_ref0 (_tmp4_);
	_g_object_unref0 (self->priv->display);
	self->priv->display = _tmp5_;
	_tmp6_ = display;
	_tmp7_ = g_signal_connect_object ((GObject*) _tmp6_, "notify::mouse-grabbed", (GCallback) ___lambda26__g_object_notify, self, 0);
	self->priv->display_grabbed_id = _tmp7_;
	_tmp8_ = display;
	_tmp9_ = g_signal_connect_object ((GObject*) _tmp8_, "notify::can-grab-mouse", (GCallback) ___lambda27__g_object_notify, self, 0);
	self->priv->display_can_grab_id = _tmp9_;
	boxes_display_page_set_overlay_toolbar_visible (self, FALSE);
	boxes_display_page_update_title (self);
	_tmp10_ = _data8_->widget;
	_tmp11_ = _data8_->widget;
	_tmp12_ = gtk_widget_get_events (_tmp11_);
	gtk_widget_set_events (_tmp10_, _tmp12_ & (~GDK_POINTER_MOTION_MASK));
	_tmp13_ = self->priv->event_box;
	_tmp14_ = _data8_->widget;
	gtk_container_add ((GtkContainer*) _tmp13_, _tmp14_);
	_tmp15_ = self->priv->event_box;
	gtk_widget_show_all ((GtkWidget*) _tmp15_);
	_tmp16_ = _data8_->widget;
	_tmp17_ = g_signal_connect_object (_tmp16_, "event", (GCallback) ___lambda28__gtk_widget_event, self, 0);
	self->priv->display_id = _tmp17_;
	_data8_->draw_id = (gulong) 0;
	_tmp18_ = _data8_->widget;
	_tmp19_ = g_signal_connect_data (_tmp18_, "draw", (GCallback) ___lambda29__gtk_widget_draw, block8_data_ref (_data8_), (GClosureNotify) block8_data_unref, 0);
	_data8_->draw_id = _tmp19_;
	boxes_display_page_show (self);
	block8_data_unref (_data8_);
	_data8_ = NULL;
}


GtkWidget* boxes_display_page_remove_display (BoxesDisplayPage* self) {
	GtkWidget* result = NULL;
	gulong _tmp0_;
	gulong _tmp3_;
	GtkEventBox* _tmp6_;
	GtkWidget* _tmp7_ = NULL;
	GtkWidget* _tmp8_;
	GtkWidget* widget;
	gulong _tmp9_;
	gulong _tmp12_;
	GtkWidget* _tmp16_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->display_grabbed_id;
	if (_tmp0_ != ((gulong) 0)) {
		BoxesDisplay* _tmp1_;
		gulong _tmp2_;
		_tmp1_ = self->priv->display;
		_tmp2_ = self->priv->display_grabbed_id;
		g_signal_handler_disconnect ((GObject*) _tmp1_, _tmp2_);
		self->priv->display_grabbed_id = (gulong) 0;
	}
	_tmp3_ = self->priv->display_can_grab_id;
	if (_tmp3_ != ((gulong) 0)) {
		BoxesDisplay* _tmp4_;
		gulong _tmp5_;
		_tmp4_ = self->priv->display;
		_tmp5_ = self->priv->display_can_grab_id;
		g_signal_handler_disconnect ((GObject*) _tmp4_, _tmp5_);
		self->priv->display_can_grab_id = (gulong) 0;
	}
	_tmp6_ = self->priv->event_box;
	_tmp7_ = gtk_bin_get_child ((GtkBin*) _tmp6_);
	_tmp8_ = _g_object_ref0 (_tmp7_);
	widget = _tmp8_;
	_tmp9_ = self->priv->display_id;
	if (_tmp9_ != ((gulong) 0)) {
		GtkWidget* _tmp10_;
		gulong _tmp11_;
		_tmp10_ = widget;
		_tmp11_ = self->priv->display_id;
		g_signal_handler_disconnect ((GObject*) _tmp10_, _tmp11_);
		self->priv->display_id = (gulong) 0;
	}
	_tmp12_ = self->priv->cursor_id;
	if (_tmp12_ != ((gulong) 0)) {
		GtkWidget* _tmp13_;
		GdkWindow* _tmp14_ = NULL;
		gulong _tmp15_;
		_tmp13_ = widget;
		_tmp14_ = gtk_widget_get_window (_tmp13_);
		_tmp15_ = self->priv->cursor_id;
		g_signal_handler_disconnect ((GObject*) _tmp14_, _tmp15_);
		self->priv->cursor_id = (gulong) 0;
	}
	_tmp16_ = widget;
	if (_tmp16_ != NULL) {
		GtkEventBox* _tmp17_;
		GtkWidget* _tmp18_;
		_tmp17_ = self->priv->event_box;
		_tmp18_ = widget;
		gtk_container_remove ((GtkContainer*) _tmp17_, _tmp18_);
	}
	result = widget;
	return result;
}


GtkWidget* boxes_display_page_get_widget (BoxesDisplayPage* self) {
	GtkWidget* result;
	GtkOverlay* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->overlay;
	result = (GtkWidget*) _tmp0_;
	return result;
}


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


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


static void boxes_display_page_class_init (BoxesDisplayPageClass * klass) {
	boxes_display_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (BoxesDisplayPagePrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_display_page_get_property;
	G_OBJECT_CLASS (klass)->finalize = boxes_display_page_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_DISPLAY_PAGE_WIDGET, g_param_spec_object ("widget", "widget", "widget", GTK_TYPE_WIDGET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void boxes_display_page_instance_init (BoxesDisplayPage * self) {
	self->priv = BOXES_DISPLAY_PAGE_GET_PRIVATE (self);
}


static void boxes_display_page_finalize (GObject* obj) {
	BoxesDisplayPage * self;
	self = BOXES_DISPLAY_PAGE (obj);
	boxes_display_page_toolbar_event_stop (self);
	_g_object_unref0 (self->priv->overlay);
	_g_object_unref0 (self->priv->app);
	_g_object_unref0 (self->priv->event_box);
	_g_object_unref0 (self->priv->box);
	_g_object_unref0 (self->priv->overlay_toolbar);
	_g_object_unref0 (self->priv->toolbar);
	_g_object_unref0 (self->priv->display);
	G_OBJECT_CLASS (boxes_display_page_parent_class)->finalize (obj);
}


GType boxes_display_page_get_type (void) {
	static volatile gsize boxes_display_page_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_display_page_type_id__volatile)) {
		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 (G_TYPE_OBJECT, "BoxesDisplayPage", &g_define_type_info, 0);
		g_once_init_leave (&boxes_display_page_type_id__volatile, boxes_display_page_type_id);
	}
	return boxes_display_page_type_id__volatile;
}


static void _vala_boxes_display_page_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	BoxesDisplayPage * self;
	self = BOXES_DISPLAY_PAGE (object);
	switch (property_id) {
		case BOXES_DISPLAY_PAGE_WIDGET:
		g_value_set_object (value, boxes_display_page_get_widget (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



