xref: /csrg-svn/usr.bin/window/wwmisc.c (revision 62479)
118727Sedward /*
2*62479Sbostic  * Copyright (c) 1983, 1993
3*62479Sbostic  *	The Regents of the University of California.  All rights reserved.
433514Sbostic  *
542954Sbostic  * This code is derived from software contributed to Berkeley by
642954Sbostic  * Edward Wang at The University of California, Berkeley.
742954Sbostic  *
842835Sbostic  * %sccs.include.redist.c%
918727Sedward  */
1018727Sedward 
1133514Sbostic #ifndef lint
12*62479Sbostic static char sccsid[] = "@(#)wwmisc.c	8.1 (Berkeley) 06/06/93";
1333514Sbostic #endif /* not lint */
1433514Sbostic 
1513926Sedward #include "ww.h"
1616322Sedward #include "tt.h"
1716322Sedward #include "char.h"
1813926Sedward 
1914896Sedward /*
2014986Sedward  * Sufficient but not necessary test for total visibility.
2114896Sedward  */
wwvisible(w)2214896Sedward wwvisible(w)
2314896Sedward register struct ww *w;
2414896Sedward {
2514896Sedward 	register i;
2614896Sedward 	register nvis = 0;
2714896Sedward 
2814986Sedward 	for (i = w->ww_i.t; i < w->ww_i.b; i++)
2914896Sedward 		nvis += w->ww_nvis[i];
3014986Sedward 	if (w->ww_hascursor
3115656Sedward 	    && w->ww_cur.r >= w->ww_i.t && w->ww_cur.r < w->ww_i.b
3214986Sedward 	    && w->ww_cur.c >= w->ww_i.l && w->ww_cur.c < w->ww_i.r
3314986Sedward 	    && wwsmap[w->ww_cur.r][w->ww_cur.c] == w->ww_index)
3414896Sedward 		nvis++;
3514986Sedward 	return nvis == w->ww_i.nr * w->ww_i.nc;
3614896Sedward }
3716322Sedward 
wwbell()3816322Sedward wwbell()
3916322Sedward {
4033248Sbostic 	ttputc(ctrl('g'));
4116322Sedward }
42