World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
SDL_mouse.h
См. документацию.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any damages
7  arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 
28 #ifndef SDL_mouse_h_
29 #define SDL_mouse_h_
30 
31 #include "SDL_stdinc.h"
32 #include "SDL_error.h"
33 #include "SDL_video.h"
34 
35 #include "begin_code.h"
36 /* Set up for C function definitions, even when using C++ */
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 typedef struct SDL_Cursor SDL_Cursor;
46 typedef enum
47 {
62 
66 typedef enum
67 {
71 
72 /* Function prototypes */
73 
77 extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void);
78 
87 extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y);
88 
112 extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(int *x, int *y);
113 
121 extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
122 
132 extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
133  int x, int y);
134 
144 extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(int x, int y);
145 
162 extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled);
163 
193 extern DECLSPEC int SDLCALL SDL_CaptureMouse(SDL_bool enabled);
194 
200 extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void);
201 
220 extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data,
221  const Uint8 * mask,
222  int w, int h, int hot_x,
223  int hot_y);
224 
230 extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface,
231  int hot_x,
232  int hot_y);
233 
239 extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id);
240 
244 extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor);
245 
249 extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void);
250 
254 extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void);
255 
263 extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor);
264 
273 extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
274 
281 #define SDL_BUTTON(X) (1 << ((X)-1))
282 #define SDL_BUTTON_LEFT 1
283 #define SDL_BUTTON_MIDDLE 2
284 #define SDL_BUTTON_RIGHT 3
285 #define SDL_BUTTON_X1 4
286 #define SDL_BUTTON_X2 5
287 #define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)
288 #define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)
289 #define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)
290 #define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1)
291 #define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2)
292 
293 
294 /* Ends C function definitions when using C++ */
295 #ifdef __cplusplus
296 }
297 #endif
298 #include "close_code.h"
299 
300 #endif /* SDL_mouse_h_ */
301 
302 /* vi: set ts=4 sw=4 expandtab: */
SDL_SYSTEM_CURSOR_HAND
@ SDL_SYSTEM_CURSOR_HAND
Definition: SDL_mouse.h:59
mask
GLenum GLint GLuint mask
Definition: SDL_opengl_glext.h:660
SDL_NUM_SYSTEM_CURSORS
@ SDL_NUM_SYSTEM_CURSORS
Definition: SDL_mouse.h:60
SDL_Surface
A collection of pixels used in software blitting.
Definition: SDL_surface.h:70
SDL_FreeCursor
DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor)
Frees a cursor created with SDL_CreateCursor() or similar functions.
SDL_CreateColorCursor
DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y)
Create a color cursor.
SDL_SYSTEM_CURSOR_WAITARROW
@ SDL_SYSTEM_CURSOR_WAITARROW
Definition: SDL_mouse.h:52
SDL_CreateCursor
DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 *data, const Uint8 *mask, int w, int h, int hot_x, int hot_y)
Create a cursor, using the specified bitmap data and mask (in MSB format).
SDL_ShowCursor
DECLSPEC int SDLCALL SDL_ShowCursor(int toggle)
Toggle whether or not the cursor is shown.
SDL_WarpMouseGlobal
DECLSPEC int SDLCALL SDL_WarpMouseGlobal(int x, int y)
Moves the mouse to the given position in global screen space.
SDL_SYSTEM_CURSOR_CROSSHAIR
@ SDL_SYSTEM_CURSOR_CROSSHAIR
Definition: SDL_mouse.h:51
SDL_SYSTEM_CURSOR_SIZENESW
@ SDL_SYSTEM_CURSOR_SIZENESW
Definition: SDL_mouse.h:54
SDL_error.h
SDL_GetMouseFocus
DECLSPEC SDL_Window *SDLCALL SDL_GetMouseFocus(void)
Get the window which currently has mouse focus.
w
GLubyte GLubyte GLubyte GLubyte w
Definition: SDL_opengl_glext.h:734
h
GLfloat GLfloat GLfloat GLfloat h
Definition: SDL_opengl_glext.h:1949
close_code.h
begin_code.h
y
EGLSurface EGLint EGLint y
Definition: SDL_egl.h:1596
SDL_GetGlobalMouseState
DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(int *x, int *y)
Get the current state of the mouse, in relation to the desktop.
SDL_GetRelativeMouseState
DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y)
Retrieve the relative state of the mouse.
x
EGLSurface EGLint x
Definition: SDL_egl.h:1596
SDL_GetDefaultCursor
DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void)
Return the default cursor.
surface
EGLSurface surface
Definition: SDL_egl.h:992
SDL_GetMouseState
DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y)
Retrieve the current state of the mouse.
SDL_SYSTEM_CURSOR_SIZEALL
@ SDL_SYSTEM_CURSOR_SIZEALL
Definition: SDL_mouse.h:57
SDL_SystemCursor
SDL_SystemCursor
Cursor types for SDL_CreateSystemCursor().
Definition: SDL_mouse.h:46
SDL_Cursor
struct SDL_Cursor SDL_Cursor
Definition: SDL_mouse.h:41
window
EGLSurface EGLNativeWindowType * window
Definition: SDL_egl.h:1580
SDL_SYSTEM_CURSOR_IBEAM
@ SDL_SYSTEM_CURSOR_IBEAM
Definition: SDL_mouse.h:49
SDL_SetCursor
DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor)
Set the active cursor.
SDL_CaptureMouse
DECLSPEC int SDLCALL SDL_CaptureMouse(SDL_bool enabled)
Capture the mouse, to track input outside an SDL window.
SDL_SetRelativeMouseMode
DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled)
Set relative mouse mode.
SDL_MOUSEWHEEL_FLIPPED
@ SDL_MOUSEWHEEL_FLIPPED
Definition: SDL_mouse.h:69
SDL_GetRelativeMouseMode
DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void)
Query whether relative mouse mode is enabled.
SDL_SYSTEM_CURSOR_NO
@ SDL_SYSTEM_CURSOR_NO
Definition: SDL_mouse.h:58
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:161
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974
SDL_SYSTEM_CURSOR_WAIT
@ SDL_SYSTEM_CURSOR_WAIT
Definition: SDL_mouse.h:50
Uint8
uint8_t Uint8
Definition: SDL_stdinc.h:179
SDL_Window
struct SDL_Window SDL_Window
The type used to identify a window.
Definition: SDL_video.h:90
SDL_GetCursor
DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void)
Return the active cursor.
SDL_stdinc.h
Uint32
uint32_t Uint32
Definition: SDL_stdinc.h:203
SDL_WarpMouseInWindow
DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window *window, int x, int y)
Moves the mouse to the given position within the window.
SDL_SYSTEM_CURSOR_SIZEWE
@ SDL_SYSTEM_CURSOR_SIZEWE
Definition: SDL_mouse.h:55
enabled
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: SDL_opengl_glext.h:2482
SDL_MOUSEWHEEL_NORMAL
@ SDL_MOUSEWHEEL_NORMAL
Definition: SDL_mouse.h:68
SDL_video.h
SDL_SYSTEM_CURSOR_SIZENWSE
@ SDL_SYSTEM_CURSOR_SIZENWSE
Definition: SDL_mouse.h:53
SDL_MouseWheelDirection
SDL_MouseWheelDirection
Scroll direction types for the Scroll event.
Definition: SDL_mouse.h:66
SDL_SYSTEM_CURSOR_ARROW
@ SDL_SYSTEM_CURSOR_ARROW
Definition: SDL_mouse.h:48
SDL_SYSTEM_CURSOR_SIZENS
@ SDL_SYSTEM_CURSOR_SIZENS
Definition: SDL_mouse.h:56
SDL_CreateSystemCursor
DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id)
Create a system cursor.