/* collection-action-window.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from collection-action-window.vala, do not modify */

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

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

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

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

typedef struct _GamesCollectionActionWindow GamesCollectionActionWindow;
typedef struct _GamesCollectionActionWindowClass GamesCollectionActionWindowClass;
typedef struct _GamesCollectionActionWindowPrivate GamesCollectionActionWindowPrivate;

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

typedef struct _GamesCollectionManager GamesCollectionManager;
typedef struct _GamesCollectionManagerClass GamesCollectionManagerClass;

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

typedef struct _GamesCollectionModel GamesCollectionModel;
typedef struct _GamesCollectionModelClass GamesCollectionModelClass;

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

typedef struct _GamesCollection GamesCollection;
typedef struct _GamesCollectionIface GamesCollectionIface;

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

typedef struct _GamesGameModel GamesGameModel;
typedef struct _GamesGameModelClass GamesGameModelClass;
typedef enum  {
	GAMES_COLLECTION_TYPE_AUTO,
	GAMES_COLLECTION_TYPE_USER,
	GAMES_COLLECTION_TYPE_PLACEHOLDER
} GamesCollectionType;

#define GAMES_TYPE_COLLECTION_TYPE (games_collection_type_get_type ())
enum  {
	GAMES_COLLECTION_ACTION_WINDOW_0_PROPERTY,
	GAMES_COLLECTION_ACTION_WINDOW_COLLECTION_MODEL_PROPERTY,
	GAMES_COLLECTION_ACTION_WINDOW_IS_USER_COLLECTIONS_EMPTY_PROPERTY,
	GAMES_COLLECTION_ACTION_WINDOW_IS_SEARCH_MODE_PROPERTY,
	GAMES_COLLECTION_ACTION_WINDOW_IS_COLLECTION_NAME_VALID_PROPERTY,
	GAMES_COLLECTION_ACTION_WINDOW_CREATE_COLLECTION_PAGE_ONLY_PROPERTY,
	GAMES_COLLECTION_ACTION_WINDOW_INSENSITIVE_COLLECTION_PROPERTY,
	GAMES_COLLECTION_ACTION_WINDOW_NUM_PROPERTIES
};
static GParamSpec* games_collection_action_window_properties[GAMES_COLLECTION_ACTION_WINDOW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define GAMES_TYPE_COLLECTION_LIST_ITEM (games_collection_list_item_get_type ())
#define GAMES_COLLECTION_LIST_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_COLLECTION_LIST_ITEM, GamesCollectionListItem))
#define GAMES_COLLECTION_LIST_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_COLLECTION_LIST_ITEM, GamesCollectionListItemClass))
#define GAMES_IS_COLLECTION_LIST_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_COLLECTION_LIST_ITEM))
#define GAMES_IS_COLLECTION_LIST_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_COLLECTION_LIST_ITEM))
#define GAMES_COLLECTION_LIST_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_COLLECTION_LIST_ITEM, GamesCollectionListItemClass))

typedef struct _GamesCollectionListItem GamesCollectionListItem;
typedef struct _GamesCollectionListItemClass GamesCollectionListItemClass;

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

typedef struct _GamesUserCollection GamesUserCollection;
typedef struct _GamesUserCollectionClass GamesUserCollectionClass;
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	GAMES_COLLECTION_ACTION_WINDOW_CONFIRMED_SIGNAL,
	GAMES_COLLECTION_ACTION_WINDOW_NUM_SIGNALS
};
static guint games_collection_action_window_signals[GAMES_COLLECTION_ACTION_WINDOW_NUM_SIGNALS] = {0};

struct _GamesCollectionActionWindow {
	HdyWindow parent_instance;
	GamesCollectionActionWindowPrivate * priv;
	gchar** filtering_terms;
	gint filtering_terms_length1;
	gint _filtering_terms_size_;
};

struct _GamesCollectionActionWindowClass {
	HdyWindowClass parent_class;
};

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

struct _GamesCollectionActionWindowPrivate {
	HdyDeck* deck;
	GtkBox* add_to_collection_page;
	GtkBox* create_collection_page;
	GtkStack* user_collections_page_stack;
	GtkScrolledWindow* list_page;
	HdyStatusPage* empty_page;
	GtkEntry* name_entry;
	GtkLabel* error_label;
	GtkListBox* list_box;
	HdySearchBar* search_bar;
	GtkSearchEntry* search_entry;
	GtkListBoxRow* add_row;
	GamesCollectionManager* collection_manager;
	GSimpleActionGroup* action_group;
	GamesCollectionModel* _collection_model;
	gboolean _is_user_collections_empty;
	gboolean _is_search_mode;
	gboolean _is_collection_name_valid;
	gboolean _create_collection_page_only;
	GamesCollection* _insensitive_collection;
};

static gint GamesCollectionActionWindow_private_offset;
static gpointer games_collection_action_window_parent_class = NULL;

VALA_EXTERN GType games_collection_action_window_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_collection_manager_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_collection_model_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_game_model_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_collection_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_collection_get_type (void) G_GNUC_CONST ;
static void games_collection_action_window_go_back (GamesCollectionActionWindow* self);
static void _games_collection_action_window_go_back_gsimple_action_activate_callback (GSimpleAction* action,
                                                                               GVariant* parameter,
                                                                               gpointer self);
static void games_collection_action_window_new_collection (GamesCollectionActionWindow* self);
static void _games_collection_action_window_new_collection_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                      GVariant* parameter,
                                                                                      gpointer self);
static void games_collection_action_window_create_collection (GamesCollectionActionWindow* self);
static void _games_collection_action_window_create_collection_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                         GVariant* parameter,
                                                                                         gpointer self);
static void games_collection_action_window_add_to_collection (GamesCollectionActionWindow* self);
static void _games_collection_action_window_add_to_collection_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                         GVariant* parameter,
                                                                                         gpointer self);
VALA_EXTERN GamesCollectionActionWindow* games_collection_action_window_new (gboolean create_collection_page_only,
                                                                 GamesCollection* collection);
VALA_EXTERN GamesCollectionActionWindow* games_collection_action_window_construct (GType object_type,
                                                                       gboolean create_collection_page_only,
                                                                       GamesCollection* collection);
static GtkWidget* games_collection_action_window_add_collection_row (GamesCollectionActionWindow* self,
                                                              GObject* object);
VALA_EXTERN GamesCollectionType games_collection_get_collection_type (GamesCollection* self);
VALA_EXTERN GType games_collection_list_item_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GamesCollectionListItem* games_collection_list_item_new (GamesCollection* collection);
VALA_EXTERN GamesCollectionListItem* games_collection_list_item_construct (GType object_type,
                                                               GamesCollection* collection);
VALA_EXTERN GamesCollection* games_collection_action_window_get_insensitive_collection (GamesCollectionActionWindow* self);
static gboolean games_collection_action_window_list_box_filter (GamesCollectionActionWindow* self,
                                                         GtkListBoxRow* row);
VALA_EXTERN GamesCollection* games_collection_list_item_get_collection (GamesCollectionListItem* self);
VALA_EXTERN gboolean games_collection_action_window_get_is_search_mode (GamesCollectionActionWindow* self);
VALA_EXTERN gboolean games_collection_matches_search_terms (GamesCollection* self,
                                                gchar** search_terms,
                                                gint search_terms_length1);
static void _vala_array_add38 (GamesCollection** * array,
                        gint* length,
                        gint* size,
                        GamesCollection* value);
VALA_EXTERN gboolean games_collection_action_window_get_create_collection_page_only (GamesCollectionActionWindow* self);
VALA_EXTERN gboolean games_collection_action_window_get_is_collection_name_valid (GamesCollectionActionWindow* self);
VALA_EXTERN GType games_user_collection_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GamesUserCollection* games_collection_manager_create_user_collection (GamesCollectionManager* self,
                                                                      const gchar* title);
static void _games_collection_action_window_create_collection_gtk_entry_activate (GtkEntry* _sender,
                                                                           gpointer self);
static void games_collection_action_window_on_listbox_row_activated (GamesCollectionActionWindow* self,
                                                              GtkListBoxRow* row);
static void _games_collection_action_window_on_listbox_row_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                                          GtkListBoxRow* row,
                                                                                          gpointer self);
VALA_EXTERN gboolean games_collection_action_window_on_key_pressed (GamesCollectionActionWindow* self,
                                                        GdkEventKey* event);
VALA_EXTERN void games_collection_action_window_set_is_search_mode (GamesCollectionActionWindow* self,
                                                        gboolean value);
VALA_EXTERN gboolean games_collection_action_window_get_is_user_collections_empty (GamesCollectionActionWindow* self);
static gboolean _games_collection_action_window_on_key_pressed_gtk_widget_key_press_event (GtkWidget* _sender,
                                                                                    GdkEventKey* event,
                                                                                    gpointer self);
static void games_collection_action_window_on_collection_name_entry_changed (GamesCollectionActionWindow* self);
VALA_EXTERN void games_collection_action_window_set_is_collection_name_valid (GamesCollectionActionWindow* self,
                                                                  gboolean value);
VALA_EXTERN gboolean games_collection_manager_does_collection_title_exist (GamesCollectionManager* self,
                                                               const gchar* title);
static void _games_collection_action_window_on_collection_name_entry_changed_g_object_notify (GObject* _sender,
                                                                                       GParamSpec* pspec,
                                                                                       gpointer self);
static void games_collection_action_window_on_visible_child_changed (GamesCollectionActionWindow* self);
static void _games_collection_action_window_on_visible_child_changed_g_object_notify (GObject* _sender,
                                                                               GParamSpec* pspec,
                                                                               gpointer self);
static void games_collection_action_window_on_search_text_notify (GamesCollectionActionWindow* self);
static void games_collection_action_window_set_filtering_text (GamesCollectionActionWindow* self,
                                                        const gchar* value);
static void _games_collection_action_window_on_search_text_notify_gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                                                                            gpointer self);
VALA_EXTERN GamesCollectionModel* games_collection_action_window_get_collection_model (GamesCollectionActionWindow* self);
VALA_EXTERN void games_collection_action_window_set_collection_model (GamesCollectionActionWindow* self,
                                                          GamesCollectionModel* value);
static GtkWidget* _games_collection_action_window_add_collection_row_gtk_list_box_create_widget_func (GObject* item,
                                                                                               gpointer self);
static gboolean _games_collection_action_window_list_box_filter_gtk_list_box_filter_func (GtkListBoxRow* row,
                                                                                   gpointer self);
VALA_EXTERN void games_collection_action_window_set_is_user_collections_empty (GamesCollectionActionWindow* self,
                                                                   gboolean value);
static void games_collection_action_window_set_create_collection_page_only (GamesCollectionActionWindow* self,
                                                                     gboolean value);
static void games_collection_action_window_set_insensitive_collection (GamesCollectionActionWindow* self,
                                                                GamesCollection* value);
static void g_cclosure_user_marshal_VOID__POINTER_INT (GClosure * closure,
                                                GValue * return_value,
                                                guint n_param_values,
                                                const GValue * param_values,
                                                gpointer invocation_hint,
                                                gpointer marshal_data);
static GObject * games_collection_action_window_constructor (GType type,
                                                      guint n_construct_properties,
                                                      GObjectConstructParam * construct_properties);
VALA_EXTERN GamesApplication* games_application_get_default (void);
VALA_EXTERN GamesCollectionManager* games_application_get_collection_manager (GamesApplication* self);
VALA_EXTERN guint games_collection_manager_get_n_user_collections (GamesCollectionManager* self);
static void _games_collection_action_window___lambda45_ (GamesCollectionActionWindow* self,
                                                  GamesCollection* collection);
static void __games_collection_action_window___lambda45__games_collection_manager_collection_added (GamesCollectionManager* _sender,
                                                                                             GamesCollection* collection,
                                                                                             gpointer self);
static void games_collection_action_window_finalize (GObject * obj);
static GType games_collection_action_window_get_type_once (void);
static void _vala_games_collection_action_window_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec);
static void _vala_games_collection_action_window_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const GActionEntry GAMES_COLLECTION_ACTION_WINDOW_action_entries[4] = {{"go-back", _games_collection_action_window_go_back_gsimple_action_activate_callback}, {"new-collection", _games_collection_action_window_new_collection_gsimple_action_activate_callback}, {"create-collection", _games_collection_action_window_create_collection_gsimple_action_activate_callback}, {"add-to-collection", _games_collection_action_window_add_to_collection_gsimple_action_activate_callback}};

static inline gpointer
games_collection_action_window_get_instance_private (GamesCollectionActionWindow* self)
{
	return G_STRUCT_MEMBER_P (self, GamesCollectionActionWindow_private_offset);
}

static void
_games_collection_action_window_go_back_gsimple_action_activate_callback (GSimpleAction* action,
                                                                          GVariant* parameter,
                                                                          gpointer self)
{
	games_collection_action_window_go_back ((GamesCollectionActionWindow*) self);
}

static void
_games_collection_action_window_new_collection_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                 GVariant* parameter,
                                                                                 gpointer self)
{
	games_collection_action_window_new_collection ((GamesCollectionActionWindow*) self);
}

static void
_games_collection_action_window_create_collection_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                    GVariant* parameter,
                                                                                    gpointer self)
{
	games_collection_action_window_create_collection ((GamesCollectionActionWindow*) self);
}

static void
_games_collection_action_window_add_to_collection_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                    GVariant* parameter,
                                                                                    gpointer self)
{
	games_collection_action_window_add_to_collection ((GamesCollectionActionWindow*) self);
}

GamesCollectionActionWindow*
games_collection_action_window_construct (GType object_type,
                                          gboolean create_collection_page_only,
                                          GamesCollection* collection)
{
	GamesCollectionActionWindow * self = NULL;
	self = (GamesCollectionActionWindow*) g_object_new (object_type, "create-collection-page-only", create_collection_page_only, "insensitive-collection", collection, NULL);
	return self;
}

GamesCollectionActionWindow*
games_collection_action_window_new (gboolean create_collection_page_only,
                                    GamesCollection* collection)
{
	return games_collection_action_window_construct (GAMES_TYPE_COLLECTION_ACTION_WINDOW, create_collection_page_only, collection);
}

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

static GtkWidget*
games_collection_action_window_add_collection_row (GamesCollectionActionWindow* self,
                                                   GObject* object)
{
	GamesCollection* collection = NULL;
	GamesCollection* _tmp0_;
	GamesCollection* _tmp1_;
	GamesCollectionListItem* row = NULL;
	GamesCollection* _tmp4_;
	GamesCollectionListItem* _tmp5_;
	GamesCollectionListItem* _tmp6_;
	GamesCollection* _tmp7_;
	GamesCollection* _tmp8_;
	GamesCollectionListItem* _tmp9_;
	GtkWidget* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (object != NULL, NULL);
	_tmp0_ = _g_object_ref0 (GAMES_IS_COLLECTION (object) ? ((GamesCollection*) object) : NULL);
	collection = _tmp0_;
	_tmp1_ = collection;
	if (games_collection_get_collection_type (_tmp1_) == GAMES_COLLECTION_TYPE_PLACEHOLDER) {
		GtkListBoxRow* _tmp2_;
		GtkWidget* _tmp3_;
		_tmp2_ = self->priv->add_row;
		_tmp3_ = _g_object_ref0 ((GtkWidget*) _tmp2_);
		result = _tmp3_;
		_g_object_unref0 (collection);
		return result;
	}
	_tmp4_ = collection;
	_tmp5_ = games_collection_list_item_new (_tmp4_);
	g_object_ref_sink (_tmp5_);
	row = _tmp5_;
	_tmp6_ = row;
	_tmp7_ = collection;
	_tmp8_ = self->priv->_insensitive_collection;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp6_, _tmp7_ != _tmp8_);
	_tmp9_ = row;
	gtk_widget_show ((GtkWidget*) _tmp9_);
	result = (GtkWidget*) row;
	_g_object_unref0 (collection);
	return result;
}

static gboolean
games_collection_action_window_list_box_filter (GamesCollectionActionWindow* self,
                                                GtkListBoxRow* row)
{
	gboolean show_row = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (row != NULL, FALSE);
	if (GAMES_IS_COLLECTION_LIST_ITEM (row)) {
		GamesCollectionListItem* list_item = NULL;
		GamesCollectionListItem* _tmp0_;
		GamesCollection* collection = NULL;
		GamesCollectionListItem* _tmp1_;
		GamesCollection* _tmp2_;
		GamesCollection* _tmp3_;
		GamesCollection* _tmp4_;
		GamesCollectionType type = 0;
		GamesCollection* _tmp5_;
		gboolean _tmp6_ = FALSE;
		_tmp0_ = _g_object_ref0 (GAMES_IS_COLLECTION_LIST_ITEM (row) ? ((GamesCollectionListItem*) row) : NULL);
		list_item = _tmp0_;
		_tmp1_ = list_item;
		_tmp2_ = games_collection_list_item_get_collection (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _g_object_ref0 (_tmp3_);
		collection = _tmp4_;
		_tmp5_ = collection;
		type = games_collection_get_collection_type (_tmp5_);
		if (type == GAMES_COLLECTION_TYPE_USER) {
			gboolean _tmp7_ = FALSE;
			gboolean _tmp8_ = FALSE;
			gboolean _tmp9_;
			_tmp9_ = self->priv->_is_search_mode;
			if (_tmp9_) {
				GamesCollection* _tmp10_;
				gchar** _tmp11_;
				gint _tmp11__length1;
				_tmp10_ = collection;
				_tmp11_ = self->filtering_terms;
				_tmp11__length1 = self->filtering_terms_length1;
				_tmp8_ = games_collection_matches_search_terms (_tmp10_, _tmp11_, (gint) _tmp11__length1);
			} else {
				_tmp8_ = FALSE;
			}
			if (_tmp8_) {
				_tmp7_ = TRUE;
			} else {
				gboolean _tmp12_;
				_tmp12_ = self->priv->_is_search_mode;
				_tmp7_ = !_tmp12_;
			}
			_tmp6_ = _tmp7_;
		} else {
			_tmp6_ = FALSE;
		}
		show_row = _tmp6_;
		_g_object_unref0 (collection);
		_g_object_unref0 (list_item);
	} else {
		gboolean _tmp13_ = FALSE;
		gboolean _tmp14_;
		_tmp14_ = self->priv->_is_search_mode;
		if (!_tmp14_) {
			_tmp13_ = TRUE;
		} else {
			gchar** _tmp15_;
			gint _tmp15__length1;
			_tmp15_ = self->filtering_terms;
			_tmp15__length1 = self->filtering_terms_length1;
			_tmp13_ = _tmp15__length1 == 0;
		}
		show_row = _tmp13_;
	}
	gtk_widget_set_visible ((GtkWidget*) row, show_row);
	result = show_row;
	return result;
}

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

static void
games_collection_action_window_add_to_collection (GamesCollectionActionWindow* self)
{
	GamesCollection** collections = NULL;
	GamesCollection** _tmp0_;
	gint collections_length1;
	gint _collections_size_;
	GtkListBox* _tmp1_;
	GList* _tmp2_;
	GamesCollection** _tmp21_;
	gint _tmp21__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_new0 (GamesCollection*, 0 + 1);
	collections = _tmp0_;
	collections_length1 = 0;
	_collections_size_ = collections_length1;
	_tmp1_ = self->priv->list_box;
	_tmp2_ = gtk_container_get_children ((GtkContainer*) _tmp1_);
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
		child_collection = _tmp2_;
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
			GtkWidget* child = NULL;
			child = (GtkWidget*) child_it->data;
			{
				GamesCollectionListItem* row = NULL;
				GtkWidget* _tmp3_;
				GamesCollectionListItem* _tmp4_;
				gboolean _tmp5_ = FALSE;
				GamesCollectionListItem* _tmp6_;
				GtkCheckButton* check_button = NULL;
				GamesCollectionListItem* _tmp10_;
				GtkWidget* _tmp11_;
				GtkWidget* _tmp12_;
				GtkCheckButton* _tmp13_;
				GtkCheckButton* _tmp14_;
				gboolean _tmp15_;
				gboolean _tmp16_;
				_tmp3_ = child;
				_tmp4_ = _g_object_ref0 (GAMES_IS_COLLECTION_LIST_ITEM (_tmp3_) ? ((GamesCollectionListItem*) _tmp3_) : NULL);
				row = _tmp4_;
				_tmp6_ = row;
				if (_tmp6_ == NULL) {
					_tmp5_ = TRUE;
				} else {
					GamesCollectionListItem* _tmp7_;
					GamesCollection* _tmp8_;
					GamesCollection* _tmp9_;
					_tmp7_ = row;
					_tmp8_ = games_collection_list_item_get_collection (_tmp7_);
					_tmp9_ = _tmp8_;
					_tmp5_ = games_collection_get_collection_type (_tmp9_) != GAMES_COLLECTION_TYPE_USER;
				}
				if (_tmp5_) {
					_g_object_unref0 (row);
					continue;
				}
				_tmp10_ = row;
				_tmp11_ = hdy_action_row_get_activatable_widget ((HdyActionRow*) _tmp10_);
				_tmp12_ = _tmp11_;
				_tmp13_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, gtk_check_button_get_type ()) ? ((GtkCheckButton*) _tmp12_) : NULL);
				check_button = _tmp13_;
				_tmp14_ = check_button;
				_tmp15_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp14_);
				_tmp16_ = _tmp15_;
				if (_tmp16_) {
					GamesCollectionListItem* _tmp17_;
					GamesCollection* _tmp18_;
					GamesCollection* _tmp19_;
					GamesCollection* _tmp20_;
					_tmp17_ = row;
					_tmp18_ = games_collection_list_item_get_collection (_tmp17_);
					_tmp19_ = _tmp18_;
					_tmp20_ = _g_object_ref0 (_tmp19_);
					_vala_array_add38 (&collections, &collections_length1, &_collections_size_, _tmp20_);
				}
				_g_object_unref0 (check_button);
				_g_object_unref0 (row);
			}
		}
		(child_collection == NULL) ? NULL : (child_collection = (g_list_free (child_collection), NULL));
	}
	_tmp21_ = collections;
	_tmp21__length1 = collections_length1;
	g_signal_emit (self, games_collection_action_window_signals[GAMES_COLLECTION_ACTION_WINDOW_CONFIRMED_SIGNAL], 0, _tmp21_, (gint) _tmp21__length1);
	gtk_window_close ((GtkWindow*) self);
	collections = (_vala_array_free (collections, collections_length1, (GDestroyNotify) g_object_unref), NULL);
}

static void
games_collection_action_window_new_collection (GamesCollectionActionWindow* self)
{
	HdyDeck* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->deck;
	hdy_deck_navigate (_tmp0_, HDY_NAVIGATION_DIRECTION_FORWARD);
}

static void
games_collection_action_window_go_back (GamesCollectionActionWindow* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_create_collection_page_only;
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		HdyDeck* _tmp2_;
		_tmp2_ = self->priv->deck;
		_tmp0_ = !hdy_deck_navigate (_tmp2_, HDY_NAVIGATION_DIRECTION_BACK);
	}
	if (_tmp0_) {
		gtk_window_close ((GtkWindow*) self);
	}
}

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

static void
games_collection_action_window_create_collection (GamesCollectionActionWindow* self)
{
	gboolean _tmp0_;
	GamesCollectionManager* _tmp1_;
	GtkEntry* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	GamesUserCollection* _tmp7_;
	GamesUserCollection* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_is_collection_name_valid;
	if (!_tmp0_) {
		return;
	}
	_tmp1_ = self->priv->collection_manager;
	_tmp2_ = self->priv->name_entry;
	_tmp3_ = gtk_entry_get_text (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = string_strip (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = games_collection_manager_create_user_collection (_tmp1_, _tmp6_);
	_tmp8_ = _tmp7_;
	_g_object_unref0 (_tmp8_);
	_g_free0 (_tmp6_);
	games_collection_action_window_go_back (self);
}

static void
_games_collection_action_window_create_collection_gtk_entry_activate (GtkEntry* _sender,
                                                                      gpointer self)
{
	games_collection_action_window_create_collection ((GamesCollectionActionWindow*) self);
}

static void
games_collection_action_window_on_listbox_row_activated (GamesCollectionActionWindow* self,
                                                         GtkListBoxRow* row)
{
	GtkListBoxRow* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (row != NULL);
	_tmp0_ = self->priv->add_row;
	if (row == _tmp0_) {
		games_collection_action_window_new_collection (self);
	}
}

static void
_games_collection_action_window_on_listbox_row_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                                     GtkListBoxRow* row,
                                                                                     gpointer self)
{
	games_collection_action_window_on_listbox_row_activated ((GamesCollectionActionWindow*) self, row);
}

gboolean
games_collection_action_window_on_key_pressed (GamesCollectionActionWindow* self,
                                               GdkEventKey* event)
{
	GdkModifierType default_modifiers = 0U;
	guint keyval = 0U;
	GdkKeymap* keymap = NULL;
	GdkDisplay* _tmp0_;
	GdkKeymap* _tmp1_;
	GdkKeymap* _tmp2_;
	GdkKeymap* _tmp3_;
	guint _tmp4_ = 0U;
	gboolean _tmp10_ = FALSE;
	gboolean _tmp11_ = FALSE;
	gboolean _tmp12_ = FALSE;
	gboolean _tmp18_;
	gboolean _tmp19_;
	gboolean _tmp20_ = FALSE;
	gboolean _tmp21_ = FALSE;
	HdyDeck* _tmp22_;
	GtkWidget* _tmp23_;
	GtkWidget* _tmp24_;
	GtkBox* _tmp25_;
	HdySearchBar* _tmp28_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	default_modifiers = gtk_accelerator_get_default_mod_mask ();
	_tmp0_ = gtk_widget_get_display ((GtkWidget*) self);
	_tmp1_ = gdk_keymap_get_for_display (_tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	keymap = _tmp2_;
	_tmp3_ = keymap;
	gdk_keymap_translate_keyboard_state (_tmp3_, (guint) event->hardware_keycode, event->state, (gint) event->group, &_tmp4_, NULL, NULL, NULL);
	keyval = _tmp4_;
	if (keyval == GDK_KEY_Escape) {
		HdyDeck* _tmp5_;
		GtkWidget* _tmp6_;
		GtkWidget* _tmp7_;
		GtkBox* _tmp8_;
		gboolean _tmp9_;
		_tmp5_ = self->priv->deck;
		_tmp6_ = hdy_deck_get_visible_child (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = self->priv->create_collection_page;
		if (_tmp7_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_widget_get_type (), GtkWidget)) {
			games_collection_action_window_go_back (self);
			result = GDK_EVENT_STOP;
			_g_object_unref0 (keymap);
			return result;
		}
		_tmp9_ = self->priv->_is_search_mode;
		if (_tmp9_) {
			games_collection_action_window_set_is_search_mode (self, FALSE);
			result = GDK_EVENT_STOP;
			_g_object_unref0 (keymap);
			return result;
		}
		games_collection_action_window_go_back (self);
		result = GDK_EVENT_STOP;
		_g_object_unref0 (keymap);
		return result;
	}
	if ((event->state & default_modifiers) == GDK_MOD1_MASK) {
		gboolean _tmp13_ = FALSE;
		gboolean _tmp14_ = FALSE;
		if (gtk_widget_get_direction ((GtkWidget*) self) == GTK_TEXT_DIR_LTR) {
			_tmp14_ = keyval == GDK_KEY_Left;
		} else {
			_tmp14_ = FALSE;
		}
		if (_tmp14_) {
			_tmp13_ = TRUE;
		} else {
			gboolean _tmp15_ = FALSE;
			if (gtk_widget_get_direction ((GtkWidget*) self) == GTK_TEXT_DIR_RTL) {
				_tmp15_ = keyval == GDK_KEY_Right;
			} else {
				_tmp15_ = FALSE;
			}
			_tmp13_ = _tmp15_;
		}
		_tmp12_ = _tmp13_;
	} else {
		_tmp12_ = FALSE;
	}
	if (_tmp12_) {
		gboolean _tmp16_;
		_tmp16_ = self->priv->_create_collection_page_only;
		_tmp11_ = !_tmp16_;
	} else {
		_tmp11_ = FALSE;
	}
	if (_tmp11_) {
		HdyDeck* _tmp17_;
		_tmp17_ = self->priv->deck;
		_tmp10_ = hdy_deck_navigate (_tmp17_, HDY_NAVIGATION_DIRECTION_BACK);
	} else {
		_tmp10_ = FALSE;
	}
	if (_tmp10_) {
		result = GDK_EVENT_STOP;
		_g_object_unref0 (keymap);
		return result;
	}
	_tmp18_ = games_collection_action_window_get_is_user_collections_empty (self);
	_tmp19_ = _tmp18_;
	if (_tmp19_) {
		result = GDK_EVENT_PROPAGATE;
		_g_object_unref0 (keymap);
		return result;
	}
	_tmp22_ = self->priv->deck;
	_tmp23_ = hdy_deck_get_visible_child (_tmp22_);
	_tmp24_ = _tmp23_;
	_tmp25_ = self->priv->add_to_collection_page;
	if (_tmp24_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, gtk_widget_get_type (), GtkWidget)) {
		gboolean _tmp26_ = FALSE;
		if (keyval == GDK_KEY_f) {
			_tmp26_ = TRUE;
		} else {
			_tmp26_ = keyval == GDK_KEY_F;
		}
		_tmp21_ = _tmp26_;
	} else {
		_tmp21_ = FALSE;
	}
	if (_tmp21_) {
		_tmp20_ = (event->state & default_modifiers) == GDK_CONTROL_MASK;
	} else {
		_tmp20_ = FALSE;
	}
	if (_tmp20_) {
		gboolean _tmp27_;
		_tmp27_ = self->priv->_is_search_mode;
		games_collection_action_window_set_is_search_mode (self, !_tmp27_);
		result = GDK_EVENT_STOP;
		_g_object_unref0 (keymap);
		return result;
	}
	_tmp28_ = self->priv->search_bar;
	result = hdy_search_bar_handle_event (_tmp28_, (GdkEvent*) event);
	_g_object_unref0 (keymap);
	return result;
}

static gboolean
_games_collection_action_window_on_key_pressed_gtk_widget_key_press_event (GtkWidget* _sender,
                                                                           GdkEventKey* event,
                                                                           gpointer self)
{
	gboolean result;
	result = games_collection_action_window_on_key_pressed ((GamesCollectionActionWindow*) self, event);
	return result;
}

static void
games_collection_action_window_on_collection_name_entry_changed (GamesCollectionActionWindow* self)
{
	gchar* name = NULL;
	GtkEntry* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	GamesCollectionManager* _tmp8_;
	const gchar* _tmp9_;
	GtkEntry* _tmp13_;
	GtkStyleContext* _tmp14_;
	GtkLabel* _tmp15_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->name_entry;
	_tmp1_ = gtk_entry_get_text (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = string_strip (_tmp2_);
	name = _tmp3_;
	_tmp4_ = name;
	if (g_strcmp0 (_tmp4_, "") == 0) {
		GtkLabel* _tmp5_;
		GtkEntry* _tmp6_;
		GtkStyleContext* _tmp7_;
		_tmp5_ = self->priv->error_label;
		gtk_label_set_label (_tmp5_, _ ("Collection name cannot be empty"));
		_tmp6_ = self->priv->name_entry;
		_tmp7_ = gtk_widget_get_style_context ((GtkWidget*) _tmp6_);
		gtk_style_context_add_class (_tmp7_, "error");
		games_collection_action_window_set_is_collection_name_valid (self, FALSE);
		_g_free0 (name);
		return;
	}
	_tmp8_ = self->priv->collection_manager;
	_tmp9_ = name;
	if (games_collection_manager_does_collection_title_exist (_tmp8_, _tmp9_)) {
		GtkLabel* _tmp10_;
		GtkEntry* _tmp11_;
		GtkStyleContext* _tmp12_;
		_tmp10_ = self->priv->error_label;
		gtk_label_set_label (_tmp10_, _ ("A collection with this name already exists"));
		_tmp11_ = self->priv->name_entry;
		_tmp12_ = gtk_widget_get_style_context ((GtkWidget*) _tmp11_);
		gtk_style_context_add_class (_tmp12_, "error");
		games_collection_action_window_set_is_collection_name_valid (self, FALSE);
		_g_free0 (name);
		return;
	}
	_tmp13_ = self->priv->name_entry;
	_tmp14_ = gtk_widget_get_style_context ((GtkWidget*) _tmp13_);
	gtk_style_context_remove_class (_tmp14_, "error");
	_tmp15_ = self->priv->error_label;
	gtk_label_set_label (_tmp15_, NULL);
	games_collection_action_window_set_is_collection_name_valid (self, TRUE);
	_g_free0 (name);
}

static void
_games_collection_action_window_on_collection_name_entry_changed_g_object_notify (GObject* _sender,
                                                                                  GParamSpec* pspec,
                                                                                  gpointer self)
{
	games_collection_action_window_on_collection_name_entry_changed ((GamesCollectionActionWindow*) self);
}

static void
games_collection_action_window_on_visible_child_changed (GamesCollectionActionWindow* self)
{
	HdyDeck* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GtkBox* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->deck;
	_tmp1_ = hdy_deck_get_visible_child (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->create_collection_page;
	if (_tmp2_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget)) {
		GtkEntry* _tmp4_;
		GtkLabel* _tmp5_;
		GtkEntry* _tmp6_;
		GtkStyleContext* _tmp7_;
		GtkEntry* _tmp8_;
		_tmp4_ = self->priv->name_entry;
		gtk_entry_set_text (_tmp4_, "");
		_tmp5_ = self->priv->error_label;
		gtk_label_set_label (_tmp5_, "");
		_tmp6_ = self->priv->name_entry;
		_tmp7_ = gtk_widget_get_style_context ((GtkWidget*) _tmp6_);
		gtk_style_context_remove_class (_tmp7_, "error");
		_tmp8_ = self->priv->name_entry;
		gtk_entry_grab_focus_without_selecting (_tmp8_);
	}
}

static void
_games_collection_action_window_on_visible_child_changed_g_object_notify (GObject* _sender,
                                                                          GParamSpec* pspec,
                                                                          gpointer self)
{
	games_collection_action_window_on_visible_child_changed ((GamesCollectionActionWindow*) self);
}

static void
games_collection_action_window_on_search_text_notify (GamesCollectionActionWindow* self)
{
	GtkSearchEntry* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GtkSearchEntry* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->search_entry;
	_tmp1_ = gtk_entry_get_text ((GtkEntry*) _tmp0_);
	_tmp2_ = _tmp1_;
	games_collection_action_window_set_filtering_text (self, _tmp2_);
	_tmp3_ = self->priv->search_entry;
	gtk_entry_grab_focus_without_selecting ((GtkEntry*) _tmp3_);
}

static void
_games_collection_action_window_on_search_text_notify_gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                                                                       gpointer self)
{
	games_collection_action_window_on_search_text_notify ((GamesCollectionActionWindow*) self);
}

static void
games_collection_action_window_set_filtering_text (GamesCollectionActionWindow* self,
                                                   const gchar* value)
{
	GtkListBox* _tmp2_;
	g_return_if_fail (self != NULL);
	if (value == NULL) {
		self->filtering_terms = (_vala_array_free (self->filtering_terms, self->filtering_terms_length1, (GDestroyNotify) g_free), NULL);
		self->filtering_terms = NULL;
		self->filtering_terms_length1 = 0;
		self->_filtering_terms_size_ = self->filtering_terms_length1;
	} else {
		gchar** _tmp0_;
		gchar** _tmp1_;
		_tmp1_ = _tmp0_ = g_strsplit (value, " ", 0);
		self->filtering_terms = (_vala_array_free (self->filtering_terms, self->filtering_terms_length1, (GDestroyNotify) g_free), NULL);
		self->filtering_terms = _tmp1_;
		self->filtering_terms_length1 = _vala_array_length (_tmp0_);
		self->_filtering_terms_size_ = self->filtering_terms_length1;
	}
	_tmp2_ = self->priv->list_box;
	gtk_list_box_invalidate_filter (_tmp2_);
}

GamesCollectionModel*
games_collection_action_window_get_collection_model (GamesCollectionActionWindow* self)
{
	GamesCollectionModel* result;
	GamesCollectionModel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_collection_model;
	result = _tmp0_;
	return result;
}

static GtkWidget*
_games_collection_action_window_add_collection_row_gtk_list_box_create_widget_func (GObject* item,
                                                                                    gpointer self)
{
	GtkWidget* result;
	result = games_collection_action_window_add_collection_row ((GamesCollectionActionWindow*) self, item);
	return result;
}

static gboolean
_games_collection_action_window_list_box_filter_gtk_list_box_filter_func (GtkListBoxRow* row,
                                                                          gpointer self)
{
	gboolean result;
	result = games_collection_action_window_list_box_filter ((GamesCollectionActionWindow*) self, row);
	return result;
}

void
games_collection_action_window_set_collection_model (GamesCollectionActionWindow* self,
                                                     GamesCollectionModel* value)
{
	GamesCollectionModel* _tmp0_;
	GtkListBox* _tmp1_;
	GamesCollectionModel* _tmp2_;
	GamesCollectionModel* _tmp3_;
	GtkListBox* _tmp4_;
	GtkListBox* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_collection_model);
	self->priv->_collection_model = _tmp0_;
	_tmp1_ = self->priv->list_box;
	_tmp2_ = games_collection_action_window_get_collection_model (self);
	_tmp3_ = _tmp2_;
	gtk_list_box_bind_model (_tmp1_, (GListModel*) _tmp3_, _games_collection_action_window_add_collection_row_gtk_list_box_create_widget_func, g_object_ref (self), g_object_unref);
	_tmp4_ = self->priv->list_box;
	gtk_list_box_set_filter_func (_tmp4_, _games_collection_action_window_list_box_filter_gtk_list_box_filter_func, g_object_ref (self), g_object_unref);
	_tmp5_ = self->priv->list_box;
	gtk_list_box_invalidate_filter (_tmp5_);
	g_object_notify_by_pspec ((GObject *) self, games_collection_action_window_properties[GAMES_COLLECTION_ACTION_WINDOW_COLLECTION_MODEL_PROPERTY]);
}

gboolean
games_collection_action_window_get_is_user_collections_empty (GamesCollectionActionWindow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_user_collections_empty;
	return result;
}

void
games_collection_action_window_set_is_user_collections_empty (GamesCollectionActionWindow* self,
                                                              gboolean value)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	self->priv->_is_user_collections_empty = value;
	_tmp0_ = games_collection_action_window_get_is_user_collections_empty (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		GtkStack* _tmp2_;
		HdyStatusPage* _tmp3_;
		_tmp2_ = self->priv->user_collections_page_stack;
		_tmp3_ = self->priv->empty_page;
		gtk_stack_set_visible_child (_tmp2_, (GtkWidget*) _tmp3_);
	} else {
		GtkStack* _tmp4_;
		GtkScrolledWindow* _tmp5_;
		_tmp4_ = self->priv->user_collections_page_stack;
		_tmp5_ = self->priv->list_page;
		gtk_stack_set_visible_child (_tmp4_, (GtkWidget*) _tmp5_);
	}
	g_object_notify_by_pspec ((GObject *) self, games_collection_action_window_properties[GAMES_COLLECTION_ACTION_WINDOW_IS_USER_COLLECTIONS_EMPTY_PROPERTY]);
}

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

void
games_collection_action_window_set_is_search_mode (GamesCollectionActionWindow* self,
                                                   gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collection_action_window_get_is_search_mode (self);
	if (old_value != value) {
		self->priv->_is_search_mode = value;
		g_object_notify_by_pspec ((GObject *) self, games_collection_action_window_properties[GAMES_COLLECTION_ACTION_WINDOW_IS_SEARCH_MODE_PROPERTY]);
	}
}

gboolean
games_collection_action_window_get_is_collection_name_valid (GamesCollectionActionWindow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_collection_name_valid;
	return result;
}

void
games_collection_action_window_set_is_collection_name_valid (GamesCollectionActionWindow* self,
                                                             gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collection_action_window_get_is_collection_name_valid (self);
	if (old_value != value) {
		self->priv->_is_collection_name_valid = value;
		g_object_notify_by_pspec ((GObject *) self, games_collection_action_window_properties[GAMES_COLLECTION_ACTION_WINDOW_IS_COLLECTION_NAME_VALID_PROPERTY]);
	}
}

gboolean
games_collection_action_window_get_create_collection_page_only (GamesCollectionActionWindow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_create_collection_page_only;
	return result;
}

static void
games_collection_action_window_set_create_collection_page_only (GamesCollectionActionWindow* self,
                                                                gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collection_action_window_get_create_collection_page_only (self);
	if (old_value != value) {
		self->priv->_create_collection_page_only = value;
		g_object_notify_by_pspec ((GObject *) self, games_collection_action_window_properties[GAMES_COLLECTION_ACTION_WINDOW_CREATE_COLLECTION_PAGE_ONLY_PROPERTY]);
	}
}

GamesCollection*
games_collection_action_window_get_insensitive_collection (GamesCollectionActionWindow* self)
{
	GamesCollection* result;
	GamesCollection* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_insensitive_collection;
	result = _tmp0_;
	return result;
}

static void
games_collection_action_window_set_insensitive_collection (GamesCollectionActionWindow* self,
                                                           GamesCollection* value)
{
	GamesCollection* old_value;
	g_return_if_fail (self != NULL);
	old_value = games_collection_action_window_get_insensitive_collection (self);
	if (old_value != value) {
		GamesCollection* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_insensitive_collection);
		self->priv->_insensitive_collection = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, games_collection_action_window_properties[GAMES_COLLECTION_ACTION_WINDOW_INSENSITIVE_COLLECTION_PROPERTY]);
	}
}

static void
g_cclosure_user_marshal_VOID__POINTER_INT (GClosure * closure,
                                           GValue * return_value,
                                           guint n_param_values,
                                           const GValue * param_values,
                                           gpointer invocation_hint,
                                           gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__POINTER_INT) (gpointer data1, gpointer arg_1, gint arg_2, gpointer data2);
	register GMarshalFunc_VOID__POINTER_INT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__POINTER_INT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_pointer (param_values + 1), g_value_get_int (param_values + 2), data2);
}

static void
_games_collection_action_window___lambda45_ (GamesCollectionActionWindow* self,
                                             GamesCollection* collection)
{
	GamesCollectionManager* _tmp0_;
	guint _tmp1_;
	guint _tmp2_;
	g_return_if_fail (collection != NULL);
	_tmp0_ = self->priv->collection_manager;
	_tmp1_ = games_collection_manager_get_n_user_collections (_tmp0_);
	_tmp2_ = _tmp1_;
	games_collection_action_window_set_is_user_collections_empty (self, _tmp2_ == ((guint) 0));
}

static void
__games_collection_action_window___lambda45__games_collection_manager_collection_added (GamesCollectionManager* _sender,
                                                                                        GamesCollection* collection,
                                                                                        gpointer self)
{
	_games_collection_action_window___lambda45_ ((GamesCollectionActionWindow*) self, collection);
}

static GObject *
games_collection_action_window_constructor (GType type,
                                            guint n_construct_properties,
                                            GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GamesCollectionActionWindow * self;
	gboolean _tmp0_;
	GamesApplication* _tmp5_;
	GamesApplication* _tmp6_;
	GamesCollectionManager* _tmp7_;
	GamesCollectionManager* _tmp8_;
	guint _tmp9_;
	guint _tmp10_;
	GamesCollectionManager* _tmp11_;
	GSimpleActionGroup* _tmp12_;
	GSimpleActionGroup* _tmp13_;
	GSimpleActionGroup* _tmp14_;
	HdySearchBar* _tmp15_;
	GtkSearchEntry* _tmp16_;
	parent_class = G_OBJECT_CLASS (games_collection_action_window_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_COLLECTION_ACTION_WINDOW, GamesCollectionActionWindow);
	_tmp0_ = self->priv->_create_collection_page_only;
	if (_tmp0_) {
		HdyDeck* _tmp1_;
		GtkBox* _tmp2_;
		_tmp1_ = self->priv->deck;
		_tmp2_ = self->priv->create_collection_page;
		hdy_deck_set_visible_child (_tmp1_, (GtkWidget*) _tmp2_);
	} else {
		HdyDeck* _tmp3_;
		GtkBox* _tmp4_;
		_tmp3_ = self->priv->deck;
		_tmp4_ = self->priv->add_to_collection_page;
		hdy_deck_set_visible_child (_tmp3_, (GtkWidget*) _tmp4_);
	}
	_tmp5_ = games_application_get_default ();
	_tmp6_ = _tmp5_;
	_tmp7_ = games_application_get_collection_manager (_tmp6_);
	_g_object_unref0 (self->priv->collection_manager);
	self->priv->collection_manager = _tmp7_;
	_g_object_unref0 (_tmp6_);
	_tmp8_ = self->priv->collection_manager;
	_tmp9_ = games_collection_manager_get_n_user_collections (_tmp8_);
	_tmp10_ = _tmp9_;
	games_collection_action_window_set_is_user_collections_empty (self, _tmp10_ == ((guint) 0));
	_tmp11_ = self->priv->collection_manager;
	g_signal_connect_object (_tmp11_, "collection-added", (GCallback) __games_collection_action_window___lambda45__games_collection_manager_collection_added, self, 0);
	_tmp12_ = g_simple_action_group_new ();
	_g_object_unref0 (self->priv->action_group);
	self->priv->action_group = _tmp12_;
	_tmp13_ = self->priv->action_group;
	g_action_map_add_action_entries ((GActionMap*) _tmp13_, GAMES_COLLECTION_ACTION_WINDOW_action_entries, (gint) G_N_ELEMENTS (GAMES_COLLECTION_ACTION_WINDOW_action_entries), self);
	_tmp14_ = self->priv->action_group;
	gtk_widget_insert_action_group ((GtkWidget*) self, "collection-action", (GActionGroup*) _tmp14_);
	_tmp15_ = self->priv->search_bar;
	_tmp16_ = self->priv->search_entry;
	hdy_search_bar_connect_entry (_tmp15_, (GtkEntry*) _tmp16_);
	return obj;
}

static void
games_collection_action_window_class_init (GamesCollectionActionWindowClass * klass,
                                           gpointer klass_data)
{
	games_collection_action_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GamesCollectionActionWindow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_games_collection_action_window_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_games_collection_action_window_set_property;
	G_OBJECT_CLASS (klass)->constructor = games_collection_action_window_constructor;
	G_OBJECT_CLASS (klass)->finalize = games_collection_action_window_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_ACTION_WINDOW_COLLECTION_MODEL_PROPERTY, games_collection_action_window_properties[GAMES_COLLECTION_ACTION_WINDOW_COLLECTION_MODEL_PROPERTY] = g_param_spec_object ("collection-model", "collection-model", "collection-model", GAMES_TYPE_COLLECTION_MODEL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_ACTION_WINDOW_IS_USER_COLLECTIONS_EMPTY_PROPERTY, games_collection_action_window_properties[GAMES_COLLECTION_ACTION_WINDOW_IS_USER_COLLECTIONS_EMPTY_PROPERTY] = g_param_spec_boolean ("is-user-collections-empty", "is-user-collections-empty", "is-user-collections-empty", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_ACTION_WINDOW_IS_SEARCH_MODE_PROPERTY, games_collection_action_window_properties[GAMES_COLLECTION_ACTION_WINDOW_IS_SEARCH_MODE_PROPERTY] = g_param_spec_boolean ("is-search-mode", "is-search-mode", "is-search-mode", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_ACTION_WINDOW_IS_COLLECTION_NAME_VALID_PROPERTY, games_collection_action_window_properties[GAMES_COLLECTION_ACTION_WINDOW_IS_COLLECTION_NAME_VALID_PROPERTY] = g_param_spec_boolean ("is-collection-name-valid", "is-collection-name-valid", "is-collection-name-valid", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_ACTION_WINDOW_CREATE_COLLECTION_PAGE_ONLY_PROPERTY, games_collection_action_window_properties[GAMES_COLLECTION_ACTION_WINDOW_CREATE_COLLECTION_PAGE_ONLY_PROPERTY] = g_param_spec_boolean ("create-collection-page-only", "create-collection-page-only", "create-collection-page-only", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_ACTION_WINDOW_INSENSITIVE_COLLECTION_PROPERTY, games_collection_action_window_properties[GAMES_COLLECTION_ACTION_WINDOW_INSENSITIVE_COLLECTION_PROPERTY] = g_param_spec_object ("insensitive-collection", "insensitive-collection", "insensitive-collection", GAMES_TYPE_COLLECTION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Games/ui/collection-action-window.ui");
	games_collection_action_window_signals[GAMES_COLLECTION_ACTION_WINDOW_CONFIRMED_SIGNAL] = g_signal_new ("confirmed", GAMES_TYPE_COLLECTION_ACTION_WINDOW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__POINTER_INT, G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_INT);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "deck", FALSE, GamesCollectionActionWindow_private_offset + G_STRUCT_OFFSET (GamesCollectionActionWindowPrivate, deck));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "add_to_collection_page", FALSE, GamesCollectionActionWindow_private_offset + G_STRUCT_OFFSET (GamesCollectionActionWindowPrivate, add_to_collection_page));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "create_collection_page", FALSE, GamesCollectionActionWindow_private_offset + G_STRUCT_OFFSET (GamesCollectionActionWindowPrivate, create_collection_page));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "user_collections_page_stack", FALSE, GamesCollectionActionWindow_private_offset + G_STRUCT_OFFSET (GamesCollectionActionWindowPrivate, user_collections_page_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "list_page", FALSE, GamesCollectionActionWindow_private_offset + G_STRUCT_OFFSET (GamesCollectionActionWindowPrivate, list_page));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "empty_page", FALSE, GamesCollectionActionWindow_private_offset + G_STRUCT_OFFSET (GamesCollectionActionWindowPrivate, empty_page));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "name_entry", FALSE, GamesCollectionActionWindow_private_offset + G_STRUCT_OFFSET (GamesCollectionActionWindowPrivate, name_entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "error_label", FALSE, GamesCollectionActionWindow_private_offset + G_STRUCT_OFFSET (GamesCollectionActionWindowPrivate, error_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "list_box", FALSE, GamesCollectionActionWindow_private_offset + G_STRUCT_OFFSET (GamesCollectionActionWindowPrivate, list_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "search_bar", FALSE, GamesCollectionActionWindow_private_offset + G_STRUCT_OFFSET (GamesCollectionActionWindowPrivate, search_bar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "search_entry", FALSE, GamesCollectionActionWindow_private_offset + G_STRUCT_OFFSET (GamesCollectionActionWindowPrivate, search_entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "add_row", FALSE, GamesCollectionActionWindow_private_offset + G_STRUCT_OFFSET (GamesCollectionActionWindowPrivate, add_row));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "create_collection", G_CALLBACK(_games_collection_action_window_create_collection_gtk_entry_activate));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_listbox_row_activated", G_CALLBACK(_games_collection_action_window_on_listbox_row_activated_gtk_list_box_row_activated));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_key_pressed", G_CALLBACK(_games_collection_action_window_on_key_pressed_gtk_widget_key_press_event));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_collection_name_entry_changed", G_CALLBACK(_games_collection_action_window_on_collection_name_entry_changed_g_object_notify));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_visible_child_changed", G_CALLBACK(_games_collection_action_window_on_visible_child_changed_g_object_notify));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_search_text_notify", G_CALLBACK(_games_collection_action_window_on_search_text_notify_gtk_search_entry_search_changed));
}

static void
games_collection_action_window_instance_init (GamesCollectionActionWindow * self,
                                              gpointer klass)
{
	self->priv = games_collection_action_window_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
games_collection_action_window_finalize (GObject * obj)
{
	GamesCollectionActionWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_COLLECTION_ACTION_WINDOW, GamesCollectionActionWindow);
	_g_object_unref0 (self->priv->collection_manager);
	_g_object_unref0 (self->priv->action_group);
	self->filtering_terms = (_vala_array_free (self->filtering_terms, self->filtering_terms_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (self->priv->_collection_model);
	_g_object_unref0 (self->priv->_insensitive_collection);
	G_OBJECT_CLASS (games_collection_action_window_parent_class)->finalize (obj);
}

static GType
games_collection_action_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GamesCollectionActionWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_collection_action_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesCollectionActionWindow), 0, (GInstanceInitFunc) games_collection_action_window_instance_init, NULL };
	GType games_collection_action_window_type_id;
	games_collection_action_window_type_id = g_type_register_static (hdy_window_get_type (), "GamesCollectionActionWindow", &g_define_type_info, 0);
	GamesCollectionActionWindow_private_offset = g_type_add_instance_private (games_collection_action_window_type_id, sizeof (GamesCollectionActionWindowPrivate));
	return games_collection_action_window_type_id;
}

GType
games_collection_action_window_get_type (void)
{
	static volatile gsize games_collection_action_window_type_id__once = 0;
	if (g_once_init_enter (&games_collection_action_window_type_id__once)) {
		GType games_collection_action_window_type_id;
		games_collection_action_window_type_id = games_collection_action_window_get_type_once ();
		g_once_init_leave (&games_collection_action_window_type_id__once, games_collection_action_window_type_id);
	}
	return games_collection_action_window_type_id__once;
}

static void
_vala_games_collection_action_window_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec)
{
	GamesCollectionActionWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_COLLECTION_ACTION_WINDOW, GamesCollectionActionWindow);
	switch (property_id) {
		case GAMES_COLLECTION_ACTION_WINDOW_COLLECTION_MODEL_PROPERTY:
		g_value_set_object (value, games_collection_action_window_get_collection_model (self));
		break;
		case GAMES_COLLECTION_ACTION_WINDOW_IS_USER_COLLECTIONS_EMPTY_PROPERTY:
		g_value_set_boolean (value, games_collection_action_window_get_is_user_collections_empty (self));
		break;
		case GAMES_COLLECTION_ACTION_WINDOW_IS_SEARCH_MODE_PROPERTY:
		g_value_set_boolean (value, games_collection_action_window_get_is_search_mode (self));
		break;
		case GAMES_COLLECTION_ACTION_WINDOW_IS_COLLECTION_NAME_VALID_PROPERTY:
		g_value_set_boolean (value, games_collection_action_window_get_is_collection_name_valid (self));
		break;
		case GAMES_COLLECTION_ACTION_WINDOW_CREATE_COLLECTION_PAGE_ONLY_PROPERTY:
		g_value_set_boolean (value, games_collection_action_window_get_create_collection_page_only (self));
		break;
		case GAMES_COLLECTION_ACTION_WINDOW_INSENSITIVE_COLLECTION_PROPERTY:
		g_value_set_object (value, games_collection_action_window_get_insensitive_collection (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_games_collection_action_window_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec)
{
	GamesCollectionActionWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_COLLECTION_ACTION_WINDOW, GamesCollectionActionWindow);
	switch (property_id) {
		case GAMES_COLLECTION_ACTION_WINDOW_COLLECTION_MODEL_PROPERTY:
		games_collection_action_window_set_collection_model (self, g_value_get_object (value));
		break;
		case GAMES_COLLECTION_ACTION_WINDOW_IS_USER_COLLECTIONS_EMPTY_PROPERTY:
		games_collection_action_window_set_is_user_collections_empty (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTION_ACTION_WINDOW_IS_SEARCH_MODE_PROPERTY:
		games_collection_action_window_set_is_search_mode (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTION_ACTION_WINDOW_IS_COLLECTION_NAME_VALID_PROPERTY:
		games_collection_action_window_set_is_collection_name_valid (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTION_ACTION_WINDOW_CREATE_COLLECTION_PAGE_ONLY_PROPERTY:
		games_collection_action_window_set_create_collection_page_only (self, g_value_get_boolean (value));
		break;
		case GAMES_COLLECTION_ACTION_WINDOW_INSENSITIVE_COLLECTION_PROPERTY:
		games_collection_action_window_set_insensitive_collection (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

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

