xref: /original-bsd/usr.bin/window/wwmisc.c (revision 18f6d767)
1 #ifndef lint
2 static char sccsid[] = "@(#)wwmisc.c	3.9 04/24/85";
3 #endif
4 
5 /*
6  * Copyright (c) 1983 Regents of the University of California,
7  * All rights reserved.  Redistribution permitted subject to
8  * the terms of the Berkeley Software License Agreement.
9  */
10 
11 #include "ww.h"
12 #include "tt.h"
13 #include "char.h"
14 
15 /*
16  * Sufficient but not necessary test for total visibility.
17  */
18 wwvisible(w)
19 register struct ww *w;
20 {
21 	register i;
22 	register nvis = 0;
23 
24 	for (i = w->ww_i.t; i < w->ww_i.b; i++)
25 		nvis += w->ww_nvis[i];
26 	if (w->ww_hascursor
27 	    && w->ww_cur.r >= w->ww_i.t && w->ww_cur.r < w->ww_i.b
28 	    && w->ww_cur.c >= w->ww_i.l && w->ww_cur.c < w->ww_i.r
29 	    && wwsmap[w->ww_cur.r][w->ww_cur.c] == w->ww_index)
30 		nvis++;
31 	return nvis == w->ww_i.nr * w->ww_i.nc;
32 }
33 
34 wwbell()
35 {
36 	ttputc(ctrl(g));
37 }
38