home *** CD-ROM | disk | FTP | other *** search
- (***************************************************************************
-
- $RCSfile: ASL.mod $
- Description: Interface to asl.library
-
- Created by: fjc (Frank Copeland)
- $Revision: 3.2 $
- $Author: fjc $
- $Date: 1994/08/08 01:12:29 $
-
- Includes Release 40.15
-
- (C) Copyright 1989-1993 Commodore-Amiga Inc.
- (C) Copyright 1989-1990 Charlie Heath
- All Rights Reserved
-
- Oberon-A interface Copyright © 1994, Frank Copeland.
- This file is part of the Oberon-A Interface.
- See Oberon-A.doc for conditions of use and distribution.
-
- ***************************************************************************)
-
- MODULE ASL;
-
- (*
- ** $C- CaseChk $I- IndexChk $L+ LongAdr $N- NilChk
- ** $P- PortableCode $R- RangeChk $S- StackChk $T- TypeChk
- ** $V- OvflChk $Z- ZeroVars
- *)
-
- IMPORT
- E := Exec, U := Utility, G := Graphics, W := Workbench, SYS := SYSTEM;
-
- (*
- ** $VER: asl.h 38.5 (5.1.93)
- **
- ** ASL library structures and constants
- *)
-
- (*****************************************************************************)
-
- CONST
-
- name * = "asl.library";
- tb * = U.tagUser+080000H;
-
-
- (*****************************************************************************)
-
- CONST
-
- (* Types of requesters known to ASL, used as arguments to AllocAslRequest() *)
- fileRequest * = 0;
- fontRequest * = 1;
- screenModeRequest * = 2;
-
- (*
- ** Requester base type, for type compatibility between requester
- ** structures
- *)
-
- TYPE
-
- RequesterBasePtr * = CPOINTER TO RequesterBase;
- RequesterBase * = RECORD END;
-
- (*****************************************************************************
- *
- * ASL File 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
-
- FileRequesterPtr * = CPOINTER TO FileRequester;
- FileRequester * = RECORD (RequesterBase)
- reserved0 - : ARRAY 4 OF E.UBYTE;
- file - : E.STRPTR; (* Contents of File gadget on exit *)
- drawer - : E.STRPTR; (* Contents of Drawer gadget on exit *)
- reserved1 - : ARRAY 10 OF E.UBYTE;
- leftEdge - : INTEGER; (* Coordinates of requester on exit *)
- topEdge - : INTEGER;
- width - : INTEGER;
- height - : INTEGER;
- reserved2 - : ARRAY 2 OF E.UBYTE;
- numArgs - : LONGINT; (* Number of files selected *)
- argList - : W.WBArgPtr; (* List of files selected *)
- userData - : E.APTR; (* You can store your own data here *)
- reserved3 - : ARRAY 8 OF E.UBYTE;
- pattern - : E.STRPTR; (* Contents of Pattern gadget on exit *)
- END;
-
- CONST
-
- (* File requester tag values, used by AllocAslRequest() and AslRequest() *)
-
- (* Window control *)
- frWindow * = tb+2; (* Parent window *)
- frScreen * = tb+40; (* Screen to open on if no window *)
- frPubScreenName * = tb+41; (* Name of public screen *)
- frPrivateIDCMP * = tb+42; (* Allocate private IDCMP? *)
- frIntuiMsgFunc * = tb+70; (* Function to handle IntuiMessages *)
- frSleepWindow * = tb+43; (* Block input in FR_Window? *)
- frUserData * = tb+52; (* What to put in userData *)
-
- (* Text display *)
- frTextAttr * = tb+51; (* Text font to use for gadget text *)
- frLocale * = tb+50; (* Locale should use for text *)
- frTitleText * = tb+1; (* Title of requester *)
- frPositiveText * = tb+18; (* Positive gadget text *)
- frNegativeText * = tb+19; (* Negative gadget text *)
-
- (* Initial settings *)
- frInitialLeftEdge * = tb+3; (* Initial requester coordinates *)
- frInitialTopEdge * = tb+4;
- frInitialWidth * = tb+5; (* Initial requester dimensions *)
- frInitialHeight * = tb+6;
- frInitialFile * = tb+8; (* Initial contents of File gadget *)
- frInitialDrawer * = tb+9; (* Initial contents of Drawer gadg. *)
- frInitialPattern * = tb+10; (* Initial contents of Pattern gadg.*)
-
- (* Options *)
- frFlags1 * = tb+20; (* Option flags *)
- frFlags2 * = tb+22; (* Additional option flags *)
- frDoSaveMode * = tb+44; (* Being used for saving? *)
- frDoMultiSelect * = tb+45; (* Do multi-select? *)
- frDoPatterns * = tb+46; (* Display a Pattern gadget? *)
-
- (* Filtering *)
- frDrawersOnly * = tb+47; (* Don't display files? *)
- frFilterFunc * = tb+49; (* Function to filter files *)
- frRejectIcons * = tb+60; (* Display .info files? *)
- frRejectPattern * = tb+61; (* Don't display files matching pat *)
- frAcceptPattern * = tb+62; (* Accept only files matching pat *)
- frFilterDrawers * = tb+63; (* Also filter drawers with patterns*)
- frHookFunc * = tb+7; (* Combined callback function *)
-
- (* Flag bits for the frFlags1 tag *)
- frbFilterFunc * = 7;
- frbIntuiFunc * = 6;
- frbDoSaveMode * = 5;
- frbPrivateIDCMP * = 4;
- frbDoMultiSelect * = 3;
- frbDoPatterns * = 0;
-
- (* Flag bits for the frFlags2 tag *)
- frbDrawersOnly * = 0;
- frbFilterDrawers * = 1;
- 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
-
- FontRequesterPtr * = CPOINTER TO FontRequester;
- FontRequester * = RECORD (RequesterBase)
- reserved0 - : ARRAY 8 OF E.UBYTE;
- attr - : G.TextAttr; (* Returned TextAttr *)
- frontPen - : E.UBYTE; (* Returned front pen *)
- backPen - : E.UBYTE; (* Returned back pen *)
- drawMode - : E.UBYTE; (* Returned drawing mode *)
- reserved1 - : E.UBYTE;
- userData - : E.APTR; (* You can store your own data here *)
- leftEdge - : INTEGER; (* Coordinates of requester on exit *)
- topEdge - : INTEGER;
- width - : INTEGER;
- height - : INTEGER;
- tAttr - : G.TTextAttr; (* Returned TTextAttr *)
- END;
-
- CONST
-
- (* Font requester tag values, used by AllocAslRequest() and AslRequest() *)
-
- (* Window control *)
- foWindow * = tb+2; (* Parent window *)
- foScreen * = tb+40; (* Screen to open on if no window *)
- foPubScreenName * = tb+41; (* Name of public screen *)
- foPrivateIDCMP * = tb+42; (* Allocate private IDCMP? *)
- foIntuiMsgFunc * = tb+70; (* Function to handle IntuiMessages *)
- foSleepWindow * = tb+43; (* Block input in FO_Window? *)
- foUserData * = tb+52; (* What to put in fo_UserData *)
-
- (* Text display *)
- foTextAttr * = tb+51; (* Text font to use for gadget text *)
- foLocale * = tb+50; (* Locale ASL should use for text *)
- foTitleText * = tb+1; (* Title of requester *)
- foPositiveText * = tb+18; (* Positive gadget text *)
- foNegativeText * = tb+19; (* Negative gadget text *)
-
- (* Initial settings *)
- foInitialLeftEdge * = tb+3; (* Initial requester coordinates *)
- foInitialTopEdge * = tb+4;
- foInitialWidth * = tb+5; (* Initial requester dimensions *)
- foInitialHeight * = tb+6;
- foInitialName * = tb+10; (* Initial contents of Name gadget *)
- foInitialSize * = tb+11; (* Initial contents of Size gadget *)
- foInitialStyle * = tb+12; (* Initial font style *)
- foInitialFlags * = tb+13; (* Initial font flags for TextAttr *)
- foInitialFrontPen * = tb+14; (* Initial front pen *)
- foInitialBackPen * = tb+15; (* Initial back pen *)
- foInitialDrawMode * = tb+59; (* Initial draw mode *)
-
- (* Options *)
- foFlags * = tb+20; (* Option flags *)
- foDoFrontPen * = tb+44; (* Display Front color selector? *)
- foDoBackPen * = tb+45; (* Display Back color selector? *)
- foDoStyle * = tb+46; (* Display Style checkboxes? *)
- foDoDrawMode * = tb+47; (* Display DrawMode cycle gadget? *)
-
- (* Filtering *)
- foFixedWidthOnly * = tb+48; (* Only allow fixed-width fonts? *)
- foMinHeight * = tb+16; (* Minimum font height to display *)
- foMaxHeight * = tb+17; (* Maximum font height to display *)
- foFilterFunc * = tb+49; (* Function to filter fonts *)
- foHookFunc * = tb+7; (* Combined callback function *)
- foMaxFrontPen * = tb+66; (* Max # of colors in front palette *)
- foMaxBackPen * = tb+67; (* Max # of colors in back palette *)
-
- (* Custom additions *)
- foModeList * = tb+21; (* Substitute list for drawmodes *)
- foFrontPens * = tb+64; (* Color table for front pen palette*)
- foBackPens * = tb+65; (* Color table for back pen palette *)
-
- (* Flag bits for foFlags tag *)
- fobDoFrontPen * = 0;
- fobDoBackPen * = 1;
- fobDoStyle * = 2;
- fobDoDrawMode * = 3;
- fobFixedWidthOnly * = 4;
- fobPrivateIDCMP * = 5;
- fobIntuiFunc * = 6;
- fobFilterFunc * = 7;
-
- (*****************************************************************************
- *
- * 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()
- *)
-
- TYPE
-
- ScreenModeRequesterPtr * = CPOINTER TO ScreenModeRequester;
- ScreenModeRequester * = RECORD (RequesterBase)
- displayID * : E.ULONG; (* Display mode ID *)
- displayWidth * : E.ULONG; (* Width of display in pixels *)
- displayHeight * : E.ULONG; (* Height of display in pixels *)
- displayDepth * : E.UWORD; (* Number of bit-planes of display *)
- overscanType * : E.UWORD; (* Type of overscan of display *)
- autoScroll * : BOOLEAN; (* Display should auto-scroll? *)
-
- bitMapWidth * : E.ULONG; (* Used to create your own BitMap *)
- bitMapHeight * : E.ULONG;
-
- leftEdge * : INTEGER; (* Coordinates of requester on exit *)
- topEdge * : INTEGER;
- width * : INTEGER;
- height * : INTEGER;
-
- infoOpened * : BOOLEAN; (* Info window opened on exit? *)
- infoLeftEdge * : INTEGER; (* Last coordinates of Info window *)
- infoTopEdge * : INTEGER;
- infoWidth * : INTEGER;
- infoHeight * : INTEGER;
-
- userData * : E.APTR; (* You can store your own data here *)
- END;
-
- (* 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.
- *)
-
- DisplayModePtr * = CPOINTER TO DisplayMode;
- DisplayMode * = RECORD (E.Node) (* see ln_Name *)
- dimensionInfo * : G.DimensionInfo; (* mode description *)
- propertyFlags * : SET; (* applicable properties *)
- END;
-
- CONST
-
- (* ScreenMode requester tag values, used by AllocAslRequest() and AslRequest() *)
-
- (* Window control *)
- smWindow * = tb+2; (* Parent window *)
- smScreen * = tb+40; (* Screen to open on if no window *)
- smPubScreenName * = tb+41; (* Name of public screen *)
- smPrivateIDCMP * = tb+42; (* Allocate private IDCMP? *)
- smIntuiMsgFunc * = tb+70; (* Function to handle IntuiMessages *)
- smSleepWindow * = tb+43; (* Block input in SM_Window? *)
- smUserData * = tb+52; (* What to put in sm_UserData *)
-
- (* Text display *)
- smTextAttr * = tb+51; (* Text font to use for gadget text *)
- smLocale * = tb+50; (* Locale ASL should use for text *)
- smTitleText * = tb+1; (* Title of requester *)
- smPositiveText * = tb+18; (* Positive gadget text *)
- smNegativeText * = tb+19; (* Negative gadget text *)
-
- (* Initial settings *)
- smInitialLeftEdge * = tb+3; (* Initial requester coordinates *)
- smInitialTopEdge * = tb+4;
- smInitialWidth * = tb+5; (* Initial requester dimensions *)
- smInitialHeight * = tb+6;
- smInitialDisplayID * = tb+100; (* Initial display mode id *)
- smInitialDisplayWidth * = tb+101; (* Initial display width *)
- smInitialDisplayHeight * = tb+102; (* Initial display height *)
- smInitialDisplayDepth * = tb+103; (* Initial display depth *)
- smInitialOverscanType * = tb+104; (* Initial type of overscan *)
- smInitialAutoScroll * = tb+105; (* Initial autoscroll setting *)
- smInitialInfoOpened * = tb+106; (* Info wndw initially opened? *)
- smInitialInfoLeftEdge * = tb+107; (* Initial Info window coords. *)
- smInitialInfoTopEdge * = tb+108;
-
- (* Options *)
- smDoWidth * = tb+109; (* Display Width gadget? *)
- smDoHeight * = tb+110; (* Display Height gadget? *)
- smDoDepth * = tb+111; (* Display Depth gadget? *)
- smDoOverscanType * = tb+112; (* Display Overscan Type gadget? *)
- smDoAutoScroll * = tb+113; (* Display AutoScroll gadget? *)
-
- (* Filtering *)
- smPropertyFlags * = tb+114; (* Must have these Property flags *)
- smPropertyMask * = tb+115; (* Only these should be looked at *)
- smMinWidth * = tb+116; (* Minimum display width to allow *)
- smMaxWidth * = tb+117; (* Maximum display width to allow *)
- smMinHeight * = tb+118; (* Minimum display height to allow *)
- smMaxHeight * = tb+119; (* Maximum display height to allow *)
- smMinDepth * = tb+120; (* Minimum display depth *)
- smMaxDepth * = tb+121; (* Maximum display depth *)
- smFilterFunc * = tb+122; (* Function to filter mode id's *)
-
- (* Custom additions *)
- smCustomSMList * = tb+123; (* Exec list of struct DisplayMode *)
-
-
- (*****************************************************************************
- *
- * Obsolete ASL definitions, here for source code compatibility only.
- * Please do NOT use in new code.
- *
- *)
-
- CONST
-
- dummy * = U.tagUser + 80000H;
- hail * = dummy+1;
- window * = dummy+2;
- leftEdge * = dummy+3;
- topEdge * = dummy+4;
- width * = dummy+5;
- height * = dummy+6;
- hookFunc * = dummy+7;
- file * = dummy+8;
- dir * = dummy+9;
- fontName * = dummy+10;
- fontHeight * = dummy+11;
- fontStyles * = dummy+12;
- fontFlags * = dummy+13;
- frontPen * = dummy+14;
- backPen * = dummy+15;
- minHeight * = dummy+16;
- maxHeight * = dummy+17;
- okText * = dummy+18;
- cancelText * = dummy+19;
- funcFlags * = dummy+20;
- modeList * = dummy+21;
- extFlags1 * = dummy+22;
- pattern * = fontName;
- (* remember what I said up there? Do not use these anymore! *)
- filDoWildFunc * = 7;
- filDoMsgFunc * = 6;
- filSave * = 5;
- filNewIDCMP * = 4;
- filMultiSelect * = 3;
- filPatGad * = 0;
- fil1NoFiles * = 0;
- fil1MatchDirs * = 1;
- fonFrontColor * = 0;
- fonBackColor * = 1;
- fonStyles * = 2;
- fonDrawMode * = 3;
- fonFixedWidth * = 4;
- fonNewIDCMP * = 5;
- fonDoMsgFunc * = 6;
- fonDoWildFunc * = 7;
-
-
- (** --- Library Base variable -------------------------------------------- *)
-
- TYPE
-
- AslBasePtr * = CPOINTER TO AslBase;
- AslBase * = RECORD (E.Library) END;
-
- VAR
-
- base * : AslBasePtr;
-
-
- (** --- Library Functions ------------------------------------------------ *)
-
- (*
- ** $VER: asl_protos.h 38.3 (19.3.92)
- *)
-
- (*--- functions in V36 or higher (distributed as Release 2.0) ---*)
-
- (* OBSOLETE -- Please use the generic requester functions instead *)
-
- LIBCALL (base : AslBasePtr) AllocFileRequest * ()
- : FileRequesterPtr;
- -30;
- LIBCALL (base : AslBasePtr) FreeFileRequest *
- ( fileReq [8] : FileRequesterPtr );
- -36;
- LIBCALL (base : AslBasePtr) RequestFile *
- ( fileReq [8] : FileRequesterPtr )
- : BOOLEAN;
- -42;
- LIBCALL (base : AslBasePtr) AllocAslRequest *
- ( type [0] : E.ULONG;
- tagList [8] : ARRAY OF U.TagItem )
- : RequesterBasePtr;
- -48;
- LIBCALL (base : AslBasePtr) AllocAslRequestTags *
- ( type [0] : E.ULONG;
- tagList [8].. : U.Tag )
- : RequesterBasePtr;
- -48;
- LIBCALL (base : AslBasePtr) FreeAslRequest *
- ( request [8] : RequesterBasePtr );
- -54;
- LIBCALL (base : AslBasePtr) AslRequest *
- ( request [8] : RequesterBasePtr;
- tagList [9] : ARRAY OF U.TagItem )
- : BOOLEAN;
- -60;
- LIBCALL (base : AslBasePtr) AslRequestTags *
- ( request [8] : RequesterBasePtr;
- tagList [9].. : U.Tag )
- : BOOLEAN;
- -60;
-
- (** --- Library Base variable -------------------------------------------- *)
- (** $L- Address globals through A4 *)
-
-
- (*------------------------------------*)
- PROCEDURE* CloseLib ();
-
- BEGIN (* CloseLib *)
- IF base # NIL THEN E.base.CloseLibrary (base) END
- END CloseLib;
-
- (*------------------------------------*)
- PROCEDURE OpenLib * (mustOpen : BOOLEAN);
-
- BEGIN (* OpenLib *)
- IF base = NIL THEN
- base :=
- SYS.VAL
- ( AslBasePtr,
- E.base.OpenLibrary (name, E.libraryMinimum) );
- IF base # NIL THEN SYS.SETCLEANUP (CloseLib)
- ELSIF mustOpen THEN HALT (100)
- END;
- END;
- END OpenLib;
-
-
- BEGIN
- base := NIL
- END ASL.
-