/* collection-view.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from collection-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 <stdlib.h>
#include <string.h>
#include <handy.h>
#include <gio/gio.h>
#include "linux/input-event-codes.h"
#include "gnome-games.h"
#include <glib/gi18n-lib.h>
#include "config.h"

#define GAMES_COLLECTION_VIEW_CONTRIBUTE_URI "https://wiki.gnome.org/Apps/Games/Contribute"
#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_COLLECTION_VIEW (games_collection_view_get_type ())
#define GAMES_COLLECTION_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_COLLECTION_VIEW, GamesCollectionView))
#define GAMES_COLLECTION_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_COLLECTION_VIEW, GamesCollectionViewClass))
#define GAMES_IS_COLLECTION_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_COLLECTION_VIEW))
#define GAMES_IS_COLLECTION_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_COLLECTION_VIEW))
#define GAMES_COLLECTION_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_COLLECTION_VIEW, GamesCollectionViewClass))

typedef struct _GamesCollectionView GamesCollectionView;
typedef struct _GamesCollectionViewClass GamesCollectionViewClass;
typedef struct _GamesCollectionViewPrivate GamesCollectionViewPrivate;

#define GAMES_TYPE_ERROR_INFO_BAR (games_error_info_bar_get_type ())
#define GAMES_ERROR_INFO_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_ERROR_INFO_BAR, GamesErrorInfoBar))
#define GAMES_ERROR_INFO_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_ERROR_INFO_BAR, GamesErrorInfoBarClass))
#define GAMES_IS_ERROR_INFO_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_ERROR_INFO_BAR))
#define GAMES_IS_ERROR_INFO_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_ERROR_INFO_BAR))
#define GAMES_ERROR_INFO_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_ERROR_INFO_BAR, GamesErrorInfoBarClass))

typedef struct _GamesErrorInfoBar GamesErrorInfoBar;
typedef struct _GamesErrorInfoBarClass GamesErrorInfoBarClass;

#define GAMES_TYPE_SEARCH_BAR (games_search_bar_get_type ())
#define GAMES_SEARCH_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_SEARCH_BAR, GamesSearchBar))
#define GAMES_SEARCH_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_SEARCH_BAR, GamesSearchBarClass))
#define GAMES_IS_SEARCH_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_SEARCH_BAR))
#define GAMES_IS_SEARCH_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_SEARCH_BAR))
#define GAMES_SEARCH_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_SEARCH_BAR, GamesSearchBarClass))

typedef struct _GamesSearchBar GamesSearchBar;
typedef struct _GamesSearchBarClass GamesSearchBarClass;

#define GAMES_TYPE_GAMES_PAGE (games_games_page_get_type ())
#define GAMES_GAMES_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_GAMES_PAGE, GamesGamesPage))
#define GAMES_GAMES_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_GAMES_PAGE, GamesGamesPageClass))
#define GAMES_IS_GAMES_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_GAMES_PAGE))
#define GAMES_IS_GAMES_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_GAMES_PAGE))
#define GAMES_GAMES_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_GAMES_PAGE, GamesGamesPageClass))

typedef struct _GamesGamesPage GamesGamesPage;
typedef struct _GamesGamesPageClass GamesGamesPageClass;

#define GAMES_TYPE_PLATFORMS_PAGE (games_platforms_page_get_type ())
#define GAMES_PLATFORMS_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_PLATFORMS_PAGE, GamesPlatformsPage))
#define GAMES_PLATFORMS_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_PLATFORMS_PAGE, GamesPlatformsPageClass))
#define GAMES_IS_PLATFORMS_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_PLATFORMS_PAGE))
#define GAMES_IS_PLATFORMS_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_PLATFORMS_PAGE))
#define GAMES_PLATFORMS_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_PLATFORMS_PAGE, GamesPlatformsPageClass))

typedef struct _GamesPlatformsPage GamesPlatformsPage;
typedef struct _GamesPlatformsPageClass GamesPlatformsPageClass;

#define GAMES_TYPE_COLLECTIONS_PAGE (games_collections_page_get_type ())
#define GAMES_COLLECTIONS_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_COLLECTIONS_PAGE, GamesCollectionsPage))
#define GAMES_COLLECTIONS_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_COLLECTIONS_PAGE, GamesCollectionsPageClass))
#define GAMES_IS_COLLECTIONS_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_COLLECTIONS_PAGE))
#define GAMES_IS_COLLECTIONS_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_COLLECTIONS_PAGE))
#define GAMES_COLLECTIONS_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_COLLECTIONS_PAGE, GamesCollectionsPageClass))

typedef struct _GamesCollectionsPage GamesCollectionsPage;
typedef struct _GamesCollectionsPageClass GamesCollectionsPageClass;

#define GAMES_TYPE_SELECTION_ACTION_BAR (games_selection_action_bar_get_type ())
#define GAMES_SELECTION_ACTION_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_SELECTION_ACTION_BAR, GamesSelectionActionBar))
#define GAMES_SELECTION_ACTION_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_SELECTION_ACTION_BAR, GamesSelectionActionBarClass))
#define GAMES_IS_SELECTION_ACTION_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_SELECTION_ACTION_BAR))
#define GAMES_IS_SELECTION_ACTION_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_SELECTION_ACTION_BAR))
#define GAMES_SELECTION_ACTION_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_SELECTION_ACTION_BAR, GamesSelectionActionBarClass))

typedef struct _GamesSelectionActionBar GamesSelectionActionBar;
typedef struct _GamesSelectionActionBarClass GamesSelectionActionBarClass;

#define GAMES_TYPE_UNDO_NOTIFICATION (games_undo_notification_get_type ())
#define GAMES_UNDO_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_UNDO_NOTIFICATION, GamesUndoNotification))
#define GAMES_UNDO_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_UNDO_NOTIFICATION, GamesUndoNotificationClass))
#define GAMES_IS_UNDO_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_UNDO_NOTIFICATION))
#define GAMES_IS_UNDO_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_UNDO_NOTIFICATION))
#define GAMES_UNDO_NOTIFICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_UNDO_NOTIFICATION, GamesUndoNotificationClass))

typedef struct _GamesUndoNotification GamesUndoNotification;
typedef struct _GamesUndoNotificationClass GamesUndoNotificationClass;

#define GAMES_TYPE_GAME_MODEL (games_game_model_get_type ())
#define GAMES_GAME_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_GAME_MODEL, GamesGameModel))
#define GAMES_GAME_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_GAME_MODEL, GamesGameModelClass))
#define GAMES_IS_GAME_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_GAME_MODEL))
#define GAMES_IS_GAME_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_GAME_MODEL))
#define GAMES_GAME_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_GAME_MODEL, GamesGameModelClass))

typedef struct _GamesGameModel GamesGameModel;
typedef struct _GamesGameModelClass GamesGameModelClass;

#define GAMES_TYPE_COLLECTION_MANAGER (games_collection_manager_get_type ())
#define GAMES_COLLECTION_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_COLLECTION_MANAGER, GamesCollectionManager))
#define GAMES_COLLECTION_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_COLLECTION_MANAGER, GamesCollectionManagerClass))
#define GAMES_IS_COLLECTION_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_COLLECTION_MANAGER))
#define GAMES_IS_COLLECTION_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_COLLECTION_MANAGER))
#define GAMES_COLLECTION_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_COLLECTION_MANAGER, GamesCollectionManagerClass))

typedef struct _GamesCollectionManager GamesCollectionManager;
typedef struct _GamesCollectionManagerClass GamesCollectionManagerClass;

#define GAMES_TYPE_KONAMI_CODE (games_konami_code_get_type ())
#define GAMES_KONAMI_CODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_KONAMI_CODE, GamesKonamiCode))
#define GAMES_KONAMI_CODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_KONAMI_CODE, GamesKonamiCodeClass))
#define GAMES_IS_KONAMI_CODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_KONAMI_CODE))
#define GAMES_IS_KONAMI_CODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_KONAMI_CODE))
#define GAMES_KONAMI_CODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_KONAMI_CODE, GamesKonamiCodeClass))

typedef struct _GamesKonamiCode GamesKonamiCode;
typedef struct _GamesKonamiCodeClass GamesKonamiCodeClass;
enum  {
	GAMES_COLLECTION_VIEW_0_PROPERTY,
	GAMES_COLLECTION_VIEW_IS_VIEW_ACTIVE_PROPERTY,
	GAMES_COLLECTION_VIEW_IS_EMPTY_COLLECTION_PROPERTY,
	GAMES_COLLECTION_VIEW_FILTERING_TEXT_PROPERTY,
	GAMES_COLLECTION_VIEW_WINDOW_PROPERTY,
	GAMES_COLLECTION_VIEW_GAME_MODEL_PROPERTY,
	GAMES_COLLECTION_VIEW_COLLECTION_MODEL_PROPERTY,
	GAMES_COLLECTION_VIEW_LOADING_NOTIFICATION_PROPERTY,
	GAMES_COLLECTION_VIEW_SEARCH_MODE_PROPERTY,
	GAMES_COLLECTION_VIEW_IS_FOLDED_PROPERTY,
	GAMES_COLLECTION_VIEW_IS_SEARCH_AVAILABLE_PROPERTY,
	GAMES_COLLECTION_VIEW_IS_SHOWING_BOTTOM_BAR_PROPERTY,
	GAMES_COLLECTION_VIEW_IS_SUBVIEW_OPEN_PROPERTY,
	GAMES_COLLECTION_VIEW_IS_SELECTION_MODE_PROPERTY,
	GAMES_COLLECTION_VIEW_IS_SELECTION_AVAILABLE_PROPERTY,
	GAMES_COLLECTION_VIEW_IS_COLLECTION_RENAME_VALID_PROPERTY,
	GAMES_COLLECTION_VIEW_SHOW_GAME_ACTIONS_PROPERTY,
	GAMES_COLLECTION_VIEW_SHOW_REMOVE_ACTION_BUTTON_PROPERTY,
	GAMES_COLLECTION_VIEW_IS_ADD_AVAILABLE_PROPERTY,
	GAMES_COLLECTION_VIEW_NUM_PROPERTIES
};
static GParamSpec* games_collection_view_properties[GAMES_COLLECTION_VIEW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define GAMES_TYPE_COLLECTION (games_collection_get_type ())
#define GAMES_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_COLLECTION, GamesCollection))
#define GAMES_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_COLLECTION))
#define GAMES_COLLECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GAMES_TYPE_COLLECTION, GamesCollectionIface))

typedef struct _GamesCollection GamesCollection;
typedef struct _GamesCollectionIface GamesCollectionIface;
typedef enum  {
	GAMES_COLLECTION_TYPE_AUTO,
	GAMES_COLLECTION_TYPE_USER,
	GAMES_COLLECTION_TYPE_PLACEHOLDER
} GamesCollectionType;

#define GAMES_TYPE_COLLECTION_TYPE (games_collection_type_get_type ())

#define GAMES_TYPE_COLLECTION_ACTION_WINDOW (games_collection_action_window_get_type ())
#define GAMES_COLLECTION_ACTION_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_COLLECTION_ACTION_WINDOW, GamesCollectionActionWindow))
#define GAMES_COLLECTION_ACTION_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_COLLECTION_ACTION_WINDOW, GamesCollectionActionWindowClass))
#define GAMES_IS_COLLECTION_ACTION_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_COLLECTION_ACTION_WINDOW))
#define GAMES_IS_COLLECTION_ACTION_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_COLLECTION_ACTION_WINDOW))
#define GAMES_COLLECTION_ACTION_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_COLLECTION_ACTION_WINDOW, GamesCollectionActionWindowClass))

typedef struct _GamesCollectionActionWindow GamesCollectionActionWindow;
typedef struct _GamesCollectionActionWindowClass GamesCollectionActionWindowClass;

#define GAMES_TYPE_COLLECTION_MODEL (games_collection_model_get_type ())
#define GAMES_COLLECTION_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_COLLECTION_MODEL, GamesCollectionModel))
#define GAMES_COLLECTION_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_COLLECTION_MODEL, GamesCollectionModelClass))
#define GAMES_IS_COLLECTION_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_COLLECTION_MODEL))
#define GAMES_IS_COLLECTION_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_COLLECTION_MODEL))
#define GAMES_COLLECTION_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_COLLECTION_MODEL, GamesCollectionModelClass))

typedef struct _GamesCollectionModel GamesCollectionModel;
typedef struct _GamesCollectionModelClass GamesCollectionModelClass;

#define GAMES_TYPE_APPLICATION_WINDOW (games_application_window_get_type ())
#define GAMES_APPLICATION_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_APPLICATION_WINDOW, GamesApplicationWindow))
#define GAMES_APPLICATION_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_APPLICATION_WINDOW, GamesApplicationWindowClass))
#define GAMES_IS_APPLICATION_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_APPLICATION_WINDOW))
#define GAMES_IS_APPLICATION_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_APPLICATION_WINDOW))
#define GAMES_APPLICATION_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_APPLICATION_WINDOW, GamesApplicationWindowClass))

typedef struct _GamesApplicationWindow GamesApplicationWindow;
typedef struct _GamesApplicationWindowClass GamesApplicationWindowClass;
#define _g_free0(var) (var = (g_free (var), NULL))

#define GAMES_TYPE_USER_COLLECTION (games_user_collection_get_type ())
#define GAMES_USER_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_USER_COLLECTION, GamesUserCollection))
#define GAMES_USER_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_USER_COLLECTION, GamesUserCollectionClass))
#define GAMES_IS_USER_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_USER_COLLECTION))
#define GAMES_IS_USER_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_USER_COLLECTION))
#define GAMES_USER_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_USER_COLLECTION, GamesUserCollectionClass))

typedef struct _GamesUserCollection GamesUserCollection;
typedef struct _GamesUserCollectionClass GamesUserCollectionClass;
typedef enum  {
	GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_NONE_FAVORITE,
	GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_ALL_FAVORITE,
	GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_SEMI_FAVORITE
} GamesSelectionActionBarFavoriteState;

#define GAMES_SELECTION_ACTION_BAR_TYPE_FAVORITE_STATE (games_selection_action_bar_favorite_state_get_type ())
enum  {
	GAMES_COLLECTION_VIEW_GAME_ACTIVATED_SIGNAL,
	GAMES_COLLECTION_VIEW_NUM_SIGNALS
};
static guint games_collection_view_signals[GAMES_COLLECTION_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 _GamesCollectionView {
	GtkBox parent_instance;
	GamesCollectionViewPrivate * priv;
	gchar** filtering_terms;
	gint filtering_terms_length1;
	gint _filtering_terms_size_;
};

struct _GamesCollectionViewClass {
	GtkBoxClass parent_class;
};

struct _GamesCollectionViewPrivate {
	HdyDeck* platforms_deck;
	HdyDeck* collections_deck;
	GtkStack* header_bar_stack;
	HdyHeaderBar* header_bar;
	HdyHeaderBar* subview_header_bar;
	HdyHeaderBar* selection_mode_header_bar;
	HdyViewSwitcherTitle* view_switcher_title;
	GamesErrorInfoBar* error_info_bar;
	GamesSearchBar* search_bar;
	HdyStatusPage* empty_collection;
	HdyStatusPage* empty_search;
	GamesGamesPage* games_page;
	GamesPlatformsPage* platforms_page;
	GamesCollectionsPage* collections_page;
	HdyHeaderBar* collection_subpage_header_bar;
	GamesSelectionActionBar* selection_action_bar;
	GtkStack* empty_stack;
	GtkStack* viewstack;
	HdyViewSwitcherBar* view_switcher_bar;
	HdySwipeGroup* swipe_group;
	HdySwipeGroup* collections_swipe_group;
	GamesUndoNotification* undo_notification;
	GtkEntry* collection_rename_entry;
	GtkPopover* rename_popover;
	GtkLabel* collection_rename_error_label;
	GtkLabel* selection_mode_label;
	gboolean _is_view_active;
	gboolean _is_empty_collection;
	GtkWindow* _window;
	GamesGameModel* _game_model;
	gboolean _loading_notification;
	gboolean _search_mode;
	gboolean _is_folded;
	gboolean _is_search_available;
	gboolean _is_showing_bottom_bar;
	gboolean _is_subview_open;
	gboolean _is_selection_mode;
	gboolean _is_selection_available;
	gboolean _is_collection_rename_valid;
	gboolean _show_game_actions;
	gboolean _show_remove_action_button;
	gboolean _is_add_available;
	GamesCollectionManager* collection_manager;
	GamesKonamiCode* konami_code;
	GSimpleActionGroup* action_group;
};

struct _GamesCollectionIface {
	GTypeInterface parent_iface;
	void (*load) (GamesCollection* self);
	gchar* (*get_id) (GamesCollection* self);
	gboolean (*get_hide_stars) (GamesCollection* self);
	GamesGameModel* (*get_game_model) (GamesCollection* self);
	GamesCollectionType (*get_collection_type) (GamesCollection* self);
	void (*add_games) (GamesCollection* self, GamesGame** games, gint games_length1);
	void (*remove_games) (GamesCollection* self, GamesGame** games, gint games_length1);
	void (*on_game_added) (GamesCollection* self, GamesGame* game);
	void (*on_game_removed) (GamesCollection* self, GamesGame* game);
	void (*on_game_replaced) (GamesCollection* self, GamesGame* game, GamesGame* prev_game);
	gboolean (*get_is_empty) (GamesCollection* self);
	const gchar* (*get_title) (GamesCollection* self);
};

static gint GamesCollectionView_private_offset;
static gpointer games_collection_view_parent_class = NULL;
static GamesUiViewIface * games_collection_view_games_ui_view_parent_iface = NULL;

VALA_EXTERN GType games_ui_view_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_collection_view_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_error_info_bar_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_search_bar_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_games_page_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_platforms_page_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_collections_page_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_selection_action_bar_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_undo_notification_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_game_model_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_collection_manager_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_konami_code_get_type (void) G_GNUC_CONST ;
static void games_collection_view_select_all (GamesCollectionView* self);
static void _games_collection_view_select_all_gsimple_action_activate_callback (GSimpleAction* action,
                                                                         GVariant* parameter,
                                                                         gpointer self);
static void games_collection_view_select_none (GamesCollectionView* self);
static void _games_collection_view_select_none_gsimple_action_activate_callback (GSimpleAction* action,
                                                                          GVariant* parameter,
                                                                          gpointer self);
static void games_collection_view_toggle_select (GamesCollectionView* self);
static void _games_collection_view_toggle_select_gsimple_action_activate_callback (GSimpleAction* action,
                                                                            GVariant* parameter,
                                                                            gpointer self);
static void games_collection_view_favorite_action (GamesCollectionView* self);
static void _games_collection_view_favorite_action_gsimple_action_activate_callback (GSimpleAction* action,
                                                                              GVariant* parameter,
                                                                              gpointer self);
static void games_collection_view_add_to_collection (GamesCollectionView* self);
static void _games_collection_view_add_to_collection_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                GVariant* parameter,
                                                                                gpointer self);
VALA_EXTERN void games_collection_view_remove_collection (GamesCollectionView* self);
static void _games_collection_view_remove_collection_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                GVariant* parameter,
                                                                                gpointer self);
VALA_EXTERN void games_collection_view_rename_collection (GamesCollectionView* self);
static void _games_collection_view_rename_collection_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                GVariant* parameter,
                                                                                gpointer self);
static void games_collection_view_remove_from_collection (GamesCollectionView* self);
static void _games_collection_view_remove_from_collection_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                     GVariant* parameter,
                                                                                     gpointer self);
VALA_EXTERN void games_collection_view_show_error (GamesCollectionView* self,
                                       const gchar* error_message);
VALA_EXTERN void games_error_info_bar_show_error (GamesErrorInfoBar* self,
                                      const gchar* message);
static gboolean games_collection_view_real_on_button_pressed (GamesUiView* base,
                                                       GdkEventButton* event);
static gboolean games_collection_view_real_on_key_pressed (GamesUiView* base,
                                                    GdkEventKey* event);
VALA_EXTERN GtkWindow* games_collection_view_get_window (GamesCollectionView* self);
VALA_EXTERN gboolean games_collection_view_get_is_selection_mode (GamesCollectionView* self);
VALA_EXTERN gboolean games_collections_page_exit_subpage (GamesCollectionsPage* self);
VALA_EXTERN gboolean games_collections_page_get_is_collection_empty (GamesCollectionsPage* self);
VALA_EXTERN gboolean games_collection_view_get_is_empty_collection (GamesCollectionView* self);
VALA_EXTERN gboolean games_collection_view_get_search_mode (GamesCollectionView* self);
VALA_EXTERN void games_collection_view_set_search_mode (GamesCollectionView* self,
                                            gboolean value);
VALA_EXTERN gboolean games_collections_page_get_is_subpage_open (GamesCollectionsPage* self);
VALA_EXTERN gboolean games_search_bar_handle_event (GamesSearchBar* self,
                                        GdkEvent* event);
static gboolean games_collection_view_real_gamepad_button_press_event (GamesUiView* base,
                                                                ManetteEvent* event);
VALA_EXTERN gboolean games_platforms_page_gamepad_button_press_event (GamesPlatformsPage* self,
                                                          ManetteEvent* event);
VALA_EXTERN gboolean games_games_page_gamepad_button_press_event (GamesGamesPage* self,
                                                      ManetteEvent* event);
VALA_EXTERN gboolean games_collections_page_gamepad_button_press_event (GamesCollectionsPage* self,
                                                            ManetteEvent* event);
static gboolean games_collection_view_real_gamepad_button_release_event (GamesUiView* base,
                                                                  ManetteEvent* event);
VALA_EXTERN gboolean games_platforms_page_gamepad_button_release_event (GamesPlatformsPage* self,
                                                            ManetteEvent* event);
VALA_EXTERN gboolean games_games_page_gamepad_button_release_event (GamesGamesPage* self,
                                                        ManetteEvent* event);
VALA_EXTERN gboolean games_collections_page_gamepad_button_release_event (GamesCollectionsPage* self,
                                                              ManetteEvent* event);
static gboolean games_collection_view_real_gamepad_absolute_axis_event (GamesUiView* base,
                                                                 ManetteEvent* event);
VALA_EXTERN gboolean games_platforms_page_gamepad_absolute_axis_event (GamesPlatformsPage* self,
                                                           ManetteEvent* event);
VALA_EXTERN gboolean games_games_page_gamepad_absolute_axis_event (GamesGamesPage* self,
                                                       ManetteEvent* event);
VALA_EXTERN gboolean games_collections_page_gamepad_absolute_axis_event (GamesCollectionsPage* self,
                                                             ManetteEvent* event);
static void games_collection_view_on_konami_code_performed (GamesCollectionView* self);
VALA_EXTERN gboolean games_ui_view_get_is_view_active (GamesUiView* self);
VALA_EXTERN void games_collection_view_run_search (GamesCollectionView* self,
                                       const gchar* query);
VALA_EXTERN void games_search_bar_run_search (GamesSearchBar* self,
                                  const gchar* query);
VALA_EXTERN void games_platforms_page_select_none (GamesPlatformsPage* self);
VALA_EXTERN void games_games_page_select_none (GamesGamesPage* self);
VALA_EXTERN void games_collections_page_select_none (GamesCollectionsPage* self);
static void games_collection_view_on_selected_items_changed (GamesCollectionView* self);
VALA_EXTERN void games_platforms_page_select_all (GamesPlatformsPage* self);
VALA_EXTERN void games_games_page_select_all (GamesGamesPage* self);
VALA_EXTERN void games_collections_page_select_all (GamesCollectionsPage* self);
VALA_EXTERN void games_collection_view_set_is_selection_mode (GamesCollectionView* self,
                                                  gboolean value);
static GamesGame** games_collection_view_get_currently_selected_games (GamesCollectionView* self,
                                                                gint* result_length1);
VALA_EXTERN GamesGame** games_games_page_get_selected_games (GamesGamesPage* self,
                                                 gint* result_length1);
VALA_EXTERN GamesGame** games_platforms_page_get_selected_games (GamesPlatformsPage* self,
                                                     gint* result_length1);
VALA_EXTERN GamesGame** games_collections_page_get_selected_games (GamesCollectionsPage* self,
                                                       gint* result_length1);
VALA_EXTERN void games_collections_page_finalize_collection_removal (GamesCollectionsPage* self);
VALA_EXTERN GType games_collection_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_collection_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GamesCollection* games_collections_page_get_current_collection (GamesCollectionsPage* self);
VALA_EXTERN GType games_collection_action_window_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GamesCollectionActionWindow* games_collection_action_window_new (gboolean create_collection_page_only,
                                                                 GamesCollection* collection);
VALA_EXTERN GamesCollectionActionWindow* games_collection_action_window_construct (GType object_type,
                                                                       gboolean create_collection_page_only,
                                                                       GamesCollection* collection);
VALA_EXTERN GType games_collection_model_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GamesCollectionModel* games_collection_view_get_collection_model (GamesCollectionView* self);
VALA_EXTERN void games_collection_action_window_set_collection_model (GamesCollectionActionWindow* self,
                                                          GamesCollectionModel* value);
VALA_EXTERN GType games_application_window_get_type (void) G_GNUC_CONST ;
static void __lambda52_ (GamesCollectionView* self,
                  GamesCollection** collections,
                  gint collections_length1);
VALA_EXTERN void games_collection_add_games (GamesCollection* self,
                                 GamesGame** games,
                                 gint games_length1);
static void ___lambda52__games_collection_action_window_confirmed (GamesCollectionActionWindow* _sender,
                                                            GamesCollection** collections,
                                                            gint collections_length1,
                                                            gpointer self);
VALA_EXTERN void games_collection_manager_toggle_favorite (GamesCollectionManager* self,
                                               GamesGame** games,
                                               gint games_length1);
VALA_EXTERN gchar* games_collection_get_id (GamesCollection* self);
VALA_EXTERN void games_collections_page_update_is_collection_empty (GamesCollectionsPage* self);
VALA_EXTERN gboolean games_collections_page_get_is_showing_user_collection (GamesCollectionsPage* self);
VALA_EXTERN void games_collections_page_remove_current_user_collection (GamesCollectionsPage* self);
VALA_EXTERN void games_collections_page_remove_currently_selected_user_collections (GamesCollectionsPage* self);
VALA_EXTERN void games_undo_notification_show_notification (GamesUndoNotification* self);
VALA_EXTERN GType games_user_collection_get_type (void) G_GNUC_CONST ;
VALA_EXTERN const gchar* games_collections_page_get_collection_title (GamesCollectionsPage* self);
VALA_EXTERN void games_collection_remove_games (GamesCollection* self,
                                    GamesGame** games,
                                    gint games_length1);
static void games_collection_view_update_available_selection_actions (GamesCollectionView* self);
VALA_EXTERN void games_collection_view_set_show_game_actions (GamesCollectionView* self,
                                                  gboolean value);
VALA_EXTERN void games_collection_view_set_show_remove_action_button (GamesCollectionView* self,
                                                          gboolean value);
static void games_collection_view_update_add_game_availablity (GamesCollectionView* self);
VALA_EXTERN void games_collection_view_set_is_add_available (GamesCollectionView* self,
                                                 gboolean value);
static void games_collection_view_update_search_filters (GamesCollectionView* self);
VALA_EXTERN void games_games_page_set_filter (GamesGamesPage* self,
                                  gchar** filtering_terms,
                                  gint filtering_terms_length1);
VALA_EXTERN void games_platforms_page_set_filter (GamesPlatformsPage* self,
                                      gchar** filtering_terms,
                                      gint filtering_terms_length1);
VALA_EXTERN void games_collections_page_set_filter (GamesCollectionsPage* self,
                                        gchar** filtering_terms,
                                        gint filtering_terms_length1);
static void games_collection_view_on_collection_subpage_opened (GamesCollectionView* self);
static void games_collection_view_update_bottom_bar (GamesCollectionView* self);
static void _games_collection_view_on_collection_subpage_opened_g_object_notify (GObject* _sender,
                                                                          GParamSpec* pspec,
                                                                          gpointer self);
static void games_collection_view_update_collection_name_validity (GamesCollectionView* self);
VALA_EXTERN void games_collection_view_set_is_collection_rename_valid (GamesCollectionView* self,
                                                           gboolean value);
VALA_EXTERN gboolean games_collection_manager_does_collection_title_exist (GamesCollectionManager* self,
                                                               const gchar* title);
VALA_EXTERN gboolean games_collection_view_get_is_collection_rename_valid (GamesCollectionView* self);
static void _games_collection_view_update_collection_name_validity_g_object_notify (GObject* _sender,
                                                                             GParamSpec* pspec,
                                                                             gpointer self);
static void games_collection_view_on_collection_rename_activated (GamesCollectionView* self);
VALA_EXTERN void games_user_collection_set_title (GamesUserCollection* self,
                                      const gchar* value);
VALA_EXTERN void games_collections_page_set_collection_title (GamesCollectionsPage* self,
                                                  const gchar* value);
VALA_EXTERN void games_collections_page_invalidate_sort (GamesCollectionsPage* self);
static void _games_collection_view_on_collection_rename_activated_gtk_button_clicked (GtkButton* _sender,
                                                                               gpointer self);
VALA_EXTERN GamesUserCollection** games_collections_page_get_selected_collections (GamesCollectionsPage* self,
                                                                       gint* result_length1);
VALA_EXTERN void games_selection_action_bar_update (GamesSelectionActionBar* self,
                                        GamesGame** games,
                                        gint games_length1);
static void _games_collection_view_on_selected_items_changed_games_collections_page_selected_items_changed (GamesCollectionsPage* _sender,
                                                                                                     gpointer self);
static void games_collection_view_on_collection_subpage_back_clicked (GamesCollectionView* self);
static void _games_collection_view_on_collection_subpage_back_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                   gpointer self);
static void games_collection_view_on_selection_mode_changed (GamesCollectionView* self);
VALA_EXTERN GType games_selection_action_bar_favorite_state_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void games_selection_action_bar_set_favorite_state (GamesSelectionActionBar* self,
                                                    GamesSelectionActionBarFavoriteState value);
static void _games_collection_view_on_selection_mode_changed_g_object_notify (GObject* _sender,
                                                                       GParamSpec* pspec,
                                                                       gpointer self);
static void games_collection_view_on_empty_collection_changed (GamesCollectionView* self);
static void games_collection_view_update_adaptive_state (GamesCollectionView* self);
static void games_collection_view_update_selection_availability (GamesCollectionView* self);
static void _games_collection_view_on_empty_collection_changed_g_object_notify (GObject* _sender,
                                                                         GParamSpec* pspec,
                                                                         gpointer self);
VALA_EXTERN gboolean games_collection_view_get_is_folded (GamesCollectionView* self);
VALA_EXTERN void games_collection_view_set_is_selection_available (GamesCollectionView* self,
                                                       gboolean value);
static void _games_collection_view_update_selection_availability_g_object_notify (GObject* _sender,
                                                                           GParamSpec* pspec,
                                                                           gpointer self);
static void games_collection_view_on_loading_notification_closed (GamesCollectionView* self);
VALA_EXTERN void games_collection_view_set_loading_notification (GamesCollectionView* self,
                                                     gboolean value);
static void _games_collection_view_on_loading_notification_closed_gtk_button_clicked (GtkButton* _sender,
                                                                               gpointer self);
static void games_collection_view_on_game_activated (GamesCollectionView* self,
                                              GamesGame* game);
static void _games_collection_view_on_game_activated_games_collections_page_game_activated (GamesCollectionsPage* _sender,
                                                                                     GamesGame* game,
                                                                                     gpointer self);
static void games_collection_view_on_visible_child_changed (GamesCollectionView* self);
VALA_EXTERN void games_games_page_reset_scroll_position (GamesGamesPage* self);
VALA_EXTERN void games_platforms_page_reset (GamesPlatformsPage* self);
VALA_EXTERN void games_collections_page_reset_scroll_position (GamesCollectionsPage* self);
VALA_EXTERN void games_collection_view_set_filtering_text (GamesCollectionView* self,
                                               const gchar* value);
static void games_collection_view_on_search_text_notify (GamesCollectionView* self);
static void _games_collection_view_on_visible_child_changed_g_object_notify (GObject* _sender,
                                                                      GParamSpec* pspec,
                                                                      gpointer self);
VALA_EXTERN const gchar* games_search_bar_get_text (GamesSearchBar* self);
VALA_EXTERN gboolean games_games_page_get_is_search_empty (GamesGamesPage* self);
VALA_EXTERN gboolean games_platforms_page_get_is_search_empty (GamesPlatformsPage* self);
VALA_EXTERN gboolean games_collections_page_get_is_search_empty (GamesCollectionsPage* self);
VALA_EXTERN void games_search_bar_focus_entry (GamesSearchBar* self);
static void _games_collection_view_on_search_text_notify_g_object_notify (GObject* _sender,
                                                                   GParamSpec* pspec,
                                                                   gpointer self);
static void games_collection_view_on_search_mode_changed (GamesCollectionView* self);
static void _games_collection_view_on_search_mode_changed_g_object_notify (GObject* _sender,
                                                                    GParamSpec* pspec,
                                                                    gpointer self);
static void games_collection_view_on_folded_changed (GamesCollectionView* self);
VALA_EXTERN gboolean games_collection_view_get_is_subview_open (GamesCollectionView* self);
static void _games_collection_view_on_folded_changed_g_object_notify (GObject* _sender,
                                                               GParamSpec* pspec,
                                                               gpointer self);
VALA_EXTERN gboolean games_collection_view_get_is_showing_bottom_bar (GamesCollectionView* self);
static void _games_collection_view_update_bottom_bar_g_object_notify (GObject* _sender,
                                                               GParamSpec* pspec,
                                                               gpointer self);
VALA_EXTERN void games_collection_view_set_is_showing_bottom_bar (GamesCollectionView* self,
                                                      gboolean value);
static void _games_collection_view_update_adaptive_state_g_object_notify (GObject* _sender,
                                                                   GParamSpec* pspec,
                                                                   gpointer self);
static void games_collection_view_on_subview_back_clicked (GamesCollectionView* self);
static void _games_collection_view_on_subview_back_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                        gpointer self);
VALA_EXTERN GamesCollectionView* games_collection_view_new (void);
VALA_EXTERN GamesCollectionView* games_collection_view_construct (GType object_type);
VALA_EXTERN void games_konami_code_reset (GamesKonamiCode* self);
VALA_EXTERN void games_collection_view_set_is_empty_collection (GamesCollectionView* self,
                                                    gboolean value);
static void games_collection_view_set_window (GamesCollectionView* self,
                                       GtkWindow* value);
VALA_EXTERN GamesGameModel* games_collection_view_get_game_model (GamesCollectionView* self);
VALA_EXTERN void games_collection_view_set_game_model (GamesCollectionView* self,
                                           GamesGameModel* value);
VALA_EXTERN void games_games_page_set_game_model (GamesGamesPage* self,
                                      GamesGameModel* value);
VALA_EXTERN void games_platforms_page_set_game_model (GamesPlatformsPage* self,
                                          GamesGameModel* value);
static void _games_collection_view_game_model___lambda53_ (GamesCollectionView* self);
static void __games_collection_view_game_model___lambda53__g_list_model_items_changed (GListModel* _sender,
                                                                                guint position,
                                                                                guint removed,
                                                                                guint added,
                                                                                gpointer self);
VALA_EXTERN GamesCollectionModel* games_collections_page_get_collection_model (GamesCollectionsPage* self);
VALA_EXTERN void games_collection_view_set_collection_model (GamesCollectionView* self,
                                                 GamesCollectionModel* value);
VALA_EXTERN void games_collections_page_set_collection_model (GamesCollectionsPage* self,
                                                  GamesCollectionModel* value);
VALA_EXTERN gboolean games_collection_view_get_loading_notification (GamesCollectionView* self);
VALA_EXTERN void games_collection_view_set_is_folded (GamesCollectionView* self,
                                          gboolean value);
VALA_EXTERN gboolean games_collection_view_get_is_search_available (GamesCollectionView* self);
VALA_EXTERN void games_collection_view_set_is_search_available (GamesCollectionView* self,
                                                    gboolean value);
VALA_EXTERN void games_collection_view_set_is_subview_open (GamesCollectionView* self,
                                                gboolean value);
VALA_EXTERN gboolean games_collection_view_get_is_selection_available (GamesCollectionView* self);
VALA_EXTERN gboolean games_collection_view_get_show_game_actions (GamesCollectionView* self);
VALA_EXTERN gboolean games_collection_view_get_show_remove_action_button (GamesCollectionView* self);
VALA_EXTERN gboolean games_collection_view_get_is_add_available (GamesCollectionView* self);
static GObject * games_collection_view_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties);
VALA_EXTERN GamesApplication* games_application_get_default (void);
VALA_EXTERN GamesCollectionManager* games_application_get_collection_manager (GamesApplication* self);
static void _games_collection_view___lambda54_ (GamesCollectionView* self);
VALA_EXTERN void games_collections_page_invalidate_filter (GamesCollectionsPage* self);
static void __games_collection_view___lambda54__games_collection_manager_collection_empty_changed (GamesCollectionManager* _sender,
                                                                                            GamesCollection* collection,
                                                                                            gpointer self);
VALA_EXTERN void games_collections_page_undo_remove_collection (GamesCollectionsPage* self);
static void _games_collections_page_undo_remove_collection_games_undo_notification_undo (GamesUndoNotification* _sender,
                                                                                  gpointer self);
static void _games_collections_page_finalize_collection_removal_games_undo_notification_closed (GamesUndoNotification* _sender,
                                                                                         gpointer self);
static void _games_collections_page_finalize_collection_removal_gtk_widget_destroy (GtkWidget* _sender,
                                                                             gpointer self);
VALA_EXTERN HdyLeaflet* games_platforms_page_get_leaflet (GamesPlatformsPage* self);
VALA_EXTERN HdyDeck* games_collections_page_get_collections_deck (GamesCollectionsPage* self);
VALA_EXTERN GamesKonamiCode* games_konami_code_new (GtkWidget* widget);
VALA_EXTERN GamesKonamiCode* games_konami_code_construct (GType object_type,
                                              GtkWidget* widget);
static void _games_collection_view_on_konami_code_performed_games_konami_code_code_performed (GamesKonamiCode* _sender,
                                                                                       gpointer self);
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_collection_view_finalize (GObject * obj);
static GType games_collection_view_get_type_once (void);
static void _vala_games_collection_view_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_games_collection_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 gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const GActionEntry GAMES_COLLECTION_VIEW_action_entries[8] = {{"select-all", _games_collection_view_select_all_gsimple_action_activate_callback}, {"select-none", _games_collection_view_select_none_gsimple_action_activate_callback}, {"toggle-select", _games_collection_view_toggle_select_gsimple_action_activate_callback}, {"favorite-action", _games_collection_view_favorite_action_gsimple_action_activate_callback}, {"add-to-collection", _games_collection_view_add_to_collection_gsimple_action_activate_callback}, {"remove-collection", _games_collection_view_remove_collection_gsimple_action_activate_callback}, {"rename-collection", _games_collection_view_rename_collection_gsimple_action_activate_callback}, {"remove-from-collection", _games_collection_view_remove_from_collection_gsimple_action_activate_callback}};

static inline gpointer
games_collection_view_get_instance_private (GamesCollectionView* self)
{
	return G_STRUCT_MEMBER_P (self, GamesCollectionView_private_offset);
}

static void
_games_collection_view_select_all_gsimple_action_activate_callback (GSimpleAction* action,
                                                                    GVariant* parameter,
                                                                    gpointer self)
{
	games_collection_view_select_all ((GamesCollectionView*) self);
}

static void
_games_collection_view_select_none_gsimple_action_activate_callback (GSimpleAction* action,
                                                                     GVariant* parameter,
                                                                     gpointer self)
{
	games_collection_view_select_none ((GamesCollectionView*) self);
}

static void
_games_collection_view_toggle_select_gsimple_action_activate_callback (GSimpleAction* action,
                                                                       GVariant* parameter,
                                                                       gpointer self)
{
	games_collection_view_toggle_select ((GamesCollectionView*) self);
}

static void
_games_collection_view_favorite_action_gsimple_action_activate_callback (GSimpleAction* action,
                                                                         GVariant* parameter,
                                                                         gpointer self)
{
	games_collection_view_favorite_action ((GamesCollectionView*) self);
}

static void
_games_collection_view_add_to_collection_gsimple_action_activate_callback (GSimpleAction* action,
                                                                           GVariant* parameter,
                                                                           gpointer self)
{
	games_collection_view_add_to_collection ((GamesCollectionView*) self);
}

static void
_games_collection_view_remove_collection_gsimple_action_activate_callback (GSimpleAction* action,
                                                                           GVariant* parameter,
                                                                           gpointer self)
{
	games_collection_view_remove_collection ((GamesCollectionView*) self);
}

static void
_games_collection_view_rename_collection_gsimple_action_activate_callback (GSimpleAction* action,
                                                                           GVariant* parameter,
                                                                           gpointer self)
{
	games_collection_view_rename_collection ((GamesCollectionView*) self);
}

static void
_games_collection_view_remove_from_collection_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                GVariant* parameter,
                                                                                gpointer self)
{
	games_collection_view_remove_from_collection ((GamesCollectionView*) self);
}

void
games_collection_view_show_error (GamesCollectionView* self,
                                  const gchar* error_message)
{
	GamesErrorInfoBar* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (error_message != NULL);
	_tmp0_ = self->priv->error_info_bar;
	games_error_info_bar_show_error (_tmp0_, error_message);
}

static gboolean
games_collection_view_real_on_button_pressed (GamesUiView* base,
                                              GdkEventButton* event)
{
	GamesCollectionView * self;
	gboolean result;
	self = (GamesCollectionView*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	result = FALSE;
	return result;
}

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

static gboolean
games_collection_view_real_on_key_pressed (GamesUiView* base,
                                           GdkEventKey* event)
{
	GamesCollectionView * 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 _tmp6_ = FALSE;
	gboolean _tmp7_ = FALSE;
	gboolean _tmp8_ = FALSE;
	gboolean _tmp18_ = FALSE;
	gboolean _tmp19_ = FALSE;
	gboolean _tmp20_ = FALSE;
	gboolean _tmp21_ = FALSE;
	gboolean _tmp28_ = FALSE;
	gboolean _tmp35_;
	gboolean _tmp36_;
	gboolean _tmp37_ = FALSE;
	gboolean _tmp38_;
	gboolean _tmp39_ = FALSE;
	gboolean _tmp40_;
	gboolean _tmp41_;
	GamesSearchBar* _tmp49_;
	gboolean result;
	self = (GamesCollectionView*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	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_;
	if ((event->state & default_modifiers) == GDK_MOD1_MASK) {
		gboolean _tmp9_ = FALSE;
		gboolean _tmp10_ = FALSE;
		GtkWindow* _tmp11_;
		_tmp11_ = self->priv->_window;
		if (gtk_widget_get_direction ((GtkWidget*) _tmp11_) == GTK_TEXT_DIR_LTR) {
			_tmp10_ = keyval == GDK_KEY_Left;
		} else {
			_tmp10_ = FALSE;
		}
		if (_tmp10_) {
			_tmp9_ = TRUE;
		} else {
			gboolean _tmp12_ = FALSE;
			GtkWindow* _tmp13_;
			_tmp13_ = self->priv->_window;
			if (gtk_widget_get_direction ((GtkWidget*) _tmp13_) == GTK_TEXT_DIR_RTL) {
				_tmp12_ = keyval == GDK_KEY_Right;
			} else {
				_tmp12_ = FALSE;
			}
			_tmp9_ = _tmp12_;
		}
		_tmp8_ = _tmp9_;
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		gboolean _tmp14_;
		_tmp14_ = self->priv->_is_selection_mode;
		_tmp7_ = !_tmp14_;
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		gboolean _tmp15_ = FALSE;
		HdyDeck* _tmp16_;
		_tmp16_ = self->priv->platforms_deck;
		if (hdy_deck_navigate (_tmp16_, HDY_NAVIGATION_DIRECTION_BACK)) {
			_tmp15_ = TRUE;
		} else {
			GamesCollectionsPage* _tmp17_;
			_tmp17_ = self->priv->collections_page;
			_tmp15_ = games_collections_page_exit_subpage (_tmp17_);
		}
		_tmp6_ = _tmp15_;
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		result = TRUE;
		_g_object_unref0 (keymap);
		return result;
	}
	if (keyval == GDK_KEY_f) {
		_tmp21_ = TRUE;
	} else {
		_tmp21_ = keyval == GDK_KEY_F;
	}
	if (_tmp21_) {
		_tmp20_ = (event->state & default_modifiers) == GDK_CONTROL_MASK;
	} else {
		_tmp20_ = FALSE;
	}
	if (_tmp20_) {
		GamesCollectionsPage* _tmp22_;
		gboolean _tmp23_;
		gboolean _tmp24_;
		_tmp22_ = self->priv->collections_page;
		_tmp23_ = games_collections_page_get_is_collection_empty (_tmp22_);
		_tmp24_ = _tmp23_;
		_tmp19_ = !_tmp24_;
	} else {
		_tmp19_ = FALSE;
	}
	if (_tmp19_) {
		gboolean _tmp25_;
		gboolean _tmp26_;
		_tmp25_ = games_collection_view_get_is_empty_collection (self);
		_tmp26_ = _tmp25_;
		_tmp18_ = !_tmp26_;
	} else {
		_tmp18_ = FALSE;
	}
	if (_tmp18_) {
		gboolean _tmp27_;
		_tmp27_ = self->priv->_search_mode;
		if (!_tmp27_) {
			games_collection_view_set_search_mode (self, TRUE);
		}
		result = TRUE;
		_g_object_unref0 (keymap);
		return result;
	}
	if (keyval == GDK_KEY_question) {
		_tmp28_ = (event->state & default_modifiers) == (GDK_CONTROL_MASK | GDK_SHIFT_MASK);
	} else {
		_tmp28_ = FALSE;
	}
	if (_tmp28_) {
		GtkApplicationWindow* win = NULL;
		GtkWindow* _tmp29_;
		GtkApplicationWindow* _tmp30_;
		GAction* action = NULL;
		GtkApplicationWindow* _tmp31_;
		GAction* _tmp32_;
		GAction* _tmp33_;
		GAction* _tmp34_;
		_tmp29_ = self->priv->_window;
		_tmp30_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp29_, gtk_application_window_get_type ()) ? ((GtkApplicationWindow*) _tmp29_) : NULL);
		win = _tmp30_;
		_tmp31_ = win;
		_tmp32_ = g_action_map_lookup_action ((GActionMap*) _tmp31_, "show-help-overlay");
		_tmp33_ = _g_object_ref0 (_tmp32_);
		action = _tmp33_;
		_tmp34_ = action;
		g_action_activate (_tmp34_, NULL);
		result = TRUE;
		_g_object_unref0 (action);
		_g_object_unref0 (win);
		_g_object_unref0 (keymap);
		return result;
	}
	_tmp35_ = games_collection_view_get_is_empty_collection (self);
	_tmp36_ = _tmp35_;
	if (_tmp36_) {
		result = FALSE;
		_g_object_unref0 (keymap);
		return result;
	}
	_tmp38_ = self->priv->_is_selection_mode;
	if (_tmp38_) {
		_tmp37_ = keyval == GDK_KEY_Escape;
	} else {
		_tmp37_ = FALSE;
	}
	if (_tmp37_) {
		games_collection_view_toggle_select (self);
		result = TRUE;
		_g_object_unref0 (keymap);
		return result;
	}
	_tmp40_ = games_collection_view_get_is_empty_collection (self);
	_tmp41_ = _tmp40_;
	if (_tmp41_) {
		_tmp39_ = TRUE;
	} else {
		gboolean _tmp42_ = FALSE;
		GamesCollectionsPage* _tmp43_;
		gboolean _tmp44_;
		gboolean _tmp45_;
		_tmp43_ = self->priv->collections_page;
		_tmp44_ = games_collections_page_get_is_subpage_open (_tmp43_);
		_tmp45_ = _tmp44_;
		if (_tmp45_) {
			GamesCollectionsPage* _tmp46_;
			gboolean _tmp47_;
			gboolean _tmp48_;
			_tmp46_ = self->priv->collections_page;
			_tmp47_ = games_collections_page_get_is_collection_empty (_tmp46_);
			_tmp48_ = _tmp47_;
			_tmp42_ = _tmp48_;
		} else {
			_tmp42_ = FALSE;
		}
		_tmp39_ = _tmp42_;
	}
	if (_tmp39_) {
		result = FALSE;
		_g_object_unref0 (keymap);
		return result;
	}
	_tmp49_ = self->priv->search_bar;
	result = games_search_bar_handle_event (_tmp49_, (GdkEvent*) event);
	_g_object_unref0 (keymap);
	return result;
}

static gboolean
games_collection_view_real_gamepad_button_press_event (GamesUiView* base,
                                                       ManetteEvent* event)
{
	GamesCollectionView * self;
	GtkWindow* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	guint16 button = 0U;
	guint16 _tmp3_ = 0U;
	gboolean _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	gboolean result;
	self = (GamesCollectionView*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = self->priv->_window;
	g_object_get (_tmp0_, "is-active", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		result = FALSE;
		return result;
	}
	if (!gtk_widget_get_mapped ((GtkWidget*) self)) {
		result = FALSE;
		return result;
	}
	_tmp4_ = manette_event_get_button (event, &_tmp3_);
	button = _tmp3_;
	if (!_tmp4_) {
		result = FALSE;
		return result;
	}
	_tmp5_ = games_collection_view_get_is_empty_collection (self);
	_tmp6_ = _tmp5_;
	if (_tmp6_) {
		result = FALSE;
		return result;
	}
	switch (button) {
		case BTN_TL:
		{
			gboolean _tmp7_ = FALSE;
			gboolean _tmp8_;
			GList* views = NULL;
			GtkStack* _tmp12_;
			GList* _tmp13_;
			GList* current_view = NULL;
			GList* _tmp14_;
			GtkStack* _tmp15_;
			GtkWidget* _tmp16_;
			GtkWidget* _tmp17_;
			GList* _tmp18_;
			GList* _tmp19_;
			GList* _tmp20_;
			GList* _tmp21_;
			_tmp8_ = self->priv->_is_selection_mode;
			if (_tmp8_) {
				_tmp7_ = TRUE;
			} else {
				GamesCollectionsPage* _tmp9_;
				gboolean _tmp10_;
				gboolean _tmp11_;
				_tmp9_ = self->priv->collections_page;
				_tmp10_ = games_collections_page_get_is_subpage_open (_tmp9_);
				_tmp11_ = _tmp10_;
				_tmp7_ = _tmp11_;
			}
			if (_tmp7_) {
				result = TRUE;
				return result;
			}
			_tmp12_ = self->priv->viewstack;
			_tmp13_ = gtk_container_get_children ((GtkContainer*) _tmp12_);
			views = _tmp13_;
			_tmp14_ = views;
			_tmp15_ = self->priv->viewstack;
			_tmp16_ = gtk_stack_get_visible_child (_tmp15_);
			_tmp17_ = _tmp16_;
			_tmp18_ = g_list_find (_tmp14_, _tmp17_);
			current_view = _tmp18_;
			_tmp19_ = current_view;
			_vala_assert (_tmp19_ != NULL, "current_view != null");
			_tmp20_ = current_view;
			_tmp21_ = _tmp20_->prev;
			if (_tmp21_ != NULL) {
				GtkStack* _tmp22_;
				GList* _tmp23_;
				GList* _tmp24_;
				gconstpointer _tmp25_;
				_tmp22_ = self->priv->viewstack;
				_tmp23_ = current_view;
				_tmp24_ = _tmp23_->prev;
				_tmp25_ = _tmp24_->data;
				gtk_stack_set_visible_child (_tmp22_, (GtkWidget*) _tmp25_);
			}
			result = TRUE;
			(views == NULL) ? NULL : (views = (g_list_free (views), NULL));
			return result;
		}
		case BTN_TR:
		{
			gboolean _tmp26_ = FALSE;
			gboolean _tmp27_;
			GList* views = NULL;
			GtkStack* _tmp31_;
			GList* _tmp32_;
			GList* current_view = NULL;
			GList* _tmp33_;
			GtkStack* _tmp34_;
			GtkWidget* _tmp35_;
			GtkWidget* _tmp36_;
			GList* _tmp37_;
			GList* _tmp38_;
			GList* _tmp39_;
			GList* _tmp40_;
			_tmp27_ = self->priv->_is_selection_mode;
			if (_tmp27_) {
				_tmp26_ = TRUE;
			} else {
				GamesCollectionsPage* _tmp28_;
				gboolean _tmp29_;
				gboolean _tmp30_;
				_tmp28_ = self->priv->collections_page;
				_tmp29_ = games_collections_page_get_is_subpage_open (_tmp28_);
				_tmp30_ = _tmp29_;
				_tmp26_ = _tmp30_;
			}
			if (_tmp26_) {
				result = TRUE;
				return result;
			}
			_tmp31_ = self->priv->viewstack;
			_tmp32_ = gtk_container_get_children ((GtkContainer*) _tmp31_);
			views = _tmp32_;
			_tmp33_ = views;
			_tmp34_ = self->priv->viewstack;
			_tmp35_ = gtk_stack_get_visible_child (_tmp34_);
			_tmp36_ = _tmp35_;
			_tmp37_ = g_list_find (_tmp33_, _tmp36_);
			current_view = _tmp37_;
			_tmp38_ = current_view;
			_vala_assert (_tmp38_ != NULL, "current_view != null");
			_tmp39_ = current_view;
			_tmp40_ = _tmp39_->next;
			if (_tmp40_ != NULL) {
				GtkStack* _tmp41_;
				GList* _tmp42_;
				GList* _tmp43_;
				gconstpointer _tmp44_;
				_tmp41_ = self->priv->viewstack;
				_tmp42_ = current_view;
				_tmp43_ = _tmp42_->next;
				_tmp44_ = _tmp43_->data;
				gtk_stack_set_visible_child (_tmp41_, (GtkWidget*) _tmp44_);
			}
			result = TRUE;
			(views == NULL) ? NULL : (views = (g_list_free (views), NULL));
			return result;
		}
		default:
		{
			GtkStack* _tmp45_;
			GtkWidget* _tmp46_;
			GtkWidget* _tmp47_;
			GamesPlatformsPage* _tmp48_;
			_tmp45_ = self->priv->viewstack;
			_tmp46_ = gtk_stack_get_visible_child (_tmp45_);
			_tmp47_ = _tmp46_;
			_tmp48_ = self->priv->platforms_page;
			if (_tmp47_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp48_, gtk_widget_get_type (), GtkWidget)) {
				GamesPlatformsPage* _tmp49_;
				_tmp49_ = self->priv->platforms_page;
				result = games_platforms_page_gamepad_button_press_event (_tmp49_, event);
				return result;
			} else {
				GtkStack* _tmp50_;
				GtkWidget* _tmp51_;
				GtkWidget* _tmp52_;
				GamesGamesPage* _tmp53_;
				_tmp50_ = self->priv->viewstack;
				_tmp51_ = gtk_stack_get_visible_child (_tmp50_);
				_tmp52_ = _tmp51_;
				_tmp53_ = self->priv->games_page;
				if (_tmp52_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, gtk_widget_get_type (), GtkWidget)) {
					GamesGamesPage* _tmp54_;
					_tmp54_ = self->priv->games_page;
					result = games_games_page_gamepad_button_press_event (_tmp54_, event);
					return result;
				} else {
					GamesCollectionsPage* _tmp55_;
					_tmp55_ = self->priv->collections_page;
					result = games_collections_page_gamepad_button_press_event (_tmp55_, event);
					return result;
				}
			}
		}
	}
}

static gboolean
games_collection_view_real_gamepad_button_release_event (GamesUiView* base,
                                                         ManetteEvent* event)
{
	GamesCollectionView * self;
	GtkWindow* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GtkStack* _tmp3_;
	GtkWidget* _tmp4_;
	GtkWidget* _tmp5_;
	GamesPlatformsPage* _tmp6_;
	gboolean result;
	self = (GamesCollectionView*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = self->priv->_window;
	g_object_get (_tmp0_, "is-active", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		result = FALSE;
		return result;
	}
	if (!gtk_widget_get_mapped ((GtkWidget*) self)) {
		result = FALSE;
		return result;
	}
	_tmp3_ = self->priv->viewstack;
	_tmp4_ = gtk_stack_get_visible_child (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = self->priv->platforms_page;
	if (_tmp5_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget)) {
		GamesPlatformsPage* _tmp7_;
		_tmp7_ = self->priv->platforms_page;
		result = games_platforms_page_gamepad_button_release_event (_tmp7_, event);
		return result;
	} else {
		GtkStack* _tmp8_;
		GtkWidget* _tmp9_;
		GtkWidget* _tmp10_;
		GamesGamesPage* _tmp11_;
		_tmp8_ = self->priv->viewstack;
		_tmp9_ = gtk_stack_get_visible_child (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = self->priv->games_page;
		if (_tmp10_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_widget_get_type (), GtkWidget)) {
			GamesGamesPage* _tmp12_;
			_tmp12_ = self->priv->games_page;
			result = games_games_page_gamepad_button_release_event (_tmp12_, event);
			return result;
		} else {
			GamesCollectionsPage* _tmp13_;
			_tmp13_ = self->priv->collections_page;
			result = games_collections_page_gamepad_button_release_event (_tmp13_, event);
			return result;
		}
	}
}

static gboolean
games_collection_view_real_gamepad_absolute_axis_event (GamesUiView* base,
                                                        ManetteEvent* event)
{
	GamesCollectionView * self;
	GtkWindow* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GtkStack* _tmp3_;
	GtkWidget* _tmp4_;
	GtkWidget* _tmp5_;
	GamesPlatformsPage* _tmp6_;
	gboolean result;
	self = (GamesCollectionView*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = self->priv->_window;
	g_object_get (_tmp0_, "is-active", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		result = FALSE;
		return result;
	}
	if (!gtk_widget_get_mapped ((GtkWidget*) self)) {
		result = FALSE;
		return result;
	}
	_tmp3_ = self->priv->viewstack;
	_tmp4_ = gtk_stack_get_visible_child (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = self->priv->platforms_page;
	if (_tmp5_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget)) {
		GamesPlatformsPage* _tmp7_;
		_tmp7_ = self->priv->platforms_page;
		result = games_platforms_page_gamepad_absolute_axis_event (_tmp7_, event);
		return result;
	} else {
		GtkStack* _tmp8_;
		GtkWidget* _tmp9_;
		GtkWidget* _tmp10_;
		GamesGamesPage* _tmp11_;
		_tmp8_ = self->priv->viewstack;
		_tmp9_ = gtk_stack_get_visible_child (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = self->priv->games_page;
		if (_tmp10_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_widget_get_type (), GtkWidget)) {
			GamesGamesPage* _tmp12_;
			_tmp12_ = self->priv->games_page;
			result = games_games_page_gamepad_absolute_axis_event (_tmp12_, event);
			return result;
		} else {
			GamesCollectionsPage* _tmp13_;
			_tmp13_ = self->priv->collections_page;
			result = games_collections_page_gamepad_absolute_axis_event (_tmp13_, event);
			return result;
		}
	}
}

static void
games_collection_view_on_konami_code_performed (GamesCollectionView* self)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = games_ui_view_get_is_view_active ((GamesUiView*) self);
	_tmp1_ = _tmp0_;
	if (!_tmp1_) {
		return;
	}
	{
		GtkWindow* _tmp2_;
		_tmp2_ = self->priv->_window;
		gtk_show_uri_on_window (_tmp2_, GAMES_COLLECTION_VIEW_CONTRIBUTE_URI, gtk_get_current_event_time (), &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		g_critical ("collection-view.vala:333: %s", _tmp4_);
		_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;
	}
}

void
games_collection_view_run_search (GamesCollectionView* self,
                                  const gchar* query)
{
	GamesSearchBar* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (query != NULL);
	games_collection_view_set_search_mode (self, TRUE);
	_tmp0_ = self->priv->search_bar;
	games_search_bar_run_search (_tmp0_, query);
}

static void
games_collection_view_select_none (GamesCollectionView* self)
{
	GamesPlatformsPage* _tmp0_;
	GamesGamesPage* _tmp1_;
	GamesCollectionsPage* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->platforms_page;
	games_platforms_page_select_none (_tmp0_);
	_tmp1_ = self->priv->games_page;
	games_games_page_select_none (_tmp1_);
	_tmp2_ = self->priv->collections_page;
	games_collections_page_select_none (_tmp2_);
	games_collection_view_on_selected_items_changed (self);
}

static void
games_collection_view_select_all (GamesCollectionView* self)
{
	GtkStack* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GamesPlatformsPage* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->viewstack;
	_tmp1_ = gtk_stack_get_visible_child (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->platforms_page;
	if (_tmp2_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget)) {
		GamesPlatformsPage* _tmp4_;
		_tmp4_ = self->priv->platforms_page;
		games_platforms_page_select_all (_tmp4_);
	} else {
		GtkStack* _tmp5_;
		GtkWidget* _tmp6_;
		GtkWidget* _tmp7_;
		GamesGamesPage* _tmp8_;
		_tmp5_ = self->priv->viewstack;
		_tmp6_ = gtk_stack_get_visible_child (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = self->priv->games_page;
		if (_tmp7_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_widget_get_type (), GtkWidget)) {
			GamesGamesPage* _tmp9_;
			_tmp9_ = self->priv->games_page;
			games_games_page_select_all (_tmp9_);
		} else {
			GamesCollectionsPage* _tmp10_;
			_tmp10_ = self->priv->collections_page;
			games_collections_page_select_all (_tmp10_);
		}
	}
	games_collection_view_on_selected_items_changed (self);
}

static void
games_collection_view_toggle_select (GamesCollectionView* self)
{
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_is_selection_mode;
	games_collection_view_set_is_selection_mode (self, !_tmp0_);
}

static GamesGame**
games_collection_view_get_currently_selected_games (GamesCollectionView* self,
                                                    gint* result_length1)
{
	GamesGame** games = NULL;
	gint games_length1 = 0;
	gint _games_size_ = 0;
	GtkStack* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GamesGamesPage* _tmp3_;
	GamesGame** _tmp17_;
	gint _tmp17__length1;
	GamesGame** result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->viewstack;
	_tmp1_ = gtk_stack_get_visible_child (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->games_page;
	if (_tmp2_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget)) {
		GamesGamesPage* _tmp4_;
		gint _tmp5_ = 0;
		GamesGame** _tmp6_;
		_tmp4_ = self->priv->games_page;
		_tmp6_ = games_games_page_get_selected_games (_tmp4_, &_tmp5_);
		games = (_vala_array_free (games, games_length1, (GDestroyNotify) g_object_unref), NULL);
		games = _tmp6_;
		games_length1 = _tmp5_;
		_games_size_ = games_length1;
	} else {
		GtkStack* _tmp7_;
		GtkWidget* _tmp8_;
		GtkWidget* _tmp9_;
		GamesPlatformsPage* _tmp10_;
		_tmp7_ = self->priv->viewstack;
		_tmp8_ = gtk_stack_get_visible_child (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = self->priv->platforms_page;
		if (_tmp9_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_widget_get_type (), GtkWidget)) {
			GamesPlatformsPage* _tmp11_;
			gint _tmp12_ = 0;
			GamesGame** _tmp13_;
			_tmp11_ = self->priv->platforms_page;
			_tmp13_ = games_platforms_page_get_selected_games (_tmp11_, &_tmp12_);
			games = (_vala_array_free (games, games_length1, (GDestroyNotify) g_object_unref), NULL);
			games = _tmp13_;
			games_length1 = _tmp12_;
			_games_size_ = games_length1;
		} else {
			GamesCollectionsPage* _tmp14_;
			gint _tmp15_ = 0;
			GamesGame** _tmp16_;
			_tmp14_ = self->priv->collections_page;
			_tmp16_ = games_collections_page_get_selected_games (_tmp14_, &_tmp15_);
			games = (_vala_array_free (games, games_length1, (GDestroyNotify) g_object_unref), NULL);
			games = _tmp16_;
			games_length1 = _tmp15_;
			_games_size_ = games_length1;
		}
	}
	_tmp17_ = games;
	_tmp17__length1 = games_length1;
	if (result_length1) {
		*result_length1 = _tmp17__length1;
	}
	result = _tmp17_;
	return result;
}

static void
__lambda52_ (GamesCollectionView* self,
             GamesCollection** collections,
             gint collections_length1)
{
	GamesGame** games = NULL;
	gint _tmp0_ = 0;
	GamesGame** _tmp1_;
	gint games_length1;
	gint _games_size_;
	_tmp1_ = games_collection_view_get_currently_selected_games (self, &_tmp0_);
	games = _tmp1_;
	games_length1 = _tmp0_;
	_games_size_ = games_length1;
	{
		GamesCollection** collection_collection = NULL;
		gint collection_collection_length1 = 0;
		gint _collection_collection_size_ = 0;
		gint collection_it = 0;
		collection_collection = collections;
		collection_collection_length1 = collections_length1;
		for (collection_it = 0; collection_it < collection_collection_length1; collection_it = collection_it + 1) {
			GamesCollection* _tmp2_;
			GamesCollection* collection = NULL;
			_tmp2_ = _g_object_ref0 (collection_collection[collection_it]);
			collection = _tmp2_;
			{
				GamesCollection* _tmp3_;
				GamesGame** _tmp4_;
				gint _tmp4__length1;
				_tmp3_ = collection;
				_tmp4_ = games;
				_tmp4__length1 = games_length1;
				games_collection_add_games (_tmp3_, _tmp4_, (gint) _tmp4__length1);
				_g_object_unref0 (collection);
			}
		}
	}
	games_collection_view_select_none (self);
	games = (_vala_array_free (games, games_length1, (GDestroyNotify) g_object_unref), NULL);
}

static void
___lambda52__games_collection_action_window_confirmed (GamesCollectionActionWindow* _sender,
                                                       GamesCollection** collections,
                                                       gint collections_length1,
                                                       gpointer self)
{
	__lambda52_ ((GamesCollectionView*) self, collections, collections_length1);
}

static void
games_collection_view_add_to_collection (GamesCollectionView* self)
{
	GamesCollectionsPage* _tmp0_;
	GamesCollection* _tmp1_ = NULL;
	GamesCollectionsPage* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	GamesCollection* current_collection = NULL;
	GamesCollection* _tmp8_;
	GamesCollectionActionWindow* dialog = NULL;
	GamesCollectionActionWindow* _tmp9_;
	GamesCollectionModel* _tmp10_;
	GamesCollectionModel* _tmp11_;
	GtkWidget* _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->collections_page;
	games_collections_page_finalize_collection_removal (_tmp0_);
	_tmp2_ = self->priv->collections_page;
	_tmp3_ = games_collections_page_get_is_subpage_open (_tmp2_);
	_tmp4_ = _tmp3_;
	if (!_tmp4_) {
		_tmp1_ = NULL;
	} else {
		GamesCollectionsPage* _tmp5_;
		GamesCollection* _tmp6_;
		GamesCollection* _tmp7_;
		_tmp5_ = self->priv->collections_page;
		_tmp6_ = games_collections_page_get_current_collection (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp1_ = _tmp7_;
	}
	_tmp8_ = _g_object_ref0 (_tmp1_);
	current_collection = _tmp8_;
	_tmp9_ = games_collection_action_window_new (FALSE, current_collection);
	g_object_ref_sink (_tmp9_);
	dialog = _tmp9_;
	_tmp10_ = games_collection_view_get_collection_model (self);
	_tmp11_ = _tmp10_;
	games_collection_action_window_set_collection_model (dialog, _tmp11_);
	_tmp12_ = gtk_widget_get_toplevel ((GtkWidget*) self);
	gtk_window_set_transient_for ((GtkWindow*) dialog, (GtkWindow*) (GAMES_IS_APPLICATION_WINDOW (_tmp12_) ? ((GamesApplicationWindow*) _tmp12_) : NULL));
	gtk_window_set_modal ((GtkWindow*) dialog, TRUE);
	gtk_widget_set_visible ((GtkWidget*) dialog, TRUE);
	g_signal_connect_object (dialog, "confirmed", (GCallback) ___lambda52__games_collection_action_window_confirmed, self, 0);
	_g_object_unref0 (dialog);
	_g_object_unref0 (current_collection);
}

static void
games_collection_view_favorite_action (GamesCollectionView* self)
{
	GamesCollectionManager* _tmp0_;
	gint _tmp1_ = 0;
	GamesGame** _tmp2_;
	GamesGame** _tmp3_;
	gint _tmp3__length1;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	GtkStack* _tmp6_;
	GtkWidget* _tmp7_;
	GtkWidget* _tmp8_;
	GamesCollectionsPage* _tmp9_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->collection_manager;
	_tmp2_ = games_collection_view_get_currently_selected_games (self, &_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp3__length1 = _tmp1_;
	games_collection_manager_toggle_favorite (_tmp0_, _tmp3_, (gint) _tmp1_);
	_tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp6_ = self->priv->viewstack;
	_tmp7_ = gtk_stack_get_visible_child (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = self->priv->collections_page;
	if (_tmp8_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_widget_get_type (), GtkWidget)) {
		GamesCollectionsPage* _tmp10_;
		gboolean _tmp11_;
		gboolean _tmp12_;
		_tmp10_ = self->priv->collections_page;
		_tmp11_ = games_collections_page_get_is_subpage_open (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp5_ = _tmp12_;
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		GamesCollectionsPage* _tmp13_;
		GamesCollection* _tmp14_;
		GamesCollection* _tmp15_;
		gchar* _tmp16_;
		gchar* _tmp17_;
		_tmp13_ = self->priv->collections_page;
		_tmp14_ = games_collections_page_get_current_collection (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = games_collection_get_id (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp4_ = g_strcmp0 (_tmp17_, "Favorites") == 0;
		_g_free0 (_tmp17_);
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		GamesCollectionsPage* _tmp18_;
		_tmp18_ = self->priv->collections_page;
		games_collections_page_update_is_collection_empty (_tmp18_);
		games_collection_view_select_none (self);
		games_collection_view_toggle_select (self);
		return;
	}
	games_collection_view_on_selected_items_changed (self);
}

void
games_collection_view_remove_collection (GamesCollectionView* self)
{
	GtkStack* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GamesCollectionsPage* _tmp3_;
	gboolean _tmp4_ = FALSE;
	GamesCollectionsPage* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	GamesUndoNotification* _tmp13_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->viewstack;
	_tmp1_ = gtk_stack_get_visible_child (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->collections_page;
	if (_tmp2_ != G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget)) {
		return;
	}
	_tmp5_ = self->priv->collections_page;
	_tmp6_ = games_collections_page_get_is_subpage_open (_tmp5_);
	_tmp7_ = _tmp6_;
	if (_tmp7_) {
		GamesCollectionsPage* _tmp8_;
		gboolean _tmp9_;
		gboolean _tmp10_;
		_tmp8_ = self->priv->collections_page;
		_tmp9_ = games_collections_page_get_is_showing_user_collection (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp4_ = _tmp10_;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		GamesCollectionsPage* _tmp11_;
		_tmp11_ = self->priv->collections_page;
		games_collections_page_remove_current_user_collection (_tmp11_);
	} else {
		GamesCollectionsPage* _tmp12_;
		_tmp12_ = self->priv->collections_page;
		games_collections_page_remove_currently_selected_user_collections (_tmp12_);
	}
	_tmp13_ = self->priv->undo_notification;
	games_undo_notification_show_notification (_tmp13_);
	games_collection_view_set_is_selection_mode (self, FALSE);
}

void
games_collection_view_rename_collection (GamesCollectionView* self)
{
	GamesCollectionsPage* _tmp0_;
	GamesCollection* _tmp1_;
	GamesCollection* _tmp2_;
	GtkEntry* _tmp3_;
	GamesCollectionsPage* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	GtkPopover* _tmp7_;
	GtkEntry* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->collections_page;
	_tmp1_ = games_collections_page_get_current_collection (_tmp0_);
	_tmp2_ = _tmp1_;
	_vala_assert (GAMES_IS_USER_COLLECTION (_tmp2_), "collections_page.current_collection is UserCollection");
	_tmp3_ = self->priv->collection_rename_entry;
	_tmp4_ = self->priv->collections_page;
	_tmp5_ = games_collections_page_get_collection_title (_tmp4_);
	_tmp6_ = _tmp5_;
	gtk_entry_set_text (_tmp3_, _tmp6_);
	_tmp7_ = self->priv->rename_popover;
	gtk_popover_popup (_tmp7_);
	_tmp8_ = self->priv->collection_rename_entry;
	gtk_widget_grab_focus ((GtkWidget*) _tmp8_);
}

static void
games_collection_view_remove_from_collection (GamesCollectionView* self)
{
	gboolean _tmp0_ = FALSE;
	GamesCollectionsPage* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GamesGame** games = NULL;
	gint _tmp7_ = 0;
	GamesGame** _tmp8_;
	gint games_length1;
	gint _games_size_;
	GamesCollectionsPage* _tmp9_;
	GamesCollection* _tmp10_;
	GamesCollection* _tmp11_;
	GamesGame** _tmp12_;
	gint _tmp12__length1;
	GamesCollectionsPage* _tmp13_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->collections_page;
	_tmp2_ = games_collections_page_get_is_subpage_open (_tmp1_);
	_tmp3_ = _tmp2_;
	if (!_tmp3_) {
		_tmp0_ = TRUE;
	} else {
		GamesCollectionsPage* _tmp4_;
		GamesCollection* _tmp5_;
		GamesCollection* _tmp6_;
		_tmp4_ = self->priv->collections_page;
		_tmp5_ = games_collections_page_get_current_collection (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp0_ = _tmp6_ == NULL;
	}
	if (_tmp0_) {
		return;
	}
	_tmp8_ = games_collection_view_get_currently_selected_games (self, &_tmp7_);
	games = _tmp8_;
	games_length1 = _tmp7_;
	_games_size_ = games_length1;
	_tmp9_ = self->priv->collections_page;
	_tmp10_ = games_collections_page_get_current_collection (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = games;
	_tmp12__length1 = games_length1;
	games_collection_remove_games (_tmp11_, _tmp12_, (gint) _tmp12__length1);
	_tmp13_ = self->priv->collections_page;
	games_collections_page_update_is_collection_empty (_tmp13_);
	games_collection_view_select_none (self);
	games = (_vala_array_free (games, games_length1, (GDestroyNotify) g_object_unref), NULL);
}

static void
games_collection_view_update_available_selection_actions (GamesCollectionView* self)
{
	gboolean _tmp0_ = FALSE;
	GtkStack* _tmp1_;
	GtkWidget* _tmp2_;
	GtkWidget* _tmp3_;
	GamesCollectionsPage* _tmp4_;
	gboolean _tmp8_ = FALSE;
	GtkStack* _tmp9_;
	GtkWidget* _tmp10_;
	GtkWidget* _tmp11_;
	GamesCollectionsPage* _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->viewstack;
	_tmp2_ = gtk_stack_get_visible_child (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = self->priv->collections_page;
	if (_tmp3_ != G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget)) {
		_tmp0_ = TRUE;
	} else {
		GamesCollectionsPage* _tmp5_;
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp5_ = self->priv->collections_page;
		_tmp6_ = games_collections_page_get_is_subpage_open (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp0_ = _tmp7_;
	}
	games_collection_view_set_show_game_actions (self, _tmp0_);
	_tmp9_ = self->priv->viewstack;
	_tmp10_ = gtk_stack_get_visible_child (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = self->priv->collections_page;
	if (_tmp11_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_widget_get_type (), GtkWidget)) {
		GamesCollectionsPage* _tmp13_;
		gboolean _tmp14_;
		gboolean _tmp15_;
		_tmp13_ = self->priv->collections_page;
		_tmp14_ = games_collections_page_get_is_subpage_open (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp8_ = !_tmp15_;
	} else {
		_tmp8_ = FALSE;
	}
	games_collection_view_set_show_remove_action_button (self, _tmp8_);
}

static void
games_collection_view_update_add_game_availablity (GamesCollectionView* self)
{
	GtkStack* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GamesCollectionsPage* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->viewstack;
	_tmp1_ = gtk_stack_get_visible_child (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->collections_page;
	games_collection_view_set_is_add_available (self, _tmp2_ != G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget));
}

static void
games_collection_view_update_search_filters (GamesCollectionView* self)
{
	GtkStack* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GamesGamesPage* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->viewstack;
	_tmp1_ = gtk_stack_get_visible_child (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->games_page;
	if (_tmp2_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget)) {
		GamesGamesPage* _tmp4_;
		gchar** _tmp5_;
		gint _tmp5__length1;
		_tmp4_ = self->priv->games_page;
		_tmp5_ = self->filtering_terms;
		_tmp5__length1 = self->filtering_terms_length1;
		games_games_page_set_filter (_tmp4_, _tmp5_, (gint) _tmp5__length1);
	} else {
		GtkStack* _tmp6_;
		GtkWidget* _tmp7_;
		GtkWidget* _tmp8_;
		GamesPlatformsPage* _tmp9_;
		_tmp6_ = self->priv->viewstack;
		_tmp7_ = gtk_stack_get_visible_child (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = self->priv->platforms_page;
		if (_tmp8_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_widget_get_type (), GtkWidget)) {
			GamesPlatformsPage* _tmp10_;
			gchar** _tmp11_;
			gint _tmp11__length1;
			_tmp10_ = self->priv->platforms_page;
			_tmp11_ = self->filtering_terms;
			_tmp11__length1 = self->filtering_terms_length1;
			games_platforms_page_set_filter (_tmp10_, _tmp11_, (gint) _tmp11__length1);
		} else {
			GamesCollectionsPage* _tmp12_;
			gchar** _tmp13_;
			gint _tmp13__length1;
			_tmp12_ = self->priv->collections_page;
			_tmp13_ = self->filtering_terms;
			_tmp13__length1 = self->filtering_terms_length1;
			games_collections_page_set_filter (_tmp12_, _tmp13_, (gint) _tmp13__length1);
		}
	}
}

static void
games_collection_view_on_collection_subpage_opened (GamesCollectionView* self)
{
	g_return_if_fail (self != NULL);
	games_collection_view_update_bottom_bar (self);
	games_collection_view_update_available_selection_actions (self);
	games_collection_view_set_search_mode (self, FALSE);
}

static void
_games_collection_view_on_collection_subpage_opened_g_object_notify (GObject* _sender,
                                                                     GParamSpec* pspec,
                                                                     gpointer self)
{
	games_collection_view_on_collection_subpage_opened ((GamesCollectionView*) self);
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static void
games_collection_view_update_collection_name_validity (GamesCollectionView* self)
{
	gchar* name = NULL;
	GtkEntry* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	GamesCollectionsPage* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	gboolean _tmp15_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->collection_rename_entry;
	_tmp1_ = gtk_entry_get_text (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = string_strip (_tmp2_);
	name = _tmp3_;
	_tmp4_ = name;
	_tmp5_ = self->priv->collections_page;
	_tmp6_ = games_collections_page_get_collection_title (_tmp5_);
	_tmp7_ = _tmp6_;
	if (g_strcmp0 (_tmp4_, _tmp7_) == 0) {
		GtkLabel* _tmp8_;
		games_collection_view_set_is_collection_rename_valid (self, TRUE);
		_tmp8_ = self->priv->collection_rename_error_label;
		gtk_label_set_label (_tmp8_, "");
	} else {
		const gchar* _tmp9_;
		_tmp9_ = name;
		if (g_strcmp0 (_tmp9_, "") == 0) {
			GtkLabel* _tmp10_;
			games_collection_view_set_is_collection_rename_valid (self, FALSE);
			_tmp10_ = self->priv->collection_rename_error_label;
			gtk_label_set_label (_tmp10_, _ ("Collection name cannot be empty"));
		} else {
			GamesCollectionManager* _tmp11_;
			const gchar* _tmp12_;
			_tmp11_ = self->priv->collection_manager;
			_tmp12_ = name;
			if (games_collection_manager_does_collection_title_exist (_tmp11_, _tmp12_)) {
				GtkLabel* _tmp13_;
				games_collection_view_set_is_collection_rename_valid (self, FALSE);
				_tmp13_ = self->priv->collection_rename_error_label;
				gtk_label_set_label (_tmp13_, _ ("A collection with this name already exists"));
			} else {
				GtkLabel* _tmp14_;
				games_collection_view_set_is_collection_rename_valid (self, TRUE);
				_tmp14_ = self->priv->collection_rename_error_label;
				gtk_label_set_label (_tmp14_, "");
			}
		}
	}
	_tmp15_ = self->priv->_is_collection_rename_valid;
	if (_tmp15_) {
		GtkEntry* _tmp16_;
		GtkStyleContext* _tmp17_;
		_tmp16_ = self->priv->collection_rename_entry;
		_tmp17_ = gtk_widget_get_style_context ((GtkWidget*) _tmp16_);
		gtk_style_context_remove_class (_tmp17_, "error");
	} else {
		GtkEntry* _tmp18_;
		GtkStyleContext* _tmp19_;
		_tmp18_ = self->priv->collection_rename_entry;
		_tmp19_ = gtk_widget_get_style_context ((GtkWidget*) _tmp18_);
		gtk_style_context_add_class (_tmp19_, "error");
	}
	_g_free0 (name);
}

static void
_games_collection_view_update_collection_name_validity_g_object_notify (GObject* _sender,
                                                                        GParamSpec* pspec,
                                                                        gpointer self)
{
	games_collection_view_update_collection_name_validity ((GamesCollectionView*) self);
}

static void
games_collection_view_on_collection_rename_activated (GamesCollectionView* self)
{
	GamesCollectionsPage* _tmp0_;
	GamesCollection* _tmp1_;
	GamesCollection* _tmp2_;
	gboolean _tmp3_;
	gchar* name = NULL;
	GtkEntry* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	GamesUserCollection* collection = NULL;
	GamesCollectionsPage* _tmp8_;
	GamesCollection* _tmp9_;
	GamesCollection* _tmp10_;
	GamesUserCollection* _tmp11_;
	GamesUserCollection* _tmp12_;
	GamesUserCollection* _tmp13_;
	const gchar* _tmp14_;
	GamesCollectionsPage* _tmp15_;
	const gchar* _tmp16_;
	GtkPopover* _tmp17_;
	GamesCollectionsPage* _tmp18_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->collections_page;
	_tmp1_ = games_collections_page_get_current_collection (_tmp0_);
	_tmp2_ = _tmp1_;
	_vala_assert (GAMES_IS_USER_COLLECTION (_tmp2_), "collections_page.current_collection is UserCollection");
	_tmp3_ = self->priv->_is_collection_rename_valid;
	if (!_tmp3_) {
		return;
	}
	_tmp4_ = self->priv->collection_rename_entry;
	_tmp5_ = gtk_entry_get_text (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = string_strip (_tmp6_);
	name = _tmp7_;
	_tmp8_ = self->priv->collections_page;
	_tmp9_ = games_collections_page_get_current_collection (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = _g_object_ref0 (GAMES_IS_USER_COLLECTION (_tmp10_) ? ((GamesUserCollection*) _tmp10_) : NULL);
	collection = _tmp11_;
	_tmp12_ = collection;
	if (_tmp12_ == NULL) {
		_g_object_unref0 (collection);
		_g_free0 (name);
		return;
	}
	_tmp13_ = collection;
	_tmp14_ = name;
	games_user_collection_set_title (_tmp13_, _tmp14_);
	_tmp15_ = self->priv->collections_page;
	_tmp16_ = name;
	games_collections_page_set_collection_title (_tmp15_, _tmp16_);
	_tmp17_ = self->priv->rename_popover;
	gtk_popover_popdown (_tmp17_);
	_tmp18_ = self->priv->collections_page;
	games_collections_page_invalidate_sort (_tmp18_);
	_g_object_unref0 (collection);
	_g_free0 (name);
}

static void
_games_collection_view_on_collection_rename_activated_gtk_button_clicked (GtkButton* _sender,
                                                                          gpointer self)
{
	games_collection_view_on_collection_rename_activated ((GamesCollectionView*) self);
}

static void
games_collection_view_on_selected_items_changed (GamesCollectionView* self)
{
	gint length = 0;
	gboolean _tmp0_ = FALSE;
	GtkStack* _tmp1_;
	GtkWidget* _tmp2_;
	GtkWidget* _tmp3_;
	GamesCollectionsPage* _tmp4_;
	gchar* label = NULL;
	GtkLabel* _tmp20_;
	const gchar* _tmp21_;
	g_return_if_fail (self != NULL);
	length = 0;
	_tmp1_ = self->priv->viewstack;
	_tmp2_ = gtk_stack_get_visible_child (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = self->priv->collections_page;
	if (_tmp3_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget)) {
		GamesCollectionsPage* _tmp5_;
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp5_ = self->priv->collections_page;
		_tmp6_ = games_collections_page_get_is_subpage_open (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp0_ = !_tmp7_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GamesUserCollection** collections = NULL;
		GamesCollectionsPage* _tmp8_;
		gint _tmp9_ = 0;
		GamesUserCollection** _tmp10_;
		gint collections_length1;
		gint _collections_size_;
		GamesUserCollection** _tmp11_;
		gint _tmp11__length1;
		GamesSelectionActionBar* _tmp12_;
		_tmp8_ = self->priv->collections_page;
		_tmp10_ = games_collections_page_get_selected_collections (_tmp8_, &_tmp9_);
		collections = _tmp10_;
		collections_length1 = _tmp9_;
		_collections_size_ = collections_length1;
		_tmp11_ = collections;
		_tmp11__length1 = collections_length1;
		length = _tmp11__length1;
		_tmp12_ = self->priv->selection_action_bar;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp12_, length != 0);
		collections = (_vala_array_free (collections, collections_length1, (GDestroyNotify) g_object_unref), NULL);
	} else {
		GamesGame** games = NULL;
		gint _tmp13_ = 0;
		GamesGame** _tmp14_;
		gint games_length1;
		gint _games_size_;
		GamesGame** _tmp15_;
		gint _tmp15__length1;
		GamesSelectionActionBar* _tmp16_;
		GamesGame** _tmp17_;
		gint _tmp17__length1;
		_tmp14_ = games_collection_view_get_currently_selected_games (self, &_tmp13_);
		games = _tmp14_;
		games_length1 = _tmp13_;
		_games_size_ = games_length1;
		_tmp15_ = games;
		_tmp15__length1 = games_length1;
		length = _tmp15__length1;
		_tmp16_ = self->priv->selection_action_bar;
		_tmp17_ = games;
		_tmp17__length1 = games_length1;
		games_selection_action_bar_update (_tmp16_, _tmp17_, (gint) _tmp17__length1);
		games = (_vala_array_free (games, games_length1, (GDestroyNotify) g_object_unref), NULL);
	}
	if (length != 0) {
		gchar* _tmp18_;
		_tmp18_ = g_strdup_printf (ngettext ("Selected %d item", "Selected %d items", (gulong) length), length);
		_g_free0 (label);
		label = _tmp18_;
	} else {
		gchar* _tmp19_;
		_tmp19_ = g_strdup (_ ("Click on items to select them"));
		_g_free0 (label);
		label = _tmp19_;
	}
	_tmp20_ = self->priv->selection_mode_label;
	_tmp21_ = label;
	gtk_label_set_label (_tmp20_, _tmp21_);
	_g_free0 (label);
}

static void
_games_collection_view_on_selected_items_changed_games_collections_page_selected_items_changed (GamesCollectionsPage* _sender,
                                                                                                gpointer self)
{
	games_collection_view_on_selected_items_changed ((GamesCollectionView*) self);
}

static void
games_collection_view_on_collection_subpage_back_clicked (GamesCollectionView* self)
{
	GamesCollectionsPage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->collections_page;
	games_collections_page_exit_subpage (_tmp0_);
}

static void
_games_collection_view_on_collection_subpage_back_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                              gpointer self)
{
	games_collection_view_on_collection_subpage_back_clicked ((GamesCollectionView*) self);
}

static void
games_collection_view_on_selection_mode_changed (GamesCollectionView* self)
{
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_is_selection_mode;
	if (_tmp0_) {
		GtkStack* _tmp1_;
		HdyHeaderBar* _tmp2_;
		GamesSelectionActionBar* _tmp3_;
		_tmp1_ = self->priv->header_bar_stack;
		_tmp2_ = self->priv->selection_mode_header_bar;
		gtk_stack_set_visible_child (_tmp1_, (GtkWidget*) _tmp2_);
		_tmp3_ = self->priv->selection_action_bar;
		games_selection_action_bar_set_favorite_state (_tmp3_, GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_NONE_FAVORITE);
	} else {
		GtkStack* _tmp4_;
		HdyDeck* _tmp5_;
		GamesCollectionsPage* _tmp6_;
		gboolean _tmp7_;
		gboolean _tmp8_;
		games_collection_view_select_none (self);
		_tmp4_ = self->priv->header_bar_stack;
		_tmp5_ = self->priv->collections_deck;
		gtk_stack_set_visible_child (_tmp4_, (GtkWidget*) _tmp5_);
		_tmp6_ = self->priv->collections_page;
		_tmp7_ = games_collections_page_get_is_subpage_open (_tmp6_);
		_tmp8_ = _tmp7_;
		if (_tmp8_) {
			HdyDeck* _tmp9_;
			HdyHeaderBar* _tmp10_;
			_tmp9_ = self->priv->collections_deck;
			_tmp10_ = self->priv->collection_subpage_header_bar;
			hdy_deck_set_visible_child (_tmp9_, (GtkWidget*) _tmp10_);
		} else {
			HdyDeck* _tmp11_;
			HdyDeck* _tmp12_;
			_tmp11_ = self->priv->collections_deck;
			_tmp12_ = self->priv->platforms_deck;
			hdy_deck_set_visible_child (_tmp11_, (GtkWidget*) _tmp12_);
		}
	}
	games_collection_view_update_bottom_bar (self);
}

static void
_games_collection_view_on_selection_mode_changed_g_object_notify (GObject* _sender,
                                                                  GParamSpec* pspec,
                                                                  gpointer self)
{
	games_collection_view_on_selection_mode_changed ((GamesCollectionView*) self);
}

static void
games_collection_view_on_empty_collection_changed (GamesCollectionView* self)
{
	g_return_if_fail (self != NULL);
	games_collection_view_update_adaptive_state (self);
	games_collection_view_update_selection_availability (self);
}

static void
_games_collection_view_on_empty_collection_changed_g_object_notify (GObject* _sender,
                                                                    GParamSpec* pspec,
                                                                    gpointer self)
{
	games_collection_view_on_empty_collection_changed ((GamesCollectionView*) self);
}

static void
games_collection_view_update_selection_availability (GamesCollectionView* self)
{
	gboolean _tmp0_ = FALSE;
	GtkStack* _tmp1_;
	GtkWidget* _tmp2_;
	GtkWidget* _tmp3_;
	GamesPlatformsPage* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->viewstack;
	_tmp2_ = gtk_stack_get_visible_child (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = self->priv->platforms_page;
	if (_tmp3_ != G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget)) {
		_tmp0_ = TRUE;
	} else {
		gboolean _tmp5_;
		_tmp5_ = self->priv->_is_folded;
		_tmp0_ = !_tmp5_;
	}
	games_collection_view_set_is_selection_available (self, _tmp0_);
}

static void
_games_collection_view_update_selection_availability_g_object_notify (GObject* _sender,
                                                                      GParamSpec* pspec,
                                                                      gpointer self)
{
	games_collection_view_update_selection_availability ((GamesCollectionView*) self);
}

static void
games_collection_view_on_loading_notification_closed (GamesCollectionView* self)
{
	g_return_if_fail (self != NULL);
	games_collection_view_set_loading_notification (self, FALSE);
}

static void
_games_collection_view_on_loading_notification_closed_gtk_button_clicked (GtkButton* _sender,
                                                                          gpointer self)
{
	games_collection_view_on_loading_notification_closed ((GamesCollectionView*) self);
}

static void
games_collection_view_on_game_activated (GamesCollectionView* self,
                                         GamesGame* game)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (game != NULL);
	g_signal_emit (self, games_collection_view_signals[GAMES_COLLECTION_VIEW_GAME_ACTIVATED_SIGNAL], 0, game);
}

static void
_games_collection_view_on_game_activated_games_collections_page_game_activated (GamesCollectionsPage* _sender,
                                                                                GamesGame* game,
                                                                                gpointer self)
{
	games_collection_view_on_game_activated ((GamesCollectionView*) self, game);
}

static void
games_collection_view_on_visible_child_changed (GamesCollectionView* self)
{
	GtkStack* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GamesGamesPage* _tmp3_;
	gboolean _tmp11_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->viewstack;
	_tmp1_ = gtk_stack_get_visible_child (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->games_page;
	if (_tmp2_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget)) {
		GamesGamesPage* _tmp4_;
		_tmp4_ = self->priv->games_page;
		games_games_page_reset_scroll_position (_tmp4_);
	} else {
		GtkStack* _tmp5_;
		GtkWidget* _tmp6_;
		GtkWidget* _tmp7_;
		GamesPlatformsPage* _tmp8_;
		_tmp5_ = self->priv->viewstack;
		_tmp6_ = gtk_stack_get_visible_child (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = self->priv->platforms_page;
		if (_tmp7_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_widget_get_type (), GtkWidget)) {
			GamesPlatformsPage* _tmp9_;
			_tmp9_ = self->priv->platforms_page;
			games_platforms_page_reset (_tmp9_);
		} else {
			GamesCollectionsPage* _tmp10_;
			_tmp10_ = self->priv->collections_page;
			games_collections_page_reset_scroll_position (_tmp10_);
		}
	}
	games_collection_view_set_filtering_text (self, NULL);
	_tmp11_ = self->priv->_search_mode;
	if (_tmp11_) {
		games_collection_view_on_search_text_notify (self);
	}
	games_collection_view_update_selection_availability (self);
	games_collection_view_update_add_game_availablity (self);
	games_collection_view_update_available_selection_actions (self);
}

static void
_games_collection_view_on_visible_child_changed_g_object_notify (GObject* _sender,
                                                                 GParamSpec* pspec,
                                                                 gpointer self)
{
	games_collection_view_on_visible_child_changed ((GamesCollectionView*) self);
}

static void
games_collection_view_on_search_text_notify (GamesCollectionView* self)
{
	GamesSearchBar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gboolean is_search_empty = FALSE;
	GtkStack* _tmp3_;
	GtkWidget* _tmp4_;
	GtkWidget* _tmp5_;
	GamesCollectionsPage* _tmp6_;
	gboolean _tmp21_ = FALSE;
	GtkStack* _tmp22_;
	GtkWidget* _tmp23_;
	GtkWidget* _tmp24_;
	GamesCollectionsPage* _tmp25_;
	GamesSearchBar* _tmp31_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->search_bar;
	_tmp1_ = games_search_bar_get_text (_tmp0_);
	_tmp2_ = _tmp1_;
	games_collection_view_set_filtering_text (self, _tmp2_);
	_tmp3_ = self->priv->viewstack;
	_tmp4_ = gtk_stack_get_visible_child (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = self->priv->collections_page;
	if (_tmp5_ != G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget)) {
		gboolean _tmp7_ = FALSE;
		GamesGamesPage* _tmp8_;
		gboolean _tmp9_;
		gboolean _tmp10_;
		_tmp8_ = self->priv->games_page;
		_tmp9_ = games_games_page_get_is_search_empty (_tmp8_);
		_tmp10_ = _tmp9_;
		if (_tmp10_) {
			_tmp7_ = TRUE;
		} else {
			GamesPlatformsPage* _tmp11_;
			gboolean _tmp12_;
			gboolean _tmp13_;
			_tmp11_ = self->priv->platforms_page;
			_tmp12_ = games_platforms_page_get_is_search_empty (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp7_ = _tmp13_;
		}
		is_search_empty = _tmp7_;
	} else {
		GamesCollectionsPage* _tmp14_;
		gboolean _tmp15_;
		gboolean _tmp16_;
		_tmp14_ = self->priv->collections_page;
		_tmp15_ = games_collections_page_get_is_search_empty (_tmp14_);
		_tmp16_ = _tmp15_;
		is_search_empty = _tmp16_;
	}
	if (is_search_empty) {
		GtkStack* _tmp17_;
		HdyStatusPage* _tmp18_;
		_tmp17_ = self->priv->empty_stack;
		_tmp18_ = self->priv->empty_search;
		gtk_stack_set_visible_child (_tmp17_, (GtkWidget*) _tmp18_);
	} else {
		GtkStack* _tmp19_;
		GtkStack* _tmp20_;
		_tmp19_ = self->priv->empty_stack;
		_tmp20_ = self->priv->viewstack;
		gtk_stack_set_visible_child (_tmp19_, (GtkWidget*) _tmp20_);
	}
	_tmp22_ = self->priv->viewstack;
	_tmp23_ = gtk_stack_get_visible_child (_tmp22_);
	_tmp24_ = _tmp23_;
	_tmp25_ = self->priv->collections_page;
	if (_tmp24_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, gtk_widget_get_type (), GtkWidget)) {
		GamesCollectionsPage* _tmp26_;
		gboolean _tmp27_;
		gboolean _tmp28_;
		_tmp26_ = self->priv->collections_page;
		_tmp27_ = games_collections_page_get_is_subpage_open (_tmp26_);
		_tmp28_ = _tmp27_;
		_tmp21_ = !_tmp28_;
	} else {
		_tmp21_ = FALSE;
	}
	if (_tmp21_) {
		HdyStatusPage* _tmp29_;
		_tmp29_ = self->priv->empty_search;
		hdy_status_page_set_title (_tmp29_, _ ("No collections found"));
	} else {
		HdyStatusPage* _tmp30_;
		_tmp30_ = self->priv->empty_search;
		hdy_status_page_set_title (_tmp30_, _ ("No games found"));
	}
	_tmp31_ = self->priv->search_bar;
	games_search_bar_focus_entry (_tmp31_);
}

static void
_games_collection_view_on_search_text_notify_g_object_notify (GObject* _sender,
                                                              GParamSpec* pspec,
                                                              gpointer self)
{
	games_collection_view_on_search_text_notify ((GamesCollectionView*) self);
}

static void
games_collection_view_on_search_mode_changed (GamesCollectionView* self)
{
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_search_mode;
	if (!_tmp0_) {
		GtkStack* _tmp1_;
		GtkStack* _tmp2_;
		_tmp1_ = self->priv->empty_stack;
		_tmp2_ = self->priv->viewstack;
		gtk_stack_set_visible_child (_tmp1_, (GtkWidget*) _tmp2_);
	}
}

static void
_games_collection_view_on_search_mode_changed_g_object_notify (GObject* _sender,
                                                               GParamSpec* pspec,
                                                               gpointer self)
{
	games_collection_view_on_search_mode_changed ((GamesCollectionView*) self);
}

static void
games_collection_view_on_folded_changed (GamesCollectionView* self)
{
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_is_folded;
	if (_tmp0_) {
		HdyHeaderBar* _tmp1_ = NULL;
		gboolean _tmp2_;
		HdyDeck* _tmp5_;
		HdySwipeGroup* _tmp6_;
		HdyDeck* _tmp7_;
		_tmp2_ = self->priv->_is_subview_open;
		if (_tmp2_) {
			HdyHeaderBar* _tmp3_;
			_tmp3_ = self->priv->subview_header_bar;
			_tmp1_ = _tmp3_;
		} else {
			HdyHeaderBar* _tmp4_;
			_tmp4_ = self->priv->header_bar;
			_tmp1_ = _tmp4_;
		}
		_tmp5_ = self->priv->platforms_deck;
		hdy_deck_set_visible_child (_tmp5_, (GtkWidget*) _tmp1_);
		_tmp6_ = self->priv->swipe_group;
		_tmp7_ = self->priv->platforms_deck;
		hdy_swipe_group_add_swipeable (_tmp6_, (HdySwipeable*) _tmp7_);
	} else {
		HdySwipeGroup* _tmp8_;
		HdyDeck* _tmp9_;
		HdyDeck* _tmp10_;
		HdyHeaderBar* _tmp11_;
		_tmp8_ = self->priv->swipe_group;
		_tmp9_ = self->priv->platforms_deck;
		hdy_swipe_group_remove_swipeable (_tmp8_, (HdySwipeable*) _tmp9_);
		_tmp10_ = self->priv->platforms_deck;
		_tmp11_ = self->priv->header_bar;
		hdy_deck_set_visible_child (_tmp10_, (GtkWidget*) _tmp11_);
	}
	games_collection_view_update_bottom_bar (self);
	games_collection_view_update_selection_availability (self);
}

static void
_games_collection_view_on_folded_changed_g_object_notify (GObject* _sender,
                                                          GParamSpec* pspec,
                                                          gpointer self)
{
	games_collection_view_on_folded_changed ((GamesCollectionView*) self);
}

static void
games_collection_view_update_bottom_bar (GamesCollectionView* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_;
	HdyViewSwitcherBar* _tmp11_;
	g_return_if_fail (self != NULL);
	_tmp3_ = self->priv->_is_selection_mode;
	if (!_tmp3_) {
		gboolean _tmp4_;
		_tmp4_ = self->priv->_is_showing_bottom_bar;
		_tmp2_ = _tmp4_;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		gboolean _tmp5_ = FALSE;
		gboolean _tmp6_;
		_tmp6_ = self->priv->_is_folded;
		if (!_tmp6_) {
			_tmp5_ = TRUE;
		} else {
			gboolean _tmp7_;
			_tmp7_ = self->priv->_is_subview_open;
			_tmp5_ = !_tmp7_;
		}
		_tmp1_ = _tmp5_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GamesCollectionsPage* _tmp8_;
		gboolean _tmp9_;
		gboolean _tmp10_;
		_tmp8_ = self->priv->collections_page;
		_tmp9_ = games_collections_page_get_is_subpage_open (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp0_ = !_tmp10_;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp11_ = self->priv->view_switcher_bar;
	hdy_view_switcher_bar_set_reveal (_tmp11_, _tmp0_);
}

static void
_games_collection_view_update_bottom_bar_g_object_notify (GObject* _sender,
                                                          GParamSpec* pspec,
                                                          gpointer self)
{
	games_collection_view_update_bottom_bar ((GamesCollectionView*) self);
}

static void
games_collection_view_update_adaptive_state (GamesCollectionView* self)
{
	gboolean showing_title = FALSE;
	HdyViewSwitcherTitle* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->view_switcher_title;
	_tmp1_ = hdy_view_switcher_title_get_title_visible (_tmp0_);
	_tmp2_ = _tmp1_;
	showing_title = _tmp2_;
	if (showing_title) {
		gboolean _tmp4_;
		gboolean _tmp5_;
		_tmp4_ = games_collection_view_get_is_empty_collection (self);
		_tmp5_ = _tmp4_;
		_tmp3_ = !_tmp5_;
	} else {
		_tmp3_ = FALSE;
	}
	games_collection_view_set_is_showing_bottom_bar (self, _tmp3_);
}

static void
_games_collection_view_update_adaptive_state_g_object_notify (GObject* _sender,
                                                              GParamSpec* pspec,
                                                              gpointer self)
{
	games_collection_view_update_adaptive_state ((GamesCollectionView*) self);
}

static void
games_collection_view_on_subview_back_clicked (GamesCollectionView* self)
{
	HdyDeck* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->platforms_deck;
	hdy_deck_navigate (_tmp0_, HDY_NAVIGATION_DIRECTION_BACK);
}

static void
_games_collection_view_on_subview_back_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                   gpointer self)
{
	games_collection_view_on_subview_back_clicked ((GamesCollectionView*) self);
}

GamesCollectionView*
games_collection_view_construct (GType object_type)
{
	GamesCollectionView * self = NULL;
	self = (GamesCollectionView*) g_object_new (object_type, NULL);
	return self;
}

GamesCollectionView*
games_collection_view_new (void)
{
	return games_collection_view_construct (GAMES_TYPE_COLLECTION_VIEW);
}

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

static void
games_collection_view_real_set_is_view_active (GamesUiView* base,
                                               gboolean value)
{
	GamesCollectionView* self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GamesKonamiCode* _tmp4_;
	self = (GamesCollectionView*) 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_) {
		games_collection_view_set_search_mode (self, FALSE);
	}
	_tmp4_ = self->priv->konami_code;
	games_konami_code_reset (_tmp4_);
	g_object_notify_by_pspec ((GObject *) self, games_collection_view_properties[GAMES_COLLECTION_VIEW_IS_VIEW_ACTIVE_PROPERTY]);
}

gboolean
games_collection_view_get_is_empty_collection (GamesCollectionView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_empty_collection;
	return result;
}

void
games_collection_view_set_is_empty_collection (GamesCollectionView* self,
                                               gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_is_empty_collection = value;
	if (self->priv->_is_empty_collection) {
		GtkStack* _tmp0_;
		HdyStatusPage* _tmp1_;
		_tmp0_ = self->priv->empty_stack;
		_tmp1_ = self->priv->empty_collection;
		gtk_stack_set_visible_child (_tmp0_, (GtkWidget*) _tmp1_);
	} else {
		GtkStack* _tmp2_;
		GtkStack* _tmp3_;
		_tmp2_ = self->priv->empty_stack;
		_tmp3_ = self->priv->viewstack;
		gtk_stack_set_visible_child (_tmp2_, (GtkWidget*) _tmp3_);
	}
	g_object_notify_by_pspec ((GObject *) self, games_collection_view_properties[GAMES_COLLECTION_VIEW_IS_EMPTY_COLLECTION_PROPERTY]);
}

void
games_collection_view_set_filtering_text (GamesCollectionView* self,
                                          const gchar* value)
{
	g_return_if_fail (self != NULL);
	if (value == NULL) {
		self->filtering_terms = (_vala_array_free (self->filtering_terms, self->filtering_terms_length1, (GDestroyNotify) g_free), NULL);
		self->filtering_terms = NULL;
		self->filtering_terms_length1 = 0;
		self->_filtering_terms_size_ = self->filtering_terms_length1;
	} else {
		gchar** _tmp0_;
		gchar** _tmp1_;
		_tmp1_ = _tmp0_ = g_strsplit (value, " ", 0);
		self->filtering_terms = (_vala_array_free (self->filtering_terms, self->filtering_terms_length1, (GDestroyNotify) g_free), NULL);
		self->filtering_terms = _tmp1_;
		self->filtering_terms_length1 = _vala_array_length (_tmp0_);
		self->_filtering_terms_size_ = self->filtering_terms_length1;
	}
	games_collection_view_update_search_filters (self);
	g_object_notify_by_pspec ((GObject *) self, games_collection_view_properties[GAMES_COLLECTION_VIEW_FILTERING_TEXT_PROPERTY]);
}

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

static void
games_collection_view_set_window (GamesCollectionView* self,
                                  GtkWindow* value)
{
	GtkWindow* old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collection_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_collection_view_properties[GAMES_COLLECTION_VIEW_WINDOW_PROPERTY]);
	}
}

GamesGameModel*
games_collection_view_get_game_model (GamesCollectionView* self)
{
	GamesGameModel* result;
	GamesGameModel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_game_model;
	result = _tmp0_;
	return result;
}

static void
_games_collection_view_game_model___lambda53_ (GamesCollectionView* self)
{
	GamesGameModel* _tmp0_;
	GamesGameModel* _tmp1_;
	_tmp0_ = games_collection_view_get_game_model (self);
	_tmp1_ = _tmp0_;
	games_collection_view_set_is_empty_collection (self, g_list_model_get_n_items ((GListModel*) _tmp1_) == ((guint) 0));
}

static void
__games_collection_view_game_model___lambda53__g_list_model_items_changed (GListModel* _sender,
                                                                           guint position,
                                                                           guint removed,
                                                                           guint added,
                                                                           gpointer self)
{
	_games_collection_view_game_model___lambda53_ ((GamesCollectionView*) self);
}

void
games_collection_view_set_game_model (GamesCollectionView* self,
                                      GamesGameModel* value)
{
	GamesGameModel* _tmp0_;
	GamesGamesPage* _tmp1_;
	GamesGameModel* _tmp2_;
	GamesGameModel* _tmp3_;
	GamesPlatformsPage* _tmp4_;
	GamesGameModel* _tmp5_;
	GamesGameModel* _tmp6_;
	GamesGameModel* _tmp7_;
	GamesGameModel* _tmp8_;
	GamesGameModel* _tmp9_;
	GamesGameModel* _tmp10_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_game_model);
	self->priv->_game_model = _tmp0_;
	_tmp1_ = self->priv->games_page;
	_tmp2_ = games_collection_view_get_game_model (self);
	_tmp3_ = _tmp2_;
	games_games_page_set_game_model (_tmp1_, _tmp3_);
	_tmp4_ = self->priv->platforms_page;
	_tmp5_ = games_collection_view_get_game_model (self);
	_tmp6_ = _tmp5_;
	games_platforms_page_set_game_model (_tmp4_, _tmp6_);
	_tmp7_ = games_collection_view_get_game_model (self);
	_tmp8_ = _tmp7_;
	games_collection_view_set_is_empty_collection (self, g_list_model_get_n_items ((GListModel*) _tmp8_) == ((guint) 0));
	_tmp9_ = games_collection_view_get_game_model (self);
	_tmp10_ = _tmp9_;
	g_signal_connect_object ((GListModel*) _tmp10_, "items-changed", (GCallback) __games_collection_view_game_model___lambda53__g_list_model_items_changed, self, 0);
	g_object_notify_by_pspec ((GObject *) self, games_collection_view_properties[GAMES_COLLECTION_VIEW_GAME_MODEL_PROPERTY]);
}

GamesCollectionModel*
games_collection_view_get_collection_model (GamesCollectionView* self)
{
	GamesCollectionModel* result;
	GamesCollectionsPage* _tmp0_;
	GamesCollectionModel* _tmp1_;
	GamesCollectionModel* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->collections_page;
	_tmp1_ = games_collections_page_get_collection_model (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
games_collection_view_set_collection_model (GamesCollectionView* self,
                                            GamesCollectionModel* value)
{
	GamesCollectionsPage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->collections_page;
	games_collections_page_set_collection_model (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, games_collection_view_properties[GAMES_COLLECTION_VIEW_COLLECTION_MODEL_PROPERTY]);
}

gboolean
games_collection_view_get_loading_notification (GamesCollectionView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_loading_notification;
	return result;
}

void
games_collection_view_set_loading_notification (GamesCollectionView* self,
                                                gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collection_view_get_loading_notification (self);
	if (old_value != value) {
		self->priv->_loading_notification = value;
		g_object_notify_by_pspec ((GObject *) self, games_collection_view_properties[GAMES_COLLECTION_VIEW_LOADING_NOTIFICATION_PROPERTY]);
	}
}

gboolean
games_collection_view_get_search_mode (GamesCollectionView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_search_mode;
	return result;
}

void
games_collection_view_set_search_mode (GamesCollectionView* self,
                                       gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collection_view_get_search_mode (self);
	if (old_value != value) {
		self->priv->_search_mode = value;
		g_object_notify_by_pspec ((GObject *) self, games_collection_view_properties[GAMES_COLLECTION_VIEW_SEARCH_MODE_PROPERTY]);
	}
}

gboolean
games_collection_view_get_is_folded (GamesCollectionView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_folded;
	return result;
}

void
games_collection_view_set_is_folded (GamesCollectionView* self,
                                     gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collection_view_get_is_folded (self);
	if (old_value != value) {
		self->priv->_is_folded = value;
		g_object_notify_by_pspec ((GObject *) self, games_collection_view_properties[GAMES_COLLECTION_VIEW_IS_FOLDED_PROPERTY]);
	}
}

gboolean
games_collection_view_get_is_search_available (GamesCollectionView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_search_available;
	return result;
}

void
games_collection_view_set_is_search_available (GamesCollectionView* self,
                                               gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collection_view_get_is_search_available (self);
	if (old_value != value) {
		self->priv->_is_search_available = value;
		g_object_notify_by_pspec ((GObject *) self, games_collection_view_properties[GAMES_COLLECTION_VIEW_IS_SEARCH_AVAILABLE_PROPERTY]);
	}
}

gboolean
games_collection_view_get_is_showing_bottom_bar (GamesCollectionView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_showing_bottom_bar;
	return result;
}

void
games_collection_view_set_is_showing_bottom_bar (GamesCollectionView* self,
                                                 gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collection_view_get_is_showing_bottom_bar (self);
	if (old_value != value) {
		self->priv->_is_showing_bottom_bar = value;
		g_object_notify_by_pspec ((GObject *) self, games_collection_view_properties[GAMES_COLLECTION_VIEW_IS_SHOWING_BOTTOM_BAR_PROPERTY]);
	}
}

gboolean
games_collection_view_get_is_subview_open (GamesCollectionView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_subview_open;
	return result;
}

void
games_collection_view_set_is_subview_open (GamesCollectionView* self,
                                           gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collection_view_get_is_subview_open (self);
	if (old_value != value) {
		self->priv->_is_subview_open = value;
		g_object_notify_by_pspec ((GObject *) self, games_collection_view_properties[GAMES_COLLECTION_VIEW_IS_SUBVIEW_OPEN_PROPERTY]);
	}
}

gboolean
games_collection_view_get_is_selection_mode (GamesCollectionView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_selection_mode;
	return result;
}

void
games_collection_view_set_is_selection_mode (GamesCollectionView* self,
                                             gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collection_view_get_is_selection_mode (self);
	if (old_value != value) {
		self->priv->_is_selection_mode = value;
		g_object_notify_by_pspec ((GObject *) self, games_collection_view_properties[GAMES_COLLECTION_VIEW_IS_SELECTION_MODE_PROPERTY]);
	}
}

gboolean
games_collection_view_get_is_selection_available (GamesCollectionView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_selection_available;
	return result;
}

void
games_collection_view_set_is_selection_available (GamesCollectionView* self,
                                                  gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collection_view_get_is_selection_available (self);
	if (old_value != value) {
		self->priv->_is_selection_available = value;
		g_object_notify_by_pspec ((GObject *) self, games_collection_view_properties[GAMES_COLLECTION_VIEW_IS_SELECTION_AVAILABLE_PROPERTY]);
	}
}

gboolean
games_collection_view_get_is_collection_rename_valid (GamesCollectionView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_collection_rename_valid;
	return result;
}

void
games_collection_view_set_is_collection_rename_valid (GamesCollectionView* self,
                                                      gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collection_view_get_is_collection_rename_valid (self);
	if (old_value != value) {
		self->priv->_is_collection_rename_valid = value;
		g_object_notify_by_pspec ((GObject *) self, games_collection_view_properties[GAMES_COLLECTION_VIEW_IS_COLLECTION_RENAME_VALID_PROPERTY]);
	}
}

gboolean
games_collection_view_get_show_game_actions (GamesCollectionView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_show_game_actions;
	return result;
}

void
games_collection_view_set_show_game_actions (GamesCollectionView* self,
                                             gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collection_view_get_show_game_actions (self);
	if (old_value != value) {
		self->priv->_show_game_actions = value;
		g_object_notify_by_pspec ((GObject *) self, games_collection_view_properties[GAMES_COLLECTION_VIEW_SHOW_GAME_ACTIONS_PROPERTY]);
	}
}

gboolean
games_collection_view_get_show_remove_action_button (GamesCollectionView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_show_remove_action_button;
	return result;
}

void
games_collection_view_set_show_remove_action_button (GamesCollectionView* self,
                                                     gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collection_view_get_show_remove_action_button (self);
	if (old_value != value) {
		self->priv->_show_remove_action_button = value;
		g_object_notify_by_pspec ((GObject *) self, games_collection_view_properties[GAMES_COLLECTION_VIEW_SHOW_REMOVE_ACTION_BUTTON_PROPERTY]);
	}
}

gboolean
games_collection_view_get_is_add_available (GamesCollectionView* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_add_available;
	return result;
}

void
games_collection_view_set_is_add_available (GamesCollectionView* self,
                                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collection_view_get_is_add_available (self);
	if (old_value != value) {
		self->priv->_is_add_available = value;
		g_object_notify_by_pspec ((GObject *) self, games_collection_view_properties[GAMES_COLLECTION_VIEW_IS_ADD_AVAILABLE_PROPERTY]);
	}
}

static void
_games_collection_view___lambda54_ (GamesCollectionView* self)
{
	GamesCollectionsPage* _tmp0_;
	_tmp0_ = self->priv->collections_page;
	games_collections_page_invalidate_filter (_tmp0_);
}

static void
__games_collection_view___lambda54__games_collection_manager_collection_empty_changed (GamesCollectionManager* _sender,
                                                                                       GamesCollection* collection,
                                                                                       gpointer self)
{
	_games_collection_view___lambda54_ ((GamesCollectionView*) self);
}

static void
_games_collections_page_undo_remove_collection_games_undo_notification_undo (GamesUndoNotification* _sender,
                                                                             gpointer self)
{
	games_collections_page_undo_remove_collection ((GamesCollectionsPage*) self);
}

static void
_games_collections_page_finalize_collection_removal_games_undo_notification_closed (GamesUndoNotification* _sender,
                                                                                    gpointer self)
{
	games_collections_page_finalize_collection_removal ((GamesCollectionsPage*) self);
}

static void
_games_collections_page_finalize_collection_removal_gtk_widget_destroy (GtkWidget* _sender,
                                                                        gpointer self)
{
	games_collections_page_finalize_collection_removal ((GamesCollectionsPage*) self);
}

static void
_games_collection_view_on_konami_code_performed_games_konami_code_code_performed (GamesKonamiCode* _sender,
                                                                                  gpointer self)
{
	games_collection_view_on_konami_code_performed ((GamesCollectionView*) self);
}

static GObject *
games_collection_view_constructor (GType type,
                                   guint n_construct_properties,
                                   GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GamesCollectionView * self;
	GamesApplication* _tmp0_;
	GamesApplication* _tmp1_;
	GamesCollectionManager* _tmp2_;
	GamesCollectionManager* _tmp3_;
	GamesUndoNotification* _tmp4_;
	GamesCollectionsPage* _tmp5_;
	GamesUndoNotification* _tmp6_;
	GamesCollectionsPage* _tmp7_;
	GtkWindow* _tmp8_;
	GamesCollectionsPage* _tmp9_;
	gchar* icon_name = NULL;
	gchar* _tmp10_;
	GtkStack* _tmp11_;
	GamesGamesPage* _tmp12_;
	const gchar* _tmp13_;
	HdyStatusPage* _tmp14_;
	const gchar* _tmp15_;
	HdySwipeGroup* _tmp16_;
	GamesPlatformsPage* _tmp17_;
	HdyLeaflet* _tmp18_;
	HdyLeaflet* _tmp19_;
	HdySwipeGroup* _tmp20_;
	GamesCollectionsPage* _tmp21_;
	HdyDeck* _tmp22_;
	HdyDeck* _tmp23_;
	GtkWindow* _tmp24_;
	GamesKonamiCode* _tmp25_;
	GamesKonamiCode* _tmp26_;
	GSimpleActionGroup* _tmp27_;
	GSimpleActionGroup* _tmp28_;
	GtkWindow* _tmp29_;
	GSimpleActionGroup* _tmp30_;
	parent_class = G_OBJECT_CLASS (games_collection_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_COLLECTION_VIEW, GamesCollectionView);
	_tmp0_ = games_application_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = games_application_get_collection_manager (_tmp1_);
	_g_object_unref0 (self->priv->collection_manager);
	self->priv->collection_manager = _tmp2_;
	_g_object_unref0 (_tmp1_);
	_tmp3_ = self->priv->collection_manager;
	g_signal_connect_object (_tmp3_, "collection-empty-changed", (GCallback) __games_collection_view___lambda54__games_collection_manager_collection_empty_changed, self, 0);
	_tmp4_ = self->priv->undo_notification;
	_tmp5_ = self->priv->collections_page;
	g_signal_connect_object (_tmp4_, "undo", (GCallback) _games_collections_page_undo_remove_collection_games_undo_notification_undo, _tmp5_, 0);
	_tmp6_ = self->priv->undo_notification;
	_tmp7_ = self->priv->collections_page;
	g_signal_connect_object (_tmp6_, "closed", (GCallback) _games_collections_page_finalize_collection_removal_games_undo_notification_closed, _tmp7_, 0);
	_tmp8_ = self->priv->_window;
	_tmp9_ = self->priv->collections_page;
	g_signal_connect_object ((GtkWidget*) _tmp8_, "destroy", (GCallback) _games_collections_page_finalize_collection_removal_gtk_widget_destroy, _tmp9_, 0);
	_tmp10_ = g_strdup (APPLICATION_ID "-symbolic");
	icon_name = _tmp10_;
	_tmp11_ = self->priv->viewstack;
	_tmp12_ = self->priv->games_page;
	_tmp13_ = icon_name;
	gtk_container_child_set ((GtkContainer*) _tmp11_, (GtkWidget*) _tmp12_, "icon-name", _tmp13_, NULL);
	_tmp14_ = self->priv->empty_collection;
	_tmp15_ = icon_name;
	hdy_status_page_set_icon_name (_tmp14_, _tmp15_);
	_tmp16_ = self->priv->swipe_group;
	_tmp17_ = self->priv->platforms_page;
	_tmp18_ = games_platforms_page_get_leaflet (_tmp17_);
	_tmp19_ = _tmp18_;
	hdy_swipe_group_add_swipeable (_tmp16_, (HdySwipeable*) _tmp19_);
	_g_object_unref0 (_tmp19_);
	_tmp20_ = self->priv->collections_swipe_group;
	_tmp21_ = self->priv->collections_page;
	_tmp22_ = games_collections_page_get_collections_deck (_tmp21_);
	_tmp23_ = _tmp22_;
	hdy_swipe_group_add_swipeable (_tmp20_, (HdySwipeable*) _tmp23_);
	_g_object_unref0 (_tmp23_);
	_tmp24_ = self->priv->_window;
	_tmp25_ = games_konami_code_new ((GtkWidget*) _tmp24_);
	_g_object_unref0 (self->priv->konami_code);
	self->priv->konami_code = _tmp25_;
	_tmp26_ = self->priv->konami_code;
	g_signal_connect_object (_tmp26_, "code-performed", (GCallback) _games_collection_view_on_konami_code_performed_games_konami_code_code_performed, self, 0);
	_tmp27_ = g_simple_action_group_new ();
	_g_object_unref0 (self->priv->action_group);
	self->priv->action_group = _tmp27_;
	_tmp28_ = self->priv->action_group;
	g_action_map_add_action_entries ((GActionMap*) _tmp28_, GAMES_COLLECTION_VIEW_action_entries, (gint) G_N_ELEMENTS (GAMES_COLLECTION_VIEW_action_entries), self);
	_tmp29_ = self->priv->_window;
	_tmp30_ = self->priv->action_group;
	gtk_widget_insert_action_group ((GtkWidget*) _tmp29_, "view", (GActionGroup*) _tmp30_);
	games_collection_view_update_add_game_availablity (self);
	games_collection_view_update_available_selection_actions (self);
	_g_free0 (icon_name);
	return obj;
}

static void
games_collection_view_class_init (GamesCollectionViewClass * klass,
                                  gpointer klass_data)
{
	games_collection_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GamesCollectionView_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_games_collection_view_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_games_collection_view_set_property;
	G_OBJECT_CLASS (klass)->constructor = games_collection_view_constructor;
	G_OBJECT_CLASS (klass)->finalize = games_collection_view_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_VIEW_IS_VIEW_ACTIVE_PROPERTY, games_collection_view_properties[GAMES_COLLECTION_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_COLLECTION_VIEW_IS_EMPTY_COLLECTION_PROPERTY, games_collection_view_properties[GAMES_COLLECTION_VIEW_IS_EMPTY_COLLECTION_PROPERTY] = g_param_spec_boolean ("is-empty-collection", "is-empty-collection", "is-empty-collection", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_VIEW_FILTERING_TEXT_PROPERTY, games_collection_view_properties[GAMES_COLLECTION_VIEW_FILTERING_TEXT_PROPERTY] = g_param_spec_string ("filtering-text", "filtering-text", "filtering-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_VIEW_WINDOW_PROPERTY, games_collection_view_properties[GAMES_COLLECTION_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_COLLECTION_VIEW_GAME_MODEL_PROPERTY, games_collection_view_properties[GAMES_COLLECTION_VIEW_GAME_MODEL_PROPERTY] = g_param_spec_object ("game-model", "game-model", "game-model", GAMES_TYPE_GAME_MODEL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_VIEW_COLLECTION_MODEL_PROPERTY, games_collection_view_properties[GAMES_COLLECTION_VIEW_COLLECTION_MODEL_PROPERTY] = g_param_spec_object ("collection-model", "collection-model", "collection-model", GAMES_TYPE_COLLECTION_MODEL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_VIEW_LOADING_NOTIFICATION_PROPERTY, games_collection_view_properties[GAMES_COLLECTION_VIEW_LOADING_NOTIFICATION_PROPERTY] = g_param_spec_boolean ("loading-notification", "loading-notification", "loading-notification", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_VIEW_SEARCH_MODE_PROPERTY, games_collection_view_properties[GAMES_COLLECTION_VIEW_SEARCH_MODE_PROPERTY] = g_param_spec_boolean ("search-mode", "search-mode", "search-mode", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_VIEW_IS_FOLDED_PROPERTY, games_collection_view_properties[GAMES_COLLECTION_VIEW_IS_FOLDED_PROPERTY] = g_param_spec_boolean ("is-folded", "is-folded", "is-folded", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_VIEW_IS_SEARCH_AVAILABLE_PROPERTY, games_collection_view_properties[GAMES_COLLECTION_VIEW_IS_SEARCH_AVAILABLE_PROPERTY] = g_param_spec_boolean ("is-search-available", "is-search-available", "is-search-available", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_VIEW_IS_SHOWING_BOTTOM_BAR_PROPERTY, games_collection_view_properties[GAMES_COLLECTION_VIEW_IS_SHOWING_BOTTOM_BAR_PROPERTY] = g_param_spec_boolean ("is-showing-bottom-bar", "is-showing-bottom-bar", "is-showing-bottom-bar", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_VIEW_IS_SUBVIEW_OPEN_PROPERTY, games_collection_view_properties[GAMES_COLLECTION_VIEW_IS_SUBVIEW_OPEN_PROPERTY] = g_param_spec_boolean ("is-subview-open", "is-subview-open", "is-subview-open", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_VIEW_IS_SELECTION_MODE_PROPERTY, games_collection_view_properties[GAMES_COLLECTION_VIEW_IS_SELECTION_MODE_PROPERTY] = g_param_spec_boolean ("is-selection-mode", "is-selection-mode", "is-selection-mode", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_VIEW_IS_SELECTION_AVAILABLE_PROPERTY, games_collection_view_properties[GAMES_COLLECTION_VIEW_IS_SELECTION_AVAILABLE_PROPERTY] = g_param_spec_boolean ("is-selection-available", "is-selection-available", "is-selection-available", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_VIEW_IS_COLLECTION_RENAME_VALID_PROPERTY, games_collection_view_properties[GAMES_COLLECTION_VIEW_IS_COLLECTION_RENAME_VALID_PROPERTY] = g_param_spec_boolean ("is-collection-rename-valid", "is-collection-rename-valid", "is-collection-rename-valid", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_VIEW_SHOW_GAME_ACTIONS_PROPERTY, games_collection_view_properties[GAMES_COLLECTION_VIEW_SHOW_GAME_ACTIONS_PROPERTY] = g_param_spec_boolean ("show-game-actions", "show-game-actions", "show-game-actions", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_VIEW_SHOW_REMOVE_ACTION_BUTTON_PROPERTY, games_collection_view_properties[GAMES_COLLECTION_VIEW_SHOW_REMOVE_ACTION_BUTTON_PROPERTY] = g_param_spec_boolean ("show-remove-action-button", "show-remove-action-button", "show-remove-action-button", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_VIEW_IS_ADD_AVAILABLE_PROPERTY, games_collection_view_properties[GAMES_COLLECTION_VIEW_IS_ADD_AVAILABLE_PROPERTY] = g_param_spec_boolean ("is-add-available", "is-add-available", "is-add-available", FALSE, 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/collection-view.ui");
	games_collection_view_signals[GAMES_COLLECTION_VIEW_GAME_ACTIVATED_SIGNAL] = g_signal_new ("game-activated", GAMES_TYPE_COLLECTION_VIEW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GAMES_TYPE_GAME);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "platforms_deck", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, platforms_deck));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "collections_deck", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, collections_deck));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "header_bar_stack", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, header_bar_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "header_bar", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, header_bar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "subview_header_bar", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, subview_header_bar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "selection_mode_header_bar", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, selection_mode_header_bar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "view_switcher_title", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, view_switcher_title));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "error_info_bar", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, error_info_bar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "search_bar", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, search_bar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "empty_collection", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, empty_collection));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "empty_search", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, empty_search));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "games_page", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, games_page));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "platforms_page", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, platforms_page));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "collections_page", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, collections_page));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "collection_subpage_header_bar", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, collection_subpage_header_bar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "selection_action_bar", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, selection_action_bar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "empty_stack", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, empty_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "viewstack", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, viewstack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "view_switcher_bar", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, view_switcher_bar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "swipe_group", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, swipe_group));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "collections_swipe_group", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, collections_swipe_group));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "undo_notification", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, undo_notification));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "collection_rename_entry", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, collection_rename_entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "rename_popover", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, rename_popover));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "collection_rename_error_label", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, collection_rename_error_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "selection_mode_label", FALSE, GamesCollectionView_private_offset + G_STRUCT_OFFSET (GamesCollectionViewPrivate, selection_mode_label));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_collection_subpage_opened", G_CALLBACK(_games_collection_view_on_collection_subpage_opened_g_object_notify));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "update_collection_name_validity", G_CALLBACK(_games_collection_view_update_collection_name_validity_g_object_notify));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_collection_rename_activated", G_CALLBACK(_games_collection_view_on_collection_rename_activated_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_selected_items_changed", G_CALLBACK(_games_collection_view_on_selected_items_changed_games_collections_page_selected_items_changed));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_collection_subpage_back_clicked", G_CALLBACK(_games_collection_view_on_collection_subpage_back_clicked_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_selection_mode_changed", G_CALLBACK(_games_collection_view_on_selection_mode_changed_g_object_notify));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_empty_collection_changed", G_CALLBACK(_games_collection_view_on_empty_collection_changed_g_object_notify));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "update_selection_availability", G_CALLBACK(_games_collection_view_update_selection_availability_g_object_notify));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_loading_notification_closed", G_CALLBACK(_games_collection_view_on_loading_notification_closed_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_game_activated", G_CALLBACK(_games_collection_view_on_game_activated_games_collections_page_game_activated));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_visible_child_changed", G_CALLBACK(_games_collection_view_on_visible_child_changed_g_object_notify));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_search_text_notify", G_CALLBACK(_games_collection_view_on_search_text_notify_g_object_notify));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_search_mode_changed", G_CALLBACK(_games_collection_view_on_search_mode_changed_g_object_notify));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_folded_changed", G_CALLBACK(_games_collection_view_on_folded_changed_g_object_notify));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "update_bottom_bar", G_CALLBACK(_games_collection_view_update_bottom_bar_g_object_notify));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "update_adaptive_state", G_CALLBACK(_games_collection_view_update_adaptive_state_g_object_notify));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_subview_back_clicked", G_CALLBACK(_games_collection_view_on_subview_back_clicked_gtk_button_clicked));
}

static void
games_collection_view_games_ui_view_interface_init (GamesUiViewIface * iface,
                                                    gpointer iface_data)
{
	games_collection_view_games_ui_view_parent_iface = g_type_interface_peek_parent (iface);
	iface->on_button_pressed = (gboolean (*) (GamesUiView*, GdkEventButton*)) games_collection_view_real_on_button_pressed;
	iface->on_key_pressed = (gboolean (*) (GamesUiView*, GdkEventKey*)) games_collection_view_real_on_key_pressed;
	iface->gamepad_button_press_event = (gboolean (*) (GamesUiView*, ManetteEvent*)) games_collection_view_real_gamepad_button_press_event;
	iface->gamepad_button_release_event = (gboolean (*) (GamesUiView*, ManetteEvent*)) games_collection_view_real_gamepad_button_release_event;
	iface->gamepad_absolute_axis_event = (gboolean (*) (GamesUiView*, ManetteEvent*)) games_collection_view_real_gamepad_absolute_axis_event;
	iface->get_is_view_active = games_collection_view_real_get_is_view_active;
	iface->set_is_view_active = games_collection_view_real_set_is_view_active;
}

static void
games_collection_view_instance_init (GamesCollectionView * self,
                                     gpointer klass)
{
	self->priv = games_collection_view_get_instance_private (self);
	g_type_ensure (GAMES_TYPE_ERROR_INFO_BAR);
	g_type_ensure (GAMES_TYPE_SEARCH_BAR);
	g_type_ensure (GAMES_TYPE_GAMES_PAGE);
	g_type_ensure (GAMES_TYPE_PLATFORMS_PAGE);
	g_type_ensure (GAMES_TYPE_COLLECTIONS_PAGE);
	g_type_ensure (GAMES_TYPE_SELECTION_ACTION_BAR);
	g_type_ensure (GAMES_TYPE_UNDO_NOTIFICATION);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
games_collection_view_finalize (GObject * obj)
{
	GamesCollectionView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_COLLECTION_VIEW, GamesCollectionView);
	self->filtering_terms = (_vala_array_free (self->filtering_terms, self->filtering_terms_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (self->priv->_window);
	_g_object_unref0 (self->priv->_game_model);
	_g_object_unref0 (self->priv->collection_manager);
	_g_object_unref0 (self->priv->konami_code);
	_g_object_unref0 (self->priv->action_group);
	G_OBJECT_CLASS (games_collection_view_parent_class)->finalize (obj);
}

static GType
games_collection_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GamesCollectionViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_collection_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesCollectionView), 0, (GInstanceInitFunc) games_collection_view_instance_init, NULL };
	static const GInterfaceInfo games_ui_view_info = { (GInterfaceInitFunc) games_collection_view_games_ui_view_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType games_collection_view_type_id;
	games_collection_view_type_id = g_type_register_static (gtk_box_get_type (), "GamesCollectionView", &g_define_type_info, 0);
	g_type_add_interface_static (games_collection_view_type_id, GAMES_TYPE_UI_VIEW, &games_ui_view_info);
	GamesCollectionView_private_offset = g_type_add_instance_private (games_collection_view_type_id, sizeof (GamesCollectionViewPrivate));
	return games_collection_view_type_id;
}

GType
games_collection_view_get_type (void)
{
	static volatile gsize games_collection_view_type_id__once = 0;
	if (g_once_init_enter (&games_collection_view_type_id__once)) {
		GType games_collection_view_type_id;
		games_collection_view_type_id = games_collection_view_get_type_once ();
		g_once_init_leave (&games_collection_view_type_id__once, games_collection_view_type_id);
	}
	return games_collection_view_type_id__once;
}

static void
_vala_games_collection_view_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	GamesCollectionView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_COLLECTION_VIEW, GamesCollectionView);
	switch (property_id) {
		case GAMES_COLLECTION_VIEW_IS_VIEW_ACTIVE_PROPERTY:
		g_value_set_boolean (value, games_ui_view_get_is_view_active ((GamesUiView*) self));
		break;
		case GAMES_COLLECTION_VIEW_IS_EMPTY_COLLECTION_PROPERTY:
		g_value_set_boolean (value, games_collection_view_get_is_empty_collection (self));
		break;
		case GAMES_COLLECTION_VIEW_WINDOW_PROPERTY:
		g_value_set_object (value, games_collection_view_get_window (self));
		break;
		case GAMES_COLLECTION_VIEW_GAME_MODEL_PROPERTY:
		g_value_set_object (value, games_collection_view_get_game_model (self));
		break;
		case GAMES_COLLECTION_VIEW_COLLECTION_MODEL_PROPERTY:
		g_value_set_object (value, games_collection_view_get_collection_model (self));
		break;
		case GAMES_COLLECTION_VIEW_LOADING_NOTIFICATION_PROPERTY:
		g_value_set_boolean (value, games_collection_view_get_loading_notification (self));
		break;
		case GAMES_COLLECTION_VIEW_SEARCH_MODE_PROPERTY:
		g_value_set_boolean (value, games_collection_view_get_search_mode (self));
		break;
		case GAMES_COLLECTION_VIEW_IS_FOLDED_PROPERTY:
		g_value_set_boolean (value, games_collection_view_get_is_folded (self));
		break;
		case GAMES_COLLECTION_VIEW_IS_SEARCH_AVAILABLE_PROPERTY:
		g_value_set_boolean (value, games_collection_view_get_is_search_available (self));
		break;
		case GAMES_COLLECTION_VIEW_IS_SHOWING_BOTTOM_BAR_PROPERTY:
		g_value_set_boolean (value, games_collection_view_get_is_showing_bottom_bar (self));
		break;
		case GAMES_COLLECTION_VIEW_IS_SUBVIEW_OPEN_PROPERTY:
		g_value_set_boolean (value, games_collection_view_get_is_subview_open (self));
		break;
		case GAMES_COLLECTION_VIEW_IS_SELECTION_MODE_PROPERTY:
		g_value_set_boolean (value, games_collection_view_get_is_selection_mode (self));
		break;
		case GAMES_COLLECTION_VIEW_IS_SELECTION_AVAILABLE_PROPERTY:
		g_value_set_boolean (value, games_collection_view_get_is_selection_available (self));
		break;
		case GAMES_COLLECTION_VIEW_IS_COLLECTION_RENAME_VALID_PROPERTY:
		g_value_set_boolean (value, games_collection_view_get_is_collection_rename_valid (self));
		break;
		case GAMES_COLLECTION_VIEW_SHOW_GAME_ACTIONS_PROPERTY:
		g_value_set_boolean (value, games_collection_view_get_show_game_actions (self));
		break;
		case GAMES_COLLECTION_VIEW_SHOW_REMOVE_ACTION_BUTTON_PROPERTY:
		g_value_set_boolean (value, games_collection_view_get_show_remove_action_button (self));
		break;
		case GAMES_COLLECTION_VIEW_IS_ADD_AVAILABLE_PROPERTY:
		g_value_set_boolean (value, games_collection_view_get_is_add_available (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_games_collection_view_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	GamesCollectionView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_COLLECTION_VIEW, GamesCollectionView);
	switch (property_id) {
		case GAMES_COLLECTION_VIEW_IS_VIEW_ACTIVE_PROPERTY:
		games_ui_view_set_is_view_active ((GamesUiView*) self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTION_VIEW_IS_EMPTY_COLLECTION_PROPERTY:
		games_collection_view_set_is_empty_collection (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTION_VIEW_FILTERING_TEXT_PROPERTY:
		games_collection_view_set_filtering_text (self, g_value_get_string (value));
		break;
		case GAMES_COLLECTION_VIEW_WINDOW_PROPERTY:
		games_collection_view_set_window (self, g_value_get_object (value));
		break;
		case GAMES_COLLECTION_VIEW_GAME_MODEL_PROPERTY:
		games_collection_view_set_game_model (self, g_value_get_object (value));
		break;
		case GAMES_COLLECTION_VIEW_COLLECTION_MODEL_PROPERTY:
		games_collection_view_set_collection_model (self, g_value_get_object (value));
		break;
		case GAMES_COLLECTION_VIEW_LOADING_NOTIFICATION_PROPERTY:
		games_collection_view_set_loading_notification (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTION_VIEW_SEARCH_MODE_PROPERTY:
		games_collection_view_set_search_mode (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTION_VIEW_IS_FOLDED_PROPERTY:
		games_collection_view_set_is_folded (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTION_VIEW_IS_SEARCH_AVAILABLE_PROPERTY:
		games_collection_view_set_is_search_available (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTION_VIEW_IS_SHOWING_BOTTOM_BAR_PROPERTY:
		games_collection_view_set_is_showing_bottom_bar (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTION_VIEW_IS_SUBVIEW_OPEN_PROPERTY:
		games_collection_view_set_is_subview_open (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTION_VIEW_IS_SELECTION_MODE_PROPERTY:
		games_collection_view_set_is_selection_mode (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTION_VIEW_IS_SELECTION_AVAILABLE_PROPERTY:
		games_collection_view_set_is_selection_available (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTION_VIEW_IS_COLLECTION_RENAME_VALID_PROPERTY:
		games_collection_view_set_is_collection_rename_valid (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTION_VIEW_SHOW_GAME_ACTIONS_PROPERTY:
		games_collection_view_set_show_game_actions (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTION_VIEW_SHOW_REMOVE_ACTION_BUTTON_PROPERTY:
		games_collection_view_set_show_remove_action_button (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTION_VIEW_IS_ADD_AVAILABLE_PROPERTY:
		games_collection_view_set_is_add_available (self, g_value_get_boolean (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 gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

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

