home *** CD-ROM | disk | FTP | other *** search
- DEFINITION FOR LIBRARY MODULE Asl ;
-
- FROM SYSTEM IMPORT ADDRESS, LONGSET, SHORTSET, STRING ;
- FROM Exec IMPORT Node, LibraryPtr ;
- FROM Utility IMPORT TagItemPtr, TAG_USER, Tag ;
- FROM Graphics IMPORT TextAttr, TTextAttr, DimensionInfo ;
- FROM Workbench IMPORT WBArg ;
-
- (* ASL library structures and constants *)
-
- TYPE
- FileRequesterPtr = POINTER TO FileRequester ;
- FontRequesterPtr = POINTER TO FontRequester ;
- ScreenModeRequesterPtr = POINTER TO ScreenModeRequester ;
- DisplayModePtr = POINTER TO DisplayMode ;
-
- (*============================================================================*)
-
- CONST
- AslName = "asl.library" ;
- ASL_TB = TAG_USER+080000H ;
-
- (*============================================================================*)
-
- (* Types of requesters known to ASL, used as arguments to AllocAslRequest() *)
- ASL_FileRequest = 0 ;
- ASL_FontRequest = 1 ;
- ASL_ScreenModeRequest = 2 ;
-
- (*=============================================================================
- |
- | 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
- FileRequester = RECORD
- CASE :BOOLEAN OF
- |TRUE:
- fr_Reserved0 : ARRAY [0..3] OF SHORTCARD ;
- fr_File : STRING ; (* Contents of File gadget on exit *)
- fr_Drawer : STRING ; (* Contents of Drawer gadget on exit *)
- fr_Reserved1 : ARRAY [0..9] OF SHORTCARD ;
- fr_LeftEdge : INTEGER ; (* Coordinates of requester on exit *)
- fr_TopEdge : INTEGER ;
- fr_Width : INTEGER ;
- fr_Height : INTEGER ;
- fr_Reserved2 : ARRAY [0..1] OF SHORTCARD ;
- fr_NumArgs : LONGINT ; (* Number of files selected *)
- fr_ArgList : POINTER TO ARRAY OF WBArg ;
- (* List of files selected *)
- fr_UserData : ADDRESS ; (* You can store your own data here *)
- fr_Reserved3 : ARRAY [0..7] OF SHORTCARD ;
- fr_Pattern : STRING ; (* Contents of Pattern gadget on exit *)
- |FALSE:
-
- (* Obsolete ASL field definitions, here for source code compatibility only.*)
- (* Please do NOT use in new code. *)
-
- rf_Reserved0 : ARRAY [0..3] OF SHORTCARD ;
- rf_File : STRING ;
- rf_Dir : STRING ;
- rf_Reserved1 : ARRAY [0..9] OF SHORTCARD ;
- rf_LeftEdge : INTEGER ;
- rf_TopEdge : INTEGER ;
- rf_Width : INTEGER ;
- rf_Height : INTEGER ;
- rf_Reserved2 : ARRAY [0..1] OF SHORTCARD ;
- rf_NumArgs : LONGINT ;
- rf_ArgList : POINTER TO ARRAY OF WBArg ;
- rf_UserData : ADDRESS ;
- rf_Reserved3 : ARRAY [0..7] OF SHORTCARD ;
- rf_Pat : STRING ;
- END ;
- END ;
-
- (* File requester tag values, used by AllocAslRequest() and AslRequest() *)
-
- (* Window control *)
- CONST
- ASLFR_Window = ASL_TB+02 ; (* Parent window *)
- ASLFR_Screen = ASL_TB+40 ; (* Screen to open on if no window *)
- ASLFR_PubScreenName = ASL_TB+41 ; (* Name of public screen *)
- ASLFR_PrivateIDCMP = ASL_TB+42 ; (* Allocate private IDCMP? *)
- ASLFR_IntuiMsgFunc = ASL_TB+70 ; (* Function to handle IntuiMessages *)
- ASLFR_SleepWindow = ASL_TB+43 ; (* Block input in ASLFR_Window? *)
- ASLFR_UserData = ASL_TB+52 ; (* What to put in fr_UserData *)
-
- (* Text display *)
- ASLFR_TextAttr = ASL_TB+51 ; (* Text font to use for gadget text *)
- ASLFR_Locale = ASL_TB+50 ; (* Locale ASL should use for text *)
- ASLFR_TitleText = ASL_TB+01 ; (* Title of requester *)
- ASLFR_PositiveText = ASL_TB+18 ; (* Positive gadget text *)
- ASLFR_NegativeText = ASL_TB+19 ; (* Negative gadget text *)
-
- (* Initial settings *)
- ASLFR_InitialLeftEdge = ASL_TB+03 ; (* Initial requester coordinates *)
- ASLFR_InitialTopEdge = ASL_TB+04 ;
- ASLFR_InitialWidth = ASL_TB+05 ; (* Initial requester dimensions *)
- ASLFR_InitialHeight = ASL_TB+06 ;
- ASLFR_InitialFile = ASL_TB+08 ; (* Initial contents of File gadget *)
- ASLFR_InitialDrawer = ASL_TB+09 ; (* Initial contents of Drawer gadg. *)
- ASLFR_InitialPattern = ASL_TB+10 ; (* Initial contents of Pattern gadg.*)
-
- (* Options *)
- ASLFR_Flags1 = ASL_TB+20 ; (* Option flags *)
- ASLFR_Flags2 = ASL_TB+22 ; (* Additional option flags *)
- ASLFR_DoSaveMode = ASL_TB+44 ; (* Being used for saving? *)
- ASLFR_DoMultiSelect = ASL_TB+45 ; (* Do multi-select? *)
- ASLFR_DoPatterns = ASL_TB+46 ; (* Display a Pattern gadget? *)
-
- (* Filtering *)
- ASLFR_DrawersOnly = ASL_TB+47 ; (* Don't display files? *)
- ASLFR_FilterFunc = ASL_TB+49 ; (* Function to filter files *)
- ASLFR_RejectIcons = ASL_TB+60 ; (* Display .info files? *)
- ASLFR_RejectPattern = ASL_TB+61 ; (* Don't display files matching pat *)
- ASLFR_AcceptPattern = ASL_TB+62 ; (* Accept only files matching pat *)
- ASLFR_FilterDrawers = ASL_TB+63 ; (* Also filter drawers with patterns *)
- ASLFR_HookFunc = ASL_TB+07 ; (* Combined callback function *)
-
- (* Flag bits for the ASLFR_Flags1 tag *)
-
- FRB_FILTERFUNC = 7 ; FRF_FILTERFUNC = {FRB_FILTERFUNC} ;
- FRB_INTUIFUNC = 6 ; FRF_INTUIFUNC = {FRB_INTUIFUNC} ;
- FRB_DOSAVEMODE = 5 ; FRF_DOSAVEMODE = {FRB_DOSAVEMODE} ;
- FRB_PRIVATEIDCMP = 4 ; FRF_PRIVATEIDCMP = {FRB_PRIVATEIDCMP} ;
- FRB_DOMULTISELECT = 3 ; FRF_DOMULTISELECT = {FRB_DOMULTISELECT} ;
- FRB_DOPATTERNS = 0 ; FRF_DOPATTERNS = {FRB_DOPATTERNS} ;
-
- (* Flag bits for the ASLFR_Flags2 tag *)
- FRB_DRAWERSONLY = 0 ; FRF_DRAWERSONLY = {FRB_DRAWERSONLY} ;
- FRB_FILTERDRAWERS = 1 ; FRF_FILTERDRAWERS = {FRB_FILTERDRAWERS} ;
- FRB_REJECTICONS = 2 ; FRF_REJECTICONS = {FRB_REJECTICONS} ;
-
- (*==============================================================================
- |
- | 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
- fo_Reserved0 : ARRAY [0..7] OF SHORTCARD ;
- fo_Attr : TextAttr ; (* Returned TextAttr *)
- fo_FrontPen : SHORTCARD ; (* Returned front pen *)
- fo_BackPen : SHORTCARD ; (* Returned back pen *)
- fo_DrawMode : SHORTSET ; (* Returned drawing mode *)
- fo_Reserved1 : SHORTCARD ;
- fo_UserData : ADDRESS ; (* You can store your own data here *)
- fo_LeftEdge : INTEGER ; (* Coordinates of requester on exit *)
- fo_TopEdge : INTEGER ;
- fo_Width : INTEGER ;
- fo_Height : INTEGER ;
- fo_TAttr : TTextAttr ; (* Returned TTextAttr *)
- END ;
-
- (* Font requester tag values, used by AllocAslRequest() and AslRequest() *)
-
- (* Window control *)
- CONST
- ASLFO_Window = ASL_TB+02 ; (* Parent window *)
- ASLFO_Screen = ASL_TB+40 ; (* Screen to open on if no window *)
- ASLFO_PubScreenName = ASL_TB+41 ; (* Name of public screen *)
- ASLFO_PrivateIDCMP = ASL_TB+42 ; (* Allocate private IDCMP? *)
- ASLFO_IntuiMsgFunc = ASL_TB+70 ; (* Function to handle IntuiMessages *)
- ASLFO_SleepWindow = ASL_TB+43 ; (* Block input in ASLFO_Window? *)
- ASLFO_UserData = ASL_TB+52 ; (* What to put in fo_UserData *)
-
- (* Text display *)
- ASLFO_TextAttr = ASL_TB+51 ; (* Text font to use for gadget text *)
- ASLFO_Locale = ASL_TB+50 ; (* Locale ASL should use for text *)
- ASLFO_TitleText = ASL_TB+01 ; (* Title of requester *)
- ASLFO_PositiveText = ASL_TB+18 ; (* Positive gadget text *)
- ASLFO_NegativeText = ASL_TB+19 ; (* Negative gadget text *)
-
- (* Initial settings *)
- ASLFO_InitialLeftEdge = ASL_TB+03 ; (* Initial requester coordinates *)
- ASLFO_InitialTopEdge = ASL_TB+04 ;
- ASLFO_InitialWidth = ASL_TB+05 ; (* Initial requester dimensions *)
- ASLFO_InitialHeight = ASL_TB+06 ;
- ASLFO_InitialName = ASL_TB+10 ; (* Initial contents of Name gadget *)
- ASLFO_InitialSize = ASL_TB+11 ; (* Initial contents of Size gadget *)
- ASLFO_InitialStyle = ASL_TB+12 ; (* Initial font style *)
- ASLFO_InitialFlags = ASL_TB+13 ; (* Initial font flags for TextAttr *)
- ASLFO_InitialFrontPen = ASL_TB+14 ; (* Initial front pen *)
- ASLFO_InitialBackPen = ASL_TB+15 ; (* Initial back pen *)
- ASLFO_InitialDrawMode = ASL_TB+59 ; (* Initial draw mode *)
-
- (* Options *)
- ASLFO_Flags = ASL_TB+20 ; (* Option flags *)
- ASLFO_DoFrontPen = ASL_TB+44 ; (* Display Front color selector? *)
- ASLFO_DoBackPen = ASL_TB+45 ; (* Display Back color selector? *)
- ASLFO_DoStyle = ASL_TB+46 ; (* Display Style checkboxes? *)
- ASLFO_DoDrawMode = ASL_TB+47 ; (* Display DrawMode cycle gadget? *)
-
- (* Filtering *)
- ASLFO_FixedWidthOnly = ASL_TB+48 ; (* Only allow fixed-width fonts? *)
- ASLFO_MinHeight = ASL_TB+16 ; (* Minimum font height to display *)
- ASLFO_MaxHeight = ASL_TB+17 ; (* Maximum font height to display *)
- ASLFO_FilterFunc = ASL_TB+49 ; (* Function to filter fonts *)
- ASLFO_HookFunc = ASL_TB+07 ; (* Combined callback function *)
- ASLFO_MaxFrontPen = ASL_TB+66 ; (* Max # of colors in front palette *)
- ASLFO_MaxBackPen = ASL_TB+67 ; (* Max # of colors in back palette *)
-
- (* Custom additions *)
- ASLFO_ModeList = ASL_TB+21 ; (* Substitute list for drawmodes *)
- ASLFO_FrontPens = ASL_TB+64 ; (* Color table for front pen palette*)
- ASLFO_BackPens = ASL_TB+65 ; (* Color table for back pen palette *)
-
- (* Flag bits for ASLFO_Flags tag *)
-
- FOB_DOFRONTPEN = 0 ; FOF_DOFRONTPEN = {FOB_DOFRONTPEN} ;
- FOB_DOBACKPEN = 1 ; FOF_DOBACKPEN = {FOB_DOBACKPEN} ;
- FOB_DOSTYLE = 2 ; FOF_DOSTYLE = {FOB_DOSTYLE} ;
- FOB_DODRAWMODE = 3 ; FOF_DODRAWMODE = {FOB_DODRAWMODE} ;
- FOB_FIXEDWIDTHONLY = 4 ; FOF_FIXEDWIDTHONLY = {FOB_FIXEDWIDTHONLY} ;
- FOB_PRIVATEIDCMP = 5 ; FOF_PRIVATEIDCMP = {FOB_PRIVATEIDCMP} ;
- FOB_INTUIFUNC = 6 ; FOF_INTUIFUNC = {FOB_INTUIFUNC} ;
- FOB_FILTERFUNC = 7 ; FOF_FILTERFUNC = {FOB_FILTERFUNC} ;
-
- (*=============================================================================
- |
- | 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
- ScreenModeRequester = RECORD
- sm_DisplayID : LONGINT ; (* Display mode ID *)
- sm_DisplayWidth : LONGINT ; (* Width of display in pixels *)
- sm_DisplayHeight : LONGINT ; (* Height of display in pixels *)
- sm_DisplayDepth : CARDINAL ; (* Number of bit-planes of display *)
- sm_OverscanType : CARDINAL ; (* Type of overscan of display *)
- sm_AutoScroll : INTEGER ; (* Display should auto-scroll? *)
-
- sm_BitMapWidth : LONGINT ; (* Used to create your own BitMap *)
- sm_BitMapHeight : LONGINT ;
-
- sm_LeftEdge : INTEGER ; (* Coordinates of requester on exit *)
- sm_TopEdge : INTEGER ;
- sm_Width : INTEGER ;
- sm_Height : INTEGER ;
-
- sm_InfoOpened : INTEGER ; (* Info window opened on exit? *)
- sm_InfoLeftEdge : INTEGER ; (* Last coordinates of Info window *)
- sm_InfoTopEdge : INTEGER ;
- sm_InfoWidth : INTEGER ;
- sm_InfoHeight : INTEGER ;
-
- sm_UserData : ADDRESS ; (* 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>. Custom mode ID's must be in the range *)
- (* 0FFFF0000H..0FFFFFFFFH.Regular properties which apply to your custom modes *)
- (* can be added in the dn_PropertyFlags field. Custom properties are not *)
- (* allowed. *)
-
- TYPE
- DisplayMode = RECORD
- dm_Node : Node ; (* see ln_Name *)
- dm_DimensionInfo : DimensionInfo ; (* mode description *)
- dm_PropertyFlags : LONGSET ; (* applicable properties *)
- END ;
-
- (* ScreenMode requester tag values, used by AllocAslRequest() and AslRequest()*)
-
- (* Window control *)
- CONST
- ASLSM_Window = ASL_TB+02 ; (* Parent window *)
- ASLSM_Screen = ASL_TB+40 ; (* Screen to open on if no window *)
- ASLSM_PubScreenName = ASL_TB+41 ; (* Name of public screen *)
- ASLSM_PrivateIDCMP = ASL_TB+42 ; (* Allocate private IDCMP? *)
- ASLSM_IntuiMsgFunc = ASL_TB+70 ; (* Function to handle IntuiMessages *)
- ASLSM_SleepWindow = ASL_TB+43 ; (* Block input in ASLSM_Window? *)
- ASLSM_UserData = ASL_TB+52 ; (* What to put in sm_UserData *)
-
- (* Text display *)
- ASLSM_TextAttr = ASL_TB+51 ; (* Text font to use for gadget text *)
- ASLSM_Locale = ASL_TB+50 ; (* Locale ASL should use for text *)
- ASLSM_TitleText = ASL_TB+01 ; (* Title of requester *)
- ASLSM_PositiveText = ASL_TB+18 ; (* Positive gadget text *)
- ASLSM_NegativeText = ASL_TB+19 ; (* Negative gadget text *)
-
- (* Initial settings *)
- ASLSM_InitialLeftEdge = ASL_TB+3 ; (* Initial requester coordinates *)
- ASLSM_InitialTopEdge = ASL_TB+4 ;
- ASLSM_InitialWidth = ASL_TB+5 ; (* Initial requester dimensions *)
- ASLSM_InitialHeight = ASL_TB+6 ;
- ASLSM_InitialDisplayID = ASL_TB+100 ; (* Initial display mode id *)
- ASLSM_InitialDisplayWidth = ASL_TB+101 ; (* Initial display width *)
- ASLSM_InitialDisplayHeight = ASL_TB+102 ; (* Initial display height *)
- ASLSM_InitialDisplayDepth = ASL_TB+103 ; (* Initial display depth *)
- ASLSM_InitialOverscanType = ASL_TB+104 ; (* Initial type of overscan *)
- ASLSM_InitialAutoScroll = ASL_TB+105 ; (* Initial autoscroll setting *)
- ASLSM_InitialInfoOpened = ASL_TB+106 ; (* Info wndw initially opened? *)
- ASLSM_InitialInfoLeftEdge = ASL_TB+107 ; (* Initial Info window coords. *)
- ASLSM_InitialInfoTopEdge = ASL_TB+108 ;
-
- (* Options *)
- ASLSM_DoWidth = ASL_TB+109 ; (* Display Width gadget? *)
- ASLSM_DoHeight = ASL_TB+110 ; (* Display Height gadget? *)
- ASLSM_DoDepth = ASL_TB+111 ; (* Display Depth gadget? *)
- ASLSM_DoOverscanType = ASL_TB+112 ; (* Display Overscan Type gadget? *)
- ASLSM_DoAutoScroll = ASL_TB+113 ; (* Display AutoScroll gadget? *)
-
- (* Filtering *)
- ASLSM_PropertyFlags = ASL_TB+114 ; (* Must have these Property flags *)
- ASLSM_PropertyMask = ASL_TB+115 ; (* Only these should be looked at *)
- ASLSM_MinWidth = ASL_TB+116 ; (* Minimum display width to allow *)
- ASLSM_MaxWidth = ASL_TB+117 ; (* Maximum display width to allow *)
- ASLSM_MinHeight = ASL_TB+118 ; (* Minimum display height to allow *)
- ASLSM_MaxHeight = ASL_TB+119 ; (* Maximum display height to allow *)
- ASLSM_MinDepth = ASL_TB+120 ; (* Minimum display depth *)
- ASLSM_MaxDepth = ASL_TB+121 ; (* Maximum display depth *)
- ASLSM_FilterFunc = ASL_TB+122 ; (* Function to filter mode id's *)
-
- (* Custom additions *)
- ASLSM_CustomSMList = ASL_TB+123 ; (* Exec list of struct DisplayMode *)
-
- (*==============================================================================
- |
- | Obsolete ASL definitions, here for source code compatibility only.
- | Please do NOT use in new code.
- |
- |=============================================================================*)
-
- ASL_Dummy = TAG_USER+080000H ;
- ASL_Hail = ASL_Dummy+1 ; ASL_Window = ASL_Dummy+2 ;
- ASL_LeftEdge = ASL_Dummy+3 ; ASL_TopEdge = ASL_Dummy+4 ;
- ASL_Width = ASL_Dummy+5 ; ASL_Height = ASL_Dummy+6 ;
- ASL_HookFunc = ASL_Dummy+7 ; ASL_File = ASL_Dummy+8 ;
- ASL_Dir = ASL_Dummy+9 ; ASL_FontName = ASL_Dummy+10 ;
- ASL_FontHeight = ASL_Dummy+11 ; ASL_FontStyles = ASL_Dummy+12 ;
- ASL_FontFlags = ASL_Dummy+13 ; ASL_FrontPen = ASL_Dummy+14 ;
- ASL_BackPen = ASL_Dummy+15 ; ASL_MinHeight = ASL_Dummy+16 ;
- ASL_MaxHeight = ASL_Dummy+17 ; ASL_OKText = ASL_Dummy+18 ;
- ASL_CancelText = ASL_Dummy+19 ; ASL_FuncFlags = ASL_Dummy+20 ;
- ASL_ModeList = ASL_Dummy+21 ; ASL_ExtFlags1 = ASL_Dummy+22 ;
- ASL_Pattern = ASL_FontName ;
-
- (* remember what I said up there? Do not use these anymore! *)
-
- FILB_DOWILDFUNC = 7 ; FILF_DOWILDFUNC = {FILB_DOWILDFUNC} ;
- FILB_DOMSGFUNC = 6 ; FILF_DOMSGFUNC = {FILB_DOMSGFUNC} ;
- FILB_SAVE = 5 ; FILF_SAVE = {FILB_SAVE} ;
- FILB_NEWIDCMP = 4 ; FILF_NEWIDCMP = {FILB_NEWIDCMP} ;
- FILB_MULTISELECT = 3 ; FILF_MULTISELECT = {FILB_MULTISELECT} ;
- FILB_PATGAD = 0 ; FILF_PATGAD = {FILB_PATGAD} ;
-
- FIL1B_NOFILES = 0 ; FIL1F_NOFILES = {FIL1B_NOFILES} ;
- FIL1B_MATCHDIRS = 1 ; FIL1F_MATCHDIRS = {FIL1B_MATCHDIRS} ;
-
- FONB_FRONTCOLOR = 0 ; FONF_FRONTCOLOR = {FONB_FRONTCOLOR} ;
- FONB_BACKCOLOR = 1 ; FONF_BACKCOLOR = {FONB_BACKCOLOR} ;
- FONB_STYLES = 2 ; FONF_STYLES = {FONB_STYLES} ;
- FONB_DRAWMODE = 3 ; FONF_DRAWMODE = {FONB_DRAWMODE} ;
- FONB_FIXEDWIDTH = 4 ; FONF_FIXEDWIDTH = {FONB_FIXEDWIDTH} ;
- FONB_NEWIDCMP = 5 ; FONF_NEWIDCMP = {FONB_NEWIDCMP} ;
- FONB_DOMSGFUNC = 6 ; FONF_DOMSGFUNC = {FONB_DOMSGFUNC} ;
- FONB_DOWILDFUNC = 7 ; FONF_DOWILDFUNC = {FONB_DOWILDFUNC} ;
-
- (*============================================================================*)
-
- VAR
- AslBase : LibraryPtr ;
-
- (* OBSOLETE -- Please use the generic requester functions instead *)
- PROCEDURE AllocFileRequest( ) : FileRequesterPtr ;
- PROCEDURE FreeFileRequest( fileReq : FileRequesterPtr ) ;
-
- PROCEDURE RequestFile( fileReq : FileRequesterPtr ) : BOOLEAN ;
- PROCEDURE AllocAslRequest( reqType : LONGINT ; tagList : TagItemPtr) : ADDRESS ;
- PROCEDURE AllocAslRequestTags( reqType : LONGINT ; Tag1 : Tag ; .. ) : ADDRESS ;
- PROCEDURE FreeAslRequest( requester : ADDRESS ) ;
- PROCEDURE AslRequest( requester : ADDRESS ; tagList : TagItemPtr ) : BOOLEAN ;
- PROCEDURE AslRequestTags( requester : ADDRESS ; Tag1 : Tag ; .. ) : BOOLEAN ;
-
- END Asl.
-