-
Notifications
You must be signed in to change notification settings - Fork 2
/
gui.h
103 lines (85 loc) · 2.62 KB
/
gui.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/* --------------------------------------------------------------------
EXTREME TUXRACER
Copyright (C) 1999-2001 Jasmin F. Patry (Tuxracer)
Copyright (C) 2010 Extreme Tuxracer Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
---------------------------------------------------------------------*/
#ifndef GUI_H
#define GUI_H
#include "bh.h"
#define MAX_MOUSERECTS 32
#define MAX_ARROWS 16
#define MAX_TEXTBUTTONS 16
#define MAX_ICONBUTTONS 8
#define MAX_CHECKBOXES 16
typedef enum {
W_ARROW,
W_TEXTBUTTON,
W_ICONBUTTON,
W_CHECKBOX
} TWidgetType;
typedef struct {
TRect rect;
int focus;
int dir;
int arrnr;
TWidgetType type;
} TMouseRect;
typedef struct {
int x;
int y;
int dir;
int focus;
} TArrow;
typedef struct {
int x;
int y;
int font;
string text;
int focus;
double ftsize; // font height
} TTextButton;
typedef struct {
int x;
int y;
int focus;
double size;
GLuint texid;
} TIconButton;
typedef struct {
int x;
int y;
int focus;
int width;
string tag;
} TCheckbox;
void GetFocus (int x, int y, int *focus, int *dir);
void ResetWidgets ();
void AddArrow (int x, int y, int dir, int focus);
void PrintArrow (int nr, bool active);
void AddTextButton (const char *text, int x, int y, int focus, double ftsize);
void AddTextButton (const string text, int x, int y, int focus, double ftsize);
void AddTextButtonN (const char *text, int x, int y, int focus, int rel_ftsize);
void AddTextButtonN (const string text, int x, int y, int focus, int rel_ftsize);
void PrintTextButton (int nr, int focus);
void AddIconButton (int x, int y, int focus, GLuint texid, double size);
void PrintIconButton (int nr, int focus, int state);
void AddCheckbox (int x, int y, int focus, int width, const string tag);
void PrintCheckbox (int nr, int focus, bool state);
void DrawFrameX (int x, int y, int w, int h, int line,
TColor backcol, TColor framecol, double transp);
void DrawLevel (int x, int y, int level, double fact);
void DrawBonus (int x, int y, int max, int num);
void DrawBonusExt (int y, int numraces, int num);
void DrawCursor ();
// --------------------------------------------------------------------
int AutoYPosN (double percent);
TArea AutoAreaN (double top_perc, double bott_perc, int w);
#endif