The Battle for Wesnoth  1.19.7+dev
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 <chrono>
#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
 
class  gui2::event::mouse_button< I >
 
class  gui2::event::distributor
 The event handler class for the widget library. More...
 

Namespaces

 gui2
 Generic file dialog.
 
 gui2::event
 

Typedefs

using gui2::event::mouse_button_left = mouse_button< 0 >
 
using gui2::event::mouse_button_middle = mouse_button< 1 >
 
using gui2::event::mouse_button_right = mouse_button< 2 >
 

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.