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

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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <handy.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include "gnome-games.h"
#include <libmanette.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>

#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_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;
typedef struct _GamesCollectionsPagePrivate GamesCollectionsPagePrivate;

#define GAMES_TYPE_COLLECTIONS_MAIN_PAGE (games_collections_main_page_get_type ())
#define GAMES_COLLECTIONS_MAIN_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_COLLECTIONS_MAIN_PAGE, GamesCollectionsMainPage))
#define GAMES_COLLECTIONS_MAIN_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_COLLECTIONS_MAIN_PAGE, GamesCollectionsMainPageClass))
#define GAMES_IS_COLLECTIONS_MAIN_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_COLLECTIONS_MAIN_PAGE))
#define GAMES_IS_COLLECTIONS_MAIN_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_COLLECTIONS_MAIN_PAGE))
#define GAMES_COLLECTIONS_MAIN_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_COLLECTIONS_MAIN_PAGE, GamesCollectionsMainPageClass))

typedef struct _GamesCollectionsMainPage GamesCollectionsMainPage;
typedef struct _GamesCollectionsMainPageClass GamesCollectionsMainPageClass;

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

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

#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;
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_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;
enum  {
	GAMES_COLLECTIONS_PAGE_0_PROPERTY,
	GAMES_COLLECTIONS_PAGE_IS_COLLECTION_EMPTY_PROPERTY,
	GAMES_COLLECTIONS_PAGE_COLLECTION_MODEL_PROPERTY,
	GAMES_COLLECTIONS_PAGE_CURRENT_COLLECTION_PROPERTY,
	GAMES_COLLECTIONS_PAGE_APPLICATION_WINDOW_PROPERTY,
	GAMES_COLLECTIONS_PAGE_IS_SEARCH_MODE_PROPERTY,
	GAMES_COLLECTIONS_PAGE_IS_SUBPAGE_OPEN_PROPERTY,
	GAMES_COLLECTIONS_PAGE_IS_SELECTION_MODE_PROPERTY,
	GAMES_COLLECTIONS_PAGE_IS_SHOWING_USER_COLLECTION_PROPERTY,
	GAMES_COLLECTIONS_PAGE_IS_SEARCH_EMPTY_PROPERTY,
	GAMES_COLLECTIONS_PAGE_CAN_SWIPE_BACK_PROPERTY,
	GAMES_COLLECTIONS_PAGE_COLLECTION_TITLE_PROPERTY,
	GAMES_COLLECTIONS_PAGE_REMOVED_NOTIFICATION_TITLE_PROPERTY,
	GAMES_COLLECTIONS_PAGE_NUM_PROPERTIES
};
static GParamSpec* games_collections_page_properties[GAMES_COLLECTIONS_PAGE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define 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_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;
enum  {
	GAMES_COLLECTIONS_PAGE_GAME_ACTIVATED_SIGNAL,
	GAMES_COLLECTIONS_PAGE_SELECTED_ITEMS_CHANGED_SIGNAL,
	GAMES_COLLECTIONS_PAGE_NUM_SIGNALS
};
static guint games_collections_page_signals[GAMES_COLLECTIONS_PAGE_NUM_SIGNALS] = {0};

struct _GamesCollectionsPage {
	GtkBin parent_instance;
	GamesCollectionsPagePrivate * priv;
};

struct _GamesCollectionsPageClass {
	GtkBinClass parent_class;
};

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

struct _GamesCollectionsPagePrivate {
	HdyDeck* collections_deck;
	GamesCollectionsMainPage* collections_main_page;
	GtkStack* collections_subpage_stack;
	GamesGamesPage* collections_subpage;
	HdyStatusPage* collection_empty_subpage;
	GamesUserCollection** last_removed_collections;
	gint last_removed_collections_length1;
	gint _last_removed_collections_size_;
	GamesCollectionManager* collection_manager;
	gboolean _is_collection_empty;
	GamesCollection* _current_collection;
	GamesApplicationWindow* _application_window;
	gboolean _is_search_mode;
	gboolean _is_subpage_open;
	gboolean _is_selection_mode;
	gboolean _is_showing_user_collection;
	gboolean _is_search_empty;
	gboolean _can_swipe_back;
	gchar* _collection_title;
	gchar* _removed_notification_title;
};

static gint GamesCollectionsPage_private_offset;
static gpointer games_collections_page_parent_class = NULL;

VALA_EXTERN GType games_collections_page_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_collections_main_page_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_games_page_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_user_collection_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_collection_manager_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_game_model_get_type (void) G_GNUC_CONST ;
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 GType games_application_window_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void games_collections_page_select_all (GamesCollectionsPage* self);
VALA_EXTERN gboolean games_collections_page_get_is_subpage_open (GamesCollectionsPage* self);
VALA_EXTERN void games_games_page_select_all (GamesGamesPage* self);
VALA_EXTERN void games_collections_main_page_select_all (GamesCollectionsMainPage* self);
VALA_EXTERN void games_collections_page_select_none (GamesCollectionsPage* self);
VALA_EXTERN void games_games_page_select_none (GamesGamesPage* self);
VALA_EXTERN void games_collections_main_page_select_none (GamesCollectionsMainPage* self);
VALA_EXTERN GamesGame** games_collections_page_get_selected_games (GamesCollectionsPage* self,
                                                       gint* result_length1);
VALA_EXTERN GamesGame** games_games_page_get_selected_games (GamesGamesPage* self,
                                                 gint* result_length1);
VALA_EXTERN GamesUserCollection** games_collections_page_get_selected_collections (GamesCollectionsPage* self,
                                                                       gint* result_length1);
VALA_EXTERN GamesUserCollection** games_collections_main_page_get_selected_collections (GamesCollectionsMainPage* self,
                                                                            gint* result_length1);
VALA_EXTERN gboolean games_collections_page_gamepad_button_press_event (GamesCollectionsPage* self,
                                                            ManetteEvent* event);
VALA_EXTERN gboolean games_games_page_gamepad_button_press_event (GamesGamesPage* self,
                                                      ManetteEvent* event);
VALA_EXTERN gboolean games_collections_main_page_gamepad_button_press_event (GamesCollectionsMainPage* self,
                                                                 ManetteEvent* event);
VALA_EXTERN gboolean games_collections_page_gamepad_button_release_event (GamesCollectionsPage* self,
                                                              ManetteEvent* event);
VALA_EXTERN gboolean games_games_page_gamepad_button_release_event (GamesGamesPage* self,
                                                        ManetteEvent* event);
VALA_EXTERN gboolean games_collections_main_page_gamepad_button_release_event (GamesCollectionsMainPage* self,
                                                                   ManetteEvent* event);
VALA_EXTERN gboolean games_collections_page_gamepad_absolute_axis_event (GamesCollectionsPage* self,
                                                             ManetteEvent* event);
VALA_EXTERN gboolean games_games_page_gamepad_absolute_axis_event (GamesGamesPage* self,
                                                       ManetteEvent* event);
VALA_EXTERN gboolean games_collections_main_page_gamepad_absolute_axis_event (GamesCollectionsMainPage* self,
                                                                  ManetteEvent* event);
VALA_EXTERN void games_collections_page_reset_scroll_position (GamesCollectionsPage* self);
VALA_EXTERN void games_games_page_reset_scroll_position (GamesGamesPage* self);
VALA_EXTERN void games_collections_main_page_reset_scroll_position (GamesCollectionsMainPage* self);
VALA_EXTERN void games_collections_page_update_is_collection_empty (GamesCollectionsPage* self);
VALA_EXTERN GamesGameModel* games_games_page_get_game_model (GamesGamesPage* self);
VALA_EXTERN void games_collections_page_set_is_collection_empty (GamesCollectionsPage* self,
                                                     gboolean value);
VALA_EXTERN void games_collections_page_set_filter (GamesCollectionsPage* self,
                                        gchar** filtering_terms,
                                        gint filtering_terms_length1);
VALA_EXTERN void games_games_page_set_filter (GamesGamesPage* self,
                                  gchar** filtering_terms,
                                  gint filtering_terms_length1);
VALA_EXTERN void games_collections_main_page_set_filter (GamesCollectionsMainPage* self,
                                             gchar** filtering_terms,
                                             gint filtering_terms_length1);
VALA_EXTERN HdyDeck* games_collections_page_get_collections_deck (GamesCollectionsPage* self);
VALA_EXTERN gboolean games_collections_page_exit_subpage (GamesCollectionsPage* self);
static gboolean games_collections_page_on_subpage_back_clicked (GamesCollectionsPage* self);
VALA_EXTERN void games_collections_page_invalidate_filter (GamesCollectionsPage* self);
VALA_EXTERN void games_collections_main_page_invalidate_filter (GamesCollectionsMainPage* self);
VALA_EXTERN void games_collections_page_invalidate_sort (GamesCollectionsPage* self);
VALA_EXTERN void games_collections_main_page_invalidate_sort (GamesCollectionsMainPage* self);
VALA_EXTERN void games_collections_page_remove_current_user_collection (GamesCollectionsPage* self);
VALA_EXTERN gboolean games_collections_page_get_is_showing_user_collection (GamesCollectionsPage* self);
VALA_EXTERN GamesCollection* games_collections_page_get_current_collection (GamesCollectionsPage* self);
static void games_collections_page_remove_collections (GamesCollectionsPage* self,
                                                GamesUserCollection** collections,
                                                gint collections_length1);
VALA_EXTERN void games_collections_page_remove_currently_selected_user_collections (GamesCollectionsPage* self);
VALA_EXTERN void games_collections_page_undo_remove_collection (GamesCollectionsPage* self);
VALA_EXTERN GType games_collection_model_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GamesCollectionModel* games_collections_page_get_collection_model (GamesCollectionsPage* self);
VALA_EXTERN void games_collection_model_add_collection (GamesCollectionModel* self,
                                            GamesCollection* collection);
VALA_EXTERN void games_collections_page_finalize_collection_removal (GamesCollectionsPage* self);
VALA_EXTERN gboolean games_collection_manager_remove_user_collection (GamesCollectionManager* self,
                                                          GamesUserCollection* collection);
VALA_EXTERN void games_collection_model_remove_collection (GamesCollectionModel* self,
                                               GamesCollection* collection);
VALA_EXTERN const gchar* games_collection_get_title (GamesCollection* self);
VALA_EXTERN void games_collections_page_set_removed_notification_title (GamesCollectionsPage* self,
                                                            const gchar* value);
static GamesUserCollection** _vala_array_dup20 (GamesUserCollection** self,
                                         gssize length);
VALA_EXTERN void games_collections_page_set_is_search_mode (GamesCollectionsPage* self,
                                                gboolean value);
VALA_EXTERN void games_collections_page_set_current_collection (GamesCollectionsPage* self,
                                                    GamesCollection* value);
static gboolean _games_collections_page_on_subpage_back_clicked_games_games_page_gamepad_cancel_clicked (GamesGamesPage* _sender,
                                                                                                  gpointer self);
static void games_collections_page_on_collection_activated (GamesCollectionsPage* self,
                                                     GamesCollection* collection);
VALA_EXTERN GamesCollectionType games_collection_get_collection_type (GamesCollection* 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 void games_collections_page_set_collection_title (GamesCollectionsPage* self,
                                                  const gchar* value);
VALA_EXTERN GamesGameModel* games_collection_get_game_model (GamesCollection* self);
VALA_EXTERN gboolean games_collections_page_get_is_collection_empty (GamesCollectionsPage* self);
VALA_EXTERN gboolean games_collection_get_hide_stars (GamesCollection* self);
VALA_EXTERN void games_games_page_set_hide_stars (GamesGamesPage* self,
                                      gboolean value);
VALA_EXTERN void games_games_page_set_game_model (GamesGamesPage* self,
                                      GamesGameModel* value);
static void _games_collections_page_on_collection_activated_games_collections_main_page_collection_activated (GamesCollectionsMainPage* _sender,
                                                                                                       GamesCollection* collection,
                                                                                                       gpointer self);
static void games_collections_page_on_game_activated (GamesCollectionsPage* self,
                                               GamesGame* game);
static void _games_collections_page_on_game_activated_games_games_page_game_activated (GamesGamesPage* _sender,
                                                                                GamesGame* game,
                                                                                gpointer self);
static void games_collections_page_on_visible_child_changed (GamesCollectionsPage* self);
VALA_EXTERN void games_collections_page_set_is_subpage_open (GamesCollectionsPage* self,
                                                 gboolean value);
static void _games_collections_page_on_visible_child_changed_g_object_notify (GObject* _sender,
                                                                       GParamSpec* pspec,
                                                                       gpointer self);
static void games_collections_page_update_can_swipe_back (GamesCollectionsPage* self);
VALA_EXTERN gboolean games_collections_page_get_is_search_mode (GamesCollectionsPage* self);
VALA_EXTERN gboolean games_collections_page_get_is_selection_mode (GamesCollectionsPage* self);
VALA_EXTERN void games_collections_page_set_can_swipe_back (GamesCollectionsPage* self,
                                                gboolean value);
static void _games_collections_page_update_can_swipe_back_g_object_notify (GObject* _sender,
                                                                    GParamSpec* pspec,
                                                                    gpointer self);
VALA_EXTERN GamesCollectionsPage* games_collections_page_new (void);
VALA_EXTERN GamesCollectionsPage* games_collections_page_construct (GType object_type);
VALA_EXTERN GamesCollectionModel* games_collections_main_page_get_collection_model (GamesCollectionsMainPage* self);
VALA_EXTERN void games_collections_page_set_collection_model (GamesCollectionsPage* self,
                                                  GamesCollectionModel* value);
VALA_EXTERN void games_collections_main_page_set_collection_model (GamesCollectionsMainPage* self,
                                                       GamesCollectionModel* value);
VALA_EXTERN void games_collections_page_set_is_showing_user_collection (GamesCollectionsPage* self,
                                                            gboolean value);
VALA_EXTERN GamesApplicationWindow* games_collections_page_get_application_window (GamesCollectionsPage* self);
VALA_EXTERN void games_collections_page_set_application_window (GamesCollectionsPage* self,
                                                    GamesApplicationWindow* value);
VALA_EXTERN void games_collections_page_set_is_selection_mode (GamesCollectionsPage* self,
                                                   gboolean value);
VALA_EXTERN gboolean games_collections_page_get_is_search_empty (GamesCollectionsPage* self);
VALA_EXTERN void games_collections_page_set_is_search_empty (GamesCollectionsPage* self,
                                                 gboolean value);
VALA_EXTERN gboolean games_collections_page_get_can_swipe_back (GamesCollectionsPage* self);
VALA_EXTERN const gchar* games_collections_page_get_collection_title (GamesCollectionsPage* self);
VALA_EXTERN const gchar* games_collections_page_get_removed_notification_title (GamesCollectionsPage* self);
static GObject * games_collections_page_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_collections_page___lambda46_ (GamesCollectionsPage* self);
VALA_EXTERN gboolean games_games_page_select_default_game (GamesGamesPage* self,
                                               GtkDirectionType direction);
static void __games_collections_page___lambda46__games_collections_main_page_gamepad_accepted (GamesCollectionsMainPage* _sender,
                                                                                        gpointer self);
static void _games_collections_page___lambda47_ (GamesCollectionsPage* self);
static void __games_collections_page___lambda47__games_games_page_selected_items_changed (GamesGamesPage* _sender,
                                                                                   gpointer self);
static void _games_collections_page___lambda48_ (GamesCollectionsPage* self);
static void __games_collections_page___lambda48__games_collections_main_page_selected_items_changed (GamesCollectionsMainPage* _sender,
                                                                                              gpointer self);
static void games_collections_page_finalize (GObject * obj);
static GType games_collections_page_get_type_once (void);
static void _vala_games_collections_page_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec);
static void _vala_games_collections_page_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
games_collections_page_get_instance_private (GamesCollectionsPage* self)
{
	return G_STRUCT_MEMBER_P (self, GamesCollectionsPage_private_offset);
}

void
games_collections_page_select_all (GamesCollectionsPage* self)
{
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_is_subpage_open;
	if (_tmp0_) {
		GamesGamesPage* _tmp1_;
		_tmp1_ = self->priv->collections_subpage;
		games_games_page_select_all (_tmp1_);
	} else {
		GamesCollectionsMainPage* _tmp2_;
		_tmp2_ = self->priv->collections_main_page;
		games_collections_main_page_select_all (_tmp2_);
	}
}

void
games_collections_page_select_none (GamesCollectionsPage* self)
{
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_is_subpage_open;
	if (_tmp0_) {
		GamesGamesPage* _tmp1_;
		_tmp1_ = self->priv->collections_subpage;
		games_games_page_select_none (_tmp1_);
	} else {
		GamesCollectionsMainPage* _tmp2_;
		_tmp2_ = self->priv->collections_main_page;
		games_collections_main_page_select_none (_tmp2_);
	}
}

GamesGame**
games_collections_page_get_selected_games (GamesCollectionsPage* self,
                                           gint* result_length1)
{
	GamesGamesPage* _tmp0_;
	gint _tmp1_ = 0;
	GamesGame** _tmp2_;
	GamesGame** _tmp3_;
	gint _tmp3__length1;
	GamesGame** result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->collections_subpage;
	_tmp2_ = games_games_page_get_selected_games (_tmp0_, &_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp3__length1 = _tmp1_;
	if (result_length1) {
		*result_length1 = _tmp3__length1;
	}
	result = _tmp3_;
	return result;
}

GamesUserCollection**
games_collections_page_get_selected_collections (GamesCollectionsPage* self,
                                                 gint* result_length1)
{
	GamesCollectionsMainPage* _tmp0_;
	gint _tmp1_ = 0;
	GamesUserCollection** _tmp2_;
	GamesUserCollection** _tmp3_;
	gint _tmp3__length1;
	GamesUserCollection** result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->collections_main_page;
	_tmp2_ = games_collections_main_page_get_selected_collections (_tmp0_, &_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp3__length1 = _tmp1_;
	if (result_length1) {
		*result_length1 = _tmp3__length1;
	}
	result = _tmp3_;
	return result;
}

gboolean
games_collections_page_gamepad_button_press_event (GamesCollectionsPage* self,
                                                   ManetteEvent* event)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp1_ = self->priv->_is_subpage_open;
	if (_tmp1_) {
		GamesGamesPage* _tmp2_;
		_tmp2_ = self->priv->collections_subpage;
		_tmp0_ = games_games_page_gamepad_button_press_event (_tmp2_, event);
	} else {
		GamesCollectionsMainPage* _tmp3_;
		_tmp3_ = self->priv->collections_main_page;
		_tmp0_ = games_collections_main_page_gamepad_button_press_event (_tmp3_, event);
	}
	result = _tmp0_;
	return result;
}

gboolean
games_collections_page_gamepad_button_release_event (GamesCollectionsPage* self,
                                                     ManetteEvent* event)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp1_ = self->priv->_is_subpage_open;
	if (_tmp1_) {
		GamesGamesPage* _tmp2_;
		_tmp2_ = self->priv->collections_subpage;
		_tmp0_ = games_games_page_gamepad_button_release_event (_tmp2_, event);
	} else {
		GamesCollectionsMainPage* _tmp3_;
		_tmp3_ = self->priv->collections_main_page;
		_tmp0_ = games_collections_main_page_gamepad_button_release_event (_tmp3_, event);
	}
	result = _tmp0_;
	return result;
}

gboolean
games_collections_page_gamepad_absolute_axis_event (GamesCollectionsPage* self,
                                                    ManetteEvent* event)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp1_ = self->priv->_is_subpage_open;
	if (_tmp1_) {
		GamesGamesPage* _tmp2_;
		_tmp2_ = self->priv->collections_subpage;
		_tmp0_ = games_games_page_gamepad_absolute_axis_event (_tmp2_, event);
	} else {
		GamesCollectionsMainPage* _tmp3_;
		_tmp3_ = self->priv->collections_main_page;
		_tmp0_ = games_collections_main_page_gamepad_absolute_axis_event (_tmp3_, event);
	}
	result = _tmp0_;
	return result;
}

void
games_collections_page_reset_scroll_position (GamesCollectionsPage* self)
{
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_is_subpage_open;
	if (_tmp0_) {
		GamesGamesPage* _tmp1_;
		_tmp1_ = self->priv->collections_subpage;
		games_games_page_reset_scroll_position (_tmp1_);
	} else {
		GamesCollectionsMainPage* _tmp2_;
		_tmp2_ = self->priv->collections_main_page;
		games_collections_main_page_reset_scroll_position (_tmp2_);
	}
}

void
games_collections_page_update_is_collection_empty (GamesCollectionsPage* self)
{
	GamesGamesPage* _tmp0_;
	GamesGameModel* _tmp1_;
	GamesGameModel* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->collections_subpage;
	_tmp1_ = games_games_page_get_game_model (_tmp0_);
	_tmp2_ = _tmp1_;
	games_collections_page_set_is_collection_empty (self, g_list_model_get_n_items ((GListModel*) _tmp2_) == ((guint) 0));
}

void
games_collections_page_set_filter (GamesCollectionsPage* self,
                                   gchar** filtering_terms,
                                   gint filtering_terms_length1)
{
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_is_subpage_open;
	if (_tmp0_) {
		GamesGamesPage* _tmp1_;
		_tmp1_ = self->priv->collections_subpage;
		games_games_page_set_filter (_tmp1_, filtering_terms, (gint) filtering_terms_length1);
	} else {
		GamesCollectionsMainPage* _tmp2_;
		_tmp2_ = self->priv->collections_main_page;
		games_collections_main_page_set_filter (_tmp2_, filtering_terms, (gint) filtering_terms_length1);
	}
}

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

HdyDeck*
games_collections_page_get_collections_deck (GamesCollectionsPage* self)
{
	HdyDeck* _tmp0_;
	HdyDeck* _tmp1_;
	HdyDeck* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->collections_deck;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

gboolean
games_collections_page_exit_subpage (GamesCollectionsPage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = games_collections_page_on_subpage_back_clicked (self);
	return result;
}

void
games_collections_page_invalidate_filter (GamesCollectionsPage* self)
{
	GamesCollectionsMainPage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->collections_main_page;
	games_collections_main_page_invalidate_filter (_tmp0_);
}

void
games_collections_page_invalidate_sort (GamesCollectionsPage* self)
{
	GamesCollectionsMainPage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->collections_main_page;
	games_collections_main_page_invalidate_sort (_tmp0_);
}

void
games_collections_page_remove_current_user_collection (GamesCollectionsPage* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	GamesCollection* _tmp4_;
	GamesCollection* _tmp5_;
	GamesUserCollection* _tmp6_;
	GamesUserCollection** _tmp7_;
	GamesUserCollection** _tmp8_;
	gint _tmp8__length1;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_is_showing_user_collection;
	if (!_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		GamesCollection* _tmp2_;
		GamesCollection* _tmp3_;
		_tmp2_ = games_collections_page_get_current_collection (self);
		_tmp3_ = _tmp2_;
		_tmp0_ = _tmp3_ == NULL;
	}
	if (_tmp0_) {
		return;
	}
	_tmp4_ = games_collections_page_get_current_collection (self);
	_tmp5_ = _tmp4_;
	_tmp6_ = _g_object_ref0 (GAMES_IS_USER_COLLECTION (_tmp5_) ? ((GamesUserCollection*) _tmp5_) : NULL);
	_tmp7_ = g_new0 (GamesUserCollection*, 1 + 1);
	_tmp7_[0] = _tmp6_;
	_tmp8_ = _tmp7_;
	_tmp8__length1 = 1;
	games_collections_page_remove_collections (self, _tmp8_, (gint) 1);
	_tmp8_ = (_vala_array_free (_tmp8_, _tmp8__length1, (GDestroyNotify) g_object_unref), NULL);
	games_collections_page_on_subpage_back_clicked (self);
}

void
games_collections_page_remove_currently_selected_user_collections (GamesCollectionsPage* self)
{
	GamesCollectionsMainPage* _tmp0_;
	gint _tmp1_ = 0;
	GamesUserCollection** _tmp2_;
	GamesUserCollection** _tmp3_;
	gint _tmp3__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->collections_main_page;
	_tmp2_ = games_collections_main_page_get_selected_collections (_tmp0_, &_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp3__length1 = _tmp1_;
	games_collections_page_remove_collections (self, _tmp3_, (gint) _tmp1_);
	_tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_object_unref), NULL);
}

void
games_collections_page_undo_remove_collection (GamesCollectionsPage* self)
{
	GamesUserCollection** _tmp0_;
	gint _tmp0__length1;
	GamesUserCollection** _tmp1_;
	gint _tmp1__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->last_removed_collections;
	_tmp0__length1 = self->priv->last_removed_collections_length1;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->last_removed_collections;
	_tmp1__length1 = self->priv->last_removed_collections_length1;
	{
		GamesUserCollection** collection_collection = NULL;
		gint collection_collection_length1 = 0;
		gint _collection_collection_size_ = 0;
		gint collection_it = 0;
		collection_collection = _tmp1_;
		collection_collection_length1 = _tmp1__length1;
		for (collection_it = 0; collection_it < collection_collection_length1; collection_it = collection_it + 1) {
			GamesUserCollection* _tmp2_;
			GamesUserCollection* collection = NULL;
			_tmp2_ = _g_object_ref0 (collection_collection[collection_it]);
			collection = _tmp2_;
			{
				GamesCollectionModel* _tmp3_;
				GamesCollectionModel* _tmp4_;
				GamesUserCollection* _tmp5_;
				GamesUserCollection* _tmp6_;
				_tmp3_ = games_collections_page_get_collection_model (self);
				_tmp4_ = _tmp3_;
				_tmp5_ = collection;
				games_collection_model_add_collection (_tmp4_, (GamesCollection*) _tmp5_);
				_tmp6_ = collection;
				g_signal_emit_by_name ((GamesCollection*) _tmp6_, "games-changed");
				_g_object_unref0 (collection);
			}
		}
	}
	self->priv->last_removed_collections = (_vala_array_free (self->priv->last_removed_collections, self->priv->last_removed_collections_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->last_removed_collections = NULL;
	self->priv->last_removed_collections_length1 = 0;
	self->priv->_last_removed_collections_size_ = self->priv->last_removed_collections_length1;
}

void
games_collections_page_finalize_collection_removal (GamesCollectionsPage* self)
{
	GamesUserCollection** _tmp0_;
	gint _tmp0__length1;
	GamesUserCollection** _tmp1_;
	gint _tmp1__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->last_removed_collections;
	_tmp0__length1 = self->priv->last_removed_collections_length1;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->last_removed_collections;
	_tmp1__length1 = self->priv->last_removed_collections_length1;
	{
		GamesUserCollection** collection_collection = NULL;
		gint collection_collection_length1 = 0;
		gint _collection_collection_size_ = 0;
		gint collection_it = 0;
		collection_collection = _tmp1_;
		collection_collection_length1 = _tmp1__length1;
		for (collection_it = 0; collection_it < collection_collection_length1; collection_it = collection_it + 1) {
			GamesUserCollection* _tmp2_;
			GamesUserCollection* collection = NULL;
			_tmp2_ = _g_object_ref0 (collection_collection[collection_it]);
			collection = _tmp2_;
			{
				GamesCollectionManager* _tmp3_;
				GamesUserCollection* _tmp4_;
				_tmp3_ = self->priv->collection_manager;
				_tmp4_ = collection;
				games_collection_manager_remove_user_collection (_tmp3_, _tmp4_);
				_g_object_unref0 (collection);
			}
		}
	}
	self->priv->last_removed_collections = (_vala_array_free (self->priv->last_removed_collections, self->priv->last_removed_collections_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->last_removed_collections = NULL;
	self->priv->last_removed_collections_length1 = 0;
	self->priv->_last_removed_collections_size_ = self->priv->last_removed_collections_length1;
}

static GamesUserCollection**
_vala_array_dup20 (GamesUserCollection** self,
                   gssize length)
{
	if (length >= 0) {
		GamesUserCollection** result;
		gssize i;
		result = g_new0 (GamesUserCollection*, length + 1);
		for (i = 0; i < length; i++) {
			GamesUserCollection* _tmp0_;
			_tmp0_ = _g_object_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static void
games_collections_page_remove_collections (GamesCollectionsPage* self,
                                           GamesUserCollection** collections,
                                           gint collections_length1)
{
	gchar* _tmp4_ = NULL;
	GamesUserCollection** _tmp10_;
	gint _tmp10__length1;
	g_return_if_fail (self != NULL);
	if (collections_length1 == 0) {
		return;
	}
	games_collections_page_finalize_collection_removal (self);
	{
		GamesUserCollection** 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) {
			GamesUserCollection* _tmp0_;
			GamesUserCollection* collection = NULL;
			_tmp0_ = _g_object_ref0 (collection_collection[collection_it]);
			collection = _tmp0_;
			{
				GamesCollectionModel* _tmp1_;
				GamesCollectionModel* _tmp2_;
				GamesUserCollection* _tmp3_;
				_tmp1_ = games_collections_page_get_collection_model (self);
				_tmp2_ = _tmp1_;
				_tmp3_ = collection;
				games_collection_model_remove_collection (_tmp2_, (GamesCollection*) _tmp3_);
				_g_object_unref0 (collection);
			}
		}
	}
	if (collections_length1 == 1) {
		GamesUserCollection* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		gchar* _tmp8_;
		_tmp5_ = collections[0];
		_tmp6_ = games_collection_get_title ((GamesCollection*) _tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = g_strdup_printf (_ ("%s removed"), _tmp7_);
		_g_free0 (_tmp4_);
		_tmp4_ = _tmp8_;
	} else {
		gchar* _tmp9_;
		_tmp9_ = g_strdup_printf (ngettext ("Removed %d collection", "Removed %d collections", (gulong) collections_length1), collections_length1);
		_g_free0 (_tmp4_);
		_tmp4_ = _tmp9_;
	}
	games_collections_page_set_removed_notification_title (self, _tmp4_);
	_tmp10_ = (collections != NULL) ? _vala_array_dup20 (collections, collections_length1) : collections;
	_tmp10__length1 = collections_length1;
	self->priv->last_removed_collections = (_vala_array_free (self->priv->last_removed_collections, self->priv->last_removed_collections_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->last_removed_collections = _tmp10_;
	self->priv->last_removed_collections_length1 = _tmp10__length1;
	self->priv->_last_removed_collections_size_ = self->priv->last_removed_collections_length1;
	_g_free0 (_tmp4_);
}

static gboolean
games_collections_page_on_subpage_back_clicked (GamesCollectionsPage* self)
{
	gboolean _tmp0_;
	HdyDeck* _tmp1_;
	GamesCollectionsMainPage* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_is_subpage_open;
	if (!_tmp0_) {
		result = FALSE;
		return result;
	}
	games_collections_page_set_is_search_mode (self, FALSE);
	_tmp1_ = self->priv->collections_deck;
	_tmp2_ = self->priv->collections_main_page;
	hdy_deck_set_visible_child (_tmp1_, (GtkWidget*) _tmp2_);
	games_collections_page_set_current_collection (self, NULL);
	result = TRUE;
	return result;
}

static gboolean
_games_collections_page_on_subpage_back_clicked_games_games_page_gamepad_cancel_clicked (GamesGamesPage* _sender,
                                                                                         gpointer self)
{
	gboolean result;
	result = games_collections_page_on_subpage_back_clicked ((GamesCollectionsPage*) self);
	return result;
}

static void
games_collections_page_on_collection_activated (GamesCollectionsPage* self,
                                                GamesCollection* collection)
{
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	HdyDeck* _tmp7_;
	GtkStack* _tmp8_;
	GamesGameModel* _tmp9_;
	GamesGameModel* _tmp10_;
	gboolean _tmp11_;
	gboolean _tmp12_;
	GamesGamesPage* _tmp13_;
	GamesGamesPage* _tmp14_;
	GamesGameModel* _tmp15_;
	GamesGameModel* _tmp16_;
	GamesGamesPage* _tmp17_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (collection != NULL);
	if (games_collection_get_collection_type (collection) == GAMES_COLLECTION_TYPE_PLACEHOLDER) {
		GamesCollectionActionWindow* dialog = NULL;
		GamesCollectionActionWindow* _tmp0_;
		GamesCollectionActionWindow* _tmp1_;
		GtkWidget* _tmp2_;
		GamesCollectionActionWindow* _tmp3_;
		GamesCollectionActionWindow* _tmp4_;
		games_collections_page_finalize_collection_removal (self);
		_tmp0_ = games_collection_action_window_new (TRUE, NULL);
		g_object_ref_sink (_tmp0_);
		dialog = _tmp0_;
		_tmp1_ = dialog;
		_tmp2_ = gtk_widget_get_toplevel ((GtkWidget*) self);
		gtk_window_set_transient_for ((GtkWindow*) _tmp1_, (GtkWindow*) (GAMES_IS_APPLICATION_WINDOW (_tmp2_) ? ((GamesApplicationWindow*) _tmp2_) : NULL));
		_tmp3_ = dialog;
		gtk_window_set_modal ((GtkWindow*) _tmp3_, TRUE);
		_tmp4_ = dialog;
		gtk_widget_set_visible ((GtkWidget*) _tmp4_, TRUE);
		_g_object_unref0 (dialog);
		return;
	}
	games_collections_page_set_current_collection (self, collection);
	_tmp5_ = games_collection_get_title (collection);
	_tmp6_ = _tmp5_;
	games_collections_page_set_collection_title (self, _tmp6_);
	_tmp7_ = self->priv->collections_deck;
	_tmp8_ = self->priv->collections_subpage_stack;
	hdy_deck_set_visible_child (_tmp7_, (GtkWidget*) _tmp8_);
	_tmp9_ = games_collection_get_game_model (collection);
	_tmp10_ = _tmp9_;
	games_collections_page_set_is_collection_empty (self, g_list_model_get_n_items ((GListModel*) _tmp10_) == ((guint) 0));
	_g_object_unref0 (_tmp10_);
	_tmp11_ = games_collections_page_get_is_collection_empty (self);
	_tmp12_ = _tmp11_;
	if (_tmp12_) {
		return;
	}
	_tmp13_ = self->priv->collections_subpage;
	games_games_page_set_hide_stars (_tmp13_, games_collection_get_hide_stars (collection));
	_tmp14_ = self->priv->collections_subpage;
	_tmp15_ = games_collection_get_game_model (collection);
	_tmp16_ = _tmp15_;
	games_games_page_set_game_model (_tmp14_, _tmp16_);
	_g_object_unref0 (_tmp16_);
	_tmp17_ = self->priv->collections_subpage;
	games_games_page_reset_scroll_position (_tmp17_);
}

static void
_games_collections_page_on_collection_activated_games_collections_main_page_collection_activated (GamesCollectionsMainPage* _sender,
                                                                                                  GamesCollection* collection,
                                                                                                  gpointer self)
{
	games_collections_page_on_collection_activated ((GamesCollectionsPage*) self, collection);
}

static void
games_collections_page_on_game_activated (GamesCollectionsPage* self,
                                          GamesGame* game)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (game != NULL);
	g_signal_emit (self, games_collections_page_signals[GAMES_COLLECTIONS_PAGE_GAME_ACTIVATED_SIGNAL], 0, game);
}

static void
_games_collections_page_on_game_activated_games_games_page_game_activated (GamesGamesPage* _sender,
                                                                           GamesGame* game,
                                                                           gpointer self)
{
	games_collections_page_on_game_activated ((GamesCollectionsPage*) self, game);
}

static void
games_collections_page_on_visible_child_changed (GamesCollectionsPage* self)
{
	HdyDeck* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GtkStack* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->collections_deck;
	_tmp1_ = hdy_deck_get_visible_child (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->collections_subpage_stack;
	games_collections_page_set_is_subpage_open (self, _tmp2_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget));
}

static void
_games_collections_page_on_visible_child_changed_g_object_notify (GObject* _sender,
                                                                  GParamSpec* pspec,
                                                                  gpointer self)
{
	games_collections_page_on_visible_child_changed ((GamesCollectionsPage*) self);
}

static void
games_collections_page_update_can_swipe_back (GamesCollectionsPage* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_is_search_mode;
	if (!_tmp1_) {
		gboolean _tmp2_;
		_tmp2_ = self->priv->_is_selection_mode;
		_tmp0_ = !_tmp2_;
	} else {
		_tmp0_ = FALSE;
	}
	games_collections_page_set_can_swipe_back (self, _tmp0_);
}

static void
_games_collections_page_update_can_swipe_back_g_object_notify (GObject* _sender,
                                                               GParamSpec* pspec,
                                                               gpointer self)
{
	games_collections_page_update_can_swipe_back ((GamesCollectionsPage*) self);
}

GamesCollectionsPage*
games_collections_page_construct (GType object_type)
{
	GamesCollectionsPage * self = NULL;
	self = (GamesCollectionsPage*) g_object_new (object_type, NULL);
	return self;
}

GamesCollectionsPage*
games_collections_page_new (void)
{
	return games_collections_page_construct (GAMES_TYPE_COLLECTIONS_PAGE);
}

gboolean
games_collections_page_get_is_collection_empty (GamesCollectionsPage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_collection_empty;
	return result;
}

void
games_collections_page_set_is_collection_empty (GamesCollectionsPage* self,
                                                gboolean value)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	self->priv->_is_collection_empty = value;
	_tmp0_ = games_collections_page_get_is_collection_empty (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		GtkStack* _tmp2_;
		HdyStatusPage* _tmp3_;
		_tmp2_ = self->priv->collections_subpage_stack;
		_tmp3_ = self->priv->collection_empty_subpage;
		gtk_stack_set_visible_child (_tmp2_, (GtkWidget*) _tmp3_);
	} else {
		GtkStack* _tmp4_;
		GamesGamesPage* _tmp5_;
		_tmp4_ = self->priv->collections_subpage_stack;
		_tmp5_ = self->priv->collections_subpage;
		gtk_stack_set_visible_child (_tmp4_, (GtkWidget*) _tmp5_);
	}
	g_object_notify_by_pspec ((GObject *) self, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_IS_COLLECTION_EMPTY_PROPERTY]);
}

GamesCollectionModel*
games_collections_page_get_collection_model (GamesCollectionsPage* self)
{
	GamesCollectionModel* result;
	GamesCollectionsMainPage* _tmp0_;
	GamesCollectionModel* _tmp1_;
	GamesCollectionModel* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->collections_main_page;
	_tmp1_ = games_collections_main_page_get_collection_model (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
games_collections_page_set_collection_model (GamesCollectionsPage* self,
                                             GamesCollectionModel* value)
{
	GamesCollectionsMainPage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->collections_main_page;
	games_collections_main_page_set_collection_model (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_COLLECTION_MODEL_PROPERTY]);
}

GamesCollection*
games_collections_page_get_current_collection (GamesCollectionsPage* self)
{
	GamesCollection* result;
	GamesCollection* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_current_collection;
	result = _tmp0_;
	return result;
}

void
games_collections_page_set_current_collection (GamesCollectionsPage* self,
                                               GamesCollection* value)
{
	GamesCollection* _tmp0_;
	gboolean _tmp1_ = FALSE;
	GamesCollection* _tmp2_;
	GamesCollection* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_current_collection);
	self->priv->_current_collection = _tmp0_;
	_tmp2_ = games_collections_page_get_current_collection (self);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != NULL) {
		GamesCollection* _tmp4_;
		GamesCollection* _tmp5_;
		_tmp4_ = games_collections_page_get_current_collection (self);
		_tmp5_ = _tmp4_;
		_tmp1_ = games_collection_get_collection_type (_tmp5_) == GAMES_COLLECTION_TYPE_USER;
	} else {
		_tmp1_ = FALSE;
	}
	games_collections_page_set_is_showing_user_collection (self, _tmp1_);
	g_object_notify_by_pspec ((GObject *) self, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_CURRENT_COLLECTION_PROPERTY]);
}

GamesApplicationWindow*
games_collections_page_get_application_window (GamesCollectionsPage* self)
{
	GamesApplicationWindow* result;
	GamesApplicationWindow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_application_window;
	result = _tmp0_;
	return result;
}

void
games_collections_page_set_application_window (GamesCollectionsPage* self,
                                               GamesApplicationWindow* value)
{
	GamesApplicationWindow* old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collections_page_get_application_window (self);
	if (old_value != value) {
		GamesApplicationWindow* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_application_window);
		self->priv->_application_window = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_APPLICATION_WINDOW_PROPERTY]);
	}
}

gboolean
games_collections_page_get_is_search_mode (GamesCollectionsPage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_search_mode;
	return result;
}

void
games_collections_page_set_is_search_mode (GamesCollectionsPage* self,
                                           gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collections_page_get_is_search_mode (self);
	if (old_value != value) {
		self->priv->_is_search_mode = value;
		g_object_notify_by_pspec ((GObject *) self, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_IS_SEARCH_MODE_PROPERTY]);
	}
}

gboolean
games_collections_page_get_is_subpage_open (GamesCollectionsPage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_subpage_open;
	return result;
}

void
games_collections_page_set_is_subpage_open (GamesCollectionsPage* self,
                                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collections_page_get_is_subpage_open (self);
	if (old_value != value) {
		self->priv->_is_subpage_open = value;
		g_object_notify_by_pspec ((GObject *) self, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_IS_SUBPAGE_OPEN_PROPERTY]);
	}
}

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

void
games_collections_page_set_is_selection_mode (GamesCollectionsPage* self,
                                              gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collections_page_get_is_selection_mode (self);
	if (old_value != value) {
		self->priv->_is_selection_mode = value;
		g_object_notify_by_pspec ((GObject *) self, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_IS_SELECTION_MODE_PROPERTY]);
	}
}

gboolean
games_collections_page_get_is_showing_user_collection (GamesCollectionsPage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_showing_user_collection;
	return result;
}

void
games_collections_page_set_is_showing_user_collection (GamesCollectionsPage* self,
                                                       gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collections_page_get_is_showing_user_collection (self);
	if (old_value != value) {
		self->priv->_is_showing_user_collection = value;
		g_object_notify_by_pspec ((GObject *) self, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_IS_SHOWING_USER_COLLECTION_PROPERTY]);
	}
}

gboolean
games_collections_page_get_is_search_empty (GamesCollectionsPage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_search_empty;
	return result;
}

void
games_collections_page_set_is_search_empty (GamesCollectionsPage* self,
                                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collections_page_get_is_search_empty (self);
	if (old_value != value) {
		self->priv->_is_search_empty = value;
		g_object_notify_by_pspec ((GObject *) self, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_IS_SEARCH_EMPTY_PROPERTY]);
	}
}

gboolean
games_collections_page_get_can_swipe_back (GamesCollectionsPage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_can_swipe_back;
	return result;
}

void
games_collections_page_set_can_swipe_back (GamesCollectionsPage* self,
                                           gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collections_page_get_can_swipe_back (self);
	if (old_value != value) {
		self->priv->_can_swipe_back = value;
		g_object_notify_by_pspec ((GObject *) self, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_CAN_SWIPE_BACK_PROPERTY]);
	}
}

const gchar*
games_collections_page_get_collection_title (GamesCollectionsPage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_collection_title;
	result = _tmp0_;
	return result;
}

void
games_collections_page_set_collection_title (GamesCollectionsPage* self,
                                             const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collections_page_get_collection_title (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_collection_title);
		self->priv->_collection_title = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_COLLECTION_TITLE_PROPERTY]);
	}
}

const gchar*
games_collections_page_get_removed_notification_title (GamesCollectionsPage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_removed_notification_title;
	result = _tmp0_;
	return result;
}

void
games_collections_page_set_removed_notification_title (GamesCollectionsPage* self,
                                                       const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collections_page_get_removed_notification_title (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_removed_notification_title);
		self->priv->_removed_notification_title = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_REMOVED_NOTIFICATION_TITLE_PROPERTY]);
	}
}

static void
_games_collections_page___lambda46_ (GamesCollectionsPage* self)
{
	GamesGamesPage* _tmp0_;
	_tmp0_ = self->priv->collections_subpage;
	games_games_page_select_default_game (_tmp0_, GTK_DIR_RIGHT);
}

static void
__games_collections_page___lambda46__games_collections_main_page_gamepad_accepted (GamesCollectionsMainPage* _sender,
                                                                                   gpointer self)
{
	_games_collections_page___lambda46_ ((GamesCollectionsPage*) self);
}

static void
_games_collections_page___lambda47_ (GamesCollectionsPage* self)
{
	g_signal_emit (self, games_collections_page_signals[GAMES_COLLECTIONS_PAGE_SELECTED_ITEMS_CHANGED_SIGNAL], 0);
}

static void
__games_collections_page___lambda47__games_games_page_selected_items_changed (GamesGamesPage* _sender,
                                                                              gpointer self)
{
	_games_collections_page___lambda47_ ((GamesCollectionsPage*) self);
}

static void
_games_collections_page___lambda48_ (GamesCollectionsPage* self)
{
	g_signal_emit (self, games_collections_page_signals[GAMES_COLLECTIONS_PAGE_SELECTED_ITEMS_CHANGED_SIGNAL], 0);
}

static void
__games_collections_page___lambda48__games_collections_main_page_selected_items_changed (GamesCollectionsMainPage* _sender,
                                                                                         gpointer self)
{
	_games_collections_page___lambda48_ ((GamesCollectionsPage*) self);
}

static GObject *
games_collections_page_constructor (GType type,
                                    guint n_construct_properties,
                                    GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GamesCollectionsPage * self;
	GamesApplication* _tmp0_;
	GamesApplication* _tmp1_;
	GamesCollectionManager* _tmp2_;
	GamesCollectionsMainPage* _tmp3_;
	GamesGamesPage* _tmp4_;
	GamesCollectionsMainPage* _tmp5_;
	parent_class = G_OBJECT_CLASS (games_collections_page_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_COLLECTIONS_PAGE, GamesCollectionsPage);
	_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->collections_main_page;
	g_signal_connect_object (_tmp3_, "gamepad-accepted", (GCallback) __games_collections_page___lambda46__games_collections_main_page_gamepad_accepted, self, 0);
	_tmp4_ = self->priv->collections_subpage;
	g_signal_connect_object (_tmp4_, "selected-items-changed", (GCallback) __games_collections_page___lambda47__games_games_page_selected_items_changed, self, 0);
	_tmp5_ = self->priv->collections_main_page;
	g_signal_connect_object (_tmp5_, "selected-items-changed", (GCallback) __games_collections_page___lambda48__games_collections_main_page_selected_items_changed, self, 0);
	games_collections_page_update_can_swipe_back (self);
	return obj;
}

static void
games_collections_page_class_init (GamesCollectionsPageClass * klass,
                                   gpointer klass_data)
{
	games_collections_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GamesCollectionsPage_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_games_collections_page_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_games_collections_page_set_property;
	G_OBJECT_CLASS (klass)->constructor = games_collections_page_constructor;
	G_OBJECT_CLASS (klass)->finalize = games_collections_page_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTIONS_PAGE_IS_COLLECTION_EMPTY_PROPERTY, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_IS_COLLECTION_EMPTY_PROPERTY] = g_param_spec_boolean ("is-collection-empty", "is-collection-empty", "is-collection-empty", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTIONS_PAGE_COLLECTION_MODEL_PROPERTY, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_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_COLLECTIONS_PAGE_CURRENT_COLLECTION_PROPERTY, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_CURRENT_COLLECTION_PROPERTY] = g_param_spec_object ("current-collection", "current-collection", "current-collection", GAMES_TYPE_COLLECTION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTIONS_PAGE_APPLICATION_WINDOW_PROPERTY, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_APPLICATION_WINDOW_PROPERTY] = g_param_spec_object ("application-window", "application-window", "application-window", GAMES_TYPE_APPLICATION_WINDOW, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTIONS_PAGE_IS_SEARCH_MODE_PROPERTY, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_IS_SEARCH_MODE_PROPERTY] = g_param_spec_boolean ("is-search-mode", "is-search-mode", "is-search-mode", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTIONS_PAGE_IS_SUBPAGE_OPEN_PROPERTY, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_IS_SUBPAGE_OPEN_PROPERTY] = g_param_spec_boolean ("is-subpage-open", "is-subpage-open", "is-subpage-open", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTIONS_PAGE_IS_SELECTION_MODE_PROPERTY, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_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_COLLECTIONS_PAGE_IS_SHOWING_USER_COLLECTION_PROPERTY, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_IS_SHOWING_USER_COLLECTION_PROPERTY] = g_param_spec_boolean ("is-showing-user-collection", "is-showing-user-collection", "is-showing-user-collection", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTIONS_PAGE_IS_SEARCH_EMPTY_PROPERTY, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_IS_SEARCH_EMPTY_PROPERTY] = g_param_spec_boolean ("is-search-empty", "is-search-empty", "is-search-empty", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTIONS_PAGE_CAN_SWIPE_BACK_PROPERTY, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_CAN_SWIPE_BACK_PROPERTY] = g_param_spec_boolean ("can-swipe-back", "can-swipe-back", "can-swipe-back", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTIONS_PAGE_COLLECTION_TITLE_PROPERTY, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_COLLECTION_TITLE_PROPERTY] = g_param_spec_string ("collection-title", "collection-title", "collection-title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTIONS_PAGE_REMOVED_NOTIFICATION_TITLE_PROPERTY, games_collections_page_properties[GAMES_COLLECTIONS_PAGE_REMOVED_NOTIFICATION_TITLE_PROPERTY] = g_param_spec_string ("removed-notification-title", "removed-notification-title", "removed-notification-title", NULL, 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/collections-page.ui");
	games_collections_page_signals[GAMES_COLLECTIONS_PAGE_GAME_ACTIVATED_SIGNAL] = g_signal_new ("game-activated", GAMES_TYPE_COLLECTIONS_PAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GAMES_TYPE_GAME);
	games_collections_page_signals[GAMES_COLLECTIONS_PAGE_SELECTED_ITEMS_CHANGED_SIGNAL] = g_signal_new ("selected-items-changed", GAMES_TYPE_COLLECTIONS_PAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "collections_deck", FALSE, GamesCollectionsPage_private_offset + G_STRUCT_OFFSET (GamesCollectionsPagePrivate, collections_deck));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "collections_main_page", FALSE, GamesCollectionsPage_private_offset + G_STRUCT_OFFSET (GamesCollectionsPagePrivate, collections_main_page));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "collections_subpage_stack", FALSE, GamesCollectionsPage_private_offset + G_STRUCT_OFFSET (GamesCollectionsPagePrivate, collections_subpage_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "collections_subpage", FALSE, GamesCollectionsPage_private_offset + G_STRUCT_OFFSET (GamesCollectionsPagePrivate, collections_subpage));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "collection_empty_subpage", FALSE, GamesCollectionsPage_private_offset + G_STRUCT_OFFSET (GamesCollectionsPagePrivate, collection_empty_subpage));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_subpage_back_clicked", G_CALLBACK(_games_collections_page_on_subpage_back_clicked_games_games_page_gamepad_cancel_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_collection_activated", G_CALLBACK(_games_collections_page_on_collection_activated_games_collections_main_page_collection_activated));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_game_activated", G_CALLBACK(_games_collections_page_on_game_activated_games_games_page_game_activated));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_visible_child_changed", G_CALLBACK(_games_collections_page_on_visible_child_changed_g_object_notify));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "update_can_swipe_back", G_CALLBACK(_games_collections_page_update_can_swipe_back_g_object_notify));
}

static void
games_collections_page_instance_init (GamesCollectionsPage * self,
                                      gpointer klass)
{
	self->priv = games_collections_page_get_instance_private (self);
	g_type_ensure (GAMES_TYPE_COLLECTIONS_MAIN_PAGE);
	g_type_ensure (GAMES_TYPE_GAMES_PAGE);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
games_collections_page_finalize (GObject * obj)
{
	GamesCollectionsPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_COLLECTIONS_PAGE, GamesCollectionsPage);
	self->priv->last_removed_collections = (_vala_array_free (self->priv->last_removed_collections, self->priv->last_removed_collections_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (self->priv->collection_manager);
	_g_object_unref0 (self->priv->_current_collection);
	_g_object_unref0 (self->priv->_application_window);
	_g_free0 (self->priv->_collection_title);
	_g_free0 (self->priv->_removed_notification_title);
	G_OBJECT_CLASS (games_collections_page_parent_class)->finalize (obj);
}

static GType
games_collections_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GamesCollectionsPageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_collections_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesCollectionsPage), 0, (GInstanceInitFunc) games_collections_page_instance_init, NULL };
	GType games_collections_page_type_id;
	games_collections_page_type_id = g_type_register_static (gtk_bin_get_type (), "GamesCollectionsPage", &g_define_type_info, 0);
	GamesCollectionsPage_private_offset = g_type_add_instance_private (games_collections_page_type_id, sizeof (GamesCollectionsPagePrivate));
	return games_collections_page_type_id;
}

GType
games_collections_page_get_type (void)
{
	static volatile gsize games_collections_page_type_id__once = 0;
	if (g_once_init_enter (&games_collections_page_type_id__once)) {
		GType games_collections_page_type_id;
		games_collections_page_type_id = games_collections_page_get_type_once ();
		g_once_init_leave (&games_collections_page_type_id__once, games_collections_page_type_id);
	}
	return games_collections_page_type_id__once;
}

static void
_vala_games_collections_page_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec)
{
	GamesCollectionsPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_COLLECTIONS_PAGE, GamesCollectionsPage);
	switch (property_id) {
		case GAMES_COLLECTIONS_PAGE_IS_COLLECTION_EMPTY_PROPERTY:
		g_value_set_boolean (value, games_collections_page_get_is_collection_empty (self));
		break;
		case GAMES_COLLECTIONS_PAGE_COLLECTION_MODEL_PROPERTY:
		g_value_set_object (value, games_collections_page_get_collection_model (self));
		break;
		case GAMES_COLLECTIONS_PAGE_CURRENT_COLLECTION_PROPERTY:
		g_value_set_object (value, games_collections_page_get_current_collection (self));
		break;
		case GAMES_COLLECTIONS_PAGE_APPLICATION_WINDOW_PROPERTY:
		g_value_set_object (value, games_collections_page_get_application_window (self));
		break;
		case GAMES_COLLECTIONS_PAGE_IS_SEARCH_MODE_PROPERTY:
		g_value_set_boolean (value, games_collections_page_get_is_search_mode (self));
		break;
		case GAMES_COLLECTIONS_PAGE_IS_SUBPAGE_OPEN_PROPERTY:
		g_value_set_boolean (value, games_collections_page_get_is_subpage_open (self));
		break;
		case GAMES_COLLECTIONS_PAGE_IS_SELECTION_MODE_PROPERTY:
		g_value_set_boolean (value, games_collections_page_get_is_selection_mode (self));
		break;
		case GAMES_COLLECTIONS_PAGE_IS_SHOWING_USER_COLLECTION_PROPERTY:
		g_value_set_boolean (value, games_collections_page_get_is_showing_user_collection (self));
		break;
		case GAMES_COLLECTIONS_PAGE_IS_SEARCH_EMPTY_PROPERTY:
		g_value_set_boolean (value, games_collections_page_get_is_search_empty (self));
		break;
		case GAMES_COLLECTIONS_PAGE_CAN_SWIPE_BACK_PROPERTY:
		g_value_set_boolean (value, games_collections_page_get_can_swipe_back (self));
		break;
		case GAMES_COLLECTIONS_PAGE_COLLECTION_TITLE_PROPERTY:
		g_value_set_string (value, games_collections_page_get_collection_title (self));
		break;
		case GAMES_COLLECTIONS_PAGE_REMOVED_NOTIFICATION_TITLE_PROPERTY:
		g_value_set_string (value, games_collections_page_get_removed_notification_title (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_games_collections_page_set_property (GObject * object,
                                           guint property_id,
                                           const GValue * value,
                                           GParamSpec * pspec)
{
	GamesCollectionsPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_COLLECTIONS_PAGE, GamesCollectionsPage);
	switch (property_id) {
		case GAMES_COLLECTIONS_PAGE_IS_COLLECTION_EMPTY_PROPERTY:
		games_collections_page_set_is_collection_empty (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTIONS_PAGE_COLLECTION_MODEL_PROPERTY:
		games_collections_page_set_collection_model (self, g_value_get_object (value));
		break;
		case GAMES_COLLECTIONS_PAGE_CURRENT_COLLECTION_PROPERTY:
		games_collections_page_set_current_collection (self, g_value_get_object (value));
		break;
		case GAMES_COLLECTIONS_PAGE_APPLICATION_WINDOW_PROPERTY:
		games_collections_page_set_application_window (self, g_value_get_object (value));
		break;
		case GAMES_COLLECTIONS_PAGE_IS_SEARCH_MODE_PROPERTY:
		games_collections_page_set_is_search_mode (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTIONS_PAGE_IS_SUBPAGE_OPEN_PROPERTY:
		games_collections_page_set_is_subpage_open (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTIONS_PAGE_IS_SELECTION_MODE_PROPERTY:
		games_collections_page_set_is_selection_mode (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTIONS_PAGE_IS_SHOWING_USER_COLLECTION_PROPERTY:
		games_collections_page_set_is_showing_user_collection (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTIONS_PAGE_IS_SEARCH_EMPTY_PROPERTY:
		games_collections_page_set_is_search_empty (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTIONS_PAGE_CAN_SWIPE_BACK_PROPERTY:
		games_collections_page_set_can_swipe_back (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTIONS_PAGE_COLLECTION_TITLE_PROPERTY:
		games_collections_page_set_collection_title (self, g_value_get_string (value));
		break;
		case GAMES_COLLECTIONS_PAGE_REMOVED_NOTIFICATION_TITLE_PROPERTY:
		games_collections_page_set_removed_notification_title (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

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

