/*
**	GadTools layout toolkit
**
**	Copyright © 1993-1996 by Olaf `Olsen' Barthel
**		Freely distributable.
**
**	:ts=4
*/

#ifndef _GTLAYOUT_GLOBAL_H
#include "gtlayout_global.h"
#endif

/****** gtlayout.library/LT_BeginRefresh ******************************************
*
*   NAME
*	LT_BeginRefresh -- Optimized window refreshing
*
*   SYNOPSIS
*	LT_BeginRefresh(Handle)
*	                  A0
*
*   FUNCTION
*	If you wish to handle window refreshing all on your own, you
*	might want to use the LT_BeginRefresh...LT_EndRefresh pair
*	in your program. By default the user interface layout engine
*	will automatically intercept IDCMP_REFRESHWINDOW events and
*	react to them accordingly.
*
*   INPUTS
*	Handle - Pointer to a LayoutHandle structure.
*
*   RESULT
*	none
*
*   SEE ALSO
*	intuition.library/BeginRefresh
*	intuition.library/EndRefresh
*	gtlayout.library/LT_EndRefresh
*
******************************************************************************
*
*/

VOID LIBENT
LT_BeginRefresh(_REG(a0) LayoutHandle *handle)
{
	if(handle)
	{
		GT_BeginRefresh(handle->Window);

		LTP_DrawGroup(handle,handle->TopGroup);
	}
}


/*****************************************************************************/


/****** gtlayout.library/LT_EndRefresh ******************************************
*
*   NAME
*	LT_EndRefresh -- Optimized window refreshing
*
*   SYNOPSIS
*	LT_EndRefresh(Handle)
*	                A0
*
*	VOID LT_EndRefresh(LayoutHandle *);
*
*   FUNCTION
*	If you wish to handle window refreshing all on your own, you
*	might want to use the LT_BeginRefresh...LT_EndRefresh pair
*	in your program. By default the user interface layout engine
*	will automatically intercept IDCMP_REFRESHWINDOW events and
*	react to them accordingly.
*
*   INPUTS
*	Handle - Pointer to a LayoutHandle structure.
*
*   RESULT
*	none
*
*   SEE ALSO
*	gtlayout.library/LT_BeginRefresh
*	intuition.library/BeginRefresh
*	intuition.library/EndRefresh
*
******************************************************************************
*
*/

VOID LIBENT
LT_EndRefresh(_REG(a0) LayoutHandle *handle,_REG(d0) BOOL complete)
{
	if(handle)
		GT_EndRefresh(handle->Window,complete);
}

/****** gtlayout.library/LT_Refresh *****************************************
*
*   NAME
*	LT_Refresh -- Redraws the entire window contents.
*
*   SYNOPSIS
*	LT_Refresh(Handle)
*	             A0
*
*	VOID LT_Refresh(LayoutHandle *);
*
*   FUNCTION
*	Redraws the contents of the window, this includes both gadgets
*	and imagery.
*
*   INPUTS
*	Handle - Pointer to a LayoutHandle structure.
*
*   RESULT
*	none
*
*   SEE ALSO
*       gadtools.library/GT_RefreshWindow
*       intuition.library/RefreshGList
*
******************************************************************************
*
*/

VOID LIBENT
LT_Refresh(_REG(a0) LayoutHandle *handle)
{
	if(handle)
	{
#ifdef DO_BOOPSI_KIND
		if(handle->BOOPSIList)
			RefreshGList((struct Gadget *)handle->BOOPSIList,handle->Window,NULL,(UWORD)-1);
#endif	/* DO_BOOPSI_KIND */

		RefreshGList(handle->List,handle->Window,NULL,(UWORD)-1);

		GT_RefreshWindow(handle -> Window,NULL);

		LTP_DrawGroup(handle,handle -> TopGroup);
	}
}
