SDL_gesture.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. /**
  19. * \file SDL_gesture.h
  20. *
  21. * Include file for SDL gesture event handling.
  22. */
  23. #ifndef SDL_gesture_h_
  24. #define SDL_gesture_h_
  25. #include "SDL_stdinc.h"
  26. #include "SDL_error.h"
  27. #include "SDL_video.h"
  28. #include "SDL_touch.h"
  29. #include "begin_code.h"
  30. /* Set up for C function definitions, even when using C++ */
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. typedef Sint64 SDL_GestureID;
  35. /* Function prototypes */
  36. /**
  37. * Begin recording a gesture on a specified touch device or all touch devices.
  38. *
  39. * If the parameter `touchId` is -1 (i.e., all devices), this function will
  40. * always return 1, regardless of whether there actually are any devices.
  41. *
  42. * \param touchId the touch device id, or -1 for all touch devices
  43. * \returns 1 on success or 0 if the specified device could not be found.
  44. *
  45. * \since This function is available since SDL 2.0.0.
  46. *
  47. * \sa SDL_GetTouchDevice
  48. */
  49. extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId);
  50. /**
  51. * Save all currently loaded Dollar Gesture templates.
  52. *
  53. * \param dst a SDL_RWops to save to
  54. * \returns the number of saved templates on success or 0 on failure; call
  55. * SDL_GetError() for more information.
  56. *
  57. * \since This function is available since SDL 2.0.0.
  58. *
  59. * \sa SDL_LoadDollarTemplates
  60. * \sa SDL_SaveDollarTemplate
  61. */
  62. extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst);
  63. /**
  64. * Save a currently loaded Dollar Gesture template.
  65. *
  66. * \param gestureId a gesture id
  67. * \param dst a SDL_RWops to save to
  68. * \returns 1 on success or 0 on failure; call SDL_GetError() for more
  69. * information.
  70. *
  71. * \since This function is available since SDL 2.0.0.
  72. *
  73. * \sa SDL_LoadDollarTemplates
  74. * \sa SDL_SaveAllDollarTemplates
  75. */
  76. extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst);
  77. /**
  78. * Load Dollar Gesture templates from a file.
  79. *
  80. * \param touchId a touch id
  81. * \param src a SDL_RWops to load from
  82. * \returns the number of loaded templates on success or a negative error code
  83. * (or 0) on failure; call SDL_GetError() for more information.
  84. *
  85. * \since This function is available since SDL 2.0.0.
  86. *
  87. * \sa SDL_SaveAllDollarTemplates
  88. * \sa SDL_SaveDollarTemplate
  89. */
  90. extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src);
  91. /* Ends C function definitions when using C++ */
  92. #ifdef __cplusplus
  93. }
  94. #endif
  95. #include "close_code.h"
  96. #endif /* SDL_gesture_h_ */
  97. /* vi: set ts=4 sw=4 expandtab: */