/* machine.c generated by valac 0.17.5.2-8558, 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/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 _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_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;
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 _Block23Data Block23Data;
typedef struct _Block24Data Block24Data;
typedef struct _Block25Data Block25Data;

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 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_);
	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;
	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 _Block23Data {
	int _ref_count_;
	BoxesMachineActor * self;
	BoxesMachine* machine;
};

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

struct _Block25Data {
	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, GError** error);
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 __lambda97_ (BoxesMachine* self);
void boxes_machine_set_screenshot_enable (BoxesMachine* self, gboolean enable);
static void ___lambda97__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
void boxes_machine_load_screenshot (BoxesMachine* self);
gchar* boxes_machine_get_screenshot_filename (BoxesMachine* self);
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 ___lambda49_ (BoxesMachine* self);
static gboolean ____lambda49__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_);
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___lambda20_ (BoxesMachine* self, gint id);
static gboolean ___lambda21_ (BoxesMachine* self);
static gboolean ____lambda21__gsource_func (gpointer self);
static void __boxes_machine_display___lambda20__boxes_display_show (BoxesDisplay* _sender, gint display_id, gpointer self);
static void _boxes_machine_display___lambda90_ (BoxesMachine* self, gint id);
static void __boxes_machine_display___lambda90__boxes_display_hide (BoxesDisplay* _sender, gint display_id, gpointer self);
static void _boxes_machine_display___lambda91_ (BoxesMachine* self);
static void __boxes_machine_display___lambda91__boxes_display_disconnected (BoxesDisplay* _sender, gpointer self);
static void _boxes_machine_display___lambda92_ (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___lambda92__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void _boxes_machine_display___lambda93_ (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___lambda93__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 Block23Data* block23_data_ref (Block23Data* _data23_);
static void block23_data_unref (void * _userdata_);
BoxesUI* boxes_ui_construct (GType object_type);
void boxes_get_color (const gchar* desc, GdkColor* result);
static gboolean __lambda94_ (Block23Data* _data23_, GdkEventKey* event);
static gboolean ___lambda94__gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self);
void boxes_actor_remove (ClutterActor* actor);
static Block24Data* block24_data_ref (Block24Data* _data24_);
static void block24_data_unref (void * _userdata_);
void boxes_display_set_enable_inputs (BoxesDisplay* self, GtkWidget* widget, gboolean enable);
static void ___lambda33_ (BoxesMachineActor* self, ClutterActor* display);
static void ____lambda33__boxes_actor_func (ClutterActor* actor, gpointer self);
static void ___lambda88_ (Block24Data* _data24_);
static gboolean __lambda89_ (Block24Data* _data24_);
static gboolean ___lambda89__gsource_func (gpointer self);
static void ____lambda88__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 _____lambda95_ (BoxesMachineActor* self);
static void ______lambda95__clutter_actor_transitions_completed (ClutterActor* _sender, gpointer self);
void boxes_display_page_show (BoxesDisplayPage* self);
static Block25Data* block25_data_ref (Block25Data* _data25_);
static void block25_data_unref (void * _userdata_);
gboolean boxes_app_get_fullscreen (BoxesApp* self);
static void ___lambda96_ (Block25Data* _data25_);
static void ____lambda96__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;
	BoxesApp* _tmp6_;
	BoxesUIState _tmp7_;
	BoxesUIState _tmp8_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	{
		BoxesDisplay* _tmp0_;
		BoxesDisplay* _tmp1_;
		GtkWidget* _tmp2_ = NULL;
		GtkWidget* _tmp3_;
		_tmp0_ = boxes_machine_get_display (self);
		_tmp1_ = _tmp0_;
		_tmp2_ = boxes_display_get_display (_tmp1_, 0, &_inner_error_);
		_tmp3_ = _tmp2_;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == BOXES_ERROR) {
				goto __catch32_boxes_error;
			}
			_g_object_unref0 (widget);
			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;
		}
		_g_object_unref0 (widget);
		widget = _tmp3_;
	}
	goto __finally32;
	__catch32_boxes_error:
	{
		GError* _error_ = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp4_ = _error_;
		_tmp5_ = _tmp4_->message;
		g_warning ("machine.vala:59: %s", _tmp5_);
		_g_error_free0 (_error_);
		_g_object_unref0 (widget);
		return;
	}
	__finally32:
	if (_inner_error_ != NULL) {
		_g_object_unref0 (widget);
		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;
	}
	_tmp6_ = boxes_app_app;
	_tmp7_ = boxes_ui_get_ui_state ((BoxesUI*) _tmp6_);
	_tmp8_ = _tmp7_;
	switch (_tmp8_) {
		case BOXES_UI_STATE_DISPLAY:
		{
			BoxesApp* _tmp9_;
			BoxesDisplayPage* _tmp10_;
			BoxesDisplay* _tmp11_;
			BoxesDisplay* _tmp12_;
			GtkWidget* _tmp13_;
			GtkWidget* _tmp14_;
			_tmp9_ = boxes_app_app;
			_tmp10_ = _tmp9_->display_page;
			_tmp11_ = boxes_machine_get_display (self);
			_tmp12_ = _tmp11_;
			_tmp13_ = widget;
			boxes_display_page_show_display (_tmp10_, _tmp12_, _tmp13_);
			_tmp14_ = widget;
			gtk_widget_grab_focus (_tmp14_);
			break;
		}
		case BOXES_UI_STATE_PROPERTIES:
		{
			BoxesMachineActor* _tmp15_;
			GtkWidget* _tmp16_;
			_tmp15_ = self->machine_actor;
			_tmp16_ = widget;
			boxes_machine_actor_update_display (_tmp15_, _tmp16_, FALSE);
			break;
		}
		default:
		break;
	}
	_g_object_unref0 (widget);
}


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


static void __lambda97_ (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 ___lambda97__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda97_ (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) ___lambda97__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_;
		GdkPixbuf* _tmp2_;
		GdkPixbuf* _tmp3_;
		GdkPixbuf* screenshot;
		_tmp0_ = boxes_machine_get_screenshot_filename (self);
		_tmp1_ = _tmp0_;
		_tmp2_ = gdk_pixbuf_new_from_file (_tmp1_, &_inner_error_);
		_tmp3_ = _tmp2_;
		_g_free0 (_tmp1_);
		screenshot = _tmp3_;
		if (_inner_error_ != NULL) {
			goto __catch33_g_error;
		}
		boxes_machine_set_screenshot (self, screenshot, FALSE);
		_g_object_unref0 (screenshot);
	}
	goto __finally33;
	__catch33_g_error:
	{
		GError* _error_ = NULL;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_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;
	}
}


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


static gboolean ____lambda49__gsource_func (gpointer self) {
	gboolean result;
	result = ___lambda49_ (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_, ____lambda49__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;
	}
}


gchar* boxes_machine_get_screenshot_filename (BoxesMachine* self) {
	gchar* result = NULL;
	BoxesDisplayConfig* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->config;
	_tmp1_ = boxes_display_config_get_uuid (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = boxes_get_screenshot_filename (_tmp3_);
	_tmp5_ = _tmp4_;
	_g_free0 (_tmp3_);
	result = _tmp5_;
	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_) {
	BOXES_MACHINE_GET_CLASS (self)->connect_display_finish (self, _res_);
}


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 __catch34_g_error;
			}
			_tmp7_ = pixbuf;
			if (_tmp7_ != NULL) {
				GdkPixbuf* _tmp8_;
				_tmp8_ = pixbuf;
				boxes_machine_set_screenshot (self, _tmp8_, TRUE);
			}
			_g_object_unref0 (pixbuf);
		}
		goto __finally34;
		__catch34_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:218: %s", _tmp10_);
			_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;
		}
	}
	_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);
	{
		GdkPixbuf* _tmp0_;
		gchar* _tmp1_ = NULL;
		gchar* _tmp2_;
		_tmp0_ = pixbuf;
		_tmp1_ = boxes_machine_get_screenshot_filename (self);
		_tmp2_ = _tmp1_;
		gdk_pixbuf_save (_tmp0_, _tmp2_, "png", &_inner_error_, NULL);
		_g_free0 (_tmp2_);
		if (_inner_error_ != NULL) {
			goto __catch35_g_error;
		}
	}
	goto __finally35;
	__catch35_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp3_ = _error_;
		_tmp4_ = _tmp3_->message;
		g_warning ("machine.vala:257: %s", _tmp4_);
		_g_error_free0 (_error_);
	}
	__finally35:
	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 __catch36_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 __catch36_g_error;
			}
			_g_object_unref0 (_data_->large_screenshot);
			_data_->large_screenshot = _data_->_tmp5_;
		}
	}
	goto __finally36;
	__catch36_g_error:
	{
		_data_->_error_ = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_g_error_free0 (_data_->_error_);
	}
	__finally36:
	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 __catch37_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 __finally37;
	__catch37_g_error:
	{
		g_clear_error (&_inner_error_);
		_inner_error_ = NULL;
	}
	__finally37:
	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_;
	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;
	}
}


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:43: 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 ___lambda21_ (BoxesMachine* self) {
	gboolean result = FALSE;
	boxes_machine_show_display (self);
	result = FALSE;
	return result;
}


static gboolean ____lambda21__gsource_func (gpointer self) {
	gboolean result;
	result = ___lambda21_ (self);
	return result;
}


static void _boxes_machine_display___lambda20_ (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_;
			_tmp3_ = boxes_app_app;
			boxes_ui_set_ui_state ((BoxesUI*) _tmp3_, BOXES_UI_STATE_DISPLAY);
			_tmp4_ = boxes_app_app;
			_tmp5_ = _tmp4_->duration;
			g_timeout_add_full (G_PRIORITY_DEFAULT, _tmp5_, ____lambda21__gsource_func, g_object_ref (self), g_object_unref);
			break;
		}
		case BOXES_UI_STATE_DISPLAY:
		case BOXES_UI_STATE_PROPERTIES:
		{
			boxes_machine_show_display (self);
			break;
		}
		default:
		break;
	}
}


static void __boxes_machine_display___lambda20__boxes_display_show (BoxesDisplay* _sender, gint display_id, gpointer self) {
	_boxes_machine_display___lambda20_ (self, display_id);
}


static void _boxes_machine_display___lambda90_ (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___lambda90__boxes_display_hide (BoxesDisplay* _sender, gint display_id, gpointer self) {
	_boxes_machine_display___lambda90_ (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___lambda91_ (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:121: %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___lambda91__boxes_display_disconnected (BoxesDisplay* _sender, gpointer self) {
	_boxes_machine_display___lambda91_ (self);
}


static void _boxes_machine_display___lambda92_ (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___lambda92__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	_boxes_machine_display___lambda92_ (self);
}


static void _boxes_machine_display___lambda93_ (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___lambda93__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	_boxes_machine_display___lambda93_ (self);
}


void boxes_machine_set_display (BoxesMachine* self, BoxesDisplay* value) {
	BoxesDisplay* _tmp0_;
	BoxesDisplay* _tmp11_;
	BoxesDisplay* _tmp12_;
	BoxesDisplay* _tmp13_;
	const gchar* _tmp14_ = NULL;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	gchar* _tmp17_ = NULL;
	gchar* _tmp18_;
	BoxesDisplay* _tmp19_;
	gulong _tmp20_ = 0UL;
	BoxesDisplay* _tmp21_;
	gulong _tmp22_ = 0UL;
	BoxesDisplay* _tmp23_;
	gulong _tmp24_ = 0UL;
	BoxesDisplay* _tmp25_;
	gulong _tmp26_ = 0UL;
	BoxesDisplay* _tmp27_;
	gulong _tmp28_ = 0UL;
	BoxesDisplay* _tmp29_;
	BoxesMachineActor* _tmp30_;
	gchar* _tmp31_ = NULL;
	gchar* _tmp32_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_display;
	if (_tmp0_ != NULL) {
		BoxesDisplay* _tmp1_;
		gulong _tmp2_;
		BoxesDisplay* _tmp3_;
		gulong _tmp4_;
		BoxesDisplay* _tmp5_;
		gulong _tmp6_;
		BoxesDisplay* _tmp7_;
		gulong _tmp8_;
		BoxesDisplay* _tmp9_;
		gulong _tmp10_;
		_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->_display;
		_tmp4_ = self->priv->hide_id;
		g_signal_handler_disconnect ((GObject*) _tmp3_, _tmp4_);
		self->priv->hide_id = (gulong) 0;
		_tmp5_ = self->priv->_display;
		_tmp6_ = self->priv->disconnected_id;
		g_signal_handler_disconnect ((GObject*) _tmp5_, _tmp6_);
		self->priv->disconnected_id = (gulong) 0;
		_tmp7_ = self->priv->_display;
		_tmp8_ = self->priv->need_password_id;
		g_signal_handler_disconnect ((GObject*) _tmp7_, _tmp8_);
		self->priv->need_password_id = (gulong) 0;
		_tmp9_ = self->priv->_display;
		_tmp10_ = self->priv->need_username_id;
		g_signal_handler_disconnect ((GObject*) _tmp9_, _tmp10_);
		self->priv->need_username_id = (gulong) 0;
	}
	_tmp11_ = value;
	_tmp12_ = _g_object_ref0 (_tmp11_);
	_g_object_unref0 (self->priv->_display);
	self->priv->_display = _tmp12_;
	_tmp13_ = self->priv->_display;
	if (_tmp13_ == NULL) {
		return;
	}
	_tmp14_ = _ ("Connecting to %s");
	_tmp15_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
	_tmp16_ = _tmp15_;
	_tmp17_ = g_strdup_printf (_tmp14_, _tmp16_);
	_tmp18_ = _tmp17_;
	boxes_machine_set_status (self, _tmp18_);
	_g_free0 (_tmp18_);
	_tmp19_ = self->priv->_display;
	_tmp20_ = g_signal_connect_object (_tmp19_, "show", (GCallback) __boxes_machine_display___lambda20__boxes_display_show, self, 0);
	self->priv->show_id = _tmp20_;
	_tmp21_ = self->priv->_display;
	_tmp22_ = g_signal_connect_object (_tmp21_, "hide", (GCallback) __boxes_machine_display___lambda90__boxes_display_hide, self, 0);
	self->priv->hide_id = _tmp22_;
	_tmp23_ = self->priv->_display;
	_tmp24_ = g_signal_connect_object (_tmp23_, "disconnected", (GCallback) __boxes_machine_display___lambda91__boxes_display_disconnected, self, 0);
	self->priv->disconnected_id = _tmp24_;
	_tmp25_ = self->priv->_display;
	_tmp26_ = g_signal_connect_object ((GObject*) _tmp25_, "notify::need-password", (GCallback) __boxes_machine_display___lambda92__g_object_notify, self, 0);
	self->priv->need_password_id = _tmp26_;
	_tmp27_ = self->priv->_display;
	_tmp28_ = g_signal_connect_object ((GObject*) _tmp27_, "notify::need-username", (GCallback) __boxes_machine_display___lambda93__g_object_notify, self, 0);
	self->priv->need_username_id = _tmp28_;
	_tmp29_ = self->priv->_display;
	_tmp30_ = self->machine_actor;
	_tmp31_ = boxes_machine_actor_get_password (_tmp30_);
	_tmp32_ = _tmp31_;
	boxes_display_set_password (_tmp29_, _tmp32_);
	_g_free0 (_tmp32_);
	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 Block23Data* block23_data_ref (Block23Data* _data23_) {
	g_atomic_int_inc (&_data23_->_ref_count_);
	return _data23_;
}


static void block23_data_unref (void * _userdata_) {
	Block23Data* _data23_;
	_data23_ = (Block23Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data23_->_ref_count_)) {
		BoxesMachineActor * self;
		self = _data23_->self;
		_g_object_unref0 (_data23_->machine);
		_g_object_unref0 (self);
		g_slice_free (Block23Data, _data23_);
	}
}


static gboolean __lambda94_ (Block23Data* _data23_, GdkEventKey* event) {
	BoxesMachineActor * self;
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GdkEventKey _tmp2_;
	guint _tmp3_;
	gboolean _tmp6_;
	gboolean _tmp9_;
	self = _data23_->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_ = _data23_->machine;
		boxes_machine_connect_display (_tmp10_, NULL, NULL);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}


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


BoxesMachineActor* boxes_machine_actor_construct (GType object_type, BoxesMachine* machine) {
	BoxesMachineActor * self = NULL;
	Block23Data* _data23_;
	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);
	_data23_ = g_slice_new0 (Block23Data);
	_data23_->_ref_count_ = 1;
	_tmp0_ = machine;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_data23_->machine = _tmp1_;
	self = (BoxesMachineActor*) boxes_ui_construct (object_type);
	_data23_->self = g_object_ref (self);
	_tmp2_ = _data23_->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_ = _data23_->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_ = _data23_->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_ = _data23_->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) ___lambda94__gtk_widget_key_press_event, block23_data_ref (_data23_), (GClosureNotify) block23_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);
	block23_data_unref (_data23_);
	_data23_ = 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:509: %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:524: 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 Block24Data* block24_data_ref (Block24Data* _data24_) {
	g_atomic_int_inc (&_data24_->_ref_count_);
	return _data24_;
}


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


static void ___lambda33_ (BoxesMachineActor* self, ClutterActor* display) {
	GtkAllocation alloc = {0};
	BoxesApp* _tmp0_;
	BoxesProperties* _tmp1_;
	GtkWidget* _tmp2_;
	GtkAllocation _tmp3_ = {0};
	BoxesApp* _tmp4_;
	BoxesTopbar* _tmp5_;
	ClutterActor* _tmp6_;
	ClutterActor* _tmp7_;
	BoxesApp* _tmp8_;
	ClutterBinLayout* _tmp9_;
	ClutterActor* _tmp10_;
	ClutterActor* _tmp11_;
	guint _tmp12_ = 0U;
	guint d;
	ClutterActor* _tmp13_;
	ClutterActor* _tmp14_;
	GtkAllocation _tmp15_;
	gint _tmp16_;
	ClutterActor* _tmp17_;
	GtkAllocation _tmp18_;
	gint _tmp19_;
	ClutterActor* _tmp20_;
	GtkAllocation _tmp21_;
	gint _tmp22_;
	ClutterActor* _tmp23_;
	GtkAllocation _tmp24_;
	gint _tmp25_;
	ClutterActor* _tmp26_;
	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_ = boxes_app_app;
	_tmp9_ = _tmp8_->overlay_bin;
	_tmp10_ = display;
	clutter_bin_layout_set_alignment (_tmp9_, _tmp10_, CLUTTER_BIN_ALIGNMENT_FIXED, CLUTTER_BIN_ALIGNMENT_FIXED);
	_tmp11_ = display;
	_tmp12_ = clutter_actor_get_easing_duration (_tmp11_);
	d = _tmp12_;
	_tmp13_ = display;
	clutter_actor_set_easing_duration (_tmp13_, (guint) 0);
	_tmp14_ = display;
	_tmp15_ = alloc;
	_tmp16_ = _tmp15_.x;
	clutter_actor_set_x (_tmp14_, (gfloat) _tmp16_);
	_tmp17_ = display;
	_tmp18_ = alloc;
	_tmp19_ = _tmp18_.y;
	clutter_actor_set_y (_tmp17_, (gfloat) _tmp19_);
	_tmp20_ = display;
	_tmp21_ = alloc;
	_tmp22_ = _tmp21_.width;
	clutter_actor_set_width (_tmp20_, (gfloat) _tmp22_);
	_tmp23_ = display;
	_tmp24_ = alloc;
	_tmp25_ = _tmp24_.height;
	clutter_actor_set_height (_tmp23_, (gfloat) _tmp25_);
	_tmp26_ = display;
	clutter_actor_set_easing_duration (_tmp26_, d);
}


static void ____lambda33__boxes_actor_func (ClutterActor* actor, gpointer self) {
	___lambda33_ (self, actor);
}


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


static gboolean ___lambda89__gsource_func (gpointer self) {
	gboolean result;
	result = __lambda89_ (self);
	return result;
}


static void ___lambda88_ (Block24Data* _data24_) {
	BoxesMachineActor * self;
	self = _data24_->self;
	g_idle_add_full (G_PRIORITY_HIGH, ___lambda89__gsource_func, block24_data_ref (_data24_), block24_data_unref);
}


static void ____lambda88__gtk_widget_size_allocate (GtkWidget* _sender, GtkAllocation* allocation, gpointer self) {
	___lambda88_ (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) {
		Block24Data* _data24_;
		GtkWidget* _tmp5_;
		GtkClutterActor* _tmp6_;
		GtkClutterActor* _tmp7_;
		BoxesApp* _tmp8_;
		ClutterBinLayout* _tmp9_;
		GtkClutterActor* _tmp10_;
		BoxesMachine* _tmp11_;
		BoxesDisplay* _tmp12_;
		BoxesDisplay* _tmp13_;
		GtkWidget* _tmp14_;
		gulong _tmp15_;
		BoxesApp* _tmp20_;
		BoxesProperties* _tmp21_;
		GtkWidget* _tmp22_;
		gulong _tmp23_ = 0UL;
		gboolean _tmp24_;
		_data24_ = g_slice_new0 (Block24Data);
		_data24_->_ref_count_ = 1;
		_data24_->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_ = boxes_app_app;
		_tmp9_ = _tmp8_->overlay_bin;
		_tmp10_ = self->priv->display;
		clutter_bin_layout_add (_tmp9_, (ClutterActor*) _tmp10_, CLUTTER_BIN_ALIGNMENT_FILL, CLUTTER_BIN_ALIGNMENT_FILL);
		_tmp11_ = self->priv->machine;
		_tmp12_ = boxes_machine_get_display (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = widget;
		boxes_display_set_enable_inputs (_tmp13_, _tmp14_, FALSE);
		_data24_->update_screenshot_alloc = ____lambda33__boxes_actor_func;
		_data24_->update_screenshot_alloc_target = g_object_ref (self);
		_data24_->update_screenshot_alloc_target_destroy_notify = g_object_unref;
		_tmp15_ = self->priv->track_screenshot_id;
		if (_tmp15_ != ((gulong) 0)) {
			BoxesApp* _tmp16_;
			BoxesProperties* _tmp17_;
			GtkWidget* _tmp18_;
			gulong _tmp19_;
			_tmp16_ = boxes_app_app;
			_tmp17_ = _tmp16_->properties;
			_tmp18_ = _tmp17_->screenshot_placeholder;
			_tmp19_ = self->priv->track_screenshot_id;
			g_signal_handler_disconnect ((GObject*) _tmp18_, _tmp19_);
		}
		_tmp20_ = boxes_app_app;
		_tmp21_ = _tmp20_->properties;
		_tmp22_ = _tmp21_->screenshot_placeholder;
		_tmp23_ = g_signal_connect_data (_tmp22_, "size-allocate", (GCallback) ____lambda88__gtk_widget_size_allocate, block24_data_ref (_data24_), (GClosureNotify) block24_data_unref, 0);
		self->priv->track_screenshot_id = _tmp23_;
		_tmp24_ = zoom;
		if (!_tmp24_) {
			GtkClutterActor* _tmp25_;
			BoxesActorFunc _tmp26_;
			void* _tmp26__target;
			GtkClutterActor* _tmp27_;
			_tmp25_ = self->priv->display;
			clutter_actor_set_easing_duration ((ClutterActor*) _tmp25_, (guint) 0);
			_tmp26_ = _data24_->update_screenshot_alloc;
			_tmp26__target = _data24_->update_screenshot_alloc_target;
			_tmp27_ = self->priv->display;
			_tmp26_ ((ClutterActor*) _tmp27_, _tmp26__target);
		}
		block24_data_unref (_data24_);
		_data24_ = NULL;
	}
}


static void _____lambda95_ (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 ______lambda95__clutter_actor_transitions_completed (ClutterActor* _sender, gpointer self) {
	_____lambda95_ (self);
}


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 (self);
		g_slice_free (Block25Data, _data25_);
	}
}


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


static void ____lambda96__clutter_actor_transitions_completed (ClutterActor* _sender, gpointer self) {
	___lambda96_ (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) {
				BoxesApp* _tmp17_;
				ClutterBinLayout* _tmp18_;
				ClutterActor* _tmp19_;
				ClutterActor* _tmp20_;
				_tmp17_ = boxes_app_app;
				_tmp18_ = _tmp17_->overlay_bin;
				_tmp19_ = boxes_ui_get_actor ((BoxesUI*) self);
				_tmp20_ = _tmp19_;
				clutter_bin_layout_set_alignment (_tmp18_, _tmp20_, CLUTTER_BIN_ALIGNMENT_FILL, CLUTTER_BIN_ALIGNMENT_FILL);
			} else {
				GtkClutterActor* _tmp21_;
				_tmp21_ = self->priv->display;
				if (_tmp21_ != NULL) {
					BoxesApp* _tmp22_;
					BoxesProperties* _tmp23_;
					GtkWidget* _tmp24_;
					gulong _tmp25_;
					GtkClutterActor* _tmp26_;
					BoxesApp* _tmp27_;
					guint _tmp28_;
					BoxesApp* _tmp29_;
					ClutterBinLayout* _tmp30_;
					GtkClutterActor* _tmp31_;
					GtkClutterActor* _tmp32_;
					_tmp22_ = boxes_app_app;
					_tmp23_ = _tmp22_->properties;
					_tmp24_ = _tmp23_->screenshot_placeholder;
					_tmp25_ = self->priv->track_screenshot_id;
					g_signal_handler_disconnect ((GObject*) _tmp24_, _tmp25_);
					self->priv->track_screenshot_id = (gulong) 0;
					_tmp26_ = self->priv->display;
					_tmp27_ = boxes_app_app;
					_tmp28_ = _tmp27_->duration;
					clutter_actor_set_easing_duration ((ClutterActor*) _tmp26_, _tmp28_);
					_tmp29_ = boxes_app_app;
					_tmp30_ = _tmp29_->overlay_bin;
					_tmp31_ = self->priv->display;
					clutter_bin_layout_set_alignment (_tmp30_, (ClutterActor*) _tmp31_, CLUTTER_BIN_ALIGNMENT_FILL, CLUTTER_BIN_ALIGNMENT_FILL);
					_tmp32_ = self->priv->display;
					g_signal_connect_object ((ClutterActor*) _tmp32_, "transitions-completed", (GCallback) ______lambda95__clutter_actor_transitions_completed, self, 0);
				} else {
					BoxesApp* _tmp33_;
					BoxesDisplayPage* _tmp34_;
					_tmp33_ = boxes_app_app;
					_tmp34_ = _tmp33_->display_page;
					boxes_display_page_show (_tmp34_);
				}
			}
			break;
		}
		case BOXES_UI_STATE_COLLECTION:
		{
			GtkEntry* _tmp35_;
			GtkEntry* _tmp36_;
			GtkLabel* _tmp37_;
			_tmp35_ = self->priv->password_entry;
			gtk_widget_set_can_focus ((GtkWidget*) _tmp35_, FALSE);
			_tmp36_ = self->priv->password_entry;
			gtk_widget_hide ((GtkWidget*) _tmp36_);
			_tmp37_ = self->priv->label;
			gtk_widget_show ((GtkWidget*) _tmp37_);
			break;
		}
		case BOXES_UI_STATE_PROPERTIES:
		{
			Block25Data* _data25_;
			BoxesUIState _tmp38_;
			BoxesApp* _tmp39_;
			BoxesDisplayPage* _tmp40_;
			GtkWidget* _tmp41_ = NULL;
			GtkWidget* widget;
			GtkWidget* _tmp42_;
			gint _tmp43_;
			gint _tmp44_;
			ClutterActorBox _tmp45_ = {0};
			ClutterActorBox box;
			GtkClutterActor* _tmp46_;
			ClutterActorBox _tmp47_;
			BoxesApp* _tmp48_;
			gboolean _tmp49_;
			gboolean _tmp50_;
			GtkClutterActor* _tmp55_;
			GtkClutterActor* _tmp56_;
			BoxesApp* _tmp57_;
			guint _tmp58_;
			GtkClutterActor* _tmp59_;
			gulong _tmp60_ = 0UL;
			GtkClutterActor* _tmp61_;
			_data25_ = g_slice_new0 (Block25Data);
			_data25_->_ref_count_ = 1;
			_data25_->self = g_object_ref (self);
			_tmp38_ = ((BoxesUI*) self)->previous_ui_state;
			if (_tmp38_ == BOXES_UI_STATE_WIZARD) {
				block25_data_unref (_data25_);
				_data25_ = NULL;
				break;
			}
			_tmp39_ = boxes_app_app;
			_tmp40_ = _tmp39_->display_page;
			_tmp41_ = boxes_display_page_remove_display (_tmp40_);
			widget = _tmp41_;
			_tmp42_ = widget;
			boxes_machine_actor_update_display (self, _tmp42_, TRUE);
			_tmp43_ = width;
			_tmp44_ = height;
			_tmp45_.x1 = (gfloat) 0;
			_tmp45_.y1 = (gfloat) 0;
			_tmp45_.x2 = (gfloat) _tmp43_;
			_tmp45_.y2 = (gfloat) _tmp44_;
			box = _tmp45_;
			_tmp46_ = self->priv->display;
			_tmp47_ = box;
			clutter_actor_allocate ((ClutterActor*) _tmp46_, &_tmp47_, 0);
			_tmp48_ = boxes_app_app;
			_tmp49_ = boxes_app_get_fullscreen (_tmp48_);
			_tmp50_ = _tmp49_;
			if (_tmp50_) {
				BoxesApp* _tmp51_;
				BoxesTopbar* _tmp52_;
				ClutterActor* _tmp53_;
				ClutterActor* _tmp54_;
				_tmp51_ = boxes_app_app;
				_tmp52_ = _tmp51_->topbar;
				_tmp53_ = boxes_ui_get_actor ((BoxesUI*) _tmp52_);
				_tmp54_ = _tmp53_;
				clutter_actor_hide (_tmp54_);
			}
			_tmp55_ = self->priv->display;
			clutter_actor_set_easing_mode ((ClutterActor*) _tmp55_, CLUTTER_LINEAR);
			_tmp56_ = self->priv->display;
			_tmp57_ = boxes_app_app;
			_tmp58_ = _tmp57_->duration;
			clutter_actor_set_easing_duration ((ClutterActor*) _tmp56_, _tmp58_);
			_data25_->completed_id = (gulong) 0;
			_tmp59_ = self->priv->display;
			_tmp60_ = g_signal_connect_data ((ClutterActor*) _tmp59_, "transitions-completed", (GCallback) ____lambda96__clutter_actor_transitions_completed, block25_data_ref (_data25_), (GClosureNotify) block25_data_unref, 0);
			_data25_->completed_id = _tmp60_;
			_tmp61_ = self->priv->display;
			clutter_actor_show ((ClutterActor*) _tmp61_);
			_g_object_unref0 (widget);
			block25_data_unref (_data25_);
			_data25_ = 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;
	}
}



