diff --git a/units/sdl2.pas b/units/sdl2.pas index 2d68861b..733a3afd 100644 --- a/units/sdl2.pas +++ b/units/sdl2.pas @@ -189,7 +189,7 @@ interface {$I sdlhaptic.inc} {$I sdlhidapi.inc} // 2.0.18 {$I sdltouch.inc} // 2.24.0 -{$I sdlgesture.inc} +{$I sdlgesture.inc} // 2.26.2 {$I sdlsyswm.inc} {$I sdlevents.inc} // 2.24.0 {$I sdllocale.inc} // 2.0.14 diff --git a/units/sdlgesture.inc b/units/sdlgesture.inc index 05aa6eeb..f89ec348 100644 --- a/units/sdlgesture.inc +++ b/units/sdlgesture.inc @@ -1,35 +1,70 @@ //from "sdl_gesture.h" type - TSDL_GestureID = cint64; + TSDL_GestureID = type cint64; {* Function prototypes *} - {** - * Begin Recording a gesture on the specified touch, or all touches (-1) - * - * - *} -function SDL_RecordGesture(touchId: TSDL_TouchID): cint32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RecordGesture' {$ENDIF} {$ENDIF}; + {/** + * Begin recording a gesture on a specified touch device or all touch devices. + * + * If the parameter `touchId` is -1 (i.e., all devices), this function will + * always return 1, regardless of whether there actually are any devices. + * + * \param touchId the touch device id, or -1 for all touch devices + * \returns 1 on success or 0 if the specified device could not be found. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetTouchDevice + *} +function SDL_RecordGesture(touchId: TSDL_TouchID): cint; cdecl; + external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RecordGesture' {$ENDIF} {$ENDIF}; {** - * Save all currently loaded Dollar Gesture templates - * - * - *} -function SDL_SaveAllDollarTemplates(src: PSDL_RWops): cint32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SaveAllDollarTemplates' {$ENDIF} {$ENDIF}; + * Save all currently loaded Dollar Gesture templates. + * + * \param dst a SDL_RWops to save to + * \returns the number of saved templates on success or 0 on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LoadDollarTemplates + * \sa SDL_SaveDollarTemplate + *} +function SDL_SaveAllDollarTemplates(dst: PSDL_RWops): cint; cdecl; + external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SaveAllDollarTemplates' {$ENDIF} {$ENDIF}; {** - * Save a currently loaded Dollar Gesture template - * - * - *} -function SDL_SaveDollarTemplate(gestureId: TSDL_GestureID; src: PSDL_RWops): cint32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SaveDollarTemplate' {$ENDIF} {$ENDIF}; + * Save a currently loaded Dollar Gesture template. + * + * \param gestureId a gesture id + * \param dst a SDL_RWops to save to + * \returns 1 on success or 0 on failure; call SDL_GetError() for more + * information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LoadDollarTemplates + * \sa SDL_SaveAllDollarTemplates + *} +function SDL_SaveDollarTemplate(gestureId: TSDL_GestureID; dst: PSDL_RWops): cint; cdecl; + external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SaveDollarTemplate' {$ENDIF} {$ENDIF}; {** - * Load Dollar Gesture templates from a file - * - * - *} -function SDL_LoadDollarTemplates(touchId: TSDL_TouchID; src: PSDL_RWops): cint32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_LoadDollarTemplates' {$ENDIF} {$ENDIF}; + * Load Dollar Gesture templates from a file. + * + * \param touchId a touch id + * \param src a SDL_RWops to load from + * \returns the number of loaded templates on success or a negative error code + * (or 0) on failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SaveAllDollarTemplates + * \sa SDL_SaveDollarTemplate + *} +function SDL_LoadDollarTemplates(touchId: TSDL_TouchID; src: PSDL_RWops): cint; cdecl; + external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_LoadDollarTemplates' {$ENDIF} {$ENDIF};