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

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

#include "gnome-games.h"
#include <glib.h>
#include <glib-object.h>
#include <string.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_INPUT_CAPABILITIES_0_PROPERTY,
	GAMES_GENERIC_INPUT_CAPABILITIES_NUM_PROPERTIES
};
static GParamSpec* games_generic_input_capabilities_properties[GAMES_GENERIC_INPUT_CAPABILITIES_NUM_PROPERTIES];

struct _GamesGenericInputCapabilitiesPrivate {
	gboolean allow_keyboard_mode;
	gboolean allow_gamepad_mode;
};

static gint GamesGenericInputCapabilities_private_offset;
static gpointer games_generic_input_capabilities_parent_class = NULL;
static GamesInputCapabilitiesIface * games_generic_input_capabilities_games_input_capabilities_parent_iface = NULL;

static gboolean games_generic_input_capabilities_real_get_allow_keyboard_mode (GamesInputCapabilities* base);
static gboolean games_generic_input_capabilities_real_get_allow_gamepad_mode (GamesInputCapabilities* base);
static void games_generic_input_capabilities_finalize (GObject * obj);
static GType games_generic_input_capabilities_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
games_generic_input_capabilities_get_instance_private (GamesGenericInputCapabilities* self)
{
	return G_STRUCT_MEMBER_P (self, GamesGenericInputCapabilities_private_offset);
}

GamesGenericInputCapabilities*
games_generic_input_capabilities_construct (GType object_type,
                                            gboolean allow_keyboard_mode,
                                            gboolean allow_gamepad_mode)
{
	GamesGenericInputCapabilities * self = NULL;
	self = (GamesGenericInputCapabilities*) g_object_new (object_type, NULL);
	self->priv->allow_keyboard_mode = allow_keyboard_mode;
	self->priv->allow_gamepad_mode = allow_gamepad_mode;
	return self;
}

GamesGenericInputCapabilities*
games_generic_input_capabilities_new (gboolean allow_keyboard_mode,
                                      gboolean allow_gamepad_mode)
{
	return games_generic_input_capabilities_construct (GAMES_TYPE_GENERIC_INPUT_CAPABILITIES, allow_keyboard_mode, allow_gamepad_mode);
}

static gboolean
games_generic_input_capabilities_real_get_allow_keyboard_mode (GamesInputCapabilities* base)
{
	GamesGenericInputCapabilities * self;
	gboolean result;
	self = (GamesGenericInputCapabilities*) base;
	result = self->priv->allow_keyboard_mode;
	return result;
}

static gboolean
games_generic_input_capabilities_real_get_allow_gamepad_mode (GamesInputCapabilities* base)
{
	GamesGenericInputCapabilities * self;
	gboolean result;
	self = (GamesGenericInputCapabilities*) base;
	result = self->priv->allow_gamepad_mode;
	return result;
}

static void
games_generic_input_capabilities_class_init (GamesGenericInputCapabilitiesClass * klass,
                                             gpointer klass_data)
{
	games_generic_input_capabilities_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GamesGenericInputCapabilities_private_offset);
	G_OBJECT_CLASS (klass)->finalize = games_generic_input_capabilities_finalize;
}

static void
games_generic_input_capabilities_games_input_capabilities_interface_init (GamesInputCapabilitiesIface * iface,
                                                                          gpointer iface_data)
{
	games_generic_input_capabilities_games_input_capabilities_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_allow_keyboard_mode = (gboolean (*) (GamesInputCapabilities*)) games_generic_input_capabilities_real_get_allow_keyboard_mode;
	iface->get_allow_gamepad_mode = (gboolean (*) (GamesInputCapabilities*)) games_generic_input_capabilities_real_get_allow_gamepad_mode;
}

static void
games_generic_input_capabilities_instance_init (GamesGenericInputCapabilities * self,
                                                gpointer klass)
{
	self->priv = games_generic_input_capabilities_get_instance_private (self);
}

static void
games_generic_input_capabilities_finalize (GObject * obj)
{
	GamesGenericInputCapabilities * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_GENERIC_INPUT_CAPABILITIES, GamesGenericInputCapabilities);
	G_OBJECT_CLASS (games_generic_input_capabilities_parent_class)->finalize (obj);
}

static GType
games_generic_input_capabilities_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GamesGenericInputCapabilitiesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_generic_input_capabilities_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesGenericInputCapabilities), 0, (GInstanceInitFunc) games_generic_input_capabilities_instance_init, NULL };
	static const GInterfaceInfo games_input_capabilities_info = { (GInterfaceInitFunc) games_generic_input_capabilities_games_input_capabilities_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType games_generic_input_capabilities_type_id;
	games_generic_input_capabilities_type_id = g_type_register_static (G_TYPE_OBJECT, "GamesGenericInputCapabilities", &g_define_type_info, 0);
	g_type_add_interface_static (games_generic_input_capabilities_type_id, GAMES_TYPE_INPUT_CAPABILITIES, &games_input_capabilities_info);
	GamesGenericInputCapabilities_private_offset = g_type_add_instance_private (games_generic_input_capabilities_type_id, sizeof (GamesGenericInputCapabilitiesPrivate));
	return games_generic_input_capabilities_type_id;
}

GType
games_generic_input_capabilities_get_type (void)
{
	static volatile gsize games_generic_input_capabilities_type_id__once = 0;
	if (g_once_init_enter (&games_generic_input_capabilities_type_id__once)) {
		GType games_generic_input_capabilities_type_id;
		games_generic_input_capabilities_type_id = games_generic_input_capabilities_get_type_once ();
		g_once_init_leave (&games_generic_input_capabilities_type_id__once, games_generic_input_capabilities_type_id);
	}
	return games_generic_input_capabilities_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;
}

