# Correct the needed linklibs in curl-config also.
[AROS-Contrib.git] / Games / Doom / hu_lib.h
blob6744283dbb5ceca4e868467ddbe03ee6752a96b9
1 // Emacs style mode select -*- C++ -*-
2 //-----------------------------------------------------------------------------
3 //
4 // $Id$
5 //
6 // Copyright (C) 1993-1996 by id Software, Inc.
7 //
8 // This source is available for distribution and/or modification
9 // only under the terms of the DOOM Source Code License as
10 // published by id Software. All rights reserved.
12 // The source is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
15 // for more details.
17 // DESCRIPTION: none
19 //-----------------------------------------------------------------------------
21 #ifndef __HULIB__
22 #define __HULIB__
24 // We are referring to patches.
25 #include "r_defs.h"
28 // background and foreground screen numbers
29 // different from other modules.
30 #define BG 1
31 #define FG 0
33 // font stuff
34 #define HU_CHARERASE KEY_BACKSPACE
36 #define HU_MAXLINES 4
37 #define HU_MAXLINELENGTH 80
40 // Typedefs of widgets
43 // Text Line widget
44 // (parent of Scrolling Text and Input Text widgets)
45 typedef struct
47 // left-justified position of scrolling text window
48 int x;
49 int y;
51 patch_t** f; // font
52 int sc; // start character
53 char l[HU_MAXLINELENGTH+1]; // line of text
54 int len; // current line length
56 // whether this line needs to be udpated
57 int needsupdate;
59 } hu_textline_t;
63 // Scrolling Text window widget
64 // (child of Text Line widget)
65 typedef struct
67 hu_textline_t l[HU_MAXLINES]; // text lines to draw
68 int h; // height in lines
69 int cl; // current line number
71 // pointer to boolean stating whether to update window
72 boolean* on;
73 boolean laston; // last value of *->on.
75 } hu_stext_t;
79 // Input Text Line widget
80 // (child of Text Line widget)
81 typedef struct
83 hu_textline_t l; // text line to input on
85 // left margin past which I am not to delete characters
86 int lm;
88 // pointer to boolean stating whether to update window
89 boolean* on;
90 boolean laston; // last value of *->on;
92 } hu_itext_t;
96 // Widget creation, access, and update routines
99 // initializes heads-up widget library
100 void HUlib_init(void);
103 // textline code
106 // clear a line of text
107 void HUlib_clearTextLine(hu_textline_t *t);
109 void HUlib_initTextLine(hu_textline_t *t, int x, int y, patch_t **f, int sc);
111 // returns success
112 boolean HUlib_addCharToTextLine(hu_textline_t *t, char ch);
114 // returns success
115 boolean HUlib_delCharFromTextLine(hu_textline_t *t);
117 // draws tline
118 void HUlib_drawTextLine(hu_textline_t *l, boolean drawcursor);
120 // erases text line
121 void HUlib_eraseTextLine(hu_textline_t *l);
125 // Scrolling Text window widget routines
128 // ?
129 void
130 HUlib_initSText
131 ( hu_stext_t* s,
132 int x,
133 int y,
134 int h,
135 patch_t** font,
136 int startchar,
137 boolean* on );
139 // add a new line
140 void HUlib_addLineToSText(hu_stext_t* s);
142 // ?
143 void
144 HUlib_addMessageToSText
145 ( hu_stext_t* s,
146 char* prefix,
147 char* msg );
149 // draws stext
150 void HUlib_drawSText(hu_stext_t* s);
152 // erases all stext lines
153 void HUlib_eraseSText(hu_stext_t* s);
155 // Input Text Line widget routines
156 void
157 HUlib_initIText
158 ( hu_itext_t* it,
159 int x,
160 int y,
161 patch_t** font,
162 int startchar,
163 boolean* on );
165 // enforces left margin
166 void HUlib_delCharFromIText(hu_itext_t* it);
168 // enforces left margin
169 void HUlib_eraseLineFromIText(hu_itext_t* it);
171 // resets line and left margin
172 void HUlib_resetIText(hu_itext_t* it);
174 // left of left-margin
175 void
176 HUlib_addPrefixToIText
177 ( hu_itext_t* it,
178 char* str );
180 // whether eaten
181 boolean
182 HUlib_keyInIText
183 ( hu_itext_t* it,
184 unsigned char ch );
186 void HUlib_drawIText(hu_itext_t* it);
188 // erases all itext lines
189 void HUlib_eraseIText(hu_itext_t* it);
191 #endif
192 //-----------------------------------------------------------------------------
194 // $Log$
195 // Revision 1.1 2000/02/29 18:21:06 stegerg
196 // Doom port based on ADoomPPC. Read README.AROS!
199 //-----------------------------------------------------------------------------