Organized joystick hotplug code a bit.

Cleaned up names, return types, etc.
This commit is contained in:
Sam Lantinga 2012-11-27 00:58:12 -08:00
parent 1898cc34ab
commit 03e08a6a79
14 changed files with 616 additions and 655 deletions

View file

@ -63,18 +63,32 @@ struct _SDL_Joystick
*/
extern int SDL_SYS_JoystickInit(void);
/* Function to return the number of joystick devices plugged in right now */
extern int SDL_SYS_NumJoysticks();
/* Function to cause any queued joystick insertions to be processed */
extern void SDL_SYS_JoystickDetect();
/* Function to determine if the joystick loop needs to run right now */
extern SDL_bool SDL_SYS_JoystickNeedsPolling();
/* Function to get the device-dependent name of a joystick */
extern const char *SDL_SYS_JoystickNameForIndex(int index);
extern const char *SDL_SYS_JoystickNameForDeviceIndex(int device_index);
/* Function to get the current instance id of the joystick located at device_index */
extern SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex( int device_index );
extern SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index);
/* Function to open a joystick for use.
The joystick to open is specified by the index field of the joystick.
This should fill the nbuttons and naxes fields of the joystick structure.
It returns 0, or -1 if there is an error.
*/
extern int SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index );
extern int SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index);
/* Function to query if the joystick is currently attached
* It returns 1 if attached, 0 otherwise.
*/
extern SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick * joystick);
/* Function to update the state of a joystick - called as a device poll.
* This function shouldn't update the joystick structure directly,
@ -89,32 +103,15 @@ extern void SDL_SYS_JoystickClose(SDL_Joystick * joystick);
/* Function to perform any system-specific joystick related cleanup */
extern void SDL_SYS_JoystickQuit(void);
/* Function to query if the joystick is currently attached
* It returns 1 if attached, 0 otherwise.
*/
extern int SDL_SYS_JoystickAttached(SDL_Joystick * joystick);
/* Function to return the stable GUID for a plugged in device */
extern JoystickGUID SDL_SYS_JoystickGetDeviceGUID(int device_index);
/* Function to return the number of joystick devices plugged in right now*/
extern int SDL_SYS_NumJoysticks();
/* Function to cause any queued joystick insertions to be processed
*/
extern void SDL_SYS_JoystickDetect();
/* Function to determine if the joystick loop needs to run right now
*/
extern int SDL_SYS_JoystickNeedsPolling();
/* Function to return the stable GUID for a plugged in device
*/
extern JoystickGUID SDL_SYS_PrivateJoystickGetDeviceGUID( int device_index );
/* Function to return the stable GUID for a opened joystick
*/
extern JoystickGUID SDL_SYS_PrivateJoystickGetGUID(SDL_Joystick * joystick);
/* Function to return the stable GUID for a opened joystick */
extern JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick);
#ifdef SDL_JOYSTICK_DINPUT
/* Function to get the current instance id of the joystick located at device_index */
extern int SDL_SYS_IsXInputDeviceIndex( int device_index );
extern SDL_bool SDL_SYS_IsXInputDeviceIndex( int device_index );
#endif
/* vi: set ts=4 sw=4 expandtab: */