/*	XGFocus.cpp
 *
 *		Handle dealing with who has the focus. For a multiple window
 *	application there could be several 'focus' objects, one for each
 *	window and one for the global application.
 *
 *		Messages are only sent to one of the 'focii', by the way.
 */

/*  YAAF - Yet another application framework
 *  Copyright (C) 1997, 1998 William Edward Woody
 *  
 *  This library is free software; you can redistribute it
 *  and/or modify it under the terms of the GNU Library
 *  General Public License as published by the Free Software
 *  Foundation; either version 2 of the License, or any
 *  later version.
 *  
 *  This library is distributed in the hope that it will be
 *  useful, but WITHOUT ANY WARRANTY; without even the implied
 *  warranty of MERCHANTABIILITY or FITNESS FOR A PARTICULAR
 *  PURPOSE. See the GNU Library General Public License for
 *  more details.
 *  
 *  You should have received a copy of the GNU Library General
 *  Public License along with this library; if not, write to the
 *  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 *  Boston, MA 02111-1307, USA.
 *  
 *  To contact the author, either e-mail me at woody@pandawave.com, 
 *	or write to
 *  
 *          William Edward Woody
 *          In Phase Consulting
 *          1545 Ard Eevin Avenue
 *          Glendale, CA 91202
 *
 *	Or visit us on the web at http://www.pandawave.com
 */

#include <XConfig.h>			// must be first to optimize compile on MSVC++
#include <XEvent.h>


/************************************************************************/
/*																		*/
/*	Construction/Destruction											*/
/*																		*/
/************************************************************************/

/*	@F"XGFocus::XGFocus" @I
 *
 *		Construct this object with itself as the current focus.
 */

XGFocus::XGFocus()
{
	fFocus = this;
	XGDispatch::SetFocusDispatch(this);
}

/*	@F"XGFocus::~XGFocus" @I
 *
 *		Delete this object.
 */

XGFocus::~XGFocus()
{
}

/************************************************************************/
/*																		*/
/*	Send messages														*/
/*																		*/
/************************************************************************/

// @G"Focus Manipulation"

/*	@F"XGFocus::SendDispatch" @I
 *
 *		Send dispatch message to the current focus.
 */

long XGFocus::SendDispatch(long msg, long arg, void *parg)
{
	if (fFocus) {
		return fFocus->DoDispatch(msg,arg,parg);
	} else {
		return -1;
	}
}
