/* machine.c generated by valac 0.17.7, the Vala compiler
 * generated from machine.vala, do not modify */

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

#include <glib.h>
#include <glib-object.h>
#include <clutter/clutter.h>
#include <gio/gio.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <libcommon.h>
#include <stdlib.h>
#include <string.h>
#include <cairo.h>
#include <gtk/gtk.h>
#include <clutter-gtk/clutter-gtk.h>
#include <float.h>
#include <math.h>
#include <gdk/gdk.h>
#include <glib/gstdio.h>
#include <glib/gi18n-lib.h>


#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;
typedef struct _BoxesUIPrivate BoxesUIPrivate;

#define BOXES_TYPE_UI_STATE (boxes_ui_state_get_type ())

#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;
typedef struct _BoxesCollectionItemPrivate BoxesCollectionItemPrivate;

#define BOXES_TYPE_IPROPERTIES_PROVIDER (boxes_iproperties_provider_get_type ())
#define BOXES_IPROPERTIES_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_IPROPERTIES_PROVIDER, BoxesIPropertiesProvider))
#define BOXES_IS_IPROPERTIES_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_IPROPERTIES_PROVIDER))
#define BOXES_IPROPERTIES_PROVIDER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), BOXES_TYPE_IPROPERTIES_PROVIDER, BoxesIPropertiesProviderIface))

typedef struct _BoxesIPropertiesProvider BoxesIPropertiesProvider;
typedef struct _BoxesIPropertiesProviderIface BoxesIPropertiesProviderIface;

#define BOXES_TYPE_PROPERTIES_PAGE (boxes_properties_page_get_type ())

#define BOXES_TYPE_PROPERTY (boxes_property_get_type ())
#define BOXES_PROPERTY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_PROPERTY, BoxesProperty))
#define BOXES_PROPERTY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_PROPERTY, BoxesPropertyClass))
#define BOXES_IS_PROPERTY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_PROPERTY))
#define BOXES_IS_PROPERTY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_PROPERTY))
#define BOXES_PROPERTY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_PROPERTY, BoxesPropertyClass))

typedef struct _BoxesProperty BoxesProperty;
typedef struct _BoxesPropertyClass BoxesPropertyClass;

#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;
typedef struct _BoxesMachinePrivate BoxesMachinePrivate;

#define BOXES_TYPE_MACHINE_ACTOR (boxes_machine_actor_get_type ())
#define BOXES_MACHINE_ACTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_MACHINE_ACTOR, BoxesMachineActor))
#define BOXES_MACHINE_ACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_MACHINE_ACTOR, BoxesMachineActorClass))
#define BOXES_IS_MACHINE_ACTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_MACHINE_ACTOR))
#define BOXES_IS_MACHINE_ACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_MACHINE_ACTOR))
#define BOXES_MACHINE_ACTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_MACHINE_ACTOR, BoxesMachineActorClass))

typedef struct _BoxesMachineActor BoxesMachineActor;
typedef struct _BoxesMachineActorClass BoxesMachineActorClass;

#define BOXES_MACHINE_TYPE_MACHINE_STATE (boxes_machine_machine_state_get_type ())

#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;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

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

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

#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 _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _BoxesMachineTakeScreenshotData BoxesMachineTakeScreenshotData;
typedef struct _BoxesMachineUpdateScreenshotData BoxesMachineUpdateScreenshotData;
#define _cairo_pattern_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_pattern_destroy (var), NULL)))
#define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL)))
#define _cairo_surface_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_surface_destroy (var), NULL)))
#define _gtk_icon_info_free0(var) ((var == NULL) ? NULL : (var = (gtk_icon_info_free (var), NULL)))
typedef struct _BoxesMachineActorPrivate BoxesMachineActorPrivate;
typedef struct _BoxesPropertiesPrivate BoxesPropertiesPrivate;
typedef struct _Block25Data Block25Data;
typedef struct _Block26Data Block26Data;
typedef struct _Block27Data Block27Data;

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 _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 _BoxesCollectionItem {
	BoxesUI parent_instance;
	BoxesCollectionItemPrivate * priv;
};

struct _BoxesCollectionItemClass {
	BoxesUIClass parent_class;
};

typedef enum  {
	BOXES_PROPERTIES_PAGE_LOGIN,
	BOXES_PROPERTIES_PAGE_SYSTEM,
	BOXES_PROPERTIES_PAGE_DISPLAY,
	BOXES_PROPERTIES_PAGE_DEVICES,
	BOXES_PROPERTIES_PAGE_LAST
} BoxesPropertiesPage;

struct _BoxesIPropertiesProviderIface {
	GTypeInterface parent_iface;
	GList* (*get_properties) (BoxesIPropertiesProvider* self, BoxesPropertiesPage page);
};

struct _BoxesMachine {
	BoxesCollectionItem parent_instance;
	BoxesMachinePrivate * priv;
	BoxesMachineActor* machine_actor;
	BoxesCollectionSource* source;
	BoxesDisplayConfig* config;
	gboolean stay_on_display;
	gboolean suspend_at_exit;
	gboolean deleted;
};

struct _BoxesMachineClass {
	BoxesCollectionItemClass parent_class;
	void (*take_screenshot) (BoxesMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	GdkPixbuf* (*take_screenshot_finish) (BoxesMachine* self, GAsyncResult* _res_, GError** error);
	GList* (*get_properties) (BoxesMachine* self, BoxesPropertiesPage page);
	void (*connect_display) (BoxesMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*connect_display_finish) (BoxesMachine* self, GAsyncResult* _res_, GError** error);
	void (*disconnect_display) (BoxesMachine* self);
	void (*delete) (BoxesMachine* self, gboolean by_user);
};

typedef enum  {
	BOXES_MACHINE_MACHINE_STATE_UNKNOWN,
	BOXES_MACHINE_MACHINE_STATE_STOPPED,
	BOXES_MACHINE_MACHINE_STATE_RUNNING,
	BOXES_MACHINE_MACHINE_STATE_PAUSED,
	BOXES_MACHINE_MACHINE_STATE_SAVED
} BoxesMachineMachineState;

struct _BoxesMachinePrivate {
	GdkPixbuf* _pixbuf;
	gchar* _info;
	gchar* _status;
	gulong show_id;
	gulong hide_id;
	guint show_timeout_id;
	gulong disconnected_id;
	gulong need_password_id;
	gulong need_username_id;
	gulong ui_state_id;
	guint screenshot_id;
	gboolean updating_screenshot;
	GdkPixbuf* orig_pixbuf;
	BoxesMachineMachineState _state;
	BoxesDisplay* _display;
	gint screenshot_counter;
};

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

struct _BoxesMachineTakeScreenshotData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesMachine* self;
	GdkPixbuf* result;
};

struct _BoxesMachineUpdateScreenshotData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesMachine* self;
	gboolean force_save;
	gboolean first_check;
	gboolean _tmp0_;
	GdkPixbuf* large_screenshot;
	GdkPixbuf* _tmp1_;
	GdkPixbuf* _tmp2_;
	gboolean _tmp3_;
	GdkPixbuf* _tmp4_;
	GdkPixbuf* _tmp5_;
	GError* _error_;
	GdkPixbuf* _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	gint _tmp9_;
	GdkPixbuf* _tmp10_;
	gboolean _tmp11_;
	GError * _inner_error_;
};

struct _BoxesMachineActor {
	BoxesUI parent_instance;
	BoxesMachineActorPrivate * priv;
	ClutterActor* _actor;
};

struct _BoxesMachineActorClass {
	BoxesUIClass parent_class;
};

struct _BoxesMachineActorPrivate {
	GtkClutterTexture* screenshot;
	GtkClutterActor* gtk_vbox;
	GtkClutterActor* display;
	GtkLabel* label;
	GtkVBox* vbox;
	GtkEntry* password_entry;
	BoxesMachine* machine;
	gulong track_screenshot_id;
};

struct _BoxesProperties {
	BoxesUI parent_instance;
	BoxesPropertiesPrivate * priv;
	GtkWidget* screenshot_placeholder;
};

struct _BoxesPropertiesClass {
	BoxesUIClass parent_class;
};

struct _Block25Data {
	int _ref_count_;
	BoxesMachineActor * self;
	BoxesMachine* machine;
};

typedef void (*BoxesActorFunc) (ClutterActor* actor, void* user_data);
struct _Block26Data {
	int _ref_count_;
	BoxesMachineActor * self;
	BoxesActorFunc update_screenshot_alloc;
	gpointer update_screenshot_alloc_target;
	GDestroyNotify update_screenshot_alloc_target_destroy_notify;
};

struct _Block27Data {
	int _ref_count_;
	BoxesMachineActor * self;
	gulong completed_id;
};


static gpointer boxes_machine_parent_class = NULL;
static cairo_surface_t* boxes_machine_grid_surface;
static cairo_surface_t* boxes_machine_grid_surface = NULL;
static GdkPixbuf* boxes_machine_default_fallback;
static GdkPixbuf* boxes_machine_default_fallback = NULL;
extern BoxesApp* boxes_app_app;
static BoxesIPropertiesProviderIface* boxes_machine_boxes_iproperties_provider_parent_iface = NULL;
static gpointer boxes_machine_actor_parent_class = NULL;

GType boxes_ui_get_type (void) G_GNUC_CONST;
GType boxes_ui_state_get_type (void) G_GNUC_CONST;
GType boxes_collection_item_get_type (void) G_GNUC_CONST;
GType boxes_properties_page_get_type (void) G_GNUC_CONST;
GType boxes_property_get_type (void) G_GNUC_CONST;
GType boxes_iproperties_provider_get_type (void) G_GNUC_CONST;
GType boxes_machine_get_type (void) G_GNUC_CONST;
GType boxes_machine_actor_get_type (void) G_GNUC_CONST;
GType boxes_machine_machine_state_get_type (void) G_GNUC_CONST;
GType boxes_display_get_type (void) G_GNUC_CONST;
#define BOXES_MACHINE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_MACHINE, BoxesMachinePrivate))
enum  {
	BOXES_MACHINE_DUMMY_PROPERTY,
	BOXES_MACHINE_ACTOR,
	BOXES_MACHINE_PIXBUF,
	BOXES_MACHINE_INFO,
	BOXES_MACHINE_STATUS,
	BOXES_MACHINE_STATE,
	BOXES_MACHINE_DISPLAY
};
#define BOXES_MACHINE_SCREENSHOT_WIDTH 180
#define BOXES_MACHINE_SCREENSHOT_HEIGHT 134
static void boxes_machine_show_display (BoxesMachine* self);
BoxesDisplay* boxes_machine_get_display (BoxesMachine* self);
GtkWidget* boxes_display_get_display (BoxesDisplay* self, gint n);
GType boxes_app_get_type (void) G_GNUC_CONST;
BoxesUIState boxes_ui_get_ui_state (BoxesUI* self);
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_display_page_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;
void boxes_display_page_show_display (BoxesDisplayPage* self, BoxesDisplay* display, GtkWidget* widget);
void boxes_machine_actor_update_display (BoxesMachineActor* self, GtkWidget* widget, gboolean zoom);
BoxesMachine* boxes_machine_construct (GType object_type, BoxesCollectionSource* source, const gchar* name);
BoxesCollectionItem* boxes_collection_item_construct (GType object_type);
void boxes_collection_item_set_name (BoxesCollectionItem* self, const gchar* value);
static GdkPixbuf* boxes_machine_draw_fallback_vm (gint width, gint height, gboolean force);
void boxes_machine_set_pixbuf (BoxesMachine* self, GdkPixbuf* value);
BoxesMachineActor* boxes_machine_actor_new (BoxesMachine* machine);
BoxesMachineActor* boxes_machine_actor_construct (GType object_type, BoxesMachine* machine);
static void __lambda99_ (BoxesMachine* self);
void boxes_machine_set_screenshot_enable (BoxesMachine* self, gboolean enable);
static void ___lambda99__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
void boxes_machine_load_screenshot (BoxesMachine* self);
static gchar* boxes_machine_get_screenshot_filename (BoxesMachine* self, GError** error);
void boxes_machine_set_screenshot (BoxesMachine* self, GdkPixbuf* large_screenshot, gboolean save);
void boxes_machine_update_screenshot (BoxesMachine* self, gboolean force_save, gboolean first_check, GAsyncReadyCallback _callback_, gpointer _user_data_);
void boxes_machine_update_screenshot_finish (BoxesMachine* self, GAsyncResult* _res_);
static gboolean ___lambda50_ (BoxesMachine* self);
static gboolean ____lambda50__gsource_func (gpointer self);
static void boxes_machine_real_take_screenshot_data_free (gpointer _data);
static void boxes_machine_real_take_screenshot (BoxesMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void boxes_machine_take_screenshot (BoxesMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
GdkPixbuf* boxes_machine_take_screenshot_finish (BoxesMachine* self, GAsyncResult* _res_, GError** error);
static gboolean boxes_machine_real_take_screenshot_co (BoxesMachineTakeScreenshotData* _data_);
GList* boxes_machine_get_properties (BoxesMachine* self, BoxesPropertiesPage page);
static GList* boxes_machine_real_get_properties (BoxesMachine* self, BoxesPropertiesPage page);
void boxes_machine_connect_display (BoxesMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void boxes_machine_connect_display_finish (BoxesMachine* self, GAsyncResult* _res_, GError** error);
void boxes_machine_disconnect_display (BoxesMachine* self);
static void boxes_machine_real_disconnect_display (BoxesMachine* self);
BoxesMachineMachineState boxes_machine_get_state (BoxesMachine* self);
GdkPixbuf* boxes_display_get_pixbuf (BoxesDisplay* self, gint n, GError** error);
GtkWidget* boxes_display_page_remove_display (BoxesDisplayPage* self);
void boxes_display_disconnect_it (BoxesDisplay* self);
void boxes_machine_set_display (BoxesMachine* self, BoxesDisplay* value);
void boxes_machine_create_display_config (BoxesMachine* self, const gchar* uuid);
const gchar* boxes_collection_item_get_name (BoxesCollectionItem* self);
gchar* boxes_uuid_generate (void);
gboolean boxes_machine_is_running (BoxesMachine* self);
static void boxes_machine_save_pixbuf_as_screenshot (BoxesMachine* self, GdkPixbuf* pixbuf);
static gint boxes_machine_pixbuf_energy (BoxesMachine* self, GdkPixbuf* pixbuf);
static GdkPixbuf* boxes_machine_draw_vm (BoxesMachine* self, GdkPixbuf* pixbuf, gint width, gint height);
void boxes_machine_actor_set_screenshot (BoxesMachineActor* self, GdkPixbuf* pixbuf);
static GdkPixbuf* boxes_machine_draw_stopped_vm (gint width, gint height);
GdkPixbuf* boxes_machine_get_pixbuf (BoxesMachine* self);
static void boxes_machine_update_screenshot_data_free (gpointer _data);
static gboolean boxes_machine_update_screenshot_co (BoxesMachineUpdateScreenshotData* _data_);
static void boxes_machine_update_screenshot_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
void boxes_machine_delete (BoxesMachine* self, gboolean by_user);
static void boxes_machine_real_delete (BoxesMachine* self, gboolean by_user);
static void boxes_machine_real_ui_state_changed (BoxesUI* base);
void boxes_ui_set_ui_state (BoxesUI* self, BoxesUIState value);
ClutterActor* boxes_ui_get_actor (BoxesUI* self);
const gchar* boxes_machine_get_info (BoxesMachine* self);
void boxes_machine_set_info (BoxesMachine* self, const gchar* value);
const gchar* boxes_machine_get_status (BoxesMachine* self);
void boxes_machine_set_status (BoxesMachine* self, const gchar* value);
void boxes_machine_set_state (BoxesMachine* self, BoxesMachineMachineState value);
const gchar* boxes_machine_machine_state_to_string (BoxesMachineMachineState self);
static void _boxes_machine_display___lambda22_ (BoxesMachine* self, gint id);
static gboolean ___lambda23_ (BoxesMachine* self);
static gboolean ____lambda23__gsource_func (gpointer self);
static void __boxes_machine_display___lambda22__boxes_display_show (BoxesDisplay* _sender, gint display_id, gpointer self);
static void _boxes_machine_display___lambda92_ (BoxesMachine* self, gint id);
static void __boxes_machine_display___lambda92__boxes_display_hide (BoxesDisplay* _sender, gint display_id, gpointer self);
static void _boxes_machine_display___lambda93_ (BoxesMachine* self);
static void __boxes_machine_display___lambda93__boxes_display_disconnected (BoxesDisplay* _sender, gpointer self);
static void _boxes_machine_display___lambda94_ (BoxesMachine* self);
void boxes_machine_actor_set_password_needed (BoxesMachineActor* self, gboolean needed);
gboolean boxes_display_get_need_password (BoxesDisplay* self);
static void __boxes_machine_display___lambda94__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void _boxes_machine_display___lambda95_ (BoxesMachine* self);
void boxes_machine_actor_set_username_needed (BoxesMachineActor* self, gboolean needed);
gboolean boxes_display_get_need_username (BoxesDisplay* self);
static void __boxes_machine_display___lambda95__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
gchar* boxes_machine_actor_get_password (BoxesMachineActor* self);
void boxes_display_set_password (BoxesDisplay* self, const gchar* value);
static void boxes_machine_finalize (GObject* obj);
static void _vala_boxes_machine_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_boxes_machine_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
#define BOXES_MACHINE_ACTOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_MACHINE_ACTOR, BoxesMachineActorPrivate))
enum  {
	BOXES_MACHINE_ACTOR_DUMMY_PROPERTY,
	BOXES_MACHINE_ACTOR_ACTOR
};
static Block25Data* block25_data_ref (Block25Data* _data25_);
static void block25_data_unref (void * _userdata_);
BoxesUI* boxes_ui_construct (GType object_type);
void boxes_get_color (const gchar* desc, GdkColor* result);
static gboolean __lambda96_ (Block25Data* _data25_, GdkEventKey* event);
static gboolean ___lambda96__gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self);
void boxes_actor_remove (ClutterActor* actor);
static Block26Data* block26_data_ref (Block26Data* _data26_);
static void block26_data_unref (void * _userdata_);
void boxes_display_set_enable_inputs (BoxesDisplay* self, GtkWidget* widget, gboolean enable);
static void ___lambda35_ (BoxesMachineActor* self, ClutterActor* display);
static void ____lambda35__boxes_actor_func (ClutterActor* actor, gpointer self);
static void ___lambda90_ (Block26Data* _data26_);
static gboolean __lambda91_ (Block26Data* _data26_);
static gboolean ___lambda91__gsource_func (gpointer self);
static void ____lambda90__gtk_widget_size_allocate (GtkWidget* _sender, GtkAllocation* allocation, gpointer self);
static void boxes_machine_actor_real_ui_state_changed (BoxesUI* base);
void boxes_display_page_get_size (BoxesDisplayPage* self, gint* width, gint* height);
static void _____lambda97_ (BoxesMachineActor* self);
static void ______lambda97__clutter_actor_transitions_completed (ClutterActor* _sender, gpointer self);
void boxes_display_page_show (BoxesDisplayPage* self);
static Block27Data* block27_data_ref (Block27Data* _data27_);
static void block27_data_unref (void * _userdata_);
gboolean boxes_app_get_fullscreen (BoxesApp* self);
static void ___lambda98_ (Block27Data* _data27_);
static void ____lambda98__clutter_actor_transitions_completed (ClutterActor* _sender, gpointer self);
static void boxes_machine_actor_finalize (GObject* obj);
static void _vala_boxes_machine_actor_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);


GType boxes_machine_machine_state_get_type (void) {
	static volatile gsize boxes_machine_machine_state_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_machine_machine_state_type_id__volatile)) {
		static const GEnumValue values[] = {{BOXES_MACHINE_MACHINE_STATE_UNKNOWN, "BOXES_MACHINE_MACHINE_STATE_UNKNOWN", "unknown"}, {BOXES_MACHINE_MACHINE_STATE_STOPPED, "BOXES_MACHINE_MACHINE_STATE_STOPPED", "stopped"}, {BOXES_MACHINE_MACHINE_STATE_RUNNING, "BOXES_MACHINE_MACHINE_STATE_RUNNING", "running"}, {BOXES_MACHINE_MACHINE_STATE_PAUSED, "BOXES_MACHINE_MACHINE_STATE_PAUSED", "paused"}, {BOXES_MACHINE_MACHINE_STATE_SAVED, "BOXES_MACHINE_MACHINE_STATE_SAVED", "saved"}, {0, NULL, NULL}};
		GType boxes_machine_machine_state_type_id;
		boxes_machine_machine_state_type_id = g_enum_register_static ("BoxesMachineMachineState", values);
		g_once_init_leave (&boxes_machine_machine_state_type_id__volatile, boxes_machine_machine_state_type_id);
	}
	return boxes_machine_machine_state_type_id__volatile;
}


static void boxes_machine_show_display (BoxesMachine* self) {
	GtkWidget* widget = NULL;
	BoxesDisplay* _tmp0_;
	BoxesDisplay* _tmp1_;
	GtkWidget* _tmp2_ = NULL;
	BoxesApp* _tmp3_;
	BoxesUIState _tmp4_;
	BoxesUIState _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = boxes_machine_get_display (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = boxes_display_get_display (_tmp1_, 0);
	_g_object_unref0 (widget);
	widget = _tmp2_;
	_tmp3_ = boxes_app_app;
	_tmp4_ = boxes_ui_get_ui_state ((BoxesUI*) _tmp3_);
	_tmp5_ = _tmp4_;
	switch (_tmp5_) {
		case BOXES_UI_STATE_DISPLAY:
		{
			BoxesApp* _tmp6_;
			BoxesDisplayPage* _tmp7_;
			BoxesDisplay* _tmp8_;
			BoxesDisplay* _tmp9_;
			GtkWidget* _tmp10_;
			GtkWidget* _tmp11_;
			_tmp6_ = boxes_app_app;
			_tmp7_ = _tmp6_->display_page;
			_tmp8_ = boxes_machine_get_display (self);
			_tmp9_ = _tmp8_;
			_tmp10_ = widget;
			boxes_display_page_show_display (_tmp7_, _tmp9_, _tmp10_);
			_tmp11_ = widget;
			gtk_widget_grab_focus (_tmp11_);
			break;
		}
		case BOXES_UI_STATE_PROPERTIES:
		{
			BoxesMachineActor* _tmp12_;
			GtkWidget* _tmp13_;
			_tmp12_ = self->machine_actor;
			_tmp13_ = widget;
			boxes_machine_actor_update_display (_tmp12_, _tmp13_, FALSE);
			break;
		}
		default:
		break;
	}
	_g_object_unref0 (widget);
}


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


static void __lambda99_ (BoxesMachine* self) {
	BoxesApp* _tmp0_;
	BoxesUIState _tmp1_;
	BoxesUIState _tmp2_;
	_tmp0_ = boxes_app_app;
	_tmp1_ = boxes_ui_get_ui_state ((BoxesUI*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == BOXES_UI_STATE_DISPLAY) {
		boxes_machine_set_screenshot_enable (self, FALSE);
	} else {
		boxes_machine_set_screenshot_enable (self, TRUE);
	}
}


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


BoxesMachine* boxes_machine_construct (GType object_type, BoxesCollectionSource* source, const gchar* name) {
	BoxesMachine * self = NULL;
	const gchar* _tmp0_;
	BoxesCollectionSource* _tmp1_;
	BoxesCollectionSource* _tmp2_;
	GdkPixbuf* _tmp3_ = NULL;
	GdkPixbuf* _tmp4_;
	BoxesMachineActor* _tmp5_;
	BoxesApp* _tmp6_;
	gulong _tmp7_ = 0UL;
	g_return_val_if_fail (source != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	self = (BoxesMachine*) boxes_collection_item_construct (object_type);
	_tmp0_ = name;
	boxes_collection_item_set_name ((BoxesCollectionItem*) self, _tmp0_);
	_tmp1_ = source;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (self->source);
	self->source = _tmp2_;
	_tmp3_ = boxes_machine_draw_fallback_vm (BOXES_MACHINE_SCREENSHOT_WIDTH, BOXES_MACHINE_SCREENSHOT_HEIGHT, FALSE);
	_tmp4_ = _tmp3_;
	boxes_machine_set_pixbuf (self, _tmp4_);
	_g_object_unref0 (_tmp4_);
	_tmp5_ = boxes_machine_actor_new (self);
	_g_object_unref0 (self->machine_actor);
	self->machine_actor = _tmp5_;
	_tmp6_ = boxes_app_app;
	_tmp7_ = g_signal_connect_object ((GObject*) _tmp6_, "notify::ui-state", (GCallback) ___lambda99__g_object_notify, self, 0);
	self->priv->ui_state_id = _tmp7_;
	return self;
}


void boxes_machine_load_screenshot (BoxesMachine* self) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	{
		gchar* _tmp0_ = NULL;
		gchar* _tmp1_;
		gchar* _tmp2_;
		GdkPixbuf* _tmp3_;
		GdkPixbuf* _tmp4_;
		GdkPixbuf* screenshot;
		GdkPixbuf* _tmp5_;
		_tmp0_ = boxes_machine_get_screenshot_filename (self, &_inner_error_);
		_tmp1_ = _tmp0_;
		if (_inner_error_ != NULL) {
			goto __catch32_g_error;
		}
		_tmp2_ = _tmp1_;
		_tmp3_ = gdk_pixbuf_new_from_file (_tmp2_, &_inner_error_);
		_tmp4_ = _tmp3_;
		_g_free0 (_tmp2_);
		screenshot = _tmp4_;
		if (_inner_error_ != NULL) {
			goto __catch32_g_error;
		}
		_tmp5_ = screenshot;
		boxes_machine_set_screenshot (self, _tmp5_, FALSE);
		_g_object_unref0 (screenshot);
	}
	goto __finally32;
	__catch32_g_error:
	{
		GError* _error_ = NULL;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_g_error_free0 (_error_);
	}
	__finally32:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static gboolean ___lambda50_ (BoxesMachine* self) {
	gboolean result = FALSE;
	boxes_machine_update_screenshot (self, FALSE, FALSE, NULL, NULL);
	result = TRUE;
	return result;
}


static gboolean ____lambda50__gsource_func (gpointer self) {
	gboolean result;
	result = ___lambda50_ (self);
	return result;
}


void boxes_machine_set_screenshot_enable (BoxesMachine* self, gboolean enable) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = enable;
	if (_tmp0_) {
		guint _tmp1_;
		BoxesApp* _tmp2_;
		GSettings* _tmp3_;
		gint _tmp4_ = 0;
		gint interval;
		gint _tmp5_;
		guint _tmp6_ = 0U;
		_tmp1_ = self->priv->screenshot_id;
		if (_tmp1_ != ((guint) 0)) {
			return;
		}
		boxes_machine_update_screenshot (self, FALSE, TRUE, NULL, NULL);
		_tmp2_ = boxes_app_app;
		_tmp3_ = _tmp2_->settings;
		_tmp4_ = g_settings_get_int (_tmp3_, "screenshot-interval");
		interval = _tmp4_;
		_tmp5_ = interval;
		_tmp6_ = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) _tmp5_, ____lambda50__gsource_func, g_object_ref (self), g_object_unref);
		self->priv->screenshot_id = _tmp6_;
	} else {
		guint _tmp7_;
		_tmp7_ = self->priv->screenshot_id;
		if (_tmp7_ != ((guint) 0)) {
			guint _tmp8_;
			_tmp8_ = self->priv->screenshot_id;
			g_source_remove (_tmp8_);
		}
		self->priv->screenshot_id = (guint) 0;
	}
}


static gchar* boxes_machine_get_screenshot_filename (BoxesMachine* self, GError** error) {
	gchar* result = NULL;
	BoxesDisplayConfig* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gboolean _tmp4_;
	BoxesDisplayConfig* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_ = NULL;
	gchar* _tmp11_;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->config;
	_tmp1_ = boxes_display_config_get_uuid (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_ == NULL;
	_g_free0 (_tmp3_);
	if (_tmp4_) {
		GError* _tmp5_;
		_tmp5_ = g_error_new_literal (BOXES_ERROR, BOXES_ERROR_INVALID, "no uuid, cannot build screenshot filename");
		_inner_error_ = _tmp5_;
		if (_inner_error_->domain == BOXES_ERROR) {
			g_propagate_error (error, _inner_error_);
			return NULL;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
	}
	_tmp6_ = self->config;
	_tmp7_ = boxes_display_config_get_uuid (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = _tmp8_;
	_tmp10_ = boxes_get_screenshot_filename (_tmp9_);
	_tmp11_ = _tmp10_;
	_g_free0 (_tmp9_);
	result = _tmp11_;
	return result;
}


static void boxes_machine_real_take_screenshot_data_free (gpointer _data) {
	BoxesMachineTakeScreenshotData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (BoxesMachineTakeScreenshotData, _data_);
}


static void boxes_machine_real_take_screenshot (BoxesMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesMachineTakeScreenshotData* _data_;
	BoxesMachine* _tmp0_;
	_data_ = g_slice_new0 (BoxesMachineTakeScreenshotData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_machine_real_take_screenshot);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_machine_real_take_screenshot_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	boxes_machine_real_take_screenshot_co (_data_);
}


static GdkPixbuf* boxes_machine_real_take_screenshot_finish (BoxesMachine* self, GAsyncResult* _res_, GError** error) {
	GdkPixbuf* result;
	BoxesMachineTakeScreenshotData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static gboolean boxes_machine_real_take_screenshot_co (BoxesMachineTakeScreenshotData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->result = NULL;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


void boxes_machine_take_screenshot (BoxesMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BOXES_MACHINE_GET_CLASS (self)->take_screenshot (self, _callback_, _user_data_);
}


GdkPixbuf* boxes_machine_take_screenshot_finish (BoxesMachine* self, GAsyncResult* _res_, GError** error) {
	return BOXES_MACHINE_GET_CLASS (self)->take_screenshot_finish (self, _res_, error);
}


static GList* boxes_machine_real_get_properties (BoxesMachine* self, BoxesPropertiesPage page) {
	g_critical ("Type `%s' does not implement abstract method `boxes_machine_get_properties'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}


GList* boxes_machine_get_properties (BoxesMachine* self, BoxesPropertiesPage page) {
	g_return_val_if_fail (self != NULL, NULL);
	return BOXES_MACHINE_GET_CLASS (self)->get_properties (self, page);
}


void boxes_machine_connect_display (BoxesMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BOXES_MACHINE_GET_CLASS (self)->connect_display (self, _callback_, _user_data_);
}


void boxes_machine_connect_display_finish (BoxesMachine* self, GAsyncResult* _res_, GError** error) {
	BOXES_MACHINE_GET_CLASS (self)->connect_display_finish (self, _res_, error);
}


static void boxes_machine_real_disconnect_display (BoxesMachine* self) {
	BoxesDisplay* _tmp0_;
	BoxesDisplay* _tmp1_;
	BoxesMachineMachineState _tmp2_;
	BoxesMachineMachineState _tmp3_;
	BoxesApp* _tmp11_;
	BoxesDisplayPage* _tmp12_;
	GtkWidget* _tmp13_ = NULL;
	GtkWidget* _tmp14_;
	BoxesDisplay* _tmp15_;
	BoxesDisplay* _tmp16_;
	GError * _inner_error_ = NULL;
	_tmp0_ = boxes_machine_get_display (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		return;
	}
	_tmp2_ = boxes_machine_get_state (self);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != BOXES_MACHINE_MACHINE_STATE_STOPPED) {
		{
			BoxesDisplay* _tmp4_;
			BoxesDisplay* _tmp5_;
			GdkPixbuf* _tmp6_ = NULL;
			GdkPixbuf* pixbuf;
			GdkPixbuf* _tmp7_;
			_tmp4_ = boxes_machine_get_display (self);
			_tmp5_ = _tmp4_;
			_tmp6_ = boxes_display_get_pixbuf (_tmp5_, 0, &_inner_error_);
			pixbuf = _tmp6_;
			if (_inner_error_ != NULL) {
				goto __catch33_g_error;
			}
			_tmp7_ = pixbuf;
			if (_tmp7_ != NULL) {
				GdkPixbuf* _tmp8_;
				_tmp8_ = pixbuf;
				boxes_machine_set_screenshot (self, _tmp8_, TRUE);
			}
			_g_object_unref0 (pixbuf);
		}
		goto __finally33;
		__catch33_g_error:
		{
			GError* _error_ = NULL;
			GError* _tmp9_;
			const gchar* _tmp10_;
			_error_ = _inner_error_;
			_inner_error_ = NULL;
			_tmp9_ = _error_;
			_tmp10_ = _tmp9_->message;
			g_warning ("machine.vala:223: %s", _tmp10_);
			_g_error_free0 (_error_);
		}
		__finally33:
		if (_inner_error_ != NULL) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return;
		}
	}
	_tmp11_ = boxes_app_app;
	_tmp12_ = _tmp11_->display_page;
	_tmp13_ = boxes_display_page_remove_display (_tmp12_);
	_tmp14_ = _tmp13_;
	_g_object_unref0 (_tmp14_);
	_tmp15_ = boxes_machine_get_display (self);
	_tmp16_ = _tmp15_;
	boxes_display_disconnect_it (_tmp16_);
	boxes_machine_set_display (self, NULL);
}


void boxes_machine_disconnect_display (BoxesMachine* self) {
	g_return_if_fail (self != NULL);
	BOXES_MACHINE_GET_CLASS (self)->disconnect_display (self);
}


void boxes_machine_create_display_config (BoxesMachine* self, const gchar* uuid) {
	BoxesDisplayConfig* _tmp0_;
	gchar* _tmp1_;
	gchar* group;
	const gchar* _tmp2_;
	BoxesCollectionSource* _tmp8_;
	const gchar* _tmp9_;
	BoxesDisplayConfig* _tmp10_;
	BoxesDisplayConfig* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	gboolean _tmp17_;
	gboolean _tmp21_ = FALSE;
	const gchar* _tmp22_;
	gboolean _tmp28_;
	BoxesDisplayConfig* _tmp31_;
	gchar* _tmp32_;
	gchar* _tmp33_;
	gchar* _tmp34_;
	gboolean _tmp35_;
	BoxesDisplayConfig* _tmp39_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->config;
	g_return_if_fail (_tmp0_ == NULL);
	_tmp1_ = g_strdup ("display");
	group = _tmp1_;
	_tmp2_ = uuid;
	if (_tmp2_ != NULL) {
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp3_ = group;
		_tmp4_ = uuid;
		_tmp5_ = g_strconcat (" ", _tmp4_, NULL);
		_tmp6_ = _tmp5_;
		_tmp7_ = g_strconcat (_tmp3_, _tmp6_, NULL);
		_g_free0 (group);
		group = _tmp7_;
		_g_free0 (_tmp6_);
	}
	_tmp8_ = self->source;
	_tmp9_ = group;
	_tmp10_ = boxes_display_config_new_with_group (_tmp8_, _tmp9_);
	_g_object_unref0 (self->config);
	self->config = _tmp10_;
	_tmp11_ = self->config;
	_tmp12_ = boxes_display_config_get_last_seen_name (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = _tmp13_;
	_tmp15_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
	_tmp16_ = _tmp15_;
	_tmp17_ = g_strcmp0 (_tmp14_, _tmp16_) != 0;
	_g_free0 (_tmp14_);
	if (_tmp17_) {
		BoxesDisplayConfig* _tmp18_;
		const gchar* _tmp19_;
		const gchar* _tmp20_;
		_tmp18_ = self->config;
		_tmp19_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
		_tmp20_ = _tmp19_;
		boxes_display_config_set_last_seen_name (_tmp18_, _tmp20_);
	}
	_tmp22_ = uuid;
	if (_tmp22_ != NULL) {
		BoxesDisplayConfig* _tmp23_;
		gchar* _tmp24_;
		gchar* _tmp25_;
		gchar* _tmp26_;
		const gchar* _tmp27_;
		_tmp23_ = self->config;
		_tmp24_ = boxes_display_config_get_uuid (_tmp23_);
		_tmp25_ = _tmp24_;
		_tmp26_ = _tmp25_;
		_tmp27_ = uuid;
		_tmp21_ = g_strcmp0 (_tmp26_, _tmp27_) != 0;
		_g_free0 (_tmp26_);
	} else {
		_tmp21_ = FALSE;
	}
	_tmp28_ = _tmp21_;
	if (_tmp28_) {
		BoxesDisplayConfig* _tmp29_;
		const gchar* _tmp30_;
		_tmp29_ = self->config;
		_tmp30_ = uuid;
		boxes_display_config_set_uuid (_tmp29_, _tmp30_);
	}
	_tmp31_ = self->config;
	_tmp32_ = boxes_display_config_get_uuid (_tmp31_);
	_tmp33_ = _tmp32_;
	_tmp34_ = _tmp33_;
	_tmp35_ = _tmp34_ == NULL;
	_g_free0 (_tmp34_);
	if (_tmp35_) {
		BoxesDisplayConfig* _tmp36_;
		gchar* _tmp37_ = NULL;
		gchar* _tmp38_;
		_tmp36_ = self->config;
		_tmp37_ = boxes_uuid_generate ();
		_tmp38_ = _tmp37_;
		boxes_display_config_set_uuid (_tmp36_, _tmp38_);
		_g_free0 (_tmp38_);
	}
	_tmp39_ = self->config;
	boxes_iconfig_save ((BoxesIConfig*) _tmp39_);
	_g_free0 (group);
}


gboolean boxes_machine_is_running (BoxesMachine* self) {
	gboolean result = FALSE;
	BoxesMachineMachineState _tmp0_;
	BoxesMachineMachineState _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = boxes_machine_get_state (self);
	_tmp1_ = _tmp0_;
	result = _tmp1_ == BOXES_MACHINE_MACHINE_STATE_RUNNING;
	return result;
}


static void boxes_machine_save_pixbuf_as_screenshot (BoxesMachine* self, GdkPixbuf* pixbuf) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	{
		gchar* _tmp0_ = NULL;
		gchar* _tmp1_;
		GdkPixbuf* _tmp2_;
		gchar* _tmp3_;
		_tmp0_ = boxes_machine_get_screenshot_filename (self, &_inner_error_);
		_tmp1_ = _tmp0_;
		if (_inner_error_ != NULL) {
			goto __catch34_g_error;
		}
		_tmp2_ = pixbuf;
		_tmp3_ = _tmp1_;
		gdk_pixbuf_save (_tmp2_, _tmp3_, "png", &_inner_error_, NULL);
		_g_free0 (_tmp3_);
		if (_inner_error_ != NULL) {
			goto __catch34_g_error;
		}
	}
	goto __finally34;
	__catch34_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp4_ = _error_;
		_tmp5_ = _tmp4_->message;
		g_warning ("machine.vala:262: %s", _tmp5_);
		_g_error_free0 (_error_);
	}
	__finally34:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static gint boxes_machine_pixbuf_energy (BoxesMachine* self, GdkPixbuf* pixbuf) {
	gint result = 0;
	GdkPixbuf* _tmp0_;
	guint8* _tmp1_ = NULL;
	guint8* pixels;
	gint pixels_length1;
	gint _pixels_size_;
	GdkPixbuf* _tmp2_;
	gint _tmp3_ = 0;
	gint w;
	GdkPixbuf* _tmp4_;
	gint _tmp5_ = 0;
	gint h;
	GdkPixbuf* _tmp6_;
	gint _tmp7_ = 0;
	gint rowstride;
	GdkPixbuf* _tmp8_;
	gint _tmp9_ = 0;
	gint n_channels;
	gint energy;
	gint row_start;
	gint _tmp42_;
	gint _tmp43_;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (pixbuf != NULL, 0);
	_tmp0_ = pixbuf;
	_tmp1_ = gdk_pixbuf_get_pixels (_tmp0_);
	pixels = _tmp1_;
	pixels_length1 = -1;
	_pixels_size_ = pixels_length1;
	_tmp2_ = pixbuf;
	_tmp3_ = gdk_pixbuf_get_width (_tmp2_);
	w = _tmp3_;
	_tmp4_ = pixbuf;
	_tmp5_ = gdk_pixbuf_get_height (_tmp4_);
	h = _tmp5_;
	_tmp6_ = pixbuf;
	_tmp7_ = gdk_pixbuf_get_rowstride (_tmp6_);
	rowstride = _tmp7_;
	_tmp8_ = pixbuf;
	_tmp9_ = gdk_pixbuf_get_n_channels (_tmp8_);
	n_channels = _tmp9_;
	energy = 0;
	row_start = 0;
	{
		gint y;
		y = 0;
		{
			gboolean _tmp10_;
			_tmp10_ = TRUE;
			while (TRUE) {
				gboolean _tmp11_;
				gint _tmp13_;
				gint _tmp14_;
				gint row_energy;
				gint _tmp15_;
				gint i;
				gint _tmp37_;
				gint _tmp38_;
				gint _tmp39_;
				gint _tmp40_;
				gint _tmp41_;
				_tmp11_ = _tmp10_;
				if (!_tmp11_) {
					gint _tmp12_;
					_tmp12_ = y;
					y = _tmp12_ + 1;
				}
				_tmp10_ = FALSE;
				_tmp13_ = y;
				_tmp14_ = h;
				if (!(_tmp13_ < _tmp14_)) {
					break;
				}
				row_energy = 0;
				_tmp15_ = row_start;
				i = _tmp15_;
				{
					gint x;
					x = 0;
					{
						gboolean _tmp16_;
						_tmp16_ = TRUE;
						while (TRUE) {
							gboolean _tmp17_;
							gint _tmp19_;
							gint _tmp20_;
							guint8* _tmp21_;
							gint _tmp21__length1;
							gint _tmp22_;
							guint8 _tmp23_;
							guint8* _tmp24_;
							gint _tmp24__length1;
							gint _tmp25_;
							guint8 _tmp26_;
							gint _tmp27_ = 0;
							guint8* _tmp28_;
							gint _tmp28__length1;
							gint _tmp29_;
							guint8 _tmp30_;
							gint _tmp31_ = 0;
							gint max;
							gint _tmp32_;
							gint _tmp33_;
							gint _tmp34_;
							gint _tmp35_;
							gint _tmp36_;
							_tmp17_ = _tmp16_;
							if (!_tmp17_) {
								gint _tmp18_;
								_tmp18_ = x;
								x = _tmp18_ + 1;
							}
							_tmp16_ = FALSE;
							_tmp19_ = x;
							_tmp20_ = w;
							if (!(_tmp19_ < _tmp20_)) {
								break;
							}
							_tmp21_ = pixels;
							_tmp21__length1 = pixels_length1;
							_tmp22_ = i;
							_tmp23_ = _tmp21_[_tmp22_ + 0];
							_tmp24_ = pixels;
							_tmp24__length1 = pixels_length1;
							_tmp25_ = i;
							_tmp26_ = _tmp24_[_tmp25_ + 1];
							_tmp27_ = MAX ((gint) _tmp23_, (gint) _tmp26_);
							_tmp28_ = pixels;
							_tmp28__length1 = pixels_length1;
							_tmp29_ = i;
							_tmp30_ = _tmp28_[_tmp29_ + 2];
							_tmp31_ = MAX (_tmp27_, (gint) _tmp30_);
							max = _tmp31_;
							_tmp32_ = row_energy;
							_tmp33_ = max;
							_tmp34_ = max;
							row_energy = _tmp32_ + (_tmp33_ * _tmp34_);
							_tmp35_ = i;
							_tmp36_ = n_channels;
							i = _tmp35_ + _tmp36_;
						}
					}
				}
				_tmp37_ = energy;
				_tmp38_ = row_energy;
				_tmp39_ = w;
				energy = _tmp37_ + (_tmp38_ / _tmp39_);
				_tmp40_ = row_start;
				_tmp41_ = rowstride;
				row_start = _tmp40_ + _tmp41_;
			}
		}
	}
	_tmp42_ = energy;
	_tmp43_ = h;
	result = _tmp42_ / _tmp43_;
	return result;
}


void boxes_machine_set_screenshot (BoxesMachine* self, GdkPixbuf* large_screenshot, gboolean save) {
	GdkPixbuf* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = large_screenshot;
	if (_tmp0_ != NULL) {
		GdkPixbuf* _tmp1_;
		gint _tmp2_ = 0;
		gint pw;
		GdkPixbuf* _tmp3_;
		gint _tmp4_ = 0;
		gint ph;
		gint _tmp5_;
		gint _tmp6_;
		gdouble _tmp7_ = 0.0;
		gdouble s;
		gint _tmp8_;
		gdouble _tmp9_;
		gint w;
		gint _tmp10_;
		gdouble _tmp11_;
		gint h;
		GdkPixbuf* _tmp12_;
		gboolean _tmp13_;
		gboolean _tmp14_;
		gint _tmp15_;
		gint _tmp16_;
		GdkPixbuf* _tmp17_;
		GdkPixbuf* small_screenshot;
		GdkPixbuf* _tmp18_;
		GdkPixbuf* _tmp19_;
		gint _tmp20_;
		gint _tmp21_;
		gdouble _tmp22_;
		gdouble _tmp23_;
		GdkPixbuf* _tmp24_;
		gint _tmp25_ = 0;
		GdkPixbuf* _tmp26_;
		GdkPixbuf* _tmp27_;
		GdkPixbuf* _tmp28_;
		GdkPixbuf* _tmp29_ = NULL;
		GdkPixbuf* _tmp30_;
		BoxesMachineActor* _tmp31_;
		GdkPixbuf* _tmp32_;
		gboolean _tmp33_;
		_tmp1_ = large_screenshot;
		_tmp2_ = gdk_pixbuf_get_width (_tmp1_);
		pw = _tmp2_;
		_tmp3_ = large_screenshot;
		_tmp4_ = gdk_pixbuf_get_height (_tmp3_);
		ph = _tmp4_;
		_tmp5_ = pw;
		_tmp6_ = ph;
		_tmp7_ = MIN (((gdouble) BOXES_MACHINE_SCREENSHOT_WIDTH) / _tmp5_, ((gdouble) BOXES_MACHINE_SCREENSHOT_HEIGHT) / _tmp6_);
		s = _tmp7_;
		_tmp8_ = pw;
		_tmp9_ = s;
		w = (gint) (_tmp8_ * _tmp9_);
		_tmp10_ = ph;
		_tmp11_ = s;
		h = (gint) (_tmp10_ * _tmp11_);
		_tmp12_ = large_screenshot;
		_tmp13_ = gdk_pixbuf_get_has_alpha (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = w;
		_tmp16_ = h;
		_tmp17_ = gdk_pixbuf_new (GDK_COLORSPACE_RGB, _tmp14_, 8, _tmp15_, _tmp16_);
		small_screenshot = _tmp17_;
		_tmp18_ = large_screenshot;
		_tmp19_ = small_screenshot;
		_tmp20_ = w;
		_tmp21_ = h;
		_tmp22_ = s;
		_tmp23_ = s;
		gdk_pixbuf_scale (_tmp18_, _tmp19_, 0, 0, _tmp20_, _tmp21_, (gdouble) 0, (gdouble) 0, _tmp22_, _tmp23_, GDK_INTERP_HYPER);
		_tmp24_ = small_screenshot;
		_tmp25_ = boxes_machine_pixbuf_energy (self, _tmp24_);
		if (_tmp25_ < 50) {
			_g_object_unref0 (small_screenshot);
			return;
		}
		_tmp26_ = small_screenshot;
		_tmp27_ = _g_object_ref0 (_tmp26_);
		_g_object_unref0 (self->priv->orig_pixbuf);
		self->priv->orig_pixbuf = _tmp27_;
		_tmp28_ = small_screenshot;
		_tmp29_ = boxes_machine_draw_vm (self, _tmp28_, BOXES_MACHINE_SCREENSHOT_WIDTH, BOXES_MACHINE_SCREENSHOT_HEIGHT);
		_tmp30_ = _tmp29_;
		boxes_machine_set_pixbuf (self, _tmp30_);
		_g_object_unref0 (_tmp30_);
		_tmp31_ = self->machine_actor;
		_tmp32_ = large_screenshot;
		boxes_machine_actor_set_screenshot (_tmp31_, _tmp32_);
		_tmp33_ = save;
		if (_tmp33_) {
			GdkPixbuf* _tmp34_;
			_tmp34_ = small_screenshot;
			boxes_machine_save_pixbuf_as_screenshot (self, _tmp34_);
		}
		_g_object_unref0 (small_screenshot);
	} else {
		GdkPixbuf* _tmp35_ = NULL;
		GdkPixbuf* _tmp36_;
		BoxesMachineActor* _tmp37_;
		GdkPixbuf* _tmp38_;
		_g_object_unref0 (self->priv->orig_pixbuf);
		self->priv->orig_pixbuf = NULL;
		_tmp35_ = boxes_machine_draw_stopped_vm (BOXES_MACHINE_SCREENSHOT_WIDTH, BOXES_MACHINE_SCREENSHOT_HEIGHT);
		_tmp36_ = _tmp35_;
		boxes_machine_set_pixbuf (self, _tmp36_);
		_g_object_unref0 (_tmp36_);
		_tmp37_ = self->machine_actor;
		_tmp38_ = self->priv->_pixbuf;
		boxes_machine_actor_set_screenshot (_tmp37_, _tmp38_);
	}
}


static void boxes_machine_update_screenshot_data_free (gpointer _data) {
	BoxesMachineUpdateScreenshotData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (BoxesMachineUpdateScreenshotData, _data_);
}


void boxes_machine_update_screenshot (BoxesMachine* self, gboolean force_save, gboolean first_check, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesMachineUpdateScreenshotData* _data_;
	BoxesMachine* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_data_ = g_slice_new0 (BoxesMachineUpdateScreenshotData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_machine_update_screenshot);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_machine_update_screenshot_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = force_save;
	_data_->force_save = _tmp1_;
	_tmp2_ = first_check;
	_data_->first_check = _tmp2_;
	boxes_machine_update_screenshot_co (_data_);
}


void boxes_machine_update_screenshot_finish (BoxesMachine* self, GAsyncResult* _res_) {
	BoxesMachineUpdateScreenshotData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void boxes_machine_update_screenshot_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesMachineUpdateScreenshotData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_machine_update_screenshot_co (_data_);
}


static gboolean boxes_machine_update_screenshot_co (BoxesMachineUpdateScreenshotData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->updating_screenshot;
	if (_data_->_tmp0_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->self->priv->updating_screenshot = TRUE;
	_data_->large_screenshot = NULL;
	{
		_data_->_state_ = 1;
		boxes_machine_take_screenshot (_data_->self, boxes_machine_update_screenshot_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = boxes_machine_take_screenshot_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
		_data_->_tmp2_ = _data_->_tmp1_;
		if (_data_->_inner_error_ != NULL) {
			goto __catch35_g_error;
		}
		_g_object_unref0 (_data_->large_screenshot);
		_data_->large_screenshot = _data_->_tmp2_;
		_data_->_tmp3_ = _data_->first_check;
		if (_data_->_tmp3_) {
			_data_->_state_ = 2;
			boxes_machine_take_screenshot (_data_->self, boxes_machine_update_screenshot_ready, _data_);
			return FALSE;
			_state_2:
			_data_->_tmp4_ = NULL;
			_data_->_tmp4_ = boxes_machine_take_screenshot_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
			_data_->_tmp5_ = _data_->_tmp4_;
			if (_data_->_inner_error_ != NULL) {
				goto __catch35_g_error;
			}
			_g_object_unref0 (_data_->large_screenshot);
			_data_->large_screenshot = _data_->_tmp5_;
		}
	}
	goto __finally35;
	__catch35_g_error:
	{
		_data_->_error_ = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_g_error_free0 (_data_->_error_);
	}
	__finally35:
	if (_data_->_inner_error_ != NULL) {
		_g_object_unref0 (_data_->large_screenshot);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	_data_->_tmp6_ = _data_->large_screenshot;
	if (_data_->_tmp6_ != NULL) {
		_data_->_tmp8_ = _data_->force_save;
		if (_data_->_tmp8_) {
			_data_->_tmp7_ = TRUE;
		} else {
			_data_->_tmp9_ = _data_->self->priv->screenshot_counter;
			_data_->self->priv->screenshot_counter = _data_->_tmp9_ + 1;
			_data_->_tmp7_ = (_data_->_tmp9_ % 12) == 0;
		}
		_data_->_tmp10_ = _data_->large_screenshot;
		_data_->_tmp11_ = _data_->_tmp7_;
		boxes_machine_set_screenshot (_data_->self, _data_->_tmp10_, _data_->_tmp11_);
	}
	_data_->self->priv->updating_screenshot = FALSE;
	_g_object_unref0 (_data_->large_screenshot);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static GdkPixbuf* boxes_machine_draw_vm (BoxesMachine* self, GdkPixbuf* pixbuf, gint width, gint height) {
	GdkPixbuf* result = NULL;
	gint _tmp0_;
	gint _tmp1_;
	cairo_surface_t* _tmp2_;
	cairo_surface_t* surface;
	cairo_surface_t* _tmp3_;
	cairo_t* _tmp4_;
	cairo_t* context;
	GdkPixbuf* _tmp5_;
	gint _tmp6_ = 0;
	gint pw;
	GdkPixbuf* _tmp7_;
	gint _tmp8_ = 0;
	gint ph;
	gint _tmp9_;
	gint _tmp10_;
	gint x;
	gint _tmp11_;
	gint _tmp12_;
	gint y;
	cairo_t* _tmp13_;
	gint _tmp14_;
	gint _tmp15_;
	gint _tmp16_;
	gint _tmp17_;
	cairo_t* _tmp18_;
	cairo_t* _tmp19_;
	GdkPixbuf* _tmp20_;
	gint _tmp21_;
	gint _tmp22_;
	cairo_t* _tmp23_;
	cairo_t* _tmp24_;
	gboolean _tmp25_ = FALSE;
	cairo_surface_t* _tmp37_;
	gint _tmp38_;
	gint _tmp39_;
	GdkPixbuf* _tmp40_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (pixbuf != NULL, NULL);
	_tmp0_ = width;
	_tmp1_ = height;
	_tmp2_ = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, _tmp0_, _tmp1_);
	surface = _tmp2_;
	_tmp3_ = surface;
	_tmp4_ = cairo_create (_tmp3_);
	context = _tmp4_;
	_tmp5_ = pixbuf;
	_tmp6_ = gdk_pixbuf_get_width (_tmp5_);
	pw = _tmp6_;
	_tmp7_ = pixbuf;
	_tmp8_ = gdk_pixbuf_get_height (_tmp7_);
	ph = _tmp8_;
	_tmp9_ = width;
	_tmp10_ = pw;
	x = (_tmp9_ - _tmp10_) / 2;
	_tmp11_ = height;
	_tmp12_ = ph;
	y = (_tmp11_ - _tmp12_) / 2;
	_tmp13_ = context;
	_tmp14_ = x;
	_tmp15_ = y;
	_tmp16_ = pw;
	_tmp17_ = ph;
	cairo_rectangle (_tmp13_, (gdouble) _tmp14_, (gdouble) _tmp15_, (gdouble) _tmp16_, (gdouble) _tmp17_);
	_tmp18_ = context;
	cairo_clip (_tmp18_);
	_tmp19_ = context;
	_tmp20_ = pixbuf;
	_tmp21_ = x;
	_tmp22_ = y;
	gdk_cairo_set_source_pixbuf (_tmp19_, _tmp20_, (gdouble) _tmp21_, (gdouble) _tmp22_);
	_tmp23_ = context;
	cairo_set_operator (_tmp23_, CAIRO_OPERATOR_SOURCE);
	_tmp24_ = context;
	cairo_paint (_tmp24_);
	_tmp25_ = boxes_machine_is_running (self);
	if (!_tmp25_) {
		cairo_t* _tmp26_;
		cairo_t* _tmp27_;
		cairo_t* _tmp28_;
		cairo_t* _tmp29_;
		cairo_surface_t* _tmp30_;
		cairo_pattern_t* _tmp31_;
		cairo_pattern_t* grid;
		cairo_pattern_t* _tmp32_;
		cairo_t* _tmp33_;
		cairo_t* _tmp34_;
		cairo_t* _tmp35_;
		cairo_pattern_t* _tmp36_;
		_tmp26_ = context;
		cairo_set_source_rgba (_tmp26_, (gdouble) 1, (gdouble) 1, (gdouble) 1, (gdouble) 1);
		_tmp27_ = context;
		cairo_set_operator (_tmp27_, CAIRO_OPERATOR_HSL_SATURATION);
		_tmp28_ = context;
		cairo_paint (_tmp28_);
		_tmp29_ = context;
		cairo_scale (_tmp29_, 2.0, 2.0);
		_tmp30_ = boxes_machine_grid_surface;
		_tmp31_ = cairo_pattern_create_for_surface (_tmp30_);
		grid = _tmp31_;
		_tmp32_ = grid;
		cairo_pattern_set_extend (_tmp32_, CAIRO_EXTEND_REPEAT);
		_tmp33_ = context;
		cairo_set_source_rgba (_tmp33_, 0.2, 0.2, 0.2, (gdouble) 1);
		_tmp34_ = context;
		cairo_set_operator (_tmp34_, CAIRO_OPERATOR_ADD);
		_tmp35_ = context;
		_tmp36_ = grid;
		cairo_mask (_tmp35_, _tmp36_);
		_cairo_pattern_destroy0 (grid);
	}
	_tmp37_ = surface;
	_tmp38_ = width;
	_tmp39_ = height;
	_tmp40_ = gdk_pixbuf_get_from_surface (_tmp37_, 0, 0, _tmp38_, _tmp39_);
	result = _tmp40_;
	_cairo_destroy0 (context);
	_cairo_surface_destroy0 (surface);
	return result;
}


static GdkPixbuf* boxes_machine_draw_stopped_vm (gint width, gint height) {
	GdkPixbuf* result = NULL;
	gint _tmp0_;
	gint _tmp1_;
	cairo_surface_t* _tmp2_;
	cairo_surface_t* surface;
	gint _tmp3_;
	gint _tmp4_;
	GdkPixbuf* _tmp5_ = NULL;
	_tmp0_ = width;
	_tmp1_ = height;
	_tmp2_ = cairo_image_surface_create (CAIRO_FORMAT_RGB24, _tmp0_, _tmp1_);
	surface = _tmp2_;
	_tmp3_ = width;
	_tmp4_ = height;
	_tmp5_ = gdk_pixbuf_get_from_surface (surface, 0, 0, _tmp3_, _tmp4_);
	result = _tmp5_;
	_cairo_surface_destroy0 (surface);
	return result;
}


static GdkPixbuf* boxes_machine_draw_fallback_vm (gint width, gint height, gboolean force) {
	GdkPixbuf* result = NULL;
	GdkPixbuf* pixbuf;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gint _tmp2_;
	gboolean _tmp4_;
	gboolean _tmp6_;
	GdkPixbuf* _tmp43_;
	gint _tmp44_;
	gint _tmp45_;
	cairo_surface_t* _tmp46_;
	cairo_surface_t* surface;
	cairo_surface_t* _tmp47_;
	gint _tmp48_;
	gint _tmp49_;
	GdkPixbuf* _tmp50_ = NULL;
	GError * _inner_error_ = NULL;
	pixbuf = NULL;
	_tmp2_ = width;
	if (_tmp2_ == BOXES_MACHINE_SCREENSHOT_WIDTH) {
		gint _tmp3_;
		_tmp3_ = height;
		_tmp1_ = _tmp3_ == BOXES_MACHINE_SCREENSHOT_HEIGHT;
	} else {
		_tmp1_ = FALSE;
	}
	_tmp4_ = _tmp1_;
	if (_tmp4_) {
		gboolean _tmp5_;
		_tmp5_ = force;
		_tmp0_ = !_tmp5_;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp6_ = _tmp0_;
	if (_tmp6_) {
		GdkPixbuf* _tmp7_;
		_tmp7_ = boxes_machine_default_fallback;
		if (_tmp7_ != NULL) {
			GdkPixbuf* _tmp8_;
			GdkPixbuf* _tmp9_;
			_tmp8_ = boxes_machine_default_fallback;
			_tmp9_ = _g_object_ref0 (_tmp8_);
			result = _tmp9_;
			_g_object_unref0 (pixbuf);
			return result;
		} else {
			gint _tmp10_;
			gint _tmp11_;
			GdkPixbuf* _tmp12_ = NULL;
			_tmp10_ = width;
			_tmp11_ = height;
			_tmp12_ = boxes_machine_draw_fallback_vm (_tmp10_, _tmp11_, TRUE);
			_g_object_unref0 (boxes_machine_default_fallback);
			boxes_machine_default_fallback = _tmp12_;
		}
	}
	{
		gint _tmp13_;
		gint _tmp14_;
		cairo_surface_t* _tmp15_;
		cairo_surface_t* surface;
		cairo_surface_t* _tmp16_;
		cairo_t* _tmp17_;
		cairo_t* context;
		gint _tmp18_;
		gint size;
		GtkIconTheme* _tmp19_ = NULL;
		gint _tmp20_;
		GtkIconInfo* _tmp21_ = NULL;
		GtkIconInfo* icon_info;
		GtkIconInfo* _tmp22_;
		GdkPixbuf* _tmp23_ = NULL;
		GdkPixbuf* _tmp24_;
		cairo_t* _tmp25_;
		GdkPixbuf* _tmp26_;
		gint _tmp27_;
		gint _tmp28_;
		gint _tmp29_;
		gint _tmp30_;
		cairo_t* _tmp31_;
		gint _tmp32_;
		gint _tmp33_;
		gint _tmp34_;
		gint _tmp35_;
		gint _tmp36_;
		gint _tmp37_;
		cairo_t* _tmp38_;
		cairo_surface_t* _tmp39_;
		gint _tmp40_;
		gint _tmp41_;
		GdkPixbuf* _tmp42_ = NULL;
		_tmp13_ = width;
		_tmp14_ = height;
		_tmp15_ = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, _tmp13_, _tmp14_);
		surface = _tmp15_;
		_tmp16_ = surface;
		_tmp17_ = cairo_create (_tmp16_);
		context = _tmp17_;
		_tmp18_ = height;
		size = (gint) (_tmp18_ * 0.6);
		_tmp19_ = gtk_icon_theme_get_default ();
		_tmp20_ = size;
		_tmp21_ = gtk_icon_theme_lookup_icon (_tmp19_, "computer-symbolic", _tmp20_, GTK_ICON_LOOKUP_GENERIC_FALLBACK);
		icon_info = _tmp21_;
		_tmp22_ = icon_info;
		_tmp23_ = gtk_icon_info_load_icon (_tmp22_, &_inner_error_);
		_tmp24_ = _tmp23_;
		if (_inner_error_ != NULL) {
			_gtk_icon_info_free0 (icon_info);
			_cairo_destroy0 (context);
			_cairo_surface_destroy0 (surface);
			goto __catch36_g_error;
		}
		_tmp25_ = context;
		_tmp26_ = _tmp24_;
		_tmp27_ = width;
		_tmp28_ = size;
		_tmp29_ = height;
		_tmp30_ = size;
		gdk_cairo_set_source_pixbuf (_tmp25_, _tmp26_, (gdouble) ((_tmp27_ - _tmp28_) / 2), (gdouble) ((_tmp29_ - _tmp30_) / 2));
		_g_object_unref0 (_tmp26_);
		_tmp31_ = context;
		_tmp32_ = width;
		_tmp33_ = size;
		_tmp34_ = height;
		_tmp35_ = size;
		_tmp36_ = size;
		_tmp37_ = size;
		cairo_rectangle (_tmp31_, (gdouble) ((_tmp32_ - _tmp33_) / 2), (gdouble) ((_tmp34_ - _tmp35_) / 2), (gdouble) _tmp36_, (gdouble) _tmp37_);
		_tmp38_ = context;
		cairo_fill (_tmp38_);
		_tmp39_ = surface;
		_tmp40_ = width;
		_tmp41_ = height;
		_tmp42_ = gdk_pixbuf_get_from_surface (_tmp39_, 0, 0, _tmp40_, _tmp41_);
		_g_object_unref0 (pixbuf);
		pixbuf = _tmp42_;
		_gtk_icon_info_free0 (icon_info);
		_cairo_destroy0 (context);
		_cairo_surface_destroy0 (surface);
	}
	goto __finally36;
	__catch36_g_error:
	{
		g_clear_error (&_inner_error_);
		_inner_error_ = NULL;
	}
	__finally36:
	if (_inner_error_ != NULL) {
		_g_object_unref0 (pixbuf);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	_tmp43_ = pixbuf;
	if (_tmp43_ != NULL) {
		result = pixbuf;
		return result;
	}
	_tmp44_ = width;
	_tmp45_ = height;
	_tmp46_ = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, _tmp44_, _tmp45_);
	surface = _tmp46_;
	_tmp47_ = surface;
	_tmp48_ = width;
	_tmp49_ = height;
	_tmp50_ = gdk_pixbuf_get_from_surface (_tmp47_, 0, 0, _tmp48_, _tmp49_);
	result = _tmp50_;
	_cairo_surface_destroy0 (surface);
	_g_object_unref0 (pixbuf);
	return result;
}


static void boxes_machine_real_delete (BoxesMachine* self, gboolean by_user) {
	gulong _tmp0_;
	BoxesDisplayConfig* _tmp3_;
	GError * _inner_error_ = NULL;
	self->deleted = TRUE;
	boxes_machine_set_screenshot_enable (self, FALSE);
	_tmp0_ = self->priv->ui_state_id;
	if (_tmp0_ != ((gulong) 0)) {
		BoxesApp* _tmp1_;
		gulong _tmp2_;
		_tmp1_ = boxes_app_app;
		_tmp2_ = self->priv->ui_state_id;
		g_signal_handler_disconnect ((GObject*) _tmp1_, _tmp2_);
		self->priv->ui_state_id = (gulong) 0;
	}
	_tmp3_ = self->config;
	boxes_display_config_delete (_tmp3_);
	{
		gchar* _tmp4_ = NULL;
		gchar* _tmp5_;
		gchar* _tmp6_;
		_tmp4_ = boxes_machine_get_screenshot_filename (self, &_inner_error_);
		_tmp5_ = _tmp4_;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == BOXES_ERROR) {
				goto __catch37_boxes_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return;
		}
		_tmp6_ = _tmp5_;
		g_unlink (_tmp6_);
		_g_free0 (_tmp6_);
	}
	goto __finally37;
	__catch37_boxes_error:
	{
		GError* e = NULL;
		GError* _tmp7_;
		const gchar* _tmp8_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp7_ = e;
		_tmp8_ = _tmp7_->message;
		g_debug ("machine.vala:436: Could not delete screenshot: %s", _tmp8_);
		_g_error_free0 (e);
	}
	__finally37:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


void boxes_machine_delete (BoxesMachine* self, gboolean by_user) {
	g_return_if_fail (self != NULL);
	BOXES_MACHINE_GET_CLASS (self)->delete (self, by_user);
}


static void boxes_machine_real_ui_state_changed (BoxesUI* base) {
	BoxesMachine * self;
	BoxesMachineActor* _tmp0_;
	BoxesUIState _tmp1_;
	BoxesUIState _tmp2_;
	self = (BoxesMachine*) base;
	_tmp0_ = self->machine_actor;
	_tmp1_ = boxes_ui_get_ui_state ((BoxesUI*) self);
	_tmp2_ = _tmp1_;
	boxes_ui_set_ui_state ((BoxesUI*) _tmp0_, _tmp2_);
}


static ClutterActor* boxes_machine_real_get_actor (BoxesUI* base) {
	ClutterActor* result;
	BoxesMachine* self;
	BoxesMachineActor* _tmp0_;
	ClutterActor* _tmp1_;
	ClutterActor* _tmp2_;
	self = (BoxesMachine*) base;
	_tmp0_ = self->machine_actor;
	_tmp1_ = boxes_ui_get_actor ((BoxesUI*) _tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}


GdkPixbuf* boxes_machine_get_pixbuf (BoxesMachine* self) {
	GdkPixbuf* result;
	GdkPixbuf* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_pixbuf;
	result = _tmp0_;
	return result;
}


void boxes_machine_set_pixbuf (BoxesMachine* self, GdkPixbuf* value) {
	GdkPixbuf* _tmp0_;
	GdkPixbuf* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_pixbuf);
	self->priv->_pixbuf = _tmp1_;
	g_object_notify ((GObject *) self, "pixbuf");
}


const gchar* boxes_machine_get_info (BoxesMachine* self) {
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_info;
	result = _tmp0_;
	return result;
}


void boxes_machine_set_info (BoxesMachine* self, const gchar* value) {
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_info);
	self->priv->_info = _tmp1_;
	g_object_notify ((GObject *) self, "info");
}


const gchar* boxes_machine_get_status (BoxesMachine* self) {
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_status;
	result = _tmp0_;
	return result;
}


void boxes_machine_set_status (BoxesMachine* self, const gchar* value) {
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_status);
	self->priv->_status = _tmp1_;
	g_object_notify ((GObject *) self, "status");
}


BoxesMachineMachineState boxes_machine_get_state (BoxesMachine* self) {
	BoxesMachineMachineState result;
	BoxesMachineMachineState _tmp0_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->_state;
	result = _tmp0_;
	return result;
}


void boxes_machine_set_state (BoxesMachine* self, BoxesMachineMachineState value) {
	BoxesMachineMachineState _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	BoxesMachineMachineState _tmp3_;
	BoxesMachineMachineState _tmp4_;
	GEnumValue* _tmp5_;
	BoxesMachineMachineState _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_state = _tmp0_;
	_tmp1_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = boxes_machine_get_state (self);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_enum_get_value (g_type_class_ref (BOXES_MACHINE_TYPE_MACHINE_STATE), _tmp4_);
	g_debug ("machine.vala:45: State of '%s' changed to %s", _tmp2_, (_tmp5_ != NULL) ? _tmp5_->value_name : NULL);
	_tmp6_ = value;
	if (_tmp6_ == BOXES_MACHINE_MACHINE_STATE_STOPPED) {
		boxes_machine_set_screenshot (self, NULL, FALSE);
	} else {
		GdkPixbuf* _tmp7_;
		_tmp7_ = self->priv->orig_pixbuf;
		if (_tmp7_ != NULL) {
			GdkPixbuf* _tmp8_;
			GdkPixbuf* _tmp9_ = NULL;
			GdkPixbuf* _tmp10_;
			_tmp8_ = self->priv->orig_pixbuf;
			_tmp9_ = boxes_machine_draw_vm (self, _tmp8_, BOXES_MACHINE_SCREENSHOT_WIDTH, BOXES_MACHINE_SCREENSHOT_HEIGHT);
			_tmp10_ = _tmp9_;
			boxes_machine_set_pixbuf (self, _tmp10_);
			_g_object_unref0 (_tmp10_);
		}
	}
	g_object_notify ((GObject *) self, "state");
}


BoxesDisplay* boxes_machine_get_display (BoxesMachine* self) {
	BoxesDisplay* result;
	BoxesDisplay* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_display;
	result = _tmp0_;
	return result;
}


static gboolean ___lambda23_ (BoxesMachine* self) {
	gboolean result = FALSE;
	self->priv->show_timeout_id = (guint) 0;
	boxes_machine_show_display (self);
	result = FALSE;
	return result;
}


static gboolean ____lambda23__gsource_func (gpointer self) {
	gboolean result;
	result = ___lambda23_ (self);
	return result;
}


static void _boxes_machine_display___lambda22_ (BoxesMachine* self, gint id) {
	BoxesApp* _tmp0_;
	BoxesUIState _tmp1_;
	BoxesUIState _tmp2_;
	_tmp0_ = boxes_app_app;
	_tmp1_ = boxes_ui_get_ui_state ((BoxesUI*) _tmp0_);
	_tmp2_ = _tmp1_;
	switch (_tmp2_) {
		case BOXES_UI_STATE_CREDS:
		{
			BoxesApp* _tmp3_;
			BoxesApp* _tmp4_;
			guint _tmp5_;
			guint _tmp6_ = 0U;
			_tmp3_ = boxes_app_app;
			boxes_ui_set_ui_state ((BoxesUI*) _tmp3_, BOXES_UI_STATE_DISPLAY);
			_tmp4_ = boxes_app_app;
			_tmp5_ = _tmp4_->duration;
			_tmp6_ = g_timeout_add_full (G_PRIORITY_DEFAULT, _tmp5_, ____lambda23__gsource_func, g_object_ref (self), g_object_unref);
			self->priv->show_timeout_id = _tmp6_;
			break;
		}
		case BOXES_UI_STATE_DISPLAY:
		case BOXES_UI_STATE_PROPERTIES:
		{
			boxes_machine_show_display (self);
			break;
		}
		default:
		break;
	}
}


static void __boxes_machine_display___lambda22__boxes_display_show (BoxesDisplay* _sender, gint display_id, gpointer self) {
	_boxes_machine_display___lambda22_ (self, display_id);
}


static void _boxes_machine_display___lambda92_ (BoxesMachine* self, gint id) {
	BoxesApp* _tmp0_;
	BoxesDisplayPage* _tmp1_;
	GtkWidget* _tmp2_ = NULL;
	GtkWidget* _tmp3_;
	_tmp0_ = boxes_app_app;
	_tmp1_ = _tmp0_->display_page;
	_tmp2_ = boxes_display_page_remove_display (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (_tmp3_);
}


static void __boxes_machine_display___lambda92__boxes_display_hide (BoxesDisplay* _sender, gint display_id, gpointer self) {
	_boxes_machine_display___lambda92_ (self, display_id);
}


static const gchar* string_to_string (const gchar* self) {
	const gchar* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}


static void _boxes_machine_display___lambda93_ (BoxesMachine* self) {
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_;
	gboolean _tmp5_;
	_tmp0_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = string_to_string (_tmp1_);
	_tmp3_ = g_strconcat ("display ", _tmp2_, " disconnected", NULL);
	_tmp4_ = _tmp3_;
	g_message ("machine.vala:123: %s", _tmp4_);
	_g_free0 (_tmp4_);
	_tmp5_ = self->stay_on_display;
	if (!_tmp5_) {
		BoxesApp* _tmp6_;
		_tmp6_ = boxes_app_app;
		boxes_ui_set_ui_state ((BoxesUI*) _tmp6_, BOXES_UI_STATE_COLLECTION);
	}
}


static void __boxes_machine_display___lambda93__boxes_display_disconnected (BoxesDisplay* _sender, gpointer self) {
	_boxes_machine_display___lambda93_ (self);
}


static void _boxes_machine_display___lambda94_ (BoxesMachine* self) {
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_;
	BoxesMachineActor* _tmp5_;
	BoxesDisplay* _tmp6_;
	BoxesDisplay* _tmp7_;
	gboolean _tmp8_;
	gboolean _tmp9_;
	_tmp0_ = _ ("Enter password for %s");
	_tmp1_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup_printf (_tmp0_, _tmp2_);
	_tmp4_ = _tmp3_;
	boxes_machine_set_status (self, _tmp4_);
	_g_free0 (_tmp4_);
	_tmp5_ = self->machine_actor;
	_tmp6_ = boxes_machine_get_display (self);
	_tmp7_ = _tmp6_;
	_tmp8_ = boxes_display_get_need_password (_tmp7_);
	_tmp9_ = _tmp8_;
	boxes_machine_actor_set_password_needed (_tmp5_, _tmp9_);
}


static void __boxes_machine_display___lambda94__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	_boxes_machine_display___lambda94_ (self);
}


static void _boxes_machine_display___lambda95_ (BoxesMachine* self) {
	BoxesMachineActor* _tmp0_;
	BoxesDisplay* _tmp1_;
	BoxesDisplay* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	_tmp0_ = self->machine_actor;
	_tmp1_ = boxes_machine_get_display (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = boxes_display_get_need_username (_tmp2_);
	_tmp4_ = _tmp3_;
	boxes_machine_actor_set_username_needed (_tmp0_, _tmp4_);
}


static void __boxes_machine_display___lambda95__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	_boxes_machine_display___lambda95_ (self);
}


void boxes_machine_set_display (BoxesMachine* self, BoxesDisplay* value) {
	BoxesDisplay* _tmp0_;
	BoxesDisplay* _tmp13_;
	BoxesDisplay* _tmp14_;
	BoxesDisplay* _tmp15_;
	const gchar* _tmp16_ = NULL;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	gchar* _tmp19_ = NULL;
	gchar* _tmp20_;
	BoxesDisplay* _tmp21_;
	gulong _tmp22_ = 0UL;
	BoxesDisplay* _tmp23_;
	gulong _tmp24_ = 0UL;
	BoxesDisplay* _tmp25_;
	gulong _tmp26_ = 0UL;
	BoxesDisplay* _tmp27_;
	gulong _tmp28_ = 0UL;
	BoxesDisplay* _tmp29_;
	gulong _tmp30_ = 0UL;
	BoxesDisplay* _tmp31_;
	BoxesMachineActor* _tmp32_;
	gchar* _tmp33_ = NULL;
	gchar* _tmp34_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_display;
	if (_tmp0_ != NULL) {
		BoxesDisplay* _tmp1_;
		gulong _tmp2_;
		guint _tmp3_;
		BoxesDisplay* _tmp5_;
		gulong _tmp6_;
		BoxesDisplay* _tmp7_;
		gulong _tmp8_;
		BoxesDisplay* _tmp9_;
		gulong _tmp10_;
		BoxesDisplay* _tmp11_;
		gulong _tmp12_;
		_tmp1_ = self->priv->_display;
		_tmp2_ = self->priv->show_id;
		g_signal_handler_disconnect ((GObject*) _tmp1_, _tmp2_);
		self->priv->show_id = (gulong) 0;
		_tmp3_ = self->priv->show_timeout_id;
		if (_tmp3_ != ((guint) 0)) {
			guint _tmp4_;
			_tmp4_ = self->priv->show_timeout_id;
			g_source_remove (_tmp4_);
		}
		self->priv->show_timeout_id = (guint) 0;
		_tmp5_ = self->priv->_display;
		_tmp6_ = self->priv->hide_id;
		g_signal_handler_disconnect ((GObject*) _tmp5_, _tmp6_);
		self->priv->hide_id = (gulong) 0;
		_tmp7_ = self->priv->_display;
		_tmp8_ = self->priv->disconnected_id;
		g_signal_handler_disconnect ((GObject*) _tmp7_, _tmp8_);
		self->priv->disconnected_id = (gulong) 0;
		_tmp9_ = self->priv->_display;
		_tmp10_ = self->priv->need_password_id;
		g_signal_handler_disconnect ((GObject*) _tmp9_, _tmp10_);
		self->priv->need_password_id = (gulong) 0;
		_tmp11_ = self->priv->_display;
		_tmp12_ = self->priv->need_username_id;
		g_signal_handler_disconnect ((GObject*) _tmp11_, _tmp12_);
		self->priv->need_username_id = (gulong) 0;
	}
	_tmp13_ = value;
	_tmp14_ = _g_object_ref0 (_tmp13_);
	_g_object_unref0 (self->priv->_display);
	self->priv->_display = _tmp14_;
	_tmp15_ = self->priv->_display;
	if (_tmp15_ == NULL) {
		return;
	}
	_tmp16_ = _ ("Connecting to %s");
	_tmp17_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
	_tmp18_ = _tmp17_;
	_tmp19_ = g_strdup_printf (_tmp16_, _tmp18_);
	_tmp20_ = _tmp19_;
	boxes_machine_set_status (self, _tmp20_);
	_g_free0 (_tmp20_);
	_tmp21_ = self->priv->_display;
	_tmp22_ = g_signal_connect_object (_tmp21_, "show", (GCallback) __boxes_machine_display___lambda22__boxes_display_show, self, 0);
	self->priv->show_id = _tmp22_;
	_tmp23_ = self->priv->_display;
	_tmp24_ = g_signal_connect_object (_tmp23_, "hide", (GCallback) __boxes_machine_display___lambda92__boxes_display_hide, self, 0);
	self->priv->hide_id = _tmp24_;
	_tmp25_ = self->priv->_display;
	_tmp26_ = g_signal_connect_object (_tmp25_, "disconnected", (GCallback) __boxes_machine_display___lambda93__boxes_display_disconnected, self, 0);
	self->priv->disconnected_id = _tmp26_;
	_tmp27_ = self->priv->_display;
	_tmp28_ = g_signal_connect_object ((GObject*) _tmp27_, "notify::need-password", (GCallback) __boxes_machine_display___lambda94__g_object_notify, self, 0);
	self->priv->need_password_id = _tmp28_;
	_tmp29_ = self->priv->_display;
	_tmp30_ = g_signal_connect_object ((GObject*) _tmp29_, "notify::need-username", (GCallback) __boxes_machine_display___lambda95__g_object_notify, self, 0);
	self->priv->need_username_id = _tmp30_;
	_tmp31_ = self->priv->_display;
	_tmp32_ = self->machine_actor;
	_tmp33_ = boxes_machine_actor_get_password (_tmp32_);
	_tmp34_ = _tmp33_;
	boxes_display_set_password (_tmp31_, _tmp34_);
	_g_free0 (_tmp34_);
	g_object_notify ((GObject *) self, "display");
}


static void boxes_machine_class_init (BoxesMachineClass * klass) {
	cairo_surface_t* _tmp0_;
	cairo_surface_t* _tmp1_;
	cairo_t* _tmp2_;
	cairo_t* cr;
	cairo_t* _tmp3_;
	cairo_t* _tmp4_;
	cairo_t* _tmp5_;
	cairo_t* _tmp6_;
	cairo_t* _tmp7_;
	cairo_t* _tmp8_;
	cairo_t* _tmp9_;
	cairo_t* _tmp10_;
	boxes_machine_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (BoxesMachinePrivate));
	BOXES_MACHINE_CLASS (klass)->take_screenshot = boxes_machine_real_take_screenshot;
	BOXES_MACHINE_CLASS (klass)->take_screenshot_finish = boxes_machine_real_take_screenshot_finish;
	BOXES_MACHINE_CLASS (klass)->get_properties = boxes_machine_real_get_properties;
	BOXES_MACHINE_CLASS (klass)->disconnect_display = boxes_machine_real_disconnect_display;
	BOXES_MACHINE_CLASS (klass)->delete = boxes_machine_real_delete;
	BOXES_UI_CLASS (klass)->ui_state_changed = boxes_machine_real_ui_state_changed;
	BOXES_UI_CLASS (klass)->get_actor = boxes_machine_real_get_actor;
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_machine_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_boxes_machine_set_property;
	G_OBJECT_CLASS (klass)->finalize = boxes_machine_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_MACHINE_ACTOR, g_param_spec_object ("actor", "actor", "actor", clutter_actor_get_type (), G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_MACHINE_PIXBUF, g_param_spec_object ("pixbuf", "pixbuf", "pixbuf", GDK_TYPE_PIXBUF, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_MACHINE_INFO, g_param_spec_string ("info", "info", "info", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_MACHINE_STATUS, g_param_spec_string ("status", "status", "status", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_MACHINE_STATE, g_param_spec_enum ("state", "state", "state", BOXES_MACHINE_TYPE_MACHINE_STATE, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_MACHINE_DISPLAY, g_param_spec_object ("display", "display", "display", BOXES_TYPE_DISPLAY, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	_tmp0_ = cairo_image_surface_create (CAIRO_FORMAT_A8, 2, 2);
	_cairo_surface_destroy0 (boxes_machine_grid_surface);
	boxes_machine_grid_surface = _tmp0_;
	_tmp1_ = boxes_machine_grid_surface;
	_tmp2_ = cairo_create (_tmp1_);
	cr = _tmp2_;
	_tmp3_ = cr;
	cairo_set_source_rgba (_tmp3_, (gdouble) 0, (gdouble) 0, (gdouble) 0, (gdouble) 0);
	_tmp4_ = cr;
	cairo_paint (_tmp4_);
	_tmp5_ = cr;
	cairo_set_source_rgba (_tmp5_, (gdouble) 1, (gdouble) 1, (gdouble) 1, (gdouble) 1);
	_tmp6_ = cr;
	cairo_set_operator (_tmp6_, CAIRO_OPERATOR_SOURCE);
	_tmp7_ = cr;
	cairo_rectangle (_tmp7_, (gdouble) 0, (gdouble) 0, (gdouble) 1, (gdouble) 1);
	_tmp8_ = cr;
	cairo_fill (_tmp8_);
	_tmp9_ = cr;
	cairo_rectangle (_tmp9_, (gdouble) 1, (gdouble) 1, (gdouble) 1, (gdouble) 1);
	_tmp10_ = cr;
	cairo_fill (_tmp10_);
	_cairo_destroy0 (cr);
}


static void boxes_machine_boxes_iproperties_provider_interface_init (BoxesIPropertiesProviderIface * iface) {
	boxes_machine_boxes_iproperties_provider_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_properties = (GList* (*)(BoxesIPropertiesProvider*, BoxesPropertiesPage)) boxes_machine_get_properties;
}


static void boxes_machine_instance_init (BoxesMachine * self) {
	self->priv = BOXES_MACHINE_GET_PRIVATE (self);
}


static void boxes_machine_finalize (GObject* obj) {
	BoxesMachine * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_MACHINE, BoxesMachine);
	_g_object_unref0 (self->machine_actor);
	_g_object_unref0 (self->source);
	_g_object_unref0 (self->config);
	_g_object_unref0 (self->priv->_pixbuf);
	_g_free0 (self->priv->_info);
	_g_free0 (self->priv->_status);
	_g_object_unref0 (self->priv->orig_pixbuf);
	_g_object_unref0 (self->priv->_display);
	G_OBJECT_CLASS (boxes_machine_parent_class)->finalize (obj);
}


GType boxes_machine_get_type (void) {
	static volatile gsize boxes_machine_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_machine_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesMachineClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_machine_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesMachine), 0, (GInstanceInitFunc) boxes_machine_instance_init, NULL };
		static const GInterfaceInfo boxes_iproperties_provider_info = { (GInterfaceInitFunc) boxes_machine_boxes_iproperties_provider_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType boxes_machine_type_id;
		boxes_machine_type_id = g_type_register_static (BOXES_TYPE_COLLECTION_ITEM, "BoxesMachine", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
		g_type_add_interface_static (boxes_machine_type_id, BOXES_TYPE_IPROPERTIES_PROVIDER, &boxes_iproperties_provider_info);
		g_once_init_leave (&boxes_machine_type_id__volatile, boxes_machine_type_id);
	}
	return boxes_machine_type_id__volatile;
}


static void _vala_boxes_machine_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	BoxesMachine * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_MACHINE, BoxesMachine);
	switch (property_id) {
		case BOXES_MACHINE_ACTOR:
		g_value_set_object (value, boxes_ui_get_actor ((BoxesUI*) self));
		break;
		case BOXES_MACHINE_PIXBUF:
		g_value_set_object (value, boxes_machine_get_pixbuf (self));
		break;
		case BOXES_MACHINE_INFO:
		g_value_set_string (value, boxes_machine_get_info (self));
		break;
		case BOXES_MACHINE_STATUS:
		g_value_set_string (value, boxes_machine_get_status (self));
		break;
		case BOXES_MACHINE_STATE:
		g_value_set_enum (value, boxes_machine_get_state (self));
		break;
		case BOXES_MACHINE_DISPLAY:
		g_value_set_object (value, boxes_machine_get_display (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_boxes_machine_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	BoxesMachine * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_MACHINE, BoxesMachine);
	switch (property_id) {
		case BOXES_MACHINE_PIXBUF:
		boxes_machine_set_pixbuf (self, g_value_get_object (value));
		break;
		case BOXES_MACHINE_INFO:
		boxes_machine_set_info (self, g_value_get_string (value));
		break;
		case BOXES_MACHINE_STATUS:
		boxes_machine_set_status (self, g_value_get_string (value));
		break;
		case BOXES_MACHINE_STATE:
		boxes_machine_set_state (self, g_value_get_enum (value));
		break;
		case BOXES_MACHINE_DISPLAY:
		boxes_machine_set_display (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static Block25Data* block25_data_ref (Block25Data* _data25_) {
	g_atomic_int_inc (&_data25_->_ref_count_);
	return _data25_;
}


static void block25_data_unref (void * _userdata_) {
	Block25Data* _data25_;
	_data25_ = (Block25Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data25_->_ref_count_)) {
		BoxesMachineActor * self;
		self = _data25_->self;
		_g_object_unref0 (_data25_->machine);
		_g_object_unref0 (self);
		g_slice_free (Block25Data, _data25_);
	}
}


static gboolean __lambda96_ (Block25Data* _data25_, GdkEventKey* event) {
	BoxesMachineActor * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GdkEventKey _tmp2_;
	guint _tmp3_;
	gboolean _tmp6_;
	gboolean _tmp9_;
	self = _data25_->self;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp2_ = *event;
	_tmp3_ = _tmp2_.keyval;
	if (_tmp3_ == ((guint) GDK_KEY_KP_Enter)) {
		_tmp1_ = TRUE;
	} else {
		GdkEventKey _tmp4_;
		guint _tmp5_;
		_tmp4_ = *event;
		_tmp5_ = _tmp4_.keyval;
		_tmp1_ = _tmp5_ == ((guint) GDK_KEY_ISO_Enter);
	}
	_tmp6_ = _tmp1_;
	if (_tmp6_) {
		_tmp0_ = TRUE;
	} else {
		GdkEventKey _tmp7_;
		guint _tmp8_;
		_tmp7_ = *event;
		_tmp8_ = _tmp7_.keyval;
		_tmp0_ = _tmp8_ == ((guint) GDK_KEY_Return);
	}
	_tmp9_ = _tmp0_;
	if (_tmp9_) {
		BoxesMachine* _tmp10_;
		_tmp10_ = _data25_->machine;
		boxes_machine_connect_display (_tmp10_, NULL, NULL);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}


static gboolean ___lambda96__gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self) {
	gboolean result;
	result = __lambda96_ (self, event);
	return result;
}


BoxesMachineActor* boxes_machine_actor_construct (GType object_type, BoxesMachine* machine) {
	BoxesMachineActor * self = NULL;
	Block25Data* _data25_;
	BoxesMachine* _tmp0_;
	BoxesMachine* _tmp1_;
	BoxesMachine* _tmp2_;
	BoxesMachine* _tmp3_;
	ClutterBoxLayout* _tmp4_;
	ClutterBoxLayout* layout;
	ClutterActor* _tmp5_;
	ClutterActor* _tmp6_;
	GtkClutterTexture* _tmp7_;
	GtkClutterTexture* _tmp8_;
	BoxesMachine* _tmp9_;
	GdkPixbuf* _tmp10_;
	GdkPixbuf* _tmp11_;
	ClutterActor* _tmp12_;
	ClutterActor* _tmp13_;
	GtkClutterTexture* _tmp14_;
	ClutterActor* _tmp15_;
	GtkClutterTexture* _tmp16_;
	GtkVBox* _tmp17_;
	GtkVBox* _tmp18_;
	GtkClutterActor* _tmp19_;
	GtkClutterActor* _tmp20_;
	GtkClutterActor* _tmp21_;
	GtkWidget* _tmp22_ = NULL;
	GtkStyleContext* _tmp23_ = NULL;
	BoxesMachine* _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	GtkLabel* _tmp27_;
	GtkLabel* _tmp28_;
	GdkColor _tmp29_ = {0};
	BoxesMachine* _tmp30_;
	GtkLabel* _tmp31_;
	GtkVBox* _tmp32_;
	GtkLabel* _tmp33_;
	GtkVBox* _tmp34_;
	GtkEntry* _tmp35_;
	GtkEntry* _tmp36_;
	GtkEntry* _tmp37_;
	const gchar* _tmp38_ = NULL;
	GtkEntry* _tmp39_;
	GtkVBox* _tmp40_;
	GtkEntry* _tmp41_;
	GtkVBox* _tmp42_;
	GtkEntry* _tmp43_;
	ClutterActor* _tmp44_;
	GtkClutterActor* _tmp45_;
	ClutterActor* _tmp46_;
	g_return_val_if_fail (machine != NULL, NULL);
	_data25_ = g_slice_new0 (Block25Data);
	_data25_->_ref_count_ = 1;
	_tmp0_ = machine;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data25_->machine);
	_data25_->machine = _tmp1_;
	self = (BoxesMachineActor*) boxes_ui_construct (object_type);
	_data25_->self = g_object_ref (self);
	_tmp2_ = _data25_->machine;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_g_object_unref0 (self->priv->machine);
	self->priv->machine = _tmp3_;
	_tmp4_ = (ClutterBoxLayout*) clutter_box_layout_new ();
	g_object_ref_sink (_tmp4_);
	layout = _tmp4_;
	clutter_box_layout_set_vertical (layout, TRUE);
	clutter_box_layout_set_spacing (layout, (guint) 10);
	_tmp5_ = clutter_actor_new ();
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->_actor);
	self->_actor = _tmp5_;
	_tmp6_ = self->_actor;
	clutter_actor_set_layout_manager (_tmp6_, (ClutterLayoutManager*) layout);
	_tmp7_ = (GtkClutterTexture*) gtk_clutter_texture_new ();
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->screenshot);
	self->priv->screenshot = _tmp7_;
	_tmp8_ = self->priv->screenshot;
	clutter_actor_set_name ((ClutterActor*) _tmp8_, "screenshot");
	_tmp9_ = _data25_->machine;
	_tmp10_ = boxes_machine_get_pixbuf (_tmp9_);
	_tmp11_ = _tmp10_;
	boxes_machine_actor_set_screenshot (self, _tmp11_);
	_tmp12_ = self->_actor;
	_tmp13_ = self->_actor;
	g_object_set (_tmp13_, "natural-width", (gfloat) BOXES_MACHINE_SCREENSHOT_WIDTH, NULL);
	g_object_set (_tmp12_, "min-width", (gfloat) BOXES_MACHINE_SCREENSHOT_WIDTH, NULL);
	_tmp14_ = self->priv->screenshot;
	clutter_texture_set_keep_aspect_ratio ((ClutterTexture*) _tmp14_, TRUE);
	_tmp15_ = self->_actor;
	_tmp16_ = self->priv->screenshot;
	clutter_container_add ((ClutterContainer*) _tmp15_, (ClutterActor*) _tmp16_, NULL);
	_tmp17_ = (GtkVBox*) gtk_vbox_new (FALSE, 0);
	g_object_ref_sink (_tmp17_);
	_g_object_unref0 (self->priv->vbox);
	self->priv->vbox = _tmp17_;
	_tmp18_ = self->priv->vbox;
	_tmp19_ = (GtkClutterActor*) gtk_clutter_actor_new_with_contents ((GtkWidget*) _tmp18_);
	g_object_ref_sink (_tmp19_);
	_g_object_unref0 (self->priv->gtk_vbox);
	self->priv->gtk_vbox = _tmp19_;
	_tmp20_ = self->priv->gtk_vbox;
	clutter_actor_set_height ((ClutterActor*) _tmp20_, (gfloat) 80);
	_tmp21_ = self->priv->gtk_vbox;
	_tmp22_ = gtk_clutter_actor_get_widget (_tmp21_);
	_tmp23_ = gtk_widget_get_style_context (_tmp22_);
	gtk_style_context_add_class (_tmp23_, "boxes-bg");
	_tmp24_ = _data25_->machine;
	_tmp25_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _tmp24_);
	_tmp26_ = _tmp25_;
	_tmp27_ = (GtkLabel*) gtk_label_new (_tmp26_);
	g_object_ref_sink (_tmp27_);
	_g_object_unref0 (self->priv->label);
	self->priv->label = _tmp27_;
	_tmp28_ = self->priv->label;
	boxes_get_color ("white", &_tmp29_);
	gtk_widget_modify_fg ((GtkWidget*) _tmp28_, GTK_STATE_NORMAL, &_tmp29_);
	_tmp30_ = _data25_->machine;
	_tmp31_ = self->priv->label;
	g_object_bind_property_with_closures ((GObject*) _tmp30_, "name", (GObject*) _tmp31_, "label", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, NULL)));
	_tmp32_ = self->priv->vbox;
	_tmp33_ = self->priv->label;
	gtk_container_add ((GtkContainer*) _tmp32_, (GtkWidget*) _tmp33_);
	_tmp34_ = self->priv->vbox;
	gtk_widget_set_valign ((GtkWidget*) _tmp34_, GTK_ALIGN_START);
	_tmp35_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp35_);
	_g_object_unref0 (self->priv->password_entry);
	self->priv->password_entry = _tmp35_;
	_tmp36_ = self->priv->password_entry;
	gtk_entry_set_visibility (_tmp36_, FALSE);
	_tmp37_ = self->priv->password_entry;
	_tmp38_ = _ ("Password");
	gtk_entry_set_placeholder_text (_tmp37_, _tmp38_);
	boxes_machine_actor_set_password_needed (self, FALSE);
	_tmp39_ = self->priv->password_entry;
	g_signal_connect_data ((GtkWidget*) _tmp39_, "key-press-event", (GCallback) ___lambda96__gtk_widget_key_press_event, block25_data_ref (_data25_), (GClosureNotify) block25_data_unref, 0);
	_tmp40_ = self->priv->vbox;
	_tmp41_ = self->priv->password_entry;
	gtk_container_add ((GtkContainer*) _tmp40_, (GtkWidget*) _tmp41_);
	_tmp42_ = self->priv->vbox;
	gtk_widget_show_all ((GtkWidget*) _tmp42_);
	_tmp43_ = self->priv->password_entry;
	gtk_widget_hide ((GtkWidget*) _tmp43_);
	_tmp44_ = self->_actor;
	_tmp45_ = self->priv->gtk_vbox;
	clutter_container_add ((ClutterContainer*) _tmp44_, (ClutterActor*) _tmp45_, NULL);
	_tmp46_ = self->_actor;
	clutter_actor_set_reactive (_tmp46_, TRUE);
	_g_object_unref0 (layout);
	block25_data_unref (_data25_);
	_data25_ = NULL;
	return self;
}


BoxesMachineActor* boxes_machine_actor_new (BoxesMachine* machine) {
	return boxes_machine_actor_construct (BOXES_TYPE_MACHINE_ACTOR, machine);
}


void boxes_machine_actor_set_screenshot (BoxesMachineActor* self, GdkPixbuf* pixbuf) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (pixbuf != NULL);
	{
		GtkClutterTexture* _tmp0_;
		GdkPixbuf* _tmp1_;
		_tmp0_ = self->priv->screenshot;
		_tmp1_ = pixbuf;
		gtk_clutter_texture_set_from_pixbuf (_tmp0_, _tmp1_, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch38_g_error;
		}
	}
	goto __finally38;
	__catch38_g_error:
	{
		GError* err = NULL;
		GError* _tmp2_;
		const gchar* _tmp3_;
		err = _inner_error_;
		_inner_error_ = NULL;
		_tmp2_ = err;
		_tmp3_ = _tmp2_->message;
		g_warning ("machine.vala:521: %s", _tmp3_);
		_g_error_free0 (err);
	}
	__finally38:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


void boxes_machine_actor_set_password_needed (BoxesMachineActor* self, gboolean needed) {
	ClutterActor* _tmp0_;
	GtkEntry* _tmp1_;
	gboolean _tmp2_;
	GtkEntry* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->_actor;
	clutter_actor_queue_relayout (_tmp0_);
	_tmp1_ = self->priv->password_entry;
	_tmp2_ = needed;
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, _tmp2_);
	_tmp3_ = self->priv->password_entry;
	_tmp4_ = needed;
	gtk_widget_set_can_focus ((GtkWidget*) _tmp3_, _tmp4_);
	_tmp5_ = needed;
	if (_tmp5_) {
		GtkEntry* _tmp6_;
		BoxesMachine* _tmp7_;
		_tmp6_ = self->priv->password_entry;
		gtk_widget_grab_focus ((GtkWidget*) _tmp6_);
		_tmp7_ = self->priv->machine;
		boxes_machine_set_display (_tmp7_, NULL);
	}
}


void boxes_machine_actor_set_username_needed (BoxesMachineActor* self, gboolean needed) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	g_debug ("machine.vala:536: FIXME: Do something about fetching username when req" \
"uired?");
	_tmp0_ = needed;
	if (_tmp0_) {
		BoxesMachine* _tmp1_;
		_tmp1_ = self->priv->machine;
		boxes_machine_set_display (_tmp1_, NULL);
	}
}


gchar* boxes_machine_actor_get_password (BoxesMachineActor* self) {
	gchar* result = NULL;
	GtkEntry* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->password_entry;
	_tmp1_ = gtk_entry_get_text (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup (_tmp2_);
	result = _tmp3_;
	return result;
}


static Block26Data* block26_data_ref (Block26Data* _data26_) {
	g_atomic_int_inc (&_data26_->_ref_count_);
	return _data26_;
}


static void block26_data_unref (void * _userdata_) {
	Block26Data* _data26_;
	_data26_ = (Block26Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data26_->_ref_count_)) {
		BoxesMachineActor * self;
		self = _data26_->self;
		(_data26_->update_screenshot_alloc_target_destroy_notify == NULL) ? NULL : (_data26_->update_screenshot_alloc_target_destroy_notify (_data26_->update_screenshot_alloc_target), NULL);
		_data26_->update_screenshot_alloc = NULL;
		_data26_->update_screenshot_alloc_target = NULL;
		_data26_->update_screenshot_alloc_target_destroy_notify = NULL;
		_g_object_unref0 (self);
		g_slice_free (Block26Data, _data26_);
	}
}


static void ___lambda35_ (BoxesMachineActor* self, ClutterActor* display) {
	GtkAllocation alloc = {0};
	BoxesApp* _tmp0_;
	BoxesProperties* _tmp1_;
	GtkWidget* _tmp2_;
	GtkAllocation _tmp3_ = {0};
	BoxesApp* _tmp4_;
	BoxesTopbar* _tmp5_;
	ClutterActor* _tmp6_;
	ClutterActor* _tmp7_;
	ClutterActor* _tmp8_;
	guint _tmp9_ = 0U;
	guint d;
	ClutterActor* _tmp10_;
	ClutterActor* _tmp11_;
	GtkAllocation _tmp12_;
	gint _tmp13_;
	ClutterActor* _tmp14_;
	GtkAllocation _tmp15_;
	gint _tmp16_;
	ClutterActor* _tmp17_;
	ClutterActor* _tmp18_;
	GtkAllocation _tmp19_;
	gint _tmp20_;
	ClutterActor* _tmp21_;
	ClutterActor* _tmp22_;
	GtkAllocation _tmp23_;
	gint _tmp24_;
	ClutterActor* _tmp25_;
	g_return_if_fail (display != NULL);
	_tmp0_ = boxes_app_app;
	_tmp1_ = _tmp0_->properties;
	_tmp2_ = _tmp1_->screenshot_placeholder;
	gtk_widget_get_allocation (_tmp2_, &_tmp3_);
	alloc = _tmp3_;
	_tmp4_ = boxes_app_app;
	_tmp5_ = _tmp4_->topbar;
	_tmp6_ = boxes_ui_get_actor ((BoxesUI*) _tmp5_);
	_tmp7_ = _tmp6_;
	clutter_actor_show (_tmp7_);
	_tmp8_ = display;
	_tmp9_ = clutter_actor_get_easing_duration (_tmp8_);
	d = _tmp9_;
	_tmp10_ = display;
	clutter_actor_set_easing_duration (_tmp10_, (guint) 0);
	_tmp11_ = display;
	_tmp12_ = alloc;
	_tmp13_ = _tmp12_.x;
	g_object_set (_tmp11_, "fixed-x", (gfloat) _tmp13_, NULL);
	_tmp14_ = display;
	_tmp15_ = alloc;
	_tmp16_ = _tmp15_.y;
	g_object_set (_tmp14_, "fixed-y", (gfloat) _tmp16_, NULL);
	_tmp17_ = display;
	_tmp18_ = display;
	_tmp19_ = alloc;
	_tmp20_ = _tmp19_.width;
	g_object_set (_tmp18_, "natural-width", (gfloat) _tmp20_, NULL);
	g_object_set (_tmp17_, "min-width", (gfloat) _tmp20_, NULL);
	_tmp21_ = display;
	_tmp22_ = display;
	_tmp23_ = alloc;
	_tmp24_ = _tmp23_.height;
	g_object_set (_tmp22_, "natural-height", (gfloat) _tmp24_, NULL);
	g_object_set (_tmp21_, "min-height", (gfloat) _tmp24_, NULL);
	_tmp25_ = display;
	clutter_actor_set_easing_duration (_tmp25_, d);
}


static void ____lambda35__boxes_actor_func (ClutterActor* actor, gpointer self) {
	___lambda35_ (self, actor);
}


static gboolean __lambda91_ (Block26Data* _data26_) {
	BoxesMachineActor * self;
	gboolean result = FALSE;
	BoxesActorFunc _tmp0_;
	void* _tmp0__target;
	GtkClutterActor* _tmp1_;
	self = _data26_->self;
	_tmp0_ = _data26_->update_screenshot_alloc;
	_tmp0__target = _data26_->update_screenshot_alloc_target;
	_tmp1_ = self->priv->display;
	_tmp0_ ((ClutterActor*) _tmp1_, _tmp0__target);
	result = FALSE;
	return result;
}


static gboolean ___lambda91__gsource_func (gpointer self) {
	gboolean result;
	result = __lambda91_ (self);
	return result;
}


static void ___lambda90_ (Block26Data* _data26_) {
	BoxesMachineActor * self;
	self = _data26_->self;
	g_idle_add_full (G_PRIORITY_HIGH, ___lambda91__gsource_func, block26_data_ref (_data26_), block26_data_unref);
}


static void ____lambda90__gtk_widget_size_allocate (GtkWidget* _sender, GtkAllocation* allocation, gpointer self) {
	___lambda90_ (self);
}


void boxes_machine_actor_update_display (BoxesMachineActor* self, GtkWidget* widget, gboolean zoom) {
	GtkClutterActor* _tmp0_;
	BoxesUIState _tmp3_;
	BoxesUIState _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	_tmp0_ = self->priv->display;
	if (_tmp0_ != NULL) {
		GtkClutterActor* _tmp1_;
		GtkClutterActor* _tmp2_;
		_tmp1_ = self->priv->display;
		boxes_actor_remove ((ClutterActor*) _tmp1_);
		_tmp2_ = self->priv->display;
		g_object_set (_tmp2_, "contents", NULL, NULL);
	}
	_tmp3_ = boxes_ui_get_ui_state ((BoxesUI*) self);
	_tmp4_ = _tmp3_;
	if (_tmp4_ == BOXES_UI_STATE_PROPERTIES) {
		Block26Data* _data26_;
		GtkWidget* _tmp5_;
		GtkClutterActor* _tmp6_;
		GtkClutterActor* _tmp7_;
		GtkClutterActor* _tmp8_;
		GtkClutterActor* _tmp9_;
		BoxesApp* _tmp10_;
		ClutterActor* _tmp11_;
		GtkClutterActor* _tmp12_;
		BoxesMachine* _tmp13_;
		BoxesDisplay* _tmp14_;
		BoxesDisplay* _tmp15_;
		GtkWidget* _tmp16_;
		gulong _tmp17_;
		BoxesApp* _tmp22_;
		BoxesProperties* _tmp23_;
		GtkWidget* _tmp24_;
		gulong _tmp25_ = 0UL;
		gboolean _tmp26_;
		_data26_ = g_slice_new0 (Block26Data);
		_data26_->_ref_count_ = 1;
		_data26_->self = g_object_ref (self);
		_tmp5_ = widget;
		_tmp6_ = (GtkClutterActor*) gtk_clutter_actor_new_with_contents (_tmp5_);
		g_object_ref_sink (_tmp6_);
		_g_object_unref0 (self->priv->display);
		self->priv->display = _tmp6_;
		_tmp7_ = self->priv->display;
		clutter_actor_set_name ((ClutterActor*) _tmp7_, "properties-thumbnail");
		_tmp8_ = self->priv->display;
		clutter_actor_set_x_align ((ClutterActor*) _tmp8_, CLUTTER_ACTOR_ALIGN_FILL);
		_tmp9_ = self->priv->display;
		clutter_actor_set_y_align ((ClutterActor*) _tmp9_, CLUTTER_ACTOR_ALIGN_FILL);
		_tmp10_ = boxes_app_app;
		_tmp11_ = _tmp10_->overlay_bin_actor;
		_tmp12_ = self->priv->display;
		clutter_actor_add_child (_tmp11_, (ClutterActor*) _tmp12_);
		_tmp13_ = self->priv->machine;
		_tmp14_ = boxes_machine_get_display (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = widget;
		boxes_display_set_enable_inputs (_tmp15_, _tmp16_, FALSE);
		_data26_->update_screenshot_alloc = ____lambda35__boxes_actor_func;
		_data26_->update_screenshot_alloc_target = g_object_ref (self);
		_data26_->update_screenshot_alloc_target_destroy_notify = g_object_unref;
		_tmp17_ = self->priv->track_screenshot_id;
		if (_tmp17_ != ((gulong) 0)) {
			BoxesApp* _tmp18_;
			BoxesProperties* _tmp19_;
			GtkWidget* _tmp20_;
			gulong _tmp21_;
			_tmp18_ = boxes_app_app;
			_tmp19_ = _tmp18_->properties;
			_tmp20_ = _tmp19_->screenshot_placeholder;
			_tmp21_ = self->priv->track_screenshot_id;
			g_signal_handler_disconnect ((GObject*) _tmp20_, _tmp21_);
		}
		_tmp22_ = boxes_app_app;
		_tmp23_ = _tmp22_->properties;
		_tmp24_ = _tmp23_->screenshot_placeholder;
		_tmp25_ = g_signal_connect_data (_tmp24_, "size-allocate", (GCallback) ____lambda90__gtk_widget_size_allocate, block26_data_ref (_data26_), (GClosureNotify) block26_data_unref, 0);
		self->priv->track_screenshot_id = _tmp25_;
		_tmp26_ = zoom;
		if (!_tmp26_) {
			GtkClutterActor* _tmp27_;
			BoxesActorFunc _tmp28_;
			void* _tmp28__target;
			GtkClutterActor* _tmp29_;
			_tmp27_ = self->priv->display;
			clutter_actor_set_easing_duration ((ClutterActor*) _tmp27_, (guint) 0);
			_tmp28_ = _data26_->update_screenshot_alloc;
			_tmp28__target = _data26_->update_screenshot_alloc_target;
			_tmp29_ = self->priv->display;
			_tmp28_ ((ClutterActor*) _tmp29_, _tmp28__target);
		}
		block26_data_unref (_data26_);
		_data26_ = NULL;
	}
}


static void _____lambda97_ (BoxesMachineActor* self) {
	GtkClutterActor* _tmp0_;
	GtkWidget* _tmp1_ = NULL;
	GtkWidget* _tmp2_;
	GtkWidget* widget;
	GtkClutterActor* _tmp3_;
	GtkClutterActor* _tmp4_;
	BoxesMachine* _tmp5_;
	BoxesDisplay* _tmp6_;
	BoxesDisplay* _tmp7_;
	BoxesApp* _tmp8_;
	BoxesDisplayPage* _tmp9_;
	BoxesMachine* _tmp10_;
	BoxesDisplay* _tmp11_;
	BoxesDisplay* _tmp12_;
	_tmp0_ = self->priv->display;
	g_object_get (_tmp0_, "contents", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	widget = _tmp2_;
	_tmp3_ = self->priv->display;
	g_object_set (_tmp3_, "contents", NULL, NULL);
	_tmp4_ = self->priv->display;
	clutter_actor_destroy ((ClutterActor*) _tmp4_);
	_g_object_unref0 (self->priv->display);
	self->priv->display = NULL;
	_tmp5_ = self->priv->machine;
	_tmp6_ = boxes_machine_get_display (_tmp5_);
	_tmp7_ = _tmp6_;
	boxes_display_set_enable_inputs (_tmp7_, widget, TRUE);
	_tmp8_ = boxes_app_app;
	_tmp9_ = _tmp8_->display_page;
	_tmp10_ = self->priv->machine;
	_tmp11_ = boxes_machine_get_display (_tmp10_);
	_tmp12_ = _tmp11_;
	boxes_display_page_show_display (_tmp9_, _tmp12_, widget);
	_g_object_unref0 (widget);
}


static void ______lambda97__clutter_actor_transitions_completed (ClutterActor* _sender, gpointer self) {
	_____lambda97_ (self);
}


static Block27Data* block27_data_ref (Block27Data* _data27_) {
	g_atomic_int_inc (&_data27_->_ref_count_);
	return _data27_;
}


static void block27_data_unref (void * _userdata_) {
	Block27Data* _data27_;
	_data27_ = (Block27Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data27_->_ref_count_)) {
		BoxesMachineActor * self;
		self = _data27_->self;
		_g_object_unref0 (self);
		g_slice_free (Block27Data, _data27_);
	}
}


static void ___lambda98_ (Block27Data* _data27_) {
	BoxesMachineActor * self;
	GtkClutterActor* _tmp0_;
	gulong _tmp1_;
	GtkClutterActor* _tmp2_;
	self = _data27_->self;
	_tmp0_ = self->priv->display;
	_tmp1_ = _data27_->completed_id;
	g_signal_handler_disconnect ((GObject*) _tmp0_, _tmp1_);
	_tmp2_ = self->priv->display;
	clutter_actor_set_easing_duration ((ClutterActor*) _tmp2_, (guint) 0);
}


static void ____lambda98__clutter_actor_transitions_completed (ClutterActor* _sender, gpointer self) {
	___lambda98_ (self);
}


static void boxes_machine_actor_real_ui_state_changed (BoxesUI* base) {
	BoxesMachineActor * self;
	gint window_width = 0;
	gint window_height = 0;
	gint width = 0;
	gint height = 0;
	gint x = 0;
	gint y = 0;
	BoxesApp* _tmp0_;
	BoxesDisplayPage* _tmp1_;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	BoxesApp* _tmp4_;
	GtkApplicationWindow* _tmp5_;
	gint _tmp6_ = 0;
	gint _tmp7_ = 0;
	gint _tmp8_;
	gint _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	BoxesUIState _tmp12_;
	BoxesUIState _tmp13_;
	self = (BoxesMachineActor*) base;
	_tmp0_ = boxes_app_app;
	_tmp1_ = _tmp0_->display_page;
	boxes_display_page_get_size (_tmp1_, &_tmp2_, &_tmp3_);
	width = _tmp2_;
	height = _tmp3_;
	_tmp4_ = boxes_app_app;
	_tmp5_ = _tmp4_->window;
	gtk_window_get_size ((GtkWindow*) _tmp5_, &_tmp6_, &_tmp7_);
	window_width = _tmp6_;
	window_height = _tmp7_;
	_tmp8_ = window_width;
	_tmp9_ = width;
	x = _tmp8_ - _tmp9_;
	_tmp10_ = window_height;
	_tmp11_ = height;
	y = _tmp10_ - _tmp11_;
	_tmp12_ = boxes_ui_get_ui_state ((BoxesUI*) self);
	_tmp13_ = _tmp12_;
	switch (_tmp13_) {
		case BOXES_UI_STATE_CREDS:
		{
			GtkClutterActor* _tmp14_;
			_tmp14_ = self->priv->gtk_vbox;
			clutter_actor_show ((ClutterActor*) _tmp14_);
			break;
		}
		case BOXES_UI_STATE_DISPLAY:
		{
			GtkClutterActor* _tmp15_;
			BoxesUIState _tmp16_;
			_tmp15_ = self->priv->gtk_vbox;
			clutter_actor_hide ((ClutterActor*) _tmp15_);
			_tmp16_ = ((BoxesUI*) self)->previous_ui_state;
			if (_tmp16_ == BOXES_UI_STATE_CREDS) {
				ClutterActor* _tmp17_;
				ClutterActor* _tmp18_;
				ClutterActor* _tmp19_;
				ClutterActor* _tmp20_;
				ClutterActor* _tmp21_;
				ClutterActor* _tmp22_;
				ClutterActor* _tmp23_;
				ClutterActor* _tmp24_;
				_tmp17_ = boxes_ui_get_actor ((BoxesUI*) self);
				_tmp18_ = _tmp17_;
				clutter_actor_set_x_align (_tmp18_, CLUTTER_ACTOR_ALIGN_FILL);
				_tmp19_ = boxes_ui_get_actor ((BoxesUI*) self);
				_tmp20_ = _tmp19_;
				clutter_actor_set_y_align (_tmp20_, CLUTTER_ACTOR_ALIGN_FILL);
				_tmp21_ = boxes_ui_get_actor ((BoxesUI*) self);
				_tmp22_ = _tmp21_;
				g_object_set (_tmp22_, "natural-width-set", FALSE, NULL);
				_tmp23_ = boxes_ui_get_actor ((BoxesUI*) self);
				_tmp24_ = _tmp23_;
				g_object_set (_tmp24_, "natural-height-set", FALSE, NULL);
			} else {
				GtkClutterActor* _tmp25_;
				_tmp25_ = self->priv->display;
				if (_tmp25_ != NULL) {
					BoxesApp* _tmp26_;
					BoxesProperties* _tmp27_;
					GtkWidget* _tmp28_;
					gulong _tmp29_;
					GtkClutterActor* _tmp30_;
					BoxesApp* _tmp31_;
					guint _tmp32_;
					GtkClutterActor* _tmp33_;
					GtkClutterActor* _tmp34_;
					GtkClutterActor* _tmp35_;
					GtkClutterActor* _tmp36_;
					GtkClutterActor* _tmp37_;
					GtkClutterActor* _tmp38_;
					GtkClutterActor* _tmp39_;
					GtkClutterActor* _tmp40_;
					_tmp26_ = boxes_app_app;
					_tmp27_ = _tmp26_->properties;
					_tmp28_ = _tmp27_->screenshot_placeholder;
					_tmp29_ = self->priv->track_screenshot_id;
					g_signal_handler_disconnect ((GObject*) _tmp28_, _tmp29_);
					self->priv->track_screenshot_id = (gulong) 0;
					_tmp30_ = self->priv->display;
					_tmp31_ = boxes_app_app;
					_tmp32_ = _tmp31_->duration;
					clutter_actor_set_easing_duration ((ClutterActor*) _tmp30_, _tmp32_);
					_tmp33_ = self->priv->display;
					clutter_actor_set_x_align ((ClutterActor*) _tmp33_, CLUTTER_ACTOR_ALIGN_FILL);
					_tmp34_ = self->priv->display;
					clutter_actor_set_y_align ((ClutterActor*) _tmp34_, CLUTTER_ACTOR_ALIGN_FILL);
					_tmp35_ = self->priv->display;
					clutter_actor_set_fixed_position_set ((ClutterActor*) _tmp35_, FALSE);
					_tmp36_ = self->priv->display;
					_tmp37_ = self->priv->display;
					g_object_set ((ClutterActor*) _tmp37_, "natural-width-set", FALSE, NULL);
					g_object_set ((ClutterActor*) _tmp36_, "min-width-set", FALSE, NULL);
					_tmp38_ = self->priv->display;
					_tmp39_ = self->priv->display;
					g_object_set ((ClutterActor*) _tmp39_, "natural-height-set", FALSE, NULL);
					g_object_set ((ClutterActor*) _tmp38_, "min-height-set", FALSE, NULL);
					_tmp40_ = self->priv->display;
					g_signal_connect_object ((ClutterActor*) _tmp40_, "transitions-completed", (GCallback) ______lambda97__clutter_actor_transitions_completed, self, 0);
				} else {
					BoxesApp* _tmp41_;
					BoxesDisplayPage* _tmp42_;
					_tmp41_ = boxes_app_app;
					_tmp42_ = _tmp41_->display_page;
					boxes_display_page_show (_tmp42_);
				}
			}
			break;
		}
		case BOXES_UI_STATE_COLLECTION:
		{
			GtkEntry* _tmp43_;
			GtkEntry* _tmp44_;
			GtkLabel* _tmp45_;
			_tmp43_ = self->priv->password_entry;
			gtk_widget_set_can_focus ((GtkWidget*) _tmp43_, FALSE);
			_tmp44_ = self->priv->password_entry;
			gtk_widget_hide ((GtkWidget*) _tmp44_);
			_tmp45_ = self->priv->label;
			gtk_widget_show ((GtkWidget*) _tmp45_);
			break;
		}
		case BOXES_UI_STATE_PROPERTIES:
		{
			Block27Data* _data27_;
			BoxesUIState _tmp46_;
			BoxesApp* _tmp47_;
			BoxesDisplayPage* _tmp48_;
			GtkWidget* _tmp49_ = NULL;
			GtkWidget* widget;
			GtkWidget* _tmp50_;
			gint _tmp51_;
			gint _tmp52_;
			ClutterActorBox _tmp53_ = {0};
			ClutterActorBox box;
			GtkClutterActor* _tmp54_;
			ClutterActorBox _tmp55_;
			BoxesApp* _tmp56_;
			gboolean _tmp57_;
			gboolean _tmp58_;
			GtkClutterActor* _tmp63_;
			GtkClutterActor* _tmp64_;
			BoxesApp* _tmp65_;
			guint _tmp66_;
			GtkClutterActor* _tmp67_;
			gulong _tmp68_ = 0UL;
			GtkClutterActor* _tmp69_;
			_data27_ = g_slice_new0 (Block27Data);
			_data27_->_ref_count_ = 1;
			_data27_->self = g_object_ref (self);
			_tmp46_ = ((BoxesUI*) self)->previous_ui_state;
			if (_tmp46_ == BOXES_UI_STATE_WIZARD) {
				block27_data_unref (_data27_);
				_data27_ = NULL;
				break;
			}
			_tmp47_ = boxes_app_app;
			_tmp48_ = _tmp47_->display_page;
			_tmp49_ = boxes_display_page_remove_display (_tmp48_);
			widget = _tmp49_;
			_tmp50_ = widget;
			boxes_machine_actor_update_display (self, _tmp50_, TRUE);
			_tmp51_ = width;
			_tmp52_ = height;
			_tmp53_.x1 = (gfloat) 0;
			_tmp53_.y1 = (gfloat) 0;
			_tmp53_.x2 = (gfloat) _tmp51_;
			_tmp53_.y2 = (gfloat) _tmp52_;
			box = _tmp53_;
			_tmp54_ = self->priv->display;
			_tmp55_ = box;
			clutter_actor_allocate ((ClutterActor*) _tmp54_, &_tmp55_, 0);
			_tmp56_ = boxes_app_app;
			_tmp57_ = boxes_app_get_fullscreen (_tmp56_);
			_tmp58_ = _tmp57_;
			if (_tmp58_) {
				BoxesApp* _tmp59_;
				BoxesTopbar* _tmp60_;
				ClutterActor* _tmp61_;
				ClutterActor* _tmp62_;
				_tmp59_ = boxes_app_app;
				_tmp60_ = _tmp59_->topbar;
				_tmp61_ = boxes_ui_get_actor ((BoxesUI*) _tmp60_);
				_tmp62_ = _tmp61_;
				clutter_actor_hide (_tmp62_);
			}
			_tmp63_ = self->priv->display;
			clutter_actor_set_easing_mode ((ClutterActor*) _tmp63_, CLUTTER_LINEAR);
			_tmp64_ = self->priv->display;
			_tmp65_ = boxes_app_app;
			_tmp66_ = _tmp65_->duration;
			clutter_actor_set_easing_duration ((ClutterActor*) _tmp64_, _tmp66_);
			_data27_->completed_id = (gulong) 0;
			_tmp67_ = self->priv->display;
			_tmp68_ = g_signal_connect_data ((ClutterActor*) _tmp67_, "transitions-completed", (GCallback) ____lambda98__clutter_actor_transitions_completed, block27_data_ref (_data27_), (GClosureNotify) block27_data_unref, 0);
			_data27_->completed_id = _tmp68_;
			_tmp69_ = self->priv->display;
			clutter_actor_show ((ClutterActor*) _tmp69_);
			_g_object_unref0 (widget);
			block27_data_unref (_data27_);
			_data27_ = NULL;
			break;
		}
		default:
		{
			break;
		}
	}
}


static ClutterActor* boxes_machine_actor_real_get_actor (BoxesUI* base) {
	ClutterActor* result;
	BoxesMachineActor* self;
	ClutterActor* _tmp0_;
	self = (BoxesMachineActor*) base;
	_tmp0_ = self->_actor;
	result = _tmp0_;
	return result;
}


static void boxes_machine_actor_class_init (BoxesMachineActorClass * klass) {
	boxes_machine_actor_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (BoxesMachineActorPrivate));
	BOXES_UI_CLASS (klass)->ui_state_changed = boxes_machine_actor_real_ui_state_changed;
	BOXES_UI_CLASS (klass)->get_actor = boxes_machine_actor_real_get_actor;
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_machine_actor_get_property;
	G_OBJECT_CLASS (klass)->finalize = boxes_machine_actor_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_MACHINE_ACTOR_ACTOR, g_param_spec_object ("actor", "actor", "actor", clutter_actor_get_type (), G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void boxes_machine_actor_instance_init (BoxesMachineActor * self) {
	self->priv = BOXES_MACHINE_ACTOR_GET_PRIVATE (self);
	self->priv->track_screenshot_id = (gulong) 0;
}


static void boxes_machine_actor_finalize (GObject* obj) {
	BoxesMachineActor * self;
	gulong _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_MACHINE_ACTOR, BoxesMachineActor);
	_tmp0_ = self->priv->track_screenshot_id;
	if (_tmp0_ != ((gulong) 0)) {
		BoxesApp* _tmp1_;
		BoxesProperties* _tmp2_;
		GtkWidget* _tmp3_;
		gulong _tmp4_;
		_tmp1_ = boxes_app_app;
		_tmp2_ = _tmp1_->properties;
		_tmp3_ = _tmp2_->screenshot_placeholder;
		_tmp4_ = self->priv->track_screenshot_id;
		g_signal_handler_disconnect ((GObject*) _tmp3_, _tmp4_);
	}
	_g_object_unref0 (self->_actor);
	_g_object_unref0 (self->priv->screenshot);
	_g_object_unref0 (self->priv->gtk_vbox);
	_g_object_unref0 (self->priv->display);
	_g_object_unref0 (self->priv->label);
	_g_object_unref0 (self->priv->vbox);
	_g_object_unref0 (self->priv->password_entry);
	_g_object_unref0 (self->priv->machine);
	G_OBJECT_CLASS (boxes_machine_actor_parent_class)->finalize (obj);
}


GType boxes_machine_actor_get_type (void) {
	static volatile gsize boxes_machine_actor_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_machine_actor_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesMachineActorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_machine_actor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesMachineActor), 0, (GInstanceInitFunc) boxes_machine_actor_instance_init, NULL };
		GType boxes_machine_actor_type_id;
		boxes_machine_actor_type_id = g_type_register_static (BOXES_TYPE_UI, "BoxesMachineActor", &g_define_type_info, 0);
		g_once_init_leave (&boxes_machine_actor_type_id__volatile, boxes_machine_actor_type_id);
	}
	return boxes_machine_actor_type_id__volatile;
}


static void _vala_boxes_machine_actor_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	BoxesMachineActor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_MACHINE_ACTOR, BoxesMachineActor);
	switch (property_id) {
		case BOXES_MACHINE_ACTOR_ACTOR:
		g_value_set_object (value, boxes_ui_get_actor ((BoxesUI*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



