Public Member Functions | Private Attributes

gui2::event::tlock Class Reference

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

List of all members.

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:
interval The time parameter of SDL_AddTimer.
param Pointer 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 79 of file distributor.cpp.


Constructor & Destructor Documentation

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

Definition at line 25 of file distributor.cpp.

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

Definition at line 32 of file distributor.cpp.


Member Data Documentation

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

Definition at line 38 of file distributor.cpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:23:59 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs