Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

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.

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)
tkey r_key (void)
int rp_key (void)
int keypress (void)
void wait (void)
tkey char2key (int ch)
void getkeysyms (tkey *keysym, int *keyprnt)
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

SDL_mutex * eventHandlingMutex
bool redrawScreen
volatile tmousesettings mouseparams
int exitprogram
volatile int ticker


Typedef Documentation

typedef int tkey
 

Definition at line 122 of file events.h.


Function Documentation

tkey char2key int  ch  ) 
 

Definition at line 244 of file events.cpp.

References ct_invvalue.

Referenced by tdlgengine::addbutton().

void exit_asc int  returnresult  ) 
 

Definition at line 645 of file events.cpp.

References closeEventThread.

Referenced by main().

char* get_key tkey  keynr  ) 
 

void getkeysyms tkey keysym,
int *  keyprnt
 

Definition at line 206 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 690 of file events.cpp.

References eventQueue, and eventQueueMutex.

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

int getTicker  ) 
 

Definition at line 558 of file events.cpp.

Referenced by eventthread().

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

Definition at line 593 of file events.cpp.

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

Referenced by main().

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 684 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 tmousesettings::x, and tmousesettings::y.

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(), tchoosetechnology::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(), tshownewtanks::run(), tgiveunitawaydlg::run(), tchoosetechlevel::run(), tresearchinfo::run(), ttributepayments::run(), tchoosetechnology::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 280 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 703 of file events.cpp.

References eventQueue, and eventQueueMutex.

Referenced by EventSupplier::PeepEvent().

tkey r_key void   ) 
 

Definition at line 158 of file events.cpp.

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

int releasetimeslice void   ) 
 

Definition at line 253 of file events.cpp.

References copy2screen(), and redrawScreen.

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

int rp_key void   ) 
 

Definition at line 182 of file events.cpp.

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

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 666 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 230 of file events.cpp.

Referenced by tviewtextwithscrolling::checkscrolling(), GuiFunctions::Descend::execute(), GuiFunctions::Ascend::execute(), GuiFunctions::Movement::execute(), CargoGuiFunctions::Movement::execute(), and researchinfo().

void starttimer void   ) 
 

Definition at line 293 of file events.cpp.

References ticker, and tticker.

char time_elapsed int  time  ) 
 

Definition at line 298 of file events.cpp.

References ticker, and tticker.

void wait void   ) 
 

Definition at line 239 of file events.cpp.


Variable Documentation

SDL_mutex* eventHandlingMutex
 

Definition at line 38 of file events.cpp.

Referenced by initializeEventHandling(), and processEvents().

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(), execuseraction(), giveunitaway(), tdialogbox::intedit(), tdialogbox::knopfdruck(), tdialogbox::newknopfdruck(), tdialogbox::newknopfdruck2(), tgiveunitawaydlg::run(), ttributepayments::run(), tchoosetechnology::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 278 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(), r_key(), rp_key(), tmessagedlg::run(), AI::run(), PlayerColorPanel::Show(), showAttackAnimation(), starttimer(), and time_elapsed().


Generated on Tue Jun 24 01:42:51 2008 for Advanced Strategic Command by  doxygen 1.4.2