RetroArch/input/input_joypad_driver.h

116 lines
3.4 KiB
C
Raw Normal View History

/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
2015-01-07 16:46:50 +00:00
* Copyright (C) 2011-2015 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INPUT_JOYPAD_DRIVER_H__
#define INPUT_JOYPAD_DRIVER_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <boolean.h>
2014-11-29 20:01:21 +00:00
#include "../libretro.h"
typedef struct rarch_joypad_driver input_device_driver_t;
2015-01-09 23:03:04 +00:00
struct rarch_joypad_driver
{
bool (*init)(void *data);
bool (*query_pad)(unsigned);
void (*destroy)(void);
bool (*button)(unsigned, uint16_t);
2015-02-15 00:57:29 +00:00
uint64_t (*get_buttons)(unsigned);
int16_t (*axis)(unsigned, uint32_t);
void (*poll)(void);
bool (*set_rumble)(unsigned, enum retro_rumble_effect, uint16_t);
const char *(*name)(unsigned);
const char *ident;
};
extern input_device_driver_t dinput_joypad;
extern input_device_driver_t linuxraw_joypad;
extern input_device_driver_t parport_joypad;
extern input_device_driver_t udev_joypad;
extern input_device_driver_t xinput_joypad;
extern input_device_driver_t sdl_joypad;
extern input_device_driver_t ps3_joypad;
extern input_device_driver_t psp_joypad;
extern input_device_driver_t ctr_joypad;
extern input_device_driver_t xdk_joypad;
extern input_device_driver_t gx_joypad;
extern input_device_driver_t hid_joypad;
extern input_device_driver_t android_joypad;
extern input_device_driver_t qnx_joypad;
extern input_device_driver_t null_joypad;
2015-11-16 01:39:38 +00:00
extern input_device_driver_t mfi_joypad;
/**
* joypad_driver_find_handle:
* @index : index of driver to get handle to.
*
* Returns: handle to joypad driver at index. Can be NULL
* if nothing found.
**/
const void *joypad_driver_find_handle(int index);
/**
* joypad_driver_find_ident:
* @index : index of driver to get handle to.
*
* Returns: Human-readable identifier of joypad driver at index. Can be NULL
* if nothing found.
**/
const char *joypad_driver_find_ident(int index);
2015-01-09 23:03:04 +00:00
/**
* config_get_joypad_driver_options:
*
* Get an enumerated list of all joypad driver names, separated by '|'.
*
* Returns: string listing of all joypad driver names, separated by '|'.
**/
const char* config_get_joypad_driver_options(void);
/**
* input_joypad_init_driver:
* @ident : identifier of driver to initialize.
*
* Initialize a joypad driver of name @ident.
*
* If ident points to NULL or a zero-length string,
* equivalent to calling input_joypad_init_first().
*
* Returns: joypad driver if found, otherwise NULL.
**/
const input_device_driver_t *input_joypad_init_driver(const char *ident, void *data);
2015-01-09 23:03:04 +00:00
/**
* input_joypad_init_first:
*
* Finds first suitable joypad driver and initializes.
*
* Returns: joypad driver if found, otherwise NULL.
**/
const input_device_driver_t *input_joypad_init_first(void *data);
2015-01-09 23:03:04 +00:00
#ifdef __cplusplus
}
#endif
#endif