amunits, morphunits: adjusted ASL library unit to latest SDK

git-svn-id: trunk@37020 -
This commit is contained in:
marcus 2017-08-21 18:05:05 +00:00
parent 627f45abac
commit a57a6d09f3
2 changed files with 794 additions and 802 deletions

View File

@ -49,26 +49,25 @@
nils.sjoholm@mailbox.swipnet.se nils.sjoholm@mailbox.swipnet.se
} }
{$PACKRECORDS 2} {$PACKRECORDS 2}
unit asl;
UNIT asl; interface
uses
INTERFACE exec, utility, workbench, agraphics;
uses exec, utility, workbench, agraphics;
{************************************************************************} {************************************************************************}
CONST const
ASLNAME : PChar = 'asl.library'; ASLNAME: PChar = 'asl.library';
ASL_TB = TAG_USER+$80000; ASL_TB = TAG_USER + $80000;
{************************************************************************} {************************************************************************}
{ Types of requesters known to ASL, used as arguments to AllocAslRequest() } // Types of requesters known to ASL, used as arguments to AllocAslRequest()
ASL_FileRequest = 0; ASL_FileRequest = 0;
ASL_FontRequest = 1; ASL_FontRequest = 1;
ASL_ScreenModeRequest = 2; ASL_ScreenModeRequest = 2;
{**************************************************************************** {****************************************************************************
* *
* ASL File Requester data structures and constants * ASL File Requester data structures and constants
@ -79,119 +78,139 @@ CONST
* AslRequest() * AslRequest()
} }
Type type
pFileRequester = ^tFileRequester; PFileRequester = ^TFileRequester;
tFileRequester = record TFileRequester = record
rf_Reserved0 : Array[0..3] Of Byte; case SmallInt of
rf_File : STRPTR; { Filename pointer } 0: (
rf_Dir : STRPTR; { Directory name pointer } rf_Reserved0: array[0..3] of Byte;
rf_Reserved1 : Array[0..9] Of Byte; rf_File: STRPTR; // Filename pointer
rf_LeftEdge : smallint; rf_Dir: STRPTR; // Directory name pointer
rf_TopEdge : smallint; { Preferred window pos } rf_Reserved1: array[0..9] of Byte;
rf_Width : smallint; rf_LeftEdge: SmallInt;
rf_Height : smallint; { Preferred window size } rf_TopEdge: SmallInt; // Preferred window pos
rf_Reserved2 : Array[0..1] Of Byte; rf_Width: SmallInt;
rf_NumArgs : LongInt; { A-la WB Args, FOR multiselects } rf_Height: SmallInt; // Preferred window size
rf_ArgList : pWBArgList; rf_Reserved2: array[0..1] of Byte;
rf_UserData : Pointer; { Applihandle (you may write!!) } rf_NumArgs: LongInt; // A-la WB Args, FOR multiselects
rf_Reserved3 : Array[0..7] Of Byte; rf_ArgList: PWBArgList;
rf_Pat : STRPTR; { Pattern match pointer } rf_UserData: APTR; // Applihandle (you may write!!)
END; { note - more reserved fields follow } rf_Reserved3: array[0..7] of Byte;
rf_Pat: STRPTR; // Pattern match pointer
);
1: (
fr_Reserved0: array[0..3] of Byte;
fr_File: STRPTR; // Filename pointer
fr_Drawer: STRPTR; // Directory name pointer
fr_Reserved1: array[0..9] of Byte;
fr_LeftEdge: SmallInt;
fr_TopEdge: SmallInt; // Preferred window pos
fr_Width: SmallInt;
fr_Height: SmallInt; // Preferred window size
fr_Reserved2: array[0..1] of Byte;
fr_NumArgs: LongInt; // A-la WB Args, FOR multiselects
fr_ArgList: PWBArgList;
fr_UserData: APTR; // Applihandle (you may write!!)
fr_Reserved3: array[0..7] of Byte;
fr_Pattern: STRPTR; // Pattern match pointer
);
end; // note - more reserved fields follow
{ File requester tag values, used by AllocAslRequest() and AslRequest() } { File requester tag values, used by AllocAslRequest() and AslRequest() }
const const
{ Window control } ASLFR_TitleText = ASL_TB + 1; // Title of requester
ASLFR_Window = ASL_TB+2 ; { Parent window } ASLFR_Window = ASL_TB + 2; // 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 }
ASLFR_PopToFront = ASL_TB+131; { Make the requester window visible }
ASLFR_Activate = ASL_TB+132; { Activate the requester window when }
{ Text display } ASLFR_InitialLeftEdge = ASL_TB + 3; // Initial requester coordinates
ASLFR_TextAttr = ASL_TB+51; { Text font to use for gadget text } ASLFR_InitialTopEdge = ASL_TB + 4;
ASLFR_Locale = ASL_TB+50; { Locale ASL should use for text } ASLFR_InitialWidth = ASL_TB + 5; // Initial requester dimensions
ASLFR_TitleText = ASL_TB+1 ; { Title of requester } ASLFR_InitialHeight = ASL_TB + 6;
ASLFR_PositiveText = ASL_TB+18; { Positive gadget text }
ASLFR_NegativeText = ASL_TB+19; { Negative gadget text }
{ Initial settings } ASLFR_HookFunc = ASL_TB + 7; // Combined callback function
ASLFR_InitialLeftEdge= ASL_TB+3 ; { Initial requester coordinates }
ASLFR_InitialTopEdge = ASL_TB+4 ;
ASLFR_InitialWidth = ASL_TB+5 ; { Initial requester dimensions }
ASLFR_InitialHeight = ASL_TB+6 ;
ASLFR_InitialFile = ASL_TB+8 ; { Initial contents of File gadget }
ASLFR_InitialDrawer = ASL_TB+9 ; { Initial contents of Drawer gadg. }
ASLFR_InitialPattern = ASL_TB+10; { Initial contents of Pattern gadg.}
ASLFR_InitialShowVolumes = ASL_TB+130; { Initially, show the volume list (V44) }
{ Options } ASLFR_InitialFile = ASL_TB + 8; // Initial contents of File gadget
ASLFR_Flags1 = ASL_TB+20; { Option flags } ASLFR_InitialDrawer = ASL_TB + 9; // Initial contents of Drawer gadg.
ASLFR_Flags2 = ASL_TB+22; { Additional option flags } ASLFR_InitialPattern = ASL_TB + 10; // Initial contents of Pattern gadg.
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_PositiveText = ASL_TB + 18; // Positive gadget text
ASLFR_DrawersOnly = ASL_TB+47; { Don't display files? } ASLFR_NegativeText = ASL_TB + 19; // Negative gadget text
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+7 ; { Combined callback function }
{ Sorting } ASLFR_Flags1 = ASL_TB + 20; // Option flags
ASLFR_SetSortBy = ASL_TB+124; { Sort criteria (name, date, size) } ASLFR_Flags2 = ASL_TB + 22; // Additional option flags
ASLFR_GetSortBy = ASL_TB+125;
ASLFR_SetSortDrawers = ASL_TB+126; { Placement of drawers in the list }
ASLFR_GetSortDrawers = ASL_TB+127;
ASLFR_SetSortOrder = ASL_TB+128; { Order (ascending or descending) }
ASLFR_GetSortOrder = ASL_TB+129;
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_SleepWindow = ASL_TB + 43; // Block input in ASLFR_Window?
{ Flag bits for the ASLFR_Flags1 tag } ASLFR_DoSaveMode = ASL_TB + 44; // Being used for saving?
FRB_FILTERFUNC = 7; ASLFR_DoMultiSelect = ASL_TB + 45; // Do multi-select?
FRB_INTUIFUNC = 6; ASLFR_DoPatterns = ASL_TB + 46; // Display a Pattern gadget?
FRB_DOSAVEMODE = 5;
FRB_PRIVATEIDCMP = 4;
FRB_DOMULTISELECT = 3;
FRB_DOPATTERNS = 0;
FRF_FILTERFUNC = 128; ASLFR_DrawersOnly = ASL_TB + 47; // Don't display files?
FRF_INTUIFUNC = 64; ASLFR_FilterFunc = ASL_TB + 49; // Function to filter files
FRF_DOSAVEMODE = 32;
FRF_PRIVATEIDCMP = 16;
FRF_DOMULTISELECT = 8;
FRF_DOPATTERNS = 1;
{ Flag bits for the ASLFR_Flags2 tag } ASLFR_Locale = ASL_TB + 50; // Locale ASL should use for text
FRB_DRAWERSONLY = 0; ASLFR_TextAttr = ASL_TB + 51; // Text font to use for gadget text
FRB_FILTERDRAWERS = 1; ASLFR_UserData = ASL_TB + 52; // What to put in fr_UserData
FRB_REJECTICONS = 2;
FRF_DRAWERSONLY = 1; ASLFR_RejectIcons = ASL_TB + 60; // Display .info files?
FRF_FILTERDRAWERS = 2; ASLFR_RejectPattern = ASL_TB + 61; // Don't display files matching pat
FRF_REJECTICONS = 4; ASLFR_AcceptPattern = ASL_TB + 62; // Accept only files matching pat
ASLFR_FilterDrawers = ASL_TB + 63; // Also filter drawers with patterns
{ Sort criteria for the ASLFR_SetSortBy/ASLFR_GetSortBy tags } ASLFR_IntuiMsgFunc = ASL_TB + 70; // Function to handle IntuiMessages
ASLFRSORTBY_Name = 0;
ASLFRSORTBY_Date = 1;
ASLFRSORTBY_Size = 2;
{ Drawer placement for the ASLFR_SetSortDrawers/ASLFR_GetSortDrawers tags } ASLFR_SetSortBy = ASL_TB + 124; // Sort criteria (name, date, size)
ASLFRSORTDRAWERS_First = 0; ASLFR_GetSortBy = ASL_TB + 125;
ASLFRSORTDRAWERS_Mix = 1; ASLFR_SetSortDrawers = ASL_TB + 126; // Placement of drawers in the list
ASLFRSORTDRAWERS_Last = 2; ASLFR_GetSortDrawers = ASL_TB + 127;
ASLFR_SetSortOrder = ASL_TB + 128; // Order (ascending or descending)
ASLFR_GetSortOrder = ASL_TB + 129;
// V44
ASLFR_InitialShowVolumes = ASL_TB + 130; // Initially, show the volume list
ASLFR_PopToFront = ASL_TB + 131; // Make the requester window visible
// V45
ASLFR_Activate = ASL_TB + 132; // Activate the requester window when
{ Sort order for the ASLFR_SetSortOrder/ASLFR_GetSortOrder tags } // Flag bits for the ASLFR_Flags1 tag
ASLFRSORTORDER_Ascend = 0; FRB_FILTERFUNC = 7;
ASLFRSORTORDER_Descend = 1; FRB_INTUIFUNC = 6;
FRB_DOSAVEMODE = 5;
FRB_PRIVATEIDCMP = 4;
FRB_DOMULTISELECT = 3;
FRB_DOPATTERNS = 0;
FRF_FILTERFUNC = 1 shl FRB_FILTERFUNC;
FRF_INTUIFUNC = 1 shl FRB_INTUIFUNC;
FRF_DOSAVEMODE = 1 shl FRB_DOSAVEMODE;
FRF_PRIVATEIDCMP = 1 shl FRB_PRIVATEIDCMP;
FRF_DOMULTISELECT = 1 shl FRB_DOMULTISELECT;
FRF_DOPATTERNS = 1 shl FRB_DOPATTERNS;
// Flag bits for the ASLFR_Flags2 tag
FRB_DRAWERSONLY = 0;
FRB_FILTERDRAWERS = 1;
FRB_REJECTICONS = 2;
FRF_DRAWERSONLY = 1 shl FRB_DRAWERSONLY;
FRF_FILTERDRAWERS = 1 shl FRB_FILTERDRAWERS;
FRF_REJECTICONS = 1 shl FRB_REJECTICONS;
// Sort criteria for the ASLFR_SetSortBy/ASLFR_GetSortBy tags
ASLFRSORTBY_Name = 0;
ASLFRSORTBY_Date = 1;
ASLFRSORTBY_Size = 2;
// Drawer placement for the ASLFR_SetSortDrawers/ASLFR_GetSortDrawers tags
ASLFRSORTDRAWERS_First = 0;
ASLFRSORTDRAWERS_Mix = 1;
ASLFRSORTDRAWERS_Last = 2;
// Sort order for the ASLFR_SetSortOrder/ASLFR_GetSortOrder tags
ASLFRSORTORDER_Ascend = 0;
ASLFRSORTORDER_Descend = 1;
{**************************************************************************** {****************************************************************************
* *
@ -203,101 +222,104 @@ const
* AslRequest() * AslRequest()
} }
Type type
pFontRequester = ^tFontRequester; PFontRequester = ^TFontRequester;
tFontRequester = record TFontRequester = record
fo_Reserved0 : Array[0..7] Of Byte; fo_Reserved0: array[0..7] of Byte;
fo_Attr : tTextAttr; { Returned TextAttr } fo_Attr: TTextAttr; // Returned TextAttr
fo_FrontPen : Byte; { Returned front pen } fo_FrontPen: Byte; // Returned front pen
fo_BackPen : Byte; { Returned back pen } fo_BackPen: Byte; // Returned back pen
fo_DrawMode : Byte; { Returned drawing mode } fo_DrawMode: Byte; // Returned drawing mode
fo_Reserved1 : Byte; fo_Reserved1: Byte;
fo_UserData : Pointer; { You can store your own data here } fo_UserData: APTR; // You can store your own data here
fo_LeftEdge : smallint; { Coordinates Of requester on Exit } fo_LeftEdge: SmallInt; // Coordinates Of requester on Exit
fo_TopEdge : smallint; fo_TopEdge: SmallInt;
fo_Width : smallint; fo_Width: SmallInt;
fo_Height : smallint; fo_Height: SmallInt;
fo_TAttr : tTTextAttr; { Returned TTextAttr } fo_TAttr: TTTextAttr; // Returned TTextAttr
end; end;
{ Font requester tag values, used by AllocAslRequest() AND AslRequest() } // Font requester tag values, used by AllocAslRequest() AND AslRequest()
const const
{ Window control } ASLFO_TitleText = ASL_TB + 1; // Title of requester
ASLFO_Window = ASL_TB+2 ; { Parent window } ASLFO_Window = ASL_TB + 2; // 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 }
ASLFO_PopToFront = ASL_TB+131; { Make the requester window visible
* when it opens (V44)
}
ASLFO_Activate = ASL_TB+132; { Activate the requester window when
* it opens (V45).
}
{ 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+1 ; { 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 + 3; // Initial requester coordinates
ASLFO_InitialLeftEdge= ASL_TB+3 ; { Initial requester coordinates } ASLFO_InitialTopEdge = ASL_TB + 4;
ASLFO_InitialTopEdge = ASL_TB+4 ; ASLFO_InitialWidth = ASL_TB + 5; // Initial requester dimensions
ASLFO_InitialWidth = ASL_TB+5 ; { Initial requester dimensions } ASLFO_InitialHeight = ASL_TB + 6;
ASLFO_InitialHeight = ASL_TB+6 ;
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_HookFunc = ASL_TB + 7; // Combined callback function
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? }
ASLFO_SampleText = ASL_TB+133; { Text to display in font sample area (V45) }
{ Filtering } ASLFO_InitialName = ASL_TB + 10; // Initial contents of Name gadget
ASLFO_FixedWidthOnly = ASL_TB+48; { Only allow fixed-width fonts? } ASLFO_InitialSize = ASL_TB + 11; // Initial contents of Size gadget
ASLFO_MinHeight = ASL_TB+16; { Minimum font height to display } ASLFO_InitialStyle = ASL_TB + 12; // Initial font style
ASLFO_MaxHeight = ASL_TB+17; { Maximum font height to display } ASLFO_InitialFlags = ASL_TB + 13; // Initial font flags for TextAttr
ASLFO_FilterFunc = ASL_TB+49; { Function to filter fonts } ASLFO_InitialFrontPen = ASL_TB + 14; // Initial front pen
ASLFO_HookFunc = ASL_TB+7 ; { Combined callback function } ASLFO_InitialBackPen = ASL_TB + 15; // Initial back pen
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_MinHeight = ASL_TB + 16; // Minimum font height to display
ASLFO_ModeList = ASL_TB+21; { Substitute list for drawmodes } ASLFO_MaxHeight = ASL_TB + 17; // Maximum font height to display
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 } ASLFO_PositiveText = ASL_TB + 18; // Positive gadget text
FOB_DOFRONTPEN = 0; ASLFO_NegativeText = ASL_TB + 19; // Negative gadget text
FOB_DOBACKPEN = 1;
FOB_DOSTYLE = 2;
FOB_DODRAWMODE = 3;
FOB_FIXEDWIDTHONLY= 4;
FOB_PRIVATEIDCMP = 5;
FOB_INTUIFUNC = 6;
FOB_FILTERFUNC = 7;
FOF_DOFRONTPEN = 1; ASLFO_Flags = ASL_TB + 20; // Option flags
FOF_DOBACKPEN = 2;
FOF_DOSTYLE = 4; ASLFO_ModeList = ASL_TB + 21; // Substitute list for drawmodes
FOF_DODRAWMODE = 8;
FOF_FIXEDWIDTHONLY = 16; ASLFO_Screen = ASL_TB + 40; // Screen to open on if no window
FOF_PRIVATEIDCMP = 32; ASLFO_PubScreenName = ASL_TB + 41; // Name of public screen
FOF_INTUIFUNC = 64; ASLFO_PrivateIDCMP = ASL_TB + 42; // Allocate private IDCMP?
FOF_FILTERFUNC = 128; ASLFO_SleepWindow = ASL_TB + 43; // Block input in ASLFO_Window?
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?
ASLFO_FixedWidthOnly = ASL_TB + 48; // Only allow fixed-width fonts?
ASLFO_FilterFunc = ASL_TB + 49; // Function to filter fonts
ASLFO_Locale = ASL_TB + 50; // Locale ASL should use for text
ASLFO_TextAttr = ASL_TB + 51; // Text font to use for gadget text
ASLFO_UserData = ASL_TB + 52; // What to put in fo_UserData
ASLFO_InitialDrawMode = ASL_TB + 59; // Initial draw mode
ASLFO_FrontPens = ASL_TB + 64; // Color table for front pen palette
ASLFO_BackPens = ASL_TB + 65; // Color table for back pen palette
ASLFO_MaxFrontPen = ASL_TB + 66; // Max # of colors in front palette
ASLFO_MaxBackPen = ASL_TB + 67; // Max # of colors in back palette
ASLFO_IntuiMsgFunc = ASL_TB + 70; // Function to handle IntuiMessages
// V44
ASLFO_PopToFront = ASL_TB + 131; // Make the requester window visible when it opens
// V45
ASLFO_Activate = ASL_TB + 132; // Activate the requester window when it opens
ASLFO_SampleText = ASL_TB + 133; // Text to display in font sample area
// Flag bits for ASLFO_Flags tag
FOB_DOFRONTPEN = 0;
FOB_DOBACKPEN = 1;
FOB_DOSTYLE = 2;
FOB_DODRAWMODE = 3;
FOB_FIXEDWIDTHONLY = 4;
FOB_PRIVATEIDCMP = 5;
FOB_INTUIFUNC = 6;
FOB_FILTERFUNC = 7;
FOF_DOFRONTPEN = 1 shl FOB_DOFRONTPEN;
FOF_DOBACKPEN = 1 shl FOB_DOBACKPEN;
FOF_DOSTYLE = 1 shl FOB_DOSTYLE;
FOF_DODRAWMODE = 1 shl FOB_DODRAWMODE;
FOF_FIXEDWIDTHONLY = 1 shl FOB_FIXEDWIDTHONLY;
FOF_PRIVATEIDCMP = 1 shl FOB_PRIVATEIDCMP;
FOF_INTUIFUNC = 1 shl FOB_INTUIFUNC;
FOF_FILTERFUNC = 1 shl FOB_FILTERFUNC;
{**************************************************************************** {****************************************************************************
* *
@ -309,32 +331,32 @@ const
* AslRequest() * AslRequest()
} }
Type type
pScreenModeRequester = ^tScreenModeRequester; PScreenModeRequester = ^TScreenModeRequester;
tScreenModeRequester = record TScreenModeRequester = record
sm_DisplayID : ULONG; { Display mode ID } sm_DisplayID: Cardinal; // Display mode ID
sm_DisplayWidth : ULONG; { Width Of display IN pixels } sm_DisplayWidth: Cardinal; // Width of display in pixels
sm_DisplayHeight : ULONG; { Height Of display IN pixels } sm_DisplayHeight: Cardinal; // Height of display in pixels
sm_DisplayDepth : word; { Number OF bit-planes OF display } sm_DisplayDepth: Word; // Number of bit-planes of display
sm_OverscanType : word; { TYPE OF overscan OF display } sm_OverscanType: Word; // type of overscan of display
sm_AutoScroll : Boolean; { Display should auto-scroll? } sm_AutoScroll: WordBool; // Display should auto-scroll?
sm_BitMapWidth : ULONG; { Used TO create your own BitMap } sm_BitMapWidth: Cardinal; // Used to create your own BitMap
sm_BitMapHeight : ULONG; sm_BitMapHeight: Cardinal;
sm_LeftEdge : smallint; { Coordinates OF requester on Exit } sm_LeftEdge: SmallInt; // Coordinates of requester on Exit
sm_TopEdge : smallint; sm_TopEdge: SmallInt;
sm_Width : smallint; sm_Width: SmallInt;
sm_Height : smallint; sm_Height: SmallInt;
sm_InfoOpened : Boolean; { Info window opened on exit? } sm_InfoOpened: WordBool; // Info window opened on exit?
sm_InfoLeftEdge : smallint; { Last coordinates OF Info window } sm_InfoLeftEdge: SmallInt; // Last coordinates of Info window
sm_InfoTopEdge : smallint; sm_InfoTopEdge: SmallInt;
sm_InfoWidth : smallint; sm_InfoWidth: SmallInt;
sm_InfoHeight : smallint; sm_InfoHeight: SmallInt;
sm_UserData : Pointer; { You can store your own data here } sm_UserData: APTR; // You can store your own data here
END; end;
{ An Exec list of custom modes can be added to the list of available modes. { An Exec list of custom modes can be added to the list of available modes.
@ -344,77 +366,70 @@ Type
* can be added in the dn_PropertyFlags field. Custom properties are not * can be added in the dn_PropertyFlags field. Custom properties are not
* allowed. * allowed.
} }
pDisplayMode = ^tDisplayMode; PDisplayMode = ^TDisplayMode;
tDisplayMode = record TDisplayMode = record
dm_Node : tNode; { see ln_Name } dm_Node: TNode; // see ln_Name
dm_DimensionInfo : tDimensionInfo; { mode description } dm_DimensionInfo: TDimensionInfo; // mode description
dm_PropertyFlags : ULONG; { applicable properties } dm_PropertyFlags: Cardinal; // applicable properties
end; end;
// ScreenMode requester tag values, used by AllocAslRequest() and AslRequest()
{ ScreenMode requester tag values, used by AllocAslRequest() and AslRequest() }
const const
{ Window control } ASLSM_TitleText = ASL_TB + 1; // Title of requester
ASLSM_Window = ASL_TB+2 ; { Parent window } ASLSM_Window = ASL_TB + 2; // 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 }
ASLSM_PopToFront = ASL_TB+131; { Make the requester window visible
* when it opens (V44)
}
ASLSM_Activate = ASL_TB+132; { Activate the requester window when
* it opens (V45).
}
{ Text display } ASLSM_InitialLeftEdge = ASL_TB + 3; // Initial requester coordinates
ASLSM_TextAttr = ASL_TB+51; { Text font to use for gadget text } ASLSM_InitialTopEdge = ASL_TB + 4;
ASLSM_Locale = ASL_TB+50; { Locale ASL should use for text } ASLSM_InitialWidth = ASL_TB + 5; // Initial requester dimensions
ASLSM_TitleText = ASL_TB+1 ; { Title of requester } ASLSM_InitialHeight = ASL_TB + 6;
ASLSM_PositiveText = ASL_TB+18; { Positive gadget text }
ASLSM_NegativeText = ASL_TB+19; { Negative gadget text }
{ Initial settings } ASLSM_PositiveText = ASL_TB + 18; // Positive gadget text
ASLSM_InitialLeftEdge = ASL_TB+3 ; { Initial requester coordinates } ASLSM_NegativeText = ASL_TB + 19; // Negative gadget text
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_Screen = ASL_TB + 40; // Screen to open on if no window
ASLSM_DoWidth = ASL_TB+109; { Display Width gadget? } ASLSM_PubScreenName = ASL_TB + 41; // Name of public screen
ASLSM_DoHeight = ASL_TB+110; { Display Height gadget? } ASLSM_PrivateIDCMP = ASL_TB + 42; // Allocate private IDCMP?
ASLSM_DoDepth = ASL_TB+111; { Display Depth gadget? } ASLSM_SleepWindow = ASL_TB + 43; // Block input in ASLSM_Window?
ASLSM_DoOverscanType = ASL_TB+112; { Display Overscan Type gadget? }
ASLSM_DoAutoScroll = ASL_TB+113; { Display AutoScroll gadget? }
{ Filtering } ASLSM_Locale = ASL_TB + 50; // Locale ASL should use for text
ASLSM_PropertyFlags = ASL_TB+114; { Must have these Property flags } ASLSM_TextAttr = ASL_TB + 51; // Text font to use for gadget text
ASLSM_PropertyMask = ASL_TB+115; { Only these should be looked at } ASLSM_UserData = ASL_TB + 52; // What to put in sm_UserData
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_IntuiMsgFunc = ASL_TB + 70; // Function to handle IntuiMessages
ASLSM_CustomSMList = ASL_TB+123; { Exec list of struct DisplayMode }
{***************************************************************************} 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;
ASL_LAST_TAG = ASL_TB+133; 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?
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
ASLSM_CustomSMList = ASL_TB + 123; // Exec list of struct DisplayMode
// V44
ASLSM_PopToFront = ASL_TB + 131; // Make the requester window visible when it opens
// V45
ASLSM_Activate = ASL_TB + 132; // Activate the requester window when it opens
ASL_LAST_TAG = ASL_TB + 133;
{***************************************************************************} {***************************************************************************}
@ -423,58 +438,45 @@ const
* of the semaphore is given below; it exists only with asl.library V45 and * of the semaphore is given below; it exists only with asl.library V45 and
* IPrefs V45 and beyond. * IPrefs V45 and beyond.
} }
ASL_SEMAPHORE_NAME : Pchar = 'asl.library'; ASL_SEMAPHORE_NAME: PChar = 'asl.library';
type type
PAslSemaphore = ^tAslSemaphore; PAslSemaphore = ^TAslSemaphore;
tAslSemaphore = record TAslSemaphore = record
as_Semaphore : tSignalSemaphore; as_Semaphore: TSignalSemaphore;
as_Version : UWORD; { Must be >= 45 } as_Version: Word; // Must be >= 45
as_Size : ULONG; { Size of this data structure. } as_Size: Cardinal; // Size of this data structure.
as_SortBy : UBYTE; { File requester defaults; name, date or size }
as_SortDrawers : UBYTE; { File requester defaults; first, mix or last } as_SortBy: Byte; // File requester defaults; name, date or size
as_SortOrder : UBYTE; { File requester defaults; ascending or descending } as_SortDrawers: Byte; // File requester defaults; first, mix or last
as_SizePosition : UBYTE; { See below } as_SortOrder: Byte; // File requester defaults; ascending or descending
as_RelativeLeft : WORD; { Window position offset }
as_RelativeTop : WORD; as_SizePosition: Byte; // See below
as_RelativeWidth : UBYTE; { Window size factor; this is
* a percentage of the parent as_RelativeLeft: Word; // Window position offset
* window/screen width. as_RelativeTop: Word;
}
as_RelativeHeight : UBYTE; as_RelativeWidth: Byte; // Window size factor; this is a percentage of the parent window/screen width.
end; as_RelativeHeight : Byte;
end;
const const
{ Default position of the ASL window. } // Default position of the ASL window.
ASLPOS_DefaultPosition = 0; { Position is calculated according to the builtin rules. } ASLPOS_DefaultPosition = 0; // Position is calculated according to the builtin rules.
ASLPOS_CenterWindow = 1; { Centred within the bounds of the parent window. } ASLPOS_CenterWindow = 1; // Centred within the bounds of the parent window.
ASLPOS_CenterScreen = 2; { Centred within the bounds of the parent screen. } ASLPOS_CenterScreen = 2; // Centred within the bounds of the parent screen.
ASLPOS_WindowPosition = 3; { Relative to the top left corner of the parent window, ASLPOS_WindowPosition = 3; // Relative to the top left corner of the parent window, using the offset values provided in the as_RelativeLeft/as_RelativeTop members.
* using the offset values provided in the ASLPOS_ScreenPosition = 4; // Relative to the top left corner of the parent screen, using the offset values provided in the as_RelativeLeft/as_RelativeTop members.
* as_RelativeLeft/as_RelativeTop members. ASLPOS_CenterMouse = 5; // Directly below the mouse pointer.
} ASLPOS_MASK = $0F;
ASLPOS_ScreenPosition = 4; { Relative to the top left corner of the parent screen, // Default size of the ASL window.
* using the offset values provided in the ASLSIZE_DefaultSize = 0 shl 4; // Size is calculated according to the builtin rules.
* as_RelativeLeft/as_RelativeTop members. ASLSIZE_RelativeSize = 1 shl 4; // Size is relative to the size of the parent window or screen, using the values provided in
} // the as_RelativeWidth/as_RelativeHeight members. The as_RelativeWidth/as_RelativeHeight values are
ASLPOS_CenterMouse = 5; { Directly below the mouse pointer. } // taken as percentage, i.e. a value of "50" stands for 50% of the width/height of the parent window/screen.
ASLPOS_MASK = $0F; ASLSIZE_MASK = $30;
// Other options.
{ Default size of the ASL window. } ASLOPTION_ASLOverrides = 1 shl 6; // ASL determines placement and size of requester windows; application's choice is ignored.
ASLSIZE_DefaultSize = (0 shl 4); { Size is calculated according to the builtin rules. }
ASLSIZE_RelativeSize = (1 shl 4); { Size is relative to the size of the parent
* window or screen, using the values provided in
* the as_RelativeWidth/as_RelativeHeight members.
* The as_RelativeWidth/as_RelativeHeight values are
* taken as percentage, i.e. a value of "50" stands for
* 50% of the width/height of the parent window/screen.
}
ASLSIZE_MASK = $30;
{ Other options. }
ASLOPTION_ASLOverrides = (1 shl 6); { ASL determines placement and size of requester
* windows; application's choice is ignored.
}
{**************************************************************************** {****************************************************************************
@ -486,48 +488,52 @@ const
} }
{$define ASL_V38_NAMES_ONLY} {$define ASL_V38_NAMES_ONLY}
{$ifndef ASL_V38_NAMES_ONLY} {$ifndef ASL_V38_NAMES_ONLY}
Const const
ASL_Dummy = (TAG_USER + $80000); ASL_Dummy = TAG_USER + $80000;
ASL_Hail = ASL_Dummy+1 ; ASL_Hail = ASL_Dummy + 1;
ASL_Window = ASL_Dummy+2 ; ASL_Window = ASL_Dummy + 2;
ASL_LeftEdge = ASL_Dummy+3 ; ASL_LeftEdge = ASL_Dummy + 3;
ASL_TopEdge = ASL_Dummy+4 ; ASL_TopEdge = ASL_Dummy + 4;
ASL_Width = ASL_Dummy+5 ; ASL_Width = ASL_Dummy + 5;
ASL_Height = ASL_Dummy+6 ; ASL_Height = ASL_Dummy + 6;
ASL_HookFunc = ASL_Dummy+7 ; ASL_HookFunc = ASL_Dummy + 7;
ASL_File = ASL_Dummy+8 ; ASL_File = ASL_Dummy + 8;
ASL_Dir = ASL_Dummy+9 ; ASL_Dir = ASL_Dummy + 9;
ASL_FontName = ASL_Dummy+10; ASL_FontName = ASL_Dummy + 10;
ASL_FontHeight = ASL_Dummy+11; ASL_FontHeight = ASL_Dummy + 11;
ASL_FontStyles = ASL_Dummy+12; ASL_FontStyles = ASL_Dummy + 12;
ASL_FontFlags = ASL_Dummy+13; ASL_FontFlags = ASL_Dummy + 13;
ASL_FrontPen = ASL_Dummy+14; ASL_FrontPen = ASL_Dummy + 14;
ASL_BackPen = ASL_Dummy+15; ASL_BackPen = ASL_Dummy + 15;
ASL_MinHeight = ASL_Dummy+16; ASL_MinHeight = ASL_Dummy + 16;
ASL_MaxHeight = ASL_Dummy+17; ASL_MaxHeight = ASL_Dummy + 17;
ASL_OKText = ASL_Dummy+18; ASL_OKText = ASL_Dummy + 18;
ASL_CancelText = ASL_Dummy+19; ASL_CancelText = ASL_Dummy + 19;
ASL_FuncFlags = ASL_Dummy+20; ASL_FuncFlags = ASL_Dummy + 20;
ASL_ModeList = ASL_Dummy+21; ASL_ModeList = ASL_Dummy + 21;
ASL_ExtFlags1 = ASL_Dummy+22; ASL_ExtFlags1 = ASL_Dummy + 22;
ASL_Pattern = ASL_FontName; ASL_Pattern = ASL_FontName;
{ remember what I said up there? Do not use these anymore! }
// remember what I said up there? Do not use these anymore!
FILB_DOWILDFUNC = 7; FILB_DOWILDFUNC = 7;
FILB_DOMSGFUNC = 6; FILB_DOMSGFUNC = 6;
FILB_SAVE = 5; FILB_SAVE = 5;
FILB_NEWIDCMP = 4; FILB_NEWIDCMP = 4;
FILB_MULTISELECT = 3; FILB_MULTISELECT = 3;
FILB_PATGAD = 0; FILB_PATGAD = 0;
FILF_DOWILDFUNC = 128;
FILF_DOMSGFUNC = 64; FILF_DOWILDFUNC = 1 shl FILB_DOWILDFUNC;
FILF_SAVE = 32; FILF_DOMSGFUNC = 1 shl FILB_DOMSGFUNC;
FILF_NEWIDCMP = 16; FILF_SAVE = 1 shl FILB_SAVE;
FILF_MULTISELECT = 8; FILF_NEWIDCMP = 1 shl FILB_NEWIDCMP;
FILF_PATGAD = 1; FILF_MULTISELECT = 1 shl FILB_MULTISELECT;
FIL1B_NOFILES = 0; FILF_PATGAD = 1 shl FILB_PATGAD;
FIL1B_MATCHDIRS = 1;
FIL1F_NOFILES = 1; FIL1B_NOFILES = 0;
FIL1F_MATCHDIRS = 2; FIL1B_MATCHDIRS = 1;
FIL1F_NOFILES = 1 shl FIL1B_NOFILES;
FIL1F_MATCHDIRS = 1 shl FIL1B_MATCHDIRS;
FONB_FRONTCOLOR = 0; FONB_FRONTCOLOR = 0;
FONB_BACKCOLOR = 1; FONB_BACKCOLOR = 1;
FONB_STYLES = 2; FONB_STYLES = 2;
@ -536,55 +542,54 @@ Const
FONB_NEWIDCMP = 5; FONB_NEWIDCMP = 5;
FONB_DOMSGFUNC = 6; FONB_DOMSGFUNC = 6;
FONB_DOWILDFUNC = 7; FONB_DOWILDFUNC = 7;
FONF_FRONTCOLOR = 1;
FONF_BACKCOLOR = 2; FONF_FRONTCOLOR = 1 shl FONB_FRONTCOLOR;
FONF_STYLES = 4; FONF_BACKCOLOR = 1 shl FONB_BACKCOLOR;
FONF_DRAWMODE = 8; FONF_STYLES = 1 shl FONB_STYLES;
FONF_FIXEDWIDTH = 16; FONF_DRAWMODE = 1 shl FONB_DRAWMODE;
FONF_NEWIDCMP = 32; FONF_FIXEDWIDTH = 1 shl FONB_FIXEDWIDTH;
FONF_DOMSGFUNC = 64; FONF_NEWIDCMP = 1 shl FONB_NEWIDCMP;
FONF_DOWILDFUNC = 128; FONF_DOMSGFUNC = 1 shl FONB_DOMSGFUNC;
FONF_DOWILDFUNC = 1 shl FONB_DOWILDFUNC;
{$endif ASL_V38_NAMES_ONLY} {$endif ASL_V38_NAMES_ONLY}
VAR AslBase : pLibrary = nil; var
AslBase: PLibrary = nil;
function AllocFileRequest: PFileRequester; SysCall AslBase 030;
procedure FreeFileRequest(FileReq: PFileRequester location 'a0'); SysCall AslBase 036;
function RequestFile(FileReq: PFileRequester location 'a0'): LongBool; SysCall AslBase 042;
function AllocAslRequest(ReqType: Cardinal location 'd0'; TagList: PTagItem location 'a0'): APTR; SysCall AslBase 048;
procedure FreeAslRequest(Requester: APTR location 'a0'); SysCall AslBase 054;
function AslRequest(Requester: APTR location 'a0'; TagList: PTagItem location 'a1'): LongBool; SysCall AslBase 060;
procedure AbortAslRequest(Requester: APTR location 'a0'); SysCall AslBase 078;
procedure ActivateAslRequest(Requester: APTR location 'a0'); SysCall AslBase 084;
FUNCTION AllocAslRequest(reqType : ULONG location 'd0'; tagList : pTagItem location 'a0') : POINTER; syscall AslBase 048; function AllocAslRequestTags(ReqType: Cardinal; const TagList: array of PtrUInt): APTR; Inline;
FUNCTION AllocFileRequest : pFileRequester; syscall AslBase 030; function AslRequestTags(Requester: APTR; const TagList: array of PtrUInt): LongBool; Inline;
FUNCTION AslRequest(requester : POINTER location 'a0'; tagList : pTagItem location 'a1') : LongBool; syscall AslBase 060;
PROCEDURE FreeAslRequest(requester : POINTER location 'a0'); syscall AslBase 054;
PROCEDURE FreeFileRequest(fileReq : pFileRequester location 'a0'); syscall AslBase 036;
FUNCTION RequestFile(fileReq : pFileRequester location 'a0') : LongBool; syscall AslBase 042;
PROCEDURE AbortAslRequest(requester : POINTER location 'a0'); syscall AslBase 078; implementation
PROCEDURE ActivateAslRequest(requester : POINTER location 'a0'); syscall AslBase 084;
function AllocAslRequestTags(reqType : ULONG; Const argv : array of PtrUInt) : POINTER; function AllocAslRequestTags(ReqType: Cardinal; const TagList: array of PtrUInt): APTR; Inline;
function AslRequestTags(requester : POINTER; Const argv : array of PtrUInt) : BOOLEAN;
IMPLEMENTATION
function AllocAslRequestTags(reqType : ULONG; Const argv : array of PtrUInt) : POINTER;
begin begin
AllocAslRequestTags := AllocAslRequest(reqType,@argv); AllocAslRequestTags := AllocAslRequest(ReqType, @tagList);
end; end;
function AslRequestTags(requester : POINTER; Const argv : array of PtrUInt) : BOOLEAN; function AslRequestTags(Requester: APTR; const TagList: array of PtrUInt): LongBool; Inline;
begin begin
AslRequestTags := AslRequest(requester,@argv); AslRequestTags := AslRequest(Requester, @TagList);
end; end;
const const
{ Change VERSION and LIBVERSION to proper values } // Change VERSION and LIBVERSION to proper values
VERSION : string[2] = '0'; VERSION : string[2] = '0';
LIBVERSION : longword = 0; LIBVERSION: LongWord = 0;
initialization initialization
AslBase := OpenLibrary(ASLNAME,LIBVERSION); AslBase := OpenLibrary(ASLNAME, LIBVERSION);
finalization finalization
if Assigned(AslBase) then if Assigned(AslBase) then
CloseLibrary(AslBase); CloseLibrary(PLibrary(AslBase));
END. (* UNIT ASL *) end.

View File

@ -24,14 +24,14 @@ unit asl;
interface interface
uses exec, utility, {workbench,} agraphics; uses exec, utility, workbench, agraphics;
{************************************************************************} {************************************************************************}
const const
ASLNAME : PChar = 'asl.library'; ASLNAME: PChar = 'asl.library';
ASL_TB = TAG_USER+$80000; ASL_TB = TAG_USER + $80000;
{************************************************************************} {************************************************************************}
@ -52,120 +52,138 @@ const
} }
type type
pFileRequester = ^tFileRequester; PFileRequester = ^TFileRequester;
tFileRequester = record TFileRequester = record
rf_Reserved0 : Array[0..3] Of Byte; case SmallInt of
rf_File : PChar; { Filename pointer } 0: (
rf_Dir : PChar; { Directory name pointer } rf_Reserved0: array[0..3] of Byte;
rf_Reserved1 : Array[0..9] Of Byte; rf_File: STRPTR; // Filename pointer
rf_LeftEdge : smallint; rf_Dir: STRPTR; // Directory name pointer
rf_TopEdge : smallint; { Preferred window pos } rf_Reserved1: array[0..9] of Byte;
rf_Width : smallint; rf_LeftEdge: SmallInt;
rf_Height : smallint; { Preferred window size } rf_TopEdge: SmallInt; // Preferred window pos
rf_Reserved2 : Array[0..1] Of Byte; rf_Width: SmallInt;
rf_NumArgs : LongInt; { A-la WB Args, FOR multiselects } rf_Height: SmallInt; // Preferred window size
{$WARNING FIX ME!!! Needs workbench unit} rf_Reserved2: array[0..1] of Byte;
{ rf_ArgList : pWBArgList;} rf_NumArgs: LongInt; // A-la WB Args, FOR multiselects
rf_ArgList : Pointer; rf_ArgList: PWBArgList;
rf_UserData : Pointer; { Applihandle (you may write!!) } rf_UserData: APTR; // Applihandle (you may write!!)
rf_Reserved3 : Array[0..7] Of Byte; rf_Reserved3: array[0..7] of Byte;
rf_Pat : PChar; { Pattern match pointer } rf_Pat: STRPTR; // Pattern match pointer
END; { note - more reserved fields follow } );
1: (
fr_Reserved0: array[0..3] of Byte;
fr_File: STRPTR; // Filename pointer
fr_Drawer: STRPTR; // Directory name pointer
fr_Reserved1: array[0..9] of Byte;
fr_LeftEdge: SmallInt;
fr_TopEdge: SmallInt; // Preferred window pos
fr_Width: SmallInt;
fr_Height: SmallInt; // Preferred window size
fr_Reserved2: array[0..1] of Byte;
fr_NumArgs: LongInt; // A-la WB Args, FOR multiselects
fr_ArgList: PWBArgList;
fr_UserData: APTR; // Applihandle (you may write!!)
fr_Reserved3: array[0..7] of Byte;
fr_Pattern: STRPTR; // Pattern match pointer
);
end; // note - more reserved fields follow
// File requester tag values, used by AllocAslRequest() and AslRequest()
{ File requester tag values, used by AllocAslRequest() and AslRequest() }
const const
{ Window control } ASLFR_TitleText = ASL_TB + 1; // Title of requester
ASLFR_Window = ASL_TB+2 ; { Parent window } ASLFR_Window = ASL_TB + 2; // 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 }
ASLFR_PopToFront = ASL_TB+131; { Make the requester window visible }
ASLFR_Activate = ASL_TB+132; { Activate the requester window when }
{ Text display } ASLFR_InitialLeftEdge = ASL_TB + 3; // Initial requester coordinates
ASLFR_TextAttr = ASL_TB+51; { Text font to use for gadget text } ASLFR_InitialTopEdge = ASL_TB + 4;
ASLFR_Locale = ASL_TB+50; { Locale ASL should use for text } ASLFR_InitialWidth = ASL_TB + 5; // Initial requester dimensions
ASLFR_TitleText = ASL_TB+1 ; { Title of requester } ASLFR_InitialHeight = ASL_TB + 6;
ASLFR_PositiveText = ASL_TB+18; { Positive gadget text }
ASLFR_NegativeText = ASL_TB+19; { Negative gadget text }
{ Initial settings } ASLFR_HookFunc = ASL_TB + 7; // Combined callback function
ASLFR_InitialLeftEdge= ASL_TB+3 ; { Initial requester coordinates }
ASLFR_InitialTopEdge = ASL_TB+4 ;
ASLFR_InitialWidth = ASL_TB+5 ; { Initial requester dimensions }
ASLFR_InitialHeight = ASL_TB+6 ;
ASLFR_InitialFile = ASL_TB+8 ; { Initial contents of File gadget }
ASLFR_InitialDrawer = ASL_TB+9 ; { Initial contents of Drawer gadg. }
ASLFR_InitialPattern = ASL_TB+10; { Initial contents of Pattern gadg.}
ASLFR_InitialShowVolumes = ASL_TB+130; { Initially, show the volume list (V44) }
{ Options } ASLFR_InitialFile = ASL_TB + 8; // Initial contents of File gadget
ASLFR_Flags1 = ASL_TB+20; { Option flags } ASLFR_InitialDrawer = ASL_TB + 9; // Initial contents of Drawer gadg.
ASLFR_Flags2 = ASL_TB+22; { Additional option flags } ASLFR_InitialPattern = ASL_TB + 10; // Initial contents of Pattern gadg.
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_PositiveText = ASL_TB + 18; // Positive gadget text
ASLFR_DrawersOnly = ASL_TB+47; { Don't display files? } ASLFR_NegativeText = ASL_TB + 19; // Negative gadget text
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+7 ; { Combined callback function }
{ Sorting } ASLFR_Flags1 = ASL_TB + 20; // Option flags
ASLFR_SetSortBy = ASL_TB+124; { Sort criteria (name, date, size) } ASLFR_Flags2 = ASL_TB + 22; // Additional option flags
ASLFR_GetSortBy = ASL_TB+125;
ASLFR_SetSortDrawers = ASL_TB+126; { Placement of drawers in the list }
ASLFR_GetSortDrawers = ASL_TB+127;
ASLFR_SetSortOrder = ASL_TB+128; { Order (ascending or descending) }
ASLFR_GetSortOrder = ASL_TB+129;
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_SleepWindow = ASL_TB + 43; // Block input in ASLFR_Window?
{ Flag bits for the ASLFR_Flags1 tag } ASLFR_DoSaveMode = ASL_TB + 44; // Being used for saving?
FRB_FILTERFUNC = 7; ASLFR_DoMultiSelect = ASL_TB + 45; // Do multi-select?
FRB_INTUIFUNC = 6; ASLFR_DoPatterns = ASL_TB + 46; // Display a Pattern gadget?
FRB_DOSAVEMODE = 5;
FRB_PRIVATEIDCMP = 4;
FRB_DOMULTISELECT = 3;
FRB_DOPATTERNS = 0;
FRF_FILTERFUNC = 128; ASLFR_DrawersOnly = ASL_TB + 47; // Don't display files?
FRF_INTUIFUNC = 64; ASLFR_FilterFunc = ASL_TB + 49; // Function to filter files
FRF_DOSAVEMODE = 32;
FRF_PRIVATEIDCMP = 16;
FRF_DOMULTISELECT = 8;
FRF_DOPATTERNS = 1;
{ Flag bits for the ASLFR_Flags2 tag } ASLFR_Locale = ASL_TB + 50; // Locale ASL should use for text
FRB_DRAWERSONLY = 0; ASLFR_TextAttr = ASL_TB + 51; // Text font to use for gadget text
FRB_FILTERDRAWERS = 1; ASLFR_UserData = ASL_TB + 52; // What to put in fr_UserData
FRB_REJECTICONS = 2;
FRF_DRAWERSONLY = 1; ASLFR_RejectIcons = ASL_TB + 60; // Display .info files?
FRF_FILTERDRAWERS = 2; ASLFR_RejectPattern = ASL_TB + 61; // Don't display files matching pat
FRF_REJECTICONS = 4; ASLFR_AcceptPattern = ASL_TB + 62; // Accept only files matching pat
ASLFR_FilterDrawers = ASL_TB + 63; // Also filter drawers with patterns
{ Sort criteria for the ASLFR_SetSortBy/ASLFR_GetSortBy tags } ASLFR_IntuiMsgFunc = ASL_TB + 70; // Function to handle IntuiMessages
ASLFRSORTBY_Name = 0;
ASLFRSORTBY_Date = 1;
ASLFRSORTBY_Size = 2;
{ Drawer placement for the ASLFR_SetSortDrawers/ASLFR_GetSortDrawers tags } ASLFR_SetSortBy = ASL_TB + 124; // Sort criteria (name, date, size)
ASLFRSORTDRAWERS_First = 0; ASLFR_GetSortBy = ASL_TB + 125;
ASLFRSORTDRAWERS_Mix = 1; ASLFR_SetSortDrawers = ASL_TB + 126; // Placement of drawers in the list
ASLFRSORTDRAWERS_Last = 2; ASLFR_GetSortDrawers = ASL_TB + 127;
ASLFR_SetSortOrder = ASL_TB + 128; // Order (ascending or descending)
ASLFR_GetSortOrder = ASL_TB + 129;
// V44
ASLFR_InitialShowVolumes = ASL_TB + 130; // Initially, show the volume list
ASLFR_PopToFront = ASL_TB + 131; // Make the requester window visible
// V45
ASLFR_Activate = ASL_TB + 132; // Activate the requester window when
{ Sort order for the ASLFR_SetSortOrder/ASLFR_GetSortOrder tags } // Flag bits for the ASLFR_Flags1 tag
ASLFRSORTORDER_Ascend = 0; FRB_FILTERFUNC = 7;
ASLFRSORTORDER_Descend = 1; FRB_INTUIFUNC = 6;
FRB_DOSAVEMODE = 5;
FRB_PRIVATEIDCMP = 4;
FRB_DOMULTISELECT = 3;
FRB_DOPATTERNS = 0;
FRF_FILTERFUNC = 1 shl FRB_FILTERFUNC;
FRF_INTUIFUNC = 1 shl FRB_INTUIFUNC;
FRF_DOSAVEMODE = 1 shl FRB_DOSAVEMODE;
FRF_PRIVATEIDCMP = 1 shl FRB_PRIVATEIDCMP;
FRF_DOMULTISELECT = 1 shl FRB_DOMULTISELECT;
FRF_DOPATTERNS = 1 shl FRB_DOPATTERNS;
// Flag bits for the ASLFR_Flags2 tag
FRB_DRAWERSONLY = 0;
FRB_FILTERDRAWERS = 1;
FRB_REJECTICONS = 2;
FRF_DRAWERSONLY = 1 shl FRB_DRAWERSONLY;
FRF_FILTERDRAWERS = 1 shl FRB_FILTERDRAWERS;
FRF_REJECTICONS = 1 shl FRB_REJECTICONS;
// Sort criteria for the ASLFR_SetSortBy/ASLFR_GetSortBy tags
ASLFRSORTBY_Name = 0;
ASLFRSORTBY_Date = 1;
ASLFRSORTBY_Size = 2;
// Drawer placement for the ASLFR_SetSortDrawers/ASLFR_GetSortDrawers tags
ASLFRSORTDRAWERS_First = 0;
ASLFRSORTDRAWERS_Mix = 1;
ASLFRSORTDRAWERS_Last = 2;
// Sort order for the ASLFR_SetSortOrder/ASLFR_GetSortOrder tags
ASLFRSORTORDER_Ascend = 0;
ASLFRSORTORDER_Descend = 1;
{**************************************************************************** {****************************************************************************
* *
@ -178,100 +196,102 @@ const
} }
type type
pFontRequester = ^tFontRequester; PFontRequester = ^TFontRequester;
tFontRequester = record TFontRequester = record
fo_Reserved0 : Array[0..7] Of Byte; fo_Reserved0: array[0..7] of Byte;
fo_Attr : tTextAttr; { Returned TextAttr } fo_Attr: TTextAttr; // Returned TextAttr
fo_FrontPen : Byte; { Returned front pen } fo_FrontPen: Byte; // Returned front pen
fo_BackPen : Byte; { Returned back pen } fo_BackPen: Byte; // Returned back pen
fo_DrawMode : Byte; { Returned drawing mode } fo_DrawMode: Byte; // Returned drawing mode
fo_Reserved1 : Byte; fo_Reserved1: Byte;
fo_UserData : Pointer; { You can store your own data here } fo_UserData: APTR; // You can store your own data here
fo_LeftEdge : smallint; { Coordinates Of requester on Exit } fo_LeftEdge: SmallInt; // Coordinates Of requester on Exit
fo_TopEdge : smallint; fo_TopEdge: SmallInt;
fo_Width : smallint; fo_Width: SmallInt;
fo_Height : smallint; fo_Height: SmallInt;
fo_TAttr : tTTextAttr; { Returned TTextAttr } fo_TAttr: TTTextAttr; // Returned TTextAttr
end; end;
{ Font requester tag values, used by AllocAslRequest() AND AslRequest() }
// Font requester tag values, used by AllocAslRequest() AND AslRequest()
const const
{ Window control } ASLFO_TitleText = ASL_TB + 1; // Title of requester
ASLFO_Window = ASL_TB+2 ; { Parent window } ASLFO_Window = ASL_TB + 2; // 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 }
ASLFO_PopToFront = ASL_TB+131; { Make the requester window visible
* when it opens (V44)
}
ASLFO_Activate = ASL_TB+132; { Activate the requester window when
* it opens (V45).
}
{ 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+1 ; { 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 + 3; // Initial requester coordinates
ASLFO_InitialLeftEdge= ASL_TB+3 ; { Initial requester coordinates } ASLFO_InitialTopEdge = ASL_TB + 4;
ASLFO_InitialTopEdge = ASL_TB+4 ; ASLFO_InitialWidth = ASL_TB + 5; // Initial requester dimensions
ASLFO_InitialWidth = ASL_TB+5 ; { Initial requester dimensions } ASLFO_InitialHeight = ASL_TB + 6;
ASLFO_InitialHeight = ASL_TB+6 ;
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_HookFunc = ASL_TB + 7; // Combined callback function
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? }
ASLFO_SampleText = ASL_TB+133; { Text to display in font sample area (V45) }
{ Filtering } ASLFO_InitialName = ASL_TB + 10; // Initial contents of Name gadget
ASLFO_FixedWidthOnly = ASL_TB+48; { Only allow fixed-width fonts? } ASLFO_InitialSize = ASL_TB + 11; // Initial contents of Size gadget
ASLFO_MinHeight = ASL_TB+16; { Minimum font height to display } ASLFO_InitialStyle = ASL_TB + 12; // Initial font style
ASLFO_MaxHeight = ASL_TB+17; { Maximum font height to display } ASLFO_InitialFlags = ASL_TB + 13; // Initial font flags for TextAttr
ASLFO_FilterFunc = ASL_TB+49; { Function to filter fonts } ASLFO_InitialFrontPen = ASL_TB + 14; // Initial front pen
ASLFO_HookFunc = ASL_TB+7 ; { Combined callback function } ASLFO_InitialBackPen = ASL_TB + 15; // Initial back pen
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_MinHeight = ASL_TB + 16; // Minimum font height to display
ASLFO_ModeList = ASL_TB+21; { Substitute list for drawmodes } ASLFO_MaxHeight = ASL_TB + 17; // Maximum font height to display
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 } ASLFO_PositiveText = ASL_TB + 18; // Positive gadget text
FOB_DOFRONTPEN = 0; ASLFO_NegativeText = ASL_TB + 19; // Negative gadget text
FOB_DOBACKPEN = 1;
FOB_DOSTYLE = 2;
FOB_DODRAWMODE = 3;
FOB_FIXEDWIDTHONLY= 4;
FOB_PRIVATEIDCMP = 5;
FOB_INTUIFUNC = 6;
FOB_FILTERFUNC = 7;
FOF_DOFRONTPEN = 1; ASLFO_Flags = ASL_TB + 20; // Option flags
FOF_DOBACKPEN = 2;
FOF_DOSTYLE = 4; ASLFO_ModeList = ASL_TB + 21; // Substitute list for drawmodes
FOF_DODRAWMODE = 8;
FOF_FIXEDWIDTHONLY = 16; ASLFO_Screen = ASL_TB + 40; // Screen to open on if no window
FOF_PRIVATEIDCMP = 32; ASLFO_PubScreenName = ASL_TB + 41; // Name of public screen
FOF_INTUIFUNC = 64; ASLFO_PrivateIDCMP = ASL_TB + 42; // Allocate private IDCMP?
FOF_FILTERFUNC = 128; ASLFO_SleepWindow = ASL_TB + 43; // Block input in ASLFO_Window?
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?
ASLFO_FixedWidthOnly = ASL_TB + 48; // Only allow fixed-width fonts?
ASLFO_FilterFunc = ASL_TB + 49; // Function to filter fonts
ASLFO_Locale = ASL_TB + 50; // Locale ASL should use for text
ASLFO_TextAttr = ASL_TB + 51; // Text font to use for gadget text
ASLFO_UserData = ASL_TB + 52; // What to put in fo_UserData
ASLFO_InitialDrawMode = ASL_TB + 59; // Initial draw mode
ASLFO_FrontPens = ASL_TB + 64; // Color table for front pen palette
ASLFO_BackPens = ASL_TB + 65; // Color table for back pen palette
ASLFO_MaxFrontPen = ASL_TB + 66; // Max # of colors in front palette
ASLFO_MaxBackPen = ASL_TB + 67; // Max # of colors in back palette
ASLFO_IntuiMsgFunc = ASL_TB + 70; // Function to handle IntuiMessages
// V44
ASLFO_PopToFront = ASL_TB + 131; // Make the requester window visible when it opens
// V45
ASLFO_Activate = ASL_TB + 132; // Activate the requester window when it opens
ASLFO_SampleText = ASL_TB + 133; // Text to display in font sample area
// Flag bits for ASLFO_Flags tag
FOB_DOFRONTPEN = 0;
FOB_DOBACKPEN = 1;
FOB_DOSTYLE = 2;
FOB_DODRAWMODE = 3;
FOB_FIXEDWIDTHONLY = 4;
FOB_PRIVATEIDCMP = 5;
FOB_INTUIFUNC = 6;
FOB_FILTERFUNC = 7;
FOF_DOFRONTPEN = 1 shl FOB_DOFRONTPEN;
FOF_DOBACKPEN = 1 shl FOB_DOBACKPEN;
FOF_DOSTYLE = 1 shl FOB_DOSTYLE;
FOF_DODRAWMODE = 1 shl FOB_DODRAWMODE;
FOF_FIXEDWIDTHONLY = 1 shl FOB_FIXEDWIDTHONLY;
FOF_PRIVATEIDCMP = 1 shl FOB_PRIVATEIDCMP;
FOF_INTUIFUNC = 1 shl FOB_INTUIFUNC;
FOF_FILTERFUNC = 1 shl FOB_FILTERFUNC;
{**************************************************************************** {****************************************************************************
* *
@ -283,32 +303,38 @@ const
* AslRequest() * AslRequest()
} }
Type type
pScreenModeRequester = ^tScreenModeRequester; PScreenModeRequester = ^TScreenModeRequester;
tScreenModeRequester = record TScreenModeRequester = record
sm_DisplayID : Cardinal; { Display mode ID } sm_DisplayID: Cardinal; // Display mode ID
sm_DisplayWidth : Cardinal; { Width Of display IN pixels } sm_DisplayWidth: Cardinal; // Width of display in pixels
sm_DisplayHeight : Cardinal; { Height Of display IN pixels } sm_DisplayHeight: Cardinal; // Height of display in pixels
sm_DisplayDepth : word; { Number OF bit-planes OF display } sm_DisplayDepth: Word; // Number of bit-planes of display
sm_OverscanType : word; { TYPE OF overscan OF display } sm_OverscanType: Word; // type of overscan of display
sm_AutoScroll : Boolean; { Display should auto-scroll? } sm_AutoScroll: WordBool; // Display should auto-scroll?
sm_BitMapWidth : Cardinal; { Used TO create your own BitMap } sm_BitMapWidth: Cardinal; // Used to create your own BitMap
sm_BitMapHeight : Cardinal; sm_BitMapHeight: Cardinal;
sm_LeftEdge : smallint; { Coordinates OF requester on Exit } sm_LeftEdge: SmallInt; // Coordinates of requester on Exit
sm_TopEdge : smallint; sm_TopEdge: SmallInt;
sm_Width : smallint; sm_Width: SmallInt;
sm_Height : smallint; sm_Height: SmallInt;
sm_InfoOpened : Boolean; { Info window opened on exit? } sm_InfoOpened: WordBool; // Info window opened on exit?
sm_InfoLeftEdge : smallint; { Last coordinates OF Info window } sm_InfoLeftEdge: SmallInt; // Last coordinates of Info window
sm_InfoTopEdge : smallint; sm_InfoTopEdge: SmallInt;
sm_InfoWidth : smallint; sm_InfoWidth: SmallInt;
sm_InfoHeight : smallint; sm_InfoHeight: SmallInt;
sm_UserData : Pointer; { You can store your own data here } sm_UserData: APTR; // You can store your own data here
END; // fields below are available from asl.library V51
sm_MonitorName: STRPTR; // Name of the monitor this sm_DisplayID is tied to To be passed as SA_MonitorName
sm_DisplayIDWidth: Cardinal; // sm_DisplayID resolution, to be passed as SA_DisplayWidth/Height in OpenScreen
sm_DisplayIDHeight: Cardinal;
end;
{ An Exec list of custom modes can be added to the list of available modes. { An Exec list of custom modes can be added to the list of available modes.
@ -318,77 +344,70 @@ Type
* can be added in the dn_PropertyFlags field. Custom properties are not * can be added in the dn_PropertyFlags field. Custom properties are not
* allowed. * allowed.
} }
pDisplayMode = ^tDisplayMode; PDisplayMode = ^TDisplayMode;
tDisplayMode = record TDisplayMode = record
dm_Node : tNode; { see ln_Name } dm_Node: TNode; // see ln_Name
dm_DimensionInfo : tDimensionInfo; { mode description } dm_DimensionInfo: TDimensionInfo; // mode description
dm_PropertyFlags : Cardinal; { applicable properties } dm_PropertyFlags: Cardinal; // applicable properties
end; end;
// ScreenMode requester tag values, used by AllocAslRequest() and AslRequest()
{ ScreenMode requester tag values, used by AllocAslRequest() and AslRequest() }
const const
{ Window control } ASLSM_TitleText = ASL_TB + 1; // Title of requester
ASLSM_Window = ASL_TB+2 ; { Parent window } ASLSM_Window = ASL_TB + 2; // 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 }
ASLSM_PopToFront = ASL_TB+131; { Make the requester window visible
* when it opens (V44)
}
ASLSM_Activate = ASL_TB+132; { Activate the requester window when
* it opens (V45).
}
{ Text display } ASLSM_InitialLeftEdge = ASL_TB + 3; // Initial requester coordinates
ASLSM_TextAttr = ASL_TB+51; { Text font to use for gadget text } ASLSM_InitialTopEdge = ASL_TB + 4;
ASLSM_Locale = ASL_TB+50; { Locale ASL should use for text } ASLSM_InitialWidth = ASL_TB + 5; // Initial requester dimensions
ASLSM_TitleText = ASL_TB+1 ; { Title of requester } ASLSM_InitialHeight = ASL_TB + 6;
ASLSM_PositiveText = ASL_TB+18; { Positive gadget text }
ASLSM_NegativeText = ASL_TB+19; { Negative gadget text }
{ Initial settings } ASLSM_PositiveText = ASL_TB + 18; // Positive gadget text
ASLSM_InitialLeftEdge = ASL_TB+3 ; { Initial requester coordinates } ASLSM_NegativeText = ASL_TB + 19; // Negative gadget text
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_Screen = ASL_TB + 40; // Screen to open on if no window
ASLSM_DoWidth = ASL_TB+109; { Display Width gadget? } ASLSM_PubScreenName = ASL_TB + 41; // Name of public screen
ASLSM_DoHeight = ASL_TB+110; { Display Height gadget? } ASLSM_PrivateIDCMP = ASL_TB + 42; // Allocate private IDCMP?
ASLSM_DoDepth = ASL_TB+111; { Display Depth gadget? } ASLSM_SleepWindow = ASL_TB + 43; // Block input in ASLSM_Window?
ASLSM_DoOverscanType = ASL_TB+112; { Display Overscan Type gadget? }
ASLSM_DoAutoScroll = ASL_TB+113; { Display AutoScroll gadget? }
{ Filtering } ASLSM_Locale = ASL_TB + 50; // Locale ASL should use for text
ASLSM_PropertyFlags = ASL_TB+114; { Must have these Property flags } ASLSM_TextAttr = ASL_TB + 51; // Text font to use for gadget text
ASLSM_PropertyMask = ASL_TB+115; { Only these should be looked at } ASLSM_UserData = ASL_TB + 52; // What to put in sm_UserData
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_IntuiMsgFunc = ASL_TB + 70; // Function to handle IntuiMessages
ASLSM_CustomSMList = ASL_TB+123; { Exec list of struct DisplayMode }
{***************************************************************************} 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;
ASL_LAST_TAG = ASL_TB+133; 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?
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
ASLSM_CustomSMList = ASL_TB + 123; // Exec list of struct DisplayMode
// V44
ASLSM_PopToFront = ASL_TB + 131; // Make the requester window visible when it opens
// V45
ASLSM_Activate = ASL_TB + 132; // Activate the requester window when it opens
ASL_LAST_TAG = ASL_TB + 133;
{***************************************************************************} {***************************************************************************}
@ -397,59 +416,45 @@ const
* of the semaphore is given below; it exists only with asl.library V45 and * of the semaphore is given below; it exists only with asl.library V45 and
* IPrefs V45 and beyond. * IPrefs V45 and beyond.
} }
ASL_SEMAPHORE_NAME : Pchar = 'asl.library'; ASL_SEMAPHORE_NAME: PChar = 'asl.library';
type type
PAslSemaphore = ^tAslSemaphore; PAslSemaphore = ^TAslSemaphore;
tAslSemaphore = record TAslSemaphore = record
as_Semaphore : tSignalSemaphore; as_Semaphore: TSignalSemaphore;
as_Version : Word; { Must be >= 45 } as_Version: Word; // Must be >= 45
as_Size : Cardinal; { Size of this data structure. } as_Size: Cardinal; // Size of this data structure.
as_SortBy : Byte; { File requester defaults; name, date or size }
as_SortDrawers : Byte; { File requester defaults; first, mix or last } as_SortBy: Byte; // File requester defaults; name, date or size
as_SortOrder : Byte; { File requester defaults; ascending or descending } as_SortDrawers: Byte; // File requester defaults; first, mix or last
as_SizePosition : Byte; { See below } as_SortOrder: Byte; // File requester defaults; ascending or descending
as_RelativeLeft : WORD; { Window position offset }
as_RelativeTop : WORD; as_SizePosition: Byte; // See below
as_RelativeWidth : Byte; { Window size factor; this is
* a percentage of the parent as_RelativeLeft: Word; // Window position offset
* window/screen width. as_RelativeTop: Word;
}
as_RelativeHeight : Byte; as_RelativeWidth: Byte; // Window size factor; this is a percentage of the parent window/screen width.
end; as_RelativeHeight : Byte;
end;
const const
{ Default position of the ASL window. } // Default position of the ASL window.
ASLPOS_DefaultPosition = 0; { Position is calculated according to the builtin rules. } ASLPOS_DefaultPosition = 0; // Position is calculated according to the builtin rules.
ASLPOS_CenterWindow = 1; { Centred within the bounds of the parent window. } ASLPOS_CenterWindow = 1; // Centred within the bounds of the parent window.
ASLPOS_CenterScreen = 2; { Centred within the bounds of the parent screen. } ASLPOS_CenterScreen = 2; // Centred within the bounds of the parent screen.
ASLPOS_WindowPosition = 3; { Relative to the top left corner of the parent window, ASLPOS_WindowPosition = 3; // Relative to the top left corner of the parent window, using the offset values provided in the as_RelativeLeft/as_RelativeTop members.
* using the offset values provided in the ASLPOS_ScreenPosition = 4; // Relative to the top left corner of the parent screen, using the offset values provided in the as_RelativeLeft/as_RelativeTop members.
* as_RelativeLeft/as_RelativeTop members. ASLPOS_CenterMouse = 5; // Directly below the mouse pointer.
} ASLPOS_MASK = $0F;
ASLPOS_ScreenPosition = 4; { Relative to the top left corner of the parent screen, // Default size of the ASL window.
* using the offset values provided in the ASLSIZE_DefaultSize = 0 shl 4; // Size is calculated according to the builtin rules.
* as_RelativeLeft/as_RelativeTop members. ASLSIZE_RelativeSize = 1 shl 4; // Size is relative to the size of the parent window or screen, using the values provided in
} // the as_RelativeWidth/as_RelativeHeight members. The as_RelativeWidth/as_RelativeHeight values are
ASLPOS_CenterMouse = 5; { Directly below the mouse pointer. } // taken as percentage, i.e. a value of "50" stands for 50% of the width/height of the parent window/screen.
ASLPOS_MASK = $0F; ASLSIZE_MASK = $30;
// Other options.
{ Default size of the ASL window. } ASLOPTION_ASLOverrides = 1 shl 6; // ASL determines placement and size of requester windows; application's choice is ignored.
ASLSIZE_DefaultSize = (0 shl 4); { Size is calculated according to the builtin rules. }
ASLSIZE_RelativeSize = (1 shl 4); { Size is relative to the size of the parent
* window or screen, using the values provided in
* the as_RelativeWidth/as_RelativeHeight members.
* The as_RelativeWidth/as_RelativeHeight values are
* taken as percentage, i.e. a value of "50" stands for
* 50% of the width/height of the parent window/screen.
}
ASLSIZE_MASK = $30;
{ Other options. }
ASLOPTION_ASLOverrides = (1 shl 6); { ASL determines placement and size of requester
* windows; application's choice is ignored.
}
{**************************************************************************** {****************************************************************************
* *
@ -461,47 +466,51 @@ const
{$define ASL_V38_NAMES_ONLY} {$define ASL_V38_NAMES_ONLY}
{$ifndef ASL_V38_NAMES_ONLY} {$ifndef ASL_V38_NAMES_ONLY}
const const
ASL_Dummy = (TAG_USER + $80000); ASL_Dummy = TAG_USER + $80000;
ASL_Hail = ASL_Dummy+1 ; ASL_Hail = ASL_Dummy + 1;
ASL_Window = ASL_Dummy+2 ; ASL_Window = ASL_Dummy + 2;
ASL_LeftEdge = ASL_Dummy+3 ; ASL_LeftEdge = ASL_Dummy + 3;
ASL_TopEdge = ASL_Dummy+4 ; ASL_TopEdge = ASL_Dummy + 4;
ASL_Width = ASL_Dummy+5 ; ASL_Width = ASL_Dummy + 5;
ASL_Height = ASL_Dummy+6 ; ASL_Height = ASL_Dummy + 6;
ASL_HookFunc = ASL_Dummy+7 ; ASL_HookFunc = ASL_Dummy + 7;
ASL_File = ASL_Dummy+8 ; ASL_File = ASL_Dummy + 8;
ASL_Dir = ASL_Dummy+9 ; ASL_Dir = ASL_Dummy + 9;
ASL_FontName = ASL_Dummy+10; ASL_FontName = ASL_Dummy + 10;
ASL_FontHeight = ASL_Dummy+11; ASL_FontHeight = ASL_Dummy + 11;
ASL_FontStyles = ASL_Dummy+12; ASL_FontStyles = ASL_Dummy + 12;
ASL_FontFlags = ASL_Dummy+13; ASL_FontFlags = ASL_Dummy + 13;
ASL_FrontPen = ASL_Dummy+14; ASL_FrontPen = ASL_Dummy + 14;
ASL_BackPen = ASL_Dummy+15; ASL_BackPen = ASL_Dummy + 15;
ASL_MinHeight = ASL_Dummy+16; ASL_MinHeight = ASL_Dummy + 16;
ASL_MaxHeight = ASL_Dummy+17; ASL_MaxHeight = ASL_Dummy + 17;
ASL_OKText = ASL_Dummy+18; ASL_OKText = ASL_Dummy + 18;
ASL_CancelText = ASL_Dummy+19; ASL_CancelText = ASL_Dummy + 19;
ASL_FuncFlags = ASL_Dummy+20; ASL_FuncFlags = ASL_Dummy + 20;
ASL_ModeList = ASL_Dummy+21; ASL_ModeList = ASL_Dummy + 21;
ASL_ExtFlags1 = ASL_Dummy+22; ASL_ExtFlags1 = ASL_Dummy + 22;
ASL_Pattern = ASL_FontName; ASL_Pattern = ASL_FontName;
{ remember what I said up there? Do not use these anymore! }
// remember what I said up there? Do not use these anymore!
FILB_DOWILDFUNC = 7; FILB_DOWILDFUNC = 7;
FILB_DOMSGFUNC = 6; FILB_DOMSGFUNC = 6;
FILB_SAVE = 5; FILB_SAVE = 5;
FILB_NEWIDCMP = 4; FILB_NEWIDCMP = 4;
FILB_MULTISELECT = 3; FILB_MULTISELECT = 3;
FILB_PATGAD = 0; FILB_PATGAD = 0;
FILF_DOWILDFUNC = 128;
FILF_DOMSGFUNC = 64; FILF_DOWILDFUNC = 1 shl FILB_DOWILDFUNC;
FILF_SAVE = 32; FILF_DOMSGFUNC = 1 shl FILB_DOMSGFUNC;
FILF_NEWIDCMP = 16; FILF_SAVE = 1 shl FILB_SAVE;
FILF_MULTISELECT = 8; FILF_NEWIDCMP = 1 shl FILB_NEWIDCMP;
FILF_PATGAD = 1; FILF_MULTISELECT = 1 shl FILB_MULTISELECT;
FIL1B_NOFILES = 0; FILF_PATGAD = 1 shl FILB_PATGAD;
FIL1B_MATCHDIRS = 1;
FIL1F_NOFILES = 1; FIL1B_NOFILES = 0;
FIL1F_MATCHDIRS = 2; FIL1B_MATCHDIRS = 1;
FIL1F_NOFILES = 1 shl FIL1B_NOFILES;
FIL1F_MATCHDIRS = 1 shl FIL1B_MATCHDIRS;
FONB_FRONTCOLOR = 0; FONB_FRONTCOLOR = 0;
FONB_BACKCOLOR = 1; FONB_BACKCOLOR = 1;
FONB_STYLES = 2; FONB_STYLES = 2;
@ -510,83 +519,61 @@ const
FONB_NEWIDCMP = 5; FONB_NEWIDCMP = 5;
FONB_DOMSGFUNC = 6; FONB_DOMSGFUNC = 6;
FONB_DOWILDFUNC = 7; FONB_DOWILDFUNC = 7;
FONF_FRONTCOLOR = 1;
FONF_BACKCOLOR = 2; FONF_FRONTCOLOR = 1 shl FONB_FRONTCOLOR;
FONF_STYLES = 4; FONF_BACKCOLOR = 1 shl FONB_BACKCOLOR;
FONF_DRAWMODE = 8; FONF_STYLES = 1 shl FONB_STYLES;
FONF_FIXEDWIDTH = 16; FONF_DRAWMODE = 1 shl FONB_DRAWMODE;
FONF_NEWIDCMP = 32; FONF_FIXEDWIDTH = 1 shl FONB_FIXEDWIDTH;
FONF_DOMSGFUNC = 64; FONF_NEWIDCMP = 1 shl FONB_NEWIDCMP;
FONF_DOWILDFUNC = 128; FONF_DOMSGFUNC = 1 shl FONB_DOMSGFUNC;
FONF_DOWILDFUNC = 1 shl FONB_DOWILDFUNC;
{$endif ASL_V38_NAMES_ONLY} {$endif ASL_V38_NAMES_ONLY}
var var
AslBase : pLibrary = nil; AslBase: PLibrary = nil;
function AllocFileRequest : pFileRequester; function AllocFileRequest: PFileRequester; SysCall AslBase 030;
SysCall AslBase 030; procedure FreeFileRequest(FileReq: PFileRequester location 'a0'); SysCall AslBase 036;
function RequestFile(FileReq: PFileRequester location 'a0'): LongBool; SysCall AslBase 042;
function AllocAslRequest(ReqType: Cardinal location 'd0'; TagList: PTagItem location 'a0'): APTR; SysCall AslBase 048;
procedure FreeAslRequest(Requester: APTR location 'a0'); SysCall AslBase 054;
function AslRequest(Requester: APTR location 'a0'; TagList: PTagItem location 'a1'): LongBool; SysCall AslBase 060;
procedure AbortAslRequest(Requester: APTR location 'a0'); SysCall AslBase 078;
procedure ActivateAslRequest(Requester: APTR location 'a0'); SysCall AslBase 084;
procedure FreeFileRequest(fileReq : pFileRequester location 'a0'); function AllocAslRequestTags(ReqType: Cardinal; const TagList: array of PtrUInt): APTR; Inline;
SysCall AslBase 036; function AslRequestTags(Requester: APTR; const TagList: array of PtrUInt): LongBool; Inline;
function RequestFile(fileReq : pFileRequester location 'a0'): LongBool;
SysCall AslBase 042;
function AllocAslRequest(reqType: Cardinal location 'd0';
tagList: pTagItem location 'a0'): Pointer;
SysCall AslBase 048;
procedure FreeAslRequest(requester: Pointer location 'a0');
SysCall AslBase 054;
function AslRequest(requester: Pointer location 'a0';
tagList : pTagItem location 'a1'): LongBool;
SysCall AslBase 060;
procedure AbortAslRequest(requester: Pointer location 'a0');
SysCall AslBase 078;
procedure ActivateAslRequest(requester : Pointer location 'a0');
SysCall AslBase 084;
function AllocAslRequestTags(reqType: Cardinal;
tagList: array of DWord): Pointer; Inline;
function AslRequestTags(requester: Pointer;
tagList : array of DWord): LongBool; Inline;
function InitAslLibrary : boolean; function InitAslLibrary : boolean;
implementation implementation
function AllocAslRequestTags(ReqType: Cardinal; const TagList: array of PtrUInt): APTR; Inline;
function AllocAslRequestTags(reqType: Cardinal;
tagList: array of DWord): Pointer; Inline;
begin begin
AllocAslRequestTags:=AllocAslRequest(reqType,@tagList); AllocAslRequestTags := AllocAslRequest(ReqType, @tagList);
end; end;
function AslRequestTags(requester: Pointer; function AslRequestTags(Requester: APTR; const TagList: array of PtrUInt): LongBool; Inline;
tagList : array of DWord): LongBool; Inline;
begin begin
AslRequestTags:=AslRequest(requester,@tagList); AslRequestTags := AslRequest(Requester, @TagList);
end; end;
const const
{ Change VERSION and LIBVERSION to proper values } // Change VERSION and LIBVERSION to proper values
VERSION : string[2] = '0'; VERSION : string[2] = '0';
LIBVERSION : longword = 0; LIBVERSION: LongWord = 0;
function InitAslLibrary : boolean; function InitAslLibrary: Boolean;
begin begin
InitAslLibrary:=Assigned(AslBase); InitAslLibrary := Assigned(AslBase);
end; end;
initialization initialization
AslBase := OpenLibrary(ASLNAME,LIBVERSION); AslBase := OpenLibrary(ASLNAME, LIBVERSION);
finalization finalization
if Assigned(AslBase) then if Assigned(AslBase) then
CloseLibrary(PLibrary(AslBase)); CloseLibrary(PLibrary(AslBase));
end. (* UNIT ASL *) end.