18 #include <SDL2/SDL_events.h>
24 #define DOUBLE_CLICK_EVENT SDL_USEREVENT
25 #define TIMER_EVENT (SDL_USEREVENT + 1)
26 #define HOVER_REMOVE_POPUP_EVENT (SDL_USEREVENT + 2)
27 #define DRAW_EVENT (SDL_USEREVENT + 3)
28 #define CLOSE_WINDOW_EVENT (SDL_USEREVENT + 4)
29 #define SHOW_HELPTIP_EVENT (SDL_USEREVENT + 5)
30 #define INVOKE_FUNCTION_EVENT (SDL_USEREVENT + 6)
111 return std::vector<sdl_handler*>();
175 bool is_input(
const SDL_Event& event);
void set_focus(const sdl_handler *ptr)
bool has_handler(const sdl_handler *ptr) const
Returns true if ptr is found in either the handlers or staging_handlers lists.
handler_list::iterator focused_handler
std::vector< sdl_handler * > staging_handlers
context(const context &)=delete
void add_handler(sdl_handler *ptr)
bool remove_handler(sdl_handler *ptr)
void add_staging_handlers()
virtual bool requires_event_focus(const SDL_Event *=nullptr) const
virtual void process_tooltip_string(int, int)
virtual void handle_window_event(const SDL_Event &)
virtual bool has_joined_global()
virtual bool has_joined()
virtual std::vector< sdl_handler * > handler_members()
virtual void handle_event(const SDL_Event &event)=0
virtual void process_event()
virtual void join_global()
virtual void join_same(sdl_handler *parent)
virtual void leave_global()
sdl_handler & operator=(sdl_handler &&)=delete
Moving would require two instances' context membership to be handled, it's simpler to delete these an...
sdl_handler(sdl_handler &&)=delete
std::vector< events::sdl_handler * > sdl_handler_vector
Handling of system events.
void raise_resize_event()
bool has_focus(const sdl_handler *hand, const SDL_Event *event)
void discard_input()
Discards all input events.
void draw()
Trigger a draw cycle.
bool is_input(const SDL_Event &event)
Is the event an input event?
void call_in_main_thread(const std::function< void(void)> &f)
void raise_process_event()
void process_tooltip_strings(int mousex, int mousey)
Triggered by mouse-motion, sends the cursor position to all handlers to check whether a tooltip shoul...
std::list< sdl_handler * > handler_list
void pump_and_draw()
pump() then immediately draw()
void pump()
Process all events currently in the queue.
void focus_handler(const sdl_handler *ptr)
std::string::const_iterator iterator