TORCS  1.3.9
The Open Racing Car Simulator
tgfclient.h
Go to the documentation of this file.
1 /***************************************************************************
2  tgfclient.h -- Interface file for The Gaming Framework
3  -------------------
4  created : Fri Aug 13 22:32:14 CEST 1999
5  copyright : (C) 1999-2014 by Eric Espie, Bernhard Wymann
6  email : torcs@free.fr
7  version : $Id$
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 
27 #ifndef __TGFCLIENT__H__
28 #define __TGFCLIENT__H__
29 
30 #include <tgf.h>
31 #include <GL/glut.h>
32 #include <plib/js.h>
33 #include <screen_properties.h>
34 
35 #define NUM_JOY 8
36 
37 extern void GfInitClient(void);
38 
39 /********************
40  * Screen Interface *
41  ********************/
42 
43 extern unsigned char *GfImgReadPng(const char *filename, int *widthp, int *heightp, float gamma);
44 extern int GfImgWritePng(unsigned char *img, const char *filename, int width, int height);
45 extern void GfImgFreeTex(GLuint tex);
46 extern GLuint GfImgReadTex(char *filename);
47 
48 extern void GfScrInit(int argc, char *argv[]);
49 extern void GfScrShutdown(void);
50 extern void *GfScrMenuInit(void *precMenu);
51 extern void GfTime2Str(char *result, int resultSize, tdble sec, int sgn);
52 extern void GfScrGetSize(int *ScrW, int *ScrH, int *ViewW, int *ViewH);
53 extern void GfScrReinit(void*);
54 
55 
56 /*****************************
57  * GUI interface (low-level) *
58  *****************************/
59 
60 /* Widget type */
61 #define GFUI_LABEL 0
62 #define GFUI_BUTTON 1
63 #define GFUI_GRBUTTON 2
64 #define GFUI_SCROLLIST 3
65 #define GFUI_SCROLLBAR 4
66 #define GFUI_EDITBOX 5
67 
68 /* Alignment */
69 #define GFUI_ALIGN_HL_VB 0x00
70 #define GFUI_ALIGN_HL_VC 0x01
71 #define GFUI_ALIGN_HL_VT 0x02
72 #define GFUI_ALIGN_HC_VB 0x10
73 #define GFUI_ALIGN_HC_VC 0x11
74 #define GFUI_ALIGN_HC_VT 0x12
75 #define GFUI_ALIGN_HR_VB 0x20
76 #define GFUI_ALIGN_HR_VC 0x21
77 #define GFUI_ALIGN_HR_VT 0x22
78 
79 /* Mouse action */
80 #define GFUI_MOUSE_UP 0
81 #define GFUI_MOUSE_DOWN 1
82 
83 /* Keyboard action */
84 #define GFUI_KEY_UP 0
85 #define GFUI_KEY_DOWN 1
86 
87 /* Scroll Bar position */
88 #define GFUI_SB_NONE 0
89 #define GFUI_SB_RIGHT 1
90 #define GFUI_SB_LEFT 2
91 #define GFUI_SB_TOP 3
92 #define GFUI_SB_BOTTOM 4
93 
94 /* Scroll bar orientation */
95 #define GFUI_HORI_SCROLLBAR 0
96 #define GFUI_VERT_SCROLLBAR 1
97 
99 typedef struct ScrollBarInfo
100 {
101  int pos;
102  void *userData;
104 
105 typedef void (*tfuiCallback)(void * /* userdata */);
106 typedef void (*tfuiSBCallback)(tScrollBarInfo *);
107 typedef int (*tfuiKeyCallback)(unsigned char key, int modifier, int state);
108 typedef int (*tfuiSKeyCallback)(int key, int modifier, int state);
111 /* GLUT Callback functions */
112 /* should be called explicitely if */
113 /* the corresponding GLUT Func is overriden */
114 /* after a call to GfuiActivateScreen */
115 extern void GfuiDisplay(void);
116 extern void GfuiDisplayNothing(void);
117 extern void GfuiIdle(void);
118 
119 /* Screen management */
120 extern void *GfuiScreenCreate(void);
121 extern void *GfuiScreenCreateEx(float *bgColor,
122  void *userDataOnActivate, tfuiCallback onActivate,
123  void *userDataOnDeactivate, tfuiCallback onDeactivate,
124  int mouseAllowed);
125 extern void GfuiScreenRelease(void *screen);
126 extern void GfuiScreenActivate(void *screen);
127 extern int GfuiScreenIsActive(void *screen);
128 extern void GfuiScreenReplace(void *screen);
129 extern void GfuiScreenDeactivate(void);
130 extern void *GfuiHookCreate(void *userDataOnActivate, tfuiCallback onActivate);
131 extern void GfuiHookRelease(void *hook);
132 extern void GfuiAddKey(void *scr, unsigned char key, const char *descr, void *userData, tfuiCallback onKeyPressed, tfuiCallback onKeyReleased);
133 extern void GfuiRegisterKey(unsigned char key, char *descr, void *userData, tfuiCallback onKeyPressed, tfuiCallback onKeyReleased);
134 extern void GfuiAddSKey(void *scr, int key, const char *descr, void *userData, tfuiCallback onKeyPressed, tfuiCallback onKeyReleased);
135 extern void GfuiHelpScreen(void *prevScreen);
136 extern void GfuiScreenShot(void *notused);
137 extern void GfuiScreenAddBgImg(void *scr, const char *filename);
138 extern void GfuiKeyEventRegister(void *scr, tfuiKeyCallback onKeyAction);
139 extern void GfuiSKeyEventRegister(void *scr, tfuiSKeyCallback onSKeyAction);
142 
143 /* mouse */
144 typedef struct MouseInfo
145 {
146  int X;
147  int Y;
148  int button[3];
149 } tMouseInfo;
150 
151 extern tMouseInfo *GfuiMouseInfo(void);
152 extern void GfuiMouseSetPos(int x, int y);
153 extern void GfuiMouseHide(void);
154 extern void GfuiMouseShow(void);
155 extern void GfuiMouseSetHWPresent(void);
156 
157 /* all widgets */
158 #define GFUI_VISIBLE 1
159 #define GFUI_INVISIBLE 0
160 extern int GfuiVisibilitySet(void *scr, int id, int visible);
161 #define GFUI_DISABLE 1
162 #define GFUI_ENABLE 0
163 extern int GfuiEnable(void *scr, int id, int flag);
164 extern void GfuiUnSelectCurrent(void);
165 
166 /* labels */
167 #define GFUI_FONT_BIG 0
168 #define GFUI_FONT_LARGE 1
169 #define GFUI_FONT_MEDIUM 2
170 #define GFUI_FONT_SMALL 3
171 #define GFUI_FONT_BIG_C 4
172 #define GFUI_FONT_LARGE_C 5
173 #define GFUI_FONT_MEDIUM_C 6
174 #define GFUI_FONT_SMALL_C 7
175 #define GFUI_FONT_DIGIT 8
176 extern int GfuiLabelCreate(void *scr, const char *text,
177  int font, int x, int y, int align, int maxlen);
178 extern int GfuiLabelCreateEx(void *scr, const char *text, float *fgColor, int font, int x, int y, int align, int maxlen);
179 
180 extern int GfuiTipCreate(void *scr, const char *text, int maxlen);
181 extern int GfuiTitleCreate(void *scr, const char *text, int maxlen);
182 
183 extern void GfuiLabelSetText(void *scr, int id, const char *text);
184 extern void GfuiLabelSetColor(void *scr, int id, float *color);
185 
186 extern void GfuiPrintString(const char *text, float *fgColor, int font, int x, int y, int align);
187 extern int GfuiFontHeight(int font);
188 extern int GfuiFontWidth(int font, const char *text);
189 
190 
191 /* buttons */
192 #define GFUI_BTNSZ 300
193 extern int GfuiButtonCreate(void *scr, const char *text, int font,
194  int x, int y, int width, int align, int mouse,
195  void *userDataOnPush, tfuiCallback onPush,
196  void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost);
197 extern int GfuiLeanButtonCreate(void *scr, const char *text, int font,
198  int x, int y, int width, int align, int mouse,
199  void *userDataOnPush, tfuiCallback onPush,
200  void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost);
201 extern int GfuiButtonStateCreate(void *scr, const char *text, int font, int x, int y, int width, int align, int mouse,
202  void *userDataOnPush, tfuiCallback onPush,
203  void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost);
204 extern int GfuiGrButtonCreate(void *scr, const char *disabled, const char *enabled, const char *focused, const char *pushed,
205  int x, int y, int align, int mouse,
206  void *userDataOnPush, tfuiCallback onPush,
207  void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost);
208 
209 extern void GfuiButtonSetText(void *scr, int id, const char *text);
210 extern int GfuiButtonGetFocused(void);
211 
212 /* Edit Box */
213 extern int GfuiEditboxCreate(void *scr, const char *text, int font, int x, int y, int width, int maxlen,
214  void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost, int margin = 10);
215 extern int GfuiEditboxGetFocused(void);
216 extern char *GfuiEditboxGetString(void *scr, int id);
217 extern void GfuiEditboxSetString(void *scr, int id, const char *text);
218 
219 /* Scrolling lists */
220 extern int GfuiScrollListCreate(void *scr, int font, int x, int y, int align,
221  int width, int height, int scrollbar, void *userDataOnSelect, tfuiCallback onSelect);
222 extern int GfuiScrollListInsertElement(void *scr, int Id, char *element, int index, void *userData);
223 extern int GfuiScrollListMoveSelectedElement(void *scr, int Id, int delta);
224 extern char *GfuiScrollListExtractSelectedElement(void *scr, int Id, void **userData);
225 extern char *GfuiScrollListExtractElement(void *scr, int Id, int index, void **userData);
226 extern char *GfuiScrollListGetSelectedElement(void *scr, int Id, void **userData);
227 extern char *GfuiScrollListGetElement(void *scr, int Id, int index, void **userData);
228 
229 /* scroll bars */
230 extern int GfuiScrollBarCreate(void *scr, int x, int y, int align, int width, int orientation,
231  int min, int max, int len, int start,
232  void *userData, tfuiSBCallback onScroll);
233 extern void GfuiScrollBarPosSet(void *scr, int id, int min, int max, int len, int start);
234 extern int GfuiScrollBarPosGet(void *scr, int id);
235 
236 /* Images */
237 extern int GfuiStaticImageCreate(void *scr, int x, int y, int w, int h, char *name);
238 extern void GfuiStaticImageSet(void *scr, int id, char *name);
239 
240 /*****************************
241  * Menu Management Interface *
242  *****************************/
243 
244 extern void *GfuiMenuScreenCreate(const char *title);
245 extern void GfuiMenuDefaultKeysAdd(void *scr);
246 extern int GfuiMenuButtonCreate(void *menu, const char *text, const char *tip, void *userdata, tfuiCallback onpush);
247 extern int GfuiMenuBackQuitButtonCreate(void *menu, const char *text, const char *tip, void *userdata, tfuiCallback onpush);
248 
249 
250 /*********************
251  * Control interface *
252  *********************/
253 
254 typedef enum {
262 } GfCtrlType;
263 
264 typedef struct
265 {
266  int index;
268 } tCtrlRef;
269 
270 
271 #define GFCTRL_JOY_UNTESTED -1
272 #define GFCTRL_JOY_NONE 0
273 #define GFCTRL_JOY_PRESENT 1
274 
275 #define GFCTRL_JOY_MAXBUTTON 32 /* Size of integer so don't change please */
276 
278 typedef struct
279 {
280  int oldb[NUM_JOY];
281  float ax[_JS_MAX_AXES * NUM_JOY];
285 } tCtrlJoyInfo;
286 
287 extern tCtrlJoyInfo *GfctrlJoyInit(void);
288 extern int GfctrlJoyIsPresent(void);
289 extern int GfctrlJoyGetCurrent(tCtrlJoyInfo *joyInfo);
290 extern void GfctrlJoyRelease(tCtrlJoyInfo *joyInfo);
291 
292 
294 typedef struct
295 {
296  int edgeup[3];
297  int edgedn[3];
298  int button[3];
299  float ax[4];
301 
302 extern tCtrlMouseInfo *GfctrlMouseInit(void);
305 extern void GfctrlMouseCenter(void);
306 extern void GfctrlMouseInitCenter(void);
307 extern void GfctrlGetRefByName(const char *name, tCtrlRef* ref);
308 extern const char *GfctrlGetNameByRef(GfCtrlType type, int index);
309 extern const char *GfctrlGetDefaultSection(GfCtrlType type);
310 extern bool GfctrlIsEventBlacklisted(void *parmHandle, const char* driversSection, const char* event);
311 
312 extern int GfuiGlutExtensionSupported(const char *str);
313 
314 
315 #endif /* __TGFCLIENT__H__ */
316 
317 
int GfctrlMouseGetCurrent(tCtrlMouseInfo *mouseInfo)
Get the mouse current values.
Definition: control.cpp:427
void GfuiMouseShow(void)
Show the mouse cursor.
Definition: gui.cpp:230
void GfImgFreeTex(GLuint tex)
Free the texture.
Definition: img.cpp:280
char * GfuiScrollListExtractSelectedElement(void *scr, int Id, void **userData)
Extract the selected element from the scroll list (removed).
char * GfuiEditboxGetString(void *scr, int id)
Get the string.
Definition: guiedit.cpp:358
void * GfScrMenuInit(void *precMenu)
Create and activate the video options menu screen.
Definition: screen.cpp:767
int GfuiButtonStateCreate(void *scr, const char *text, int font, int x, int y, int width, int align, int mouse, void *userDataOnPush, tfuiCallback onPush, void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost)
Add a state button to a screen.
Definition: guibutton.cpp:188
void GfScrReinit(void *)
Definition: screen.cpp:512
int GfuiEditboxGetFocused(void)
Get the Id of the editbox focused in the current screen.
Definition: guiedit.cpp:138
struct MouseInfo tMouseInfo
void GfuiScreenReplace(void *screen)
Activate a screen and make it current plus release the current screen.
Definition: gui.cpp:506
tCtrlJoyInfo * GfctrlJoyInit(void)
Initialize the joystick control.
Definition: control.cpp:303
void GfuiUnSelectCurrent(void)
Remove the focus on the current element.
Definition: guiobject.cpp:162
int GfImgWritePng(unsigned char *img, const char *filename, int width, int height)
Write a buffer to a png image on disk.
Definition: img.cpp:201
GLuint GfImgReadTex(char *filename)
Read a png image into a texture.
Definition: img.cpp:293
int GfuiButtonCreate(void *scr, const char *text, int font, int x, int y, int width, int align, int mouse, void *userDataOnPush, tfuiCallback onPush, void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost)
Add a button to a screen.
Definition: guibutton.cpp:248
void GfuiSKeyEventRegister(void *scr, tfuiSKeyCallback onSKeyAction)
Definition: gui.cpp:711
Scalar max(Scalar x, Scalar y)
Definition: Basic.h:50
int GfuiMenuButtonCreate(void *menu, const char *text, const char *tip, void *userdata, tfuiCallback onpush)
Add a button to a menu screen.
Definition: guimenu.cpp:110
bool GfctrlIsEventBlacklisted(void *parmHandle, const char *driversSection, const char *event)
Check if given event is blacklisted (used for buttons or axis which fire a button AND move event)...
Definition: control.cpp:502
void GfuiMouseSetPos(int x, int y)
Set the mouse position.
Definition: gui.cpp:391
static float ax[_JS_MAX_AXES *NUM_JOY]
int GfuiTipCreate(void *scr, const char *text, int maxlen)
Add a Tip (generally associated with a button).
Definition: guilabel.cpp:155
void GfScrInit(int argc, char *argv[])
Definition: screen.cpp:261
void GfuiScrollBarPosSet(void *scr, int id, int min, int max, int len, int start)
Set new values for position.
static void onSelect(void *)
int GfuiScrollListInsertElement(void *scr, int Id, char *element, int index, void *userData)
Insert an element in a scroll list.
Joystick Information Structure.
Definition: tgfclient.h:278
void GfctrlMouseRelease(tCtrlMouseInfo *mouseInfo)
Release the tCtrlMouseInfo structure.
Definition: control.cpp:412
tCtrlMouseInfo * GfctrlMouseInit(void)
Initialize the mouse control.
Definition: control.cpp:399
void GfuiAddKey(void *scr, unsigned char key, const char *descr, void *userData, tfuiCallback onKeyPressed, tfuiCallback onKeyReleased)
Add a Keyboard callback to a screen.
Definition: gui.cpp:742
char * GfuiScrollListGetSelectedElement(void *scr, int Id, void **userData)
Get the selected element from the scroll list.
void GfuiDisplay(void)
Display function for the GUI to be called during redisplay of glut.
Definition: gui.cpp:136
void GfuiScreenRelease(void *screen)
Release the given screen.
Definition: gui.cpp:618
int GfuiLabelCreate(void *scr, const char *text, int font, int x, int y, int align, int maxlen)
Add a label to a screen.
Definition: guilabel.cpp:142
static tCtrlMouseInfo mouseInfo
void * GfuiMenuScreenCreate(const char *title)
Create a new menu screen.
Definition: guimenu.cpp:76
void GfuiKeyEventRegisterCurrent(tfuiKeyCallback onKeyAction)
Definition: gui.cpp:719
Scroll bar call-back information.
Definition: tgfclient.h:99
int GfctrlJoyGetCurrent(tCtrlJoyInfo *joyInfo)
Get the joystick current values.
Definition: control.cpp:349
void * userData
Associated user data.
Definition: tgfclient.h:102
static int ViewH
Definition: gui.cpp:43
void GfuiKeyEventRegister(void *scr, tfuiKeyCallback onKeyAction)
Definition: gui.cpp:702
int(* tfuiSKeyCallback)(int key, int modifier, int state)
return 1 to prevent normal key computing
Definition: tgfclient.h:108
int GfuiScrollListMoveSelectedElement(void *scr, int Id, int delta)
Move the selected element within the scroll list.
int GfuiEditboxCreate(void *scr, const char *text, int font, int x, int y, int width, int maxlen, void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost, int margin=10)
Add a editbox to a screen.
Definition: guiedit.cpp:57
void GfuiScreenAddBgImg(void *scr, const char *filename)
Add an image background to a screen.
Definition: gui.cpp:961
void GfctrlJoyRelease(tCtrlJoyInfo *joyInfo)
Release the tCtrlJoyInfo structure.
Definition: control.cpp:321
static int ViewW
Definition: gui.cpp:43
int(* tfuiKeyCallback)(unsigned char key, int modifier, int state)
return 1 to prevent normal key computing
Definition: tgfclient.h:107
int GfuiButtonGetFocused(void)
Get the Id of the button focused in the current screen.
Definition: guibutton.cpp:387
void GfuiIdle(void)
Idle function for the GUI to be called during Idle loop of glut.
Definition: gui.cpp:116
void GfInitClient(void)
Definition: tgfclient.cpp:31
static void onPush(void *vi)
void GfuiStaticImageSet(void *scr, int id, char *name)
Replace an image by another one.
Definition: guiimage.cpp:86
GfCtrlType type
Definition: tgfclient.h:267
void GfuiRegisterKey(unsigned char key, char *descr, void *userData, tfuiCallback onKeyPressed, tfuiCallback onKeyReleased)
Add a Keyboard callback to the current screen.
Definition: gui.cpp:800
char * GfuiScrollListExtractElement(void *scr, int Id, int index, void **userData)
Extract the specified element from the scroll list.
void GfuiDisplayNothing(void)
Dummy display function for glut.
Definition: gui.cpp:108
void GfuiMouseSetHWPresent(void)
Force the hardware mouse pointer.
Definition: gui.cpp:241
void GfuiButtonSetText(void *scr, int id, const char *text)
Change the label of a button.
Definition: guibutton.cpp:357
void * GfuiScreenCreateEx(float *bgColor, void *userDataOnActivate, tfuiCallback onActivate, void *userDataOnDeactivate, tfuiCallback onDeactivate, int mouseAllowed)
Create a screen.
Definition: gui.cpp:578
int button[3]
Definition: tgfclient.h:148
GfCtrlType
Definition: tgfclient.h:254
void GfuiEditboxSetString(void *scr, int id, const char *text)
Set a new string.
Definition: guiedit.cpp:383
void GfuiLabelSetText(void *scr, int id, const char *text)
Change the text of a label.
Definition: guilabel.cpp:212
float tdble
Floating point type used in TORCS.
Definition: tgf.h:48
static void onActivate(void *)
const char * GfctrlGetNameByRef(GfCtrlType type, int index)
Get a control name by its reference.
Definition: control.cpp:191
static void onFocusLost(void *)
unsigned char * GfImgReadPng(const char *filename, int *widthp, int *heightp, float gamma)
Load an image from disk to a buffer in RGBA mode.
Definition: img.cpp:54
void GfuiSKeyEventRegisterCurrent(tfuiSKeyCallback onSKeyAction)
Definition: gui.cpp:726
char * GfuiScrollListGetElement(void *scr, int Id, int index, void **userData)
Get the specified element from the scroll list.
int GfuiScrollBarCreate(void *scr, int x, int y, int align, int width, int orientation, int min, int max, int len, int start, void *userData, tfuiSBCallback onScroll)
Create a new scroll bar.
The Gaming Framework API.
Parameter set handle structure, multiple handles can reference the same parameter set...
Definition: params.cpp:125
static int ScrW
Definition: gui.cpp:43
tMouseInfo * GfuiMouseInfo(void)
Get the mouse information (position and buttons)
Definition: gui.cpp:380
int GfuiLeanButtonCreate(void *scr, const char *text, int font, int x, int y, int width, int align, int mouse, void *userDataOnPush, tfuiCallback onPush, void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost)
Definition: guibutton.cpp:332
void GfuiLabelSetColor(void *scr, int id, float *color)
Change the color of a label.
Definition: guilabel.cpp:239
int GfuiGlutExtensionSupported(const char *str)
Definition: screen.cpp:944
void GfuiMenuDefaultKeysAdd(void *scr)
Add the default menu keyboard callback to a screen.
Definition: guimenu.cpp:55
int GfuiFontWidth(int font, const char *text)
Definition: guiobject.cpp:70
int GfuiFontHeight(int font)
Definition: guiobject.cpp:65
int GfuiStaticImageCreate(void *scr, int x, int y, int w, int h, char *name)
Create a new static image.
Definition: guiimage.cpp:48
int GfctrlJoyIsPresent(void)
Check if a joystick is present.
Definition: control.cpp:332
int GfuiScreenIsActive(void *screen)
Tell if the screen is active or not.
Definition: gui.cpp:456
void * GfuiHookCreate(void *userDataOnActivate, tfuiCallback onActivate)
Create a callback hook.
Definition: gui.cpp:679
void(* tfuiCallback)(void *)
Definition: tgfclient.h:105
void GfctrlMouseInitCenter(void)
Get the reference position.
Definition: control.cpp:489
void GfuiMouseHide(void)
Hide the mouse cursor.
Definition: gui.cpp:220
void GfuiScreenActivate(void *screen)
Activate a screen and make it current.
Definition: gui.cpp:467
void GfuiAddSKey(void *scr, int key, const char *descr, void *userData, tfuiCallback onKeyPressed, tfuiCallback onKeyReleased)
Add a Special Keyboard shortcut to the screen.
Definition: gui.cpp:816
int GfuiScrollBarPosGet(void *scr, int id)
Get the current position of a scroll bar.
static int ScrH
Definition: gui.cpp:43
int GfuiEnable(void *scr, int id, int flag)
Enable / Disable an object.
Definition: guiobject.cpp:434
#define GFCTRL_JOY_MAXBUTTON
Definition: tgfclient.h:275
void GfctrlGetRefByName(const char *name, tCtrlRef *ref)
Get a control reference by its name.
Definition: control.cpp:123
void GfScrGetSize(int *ScrW, int *ScrH, int *ViewW, int *ViewH)
Get the screen and viewport sizes.
Definition: screen.cpp:471
void GfuiHelpScreen(void *prevScreen)
Generate a help screen.
Definition: guihelp.cpp:48
Scalar min(Scalar x, Scalar y)
Definition: Basic.h:49
void GfuiScreenShot(void *notused)
Save a screen shot in png format.
Definition: gui.cpp:913
static Vector y[4]
Definition: Convex.cpp:56
int pos
Current scroll bar position.
Definition: tgfclient.h:101
const char * GfctrlGetDefaultSection(GfCtrlType type)
Definition: control.cpp:284
int GfuiLabelCreateEx(void *scr, const char *text, float *fgColor, int font, int x, int y, int align, int maxlen)
Create a new label (extended version).
Definition: guilabel.cpp:63
int GfuiTitleCreate(void *scr, const char *text, int maxlen)
Add a Title to the screen.
Definition: guilabel.cpp:170
int GfuiScrollListCreate(void *scr, int font, int x, int y, int align, int width, int height, int scrollbar, void *userDataOnSelect, tfuiCallback onSelect)
Create a new scroll list.
void GfctrlMouseCenter(void)
Recentre the mouse on the screen.
Definition: control.cpp:476
int GfuiGrButtonCreate(void *scr, const char *disabled, const char *enabled, const char *focused, const char *pushed, int x, int y, int align, int mouse, void *userDataOnPush, tfuiCallback onPush, void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost)
Add a graphical button to a screen.
Definition: guibutton.cpp:62
void * GfuiScreenCreate(void)
Create a new screen.
Definition: gui.cpp:543
void GfuiPrintString(const char *text, float *fgColor, int font, int x, int y, int align)
Definition: guiobject.cpp:43
static int onKeyAction(unsigned char key, int, int state)
void GfTime2Str(char *result, int resultSize, tdble sec, int sgn)
Convert a time in seconds (float) to an ascii string.
Definition: tgf.cpp:193
Mouse information structure.
Definition: tgfclient.h:294
int sgn(Scalar x)
Definition: Basic.h:46
struct ScrollBarInfo tScrollBarInfo
Scroll bar call-back information.
int index
Definition: tgfclient.h:266
void GfScrShutdown(void)
Shutdown the screen.
Definition: screen.cpp:442
void GfuiHookRelease(void *hook)
Release the given hook.
Definition: gui.cpp:696
int GfuiMenuBackQuitButtonCreate(void *menu, const char *text, const char *tip, void *userdata, tfuiCallback onpush)
Add the "Back" or "Quit" button at the bottom of the menu screen.
Definition: guimenu.cpp:156
void(* tfuiSBCallback)(tScrollBarInfo *)
Definition: tgfclient.h:106
void GfuiScreenDeactivate(void)
Deactivate the current screen.
Definition: gui.cpp:520
#define NUM_JOY
Definition: tgfclient.h:35
static int onSKeyAction(int key, int, int state)