The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Namespaces | Macros | Functions
dispatcher_private.hpp File Reference
#include "gui/core/event/dispatcher.hpp"
#include "gui/widgets/widget.hpp"
#include "utils/type_trait_aliases.hpp"
#include <SDL_events.h>
#include <boost/mpl/for_each.hpp>
#include <boost/range/adaptor/reversed.hpp>
Include dependency graph for dispatcher_private.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  gui2::event::dispatcher_implementation
 
class  gui2::event::dispatcher_implementation::has_handler
 A helper class to find out whether dispatcher has an handler for a certain event. More...
 
struct  gui2::event::implementation::find< done >
 Specialized class when itor == end. More...
 
struct  gui2::event::implementation::find< false >
 Specialized class when itor != end. More...
 

Namespaces

 gui2
 Generic file dialog.
 
 gui2::event
 
 gui2::event::implementation
 Contains the implementation details of the find function.
 

Macros

#define IMPLEMENT_EVENT_SIGNAL(SET, FUNCTION, QUEUE)
 Helper macro to implement the various event_signal functions. More...
 
#define IMPLEMENT_EVENT_SIGNAL_WRAPPER(TYPE)
 Small helper macro to wrap IMPLEMENT_EVENT_SIGNAL. More...
 

Functions

template<typename sequence , typename E , typename F >
bool gui2::event::find (E event, F functor)
 Tests whether an event handler is available. More...
 
template<typename T >
std::vector< std::pair< widget
*, ui_event > > 
gui2::event::implementation::build_event_chain (const ui_event event, widget *dispatcher, widget *w)
 Build the event chain. More...
 
template<>
std::vector< std::pair< widget
*, ui_event > > 
gui2::event::implementation::build_event_chain< signal_notification_function > (const ui_event event, widget *dispatcher, widget *w)
 Build the event chain for signal_notification_function. More...
 
template<>
std::vector< std::pair< widget
*, ui_event > > 
gui2::event::implementation::build_event_chain< signal_message_function > (const ui_event event, widget *dispatcher, widget *w)
 Build the event chain for signal_message_function. More...
 
template<typename T , typename... F>
bool gui2::event::implementation::fire_event (const ui_event event, std::vector< std::pair< widget *, ui_event >> &event_chain, widget *dispatcher, widget *w, F &&...params)
 Helper function for fire_event. More...
 
template<typename T , typename... F>
bool gui2::event::fire_event (const ui_event event, dispatcher *d, widget *w, F &&...params)
 Fires an event. More...
 
template<ui_event click, ui_event double_click, bool(event_executor::*)() const wants_double_click, typename T , typename... F>
bool gui2::event::fire_event_double_click (dispatcher *dsp, widget *wgt, F &&...params)
 

Macro Definition Documentation

#define IMPLEMENT_EVENT_SIGNAL (   SET,
  FUNCTION,
  QUEUE 
)

Helper macro to implement the various event_signal functions.

Implements two helper functions as documented in the macro.

Parameters
SETThe set in which the event type needs to be eg the gui2::event::set_event or a similar set defined in that header.
FUNCTIONThe function signature to validate the implementation function SFINAE against eg the gui2::event::signal_function or another one in that header.
QUEUEThe queue in which the event is slotted.

Definition at line 49 of file dispatcher_private.hpp.

#define IMPLEMENT_EVENT_SIGNAL_WRAPPER (   TYPE)
Value:
signal_##TYPE##_function, \
signal_##TYPE##_queue_)
TYPE
UNSCALED : image will be drawn "as is" without changing size, even in case of redraw SCALED_TO_ZOOM :...
Definition: image.hpp:189
#define IMPLEMENT_EVENT_SIGNAL(SET, FUNCTION, QUEUE)
Helper macro to implement the various event_signal functions.

Small helper macro to wrap IMPLEMENT_EVENT_SIGNAL.

Since the parameters to IMPLEMENT_EVENT_SIGNAL use the same parameters with a slight difference per type this macro wraps the function by its type.

Parameters
TYPEThe type to wrap for IMPLEMENT_EVENT_SIGNAL.

Definition at line 102 of file dispatcher_private.hpp.