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

/* This file is part of GNOME Games. License: GPL-3.0+.*/

#include <gtk/gtk.h>
#include <glib-object.h>
#include <gdk/gdk.h>
#include <glib.h>
#include <libmanette.h>
#include <handy.h>
#include "gnome-games.h"
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include "linux/input-event-codes.h"
#include <glib/gi18n-lib.h>
#include <cairo-gobject.h>

#define GAMES_DISPLAY_VIEW_FOCUS_OUT_DELAY_MILLISECONDS ((guint) 500)
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define GAMES_TYPE_UI_VIEW (games_ui_view_get_type ())
#define GAMES_UI_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_UI_VIEW, GamesUiView))
#define GAMES_IS_UI_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_UI_VIEW))
#define GAMES_UI_VIEW_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GAMES_TYPE_UI_VIEW, GamesUiViewIface))

typedef struct _GamesUiView GamesUiView;
typedef struct _GamesUiViewIface GamesUiViewIface;

#define GAMES_TYPE_DISPLAY_VIEW (games_display_view_get_type ())
#define GAMES_DISPLAY_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_DISPLAY_VIEW, GamesDisplayView))
#define GAMES_DISPLAY_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_DISPLAY_VIEW, GamesDisplayViewClass))
#define GAMES_IS_DISPLAY_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_DISPLAY_VIEW))
#define GAMES_IS_DISPLAY_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_DISPLAY_VIEW))
#define GAMES_DISPLAY_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_DISPLAY_VIEW, GamesDisplayViewClass))

typedef struct _GamesDisplayView GamesDisplayView;
typedef struct _GamesDisplayViewClass GamesDisplayViewClass;
typedef struct _GamesDisplayViewPrivate GamesDisplayViewPrivate;

#define GAMES_TYPE_MEDIA_MENU_BUTTON (games_media_menu_button_get_type ())
#define GAMES_MEDIA_MENU_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_MEDIA_MENU_BUTTON, GamesMediaMenuButton))
#define GAMES_MEDIA_MENU_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_MEDIA_MENU_BUTTON, GamesMediaMenuButtonClass))
#define GAMES_IS_MEDIA_MENU_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_MEDIA_MENU_BUTTON))
#define GAMES_IS_MEDIA_MENU_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_MEDIA_MENU_BUTTON))
#define GAMES_MEDIA_MENU_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_MEDIA_MENU_BUTTON, GamesMediaMenuButtonClass))

typedef struct _GamesMediaMenuButton GamesMediaMenuButton;
typedef struct _GamesMediaMenuButtonClass GamesMediaMenuButtonClass;

#define GAMES_TYPE_INPUT_MODE_SWITCHER (games_input_mode_switcher_get_type ())
#define GAMES_INPUT_MODE_SWITCHER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_INPUT_MODE_SWITCHER, GamesInputModeSwitcher))
#define GAMES_INPUT_MODE_SWITCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_INPUT_MODE_SWITCHER, GamesInputModeSwitcherClass))
#define GAMES_IS_INPUT_MODE_SWITCHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_INPUT_MODE_SWITCHER))
#define GAMES_IS_INPUT_MODE_SWITCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_INPUT_MODE_SWITCHER))
#define GAMES_INPUT_MODE_SWITCHER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_INPUT_MODE_SWITCHER, GamesInputModeSwitcherClass))

typedef struct _GamesInputModeSwitcher GamesInputModeSwitcher;
typedef struct _GamesInputModeSwitcherClass GamesInputModeSwitcherClass;

#define GAMES_TYPE_FULLSCREEN_BOX (games_fullscreen_box_get_type ())
#define GAMES_FULLSCREEN_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_FULLSCREEN_BOX, GamesFullscreenBox))
#define GAMES_FULLSCREEN_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_FULLSCREEN_BOX, GamesFullscreenBoxClass))
#define GAMES_IS_FULLSCREEN_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_FULLSCREEN_BOX))
#define GAMES_IS_FULLSCREEN_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_FULLSCREEN_BOX))
#define GAMES_FULLSCREEN_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_FULLSCREEN_BOX, GamesFullscreenBoxClass))

typedef struct _GamesFullscreenBox GamesFullscreenBox;
typedef struct _GamesFullscreenBoxClass GamesFullscreenBoxClass;

#define GAMES_TYPE_FLASH_BOX (games_flash_box_get_type ())
#define GAMES_FLASH_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_FLASH_BOX, GamesFlashBox))
#define GAMES_FLASH_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_FLASH_BOX, GamesFlashBoxClass))
#define GAMES_IS_FLASH_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_FLASH_BOX))
#define GAMES_IS_FLASH_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_FLASH_BOX))
#define GAMES_FLASH_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_FLASH_BOX, GamesFlashBoxClass))

typedef struct _GamesFlashBox GamesFlashBox;
typedef struct _GamesFlashBoxClass GamesFlashBoxClass;

#define GAMES_TYPE_SNAPSHOTS_LIST (games_snapshots_list_get_type ())
#define GAMES_SNAPSHOTS_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_SNAPSHOTS_LIST, GamesSnapshotsList))
#define GAMES_SNAPSHOTS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_SNAPSHOTS_LIST, GamesSnapshotsListClass))
#define GAMES_IS_SNAPSHOTS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_SNAPSHOTS_LIST))
#define GAMES_IS_SNAPSHOTS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_SNAPSHOTS_LIST))
#define GAMES_SNAPSHOTS_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_SNAPSHOTS_LIST, GamesSnapshotsListClass))

typedef struct _GamesSnapshotsList GamesSnapshotsList;
typedef struct _GamesSnapshotsListClass GamesSnapshotsListClass;
enum  {
	GAMES_DISPLAY_VIEW_0_PROPERTY,
	GAMES_DISPLAY_VIEW_IS_VIEW_ACTIVE_PROPERTY,
	GAMES_DISPLAY_VIEW_WINDOW_PROPERTY,
	GAMES_DISPLAY_VIEW_CAN_FULLSCREEN_PROPERTY,
	GAMES_DISPLAY_VIEW_IS_FULLSCREEN_PROPERTY,
	GAMES_DISPLAY_VIEW_IS_SHOWING_SNAPSHOTS_PROPERTY,
	GAMES_DISPLAY_VIEW_IS_MENU_OPEN_PROPERTY,
	GAMES_DISPLAY_VIEW_GAME_TITLE_PROPERTY,
	GAMES_DISPLAY_VIEW_RUNNER_PROPERTY,
	GAMES_DISPLAY_VIEW_NUM_PROPERTIES
};
static GParamSpec* games_display_view_properties[GAMES_DISPLAY_VIEW_NUM_PROPERTIES];
#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)))
typedef struct _GamesDisplayViewRunGameData GamesDisplayViewRunGameData;
typedef struct _GamesDisplayViewRunGameWithCancellableData GamesDisplayViewRunGameWithCancellableData;

#define GAMES_TYPE_GAME_COLLECTION (games_game_collection_get_type ())
#define GAMES_GAME_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_GAME_COLLECTION, GamesGameCollection))
#define GAMES_GAME_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_GAME_COLLECTION, GamesGameCollectionClass))
#define GAMES_IS_GAME_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_GAME_COLLECTION))
#define GAMES_IS_GAME_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_GAME_COLLECTION))
#define GAMES_GAME_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_GAME_COLLECTION, GamesGameCollectionClass))

typedef struct _GamesGameCollection GamesGameCollection;
typedef struct _GamesGameCollectionClass GamesGameCollectionClass;
typedef struct _GamesDisplayViewPromptResumeWithCancellableData GamesDisplayViewPromptResumeWithCancellableData;
typedef struct _GamesDisplayViewPromptResumeFailWithCancellableData GamesDisplayViewPromptResumeFailWithCancellableData;
typedef struct _GamesDisplayViewQuitGameData GamesDisplayViewQuitGameData;
typedef struct _GamesDisplayViewQuitGameWithCancellableData GamesDisplayViewQuitGameWithCancellableData;
typedef struct _GamesDisplayViewRestartInternalData GamesDisplayViewRestartInternalData;
typedef struct _Block27Data Block27Data;
typedef struct _GamesDisplayViewRunDialogAsyncData GamesDisplayViewRunDialogAsyncData;
enum  {
	GAMES_DISPLAY_VIEW_BACK_SIGNAL,
	GAMES_DISPLAY_VIEW_NUM_SIGNALS
};
static guint games_display_view_signals[GAMES_DISPLAY_VIEW_NUM_SIGNALS] = {0};
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _GamesUiViewIface {
	GTypeInterface parent_iface;
	gboolean (*on_button_pressed) (GamesUiView* self, GdkEventButton* event);
	gboolean (*on_key_pressed) (GamesUiView* self, GdkEventKey* event);
	gboolean (*gamepad_button_press_event) (GamesUiView* self, ManetteEvent* event);
	gboolean (*gamepad_button_release_event) (GamesUiView* self, ManetteEvent* event);
	gboolean (*gamepad_absolute_axis_event) (GamesUiView* self, ManetteEvent* event);
	gboolean (*get_is_view_active) (GamesUiView* self);
	void (*set_is_view_active) (GamesUiView* self, gboolean value);
};

struct _GamesDisplayView {
	GtkBox parent_instance;
	GamesDisplayViewPrivate * priv;
};

struct _GamesDisplayViewClass {
	GtkBoxClass parent_class;
};

struct _GamesDisplayViewPrivate {
	GtkStack* headerbar_stack;
	HdyHeaderBar* ingame_header_bar;
	GtkButton* fullscreen;
	GtkButton* restore;
	GtkMenuButton* secondary_menu_button;
	HdyHeaderBar* snapshots_header_bar;
	GamesMediaMenuButton* media_button;
	GamesInputModeSwitcher* input_mode_switcher;
	GtkStack* stack;
	HdyStatusPage* error_display;
	GtkButton* restart_btn;
	GtkBox* display_box;
	GamesDisplayBin* display_bin;
	GamesFullscreenBox* fullscreen_box;
	GamesFlashBox* flash_box;
	GamesSnapshotsList* snapshots_list;
	gboolean _is_view_active;
	GtkWindow* _window;
	gboolean _can_fullscreen;
	gboolean _is_fullscreen;
	gboolean _is_showing_snapshots;
	gboolean _is_menu_open;
	gchar* _game_title;
	GamesRunner* _runner;
	GamesHeaderBarWidget* _extra_widget;
	GSettings* settings;
	GCancellable* run_game_cancellable;
	GCancellable* quit_game_cancellable;
	GtkMessageDialog* resume_dialog;
	GtkMessageDialog* resume_failed_dialog;
	GtkMessageDialog* quit_dialog;
	GtkMessageDialog* restart_dialog;
	gulong extra_widget_notify_block_autohide_id;
	GamesGame* game;
	GSimpleActionGroup* action_group;
};

struct _GamesDisplayViewRunGameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GamesDisplayView* self;
	GamesGame* game;
	gboolean _tmp0_;
	GamesRunner* _tmp1_;
	GamesRunner* _tmp2_;
	GamesGame* _tmp3_;
	GCancellable* _tmp4_;
	GCancellable* _tmp5_;
	GCancellable* cancellable;
	GCancellable* _tmp6_;
	GCancellable* _tmp7_;
	GCancellable* _tmp8_;
	GCancellable* _tmp9_;
	GCancellable* _tmp10_;
	GCancellable* _tmp11_;
};

struct _GamesDisplayViewRunGameWithCancellableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GamesDisplayView* self;
	GamesGame* game;
	GCancellable* cancellable;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GamesRunner* _tmp2_;
	GamesRunner* _tmp3_;
	GamesRunner* _tmp4_;
	GamesRunner* _tmp5_;
	GamesRunner* _tmp6_;
	GamesRunner* _tmp7_;
	gboolean _tmp8_;
	gboolean _tmp9_;
	GamesMediaMenuButton* _tmp10_;
	GamesRunner* _tmp11_;
	GamesRunner* _tmp12_;
	GamesMediaSet* _tmp13_;
	GamesMediaSet* _tmp14_;
	GamesRunner* _tmp15_;
	GamesRunner* _tmp16_;
	gboolean _tmp17_;
	GSettings* _tmp18_;
	gboolean _tmp19_;
	GamesRunner* _tmp20_;
	GamesRunner* _tmp21_;
	gboolean _tmp22_;
	gboolean _tmp23_;
	GamesRunner* _tmp24_;
	GamesRunner* _tmp25_;
	GtkResponseType response;
	GamesRunner* _tmp26_;
	GamesRunner* _tmp27_;
	GamesRunner* _tmp28_;
	GamesRunner* _tmp29_;
};

struct _GamesDisplayViewPromptResumeWithCancellableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GamesDisplayView* self;
	GCancellable* cancellable;
	GtkResponseType result;
	GtkMessageDialog* _tmp0_;
	GtkWindow* _tmp1_;
	GtkMessageDialog* _tmp2_;
	GtkMessageDialog* _tmp3_;
	GtkMessageDialog* _tmp4_;
	GtkMessageDialog* _tmp5_;
	GtkResponseType response;
	GtkMessageDialog* _tmp6_;
	GtkMessageDialog* _tmp7_;
	GtkMessageDialog* _tmp8_;
};

struct _GamesDisplayViewPromptResumeFailWithCancellableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GamesDisplayView* self;
	GamesRunner* runner;
	GCancellable* cancellable;
	GtkMessageDialog* _tmp0_;
	GtkWindow* _tmp1_;
	GtkMessageDialog* _tmp2_;
	GtkMessageDialog* _tmp3_;
	GtkResponseType response;
	GtkMessageDialog* _tmp4_;
	GtkMessageDialog* _tmp5_;
	GError* e;
	GError* _tmp7_;
	const gchar* _tmp8_;
	GError* _inner_error0_;
};

struct _GamesDisplayViewQuitGameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GamesDisplayView* self;
	gboolean result;
	GCancellable* _tmp0_;
	GCancellable* _tmp1_;
	GCancellable* _tmp2_;
	GCancellable* _tmp3_;
	GCancellable* cancellable;
	GCancellable* _tmp4_;
	GCancellable* _tmp5_;
	GCancellable* _tmp6_;
	gboolean _result_;
	GCancellable* _tmp7_;
	GCancellable* _tmp8_;
	GCancellable* _tmp9_;
};

struct _GamesDisplayViewQuitGameWithCancellableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GamesDisplayView* self;
	GCancellable* cancellable;
	gboolean result;
	GamesRunner* _tmp0_;
	GamesRunner* _tmp1_;
	GamesRunner* _tmp2_;
	GamesRunner* _tmp3_;
	GamesRunner* _tmp4_;
	GamesRunner* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	GamesRunner* _tmp8_;
	GamesRunner* _tmp9_;
	GamesRunner* _tmp10_;
	GamesRunner* _tmp11_;
	GamesSnapshot* _tmp12_;
	GamesSnapshot* _tmp13_;
	gboolean _tmp14_;
	GamesRunner* _tmp15_;
	GamesRunner* _tmp16_;
	GtkMessageDialog* _tmp17_;
	GtkWindow* _tmp18_;
	GtkMessageDialog* _tmp19_;
	GtkMessageDialog* _tmp20_;
	GtkWidget* button;
	GtkMessageDialog* _tmp21_;
	GtkWidget* _tmp22_;
	GtkWidget* _tmp23_;
	GtkWidget* _tmp24_;
	GtkStyleContext* _tmp25_;
	GtkResponseType response;
	GtkMessageDialog* _tmp26_;
	GtkMessageDialog* _tmp27_;
	GtkMessageDialog* _tmp28_;
};

struct _GamesDisplayViewRestartInternalData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GamesDisplayView* self;
	gboolean _tmp0_;
	GamesRunner* _tmp1_;
	GamesRunner* _tmp2_;
	GamesRunner* _tmp3_;
	GamesRunner* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	GamesGame* _tmp7_;
	GamesRunner* _tmp8_;
	GamesRunner* _tmp9_;
	GamesRunner* _tmp10_;
	GamesRunner* _tmp11_;
	GamesSnapshot* _tmp12_;
	GamesSnapshot* _tmp13_;
	gboolean _tmp14_;
	GtkWindow* _tmp15_;
	GtkMessageDialog* _tmp16_;
	GtkMessageDialog* _tmp17_;
	GtkWidget* button;
	GtkMessageDialog* _tmp18_;
	GtkWidget* _tmp19_;
	GtkWidget* _tmp20_;
	GtkWidget* _tmp21_;
	GtkStyleContext* _tmp22_;
	GtkResponseType response;
	GtkMessageDialog* _tmp23_;
	GtkMessageDialog* _tmp24_;
	gboolean _tmp25_;
	GamesRunner* _tmp26_;
	GamesRunner* _tmp27_;
	GamesRunner* _tmp28_;
	GamesRunner* _tmp29_;
	GamesGame* _tmp30_;
	GamesRunner* _tmp31_;
	GamesRunner* _tmp32_;
	GamesRunner* _tmp33_;
	GamesRunner* _tmp34_;
	GError* e;
	GError* _tmp35_;
	const gchar* _tmp36_;
	GError* _inner_error0_;
};

struct _Block27Data {
	int _ref_count_;
	GamesDisplayView* self;
	GtkResponseType response;
	gpointer _async_data_;
};

struct _GamesDisplayViewRunDialogAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GamesDisplayView* self;
	GtkDialog* dialog;
	GtkResponseType result;
	Block27Data* _data27_;
};

static gint GamesDisplayView_private_offset;
static gpointer games_display_view_parent_class = NULL;
static GamesUiViewIface * games_display_view_games_ui_view_parent_iface = NULL;

VALA_EXTERN GType games_ui_view_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_display_view_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_media_menu_button_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_input_mode_switcher_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_fullscreen_box_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_flash_box_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_snapshots_list_get_type (void) G_GNUC_CONST ;
static void games_display_view_load_snapshot (GamesDisplayView* self);
static void _games_display_view_load_snapshot_gsimple_action_activate_callback (GSimpleAction* action,
                                                                         GVariant* parameter,
                                                                         gpointer self);
static void games_display_view_show_snapshots (GamesDisplayView* self);
static void _games_display_view_show_snapshots_gsimple_action_activate_callback (GSimpleAction* action,
                                                                          GVariant* parameter,
                                                                          gpointer self);
static void games_display_view_restart (GamesDisplayView* self);
static void _games_display_view_restart_gsimple_action_activate_callback (GSimpleAction* action,
                                                                   GVariant* parameter,
                                                                   gpointer self);
static gboolean games_display_view_real_on_button_pressed (GamesUiView* base,
                                                    GdkEventButton* event);
static gboolean games_display_view_real_on_key_pressed (GamesUiView* base,
                                                 GdkEventKey* event);
VALA_EXTERN GtkWindow* games_display_view_get_window (GamesDisplayView* self);
VALA_EXTERN GamesRunner* games_display_view_get_runner (GamesDisplayView* self);
VALA_EXTERN gboolean games_display_view_get_is_showing_snapshots (GamesDisplayView* self);
VALA_EXTERN gboolean games_snapshots_list_on_key_press_event (GamesSnapshotsList* self,
                                                  guint keyval,
                                                  GdkModifierType state);
VALA_EXTERN gboolean games_display_view_get_can_fullscreen (GamesDisplayView* self);
VALA_EXTERN gboolean games_display_view_get_is_fullscreen (GamesDisplayView* self);
VALA_EXTERN void games_display_view_set_is_fullscreen (GamesDisplayView* self,
                                           gboolean value);
static void games_display_view_on_escape_key_pressed (GamesDisplayView* self);
static void games_display_view_on_display_back (GamesDisplayView* self);
static void games_display_view_create_new_snapshot (GamesDisplayView* self);
static void games_display_view_load_latest_snapshot (GamesDisplayView* self);
static gboolean games_display_view_real_gamepad_button_press_event (GamesUiView* base,
                                                             ManetteEvent* event);
static gboolean games_display_view_handle_dialog_gamepad_button_press_event (GamesDisplayView* self,
                                                                      GtkDialog* dialog,
                                                                      ManetteEvent* event);
static gboolean games_display_view_real_gamepad_button_release_event (GamesUiView* base,
                                                               ManetteEvent* event);
static gboolean games_display_view_real_gamepad_absolute_axis_event (GamesUiView* base,
                                                              ManetteEvent* event);
VALA_EXTERN void games_display_view_set_is_showing_snapshots (GamesDisplayView* self,
                                                  gboolean value);
static void games_display_view_run_game_data_free (gpointer _data);
VALA_EXTERN void games_display_view_run_game (GamesDisplayView* self,
                                  GamesGame* game,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_);
VALA_EXTERN void games_display_view_run_game_finish (GamesDisplayView* self,
                                         GAsyncResult* _res_);
static gboolean games_display_view_run_game_co (GamesDisplayViewRunGameData* _data_);
VALA_EXTERN void games_display_view_quit_game (GamesDisplayView* self,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN gboolean games_display_view_quit_game_finish (GamesDisplayView* self,
                                              GAsyncResult* _res_);
static void games_display_view_run_game_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_);
static void games_display_view_run_game_with_cancellable (GamesDisplayView* self,
                                                   GamesGame* game,
                                                   GCancellable* cancellable,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
static void games_display_view_run_game_with_cancellable_finish (GamesDisplayView* self,
                                                          GAsyncResult* _res_);
static void games_display_view_run_game_with_cancellable_data_free (gpointer _data);
static gboolean games_display_view_run_game_with_cancellable_co (GamesDisplayViewRunGameWithCancellableData* _data_);
VALA_EXTERN void games_display_view_set_game_title (GamesDisplayView* self,
                                        const gchar* value);
static void games_display_view_reset_display_page (GamesDisplayView* self);
static GamesRunner* games_display_view_try_get_runner (GamesDisplayView* self,
                                                GamesGame* game);
VALA_EXTERN void games_display_view_set_runner (GamesDisplayView* self,
                                    GamesRunner* value);
VALA_EXTERN void games_display_view_set_can_fullscreen (GamesDisplayView* self,
                                            gboolean value);
VALA_EXTERN void games_media_menu_button_set_media_set (GamesMediaMenuButton* self,
                                            GamesMediaSet* value);
static void __lambda60_ (GamesDisplayView* self,
                  const gchar* message);
static void ___lambda60__games_runner_crash (GamesRunner* _sender,
                                      const gchar* message,
                                      gpointer self);
static void games_display_view_update_actions (GamesDisplayView* self);
static gboolean games_display_view_start_or_resume (GamesDisplayView* self,
                                             GamesRunner* runner,
                                             gboolean resume);
static void games_display_view_prompt_resume_with_cancellable (GamesDisplayView* self,
                                                        GCancellable* cancellable,
                                                        GAsyncReadyCallback _callback_,
                                                        gpointer _user_data_);
static GtkResponseType games_display_view_prompt_resume_with_cancellable_finish (GamesDisplayView* self,
                                                                          GAsyncResult* _res_);
static void games_display_view_run_game_with_cancellable_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_);
static void games_display_view_prompt_resume_fail_with_cancellable (GamesDisplayView* self,
                                                             GamesRunner* runner,
                                                             GCancellable* cancellable,
                                                             GAsyncReadyCallback _callback_,
                                                             gpointer _user_data_);
static void games_display_view_prompt_resume_fail_with_cancellable_finish (GamesDisplayView* self,
                                                                    GAsyncResult* _res_);
VALA_EXTERN GType games_game_collection_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GamesApplication* games_application_get_default (void);
VALA_EXTERN GamesGameCollection* games_application_get_collection (GamesApplication* self);
VALA_EXTERN GamesRunner* games_game_collection_create_runner (GamesGameCollection* self,
                                                  GamesGame* game);
static void games_display_view_prompt_resume_with_cancellable_data_free (gpointer _data);
static gboolean games_display_view_prompt_resume_with_cancellable_co (GamesDisplayViewPromptResumeWithCancellableData* _data_);
static void __lambda61_ (GamesDisplayView* self);
static void ___lambda61__g_cancellable_cancelled (GCancellable* _sender,
                                           gpointer self);
static void games_display_view_run_dialog_async (GamesDisplayView* self,
                                          GtkDialog* dialog,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
static GtkResponseType games_display_view_run_dialog_finish (GamesDisplayView* self,
                                                      GAsyncResult* _res_);
static void games_display_view_prompt_resume_with_cancellable_ready (GObject* source_object,
                                                              GAsyncResult* _res_,
                                                              gpointer _user_data_);
static void games_display_view_prompt_resume_fail_with_cancellable_data_free (gpointer _data);
static gboolean games_display_view_prompt_resume_fail_with_cancellable_co (GamesDisplayViewPromptResumeFailWithCancellableData* _data_);
static void __lambda62_ (GamesDisplayView* self);
static void ___lambda62__g_cancellable_cancelled (GCancellable* _sender,
                                           gpointer self);
static void games_display_view_prompt_resume_fail_with_cancellable_ready (GObject* source_object,
                                                                   GAsyncResult* _res_,
                                                                   gpointer _user_data_);
static void games_display_view_quit_game_data_free (gpointer _data);
static gboolean games_display_view_quit_game_co (GamesDisplayViewQuitGameData* _data_);
static void games_display_view_quit_game_with_cancellable (GamesDisplayView* self,
                                                    GCancellable* cancellable,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_);
static gboolean games_display_view_quit_game_with_cancellable_finish (GamesDisplayView* self,
                                                               GAsyncResult* _res_);
static void games_display_view_quit_game_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static void games_display_view_quit_game_with_cancellable_data_free (gpointer _data);
static gboolean games_display_view_quit_game_with_cancellable_co (GamesDisplayViewQuitGameWithCancellableData* _data_);
static void __lambda58_ (GamesDisplayView* self);
static void ___lambda58__g_cancellable_cancelled (GCancellable* _sender,
                                           gpointer self);
static void games_display_view_quit_game_with_cancellable_ready (GObject* source_object,
                                                          GAsyncResult* _res_,
                                                          gpointer _user_data_);
static gboolean games_display_view_cancel_quitting_game (GamesDisplayView* self);
static void games_display_view_set_extra_widget (GamesDisplayView* self,
                                          GamesHeaderBarWidget* value);
static void games_display_view_on_snapshots_hidden (GamesDisplayView* self);
static void _games_display_view_on_snapshots_hidden_games_snapshots_list_hidden (GamesSnapshotsList* _sender,
                                                                          gpointer self);
VALA_EXTERN void games_display_view_update_pause (GamesDisplayView* self);
static gboolean games_display_view_can_update_pause (GamesDisplayView* self);
static void games_display_view_restart_internal (GamesDisplayView* self,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
static void games_display_view_restart_internal_finish (GamesDisplayView* self,
                                                 GAsyncResult* _res_);
static void games_display_view_restart_internal_data_free (gpointer _data);
static gboolean games_display_view_restart_internal_co (GamesDisplayViewRestartInternalData* _data_);
static void games_display_view_restart_internal_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
static void games_display_view_set_display (GamesDisplayView* self,
                                     GtkWidget* display);
static void games_display_view_remove_display (GamesDisplayView* self);
static void games_display_view_real_size_allocate (GtkWidget* base,
                                            GtkAllocation* allocation);
static void games_display_view_update_fullscreen_box (GamesDisplayView* self);
VALA_EXTERN gboolean games_media_menu_button_get_active (GamesMediaMenuButton* self);
static GamesHeaderBarWidget* games_display_view_get_extra_widget (GamesDisplayView* self);
VALA_EXTERN void games_fullscreen_box_set_autohide (GamesFullscreenBox* self,
                                        gboolean value);
VALA_EXTERN void games_fullscreen_box_set_overlay (GamesFullscreenBox* self,
                                       gboolean value);
static void _games_display_view_update_fullscreen_box_g_object_notify (GObject* _sender,
                                                                GParamSpec* pspec,
                                                                gpointer self);
static void games_display_view_on_fullscreen_changed (GamesDisplayView* self);
static void _games_display_view_on_fullscreen_changed_g_object_notify (GObject* _sender,
                                                                GParamSpec* pspec,
                                                                gpointer self);
static void games_display_view_on_showing_snapshots_changed (GamesDisplayView* self);
static void _games_display_view_on_showing_snapshots_changed_g_object_notify (GObject* _sender,
                                                                       GParamSpec* pspec,
                                                                       gpointer self);
static void games_display_view_on_back_clicked (GamesDisplayView* self);
static void _games_display_view_on_back_clicked_gtk_button_clicked (GtkButton* _sender,
                                                             gpointer self);
static void games_display_view_on_fullscreen_clicked (GamesDisplayView* self);
static void _games_display_view_on_fullscreen_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                   gpointer self);
static void games_display_view_on_restore_clicked (GamesDisplayView* self);
static void _games_display_view_on_restore_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                gpointer self);
static void games_display_view_run_dialog_async_data_free (gpointer _data);
static gboolean games_display_view_run_dialog_async_co (GamesDisplayViewRunDialogAsyncData* _data_);
static Block27Data* block27_data_ref (Block27Data* _data27_);
static void block27_data_unref (void * _userdata_);
static void __lambda59_ (Block27Data* _data27_,
                  gint r);
static void ___lambda59__gtk_dialog_response (GtkDialog* _sender,
                                       gint response_id,
                                       gpointer self);
VALA_EXTERN GamesDisplayView* games_display_view_new (void);
VALA_EXTERN GamesDisplayView* games_display_view_construct (GType object_type);
VALA_EXTERN gboolean games_ui_view_get_is_view_active (GamesUiView* self);
static void games_display_view_set_window (GamesDisplayView* self,
                                    GtkWindow* value);
VALA_EXTERN gboolean games_display_view_get_is_menu_open (GamesDisplayView* self);
VALA_EXTERN void games_display_view_set_is_menu_open (GamesDisplayView* self,
                                          gboolean value);
VALA_EXTERN const gchar* games_display_view_get_game_title (GamesDisplayView* self);
VALA_EXTERN void games_flash_box_flash (GamesFlashBox* self);
static void _games_flash_box_flash_games_runner_snapshot_created (GamesRunner* _sender,
                                                           gpointer self);
VALA_EXTERN void games_snapshots_list_set_runner (GamesSnapshotsList* self,
                                      GamesRunner* value);
VALA_EXTERN void games_input_mode_switcher_set_runner (GamesInputModeSwitcher* self,
                                           GamesRunner* value);
static GObject * games_display_view_constructor (GType type,
                                          guint n_construct_properties,
                                          GObjectConstructParam * construct_properties);
VALA_EXTERN gboolean games_ui_view_on_button_pressed (GamesUiView* self,
                                          GdkEventButton* event);
VALA_EXTERN gboolean games_ui_view_on_key_pressed (GamesUiView* self,
                                       GdkEventKey* event);
VALA_EXTERN gboolean games_ui_view_gamepad_button_press_event (GamesUiView* self,
                                                   ManetteEvent* event);
VALA_EXTERN gboolean games_ui_view_gamepad_button_release_event (GamesUiView* self,
                                                     ManetteEvent* event);
VALA_EXTERN gboolean games_ui_view_gamepad_absolute_axis_event (GamesUiView* self,
                                                    ManetteEvent* event);
VALA_EXTERN void games_ui_view_set_is_view_active (GamesUiView* self,
                                       gboolean value);
static void games_display_view_finalize (GObject * obj);
static GType games_display_view_get_type_once (void);
static void _vala_games_display_view_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec);
static void _vala_games_display_view_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const GActionEntry GAMES_DISPLAY_VIEW_action_entries[3] = {{"load-snapshot", _games_display_view_load_snapshot_gsimple_action_activate_callback}, {"show-snapshots", _games_display_view_show_snapshots_gsimple_action_activate_callback}, {"restart", _games_display_view_restart_gsimple_action_activate_callback}};

static inline gpointer
games_display_view_get_instance_private (GamesDisplayView* self)
{
	return G_STRUCT_MEMBER_P (self, GamesDisplayView_private_offset);
}

static void
_games_display_view_load_snapshot_gsimple_action_activate_callback (GSimpleAction* action,
                                                                    GVariant* parameter,
                                                                    gpointer self)
{
	games_display_view_load_snapshot ((GamesDisplayView*) self);
}

static void
_games_display_view_show_snapshots_gsimple_action_activate_callback (GSimpleAction* action,
                                                                     GVariant* parameter,
                                                                     gpointer self)
{
	games_display_view_show_snapshots ((GamesDisplayView*) self);
}

static void
_games_display_view_restart_gsimple_action_activate_callback (GSimpleAction* action,
                                                              GVariant* parameter,
                                                              gpointer self)
{
	games_display_view_restart ((GamesDisplayView*) self);
}

static gboolean
games_display_view_real_on_button_pressed (GamesUiView* base,
                                           GdkEventButton* event)
{
	GamesDisplayView * self;
	gboolean result;
	self = (GamesDisplayView*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	if (event->button == ((guint) 8)) {
		g_signal_emit (self, games_display_view_signals[GAMES_DISPLAY_VIEW_BACK_SIGNAL], 0);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

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

static gboolean
games_display_view_real_on_key_pressed (GamesUiView* base,
                                        GdkEventKey* event)
{
	GamesDisplayView * self;
	GdkModifierType default_modifiers = 0U;
	guint keyval = 0U;
	GdkKeymap* keymap = NULL;
	GtkWindow* _tmp0_;
	GdkDisplay* _tmp1_;
	GdkKeymap* _tmp2_;
	GdkKeymap* _tmp3_;
	GdkKeymap* _tmp4_;
	guint _tmp5_ = 0U;
	gboolean ctrl_pressed = FALSE;
	GamesRunner* _tmp6_;
	GamesRunner* _tmp7_;
	gboolean _tmp8_ = FALSE;
	gboolean _tmp9_;
	GamesRunner* _tmp11_;
	GamesRunner* _tmp12_;
	gboolean _tmp13_ = FALSE;
	gboolean _tmp14_ = FALSE;
	gboolean _tmp15_ = FALSE;
	gboolean _tmp16_ = FALSE;
	gboolean _tmp22_ = FALSE;
	gboolean _tmp23_ = FALSE;
	gboolean _tmp29_ = FALSE;
	GamesRunner* _tmp35_;
	GamesRunner* _tmp36_;
	GamesRunner* _tmp37_;
	GamesRunner* _tmp38_;
	gboolean _tmp39_;
	gboolean _tmp40_;
	gboolean _tmp41_;
	gboolean _tmp42_ = FALSE;
	gboolean _tmp43_ = FALSE;
	gboolean _tmp44_ = FALSE;
	gboolean _tmp45_ = FALSE;
	gboolean _tmp46_ = FALSE;
	gboolean _tmp47_ = FALSE;
	gboolean _tmp48_ = FALSE;
	gboolean _tmp49_ = FALSE;
	gboolean _tmp50_ = FALSE;
	gboolean result;
	self = (GamesDisplayView*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	if (!gtk_widget_get_mapped ((GtkWidget*) self)) {
		result = FALSE;
		return result;
	}
	default_modifiers = gtk_accelerator_get_default_mod_mask ();
	_tmp0_ = self->priv->_window;
	_tmp1_ = gtk_widget_get_display ((GtkWidget*) _tmp0_);
	_tmp2_ = gdk_keymap_get_for_display (_tmp1_);
	_tmp3_ = _g_object_ref0 (_tmp2_);
	keymap = _tmp3_;
	_tmp4_ = keymap;
	gdk_keymap_translate_keyboard_state (_tmp4_, (guint) event->hardware_keycode, event->state, (gint) event->group, &_tmp5_, NULL, NULL, NULL);
	keyval = _tmp5_;
	ctrl_pressed = (event->state & default_modifiers) == GDK_CONTROL_MASK;
	_tmp6_ = games_display_view_get_runner (self);
	_tmp7_ = _tmp6_;
	if (_tmp7_ == NULL) {
		result = FALSE;
		_g_object_unref0 (keymap);
		return result;
	}
	_tmp9_ = self->priv->_is_showing_snapshots;
	if (_tmp9_) {
		GamesSnapshotsList* _tmp10_;
		_tmp10_ = self->priv->snapshots_list;
		_tmp8_ = games_snapshots_list_on_key_press_event (_tmp10_, keyval, event->state & default_modifiers);
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		result = TRUE;
		_g_object_unref0 (keymap);
		return result;
	}
	_tmp11_ = games_display_view_get_runner (self);
	_tmp12_ = _tmp11_;
	if (games_runner_key_press_event (_tmp12_, keyval, event->state & default_modifiers)) {
		result = TRUE;
		_g_object_unref0 (keymap);
		return result;
	}
	if (keyval == GDK_KEY_f) {
		_tmp16_ = TRUE;
	} else {
		_tmp16_ = keyval == GDK_KEY_F;
	}
	if (_tmp16_) {
		_tmp15_ = ctrl_pressed;
	} else {
		_tmp15_ = FALSE;
	}
	if (_tmp15_) {
		gboolean _tmp17_;
		_tmp17_ = self->priv->_can_fullscreen;
		_tmp14_ = _tmp17_;
	} else {
		_tmp14_ = FALSE;
	}
	if (_tmp14_) {
		gboolean _tmp18_;
		_tmp18_ = self->priv->_is_showing_snapshots;
		_tmp13_ = !_tmp18_;
	} else {
		_tmp13_ = FALSE;
	}
	if (_tmp13_) {
		gboolean _tmp19_;
		GSettings* _tmp20_;
		gboolean _tmp21_;
		_tmp19_ = self->priv->_is_fullscreen;
		games_display_view_set_is_fullscreen (self, !_tmp19_);
		_tmp20_ = self->priv->settings;
		_tmp21_ = self->priv->_is_fullscreen;
		g_settings_set_boolean (_tmp20_, "fullscreen", _tmp21_);
		result = TRUE;
		_g_object_unref0 (keymap);
		return result;
	}
	if (keyval == GDK_KEY_F11) {
		gboolean _tmp24_;
		_tmp24_ = self->priv->_can_fullscreen;
		_tmp23_ = _tmp24_;
	} else {
		_tmp23_ = FALSE;
	}
	if (_tmp23_) {
		gboolean _tmp25_;
		_tmp25_ = self->priv->_is_showing_snapshots;
		_tmp22_ = !_tmp25_;
	} else {
		_tmp22_ = FALSE;
	}
	if (_tmp22_) {
		gboolean _tmp26_;
		GSettings* _tmp27_;
		gboolean _tmp28_;
		_tmp26_ = self->priv->_is_fullscreen;
		games_display_view_set_is_fullscreen (self, !_tmp26_);
		_tmp27_ = self->priv->settings;
		_tmp28_ = self->priv->_is_fullscreen;
		g_settings_set_boolean (_tmp27_, "fullscreen", _tmp28_);
		result = TRUE;
		_g_object_unref0 (keymap);
		return result;
	}
	if (keyval == GDK_KEY_Escape) {
		games_display_view_on_escape_key_pressed (self);
		result = TRUE;
		_g_object_unref0 (keymap);
		return result;
	}
	if ((event->state & default_modifiers) == GDK_MOD1_MASK) {
		gboolean _tmp30_ = FALSE;
		gboolean _tmp31_ = FALSE;
		GtkWindow* _tmp32_;
		_tmp32_ = self->priv->_window;
		if (gtk_widget_get_direction ((GtkWidget*) _tmp32_) == GTK_TEXT_DIR_LTR) {
			_tmp31_ = keyval == GDK_KEY_Left;
		} else {
			_tmp31_ = FALSE;
		}
		if (_tmp31_) {
			_tmp30_ = TRUE;
		} else {
			gboolean _tmp33_ = FALSE;
			GtkWindow* _tmp34_;
			_tmp34_ = self->priv->_window;
			if (gtk_widget_get_direction ((GtkWidget*) _tmp34_) == GTK_TEXT_DIR_RTL) {
				_tmp33_ = keyval == GDK_KEY_Right;
			} else {
				_tmp33_ = FALSE;
			}
			_tmp30_ = _tmp33_;
		}
		_tmp29_ = _tmp30_;
	} else {
		_tmp29_ = FALSE;
	}
	if (_tmp29_) {
		games_display_view_on_display_back (self);
		result = TRUE;
		_g_object_unref0 (keymap);
		return result;
	}
	_tmp35_ = games_display_view_get_runner (self);
	_tmp36_ = _tmp35_;
	if (_tmp36_ == NULL) {
		result = FALSE;
		_g_object_unref0 (keymap);
		return result;
	}
	_tmp37_ = games_display_view_get_runner (self);
	_tmp38_ = _tmp37_;
	_tmp39_ = games_runner_get_supports_snapshots (_tmp38_);
	_tmp40_ = _tmp39_;
	if (!_tmp40_) {
		result = FALSE;
		_g_object_unref0 (keymap);
		return result;
	}
	_tmp41_ = self->priv->_is_showing_snapshots;
	if (_tmp41_) {
		result = FALSE;
		_g_object_unref0 (keymap);
		return result;
	}
	if (keyval == GDK_KEY_a) {
		_tmp44_ = TRUE;
	} else {
		_tmp44_ = keyval == GDK_KEY_A;
	}
	if (_tmp44_) {
		_tmp43_ = ctrl_pressed;
	} else {
		_tmp43_ = FALSE;
	}
	if (_tmp43_) {
		_tmp42_ = TRUE;
	} else {
		_tmp42_ = keyval == GDK_KEY_F4;
	}
	if (_tmp42_) {
		games_display_view_show_snapshots (self);
		result = TRUE;
		_g_object_unref0 (keymap);
		return result;
	}
	if (keyval == GDK_KEY_s) {
		_tmp47_ = TRUE;
	} else {
		_tmp47_ = keyval == GDK_KEY_S;
	}
	if (_tmp47_) {
		_tmp46_ = ctrl_pressed;
	} else {
		_tmp46_ = FALSE;
	}
	if (_tmp46_) {
		_tmp45_ = TRUE;
	} else {
		_tmp45_ = keyval == GDK_KEY_F2;
	}
	if (_tmp45_) {
		games_display_view_create_new_snapshot (self);
		result = TRUE;
		_g_object_unref0 (keymap);
		return result;
	}
	if (keyval == GDK_KEY_d) {
		_tmp50_ = TRUE;
	} else {
		_tmp50_ = keyval == GDK_KEY_D;
	}
	if (_tmp50_) {
		_tmp49_ = ctrl_pressed;
	} else {
		_tmp49_ = FALSE;
	}
	if (_tmp49_) {
		_tmp48_ = TRUE;
	} else {
		_tmp48_ = keyval == GDK_KEY_F3;
	}
	if (_tmp48_) {
		games_display_view_load_latest_snapshot (self);
		result = TRUE;
		_g_object_unref0 (keymap);
		return result;
	}
	result = FALSE;
	_g_object_unref0 (keymap);
	return result;
}

static void
games_display_view_on_escape_key_pressed (GamesDisplayView* self)
{
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_is_showing_snapshots;
	if (_tmp0_) {
		games_display_view_on_display_back (self);
	} else {
		gboolean _tmp1_;
		_tmp1_ = self->priv->_can_fullscreen;
		if (_tmp1_) {
			GSettings* _tmp2_;
			games_display_view_set_is_fullscreen (self, FALSE);
			_tmp2_ = self->priv->settings;
			g_settings_set_boolean (_tmp2_, "fullscreen", FALSE);
		}
	}
}

static void
games_display_view_create_new_snapshot (GamesDisplayView* self)
{
	GamesRunner* _tmp0_;
	GamesRunner* _tmp1_;
	GamesRunner* _tmp2_;
	GamesRunner* _tmp3_;
	GamesSnapshot* _tmp4_;
	GamesSnapshot* _tmp5_;
	GamesRunner* _tmp6_;
	GamesRunner* _tmp7_;
	GamesRunner* _tmp8_;
	GamesRunner* _tmp9_;
	GtkWidget* _tmp10_;
	GtkWidget* _tmp11_;
	g_return_if_fail (self != NULL);
	_tmp0_ = games_display_view_get_runner (self);
	_tmp1_ = _tmp0_;
	games_runner_pause (_tmp1_);
	_tmp2_ = games_display_view_get_runner (self);
	_tmp3_ = _tmp2_;
	_tmp4_ = games_runner_try_create_snapshot (_tmp3_, FALSE);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp5_);
	_tmp6_ = games_display_view_get_runner (self);
	_tmp7_ = _tmp6_;
	games_runner_resume (_tmp7_);
	_tmp8_ = games_display_view_get_runner (self);
	_tmp9_ = _tmp8_;
	_tmp10_ = games_runner_get_display (_tmp9_);
	_tmp11_ = _tmp10_;
	gtk_widget_grab_focus (_tmp11_);
	_g_object_unref0 (_tmp11_);
}

static void
games_display_view_load_latest_snapshot (GamesDisplayView* self)
{
	GamesSnapshot** snapshots = NULL;
	GamesRunner* _tmp0_;
	GamesRunner* _tmp1_;
	gint _tmp2_ = 0;
	GamesSnapshot** _tmp3_;
	gint snapshots_length1;
	gint _snapshots_size_;
	GamesSnapshot** _tmp4_;
	gint _tmp4__length1;
	GamesRunner* _tmp5_;
	GamesRunner* _tmp6_;
	GamesRunner* _tmp7_;
	GamesRunner* _tmp8_;
	GamesSnapshot** _tmp9_;
	gint _tmp9__length1;
	GamesSnapshot* _tmp10_;
	GamesRunner* _tmp15_;
	GamesRunner* _tmp16_;
	GamesRunner* _tmp17_;
	GamesRunner* _tmp18_;
	GtkWidget* _tmp19_;
	GtkWidget* _tmp20_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = games_display_view_get_runner (self);
	_tmp1_ = _tmp0_;
	_tmp3_ = games_runner_get_snapshots (_tmp1_, &_tmp2_);
	snapshots = _tmp3_;
	snapshots_length1 = _tmp2_;
	_snapshots_size_ = snapshots_length1;
	_tmp4_ = snapshots;
	_tmp4__length1 = snapshots_length1;
	if (_tmp4__length1 == 0) {
		snapshots = (_vala_array_free (snapshots, snapshots_length1, (GDestroyNotify) g_object_unref), NULL);
		return;
	}
	_tmp5_ = games_display_view_get_runner (self);
	_tmp6_ = _tmp5_;
	games_runner_pause (_tmp6_);
	_tmp7_ = games_display_view_get_runner (self);
	_tmp8_ = _tmp7_;
	_tmp9_ = snapshots;
	_tmp9__length1 = snapshots_length1;
	_tmp10_ = _tmp9_[0];
	games_runner_preview_snapshot (_tmp8_, _tmp10_);
	{
		GamesRunner* _tmp11_;
		GamesRunner* _tmp12_;
		_tmp11_ = games_display_view_get_runner (self);
		_tmp12_ = _tmp11_;
		games_runner_load_previewed_snapshot (_tmp12_, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp13_;
		const gchar* _tmp14_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp13_ = e;
		_tmp14_ = _tmp13_->message;
		g_warning ("display-view.vala:278: Failed to load snapshot: %s", _tmp14_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		snapshots = (_vala_array_free (snapshots, snapshots_length1, (GDestroyNotify) g_object_unref), NULL);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp15_ = games_display_view_get_runner (self);
	_tmp16_ = _tmp15_;
	games_runner_resume (_tmp16_);
	_tmp17_ = games_display_view_get_runner (self);
	_tmp18_ = _tmp17_;
	_tmp19_ = games_runner_get_display (_tmp18_);
	_tmp20_ = _tmp19_;
	gtk_widget_grab_focus (_tmp20_);
	_g_object_unref0 (_tmp20_);
	snapshots = (_vala_array_free (snapshots, snapshots_length1, (GDestroyNotify) g_object_unref), NULL);
}

static gboolean
games_display_view_real_gamepad_button_press_event (GamesUiView* base,
                                                    ManetteEvent* event)
{
	GamesDisplayView * self;
	GtkMessageDialog* _tmp0_;
	GtkMessageDialog* _tmp2_;
	GtkMessageDialog* _tmp4_;
	GtkMessageDialog* _tmp6_;
	gboolean _tmp8_ = FALSE;
	GtkWindow* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	guint16 button = 0U;
	guint16 _tmp13_ = 0U;
	gboolean _tmp14_;
	GamesRunner* _tmp15_;
	GamesRunner* _tmp16_;
	GamesRunner* _tmp17_;
	GamesRunner* _tmp18_;
	gboolean result;
	self = (GamesDisplayView*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = self->priv->resume_dialog;
	if (_tmp0_ != NULL) {
		GtkMessageDialog* _tmp1_;
		_tmp1_ = self->priv->resume_dialog;
		result = games_display_view_handle_dialog_gamepad_button_press_event (self, (GtkDialog*) _tmp1_, event);
		return result;
	}
	_tmp2_ = self->priv->resume_failed_dialog;
	if (_tmp2_ != NULL) {
		GtkMessageDialog* _tmp3_;
		_tmp3_ = self->priv->resume_failed_dialog;
		result = games_display_view_handle_dialog_gamepad_button_press_event (self, (GtkDialog*) _tmp3_, event);
		return result;
	}
	_tmp4_ = self->priv->quit_dialog;
	if (_tmp4_ != NULL) {
		GtkMessageDialog* _tmp5_;
		_tmp5_ = self->priv->quit_dialog;
		result = games_display_view_handle_dialog_gamepad_button_press_event (self, (GtkDialog*) _tmp5_, event);
		return result;
	}
	_tmp6_ = self->priv->restart_dialog;
	if (_tmp6_ != NULL) {
		GtkMessageDialog* _tmp7_;
		_tmp7_ = self->priv->restart_dialog;
		result = games_display_view_handle_dialog_gamepad_button_press_event (self, (GtkDialog*) _tmp7_, event);
		return result;
	}
	_tmp9_ = self->priv->_window;
	g_object_get (_tmp9_, "is-active", &_tmp10_, NULL);
	_tmp11_ = _tmp10_;
	if (!_tmp11_) {
		_tmp8_ = TRUE;
	} else {
		GtkWindow* _tmp12_;
		_tmp12_ = self->priv->_window;
		_tmp8_ = !gtk_widget_get_mapped ((GtkWidget*) _tmp12_);
	}
	if (_tmp8_) {
		result = FALSE;
		return result;
	}
	_tmp14_ = manette_event_get_button (event, &_tmp13_);
	button = _tmp13_;
	if (!_tmp14_) {
		result = FALSE;
		return result;
	}
	if (!gtk_widget_get_mapped ((GtkWidget*) self)) {
		result = FALSE;
		return result;
	}
	_tmp15_ = games_display_view_get_runner (self);
	_tmp16_ = _tmp15_;
	if (_tmp16_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp17_ = games_display_view_get_runner (self);
	_tmp18_ = _tmp17_;
	if (games_runner_gamepad_button_press_event (_tmp18_, button)) {
		result = TRUE;
		return result;
	}
	switch (button) {
		case BTN_MODE:
		{
			games_display_view_on_display_back (self);
			result = TRUE;
			return result;
		}
		default:
		{
			result = FALSE;
			return result;
		}
	}
}

static gboolean
games_display_view_real_gamepad_button_release_event (GamesUiView* base,
                                                      ManetteEvent* event)
{
	GamesDisplayView * self;
	gboolean result;
	self = (GamesDisplayView*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	result = FALSE;
	return result;
}

static gboolean
games_display_view_real_gamepad_absolute_axis_event (GamesUiView* base,
                                                     ManetteEvent* event)
{
	GamesDisplayView * self;
	gboolean result;
	self = (GamesDisplayView*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	result = FALSE;
	return result;
}

static void
games_display_view_on_display_back (GamesDisplayView* self)
{
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_is_showing_snapshots;
	if (_tmp0_) {
		GamesRunner* _tmp1_;
		GamesRunner* _tmp2_;
		_tmp1_ = games_display_view_get_runner (self);
		_tmp2_ = _tmp1_;
		games_runner_preview_current_state (_tmp2_);
		games_display_view_set_is_showing_snapshots (self, FALSE);
		return;
	}
	g_signal_emit (self, games_display_view_signals[GAMES_DISPLAY_VIEW_BACK_SIGNAL], 0);
}

static void
games_display_view_run_game_data_free (gpointer _data)
{
	GamesDisplayViewRunGameData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->game);
	_g_object_unref0 (_data_->self);
	g_slice_free (GamesDisplayViewRunGameData, _data_);
}

void
games_display_view_run_game (GamesDisplayView* self,
                             GamesGame* game,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	GamesDisplayViewRunGameData* _data_;
	GamesDisplayView* _tmp0_;
	GamesGame* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (game != NULL);
	_data_ = g_slice_new0 (GamesDisplayViewRunGameData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, games_display_view_run_game_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (game);
	_g_object_unref0 (_data_->game);
	_data_->game = _tmp1_;
	games_display_view_run_game_co (_data_);
}

void
games_display_view_run_game_finish (GamesDisplayView* self,
                                    GAsyncResult* _res_)
{
	GamesDisplayViewRunGameData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
games_display_view_run_game_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_)
{
	GamesDisplayViewRunGameData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	games_display_view_run_game_co (_data_);
}

static gboolean
games_display_view_run_game_co (GamesDisplayViewRunGameData* _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_->_tmp1_ = games_display_view_get_runner (_data_->self);
	_data_->_tmp2_ = _data_->_tmp1_;
	if (_data_->_tmp2_ != NULL) {
		_data_->_state_ = 1;
		games_display_view_quit_game (_data_->self, games_display_view_run_game_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp0_ = !games_display_view_quit_game_finish (_data_->self, _data_->_res_);
	} else {
		_data_->_tmp0_ = FALSE;
	}
	if (_data_->_tmp0_) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = _g_object_ref0 (_data_->game);
	_g_object_unref0 (_data_->self->priv->game);
	_data_->self->priv->game = _data_->_tmp3_;
	_data_->_tmp4_ = _data_->self->priv->run_game_cancellable;
	if (_data_->_tmp4_ != NULL) {
		_data_->_tmp5_ = _data_->self->priv->run_game_cancellable;
		g_cancellable_cancel (_data_->_tmp5_);
	}
	_data_->_tmp6_ = g_cancellable_new ();
	_data_->cancellable = _data_->_tmp6_;
	_data_->_tmp7_ = _data_->cancellable;
	_data_->_tmp8_ = _g_object_ref0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->self->priv->run_game_cancellable);
	_data_->self->priv->run_game_cancellable = _data_->_tmp8_;
	_data_->_tmp9_ = _data_->cancellable;
	_data_->_state_ = 2;
	games_display_view_run_game_with_cancellable (_data_->self, _data_->game, _data_->_tmp9_, games_display_view_run_game_ready, _data_);
	return FALSE;
	_state_2:
	games_display_view_run_game_with_cancellable_finish (_data_->self, _data_->_res_);
	_data_->_tmp10_ = _data_->self->priv->run_game_cancellable;
	_data_->_tmp11_ = _data_->cancellable;
	if (_data_->_tmp10_ == _data_->_tmp11_) {
		_g_object_unref0 (_data_->self->priv->run_game_cancellable);
		_data_->self->priv->run_game_cancellable = NULL;
	}
	_g_object_unref0 (_data_->cancellable);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
games_display_view_run_game_with_cancellable_data_free (gpointer _data)
{
	GamesDisplayViewRunGameWithCancellableData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->game);
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (GamesDisplayViewRunGameWithCancellableData, _data_);
}

static void
games_display_view_run_game_with_cancellable (GamesDisplayView* self,
                                              GamesGame* game,
                                              GCancellable* cancellable,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	GamesDisplayViewRunGameWithCancellableData* _data_;
	GamesDisplayView* _tmp0_;
	GamesGame* _tmp1_;
	GCancellable* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (game != NULL);
	g_return_if_fail (cancellable != NULL);
	_data_ = g_slice_new0 (GamesDisplayViewRunGameWithCancellableData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, games_display_view_run_game_with_cancellable_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (game);
	_g_object_unref0 (_data_->game);
	_data_->game = _tmp1_;
	_tmp2_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp2_;
	games_display_view_run_game_with_cancellable_co (_data_);
}

static void
games_display_view_run_game_with_cancellable_finish (GamesDisplayView* self,
                                                     GAsyncResult* _res_)
{
	GamesDisplayViewRunGameWithCancellableData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	if (NULL == _data_) {
		return;
	}
}

static void
__lambda60_ (GamesDisplayView* self,
             const gchar* message)
{
	GamesRunner* _tmp0_;
	GamesRunner* _tmp1_;
	GCancellable* _tmp2_;
	GCancellable* _tmp4_;
	GtkStack* _tmp6_;
	HdyStatusPage* _tmp7_;
	HdyStatusPage* _tmp8_;
	HdyStatusPage* _tmp9_;
	GtkButton* _tmp10_;
	g_return_if_fail (message != NULL);
	_tmp0_ = games_display_view_get_runner (self);
	_tmp1_ = _tmp0_;
	games_runner_stop (_tmp1_);
	games_display_view_reset_display_page (self);
	_tmp2_ = self->priv->run_game_cancellable;
	if (_tmp2_ != NULL) {
		GCancellable* _tmp3_;
		_tmp3_ = self->priv->run_game_cancellable;
		g_cancellable_cancel (_tmp3_);
	}
	_tmp4_ = self->priv->quit_game_cancellable;
	if (_tmp4_ != NULL) {
		GCancellable* _tmp5_;
		_tmp5_ = self->priv->quit_game_cancellable;
		g_cancellable_cancel (_tmp5_);
	}
	_tmp6_ = self->priv->stack;
	_tmp7_ = self->priv->error_display;
	gtk_stack_set_visible_child (_tmp6_, (GtkWidget*) _tmp7_);
	games_display_view_set_is_showing_snapshots (self, FALSE);
	_tmp8_ = self->priv->error_display;
	hdy_status_page_set_title (_tmp8_, _ ("Oops! The game crashed unexpectedly"));
	_tmp9_ = self->priv->error_display;
	hdy_status_page_set_description (_tmp9_, message);
	_tmp10_ = self->priv->restart_btn;
	gtk_widget_show ((GtkWidget*) _tmp10_);
}

static void
___lambda60__games_runner_crash (GamesRunner* _sender,
                                 const gchar* message,
                                 gpointer self)
{
	__lambda60_ ((GamesDisplayView*) self, message);
}

static void
games_display_view_run_game_with_cancellable_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	GamesDisplayViewRunGameWithCancellableData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	games_display_view_run_game_with_cancellable_co (_data_);
}

static gboolean
games_display_view_run_game_with_cancellable_co (GamesDisplayViewRunGameWithCancellableData* _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_ = games_game_get_name (_data_->game);
	_data_->_tmp1_ = _data_->_tmp0_;
	games_display_view_set_game_title (_data_->self, _data_->_tmp1_);
	games_display_view_reset_display_page (_data_->self);
	_data_->_tmp2_ = games_display_view_try_get_runner (_data_->self, _data_->game);
	_data_->_tmp3_ = _data_->_tmp2_;
	games_display_view_set_runner (_data_->self, _data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp3_);
	_data_->_tmp4_ = games_display_view_get_runner (_data_->self);
	_data_->_tmp5_ = _data_->_tmp4_;
	if (_data_->_tmp5_ == NULL) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp6_ = games_display_view_get_runner (_data_->self);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = games_runner_get_can_fullscreen (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	games_display_view_set_can_fullscreen (_data_->self, _data_->_tmp9_);
	_data_->_tmp10_ = _data_->self->priv->media_button;
	_data_->_tmp11_ = games_display_view_get_runner (_data_->self);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp13_ = games_runner_get_media_set (_data_->_tmp12_);
	_data_->_tmp14_ = _data_->_tmp13_;
	games_media_menu_button_set_media_set (_data_->_tmp10_, _data_->_tmp14_);
	_data_->_tmp15_ = games_display_view_get_runner (_data_->self);
	_data_->_tmp16_ = _data_->_tmp15_;
	g_signal_connect_object (_data_->_tmp16_, "crash", (GCallback) ___lambda60__games_runner_crash, _data_->self, 0);
	games_display_view_update_actions (_data_->self);
	_data_->_tmp18_ = _data_->self->priv->settings;
	if (g_settings_get_boolean (_data_->_tmp18_, "fullscreen")) {
		_data_->_tmp19_ = _data_->self->priv->_can_fullscreen;
		_data_->_tmp17_ = _data_->_tmp19_;
	} else {
		_data_->_tmp17_ = FALSE;
	}
	games_display_view_set_is_fullscreen (_data_->self, _data_->_tmp17_);
	_data_->_tmp20_ = games_display_view_get_runner (_data_->self);
	_data_->_tmp21_ = _data_->_tmp20_;
	_data_->_tmp22_ = games_runner_get_can_resume (_data_->_tmp21_);
	_data_->_tmp23_ = _data_->_tmp22_;
	if (!_data_->_tmp23_) {
		_data_->_tmp24_ = games_display_view_get_runner (_data_->self);
		_data_->_tmp25_ = _data_->_tmp24_;
		games_display_view_start_or_resume (_data_->self, _data_->_tmp25_, FALSE);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_state_ = 1;
	games_display_view_prompt_resume_with_cancellable (_data_->self, _data_->cancellable, games_display_view_run_game_with_cancellable_ready, _data_);
	return FALSE;
	_state_1:
	_data_->response = games_display_view_prompt_resume_with_cancellable_finish (_data_->self, _data_->_res_);
	if (_data_->response == GTK_RESPONSE_NONE) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp26_ = games_display_view_get_runner (_data_->self);
	_data_->_tmp27_ = _data_->_tmp26_;
	if (!games_display_view_start_or_resume (_data_->self, _data_->_tmp27_, _data_->response == GTK_RESPONSE_ACCEPT)) {
		_data_->_tmp28_ = games_display_view_get_runner (_data_->self);
		_data_->_tmp29_ = _data_->_tmp28_;
		_data_->_state_ = 2;
		games_display_view_prompt_resume_fail_with_cancellable (_data_->self, _data_->_tmp29_, _data_->cancellable, games_display_view_run_game_with_cancellable_ready, _data_);
		return FALSE;
		_state_2:
		games_display_view_prompt_resume_fail_with_cancellable_finish (_data_->self, _data_->_res_);
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static GamesRunner*
games_display_view_try_get_runner (GamesDisplayView* self,
                                   GamesGame* game)
{
	GamesGameCollection* collection = NULL;
	GamesApplication* _tmp0_;
	GamesApplication* _tmp1_;
	GamesGameCollection* _tmp2_;
	GamesGameCollection* _tmp3_;
	GamesRunner* runner = NULL;
	GamesGameCollection* _tmp4_;
	GamesRunner* _tmp5_;
	GamesRunner* _tmp6_;
	GError* _inner_error0_ = NULL;
	GamesRunner* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (game != NULL, NULL);
	_tmp0_ = games_application_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = games_application_get_collection (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (_tmp1_);
	collection = _tmp3_;
	_tmp4_ = collection;
	_tmp5_ = games_game_collection_create_runner (_tmp4_, game);
	runner = _tmp5_;
	_tmp6_ = runner;
	_vala_assert (_tmp6_ != NULL, "runner != null");
	{
		GamesRunner* _tmp7_;
		_tmp7_ = runner;
		games_runner_prepare (_tmp7_, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == GAMES_RUNNER_ERROR) {
				goto __catch0_games_runner_error;
			}
			_g_object_unref0 (runner);
			_g_object_unref0 (collection);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	goto __finally0;
	__catch0_games_runner_error:
	{
		GError* e = NULL;
		GtkStack* _tmp8_;
		HdyStatusPage* _tmp9_;
		HdyStatusPage* _tmp10_;
		HdyStatusPage* _tmp11_;
		GError* _tmp12_;
		const gchar* _tmp13_;
		GtkButton* _tmp14_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		games_display_view_reset_display_page (self);
		_tmp8_ = self->priv->stack;
		_tmp9_ = self->priv->error_display;
		gtk_stack_set_visible_child (_tmp8_, (GtkWidget*) _tmp9_);
		_tmp10_ = self->priv->error_display;
		hdy_status_page_set_title (_tmp10_, _ ("Oops! Unable to run the game"));
		_tmp11_ = self->priv->error_display;
		_tmp12_ = e;
		_tmp13_ = _tmp12_->message;
		hdy_status_page_set_description (_tmp11_, _tmp13_);
		_tmp14_ = self->priv->restart_btn;
		gtk_widget_hide ((GtkWidget*) _tmp14_);
		result = NULL;
		_g_error_free0 (e);
		_g_object_unref0 (runner);
		_g_object_unref0 (collection);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (runner);
		_g_object_unref0 (collection);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	result = runner;
	_g_object_unref0 (collection);
	return result;
}

static void
games_display_view_prompt_resume_with_cancellable_data_free (gpointer _data)
{
	GamesDisplayViewPromptResumeWithCancellableData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (GamesDisplayViewPromptResumeWithCancellableData, _data_);
}

static void
games_display_view_prompt_resume_with_cancellable (GamesDisplayView* self,
                                                   GCancellable* cancellable,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_)
{
	GamesDisplayViewPromptResumeWithCancellableData* _data_;
	GamesDisplayView* _tmp0_;
	GCancellable* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (cancellable != NULL);
	_data_ = g_slice_new0 (GamesDisplayViewPromptResumeWithCancellableData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, games_display_view_prompt_resume_with_cancellable_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp1_;
	games_display_view_prompt_resume_with_cancellable_co (_data_);
}

static GtkResponseType
games_display_view_prompt_resume_with_cancellable_finish (GamesDisplayView* self,
                                                          GAsyncResult* _res_)
{
	GtkResponseType result;
	GamesDisplayViewPromptResumeWithCancellableData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	if (NULL == _data_) {
		return 0;
	}
	result = _data_->result;
	return result;
}

static void
__lambda61_ (GamesDisplayView* self)
{
	GtkMessageDialog* _tmp0_;
	_tmp0_ = self->priv->resume_dialog;
	gtk_widget_destroy ((GtkWidget*) _tmp0_);
	_g_object_unref0 (self->priv->resume_dialog);
	self->priv->resume_dialog = NULL;
}

static void
___lambda61__g_cancellable_cancelled (GCancellable* _sender,
                                      gpointer self)
{
	__lambda61_ ((GamesDisplayView*) self);
}

static void
games_display_view_prompt_resume_with_cancellable_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_)
{
	GamesDisplayViewPromptResumeWithCancellableData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	games_display_view_prompt_resume_with_cancellable_co (_data_);
}

static gboolean
games_display_view_prompt_resume_with_cancellable_co (GamesDisplayViewPromptResumeWithCancellableData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->resume_dialog;
	if (_data_->_tmp0_ != NULL) {
		_data_->result = GTK_RESPONSE_NONE;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp1_ = _data_->self->priv->_window;
	_data_->_tmp2_ = (GtkMessageDialog*) gtk_message_dialog_new (_data_->_tmp1_, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, "%s", _ ("Resume last game?"));
	g_object_ref_sink (_data_->_tmp2_);
	_g_object_unref0 (_data_->self->priv->resume_dialog);
	_data_->self->priv->resume_dialog = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->self->priv->resume_dialog;
	gtk_dialog_add_button ((GtkDialog*) _data_->_tmp3_, _ ("Restart"), (gint) GTK_RESPONSE_CANCEL);
	_data_->_tmp4_ = _data_->self->priv->resume_dialog;
	gtk_dialog_add_button ((GtkDialog*) _data_->_tmp4_, _ ("Resume"), (gint) GTK_RESPONSE_ACCEPT);
	_data_->_tmp5_ = _data_->self->priv->resume_dialog;
	gtk_dialog_set_default_response ((GtkDialog*) _data_->_tmp5_, (gint) GTK_RESPONSE_ACCEPT);
	g_signal_connect_object (_data_->cancellable, "cancelled", (GCallback) ___lambda61__g_cancellable_cancelled, _data_->self, 0);
	_data_->_tmp6_ = _data_->self->priv->resume_dialog;
	_data_->_state_ = 1;
	games_display_view_run_dialog_async (_data_->self, (GtkDialog*) _data_->_tmp6_, games_display_view_prompt_resume_with_cancellable_ready, _data_);
	return FALSE;
	_state_1:
	_data_->response = games_display_view_run_dialog_finish (_data_->self, _data_->_res_);
	_data_->_tmp7_ = _data_->self->priv->resume_dialog;
	if (_data_->_tmp7_ != NULL) {
		_data_->_tmp8_ = _data_->self->priv->resume_dialog;
		gtk_widget_destroy ((GtkWidget*) _data_->_tmp8_);
		_g_object_unref0 (_data_->self->priv->resume_dialog);
		_data_->self->priv->resume_dialog = NULL;
	}
	_data_->result = (GtkResponseType) _data_->response;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static gboolean
games_display_view_start_or_resume (GamesDisplayView* self,
                                    GamesRunner* runner,
                                    gboolean resume)
{
	gboolean _tmp2_ = FALSE;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (runner != NULL, FALSE);
	{
		if (resume) {
			games_runner_load_previewed_snapshot (runner, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		games_runner_start (runner, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		result = TRUE;
		return result;
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp0_;
		const gchar* _tmp1_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp0_ = e;
		_tmp1_ = _tmp0_->message;
		g_warning ("display-view.vala:481: %s", _tmp1_);
		result = FALSE;
		_g_error_free0 (e);
		return result;
	}
	__finally0:
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
	g_clear_error (&_inner_error0_);
	return _tmp2_;
}

static void
games_display_view_prompt_resume_fail_with_cancellable_data_free (gpointer _data)
{
	GamesDisplayViewPromptResumeFailWithCancellableData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->runner);
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (GamesDisplayViewPromptResumeFailWithCancellableData, _data_);
}

static void
games_display_view_prompt_resume_fail_with_cancellable (GamesDisplayView* self,
                                                        GamesRunner* runner,
                                                        GCancellable* cancellable,
                                                        GAsyncReadyCallback _callback_,
                                                        gpointer _user_data_)
{
	GamesDisplayViewPromptResumeFailWithCancellableData* _data_;
	GamesDisplayView* _tmp0_;
	GamesRunner* _tmp1_;
	GCancellable* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (runner != NULL);
	g_return_if_fail (cancellable != NULL);
	_data_ = g_slice_new0 (GamesDisplayViewPromptResumeFailWithCancellableData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, games_display_view_prompt_resume_fail_with_cancellable_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (runner);
	_g_object_unref0 (_data_->runner);
	_data_->runner = _tmp1_;
	_tmp2_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp2_;
	games_display_view_prompt_resume_fail_with_cancellable_co (_data_);
}

static void
games_display_view_prompt_resume_fail_with_cancellable_finish (GamesDisplayView* self,
                                                               GAsyncResult* _res_)
{
	GamesDisplayViewPromptResumeFailWithCancellableData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	if (NULL == _data_) {
		return;
	}
}

static void
__lambda62_ (GamesDisplayView* self)
{
	GtkMessageDialog* _tmp0_;
	_tmp0_ = self->priv->resume_failed_dialog;
	gtk_widget_destroy ((GtkWidget*) _tmp0_);
	_g_object_unref0 (self->priv->resume_failed_dialog);
	self->priv->resume_failed_dialog = NULL;
}

static void
___lambda62__g_cancellable_cancelled (GCancellable* _sender,
                                      gpointer self)
{
	__lambda62_ ((GamesDisplayView*) self);
}

static void
games_display_view_prompt_resume_fail_with_cancellable_ready (GObject* source_object,
                                                              GAsyncResult* _res_,
                                                              gpointer _user_data_)
{
	GamesDisplayViewPromptResumeFailWithCancellableData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	games_display_view_prompt_resume_fail_with_cancellable_co (_data_);
}

static gboolean
games_display_view_prompt_resume_fail_with_cancellable_co (GamesDisplayViewPromptResumeFailWithCancellableData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->resume_failed_dialog;
	if (_data_->_tmp0_ != NULL) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp1_ = _data_->self->priv->_window;
	_data_->_tmp2_ = (GtkMessageDialog*) gtk_message_dialog_new (_data_->_tmp1_, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_CANCEL, "%s", _ ("Resume last game?"));
	g_object_ref_sink (_data_->_tmp2_);
	_g_object_unref0 (_data_->self->priv->resume_failed_dialog);
	_data_->self->priv->resume_failed_dialog = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->self->priv->resume_failed_dialog;
	gtk_dialog_add_button ((GtkDialog*) _data_->_tmp3_, C_ ("Resuming a game failed dialog", "Reset"), (gint) GTK_RESPONSE_ACCEPT);
	g_signal_connect_object (_data_->cancellable, "cancelled", (GCallback) ___lambda62__g_cancellable_cancelled, _data_->self, 0);
	_data_->_tmp4_ = _data_->self->priv->resume_failed_dialog;
	_data_->_state_ = 1;
	games_display_view_run_dialog_async (_data_->self, (GtkDialog*) _data_->_tmp4_, games_display_view_prompt_resume_fail_with_cancellable_ready, _data_);
	return FALSE;
	_state_1:
	_data_->response = games_display_view_run_dialog_finish (_data_->self, _data_->_res_);
	_data_->_tmp5_ = _data_->self->priv->resume_failed_dialog;
	gtk_widget_destroy ((GtkWidget*) _data_->_tmp5_);
	_g_object_unref0 (_data_->self->priv->resume_failed_dialog);
	_data_->self->priv->resume_failed_dialog = NULL;
	if (g_cancellable_is_cancelled (_data_->cancellable)) {
		_data_->response = GTK_RESPONSE_CANCEL;
	}
	if (_data_->response == GTK_RESPONSE_CANCEL) {
		GamesRunner* _tmp6_;
		_tmp6_ = _g_object_ref0 (NULL);
		_g_object_unref0 (_data_->runner);
		_data_->runner = _tmp6_;
		g_signal_emit (_data_->self, games_display_view_signals[GAMES_DISPLAY_VIEW_BACK_SIGNAL], 0);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	{
		games_runner_start (_data_->runner, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp7_ = _data_->e;
		_data_->_tmp8_ = _data_->_tmp7_->message;
		g_warning ("display-view.vala:526: %s", _data_->_tmp8_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

void
games_display_view_quit_game (GamesDisplayView* self,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	GamesDisplayViewQuitGameData* _data_;
	GamesDisplayView* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GamesDisplayViewQuitGameData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, games_display_view_quit_game_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	games_display_view_quit_game_co (_data_);
}

gboolean
games_display_view_quit_game_finish (GamesDisplayView* self,
                                     GAsyncResult* _res_)
{
	gboolean result;
	GamesDisplayViewQuitGameData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
games_display_view_quit_game_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	GamesDisplayViewQuitGameData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	games_display_view_quit_game_co (_data_);
}

static gboolean
games_display_view_quit_game_co (GamesDisplayViewQuitGameData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->run_game_cancellable;
	if (_data_->_tmp0_ != NULL) {
		_data_->_tmp1_ = _data_->self->priv->run_game_cancellable;
		g_cancellable_cancel (_data_->_tmp1_);
	}
	_data_->_tmp2_ = _data_->self->priv->quit_game_cancellable;
	if (_data_->_tmp2_ != NULL) {
		_data_->_tmp3_ = _data_->self->priv->quit_game_cancellable;
		g_cancellable_cancel (_data_->_tmp3_);
	}
	_data_->_tmp4_ = g_cancellable_new ();
	_data_->cancellable = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->cancellable;
	_data_->_tmp6_ = _g_object_ref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->self->priv->quit_game_cancellable);
	_data_->self->priv->quit_game_cancellable = _data_->_tmp6_;
	_data_->_tmp7_ = _data_->cancellable;
	_data_->_state_ = 1;
	games_display_view_quit_game_with_cancellable (_data_->self, _data_->_tmp7_, games_display_view_quit_game_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_result_ = games_display_view_quit_game_with_cancellable_finish (_data_->self, _data_->_res_);
	_data_->_tmp8_ = _data_->self->priv->quit_game_cancellable;
	_data_->_tmp9_ = _data_->cancellable;
	if (_data_->_tmp8_ == _data_->_tmp9_) {
		_g_object_unref0 (_data_->self->priv->quit_game_cancellable);
		_data_->self->priv->quit_game_cancellable = NULL;
	}
	_data_->result = _data_->_result_;
	_g_object_unref0 (_data_->cancellable);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
games_display_view_quit_game_with_cancellable_data_free (gpointer _data)
{
	GamesDisplayViewQuitGameWithCancellableData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->self);
	g_slice_free (GamesDisplayViewQuitGameWithCancellableData, _data_);
}

static void
games_display_view_quit_game_with_cancellable (GamesDisplayView* self,
                                               GCancellable* cancellable,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_)
{
	GamesDisplayViewQuitGameWithCancellableData* _data_;
	GamesDisplayView* _tmp0_;
	GCancellable* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (cancellable != NULL);
	_data_ = g_slice_new0 (GamesDisplayViewQuitGameWithCancellableData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, games_display_view_quit_game_with_cancellable_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp1_;
	games_display_view_quit_game_with_cancellable_co (_data_);
}

static gboolean
games_display_view_quit_game_with_cancellable_finish (GamesDisplayView* self,
                                                      GAsyncResult* _res_)
{
	gboolean result;
	GamesDisplayViewQuitGameWithCancellableData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	if (NULL == _data_) {
		gboolean _tmp0_ = FALSE;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
__lambda58_ (GamesDisplayView* self)
{
	GtkMessageDialog* _tmp0_;
	_tmp0_ = self->priv->quit_dialog;
	gtk_widget_destroy ((GtkWidget*) _tmp0_);
	_g_object_unref0 (self->priv->quit_dialog);
	self->priv->quit_dialog = NULL;
}

static void
___lambda58__g_cancellable_cancelled (GCancellable* _sender,
                                      gpointer self)
{
	__lambda58_ ((GamesDisplayView*) self);
}

static void
games_display_view_quit_game_with_cancellable_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_)
{
	GamesDisplayViewQuitGameWithCancellableData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	games_display_view_quit_game_with_cancellable_co (_data_);
}

static gboolean
games_display_view_quit_game_with_cancellable_co (GamesDisplayViewQuitGameWithCancellableData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = games_display_view_get_runner (_data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	if (_data_->_tmp1_ == NULL) {
		_data_->result = TRUE;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp2_ = games_display_view_get_runner (_data_->self);
	_data_->_tmp3_ = _data_->_tmp2_;
	games_runner_pause (_data_->_tmp3_);
	_data_->_tmp4_ = games_display_view_get_runner (_data_->self);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = games_runner_get_is_integrated (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	if (!_data_->_tmp7_) {
		_data_->_tmp8_ = games_display_view_get_runner (_data_->self);
		_data_->_tmp9_ = _data_->_tmp8_;
		games_runner_stop (_data_->_tmp9_);
		_data_->result = TRUE;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp10_ = games_display_view_get_runner (_data_->self);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp12_ = games_runner_try_create_snapshot (_data_->_tmp11_, TRUE);
	_data_->_tmp13_ = _data_->_tmp12_;
	_data_->_tmp14_ = _data_->_tmp13_ != NULL;
	_g_object_unref0 (_data_->_tmp13_);
	if (_data_->_tmp14_) {
		_data_->_tmp15_ = games_display_view_get_runner (_data_->self);
		_data_->_tmp16_ = _data_->_tmp15_;
		games_runner_stop (_data_->_tmp16_);
		_data_->result = TRUE;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp17_ = _data_->self->priv->quit_dialog;
	if (_data_->_tmp17_ != NULL) {
		_data_->result = FALSE;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp18_ = _data_->self->priv->_window;
	_data_->_tmp19_ = (GtkMessageDialog*) gtk_message_dialog_new (_data_->_tmp18_, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_CANCEL, "%s", _ ("Are you sure you want to quit?"));
	g_object_ref_sink (_data_->_tmp19_);
	_g_object_unref0 (_data_->self->priv->quit_dialog);
	_data_->self->priv->quit_dialog = _data_->_tmp19_;
	_data_->_tmp20_ = _data_->self->priv->quit_dialog;
	gtk_message_dialog_format_secondary_text (_data_->_tmp20_, "%s", _ ("All unsaved progress will be lost."));
	_data_->_tmp21_ = _data_->self->priv->quit_dialog;
	_data_->_tmp22_ = gtk_dialog_add_button ((GtkDialog*) _data_->_tmp21_, _ ("Quit"), (gint) GTK_RESPONSE_ACCEPT);
	_data_->_tmp23_ = _g_object_ref0 (_data_->_tmp22_);
	_data_->button = _data_->_tmp23_;
	_data_->_tmp24_ = _data_->button;
	_data_->_tmp25_ = gtk_widget_get_style_context (_data_->_tmp24_);
	gtk_style_context_add_class (_data_->_tmp25_, "destructive-action");
	g_signal_connect_object (_data_->cancellable, "cancelled", (GCallback) ___lambda58__g_cancellable_cancelled, _data_->self, 0);
	_data_->_tmp26_ = _data_->self->priv->quit_dialog;
	_data_->_state_ = 1;
	games_display_view_run_dialog_async (_data_->self, (GtkDialog*) _data_->_tmp26_, games_display_view_quit_game_with_cancellable_ready, _data_);
	return FALSE;
	_state_1:
	_data_->response = games_display_view_run_dialog_finish (_data_->self, _data_->_res_);
	_data_->_tmp27_ = _data_->self->priv->quit_dialog;
	if (_data_->_tmp27_ != NULL) {
		_data_->_tmp28_ = _data_->self->priv->quit_dialog;
		gtk_widget_destroy ((GtkWidget*) _data_->_tmp28_);
		_g_object_unref0 (_data_->self->priv->quit_dialog);
		_data_->self->priv->quit_dialog = NULL;
	}
	if (g_cancellable_is_cancelled (_data_->cancellable)) {
		_data_->result = games_display_view_cancel_quitting_game (_data_->self);
		_g_object_unref0 (_data_->button);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->response == GTK_RESPONSE_ACCEPT) {
		_data_->result = TRUE;
		_g_object_unref0 (_data_->button);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = games_display_view_cancel_quitting_game (_data_->self);
	_g_object_unref0 (_data_->button);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static gboolean
games_display_view_cancel_quitting_game (GamesDisplayView* self)
{
	GamesRunner* _tmp0_;
	GamesRunner* _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = games_display_view_get_runner (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		GamesRunner* _tmp2_;
		GamesRunner* _tmp3_;
		_tmp2_ = games_display_view_get_runner (self);
		_tmp3_ = _tmp2_;
		games_runner_resume (_tmp3_);
	}
	result = FALSE;
	return result;
}

static void
games_display_view_reset_display_page (GamesDisplayView* self)
{
	GamesMediaMenuButton* _tmp0_;
	GtkMenuButton* _tmp1_;
	g_return_if_fail (self != NULL);
	games_display_view_set_can_fullscreen (self, FALSE);
	games_display_view_set_runner (self, NULL);
	_tmp0_ = self->priv->media_button;
	games_media_menu_button_set_media_set (_tmp0_, NULL);
	_tmp1_ = self->priv->secondary_menu_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, FALSE);
	games_display_view_set_extra_widget (self, NULL);
	games_display_view_update_actions (self);
}

static void
games_display_view_on_snapshots_hidden (GamesDisplayView* self)
{
	GtkWindow* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_window;
	g_object_get (_tmp0_, "is-active", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GamesRunner* _tmp3_;
		GamesRunner* _tmp4_;
		GamesRunner* _tmp5_;
		GamesRunner* _tmp6_;
		GtkWidget* _tmp7_;
		GtkWidget* _tmp8_;
		_tmp3_ = games_display_view_get_runner (self);
		_tmp4_ = _tmp3_;
		games_runner_resume (_tmp4_);
		_tmp5_ = games_display_view_get_runner (self);
		_tmp6_ = _tmp5_;
		_tmp7_ = games_runner_get_display (_tmp6_);
		_tmp8_ = _tmp7_;
		gtk_widget_grab_focus (_tmp8_);
		_g_object_unref0 (_tmp8_);
	}
}

static void
_games_display_view_on_snapshots_hidden_games_snapshots_list_hidden (GamesSnapshotsList* _sender,
                                                                     gpointer self)
{
	games_display_view_on_snapshots_hidden ((GamesDisplayView*) self);
}

void
games_display_view_update_pause (GamesDisplayView* self)
{
	GtkWindow* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	if (!games_display_view_can_update_pause (self)) {
		return;
	}
	_tmp0_ = self->priv->_window;
	g_object_get (_tmp0_, "is-active", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		gboolean _tmp3_;
		_tmp3_ = self->priv->_is_showing_snapshots;
		if (!_tmp3_) {
			GamesRunner* _tmp4_;
			GamesRunner* _tmp5_;
			GamesRunner* _tmp6_;
			GamesRunner* _tmp7_;
			GtkWidget* _tmp8_;
			GtkWidget* _tmp9_;
			_tmp4_ = games_display_view_get_runner (self);
			_tmp5_ = _tmp4_;
			games_runner_resume (_tmp5_);
			_tmp6_ = games_display_view_get_runner (self);
			_tmp7_ = _tmp6_;
			_tmp8_ = games_runner_get_display (_tmp7_);
			_tmp9_ = _tmp8_;
			gtk_widget_grab_focus (_tmp9_);
			_g_object_unref0 (_tmp9_);
		}
	} else {
		GamesRunner* _tmp10_;
		GamesRunner* _tmp11_;
		_tmp10_ = games_display_view_get_runner (self);
		_tmp11_ = _tmp10_;
		games_runner_pause (_tmp11_);
	}
}

static gboolean
games_display_view_can_update_pause (GamesDisplayView* self)
{
	GamesRunner* _tmp0_;
	GamesRunner* _tmp1_;
	GCancellable* _tmp2_;
	GCancellable* _tmp3_;
	GtkMessageDialog* _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = games_display_view_get_runner (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp2_ = self->priv->run_game_cancellable;
	if (_tmp2_ != NULL) {
		result = FALSE;
		return result;
	}
	_tmp3_ = self->priv->quit_game_cancellable;
	if (_tmp3_ != NULL) {
		result = FALSE;
		return result;
	}
	_tmp4_ = self->priv->restart_dialog;
	if (_tmp4_ != NULL) {
		result = FALSE;
		return result;
	}
	result = TRUE;
	return result;
}

static void
games_display_view_update_actions (GamesDisplayView* self)
{
	GSimpleAction* action = NULL;
	GSimpleActionGroup* _tmp0_;
	GAction* _tmp1_;
	GSimpleAction* _tmp2_;
	gboolean _tmp3_ = FALSE;
	GamesRunner* _tmp4_;
	GamesRunner* _tmp5_;
	GSimpleAction* _tmp10_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->action_group;
	_tmp1_ = g_action_map_lookup_action ((GActionMap*) _tmp0_, "show-snapshots");
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp1_) : NULL);
	action = _tmp2_;
	_tmp4_ = games_display_view_get_runner (self);
	_tmp5_ = _tmp4_;
	if (_tmp5_ != NULL) {
		GamesRunner* _tmp6_;
		GamesRunner* _tmp7_;
		gboolean _tmp8_;
		gboolean _tmp9_;
		_tmp6_ = games_display_view_get_runner (self);
		_tmp7_ = _tmp6_;
		_tmp8_ = games_runner_get_supports_snapshots (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp3_ = _tmp9_;
	} else {
		_tmp3_ = FALSE;
	}
	_tmp10_ = action;
	g_simple_action_set_enabled (_tmp10_, _tmp3_);
	_g_object_unref0 (action);
}

static void
games_display_view_load_snapshot (GamesDisplayView* self)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	{
		GamesRunner* _tmp0_;
		GamesRunner* _tmp1_;
		_tmp0_ = games_display_view_get_runner (self);
		_tmp1_ = _tmp0_;
		games_runner_load_previewed_snapshot (_tmp1_, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp2_;
		const gchar* _tmp3_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp2_ = e;
		_tmp3_ = _tmp2_->message;
		g_critical ("display-view.vala:675: Failed to load snapshot: %s", _tmp3_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	games_display_view_set_is_showing_snapshots (self, FALSE);
}

static void
games_display_view_show_snapshots (GamesDisplayView* self)
{
	gboolean _tmp0_ = FALSE;
	GamesRunner* _tmp1_;
	GamesRunner* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp1_ = games_display_view_get_runner (self);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != NULL) {
		GamesRunner* _tmp3_;
		GamesRunner* _tmp4_;
		gboolean _tmp5_;
		gboolean _tmp6_;
		_tmp3_ = games_display_view_get_runner (self);
		_tmp4_ = _tmp3_;
		_tmp5_ = games_runner_get_is_integrated (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp0_ = _tmp6_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		games_display_view_set_is_showing_snapshots (self, TRUE);
	}
}

static void
games_display_view_restart (GamesDisplayView* self)
{
	g_return_if_fail (self != NULL);
	games_display_view_restart_internal (self, NULL, NULL);
}

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

static void
games_display_view_restart_internal (GamesDisplayView* self,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	GamesDisplayViewRestartInternalData* _data_;
	GamesDisplayView* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (GamesDisplayViewRestartInternalData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, games_display_view_restart_internal_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	games_display_view_restart_internal_co (_data_);
}

static void
games_display_view_restart_internal_finish (GamesDisplayView* self,
                                            GAsyncResult* _res_)
{
	GamesDisplayViewRestartInternalData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
games_display_view_restart_internal_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_)
{
	GamesDisplayViewRestartInternalData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	games_display_view_restart_internal_co (_data_);
}

static gboolean
games_display_view_restart_internal_co (GamesDisplayViewRestartInternalData* _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_->_tmp1_ = games_display_view_get_runner (_data_->self);
	_data_->_tmp2_ = _data_->_tmp1_;
	if (_data_->_tmp2_ == NULL) {
		_data_->_tmp0_ = TRUE;
	} else {
		_data_->_tmp3_ = games_display_view_get_runner (_data_->self);
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_tmp5_ = games_runner_get_is_integrated (_data_->_tmp4_);
		_data_->_tmp6_ = _data_->_tmp5_;
		_data_->_tmp0_ = !_data_->_tmp6_;
	}
	if (_data_->_tmp0_) {
		_data_->_tmp7_ = _data_->self->priv->game;
		_data_->_state_ = 1;
		games_display_view_run_game (_data_->self, _data_->_tmp7_, games_display_view_restart_internal_ready, _data_);
		return FALSE;
		_state_1:
		games_display_view_run_game_finish (_data_->self, _data_->_res_);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp8_ = games_display_view_get_runner (_data_->self);
	_data_->_tmp9_ = _data_->_tmp8_;
	games_runner_pause (_data_->_tmp9_);
	_data_->_tmp10_ = games_display_view_get_runner (_data_->self);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp12_ = games_runner_try_create_snapshot (_data_->_tmp11_, TRUE);
	_data_->_tmp13_ = _data_->_tmp12_;
	_data_->_tmp14_ = _data_->_tmp13_ == NULL;
	_g_object_unref0 (_data_->_tmp13_);
	if (_data_->_tmp14_) {
		_data_->_tmp15_ = _data_->self->priv->_window;
		_data_->_tmp16_ = (GtkMessageDialog*) gtk_message_dialog_new (_data_->_tmp15_, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_CANCEL, "%s", _ ("Are you sure you want to restart?"));
		g_object_ref_sink (_data_->_tmp16_);
		_g_object_unref0 (_data_->self->priv->restart_dialog);
		_data_->self->priv->restart_dialog = _data_->_tmp16_;
		_data_->_tmp17_ = _data_->self->priv->restart_dialog;
		gtk_message_dialog_format_secondary_text (_data_->_tmp17_, "%s", _ ("All unsaved progress will be lost."));
		_data_->_tmp18_ = _data_->self->priv->restart_dialog;
		_data_->_tmp19_ = gtk_dialog_add_button ((GtkDialog*) _data_->_tmp18_, _ ("Restart"), (gint) GTK_RESPONSE_ACCEPT);
		_data_->_tmp20_ = _g_object_ref0 (_data_->_tmp19_);
		_data_->button = _data_->_tmp20_;
		_data_->_tmp21_ = _data_->button;
		_data_->_tmp22_ = gtk_widget_get_style_context (_data_->_tmp21_);
		gtk_style_context_add_class (_data_->_tmp22_, "destructive-action");
		_data_->_tmp23_ = _data_->self->priv->restart_dialog;
		_data_->_state_ = 2;
		games_display_view_run_dialog_async (_data_->self, (GtkDialog*) _data_->_tmp23_, games_display_view_restart_internal_ready, _data_);
		return FALSE;
		_state_2:
		_data_->response = games_display_view_run_dialog_finish (_data_->self, _data_->_res_);
		_data_->_tmp24_ = _data_->self->priv->restart_dialog;
		gtk_widget_destroy ((GtkWidget*) _data_->_tmp24_);
		_g_object_unref0 (_data_->self->priv->restart_dialog);
		_data_->self->priv->restart_dialog = NULL;
		if (_data_->response == GTK_RESPONSE_CANCEL) {
			_data_->_tmp25_ = TRUE;
		} else {
			_data_->_tmp25_ = _data_->response == GTK_RESPONSE_DELETE_EVENT;
		}
		if (_data_->_tmp25_) {
			_data_->_tmp26_ = games_display_view_get_runner (_data_->self);
			_data_->_tmp27_ = _data_->_tmp26_;
			games_runner_resume (_data_->_tmp27_);
			_g_object_unref0 (_data_->button);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_g_object_unref0 (_data_->button);
	}
	_data_->_tmp28_ = games_display_view_get_runner (_data_->self);
	_data_->_tmp29_ = _data_->_tmp28_;
	games_runner_stop (_data_->_tmp29_);
	_data_->_tmp30_ = _data_->self->priv->game;
	_data_->_tmp31_ = games_display_view_try_get_runner (_data_->self, _data_->_tmp30_);
	_data_->_tmp32_ = _data_->_tmp31_;
	games_display_view_set_runner (_data_->self, _data_->_tmp32_);
	_g_object_unref0 (_data_->_tmp32_);
	{
		_data_->_tmp33_ = games_display_view_get_runner (_data_->self);
		_data_->_tmp34_ = _data_->_tmp33_;
		games_runner_start (_data_->_tmp34_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp35_ = _data_->e;
		_data_->_tmp36_ = _data_->_tmp35_->message;
		g_critical ("display-view.vala:733: Couldn't restart: %s", _data_->_tmp36_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
games_display_view_set_display (GamesDisplayView* self,
                                GtkWidget* display)
{
	GamesDisplayBin* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (display != NULL);
	games_display_view_remove_display (self);
	_tmp0_ = self->priv->display_bin;
	gtk_container_add ((GtkContainer*) _tmp0_, display);
	gtk_widget_set_visible (display, TRUE);
}

static void
games_display_view_remove_display (GamesDisplayView* self)
{
	GtkWidget* child = NULL;
	GamesDisplayBin* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GtkWidget* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->display_bin;
	_tmp1_ = gtk_bin_get_child ((GtkBin*) _tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	child = _tmp2_;
	_tmp3_ = child;
	if (_tmp3_ != NULL) {
		GamesDisplayBin* _tmp4_;
		GtkWidget* _tmp5_;
		_tmp4_ = self->priv->display_bin;
		_tmp5_ = child;
		gtk_container_remove ((GtkContainer*) _tmp4_, _tmp5_);
	}
	_g_object_unref0 (child);
}

static void
games_display_view_real_size_allocate (GtkWidget* base,
                                       GtkAllocation* allocation)
{
	GamesDisplayView * self;
	GamesDisplayBin* _tmp0_;
	GtkAllocation _tmp1_;
	GtkAllocation _tmp2_;
	self = (GamesDisplayView*) base;
	g_return_if_fail (allocation != NULL);
	_tmp0_ = self->priv->display_bin;
	_tmp1_ = *allocation;
	games_display_bin_set_child_width (_tmp0_, _tmp1_.width);
	_tmp2_ = *allocation;
	GTK_WIDGET_CLASS (games_display_view_parent_class)->size_allocate ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_box_get_type (), GtkBox), &_tmp2_);
}

static void
games_display_view_update_fullscreen_box (GamesDisplayView* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GamesMediaMenuButton* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	gboolean is_menu_open = FALSE;
	gboolean _tmp15_ = FALSE;
	GamesFullscreenBox* _tmp17_;
	gboolean _tmp18_ = FALSE;
	gboolean _tmp19_;
	GamesFullscreenBox* _tmp21_;
	g_return_if_fail (self != NULL);
	_tmp2_ = self->priv->media_button;
	_tmp3_ = games_media_menu_button_get_active (_tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_) {
		_tmp1_ = TRUE;
	} else {
		GtkMenuButton* _tmp5_;
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp5_ = self->priv->secondary_menu_button;
		_tmp6_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp5_);
		_tmp7_ = _tmp6_;
		_tmp1_ = _tmp7_;
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		gboolean _tmp8_ = FALSE;
		GamesHeaderBarWidget* _tmp9_;
		GamesHeaderBarWidget* _tmp10_;
		_tmp9_ = games_display_view_get_extra_widget (self);
		_tmp10_ = _tmp9_;
		if (_tmp10_ != NULL) {
			GamesHeaderBarWidget* _tmp11_;
			GamesHeaderBarWidget* _tmp12_;
			gboolean _tmp13_;
			gboolean _tmp14_;
			_tmp11_ = games_display_view_get_extra_widget (self);
			_tmp12_ = _tmp11_;
			_tmp13_ = games_header_bar_widget_get_block_autohide (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp8_ = _tmp14_;
		} else {
			_tmp8_ = FALSE;
		}
		_tmp0_ = _tmp8_;
	}
	is_menu_open = _tmp0_;
	if (!is_menu_open) {
		gboolean _tmp16_;
		_tmp16_ = self->priv->_is_showing_snapshots;
		_tmp15_ = !_tmp16_;
	} else {
		_tmp15_ = FALSE;
	}
	_tmp17_ = self->priv->fullscreen_box;
	games_fullscreen_box_set_autohide (_tmp17_, _tmp15_);
	_tmp19_ = self->priv->_is_fullscreen;
	if (_tmp19_) {
		gboolean _tmp20_;
		_tmp20_ = self->priv->_is_showing_snapshots;
		_tmp18_ = !_tmp20_;
	} else {
		_tmp18_ = FALSE;
	}
	_tmp21_ = self->priv->fullscreen_box;
	games_fullscreen_box_set_overlay (_tmp21_, _tmp18_);
}

static void
_games_display_view_update_fullscreen_box_g_object_notify (GObject* _sender,
                                                           GParamSpec* pspec,
                                                           gpointer self)
{
	games_display_view_update_fullscreen_box ((GamesDisplayView*) self);
}

static void
games_display_view_on_fullscreen_changed (GamesDisplayView* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	GtkButton* _tmp3_;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_;
	GtkButton* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_can_fullscreen;
	if (_tmp1_) {
		gboolean _tmp2_;
		_tmp2_ = self->priv->_is_fullscreen;
		_tmp0_ = !_tmp2_;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp3_ = self->priv->fullscreen;
	gtk_widget_set_visible ((GtkWidget*) _tmp3_, _tmp0_);
	_tmp5_ = self->priv->_can_fullscreen;
	if (_tmp5_) {
		gboolean _tmp6_;
		_tmp6_ = self->priv->_is_fullscreen;
		_tmp4_ = _tmp6_;
	} else {
		_tmp4_ = FALSE;
	}
	_tmp7_ = self->priv->restore;
	gtk_widget_set_visible ((GtkWidget*) _tmp7_, _tmp4_);
	games_display_view_update_fullscreen_box (self);
}

static void
_games_display_view_on_fullscreen_changed_g_object_notify (GObject* _sender,
                                                           GParamSpec* pspec,
                                                           gpointer self)
{
	games_display_view_on_fullscreen_changed ((GamesDisplayView*) self);
}

static void
games_display_view_on_showing_snapshots_changed (GamesDisplayView* self)
{
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	games_display_view_update_fullscreen_box (self);
	_tmp0_ = self->priv->_is_showing_snapshots;
	if (_tmp0_) {
		GtkStack* _tmp1_;
		HdyHeaderBar* _tmp2_;
		_tmp1_ = self->priv->headerbar_stack;
		_tmp2_ = self->priv->snapshots_header_bar;
		gtk_stack_set_visible_child (_tmp1_, (GtkWidget*) _tmp2_);
	} else {
		GtkStack* _tmp3_;
		HdyHeaderBar* _tmp4_;
		_tmp3_ = self->priv->headerbar_stack;
		_tmp4_ = self->priv->ingame_header_bar;
		gtk_stack_set_visible_child (_tmp3_, (GtkWidget*) _tmp4_);
	}
}

static void
_games_display_view_on_showing_snapshots_changed_g_object_notify (GObject* _sender,
                                                                  GParamSpec* pspec,
                                                                  gpointer self)
{
	games_display_view_on_showing_snapshots_changed ((GamesDisplayView*) self);
}

static void
games_display_view_on_back_clicked (GamesDisplayView* self)
{
	g_return_if_fail (self != NULL);
	games_display_view_on_display_back (self);
}

static void
_games_display_view_on_back_clicked_gtk_button_clicked (GtkButton* _sender,
                                                        gpointer self)
{
	games_display_view_on_back_clicked ((GamesDisplayView*) self);
}

static void
games_display_view_on_fullscreen_clicked (GamesDisplayView* self)
{
	GSettings* _tmp0_;
	g_return_if_fail (self != NULL);
	games_display_view_set_is_fullscreen (self, TRUE);
	_tmp0_ = self->priv->settings;
	g_settings_set_boolean (_tmp0_, "fullscreen", TRUE);
}

static void
_games_display_view_on_fullscreen_clicked_gtk_button_clicked (GtkButton* _sender,
                                                              gpointer self)
{
	games_display_view_on_fullscreen_clicked ((GamesDisplayView*) self);
}

static void
games_display_view_on_restore_clicked (GamesDisplayView* self)
{
	GSettings* _tmp0_;
	g_return_if_fail (self != NULL);
	games_display_view_set_is_fullscreen (self, FALSE);
	_tmp0_ = self->priv->settings;
	g_settings_set_boolean (_tmp0_, "fullscreen", FALSE);
}

static void
_games_display_view_on_restore_clicked_gtk_button_clicked (GtkButton* _sender,
                                                           gpointer self)
{
	games_display_view_on_restore_clicked ((GamesDisplayView*) self);
}

static gboolean
games_display_view_handle_dialog_gamepad_button_press_event (GamesDisplayView* self,
                                                             GtkDialog* dialog,
                                                             ManetteEvent* event)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	guint16 button = 0U;
	guint16 _tmp4_ = 0U;
	gboolean _tmp5_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (dialog != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = gtk_widget_get_visible ((GtkWidget*) self);
	_tmp1_ = _tmp0_;
	if (!_tmp1_) {
		result = FALSE;
		return result;
	}
	g_object_get ((GtkWindow*) dialog, "is-active", &_tmp2_, NULL);
	_tmp3_ = _tmp2_;
	if (!_tmp3_) {
		result = FALSE;
		return result;
	}
	_tmp5_ = manette_event_get_button (event, &_tmp4_);
	button = _tmp4_;
	if (!_tmp5_) {
		result = FALSE;
		return result;
	}
	switch (button) {
		case BTN_A:
		{
			gtk_dialog_response (dialog, (gint) GTK_RESPONSE_ACCEPT);
			result = TRUE;
			return result;
		}
		case BTN_B:
		{
			gtk_dialog_response (dialog, (gint) GTK_RESPONSE_CANCEL);
			result = TRUE;
			return result;
		}
		default:
		{
			result = FALSE;
			return result;
		}
	}
}

static void
games_display_view_run_dialog_async_data_free (gpointer _data)
{
	GamesDisplayViewRunDialogAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->dialog);
	_g_object_unref0 (_data_->self);
	g_slice_free (GamesDisplayViewRunDialogAsyncData, _data_);
}

static void
games_display_view_run_dialog_async (GamesDisplayView* self,
                                     GtkDialog* dialog,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	GamesDisplayViewRunDialogAsyncData* _data_;
	GamesDisplayView* _tmp0_;
	GtkDialog* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (dialog != NULL);
	_data_ = g_slice_new0 (GamesDisplayViewRunDialogAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, games_display_view_run_dialog_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (dialog);
	_g_object_unref0 (_data_->dialog);
	_data_->dialog = _tmp1_;
	games_display_view_run_dialog_async_co (_data_);
}

static GtkResponseType
games_display_view_run_dialog_finish (GamesDisplayView* self,
                                      GAsyncResult* _res_)
{
	GtkResponseType result;
	GamesDisplayViewRunDialogAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

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

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

static void
__lambda59_ (Block27Data* _data27_,
             gint r)
{
	GamesDisplayView* self;
	self = _data27_->self;
	_data27_->response = (GtkResponseType) r;
	games_display_view_run_dialog_async_co (_data27_->_async_data_);
}

static void
___lambda59__gtk_dialog_response (GtkDialog* _sender,
                                  gint response_id,
                                  gpointer self)
{
	__lambda59_ (self, response_id);
}

static gboolean
games_display_view_run_dialog_async_co (GamesDisplayViewRunDialogAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data27_ = g_slice_new0 (Block27Data);
	_data_->_data27_->_ref_count_ = 1;
	_data_->_data27_->self = g_object_ref (_data_->self);
	_data_->_data27_->_async_data_ = _data_;
	_data_->_data27_->response = GTK_RESPONSE_CANCEL;
	g_signal_connect_data (_data_->dialog, "response", (GCallback) ___lambda59__gtk_dialog_response, block27_data_ref (_data_->_data27_), (GClosureNotify) block27_data_unref, 0);
	gtk_window_present ((GtkWindow*) _data_->dialog);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->result = _data_->_data27_->response;
	block27_data_unref (_data_->_data27_);
	_data_->_data27_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

GamesDisplayView*
games_display_view_construct (GType object_type)
{
	GamesDisplayView * self = NULL;
	self = (GamesDisplayView*) g_object_new (object_type, NULL);
	return self;
}

GamesDisplayView*
games_display_view_new (void)
{
	return games_display_view_construct (GAMES_TYPE_DISPLAY_VIEW);
}

static gboolean
games_display_view_real_get_is_view_active (GamesUiView* base)
{
	gboolean result;
	GamesDisplayView* self;
	self = (GamesDisplayView*) base;
	result = self->priv->_is_view_active;
	return result;
}

static void
games_display_view_real_set_is_view_active (GamesUiView* base,
                                            gboolean value)
{
	GamesDisplayView* self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	self = (GamesDisplayView*) base;
	_tmp0_ = games_ui_view_get_is_view_active ((GamesUiView*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == value) {
		return;
	}
	self->priv->_is_view_active = value;
	_tmp2_ = games_ui_view_get_is_view_active ((GamesUiView*) self);
	_tmp3_ = _tmp2_;
	if (!_tmp3_) {
		GamesRunner* _tmp4_;
		GamesRunner* _tmp5_;
		games_display_view_set_is_fullscreen (self, FALSE);
		_tmp4_ = games_display_view_get_runner (self);
		_tmp5_ = _tmp4_;
		if (_tmp5_ != NULL) {
			GamesRunner* _tmp6_;
			GamesRunner* _tmp7_;
			_tmp6_ = games_display_view_get_runner (self);
			_tmp7_ = _tmp6_;
			games_runner_stop (_tmp7_);
			games_display_view_set_runner (self, NULL);
		}
		games_display_view_update_actions (self);
	}
	g_object_notify_by_pspec ((GObject *) self, games_display_view_properties[GAMES_DISPLAY_VIEW_IS_VIEW_ACTIVE_PROPERTY]);
}

GtkWindow*
games_display_view_get_window (GamesDisplayView* self)
{
	GtkWindow* result;
	GtkWindow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_window;
	result = _tmp0_;
	return result;
}

static void
games_display_view_set_window (GamesDisplayView* self,
                               GtkWindow* value)
{
	GtkWindow* old_value;
	g_return_if_fail (self != NULL);
	old_value = games_display_view_get_window (self);
	if (old_value != value) {
		GtkWindow* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_window);
		self->priv->_window = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, games_display_view_properties[GAMES_DISPLAY_VIEW_WINDOW_PROPERTY]);
	}
}

gboolean
games_display_view_get_can_fullscreen (GamesDisplayView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_can_fullscreen;
	return result;
}

void
games_display_view_set_can_fullscreen (GamesDisplayView* self,
                                       gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_display_view_get_can_fullscreen (self);
	if (old_value != value) {
		self->priv->_can_fullscreen = value;
		g_object_notify_by_pspec ((GObject *) self, games_display_view_properties[GAMES_DISPLAY_VIEW_CAN_FULLSCREEN_PROPERTY]);
	}
}

gboolean
games_display_view_get_is_fullscreen (GamesDisplayView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_fullscreen;
	return result;
}

void
games_display_view_set_is_fullscreen (GamesDisplayView* self,
                                      gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_display_view_get_is_fullscreen (self);
	if (old_value != value) {
		self->priv->_is_fullscreen = value;
		g_object_notify_by_pspec ((GObject *) self, games_display_view_properties[GAMES_DISPLAY_VIEW_IS_FULLSCREEN_PROPERTY]);
	}
}

gboolean
games_display_view_get_is_showing_snapshots (GamesDisplayView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_showing_snapshots;
	return result;
}

void
games_display_view_set_is_showing_snapshots (GamesDisplayView* self,
                                             gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_display_view_get_is_showing_snapshots (self);
	if (old_value != value) {
		self->priv->_is_showing_snapshots = value;
		g_object_notify_by_pspec ((GObject *) self, games_display_view_properties[GAMES_DISPLAY_VIEW_IS_SHOWING_SNAPSHOTS_PROPERTY]);
	}
}

gboolean
games_display_view_get_is_menu_open (GamesDisplayView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_menu_open;
	return result;
}

void
games_display_view_set_is_menu_open (GamesDisplayView* self,
                                     gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_display_view_get_is_menu_open (self);
	if (old_value != value) {
		self->priv->_is_menu_open = value;
		g_object_notify_by_pspec ((GObject *) self, games_display_view_properties[GAMES_DISPLAY_VIEW_IS_MENU_OPEN_PROPERTY]);
	}
}

const gchar*
games_display_view_get_game_title (GamesDisplayView* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_game_title;
	result = _tmp0_;
	return result;
}

void
games_display_view_set_game_title (GamesDisplayView* self,
                                   const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = games_display_view_get_game_title (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_game_title);
		self->priv->_game_title = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, games_display_view_properties[GAMES_DISPLAY_VIEW_GAME_TITLE_PROPERTY]);
	}
}

GamesRunner*
games_display_view_get_runner (GamesDisplayView* self)
{
	GamesRunner* result;
	GamesRunner* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_runner;
	result = _tmp0_;
	return result;
}

static void
_games_flash_box_flash_games_runner_snapshot_created (GamesRunner* _sender,
                                                      gpointer self)
{
	games_flash_box_flash ((GamesFlashBox*) self);
}

void
games_display_view_set_runner (GamesDisplayView* self,
                               GamesRunner* value)
{
	GamesRunner* _tmp0_;
	GamesRunner* _tmp1_;
	GamesRunner* _tmp6_;
	GamesRunner* _tmp7_;
	GamesRunner* _tmp8_;
	GtkStack* _tmp9_;
	GtkBox* _tmp10_;
	GtkWidget* display = NULL;
	GamesRunner* _tmp11_;
	GamesRunner* _tmp12_;
	GtkWidget* _tmp13_;
	GtkWidget* _tmp14_;
	GamesSnapshotsList* _tmp15_;
	GamesInputModeSwitcher* _tmp16_;
	GamesRunner* _tmp17_;
	GamesRunner* _tmp18_;
	gboolean _tmp23_ = FALSE;
	GamesRunner* _tmp24_;
	GamesRunner* _tmp25_;
	GtkMenuButton* _tmp30_;
	GamesRunner* _tmp31_;
	GamesRunner* _tmp32_;
	GamesFlashBox* _tmp33_;
	g_return_if_fail (self != NULL);
	_tmp0_ = games_display_view_get_runner (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		GamesRunner* _tmp2_;
		GamesRunner* _tmp3_;
		GamesFlashBox* _tmp4_;
		guint _tmp5_;
		_tmp2_ = games_display_view_get_runner (self);
		_tmp3_ = _tmp2_;
		_tmp4_ = self->priv->flash_box;
		g_signal_parse_name ("snapshot-created", GAMES_TYPE_RUNNER, &_tmp5_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp3_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _games_flash_box_flash_games_runner_snapshot_created, _tmp4_);
	}
	_tmp6_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_runner);
	self->priv->_runner = _tmp6_;
	games_display_view_remove_display (self);
	_tmp7_ = games_display_view_get_runner (self);
	_tmp8_ = _tmp7_;
	if (_tmp8_ == NULL) {
		return;
	}
	_tmp9_ = self->priv->stack;
	_tmp10_ = self->priv->display_box;
	gtk_stack_set_visible_child (_tmp9_, (GtkWidget*) _tmp10_);
	_tmp11_ = games_display_view_get_runner (self);
	_tmp12_ = _tmp11_;
	_tmp13_ = games_runner_get_display (_tmp12_);
	display = _tmp13_;
	_tmp14_ = display;
	games_display_view_set_display (self, _tmp14_);
	_tmp15_ = self->priv->snapshots_list;
	games_snapshots_list_set_runner (_tmp15_, value);
	_tmp16_ = self->priv->input_mode_switcher;
	games_input_mode_switcher_set_runner (_tmp16_, value);
	_tmp17_ = games_display_view_get_runner (self);
	_tmp18_ = _tmp17_;
	if (_tmp18_ != NULL) {
		GamesRunner* _tmp19_;
		GamesRunner* _tmp20_;
		GamesHeaderBarWidget* _tmp21_;
		GamesHeaderBarWidget* _tmp22_;
		_tmp19_ = games_display_view_get_runner (self);
		_tmp20_ = _tmp19_;
		_tmp21_ = games_runner_get_extra_widget (_tmp20_);
		_tmp22_ = _tmp21_;
		games_display_view_set_extra_widget (self, _tmp22_);
		_g_object_unref0 (_tmp22_);
	} else {
		games_display_view_set_extra_widget (self, NULL);
	}
	_tmp24_ = games_display_view_get_runner (self);
	_tmp25_ = _tmp24_;
	if (_tmp25_ != NULL) {
		GamesRunner* _tmp26_;
		GamesRunner* _tmp27_;
		gboolean _tmp28_;
		gboolean _tmp29_;
		_tmp26_ = games_display_view_get_runner (self);
		_tmp27_ = _tmp26_;
		_tmp28_ = games_runner_get_is_integrated (_tmp27_);
		_tmp29_ = _tmp28_;
		_tmp23_ = _tmp29_;
	} else {
		_tmp23_ = FALSE;
	}
	_tmp30_ = self->priv->secondary_menu_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp30_, _tmp23_);
	_tmp31_ = games_display_view_get_runner (self);
	_tmp32_ = _tmp31_;
	_tmp33_ = self->priv->flash_box;
	g_signal_connect_object (_tmp32_, "snapshot-created", (GCallback) _games_flash_box_flash_games_runner_snapshot_created, _tmp33_, 0);
	_g_object_unref0 (display);
	g_object_notify_by_pspec ((GObject *) self, games_display_view_properties[GAMES_DISPLAY_VIEW_RUNNER_PROPERTY]);
}

static GamesHeaderBarWidget*
games_display_view_get_extra_widget (GamesDisplayView* self)
{
	GamesHeaderBarWidget* result;
	GamesHeaderBarWidget* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_extra_widget;
	result = _tmp0_;
	return result;
}

static void
games_display_view_set_extra_widget (GamesDisplayView* self,
                                     GamesHeaderBarWidget* value)
{
	GamesHeaderBarWidget* _tmp0_;
	GamesHeaderBarWidget* _tmp1_;
	GamesHeaderBarWidget* _tmp2_;
	GamesHeaderBarWidget* _tmp3_;
	GamesHeaderBarWidget* _tmp9_;
	GamesHeaderBarWidget* _tmp10_;
	GamesHeaderBarWidget* _tmp11_;
	g_return_if_fail (self != NULL);
	_tmp0_ = games_display_view_get_extra_widget (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == value) {
		return;
	}
	_tmp2_ = games_display_view_get_extra_widget (self);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != NULL) {
		GamesHeaderBarWidget* _tmp4_;
		GamesHeaderBarWidget* _tmp5_;
		HdyHeaderBar* _tmp6_;
		GamesHeaderBarWidget* _tmp7_;
		GamesHeaderBarWidget* _tmp8_;
		_tmp4_ = games_display_view_get_extra_widget (self);
		_tmp5_ = _tmp4_;
		g_signal_handler_disconnect ((GObject*) _tmp5_, self->priv->extra_widget_notify_block_autohide_id);
		_tmp6_ = self->priv->ingame_header_bar;
		_tmp7_ = games_display_view_get_extra_widget (self);
		_tmp8_ = _tmp7_;
		gtk_container_remove ((GtkContainer*) _tmp6_, (GtkWidget*) _tmp8_);
		self->priv->extra_widget_notify_block_autohide_id = (gulong) 0;
	}
	_tmp9_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_extra_widget);
	self->priv->_extra_widget = _tmp9_;
	_tmp10_ = games_display_view_get_extra_widget (self);
	_tmp11_ = _tmp10_;
	if (_tmp11_ != NULL) {
		GamesHeaderBarWidget* _tmp12_;
		GamesHeaderBarWidget* _tmp13_;
		gulong _tmp14_;
		HdyHeaderBar* _tmp15_;
		GamesHeaderBarWidget* _tmp16_;
		GamesHeaderBarWidget* _tmp17_;
		_tmp12_ = games_display_view_get_extra_widget (self);
		_tmp13_ = _tmp12_;
		_tmp14_ = g_signal_connect_object ((GObject*) _tmp13_, "notify::block-autohide", (GCallback) _games_display_view_update_fullscreen_box_g_object_notify, self, 0);
		self->priv->extra_widget_notify_block_autohide_id = _tmp14_;
		_tmp15_ = self->priv->ingame_header_bar;
		_tmp16_ = games_display_view_get_extra_widget (self);
		_tmp17_ = _tmp16_;
		hdy_header_bar_pack_end (_tmp15_, (GtkWidget*) _tmp17_);
	}
}

static GObject *
games_display_view_constructor (GType type,
                                guint n_construct_properties,
                                GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GamesDisplayView * self;
	GSettings* _tmp0_;
	GSimpleActionGroup* _tmp1_;
	GSimpleActionGroup* _tmp2_;
	GtkWindow* _tmp3_;
	GSimpleActionGroup* _tmp4_;
	parent_class = G_OBJECT_CLASS (games_display_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_DISPLAY_VIEW, GamesDisplayView);
	_tmp0_ = g_settings_new ("org.gnome.Games");
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp0_;
	_tmp1_ = g_simple_action_group_new ();
	_g_object_unref0 (self->priv->action_group);
	self->priv->action_group = _tmp1_;
	_tmp2_ = self->priv->action_group;
	g_action_map_add_action_entries ((GActionMap*) _tmp2_, GAMES_DISPLAY_VIEW_action_entries, (gint) G_N_ELEMENTS (GAMES_DISPLAY_VIEW_action_entries), self);
	_tmp3_ = self->priv->_window;
	_tmp4_ = self->priv->action_group;
	gtk_widget_insert_action_group ((GtkWidget*) _tmp3_, "display", (GActionGroup*) _tmp4_);
	return obj;
}

static void
games_display_view_class_init (GamesDisplayViewClass * klass,
                               gpointer klass_data)
{
	games_display_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GamesDisplayView_private_offset);
	((GtkWidgetClass *) klass)->size_allocate = (void (*) (GtkWidget*, GtkAllocation*)) games_display_view_real_size_allocate;
	G_OBJECT_CLASS (klass)->get_property = _vala_games_display_view_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_games_display_view_set_property;
	G_OBJECT_CLASS (klass)->constructor = games_display_view_constructor;
	G_OBJECT_CLASS (klass)->finalize = games_display_view_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_DISPLAY_VIEW_IS_VIEW_ACTIVE_PROPERTY, games_display_view_properties[GAMES_DISPLAY_VIEW_IS_VIEW_ACTIVE_PROPERTY] = g_param_spec_boolean ("is-view-active", "is-view-active", "is-view-active", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_DISPLAY_VIEW_WINDOW_PROPERTY, games_display_view_properties[GAMES_DISPLAY_VIEW_WINDOW_PROPERTY] = g_param_spec_object ("window", "window", "window", gtk_window_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_DISPLAY_VIEW_CAN_FULLSCREEN_PROPERTY, games_display_view_properties[GAMES_DISPLAY_VIEW_CAN_FULLSCREEN_PROPERTY] = g_param_spec_boolean ("can-fullscreen", "can-fullscreen", "can-fullscreen", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_DISPLAY_VIEW_IS_FULLSCREEN_PROPERTY, games_display_view_properties[GAMES_DISPLAY_VIEW_IS_FULLSCREEN_PROPERTY] = g_param_spec_boolean ("is-fullscreen", "is-fullscreen", "is-fullscreen", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_DISPLAY_VIEW_IS_SHOWING_SNAPSHOTS_PROPERTY, games_display_view_properties[GAMES_DISPLAY_VIEW_IS_SHOWING_SNAPSHOTS_PROPERTY] = g_param_spec_boolean ("is-showing-snapshots", "is-showing-snapshots", "is-showing-snapshots", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_DISPLAY_VIEW_IS_MENU_OPEN_PROPERTY, games_display_view_properties[GAMES_DISPLAY_VIEW_IS_MENU_OPEN_PROPERTY] = g_param_spec_boolean ("is-menu-open", "is-menu-open", "is-menu-open", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_DISPLAY_VIEW_GAME_TITLE_PROPERTY, games_display_view_properties[GAMES_DISPLAY_VIEW_GAME_TITLE_PROPERTY] = g_param_spec_string ("game-title", "game-title", "game-title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_DISPLAY_VIEW_RUNNER_PROPERTY, games_display_view_properties[GAMES_DISPLAY_VIEW_RUNNER_PROPERTY] = g_param_spec_object ("runner", "runner", "runner", GAMES_TYPE_RUNNER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Games/ui/display-view.ui");
	games_display_view_signals[GAMES_DISPLAY_VIEW_BACK_SIGNAL] = g_signal_new ("back", GAMES_TYPE_DISPLAY_VIEW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "headerbar_stack", FALSE, GamesDisplayView_private_offset + G_STRUCT_OFFSET (GamesDisplayViewPrivate, headerbar_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "ingame_header_bar", FALSE, GamesDisplayView_private_offset + G_STRUCT_OFFSET (GamesDisplayViewPrivate, ingame_header_bar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "fullscreen", FALSE, GamesDisplayView_private_offset + G_STRUCT_OFFSET (GamesDisplayViewPrivate, fullscreen));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "restore", FALSE, GamesDisplayView_private_offset + G_STRUCT_OFFSET (GamesDisplayViewPrivate, restore));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "secondary_menu_button", FALSE, GamesDisplayView_private_offset + G_STRUCT_OFFSET (GamesDisplayViewPrivate, secondary_menu_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "snapshots_header_bar", FALSE, GamesDisplayView_private_offset + G_STRUCT_OFFSET (GamesDisplayViewPrivate, snapshots_header_bar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "media_button", FALSE, GamesDisplayView_private_offset + G_STRUCT_OFFSET (GamesDisplayViewPrivate, media_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "input_mode_switcher", FALSE, GamesDisplayView_private_offset + G_STRUCT_OFFSET (GamesDisplayViewPrivate, input_mode_switcher));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "stack", FALSE, GamesDisplayView_private_offset + G_STRUCT_OFFSET (GamesDisplayViewPrivate, stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "error_display", FALSE, GamesDisplayView_private_offset + G_STRUCT_OFFSET (GamesDisplayViewPrivate, error_display));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "restart_btn", FALSE, GamesDisplayView_private_offset + G_STRUCT_OFFSET (GamesDisplayViewPrivate, restart_btn));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "display_box", FALSE, GamesDisplayView_private_offset + G_STRUCT_OFFSET (GamesDisplayViewPrivate, display_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "display_bin", FALSE, GamesDisplayView_private_offset + G_STRUCT_OFFSET (GamesDisplayViewPrivate, display_bin));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "fullscreen_box", FALSE, GamesDisplayView_private_offset + G_STRUCT_OFFSET (GamesDisplayViewPrivate, fullscreen_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "flash_box", FALSE, GamesDisplayView_private_offset + G_STRUCT_OFFSET (GamesDisplayViewPrivate, flash_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "snapshots_list", FALSE, GamesDisplayView_private_offset + G_STRUCT_OFFSET (GamesDisplayViewPrivate, snapshots_list));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_snapshots_hidden", G_CALLBACK(_games_display_view_on_snapshots_hidden_games_snapshots_list_hidden));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "update_fullscreen_box", G_CALLBACK(_games_display_view_update_fullscreen_box_g_object_notify));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_fullscreen_changed", G_CALLBACK(_games_display_view_on_fullscreen_changed_g_object_notify));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_showing_snapshots_changed", G_CALLBACK(_games_display_view_on_showing_snapshots_changed_g_object_notify));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_back_clicked", G_CALLBACK(_games_display_view_on_back_clicked_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_fullscreen_clicked", G_CALLBACK(_games_display_view_on_fullscreen_clicked_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_restore_clicked", G_CALLBACK(_games_display_view_on_restore_clicked_gtk_button_clicked));
}

static void
games_display_view_games_ui_view_interface_init (GamesUiViewIface * iface,
                                                 gpointer iface_data)
{
	games_display_view_games_ui_view_parent_iface = g_type_interface_peek_parent (iface);
	iface->on_button_pressed = (gboolean (*) (GamesUiView*, GdkEventButton*)) games_display_view_real_on_button_pressed;
	iface->on_key_pressed = (gboolean (*) (GamesUiView*, GdkEventKey*)) games_display_view_real_on_key_pressed;
	iface->gamepad_button_press_event = (gboolean (*) (GamesUiView*, ManetteEvent*)) games_display_view_real_gamepad_button_press_event;
	iface->gamepad_button_release_event = (gboolean (*) (GamesUiView*, ManetteEvent*)) games_display_view_real_gamepad_button_release_event;
	iface->gamepad_absolute_axis_event = (gboolean (*) (GamesUiView*, ManetteEvent*)) games_display_view_real_gamepad_absolute_axis_event;
	iface->get_is_view_active = games_display_view_real_get_is_view_active;
	iface->set_is_view_active = games_display_view_real_set_is_view_active;
}

static void
games_display_view_instance_init (GamesDisplayView * self,
                                  gpointer klass)
{
	self->priv = games_display_view_get_instance_private (self);
	g_type_ensure (GAMES_TYPE_MEDIA_MENU_BUTTON);
	g_type_ensure (GAMES_TYPE_INPUT_MODE_SWITCHER);
	g_type_ensure (GAMES_TYPE_DISPLAY_BIN);
	g_type_ensure (GAMES_TYPE_FULLSCREEN_BOX);
	g_type_ensure (GAMES_TYPE_FLASH_BOX);
	g_type_ensure (GAMES_TYPE_SNAPSHOTS_LIST);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
games_display_view_finalize (GObject * obj)
{
	GamesDisplayView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_DISPLAY_VIEW, GamesDisplayView);
	_g_object_unref0 (self->priv->_window);
	_g_free0 (self->priv->_game_title);
	_g_object_unref0 (self->priv->_runner);
	_g_object_unref0 (self->priv->_extra_widget);
	_g_object_unref0 (self->priv->settings);
	_g_object_unref0 (self->priv->run_game_cancellable);
	_g_object_unref0 (self->priv->quit_game_cancellable);
	_g_object_unref0 (self->priv->resume_dialog);
	_g_object_unref0 (self->priv->resume_failed_dialog);
	_g_object_unref0 (self->priv->quit_dialog);
	_g_object_unref0 (self->priv->restart_dialog);
	_g_object_unref0 (self->priv->game);
	_g_object_unref0 (self->priv->action_group);
	G_OBJECT_CLASS (games_display_view_parent_class)->finalize (obj);
}

static GType
games_display_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GamesDisplayViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_display_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesDisplayView), 0, (GInstanceInitFunc) games_display_view_instance_init, NULL };
	static const GInterfaceInfo games_ui_view_info = { (GInterfaceInitFunc) games_display_view_games_ui_view_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType games_display_view_type_id;
	games_display_view_type_id = g_type_register_static (gtk_box_get_type (), "GamesDisplayView", &g_define_type_info, 0);
	g_type_add_interface_static (games_display_view_type_id, GAMES_TYPE_UI_VIEW, &games_ui_view_info);
	GamesDisplayView_private_offset = g_type_add_instance_private (games_display_view_type_id, sizeof (GamesDisplayViewPrivate));
	return games_display_view_type_id;
}

GType
games_display_view_get_type (void)
{
	static volatile gsize games_display_view_type_id__once = 0;
	if (g_once_init_enter (&games_display_view_type_id__once)) {
		GType games_display_view_type_id;
		games_display_view_type_id = games_display_view_get_type_once ();
		g_once_init_leave (&games_display_view_type_id__once, games_display_view_type_id);
	}
	return games_display_view_type_id__once;
}

static void
_vala_games_display_view_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec)
{
	GamesDisplayView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_DISPLAY_VIEW, GamesDisplayView);
	switch (property_id) {
		case GAMES_DISPLAY_VIEW_IS_VIEW_ACTIVE_PROPERTY:
		g_value_set_boolean (value, games_ui_view_get_is_view_active ((GamesUiView*) self));
		break;
		case GAMES_DISPLAY_VIEW_WINDOW_PROPERTY:
		g_value_set_object (value, games_display_view_get_window (self));
		break;
		case GAMES_DISPLAY_VIEW_CAN_FULLSCREEN_PROPERTY:
		g_value_set_boolean (value, games_display_view_get_can_fullscreen (self));
		break;
		case GAMES_DISPLAY_VIEW_IS_FULLSCREEN_PROPERTY:
		g_value_set_boolean (value, games_display_view_get_is_fullscreen (self));
		break;
		case GAMES_DISPLAY_VIEW_IS_SHOWING_SNAPSHOTS_PROPERTY:
		g_value_set_boolean (value, games_display_view_get_is_showing_snapshots (self));
		break;
		case GAMES_DISPLAY_VIEW_IS_MENU_OPEN_PROPERTY:
		g_value_set_boolean (value, games_display_view_get_is_menu_open (self));
		break;
		case GAMES_DISPLAY_VIEW_GAME_TITLE_PROPERTY:
		g_value_set_string (value, games_display_view_get_game_title (self));
		break;
		case GAMES_DISPLAY_VIEW_RUNNER_PROPERTY:
		g_value_set_object (value, games_display_view_get_runner (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_games_display_view_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec)
{
	GamesDisplayView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_DISPLAY_VIEW, GamesDisplayView);
	switch (property_id) {
		case GAMES_DISPLAY_VIEW_IS_VIEW_ACTIVE_PROPERTY:
		games_ui_view_set_is_view_active ((GamesUiView*) self, g_value_get_boolean (value));
		break;
		case GAMES_DISPLAY_VIEW_WINDOW_PROPERTY:
		games_display_view_set_window (self, g_value_get_object (value));
		break;
		case GAMES_DISPLAY_VIEW_CAN_FULLSCREEN_PROPERTY:
		games_display_view_set_can_fullscreen (self, g_value_get_boolean (value));
		break;
		case GAMES_DISPLAY_VIEW_IS_FULLSCREEN_PROPERTY:
		games_display_view_set_is_fullscreen (self, g_value_get_boolean (value));
		break;
		case GAMES_DISPLAY_VIEW_IS_SHOWING_SNAPSHOTS_PROPERTY:
		games_display_view_set_is_showing_snapshots (self, g_value_get_boolean (value));
		break;
		case GAMES_DISPLAY_VIEW_IS_MENU_OPEN_PROPERTY:
		games_display_view_set_is_menu_open (self, g_value_get_boolean (value));
		break;
		case GAMES_DISPLAY_VIEW_GAME_TITLE_PROPERTY:
		games_display_view_set_game_title (self, g_value_get_string (value));
		break;
		case GAMES_DISPLAY_VIEW_RUNNER_PROPERTY:
		games_display_view_set_runner (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

