home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / utilities / utilst / wimpext / Manual next >
Text File  |  1993-08-16  |  87KB  |  2,347 lines

  1.                       ________________________________
  2.  
  3.                       WimpExtension 2.18 (16-Aug-1993)
  4.                       ________________________________
  5.  
  6.  
  7.                      (c) Jon Ribbens of DoggySoft, 1993
  8.  
  9.  
  10. Licence
  11. =======
  12.  
  13.  
  14. You can give copies of WimpExtension, with or without the accompanying
  15. documentation and example application, to anybody you like, as long as you
  16. don't make any money out of doing so. You can, however, include WimpExtension
  17. with other commercial products. ie: You can sell a program which uses
  18. WimpExtension, and include WimpExtension with it, but you can't sell
  19. WimpExtension on its own.
  20.  
  21. There is no warranty at all, express or implied or whatever. If anything goes
  22. wrong, don't blame me. I will, however, try to fix any problems you find.
  23.  
  24.  
  25. NB  If you find any bugs in WimpExtension, or you think I should include some
  26. --  extra feature, don't just sit there muttering to yourself, TELL me about
  27.     it.
  28.  
  29.  
  30.  
  31. Introduction
  32. ============
  33.  
  34. WimpExtension is designed to make the task of programming the Wimp easier. It
  35. also enables you to use 3D icons (like Impression). It is designed to enable
  36. you, when you are writing your programs, to think less 'It's a Desktop
  37. program' and more 'It's a program to do ...'. It has been written over a
  38. period of more than a year, reaching over twelve thousand lines of source
  39. code, hopefully carefully designed to be as easy to use as possible.
  40.  
  41. You use WimpExtension by a set of SWI (BASIC's SYS) commands. There are calls
  42. to put icons on the iconbar, to change the pointer shape, to pop icons in and
  43. out, link windows so they move about together (for toolboxes and
  44. windows-in-windows), there are facilities for options window handling, for
  45. dialogue boxes, for controlling indirected icons, for loading templates, for
  46. colour menus, for RAM templates, for dragging icons, for menu handling, for
  47. draw-files and sprites, for immediate windows, for memory management, etc.,
  48. etc.
  49.  
  50. This manual explains all the features of WimpExtension, and how to use them.
  51. For a quick overview of the SWI calls read the file 'SWIs'.
  52.  
  53. There is an accompanying example application, ExtDemo, which should be
  54. included with the WimpExtension module. This shows off some of the features
  55. of WimpExtension. It is written in BASIC so that you can see how it works.
  56.  
  57.  
  58.  
  59. General points
  60. ==============
  61.  
  62. * WimpExtension needs to know which task is calling it. It is told when you
  63.   call WimpExt_Initialise or WimpExt_Action, but calls to Wimp_Poll may
  64.   change it (as other tasks call it). If you have not called
  65.   WimpExt_Initialise or WimpExt_Action since the last Wimp_Poll therefore,
  66.   you should call WimpExt_CurrentTask to tell WimpExtension your task handle.
  67. * In general, all strings are control-terminated, ie. they may not contain
  68.   any characters less than 32, which are treated as terminators.
  69. * Some features of WimpExtension are controlled by the validation strings of
  70.   icons. To have a validation string, the icon must be indirected text (plus
  71.   sprite if you want). (If you don't want text, make it text, just don't put
  72.   any text in it.) Validation commands are separated by semicolons; you can
  73.   put as many as you want on a single icon. You shouldn't use the same
  74.   command twice, unless you are specifically told you can. (The behaviour is
  75.   undefined if you do - ie. different versions of WimpExtension may do
  76.   different things.)
  77. * Since it claims workspace for tasks it knows about, WimpExtension MUST know
  78.   when a task closes down. You should therefore, always call
  79.   WimpExt_CloseDown before your task exits. To catch any unavoidable slips
  80.   (eg. Address Exceptions in BASIC) WimpExtension initialises a module task
  81.   which will call WimpExt_CloseDown for any tasks that exit. You must not
  82.   rely on this, though.
  83. * All SWIs corrupt R0, even if they are not using it to return a result.
  84. * Because WimpExtension provides more than 64 SWIs, another module called
  85.   'WimpExtShadow' appears in the module list. This is perfectly normal and
  86.   should be ignored.
  87.  
  88.  
  89.  
  90. Essential SWIs
  91. ==============
  92.  
  93. These are SWIs you MUST call if you are going to use ANY of the features of
  94. WimpExtension.
  95.  
  96.  
  97. WimpExt_Initialise       &45780
  98. -------------------------------
  99. R0 = 16
  100. R1 = task handle
  101. R2 = features flags
  102.        bit     meaning
  103.        0       semi-automatic slabbing if set, automatic otherwise
  104.        1       automatically recreate menus if set
  105.        2       task wants to use font menus if set
  106.        3       automatically compact heap once a second if set
  107.        4       'correct' radio icons if set
  108.        5       semi-automatic help if set, automatic otherwise
  109.        6       use alternative parameters for flag-setting SWIs if set
  110.        7       use R0 of WimpExt_SetIconString[N]
  111.        8       automatically call WimpExt_MoveCaret
  112.        9       Unset other icons in ESG when setting icons
  113.        10      Automatically call WimpExt_ViewIcon after moving caret
  114.        11      Don't allow TAB for moving between writeable icons
  115.        12-31   reserved; MUST BE 0
  116. Exit:
  117. R0 = WimpExt version number * 100
  118. R2 = pointer to WimpExt's sprite pool
  119.  
  120. Must be called prior to using any other WimpExt calls. R0 must be 11 on
  121. entry. This is so that WimpExtension can work out what version the program
  122. thinks it is calling (so I can change the functionality of calls later whilst
  123. still retaining backwards-compatibility). R2 holds features flags, for
  124. specifying certain things at start-up. If bit 1 of R2 is set then if the user
  125. selects a menu option with the ADJUST button then the menu will automatically
  126. be recreated when you next call WimpExt_PrePoll (assuming you used
  127. 'WimpExt_CreateMenu' to create the menu, that is). If bit 2 of R2 is set then
  128. you are allowed to call WimpExt_GetFontMenu and WimpExt_DecodeFontMenu - you
  129. are NOT allowed to call them if you do not set bit 2. If bit 4 of R2 is set
  130. then the user won't be able to deselect all of a group of radio icons by
  131. clicking adjust on the selected icon.
  132.  
  133.  
  134. WimpExt_CloseDown        &45781
  135. -------------------------------
  136. R0 = task handle
  137.  
  138. Must be called prior to the task exiting.
  139.  
  140.  
  141. WimpExt_PrePoll          &457B4
  142. -------------------------------
  143.  
  144. To be called immediately before Wimp_Poll or Wimp_PollIdle.
  145.  
  146.  
  147. WimpExt_Action           &45784
  148. -------------------------------
  149. R0 = task handle
  150. R1 = Wimp_Poll block
  151. R2 = Wimp_Poll reason code
  152. Exit:
  153. R0 = Wimp_Poll reason code (possibly altered)
  154.  
  155. To be called immediately after Wimp_Poll. WimpExtension may alter the code
  156. returned - eg. if the user clicks in a requester window then the code will
  157. be translated before your program gets to see it.
  158.  
  159.  
  160. The general structure of your program, therefore, will be:
  161.  
  162.     SYS "Wimp_Initialise"...
  163.     SYS "WimpExt_Initialise"...
  164.     WHILE NOT quit%
  165.       SYS "WimpExt_PrePoll"
  166.       SYS "Wimp_Poll"...
  167.       SYS "WimpExt_Action"...
  168.     ENDWHILE
  169.     SYS "WimpExt_CloseDown"...
  170.     SYS "Wimp_CloseDown"...
  171.     END
  172.  
  173.  
  174.  
  175. 3D icons and window redraws
  176. ===========================
  177.  
  178. 3D borders are treated as user graphics, so the 'auto-redraw' flag in the
  179. window definition should not be set. 3D borders are controlled by the 'w'
  180. validation command:
  181.  
  182.   'w' (border type)
  183.     Syntax:
  184.       w<border number>,<slabbing mask>,<slabbing time>,<top left colour>,
  185.        <bottom right colour>,<popped in colour>,<popped out colour>,
  186.        <channel colour>
  187.  
  188. All the numbers apart from the border number are optional. The defaults are:
  189. wxx,4,15,4,0,1,14,12. These defaults can be changed by the user, using the
  190. command 'WimpExt Defaults' - see below. You can specify only some, eg:
  191. w2,4,20 or w2,,,,3. The border numbers are:
  192.  
  193.      0  : Standard 3D border. Used for headings and buttons. Pops in if
  194.           clicked on.
  195.      1  : Ridged grouping border. Put it around things of a similar nature.
  196.      2  : Like 0, with a channel round it. Used for the default button (ie.
  197.           the one that is pressed if you press RETURN).
  198.      3  : Wide border for writeable icons - leave the normal black border on
  199.           the icon and make the background white.
  200.      4  : Popped in border - for things that are for information only.
  201.      5  : Trenched border - the opposite of border 1. Can be clicked on.
  202.           Suggested use is as an alternate border 1.
  203.      6  : Title border - similar to border 0, but with two 'dents'.
  204.           This border is designed to be used as the title of a group, with
  205.           a border 1 icon behind it as the frame - see ExtDemo for examples.
  206.  
  207. If you add 8 to the border number, it will become inert - ie. it will ignore
  208. all mouse clicks and not pop in. Bordered icons should be filled if you want
  209. them to change colour when clicked on (which is definitely recommended), and
  210. you should initially set the background colour of the icon to the out-colour.
  211.  
  212. Anti-aliased font icons are now supported. The icon MUST have an 'F'
  213. validation command, as the Wimp needs this to specify the icon's colour. Note
  214. that slabbing font icons doesn't look very good in 16-colour modes, due to
  215. anti-aliasing (this isn't WimpExtension's fault, it's just a fact of life).
  216.  
  217. If you set the in-colour and out-colour the same then the icon won't ever be
  218. slabbed in or out. If you really really want an icon which doesn't change
  219. colour when slabbed in and out unset the 'Filled' flag. I don't recommend
  220. having icons which don't change colour, anyway - they look awful.
  221.  
  222. Note that when WimpExtension redraws border type 6, if the icon is filled (as
  223. it should be using this border) then WimpExtension fills the icon at the same
  224. time. This means that you only very very briefly see the ridged border behind
  225. it.
  226.  
  227.  
  228. WimpExt_SlabIcon         &45782
  229. -------------------------------
  230. R2 = window handle or 0 for slabbed icon
  231. R3 = icon handle
  232. If semi-automatic slabbing is enabled, then:
  233. R4 = 0 to pop out, any other to pop in
  234.  
  235. To be called to force an icon to be slabbed (for example to slab the default
  236. action icon if RETURN is pressed). If semi-automatic slabbing is enabled then
  237. the icon will be popped in or out depending on R4, otherwise it will be
  238. popped in and then out again. If R2 is zero then the last icon to be slabbed
  239. in (either implicity or explicity) is used. Note that in this case the SWI
  240. might return an error (eg. if the window has been deleted), so use the X form
  241. if the SWI.
  242.  
  243.  
  244. WimpExt_Redraw           &45783
  245. -------------------------------
  246. R1 = Wimp_RedrawWindow block
  247.  
  248. To be called in the window redraw loop, to draw the 3D borders round icons.
  249.  
  250.  
  251. If you use 3D borders, you MUST call WimpExt_Redraw, or they won't appear.
  252. Your redraw loop would probably look something like:
  253.  
  254.     SYS "Wimp_RedrawWindow",,q% TO flag%
  255.     WHILE flag%
  256.       SYS "WimpExt_Redraw",,q%
  257.       ...
  258.       SYS "Wimp_GetRectangle",,q% TO flag%
  259.     ENDWHILE
  260.  
  261.  
  262. WimpExt_AutoRedraw       &45798
  263. -------------------------------
  264. R1 = Wimp_Poll reason code 1 block
  265.  
  266. This call can be used instead of the normal Wimp_RedrawWindow/GetRectangle
  267. loop if the window doesn't contain any graphics drawn by your program. It
  268. does the equivalent of:
  269.  
  270.     SYS "Wimp_RedrawWindow",,q% TO flag%
  271.     WHILE flag%
  272.       SYS "WimpExt_Redraw",,q%
  273.       SYS "Wimp_GetRectangle",,q% TO flag%
  274.     ENDWHILE
  275.  
  276.  
  277.  
  278. Iconbar sprites
  279. ===============
  280.  
  281. Two SWIs are provided for putting icons on the iconbar - one for sprites
  282. only, and one for text-plus-sprite icons. These read the size of the sprite
  283. to get the width of the icon.
  284.  
  285.  
  286. WimpExt_IconBarSprite    &45785
  287. -------------------------------
  288. R2 = -2 for left of iconbar, -1 for right
  289. R3 = pointer to sprite name
  290. R5 = icon button type (eg. 3)
  291. Exit:
  292. R0 = icon handle
  293.  
  294. Will place a sprite on the iconbar, returning the icon handle. Note that the
  295. sprite name is copied out of the memory block, which can be reused. Also note
  296. that the number in R5 is just the button type, not the flags.
  297.  
  298.  
  299. WimpExt_IconBarText      &45786
  300. -------------------------------
  301. R2 = -2 for left of iconbar, -1 for right
  302. R3 = pointer to sprite name
  303. R4 = pointer to text (max. 128 chars inc. terminator)
  304. R5 = icon button type (eg. 3)
  305. Exit:
  306. R0 = icon handle
  307.  
  308. Will place a sprite on the iconbar, with a text message underneath, returning
  309. the icon handle. Note that the sprite name is copied out of the memory block,
  310. which can be reused, but the text remains where it is; this is so you can
  311. change the text after creating the icon. Also note that the number in R5 is
  312. just the button type, not the flags.
  313.  
  314.  
  315.  
  316. Linked windows
  317. ==============
  318.  
  319. Linked windows are good for option setting and lists of things. They consist
  320. of a main window, which is normal, and a subwindow, which moves around with
  321. the main window. The subwindow normally has no titlebar and no horizontal
  322. scrollbar, just the vertical scrollbar, although this is a matter of style.
  323. To have more than one subwindow in a main window you should link the
  324. subwindows together. eg:
  325.   SYS "WimpExt_LinkWindows",,,mainw%,link1w%,0
  326.   SYS "WimpExt_LinkWindows",,,link1w%,link2w%,0
  327.   SYS "WimpExt_LinkWindows",,,link2w%,link3w%,0
  328.   ...
  329.  
  330. WimpExtension makes linked windows very easy - to set up a linked window,
  331. just use SWI WimpExt_LinkWindows, and use WimpExt_OpenLinked and
  332. WimpExt_CloseLinked instead of Wimp_OpenWindow and Wimp_CloseWindow.
  333.  
  334.  
  335. WimpExt_LinkWindows      &45787
  336. -------------------------------
  337. R2 = main window handle
  338. R3 = sub-window handle
  339. R4 = flags
  340.      bit    meaning
  341.      0      clip linked window to the left of the main window
  342.      1      clip linked window to the right of the main window
  343.      2      clip linked window above the main window
  344.      3      clip linked window below the main window
  345.      4-30   reserved; MUST BE 0
  346.      31     link is hidden
  347.  
  348. Will link two windows so the sub-window moves with the main window. Currently
  349. there is a limit of 16 linked windows - this may be removed in a later
  350. version.
  351.  
  352.  
  353. WimpExt_OpenLinked       &45788
  354. -------------------------------
  355. R1 = Wimp_OpenWindow block
  356.  
  357. To be used instead of Wimp_OpenWindow. It does the same thing, but if the
  358. window is linked then it will handle the link. If the window is not linked,
  359. it has the same effect as Wimp_OpenWindow.
  360.  
  361.  
  362. WimpExt_CloseLinked      &45789
  363. -------------------------------
  364. R1 = Wimp_CloseWindow block
  365.  
  366. To be used instead of Wimp_CloseWindow. It does the same thing, but if the
  367. window is linked then it will close the linked window as well. If the window
  368. is not linked, it has the same effect as Wimp_CloseWindow.
  369.  
  370.  
  371. WimpExt_UnLinkWindows    &4578A
  372. -------------------------------
  373. R2 = main window handle
  374. R3 = sub-window handle
  375.  
  376. Will remove the link between the specified window and its subwindow. Note
  377. that this just removes the pointer in WimpExtension workspace, if the windows
  378. are on the screen they will remain there. You do not have to call
  379. UnLinkWindows before you exit - it is here so that you can unlink windows
  380. while your application is still running.
  381.  
  382.  
  383. WimpExt_HideLink         &457A8
  384. -------------------------------
  385. R0 = main window handle
  386. R2 = sub-window handle
  387.  
  388. Temporarily hides the link between the specified window and its sub-window.
  389. This is useful, for example, for removing toolboxes in such a way that they
  390. can be replaced later. Note that this call does no screen update - ie. the
  391. sub-window remains where it is.
  392.  
  393.  
  394. WimpExt_UnHideLink       &457A9
  395. -------------------------------
  396. R0 = main window handle
  397. R2 = sub-window handle
  398.  
  399. Unhides the previously hidden link. Note that this call does no screen
  400. update - ie. the sub-window remains where it is.
  401.  
  402.  
  403. WimpExt_ManualLink       &46389
  404. -------------------------------
  405. R2 = main window handle
  406. R3 = sub-window handle
  407. R4 = flags
  408.      bit    meaning
  409.      0      clip linked window to the left of the main window
  410.      1      clip linked window to the right of the main window
  411.      2      clip linked window above the main window
  412.      3      clip linked window below the main window
  413.      4-30   reserved; MUST BE 0
  414.      31     link is hidden
  415. R5 = X offset between main and sub-window
  416. R6 = Y offset between main and sub-window
  417.  
  418. Will link two windows so the sub-window moves with the main window. Currently
  419. there is a limit of 16 linked windows - this may be removed in a later
  420. version.
  421.  
  422.  
  423.  
  424. Templates
  425. =========
  426.  
  427. Using templates usually is quite tedious, as you have to open the template
  428. file and read in the definitions for each window individually, calling
  429. Wimp_CreateWindow for each one and storing the window handle. Using
  430. WimpExtension you just call WimpExt_LoadTemplates and all the windows in the
  431. named file will be loaded and created, and the handles stored in a buffer.
  432. The only time you cannot do this is if you have more than one window that you
  433. want to open multiple copies of. If you have no such windows, you're OK, if
  434. you want one such window then you simply make sure it's the last window in
  435. the templates file, and its definition will be in the buffer after the SWI
  436. call.
  437.  
  438. Note that by using this call your program is dependent on the order of the
  439. templates in the file. This shouldn't matter, as when you make the templates
  440. file you know what order you've got them in, and nobody else has any business
  441. changing your templates file.
  442.  
  443.  
  444. WimpExt_LoadTemplates    &4578C
  445. -------------------------------
  446. R0 = pointer to buffer for storing window handles
  447. R1 = pointer to user buffer for template (big enough for largest template)
  448. R2 = pointer to workspace for indirected icons
  449. R3 = pointer to end of workspace for indirected icons
  450. R4 = 256-byte font reference array (-1 for no fonts)
  451. R5 = pointer to filename of templates file
  452. R6 = pointer to sprite area control block (+1 for Wimp sprite pool)
  453.  
  454. Loads in all the templates from the file whose name is pointed to by R5, and
  455. called Wimp_CreateWindow for each one. The value in R6 is placed in the
  456. window block at offset +64. Stores the window handles sequentially in the
  457. buffer pointed to by R0, in the order they are found in the templates file.
  458. On exit the buffer pointed to by R1 will contain the template for the last
  459. window in the file. The buffer for window handles should be big enough to
  460. store all the window handles, each of which is a word. For each window, if
  461. the word on entry is zero the window will be created as usual. Bits that are
  462. set have the following meanings:
  463.  
  464.     Bit   Meaning if set
  465.     ----------------------------------------------
  466.     0     centre window horizontally
  467.     1     don't create window
  468.     2     centre window vertically
  469.  
  470. Bit 1 is useful if you have the last window in the file as one that you want
  471. repeatedly, but you don't want it created at once.
  472.  
  473.  
  474. Another SWI is provided for RAM templates. This is provided mainly for module
  475. tasks, where the templates must be part of the main code. You can use the
  476. supplied BASIC function 'FNtemplate' to include the template as part of your
  477. code, and then use WimpExt_LoadRAMTemplate to turn this into a window
  478. definition.
  479.  
  480.  
  481. WimpExt_LoadRAMTemplate  &457A5
  482. -------------------------------
  483. R1 = pointer to user buffer for window definition
  484. R2 = pointer to workspace for indirected icons
  485. R3 = pointer to end of workspace for indirected icons
  486. R4 = -1 for no fonts - fonts not supported at present
  487. R5 = pointer to template
  488. Exit:
  489. R2 = pointer to end of workspace used (ie. first free byte)
  490.  
  491. This call is similar to Wimp_LoadTemplate except that it uses templates in
  492. RAM. This is designed to be used in Module tasks, where you cannot have a
  493. separate Templates file. You would use the supplied 'FNtemplate' function to
  494. insert the template in your module, and then call WimpExt_LoadRAMTemplate to
  495. convert this to a window definition. At present fonts in templates are not
  496. supported - this shouldn't cause too much of a problem as I have never seen
  497. a program which uses this feature anyway.
  498.  
  499.  
  500.  
  501. Icon handling
  502. =============
  503.  
  504. Lots of SWIs are provided for handling icons, eg. setting the string in a
  505. text icon, shading icons, reading a number from an icon, etc...
  506.  
  507.  
  508. WimpExt_SetIconString    &4578D
  509. -------------------------------
  510. R0 = non-zero for ellipsis (only if enabled in WimpExt_Initialise)
  511. R2 = window handle
  512. R3 = icon handle
  513. R4 = pointer to string
  514.  
  515. Copies the string pointed to by R2 into the specified indirected text icon,
  516. and updates the screen if necessary. If the caret was in the icon then it is
  517. moved to the end of the new string. Only updates the screen if anything was
  518. changed - ie. if the new string is the same as the old string then nothing
  519. will happen. If R0 is non-zero and bit 7 was set in R2 in WimpExt_Initialise
  520. and the string is longer than the icon can hold then the string will be
  521. post-fixed with '...'.
  522.  
  523.  
  524. WimpExt_SetIcon          &4578F
  525. -------------------------------
  526. R2 = window handle
  527. R3 = icon handle
  528. R4 = 0 to deselect icon, non-zero to select icon
  529. If bit 6 of R2 was set in WimpExt_Initialise:
  530. R4 = 0 to deselect icon, 1 to select icon, 2 to toggle icon
  531. Exit:
  532. R0 = old state of icon (0 for unset, 1 for set)
  533.  
  534. Selects the icon if R4 is non-zero, deselects it otherwise. Updates the
  535. screen if necessary. If bit 6 of R2 was set in WimpExt_Initialise then the
  536. alternative parameters are used as shown. If bit 9 of R2 was set in
  537. WimpExt_Initialise and you are setting the icon, then other icons in the same
  538. ESG will be unset.
  539.  
  540.  
  541. WimpExt_GetIcon          &45790
  542. -------------------------------
  543. R2 = window handle
  544. R3 = icon handle
  545. Exit:
  546. R0 = 0 if icon is not selected, 1 if it is selected
  547. R3 = word at iconblock+20 (ie. pointer to indirected text for indirected text
  548.      icon)
  549.  
  550. Detects whether the icon is selected, and returns 1 in R0 if it is, 0
  551. otherwise. Also returns in R1 then value in the iconblock at offset 20. For
  552. an indirected text icon this will be a pointer to the text.
  553.  
  554.  
  555. WimpExt_SetNumberIcon    &45791
  556. -------------------------------
  557. R0 = base
  558. R2 = window handle
  559. R3 = icon handle
  560. R4 = value
  561.  
  562. Converts the signed integer in R4 into a string and places it in the icon.
  563. Updates the screen as necessary. The base to be used is specified in R0 - it
  564. must be in the range 2-36.
  565.  
  566.  
  567. WimpExt_GetNumberIcon    &45792
  568. -------------------------------
  569. R0 = default base
  570. R2 = window handle
  571. R3 = icon handle
  572. Exit:
  573. R0 = value
  574.  
  575. Converts the string in the icon to a signed integer and places it in R0. The
  576. base to be used by default is specified in R0 - it must be in the range 2-36.
  577.  
  578.  
  579. WimpExt_IncNumberIcon    &45793
  580. -------------------------------
  581. R0 = base
  582. R2 = window handle
  583. R3 = icon handle
  584. R4 = maximum value
  585. R5 = step
  586. Exit:
  587. R0 = new value
  588.  
  589. Converts the string in the icon to an signed integer, adds the step, and puts
  590. it back. Updates the screen as necessary. The value will not go beyond the
  591. value passed in R4, and the new value is returned in R0.
  592.  
  593.  
  594. WimpExt_DecNumberIcon    &45794
  595. -------------------------------
  596. R0 = base
  597. R2 = window handle
  598. R3 = icon handle
  599. R4 = minimum value
  600. R5 = step
  601. Exit:
  602. R0 = new value
  603.  
  604. Converts the string in the icon to an signed integer, subtracts the step, and
  605. puts it back. Updates the screen as necessary. The value will not go beyond
  606. the value passed in R4, and the new value is returned in R0.
  607.  
  608.  
  609. WimpExt_SetIconStringN   &457A0
  610. -------------------------------
  611. R0 = non-zero for ellipsis (only if enabled in WimpExt_Initialise)
  612. R2 = window handle
  613. R3 = icon handle
  614. R4 = pointer to string
  615.  
  616. Copies the string pointed to by R2 into the specified indirected text icon,
  617. and updates the screen if necessary. If the string is longer than the size of
  618. the buffer then the right-hand end of the string is copied (as opposed to the
  619. left-hand end, which is the case if you use WimpExt_SetIconString). If the
  620. caret was in the icon then it is moved to the end of the new string. If R0 is
  621. non-zero and bit 7 was set in R2 in WimpExt_Initialise and the string is
  622. longer than the icon can hold then the string will be pre-fixed with '...'.
  623.  
  624.  
  625. WimpExt_SetIconColour    &457B0
  626. -------------------------------
  627. R2 = window handle
  628. R3 = icon handle
  629. R4 = foreground colour (0-15 or -1 to keep the same)
  630. R5 = background colour (0-15 or -1 to keep the same)
  631. Exit:
  632. R0 = old foreground colour + old background colour * 16
  633.  
  634. Changes the specified icon's colour(s). If there is no change then the icon
  635. is not updated (ie. it doesn't flicker). This call will now work for anti-
  636. aliased fonts, but the icon MUST have an 'F' validation command, as the Wimp
  637. needs this to specify the icon's colour.
  638.  
  639.  
  640. WimpExt_ShadeIcon        &457B1
  641. -------------------------------
  642. R2 = window handle
  643. R3 = icon handle
  644. R4 = 0 to unshade icon, non-zero to shade icon
  645. If bit 6 of R2 was set in WimpExt_Initialise:
  646. R4 = 0 to unshade icon, 1 to shade icon, 2 to toggle shade flag
  647. Exit:
  648. R0 = old state of icon (0 for unshaded, 1 for shaded)
  649.  
  650. Shades the icon if R2 is non-zero, unshades it otherwise. Updates the screen
  651. if necessary. If the caret was in the icon and you are telling WimpExtension
  652. to shade it then the caret is removed (disowned). If bit 6 of R2 was set in
  653. WimpExt_Initialise then the alternative parameters are used as shown.
  654.  
  655.  
  656. WimpExt_ViewIcon         &4638B
  657. -------------------------------
  658. R0 = movement type:
  659.      0 = scroll window minimum amount necessary
  660.      1 = centre icon in window (only if it's currently outside the window)
  661.      2 = choose 0 or 1 depending on how far outside the window the icon is
  662. R2 = window handle (or -1 for caret window and icon)
  663. R3 = icon handle (if R2<>-1)
  664.  
  665. Checks to see if the specified icon is in the portion of the window which is
  666. visible on the screen, and scrolls the window to display it if it isn't. If
  667. R2=-1 then the icon containing the caret (if if belongs to your task) is
  668. used. R0=2 is the recommended movement type to use.
  669.  
  670.  
  671.  
  672. Pointer handling
  673. ================
  674.  
  675. Pointer changes over icons are controlled by the 'wp' validation command.
  676.  
  677.    'wp' (change pointer)
  678.      Syntax:
  679.        wp<pointer name>,<x hotspot>,<y hotspot>
  680.  
  681. The x and y hotspots are optional. What happens is that when the pointer is
  682. over the icon it will changed to the named sprite. The 'hotspot' is the area
  683. that is the actual 'point' of the pointer. Apart from the following supplied
  684. standard pointers, the sprite must be in the Wimp sprite pool.
  685.  
  686. Standard supplied pointers are:
  687.  
  688.        ptr_write    (4,4)
  689.         should be used over writeable icons
  690.        ptr_menu     (6,5)
  691.         should be used over icons that lead to menus when clicked with SELECT
  692.        ptr_direct   (12,6)
  693.         should be used for resizing objects
  694.        ptr_hand     (10,9)
  695.         should be used for dragging objects
  696.        ptr_cross    (8,4)
  697.         should be used for accurate pointing
  698.  
  699. All these pointers are stored (with hi-res versions as well) inside the
  700. WimpExtension module itself, so they are always available.
  701.  
  702. Pointer sprites should be designed in mode 8, maximum size 32x32 pixels. You
  703. should be wary of using logical colour 2 in pointer sprites, as it doesn't
  704. work in high-res mono modes. The pointer can have a palette if you want it
  705. to.
  706.  
  707. If you are in a hi-res mode then WimpExtension will try to use a sprite of
  708. name "<pointer>22", and then try "<pointer>" if that didn't work. Therefore
  709. you can supply hi-res pointers as well (they should be in mode 19).
  710.  
  711. The pointer changing is done entirely by the WimpExtension task, so you CAN
  712. disable null events and pointer changing will still work.
  713.  
  714. On RISC OS 3 the 'p' command is attempted by the operating system, so
  715. WimpExtension uses the 'wp' command as RISC OS gets the pointer changing
  716. wrong.
  717.  
  718. There is also a SWI provided so that your program can change the pointer
  719. directly:
  720.  
  721.  
  722. WimpExt_SetPointer       &45795
  723. -------------------------------
  724. R0 = pointer to sprite name in the Wimp sprite pool, or 0 to reset pointer
  725. If R0>0:
  726. R2 = hotspot X
  727. R3 = hotspot Y
  728.  
  729. Stores the old pointer palette, and changes the pointer palette and shape to
  730. the sprite specified in R0 (palette optional). The 'hotspot' is defined by
  731. the X and Y coordinates (pixels) in R2 and R3. If R0 is 0 then it will reset
  732. the pointer to its original state. You don't need to check if the pointer is
  733. already reset or changed as WimpExtension will do this for you. Note that the
  734. pointer will keep changed until you specifically ask for it to be reset - ie.
  735. pointer changes over icons will be suspended, and the pointer will remain
  736. changed outside your window's workarea.
  737.  
  738.  
  739. WimpExt_LimitPointer     &457A2
  740. -------------------------------
  741. R0 = window handle
  742.  
  743. Limits the mouse pointer to the visible area of the window specified. Note
  744. that if there are draggable objects within this area and these are used then
  745. the mouse rectangle is reset. It is also reset if there is a change of mode,
  746. eg. if the user presses F12 and then Return.
  747.  
  748.  
  749. WimpExt_ReleasePointer   &457A3
  750. -------------------------------
  751.  
  752. Releases the limits on the mouse pointer - ie. sets the mouse rectangle to be
  753. the entire screen. Note that this call resets the graphics origin and the
  754. graphics and text windows (ie. it does a 'VDU 26').
  755.  
  756.  
  757.  
  758. Colour menus
  759. ============
  760.  
  761. Colour menus are useful if you want the user to be able to select any WIMP
  762. colour for some reason. WimpExtension will automatically create a colour menu
  763. for you, and will work out whether each menu item should be black or white.
  764.  
  765.  
  766. WimpExt_ColoursMenu      &45797
  767. -------------------------------
  768. R0 = colour to be ticked
  769. R2 = 0 to have just colours, 1 to have extra option
  770. Exit:
  771. R0 = pointer to colour menu
  772.  
  773. Creates a colour menu (like Edit's 'Background' and 'Foreground' ones),
  774. making the text of each option black or white depending on the brightness of
  775. that colour in the current palette. If the value in R0 on entry is in the
  776. range 0-15 then that colour will be ticked in the menu. The call returns a
  777. pointer to the menu block (in RMA workspace). If the value in R2 on entry is
  778. 1 then a 17th option will be added, 'Transparent'. You can change the text of
  779. this by changing the menu block if you want (it's in RMA). The 17th option
  780. will be ticked if R0 on entry is 16.
  781.  
  782.  
  783.  
  784. Window handling
  785. ===============
  786.  
  787.  
  788. WimpExt_CentreWindow     &45799
  789. -------------------------------
  790. R1 = pointer to block:
  791.       R1 +  0   visible area minimum x coordinate
  792.       R1 +  4   visible area minimum y coordinate
  793.       R1 +  8   visible area maximum x coordinate
  794.       R1 + 12   visible area maximum y coordinate
  795.       R1 + 28   window flags
  796. Exit:
  797.       Block contains altered coordinates
  798.  
  799. This call shifts the x coordinates in the supplied block so that the window
  800. described would be centred horizontally on the screen. You can use this call
  801. before Wimp_CreateWindow - eg:
  802.        SYS "WimpExt_CentreWindow",,q%
  803.        SYS "WimpExt_CreateWindow",,q% TO handle%
  804. or you can use it before Wimp_OpenWindow - eg:
  805.        SYS "WimpExt_CentreWindow",,q%+4
  806.        SYS "WimpExt_OpenWindow",,q%
  807. If you are using WimpExt_LoadTemplates then windows can be centred
  808. automatically for you (see description above).
  809.  
  810.  
  811. WimpExt_CentreWindowV    &457BE
  812. -------------------------------
  813. R1 = Pointer to block:
  814.       R1 +  0   visible area minimum x coordinate
  815.       R1 +  4   visible area minimum y coordinate
  816.       R1 +  8   visible area maximum x coordinate
  817.       R1 + 12   visible area maximum y coordinate
  818.       R1 + 28   window flags
  819. Exit:
  820.       Block contains altered coordinates
  821.  
  822. This call shifts the y coordinates in the supplied block so that the window
  823. described would be centred vertically on the screen. You can use this call
  824. before Wimp_CreateWindow - eg:
  825.        SYS "WimpExt_CentreWindowV",,q%
  826.        SYS "WimpExt_CreateWindow",,q% TO handle%
  827. or you can use it before Wimp_OpenWindow - eg:
  828.        SYS "WimpExt_CentreWindowV",,q%+4
  829.        SYS "WimpExt_OpenWindow",,q%
  830. If you are using WimpExt_LoadTemplates then windows can be centred
  831. automatically for you (see description above).
  832.  
  833.  
  834. WimpExt_CheckWindowOpen  &4579D
  835. -------------------------------
  836. R0 = window handle (or -3 for requester window)
  837. Exit:
  838. R0 = 0 if window closed, 1 if open
  839.  
  840. Checks to see if the specified window is open.
  841.  
  842.  
  843. WimpExt_SetWindowTitle   &4579F
  844. -------------------------------
  845. R2 = window handle
  846. R3 = pointer to string
  847.  
  848. Copies the string in R3 into the window whose handle is in R2. The title must
  849. be indirected. Updates the screen if necessary.
  850.  
  851.  
  852. WimpExt_OpenFullSize     &457A4
  853. -------------------------------
  854. R2 = window handle
  855. R3 = window to open behind (-1 = top, -2 = bottom)
  856.  
  857. Opens the window to maximum size - ie. the same as clicking on the toggle
  858. icon.
  859.  
  860.  
  861. WimpExt_SetExtent        &457B5
  862. -------------------------------
  863. R0 = window handle
  864. R1 = pointer to block
  865.      R1+00 = new work area minimum x
  866.      R1+04 = new work area minimum y
  867.      R1+08 = new work area maximum x
  868.      R1+12 = new work area maximum y
  869.  
  870. Sets the work area extent of the specified window, altering the values to be
  871. whole pixels, and reopening the window (if already open) so that the change
  872. is reflected on the screen.
  873.  
  874.  
  875.  
  876. Key handling
  877. ============
  878.  
  879. As it is often needed that RETURN do the same as clicking on the default icon
  880. (the one with border type 2), and also that the up and down arrow keys move
  881. to writeable icons above and below, WimpExtension will handle these keys for
  882. you. Simply include the validation code 'wr' in the writeable icon's
  883. validation string:
  884.  
  885.   'wr'
  886.     Syntax:
  887.       wr[RETURN icon number],[up icon number],[down icon number]
  888.  
  889. The icons specified will be used when the user presses RETURN, up arrow (or
  890. shift-tab) and down arrow (or tab) respectively. If the icon specified is a
  891. writeable icon then the caret will be moved to that icon, otherwise
  892. WimpExtension will generate a fake Mouse_Click event for that icon, which
  893. will make it appear to your task as if the user clicked with button status
  894. %100 on the icon (the mouse coordinates given will be those of the caret).
  895.  
  896. You may leave out any of the numbers in the syntax, if you do so then
  897. WimpExtension will not affect the handling of that key.
  898.  
  899.  
  900. WimpExt_PutCaretIcon     &4579B
  901. -------------------------------
  902. R2 = window handle
  903. R3 = icon handle
  904.  
  905. Works out the length of the text icon specified and calls
  906. Wimp_SetCaretPosition to position the caret at the end of the string.
  907.  
  908.  
  909. WimpExt_MoveCaretIcon    &46384
  910. -------------------------------
  911. R2 = window handle
  912. R3 = icon handle
  913.  
  914. Moves the caret into the specified icon, keeping its vertical position as
  915. nearly unchanged as possible. If the caret is currently disowned then it is
  916. placed at the end of the string in the icon.
  917.  
  918.  
  919. WimpExt_MoveCaret        &457B6
  920. -------------------------------
  921. R0 = key
  922. R2 = window handle
  923. R3 = icon handle
  924. Exit:
  925. R0 preserved if no action taken, 0 otherwise
  926.  
  927. Moves the caret from its current writeable icon to the next one above or
  928. below (in number) if the key in R0 is up arrow (or shift-tab) or down arrow
  929. (or tab). If you set bit 8 of R2 on entry to WimpExt_Initialise then this SWI
  930. will be called automatically for you in WimpExt_Action, and the reason code
  931. translated to a null event if the key is processed.
  932.  
  933.  
  934.  
  935. Radio icons
  936. ===========
  937.  
  938. There are a couple of validation commands for helping with radio icons. 'ws'
  939. allows icons to select and deselect other icons when clicked on, and 'wu'
  940. allows icons to shade and unshade other icons.
  941.  
  942.   'ws'
  943.     Syntax:
  944.       ws<action>,<icon>[,<icon>][,<icon>][,<icon>]...
  945.  
  946. The action code is as follows:
  947.  
  948.   0   deselect specified icons
  949.   1   select specified icons
  950.   2   toggle specified icons
  951.  
  952. The syntax is exactly the same for 'wu' except that the icons will be shaded
  953. instead of selected. You can specify several of these commands in one
  954. validation string - eg. 'ws1,4;ws2,5;ws0,1'.
  955.  
  956.  
  957.  
  958. Menu handling
  959. =============
  960.  
  961.  
  962. WimpExtension can do a couple of helpful things with menus. If you use
  963. WimpExt_CreateMenu instead of Wimp_CreateMenu and you set bit 1 in R2 when
  964. you call WimpExt_Initialise then WimpExtension will automatically recreate
  965. menus when the user clicks Adjust.
  966.  
  967.  
  968. WimpExt_OpenDialogue     &4579C
  969. -------------------------------
  970. R2 = window handle
  971. R3 = X Offset
  972. R4 = Y Offset
  973.  
  974. Opens the specified window using Wimp_CreateMenu at the pointer position,
  975. offset by R3 and R4. The coordinates used are PointerX-R3,PointerY+R4.
  976.  
  977.  
  978. WimpExt_CreateMenu       &457AC
  979. -------------------------------
  980. R1 = pointer to menu structure, or window handle, or -1 to close menus
  981. R2 = menu X
  982. R3 = menu Y
  983.  
  984. Exactly the same as Wimp_CreateMenu, except that the parameters are stored so
  985. that, after you have processed the selection, if the user clicked ADJUST you
  986. can call WimpExt_ReCreateMenu (see below) to reopen the menu, or this can be
  987. done for you (see WimpExt_Initialise).
  988.  
  989.  
  990. WimpExt_ReCreateMenu     &457AD
  991. -------------------------------
  992.  
  993. Reopens the last menu opened with WimpExt_CreateMenu. Generates an error if
  994. the last operation was to close a menu, or if you have not called
  995. WimpExt_CreateMenu yet.
  996.  
  997.  
  998. WimpExt_ShadeEntry       &457AE
  999. -------------------------------
  1000. R1 = pointer to menu structure
  1001. R2 = number of option to shade/unshade (0...nn)
  1002. R3 = 0 to unshade, any other to shade
  1003. If bit 6 of R2 was set in WimpExt_Initialise:
  1004. R3 = 0 to unshade entry, 1 to shade icon, 2 to toggle shade flag
  1005. Exit:
  1006. R0 = old state of menu entry (0 for unshaded, 1 for shaded)
  1007.  
  1008. Shades or unshades the specified menu entry. If bit 6 of R2 was set in
  1009. WimpExt_Initialise then the alternative parameters are used as shown.
  1010.  
  1011.  
  1012. WimpExt_TickEntry        &457AF
  1013. -------------------------------
  1014. R1 = pointer to menu structure
  1015. R2 = number of option to tick/untick (0...nn)
  1016. R3 = 0 to untick, any other to tick
  1017. If bit 6 of R2 was set in WimpExt_Initialise:
  1018. R3 = 0 to untick entry, 1 to tick entry, 2 to toggle tick flag
  1019. Exit:
  1020. R0 = old state of menu entry (0 for unticked, 1 for ticked)
  1021.  
  1022. Ticks or unticks the specified menu entry. If bit 6 of R2 was set in
  1023. WimpExt_Initialise then the alternative parameters are used as shown.
  1024.  
  1025.  
  1026. WimpExt_MenuWidth        &46382
  1027. -------------------------------
  1028. R1 = pointer to menu structure
  1029.  
  1030. This SWI scans through the specified menu, altering its width and the widths
  1031. of all its submenus, so that all the menus are the minimum width possible
  1032. while still displaying the text correctly (and neatly).
  1033.  
  1034.  
  1035.  
  1036. Incrementing and decrementing icons
  1037. ===================================
  1038.  
  1039. If, as is often the case, you have a number in an indirected icon on the
  1040. screen and you want the user to be able to alter it, it is nice to have
  1041. bumper icons next to it as well as making it writeable. For this purpose, you
  1042. can specify that an icon should decrement/increment another icon when clicked
  1043. on in the validation string. The syntax of the command is:
  1044.  
  1045.    'wi' (increment)
  1046.      Syntax:
  1047.        wi<icon>,<minimum>,<maximum>,<step>
  1048.  
  1049. The default values are: wixx,0,&7FFFFFFF,1. All the values are optional apart
  1050. from the icon number. To make it decrement the icon instead, use a negative
  1051. step value. If the user clicks with Adjust instead of Select then the icon
  1052. will be incremented instead of decremented, or decremented instead of
  1053. incremented, in keeping with other RISC OS features.
  1054.  
  1055. See 'icon handling', WimpExt_IncNumberIcon and WimpExt_DecNumberIcon for more
  1056. information.
  1057.  
  1058.  
  1059.  
  1060. Requester windows
  1061. =================
  1062.  
  1063. A requester window has a title message, a text string, and up to four
  1064. buttons. It can be used as a general-purpose way of asking the user for some
  1065. response which must be answered before anything else happens - like the
  1066. Wimp's Wimp_ReportError window, but a lot nicer and more flexible. An
  1067. advantage of the requester windows is that you can specify the text of the
  1068. buttons, what Escape and Return do, and the computer still multitasks while
  1069. the requester is open. (If you don't want a multitasking requester, see
  1070. 'Immediate windows'.)
  1071.  
  1072.  
  1073. WimpExt_OpenRequester    &457A6
  1074. -------------------------------
  1075. R2 = title (eg. 'Message from MyTask')
  1076. R3 = text (eg. 'Document not saved. Save?')
  1077. R4 = pointer to block containing button definitons
  1078.        text for default button    (eg. 'Save')
  1079.        text for button 1          (eg. 'Discard')
  1080.        text for button 2          (eg. 'Cancel')
  1081.        ...
  1082. R5 = button to be used if 'Escape' is pressed (0-3)
  1083.  
  1084. Opens a requester box with a title, a message and some buttons along the
  1085. right-hand edge. The pointer is constrained to the requester window. The
  1086. buttons may contain any text up to 8 characters. You can have up to 4
  1087. buttons. They are filled with the text specified from the bottom one (the
  1088. default) upwards. If the text for a button is a null string then that button
  1089. will not be created. If the user presses Return then the default button is
  1090. pressed. If the user presses Escape then the button specified in R5 is
  1091. pressed. Mouse_Click events to the requester window will be passed from
  1092. WimpExt_Action filtered so that only Select and Adjust are passed through,
  1093. the window handle is -3, and the icon handle will be 0-3. You can check
  1094. whether the requester window is open by using WimpExt_CheckWindowOpen.
  1095.  
  1096.  
  1097. WimpExt_CloseRequester   &457A7
  1098. -------------------------------
  1099.  
  1100. Closes the requester window and releases the mouse pointer. This is done
  1101. automatically if the user selects a button in the requester box, or presses
  1102. Escape or Return. If the window wasn't open then no error is generated.
  1103.  
  1104.  
  1105.  
  1106. Help
  1107. ====
  1108.  
  1109. WimpExtension provides a couple of SWIs and a validation command to make
  1110. providing multitasking help easier. The validation command is:
  1111.  
  1112.     'wh' (help)
  1113.       Syntax:
  1114.         wh<message>
  1115.  
  1116. When the pointer is over the icon, Acorn's Help application would display the
  1117. message specified.
  1118.  
  1119. If you set bit 5 of R2 when you called WimpExt_Initialise, specifying
  1120. 'semi-automatic' help then, instead of sending the message to Help for you,
  1121. WimpExtension will instead give YOU a message, &45783, giving you the
  1122. suggested help string. This feature was suggested by Peter Greenham, so that
  1123. help strings can be converted via MsgTrans. The message format is as follows:
  1124.     R1+16  &45783
  1125.     R1+20  mouse X
  1126.     R1+24  mouse Y
  1127.     R1+28  button state
  1128.     R1+32  window handle (-1 for background, -2 for icon bar,
  1129.            -3 for requester window)
  1130.     R1+36  icon handle
  1131.     R1+40  suggested text
  1132.  
  1133. You may notice that this is the same as message &502, with the message number
  1134. changed and the suggested text tagged on the end. To send this on unchanged,
  1135. you would use:
  1136.     SYS "WimpExt_SendHelp",q%+40,q%
  1137.  
  1138.  
  1139. WimpExt_SendHelp         &457AA
  1140. -------------------------------
  1141. R0 = message text
  1142. R1 = pointer to message block containing message of type &502 or &45783
  1143.  
  1144. Sends a reply to message type &502, with the specified text. The message will
  1145. appear in Help's Interactive Help Window, or WimpHelp's Standard Help Window.
  1146.  
  1147.  
  1148. WimpExt_SendWimpHelp     &457AB
  1149. -------------------------------
  1150. R2 = keyword
  1151. R3 = filename
  1152.  
  1153. Sends a message to WimpHelp, telling it to open a hypertext help window from
  1154. a file as specified in R3, with the keyword as specified in R2.
  1155.  
  1156.  
  1157.  
  1158. Graphics handling
  1159. =================
  1160.  
  1161.  
  1162. WimpExtension can help you with plotting sprites (including 256-colour ones)
  1163. and also with operations on Draw files (including displaying them).
  1164.  
  1165.  
  1166. WimpExt_SpriteOp         &46386
  1167. -------------------------------
  1168. R0 = reason code
  1169.      +256 for user sprite area, R2 points to sprite name
  1170.      +512 for user sprite area, R2 points to sprite
  1171. unless otherwise specified:
  1172. R1 = sprite control block pointer (or +1 for Wimp sprite pool)
  1173. R2 = sprite pointer
  1174. other registers as appropriate for reason code
  1175.  
  1176. This SWI performs various operations on sprites, including displaying them
  1177. onto the screen (or printer). Note that these calls need ColourTrans if you
  1178. are using them with 256-colour sprites. Sprites in the system sprite area are
  1179. not supported.
  1180.  
  1181. R0 = 0 : Display sprite
  1182. -----------------------
  1183. R3 = x coordinate (OS units)
  1184. R4 = y coordinate (OS units)
  1185. R5 = plot action
  1186.  
  1187. Plots the specified sprite on the screen. This call is mode-independent, so
  1188. if necessary the sprite is changed size and/or the colours are chosen
  1189. appropriately.
  1190.  
  1191. R0 = 1 : Get palette
  1192. --------------------
  1193. Exit:
  1194. R3 = pointer to sprite's palette, or 0 if it doesn't have one
  1195. R4 = number of entries in palette
  1196.  
  1197. Locates the specified sprite's palette.
  1198.  
  1199. R0 = 2 : Make pixel translation table
  1200. -------------------------------------
  1201. R3 = pointer to block to contain table (1 byte per colour)
  1202. Exit:
  1203.      block contains pixel translation data
  1204.  
  1205. Calculates a pixel translation table for displaying the specified sprite in
  1206. the current mode. If the sprite has no palette then the desktop's colours are
  1207. used.
  1208.  
  1209. R0 = 3 : Make scaling table
  1210. ---------------------------
  1211. R3 = pointer to 16-byte block to contain table
  1212. Exit:
  1213.      block contains scaling table
  1214.  
  1215. Calculates a scaling table for displaying the specified sprite at normal size
  1216. in the current mode.
  1217.  
  1218. R0 = 4 : Display sprite scaled
  1219. ------------------------------
  1220. R3 = x coordinate (OS units)
  1221. R4 = y coordinate (OS units)
  1222. R5 = plot action
  1223. R6 = pointer to sprite scaling table:
  1224.      R6 + 00  x multiplier
  1225.      R6 + 04  y multiplier
  1226.      R6 + 08  x divisor
  1227.      R6 + 12  y divisor
  1228.  
  1229. Plots the specified sprite on the screen, scaled according to the table. This
  1230. call is mode-independent, so if necessary the sprite is changed size and/or
  1231. the colours are chosen appropriately. The sprite is first scaled to be the
  1232. correct size in the current mode, then the specified scaling table is used.
  1233.  
  1234.  
  1235. R0 = 5 : Copy sprite
  1236. --------------------
  1237. R3 = pointer to destination sprite area (or +1 for Wimp sprite pool)
  1238.  
  1239. Copies the specified sprite into the destination sprite area. Gives an error
  1240. if there isn't enough room. Note that sprites with duplicate names will NOT
  1241. be overwritten; you will end up with two sprites with the same name.
  1242.  
  1243. R0 = 6 : Copy sprite area
  1244. -------------------------
  1245. R1 = source sprite control block pointer (or +1 for Wimp RMA sprite pool,
  1246.      or +2 for Wimp ROM sprite pool)
  1247. R2 = target sprite control block pointer (or +1 for Wimp sprite pool)
  1248.  
  1249. Copies ALL the sprites from the source sprite area to the target sprite area.
  1250. Gives an error if there isn't enough room. Note that sprites with duplicate
  1251. names will NOT be overwritten; you will end up with two sprites with the same
  1252. name.
  1253.  
  1254. R0 = 7 : Remove duplicate names
  1255. -------------------------------
  1256. R1 = sprite control block pointer (or +1 for Wimp sprite pool)
  1257.  
  1258. Checks for sprites with duplicate names. If any exist, all copies except the
  1259. LAST one will be deleted.
  1260.  
  1261. R0 = 8 : Copy sprite area sprite by sprite
  1262. ------------------------------------------
  1263. R1 = source sprite control block pointer (or +1 for Wimp RMA sprite pool,
  1264.      or +2 for Wimp ROM sprite pool)
  1265. R2 = target sprite control block pointer (or +1 for Wimp sprite pool)
  1266.  
  1267. Copies ALL the sprites from the source sprite area to the target sprite area.
  1268. Gives an error if there isn't enough room. The sprites will be copied one by
  1269. one, with duplicate sprite names removed before each copy. This means that
  1270. this call, while being slower than 'Copy sprite area' followed by 'Remove
  1271. duplicate names', often requires less free memory in the target sprite area.
  1272.  
  1273. R0 = 9 : Check if sprite needs to be transformed
  1274. ------------------------------------------------
  1275. R3 = mode to check for, or -1 for current mode
  1276. Exit:
  1277. R0 = bit   meaning if set
  1278.      0     a pixel translation table would be needed
  1279.      1     a scaling table would be needed
  1280.      2-31  undefined; will be 0 if the sprite doesn't need transforming
  1281.  
  1282. Checks whether the specified sprite needs to be scaled or needs a pixel
  1283. translation table to be plotted correctly in the specified mode. If either of
  1284. these things are required, other WimpExt_SpriteOp calls exist to calculate
  1285. them for you.
  1286.  
  1287. R0 = 10 : Global replace
  1288. ------------------------
  1289. R3 = search colour
  1290. R4 = replace colour
  1291.  
  1292. Replaces all pixels of colour R3 with pixels of colour R4. This routine isn't
  1293. very fast, but it works. Currently it won't work with 256-colour sprites.
  1294.  
  1295.  
  1296. WimpExt_DrawOp           &46385
  1297. -------------------------------
  1298. R0 = reason code
  1299. other registers as appropriate for reason code
  1300.  
  1301. This SWI performs various operations on Draw files, including rendering them
  1302. onto the screen (or printer).
  1303.  
  1304. R0 = 0 : Render draw file
  1305. -------------------------
  1306. R1 = pointer to scaling and position table:
  1307.        R1+00 = amount to multiply X by * 65536
  1308.        R1+04 = 0
  1309.        R1+08 = 0
  1310.        R1+12 = amount to multiply Y by * 65536
  1311.        R1+16 = X origin (OS units)
  1312.        R1+20 = Y origin (OS units)
  1313. R2 = pointer to first object (ie. beginning of Draw file+40)
  1314. R3 = pointer to end of file
  1315. R4 = pointer to graphics clip box, or 0 for no clipping:
  1316.        R4+00 = XMin
  1317.        R4+04 = YMin
  1318.        R4+08 = XMax
  1319.        R4+12 = YMax
  1320. Exit:
  1321. F0-F2 corrupted
  1322.  
  1323. This call displays a draw file. Objects will be checked one by one to see if
  1324. they are in the clipping area, and redrawn if they are. Currently the
  1325. following objects are supported:
  1326.       0 - font table
  1327.       1 - text
  1328.       2 - path
  1329.       5 - sprite
  1330.       6 - group
  1331.       7 - tag
  1332. This is all the objects specified in the RISC OS 2 PRMs, except for text AREA
  1333. objects, which are hardly ever used and are very very complicated. Magnifying
  1334. a draw file by more than about 8 times is probably not a good idea because
  1335. rounding errors in the Draw module will start to become significant. Note
  1336. that this call requires the ColourTrans module. It also requires the
  1337. FPEmulator module, if and only if the scaling is not 1:1. This call replaces
  1338. the old SWI WimpExt_RedrawDraw, which should now not be used. (This call is
  1339. much better anyway.)
  1340.  
  1341. R0 = 1 : Calculate bounding box
  1342. -------------------------------
  1343. R2 = pointer to first object
  1344. R3 = pointer to end of last object
  1345. Exit:
  1346. R4 = XMin (Draw units)
  1347. R5 = YMin (Draw units)
  1348. R6 = XMax (Draw units)
  1349. R7 = YMax (Draw units)
  1350.  
  1351. Calculates the bounding box of the specified objects. The coordinates are
  1352. returned in Draw units (which are OS Units * 256). Grouped objects are not
  1353. checked individually - the group's bounding box is used. Unknown object types
  1354. will not be checked. (This call 'knows' all the types described in the RISC
  1355. OS 2 PRMs.)
  1356.  
  1357. R0 = 2 : Register unknown object handler
  1358. ----------------------------------------
  1359. R2 = pointer to routine (or 0 for no unknown object handler)
  1360. R3 = pointer to workspace
  1361.  
  1362. This routine will be called if the Render Draw File code encounters an
  1363. unknown object. The routine has the following entry and exit conditions:
  1364. Entry: (SVC mode)
  1365.   R2  = pointer to object
  1366.   R4  = pointer to scaling and position table
  1367.   R6  = clipping rectangle XMin (pretransformed)
  1368.   R7  = clipping rectangle YMin (pretransformed)
  1369.   R8  = clipping rectangle XMax (pretransformed)
  1370.   R9  = clipping rectangle YMax (pretransformed)
  1371.   R12 = your workspace pointer
  1372.   R13 = pointer to supervisor stack (at least 256 bytes guaranteed)
  1373.   R14 = return address
  1374. Exit:
  1375.   R1-R11,R13 preserved
  1376.   V flag set on error, with R0 pointing to standard error block
  1377.  
  1378.  
  1379.  
  1380. WimpExtension's Sprite Pool
  1381. ===========================
  1382.  
  1383. WimpExtension has a built-in
  1384.  
  1385.  
  1386.  
  1387. Font menus
  1388. ==========
  1389.  
  1390.  
  1391. Font menus have tended to be huge and impossible to use, with every single
  1392. variety of every single font listed all in one menu. WimpExtension will
  1393. automatically create a hierarchial font menu for you, with all the fonts
  1394. listed by family. Note that you must set bit 2 of R2 when you call
  1395. WimpExt_Initialise if you wish to use font menus.
  1396.  
  1397.  
  1398. WimpExt_GetFontMenu      &457B7
  1399. -------------------------------
  1400. R0 = 0 to unshade 'System font' entry, 1 to shade it
  1401. R1 = pointer to menu title (12 chars max), or 0 for default title ('Font')
  1402. Exit:
  1403. R1 = pointer to menu structure
  1404.  
  1405. Reads in the list of fonts currently available and creates a hierarchial
  1406. menu structure with all the fonts listed by family. 'System font' is also on
  1407. the root menu. This menu structure is guaranteed to remain in the same place
  1408. for as long as your task is active. The font list MAY be read in the first
  1409. time you call WimpExt_GetFontMenu, or it may have been read in earlier. This
  1410. SWI may only be called if you set bit 2 of R2 when you called
  1411. WimpExt_Initialise.
  1412.  
  1413.  
  1414. WimpExt_DecodeFontMenu   &457B8
  1415. -------------------------------
  1416. R0 = pointer to buffer for font name
  1417. R1 = pointer to Wimp_Poll block, reason code Menu_Selection
  1418.  
  1419. The font menu is decoded and the correct font name is placed in the buffer.
  1420. If the user selects, for example, 'Trinity' of 'Trinity.xxx','Trinity.yyy'
  1421. the submenus will be followed through, and the font name at the top of each
  1422. menu used. This SWI may only be called if you set bit 2 of R2 when you called
  1423. WimpExt_Initialise.
  1424.  
  1425.  
  1426.  
  1427. Immediate windows
  1428. =================
  1429.  
  1430.  
  1431. Immediate windows are nothing to do with the Wimp. They are redrawn entirely
  1432. by WimpExtension, and do not multitask. They can be for reporting the
  1433. progress of a non-multitasking operation, or for getting an immediate
  1434. response from the user. Because the redraw routine is entirely within
  1435. WimpExtension, not all features of windows and icons are supported. Windows
  1436. are fully supported apart from scrollbars and the control icons in the window
  1437. border. Icons at the moment don't include sprites, but this will be improved
  1438. upon in a later version of WimpExtension.
  1439.  
  1440.  
  1441. WimpExt_ControlImmediate &457B9
  1442. -------------------------------
  1443. R1 = 0 or -1   : close immediate window
  1444.    = 1         : check for mouse click in immediate window
  1445.    = 2         : open immediate requester and wait for mouse click
  1446.    = 3         : redraw icon - icon handle in R0
  1447.    = 4         : slab icon - icon handle in R0 (-1 to use currently slabbed
  1448.                  icon), R2 = 1 to slab in, 0 to slab out
  1449.    = 5         : limit pointer to immediate window
  1450.    = 6         : redraw icon's 3D border - icon handle in R0
  1451.    = 7         : redraw icon:
  1452.                  R0 = pointer to icon block
  1453.                  R2 = 'Work area' X origin
  1454.                  R3 = 'Work area' Y origin
  1455.   >= &8000     : open immediate window using data pointed to by R1
  1456. If R1 = 2 then rest of registers as for WimpExt_OpenRequester
  1457. Exit:
  1458. If R1 = 1 or 2 : R0 = Icon handle of icon clicked on, or -1 for none
  1459.  
  1460. This SWI is for using windows like the Wimp_ReportError window that are not
  1461. multi-tasking. You can only have one 'immediate window' open at a time, it is
  1462. always on top of the window pile, and you MUST NOT call 'Wimp_Poll' while the
  1463. immediate window is open.
  1464. If R1 is 0 or -1 on entry, the immediate window is closed. If it was not open
  1465. then no error is generated.
  1466. If R1 is 1 on entry, then the program will check for mouse clicks on icons in
  1467. the window. 3D icons will be slabbed automatically. -1 is returned if no iconwas clicked on.
  1468. If R1 is 2 on entry, the rest of the registers are as for
  1469. WimpExt_OpenRequester. It opens an 'immediate requester' and waits for a
  1470. mouse click on one of the action buttons, or ESCAPE or RETURN. The icon
  1471. clicked on is returned in R0.
  1472. If R1 is 3 on entry, the icon in the immediate window whose handle is in R0
  1473. will be redrawn (presumably because you have changed the indirected data).
  1474. The 3D border is not redrawn.
  1475. If R1 is 4 on entry, the icon whose handle is in R0 will be slabbed in or out
  1476. depending on R2 - similar to WimpExt_SlabIcon for normal icons. If the
  1477. specified icon handle is -1 and R2 is 0 then the currently slabbed icon (if
  1478. any) is used.
  1479. If R1 is 5, the mouse rectangle is redefined to be the size of the immediate
  1480. window - similar to WimpExt_LimitPointer for normal windows. Use
  1481. WimpExt_ReleasePointer to release the pointer again afterwards.
  1482. If R1 is 6, the specified icon's 3D border is redrawn.
  1483. If R1 is 7, the specified icon is drawn. You do not need to have an immediate
  1484. window open to use this reason code.
  1485. If R1 is greater than or equal to &8000 on entry, then an immediate window is
  1486. created from the Wimp_CreateWindow block pointed to by R1.
  1487. If you call WimpExt_PrePoll while an immediate window is open then it will be
  1488. closed automatically - the Wimp does not know about immediate windows and the
  1489. screen display would become corrupted if you kept an immediate window open
  1490. over a call to Wimp_Poll[Idle].
  1491. Icon types currently supported are:
  1492.   sprite-only non-indirected
  1493.   text-only, all types
  1494. Unknown icon types will be ignored.
  1495.  
  1496.  
  1497.  
  1498. Heap manager
  1499. ============
  1500.  
  1501. One of the biggest problems in writing multitasking programs (or single-
  1502. tasking ones for that matter) is memory management. For any program which has
  1503. more than one memory array which may change size during use it can get very
  1504. complicated. For this reason, WimpExtension provides a complete heap
  1505. manager. You call the initialise routine at the beginning of your program,
  1506. and from then on whenever you need some memory simply ask for it, and return
  1507. it when you don't need it any more. WimpExtension will automatically tidy the
  1508. heap, and reduce and enlarge the WimpSlot where necessary/possible.
  1509.  
  1510. The heap management system takes control of all your task's memory above the
  1511. start of the heap (specified when you call the initialise routine). You
  1512. should NOT change your task's WimpSlot when using the heap management routine
  1513. (ie. don't call Wimp_SlotSize with R0<>-1).
  1514.  
  1515. So that the memory blocks can be moved about by the tidy routine, you are not
  1516. given the address of the block, but the address of its 'anchor'. This is a
  1517. single word which points to the block. The tidy routine can then move the
  1518. block about and then update the anchor so you still know where it is. Note
  1519. that blocks will not mysteriously move on their own, they will only move on
  1520. calls to WimpExt_Heap, and then only for reason codes 5, 6, 11 and 12.
  1521. (See below.)
  1522.  
  1523. You specify the number of anchors to create when calling WimpExt_Heap's
  1524. initialise routine. More anchors can be created later using the increase
  1525. anchors routine, but this is quite slow. If you use the 'allocate with
  1526. extend' routine for allocating blocks then the increase anchors routine will
  1527. be called for you automatically when necessary. You cannot decrease the
  1528. number of anchors. If you specify 0 anchors in the initialise entry then a
  1529. default value of 256 is used - this is loads and should be more than
  1530. sufficient for most needs.
  1531.  
  1532. Note that the size of all memory blocks is a multiple of 8 plus 4 (ie.
  1533. size = 8N+4). The size will be rounded up on calls to the allocate routine.
  1534. The size of the block is stored 4 bytes before the start of the block. All
  1535. blocks are guaranteed word aligned.
  1536.  
  1537. When calling WimpExt_Heap routines, you can either refer to a block by a
  1538. pointer to it, or by a pointer to its anchor. I will refer to this as a
  1539. 'block pointer'.
  1540.  
  1541. The tidy routine can be automatically called once a second in WimpExt_PrePoll
  1542. if you set bit 3 of R2 when you call WimpExt_Initialise. Remember not to mask
  1543. out null events, though - it's probably best to use Wimp_PollIdle.
  1544.  
  1545. The routines are fairly robust, and will usually produce the error
  1546. 'Heap corrupt' or 'Bad heap operation' rather than an address exception or
  1547. corrupting memory if something goes wrong. Both of these should probably be
  1548. treated as fatal errors, but you can do with them what you like.
  1549.  
  1550. Note that when there are no blocks allocated in the heap, it takes no memory
  1551. at all - even the list of anchors is destroyed. This means that if you are a
  1552. module task with a heap at &8000 then you won't be unnecessarily using 16k
  1553. (or whatever page size the computer is using) all the time.
  1554.  
  1555. The calls all act on the currently selected heap. Use the call R0=14 to
  1556. select different heaps. Heaps are specified through a 'heap pointer', which
  1557. is set out as follows:
  1558.   +00  hp_heap       offset of heap data area
  1559.   +04  hp_free       offset of first free block, or 0 if no free blocks
  1560.   +08  hp_anchors    offset of first anchor
  1561.   +0C  hp_heapsize   total size of heap in bytes
  1562.   +10  hp_heapfix    'fixed' counter
  1563.   +14  hp_tidytime   monotonic time of last Tidy call
  1564.   +18  hp_heaptidy   tidy flag; 0 if heap is fully tidied, non-zero otherwise
  1565.   +1C  hp_created    created flag; 0 if heap is uncreated, non-zero otherwise
  1566.   +20  hp_base       pointer to base of heap memory
  1567.   +24  hp_pagesize   'page' size
  1568.   +28  hp_setsize    pointer to routine to change size of heap, entered in
  1569.                      SVC mode:
  1570.                        R0  = size required
  1571.                        R10 = heap pointer
  1572.                        R13 = supervisor stack
  1573.                        R14 = return address
  1574.                       exit:
  1575.                        R0  = 0 indicates failure, non-zero indicates success
  1576.                        all other registers preserved
  1577.   +2C  hp_numblocks  number of blocks claimed
  1578.   +30  hp_rootptr    pointer to pointer to base of heap memory
  1579.   +34  hp_misc       depends on what sort of heap this is
  1580.  
  1581. See the file "Heap" for a detailed explanation of the heap memory manager.
  1582.  
  1583.  
  1584. WimpExt_Heap             &457BA
  1585. -------------------------------
  1586. R0 = reason code
  1587. other registers as appropriate for reason code
  1588.  
  1589. R0 = 0 - Initialise standard heap:
  1590. ----------------------------------
  1591. R1 = pointer to base of heap
  1592. R2 = number of anchors to allocate
  1593.  
  1594. Initialises the standard heap. R1 points to the base of the heap - it will
  1595. grow upwards from here. R2 specifies the numbers of anchors to allocate
  1596. initially. Each anchor takes 8 bytes. Note that R1 is rounded up to the
  1597. nearest multiple of 8 plus 4 (ie. 8N+4). The heap is automatically selected
  1598. as the current heap.
  1599.  
  1600. R0 = 1 - Describe heap:
  1601. -----------------------
  1602. Exit:
  1603. R0 = currently selected heap pointer, or +1 for standard heap
  1604. R2 = largest available block size
  1605. R3 = total free
  1606. R4 = memory used by heap
  1607. R5 = number of anchors allocated
  1608. R6 = number of anchors in use
  1609.  
  1610. Adds up all the sizes of the free blocks, and returns information about
  1611. memory used by the heap. If the heap is empty then R2-R6 will be zero.
  1612.  
  1613. R0 = 2 - Allocate block:
  1614. ------------------------
  1615. R2 = size of block required
  1616. Exit:
  1617. R1 = pointer to anchor or zero if allocation failed
  1618.  
  1619. Tries to find a block of the required size. Increases the WimpSlot if
  1620. necessary. If a call to Wimp_SlotSize fails then zero will be returned. Note
  1621. that the size is rounded up to the next multiple of 8 plus 4.
  1622.  
  1623. R0 = 3 - Free block:
  1624. --------------------
  1625. R1 = block pointer
  1626.  
  1627. Frees the memory used by the specified block.
  1628.  
  1629. R0 = 4 - Reallocate block:
  1630. --------------------------
  1631. R1 = block pointer
  1632. R2 = new size required
  1633. Exit:
  1634. R1 = pointer to anchor (the same anchor as before) or 0 if reallocate failed
  1635.  
  1636. Tries to resize the specified block. You should check R1 on exit to see if
  1637. the resize was successful (only on increasing the size, decreasing the size
  1638. will always be successful).
  1639.  
  1640. R0 = 5 - Tidy heap:
  1641. -------------------
  1642.  
  1643. Tries to tidy the heap, reducing the WimpSlot if possible. This can be
  1644. automatically performed once a second (in WimpExt_PrePoll) if you set bit 3
  1645. of R2 when you called WimpExt_Initialise. Note that this routine does not
  1646. tidy the heap fully, it just does a little bit each time it is called. This
  1647. is to keep the time cost down.
  1648.  
  1649. R0 = 6 - Compact heap:
  1650. ----------------------
  1651.  
  1652. Repeatedly calls Tidy Heap, until the heap is as small as it can get.
  1653.  
  1654. R0 = 7 - Find anchor:
  1655. ---------------------
  1656. R1 = block pointer
  1657. Exit:
  1658. R1 = pointer to anchor
  1659.  
  1660. Given a block pointer, returns a pointer to that block's anchor.
  1661.  
  1662. R0 = 8 - Fix blocks:
  1663. --------------------
  1664.  
  1665. Fixes the heap. Subsequent calls to the Tidy or Compact routines will have no
  1666. effect. Effectively, the heap becomes a non-relocatable heap like the RMA.
  1667. This call is provided so that if you temporarily need to rely on the blocks
  1668. not moving, you can easily do so. WimpExtension keeps a counter of the number
  1669. of times you call this routine, so that if you, for example, fix the blocks
  1670. twice in a row then you need to unfix them twice in a row before they are
  1671. actually unfixed.
  1672.  
  1673. R0 = 9 - Unfix blocks regardless of counter:
  1674. --------------------------------------------
  1675.  
  1676. Unfixes the heap, so that garbage disposal routines will work again. This
  1677. call zeroes the counter straight away - ie. the blocks are immediately
  1678. unfixed no matter how many times you called the fix routine.
  1679.  
  1680. R0 = 10 - Unfix blocks:
  1681. -----------------------
  1682.  
  1683. Unfixes the heap, so that garbage disposal routines will work again. This
  1684. routine decrements the fix counter, and only actually unfixes the blocks if
  1685. the counter reaches zero.
  1686.  
  1687. R0 = 11 - Increase anchors:
  1688. ---------------------------
  1689. R2 = number of anchors to add
  1690. Exit:
  1691. R1 = 0 indicates failure, non-zero indicates success
  1692.  
  1693. Increases the number of anchors. This routine is quite slow as it often has
  1694. to move the entire heap up in memory so you should use this routine
  1695. sparingly, if you need to use it at all. Note that this SWI causes blocks to
  1696. be relocated.
  1697.  
  1698. R0 = 12 - Allocate with anchor extend:
  1699. --------------------------------------
  1700. R2 = size of block required
  1701. Exit:
  1702. R1 = pointer to anchor or zero if allocation failed
  1703.  
  1704. Tries to find a block of the required size. Increases the WimpSlot if
  1705. necessary. If a call to Wimp_SlotSize fails then zero will be returned. Note
  1706. that the size is rounded up to the next multiple of 8 plus 4. If no free
  1707. anchors are available then the increase anchors call is used to make some
  1708. more; therefore using this SWI can cause blocks to be relocated. It is,
  1709. however, the recommended call to use for allocating blocks as it isn't
  1710. limited by the number of anchors already created.
  1711.  
  1712. R0 = 13 - Free all blocks
  1713. -------------------------
  1714.  
  1715. Frees all blocks in the currently selected heap belonging to your task.
  1716.  
  1717. R0 = 14 - Select heap
  1718. ---------------------
  1719. R1 = heap pointer, or +1 for standard heap, or -1 for no change
  1720. Exit:
  1721. R0 = previous heap pointer, or 0 if no previously selected heap
  1722. R1 = current heap pointer, or 0 if no currently selected heap
  1723.  
  1724. Selects a new heap to be used by the other WimpExt_Heap calls.
  1725.  
  1726. R0 = 15 - Relocate heap
  1727. -----------------------
  1728.  
  1729. Compares the heap addresses specified by hp_base and hp_rootptr. If they are
  1730. different, then hp_base is updated by hp_rootptr, and the anchors are
  1731. recalculated to account for the change of address.
  1732.  
  1733. R0 = 16 - Create a heap in a heap block
  1734. ---------------------------------------
  1735. R1 = heap pointer (blank, it will be filled in by this call)
  1736. R2 = number of anchors to create
  1737. Exit:
  1738. R1 = heap pointer, or 0 if the call failed due to lack of memory
  1739.  
  1740. This call creates a new heap inside a heap block in the currently selected
  1741. heap. The new heap is NOT selected as the current heap.
  1742.  
  1743.  
  1744.  
  1745. Data transfer
  1746. =============
  1747.  
  1748. WimpExtension can handle saving files if your file is in a contiguous area of
  1749. memory (ie. not split up in several chunks all over the place). You just call
  1750. WimpExt_DataSave when you receive the User_Drag_Box event from the user
  1751. dropping the icon in a filer window or onto another task. When the transfer
  1752. is complete (successful or otherwise) you will be sent a message, &45782,
  1753. telling you that the transfer is complete, and whether everything went OK.
  1754. The SWI supports the full data transfer protocol, including the Wimp$Scrap
  1755. method and RAM transfer. Note that if you are saving from a WimpExt_Heap
  1756. block, you should fix the heap beforehand, and unfix it afterwards.
  1757.  
  1758. WimpExtension can also handle loading of files. Files can either be loaded
  1759. into a WimpExt_Heap block (the preferred method) or they can be loaded into a
  1760. fixed-size area of memory. Use is similar to WimpExt_DataSave - you just pass
  1761. the DataSave or DataLoad message to WimpExt_DataLoad, and wait for a message
  1762. telling you the transfer is complete.
  1763.  
  1764.  
  1765. WimpExt_DataSave         &457BC
  1766. -------------------------------
  1767. R0 = File length
  1768. R1 = Pointer to filename (pathname or leafname)
  1769. R2 = File type
  1770. R3 = Pointer to data
  1771. R4 = Zero to allow files to be saved to your own task, non-zero otherwise
  1772. Exit:
  1773. R0 = 0 if failed due to attempt to save to own task, non-zero otherwise
  1774.  
  1775. Used to save a file from your program to a filer or to another task. When you
  1776. receive the User_Drag_Box event after the user has dragged the icon to where
  1777. they want it put, call WimpExt_DataSave to handle the data transfer. If R4 is
  1778. non-zero on entry, then if the user has dragged the file to a window or icon
  1779. belonging to your task then no action will be taken, and R0 will be zero on
  1780. exit. Otherwise, when the transfer has finished, WimpExtension will send you
  1781. a message, number &45782, with the word at R1+20 having the following
  1782. meaning:
  1783.         0 = file not saved
  1784.         1 = file saved but is 'unsafe' (eg. saved to another task)
  1785.         2 = file saved
  1786. If the code is 2, then the filename the file was saved as is at R1+24.
  1787.  
  1788.  
  1789. WimpExt_DataLoad         &46383
  1790. -------------------------------
  1791. R0 = 0 : Load into heap block
  1792.   R1 = pointer to DataSave or DataLoad message block
  1793.   R2 = block pointer of block to receive file, or 0 to create new block
  1794.   R3 = offset in block to place file
  1795. R0 = 1 : Load into fixed block
  1796.   R1 = pointer to DataSave or DataLoad message block
  1797.   R2 = pointer to block to receive file
  1798.   R3 = length of block
  1799.  
  1800. Use this SWI to load files from the filer or other applications. If R0=0 then
  1801. the file is loaded into a WimpExt_Heap block, and can be any length, memory
  1802. permitting. If R0=1 then the file is loaded into a fixed area of memory, and
  1803. will not be loaded if it exceeds the length of the area. When you receive the
  1804. DataSave or DataLoad message, pass the block onto WimpExt_DataLoad, and the
  1805. transfer will be handled automatically. As long as this SWI doesn't return an
  1806. error, when the transfer has finished, WimpExtension will send you a message,
  1807. number &45784, with the word at R1+20 having the following meaning:
  1808.         0 = file not loaded. Error block at R1+28
  1809.         1 = file transferred successfully from another task
  1810.         2 = file loaded successfully from disc
  1811. A pointer to the block's anchor is at R1+24, if it was loaded into a heap
  1812. block. Otherwise a pointer to the area is at R1+24. If R1+20<>0 then the rest
  1813. of the block contains:
  1814.     R1+28 = length of file
  1815.     R1+32 = load address of file
  1816.     R1+36 = exec address of file
  1817.     R1+40 = filename (leafname if transferred from task)
  1818. Obviously you need to have initialised a heap to use this SWI. Note that
  1819. WimpExtension won't free the block if there's an error; your error handler
  1820. must do this if appropriate. The load and exec addresses don't indicate the
  1821. date if the file was transferred from another task (the relevant bits will
  1822. all be zero).
  1823.  
  1824.  
  1825.  
  1826. Dragging icons
  1827. ==============
  1828.  
  1829.  
  1830. To make dragging icons about easier, WimpExtension provides a single SWI
  1831. 'WimpExt_DragIcon'. Normally this will produce an ordinary rotating dash-box
  1832. like normal. If you have the DragASprite module loaded, however, it can be
  1833. made to use that instead (if the user has configured the computer to use this
  1834. module by setting bit 1 of CMOS RAM location 28).
  1835.  
  1836. The DragASprite module is included with RISC OS 3 and above. However, the
  1837. module can be altered to work on RISC OS 2 by simply removing the call to
  1838. OS_ReadSysInfo in the initialise entry. I have no idea whether it is legal to
  1839. take a copy of DragASprite from a RISC OS 3 machine, alter it, and put it on
  1840. a RISC OS 2 machine, so I haven't supplied a RISC OS 2-compatible copy of
  1841. DragASprite.
  1842.  
  1843.  
  1844. WimpExt_DragIcon         &4579A
  1845. -------------------------------
  1846. R0 = flags:
  1847.       0-1 Horizontal position:
  1848.             00 = left
  1849.             01 = middle
  1850.             10 = right
  1851.             11 = undefined
  1852.       2-3 Vertical position:
  1853.             00 = bottom
  1854.             01 = middle
  1855.             10 = top
  1856.             11 = undefined
  1857.       4-5 Mouse bounding box:
  1858.             00 = whole screen
  1859.             01 = constrain to parent window
  1860.             10 = constrain to box pointed to by R5
  1861.             11 = undefined
  1862.       6   constrain sprite if set, otherwise constrain pointer
  1863.       7   shadow if set
  1864.       8   use DragASprite even if CMOS flag isn't set
  1865.      9-31 reserved; MUST BE 0
  1866. R1 = pointer to sprite block, +1 for Wimp sprite area, 0 to use dash box
  1867. R2 = Window handle
  1868. R3 = Icon handle
  1869. R4 = pointer to sprite name (if R1<>0)
  1870. R5 = pointer to mouse bounding box (only if necessary - see flags)
  1871.       +00 xmin
  1872.       +04 ymin
  1873.       +08 xmax
  1874.       +12 ymax
  1875.  
  1876. This SWI does one of two things. If the DragASprite module is loaded, and
  1877. bit 1 of byte 28 of the CMOS RAM is set, and R1<>0 then it will use the
  1878. DragASprite module as follows:
  1879.   Work out the parameters to 'DragASprite_Start' and call it. If this
  1880.   produces an error then try again with dash box as described below.
  1881. Otherwise it makes an ordinary rotating dash box as follows:
  1882.   Work out the parameters to 'Wimp_DragBox' and call it. Bits 0-3 and 7 of
  1883.   the flags are ignored.
  1884. If you are using this SWI at any time with R1<>0 then remember to call
  1885. XDragASprite_Stop at appropriate points. You MUST use the X form of the SWI,
  1886. and you must ignore errors.
  1887. This SWI has been altered since version 1.63 of WimpExtension - if you wish
  1888. to use it as before simply set R0 and R1 to zero.
  1889.  
  1890.  
  1891.  
  1892. Defaults and sprites
  1893. ====================
  1894.  
  1895. The 'WimpExt Defaults' command is intended to allow the user to customise the
  1896. colours of the 3D borders, or to make the 3D borders flat. Whenever the
  1897. command is issued, a message (no. &45791) is broadcast, and then the screen
  1898. is redrawn. You can read the defaults settings by using WimpExt_MiscOp 0.
  1899.  
  1900. The problem with making the 3D borders flat is that sprites in the window
  1901. will still be 3D. For this reason, WimpExtension contains both flat and 3D
  1902. versions of the most commonly used sprites. A pointer to the sprite area
  1903. containing these sprites in returned in R2 when you call WimpExt_Initialise.
  1904. The sprites available are: radioon, radiooff, optoff, opton, yes, no, inc1,
  1905. dec1, dec, inc. A copy of the 3D sprites group is included in the file
  1906. '3DSprs' so you can see the sprites while you're designing your templates.
  1907.  
  1908. When you receive the 'defaults changed' message, you should read the new
  1909. defaults, and make whatever alterations are necessary if the style has
  1910. changed.
  1911.  
  1912.  
  1913.  
  1914. Hotkeys
  1915. =======
  1916.  
  1917. If you aren't using WimpExtension, and you want your task to provide a
  1918. hot-key (ie. a key which does something even when your task doesn't have the
  1919. caret) then you have to open a window permanently somewhere off the screen.
  1920. This wastes memory on RISC OS 3, and means that you run out of windows even
  1921. more quickly than usual on RISC OS 2.
  1922.  
  1923. WimpExtension opens a hot-key window for you, and then will tell you about
  1924. any key-press events it is given. This saves windows because one window is
  1925. shared between all WimpExtension tasks.
  1926.  
  1927. When WimpExtension receives a keypress event, it broadcasts a message as
  1928. follows:
  1929.   R1+16 = &45790
  1930.   R1+20 = key code
  1931.  
  1932. If you decide to do something with the keypress, you should acknowledge the
  1933. message to prevent WimpExtension from passing it on to other tasks.
  1934.  
  1935.  
  1936.  
  1937. Miscellaneous SWIs
  1938. ==================
  1939.  
  1940.  
  1941. WimpExt_CurrentTask      &4578B
  1942. -------------------------------
  1943. R0 = task handle
  1944. Exit:
  1945. R0 = previous task handle
  1946.  
  1947. Informs WimpExtension which task is currently active. Not needed if you have
  1948. called WimpExt_Initialise or WimpExt_Action since the last Wimp_Poll. The
  1949. previous user is returned in R0.
  1950.  
  1951.  
  1952. WimpExt_Divide           &45796
  1953. -------------------------------
  1954. R2 = Numerator
  1955. R3 = Denominator
  1956. Exit:
  1957. R0 = Result
  1958. R2 = Remainder
  1959.  
  1960. Returns (R2 DIV R3) in R0 and (R2 MOD R3) in R2. Useful for calculating which
  1961. area of window needs to be updated. An error is produced if R3 is zero on
  1962. entry.
  1963.  
  1964.  
  1965. WimpExt_CopyString       &4579E
  1966. -------------------------------
  1967. R2 = 'From' pointer
  1968. R3 = 'To' pointer
  1969.  
  1970. Copies the control-terminated string from R2 to R3. The string stored at R3
  1971. will be zero-terminated whatever the terminator was for the original string.
  1972.  
  1973.  
  1974. WimpExt_FindLeaf         &457A1
  1975. -------------------------------
  1976. R0 = Pointer to pathname
  1977. Exit:
  1978. R0 = Pointer to leafname
  1979.  
  1980. Finds the last occurence of '.' in the string pointed to by R0, and returns a
  1981. pointer to the next character. eg. given 'scsi::HardDisc.$.first.second.last'
  1982. it will return a pointer to 'last'. This can be useful for both extracting
  1983. the leaf name, and for determining what directory the file is in (by poking
  1984. a zero to (R0-1) - eg. MOV R2,#0  STRB R2,[R0,#-1] ).
  1985.  
  1986.  
  1987. WimpExt_MemCopy          &457BB
  1988. -------------------------------
  1989. R0 = 'From' address (word aligned)
  1990. R1 = 'To' address (word aligned)
  1991. R2 = Length (not necessarily word aligned)
  1992. Exit:
  1993. R0 preserved
  1994.  
  1995. Copies an area of memory very quickly. Can cope with overlap, R0=R1 or R2=0.
  1996.  
  1997.  
  1998. WimpExt_PlotBorder       &457BD
  1999. -------------------------------
  2000. R0 = reason code
  2001.  R0 = 0  =>  R1 = pointer to icon block
  2002.              R2 = window handle (or -1 for no window)
  2003.  R0 = 1  =>  R1 = pointer to block:
  2004.                R1 + 0  Minimum work area x coordinate
  2005.                R1 + 4  Minimum work area y coordinate
  2006.                R1 + 8  Maximum work area x coordinate
  2007.                R1 + 12 Maximum work area y coordinate
  2008.                R1 + 16 Border type
  2009.              R2 = window handle (or -1 for no window)
  2010.  
  2011. Like Wimp_PlotIcon, except it just redraws the 3D border. R0 specifies how
  2012. the coordinates and border type are to be specified. If bit 31 of R0 is set
  2013. then the border will be plotted slabbed in.
  2014.  
  2015.  
  2016. WimpExt_Sort             &46380
  2017. -------------------------------
  2018. R0 = number of objects to sort
  2019. R1 = pointer to array of objects
  2020. R2 = pointer to comparison routine
  2021. R3 = workspace pointer for comparison procedure
  2022. R4 = size of object
  2023. R5 = address of temporary workspace of R4 bytes (only needed if R4>63)
  2024.  
  2025. This SWI will sort an array of objects. It is very similar to the OS_HeapSort
  2026. SWI, except that you can use it to sort an array of ANY object, rather than
  2027. just arrays of pointers. R2 points to a routine which is entered, in SVC
  2028. mode, as follows:
  2029.   R0  = address of object a
  2030.   R1  = address of object b
  2031.   R12 = value supplied to WimpExt_Sort in R3
  2032.   R13 = supervisor stack
  2033.   R14 = return address
  2034. The routine should compare the two objects and return, preserving all
  2035. registers apart from R0,R1,R12 and R14, with flags set as follows:
  2036.   a<b   Z=0, C=0
  2037.   a=b   Z=1, C=1
  2038.   a>b   Z=0, C=1
  2039. The actual method of sorting is unspecified; suffice it to say it's fast...
  2040. Although R5 doesn't have to be word-aligned, the sort will probably be faster
  2041. if it is.
  2042.  
  2043.  
  2044. WimpExt_MemMove          &46381
  2045. -------------------------------
  2046. R0 = from
  2047. R1 = to
  2048. R2 = size in bytes
  2049.  
  2050. Copies R2 bytes from R0 to R1. R0 and R1 need not be word-aligned, and R2
  2051. need not be a multiple of 4. This SWI uses the optimised memory copying
  2052. routine given in the RISC OS 2 PRMs. It does not cope with overlap (which is
  2053. why it's separate from WimpExt_MemCopy).
  2054.  
  2055.  
  2056. WimpExt_Intersect        &46387
  2057. -------------------------------
  2058. R0 = 0 : Boxes in registers:
  2059.   R2 = XMin1
  2060.   R3 = YMin1
  2061.   R4 = XMax1
  2062.   R5 = YMax1
  2063.   R6 = XMin2
  2064.   R7 = YMin2
  2065.   R8 = XMax2
  2066.   R9 = YMax2
  2067. R0 = 1 : Boxes in blocks:
  2068.   R2 = pointer to XMin1,YMin1,XMax1,YMax1
  2069.   R3 = pointer to XMin2,YMin2,XMax2,YMax2
  2070. Exit:
  2071. If boxes intersect:
  2072. R0 = 1, C flag set
  2073. If boxes don't intersect:
  2074. R0 = 0, C flag clear
  2075.  
  2076. Checks whether the specified rectangles intersect.
  2077.  
  2078.  
  2079. WimpExt_BorderOp         &46388
  2080. -------------------------------
  2081. R0 = reason code
  2082. other registers as appropriate for reason code
  2083.  
  2084. R0 = 0 : Get border number
  2085. --------------------------
  2086. R1 = pointer to icon block
  2087. Exit:
  2088. R0 = border number, or -1 if the icon has no 3D border
  2089.  
  2090. Returns the number of the 3D border of the specified icon. -1 is returned if
  2091. the icon has no 3D border.
  2092.  
  2093. R0 = 1 : Get border width
  2094. -------------------------
  2095. R2 = border number (0-6)
  2096. Exit:
  2097. R0 = width in OS units, or 0 if R2 did not contain a valid border number
  2098.  
  2099. Returns the width of the 3D border outside the icon's bounding box. 0 is
  2100. returned if an invalid border type is specified.
  2101.  
  2102. R0 = 2 : Get bounding box in registers
  2103. --------------------------------------
  2104. R1 = pointer to icon block
  2105. Exit:
  2106. R2 = XMin
  2107. R3 = YMin
  2108. R4 = XMax
  2109. R5 = YMax
  2110.  
  2111. Returns the bounding box of the icon, including the 3D border if present.
  2112.  
  2113. R0 = 3 : Get bounding box in block
  2114. ----------------------------------
  2115. R1 = pointer to icon block
  2116. R2 = pointer to 16-byte block to receive bounding box
  2117. Exit:
  2118. R2 +  0 = XMin
  2119. R2 +  4 = YMin
  2120. R2 +  8 = XMax
  2121. R2 + 12 = YMax
  2122.  
  2123. Returns the bounding box of the icon, including the 3D border if present.
  2124.  
  2125.  
  2126. WimpExt_MiscOp           &4638A
  2127. -------------------------------
  2128. R0 = reason code
  2129. other registers as appropriate for reason code
  2130.  
  2131. R0 = 0 : Read defaults
  2132. ----------------------
  2133. R1 = pointer to block to read values (64 bytes long)
  2134. Exit:
  2135. R1 +  0 = top-left colour
  2136. R1 +  4 = bottom-right colour
  2137. R1 +  8 = in colour
  2138. R1 + 12 = channel colour
  2139. R1 + 16 = minimum slabbing time
  2140. R1 + 20 = sprite style
  2141.           bit    meaning
  2142.           0      0 = 3D, 1 = flat
  2143.           1-31   reserved
  2144.  
  2145. Reads in the default values as specified by *WimpExt Defaults. The block
  2146. should be at least 64 bytes long, to allow room for future expansion.
  2147.  
  2148. R0 = 1 : Read window border thickness
  2149. -------------------------------------
  2150. Exit:
  2151. R2 = title thickness (OS Units)
  2152. R3 = vertical scrollbar thickness (OS Units)
  2153. R4 = horizontal scrollbar thickness (OS Units)
  2154.  
  2155. Reads the thickness of the window borders. Needed because on RISC OS 3 Acorn
  2156. rather stupidly decided to make it so that you can change their thickness.
  2157.  
  2158.  
  2159. WimpExt_SubstituteArgs   &4638C
  2160. -------------------------------
  2161. R0 = pointer to template string
  2162. R1 = pointer to buffer to hold resulting string
  2163. R2 = pointer to string %0
  2164. R3 = pointer to string %1
  2165. R4 = pointer to string %2
  2166. R5 = pointer to string %3
  2167. R6 = pointer to string %4
  2168. Exit:
  2169. R0 = pointer to zero-byte terminator of substituted string
  2170.  
  2171. Takes a string of the form 'This is an %0 of the %1 of %2_%3' and substitutes
  2172. the given strings when %0,%1,%2,%3 or %4 is encountered. eg:
  2173.  
  2174.   SYS "WimpExt_SubstituteArgs","This is an %0 of the %1 of %2_%3",q%,"example","use","WimpExt","SubstituteArgs" TO ,string$
  2175.  
  2176. would give 'This is an example of the use of WimpExt_SubstituteArgs'. Any
  2177. strings not used in the template do not need to have sensible values in the
  2178. corresponding register, although you may like to make the register zero, in
  2179. which case WimpExtension will fault that string's use. To include a % in the
  2180. template, use %%.
  2181.  
  2182.  
  2183. WimpExt_RedirectSprites  &4638D
  2184. -------------------------------
  2185. R0 = pointer to sprite area control block, or +1 for Wimp sprite area
  2186. R1 = pointer to Wimp_CreateWindow block
  2187.  
  2188. Sets the sprite area control block pointer of all the indirected, sprite-only
  2189. icons in the CreateWindow block to R0.
  2190.  
  2191.  
  2192.  
  2193. OS commands
  2194. ===========
  2195.  
  2196. WimpExtension provides the OS-command 'X'. This is used to execute other OS
  2197. commands, but any errors produced by that command will be ignored. This can
  2198. be useful in obey files. eg:
  2199.  
  2200.   X Delete <Obey$Dir>.Backup
  2201.   X Rename <Obey$Dir>.Data <Obey$Dir>.Backup
  2202.  
  2203. or
  2204.  
  2205.   X Run <Obey$Dir>.Title
  2206.   
  2207. WimpExtension also provides a command 'WimpExt Defaults'. This is used to
  2208. specify the default colours and slabbing time for 3D borders. The syntax is:
  2209.  
  2210.   *WimpExt Defaults <top-left> <bottom-right> <in> <channel>
  2211.                     <time> <sprite style>
  2212.  
  2213. The default defaults (ie. those used if you don't issue a WimpExt Defaults
  2214. command) are 4 0 14 12 15 0. This command is NOT to be used by your programs;
  2215. it is provided so that the user can decide what colour scheme THEY prefer.
  2216.  
  2217. This command can also be used if you don't like 3D borders; if you try
  2218.  
  2219.   *WimpExt Defaults 7 7 3 1 15 1
  2220.   
  2221. you will find that all the borders are now completely flat. (And it doesn't
  2222. look too bad, either.)
  2223.  
  2224. The sprite style parameter is 0 for 3D sprites, and 1 for flat sprites. This
  2225. allows you to choose whether you want flat or 3D sprites in WimpExtension
  2226. applications which take note of this value.
  2227.  
  2228. The Defaults command really is only to be used by the user, not by any
  2229. programs. It'll probably be removed in a later version of WimpExtenion, when
  2230. I put in the 'Style manager', which'll do all that WimpExt Defaults does and
  2231. a lot lot more (TM). :-)
  2232.  
  2233. BTW, There really IS a good reason for making it a bizarre two-worded
  2234. command. All will become clear later ;-)
  2235.  
  2236.  
  2237.  
  2238. Things possibly to be included in a later version...
  2239. ====================================================
  2240.  
  2241.    * Resizeable RamFS and common data area (very very useful)
  2242.    * List handling (quite useful when you come to think of it)
  2243.    * Fast text displayer (very useful)
  2244.    * Libraryification (quite literally, useful)  <--- COMING SOON (hopefully)
  2245.  
  2246. Plus anything else useful anybody comes up with...
  2247.  
  2248. Improving immediate windows is definitely Acorn's problem - the fact that
  2249. they are not provided in the Wimp is a major failing of the RISC OS desktop.
  2250. (Or rather, they ARE provided in the Wimp, Acorn just haven't provided a way
  2251. for us ordinary mortals to get at them.)
  2252.  
  2253. Aha! RISC OS 3 now provides immediate icons, but not immediate windows. I'll
  2254. add this into WimpExtension sometime, but I'm still waiting for immediate
  2255. windows in the OS... (Look, come on. All we need is a SWI Wimp_FinishRedraw.)
  2256.  
  2257. (Basically, by 2022 WimpExtension will be slightly larger than the solar
  2258. system and will have more features than are dreamt of in your philosophy.)
  2259.  
  2260.  
  2261.  
  2262. Thanks
  2263. ======
  2264.  
  2265.  
  2266. Thanks to Aiden Corey (hope I spelt that right) for helpful suggestions.
  2267.  
  2268. Thanks to Jon Thackray for disappearing off to Canterbury and claiming he's
  2269. poor when he quite blatantly bought an A410 and an ARM3 and a huge hard
  2270. drive, and Impression, and ...
  2271.  
  2272. Thanks to James Ponder for uploading stuff to BBSes ( :-)   <- that's a
  2273. smiley, for people who haven't used bulletin boards, I mean, I didn't know
  2274. what it was at first). James is really annoying and has a 14k4 modem, which
  2275. is silly.
  2276.  
  2277. Thanks to Mr. Clare, for looking mildly amused at whatever stunning programs
  2278. I pass his way...
  2279.  
  2280. Thanks to David Cox for being able to get me the SWI chunk for this module,
  2281. and being the first person other than me to use it in one of their programs.
  2282. (But certainly not the last ;-) )
  2283.  
  2284. Thanks to Ben Dooks for winning "Mr. Thinny" Contest three years running.
  2285.  
  2286. Thanks to Andrew Clover for not being eight feet tall.
  2287.  
  2288. Thanks to Acorn for making sprite and draw-file displaying so incredibly
  2289. complicated, and for making RISC OS so flexible, honest.
  2290.  
  2291. Finally, thanks to Ben Curthoys for generally complaining at me to get things
  2292. finished (maybe I WILL write a game someday), and for a black plastic bag.
  2293. (Which has now shuffled off this mortal coil :-( ).
  2294.  
  2295.  
  2296.  
  2297. Plugs
  2298. =====
  2299.  
  2300. Look out for other PD stuff by me... VEnd ... HourMake ... EliteCht ...
  2301. RoughTime IV ... SWI ... StopClock ... Quitter ... WimpHelp (coming soon!)
  2302. ...
  2303.  
  2304. Also, products from other members of DoggySoft...
  2305.  
  2306. The Hacker, only £5, the original and BEST games hacker - makes it incredibly
  2307. easy to create cheats for games. Many many wonderful features. Just press
  2308. Alt-Alt during the game, and The Hacker will pop up... (As seen in Acorn
  2309. Computing, BBC Acorn User and Archimedes World...:-) )
  2310.  
  2311. Diss, only £10, by far the best desktop disassembler available for the
  2312. Archimedes. Diss has FAR too many features to list them all here, but they
  2313. include:
  2314.   * Multiple files/multiple views
  2315.   * FAST disassembly with optional colour-coding
  2316.   * Labels - you can add labels to any address to aid disassembly.
  2317.      eg. Instead of:
  2318.       B       &381239471
  2319.      you get:
  2320.       B       mouse_click
  2321.   * Automatic un-squeezing of Squeezed files
  2322.   * Automatic labels generation for:
  2323.       Modules (eg. entry points, SWIs, OS commands, etc.)
  2324.       Shared C Library functions
  2325.       C programs
  2326.       BASIC in-line-assembler programs
  2327.       LINKed programs
  2328.       ABC programs
  2329.   * Search facilities (including search for reference (incredibly useful))
  2330. etc. etc. etc... Diss is invaluable for any serious programmer. (As seen in
  2331. Archimedes World. :-) )
  2332.  
  2333.  
  2334.  
  2335. Finally
  2336. =======
  2337.  
  2338. Any money, bug reports, information, demos, just about anything to:
  2339.  
  2340.                 Jon Ribbens
  2341.                 39 Nutkins Way
  2342.                 Chesham
  2343.                 Bucks.
  2344.                 HP5 2BE
  2345.  
  2346. I can also be reached on Arcade BBS, but don't hold your breath...
  2347.