home *** CD-ROM | disk | FTP | other *** search
- (***************************************************************************
-
- $RCSfile: ASL.mod $
- Description: Interface to asl.library
-
- Created by: fjc (Frank Copeland)
- $Revision: 3.7 $
- $Author: fjc $
- $Date: 1995/01/26 02:39:55 $
-
- 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-1995, Frank Copeland.
- This file is part of the Oberon-A Interface.
- See Oberon-A.doc for conditions of use and distribution.
-
- ***************************************************************************)
-
- <* STANDARD- *> <* INITIALISE- *> <* MAIN- *>
- <*$ CaseChk- IndexChk- LongVars+ NilChk- *>
- <*$ RangeChk- StackChk- TypeChk- OvflChk- *>
-
- MODULE [2] ASL;
-
- IMPORT
- SYS := SYSTEM, Kernel, e := Exec, u := Utility, gfx := Graphics,
- w := Workbench, s := Sets;
-
- (*
- ** $VER: asl.h 38.5 (5.1.93)
- **
- ** ASL library structures and constants
- *)
-
- (*****************************************************************************)
-
- CONST
-
- aslName * = "asl.library";
- aslTag * = u.user+080000H;
-
-
- (*****************************************************************************)
-
- 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 * = aslTag+2; (* Parent window *)
- screen * = aslTag+40; (* Screen to open on if no window *)
- pubScreenName * = aslTag+41; (* Name of public screen *)
- privateIDCMP * = aslTag+42; (* Allocate private IDCMP? *)
- intuiMsgFunc * = aslTag+70; (* Function to handle IntuiMessages *)
- sleepWindow * = aslTag+43; (* Block input in ASLFO_WindoU? *)
- userData * = aslTag+52; (* What to put in fo_UserData *)
-
- (* Text display *)
- textAttr * = aslTag+51; (* Text font to use for gadget text *)
- locale * = aslTag+50; (* Locale ASL should use for text *)
- titleText * = aslTag+1; (* Title of requester *)
- positiveText * = aslTag+18; (* Positive gadget text *)
- negativeText * = aslTag+19; (* Negative gadget text *)
-
- (* Initial settings *)
- initialLeftEdge * = aslTag+3; (* Initial requester coordinates *)
- initialTopEdge * = aslTag+4;
- initialWidth * = aslTag+5; (* Initial requester dimensions *)
- initialHeight * = aslTag+6;
-
- (* Filtering *)
- filterFunc * = aslTag+49; (* Function to filter fonts *)
- hookFunc * = aslTag+7; (* Combined callback function *)
-
- (*
- ** Requester base type, for type compatibility between requester
- ** structures
- *)
-
- TYPE
-
- ASLRequesterPtr * = POINTER TO ASLRequester;
- ASLRequester * = 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 * = POINTER TO FileRequester;
- FileRequester * = RECORD (ASLRequester)
- reserved0 - : ARRAY 4 OF e.UBYTE;
- file - : e.LSTRPTR; (* Contents of File gadget on exit *)
- drawer - : e.LSTRPTR; (* 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.WBArgumentsPtr; (* List of files selected *)
- userData - : e.APTR; (* You can store your own data here *)
- reserved3 - : ARRAY 8 OF e.UBYTE;
- pattern - : e.LSTRPTR; (* Contents of Pattern gadget on exit *)
- END;
-
- CONST
-
- (* File 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 *)
- initialFile * = aslTag+8; (* Initial contents of File gadget *)
- initialDrawer * = aslTag+9; (* Initial contents of Drawer gadg. *)
- initialPattern * = aslTag+10; (* Initial contents of Pattern gadg.*)
-
- (* Options *)
- flags1 * = aslTag+20; (* Option flags *)
- flags2 * = aslTag+22; (* Additional option flags *)
- doSaveMode * = aslTag+44; (* Being used for saving? *)
- doMultiSelect * = aslTag+45; (* Do multi-select? *)
- doPatterns * = aslTag+46; (* Display a Pattern gadget? *)
-
- (* Filtering *)
- (* see common tags above *)
- drawersOnly * = aslTag+47; (* Don't display files? *)
- rejectIcons * = aslTag+60; (* Display .info files? *)
- rejectPattern * = aslTag+61; (* Don't display files matching pat *)
- acceptPattern * = aslTag+62; (* Accept only files matching pat *)
- filterDrawers * = aslTag+63; (* Also filter drawers with patterns*)
-
- (* Flag bits for the flags1 tag *)
- frFilterFunc * = 7;
- frIntuiFunc * = 6;
- frDoSaveMode * = 5;
- frPrivateIDCMP * = 4;
- frDoMultiSelect * = 3;
- frDoPatterns * = 0;
-
- (* Flag bits for the flags2 tag *)
- frDrawersOnly * = 0;
- frFilterDrawers * = 1;
- frRejectIcons * = 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 * = POINTER TO FontRequester;
- FontRequester * = RECORD (ASLRequester)
- reserved0 - : ARRAY 8 OF e.UBYTE;
- attr - : gfx.TextAttr; (* Returned TextAttr *)
- frontPen - : SHORTINT; (* Returned front pen *)
- backPen - : SHORTINT; (* Returned back pen *)
- drawMode - : s.SET8; (* 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 - : gfx.TTextAttr; (* Returned TTextAttr *)
- END;
-
- 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 * = aslTag+10; (* Initial contents of Name gadget *)
- initialSize * = aslTag+11; (* Initial contents of Size gadget *)
- initialStyle * = aslTag+12; (* Initial font style *)
- initialFlags * = aslTag+13; (* Initial font flags for TextAttr *)
- initialFrontPen * = aslTag+14; (* Initial front pen *)
- initialBackPen * = aslTag+15; (* Initial back pen *)
- initialDrawMode * = aslTag+59; (* Initial draw mode *)
-
- (* Options *)
- flags * = aslTag+20; (* Option flags *)
- doFrontPen * = aslTag+44; (* Display Front color selector? *)
- doBackPen * = aslTag+45; (* Display Back color selector? *)
- doStyle * = aslTag+46; (* Display Style checkboxes? *)
- doDrawMode * = aslTag+47; (* Display DrawMode cycle gadget? *)
-
- (* Filtering *)
- fixedWidthOnly * = aslTag+48; (* Only allow fixed-width fonts? *)
- minHeight * = aslTag+16; (* Minimum font height to display *)
- maxHeight * = aslTag+17; (* Maximum font height to display *)
- maxFrontPen * = aslTag+66; (* Max # of colors in front palette *)
- maxBackPen * = aslTag+67; (* Max # of colors in back palette *)
-
- (* Custom additions *)
- modeList * = aslTag+21; (* Substitute list for drawmodes *)
- frontPens * = aslTag+64; (* Color table for front pen palette*)
- backPens * = aslTag+65; (* Color table for back pen palette *)
-
- (* Flag bits for foFlags tag *)
- foDoFrontPen * = 0;
- foDoBackPen * = 1;
- foDoStyle * = 2;
- foDoDrawMode * = 3;
- foFixedWidthOnly * = 4;
- foPrivateIDCMP * = 5;
- foIntuiFunc * = 6;
- foFilterFunc * = 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 * = POINTER TO ScreenModeRequester;
- ScreenModeRequester * = RECORD (ASLRequester)
- 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? *)
- pad1 : SHORTINT;
-
- 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? *)
- pad2 : SHORTINT;
- 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 * = POINTER TO DisplayMode;
- DisplayMode * = RECORD (e.NodeBase)
- node * : e.Node; (* see ln_Name *)
- dimensionInfo * : gfx.DimensionInfo; (* mode description *)
- propertyFlags * : s.SET32; (* applicable properties *)
- END;
-
- 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 * = aslTag+100; (* Initial display mode id *)
- initialDisplayWidth * = aslTag+101; (* Initial display width *)
- initialDisplayHeight * = aslTag+102; (* Initial display height *)
- initialDisplayDepth * = aslTag+103; (* Initial display depth *)
- initialOverscanType * = aslTag+104; (* Initial type of overscan *)
- initialAutoScroll * = aslTag+105; (* Initial autoscroll setting *)
- initialInfoOpened * = aslTag+106; (* Info wndw initially opened? *)
- initialInfoLeftEdge * = aslTag+107; (* Initial Info window coords. *)
- initialInfoTopEdge * = aslTag+108;
-
- (* Options *)
- doWidth * = aslTag+109; (* Display Width gadget? *)
- doHeight * = aslTag+110; (* Display Height gadget? *)
- doDepth * = aslTag+111; (* Display Depth gadget? *)
- doOverscanType * = aslTag+112; (* Display Overscan Type gadget? *)
- doAutoScroll * = aslTag+113; (* Display AutoScroll gadget? *)
-
- (* Filtering *)
- smPropertyFlags * = aslTag+114; (* Must have these Property flags *)
- smPropertyMask * = aslTag+115; (* Only these should be looked at *)
- smMinWidth * = aslTag+116; (* Minimum display width to allow *)
- smMaxWidth * = aslTag+117; (* Maximum display width to allow *)
- smMinHeight * = aslTag+118; (* Minimum display height to allow *)
- smMaxHeight * = aslTag+119; (* Maximum display height to allow *)
- smMinDepth * = aslTag+120; (* Minimum display depth *)
- smMaxDepth * = aslTag+121; (* Maximum display depth *)
- smFilterFunc * = aslTag+122; (* Function to filter mode id's *)
-
- (* Custom additions *)
- customSMList * = aslTag+123; (* Exec list of struct DisplayMode *)
-
-
- (*****************************************************************************
- *
- * Obsolete ASL definitions, here for source code compatibility only.
- * Please do NOT use in new code.
- *
- *)
-
- CONST
-
- fonFrontColor * = 0;
- fonBackColor * = 1;
- fonStyles * = 2;
- fonDrawMode * = 3;
- fonFixedWidth * = 4;
- fonNewIDCMP * = 5;
- fonDoMsgFunc * = 6;
- fonDoWildFunc * = 7;
-
- doWildFunc * = frFilterFunc;
- doMsgFunc * = frIntuiFunc;
- save * = frDoSaveMode;
- newIDCMP * = frPrivateIDCMP;
- multiSelect * = frDoMultiSelect;
- patGad * = frDoPatterns;
- noFiles * = frDrawersOnly;
-
- aslDummy * = aslTag;
-
- 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 of ASL Tag values *****************************************)
-
- CONST
-
- (** --- Library Base variable -------------------------------------------- *)
-
- VAR
-
- base *, asl * : e.LibraryPtr;
-
-
- (** --- 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 *)
-
- PROCEDURE AllocFileRequest* [base,-30] ()
- : FileRequesterPtr;
- PROCEDURE FreeFileRequest* [base,-36]
- ( fileReq [8] : FileRequesterPtr );
- PROCEDURE RequestFile* [base,-42]
- ( fileReq [8] : FileRequesterPtr )
- : BOOLEAN;
- PROCEDURE AllocAslRequest* [base,-48]
- ( type [0] : e.ULONG;
- tagList [8] : ARRAY OF u.TagItem )
- : ASLRequesterPtr;
- PROCEDURE AllocAslRequestTags* [base,-48]
- ( type [0] : e.ULONG;
- tagList [8].. : u.Tag )
- : ASLRequesterPtr;
- PROCEDURE FreeAslRequest* [base,-54]
- ( request [8] : ASLRequesterPtr );
- PROCEDURE AslRequest* [base,-60]
- ( request [8] : ASLRequesterPtr;
- tagList [9] : ARRAY OF u.TagItem )
- : BOOLEAN;
- PROCEDURE AslRequestTags* [base,-60]
- ( request [8] : ASLRequesterPtr;
- tagList [9].. : u.Tag )
- : BOOLEAN;
-
- (*--- Library Base variable --------------------------------------------*)
-
- <*$LongVars-*>
-
- (*------------------------------------*)
- PROCEDURE* [0] CloseLib (VAR rc : LONGINT);
-
- BEGIN (* CloseLib *)
- IF base # NIL THEN e.CloseLibrary (base) END
- END CloseLib;
-
- BEGIN
- base := e.OpenLibrary (aslName, e.libraryMinimum);
- IF base # NIL THEN Kernel.SetCleanup (CloseLib) END;
- asl := base
- END ASL.
-