xref: /csrg-svn/usr.bin/window/wwmisc.c (revision 42835)
118727Sedward /*
233514Sbostic  * Copyright (c) 1983 Regents of the University of California.
333514Sbostic  * All rights reserved.
433514Sbostic  *
5*42835Sbostic  * %sccs.include.redist.c%
618727Sedward  */
718727Sedward 
833514Sbostic #ifndef lint
9*42835Sbostic static char sccsid[] = "@(#)wwmisc.c	3.13 (Berkeley) 06/02/90";
1033514Sbostic #endif /* not lint */
1133514Sbostic 
1213926Sedward #include "ww.h"
1316322Sedward #include "tt.h"
1416322Sedward #include "char.h"
1513926Sedward 
1614896Sedward /*
1714986Sedward  * Sufficient but not necessary test for total visibility.
1814896Sedward  */
1914896Sedward wwvisible(w)
2014896Sedward register struct ww *w;
2114896Sedward {
2214896Sedward 	register i;
2314896Sedward 	register nvis = 0;
2414896Sedward 
2514986Sedward 	for (i = w->ww_i.t; i < w->ww_i.b; i++)
2614896Sedward 		nvis += w->ww_nvis[i];
2714986Sedward 	if (w->ww_hascursor
2815656Sedward 	    && w->ww_cur.r >= w->ww_i.t && w->ww_cur.r < w->ww_i.b
2914986Sedward 	    && w->ww_cur.c >= w->ww_i.l && w->ww_cur.c < w->ww_i.r
3014986Sedward 	    && wwsmap[w->ww_cur.r][w->ww_cur.c] == w->ww_index)
3114896Sedward 		nvis++;
3214986Sedward 	return nvis == w->ww_i.nr * w->ww_i.nc;
3314896Sedward }
3416322Sedward 
3516322Sedward wwbell()
3616322Sedward {
3733248Sbostic 	ttputc(ctrl('g'));
3816322Sedward }
39