updated on Tue Jan 10 12:02:00 UTC 2012
[aur-mirror.git] / screen-firstline / hardstatusfirstline.patch
blob822024d7a7dbed68d522c5b6196012b2fe9751d0
1 diff -dpr screen-4.0.3-h2-start/display.c screen-4.0.3-h2/display.c
2 *** screen-4.0.3-h2-start/display.c 2009-01-19 18:03:12.848855058 +0400
3 --- screen-4.0.3-h2/display.c 2009-01-19 18:15:37.111854611 +0400
4 *************** MakeDefaultCanvas()
5 *** 422,428 ****
6 return -1;
7 cv->c_xs = 0;
8 cv->c_xe = D_width - 1;
9 ! cv->c_ys = 0;
10 cv->c_ye = D_height - 1 - (D_has_hstatus == HSTATUS_LASTLINE) - captionalways;
11 debug2("MakeDefaultCanvas 0,0 %d,%d\n", cv->c_xe, cv->c_ye);
12 cv->c_xoff = 0;
13 --- 422,428 ----
14 return -1;
15 cv->c_xs = 0;
16 cv->c_xe = D_width - 1;
17 ! cv->c_ys = (D_has_hstatus == HSTATUS_FIRSTLINE);
18 cv->c_ye = D_height - 1 - (D_has_hstatus == HSTATUS_LASTLINE) - captionalways;
19 debug2("MakeDefaultCanvas 0,0 %d,%d\n", cv->c_xe, cv->c_ye);
20 cv->c_xoff = 0;
21 *************** char *str;
22 *** 2856,2861 ****
23 --- 2856,2883 ----
24 D_hstatus = *str ? 1 : 0;
25 SetRendition(&mchar_null);
27 + else if (D_has_hstatus == HSTATUS_FIRSTLINE)
28 + {
29 + debug("ShowHStatus: using first line\n");
30 + ox = D_x;
31 + oy = D_y;
32 + str = str ? str : "";
33 + l = strlen(str);
34 + if (l > D_width)
35 + l = D_width;
36 + GotoPos(0, 0);
37 + SetRendition(captionalways || D_cvlist == 0 || D_cvlist->c_next ? &mchar_null: &mchar_so);
38 + PutWinMsg(str, 0, l);
39 + if (!captionalways && D_cvlist && !D_cvlist->c_next)
40 + while (l++ < D_width)
41 + PUTCHARLP(' ');
42 + if (l < D_width)
43 + ClearArea(l, 0, l, D_width - 1, D_width - 1, 0, 0, 0);
44 + if (ox != -1 && oy != -1)
45 + GotoPos(ox, oy);
46 + D_hstatus = *str ? 1 : 0;
47 + SetRendition(&mchar_null);
48 + }
49 else if (str && *str && D_has_hstatus == HSTATUS_MESSAGE)
51 debug("ShowHStatus: using message\n");
52 *************** int y, from, to, isblank;
53 *** 2943,2949 ****
54 if (D_status == STATUS_ON_WIN && y == STATLINE)
55 return; /* can't refresh status */
57 ! if (y == D_height - 1 && D_has_hstatus == HSTATUS_LASTLINE)
59 RefreshHStatus();
60 return;
61 --- 2965,2971 ----
62 if (D_status == STATUS_ON_WIN && y == STATLINE)
63 return; /* can't refresh status */
65 ! if ( (y == D_height - 1 && D_has_hstatus == HSTATUS_LASTLINE)||(y == 0 && D_has_hstatus == HSTATUS_FIRSTLINE) )
67 RefreshHStatus();
68 return;
69 *************** struct canvas *cv;
70 *** 4540,4545 ****
71 --- 4562,4568 ----
72 D_cvlist = 0;
73 D_forecv = lay->lay_forecv;
74 DupLayoutCv(&lay->lay_canvas, &D_canvas, 0);
75 + D_canvas.c_ys = (D_has_hstatus == HSTATUS_FIRSTLINE);
76 D_canvas.c_ye = D_height - 1 - ((D_canvas.c_slperp && D_canvas.c_slperp->c_slnext) || captionalways) - (D_has_hstatus == HSTATUS_LASTLINE);
77 ResizeCanvas(&D_canvas);
78 RecreateCanvasChain();
79 Only in screen-4.0.3-h2: display.c~
80 diff -dpr screen-4.0.3-h2-start/display.h screen-4.0.3-h2/display.h
81 *** screen-4.0.3-h2-start/display.h 2009-01-19 18:03:10.705855688 +0400
82 --- screen-4.0.3-h2/display.h 2009-01-19 18:03:21.556856374 +0400
83 *************** while (0)
84 *** 377,380 ****
85 #define HSTATUS_LASTLINE 1
86 #define HSTATUS_MESSAGE 2
87 #define HSTATUS_HS 3
88 ! #define HSTATUS_ALWAYS (1<<2)
89 --- 377,381 ----
90 #define HSTATUS_LASTLINE 1
91 #define HSTATUS_MESSAGE 2
92 #define HSTATUS_HS 3
93 ! #define HSTATUS_FIRSTLINE 4
94 ! #define HSTATUS_ALWAYS (1<<3)
95 diff -dpr screen-4.0.3-h2-start/process.c screen-4.0.3-h2/process.c
96 *** screen-4.0.3-h2-start/process.c 2009-01-19 18:03:12.383855446 +0400
97 --- screen-4.0.3-h2/process.c 2009-01-19 18:27:36.839856182 +0400
98 *************** int key;
99 *** 2662,2668 ****
100 s = args[0];
101 if (!strncmp(s, "always", 6))
102 s += 6;
103 ! if (!strcmp(s, "lastline"))
104 new_use = HSTATUS_LASTLINE;
105 else if (!strcmp(s, "ignore"))
106 new_use = HSTATUS_IGNORE;
107 --- 2662,2670 ----
108 s = args[0];
109 if (!strncmp(s, "always", 6))
110 s += 6;
111 ! if (!strcmp(s, "firstline"))
112 ! new_use = HSTATUS_FIRSTLINE;
113 ! else if (!strcmp(s, "lastline"))
114 new_use = HSTATUS_LASTLINE;
115 else if (!strcmp(s, "ignore"))
116 new_use = HSTATUS_IGNORE;
117 *************** int key;
118 *** 2697,2702 ****
119 --- 2699,2706 ----
120 D_has_hstatus = new_use;
121 if ((new_use == HSTATUS_LASTLINE && old_use != HSTATUS_LASTLINE) || (new_use != HSTATUS_LASTLINE && old_use == HSTATUS_LASTLINE))
122 ChangeScreenSize(D_width, D_height, 1);
123 + if ((new_use == HSTATUS_FIRSTLINE && old_use != HSTATUS_FIRSTLINE) || (new_use != HSTATUS_FIRSTLINE && old_use == HSTATUS_FIRSTLINE))
124 + ChangeScreenSize(D_width, D_height, 1);
125 RefreshHStatus();
128 diff -dpr screen-4.0.3-h2-start/resize.c screen-4.0.3-h2/resize.c
129 *** screen-4.0.3-h2-start/resize.c 2009-01-19 18:03:09.851855366 +0400
130 --- screen-4.0.3-h2/resize.c 2009-01-19 18:03:21.623855067 +0400
131 *************** int change_fore;
132 *** 154,159 ****
133 --- 154,160 ----
135 cv = &D_canvas;
136 cv->c_xe = wi - 1;
137 + cv->c_ys = (D_has_hstatus == HSTATUS_FIRSTLINE);
138 cv->c_ye = he - 1 - ((cv->c_slperp && cv->c_slperp->c_slnext) || captionalways) - (D_has_hstatus == HSTATUS_LASTLINE);
139 if (cv->c_slperp)