1 diff -ur tf-50b6/src/globals.h tf-50b6-patch/src/globals.h
2 --- tf-50b6/src/globals.h Wed Jul 21 02:19:41 2004
3 +++ tf-50b6-patch/src/globals.h Thu Aug 5 14:27:52 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-50b6/src/main.c tf-50b6-patch/src/main.c
13 --- tf-50b6/src/main.c Thu Jul 29 19:37:19 2004
14 +++ tf-50b6-patch/src/main.c Thu Aug 5 14:27:52 2004
17 "TinyFugue version 5.0 beta 6";
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 Only in tf-50b6-patch/src: main.c.orig
25 diff -ur tf-50b6/src/output.c tf-50b6-patch/src/output.c
26 --- tf-50b6/src/output.c Fri Jul 30 21:21:02 2004
27 +++ tf-50b6-patch/src/output.c Thu Aug 5 14:27:53 2004
29 * Handles all screen-related phenomena.
30 *****************************************************************/
32 +#define MAX_STATUS_HEIGHT 5
38 lines = ((str = getvar("LINES"))) ? atoi(str) : 0;
39 columns = ((str = getvar("COLUMNS"))) ? atoi(str) : 0;
40 if (lines <= 0 || columns <= 0) get_window_size();
41 - ystatus = lines - isize;
42 + ystatus = lines - isize - (status_height - 1);
44 bottom_margin = lines;
50 - Stringninit(status_line, columns);
51 - check_charattrs(status_line, columns, 0, __FILE__, __LINE__);
52 + Stringninit(status_line, columns * MAX_STATUS_HEIGHT);
53 + check_charattrs(status_line, columns * MAX_STATUS_HEIGHT, 0, __FILE__, __LINE__);
54 ch_attr(&special_var[VAR_hiliteattr]);
55 ch_attr(&special_var[VAR_alert_attr]);
56 ch_attr(&special_var[VAR_stat_attr]);
60 if (isize > lines - 3) set_var_by_id(VAR_isize, lines - 3);
61 - ystatus = lines - isize;
62 + ystatus = lines - isize - (status_height - 1);
64 outcount = ystatus - 1;
68 update_status_line(NULL);
70 - iy = iendy = istarty = ystatus + 1;
71 + iy = iendy = istarty = ystatus + status_height;
76 inlist(field, status_field_list, status_field_list->tail);
79 - if (width > columns) {
80 - eprintf("status_fields: status width (%d) is wider than screen (%d)",
82 + if (width > columns * status_height) {
83 + eprintf("status_fields: status width (%d) is wider than screen * status height (%d * %d)",
84 + width, columns, status_height);
87 /* update new fields */
88 @@ -1411,21 +1413,21 @@
91 if (field->column >= 0)
92 - return (field->column > columns) ? columns : field->column;
93 + return (field->column > columns * status_height) ? columns * status_height : field->column;
94 column = field->column +
95 - ((status_left + status_right > columns) ?
96 - status_left + status_right : columns);
97 - return (column > columns) ? columns : column;
98 + ((status_left + status_right > columns * status_height) ?
99 + status_left + status_right : columns * status_height);
100 + return (column > columns * status_height) ? columns * status_height : column;
103 static int status_width(StatusField *field, int start)
106 - if (start >= columns) return 0;
107 - width = (field->width == 0) ? columns - status_right - status_left :
108 + if (start >= columns * status_height) return 0;
109 + width = (field->width == 0) ? columns * status_height - status_right - status_left :
110 (field->width > 0) ? field->width : -field->width;
111 - if (width > columns - start)
112 - width = columns - start;
113 + if (width > columns * status_height - start)
114 + width = columns * status_height - start;
118 @@ -1583,8 +1585,8 @@
121 if (internal >= 0 && field->internal != internal) continue;
122 - column = status_field_column(field);
123 - if (column >= columns) /* doesn't fit, nor will any later fields */
124 + column = status_field_column(field);
125 + if (column >= columns * status_height) /* doesn't fit, nor will any later fields */
128 width = format_status_field(field);
129 @@ -1593,17 +1595,17 @@
130 column >= alert_pos + alert_len)
132 /* no overlap with alert */
133 - xy(column + 1, ystatus);
134 + xy((column + 1) % columns, ystatus + (column / columns));
135 hwrite(CS(status_line), column, width, 0);
137 if (column < alert_pos) {
138 /* field starts left of alert */
139 - xy(column + 1, ystatus);
140 + xy((column + 1) % columns, ystatus + (column / columns));
141 hwrite(CS(status_line), column, alert_pos - column, 0);
143 if (column + width >= alert_pos) {
144 /* field ends right of alert */
145 - xy(alert_pos + alert_len + 1, ystatus);
146 + xy((alert_pos + alert_len + 1) % columns, ystatus + (column / columns));
147 hwrite(CS(status_line), alert_pos + alert_len,
148 column + width - (alert_pos + alert_len), 0);
150 @@ -1625,12 +1627,12 @@
151 for (node = status_field_list->head; node; node = node->next) {
152 field = (StatusField*)node->datum;
154 - if ((column = status_field_column(field)) >= columns)
155 + if ((column = status_field_column(field)) >= columns * status_height)
157 width = format_status_field(field);
160 - for (column += width; column < columns; column++) {
161 + for (column += width; column < columns * status_height; column++) {
162 status_line->data[column] = true_status_pad;
163 status_line->charattrs[column] = status_attr;
165 @@ -1638,23 +1640,33 @@
167 int display_status_line(void)
170 if (screen_mode < 1) return 0;
173 /* no overlap with alert */
175 - hwrite(CS(status_line), 0, columns, 0);
176 + for (i = 0; i < status_height; i++) {
177 + xy(1, ystatus + i);
178 + hwrite(CS(status_line), (columns * i), columns, 0);
181 /* overlap with alert (this could happen in ch_status_attr()) */
182 - if (alert_pos > 0) {
184 - hwrite(CS(status_line), 0, alert_pos, 0);
186 - if (alert_pos + alert_len < columns) {
187 - xy(alert_pos + alert_len + 1, ystatus);
188 - hwrite(CS(status_line), alert_pos + alert_len,
189 - columns - (alert_pos + alert_len), 0);
191 + for (i = 0; i < status_height; i++) {
193 + if (alert_pos > 0) {
195 + hwrite(CS(status_line), 0, alert_pos, 0);
197 + if (alert_pos + alert_len < columns) {
198 + xy(alert_pos + alert_len + 1, ystatus);
199 + hwrite(CS(status_line), alert_pos + alert_len,
200 + columns - (alert_pos + alert_len), 0);
203 + xy(1, ystatus + i);
204 + hwrite(CS(status_line), (columns * i), columns, 0);
210 @@ -1747,9 +1759,9 @@
214 - if (status_line->len < columns)
215 - Stringnadd(status_line, '?', columns - status_line->len);
216 - Stringtrunc(status_line, columns);
217 + if (status_line->len < columns * status_height)
218 + Stringnadd(status_line, '?', columns * status_height - status_line->len);
219 + Stringtrunc(status_line, columns * status_height);
221 if (screen_mode < 0) { /* e.g., called by init_variables() */
223 @@ -1763,6 +1775,11 @@
225 } else if (var == &special_var[VAR_isize]) { /* %isize changed */
227 + } else if (var == &special_var[VAR_stat_height]) { /* %status_height changed */
228 + if (status_height > MAX_STATUS_HEIGHT) {
229 + set_var_by_id(VAR_stat_height, MAX_STATUS_HEIGHT);
232 } else { /* SIGWINCH */
233 /* Set ystatus to the top of the area fix_screen() must erase. */
235 @@ -1858,9 +1875,9 @@
236 static void clear_input_window(void)
238 /* only called in visual mode */
239 - clear_lines(ystatus + 1, lines);
240 + clear_lines(ystatus + status_height, lines);
242 - iy = iendy = istarty = ystatus + 1;
243 + iy = iendy = istarty = ystatus + status_height;
247 @@ -1878,14 +1895,14 @@
248 static void scroll_input(int n)
251 - clear_lines(ystatus + 1, lines);
252 - iendy = ystatus + 1;
253 + clear_lines(ystatus + status_height, lines);
254 + iendy = ystatus + status_height;
255 } else if (delete_line) {
256 - xy(1, ystatus + 1);
257 + xy(1, ystatus + status_height);
258 for (iendy = lines + 1; iendy > lines - n + 1; iendy--)
260 } else if (has_scroll_region) {
261 - setscroll(ystatus + 1, lines);
262 + setscroll(ystatus + status_height, lines);
264 crnl(n); /* DON'T: cy += n; */
265 iendy = lines - n + 1;
266 @@ -2049,7 +2066,7 @@
268 } else if (scroll && !clearfull) {
270 - if (istarty > ystatus + 1) istarty--;
271 + if (istarty > ystatus + status_height) istarty--;
273 clear_input_window();
275 @@ -2292,7 +2309,7 @@
276 ioutall(place - (ix - 1) - (iy - lines - 1) * Wrap);
279 - } else if ((iy < ystatus + 1) || (iy > lines)) {
280 + } else if ((iy < ystatus + status_height) || (iy > lines)) {
284 Only in tf-50b6-patch/src: output.c.orig
285 diff -ur tf-50b6/src/varlist.h tf-50b6-patch/src/varlist.h
286 --- tf-50b6/src/varlist.h Mon Jul 26 10:30:56 2004
287 +++ tf-50b6-patch/src/varlist.h Thu Aug 5 14:27:53 2004
289 varstr (VAR_sprefix, "sprefix", NULL, NULL)
290 varstr (VAR_stat_attr, "status_attr", NULL, ch_status_attr)
291 varstr (VAR_stat_fields,"status_fields",NULL, ch_status_fields)
292 +varint (VAR_stat_height,"status_height",1, ch_visual)
293 varstr (VAR_stat_pad, "status_pad", "_", update_status_line)
294 varstr (VAR_stint_clock,"status_int_clock",NULL, ch_status_int)
295 varstr (VAR_stint_more, "status_int_more",NULL, ch_status_int)