diff include/SDL_events.h @ 1722:5daa04d862f1 SDL-1.3

Added a userdata parameter for event filters. Added a function to filter the existing queued events. Added explicit support for relative mouse mode to the API.
author Sam Lantinga <slouken@libsdl.org>
date Fri, 30 Jun 2006 08:18:44 +0000
parents 8d7fecceb9ef
children 6c63fc2bd986
line wrap: on
line diff
--- a/include/SDL_events.h	Fri Jun 30 05:50:35 2006 +0000
+++ b/include/SDL_events.h	Fri Jun 30 08:18:44 2006 +0000
@@ -377,7 +377,7 @@
 
   The filter is protypted as:
 */
-typedef int (SDLCALL * SDL_EventFilter) (SDL_Event * event);
+typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
 /*
   If the filter returns 1, then the event will be added to the internal queue.
   If it returns 0, then the event will be dropped from the queue, but the 
@@ -394,13 +394,21 @@
   If the quit event is generated by an interrupt signal, it will bypass the
   internal queue and be delivered to the application at the next event poll.
 */
-extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter);
+extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter,
+                                                void *userdata);
 
 /*
   Return the current event filter - can be used to "chain" filters.
   If there is no event filter set, this function returns NULL.
 */
-extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void);
+extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void **userdata);
+
+/*
+  Run the filter function on the current event queue, removing any
+  events for which the filter returns 0.
+*/
+extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter,
+                                              void *userdata);
 
 /*
   This function allows you to set the state of processing certain events.