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

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

#include "gnome-games.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.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

enum  {
	GAMES_GENERIC_TITLE_0_PROPERTY,
	GAMES_GENERIC_TITLE_NUM_PROPERTIES
};
static GParamSpec* games_generic_title_properties[GAMES_GENERIC_TITLE_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

struct _GamesGenericTitlePrivate {
	gchar* title;
};

static gint GamesGenericTitle_private_offset;
static gpointer games_generic_title_parent_class = NULL;
static GamesTitleIface * games_generic_title_games_title_parent_iface = NULL;

static gchar* games_generic_title_real_get_title (GamesTitle* base,
                                           GError** error);
static void games_generic_title_finalize (GObject * obj);
static GType games_generic_title_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
games_generic_title_get_instance_private (GamesGenericTitle* self)
{
	return G_STRUCT_MEMBER_P (self, GamesGenericTitle_private_offset);
}

GamesGenericTitle*
games_generic_title_construct (GType object_type,
                               const gchar* title)
{
	GamesGenericTitle * self = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (title != NULL, NULL);
	self = (GamesGenericTitle*) g_object_new (object_type, NULL);
	_tmp0_ = g_strdup (title);
	_g_free0 (self->priv->title);
	self->priv->title = _tmp0_;
	return self;
}

GamesGenericTitle*
games_generic_title_new (const gchar* title)
{
	return games_generic_title_construct (GAMES_TYPE_GENERIC_TITLE, title);
}

static gchar*
games_generic_title_real_get_title (GamesTitle* base,
                                    GError** error)
{
	GamesGenericTitle * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	self = (GamesGenericTitle*) base;
	_tmp0_ = self->priv->title;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
games_generic_title_class_init (GamesGenericTitleClass * klass,
                                gpointer klass_data)
{
	games_generic_title_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GamesGenericTitle_private_offset);
	G_OBJECT_CLASS (klass)->finalize = games_generic_title_finalize;
}

static void
games_generic_title_games_title_interface_init (GamesTitleIface * iface,
                                                gpointer iface_data)
{
	games_generic_title_games_title_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_title = (gchar* (*) (GamesTitle*, GError**)) games_generic_title_real_get_title;
}

static void
games_generic_title_instance_init (GamesGenericTitle * self,
                                   gpointer klass)
{
	self->priv = games_generic_title_get_instance_private (self);
}

static void
games_generic_title_finalize (GObject * obj)
{
	GamesGenericTitle * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_GENERIC_TITLE, GamesGenericTitle);
	_g_free0 (self->priv->title);
	G_OBJECT_CLASS (games_generic_title_parent_class)->finalize (obj);
}

static GType
games_generic_title_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GamesGenericTitleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_generic_title_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesGenericTitle), 0, (GInstanceInitFunc) games_generic_title_instance_init, NULL };
	static const GInterfaceInfo games_title_info = { (GInterfaceInitFunc) games_generic_title_games_title_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType games_generic_title_type_id;
	games_generic_title_type_id = g_type_register_static (G_TYPE_OBJECT, "GamesGenericTitle", &g_define_type_info, 0);
	g_type_add_interface_static (games_generic_title_type_id, GAMES_TYPE_TITLE, &games_title_info);
	GamesGenericTitle_private_offset = g_type_add_instance_private (games_generic_title_type_id, sizeof (GamesGenericTitlePrivate));
	return games_generic_title_type_id;
}

GType
games_generic_title_get_type (void)
{
	static volatile gsize games_generic_title_type_id__once = 0;
	if (g_once_init_enter (&games_generic_title_type_id__once)) {
		GType games_generic_title_type_id;
		games_generic_title_type_id = games_generic_title_get_type_once ();
		g_once_init_leave (&games_generic_title_type_id__once, games_generic_title_type_id);
	}
	return games_generic_title_type_id__once;
}

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

