diff include/SDL_compat.h @ 4429:faa9fc8e7f67

General improvements for user custom event registration * Switched event type to enum (int32) * Switched polling by mask to polling by type range * Added SDL_RegisterEvents() to allow dynamic user event registration * Spread events out to allow inserting new related events without breaking binary compatibility * Added padding to event structures so they're the same size regardless of 32-bit compiler structure packing settings * Split SDL_HasEvent() to SDL_HasEvent() for a single event and SDL_HasEvents() for a range of events * Added SDL_GetEventState() as a shortcut for SDL_EventState(X, SDL_QUERY) * Added SDL_FlushEvent() and SDL_FlushEvents() to clear events from the event queue
author Sam Lantinga <slouken@libsdl.org>
date Thu, 25 Mar 2010 01:08:26 -0700
parents a3e71b957215
children 82f357a91d43
line wrap: on
line diff
--- a/include/SDL_compat.h	Wed Mar 10 15:07:20 2010 +0000
+++ b/include/SDL_compat.h	Thu Mar 25 01:08:26 2010 -0700
@@ -91,12 +91,34 @@
 #define SDL_LOGPAL 0x01
 #define SDL_PHYSPAL 0x02
 
-#define SDL_ACTIVEEVENT	SDL_EVENT_RESERVED1
-#define SDL_VIDEORESIZE	SDL_EVENT_RESERVED2
-#define SDL_VIDEOEXPOSE	SDL_EVENT_RESERVED3
-#define SDL_ACTIVEEVENTMASK	SDL_EVENTMASK(SDL_ACTIVEEVENT)
-#define SDL_VIDEORESIZEMASK SDL_EVENTMASK(SDL_VIDEORESIZE)
-#define SDL_VIDEOEXPOSEMASK SDL_EVENTMASK(SDL_VIDEOEXPOSE)
+#define SDL_ACTIVEEVENT	SDL_EVENT_COMPAT1
+#define SDL_VIDEORESIZE	SDL_EVENT_COMPAT2
+#define SDL_VIDEOEXPOSE	SDL_EVENT_COMPAT3
+#define SDL_ACTIVEEVENTMASK	SDL_ACTIVEEVENT, SDL_ACTIVEEVENT
+#define SDL_VIDEORESIZEMASK SDL_VIDEORESIZE, SDL_VIDEORESIZE
+#define SDL_VIDEOEXPOSEMASK SDL_VIDEOEXPOSE, SDL_VIDEOEXPOSE
+#define SDL_WINDOWEVENTMASK SDL_WINDOWEVENT, SDL_WINDOWEVENT
+#define SDL_KEYDOWNMASK SDL_KEYDOWN, SDL_KEYDOWN
+#define SDL_KEYUPMASK SDL_KEYUP, SDL_KEYUP
+#define SDL_KEYEVENTMASK SDL_KEYDOWN, SDL_KEYUP
+#define SDL_TEXTEDITINGMASK SDL_TEXTEDITING, SDL_TEXTEDITING
+#define SDL_TEXTINPUTMASK SDL_TEXTINPUT, SDL_TEXTINPUT
+#define SDL_MOUSEMOTIONMASK SDL_MOUSEMOTION, SDL_MOUSEMOTION
+#define SDL_MOUSEBUTTONDOWNMASK SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONDOWN
+#define SDL_MOUSEBUTTONUPMASK SDL_MOUSEBUTTONUP, SDL_MOUSEBUTTONUP
+#define SDL_MOUSEWHEELMASK SDL_MOUSEWHEEL, SDL_MOUSEWHEEL
+#define SDL_MOUSEEVENTMASK SDL_MOUSEMOTION, SDL_MOUSEBUTTONUP
+#define SDL_JOYAXISMOTIONMASK SDL_JOYAXISMOTION, SDL_JOYAXISMOTION
+#define SDL_JOYBALLMOTIONMASK SDL_JOYBALLMOTION, SDL_JOYBALLMOTION
+#define SDL_JOYHATMOTIONMASK SDL_JOYHATMOTION, SDL_JOYHATMOTION
+#define SDL_JOYBUTTONDOWNMASK SDL_JOYBUTTONDOWN, SDL_JOYBUTTONDOWN
+#define SDL_JOYBUTTONUPMASK SDL_JOYBUTTONUP, SDL_JOYBUTTONUP
+#define SDL_JOYEVENTMASK SDL_JOYAXISMOTION, SDL_JOYBUTTONUP
+#define SDL_QUITMASK SDL_QUIT, SDL_QUIT
+#define SDL_SYSWMEVENTMASK SDL_SYSWMEVENT, SDL_SYSWMEVENT
+#define SDL_PROXIMITYINMASK SDL_PROXIMITYIN, SDL_PROXIMITYIN
+#define SDL_PROXIMITYOUTMASK SDL_PROXIMITYOUT, SDL_PROXIMITYOUT
+#define SDL_ALLEVENTS SDL_FIRSTEVENT, SDL_LASTEVENT
 
 #define SDL_BUTTON_WHEELUP	4
 #define SDL_BUTTON_WHEELDOWN	5