Update the discussion of themeing in the manual, and put a note in the wps tags appen...
[kugel-rb.git] / apps / plugins / doom / st_lib.h
blob09e5faaf8725ed14e7a995f574d802334a859f89
1 /* Emacs style mode select -*- C++ -*-
2 *-----------------------------------------------------------------------------
5 * PrBoom a Doom port merged with LxDoom and LSDLDoom
6 * based on BOOM, a modified and improved DOOM engine
7 * Copyright (C) 1999 by
8 * id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
9 * Copyright (C) 1999-2000 by
10 * Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25 * 02111-1307, USA.
27 * DESCRIPTION:
28 * The status bar widget definitions and prototypes
30 *-----------------------------------------------------------------------------*/
32 #ifndef __STLIB__
33 #define __STLIB__
35 // We are referring to patches.
36 #include "r_defs.h"
37 #include "v_video.h" // color ranges
40 // Background and foreground screen numbers
42 #define BG 4
43 #define FG 0
46 // Typedefs of widgets
49 // Number widget
51 typedef struct
53 // upper right-hand corner
54 // of the number (right-justified)
55 int x;
56 int y;
58 // max # of digits in number
59 int width;
61 // last number value
62 int oldnum;
64 // pointer to current value
65 int* num;
67 // pointer to boolean stating
68 // whether to update number
69 boolean* on;
71 // list of patches for 0-9
72 const patchnum_t* p;
74 // user data
75 int data;
76 } st_number_t;
78 // Percent widget ("child" of number widget,
79 // or, more precisely, contains a number widget.)
80 typedef struct
82 // number information
83 st_number_t n;
85 // percent sign graphic
86 const patchnum_t* p;
87 } st_percent_t;
89 // Multiple Icon widget
90 typedef struct
92 // center-justified location of icons
93 int x;
94 int y;
96 // last icon number
97 int oldinum;
99 // pointer to current icon
100 int* inum;
102 // pointer to boolean stating
103 // whether to update icon
104 boolean* on;
106 // list of icons
107 const patchnum_t* p;
109 // user data
110 int data;
112 } st_multicon_t;
114 // Binary Icon widget
116 typedef struct
118 // center-justified location of icon
119 int x;
120 int y;
122 // last icon value
123 int oldval;
125 // pointer to current icon status
126 boolean* val;
128 // pointer to boolean
129 // stating whether to update icon
130 boolean* on;
132 const patchnum_t* p; // icon
133 int data; // user data
134 } st_binicon_t;
137 // Widget creation, access, and update routines
140 // Initializes widget library.
141 // More precisely, initialize STMINUS,
142 // everything else is done somewhere else.
144 void STlib_init(void);
146 // Number widget routines
147 void STlib_initNum
148 ( st_number_t* n,
149 int x,
150 int y,
151 const patchnum_t* pl,
152 int* num,
153 boolean* on,
154 int width );
156 void STlib_updateNum
157 ( st_number_t* n,
158 int cm,
159 boolean refresh );
162 // Percent widget routines
163 void STlib_initPercent
164 ( st_percent_t* p,
165 int x,
166 int y,
167 const patchnum_t* pl,
168 int* num,
169 boolean* on,
170 const patchnum_t* percent );
173 void STlib_updatePercent
174 ( st_percent_t* per,
175 int cm,
176 int refresh );
179 // Multiple Icon widget routines
180 void STlib_initMultIcon
181 ( st_multicon_t* mi,
182 int x,
183 int y,
184 const patchnum_t* il,
185 int* inum,
186 boolean* on );
189 void STlib_updateMultIcon
190 ( st_multicon_t* mi,
191 boolean refresh );
193 // Binary Icon widget routines
195 void STlib_initBinIcon
196 ( st_binicon_t* b,
197 int x,
198 int y,
199 const patchnum_t* i,
200 boolean* val,
201 boolean* on );
203 void STlib_updateBinIcon
204 ( st_binicon_t* bi,
205 boolean refresh );
207 #endif