From 8cdf8dec703d882b46ca50a769fabb95ffc48e2c Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 24 Nov 2016 21:27:41 +0100 Subject: sync with upstream --- .../include/kodi/kodi_peripheral_dll.h | 72 +++++++++++++++++++++- 1 file changed, 69 insertions(+), 3 deletions(-) (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h') diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h index 591afcc..f9d7482 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h @@ -22,7 +22,7 @@ #include "kodi_peripheral_types.h" -#define PERIPHERAL_ADDON_JOYSTICKS // TODO +#define PERIPHERAL_ADDON_JOYSTICKS //! @todo #ifdef __cplusplus extern "C" @@ -100,6 +100,14 @@ extern "C" * @param events The array of allocated events */ void FreeEvents(unsigned int event_count, PERIPHERAL_EVENT* events); + + /*! + * @brief Send an input event to the specified peripheral + * @param peripheralIndex The index of the device receiving the input event + * @param event The input event + * @return true if the event was handled, false otherwise + */ + bool SendEvent(const PERIPHERAL_EVENT* event); ///} /// @name Joystick operations @@ -150,12 +158,57 @@ extern "C" * @brief Add or update joystick features * @param joystick The device's joystick properties; unknown values may be left at their default * @param controller_id The game controller profile being updated - * @param feature_count The number of features int the features array + * @param feature_count The number of features in the features array * @param features The array of features * @return PERIPHERAL_NO_ERROR if successful */ PERIPHERAL_ERROR MapFeatures(const JOYSTICK_INFO* joystick, const char* controller_id, - unsigned int feature_count, JOYSTICK_FEATURE* features); + unsigned int feature_count, const JOYSTICK_FEATURE* features); + + /*! + * @brief Get the driver primitives that should be ignored while mapping the device + * @param joystick The device's joystick properties; unknown values may be left at their default + * @param primitive_count The number of features allocated for the primitives array + * @param primitives The array of allocated driver primitives to be ignored + * @return PERIPHERAL_NO_ERROR if successful; array must be freed using + * FreePrimitives() in this case + */ + PERIPHERAL_ERROR GetIgnoredPrimitives(const JOYSTICK_INFO* joystick, + unsigned int* primitive_count, + JOYSTICK_DRIVER_PRIMITIVE** primitives); + + /*! + * @brief Free the memory allocated in GetIgnoredPrimitives() + * + * Must be called if GetIgnoredPrimitives() returns PERIPHERAL_NO_ERROR. + * + * @param primitive_count The number of driver primitives allocated for the primitives array + * @param primitives The array of allocated driver primitives + */ + void FreePrimitives(unsigned int primitive_count, JOYSTICK_DRIVER_PRIMITIVE* primitives); + + /*! + * @brief Set the list of driver primitives that are ignored for the device + * @param joystick The device's joystick properties; unknown values may be left at their default + * @param primitive_count The number of driver features in the primitives array + * @param primitives The array of driver primitives to ignore + * @return PERIPHERAL_NO_ERROR if successful + */ + PERIPHERAL_ERROR SetIgnoredPrimitives(const JOYSTICK_INFO* joystick, + unsigned int primitive_count, + const JOYSTICK_DRIVER_PRIMITIVE* primitives); + + /*! + * @brief Save the button map for the given joystick + * @param joystick The device's joystick properties + */ + void SaveButtonMap(const JOYSTICK_INFO* joystick); + + /*! + * @brief Revert the button map to the last time it was loaded or committed to disk + * @param joystick The device's joystick properties + */ + void RevertButtonMap(const JOYSTICK_INFO* joystick); /*! * @brief Reset the button map for the given joystick and controller profile ID @@ -163,6 +216,12 @@ extern "C" * @param controller_id The game controller profile being reset */ void ResetButtonMap(const JOYSTICK_INFO* joystick, const char* controller_id); + + /*! + * @brief Powers off the given joystick if supported + * @param index The joystick's driver index + */ + void PowerOffJoystick(unsigned int index); #endif ///} @@ -180,6 +239,7 @@ extern "C" pClient->FreeScanResults = FreeScanResults; pClient->GetEvents = GetEvents; pClient->FreeEvents = FreeEvents; + pClient->SendEvent = SendEvent; #ifdef PERIPHERAL_ADDON_JOYSTICKS pClient->GetJoystickInfo = GetJoystickInfo; @@ -187,7 +247,13 @@ extern "C" pClient->GetFeatures = GetFeatures; pClient->FreeFeatures = FreeFeatures; pClient->MapFeatures = MapFeatures; + pClient->GetIgnoredPrimitives = GetIgnoredPrimitives; + pClient->FreePrimitives = FreePrimitives; + pClient->SetIgnoredPrimitives = SetIgnoredPrimitives; + pClient->SaveButtonMap = SaveButtonMap; + pClient->RevertButtonMap = RevertButtonMap; pClient->ResetButtonMap = ResetButtonMap; + pClient->PowerOffJoystick = PowerOffJoystick; #endif } -- cgit v1.2.3