The Battle for Wesnoth  1.17.0-dev
Public Member Functions | List of all members
gui2::event::mouse_button_left Struct Reference

Three subclasses of mouse_button, so that the distributor class can inherit from them; C++ doesn't allow multiple inheritance to directly use more than one instance of a superclass. More...

#include <distributor.hpp>

Inheritance diagram for gui2::event::mouse_button_left:

Public Member Functions

 mouse_button_left (const mouse_button_event_types &events, widget &owner, const dispatcher::queue_position queue_position)
 
- Public Member Functions inherited from gui2::event::mouse_button
 mouse_button (const mouse_button_event_types &events, widget &owner, const dispatcher::queue_position queue_position)
 
void initialize_state (int32_t button_state)
 Initializes the state of the button. More...
 
- Public Member Functions inherited from gui2::event::mouse_motion
 mouse_motion (widget &owner, const dispatcher::queue_position queue_position)
 
 ~mouse_motion ()
 
void capture_mouse (const bool capture=true)
 Captures the mouse input. More...
 

Additional Inherited Members

- Protected Member Functions inherited from gui2::event::mouse_motion
void start_hover_timer (widget *widget, const point &coordinate)
 Starts the hover timer. More...
 
void stop_hover_timer ()
 Stops the current hover timer. More...
 
void mouse_enter (widget *mouse_over)
 Called when the mouse enters a widget. More...
 
void mouse_leave ()
 Called when the mouse leaves the current widget. More...
 
- Protected Attributes inherited from gui2::event::mouse_button
uint32_t last_click_stamp_
 The time of the last click used for double clicking. More...
 
widgetlast_clicked_widget_
 The widget the last click was on, used for double clicking. More...
 
widgetfocus_
 If the mouse isn't captured we need to verify the up is on the same widget as the down so we send a proper click, also needed to send the up to the right widget. More...
 
- Protected Attributes inherited from gui2::event::mouse_motion
widgetmouse_focus_
 The widget that currently has the mouse focus_. More...
 
bool mouse_captured_
 Did the current widget capture the focus_? More...
 
widgetowner_
 The widget that owns us. More...
 
std::size_t hover_timer_
 The timer for the hover event. More...
 
widgethover_widget_
 The widget which should get the hover event. More...
 
point hover_position_
 The anchor point of the hover event. More...
 
bool hover_shown_
 Has the hover been shown for the widget? More...
 

Detailed Description

Three subclasses of mouse_button, so that the distributor class can inherit from them; C++ doesn't allow multiple inheritance to directly use more than one instance of a superclass.

It's a diamond inheritance, as all of these have virtual base class mouse_motion; refactoring that would allow these multiple classes to be replaced with a simple (distributor has-a std::array<mouse_button, 3>) relationship.

Definition at line 233 of file distributor.hpp.

Constructor & Destructor Documentation

◆ mouse_button_left()

gui2::event::mouse_button_left::mouse_button_left ( const mouse_button_event_types events,
widget owner,
const dispatcher::queue_position  queue_position 
)
inline

Definition at line 235 of file distributor.hpp.


The documentation for this struct was generated from the following file: