Advanced Strategic Command
Classes | Typedefs | Functions | Variables
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. More...
 
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)
 
bool time_elapsed (int time)
 
int releasetimeslice (void)
 
int getTicker ()
 
bool getQueuedEvent (SDL_Event &event)
 if the events are being queue, get one. More...
 
bool peekEvent (SDL_Event &event)
 gets the next event without removing it from the queue. More...
 
void setMouseUpdateFlag (const bool *flag)
 passes a references which' value determines if the mouse cursor is hidden on screen updates More...
 

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 
)
int getmousestatus ( )
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 
)
bool isKeyPressed ( SDLKey  key)
int keypress ( void  )
bool legacyEventSystemActive ( )
int mouseinrect ( int  x1,
int  y1,
int  x2,
int  y2 
)
int mouseinrect ( const tmouserect rect)
void mouseintproc2 ( void  )
void mousevisible ( int  an)
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  )
bool setEventRouting ( bool  queue,
bool  legacy 
)

Defines what happens with the SDL events.

Parameters
queueEvents are queued to be extracted with getQueuedEvent
legacyEvents 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.

bool 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
bool redrawScreen

Definition at line 63 of file events.cpp.

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

volatile int ticker