(*
**	Cyclone Modula-2 Interface module:
**	$VER: asl.h 38.5 (5.1.93)
**	Includes Release 40.15
**
**	ASL library structures and constants
**
**	(C) Copyright 1989-1993 Commodore-Amiga Inc.
**	(C) Copyright 1989-1990 Charlie Heath
**	All Rights Reserved
**
**      Interface module by Marcel Timmermans
**      (C) Copyright 1995-1996 Marcel Timmermans
**      All Rights Reserved
*)

(*$ Implementation- *)
DEFINITION MODULE AslD;

FROM SYSTEM IMPORT ADDRESS;
FROM ExecD  IMPORT Node;
FROM GraphicsD IMPORT TextAttr,TTextAttr,DrawModeSet,DimensionInfo,PropertyFlagSet;
FROM UtilityD IMPORT tagUser;
FROM Workbench IMPORT WBArgumentsPtr;

CONST
 aslName="asl.library";
 aslTB=tagUser+80000H;

TYPE
 StrPtr=POINTER TO ARRAY [0..511] OF CHAR;

 FileRequester=RECORD
  reserved1:ADDRESS;
  file:StrPtr;
  dir:StrPtr;
  reserved2:ADDRESS;
  reserved3:SHORTCARD;
  reserved4:SHORTCARD;
  reserved5:ADDRESS;
  leftEdge,topEdge:INTEGER;
  width,height:INTEGER;
  reserved6:INTEGER;
  numArgs:LONGINT;
  argList:WBArgumentsPtr;
  userData:ADDRESS;
  reserved7:ADDRESS;
  reserved8:ADDRESS;
  pat:StrPtr;
 END;
 FileRequesterPtr=POINTER TO FileRequester;

(*****************************************************************************)

CONST

(* Types of requesters known to ASL, used as arguments to AllocAslRequest() *)
  fileRequest       = 0;
  fontRequest       = 1;
  screenModeRequest = 2;


(************************************************************************)
CONST
(*
 * common tag arguments
 *)


(* Window control *)
  window         = aslTB+2;   (* Parent window                    *)
  screen         = aslTB+40;  (* Screen to open on if no window   *)
  pubScreenName  = aslTB+41;  (* Name of public screen            *)
  privateIDCMP   = aslTB+42;  (* Allocate private IDCMP?          *)
  intuiMsgFunc   = aslTB+70;  (* Function to handle IntuiMessages *)
  sleepWindow    = aslTB+43;  (* Block input in ASLFO_WindoU?     *)
  userData       = aslTB+52;  (* What to put in fo_UserData       *)

(* Text display *)
  textAttr       = aslTB+51;  (* Text font to use for gadget text *)
  locale         = aslTB+50;  (* Locale ASL should use for text   *)
  titleText      = aslTB+1;   (* Title of requester               *)
  positiveText   = aslTB+18;  (* Positive gadget text             *)
  negativeText   = aslTB+19;  (* Negative gadget text             *)

(* Initial settings *)
  initialLeftEdge = aslTB+3;   (* Initial requester coordinates    *)
  initialTopEdge  = aslTB+4;
  initialWidth    = aslTB+5;   (* Initial requester dimensions     *)
  initialHeight   = aslTB+6;
  initialFile     = aslTB+8;	 (* Initial contents of File gadget  *)
  initialDrawer   = aslTB+9;	 (* Initial contents of Drawer gadg. *)
  initialPattern  = aslTB+10;  (* Initial contents of Pattern gadg.*)

(* Options *)
  flags1	        = aslTB+20;  (* Option flags		     *)
  flags2	        = aslTB+22;  (* Additional option flags	     *)
  doSaveMode      = aslTB+44;  (* Being used for saving?	     *)
  doMultiSelect   = aslTB+45;  (* Do multi-select?		     *)
  doPatterns      = aslTB+46;  (* Display a Pattern gadget?	     *)

(* Filtering *)
  drawersOnly     = aslTB+47;  (* Don't display files?	     *)
  filterFunc      = aslTB+49;  (* Function to filter files	     *) 
  rejectIcons     = aslTB+60;  (* Display .info files?	     *)
  rejectPattern   = aslTB+61;  (* Don't display files matching pat *)
  acceptPattern   = aslTB+62;  (* Accept only files matching pat   *)
  filterDrawers   = aslTB+63;  (* Also filter drawers with patterns*)
  hookFunc	      = aslTB+7;  (* Combined callback function	     *)

(* Flag bits for the ASLFR_Flags1 tag *)
  frbFilterFunc    = 7;
  frbIntuiFunc     = 6;
  frbDoSaveMode    = 5;
  frbPrivateIDCMP  = 4;
  frbDoMultiSelect = 3;
  frbDoPatterns    = 0;

(* Flag bits for the ASLFR_Flags2 tag *)
  frbDrawersOnly   = 0; (* Do not want a file gadget, no files shown      *)
  frbFilterDrawers = 1; (* filter drawers by matching pattern             *)
  frbRejectIcons   = 2;

(*****************************************************************************
 *
 * ASL Font Requester data structures and constants
 *
 * This structure must only be allocated by asl.library amd is READ-ONLY!
 * Control of the various fields is provided via tags when the requester
 * is created with AllocAslRequest() and when it is displayed via
 * AslRequest()
 *)
TYPE
 FontRequester=RECORD
  reserved0:ARRAY [0..1] OF ADDRESS;
  attr:TextAttr;        (* Returned TextAttr                *)
  frontPen:SHORTCARD;   (* Returned front pen               *)
  backPen:SHORTCARD;    (* Returned back pen                *)
  drawMode:DrawModeSet; (* Returned drawing mode            *)  
  reserved1:SHORTCARD;   
  userData:ADDRESS;     (* You can store your own data here *)
  leftEdge:INTEGER;     (* Coordinates of requester on exit *)
  topEdge:INTEGER; 
  width:INTEGER;   
  height:INTEGER;  
  tAttr:TTextAttr;      (* Returned TTextAttr               *)
 END;
 FontRequesterPtr=POINTER TO FontRequester;

CONST
(* Font requester tag values, used by AllocAslRequest() and AslRequest() *)

(* Window control *)
  (* see common tags above *)

(* Text display *)
  (* see common tags above *)

(* Initial settings *)
  (* see common tags above *)
  initialName     = aslTB+10;  (* Initial contents of Name gadget  *)
  initialSize     = aslTB+11;  (* Initial contents of Size gadget  *)
  initialStyle    = aslTB+12;  (* Initial font style               *)
  initialFlags    = aslTB+13;  (* Initial font flags for TextAttr  *)
  initialFrontPen = aslTB+14;  (* Initial front pen                *)
  initialBackPen  = aslTB+15;  (* Initial back pen                 *)
  initialDrawMode = aslTB+59;  (* Initial draw mode                *)

(* Options *)
  flags          = aslTB+20;  (* Option flags                     *)
  doFrontPen     = aslTB+44;  (* Display Front color selector?    *)
  doBackPen      = aslTB+45;  (* Display Back color selector?     *)
  doStyle        = aslTB+46;  (* Display Style checkboxes?        *)
  doDrawMode     = aslTB+47;  (* Display DrawMode cycle gadget?   *)

(* Filtering *)
  fixedWidthOnly = aslTB+48;  (* Only allow fixed-width fonts?    *)
  minHeight      = aslTB+16;  (* Minimum font height to display   *)
  maxHeight      = aslTB+17;  (* Maximum font height to display   *)

(* Custom additions *)
  modeList       = aslTB+21;  (* Substitute list for drawmodes    *)


(* Flag bits for ASLFO_Flags tag *)
  foDoFrontPen     = 0;
  foDoBackPen      = 1;
  foDoStyle        = 2;
  foDoDrawMode     = 3;
  foFixedWidthOnly = 4;
  foPrivateIDCMP   = 5;
  foIntuiFunc      = 6;
  foFilterFunc     = 7;

TYPE
(*****************************************************************************
 *
 * ASL Screen Mode Requester data structures and constants
 *
 * This structure must only be allocated by asl.library and is READ-ONLY!
 * Control of the various fields is provided via tags when the requester
 * is created with AllocAslRequest() and when it is displayed via
 * AslRequest()
 *)

 ScreenModeRequester=RECORD 
  displayID:LONGCARD;         (* Display mode ID                  *)  
  displayWidth:LONGCARD;      (* Width of display in pixels       *)
  displayHeight:LONGCARD;     (* Height of display in pixels      *)
  displayDepth:CARDINAL;      (* Number of bit-planes of display  *)
  overscanType:CARDINAL;      (* Type of overscan of display      *)
  autoScroll:INTEGER;         (* Display should auto-scroll?      *)
  bitMapWidth:LONGCARD;       (* Used to create your own BitMap   *)
  bitMapHeight:LONGCARD;      
  leftEdge:INTEGER;           (* Coordinates of requester on exit *)
  topEdge:INTEGER;          
  width:INTEGER;            
  height:INTEGER;             
  infoOpened:INTEGER;         (* Info window opened on exit?      *)  
  infoLeftEdge:INTEGER;       (* Last coordinates of Info window  *)  
  infoTopEdge:INTEGER;      
  infoWidth:INTEGER;        
  infoHeight:INTEGER;         
  userData:ADDRESS;           (* You can store your own data here *)
 END;
 ScreenModeRequesterPtr=POINTER TO ScreenModeRequester;

(* An Exec list of custom modes can be added to the list of available modes.
 * The DimensionInfo structure must be completely initialized, including the
 * Header. See <graphics/displayinfo.h>. Custom mode ID's must be in the range
 * 0xFFFF0000..0xFFFFFFFF. Regular properties which apply to your custom modes
 * can be added in the dn_PropertyFlags field. Custom properties are not
 * allowed.
 *)

 DisplayMode=RECORD
  node:Node;
  dimensionInfo:DimensionInfo;    (* mode description      *)
  propertyFlags:PropertyFlagSet;  (* applicable properties *)
 END;
 DisplayModePtr=POINTER TO DisplayMode;

CONST
CONST
(* ScreenMode requester tag values, used by AllocAslRequest() and AslRequest() *)

(* Window control *)
  (* see common tags above *)

(* Text display *)
  (* see common tags above *)

(* Initial settings *)
  (* see common tags above *)
  initialDisplayID    = aslTB+100; (* Initial display mode id     *)
  initialDisplayWidth = aslTB+101; (* Initial display width       *)
  initialDisplayHeight= aslTB+102; (* Initial display height      *)
  initialDisplayDepth = aslTB+103; (* Initial display depth       *)
  initialOverscanType = aslTB+104; (* Initial type of overscan    *)
  initialAutoScroll   = aslTB+105; (* Initial autoscroll setting  *)
  initialInfoOpened   = aslTB+106; (* Info wndw initially opened? *)
  initialInfoLeftEdge = aslTB+107; (* Initial Info window coords. *)
  initialInfoTopEdge  = aslTB+108;

(* Initial settings *)
  doWidth        = aslTB+109;  (* Display Width gadget?           *)
  doHeight       = aslTB+110;  (* Display Height gadget?          *)
  doDepth        = aslTB+111;  (* Display Depth gadget?           *)
  doOverscanType = aslTB+112;  (* Display Overscan Type gadget?   *)
  doAutoScroll   = aslTB+113;  (* Display AutoScroll gadget?      *)

(* Filtering *)
  smPropertyFlags= aslTB+114;  (* Must have these Property flags  *)
  smPropertyMask = aslTB+115;  (* Only these should be looked at  *)
  smMinWidth     = aslTB+116;  (* Minimum display width to allow  *)
  smMaxWidth     = aslTB+117;  (* Maximum display width to allow  *)
  smMinHeight    = aslTB+118;  (* Minimum display height to allow *)
  smMaxHeight    = aslTB+119;  (* Maximum display height to allow *)
  smMinDepth     = aslTB+120;  (* Minimum display depth           *)
  smMaxDepth     = aslTB+121;  (* Maximum display depth           *)
  smFilterFunc   = aslTB+122;  (* Function to filter mode id's    *)

(* Custom additions *)
  customSMList   = aslTB+123;  (* Exec list of struct DisplayMode *)

(***********************************************************************
 *
 * Obsolete ASL definitions, here for source code compatibility only.
 * Please do NOT use in new code.
 *
 *)
  fonFrontColor = 0;
  fonBackColor  = 1;
  fonStyles     = 2;
  fonDrawMode   = 3;
  fonFixedWidth = 4;
  fonNewIDCMP   = 5;
  fonDoMsgFunc  = 6;
  fonDoWildFunc = 7;

  doWildFunc   = frbFilterFunc;
  doMsgFunc    = frbIntuiFunc;
  save         = frbDoSaveMode;
  newIDCMP     = frbPrivateIDCMP;
  multiSelect  = frbDoMultiSelect;
  patGad       = frbDoPatterns;
  noFiles      = frbDrawersOnly;

  aslDummy      = aslTB;

  hail        = aslDummy+1;    (* Hailing text follows              *)
  leftEdge    = aslDummy+3;    (* Initialize LeftEdge               *)
  topEdge     = aslDummy+4;    (* Initialize TopEdge                *)
  width       = aslDummy+5;
  height      = aslDummy+6;

(* Tags specific to file request                                             *)
  file        = aslDummy+8;    (* Initial name of file follows      *)
  dir         = aslDummy+9;    (* Initial string of filerequest dir *)

(* Tags specific to font request                                             *)
  fontName    = aslDummy+10;   (* Initial font name                 *)
  fontHeight  = aslDummy+11;   (* Initial font height               *)
  fontStyles  = aslDummy+12;   (* Initial font styles               *)
  fontFlags   = aslDummy+13;   (* Initial font flags for textattr   *)
  frontPen    = aslDummy+14;   (* Initial frontpen color            *)
  backPen     = aslDummy+15;   (* Initial backpen color             *)

  okText      = aslDummy+18;   (* Text displayed in OK gadget       *)
  cancelText  = aslDummy+19;   (* Text displayed in CANCEL gadget   *)
  funcFlags   = aslDummy+20;   (* Function flags, depend on request *)

  extFlags1   = aslDummy+22;   (* For passing extended FIL1F flags   *)
  pattern     = fontName;      (* File requester pattern string     *)

END AslD.
