/* selection-action-bar.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from selection-action-bar.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 <glib/gi18n-lib.h>
#include "gnome-games.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_SELECTION_ACTION_BAR (games_selection_action_bar_get_type ())
#define GAMES_SELECTION_ACTION_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_SELECTION_ACTION_BAR, GamesSelectionActionBar))
#define GAMES_SELECTION_ACTION_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_SELECTION_ACTION_BAR, GamesSelectionActionBarClass))
#define GAMES_IS_SELECTION_ACTION_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_SELECTION_ACTION_BAR))
#define GAMES_IS_SELECTION_ACTION_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_SELECTION_ACTION_BAR))
#define GAMES_SELECTION_ACTION_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_SELECTION_ACTION_BAR, GamesSelectionActionBarClass))

typedef struct _GamesSelectionActionBar GamesSelectionActionBar;
typedef struct _GamesSelectionActionBarClass GamesSelectionActionBarClass;
typedef struct _GamesSelectionActionBarPrivate GamesSelectionActionBarPrivate;
typedef enum  {
	GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_NONE_FAVORITE,
	GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_ALL_FAVORITE,
	GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_SEMI_FAVORITE
} GamesSelectionActionBarFavoriteState;

#define GAMES_SELECTION_ACTION_BAR_TYPE_FAVORITE_STATE (games_selection_action_bar_favorite_state_get_type ())
enum  {
	GAMES_SELECTION_ACTION_BAR_0_PROPERTY,
	GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_PROPERTY,
	GAMES_SELECTION_ACTION_BAR_SHOW_REMOVE_BUTTON_PROPERTY,
	GAMES_SELECTION_ACTION_BAR_SHOW_GAME_ACTIONS_PROPERTY,
	GAMES_SELECTION_ACTION_BAR_SHOW_REMOVE_COLLECTION_BUTTON_PROPERTY,
	GAMES_SELECTION_ACTION_BAR_NUM_PROPERTIES
};
static GParamSpec* games_selection_action_bar_properties[GAMES_SELECTION_ACTION_BAR_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))

struct _GamesSelectionActionBar {
	GtkActionBar parent_instance;
	GamesSelectionActionBarPrivate * priv;
};

struct _GamesSelectionActionBarClass {
	GtkActionBarClass parent_class;
};

struct _GamesSelectionActionBarPrivate {
	GtkStack* icon_stack;
	GtkButton* favorite_button;
	GamesSelectionActionBarFavoriteState _favorite_state;
	gboolean _show_remove_button;
	gboolean _show_game_actions;
	gboolean _show_remove_collection_button;
};

static gint GamesSelectionActionBar_private_offset;
static gpointer games_selection_action_bar_parent_class = NULL;

VALA_EXTERN GType games_selection_action_bar_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType games_selection_action_bar_favorite_state_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gchar* games_selection_action_bar_favorite_state_get_child_name (GamesSelectionActionBarFavoriteState self);
VALA_EXTERN gchar* games_selection_action_bar_favorite_state_get_tooltip_text (GamesSelectionActionBarFavoriteState self);
VALA_EXTERN void games_selection_action_bar_update (GamesSelectionActionBar* self,
                                        GamesGame** games,
                                        gint games_length1);
static gboolean games_selection_action_bar_is_all_favorite (GamesSelectionActionBar* self,
                                                     GamesGame** games,
                                                     gint games_length1);
VALA_EXTERN void games_selection_action_bar_set_favorite_state (GamesSelectionActionBar* self,
                                                    GamesSelectionActionBarFavoriteState value);
static gboolean games_selection_action_bar_is_none_favorite (GamesSelectionActionBar* self,
                                                      GamesGame** games,
                                                      gint games_length1);
VALA_EXTERN GamesSelectionActionBar* games_selection_action_bar_new (void);
VALA_EXTERN GamesSelectionActionBar* games_selection_action_bar_construct (GType object_type);
VALA_EXTERN GamesSelectionActionBarFavoriteState games_selection_action_bar_get_favorite_state (GamesSelectionActionBar* self);
VALA_EXTERN gboolean games_selection_action_bar_get_show_remove_button (GamesSelectionActionBar* self);
VALA_EXTERN void games_selection_action_bar_set_show_remove_button (GamesSelectionActionBar* self,
                                                        gboolean value);
VALA_EXTERN gboolean games_selection_action_bar_get_show_game_actions (GamesSelectionActionBar* self);
VALA_EXTERN void games_selection_action_bar_set_show_game_actions (GamesSelectionActionBar* self,
                                                       gboolean value);
VALA_EXTERN gboolean games_selection_action_bar_get_show_remove_collection_button (GamesSelectionActionBar* self);
VALA_EXTERN void games_selection_action_bar_set_show_remove_collection_button (GamesSelectionActionBar* self,
                                                                   gboolean value);
static void games_selection_action_bar_finalize (GObject * obj);
static GType games_selection_action_bar_get_type_once (void);
static void _vala_games_selection_action_bar_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
static void _vala_games_selection_action_bar_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_selection_action_bar_get_instance_private (GamesSelectionActionBar* self)
{
	return G_STRUCT_MEMBER_P (self, GamesSelectionActionBar_private_offset);
}

gchar*
games_selection_action_bar_favorite_state_get_child_name (GamesSelectionActionBarFavoriteState self)
{
	gchar* result;
	switch (self) {
		case GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_NONE_FAVORITE:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup ("starred-icon");
			result = _tmp0_;
			return result;
		}
		case GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_ALL_FAVORITE:
		{
			gchar* _tmp1_;
			_tmp1_ = g_strdup ("non-starred-icon");
			result = _tmp1_;
			return result;
		}
		case GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_SEMI_FAVORITE:
		{
			gchar* _tmp2_;
			_tmp2_ = g_strdup ("semi-starred-icon");
			result = _tmp2_;
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}

gchar*
games_selection_action_bar_favorite_state_get_tooltip_text (GamesSelectionActionBarFavoriteState self)
{
	gchar* result;
	switch (self) {
		case GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_ALL_FAVORITE:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup (_ ("Remove selected games from favorites"));
			result = _tmp0_;
			return result;
		}
		case GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_NONE_FAVORITE:
		case GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_SEMI_FAVORITE:
		{
			gchar* _tmp1_;
			_tmp1_ = g_strdup (_ ("Add selected games to favorites"));
			result = _tmp1_;
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}

static GType
games_selection_action_bar_favorite_state_get_type_once (void)
{
	static const GEnumValue values[] = {{GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_NONE_FAVORITE, "GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_NONE_FAVORITE", "none-favorite"}, {GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_ALL_FAVORITE, "GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_ALL_FAVORITE", "all-favorite"}, {GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_SEMI_FAVORITE, "GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_SEMI_FAVORITE", "semi-favorite"}, {0, NULL, NULL}};
	GType games_selection_action_bar_favorite_state_type_id;
	games_selection_action_bar_favorite_state_type_id = g_enum_register_static ("GamesSelectionActionBarFavoriteState", values);
	return games_selection_action_bar_favorite_state_type_id;
}

GType
games_selection_action_bar_favorite_state_get_type (void)
{
	static volatile gsize games_selection_action_bar_favorite_state_type_id__once = 0;
	if (g_once_init_enter (&games_selection_action_bar_favorite_state_type_id__once)) {
		GType games_selection_action_bar_favorite_state_type_id;
		games_selection_action_bar_favorite_state_type_id = games_selection_action_bar_favorite_state_get_type_once ();
		g_once_init_leave (&games_selection_action_bar_favorite_state_type_id__once, games_selection_action_bar_favorite_state_type_id);
	}
	return games_selection_action_bar_favorite_state_type_id__once;
}

void
games_selection_action_bar_update (GamesSelectionActionBar* self,
                                   GamesGame** games,
                                   gint games_length1)
{
	g_return_if_fail (self != NULL);
	gtk_widget_set_sensitive ((GtkWidget*) self, games_length1 != 0);
	if (games_selection_action_bar_is_all_favorite (self, games, (gint) games_length1)) {
		games_selection_action_bar_set_favorite_state (self, GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_ALL_FAVORITE);
		return;
	}
	if (games_selection_action_bar_is_none_favorite (self, games, (gint) games_length1)) {
		games_selection_action_bar_set_favorite_state (self, GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_NONE_FAVORITE);
		return;
	}
	games_selection_action_bar_set_favorite_state (self, GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_SEMI_FAVORITE);
}

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

static gboolean
games_selection_action_bar_is_all_favorite (GamesSelectionActionBar* self,
                                            GamesGame** games,
                                            gint games_length1)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	{
		GamesGame** game_collection = NULL;
		gint game_collection_length1 = 0;
		gint _game_collection_size_ = 0;
		gint game_it = 0;
		game_collection = games;
		game_collection_length1 = games_length1;
		for (game_it = 0; game_it < game_collection_length1; game_it = game_it + 1) {
			GamesGame* _tmp0_;
			GamesGame* game = NULL;
			_tmp0_ = _g_object_ref0 (game_collection[game_it]);
			game = _tmp0_;
			{
				GamesGame* _tmp1_;
				gboolean _tmp2_;
				gboolean _tmp3_;
				_tmp1_ = game;
				_tmp2_ = games_game_get_is_favorite (_tmp1_);
				_tmp3_ = _tmp2_;
				if (!_tmp3_) {
					result = FALSE;
					_g_object_unref0 (game);
					return result;
				}
				_g_object_unref0 (game);
			}
		}
	}
	result = TRUE;
	return result;
}

static gboolean
games_selection_action_bar_is_none_favorite (GamesSelectionActionBar* self,
                                             GamesGame** games,
                                             gint games_length1)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	{
		GamesGame** game_collection = NULL;
		gint game_collection_length1 = 0;
		gint _game_collection_size_ = 0;
		gint game_it = 0;
		game_collection = games;
		game_collection_length1 = games_length1;
		for (game_it = 0; game_it < game_collection_length1; game_it = game_it + 1) {
			GamesGame* _tmp0_;
			GamesGame* game = NULL;
			_tmp0_ = _g_object_ref0 (game_collection[game_it]);
			game = _tmp0_;
			{
				GamesGame* _tmp1_;
				gboolean _tmp2_;
				gboolean _tmp3_;
				_tmp1_ = game;
				_tmp2_ = games_game_get_is_favorite (_tmp1_);
				_tmp3_ = _tmp2_;
				if (_tmp3_) {
					result = FALSE;
					_g_object_unref0 (game);
					return result;
				}
				_g_object_unref0 (game);
			}
		}
	}
	result = TRUE;
	return result;
}

GamesSelectionActionBar*
games_selection_action_bar_construct (GType object_type)
{
	GamesSelectionActionBar * self = NULL;
	self = (GamesSelectionActionBar*) g_object_new (object_type, NULL);
	return self;
}

GamesSelectionActionBar*
games_selection_action_bar_new (void)
{
	return games_selection_action_bar_construct (GAMES_TYPE_SELECTION_ACTION_BAR);
}

GamesSelectionActionBarFavoriteState
games_selection_action_bar_get_favorite_state (GamesSelectionActionBar* self)
{
	GamesSelectionActionBarFavoriteState result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_favorite_state;
	return result;
}

void
games_selection_action_bar_set_favorite_state (GamesSelectionActionBar* self,
                                               GamesSelectionActionBarFavoriteState value)
{
	GtkStack* _tmp0_;
	GamesSelectionActionBarFavoriteState _tmp1_;
	GamesSelectionActionBarFavoriteState _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	GtkButton* _tmp5_;
	GamesSelectionActionBarFavoriteState _tmp6_;
	GamesSelectionActionBarFavoriteState _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	g_return_if_fail (self != NULL);
	self->priv->_favorite_state = value;
	_tmp0_ = self->priv->icon_stack;
	_tmp1_ = games_selection_action_bar_get_favorite_state (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = games_selection_action_bar_favorite_state_get_child_name (_tmp2_);
	_tmp4_ = _tmp3_;
	gtk_stack_set_visible_child_name (_tmp0_, _tmp4_);
	_g_free0 (_tmp4_);
	_tmp5_ = self->priv->favorite_button;
	_tmp6_ = games_selection_action_bar_get_favorite_state (self);
	_tmp7_ = _tmp6_;
	_tmp8_ = games_selection_action_bar_favorite_state_get_tooltip_text (_tmp7_);
	_tmp9_ = _tmp8_;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp5_, _tmp9_);
	_g_free0 (_tmp9_);
	g_object_notify_by_pspec ((GObject *) self, games_selection_action_bar_properties[GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_PROPERTY]);
}

gboolean
games_selection_action_bar_get_show_remove_button (GamesSelectionActionBar* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_show_remove_button;
	return result;
}

void
games_selection_action_bar_set_show_remove_button (GamesSelectionActionBar* self,
                                                   gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_selection_action_bar_get_show_remove_button (self);
	if (old_value != value) {
		self->priv->_show_remove_button = value;
		g_object_notify_by_pspec ((GObject *) self, games_selection_action_bar_properties[GAMES_SELECTION_ACTION_BAR_SHOW_REMOVE_BUTTON_PROPERTY]);
	}
}

gboolean
games_selection_action_bar_get_show_game_actions (GamesSelectionActionBar* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_show_game_actions;
	return result;
}

void
games_selection_action_bar_set_show_game_actions (GamesSelectionActionBar* self,
                                                  gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_selection_action_bar_get_show_game_actions (self);
	if (old_value != value) {
		self->priv->_show_game_actions = value;
		g_object_notify_by_pspec ((GObject *) self, games_selection_action_bar_properties[GAMES_SELECTION_ACTION_BAR_SHOW_GAME_ACTIONS_PROPERTY]);
	}
}

gboolean
games_selection_action_bar_get_show_remove_collection_button (GamesSelectionActionBar* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_show_remove_collection_button;
	return result;
}

void
games_selection_action_bar_set_show_remove_collection_button (GamesSelectionActionBar* self,
                                                              gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = games_selection_action_bar_get_show_remove_collection_button (self);
	if (old_value != value) {
		self->priv->_show_remove_collection_button = value;
		g_object_notify_by_pspec ((GObject *) self, games_selection_action_bar_properties[GAMES_SELECTION_ACTION_BAR_SHOW_REMOVE_COLLECTION_BUTTON_PROPERTY]);
	}
}

static void
games_selection_action_bar_class_init (GamesSelectionActionBarClass * klass,
                                       gpointer klass_data)
{
	games_selection_action_bar_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GamesSelectionActionBar_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_games_selection_action_bar_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_games_selection_action_bar_set_property;
	G_OBJECT_CLASS (klass)->finalize = games_selection_action_bar_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_PROPERTY, games_selection_action_bar_properties[GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_PROPERTY] = g_param_spec_enum ("favorite-state", "favorite-state", "favorite-state", GAMES_SELECTION_ACTION_BAR_TYPE_FAVORITE_STATE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_SELECTION_ACTION_BAR_SHOW_REMOVE_BUTTON_PROPERTY, games_selection_action_bar_properties[GAMES_SELECTION_ACTION_BAR_SHOW_REMOVE_BUTTON_PROPERTY] = g_param_spec_boolean ("show-remove-button", "show-remove-button", "show-remove-button", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_SELECTION_ACTION_BAR_SHOW_GAME_ACTIONS_PROPERTY, games_selection_action_bar_properties[GAMES_SELECTION_ACTION_BAR_SHOW_GAME_ACTIONS_PROPERTY] = g_param_spec_boolean ("show-game-actions", "show-game-actions", "show-game-actions", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_SELECTION_ACTION_BAR_SHOW_REMOVE_COLLECTION_BUTTON_PROPERTY, games_selection_action_bar_properties[GAMES_SELECTION_ACTION_BAR_SHOW_REMOVE_COLLECTION_BUTTON_PROPERTY] = g_param_spec_boolean ("show-remove-collection-button", "show-remove-collection-button", "show-remove-collection-button", 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/selection-action-bar.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "icon_stack", FALSE, GamesSelectionActionBar_private_offset + G_STRUCT_OFFSET (GamesSelectionActionBarPrivate, icon_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "favorite_button", FALSE, GamesSelectionActionBar_private_offset + G_STRUCT_OFFSET (GamesSelectionActionBarPrivate, favorite_button));
}

static void
games_selection_action_bar_instance_init (GamesSelectionActionBar * self,
                                          gpointer klass)
{
	self->priv = games_selection_action_bar_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
games_selection_action_bar_finalize (GObject * obj)
{
	GamesSelectionActionBar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_SELECTION_ACTION_BAR, GamesSelectionActionBar);
	G_OBJECT_CLASS (games_selection_action_bar_parent_class)->finalize (obj);
}

static GType
games_selection_action_bar_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GamesSelectionActionBarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_selection_action_bar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesSelectionActionBar), 0, (GInstanceInitFunc) games_selection_action_bar_instance_init, NULL };
	GType games_selection_action_bar_type_id;
	games_selection_action_bar_type_id = g_type_register_static (gtk_action_bar_get_type (), "GamesSelectionActionBar", &g_define_type_info, 0);
	GamesSelectionActionBar_private_offset = g_type_add_instance_private (games_selection_action_bar_type_id, sizeof (GamesSelectionActionBarPrivate));
	return games_selection_action_bar_type_id;
}

GType
games_selection_action_bar_get_type (void)
{
	static volatile gsize games_selection_action_bar_type_id__once = 0;
	if (g_once_init_enter (&games_selection_action_bar_type_id__once)) {
		GType games_selection_action_bar_type_id;
		games_selection_action_bar_type_id = games_selection_action_bar_get_type_once ();
		g_once_init_leave (&games_selection_action_bar_type_id__once, games_selection_action_bar_type_id);
	}
	return games_selection_action_bar_type_id__once;
}

static void
_vala_games_selection_action_bar_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	GamesSelectionActionBar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_SELECTION_ACTION_BAR, GamesSelectionActionBar);
	switch (property_id) {
		case GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_PROPERTY:
		g_value_set_enum (value, games_selection_action_bar_get_favorite_state (self));
		break;
		case GAMES_SELECTION_ACTION_BAR_SHOW_REMOVE_BUTTON_PROPERTY:
		g_value_set_boolean (value, games_selection_action_bar_get_show_remove_button (self));
		break;
		case GAMES_SELECTION_ACTION_BAR_SHOW_GAME_ACTIONS_PROPERTY:
		g_value_set_boolean (value, games_selection_action_bar_get_show_game_actions (self));
		break;
		case GAMES_SELECTION_ACTION_BAR_SHOW_REMOVE_COLLECTION_BUTTON_PROPERTY:
		g_value_set_boolean (value, games_selection_action_bar_get_show_remove_collection_button (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_games_selection_action_bar_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec)
{
	GamesSelectionActionBar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_SELECTION_ACTION_BAR, GamesSelectionActionBar);
	switch (property_id) {
		case GAMES_SELECTION_ACTION_BAR_FAVORITE_STATE_PROPERTY:
		games_selection_action_bar_set_favorite_state (self, g_value_get_enum (value));
		break;
		case GAMES_SELECTION_ACTION_BAR_SHOW_REMOVE_BUTTON_PROPERTY:
		games_selection_action_bar_set_show_remove_button (self, g_value_get_boolean (value));
		break;
		case GAMES_SELECTION_ACTION_BAR_SHOW_GAME_ACTIONS_PROPERTY:
		games_selection_action_bar_set_show_game_actions (self, g_value_get_boolean (value));
		break;
		case GAMES_SELECTION_ACTION_BAR_SHOW_REMOVE_COLLECTION_BUTTON_PROPERTY:
		games_selection_action_bar_set_show_remove_collection_button (self, g_value_get_boolean (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;
}

