	IFND LIBRARIES_ASLBASE_I
LIBRARIES_ASLBASE_I	SET	1

***********************************************************************
*
* AshBase.i - asl.library assembly include file
*
* Copyright (c) 1989, Microsmiths Inc, Commodore Inc.
* All Rights Reserved.
*
***********************************************************************
*
* Version:	1.0
*
* By:		cdh
*
* Created:	3-Dec-89
*
***********************************************************************

	IFND EXEC_TYPES_I
	INCLUDE "exec/types.i"
	ENDC

	IFND EXEC_LIBRARIES_I
	INCLUDE "exec/libraries.i"
	ENDC

	IFND EXEC_LISTS_I
	INCLUDE "exec/lists.i"
	ENDC

	IFND EXEC_SEMAPHORES_I
	INCLUDE "exec/semaphores.i"
	ENDC

	IFND LIBRARIES_DOS_I
	INCLUDE "libraries/dos.i"
	ENDC

	IFND LIBRARIES_DOS_LIB_I
	INCLUDE "libraries/dos_lib.i"
	ENDC

	IFND INTUITION_INTUITION_I
	INCLUDE "intuition/intuition.i"
	ENDC

***********************************************************************

AslName	MACRO
	dc.b	'asl.library',0
	ds.w	0
	ENDM

AslVersion	equ	11
AslRevision	equ	0

***********************************************************************

AO_AslLib	EQU	$00008037

AN_AslLibrary	EQU	$03700000
AN_AslNoDOS	EQU	$83730001	; Can't open DOS library.
AN_AslNoGfx	EQU	$83730002	; Can't open graphics
AN_AslNoIntuit	EQU	$83730003	; Can't open intuition

AN_AslScattered	EQU	$83700002	; Scatter loading != OK in Asl.

***********************************************************************

	STRUCTURE AslBase,LIB_SIZE
		ULONG	ASL_UtiBase	; Cached Utility.library
		ULONG	ASL_DosBase	; Cached dosbase
		ULONG	ASL_GfxBase	; Cached graphics
		ULONG	ASL_IntuiBase	; Cached intuition
		ULONG	ASL_SegList	; pointer to seglist of loaded library
		UWORD	ASL_Flags
		LABEL	AslLib_Sizeof

******************************* File Requester ******************************
* The following structure is returned by AllocFileRequest		    *
*****************************************************************************

	STRUCTURE FileRequester,0
		CPTR	rf_Hail 		; Hailing text
		CPTR	rf_File 		; *Filename array (FCHARS+1)
		CPTR	rf_Dir			; *Directory array (DSIZE+1)
		CPTR	rf_Window		; Window requesting or NULL
		UBYTE	rf_FuncFlags		; Set bitdef's below
		UBYTE	rf_reserved1		; Set to NULL
		APTR	rf_Function		; Func to call for wildcards
		LONG	rf_LeftEdge
		LABEL	rf_SIZEOF

*****************************************************************
* The following are the equates for rf_FuncFlags. These bits tell
* FileRequest() what your rf_UserFunc is expecting, and what FileRequest()
* should call it for.
*
* You are called like so
* rf_Function(Mask, Object)
* ULONG Mask
* CPTR	*Object
*
* The Mask is a copy of the flag value that caused FileRequest() to call
* your function. You can use this to determine what action you need to
* perform, and exactly what Object is, so you know what to do and
* what to return.
*
	BITDEF	RF,DOWILDFUNC,7 ; Call me with a FIB and a name, ZERO return accepts.
	BITDEF	RF,DOMSGFUNC,6	; You get all IDCMP message not for FileRequest()
	BITDEF	RF,DOCOLOR,5	; Set this bit for that new and differnt look
	BITDEF	RF,NEWIDCMP,4	; Force a new IDCMP (only if rf_Window != NULL)
	BITDEF	RF,NEWWINDFUNC,3 ; You get to modify the NewWindow struct.
	BITDEF	RF,ADDGADFUNC,2 ; You get to add gadgets
	BITDEF	RF,GEVENTFUNC,1 ; Function to call if one of your gads is selected
	BITDEF	RF,LISTFUNC,0	; not implemented.

* The bits FR2Bxxx are in the rf_reserved1 byte.
	BITDEF	RF2,LONGPATH,0	; Specify that rf_Dir buffer is 256
				;  bytes long
LONG_DSIZE	EQU	254	; If FRB_LongPath, you must allocate
				; LONG_DSIZE+1 rather than DSIZE+1 for
				; rf_Dir buffer
LONG_FSIZE	EQU	126

RF_FIRST_GADGET EQU	$7680		; User gadgetID's must be less than this.

*****************************************************************************

	STRUCTURE FontRequester,0
		CPTR	fo_Hail 		; Hailing text
		CPTR	fo_Window		; Window requesting or NULL
		APTR	fo_Name 		; Returned name
		USHORT	fo_YSize
		UBYTE	fo_Style
		UBYTE	fo_Flags
		UBYTE	fo_FrontPen
		UBYTE	fo_BackPen
		SHORT	fo_FuncFlags		; Set bitdef's below
		SHORT	fo_LeftEdge
		SHORT	fo_TopEdge
		LABEL	fo_SIZEOF

*****************************************************************************

	STRUCTURE	NewDList,0
		APTR	nd_RequesterPtr
		APTR	nd_DLHook

		SHORT	nd_LeftEdge
		SHORT	nd_TopEdge
		SHORT	nd_Width
		SHORT	nd_Height

		BYTE	nd_FgPen
		BYTE	nd_BgPen
		BYTE	nd_BdPen
		BYTE	nd_BarPen

		SHORT	nd_ItemHeight
		USHORT	nd_Flags

		USHORT	nd_GadgetID
		LABEL	nd_SIZEOF

* nd_Flags bit definitions.

	BITDEF	DL,DRAWBORDER,0
	BITDEF	DL,SIZEGAD,1

* Scroll enumerations for ScrollDList( dlist, num )

ST_UPONE	equ	0
ST_DOWNONE	equ	1
ST_UPDISPLAY	equ	2
ST_DOWNDISPLAY	equ	3
ST_TOP		equ	4
ST_BOTTOM	equ	5

* Structure passed to GetDListInfo

	STRUCTURE	DLInfo,0
		LONG	dli_NumItems
		LONG	dli_TopItem
		SHORT	dli_DispItems
		LABEL	dli_SIZEOF

* Message structure passed for SELECT and RENDER events
	STRUCTURE	DLHookMsg,0
		APTR	dh_RPort
		LONG	dh_Item
		SHORT	dh_Type
		SHORT	dh_LeftEdge
		SHORT	dh_TopEdge
		SHORT	dh_Width
		SHORT	dh_Height
		SHORT	dh_MouseX
		SHORT	dh_MouseY
		LABEL	dh_SIZEOF


* Types for DlHook callback
DH_RENDER	equ	0
DH_SELECT	equ	1

* PRIVATE stuff

BORDERWIDTH	equ	16	; Width of arrows + prop gadgetry
ARROWHEIGHT	equ	9	; Height of arrows

	STRUCTURE	DList,0
		STRUCT	ld_NDL,nd_SIZEOF

		APTR	ld_WindowPtr
		APTR	ld_RPort

		SHORT	ld_W
		SHORT	ld_H

		SHORT	ld_X0
		SHORT	ld_Y0
		SHORT	ld_X1
		SHORT	ld_Y1
		SHORT	ld_W0
		SHORT	ld_H0

		LONG	ld_ItemCount
		LONG	ld_TopItemNum
		LONG	ld_OldTopItemNum
		SHORT	ld_MaxScrItems

		SHORT	ld_DisplayValid
		SHORT	ld_PropValid
		SHORT	ld_Special
		SHORT	ld_Bias

		STRUCT	ld_UpArrow,gg_SIZEOF
		STRUCT	ld_DownArrow,gg_SIZEOF
		STRUCT	ld_ScrollBar,gg_SIZEOF
		STRUCT	ld_SelectArea,gg_SIZEOF

		STRUCT	ld_UpArrowImg,ig_SIZEOF
		STRUCT	ld_DownArrowImg,ig_SIZEOF
		STRUCT	ld_ScrollBarImg,ig_SIZEOF

		STRUCT	ld_ScrollBarInfo,pi_SIZEOF

		STRUCT	ld_RastPort,rp_SIZEOF

		STRUCT	ld_UpData,ARROWHEIGHT*2
		STRUCT	ld_DownData,ARROWHEIGHT*2

		LABEL	ld_SIZEOF

	LIBINIT
*
	LIBDEF	_LVOAllocFileRequest
	LIBDEF	_LVOFreeFileRequest
	LIBDEF	_LVORequestFile

	LIBDEF	_LVOAllocFontRequest
	LIBDEF	_LVOFreeFontRequest
	LIBDEF	_LVORequestFont

	LIBDEF	_LVOCreateDList
	LIBDEF	_LVOFreeDList

	LIBDEF	_LVOAddDListItems
	LIBDEF	_LVOEmptyDList

	LIBDEF	_LVOScrollDList
	LIBDEF	_LVOScrollDListAbs
	LIBDEF	_LVOGetDListInfo

	LIBDEF	_LVODrawDList
	LIBDEF	_LVORefreshDList
	LIBDEF	_LVORefreshDListProp

	LIBDEF	_LVOHandleDListEvent

	ENDC	!LIBRARIES_ASLBASE_I
