comparison src/events/SDL_mouse_c.h @ 2710:44e49d3fa6cf

Final merge of Google Summer of Code 2008 work... Many-mouse and tablet support by Szymon Wilczek, mentored by Ryan C. Gordon Everything concerning the project is noted on the wiki: http://wilku.ravenlord.ws/doku.php?id=start
author Sam Lantinga <slouken@libsdl.org>
date Mon, 25 Aug 2008 06:33:00 +0000
parents 003c1b5b07da
children c4e697245676
comparison
equal deleted inserted replaced
2709:fd3f0f1147e7 2710:44e49d3fa6cf
27 typedef struct SDL_Mouse SDL_Mouse; 27 typedef struct SDL_Mouse SDL_Mouse;
28 28
29 struct SDL_Cursor 29 struct SDL_Cursor
30 { 30 {
31 SDL_Mouse *mouse; 31 SDL_Mouse *mouse;
32
33 SDL_Cursor *next; 32 SDL_Cursor *next;
34
35 void *driverdata; 33 void *driverdata;
36 }; 34 };
37 35
38 struct SDL_Mouse 36 struct SDL_Mouse
39 { 37 {
54 int y); 52 int y);
55 53
56 /* Free the mouse when it's time */ 54 /* Free the mouse when it's time */
57 void (*FreeMouse) (SDL_Mouse * mouse); 55 void (*FreeMouse) (SDL_Mouse * mouse);
58 56
57 /* data common for tablets */
58 int pressure;
59 int pressure_max;
60 int pressure_min;
61 int tilt; /* for future use */
62 int rotation; /* for future use */
63 int total_ends;
64 int current_end;
65
59 /* Data common to all mice */ 66 /* Data common to all mice */
60 SDL_WindowID focus; 67 SDL_WindowID focus;
68 int which;
61 int x; 69 int x;
62 int y; 70 int y;
71 int z; /* for future use */
63 int xdelta; 72 int xdelta;
64 int ydelta; 73 int ydelta;
74 char *name;
65 Uint8 buttonstate; 75 Uint8 buttonstate;
66 SDL_bool relative_mode; 76 SDL_bool relative_mode;
77 SDL_bool proximity;
67 SDL_bool flush_motion; 78 SDL_bool flush_motion;
68 79
69 SDL_Cursor *cursors; 80 SDL_Cursor *cursors;
70 SDL_Cursor *def_cursor; 81 SDL_Cursor *def_cursor;
71 SDL_Cursor *cur_cursor; 82 SDL_Cursor *cur_cursor;
72 SDL_bool cursor_shown; 83 SDL_bool cursor_shown;
73 84
74 void *driverdata; 85 void *driverdata;
75 }; 86 };
76 87
77
78 /* Initialize the mouse subsystem */ 88 /* Initialize the mouse subsystem */
79 extern int SDL_MouseInit(void); 89 extern int SDL_MouseInit(void);
80 90
81 /* Get the mouse at an index */ 91 /* Get the mouse at an index */
82 extern SDL_Mouse *SDL_GetMouse(int index); 92 extern SDL_Mouse *SDL_GetMouse(int index);
83 93
94 /* Assign an id to a mouse at an index */
95 extern int SDL_SetMouseIndexId(int id, int index);
96
97 /* Get the mouse by id */
98 extern SDL_Mouse *SDL_GetMouseByID(int id);
99
84 /* Add a mouse, possibly reattaching at a particular index (or -1), 100 /* Add a mouse, possibly reattaching at a particular index (or -1),
85 returning the index of the mouse, or -1 if there was an error. 101 returning the index of the mouse, or -1 if there was an error.
86 */ 102 */
87 extern int SDL_AddMouse(const SDL_Mouse * mouse, int index); 103 extern int SDL_AddMouse(const SDL_Mouse * mouse, int index, char *name,
104 int pressure_max, int pressure_min, int ends);
88 105
89 /* Remove a mouse at an index, clearing the slot for later */ 106 /* Remove a mouse at an index, clearing the slot for later */
90 extern void SDL_DelMouse(int index); 107 extern void SDL_DelMouse(int index);
91 108
92 /* Clear the button state of a mouse at an index */ 109 /* Clear the button state of a mouse at an index */
93 extern void SDL_ResetMouse(int index); 110 extern void SDL_ResetMouse(int index);
94 111
95 /* Set the mouse focus window */ 112 /* Set the mouse focus window */
96 extern void SDL_SetMouseFocus(int index, SDL_WindowID windowID); 113 extern void SDL_SetMouseFocus(int id, SDL_WindowID windowID);
97 114
98 /* Send a mouse motion event for a mouse at an index */ 115 /* Send a mouse motion event for a mouse at an index */
99 extern int SDL_SendMouseMotion(int index, int relative, int x, int y); 116 extern int SDL_SendMouseMotion(int id, int relative, int x, int y, int z);
100 117
101 /* Send a mouse button event for a mouse at an index */ 118 /* Send a mouse button event for a mouse at an index */
102 extern int SDL_SendMouseButton(int index, Uint8 state, Uint8 button); 119 extern int SDL_SendMouseButton(int id, Uint8 state, Uint8 button);
103 120
104 /* Send a mouse wheel event for a mouse at an index */ 121 /* Send a mouse wheel event for a mouse at an index */
105 extern int SDL_SendMouseWheel(int index, int x, int y); 122 extern int SDL_SendMouseWheel(int id, int x, int y);
106 123
107 /* Shutdown the mouse subsystem */ 124 /* Shutdown the mouse subsystem */
108 extern void SDL_MouseQuit(void); 125 extern void SDL_MouseQuit(void);
109 126
127 /* FIXME: Where do these functions go in this header? */
128 extern void SDL_UpdateCoordinates(int x, int y);
129 extern void SDL_ChangeEnd(int id, int end);
130
110 #endif /* _SDL_mouse_c_h */ 131 #endif /* _SDL_mouse_c_h */
111 132
112 /* vi: set ts=4 sw=4 expandtab: */ 133 /* vi: set ts=4 sw=4 expandtab: */