1 diff -ur tf-50b3/src/globals.h tfmod/src/globals.h
2 --- tf-50b3/src/globals.h Tue Jan 6 01:11:04 2004
3 +++ tfmod/src/globals.h Mon Jan 5 23:28:48 2004
5 #define sockmload getintvar(VAR_sockmload)
6 #define status_fields getstdvar(VAR_stat_fields)
7 #define status_pad getstdvar(VAR_stat_pad)
8 +#define status_height getintvar(VAR_stat_height)
9 #define sub getintvar(VAR_sub)
10 #define tabsize getintvar(VAR_tabsize)
11 #define telopt getintvar(VAR_telopt)
12 diff -ur tf-50b3/src/output.c tfmod/src/output.c
13 --- tf-50b3/src/output.c Tue Jan 6 01:11:04 2004
14 +++ tfmod/src/output.c Tue Jan 6 00:27:03 2004
16 * Handles all screen-related phenomena.
17 *****************************************************************/
19 +#define MAX_STATUS_HEIGHT 5
25 lines = ((str = getvar("LINES"))) ? atoi(str) : 0;
26 columns = ((str = getvar("COLUMNS"))) ? atoi(str) : 0;
27 if (lines <= 0 || columns <= 0) get_window_size();
28 - ystatus = lines - isize;
29 + ystatus = lines - isize - (status_height-1);
31 bottom_margin = lines;
36 - Stringninit(status_line, columns);
37 - check_charattrs(status_line, columns, 0, __FILE__, __LINE__);
38 + Stringninit(status_line, columns*MAX_STATUS_HEIGHT);
39 + check_charattrs(status_line, columns*MAX_STATUS_HEIGHT, 0, __FILE__, __LINE__);
46 if (isize > lines - 3) set_var_by_id(VAR_isize, lines - 3);
47 - ystatus = lines - isize;
48 + ystatus = lines - isize - (status_height - 1);
50 outcount = ystatus - 1;
56 - iy = iendy = istarty = ystatus + 1;
57 + iy = iendy = istarty = ystatus + status_height;
64 if (width > columns) {
65 - eprintf("status_fields: status width (%d) is wider than screen (%d)",
67 +// eprintf("status_fields: status width (%d) is wider than screen (%d)",
71 /* update new fields */
72 @@ -1374,21 +1376,21 @@
75 if (field->column >= 0)
76 - return (field->column > columns) ? columns : field->column;
77 + return (field->column > columns*status_height) ? columns*status_height : field->column;
78 column = field->column +
79 - ((status_left + status_right > columns) ?
80 - status_left + status_right : columns);
81 - return (column > columns) ? columns : column;
82 + ((status_left + status_right > columns*status_height) ?
83 + status_left + status_right : columns*status_height);
84 + return (column > columns*status_height) ? columns*status_height : column;
87 static int status_width(StatusField *field, int start)
90 - if (start >= columns) return 0;
91 - width = (field->width == 0) ? columns - status_right - status_left :
92 + if (start >= columns*status_height) return 0;
93 + width = (field->width == 0) ? columns*status_height - status_right - status_left :
94 (field->width > 0) ? field->width : -field->width;
95 - if (width > columns - start)
96 - width = columns - start;
97 + if (width > columns*status_height - start)
98 + width = columns*status_height - start;
102 @@ -1548,7 +1550,7 @@
104 if (internal >= 0 && field->internal != internal) continue;
105 column = status_field_column(field);
106 - if (column >= columns) /* doesn't fit, nor will any later fields */
107 + if (column >= columns*status_height) /* doesn't fit, nor will any later fields */
110 width = format_status_field(field);
111 @@ -1589,12 +1591,12 @@
112 for (node = status_field_list->head; node; node = node->next) {
113 field = (StatusField*)node->datum;
115 - if ((column = status_field_column(field)) >= columns)
116 + if ((column = status_field_column(field)) >= columns*status_height)
118 width = format_status_field(field);
121 - for (column += width; column < columns; column++) {
122 + for (column += width; column < columns*status_height; column++) {
123 status_line->data[column] = true_status_pad;
124 status_line->charattrs[column] = status_attr;
126 @@ -1602,23 +1604,33 @@
128 int display_status_line(void)
131 if (screen_mode < 1) return 0;
134 /* no overlap with alert */
136 - hwrite(status_line, 0, columns, 0);
137 + for (i=0;i<status_height;i++) {
139 + hwrite(status_line, (columns*i), columns, 0);
142 /* overlap with alert (this could happen in ch_status_attr()) */
143 - if (alert_pos > 0) {
145 - hwrite(status_line, 0, alert_pos, 0);
147 - if (alert_pos + alert_len < columns) {
148 - xy(alert_pos + alert_len + 1, ystatus);
149 - hwrite(status_line, alert_pos + alert_len,
150 - columns - (alert_pos + alert_len), 0);
151 + for (i=0;i<status_height;i++) {
153 + if (alert_pos > 0) {
155 + hwrite(status_line, 0, alert_pos, 0);
157 + if (alert_pos + alert_len < columns) {
158 + xy(alert_pos + alert_len + 1, ystatus);
159 + hwrite(status_line, alert_pos + alert_len,
160 + columns - (alert_pos + alert_len), 0);
164 + hwrite(status_line, (columns*i), columns, 0);
170 @@ -1710,11 +1722,12 @@
173 static int old_isize = 0;
174 + static int old_height = 0;
177 - if (status_line->len < columns)
178 - Stringnadd(status_line, '?', columns - status_line->len);
179 - Stringtrunc(status_line, columns);
180 + if (status_line->len < columns*status_height)
181 + Stringnadd(status_line, '?', columns*status_height - status_line->len);
182 + Stringtrunc(status_line, columns*status_height);
184 if (screen_mode < 0) { /* e.g., called by init_variables() */
186 @@ -1728,6 +1741,11 @@
188 } else if (isize != old_isize) { /* %isize changed */
190 + } else if (status_height != old_height) { /* %status_height changed */
191 + if (status_height > MAX_STATUS_HEIGHT) {
192 + set_var_by_id(VAR_stat_height, MAX_STATUS_HEIGHT);
195 } else { /* SIGWINCH */
196 /* Set ystatus to the top of the area fix_screen() must erase. */
198 @@ -1742,6 +1760,7 @@
199 transmit_window_size();
202 + old_height = status_height;
206 @@ -1810,9 +1829,9 @@
207 static void clear_input_window(void)
209 /* only called in visual mode */
210 - clear_lines(ystatus + 1, lines);
211 + clear_lines(ystatus + status_height, lines);
213 - iy = iendy = istarty = ystatus + 1;
214 + iy = iendy = istarty = ystatus + status_height;
218 @@ -1830,14 +1849,14 @@
219 static void scroll_input(int n)
222 - clear_lines(ystatus + 1, lines);
223 - iendy = ystatus + 1;
224 + clear_lines(ystatus + status_height, lines);
225 + iendy = ystatus + status_height;
226 } else if (delete_line) {
227 - xy(1, ystatus + 1);
228 + xy(1, ystatus + status_height);
229 for (iendy = lines + 1; iendy > lines - n + 1; iendy--)
231 } else if (has_scroll_region) {
232 - setscroll(ystatus + 1, lines);
233 + setscroll(ystatus + status_height, lines);
235 crnl(n); /* DON'T: cy += n; */
236 iendy = lines - n + 1;
237 @@ -1986,7 +2005,7 @@
239 } else if (scroll && !clearfull) {
241 - if (istarty > ystatus + 1) istarty--;
242 + if (istarty > ystatus + status_height) istarty--;
244 clear_input_window();
246 @@ -2176,7 +2195,7 @@
247 ioutall(place - (ix - 1) - (iy - lines - 1) * Wrap);
250 - } else if ((iy < ystatus + 1) || (iy > lines)) {
251 + } else if ((iy < ystatus + status_height) || (iy > lines)) {
255 diff -ur tf-50b3/src/varlist.h tfmod/src/varlist.h
256 --- tf-50b3/src/varlist.h Tue Jan 6 01:11:05 2004
257 +++ tfmod/src/varlist.h Mon Jan 5 23:35:36 2004
259 varflag(VAR_sockmload, "sockmload", FALSE, NULL)
260 varstr (VAR_stat_attr, "status_attr", NULL, ch_status_attr)
261 varstr (VAR_stat_fields,"status_fields",NULL, ch_status_fields)
262 +varint (VAR_stat_height,"status_height",1, ch_visual)
263 varstr (VAR_stat_pad, "status_pad", "_", update_status_line)
264 varstr (VAR_stint_clock,"status_int_clock",NULL, ch_status_int)
265 varstr (VAR_stint_more, "status_int_more",NULL, ch_status_int)