SDL_mouse.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #ifndef _SDL_mouse_h
  2. #define _SDL_mouse_h
  3. #include "SDL_stdinc.h"
  4. #include "SDL_error.h"
  5. #include "SDL_video.h"
  6. #include "begin_code.h"
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. typedef struct SDL_Cursor SDL_Cursor;
  11. typedef enum
  12. {
  13. SDL_SYSTEM_CURSOR_ARROW,
  14. SDL_SYSTEM_CURSOR_IBEAM,
  15. SDL_SYSTEM_CURSOR_WAIT,
  16. SDL_SYSTEM_CURSOR_CROSSHAIR,
  17. SDL_SYSTEM_CURSOR_WAITARROW,
  18. SDL_SYSTEM_CURSOR_SIZENWSE,
  19. SDL_SYSTEM_CURSOR_SIZENESW,
  20. SDL_SYSTEM_CURSOR_SIZEWE,
  21. SDL_SYSTEM_CURSOR_SIZENS,
  22. SDL_SYSTEM_CURSOR_SIZEALL,
  23. SDL_SYSTEM_CURSOR_NO,
  24. SDL_SYSTEM_CURSOR_HAND,
  25. SDL_NUM_SYSTEM_CURSORS
  26. } SDL_SystemCursor;
  27. typedef SDL_Window * SDLCALL tSDL_GetMouseFocus(void);
  28. typedef Uint32 SDLCALL tSDL_GetMouseState(int *x, int *y);
  29. typedef Uint32 SDLCALL tSDL_GetRelativeMouseState(int *x, int *y);
  30. typedef void SDLCALL tSDL_WarpMouseInWindow(SDL_Window * window,
  31. int x, int y);
  32. typedef int SDLCALL tSDL_SetRelativeMouseMode(SDL_bool enabled);
  33. typedef SDL_bool SDLCALL tSDL_GetRelativeMouseMode(void);
  34. typedef SDL_Cursor * SDLCALL tSDL_CreateCursor(const Uint8 * data,
  35. const Uint8 * mask,
  36. int w, int h, int hot_x,
  37. int hot_y);
  38. typedef SDL_Cursor * SDLCALL tSDL_CreateColorCursor(SDL_Surface *surface,
  39. int hot_x,
  40. int hot_y);
  41. typedef SDL_Cursor * SDLCALL tSDL_CreateSystemCursor(SDL_SystemCursor id);
  42. typedef void SDLCALL tSDL_SetCursor(SDL_Cursor * cursor);
  43. typedef SDL_Cursor * SDLCALL tSDL_GetCursor(void);
  44. typedef SDL_Cursor * SDLCALL tSDL_GetDefaultCursor(void);
  45. typedef void SDLCALL tSDL_FreeCursor(SDL_Cursor * cursor);
  46. typedef int SDLCALL tSDL_ShowCursor(int toggle);
  47. #define SDL_BUTTON(X) (1 << ((X)-1))
  48. #define SDL_BUTTON_LEFT 1
  49. #define SDL_BUTTON_MIDDLE 2
  50. #define SDL_BUTTON_RIGHT 3
  51. #define SDL_BUTTON_X1 4
  52. #define SDL_BUTTON_X2 5
  53. #define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)
  54. #define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)
  55. #define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)
  56. #define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1)
  57. #define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2)
  58. extern tSDL_GetMouseFocus *SDL_GetMouseFocus;
  59. extern tSDL_GetMouseState *SDL_GetMouseState;
  60. extern tSDL_GetRelativeMouseState *SDL_GetRelativeMouseState;
  61. extern tSDL_WarpMouseInWindow *SDL_WarpMouseInWindow;
  62. extern tSDL_SetRelativeMouseMode *SDL_SetRelativeMouseMode;
  63. extern tSDL_GetRelativeMouseMode *SDL_GetRelativeMouseMode;
  64. extern tSDL_CreateCursor *SDL_CreateCursor;
  65. extern tSDL_CreateColorCursor *SDL_CreateColorCursor;
  66. extern tSDL_CreateSystemCursor *SDL_CreateSystemCursor;
  67. extern tSDL_SetCursor *SDL_SetCursor;
  68. extern tSDL_GetCursor *SDL_GetCursor;
  69. extern tSDL_GetDefaultCursor *SDL_GetDefaultCursor;
  70. extern tSDL_FreeCursor *SDL_FreeCursor;
  71. extern tSDL_ShowCursor *SDL_ShowCursor;
  72. #ifdef __cplusplus
  73. }
  74. #endif
  75. #include "close_code.h"
  76. #endif