/* display-page.c generated by valac 0.17.7, 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 <libgd/gd.h>
#include <gtk/gtk.h>
#include <libcommon.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 <stdlib.h>
#include <string.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 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;

#define BOXES_TYPE_UI_STATE (boxes_ui_state_get_type ())
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#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 _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_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_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_REVEALER (boxes_revealer_get_type ())
#define BOXES_REVEALER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_REVEALER, BoxesRevealer))
#define BOXES_REVEALER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_REVEALER, BoxesRevealerClass))
#define BOXES_IS_REVEALER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_REVEALER))
#define BOXES_IS_REVEALER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_REVEALER))
#define BOXES_REVEALER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_REVEALER, BoxesRevealerClass))

typedef struct _BoxesRevealer BoxesRevealer;
typedef struct _BoxesRevealerClass BoxesRevealerClass;

#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_COLLECTION_FILTER (boxes_collection_filter_get_type ())
#define BOXES_COLLECTION_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION_FILTER, BoxesCollectionFilter))
#define BOXES_COLLECTION_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION_FILTER, BoxesCollectionFilterClass))
#define BOXES_IS_COLLECTION_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION_FILTER))
#define BOXES_IS_COLLECTION_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION_FILTER))
#define BOXES_COLLECTION_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION_FILTER, BoxesCollectionFilterClass))

typedef struct _BoxesCollectionFilter BoxesCollectionFilter;
typedef struct _BoxesCollectionFilterClass BoxesCollectionFilterClass;

#define BOXES_TYPE_COLLECTION_VIEW (boxes_collection_view_get_type ())
#define BOXES_COLLECTION_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION_VIEW, BoxesCollectionView))
#define BOXES_COLLECTION_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION_VIEW, BoxesCollectionViewClass))
#define BOXES_IS_COLLECTION_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION_VIEW))
#define BOXES_IS_COLLECTION_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION_VIEW))
#define BOXES_COLLECTION_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION_VIEW, BoxesCollectionViewClass))

typedef struct _BoxesCollectionView BoxesCollectionView;
typedef struct _BoxesCollectionViewClass BoxesCollectionViewClass;

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

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

struct _BoxesDisplayToolbarClass {
	GdMainToolbarClass parent_class;
};

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;
	GtkEventBox* event_box;
	GtkBox* box;
	BoxesDisplayToolbar* overlay_toolbar;
	BoxesDisplayToolbar* toolbar;
	guint toolbar_hide_id;
	guint toolbar_show_id;
	gulong cursor_id;
	BoxesDisplay* display;
	gulong display_can_grab_id;
	gulong display_grabbed_id;
};

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;
	ClutterBinLayout* stage_bin;
	ClutterActor* overlay_bin_actor;
	ClutterBinLayout* overlay_bin;
	BoxesCollectionItem* current_item;
	BoxesSearchbar* searchbar;
	BoxesTopbar* topbar;
	BoxesNotificationbar* notificationbar;
	BoxesRevealer* sidebar_revealer;
	BoxesRevealer* searchbar_revealer;
	BoxesSidebar* sidebar;
	BoxesSelectionbar* selectionbar;
	guint duration;
	GSettings* settings;
	BoxesWizard* wizard;
	BoxesProperties* properties;
	BoxesDisplayPage* display_page;
	BoxesCollection* collection;
	BoxesCollectionFilter* filter;
	GSimpleAction* action_properties;
	GSimpleAction* action_fullscreen;
	GSimpleAction* action_shutdown;
	BoxesCollectionView* view;
};

struct _BoxesAppClass {
	BoxesUIClass parent_class;
};

typedef enum  {
	BOXES_APP_PAGE_MAIN,
	BOXES_APP_PAGE_DISPLAY
} BoxesAppPage;

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


static gpointer boxes_display_toolbar_parent_class = NULL;
extern BoxesApp* boxes_app_app;
static gpointer boxes_display_page_parent_class = NULL;

GType boxes_display_toolbar_get_type (void) G_GNUC_CONST;
enum  {
	BOXES_DISPLAY_TOOLBAR_DUMMY_PROPERTY
};
BoxesDisplayToolbar* boxes_display_toolbar_new (void);
BoxesDisplayToolbar* boxes_display_toolbar_construct (GType object_type);
static void __lambda24_ (BoxesDisplayToolbar* self, GtkButton* button);
GType boxes_ui_get_type (void) G_GNUC_CONST;
GType boxes_app_get_type (void) G_GNUC_CONST;
GType boxes_ui_state_get_type (void) G_GNUC_CONST;
void boxes_ui_set_ui_state (BoxesUI* self, BoxesUIState value);
static void ___lambda24__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda25_ (BoxesDisplayToolbar* self, GtkButton* button);
gboolean boxes_app_get_fullscreen (BoxesApp* self);
void boxes_app_set_fullscreen (BoxesApp* self, gboolean value);
static void ___lambda25__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda26_ (BoxesDisplayToolbar* self, GtkButton* button);
static void ___lambda26__gtk_button_clicked (GtkButton* _sender, gpointer self);
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 (void);
BoxesDisplayPage* boxes_display_page_construct (GType object_type);
static gboolean __lambda27_ (BoxesDisplayPage* self, GdkEvent* event);
GType boxes_collection_item_get_type (void) G_GNUC_CONST;
GType boxes_searchbar_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_revealer_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;
GType boxes_collection_filter_get_type (void) G_GNUC_CONST;
GType boxes_collection_view_get_type (void) G_GNUC_CONST;
static gboolean _____lambda28_ (BoxesDisplayPage* self);
static void boxes_display_page_set_overlay_toolbar_visible (BoxesDisplayPage* self, gboolean visible);
static gboolean ______lambda28__gsource_func (gpointer self);
static gboolean _____lambda29_ (BoxesDisplayPage* self);
static gboolean ______lambda29__gsource_func (gpointer self);
static gboolean ___lambda27__gtk_widget_event (GtkWidget* _sender, GdkEvent* event, gpointer self);
static gboolean __lambda30_ (BoxesDisplayPage* self, GdkEventWindowState* event);
static void boxes_display_page_update_toolbar_visible (BoxesDisplayPage* self);
static gboolean ___lambda30__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 Block10Data* block10_data_ref (Block10Data* _data10_);
static void block10_data_unref (void * _userdata_);
GtkWidget* boxes_display_page_remove_display (BoxesDisplayPage* self);
static void __lambda31_ (BoxesDisplayPage* self);
static void ___lambda31__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void __lambda32_ (BoxesDisplayPage* self);
static void ___lambda32__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static gboolean __lambda33_ (Block10Data* _data10_);
static void __lambda34_ (Block10Data* _data10_);
static void ___lambda34__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static gboolean ___lambda33__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 void __lambda24_ (BoxesDisplayToolbar* self, GtkButton* button) {
	BoxesApp* _tmp0_;
	g_return_if_fail (button != NULL);
	_tmp0_ = boxes_app_app;
	boxes_ui_set_ui_state ((BoxesUI*) _tmp0_, BOXES_UI_STATE_COLLECTION);
}


static void ___lambda24__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda24_ (self, _sender);
}


static void __lambda25_ (BoxesDisplayToolbar* self, GtkButton* button) {
	BoxesApp* _tmp0_;
	BoxesApp* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	g_return_if_fail (button != NULL);
	_tmp0_ = boxes_app_app;
	_tmp1_ = boxes_app_app;
	_tmp2_ = boxes_app_get_fullscreen (_tmp1_);
	_tmp3_ = _tmp2_;
	boxes_app_set_fullscreen (_tmp0_, !_tmp3_);
}


static void ___lambda25__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda25_ (self, _sender);
}


static void __lambda26_ (BoxesDisplayToolbar* self, GtkButton* button) {
	BoxesApp* _tmp0_;
	g_return_if_fail (button != NULL);
	_tmp0_ = boxes_app_app;
	boxes_ui_set_ui_state ((BoxesUI*) _tmp0_, BOXES_UI_STATE_PROPERTIES);
}


static void ___lambda26__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda26_ (self, _sender);
}


BoxesDisplayToolbar* boxes_display_toolbar_construct (GType object_type) {
	BoxesDisplayToolbar * self = NULL;
	GtkStyleContext* _tmp0_ = NULL;
	GtkWidget* _tmp1_ = NULL;
	GtkButton* _tmp2_;
	GtkButton* back;
	GtkWidget* _tmp3_ = NULL;
	GtkButton* _tmp4_;
	GtkButton* fullscreen;
	GtkWidget* _tmp5_ = NULL;
	GtkButton* _tmp6_;
	GtkButton* props;
	self = (BoxesDisplayToolbar*) g_object_new (object_type, NULL);
	_tmp0_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_add_class (_tmp0_, GTK_STYLE_CLASS_MENUBAR);
	_tmp1_ = gd_main_toolbar_add_button ((GdMainToolbar*) self, "go-previous-symbolic", NULL, TRUE);
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, GTK_TYPE_BUTTON) ? ((GtkButton*) _tmp1_) : NULL);
	back = _tmp2_;
	g_signal_connect_object (back, "clicked", (GCallback) ___lambda24__gtk_button_clicked, self, 0);
	_tmp3_ = gd_main_toolbar_add_button ((GdMainToolbar*) self, "view-fullscreen-symbolic", NULL, FALSE);
	_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, GTK_TYPE_BUTTON) ? ((GtkButton*) _tmp3_) : NULL);
	fullscreen = _tmp4_;
	g_signal_connect_object (fullscreen, "clicked", (GCallback) ___lambda25__gtk_button_clicked, self, 0);
	_tmp5_ = gd_main_toolbar_add_button ((GdMainToolbar*) self, "utilities-system-monitor-symbolic", NULL, FALSE);
	_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, GTK_TYPE_BUTTON) ? ((GtkButton*) _tmp5_) : NULL);
	props = _tmp6_;
	g_signal_connect_object (props, "clicked", (GCallback) ___lambda26__gtk_button_clicked, self, 0);
	_g_object_unref0 (props);
	_g_object_unref0 (fullscreen);
	_g_object_unref0 (back);
	return self;
}


BoxesDisplayToolbar* boxes_display_toolbar_new (void) {
	return boxes_display_toolbar_construct (BOXES_TYPE_DISPLAY_TOOLBAR);
}


static void boxes_display_toolbar_class_init (BoxesDisplayToolbarClass * klass) {
	boxes_display_toolbar_parent_class = g_type_class_peek_parent (klass);
}


static void boxes_display_toolbar_instance_init (BoxesDisplayToolbar * self) {
}


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 (gd_main_toolbar_get_type (), "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 gboolean _____lambda28_ (BoxesDisplayPage* self) {
	gboolean result = FALSE;
	boxes_display_page_set_overlay_toolbar_visible (self, TRUE);
	self->priv->toolbar_show_id = (guint) 0;
	result = FALSE;
	return result;
}


static gboolean ______lambda28__gsource_func (gpointer self) {
	gboolean result;
	result = _____lambda28_ (self);
	return result;
}


static gboolean _____lambda29_ (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 ______lambda29__gsource_func (gpointer self) {
	gboolean result;
	result = _____lambda29_ (self);
	return result;
}


static gboolean __lambda27_ (BoxesDisplayPage* self, GdkEvent* event) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	BoxesApp* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp6_;
	GdkEvent* _tmp27_;
	GdkEventType _tmp28_;
	GtkEventBox* _tmp29_;
	GtkWidget* _tmp30_ = NULL;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp1_ = boxes_app_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;
		gboolean _tmp10_ = FALSE;
		gdouble _tmp11_;
		gboolean _tmp13_;
		_tmp7_ = event;
		_tmp8_ = _tmp7_->motion;
		_tmp9_ = _tmp8_.y;
		y = _tmp9_;
		_tmp11_ = y;
		if (_tmp11_ <= ((gdouble) 0)) {
			guint _tmp12_;
			_tmp12_ = self->priv->toolbar_show_id;
			_tmp10_ = _tmp12_ == ((guint) 0);
		} else {
			_tmp10_ = FALSE;
		}
		_tmp13_ = _tmp10_;
		if (_tmp13_) {
			GdkEvent* _tmp14_;
			GdkEventMotion _tmp15_;
			GdkModifierType _tmp16_;
			boxes_display_page_toolbar_event_stop (self);
			_tmp14_ = event;
			_tmp15_ = _tmp14_->motion;
			_tmp16_ = _tmp15_.state;
			if ((_tmp16_ & ((((((((((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) {
				BoxesApp* _tmp17_;
				guint _tmp18_;
				guint _tmp19_ = 0U;
				_tmp17_ = boxes_app_app;
				_tmp18_ = _tmp17_->duration;
				_tmp19_ = g_timeout_add_full (G_PRIORITY_DEFAULT, _tmp18_, ______lambda28__gsource_func, g_object_ref (self), g_object_unref);
				self->priv->toolbar_show_id = _tmp19_;
			}
		} else {
			gboolean _tmp20_ = FALSE;
			gdouble _tmp21_;
			gboolean _tmp23_;
			_tmp21_ = y;
			if (_tmp21_ > ((gdouble) 5)) {
				guint _tmp22_;
				_tmp22_ = self->priv->toolbar_hide_id;
				_tmp20_ = _tmp22_ == ((guint) 0);
			} else {
				_tmp20_ = FALSE;
			}
			_tmp23_ = _tmp20_;
			if (_tmp23_) {
				BoxesApp* _tmp24_;
				guint _tmp25_;
				guint _tmp26_ = 0U;
				boxes_display_page_toolbar_event_stop (self);
				_tmp24_ = boxes_app_app;
				_tmp25_ = _tmp24_->duration;
				_tmp26_ = g_timeout_add_full (G_PRIORITY_DEFAULT, _tmp25_, ______lambda29__gsource_func, g_object_ref (self), g_object_unref);
				self->priv->toolbar_hide_id = _tmp26_;
			}
		}
	}
	_tmp27_ = event;
	_tmp28_ = _tmp27_->type;
	if (_tmp28_ == GDK_GRAB_BROKEN) {
		result = FALSE;
		return result;
	}
	_tmp29_ = self->priv->event_box;
	_tmp30_ = gtk_bin_get_child ((GtkBin*) _tmp29_);
	if (_tmp30_ != NULL) {
		GtkEventBox* _tmp31_;
		GtkWidget* _tmp32_ = NULL;
		GdkEvent* _tmp33_;
		_tmp31_ = self->priv->event_box;
		_tmp32_ = gtk_bin_get_child ((GtkBin*) _tmp31_);
		_tmp33_ = event;
		gtk_widget_event (_tmp32_, _tmp33_);
	}
	result = FALSE;
	return result;
}


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


static gboolean __lambda30_ (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 ___lambda30__gtk_widget_window_state_event (GtkWidget* _sender, GdkEventWindowState* event, gpointer self) {
	gboolean result;
	result = __lambda30_ (self, event);
	return result;
}


BoxesDisplayPage* boxes_display_page_construct (GType object_type) {
	BoxesDisplayPage * self = NULL;
	GtkEventBox* _tmp0_;
	GtkEventBox* _tmp1_;
	GtkStyleContext* _tmp2_ = NULL;
	GtkEventBox* _tmp3_;
	GtkEventBox* _tmp4_;
	GtkEventBox* _tmp5_;
	BoxesDisplayToolbar* _tmp6_;
	GtkBox* _tmp7_;
	GtkBox* _tmp8_;
	BoxesDisplayToolbar* _tmp9_;
	GtkBox* _tmp10_;
	GtkEventBox* _tmp11_;
	GtkOverlay* _tmp12_;
	BoxesApp* _tmp13_;
	GtkApplicationWindow* _tmp14_;
	GtkOverlay* _tmp15_;
	GtkOverlay* _tmp16_;
	GtkBox* _tmp17_;
	BoxesDisplayToolbar* _tmp18_;
	BoxesDisplayToolbar* _tmp19_;
	GtkOverlay* _tmp20_;
	BoxesDisplayToolbar* _tmp21_;
	GtkOverlay* _tmp22_;
	GtkStyleContext* _tmp23_ = NULL;
	GtkOverlay* _tmp24_;
	self = (BoxesDisplayPage*) g_object_new (object_type, NULL);
	_tmp0_ = (GtkEventBox*) gtk_event_box_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->event_box);
	self->priv->event_box = _tmp0_;
	_tmp1_ = self->priv->event_box;
	_tmp2_ = gtk_widget_get_style_context ((GtkWidget*) _tmp1_);
	gtk_style_context_add_class (_tmp2_, "boxes-toplevel");
	_tmp3_ = self->priv->event_box;
	gtk_widget_set_events ((GtkWidget*) _tmp3_, (gint) (GDK_POINTER_MOTION_MASK | GDK_SCROLL_MASK));
	_tmp4_ = self->priv->event_box;
	gtk_event_box_set_above_child (_tmp4_, TRUE);
	_tmp5_ = self->priv->event_box;
	g_signal_connect_object ((GtkWidget*) _tmp5_, "event", (GCallback) ___lambda27__gtk_widget_event, self, 0);
	_tmp6_ = boxes_display_toolbar_new ();
	g_object_ref_sink (_tmp6_);
	_g_object_unref0 (self->priv->toolbar);
	self->priv->toolbar = _tmp6_;
	_tmp7_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->box);
	self->priv->box = _tmp7_;
	_tmp8_ = self->priv->box;
	_tmp9_ = self->priv->toolbar;
	gtk_box_pack_start (_tmp8_, (GtkWidget*) _tmp9_, FALSE, FALSE, (guint) 0);
	_tmp10_ = self->priv->box;
	_tmp11_ = self->priv->event_box;
	gtk_box_pack_start (_tmp10_, (GtkWidget*) _tmp11_, TRUE, TRUE, (guint) 0);
	_tmp12_ = (GtkOverlay*) gtk_overlay_new ();
	g_object_ref_sink (_tmp12_);
	_g_object_unref0 (self->priv->overlay);
	self->priv->overlay = _tmp12_;
	_tmp13_ = boxes_app_app;
	_tmp14_ = _tmp13_->window;
	g_signal_connect_object ((GtkWidget*) _tmp14_, "window-state-event", (GCallback) ___lambda30__gtk_widget_window_state_event, self, 0);
	_tmp15_ = self->priv->overlay;
	g_object_set ((GtkWidget*) _tmp15_, "margin", 0, NULL);
	_tmp16_ = self->priv->overlay;
	_tmp17_ = self->priv->box;
	gtk_container_add ((GtkContainer*) _tmp16_, (GtkWidget*) _tmp17_);
	_tmp18_ = boxes_display_toolbar_new ();
	g_object_ref_sink (_tmp18_);
	_g_object_unref0 (self->priv->overlay_toolbar);
	self->priv->overlay_toolbar = _tmp18_;
	_tmp19_ = self->priv->overlay_toolbar;
	gtk_widget_set_valign ((GtkWidget*) _tmp19_, GTK_ALIGN_START);
	_tmp20_ = self->priv->overlay;
	_tmp21_ = self->priv->overlay_toolbar;
	gtk_overlay_add_overlay (_tmp20_, (GtkWidget*) _tmp21_);
	_tmp22_ = self->priv->overlay;
	_tmp23_ = gtk_widget_get_style_context ((GtkWidget*) _tmp22_);
	gtk_style_context_add_class (_tmp23_, "boxes-toplevel");
	_tmp24_ = self->priv->overlay;
	gtk_widget_show_all ((GtkWidget*) _tmp24_);
	return self;
}


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


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_ = boxes_app_app;
	_tmp1_ = _tmp0_->window;
	gtk_window_get_size ((GtkWindow*) _tmp1_, &_tmp2_, &_tmp3_);
	_vala_width = _tmp2_;
	_vala_height = _tmp3_;
	_tmp4_ = boxes_app_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_ = boxes_app_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:133: 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_;
	guint _tmp2_;
	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;
	_tmp2_ = self->priv->toolbar_show_id;
	if (_tmp2_ != ((guint) 0)) {
		guint _tmp3_;
		_tmp3_ = self->priv->toolbar_show_id;
		g_source_remove (_tmp3_);
	}
	self->priv->toolbar_show_id = (guint) 0;
}


void boxes_display_page_show (BoxesDisplayPage* self) {
	BoxesApp* _tmp0_;
	GtkNotebook* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = boxes_app_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;
	gchar* hint;
	gboolean _tmp8_;
	gboolean _tmp9_;
	BoxesDisplayToolbar* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	BoxesDisplayToolbar* _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	g_return_if_fail (self != NULL);
	_tmp0_ = boxes_app_app;
	_tmp1_ = _tmp0_->current_item;
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, BOXES_TYPE_MACHINE) ? ((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_;
	hint = NULL;
	_tmp8_ = boxes_display_page_get_grabbed (self);
	_tmp9_ = _tmp8_;
	if (_tmp9_) {
		const gchar* _tmp10_ = NULL;
		gchar* _tmp11_;
		_tmp10_ = _ ("(press Ctrl+Alt keys to ungrab)");
		_tmp11_ = g_strdup (_tmp10_);
		_g_free0 (hint);
		hint = _tmp11_;
	}
	_tmp12_ = self->priv->overlay_toolbar;
	_tmp13_ = title;
	_tmp14_ = hint;
	gd_main_toolbar_set_labels ((GdMainToolbar*) _tmp12_, _tmp13_, _tmp14_);
	_tmp15_ = self->priv->toolbar;
	_tmp16_ = title;
	_tmp17_ = hint;
	gd_main_toolbar_set_labels ((GdMainToolbar*) _tmp15_, _tmp16_, _tmp17_);
	_g_free0 (hint);
	_g_free0 (title);
	_g_object_unref0 (machine);
}


static Block10Data* block10_data_ref (Block10Data* _data10_) {
	g_atomic_int_inc (&_data10_->_ref_count_);
	return _data10_;
}


static void block10_data_unref (void * _userdata_) {
	Block10Data* _data10_;
	_data10_ = (Block10Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data10_->_ref_count_)) {
		BoxesDisplayPage * self;
		self = _data10_->self;
		_g_object_unref0 (_data10_->widget);
		_g_object_unref0 (self);
		g_slice_free (Block10Data, _data10_);
	}
}


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


static void ___lambda31__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda31_ (self);
}


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


static void ___lambda32__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda32_ (self);
}


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


static void ___lambda34__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda34_ (self);
}


static gboolean __lambda33_ (Block10Data* _data10_) {
	BoxesDisplayPage * self;
	gboolean result = FALSE;
	GtkWidget* _tmp0_;
	gulong _tmp1_;
	GtkWidget* _tmp2_;
	GdkWindow* _tmp3_ = NULL;
	gulong _tmp4_ = 0UL;
	self = _data10_->self;
	_tmp0_ = _data10_->widget;
	_tmp1_ = _data10_->draw_id;
	g_signal_handler_disconnect ((GObject*) _tmp0_, _tmp1_);
	_tmp2_ = _data10_->widget;
	_tmp3_ = gtk_widget_get_window (_tmp2_);
	_tmp4_ = g_signal_connect_data ((GObject*) _tmp3_, "notify::cursor", (GCallback) ___lambda34__g_object_notify, block10_data_ref (_data10_), (GClosureNotify) block10_data_unref, 0);
	self->priv->cursor_id = _tmp4_;
	result = FALSE;
	return result;
}


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


void boxes_display_page_show_display (BoxesDisplayPage* self, BoxesDisplay* display, GtkWidget* widget) {
	Block10Data* _data10_;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	GtkEventBox* _tmp2_;
	GtkWidget* _tmp3_ = NULL;
	GtkWidget* _tmp4_;
	GtkWidget* _tmp5_ = NULL;
	GtkWidget* _tmp6_;
	BoxesDisplay* _tmp7_;
	BoxesDisplay* _tmp8_;
	BoxesDisplay* _tmp9_;
	gulong _tmp10_ = 0UL;
	BoxesDisplay* _tmp11_;
	gulong _tmp12_ = 0UL;
	GtkWidget* _tmp13_;
	GtkWidget* _tmp14_;
	gint _tmp15_ = 0;
	GtkEventBox* _tmp16_;
	GtkWidget* _tmp17_;
	GtkEventBox* _tmp18_;
	GtkWidget* _tmp19_;
	gulong _tmp20_ = 0UL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (display != NULL);
	g_return_if_fail (widget != NULL);
	_data10_ = g_slice_new0 (Block10Data);
	_data10_->_ref_count_ = 1;
	_data10_->self = g_object_ref (self);
	_tmp0_ = widget;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data10_->widget);
	_data10_->widget = _tmp1_;
	_tmp2_ = self->priv->event_box;
	_tmp3_ = gtk_bin_get_child ((GtkBin*) _tmp2_);
	_tmp4_ = _data10_->widget;
	if (_tmp3_ == _tmp4_) {
		block10_data_unref (_data10_);
		_data10_ = NULL;
		return;
	}
	_tmp5_ = boxes_display_page_remove_display (self);
	_tmp6_ = _tmp5_;
	_g_object_unref0 (_tmp6_);
	_tmp7_ = display;
	_tmp8_ = _g_object_ref0 (_tmp7_);
	_g_object_unref0 (self->priv->display);
	self->priv->display = _tmp8_;
	_tmp9_ = display;
	_tmp10_ = g_signal_connect_object ((GObject*) _tmp9_, "notify::mouse-grabbed", (GCallback) ___lambda31__g_object_notify, self, 0);
	self->priv->display_grabbed_id = _tmp10_;
	_tmp11_ = display;
	_tmp12_ = g_signal_connect_object ((GObject*) _tmp11_, "notify::can-grab-mouse", (GCallback) ___lambda32__g_object_notify, self, 0);
	self->priv->display_can_grab_id = _tmp12_;
	boxes_display_page_set_overlay_toolbar_visible (self, FALSE);
	boxes_display_page_update_title (self);
	_tmp13_ = _data10_->widget;
	_tmp14_ = _data10_->widget;
	_tmp15_ = gtk_widget_get_events (_tmp14_);
	gtk_widget_set_events (_tmp13_, _tmp15_ & (~GDK_POINTER_MOTION_MASK));
	_tmp16_ = self->priv->event_box;
	_tmp17_ = _data10_->widget;
	gtk_container_add ((GtkContainer*) _tmp16_, _tmp17_);
	_tmp18_ = self->priv->event_box;
	gtk_widget_show_all ((GtkWidget*) _tmp18_);
	_data10_->draw_id = (gulong) 0;
	_tmp19_ = _data10_->widget;
	_tmp20_ = g_signal_connect_data (_tmp19_, "draw", (GCallback) ___lambda33__gtk_widget_draw, block10_data_ref (_data10_), (GClosureNotify) block10_data_unref, 0);
	_data10_->draw_id = _tmp20_;
	boxes_display_page_show (self);
	block10_data_unref (_data10_);
	_data10_ = 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_;
	GtkWidget* _tmp13_;
	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->cursor_id;
	if (_tmp9_ != ((gulong) 0)) {
		GtkWidget* _tmp10_;
		GdkWindow* _tmp11_ = NULL;
		gulong _tmp12_;
		_tmp10_ = widget;
		_tmp11_ = gtk_widget_get_window (_tmp10_);
		_tmp12_ = self->priv->cursor_id;
		g_signal_handler_disconnect ((GObject*) _tmp11_, _tmp12_);
		self->priv->cursor_id = (gulong) 0;
	}
	_tmp13_ = widget;
	if (_tmp13_ != NULL) {
		GtkEventBox* _tmp14_;
		GtkWidget* _tmp15_;
		_tmp14_ = self->priv->event_box;
		_tmp15_ = widget;
		gtk_container_remove ((GtkContainer*) _tmp14_, _tmp15_);
	}
	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;
	gboolean _tmp0_ = FALSE;
	BoxesDisplay* _tmp1_;
	gboolean _tmp5_;
	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;
	}
	_tmp5_ = _tmp0_;
	result = _tmp5_;
	return result;
}


static gboolean boxes_display_page_get_grabbed (BoxesDisplayPage* self) {
	gboolean result;
	gboolean _tmp0_ = FALSE;
	BoxesDisplay* _tmp1_;
	gboolean _tmp5_;
	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;
	}
	_tmp5_ = _tmp0_;
	result = _tmp5_;
	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 = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_DISPLAY_PAGE, BoxesDisplayPage);
	boxes_display_page_toolbar_event_stop (self);
	_g_object_unref0 (self->priv->overlay);
	_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 = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_DISPLAY_PAGE, BoxesDisplayPage);
	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;
	}
}



