sdltouch.inc 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. //from "sdl_touch.h"
  2. type
  3. PPSDL_TouchID = ^PSDL_TouchID;
  4. PSDL_TouchID = ^TSDL_TouchID;
  5. TSDL_TouchID = type cint64;
  6. PPSDL_FingerID = ^PSDL_FingerID;
  7. PSDL_FingerID = ^TSDL_FingerID;
  8. TSDL_FingerID = type cint64;
  9. PPSDL_TouchDeviceType = ^PSDL_TouchDeviceType;
  10. PSDL_TouchDeviceType = ^TSDL_TouchDeviceType;
  11. TSDL_TouchDeviceType = type cint;
  12. const
  13. SDL_TOUCH_DEVICE_INVALID = TSDL_TouchDeviceType(-1);
  14. SDL_TOUCH_DEVICE_DIRECT = TSDL_TouchDeviceType(0); {* touch screen with window-relative coordinates *}
  15. SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE = TSDL_TouchDeviceType(1); {* trackpad with absolute device coordinates *}
  16. SDL_TOUCH_DEVICE_INDIRECT_RELATIVE = TSDL_TouchDeviceType(2); {* trackpad with relative device coordinates *}
  17. type
  18. PPSDL_Finger = ^PSDL_Finger;
  19. PSDL_Finger = ^TSDL_Finger;
  20. TSDL_Finger = record
  21. id: TSDL_FingerID;
  22. x: cfloat;
  23. y: cfloat;
  24. pressure: cfloat;
  25. end;
  26. const
  27. {* Used as the device ID for mouse events simulated with touch input *}
  28. SDL_TOUCH_MOUSEID = cuint32(-1);
  29. {* Used as the SDL_TouchID for touch events simulated with mouse input *}
  30. SDL_MOUSE_TOUCHID = TSDL_TouchID(-1);
  31. {* Function prototypes *}
  32. {**
  33. * Get the number of registered touch devices.
  34. *}
  35. function SDL_GetNumTouchDevices(): cint; cdecl;
  36. external {$IFDEF DYNAMIC_LINK}SDL_LibName{$ENDIF} {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetNumTouchDevices' {$ENDIF} {$ENDIF};
  37. {**
  38. * Get the touch ID with the given index, or 0 if the index is invalid.
  39. *}
  40. function SDL_GetTouchDevice(index: cint): TSDL_TouchID; cdecl;
  41. external {$IFDEF DYNAMIC_LINK}SDL_LibName{$ENDIF} {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetTouchDevice' {$ENDIF} {$ENDIF};
  42. {**
  43. * Get the touch device name as reported from the driver,
  44. * or NIL if the index is invalid.
  45. *
  46. * \since This function is available since SDL 2.0.22.
  47. *}
  48. function SDL_GetTouchName(index: cint): PAnsiChar; cdecl;
  49. external {$IFDEF DYNAMIC_LINK}SDL_LibName{$ENDIF} {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetTouchName' {$ENDIF} {$ENDIF};
  50. {**
  51. * Get the type of the given touch device.
  52. *
  53. * \since This function is available since SDL 2.0.10.
  54. *}
  55. function SDL_GetTouchDeviceType(touchID: TSDL_TouchID): TSDL_TouchDeviceType; cdecl;
  56. external {$IFDEF DYNAMIC_LINK}SDL_LibName{$ENDIF} {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetTouchDeviceType' {$ENDIF} {$ENDIF};
  57. {**
  58. * Get the number of active fingers for a given touch device.
  59. *}
  60. function SDL_GetNumTouchFingers(touchID: TSDL_TouchID): cint; cdecl;
  61. external {$IFDEF DYNAMIC_LINK}SDL_LibName{$ENDIF} {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetNumTouchFingers' {$ENDIF} {$ENDIF};
  62. {**
  63. * Get the finger object of the given touch, with the given index.
  64. *}
  65. function SDL_GetTouchFinger(touchID: TSDL_TouchID; index: cint): PSDL_Finger; cdecl;
  66. external {$IFDEF DYNAMIC_LINK}SDL_LibName{$ENDIF} {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetTouchFinger' {$ENDIF} {$ENDIF};