-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbanner.c
59 lines (48 loc) · 1.43 KB
/
banner.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* Banner window abstraction. Just a title text with default behavior.
*
* Robert W. Baldwin, December 1984.
*/
#include <stdio.h>
#include "window.h"
#include "layout.h"
/* Window for the title banner. */
displine banline1 = {
1,1, /* Origin. */
1,MAXWIDTH, /* Height and width. */
1,1, /* Initial cursor position */
NULL, /* No private data. */
wl_setcur, /* Firstime = Set cursor to current value. */
wl_noop, /* Lasttime = do nothing. */
wl_dldraw, /* Default dispaly line draw routine. */
dokey, /* Default keystroke handler. */
arwktab, /* Basic arrow keystroke handler. */
1,MAXWIDTH, /* Min and Max column for cursor in line. */
};
displine *banlines[] = {
&banline1, /* List of display lines for the banner. */
NULL,
};
twindow banner = {
1,1, /* Origin. */
1,MAXWIDTH, /* Height and width. */
1,1, /* Initial cursor position */
NULL, /* No private data. */
wl_setcur, /* Firstime = accept current cursor position. */
wl_noop, /* Lasttime = do nothing. */
wl_twdraw, /* Simple draw routine. */
dokey, /* Default keystroke handler. */
arwktab, /* Basic arrow keystroke handler. */
banlines,
};
/* Initialize the banner window and return a pointer to it.
* Fill in the banner text.
*/
gwindow *(ibanner())
{
displine *line;
line = banner.dlines[0];
clrdline(line);
setndline(line, BANTEXT, BANLM);
return ((gwindow *) &banner);
}