TORCS  1.3.9
The Open Racing Car Simulator
gui.cpp File Reference

This API is used to manage all the menu screens. More...

#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <tgfclient.h>
#include "gui.h"
#include <portability.h>
Include dependency graph for gui.cpp:

Go to the source code of this file.

Macros

#define REPEAT1   1.0
 
#define REPEAT2   0.2
 

Functions

static void gfuiColorInit (void)
 
void gfuiInit (void)
 
void GfuiDisplayNothing (void)
 Dummy display function for glut. More...
 
void GfuiIdle (void)
 Idle function for the GUI to be called during Idle loop of glut. More...
 
void GfuiDisplay (void)
 Display function for the GUI to be called during redisplay of glut. More...
 
void GfuiMouseHide (void)
 Hide the mouse cursor. More...
 
void GfuiMouseShow (void)
 Show the mouse cursor. More...
 
void GfuiMouseSetHWPresent (void)
 Force the hardware mouse pointer. More...
 
static void gfuiKeyboard (unsigned char key, int, int)
 
static void gfuiSpecial (int key, int, int)
 
static void gfuiKeyboardUp (unsigned char key, int, int)
 
static void gfuiSpecialUp (int key, int, int)
 
tMouseInfoGfuiMouseInfo (void)
 Get the mouse information (position and buttons) More...
 
void GfuiMouseSetPos (int x, int y)
 Set the mouse position. More...
 
static void gfuiMouse (int button, int state, int x, int y)
 
static void gfuiMotion (int x, int y)
 
static void gfuiPassiveMotion (int x, int y)
 
int GfuiScreenIsActive (void *screen)
 Tell if the screen is active or not. More...
 
void GfuiScreenActivate (void *screen)
 Activate a screen and make it current. More...
 
void GfuiScreenReplace (void *screen)
 Activate a screen and make it current plus release the current screen. More...
 
void GfuiScreenDeactivate (void)
 Deactivate the current screen. More...
 
void * GfuiScreenCreate (void)
 Create a new screen. More...
 
void * GfuiScreenCreateEx (float *bgColor, void *userDataOnActivate, tfuiCallback onActivate, void *userDataOnDeactivate, tfuiCallback onDeactivate, int mouseAllowed)
 Create a screen. More...
 
void GfuiScreenRelease (void *scr)
 Release the given screen. More...
 
void * GfuiHookCreate (void *userDataOnActivate, tfuiCallback onActivate)
 Create a callback hook. More...
 
void GfuiHookRelease (void *hook)
 Release the given hook. More...
 
void GfuiKeyEventRegister (void *scr, tfuiKeyCallback onKeyAction)
 
void GfuiSKeyEventRegister (void *scr, tfuiSKeyCallback onSKeyAction)
 
void GfuiKeyEventRegisterCurrent (tfuiKeyCallback onKeyAction)
 
void GfuiSKeyEventRegisterCurrent (tfuiSKeyCallback onSKeyAction)
 
void GfuiAddKey (void *scr, unsigned char key, const char *descr, void *userData, tfuiCallback onKeyPressed, tfuiCallback onKeyReleased)
 Add a Keyboard callback to a screen. More...
 
void GfuiRegisterKey (unsigned char key, char *descr, void *userData, tfuiCallback onKeyPressed, tfuiCallback onKeyReleased)
 Add a Keyboard callback to the current screen. More...
 
void GfuiAddSKey (void *scr, int key, const char *descr, void *userData, tfuiCallback onKeyPressed, tfuiCallback onKeyReleased)
 Add a Special Keyboard shortcut to the screen. More...
 
void GfuiScreenShot (void *)
 Save a screen shot in png format. More...
 
void GfuiScreenAddBgImg (void *scr, const char *filename)
 Add an image background to a screen. More...
 

Variables

tGfuiScreenGfuiScreen
 
static int GfuiMouseVisible = 1
 
tMouseInfo GfuiMouse
 
int GfuiMouseHW = 0
 
float GfuiColor [GFUI_COLORNB][4]
 
static int ScrW
 
static int ScrH
 
static int ViewW
 
static int ViewH
 
static tdble DelayRepeat
 
static double LastTimeClick
 

Detailed Description

This API is used to manage all the menu screens.

Author
Eric Espie
Version
$Id$

Definition in file gui.cpp.

Macro Definition Documentation

◆ REPEAT1

#define REPEAT1   1.0

Definition at line 47 of file gui.cpp.

◆ REPEAT2

#define REPEAT2   0.2

Definition at line 48 of file gui.cpp.

Function Documentation

◆ gfuiColorInit()

static void gfuiColorInit ( void  )
static

Definition at line 51 of file gui.cpp.

Here is the call graph for this function:

◆ gfuiInit()

void gfuiInit ( void  )

Definition at line 90 of file gui.cpp.

Here is the call graph for this function:

◆ gfuiKeyboard()

static void gfuiKeyboard ( unsigned char  key,
int  ,
int   
)
static

Definition at line 247 of file gui.cpp.

Here is the call graph for this function:

◆ gfuiKeyboardUp()

static void gfuiKeyboardUp ( unsigned char  key,
int  ,
int   
)
static

Definition at line 321 of file gui.cpp.

◆ GfuiKeyEventRegister()

void GfuiKeyEventRegister ( void *  scr,
tfuiKeyCallback  onKeyAction 
)

Definition at line 702 of file gui.cpp.

Here is the call graph for this function:

◆ GfuiKeyEventRegisterCurrent()

void GfuiKeyEventRegisterCurrent ( tfuiKeyCallback  onKeyAction)

Definition at line 719 of file gui.cpp.

Here is the call graph for this function:

◆ gfuiMotion()

static void gfuiMotion ( int  x,
int  y 
)
static

Definition at line 431 of file gui.cpp.

Here is the call graph for this function:

◆ gfuiMouse()

static void gfuiMouse ( int  button,
int  state,
int  x,
int  y 
)
static

Definition at line 398 of file gui.cpp.

Here is the call graph for this function:

◆ gfuiPassiveMotion()

static void gfuiPassiveMotion ( int  x,
int  y 
)
static

Definition at line 442 of file gui.cpp.

Here is the call graph for this function:

◆ GfuiSKeyEventRegister()

void GfuiSKeyEventRegister ( void *  scr,
tfuiSKeyCallback  onSKeyAction 
)

Definition at line 711 of file gui.cpp.

Here is the call graph for this function:

◆ GfuiSKeyEventRegisterCurrent()

void GfuiSKeyEventRegisterCurrent ( tfuiSKeyCallback  onSKeyAction)

Definition at line 726 of file gui.cpp.

Here is the call graph for this function:

◆ gfuiSpecial()

static void gfuiSpecial ( int  key,
int  ,
int   
)
static

Definition at line 284 of file gui.cpp.

Here is the call graph for this function:

◆ gfuiSpecialUp()

static void gfuiSpecialUp ( int  key,
int  ,
int   
)
static

Definition at line 349 of file gui.cpp.

Variable Documentation

◆ DelayRepeat

tdble DelayRepeat
static

Definition at line 45 of file gui.cpp.

◆ GfuiColor

float GfuiColor[GFUI_COLORNB][4]

Definition at line 41 of file gui.cpp.

◆ GfuiMouse

tMouseInfo GfuiMouse

Definition at line 37 of file gui.cpp.

◆ GfuiMouseHW

int GfuiMouseHW = 0

Definition at line 39 of file gui.cpp.

◆ GfuiMouseVisible

int GfuiMouseVisible = 1
static

Definition at line 36 of file gui.cpp.

◆ GfuiScreen

tGfuiScreen* GfuiScreen

Definition at line 35 of file gui.cpp.

◆ LastTimeClick

double LastTimeClick
static

Definition at line 46 of file gui.cpp.

◆ ScrH

int ScrH
static

Definition at line 43 of file gui.cpp.

◆ ScrW

int ScrW
static

Definition at line 43 of file gui.cpp.

◆ ViewH

int ViewH
static

Definition at line 43 of file gui.cpp.

◆ ViewW

int ViewW
static

Definition at line 43 of file gui.cpp.