From d6711c71b615a2289d147b7308a757b087162b1e Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 28 Jan 2023 02:04:17 +0100 Subject: [PATCH 1/6] Make TSDL_GestureID an own type --- units/sdlgesture.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/units/sdlgesture.inc b/units/sdlgesture.inc index 05aa6eeb..e88908b7 100644 --- a/units/sdlgesture.inc +++ b/units/sdlgesture.inc @@ -1,7 +1,7 @@ //from "sdl_gesture.h" type - TSDL_GestureID = cint64; + TSDL_GestureID = type cint64; {* Function prototypes *} From d44f06bdbdd07aea7b17df0c533c85577997cd46 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 28 Jan 2023 02:05:42 +0100 Subject: [PATCH 2/6] Update SDL_RecordGesture --- units/sdlgesture.inc | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/units/sdlgesture.inc b/units/sdlgesture.inc index e88908b7..bc88dc85 100644 --- a/units/sdlgesture.inc +++ b/units/sdlgesture.inc @@ -5,12 +5,21 @@ type {* 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 From cb697e9e479ce552cc826a95a4be6485c2e7b5c5 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 28 Jan 2023 02:06:42 +0100 Subject: [PATCH 3/6] Update SDL_SaveAllDollarTemplates --- units/sdlgesture.inc | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/units/sdlgesture.inc b/units/sdlgesture.inc index bc88dc85..983189bd 100644 --- a/units/sdlgesture.inc +++ b/units/sdlgesture.inc @@ -22,11 +22,19 @@ 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 From 4f9909d740438f4b43f05490c02c0a0bb31efd63 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 28 Jan 2023 02:07:46 +0100 Subject: [PATCH 4/6] Update SDL_SaveDollarTemplate --- units/sdlgesture.inc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/units/sdlgesture.inc b/units/sdlgesture.inc index 983189bd..92664328 100644 --- a/units/sdlgesture.inc +++ b/units/sdlgesture.inc @@ -37,11 +37,20 @@ 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}; {** From d00d4a3d90b99774e207a1e793edd7586763ebd1 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 28 Jan 2023 02:08:44 +0100 Subject: [PATCH 5/6] Update SDL_LoadDollarTemplates --- units/sdlgesture.inc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/units/sdlgesture.inc b/units/sdlgesture.inc index 92664328..f89ec348 100644 --- a/units/sdlgesture.inc +++ b/units/sdlgesture.inc @@ -54,8 +54,17 @@ function SDL_SaveDollarTemplate(gestureId: TSDL_GestureID; dst: PSDL_RWops): cin {** - * 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}; From 5f655c21bd7467b5ad4ef21253c4a5bf5636f4c6 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 28 Jan 2023 02:09:21 +0100 Subject: [PATCH 6/6] Add version tag 2.26.2 for sdlgesture.inc --- units/sdl2.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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