events.h File Reference

#include <SDL.h>
#include "sdl/keysymbols.h"

Include dependency graph for events.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  EventHandlingMutex
class  ThreadExitException
struct  tmouserect
class  tmousesettings

Typedefs

typedef int tkey

Functions

bool setEventRouting (bool queue, bool legacy)
 Defines what happens with the SDL events.
bool legacyEventSystemActive ()
int initializeEventHandling (int(*fn)(void *), void *data)
void exit_asc (int returnresult)
void mousevisible (int an)
int getmousestatus ()
void setmouseposition (int x, int y)
void setnewmousepointer (void *picture, int hotspotx, int hotspoty)
int mouseinrect (int x1, int y1, int x2, int y2)
int mouseinrect (const tmouserect *rect)
void mouseintproc2 (void)
char skeypress (tkey keynr)
char * get_key (tkey keynr)
int keypress (void)
void wait (void)
tkey char2key (int ch)
void getkeysyms (tkey *keysym, int *keyprnt)
bool isKeyPressed (SDLKey key)
void ndelay (int time)
void starttimer (void)
char time_elapsed (int time)
int releasetimeslice (void)
int getTicker ()
bool getQueuedEvent (SDL_Event &event)
 if the events are being queue, get one.
bool peekEvent (SDL_Event &event)
 gets the next event without removing it from the queue.
void setMouseUpdateFlag (const bool *flag)
 passes a references which' value determines if the mouse cursor is hidden on screen updates

Variables

bool redrawScreen
volatile tmousesettings mouseparams
int exitprogram
volatile int ticker


Typedef Documentation

typedef int tkey

Definition at line 126 of file events.h.


Function Documentation

tkey char2key ( int  ch  ) 

Definition at line 200 of file events.cpp.

References ct_invvalue.

Referenced by tdlgengine::addbutton().

void exit_asc ( int  returnresult  ) 

Definition at line 612 of file events.cpp.

References closeEventThread.

Referenced by main().

char* get_key ( tkey  keynr  ) 

void getkeysyms ( tkey keysym,
int *  keyprnt 
)

Definition at line 157 of file events.cpp.

References keyboardmutex, keybuffer_prnt, keybuffer_sym, releasetimeslice(), and ticker.

Referenced by tdialogbox::intedit(), tdialogbox::run(), and tdialogbox::stredit().

int getmousestatus (  ) 

Definition at line 79 of file events.cpp.

Referenced by tdialogbox::buildgraphics(), tdlgengine::buttonpressed(), tdialogbox::copyvirtualframebuf(), tdialogbox::done(), tdialogbox::execbutton(), tstringselect::run(), tdialogbox::run(), and tdialogbox::showbutton().

bool getQueuedEvent ( SDL_Event &  event  ) 

if the events are being queue, get one.

Returns:
false if no event available

Definition at line 657 of file events.cpp.

References eventQueue, and eventQueueMutex.

Referenced by EventSupplier::PollEvent(), and EventSupplier::WaitEvent().

int getTicker (  ) 

Definition at line 525 of file events.cpp.

Referenced by eventthread().

int initializeEventHandling ( int(*)(void *)  fn,
void *  data 
)

Definition at line 560 of file events.cpp.

References closeEventThread, eventHandlingMutex, eventQueueMutex, eventthread(), gamethread(), graphicsQueueMutex, keyboardmutex, mouseparams, tmousesettings::xsize, and tmousesettings::ysize.

Referenced by main().

bool isKeyPressed ( SDLKey  key  ) 

Definition at line 187 of file events.cpp.

Referenced by GuiFunctions::MovementBase::execute(), and CargoGuiFunctions::Movement::execute().

int keypress ( void   ) 

Definition at line 146 of file events.cpp.

References keyboardmutex, and keybuffer_sym.

Referenced by tdialogbox::intedit(), tdialogbox::run(), tdialogbox::stredit(), and trunreplay::wait().

bool legacyEventSystemActive (  ) 

Definition at line 651 of file events.cpp.

References _fillLegacyEventStructures.

Referenced by choice_dlg(), chooseString(), displaymessage(), viewmessage(), and viewtextquery().

int mouseinrect ( const tmouserect rect  ) 

Definition at line 116 of file events.cpp.

References mouseparams, tmousesettings::x, tmouserect::x1, tmouserect::x2, tmousesettings::y, tmouserect::y1, and tmouserect::y2.

int mouseinrect ( int  x1,
int  y1,
int  x2,
int  y2 
)

Definition at line 108 of file events.cpp.

Referenced by tdialogbox::execbutton(), tdialogbox::intedit(), tgiveunitawaydlg::run(), and tdialogbox::stredit().

void mouseintproc2 ( void   ) 

void mousevisible ( int  an  ) 

Definition at line 75 of file events.cpp.

Referenced by tplayerselall::anzeige(), tplayerchange::anzeige(), thelpsystem::buildgraphics(), tdialogbox::buildgraphics(), tdlgengine::buttonpressed(), tdialogbox::copyvirtualframebuf(), tdialogbox::done(), tdialogbox::execbutton(), tplayerselall::init(), tminestrength::init(), tres::init(), UnitPropertyEditor::init(), EditAiParam::init(), BuildingValues::init(), tplayerchange::init(), tmapgenerator::init(), StringEdit::init(), tgetid::init(), tstringselect::init(), tchoice_dlg::init(), tdialogbox::knopfdruck(), mapeditorMainThread(), tdialogbox::newknopfdruck(), tdialogbox::newknopfdruck2(), tgiveunitawaydlg::run(), tchoosetechlevel::run(), tresearchinfo::run(), ttributepayments::run(), MirrorMap::run(), tputresourcesdlg::run(), tdisplaymessage::run(), tdialogbox::run(), MultilineEdit::run(), tchoosezoomlevel::run(), ResizeMap::run(), tbi3preferences::run(), tviewanytext::run(), tchoice_dlg::run(), tdialogbox::showbutton(), tshowhistoryinit(), and tstringselect::viewtext().

void ndelay ( int  time  ) 

Definition at line 236 of file events.cpp.

References releasetimeslice(), and ticker.

bool peekEvent ( SDL_Event &  event  ) 

gets the next event without removing it from the queue.

Returns:
false if no event available

Definition at line 670 of file events.cpp.

References eventQueue, and eventQueueMutex.

Referenced by EventSupplier::PeepEvent().

int releasetimeslice ( void   ) 

Definition at line 209 of file events.cpp.

References copy2screen(), and redrawScreen.

Referenced by tsearchreactionfireingunits::attack(), tstringselect::done(), execaction(), tdialogbox::execbutton(), executeUserAction(), getkeysyms(), giveunitaway(), tdialogbox::intedit(), tdialogbox::knopfdruck(), ndelay(), tdialogbox::newknopfdruck(), tdialogbox::newknopfdruck2(), trunreplay::run(), tgiveunitawaydlg::run(), tdialogbox::run(), tchoice_dlg::run(), showAttackAnimation(), tdialogbox::stredit(), trunreplay::wait(), EventSupplier::WaitEvent(), and waitWithUpdate().

bool setEventRouting ( bool  queue,
bool  legacy 
)

Defines what happens with the SDL events.

Parameters:
queue Events are queued to be extracted with getQueuedEvent
legacy Events are evaluated and the global legacy structures updated
Returns:
the previous state of the event queing

Definition at line 633 of file events.cpp.

References _fillLegacyEventStructures, _queueEvents, eventQueue, and eventQueueMutex.

Referenced by ASC_PG_App::enableLegacyEventHandling(), tdialogbox::tdialogbox(), and tdialogbox::~tdialogbox().

void setmouseposition ( int  x,
int  y 
)

Definition at line 99 of file events.cpp.

void setMouseUpdateFlag ( const bool *  flag  ) 

passes a references which' value determines if the mouse cursor is hidden on screen updates

Definition at line 69 of file events.cpp.

References mouseUpdateFlag.

Referenced by ASC_PG_App::ASC_PG_App().

void setnewmousepointer ( void *  picture,
int  hotspotx,
int  hotspoty 
)

Definition at line 104 of file events.cpp.

char skeypress ( tkey  keynr  ) 

Definition at line 181 of file events.cpp.

Referenced by tviewtextwithscrolling::checkscrolling(), and researchinfo().

void starttimer ( void   ) 

Definition at line 249 of file events.cpp.

References ticker, and tticker.

char time_elapsed ( int  time  ) 

Definition at line 254 of file events.cpp.

References ticker, and tticker.

void wait ( void   ) 

Definition at line 195 of file events.cpp.


Variable Documentation

int exitprogram

Definition at line 53 of file events.cpp.

Referenced by processEvents().

volatile tmousesettings mouseparams

Definition at line 35 of file events.cpp.

Referenced by tstringselect::done(), execaction(), tdialogbox::execbutton(), executeUserAction(), giveunitaway(), initializeEventHandling(), tdialogbox::intedit(), tdialogbox::knopfdruck(), mouseinrect(), tdialogbox::newknopfdruck(), tdialogbox::newknopfdruck2(), processEvents(), tgiveunitawaydlg::run(), ttributepayments::run(), tstringselect::run(), tdialogbox::run(), tchoice_dlg::run(), and tdialogbox::stredit().

bool redrawScreen

Definition at line 63 of file events.cpp.

Referenced by ASC_PG_App::eventIdle(), processEvents(), and releasetimeslice().

volatile int ticker

Definition at line 234 of file events.cpp.

Referenced by tsearchreactionfireingunits::attack(), AutoProgressBar::AutoProgressBar(), benchgame(), tdlgengine::buttonpressed(), tviewtextwithscrolling::checkscrolling(), MainScreenWidget::displayMessage(), MapDisplayPG::displayUnitMovement(), eventthread(), tdialogbox::execbutton(), trunreplay::execnextreplaymove(), getkeysyms(), MainScreenWidget::idleHandler(), OverviewMapHolder::idleHandler(), PlayerColorPanel::idler(), infomessage(), MainScreenWidget::mouseScrollChecker(), ndelay(), tmessagedlg::run(), AI::run(), PlayerColorPanel::Show(), showAttackAnimation(), starttimer(), time_elapsed(), trunreplay::wait(), and waitWithUpdate().


Generated on Mon May 21 01:34:49 2012 for Advanced Strategic Command by  doxygen 1.5.1