The Battle for Wesnoth  1.15.0-dev
Classes | Namespaces | Typedefs | Functions
dispatcher.hpp File Reference
#include "gui/core/event/handler.hpp"
#include "hotkey/hotkey_command.hpp"
#include "utils/functional.hpp"
#include <SDL_events.h>
#include <list>
#include <map>
#include <type_traits>
Include dependency graph for dispatcher.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  gui2::event::dispatcher
 Base class for event handling. More...
 
struct  gui2::event::dispatcher::signal_type< T >
 Helper struct to generate the various signal types. More...
 
struct  gui2::event::dispatcher::signal_queue< T >
 Helper struct to generate the various event queues. More...
 

Namespaces

 gui2
 Generic file dialog.
 
 gui2::event
 

Typedefs

template<typename... T>
using gui2::event::dispatcher_callback_func = std::function< void(widget &, const ui_event, bool &, bool &, T...)>
 Callback function signature alias template. More...
 
using gui2::event::signal_function = dispatcher_callback_func<>
 Callback function signature. More...
 
using gui2::event::signal_mouse_function = dispatcher_callback_func< const point & >
 Callback function signature. More...
 
using gui2::event::signal_keyboard_function = dispatcher_callback_func< const SDL_Keycode, const SDL_Keymod, const std::string & >
 Callback function signature. More...
 
using gui2::event::signal_touch_function = dispatcher_callback_func< const point &, const point & >
 Callback function signature. More...
 
using gui2::event::signal_notification_function = dispatcher_callback_func< void * >
 Callback function signature. More...
 
using gui2::event::signal_message_function = dispatcher_callback_func< const message & >
 Callback function signature. More...
 
using gui2::event::signal_raw_event_function = dispatcher_callback_func< const SDL_Event & >
 Raw event callback function signature. More...
 
using gui2::event::signal_text_input_function = dispatcher_callback_func< const std::string &, int32_t, int32_t >
 Callback function signature. More...
 
using gui2::event::hotkey_function = std::function< void(widget &dispatcher, hotkey::HOTKEY_COMMAND id)>
 Hotkey function handler signature. More...
 

Functions

constexpr bool gui2::event::is_general_event (const ui_event event)
 Helper for catching use error of dispatcher::connect_signal. More...
 
constexpr bool gui2::event::is_mouse_event (const ui_event event)
 Helper for catching use error of dispatcher::connect_signal. More...
 
constexpr bool gui2::event::is_keyboard_event (const ui_event event)
 Helper for catching use error of dispatcher::connect_signal. More...
 
constexpr bool gui2::event::is_touch_event (const ui_event event)
 Helper for catching use error of dispatcher::connect_signal. More...
 
constexpr bool gui2::event::is_notification_event (const ui_event event)
 Helper for catching use error of dispatcher::connect_signal. More...
 
constexpr bool gui2::event::is_message_event (const ui_event event)
 Helper for catching use error of dispatcher::connect_signal. More...
 
constexpr bool gui2::event::is_raw_event_event (const ui_event event)
 Helper for catching use error of dispatcher::connect_signal. More...
 
constexpr bool gui2::event::is_text_input_event (const ui_event event)
 Helper for catching use error of dispatcher::connect_signal. More...
 
void gui2::event::connect_signal_pre_key_press (dispatcher &dispatcher, const signal_keyboard_function &signal)
 Connects the signal for 'snooping' on the keypress. More...
 
void gui2::event::connect_signal_mouse_left_click (dispatcher &dispatcher, const signal_function &signal)
 Connects a signal handler for a left mouse button click. More...
 
void gui2::event::disconnect_signal_mouse_left_click (dispatcher &dispatcher, const signal_function &signal)
 Disconnects a signal handler for a left mouse button click. More...
 
void gui2::event::connect_signal_mouse_left_double_click (dispatcher &dispatcher, const signal_function &signal)
 Connects a signal handler for a left mouse button double click. More...
 
void gui2::event::connect_signal_notify_modified (dispatcher &dispatcher, const signal_notification_function &signal)
 Connects a signal handler for getting a notification upon modification. More...
 
void gui2::event::connect_signal_on_draw (dispatcher &dispatcher, const signal_function &signal)
 Connects a signal handler for a callback when the widget is drawn. More...