1 /************************************************************************
2  * This program is Copyright (C) 1986-1996 by Jonathan Payne.  JOVE is  *
3  * provided to you without charge, and with no warranty.  You may give  *
4  * away copies of JOVE, including sources, provided that this notice is *
5  * included in all the files.                                           *
6  ************************************************************************/
7 
8 /* typedef struct window Window in jove.h */
9 
10 struct window {
11 	Window
12 		*w_prev,	/* circular list */
13 		*w_next;
14 	Buffer	*w_bufp;	/* buffer associated with this window */
15 	LinePtr
16 		w_top,		/* top line */
17 		w_line;	/* current line */
18 	int
19 		w_char,
20 		w_height,	/* window height (including mode line) */
21 		w_topnum,	/* buffer line number of the topline */
22 		w_dotcol,	/* screen column of w_line (set by UpdWindow) */
23 		w_dotline,	/* screen line number of w_line (set by UpdWindow) */
24 		w_flags,
25 #define	W_TOPGONE	01
26 #define	W_CURGONE	02	/* topline (curline) of window has been deleted
27 				   since the last time a redisplay was called */
28 #define W_VISSPACE	04
29 #define W_NUMLINES	010
30 		w_LRscroll;	/* amount of LeftRight scrolling in window */
31 #ifdef MAC
32 	int	w_topline;	/* row number of top line in window */
33 	/* Note: "ControlHandle w_control" would require more includes */
34 	struct ControlRecord **w_control;	/* scroll bar for window */
35 #endif
36 };
37 
38 #define W_NUMWIDTH(w)	(((w)->w_flags & W_NUMLINES)? 8 : 0)
39 #define SIWIDTH(off)	((off) != 0? 1 : 0)	/* width of shift indicator, if any */
40 
41 extern Window
42 	*fwind,		/* first window in list */
43 	*curwind;	/* current window */
44 
45 #define one_windp()	(fwind->w_next == fwind)
46 #define WSIZE(wp)	((wp)->w_height - 1)	/* window lines, without modeline */
47 
48 extern int
49 	FLine proto((Window *w)),
50 	in_window proto((Window *windes,LinePtr line));
51 
52 extern Window
53 	*div_wind proto((Window *wp,int n)),
54 	*windbp proto((Buffer *bp));
55 
56 extern void
57 	CalcWind proto((Window *w)),
58 	CentWind proto((Window *w)),
59 	SetTop proto((Window *w,LinePtr line)),
60 	SetWind proto((Window *new)),
61 	WindSize proto((Window *w,int inc)),
62 	del_wind proto((Window *wp)),
63 	pop_wind proto((char *name,bool clobber,int btype)),
64 	tiewind proto((Window *w,Buffer *bp)),	/* util.c!! */
65 	winit proto((void));
66 
67 /* Commands: */
68 
69 extern void
70 	DelCurWindow proto((void)),
71 	GotoWind proto((void)),
72 	GrowWindowCmd proto((void)),
73 	NextWindow proto((void)),
74 	OneWindow proto((void)),
75 	PageNWind proto((void)),
76 	PrevWindow proto((void)),
77 	ScrollLeft proto((void)),
78 	ScrollRight proto((void)),
79 	ShrWindow proto((void)),
80 	SplitWind proto((void)),
81 	WNumLines proto((void)),
82 	WVisSpace proto((void)),
83 	WindFind proto((void));
84 
85 /* Variables: */
86 
87 extern int	ScrollStep;		/* VAR: how should we scroll */
88 
89 #ifdef HIGHLIGHTING
90 extern bool	ScrollBar;		/* VAR: whether the scrollbar is used */
91 #endif
92