1 diff -ur tf-50b5/src/globals.h tf-50b5-patch/src/globals.h
2 --- tf-50b5/src/globals.h Wed Jul 21 02:19:41 2004
3 +++ tf-50b5-patch/src/globals.h Wed Jul 28 00:21:15 2004
5 #define status_attr getattrvar(VAR_stat_attr)
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-50b5/src/main.c tf-50b5-patch/src/main.c
13 --- tf-50b5/src/main.c Fri Jul 16 23:13:51 2004
14 +++ tf-50b5-patch/src/main.c Wed Jul 28 00:21:15 2004
17 "TinyFugue version 5.0 beta 5";
19 -const char mods[] = "";
20 +const char mods[] = "With multistatus line written by Someone [Minor changes by Karol Lassak (ingwar@ingwar.eu.org)]";
22 const char copyright[] =
23 "Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2003, 2004 Ken Keys (hawkeye@tcp.com)";
24 diff -ur tf-50b5/src/output.c tf-50b5-patch/src/output.c
25 --- tf-50b5/src/output.c Tue Jul 27 03:02:34 2004
26 +++ tf-50b5-patch/src/output.c Wed Jul 28 00:21:15 2004
28 * Handles all screen-related phenomena.
29 *****************************************************************/
31 +#define MAX_STATUS_HEIGHT 5
37 lines = ((str = getvar("LINES"))) ? atoi(str) : 0;
38 columns = ((str = getvar("COLUMNS"))) ? atoi(str) : 0;
39 if (lines <= 0 || columns <= 0) get_window_size();
40 - ystatus = lines - isize;
41 + ystatus = lines - isize - (status_height - 1);
43 bottom_margin = lines;
48 - Stringninit(status_line, columns);
49 - check_charattrs(status_line, columns, 0, __FILE__, __LINE__);
50 + Stringninit(status_line, columns * MAX_STATUS_HEIGHT);
51 + check_charattrs(status_line, columns * MAX_STATUS_HEIGHT, 0, __FILE__, __LINE__);
52 ch_attr(&special_var[VAR_hiliteattr]);
53 ch_attr(&special_var[VAR_alert_attr]);
54 ch_attr(&special_var[VAR_stat_attr]);
58 if (isize > lines - 3) set_var_by_id(VAR_isize, lines - 3);
59 - ystatus = lines - isize;
60 + ystatus = lines - isize - (status_height - 1);
62 outcount = ystatus - 1;
66 update_status_line(NULL);
68 - iy = iendy = istarty = ystatus + 1;
69 + iy = iendy = istarty = ystatus + status_height;
74 inlist(field, status_field_list, status_field_list->tail);
77 - if (width > columns) {
78 - eprintf("status_fields: status width (%d) is wider than screen (%d)",
80 + if (width > columns * status_height) {
81 + eprintf("status_fields: status width (%d) is wider than screen * status height (%d * %d)",
82 + width, columns, status_height);
85 /* update new fields */
86 @@ -1408,21 +1410,21 @@
89 if (field->column >= 0)
90 - return (field->column > columns) ? columns : field->column;
91 + return (field->column > columns * status_height) ? columns * status_height : field->column;
92 column = field->column +
93 - ((status_left + status_right > columns) ?
94 - status_left + status_right : columns);
95 - return (column > columns) ? columns : column;
96 + ((status_left + status_right > columns * status_height) ?
97 + status_left + status_right : columns * status_height);
98 + return (column > columns * status_height) ? columns * status_height : column;
101 static int status_width(StatusField *field, int start)
104 - if (start >= columns) return 0;
105 - width = (field->width == 0) ? columns - status_right - status_left :
106 + if (start >= columns * status_height) return 0;
107 + width = (field->width == 0) ? columns * status_height - status_right - status_left :
108 (field->width > 0) ? field->width : -field->width;
109 - if (width > columns - start)
110 - width = columns - start;
111 + if (width > columns * status_height - start)
112 + width = columns * status_height - start;
116 @@ -1580,8 +1582,8 @@
119 if (internal >= 0 && field->internal != internal) continue;
120 - column = status_field_column(field);
121 - if (column >= columns) /* doesn't fit, nor will any later fields */
122 + column = status_field_column(field);
123 + if (column >= columns * status_height) /* doesn't fit, nor will any later fields */
126 width = format_status_field(field);
127 @@ -1590,17 +1592,17 @@
128 column >= alert_pos + alert_len)
130 /* no overlap with alert */
131 - xy(column + 1, ystatus);
132 + xy((column + 1) % columns, ystatus + (column / columns));
133 hwrite(CS(status_line), column, width, 0);
135 if (column < alert_pos) {
136 /* field starts left of alert */
137 - xy(column + 1, ystatus);
138 + xy((column + 1) % columns, ystatus + (column / columns));
139 hwrite(CS(status_line), column, alert_pos - column, 0);
141 if (column + width >= alert_pos) {
142 /* field ends right of alert */
143 - xy(alert_pos + alert_len + 1, ystatus);
144 + xy((alert_pos + alert_len + 1) % columns, ystatus + (column / columns));
145 hwrite(CS(status_line), alert_pos + alert_len,
146 column + width - (alert_pos + alert_len), 0);
148 @@ -1622,12 +1624,12 @@
149 for (node = status_field_list->head; node; node = node->next) {
150 field = (StatusField*)node->datum;
152 - if ((column = status_field_column(field)) >= columns)
153 + if ((column = status_field_column(field)) >= columns * status_height)
155 width = format_status_field(field);
158 - for (column += width; column < columns; column++) {
159 + for (column += width; column < columns * status_height; column++) {
160 status_line->data[column] = true_status_pad;
161 status_line->charattrs[column] = status_attr;
163 @@ -1635,23 +1637,33 @@
165 int display_status_line(void)
168 if (screen_mode < 1) return 0;
171 /* no overlap with alert */
173 - hwrite(CS(status_line), 0, columns, 0);
174 + for (i = 0; i < status_height; i++) {
175 + xy(1, ystatus + i);
176 + hwrite(CS(status_line), (columns * i), columns, 0);
179 /* overlap with alert (this could happen in ch_status_attr()) */
180 - if (alert_pos > 0) {
182 - hwrite(CS(status_line), 0, alert_pos, 0);
184 - if (alert_pos + alert_len < columns) {
185 - xy(alert_pos + alert_len + 1, ystatus);
186 - hwrite(CS(status_line), alert_pos + alert_len,
187 - columns - (alert_pos + alert_len), 0);
189 + for (i = 0; i < status_height; i++) {
191 + if (alert_pos > 0) {
193 + hwrite(CS(status_line), 0, alert_pos, 0);
195 + if (alert_pos + alert_len < columns) {
196 + xy(alert_pos + alert_len + 1, ystatus);
197 + hwrite(CS(status_line), alert_pos + alert_len,
198 + columns - (alert_pos + alert_len), 0);
201 + xy(1, ystatus + i);
202 + hwrite(CS(status_line), (columns * i), columns, 0);
208 @@ -1744,9 +1756,9 @@
212 - if (status_line->len < columns)
213 - Stringnadd(status_line, '?', columns - status_line->len);
214 - Stringtrunc(status_line, columns);
215 + if (status_line->len < columns * status_height)
216 + Stringnadd(status_line, '?', columns * status_height - status_line->len);
217 + Stringtrunc(status_line, columns * status_height);
219 if (screen_mode < 0) { /* e.g., called by init_variables() */
221 @@ -1760,6 +1772,11 @@
223 } else if (var == &special_var[VAR_isize]) { /* %isize changed */
225 + } else if (var == &special_var[VAR_stat_height]) { /* %status_height changed */
226 + if (status_height > MAX_STATUS_HEIGHT) {
227 + set_var_by_id(VAR_stat_height, MAX_STATUS_HEIGHT);
230 } else { /* SIGWINCH */
231 /* Set ystatus to the top of the area fix_screen() must erase. */
233 @@ -1853,9 +1870,9 @@
234 static void clear_input_window(void)
236 /* only called in visual mode */
237 - clear_lines(ystatus + 1, lines);
238 + clear_lines(ystatus + status_height, lines);
240 - iy = iendy = istarty = ystatus + 1;
241 + iy = iendy = istarty = ystatus + status_height;
245 @@ -1873,14 +1890,14 @@
246 static void scroll_input(int n)
249 - clear_lines(ystatus + 1, lines);
250 - iendy = ystatus + 1;
251 + clear_lines(ystatus + status_height, lines);
252 + iendy = ystatus + status_height;
253 } else if (delete_line) {
254 - xy(1, ystatus + 1);
255 + xy(1, ystatus + status_height);
256 for (iendy = lines + 1; iendy > lines - n + 1; iendy--)
258 } else if (has_scroll_region) {
259 - setscroll(ystatus + 1, lines);
260 + setscroll(ystatus + status_height, lines);
262 crnl(n); /* DON'T: cy += n; */
263 iendy = lines - n + 1;
264 @@ -2039,7 +2056,7 @@
266 } else if (scroll && !clearfull) {
268 - if (istarty > ystatus + 1) istarty--;
269 + if (istarty > ystatus + status_height) istarty--;
271 clear_input_window();
273 @@ -2273,7 +2290,7 @@
274 ioutall(place - (ix - 1) - (iy - lines - 1) * Wrap);
277 - } else if ((iy < ystatus + 1) || (iy > lines)) {
278 + } else if ((iy < ystatus + status_height) || (iy > lines)) {
282 diff -ur tf-50b5/src/varlist.h tf-50b5-patch/src/varlist.h
283 --- tf-50b5/src/varlist.h Mon Jul 26 10:30:56 2004
284 +++ tf-50b5-patch/src/varlist.h Wed Jul 28 00:21:15 2004
286 varstr (VAR_sprefix, "sprefix", NULL, NULL)
287 varstr (VAR_stat_attr, "status_attr", NULL, ch_status_attr)
288 varstr (VAR_stat_fields,"status_fields",NULL, ch_status_fields)
289 +varint (VAR_stat_height,"status_height",1, ch_visual)
290 varstr (VAR_stat_pad, "status_pad", "_", update_status_line)
291 varstr (VAR_stint_clock,"status_int_clock",NULL, ch_status_int)
292 varstr (VAR_stint_more, "status_int_more",NULL, ch_status_int)