/*
 * $Copyright:	$
 * Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
 * Sequent Computer Systems, Inc.   All rights reserved.
 *  
 * This software is furnished under a license and may be used
 * only in accordance with the terms of that license and with the
 * inclusion of the above copyright notice.   This software may not
 * be provided or otherwise made available to, or used by, any
 * other person.  No title to or ownership of the software is
 * hereby transferred."
 *
 */
/*	Copyright (c) 1984 AT&T	*/
/*	  All Rights Reserved  	*/

/*	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T	*/
/*	The copyright notice above does not evidence any   	*/
/*	actual or intended publication of such source code.	*/

/*
 * Copyright  (c) 1986 AT&T
 *	All Rights Reserved
 */
#ident	"$Header: vmark.c 1.2 89/10/10 $@(#)vm.vt:src/vt/vmark.c	1.2"

#include	<curses.h>
#include	"wish.h"
#include	"vt.h"
#include	"vtdefs.h"

void
_vt_mark_overlap(v)
register struct vt	*v;
{
	register int	n;
	int	sr1, r1, sc1, c1;
	int	sr2, r2, sc2, c2;
	register struct vt	*vp;

	getbegyx(v->win, sr1, sc1);
	getmaxyx(v->win, r1, c1);
#ifdef _DEBUG
	_debug3(stderr, "vmark: window %d(#%d) - %d,%d %d,%d\n", v - VT_array, v->number, sr1, sc1, r1, c1);
#endif
	for (n = VT_front; n != VT_UNDEFINED; n = vp->next) {
		vp = &VT_array[n];
		getbegyx(vp->win, sr2, sc2);
		getmaxyx(vp->win, r2, c2);
		if (_vt_overlap(sr1, r1, sr2, r2) && _vt_overlap(sc1, c1, sc2, c2)) {
#ifdef _DEBUG
			_debug3(stderr, "\t\tmarking %d(#%d) dirty\n", n, vp->number);
#endif
			vp->flags |= VT_BDIRTY;
		}
	}
}
