15 #define GETTEXT_DOMAIN "wesnoth-lib"
30 : mouse_behavior_(all)
31 , want_keyboard_input_(true)
33 , signal_mouse_queue_()
34 , signal_keyboard_queue_()
35 , signal_notification_queue_()
36 , signal_message_queue_()
60 std::cerr <<
"Event '" <<
event
66 ::thas_handler(event_type, *
this))
69 ::thas_handler(event_type, *
this))
72 ::thas_handler(event_type, *
this))
75 ::thas_handler(event_type, *
this))
79 return find<tset_event>(
82 || find<tset_event_mouse>(event,
85 || find<tset_event_keyboard>(
89 || find<tset_event_notification>(
93 || find<tset_event_message>(event,
140 functor(dispatcher, event, handled, halt);
173 return fire_event<tsignal_function>(
203 return fire_event<tsignal_mouse_function>(
event,
242 return fire_event<tsignal_keyboard_function>(
259 functor(dispatcher, event, handled, halt,
nullptr);
265 assert(find<tset_event_notification>(event,
tevent_in_set()));
266 return fire_event<tsignal_notification_function>(
297 return fire_event<tsignal_message_function>(
event,
318 return itor->second(*
this,
id);
Define the common log macros for the gui toolkit.
void operator()(tsignal_function functor, tdispatcher &dispatcher, const tevent event, bool &handled, bool &halt)
Helper struct to wrap the functor call.
See LEFT_BUTTON_DOUBLE_CLICK.
A left mouse button double click event for a widget.
void operator()(tsignal_keyboard_function functor, tdispatcher &dispatcher, const tevent event, bool &handled, bool &halt)
itor second functor(surf, f[1])
Helper class to do a runtime test whether an event is in a set.
ttrigger_keyboard(const SDLKey key, const SDLMod modifier, const utf8::string &unicode)
void register_hotkey(const hotkey::HOTKEY_COMMAND id, const thotkey_function &function)
Registers a hotkey.
std::function< bool(tdispatcher &dispatcher, hotkey::HOTKEY_COMMAND id)> thotkey_function
Hotkey function handler signature.
Base class for event handling.
std::function< void(tdispatcher &dispatcher, const tevent event, bool &handled, bool &halt, const SDLKey key, const SDLMod modifier, const utf8::string &unicode)> tsignal_keyboard_function
Callback function signature.
bool connected_
Are we connected to the event handler.
bool wants_mouse_middle_double_click() const
A left mouse button click event for a widget.
std::map< hotkey::HOTKEY_COMMAND, thotkey_function > hotkeys_
The registered hotkeys for this dispatcher.
A class inherited from ttext_box that displays its input as stars.
std::function< void(tdispatcher &dispatcher, const tevent event, bool &handled, bool &halt, tmessage &message)> tsignal_message_function
Callback function signature.
void operator()(tsignal_mouse_function functor, tdispatcher &dispatcher, const tevent event, bool &handled, bool &halt)
bool wants_mouse_left_double_click() const
See LEFT_BUTTON_DOUBLE_CLICK.
bool oper(tevent)
If found we get executed to set the result.
std::function< void(tdispatcher &dispatcher, const tevent event, bool &handled, bool &halt, const tpoint &coordinate)> tsignal_mouse_function
Callback function signature.
Helper struct to wrap the functor call.
bool fire(const tevent event, twidget &target)
Fires an event which has no extra parameters.
bool execute_hotkey(const hotkey::HOTKEY_COMMAND id)
Executes a hotkey.
void connect()
Connects the dispatcher to the event handler.
ttrigger_mouse(const tpoint &coordinate)
void operator()(tsignal_notification_function functor, tdispatcher &dispatcher, const tevent event, bool &handled, bool &halt)
std::function< void(tdispatcher &dispatcher, const tevent event, bool &handled, bool &halt)> tsignal_function
Callback function signature.
bool fire_event_double_click(twidget *dispatcher, twidget *widget, F functor)
Helper struct to wrap the functor call.
static size_t id
Ids for the timers.
tevent
The event send to the dispatcher.
void operator()(tsignal_message_function functor, tdispatcher &dispatcher, const tevent event, bool &handled, bool &halt)
Helper struct to wrap the functor call.
A helper class to find out whether dispatcher has an handler for a certain event. ...
std::map< std::string, tfilter >::iterator itor
void connect_dispatcher(tdispatcher *dispatcher)
Connects a dispatcher to the event handler.
The message callbacks hold a reference to a message.
std::function< void(tdispatcher &dispatcher, const tevent event, bool &handled, bool &halt, void *)> tsignal_notification_function
Callback function signature.
ttrigger_message(tmessage &message)
bool has_event(const tevent event, const tevent_type event_type)
Helper struct to wrap the functor call.
void disconnect_dispatcher(tdispatcher *dispatcher)
Disconnects a dispatcher to the event handler.
GLsizei GLenum GLuint GLuint GLsizei char * message
bool wants_mouse_right_double_click() const