/* games-box.c generated by valac 0.56.19, the Vala compiler
 * generated from games-box.vala, do not modify */

#include "protonplus_core.h"
#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <gio/gio.h>
#include <adwaita.h>
#include <glib/gi18n-lib.h>
#include <float.h>
#include <math.h>
#include <pango/pango.h>
#include <gdk/gdk.h>

#define PROTON_PLUS_WIDGETS_GAMES_GAME_LIST_CONTROLLER_BOX_SORT_HEADER_BIND_MAX_ATTEMPTS 8
#define PROTON_PLUS_WIDGETS_GAMES_BOX_NARROW_VIEW_WIDTH 700
#define PROTON_PLUS_WIDGETS_GAMES_BOX_FOCUS_BIND_MAX_ATTEMPTS 8
#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 PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SORT_HEADER_TARGET (proton_plus_widgets_games_game_sort_header_target_get_type ())
#define PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_TARGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SORT_HEADER_TARGET, ProtonPlusWidgetsGamesGameSortHeaderTarget))
#define PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_TARGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SORT_HEADER_TARGET, ProtonPlusWidgetsGamesGameSortHeaderTargetClass))
#define PROTON_PLUS_WIDGETS_GAMES_IS_GAME_SORT_HEADER_TARGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SORT_HEADER_TARGET))
#define PROTON_PLUS_WIDGETS_GAMES_IS_GAME_SORT_HEADER_TARGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SORT_HEADER_TARGET))
#define PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_TARGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SORT_HEADER_TARGET, ProtonPlusWidgetsGamesGameSortHeaderTargetClass))

typedef struct _ProtonPlusWidgetsGamesGameSortHeaderTarget ProtonPlusWidgetsGamesGameSortHeaderTarget;
typedef struct _ProtonPlusWidgetsGamesGameSortHeaderTargetClass ProtonPlusWidgetsGamesGameSortHeaderTargetClass;
typedef struct _ProtonPlusWidgetsGamesGameSortHeaderTargetPrivate ProtonPlusWidgetsGamesGameSortHeaderTargetPrivate;
enum  {
	PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_TARGET_0_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_TARGET_HEADER_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_TARGET_ACTIVATION_TARGET_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_TARGET_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_games_game_sort_header_target_properties[PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_TARGET_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SORT_HEADER_MAP_TARGET (proton_plus_widgets_games_game_sort_header_map_target_get_type ())
#define PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_MAP_TARGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SORT_HEADER_MAP_TARGET, ProtonPlusWidgetsGamesGameSortHeaderMapTarget))
#define PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_MAP_TARGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SORT_HEADER_MAP_TARGET, ProtonPlusWidgetsGamesGameSortHeaderMapTargetClass))
#define PROTON_PLUS_WIDGETS_GAMES_IS_GAME_SORT_HEADER_MAP_TARGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SORT_HEADER_MAP_TARGET))
#define PROTON_PLUS_WIDGETS_GAMES_IS_GAME_SORT_HEADER_MAP_TARGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SORT_HEADER_MAP_TARGET))
#define PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_MAP_TARGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SORT_HEADER_MAP_TARGET, ProtonPlusWidgetsGamesGameSortHeaderMapTargetClass))

typedef struct _ProtonPlusWidgetsGamesGameSortHeaderMapTarget ProtonPlusWidgetsGamesGameSortHeaderMapTarget;
typedef struct _ProtonPlusWidgetsGamesGameSortHeaderMapTargetClass ProtonPlusWidgetsGamesGameSortHeaderMapTargetClass;
typedef struct _ProtonPlusWidgetsGamesGameSortHeaderMapTargetPrivate ProtonPlusWidgetsGamesGameSortHeaderMapTargetPrivate;

#define PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_CONTROLLER_BOX (proton_plus_widgets_games_game_list_controller_box_get_type ())
#define PROTON_PLUS_WIDGETS_GAMES_GAME_LIST_CONTROLLER_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_CONTROLLER_BOX, ProtonPlusWidgetsGamesGameListControllerBox))
#define PROTON_PLUS_WIDGETS_GAMES_GAME_LIST_CONTROLLER_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_CONTROLLER_BOX, ProtonPlusWidgetsGamesGameListControllerBoxClass))
#define PROTON_PLUS_WIDGETS_GAMES_IS_GAME_LIST_CONTROLLER_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_CONTROLLER_BOX))
#define PROTON_PLUS_WIDGETS_GAMES_IS_GAME_LIST_CONTROLLER_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_CONTROLLER_BOX))
#define PROTON_PLUS_WIDGETS_GAMES_GAME_LIST_CONTROLLER_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_CONTROLLER_BOX, ProtonPlusWidgetsGamesGameListControllerBoxClass))

typedef struct _ProtonPlusWidgetsGamesGameListControllerBox ProtonPlusWidgetsGamesGameListControllerBox;
typedef struct _ProtonPlusWidgetsGamesGameListControllerBoxClass ProtonPlusWidgetsGamesGameListControllerBoxClass;
enum  {
	PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_MAP_TARGET_0_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_MAP_TARGET_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_games_game_sort_header_map_target_properties[PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_MAP_TARGET_NUM_PROPERTIES];
typedef struct _ProtonPlusWidgetsGamesGameListControllerBoxPrivate ProtonPlusWidgetsGamesGameListControllerBoxPrivate;
enum  {
	PROTON_PLUS_WIDGETS_GAMES_GAME_LIST_CONTROLLER_BOX_0_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_GAME_LIST_CONTROLLER_BOX_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_games_game_list_controller_box_properties[PROTON_PLUS_WIDGETS_GAMES_GAME_LIST_CONTROLLER_BOX_NUM_PROPERTIES];
typedef struct _Block38Data Block38Data;
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	PROTON_PLUS_WIDGETS_GAMES_BOX_0_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_BOX_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_games_box_properties[PROTON_PLUS_WIDGETS_GAMES_BOX_NUM_PROPERTIES];
#define _gtk_expression_unref0(var) ((var == NULL) ? NULL : (var = (gtk_expression_unref (var), NULL)))
typedef struct _Block39Data Block39Data;
typedef struct _Block40Data Block40Data;
typedef struct _Block41Data Block41Data;
enum  {
	PROTON_PLUS_WIDGETS_GAMES_BOX_HEADER_PRESENTATION_CHANGED_SIGNAL,
	PROTON_PLUS_WIDGETS_GAMES_BOX_NUM_SIGNALS
};
static guint proton_plus_widgets_games_box_signals[PROTON_PLUS_WIDGETS_GAMES_BOX_NUM_SIGNALS] = {0};

struct _ProtonPlusWidgetsGamesGameSortHeaderTarget {
	GObject parent_instance;
	ProtonPlusWidgetsGamesGameSortHeaderTargetPrivate * priv;
};

struct _ProtonPlusWidgetsGamesGameSortHeaderTargetClass {
	GObjectClass parent_class;
};

struct _ProtonPlusWidgetsGamesGameSortHeaderTargetPrivate {
	GtkColumnView* view;
	GtkColumnViewColumn* column;
	GtkWidget* _header;
	GtkButton* _activation_target;
	gulong activation_handler;
};

struct _ProtonPlusWidgetsGamesGameSortHeaderMapTarget {
	GObject parent_instance;
	ProtonPlusWidgetsGamesGameSortHeaderMapTargetPrivate * priv;
};

struct _ProtonPlusWidgetsGamesGameSortHeaderMapTargetClass {
	GObjectClass parent_class;
};

struct _ProtonPlusWidgetsGamesGameSortHeaderMapTargetPrivate {
	ProtonPlusWidgetsGamesGameListControllerBox* owner;
};

struct _ProtonPlusWidgetsGamesGameListControllerBox {
	GtkBox parent_instance;
	ProtonPlusWidgetsGamesGameListControllerBoxPrivate * priv;
};

struct _ProtonPlusWidgetsGamesGameListControllerBoxClass {
	GtkBoxClass parent_class;
};

struct _ProtonPlusWidgetsGamesGameListControllerBoxPrivate {
	GtkWidget* toolbar;
	GtkColumnView* wide_view;
	GtkWidget* narrow_view;
	ProtonPlusWidgetsGamesGameBoundaryFocusRequest toolbar_focus;
	gpointer toolbar_focus_target;
	ProtonPlusWidgetsGamesGameBoundaryFocusRequest first_game_focus;
	gpointer first_game_focus_target;
	ProtonPlusWidgetsGamesGameBoundaryFocusRequest first_game_title_focus;
	gpointer first_game_title_focus_target;
	GeeArrayList* sort_headers;
	ProtonPlusWidgetsGamesGameSortHeaderMapTarget* sort_header_map_target;
	gulong sort_header_map_handler;
	guint sort_header_idle_id;
	gint sort_header_attempt;
	gint active_sort_header_index;
};

struct _Block38Data {
	int _ref_count_;
	ProtonPlusWidgetsGamesGameListControllerBox* self;
	ProtonPlusWidgetsGamesGameListControllerBox* weak_self;
};

struct _ProtonPlusWidgetsGamesBoxPrivate {
	gboolean _error;
	gboolean _invalid;
	gboolean narrow_view_active;
	ProtonPlusModelsLauncher* launcher;
	GtkImage* image;
	AdwStatusPage* status_page;
	ProtonPlusWidgetsGamesMassEditButton* mass_edit_button;
	GtkSearchEntry* search_entry;
	GtkCheckButton* check_button;
	GtkBox* toolbar;
	GtkBox* games_card;
	AdwNavigationView* navigation_view;
	AdwNavigationPage* list_page;
	AdwNavigationPage* mass_edit_page;
	GtkStack* list_stack;
	GtkStack* views_stack;
	AdwStatusPage* empty_status_page;
	GtkButton* empty_action_button;
	GtkColumnView* wide_view;
	ProtonPlusWidgetsGamesGameListControllerBox* games_controller_box;
	GtkColumnViewColumn* actions_column;
	GtkListView* narrow_view;
	GtkMenuButton* filter_button;
	GtkCheckButton* all_filter_check;
	GtkCheckButton* non_steam_filter_check;
	GtkCheckButton* native_filter_check;
	AdwSpinner* spinner;
	GtkOverlay* overlay;
	ProtonPlusWidgetsGamesMassEditView* mass_edit_view;
	ProtonPlusWidgetsGamesGameCollection* games;
	GListStore* compatibility_tool_model;
	GtkPropertyExpression* expression;
	GtkMenuButton* selection_button;
	GtkListBox* selection_list_box;
	GtkPopover* selection_popover;
	GtkLabel* selection_popover_title;
	GeeHashMap* narrow_rows;
	GeeHashMap* wide_selection_cells;
	GeeHashMap* wide_title_cells;
	GeeHashMap* wide_action_cells;
	ProtonPlusWidgetsGamesGameListItem* last_focused_item;
	gchar* search_query;
	guint search_timeout_id;
	guint focus_idle_id;
	gboolean updating_selection_toggle;
	gboolean mass_edit_cleanup_pending;
	gboolean selection_mode_active;
};

struct _Block39Data {
	int _ref_count_;
	ProtonPlusWidgetsGamesBox* self;
	ProtonPlusWidgetsGamesGameTextCellKind kind;
};

struct _Block40Data {
	int _ref_count_;
	ProtonPlusWidgetsGamesBox* self;
	GtkPopover* filter_popover;
};

struct _Block41Data {
	int _ref_count_;
	ProtonPlusWidgetsGamesBox* self;
	guint position;
	ProtonPlusWidgetsGamesGameFocusLane lane;
	guint64 expected_generation;
	ProtonPlusWidgetsGamesGameListItem* expected_item;
	gboolean expected_narrow;
	gint attempt;
};

static gint ProtonPlusWidgetsGamesGameSortHeaderTarget_private_offset;
static gpointer proton_plus_widgets_games_game_sort_header_target_parent_class = NULL;
static gint ProtonPlusWidgetsGamesGameSortHeaderMapTarget_private_offset;
static gpointer proton_plus_widgets_games_game_sort_header_map_target_parent_class = NULL;
static gint ProtonPlusWidgetsGamesGameListControllerBox_private_offset;
static gpointer proton_plus_widgets_games_game_list_controller_box_parent_class = NULL;
static ProtonPlusUtilsControllerDirectionalFocusIface * proton_plus_widgets_games_game_list_controller_box_proton_plus_utils_controller_directional_focus_parent_iface = NULL;
static ProtonPlusUtilsControllerActivationRedirectIface * proton_plus_widgets_games_game_list_controller_box_proton_plus_utils_controller_activation_redirect_parent_iface = NULL;
static gint ProtonPlusWidgetsGamesBox_private_offset;
static gpointer proton_plus_widgets_games_box_parent_class = NULL;
static ProtonPlusUtilsControllerNavigationHostIface * proton_plus_widgets_games_box_proton_plus_utils_controller_navigation_host_parent_iface = NULL;
static ProtonPlusUtilsControllerPageShortcutsIface * proton_plus_widgets_games_box_proton_plus_utils_controller_page_shortcuts_parent_iface = NULL;

VALA_EXTERN GType proton_plus_widgets_games_game_sort_header_target_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusWidgetsGamesGameSortHeaderTarget* proton_plus_widgets_games_game_sort_header_target_new (GtkColumnView* view,
                                                                                                   GtkColumnViewColumn* column,
                                                                                                   GtkWidget* header);
VALA_EXTERN ProtonPlusWidgetsGamesGameSortHeaderTarget* proton_plus_widgets_games_game_sort_header_target_construct (GType object_type,
                                                                                                         GtkColumnView* view,
                                                                                                         GtkColumnViewColumn* column,
                                                                                                         GtkWidget* header);
static void proton_plus_widgets_games_game_sort_header_target_set_header (ProtonPlusWidgetsGamesGameSortHeaderTarget* self,
                                                                   GtkWidget* value);
static void proton_plus_widgets_games_game_sort_header_target_set_activation_target (ProtonPlusWidgetsGamesGameSortHeaderTarget* self,
                                                                              GtkButton* value);
VALA_EXTERN GtkButton* proton_plus_widgets_games_game_sort_header_target_get_activation_target (ProtonPlusWidgetsGamesGameSortHeaderTarget* self);
static void proton_plus_widgets_games_game_sort_header_target_activate_sort (ProtonPlusWidgetsGamesGameSortHeaderTarget* self);
static void _proton_plus_widgets_games_game_sort_header_target_activate_sort_gtk_button_activate (GtkButton* _sender,
                                                                                           gpointer self);
VALA_EXTERN void proton_plus_widgets_games_game_sort_header_target_set_controller_focus (ProtonPlusWidgetsGamesGameSortHeaderTarget* self,
                                                                             gboolean focused);
VALA_EXTERN GtkWidget* proton_plus_widgets_games_game_sort_header_target_get_header (ProtonPlusWidgetsGamesGameSortHeaderTarget* self);
VALA_EXTERN gchar* proton_plus_widgets_games_game_sort_header_target_get_title (ProtonPlusWidgetsGamesGameSortHeaderTarget* self);
VALA_EXTERN void proton_plus_widgets_games_game_sort_header_target_detach (ProtonPlusWidgetsGamesGameSortHeaderTarget* self);
static void proton_plus_widgets_games_game_sort_header_target_finalize (GObject * obj);
static GType proton_plus_widgets_games_game_sort_header_target_get_type_once (void);
static void _vala_proton_plus_widgets_games_game_sort_header_target_get_property (GObject * object,
                                                                           guint property_id,
                                                                           GValue * value,
                                                                           GParamSpec * pspec);
static void _vala_proton_plus_widgets_games_game_sort_header_target_set_property (GObject * object,
                                                                           guint property_id,
                                                                           const GValue * value,
                                                                           GParamSpec * pspec);
VALA_EXTERN GType proton_plus_widgets_games_game_sort_header_map_target_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType proton_plus_widgets_games_game_list_controller_box_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusWidgetsGamesGameSortHeaderMapTarget* proton_plus_widgets_games_game_sort_header_map_target_new (ProtonPlusWidgetsGamesGameListControllerBox* owner);
VALA_EXTERN ProtonPlusWidgetsGamesGameSortHeaderMapTarget* proton_plus_widgets_games_game_sort_header_map_target_construct (GType object_type,
                                                                                                                ProtonPlusWidgetsGamesGameListControllerBox* owner);
VALA_EXTERN void proton_plus_widgets_games_game_sort_header_map_target_mapped (ProtonPlusWidgetsGamesGameSortHeaderMapTarget* self);
VALA_EXTERN void proton_plus_widgets_games_game_list_controller_box_begin_sort_header_configuration (ProtonPlusWidgetsGamesGameListControllerBox* self);
static void proton_plus_widgets_games_game_sort_header_map_target_finalize (GObject * obj);
static GType proton_plus_widgets_games_game_sort_header_map_target_get_type_once (void);
VALA_EXTERN ProtonPlusWidgetsGamesGameListControllerBox* proton_plus_widgets_games_game_list_controller_box_new (GtkWidget* toolbar,
                                                                                                     GtkColumnView* wide_view,
                                                                                                     GtkWidget* narrow_view,
                                                                                                     ProtonPlusWidgetsGamesGameBoundaryFocusRequest toolbar_focus,
                                                                                                     gpointer toolbar_focus_target,
                                                                                                     ProtonPlusWidgetsGamesGameBoundaryFocusRequest first_game_focus,
                                                                                                     gpointer first_game_focus_target,
                                                                                                     ProtonPlusWidgetsGamesGameBoundaryFocusRequest first_game_title_focus,
                                                                                                     gpointer first_game_title_focus_target);
VALA_EXTERN ProtonPlusWidgetsGamesGameListControllerBox* proton_plus_widgets_games_game_list_controller_box_construct (GType object_type,
                                                                                                           GtkWidget* toolbar,
                                                                                                           GtkColumnView* wide_view,
                                                                                                           GtkWidget* narrow_view,
                                                                                                           ProtonPlusWidgetsGamesGameBoundaryFocusRequest toolbar_focus,
                                                                                                           gpointer toolbar_focus_target,
                                                                                                           ProtonPlusWidgetsGamesGameBoundaryFocusRequest first_game_focus,
                                                                                                           gpointer first_game_focus_target,
                                                                                                           ProtonPlusWidgetsGamesGameBoundaryFocusRequest first_game_title_focus,
                                                                                                           gpointer first_game_title_focus_target);
static void _proton_plus_widgets_games_game_sort_header_map_target_mapped_gtk_widget_map (GtkWidget* _sender,
                                                                                   gpointer self);
static void __lambda108_ (ProtonPlusWidgetsGamesGameListControllerBox* self);
static void proton_plus_widgets_games_game_list_controller_box_clear_sort_header_focus (ProtonPlusWidgetsGamesGameListControllerBox* self);
static void ___lambda108__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static gboolean proton_plus_widgets_games_game_list_controller_box_real_controller_focus_direction (ProtonPlusUtilsControllerDirectionalFocus* base,
                                                                                             GObject* focused_object,
                                                                                             ProtonPlusUtilsControllerNavigationDirection direction);
static gboolean proton_plus_widgets_games_game_list_controller_box_focus_sort_header (ProtonPlusWidgetsGamesGameListControllerBox* self,
                                                                               gint index);
static gboolean proton_plus_widgets_games_game_list_controller_box_is_inside_widget (ProtonPlusWidgetsGamesGameListControllerBox* self,
                                                                              GtkWidget* focused,
                                                                              GtkWidget* ancestor);
VALA_EXTERN gboolean proton_plus_widgets_games_game_list_controller_box_focus_first_sort_header (ProtonPlusWidgetsGamesGameListControllerBox* self);
static GObject* proton_plus_widgets_games_game_list_controller_box_real_get_controller_activation_target (ProtonPlusUtilsControllerActivationRedirect* base,
                                                                                                   GObject* focused_object);
static void proton_plus_widgets_games_game_list_controller_box_configure_sort_headers (ProtonPlusWidgetsGamesGameListControllerBox* self);
static void proton_plus_widgets_games_game_list_controller_box_collect_column_headers (ProtonPlusWidgetsGamesGameListControllerBox* self,
                                                                                GtkWidget* parent,
                                                                                GeeArrayList* headers);
static void proton_plus_widgets_games_game_list_controller_box_schedule_sort_header_configuration (ProtonPlusWidgetsGamesGameListControllerBox* self);
static Block38Data* block38_data_ref (Block38Data* _data38_);
static void block38_data_unref (void * _userdata_);
static gboolean __lambda107_ (Block38Data* _data38_);
static gboolean ___lambda107__gsource_func (gpointer self);
static void proton_plus_widgets_games_game_list_controller_box_real_dispose (GObject* base);
static void proton_plus_widgets_games_game_list_controller_box_finalize (GObject * obj);
static GType proton_plus_widgets_games_game_list_controller_box_get_type_once (void);
static GtkColumnView* proton_plus_widgets_games_box_build_wide_view (ProtonPlusWidgetsGamesBox* self);
static void proton_plus_widgets_games_box_activate_game_row (ProtonPlusWidgetsGamesBox* self,
                                                      guint position);
static void _proton_plus_widgets_games_box_activate_game_row_gtk_column_view_activate (GtkColumnView* _sender,
                                                                                guint position,
                                                                                gpointer self);
static GtkSignalListItemFactory* proton_plus_widgets_games_box_create_selection_factory (ProtonPlusWidgetsGamesBox* self);
static GtkSignalListItemFactory* proton_plus_widgets_games_box_create_title_factory (ProtonPlusWidgetsGamesBox* self);
static GtkSignalListItemFactory* proton_plus_widgets_games_box_create_text_factory (ProtonPlusWidgetsGamesBox* self,
                                                                             ProtonPlusWidgetsGamesGameTextCellKind kind);
static GtkSignalListItemFactory* proton_plus_widgets_games_box_create_actions_factory (ProtonPlusWidgetsGamesBox* self);
static GtkListView* proton_plus_widgets_games_box_build_narrow_view (ProtonPlusWidgetsGamesBox* self);
static void __lambda216_ (ProtonPlusWidgetsGamesBox* self,
                   GObject* object);
static gboolean proton_plus_widgets_games_box_focus_narrow_relative (ProtonPlusWidgetsGamesBox* self,
                                                              ProtonPlusWidgetsGamesGameListItem* item,
                                                              gint delta,
                                                              ProtonPlusWidgetsGamesGameFocusLane lane);
static gboolean _proton_plus_widgets_games_box_focus_narrow_relative_proton_plus_widgets_games_game_vertical_focus_request (ProtonPlusWidgetsGamesGameListItem* item,
                                                                                                                     gint delta,
                                                                                                                     ProtonPlusWidgetsGamesGameFocusLane lane,
                                                                                                                     gpointer self);
static void proton_plus_widgets_games_box_activate_game_item (ProtonPlusWidgetsGamesBox* self,
                                                       ProtonPlusWidgetsGamesGameListItem* item);
static void _proton_plus_widgets_games_box_activate_game_item_proton_plus_widgets_games_game_activation_request (ProtonPlusWidgetsGamesGameListItem* item,
                                                                                                          gpointer self);
static void ___lambda216__gtk_signal_list_item_factory_setup (GtkSignalListItemFactory* _sender,
                                                       GObject* object,
                                                       gpointer self);
static void __lambda217_ (ProtonPlusWidgetsGamesBox* self,
                   GObject* object);
static void ___lambda217__gtk_signal_list_item_factory_bind (GtkSignalListItemFactory* _sender,
                                                      GObject* object,
                                                      gpointer self);
static void __lambda218_ (ProtonPlusWidgetsGamesBox* self,
                   GObject* object);
static void ___lambda218__gtk_signal_list_item_factory_unbind (GtkSignalListItemFactory* _sender,
                                                        GObject* object,
                                                        gpointer self);
static void __lambda219_ (ProtonPlusWidgetsGamesBox* self,
                   GObject* object);
static void ___lambda219__gtk_signal_list_item_factory_teardown (GtkSignalListItemFactory* _sender,
                                                          GObject* object,
                                                          gpointer self);
static void _proton_plus_widgets_games_box_activate_game_row_gtk_list_view_activate (GtkListView* _sender,
                                                                              guint position,
                                                                              gpointer self);
static GtkScrolledWindow* proton_plus_widgets_games_box_create_collection_scroller (ProtonPlusWidgetsGamesBox* self,
                                                                             GtkWidget* view);
static void __lambda193_ (ProtonPlusWidgetsGamesBox* self,
                   GObject* object);
static gboolean proton_plus_widgets_games_box_focus_wide_relative (ProtonPlusWidgetsGamesBox* self,
                                                            ProtonPlusWidgetsGamesGameListItem* item,
                                                            gint delta,
                                                            ProtonPlusWidgetsGamesGameFocusLane lane);
static gboolean _proton_plus_widgets_games_box_focus_wide_relative_proton_plus_widgets_games_game_vertical_focus_request (ProtonPlusWidgetsGamesGameListItem* item,
                                                                                                                   gint delta,
                                                                                                                   ProtonPlusWidgetsGamesGameFocusLane lane,
                                                                                                                   gpointer self);
static gboolean proton_plus_widgets_games_box_focus_wide_title (ProtonPlusWidgetsGamesBox* self,
                                                         ProtonPlusWidgetsGamesGameListItem* item);
static gboolean _proton_plus_widgets_games_box_focus_wide_title_proton_plus_widgets_games_game_peer_focus_request (ProtonPlusWidgetsGamesGameListItem* item,
                                                                                                            gpointer self);
static void ___lambda193__gtk_signal_list_item_factory_setup (GtkSignalListItemFactory* _sender,
                                                       GObject* object,
                                                       gpointer self);
static void __lambda201_ (ProtonPlusWidgetsGamesBox* self,
                   GObject* object);
static void ___lambda201__gtk_signal_list_item_factory_bind (GtkSignalListItemFactory* _sender,
                                                      GObject* object,
                                                      gpointer self);
static void __lambda202_ (ProtonPlusWidgetsGamesBox* self,
                   GObject* object);
static void ___lambda202__gtk_signal_list_item_factory_unbind (GtkSignalListItemFactory* _sender,
                                                        GObject* object,
                                                        gpointer self);
static void __lambda203_ (ProtonPlusWidgetsGamesBox* self,
                   GObject* object);
static void ___lambda203__gtk_signal_list_item_factory_teardown (GtkSignalListItemFactory* _sender,
                                                          GObject* object,
                                                          gpointer self);
static void __lambda204_ (ProtonPlusWidgetsGamesBox* self,
                   GObject* object);
static gboolean proton_plus_widgets_games_box_focus_wide_selection (ProtonPlusWidgetsGamesBox* self,
                                                             ProtonPlusWidgetsGamesGameListItem* item);
static gboolean _proton_plus_widgets_games_box_focus_wide_selection_proton_plus_widgets_games_game_peer_focus_request (ProtonPlusWidgetsGamesGameListItem* item,
                                                                                                                gpointer self);
static gboolean proton_plus_widgets_games_box_focus_wide_actions (ProtonPlusWidgetsGamesBox* self,
                                                           ProtonPlusWidgetsGamesGameListItem* item);
static gboolean _proton_plus_widgets_games_box_focus_wide_actions_proton_plus_widgets_games_game_peer_focus_request (ProtonPlusWidgetsGamesGameListItem* item,
                                                                                                              gpointer self);
static void ___lambda204__gtk_signal_list_item_factory_setup (GtkSignalListItemFactory* _sender,
                                                       GObject* object,
                                                       gpointer self);
static void __lambda205_ (ProtonPlusWidgetsGamesBox* self,
                   GObject* object);
static void ___lambda205__gtk_signal_list_item_factory_bind (GtkSignalListItemFactory* _sender,
                                                      GObject* object,
                                                      gpointer self);
static void __lambda206_ (ProtonPlusWidgetsGamesBox* self,
                   GObject* object);
static void ___lambda206__gtk_signal_list_item_factory_unbind (GtkSignalListItemFactory* _sender,
                                                        GObject* object,
                                                        gpointer self);
static void __lambda207_ (ProtonPlusWidgetsGamesBox* self,
                   GObject* object);
static void ___lambda207__gtk_signal_list_item_factory_teardown (GtkSignalListItemFactory* _sender,
                                                          GObject* object,
                                                          gpointer self);
static Block39Data* block39_data_ref (Block39Data* _data39_);
static void block39_data_unref (void * _userdata_);
static void __lambda208_ (Block39Data* _data39_,
                   GObject* object);
static void ___lambda208__gtk_signal_list_item_factory_setup (GtkSignalListItemFactory* _sender,
                                                       GObject* object,
                                                       gpointer self);
static void __lambda209_ (ProtonPlusWidgetsGamesBox* self,
                   GObject* object);
static void ___lambda209__gtk_signal_list_item_factory_bind (GtkSignalListItemFactory* _sender,
                                                      GObject* object,
                                                      gpointer self);
static void __lambda210_ (ProtonPlusWidgetsGamesBox* self,
                   GObject* object);
static void ___lambda210__gtk_signal_list_item_factory_unbind (GtkSignalListItemFactory* _sender,
                                                        GObject* object,
                                                        gpointer self);
static void __lambda211_ (ProtonPlusWidgetsGamesBox* self,
                   GObject* object);
static void ___lambda211__gtk_signal_list_item_factory_teardown (GtkSignalListItemFactory* _sender,
                                                          GObject* object,
                                                          gpointer self);
static void __lambda212_ (ProtonPlusWidgetsGamesBox* self,
                   GObject* object);
static void ___lambda212__gtk_signal_list_item_factory_setup (GtkSignalListItemFactory* _sender,
                                                       GObject* object,
                                                       gpointer self);
static void __lambda213_ (ProtonPlusWidgetsGamesBox* self,
                   GObject* object);
static void ___lambda213__gtk_signal_list_item_factory_bind (GtkSignalListItemFactory* _sender,
                                                      GObject* object,
                                                      gpointer self);
static void __lambda214_ (ProtonPlusWidgetsGamesBox* self,
                   GObject* object);
static void ___lambda214__gtk_signal_list_item_factory_unbind (GtkSignalListItemFactory* _sender,
                                                        GObject* object,
                                                        gpointer self);
static void __lambda215_ (ProtonPlusWidgetsGamesBox* self,
                   GObject* object);
static void ___lambda215__gtk_signal_list_item_factory_teardown (GtkSignalListItemFactory* _sender,
                                                          GObject* object,
                                                          gpointer self);
static void proton_plus_widgets_games_box_build_selection_popover (ProtonPlusWidgetsGamesBox* self);
static void proton_plus_widgets_games_box_build_filter_popover (ProtonPlusWidgetsGamesBox* self);
static Block40Data* block40_data_ref (Block40Data* _data40_);
static void block40_data_unref (void * _userdata_);
static void __lambda220_ (Block40Data* _data40_);
static void proton_plus_widgets_games_box_apply_filter_choice (ProtonPlusWidgetsGamesBox* self,
                                                        GtkCheckButton* choice,
                                                        GtkPopover* popover);
static void ___lambda220__gtk_check_button_toggled (GtkCheckButton* _sender,
                                             gpointer self);
static void __lambda221_ (Block40Data* _data40_);
static void ___lambda221__gtk_check_button_toggled (GtkCheckButton* _sender,
                                             gpointer self);
static void __lambda222_ (Block40Data* _data40_);
static void ___lambda222__gtk_check_button_toggled (GtkCheckButton* _sender,
                                             gpointer self);
static void proton_plus_widgets_games_box_update_filter_button_state (ProtonPlusWidgetsGamesBox* self);
static void proton_plus_widgets_games_box_build_search_toolbar (ProtonPlusWidgetsGamesBox* self);
static void proton_plus_widgets_games_box_schedule_search_filter (ProtonPlusWidgetsGamesBox* self);
static void _proton_plus_widgets_games_box_schedule_search_filter_gtk_editable_changed (GtkEditable* _sender,
                                                                                 gpointer self);
static void __lambda224_ (ProtonPlusWidgetsGamesBox* self);
static void ___lambda224__gtk_search_entry_stop_search (GtkSearchEntry* _sender,
                                                 gpointer self);
static void __lambda225_ (ProtonPlusWidgetsGamesBox* self);
static void ___lambda225__gtk_check_button_toggled (GtkCheckButton* _sender,
                                             gpointer self);
static GtkBox* proton_plus_widgets_games_box_build_toolbar (ProtonPlusWidgetsGamesBox* self);
static void proton_plus_widgets_games_box_refilter_games (ProtonPlusWidgetsGamesBox* self);
static gboolean proton_plus_widgets_games_box_get_invalid (ProtonPlusWidgetsGamesBox* self);
static gboolean proton_plus_widgets_games_box_get_error (ProtonPlusWidgetsGamesBox* self);
static void proton_plus_widgets_games_box_show_normal (ProtonPlusWidgetsGamesBox* self);
static void proton_plus_widgets_games_box_set_invalid (ProtonPlusWidgetsGamesBox* self,
                                                gboolean value);
static void proton_plus_widgets_games_box_set_error (ProtonPlusWidgetsGamesBox* self,
                                              gboolean value);
static void proton_plus_widgets_games_box_show_status_box (ProtonPlusWidgetsGamesBox* self,
                                                    const gchar* icon,
                                                    const gchar* title,
                                                    const gchar* description,
                                                    gboolean is_image);
static void proton_plus_widgets_games_box_update_selection_controls (ProtonPlusWidgetsGamesBox* self);
static void proton_plus_widgets_games_box_cancel_focus_idle (ProtonPlusWidgetsGamesBox* self);
static gboolean __lambda223_ (ProtonPlusWidgetsGamesBox* self);
static gboolean ___lambda223__gsource_func (gpointer self);
static void proton_plus_widgets_games_box_update_empty_state (ProtonPlusWidgetsGamesBox* self);
static void proton_plus_widgets_games_box_set_selection_mode (ProtonPlusWidgetsGamesBox* self,
                                                       gboolean active);
static void proton_plus_widgets_games_box_open_single_game_edit (ProtonPlusWidgetsGamesBox* self,
                                                          ProtonPlusWidgetsGamesGameListItem* item);
static void proton_plus_widgets_games_box_open_mass_edit (ProtonPlusWidgetsGamesBox* self,
                                                   ProtonPlusWidgetsGamesGameListItem** items,
                                                   gint items_length1);
static void proton_plus_widgets_games_box_push_mass_edit_page (ProtonPlusWidgetsGamesBox* self);
static void proton_plus_widgets_games_box_switch_collection_view (ProtonPlusWidgetsGamesBox* self,
                                                           gboolean narrow);
static ProtonPlusWidgetsGamesGameListItem* proton_plus_widgets_games_box_find_focused_item (ProtonPlusWidgetsGamesBox* self);
static void proton_plus_widgets_games_box_schedule_item_focus (ProtonPlusWidgetsGamesBox* self,
                                                        guint position,
                                                        ProtonPlusWidgetsGamesGameFocusLane lane);
static gboolean proton_plus_widgets_games_box_focus_relative (ProtonPlusWidgetsGamesBox* self,
                                                       ProtonPlusWidgetsGamesGameListItem* item,
                                                       gint delta,
                                                       ProtonPlusWidgetsGamesGameFocusLane lane);
static gboolean proton_plus_widgets_games_box_focus_launcher_selector (ProtonPlusWidgetsGamesBox* self);
static gboolean proton_plus_widgets_games_box_focus_item (ProtonPlusWidgetsGamesBox* self,
                                                   guint position,
                                                   ProtonPlusWidgetsGamesGameFocusLane lane);
static gboolean proton_plus_widgets_games_box_try_focus_bound_item (ProtonPlusWidgetsGamesBox* self,
                                                             ProtonPlusWidgetsGamesGameListItem* item,
                                                             ProtonPlusWidgetsGamesGameFocusLane lane,
                                                             gboolean narrow,
                                                             gboolean* focus_ready);
static void proton_plus_widgets_games_box_scroll_collection_to (ProtonPlusWidgetsGamesBox* self,
                                                         guint position,
                                                         gboolean narrow);
static void proton_plus_widgets_games_box_schedule_item_focus_attempt (ProtonPlusWidgetsGamesBox* self,
                                                                guint position,
                                                                ProtonPlusWidgetsGamesGameFocusLane lane,
                                                                guint64 expected_generation,
                                                                ProtonPlusWidgetsGamesGameListItem* expected_item,
                                                                gboolean expected_narrow,
                                                                gint attempt);
static Block41Data* block41_data_ref (Block41Data* _data41_);
static void block41_data_unref (void * _userdata_);
static gboolean __lambda200_ (Block41Data* _data41_);
static gboolean ___lambda200__gsource_func (gpointer self);
static gboolean proton_plus_widgets_games_box_focus_last_visible_game (ProtonPlusWidgetsGamesBox* self);
static gboolean proton_plus_widgets_games_box_focus_first_visible_game (ProtonPlusWidgetsGamesBox* self);
static gboolean proton_plus_widgets_games_box_focus_first_visible_game_title (ProtonPlusWidgetsGamesBox* self);
static gboolean proton_plus_widgets_games_box_focus_games_toolbar (ProtonPlusWidgetsGamesBox* self);
static gboolean proton_plus_widgets_games_box_pop_page (ProtonPlusWidgetsGamesBox* self);
static void proton_plus_widgets_games_box_cleanup_mass_edit_exit (ProtonPlusWidgetsGamesBox* self);
static void proton_plus_widgets_games_box_reset_games_list_state (ProtonPlusWidgetsGamesBox* self);
static gchar* proton_plus_widgets_games_box_real_get_controller_page_id (ProtonPlusUtilsControllerNavigationHost* base);
static GObject* proton_plus_widgets_games_box_real_get_controller_page_root (ProtonPlusUtilsControllerNavigationHost* base);
static GObject* proton_plus_widgets_games_box_real_get_controller_initial_focus (ProtonPlusUtilsControllerNavigationHost* base);
static gboolean proton_plus_widgets_games_box_real_controller_navigate_back (ProtonPlusUtilsControllerNavigationHost* base);
static gboolean proton_plus_widgets_games_box_real_controller_can_navigate_back (ProtonPlusUtilsControllerNavigationHost* base);
static gboolean proton_plus_widgets_games_box_real_controller_can_switch_page (ProtonPlusUtilsControllerNavigationHost* base);
static gboolean proton_plus_widgets_games_box_real_controller_prefers_initial_focus_after_switch (ProtonPlusUtilsControllerNavigationHost* base);
static gboolean proton_plus_widgets_games_box_real_controller_switch_page (ProtonPlusUtilsControllerNavigationHost* base,
                                                                    gint delta);
static gboolean proton_plus_widgets_games_box_real_controller_can_open_search (ProtonPlusUtilsControllerPageShortcuts* base);
static gboolean proton_plus_widgets_games_box_real_controller_can_open_filter (ProtonPlusUtilsControllerPageShortcuts* base);
static gboolean proton_plus_widgets_games_box_real_controller_open_search (ProtonPlusUtilsControllerPageShortcuts* base);
static gboolean proton_plus_widgets_games_box_real_controller_open_filter (ProtonPlusUtilsControllerPageShortcuts* base);
static void proton_plus_widgets_games_box_real_dispose (GObject* base);
static GObject * proton_plus_widgets_games_box_constructor (GType type,
                                                     guint n_construct_properties,
                                                     GObjectConstructParam * construct_properties);
static void _proton_plus_widgets_games_box___lambda226_ (ProtonPlusWidgetsGamesBox* self);
static void __proton_plus_widgets_games_box___lambda226__adw_breakpoint_apply (AdwBreakpoint* _sender,
                                                                        gpointer self);
static void _proton_plus_widgets_games_box___lambda227_ (ProtonPlusWidgetsGamesBox* self);
static void __proton_plus_widgets_games_box___lambda227__adw_breakpoint_unapply (AdwBreakpoint* _sender,
                                                                          gpointer self);
static void _proton_plus_widgets_games_box___lambda228_ (ProtonPlusWidgetsGamesBox* self);
static void __proton_plus_widgets_games_box___lambda228__gtk_button_clicked (GtkButton* _sender,
                                                                      gpointer self);
static gboolean _proton_plus_widgets_games_box_focus_last_visible_game_proton_plus_widgets_games_focus_last_visible_game_request (gpointer self);
static void _proton_plus_widgets_games_box___lambda229_ (ProtonPlusWidgetsGamesBox* self);
static void __proton_plus_widgets_games_box___lambda229__proton_plus_widgets_games_mass_edit_button_mass_edit_requested (ProtonPlusWidgetsGamesMassEditButton* _sender,
                                                                                                                  gpointer self);
static void _proton_plus_widgets_games_box___lambda230_ (ProtonPlusWidgetsGamesBox* self);
static void __proton_plus_widgets_games_box___lambda230__proton_plus_widgets_games_game_collection_state_changed (ProtonPlusWidgetsGamesGameCollection* _sender,
                                                                                                           gpointer self);
static gboolean _proton_plus_widgets_games_box_focus_games_toolbar_proton_plus_widgets_games_game_boundary_focus_request (gpointer self);
static gboolean _proton_plus_widgets_games_box_focus_first_visible_game_proton_plus_widgets_games_game_boundary_focus_request (gpointer self);
static gboolean _proton_plus_widgets_games_box_focus_first_visible_game_title_proton_plus_widgets_games_game_boundary_focus_request (gpointer self);
static void _proton_plus_widgets_games_box___lambda231_ (ProtonPlusWidgetsGamesBox* self);
static void __proton_plus_widgets_games_box___lambda231__proton_plus_widgets_games_mass_edit_view_back_requested (ProtonPlusWidgetsGamesMassEditView* _sender,
                                                                                                           gpointer self);
static void _proton_plus_widgets_games_box___lambda232_ (ProtonPlusWidgetsGamesBox* self,
                                                  AdwNavigationPage* page);
static void __proton_plus_widgets_games_box___lambda232__adw_navigation_view_popped (AdwNavigationView* _sender,
                                                                              AdwNavigationPage* page,
                                                                              gpointer self);
static void _proton_plus_widgets_games_box___lambda233_ (ProtonPlusWidgetsGamesBox* self);
static void __proton_plus_widgets_games_box___lambda233__g_object_notify (GObject* _sender,
                                                                   GParamSpec* pspec,
                                                                   gpointer self);
static void proton_plus_widgets_games_box_finalize (GObject * obj);
static GType proton_plus_widgets_games_box_get_type_once (void);
static void _vala_proton_plus_widgets_games_box_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec);
static void _vala_proton_plus_widgets_games_box_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
proton_plus_widgets_games_game_sort_header_target_get_instance_private (ProtonPlusWidgetsGamesGameSortHeaderTarget* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsGamesGameSortHeaderTarget_private_offset);
}

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

static void
_proton_plus_widgets_games_game_sort_header_target_activate_sort_gtk_button_activate (GtkButton* _sender,
                                                                                      gpointer self)
{
	proton_plus_widgets_games_game_sort_header_target_activate_sort ((ProtonPlusWidgetsGamesGameSortHeaderTarget*) self);
}

ProtonPlusWidgetsGamesGameSortHeaderTarget*
proton_plus_widgets_games_game_sort_header_target_construct (GType object_type,
                                                             GtkColumnView* view,
                                                             GtkColumnViewColumn* column,
                                                             GtkWidget* header)
{
	ProtonPlusWidgetsGamesGameSortHeaderTarget * self = NULL;
	GtkColumnViewColumn* _tmp0_;
	GtkButton* _tmp1_;
	GtkButton* _tmp2_;
	GtkButton* _tmp3_;
	gulong _tmp4_;
	g_return_val_if_fail (view != NULL, NULL);
	g_return_val_if_fail (column != NULL, NULL);
	g_return_val_if_fail (header != NULL, NULL);
	self = (ProtonPlusWidgetsGamesGameSortHeaderTarget*) g_object_new (object_type, NULL);
	self->priv->view = view;
	_tmp0_ = _g_object_ref0 (column);
	_g_object_unref0 (self->priv->column);
	self->priv->column = _tmp0_;
	proton_plus_widgets_games_game_sort_header_target_set_header (self, header);
	_tmp1_ = (GtkButton*) gtk_button_new ();
	g_object_ref_sink (_tmp1_);
	_tmp2_ = _tmp1_;
	proton_plus_widgets_games_game_sort_header_target_set_activation_target (self, _tmp2_);
	_g_object_unref0 (_tmp2_);
	_tmp3_ = self->priv->_activation_target;
	_tmp4_ = g_signal_connect_object (_tmp3_, "activate", (GCallback) _proton_plus_widgets_games_game_sort_header_target_activate_sort_gtk_button_activate, self, 0);
	self->priv->activation_handler = _tmp4_;
	return self;
}

ProtonPlusWidgetsGamesGameSortHeaderTarget*
proton_plus_widgets_games_game_sort_header_target_new (GtkColumnView* view,
                                                       GtkColumnViewColumn* column,
                                                       GtkWidget* header)
{
	return proton_plus_widgets_games_game_sort_header_target_construct (PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SORT_HEADER_TARGET, view, column, header);
}

void
proton_plus_widgets_games_game_sort_header_target_set_controller_focus (ProtonPlusWidgetsGamesGameSortHeaderTarget* self,
                                                                        gboolean focused)
{
	g_return_if_fail (self != NULL);
	if (focused) {
		GtkWidget* _tmp0_;
		_tmp0_ = self->priv->_header;
		gtk_widget_add_css_class (_tmp0_, "games-sort-header-controller-focus");
	} else {
		GtkWidget* _tmp1_;
		_tmp1_ = self->priv->_header;
		gtk_widget_remove_css_class (_tmp1_, "games-sort-header-controller-focus");
	}
}

gchar*
proton_plus_widgets_games_game_sort_header_target_get_title (ProtonPlusWidgetsGamesGameSortHeaderTarget* self)
{
	const gchar* _tmp0_ = NULL;
	GtkColumnViewColumn* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->column;
	_tmp2_ = gtk_column_view_column_get_title (_tmp1_);
	_tmp0_ = _tmp2_;
	if (_tmp0_ == NULL) {
		_tmp0_ = "";
	}
	_tmp3_ = g_strdup (_tmp0_);
	result = _tmp3_;
	return result;
}

static void
proton_plus_widgets_games_game_sort_header_target_activate_sort (ProtonPlusWidgetsGamesGameSortHeaderTarget* self)
{
	GtkColumnView* _tmp0_;
	GtkColumnViewSorter* sorter = NULL;
	GtkColumnView* _tmp1_;
	GtkSorter* _tmp2_;
	GtkColumnViewSorter* _tmp3_;
	gboolean _tmp4_ = FALSE;
	GtkColumnViewSorter* _tmp5_;
	gboolean is_primary = FALSE;
	GtkSortType _tmp9_ = 0;
	GtkColumnViewSorter* _tmp10_;
	GtkSortType current_direction = 0;
	GtkColumnView* _tmp13_;
	GtkColumnViewColumn* _tmp14_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->view;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->view;
	_tmp2_ = gtk_column_view_get_sorter (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_column_view_get_type (), GtkColumnView));
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, gtk_column_view_sorter_get_type ()) ? ((GtkColumnViewSorter*) _tmp2_) : NULL);
	sorter = _tmp3_;
	_tmp5_ = sorter;
	if (_tmp5_ != NULL) {
		GtkColumnViewSorter* _tmp6_;
		GtkColumnViewColumn* _tmp7_;
		GtkColumnViewColumn* _tmp8_;
		_tmp6_ = sorter;
		_tmp7_ = gtk_column_view_sorter_get_primary_sort_column (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_column_view_sorter_get_type (), GtkColumnViewSorter));
		_tmp8_ = self->priv->column;
		_tmp4_ = _tmp7_ == _tmp8_;
	} else {
		_tmp4_ = FALSE;
	}
	is_primary = _tmp4_;
	_tmp10_ = sorter;
	if (_tmp10_ != NULL) {
		GtkColumnViewSorter* _tmp11_;
		_tmp11_ = sorter;
		_tmp9_ = gtk_column_view_sorter_get_primary_sort_order (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_column_view_sorter_get_type (), GtkColumnViewSorter));
	} else {
		_tmp9_ = GTK_SORT_ASCENDING;
	}
	current_direction = _tmp9_;
	if (!is_primary) {
		GtkColumnView* _tmp12_;
		_tmp12_ = self->priv->view;
		gtk_column_view_sort_by_column (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_column_view_get_type (), GtkColumnView), NULL, GTK_SORT_ASCENDING);
	}
	_tmp13_ = self->priv->view;
	_tmp14_ = self->priv->column;
	gtk_column_view_sort_by_column (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_column_view_get_type (), GtkColumnView), _tmp14_, proton_plus_widgets_games_game_controller_navigation_policy_next_sort_direction (is_primary, current_direction));
	_g_object_unref0 (sorter);
}

void
proton_plus_widgets_games_game_sort_header_target_detach (ProtonPlusWidgetsGamesGameSortHeaderTarget* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->activation_handler != ((gulong) 0)) {
		GtkButton* _tmp0_;
		_tmp0_ = self->priv->_activation_target;
		g_signal_handler_disconnect ((GObject*) _tmp0_, self->priv->activation_handler);
		self->priv->activation_handler = (gulong) 0;
	}
	proton_plus_widgets_games_game_sort_header_target_set_controller_focus (self, FALSE);
	self->priv->view = NULL;
}

GtkWidget*
proton_plus_widgets_games_game_sort_header_target_get_header (ProtonPlusWidgetsGamesGameSortHeaderTarget* self)
{
	GtkWidget* result;
	GtkWidget* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_header;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_game_sort_header_target_set_header (ProtonPlusWidgetsGamesGameSortHeaderTarget* self,
                                                              GtkWidget* value)
{
	GtkWidget* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_games_game_sort_header_target_get_header (self);
	if (old_value != value) {
		GtkWidget* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_header);
		self->priv->_header = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_games_game_sort_header_target_properties[PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_TARGET_HEADER_PROPERTY]);
	}
}

GtkButton*
proton_plus_widgets_games_game_sort_header_target_get_activation_target (ProtonPlusWidgetsGamesGameSortHeaderTarget* self)
{
	GtkButton* result;
	GtkButton* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_activation_target;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_game_sort_header_target_set_activation_target (ProtonPlusWidgetsGamesGameSortHeaderTarget* self,
                                                                         GtkButton* value)
{
	GtkButton* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_games_game_sort_header_target_get_activation_target (self);
	if (old_value != value) {
		GtkButton* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_activation_target);
		self->priv->_activation_target = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_games_game_sort_header_target_properties[PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_TARGET_ACTIVATION_TARGET_PROPERTY]);
	}
}

static void
proton_plus_widgets_games_game_sort_header_target_class_init (ProtonPlusWidgetsGamesGameSortHeaderTargetClass * klass,
                                                              gpointer klass_data)
{
	proton_plus_widgets_games_game_sort_header_target_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsGamesGameSortHeaderTarget_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_games_game_sort_header_target_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_games_game_sort_header_target_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_games_game_sort_header_target_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_TARGET_HEADER_PROPERTY, proton_plus_widgets_games_game_sort_header_target_properties[PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_TARGET_HEADER_PROPERTY] = g_param_spec_object ("header", "header", "header", gtk_widget_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_TARGET_ACTIVATION_TARGET_PROPERTY, proton_plus_widgets_games_game_sort_header_target_properties[PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_TARGET_ACTIVATION_TARGET_PROPERTY] = g_param_spec_object ("activation-target", "activation-target", "activation-target", gtk_button_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
proton_plus_widgets_games_game_sort_header_target_instance_init (ProtonPlusWidgetsGamesGameSortHeaderTarget * self,
                                                                 gpointer klass)
{
	self->priv = proton_plus_widgets_games_game_sort_header_target_get_instance_private (self);
}

static void
proton_plus_widgets_games_game_sort_header_target_finalize (GObject * obj)
{
	ProtonPlusWidgetsGamesGameSortHeaderTarget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SORT_HEADER_TARGET, ProtonPlusWidgetsGamesGameSortHeaderTarget);
	_g_object_unref0 (self->priv->column);
	_g_object_unref0 (self->priv->_header);
	_g_object_unref0 (self->priv->_activation_target);
	G_OBJECT_CLASS (proton_plus_widgets_games_game_sort_header_target_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_games_game_sort_header_target_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsGamesGameSortHeaderTargetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_games_game_sort_header_target_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsGamesGameSortHeaderTarget), 0, (GInstanceInitFunc) proton_plus_widgets_games_game_sort_header_target_instance_init, NULL };
	GType proton_plus_widgets_games_game_sort_header_target_type_id;
	proton_plus_widgets_games_game_sort_header_target_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusWidgetsGamesGameSortHeaderTarget", &g_define_type_info, 0);
	ProtonPlusWidgetsGamesGameSortHeaderTarget_private_offset = g_type_add_instance_private (proton_plus_widgets_games_game_sort_header_target_type_id, sizeof (ProtonPlusWidgetsGamesGameSortHeaderTargetPrivate));
	return proton_plus_widgets_games_game_sort_header_target_type_id;
}

GType
proton_plus_widgets_games_game_sort_header_target_get_type (void)
{
	static volatile gsize proton_plus_widgets_games_game_sort_header_target_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_games_game_sort_header_target_type_id__once)) {
		GType proton_plus_widgets_games_game_sort_header_target_type_id;
		proton_plus_widgets_games_game_sort_header_target_type_id = proton_plus_widgets_games_game_sort_header_target_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_games_game_sort_header_target_type_id__once, proton_plus_widgets_games_game_sort_header_target_type_id);
	}
	return proton_plus_widgets_games_game_sort_header_target_type_id__once;
}

static void
_vala_proton_plus_widgets_games_game_sort_header_target_get_property (GObject * object,
                                                                      guint property_id,
                                                                      GValue * value,
                                                                      GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesGameSortHeaderTarget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SORT_HEADER_TARGET, ProtonPlusWidgetsGamesGameSortHeaderTarget);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_TARGET_HEADER_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_games_game_sort_header_target_get_header (self));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_TARGET_ACTIVATION_TARGET_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_games_game_sort_header_target_get_activation_target (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_widgets_games_game_sort_header_target_set_property (GObject * object,
                                                                      guint property_id,
                                                                      const GValue * value,
                                                                      GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesGameSortHeaderTarget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SORT_HEADER_TARGET, ProtonPlusWidgetsGamesGameSortHeaderTarget);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_TARGET_HEADER_PROPERTY:
		proton_plus_widgets_games_game_sort_header_target_set_header (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_TARGET_ACTIVATION_TARGET_PROPERTY:
		proton_plus_widgets_games_game_sort_header_target_set_activation_target (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
proton_plus_widgets_games_game_sort_header_map_target_get_instance_private (ProtonPlusWidgetsGamesGameSortHeaderMapTarget* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsGamesGameSortHeaderMapTarget_private_offset);
}

ProtonPlusWidgetsGamesGameSortHeaderMapTarget*
proton_plus_widgets_games_game_sort_header_map_target_construct (GType object_type,
                                                                 ProtonPlusWidgetsGamesGameListControllerBox* owner)
{
	ProtonPlusWidgetsGamesGameSortHeaderMapTarget * self = NULL;
	g_return_val_if_fail (owner != NULL, NULL);
	self = (ProtonPlusWidgetsGamesGameSortHeaderMapTarget*) g_object_new (object_type, NULL);
	self->priv->owner = owner;
	return self;
}

ProtonPlusWidgetsGamesGameSortHeaderMapTarget*
proton_plus_widgets_games_game_sort_header_map_target_new (ProtonPlusWidgetsGamesGameListControllerBox* owner)
{
	return proton_plus_widgets_games_game_sort_header_map_target_construct (PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SORT_HEADER_MAP_TARGET, owner);
}

void
proton_plus_widgets_games_game_sort_header_map_target_mapped (ProtonPlusWidgetsGamesGameSortHeaderMapTarget* self)
{
	ProtonPlusWidgetsGamesGameListControllerBox* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->owner;
	if (_tmp0_ != NULL) {
		ProtonPlusWidgetsGamesGameListControllerBox* _tmp1_;
		_tmp1_ = self->priv->owner;
		proton_plus_widgets_games_game_list_controller_box_begin_sort_header_configuration (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_CONTROLLER_BOX, ProtonPlusWidgetsGamesGameListControllerBox));
	}
}

static void
proton_plus_widgets_games_game_sort_header_map_target_class_init (ProtonPlusWidgetsGamesGameSortHeaderMapTargetClass * klass,
                                                                  gpointer klass_data)
{
	proton_plus_widgets_games_game_sort_header_map_target_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsGamesGameSortHeaderMapTarget_private_offset);
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_games_game_sort_header_map_target_finalize;
}

static void
proton_plus_widgets_games_game_sort_header_map_target_instance_init (ProtonPlusWidgetsGamesGameSortHeaderMapTarget * self,
                                                                     gpointer klass)
{
	self->priv = proton_plus_widgets_games_game_sort_header_map_target_get_instance_private (self);
}

static void
proton_plus_widgets_games_game_sort_header_map_target_finalize (GObject * obj)
{
	ProtonPlusWidgetsGamesGameSortHeaderMapTarget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SORT_HEADER_MAP_TARGET, ProtonPlusWidgetsGamesGameSortHeaderMapTarget);
	G_OBJECT_CLASS (proton_plus_widgets_games_game_sort_header_map_target_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_games_game_sort_header_map_target_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsGamesGameSortHeaderMapTargetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_games_game_sort_header_map_target_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsGamesGameSortHeaderMapTarget), 0, (GInstanceInitFunc) proton_plus_widgets_games_game_sort_header_map_target_instance_init, NULL };
	GType proton_plus_widgets_games_game_sort_header_map_target_type_id;
	proton_plus_widgets_games_game_sort_header_map_target_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusWidgetsGamesGameSortHeaderMapTarget", &g_define_type_info, 0);
	ProtonPlusWidgetsGamesGameSortHeaderMapTarget_private_offset = g_type_add_instance_private (proton_plus_widgets_games_game_sort_header_map_target_type_id, sizeof (ProtonPlusWidgetsGamesGameSortHeaderMapTargetPrivate));
	return proton_plus_widgets_games_game_sort_header_map_target_type_id;
}

GType
proton_plus_widgets_games_game_sort_header_map_target_get_type (void)
{
	static volatile gsize proton_plus_widgets_games_game_sort_header_map_target_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_games_game_sort_header_map_target_type_id__once)) {
		GType proton_plus_widgets_games_game_sort_header_map_target_type_id;
		proton_plus_widgets_games_game_sort_header_map_target_type_id = proton_plus_widgets_games_game_sort_header_map_target_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_games_game_sort_header_map_target_type_id__once, proton_plus_widgets_games_game_sort_header_map_target_type_id);
	}
	return proton_plus_widgets_games_game_sort_header_map_target_type_id__once;
}

static inline gpointer
proton_plus_widgets_games_game_list_controller_box_get_instance_private (ProtonPlusWidgetsGamesGameListControllerBox* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsGamesGameListControllerBox_private_offset);
}

static void
_proton_plus_widgets_games_game_sort_header_map_target_mapped_gtk_widget_map (GtkWidget* _sender,
                                                                              gpointer self)
{
	proton_plus_widgets_games_game_sort_header_map_target_mapped ((ProtonPlusWidgetsGamesGameSortHeaderMapTarget*) self);
}

static void
__lambda108_ (ProtonPlusWidgetsGamesGameListControllerBox* self)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	g_object_get ((GtkWidget*) self, "has-focus", &_tmp0_, NULL);
	_tmp1_ = _tmp0_;
	if (!_tmp1_) {
		proton_plus_widgets_games_game_list_controller_box_clear_sort_header_focus (self);
	}
}

static void
___lambda108__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda108_ ((ProtonPlusWidgetsGamesGameListControllerBox*) self);
}

ProtonPlusWidgetsGamesGameListControllerBox*
proton_plus_widgets_games_game_list_controller_box_construct (GType object_type,
                                                              GtkWidget* toolbar,
                                                              GtkColumnView* wide_view,
                                                              GtkWidget* narrow_view,
                                                              ProtonPlusWidgetsGamesGameBoundaryFocusRequest toolbar_focus,
                                                              gpointer toolbar_focus_target,
                                                              ProtonPlusWidgetsGamesGameBoundaryFocusRequest first_game_focus,
                                                              gpointer first_game_focus_target,
                                                              ProtonPlusWidgetsGamesGameBoundaryFocusRequest first_game_title_focus,
                                                              gpointer first_game_title_focus_target)
{
	ProtonPlusWidgetsGamesGameListControllerBox * self = NULL;
	GtkWidget* _tmp0_;
	GtkColumnView* _tmp1_;
	GtkWidget* _tmp2_;
	GeeArrayList* _tmp3_;
	ProtonPlusWidgetsGamesGameSortHeaderMapTarget* _tmp4_;
	ProtonPlusWidgetsGamesGameSortHeaderMapTarget* _tmp5_;
	gulong _tmp6_;
	g_return_val_if_fail (toolbar != NULL, NULL);
	g_return_val_if_fail (wide_view != NULL, NULL);
	g_return_val_if_fail (narrow_view != NULL, NULL);
	self = (ProtonPlusWidgetsGamesGameListControllerBox*) g_object_new (object_type, "orientation", GTK_ORIENTATION_VERTICAL, "spacing", 12, NULL);
	_tmp0_ = _g_object_ref0 (toolbar);
	_g_object_unref0 (self->priv->toolbar);
	self->priv->toolbar = _tmp0_;
	_tmp1_ = _g_object_ref0 (wide_view);
	_g_object_unref0 (self->priv->wide_view);
	self->priv->wide_view = _tmp1_;
	_tmp2_ = _g_object_ref0 (narrow_view);
	_g_object_unref0 (self->priv->narrow_view);
	self->priv->narrow_view = _tmp2_;
	self->priv->toolbar_focus = toolbar_focus;
	self->priv->toolbar_focus_target = toolbar_focus_target;
	self->priv->first_game_focus = first_game_focus;
	self->priv->first_game_focus_target = first_game_focus_target;
	self->priv->first_game_title_focus = first_game_title_focus;
	self->priv->first_game_title_focus_target = first_game_title_focus_target;
	gtk_widget_set_focusable ((GtkWidget*) self, TRUE);
	gtk_widget_add_css_class ((GtkWidget*) self, "games-sort-header-focus-proxy");
	_tmp3_ = gee_array_list_new (PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SORT_HEADER_TARGET, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->sort_headers);
	self->priv->sort_headers = _tmp3_;
	_tmp4_ = proton_plus_widgets_games_game_sort_header_map_target_new (self);
	_g_object_unref0 (self->priv->sort_header_map_target);
	self->priv->sort_header_map_target = _tmp4_;
	_tmp5_ = self->priv->sort_header_map_target;
	_tmp6_ = g_signal_connect_object ((GtkWidget*) wide_view, "map", (GCallback) _proton_plus_widgets_games_game_sort_header_map_target_mapped_gtk_widget_map, _tmp5_, 0);
	self->priv->sort_header_map_handler = _tmp6_;
	g_signal_connect_object ((GObject*) self, "notify::has-focus", (GCallback) ___lambda108__g_object_notify, self, 0);
	return self;
}

ProtonPlusWidgetsGamesGameListControllerBox*
proton_plus_widgets_games_game_list_controller_box_new (GtkWidget* toolbar,
                                                        GtkColumnView* wide_view,
                                                        GtkWidget* narrow_view,
                                                        ProtonPlusWidgetsGamesGameBoundaryFocusRequest toolbar_focus,
                                                        gpointer toolbar_focus_target,
                                                        ProtonPlusWidgetsGamesGameBoundaryFocusRequest first_game_focus,
                                                        gpointer first_game_focus_target,
                                                        ProtonPlusWidgetsGamesGameBoundaryFocusRequest first_game_title_focus,
                                                        gpointer first_game_title_focus_target)
{
	return proton_plus_widgets_games_game_list_controller_box_construct (PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_CONTROLLER_BOX, toolbar, wide_view, narrow_view, toolbar_focus, toolbar_focus_target, first_game_focus, first_game_focus_target, first_game_title_focus, first_game_title_focus_target);
}

static gboolean
proton_plus_widgets_games_game_list_controller_box_real_controller_focus_direction (ProtonPlusUtilsControllerDirectionalFocus* base,
                                                                                    GObject* focused_object,
                                                                                    ProtonPlusUtilsControllerNavigationDirection direction)
{
	ProtonPlusWidgetsGamesGameListControllerBox * self;
	GtkWidget* focused = NULL;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	gint _tmp2_ = 0;
	GtkWidget* _tmp3_;
	gint sort_header_index = 0;
	gboolean _tmp9_ = FALSE;
	GtkWidget* _tmp10_;
	GtkColumnView* _tmp11_;
	ProtonPlusWidgetsGamesGameCollectionBoundaryAction action = 0;
	GtkWidget* _tmp14_;
	GtkWidget* _tmp15_;
	GtkColumnView* _tmp16_;
	gboolean result;
	self = (ProtonPlusWidgetsGamesGameListControllerBox*) base;
	g_return_val_if_fail (focused_object != NULL, FALSE);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (focused_object, gtk_widget_get_type ()) ? ((GtkWidget*) focused_object) : NULL);
	focused = _tmp0_;
	_tmp1_ = focused;
	if (_tmp1_ == NULL) {
		result = FALSE;
		_g_object_unref0 (focused);
		return result;
	}
	_tmp3_ = focused;
	if (_tmp3_ == G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget)) {
		_tmp2_ = self->priv->active_sort_header_index;
	} else {
		_tmp2_ = -1;
	}
	sort_header_index = _tmp2_;
	if (sort_header_index >= 0) {
		ProtonPlusWidgetsGamesGameSortHeaderNavigationAction header_action = 0;
		GeeArrayList* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		_tmp4_ = self->priv->sort_headers;
		_tmp5_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp4_);
		_tmp6_ = _tmp5_;
		header_action = proton_plus_widgets_games_game_controller_navigation_policy_sort_header_action (sort_header_index, _tmp6_, direction);
		switch (header_action) {
			case PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_NAVIGATION_ACTION_PREVIOUS_HEADER:
			{
				result = proton_plus_widgets_games_game_list_controller_box_focus_sort_header (self, sort_header_index - 1);
				_g_object_unref0 (focused);
				return result;
			}
			case PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_NAVIGATION_ACTION_NEXT_HEADER:
			{
				result = proton_plus_widgets_games_game_list_controller_box_focus_sort_header (self, sort_header_index + 1);
				_g_object_unref0 (focused);
				return result;
			}
			case PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_NAVIGATION_ACTION_FOCUS_TOOLBAR:
			{
				ProtonPlusWidgetsGamesGameBoundaryFocusRequest _tmp7_;
				gpointer _tmp7__target;
				_tmp7_ = self->priv->toolbar_focus;
				_tmp7__target = self->priv->toolbar_focus_target;
				result = _tmp7_ (_tmp7__target);
				_g_object_unref0 (focused);
				return result;
			}
			case PROTON_PLUS_WIDGETS_GAMES_GAME_SORT_HEADER_NAVIGATION_ACTION_FOCUS_FIRST_GAME:
			{
				ProtonPlusWidgetsGamesGameBoundaryFocusRequest _tmp8_;
				gpointer _tmp8__target;
				_tmp8_ = self->priv->first_game_title_focus;
				_tmp8__target = self->priv->first_game_title_focus_target;
				result = _tmp8_ (_tmp8__target);
				_g_object_unref0 (focused);
				return result;
			}
			default:
			{
				result = FALSE;
				_g_object_unref0 (focused);
				return result;
			}
		}
	}
	_tmp10_ = focused;
	_tmp11_ = self->priv->wide_view;
	if (proton_plus_widgets_games_game_list_controller_box_is_inside_widget (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_widget_get_type (), GtkWidget), (GtkWidget*) _tmp11_)) {
		_tmp9_ = TRUE;
	} else {
		GtkWidget* _tmp12_;
		GtkWidget* _tmp13_;
		_tmp12_ = focused;
		_tmp13_ = self->priv->narrow_view;
		_tmp9_ = proton_plus_widgets_games_game_list_controller_box_is_inside_widget (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_widget_get_type (), GtkWidget), _tmp13_);
	}
	_tmp14_ = focused;
	_tmp15_ = self->priv->toolbar;
	_tmp16_ = self->priv->wide_view;
	action = proton_plus_widgets_games_game_controller_navigation_policy_boundary_action (proton_plus_widgets_games_game_list_controller_box_is_inside_widget (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_widget_get_type (), GtkWidget), _tmp15_), _tmp9_, direction, gtk_widget_get_mapped ((GtkWidget*) _tmp16_));
	switch (action) {
		case PROTON_PLUS_WIDGETS_GAMES_GAME_COLLECTION_BOUNDARY_ACTION_FOCUS_TOOLBAR:
		{
			ProtonPlusWidgetsGamesGameBoundaryFocusRequest _tmp17_;
			gpointer _tmp17__target;
			_tmp17_ = self->priv->toolbar_focus;
			_tmp17__target = self->priv->toolbar_focus_target;
			result = _tmp17_ (_tmp17__target);
			_g_object_unref0 (focused);
			return result;
		}
		case PROTON_PLUS_WIDGETS_GAMES_GAME_COLLECTION_BOUNDARY_ACTION_FOCUS_FIRST_SORT_HEADER:
		{
			ProtonPlusWidgetsGamesGameBoundaryFocusRequest _tmp18_;
			gpointer _tmp18__target;
			if (proton_plus_widgets_games_game_list_controller_box_focus_first_sort_header (self)) {
				result = TRUE;
				_g_object_unref0 (focused);
				return result;
			}
			_tmp18_ = self->priv->first_game_focus;
			_tmp18__target = self->priv->first_game_focus_target;
			result = _tmp18_ (_tmp18__target);
			_g_object_unref0 (focused);
			return result;
		}
		case PROTON_PLUS_WIDGETS_GAMES_GAME_COLLECTION_BOUNDARY_ACTION_FOCUS_FIRST_GAME:
		{
			ProtonPlusWidgetsGamesGameBoundaryFocusRequest _tmp19_;
			gpointer _tmp19__target;
			_tmp19_ = self->priv->first_game_focus;
			_tmp19__target = self->priv->first_game_focus_target;
			result = _tmp19_ (_tmp19__target);
			_g_object_unref0 (focused);
			return result;
		}
		default:
		{
			result = FALSE;
			_g_object_unref0 (focused);
			return result;
		}
	}
}

static GObject*
proton_plus_widgets_games_game_list_controller_box_real_get_controller_activation_target (ProtonPlusUtilsControllerActivationRedirect* base,
                                                                                          GObject* focused_object)
{
	ProtonPlusWidgetsGamesGameListControllerBox * self;
	GtkWidget* focused = NULL;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	gint _tmp2_ = 0;
	GtkWidget* _tmp3_;
	gint index = 0;
	GeeArrayList* _tmp4_;
	gpointer _tmp5_;
	ProtonPlusWidgetsGamesGameSortHeaderTarget* _tmp6_;
	GtkButton* _tmp7_;
	GtkButton* _tmp8_;
	GObject* _tmp9_;
	GObject* _tmp10_;
	GObject* result;
	self = (ProtonPlusWidgetsGamesGameListControllerBox*) base;
	g_return_val_if_fail (focused_object != NULL, NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (focused_object, gtk_widget_get_type ()) ? ((GtkWidget*) focused_object) : NULL);
	focused = _tmp0_;
	_tmp1_ = focused;
	if (_tmp1_ == NULL) {
		result = NULL;
		_g_object_unref0 (focused);
		return result;
	}
	_tmp3_ = focused;
	if (_tmp3_ == G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget)) {
		_tmp2_ = self->priv->active_sort_header_index;
	} else {
		_tmp2_ = -1;
	}
	index = _tmp2_;
	if (index < 0) {
		result = NULL;
		_g_object_unref0 (focused);
		return result;
	}
	_tmp4_ = self->priv->sort_headers;
	_tmp5_ = gee_abstract_list_get ((GeeAbstractList*) _tmp4_, index);
	_tmp6_ = (ProtonPlusWidgetsGamesGameSortHeaderTarget*) _tmp5_;
	_tmp7_ = proton_plus_widgets_games_game_sort_header_target_get_activation_target (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = _g_object_ref0 ((GObject*) _tmp8_);
	_tmp10_ = _tmp9_;
	_g_object_unref0 (_tmp6_);
	result = _tmp10_;
	_g_object_unref0 (focused);
	return result;
}

gboolean
proton_plus_widgets_games_game_list_controller_box_focus_first_sort_header (ProtonPlusWidgetsGamesGameListControllerBox* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	proton_plus_widgets_games_game_list_controller_box_configure_sort_headers (self);
	result = proton_plus_widgets_games_game_list_controller_box_focus_sort_header (self, 0);
	return result;
}

void
proton_plus_widgets_games_game_list_controller_box_begin_sort_header_configuration (ProtonPlusWidgetsGamesGameListControllerBox* self)
{
	g_return_if_fail (self != NULL);
	self->priv->sort_header_attempt = 0;
	proton_plus_widgets_games_game_list_controller_box_configure_sort_headers (self);
}

static void
proton_plus_widgets_games_game_list_controller_box_configure_sort_headers (ProtonPlusWidgetsGamesGameListControllerBox* self)
{
	gboolean _tmp0_ = FALSE;
	GtkColumnView* _tmp1_;
	GeeArrayList* headers = NULL;
	GeeArrayList* _tmp5_;
	GtkColumnView* _tmp6_;
	GeeArrayList* _tmp7_;
	GListModel* columns = NULL;
	GtkColumnView* _tmp8_;
	GListModel* _tmp9_;
	GListModel* _tmp10_;
	GeeArrayList* _tmp11_;
	gint _tmp12_;
	gint _tmp13_;
	GListModel* _tmp14_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->wide_view;
	if (!gtk_widget_get_mapped ((GtkWidget*) _tmp1_)) {
		_tmp0_ = TRUE;
	} else {
		GeeArrayList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		_tmp2_ = self->priv->sort_headers;
		_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_ > 0;
	}
	if (_tmp0_) {
		return;
	}
	_tmp5_ = gee_array_list_new (gtk_widget_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	headers = _tmp5_;
	_tmp6_ = self->priv->wide_view;
	_tmp7_ = headers;
	proton_plus_widgets_games_game_list_controller_box_collect_column_headers (self, (GtkWidget*) _tmp6_, _tmp7_);
	_tmp8_ = self->priv->wide_view;
	_tmp9_ = gtk_column_view_get_columns (_tmp8_);
	_tmp10_ = _g_object_ref0 (_tmp9_);
	columns = _tmp10_;
	_tmp11_ = headers;
	_tmp12_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = columns;
	if (((guint) _tmp13_) < g_list_model_get_n_items (_tmp14_)) {
		if (self->priv->sort_header_attempt < PROTON_PLUS_WIDGETS_GAMES_GAME_LIST_CONTROLLER_BOX_SORT_HEADER_BIND_MAX_ATTEMPTS) {
			gint _tmp15_;
			_tmp15_ = self->priv->sort_header_attempt;
			self->priv->sort_header_attempt = _tmp15_ + 1;
			proton_plus_widgets_games_game_list_controller_box_schedule_sort_header_configuration (self);
		}
		_g_object_unref0 (columns);
		_g_object_unref0 (headers);
		return;
	}
	{
		guint i = 0U;
		i = (guint) 0;
		{
			gboolean _tmp16_ = FALSE;
			_tmp16_ = TRUE;
			while (TRUE) {
				GListModel* _tmp18_;
				GtkColumnViewColumn* column = NULL;
				GListModel* _tmp19_;
				GObject* _tmp20_;
				GtkColumnViewColumn* _tmp21_;
				gboolean _tmp22_ = FALSE;
				GtkColumnViewColumn* _tmp23_;
				GtkWidget* header = NULL;
				GeeArrayList* _tmp26_;
				gpointer _tmp27_;
				GeeArrayList* _tmp28_;
				GtkColumnView* _tmp29_;
				GtkColumnViewColumn* _tmp30_;
				GtkWidget* _tmp31_;
				ProtonPlusWidgetsGamesGameSortHeaderTarget* _tmp32_;
				ProtonPlusWidgetsGamesGameSortHeaderTarget* _tmp33_;
				if (!_tmp16_) {
					guint _tmp17_;
					_tmp17_ = i;
					i = _tmp17_ + 1;
				}
				_tmp16_ = FALSE;
				_tmp18_ = columns;
				if (!(i < g_list_model_get_n_items (_tmp18_))) {
					break;
				}
				_tmp19_ = columns;
				_tmp20_ = g_list_model_get_item (_tmp19_, i);
				_tmp21_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp20_, gtk_column_view_column_get_type ()) ? ((GtkColumnViewColumn*) _tmp20_) : NULL;
				if (_tmp21_ == NULL) {
					_g_object_unref0 (_tmp20_);
				}
				column = _tmp21_;
				_tmp23_ = column;
				if (_tmp23_ == NULL) {
					_tmp22_ = TRUE;
				} else {
					GtkColumnViewColumn* _tmp24_;
					GtkSorter* _tmp25_;
					_tmp24_ = column;
					_tmp25_ = gtk_column_view_column_get_sorter (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, gtk_column_view_column_get_type (), GtkColumnViewColumn));
					_tmp22_ = _tmp25_ == NULL;
				}
				if (_tmp22_) {
					_g_object_unref0 (column);
					continue;
				}
				_tmp26_ = headers;
				_tmp27_ = gee_abstract_list_get ((GeeAbstractList*) _tmp26_, (gint) i);
				header = (GtkWidget*) _tmp27_;
				_tmp28_ = self->priv->sort_headers;
				_tmp29_ = self->priv->wide_view;
				_tmp30_ = column;
				_tmp31_ = header;
				_tmp32_ = proton_plus_widgets_games_game_sort_header_target_new (_tmp29_, G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, gtk_column_view_column_get_type (), GtkColumnViewColumn), _tmp31_);
				_tmp33_ = _tmp32_;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp28_, _tmp33_);
				_g_object_unref0 (_tmp33_);
				_g_object_unref0 (header);
				_g_object_unref0 (column);
			}
		}
	}
	_g_object_unref0 (columns);
	_g_object_unref0 (headers);
}

static Block38Data*
block38_data_ref (Block38Data* _data38_)
{
	g_atomic_int_inc (&_data38_->_ref_count_);
	return _data38_;
}

static void
block38_data_unref (void * _userdata_)
{
	Block38Data* _data38_;
	_data38_ = (Block38Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data38_->_ref_count_)) {
		ProtonPlusWidgetsGamesGameListControllerBox* self;
		self = _data38_->self;
		_g_object_unref0 (self);
		g_slice_free (Block38Data, _data38_);
	}
}

static gboolean
__lambda107_ (Block38Data* _data38_)
{
	ProtonPlusWidgetsGamesGameListControllerBox* self;
	ProtonPlusWidgetsGamesGameListControllerBox* _tmp0_;
	ProtonPlusWidgetsGamesGameListControllerBox* _tmp1_;
	ProtonPlusWidgetsGamesGameListControllerBox* _tmp2_;
	gboolean result;
	self = _data38_->self;
	_tmp0_ = _data38_->weak_self;
	if (_tmp0_ == NULL) {
		result = G_SOURCE_REMOVE;
		return result;
	}
	_tmp1_ = _data38_->weak_self;
	G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_CONTROLLER_BOX, ProtonPlusWidgetsGamesGameListControllerBox)->priv->sort_header_idle_id = (guint) 0;
	_tmp2_ = _data38_->weak_self;
	proton_plus_widgets_games_game_list_controller_box_configure_sort_headers (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_CONTROLLER_BOX, ProtonPlusWidgetsGamesGameListControllerBox));
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda107__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda107_ (self);
	return result;
}

static void
proton_plus_widgets_games_game_list_controller_box_schedule_sort_header_configuration (ProtonPlusWidgetsGamesGameListControllerBox* self)
{
	Block38Data* _data38_;
	g_return_if_fail (self != NULL);
	_data38_ = g_slice_new0 (Block38Data);
	_data38_->_ref_count_ = 1;
	_data38_->self = g_object_ref (self);
	if (self->priv->sort_header_idle_id != ((guint) 0)) {
		block38_data_unref (_data38_);
		_data38_ = NULL;
		return;
	}
	_data38_->weak_self = self;
	self->priv->sort_header_idle_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda107__gsource_func, block38_data_ref (_data38_), block38_data_unref);
	block38_data_unref (_data38_);
	_data38_ = NULL;
}

static void
proton_plus_widgets_games_game_list_controller_box_collect_column_headers (ProtonPlusWidgetsGamesGameListControllerBox* self,
                                                                           GtkWidget* parent,
                                                                           GeeArrayList* headers)
{
	GtkWidget* child = NULL;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (parent != NULL);
	g_return_if_fail (headers != NULL);
	_tmp0_ = gtk_widget_get_first_child (parent);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	child = _tmp1_;
	while (TRUE) {
		GtkWidget* _tmp2_;
		GtkWidget* _tmp3_;
		GtkWidget* _tmp6_;
		GtkWidget* _tmp7_;
		GtkWidget* _tmp8_;
		_tmp2_ = child;
		if (!(_tmp2_ != NULL)) {
			break;
		}
		_tmp3_ = child;
		if (gtk_accessible_get_accessible_role (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_accessible_get_type (), GtkAccessible)) == GTK_ACCESSIBLE_ROLE_COLUMN_HEADER) {
			GtkWidget* _tmp4_;
			_tmp4_ = child;
			gee_abstract_collection_add ((GeeAbstractCollection*) headers, _tmp4_);
		} else {
			GtkWidget* _tmp5_;
			_tmp5_ = child;
			proton_plus_widgets_games_game_list_controller_box_collect_column_headers (self, _tmp5_, headers);
		}
		_tmp6_ = child;
		_tmp7_ = gtk_widget_get_next_sibling (_tmp6_);
		_tmp8_ = _g_object_ref0 (_tmp7_);
		_g_object_unref0 (child);
		child = _tmp8_;
	}
	_g_object_unref0 (child);
}

static gboolean
proton_plus_widgets_games_game_list_controller_box_focus_sort_header (ProtonPlusWidgetsGamesGameListControllerBox* self,
                                                                      gint index)
{
	gboolean _tmp0_ = FALSE;
	GeeArrayList* _tmp4_;
	gpointer _tmp5_;
	ProtonPlusWidgetsGamesGameSortHeaderTarget* _tmp6_;
	GeeArrayList* _tmp7_;
	gpointer _tmp8_;
	ProtonPlusWidgetsGamesGameSortHeaderTarget* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (index < 0) {
		_tmp0_ = TRUE;
	} else {
		GeeArrayList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		_tmp1_ = self->priv->sort_headers;
		_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp0_ = index >= _tmp3_;
	}
	if (_tmp0_) {
		result = FALSE;
		return result;
	}
	proton_plus_widgets_games_game_list_controller_box_clear_sort_header_focus (self);
	self->priv->active_sort_header_index = index;
	_tmp4_ = self->priv->sort_headers;
	_tmp5_ = gee_abstract_list_get ((GeeAbstractList*) _tmp4_, index);
	_tmp6_ = (ProtonPlusWidgetsGamesGameSortHeaderTarget*) _tmp5_;
	proton_plus_widgets_games_game_sort_header_target_set_controller_focus (_tmp6_, TRUE);
	_g_object_unref0 (_tmp6_);
	_tmp7_ = self->priv->sort_headers;
	_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, index);
	_tmp9_ = (ProtonPlusWidgetsGamesGameSortHeaderTarget*) _tmp8_;
	_tmp10_ = proton_plus_widgets_games_game_sort_header_target_get_title (_tmp9_);
	_tmp11_ = _tmp10_;
	gtk_accessible_update_property ((GtkAccessible*) self, GTK_ACCESSIBLE_PROPERTY_LABEL, _tmp11_, -1, -1);
	_g_free0 (_tmp11_);
	_g_object_unref0 (_tmp9_);
	if (gtk_widget_grab_focus ((GtkWidget*) self)) {
		result = TRUE;
		return result;
	}
	proton_plus_widgets_games_game_list_controller_box_clear_sort_header_focus (self);
	result = FALSE;
	return result;
}

static void
proton_plus_widgets_games_game_list_controller_box_clear_sort_header_focus (ProtonPlusWidgetsGamesGameListControllerBox* self)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	if (self->priv->active_sort_header_index >= 0) {
		GeeArrayList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		_tmp1_ = self->priv->sort_headers;
		_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp0_ = self->priv->active_sort_header_index < _tmp3_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GeeArrayList* _tmp4_;
		gpointer _tmp5_;
		ProtonPlusWidgetsGamesGameSortHeaderTarget* _tmp6_;
		_tmp4_ = self->priv->sort_headers;
		_tmp5_ = gee_abstract_list_get ((GeeAbstractList*) _tmp4_, self->priv->active_sort_header_index);
		_tmp6_ = (ProtonPlusWidgetsGamesGameSortHeaderTarget*) _tmp5_;
		proton_plus_widgets_games_game_sort_header_target_set_controller_focus (_tmp6_, FALSE);
		_g_object_unref0 (_tmp6_);
	}
	self->priv->active_sort_header_index = -1;
	gtk_accessible_reset_property ((GtkAccessible*) self, GTK_ACCESSIBLE_PROPERTY_LABEL);
}

static gboolean
proton_plus_widgets_games_game_list_controller_box_is_inside_widget (ProtonPlusWidgetsGamesGameListControllerBox* self,
                                                                     GtkWidget* focused,
                                                                     GtkWidget* ancestor)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (focused != NULL, FALSE);
	g_return_val_if_fail (ancestor != NULL, FALSE);
	if (focused == ancestor) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = gtk_widget_is_ancestor (focused, ancestor);
	}
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_games_game_list_controller_box_real_dispose (GObject* base)
{
	ProtonPlusWidgetsGamesGameListControllerBox * self;
	GeeArrayList* _tmp10_;
	self = (ProtonPlusWidgetsGamesGameListControllerBox*) base;
	proton_plus_widgets_games_game_list_controller_box_clear_sort_header_focus (self);
	if (self->priv->sort_header_idle_id != ((guint) 0)) {
		g_source_remove (self->priv->sort_header_idle_id);
		self->priv->sort_header_idle_id = (guint) 0;
	}
	if (self->priv->sort_header_map_handler != ((gulong) 0)) {
		GtkColumnView* _tmp0_;
		_tmp0_ = self->priv->wide_view;
		g_signal_handler_disconnect ((GObject*) _tmp0_, self->priv->sort_header_map_handler);
		self->priv->sort_header_map_handler = (gulong) 0;
	}
	{
		GeeArrayList* _target_list = NULL;
		GeeArrayList* _tmp1_;
		gint _target_size = 0;
		GeeArrayList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _target_index = 0;
		_tmp1_ = self->priv->sort_headers;
		_target_list = _tmp1_;
		_tmp2_ = _target_list;
		_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_target_size = _tmp4_;
		_target_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			ProtonPlusWidgetsGamesGameSortHeaderTarget* target = NULL;
			GeeArrayList* _tmp7_;
			gpointer _tmp8_;
			ProtonPlusWidgetsGamesGameSortHeaderTarget* _tmp9_;
			_target_index = _target_index + 1;
			_tmp5_ = _target_index;
			_tmp6_ = _target_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _target_list;
			_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, _target_index);
			target = (ProtonPlusWidgetsGamesGameSortHeaderTarget*) _tmp8_;
			_tmp9_ = target;
			proton_plus_widgets_games_game_sort_header_target_detach (_tmp9_);
			_g_object_unref0 (target);
		}
	}
	_tmp10_ = self->priv->sort_headers;
	gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp10_);
	G_OBJECT_CLASS (proton_plus_widgets_games_game_list_controller_box_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_box_get_type (), GtkBox));
}

static void
proton_plus_widgets_games_game_list_controller_box_class_init (ProtonPlusWidgetsGamesGameListControllerBoxClass * klass,
                                                               gpointer klass_data)
{
	proton_plus_widgets_games_game_list_controller_box_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsGamesGameListControllerBox_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) proton_plus_widgets_games_game_list_controller_box_real_dispose;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_games_game_list_controller_box_finalize;
}

static void
proton_plus_widgets_games_game_list_controller_box_proton_plus_utils_controller_directional_focus_interface_init (ProtonPlusUtilsControllerDirectionalFocusIface * iface,
                                                                                                                  gpointer iface_data)
{
	proton_plus_widgets_games_game_list_controller_box_proton_plus_utils_controller_directional_focus_parent_iface = g_type_interface_peek_parent (iface);
	iface->controller_focus_direction = (gboolean (*) (ProtonPlusUtilsControllerDirectionalFocus*, GObject*, ProtonPlusUtilsControllerNavigationDirection)) proton_plus_widgets_games_game_list_controller_box_real_controller_focus_direction;
}

static void
proton_plus_widgets_games_game_list_controller_box_proton_plus_utils_controller_activation_redirect_interface_init (ProtonPlusUtilsControllerActivationRedirectIface * iface,
                                                                                                                    gpointer iface_data)
{
	proton_plus_widgets_games_game_list_controller_box_proton_plus_utils_controller_activation_redirect_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_controller_activation_target = (GObject* (*) (ProtonPlusUtilsControllerActivationRedirect*, GObject*)) proton_plus_widgets_games_game_list_controller_box_real_get_controller_activation_target;
}

static void
proton_plus_widgets_games_game_list_controller_box_instance_init (ProtonPlusWidgetsGamesGameListControllerBox * self,
                                                                  gpointer klass)
{
	self->priv = proton_plus_widgets_games_game_list_controller_box_get_instance_private (self);
	self->priv->sort_header_idle_id = (guint) 0;
	self->priv->sort_header_attempt = 0;
	self->priv->active_sort_header_index = -1;
}

static void
proton_plus_widgets_games_game_list_controller_box_finalize (GObject * obj)
{
	ProtonPlusWidgetsGamesGameListControllerBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_CONTROLLER_BOX, ProtonPlusWidgetsGamesGameListControllerBox);
	_g_object_unref0 (self->priv->toolbar);
	_g_object_unref0 (self->priv->wide_view);
	_g_object_unref0 (self->priv->narrow_view);
	_g_object_unref0 (self->priv->sort_headers);
	_g_object_unref0 (self->priv->sort_header_map_target);
	G_OBJECT_CLASS (proton_plus_widgets_games_game_list_controller_box_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_games_game_list_controller_box_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsGamesGameListControllerBoxClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_games_game_list_controller_box_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsGamesGameListControllerBox), 0, (GInstanceInitFunc) proton_plus_widgets_games_game_list_controller_box_instance_init, NULL };
	static const GInterfaceInfo proton_plus_utils_controller_directional_focus_info = { (GInterfaceInitFunc) proton_plus_widgets_games_game_list_controller_box_proton_plus_utils_controller_directional_focus_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo proton_plus_utils_controller_activation_redirect_info = { (GInterfaceInitFunc) proton_plus_widgets_games_game_list_controller_box_proton_plus_utils_controller_activation_redirect_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType proton_plus_widgets_games_game_list_controller_box_type_id;
	proton_plus_widgets_games_game_list_controller_box_type_id = g_type_register_static (gtk_box_get_type (), "ProtonPlusWidgetsGamesGameListControllerBox", &g_define_type_info, 0);
	g_type_add_interface_static (proton_plus_widgets_games_game_list_controller_box_type_id, PROTON_PLUS_UTILS_TYPE_CONTROLLER_DIRECTIONAL_FOCUS, &proton_plus_utils_controller_directional_focus_info);
	g_type_add_interface_static (proton_plus_widgets_games_game_list_controller_box_type_id, PROTON_PLUS_UTILS_TYPE_CONTROLLER_ACTIVATION_REDIRECT, &proton_plus_utils_controller_activation_redirect_info);
	ProtonPlusWidgetsGamesGameListControllerBox_private_offset = g_type_add_instance_private (proton_plus_widgets_games_game_list_controller_box_type_id, sizeof (ProtonPlusWidgetsGamesGameListControllerBoxPrivate));
	return proton_plus_widgets_games_game_list_controller_box_type_id;
}

GType
proton_plus_widgets_games_game_list_controller_box_get_type (void)
{
	static volatile gsize proton_plus_widgets_games_game_list_controller_box_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_games_game_list_controller_box_type_id__once)) {
		GType proton_plus_widgets_games_game_list_controller_box_type_id;
		proton_plus_widgets_games_game_list_controller_box_type_id = proton_plus_widgets_games_game_list_controller_box_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_games_game_list_controller_box_type_id__once, proton_plus_widgets_games_game_list_controller_box_type_id);
	}
	return proton_plus_widgets_games_game_list_controller_box_type_id__once;
}

static inline gpointer
proton_plus_widgets_games_box_get_instance_private (ProtonPlusWidgetsGamesBox* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsGamesBox_private_offset);
}

static void
_proton_plus_widgets_games_box_activate_game_row_gtk_column_view_activate (GtkColumnView* _sender,
                                                                           guint position,
                                                                           gpointer self)
{
	proton_plus_widgets_games_box_activate_game_row ((ProtonPlusWidgetsGamesBox*) self, position);
}

static GtkColumnView*
proton_plus_widgets_games_box_build_wide_view (ProtonPlusWidgetsGamesBox* self)
{
	GtkColumnView* view = NULL;
	ProtonPlusWidgetsGamesGameCollection* _tmp0_;
	GtkMultiSelection* _tmp1_;
	GtkMultiSelection* _tmp2_;
	GtkSelectionModel* _tmp3_;
	GtkColumnView* _tmp4_ = NULL;
	GtkColumnView* _tmp5_;
	GtkColumnView* _tmp6_;
	GtkColumnViewColumn* selection_column = NULL;
	GtkSignalListItemFactory* _tmp7_;
	GtkColumnViewColumn* _tmp8_;
	GtkColumnViewColumn* _tmp9_;
	GtkColumnView* _tmp10_;
	GtkColumnViewColumn* _tmp11_;
	GtkColumnViewColumn* title_column = NULL;
	GtkSignalListItemFactory* _tmp12_;
	GtkColumnViewColumn* _tmp13_;
	GtkColumnViewColumn* _tmp14_;
	GtkColumnViewColumn* _tmp15_;
	ProtonPlusWidgetsGamesGameCollection* _tmp16_;
	GtkStringSorter* _tmp17_;
	GtkStringSorter* _tmp18_;
	GtkColumnView* _tmp19_;
	GtkColumnViewColumn* _tmp20_;
	GtkColumnViewColumn* prefix_column = NULL;
	GtkSignalListItemFactory* _tmp21_;
	GtkColumnViewColumn* _tmp22_;
	GtkColumnViewColumn* _tmp23_;
	GtkColumnViewColumn* _tmp24_;
	ProtonPlusWidgetsGamesGameCollection* _tmp25_;
	GtkNumericSorter* _tmp26_;
	GtkNumericSorter* _tmp27_;
	GtkColumnView* _tmp28_;
	GtkColumnViewColumn* _tmp29_;
	GtkColumnViewColumn* tool_column = NULL;
	GtkSignalListItemFactory* _tmp30_;
	GtkColumnViewColumn* _tmp31_;
	GtkColumnViewColumn* _tmp32_;
	GtkColumnViewColumn* _tmp33_;
	ProtonPlusWidgetsGamesGameCollection* _tmp34_;
	GtkSorter* _tmp35_;
	GtkSorter* _tmp36_;
	GtkColumnView* _tmp37_;
	GtkColumnViewColumn* _tmp38_;
	GtkSignalListItemFactory* _tmp39_;
	GtkColumnViewColumn* _tmp40_;
	GtkColumnViewColumn* _tmp41_;
	GtkColumnView* _tmp42_;
	GtkColumnViewColumn* _tmp43_;
	GtkColumnView* _tmp44_;
	GtkColumnViewColumn* _tmp45_;
	GtkSorter* view_sorter = NULL;
	GtkColumnView* _tmp46_;
	GtkSorter* _tmp47_;
	GtkSorter* _tmp48_;
	GtkSorter* _tmp49_;
	GtkColumnView* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->games;
	_tmp1_ = proton_plus_widgets_games_game_collection_get_selection_model (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 ((GtkSelectionModel*) _tmp2_);
	_tmp4_ = (GtkColumnView*) gtk_column_view_new (_tmp3_);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp4_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp4_, TRUE);
	gtk_column_view_set_show_column_separators (_tmp4_, FALSE);
	gtk_column_view_set_show_row_separators (_tmp4_, TRUE);
	gtk_column_view_set_single_click_activate (_tmp4_, TRUE);
	g_object_ref_sink (_tmp4_);
	view = _tmp4_;
	_tmp5_ = view;
	gtk_widget_add_css_class ((GtkWidget*) _tmp5_, "list-content");
	_tmp6_ = view;
	g_signal_connect_object (_tmp6_, "activate", (GCallback) _proton_plus_widgets_games_box_activate_game_row_gtk_column_view_activate, self, 0);
	_tmp7_ = proton_plus_widgets_games_box_create_selection_factory (self);
	_tmp8_ = gtk_column_view_column_new ("", (GtkListItemFactory*) _tmp7_);
	selection_column = _tmp8_;
	_tmp9_ = selection_column;
	gtk_column_view_column_set_expand (_tmp9_, FALSE);
	_tmp10_ = view;
	_tmp11_ = selection_column;
	gtk_column_view_append_column (_tmp10_, _tmp11_);
	_tmp12_ = proton_plus_widgets_games_box_create_title_factory (self);
	_tmp13_ = gtk_column_view_column_new (_ ("Games"), (GtkListItemFactory*) _tmp12_);
	title_column = _tmp13_;
	_tmp14_ = title_column;
	gtk_column_view_column_set_expand (_tmp14_, FALSE);
	_tmp15_ = title_column;
	_tmp16_ = self->priv->games;
	_tmp17_ = proton_plus_widgets_games_game_collection_get_name_sorter (_tmp16_);
	_tmp18_ = _tmp17_;
	gtk_column_view_column_set_sorter (_tmp15_, (GtkSorter*) _tmp18_);
	_tmp19_ = view;
	_tmp20_ = title_column;
	gtk_column_view_append_column (_tmp19_, _tmp20_);
	_tmp21_ = proton_plus_widgets_games_box_create_text_factory (self, PROTON_PLUS_WIDGETS_GAMES_GAME_TEXT_CELL_KIND_PREFIX);
	_tmp22_ = gtk_column_view_column_new (_ ("Prefix"), (GtkListItemFactory*) _tmp21_);
	prefix_column = _tmp22_;
	_tmp23_ = prefix_column;
	gtk_column_view_column_set_expand (_tmp23_, FALSE);
	_tmp24_ = prefix_column;
	_tmp25_ = self->priv->games;
	_tmp26_ = proton_plus_widgets_games_game_collection_get_prefix_sorter (_tmp25_);
	_tmp27_ = _tmp26_;
	gtk_column_view_column_set_sorter (_tmp24_, (GtkSorter*) _tmp27_);
	_tmp28_ = view;
	_tmp29_ = prefix_column;
	gtk_column_view_append_column (_tmp28_, _tmp29_);
	_tmp30_ = proton_plus_widgets_games_box_create_text_factory (self, PROTON_PLUS_WIDGETS_GAMES_GAME_TEXT_CELL_KIND_TOOL);
	_tmp31_ = gtk_column_view_column_new (_ ("Tool"), (GtkListItemFactory*) _tmp30_);
	tool_column = _tmp31_;
	_tmp32_ = tool_column;
	gtk_column_view_column_set_expand (_tmp32_, TRUE);
	_tmp33_ = tool_column;
	_tmp34_ = self->priv->games;
	_tmp35_ = proton_plus_widgets_games_game_collection_get_tool_sorter (_tmp34_);
	_tmp36_ = _tmp35_;
	gtk_column_view_column_set_sorter (_tmp33_, _tmp36_);
	_tmp37_ = view;
	_tmp38_ = tool_column;
	gtk_column_view_append_column (_tmp37_, _tmp38_);
	_tmp39_ = proton_plus_widgets_games_box_create_actions_factory (self);
	_tmp40_ = gtk_column_view_column_new (_ ("Actions"), (GtkListItemFactory*) _tmp39_);
	_g_object_unref0 (self->priv->actions_column);
	self->priv->actions_column = _tmp40_;
	_tmp41_ = self->priv->actions_column;
	gtk_column_view_column_set_expand (_tmp41_, FALSE);
	_tmp42_ = view;
	_tmp43_ = self->priv->actions_column;
	gtk_column_view_append_column (_tmp42_, _tmp43_);
	_tmp44_ = view;
	_tmp45_ = title_column;
	gtk_column_view_sort_by_column (_tmp44_, _tmp45_, GTK_SORT_ASCENDING);
	_tmp46_ = view;
	_tmp47_ = gtk_column_view_get_sorter (_tmp46_);
	_tmp48_ = _g_object_ref0 (_tmp47_);
	view_sorter = _tmp48_;
	_tmp49_ = view_sorter;
	if (_tmp49_ != NULL) {
		ProtonPlusWidgetsGamesGameCollection* _tmp50_;
		GtkSorter* _tmp51_;
		_tmp50_ = self->priv->games;
		_tmp51_ = view_sorter;
		proton_plus_widgets_games_game_collection_set_sorter (_tmp50_, G_TYPE_CHECK_INSTANCE_CAST (_tmp51_, gtk_sorter_get_type (), GtkSorter));
	}
	result = view;
	_g_object_unref0 (view_sorter);
	_g_object_unref0 (tool_column);
	_g_object_unref0 (prefix_column);
	_g_object_unref0 (title_column);
	_g_object_unref0 (selection_column);
	return result;
}

static gboolean
_proton_plus_widgets_games_box_focus_narrow_relative_proton_plus_widgets_games_game_vertical_focus_request (ProtonPlusWidgetsGamesGameListItem* item,
                                                                                                            gint delta,
                                                                                                            ProtonPlusWidgetsGamesGameFocusLane lane,
                                                                                                            gpointer self)
{
	gboolean result;
	result = proton_plus_widgets_games_box_focus_narrow_relative ((ProtonPlusWidgetsGamesBox*) self, item, delta, lane);
	return result;
}

static void
_proton_plus_widgets_games_box_activate_game_item_proton_plus_widgets_games_game_activation_request (ProtonPlusWidgetsGamesGameListItem* item,
                                                                                                     gpointer self)
{
	proton_plus_widgets_games_box_activate_game_item ((ProtonPlusWidgetsGamesBox*) self, item);
}

static void
__lambda216_ (ProtonPlusWidgetsGamesBox* self,
              GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	ProtonPlusWidgetsGamesGameRow* row = NULL;
	ProtonPlusWidgetsGamesGameRow* _tmp1_;
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (object, gtk_list_item_get_type (), GtkListItem));
	list_item = _tmp0_;
	_tmp1_ = proton_plus_widgets_games_game_row_new (_proton_plus_widgets_games_box_focus_narrow_relative_proton_plus_widgets_games_game_vertical_focus_request, self, _proton_plus_widgets_games_box_activate_game_item_proton_plus_widgets_games_game_activation_request, self);
	g_object_ref_sink (_tmp1_);
	row = _tmp1_;
	gtk_list_item_set_activatable (list_item, TRUE);
	gtk_list_item_set_focusable (list_item, FALSE);
	gtk_list_item_set_selectable (list_item, FALSE);
	gtk_list_item_set_child (list_item, (GtkWidget*) row);
	_g_object_unref0 (row);
	_g_object_unref0 (list_item);
}

static void
___lambda216__gtk_signal_list_item_factory_setup (GtkSignalListItemFactory* _sender,
                                                  GObject* object,
                                                  gpointer self)
{
	__lambda216_ ((ProtonPlusWidgetsGamesBox*) self, object);
}

static void
__lambda217_ (ProtonPlusWidgetsGamesBox* self,
              GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	ProtonPlusWidgetsGamesGameListItem* item = NULL;
	GtkListItem* _tmp1_;
	GObject* _tmp2_;
	ProtonPlusWidgetsGamesGameListItem* _tmp3_;
	ProtonPlusWidgetsGamesGameRow* row = NULL;
	GtkListItem* _tmp4_;
	GtkWidget* _tmp5_;
	ProtonPlusWidgetsGamesGameRow* _tmp6_;
	gboolean _tmp7_ = FALSE;
	ProtonPlusWidgetsGamesGameListItem* _tmp8_;
	ProtonPlusWidgetsGamesGameRow* _tmp10_;
	ProtonPlusWidgetsGamesGameListItem* _tmp11_;
	ProtonPlusWidgetsGamesGameRow* _tmp12_;
	GeeHashMap* _tmp13_;
	ProtonPlusWidgetsGamesGameListItem* _tmp14_;
	ProtonPlusWidgetsGamesGameRow* _tmp15_;
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (object, gtk_list_item_get_type (), GtkListItem));
	list_item = _tmp0_;
	_tmp1_ = list_item;
	_tmp2_ = gtk_list_item_get_item (_tmp1_);
	_tmp3_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_LIST_ITEM (_tmp2_) ? ((ProtonPlusWidgetsGamesGameListItem*) _tmp2_) : NULL);
	item = _tmp3_;
	_tmp4_ = list_item;
	_tmp5_ = gtk_list_item_get_child (_tmp4_);
	_tmp6_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_ROW (_tmp5_) ? ((ProtonPlusWidgetsGamesGameRow*) _tmp5_) : NULL);
	row = _tmp6_;
	_tmp8_ = item;
	if (_tmp8_ == NULL) {
		_tmp7_ = TRUE;
	} else {
		ProtonPlusWidgetsGamesGameRow* _tmp9_;
		_tmp9_ = row;
		_tmp7_ = _tmp9_ == NULL;
	}
	if (_tmp7_) {
		_g_object_unref0 (row);
		_g_object_unref0 (item);
		_g_object_unref0 (list_item);
		return;
	}
	_tmp10_ = row;
	_tmp11_ = item;
	proton_plus_widgets_games_game_row_bind (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_ROW, ProtonPlusWidgetsGamesGameRow), G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
	_tmp12_ = row;
	proton_plus_widgets_games_game_row_set_selection_mode (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_ROW, ProtonPlusWidgetsGamesGameRow), self->priv->selection_mode_active);
	_tmp13_ = self->priv->narrow_rows;
	_tmp14_ = item;
	_tmp15_ = row;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp13_, G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem), G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_ROW, ProtonPlusWidgetsGamesGameRow));
	_g_object_unref0 (row);
	_g_object_unref0 (item);
	_g_object_unref0 (list_item);
}

static void
___lambda217__gtk_signal_list_item_factory_bind (GtkSignalListItemFactory* _sender,
                                                 GObject* object,
                                                 gpointer self)
{
	__lambda217_ ((ProtonPlusWidgetsGamesBox*) self, object);
}

static void
__lambda218_ (ProtonPlusWidgetsGamesBox* self,
              GObject* object)
{
	ProtonPlusWidgetsGamesGameRow* row = NULL;
	GtkWidget* _tmp0_;
	ProtonPlusWidgetsGamesGameRow* _tmp1_;
	ProtonPlusWidgetsGamesGameRow* _tmp2_;
	ProtonPlusWidgetsGamesGameListItem* item = NULL;
	ProtonPlusWidgetsGamesGameRow* _tmp3_;
	ProtonPlusWidgetsGamesGameListItem* _tmp4_;
	gboolean _tmp5_ = FALSE;
	ProtonPlusWidgetsGamesGameListItem* _tmp6_;
	ProtonPlusWidgetsGamesGameRow* _tmp14_;
	g_return_if_fail (object != NULL);
	_tmp0_ = gtk_list_item_get_child (G_TYPE_CHECK_INSTANCE_CAST (object, gtk_list_item_get_type (), GtkListItem));
	_tmp1_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_ROW (_tmp0_) ? ((ProtonPlusWidgetsGamesGameRow*) _tmp0_) : NULL);
	row = _tmp1_;
	_tmp2_ = row;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (row);
		return;
	}
	_tmp3_ = row;
	_tmp4_ = proton_plus_widgets_games_game_row_get_item (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_ROW, ProtonPlusWidgetsGamesGameRow));
	item = _tmp4_;
	_tmp6_ = item;
	if (_tmp6_ != NULL) {
		GeeHashMap* _tmp7_;
		ProtonPlusWidgetsGamesGameListItem* _tmp8_;
		gpointer _tmp9_;
		ProtonPlusWidgetsGamesGameRow* _tmp10_;
		ProtonPlusWidgetsGamesGameRow* _tmp11_;
		_tmp7_ = self->priv->narrow_rows;
		_tmp8_ = item;
		_tmp9_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp7_, G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
		_tmp10_ = (ProtonPlusWidgetsGamesGameRow*) _tmp9_;
		_tmp11_ = row;
		_tmp5_ = _tmp10_ == _tmp11_;
		_g_object_unref0 (_tmp10_);
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		GeeHashMap* _tmp12_;
		ProtonPlusWidgetsGamesGameListItem* _tmp13_;
		_tmp12_ = self->priv->narrow_rows;
		_tmp13_ = item;
		gee_abstract_map_unset ((GeeAbstractMap*) _tmp12_, G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem), NULL);
	}
	_tmp14_ = row;
	proton_plus_widgets_games_game_row_unbind (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_ROW, ProtonPlusWidgetsGamesGameRow));
	_g_object_unref0 (item);
	_g_object_unref0 (row);
}

static void
___lambda218__gtk_signal_list_item_factory_unbind (GtkSignalListItemFactory* _sender,
                                                   GObject* object,
                                                   gpointer self)
{
	__lambda218_ ((ProtonPlusWidgetsGamesBox*) self, object);
}

static void
__lambda219_ (ProtonPlusWidgetsGamesBox* self,
              GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	ProtonPlusWidgetsGamesGameRow* row = NULL;
	GtkListItem* _tmp1_;
	GtkWidget* _tmp2_;
	ProtonPlusWidgetsGamesGameRow* _tmp3_;
	ProtonPlusWidgetsGamesGameRow* _tmp4_ = NULL;
	ProtonPlusWidgetsGamesGameRow* _tmp5_;
	GtkListItem* _tmp6_;
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (object, gtk_list_item_get_type (), GtkListItem));
	list_item = _tmp0_;
	_tmp1_ = list_item;
	_tmp2_ = gtk_list_item_get_child (_tmp1_);
	_tmp3_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_ROW (_tmp2_) ? ((ProtonPlusWidgetsGamesGameRow*) _tmp2_) : NULL);
	row = _tmp3_;
	_tmp5_ = row;
	_tmp4_ = _tmp5_;
	if (_tmp4_ != NULL) {
		proton_plus_widgets_games_game_row_unbind (_tmp4_);
	}
	_tmp6_ = list_item;
	gtk_list_item_set_child (_tmp6_, NULL);
	_g_object_unref0 (row);
	_g_object_unref0 (list_item);
}

static void
___lambda219__gtk_signal_list_item_factory_teardown (GtkSignalListItemFactory* _sender,
                                                     GObject* object,
                                                     gpointer self)
{
	__lambda219_ ((ProtonPlusWidgetsGamesBox*) self, object);
}

static void
_proton_plus_widgets_games_box_activate_game_row_gtk_list_view_activate (GtkListView* _sender,
                                                                         guint position,
                                                                         gpointer self)
{
	proton_plus_widgets_games_box_activate_game_row ((ProtonPlusWidgetsGamesBox*) self, position);
}

static GtkListView*
proton_plus_widgets_games_box_build_narrow_view (ProtonPlusWidgetsGamesBox* self)
{
	GtkSignalListItemFactory* factory = NULL;
	GtkSignalListItemFactory* _tmp0_;
	GtkListView* view = NULL;
	ProtonPlusWidgetsGamesGameCollection* _tmp1_;
	GtkMultiSelection* _tmp2_;
	GtkMultiSelection* _tmp3_;
	GtkSelectionModel* _tmp4_;
	GtkListItemFactory* _tmp5_;
	GtkListView* _tmp6_ = NULL;
	GtkListView* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkSignalListItemFactory*) gtk_signal_list_item_factory_new ();
	factory = _tmp0_;
	g_signal_connect_object (factory, "setup", (GCallback) ___lambda216__gtk_signal_list_item_factory_setup, self, 0);
	g_signal_connect_object (factory, "bind", (GCallback) ___lambda217__gtk_signal_list_item_factory_bind, self, 0);
	g_signal_connect_object (factory, "unbind", (GCallback) ___lambda218__gtk_signal_list_item_factory_unbind, self, 0);
	g_signal_connect_object (factory, "teardown", (GCallback) ___lambda219__gtk_signal_list_item_factory_teardown, self, 0);
	_tmp1_ = self->priv->games;
	_tmp2_ = proton_plus_widgets_games_game_collection_get_selection_model (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _g_object_ref0 ((GtkSelectionModel*) _tmp3_);
	_tmp5_ = _g_object_ref0 ((GtkListItemFactory*) factory);
	_tmp6_ = (GtkListView*) gtk_list_view_new (_tmp4_, _tmp5_);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp6_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp6_, TRUE);
	gtk_list_view_set_single_click_activate (_tmp6_, TRUE);
	g_object_ref_sink (_tmp6_);
	view = _tmp6_;
	gtk_widget_add_css_class ((GtkWidget*) view, "boxed-list");
	gtk_widget_add_css_class ((GtkWidget*) view, "list-content");
	g_signal_connect_object (view, "activate", (GCallback) _proton_plus_widgets_games_box_activate_game_row_gtk_list_view_activate, self, 0);
	result = view;
	_g_object_unref0 (factory);
	return result;
}

static GtkScrolledWindow*
proton_plus_widgets_games_box_create_collection_scroller (ProtonPlusWidgetsGamesBox* self,
                                                          GtkWidget* view)
{
	GtkWidget* _tmp0_;
	GtkScrolledWindow* _tmp1_ = NULL;
	GtkScrolledWindow* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (view != NULL, NULL);
	_tmp0_ = _g_object_ref0 (view);
	_tmp1_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp1_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp1_, TRUE);
	g_object_set (_tmp1_, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	g_object_set (_tmp1_, "vscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
	gtk_scrolled_window_set_child (_tmp1_, _tmp0_);
	_g_object_unref0 (_tmp0_);
	g_object_ref_sink (_tmp1_);
	result = _tmp1_;
	return result;
}

static gboolean
_proton_plus_widgets_games_box_focus_wide_relative_proton_plus_widgets_games_game_vertical_focus_request (ProtonPlusWidgetsGamesGameListItem* item,
                                                                                                          gint delta,
                                                                                                          ProtonPlusWidgetsGamesGameFocusLane lane,
                                                                                                          gpointer self)
{
	gboolean result;
	result = proton_plus_widgets_games_box_focus_wide_relative ((ProtonPlusWidgetsGamesBox*) self, item, delta, lane);
	return result;
}

static gboolean
_proton_plus_widgets_games_box_focus_wide_title_proton_plus_widgets_games_game_peer_focus_request (ProtonPlusWidgetsGamesGameListItem* item,
                                                                                                   gpointer self)
{
	gboolean result;
	result = proton_plus_widgets_games_box_focus_wide_title ((ProtonPlusWidgetsGamesBox*) self, item);
	return result;
}

static void
__lambda193_ (ProtonPlusWidgetsGamesBox* self,
              GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	ProtonPlusWidgetsGamesGameSelectionCell* _tmp1_;
	ProtonPlusWidgetsGamesGameSelectionCell* _tmp2_;
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (object, gtk_list_item_get_type (), GtkListItem));
	list_item = _tmp0_;
	gtk_list_item_set_activatable (list_item, TRUE);
	gtk_list_item_set_focusable (list_item, FALSE);
	gtk_list_item_set_selectable (list_item, FALSE);
	_tmp1_ = proton_plus_widgets_games_game_selection_cell_new (_proton_plus_widgets_games_box_focus_wide_relative_proton_plus_widgets_games_game_vertical_focus_request, self, _proton_plus_widgets_games_box_focus_wide_title_proton_plus_widgets_games_game_peer_focus_request, self);
	g_object_ref_sink (_tmp1_);
	_tmp2_ = _tmp1_;
	gtk_list_item_set_child (list_item, (GtkWidget*) _tmp2_);
	_g_object_unref0 (_tmp2_);
	_g_object_unref0 (list_item);
}

static void
___lambda193__gtk_signal_list_item_factory_setup (GtkSignalListItemFactory* _sender,
                                                  GObject* object,
                                                  gpointer self)
{
	__lambda193_ ((ProtonPlusWidgetsGamesBox*) self, object);
}

static void
__lambda201_ (ProtonPlusWidgetsGamesBox* self,
              GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	ProtonPlusWidgetsGamesGameListItem* item = NULL;
	GtkListItem* _tmp1_;
	GObject* _tmp2_;
	ProtonPlusWidgetsGamesGameListItem* _tmp3_;
	ProtonPlusWidgetsGamesGameSelectionCell* cell = NULL;
	GtkListItem* _tmp4_;
	GtkWidget* _tmp5_;
	ProtonPlusWidgetsGamesGameSelectionCell* _tmp6_;
	gboolean _tmp7_ = FALSE;
	ProtonPlusWidgetsGamesGameListItem* _tmp8_;
	ProtonPlusWidgetsGamesGameSelectionCell* _tmp10_;
	ProtonPlusWidgetsGamesGameListItem* _tmp11_;
	ProtonPlusWidgetsGamesGameSelectionCell* _tmp12_;
	GeeHashMap* _tmp13_;
	ProtonPlusWidgetsGamesGameListItem* _tmp14_;
	ProtonPlusWidgetsGamesGameSelectionCell* _tmp15_;
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (object, gtk_list_item_get_type (), GtkListItem));
	list_item = _tmp0_;
	_tmp1_ = list_item;
	_tmp2_ = gtk_list_item_get_item (_tmp1_);
	_tmp3_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_LIST_ITEM (_tmp2_) ? ((ProtonPlusWidgetsGamesGameListItem*) _tmp2_) : NULL);
	item = _tmp3_;
	_tmp4_ = list_item;
	_tmp5_ = gtk_list_item_get_child (_tmp4_);
	_tmp6_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_SELECTION_CELL (_tmp5_) ? ((ProtonPlusWidgetsGamesGameSelectionCell*) _tmp5_) : NULL);
	cell = _tmp6_;
	_tmp8_ = item;
	if (_tmp8_ == NULL) {
		_tmp7_ = TRUE;
	} else {
		ProtonPlusWidgetsGamesGameSelectionCell* _tmp9_;
		_tmp9_ = cell;
		_tmp7_ = _tmp9_ == NULL;
	}
	if (_tmp7_) {
		_g_object_unref0 (cell);
		_g_object_unref0 (item);
		_g_object_unref0 (list_item);
		return;
	}
	_tmp10_ = cell;
	_tmp11_ = item;
	proton_plus_widgets_games_game_selection_cell_bind (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SELECTION_CELL, ProtonPlusWidgetsGamesGameSelectionCell), G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
	_tmp12_ = cell;
	proton_plus_widgets_games_game_selection_cell_set_selection_mode (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SELECTION_CELL, ProtonPlusWidgetsGamesGameSelectionCell), self->priv->selection_mode_active);
	_tmp13_ = self->priv->wide_selection_cells;
	_tmp14_ = item;
	_tmp15_ = cell;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp13_, G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem), G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SELECTION_CELL, ProtonPlusWidgetsGamesGameSelectionCell));
	_g_object_unref0 (cell);
	_g_object_unref0 (item);
	_g_object_unref0 (list_item);
}

static void
___lambda201__gtk_signal_list_item_factory_bind (GtkSignalListItemFactory* _sender,
                                                 GObject* object,
                                                 gpointer self)
{
	__lambda201_ ((ProtonPlusWidgetsGamesBox*) self, object);
}

static void
__lambda202_ (ProtonPlusWidgetsGamesBox* self,
              GObject* object)
{
	ProtonPlusWidgetsGamesGameSelectionCell* cell = NULL;
	GtkWidget* _tmp0_;
	ProtonPlusWidgetsGamesGameSelectionCell* _tmp1_;
	ProtonPlusWidgetsGamesGameSelectionCell* _tmp2_;
	ProtonPlusWidgetsGamesGameListItem* item = NULL;
	ProtonPlusWidgetsGamesGameSelectionCell* _tmp3_;
	ProtonPlusWidgetsGamesGameListItem* _tmp4_;
	gboolean _tmp5_ = FALSE;
	ProtonPlusWidgetsGamesGameListItem* _tmp6_;
	ProtonPlusWidgetsGamesGameSelectionCell* _tmp14_;
	g_return_if_fail (object != NULL);
	_tmp0_ = gtk_list_item_get_child (G_TYPE_CHECK_INSTANCE_CAST (object, gtk_list_item_get_type (), GtkListItem));
	_tmp1_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_SELECTION_CELL (_tmp0_) ? ((ProtonPlusWidgetsGamesGameSelectionCell*) _tmp0_) : NULL);
	cell = _tmp1_;
	_tmp2_ = cell;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (cell);
		return;
	}
	_tmp3_ = cell;
	_tmp4_ = proton_plus_widgets_games_game_selection_cell_get_item (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SELECTION_CELL, ProtonPlusWidgetsGamesGameSelectionCell));
	item = _tmp4_;
	_tmp6_ = item;
	if (_tmp6_ != NULL) {
		GeeHashMap* _tmp7_;
		ProtonPlusWidgetsGamesGameListItem* _tmp8_;
		gpointer _tmp9_;
		ProtonPlusWidgetsGamesGameSelectionCell* _tmp10_;
		ProtonPlusWidgetsGamesGameSelectionCell* _tmp11_;
		_tmp7_ = self->priv->wide_selection_cells;
		_tmp8_ = item;
		_tmp9_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp7_, G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
		_tmp10_ = (ProtonPlusWidgetsGamesGameSelectionCell*) _tmp9_;
		_tmp11_ = cell;
		_tmp5_ = _tmp10_ == _tmp11_;
		_g_object_unref0 (_tmp10_);
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		GeeHashMap* _tmp12_;
		ProtonPlusWidgetsGamesGameListItem* _tmp13_;
		_tmp12_ = self->priv->wide_selection_cells;
		_tmp13_ = item;
		gee_abstract_map_unset ((GeeAbstractMap*) _tmp12_, G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem), NULL);
	}
	_tmp14_ = cell;
	proton_plus_widgets_games_game_selection_cell_unbind (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SELECTION_CELL, ProtonPlusWidgetsGamesGameSelectionCell));
	_g_object_unref0 (item);
	_g_object_unref0 (cell);
}

static void
___lambda202__gtk_signal_list_item_factory_unbind (GtkSignalListItemFactory* _sender,
                                                   GObject* object,
                                                   gpointer self)
{
	__lambda202_ ((ProtonPlusWidgetsGamesBox*) self, object);
}

static void
__lambda203_ (ProtonPlusWidgetsGamesBox* self,
              GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	ProtonPlusWidgetsGamesGameSelectionCell* cell = NULL;
	GtkListItem* _tmp1_;
	GtkWidget* _tmp2_;
	ProtonPlusWidgetsGamesGameSelectionCell* _tmp3_;
	ProtonPlusWidgetsGamesGameSelectionCell* _tmp4_ = NULL;
	ProtonPlusWidgetsGamesGameSelectionCell* _tmp5_;
	GtkListItem* _tmp6_;
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (object, gtk_list_item_get_type (), GtkListItem));
	list_item = _tmp0_;
	_tmp1_ = list_item;
	_tmp2_ = gtk_list_item_get_child (_tmp1_);
	_tmp3_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_SELECTION_CELL (_tmp2_) ? ((ProtonPlusWidgetsGamesGameSelectionCell*) _tmp2_) : NULL);
	cell = _tmp3_;
	_tmp5_ = cell;
	_tmp4_ = _tmp5_;
	if (_tmp4_ != NULL) {
		proton_plus_widgets_games_game_selection_cell_unbind (_tmp4_);
	}
	_tmp6_ = list_item;
	gtk_list_item_set_child (_tmp6_, NULL);
	_g_object_unref0 (cell);
	_g_object_unref0 (list_item);
}

static void
___lambda203__gtk_signal_list_item_factory_teardown (GtkSignalListItemFactory* _sender,
                                                     GObject* object,
                                                     gpointer self)
{
	__lambda203_ ((ProtonPlusWidgetsGamesBox*) self, object);
}

static GtkSignalListItemFactory*
proton_plus_widgets_games_box_create_selection_factory (ProtonPlusWidgetsGamesBox* self)
{
	GtkSignalListItemFactory* factory = NULL;
	GtkSignalListItemFactory* _tmp0_;
	GtkSignalListItemFactory* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkSignalListItemFactory*) gtk_signal_list_item_factory_new ();
	factory = _tmp0_;
	g_signal_connect_object (factory, "setup", (GCallback) ___lambda193__gtk_signal_list_item_factory_setup, self, 0);
	g_signal_connect_object (factory, "bind", (GCallback) ___lambda201__gtk_signal_list_item_factory_bind, self, 0);
	g_signal_connect_object (factory, "unbind", (GCallback) ___lambda202__gtk_signal_list_item_factory_unbind, self, 0);
	g_signal_connect_object (factory, "teardown", (GCallback) ___lambda203__gtk_signal_list_item_factory_teardown, self, 0);
	result = factory;
	return result;
}

static gboolean
_proton_plus_widgets_games_box_focus_wide_selection_proton_plus_widgets_games_game_peer_focus_request (ProtonPlusWidgetsGamesGameListItem* item,
                                                                                                       gpointer self)
{
	gboolean result;
	result = proton_plus_widgets_games_box_focus_wide_selection ((ProtonPlusWidgetsGamesBox*) self, item);
	return result;
}

static gboolean
_proton_plus_widgets_games_box_focus_wide_actions_proton_plus_widgets_games_game_peer_focus_request (ProtonPlusWidgetsGamesGameListItem* item,
                                                                                                     gpointer self)
{
	gboolean result;
	result = proton_plus_widgets_games_box_focus_wide_actions ((ProtonPlusWidgetsGamesBox*) self, item);
	return result;
}

static void
__lambda204_ (ProtonPlusWidgetsGamesBox* self,
              GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	ProtonPlusWidgetsGamesGameTitleCell* _tmp1_;
	ProtonPlusWidgetsGamesGameTitleCell* _tmp2_;
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (object, gtk_list_item_get_type (), GtkListItem));
	list_item = _tmp0_;
	gtk_list_item_set_activatable (list_item, TRUE);
	gtk_list_item_set_focusable (list_item, FALSE);
	gtk_list_item_set_selectable (list_item, FALSE);
	_tmp1_ = proton_plus_widgets_games_game_title_cell_new (_proton_plus_widgets_games_box_focus_wide_relative_proton_plus_widgets_games_game_vertical_focus_request, self, _proton_plus_widgets_games_box_focus_wide_selection_proton_plus_widgets_games_game_peer_focus_request, self, _proton_plus_widgets_games_box_focus_wide_actions_proton_plus_widgets_games_game_peer_focus_request, self, _proton_plus_widgets_games_box_activate_game_item_proton_plus_widgets_games_game_activation_request, self);
	g_object_ref_sink (_tmp1_);
	_tmp2_ = _tmp1_;
	gtk_list_item_set_child (list_item, (GtkWidget*) _tmp2_);
	_g_object_unref0 (_tmp2_);
	_g_object_unref0 (list_item);
}

static void
___lambda204__gtk_signal_list_item_factory_setup (GtkSignalListItemFactory* _sender,
                                                  GObject* object,
                                                  gpointer self)
{
	__lambda204_ ((ProtonPlusWidgetsGamesBox*) self, object);
}

static void
__lambda205_ (ProtonPlusWidgetsGamesBox* self,
              GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	ProtonPlusWidgetsGamesGameListItem* item = NULL;
	GtkListItem* _tmp1_;
	GObject* _tmp2_;
	ProtonPlusWidgetsGamesGameListItem* _tmp3_;
	ProtonPlusWidgetsGamesGameTitleCell* cell = NULL;
	GtkListItem* _tmp4_;
	GtkWidget* _tmp5_;
	ProtonPlusWidgetsGamesGameTitleCell* _tmp6_;
	gboolean _tmp7_ = FALSE;
	ProtonPlusWidgetsGamesGameListItem* _tmp8_;
	ProtonPlusWidgetsGamesGameTitleCell* _tmp10_;
	ProtonPlusWidgetsGamesGameListItem* _tmp11_;
	ProtonPlusWidgetsGamesGameTitleCell* _tmp12_;
	GeeHashMap* _tmp13_;
	ProtonPlusWidgetsGamesGameListItem* _tmp14_;
	ProtonPlusWidgetsGamesGameTitleCell* _tmp15_;
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (object, gtk_list_item_get_type (), GtkListItem));
	list_item = _tmp0_;
	_tmp1_ = list_item;
	_tmp2_ = gtk_list_item_get_item (_tmp1_);
	_tmp3_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_LIST_ITEM (_tmp2_) ? ((ProtonPlusWidgetsGamesGameListItem*) _tmp2_) : NULL);
	item = _tmp3_;
	_tmp4_ = list_item;
	_tmp5_ = gtk_list_item_get_child (_tmp4_);
	_tmp6_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_TITLE_CELL (_tmp5_) ? ((ProtonPlusWidgetsGamesGameTitleCell*) _tmp5_) : NULL);
	cell = _tmp6_;
	_tmp8_ = item;
	if (_tmp8_ == NULL) {
		_tmp7_ = TRUE;
	} else {
		ProtonPlusWidgetsGamesGameTitleCell* _tmp9_;
		_tmp9_ = cell;
		_tmp7_ = _tmp9_ == NULL;
	}
	if (_tmp7_) {
		_g_object_unref0 (cell);
		_g_object_unref0 (item);
		_g_object_unref0 (list_item);
		return;
	}
	_tmp10_ = cell;
	_tmp11_ = item;
	proton_plus_widgets_games_game_title_cell_bind (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_TITLE_CELL, ProtonPlusWidgetsGamesGameTitleCell), G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
	_tmp12_ = cell;
	proton_plus_widgets_games_game_title_cell_set_selection_mode (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_TITLE_CELL, ProtonPlusWidgetsGamesGameTitleCell), self->priv->selection_mode_active);
	_tmp13_ = self->priv->wide_title_cells;
	_tmp14_ = item;
	_tmp15_ = cell;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp13_, G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem), G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_TITLE_CELL, ProtonPlusWidgetsGamesGameTitleCell));
	_g_object_unref0 (cell);
	_g_object_unref0 (item);
	_g_object_unref0 (list_item);
}

static void
___lambda205__gtk_signal_list_item_factory_bind (GtkSignalListItemFactory* _sender,
                                                 GObject* object,
                                                 gpointer self)
{
	__lambda205_ ((ProtonPlusWidgetsGamesBox*) self, object);
}

static void
__lambda206_ (ProtonPlusWidgetsGamesBox* self,
              GObject* object)
{
	ProtonPlusWidgetsGamesGameTitleCell* cell = NULL;
	GtkWidget* _tmp0_;
	ProtonPlusWidgetsGamesGameTitleCell* _tmp1_;
	ProtonPlusWidgetsGamesGameTitleCell* _tmp2_;
	ProtonPlusWidgetsGamesGameListItem* item = NULL;
	ProtonPlusWidgetsGamesGameTitleCell* _tmp3_;
	ProtonPlusWidgetsGamesGameListItem* _tmp4_;
	gboolean _tmp5_ = FALSE;
	ProtonPlusWidgetsGamesGameListItem* _tmp6_;
	ProtonPlusWidgetsGamesGameTitleCell* _tmp14_;
	g_return_if_fail (object != NULL);
	_tmp0_ = gtk_list_item_get_child (G_TYPE_CHECK_INSTANCE_CAST (object, gtk_list_item_get_type (), GtkListItem));
	_tmp1_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_TITLE_CELL (_tmp0_) ? ((ProtonPlusWidgetsGamesGameTitleCell*) _tmp0_) : NULL);
	cell = _tmp1_;
	_tmp2_ = cell;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (cell);
		return;
	}
	_tmp3_ = cell;
	_tmp4_ = proton_plus_widgets_games_game_title_cell_get_item (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_TITLE_CELL, ProtonPlusWidgetsGamesGameTitleCell));
	item = _tmp4_;
	_tmp6_ = item;
	if (_tmp6_ != NULL) {
		GeeHashMap* _tmp7_;
		ProtonPlusWidgetsGamesGameListItem* _tmp8_;
		gpointer _tmp9_;
		ProtonPlusWidgetsGamesGameTitleCell* _tmp10_;
		ProtonPlusWidgetsGamesGameTitleCell* _tmp11_;
		_tmp7_ = self->priv->wide_title_cells;
		_tmp8_ = item;
		_tmp9_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp7_, G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
		_tmp10_ = (ProtonPlusWidgetsGamesGameTitleCell*) _tmp9_;
		_tmp11_ = cell;
		_tmp5_ = _tmp10_ == _tmp11_;
		_g_object_unref0 (_tmp10_);
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		GeeHashMap* _tmp12_;
		ProtonPlusWidgetsGamesGameListItem* _tmp13_;
		_tmp12_ = self->priv->wide_title_cells;
		_tmp13_ = item;
		gee_abstract_map_unset ((GeeAbstractMap*) _tmp12_, G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem), NULL);
	}
	_tmp14_ = cell;
	proton_plus_widgets_games_game_title_cell_unbind (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_TITLE_CELL, ProtonPlusWidgetsGamesGameTitleCell));
	_g_object_unref0 (item);
	_g_object_unref0 (cell);
}

static void
___lambda206__gtk_signal_list_item_factory_unbind (GtkSignalListItemFactory* _sender,
                                                   GObject* object,
                                                   gpointer self)
{
	__lambda206_ ((ProtonPlusWidgetsGamesBox*) self, object);
}

static void
__lambda207_ (ProtonPlusWidgetsGamesBox* self,
              GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	ProtonPlusWidgetsGamesGameTitleCell* cell = NULL;
	GtkListItem* _tmp1_;
	GtkWidget* _tmp2_;
	ProtonPlusWidgetsGamesGameTitleCell* _tmp3_;
	ProtonPlusWidgetsGamesGameTitleCell* _tmp4_ = NULL;
	ProtonPlusWidgetsGamesGameTitleCell* _tmp5_;
	GtkListItem* _tmp6_;
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (object, gtk_list_item_get_type (), GtkListItem));
	list_item = _tmp0_;
	_tmp1_ = list_item;
	_tmp2_ = gtk_list_item_get_child (_tmp1_);
	_tmp3_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_TITLE_CELL (_tmp2_) ? ((ProtonPlusWidgetsGamesGameTitleCell*) _tmp2_) : NULL);
	cell = _tmp3_;
	_tmp5_ = cell;
	_tmp4_ = _tmp5_;
	if (_tmp4_ != NULL) {
		proton_plus_widgets_games_game_title_cell_unbind (_tmp4_);
	}
	_tmp6_ = list_item;
	gtk_list_item_set_child (_tmp6_, NULL);
	_g_object_unref0 (cell);
	_g_object_unref0 (list_item);
}

static void
___lambda207__gtk_signal_list_item_factory_teardown (GtkSignalListItemFactory* _sender,
                                                     GObject* object,
                                                     gpointer self)
{
	__lambda207_ ((ProtonPlusWidgetsGamesBox*) self, object);
}

static GtkSignalListItemFactory*
proton_plus_widgets_games_box_create_title_factory (ProtonPlusWidgetsGamesBox* self)
{
	GtkSignalListItemFactory* factory = NULL;
	GtkSignalListItemFactory* _tmp0_;
	GtkSignalListItemFactory* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkSignalListItemFactory*) gtk_signal_list_item_factory_new ();
	factory = _tmp0_;
	g_signal_connect_object (factory, "setup", (GCallback) ___lambda204__gtk_signal_list_item_factory_setup, self, 0);
	g_signal_connect_object (factory, "bind", (GCallback) ___lambda205__gtk_signal_list_item_factory_bind, self, 0);
	g_signal_connect_object (factory, "unbind", (GCallback) ___lambda206__gtk_signal_list_item_factory_unbind, self, 0);
	g_signal_connect_object (factory, "teardown", (GCallback) ___lambda207__gtk_signal_list_item_factory_teardown, self, 0);
	result = factory;
	return result;
}

static Block39Data*
block39_data_ref (Block39Data* _data39_)
{
	g_atomic_int_inc (&_data39_->_ref_count_);
	return _data39_;
}

static void
block39_data_unref (void * _userdata_)
{
	Block39Data* _data39_;
	_data39_ = (Block39Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data39_->_ref_count_)) {
		ProtonPlusWidgetsGamesBox* self;
		self = _data39_->self;
		_g_object_unref0 (self);
		g_slice_free (Block39Data, _data39_);
	}
}

static void
__lambda208_ (Block39Data* _data39_,
              GObject* object)
{
	ProtonPlusWidgetsGamesBox* self;
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	ProtonPlusWidgetsGamesGameTextCell* _tmp1_;
	ProtonPlusWidgetsGamesGameTextCell* _tmp2_;
	self = _data39_->self;
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (object, gtk_list_item_get_type (), GtkListItem));
	list_item = _tmp0_;
	gtk_list_item_set_activatable (list_item, TRUE);
	gtk_list_item_set_focusable (list_item, FALSE);
	gtk_list_item_set_selectable (list_item, FALSE);
	_tmp1_ = proton_plus_widgets_games_game_text_cell_new (_data39_->kind);
	g_object_ref_sink (_tmp1_);
	_tmp2_ = _tmp1_;
	gtk_list_item_set_child (list_item, (GtkWidget*) _tmp2_);
	_g_object_unref0 (_tmp2_);
	_g_object_unref0 (list_item);
}

static void
___lambda208__gtk_signal_list_item_factory_setup (GtkSignalListItemFactory* _sender,
                                                  GObject* object,
                                                  gpointer self)
{
	__lambda208_ (self, object);
}

static void
__lambda209_ (ProtonPlusWidgetsGamesBox* self,
              GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	ProtonPlusWidgetsGamesGameListItem* item = NULL;
	GtkListItem* _tmp1_;
	GObject* _tmp2_;
	ProtonPlusWidgetsGamesGameListItem* _tmp3_;
	ProtonPlusWidgetsGamesGameTextCell* cell = NULL;
	GtkListItem* _tmp4_;
	GtkWidget* _tmp5_;
	ProtonPlusWidgetsGamesGameTextCell* _tmp6_;
	gboolean _tmp7_ = FALSE;
	ProtonPlusWidgetsGamesGameListItem* _tmp8_;
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (object, gtk_list_item_get_type (), GtkListItem));
	list_item = _tmp0_;
	_tmp1_ = list_item;
	_tmp2_ = gtk_list_item_get_item (_tmp1_);
	_tmp3_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_LIST_ITEM (_tmp2_) ? ((ProtonPlusWidgetsGamesGameListItem*) _tmp2_) : NULL);
	item = _tmp3_;
	_tmp4_ = list_item;
	_tmp5_ = gtk_list_item_get_child (_tmp4_);
	_tmp6_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_TEXT_CELL (_tmp5_) ? ((ProtonPlusWidgetsGamesGameTextCell*) _tmp5_) : NULL);
	cell = _tmp6_;
	_tmp8_ = item;
	if (_tmp8_ != NULL) {
		ProtonPlusWidgetsGamesGameTextCell* _tmp9_;
		_tmp9_ = cell;
		_tmp7_ = _tmp9_ != NULL;
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		ProtonPlusWidgetsGamesGameTextCell* _tmp10_;
		ProtonPlusWidgetsGamesGameListItem* _tmp11_;
		_tmp10_ = cell;
		_tmp11_ = item;
		proton_plus_widgets_games_game_text_cell_bind (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_TEXT_CELL, ProtonPlusWidgetsGamesGameTextCell), G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
	}
	_g_object_unref0 (cell);
	_g_object_unref0 (item);
	_g_object_unref0 (list_item);
}

static void
___lambda209__gtk_signal_list_item_factory_bind (GtkSignalListItemFactory* _sender,
                                                 GObject* object,
                                                 gpointer self)
{
	__lambda209_ ((ProtonPlusWidgetsGamesBox*) self, object);
}

static void
__lambda210_ (ProtonPlusWidgetsGamesBox* self,
              GObject* object)
{
	ProtonPlusWidgetsGamesGameTextCell* cell = NULL;
	GtkWidget* _tmp0_;
	ProtonPlusWidgetsGamesGameTextCell* _tmp1_;
	ProtonPlusWidgetsGamesGameTextCell* _tmp2_ = NULL;
	ProtonPlusWidgetsGamesGameTextCell* _tmp3_;
	g_return_if_fail (object != NULL);
	_tmp0_ = gtk_list_item_get_child (G_TYPE_CHECK_INSTANCE_CAST (object, gtk_list_item_get_type (), GtkListItem));
	_tmp1_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_TEXT_CELL (_tmp0_) ? ((ProtonPlusWidgetsGamesGameTextCell*) _tmp0_) : NULL);
	cell = _tmp1_;
	_tmp3_ = cell;
	_tmp2_ = _tmp3_;
	if (_tmp2_ != NULL) {
		proton_plus_widgets_games_game_text_cell_unbind (_tmp2_);
	}
	_g_object_unref0 (cell);
}

static void
___lambda210__gtk_signal_list_item_factory_unbind (GtkSignalListItemFactory* _sender,
                                                   GObject* object,
                                                   gpointer self)
{
	__lambda210_ ((ProtonPlusWidgetsGamesBox*) self, object);
}

static void
__lambda211_ (ProtonPlusWidgetsGamesBox* self,
              GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	ProtonPlusWidgetsGamesGameTextCell* cell = NULL;
	GtkListItem* _tmp1_;
	GtkWidget* _tmp2_;
	ProtonPlusWidgetsGamesGameTextCell* _tmp3_;
	ProtonPlusWidgetsGamesGameTextCell* _tmp4_ = NULL;
	ProtonPlusWidgetsGamesGameTextCell* _tmp5_;
	GtkListItem* _tmp6_;
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (object, gtk_list_item_get_type (), GtkListItem));
	list_item = _tmp0_;
	_tmp1_ = list_item;
	_tmp2_ = gtk_list_item_get_child (_tmp1_);
	_tmp3_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_TEXT_CELL (_tmp2_) ? ((ProtonPlusWidgetsGamesGameTextCell*) _tmp2_) : NULL);
	cell = _tmp3_;
	_tmp5_ = cell;
	_tmp4_ = _tmp5_;
	if (_tmp4_ != NULL) {
		proton_plus_widgets_games_game_text_cell_unbind (_tmp4_);
	}
	_tmp6_ = list_item;
	gtk_list_item_set_child (_tmp6_, NULL);
	_g_object_unref0 (cell);
	_g_object_unref0 (list_item);
}

static void
___lambda211__gtk_signal_list_item_factory_teardown (GtkSignalListItemFactory* _sender,
                                                     GObject* object,
                                                     gpointer self)
{
	__lambda211_ ((ProtonPlusWidgetsGamesBox*) self, object);
}

static GtkSignalListItemFactory*
proton_plus_widgets_games_box_create_text_factory (ProtonPlusWidgetsGamesBox* self,
                                                   ProtonPlusWidgetsGamesGameTextCellKind kind)
{
	Block39Data* _data39_;
	GtkSignalListItemFactory* factory = NULL;
	GtkSignalListItemFactory* _tmp0_;
	GtkSignalListItemFactory* result;
	g_return_val_if_fail (self != NULL, NULL);
	_data39_ = g_slice_new0 (Block39Data);
	_data39_->_ref_count_ = 1;
	_data39_->self = g_object_ref (self);
	_data39_->kind = kind;
	_tmp0_ = (GtkSignalListItemFactory*) gtk_signal_list_item_factory_new ();
	factory = _tmp0_;
	g_signal_connect_data (factory, "setup", (GCallback) ___lambda208__gtk_signal_list_item_factory_setup, block39_data_ref (_data39_), (GClosureNotify) block39_data_unref, 0);
	g_signal_connect_object (factory, "bind", (GCallback) ___lambda209__gtk_signal_list_item_factory_bind, self, 0);
	g_signal_connect_object (factory, "unbind", (GCallback) ___lambda210__gtk_signal_list_item_factory_unbind, self, 0);
	g_signal_connect_object (factory, "teardown", (GCallback) ___lambda211__gtk_signal_list_item_factory_teardown, self, 0);
	result = factory;
	block39_data_unref (_data39_);
	_data39_ = NULL;
	return result;
}

static void
__lambda212_ (ProtonPlusWidgetsGamesBox* self,
              GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	ProtonPlusWidgetsGamesGameActions* _tmp1_;
	ProtonPlusWidgetsGamesGameActions* _tmp2_;
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (object, gtk_list_item_get_type (), GtkListItem));
	list_item = _tmp0_;
	gtk_list_item_set_activatable (list_item, TRUE);
	gtk_list_item_set_focusable (list_item, FALSE);
	gtk_list_item_set_selectable (list_item, FALSE);
	_tmp1_ = proton_plus_widgets_games_game_actions_new (_proton_plus_widgets_games_box_focus_wide_relative_proton_plus_widgets_games_game_vertical_focus_request, self, _proton_plus_widgets_games_box_focus_wide_title_proton_plus_widgets_games_game_peer_focus_request, self);
	g_object_ref_sink (_tmp1_);
	_tmp2_ = _tmp1_;
	gtk_list_item_set_child (list_item, (GtkWidget*) _tmp2_);
	_g_object_unref0 (_tmp2_);
	_g_object_unref0 (list_item);
}

static void
___lambda212__gtk_signal_list_item_factory_setup (GtkSignalListItemFactory* _sender,
                                                  GObject* object,
                                                  gpointer self)
{
	__lambda212_ ((ProtonPlusWidgetsGamesBox*) self, object);
}

static void
__lambda213_ (ProtonPlusWidgetsGamesBox* self,
              GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	ProtonPlusWidgetsGamesGameListItem* item = NULL;
	GtkListItem* _tmp1_;
	GObject* _tmp2_;
	ProtonPlusWidgetsGamesGameListItem* _tmp3_;
	ProtonPlusWidgetsGamesGameActions* actions = NULL;
	GtkListItem* _tmp4_;
	GtkWidget* _tmp5_;
	ProtonPlusWidgetsGamesGameActions* _tmp6_;
	gboolean _tmp7_ = FALSE;
	ProtonPlusWidgetsGamesGameListItem* _tmp8_;
	ProtonPlusWidgetsGamesGameActions* _tmp10_;
	ProtonPlusWidgetsGamesGameListItem* _tmp11_;
	ProtonPlusWidgetsGamesGameActions* _tmp12_;
	GeeHashMap* _tmp13_;
	ProtonPlusWidgetsGamesGameListItem* _tmp14_;
	ProtonPlusWidgetsGamesGameActions* _tmp15_;
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (object, gtk_list_item_get_type (), GtkListItem));
	list_item = _tmp0_;
	_tmp1_ = list_item;
	_tmp2_ = gtk_list_item_get_item (_tmp1_);
	_tmp3_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_LIST_ITEM (_tmp2_) ? ((ProtonPlusWidgetsGamesGameListItem*) _tmp2_) : NULL);
	item = _tmp3_;
	_tmp4_ = list_item;
	_tmp5_ = gtk_list_item_get_child (_tmp4_);
	_tmp6_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_ACTIONS (_tmp5_) ? ((ProtonPlusWidgetsGamesGameActions*) _tmp5_) : NULL);
	actions = _tmp6_;
	_tmp8_ = item;
	if (_tmp8_ == NULL) {
		_tmp7_ = TRUE;
	} else {
		ProtonPlusWidgetsGamesGameActions* _tmp9_;
		_tmp9_ = actions;
		_tmp7_ = _tmp9_ == NULL;
	}
	if (_tmp7_) {
		_g_object_unref0 (actions);
		_g_object_unref0 (item);
		_g_object_unref0 (list_item);
		return;
	}
	_tmp10_ = actions;
	_tmp11_ = item;
	proton_plus_widgets_games_game_actions_bind (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_ACTIONS, ProtonPlusWidgetsGamesGameActions), G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
	_tmp12_ = actions;
	proton_plus_widgets_games_game_actions_set_selection_mode (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_ACTIONS, ProtonPlusWidgetsGamesGameActions), self->priv->selection_mode_active);
	_tmp13_ = self->priv->wide_action_cells;
	_tmp14_ = item;
	_tmp15_ = actions;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp13_, G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem), G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_ACTIONS, ProtonPlusWidgetsGamesGameActions));
	_g_object_unref0 (actions);
	_g_object_unref0 (item);
	_g_object_unref0 (list_item);
}

static void
___lambda213__gtk_signal_list_item_factory_bind (GtkSignalListItemFactory* _sender,
                                                 GObject* object,
                                                 gpointer self)
{
	__lambda213_ ((ProtonPlusWidgetsGamesBox*) self, object);
}

static void
__lambda214_ (ProtonPlusWidgetsGamesBox* self,
              GObject* object)
{
	ProtonPlusWidgetsGamesGameActions* actions = NULL;
	GtkWidget* _tmp0_;
	ProtonPlusWidgetsGamesGameActions* _tmp1_;
	ProtonPlusWidgetsGamesGameActions* _tmp2_;
	ProtonPlusWidgetsGamesGameListItem* item = NULL;
	ProtonPlusWidgetsGamesGameActions* _tmp3_;
	ProtonPlusWidgetsGamesGameListItem* _tmp4_;
	gboolean _tmp5_ = FALSE;
	ProtonPlusWidgetsGamesGameListItem* _tmp6_;
	ProtonPlusWidgetsGamesGameActions* _tmp14_;
	g_return_if_fail (object != NULL);
	_tmp0_ = gtk_list_item_get_child (G_TYPE_CHECK_INSTANCE_CAST (object, gtk_list_item_get_type (), GtkListItem));
	_tmp1_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_ACTIONS (_tmp0_) ? ((ProtonPlusWidgetsGamesGameActions*) _tmp0_) : NULL);
	actions = _tmp1_;
	_tmp2_ = actions;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (actions);
		return;
	}
	_tmp3_ = actions;
	_tmp4_ = proton_plus_widgets_games_game_actions_get_item (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_ACTIONS, ProtonPlusWidgetsGamesGameActions));
	item = _tmp4_;
	_tmp6_ = item;
	if (_tmp6_ != NULL) {
		GeeHashMap* _tmp7_;
		ProtonPlusWidgetsGamesGameListItem* _tmp8_;
		gpointer _tmp9_;
		ProtonPlusWidgetsGamesGameActions* _tmp10_;
		ProtonPlusWidgetsGamesGameActions* _tmp11_;
		_tmp7_ = self->priv->wide_action_cells;
		_tmp8_ = item;
		_tmp9_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp7_, G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
		_tmp10_ = (ProtonPlusWidgetsGamesGameActions*) _tmp9_;
		_tmp11_ = actions;
		_tmp5_ = _tmp10_ == _tmp11_;
		_g_object_unref0 (_tmp10_);
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		GeeHashMap* _tmp12_;
		ProtonPlusWidgetsGamesGameListItem* _tmp13_;
		_tmp12_ = self->priv->wide_action_cells;
		_tmp13_ = item;
		gee_abstract_map_unset ((GeeAbstractMap*) _tmp12_, G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem), NULL);
	}
	_tmp14_ = actions;
	proton_plus_widgets_games_game_actions_unbind (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_ACTIONS, ProtonPlusWidgetsGamesGameActions));
	_g_object_unref0 (item);
	_g_object_unref0 (actions);
}

static void
___lambda214__gtk_signal_list_item_factory_unbind (GtkSignalListItemFactory* _sender,
                                                   GObject* object,
                                                   gpointer self)
{
	__lambda214_ ((ProtonPlusWidgetsGamesBox*) self, object);
}

static void
__lambda215_ (ProtonPlusWidgetsGamesBox* self,
              GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	ProtonPlusWidgetsGamesGameActions* actions = NULL;
	GtkListItem* _tmp1_;
	GtkWidget* _tmp2_;
	ProtonPlusWidgetsGamesGameActions* _tmp3_;
	ProtonPlusWidgetsGamesGameActions* _tmp4_ = NULL;
	ProtonPlusWidgetsGamesGameActions* _tmp5_;
	GtkListItem* _tmp6_;
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (object, gtk_list_item_get_type (), GtkListItem));
	list_item = _tmp0_;
	_tmp1_ = list_item;
	_tmp2_ = gtk_list_item_get_child (_tmp1_);
	_tmp3_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_GAMES_IS_GAME_ACTIONS (_tmp2_) ? ((ProtonPlusWidgetsGamesGameActions*) _tmp2_) : NULL);
	actions = _tmp3_;
	_tmp5_ = actions;
	_tmp4_ = _tmp5_;
	if (_tmp4_ != NULL) {
		proton_plus_widgets_games_game_actions_unbind (_tmp4_);
	}
	_tmp6_ = list_item;
	gtk_list_item_set_child (_tmp6_, NULL);
	_g_object_unref0 (actions);
	_g_object_unref0 (list_item);
}

static void
___lambda215__gtk_signal_list_item_factory_teardown (GtkSignalListItemFactory* _sender,
                                                     GObject* object,
                                                     gpointer self)
{
	__lambda215_ ((ProtonPlusWidgetsGamesBox*) self, object);
}

static GtkSignalListItemFactory*
proton_plus_widgets_games_box_create_actions_factory (ProtonPlusWidgetsGamesBox* self)
{
	GtkSignalListItemFactory* factory = NULL;
	GtkSignalListItemFactory* _tmp0_;
	GtkSignalListItemFactory* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkSignalListItemFactory*) gtk_signal_list_item_factory_new ();
	factory = _tmp0_;
	g_signal_connect_object (factory, "setup", (GCallback) ___lambda212__gtk_signal_list_item_factory_setup, self, 0);
	g_signal_connect_object (factory, "bind", (GCallback) ___lambda213__gtk_signal_list_item_factory_bind, self, 0);
	g_signal_connect_object (factory, "unbind", (GCallback) ___lambda214__gtk_signal_list_item_factory_unbind, self, 0);
	g_signal_connect_object (factory, "teardown", (GCallback) ___lambda215__gtk_signal_list_item_factory_teardown, self, 0);
	result = factory;
	return result;
}

static void
proton_plus_widgets_games_box_build_selection_popover (ProtonPlusWidgetsGamesBox* self)
{
	GtkListBox* _tmp0_ = NULL;
	GtkListBox* _tmp1_;
	GtkScrolledWindow* selection_scrolled_window = NULL;
	GtkListBox* _tmp2_;
	GtkWidget* _tmp3_;
	GtkScrolledWindow* _tmp4_ = NULL;
	GtkLabel* _tmp5_ = NULL;
	GtkLabel* _tmp6_;
	GtkBox* content = NULL;
	GtkBox* _tmp7_;
	GtkLabel* _tmp8_;
	GtkWidget* _tmp9_;
	GtkPopover* _tmp10_ = NULL;
	GtkPopover* _tmp11_;
	GtkPopover* _tmp12_;
	GtkMenuButton* _tmp13_ = NULL;
	GtkPopover* _tmp14_;
	GtkMenuButton* _tmp15_;
	GtkMenuButton* _tmp16_;
	GtkMenuButton* _tmp17_;
	g_return_if_fail (self != NULL);
	_tmp0_ = (GtkListBox*) gtk_list_box_new ();
	gtk_list_box_set_selection_mode (_tmp0_, GTK_SELECTION_NONE);
	gtk_widget_set_focusable ((GtkWidget*) _tmp0_, FALSE);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->selection_list_box);
	self->priv->selection_list_box = _tmp0_;
	_tmp1_ = self->priv->selection_list_box;
	gtk_widget_add_css_class ((GtkWidget*) _tmp1_, "selection-popover-list");
	_tmp2_ = self->priv->selection_list_box;
	_tmp3_ = _g_object_ref0 ((GtkWidget*) _tmp2_);
	_tmp4_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	g_object_set (_tmp4_, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	g_object_set (_tmp4_, "vscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
	gtk_scrolled_window_set_max_content_height (_tmp4_, 300);
	gtk_scrolled_window_set_propagate_natural_height (_tmp4_, TRUE);
	gtk_scrolled_window_set_child (_tmp4_, _tmp3_);
	_g_object_unref0 (_tmp3_);
	g_object_ref_sink (_tmp4_);
	selection_scrolled_window = _tmp4_;
	_tmp5_ = (GtkLabel*) gtk_label_new ("");
	gtk_widget_set_halign ((GtkWidget*) _tmp5_, GTK_ALIGN_START);
	gtk_label_set_xalign (_tmp5_, (gfloat) 0);
	gtk_label_set_ellipsize (_tmp5_, PANGO_ELLIPSIZE_END);
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->priv->selection_popover_title);
	self->priv->selection_popover_title = _tmp5_;
	_tmp6_ = self->priv->selection_popover_title;
	gtk_widget_add_css_class ((GtkWidget*) _tmp6_, "heading");
	_tmp7_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
	g_object_ref_sink (_tmp7_);
	content = _tmp7_;
	gtk_widget_add_css_class ((GtkWidget*) content, "selection-popover-content");
	_tmp8_ = self->priv->selection_popover_title;
	gtk_box_append (content, (GtkWidget*) _tmp8_);
	gtk_box_append (content, (GtkWidget*) selection_scrolled_window);
	_tmp9_ = _g_object_ref0 ((GtkWidget*) content);
	_tmp10_ = (GtkPopover*) gtk_popover_new ();
	gtk_popover_set_child (_tmp10_, _tmp9_);
	_g_object_unref0 (_tmp9_);
	g_object_ref_sink (_tmp10_);
	_g_object_unref0 (self->priv->selection_popover);
	self->priv->selection_popover = _tmp10_;
	_tmp11_ = self->priv->selection_popover;
	_tmp12_ = _g_object_ref0 (_tmp11_);
	_tmp13_ = (GtkMenuButton*) gtk_menu_button_new ();
	gtk_menu_button_set_popover (_tmp13_, _tmp12_);
	_g_object_unref0 (_tmp12_);
	gtk_widget_set_visible ((GtkWidget*) _tmp13_, FALSE);
	g_object_ref_sink (_tmp13_);
	_g_object_unref0 (self->priv->selection_button);
	self->priv->selection_button = _tmp13_;
	_tmp14_ = self->priv->selection_popover;
	_tmp15_ = self->priv->selection_button;
	proton_plus_widgets_window_register_popover_for_controller (_tmp14_, (GtkWidget*) _tmp15_, NULL);
	_tmp16_ = self->priv->selection_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp16_, "flat");
	_tmp17_ = self->priv->selection_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp17_, "bold");
	_g_object_unref0 (content);
	_g_object_unref0 (selection_scrolled_window);
}

static Block40Data*
block40_data_ref (Block40Data* _data40_)
{
	g_atomic_int_inc (&_data40_->_ref_count_);
	return _data40_;
}

static void
block40_data_unref (void * _userdata_)
{
	Block40Data* _data40_;
	_data40_ = (Block40Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data40_->_ref_count_)) {
		ProtonPlusWidgetsGamesBox* self;
		self = _data40_->self;
		_g_object_unref0 (_data40_->filter_popover);
		_g_object_unref0 (self);
		g_slice_free (Block40Data, _data40_);
	}
}

static void
__lambda220_ (Block40Data* _data40_)
{
	ProtonPlusWidgetsGamesBox* self;
	GtkCheckButton* _tmp0_;
	self = _data40_->self;
	_tmp0_ = self->priv->all_filter_check;
	proton_plus_widgets_games_box_apply_filter_choice (self, _tmp0_, _data40_->filter_popover);
}

static void
___lambda220__gtk_check_button_toggled (GtkCheckButton* _sender,
                                        gpointer self)
{
	__lambda220_ (self);
}

static void
__lambda221_ (Block40Data* _data40_)
{
	ProtonPlusWidgetsGamesBox* self;
	GtkCheckButton* _tmp0_;
	self = _data40_->self;
	_tmp0_ = self->priv->native_filter_check;
	proton_plus_widgets_games_box_apply_filter_choice (self, _tmp0_, _data40_->filter_popover);
}

static void
___lambda221__gtk_check_button_toggled (GtkCheckButton* _sender,
                                        gpointer self)
{
	__lambda221_ (self);
}

static void
__lambda222_ (Block40Data* _data40_)
{
	ProtonPlusWidgetsGamesBox* self;
	GtkCheckButton* _tmp0_;
	self = _data40_->self;
	_tmp0_ = self->priv->non_steam_filter_check;
	proton_plus_widgets_games_box_apply_filter_choice (self, _tmp0_, _data40_->filter_popover);
}

static void
___lambda222__gtk_check_button_toggled (GtkCheckButton* _sender,
                                        gpointer self)
{
	__lambda222_ (self);
}

static void
proton_plus_widgets_games_box_build_filter_popover (ProtonPlusWidgetsGamesBox* self)
{
	Block40Data* _data40_;
	GtkCheckButton* _tmp0_ = NULL;
	GtkCheckButton* _tmp1_;
	GtkCheckButton* _tmp2_;
	GtkCheckButton* _tmp3_;
	GtkCheckButton* _tmp4_;
	GtkCheckButton* _tmp5_;
	GtkCheckButton* _tmp6_;
	ProtonPlusWidgetsControllerChoiceBox* filter_popover_box = NULL;
	ProtonPlusWidgetsControllerChoiceBox* _tmp7_ = NULL;
	GtkCheckButton* _tmp8_;
	GtkCheckButton* _tmp9_;
	GtkCheckButton* _tmp10_;
	GtkWidget* _tmp11_;
	GtkPopover* _tmp12_ = NULL;
	GtkCheckButton* _tmp13_;
	GtkCheckButton* _tmp14_;
	GtkCheckButton* _tmp15_;
	gchar* _tmp16_;
	GtkPopover* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar** _tmp20_;
	GtkMenuButton* _tmp21_ = NULL;
	GtkMenuButton* _tmp22_;
	GtkMenuButton* _tmp23_;
	GtkCheckButton* _tmp24_;
	g_return_if_fail (self != NULL);
	_data40_ = g_slice_new0 (Block40Data);
	_data40_->_ref_count_ = 1;
	_data40_->self = g_object_ref (self);
	_tmp0_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("All"));
	gtk_check_button_set_active (_tmp0_, TRUE);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->all_filter_check);
	self->priv->all_filter_check = _tmp0_;
	_tmp1_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Native"));
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->native_filter_check);
	self->priv->native_filter_check = _tmp1_;
	_tmp2_ = self->priv->native_filter_check;
	_tmp3_ = self->priv->all_filter_check;
	gtk_check_button_set_group (_tmp2_, _tmp3_);
	_tmp4_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Non-Steam"));
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->non_steam_filter_check);
	self->priv->non_steam_filter_check = _tmp4_;
	_tmp5_ = self->priv->non_steam_filter_check;
	_tmp6_ = self->priv->all_filter_check;
	gtk_check_button_set_group (_tmp5_, _tmp6_);
	_tmp7_ = proton_plus_widgets_controller_choice_box_new ();
	gtk_widget_set_margin_top ((GtkWidget*) _tmp7_, 12);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp7_, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp7_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp7_, 12);
	g_object_ref_sink (_tmp7_);
	filter_popover_box = _tmp7_;
	_tmp8_ = self->priv->all_filter_check;
	gtk_box_append ((GtkBox*) filter_popover_box, (GtkWidget*) _tmp8_);
	_tmp9_ = self->priv->native_filter_check;
	gtk_box_append ((GtkBox*) filter_popover_box, (GtkWidget*) _tmp9_);
	_tmp10_ = self->priv->non_steam_filter_check;
	gtk_box_append ((GtkBox*) filter_popover_box, (GtkWidget*) _tmp10_);
	_tmp11_ = _g_object_ref0 ((GtkWidget*) filter_popover_box);
	_tmp12_ = (GtkPopover*) gtk_popover_new ();
	gtk_popover_set_child (_tmp12_, _tmp11_);
	_g_object_unref0 (_tmp11_);
	g_object_ref_sink (_tmp12_);
	_data40_->filter_popover = _tmp12_;
	_tmp13_ = self->priv->all_filter_check;
	g_signal_connect_data (_tmp13_, "toggled", (GCallback) ___lambda220__gtk_check_button_toggled, block40_data_ref (_data40_), (GClosureNotify) block40_data_unref, 0);
	_tmp14_ = self->priv->native_filter_check;
	g_signal_connect_data (_tmp14_, "toggled", (GCallback) ___lambda221__gtk_check_button_toggled, block40_data_ref (_data40_), (GClosureNotify) block40_data_unref, 0);
	_tmp15_ = self->priv->non_steam_filter_check;
	g_signal_connect_data (_tmp15_, "toggled", (GCallback) ___lambda222__gtk_check_button_toggled, block40_data_ref (_data40_), (GClosureNotify) block40_data_unref, 0);
	_tmp16_ = g_strdup ("filter-2-symbolic");
	_tmp17_ = _g_object_ref0 (_data40_->filter_popover);
	_tmp18_ = g_strdup (_ ("Filter"));
	_tmp19_ = g_strdup ("flat");
	_tmp20_ = g_new0 (gchar*, 1 + 1);
	_tmp20_[0] = _tmp19_;
	_tmp21_ = (GtkMenuButton*) gtk_menu_button_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp21_, GTK_ALIGN_CENTER);
	gtk_menu_button_set_icon_name (_tmp21_, _tmp16_);
	_g_free0 (_tmp16_);
	gtk_menu_button_set_popover (_tmp21_, _tmp17_);
	_g_object_unref0 (_tmp17_);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp21_, _tmp18_);
	_g_free0 (_tmp18_);
	gtk_widget_set_visible ((GtkWidget*) _tmp21_, FALSE);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp21_, _tmp20_);
	_tmp20_ = (_vala_array_free (_tmp20_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp21_);
	_g_object_unref0 (self->priv->filter_button);
	self->priv->filter_button = _tmp21_;
	_tmp22_ = self->priv->filter_button;
	gtk_accessible_update_property ((GtkAccessible*) _tmp22_, GTK_ACCESSIBLE_PROPERTY_LABEL, _ ("Filter Games"), -1, -1);
	_tmp23_ = self->priv->filter_button;
	_tmp24_ = self->priv->all_filter_check;
	proton_plus_widgets_window_register_popover_for_controller (_data40_->filter_popover, (GtkWidget*) _tmp23_, (GtkWidget*) _tmp24_);
	proton_plus_widgets_games_box_update_filter_button_state (self);
	_g_object_unref0 (filter_popover_box);
	block40_data_unref (_data40_);
	_data40_ = NULL;
}

static void
_proton_plus_widgets_games_box_schedule_search_filter_gtk_editable_changed (GtkEditable* _sender,
                                                                            gpointer self)
{
	proton_plus_widgets_games_box_schedule_search_filter ((ProtonPlusWidgetsGamesBox*) self);
}

static void
__lambda224_ (ProtonPlusWidgetsGamesBox* self)
{
	GtkSearchEntry* _tmp0_;
	const gchar* _tmp1_;
	_tmp0_ = self->priv->search_entry;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
	if (g_strcmp0 (_tmp1_, "") != 0) {
		GtkSearchEntry* _tmp2_;
		_tmp2_ = self->priv->search_entry;
		gtk_editable_set_text ((GtkEditable*) _tmp2_, "");
	}
}

static void
___lambda224__gtk_search_entry_stop_search (GtkSearchEntry* _sender,
                                            gpointer self)
{
	__lambda224_ ((ProtonPlusWidgetsGamesBox*) self);
}

static void
__lambda225_ (ProtonPlusWidgetsGamesBox* self)
{
	if (!self->priv->updating_selection_toggle) {
		ProtonPlusWidgetsGamesGameCollection* _tmp0_;
		GtkCheckButton* _tmp1_;
		_tmp0_ = self->priv->games;
		_tmp1_ = self->priv->check_button;
		proton_plus_widgets_games_game_collection_select_all_visible (_tmp0_, gtk_check_button_get_active (_tmp1_));
	}
}

static void
___lambda225__gtk_check_button_toggled (GtkCheckButton* _sender,
                                        gpointer self)
{
	__lambda225_ ((ProtonPlusWidgetsGamesBox*) self);
}

static void
proton_plus_widgets_games_box_build_search_toolbar (ProtonPlusWidgetsGamesBox* self)
{
	gchar* _tmp0_;
	GtkSearchEntry* _tmp1_ = NULL;
	GtkSearchEntry* _tmp2_;
	GtkSearchEntry* _tmp3_;
	GtkSearchEntry* _tmp4_;
	GtkSearchEntry* _tmp5_;
	gchar* _tmp6_;
	GtkCheckButton* _tmp7_ = NULL;
	GtkCheckButton* _tmp8_;
	GtkCheckButton* _tmp9_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (_ ("Search games"));
	_tmp1_ = (GtkSearchEntry*) gtk_search_entry_new ();
	g_object_set (_tmp1_, "placeholder-text", _tmp0_, NULL);
	_g_free0 (_tmp0_);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp1_, TRUE);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->search_entry);
	self->priv->search_entry = _tmp1_;
	_tmp2_ = self->priv->search_entry;
	proton_plus_utils_text_input_metadata_policy_apply ((GtkWidget*) _tmp2_, PROTON_PLUS_UTILS_TEXT_INPUT_FIELD_KIND_SEARCH);
	_tmp3_ = self->priv->search_entry;
	gtk_widget_add_css_class ((GtkWidget*) _tmp3_, "flat");
	_tmp4_ = self->priv->search_entry;
	g_signal_connect_object ((GtkEditable*) _tmp4_, "changed", (GCallback) _proton_plus_widgets_games_box_schedule_search_filter_gtk_editable_changed, self, 0);
	_tmp5_ = self->priv->search_entry;
	g_signal_connect_object (_tmp5_, "stop-search", (GCallback) ___lambda224__gtk_search_entry_stop_search, self, 0);
	_tmp6_ = g_strdup (_ ("Select all visible games"));
	_tmp7_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp7_, _tmp6_);
	_g_free0 (_tmp6_);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->check_button);
	self->priv->check_button = _tmp7_;
	_tmp8_ = self->priv->check_button;
	gtk_accessible_update_property ((GtkAccessible*) _tmp8_, GTK_ACCESSIBLE_PROPERTY_LABEL, _ ("Select all visible games"), -1, -1);
	_tmp9_ = self->priv->check_button;
	g_signal_connect_object (_tmp9_, "toggled", (GCallback) ___lambda225__gtk_check_button_toggled, self, 0);
}

static GtkBox*
proton_plus_widgets_games_box_build_toolbar (ProtonPlusWidgetsGamesBox* self)
{
	GtkBox* toolbar = NULL;
	GtkBox* _tmp0_ = NULL;
	GtkCheckButton* _tmp1_;
	GtkSearchEntry* _tmp2_;
	GtkMenuButton* _tmp3_;
	GtkBox* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp0_, TRUE);
	gtk_widget_set_overflow ((GtkWidget*) _tmp0_, GTK_OVERFLOW_HIDDEN);
	g_object_ref_sink (_tmp0_);
	toolbar = _tmp0_;
	gtk_widget_add_css_class ((GtkWidget*) toolbar, "list-header");
	_tmp1_ = self->priv->check_button;
	gtk_box_append (toolbar, (GtkWidget*) _tmp1_);
	_tmp2_ = self->priv->search_entry;
	gtk_box_append (toolbar, (GtkWidget*) _tmp2_);
	_tmp3_ = self->priv->filter_button;
	gtk_box_append (toolbar, (GtkWidget*) _tmp3_);
	result = toolbar;
	return result;
}

static void
proton_plus_widgets_games_box_apply_filter_choice (ProtonPlusWidgetsGamesBox* self,
                                                   GtkCheckButton* choice,
                                                   GtkPopover* popover)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (choice != NULL);
	g_return_if_fail (popover != NULL);
	_tmp0_ = gtk_check_button_get_active (choice);
	_tmp1_ = _tmp0_;
	if (!_tmp1_) {
		return;
	}
	proton_plus_widgets_games_box_refilter_games (self);
	proton_plus_widgets_games_box_update_filter_button_state (self);
	gtk_popover_popdown (popover);
}

void
proton_plus_widgets_games_box_set_selected_launcher (ProtonPlusWidgetsGamesBox* self,
                                                     ProtonPlusModelsLauncher* launcher)
{
	ProtonPlusModelsLauncher* _tmp0_;
	GtkMenuButton* _tmp1_;
	GtkCheckButton* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (launcher != NULL);
	_tmp0_ = _g_object_ref0 (launcher);
	_g_object_unref0 (self->priv->launcher);
	self->priv->launcher = _tmp0_;
	_tmp1_ = self->priv->filter_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, launcher->has_library_support);
	_tmp2_ = self->priv->non_steam_filter_check;
	gtk_widget_set_visible ((GtkWidget*) _tmp2_, PROTON_PLUS_MODELS_LAUNCHERS_IS_STEAM (launcher));
	if (launcher->has_library_support) {
		gboolean _tmp3_ = FALSE;
		gboolean _tmp4_;
		_tmp4_ = self->priv->_invalid;
		if (_tmp4_) {
			_tmp3_ = TRUE;
		} else {
			gboolean _tmp5_;
			_tmp5_ = self->priv->_error;
			_tmp3_ = _tmp5_;
		}
		if (_tmp3_) {
			proton_plus_widgets_games_box_show_normal (self);
			proton_plus_widgets_games_box_set_invalid (self, FALSE);
		}
		if (PROTON_PLUS_MODELS_LAUNCHERS_IS_STEAM (launcher)) {
			ProtonPlusModelsLaunchersSteam* steam = NULL;
			ProtonPlusModelsLaunchersSteam* _tmp6_;
			gboolean _tmp7_ = FALSE;
			gboolean _tmp8_;
			gboolean _tmp9_;
			_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (launcher, PROTON_PLUS_MODELS_LAUNCHERS_TYPE_STEAM, ProtonPlusModelsLaunchersSteam));
			steam = _tmp6_;
			_tmp8_ = proton_plus_models_launcher_get_game_library_available (launcher);
			_tmp9_ = _tmp8_;
			if (!_tmp9_) {
				_tmp7_ = TRUE;
			} else {
				ProtonPlusModelsLaunchersSteam* _tmp10_;
				GList* _tmp11_;
				_tmp10_ = steam;
				_tmp11_ = _tmp10_->profiles;
				_tmp7_ = g_list_length (_tmp11_) == ((guint) 0);
			}
			if (_tmp7_) {
				proton_plus_widgets_games_box_set_error (self, TRUE);
				proton_plus_widgets_games_box_show_status_box (self, "bug-symbolic", _ ("Steam games couldn’t be loaded"), _ ("Steam’s library or profile data is missing or invalid. Finish setting " \
"up Steam, then restart ProtonPlus. Tools and other launchers remain av" \
"ailable."), FALSE);
			} else {
				proton_plus_widgets_games_box_load_games (self);
			}
			_g_object_unref0 (steam);
		}
	} else {
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		gchar* _tmp16_;
		gchar* _tmp17_;
		proton_plus_widgets_games_box_set_invalid (self, TRUE);
		_tmp12_ = launcher->icon_path;
		_tmp13_ = launcher->title;
		_tmp14_ = g_strdup_printf (_ ("%s is currently not supported."), _tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = g_strdup_printf ("%s\n%s", _tmp15_, _ ("If you want me to speed up the development make sure to show your supp" \
"ort!"));
		_tmp17_ = _tmp16_;
		proton_plus_widgets_games_box_show_status_box (self, _tmp12_, _ ("Unsupported launcher"), _tmp17_, TRUE);
		_g_free0 (_tmp17_);
		_g_free0 (_tmp15_);
	}
}

static void
proton_plus_widgets_games_box_show_normal (ProtonPlusWidgetsGamesBox* self)
{
	GtkBox* _tmp0_;
	AdwStatusPage* _tmp1_;
	g_return_if_fail (self != NULL);
	proton_plus_widgets_games_box_set_error (self, FALSE);
	_tmp0_ = self->priv->games_card;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, TRUE);
	proton_plus_widgets_games_box_update_selection_controls (self);
	_tmp1_ = self->priv->status_page;
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, FALSE);
}

static void
proton_plus_widgets_games_box_show_status_box (ProtonPlusWidgetsGamesBox* self,
                                               const gchar* icon,
                                               const gchar* title,
                                               const gchar* description,
                                               gboolean is_image)
{
	GtkBox* _tmp0_;
	ProtonPlusWidgetsGamesMassEditButton* _tmp1_;
	AdwStatusPage* _tmp4_;
	AdwStatusPage* _tmp5_;
	AdwStatusPage* _tmp6_;
	AdwStatusPage* _tmp7_;
	AdwStatusPage* _tmp8_;
	GtkImage* _tmp9_;
	GdkPaintable* _tmp10_;
	AdwStatusPage* _tmp11_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (icon != NULL);
	g_return_if_fail (title != NULL);
	g_return_if_fail (description != NULL);
	_tmp0_ = self->priv->games_card;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, FALSE);
	_tmp1_ = self->priv->mass_edit_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, FALSE);
	if (is_image) {
		GtkImage* _tmp2_;
		_tmp2_ = self->priv->image;
		gtk_image_set_from_resource (_tmp2_, icon);
	} else {
		GtkImage* _tmp3_;
		_tmp3_ = self->priv->image;
		gtk_image_set_from_icon_name (_tmp3_, icon);
	}
	_tmp4_ = self->priv->status_page;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp4_, TRUE);
	_tmp5_ = self->priv->status_page;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp5_, TRUE);
	_tmp6_ = self->priv->status_page;
	adw_status_page_set_title (_tmp6_, title);
	_tmp7_ = self->priv->status_page;
	adw_status_page_set_description (_tmp7_, description);
	_tmp8_ = self->priv->status_page;
	_tmp9_ = self->priv->image;
	_tmp10_ = gtk_image_get_paintable (_tmp9_);
	adw_status_page_set_paintable (_tmp8_, _tmp10_);
	_tmp11_ = self->priv->status_page;
	gtk_widget_set_visible ((GtkWidget*) _tmp11_, TRUE);
}

void
proton_plus_widgets_games_box_load_games (ProtonPlusWidgetsGamesBox* self)
{
	AdwSpinner* _tmp0_;
	GtkSearchEntry* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	GtkOverlay* _tmp4_;
	AdwSpinner* _tmp5_;
	GListStore* _tmp6_;
	GListStore* _tmp7_;
	ProtonPlusModelsCompatibilityTool* _tmp8_;
	ProtonPlusModelsCompatibilityTool* _tmp9_;
	ProtonPlusModelsLaunchersSteam* steam = NULL;
	ProtonPlusModelsLauncher* _tmp10_;
	ProtonPlusModelsLaunchersSteam* _tmp11_;
	ProtonPlusModelsLaunchersSteam* _tmp12_;
	ProtonPlusWidgetsGamesGameCollection* _tmp35_;
	ProtonPlusModelsLauncher* _tmp36_;
	GList* _tmp37_;
	GtkOverlay* _tmp38_;
	AdwSpinner* _tmp39_;
	AdwSpinner* _tmp40_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->spinner;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, TRUE);
	if (self->priv->search_timeout_id != ((guint) 0)) {
		g_source_remove (self->priv->search_timeout_id);
		self->priv->search_timeout_id = (guint) 0;
	}
	proton_plus_widgets_games_box_cancel_focus_idle (self);
	_tmp1_ = self->priv->search_entry;
	_tmp2_ = gtk_editable_get_text ((GtkEditable*) _tmp1_);
	_tmp3_ = g_utf8_strdown (_tmp2_, (gssize) -1);
	_g_free0 (self->priv->search_query);
	self->priv->search_query = _tmp3_;
	_tmp4_ = self->priv->overlay;
	_tmp5_ = self->priv->spinner;
	gtk_overlay_add_overlay (_tmp4_, (GtkWidget*) _tmp5_);
	_tmp6_ = g_list_store_new (PROTON_PLUS_MODELS_TYPE_COMPATIBILITY_TOOL);
	_g_object_unref0 (self->priv->compatibility_tool_model);
	self->priv->compatibility_tool_model = _tmp6_;
	_tmp7_ = self->priv->compatibility_tool_model;
	_tmp8_ = proton_plus_models_compatibility_tool_new (_ ("Default"), "Default", "", PROTON_PLUS_MODELS_COMPATIBILITY_TOOL_RUNTIME_KIND_PROTON, "", FALSE);
	_tmp9_ = _tmp8_;
	g_list_store_append (_tmp7_, (GObject*) _tmp9_);
	_g_object_unref0 (_tmp9_);
	_tmp10_ = self->priv->launcher;
	_tmp11_ = _g_object_ref0 (PROTON_PLUS_MODELS_LAUNCHERS_IS_STEAM (_tmp10_) ? ((ProtonPlusModelsLaunchersSteam*) _tmp10_) : NULL);
	steam = _tmp11_;
	_tmp12_ = steam;
	if (_tmp12_ != NULL) {
		{
			GeeList* _tool_list = NULL;
			ProtonPlusModelsLaunchersSteam* _tmp13_;
			GeeList* _tmp14_;
			gint _tool_size = 0;
			GeeList* _tmp15_;
			gint _tmp16_;
			gint _tmp17_;
			gint _tool_index = 0;
			_tmp13_ = steam;
			_tmp14_ = proton_plus_models_launchers_steam_get_assignable_compatibility_tools (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, PROTON_PLUS_MODELS_LAUNCHERS_TYPE_STEAM, ProtonPlusModelsLaunchersSteam));
			_tool_list = _tmp14_;
			_tmp15_ = _tool_list;
			_tmp16_ = gee_collection_get_size ((GeeCollection*) _tmp15_);
			_tmp17_ = _tmp16_;
			_tool_size = _tmp17_;
			_tool_index = -1;
			while (TRUE) {
				gint _tmp18_;
				gint _tmp19_;
				ProtonPlusModelsCompatibilityTool* tool = NULL;
				GeeList* _tmp20_;
				gpointer _tmp21_;
				GListStore* _tmp22_;
				ProtonPlusModelsCompatibilityTool* _tmp23_;
				_tool_index = _tool_index + 1;
				_tmp18_ = _tool_index;
				_tmp19_ = _tool_size;
				if (!(_tmp18_ < _tmp19_)) {
					break;
				}
				_tmp20_ = _tool_list;
				_tmp21_ = gee_list_get (_tmp20_, _tool_index);
				tool = (ProtonPlusModelsCompatibilityTool*) _tmp21_;
				_tmp22_ = self->priv->compatibility_tool_model;
				_tmp23_ = tool;
				g_list_store_append (_tmp22_, (GObject*) _tmp23_);
				_g_object_unref0 (tool);
			}
			_g_object_unref0 (_tool_list);
		}
	} else {
		{
			GeeLinkedList* _tool_list = NULL;
			ProtonPlusModelsLauncher* _tmp24_;
			GeeLinkedList* _tmp25_;
			gint _tool_size = 0;
			GeeLinkedList* _tmp26_;
			gint _tmp27_;
			gint _tmp28_;
			gint _tool_index = 0;
			_tmp24_ = self->priv->launcher;
			_tmp25_ = _tmp24_->compatibility_tools;
			_tool_list = _tmp25_;
			_tmp26_ = _tool_list;
			_tmp27_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp26_);
			_tmp28_ = _tmp27_;
			_tool_size = _tmp28_;
			_tool_index = -1;
			while (TRUE) {
				gint _tmp29_;
				gint _tmp30_;
				ProtonPlusModelsCompatibilityTool* tool = NULL;
				GeeLinkedList* _tmp31_;
				gpointer _tmp32_;
				GListStore* _tmp33_;
				ProtonPlusModelsCompatibilityTool* _tmp34_;
				_tool_index = _tool_index + 1;
				_tmp29_ = _tool_index;
				_tmp30_ = _tool_size;
				if (!(_tmp29_ < _tmp30_)) {
					break;
				}
				_tmp31_ = _tool_list;
				_tmp32_ = gee_abstract_list_get ((GeeAbstractList*) _tmp31_, _tool_index);
				tool = (ProtonPlusModelsCompatibilityTool*) _tmp32_;
				_tmp33_ = self->priv->compatibility_tool_model;
				_tmp34_ = tool;
				g_list_store_append (_tmp33_, (GObject*) _tmp34_);
				_g_object_unref0 (tool);
			}
		}
	}
	_tmp35_ = self->priv->games;
	_tmp36_ = self->priv->launcher;
	_tmp37_ = _tmp36_->games;
	proton_plus_widgets_games_game_collection_replace (_tmp35_, _tmp37_);
	proton_plus_widgets_games_box_refilter_games (self);
	_tmp38_ = self->priv->overlay;
	_tmp39_ = self->priv->spinner;
	gtk_overlay_remove_overlay (_tmp38_, (GtkWidget*) _tmp39_);
	_tmp40_ = self->priv->spinner;
	gtk_widget_set_visible ((GtkWidget*) _tmp40_, FALSE);
	_g_object_unref0 (steam);
}

static gboolean
__lambda223_ (ProtonPlusWidgetsGamesBox* self)
{
	gboolean result;
	self->priv->search_timeout_id = (guint) 0;
	proton_plus_widgets_games_box_refilter_games (self);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda223__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda223_ ((ProtonPlusWidgetsGamesBox*) self);
	return result;
}

static void
proton_plus_widgets_games_box_schedule_search_filter (ProtonPlusWidgetsGamesBox* self)
{
	GtkSearchEntry* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->search_entry;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
	_tmp2_ = g_utf8_strdown (_tmp1_, (gssize) -1);
	_g_free0 (self->priv->search_query);
	self->priv->search_query = _tmp2_;
	if (self->priv->search_timeout_id != ((guint) 0)) {
		g_source_remove (self->priv->search_timeout_id);
	}
	self->priv->search_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 150, ___lambda223__gsource_func, g_object_ref (self), g_object_unref);
}

static void
proton_plus_widgets_games_box_refilter_games (ProtonPlusWidgetsGamesBox* self)
{
	ProtonPlusWidgetsGamesGameFilterMode mode = 0;
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	ProtonPlusWidgetsGamesGameCollection* _tmp6_;
	const gchar* _tmp7_;
	g_return_if_fail (self != NULL);
	mode = PROTON_PLUS_WIDGETS_GAMES_GAME_FILTER_MODE_ALL;
	_tmp0_ = self->priv->native_filter_check;
	_tmp1_ = gtk_check_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		mode = PROTON_PLUS_WIDGETS_GAMES_GAME_FILTER_MODE_NATIVE;
	} else {
		GtkCheckButton* _tmp3_;
		gboolean _tmp4_;
		gboolean _tmp5_;
		_tmp3_ = self->priv->non_steam_filter_check;
		_tmp4_ = gtk_check_button_get_active (_tmp3_);
		_tmp5_ = _tmp4_;
		if (_tmp5_) {
			mode = PROTON_PLUS_WIDGETS_GAMES_GAME_FILTER_MODE_NON_STEAM;
		}
	}
	_tmp6_ = self->priv->games;
	_tmp7_ = self->priv->search_query;
	proton_plus_widgets_games_game_collection_set_filter (_tmp6_, _tmp7_, mode);
}

static void
proton_plus_widgets_games_box_update_filter_button_state (ProtonPlusWidgetsGamesBox* self)
{
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GtkCheckButton* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->all_filter_check;
	_tmp1_ = gtk_check_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		GtkMenuButton* _tmp3_;
		_tmp3_ = self->priv->filter_button;
		gtk_widget_add_css_class ((GtkWidget*) _tmp3_, "games-filter-active");
	} else {
		GtkMenuButton* _tmp4_;
		_tmp4_ = self->priv->filter_button;
		gtk_widget_remove_css_class ((GtkWidget*) _tmp4_, "games-filter-active");
	}
	_tmp5_ = self->priv->native_filter_check;
	_tmp6_ = gtk_check_button_get_active (_tmp5_);
	_tmp7_ = _tmp6_;
	if (_tmp7_) {
		GtkMenuButton* _tmp8_;
		_tmp8_ = self->priv->filter_button;
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp8_, _ ("Filter: Native"));
	} else {
		GtkCheckButton* _tmp9_;
		gboolean _tmp10_;
		gboolean _tmp11_;
		_tmp9_ = self->priv->non_steam_filter_check;
		_tmp10_ = gtk_check_button_get_active (_tmp9_);
		_tmp11_ = _tmp10_;
		if (_tmp11_) {
			GtkMenuButton* _tmp12_;
			_tmp12_ = self->priv->filter_button;
			gtk_widget_set_tooltip_text ((GtkWidget*) _tmp12_, _ ("Filter: Non-Steam"));
		} else {
			GtkMenuButton* _tmp13_;
			_tmp13_ = self->priv->filter_button;
			gtk_widget_set_tooltip_text ((GtkWidget*) _tmp13_, _ ("Filter: All games"));
		}
	}
}

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
proton_plus_widgets_games_box_update_empty_state (ProtonPlusWidgetsGamesBox* self)
{
	ProtonPlusWidgetsGamesGameCollection* _tmp0_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gboolean _tmp5_;
	GtkStack* _tmp23_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->games;
	if (proton_plus_widgets_games_game_collection_visible_count (_tmp0_) > ((guint) 0)) {
		GtkStack* _tmp1_;
		_tmp1_ = self->priv->list_stack;
		gtk_stack_set_visible_child_name (_tmp1_, "list");
		return;
	}
	_tmp2_ = self->priv->search_query;
	_tmp3_ = string_strip (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_strcmp0 (_tmp4_, "") != 0;
	_g_free0 (_tmp4_);
	if (_tmp5_) {
		AdwStatusPage* _tmp6_;
		AdwStatusPage* _tmp7_;
		AdwStatusPage* _tmp8_;
		GtkButton* _tmp9_;
		GtkButton* _tmp10_;
		_tmp6_ = self->priv->empty_status_page;
		adw_status_page_set_title (_tmp6_, _ ("No matching games"));
		_tmp7_ = self->priv->empty_status_page;
		adw_status_page_set_description (_tmp7_, _ ("Try a different search term or clear the search."));
		_tmp8_ = self->priv->empty_status_page;
		adw_status_page_set_icon_name (_tmp8_, "edit-find-symbolic");
		_tmp9_ = self->priv->empty_action_button;
		gtk_button_set_label (_tmp9_, _ ("Clear Search"));
		_tmp10_ = self->priv->empty_action_button;
		gtk_widget_set_visible ((GtkWidget*) _tmp10_, TRUE);
	} else {
		GtkCheckButton* _tmp11_;
		gboolean _tmp12_;
		gboolean _tmp13_;
		_tmp11_ = self->priv->all_filter_check;
		_tmp12_ = gtk_check_button_get_active (_tmp11_);
		_tmp13_ = _tmp12_;
		if (!_tmp13_) {
			AdwStatusPage* _tmp14_;
			AdwStatusPage* _tmp15_;
			AdwStatusPage* _tmp16_;
			GtkButton* _tmp17_;
			GtkButton* _tmp18_;
			_tmp14_ = self->priv->empty_status_page;
			adw_status_page_set_title (_tmp14_, _ ("No games match this filter"));
			_tmp15_ = self->priv->empty_status_page;
			adw_status_page_set_description (_tmp15_, _ ("Choose All games to see your complete library."));
			_tmp16_ = self->priv->empty_status_page;
			adw_status_page_set_icon_name (_tmp16_, "filter-2-symbolic");
			_tmp17_ = self->priv->empty_action_button;
			gtk_button_set_label (_tmp17_, _ ("Reset Filters"));
			_tmp18_ = self->priv->empty_action_button;
			gtk_widget_set_visible ((GtkWidget*) _tmp18_, TRUE);
		} else {
			AdwStatusPage* _tmp19_;
			AdwStatusPage* _tmp20_;
			AdwStatusPage* _tmp21_;
			GtkButton* _tmp22_;
			_tmp19_ = self->priv->empty_status_page;
			adw_status_page_set_title (_tmp19_, _ ("No games found"));
			_tmp20_ = self->priv->empty_status_page;
			adw_status_page_set_description (_tmp20_, _ ("No games are available for this launcher."));
			_tmp21_ = self->priv->empty_status_page;
			adw_status_page_set_icon_name (_tmp21_, "gamepad-symbolic");
			_tmp22_ = self->priv->empty_action_button;
			gtk_widget_set_visible ((GtkWidget*) _tmp22_, FALSE);
		}
	}
	_tmp23_ = self->priv->list_stack;
	gtk_stack_set_visible_child_name (_tmp23_, "empty");
}

static void
proton_plus_widgets_games_box_update_selection_controls (ProtonPlusWidgetsGamesBox* self)
{
	guint visible_count = 0U;
	ProtonPlusWidgetsGamesGameCollection* _tmp0_;
	guint selected_visible_count = 0U;
	ProtonPlusWidgetsGamesGameCollection* _tmp1_;
	guint selected_count = 0U;
	ProtonPlusWidgetsGamesGameCollection* _tmp2_;
	gboolean _tmp3_ = FALSE;
	GtkCheckButton* _tmp4_;
	gboolean _tmp5_ = FALSE;
	GtkCheckButton* _tmp6_;
	ProtonPlusWidgetsGamesMassEditButton* _tmp7_;
	ProtonPlusWidgetsGamesMassEditButton* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->games;
	visible_count = proton_plus_widgets_games_game_collection_visible_count (_tmp0_);
	_tmp1_ = self->priv->games;
	selected_visible_count = proton_plus_widgets_games_game_collection_selected_visible_count (_tmp1_);
	_tmp2_ = self->priv->games;
	selected_count = proton_plus_widgets_games_game_collection_selected_count (_tmp2_);
	proton_plus_widgets_games_box_set_selection_mode (self, selected_count > ((guint) 0));
	self->priv->updating_selection_toggle = TRUE;
	if (selected_visible_count > ((guint) 0)) {
		_tmp3_ = selected_visible_count < visible_count;
	} else {
		_tmp3_ = FALSE;
	}
	_tmp4_ = self->priv->check_button;
	gtk_check_button_set_inconsistent (_tmp4_, _tmp3_);
	if (visible_count > ((guint) 0)) {
		_tmp5_ = selected_visible_count == visible_count;
	} else {
		_tmp5_ = FALSE;
	}
	_tmp6_ = self->priv->check_button;
	gtk_check_button_set_active (_tmp6_, _tmp5_);
	self->priv->updating_selection_toggle = FALSE;
	_tmp7_ = self->priv->mass_edit_button;
	proton_plus_widgets_games_mass_edit_button_set_selected_count (_tmp7_, (gint) selected_count);
	_tmp8_ = self->priv->mass_edit_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp8_, selected_count >= ((guint) 2));
}

static void
proton_plus_widgets_games_box_set_selection_mode (ProtonPlusWidgetsGamesBox* self,
                                                  gboolean active)
{
	GtkColumnViewColumn* _tmp0_;
	g_return_if_fail (self != NULL);
	if (self->priv->selection_mode_active == active) {
		return;
	}
	self->priv->selection_mode_active = active;
	_tmp0_ = self->priv->actions_column;
	gtk_column_view_column_set_visible (_tmp0_, !active);
	{
		GeeIterator* _row_it = NULL;
		GeeHashMap* _tmp1_;
		GeeCollection* _tmp2_;
		GeeCollection* _tmp3_;
		GeeCollection* _tmp4_;
		GeeIterator* _tmp5_;
		GeeIterator* _tmp6_;
		_tmp1_ = self->priv->narrow_rows;
		_tmp2_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_row_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_;
			ProtonPlusWidgetsGamesGameRow* row = NULL;
			GeeIterator* _tmp8_;
			gpointer _tmp9_;
			ProtonPlusWidgetsGamesGameRow* _tmp10_;
			_tmp7_ = _row_it;
			if (!gee_iterator_next (_tmp7_)) {
				break;
			}
			_tmp8_ = _row_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			row = (ProtonPlusWidgetsGamesGameRow*) _tmp9_;
			_tmp10_ = row;
			proton_plus_widgets_games_game_row_set_selection_mode (_tmp10_, active);
			_g_object_unref0 (row);
		}
		_g_object_unref0 (_row_it);
	}
	{
		GeeIterator* _cell_it = NULL;
		GeeHashMap* _tmp11_;
		GeeCollection* _tmp12_;
		GeeCollection* _tmp13_;
		GeeCollection* _tmp14_;
		GeeIterator* _tmp15_;
		GeeIterator* _tmp16_;
		_tmp11_ = self->priv->wide_selection_cells;
		_tmp12_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = _tmp13_;
		_tmp15_ = gee_iterable_iterator ((GeeIterable*) _tmp14_);
		_tmp16_ = _tmp15_;
		_g_object_unref0 (_tmp14_);
		_cell_it = _tmp16_;
		while (TRUE) {
			GeeIterator* _tmp17_;
			ProtonPlusWidgetsGamesGameSelectionCell* cell = NULL;
			GeeIterator* _tmp18_;
			gpointer _tmp19_;
			ProtonPlusWidgetsGamesGameSelectionCell* _tmp20_;
			_tmp17_ = _cell_it;
			if (!gee_iterator_next (_tmp17_)) {
				break;
			}
			_tmp18_ = _cell_it;
			_tmp19_ = gee_iterator_get (_tmp18_);
			cell = (ProtonPlusWidgetsGamesGameSelectionCell*) _tmp19_;
			_tmp20_ = cell;
			proton_plus_widgets_games_game_selection_cell_set_selection_mode (_tmp20_, active);
			_g_object_unref0 (cell);
		}
		_g_object_unref0 (_cell_it);
	}
	{
		GeeIterator* _cell_it = NULL;
		GeeHashMap* _tmp21_;
		GeeCollection* _tmp22_;
		GeeCollection* _tmp23_;
		GeeCollection* _tmp24_;
		GeeIterator* _tmp25_;
		GeeIterator* _tmp26_;
		_tmp21_ = self->priv->wide_title_cells;
		_tmp22_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp21_);
		_tmp23_ = _tmp22_;
		_tmp24_ = _tmp23_;
		_tmp25_ = gee_iterable_iterator ((GeeIterable*) _tmp24_);
		_tmp26_ = _tmp25_;
		_g_object_unref0 (_tmp24_);
		_cell_it = _tmp26_;
		while (TRUE) {
			GeeIterator* _tmp27_;
			ProtonPlusWidgetsGamesGameTitleCell* cell = NULL;
			GeeIterator* _tmp28_;
			gpointer _tmp29_;
			ProtonPlusWidgetsGamesGameTitleCell* _tmp30_;
			_tmp27_ = _cell_it;
			if (!gee_iterator_next (_tmp27_)) {
				break;
			}
			_tmp28_ = _cell_it;
			_tmp29_ = gee_iterator_get (_tmp28_);
			cell = (ProtonPlusWidgetsGamesGameTitleCell*) _tmp29_;
			_tmp30_ = cell;
			proton_plus_widgets_games_game_title_cell_set_selection_mode (_tmp30_, active);
			_g_object_unref0 (cell);
		}
		_g_object_unref0 (_cell_it);
	}
	{
		GeeIterator* _actions_it = NULL;
		GeeHashMap* _tmp31_;
		GeeCollection* _tmp32_;
		GeeCollection* _tmp33_;
		GeeCollection* _tmp34_;
		GeeIterator* _tmp35_;
		GeeIterator* _tmp36_;
		_tmp31_ = self->priv->wide_action_cells;
		_tmp32_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp31_);
		_tmp33_ = _tmp32_;
		_tmp34_ = _tmp33_;
		_tmp35_ = gee_iterable_iterator ((GeeIterable*) _tmp34_);
		_tmp36_ = _tmp35_;
		_g_object_unref0 (_tmp34_);
		_actions_it = _tmp36_;
		while (TRUE) {
			GeeIterator* _tmp37_;
			ProtonPlusWidgetsGamesGameActions* actions = NULL;
			GeeIterator* _tmp38_;
			gpointer _tmp39_;
			ProtonPlusWidgetsGamesGameActions* _tmp40_;
			_tmp37_ = _actions_it;
			if (!gee_iterator_next (_tmp37_)) {
				break;
			}
			_tmp38_ = _actions_it;
			_tmp39_ = gee_iterator_get (_tmp38_);
			actions = (ProtonPlusWidgetsGamesGameActions*) _tmp39_;
			_tmp40_ = actions;
			proton_plus_widgets_games_game_actions_set_selection_mode (_tmp40_, active);
			_g_object_unref0 (actions);
		}
		_g_object_unref0 (_actions_it);
	}
}

static void
proton_plus_widgets_games_box_activate_game_row (ProtonPlusWidgetsGamesBox* self,
                                                 guint position)
{
	ProtonPlusWidgetsGamesGameListItem* item = NULL;
	ProtonPlusWidgetsGamesGameCollection* _tmp0_;
	ProtonPlusWidgetsGamesGameListItem* _tmp1_;
	ProtonPlusWidgetsGamesGameListItem* _tmp2_;
	ProtonPlusWidgetsGamesGameListItem* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->games;
	_tmp1_ = proton_plus_widgets_games_game_collection_item_at (_tmp0_, position);
	item = _tmp1_;
	_tmp2_ = item;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (item);
		return;
	}
	_tmp3_ = item;
	proton_plus_widgets_games_box_activate_game_item (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
	_g_object_unref0 (item);
}

static void
proton_plus_widgets_games_box_activate_game_item (ProtonPlusWidgetsGamesBox* self,
                                                  ProtonPlusWidgetsGamesGameListItem* item)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	switch (proton_plus_widgets_games_game_action_availability_row_activation (self->priv->selection_mode_active)) {
		case PROTON_PLUS_WIDGETS_GAMES_GAME_ROW_ACTIVATION_TOGGLE_SELECTION:
		{
			gboolean _tmp0_;
			gboolean _tmp1_;
			_tmp0_ = proton_plus_widgets_games_game_list_item_get_selected (item);
			_tmp1_ = _tmp0_;
			proton_plus_widgets_games_game_list_item_set_selected (item, !_tmp1_);
			break;
		}
		case PROTON_PLUS_WIDGETS_GAMES_GAME_ROW_ACTIVATION_MODIFY:
		{
			proton_plus_widgets_games_box_open_single_game_edit (self, item);
			break;
		}
		default:
		break;
	}
}

static void
proton_plus_widgets_games_box_open_single_game_edit (ProtonPlusWidgetsGamesBox* self,
                                                     ProtonPlusWidgetsGamesGameListItem* item)
{
	ProtonPlusWidgetsGamesGameListItem* _tmp0_;
	ProtonPlusWidgetsGamesGameListItem** _tmp1_;
	ProtonPlusWidgetsGamesGameListItem** _tmp2_;
	gint _tmp2__length1;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	_tmp0_ = _g_object_ref0 (item);
	_tmp1_ = g_new0 (ProtonPlusWidgetsGamesGameListItem*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = 1;
	proton_plus_widgets_games_box_open_mass_edit (self, _tmp2_, (gint) 1);
	_tmp2_ = (_vala_array_free (_tmp2_, _tmp2__length1, (GDestroyNotify) g_object_unref), NULL);
}

static void
proton_plus_widgets_games_box_open_mass_edit (ProtonPlusWidgetsGamesBox* self,
                                              ProtonPlusWidgetsGamesGameListItem** items,
                                              gint items_length1)
{
	ProtonPlusWidgetsGamesMassEditView* _tmp0_;
	GListStore* _tmp1_;
	GtkPropertyExpression* _tmp2_;
	GtkMenuButton* _tmp3_;
	ProtonPlusWidgetsGamesMassEditView* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	GtkMenuButton* _tmp7_;
	GtkLabel* _tmp8_;
	ProtonPlusWidgetsGamesMassEditView* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	GtkListBox* _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->mass_edit_view;
	_tmp1_ = self->priv->compatibility_tool_model;
	_tmp2_ = self->priv->expression;
	proton_plus_widgets_games_mass_edit_view_load (_tmp0_, items, (gint) items_length1, _tmp1_, _tmp2_);
	_tmp3_ = self->priv->selection_button;
	_tmp4_ = self->priv->mass_edit_view;
	_tmp5_ = proton_plus_widgets_games_mass_edit_view_get_selection_text (_tmp4_);
	_tmp6_ = _tmp5_;
	gtk_menu_button_set_label (_tmp3_, _tmp6_);
	_g_free0 (_tmp6_);
	_tmp7_ = self->priv->selection_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp7_, TRUE);
	_tmp8_ = self->priv->selection_popover_title;
	_tmp9_ = self->priv->mass_edit_view;
	_tmp10_ = proton_plus_widgets_games_mass_edit_view_get_selection_text (_tmp9_);
	_tmp11_ = _tmp10_;
	gtk_label_set_label (_tmp8_, _tmp11_);
	_g_free0 (_tmp11_);
	_tmp12_ = self->priv->selection_list_box;
	gtk_list_box_remove_all (_tmp12_);
	{
		ProtonPlusWidgetsGamesGameListItem** item_collection = NULL;
		gint item_collection_length1 = 0;
		gint _item_collection_size_ = 0;
		gint item_it = 0;
		item_collection = items;
		item_collection_length1 = items_length1;
		for (item_it = 0; item_it < item_collection_length1; item_it = item_it + 1) {
			ProtonPlusWidgetsGamesGameListItem* _tmp13_;
			ProtonPlusWidgetsGamesGameListItem* item = NULL;
			_tmp13_ = _g_object_ref0 (item_collection[item_it]);
			item = _tmp13_;
			{
				GtkLabel* title = NULL;
				ProtonPlusWidgetsGamesGameListItem* _tmp14_;
				ProtonPlusModelsGame* _tmp15_;
				ProtonPlusModelsGame* _tmp16_;
				const gchar* _tmp17_;
				const gchar* _tmp18_;
				GtkLabel* _tmp19_ = NULL;
				GtkBox* content = NULL;
				GtkBox* _tmp20_;
				GtkBox* _tmp21_;
				GtkBox* _tmp22_;
				GtkImage* _tmp23_;
				GtkImage* _tmp24_;
				GtkBox* _tmp25_;
				GtkLabel* _tmp26_;
				GtkListBox* _tmp27_;
				GtkBox* _tmp28_;
				GtkWidget* _tmp29_;
				GtkListBoxRow* _tmp30_ = NULL;
				GtkListBoxRow* _tmp31_;
				_tmp14_ = item;
				_tmp15_ = proton_plus_widgets_games_game_list_item_get_game (_tmp14_);
				_tmp16_ = _tmp15_;
				_tmp17_ = proton_plus_models_game_get_name (_tmp16_);
				_tmp18_ = _tmp17_;
				_tmp19_ = (GtkLabel*) gtk_label_new (_tmp18_);
				gtk_widget_set_halign ((GtkWidget*) _tmp19_, GTK_ALIGN_START);
				gtk_widget_set_hexpand ((GtkWidget*) _tmp19_, TRUE);
				gtk_label_set_xalign (_tmp19_, (gfloat) 0);
				gtk_label_set_ellipsize (_tmp19_, PANGO_ELLIPSIZE_END);
				g_object_ref_sink (_tmp19_);
				title = _tmp19_;
				_tmp20_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
				g_object_ref_sink (_tmp20_);
				content = _tmp20_;
				_tmp21_ = content;
				gtk_widget_add_css_class ((GtkWidget*) _tmp21_, "selection-popover-row");
				_tmp22_ = content;
				_tmp23_ = (GtkImage*) gtk_image_new_from_icon_name ("gamepad-symbolic");
				g_object_ref_sink (_tmp23_);
				_tmp24_ = _tmp23_;
				gtk_box_append (_tmp22_, (GtkWidget*) _tmp24_);
				_g_object_unref0 (_tmp24_);
				_tmp25_ = content;
				_tmp26_ = title;
				gtk_box_append (_tmp25_, (GtkWidget*) _tmp26_);
				_tmp27_ = self->priv->selection_list_box;
				_tmp28_ = content;
				_tmp29_ = _g_object_ref0 ((GtkWidget*) _tmp28_);
				_tmp30_ = (GtkListBoxRow*) gtk_list_box_row_new ();
				gtk_list_box_row_set_activatable (_tmp30_, FALSE);
				gtk_list_box_row_set_selectable (_tmp30_, FALSE);
				gtk_widget_set_focusable ((GtkWidget*) _tmp30_, FALSE);
				gtk_list_box_row_set_child (_tmp30_, _tmp29_);
				_g_object_unref0 (_tmp29_);
				g_object_ref_sink (_tmp30_);
				_tmp31_ = _tmp30_;
				gtk_list_box_append (_tmp27_, (GtkWidget*) _tmp31_);
				_g_object_unref0 (_tmp31_);
				_g_object_unref0 (content);
				_g_object_unref0 (title);
				_g_object_unref0 (item);
			}
		}
	}
	self->priv->mass_edit_cleanup_pending = TRUE;
	proton_plus_widgets_games_box_push_mass_edit_page (self);
}

static void
proton_plus_widgets_games_box_switch_collection_view (ProtonPlusWidgetsGamesBox* self,
                                                      gboolean narrow)
{
	ProtonPlusWidgetsGamesGameListItem* focused_item = NULL;
	ProtonPlusWidgetsGamesGameListItem* _tmp0_;
	ProtonPlusWidgetsGamesGameListItem* _tmp1_;
	const gchar* _tmp4_ = NULL;
	GtkStack* _tmp5_;
	ProtonPlusWidgetsGamesGameListItem* _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = proton_plus_widgets_games_box_find_focused_item (self);
	focused_item = _tmp0_;
	_tmp1_ = focused_item;
	if (_tmp1_ != NULL) {
		ProtonPlusWidgetsGamesGameListItem* _tmp2_;
		ProtonPlusWidgetsGamesGameListItem* _tmp3_;
		_tmp2_ = focused_item;
		_tmp3_ = _g_object_ref0 (_tmp2_);
		_g_object_unref0 (self->priv->last_focused_item);
		self->priv->last_focused_item = _tmp3_;
	}
	self->priv->narrow_view_active = narrow;
	if (narrow) {
		_tmp4_ = "narrow";
	} else {
		_tmp4_ = "wide";
	}
	_tmp5_ = self->priv->views_stack;
	gtk_stack_set_visible_child_name (_tmp5_, _tmp4_);
	_tmp6_ = focused_item;
	if (_tmp6_ != NULL) {
		gint position = 0;
		ProtonPlusWidgetsGamesGameCollection* _tmp7_;
		ProtonPlusWidgetsGamesGameListItem* _tmp8_;
		_tmp7_ = self->priv->games;
		_tmp8_ = focused_item;
		position = proton_plus_widgets_games_game_collection_position_of (_tmp7_, G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
		if (position >= 0) {
			proton_plus_widgets_games_box_schedule_item_focus (self, (guint) position, PROTON_PLUS_WIDGETS_GAMES_GAME_FOCUS_LANE_SELECTION);
		}
	}
	_g_object_unref0 (focused_item);
}

static ProtonPlusWidgetsGamesGameListItem*
proton_plus_widgets_games_box_find_focused_item (ProtonPlusWidgetsGamesBox* self)
{
	GtkRoot* _tmp0_ = NULL;
	GtkRoot* _tmp1_;
	GtkWidget* _tmp2_ = NULL;
	GtkWidget* focused = NULL;
	GtkWidget* _tmp4_;
	GtkWidget* _tmp5_;
	ProtonPlusWidgetsGamesGameListItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = gtk_widget_get_root ((GtkWidget*) self);
	_tmp0_ = _tmp1_;
	_tmp2_ = NULL;
	if (_tmp0_ != NULL) {
		GtkWidget* _tmp3_;
		_tmp3_ = gtk_root_get_focus (_tmp0_);
		_tmp2_ = _tmp3_;
	}
	_tmp4_ = _g_object_ref0 (_tmp2_);
	focused = _tmp4_;
	_tmp5_ = focused;
	if (_tmp5_ == NULL) {
		result = NULL;
		_g_object_unref0 (focused);
		return result;
	}
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp6_;
		GeeSet* _tmp7_;
		GeeSet* _tmp8_;
		GeeSet* _tmp9_;
		GeeIterator* _tmp10_;
		GeeIterator* _tmp11_;
		_tmp6_ = self->priv->narrow_rows;
		_tmp7_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = _tmp8_;
		_tmp10_ = gee_iterable_iterator ((GeeIterable*) _tmp9_);
		_tmp11_ = _tmp10_;
		_g_object_unref0 (_tmp9_);
		_entry_it = _tmp11_;
		while (TRUE) {
			GeeIterator* _tmp12_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp13_;
			gpointer _tmp14_;
			gboolean _tmp15_ = FALSE;
			GtkWidget* _tmp16_;
			GeeMapEntry* _tmp17_;
			gconstpointer _tmp18_;
			gconstpointer _tmp19_;
			_tmp12_ = _entry_it;
			if (!gee_iterator_next (_tmp12_)) {
				break;
			}
			_tmp13_ = _entry_it;
			_tmp14_ = gee_iterator_get (_tmp13_);
			entry = (GeeMapEntry*) _tmp14_;
			_tmp16_ = focused;
			_tmp17_ = entry;
			_tmp18_ = gee_map_entry_get_value (_tmp17_);
			_tmp19_ = _tmp18_;
			if (_tmp16_ == G_TYPE_CHECK_INSTANCE_CAST ((ProtonPlusWidgetsGamesGameRow*) _tmp19_, gtk_widget_get_type (), GtkWidget)) {
				_tmp15_ = TRUE;
			} else {
				GtkWidget* _tmp20_;
				GeeMapEntry* _tmp21_;
				gconstpointer _tmp22_;
				gconstpointer _tmp23_;
				_tmp20_ = focused;
				_tmp21_ = entry;
				_tmp22_ = gee_map_entry_get_value (_tmp21_);
				_tmp23_ = _tmp22_;
				_tmp15_ = gtk_widget_is_ancestor (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, gtk_widget_get_type (), GtkWidget), (GtkWidget*) ((ProtonPlusWidgetsGamesGameRow*) _tmp23_));
			}
			if (_tmp15_) {
				GeeMapEntry* _tmp24_;
				gconstpointer _tmp25_;
				gconstpointer _tmp26_;
				ProtonPlusWidgetsGamesGameListItem* _tmp27_;
				_tmp24_ = entry;
				_tmp25_ = gee_map_entry_get_key (_tmp24_);
				_tmp26_ = _tmp25_;
				_tmp27_ = _g_object_ref0 ((ProtonPlusWidgetsGamesGameListItem*) _tmp26_);
				result = _tmp27_;
				_g_object_unref0 (entry);
				_g_object_unref0 (_entry_it);
				_g_object_unref0 (focused);
				return result;
			}
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp28_;
		GeeSet* _tmp29_;
		GeeSet* _tmp30_;
		GeeSet* _tmp31_;
		GeeIterator* _tmp32_;
		GeeIterator* _tmp33_;
		_tmp28_ = self->priv->wide_selection_cells;
		_tmp29_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp28_);
		_tmp30_ = _tmp29_;
		_tmp31_ = _tmp30_;
		_tmp32_ = gee_iterable_iterator ((GeeIterable*) _tmp31_);
		_tmp33_ = _tmp32_;
		_g_object_unref0 (_tmp31_);
		_entry_it = _tmp33_;
		while (TRUE) {
			GeeIterator* _tmp34_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp35_;
			gpointer _tmp36_;
			gboolean _tmp37_ = FALSE;
			GtkWidget* _tmp38_;
			GeeMapEntry* _tmp39_;
			gconstpointer _tmp40_;
			gconstpointer _tmp41_;
			_tmp34_ = _entry_it;
			if (!gee_iterator_next (_tmp34_)) {
				break;
			}
			_tmp35_ = _entry_it;
			_tmp36_ = gee_iterator_get (_tmp35_);
			entry = (GeeMapEntry*) _tmp36_;
			_tmp38_ = focused;
			_tmp39_ = entry;
			_tmp40_ = gee_map_entry_get_value (_tmp39_);
			_tmp41_ = _tmp40_;
			if (_tmp38_ == G_TYPE_CHECK_INSTANCE_CAST ((ProtonPlusWidgetsGamesGameSelectionCell*) _tmp41_, gtk_widget_get_type (), GtkWidget)) {
				_tmp37_ = TRUE;
			} else {
				GtkWidget* _tmp42_;
				GeeMapEntry* _tmp43_;
				gconstpointer _tmp44_;
				gconstpointer _tmp45_;
				_tmp42_ = focused;
				_tmp43_ = entry;
				_tmp44_ = gee_map_entry_get_value (_tmp43_);
				_tmp45_ = _tmp44_;
				_tmp37_ = gtk_widget_is_ancestor (G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, gtk_widget_get_type (), GtkWidget), (GtkWidget*) ((ProtonPlusWidgetsGamesGameSelectionCell*) _tmp45_));
			}
			if (_tmp37_) {
				GeeMapEntry* _tmp46_;
				gconstpointer _tmp47_;
				gconstpointer _tmp48_;
				ProtonPlusWidgetsGamesGameListItem* _tmp49_;
				_tmp46_ = entry;
				_tmp47_ = gee_map_entry_get_key (_tmp46_);
				_tmp48_ = _tmp47_;
				_tmp49_ = _g_object_ref0 ((ProtonPlusWidgetsGamesGameListItem*) _tmp48_);
				result = _tmp49_;
				_g_object_unref0 (entry);
				_g_object_unref0 (_entry_it);
				_g_object_unref0 (focused);
				return result;
			}
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp50_;
		GeeSet* _tmp51_;
		GeeSet* _tmp52_;
		GeeSet* _tmp53_;
		GeeIterator* _tmp54_;
		GeeIterator* _tmp55_;
		_tmp50_ = self->priv->wide_title_cells;
		_tmp51_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp50_);
		_tmp52_ = _tmp51_;
		_tmp53_ = _tmp52_;
		_tmp54_ = gee_iterable_iterator ((GeeIterable*) _tmp53_);
		_tmp55_ = _tmp54_;
		_g_object_unref0 (_tmp53_);
		_entry_it = _tmp55_;
		while (TRUE) {
			GeeIterator* _tmp56_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp57_;
			gpointer _tmp58_;
			gboolean _tmp59_ = FALSE;
			GtkWidget* _tmp60_;
			GeeMapEntry* _tmp61_;
			gconstpointer _tmp62_;
			gconstpointer _tmp63_;
			_tmp56_ = _entry_it;
			if (!gee_iterator_next (_tmp56_)) {
				break;
			}
			_tmp57_ = _entry_it;
			_tmp58_ = gee_iterator_get (_tmp57_);
			entry = (GeeMapEntry*) _tmp58_;
			_tmp60_ = focused;
			_tmp61_ = entry;
			_tmp62_ = gee_map_entry_get_value (_tmp61_);
			_tmp63_ = _tmp62_;
			if (_tmp60_ == G_TYPE_CHECK_INSTANCE_CAST ((ProtonPlusWidgetsGamesGameTitleCell*) _tmp63_, gtk_widget_get_type (), GtkWidget)) {
				_tmp59_ = TRUE;
			} else {
				GtkWidget* _tmp64_;
				GeeMapEntry* _tmp65_;
				gconstpointer _tmp66_;
				gconstpointer _tmp67_;
				_tmp64_ = focused;
				_tmp65_ = entry;
				_tmp66_ = gee_map_entry_get_value (_tmp65_);
				_tmp67_ = _tmp66_;
				_tmp59_ = gtk_widget_is_ancestor (G_TYPE_CHECK_INSTANCE_CAST (_tmp64_, gtk_widget_get_type (), GtkWidget), (GtkWidget*) ((ProtonPlusWidgetsGamesGameTitleCell*) _tmp67_));
			}
			if (_tmp59_) {
				GeeMapEntry* _tmp68_;
				gconstpointer _tmp69_;
				gconstpointer _tmp70_;
				ProtonPlusWidgetsGamesGameListItem* _tmp71_;
				_tmp68_ = entry;
				_tmp69_ = gee_map_entry_get_key (_tmp68_);
				_tmp70_ = _tmp69_;
				_tmp71_ = _g_object_ref0 ((ProtonPlusWidgetsGamesGameListItem*) _tmp70_);
				result = _tmp71_;
				_g_object_unref0 (entry);
				_g_object_unref0 (_entry_it);
				_g_object_unref0 (focused);
				return result;
			}
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp72_;
		GeeSet* _tmp73_;
		GeeSet* _tmp74_;
		GeeSet* _tmp75_;
		GeeIterator* _tmp76_;
		GeeIterator* _tmp77_;
		_tmp72_ = self->priv->wide_action_cells;
		_tmp73_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp72_);
		_tmp74_ = _tmp73_;
		_tmp75_ = _tmp74_;
		_tmp76_ = gee_iterable_iterator ((GeeIterable*) _tmp75_);
		_tmp77_ = _tmp76_;
		_g_object_unref0 (_tmp75_);
		_entry_it = _tmp77_;
		while (TRUE) {
			GeeIterator* _tmp78_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp79_;
			gpointer _tmp80_;
			gboolean _tmp81_ = FALSE;
			GtkWidget* _tmp82_;
			GeeMapEntry* _tmp83_;
			gconstpointer _tmp84_;
			gconstpointer _tmp85_;
			_tmp78_ = _entry_it;
			if (!gee_iterator_next (_tmp78_)) {
				break;
			}
			_tmp79_ = _entry_it;
			_tmp80_ = gee_iterator_get (_tmp79_);
			entry = (GeeMapEntry*) _tmp80_;
			_tmp82_ = focused;
			_tmp83_ = entry;
			_tmp84_ = gee_map_entry_get_value (_tmp83_);
			_tmp85_ = _tmp84_;
			if (_tmp82_ == G_TYPE_CHECK_INSTANCE_CAST ((ProtonPlusWidgetsGamesGameActions*) _tmp85_, gtk_widget_get_type (), GtkWidget)) {
				_tmp81_ = TRUE;
			} else {
				GtkWidget* _tmp86_;
				GeeMapEntry* _tmp87_;
				gconstpointer _tmp88_;
				gconstpointer _tmp89_;
				_tmp86_ = focused;
				_tmp87_ = entry;
				_tmp88_ = gee_map_entry_get_value (_tmp87_);
				_tmp89_ = _tmp88_;
				_tmp81_ = gtk_widget_is_ancestor (G_TYPE_CHECK_INSTANCE_CAST (_tmp86_, gtk_widget_get_type (), GtkWidget), (GtkWidget*) ((ProtonPlusWidgetsGamesGameActions*) _tmp89_));
			}
			if (_tmp81_) {
				GeeMapEntry* _tmp90_;
				gconstpointer _tmp91_;
				gconstpointer _tmp92_;
				ProtonPlusWidgetsGamesGameListItem* _tmp93_;
				_tmp90_ = entry;
				_tmp91_ = gee_map_entry_get_key (_tmp90_);
				_tmp92_ = _tmp91_;
				_tmp93_ = _g_object_ref0 ((ProtonPlusWidgetsGamesGameListItem*) _tmp92_);
				result = _tmp93_;
				_g_object_unref0 (entry);
				_g_object_unref0 (_entry_it);
				_g_object_unref0 (focused);
				return result;
			}
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	result = NULL;
	_g_object_unref0 (focused);
	return result;
}

static gboolean
proton_plus_widgets_games_box_focus_narrow_relative (ProtonPlusWidgetsGamesBox* self,
                                                     ProtonPlusWidgetsGamesGameListItem* item,
                                                     gint delta,
                                                     ProtonPlusWidgetsGamesGameFocusLane lane)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (item != NULL, FALSE);
	result = proton_plus_widgets_games_box_focus_relative (self, item, delta, lane);
	return result;
}

static gboolean
proton_plus_widgets_games_box_focus_wide_relative (ProtonPlusWidgetsGamesBox* self,
                                                   ProtonPlusWidgetsGamesGameListItem* item,
                                                   gint delta,
                                                   ProtonPlusWidgetsGamesGameFocusLane lane)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (item != NULL, FALSE);
	if (delta < 0) {
		_tmp2_ = proton_plus_widgets_games_game_controller_navigation_policy_top_boundary_uses_sort_header (lane);
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		ProtonPlusWidgetsGamesGameCollection* _tmp3_;
		_tmp3_ = self->priv->games;
		_tmp1_ = proton_plus_widgets_games_game_collection_position_of (_tmp3_, item) == 0;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		ProtonPlusWidgetsGamesGameListControllerBox* _tmp4_;
		_tmp4_ = self->priv->games_controller_box;
		_tmp0_ = proton_plus_widgets_games_game_list_controller_box_focus_first_sort_header (_tmp4_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		result = TRUE;
		return result;
	}
	result = proton_plus_widgets_games_box_focus_relative (self, item, delta, lane);
	return result;
}

static gboolean
proton_plus_widgets_games_box_focus_relative (ProtonPlusWidgetsGamesBox* self,
                                              ProtonPlusWidgetsGamesGameListItem* item,
                                              gint delta,
                                              ProtonPlusWidgetsGamesGameFocusLane lane)
{
	gint position = 0;
	ProtonPlusWidgetsGamesGameCollection* _tmp0_;
	gint target = 0;
	ProtonPlusWidgetsGamesGameCollection* _tmp3_;
	ProtonPlusWidgetsGamesGameCollection* _tmp7_;
	ProtonPlusWidgetsGamesGameListItem* _tmp8_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (item != NULL, FALSE);
	_tmp0_ = self->priv->games;
	position = proton_plus_widgets_games_game_collection_position_of (_tmp0_, item);
	if (position < 0) {
		result = FALSE;
		return result;
	}
	target = position + delta;
	if (target < 0) {
		GtkSearchEntry* _tmp2_;
		if (proton_plus_widgets_games_game_controller_navigation_policy_top_boundary_uses_selection (lane)) {
			GtkCheckButton* _tmp1_;
			_tmp1_ = self->priv->check_button;
			result = gtk_widget_grab_focus ((GtkWidget*) _tmp1_);
			return result;
		}
		_tmp2_ = self->priv->search_entry;
		result = gtk_widget_grab_focus ((GtkWidget*) _tmp2_);
		return result;
	}
	_tmp3_ = self->priv->games;
	if (((guint) target) >= proton_plus_widgets_games_game_collection_visible_count (_tmp3_)) {
		gboolean _tmp4_ = FALSE;
		ProtonPlusWidgetsGamesMassEditButton* _tmp5_;
		if (delta <= 0) {
			result = FALSE;
			return result;
		}
		_tmp5_ = self->priv->mass_edit_button;
		if (gtk_widget_get_visible ((GtkWidget*) _tmp5_)) {
			ProtonPlusWidgetsGamesMassEditButton* _tmp6_;
			_tmp6_ = self->priv->mass_edit_button;
			_tmp4_ = gtk_widget_grab_focus ((GtkWidget*) _tmp6_);
		} else {
			_tmp4_ = FALSE;
		}
		if (_tmp4_) {
			result = TRUE;
			return result;
		}
		result = proton_plus_widgets_games_box_focus_launcher_selector (self);
		return result;
	}
	_tmp7_ = self->priv->games;
	_tmp8_ = proton_plus_widgets_games_game_collection_item_at (_tmp7_, (guint) target);
	_g_object_unref0 (self->priv->last_focused_item);
	self->priv->last_focused_item = _tmp8_;
	result = proton_plus_widgets_games_box_focus_item (self, (guint) target, lane);
	return result;
}

static gboolean
proton_plus_widgets_games_box_focus_launcher_selector (ProtonPlusWidgetsGamesBox* self)
{
	ProtonPlusWidgetsWindow* window = NULL;
	GtkRoot* _tmp0_;
	ProtonPlusWidgetsWindow* _tmp1_;
	gboolean _tmp2_ = FALSE;
	ProtonPlusWidgetsWindow* _tmp3_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = gtk_widget_get_root ((GtkWidget*) self);
	_tmp1_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_IS_WINDOW (_tmp0_) ? ((ProtonPlusWidgetsWindow*) _tmp0_) : NULL);
	window = _tmp1_;
	_tmp3_ = window;
	if (_tmp3_ != NULL) {
		ProtonPlusWidgetsWindow* _tmp4_;
		_tmp4_ = window;
		_tmp2_ = proton_plus_widgets_window_focus_launcher_selector (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, PROTON_PLUS_WIDGETS_TYPE_WINDOW, ProtonPlusWidgetsWindow));
	} else {
		_tmp2_ = FALSE;
	}
	result = _tmp2_;
	_g_object_unref0 (window);
	return result;
}

static gboolean
proton_plus_widgets_games_box_focus_wide_actions (ProtonPlusWidgetsGamesBox* self,
                                                  ProtonPlusWidgetsGamesGameListItem* item)
{
	ProtonPlusWidgetsGamesGameActions* actions = NULL;
	GeeHashMap* _tmp0_;
	gpointer _tmp1_;
	ProtonPlusWidgetsGamesGameActions* _tmp2_;
	gint position = 0;
	ProtonPlusWidgetsGamesGameCollection* _tmp4_;
	gboolean _tmp5_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (item != NULL, FALSE);
	_tmp0_ = self->priv->wide_action_cells;
	_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, item);
	actions = (ProtonPlusWidgetsGamesGameActions*) _tmp1_;
	_tmp2_ = actions;
	if (_tmp2_ != NULL) {
		ProtonPlusWidgetsGamesGameActions* _tmp3_;
		_tmp3_ = actions;
		result = proton_plus_widgets_games_game_actions_focus_first_action (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_ACTIONS, ProtonPlusWidgetsGamesGameActions));
		_g_object_unref0 (actions);
		return result;
	}
	_tmp4_ = self->priv->games;
	position = proton_plus_widgets_games_game_collection_position_of (_tmp4_, item);
	if (position >= 0) {
		_tmp5_ = proton_plus_widgets_games_box_focus_item (self, (guint) position, PROTON_PLUS_WIDGETS_GAMES_GAME_FOCUS_LANE_FIRST_ACTION);
	} else {
		_tmp5_ = FALSE;
	}
	result = _tmp5_;
	_g_object_unref0 (actions);
	return result;
}

static gboolean
proton_plus_widgets_games_box_focus_wide_title (ProtonPlusWidgetsGamesBox* self,
                                                ProtonPlusWidgetsGamesGameListItem* item)
{
	ProtonPlusWidgetsGamesGameTitleCell* cell = NULL;
	GeeHashMap* _tmp0_;
	gpointer _tmp1_;
	ProtonPlusWidgetsGamesGameTitleCell* _tmp2_;
	gint position = 0;
	ProtonPlusWidgetsGamesGameCollection* _tmp4_;
	gboolean _tmp5_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (item != NULL, FALSE);
	if (self->priv->selection_mode_active) {
		result = proton_plus_widgets_games_box_focus_wide_selection (self, item);
		return result;
	}
	_tmp0_ = self->priv->wide_title_cells;
	_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, item);
	cell = (ProtonPlusWidgetsGamesGameTitleCell*) _tmp1_;
	_tmp2_ = cell;
	if (_tmp2_ != NULL) {
		ProtonPlusWidgetsGamesGameTitleCell* _tmp3_;
		_tmp3_ = cell;
		result = gtk_widget_grab_focus ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_TITLE_CELL, ProtonPlusWidgetsGamesGameTitleCell));
		_g_object_unref0 (cell);
		return result;
	}
	_tmp4_ = self->priv->games;
	position = proton_plus_widgets_games_game_collection_position_of (_tmp4_, item);
	if (position >= 0) {
		_tmp5_ = proton_plus_widgets_games_box_focus_item (self, (guint) position, PROTON_PLUS_WIDGETS_GAMES_GAME_FOCUS_LANE_ROW);
	} else {
		_tmp5_ = FALSE;
	}
	result = _tmp5_;
	_g_object_unref0 (cell);
	return result;
}

static gboolean
proton_plus_widgets_games_box_focus_wide_selection (ProtonPlusWidgetsGamesBox* self,
                                                    ProtonPlusWidgetsGamesGameListItem* item)
{
	ProtonPlusWidgetsGamesGameSelectionCell* cell = NULL;
	GeeHashMap* _tmp0_;
	gpointer _tmp1_;
	gboolean _tmp2_ = FALSE;
	ProtonPlusWidgetsGamesGameSelectionCell* _tmp3_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (item != NULL, FALSE);
	_tmp0_ = self->priv->wide_selection_cells;
	_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, item);
	cell = (ProtonPlusWidgetsGamesGameSelectionCell*) _tmp1_;
	_tmp3_ = cell;
	if (_tmp3_ != NULL) {
		ProtonPlusWidgetsGamesGameSelectionCell* _tmp4_;
		_tmp4_ = cell;
		_tmp2_ = gtk_widget_grab_focus ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SELECTION_CELL, ProtonPlusWidgetsGamesGameSelectionCell));
	} else {
		_tmp2_ = FALSE;
	}
	result = _tmp2_;
	_g_object_unref0 (cell);
	return result;
}

static gboolean
proton_plus_widgets_games_box_focus_item (ProtonPlusWidgetsGamesBox* self,
                                          guint position,
                                          ProtonPlusWidgetsGamesGameFocusLane lane)
{
	ProtonPlusWidgetsGamesGameListItem* item = NULL;
	ProtonPlusWidgetsGamesGameCollection* _tmp0_;
	ProtonPlusWidgetsGamesGameListItem* _tmp1_;
	ProtonPlusWidgetsGamesGameListItem* _tmp2_;
	gboolean focus_ready = FALSE;
	ProtonPlusWidgetsGamesGameListItem* _tmp3_;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->games;
	_tmp1_ = proton_plus_widgets_games_game_collection_item_at (_tmp0_, position);
	item = _tmp1_;
	_tmp2_ = item;
	if (_tmp2_ == NULL) {
		result = FALSE;
		_g_object_unref0 (item);
		return result;
	}
	_tmp3_ = item;
	_tmp5_ = proton_plus_widgets_games_box_try_focus_bound_item (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem), lane, self->priv->narrow_view_active, &_tmp4_);
	focus_ready = _tmp4_;
	if (_tmp5_) {
		proton_plus_widgets_games_box_scroll_collection_to (self, position, self->priv->narrow_view_active);
		result = TRUE;
		_g_object_unref0 (item);
		return result;
	}
	if (focus_ready) {
		result = FALSE;
		_g_object_unref0 (item);
		return result;
	}
	proton_plus_widgets_games_box_schedule_item_focus (self, position, lane);
	result = TRUE;
	_g_object_unref0 (item);
	return result;
}

static gboolean
proton_plus_widgets_games_box_try_focus_bound_item (ProtonPlusWidgetsGamesBox* self,
                                                    ProtonPlusWidgetsGamesGameListItem* item,
                                                    ProtonPlusWidgetsGamesGameFocusLane lane,
                                                    gboolean narrow,
                                                    gboolean* focus_ready)
{
	gboolean _vala_focus_ready = FALSE;
	ProtonPlusWidgetsGamesGameSelectionCell* cell = NULL;
	GeeHashMap* _tmp21_;
	gpointer _tmp22_;
	gboolean _tmp23_ = FALSE;
	ProtonPlusWidgetsGamesGameSelectionCell* _tmp24_;
	gboolean _tmp26_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (item != NULL, FALSE);
	lane = proton_plus_widgets_games_game_controller_navigation_policy_selection_mode_lane (lane, self->priv->selection_mode_active);
	if (narrow) {
		ProtonPlusWidgetsGamesGameRow* row = NULL;
		GeeHashMap* _tmp0_;
		gpointer _tmp1_;
		gboolean _tmp2_ = FALSE;
		ProtonPlusWidgetsGamesGameRow* _tmp3_;
		gboolean _tmp5_ = FALSE;
		_tmp0_ = self->priv->narrow_rows;
		_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, item);
		row = (ProtonPlusWidgetsGamesGameRow*) _tmp1_;
		_tmp3_ = row;
		if (_tmp3_ != NULL) {
			ProtonPlusWidgetsGamesGameRow* _tmp4_;
			_tmp4_ = row;
			_tmp2_ = gtk_widget_get_mapped ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_ROW, ProtonPlusWidgetsGamesGameRow));
		} else {
			_tmp2_ = FALSE;
		}
		_vala_focus_ready = _tmp2_;
		if (_vala_focus_ready) {
			ProtonPlusWidgetsGamesGameRow* _tmp6_;
			_tmp6_ = row;
			_tmp5_ = proton_plus_widgets_games_game_row_focus_lane (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_ROW, ProtonPlusWidgetsGamesGameRow), lane);
		} else {
			_tmp5_ = FALSE;
		}
		result = _tmp5_;
		_g_object_unref0 (row);
		if (focus_ready) {
			*focus_ready = _vala_focus_ready;
		}
		return result;
	}
	if (lane == PROTON_PLUS_WIDGETS_GAMES_GAME_FOCUS_LANE_ROW) {
		ProtonPlusWidgetsGamesGameTitleCell* cell = NULL;
		GeeHashMap* _tmp7_;
		gpointer _tmp8_;
		gboolean _tmp9_ = FALSE;
		ProtonPlusWidgetsGamesGameTitleCell* _tmp10_;
		gboolean _tmp12_ = FALSE;
		_tmp7_ = self->priv->wide_title_cells;
		_tmp8_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp7_, item);
		cell = (ProtonPlusWidgetsGamesGameTitleCell*) _tmp8_;
		_tmp10_ = cell;
		if (_tmp10_ != NULL) {
			ProtonPlusWidgetsGamesGameTitleCell* _tmp11_;
			_tmp11_ = cell;
			_tmp9_ = gtk_widget_get_mapped ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_TITLE_CELL, ProtonPlusWidgetsGamesGameTitleCell));
		} else {
			_tmp9_ = FALSE;
		}
		_vala_focus_ready = _tmp9_;
		if (_vala_focus_ready) {
			ProtonPlusWidgetsGamesGameTitleCell* _tmp13_;
			_tmp13_ = cell;
			_tmp12_ = gtk_widget_grab_focus ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_TITLE_CELL, ProtonPlusWidgetsGamesGameTitleCell));
		} else {
			_tmp12_ = FALSE;
		}
		result = _tmp12_;
		_g_object_unref0 (cell);
		if (focus_ready) {
			*focus_ready = _vala_focus_ready;
		}
		return result;
	}
	if (lane != PROTON_PLUS_WIDGETS_GAMES_GAME_FOCUS_LANE_SELECTION) {
		ProtonPlusWidgetsGamesGameActions* cell = NULL;
		GeeHashMap* _tmp14_;
		gpointer _tmp15_;
		gboolean _tmp16_ = FALSE;
		ProtonPlusWidgetsGamesGameActions* _tmp17_;
		gboolean _tmp19_ = FALSE;
		_tmp14_ = self->priv->wide_action_cells;
		_tmp15_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp14_, item);
		cell = (ProtonPlusWidgetsGamesGameActions*) _tmp15_;
		_tmp17_ = cell;
		if (_tmp17_ != NULL) {
			ProtonPlusWidgetsGamesGameActions* _tmp18_;
			_tmp18_ = cell;
			_tmp16_ = gtk_widget_get_mapped ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_ACTIONS, ProtonPlusWidgetsGamesGameActions));
		} else {
			_tmp16_ = FALSE;
		}
		_vala_focus_ready = _tmp16_;
		if (_vala_focus_ready) {
			ProtonPlusWidgetsGamesGameActions* _tmp20_;
			_tmp20_ = cell;
			_tmp19_ = proton_plus_widgets_games_game_actions_focus_lane (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_ACTIONS, ProtonPlusWidgetsGamesGameActions), lane);
		} else {
			_tmp19_ = FALSE;
		}
		result = _tmp19_;
		_g_object_unref0 (cell);
		if (focus_ready) {
			*focus_ready = _vala_focus_ready;
		}
		return result;
	}
	_tmp21_ = self->priv->wide_selection_cells;
	_tmp22_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp21_, item);
	cell = (ProtonPlusWidgetsGamesGameSelectionCell*) _tmp22_;
	_tmp24_ = cell;
	if (_tmp24_ != NULL) {
		ProtonPlusWidgetsGamesGameSelectionCell* _tmp25_;
		_tmp25_ = cell;
		_tmp23_ = gtk_widget_get_mapped ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SELECTION_CELL, ProtonPlusWidgetsGamesGameSelectionCell));
	} else {
		_tmp23_ = FALSE;
	}
	_vala_focus_ready = _tmp23_;
	if (_vala_focus_ready) {
		ProtonPlusWidgetsGamesGameSelectionCell* _tmp27_;
		_tmp27_ = cell;
		_tmp26_ = gtk_widget_grab_focus ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SELECTION_CELL, ProtonPlusWidgetsGamesGameSelectionCell));
	} else {
		_tmp26_ = FALSE;
	}
	result = _tmp26_;
	_g_object_unref0 (cell);
	if (focus_ready) {
		*focus_ready = _vala_focus_ready;
	}
	return result;
}

static void
proton_plus_widgets_games_box_scroll_collection_to (ProtonPlusWidgetsGamesBox* self,
                                                    guint position,
                                                    gboolean narrow)
{
	g_return_if_fail (self != NULL);
	if (narrow) {
		GtkListView* _tmp0_;
		_tmp0_ = self->priv->narrow_view;
		gtk_list_view_scroll_to (_tmp0_, position, GTK_LIST_SCROLL_NONE, NULL);
	} else {
		GtkColumnView* _tmp1_;
		_tmp1_ = self->priv->wide_view;
		gtk_column_view_scroll_to (_tmp1_, position, NULL, GTK_LIST_SCROLL_NONE, NULL);
	}
}

static void
proton_plus_widgets_games_box_schedule_item_focus (ProtonPlusWidgetsGamesBox* self,
                                                   guint position,
                                                   ProtonPlusWidgetsGamesGameFocusLane lane)
{
	guint64 expected_generation = 0ULL;
	ProtonPlusWidgetsGamesGameCollection* _tmp0_;
	guint64 _tmp1_;
	guint64 _tmp2_;
	ProtonPlusWidgetsGamesGameListItem* expected_item = NULL;
	ProtonPlusWidgetsGamesGameCollection* _tmp3_;
	ProtonPlusWidgetsGamesGameListItem* _tmp4_;
	ProtonPlusWidgetsGamesGameListItem* _tmp5_;
	gboolean expected_narrow = FALSE;
	ProtonPlusWidgetsGamesGameListItem* _tmp6_;
	g_return_if_fail (self != NULL);
	proton_plus_widgets_games_box_cancel_focus_idle (self);
	_tmp0_ = self->priv->games;
	_tmp1_ = proton_plus_widgets_games_game_collection_get_generation (_tmp0_);
	_tmp2_ = _tmp1_;
	expected_generation = _tmp2_;
	_tmp3_ = self->priv->games;
	_tmp4_ = proton_plus_widgets_games_game_collection_item_at (_tmp3_, position);
	expected_item = _tmp4_;
	_tmp5_ = expected_item;
	if (_tmp5_ == NULL) {
		_g_object_unref0 (expected_item);
		return;
	}
	expected_narrow = self->priv->narrow_view_active;
	proton_plus_widgets_games_box_scroll_collection_to (self, position, expected_narrow);
	_tmp6_ = expected_item;
	proton_plus_widgets_games_box_schedule_item_focus_attempt (self, position, lane, expected_generation, G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem), expected_narrow, 0);
	_g_object_unref0 (expected_item);
}

static Block41Data*
block41_data_ref (Block41Data* _data41_)
{
	g_atomic_int_inc (&_data41_->_ref_count_);
	return _data41_;
}

static void
block41_data_unref (void * _userdata_)
{
	Block41Data* _data41_;
	_data41_ = (Block41Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data41_->_ref_count_)) {
		ProtonPlusWidgetsGamesBox* self;
		self = _data41_->self;
		_g_object_unref0 (_data41_->expected_item);
		_g_object_unref0 (self);
		g_slice_free (Block41Data, _data41_);
	}
}

static gboolean
__lambda200_ (Block41Data* _data41_)
{
	ProtonPlusWidgetsGamesBox* self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	ProtonPlusWidgetsGamesGameCollection* _tmp2_;
	guint64 _tmp3_;
	guint64 _tmp4_;
	gboolean focus_ready = FALSE;
	gboolean _tmp8_ = FALSE;
	gboolean _tmp9_;
	gboolean result;
	self = _data41_->self;
	self->priv->focus_idle_id = (guint) 0;
	_tmp2_ = self->priv->games;
	_tmp3_ = proton_plus_widgets_games_game_collection_get_generation (_tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_ != _data41_->expected_generation) {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = self->priv->narrow_view_active != _data41_->expected_narrow;
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		ProtonPlusWidgetsGamesGameCollection* _tmp5_;
		ProtonPlusWidgetsGamesGameListItem* _tmp6_;
		ProtonPlusWidgetsGamesGameListItem* _tmp7_;
		_tmp5_ = self->priv->games;
		_tmp6_ = proton_plus_widgets_games_game_collection_item_at (_tmp5_, _data41_->position);
		_tmp7_ = _tmp6_;
		_tmp0_ = _tmp7_ != _data41_->expected_item;
		_g_object_unref0 (_tmp7_);
	}
	if (_tmp0_) {
		result = G_SOURCE_REMOVE;
		return result;
	}
	_tmp9_ = proton_plus_widgets_games_box_try_focus_bound_item (self, _data41_->expected_item, _data41_->lane, _data41_->expected_narrow, &_tmp8_);
	focus_ready = _tmp8_;
	if (_tmp9_) {
		proton_plus_widgets_games_box_scroll_collection_to (self, _data41_->position, _data41_->expected_narrow);
	} else {
		gboolean _tmp10_ = FALSE;
		if (!focus_ready) {
			_tmp10_ = _data41_->attempt < PROTON_PLUS_WIDGETS_GAMES_BOX_FOCUS_BIND_MAX_ATTEMPTS;
		} else {
			_tmp10_ = FALSE;
		}
		if (_tmp10_) {
			proton_plus_widgets_games_box_scroll_collection_to (self, _data41_->position, _data41_->expected_narrow);
			proton_plus_widgets_games_box_schedule_item_focus_attempt (self, _data41_->position, _data41_->lane, _data41_->expected_generation, _data41_->expected_item, _data41_->expected_narrow, _data41_->attempt + 1);
		}
	}
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda200__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda200_ (self);
	return result;
}

static void
proton_plus_widgets_games_box_schedule_item_focus_attempt (ProtonPlusWidgetsGamesBox* self,
                                                           guint position,
                                                           ProtonPlusWidgetsGamesGameFocusLane lane,
                                                           guint64 expected_generation,
                                                           ProtonPlusWidgetsGamesGameListItem* expected_item,
                                                           gboolean expected_narrow,
                                                           gint attempt)
{
	Block41Data* _data41_;
	ProtonPlusWidgetsGamesGameListItem* _tmp0_;
	gint _tmp1_ = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (expected_item != NULL);
	_data41_ = g_slice_new0 (Block41Data);
	_data41_->_ref_count_ = 1;
	_data41_->self = g_object_ref (self);
	_data41_->position = position;
	_data41_->lane = lane;
	_data41_->expected_generation = expected_generation;
	_tmp0_ = _g_object_ref0 (expected_item);
	_g_object_unref0 (_data41_->expected_item);
	_data41_->expected_item = _tmp0_;
	_data41_->expected_narrow = expected_narrow;
	_data41_->attempt = attempt;
	if (_data41_->attempt == 0) {
		_tmp1_ = 1;
	} else {
		_tmp1_ = 16;
	}
	self->priv->focus_idle_id = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) _tmp1_, ___lambda200__gsource_func, block41_data_ref (_data41_), block41_data_unref);
	block41_data_unref (_data41_);
	_data41_ = NULL;
}

static void
proton_plus_widgets_games_box_cancel_focus_idle (ProtonPlusWidgetsGamesBox* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->focus_idle_id == ((guint) 0)) {
		return;
	}
	g_source_remove (self->priv->focus_idle_id);
	self->priv->focus_idle_id = (guint) 0;
}

static gboolean
proton_plus_widgets_games_box_focus_last_visible_game (ProtonPlusWidgetsGamesBox* self)
{
	guint count = 0U;
	ProtonPlusWidgetsGamesGameCollection* _tmp0_;
	gboolean _tmp1_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->games;
	count = proton_plus_widgets_games_game_collection_visible_count (_tmp0_);
	if (count > ((guint) 0)) {
		_tmp1_ = proton_plus_widgets_games_box_focus_item (self, count - 1, PROTON_PLUS_WIDGETS_GAMES_GAME_FOCUS_LANE_SELECTION);
	} else {
		_tmp1_ = FALSE;
	}
	result = _tmp1_;
	return result;
}

static gboolean
proton_plus_widgets_games_box_focus_first_visible_game (ProtonPlusWidgetsGamesBox* self)
{
	gboolean _tmp0_ = FALSE;
	ProtonPlusWidgetsGamesGameCollection* _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->games;
	if (proton_plus_widgets_games_game_collection_visible_count (_tmp1_) > ((guint) 0)) {
		_tmp0_ = proton_plus_widgets_games_box_focus_item (self, (guint) 0, PROTON_PLUS_WIDGETS_GAMES_GAME_FOCUS_LANE_SELECTION);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gboolean
proton_plus_widgets_games_box_focus_first_visible_game_title (ProtonPlusWidgetsGamesBox* self)
{
	gboolean _tmp0_ = FALSE;
	ProtonPlusWidgetsGamesGameCollection* _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = self->priv->games;
	if (proton_plus_widgets_games_game_collection_visible_count (_tmp1_) > ((guint) 0)) {
		_tmp0_ = proton_plus_widgets_games_box_focus_item (self, (guint) 0, PROTON_PLUS_WIDGETS_GAMES_GAME_FOCUS_LANE_ROW);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gboolean
proton_plus_widgets_games_box_focus_games_toolbar (ProtonPlusWidgetsGamesBox* self)
{
	GtkSearchEntry* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->search_entry;
	result = gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
	return result;
}

void
proton_plus_widgets_games_box_show_games_list_page (ProtonPlusWidgetsGamesBox* self)
{
	gboolean cleanup_was_pending = FALSE;
	AdwNavigationView* _tmp0_;
	AdwNavigationPage* _tmp1_;
	AdwNavigationPage* _tmp2_;
	g_return_if_fail (self != NULL);
	cleanup_was_pending = self->priv->mass_edit_cleanup_pending;
	_tmp0_ = self->priv->navigation_view;
	_tmp1_ = adw_navigation_view_get_visible_page (_tmp0_);
	_tmp2_ = self->priv->mass_edit_page;
	if (_tmp1_ == _tmp2_) {
		if (!proton_plus_widgets_games_box_pop_page (self)) {
			AdwNavigationView* _tmp3_;
			AdwNavigationPage* _tmp4_;
			AdwNavigationPage* _tmp5_;
			AdwNavigationPage** _tmp6_;
			AdwNavigationPage** _tmp7_;
			gint _tmp7__length1;
			_tmp3_ = self->priv->navigation_view;
			_tmp4_ = self->priv->list_page;
			_tmp5_ = _g_object_ref0 (_tmp4_);
			_tmp6_ = g_new0 (AdwNavigationPage*, 1 + 1);
			_tmp6_[0] = _tmp5_;
			_tmp7_ = _tmp6_;
			_tmp7__length1 = 1;
			adw_navigation_view_replace (_tmp3_, _tmp7_, (gint) 1);
			_tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) g_object_unref), NULL);
		}
	} else {
		AdwNavigationView* _tmp8_;
		AdwNavigationPage* _tmp9_;
		AdwNavigationPage* _tmp10_;
		AdwNavigationPage** _tmp11_;
		AdwNavigationPage** _tmp12_;
		gint _tmp12__length1;
		_tmp8_ = self->priv->navigation_view;
		_tmp9_ = self->priv->list_page;
		_tmp10_ = _g_object_ref0 (_tmp9_);
		_tmp11_ = g_new0 (AdwNavigationPage*, 1 + 1);
		_tmp11_[0] = _tmp10_;
		_tmp12_ = _tmp11_;
		_tmp12__length1 = 1;
		adw_navigation_view_replace (_tmp8_, _tmp12_, (gint) 1);
		_tmp12_ = (_vala_array_free (_tmp12_, _tmp12__length1, (GDestroyNotify) g_object_unref), NULL);
	}
	if (cleanup_was_pending) {
		proton_plus_widgets_games_box_cleanup_mass_edit_exit (self);
	} else {
		proton_plus_widgets_games_box_reset_games_list_state (self);
	}
}

static void
proton_plus_widgets_games_box_push_mass_edit_page (ProtonPlusWidgetsGamesBox* self)
{
	AdwNavigationView* _tmp0_;
	AdwNavigationPage* _tmp1_;
	AdwNavigationPage* _tmp2_;
	GListModel* navigation_stack = NULL;
	AdwNavigationView* _tmp3_;
	GListModel* _tmp4_;
	AdwNavigationView* _tmp15_;
	AdwNavigationPage* _tmp16_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->navigation_view;
	_tmp1_ = adw_navigation_view_get_visible_page (_tmp0_);
	_tmp2_ = self->priv->mass_edit_page;
	if (_tmp1_ == _tmp2_) {
		return;
	}
	_tmp3_ = self->priv->navigation_view;
	_tmp4_ = adw_navigation_view_get_navigation_stack (_tmp3_);
	navigation_stack = _tmp4_;
	{
		guint i = 0U;
		i = (guint) 0;
		{
			gboolean _tmp5_ = FALSE;
			_tmp5_ = TRUE;
			while (TRUE) {
				GListModel* _tmp7_;
				GListModel* _tmp8_;
				GObject* _tmp9_;
				GObject* _tmp10_;
				AdwNavigationPage* _tmp11_;
				gboolean _tmp12_;
				if (!_tmp5_) {
					guint _tmp6_;
					_tmp6_ = i;
					i = _tmp6_ + 1;
				}
				_tmp5_ = FALSE;
				_tmp7_ = navigation_stack;
				if (!(i < g_list_model_get_n_items (_tmp7_))) {
					break;
				}
				_tmp8_ = navigation_stack;
				_tmp9_ = g_list_model_get_item (_tmp8_, i);
				_tmp10_ = _tmp9_;
				_tmp11_ = self->priv->mass_edit_page;
				_tmp12_ = _tmp10_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, G_TYPE_OBJECT, GObject);
				_g_object_unref0 (_tmp10_);
				if (_tmp12_) {
					AdwNavigationView* _tmp13_;
					AdwNavigationPage* _tmp14_;
					_tmp13_ = self->priv->navigation_view;
					_tmp14_ = self->priv->mass_edit_page;
					adw_navigation_view_pop_to_page (_tmp13_, _tmp14_);
					_g_object_unref0 (navigation_stack);
					return;
				}
			}
		}
	}
	_tmp15_ = self->priv->navigation_view;
	_tmp16_ = self->priv->mass_edit_page;
	adw_navigation_view_push (_tmp15_, _tmp16_);
	_g_object_unref0 (navigation_stack);
}

static gboolean
proton_plus_widgets_games_box_pop_page (ProtonPlusWidgetsGamesBox* self)
{
	AdwNavigationView* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->navigation_view;
	result = adw_navigation_view_pop (_tmp0_);
	return result;
}

static void
proton_plus_widgets_games_box_cleanup_mass_edit_exit (ProtonPlusWidgetsGamesBox* self)
{
	g_return_if_fail (self != NULL);
	if (!self->priv->mass_edit_cleanup_pending) {
		return;
	}
	self->priv->mass_edit_cleanup_pending = FALSE;
	proton_plus_widgets_games_box_reset_games_list_state (self);
}

static void
proton_plus_widgets_games_box_reset_games_list_state (ProtonPlusWidgetsGamesBox* self)
{
	GtkPopover* _tmp0_;
	GtkMenuButton* _tmp1_;
	GtkSearchEntry* _tmp2_;
	GtkCheckButton* _tmp3_;
	ProtonPlusWidgetsGamesGameCollection* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->selection_popover;
	gtk_popover_popdown (_tmp0_);
	_tmp1_ = self->priv->selection_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, FALSE);
	_tmp2_ = self->priv->search_entry;
	gtk_editable_set_text ((GtkEditable*) _tmp2_, "");
	_tmp3_ = self->priv->all_filter_check;
	gtk_check_button_set_active (_tmp3_, TRUE);
	_tmp4_ = self->priv->games;
	proton_plus_widgets_games_game_collection_clear_selection (_tmp4_);
	proton_plus_widgets_games_box_update_selection_controls (self);
}

static gchar*
proton_plus_widgets_games_box_real_get_controller_page_id (ProtonPlusUtilsControllerNavigationHost* base)
{
	ProtonPlusWidgetsGamesBox * self;
	const gchar* _tmp0_ = NULL;
	AdwNavigationView* _tmp1_;
	AdwNavigationPage* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* result;
	self = (ProtonPlusWidgetsGamesBox*) base;
	_tmp1_ = self->priv->navigation_view;
	_tmp2_ = adw_navigation_view_get_visible_page (_tmp1_);
	_tmp3_ = adw_navigation_page_get_tag (_tmp2_);
	_tmp0_ = _tmp3_;
	if (_tmp0_ == NULL) {
		_tmp0_ = "list";
	}
	_tmp4_ = g_strdup_printf ("games:%s", _tmp0_);
	result = _tmp4_;
	return result;
}

ProtonPlusWidgetsHeaderPresentation*
proton_plus_widgets_games_box_get_header_presentation (ProtonPlusWidgetsGamesBox* self)
{
	AdwNavigationView* _tmp0_;
	AdwNavigationPage* _tmp1_;
	AdwNavigationPage* _tmp2_;
	ProtonPlusWidgetsHeaderPresentation* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->navigation_view;
	_tmp1_ = adw_navigation_view_get_visible_page (_tmp0_);
	_tmp2_ = self->priv->mass_edit_page;
	if (_tmp1_ == _tmp2_) {
		ProtonPlusWidgetsGamesMassEditView* _tmp3_;
		ProtonPlusWidgetsHeaderPresentation* _tmp4_;
		ProtonPlusWidgetsHeaderPresentation* _tmp5_;
		ProtonPlusWidgetsHeaderPresentation* _tmp6_;
		_tmp3_ = self->priv->mass_edit_view;
		_tmp4_ = proton_plus_widgets_games_mass_edit_view_get_header_presentation (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = _g_object_ref0 (_tmp5_);
		result = _tmp6_;
		return result;
	}
	result = NULL;
	return result;
}

static GObject*
proton_plus_widgets_games_box_real_get_controller_page_root (ProtonPlusUtilsControllerNavigationHost* base)
{
	ProtonPlusWidgetsGamesBox * self;
	AdwNavigationView* _tmp0_;
	AdwNavigationPage* _tmp1_;
	GtkWidget* _tmp2_;
	GObject* _tmp3_;
	GObject* result;
	self = (ProtonPlusWidgetsGamesBox*) base;
	_tmp0_ = self->priv->navigation_view;
	_tmp1_ = adw_navigation_view_get_visible_page (_tmp0_);
	_tmp2_ = adw_navigation_page_get_child (_tmp1_);
	_tmp3_ = _g_object_ref0 ((GObject*) _tmp2_);
	result = _tmp3_;
	return result;
}

static GObject*
proton_plus_widgets_games_box_real_get_controller_initial_focus (ProtonPlusUtilsControllerNavigationHost* base)
{
	ProtonPlusWidgetsGamesBox * self;
	AdwNavigationView* _tmp0_;
	AdwNavigationPage* _tmp1_;
	AdwNavigationPage* _tmp2_;
	ProtonPlusWidgetsGamesGameListItem* _tmp5_;
	ProtonPlusWidgetsGamesGameListItem* first = NULL;
	ProtonPlusWidgetsGamesGameCollection* _tmp14_;
	ProtonPlusWidgetsGamesGameListItem* _tmp15_;
	ProtonPlusWidgetsGamesGameListItem* _tmp16_;
	GeeHashMap* _tmp26_;
	ProtonPlusWidgetsGamesGameListItem* _tmp27_;
	gpointer _tmp28_;
	GObject* result;
	self = (ProtonPlusWidgetsGamesBox*) base;
	_tmp0_ = self->priv->navigation_view;
	_tmp1_ = adw_navigation_view_get_visible_page (_tmp0_);
	_tmp2_ = self->priv->mass_edit_page;
	if (_tmp1_ == _tmp2_) {
		ProtonPlusWidgetsGamesMassEditView* _tmp3_;
		GtkWidget* _tmp4_;
		_tmp3_ = self->priv->mass_edit_view;
		_tmp4_ = proton_plus_widgets_games_mass_edit_view_get_controller_initial_focus (_tmp3_);
		result = (GObject*) _tmp4_;
		return result;
	}
	_tmp5_ = self->priv->last_focused_item;
	if (_tmp5_ != NULL) {
		gint position = 0;
		ProtonPlusWidgetsGamesGameCollection* _tmp6_;
		ProtonPlusWidgetsGamesGameListItem* _tmp7_;
		_tmp6_ = self->priv->games;
		_tmp7_ = self->priv->last_focused_item;
		position = proton_plus_widgets_games_game_collection_position_of (_tmp6_, G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
		if (position >= 0) {
			GeeHashMap* _tmp11_;
			ProtonPlusWidgetsGamesGameListItem* _tmp12_;
			gpointer _tmp13_;
			proton_plus_widgets_games_box_focus_item (self, (guint) position, PROTON_PLUS_WIDGETS_GAMES_GAME_FOCUS_LANE_SELECTION);
			if (self->priv->narrow_view_active) {
				GeeHashMap* _tmp8_;
				ProtonPlusWidgetsGamesGameListItem* _tmp9_;
				gpointer _tmp10_;
				_tmp8_ = self->priv->narrow_rows;
				_tmp9_ = self->priv->last_focused_item;
				_tmp10_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp8_, G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
				result = (GObject*) ((ProtonPlusWidgetsGamesGameRow*) _tmp10_);
				return result;
			}
			_tmp11_ = self->priv->wide_selection_cells;
			_tmp12_ = self->priv->last_focused_item;
			_tmp13_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp11_, G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
			result = (GObject*) ((ProtonPlusWidgetsGamesGameSelectionCell*) _tmp13_);
			return result;
		}
	}
	_tmp14_ = self->priv->games;
	_tmp15_ = proton_plus_widgets_games_game_collection_item_at (_tmp14_, (guint) 0);
	first = _tmp15_;
	_tmp16_ = first;
	if (_tmp16_ == NULL) {
		GtkButton* _tmp17_ = NULL;
		GtkButton* _tmp18_;
		gboolean _tmp19_;
		gboolean _tmp20_;
		GObject* _tmp22_;
		_tmp18_ = self->priv->empty_action_button;
		_tmp19_ = gtk_widget_get_visible ((GtkWidget*) _tmp18_);
		_tmp20_ = _tmp19_;
		if (_tmp20_) {
			GtkButton* _tmp21_;
			_tmp21_ = self->priv->empty_action_button;
			_tmp17_ = _tmp21_;
		} else {
			_tmp17_ = NULL;
		}
		_tmp22_ = _g_object_ref0 ((GObject*) _tmp17_);
		result = _tmp22_;
		_g_object_unref0 (first);
		return result;
	}
	if (self->priv->narrow_view_active) {
		GeeHashMap* _tmp23_;
		ProtonPlusWidgetsGamesGameListItem* _tmp24_;
		gpointer _tmp25_;
		_tmp23_ = self->priv->narrow_rows;
		_tmp24_ = first;
		_tmp25_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp23_, G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
		result = (GObject*) ((ProtonPlusWidgetsGamesGameRow*) _tmp25_);
		_g_object_unref0 (first);
		return result;
	}
	_tmp26_ = self->priv->wide_selection_cells;
	_tmp27_ = first;
	_tmp28_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp26_, G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, ProtonPlusWidgetsGamesGameListItem));
	result = (GObject*) ((ProtonPlusWidgetsGamesGameSelectionCell*) _tmp28_);
	_g_object_unref0 (first);
	return result;
}

static gboolean
proton_plus_widgets_games_box_real_controller_navigate_back (ProtonPlusUtilsControllerNavigationHost* base)
{
	ProtonPlusWidgetsGamesBox * self;
	gboolean result;
	self = (ProtonPlusWidgetsGamesBox*) base;
	result = proton_plus_widgets_games_box_pop_page (self);
	return result;
}

static gboolean
proton_plus_widgets_games_box_real_controller_can_navigate_back (ProtonPlusUtilsControllerNavigationHost* base)
{
	ProtonPlusWidgetsGamesBox * self;
	AdwNavigationView* _tmp0_;
	AdwNavigationPage* _tmp1_;
	AdwNavigationPage* _tmp2_;
	gboolean result;
	self = (ProtonPlusWidgetsGamesBox*) base;
	_tmp0_ = self->priv->navigation_view;
	_tmp1_ = adw_navigation_view_get_visible_page (_tmp0_);
	_tmp2_ = self->priv->mass_edit_page;
	result = _tmp1_ == _tmp2_;
	return result;
}

static gboolean
proton_plus_widgets_games_box_real_controller_can_switch_page (ProtonPlusUtilsControllerNavigationHost* base)
{
	ProtonPlusWidgetsGamesBox * self;
	gboolean result;
	self = (ProtonPlusWidgetsGamesBox*) base;
	result = FALSE;
	return result;
}

static gboolean
proton_plus_widgets_games_box_real_controller_prefers_initial_focus_after_switch (ProtonPlusUtilsControllerNavigationHost* base)
{
	ProtonPlusWidgetsGamesBox * self;
	gboolean result;
	self = (ProtonPlusWidgetsGamesBox*) base;
	result = FALSE;
	return result;
}

static gboolean
proton_plus_widgets_games_box_real_controller_switch_page (ProtonPlusUtilsControllerNavigationHost* base,
                                                           gint delta)
{
	ProtonPlusWidgetsGamesBox * self;
	gboolean result;
	self = (ProtonPlusWidgetsGamesBox*) base;
	result = FALSE;
	return result;
}

static gboolean
proton_plus_widgets_games_box_real_controller_can_open_search (ProtonPlusUtilsControllerPageShortcuts* base)
{
	ProtonPlusWidgetsGamesBox * self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	AdwNavigationView* _tmp3_;
	AdwNavigationPage* _tmp4_;
	AdwNavigationPage* _tmp5_;
	gboolean result;
	self = (ProtonPlusWidgetsGamesBox*) base;
	_tmp3_ = self->priv->navigation_view;
	_tmp4_ = adw_navigation_view_get_visible_page (_tmp3_);
	_tmp5_ = self->priv->list_page;
	if (_tmp4_ == _tmp5_) {
		GtkSearchEntry* _tmp6_;
		_tmp6_ = self->priv->search_entry;
		_tmp2_ = gtk_widget_get_mapped ((GtkWidget*) _tmp6_);
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		GtkSearchEntry* _tmp7_;
		_tmp7_ = self->priv->search_entry;
		_tmp1_ = gtk_widget_is_visible ((GtkWidget*) _tmp7_);
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GtkSearchEntry* _tmp8_;
		_tmp8_ = self->priv->search_entry;
		_tmp0_ = gtk_widget_is_sensitive ((GtkWidget*) _tmp8_);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

gboolean
proton_plus_widgets_games_box_search_available (ProtonPlusWidgetsGamesBox* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	AdwNavigationView* _tmp2_;
	AdwNavigationPage* _tmp3_;
	AdwNavigationPage* _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp2_ = self->priv->navigation_view;
	_tmp3_ = adw_navigation_view_get_visible_page (_tmp2_);
	_tmp4_ = self->priv->list_page;
	if (_tmp3_ == _tmp4_) {
		GtkBox* _tmp5_;
		_tmp5_ = self->priv->games_card;
		_tmp1_ = gtk_widget_is_visible ((GtkWidget*) _tmp5_);
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GtkSearchEntry* _tmp6_;
		_tmp6_ = self->priv->search_entry;
		_tmp0_ = gtk_widget_is_sensitive ((GtkWidget*) _tmp6_);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gboolean
proton_plus_widgets_games_box_real_controller_can_open_filter (ProtonPlusUtilsControllerPageShortcuts* base)
{
	ProtonPlusWidgetsGamesBox * self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	AdwNavigationView* _tmp3_;
	AdwNavigationPage* _tmp4_;
	AdwNavigationPage* _tmp5_;
	gboolean result;
	self = (ProtonPlusWidgetsGamesBox*) base;
	_tmp3_ = self->priv->navigation_view;
	_tmp4_ = adw_navigation_view_get_visible_page (_tmp3_);
	_tmp5_ = self->priv->list_page;
	if (_tmp4_ == _tmp5_) {
		GtkMenuButton* _tmp6_;
		_tmp6_ = self->priv->filter_button;
		_tmp2_ = gtk_widget_get_mapped ((GtkWidget*) _tmp6_);
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		GtkMenuButton* _tmp7_;
		_tmp7_ = self->priv->filter_button;
		_tmp1_ = gtk_widget_is_visible ((GtkWidget*) _tmp7_);
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GtkMenuButton* _tmp8_;
		_tmp8_ = self->priv->filter_button;
		_tmp0_ = gtk_widget_is_sensitive ((GtkWidget*) _tmp8_);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gboolean
proton_plus_widgets_games_box_real_controller_open_search (ProtonPlusUtilsControllerPageShortcuts* base)
{
	ProtonPlusWidgetsGamesBox * self;
	gboolean _tmp0_ = FALSE;
	gboolean result;
	self = (ProtonPlusWidgetsGamesBox*) base;
	if (proton_plus_utils_controller_page_shortcuts_controller_can_open_search ((ProtonPlusUtilsControllerPageShortcuts*) self)) {
		GtkSearchEntry* _tmp1_;
		_tmp1_ = self->priv->search_entry;
		_tmp0_ = gtk_widget_grab_focus ((GtkWidget*) _tmp1_);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gboolean
proton_plus_widgets_games_box_real_controller_open_filter (ProtonPlusUtilsControllerPageShortcuts* base)
{
	ProtonPlusWidgetsGamesBox * self;
	GtkMenuButton* _tmp0_;
	gboolean result;
	self = (ProtonPlusWidgetsGamesBox*) base;
	if (!proton_plus_utils_controller_page_shortcuts_controller_can_open_filter ((ProtonPlusUtilsControllerPageShortcuts*) self)) {
		result = FALSE;
		return result;
	}
	_tmp0_ = self->priv->filter_button;
	gtk_menu_button_popup (_tmp0_);
	result = TRUE;
	return result;
}

static void
proton_plus_widgets_games_box_real_dispose (GObject* base)
{
	ProtonPlusWidgetsGamesBox * self;
	self = (ProtonPlusWidgetsGamesBox*) base;
	if (self->priv->search_timeout_id != ((guint) 0)) {
		g_source_remove (self->priv->search_timeout_id);
		self->priv->search_timeout_id = (guint) 0;
	}
	proton_plus_widgets_games_box_cancel_focus_idle (self);
	G_OBJECT_CLASS (proton_plus_widgets_games_box_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_box_get_type (), GtkBox));
}

ProtonPlusWidgetsGamesBox*
proton_plus_widgets_games_box_construct (GType object_type)
{
	ProtonPlusWidgetsGamesBox * self = NULL;
	self = (ProtonPlusWidgetsGamesBox*) g_object_new (object_type, NULL);
	return self;
}

ProtonPlusWidgetsGamesBox*
proton_plus_widgets_games_box_new (void)
{
	return proton_plus_widgets_games_box_construct (PROTON_PLUS_WIDGETS_GAMES_TYPE_BOX);
}

static gboolean
proton_plus_widgets_games_box_get_error (ProtonPlusWidgetsGamesBox* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_error;
	return result;
}

static void
proton_plus_widgets_games_box_set_error (ProtonPlusWidgetsGamesBox* self,
                                         gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_error = value;
}

static gboolean
proton_plus_widgets_games_box_get_invalid (ProtonPlusWidgetsGamesBox* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_invalid;
	return result;
}

static void
proton_plus_widgets_games_box_set_invalid (ProtonPlusWidgetsGamesBox* self,
                                           gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_invalid = value;
}

static void
_proton_plus_widgets_games_box___lambda226_ (ProtonPlusWidgetsGamesBox* self)
{
	proton_plus_widgets_games_box_switch_collection_view (self, TRUE);
}

static void
__proton_plus_widgets_games_box___lambda226__adw_breakpoint_apply (AdwBreakpoint* _sender,
                                                                   gpointer self)
{
	_proton_plus_widgets_games_box___lambda226_ ((ProtonPlusWidgetsGamesBox*) self);
}

static void
_proton_plus_widgets_games_box___lambda227_ (ProtonPlusWidgetsGamesBox* self)
{
	proton_plus_widgets_games_box_switch_collection_view (self, FALSE);
}

static void
__proton_plus_widgets_games_box___lambda227__adw_breakpoint_unapply (AdwBreakpoint* _sender,
                                                                     gpointer self)
{
	_proton_plus_widgets_games_box___lambda227_ ((ProtonPlusWidgetsGamesBox*) self);
}

static void
_proton_plus_widgets_games_box___lambda228_ (ProtonPlusWidgetsGamesBox* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gboolean _tmp3_;
	_tmp0_ = self->priv->search_query;
	_tmp1_ = string_strip (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strcmp0 (_tmp2_, "") != 0;
	_g_free0 (_tmp2_);
	if (_tmp3_) {
		GtkSearchEntry* _tmp4_;
		GtkSearchEntry* _tmp5_;
		_tmp4_ = self->priv->search_entry;
		gtk_editable_set_text ((GtkEditable*) _tmp4_, "");
		_tmp5_ = self->priv->search_entry;
		gtk_widget_grab_focus ((GtkWidget*) _tmp5_);
	} else {
		GtkCheckButton* _tmp6_;
		gboolean _tmp7_;
		gboolean _tmp8_;
		_tmp6_ = self->priv->all_filter_check;
		_tmp7_ = gtk_check_button_get_active (_tmp6_);
		_tmp8_ = _tmp7_;
		if (!_tmp8_) {
			GtkCheckButton* _tmp9_;
			GtkMenuButton* _tmp10_;
			_tmp9_ = self->priv->all_filter_check;
			gtk_check_button_set_active (_tmp9_, TRUE);
			_tmp10_ = self->priv->filter_button;
			gtk_widget_grab_focus ((GtkWidget*) _tmp10_);
		}
	}
}

static void
__proton_plus_widgets_games_box___lambda228__gtk_button_clicked (GtkButton* _sender,
                                                                 gpointer self)
{
	_proton_plus_widgets_games_box___lambda228_ ((ProtonPlusWidgetsGamesBox*) self);
}

static gboolean
_proton_plus_widgets_games_box_focus_last_visible_game_proton_plus_widgets_games_focus_last_visible_game_request (gpointer self)
{
	gboolean result;
	result = proton_plus_widgets_games_box_focus_last_visible_game ((ProtonPlusWidgetsGamesBox*) self);
	return result;
}

static void
_proton_plus_widgets_games_box___lambda229_ (ProtonPlusWidgetsGamesBox* self)
{
	ProtonPlusWidgetsGamesGameListItem** selected = NULL;
	ProtonPlusWidgetsGamesGameCollection* _tmp0_;
	gint _tmp1_ = 0;
	ProtonPlusWidgetsGamesGameListItem** _tmp2_;
	gint selected_length1;
	gint _selected_size_;
	ProtonPlusWidgetsGamesGameListItem** _tmp3_;
	gint _tmp3__length1;
	ProtonPlusWidgetsMainWarningDialog* dialog = NULL;
	ProtonPlusWidgetsMainWarningDialog* _tmp5_;
	ProtonPlusWidgetsMainWarningDialog* _tmp6_;
	ProtonPlusWidgetsGamesMassEditButton* _tmp7_;
	GtkRoot* _tmp8_;
	_tmp0_ = self->priv->games;
	_tmp2_ = proton_plus_widgets_games_game_collection_selected_items (_tmp0_, &_tmp1_);
	selected = _tmp2_;
	selected_length1 = _tmp1_;
	_selected_size_ = selected_length1;
	_tmp3_ = selected;
	_tmp3__length1 = selected_length1;
	if (_tmp3__length1 > 0) {
		ProtonPlusWidgetsGamesGameListItem** _tmp4_;
		gint _tmp4__length1;
		_tmp4_ = selected;
		_tmp4__length1 = selected_length1;
		proton_plus_widgets_games_box_open_mass_edit (self, _tmp4_, (gint) _tmp4__length1);
		selected = (_vala_array_free (selected, selected_length1, (GDestroyNotify) g_object_unref), NULL);
		return;
	}
	_tmp5_ = proton_plus_widgets_main_warning_dialog_new (_ ("Warning"), _ ("Please make sure to select at least one game before using the mass edi" \
"t feature."));
	g_object_ref_sink (_tmp5_);
	dialog = _tmp5_;
	_tmp6_ = dialog;
	_tmp7_ = self->priv->mass_edit_button;
	_tmp8_ = gtk_widget_get_root ((GtkWidget*) _tmp7_);
	proton_plus_widgets_window_present_dialog_for_controller ((AdwDialog*) _tmp6_, (GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_window_get_type (), GtkWindow));
	_g_object_unref0 (dialog);
	selected = (_vala_array_free (selected, selected_length1, (GDestroyNotify) g_object_unref), NULL);
}

static void
__proton_plus_widgets_games_box___lambda229__proton_plus_widgets_games_mass_edit_button_mass_edit_requested (ProtonPlusWidgetsGamesMassEditButton* _sender,
                                                                                                             gpointer self)
{
	_proton_plus_widgets_games_box___lambda229_ ((ProtonPlusWidgetsGamesBox*) self);
}

static void
_proton_plus_widgets_games_box___lambda230_ (ProtonPlusWidgetsGamesBox* self)
{
	proton_plus_widgets_games_box_update_empty_state (self);
	proton_plus_widgets_games_box_update_selection_controls (self);
}

static void
__proton_plus_widgets_games_box___lambda230__proton_plus_widgets_games_game_collection_state_changed (ProtonPlusWidgetsGamesGameCollection* _sender,
                                                                                                      gpointer self)
{
	_proton_plus_widgets_games_box___lambda230_ ((ProtonPlusWidgetsGamesBox*) self);
}

static gboolean
_proton_plus_widgets_games_box_focus_games_toolbar_proton_plus_widgets_games_game_boundary_focus_request (gpointer self)
{
	gboolean result;
	result = proton_plus_widgets_games_box_focus_games_toolbar ((ProtonPlusWidgetsGamesBox*) self);
	return result;
}

static gboolean
_proton_plus_widgets_games_box_focus_first_visible_game_proton_plus_widgets_games_game_boundary_focus_request (gpointer self)
{
	gboolean result;
	result = proton_plus_widgets_games_box_focus_first_visible_game ((ProtonPlusWidgetsGamesBox*) self);
	return result;
}

static gboolean
_proton_plus_widgets_games_box_focus_first_visible_game_title_proton_plus_widgets_games_game_boundary_focus_request (gpointer self)
{
	gboolean result;
	result = proton_plus_widgets_games_box_focus_first_visible_game_title ((ProtonPlusWidgetsGamesBox*) self);
	return result;
}

static void
_proton_plus_widgets_games_box___lambda231_ (ProtonPlusWidgetsGamesBox* self)
{
	proton_plus_widgets_games_box_pop_page (self);
}

static void
__proton_plus_widgets_games_box___lambda231__proton_plus_widgets_games_mass_edit_view_back_requested (ProtonPlusWidgetsGamesMassEditView* _sender,
                                                                                                      gpointer self)
{
	_proton_plus_widgets_games_box___lambda231_ ((ProtonPlusWidgetsGamesBox*) self);
}

static void
_proton_plus_widgets_games_box___lambda232_ (ProtonPlusWidgetsGamesBox* self,
                                             AdwNavigationPage* page)
{
	AdwNavigationPage* _tmp0_;
	g_return_if_fail (page != NULL);
	_tmp0_ = self->priv->mass_edit_page;
	if (page == _tmp0_) {
		proton_plus_widgets_games_box_cleanup_mass_edit_exit (self);
	}
}

static void
__proton_plus_widgets_games_box___lambda232__adw_navigation_view_popped (AdwNavigationView* _sender,
                                                                         AdwNavigationPage* page,
                                                                         gpointer self)
{
	_proton_plus_widgets_games_box___lambda232_ ((ProtonPlusWidgetsGamesBox*) self, page);
}

static void
_proton_plus_widgets_games_box___lambda233_ (ProtonPlusWidgetsGamesBox* self)
{
	ProtonPlusWidgetsHeaderPresentation* _tmp0_;
	ProtonPlusWidgetsHeaderPresentation* _tmp1_;
	_tmp0_ = proton_plus_widgets_games_box_get_header_presentation (self);
	_tmp1_ = _tmp0_;
	g_signal_emit (self, proton_plus_widgets_games_box_signals[PROTON_PLUS_WIDGETS_GAMES_BOX_HEADER_PRESENTATION_CHANGED_SIGNAL], 0, _tmp1_);
	_g_object_unref0 (_tmp1_);
}

static void
__proton_plus_widgets_games_box___lambda233__g_object_notify (GObject* _sender,
                                                              GParamSpec* pspec,
                                                              gpointer self)
{
	_proton_plus_widgets_games_box___lambda233_ ((ProtonPlusWidgetsGamesBox*) self);
}

static GObject *
proton_plus_widgets_games_box_constructor (GType type,
                                           guint n_construct_properties,
                                           GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ProtonPlusWidgetsGamesBox * self;
	GtkImage* _tmp0_;
	AdwStatusPage* _tmp1_ = NULL;
	ProtonPlusWidgetsGamesGameCollection* _tmp2_;
	GeeHashMap* _tmp3_;
	GeeHashMap* _tmp4_;
	GeeHashMap* _tmp5_;
	GeeHashMap* _tmp6_;
	GtkColumnView* _tmp7_;
	GtkListView* _tmp8_;
	GtkStack* _tmp9_ = NULL;
	GtkStack* _tmp10_;
	GtkColumnView* _tmp11_;
	GtkScrolledWindow* _tmp12_;
	GtkScrolledWindow* _tmp13_;
	GtkStack* _tmp14_;
	GtkListView* _tmp15_;
	GtkScrolledWindow* _tmp16_;
	GtkScrolledWindow* _tmp17_;
	GtkStack* _tmp18_;
	AdwBreakpointBin* responsive_views = NULL;
	AdwBreakpointBin* _tmp19_;
	AdwBreakpointBin* _tmp20_;
	AdwBreakpointBin* _tmp21_;
	GtkStack* _tmp22_;
	AdwBreakpoint* narrow_breakpoint = NULL;
	AdwBreakpointCondition* _tmp23_;
	AdwBreakpoint* _tmp24_;
	AdwBreakpoint* _tmp25_;
	AdwBreakpoint* _tmp26_;
	AdwBreakpointBin* _tmp27_;
	AdwBreakpoint* _tmp28_;
	AdwBreakpoint* _tmp29_;
	AdwSpinner* _tmp30_ = NULL;
	AdwSpinner* _tmp31_;
	gchar* _tmp32_;
	gchar* _tmp33_;
	gchar* _tmp34_;
	AdwStatusPage* _tmp35_ = NULL;
	GtkButton* _tmp36_ = NULL;
	GtkButton* _tmp37_;
	GtkButton* _tmp38_;
	AdwStatusPage* _tmp39_;
	GtkButton* _tmp40_;
	GtkStack* _tmp41_ = NULL;
	GtkStack* _tmp42_;
	AdwBreakpointBin* _tmp43_;
	GtkStack* _tmp44_;
	AdwStatusPage* _tmp45_;
	GtkStack* _tmp46_;
	GtkWidget* _tmp47_;
	GtkOverlay* _tmp48_ = NULL;
	ProtonPlusWidgetsGamesMassEditButton* _tmp49_ = NULL;
	ProtonPlusWidgetsGamesMassEditButton* _tmp50_;
	ProtonPlusWidgetsGamesGameCollection* _tmp51_;
	GtkBox* _tmp52_ = NULL;
	GtkBox* _tmp53_;
	GtkBox* _tmp54_;
	GtkBox* _tmp55_;
	GtkBox* _tmp56_;
	GtkBox* _tmp57_;
	GtkOverlay* _tmp58_;
	GtkBox* _tmp59_;
	GtkColumnView* _tmp60_;
	GtkListView* _tmp61_;
	ProtonPlusWidgetsGamesGameListControllerBox* _tmp62_ = NULL;
	ProtonPlusWidgetsGamesGameListControllerBox* _tmp63_;
	GtkBox* _tmp64_;
	ProtonPlusWidgetsGamesGameListControllerBox* _tmp65_;
	ProtonPlusWidgetsGamesMassEditButton* _tmp66_;
	ProtonPlusWidgetsGamesGameListControllerBox* _tmp67_;
	AdwStatusPage* _tmp68_;
	AdwClamp* games_page_clamp = NULL;
	ProtonPlusWidgetsGamesGameListControllerBox* _tmp69_;
	GtkWidget* _tmp70_;
	AdwClamp* _tmp71_ = NULL;
	GtkMenuButton* _tmp72_;
	ProtonPlusWidgetsGamesMassEditView* _tmp73_;
	ProtonPlusWidgetsGamesMassEditView* _tmp74_;
	AdwClamp* _tmp75_;
	AdwNavigationPage* _tmp76_;
	ProtonPlusWidgetsGamesMassEditView* _tmp77_;
	AdwNavigationPage* _tmp78_;
	AdwNavigationView* _tmp79_ = NULL;
	AdwNavigationView* _tmp80_;
	AdwNavigationPage* _tmp81_;
	AdwNavigationView* _tmp82_;
	AdwNavigationPage* _tmp83_;
	AdwNavigationView* _tmp84_;
	AdwNavigationView* _tmp85_;
	AdwNavigationView* _tmp86_;
	GtkPropertyExpression* _tmp87_;
	AdwNavigationView* _tmp88_;
	parent_class = G_OBJECT_CLASS (proton_plus_widgets_games_box_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_GAMES_TYPE_BOX, ProtonPlusWidgetsGamesBox);
	_tmp0_ = (GtkImage*) gtk_image_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->image);
	self->priv->image = _tmp0_;
	_tmp1_ = (AdwStatusPage*) adw_status_page_new ();
	gtk_widget_set_visible ((GtkWidget*) _tmp1_, FALSE);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->status_page);
	self->priv->status_page = _tmp1_;
	_tmp2_ = proton_plus_widgets_games_game_collection_new ();
	_g_object_unref0 (self->priv->games);
	self->priv->games = _tmp2_;
	_tmp3_ = gee_hash_map_new (PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_ROW, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->narrow_rows);
	self->priv->narrow_rows = _tmp3_;
	_tmp4_ = gee_hash_map_new (PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_SELECTION_CELL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->wide_selection_cells);
	self->priv->wide_selection_cells = _tmp4_;
	_tmp5_ = gee_hash_map_new (PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_TITLE_CELL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->wide_title_cells);
	self->priv->wide_title_cells = _tmp5_;
	_tmp6_ = gee_hash_map_new (PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_LIST_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, PROTON_PLUS_WIDGETS_GAMES_TYPE_GAME_ACTIONS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->wide_action_cells);
	self->priv->wide_action_cells = _tmp6_;
	_tmp7_ = proton_plus_widgets_games_box_build_wide_view (self);
	_g_object_unref0 (self->priv->wide_view);
	self->priv->wide_view = _tmp7_;
	_tmp8_ = proton_plus_widgets_games_box_build_narrow_view (self);
	_g_object_unref0 (self->priv->narrow_view);
	self->priv->narrow_view = _tmp8_;
	_tmp9_ = (GtkStack*) gtk_stack_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp9_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp9_, TRUE);
	gtk_stack_set_transition_type (_tmp9_, GTK_STACK_TRANSITION_TYPE_CROSSFADE);
	gtk_stack_set_transition_duration (_tmp9_, (guint) 150);
	g_object_ref_sink (_tmp9_);
	_g_object_unref0 (self->priv->views_stack);
	self->priv->views_stack = _tmp9_;
	_tmp10_ = self->priv->views_stack;
	_tmp11_ = self->priv->wide_view;
	_tmp12_ = proton_plus_widgets_games_box_create_collection_scroller (self, (GtkWidget*) _tmp11_);
	_tmp13_ = _tmp12_;
	gtk_stack_add_named (_tmp10_, (GtkWidget*) _tmp13_, "wide");
	_g_object_unref0 (_tmp13_);
	_tmp14_ = self->priv->views_stack;
	_tmp15_ = self->priv->narrow_view;
	_tmp16_ = proton_plus_widgets_games_box_create_collection_scroller (self, (GtkWidget*) _tmp15_);
	_tmp17_ = _tmp16_;
	gtk_stack_add_named (_tmp14_, (GtkWidget*) _tmp17_, "narrow");
	_g_object_unref0 (_tmp17_);
	_tmp18_ = self->priv->views_stack;
	gtk_stack_set_visible_child_name (_tmp18_, "wide");
	_tmp19_ = (AdwBreakpointBin*) adw_breakpoint_bin_new ();
	g_object_ref_sink (_tmp19_);
	responsive_views = _tmp19_;
	_tmp20_ = responsive_views;
	gtk_widget_set_size_request ((GtkWidget*) _tmp20_, 360, 1);
	_tmp21_ = responsive_views;
	_tmp22_ = self->priv->views_stack;
	adw_breakpoint_bin_set_child (_tmp21_, (GtkWidget*) _tmp22_);
	_tmp23_ = adw_breakpoint_condition_new_length (ADW_BREAKPOINT_CONDITION_MAX_WIDTH, (gdouble) PROTON_PLUS_WIDGETS_GAMES_BOX_NARROW_VIEW_WIDTH, ADW_LENGTH_UNIT_SP);
	_tmp24_ = adw_breakpoint_new (_tmp23_);
	narrow_breakpoint = _tmp24_;
	_tmp25_ = narrow_breakpoint;
	g_signal_connect_object (_tmp25_, "apply", (GCallback) __proton_plus_widgets_games_box___lambda226__adw_breakpoint_apply, self, 0);
	_tmp26_ = narrow_breakpoint;
	g_signal_connect_object (_tmp26_, "unapply", (GCallback) __proton_plus_widgets_games_box___lambda227__adw_breakpoint_unapply, self, 0);
	_tmp27_ = responsive_views;
	_tmp28_ = narrow_breakpoint;
	_tmp29_ = _g_object_ref0 (_tmp28_);
	adw_breakpoint_bin_add_breakpoint (_tmp27_, _tmp29_);
	_tmp30_ = (AdwSpinner*) adw_spinner_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp30_, GTK_ALIGN_CENTER);
	gtk_widget_set_valign ((GtkWidget*) _tmp30_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp30_);
	_g_object_unref0 (self->priv->spinner);
	self->priv->spinner = _tmp30_;
	_tmp31_ = self->priv->spinner;
	gtk_widget_set_size_request ((GtkWidget*) _tmp31_, 32, 32);
	_tmp32_ = g_strdup (_ ("No games found"));
	_tmp33_ = g_strdup (_ ("Try a different search term or filter."));
	_tmp34_ = g_strdup ("edit-find-symbolic");
	_tmp35_ = (AdwStatusPage*) adw_status_page_new ();
	adw_status_page_set_title (_tmp35_, _tmp32_);
	_g_free0 (_tmp32_);
	adw_status_page_set_description (_tmp35_, _tmp33_);
	_g_free0 (_tmp33_);
	adw_status_page_set_icon_name (_tmp35_, _tmp34_);
	_g_free0 (_tmp34_);
	g_object_ref_sink (_tmp35_);
	_g_object_unref0 (self->priv->empty_status_page);
	self->priv->empty_status_page = _tmp35_;
	_tmp36_ = (GtkButton*) gtk_button_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp36_, GTK_ALIGN_CENTER);
	gtk_widget_set_visible ((GtkWidget*) _tmp36_, FALSE);
	g_object_ref_sink (_tmp36_);
	_g_object_unref0 (self->priv->empty_action_button);
	self->priv->empty_action_button = _tmp36_;
	_tmp37_ = self->priv->empty_action_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp37_, "suggested-action");
	_tmp38_ = self->priv->empty_action_button;
	g_signal_connect_object (_tmp38_, "clicked", (GCallback) __proton_plus_widgets_games_box___lambda228__gtk_button_clicked, self, 0);
	_tmp39_ = self->priv->empty_status_page;
	_tmp40_ = self->priv->empty_action_button;
	adw_status_page_set_child (_tmp39_, (GtkWidget*) _tmp40_);
	_tmp41_ = (GtkStack*) gtk_stack_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp41_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp41_, TRUE);
	g_object_ref_sink (_tmp41_);
	_g_object_unref0 (self->priv->list_stack);
	self->priv->list_stack = _tmp41_;
	_tmp42_ = self->priv->list_stack;
	_tmp43_ = responsive_views;
	gtk_stack_add_named (_tmp42_, (GtkWidget*) _tmp43_, "list");
	_tmp44_ = self->priv->list_stack;
	_tmp45_ = self->priv->empty_status_page;
	gtk_stack_add_named (_tmp44_, (GtkWidget*) _tmp45_, "empty");
	_tmp46_ = self->priv->list_stack;
	_tmp47_ = _g_object_ref0 ((GtkWidget*) _tmp46_);
	_tmp48_ = (GtkOverlay*) gtk_overlay_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp48_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp48_, TRUE);
	gtk_overlay_set_child (_tmp48_, _tmp47_);
	_g_object_unref0 (_tmp47_);
	g_object_ref_sink (_tmp48_);
	_g_object_unref0 (self->priv->overlay);
	self->priv->overlay = _tmp48_;
	_tmp49_ = proton_plus_widgets_games_mass_edit_button_new (_proton_plus_widgets_games_box_focus_last_visible_game_proton_plus_widgets_games_focus_last_visible_game_request, self);
	gtk_widget_set_visible ((GtkWidget*) _tmp49_, FALSE);
	g_object_ref_sink (_tmp49_);
	_g_object_unref0 (self->priv->mass_edit_button);
	self->priv->mass_edit_button = _tmp49_;
	_tmp50_ = self->priv->mass_edit_button;
	g_signal_connect_object (_tmp50_, "mass-edit-requested", (GCallback) __proton_plus_widgets_games_box___lambda229__proton_plus_widgets_games_mass_edit_button_mass_edit_requested, self, 0);
	proton_plus_widgets_games_box_build_selection_popover (self);
	proton_plus_widgets_games_box_build_filter_popover (self);
	proton_plus_widgets_games_box_build_search_toolbar (self);
	_tmp51_ = self->priv->games;
	g_signal_connect_object (_tmp51_, "state-changed", (GCallback) __proton_plus_widgets_games_box___lambda230__proton_plus_widgets_games_game_collection_state_changed, self, 0);
	_tmp52_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp52_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp52_, TRUE);
	gtk_widget_set_overflow ((GtkWidget*) _tmp52_, GTK_OVERFLOW_HIDDEN);
	g_object_ref_sink (_tmp52_);
	_g_object_unref0 (self->priv->games_card);
	self->priv->games_card = _tmp52_;
	_tmp53_ = self->priv->games_card;
	gtk_widget_add_css_class ((GtkWidget*) _tmp53_, "card");
	_tmp54_ = proton_plus_widgets_games_box_build_toolbar (self);
	_g_object_unref0 (self->priv->toolbar);
	self->priv->toolbar = _tmp54_;
	_tmp55_ = self->priv->games_card;
	_tmp56_ = self->priv->toolbar;
	gtk_box_append (_tmp55_, (GtkWidget*) _tmp56_);
	_tmp57_ = self->priv->games_card;
	_tmp58_ = self->priv->overlay;
	gtk_box_append (_tmp57_, (GtkWidget*) _tmp58_);
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_VERTICAL);
	gtk_box_set_spacing ((GtkBox*) self, 0);
	_tmp59_ = self->priv->toolbar;
	_tmp60_ = self->priv->wide_view;
	_tmp61_ = self->priv->narrow_view;
	_tmp62_ = proton_plus_widgets_games_game_list_controller_box_new ((GtkWidget*) _tmp59_, _tmp60_, (GtkWidget*) _tmp61_, _proton_plus_widgets_games_box_focus_games_toolbar_proton_plus_widgets_games_game_boundary_focus_request, self, _proton_plus_widgets_games_box_focus_first_visible_game_proton_plus_widgets_games_game_boundary_focus_request, self, _proton_plus_widgets_games_box_focus_first_visible_game_title_proton_plus_widgets_games_game_boundary_focus_request, self);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp62_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp62_, TRUE);
	g_object_ref_sink (_tmp62_);
	_g_object_unref0 (self->priv->games_controller_box);
	self->priv->games_controller_box = _tmp62_;
	_tmp63_ = self->priv->games_controller_box;
	_tmp64_ = self->priv->games_card;
	gtk_box_append ((GtkBox*) _tmp63_, (GtkWidget*) _tmp64_);
	_tmp65_ = self->priv->games_controller_box;
	_tmp66_ = self->priv->mass_edit_button;
	gtk_box_append ((GtkBox*) _tmp65_, (GtkWidget*) _tmp66_);
	_tmp67_ = self->priv->games_controller_box;
	_tmp68_ = self->priv->status_page;
	gtk_box_append ((GtkBox*) _tmp67_, (GtkWidget*) _tmp68_);
	_tmp69_ = self->priv->games_controller_box;
	_tmp70_ = _g_object_ref0 ((GtkWidget*) _tmp69_);
	_tmp71_ = (AdwClamp*) adw_clamp_new ();
	gtk_widget_set_vexpand ((GtkWidget*) _tmp71_, TRUE);
	adw_clamp_set_maximum_size (_tmp71_, 975);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp71_, 12);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp71_, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp71_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp71_, 12);
	adw_clamp_set_child (_tmp71_, _tmp70_);
	_g_object_unref0 (_tmp70_);
	g_object_ref_sink (_tmp71_);
	games_page_clamp = _tmp71_;
	_tmp72_ = self->priv->selection_button;
	_tmp73_ = proton_plus_widgets_games_mass_edit_view_new (_tmp72_);
	g_object_ref_sink (_tmp73_);
	_g_object_unref0 (self->priv->mass_edit_view);
	self->priv->mass_edit_view = _tmp73_;
	_tmp74_ = self->priv->mass_edit_view;
	g_signal_connect_object (_tmp74_, "back-requested", (GCallback) __proton_plus_widgets_games_box___lambda231__proton_plus_widgets_games_mass_edit_view_back_requested, self, 0);
	_tmp75_ = games_page_clamp;
	_tmp76_ = adw_navigation_page_new_with_tag ((GtkWidget*) _tmp75_, _ ("Games"), "list");
	g_object_ref_sink (_tmp76_);
	_g_object_unref0 (self->priv->list_page);
	self->priv->list_page = _tmp76_;
	_tmp77_ = self->priv->mass_edit_view;
	_tmp78_ = adw_navigation_page_new_with_tag ((GtkWidget*) _tmp77_, _ ("Games"), "mass-edit");
	g_object_ref_sink (_tmp78_);
	_g_object_unref0 (self->priv->mass_edit_page);
	self->priv->mass_edit_page = _tmp78_;
	_tmp79_ = (AdwNavigationView*) adw_navigation_view_new ();
	gtk_widget_set_vexpand ((GtkWidget*) _tmp79_, TRUE);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp79_, TRUE);
	g_object_ref_sink (_tmp79_);
	_g_object_unref0 (self->priv->navigation_view);
	self->priv->navigation_view = _tmp79_;
	_tmp80_ = self->priv->navigation_view;
	_tmp81_ = self->priv->list_page;
	adw_navigation_view_add (_tmp80_, _tmp81_);
	_tmp82_ = self->priv->navigation_view;
	_tmp83_ = self->priv->mass_edit_page;
	adw_navigation_view_add (_tmp82_, _tmp83_);
	_tmp84_ = self->priv->navigation_view;
	g_signal_connect_object (_tmp84_, "popped", (GCallback) __proton_plus_widgets_games_box___lambda232__adw_navigation_view_popped, self, 0);
	_tmp85_ = self->priv->navigation_view;
	g_signal_connect_object ((GObject*) _tmp85_, "notify::visible-page", (GCallback) __proton_plus_widgets_games_box___lambda233__g_object_notify, self, 0);
	_tmp86_ = self->priv->navigation_view;
	g_object_notify ((GObject*) _tmp86_, "visible-page");
	_tmp87_ = (GtkPropertyExpression*) gtk_property_expression_new (PROTON_PLUS_MODELS_TYPE_COMPATIBILITY_TOOL, NULL, "display_title");
	_gtk_expression_unref0 (self->priv->expression);
	self->priv->expression = _tmp87_;
	_tmp88_ = self->priv->navigation_view;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp88_);
	_g_object_unref0 (games_page_clamp);
	_g_object_unref0 (narrow_breakpoint);
	_g_object_unref0 (responsive_views);
	return obj;
}

static void
proton_plus_widgets_games_box_class_init (ProtonPlusWidgetsGamesBoxClass * klass,
                                          gpointer klass_data)
{
	proton_plus_widgets_games_box_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsGamesBox_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) proton_plus_widgets_games_box_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_games_box_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_games_box_set_property;
	G_OBJECT_CLASS (klass)->constructor = proton_plus_widgets_games_box_constructor;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_games_box_finalize;
	proton_plus_widgets_games_box_signals[PROTON_PLUS_WIDGETS_GAMES_BOX_HEADER_PRESENTATION_CHANGED_SIGNAL] = g_signal_new ("header-presentation-changed", PROTON_PLUS_WIDGETS_GAMES_TYPE_BOX, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, PROTON_PLUS_WIDGETS_HEADER_TYPE_PRESENTATION);
}

static void
proton_plus_widgets_games_box_proton_plus_utils_controller_navigation_host_interface_init (ProtonPlusUtilsControllerNavigationHostIface * iface,
                                                                                           gpointer iface_data)
{
	proton_plus_widgets_games_box_proton_plus_utils_controller_navigation_host_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_controller_page_id = (gchar* (*) (ProtonPlusUtilsControllerNavigationHost*)) proton_plus_widgets_games_box_real_get_controller_page_id;
	iface->get_controller_page_root = (GObject* (*) (ProtonPlusUtilsControllerNavigationHost*)) proton_plus_widgets_games_box_real_get_controller_page_root;
	iface->get_controller_initial_focus = (GObject* (*) (ProtonPlusUtilsControllerNavigationHost*)) proton_plus_widgets_games_box_real_get_controller_initial_focus;
	iface->controller_navigate_back = (gboolean (*) (ProtonPlusUtilsControllerNavigationHost*)) proton_plus_widgets_games_box_real_controller_navigate_back;
	iface->controller_can_navigate_back = (gboolean (*) (ProtonPlusUtilsControllerNavigationHost*)) proton_plus_widgets_games_box_real_controller_can_navigate_back;
	iface->controller_can_switch_page = (gboolean (*) (ProtonPlusUtilsControllerNavigationHost*)) proton_plus_widgets_games_box_real_controller_can_switch_page;
	iface->controller_prefers_initial_focus_after_switch = (gboolean (*) (ProtonPlusUtilsControllerNavigationHost*)) proton_plus_widgets_games_box_real_controller_prefers_initial_focus_after_switch;
	iface->controller_switch_page = (gboolean (*) (ProtonPlusUtilsControllerNavigationHost*, gint)) proton_plus_widgets_games_box_real_controller_switch_page;
}

static void
proton_plus_widgets_games_box_proton_plus_utils_controller_page_shortcuts_interface_init (ProtonPlusUtilsControllerPageShortcutsIface * iface,
                                                                                          gpointer iface_data)
{
	proton_plus_widgets_games_box_proton_plus_utils_controller_page_shortcuts_parent_iface = g_type_interface_peek_parent (iface);
	iface->controller_can_open_search = (gboolean (*) (ProtonPlusUtilsControllerPageShortcuts*)) proton_plus_widgets_games_box_real_controller_can_open_search;
	iface->controller_can_open_filter = (gboolean (*) (ProtonPlusUtilsControllerPageShortcuts*)) proton_plus_widgets_games_box_real_controller_can_open_filter;
	iface->controller_open_search = (gboolean (*) (ProtonPlusUtilsControllerPageShortcuts*)) proton_plus_widgets_games_box_real_controller_open_search;
	iface->controller_open_filter = (gboolean (*) (ProtonPlusUtilsControllerPageShortcuts*)) proton_plus_widgets_games_box_real_controller_open_filter;
}

static void
proton_plus_widgets_games_box_instance_init (ProtonPlusWidgetsGamesBox * self,
                                             gpointer klass)
{
	gchar* _tmp0_;
	self->priv = proton_plus_widgets_games_box_get_instance_private (self);
	self->priv->narrow_view_active = FALSE;
	_tmp0_ = g_strdup ("");
	self->priv->search_query = _tmp0_;
	self->priv->search_timeout_id = (guint) 0;
	self->priv->focus_idle_id = (guint) 0;
	self->priv->updating_selection_toggle = FALSE;
	self->priv->mass_edit_cleanup_pending = FALSE;
	self->priv->selection_mode_active = FALSE;
}

static void
proton_plus_widgets_games_box_finalize (GObject * obj)
{
	ProtonPlusWidgetsGamesBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_GAMES_TYPE_BOX, ProtonPlusWidgetsGamesBox);
	_g_object_unref0 (self->priv->launcher);
	_g_object_unref0 (self->priv->image);
	_g_object_unref0 (self->priv->status_page);
	_g_object_unref0 (self->priv->mass_edit_button);
	_g_object_unref0 (self->priv->search_entry);
	_g_object_unref0 (self->priv->check_button);
	_g_object_unref0 (self->priv->toolbar);
	_g_object_unref0 (self->priv->games_card);
	_g_object_unref0 (self->priv->navigation_view);
	_g_object_unref0 (self->priv->list_page);
	_g_object_unref0 (self->priv->mass_edit_page);
	_g_object_unref0 (self->priv->list_stack);
	_g_object_unref0 (self->priv->views_stack);
	_g_object_unref0 (self->priv->empty_status_page);
	_g_object_unref0 (self->priv->empty_action_button);
	_g_object_unref0 (self->priv->wide_view);
	_g_object_unref0 (self->priv->games_controller_box);
	_g_object_unref0 (self->priv->actions_column);
	_g_object_unref0 (self->priv->narrow_view);
	_g_object_unref0 (self->priv->filter_button);
	_g_object_unref0 (self->priv->all_filter_check);
	_g_object_unref0 (self->priv->non_steam_filter_check);
	_g_object_unref0 (self->priv->native_filter_check);
	_g_object_unref0 (self->priv->spinner);
	_g_object_unref0 (self->priv->overlay);
	_g_object_unref0 (self->priv->mass_edit_view);
	_g_object_unref0 (self->priv->games);
	_g_object_unref0 (self->priv->compatibility_tool_model);
	_gtk_expression_unref0 (self->priv->expression);
	_g_object_unref0 (self->priv->selection_button);
	_g_object_unref0 (self->priv->selection_list_box);
	_g_object_unref0 (self->priv->selection_popover);
	_g_object_unref0 (self->priv->selection_popover_title);
	_g_object_unref0 (self->priv->narrow_rows);
	_g_object_unref0 (self->priv->wide_selection_cells);
	_g_object_unref0 (self->priv->wide_title_cells);
	_g_object_unref0 (self->priv->wide_action_cells);
	_g_object_unref0 (self->priv->last_focused_item);
	_g_free0 (self->priv->search_query);
	G_OBJECT_CLASS (proton_plus_widgets_games_box_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_games_box_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsGamesBoxClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_games_box_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsGamesBox), 0, (GInstanceInitFunc) proton_plus_widgets_games_box_instance_init, NULL };
	static const GInterfaceInfo proton_plus_utils_controller_navigation_host_info = { (GInterfaceInitFunc) proton_plus_widgets_games_box_proton_plus_utils_controller_navigation_host_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo proton_plus_utils_controller_page_shortcuts_info = { (GInterfaceInitFunc) proton_plus_widgets_games_box_proton_plus_utils_controller_page_shortcuts_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType proton_plus_widgets_games_box_type_id;
	proton_plus_widgets_games_box_type_id = g_type_register_static (gtk_box_get_type (), "ProtonPlusWidgetsGamesBox", &g_define_type_info, 0);
	g_type_add_interface_static (proton_plus_widgets_games_box_type_id, PROTON_PLUS_UTILS_TYPE_CONTROLLER_NAVIGATION_HOST, &proton_plus_utils_controller_navigation_host_info);
	g_type_add_interface_static (proton_plus_widgets_games_box_type_id, PROTON_PLUS_UTILS_TYPE_CONTROLLER_PAGE_SHORTCUTS, &proton_plus_utils_controller_page_shortcuts_info);
	ProtonPlusWidgetsGamesBox_private_offset = g_type_add_instance_private (proton_plus_widgets_games_box_type_id, sizeof (ProtonPlusWidgetsGamesBoxPrivate));
	return proton_plus_widgets_games_box_type_id;
}

GType
proton_plus_widgets_games_box_get_type (void)
{
	static volatile gsize proton_plus_widgets_games_box_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_games_box_type_id__once)) {
		GType proton_plus_widgets_games_box_type_id;
		proton_plus_widgets_games_box_type_id = proton_plus_widgets_games_box_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_games_box_type_id__once, proton_plus_widgets_games_box_type_id);
	}
	return proton_plus_widgets_games_box_type_id__once;
}

static void
_vala_proton_plus_widgets_games_box_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_TYPE_BOX, ProtonPlusWidgetsGamesBox);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_widgets_games_box_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec)
{
	ProtonPlusWidgetsGamesBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_GAMES_TYPE_BOX, ProtonPlusWidgetsGamesBox);
	switch (property_id) {
		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);
}

