asl.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 2005 Karoly Balogh for Genesi S.a.r.l.
  5. intuition.library interface unit for MorphOS/PowerPC
  6. Based on work of Nils Sjoholm member of the Amiga RTL
  7. development team.
  8. MorphOS port was done on a free Pegasos II/G4 machine
  9. provided by Genesi S.a.r.l. <www.genesi.lu>
  10. See the file COPYING.FPC, included in this distribution,
  11. for details about the copyright.
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. **********************************************************************}
  16. {$PACKRECORDS 2}
  17. unit asl;
  18. interface
  19. uses exec, utility, {workbench,} graphics;
  20. {************************************************************************}
  21. const
  22. ASLNAME : PChar = 'asl.library';
  23. ASL_TB = TAG_USER+$80000;
  24. {************************************************************************}
  25. { Types of requesters known to ASL, used as arguments to AllocAslRequest() }
  26. ASL_FileRequest = 0;
  27. ASL_FontRequest = 1;
  28. ASL_ScreenModeRequest = 2;
  29. {****************************************************************************
  30. *
  31. * ASL File Requester data structures and constants
  32. *
  33. * This structure must only be allocated by asl.library amd is READ-ONLY!
  34. * Control of the various fields is provided via tags when the requester
  35. * is created with AllocAslRequest() and when it is displayed via
  36. * AslRequest()
  37. }
  38. type
  39. pFileRequester = ^tFileRequester;
  40. tFileRequester = record
  41. rf_Reserved0 : Array[0..3] Of Byte;
  42. rf_File : PChar; { Filename pointer }
  43. rf_Dir : PChar; { Directory name pointer }
  44. rf_Reserved1 : Array[0..9] Of Byte;
  45. rf_LeftEdge : smallint;
  46. rf_TopEdge : smallint; { Preferred window pos }
  47. rf_Width : smallint;
  48. rf_Height : smallint; { Preferred window size }
  49. rf_Reserved2 : Array[0..1] Of Byte;
  50. rf_NumArgs : LongInt; { A-la WB Args, FOR multiselects }
  51. {$WARNING FIX ME!!! Needs workbench unit}
  52. { rf_ArgList : pWBArgList;}
  53. rf_ArgList : Pointer;
  54. rf_UserData : Pointer; { Applihandle (you may write!!) }
  55. rf_Reserved3 : Array[0..7] Of Byte;
  56. rf_Pat : PChar; { Pattern match pointer }
  57. END; { note - more reserved fields follow }
  58. { File requester tag values, used by AllocAslRequest() and AslRequest() }
  59. const
  60. { Window control }
  61. ASLFR_Window = ASL_TB+2 ; { Parent window }
  62. ASLFR_Screen = ASL_TB+40; { Screen to open on if no window }
  63. ASLFR_PubScreenName = ASL_TB+41; { Name of public screen }
  64. ASLFR_PrivateIDCMP = ASL_TB+42; { Allocate private IDCMP? }
  65. ASLFR_IntuiMsgFunc = ASL_TB+70; { Function to handle IntuiMessages }
  66. ASLFR_SleepWindow = ASL_TB+43; { Block input in ASLFR_Window? }
  67. ASLFR_UserData = ASL_TB+52; { What to put in fr_UserData }
  68. ASLFR_PopToFront = ASL_TB+131; { Make the requester window visible }
  69. ASLFR_Activate = ASL_TB+132; { Activate the requester window when }
  70. { Text display }
  71. ASLFR_TextAttr = ASL_TB+51; { Text font to use for gadget text }
  72. ASLFR_Locale = ASL_TB+50; { Locale ASL should use for text }
  73. ASLFR_TitleText = ASL_TB+1 ; { Title of requester }
  74. ASLFR_PositiveText = ASL_TB+18; { Positive gadget text }
  75. ASLFR_NegativeText = ASL_TB+19; { Negative gadget text }
  76. { Initial settings }
  77. ASLFR_InitialLeftEdge= ASL_TB+3 ; { Initial requester coordinates }
  78. ASLFR_InitialTopEdge = ASL_TB+4 ;
  79. ASLFR_InitialWidth = ASL_TB+5 ; { Initial requester dimensions }
  80. ASLFR_InitialHeight = ASL_TB+6 ;
  81. ASLFR_InitialFile = ASL_TB+8 ; { Initial contents of File gadget }
  82. ASLFR_InitialDrawer = ASL_TB+9 ; { Initial contents of Drawer gadg. }
  83. ASLFR_InitialPattern = ASL_TB+10; { Initial contents of Pattern gadg.}
  84. ASLFR_InitialShowVolumes = ASL_TB+130; { Initially, show the volume list (V44) }
  85. { Options }
  86. ASLFR_Flags1 = ASL_TB+20; { Option flags }
  87. ASLFR_Flags2 = ASL_TB+22; { Additional option flags }
  88. ASLFR_DoSaveMode = ASL_TB+44; { Being used for saving? }
  89. ASLFR_DoMultiSelect = ASL_TB+45; { Do multi-select? }
  90. ASLFR_DoPatterns = ASL_TB+46; { Display a Pattern gadget? }
  91. { Filtering }
  92. ASLFR_DrawersOnly = ASL_TB+47; { Don't display files? }
  93. ASLFR_FilterFunc = ASL_TB+49; { Function to filter files }
  94. ASLFR_RejectIcons = ASL_TB+60; { Display .info files? }
  95. ASLFR_RejectPattern = ASL_TB+61; { Don't display files matching pat }
  96. ASLFR_AcceptPattern = ASL_TB+62; { Accept only files matching pat }
  97. ASLFR_FilterDrawers = ASL_TB+63; { Also filter drawers with patterns}
  98. ASLFR_HookFunc = ASL_TB+7 ; { Combined callback function }
  99. { Sorting }
  100. ASLFR_SetSortBy = ASL_TB+124; { Sort criteria (name, date, size) }
  101. ASLFR_GetSortBy = ASL_TB+125;
  102. ASLFR_SetSortDrawers = ASL_TB+126; { Placement of drawers in the list }
  103. ASLFR_GetSortDrawers = ASL_TB+127;
  104. ASLFR_SetSortOrder = ASL_TB+128; { Order (ascending or descending) }
  105. ASLFR_GetSortOrder = ASL_TB+129;
  106. { Flag bits for the ASLFR_Flags1 tag }
  107. FRB_FILTERFUNC = 7;
  108. FRB_INTUIFUNC = 6;
  109. FRB_DOSAVEMODE = 5;
  110. FRB_PRIVATEIDCMP = 4;
  111. FRB_DOMULTISELECT = 3;
  112. FRB_DOPATTERNS = 0;
  113. FRF_FILTERFUNC = 128;
  114. FRF_INTUIFUNC = 64;
  115. FRF_DOSAVEMODE = 32;
  116. FRF_PRIVATEIDCMP = 16;
  117. FRF_DOMULTISELECT = 8;
  118. FRF_DOPATTERNS = 1;
  119. { Flag bits for the ASLFR_Flags2 tag }
  120. FRB_DRAWERSONLY = 0;
  121. FRB_FILTERDRAWERS = 1;
  122. FRB_REJECTICONS = 2;
  123. FRF_DRAWERSONLY = 1;
  124. FRF_FILTERDRAWERS = 2;
  125. FRF_REJECTICONS = 4;
  126. { Sort criteria for the ASLFR_SetSortBy/ASLFR_GetSortBy tags }
  127. ASLFRSORTBY_Name = 0;
  128. ASLFRSORTBY_Date = 1;
  129. ASLFRSORTBY_Size = 2;
  130. { Drawer placement for the ASLFR_SetSortDrawers/ASLFR_GetSortDrawers tags }
  131. ASLFRSORTDRAWERS_First = 0;
  132. ASLFRSORTDRAWERS_Mix = 1;
  133. ASLFRSORTDRAWERS_Last = 2;
  134. { Sort order for the ASLFR_SetSortOrder/ASLFR_GetSortOrder tags }
  135. ASLFRSORTORDER_Ascend = 0;
  136. ASLFRSORTORDER_Descend = 1;
  137. {****************************************************************************
  138. *
  139. * ASL Font Requester data structures and constants
  140. *
  141. * This structure must only be allocated by asl.library amd is READ-ONLY!
  142. * Control of the various fields is provided via tags when the requester
  143. * is created with AllocAslRequest() and when it is displayed via
  144. * AslRequest()
  145. }
  146. type
  147. pFontRequester = ^tFontRequester;
  148. tFontRequester = record
  149. fo_Reserved0 : Array[0..7] Of Byte;
  150. fo_Attr : tTextAttr; { Returned TextAttr }
  151. fo_FrontPen : Byte; { Returned front pen }
  152. fo_BackPen : Byte; { Returned back pen }
  153. fo_DrawMode : Byte; { Returned drawing mode }
  154. fo_Reserved1 : Byte;
  155. fo_UserData : Pointer; { You can store your own data here }
  156. fo_LeftEdge : smallint; { Coordinates Of requester on Exit }
  157. fo_TopEdge : smallint;
  158. fo_Width : smallint;
  159. fo_Height : smallint;
  160. fo_TAttr : tTTextAttr; { Returned TTextAttr }
  161. end;
  162. { Font requester tag values, used by AllocAslRequest() AND AslRequest() }
  163. const
  164. { Window control }
  165. ASLFO_Window = ASL_TB+2 ; { Parent window }
  166. ASLFO_Screen = ASL_TB+40; { Screen to open on if no window }
  167. ASLFO_PubScreenName = ASL_TB+41; { Name of public screen }
  168. ASLFO_PrivateIDCMP = ASL_TB+42; { Allocate private IDCMP? }
  169. ASLFO_IntuiMsgFunc = ASL_TB+70; { Function to handle IntuiMessages }
  170. ASLFO_SleepWindow = ASL_TB+43; { Block input in ASLFO_Window? }
  171. ASLFO_UserData = ASL_TB+52; { What to put in fo_UserData }
  172. ASLFO_PopToFront = ASL_TB+131; { Make the requester window visible
  173. * when it opens (V44)
  174. }
  175. ASLFO_Activate = ASL_TB+132; { Activate the requester window when
  176. * it opens (V45).
  177. }
  178. { Text display }
  179. ASLFO_TextAttr = ASL_TB+51; { Text font to use for gadget text }
  180. ASLFO_Locale = ASL_TB+50; { Locale ASL should use for text }
  181. ASLFO_TitleText = ASL_TB+1 ; { Title of requester }
  182. ASLFO_PositiveText = ASL_TB+18; { Positive gadget text }
  183. ASLFO_NegativeText = ASL_TB+19; { Negative gadget text }
  184. { Initial settings }
  185. ASLFO_InitialLeftEdge= ASL_TB+3 ; { Initial requester coordinates }
  186. ASLFO_InitialTopEdge = ASL_TB+4 ;
  187. ASLFO_InitialWidth = ASL_TB+5 ; { Initial requester dimensions }
  188. ASLFO_InitialHeight = ASL_TB+6 ;
  189. ASLFO_InitialName = ASL_TB+10; { Initial contents of Name gadget }
  190. ASLFO_InitialSize = ASL_TB+11; { Initial contents of Size gadget }
  191. ASLFO_InitialStyle = ASL_TB+12; { Initial font style }
  192. ASLFO_InitialFlags = ASL_TB+13; { Initial font flags for TextAttr }
  193. ASLFO_InitialFrontPen= ASL_TB+14; { Initial front pen }
  194. ASLFO_InitialBackPen = ASL_TB+15; { Initial back pen }
  195. ASLFO_InitialDrawMode= ASL_TB+59; { Initial draw mode }
  196. { Options }
  197. ASLFO_Flags = ASL_TB+20; { Option flags }
  198. ASLFO_DoFrontPen = ASL_TB+44; { Display Front color selector? }
  199. ASLFO_DoBackPen = ASL_TB+45; { Display Back color selector? }
  200. ASLFO_DoStyle = ASL_TB+46; { Display Style checkboxes? }
  201. ASLFO_DoDrawMode = ASL_TB+47; { Display DrawMode cycle gadget? }
  202. ASLFO_SampleText = ASL_TB+133; { Text to display in font sample area (V45) }
  203. { Filtering }
  204. ASLFO_FixedWidthOnly = ASL_TB+48; { Only allow fixed-width fonts? }
  205. ASLFO_MinHeight = ASL_TB+16; { Minimum font height to display }
  206. ASLFO_MaxHeight = ASL_TB+17; { Maximum font height to display }
  207. ASLFO_FilterFunc = ASL_TB+49; { Function to filter fonts }
  208. ASLFO_HookFunc = ASL_TB+7 ; { Combined callback function }
  209. ASLFO_MaxFrontPen = ASL_TB+66; { Max # of colors in front palette }
  210. ASLFO_MaxBackPen = ASL_TB+67; { Max # of colors in back palette }
  211. { Custom additions }
  212. ASLFO_ModeList = ASL_TB+21; { Substitute list for drawmodes }
  213. ASLFO_FrontPens = ASL_TB+64; { Color table for front pen palette}
  214. ASLFO_BackPens = ASL_TB+65; { Color table for back pen palette }
  215. { Flag bits for ASLFO_Flags tag }
  216. FOB_DOFRONTPEN = 0;
  217. FOB_DOBACKPEN = 1;
  218. FOB_DOSTYLE = 2;
  219. FOB_DODRAWMODE = 3;
  220. FOB_FIXEDWIDTHONLY= 4;
  221. FOB_PRIVATEIDCMP = 5;
  222. FOB_INTUIFUNC = 6;
  223. FOB_FILTERFUNC = 7;
  224. FOF_DOFRONTPEN = 1;
  225. FOF_DOBACKPEN = 2;
  226. FOF_DOSTYLE = 4;
  227. FOF_DODRAWMODE = 8;
  228. FOF_FIXEDWIDTHONLY = 16;
  229. FOF_PRIVATEIDCMP = 32;
  230. FOF_INTUIFUNC = 64;
  231. FOF_FILTERFUNC = 128;
  232. {****************************************************************************
  233. *
  234. * ASL Screen Mode Requester data structures and constants
  235. *
  236. * This structure must only be allocated by asl.library and is READ-ONLY!
  237. * Control of the various fields is provided via tags when the requester
  238. * is created with AllocAslRequest() and when it is displayed via
  239. * AslRequest()
  240. }
  241. Type
  242. pScreenModeRequester = ^tScreenModeRequester;
  243. tScreenModeRequester = record
  244. sm_DisplayID : Cardinal; { Display mode ID }
  245. sm_DisplayWidth : Cardinal; { Width Of display IN pixels }
  246. sm_DisplayHeight : Cardinal; { Height Of display IN pixels }
  247. sm_DisplayDepth : word; { Number OF bit-planes OF display }
  248. sm_OverscanType : word; { TYPE OF overscan OF display }
  249. sm_AutoScroll : Boolean; { Display should auto-scroll? }
  250. sm_BitMapWidth : Cardinal; { Used TO create your own BitMap }
  251. sm_BitMapHeight : Cardinal;
  252. sm_LeftEdge : smallint; { Coordinates OF requester on Exit }
  253. sm_TopEdge : smallint;
  254. sm_Width : smallint;
  255. sm_Height : smallint;
  256. sm_InfoOpened : Boolean; { Info window opened on exit? }
  257. sm_InfoLeftEdge : smallint; { Last coordinates OF Info window }
  258. sm_InfoTopEdge : smallint;
  259. sm_InfoWidth : smallint;
  260. sm_InfoHeight : smallint;
  261. sm_UserData : Pointer; { You can store your own data here }
  262. END;
  263. { An Exec list of custom modes can be added to the list of available modes.
  264. * The DimensionInfo structure must be completely initialized, including the
  265. * Header. See <graphics/displayinfo.h>. Custom mode ID's must be in the range
  266. * $FFFF0000..$FFFFFFFF. Regular properties which apply to your custom modes
  267. * can be added in the dn_PropertyFlags field. Custom properties are not
  268. * allowed.
  269. }
  270. pDisplayMode = ^tDisplayMode;
  271. tDisplayMode = record
  272. dm_Node : tNode; { see ln_Name }
  273. dm_DimensionInfo : tDimensionInfo; { mode description }
  274. dm_PropertyFlags : Cardinal; { applicable properties }
  275. end;
  276. { ScreenMode requester tag values, used by AllocAslRequest() and AslRequest() }
  277. const
  278. { Window control }
  279. ASLSM_Window = ASL_TB+2 ; { Parent window }
  280. ASLSM_Screen = ASL_TB+40; { Screen to open on if no window }
  281. ASLSM_PubScreenName = ASL_TB+41; { Name of public screen }
  282. ASLSM_PrivateIDCMP = ASL_TB+42; { Allocate private IDCMP? }
  283. ASLSM_IntuiMsgFunc = ASL_TB+70; { Function to handle IntuiMessages }
  284. ASLSM_SleepWindow = ASL_TB+43; { Block input in ASLSM_Window? }
  285. ASLSM_UserData = ASL_TB+52; { What to put in sm_UserData }
  286. ASLSM_PopToFront = ASL_TB+131; { Make the requester window visible
  287. * when it opens (V44)
  288. }
  289. ASLSM_Activate = ASL_TB+132; { Activate the requester window when
  290. * it opens (V45).
  291. }
  292. { Text display }
  293. ASLSM_TextAttr = ASL_TB+51; { Text font to use for gadget text }
  294. ASLSM_Locale = ASL_TB+50; { Locale ASL should use for text }
  295. ASLSM_TitleText = ASL_TB+1 ; { Title of requester }
  296. ASLSM_PositiveText = ASL_TB+18; { Positive gadget text }
  297. ASLSM_NegativeText = ASL_TB+19; { Negative gadget text }
  298. { Initial settings }
  299. ASLSM_InitialLeftEdge = ASL_TB+3 ; { Initial requester coordinates }
  300. ASLSM_InitialTopEdge = ASL_TB+4 ;
  301. ASLSM_InitialWidth = ASL_TB+5 ; { Initial requester dimensions }
  302. ASLSM_InitialHeight = ASL_TB+6 ;
  303. ASLSM_InitialDisplayID = ASL_TB+100; { Initial display mode id }
  304. ASLSM_InitialDisplayWidth = ASL_TB+101; { Initial display width }
  305. ASLSM_InitialDisplayHeight = ASL_TB+102; { Initial display height }
  306. ASLSM_InitialDisplayDepth = ASL_TB+103; { Initial display depth }
  307. ASLSM_InitialOverscanType = ASL_TB+104; { Initial type of overscan }
  308. ASLSM_InitialAutoScroll = ASL_TB+105; { Initial autoscroll setting }
  309. ASLSM_InitialInfoOpened = ASL_TB+106; { Info wndw initially opened? }
  310. ASLSM_InitialInfoLeftEdge = ASL_TB+107; { Initial Info window coords. }
  311. ASLSM_InitialInfoTopEdge = ASL_TB+108;
  312. { Options }
  313. ASLSM_DoWidth = ASL_TB+109; { Display Width gadget? }
  314. ASLSM_DoHeight = ASL_TB+110; { Display Height gadget? }
  315. ASLSM_DoDepth = ASL_TB+111; { Display Depth gadget? }
  316. ASLSM_DoOverscanType = ASL_TB+112; { Display Overscan Type gadget? }
  317. ASLSM_DoAutoScroll = ASL_TB+113; { Display AutoScroll gadget? }
  318. { Filtering }
  319. ASLSM_PropertyFlags = ASL_TB+114; { Must have these Property flags }
  320. ASLSM_PropertyMask = ASL_TB+115; { Only these should be looked at }
  321. ASLSM_MinWidth = ASL_TB+116; { Minimum display width to allow }
  322. ASLSM_MaxWidth = ASL_TB+117; { Maximum display width to allow }
  323. ASLSM_MinHeight = ASL_TB+118; { Minimum display height to allow }
  324. ASLSM_MaxHeight = ASL_TB+119; { Maximum display height to allow }
  325. ASLSM_MinDepth = ASL_TB+120; { Minimum display depth }
  326. ASLSM_MaxDepth = ASL_TB+121; { Maximum display depth }
  327. ASLSM_FilterFunc = ASL_TB+122; { Function to filter mode id's }
  328. { Custom additions }
  329. ASLSM_CustomSMList = ASL_TB+123; { Exec list of struct DisplayMode }
  330. {***************************************************************************}
  331. ASL_LAST_TAG = ASL_TB+133;
  332. {***************************************************************************}
  333. { This defines the rendezvous data for setting and querying asl.library's
  334. * defaults for the window size and the file requester sort order. The name
  335. * of the semaphore is given below; it exists only with asl.library V45 and
  336. * IPrefs V45 and beyond.
  337. }
  338. ASL_SEMAPHORE_NAME : Pchar = 'asl.library';
  339. type
  340. PAslSemaphore = ^tAslSemaphore;
  341. tAslSemaphore = record
  342. as_Semaphore : tSignalSemaphore;
  343. as_Version : Word; { Must be >= 45 }
  344. as_Size : Cardinal; { Size of this data structure. }
  345. as_SortBy : Byte; { File requester defaults; name, date or size }
  346. as_SortDrawers : Byte; { File requester defaults; first, mix or last }
  347. as_SortOrder : Byte; { File requester defaults; ascending or descending }
  348. as_SizePosition : Byte; { See below }
  349. as_RelativeLeft : WORD; { Window position offset }
  350. as_RelativeTop : WORD;
  351. as_RelativeWidth : Byte; { Window size factor; this is
  352. * a percentage of the parent
  353. * window/screen width.
  354. }
  355. as_RelativeHeight : Byte;
  356. end;
  357. const
  358. { Default position of the ASL window. }
  359. ASLPOS_DefaultPosition = 0; { Position is calculated according to the builtin rules. }
  360. ASLPOS_CenterWindow = 1; { Centred within the bounds of the parent window. }
  361. ASLPOS_CenterScreen = 2; { Centred within the bounds of the parent screen. }
  362. ASLPOS_WindowPosition = 3; { Relative to the top left corner of the parent window,
  363. * using the offset values provided in the
  364. * as_RelativeLeft/as_RelativeTop members.
  365. }
  366. ASLPOS_ScreenPosition = 4; { Relative to the top left corner of the parent screen,
  367. * using the offset values provided in the
  368. * as_RelativeLeft/as_RelativeTop members.
  369. }
  370. ASLPOS_CenterMouse = 5; { Directly below the mouse pointer. }
  371. ASLPOS_MASK = $0F;
  372. { Default size of the ASL window. }
  373. ASLSIZE_DefaultSize = (0 shl 4); { Size is calculated according to the builtin rules. }
  374. ASLSIZE_RelativeSize = (1 shl 4); { Size is relative to the size of the parent
  375. * window or screen, using the values provided in
  376. * the as_RelativeWidth/as_RelativeHeight members.
  377. * The as_RelativeWidth/as_RelativeHeight values are
  378. * taken as percentage, i.e. a value of "50" stands for
  379. * 50% of the width/height of the parent window/screen.
  380. }
  381. ASLSIZE_MASK = $30;
  382. { Other options. }
  383. ASLOPTION_ASLOverrides = (1 shl 6); { ASL determines placement and size of requester
  384. * windows; application's choice is ignored.
  385. }
  386. {****************************************************************************
  387. *
  388. * Obsolete ASL definitions, here for source code compatibility only.
  389. * Please do NOT use in new code.
  390. *
  391. * define ASL_V38_NAMES_ONLY to remove these older names
  392. }
  393. {$define ASL_V38_NAMES_ONLY}
  394. {$ifndef ASL_V38_NAMES_ONLY}
  395. const
  396. ASL_Dummy = (TAG_USER + $80000);
  397. ASL_Hail = ASL_Dummy+1 ;
  398. ASL_Window = ASL_Dummy+2 ;
  399. ASL_LeftEdge = ASL_Dummy+3 ;
  400. ASL_TopEdge = ASL_Dummy+4 ;
  401. ASL_Width = ASL_Dummy+5 ;
  402. ASL_Height = ASL_Dummy+6 ;
  403. ASL_HookFunc = ASL_Dummy+7 ;
  404. ASL_File = ASL_Dummy+8 ;
  405. ASL_Dir = ASL_Dummy+9 ;
  406. ASL_FontName = ASL_Dummy+10;
  407. ASL_FontHeight = ASL_Dummy+11;
  408. ASL_FontStyles = ASL_Dummy+12;
  409. ASL_FontFlags = ASL_Dummy+13;
  410. ASL_FrontPen = ASL_Dummy+14;
  411. ASL_BackPen = ASL_Dummy+15;
  412. ASL_MinHeight = ASL_Dummy+16;
  413. ASL_MaxHeight = ASL_Dummy+17;
  414. ASL_OKText = ASL_Dummy+18;
  415. ASL_CancelText = ASL_Dummy+19;
  416. ASL_FuncFlags = ASL_Dummy+20;
  417. ASL_ModeList = ASL_Dummy+21;
  418. ASL_ExtFlags1 = ASL_Dummy+22;
  419. ASL_Pattern = ASL_FontName;
  420. { remember what I said up there? Do not use these anymore! }
  421. FILB_DOWILDFUNC = 7;
  422. FILB_DOMSGFUNC = 6;
  423. FILB_SAVE = 5;
  424. FILB_NEWIDCMP = 4;
  425. FILB_MULTISELECT = 3;
  426. FILB_PATGAD = 0;
  427. FILF_DOWILDFUNC = 128;
  428. FILF_DOMSGFUNC = 64;
  429. FILF_SAVE = 32;
  430. FILF_NEWIDCMP = 16;
  431. FILF_MULTISELECT = 8;
  432. FILF_PATGAD = 1;
  433. FIL1B_NOFILES = 0;
  434. FIL1B_MATCHDIRS = 1;
  435. FIL1F_NOFILES = 1;
  436. FIL1F_MATCHDIRS = 2;
  437. FONB_FRONTCOLOR = 0;
  438. FONB_BACKCOLOR = 1;
  439. FONB_STYLES = 2;
  440. FONB_DRAWMODE = 3;
  441. FONB_FIXEDWIDTH = 4;
  442. FONB_NEWIDCMP = 5;
  443. FONB_DOMSGFUNC = 6;
  444. FONB_DOWILDFUNC = 7;
  445. FONF_FRONTCOLOR = 1;
  446. FONF_BACKCOLOR = 2;
  447. FONF_STYLES = 4;
  448. FONF_DRAWMODE = 8;
  449. FONF_FIXEDWIDTH = 16;
  450. FONF_NEWIDCMP = 32;
  451. FONF_DOMSGFUNC = 64;
  452. FONF_DOWILDFUNC = 128;
  453. {$endif ASL_V38_NAMES_ONLY}
  454. var
  455. AslBase : pLibrary;
  456. function AllocFileRequest : pFileRequester;
  457. SysCall AslBase 030;
  458. procedure FreeFileRequest(fileReq : pFileRequester location 'a0');
  459. SysCall AslBase 036;
  460. function RequestFile(fileReq : pFileRequester location 'a0'): Boolean;
  461. SysCall AslBase 042;
  462. function AllocAslRequest(reqType: Cardinal location 'd0';
  463. tagList: pTagItem location 'a0'): Pointer;
  464. SysCall AslBase 048;
  465. procedure FreeAslRequest(requester: Pointer location 'a0');
  466. SysCall AslBase 054;
  467. function AslRequest(requester: Pointer location 'a0';
  468. tagList : pTagItem location 'a1'): Boolean;
  469. SysCall AslBase 060;
  470. procedure AbortAslRequest(requester: Pointer location 'a0');
  471. SysCall AslBase 078;
  472. procedure ActivateAslRequest(requester : Pointer location 'a0');
  473. SysCall AslBase 084;
  474. function AllocAslRequestTags(reqType: Cardinal;
  475. tagList: array of DWord): Pointer; Inline;
  476. function AslRequestTags(requester: Pointer;
  477. tagList : array of DWord): Boolean; Inline;
  478. function InitAslLibrary : boolean;
  479. implementation
  480. function AllocAslRequestTags(reqType: Cardinal;
  481. tagList: array of DWord): Pointer; Inline;
  482. begin
  483. AllocAslRequestTags:=AllocAslRequest(reqType,@tagList);
  484. end;
  485. function AslRequestTags(requester: Pointer;
  486. tagList : array of DWord): Boolean; Inline;
  487. begin
  488. AslRequestTags:=AslRequest(requester,@tagList);
  489. end;
  490. const
  491. { Change VERSION and LIBVERSION to proper values }
  492. VERSION : string[2] = '0';
  493. LIBVERSION : longword = 0;
  494. var
  495. asl_exit: Pointer;
  496. procedure CloseAslLibrary;
  497. begin
  498. ExitProc := asl_exit;
  499. if AslBase <> nil then begin
  500. CloseLibrary(PLibrary(AslBase));
  501. AslBase := nil;
  502. end;
  503. end;
  504. function InitAslLibrary : boolean;
  505. begin
  506. AslBase := nil;
  507. AslBase := OpenLibrary(ASLNAME,LIBVERSION);
  508. if AslBase <> nil then begin
  509. asl_exit := ExitProc;
  510. ExitProc := @CloseAslLibrary;
  511. InitAslLibrary:=True;
  512. end else begin
  513. InitAslLibrary:=False;
  514. end;
  515. end;
  516. end. (* UNIT ASL *)
  517. {
  518. $Log$
  519. Revision 1.1 2005-01-30 18:58:23 karoly
  520. * initial revision
  521. }