/*
 * Copyright 1990 by Baylor College of Medicine ALL RIGHTS RESERVED. 
 *
 * This program is subject to a license agreement between 
 * Baylor College of Medicine and MIT. Any use inconsistent with
 * said license and any use by persons other than the faculty, 
 * students and staff at MIT or any use on a computer not operated 
 * as part of the Athena Computing Environment (ACE) is expressly 
 * prohibited.
 */
/****************************************************************
 * File: watch.c 
 * Date: 01/30/91
 *
 * Description:
 *   This file contains function for activating and deactivating
 *   the "watch" cursor. These functions should be used when the
 *   must wait for the application to perform some action.
 *
 * Revisions:
 ****************************************************************/
#include <stdio.h>
#include <X11/StringDefs.h>
#include <X11/IntrinsicP.h>
#include <X11/cursorfont.h>

#include "VtP.h"

/****************************************************************
 *                    PUBLIC FUNCTIONS
 ****************************************************************/

/****************************************************************
 * Function: VtWatchOn
 * Date: 01/30/91
 *
 * Description:
 *   This function activates the watch cursor for the window
 *   used by the widget passed.
 *
 * Linkage: VtWatchOn(w)
 *   Widget w - Widget which the watch will appear.
 *
 * Revisions:
 ****************************************************************/
PUBLIC
void
VtWatchOn(w)
	Widget w;
{
	static Cursor watch;
	if (watch == NULL)
	{
		watch = XCreateFontCursor(XtDisplay(w),XC_watch);
	}
	XDefineCursor(XtDisplay(w),XtWindow(w),watch);
	XFlush(XtDisplay(w));
}

/****************************************************************
 * Function: VtWatchOff
 * Date: 01/30/91
 *
 * Description:
 *   This function deactivates the watch cursor for the window
 *   used by the widget passed.
 *
 * Linkage: VtWatchOff(w)
 *   Widget w - Widget to be deactivated.
 *
 * Revisions:
 ****************************************************************/
PUBLIC
void
VtWatchOff(w)
	Widget w;
{
	XUndefineCursor(XtDisplay(w),XtWindow(w));
}
