comparison include/SDL_events.h @ 1668:4da1ee79c9af SDL-1.3

more tweaking indent options
author Sam Lantinga <slouken@libsdl.org>
date Mon, 29 May 2006 04:04:35 +0000
parents 782fd950bd46
children 9857d21967bb
comparison
equal deleted inserted replaced
1667:1fddae038bc8 1668:4da1ee79c9af
87 * \brief Predefined event masks 87 * \brief Predefined event masks
88 */ 88 */
89 #define SDL_EVENTMASK(X) (1<<(X)) 89 #define SDL_EVENTMASK(X) (1<<(X))
90 typedef enum 90 typedef enum
91 { 91 {
92 SDL_WINDOWEVENTMASK = SDL_EVENTMASK (SDL_WINDOWEVENT), 92 SDL_WINDOWEVENTMASK = SDL_EVENTMASK(SDL_WINDOWEVENT),
93 SDL_KEYDOWNMASK = SDL_EVENTMASK (SDL_KEYDOWN), 93 SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN),
94 SDL_KEYUPMASK = SDL_EVENTMASK (SDL_KEYUP), 94 SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP),
95 SDL_KEYEVENTMASK = SDL_EVENTMASK (SDL_KEYDOWN) | 95 SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN) | SDL_EVENTMASK(SDL_KEYUP),
96 SDL_EVENTMASK (SDL_KEYUP), 96 SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION),
97 SDL_MOUSEMOTIONMASK = SDL_EVENTMASK (SDL_MOUSEMOTION), 97 SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
98 SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK (SDL_MOUSEBUTTONDOWN), 98 SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
99 SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK (SDL_MOUSEBUTTONUP), 99 SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION) |
100 SDL_MOUSEEVENTMASK = SDL_EVENTMASK (SDL_MOUSEMOTION) | 100 SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN) | SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
101 SDL_EVENTMASK (SDL_MOUSEBUTTONDOWN) | 101 SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION),
102 SDL_EVENTMASK (SDL_MOUSEBUTTONUP), 102 SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION),
103 SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK (SDL_JOYAXISMOTION), 103 SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION),
104 SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK (SDL_JOYBALLMOTION), 104 SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN),
105 SDL_JOYHATMOTIONMASK = SDL_EVENTMASK (SDL_JOYHATMOTION), 105 SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP),
106 SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK (SDL_JOYBUTTONDOWN), 106 SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION) |
107 SDL_JOYBUTTONUPMASK = SDL_EVENTMASK (SDL_JOYBUTTONUP), 107 SDL_EVENTMASK(SDL_JOYBALLMOTION) |
108 SDL_JOYEVENTMASK = SDL_EVENTMASK (SDL_JOYAXISMOTION) | 108 SDL_EVENTMASK(SDL_JOYHATMOTION) |
109 SDL_EVENTMASK (SDL_JOYBALLMOTION) | 109 SDL_EVENTMASK(SDL_JOYBUTTONDOWN) | SDL_EVENTMASK(SDL_JOYBUTTONUP),
110 SDL_EVENTMASK (SDL_JOYHATMOTION) | 110 SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT),
111 SDL_EVENTMASK (SDL_JOYBUTTONDOWN) | SDL_EVENTMASK (SDL_JOYBUTTONUP), 111 SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT)
112 SDL_QUITMASK = SDL_EVENTMASK (SDL_QUIT),
113 SDL_SYSWMEVENTMASK = SDL_EVENTMASK (SDL_SYSWMEVENT)
114 } SDL_EventMask; 112 } SDL_EventMask;
115 #define SDL_ALLEVENTS 0xFFFFFFFF 113 #define SDL_ALLEVENTS 0xFFFFFFFF
116 114
117 /** 115 /**
118 * \struct SDL_WindowEvent 116 * \struct SDL_WindowEvent
297 295
298 /* Pumps the event loop, gathering events from the input devices. 296 /* Pumps the event loop, gathering events from the input devices.
299 This function updates the event queue and internal input device state. 297 This function updates the event queue and internal input device state.
300 This should only be run in the thread that sets the video mode. 298 This should only be run in the thread that sets the video mode.
301 */ 299 */
302 extern DECLSPEC void SDLCALL SDL_PumpEvents (void); 300 extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
303 301
304 /* Checks the event queue for messages and optionally returns them. 302 /* Checks the event queue for messages and optionally returns them.
305 If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to 303 If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to
306 the back of the event queue. 304 the back of the event queue.
307 If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front 305 If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front
318 SDL_ADDEVENT, 316 SDL_ADDEVENT,
319 SDL_PEEKEVENT, 317 SDL_PEEKEVENT,
320 SDL_GETEVENT 318 SDL_GETEVENT
321 } SDL_eventaction; 319 } SDL_eventaction;
322 /* */ 320 /* */
323 extern DECLSPEC int SDLCALL SDL_PeepEvents (SDL_Event * events, int numevents, 321 extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents,
324 SDL_eventaction action, 322 SDL_eventaction action,
325 Uint32 mask); 323 Uint32 mask);
326 324
327 /* Polls for currently pending events, and returns 1 if there are any pending 325 /* Polls for currently pending events, and returns 1 if there are any pending
328 events, or 0 if there are none available. If 'event' is not NULL, the next 326 events, or 0 if there are none available. If 'event' is not NULL, the next
329 event is removed from the queue and stored in that area. 327 event is removed from the queue and stored in that area.
330 */ 328 */
331 extern DECLSPEC int SDLCALL SDL_PollEvent (SDL_Event * event); 329 extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event);
332 330
333 /* Waits indefinitely for the next available event, returning 1, or 0 if there 331 /* Waits indefinitely for the next available event, returning 1, or 0 if there
334 was an error while waiting for events. If 'event' is not NULL, the next 332 was an error while waiting for events. If 'event' is not NULL, the next
335 event is removed from the queue and stored in that area. 333 event is removed from the queue and stored in that area.
336 */ 334 */
337 extern DECLSPEC int SDLCALL SDL_WaitEvent (SDL_Event * event); 335 extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event);
338 336
339 /* Add an event to the event queue. 337 /* Add an event to the event queue.
340 This function returns 0 on success, or -1 if the event queue was full 338 This function returns 0 on success, or -1 if the event queue was full
341 or there was some other error. 339 or there was some other error.
342 */ 340 */
343 extern DECLSPEC int SDLCALL SDL_PushEvent (SDL_Event * event); 341 extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event);
344 342
345 /* 343 /*
346 This function sets up a filter to process all events before they 344 This function sets up a filter to process all events before they
347 change internal state and are posted to the internal event queue. 345 change internal state and are posted to the internal event queue.
348 346
363 application window. If the event filter returns 1, then the window will 361 application window. If the event filter returns 1, then the window will
364 be closed, otherwise the window will remain open if possible. 362 be closed, otherwise the window will remain open if possible.
365 If the quit event is generated by an interrupt signal, it will bypass the 363 If the quit event is generated by an interrupt signal, it will bypass the
366 internal queue and be delivered to the application at the next event poll. 364 internal queue and be delivered to the application at the next event poll.
367 */ 365 */
368 extern DECLSPEC void SDLCALL SDL_SetEventFilter (SDL_EventFilter filter); 366 extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter);
369 367
370 /* 368 /*
371 Return the current event filter - can be used to "chain" filters. 369 Return the current event filter - can be used to "chain" filters.
372 If there is no event filter set, this function returns NULL. 370 If there is no event filter set, this function returns NULL.
373 */ 371 */
374 extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter (void); 372 extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void);
375 373
376 /* 374 /*
377 This function allows you to set the state of processing certain events. 375 This function allows you to set the state of processing certain events.
378 If 'state' is set to SDL_IGNORE, that event will be automatically dropped 376 If 'state' is set to SDL_IGNORE, that event will be automatically dropped
379 from the event queue and will not event be filtered. 377 from the event queue and will not event be filtered.
383 */ 381 */
384 #define SDL_QUERY -1 382 #define SDL_QUERY -1
385 #define SDL_IGNORE 0 383 #define SDL_IGNORE 0
386 #define SDL_DISABLE 0 384 #define SDL_DISABLE 0
387 #define SDL_ENABLE 1 385 #define SDL_ENABLE 1
388 extern DECLSPEC Uint8 SDLCALL SDL_EventState (Uint8 type, int state); 386 extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state);
389 387
390 388
391 /* Ends C function definitions when using C++ */ 389 /* Ends C function definitions when using C++ */
392 #ifdef __cplusplus 390 #ifdef __cplusplus
393 /* *INDENT-OFF* */ 391 /* *INDENT-OFF* */