]> git.pld-linux.org Git - packages/tf.git/blob - tf-50b6-multistatus.patch
- simplify %setup
[packages/tf.git] / tf-50b6-multistatus.patch
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
4 @@ -223,6 +223,7 @@
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
15 @@ -49,7 +49,7 @@
16  #endif
17      "TinyFugue version 5.0 beta 6";
18  
19 -const char mods[] = "";
20 +const char mods[] = "With multistatus line written by Someone [Minor changes by Karol Lassak (ingwar@ingwar.eu.org)]";
21  
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
28 @@ -15,6 +15,8 @@
29   * Handles all screen-related phenomena.
30   *****************************************************************/
31  
32 +#define MAX_STATUS_HEIGHT 5
33 +
34  #define TERM_vt100     1
35  #define TERM_vt220     2
36  #define TERM_ansi      3
37 @@ -388,7 +390,7 @@
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);
43      top_margin = 1;
44      bottom_margin = lines;
45  
46 @@ -396,8 +398,8 @@
47      old_ix = -1;
48  
49      init_term();
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]);
57 @@ -688,7 +690,7 @@
58      } else {
59          prompt = fgprompt();
60          if (isize > lines - 3) set_var_by_id(VAR_isize, lines - 3);
61 -        ystatus = lines - isize;
62 +        ystatus = lines - isize - (status_height - 1);
63  #if 0
64          outcount = ystatus - 1;
65  #endif
66 @@ -699,7 +701,7 @@
67          }
68          update_status_line(NULL);
69          ix = iendx = oy = 1;
70 -        iy = iendy = istarty = ystatus + 1;
71 +        iy = iendy = istarty = ystatus + status_height;
72          ipos();
73  #endif
74      }
75 @@ -1317,9 +1319,9 @@
76          inlist(field, status_field_list, status_field_list->tail);
77      }
78  
79 -    if (width > columns) {
80 -        eprintf("status_fields: status width (%d) is wider than screen (%d)",
81 -           width, columns);
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);
85      }
86  
87      /* update new fields */
88 @@ -1411,21 +1413,21 @@
89  {
90      int column;
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;
101  }
102  
103  static int status_width(StatusField *field, int start)
104  {
105      int width;
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;
115      if (width < 0)
116         width = 0;
117      return width;
118 @@ -1583,8 +1585,8 @@
119                 continue;
120         }
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 */
126             break;
127         count++;
128          width = format_status_field(field);
129 @@ -1593,17 +1595,17 @@
130             column >= alert_pos + alert_len)
131         {
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);
136         } else {
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);
142             }
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);
149             }
150 @@ -1625,12 +1627,12 @@
151      for (node = status_field_list->head; node; node = node->next) {
152          field = (StatusField*)node->datum;
153  
154 -       if ((column = status_field_column(field)) >= columns)
155 +       if ((column = status_field_column(field)) >= columns * status_height)
156             break;
157          width = format_status_field(field);
158      }
159  
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;
164      }
165 @@ -1638,23 +1640,33 @@
166  
167  int display_status_line(void)
168  {
169 +    int i;
170      if (screen_mode < 1) return 0;
171  
172      if (!alert_len) {
173         /* no overlap with alert */
174 -       xy(1, ystatus);
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);
179 +        }
180      } else {
181         /* overlap with alert (this could happen in ch_status_attr()) */
182 -       if (alert_pos > 0) {
183 -           xy(1, ystatus);
184 -           hwrite(CS(status_line), 0, alert_pos, 0);
185 -       }
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);
190 -       }
191 +       for (i = 0; i < status_height; i++) {
192 +        if (!i) {
193 +               if (alert_pos > 0) {
194 +                   xy(1, ystatus);
195 +                   hwrite(CS(status_line), 0, alert_pos, 0);
196 +               }
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);
201 +               }
202 +      } else {
203 +               xy(1, ystatus + i);
204 +                hwrite(CS(status_line), (columns * i), columns, 0);
205 +         }
206 +     }
207      }
208  
209      bufflush();
210 @@ -1747,9 +1759,9 @@
211  {
212      int need_redraw;
213  
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);
220  
221      if (screen_mode < 0) {                /* e.g., called by init_variables() */
222          need_redraw = 0;
223 @@ -1763,6 +1775,11 @@
224  #ifdef SCREEN
225      } else if (var == &special_var[VAR_isize]) {      /* %isize changed */
226          need_redraw = 1;
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);
230 +        } 
231 +        need_redraw = 1;
232      } else {                              /* SIGWINCH */
233          /* Set ystatus to the top of the area fix_screen() must erase. */
234          /* ystatus = 1; */
235 @@ -1858,9 +1875,9 @@
236  static void clear_input_window(void)
237  {
238      /* only called in visual mode */
239 -    clear_lines(ystatus + 1, lines);
240 +    clear_lines(ystatus + status_height, lines);
241      ix = iendx = 1;
242 -    iy = iendy = istarty = ystatus + 1;
243 +    iy = iendy = istarty = ystatus + status_height;
244      ipos();
245  }
246  
247 @@ -1878,14 +1895,14 @@
248  static void scroll_input(int n)
249  {
250      if (n > isize) {
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--)
259              tp(delete_line);
260      } else if (has_scroll_region) {
261 -        setscroll(ystatus + 1, lines);
262 +        setscroll(ystatus + status_height, lines);
263          xy(1, lines);
264          crnl(n);  /* DON'T: cy += n; */
265          iendy = lines - n + 1;
266 @@ -2049,7 +2066,7 @@
267             }
268          } else if (scroll && !clearfull) {
269              scroll_input(1);
270 -            if (istarty > ystatus + 1) istarty--;
271 +            if (istarty > ystatus + status_height) istarty--;
272          } else {
273              clear_input_window();
274          }
275 @@ -2292,7 +2309,7 @@
276              ioutall(place - (ix - 1) - (iy - lines - 1) * Wrap);
277              iy = lines;
278              ipos();
279 -        } else if ((iy < ystatus + 1) || (iy > lines)) {
280 +        } else if ((iy < ystatus + status_height) || (iy > lines)) {
281              logical_refresh();
282          } else {
283              ipos();
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
288 @@ -128,6 +128,7 @@
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)
This page took 0.053378 seconds and 3 git commands to generate.