/*
 * winUtils.h
 *
 * [Generated from winUtils, 25 September 1996]
 */

#if !defined(__CC_NORCROFT) || !defined(__arm)
  #error You must use the Norcroft ARM Compiler for Sapphire programs
#endif

#pragma include_only_once
#pragma force_top_level

#ifndef __winUtils_h
#define __winUtils_h

#ifndef __sapphire_h
  #include "sapphire.h"
#endif

/*----- Overview ----------------------------------------------------------*
 *
 * Functions provided:
 *
 *  winUtils_setTitle
 *  winUtils_setPosition
 *  winUtils_findValid
 *  winUtils_shaded
 */

/* --- winUtils_setTitle --- *
 *
 * On entry:	R0 == pointer to string to set in title
 *		R1 == pointer to title bar buffer
 *		R2 == window handle to write to
 *
 * On exit:	--
 *
 * Use:		Sets a window's title string.  If the string is different,
 *		the title is redrawn.  The contortion to do this is
 *		unpleasant, and is not to be performed in public.
 */

extern routine winUtils_setTitle;

/* --- winUtils_setPosition --- *
 *
 * On entry:	R0 == window opening style
 *		R1 == pointer to window state block
 *		R2,R3 == extra arguments for displaying the window
 *
 * On exit:	R2,R3 contain position for opening with Wimp_CreateMenu
 *
 * Use:		Modifies the window state block pointed to by R0 so that the
 *		window appears as required in the given opening style.  The
 *		window is always moved to the top.
 */

extern routine winUtils_setPosition;

/* --- winUtils_findValid --- *
 *
 * On entry:	R0 == pointer to icon block
 * 		R1 == character to find in block (not case-sensitive)
 *		R2 == old pointer to search from, or 0
 *
 * On exit:	R1 == character forced to lower case
 *		CS if found, and
 *		  R2 points to command string
 *		else CC and
 *		  R2 corrupted
 *
 * Use:		Tries to find a validation string command in the given
 *		icon block.
 */

extern routine winUtils_findValid;

/* --- winUtils_shaded --- *
 *
 * On entry:	R0 == window handle
 *		R1 == icon handle
 *
 * On exit:	CS if icon is shaded, CC otherwise
 *
 * Use:		Informs caller whether an icon is shaded in the Sapphire
 *		sense (ESG 31 or shaded bit set).
 */

extern routine winUtils_shaded;

/* --- Opening styles for winUtils_setPosition --- *
 *
 * These are actually the same as the dbox_open styles, without the flags
 * bits.
 */

#define wStyle_current 0
#define wStyle_centre 1
#define wStyle_pointer 2
#define wStyle_givenY 3
#define wStyle_givenXY 4

/*----- That's all, folks -------------------------------------------------*/

#endif
