#ifndef	LIBRARIES_ASL_H
#define	LIBRARIES_ASL_H	1

/*
**	$Filename: libraries/asl.h $
**	$Release: 2.02 $
**	$Revision: 1.7 $
**	$Date: 90/11/02 $
**
**	ASL library name and useful definitions.
**
**	(C) Copyright 1989,1990 Commodore-Amiga Inc. and Charlie Heath
**		All Rights Reserved
*/

#ifndef	EXEC_TYPES_H
#include	<exec/types.h>
#endif

#ifndef	EXEC_LISTS_H
#include	<exec/lists.h>
#endif

#ifndef	EXEC_LIBRARIES_H
#include	<exec/libraries.h>
#endif

#ifndef UTILITY_HOOKS_H
#include <utility/hooks.h>
#endif

#ifndef UTILITY_TAGITEM_H
#include <utility/tagitem.h>
#endif

#ifndef WBArg
#include <workbench/startup.h>
#endif

#ifndef GRAPHICS_TEXT_H
#include <graphics/text.h>
#endif

/*
 ************************************************************************
 *	Standard definitions for asl library information		*
 ************************************************************************
 */

#define	AslName		"asl.library"

/*
 ************************************************************************
 *									*
 *	The ASL file requester data structure...			*
 *									*
 * The fields described here are for READ ACCESS to the structure	*
 * returned by AllocAslRequest( ASL_FileRequest, ... )			*
 *									*
 * Any modifications MUST be done via TAGS either at the time of	*
 * creation by AllocAslRequest(), or when used, via AslRequest()	*
 *									*
 ************************************************************************
 */
struct FileRequester	{
	APTR	rf_Reserved1;
	BYTE	*rf_File;	/* Filename pointer		*/
	BYTE	*rf_Dir;	/* Directory name pointer	*/
	WORD	rf_Reserved2[5];
	SHORT	rf_LeftEdge,rf_TopEdge;	/* Preferred window pos	*/
	SHORT	rf_Width,rf_Height;   /* Preferred window size	*/
	SHORT	rf_Reserved3;
	LONG	rf_NumArgs;	/* A-la WB Args, for multiselects */
	struct WBArg *rf_ArgList;
	APTR	rf_UserData;	/* Applihandle (you may write!!) */
	};


/*
 * The following defined values are the ASL_FuncFlag tag values which
 * are defined for the ASL file request.  These values may be passed
 * as a TagItem to modify the way the requester is presented.  Each
 * flag value defined has a description of the particular action.
 *
 * Also related to the ASL_FuncFlag values is the ASL_HookFunc tagitem,
 * which provides a callback function to allow the application to
 * interact with the requester.  If an ASL_HookFunc TagItem is
 * defined, that function will be called like so:
 *
 * rf_Function(Mask, Object)
 * ULONG	Mask;
 * CPTR		*Object;
 *
 * The Mask value is a copy of the specific ASL_FuncFlag value which
 * the callback is for; Object is a pointer to a data object.
 *
 * For the ASL file requester, two ASL_HookFunction flag values are
 * currently defined; FILF_DOWILDFUNC and FILF_DOMSGFUNC.
 *
 */

#define	FILB_DOWILDFUNC	7L /* Call me with a FIB and a name,	*/
			   /*		 ZERO return accepts.	*/
#define	FILB_DOMSGFUNC	6L /* You get all IDCMP messages not	*/
			   /*		 for FileRequest()	*/
#define	FILB_SAVE	5L /* For a SAVE operation, set this bit */
#define	FILB_NEWIDCMP	4L /* Force a new IDCMP (only if rf_Window != NULL)  */
#define FILB_MULTISELECT 3L /* Request multiple selections returned from FR. */
			   /*	MULISELECT is ignored if FILB_SAVE is on     */
#define	FILB_PATGAD	0L /* Ask for pattern gadget			     */


#define	FILF_DOWILDFUNC	(1L << FILB_DOWILDFUNC)
#define	FILF_DOMSGFUNC	(1L << FILB_DOMSGFUNC)

#define	FILF_SAVE	(1L << FILB_SAVE)
#define	FILF_NEWIDCMP	(1L << FILB_NEWIDCMP)
#define	FILF_MULTISELECT (1L << FILB_MULTISELECT)
#define	FILF_PATGAD	(1L << FILB_PATGAD)


/*
 ************************************************************************
 *	The ASL font requester data structure...			*
 *									*
 * As with the FileRequest structure, the fields documented here are	*
 * for READ ACCESS ONLY.  Any modifications must be done via tags.	*
 ************************************************************************
 */
struct FontRequester	{
	APTR	fo_Reserved1[2];
	struct TextAttr fo_Attr;	/* Returned TextAttr		*/
	UBYTE	fo_FrontPen;		/* Returned pens, if selected	*/
	UBYTE	fo_BackPen;
	UBYTE	fo_DrawMode;
	APTR	fo_UserData;
	};

/* Bit defines for ASL_FuncFlags, for FONT requester			*/
/* See descriptive text for FILF_ values above for an overview.		*/

#define	FONB_FrontColor	0	/* Display Front color selector?	*/
#define	FONB_BackColor	1	/* Display Back color selector?		*/
#define	FONB_Styles	2	/* Display Styles checkboxes?		*/
#define	FONB_DrawMode	3	/* Display DrawMode NWay?		*/
#define	FONB_FixedWidth	4	/* Only allow fixed-width fonts?	*/
#define	FONB_NewIDCMP	5	/* Create a new IDCMP port, not shared	*/
#define	FONB_DoMsgFunc	6	/* Call with IntuiMessages for		*/
				/*	other windows in shared port	*/
#define	FONB_DoWildFunc	7	/* Call with each TextAttr to approve	*/

#define	FONF_FrontColor	1
#define	FONF_BackColor	2
#define	FONF_Styles	4
#define	FONF_DrawMode	8
#define	FONF_FixedWidth	16
#define	FONF_NewIDCMP	32
#define	FONF_DoMsgFunc	64
#define	FONF_DoWildFunc	128


/************************************************************************/
/* Arguments to AllocAslRequest()					*/
/* Types of requester structures which may be allocated:		*/
/************************************************************************/
#define	ASL_FileRequest	0
#define	ASL_FontRequest	1

/************************************************************************/
/* Tags for AllocAslRequest() and AslRequest()				*/
/************************************************************************/

#define ASL_Dummy (TAG_USER + 0x80000)

#define ASL_Hail	ASL_Dummy+1	/* Hailing text follows		     */
#define ASL_Window	ASL_Dummy+2	/* Parent window for IDCMP & screen  */
#define	ASL_LeftEdge	ASL_Dummy+3	/* Initialize LeftEdge		     */
#define	ASL_TopEdge	ASL_Dummy+4	/* Initialize TopEdge		     */
#define	ASL_Width	ASL_Dummy+5
#define	ASL_Height	ASL_Dummy+6
#define	ASL_HookFunc	ASL_Dummy+7	/* Hook function pointer	     */

/* Tags specific to file request					     */
#define	ASL_File	ASL_Dummy+8	/* Initial name of file follows	     */
#define	ASL_Dir		ASL_Dummy+9	/* Initial string of filerequest dir */

/* Tags specific to font request					     */
#define	ASL_FontName	ASL_Dummy+10	/* Initial font name		     */
#define	ASL_FontHeight	ASL_Dummy+11	/* Initial font height		     */
#define	ASL_FontStyles	ASL_Dummy+12	/* Initial font styles		     */
#define	ASL_FontFlags	ASL_Dummy+13	/* Initial font flags for textattr   */
#define	ASL_FrontPen	ASL_Dummy+14	/* Initial frontpen color	     */
#define	ASL_BackPen	ASL_Dummy+15	/* Initial backpen color	     */
#define	ASL_MinHeight	ASL_Dummy+16	/* Minimum font height to display    */
#define	ASL_MaxHeight	ASL_Dummy+17	/* Max font height to display	     */

#define	ASL_OKText	ASL_Dummy+18	/* Text displayed in OK gadget	     */
#define	ASL_CancelText	ASL_Dummy+19	/* Text displayed in CANCEL gadget   */
#define	ASL_FuncFlags	ASL_Dummy+20	/* Function flags, depend on request */

#define	ASL_ModeList	ASL_Dummy+21	/* Substitute list for font drawmodes */

#define	ASL_Pattern	ASL_FontName	/* File requester pattern string     */

/******** END of ASL Tag values	*****************************************/

#endif
