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
29 *-----------------------------------------------------------------------------*/
34 // We are referring to patches.
36 #include "v_video.h" //jff 2/16/52 include color range defs
39 /* background and foreground screen numbers
40 * different from other modules. */
45 * #define HU_CHARERASE KEYD_BACKSPACE / not used / phares
49 #define HU_MAXLINELENGTH 80
50 #define HU_REFRESHSPACING 8 /*jff 2/26/98 space lines in text refresh widget*/
51 /*jff 2/26/98 maximum number of messages allowed in refresh list */
52 #define HU_MAXMESSAGES 16
59 * (parent of Scrolling Text and Input Text widgets) */
62 // left-justified position of scrolling text window
66 const patchnum_t
* f
; // font
67 int sc
; // start character
68 //const char *cr; //jff 2/16/52 output color range
69 // Proff - Made this an int again. Needed for OpenGL
70 int cm
; //jff 2/16/52 output color range
72 // killough 1/23/98: Support multiple lines:
76 char l
[HU_MAXLINELENGTH
*MAXLINES
+1]; // line of text
77 int len
; // current line length
79 // whether this line needs to be udpated
86 // Scrolling Text window widget
87 // (child of Text Line widget)
90 hu_textline_t l
[HU_MAXLINES
]; // text lines to draw
91 int h
; // height in lines
92 int cl
; // current line number
94 // pointer to boolean stating whether to update window
96 boolean laston
; // last value of *->on.
100 //jff 2/26/98 new widget to display last hud_msg_lines of messages
101 // Message refresh window widget
104 hu_textline_t l
[HU_MAXMESSAGES
]; // text lines to draw
105 int nl
; // height in lines
106 int nr
; // total height in rows
107 int cl
; // current line number
109 int x
,y
,w
,h
; // window position and size
110 const patchnum_t
*bg
; // patches for background
112 // pointer to boolean stating whether to update window
114 boolean laston
; // last value of *->on.
120 // Input Text Line widget
121 // (child of Text Line widget)
124 hu_textline_t l
; // text line to input on
126 // left margin past which I am not to delete characters
129 // pointer to boolean stating whether to update window
131 boolean laston
; // last value of *->on;
137 // Widget creation, access, and update routines
140 // initializes heads-up widget library
141 void HUlib_init(void);
147 // clear a line of text
148 void HUlib_clearTextLine(hu_textline_t
*t
);
150 void HUlib_initTextLine
157 int cm
//jff 2/16/98 add color range parameter
161 boolean
HUlib_addCharToTextLine(hu_textline_t
*t
, char ch
);
164 boolean
HUlib_delCharFromTextLine(hu_textline_t
*t
);
167 void HUlib_drawTextLine(hu_textline_t
*l
, boolean drawcursor
);
170 void HUlib_eraseTextLine(hu_textline_t
*l
);
174 // Scrolling Text window widget routines
177 // initialize an stext widget
183 const patchnum_t
* font
,
185 int cm
, //jff 2/16/98 add color range parameter
189 void HUlib_addLineToSText(hu_stext_t
* s
);
191 // add a text message to an stext widget
192 void HUlib_addMessageToSText(hu_stext_t
* s
, const char* prefix
, const char* msg
);
195 void HUlib_drawSText(hu_stext_t
* s
);
197 // erases all stext lines
198 void HUlib_eraseSText(hu_stext_t
* s
);
200 //jff 2/26/98 message refresh widget
201 // initialize refresh text widget
202 void HUlib_initMText(hu_mtext_t
*m
, int x
, int y
, int w
, int h
, const patchnum_t
* font
,
203 int startchar
, int cm
, const patchnum_t
* bgfont
, boolean
*on
);
205 //jff 2/26/98 message refresh widget
206 // add a text line to refresh text widget
207 void HUlib_addLineToMText( hu_mtext_t
* m
);
209 //jff 2/26/98 message refresh widget
210 // add a text message to refresh text widget
211 void HUlib_addMessageToMText(hu_mtext_t
* m
, const char* prefix
, const char* msg
);
213 //jff 2/26/98 new routine to display a background on which
214 // the list of last hud_msg_lines are displayed
220 const patchnum_t
* bgp
223 //jff 2/26/98 message refresh widget
225 void HUlib_drawMText(hu_mtext_t
* m
);
227 //jff 4/28/98 erases behind message list
228 void HUlib_eraseMText(hu_mtext_t
* m
);
230 // Input Text Line widget routines
235 const patchnum_t
* font
,
237 int cm
, //jff 2/16/98 add color range parameter
240 // enforces left margin
241 void HUlib_delCharFromIText(hu_itext_t
* it
);
243 // enforces left margin
244 void HUlib_eraseLineFromIText(hu_itext_t
* it
);
246 // resets line and left margin
247 void HUlib_resetIText(hu_itext_t
* it
);
249 // left of left-margin
250 void HUlib_addPrefixToIText
255 boolean HUlib_keyInIText
259 void HUlib_drawIText(hu_itext_t
* it
);
261 // erases all itext lines
262 void HUlib_eraseIText(hu_itext_t
* it
);