events Namespace Reference

Handling of system events. More...


Classes

class  handler
struct  event_context
struct  pump_info
class  pump_monitor
class  observer
class  generic_event
class  delete_recall_unit
class  cmd_arg_parser
class  map_command_handler
class  chat_command_handler
class  console_handler
class  chat_handler
class  menu_handler
struct  command_disabler
class  mouse_handler

Functions

void raise_help_string_event (int mousex, int mousey)
void focus_handler (const handler *ptr)
bool has_focus (const handler *hand, const SDL_Event *event)
void pump ()
void raise_process_event ()
void raise_draw_event ()
void raise_volatile_draw_event ()
void raise_volatile_undraw_event ()
int discard (Uint32 event_mask)
void cycle_focus ()
static bool command_active ()
static void format_prob (char str_buf[10], const float prob)

Variables

std::deque< context > event_contexts
std::vector< pump_monitor * > pump_monitors
int commands_disabled = 0
const double drag_threshold = 14.0


Detailed Description

Handling of system events.

System events include mouse and key events, and other events which are not domain specific. The program maintains a stack of event_context objects, the top of the stack being the active event_context.

When an object of a type inheriting from handler is instantiated, it will be associated with the active event_context (unless auto_join has been set false, in which case it can manually be instructed to join a later context). As long as its event_context remains active, and only then, it will receive all system events.

Note:
Multiple handler objects will receive the same events, including key events.

Function Documentation

static bool events::command_active (  )  [static]

void events::cycle_focus (  ) 

int events::discard ( Uint32  event_mask  ) 

Definition at line 455 of file events.cpp.

References ERR_GEN.

Referenced by input_blocker::~input_blocker().

void events::focus_handler ( const handler *  ptr  ) 

Definition at line 215 of file events.cpp.

References event_contexts.

Referenced by gui::textbox::handle_event(), has_focus(), and gui::widget::set_focus().

static void events::format_prob ( char  str_buf[10],
const float  prob 
) [static]

Definition at line 62 of file mouse_events.cpp.

bool events::has_focus ( const handler *  hand,
const SDL_Event *  event 
)

Definition at line 222 of file events.cpp.

References event_contexts, focus_handler(), and events::handler::requires_event_focus().

Referenced by gui::widget::focus().

void events::pump (  ) 

void events::raise_draw_event (  ) 

void events::raise_help_string_event ( int  mousex,
int  mousey 
)

Definition at line 443 of file events.cpp.

References event_contexts.

Referenced by pump().

void events::raise_process_event (  ) 

void events::raise_volatile_draw_event (  ) 

Definition at line 415 of file events.cpp.

References event_contexts.

Referenced by display::flip().

void events::raise_volatile_undraw_event (  ) 

Definition at line 429 of file events.cpp.

References event_contexts.

Referenced by display::flip().


Variable Documentation

const double events::drag_threshold = 14.0 [static]

Definition at line 80 of file mouse_events.cpp.

std::deque<context> events::event_contexts [static]

std::vector<pump_monitor*> events::pump_monitors [static]


Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs