zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SDL_mouse_c.h
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2013 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 #include "SDL_config.h"
22 
23 #ifndef _SDL_mouse_c_h
24 #define _SDL_mouse_c_h
25 
26 #include "SDL_mouse.h"
27 
29 
30 struct SDL_Cursor
31 {
32  struct SDL_Cursor *next;
33  void *driverdata;
34 };
35 
36 typedef struct
37 {
38  /* Create a cursor from a surface */
39  SDL_Cursor *(*CreateCursor) (SDL_Surface * surface, int hot_x, int hot_y);
40 
41  /* Create a system cursor */
42  SDL_Cursor *(*CreateSystemCursor) (SDL_SystemCursor id);
43 
44  /* Show the specified cursor, or hide if cursor is NULL */
45  int (*ShowCursor) (SDL_Cursor * cursor);
46 
47  /* This is called when a mouse motion event occurs */
48  void (*MoveCursor) (SDL_Cursor * cursor);
49 
50  /* Free a window manager cursor */
51  void (*FreeCursor) (SDL_Cursor * cursor);
52 
53  /* Warp the mouse to (x,y) */
54  void (*WarpMouse) (SDL_Window * window, int x, int y);
55 
56  /* Set relative mode */
57  int (*SetRelativeMouseMode) (SDL_bool enabled);
58 
59  /* Data common to all mice */
62  int x;
63  int y;
64  int xdelta;
65  int ydelta;
66  int last_x, last_y; /* the last reported x and y coordinates */
69  /* the x and y coordinates when relative mode was activated */
70  int original_x, original_y;
71 
76 
77  /* Driver-dependent data. */
78  void *driverdata;
79 } SDL_Mouse;
80 
81 
82 /* Initialize the mouse subsystem */
83 extern int SDL_MouseInit(void);
84 
85 /* Get the mouse state structure */
86 SDL_Mouse *SDL_GetMouse(void);
87 
88 /* Set the default mouse cursor */
89 extern void SDL_SetDefaultCursor(SDL_Cursor * cursor);
90 
91 /* Set the mouse focus window */
92 extern void SDL_SetMouseFocus(SDL_Window * window);
93 
94 /* Send a mouse motion event */
95 extern int SDL_SendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relative, int x, int y);
96 
97 /* Send a mouse button event */
98 extern int SDL_SendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8 button);
99 
100 /* Send a mouse wheel event */
101 extern int SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, int x, int y);
102 
103 /* Shutdown the mouse subsystem */
104 extern void SDL_MouseQuit(void);
105 
106 #endif /* _SDL_mouse_c_h */
107 
108 /* vi: set ts=4 sw=4 expandtab: */
SDL_Mouse * SDL_GetMouse(void)
Definition: SDL_mouse.c:62
int last_y
Definition: SDL_mouse_c.h:66
GLvoid **typedef void(GLAPIENTRY *PFNGLGETVERTEXATTRIBDVPROC)(GLuint
Definition: glew.h:1824
Uint32 buttonstate
Definition: SDL_mouse_c.h:67
SDL_Window * focus
Definition: SDL_mouse_c.h:61
SDL_bool
Definition: SDL_stdinc.h:116
GLenum GLsizei const GLuint GLboolean enabled
Definition: glew.h:2538
EGLSurface EGLint x
Definition: eglext.h:293
EGLSurface surface
Definition: eglext.h:74
A collection of pixels used in software blitting.
Definition: SDL_surface.h:69
int ydelta
Definition: SDL_mouse_c.h:65
void SDL_SetMouseFocus(SDL_Window *window)
Definition: SDL_mouse.c:93
GLuint id
Definition: gl2ext.h:1142
void SDL_MouseQuit(void)
Definition: SDL_mouse.c:360
SDL_Cursor * cursors
Definition: SDL_mouse_c.h:72
SDL_MouseID mouseID
Definition: SDL_mouse_c.h:60
Uint32 SDL_MouseID
Definition: SDL_mouse_c.h:28
int SDL_MouseInit(void)
Definition: SDL_mouse.c:41
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:145
int
Definition: SDL_systhread.c:37
int SDL_SendMouseMotion(SDL_Window *window, SDL_MouseID mouseID, int relative, int x, int y)
Definition: SDL_mouse.c:178
SDL_bool cursor_shown
Definition: SDL_mouse_c.h:75
SDL_bool relative_mode
Definition: SDL_mouse_c.h:68
SDL_SystemCursor
Cursor types for SDL_CreateSystemCursor.
Definition: SDL_mouse.h:46
void SDL_SetDefaultCursor(SDL_Cursor *cursor)
Definition: SDL_mouse.c:51
EGLSurface EGLint EGLint y
Definition: eglext.h:293
struct SDL_Cursor * next
Definition: SDL_mouse_c.h:32
int xdelta
Definition: SDL_mouse_c.h:64
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:129
int SDL_SendMouseWheel(SDL_Window *window, SDL_MouseID mouseID, int x, int y)
Definition: SDL_mouse.c:332
SDL_Cursor * cur_cursor
Definition: SDL_mouse_c.h:74
void * driverdata
Definition: SDL_mouse_c.h:78
int original_y
Definition: SDL_mouse_c.h:70
void * driverdata
Definition: SDL_mouse_c.h:33
int SDL_SendMouseButton(SDL_Window *window, SDL_MouseID mouseID, Uint8 state, Uint8 button)
Definition: SDL_mouse.c:276
SDL_Cursor * def_cursor
Definition: SDL_mouse_c.h:73