The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
gui2::event::tlock Class Reference

SDL_AddTimer() callback for the hover event. More...

Public Member Functions

 tlock (bool &locked)
 
 ~tlock ()
 

Private Attributes

bool & locked_
 

Detailed Description

SDL_AddTimer() callback for the hover event.

When this callback is called it pushes a new hover event in the event queue.

Parameters
intervalThe time parameter of SDL_AddTimer.
paramPointer to a widget that's able to show the tooltip (will be used as a dispatcher).
Returns
The new timer interval, 0 to stop. Small helper to keep a resource (boolean) locked.

Some of the event handling routines can't be called recursively, this due to the fact that they are attached to the pre queue and when the forward an event the pre queue event gets triggered recursively causing infinite recursion.

To prevent that those functions check the lock and exit when the lock is held otherwise grab the lock here.

Definition at line 88 of file distributor.cpp.

Constructor & Destructor Documentation

gui2::event::tlock::tlock ( bool &  locked)
inline

Definition at line 91 of file distributor.cpp.

References locked_.

gui2::event::tlock::~tlock ( )
inline

Definition at line 97 of file distributor.cpp.

References locked_.

Member Data Documentation

bool& gui2::event::tlock::locked_
private

Definition at line 104 of file distributor.cpp.

Referenced by tlock(), and ~tlock().


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