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

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

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

#define GAMES_COLLECTION_THUMBNAIL_N_ROWS ((guint) 2)
#define GAMES_COLLECTION_THUMBNAIL_N_COLUMNS ((guint) 2)
#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_THUMBNAIL (games_collection_thumbnail_get_type ())
#define GAMES_COLLECTION_THUMBNAIL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_COLLECTION_THUMBNAIL, GamesCollectionThumbnail))
#define GAMES_COLLECTION_THUMBNAIL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_COLLECTION_THUMBNAIL, GamesCollectionThumbnailClass))
#define GAMES_IS_COLLECTION_THUMBNAIL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_COLLECTION_THUMBNAIL))
#define GAMES_IS_COLLECTION_THUMBNAIL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_COLLECTION_THUMBNAIL))
#define GAMES_COLLECTION_THUMBNAIL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_COLLECTION_THUMBNAIL, GamesCollectionThumbnailClass))

typedef struct _GamesCollectionThumbnail GamesCollectionThumbnail;
typedef struct _GamesCollectionThumbnailClass GamesCollectionThumbnailClass;
typedef struct _GamesCollectionThumbnailPrivate GamesCollectionThumbnailPrivate;

#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_THUMBNAIL_0_PROPERTY,
	GAMES_COLLECTION_THUMBNAIL_COLLECTION_PROPERTY,
	GAMES_COLLECTION_THUMBNAIL_NUM_PROPERTIES
};
static GParamSpec* games_collection_thumbnail_properties[GAMES_COLLECTION_THUMBNAIL_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define GAMES_TYPE_GAME_THUMBNAIL (games_game_thumbnail_get_type ())
#define GAMES_GAME_THUMBNAIL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_GAME_THUMBNAIL, GamesGameThumbnail))
#define GAMES_GAME_THUMBNAIL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_GAME_THUMBNAIL, GamesGameThumbnailClass))
#define GAMES_IS_GAME_THUMBNAIL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_GAME_THUMBNAIL))
#define GAMES_IS_GAME_THUMBNAIL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_GAME_THUMBNAIL))
#define GAMES_GAME_THUMBNAIL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_GAME_THUMBNAIL, GamesGameThumbnailClass))

typedef struct _GamesGameThumbnail GamesGameThumbnail;
typedef struct _GamesGameThumbnailClass GamesGameThumbnailClass;
typedef struct _Block25Data Block25Data;

struct _GamesCollectionThumbnail {
	GtkBin parent_instance;
	GamesCollectionThumbnailPrivate * priv;
};

struct _GamesCollectionThumbnailClass {
	GtkBinClass parent_class;
};

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

struct _GamesCollectionThumbnailPrivate {
	GtkStack* thumbnail_stack;
	GtkGrid* grid;
	GtkImage* new_collection_image;
	gulong games_changed_id;
	GamesCollection* _collection;
};

struct _Block25Data {
	int _ref_count_;
	GamesCollectionThumbnail* self;
	GamesGameThumbnail* game_thumbnail;
};

static gint GamesCollectionThumbnail_private_offset;
static gpointer games_collection_thumbnail_parent_class = NULL;

VALA_EXTERN GType games_collection_thumbnail_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_thumbnail_on_games_changed (GamesCollectionThumbnail* self);
VALA_EXTERN GamesCollection* games_collection_thumbnail_get_collection (GamesCollectionThumbnail* self);
VALA_EXTERN GamesGameModel* games_collection_get_game_model (GamesCollection* self);
VALA_EXTERN GType games_game_thumbnail_get_type (void) G_GNUC_CONST ;
static GamesGameThumbnail* games_collection_thumbnail_get_game_thumbnail (GamesCollectionThumbnail* self,
                                                                   GamesGame* game);
static Block25Data* block25_data_ref (Block25Data* _data25_);
static void block25_data_unref (void * _userdata_);
VALA_EXTERN GamesGameThumbnail* games_game_thumbnail_new (void);
VALA_EXTERN GamesGameThumbnail* games_game_thumbnail_construct (GType object_type);
VALA_EXTERN void games_game_thumbnail_set_game (GamesGameThumbnail* self,
                                    GamesGame* value);
static void __lambda23_ (Block25Data* _data25_,
                  GamesGame* new_game);
static void ___lambda23__games_game_replaced (GamesGame* _sender,
                                       GamesGame* new_game,
                                       gpointer self);
VALA_EXTERN GamesCollectionThumbnail* games_collection_thumbnail_new (void);
VALA_EXTERN GamesCollectionThumbnail* games_collection_thumbnail_construct (GType object_type);
VALA_EXTERN void games_collection_thumbnail_set_collection (GamesCollectionThumbnail* self,
                                                GamesCollection* value);
VALA_EXTERN GamesCollectionType games_collection_get_collection_type (GamesCollection* self);
static void _games_collection_thumbnail_on_games_changed_games_collection_games_changed (GamesCollection* _sender,
                                                                                  gpointer self);
static void games_collection_thumbnail_finalize (GObject * obj);
static GType games_collection_thumbnail_get_type_once (void);
static void _vala_games_collection_thumbnail_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
static void _vala_games_collection_thumbnail_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
games_collection_thumbnail_get_instance_private (GamesCollectionThumbnail* self)
{
	return G_STRUCT_MEMBER_P (self, GamesCollectionThumbnail_private_offset);
}

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

static void
games_collection_thumbnail_on_games_changed (GamesCollectionThumbnail* self)
{
	guint max_subcovers = 0U;
	GList* children = NULL;
	GtkGrid* _tmp0_;
	GList* _tmp1_;
	gint pos = 0;
	GamesGameModel* game_model = NULL;
	GamesCollection* _tmp2_;
	GamesCollection* _tmp3_;
	GamesGameModel* _tmp4_;
	guint n_games = 0U;
	GamesGameModel* _tmp5_;
	GList* _tmp6_;
	g_return_if_fail (self != NULL);
	max_subcovers = GAMES_COLLECTION_THUMBNAIL_N_ROWS * GAMES_COLLECTION_THUMBNAIL_N_COLUMNS;
	_tmp0_ = self->priv->grid;
	_tmp1_ = gtk_container_get_children ((GtkContainer*) _tmp0_);
	children = _tmp1_;
	children = g_list_reverse (children);
	pos = 0;
	_tmp2_ = games_collection_thumbnail_get_collection (self);
	_tmp3_ = _tmp2_;
	_tmp4_ = games_collection_get_game_model (_tmp3_);
	game_model = _tmp4_;
	_tmp5_ = game_model;
	n_games = g_list_model_get_n_items ((GListModel*) _tmp5_);
	_tmp6_ = children;
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
		child_collection = _tmp6_;
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
			GtkWidget* child = NULL;
			child = (GtkWidget*) child_it->data;
			{
				GtkBin* event_box = NULL;
				GtkWidget* _tmp7_;
				GtkBin* _tmp8_;
				_tmp7_ = child;
				_tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, gtk_bin_get_type ()) ? ((GtkBin*) _tmp7_) : NULL);
				event_box = _tmp8_;
				if (((guint) pos) < n_games) {
					GamesGame* game = NULL;
					GamesGameModel* _tmp9_;
					GObject* _tmp10_;
					GamesGame* _tmp11_;
					GamesGameThumbnail* game_thumbnail = NULL;
					GamesGame* _tmp12_;
					GamesGameThumbnail* _tmp13_;
					GtkWidget* current_thumbnail = NULL;
					GtkBin* _tmp14_;
					GtkWidget* _tmp15_;
					GtkWidget* _tmp16_;
					GtkWidget* _tmp17_;
					GtkBin* _tmp20_;
					GamesGameThumbnail* _tmp21_;
					gint _tmp22_;
					_tmp9_ = game_model;
					_tmp10_ = g_list_model_get_item ((GListModel*) _tmp9_, (guint) pos);
					_tmp11_ = GAMES_IS_GAME (_tmp10_) ? ((GamesGame*) _tmp10_) : NULL;
					if (_tmp11_ == NULL) {
						_g_object_unref0 (_tmp10_);
					}
					game = _tmp11_;
					_tmp12_ = game;
					_tmp13_ = games_collection_thumbnail_get_game_thumbnail (self, _tmp12_);
					game_thumbnail = _tmp13_;
					_tmp14_ = event_box;
					_tmp15_ = gtk_bin_get_child (_tmp14_);
					_tmp16_ = _g_object_ref0 (_tmp15_);
					current_thumbnail = _tmp16_;
					_tmp17_ = current_thumbnail;
					if (_tmp17_ != NULL) {
						GtkBin* _tmp18_;
						GtkWidget* _tmp19_;
						_tmp18_ = event_box;
						_tmp19_ = current_thumbnail;
						gtk_container_remove ((GtkContainer*) _tmp18_, _tmp19_);
					}
					_tmp20_ = event_box;
					_tmp21_ = game_thumbnail;
					gtk_container_add ((GtkContainer*) _tmp20_, (GtkWidget*) _tmp21_);
					_tmp22_ = pos;
					pos = _tmp22_ + 1;
					_g_object_unref0 (current_thumbnail);
					_g_object_unref0 (game_thumbnail);
					_g_object_unref0 (game);
					_g_object_unref0 (event_box);
					continue;
				}
				if (((guint) pos) < max_subcovers) {
					GtkWidget* game_thumbnail = NULL;
					GtkBin* _tmp23_;
					GtkWidget* _tmp24_;
					GtkWidget* _tmp25_;
					GtkWidget* _tmp26_;
					gint _tmp29_;
					_tmp23_ = event_box;
					_tmp24_ = gtk_bin_get_child (_tmp23_);
					_tmp25_ = _g_object_ref0 (_tmp24_);
					game_thumbnail = _tmp25_;
					_tmp26_ = game_thumbnail;
					if (_tmp26_ != NULL) {
						GtkBin* _tmp27_;
						GtkWidget* _tmp28_;
						_tmp27_ = event_box;
						_tmp28_ = game_thumbnail;
						gtk_container_remove ((GtkContainer*) _tmp27_, _tmp28_);
					}
					_tmp29_ = pos;
					pos = _tmp29_ + 1;
					_g_object_unref0 (game_thumbnail);
				}
				_g_object_unref0 (event_box);
			}
		}
	}
	_g_object_unref0 (game_model);
	(children == NULL) ? NULL : (children = (g_list_free (children), NULL));
}

static Block25Data*
block25_data_ref (Block25Data* _data25_)
{
	g_atomic_int_inc (&_data25_->_ref_count_);
	return _data25_;
}

static void
block25_data_unref (void * _userdata_)
{
	Block25Data* _data25_;
	_data25_ = (Block25Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data25_->_ref_count_)) {
		GamesCollectionThumbnail* self;
		self = _data25_->self;
		_g_object_unref0 (_data25_->game_thumbnail);
		_g_object_unref0 (self);
		g_slice_free (Block25Data, _data25_);
	}
}

static void
__lambda23_ (Block25Data* _data25_,
             GamesGame* new_game)
{
	GamesCollectionThumbnail* self;
	self = _data25_->self;
	g_return_if_fail (new_game != NULL);
	games_game_thumbnail_set_game (_data25_->game_thumbnail, new_game);
}

static void
___lambda23__games_game_replaced (GamesGame* _sender,
                                  GamesGame* new_game,
                                  gpointer self)
{
	__lambda23_ (self, new_game);
}

static GamesGameThumbnail*
games_collection_thumbnail_get_game_thumbnail (GamesCollectionThumbnail* self,
                                               GamesGame* game)
{
	Block25Data* _data25_;
	GamesGameThumbnail* _tmp0_;
	GamesGameThumbnail* _tmp1_;
	GamesGameThumbnail* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (game != NULL, NULL);
	_data25_ = g_slice_new0 (Block25Data);
	_data25_->_ref_count_ = 1;
	_data25_->self = g_object_ref (self);
	_tmp0_ = games_game_thumbnail_new ();
	g_object_ref_sink (_tmp0_);
	_data25_->game_thumbnail = _tmp0_;
	games_game_thumbnail_set_game (_data25_->game_thumbnail, game);
	g_signal_connect_data (game, "replaced", (GCallback) ___lambda23__games_game_replaced, block25_data_ref (_data25_), (GClosureNotify) block25_data_unref, 0);
	gtk_widget_set_visible ((GtkWidget*) _data25_->game_thumbnail, TRUE);
	_tmp1_ = _g_object_ref0 (_data25_->game_thumbnail);
	result = _tmp1_;
	block25_data_unref (_data25_);
	_data25_ = NULL;
	return result;
}

GamesCollectionThumbnail*
games_collection_thumbnail_construct (GType object_type)
{
	GamesCollectionThumbnail * self = NULL;
	self = (GamesCollectionThumbnail*) g_object_new (object_type, NULL);
	return self;
}

GamesCollectionThumbnail*
games_collection_thumbnail_new (void)
{
	return games_collection_thumbnail_construct (GAMES_TYPE_COLLECTION_THUMBNAIL);
}

GamesCollection*
games_collection_thumbnail_get_collection (GamesCollectionThumbnail* self)
{
	GamesCollection* result;
	GamesCollection* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_collection;
	result = _tmp0_;
	return result;
}

static void
_games_collection_thumbnail_on_games_changed_games_collection_games_changed (GamesCollection* _sender,
                                                                             gpointer self)
{
	games_collection_thumbnail_on_games_changed ((GamesCollectionThumbnail*) self);
}

void
games_collection_thumbnail_set_collection (GamesCollectionThumbnail* self,
                                           GamesCollection* value)
{
	GamesCollection* _tmp2_;
	GamesCollection* _tmp3_;
	GamesCollection* _tmp4_;
	GamesCollection* _tmp7_;
	GamesCollection* _tmp8_;
	gulong _tmp9_;
	g_return_if_fail (self != NULL);
	if (self->priv->games_changed_id > ((gulong) 0)) {
		GamesCollection* _tmp0_;
		GamesCollection* _tmp1_;
		_tmp0_ = games_collection_thumbnail_get_collection (self);
		_tmp1_ = _tmp0_;
		g_signal_handler_disconnect ((GObject*) _tmp1_, self->priv->games_changed_id);
	}
	_tmp2_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_collection);
	self->priv->_collection = _tmp2_;
	_tmp3_ = games_collection_thumbnail_get_collection (self);
	_tmp4_ = _tmp3_;
	if (games_collection_get_collection_type (_tmp4_) == GAMES_COLLECTION_TYPE_PLACEHOLDER) {
		GtkStack* _tmp5_;
		GtkImage* _tmp6_;
		_tmp5_ = self->priv->thumbnail_stack;
		_tmp6_ = self->priv->new_collection_image;
		gtk_stack_set_visible_child (_tmp5_, (GtkWidget*) _tmp6_);
		return;
	}
	_tmp7_ = games_collection_thumbnail_get_collection (self);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_signal_connect_object (_tmp8_, "games-changed", (GCallback) _games_collection_thumbnail_on_games_changed_games_collection_games_changed, self, 0);
	self->priv->games_changed_id = _tmp9_;
	games_collection_thumbnail_on_games_changed (self);
	g_object_notify_by_pspec ((GObject *) self, games_collection_thumbnail_properties[GAMES_COLLECTION_THUMBNAIL_COLLECTION_PROPERTY]);
}

static void
games_collection_thumbnail_class_init (GamesCollectionThumbnailClass * klass,
                                       gpointer klass_data)
{
	games_collection_thumbnail_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GamesCollectionThumbnail_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_games_collection_thumbnail_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_games_collection_thumbnail_set_property;
	G_OBJECT_CLASS (klass)->finalize = games_collection_thumbnail_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_COLLECTION_THUMBNAIL_COLLECTION_PROPERTY, games_collection_thumbnail_properties[GAMES_COLLECTION_THUMBNAIL_COLLECTION_PROPERTY] = g_param_spec_object ("collection", "collection", "collection", GAMES_TYPE_COLLECTION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Games/ui/collection-thumbnail.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "thumbnail_stack", FALSE, GamesCollectionThumbnail_private_offset + G_STRUCT_OFFSET (GamesCollectionThumbnailPrivate, thumbnail_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "grid", FALSE, GamesCollectionThumbnail_private_offset + G_STRUCT_OFFSET (GamesCollectionThumbnailPrivate, grid));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "new_collection_image", FALSE, GamesCollectionThumbnail_private_offset + G_STRUCT_OFFSET (GamesCollectionThumbnailPrivate, new_collection_image));
}

static void
games_collection_thumbnail_instance_init (GamesCollectionThumbnail * self,
                                          gpointer klass)
{
	self->priv = games_collection_thumbnail_get_instance_private (self);
	self->priv->games_changed_id = (gulong) 0;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
games_collection_thumbnail_finalize (GObject * obj)
{
	GamesCollectionThumbnail * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_COLLECTION_THUMBNAIL, GamesCollectionThumbnail);
	_g_object_unref0 (self->priv->_collection);
	G_OBJECT_CLASS (games_collection_thumbnail_parent_class)->finalize (obj);
}

static GType
games_collection_thumbnail_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GamesCollectionThumbnailClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_collection_thumbnail_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesCollectionThumbnail), 0, (GInstanceInitFunc) games_collection_thumbnail_instance_init, NULL };
	GType games_collection_thumbnail_type_id;
	games_collection_thumbnail_type_id = g_type_register_static (gtk_bin_get_type (), "GamesCollectionThumbnail", &g_define_type_info, 0);
	GamesCollectionThumbnail_private_offset = g_type_add_instance_private (games_collection_thumbnail_type_id, sizeof (GamesCollectionThumbnailPrivate));
	return games_collection_thumbnail_type_id;
}

GType
games_collection_thumbnail_get_type (void)
{
	static volatile gsize games_collection_thumbnail_type_id__once = 0;
	if (g_once_init_enter (&games_collection_thumbnail_type_id__once)) {
		GType games_collection_thumbnail_type_id;
		games_collection_thumbnail_type_id = games_collection_thumbnail_get_type_once ();
		g_once_init_leave (&games_collection_thumbnail_type_id__once, games_collection_thumbnail_type_id);
	}
	return games_collection_thumbnail_type_id__once;
}

static void
_vala_games_collection_thumbnail_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	GamesCollectionThumbnail * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_COLLECTION_THUMBNAIL, GamesCollectionThumbnail);
	switch (property_id) {
		case GAMES_COLLECTION_THUMBNAIL_COLLECTION_PROPERTY:
		g_value_set_object (value, games_collection_thumbnail_get_collection (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_games_collection_thumbnail_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec)
{
	GamesCollectionThumbnail * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_COLLECTION_THUMBNAIL, GamesCollectionThumbnail);
	switch (property_id) {
		case GAMES_COLLECTION_THUMBNAIL_COLLECTION_PROPERTY:
		games_collection_thumbnail_set_collection (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

