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

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

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

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

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

typedef struct _GamesPlatformsPage GamesPlatformsPage;
typedef struct _GamesPlatformsPageClass GamesPlatformsPageClass;
typedef struct _GamesPlatformsPagePrivate GamesPlatformsPagePrivate;

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

typedef struct _GamesGamesPage GamesGamesPage;
typedef struct _GamesGamesPageClass GamesGamesPageClass;

#define GAMES_TYPE_GAMEPAD_BROWSE (games_gamepad_browse_get_type ())
#define GAMES_GAMEPAD_BROWSE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_GAMEPAD_BROWSE, GamesGamepadBrowse))
#define GAMES_GAMEPAD_BROWSE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_GAMEPAD_BROWSE, GamesGamepadBrowseClass))
#define GAMES_IS_GAMEPAD_BROWSE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_GAMEPAD_BROWSE))
#define GAMES_IS_GAMEPAD_BROWSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_GAMEPAD_BROWSE))
#define GAMES_GAMEPAD_BROWSE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_GAMEPAD_BROWSE, GamesGamepadBrowseClass))

typedef struct _GamesGamepadBrowse GamesGamepadBrowse;
typedef struct _GamesGamepadBrowseClass GamesGamepadBrowseClass;

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

typedef struct _GamesGameModel GamesGameModel;
typedef struct _GamesGameModelClass GamesGameModelClass;
enum  {
	GAMES_PLATFORMS_PAGE_0_PROPERTY,
	GAMES_PLATFORMS_PAGE_GAME_MODEL_PROPERTY,
	GAMES_PLATFORMS_PAGE_IS_ACTIVE_PROPERTY,
	GAMES_PLATFORMS_PAGE_IS_FOLDED_PROPERTY,
	GAMES_PLATFORMS_PAGE_IS_SUBVIEW_OPEN_PROPERTY,
	GAMES_PLATFORMS_PAGE_SUBVIEW_TITLE_PROPERTY,
	GAMES_PLATFORMS_PAGE_IS_SELECTION_MODE_PROPERTY,
	GAMES_PLATFORMS_PAGE_IS_SEARCH_EMPTY_PROPERTY,
	GAMES_PLATFORMS_PAGE_NUM_PROPERTIES
};
static GParamSpec* games_platforms_page_properties[GAMES_PLATFORMS_PAGE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define GAMES_TYPE_PLATFORM_LIST_ITEM (games_platform_list_item_get_type ())
#define GAMES_PLATFORM_LIST_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_PLATFORM_LIST_ITEM, GamesPlatformListItem))
#define GAMES_PLATFORM_LIST_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_PLATFORM_LIST_ITEM, GamesPlatformListItemClass))
#define GAMES_IS_PLATFORM_LIST_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_PLATFORM_LIST_ITEM))
#define GAMES_IS_PLATFORM_LIST_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_PLATFORM_LIST_ITEM))
#define GAMES_PLATFORM_LIST_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_PLATFORM_LIST_ITEM, GamesPlatformListItemClass))

typedef struct _GamesPlatformListItem GamesPlatformListItem;
typedef struct _GamesPlatformListItemClass GamesPlatformListItemClass;

#define GAMES_TYPE_PLATFORM_MODEL (games_platform_model_get_type ())
#define GAMES_PLATFORM_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_PLATFORM_MODEL, GamesPlatformModel))
#define GAMES_PLATFORM_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_PLATFORM_MODEL, GamesPlatformModelClass))
#define GAMES_IS_PLATFORM_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_PLATFORM_MODEL))
#define GAMES_IS_PLATFORM_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_PLATFORM_MODEL))
#define GAMES_PLATFORM_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_PLATFORM_MODEL, GamesPlatformModelClass))

typedef struct _GamesPlatformModel GamesPlatformModel;
typedef struct _GamesPlatformModelClass GamesPlatformModelClass;
typedef gboolean (*GamesGamesPageGameFilter) (GamesGame* game, gpointer user_data);
enum  {
	GAMES_PLATFORMS_PAGE_GAME_ACTIVATED_SIGNAL,
	GAMES_PLATFORMS_PAGE_SELECTED_ITEMS_CHANGED_SIGNAL,
	GAMES_PLATFORMS_PAGE_NUM_SIGNALS
};
static guint games_platforms_page_signals[GAMES_PLATFORMS_PAGE_NUM_SIGNALS] = {0};

struct _GamesPlatformsPage {
	GtkBin parent_instance;
	GamesPlatformsPagePrivate * priv;
};

struct _GamesPlatformsPageClass {
	GtkBinClass parent_class;
};

struct _GamesPlatformsPagePrivate {
	HdyLeaflet* leaflet;
	GtkListBox* list_box;
	GamesGamesPage* games_page;
	GamesGamepadBrowse* gamepad_browse;
	GamesPlatform* selected_platform;
	gboolean has_used_gamepad;
	gchar** filtering_terms;
	gint filtering_terms_length1;
	gint _filtering_terms_size_;
	GamesGameModel* _game_model;
	GBinding* window_active_binding;
	gboolean _is_active;
	gboolean _is_folded;
	gboolean _is_subview_open;
	gchar* _subview_title;
	gboolean _is_selection_mode;
	gboolean _is_search_empty;
};

static gint GamesPlatformsPage_private_offset;
static gpointer games_platforms_page_parent_class = NULL;

VALA_EXTERN GType games_platforms_page_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_games_page_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_gamepad_browse_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_game_model_get_type (void) G_GNUC_CONST ;
static gboolean games_platforms_page_filter_list (GamesPlatformsPage* self,
                                           GtkListBoxRow* row);
VALA_EXTERN GType games_platform_list_item_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GamesPlatform* games_platform_list_item_get_platform (GamesPlatformListItem* self);
VALA_EXTERN GamesGameModel* games_platforms_page_get_game_model (GamesPlatformsPage* self);
static void _vala_array_add41 (GamesGame** * array,
                        gint* length,
                        gint* size,
                        GamesGame* value);
static gboolean games_platforms_page_filter_game (GamesPlatformsPage* self,
                                           GamesGame* game);
VALA_EXTERN void games_platforms_page_on_map (GamesPlatformsPage* self);
VALA_EXTERN void games_platforms_page_set_is_active (GamesPlatformsPage* self,
                                         gboolean value);
static void _games_platforms_page_on_map_gtk_widget_map (GtkWidget* _sender,
                                                  gpointer self);
VALA_EXTERN void games_platforms_page_on_unmap (GamesPlatformsPage* self);
static void _games_platforms_page_on_unmap_gtk_widget_unmap (GtkWidget* _sender,
                                                      gpointer self);
VALA_EXTERN void games_platforms_page_set_filter (GamesPlatformsPage* self,
                                      gchar** filtering_terms,
                                      gint filtering_terms_length1);
static gchar** _vala_array_dup29 (gchar** self,
                           gssize length);
VALA_EXTERN void games_games_page_set_filter (GamesGamesPage* self,
                                  gchar** filtering_terms,
                                  gint filtering_terms_length1);
static void games_platforms_page_select_first_visible_row (GamesPlatformsPage* self);
VALA_EXTERN gboolean games_platforms_page_gamepad_button_press_event (GamesPlatformsPage* self,
                                                          ManetteEvent* event);
VALA_EXTERN gboolean games_games_page_has_game_selected (GamesGamesPage* self);
VALA_EXTERN gboolean games_games_page_gamepad_button_press_event (GamesGamesPage* self,
                                                      ManetteEvent* event);
VALA_EXTERN gboolean games_gamepad_browse_gamepad_button_press_event (GamesGamepadBrowse* self,
                                                          ManetteEvent* event);
VALA_EXTERN gboolean games_platforms_page_gamepad_button_release_event (GamesPlatformsPage* self,
                                                            ManetteEvent* event);
VALA_EXTERN gboolean games_games_page_gamepad_button_release_event (GamesGamesPage* self,
                                                        ManetteEvent* event);
VALA_EXTERN gboolean games_gamepad_browse_gamepad_button_release_event (GamesGamepadBrowse* self,
                                                            ManetteEvent* event);
VALA_EXTERN gboolean games_platforms_page_gamepad_absolute_axis_event (GamesPlatformsPage* self,
                                                           ManetteEvent* event);
VALA_EXTERN gboolean games_games_page_gamepad_absolute_axis_event (GamesGamesPage* self,
                                                       ManetteEvent* event);
VALA_EXTERN gboolean games_gamepad_browse_gamepad_absolute_axis_event (GamesGamepadBrowse* self,
                                                           ManetteEvent* event);
VALA_EXTERN void games_platforms_page_select_all (GamesPlatformsPage* self);
VALA_EXTERN void games_games_page_select_all (GamesGamesPage* self);
VALA_EXTERN void games_platforms_page_select_none (GamesPlatformsPage* self);
VALA_EXTERN void games_games_page_select_none (GamesGamesPage* self);
VALA_EXTERN GamesGame** games_platforms_page_get_selected_games (GamesPlatformsPage* self,
                                                     gint* result_length1);
VALA_EXTERN GamesGame** games_games_page_get_selected_games (GamesGamesPage* self,
                                                 gint* result_length1);
static gboolean games_platforms_page_on_gamepad_browse (GamesPlatformsPage* self,
                                                 GtkDirectionType direction);
static void games_platforms_page_update_selection_mode (GamesPlatformsPage* self);
static void games_platforms_page_select_platform_for_row (GamesPlatformsPage* self,
                                                   GtkListBoxRow* row_item);
VALA_EXTERN gboolean games_games_page_select_default_game (GamesGamesPage* self,
                                               GtkDirectionType direction);
static gboolean _games_platforms_page_on_gamepad_browse_games_gamepad_browse_browse (GamesGamepadBrowse* _sender,
                                                                              GtkDirectionType direction,
                                                                              gpointer self);
static gboolean games_platforms_page_on_gamepad_accept (GamesPlatformsPage* self);
static gboolean _games_platforms_page_on_gamepad_accept_games_gamepad_browse_accept (GamesGamepadBrowse* _sender,
                                                                              gpointer self);
static gboolean games_platforms_page_on_gamepad_cancel (GamesPlatformsPage* self);
VALA_EXTERN void games_games_page_unselect_game (GamesGamesPage* self);
static gboolean _games_platforms_page_on_gamepad_cancel_games_gamepad_browse_cancel (GamesGamepadBrowse* _sender,
                                                                              gpointer self);
static void games_platforms_page_on_list_box_row_activated (GamesPlatformsPage* self,
                                                     GtkListBoxRow* row_item);
static void _games_platforms_page_on_list_box_row_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                                 GtkListBoxRow* row,
                                                                                 gpointer self);
VALA_EXTERN void games_platforms_page_set_subview_title (GamesPlatformsPage* self,
                                             const gchar* value);
VALA_EXTERN void games_games_page_invalidate_filter (GamesGamesPage* self);
VALA_EXTERN void games_games_page_reset_scroll_position (GamesGamesPage* self);
VALA_EXTERN void games_platforms_page_reset (GamesPlatformsPage* self);
static void games_platforms_page_select_current_row (GamesPlatformsPage* self);
VALA_EXTERN gboolean games_platforms_page_get_is_folded (GamesPlatformsPage* self);
static GtkWidget* games_platforms_page_add_platform (GamesPlatformsPage* self,
                                              GObject* object);
VALA_EXTERN GamesPlatformListItem* games_platform_list_item_new (GamesPlatform* platform);
VALA_EXTERN GamesPlatformListItem* games_platform_list_item_construct (GType object_type,
                                                           GamesPlatform* platform);
static void games_platforms_page_on_folded_changed (GamesPlatformsPage* self);
VALA_EXTERN gboolean games_platforms_page_get_is_selection_mode (GamesPlatformsPage* self);
static void _games_platforms_page_on_folded_changed_g_object_notify (GObject* _sender,
                                                              GParamSpec* pspec,
                                                              gpointer self);
static void games_platforms_page_on_leaflet_folded_changed (GamesPlatformsPage* self);
VALA_EXTERN void games_platforms_page_set_is_folded (GamesPlatformsPage* self,
                                         gboolean value);
static void _games_platforms_page_on_leaflet_folded_changed_g_object_notify (GObject* _sender,
                                                                      GParamSpec* pspec,
                                                                      gpointer self);
VALA_EXTERN void games_platforms_page_on_game_activated (GamesPlatformsPage* self,
                                             GamesGame* game);
static void _games_platforms_page_on_game_activated_games_games_page_game_activated (GamesGamesPage* _sender,
                                                                              GamesGame* game,
                                                                              gpointer self);
static void games_platforms_page_on_visible_child_changed (GamesPlatformsPage* self);
VALA_EXTERN void games_platforms_page_set_is_subview_open (GamesPlatformsPage* self,
                                               gboolean value);
static void _games_platforms_page_on_visible_child_changed_g_object_notify (GObject* _sender,
                                                                     GParamSpec* pspec,
                                                                     gpointer self);
VALA_EXTERN HdyLeaflet* games_platforms_page_get_leaflet (GamesPlatformsPage* self);
VALA_EXTERN GamesPlatformsPage* games_platforms_page_new (void);
VALA_EXTERN GamesPlatformsPage* games_platforms_page_construct (GType object_type);
VALA_EXTERN void games_platforms_page_set_game_model (GamesPlatformsPage* self,
                                          GamesGameModel* value);
VALA_EXTERN void games_games_page_set_game_model (GamesGamesPage* self,
                                      GamesGameModel* value);
VALA_EXTERN GType games_platform_model_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GamesPlatformModel* games_platform_model_new (GamesGameModel* game_model);
VALA_EXTERN GamesPlatformModel* games_platform_model_construct (GType object_type,
                                                    GamesGameModel* game_model);
static GtkWidget* _games_platforms_page_add_platform_gtk_list_box_create_widget_func (GObject* item,
                                                                               gpointer self);
VALA_EXTERN gboolean games_platforms_page_get_is_active (GamesPlatformsPage* self);
VALA_EXTERN void games_gamepad_browse_cancel_cursor_movement (GamesGamepadBrowse* self);
VALA_EXTERN gboolean games_platforms_page_get_is_subview_open (GamesPlatformsPage* self);
VALA_EXTERN const gchar* games_platforms_page_get_subview_title (GamesPlatformsPage* self);
VALA_EXTERN void games_platforms_page_set_is_selection_mode (GamesPlatformsPage* self,
                                                 gboolean value);
VALA_EXTERN gboolean games_platforms_page_get_is_search_empty (GamesPlatformsPage* self);
VALA_EXTERN void games_platforms_page_set_is_search_empty (GamesPlatformsPage* self,
                                               gboolean value);
static GObject * games_platforms_page_constructor (GType type,
                                            guint n_construct_properties,
                                            GObjectConstructParam * construct_properties);
VALA_EXTERN void games_games_page_set_game_filter (GamesGamesPage* self,
                                       GamesGamesPageGameFilter game_filter,
                                       gpointer game_filter_target);
static gboolean _games_platforms_page_filter_game_games_games_page_game_filter (GamesGame* game,
                                                                         gpointer self);
static gboolean _games_platforms_page_filter_list_gtk_list_box_filter_func (GtkListBoxRow* row,
                                                                     gpointer self);
static void _games_platforms_page___lambda22_ (GamesPlatformsPage* self);
static void __games_platforms_page___lambda22__games_games_page_selected_items_changed (GamesGamesPage* _sender,
                                                                                 gpointer self);
static void games_platforms_page_finalize (GObject * obj);
static GType games_platforms_page_get_type_once (void);
static void _vala_games_platforms_page_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec);
static void _vala_games_platforms_page_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
games_platforms_page_get_instance_private (GamesPlatformsPage* self)
{
	return G_STRUCT_MEMBER_P (self, GamesPlatformsPage_private_offset);
}

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

static void
_vala_array_add41 (GamesGame** * array,
                   gint* length,
                   gint* size,
                   GamesGame* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GamesGame*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static gboolean
games_platforms_page_filter_list (GamesPlatformsPage* self,
                                  GtkListBoxRow* row)
{
	GamesPlatformListItem* item = NULL;
	GamesPlatformListItem* _tmp0_;
	GamesPlatformListItem* _tmp1_;
	GamesPlatformListItem* _tmp2_;
	GamesPlatform* _tmp3_;
	GamesPlatform* _tmp4_;
	GamesGame** visible_games = NULL;
	GamesGame** _tmp5_;
	gint visible_games_length1;
	gint _visible_games_size_;
	GamesGame** _tmp18_;
	gint _tmp18__length1;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = _g_object_ref0 (GAMES_IS_PLATFORM_LIST_ITEM (row) ? ((GamesPlatformListItem*) row) : NULL);
	item = _tmp0_;
	_tmp1_ = item;
	if (_tmp1_ == NULL) {
		result = FALSE;
		_g_object_unref0 (item);
		return result;
	}
	_tmp2_ = item;
	_tmp3_ = games_platform_list_item_get_platform (_tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_ == NULL) {
		gtk_widget_hide ((GtkWidget*) row);
		result = FALSE;
		_g_object_unref0 (item);
		return result;
	}
	_tmp5_ = g_new0 (GamesGame*, 0 + 1);
	visible_games = _tmp5_;
	visible_games_length1 = 0;
	_visible_games_size_ = visible_games_length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp6_ = FALSE;
			_tmp6_ = TRUE;
			while (TRUE) {
				GamesGameModel* _tmp8_;
				GamesGameModel* _tmp9_;
				GamesGame* game = NULL;
				GamesGameModel* _tmp10_;
				GamesGameModel* _tmp11_;
				GObject* _tmp12_;
				GamesGame* _tmp13_;
				GamesGame* _tmp14_;
				gchar** _tmp15_;
				gint _tmp15__length1;
				if (!_tmp6_) {
					gint _tmp7_;
					_tmp7_ = i;
					i = _tmp7_ + 1;
				}
				_tmp6_ = FALSE;
				_tmp8_ = games_platforms_page_get_game_model (self);
				_tmp9_ = _tmp8_;
				if (!(((guint) i) < g_list_model_get_n_items ((GListModel*) _tmp9_))) {
					break;
				}
				_tmp10_ = games_platforms_page_get_game_model (self);
				_tmp11_ = _tmp10_;
				_tmp12_ = g_list_model_get_item ((GListModel*) _tmp11_, (guint) i);
				_tmp13_ = GAMES_IS_GAME (_tmp12_) ? ((GamesGame*) _tmp12_) : NULL;
				if (_tmp13_ == NULL) {
					_g_object_unref0 (_tmp12_);
				}
				game = _tmp13_;
				_tmp14_ = game;
				_tmp15_ = self->priv->filtering_terms;
				_tmp15__length1 = self->priv->filtering_terms_length1;
				if (games_game_matches_search_terms (_tmp14_, _tmp15_, (gint) _tmp15__length1)) {
					GamesGame* _tmp16_;
					GamesGame* _tmp17_;
					_tmp16_ = game;
					_tmp17_ = _g_object_ref0 (_tmp16_);
					_vala_array_add41 (&visible_games, &visible_games_length1, &_visible_games_size_, _tmp17_);
				}
				_g_object_unref0 (game);
			}
		}
	}
	_tmp18_ = visible_games;
	_tmp18__length1 = visible_games_length1;
	{
		GamesGame** game_collection = NULL;
		gint game_collection_length1 = 0;
		gint _game_collection_size_ = 0;
		gint game_it = 0;
		game_collection = _tmp18_;
		game_collection_length1 = _tmp18__length1;
		for (game_it = 0; game_it < game_collection_length1; game_it = game_it + 1) {
			GamesGame* _tmp19_;
			GamesGame* game = NULL;
			_tmp19_ = _g_object_ref0 (game_collection[game_it]);
			game = _tmp19_;
			{
				GamesGame* _tmp20_;
				GamesPlatform* _tmp21_;
				GamesPlatform* _tmp22_;
				GamesPlatformListItem* _tmp23_;
				GamesPlatform* _tmp24_;
				GamesPlatform* _tmp25_;
				_tmp20_ = game;
				_tmp21_ = games_game_get_platform (_tmp20_);
				_tmp22_ = _tmp21_;
				_tmp23_ = item;
				_tmp24_ = games_platform_list_item_get_platform (_tmp23_);
				_tmp25_ = _tmp24_;
				if (_tmp22_ == _tmp25_) {
					gtk_widget_show ((GtkWidget*) row);
					result = TRUE;
					_g_object_unref0 (game);
					visible_games = (_vala_array_free (visible_games, visible_games_length1, (GDestroyNotify) g_object_unref), NULL);
					_g_object_unref0 (item);
					return result;
				}
				_g_object_unref0 (game);
			}
		}
	}
	gtk_widget_hide ((GtkWidget*) row);
	result = FALSE;
	visible_games = (_vala_array_free (visible_games, visible_games_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (item);
	return result;
}

static gboolean
games_platforms_page_filter_game (GamesPlatformsPage* self,
                                  GamesGame* game)
{
	gboolean _tmp0_ = FALSE;
	GamesPlatform* _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (game != NULL, FALSE);
	_tmp1_ = self->priv->selected_platform;
	if (_tmp1_ != NULL) {
		GamesPlatform* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GamesPlatform* _tmp5_;
		GamesPlatform* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		_tmp2_ = self->priv->selected_platform;
		_tmp3_ = games_platform_get_name (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = games_game_get_platform (game);
		_tmp6_ = _tmp5_;
		_tmp7_ = games_platform_get_name (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp0_ = g_strcmp0 (_tmp4_, _tmp8_) != 0;
		_g_free0 (_tmp8_);
		_g_free0 (_tmp4_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		result = FALSE;
		return result;
	}
	result = TRUE;
	return result;
}

void
games_platforms_page_on_map (GamesPlatformsPage* self)
{
	GtkWidget* window = NULL;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GtkWidget* _tmp3_;
	GBinding* _tmp4_;
	GBinding* _tmp5_;
	g_return_if_fail (self != NULL);
	_g_object_unref0 (self->priv->window_active_binding);
	self->priv->window_active_binding = NULL;
	games_platforms_page_set_is_active (self, FALSE);
	_tmp0_ = gtk_widget_get_ancestor ((GtkWidget*) self, gtk_window_get_type ());
	_tmp1_ = _g_object_ref0 (_tmp0_);
	window = _tmp1_;
	_tmp2_ = window;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (window);
		return;
	}
	_tmp3_ = window;
	_tmp4_ = g_object_bind_property_with_closures ((GObject*) _tmp3_, "is-active", (GObject*) self, "is-active", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp5_ = _g_object_ref0 (_tmp4_);
	_g_object_unref0 (self->priv->window_active_binding);
	self->priv->window_active_binding = _tmp5_;
	_g_object_unref0 (window);
}

static void
_games_platforms_page_on_map_gtk_widget_map (GtkWidget* _sender,
                                             gpointer self)
{
	games_platforms_page_on_map ((GamesPlatformsPage*) self);
}

void
games_platforms_page_on_unmap (GamesPlatformsPage* self)
{
	g_return_if_fail (self != NULL);
	_g_object_unref0 (self->priv->window_active_binding);
	self->priv->window_active_binding = NULL;
	games_platforms_page_set_is_active (self, FALSE);
}

static void
_games_platforms_page_on_unmap_gtk_widget_unmap (GtkWidget* _sender,
                                                 gpointer self)
{
	games_platforms_page_on_unmap ((GamesPlatformsPage*) self);
}

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

void
games_platforms_page_set_filter (GamesPlatformsPage* self,
                                 gchar** filtering_terms,
                                 gint filtering_terms_length1)
{
	gchar** _tmp0_;
	gint _tmp0__length1;
	GamesGamesPage* _tmp1_;
	GtkListBox* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = (filtering_terms != NULL) ? _vala_array_dup29 (filtering_terms, filtering_terms_length1) : filtering_terms;
	_tmp0__length1 = filtering_terms_length1;
	self->priv->filtering_terms = (_vala_array_free (self->priv->filtering_terms, self->priv->filtering_terms_length1, (GDestroyNotify) g_free), NULL);
	self->priv->filtering_terms = _tmp0_;
	self->priv->filtering_terms_length1 = _tmp0__length1;
	self->priv->_filtering_terms_size_ = self->priv->filtering_terms_length1;
	_tmp1_ = self->priv->games_page;
	games_games_page_set_filter (_tmp1_, filtering_terms, (gint) filtering_terms_length1);
	_tmp2_ = self->priv->list_box;
	gtk_list_box_invalidate_filter (_tmp2_);
	games_platforms_page_select_first_visible_row (self);
}

gboolean
games_platforms_page_gamepad_button_press_event (GamesPlatformsPage* self,
                                                 ManetteEvent* event)
{
	GamesGamesPage* _tmp0_;
	GamesGamepadBrowse* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	if (!gtk_widget_get_mapped ((GtkWidget*) self)) {
		result = FALSE;
		return result;
	}
	_tmp0_ = self->priv->games_page;
	if (games_games_page_has_game_selected (_tmp0_)) {
		GamesGamesPage* _tmp1_;
		_tmp1_ = self->priv->games_page;
		if (games_games_page_gamepad_button_press_event (_tmp1_, event)) {
			result = TRUE;
			return result;
		}
	}
	_tmp2_ = self->priv->gamepad_browse;
	result = games_gamepad_browse_gamepad_button_press_event (_tmp2_, event);
	return result;
}

gboolean
games_platforms_page_gamepad_button_release_event (GamesPlatformsPage* self,
                                                   ManetteEvent* event)
{
	GamesGamesPage* _tmp0_;
	GamesGamepadBrowse* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	if (!gtk_widget_get_mapped ((GtkWidget*) self)) {
		result = FALSE;
		return result;
	}
	_tmp0_ = self->priv->games_page;
	if (games_games_page_has_game_selected (_tmp0_)) {
		GamesGamesPage* _tmp1_;
		_tmp1_ = self->priv->games_page;
		if (games_games_page_gamepad_button_release_event (_tmp1_, event)) {
			result = TRUE;
			return result;
		}
	}
	_tmp2_ = self->priv->gamepad_browse;
	result = games_gamepad_browse_gamepad_button_release_event (_tmp2_, event);
	return result;
}

gboolean
games_platforms_page_gamepad_absolute_axis_event (GamesPlatformsPage* self,
                                                  ManetteEvent* event)
{
	GamesGamesPage* _tmp0_;
	GamesGamepadBrowse* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	if (!gtk_widget_get_mapped ((GtkWidget*) self)) {
		result = FALSE;
		return result;
	}
	_tmp0_ = self->priv->games_page;
	if (games_games_page_has_game_selected (_tmp0_)) {
		GamesGamesPage* _tmp1_;
		_tmp1_ = self->priv->games_page;
		if (games_games_page_gamepad_absolute_axis_event (_tmp1_, event)) {
			result = TRUE;
			return result;
		}
	}
	_tmp2_ = self->priv->gamepad_browse;
	result = games_gamepad_browse_gamepad_absolute_axis_event (_tmp2_, event);
	return result;
}

void
games_platforms_page_select_all (GamesPlatformsPage* self)
{
	GamesGamesPage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->games_page;
	games_games_page_select_all (_tmp0_);
}

void
games_platforms_page_select_none (GamesPlatformsPage* self)
{
	GamesGamesPage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->games_page;
	games_games_page_select_none (_tmp0_);
}

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

static gboolean
games_platforms_page_on_gamepad_browse (GamesPlatformsPage* self,
                                        GtkDirectionType direction)
{
	GtkListBox* _tmp0_;
	GList* _tmp1_;
	GList* _tmp2_;
	gboolean _tmp3_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->list_box;
	_tmp1_ = gtk_list_box_get_selected_rows (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_list_length (_tmp2_) == ((guint) 0);
	(_tmp2_ == NULL) ? NULL : (_tmp2_ = (g_list_free (_tmp2_), NULL));
	if (_tmp3_) {
		GtkListBoxRow* first_row = NULL;
		GtkListBox* _tmp4_;
		GtkListBoxRow* _tmp5_;
		GtkListBoxRow* _tmp6_;
		GtkListBoxRow* _tmp7_;
		GtkListBoxRow* _tmp8_;
		gboolean _tmp9_ = FALSE;
		_tmp4_ = self->priv->list_box;
		_tmp5_ = gtk_list_box_get_row_at_index (_tmp4_, 0);
		_tmp6_ = _g_object_ref0 (_tmp5_);
		first_row = _tmp6_;
		_tmp7_ = first_row;
		if (_tmp7_ == NULL) {
			result = FALSE;
			_g_object_unref0 (first_row);
			return result;
		}
		self->priv->has_used_gamepad = TRUE;
		games_platforms_page_update_selection_mode (self);
		_tmp8_ = first_row;
		g_signal_emit_by_name ((GtkWidget*) _tmp8_, "focus", direction, &_tmp9_);
		result = TRUE;
		_g_object_unref0 (first_row);
		return result;
	}
	switch (direction) {
		case GTK_DIR_UP:
		{
			GtkListBox* _tmp10_;
			GtkListBox* _tmp11_;
			GtkListBoxRow* _tmp12_;
			_tmp10_ = self->priv->list_box;
			g_signal_emit_by_name (_tmp10_, "move-cursor", GTK_MOVEMENT_DISPLAY_LINES, -1);
			_tmp11_ = self->priv->list_box;
			_tmp12_ = gtk_list_box_get_selected_row (_tmp11_);
			games_platforms_page_select_platform_for_row (self, _tmp12_);
			result = TRUE;
			return result;
		}
		case GTK_DIR_DOWN:
		{
			GtkListBox* _tmp13_;
			GtkListBox* _tmp14_;
			GtkListBoxRow* _tmp15_;
			_tmp13_ = self->priv->list_box;
			g_signal_emit_by_name (_tmp13_, "move-cursor", GTK_MOVEMENT_DISPLAY_LINES, 1);
			_tmp14_ = self->priv->list_box;
			_tmp15_ = gtk_list_box_get_selected_row (_tmp14_);
			games_platforms_page_select_platform_for_row (self, _tmp15_);
			result = TRUE;
			return result;
		}
		case GTK_DIR_RIGHT:
		{
			HdyLeaflet* _tmp16_;
			GamesGamesPage* _tmp17_;
			_tmp16_ = self->priv->leaflet;
			hdy_leaflet_navigate (_tmp16_, HDY_NAVIGATION_DIRECTION_FORWARD);
			_tmp17_ = self->priv->games_page;
			games_games_page_select_default_game (_tmp17_, GTK_DIR_RIGHT);
			result = TRUE;
			return result;
		}
		default:
		{
			result = FALSE;
			return result;
		}
	}
}

static gboolean
_games_platforms_page_on_gamepad_browse_games_gamepad_browse_browse (GamesGamepadBrowse* _sender,
                                                                     GtkDirectionType direction,
                                                                     gpointer self)
{
	gboolean result;
	result = games_platforms_page_on_gamepad_browse ((GamesPlatformsPage*) self, direction);
	return result;
}

static gboolean
games_platforms_page_on_gamepad_accept (GamesPlatformsPage* self)
{
	HdyLeaflet* _tmp0_;
	GamesGamesPage* _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->leaflet;
	hdy_leaflet_navigate (_tmp0_, HDY_NAVIGATION_DIRECTION_FORWARD);
	_tmp1_ = self->priv->games_page;
	games_games_page_select_default_game (_tmp1_, GTK_DIR_RIGHT);
	result = TRUE;
	return result;
}

static gboolean
_games_platforms_page_on_gamepad_accept_games_gamepad_browse_accept (GamesGamepadBrowse* _sender,
                                                                     gpointer self)
{
	gboolean result;
	result = games_platforms_page_on_gamepad_accept ((GamesPlatformsPage*) self);
	return result;
}

static gboolean
games_platforms_page_on_gamepad_cancel (GamesPlatformsPage* self)
{
	GamesGamesPage* _tmp0_;
	HdyLeaflet* _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->games_page;
	games_games_page_unselect_game (_tmp0_);
	_tmp1_ = self->priv->leaflet;
	hdy_leaflet_navigate (_tmp1_, HDY_NAVIGATION_DIRECTION_BACK);
	result = TRUE;
	return result;
}

static gboolean
_games_platforms_page_on_gamepad_cancel_games_gamepad_browse_cancel (GamesGamepadBrowse* _sender,
                                                                     gpointer self)
{
	gboolean result;
	result = games_platforms_page_on_gamepad_cancel ((GamesPlatformsPage*) self);
	return result;
}

static void
games_platforms_page_on_list_box_row_activated (GamesPlatformsPage* self,
                                                GtkListBoxRow* row_item)
{
	HdyLeaflet* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (row_item != NULL);
	games_platforms_page_select_platform_for_row (self, row_item);
	_tmp0_ = self->priv->leaflet;
	hdy_leaflet_navigate (_tmp0_, HDY_NAVIGATION_DIRECTION_FORWARD);
}

static void
_games_platforms_page_on_list_box_row_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                            GtkListBoxRow* row,
                                                                            gpointer self)
{
	games_platforms_page_on_list_box_row_activated ((GamesPlatformsPage*) self, row);
}

static void
games_platforms_page_select_platform_for_row (GamesPlatformsPage* self,
                                              GtkListBoxRow* row_item)
{
	GamesPlatformListItem* row = NULL;
	GamesPlatformListItem* _tmp0_;
	GamesPlatform* _tmp1_;
	GamesPlatform* _tmp2_;
	GamesPlatform* _tmp3_;
	GamesPlatform* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	GamesGamesPage* _tmp7_;
	GamesGamesPage* _tmp8_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (row_item != NULL);
	_tmp0_ = _g_object_ref0 (GAMES_IS_PLATFORM_LIST_ITEM (row_item) ? ((GamesPlatformListItem*) row_item) : NULL);
	row = _tmp0_;
	_tmp1_ = games_platform_list_item_get_platform (row);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_g_object_unref0 (self->priv->selected_platform);
	self->priv->selected_platform = _tmp3_;
	_tmp4_ = self->priv->selected_platform;
	_tmp5_ = games_platform_get_name (_tmp4_);
	_tmp6_ = _tmp5_;
	games_platforms_page_set_subview_title (self, _tmp6_);
	_g_free0 (_tmp6_);
	_tmp7_ = self->priv->games_page;
	games_games_page_invalidate_filter (_tmp7_);
	_tmp8_ = self->priv->games_page;
	games_games_page_reset_scroll_position (_tmp8_);
	_g_object_unref0 (row);
}

void
games_platforms_page_reset (GamesPlatformsPage* self)
{
	HdyLeaflet* _tmp0_;
	g_return_if_fail (self != NULL);
	games_platforms_page_select_first_visible_row (self);
	_tmp0_ = self->priv->leaflet;
	hdy_leaflet_navigate (_tmp0_, HDY_NAVIGATION_DIRECTION_BACK);
}

static void
games_platforms_page_select_first_visible_row (GamesPlatformsPage* self)
{
	GtkListBox* _tmp0_;
	GList* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->list_box;
	_tmp1_ = gtk_container_get_children ((GtkContainer*) _tmp0_);
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
		child_collection = _tmp1_;
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
			GtkWidget* child = NULL;
			child = (GtkWidget*) child_it->data;
			{
				GtkListBoxRow* row = NULL;
				GtkWidget* _tmp2_;
				GtkListBoxRow* _tmp3_;
				GtkListBoxRow* _tmp4_;
				_tmp2_ = child;
				_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, gtk_list_box_row_get_type ()) ? ((GtkListBoxRow*) _tmp2_) : NULL);
				row = _tmp3_;
				_tmp4_ = row;
				if (gtk_widget_get_child_visible ((GtkWidget*) _tmp4_)) {
					GtkListBox* _tmp5_;
					GtkListBoxRow* _tmp6_;
					GtkListBoxRow* _tmp7_;
					gboolean _tmp8_ = FALSE;
					GtkListBoxRow* _tmp9_;
					_tmp5_ = self->priv->list_box;
					_tmp6_ = row;
					gtk_list_box_select_row (_tmp5_, _tmp6_);
					_tmp7_ = row;
					g_signal_emit_by_name ((GtkWidget*) _tmp7_, "focus", GTK_DIR_LEFT, &_tmp8_);
					_tmp9_ = row;
					games_platforms_page_select_platform_for_row (self, _tmp9_);
					_g_object_unref0 (row);
					break;
				}
				_g_object_unref0 (row);
			}
		}
		(child_collection == NULL) ? NULL : (child_collection = (g_list_free (child_collection), NULL));
	}
}

static void
games_platforms_page_select_current_row (GamesPlatformsPage* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	GtkListBox* _tmp2_;
	GList* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_is_folded;
	if (_tmp1_) {
		_tmp0_ = !self->priv->has_used_gamepad;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		return;
	}
	_tmp2_ = self->priv->list_box;
	_tmp3_ = gtk_container_get_children ((GtkContainer*) _tmp2_);
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
		child_collection = _tmp3_;
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
			GtkWidget* child = NULL;
			child = (GtkWidget*) child_it->data;
			{
				GamesPlatformListItem* platform_item = NULL;
				GtkWidget* _tmp4_;
				GamesPlatformListItem* _tmp5_;
				GamesPlatformListItem* _tmp6_;
				GamesPlatform* _tmp7_;
				GamesPlatform* _tmp8_;
				GamesPlatform* _tmp9_;
				_tmp4_ = child;
				_tmp5_ = _g_object_ref0 (GAMES_IS_PLATFORM_LIST_ITEM (_tmp4_) ? ((GamesPlatformListItem*) _tmp4_) : NULL);
				platform_item = _tmp5_;
				_tmp6_ = platform_item;
				_tmp7_ = games_platform_list_item_get_platform (_tmp6_);
				_tmp8_ = _tmp7_;
				_tmp9_ = self->priv->selected_platform;
				if (games_platform_equal (_tmp8_, _tmp9_)) {
					GtkListBox* _tmp10_;
					GamesPlatformListItem* _tmp11_;
					_tmp10_ = self->priv->list_box;
					_tmp11_ = platform_item;
					gtk_list_box_select_row (_tmp10_, (GtkListBoxRow*) _tmp11_);
					_g_object_unref0 (platform_item);
					break;
				}
				_g_object_unref0 (platform_item);
			}
		}
		(child_collection == NULL) ? NULL : (child_collection = (g_list_free (child_collection), NULL));
	}
}

static GtkWidget*
games_platforms_page_add_platform (GamesPlatformsPage* self,
                                   GObject* object)
{
	GamesPlatform* platform = NULL;
	GamesPlatform* _tmp0_;
	GamesPlatformListItem* item = NULL;
	GamesPlatformListItem* _tmp1_;
	GtkWidget* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (object != NULL, NULL);
	_tmp0_ = _g_object_ref0 (GAMES_IS_PLATFORM (object) ? ((GamesPlatform*) object) : NULL);
	platform = _tmp0_;
	_tmp1_ = games_platform_list_item_new (platform);
	g_object_ref_sink (_tmp1_);
	item = _tmp1_;
	gtk_widget_show ((GtkWidget*) item);
	result = (GtkWidget*) item;
	_g_object_unref0 (platform);
	return result;
}

static void
games_platforms_page_update_selection_mode (GamesPlatformsPage* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_is_folded;
	if (!_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = self->priv->has_used_gamepad;
	}
	if (_tmp0_) {
		GtkListBox* _tmp2_;
		_tmp2_ = self->priv->list_box;
		gtk_list_box_set_selection_mode (_tmp2_, GTK_SELECTION_SINGLE);
	} else {
		GtkListBox* _tmp3_;
		_tmp3_ = self->priv->list_box;
		gtk_list_box_set_selection_mode (_tmp3_, GTK_SELECTION_NONE);
	}
	games_platforms_page_select_current_row (self);
}

static void
games_platforms_page_on_folded_changed (GamesPlatformsPage* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	games_platforms_page_update_selection_mode (self);
	_tmp1_ = self->priv->_is_selection_mode;
	if (_tmp1_) {
		gboolean _tmp2_;
		_tmp2_ = self->priv->_is_folded;
		_tmp0_ = _tmp2_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		HdyLeaflet* _tmp3_;
		_tmp3_ = self->priv->leaflet;
		hdy_leaflet_navigate (_tmp3_, HDY_NAVIGATION_DIRECTION_FORWARD);
	}
}

static void
_games_platforms_page_on_folded_changed_g_object_notify (GObject* _sender,
                                                         GParamSpec* pspec,
                                                         gpointer self)
{
	games_platforms_page_on_folded_changed ((GamesPlatformsPage*) self);
}

static void
games_platforms_page_on_leaflet_folded_changed (GamesPlatformsPage* self)
{
	HdyLeaflet* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->leaflet;
	_tmp1_ = hdy_leaflet_get_folded (_tmp0_);
	_tmp2_ = _tmp1_;
	games_platforms_page_set_is_folded (self, _tmp2_);
}

static void
_games_platforms_page_on_leaflet_folded_changed_g_object_notify (GObject* _sender,
                                                                 GParamSpec* pspec,
                                                                 gpointer self)
{
	games_platforms_page_on_leaflet_folded_changed ((GamesPlatformsPage*) self);
}

void
games_platforms_page_on_game_activated (GamesPlatformsPage* self,
                                        GamesGame* game)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (game != NULL);
	g_signal_emit (self, games_platforms_page_signals[GAMES_PLATFORMS_PAGE_GAME_ACTIVATED_SIGNAL], 0, game);
}

static void
_games_platforms_page_on_game_activated_games_games_page_game_activated (GamesGamesPage* _sender,
                                                                         GamesGame* game,
                                                                         gpointer self)
{
	games_platforms_page_on_game_activated ((GamesPlatformsPage*) self, game);
}

static void
games_platforms_page_on_visible_child_changed (GamesPlatformsPage* self)
{
	HdyLeaflet* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GamesGamesPage* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->leaflet;
	_tmp1_ = hdy_leaflet_get_visible_child (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->games_page;
	games_platforms_page_set_is_subview_open (self, _tmp2_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget));
}

static void
_games_platforms_page_on_visible_child_changed_g_object_notify (GObject* _sender,
                                                                GParamSpec* pspec,
                                                                gpointer self)
{
	games_platforms_page_on_visible_child_changed ((GamesPlatformsPage*) self);
}

HdyLeaflet*
games_platforms_page_get_leaflet (GamesPlatformsPage* self)
{
	HdyLeaflet* _tmp0_;
	HdyLeaflet* _tmp1_;
	HdyLeaflet* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->leaflet;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

GamesPlatformsPage*
games_platforms_page_construct (GType object_type)
{
	GamesPlatformsPage * self = NULL;
	self = (GamesPlatformsPage*) g_object_new (object_type, NULL);
	return self;
}

GamesPlatformsPage*
games_platforms_page_new (void)
{
	return games_platforms_page_construct (GAMES_TYPE_PLATFORMS_PAGE);
}

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

static GtkWidget*
_games_platforms_page_add_platform_gtk_list_box_create_widget_func (GObject* item,
                                                                    gpointer self)
{
	GtkWidget* result;
	result = games_platforms_page_add_platform ((GamesPlatformsPage*) self, item);
	return result;
}

void
games_platforms_page_set_game_model (GamesPlatformsPage* self,
                                     GamesGameModel* value)
{
	GamesGameModel* _tmp0_;
	GamesGamesPage* _tmp1_;
	GamesPlatformModel* platform_model = NULL;
	GamesPlatformModel* _tmp2_;
	GtkListBox* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_game_model);
	self->priv->_game_model = _tmp0_;
	_tmp1_ = self->priv->games_page;
	games_games_page_set_game_model (_tmp1_, value);
	_tmp2_ = games_platform_model_new (value);
	platform_model = _tmp2_;
	_tmp3_ = self->priv->list_box;
	gtk_list_box_bind_model (_tmp3_, (GListModel*) platform_model, _games_platforms_page_add_platform_gtk_list_box_create_widget_func, g_object_ref (self), g_object_unref);
	_g_object_unref0 (platform_model);
	g_object_notify_by_pspec ((GObject *) self, games_platforms_page_properties[GAMES_PLATFORMS_PAGE_GAME_MODEL_PROPERTY]);
}

gboolean
games_platforms_page_get_is_active (GamesPlatformsPage* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_active;
	return result;
}

void
games_platforms_page_set_is_active (GamesPlatformsPage* self,
                                    gboolean value)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_is_active == value) {
		return;
	}
	self->priv->_is_active = value;
	if (!self->priv->_is_active) {
		GamesGamepadBrowse* _tmp0_;
		_tmp0_ = self->priv->gamepad_browse;
		games_gamepad_browse_cancel_cursor_movement (_tmp0_);
	}
	g_object_notify_by_pspec ((GObject *) self, games_platforms_page_properties[GAMES_PLATFORMS_PAGE_IS_ACTIVE_PROPERTY]);
}

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

void
games_platforms_page_set_is_folded (GamesPlatformsPage* self,
                                    gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_platforms_page_get_is_folded (self);
	if (old_value != value) {
		self->priv->_is_folded = value;
		g_object_notify_by_pspec ((GObject *) self, games_platforms_page_properties[GAMES_PLATFORMS_PAGE_IS_FOLDED_PROPERTY]);
	}
}

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

void
games_platforms_page_set_is_subview_open (GamesPlatformsPage* self,
                                          gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_platforms_page_get_is_subview_open (self);
	if (old_value != value) {
		self->priv->_is_subview_open = value;
		g_object_notify_by_pspec ((GObject *) self, games_platforms_page_properties[GAMES_PLATFORMS_PAGE_IS_SUBVIEW_OPEN_PROPERTY]);
	}
}

const gchar*
games_platforms_page_get_subview_title (GamesPlatformsPage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_subview_title;
	result = _tmp0_;
	return result;
}

void
games_platforms_page_set_subview_title (GamesPlatformsPage* self,
                                        const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = games_platforms_page_get_subview_title (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_subview_title);
		self->priv->_subview_title = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, games_platforms_page_properties[GAMES_PLATFORMS_PAGE_SUBVIEW_TITLE_PROPERTY]);
	}
}

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

void
games_platforms_page_set_is_selection_mode (GamesPlatformsPage* self,
                                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_platforms_page_get_is_selection_mode (self);
	if (old_value != value) {
		self->priv->_is_selection_mode = value;
		g_object_notify_by_pspec ((GObject *) self, games_platforms_page_properties[GAMES_PLATFORMS_PAGE_IS_SELECTION_MODE_PROPERTY]);
	}
}

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

void
games_platforms_page_set_is_search_empty (GamesPlatformsPage* self,
                                          gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_platforms_page_get_is_search_empty (self);
	if (old_value != value) {
		self->priv->_is_search_empty = value;
		g_object_notify_by_pspec ((GObject *) self, games_platforms_page_properties[GAMES_PLATFORMS_PAGE_IS_SEARCH_EMPTY_PROPERTY]);
	}
}

static gboolean
_games_platforms_page_filter_game_games_games_page_game_filter (GamesGame* game,
                                                                gpointer self)
{
	gboolean result;
	result = games_platforms_page_filter_game ((GamesPlatformsPage*) self, game);
	return result;
}

static gboolean
_games_platforms_page_filter_list_gtk_list_box_filter_func (GtkListBoxRow* row,
                                                            gpointer self)
{
	gboolean result;
	result = games_platforms_page_filter_list ((GamesPlatformsPage*) self, row);
	return result;
}

static void
_games_platforms_page___lambda22_ (GamesPlatformsPage* self)
{
	g_signal_emit (self, games_platforms_page_signals[GAMES_PLATFORMS_PAGE_SELECTED_ITEMS_CHANGED_SIGNAL], 0);
}

static void
__games_platforms_page___lambda22__games_games_page_selected_items_changed (GamesGamesPage* _sender,
                                                                            gpointer self)
{
	_games_platforms_page___lambda22_ ((GamesPlatformsPage*) self);
}

static GObject *
games_platforms_page_constructor (GType type,
                                  guint n_construct_properties,
                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GamesPlatformsPage * self;
	GamesGamesPage* _tmp0_;
	GtkListBox* _tmp1_;
	GamesGamesPage* _tmp2_;
	parent_class = G_OBJECT_CLASS (games_platforms_page_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_PLATFORMS_PAGE, GamesPlatformsPage);
	_tmp0_ = self->priv->games_page;
	games_games_page_set_game_filter (_tmp0_, _games_platforms_page_filter_game_games_games_page_game_filter, self);
	_tmp1_ = self->priv->list_box;
	gtk_list_box_set_filter_func (_tmp1_, _games_platforms_page_filter_list_gtk_list_box_filter_func, g_object_ref (self), g_object_unref);
	_tmp2_ = self->priv->games_page;
	g_signal_connect_object (_tmp2_, "selected-items-changed", (GCallback) __games_platforms_page___lambda22__games_games_page_selected_items_changed, self, 0);
	return obj;
}

static void
games_platforms_page_class_init (GamesPlatformsPageClass * klass,
                                 gpointer klass_data)
{
	games_platforms_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GamesPlatformsPage_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_games_platforms_page_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_games_platforms_page_set_property;
	G_OBJECT_CLASS (klass)->constructor = games_platforms_page_constructor;
	G_OBJECT_CLASS (klass)->finalize = games_platforms_page_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_PLATFORMS_PAGE_GAME_MODEL_PROPERTY, games_platforms_page_properties[GAMES_PLATFORMS_PAGE_GAME_MODEL_PROPERTY] = g_param_spec_object ("game-model", "game-model", "game-model", GAMES_TYPE_GAME_MODEL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_PLATFORMS_PAGE_IS_ACTIVE_PROPERTY, games_platforms_page_properties[GAMES_PLATFORMS_PAGE_IS_ACTIVE_PROPERTY] = g_param_spec_boolean ("is-active", "is-active", "is-active", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_PLATFORMS_PAGE_IS_FOLDED_PROPERTY, games_platforms_page_properties[GAMES_PLATFORMS_PAGE_IS_FOLDED_PROPERTY] = g_param_spec_boolean ("is-folded", "is-folded", "is-folded", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_PLATFORMS_PAGE_IS_SUBVIEW_OPEN_PROPERTY, games_platforms_page_properties[GAMES_PLATFORMS_PAGE_IS_SUBVIEW_OPEN_PROPERTY] = g_param_spec_boolean ("is-subview-open", "is-subview-open", "is-subview-open", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_PLATFORMS_PAGE_SUBVIEW_TITLE_PROPERTY, games_platforms_page_properties[GAMES_PLATFORMS_PAGE_SUBVIEW_TITLE_PROPERTY] = g_param_spec_string ("subview-title", "subview-title", "subview-title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_PLATFORMS_PAGE_IS_SELECTION_MODE_PROPERTY, games_platforms_page_properties[GAMES_PLATFORMS_PAGE_IS_SELECTION_MODE_PROPERTY] = g_param_spec_boolean ("is-selection-mode", "is-selection-mode", "is-selection-mode", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_PLATFORMS_PAGE_IS_SEARCH_EMPTY_PROPERTY, games_platforms_page_properties[GAMES_PLATFORMS_PAGE_IS_SEARCH_EMPTY_PROPERTY] = g_param_spec_boolean ("is-search-empty", "is-search-empty", "is-search-empty", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Games/ui/platforms-page.ui");
	games_platforms_page_signals[GAMES_PLATFORMS_PAGE_GAME_ACTIVATED_SIGNAL] = g_signal_new ("game-activated", GAMES_TYPE_PLATFORMS_PAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GAMES_TYPE_GAME);
	games_platforms_page_signals[GAMES_PLATFORMS_PAGE_SELECTED_ITEMS_CHANGED_SIGNAL] = g_signal_new ("selected-items-changed", GAMES_TYPE_PLATFORMS_PAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "leaflet", FALSE, GamesPlatformsPage_private_offset + G_STRUCT_OFFSET (GamesPlatformsPagePrivate, leaflet));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "list_box", FALSE, GamesPlatformsPage_private_offset + G_STRUCT_OFFSET (GamesPlatformsPagePrivate, list_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "games_page", FALSE, GamesPlatformsPage_private_offset + G_STRUCT_OFFSET (GamesPlatformsPagePrivate, games_page));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "gamepad_browse", FALSE, GamesPlatformsPage_private_offset + G_STRUCT_OFFSET (GamesPlatformsPagePrivate, gamepad_browse));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_map", G_CALLBACK(_games_platforms_page_on_map_gtk_widget_map));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_unmap", G_CALLBACK(_games_platforms_page_on_unmap_gtk_widget_unmap));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_gamepad_browse", G_CALLBACK(_games_platforms_page_on_gamepad_browse_games_gamepad_browse_browse));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_gamepad_accept", G_CALLBACK(_games_platforms_page_on_gamepad_accept_games_gamepad_browse_accept));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_gamepad_cancel", G_CALLBACK(_games_platforms_page_on_gamepad_cancel_games_gamepad_browse_cancel));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_list_box_row_activated", G_CALLBACK(_games_platforms_page_on_list_box_row_activated_gtk_list_box_row_activated));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_folded_changed", G_CALLBACK(_games_platforms_page_on_folded_changed_g_object_notify));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_leaflet_folded_changed", G_CALLBACK(_games_platforms_page_on_leaflet_folded_changed_g_object_notify));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_game_activated", G_CALLBACK(_games_platforms_page_on_game_activated_games_games_page_game_activated));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_visible_child_changed", G_CALLBACK(_games_platforms_page_on_visible_child_changed_g_object_notify));
}

static void
games_platforms_page_instance_init (GamesPlatformsPage * self,
                                    gpointer klass)
{
	self->priv = games_platforms_page_get_instance_private (self);
	g_type_ensure (GAMES_TYPE_GAMES_PAGE);
	g_type_ensure (GAMES_TYPE_GAMEPAD_BROWSE);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
games_platforms_page_finalize (GObject * obj)
{
	GamesPlatformsPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_PLATFORMS_PAGE, GamesPlatformsPage);
	_g_object_unref0 (self->priv->selected_platform);
	self->priv->filtering_terms = (_vala_array_free (self->priv->filtering_terms, self->priv->filtering_terms_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (self->priv->_game_model);
	_g_object_unref0 (self->priv->window_active_binding);
	_g_free0 (self->priv->_subview_title);
	G_OBJECT_CLASS (games_platforms_page_parent_class)->finalize (obj);
}

static GType
games_platforms_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GamesPlatformsPageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_platforms_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesPlatformsPage), 0, (GInstanceInitFunc) games_platforms_page_instance_init, NULL };
	GType games_platforms_page_type_id;
	games_platforms_page_type_id = g_type_register_static (gtk_bin_get_type (), "GamesPlatformsPage", &g_define_type_info, 0);
	GamesPlatformsPage_private_offset = g_type_add_instance_private (games_platforms_page_type_id, sizeof (GamesPlatformsPagePrivate));
	return games_platforms_page_type_id;
}

GType
games_platforms_page_get_type (void)
{
	static volatile gsize games_platforms_page_type_id__once = 0;
	if (g_once_init_enter (&games_platforms_page_type_id__once)) {
		GType games_platforms_page_type_id;
		games_platforms_page_type_id = games_platforms_page_get_type_once ();
		g_once_init_leave (&games_platforms_page_type_id__once, games_platforms_page_type_id);
	}
	return games_platforms_page_type_id__once;
}

static void
_vala_games_platforms_page_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec)
{
	GamesPlatformsPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_PLATFORMS_PAGE, GamesPlatformsPage);
	switch (property_id) {
		case GAMES_PLATFORMS_PAGE_GAME_MODEL_PROPERTY:
		g_value_set_object (value, games_platforms_page_get_game_model (self));
		break;
		case GAMES_PLATFORMS_PAGE_IS_ACTIVE_PROPERTY:
		g_value_set_boolean (value, games_platforms_page_get_is_active (self));
		break;
		case GAMES_PLATFORMS_PAGE_IS_FOLDED_PROPERTY:
		g_value_set_boolean (value, games_platforms_page_get_is_folded (self));
		break;
		case GAMES_PLATFORMS_PAGE_IS_SUBVIEW_OPEN_PROPERTY:
		g_value_set_boolean (value, games_platforms_page_get_is_subview_open (self));
		break;
		case GAMES_PLATFORMS_PAGE_SUBVIEW_TITLE_PROPERTY:
		g_value_set_string (value, games_platforms_page_get_subview_title (self));
		break;
		case GAMES_PLATFORMS_PAGE_IS_SELECTION_MODE_PROPERTY:
		g_value_set_boolean (value, games_platforms_page_get_is_selection_mode (self));
		break;
		case GAMES_PLATFORMS_PAGE_IS_SEARCH_EMPTY_PROPERTY:
		g_value_set_boolean (value, games_platforms_page_get_is_search_empty (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_games_platforms_page_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec)
{
	GamesPlatformsPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_PLATFORMS_PAGE, GamesPlatformsPage);
	switch (property_id) {
		case GAMES_PLATFORMS_PAGE_GAME_MODEL_PROPERTY:
		games_platforms_page_set_game_model (self, g_value_get_object (value));
		break;
		case GAMES_PLATFORMS_PAGE_IS_ACTIVE_PROPERTY:
		games_platforms_page_set_is_active (self, g_value_get_boolean (value));
		break;
		case GAMES_PLATFORMS_PAGE_IS_FOLDED_PROPERTY:
		games_platforms_page_set_is_folded (self, g_value_get_boolean (value));
		break;
		case GAMES_PLATFORMS_PAGE_IS_SUBVIEW_OPEN_PROPERTY:
		games_platforms_page_set_is_subview_open (self, g_value_get_boolean (value));
		break;
		case GAMES_PLATFORMS_PAGE_SUBVIEW_TITLE_PROPERTY:
		games_platforms_page_set_subview_title (self, g_value_get_string (value));
		break;
		case GAMES_PLATFORMS_PAGE_IS_SELECTION_MODE_PROPERTY:
		games_platforms_page_set_is_selection_mode (self, g_value_get_boolean (value));
		break;
		case GAMES_PLATFORMS_PAGE_IS_SEARCH_EMPTY_PROPERTY:
		games_platforms_page_set_is_search_empty (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

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

