The Battle for Wesnoth  1.17.0-dev
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
gui2::event::mouse_button Class Reference

#include <distributor.hpp>

Inheritance diagram for gui2::event::mouse_button:

Public Member Functions

 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...
 

Protected Attributes

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...
 

Private Member Functions

void signal_handler_sdl_button_down (const event::ui_event event, bool &handled, const point &coordinate)
 
void signal_handler_sdl_button_up (const event::ui_event event, bool &handled, const point &coordinate)
 
void mouse_button_click (widget *widget)
 

Private Attributes

const mouse_button_event_types events_
 Which set of SDL events correspond to this button. More...
 
bool is_down_
 Is the button down? More...
 
bool signal_handler_sdl_button_down_entered_
 
bool signal_handler_sdl_button_up_entered_
 

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...
 

Detailed Description

Definition at line 174 of file distributor.hpp.

Constructor & Destructor Documentation

◆ mouse_button()

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

Member Function Documentation

◆ initialize_state()

void gui2::event::mouse_button::initialize_state ( int32_t  button_state)

Initializes the state of the button.

Parameters
button_stateThe initial state of all buttons, in which the bit corresponding to mouse_button_event_types.mask will be set if the button is down, or unset if it is up.

Definition at line 437 of file distributor.cpp.

References events_, focus_, is_down_, last_click_stamp_, last_clicked_widget_, and gui2::event::mouse_button_event_types::mask.

Referenced by gui2::event::distributor::initialize_state().

◆ mouse_button_click()

void gui2::event::mouse_button::mouse_button_click ( widget widget)
private

◆ signal_handler_sdl_button_down()

void gui2::event::mouse_button::signal_handler_sdl_button_down ( const event::ui_event  event,
bool &  handled,
const point coordinate 
)
private

◆ signal_handler_sdl_button_up()

void gui2::event::mouse_button::signal_handler_sdl_button_up ( const event::ui_event  event,
bool &  handled,
const point coordinate 
)
private

Member Data Documentation

◆ events_

const mouse_button_event_types gui2::event::mouse_button::events_
private

Which set of SDL events correspond to this button.

Definition at line 205 of file distributor.hpp.

Referenced by initialize_state(), mouse_button(), mouse_button_click(), signal_handler_sdl_button_down(), and signal_handler_sdl_button_up().

◆ focus_

widget* gui2::event::mouse_button::focus_
protected

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.

Definition at line 201 of file distributor.hpp.

Referenced by initialize_state(), gui2::event::distributor::signal_handler_notify_removal(), signal_handler_sdl_button_down(), and signal_handler_sdl_button_up().

◆ is_down_

bool gui2::event::mouse_button::is_down_
private

Is the button down?

Definition at line 208 of file distributor.hpp.

Referenced by initialize_state(), signal_handler_sdl_button_down(), and signal_handler_sdl_button_up().

◆ last_click_stamp_

uint32_t gui2::event::mouse_button::last_click_stamp_
protected

The time of the last click used for double clicking.

Definition at line 191 of file distributor.hpp.

Referenced by initialize_state(), and mouse_button_click().

◆ last_clicked_widget_

widget* gui2::event::mouse_button::last_clicked_widget_
protected

The widget the last click was on, used for double clicking.

Definition at line 194 of file distributor.hpp.

Referenced by initialize_state(), mouse_button_click(), and gui2::event::distributor::signal_handler_notify_removal().

◆ signal_handler_sdl_button_down_entered_

bool gui2::event::mouse_button::signal_handler_sdl_button_down_entered_
private

Definition at line 210 of file distributor.hpp.

Referenced by signal_handler_sdl_button_down().

◆ signal_handler_sdl_button_up_entered_

bool gui2::event::mouse_button::signal_handler_sdl_button_up_entered_
private

Definition at line 215 of file distributor.hpp.

Referenced by signal_handler_sdl_button_up().


The documentation for this class was generated from the following files: