comparison include/SDL_events.h @ 2674:f1d07ba2e275 gsoc2008_nds

Started adding framework for Touchscreen API, based on and (consistent with) the existing Joystick API.
author Darren Alton <dalton@stevens.edu>
date Mon, 23 Jun 2008 11:55:26 +0000
parents c97ad1abe05b
children 3895761db26a
comparison
equal deleted inserted replaced
2673:24a6b3588eac 2674:f1d07ba2e275
33 #include "SDL_error.h" 33 #include "SDL_error.h"
34 #include "SDL_video.h" 34 #include "SDL_video.h"
35 #include "SDL_keyboard.h" 35 #include "SDL_keyboard.h"
36 #include "SDL_mouse.h" 36 #include "SDL_mouse.h"
37 #include "SDL_joystick.h" 37 #include "SDL_joystick.h"
38 #include "SDL_touchscreen.h"
38 #include "SDL_quit.h" 39 #include "SDL_quit.h"
39 40
40 #include "begin_code.h" 41 #include "begin_code.h"
41 /* Set up for C function definitions, even when using C++ */ 42 /* Set up for C function definitions, even when using C++ */
42 #ifdef __cplusplus 43 #ifdef __cplusplus
68 SDL_JOYAXISMOTION, /**< Joystick axis motion */ 69 SDL_JOYAXISMOTION, /**< Joystick axis motion */
69 SDL_JOYBALLMOTION, /**< Joystick trackball motion */ 70 SDL_JOYBALLMOTION, /**< Joystick trackball motion */
70 SDL_JOYHATMOTION, /**< Joystick hat position change */ 71 SDL_JOYHATMOTION, /**< Joystick hat position change */
71 SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ 72 SDL_JOYBUTTONDOWN, /**< Joystick button pressed */
72 SDL_JOYBUTTONUP, /**< Joystick button released */ 73 SDL_JOYBUTTONUP, /**< Joystick button released */
74 SDL_TOUCHPRESSED, /**< Touchscreen pressed */
75 SDL_TOUCHRELEASED, /**< Touchscreen no longer pressed */
76 SDL_TOUCHMOTION, /**< Touchscreen point motion */
73 SDL_QUIT, /**< User-requested quit */ 77 SDL_QUIT, /**< User-requested quit */
74 SDL_SYSWMEVENT, /**< System specific event */ 78 SDL_SYSWMEVENT, /**< System specific event */
75 SDL_EVENT_RESERVED1, /**< Reserved for future use... */ 79 SDL_EVENT_RESERVED1, /**< Reserved for future use... */
76 SDL_EVENT_RESERVED2, /**< Reserved for future use... */ 80 SDL_EVENT_RESERVED2, /**< Reserved for future use... */
77 SDL_EVENT_RESERVED3, /**< Reserved for future use... */ 81 SDL_EVENT_RESERVED3, /**< Reserved for future use... */
109 SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP), 113 SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP),
110 SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION) | 114 SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION) |
111 SDL_EVENTMASK(SDL_JOYBALLMOTION) | 115 SDL_EVENTMASK(SDL_JOYBALLMOTION) |
112 SDL_EVENTMASK(SDL_JOYHATMOTION) | 116 SDL_EVENTMASK(SDL_JOYHATMOTION) |
113 SDL_EVENTMASK(SDL_JOYBUTTONDOWN) | SDL_EVENTMASK(SDL_JOYBUTTONUP), 117 SDL_EVENTMASK(SDL_JOYBUTTONDOWN) | SDL_EVENTMASK(SDL_JOYBUTTONUP),
118 SDL_TOUCHPRESSEDMASK = SDL_EVENTMASK(SDL_TOUCHPRESSED),
119 SDL_TOUCHRELEASEDMASK = SDL_EVENTMASK(SDL_TOUCHRELEASED),
120 SDL_TOUCHMOTIONMASK = SDL_EVENTMASK(SDL_TOUCHMOTION),
121 SDL_TOUCHEVENTMASK = SDL_EVENTMASK(SDL_TOUCHPRESSED) |
122 SDL_EVENTMASK(SDL_TOUCHRELEASED) | SDL_EVENTMASK(SDL_TOUCHMOTION),
114 SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT), 123 SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT),
115 SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT) 124 SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT)
116 } SDL_EventMask; 125 } SDL_EventMask;
117 #define SDL_ALLEVENTS 0xFFFFFFFF 126 #define SDL_ALLEVENTS 0xFFFFFFFF
118 127
260 Uint8 type; /**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */ 269 Uint8 type; /**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */
261 Uint8 which; /**< The joystick device index */ 270 Uint8 which; /**< The joystick device index */
262 Uint8 button; /**< The joystick button index */ 271 Uint8 button; /**< The joystick button index */
263 Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ 272 Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
264 } SDL_JoyButtonEvent; 273 } SDL_JoyButtonEvent;
274
275 /**
276 * \struct SDL_TouchEvent
277 *
278 * \brief Touchscreen motion event structure (event.touch.*)
279 */
280 typedef struct SDL_TouchEvent
281 {
282 Uint8 type; /**< SDL_TOUCHMOTION, SDL_TOUCHPRESS, SDL_TOUCHRELEASED */
283 Uint8 which; /**< The touchscreen device index */
284 int point; /**< The touch point index, relevant for multitouch. */
285 int xpos; /**< The X coordinate of the touch point. */
286 int ypos; /**< The Y coordinate of the touch point. */
287 int pressure; /**< The pressure of the touch */
288 } SDL_TouchEvent;
265 289
266 /** 290 /**
267 * \struct SDL_QuitEvent 291 * \struct SDL_QuitEvent
268 * 292 *
269 * \brief The "quit requested" event 293 * \brief The "quit requested" event
332 SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */ 356 SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */
333 SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ 357 SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */
334 SDL_JoyBallEvent jball; /**< Joystick ball event data */ 358 SDL_JoyBallEvent jball; /**< Joystick ball event data */
335 SDL_JoyHatEvent jhat; /**< Joystick hat event data */ 359 SDL_JoyHatEvent jhat; /**< Joystick hat event data */
336 SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ 360 SDL_JoyButtonEvent jbutton; /**< Joystick button event data */
361 SDL_TouchEvent touch; /**< Touchscreen event data */
337 SDL_QuitEvent quit; /**< Quit request event data */ 362 SDL_QuitEvent quit; /**< Quit request event data */
338 SDL_UserEvent user; /**< Custom event data */ 363 SDL_UserEvent user; /**< Custom event data */
339 SDL_SysWMEvent syswm; /**< System dependent window event data */ 364 SDL_SysWMEvent syswm; /**< System dependent window event data */
340 365
341 /* Temporarily here for backwards compatibility */ 366 /* Temporarily here for backwards compatibility */