SDL++
C++wrapperfortheSDLlibrary.
|
00001 00021 #ifndef SDL_EVENT_WINDOWEVENTS_H 00022 #define SDL_EVENT_WINDOWEVENTS_H 00023 00024 #include <SDL.h> 00025 00026 #include "sdlpp/event/SimpleComparator.h" 00027 00028 namespace sdl { 00029 namespace event { 00034 struct ActiveBase : public EventBase { 00040 ActiveBase (const SDL_Event* event) : EventBase (event) {}; 00041 00047 const SDL_ActiveEvent& get () const { return event_->active; }; 00048 00054 const SDL_ActiveEvent& get () { return event_->active; }; 00055 }; //Active 00056 00061 typedef Event<SimpleComparator<SDL_ACTIVEEVENT>, ActiveBase> Active; 00062 00067 struct ExposeBase : public EventBase { 00073 ExposeBase (const SDL_Event* event) : EventBase (event) {}; 00074 00080 const SDL_ExposeEvent& get () const { return event_->expose; }; 00081 00087 const SDL_ExposeEvent& get () { return event_->expose; }; 00088 }; //Expose 00089 00094 typedef Event<SimpleComparator<SDL_VIDEOEXPOSE>, ExposeBase> Expose; 00095 00100 struct QuitBase : public EventBase { 00106 QuitBase (const SDL_Event* event) : EventBase (event) {}; 00107 00113 const SDL_QuitEvent& get () const { return event_->quit; }; 00114 00120 const SDL_QuitEvent& get () { return event_->quit; }; 00121 }; //Quit 00122 00127 typedef Event<SimpleComparator<SDL_QUIT>, QuitBase> Quit; 00128 00133 struct ResizeBase : public EventBase { 00139 ResizeBase (const SDL_Event* event) : EventBase (event) {}; 00140 00146 const SDL_ResizeEvent& get () const { return event_->resize; }; 00147 00153 const SDL_ResizeEvent& get () { return event_->resize; }; 00154 }; //Resize 00155 00160 typedef Event<SimpleComparator<SDL_VIDEORESIZE>, ResizeBase> Resize; 00161 00166 struct WindowManagerBase : public EventBase { 00172 WindowManagerBase (const SDL_Event* event) : EventBase (event) {}; 00173 00179 const SDL_SysWMEvent& get () const { return event_->syswm; }; 00180 00186 const SDL_SysWMEvent& get () { return event_->syswm; }; 00187 }; //WindowManager 00188 00193 typedef Event<SimpleComparator<SDL_SYSWMEVENT>, WindowManagerBase> WindowManager; 00194 }; //event 00195 }; //sdl 00196 00197 #endif //SDL_EVENT_WINDOWEVENTS_H 00198