#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 |
| tkey char2key | ( | int | ch | ) |
Definition at line 200 of file events.cpp.
References ct_invvalue.
Referenced by tdlgengine::addbutton().
| void exit_asc | ( | int | returnresult | ) |
| 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.
Definition at line 657 of file events.cpp.
References eventQueue, and eventQueueMutex.
Referenced by EventSupplier::PollEvent(), and EventSupplier::WaitEvent().
| int getTicker | ( | ) |
| 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 | ) |
| bool peekEvent | ( | SDL_Event & | event | ) |
gets the next event without removing it from the queue.
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.
| queue | Events are queued to be extracted with getQueuedEvent | |
| legacy | Events are evaluated and the global legacy structures updated |
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 | ) |
| char time_elapsed | ( | int | time | ) |
| void wait | ( | void | ) |
Definition at line 195 of file events.cpp.
| int exitprogram |
| 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().
1.5.1