XenevaOS
Loading...
Searching...
No Matches
st_lib.h
Go to the documentation of this file.
1//
2// Copyright(C) 1993-1996 Id Software, Inc.
3// Copyright(C) 2005-2014 Simon Howard
4//
5// This program is free software; you can redistribute it and/or
6// modify it under the terms of the GNU General Public License
7// as published by the Free Software Foundation; either version 2
8// of the License, or (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// DESCRIPTION:
16// The status bar widget code.
17//
18
19#ifndef __STLIB__
20#define __STLIB__
21
22
23// We are referring to patches.
24#include "r_defs.h"
25
26//
27// Typedefs of widgets
28//
29
30// Number widget
31
32typedef struct
33{
34 // upper right-hand corner
35 // of the number (right-justified)
36 int x;
37 int y;
38
39 // max # of digits in number
40 int width;
41
42 // last number value
43 int oldnum;
44
45 // pointer to current value
46 int* num;
47
48 // pointer to boolean stating
49 // whether to update number
50 boolean* on;
51
52 // list of patches for 0-9
53 patch_t** p;
54
55 // user data
56 int data;
57
59
60
61
62// Percent widget ("child" of number widget,
63// or, more precisely, contains a number widget.)
64typedef struct
65{
66 // number information
68
69 // percent sign graphic
70 patch_t* p;
71
73
74
75
76// Multiple Icon widget
77typedef struct
78{
79 // center-justified location of icons
80 int x;
81 int y;
82
83 // last icon number
85
86 // pointer to current icon
87 int* inum;
88
89 // pointer to boolean stating
90 // whether to update icon
91 boolean* on;
92
93 // list of icons
94 patch_t** p;
95
96 // user data
97 int data;
98
100
101
102
103
104// Binary Icon widget
105
106typedef struct
107{
108 // center-justified location of icon
109 int x;
110 int y;
111
112 // last icon value
113 boolean oldval;
114
115 // pointer to current icon status
116 boolean* val;
117
118 // pointer to boolean
119 // stating whether to update icon
120 boolean* on;
121
122
123 patch_t* p; // icon
124 int data; // user data
125
127
128
129
130//
131// Widget creation, access, and update routines
132//
133
134// Initializes widget library.
135// More precisely, initialize STMINUS,
136// everything else is done somewhere else.
137//
138void STlib_init(void);
139
140
141
142// Number widget routines
143void
145( st_number_t* n,
146 int x,
147 int y,
148 patch_t** pl,
149 int* num,
150 boolean* on,
151 int width );
152
153void
155( st_number_t* n,
156 boolean refresh );
157
158
159// Percent widget routines
160void
162( st_percent_t* p,
163 int x,
164 int y,
165 patch_t** pl,
166 int* num,
167 boolean* on,
168 patch_t* percent );
169
170
171void
173( st_percent_t* per,
174 int refresh );
175
176
177// Multiple Icon widget routines
178void
180( st_multicon_t* mi,
181 int x,
182 int y,
183 patch_t** il,
184 int* inum,
185 boolean* on );
186
187
188void
190( st_multicon_t* mi,
191 boolean refresh );
192
193// Binary Icon widget routines
194
195void
197( st_binicon_t* b,
198 int x,
199 int y,
200 patch_t* i,
201 boolean* val,
202 boolean* on );
203
204void
206( st_binicon_t* bi,
207 boolean refresh );
208
209#endif
size_t b
Definition main.cpp:156
void STlib_initMultIcon(st_multicon_t *mi, int x, int y, patch_t **il, int *inum, boolean *on)
Definition st_lib.c:187
void STlib_initNum(st_number_t *n, int x, int y, patch_t **pl, int *num, boolean *on, int width)
Definition st_lib.c:60
void STlib_init(void)
Definition st_lib.c:51
void STlib_initPercent(st_percent_t *p, int x, int y, patch_t **pl, int *num, boolean *on, patch_t *percent)
Definition st_lib.c:157
void STlib_initBinIcon(st_binicon_t *b, int x, int y, patch_t *i, boolean *val, boolean *on)
Definition st_lib.c:237
void STlib_updateNum(st_number_t *n, boolean refresh)
Definition st_lib.c:147
void STlib_updateMultIcon(st_multicon_t *mi, boolean refresh)
Definition st_lib.c:206
void STlib_updatePercent(st_percent_t *per, int refresh)
Definition st_lib.c:174
void STlib_updateBinIcon(st_binicon_t *bi, boolean refresh)
Definition st_lib.c:256
Definition st_lib.h:107
boolean oldval
Definition st_lib.h:113
patch_t * p
Definition st_lib.h:123
int x
Definition st_lib.h:109
boolean * on
Definition st_lib.h:120
int data
Definition st_lib.h:124
boolean * val
Definition st_lib.h:116
int y
Definition st_lib.h:110
Definition st_lib.h:78
boolean * on
Definition st_lib.h:91
int x
Definition st_lib.h:80
patch_t ** p
Definition st_lib.h:94
int * inum
Definition st_lib.h:87
int oldinum
Definition st_lib.h:84
int data
Definition st_lib.h:97
int y
Definition st_lib.h:81
Definition st_lib.h:33
int y
Definition st_lib.h:37
int data
Definition st_lib.h:56
int * num
Definition st_lib.h:46
int oldnum
Definition st_lib.h:43
int width
Definition st_lib.h:40
int x
Definition st_lib.h:36
patch_t ** p
Definition st_lib.h:53
boolean * on
Definition st_lib.h:50
Definition st_lib.h:65
patch_t * p
Definition st_lib.h:70
st_number_t n
Definition st_lib.h:67