/* input-device.c generated by valac 0.36.1.17-97a62, the Vala compiler
 * generated from input-device.vala, do not modify */

/* This file is part of retro-gtk. License: GPL-3.0+.*/

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


#define RETRO_TYPE_INPUT_DEVICE (retro_input_device_get_type ())
#define RETRO_INPUT_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RETRO_TYPE_INPUT_DEVICE, RetroInputDevice))
#define RETRO_IS_INPUT_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RETRO_TYPE_INPUT_DEVICE))
#define RETRO_INPUT_DEVICE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), RETRO_TYPE_INPUT_DEVICE, RetroInputDeviceIface))

typedef struct _RetroInputDevice RetroInputDevice;
typedef struct _RetroInputDeviceIface RetroInputDeviceIface;

#define RETRO_TYPE_DEVICE_TYPE (retro_device_type_get_type ())

typedef enum  {
	RETRO_DEVICE_TYPE_TYPE_MASK = 0xff,
	RETRO_DEVICE_TYPE_NONE = 0,
	RETRO_DEVICE_TYPE_JOYPAD = 1,
	RETRO_DEVICE_TYPE_MOUSE = 2,
	RETRO_DEVICE_TYPE_KEYBOARD = 3,
	RETRO_DEVICE_TYPE_LIGHTGUN = 4,
	RETRO_DEVICE_TYPE_ANALOG = 5,
	RETRO_DEVICE_TYPE_POINTER = 6
} RetroDeviceType;

struct _RetroInputDeviceIface {
	GTypeInterface parent_iface;
	void (*poll) (RetroInputDevice* self);
	gint16 (*get_input_state) (RetroInputDevice* self, RetroDeviceType device, guint index, guint id);
	RetroDeviceType (*get_device_type) (RetroInputDevice* self);
	guint64 (*get_device_capabilities) (RetroInputDevice* self);
};



GType retro_device_type_get_type (void) G_GNUC_CONST;
GType retro_input_device_get_type (void) G_GNUC_CONST;
void retro_input_device_poll (RetroInputDevice* self);
gint16 retro_input_device_get_input_state (RetroInputDevice* self, RetroDeviceType device, guint index, guint id);
RetroDeviceType retro_input_device_get_device_type (RetroInputDevice* self);
guint64 retro_input_device_get_device_capabilities (RetroInputDevice* self);


void retro_input_device_poll (RetroInputDevice* self) {
	g_return_if_fail (self != NULL);
	RETRO_INPUT_DEVICE_GET_INTERFACE (self)->poll (self);
}


gint16 retro_input_device_get_input_state (RetroInputDevice* self, RetroDeviceType device, guint index, guint id) {
	g_return_val_if_fail (self != NULL, 0);
	return RETRO_INPUT_DEVICE_GET_INTERFACE (self)->get_input_state (self, device, index, id);
}


RetroDeviceType retro_input_device_get_device_type (RetroInputDevice* self) {
	g_return_val_if_fail (self != NULL, 0);
	return RETRO_INPUT_DEVICE_GET_INTERFACE (self)->get_device_type (self);
}


guint64 retro_input_device_get_device_capabilities (RetroInputDevice* self) {
	g_return_val_if_fail (self != NULL, 0ULL);
	return RETRO_INPUT_DEVICE_GET_INTERFACE (self)->get_device_capabilities (self);
}


static void retro_input_device_base_init (RetroInputDeviceIface * iface) {
	static gboolean initialized = FALSE;
	if (!initialized) {
		initialized = TRUE;
	}
}


GType retro_input_device_get_type (void) {
	static volatile gsize retro_input_device_type_id__volatile = 0;
	if (g_once_init_enter (&retro_input_device_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RetroInputDeviceIface), (GBaseInitFunc) retro_input_device_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
		GType retro_input_device_type_id;
		retro_input_device_type_id = g_type_register_static (G_TYPE_INTERFACE, "RetroInputDevice", &g_define_type_info, 0);
		g_type_interface_add_prerequisite (retro_input_device_type_id, G_TYPE_OBJECT);
		g_once_init_leave (&retro_input_device_type_id__volatile, retro_input_device_type_id);
	}
	return retro_input_device_type_id__volatile;
}



