The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Namespaces | Typedefs
distributor.hpp File Reference

Contains the event distributor. More...

#include "gui/core/event/dispatcher.hpp"
#include "gui/core/event/handler.hpp"
#include "sdl/point.hpp"
#include "serialization/unicode_types.hpp"
#include "video.hpp"
#include <string>
#include <vector>
Include dependency graph for distributor.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  gui2::event::mouse_motion
 
struct  gui2::event::mouse_button_event_types_wrapper< sdl_button_down, sdl_button_up, button_down, button_up, button_click, button_double_click >
 Small helper metastruct to specialize mouse_button with and provide ui_event type aliases without needing to make mouse_button take a million template types. More...
 
class  gui2::event::mouse_button< T >
 
class  gui2::event::distributor
 The event handler class for the widget library. More...
 
class  gui2::event::distributor::layer
 

Namespaces

 gui2
 Generic file dialog.
 
 gui2::event
 

Typedefs

using gui2::event::mouse_button_left = mouse_button< mouse_button_event_types_wrapper< SDL_LEFT_BUTTON_DOWN, SDL_LEFT_BUTTON_UP, LEFT_BUTTON_DOWN, LEFT_BUTTON_UP, LEFT_BUTTON_CLICK, LEFT_BUTTON_DOUBLE_CLICK > >
 
using gui2::event::mouse_button_middle = mouse_button< mouse_button_event_types_wrapper< SDL_MIDDLE_BUTTON_DOWN, SDL_MIDDLE_BUTTON_UP, MIDDLE_BUTTON_DOWN, MIDDLE_BUTTON_UP, MIDDLE_BUTTON_CLICK, MIDDLE_BUTTON_DOUBLE_CLICK > >
 
using gui2::event::mouse_button_right = mouse_button< mouse_button_event_types_wrapper< SDL_RIGHT_BUTTON_DOWN, SDL_RIGHT_BUTTON_UP, RIGHT_BUTTON_DOWN, RIGHT_BUTTON_UP, RIGHT_BUTTON_CLICK, RIGHT_BUTTON_DOUBLE_CLICK > >
 

Detailed Description

Contains the event distributor.

The event distributor exists of several classes which are combined in one templated distributor class. The classes are closely tight together.

All classes have direct access to each others members since they should act as one. (Since the buttons are a templated subclass it's not possible to use private subclasses.)

The mouse_motion class handles the mouse motion and holds the owner of us since all classes virtually inherit us.

The mouse_button classes are templated classes per mouse button, the template parameters are used to make the difference between the mouse buttons. Although it's easily possible to add more mouse buttons in the code several places only expect a left, middle and right button.

distributor is the main class to be used in the user code. This class contains the handling of the keyboard as well.

Definition in file distributor.hpp.