1 | /* Copyright (c) 1985 Ceriel J.H. Jacobs */
|
---|
2 |
|
---|
3 | /* $Header: /cvsup/minix/src/commands/yap/display.h,v 1.1.1.1 2005/04/21 14:55:39 beng Exp $ */
|
---|
4 |
|
---|
5 | # ifndef _DISPLAY_
|
---|
6 | # define PUBLIC extern
|
---|
7 | # else
|
---|
8 | # define PUBLIC
|
---|
9 | # endif
|
---|
10 |
|
---|
11 | # define MINPAGESIZE 5
|
---|
12 |
|
---|
13 | PUBLIC int pagesize; /* How many lines on a page */
|
---|
14 | PUBLIC int maxpagesize; /* Maximum # of lines on a page */
|
---|
15 | PUBLIC int scrollsize; /* number of lines in a scroll */
|
---|
16 | struct scr_info {
|
---|
17 | struct linelist {
|
---|
18 | int cnt; /* # of screenlines for this line */
|
---|
19 | long line; /* lineno of this line */
|
---|
20 | # define firstline head->line
|
---|
21 | # define lastline tail->line
|
---|
22 | struct linelist *next;
|
---|
23 | struct linelist *prev;
|
---|
24 | } *tail, *head; /* Of all lines of the input file that are
|
---|
25 | * on the screen, remember how many
|
---|
26 | * screenlines they occupy. Keep this
|
---|
27 | * info in a doubly linked list.
|
---|
28 | */
|
---|
29 | int nf; /* How many screenlines of the first line
|
---|
30 | * on the screen are not on the screen?
|
---|
31 | */
|
---|
32 | int currentpos; /* Y coordinate of first free line */
|
---|
33 | struct linelist ssaavv; /* Mark */
|
---|
34 | # define savfirst ssaavv.line
|
---|
35 | # define savnf ssaavv.cnt
|
---|
36 | };
|
---|
37 |
|
---|
38 | PUBLIC struct scr_info scr_info;
|
---|
39 | PUBLIC int status; /* EOFILE on end of file
|
---|
40 | * START on start of file
|
---|
41 | * logical "or" if both
|
---|
42 | */
|
---|
43 | /* Flags for status field */
|
---|
44 |
|
---|
45 | # define EOFILE 01
|
---|
46 | # define START 02
|
---|
47 |
|
---|
48 | VOID redraw();
|
---|
49 | /*
|
---|
50 | * void redraw(flag)
|
---|
51 | * int flag; Either 0 or 1
|
---|
52 | *
|
---|
53 | * Redraws the screen. If flag = 1, the screen is redrawn as precisely
|
---|
54 | * as possible, otherwise one page is displayed (which possibly does not
|
---|
55 | * take a whole screen.
|
---|
56 | */
|
---|
57 |
|
---|
58 | int display();
|
---|
59 | /*
|
---|
60 | * int display(firstline, nodispl, nlines, really)
|
---|
61 | * long firstline; Line with which to start
|
---|
62 | * int nodispl; Do not display nodispl lines of it
|
---|
63 | * int nlines; Number of screen lines that must be displayed
|
---|
64 | * int really; Either 0 or 1
|
---|
65 | *
|
---|
66 | * Displays nlines as a page. if "really" = 0, the actual displaying is not
|
---|
67 | * performed. Only the computing associated with it is done.
|
---|
68 | */
|
---|
69 |
|
---|
70 | int scrollf();
|
---|
71 | /*
|
---|
72 | * int scrollf(nlines,really)
|
---|
73 | * int nlines; Number of lines to scroll
|
---|
74 | * int really; Either 0 or 1, see explanation above
|
---|
75 | *
|
---|
76 | * Scroll forwards "nlines" (screen)lines.
|
---|
77 | */
|
---|
78 |
|
---|
79 | int scrollb();
|
---|
80 | /*
|
---|
81 | * int scrollb(nlines,really)
|
---|
82 | * int nlines; Number of lines to scroll
|
---|
83 | * int really; Either 0 or 1, see explanation above
|
---|
84 | *
|
---|
85 | * Scroll backwards "nlines" (screen)lines.
|
---|
86 | */
|
---|
87 |
|
---|
88 | int tomark();
|
---|
89 | /*
|
---|
90 | * int tomark(cnt)
|
---|
91 | * long cnt; (Argument ignored)
|
---|
92 | *
|
---|
93 | * Display a page starting at the mark. If there was no
|
---|
94 | * mark, display the first page of the file.
|
---|
95 | * (There is always assumed to be a mark, the initial one is on the first page
|
---|
96 | * of the file).
|
---|
97 | */
|
---|
98 |
|
---|
99 | int setmark();
|
---|
100 | /*
|
---|
101 | * int setmark(cnt)
|
---|
102 | * long cnt; (Argument ignored)
|
---|
103 | *
|
---|
104 | * Sets a mark on the current page.
|
---|
105 | * It returns nothing (but the address is taken ...)
|
---|
106 | */
|
---|
107 |
|
---|
108 | int exgmark();
|
---|
109 | /*
|
---|
110 | * int exgmark(cnt)
|
---|
111 | * long cnt; (Argumewnt ignored)
|
---|
112 | *
|
---|
113 | * Sets the mark on the current page and displays the
|
---|
114 | * previously marked page.
|
---|
115 | */
|
---|
116 |
|
---|
117 | VOID d_clean();
|
---|
118 | /*
|
---|
119 | * void d_clean()
|
---|
120 | *
|
---|
121 | * Clean up and initialize. To be called before displaying a new file
|
---|
122 | */
|
---|
123 |
|
---|
124 | # undef PUBLIC
|
---|