/* media-info.c generated by valac 0.36.6.6-c7bee, the Vala compiler
 * generated from media-info.vala, do not modify */

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

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>


#define GAMES_TYPE_MEDIA_INFO (games_media_info_get_type ())
#define GAMES_MEDIA_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_MEDIA_INFO, GamesMediaInfo))
#define GAMES_MEDIA_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_MEDIA_INFO, GamesMediaInfoClass))
#define GAMES_IS_MEDIA_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_MEDIA_INFO))
#define GAMES_IS_MEDIA_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_MEDIA_INFO))
#define GAMES_MEDIA_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_MEDIA_INFO, GamesMediaInfoClass))

typedef struct _GamesMediaInfo GamesMediaInfo;
typedef struct _GamesMediaInfoClass GamesMediaInfoClass;
typedef struct _GamesMediaInfoPrivate GamesMediaInfoPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _GamesMediaInfo {
	GObject parent_instance;
	GamesMediaInfoPrivate * priv;
};

struct _GamesMediaInfoClass {
	GObjectClass parent_class;
};

struct _GamesMediaInfoPrivate {
	gchar* _platform;
	gchar* _game_id;
	gchar* _media_id;
	guint _media_index;
};


static gpointer games_media_info_parent_class = NULL;

GType games_media_info_get_type (void) G_GNUC_CONST;
#define GAMES_MEDIA_INFO_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GAMES_TYPE_MEDIA_INFO, GamesMediaInfoPrivate))
enum  {
	GAMES_MEDIA_INFO_0_PROPERTY,
	GAMES_MEDIA_INFO_PLATFORM_PROPERTY,
	GAMES_MEDIA_INFO_GAME_ID_PROPERTY,
	GAMES_MEDIA_INFO_MEDIA_ID_PROPERTY,
	GAMES_MEDIA_INFO_MEDIA_INDEX_PROPERTY
};
GamesMediaInfo* games_media_info_new (const gchar* platform, const gchar* game_id, const gchar* media_id, guint media_index);
GamesMediaInfo* games_media_info_construct (GType object_type, const gchar* platform, const gchar* game_id, const gchar* media_id, guint media_index);
static void games_media_info_set_platform (GamesMediaInfo* self, const gchar* value);
static void games_media_info_set_game_id (GamesMediaInfo* self, const gchar* value);
static void games_media_info_set_media_id (GamesMediaInfo* self, const gchar* value);
static void games_media_info_set_media_index (GamesMediaInfo* self, guint value);
const gchar* games_media_info_get_platform (GamesMediaInfo* self);
const gchar* games_media_info_get_game_id (GamesMediaInfo* self);
const gchar* games_media_info_get_media_id (GamesMediaInfo* self);
guint games_media_info_get_media_index (GamesMediaInfo* self);
static void games_media_info_finalize (GObject * obj);
static void _vala_games_media_info_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_games_media_info_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


GamesMediaInfo* games_media_info_construct (GType object_type, const gchar* platform, const gchar* game_id, const gchar* media_id, guint media_index) {
	GamesMediaInfo * self = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	guint _tmp3_;
	g_return_val_if_fail (platform != NULL, NULL);
	g_return_val_if_fail (game_id != NULL, NULL);
	self = (GamesMediaInfo*) g_object_new (object_type, NULL);
	_tmp0_ = platform;
	games_media_info_set_platform (self, _tmp0_);
	_tmp1_ = game_id;
	games_media_info_set_game_id (self, _tmp1_);
	_tmp2_ = media_id;
	games_media_info_set_media_id (self, _tmp2_);
	_tmp3_ = media_index;
	games_media_info_set_media_index (self, _tmp3_);
	return self;
}


GamesMediaInfo* games_media_info_new (const gchar* platform, const gchar* game_id, const gchar* media_id, guint media_index) {
	return games_media_info_construct (GAMES_TYPE_MEDIA_INFO, platform, game_id, media_id, media_index);
}


const gchar* games_media_info_get_platform (GamesMediaInfo* self) {
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_platform;
	result = _tmp0_;
	return result;
}


static void games_media_info_set_platform (GamesMediaInfo* self, const gchar* value) {
	g_return_if_fail (self != NULL);
	if (g_strcmp0 (value, games_media_info_get_platform (self)) != 0) {
		const gchar* _tmp0_;
		gchar* _tmp1_;
		_tmp0_ = value;
		_tmp1_ = g_strdup (_tmp0_);
		_g_free0 (self->priv->_platform);
		self->priv->_platform = _tmp1_;
		g_object_notify ((GObject *) self, "platform");
	}
}


const gchar* games_media_info_get_game_id (GamesMediaInfo* self) {
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_game_id;
	result = _tmp0_;
	return result;
}


static void games_media_info_set_game_id (GamesMediaInfo* self, const gchar* value) {
	g_return_if_fail (self != NULL);
	if (g_strcmp0 (value, games_media_info_get_game_id (self)) != 0) {
		const gchar* _tmp0_;
		gchar* _tmp1_;
		_tmp0_ = value;
		_tmp1_ = g_strdup (_tmp0_);
		_g_free0 (self->priv->_game_id);
		self->priv->_game_id = _tmp1_;
		g_object_notify ((GObject *) self, "game-id");
	}
}


const gchar* games_media_info_get_media_id (GamesMediaInfo* self) {
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_media_id;
	result = _tmp0_;
	return result;
}


static void games_media_info_set_media_id (GamesMediaInfo* self, const gchar* value) {
	g_return_if_fail (self != NULL);
	if (g_strcmp0 (value, games_media_info_get_media_id (self)) != 0) {
		const gchar* _tmp0_;
		gchar* _tmp1_;
		_tmp0_ = value;
		_tmp1_ = g_strdup (_tmp0_);
		_g_free0 (self->priv->_media_id);
		self->priv->_media_id = _tmp1_;
		g_object_notify ((GObject *) self, "media-id");
	}
}


guint games_media_info_get_media_index (GamesMediaInfo* self) {
	guint result;
	guint _tmp0_;
	g_return_val_if_fail (self != NULL, 0U);
	_tmp0_ = self->priv->_media_index;
	result = _tmp0_;
	return result;
}


static void games_media_info_set_media_index (GamesMediaInfo* self, guint value) {
	g_return_if_fail (self != NULL);
	if (games_media_info_get_media_index (self) != value) {
		guint _tmp0_;
		_tmp0_ = value;
		self->priv->_media_index = _tmp0_;
		g_object_notify ((GObject *) self, "media-index");
	}
}


static void games_media_info_class_init (GamesMediaInfoClass * klass) {
	games_media_info_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GamesMediaInfoPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_games_media_info_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_games_media_info_set_property;
	G_OBJECT_CLASS (klass)->finalize = games_media_info_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_MEDIA_INFO_PLATFORM_PROPERTY, g_param_spec_string ("platform", "platform", "platform", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_MEDIA_INFO_GAME_ID_PROPERTY, g_param_spec_string ("game-id", "game-id", "game-id", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_MEDIA_INFO_MEDIA_ID_PROPERTY, g_param_spec_string ("media-id", "media-id", "media-id", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_MEDIA_INFO_MEDIA_INDEX_PROPERTY, g_param_spec_uint ("media-index", "media-index", "media-index", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void games_media_info_instance_init (GamesMediaInfo * self) {
	self->priv = GAMES_MEDIA_INFO_GET_PRIVATE (self);
}


static void games_media_info_finalize (GObject * obj) {
	GamesMediaInfo * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_MEDIA_INFO, GamesMediaInfo);
	_g_free0 (self->priv->_platform);
	_g_free0 (self->priv->_game_id);
	_g_free0 (self->priv->_media_id);
	G_OBJECT_CLASS (games_media_info_parent_class)->finalize (obj);
}


GType games_media_info_get_type (void) {
	static volatile gsize games_media_info_type_id__volatile = 0;
	if (g_once_init_enter (&games_media_info_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GamesMediaInfoClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_media_info_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesMediaInfo), 0, (GInstanceInitFunc) games_media_info_instance_init, NULL };
		GType games_media_info_type_id;
		games_media_info_type_id = g_type_register_static (G_TYPE_OBJECT, "GamesMediaInfo", &g_define_type_info, 0);
		g_once_init_leave (&games_media_info_type_id__volatile, games_media_info_type_id);
	}
	return games_media_info_type_id__volatile;
}


static void _vala_games_media_info_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GamesMediaInfo * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_MEDIA_INFO, GamesMediaInfo);
	switch (property_id) {
		case GAMES_MEDIA_INFO_PLATFORM_PROPERTY:
		g_value_set_string (value, games_media_info_get_platform (self));
		break;
		case GAMES_MEDIA_INFO_GAME_ID_PROPERTY:
		g_value_set_string (value, games_media_info_get_game_id (self));
		break;
		case GAMES_MEDIA_INFO_MEDIA_ID_PROPERTY:
		g_value_set_string (value, games_media_info_get_media_id (self));
		break;
		case GAMES_MEDIA_INFO_MEDIA_INDEX_PROPERTY:
		g_value_set_uint (value, games_media_info_get_media_index (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_games_media_info_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GamesMediaInfo * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_MEDIA_INFO, GamesMediaInfo);
	switch (property_id) {
		case GAMES_MEDIA_INFO_PLATFORM_PROPERTY:
		games_media_info_set_platform (self, g_value_get_string (value));
		break;
		case GAMES_MEDIA_INFO_GAME_ID_PROPERTY:
		games_media_info_set_game_id (self, g_value_get_string (value));
		break;
		case GAMES_MEDIA_INFO_MEDIA_ID_PROPERTY:
		games_media_info_set_media_id (self, g_value_get_string (value));
		break;
		case GAMES_MEDIA_INFO_MEDIA_INDEX_PROPERTY:
		games_media_info_set_media_index (self, g_value_get_uint (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



