comparison include/SDL_events.h @ 337:9154ec9ca3d2

Explicitly specify the SDL API calling convention (C by default)
author Sam Lantinga <slouken@libsdl.org>
date Thu, 11 Apr 2002 14:35:16 +0000
parents f6ffac90895c
children f7596a8a3b8b
comparison
equal deleted inserted replaced
336:745873ea091f 337:9154ec9ca3d2
236 236
237 /* Pumps the event loop, gathering events from the input devices. 237 /* Pumps the event loop, gathering events from the input devices.
238 This function updates the event queue and internal input device state. 238 This function updates the event queue and internal input device state.
239 This should only be run in the thread that sets the video mode. 239 This should only be run in the thread that sets the video mode.
240 */ 240 */
241 extern DECLSPEC void SDL_PumpEvents(void); 241 extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
242 242
243 /* Checks the event queue for messages and optionally returns them. 243 /* Checks the event queue for messages and optionally returns them.
244 If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to 244 If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to
245 the back of the event queue. 245 the back of the event queue.
246 If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front 246 If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front
256 SDL_ADDEVENT, 256 SDL_ADDEVENT,
257 SDL_PEEKEVENT, 257 SDL_PEEKEVENT,
258 SDL_GETEVENT 258 SDL_GETEVENT
259 } SDL_eventaction; 259 } SDL_eventaction;
260 /* */ 260 /* */
261 extern DECLSPEC int SDL_PeepEvents(SDL_Event *events, int numevents, 261 extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents,
262 SDL_eventaction action, Uint32 mask); 262 SDL_eventaction action, Uint32 mask);
263 263
264 /* Polls for currently pending events, and returns 1 if there are any pending 264 /* Polls for currently pending events, and returns 1 if there are any pending
265 events, or 0 if there are none available. If 'event' is not NULL, the next 265 events, or 0 if there are none available. If 'event' is not NULL, the next
266 event is removed from the queue and stored in that area. 266 event is removed from the queue and stored in that area.
267 */ 267 */
268 extern DECLSPEC int SDL_PollEvent(SDL_Event *event); 268 extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event *event);
269 269
270 /* Waits indefinitely for the next available event, returning 1, or 0 if there 270 /* Waits indefinitely for the next available event, returning 1, or 0 if there
271 was an error while waiting for events. If 'event' is not NULL, the next 271 was an error while waiting for events. If 'event' is not NULL, the next
272 event is removed from the queue and stored in that area. 272 event is removed from the queue and stored in that area.
273 */ 273 */
274 extern DECLSPEC int SDL_WaitEvent(SDL_Event *event); 274 extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event *event);
275 275
276 /* Add an event to the event queue. 276 /* Add an event to the event queue.
277 This function returns 0 if the event queue was full, or -1 277 This function returns 0 if the event queue was full, or -1
278 if there was some other error. Returns 1 on success. 278 if there was some other error. Returns 1 on success.
279 */ 279 */
280 extern DECLSPEC int SDL_PushEvent(SDL_Event *event); 280 extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event);
281 281
282 /* 282 /*
283 This function sets up a filter to process all events before they 283 This function sets up a filter to process all events before they
284 change internal state and are posted to the internal event queue. 284 change internal state and are posted to the internal event queue.
285 285
300 application window. If the event filter returns 1, then the window will 300 application window. If the event filter returns 1, then the window will
301 be closed, otherwise the window will remain open if possible. 301 be closed, otherwise the window will remain open if possible.
302 If the quit event is generated by an interrupt signal, it will bypass the 302 If the quit event is generated by an interrupt signal, it will bypass the
303 internal queue and be delivered to the application at the next event poll. 303 internal queue and be delivered to the application at the next event poll.
304 */ 304 */
305 extern DECLSPEC void SDL_SetEventFilter(SDL_EventFilter filter); 305 extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter);
306 306
307 /* 307 /*
308 Return the current event filter - can be used to "chain" filters. 308 Return the current event filter - can be used to "chain" filters.
309 If there is no event filter set, this function returns NULL. 309 If there is no event filter set, this function returns NULL.
310 */ 310 */
311 extern DECLSPEC SDL_EventFilter SDL_GetEventFilter(void); 311 extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void);
312 312
313 /* 313 /*
314 This function allows you to set the state of processing certain events. 314 This function allows you to set the state of processing certain events.
315 If 'state' is set to SDL_IGNORE, that event will be automatically dropped 315 If 'state' is set to SDL_IGNORE, that event will be automatically dropped
316 from the event queue and will not event be filtered. 316 from the event queue and will not event be filtered.
320 */ 320 */
321 #define SDL_QUERY -1 321 #define SDL_QUERY -1
322 #define SDL_IGNORE 0 322 #define SDL_IGNORE 0
323 #define SDL_DISABLE 0 323 #define SDL_DISABLE 0
324 #define SDL_ENABLE 1 324 #define SDL_ENABLE 1
325 extern DECLSPEC Uint8 SDL_EventState(Uint8 type, int state); 325 extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state);
326 326
327 327
328 /* Ends C function definitions when using C++ */ 328 /* Ends C function definitions when using C++ */
329 #ifdef __cplusplus 329 #ifdef __cplusplus
330 } 330 }