Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199312.adf » !OmniDesk_OmniDesk » !SWI/!RunImage

!SWI/!RunImage

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199312.adf » !OmniDesk_OmniDesk
Filename: !SWI/!RunImage
Read OK:
File size: CB7A bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >!RunImage for SWI Index
   20:
   30VersionNumber$="1�03 (27 July 1993)":Taskname$="SWI�Index"
   40Exit=FALSE:Startup=FALSE:Done=FALSE
   50DoModeChange=FALSE
   60:
   70DIM Block 256,Buffer 256,MenuHelp 16,IconData 12
   80IndMenuMax=80:DIM IndirectMenuText IndMenuMax
   90DIM Templates 1636,InfoInd 190,LocInd 592,SaveInd 379
  100DIM IBMenu 76,MainMenu 172
  110DIM PRMMenu 220:REM Enough space for 8 entries
  120:
  130REM Messages used by the OmniDesk suite:
  140UtilDeclare=&825C0:UtilOpen=&825C1:UtilQuitting=&825C2:UtilReside=&825C3:UtilAckLoad=&825C4
  150REM These are official Acorn allocations.
  160:
  170ON ERROR Block!0=ERR:$(Block+4)=REPORT$+CHR$0:SYS "Wimp_ReportError",Block,1,Taskname$:END
  180:
  190OmniDesk=FNReadStartupString:REM Also assigns Exit and Startup
  200:
  210*Set SWIIndex$RISCOS 3
  220*RMEnsure UtilityModule 3.00 Set SWIIndex$RISCOS 2
  230SYS "XOS_ReadVarVal","SWIIndex$RISCOS",Block,256,0,0 TO ,,len:Block?len=13:wimp$=$Block
  240IF wimp$<>"3" THEN wimp$="2"
  250*Unset SWIIndex$RISCOS
  260:
  270*Set SWIIndex$SpriteDrag Yes
  280*RMEnsure DragASprite 0.00 Set SWIIndex$SpriteDrag No
  290SYS "XOS_ReadVarVal","SWIIndex$SpriteDrag",Block,256,0,0 TO ,,len:Block?len=13
  300IF $Block="Yes" THEN DragASprite=TRUE:ELSE DragASprite=FALSE
  310*Unset SWIIndex$SpriteDrag
  320:
  330SYS "XOS_ReadVarVal","Obey$Dir",Block,256,0,0 TO ,,len:Block?len=13:OurFileName$=$Block
  340N=-1:REPEAT:N+=1:UNTIL MID$(OurFileName$,LEN(OurFileName$)-N,1)="."
  350OurPathName$=LEFT$(OurFileName$,LEN(OurFileName$)-N):OurFileName$=RIGHT$(OurFileName$,N)
  360:
  370REM Read size of sprite file and load it. We need to DIM 16 bytes more than the file's size.
  380SYS "OS_FSControl",28,"<SWIIndex$Dir>.Sprites" TO ,,len
  390DIM Sprites len+16:!Sprites=len+16:Sprites!4=0:Sprites!8=16:Sprites!12=16:SYS "OS_SpriteOp",256+10,Sprites,"<SWIIndex$Dir>.Sprites"
  400:
  410IF wimp$="3" THEN
  420  DIM messagelist% 36
  430  messagelist%!0=&502:messagelist%!4=&400C1
  440  messagelist%!8=UtilOpen:messagelist%!12=UtilQuitting
  450  messagelist%!16=UtilReside:messagelist%!20=10
  460  messagelist%!24=4:messagelist%!28=2:messagelist%!32=0
  470  SYS "Wimp_Initialise",300,&4B534154,Taskname$,messagelist% TO wimp,Task
  480ELSE
  490  SYS "Wimp_Initialise",200,&4B534154,Taskname$ TO wimp,Task
  500ENDIF
  510:
  520SYS "Interface_Initialise",Task
  530:
  540SYS "Wimp_OpenTemplate",,"<SWIIndex$Dir>.Templates"
  550SYS "Wimp_LoadTemplate",,Templates,InfoInd,InfoInd+190,-1,"Info",0
  560SYS "Wimp_CreateWindow",,Templates TO Info
  570SYS "Wimp_LoadTemplate",,Templates,LocInd,LocInd+592,-1,"WindowXY",0:Templates!64=Sprites
  580SYS "Wimp_CreateWindow",,Templates TO Loc
  590SYS "Wimp_LoadTemplate",,Templates,SaveInd,SaveInd+379,-1,"Save",0
  600SYS "Wimp_CreateWindow",,Templates TO Save
  610SYS "Wimp_CloseTemplate"
  620:
  630PROCUpdateIcon(Save,4,"This Module"):FullSave=FALSE
  640PROCCleanUpLocWindow
  650ReadError=NOT(FNLoadSettings)
  660:
  670Title$="Modules|providing SWIs":DIM IndexMenuTitle LEN(Title$)+2:$IndexMenuTitle=Title$+CHR$13
  680IndexMenu=-1:REM Temporary: this will be assigned in PROCCreateIndexWindow
  690Index=-1:REM Temporary: this will be assigned in PROCScanModules
  700PROCBuildMenus
  710LargestPRM=FNBuildPRMMenu:ScannedModules=FALSE
  720:
  730PROCInitialise
  740PROCCreatePRMStore(LargestPRM)
  750PROCTickPRMchoice(PRM$)
  760PROCLoadPRMIndex(PRM$)
  770:
  780IF OmniDesk=0 THEN
  790  REM Put Icon on the icon-bar
  800  Block!0=-1
  810  Block!4=0:Block!8=0:Block!12=68:Block!16=68
  820  Block!20=&17003002:$(Block+24)="!SWI�Index"+CHR$13
  830  SYS "Wimp_CreateIcon",,Block TO IconBar
  840ENDIF
  850:
  860IF OmniDesk<>0 THEN PROCDeclareToOmniDesk
  870IF Startup THEN Done=TRUE:REM '-Startup' parameter means 'declare and die immediately'.
  880:
  890PROCUpdateIcon(Info,3,VersionNumber$)
  900PROCModeChange:REM To update icon-bar icon if necessary
  910:
  920ON ERROR PROCError
  930IF ReadError THEN ReadError=FALSE:PROCDefaultSettings:ERROR 9999,"An error occurred whilst reading the settings file. Default settings will therefore be used."
  940:
  950SYS "OS_ReadMonotonicTime" TO polltime%
  960:
  970REM Main program loop
  980REPEAT
  990  SYS "Wimp_PollIdle",%1100000110000,Block TO Reason
 1000  SYS "Interface_Poll",Reason,,Task
 1010  SYS "Interface_PreProcessKey",Reason,Block,Task
 1020  CASE Reason OF
 1030    WHEN 0 : SYS "OS_ReadMonotonicTime" TO polltime%
 1040             polltime%+=100:REM Do a Wimp_Poll approximately once a second
 1050             IF (Index<>-1) AND DoModeChange THEN IF FNOpenState(Index) THEN PROCOpen(Index,FALSE,XPosition,YPosition)
 1060    WHEN 1 : PROCRedraw
 1070    WHEN 2 : SYS "Wimp_OpenWindow",,Block
 1080    WHEN 3 : SYS "Wimp_CloseWindow",,Block
 1090             IF Exit THEN Done=TRUE
 1100    WHEN 6 : PROCMouseButton
 1110    WHEN 7 : PROCDragFinished
 1120    WHEN 8 : PROCKeyPressed
 1130    WHEN 9 : PROCDecodeMenu
 1140    WHEN 17,18,19 : PROCRecieveMessage
 1150  ENDCASE
 1160UNTIL Done
 1170PROCSayGoodbye
 1180END
 1190:
 1200DEF PROCError
 1210Click=0:Block!0=ERR:CASE ERR OF
 1220  WHEN 9999:REM Custom error
 1230    $(Block+4)=REPORT$+CHR$0
 1240    SYS "Wimp_ReportError",Block,17,"Notice from SWI Index"
 1250  OTHERWISE
 1260    $(Block+4)=REPORT$+" (internal error code "+STR$ERL+"). Click on OK to continue, or Cancel to terminate the program."+CHR$0
 1270    SYS "Wimp_ReportError",Block,3,Taskname$ TO ,Click
 1280ENDCASE
 1290IF Click=2 THEN PROCSayGoodbye:END
 1300ENDPROC
 1310:
 1320DEF PROCOpen(WindowHandle,TopOfStack,across,up)
 1330Block!0=WindowHandle
 1340SYS "Wimp_GetWindowState",,Block
 1350IF (across<>-1) AND (across<>-1) THEN PROCDecideWindowPosition(Block,across,up)
 1360IF TopOfStack THEN Block!28=-1
 1370SYS "Wimp_OpenWindow",,Block
 1380ENDPROC
 1390:
 1400DEF PROCClose(WindowHandle)
 1410Block!0=WindowHandle
 1420SYS "Wimp_GetWindowState",,Block
 1430SYS "Wimp_CloseWindow",,Block
 1440ENDPROC
 1450:
 1460DEF PROCDecideWindowPosition(Block,across,up)
 1470REM Use of this procedure lets you open windows on an invisible grid which
 1480REM automatically fits itself to the screen mode in use. There are five
 1490REM positions across (left, mid-left, centre, mid-right, right) and five
 1500REM positions up (bottom of screen, above icon-bar, centre of screen,
 1510REM centre top of screen, top of screen).
 1520  :
 1530Xpixels=FNModeInfo("XPixels",-1):Ypixels=FNModeInfo("YPixels",-1)
 1540XEigFactor=FNModeInfo("XEigFactor",-1):YEigFactor=FNModeInfo("YEigFactor",-1)
 1550  :
 1560top=Block!16:right=Block!12:bot=Block!8:left=Block!4
 1570SYS "Wimp_OpenWindow",,Block:SYS "Wimp_GetWindowOutline",,Block
 1580TB=((Block!16)-top)/(2^YEigFactor)
 1590VS=((Block!12)-right)/(2^XEigFactor)
 1600HS=(bot-(Block!8))/(2^YEigFactor)
 1610LP=(left-(Block!4))/(2^XEigFactor)
 1620REM LP is Left Pixel: normally present, but not if window is transparent.
 1630width=(right-left)/(2^XEigFactor)
 1640height=(top-bot)/(2^YEigFactor)
 1650CASE across OF
 1660  WHEN 0:x=LP
 1670  WHEN 1:x=LP+((Xpixels+1)-(width+LP+VS))/4
 1680  WHEN 2:x=LP+((Xpixels+1)-(width+LP+VS))/2
 1690  WHEN 3:x=LP+(3*(((Xpixels+1)-(width+LP+VS))/4))
 1700  WHEN 4:x=(Xpixels+1)-(width+VS)
 1710ENDCASE
 1720CASE up OF
 1730  WHEN 0:y=HS
 1740  WHEN 1:y=HS+(132/(2^YEigFactor))
 1750  WHEN 2:y=HS+((Ypixels+1)-(height+TB+HS))/2
 1760  WHEN 3:y=HS+(3*(((Ypixels+1)-(height+TB+HS))/4))
 1770  WHEN 4:y=(Ypixels+1)-(height+TB)
 1780ENDCASE
 1790REM Above coordinates position window.
 1800REM Now convert to screen coordinates:
 1810x=x*(2^XEigFactor):y=y*(2^YEigFactor)
 1820width=width*(2^XEigFactor):height=height*(2^YEigFactor)
 1830Block!12=x+width:Block!4=x
 1840Block!16=y+height:Block!8=y
 1850ENDPROC
 1860:
 1870REM -------------------------------------------------------------------------
 1880REM Wimp poll routines
 1890REM -------------------------------------------------------------------------
 1900:
 1910DEF PROCRedraw
 1920IF DoModeChange AND (Index<>-1) THEN
 1930  REM Re-opening windows need an extra wimp_poll to happen after the mode change in order to work:
 1940  IF FNOpenState(Index) THEN PROCOpen(Index,FALSE,XPosition,YPosition)
 1950  DoModeChange=FALSE
 1960ENDIF
 1970SYS "Wimp_RedrawWindow",,Block TO flag
 1980WHILE flag
 1990  SYS "Interface_Render3dWindow",,Block
 2000  SYS "Wimp_GetRectangle",,Block TO flag
 2010ENDWHILE
 2020ENDPROC
 2030:
 2040DEF PROCRecieveMessage
 2050CASE Block!16 OF
 2060  WHEN 0 : Done=TRUE
 2070  WHEN 2 : REM We're saving out to another application or to the filer.
 2080           REM We've just received acknowledgement to go ahead and save.
 2090           FileName$="":N=44:WHILE ((Block?N)>=32) AND (N<256):FileName$+=CHR$(Block?N):N+=1:ENDWHILE
 2100           IF NOT FNSaveSWIListToFile(FileName$) THEN PROCDeleteWimpScrap:ERROR 9999,"An error occurred whilst saving the file."
 2110           Block!12=Block!8:Block!16=3:SYS "Wimp_SendMessage",17,Block,Block!4
 2120           MyRef=-1:REM Invalidate once again, until our next save out.
 2130           IF FileName$<>"<Wimp$Scrap>" THEN
 2140             PROCUpdateIcon(Save,2,FileName$)
 2150             REM Put full filename into save box
 2160           ENDIF
 2170  WHEN 4 : REM We have saved the SWI List file, and are receiving acknowledgement.
 2180           REM We don't need to actually do anything except close the menu.
 2190           SYS "Wimp_CreateMenu",,-1
 2200  WHEN 10: IF OmniDesk=0 THEN PROCSaveDesktop(Block!20)
 2210           REM Only save if we have not been started up by OmniDesk
 2220  WHEN &502 : PROCHelp
 2230  WHEN &400C1 : PROCModeChange
 2240  WHEN UtilOpen : IF $(Block+24)=Taskname$ THEN PROCOmniDeskCalling
 2250  WHEN UtilQuitting : IF OmniDesk<>0 THEN
 2260                        IF Block!20=OmniDesk THEN Done=TRUE
 2270                      ENDIF
 2280  WHEN UtilReside : Exit=FALSE
 2290ENDCASE
 2300ENDPROC
 2310:
 2320DEF PROCDeleteWimpScrap
 2330LOCAL ERROR
 2340ON ERROR LOCAL RESTORE ERROR:ENDPROC
 2350REM We may receive try to delete a non-existant Wimp$Scrap
 2360REM file if the receiving task did not recognise the filetype.
 2370OSCLI("Delete <Wimp$Scrap>")
 2380ENDPROC
 2390:
 2400DEF PROCMouseButton
 2410MouseX=Block!0:MouseY=Block!4:Buttons=Block!8
 2420Window=Block!12:Icon=Block!16
 2430CASE Window OF
 2440  WHEN -2:REM Icon bar icon clicked
 2450    CASE Buttons OF
 2460      WHEN 1 : REM Adjust
 2470      WHEN 2 : REM Menu
 2480        M%=IBMenu:MenuX=MouseX:MenuY=MouseY:PROCMakeMenu
 2490      WHEN 4 : REM Select
 2500        IF NOT ScannedModules THEN PROCScanModules
 2510        IF Index=-1 THEN Index=FNCreateIndexWindow(0,TRUE)
 2520        PROCOpen(Index,TRUE,XPosition,YPosition)
 2530    ENDCASE
 2540  WHEN Index
 2550    CASE Buttons OF
 2560      WHEN 1 : REM Adjust
 2570      WHEN 2 : REM Menu
 2580        M%=MainMenu:MenuX=MouseX:MenuY=MouseY
 2590        IF wimp>=310 THEN
 2600          IF LEFT$($MainMenuTitle,1)="\" THEN $MainMenuTitle=RIGHT$($MainMenuTitle,LEN($MainMenuTitle)-1)+CHR$13
 2610          IF XPosition=4 THEN $MainMenuTitle="\"+$MainMenuTitle+CHR$13
 2620        ENDIF
 2630        PROCMakeMenu
 2640      WHEN 4 : REM Select
 2650    ENDCASE
 2660  WHEN Loc AND Buttons<8:REM Reposition main window
 2670    IF Icon>=6 THEN
 2680      XPosition=FNReadWindowLocation("X")
 2690      YPosition=FNReadWindowLocation("Y")
 2700      IF FNOpenState(Index) THEN PROCOpen(Index,FALSE,XPosition,YPosition)
 2710    ENDIF
 2720  WHEN Save
 2730    CASE Icon OF
 2740      WHEN 1:REM File icon
 2750        IF Buttons>=8 THEN
 2760          IF DragASprite THEN
 2770            REM The following lines delete the file icon from the save window,
 2780            REM giving the impression that you are actually dragging it out.
 2790            REM It will be replaced in PROCDragFinished.
 2800            Block!0=Save:Block!4=1:SYS "Wimp_GetIconState",,Block
 2810            SaveBoxDragFile$=$(Block!32)
 2820            Block!8=0:Block!12=0:$(Block!32)=CHR$13
 2830            SYS "Wimp_SetIconState",,Block
 2840          ENDIF
 2850          PROCDragBox(Save,1,5,1,"file_fff")
 2860        ENDIF
 2870      WHEN 3:REM OK icon
 2880        IF (Buttons<8) AND (Buttons<>2) THEN
 2890          SYS "Interface_SlabButton",,Block
 2900          IF Buttons<>1 THEN SYS "Wimp_CreateMenu",,-1
 2910          A$=FNReadIconStr(Save,2):IF A$="" THEN A$="SWI�List"
 2920          PROCUpdateIcon(Save,2,A$)
 2930          IF INSTR(A$,".")=0 THEN Block!8=0:Block!12=Save:Block!16=3:SYS "Interface_SlabButton",,Block:ERROR 9999,"To save, drag the icon to a directory display."
 2940          IF NOT FNSaveSWIListToFile(A$) THEN PROCDeleteWimpScrap:Block!8=0:Block!12=Save:Block!16=3:SYS "Interface_SlabButton",,Block:ERROR 9999,"An error occurred whilst saving the file."
 2950          Block!8=0:Block!12=Save:Block!16=3:SYS "Interface_SlabButton",,Block
 2960        ENDIF
 2970      WHEN 4:REM Switch icon
 2980        IF (Buttons<8) AND (Buttons<>2) THEN
 2990          SYS "Interface_SlabButton",,Block
 3000          A$=FNReadIconStr(Save,4):IF A$="This Module" THEN A$="All Modules" ELSE A$="This Module"
 3010          PROCUpdateIcon(Save,4,A$)
 3020          FullSave=NOT FullSave
 3030          Block!8=0:Block!12=Save:Block!16=4:SYS "Interface_SlabButton",,Block
 3040        ENDIF
 3050    ENDCASE
 3060ENDCASE
 3070ENDPROC
 3080:
 3090DEF PROCDragFinished
 3100IF DragASprite THEN
 3110  SYS "DragASprite_Stop"
 3120  REM The following lines replace the sprite in the save box.
 3130  Block!0=Save:Block!4=1:SYS "Wimp_GetIconState",,Block
 3140  Block!8=0:Block!12=0:$(Block!32)=SaveBoxDragFile$
 3150  SYS "Wimp_SetIconState",,Block
 3160ENDIF
 3170SYS "Wimp_GetPointerInfo",,Block
 3180IF Block!12=-1 THEN ENDPROC:REM Dragged to background.
 3190DraggedToX=Block!0:DraggedToY=Block!4:DraggedToWindow=Block!12:DraggedToIcon=Block!16
 3200REM Find out leaf name in save box:
 3210Dragging$=FNReadIconStr(Save,2):len=LEN(Dragging$)
 3220N=-1:REPEAT:N+=1:UNTIL (MID$(Dragging$,LEN(Dragging$)-N,1)=".") OR (N=len)
 3230IF N<len THEN Dragging$=RIGHT$(Dragging$,N)
 3240IF Dragging$="" THEN Dragging$="SWI�List":PROCUpdateIcon(Save,2,Dragging$)
 3250REM OK - Let's begin an inter-application save
 3260MyRef=0
 3270Block!0=256:Block!12=MyRef:Block!16=1:REM DataSave
 3280Block!20=DraggedToWindow:Block!24=DraggedToIcon:Block!28=DraggedToX:Block!32=DraggedToY
 3290Block!36=-1:REM No idea what the size is going to be
 3300Block!40=&FFF:REM Filetype of Text
 3310$(Block+44)=Dragging$+CHR$0
 3320SYS "Wimp_SendMessage",17,Block,DraggedToWindow,DraggedToIcon
 3330REM DraggedToIcon included in case DraggedToWindow=-2 (icon bar)
 3340ENDPROC
 3350:
 3360DEF PROCKeyPressed
 3370Window=Block!0:Icon=Block!4:Character=Block!24
 3380CASE Window OF
 3390  WHEN Save:
 3400    IF Character=13 THEN
 3410      Block!8=4:Block!12=Save:Block!16=3:SYS "Interface_SlabButton",,Block
 3420      A$=FNReadIconStr(Save,2):IF A$="" THEN A$="SWI�List"
 3430      PROCUpdateIcon(Save,2,A$)
 3440      IF INSTR(A$,".")=0 THEN Block!8=0:Block!12=Save:Block!16=3:SYS "Interface_SlabButton",,Block:ERROR 9999,"To save, drag the icon to a directory display."
 3450      IF NOT FNSaveSWIListToFile(A$) THEN PROCDeleteWimpScrap:Block!8=0:Block!12=Save:Block!16=3:SYS "Interface_SlabButton",,Block:ERROR 9999,"An error occurred whilst saving the file."
 3460      Block!8=0:Block!12=Save:Block!16=3:SYS "Interface_SlabButton",,Block
 3470      SYS "Wimp_CreateMenu",,-1
 3480    ELSE
 3490      SYS "Wimp_ProcessKey",Character
 3500    ENDIF
 3510  OTHERWISE
 3520    SYS "Wimp_ProcessKey",Character
 3530ENDCASE
 3540ENDPROC
 3550:
 3560DEF PROCDecodeMenu
 3570Sub0=Block!0:Sub1=Block!4:Sub2=Block!8
 3580CloseMenu=FALSE
 3590CASE M% OF
 3600  WHEN IBMenu:
 3610    CASE Sub0 OF
 3620      WHEN 0
 3630        SYS "Wimp_GetPointerInfo",,Block
 3640        SYS "Wimp_CreateMenu",,Info,Block!0-24,Block!4+24
 3650        CloseMenu=TRUE
 3660      WHEN 1
 3670        Done=TRUE
 3680    ENDCASE
 3690  WHEN MainMenu:
 3700    CASE Sub0 OF
 3710      WHEN 0
 3720        SYS "Wimp_GetPointerInfo",,Block
 3730        SYS "Wimp_CreateMenu",,Info,Block!0-24,Block!4+24
 3740        CloseMenu=TRUE
 3750      WHEN 1
 3760        CASE Sub1 OF
 3770          WHEN -1:REM Do nothing
 3780          WHEN 0:PROCScanModules
 3790                 CloseMenu=TRUE
 3800                 Index=FNCreateIndexWindow(0,FALSE)
 3810                 PROCOpen(Index,FALSE,XPosition,YPosition)
 3820                 PROCOpen(Index,FALSE,XPosition,YPosition)
 3830          OTHERWISE
 3840            IF NOT FNMenuTicked(IndexMenu,Sub1) THEN
 3850              Index=FNCreateIndexWindow(Sub1-1,TRUE)
 3860              FOR N=1 TO TotalModules
 3870                PROCTickMenu(IndexMenu,N,N=Sub1)
 3880              NEXT
 3890              PROCOpen(Index,FALSE,XPosition,YPosition)
 3900              PROCOpen(Index,FALSE,XPosition,YPosition)
 3910            ENDIF
 3920        ENDCASE
 3930      WHEN 2
 3940        IF Sub1<>-1 THEN
 3950          A$=$(PRMMenu+28+(24*Sub1)+12)
 3960          IF A$<>PRM$ THEN
 3970            PRM$=A$
 3980            M%=PRMMenu+4
 3990            Counter=-1
 4000            REPEAT
 4010              Counter+=1:M%+=24
 4020              PROCTickMenu(PRMMenu,Counter,Counter=Sub1)
 4030            UNTIL ((M%!0) AND 128)=128
 4040            PROCLoadPRMIndex(PRM$)
 4050            Counter=0
 4060            REPEAT:Counter+=1:UNTIL FNMenuTicked(IndexMenu,Counter)
 4070            Index=FNCreateIndexWindow(Counter-1,FALSE)
 4080            PROCOpen(Index,FALSE,XPosition,YPosition)
 4090            PROCOpen(Index,FALSE,XPosition,YPosition)
 4100          ENDIF
 4110          M%=MainMenu
 4120        ENDIF
 4130      WHEN 3
 4140        SYS "Wimp_GetPointerInfo",,Block
 4150        SYS "Wimp_CreateMenu",,Loc,Block!0-24,Block!4+24
 4160        CloseMenu=TRUE
 4170      WHEN 4
 4180        SYS "Wimp_GetPointerInfo",,Block
 4190        SYS "Wimp_CreateMenu",,Save,Block!0-146,Block!4+60
 4200        CloseMenu=TRUE
 4210      WHEN 5
 4220        IF NOT FNSaveSettings THEN ERROR 9999,"An error occurred whilst writing the settings file."
 4230    ENDCASE
 4240ENDCASE
 4250SYS "Wimp_GetPointerInfo",,Block
 4260IF ((Block!8 AND 1)=1) AND (NOT CloseMenu) THEN PROCMakeMenu
 4270ENDPROC
 4280:
 4290REM -------------------------------------------------------------------------
 4300REM Menu routines
 4310REM -------------------------------------------------------------------------
 4320:
 4330DEF PROCBuildMenus
 4340REM This procedure should only be visited once, since it contains DIMs.
 4350  :
 4360REM In the menu title strings below, if a "|" character is present it will be
 4370REM replaced by a space under RISC OS 3.1 (or greater), or will terminate the
 4380REM string under earlier versions of the wimp. This allows the new indirected
 4390REM menu titles to be used (which were introduced with RISC OS 3.1).
 4400  :
 4410IndirectMenuTextOffsetPointer=0
 4420REM This points to a pool to be used by all menus for their indirected text.
 4430  :
 4440M%=IBMenu
 4450Title$="SWI Index":DIM IBMenuTitle LEN(Title$)+1:$IBMenuTitle=Title$+CHR$13
 4460PROCMenuInit(IBMenuTitle)
 4470PROCMenuItem("Info",0,Info)
 4480PROCMenuItem("Quit",128,-1)
 4490  :
 4500M%=MainMenu
 4510Title$="SWI Index":DIM MainMenuTitle LEN(Title$)+2:$MainMenuTitle=Title$+CHR$13
 4520PROCMenuInit(MainMenuTitle)
 4530PROCMenuItem("Info",2,Info)
 4540PROCMenuItem("Module index",0,IndexMenu)
 4550PROCMenuItem("PRM page index",0,PRMMenu)
 4560PROCMenuItem("Window position",2,Loc)
 4570PROCMenuItem("Save SWI list",0,Save)
 4580PROCMenuItem("Save settings",128,-1)
 4590ENDPROC
 4600:
 4610DEF PROCMakeMenu
 4620IF MenuX<0 THEN MenuX=0
 4630IF MenuY<184 THEN MenuY=184:REM for icon bar
 4640SYS "Wimp_CreateMenu",,M%,MenuX-((36+M%!16)/2),MenuY
 4650ENDPROC
 4660:
 4670DEF PROCMenuInit(MenuTitle)
 4680IF wimp>=310 THEN
 4690  A=INSTR($MenuTitle,"|"):IF A<>0 THEN ?(MenuTitle+(A-1))=32
 4700  MenuMax=LEN($MenuTitle)
 4710  M%!0=MenuTitle
 4720ELSE
 4730  A=INSTR($MenuTitle,"|"):IF A<>0 THEN ?(MenuTitle+(A-1))=13
 4740  MenuMax=LEN(LEFT$($MenuTitle,12))
 4750  $M%=LEFT$($MenuTitle,12)
 4760ENDIF
 4770M%?12=7:M%?13=2:M%?14=11:M%?15=0
 4780M%!16=MenuMax*16
 4790M%!20=44:M%!24=0
 4800P%=M%+28
 4810ENDPROC
 4820:
 4830DEF PROCMenuItem(Text$,Flags,Link)
 4840REM Flags: 1-ticked, 2-dashed line, 4-writeable, 8-message, 128-last item
 4850REM Link: menu or window handle for sub-pointer
 4860P%!0=Flags:P%!4=Link
 4870IF LEN(Text$)<=12 THEN
 4880  P%!8=&07003021:REM Not indirected
 4890  $(P%+12)=Text$
 4900ELSE
 4910  P%!8=&07003121:REM Indirected
 4920  P%!12=IndirectMenuText+IndirectMenuTextOffsetPointer
 4930  P%!16=0:P%!20=0
 4940  $(IndirectMenuText+IndirectMenuTextOffsetPointer)=Text$+CHR$13
 4950  IndirectMenuTextOffsetPointer+=LEN(Text$)+1
 4960  IF IndirectMenuTextOffsetPointer>IndMenuMax THEN ERROR 0,"The indirect menu text buffer has overflowed. Please allocate more space."
 4970ENDIF
 4980P%+=24
 4990IF MenuMax<LEN(Text$) THEN MenuMax=LEN(Text$):M%!16=(MenuMax+1)*16
 5000IF (Flags=128) AND (wimp>=310) THEN M%!28=(((M%!28) AND NOT 256) EOR 256)
 5010  REM Indirected menu titles for RISC OS 3.1 upwards.
 5020ENDPROC
 5030:
 5040REM -------------------------------------------------------------------------
 5050REM Responses to incoming wimp messages
 5060REM -------------------------------------------------------------------------
 5070:
 5080DEF PROCSaveDesktop(File)
 5090LOCAL ERROR
 5100ON ERROR LOCAL Block!12=Block!8:SYS "Wimp_SendMessage",19,Block,Block!4:RESTORE ERROR:ENDPROC
 5110REM The above line acknowledges the message if an error occurs, thereby
 5120REM aborting the desktop save.
 5130BPUT#File,"Run "+OurPathName$+OurFileName$
 5140ENDPROC
 5150:
 5160DEF PROCHelp
 5170Block!12=Block!8:Block!16=&503:HelpInfo=Block+20
 5180  :
 5190REM Block!32 gives window, Block!36 gives icon
 5200  :
 5210CASE Block!32 OF
 5220  WHEN -2:PROCSend("This is the SWI Index icon.")
 5230          PROCSend("Click MENU for information or to quit.")
 5240          PROCSend("Click SELECT to open the SWI Index window.")
 5250  WHEN Index:PROCSend("This window displays all the SWI calls provided by a module, and their page references if they are documented in the Programmer's Reference Manual.")
 5260             PROCSend("The word on the raised border is the SWI prefix.")
 5270             PROCSend("Click MENU for the main menu.")
 5280  WHEN Info:PROCSend("This window displays information about SWI Index.")
 5290            PROCSend("SWI Index is a member of the OmniDesk Suite of desktop utilities.")
 5300  WHEN Loc:
 5310   CASE TRUE OF
 5320     WHEN ((Block!36)<6):PROCSend("This window lets you snap the magnifier window to an invisble screen grid.")
 5330                         PROCSend("The second position up puts the window just above the icon-bar, and is therefore not evenly spaced with the other rows.")
 5340     OTHERWISE PROCSend("Click SELECT on the position you want the window to snap to, or ADJUST on the window icon to turn the snapping off.")
 5350               PROCSend("If snapping is on, the window will open at the appropriate position when you change mode.")
 5360   ENDCASE
 5370 WHEN Save:
 5380   CASE Block!36 OF
 5390     WHEN 0:PROCSend("Drag the file icon to a filer window or to another application which can accept text files, or enter a filename and click OK (or press RETURN) to save.")
 5400     WHEN 1:PROCSend("Drag this icon to a filer window or to another application which can accept text files.")
 5410     WHEN 2:PROCSend("Enter a filename here and click OK (or press RETURN) to save, or drag the file icon to a filer window or to another application which can accept text files.")
 5420     WHEN 3:PROCSend("Click OK (or press RETURN) to save the file, or drag the file icon to a filer window or to another application which can accept text files.")
 5430     WHEN 4:PROCSend("Click SELECT or ADJUST to toggle between saving details of just the displayed module or of all currently loaded modules.")
 5440     OTHERWISE PROCSend("This is the Save window.")
 5450               PROCSend("The file saved will either contain details of the SWI calls provided by the displayed module or by all modules, depending on the setting of the switch at the bottom of the window.")
 5460   ENDCASE
 5470OTHERWISE
 5480  IF wimp>=217 THEN
 5490    MenuHelp!0=-1:MenuHelp!4=-1:MenuHelp!8=-1
 5500    SYS "Wimp_GetMenuState",1,MenuHelp,Block!32,Block!36
 5510    CASE M% OF
 5520      WHEN IBMenu:
 5530        IF MenuHelp!4=-1 THEN
 5540          CASE MenuHelp!0 OF
 5550            WHEN 0:PROCSend("Move the pointer right to see information about SWI Index.")
 5560            WHEN 1:PROCSend("Click SELECT to quit SWI Index.")
 5570            OTHERWISE PROCSend("This is the SWI Index icon-bar menu.")
 5580          ENDCASE
 5590        ENDIF
 5600      WHEN MainMenu:
 5610        Direction$="right":IF wimp>=310 AND CHR$(MainMenuTitle?0)="\" THEN Direction$="left"
 5620        CASE MenuHelp!0 OF
 5630          WHEN 0:PROCSend("Move the pointer "+Direction$+" to see information about SWI Index.")
 5640          WHEN 1:CASE MenuHelp!4 OF
 5650                   WHEN -1:PROCSend("The module index menu contains a list of the currently loaded modules which provide SWI calls.")
 5660                   WHEN 0:PROCSend("Click SELECT or ADJUST to update the list of modules.")
 5670                   OTHERWISE PROCSend("Click SELECT or ADJUST to display details of this module's SWI calls in the main SWI Index window.")
 5680                 ENDCASE
 5690          WHEN 2:PROCSend("Choose your edition of the Programmer's Reference Manual from the PRM Edition sub-menu.")
 5700                 PROCSend("The page references in the SWI Index window will be updated as appropriate.")
 5710          WHEN 3:PROCSend("Move the pointer "+Direction$+" to set the position of the SWI Index window on the screen.")
 5720          WHEN 4:PROCSend("Move the pointer "+Direction$+" to save details of the SWI calls provided by this module, or by all modules.")
 5730          WHEN 5:PROCSend("Click SELECT or ADJUST to save the SWI Index window position and the selected PRM edition.")
 5740          OTHERWISE PROCSend("This is the SWI Index main menu.")
 5750        ENDCASE
 5760    ENDCASE
 5770  ENDIF
 5780ENDCASE
 5790  :
 5800?HelpInfo=0
 5810Block!0=(HelpInfo+4-Block) AND NOT 3
 5820SYS "Wimp_SendMessage",17,Block,Block!4
 5830ENDPROC
 5840:
 5850DEF FNOmniHelpMessage(A$)
 5860IF A$="CLICK" THEN =LEFT$("open the SWI Index window.",76)+CHR$13
 5870IF A$="DRAG" THEN =LEFT$("",76)+CHR$13
 5880=""
 5890:
 5900DEF PROCSend(Text$)
 5910$HelpInfo=Text$+"|M"
 5920HelpInfo+=LEN(Text$)+2
 5930ENDPROC
 5940:
 5950DEF PROCOmniDeskCalling
 5960IF OmniDesk=0 THEN ENDPROC
 5970REM This first line is for if a broadcast message is received which was
 5980REM intended for a transient copy of the utility. A stand-alone
 5990REM instantiation of the utility should ignore such messages.
 6000CASE Block!20 OF
 6010  WHEN 4:IF NOT ScannedModules THEN PROCScanModules
 6020         IF Index=-1 THEN Index=FNCreateIndexWindow(0,TRUE)
 6030         PROCOpen(Index,TRUE,XPosition,YPosition)
 6040ENDCASE
 6050ENDPROC
 6060:
 6070DEF PROCModeChange
 6080DoModeChange=TRUE
 6090IF OmniDesk=0 THEN PROCUpdateIconForMode("!SWI�Index",-2,IconBar)
 6100ENDPROC
 6110:
 6120REM -------------------------------------------------------------------------
 6130REM General non-specific useful routines (mostly wimp)
 6140REM -------------------------------------------------------------------------
 6150:
 6160DEF PROCUpdateIcon(Wndw,Icn,Txt$)
 6170Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 6180IF LEN(Txt$)>(Block!36)-1 THEN
 6190  IF ((Block!24) AND (1<<9))=(1<<9) THEN
 6200    REM Right-justified
 6210    Txt$="�"+RIGHT$(Txt$,(Block!36)-2)
 6220  ELSE
 6230    REM Left-justified or centred
 6240    Txt$=LEFT$(Txt$,(Block!36)-1):RIGHT$(Txt$)="�"
 6250  ENDIF
 6260ENDIF
 6270REM ^ Ensures the text can't overflow the maximum space in the icon.
 6280IF $(Block!28)<>Txt$ THEN
 6290  $(Block!28)=Txt$:Block!8=0:Block!12=0
 6300  SYS "Wimp_SetIconState",,Block
 6310ENDIF
 6320SYS "Wimp_GetCaretPosition",,Block
 6330IF Block!0=Wndw AND Block!4=Icn THEN
 6340  REM If this icon owns the caret, then put it at the end.
 6350  SYS "Wimp_SetCaretPosition",Wndw,Icn,0,0,-1,LEN(Txt$)
 6360ENDIF
 6370ENDPROC
 6380:
 6390DEF PROCUpdateIconColour(Wndw,Icn,FCol,BCol)
 6400REM Change an icon's colours
 6410Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 6420IF (((Block?27)>>4)=BCol) AND (((Block?27) MOD 16)=FCol) THEN ENDPROC
 6430  REM ^ Same colour, so don't change.
 6440Block!12=(%11111111<<24):Block!8=(BCol<<28)+(FCol<<24)
 6450SYS "Wimp_SetIconState",,Block
 6460ENDPROC
 6470:
 6480DEF PROCUpdateSelectedFlag(Wndw,Icn,State)
 6490REM Use State=TRUE to make icon become selected
 6500Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 6510IF ((Block!24) AND (1<<21))=((-State)<<21) THEN ENDPROC
 6520Block!12=(1<<21):IF State THEN Block!8=(1<<21) ELSE Block!8=(0<<21)
 6530SYS "Wimp_SetIconState",,Block
 6540ENDPROC
 6550:
 6560DEF PROCUpdateShadedFlag(Wndw,Icn,State)
 6570REM Use State=TRUE to make icon become shaded
 6580Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 6590IF ((Block!24) AND (1<<22))=((-State)<<22) THEN ENDPROC
 6600Block!12=(1<<22):IF State THEN Block!8=(1<<22) ELSE Block!8=(0<<22)
 6610SYS "Wimp_SetIconState",,Block
 6620ENDPROC
 6630:
 6640DEF FNSelectedState(Wndw,Icn)
 6650Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 6660IF ((Block!24) AND (1<<21))=(1<<21) THEN =TRUE
 6670=FALSE
 6680:
 6690DEF FNShadedState(Wndw,Icn)
 6700Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 6710IF ((Block!24) AND (1<<22))=(1<<22) THEN =TRUE
 6720=FALSE
 6730:
 6740DEF FNOpenState(Wndw)
 6750REM Returns TRUE if window is open; false otherwise
 6760Block!0=Wndw:SYS "Wimp_GetWindowState",,Block
 6770IF ((Block!32) AND (1<<16))=(1<<16) THEN =TRUE
 6780=FALSE
 6790:
 6800DEF PROCShadeMenu(Menu,Item,State)
 6810!(Menu+28+(24*Item)+8)=(!(Menu+28+(24*Item)+8) AND NOT (1<<22)) EOR ((-State)<<22)
 6820ENDPROC
 6830:
 6840DEF PROCTickMenu(Menu,Item,State)
 6850!(Menu+28+(24*Item))=(!(Menu+28+(24*Item)) AND NOT 1) EOR (-State)
 6860ENDPROC
 6870:
 6880DEF FNMenuShaded(Menu,Item)
 6890IF (!(Menu+28+(24*Item)+8) AND (1<<22))=(1<<22) THEN =TRUE
 6900=FALSE
 6910:
 6920DEF FNMenuTicked(Menu,Item)
 6930IF (!(Menu+28+(24*Item)) AND 1)=1 THEN =TRUE
 6940=FALSE
 6950:
 6960DEF FNReadIcon(Wndw,Icn)
 6970REM Read numeric value of icon
 6980Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 6990=VAL($(Block!28))
 7000:
 7010DEF FNReadIconStr(Wndw,Icn)
 7020REM Read string value of icon
 7030Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 7040=$(Block!28)
 7050:
 7060DEF FNModeInfo(var$,mode)
 7070REM Use mode=-1 for current screen mode
 7080CASE var$ OF
 7090  WHEN "XPixels":SYS "OS_ReadModeVariable",mode,11 TO ,,var
 7100  WHEN "YPixels":SYS "OS_ReadModeVariable",mode,12 TO ,,var
 7110  WHEN "NCol":SYS "OS_ReadModeVariable",mode,3 TO ,,var
 7120  WHEN "XEigFactor":SYS "OS_ReadModeVariable",mode,4 TO ,,var
 7130  WHEN "YEigFactor":SYS "OS_ReadModeVariable",mode,5 TO ,,var
 7140  WHEN "BPP":SYS "OS_ReadModeVariable",mode,9 TO ,,var:var=2^var
 7150  OTHERWISE var=-1:REM Fall-through for a faulty input value
 7160ENDCASE
 7170=var
 7180:
 7190DEF PROCUpdateIconForMode(Appname$,Wndw,Icn)
 7200REM This procedure requires that ALL the icon sprites are defined in mode 20
 7210REM or mode 27 (which is equivalent) with a mask but no palette. They should
 7220REM still appear to have the expected resolutions and number of colours, i.e
 7230REM !Sprites23: two colours, high resolution, !Sprites (actually !Sprites24)
 7240REM at mode 12 resolution (double height pixels) in 16 colours, and normal
 7250REM mode 20 resolution, 16 colours for the !Sprites22 icon. If this is not
 7260REM adhered to, then memory shortage errors may occur on a mode change.
 7270Extension$="24"
 7280IF FNModeInfo("YEigFactor",-1)<2 THEN
 7290  IF FNModeInfo("NCol",-1)>2 THEN
 7300    Extension$="22"
 7310  ELSE
 7320    Extension$="23"
 7330  ENDIF
 7340ENDIF
 7350SYS "Wimp_BaseOfSprites" TO ,iconsprite%
 7360SYS "OS_SpriteOp",256+25,iconsprite%,Appname$:REM Delete icon sprite
 7370REM The following three lines assume a mask but no palette:
 7380SYS "OS_SpriteOp",256+40,Sprites,Appname$+Extension$ TO ,,,w,h,,mode:REM Get info about new sprite
 7390SYS "OS_SpriteOp",256+15,iconsprite%,Appname$,0,w,h,mode:REM Create replacement icon sprite
 7400SYS "OS_SpriteOp",256+29,iconsprite%,Appname$:REM Create mask
 7410  :
 7420REM Paint sprite mask into iconsprite mask:
 7430SYS "OS_SpriteOp",256+61,iconsprite%,Appname$,0 TO r0,r1,r2,r3:REM Output to mask
 7440SYS "OS_SpriteOp",256+49,Sprites,Appname$+Extension$,0,0:REM Paint mask from Sprites
 7450GCOL 4,128:CLG:REM Invert to make mask the right way round
 7460SYS "OS_SpriteOp",r0,r1,r2,r3:REM Reset screen output
 7470  :
 7480REM Paint sprite into iconsprite:
 7490SYS "OS_SpriteOp",256+60,iconsprite%,Appname$,0 TO r0,r1,r2,r3:REM Output to new icon sprite
 7500SYS "OS_SpriteOp",256+34,Sprites,Appname$+Extension$,0,0,8:REM Paint copy from Sprites
 7510SYS "OS_SpriteOp",r0,r1,r2,r3:REM Reset screen output
 7520Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 7530Block!8=0:Block!12=0:SYS "Wimp_SetIconState",,Block:REM Re-plot icon
 7540ENDPROC
 7550:
 7560DEF FNCreateWindow(minX,minY,maxX,maxY,Xoffset,Yoffset,Handle,Flags,TitleCol,TitleBackCol,WorkCol,WorkBackCol,ScrollCol,SliderCol,InputCol,WminX,WminY,WmaxX,WmaxY,TitleFlags,Wbutton,SpritePoint,MinW,MinH,TitleData$)
 7570Block!0=minX:Block!4=minY:Block!8=maxX:Block!12=maxY:Block!16=Xoffset:Block!20=Yoffset
 7580Block!24=Handle:Block!28=Flags
 7590Block?32=TitleCol:Block?33=TitleBackCol:Block?34=WorkCol:Block?35=WorkBackCol
 7600Block?36=ScrollCol:Block?37=SliderCol:Block?38=InputCol:Block?39=0
 7610Block!40=WminX:Block!44=WminY:Block!48=WmaxX:Block!52=WmaxY
 7620Block!56=TitleFlags:Block!60=Wbutton:Block!64=SpritePoint
 7630Block!68=(MinH<<15)+MinW :::::::::::: REM 0,0 sets the minimum window with to the title width
 7640$(Block+72)=TitleData$:Block!84=0 ::: REM No icons initially
 7650SYS "Wimp_CreateWindow",,Block TO WindowHandle
 7660=WindowHandle
 7670:
 7680DEF FNCreateIcon(WindowHandle,minX,minY,maxX,maxY,Flags,IconData)
 7690Block!0=WindowHandle
 7700Block!4=minX:Block!8=minY:Block!12=maxX:Block!16=maxY:Block!20=Flags
 7710Block!24=IconData!0:Block!28=IconData!4:Block!32=IconData!8
 7720SYS "Wimp_CreateIcon",,Block TO IconHandle
 7730=IconHandle
 7740:
 7750DEF PROCInitialise
 7760AppSize=HIMEM-&8000:MinSize=AppSize:SlotEnd=HIMEM
 7770ENDPROC
 7780:
 7790DEF FNAllocateMemory(Required)
 7800SlotSize=FNSlotSize(-1)
 7810IF SlotSize<Required THEN NewSize=FNSlotSize(Required):IF NewSize<Required THEN SlotSize=FNSlotSize(AppSize):=0:REM Returns, indicating memory not claimed
 7820IF SlotSize>Required THEN SlotSize=FNSlotSize(Required)
 7830=SlotSize:REM Returns with bytes claimed
 7840:
 7850DEF FNSlotSize(Bytes)
 7860SYS "Wimp_SlotSize",Bytes,-1 TO Bytes
 7870=Bytes
 7880:
 7890DEF PROCMinimiseWimpSlot
 7900dummy=FNAllocateMemory(MinSize)
 7910ENDPROC
 7920:
 7930DEF PROCCloseFileIfPoss(FileHandle)
 7940LOCAL ERROR
 7950ON ERROR LOCAL RESTORE ERROR:ENDPROC:REM Unable to close file
 7960CLOSE#FileHandle
 7970ENDPROC
 7980:
 7990DEF FNFindFileSize(FileName$)
 8000IF FileName$="<Wimp$Scrap>" THEN
 8010  SYS "OS_File",15,FileName$,,,FileName$ TO ,,,,FileSize
 8020ELSE
 8030  N=-1:REPEAT:N+=1:UNTIL MID$(FileName$,LEN(FileName$)-N,1)="."
 8040  PathName$=LEFT$(FileName$,LEN(FileName$)-N):LeafName$=RIGHT$(FileName$,N)
 8050  SYS "OS_File",13,LeafName$,,,PathName$ TO ,,,,FileSize
 8060ENDIF
 8070=FileSize
 8080:
 8090DEF FNNextEntry
 8100REM Gets next entry (created by BPUT#Data,A$) from a file as a string.
 8110REM Use as A$=FNNextEntry.
 8120LOCAL ERROR
 8130ON ERROR LOCAL RESTORE ERROR:="":REM Error reading file
 8140NE$=GET$#Data
 8150WHILE LEFT$(NE$,1)="|"
 8160  NE$=GET$#Data
 8170ENDWHILE
 8180=NE$
 8190:
 8200DEF PROCDragBox(WindowHandle,IconHandle,DragType,SpriteArea,SpriteName$)
 8210Block!0=WindowHandle:SYS "Wimp_GetWindowState",,Block
 8220wminx=Block!4:wmaxy=Block!16
 8230Block!0=WindowHandle:Block!4=IconHandle:SYS "Wimp_GetIconState",,Block
 8240iminx=Block!8:iminy=Block!12:imaxx=Block!16:imaxy=Block!20
 8250Block!0=WindowHandle:Block!4=DragType
 8260Block!8=(wminx+iminx)
 8270Block!12=(wmaxy+iminy)
 8280Block!16=(wminx+imaxx)
 8290Block!20=(wmaxy+imaxy)
 8300Block!24=1:Block!28=1
 8310Block!32=(FNModeInfo("Xpixels",-1)+1)*(2^FNModeInfo("XEigFactor",-1))
 8320Block!36=(FNModeInfo("Ypixels",-1)+1)*(2^FNModeInfo("YEigFactor",-1))
 8330IF DragASprite THEN
 8340  SYS "DragASprite_Start",%10000101,SpriteArea,SpriteName$,Block+8
 8350ELSE
 8360  SYS "Wimp_DragBox",,Block
 8370ENDIF
 8380ENDPROC
 8390:
 8400REM -------------------------------------------------------------------------
 8410REM Routines common to the OmniDesk utilities
 8420REM -------------------------------------------------------------------------
 8430:
 8440DEF PROCDeclareToOmniDesk
 8450Block!0=208:Block!12=0:Block!16=UtilDeclare
 8460Block!20=Task
 8470$(Block+24)=Taskname$
 8480$(Block+44)=OurFileName$
 8490$(Block+55)=FNOmniHelpMessage("CLICK")
 8500$(Block+132)=FNOmniHelpMessage("DRAG")
 8510SYS "Wimp_SendMessage",17,Block,OmniDesk
 8520ENDPROC
 8530:
 8540DEF PROCSayGoodbye
 8550IF OmniDesk<>0 THEN
 8560  Block!0=24:Block!12=0:Block!16=UtilQuitting
 8570  Block!20=Task
 8580  SYS "Wimp_SendMessage",17,Block,OmniDesk
 8590ENDIF
 8600SYS "Interface_CloseDown",Task
 8610SYS "Wimp_CloseDown",Task,&4B534154
 8620ENDPROC
 8630:
 8640DEF FNReadStartupString
 8650REM Returns task handle of OmniDesk (which is passed in the command string)
 8660REM or 0 if not started by OmniDesk.
 8670SYS "OS_GetEnv" TO Command$
 8680A=INSTR(Command$,"-Startup")
 8690IF A<>0 THEN Startup=TRUE
 8700A=INSTR(Command$,"-Exit")
 8710IF A<>0 THEN Exit=TRUE
 8720A=INSTR(Command$,"-OmniDesk")
 8730IF A=0 THEN =0
 8740=VAL(MID$(Command$,A+9))
 8750:
 8760DEF FNReadWindowLocation(Axis$)
 8770REM Reads which radio icon (if any) is selected in the Window Position
 8780REM selector window and returns the axis coordinate (two calls needed)
 8790REM or -1 for no position selected.
 8800Icon=5:REPEAT:Icon+=1:UNTIL (FNSelectedState(Loc,Icon)=TRUE) OR (Icon=31)
 8810IF Icon=31 THEN =-1:REM All icons deselected
 8820Location=-1:Icon-=6:REM Bring icon into range 0-14
 8830CASE Axis$ OF
 8840  WHEN "X","x":Location=Icon DIV 5
 8850  WHEN "Y","y":Location=4-(Icon MOD 5)
 8860ENDCASE
 8870=Location
 8880:
 8890DEF PROCCleanUpLocWindow
 8900REM Makes sure that none of the 'window' icons in the Loc window is selected.
 8910N=5:REPEAT
 8920N+=1:UNTIL N=30 OR FNSelectedState(Loc,N)
 8930PROCUpdateSelectedFlag(Loc,N,FALSE)
 8940ENDPROC
 8950:
 8960REM -------------------------------------------------------------------------
 8970REM Special routines for this program only
 8980REM -------------------------------------------------------------------------
 8990:
 9000DEF PROCScanModules
 9010PROCMinimiseWimpSlot:REM We have set things up so that this will NOT disturb
 9020                     REM the loaded PRM index file.
 9030TotalModules=FNCountLoadedModulesWithSWIs
 9040TotalModules+=1:REM We need to insert the OS SWIs too, which are not
 9050                REM provided by a normal module.
 9060REM We are about to build the index menu indirected data structure.
 9070REM This structure will store the menu contents and information for opening
 9080REM the index window (i.e. number of SWIs for depth calculation).
 9090REM We want 32 bytes for each module: 1 for the number of SWIs (maximum any
 9100REM module can have is 64); 4 for the base number of the module; and
 9110REM 27 for the module title string to go into the menu. NB 27 is an
 9120REM arbitrary maximum; however, the two modules InternationalKeyboard and
 9130REM LaserDirectController both require 21 characters, so we may as well fill
 9140REM up 32 bytes with this much space plus a little extra to be safe (i.e.
 9150REM title length is maximum 26 characters plus a carriage return).
 9160REM Summary: ModDataStruc  Length  Contents
 9170REM                    +0       1  Number of SWIs in module
 9180REM                    +1       4  Module base
 9190REM                    +5      27  Module title (max. 26 chars + CHR$13)
 9200  :
 9210REM In the next line the '28+24+(24*TotalModules)' is for the index menu itself.
 9220RequiredMem=MinSize+(32*TotalModules)+28+24+(24*TotalModules)
 9230  :
 9240IF FNAllocateMemory(RequiredMem)=0 THEN
 9250  IF Index<>-1 THEN Block!0=Index:SYS "Wimp_DeleteWindow",,Block
 9260  Index=-1:REM Mark Index window as 'not yet created'
 9270  ERROR 9999,"Unable to claim enough memory for the index menu and associated data."
 9280ENDIF
 9290  :
 9300ModDataStruc=SlotEnd
 9310REM First start off with the OS:
 9320NamePointer=ModDataStruc+5
 9330$NamePointer="OS"+CHR$13
 9340ModDataStruc!1=0
 9350TotalSWIs=0
 9360  :
 9370SYS "Hourglass_On"
 9380SYS "Hourglass_Percentage",0
 9390  :
 9400REM OS SWIs are numbered 0-255, then the set 256-511
 9410REM are the various permutations of OS_WriteI.
 9420REM We're going to ignore all but the first of the
 9430REM OS_WriteI SWIs, and make a general reference.
 9440FOR N=0 TO 256
 9450  A$=FNSWIName(N,Buffer,256,N)
 9460  IF A$<>"" THEN TotalSWIs+=1
 9470NEXT
 9480  :
 9490ModDataStruc?0=TotalSWIs
 9500  :
 9510REM Now go through all the other modules which are loaded at the moment:
 9520ModNum=0:ModBase=0:SWIChunk=0:Prefix$="":ModName$="":IndexCounter=0
 9530WHILE FNNextSWIMod(ModNum,ModBase,SWIChunk,Prefix$,ModName$)
 9540  REM We haven't run out of modules yet...
 9550  IndexCounter+=1
 9560  SYS "Hourglass_Percentage",(100/TotalModules)*IndexCounter
 9570  ?(ModDataStruc+(32*IndexCounter)+0)=FNCountSWIs(ModBase)
 9580  !(ModDataStruc+(32*IndexCounter)+1)=ModBase
 9590  $(ModDataStruc+(32*IndexCounter)+5)=LEFT$(ModName$,26)+CHR$13
 9600ENDWHILE
 9610  :
 9620REM We now have all the relevant modules stored in the data area.
 9630REM However, the OS lists them in a very unhelpful order.
 9640REM It would be much nicer if they were listed alphabetically,
 9650REM so we'll now sort them into alphabetical order using a simple
 9660REM bubble-sort method:
 9670  :
 9680FOR N=1 TO TotalModules-1
 9690  FOR M=N+1 TO TotalModules
 9700    IF $(ModDataStruc+(32*(N-1))+5)>$(ModDataStruc+(32*(M-1))+5) THEN
 9710      SWAP ?(ModDataStruc+(32*(N-1))+0),?(ModDataStruc+(32*(M-1))+0)
 9720      SWAP !(ModDataStruc+(32*(N-1))+1),!(ModDataStruc+(32*(M-1))+1)
 9730      SWAP $(ModDataStruc+(32*(N-1))+5),$(ModDataStruc+(32*(M-1))+5)
 9740    ENDIF
 9750  NEXT
 9760NEXT
 9770  :
 9780REM Now we want to build the index menu:
 9790IndexMenu=ModDataStruc+(32*TotalModules)
 9800M%=IndexMenu:IndexMenuWidth=LEN("Re-scan modules")
 9810PROCMenuInit(IndexMenuTitle):REM Initialises P% as menu item pointer
 9820A$="Re-scan modules":PROCMenuItem(A$,2,-1):IndirectMenuTextOffsetPointer-=(LEN(A$)+1)
 9830REM The line above moves the menu indirect text pointer back to the start of
 9840REM the string for this menu item. The reason for this is that rebuilding
 9850REM this menu would keep adding this item into the buffer until it over-
 9860REM flowed. Since this is the last menu we build (and the only one which
 9870REM we rebuild), it's safe to mess about with the pointer.
 9880FOR N=0 TO TotalModules-1
 9890  REM Make menu item:
 9900  NamePointer=ModDataStruc+(32*N)+5
 9910  P%!0=0:P%!4=-1:P%!8=&07003121:REM Indirected
 9920  P%!12=NamePointer:P%!16=0:P%!20=0:P%+=24
 9930  IF IndexMenuWidth<LEN($NamePointer) THEN IndexMenuWidth=LEN($NamePointer):M%!16=(IndexMenuWidth+1)*16
 9940NEXT
 9950P%-=24:P%!0=128:REM Mark last item as final
 9960IF wimp>=310 THEN M%!28=(((M%!28) AND NOT 256) EOR 256):REM Indirected menu title
 9970REM That's built the menu; now attach its handle to the main menu:
 9980MainMenu!(28+24+4)=IndexMenu
 9990PROCTickMenu(IndexMenu,1,TRUE)
10000SYS "Hourglass_Off"
10010ScannedModules=TRUE
10020Index=FNCreateIndexWindow(0,TRUE)
10030ENDPROC
10040:
10050DEF FNCreateIndexWindow(Module,ResetScroll)
10060SYS "Hourglass_Start",50
10070REM First delete the old window and return used memory:
10080  :
10090IF Index<>-1 THEN
10100  Block!0=Index:SYS "Wimp_GetWindowState",,Block
10110  ScrollY=Block!24:BehindWindow=Block!28
10120  MinX=0
10130  MaxY=FNModeInfo("YPixels",-1)*2^FNModeInfo("YEigFactor",-1)
10140  IF XPosition=-1 OR YPosition=-1 THEN MinX=Block!4:MaxY=Block!16
10150  SYS "Wimp_DeleteWindow",,Block
10160  Index=-1
10170  IF ResetScroll THEN ScrollY=0
10180ELSE
10190  ScrollY=0:BehindWindow=-1
10200  MinX=(FNModeInfo("XPixels",-1)*2^FNModeInfo("XEigFactor",-1))/6
10210  MaxY=(FNModeInfo("YPixels",-1)*2^FNModeInfo("YEigFactor",-1))-((FNModeInfo("YPixels",-1)*2^FNModeInfo("YEigFactor",-1))/6)
10220ENDIF
10230IndirectIconBase=IndexMenu+28+24+(24*TotalModules)
10240RequiredMem=MinSize+(32*TotalModules)+28+24+(24*TotalModules)
10250dummy=FNAllocateMemory(RequiredMem)
10260REM Minimises wimpslot whilst preserving PRM index file and module data structure/menu.
10270  :
10280REM Now we need to work out how much indirected space is required for the entire window.
10290REM The label icons at the top require:
10300REM   SWI Call  :  9 bytes text  :  3 bytes validation
10310REM   SWI &     :  6 bytes text  :  3 bytes validation
10320REM   PRM Page  :  9 bytes text  :  3 bytes validation
10330REM                                   = 33 bytes total
10340REM The rest of the window consists of:
10350REM (1): SWI prefix label and 3D border; and
10360REM (2): One indirected icon for each SWI name
10370REM (3): One direct icon for each SWI number
10380REM (4): One direct icon for each page reference
10390REM We don't know how long the SWI prefix label is going to be,
10400REM but the longest built-in SWI prefix known at the time of
10410REM writing (on RISC OS 3TAN1) is SharedCLibrary, which is 14
10420REM characters long. So we'll allow 18 bytes to accommodate this
10430REM plus a bit more to be on the safe side (17 characters + CHR$13).
10440REM No validation string is needed for the SWI labels, and no text
10450REM is needed for border icons. So:
10460REM   SWI prefix label       :  18 bytes text  :  3 bytes validation
10470REM   3D surrounding border  :   1 byte  text  :  3 bytes validation
10480REM                                                 = 24 bytes total
10490REM   1 icon per SWI call    :  50 bytes text  :  0 bytes validation
10500REM The SWI label icon is of the form:
10510REM   <SWI name excluding prefix> {31 characters} + " "
10520REM   + <SWI Number excluding &>  { 6 characters} + " "
10530REM   + <PRM page reference if available> {10 characters} + CHR$13
10540REM   = 50 bytes total
10550REM   The SWI name and number are separated by a row of dots with a
10560REM   space at either end.
10570REM So: total space required is 33 + 24 + (50 CHAINEVALSWIs)
10580RequiredMem+=33+24+(50*?(ModDataStruc+(32*Module)))
10590  :
10600IF FNAllocateMemory(RequiredMem)=0 THEN ERROR 9999,"Unable to claim memory for the index window."
10610  :
10620ModuleBase=!(ModDataStruc+(32*Module)+1)
10630$(IndirectIconBase+0)="SWI Call"+CHR$13:$(IndirectIconBase+9)="Z3"+CHR$13
10640$(IndirectIconBase+12)="SWI &"+CHR$13:$(IndirectIconBase+18)="Z3"+CHR$13
10650$(IndirectIconBase+21)="PRM Page"+CHR$13:$(IndirectIconBase+30)="Z3"+CHR$13
10660REM That's the data set up for the three label icons at the top of the window.
10670Prefix$=FNSWIPrefix(ModuleBase,Buffer,256):IF ModuleBase=0 THEN Prefix$="OS"
10680$(IndirectIconBase+33)=LEFT$(Prefix$,17)+CHR$13:$(IndirectIconBase+51)="Z0"+CHR$13
10690$(IndirectIconBase+54)=CHR$13:$(IndirectIconBase+55)="Z1"+CHR$13
10700REM That's the data set up for the SWI prefix label and 3D surrounding border.
10710  :
10720REM We now go through all the SWIs in the module and put their text into the indirected icons
10730  :
10740SWICount=0:SWINum=ModuleBase!28:TopLimit=63
10750IF ModuleBase=0 THEN SWINum=0:TopLimit=256:REM OS
10760  :
10770REM Can we find the prefix in the PRM index store?
10780PageIndex=FNPageIndexPresent(Prefix$)
10790REM A value of 0 means not present; otherwise we get the search base address
10800  :
10810FOR N=0 TO TopLimit
10820  SWIName$=FNSWIName(SWINum,Buffer,256,N)
10830  IF SWIName$<>"" THEN
10840    S$=LEFT$(SWIName$,31)
10850    IF N=256 THEN S$="WriteI":REM Our homage to this gargantuan set ...
10860    IF LEN(S$)<31 THEN S$+=" "
10870    S$+=STRING$(31-LEN(S$),".")
10880    S$+=STRING$(5-LEN(STR$~SWINum),".")
10890    S$+=" "
10900    S$+=STR$~SWINum
10910    S$+=" "
10920    IF PageIndex<>0 THEN
10930      T$=STRING$(10,"."):RIGHT$(T$)=RIGHT$(" "+FNLookUpPage(SWINum,PageIndex),10)
10940      S$+=T$
10950    ENDIF
10960    $(IndirectIconBase+58+(50*SWICount))=LEFT$(S$,49)+CHR$13:REM LEFT$ just in case...
10970    SWICount+=1
10980  ENDIF
10990  SWINum+=1
11000NEXT
11010WorkExtent=-132-(40*SWICount+1)-12
11020IF PageIndex=0 THEN WindowWidth=630 ELSE WindowWidth=810
11030Index=FNCreateWindow(MinX,WorkExtent,WindowWidth,MaxY,0,ScrollY,BehindWindow,%10110111000000000000000000000010,7,2,7,1,3,1,12,0,WorkExtent,WindowWidth,0,%11101,3,1,WindowWidth,0,"SWI�Index")
11040IconData!0=IndirectIconBase+0:IconData!4=IndirectIconBase+9:IconData!8=9
11050Icon=FNCreateIcon(Index,14,-60,206,-12,&17000139,IconData):REM SWI Call
11060IconData!0=IndirectIconBase+12:IconData!4=IndirectIconBase+18:IconData!8=6
11070Icon=FNCreateIcon(Index,518,-60,618,-12,&17000139,IconData):REM SWI &
11080IconData!0=IndirectIconBase+21:IconData!4=IndirectIconBase+30:IconData!8=9
11090Icon=FNCreateIcon(Index,638,-60,798,-12,&17000139,IconData):REM PRM Page
11100IconData!0=IndirectIconBase+33:IconData!4=IndirectIconBase+51:IconData!8=18
11110Icon=FNCreateIcon(Index,24,-128,24+(16*LEN(Prefix$))+32,-80,&17000139,IconData):REM SWI Prefix
11120IconData!0=IndirectIconBase+54:IconData!4=IndirectIconBase+55:IconData!8=1
11130Icon=FNCreateIcon(Index,12,-132-(40*SWICount+1),WindowWidth-14,-108,&17000119,IconData):REM 3D Border
11140FOR N=0 TO SWICount-1
11150  IconData!0=IndirectIconBase+58+(50*N):IconData!4=-1:IconData!8=50
11160  Icon=FNCreateIcon(Index,12,-132-(40*N+1)-40,WindowWidth-14,-132-(40*N+1),&17000111,IconData)
11170NEXT
11180SYS "Hourglass_Off"
11190=Index
11200:
11210DEF FNNextSWIMod(RETURN ModNum,RETURN ModBase,RETURN SWIChunk,RETURN Prefix$,RETURN ModName$)
11220REM Return details of the current module base number, name and SWI prefix,
11230REM and update the module number to the next module in the list
11240REM (or return FALSE for no more modules). Skip any modules which
11250REM don't provide SWIs.
11260LOCAL ERROR
11270ON ERROR LOCAL RESTORE ERROR:=FALSE
11280REPEAT
11290  REPEAT
11300    InsNum=0:REM Instantiation number
11310    REPEAT
11320      REM Ignore alternative instantiations:
11330      REM they all have the same SWIs.
11340      SYS "OS_Module",12,ModNum,InsNum TO ,ModNum,InsNum,ModBase
11350    UNTIL InsNum=0
11360    SWIChunk=ModBase!28
11370  UNTIL SWIChunk<>0
11380  Prefix$=FNSWIPrefix(ModBase,Buffer,256)
11390UNTIL Prefix$<>""
11400ModName$=FNModName(ModBase)
11410=TRUE
11420:
11430DEF FNModName(ModBase)
11440REM Find a module name (SWI prefix) given a module base number
11450ModName$="":StringCount=0
11460WHILE ?(ModBase+(ModBase!16)+StringCount)>=32
11470  ModName$+=CHR$(?(ModBase+(ModBase!16)+StringCount))
11480  StringCount+=1
11490ENDWHILE
11500=ModName$
11510:
11520DEF FNSWIPrefix(ModBase,Buffer,BufferLen)
11530SWINum=(ModBase!28)
11540SYS "OS_SWINumberToString",SWINum,Buffer,BufferLen TO ,,Len
11550Buffer?(Len-1)=13
11560A=INSTR($Buffer,"_")
11570IF A=0 THEN =""
11580=LEFT$($Buffer,A-1)
11590:
11600DEF FNSWIName(SWINum,Buffer,BufferLen,SWICounter)
11610REM This function returns a SWI name with its prefix removed.
11620REM Undefined SWIs are returned as an empty string.
11630REM The last parameter (SWICounter) is the number of the SWI
11640REM within the module. We need it so that we can return as an
11650REM empty string SWIs of the form "Module_##" (i.e. undefined,
11660REM where ## is a number from 0 to 63).
11670  :
11680SYS "OS_SWINumberToString",SWINum,Buffer,BufferLen TO ,,Len
11690Buffer?(Len-1)=13
11700A=INSTR($Buffer,"_")
11710IF A=0 THEN =""
11720$Buffer=RIGHT$($Buffer,LEN($Buffer)-A)
11730IF $Buffer=STR$(SWICounter) THEN =""
11740IF $Buffer="Undefined" THEN =""
11750IF $Buffer="NOP" THEN =""
11760IF LEFT$($Buffer,8)="Reserved" AND LEN($Buffer)<=10 THEN =""
11770=$Buffer
11780:
11790DEF FNCountLoadedModulesWithSWIs
11800Counter=0:N=0
11810REPEAT UNTIL NOT FNMoreMods(N,Counter)
11820=Counter
11830:
11840DEF FNCountSWIs(ModBase)
11850SWINum=(ModBase!28):Counter=0
11860REM We must examine all SWIs (up to 64 defined per module).
11870REM Unfortunately, we can't stop when we find an
11880REM undefined SWI, because the defined SWIs don't always
11890REM appear in a contiguous block. Therefore, we have to
11900REM search through all 64 SWIs in each module.
11910REPEAT
11920  A$=FNSWIName(SWINum,Buffer,256,SWINum-(ModBase!28))
11930  IF A$<>"" THEN Counter+=1
11940  SWINum+=1
11950UNTIL SWINum=(ModBase!28)+64
11960=Counter
11970:
11980DEF FNMoreMods(RETURN N,RETURN Counter)
11990LOCAL ERROR
12000ON ERROR LOCAL RESTORE ERROR:=FALSE
12010InsNum=0:REM Instantiation number
12020REPEAT
12030  REM Ignore alternative instantiations:
12040  REM they all have the same SWIs.
12050  SYS "OS_Module",12,N,InsNum TO ,N,InsNum,ModBase
12060UNTIL InsNum=0
12070IF (ModBase!28)<>0 THEN
12080  SYS "OS_SWINumberToString",(ModBase!28),Buffer,256 TO ,,Len
12090  Buffer?(Len-1)=13
12100  A=INSTR($Buffer,"_")
12110  IF A>0 THEN Counter+=1
12120ENDIF
12130=TRUE
12140:
12150DEF PROCTickPRMchoice(RETURN PRM$)
12160REM The following will find the PRM file in the menu and tick it,
12170REM or tick the first item if the file is not present:
12180M%=PRMMenu+4:Counter=-1
12190REPEAT
12200  M%+=24:Counter+=1
12210UNTIL ($(M%+12)=PRM$) OR (((M%!0) AND (1<<7))=(1<<7))
12220IF $(M%+12)=PRM$ THEN PROCTickMenu(PRMMenu,Counter,TRUE) ELSE M%=PRMMenu+28:PRM$=$(M%+12):PROCTickMenu(PRMMenu,0,TRUE)
12230ENDPROC
12240:
12250DEF FNPageIndexPresent(Prefix$)
12260Address=PRMStore
12270REPEAT
12280  A$=$(Address)
12290  Address+=LEN(A$)+1
12300UNTIL (A$="***") OR (A$=Prefix$)
12310IF A$="***" THEN =0
12320=Address
12330:
12340DEF FNLookUpPage(SWINum,RETURN Address)
12350A$=$(Address)
12360IF LEFT$(A$,1)<>"&" THEN ="-"
12370AddressOffset=Address
12380REPEAT
12390  A$=$(AddressOffset)
12400  AddressOffset+=LEN(A$)+1
12410UNTIL (LEFT$(A$,INSTR(A$,",")-1)="&"+STR$~SWINum) OR (LEFT$(A$,1)<>"&")
12420IF LEFT$(A$,1)<>"&" THEN ="-"
12430Address=AddressOffset
12440=RIGHT$(A$,LEN(A$)-INSTR(A$,","))
12450:
12460DEF PROCLoadPRMIndex(PRM$)
12470REM We want to load the PRM Index file into memory for faster referencing.
12480REM PRMStore is defined when the menus are being built at startup.
12490SYS "OS_File",16,OurPathName$+"!SWI�Index.PRM."+PRM$,PRMStore,0
12500ENDPROC
12510:
12520DEF FNBuildPRMMenu
12530M%=PRMMenu
12540Title$="PRM Edition":DIM PRMMenuTitle LEN(Title$)+1:$PRMMenuTitle=Title$+CHR$13
12550PROCMenuInit(PRMMenuTitle)
12560REM The following code will build the PRM Edition menu, and will also
12570REM find out the size of the largest PRM file so that we can put aside
12580REM that amount of memory to load any requested PRM index file.
12590File=0:LargestPRM=0
12600WHILE File<>-1
12610  SYS "OS_GBPB",10,"<SWIIndex$Dir>.PRM",Block,1,File,256,"*" TO ,,,,File
12620  IF LargestPRM<Block!8 THEN LargestPRM=Block!8
12630  Name$="":N=20:WHILE (Block?N)>=32:Name$+=CHR$(Block?N):N+=1:ENDWHILE
12640  IF ((Block!16>-1) AND (Block!16<4096)) AND File<>-1 THEN PROCMenuItem(Name$,0,-1)
12650ENDWHILE
12660P%-=24:REM Reset menu item pointer to final item and mark as 'last'
12670P%!0=((P%!0) AND NOT 128) EOR 128
12680IF wimp>=310 THEN M%!28=(((M%!28) AND NOT 256) EOR 256):REM Indirected menu title
12690REM We must be absolutely sure that LargestPRM is a multiple of 4: if not,
12700REM then PROCScanModules would try to build the index menu on an address
12710REM which falls across a word boundary, which would result in an 'Invalid
12720REM window handle' error when trying to access the menu. The next line will
12730REM increase LargestPRM by up to 3 bytes to make it a whole number of words
12740REM long:
12750LargestPRM+=4-(LargestPRM MOD 4)
12760=LargestPRM
12770:
12780DEF PROCCreatePRMStore(LargestPRM)
12790PRMStore=FNAllocateMemory(AppSize+LargestPRM)
12800IF PRMStore=0 THEN Done=TRUE:ERROR 9999,"Unable to claim enough memory to start up properly."
12810MinSize=AppSize+LargestPRM
12820PRMStore=SlotEnd:SlotEnd+=LargestPRM
12830ENDPROC
12840:
12850DEF FNSaveSWIListToFile(Output$)
12860LOCAL ERROR
12870ON ERROR LOCAL RESTORE ERROR:SYS "Hourglass_Smash":PROCCloseFileIfPoss(File):=FALSE:REM Error writing file
12880  :
12890  File=OPENOUT (Output$)
12900  IF FullSave THEN
12910    SYS "Hourglass_On"
12920    FOR N=0 TO TotalModules-1
12930      SYS "Hourglass_Percentage",(100/TotalModules)*N
12940      PROCWriteModule(N)
12950      IF N<(TotalModules-1) THEN BPUT#File,""
12960    NEXT
12970    SYS "Hourglass_Off"
12980  ELSE
12990    Counter=0:REPEAT:Counter+=1:UNTIL FNMenuTicked(IndexMenu,Counter)
13000    PROCWriteModule(Counter-1)
13010  ENDIF
13020  CLOSE#File
13030  OSCLI("Settype "+Output$+" Text")
13040  :
13050=TRUE
13060:
13070DEF PROCWriteModule(Module)
13080ModuleBase=!(ModDataStruc+(32*Module)+1)
13090SWINum=ModuleBase!28
13100Prefix$=FNSWIPrefix(ModuleBase,Buffer,256)
13110IF ModuleBase=0 THEN Prefix$="OS"
13120IF Prefix$="OS" THEN TopLimit=255:SWINum=0 ELSE TopLimit=63
13130BPUT#File,"Module: "+$(ModDataStruc+(32*Module)+5)
13140FOR S=0 TO TopLimit
13150  SWIName$=FNSWIName(SWINum,Buffer,256,S)
13160  IF SWIName$<>"" THEN
13170    A$=STRING$(7," ")
13180    RIGHT$(A$)=STR$~(SWINum)
13190    A$+=" "
13200    A$+=Prefix$+"_"
13210    A$+=SWIName$
13220    BPUT#File,A$
13230  ENDIF
13240  SWINum+=1
13250NEXT
13260IF Prefix$="OS" THEN BPUT#File,"    100 OS_WriteI"
13270ENDPROC
13280:
13290DEF FNSaveSettings
13300LOCAL ERROR
13310ON ERROR LOCAL RESTORE ERROR:PROCCloseFileIfPoss(Data):=FALSE:REM Error writing file
13320  :
13330  Data=OPENOUT ("<SWIIndex$Dir>.Settings")
13340  BPUT#Data,"| X and Y grid coordinates of SWI Index window:"
13350  BPUT#Data,STR$(XPosition)
13360  BPUT#Data,STR$(YPosition)
13370  BPUT#Data,"| PRM Edition:"
13380  BPUT#Data,PRM$
13390  CLOSE#Data
13400  OSCLI("Settype <SWIIndex$Dir>.Settings Text")
13410  :
13420=TRUE
13430:
13440DEF FNLoadSettings
13450LOCAL ERROR
13460ON ERROR LOCAL RESTORE ERROR:PROCCloseFileIfPoss(Data):=FALSE:REM 'Settings' file is damaged or missing
13470  :
13480  Data=OPENIN "<SWIIndex$Dir>.Settings"
13490  XPosition=VAL(FNNextEntry)
13500  YPosition=VAL(FNNextEntry)
13510  PRM$=FNNextEntry
13520  CLOSE#Data
13530  :
13540  IF XPosition<>-1 AND YPosition<>-1 THEN PROCUpdateSelectedFlag(Loc,6+((5*XPosition)+(4-YPosition)),TRUE)
13550  :
13560=TRUE
13570:
13580DEF PROCDefaultSettings
13590XPosition=4:YPosition=4
13600PROCUpdateSelectedFlag(Loc,6+((5*XPosition)+(4-YPosition)),TRUE)
13610ENDPROC

� >!RunImage for SWI Index
:
>VersionNumber$="1�03 (27 July 1993)":Taskname$="SWI�Index"
(Exit=�:Startup=�:Done=�
2DoModeChange=�
<:
F2� Block 256,Buffer 256,MenuHelp 16,IconData 12
P/IndMenuMax=80:� IndirectMenuText IndMenuMax
Z7� Templates 1636,InfoInd 190,LocInd 592,SaveInd 379
d� IBMenu 76,MainMenu 172
n.� PRMMenu 220:� Enough space for 8 entries
x:
�*� Messages used by the OmniDesk suite:
�_UtilDeclare=&825C0:UtilOpen=&825C1:UtilQuitting=&825C2:UtilReside=&825C3:UtilAckLoad=&825C4
�+� These are official Acorn allocations.
�:
�L� � Block!0=�:$(Block+4)=�$+�0:ș "Wimp_ReportError",Block,1,Taskname$:�
�:
�?OmniDesk=�ReadStartupString:� Also assigns Exit and Startup
�:
�*Set SWIIndex$RISCOS 3
�6*RMEnsure UtilityModule 3.00 Set SWIIndex$RISCOS 2
�Yș "XOS_ReadVarVal","SWIIndex$RISCOS",Block,256,0,0 � ,,len:Block?len=13:wimp$=$Block
�� wimp$<>"3" � wimp$="2"
�*Unset SWIIndex$RISCOS
:
 *Set SWIIndex$SpriteDrag Yes
9*RMEnsure DragASprite 0.00 Set SWIIndex$SpriteDrag No
"Pș "XOS_ReadVarVal","SWIIndex$SpriteDrag",Block,256,0,0 � ,,len:Block?len=13
,2� $Block="Yes" � DragASprite=�:� DragASprite=�
6*Unset SWIIndex$SpriteDrag
@:
JYș "XOS_ReadVarVal","Obey$Dir",Block,256,0,0 � ,,len:Block?len=13:OurFileName$=$Block
T8N=-1:�:N+=1:� �OurFileName$,�(OurFileName$)-N,1)="."
^OOurPathName$=�OurFileName$,�(OurFileName$)-N):OurFileName$=�OurFileName$,N)
h:
r^� Read size of sprite file and load it. We need to DIM 16 bytes more than the file's size.
|9ș "OS_FSControl",28,"<SWIIndex$Dir>.Sprites" � ,,len
��� Sprites len+16:!Sprites=len+16:Sprites!4=0:Sprites!8=16:Sprites!12=16:ș "OS_SpriteOp",256+10,Sprites,"<SWIIndex$Dir>.Sprites"
�:
�� wimp$="3" �
�  � messagelist% 36
�/  messagelist%!0=&502:messagelist%!4=&400C1
�:  messagelist%!8=UtilOpen:messagelist%!12=UtilQuitting
�3  messagelist%!16=UtilReside:messagelist%!20=10
�;  messagelist%!24=4:messagelist%!28=2:messagelist%!32=0
�K  ș "Wimp_Initialise",300,&4B534154,Taskname$,messagelist% � wimp,Task
��
�>  ș "Wimp_Initialise",200,&4B534154,Taskname$ � wimp,Task
��
�:
"ș "Interface_Initialise",Task
:
6ș "Wimp_OpenTemplate",,"<SWIIndex$Dir>.Templates"
&Eș "Wimp_LoadTemplate",,Templates,InfoInd,InfoInd+190,-1,"Info",0
0,ș "Wimp_CreateWindow",,Templates � Info
:\ș "Wimp_LoadTemplate",,Templates,LocInd,LocInd+592,-1,"WindowXY",0:Templates!64=Sprites
D+ș "Wimp_CreateWindow",,Templates � Loc
NEș "Wimp_LoadTemplate",,Templates,SaveInd,SaveInd+379,-1,"Save",0
X,ș "Wimp_CreateWindow",,Templates � Save
bș "Wimp_CloseTemplate"
l:
v0�UpdateIcon(Save,4,"This Module"):FullSave=�
��CleanUpLocWindow
�ReadError=�(�LoadSettings)
�:
�[Title$="Modules|providing SWIs":� IndexMenuTitle �(Title$)+2:$IndexMenuTitle=Title$+�13
�LIndexMenu=-1:� Temporary: this will be assigned in PROCCreateIndexWindow
�BIndex=-1:� Temporary: this will be assigned in PROCScanModules
��BuildMenus
�-LargestPRM=�BuildPRMMenu:ScannedModules=�
�:
��Initialise
��CreatePRMStore(LargestPRM)
��TickPRMchoice(PRM$)
��LoadPRMIndex(PRM$)
:
� OmniDesk=0 �
   � Put Icon on the icon-bar
   Block!0=-1
*1  Block!4=0:Block!8=0:Block!12=68:Block!16=68
45  Block!20=&17003002:$(Block+24)="!SWI�Index"+�13
>+  ș "Wimp_CreateIcon",,Block � IconBar
H�
R:
\&� OmniDesk<>0 � �DeclareToOmniDesk
fR� Startup � Done=�:� '-Startup' parameter means 'declare and die immediately'.
p:
z&�UpdateIcon(Info,3,VersionNumber$)
�6�ModeChange:� To update icon-bar icon if necessary
�:
�� � �Error
��� ReadError � ReadError=�:�DefaultSettings:� 9999,"An error occurred whilst reading the settings file. Default settings will therefore be used."
�:
�)ș "OS_ReadMonotonicTime" � polltime%
�:
�� Main program loop
��
�6  ș "Wimp_PollIdle",%1100000110000,Block � Reason
�&  ș "Interface_Poll",Reason,,Task
�4  ș "Interface_PreProcessKey",Reason,Block,Task
�  Ȏ Reason �
3    � 0 : ș "OS_ReadMonotonicTime" � polltime%
L             polltime%+=100:� Do a Wimp_Poll approximately once a second
h             � (Index<>-1) � DoModeChange � � �OpenState(Index) � �Open(Index,�,XPosition,YPosition)
$    � 1 : �Redraw
.)    � 2 : ș "Wimp_OpenWindow",,Block
8*    � 3 : ș "Wimp_CloseWindow",,Block
B              � Exit � Done=�
L    � 6 : �MouseButton
V    � 7 : �DragFinished
`    � 8 : �KeyPressed
j    � 9 : �DecodeMenu
t$    � 17,18,19 : �RecieveMessage
~  �
�
� Done
��SayGoodbye
��
�:
�� �Error
�Click=0:Block!0=�:Ȏ � �
�  � 9999:� Custom error
�    $(Block+4)=�$+�0
�>    ș "Wimp_ReportError",Block,17,"Notice from SWI Index"
�  
�v    $(Block+4)=�$+" (internal error code "+Þ+"). Click on OK to continue, or Cancel to terminate the program."+�0
�8    ș "Wimp_ReportError",Block,3,Taskname$ � ,Click
�

� Click=2 � �SayGoodbye:�
�
:
(.� �Open(WindowHandle,TopOfStack,across,up)
2Block!0=WindowHandle
<#ș "Wimp_GetWindowState",,Block
FJ� (across<>-1) � (across<>-1) � �DecideWindowPosition(Block,across,up)
P� TopOfStack � Block!28=-1
Zș "Wimp_OpenWindow",,Block
d�
n:
x� �Close(WindowHandle)
�Block!0=WindowHandle
�#ș "Wimp_GetWindowState",,Block
� ș "Wimp_CloseWindow",,Block
��
�:
�,� �DecideWindowPosition(Block,across,up)
�L� Use of this procedure lets you open windows on an invisible grid which
�I� automatically fits itself to the screen mode in use. There are five
�J� positions across (left, mid-left, centre, mid-right, right) and five
�G� positions up (bottom of screen, above icon-bar, centre of screen,
�+� centre top of screen, top of screen).
�  :
�CXpixels=�ModeInfo("XPixels",-1):Ypixels=�ModeInfo("YPixels",-1)
OXEigFactor=�ModeInfo("XEigFactor",-1):YEigFactor=�ModeInfo("YEigFactor",-1)
  :
8top=Block!16:right=Block!12:bot=Block!8:left=Block!4
"Aș "Wimp_OpenWindow",,Block:ș "Wimp_GetWindowOutline",,Block
,&TB=((Block!16)-top)/(2^YEigFactor)
6(VS=((Block!12)-right)/(2^XEigFactor)
@%HS=(bot-(Block!8))/(2^YEigFactor)
J&LP=(left-(Block!4))/(2^XEigFactor)
TK� LP is Left Pixel: normally present, but not if window is transparent.
^%width=(right-left)/(2^XEigFactor)
h#height=(top-bot)/(2^YEigFactor)
rȎ across �
|  � 0:x=LP
�,  � 1:x=LP+((Xpixels+1)-(width+LP+VS))/4
�,  � 2:x=LP+((Xpixels+1)-(width+LP+VS))/2
�2  � 3:x=LP+(3*(((Xpixels+1)-(width+LP+VS))/4))
�"  � 4:x=(Xpixels+1)-(width+VS)
��
�Ȏ up �
�  � 0:y=HS
�#  � 1:y=HS+(132/(2^YEigFactor))
�-  � 2:y=HS+((Ypixels+1)-(height+TB+HS))/2
�3  � 3:y=HS+(3*(((Ypixels+1)-(height+TB+HS))/4))
�#  � 4:y=(Ypixels+1)-(height+TB)
��
�(� Above coordinates position window.
(� Now convert to screen coordinates:
)x=x*(2^XEigFactor):y=y*(2^YEigFactor)
;width=width*(2^XEigFactor):height=height*(2^YEigFactor)
&Block!12=x+width:Block!4=x
0Block!16=y+height:Block!8=y
:�
D:
NO� -------------------------------------------------------------------------
X� Wimp poll routines
bO� -------------------------------------------------------------------------
l:
v
� �Redraw
�"� DoModeChange � (Index<>-1) �
�d  � Re-opening windows need an extra wimp_poll to happen after the mode change in order to work:
�>  � �OpenState(Index) � �Open(Index,�,XPosition,YPosition)
�  DoModeChange=�
��
�(ș "Wimp_RedrawWindow",,Block � flag
�ȕ flag
�*  ș "Interface_Render3dWindow",,Block
�*  ș "Wimp_GetRectangle",,Block � flag
��
��
�:
�� �RecieveMessage
Ȏ Block!16 �
  � 0 : Done=�
F  � 2 : � We're saving out to another application or to the filer.
 J           � We've just received acknowledgement to go ahead and save.
*Z           FileName$="":N=44:ȕ ((Block?N)>=32) � (N<256):FileName$+=�(Block?N):N+=1:�
4v           � � �SaveSWIListToFile(FileName$) � �DeleteWimpScrap:� 9999,"An error occurred whilst saving the file."
>Q           Block!12=Block!8:Block!16=3:ș "Wimp_SendMessage",17,Block,Block!4
HI           MyRef=-1:� Invalidate once again, until our next save out.
R,           � FileName$<>"<Wimp$Scrap>" �
\.             �UpdateIcon(Save,2,FileName$)
f2             � Put full filename into save box
p           �
zQ  � 4 : � We have saved the SWI List file, and are receiving acknowledgement.
�M           � We don't need to actually do anything except close the menu.
�'           ș "Wimp_CreateMenu",,-1
�1  � 10: � OmniDesk=0 � �SaveDesktop(Block!20)
�E           � Only save if we have not been started up by OmniDesk
�  � &502 : �Help
�  � &400C1 : �ModeChange
�=  � UtilOpen : � $(Block+24)=Taskname$ � �OmniDeskCalling
�&  � UtilQuitting : � OmniDesk<>0 �
�8                        � Block!20=OmniDesk � Done=�
�                      �
�  � UtilReside : Exit=�
��
��
	:
	� �DeleteWimpScrap
	� �
	$� � � � �:�
	.<� We may receive try to delete a non-existant Wimp$Scrap
	8@� file if the receiving task did not recognise the filetype.
	B�("Delete <Wimp$Scrap>")
	L�
	V:
	`� �MouseButton
	j1MouseX=Block!0:MouseY=Block!4:Buttons=Block!8
	t!Window=Block!12:Icon=Block!16
	~Ȏ Window �
	�"  � -2:� Icon bar icon clicked
	�    Ȏ Buttons �
	�      � 1 : � Adjust
	�      � 2 : � Menu
	�9        M%=IBMenu:MenuX=MouseX:MenuY=MouseY:�MakeMenu
	�      � 4 : � Select
	�-        � � ScannedModules � �ScanModules
	�6        � Index=-1 � Index=�CreateIndexWindow(0,�)
	�.        �Open(Index,�,XPosition,YPosition)
	�	    �
	�
  � Index
	�    Ȏ Buttons �
      � 1 : � Adjust

      � 2 : � Menu
1        M%=MainMenu:MenuX=MouseX:MenuY=MouseY
        � wimp>=310 �
(`          � �$MainMenuTitle,1)="\" � $MainMenuTitle=�$MainMenuTitle,�($MainMenuTitle)-1)+�13
2C          � XPosition=4 � $MainMenuTitle="\"+$MainMenuTitle+�13
<
        �
F        �MakeMenu
P      � 4 : � Select
Z	    �
d0  � Loc � Buttons<8:� Reposition main window
n    � Icon>=6 �
x,      XPosition=�ReadWindowLocation("X")
�,      YPosition=�ReadWindowLocation("Y")
�B      � �OpenState(Index) � �Open(Index,�,XPosition,YPosition)
�	    �
�  � Save
�    Ȏ Icon �
�      � 1:� File icon
�        � Buttons>=8 �
�          � DragASprite �
�P            � The following lines delete the file icon from the save window,
�N            � giving the impression that you are actually dragging it out.
�:            � It will be replaced in PROCDragFinished.
�D            Block!0=Save:Block!4=1:ș "Wimp_GetIconState",,Block
�,            SaveBoxDragFile$=$(Block!32)
4            Block!8=0:Block!12=0:$(Block!32)=�13
-            ș "Wimp_SetIconState",,Block
          �
"-          �DragBox(Save,1,5,1,"file_fff")
,
        �
6      � 3:� OK icon
@*        � (Buttons<8) � (Buttons<>2) �
J.          ș "Interface_SlabButton",,Block
T5          � Buttons<>1 � ș "Wimp_CreateMenu",,-1
^=          A$=�ReadIconStr(Save,2):� A$="" � A$="SWI�List"
h$          �UpdateIcon(Save,2,A$)
r�          � �A$,".")=0 � Block!8=0:Block!12=Save:Block!16=3:ș "Interface_SlabButton",,Block:� 9999,"To save, drag the icon to a directory display."
|�          � � �SaveSWIListToFile(A$) � �DeleteWimpScrap:Block!8=0:Block!12=Save:Block!16=3:ș "Interface_SlabButton",,Block:� 9999,"An error occurred whilst saving the file."
�Q          Block!8=0:Block!12=Save:Block!16=3:ș "Interface_SlabButton",,Block
�
        �
�      � 4:� Switch icon
�*        � (Buttons<8) � (Buttons<>2) �
�.          ș "Interface_SlabButton",,Block
�^          A$=�ReadIconStr(Save,4):� A$="This Module" � A$="All Modules" � A$="This Module"
�$          �UpdateIcon(Save,4,A$)
�!          FullSave=� FullSave
�Q          Block!8=0:Block!12=Save:Block!16=4:ș "Interface_SlabButton",,Block
�
        �
�	    �
��
��
:
� �DragFinished
� DragASprite �
&  ș "DragASprite_Stop"
0?  � The following lines replace the sprite in the save box.
::  Block!0=Save:Block!4=1:ș "Wimp_GetIconState",,Block
D7  Block!8=0:Block!12=0:$(Block!32)=SaveBoxDragFile$
N#  ș "Wimp_SetIconState",,Block
X�
b#ș "Wimp_GetPointerInfo",,Block
l.� Block!12=-1 � �:� Dragged to background.
vYDraggedToX=Block!0:DraggedToY=Block!4:DraggedToWindow=Block!12:DraggedToIcon=Block!16
�%� Find out leaf name in save box:
�3Dragging$=�ReadIconStr(Save,2):len=�(Dragging$)
�>N=-1:�:N+=1:� (�Dragging$,�(Dragging$)-N,1)=".") � (N=len)
�%� N<len � Dragging$=�Dragging$,N)
�G� Dragging$="" � Dragging$="SWI�List":�UpdateIcon(Save,2,Dragging$)
�0� OK - Let's begin an inter-application save
�MyRef=0
�4Block!0=256:Block!12=MyRef:Block!16=1:� DataSave
�[Block!20=DraggedToWindow:Block!24=DraggedToIcon:Block!28=DraggedToX:Block!32=DraggedToY
�6Block!36=-1:� No idea what the size is going to be
�$Block!40=&FFF:� Filetype of Text
�$(Block+44)=Dragging$+�0
�@ș "Wimp_SendMessage",17,Block,DraggedToWindow,DraggedToIcon

B� DraggedToIcon included in case DraggedToWindow=-2 (icon bar)

�

:

 � �KeyPressed

*2Window=Block!0:Icon=Block!4:Character=Block!24

4Ȏ Window �

>
  � Save:

H    � Character=13 �

RM      Block!8=4:Block!12=Save:Block!16=3:ș "Interface_SlabButton",,Block

\9      A$=�ReadIconStr(Save,2):� A$="" � A$="SWI�List"

f       �UpdateIcon(Save,2,A$)

p�      � �A$,".")=0 � Block!8=0:Block!12=Save:Block!16=3:ș "Interface_SlabButton",,Block:� 9999,"To save, drag the icon to a directory display."

z�      � � �SaveSWIListToFile(A$) � �DeleteWimpScrap:Block!8=0:Block!12=Save:Block!16=3:ș "Interface_SlabButton",,Block:� 9999,"An error occurred whilst saving the file."

�M      Block!8=0:Block!12=Save:Block!16=3:ș "Interface_SlabButton",,Block

�"      ș "Wimp_CreateMenu",,-1

�	    �

�(      ș "Wimp_ProcessKey",Character

�	    �

�  

�&    ș "Wimp_ProcessKey",Character

��

��

�:

�� �DecodeMenu

�*Sub0=Block!0:Sub1=Block!4:Sub2=Block!8

�CloseMenu=�
Ȏ M% �
  � IBMenu:
    Ȏ Sub0 �
$
      � 0
.+        ș "Wimp_GetPointerInfo",,Block
8<        ș "Wimp_CreateMenu",,Info,Block!0-24,Block!4+24
B        CloseMenu=�
L
      � 1
V        Done=�
`	    �
j  � MainMenu:
t    Ȏ Sub0 �
~
      � 0
�+        ș "Wimp_GetPointerInfo",,Block
�<        ș "Wimp_CreateMenu",,Info,Block!0-24,Block!4+24
�        CloseMenu=�
�
      � 1
�        Ȏ Sub1 �
�          � -1:� Do nothing
�          � 0:�ScanModules
�                  CloseMenu=�
�2                 Index=�CreateIndexWindow(0,�)
�7                 �Open(Index,�,XPosition,YPosition)
�7                 �Open(Index,�,XPosition,YPosition)
�          
1            � � �MenuTicked(IndexMenu,Sub1) �

4              Index=�CreateIndexWindow(Sub1-1,�)
&              � N=1 � TotalModules
1                �TickMenu(IndexMenu,N,N=Sub1)
(              �
24              �Open(Index,�,XPosition,YPosition)
<4              �Open(Index,�,XPosition,YPosition)
F            �
P
        �
Z
      � 2
d        � Sub1<>-1 �
n+          A$=$(PRMMenu+28+(24*Sub1)+12)
x          � A$<>PRM$ �
�            PRM$=A$
�            M%=PRMMenu+4
�            Counter=-1
�            �
�#              Counter+=1:M%+=24
�9              �TickMenu(PRMMenu,Counter,Counter=Sub1)
�$            � ((M%!0) � 128)=128
�#            �LoadPRMIndex(PRM$)
�            Counter=0
�=            �:Counter+=1:� �MenuTicked(IndexMenu,Counter)
�5            Index=�CreateIndexWindow(Counter-1,�)
�2            �Open(Index,�,XPosition,YPosition)
�2            �Open(Index,�,XPosition,YPosition)
          �
          M%=MainMenu

        �
"
      � 3
,+        ș "Wimp_GetPointerInfo",,Block
6;        ș "Wimp_CreateMenu",,Loc,Block!0-24,Block!4+24
@        CloseMenu=�
J
      � 4
T+        ș "Wimp_GetPointerInfo",,Block
^=        ș "Wimp_CreateMenu",,Save,Block!0-146,Block!4+60
h        CloseMenu=�
r
      � 5
|\        � � �SaveSettings � � 9999,"An error occurred whilst writing the settings file."
�	    �
��
�#ș "Wimp_GetPointerInfo",,Block
�3� ((Block!8 � 1)=1) � (� CloseMenu) � �MakeMenu
��
�:
�O� -------------------------------------------------------------------------
�� Menu routines
�O� -------------------------------------------------------------------------
�:
�� �BuildMenus
�I� This procedure should only be visited once, since it contains DIMs.
�  :
O� In the menu title strings below, if a "|" character is present it will be
O� replaced by a space under RISC OS 3.1 (or greater), or will terminate the
O� string under earlier versions of the wimp. This allows the new indirected
&F� menu titles to be used (which were introduced with RISC OS 3.1).
0  :
:#IndirectMenuTextOffsetPointer=0
DN� This points to a pool to be used by all menus for their indirected text.
N  :
X
M%=IBMenu
bHTitle$="SWI Index":� IBMenuTitle �(Title$)+1:$IBMenuTitle=Title$+�13
l�MenuInit(IBMenuTitle)
v�MenuItem("Info",0,Info)
��MenuItem("Quit",128,-1)
�  :
�M%=MainMenu
�LTitle$="SWI Index":� MainMenuTitle �(Title$)+2:$MainMenuTitle=Title$+�13
��MenuInit(MainMenuTitle)
��MenuItem("Info",2,Info)
�)�MenuItem("Module index",0,IndexMenu)
�)�MenuItem("PRM page index",0,PRMMenu)
�&�MenuItem("Window position",2,Loc)
�%�MenuItem("Save SWI list",0,Save)
�%�MenuItem("Save settings",128,-1)
��
�:
� �MakeMenu
� MenuX<0 � MenuX=0
*� MenuY<184 � MenuY=184:� for icon bar
 7ș "Wimp_CreateMenu",,M%,MenuX-((36+M%!16)/2),MenuY
*�
4:
>� �MenuInit(MenuTitle)
H� wimp>=310 �
R7  A=�$MenuTitle,"|"):� A<>0 � ?(MenuTitle+(A-1))=32
\  MenuMax=�($MenuTitle)
f  M%!0=MenuTitle
p�
z7  A=�$MenuTitle,"|"):� A<>0 � ?(MenuTitle+(A-1))=13
�   MenuMax=�(�$MenuTitle,12))
�  $M%=�$MenuTitle,12)
��
�$M%?12=7:M%?13=2:M%?14=11:M%?15=0
�M%!16=MenuMax*16
�M%!20=44:M%!24=0
�P%=M%+28
��
�:
�!� �MenuItem(Text$,Flags,Link)
�K� Flags: 1-ticked, 2-dashed line, 4-writeable, 8-message, 128-last item
�1� Link: menu or window handle for sub-pointer
�P%!0=Flags:P%!4=Link
� �(Text$)<=12 �
%  P%!8=&07003021:� Not indirected
  $(P%+12)=Text$
$�
.!  P%!8=&07003121:� Indirected
8:  P%!12=IndirectMenuText+IndirectMenuTextOffsetPointer
B  P%!16=0:P%!20=0
LA  $(IndirectMenuText+IndirectMenuTextOffsetPointer)=Text$+�13
V/  IndirectMenuTextOffsetPointer+=�(Text$)+1
`�  � IndirectMenuTextOffsetPointer>IndMenuMax � � 0,"The indirect menu text buffer has overflowed. Please allocate more space."
j�
t
P%+=24
~>� MenuMax<�(Text$) � MenuMax=�(Text$):M%!16=(MenuMax+1)*16
�A� (Flags=128) � (wimp>=310) � M%!28=(((M%!28) � � 256) � 256)
�7  � Indirected menu titles for RISC OS 3.1 upwards.
��
�:
�O� -------------------------------------------------------------------------
�)� Responses to incoming wimp messages
�O� -------------------------------------------------------------------------
�:
�� �SaveDesktop(File)
�� �
�G� � � Block!12=Block!8:ș "Wimp_SendMessage",19,Block,Block!4:� �:�
�I� The above line acknowledges the message if an error occurs, thereby
 � aborting the desktop save.

+�#File,"Run "+OurPathName$+OurFileName$
�
:
(� �Help
24Block!12=Block!8:Block!16=&503:HelpInfo=Block+20
<  :
F0� Block!32 gives window, Block!36 gives icon
P  :
ZȎ Block!32 �
d/  � -2:�Send("This is the SWI Index icon.")
n=          �Send("Click MENU for information or to quit.")
xA          �Send("Click SELECT to open the SWI Index window.")
��  � Index:�Send("This window displays all the SWI calls provided by a module, and their page references if they are documented in the Programmer's Reference Manual.")
�J             �Send("The word on the raised border is the SWI prefix.")
�7             �Send("Click MENU for the main menu.")
�G  � Info:�Send("This window displays information about SWI Index.")
�Z            �Send("SWI Index is a member of the OmniDesk Suite of desktop utilities.")
�  � Loc:
�
   Ȏ � �
�m     � ((Block!36)<6):�Send("This window lets you snap the magnifier window to an invisble screen grid.")
ҝ                         �Send("The second position up puts the window just above the icon-bar, and is therefore not evenly spaced with the other rows.")
܇      �Send("Click SELECT on the position you want the window to snap to, or ADJUST on the window icon to turn the snapping off.")
�u               �Send("If snapping is on, the window will open at the appropriate position when you change mode.")
�   �
� � Save:
   Ȏ Block!36 �
�     � 0:�Send("Drag the file icon to a filer window or to another application which can accept text files, or enter a filename and click OK (or press RETURN) to save.")
m     � 1:�Send("Drag this icon to a filer window or to another application which can accept text files.")
"�     � 2:�Send("Enter a filename here and click OK (or press RETURN) to save, or drag the file icon to a filer window or to another application which can accept text files.")
,�     � 3:�Send("Click OK (or press RETURN) to save the file, or drag the file icon to a filer window or to another application which can accept text files.")
6�     � 4:�Send("Click SELECT or ADJUST to toggle between saving details of just the displayed module or of all currently loaded modules.")
@,      �Send("This is the Save window.")
J�               �Send("The file saved will either contain details of the SWI calls provided by the displayed module or by all modules, depending on the setting of the switch at the bottom of the window.")
T   �
^
h  � wimp>=217 �
r1    MenuHelp!0=-1:MenuHelp!4=-1:MenuHelp!8=-1
|;    ș "Wimp_GetMenuState",1,MenuHelp,Block!32,Block!36
�    Ȏ M% �
�      � IBMenu:
�        � MenuHelp!4=-1 �
�          Ȏ MenuHelp!0 �
�W            � 0:�Send("Move the pointer right to see information about SWI Index.")
�<            � 1:�Send("Click SELECT to quit SWI Index.")
�?             �Send("This is the SWI Index icon-bar menu.")
�          �
�
        �
�      � MainMenu:
�W        Direction$="right":� wimp>=310 � �(MainMenuTitle?0)="\" � Direction$="left"
�        Ȏ MenuHelp!0 �
�^          � 0:�Send("Move the pointer "+Direction$+" to see information about SWI Index.")
!          � 1:Ȏ MenuHelp!4 �
�                   � -1:�Send("The module index menu contains a list of the currently loaded modules which provide SWI calls.")
Y                   � 0:�Send("Click SELECT or ADJUST to update the list of modules.")
&�                    �Send("Click SELECT or ADJUST to display details of this module's SWI calls in the main SWI Index window.")
0                 �
:r          � 2:�Send("Choose your edition of the Programmer's Reference Manual from the PRM Edition sub-menu.")
Di                 �Send("The page references in the SWI Index window will be updated as appropriate.")
Nu          � 3:�Send("Move the pointer "+Direction$+" to set the position of the SWI Index window on the screen.")
X�          � 4:�Send("Move the pointer "+Direction$+" to save details of the SWI calls provided by this module, or by all modules.")
bu          � 5:�Send("Click SELECT or ADJUST to save the SWI Index window position and the selected PRM edition.")
l9           �Send("This is the SWI Index main menu.")
v
        �
�	    �
�  �
��
�  :
�?HelpInfo=0
�$Block!0=(HelpInfo+4-Block) � � 3
�*ș "Wimp_SendMessage",17,Block,Block!4
��
�:
�� �OmniHelpMessage(A$)
�9� A$="CLICK" � =�"open the SWI Index window.",76)+�13
�� A$="DRAG" � =�"",76)+�13
�=""
:
� �Send(Text$)
$HelpInfo=Text$+"|M"
 HelpInfo+=�(Text$)+2
*�
4:
>� �OmniDeskCalling
H� OmniDesk=0 � �
RI� This first line is for if a broadcast message is received which was
\A� intended for a transient copy of the utility. A stand-alone
f?� instantiation of the utility should ignore such messages.
pȎ Block!20 �
z+  � 4:� � ScannedModules � �ScanModules
�7         � Index=-1 � Index=�CreateIndexWindow(0,�)
�/         �Open(Index,�,XPosition,YPosition)
��
��
�:
�� �ModeChange
�DoModeChange=�
�>� OmniDesk=0 � �UpdateIconForMode("!SWI�Index",-2,IconBar)
��
�:
�O� -------------------------------------------------------------------------
�8� General non-specific useful routines (mostly wimp)
�O� -------------------------------------------------------------------------
:
 � �UpdateIcon(Wndw,Icn,Txt$)
:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
$� �(Txt$)>(Block!36)-1 �
.&  � ((Block!24) � (1<<9))=(1<<9) �
8    � Right-justified
B$    Txt$="�"+�Txt$,(Block!36)-2)
L  �
V#    � Left-justified or centred
`+    Txt$=�Txt$,(Block!36)-1):�Txt$)="�"
j  �
t�
~F� ^ Ensures the text can't overflow the maximum space in the icon.
�� $(Block!28)<>Txt$ �
�+  $(Block!28)=Txt$:Block!8=0:Block!12=0
�#  ș "Wimp_SetIconState",,Block
��
�%ș "Wimp_GetCaretPosition",,Block
�"� Block!0=Wndw � Block!4=Icn �
�<  � If this icon owns the caret, then put it at the end.
�8  ș "Wimp_SetCaretPosition",Wndw,Icn,0,0,-1,�(Txt$)
��
��
�:
�+� �UpdateIconColour(Wndw,Icn,FCol,BCol)
� Change an icon's colours

:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
;� (((Block?27)>>4)=BCol) � (((Block?27) � 16)=FCol) � �
'  � ^ Same colour, so don't change.
(:Block!12=(%11111111<<24):Block!8=(BCol<<28)+(FCol<<24)
2!ș "Wimp_SetIconState",,Block
<�
F:
P)� �UpdateSelectedFlag(Wndw,Icn,State)
Z1� Use State=TRUE to make icon become selected
d:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
n/� ((Block!24) � (1<<21))=((-State)<<21) � �
x@Block!12=(1<<21):� State � Block!8=(1<<21) � Block!8=(0<<21)
�!ș "Wimp_SetIconState",,Block
��
�:
�'� �UpdateShadedFlag(Wndw,Icn,State)
�/� Use State=TRUE to make icon become shaded
�:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
�/� ((Block!24) � (1<<22))=((-State)<<22) � �
�@Block!12=(1<<22):� State � Block!8=(1<<22) � Block!8=(0<<22)
�!ș "Wimp_SetIconState",,Block
��
�:
�� �SelectedState(Wndw,Icn)
�:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
)� ((Block!24) � (1<<21))=(1<<21) � =�
=�
:
"� �ShadedState(Wndw,Icn)
,:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
6)� ((Block!24) � (1<<22))=(1<<22) � =�
@=�
J:
T� �OpenState(Wndw)
^5� Returns TRUE if window is open; false otherwise
h0Block!0=Wndw:ș "Wimp_GetWindowState",,Block
r)� ((Block!32) � (1<<16))=(1<<16) � =�
|=�
�:
�!� �ShadeMenu(Menu,Item,State)
�P!(Menu+28+(24*Item)+8)=(!(Menu+28+(24*Item)+8) � � (1<<22)) � ((-State)<<22)
��
�:
� � �TickMenu(Menu,Item,State)
�@!(Menu+28+(24*Item))=(!(Menu+28+(24*Item)) � � 1) � (-State)
��
�:
�� �MenuShaded(Menu,Item)
�5� (!(Menu+28+(24*Item)+8) � (1<<22))=(1<<22) � =�
�=�
�:
� �MenuTicked(Menu,Item)
'� (!(Menu+28+(24*Item)) � 1)=1 � =�
=�
&:
0� �ReadIcon(Wndw,Icn)
: � Read numeric value of icon
D:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
N=�($(Block!28))
X:
b� �ReadIconStr(Wndw,Icn)
l� Read string value of icon
v:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
�=$(Block!28)
�:
�� �ModeInfo(var$,mode)
�)� Use mode=-1 for current screen mode
�
Ȏ var$ �
�:  � "XPixels":ș "OS_ReadModeVariable",mode,11 � ,,var
�:  � "YPixels":ș "OS_ReadModeVariable",mode,12 � ,,var
�6  � "NCol":ș "OS_ReadModeVariable",mode,3 � ,,var
�<  � "XEigFactor":ș "OS_ReadModeVariable",mode,4 � ,,var
�<  � "YEigFactor":ș "OS_ReadModeVariable",mode,5 � ,,var
�?  � "BPP":ș "OS_ReadModeVariable",mode,9 � ,,var:var=2^var
�6   var=-1:� Fall-through for a faulty input value
��
=var
:
+� �UpdateIconForMode(Appname$,Wndw,Icn)
 N� This procedure requires that ALL the icon sprites are defined in mode 20
*N� or mode 27 (which is equivalent) with a mask but no palette. They should
4N� still appear to have the expected resolutions and number of colours, i.e
>N� !Sprites23: two colours, high resolution, !Sprites (actually !Sprites24)
HL� at mode 12 resolution (double height pixels) in 16 colours, and normal
RL� mode 20 resolution, 16 colours for the !Sprites22 icon. If this is not
\I� adhered to, then memory shortage errors may occur on a mode change.
fExtension$="24"
p$� �ModeInfo("YEigFactor",-1)<2 �
z   � �ModeInfo("NCol",-1)>2 �
�    Extension$="22"
�  �
�    Extension$="23"
�  �
��
�*ș "Wimp_BaseOfSprites" � ,iconsprite%
�Eș "OS_SpriteOp",256+25,iconsprite%,Appname$:� Delete icon sprite
�=� The following three lines assume a mask but no palette:
�bș "OS_SpriteOp",256+40,Sprites,Appname$+Extension$ � ,,,w,h,,mode:� Get info about new sprite
�\ș "OS_SpriteOp",256+15,iconsprite%,Appname$,0,w,h,mode:� Create replacement icon sprite
�>ș "OS_SpriteOp",256+29,iconsprite%,Appname$:� Create mask
�  :
�-� Paint sprite mask into iconsprite mask:
Qș "OS_SpriteOp",256+61,iconsprite%,Appname$,0 � r0,r1,r2,r3:� Output to mask
Uș "OS_SpriteOp",256+49,Sprites,Appname$+Extension$,0,0:� Paint mask from Sprites
7� 4,128:�:� Invert to make mask the right way round
$6ș "OS_SpriteOp",r0,r1,r2,r3:� Reset screen output
.  :
8#� Paint sprite into iconsprite:
B\ș "OS_SpriteOp",256+60,iconsprite%,Appname$,0 � r0,r1,r2,r3:� Output to new icon sprite
LWș "OS_SpriteOp",256+34,Sprites,Appname$+Extension$,0,0,8:� Paint copy from Sprites
V6ș "OS_SpriteOp",r0,r1,r2,r3:� Reset screen output
`:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
jEBlock!8=0:Block!12=0:ș "Wimp_SetIconState",,Block:� Re-plot icon
t�
~:
��� �CreateWindow(minX,minY,maxX,maxY,Xoffset,Yoffset,Handle,Flags,TitleCol,TitleBackCol,WorkCol,WorkBackCol,ScrollCol,SliderCol,InputCol,WminX,WminY,WmaxX,WmaxY,TitleFlags,Wbutton,SpritePoint,MinW,MinH,TitleData$)
�ZBlock!0=minX:Block!4=minY:Block!8=maxX:Block!12=maxY:Block!16=Xoffset:Block!20=Yoffset
�"Block!24=Handle:Block!28=Flags
�QBlock?32=TitleCol:Block?33=TitleBackCol:Block?34=WorkCol:Block?35=WorkBackCol
�FBlock?36=ScrollCol:Block?37=SliderCol:Block?38=InputCol:Block?39=0
�?Block!40=WminX:Block!44=WminY:Block!48=WmaxX:Block!52=WmaxY
�=Block!56=TitleFlags:Block!60=Wbutton:Block!64=SpritePoint
�_Block!68=(MinH<<15)+MinW :::::::::::: � 0,0 sets the minimum window with to the title width
�>$(Block+72)=TitleData$:Block!84=0 ::: � No icons initially
�0ș "Wimp_CreateWindow",,Block � WindowHandle
�=WindowHandle
�:
B� �CreateIcon(WindowHandle,minX,minY,maxX,maxY,Flags,IconData)

Block!0=WindowHandle
HBlock!4=minX:Block!8=minY:Block!12=maxX:Block!16=maxY:Block!20=Flags
?Block!24=IconData!0:Block!28=IconData!4:Block!32=IconData!8
(,ș "Wimp_CreateIcon",,Block � IconHandle
2=IconHandle
<:
F� �Initialise
P-AppSize=�-&8000:MinSize=AppSize:SlotEnd=�
Z�
d:
n� �AllocateMemory(Required)
xSlotSize=�SlotSize(-1)
��� SlotSize<Required � NewSize=�SlotSize(Required):� NewSize<Required � SlotSize=�SlotSize(AppSize):=0:� Returns, indicating memory not claimed
�6� SlotSize>Required � SlotSize=�SlotSize(Required)
�*=SlotSize:� Returns with bytes claimed
�:
�� �SlotSize(Bytes)
�'ș "Wimp_SlotSize",Bytes,-1 � Bytes
�
=Bytes
�:
�� �MinimiseWimpSlot
�"dummy=�AllocateMemory(MinSize)
��
�:
�"� �CloseFileIfPoss(FileHandle)
� �
&� � � � �:�:� Unable to close file
�#FileHandle
"�
,:
6� �FindFileSize(FileName$)
@ � FileName$="<Wimp$Scrap>" �
J:  ș "OS_File",15,FileName$,,,FileName$ � ,,,,FileSize
T�
^4  N=-1:�:N+=1:� �FileName$,�(FileName$)-N,1)="."
hB  PathName$=�FileName$,�(FileName$)-N):LeafName$=�FileName$,N)
r:  ș "OS_File",13,LeafName$,,,PathName$ � ,,,,FileSize
|�
�
=FileSize
�:
�� �NextEntry
�H� Gets next entry (created by BPUT#Data,A$) from a file as a string.
�� Use as A$=FNNextEntry.
�� �
�&� � � � �:="":� Error reading file
�NE$=�#Data
�ȕ �NE$,1)="|"
�  NE$=�#Data
��
�=NE$
�:
 G� �DragBox(WindowHandle,IconHandle,DragType,SpriteArea,SpriteName$)
 8Block!0=WindowHandle:ș "Wimp_GetWindowState",,Block
  wminx=Block!4:wmaxy=Block!16
 &IBlock!0=WindowHandle:Block!4=IconHandle:ș "Wimp_GetIconState",,Block
 0>iminx=Block!8:iminy=Block!12:imaxx=Block!16:imaxy=Block!20
 :)Block!0=WindowHandle:Block!4=DragType
 DBlock!8=(wminx+iminx)
 NBlock!12=(wmaxy+iminy)
 XBlock!16=(wminx+imaxx)
 bBlock!20=(wmaxy+imaxy)
 lBlock!24=1:Block!28=1
 vGBlock!32=(�ModeInfo("Xpixels",-1)+1)*(2^�ModeInfo("XEigFactor",-1))
 �GBlock!36=(�ModeInfo("Ypixels",-1)+1)*(2^�ModeInfo("YEigFactor",-1))
 �� DragASprite �
 �E  ș "DragASprite_Start",%10000101,SpriteArea,SpriteName$,Block+8
 ��
 �  ș "Wimp_DragBox",,Block
 ��
 ��
 �:
 �O� -------------------------------------------------------------------------
 �/� Routines common to the OmniDesk utilities
 �O� -------------------------------------------------------------------------
 �:
 �� �DeclareToOmniDesk
!/Block!0=208:Block!12=0:Block!16=UtilDeclare
!Block!20=Task
!$(Block+24)=Taskname$
! $(Block+44)=OurFileName$
!*)$(Block+55)=�OmniHelpMessage("CLICK")
!4)$(Block+132)=�OmniHelpMessage("DRAG")
!>+ș "Wimp_SendMessage",17,Block,OmniDesk
!H�
!R:
!\� �SayGoodbye
!f� OmniDesk<>0 �
!p1  Block!0=24:Block!12=0:Block!16=UtilQuitting
!z  Block!20=Task
!�-  ș "Wimp_SendMessage",17,Block,OmniDesk
!��
!�!ș "Interface_CloseDown",Task
!�&ș "Wimp_CloseDown",Task,&4B534154
!��
!�:
!�� �ReadStartupString
!�M� Returns task handle of OmniDesk (which is passed in the command string)
!�&� or 0 if not started by OmniDesk.
!�ș "OS_GetEnv" � Command$
!�A=�Command$,"-Startup")
!�� A<>0 � Startup=�
!�A=�Command$,"-Exit")
"� A<>0 � Exit=�
"A=�Command$,"-OmniDesk")
"� A=0 � =0
"$=�(�Command$,A+9))
".:
"8 � �ReadWindowLocation(Axis$)
"BH� Reads which radio icon (if any) is selected in the Window Position
"LH� selector window and returns the axis coordinate (two calls needed)
"V%� or -1 for no position selected.
"`?Icon=5:�:Icon+=1:� (�SelectedState(Loc,Icon)=�) � (Icon=31)
"j*� Icon=31 � =-1:� All icons deselected
"t4Location=-1:Icon-=6:� Bring icon into range 0-14
"~Ȏ Axis$ �
"�!  � "X","x":Location=Icon � 5
"�%  � "Y","y":Location=4-(Icon � 5)
"��
"�
=Location
"�:
"�� �CleanUpLocWindow
"�O� Makes sure that none of the 'window' icons in the Loc window is selected.
"�	N=5:�
"�'N+=1:� N=30 � �SelectedState(Loc,N)
"� �UpdateSelectedFlag(Loc,N,�)
"��
"�:
#O� -------------------------------------------------------------------------
#
,� Special routines for this program only
#O� -------------------------------------------------------------------------
#:
#(� �ScanModules
#2K�MinimiseWimpSlot:� We have set things up so that this will NOT disturb
#<5                     � the loaded PRM index file.
#F,TotalModules=�CountLoadedModulesWithSWIs
#PFTotalModules+=1:� We need to insert the OS SWIs too, which are not
#Z2                � provided by a normal module.
#dE� We are about to build the index menu indirected data structure.
#nM� This structure will store the menu contents and information for opening
#xC� the index window (i.e. number of SWIs for depth calculation).
#�M� We want 32 bytes for each module: 1 for the number of SWIs (maximum any
#�F� module can have is 64); 4 for the base number of the module; and
#�E� 27 for the module title string to go into the menu. NB 27 is an
#�K� arbitrary maximum; however, the two modules InternationalKeyboard and
#�N� LaserDirectController both require 21 characters, so we may as well fill
#�K� up 32 bytes with this much space plus a little extra to be safe (i.e.
#�D� title length is maximum 26 characters plus a carriage return).
#�-� Summary: ModDataStruc  Length  Contents
#�=�                    +0       1  Number of SWIs in module
#�0�                    +1       4  Module base
#�J�                    +5      27  Module title (max. 26 chars + CHR$13)
#�  :
#�R� In the next line the '28+24+(24*TotalModules)' is for the index menu itself.
$ARequiredMem=MinSize+(32*TotalModules)+28+24+(24*TotalModules)
$  :
$&� �AllocateMemory(RequiredMem)=0 �
$"?  � Index<>-1 � Block!0=Index:ș "Wimp_DeleteWindow",,Block
$,7  Index=-1:� Mark Index window as 'not yet created'
$6T  � 9999,"Unable to claim enough memory for the index menu and associated data."
$@�
$J  :
$TModDataStruc=SlotEnd
$^"� First start off with the OS:
$hNamePointer=ModDataStruc+5
$r$NamePointer="OS"+�13
$|ModDataStruc!1=0
$�TotalSWIs=0
$�  :
$�ș "Hourglass_On"
$�ș "Hourglass_Percentage",0
$�  :
$�6� OS SWIs are numbered 0-255, then the set 256-511
$�0� are the various permutations of OS_WriteI.
$�4� We're going to ignore all but the first of the
$�3� OS_WriteI SWIs, and make a general reference.
$�� N=0 � 256
$�!  A$=�SWIName(N,Buffer,256,N)
$�  � A$<>"" � TotalSWIs+=1
$��
%  :
%ModDataStruc?0=TotalSWIs
%  :
%&J� Now go through all the other modules which are loaded at the moment:
%0GModNum=0:ModBase=0:SWIChunk=0:Prefix$="":ModName$="":IndexCounter=0
%:<ȕ �NextSWIMod(ModNum,ModBase,SWIChunk,Prefix$,ModName$)
%D,  � We haven't run out of modules yet...
%N  IndexCounter+=1
%X?  ș "Hourglass_Percentage",(100/TotalModules)*IndexCounter
%b=  ?(ModDataStruc+(32*IndexCounter)+0)=�CountSWIs(ModBase)
%l1  !(ModDataStruc+(32*IndexCounter)+1)=ModBase
%v;  $(ModDataStruc+(32*IndexCounter)+5)=�ModName$,26)+�13
%��
%�  :
%�C� We now have all the relevant modules stored in the data area.
%�;� However, the OS lists them in a very unhelpful order.
%�@� It would be much nicer if they were listed alphabetically,
%�C� so we'll now sort them into alphabetical order using a simple
%�� bubble-sort method:
%�  :
%�� N=1 � TotalModules-1
%�  � M=N+1 � TotalModules
%�E    � $(ModDataStruc+(32*(N-1))+5)>$(ModDataStruc+(32*(M-1))+5) �
%�F      Ȕ ?(ModDataStruc+(32*(N-1))+0),?(ModDataStruc+(32*(M-1))+0)
%�F      Ȕ !(ModDataStruc+(32*(N-1))+1),!(ModDataStruc+(32*(M-1))+1)
&F      Ȕ $(ModDataStruc+(32*(N-1))+5),$(ModDataStruc+(32*(M-1))+5)
&	    �
&  �
& �
&*  :
&4*� Now we want to build the index menu:
&>,IndexMenu=ModDataStruc+(32*TotalModules)
&H4M%=IndexMenu:IndexMenuWidth=�("Re-scan modules")
&RC�MenuInit(IndexMenuTitle):� Initialises P% as menu item pointer
&\TA$="Re-scan modules":�MenuItem(A$,2,-1):IndirectMenuTextOffsetPointer-=(�(A$)+1)
&fN� The line above moves the menu indirect text pointer back to the start of
&pK� the string for this menu item. The reason for this is that rebuilding
&zJ� this menu would keep adding this item into the buffer until it over-
&�J� flowed. Since this is the last menu we build (and the only one which
&�<� we rebuild), it's safe to mess about with the pointer.
&�� N=0 � TotalModules-1
&�  � Make menu item:
&�'  NamePointer=ModDataStruc+(32*N)+5
&�0  P%!0=0:P%!4=-1:P%!8=&07003121:� Indirected
&�.  P%!12=NamePointer:P%!16=0:P%!20=0:P%+=24
&�c  � IndexMenuWidth<�($NamePointer) � IndexMenuWidth=�($NamePointer):M%!16=(IndexMenuWidth+1)*16
&��
&�-P%-=24:P%!0=128:� Mark last item as final
&�I� wimp>=310 � M%!28=(((M%!28) � � 256) � 256):� Indirected menu title
&�D� That's built the menu; now attach its handle to the main menu:
&� MainMenu!(28+24+4)=IndexMenu
'�TickMenu(IndexMenu,1,�)
'ș "Hourglass_Off"
'ScannedModules=�
'$!Index=�CreateIndexWindow(0,�)
'.�
'8:
'B,� �CreateIndexWindow(Module,ResetScroll)
'Lș "Hourglass_Start",50
'V9� First delete the old window and return used memory:
'`  :
'j� Index<>-1 �
't3  Block!0=Index:ș "Wimp_GetWindowState",,Block
'~,  ScrollY=Block!24:BehindWindow=Block!28
'�  MinX=0
'�?  MaxY=�ModeInfo("YPixels",-1)*2^�ModeInfo("YEigFactor",-1)
'�@  � XPosition=-1 � YPosition=-1 � MinX=Block!4:MaxY=Block!16
'�#  ș "Wimp_DeleteWindow",,Block
'�  Index=-1
'�  � ResetScroll � ScrollY=0
'��
'�  ScrollY=0:BehindWindow=-1
'�C  MinX=(�ModeInfo("XPixels",-1)*2^�ModeInfo("XEigFactor",-1))/6
'�|  MaxY=(�ModeInfo("YPixels",-1)*2^�ModeInfo("YEigFactor",-1))-((�ModeInfo("YPixels",-1)*2^�ModeInfo("YEigFactor",-1))/6)
'��
'�6IndirectIconBase=IndexMenu+28+24+(24*TotalModules)
(ARequiredMem=MinSize+(32*TotalModules)+28+24+(24*TotalModules)
(
&dummy=�AllocateMemory(RequiredMem)
(Y� Minimises wimpslot whilst preserving PRM index file and module data structure/menu.
(  :
((Z� Now we need to work out how much indirected space is required for the entire window.
(2)� The label icons at the top require:
(<8�   SWI Call  :  9 bytes text  :  3 bytes validation
(F8�   SWI &     :  6 bytes text  :  3 bytes validation
(P8�   PRM Page  :  9 bytes text  :  3 bytes validation
(Z8�                                   = 33 bytes total
(d)� The rest of the window consists of:
(n.� (1): SWI prefix label and 3D border; and
(x0� (2): One indirected icon for each SWI name
(�.� (3): One direct icon for each SWI number
(�2� (4): One direct icon for each page reference
(�A� We don't know how long the SWI prefix label is going to be,
(�>� but the longest built-in SWI prefix known at the time of
(�=� writing (on RISC OS 3�1) is SharedCLibrary, which is 14
(�B� characters long. So we'll allow 18 bytes to accommodate this
(�F� plus a bit more to be on the safe side (17 characters + CHR$13).
(�D� No validation string is needed for the SWI labels, and no text
(�%� is needed for border icons. So:
(�F�   SWI prefix label       :  18 bytes text  :  3 bytes validation
(�F�   3D surrounding border  :   1 byte  text  :  3 bytes validation
(�F�                                                 = 24 bytes total
(�F�   1 icon per SWI call    :  50 bytes text  :  0 bytes validation
)(� The SWI label icon is of the form:
)9�   <SWI name excluding prefix> {31 characters} + " "
)9�   + <SWI Number excluding &>  { 6 characters} + " "
)"D�   + <PRM page reference if available> {10 characters} + CHR$13
),�   = 50 bytes total
)6E�   The SWI name and number are separated by a row of dots with a
)@�   space at either end.
)J7� So: total space required is 33 + 24 + (50 נSWIs)
)T7RequiredMem+=33+24+(50*?(ModDataStruc+(32*Module)))
)^  :
)h\� �AllocateMemory(RequiredMem)=0 � � 9999,"Unable to claim memory for the index window."
)r  :
)|,ModuleBase=!(ModDataStruc+(32*Module)+1)
)�G$(IndirectIconBase+0)="SWI Call"+�13:$(IndirectIconBase+9)="Z3"+�13
)�F$(IndirectIconBase+12)="SWI &"+�13:$(IndirectIconBase+18)="Z3"+�13
)�I$(IndirectIconBase+21)="PRM Page"+�13:$(IndirectIconBase+30)="Z3"+�13
)�P� That's the data set up for the three label icons at the top of the window.
)�KPrefix$=�SWIPrefix(ModuleBase,Buffer,256):� ModuleBase=0 � Prefix$="OS"
)�K$(IndirectIconBase+33)=�Prefix$,17)+�13:$(IndirectIconBase+51)="Z0"+�13
)�>$(IndirectIconBase+54)=�13:$(IndirectIconBase+55)="Z1"+�13
)�P� That's the data set up for the SWI prefix label and 3D surrounding border.
)�  :
)�_� We now go through all the SWIs in the module and put their text into the indirected icons
)�  :
)�/SWICount=0:SWINum=ModuleBase!28:TopLimit=63
)�/� ModuleBase=0 � SWINum=0:TopLimit=256:� OS
*  :
*4� Can we find the prefix in the PRM index store?
*(PageIndex=�PageIndexPresent(Prefix$)
*&N� A value of 0 means not present; otherwise we get the search base address
*0  :
*:� N=0 � TopLimit
*D,  SWIName$=�SWIName(SWINum,Buffer,256,N)
*N  � SWIName$<>"" �
*X    S$=�SWIName$,31)
*bE    � N=256 � S$="WriteI":� Our homage to this gargantuan set ...
*l    � �(S$)<31 � S$+=" "
*v    S$+=�31-�(S$),".")
*�    S$+=�5-�(�~SWINum),".")
*�    S$+=" "
*�    S$+=�~SWINum
*�    S$+=" "
*�    � PageIndex<>0 �
*�A      T$=�10,"."):�T$)=�" "+�LookUpPage(SWINum,PageIndex),10)
*�      S$+=T$
*�	    �
*�P    $(IndirectIconBase+58+(50*SWICount))=�S$,49)+�13:� LEFT$ just in case...
*�    SWICount+=1
*�  �
*�  SWINum+=1
*��
+&WorkExtent=-132-(40*SWICount+1)-12
+5� PageIndex=0 � WindowWidth=630 � WindowWidth=810
+�Index=�CreateWindow(MinX,WorkExtent,WindowWidth,MaxY,0,ScrollY,BehindWindow,%10110111000000000000000000000010,7,2,7,1,3,1,12,0,WorkExtent,WindowWidth,0,%11101,3,1,WindowWidth,0,"SWI�Index")
+ LIconData!0=IndirectIconBase+0:IconData!4=IndirectIconBase+9:IconData!8=9
+*HIcon=�CreateIcon(Index,14,-60,206,-12,&17000139,IconData):� SWI Call
+4NIconData!0=IndirectIconBase+12:IconData!4=IndirectIconBase+18:IconData!8=6
+>FIcon=�CreateIcon(Index,518,-60,618,-12,&17000139,IconData):� SWI &
+HNIconData!0=IndirectIconBase+21:IconData!4=IndirectIconBase+30:IconData!8=9
+RIIcon=�CreateIcon(Index,638,-60,798,-12,&17000139,IconData):� PRM Page
+\OIconData!0=IndirectIconBase+33:IconData!4=IndirectIconBase+51:IconData!8=18
+f]Icon=�CreateIcon(Index,24,-128,24+(16*�(Prefix$))+32,-80,&17000139,IconData):� SWI Prefix
+pNIconData!0=IndirectIconBase+54:IconData!4=IndirectIconBase+55:IconData!8=1
+zfIcon=�CreateIcon(Index,12,-132-(40*SWICount+1),WindowWidth-14,-108,&17000119,IconData):� 3D Border
+�� N=0 � SWICount-1
+�G  IconData!0=IndirectIconBase+58+(50*N):IconData!4=-1:IconData!8=50
+�a  Icon=�CreateIcon(Index,12,-132-(40*N+1)-40,WindowWidth-14,-132-(40*N+1),&17000111,IconData)
+��
+�ș "Hourglass_Off"
+�
=Index
+�:
+�E� �NextSWIMod(� ModNum,� ModBase,� SWIChunk,� Prefix$,� ModName$)
+�L� Return details of the current module base number, name and SWI prefix,
+�A� and update the module number to the next module in the list
+�C� (or return FALSE for no more modules). Skip any modules which
+�� don't provide SWIs.
+�� �
,� � � � �:=�
,�
,  �
,$'    InsNum=0:� Instantiation number
,.	    �
,8.      � Ignore alternative instantiations:
,B(      � they all have the same SWIs.
,LB      ș "OS_Module",12,ModNum,InsNum � ,ModNum,InsNum,ModBase
,V    � InsNum=0
,`    SWIChunk=ModBase!28
,j  � SWIChunk<>0
,t,  Prefix$=�SWIPrefix(ModBase,Buffer,256)
,~� Prefix$<>""
,�ModName$=�ModName(ModBase)
,�=�
,�:
,�� �ModName(ModBase)
,�@� Find a module name (SWI prefix) given a module base number
,�ModName$="":StringCount=0
,�.ȕ ?(ModBase+(ModBase!16)+StringCount)>=32
,�6  ModName$+=�(?(ModBase+(ModBase!16)+StringCount))
,�  StringCount+=1
,��
,�
=ModName$
,�:
-*� �SWIPrefix(ModBase,Buffer,BufferLen)
-
SWINum=(ModBase!28)
-=ș "OS_SWINumberToString",SWINum,Buffer,BufferLen � ,,Len
-Buffer?(Len-1)=13
-(A=�$Buffer,"_")
-2� A=0 � =""
-<=�$Buffer,A-1)
-F:
-P2� �SWIName(SWINum,Buffer,BufferLen,SWICounter)
-Z?� This function returns a SWI name with its prefix removed.
-d5� Undefined SWIs are returned as an empty string.
-n>� The last parameter (SWICounter) is the number of the SWI
-x?� within the module. We need it so that we can return as an
-�@� empty string SWIs of the form "Module_##" (i.e. undefined,
-�)� where ## is a number from 0 to 63).
-�  :
-�=ș "OS_SWINumberToString",SWINum,Buffer,BufferLen � ,,Len
-�Buffer?(Len-1)=13
-�A=�$Buffer,"_")
-�� A=0 � =""
-�"$Buffer=�$Buffer,�($Buffer)-A)
-�!� $Buffer=�(SWICounter) � =""
-�� $Buffer="Undefined" � =""
-�� $Buffer="NOP" � =""
-�3� �$Buffer,8)="Reserved" � �($Buffer)<=10 � =""
-�=$Buffer
.:
.!� �CountLoadedModulesWithSWIs
.Counter=0:N=0
."� � � �MoreMods(N,Counter)
.,=Counter
.6:
.@� �CountSWIs(ModBase)
.J!SWINum=(ModBase!28):Counter=0
.T=� We must examine all SWIs (up to 64 defined per module).
.^2� Unfortunately, we can't stop when we find an
.h:� undefined SWI, because the defined SWIs don't always
.r9� appear in a contiguous block. Therefore, we have to
.|0� search through all 64 SWIs in each module.
.��
.�8  A$=�SWIName(SWINum,Buffer,256,SWINum-(ModBase!28))
.�  � A$<>"" � Counter+=1
.�  SWINum+=1
.�� SWINum=(ModBase!28)+64
.�=Counter
.�:
.�� �MoreMods(� N,� Counter)
.�� �
.�� � � � �:=�
.�#InsNum=0:� Instantiation number
.��
.�*  � Ignore alternative instantiations:
/$  � they all have the same SWIs.
/4  ș "OS_Module",12,N,InsNum � ,N,InsNum,ModBase
/� InsNum=0
/&� (ModBase!28)<>0 �
/0?  ș "OS_SWINumberToString",(ModBase!28),Buffer,256 � ,,Len
/:  Buffer?(Len-1)=13
/D  A=�$Buffer,"_")
/N  � A>0 � Counter+=1
/X�
/b=�
/l:
/v� �TickPRMchoice(� PRM$)
/�C� The following will find the PRM file in the menu and tick it,
/�8� or tick the first item if the file is not present:
/�M%=PRMMenu+4:Counter=-1
/��
/�  M%+=24:Counter+=1
/�2� ($(M%+12)=PRM$) � (((M%!0) � (1<<7))=(1<<7))
/�g� $(M%+12)=PRM$ � �TickMenu(PRMMenu,Counter,�) � M%=PRMMenu+28:PRM$=$(M%+12):�TickMenu(PRMMenu,0,�)
/��
/�:
/� � �PageIndexPresent(Prefix$)
/�Address=PRMStore
/��
/�  A$=$(Address)
0  Address+=�(A$)+1
0� (A$="***") � (A$=Prefix$)
0� A$="***" � =0
0 =Address
0*:
04#� �LookUpPage(SWINum,� Address)
0>A$=$(Address)
0H� �A$,1)<>"&" � ="-"
0RAddressOffset=Address
0\�
0f  A$=$(AddressOffset)
0p  AddressOffset+=�(A$)+1
0z4� (�A$,�A$,",")-1)="&"+�~SWINum) � (�A$,1)<>"&")
0�� �A$,1)<>"&" � ="-"
0�Address=AddressOffset
0�=�A$,�(A$)-�A$,","))
0�:
0�� �LoadPRMIndex(PRM$)
0�L� We want to load the PRM Index file into memory for faster referencing.
0�D� PRMStore is defined when the menus are being built at startup.
0�Bș "OS_File",16,OurPathName$+"!SWI�Index.PRM."+PRM$,PRMStore,0
0��
0�:
0�� �BuildPRMMenu
0�M%=PRMMenu
0�LTitle$="PRM Edition":� PRMMenuTitle �(Title$)+1:$PRMMenuTitle=Title$+�13
1�MenuInit(PRMMenuTitle)
1G� The following code will build the PRM Edition menu, and will also
1H� find out the size of the largest PRM file so that we can put aside
1$A� that amount of memory to load any requested PRM index file.
1.File=0:LargestPRM=0
18ȕ File<>-1
1BJ  ș "OS_GBPB",10,"<SWIIndex$Dir>.PRM",Block,1,File,256,"*" � ,,,,File
1L/  � LargestPRM<Block!8 � LargestPRM=Block!8
1V=  Name$="":N=20:ȕ (Block?N)>=32:Name$+=�(Block?N):N+=1:�
1`L  � ((Block!16>-1) � (Block!16<4096)) � File<>-1 � �MenuItem(Name$,0,-1)
1j�
1tEP%-=24:� Reset menu item pointer to final item and mark as 'last'
1~P%!0=((P%!0) � � 128) � 128
1�I� wimp>=310 � M%!28=(((M%!28) � � 256) � 256):� Indirected menu title
1�L� We must be absolutely sure that LargestPRM is a multiple of 4: if not,
1�J� then PROCScanModules would try to build the index menu on an address
1�K� which falls across a word boundary, which would result in an 'Invalid
1�M� window handle' error when trying to access the menu. The next line will
1�M� increase LargestPRM by up to 3 bytes to make it a whole number of words
1�� long:
1�"LargestPRM+=4-(LargestPRM � 4)
1�=LargestPRM
1�:
1�!� �CreatePRMStore(LargestPRM)
1�0PRMStore=�AllocateMemory(AppSize+LargestPRM)
2V� PRMStore=0 � Done=�:� 9999,"Unable to claim enough memory to start up properly."
2
MinSize=AppSize+LargestPRM
2(PRMStore=SlotEnd:SlotEnd+=LargestPRM
2�
2(:
22!� �SaveSWIListToFile(Output$)
2<� �
2FQ� � � � �:ș "Hourglass_Smash":�CloseFileIfPoss(File):=�:� Error writing file
2P  :
2Z  File=� (Output$)
2d  � FullSave �
2n    ș "Hourglass_On"
2x    � N=0 � TotalModules-1
2�8      ș "Hourglass_Percentage",(100/TotalModules)*N
2�      �WriteModule(N)
2�*      � N<(TotalModules-1) � �#File,""
2�	    �
2�    ș "Hourglass_Off"
2�  �
2�?    Counter=0:�:Counter+=1:� �MenuTicked(IndexMenu,Counter)
2�    �WriteModule(Counter-1)
2�  �
2�  �#File
2�#  �("Settype "+Output$+" Text")
2�  :
2�=�
3:
3� �WriteModule(Module)
3,ModuleBase=!(ModDataStruc+(32*Module)+1)
3"SWINum=ModuleBase!28
3,-Prefix$=�SWIPrefix(ModuleBase,Buffer,256)
36!� ModuleBase=0 � Prefix$="OS"
3@8� Prefix$="OS" � TopLimit=255:SWINum=0 � TopLimit=63
3J3�#File,"Module: "+$(ModDataStruc+(32*Module)+5)
3T� S=0 � TopLimit
3^,  SWIName$=�SWIName(SWINum,Buffer,256,S)
3h  � SWIName$<>"" �
3r    A$=�7," ")
3|    �A$)=�~(SWINum)
3�    A$+=" "
3�    A$+=Prefix$+"_"
3�    A$+=SWIName$
3�    �#File,A$
3�  �
3�  SWINum+=1
3��
3�/� Prefix$="OS" � �#File,"    100 OS_WriteI"
3��
3�:
3�� �SaveSettings
3�� �
3�<� � � � �:�CloseFileIfPoss(Data):=�:� Error writing file
4  :
4(  Data=� ("<SWIIndex$Dir>.Settings")
4>  �#Data,"| X and Y grid coordinates of SWI Index window:"
4&  �#Data,�(XPosition)
40  �#Data,�(YPosition)
4:  �#Data,"| PRM Edition:"
4D  �#Data,PRM$
4N  �#Data
4X/  �("Settype <SWIIndex$Dir>.Settings Text")
4b  :
4l=�
4v:
4�� �LoadSettings
4�� �
4�O� � � � �:�CloseFileIfPoss(Data):=�:� 'Settings' file is damaged or missing
4�  :
4�&  Data=� "<SWIIndex$Dir>.Settings"
4�  XPosition=�(�NextEntry)
4�  YPosition=�(�NextEntry)
4�  PRM$=�NextEntry
4�  �#Data
4�  :
4�b  � XPosition<>-1 � YPosition<>-1 � �UpdateSelectedFlag(Loc,6+((5*XPosition)+(4-YPosition)),�)
4�  :
4�=�
5:
5� �DefaultSettings
5XPosition=4:YPosition=4
5 >�UpdateSelectedFlag(Loc,6+((5*XPosition)+(4-YPosition)),�)
5*�
�
00000000  0d 00 0a 1e f4 20 3e 21  52 75 6e 49 6d 61 67 65  |..... >!RunImage|
00000010  20 66 6f 72 20 53 57 49  20 49 6e 64 65 78 0d 00  | for SWI Index..|
00000020  14 05 3a 0d 00 1e 3e 56  65 72 73 69 6f 6e 4e 75  |..:...>VersionNu|
00000030  6d 62 65 72 24 3d 22 31  b7 30 33 20 28 32 37 20  |mber$="1.03 (27 |
00000040  4a 75 6c 79 20 31 39 39  33 29 22 3a 54 61 73 6b  |July 1993)":Task|
00000050  6e 61 6d 65 24 3d 22 53  57 49 a0 49 6e 64 65 78  |name$="SWI.Index|
00000060  22 0d 00 28 1b 45 78 69  74 3d a3 3a 53 74 61 72  |"..(.Exit=.:Star|
00000070  74 75 70 3d a3 3a 44 6f  6e 65 3d a3 0d 00 32 12  |tup=.:Done=...2.|
00000080  44 6f 4d 6f 64 65 43 68  61 6e 67 65 3d a3 0d 00  |DoModeChange=...|
00000090  3c 05 3a 0d 00 46 32 de  20 42 6c 6f 63 6b 20 32  |<.:..F2. Block 2|
000000a0  35 36 2c 42 75 66 66 65  72 20 32 35 36 2c 4d 65  |56,Buffer 256,Me|
000000b0  6e 75 48 65 6c 70 20 31  36 2c 49 63 6f 6e 44 61  |nuHelp 16,IconDa|
000000c0  74 61 20 31 32 0d 00 50  2f 49 6e 64 4d 65 6e 75  |ta 12..P/IndMenu|
000000d0  4d 61 78 3d 38 30 3a de  20 49 6e 64 69 72 65 63  |Max=80:. Indirec|
000000e0  74 4d 65 6e 75 54 65 78  74 20 49 6e 64 4d 65 6e  |tMenuText IndMen|
000000f0  75 4d 61 78 0d 00 5a 37  de 20 54 65 6d 70 6c 61  |uMax..Z7. Templa|
00000100  74 65 73 20 31 36 33 36  2c 49 6e 66 6f 49 6e 64  |tes 1636,InfoInd|
00000110  20 31 39 30 2c 4c 6f 63  49 6e 64 20 35 39 32 2c  | 190,LocInd 592,|
00000120  53 61 76 65 49 6e 64 20  33 37 39 0d 00 64 1c de  |SaveInd 379..d..|
00000130  20 49 42 4d 65 6e 75 20  37 36 2c 4d 61 69 6e 4d  | IBMenu 76,MainM|
00000140  65 6e 75 20 31 37 32 0d  00 6e 2e de 20 50 52 4d  |enu 172..n.. PRM|
00000150  4d 65 6e 75 20 32 32 30  3a f4 20 45 6e 6f 75 67  |Menu 220:. Enoug|
00000160  68 20 73 70 61 63 65 20  66 6f 72 20 38 20 65 6e  |h space for 8 en|
00000170  74 72 69 65 73 0d 00 78  05 3a 0d 00 82 2a f4 20  |tries..x.:...*. |
00000180  4d 65 73 73 61 67 65 73  20 75 73 65 64 20 62 79  |Messages used by|
00000190  20 74 68 65 20 4f 6d 6e  69 44 65 73 6b 20 73 75  | the OmniDesk su|
000001a0  69 74 65 3a 0d 00 8c 5f  55 74 69 6c 44 65 63 6c  |ite:..._UtilDecl|
000001b0  61 72 65 3d 26 38 32 35  43 30 3a 55 74 69 6c 4f  |are=&825C0:UtilO|
000001c0  70 65 6e 3d 26 38 32 35  43 31 3a 55 74 69 6c 51  |pen=&825C1:UtilQ|
000001d0  75 69 74 74 69 6e 67 3d  26 38 32 35 43 32 3a 55  |uitting=&825C2:U|
000001e0  74 69 6c 52 65 73 69 64  65 3d 26 38 32 35 43 33  |tilReside=&825C3|
000001f0  3a 55 74 69 6c 41 63 6b  4c 6f 61 64 3d 26 38 32  |:UtilAckLoad=&82|
00000200  35 43 34 0d 00 96 2b f4  20 54 68 65 73 65 20 61  |5C4...+. These a|
00000210  72 65 20 6f 66 66 69 63  69 61 6c 20 41 63 6f 72  |re official Acor|
00000220  6e 20 61 6c 6c 6f 63 61  74 69 6f 6e 73 2e 0d 00  |n allocations...|
00000230  a0 05 3a 0d 00 aa 4c ee  20 85 20 42 6c 6f 63 6b  |..:...L. . Block|
00000240  21 30 3d 9f 3a 24 28 42  6c 6f 63 6b 2b 34 29 3d  |!0=.:$(Block+4)=|
00000250  f6 24 2b bd 30 3a c8 99  20 22 57 69 6d 70 5f 52  |.$+.0:.. "Wimp_R|
00000260  65 70 6f 72 74 45 72 72  6f 72 22 2c 42 6c 6f 63  |eportError",Bloc|
00000270  6b 2c 31 2c 54 61 73 6b  6e 61 6d 65 24 3a e0 0d  |k,1,Taskname$:..|
00000280  00 b4 05 3a 0d 00 be 3f  4f 6d 6e 69 44 65 73 6b  |...:...?OmniDesk|
00000290  3d a4 52 65 61 64 53 74  61 72 74 75 70 53 74 72  |=.ReadStartupStr|
000002a0  69 6e 67 3a f4 20 41 6c  73 6f 20 61 73 73 69 67  |ing:. Also assig|
000002b0  6e 73 20 45 78 69 74 20  61 6e 64 20 53 74 61 72  |ns Exit and Star|
000002c0  74 75 70 0d 00 c8 05 3a  0d 00 d2 1a 2a 53 65 74  |tup....:....*Set|
000002d0  20 53 57 49 49 6e 64 65  78 24 52 49 53 43 4f 53  | SWIIndex$RISCOS|
000002e0  20 33 0d 00 dc 36 2a 52  4d 45 6e 73 75 72 65 20  | 3...6*RMEnsure |
000002f0  55 74 69 6c 69 74 79 4d  6f 64 75 6c 65 20 33 2e  |UtilityModule 3.|
00000300  30 30 20 53 65 74 20 53  57 49 49 6e 64 65 78 24  |00 Set SWIIndex$|
00000310  52 49 53 43 4f 53 20 32  0d 00 e6 59 c8 99 20 22  |RISCOS 2...Y.. "|
00000320  58 4f 53 5f 52 65 61 64  56 61 72 56 61 6c 22 2c  |XOS_ReadVarVal",|
00000330  22 53 57 49 49 6e 64 65  78 24 52 49 53 43 4f 53  |"SWIIndex$RISCOS|
00000340  22 2c 42 6c 6f 63 6b 2c  32 35 36 2c 30 2c 30 20  |",Block,256,0,0 |
00000350  b8 20 2c 2c 6c 65 6e 3a  42 6c 6f 63 6b 3f 6c 65  |. ,,len:Block?le|
00000360  6e 3d 31 33 3a 77 69 6d  70 24 3d 24 42 6c 6f 63  |n=13:wimp$=$Bloc|
00000370  6b 0d 00 f0 1c e7 20 77  69 6d 70 24 3c 3e 22 33  |k..... wimp$<>"3|
00000380  22 20 8c 20 77 69 6d 70  24 3d 22 32 22 0d 00 fa  |" . wimp$="2"...|
00000390  1a 2a 55 6e 73 65 74 20  53 57 49 49 6e 64 65 78  |.*Unset SWIIndex|
000003a0  24 52 49 53 43 4f 53 0d  01 04 05 3a 0d 01 0e 20  |$RISCOS....:... |
000003b0  2a 53 65 74 20 53 57 49  49 6e 64 65 78 24 53 70  |*Set SWIIndex$Sp|
000003c0  72 69 74 65 44 72 61 67  20 59 65 73 0d 01 18 39  |riteDrag Yes...9|
000003d0  2a 52 4d 45 6e 73 75 72  65 20 44 72 61 67 41 53  |*RMEnsure DragAS|
000003e0  70 72 69 74 65 20 30 2e  30 30 20 53 65 74 20 53  |prite 0.00 Set S|
000003f0  57 49 49 6e 64 65 78 24  53 70 72 69 74 65 44 72  |WIIndex$SpriteDr|
00000400  61 67 20 4e 6f 0d 01 22  50 c8 99 20 22 58 4f 53  |ag No.."P.. "XOS|
00000410  5f 52 65 61 64 56 61 72  56 61 6c 22 2c 22 53 57  |_ReadVarVal","SW|
00000420  49 49 6e 64 65 78 24 53  70 72 69 74 65 44 72 61  |IIndex$SpriteDra|
00000430  67 22 2c 42 6c 6f 63 6b  2c 32 35 36 2c 30 2c 30  |g",Block,256,0,0|
00000440  20 b8 20 2c 2c 6c 65 6e  3a 42 6c 6f 63 6b 3f 6c  | . ,,len:Block?l|
00000450  65 6e 3d 31 33 0d 01 2c  32 e7 20 24 42 6c 6f 63  |en=13..,2. $Bloc|
00000460  6b 3d 22 59 65 73 22 20  8c 20 44 72 61 67 41 53  |k="Yes" . DragAS|
00000470  70 72 69 74 65 3d b9 3a  8b 20 44 72 61 67 41 53  |prite=.:. DragAS|
00000480  70 72 69 74 65 3d a3 0d  01 36 1e 2a 55 6e 73 65  |prite=...6.*Unse|
00000490  74 20 53 57 49 49 6e 64  65 78 24 53 70 72 69 74  |t SWIIndex$Sprit|
000004a0  65 44 72 61 67 0d 01 40  05 3a 0d 01 4a 59 c8 99  |eDrag..@.:..JY..|
000004b0  20 22 58 4f 53 5f 52 65  61 64 56 61 72 56 61 6c  | "XOS_ReadVarVal|
000004c0  22 2c 22 4f 62 65 79 24  44 69 72 22 2c 42 6c 6f  |","Obey$Dir",Blo|
000004d0  63 6b 2c 32 35 36 2c 30  2c 30 20 b8 20 2c 2c 6c  |ck,256,0,0 . ,,l|
000004e0  65 6e 3a 42 6c 6f 63 6b  3f 6c 65 6e 3d 31 33 3a  |en:Block?len=13:|
000004f0  4f 75 72 46 69 6c 65 4e  61 6d 65 24 3d 24 42 6c  |OurFileName$=$Bl|
00000500  6f 63 6b 0d 01 54 38 4e  3d 2d 31 3a f5 3a 4e 2b  |ock..T8N=-1:.:N+|
00000510  3d 31 3a fd 20 c1 4f 75  72 46 69 6c 65 4e 61 6d  |=1:. .OurFileNam|
00000520  65 24 2c a9 28 4f 75 72  46 69 6c 65 4e 61 6d 65  |e$,.(OurFileName|
00000530  24 29 2d 4e 2c 31 29 3d  22 2e 22 0d 01 5e 4f 4f  |$)-N,1)="."..^OO|
00000540  75 72 50 61 74 68 4e 61  6d 65 24 3d c0 4f 75 72  |urPathName$=.Our|
00000550  46 69 6c 65 4e 61 6d 65  24 2c a9 28 4f 75 72 46  |FileName$,.(OurF|
00000560  69 6c 65 4e 61 6d 65 24  29 2d 4e 29 3a 4f 75 72  |ileName$)-N):Our|
00000570  46 69 6c 65 4e 61 6d 65  24 3d c2 4f 75 72 46 69  |FileName$=.OurFi|
00000580  6c 65 4e 61 6d 65 24 2c  4e 29 0d 01 68 05 3a 0d  |leName$,N)..h.:.|
00000590  01 72 5e f4 20 52 65 61  64 20 73 69 7a 65 20 6f  |.r^. Read size o|
000005a0  66 20 73 70 72 69 74 65  20 66 69 6c 65 20 61 6e  |f sprite file an|
000005b0  64 20 6c 6f 61 64 20 69  74 2e 20 57 65 20 6e 65  |d load it. We ne|
000005c0  65 64 20 74 6f 20 44 49  4d 20 31 36 20 62 79 74  |ed to DIM 16 byt|
000005d0  65 73 20 6d 6f 72 65 20  74 68 61 6e 20 74 68 65  |es more than the|
000005e0  20 66 69 6c 65 27 73 20  73 69 7a 65 2e 0d 01 7c  | file's size...||
000005f0  39 c8 99 20 22 4f 53 5f  46 53 43 6f 6e 74 72 6f  |9.. "OS_FSContro|
00000600  6c 22 2c 32 38 2c 22 3c  53 57 49 49 6e 64 65 78  |l",28,"<SWIIndex|
00000610  24 44 69 72 3e 2e 53 70  72 69 74 65 73 22 20 b8  |$Dir>.Sprites" .|
00000620  20 2c 2c 6c 65 6e 0d 01  86 84 de 20 53 70 72 69  | ,,len..... Spri|
00000630  74 65 73 20 6c 65 6e 2b  31 36 3a 21 53 70 72 69  |tes len+16:!Spri|
00000640  74 65 73 3d 6c 65 6e 2b  31 36 3a 53 70 72 69 74  |tes=len+16:Sprit|
00000650  65 73 21 34 3d 30 3a 53  70 72 69 74 65 73 21 38  |es!4=0:Sprites!8|
00000660  3d 31 36 3a 53 70 72 69  74 65 73 21 31 32 3d 31  |=16:Sprites!12=1|
00000670  36 3a c8 99 20 22 4f 53  5f 53 70 72 69 74 65 4f  |6:.. "OS_SpriteO|
00000680  70 22 2c 32 35 36 2b 31  30 2c 53 70 72 69 74 65  |p",256+10,Sprite|
00000690  73 2c 22 3c 53 57 49 49  6e 64 65 78 24 44 69 72  |s,"<SWIIndex$Dir|
000006a0  3e 2e 53 70 72 69 74 65  73 22 0d 01 90 05 3a 0d  |>.Sprites"....:.|
000006b0  01 9a 11 e7 20 77 69 6d  70 24 3d 22 33 22 20 8c  |.... wimp$="3" .|
000006c0  0d 01 a4 17 20 20 de 20  6d 65 73 73 61 67 65 6c  |....  . messagel|
000006d0  69 73 74 25 20 33 36 0d  01 ae 2f 20 20 6d 65 73  |ist% 36.../  mes|
000006e0  73 61 67 65 6c 69 73 74  25 21 30 3d 26 35 30 32  |sagelist%!0=&502|
000006f0  3a 6d 65 73 73 61 67 65  6c 69 73 74 25 21 34 3d  |:messagelist%!4=|
00000700  26 34 30 30 43 31 0d 01  b8 3a 20 20 6d 65 73 73  |&400C1...:  mess|
00000710  61 67 65 6c 69 73 74 25  21 38 3d 55 74 69 6c 4f  |agelist%!8=UtilO|
00000720  70 65 6e 3a 6d 65 73 73  61 67 65 6c 69 73 74 25  |pen:messagelist%|
00000730  21 31 32 3d 55 74 69 6c  51 75 69 74 74 69 6e 67  |!12=UtilQuitting|
00000740  0d 01 c2 33 20 20 6d 65  73 73 61 67 65 6c 69 73  |...3  messagelis|
00000750  74 25 21 31 36 3d 55 74  69 6c 52 65 73 69 64 65  |t%!16=UtilReside|
00000760  3a 6d 65 73 73 61 67 65  6c 69 73 74 25 21 32 30  |:messagelist%!20|
00000770  3d 31 30 0d 01 cc 3b 20  20 6d 65 73 73 61 67 65  |=10...;  message|
00000780  6c 69 73 74 25 21 32 34  3d 34 3a 6d 65 73 73 61  |list%!24=4:messa|
00000790  67 65 6c 69 73 74 25 21  32 38 3d 32 3a 6d 65 73  |gelist%!28=2:mes|
000007a0  73 61 67 65 6c 69 73 74  25 21 33 32 3d 30 0d 01  |sagelist%!32=0..|
000007b0  d6 4b 20 20 c8 99 20 22  57 69 6d 70 5f 49 6e 69  |.K  .. "Wimp_Ini|
000007c0  74 69 61 6c 69 73 65 22  2c 33 30 30 2c 26 34 42  |tialise",300,&4B|
000007d0  35 33 34 31 35 34 2c 54  61 73 6b 6e 61 6d 65 24  |534154,Taskname$|
000007e0  2c 6d 65 73 73 61 67 65  6c 69 73 74 25 20 b8 20  |,messagelist% . |
000007f0  77 69 6d 70 2c 54 61 73  6b 0d 01 e0 05 cc 0d 01  |wimp,Task.......|
00000800  ea 3e 20 20 c8 99 20 22  57 69 6d 70 5f 49 6e 69  |.>  .. "Wimp_Ini|
00000810  74 69 61 6c 69 73 65 22  2c 32 30 30 2c 26 34 42  |tialise",200,&4B|
00000820  35 33 34 31 35 34 2c 54  61 73 6b 6e 61 6d 65 24  |534154,Taskname$|
00000830  20 b8 20 77 69 6d 70 2c  54 61 73 6b 0d 01 f4 05  | . wimp,Task....|
00000840  cd 0d 01 fe 05 3a 0d 02  08 22 c8 99 20 22 49 6e  |.....:...".. "In|
00000850  74 65 72 66 61 63 65 5f  49 6e 69 74 69 61 6c 69  |terface_Initiali|
00000860  73 65 22 2c 54 61 73 6b  0d 02 12 05 3a 0d 02 1c  |se",Task....:...|
00000870  36 c8 99 20 22 57 69 6d  70 5f 4f 70 65 6e 54 65  |6.. "Wimp_OpenTe|
00000880  6d 70 6c 61 74 65 22 2c  2c 22 3c 53 57 49 49 6e  |mplate",,"<SWIIn|
00000890  64 65 78 24 44 69 72 3e  2e 54 65 6d 70 6c 61 74  |dex$Dir>.Templat|
000008a0  65 73 22 0d 02 26 45 c8  99 20 22 57 69 6d 70 5f  |es"..&E.. "Wimp_|
000008b0  4c 6f 61 64 54 65 6d 70  6c 61 74 65 22 2c 2c 54  |LoadTemplate",,T|
000008c0  65 6d 70 6c 61 74 65 73  2c 49 6e 66 6f 49 6e 64  |emplates,InfoInd|
000008d0  2c 49 6e 66 6f 49 6e 64  2b 31 39 30 2c 2d 31 2c  |,InfoInd+190,-1,|
000008e0  22 49 6e 66 6f 22 2c 30  0d 02 30 2c c8 99 20 22  |"Info",0..0,.. "|
000008f0  57 69 6d 70 5f 43 72 65  61 74 65 57 69 6e 64 6f  |Wimp_CreateWindo|
00000900  77 22 2c 2c 54 65 6d 70  6c 61 74 65 73 20 b8 20  |w",,Templates . |
00000910  49 6e 66 6f 0d 02 3a 5c  c8 99 20 22 57 69 6d 70  |Info..:\.. "Wimp|
00000920  5f 4c 6f 61 64 54 65 6d  70 6c 61 74 65 22 2c 2c  |_LoadTemplate",,|
00000930  54 65 6d 70 6c 61 74 65  73 2c 4c 6f 63 49 6e 64  |Templates,LocInd|
00000940  2c 4c 6f 63 49 6e 64 2b  35 39 32 2c 2d 31 2c 22  |,LocInd+592,-1,"|
00000950  57 69 6e 64 6f 77 58 59  22 2c 30 3a 54 65 6d 70  |WindowXY",0:Temp|
00000960  6c 61 74 65 73 21 36 34  3d 53 70 72 69 74 65 73  |lates!64=Sprites|
00000970  0d 02 44 2b c8 99 20 22  57 69 6d 70 5f 43 72 65  |..D+.. "Wimp_Cre|
00000980  61 74 65 57 69 6e 64 6f  77 22 2c 2c 54 65 6d 70  |ateWindow",,Temp|
00000990  6c 61 74 65 73 20 b8 20  4c 6f 63 0d 02 4e 45 c8  |lates . Loc..NE.|
000009a0  99 20 22 57 69 6d 70 5f  4c 6f 61 64 54 65 6d 70  |. "Wimp_LoadTemp|
000009b0  6c 61 74 65 22 2c 2c 54  65 6d 70 6c 61 74 65 73  |late",,Templates|
000009c0  2c 53 61 76 65 49 6e 64  2c 53 61 76 65 49 6e 64  |,SaveInd,SaveInd|
000009d0  2b 33 37 39 2c 2d 31 2c  22 53 61 76 65 22 2c 30  |+379,-1,"Save",0|
000009e0  0d 02 58 2c c8 99 20 22  57 69 6d 70 5f 43 72 65  |..X,.. "Wimp_Cre|
000009f0  61 74 65 57 69 6e 64 6f  77 22 2c 2c 54 65 6d 70  |ateWindow",,Temp|
00000a00  6c 61 74 65 73 20 b8 20  53 61 76 65 0d 02 62 1b  |lates . Save..b.|
00000a10  c8 99 20 22 57 69 6d 70  5f 43 6c 6f 73 65 54 65  |.. "Wimp_CloseTe|
00000a20  6d 70 6c 61 74 65 22 0d  02 6c 05 3a 0d 02 76 30  |mplate"..l.:..v0|
00000a30  f2 55 70 64 61 74 65 49  63 6f 6e 28 53 61 76 65  |.UpdateIcon(Save|
00000a40  2c 34 2c 22 54 68 69 73  20 4d 6f 64 75 6c 65 22  |,4,"This Module"|
00000a50  29 3a 46 75 6c 6c 53 61  76 65 3d a3 0d 02 80 15  |):FullSave=.....|
00000a60  f2 43 6c 65 61 6e 55 70  4c 6f 63 57 69 6e 64 6f  |.CleanUpLocWindo|
00000a70  77 0d 02 8a 1e 52 65 61  64 45 72 72 6f 72 3d ac  |w....ReadError=.|
00000a80  28 a4 4c 6f 61 64 53 65  74 74 69 6e 67 73 29 0d  |(.LoadSettings).|
00000a90  02 94 05 3a 0d 02 9e 5b  54 69 74 6c 65 24 3d 22  |...:...[Title$="|
00000aa0  4d 6f 64 75 6c 65 73 7c  70 72 6f 76 69 64 69 6e  |Modules|providin|
00000ab0  67 20 53 57 49 73 22 3a  de 20 49 6e 64 65 78 4d  |g SWIs":. IndexM|
00000ac0  65 6e 75 54 69 74 6c 65  20 a9 28 54 69 74 6c 65  |enuTitle .(Title|
00000ad0  24 29 2b 32 3a 24 49 6e  64 65 78 4d 65 6e 75 54  |$)+2:$IndexMenuT|
00000ae0  69 74 6c 65 3d 54 69 74  6c 65 24 2b bd 31 33 0d  |itle=Title$+.13.|
00000af0  02 a8 4c 49 6e 64 65 78  4d 65 6e 75 3d 2d 31 3a  |..LIndexMenu=-1:|
00000b00  f4 20 54 65 6d 70 6f 72  61 72 79 3a 20 74 68 69  |. Temporary: thi|
00000b10  73 20 77 69 6c 6c 20 62  65 20 61 73 73 69 67 6e  |s will be assign|
00000b20  65 64 20 69 6e 20 50 52  4f 43 43 72 65 61 74 65  |ed in PROCCreate|
00000b30  49 6e 64 65 78 57 69 6e  64 6f 77 0d 02 b2 42 49  |IndexWindow...BI|
00000b40  6e 64 65 78 3d 2d 31 3a  f4 20 54 65 6d 70 6f 72  |ndex=-1:. Tempor|
00000b50  61 72 79 3a 20 74 68 69  73 20 77 69 6c 6c 20 62  |ary: this will b|
00000b60  65 20 61 73 73 69 67 6e  65 64 20 69 6e 20 50 52  |e assigned in PR|
00000b70  4f 43 53 63 61 6e 4d 6f  64 75 6c 65 73 0d 02 bc  |OCScanModules...|
00000b80  0f f2 42 75 69 6c 64 4d  65 6e 75 73 0d 02 c6 2d  |..BuildMenus...-|
00000b90  4c 61 72 67 65 73 74 50  52 4d 3d a4 42 75 69 6c  |LargestPRM=.Buil|
00000ba0  64 50 52 4d 4d 65 6e 75  3a 53 63 61 6e 6e 65 64  |dPRMMenu:Scanned|
00000bb0  4d 6f 64 75 6c 65 73 3d  a3 0d 02 d0 05 3a 0d 02  |Modules=.....:..|
00000bc0  da 0f f2 49 6e 69 74 69  61 6c 69 73 65 0d 02 e4  |...Initialise...|
00000bd0  1f f2 43 72 65 61 74 65  50 52 4d 53 74 6f 72 65  |..CreatePRMStore|
00000be0  28 4c 61 72 67 65 73 74  50 52 4d 29 0d 02 ee 18  |(LargestPRM)....|
00000bf0  f2 54 69 63 6b 50 52 4d  63 68 6f 69 63 65 28 50  |.TickPRMchoice(P|
00000c00  52 4d 24 29 0d 02 f8 17  f2 4c 6f 61 64 50 52 4d  |RM$).....LoadPRM|
00000c10  49 6e 64 65 78 28 50 52  4d 24 29 0d 03 02 05 3a  |Index(PRM$)....:|
00000c20  0d 03 0c 12 e7 20 4f 6d  6e 69 44 65 73 6b 3d 30  |..... OmniDesk=0|
00000c30  20 8c 0d 03 16 20 20 20  f4 20 50 75 74 20 49 63  | ....   . Put Ic|
00000c40  6f 6e 20 6f 6e 20 74 68  65 20 69 63 6f 6e 2d 62  |on on the icon-b|
00000c50  61 72 0d 03 20 10 20 20  42 6c 6f 63 6b 21 30 3d  |ar.. .  Block!0=|
00000c60  2d 31 0d 03 2a 31 20 20  42 6c 6f 63 6b 21 34 3d  |-1..*1  Block!4=|
00000c70  30 3a 42 6c 6f 63 6b 21  38 3d 30 3a 42 6c 6f 63  |0:Block!8=0:Bloc|
00000c80  6b 21 31 32 3d 36 38 3a  42 6c 6f 63 6b 21 31 36  |k!12=68:Block!16|
00000c90  3d 36 38 0d 03 34 35 20  20 42 6c 6f 63 6b 21 32  |=68..45  Block!2|
00000ca0  30 3d 26 31 37 30 30 33  30 30 32 3a 24 28 42 6c  |0=&17003002:$(Bl|
00000cb0  6f 63 6b 2b 32 34 29 3d  22 21 53 57 49 a0 49 6e  |ock+24)="!SWI.In|
00000cc0  64 65 78 22 2b bd 31 33  0d 03 3e 2b 20 20 c8 99  |dex"+.13..>+  ..|
00000cd0  20 22 57 69 6d 70 5f 43  72 65 61 74 65 49 63 6f  | "Wimp_CreateIco|
00000ce0  6e 22 2c 2c 42 6c 6f 63  6b 20 b8 20 49 63 6f 6e  |n",,Block . Icon|
00000cf0  42 61 72 0d 03 48 05 cd  0d 03 52 05 3a 0d 03 5c  |Bar..H....R.:..\|
00000d00  26 e7 20 4f 6d 6e 69 44  65 73 6b 3c 3e 30 20 8c  |&. OmniDesk<>0 .|
00000d10  20 f2 44 65 63 6c 61 72  65 54 6f 4f 6d 6e 69 44  | .DeclareToOmniD|
00000d20  65 73 6b 0d 03 66 52 e7  20 53 74 61 72 74 75 70  |esk..fR. Startup|
00000d30  20 8c 20 44 6f 6e 65 3d  b9 3a f4 20 27 2d 53 74  | . Done=.:. '-St|
00000d40  61 72 74 75 70 27 20 70  61 72 61 6d 65 74 65 72  |artup' parameter|
00000d50  20 6d 65 61 6e 73 20 27  64 65 63 6c 61 72 65 20  | means 'declare |
00000d60  61 6e 64 20 64 69 65 20  69 6d 6d 65 64 69 61 74  |and die immediat|
00000d70  65 6c 79 27 2e 0d 03 70  05 3a 0d 03 7a 26 f2 55  |ely'...p.:..z&.U|
00000d80  70 64 61 74 65 49 63 6f  6e 28 49 6e 66 6f 2c 33  |pdateIcon(Info,3|
00000d90  2c 56 65 72 73 69 6f 6e  4e 75 6d 62 65 72 24 29  |,VersionNumber$)|
00000da0  0d 03 84 36 f2 4d 6f 64  65 43 68 61 6e 67 65 3a  |...6.ModeChange:|
00000db0  f4 20 54 6f 20 75 70 64  61 74 65 20 69 63 6f 6e  |. To update icon|
00000dc0  2d 62 61 72 20 69 63 6f  6e 20 69 66 20 6e 65 63  |-bar icon if nec|
00000dd0  65 73 73 61 72 79 0d 03  8e 05 3a 0d 03 98 0e ee  |essary....:.....|
00000de0  20 85 20 f2 45 72 72 6f  72 0d 03 a2 94 e7 20 52  | . .Error..... R|
00000df0  65 61 64 45 72 72 6f 72  20 8c 20 52 65 61 64 45  |eadError . ReadE|
00000e00  72 72 6f 72 3d a3 3a f2  44 65 66 61 75 6c 74 53  |rror=.:.DefaultS|
00000e10  65 74 74 69 6e 67 73 3a  85 20 39 39 39 39 2c 22  |ettings:. 9999,"|
00000e20  41 6e 20 65 72 72 6f 72  20 6f 63 63 75 72 72 65  |An error occurre|
00000e30  64 20 77 68 69 6c 73 74  20 72 65 61 64 69 6e 67  |d whilst reading|
00000e40  20 74 68 65 20 73 65 74  74 69 6e 67 73 20 66 69  | the settings fi|
00000e50  6c 65 2e 20 44 65 66 61  75 6c 74 20 73 65 74 74  |le. Default sett|
00000e60  69 6e 67 73 20 77 69 6c  6c 20 74 68 65 72 65 66  |ings will theref|
00000e70  6f 72 65 20 62 65 20 75  73 65 64 2e 22 0d 03 ac  |ore be used."...|
00000e80  05 3a 0d 03 b6 29 c8 99  20 22 4f 53 5f 52 65 61  |.:...).. "OS_Rea|
00000e90  64 4d 6f 6e 6f 74 6f 6e  69 63 54 69 6d 65 22 20  |dMonotonicTime" |
00000ea0  b8 20 70 6f 6c 6c 74 69  6d 65 25 0d 03 c0 05 3a  |. polltime%....:|
00000eb0  0d 03 ca 17 f4 20 4d 61  69 6e 20 70 72 6f 67 72  |..... Main progr|
00000ec0  61 6d 20 6c 6f 6f 70 0d  03 d4 05 f5 0d 03 de 36  |am loop........6|
00000ed0  20 20 c8 99 20 22 57 69  6d 70 5f 50 6f 6c 6c 49  |  .. "Wimp_PollI|
00000ee0  64 6c 65 22 2c 25 31 31  30 30 30 30 30 31 31 30  |dle",%1100000110|
00000ef0  30 30 30 2c 42 6c 6f 63  6b 20 b8 20 52 65 61 73  |000,Block . Reas|
00000f00  6f 6e 0d 03 e8 26 20 20  c8 99 20 22 49 6e 74 65  |on...&  .. "Inte|
00000f10  72 66 61 63 65 5f 50 6f  6c 6c 22 2c 52 65 61 73  |rface_Poll",Reas|
00000f20  6f 6e 2c 2c 54 61 73 6b  0d 03 f2 34 20 20 c8 99  |on,,Task...4  ..|
00000f30  20 22 49 6e 74 65 72 66  61 63 65 5f 50 72 65 50  | "Interface_PreP|
00000f40  72 6f 63 65 73 73 4b 65  79 22 2c 52 65 61 73 6f  |rocessKey",Reaso|
00000f50  6e 2c 42 6c 6f 63 6b 2c  54 61 73 6b 0d 03 fc 11  |n,Block,Task....|
00000f60  20 20 c8 8e 20 52 65 61  73 6f 6e 20 ca 0d 04 06  |  .. Reason ....|
00000f70  33 20 20 20 20 c9 20 30  20 3a 20 c8 99 20 22 4f  |3    . 0 : .. "O|
00000f80  53 5f 52 65 61 64 4d 6f  6e 6f 74 6f 6e 69 63 54  |S_ReadMonotonicT|
00000f90  69 6d 65 22 20 b8 20 70  6f 6c 6c 74 69 6d 65 25  |ime" . polltime%|
00000fa0  0d 04 10 4c 20 20 20 20  20 20 20 20 20 20 20 20  |...L            |
00000fb0  20 70 6f 6c 6c 74 69 6d  65 25 2b 3d 31 30 30 3a  | polltime%+=100:|
00000fc0  f4 20 44 6f 20 61 20 57  69 6d 70 5f 50 6f 6c 6c  |. Do a Wimp_Poll|
00000fd0  20 61 70 70 72 6f 78 69  6d 61 74 65 6c 79 20 6f  | approximately o|
00000fe0  6e 63 65 20 61 20 73 65  63 6f 6e 64 0d 04 1a 68  |nce a second...h|
00000ff0  20 20 20 20 20 20 20 20  20 20 20 20 20 e7 20 28  |             . (|
00001000  49 6e 64 65 78 3c 3e 2d  31 29 20 80 20 44 6f 4d  |Index<>-1) . DoM|
00001010  6f 64 65 43 68 61 6e 67  65 20 8c 20 e7 20 a4 4f  |odeChange . . .O|
00001020  70 65 6e 53 74 61 74 65  28 49 6e 64 65 78 29 20  |penState(Index) |
00001030  8c 20 f2 4f 70 65 6e 28  49 6e 64 65 78 2c a3 2c  |. .Open(Index,.,|
00001040  58 50 6f 73 69 74 69 6f  6e 2c 59 50 6f 73 69 74  |XPosition,YPosit|
00001050  69 6f 6e 29 0d 04 24 15  20 20 20 20 c9 20 31 20  |ion)..$.    . 1 |
00001060  3a 20 f2 52 65 64 72 61  77 0d 04 2e 29 20 20 20  |: .Redraw...)   |
00001070  20 c9 20 32 20 3a 20 c8  99 20 22 57 69 6d 70 5f  | . 2 : .. "Wimp_|
00001080  4f 70 65 6e 57 69 6e 64  6f 77 22 2c 2c 42 6c 6f  |OpenWindow",,Blo|
00001090  63 6b 0d 04 38 2a 20 20  20 20 c9 20 33 20 3a 20  |ck..8*    . 3 : |
000010a0  c8 99 20 22 57 69 6d 70  5f 43 6c 6f 73 65 57 69  |.. "Wimp_CloseWi|
000010b0  6e 64 6f 77 22 2c 2c 42  6c 6f 63 6b 0d 04 42 20  |ndow",,Block..B |
000010c0  20 20 20 20 20 20 20 20  20 20 20 20 20 e7 20 45  |             . E|
000010d0  78 69 74 20 8c 20 44 6f  6e 65 3d b9 0d 04 4c 1a  |xit . Done=...L.|
000010e0  20 20 20 20 c9 20 36 20  3a 20 f2 4d 6f 75 73 65  |    . 6 : .Mouse|
000010f0  42 75 74 74 6f 6e 0d 04  56 1b 20 20 20 20 c9 20  |Button..V.    . |
00001100  37 20 3a 20 f2 44 72 61  67 46 69 6e 69 73 68 65  |7 : .DragFinishe|
00001110  64 0d 04 60 19 20 20 20  20 c9 20 38 20 3a 20 f2  |d..`.    . 8 : .|
00001120  4b 65 79 50 72 65 73 73  65 64 0d 04 6a 19 20 20  |KeyPressed..j.  |
00001130  20 20 c9 20 39 20 3a 20  f2 44 65 63 6f 64 65 4d  |  . 9 : .DecodeM|
00001140  65 6e 75 0d 04 74 24 20  20 20 20 c9 20 31 37 2c  |enu..t$    . 17,|
00001150  31 38 2c 31 39 20 3a 20  f2 52 65 63 69 65 76 65  |18,19 : .Recieve|
00001160  4d 65 73 73 61 67 65 0d  04 7e 07 20 20 cb 0d 04  |Message..~.  ...|
00001170  88 0a fd 20 44 6f 6e 65  0d 04 92 0f f2 53 61 79  |... Done.....Say|
00001180  47 6f 6f 64 62 79 65 0d  04 9c 05 e0 0d 04 a6 05  |Goodbye.........|
00001190  3a 0d 04 b0 0c dd 20 f2  45 72 72 6f 72 0d 04 ba  |:..... .Error...|
000011a0  1c 43 6c 69 63 6b 3d 30  3a 42 6c 6f 63 6b 21 30  |.Click=0:Block!0|
000011b0  3d 9f 3a c8 8e 20 9f 20  ca 0d 04 c4 1b 20 20 c9  |=.:.. . .....  .|
000011c0  20 39 39 39 39 3a f4 20  43 75 73 74 6f 6d 20 65  | 9999:. Custom e|
000011d0  72 72 6f 72 0d 04 ce 18  20 20 20 20 24 28 42 6c  |rror....    $(Bl|
000011e0  6f 63 6b 2b 34 29 3d f6  24 2b bd 30 0d 04 d8 3e  |ock+4)=.$+.0...>|
000011f0  20 20 20 20 c8 99 20 22  57 69 6d 70 5f 52 65 70  |    .. "Wimp_Rep|
00001200  6f 72 74 45 72 72 6f 72  22 2c 42 6c 6f 63 6b 2c  |ortError",Block,|
00001210  31 37 2c 22 4e 6f 74 69  63 65 20 66 72 6f 6d 20  |17,"Notice from |
00001220  53 57 49 20 49 6e 64 65  78 22 0d 04 e2 07 20 20  |SWI Index"....  |
00001230  7f 0d 04 ec 76 20 20 20  20 24 28 42 6c 6f 63 6b  |....v    $(Block|
00001240  2b 34 29 3d f6 24 2b 22  20 28 69 6e 74 65 72 6e  |+4)=.$+" (intern|
00001250  61 6c 20 65 72 72 6f 72  20 63 6f 64 65 20 22 2b  |al error code "+|
00001260  c3 9e 2b 22 29 2e 20 43  6c 69 63 6b 20 6f 6e 20  |..+"). Click on |
00001270  4f 4b 20 74 6f 20 63 6f  6e 74 69 6e 75 65 2c 20  |OK to continue, |
00001280  6f 72 20 43 61 6e 63 65  6c 20 74 6f 20 74 65 72  |or Cancel to ter|
00001290  6d 69 6e 61 74 65 20 74  68 65 20 70 72 6f 67 72  |minate the progr|
000012a0  61 6d 2e 22 2b bd 30 0d  04 f6 38 20 20 20 20 c8  |am."+.0...8    .|
000012b0  99 20 22 57 69 6d 70 5f  52 65 70 6f 72 74 45 72  |. "Wimp_ReportEr|
000012c0  72 6f 72 22 2c 42 6c 6f  63 6b 2c 33 2c 54 61 73  |ror",Block,3,Tas|
000012d0  6b 6e 61 6d 65 24 20 b8  20 2c 43 6c 69 63 6b 0d  |kname$ . ,Click.|
000012e0  05 00 05 cb 0d 05 0a 1d  e7 20 43 6c 69 63 6b 3d  |......... Click=|
000012f0  32 20 8c 20 f2 53 61 79  47 6f 6f 64 62 79 65 3a  |2 . .SayGoodbye:|
00001300  e0 0d 05 14 05 e1 0d 05  1e 05 3a 0d 05 28 2e dd  |..........:..(..|
00001310  20 f2 4f 70 65 6e 28 57  69 6e 64 6f 77 48 61 6e  | .Open(WindowHan|
00001320  64 6c 65 2c 54 6f 70 4f  66 53 74 61 63 6b 2c 61  |dle,TopOfStack,a|
00001330  63 72 6f 73 73 2c 75 70  29 0d 05 32 18 42 6c 6f  |cross,up)..2.Blo|
00001340  63 6b 21 30 3d 57 69 6e  64 6f 77 48 61 6e 64 6c  |ck!0=WindowHandl|
00001350  65 0d 05 3c 23 c8 99 20  22 57 69 6d 70 5f 47 65  |e..<#.. "Wimp_Ge|
00001360  74 57 69 6e 64 6f 77 53  74 61 74 65 22 2c 2c 42  |tWindowState",,B|
00001370  6c 6f 63 6b 0d 05 46 4a  e7 20 28 61 63 72 6f 73  |lock..FJ. (acros|
00001380  73 3c 3e 2d 31 29 20 80  20 28 61 63 72 6f 73 73  |s<>-1) . (across|
00001390  3c 3e 2d 31 29 20 8c 20  f2 44 65 63 69 64 65 57  |<>-1) . .DecideW|
000013a0  69 6e 64 6f 77 50 6f 73  69 74 69 6f 6e 28 42 6c  |indowPosition(Bl|
000013b0  6f 63 6b 2c 61 63 72 6f  73 73 2c 75 70 29 0d 05  |ock,across,up)..|
000013c0  50 1e e7 20 54 6f 70 4f  66 53 74 61 63 6b 20 8c  |P.. TopOfStack .|
000013d0  20 42 6c 6f 63 6b 21 32  38 3d 2d 31 0d 05 5a 1f  | Block!28=-1..Z.|
000013e0  c8 99 20 22 57 69 6d 70  5f 4f 70 65 6e 57 69 6e  |.. "Wimp_OpenWin|
000013f0  64 6f 77 22 2c 2c 42 6c  6f 63 6b 0d 05 64 05 e1  |dow",,Block..d..|
00001400  0d 05 6e 05 3a 0d 05 78  1a dd 20 f2 43 6c 6f 73  |..n.:..x.. .Clos|
00001410  65 28 57 69 6e 64 6f 77  48 61 6e 64 6c 65 29 0d  |e(WindowHandle).|
00001420  05 82 18 42 6c 6f 63 6b  21 30 3d 57 69 6e 64 6f  |...Block!0=Windo|
00001430  77 48 61 6e 64 6c 65 0d  05 8c 23 c8 99 20 22 57  |wHandle...#.. "W|
00001440  69 6d 70 5f 47 65 74 57  69 6e 64 6f 77 53 74 61  |imp_GetWindowSta|
00001450  74 65 22 2c 2c 42 6c 6f  63 6b 0d 05 96 20 c8 99  |te",,Block... ..|
00001460  20 22 57 69 6d 70 5f 43  6c 6f 73 65 57 69 6e 64  | "Wimp_CloseWind|
00001470  6f 77 22 2c 2c 42 6c 6f  63 6b 0d 05 a0 05 e1 0d  |ow",,Block......|
00001480  05 aa 05 3a 0d 05 b4 2c  dd 20 f2 44 65 63 69 64  |...:...,. .Decid|
00001490  65 57 69 6e 64 6f 77 50  6f 73 69 74 69 6f 6e 28  |eWindowPosition(|
000014a0  42 6c 6f 63 6b 2c 61 63  72 6f 73 73 2c 75 70 29  |Block,across,up)|
000014b0  0d 05 be 4c f4 20 55 73  65 20 6f 66 20 74 68 69  |...L. Use of thi|
000014c0  73 20 70 72 6f 63 65 64  75 72 65 20 6c 65 74 73  |s procedure lets|
000014d0  20 79 6f 75 20 6f 70 65  6e 20 77 69 6e 64 6f 77  | you open window|
000014e0  73 20 6f 6e 20 61 6e 20  69 6e 76 69 73 69 62 6c  |s on an invisibl|
000014f0  65 20 67 72 69 64 20 77  68 69 63 68 0d 05 c8 49  |e grid which...I|
00001500  f4 20 61 75 74 6f 6d 61  74 69 63 61 6c 6c 79 20  |. automatically |
00001510  66 69 74 73 20 69 74 73  65 6c 66 20 74 6f 20 74  |fits itself to t|
00001520  68 65 20 73 63 72 65 65  6e 20 6d 6f 64 65 20 69  |he screen mode i|
00001530  6e 20 75 73 65 2e 20 54  68 65 72 65 20 61 72 65  |n use. There are|
00001540  20 66 69 76 65 0d 05 d2  4a f4 20 70 6f 73 69 74  | five...J. posit|
00001550  69 6f 6e 73 20 61 63 72  6f 73 73 20 28 6c 65 66  |ions across (lef|
00001560  74 2c 20 6d 69 64 2d 6c  65 66 74 2c 20 63 65 6e  |t, mid-left, cen|
00001570  74 72 65 2c 20 6d 69 64  2d 72 69 67 68 74 2c 20  |tre, mid-right, |
00001580  72 69 67 68 74 29 20 61  6e 64 20 66 69 76 65 0d  |right) and five.|
00001590  05 dc 47 f4 20 70 6f 73  69 74 69 6f 6e 73 20 75  |..G. positions u|
000015a0  70 20 28 62 6f 74 74 6f  6d 20 6f 66 20 73 63 72  |p (bottom of scr|
000015b0  65 65 6e 2c 20 61 62 6f  76 65 20 69 63 6f 6e 2d  |een, above icon-|
000015c0  62 61 72 2c 20 63 65 6e  74 72 65 20 6f 66 20 73  |bar, centre of s|
000015d0  63 72 65 65 6e 2c 0d 05  e6 2b f4 20 63 65 6e 74  |creen,...+. cent|
000015e0  72 65 20 74 6f 70 20 6f  66 20 73 63 72 65 65 6e  |re top of screen|
000015f0  2c 20 74 6f 70 20 6f 66  20 73 63 72 65 65 6e 29  |, top of screen)|
00001600  2e 0d 05 f0 07 20 20 3a  0d 05 fa 43 58 70 69 78  |.....  :...CXpix|
00001610  65 6c 73 3d a4 4d 6f 64  65 49 6e 66 6f 28 22 58  |els=.ModeInfo("X|
00001620  50 69 78 65 6c 73 22 2c  2d 31 29 3a 59 70 69 78  |Pixels",-1):Ypix|
00001630  65 6c 73 3d a4 4d 6f 64  65 49 6e 66 6f 28 22 59  |els=.ModeInfo("Y|
00001640  50 69 78 65 6c 73 22 2c  2d 31 29 0d 06 04 4f 58  |Pixels",-1)...OX|
00001650  45 69 67 46 61 63 74 6f  72 3d a4 4d 6f 64 65 49  |EigFactor=.ModeI|
00001660  6e 66 6f 28 22 58 45 69  67 46 61 63 74 6f 72 22  |nfo("XEigFactor"|
00001670  2c 2d 31 29 3a 59 45 69  67 46 61 63 74 6f 72 3d  |,-1):YEigFactor=|
00001680  a4 4d 6f 64 65 49 6e 66  6f 28 22 59 45 69 67 46  |.ModeInfo("YEigF|
00001690  61 63 74 6f 72 22 2c 2d  31 29 0d 06 0e 07 20 20  |actor",-1)....  |
000016a0  3a 0d 06 18 38 74 6f 70  3d 42 6c 6f 63 6b 21 31  |:...8top=Block!1|
000016b0  36 3a 72 69 67 68 74 3d  42 6c 6f 63 6b 21 31 32  |6:right=Block!12|
000016c0  3a 62 6f 74 3d 42 6c 6f  63 6b 21 38 3a 6c 65 66  |:bot=Block!8:lef|
000016d0  74 3d 42 6c 6f 63 6b 21  34 0d 06 22 41 c8 99 20  |t=Block!4.."A.. |
000016e0  22 57 69 6d 70 5f 4f 70  65 6e 57 69 6e 64 6f 77  |"Wimp_OpenWindow|
000016f0  22 2c 2c 42 6c 6f 63 6b  3a c8 99 20 22 57 69 6d  |",,Block:.. "Wim|
00001700  70 5f 47 65 74 57 69 6e  64 6f 77 4f 75 74 6c 69  |p_GetWindowOutli|
00001710  6e 65 22 2c 2c 42 6c 6f  63 6b 0d 06 2c 26 54 42  |ne",,Block..,&TB|
00001720  3d 28 28 42 6c 6f 63 6b  21 31 36 29 2d 74 6f 70  |=((Block!16)-top|
00001730  29 2f 28 32 5e 59 45 69  67 46 61 63 74 6f 72 29  |)/(2^YEigFactor)|
00001740  0d 06 36 28 56 53 3d 28  28 42 6c 6f 63 6b 21 31  |..6(VS=((Block!1|
00001750  32 29 2d 72 69 67 68 74  29 2f 28 32 5e 58 45 69  |2)-right)/(2^XEi|
00001760  67 46 61 63 74 6f 72 29  0d 06 40 25 48 53 3d 28  |gFactor)..@%HS=(|
00001770  62 6f 74 2d 28 42 6c 6f  63 6b 21 38 29 29 2f 28  |bot-(Block!8))/(|
00001780  32 5e 59 45 69 67 46 61  63 74 6f 72 29 0d 06 4a  |2^YEigFactor)..J|
00001790  26 4c 50 3d 28 6c 65 66  74 2d 28 42 6c 6f 63 6b  |&LP=(left-(Block|
000017a0  21 34 29 29 2f 28 32 5e  58 45 69 67 46 61 63 74  |!4))/(2^XEigFact|
000017b0  6f 72 29 0d 06 54 4b f4  20 4c 50 20 69 73 20 4c  |or)..TK. LP is L|
000017c0  65 66 74 20 50 69 78 65  6c 3a 20 6e 6f 72 6d 61  |eft Pixel: norma|
000017d0  6c 6c 79 20 70 72 65 73  65 6e 74 2c 20 62 75 74  |lly present, but|
000017e0  20 6e 6f 74 20 69 66 20  77 69 6e 64 6f 77 20 69  | not if window i|
000017f0  73 20 74 72 61 6e 73 70  61 72 65 6e 74 2e 0d 06  |s transparent...|
00001800  5e 25 77 69 64 74 68 3d  28 72 69 67 68 74 2d 6c  |^%width=(right-l|
00001810  65 66 74 29 2f 28 32 5e  58 45 69 67 46 61 63 74  |eft)/(2^XEigFact|
00001820  6f 72 29 0d 06 68 23 68  65 69 67 68 74 3d 28 74  |or)..h#height=(t|
00001830  6f 70 2d 62 6f 74 29 2f  28 32 5e 59 45 69 67 46  |op-bot)/(2^YEigF|
00001840  61 63 74 6f 72 29 0d 06  72 0f c8 8e 20 61 63 72  |actor)..r... acr|
00001850  6f 73 73 20 ca 0d 06 7c  0e 20 20 c9 20 30 3a 78  |oss ...|.  . 0:x|
00001860  3d 4c 50 0d 06 86 2c 20  20 c9 20 31 3a 78 3d 4c  |=LP...,  . 1:x=L|
00001870  50 2b 28 28 58 70 69 78  65 6c 73 2b 31 29 2d 28  |P+((Xpixels+1)-(|
00001880  77 69 64 74 68 2b 4c 50  2b 56 53 29 29 2f 34 0d  |width+LP+VS))/4.|
00001890  06 90 2c 20 20 c9 20 32  3a 78 3d 4c 50 2b 28 28  |..,  . 2:x=LP+((|
000018a0  58 70 69 78 65 6c 73 2b  31 29 2d 28 77 69 64 74  |Xpixels+1)-(widt|
000018b0  68 2b 4c 50 2b 56 53 29  29 2f 32 0d 06 9a 32 20  |h+LP+VS))/2...2 |
000018c0  20 c9 20 33 3a 78 3d 4c  50 2b 28 33 2a 28 28 28  | . 3:x=LP+(3*(((|
000018d0  58 70 69 78 65 6c 73 2b  31 29 2d 28 77 69 64 74  |Xpixels+1)-(widt|
000018e0  68 2b 4c 50 2b 56 53 29  29 2f 34 29 29 0d 06 a4  |h+LP+VS))/4))...|
000018f0  22 20 20 c9 20 34 3a 78  3d 28 58 70 69 78 65 6c  |"  . 4:x=(Xpixel|
00001900  73 2b 31 29 2d 28 77 69  64 74 68 2b 56 53 29 0d  |s+1)-(width+VS).|
00001910  06 ae 05 cb 0d 06 b8 0b  c8 8e 20 75 70 20 ca 0d  |.......... up ..|
00001920  06 c2 0e 20 20 c9 20 30  3a 79 3d 48 53 0d 06 cc  |...  . 0:y=HS...|
00001930  23 20 20 c9 20 31 3a 79  3d 48 53 2b 28 31 33 32  |#  . 1:y=HS+(132|
00001940  2f 28 32 5e 59 45 69 67  46 61 63 74 6f 72 29 29  |/(2^YEigFactor))|
00001950  0d 06 d6 2d 20 20 c9 20  32 3a 79 3d 48 53 2b 28  |...-  . 2:y=HS+(|
00001960  28 59 70 69 78 65 6c 73  2b 31 29 2d 28 68 65 69  |(Ypixels+1)-(hei|
00001970  67 68 74 2b 54 42 2b 48  53 29 29 2f 32 0d 06 e0  |ght+TB+HS))/2...|
00001980  33 20 20 c9 20 33 3a 79  3d 48 53 2b 28 33 2a 28  |3  . 3:y=HS+(3*(|
00001990  28 28 59 70 69 78 65 6c  73 2b 31 29 2d 28 68 65  |((Ypixels+1)-(he|
000019a0  69 67 68 74 2b 54 42 2b  48 53 29 29 2f 34 29 29  |ight+TB+HS))/4))|
000019b0  0d 06 ea 23 20 20 c9 20  34 3a 79 3d 28 59 70 69  |...#  . 4:y=(Ypi|
000019c0  78 65 6c 73 2b 31 29 2d  28 68 65 69 67 68 74 2b  |xels+1)-(height+|
000019d0  54 42 29 0d 06 f4 05 cb  0d 06 fe 28 f4 20 41 62  |TB)........(. Ab|
000019e0  6f 76 65 20 63 6f 6f 72  64 69 6e 61 74 65 73 20  |ove coordinates |
000019f0  70 6f 73 69 74 69 6f 6e  20 77 69 6e 64 6f 77 2e  |position window.|
00001a00  0d 07 08 28 f4 20 4e 6f  77 20 63 6f 6e 76 65 72  |...(. Now conver|
00001a10  74 20 74 6f 20 73 63 72  65 65 6e 20 63 6f 6f 72  |t to screen coor|
00001a20  64 69 6e 61 74 65 73 3a  0d 07 12 29 78 3d 78 2a  |dinates:...)x=x*|
00001a30  28 32 5e 58 45 69 67 46  61 63 74 6f 72 29 3a 79  |(2^XEigFactor):y|
00001a40  3d 79 2a 28 32 5e 59 45  69 67 46 61 63 74 6f 72  |=y*(2^YEigFactor|
00001a50  29 0d 07 1c 3b 77 69 64  74 68 3d 77 69 64 74 68  |)...;width=width|
00001a60  2a 28 32 5e 58 45 69 67  46 61 63 74 6f 72 29 3a  |*(2^XEigFactor):|
00001a70  68 65 69 67 68 74 3d 68  65 69 67 68 74 2a 28 32  |height=height*(2|
00001a80  5e 59 45 69 67 46 61 63  74 6f 72 29 0d 07 26 1e  |^YEigFactor)..&.|
00001a90  42 6c 6f 63 6b 21 31 32  3d 78 2b 77 69 64 74 68  |Block!12=x+width|
00001aa0  3a 42 6c 6f 63 6b 21 34  3d 78 0d 07 30 1f 42 6c  |:Block!4=x..0.Bl|
00001ab0  6f 63 6b 21 31 36 3d 79  2b 68 65 69 67 68 74 3a  |ock!16=y+height:|
00001ac0  42 6c 6f 63 6b 21 38 3d  79 0d 07 3a 05 e1 0d 07  |Block!8=y..:....|
00001ad0  44 05 3a 0d 07 4e 4f f4  20 2d 2d 2d 2d 2d 2d 2d  |D.:..NO. -------|
00001ae0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001b20  2d 2d 0d 07 58 18 f4 20  57 69 6d 70 20 70 6f 6c  |--..X.. Wimp pol|
00001b30  6c 20 72 6f 75 74 69 6e  65 73 0d 07 62 4f f4 20  |l routines..bO. |
00001b40  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001b80  2d 2d 2d 2d 2d 2d 2d 2d  2d 0d 07 6c 05 3a 0d 07  |---------..l.:..|
00001b90  76 0d dd 20 f2 52 65 64  72 61 77 0d 07 80 22 e7  |v.. .Redraw...".|
00001ba0  20 44 6f 4d 6f 64 65 43  68 61 6e 67 65 20 80 20  | DoModeChange . |
00001bb0  28 49 6e 64 65 78 3c 3e  2d 31 29 20 8c 0d 07 8a  |(Index<>-1) ....|
00001bc0  64 20 20 f4 20 52 65 2d  6f 70 65 6e 69 6e 67 20  |d  . Re-opening |
00001bd0  77 69 6e 64 6f 77 73 20  6e 65 65 64 20 61 6e 20  |windows need an |
00001be0  65 78 74 72 61 20 77 69  6d 70 5f 70 6f 6c 6c 20  |extra wimp_poll |
00001bf0  74 6f 20 68 61 70 70 65  6e 20 61 66 74 65 72 20  |to happen after |
00001c00  74 68 65 20 6d 6f 64 65  20 63 68 61 6e 67 65 20  |the mode change |
00001c10  69 6e 20 6f 72 64 65 72  20 74 6f 20 77 6f 72 6b  |in order to work|
00001c20  3a 0d 07 94 3e 20 20 e7  20 a4 4f 70 65 6e 53 74  |:...>  . .OpenSt|
00001c30  61 74 65 28 49 6e 64 65  78 29 20 8c 20 f2 4f 70  |ate(Index) . .Op|
00001c40  65 6e 28 49 6e 64 65 78  2c a3 2c 58 50 6f 73 69  |en(Index,.,XPosi|
00001c50  74 69 6f 6e 2c 59 50 6f  73 69 74 69 6f 6e 29 0d  |tion,YPosition).|
00001c60  07 9e 14 20 20 44 6f 4d  6f 64 65 43 68 61 6e 67  |...  DoModeChang|
00001c70  65 3d a3 0d 07 a8 05 cd  0d 07 b2 28 c8 99 20 22  |e=.........(.. "|
00001c80  57 69 6d 70 5f 52 65 64  72 61 77 57 69 6e 64 6f  |Wimp_RedrawWindo|
00001c90  77 22 2c 2c 42 6c 6f 63  6b 20 b8 20 66 6c 61 67  |w",,Block . flag|
00001ca0  0d 07 bc 0b c8 95 20 66  6c 61 67 0d 07 c6 2a 20  |...... flag...* |
00001cb0  20 c8 99 20 22 49 6e 74  65 72 66 61 63 65 5f 52  | .. "Interface_R|
00001cc0  65 6e 64 65 72 33 64 57  69 6e 64 6f 77 22 2c 2c  |ender3dWindow",,|
00001cd0  42 6c 6f 63 6b 0d 07 d0  2a 20 20 c8 99 20 22 57  |Block...*  .. "W|
00001ce0  69 6d 70 5f 47 65 74 52  65 63 74 61 6e 67 6c 65  |imp_GetRectangle|
00001cf0  22 2c 2c 42 6c 6f 63 6b  20 b8 20 66 6c 61 67 0d  |",,Block . flag.|
00001d00  07 da 05 ce 0d 07 e4 05  e1 0d 07 ee 05 3a 0d 07  |.............:..|
00001d10  f8 15 dd 20 f2 52 65 63  69 65 76 65 4d 65 73 73  |... .RecieveMess|
00001d20  61 67 65 0d 08 02 11 c8  8e 20 42 6c 6f 63 6b 21  |age...... Block!|
00001d30  31 36 20 ca 0d 08 0c 12  20 20 c9 20 30 20 3a 20  |16 .....  . 0 : |
00001d40  44 6f 6e 65 3d b9 0d 08  16 46 20 20 c9 20 32 20  |Done=....F  . 2 |
00001d50  3a 20 f4 20 57 65 27 72  65 20 73 61 76 69 6e 67  |: . We're saving|
00001d60  20 6f 75 74 20 74 6f 20  61 6e 6f 74 68 65 72 20  | out to another |
00001d70  61 70 70 6c 69 63 61 74  69 6f 6e 20 6f 72 20 74  |application or t|
00001d80  6f 20 74 68 65 20 66 69  6c 65 72 2e 0d 08 20 4a  |o the filer... J|
00001d90  20 20 20 20 20 20 20 20  20 20 20 f4 20 57 65 27  |           . We'|
00001da0  76 65 20 6a 75 73 74 20  72 65 63 65 69 76 65 64  |ve just received|
00001db0  20 61 63 6b 6e 6f 77 6c  65 64 67 65 6d 65 6e 74  | acknowledgement|
00001dc0  20 74 6f 20 67 6f 20 61  68 65 61 64 20 61 6e 64  | to go ahead and|
00001dd0  20 73 61 76 65 2e 0d 08  2a 5a 20 20 20 20 20 20  | save...*Z      |
00001de0  20 20 20 20 20 46 69 6c  65 4e 61 6d 65 24 3d 22  |     FileName$="|
00001df0  22 3a 4e 3d 34 34 3a c8  95 20 28 28 42 6c 6f 63  |":N=44:.. ((Bloc|
00001e00  6b 3f 4e 29 3e 3d 33 32  29 20 80 20 28 4e 3c 32  |k?N)>=32) . (N<2|
00001e10  35 36 29 3a 46 69 6c 65  4e 61 6d 65 24 2b 3d bd  |56):FileName$+=.|
00001e20  28 42 6c 6f 63 6b 3f 4e  29 3a 4e 2b 3d 31 3a ce  |(Block?N):N+=1:.|
00001e30  0d 08 34 76 20 20 20 20  20 20 20 20 20 20 20 e7  |..4v           .|
00001e40  20 ac 20 a4 53 61 76 65  53 57 49 4c 69 73 74 54  | . .SaveSWIListT|
00001e50  6f 46 69 6c 65 28 46 69  6c 65 4e 61 6d 65 24 29  |oFile(FileName$)|
00001e60  20 8c 20 f2 44 65 6c 65  74 65 57 69 6d 70 53 63  | . .DeleteWimpSc|
00001e70  72 61 70 3a 85 20 39 39  39 39 2c 22 41 6e 20 65  |rap:. 9999,"An e|
00001e80  72 72 6f 72 20 6f 63 63  75 72 72 65 64 20 77 68  |rror occurred wh|
00001e90  69 6c 73 74 20 73 61 76  69 6e 67 20 74 68 65 20  |ilst saving the |
00001ea0  66 69 6c 65 2e 22 0d 08  3e 51 20 20 20 20 20 20  |file."..>Q      |
00001eb0  20 20 20 20 20 42 6c 6f  63 6b 21 31 32 3d 42 6c  |     Block!12=Bl|
00001ec0  6f 63 6b 21 38 3a 42 6c  6f 63 6b 21 31 36 3d 33  |ock!8:Block!16=3|
00001ed0  3a c8 99 20 22 57 69 6d  70 5f 53 65 6e 64 4d 65  |:.. "Wimp_SendMe|
00001ee0  73 73 61 67 65 22 2c 31  37 2c 42 6c 6f 63 6b 2c  |ssage",17,Block,|
00001ef0  42 6c 6f 63 6b 21 34 0d  08 48 49 20 20 20 20 20  |Block!4..HI     |
00001f00  20 20 20 20 20 20 4d 79  52 65 66 3d 2d 31 3a f4  |      MyRef=-1:.|
00001f10  20 49 6e 76 61 6c 69 64  61 74 65 20 6f 6e 63 65  | Invalidate once|
00001f20  20 61 67 61 69 6e 2c 20  75 6e 74 69 6c 20 6f 75  | again, until ou|
00001f30  72 20 6e 65 78 74 20 73  61 76 65 20 6f 75 74 2e  |r next save out.|
00001f40  0d 08 52 2c 20 20 20 20  20 20 20 20 20 20 20 e7  |..R,           .|
00001f50  20 46 69 6c 65 4e 61 6d  65 24 3c 3e 22 3c 57 69  | FileName$<>"<Wi|
00001f60  6d 70 24 53 63 72 61 70  3e 22 20 8c 0d 08 5c 2e  |mp$Scrap>" ...\.|
00001f70  20 20 20 20 20 20 20 20  20 20 20 20 20 f2 55 70  |             .Up|
00001f80  64 61 74 65 49 63 6f 6e  28 53 61 76 65 2c 32 2c  |dateIcon(Save,2,|
00001f90  46 69 6c 65 4e 61 6d 65  24 29 0d 08 66 32 20 20  |FileName$)..f2  |
00001fa0  20 20 20 20 20 20 20 20  20 20 20 f4 20 50 75 74  |           . Put|
00001fb0  20 66 75 6c 6c 20 66 69  6c 65 6e 61 6d 65 20 69  | full filename i|
00001fc0  6e 74 6f 20 73 61 76 65  20 62 6f 78 0d 08 70 10  |nto save box..p.|
00001fd0  20 20 20 20 20 20 20 20  20 20 20 cd 0d 08 7a 51  |           ...zQ|
00001fe0  20 20 c9 20 34 20 3a 20  f4 20 57 65 20 68 61 76  |  . 4 : . We hav|
00001ff0  65 20 73 61 76 65 64 20  74 68 65 20 53 57 49 20  |e saved the SWI |
00002000  4c 69 73 74 20 66 69 6c  65 2c 20 61 6e 64 20 61  |List file, and a|
00002010  72 65 20 72 65 63 65 69  76 69 6e 67 20 61 63 6b  |re receiving ack|
00002020  6e 6f 77 6c 65 64 67 65  6d 65 6e 74 2e 0d 08 84  |nowledgement....|
00002030  4d 20 20 20 20 20 20 20  20 20 20 20 f4 20 57 65  |M           . We|
00002040  20 64 6f 6e 27 74 20 6e  65 65 64 20 74 6f 20 61  | don't need to a|
00002050  63 74 75 61 6c 6c 79 20  64 6f 20 61 6e 79 74 68  |ctually do anyth|
00002060  69 6e 67 20 65 78 63 65  70 74 20 63 6c 6f 73 65  |ing except close|
00002070  20 74 68 65 20 6d 65 6e  75 2e 0d 08 8e 27 20 20  | the menu....'  |
00002080  20 20 20 20 20 20 20 20  20 c8 99 20 22 57 69 6d  |         .. "Wim|
00002090  70 5f 43 72 65 61 74 65  4d 65 6e 75 22 2c 2c 2d  |p_CreateMenu",,-|
000020a0  31 0d 08 98 31 20 20 c9  20 31 30 3a 20 e7 20 4f  |1...1  . 10: . O|
000020b0  6d 6e 69 44 65 73 6b 3d  30 20 8c 20 f2 53 61 76  |mniDesk=0 . .Sav|
000020c0  65 44 65 73 6b 74 6f 70  28 42 6c 6f 63 6b 21 32  |eDesktop(Block!2|
000020d0  30 29 0d 08 a2 45 20 20  20 20 20 20 20 20 20 20  |0)...E          |
000020e0  20 f4 20 4f 6e 6c 79 20  73 61 76 65 20 69 66 20  | . Only save if |
000020f0  77 65 20 68 61 76 65 20  6e 6f 74 20 62 65 65 6e  |we have not been|
00002100  20 73 74 61 72 74 65 64  20 75 70 20 62 79 20 4f  | started up by O|
00002110  6d 6e 69 44 65 73 6b 0d  08 ac 14 20 20 c9 20 26  |mniDesk....  . &|
00002120  35 30 32 20 3a 20 f2 48  65 6c 70 0d 08 b6 1c 20  |502 : .Help.... |
00002130  20 c9 20 26 34 30 30 43  31 20 3a 20 f2 4d 6f 64  | . &400C1 : .Mod|
00002140  65 43 68 61 6e 67 65 0d  08 c0 3d 20 20 c9 20 55  |eChange...=  . U|
00002150  74 69 6c 4f 70 65 6e 20  3a 20 e7 20 24 28 42 6c  |tilOpen : . $(Bl|
00002160  6f 63 6b 2b 32 34 29 3d  54 61 73 6b 6e 61 6d 65  |ock+24)=Taskname|
00002170  24 20 8c 20 f2 4f 6d 6e  69 44 65 73 6b 43 61 6c  |$ . .OmniDeskCal|
00002180  6c 69 6e 67 0d 08 ca 26  20 20 c9 20 55 74 69 6c  |ling...&  . Util|
00002190  51 75 69 74 74 69 6e 67  20 3a 20 e7 20 4f 6d 6e  |Quitting : . Omn|
000021a0  69 44 65 73 6b 3c 3e 30  20 8c 0d 08 d4 38 20 20  |iDesk<>0 ....8  |
000021b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000021c0  20 20 20 20 20 20 e7 20  42 6c 6f 63 6b 21 32 30  |      . Block!20|
000021d0  3d 4f 6d 6e 69 44 65 73  6b 20 8c 20 44 6f 6e 65  |=OmniDesk . Done|
000021e0  3d b9 0d 08 de 1b 20 20  20 20 20 20 20 20 20 20  |=.....          |
000021f0  20 20 20 20 20 20 20 20  20 20 20 20 cd 0d 08 e8  |            ....|
00002200  1b 20 20 c9 20 55 74 69  6c 52 65 73 69 64 65 20  |.  . UtilReside |
00002210  3a 20 45 78 69 74 3d a3  0d 08 f2 05 cb 0d 08 fc  |: Exit=.........|
00002220  05 e1 0d 09 06 05 3a 0d  09 10 16 dd 20 f2 44 65  |......:..... .De|
00002230  6c 65 74 65 57 69 6d 70  53 63 72 61 70 0d 09 1a  |leteWimpScrap...|
00002240  07 ea 20 85 0d 09 24 0f  ee 20 85 20 ea 20 f7 20  |.. ...$.. . . . |
00002250  85 3a e1 0d 09 2e 3c f4  20 57 65 20 6d 61 79 20  |.:....<. We may |
00002260  72 65 63 65 69 76 65 20  74 72 79 20 74 6f 20 64  |receive try to d|
00002270  65 6c 65 74 65 20 61 20  6e 6f 6e 2d 65 78 69 73  |elete a non-exis|
00002280  74 61 6e 74 20 57 69 6d  70 24 53 63 72 61 70 0d  |tant Wimp$Scrap.|
00002290  09 38 40 f4 20 66 69 6c  65 20 69 66 20 74 68 65  |.8@. file if the|
000022a0  20 72 65 63 65 69 76 69  6e 67 20 74 61 73 6b 20  | receiving task |
000022b0  64 69 64 20 6e 6f 74 20  72 65 63 6f 67 6e 69 73  |did not recognis|
000022c0  65 20 74 68 65 20 66 69  6c 65 74 79 70 65 2e 0d  |e the filetype..|
000022d0  09 42 1c ff 28 22 44 65  6c 65 74 65 20 3c 57 69  |.B..("Delete <Wi|
000022e0  6d 70 24 53 63 72 61 70  3e 22 29 0d 09 4c 05 e1  |mp$Scrap>")..L..|
000022f0  0d 09 56 05 3a 0d 09 60  12 dd 20 f2 4d 6f 75 73  |..V.:..`.. .Mous|
00002300  65 42 75 74 74 6f 6e 0d  09 6a 31 4d 6f 75 73 65  |eButton..j1Mouse|
00002310  58 3d 42 6c 6f 63 6b 21  30 3a 4d 6f 75 73 65 59  |X=Block!0:MouseY|
00002320  3d 42 6c 6f 63 6b 21 34  3a 42 75 74 74 6f 6e 73  |=Block!4:Buttons|
00002330  3d 42 6c 6f 63 6b 21 38  0d 09 74 21 57 69 6e 64  |=Block!8..t!Wind|
00002340  6f 77 3d 42 6c 6f 63 6b  21 31 32 3a 49 63 6f 6e  |ow=Block!12:Icon|
00002350  3d 42 6c 6f 63 6b 21 31  36 0d 09 7e 0f c8 8e 20  |=Block!16..~... |
00002360  57 69 6e 64 6f 77 20 ca  0d 09 88 22 20 20 c9 20  |Window ...."  . |
00002370  2d 32 3a f4 20 49 63 6f  6e 20 62 61 72 20 69 63  |-2:. Icon bar ic|
00002380  6f 6e 20 63 6c 69 63 6b  65 64 0d 09 92 14 20 20  |on clicked....  |
00002390  20 20 c8 8e 20 42 75 74  74 6f 6e 73 20 ca 0d 09  |  .. Buttons ...|
000023a0  9c 18 20 20 20 20 20 20  c9 20 31 20 3a 20 f4 20  |..      . 1 : . |
000023b0  41 64 6a 75 73 74 0d 09  a6 16 20 20 20 20 20 20  |Adjust....      |
000023c0  c9 20 32 20 3a 20 f4 20  4d 65 6e 75 0d 09 b0 39  |. 2 : . Menu...9|
000023d0  20 20 20 20 20 20 20 20  4d 25 3d 49 42 4d 65 6e  |        M%=IBMen|
000023e0  75 3a 4d 65 6e 75 58 3d  4d 6f 75 73 65 58 3a 4d  |u:MenuX=MouseX:M|
000023f0  65 6e 75 59 3d 4d 6f 75  73 65 59 3a f2 4d 61 6b  |enuY=MouseY:.Mak|
00002400  65 4d 65 6e 75 0d 09 ba  18 20 20 20 20 20 20 c9  |eMenu....      .|
00002410  20 34 20 3a 20 f4 20 53  65 6c 65 63 74 0d 09 c4  | 4 : . Select...|
00002420  2d 20 20 20 20 20 20 20  20 e7 20 ac 20 53 63 61  |-        . . Sca|
00002430  6e 6e 65 64 4d 6f 64 75  6c 65 73 20 8c 20 f2 53  |nnedModules . .S|
00002440  63 61 6e 4d 6f 64 75 6c  65 73 0d 09 ce 36 20 20  |canModules...6  |
00002450  20 20 20 20 20 20 e7 20  49 6e 64 65 78 3d 2d 31  |      . Index=-1|
00002460  20 8c 20 49 6e 64 65 78  3d a4 43 72 65 61 74 65  | . Index=.Create|
00002470  49 6e 64 65 78 57 69 6e  64 6f 77 28 30 2c b9 29  |IndexWindow(0,.)|
00002480  0d 09 d8 2e 20 20 20 20  20 20 20 20 f2 4f 70 65  |....        .Ope|
00002490  6e 28 49 6e 64 65 78 2c  b9 2c 58 50 6f 73 69 74  |n(Index,.,XPosit|
000024a0  69 6f 6e 2c 59 50 6f 73  69 74 69 6f 6e 29 0d 09  |ion,YPosition)..|
000024b0  e2 09 20 20 20 20 cb 0d  09 ec 0d 20 20 c9 20 49  |..    .....  . I|
000024c0  6e 64 65 78 0d 09 f6 14  20 20 20 20 c8 8e 20 42  |ndex....    .. B|
000024d0  75 74 74 6f 6e 73 20 ca  0d 0a 00 18 20 20 20 20  |uttons .....    |
000024e0  20 20 c9 20 31 20 3a 20  f4 20 41 64 6a 75 73 74  |  . 1 : . Adjust|
000024f0  0d 0a 0a 16 20 20 20 20  20 20 c9 20 32 20 3a 20  |....      . 2 : |
00002500  f4 20 4d 65 6e 75 0d 0a  14 31 20 20 20 20 20 20  |. Menu...1      |
00002510  20 20 4d 25 3d 4d 61 69  6e 4d 65 6e 75 3a 4d 65  |  M%=MainMenu:Me|
00002520  6e 75 58 3d 4d 6f 75 73  65 58 3a 4d 65 6e 75 59  |nuX=MouseX:MenuY|
00002530  3d 4d 6f 75 73 65 59 0d  0a 1e 19 20 20 20 20 20  |=MouseY....     |
00002540  20 20 20 e7 20 77 69 6d  70 3e 3d 33 31 30 20 8c  |   . wimp>=310 .|
00002550  0d 0a 28 60 20 20 20 20  20 20 20 20 20 20 e7 20  |..(`          . |
00002560  c0 24 4d 61 69 6e 4d 65  6e 75 54 69 74 6c 65 2c  |.$MainMenuTitle,|
00002570  31 29 3d 22 5c 22 20 8c  20 24 4d 61 69 6e 4d 65  |1)="\" . $MainMe|
00002580  6e 75 54 69 74 6c 65 3d  c2 24 4d 61 69 6e 4d 65  |nuTitle=.$MainMe|
00002590  6e 75 54 69 74 6c 65 2c  a9 28 24 4d 61 69 6e 4d  |nuTitle,.($MainM|
000025a0  65 6e 75 54 69 74 6c 65  29 2d 31 29 2b bd 31 33  |enuTitle)-1)+.13|
000025b0  0d 0a 32 43 20 20 20 20  20 20 20 20 20 20 e7 20  |..2C          . |
000025c0  58 50 6f 73 69 74 69 6f  6e 3d 34 20 8c 20 24 4d  |XPosition=4 . $M|
000025d0  61 69 6e 4d 65 6e 75 54  69 74 6c 65 3d 22 5c 22  |ainMenuTitle="\"|
000025e0  2b 24 4d 61 69 6e 4d 65  6e 75 54 69 74 6c 65 2b  |+$MainMenuTitle+|
000025f0  bd 31 33 0d 0a 3c 0d 20  20 20 20 20 20 20 20 cd  |.13..<.        .|
00002600  0d 0a 46 15 20 20 20 20  20 20 20 20 f2 4d 61 6b  |..F.        .Mak|
00002610  65 4d 65 6e 75 0d 0a 50  18 20 20 20 20 20 20 c9  |eMenu..P.      .|
00002620  20 34 20 3a 20 f4 20 53  65 6c 65 63 74 0d 0a 5a  | 4 : . Select..Z|
00002630  09 20 20 20 20 cb 0d 0a  64 30 20 20 c9 20 4c 6f  |.    ...d0  . Lo|
00002640  63 20 80 20 42 75 74 74  6f 6e 73 3c 38 3a f4 20  |c . Buttons<8:. |
00002650  52 65 70 6f 73 69 74 69  6f 6e 20 6d 61 69 6e 20  |Reposition main |
00002660  77 69 6e 64 6f 77 0d 0a  6e 13 20 20 20 20 e7 20  |window..n.    . |
00002670  49 63 6f 6e 3e 3d 36 20  8c 0d 0a 78 2c 20 20 20  |Icon>=6 ...x,   |
00002680  20 20 20 58 50 6f 73 69  74 69 6f 6e 3d a4 52 65  |   XPosition=.Re|
00002690  61 64 57 69 6e 64 6f 77  4c 6f 63 61 74 69 6f 6e  |adWindowLocation|
000026a0  28 22 58 22 29 0d 0a 82  2c 20 20 20 20 20 20 59  |("X")...,      Y|
000026b0  50 6f 73 69 74 69 6f 6e  3d a4 52 65 61 64 57 69  |Position=.ReadWi|
000026c0  6e 64 6f 77 4c 6f 63 61  74 69 6f 6e 28 22 59 22  |ndowLocation("Y"|
000026d0  29 0d 0a 8c 42 20 20 20  20 20 20 e7 20 a4 4f 70  |)...B      . .Op|
000026e0  65 6e 53 74 61 74 65 28  49 6e 64 65 78 29 20 8c  |enState(Index) .|
000026f0  20 f2 4f 70 65 6e 28 49  6e 64 65 78 2c a3 2c 58  | .Open(Index,.,X|
00002700  50 6f 73 69 74 69 6f 6e  2c 59 50 6f 73 69 74 69  |Position,YPositi|
00002710  6f 6e 29 0d 0a 96 09 20  20 20 20 cd 0d 0a a0 0c  |on)....    .....|
00002720  20 20 c9 20 53 61 76 65  0d 0a aa 11 20 20 20 20  |  . Save....    |
00002730  c8 8e 20 49 63 6f 6e 20  ca 0d 0a b4 19 20 20 20  |.. Icon .....   |
00002740  20 20 20 c9 20 31 3a f4  20 46 69 6c 65 20 69 63  |   . 1:. File ic|
00002750  6f 6e 0d 0a be 1a 20 20  20 20 20 20 20 20 e7 20  |on....        . |
00002760  42 75 74 74 6f 6e 73 3e  3d 38 20 8c 0d 0a c8 1d  |Buttons>=8 .....|
00002770  20 20 20 20 20 20 20 20  20 20 e7 20 44 72 61 67  |          . Drag|
00002780  41 53 70 72 69 74 65 20  8c 0d 0a d2 50 20 20 20  |ASprite ....P   |
00002790  20 20 20 20 20 20 20 20  20 f4 20 54 68 65 20 66  |         . The f|
000027a0  6f 6c 6c 6f 77 69 6e 67  20 6c 69 6e 65 73 20 64  |ollowing lines d|
000027b0  65 6c 65 74 65 20 74 68  65 20 66 69 6c 65 20 69  |elete the file i|
000027c0  63 6f 6e 20 66 72 6f 6d  20 74 68 65 20 73 61 76  |con from the sav|
000027d0  65 20 77 69 6e 64 6f 77  2c 0d 0a dc 4e 20 20 20  |e window,...N   |
000027e0  20 20 20 20 20 20 20 20  20 f4 20 67 69 76 69 6e  |         . givin|
000027f0  67 20 74 68 65 20 69 6d  70 72 65 73 73 69 6f 6e  |g the impression|
00002800  20 74 68 61 74 20 79 6f  75 20 61 72 65 20 61 63  | that you are ac|
00002810  74 75 61 6c 6c 79 20 64  72 61 67 67 69 6e 67 20  |tually dragging |
00002820  69 74 20 6f 75 74 2e 0d  0a e6 3a 20 20 20 20 20  |it out....:     |
00002830  20 20 20 20 20 20 20 f4  20 49 74 20 77 69 6c 6c  |       . It will|
00002840  20 62 65 20 72 65 70 6c  61 63 65 64 20 69 6e 20  | be replaced in |
00002850  50 52 4f 43 44 72 61 67  46 69 6e 69 73 68 65 64  |PROCDragFinished|
00002860  2e 0d 0a f0 44 20 20 20  20 20 20 20 20 20 20 20  |....D           |
00002870  20 42 6c 6f 63 6b 21 30  3d 53 61 76 65 3a 42 6c  | Block!0=Save:Bl|
00002880  6f 63 6b 21 34 3d 31 3a  c8 99 20 22 57 69 6d 70  |ock!4=1:.. "Wimp|
00002890  5f 47 65 74 49 63 6f 6e  53 74 61 74 65 22 2c 2c  |_GetIconState",,|
000028a0  42 6c 6f 63 6b 0d 0a fa  2c 20 20 20 20 20 20 20  |Block...,       |
000028b0  20 20 20 20 20 53 61 76  65 42 6f 78 44 72 61 67  |     SaveBoxDrag|
000028c0  46 69 6c 65 24 3d 24 28  42 6c 6f 63 6b 21 33 32  |File$=$(Block!32|
000028d0  29 0d 0b 04 34 20 20 20  20 20 20 20 20 20 20 20  |)...4           |
000028e0  20 42 6c 6f 63 6b 21 38  3d 30 3a 42 6c 6f 63 6b  | Block!8=0:Block|
000028f0  21 31 32 3d 30 3a 24 28  42 6c 6f 63 6b 21 33 32  |!12=0:$(Block!32|
00002900  29 3d bd 31 33 0d 0b 0e  2d 20 20 20 20 20 20 20  |)=.13...-       |
00002910  20 20 20 20 20 c8 99 20  22 57 69 6d 70 5f 53 65  |     .. "Wimp_Se|
00002920  74 49 63 6f 6e 53 74 61  74 65 22 2c 2c 42 6c 6f  |tIconState",,Blo|
00002930  63 6b 0d 0b 18 0f 20 20  20 20 20 20 20 20 20 20  |ck....          |
00002940  cd 0d 0b 22 2d 20 20 20  20 20 20 20 20 20 20 f2  |..."-          .|
00002950  44 72 61 67 42 6f 78 28  53 61 76 65 2c 31 2c 35  |DragBox(Save,1,5|
00002960  2c 31 2c 22 66 69 6c 65  5f 66 66 66 22 29 0d 0b  |,1,"file_fff")..|
00002970  2c 0d 20 20 20 20 20 20  20 20 cd 0d 0b 36 17 20  |,.        ...6. |
00002980  20 20 20 20 20 c9 20 33  3a f4 20 4f 4b 20 69 63  |     . 3:. OK ic|
00002990  6f 6e 0d 0b 40 2a 20 20  20 20 20 20 20 20 e7 20  |on..@*        . |
000029a0  28 42 75 74 74 6f 6e 73  3c 38 29 20 80 20 28 42  |(Buttons<8) . (B|
000029b0  75 74 74 6f 6e 73 3c 3e  32 29 20 8c 0d 0b 4a 2e  |uttons<>2) ...J.|
000029c0  20 20 20 20 20 20 20 20  20 20 c8 99 20 22 49 6e  |          .. "In|
000029d0  74 65 72 66 61 63 65 5f  53 6c 61 62 42 75 74 74  |terface_SlabButt|
000029e0  6f 6e 22 2c 2c 42 6c 6f  63 6b 0d 0b 54 35 20 20  |on",,Block..T5  |
000029f0  20 20 20 20 20 20 20 20  e7 20 42 75 74 74 6f 6e  |        . Button|
00002a00  73 3c 3e 31 20 8c 20 c8  99 20 22 57 69 6d 70 5f  |s<>1 . .. "Wimp_|
00002a10  43 72 65 61 74 65 4d 65  6e 75 22 2c 2c 2d 31 0d  |CreateMenu",,-1.|
00002a20  0b 5e 3d 20 20 20 20 20  20 20 20 20 20 41 24 3d  |.^=          A$=|
00002a30  a4 52 65 61 64 49 63 6f  6e 53 74 72 28 53 61 76  |.ReadIconStr(Sav|
00002a40  65 2c 32 29 3a e7 20 41  24 3d 22 22 20 8c 20 41  |e,2):. A$="" . A|
00002a50  24 3d 22 53 57 49 a0 4c  69 73 74 22 0d 0b 68 24  |$="SWI.List"..h$|
00002a60  20 20 20 20 20 20 20 20  20 20 f2 55 70 64 61 74  |          .Updat|
00002a70  65 49 63 6f 6e 28 53 61  76 65 2c 32 2c 41 24 29  |eIcon(Save,2,A$)|
00002a80  0d 0b 72 98 20 20 20 20  20 20 20 20 20 20 e7 20  |..r.          . |
00002a90  a7 41 24 2c 22 2e 22 29  3d 30 20 8c 20 42 6c 6f  |.A$,".")=0 . Blo|
00002aa0  63 6b 21 38 3d 30 3a 42  6c 6f 63 6b 21 31 32 3d  |ck!8=0:Block!12=|
00002ab0  53 61 76 65 3a 42 6c 6f  63 6b 21 31 36 3d 33 3a  |Save:Block!16=3:|
00002ac0  c8 99 20 22 49 6e 74 65  72 66 61 63 65 5f 53 6c  |.. "Interface_Sl|
00002ad0  61 62 42 75 74 74 6f 6e  22 2c 2c 42 6c 6f 63 6b  |abButton",,Block|
00002ae0  3a 85 20 39 39 39 39 2c  22 54 6f 20 73 61 76 65  |:. 9999,"To save|
00002af0  2c 20 64 72 61 67 20 74  68 65 20 69 63 6f 6e 20  |, drag the icon |
00002b00  74 6f 20 61 20 64 69 72  65 63 74 6f 72 79 20 64  |to a directory d|
00002b10  69 73 70 6c 61 79 2e 22  0d 0b 7c b2 20 20 20 20  |isplay."..|.    |
00002b20  20 20 20 20 20 20 e7 20  ac 20 a4 53 61 76 65 53  |      . . .SaveS|
00002b30  57 49 4c 69 73 74 54 6f  46 69 6c 65 28 41 24 29  |WIListToFile(A$)|
00002b40  20 8c 20 f2 44 65 6c 65  74 65 57 69 6d 70 53 63  | . .DeleteWimpSc|
00002b50  72 61 70 3a 42 6c 6f 63  6b 21 38 3d 30 3a 42 6c  |rap:Block!8=0:Bl|
00002b60  6f 63 6b 21 31 32 3d 53  61 76 65 3a 42 6c 6f 63  |ock!12=Save:Bloc|
00002b70  6b 21 31 36 3d 33 3a c8  99 20 22 49 6e 74 65 72  |k!16=3:.. "Inter|
00002b80  66 61 63 65 5f 53 6c 61  62 42 75 74 74 6f 6e 22  |face_SlabButton"|
00002b90  2c 2c 42 6c 6f 63 6b 3a  85 20 39 39 39 39 2c 22  |,,Block:. 9999,"|
00002ba0  41 6e 20 65 72 72 6f 72  20 6f 63 63 75 72 72 65  |An error occurre|
00002bb0  64 20 77 68 69 6c 73 74  20 73 61 76 69 6e 67 20  |d whilst saving |
00002bc0  74 68 65 20 66 69 6c 65  2e 22 0d 0b 86 51 20 20  |the file."...Q  |
00002bd0  20 20 20 20 20 20 20 20  42 6c 6f 63 6b 21 38 3d  |        Block!8=|
00002be0  30 3a 42 6c 6f 63 6b 21  31 32 3d 53 61 76 65 3a  |0:Block!12=Save:|
00002bf0  42 6c 6f 63 6b 21 31 36  3d 33 3a c8 99 20 22 49  |Block!16=3:.. "I|
00002c00  6e 74 65 72 66 61 63 65  5f 53 6c 61 62 42 75 74  |nterface_SlabBut|
00002c10  74 6f 6e 22 2c 2c 42 6c  6f 63 6b 0d 0b 90 0d 20  |ton",,Block.... |
00002c20  20 20 20 20 20 20 20 cd  0d 0b 9a 1b 20 20 20 20  |       .....    |
00002c30  20 20 c9 20 34 3a f4 20  53 77 69 74 63 68 20 69  |  . 4:. Switch i|
00002c40  63 6f 6e 0d 0b a4 2a 20  20 20 20 20 20 20 20 e7  |con...*        .|
00002c50  20 28 42 75 74 74 6f 6e  73 3c 38 29 20 80 20 28  | (Buttons<8) . (|
00002c60  42 75 74 74 6f 6e 73 3c  3e 32 29 20 8c 0d 0b ae  |Buttons<>2) ....|
00002c70  2e 20 20 20 20 20 20 20  20 20 20 c8 99 20 22 49  |.          .. "I|
00002c80  6e 74 65 72 66 61 63 65  5f 53 6c 61 62 42 75 74  |nterface_SlabBut|
00002c90  74 6f 6e 22 2c 2c 42 6c  6f 63 6b 0d 0b b8 5e 20  |ton",,Block...^ |
00002ca0  20 20 20 20 20 20 20 20  20 41 24 3d a4 52 65 61  |         A$=.Rea|
00002cb0  64 49 63 6f 6e 53 74 72  28 53 61 76 65 2c 34 29  |dIconStr(Save,4)|
00002cc0  3a e7 20 41 24 3d 22 54  68 69 73 20 4d 6f 64 75  |:. A$="This Modu|
00002cd0  6c 65 22 20 8c 20 41 24  3d 22 41 6c 6c 20 4d 6f  |le" . A$="All Mo|
00002ce0  64 75 6c 65 73 22 20 8b  20 41 24 3d 22 54 68 69  |dules" . A$="Thi|
00002cf0  73 20 4d 6f 64 75 6c 65  22 0d 0b c2 24 20 20 20  |s Module"...$   |
00002d00  20 20 20 20 20 20 20 f2  55 70 64 61 74 65 49 63  |       .UpdateIc|
00002d10  6f 6e 28 53 61 76 65 2c  34 2c 41 24 29 0d 0b cc  |on(Save,4,A$)...|
00002d20  21 20 20 20 20 20 20 20  20 20 20 46 75 6c 6c 53  |!          FullS|
00002d30  61 76 65 3d ac 20 46 75  6c 6c 53 61 76 65 0d 0b  |ave=. FullSave..|
00002d40  d6 51 20 20 20 20 20 20  20 20 20 20 42 6c 6f 63  |.Q          Bloc|
00002d50  6b 21 38 3d 30 3a 42 6c  6f 63 6b 21 31 32 3d 53  |k!8=0:Block!12=S|
00002d60  61 76 65 3a 42 6c 6f 63  6b 21 31 36 3d 34 3a c8  |ave:Block!16=4:.|
00002d70  99 20 22 49 6e 74 65 72  66 61 63 65 5f 53 6c 61  |. "Interface_Sla|
00002d80  62 42 75 74 74 6f 6e 22  2c 2c 42 6c 6f 63 6b 0d  |bButton",,Block.|
00002d90  0b e0 0d 20 20 20 20 20  20 20 20 cd 0d 0b ea 09  |...        .....|
00002da0  20 20 20 20 cb 0d 0b f4  05 cb 0d 0b fe 05 e1 0d  |    ............|
00002db0  0c 08 05 3a 0d 0c 12 13  dd 20 f2 44 72 61 67 46  |...:..... .DragF|
00002dc0  69 6e 69 73 68 65 64 0d  0c 1c 13 e7 20 44 72 61  |inished..... Dra|
00002dd0  67 41 53 70 72 69 74 65  20 8c 0d 0c 26 1b 20 20  |gASprite ...&.  |
00002de0  c8 99 20 22 44 72 61 67  41 53 70 72 69 74 65 5f  |.. "DragASprite_|
00002df0  53 74 6f 70 22 0d 0c 30  3f 20 20 f4 20 54 68 65  |Stop"..0?  . The|
00002e00  20 66 6f 6c 6c 6f 77 69  6e 67 20 6c 69 6e 65 73  | following lines|
00002e10  20 72 65 70 6c 61 63 65  20 74 68 65 20 73 70 72  | replace the spr|
00002e20  69 74 65 20 69 6e 20 74  68 65 20 73 61 76 65 20  |ite in the save |
00002e30  62 6f 78 2e 0d 0c 3a 3a  20 20 42 6c 6f 63 6b 21  |box...::  Block!|
00002e40  30 3d 53 61 76 65 3a 42  6c 6f 63 6b 21 34 3d 31  |0=Save:Block!4=1|
00002e50  3a c8 99 20 22 57 69 6d  70 5f 47 65 74 49 63 6f  |:.. "Wimp_GetIco|
00002e60  6e 53 74 61 74 65 22 2c  2c 42 6c 6f 63 6b 0d 0c  |nState",,Block..|
00002e70  44 37 20 20 42 6c 6f 63  6b 21 38 3d 30 3a 42 6c  |D7  Block!8=0:Bl|
00002e80  6f 63 6b 21 31 32 3d 30  3a 24 28 42 6c 6f 63 6b  |ock!12=0:$(Block|
00002e90  21 33 32 29 3d 53 61 76  65 42 6f 78 44 72 61 67  |!32)=SaveBoxDrag|
00002ea0  46 69 6c 65 24 0d 0c 4e  23 20 20 c8 99 20 22 57  |File$..N#  .. "W|
00002eb0  69 6d 70 5f 53 65 74 49  63 6f 6e 53 74 61 74 65  |imp_SetIconState|
00002ec0  22 2c 2c 42 6c 6f 63 6b  0d 0c 58 05 cd 0d 0c 62  |",,Block..X....b|
00002ed0  23 c8 99 20 22 57 69 6d  70 5f 47 65 74 50 6f 69  |#.. "Wimp_GetPoi|
00002ee0  6e 74 65 72 49 6e 66 6f  22 2c 2c 42 6c 6f 63 6b  |nterInfo",,Block|
00002ef0  0d 0c 6c 2e e7 20 42 6c  6f 63 6b 21 31 32 3d 2d  |..l.. Block!12=-|
00002f00  31 20 8c 20 e1 3a f4 20  44 72 61 67 67 65 64 20  |1 . .:. Dragged |
00002f10  74 6f 20 62 61 63 6b 67  72 6f 75 6e 64 2e 0d 0c  |to background...|
00002f20  76 59 44 72 61 67 67 65  64 54 6f 58 3d 42 6c 6f  |vYDraggedToX=Blo|
00002f30  63 6b 21 30 3a 44 72 61  67 67 65 64 54 6f 59 3d  |ck!0:DraggedToY=|
00002f40  42 6c 6f 63 6b 21 34 3a  44 72 61 67 67 65 64 54  |Block!4:DraggedT|
00002f50  6f 57 69 6e 64 6f 77 3d  42 6c 6f 63 6b 21 31 32  |oWindow=Block!12|
00002f60  3a 44 72 61 67 67 65 64  54 6f 49 63 6f 6e 3d 42  |:DraggedToIcon=B|
00002f70  6c 6f 63 6b 21 31 36 0d  0c 80 25 f4 20 46 69 6e  |lock!16...%. Fin|
00002f80  64 20 6f 75 74 20 6c 65  61 66 20 6e 61 6d 65 20  |d out leaf name |
00002f90  69 6e 20 73 61 76 65 20  62 6f 78 3a 0d 0c 8a 33  |in save box:...3|
00002fa0  44 72 61 67 67 69 6e 67  24 3d a4 52 65 61 64 49  |Dragging$=.ReadI|
00002fb0  63 6f 6e 53 74 72 28 53  61 76 65 2c 32 29 3a 6c  |conStr(Save,2):l|
00002fc0  65 6e 3d a9 28 44 72 61  67 67 69 6e 67 24 29 0d  |en=.(Dragging$).|
00002fd0  0c 94 3e 4e 3d 2d 31 3a  f5 3a 4e 2b 3d 31 3a fd  |..>N=-1:.:N+=1:.|
00002fe0  20 28 c1 44 72 61 67 67  69 6e 67 24 2c a9 28 44  | (.Dragging$,.(D|
00002ff0  72 61 67 67 69 6e 67 24  29 2d 4e 2c 31 29 3d 22  |ragging$)-N,1)="|
00003000  2e 22 29 20 84 20 28 4e  3d 6c 65 6e 29 0d 0c 9e  |.") . (N=len)...|
00003010  25 e7 20 4e 3c 6c 65 6e  20 8c 20 44 72 61 67 67  |%. N<len . Dragg|
00003020  69 6e 67 24 3d c2 44 72  61 67 67 69 6e 67 24 2c  |ing$=.Dragging$,|
00003030  4e 29 0d 0c a8 47 e7 20  44 72 61 67 67 69 6e 67  |N)...G. Dragging|
00003040  24 3d 22 22 20 8c 20 44  72 61 67 67 69 6e 67 24  |$="" . Dragging$|
00003050  3d 22 53 57 49 a0 4c 69  73 74 22 3a f2 55 70 64  |="SWI.List":.Upd|
00003060  61 74 65 49 63 6f 6e 28  53 61 76 65 2c 32 2c 44  |ateIcon(Save,2,D|
00003070  72 61 67 67 69 6e 67 24  29 0d 0c b2 30 f4 20 4f  |ragging$)...0. O|
00003080  4b 20 2d 20 4c 65 74 27  73 20 62 65 67 69 6e 20  |K - Let's begin |
00003090  61 6e 20 69 6e 74 65 72  2d 61 70 70 6c 69 63 61  |an inter-applica|
000030a0  74 69 6f 6e 20 73 61 76  65 0d 0c bc 0b 4d 79 52  |tion save....MyR|
000030b0  65 66 3d 30 0d 0c c6 34  42 6c 6f 63 6b 21 30 3d  |ef=0...4Block!0=|
000030c0  32 35 36 3a 42 6c 6f 63  6b 21 31 32 3d 4d 79 52  |256:Block!12=MyR|
000030d0  65 66 3a 42 6c 6f 63 6b  21 31 36 3d 31 3a f4 20  |ef:Block!16=1:. |
000030e0  44 61 74 61 53 61 76 65  0d 0c d0 5b 42 6c 6f 63  |DataSave...[Bloc|
000030f0  6b 21 32 30 3d 44 72 61  67 67 65 64 54 6f 57 69  |k!20=DraggedToWi|
00003100  6e 64 6f 77 3a 42 6c 6f  63 6b 21 32 34 3d 44 72  |ndow:Block!24=Dr|
00003110  61 67 67 65 64 54 6f 49  63 6f 6e 3a 42 6c 6f 63  |aggedToIcon:Bloc|
00003120  6b 21 32 38 3d 44 72 61  67 67 65 64 54 6f 58 3a  |k!28=DraggedToX:|
00003130  42 6c 6f 63 6b 21 33 32  3d 44 72 61 67 67 65 64  |Block!32=Dragged|
00003140  54 6f 59 0d 0c da 36 42  6c 6f 63 6b 21 33 36 3d  |ToY...6Block!36=|
00003150  2d 31 3a f4 20 4e 6f 20  69 64 65 61 20 77 68 61  |-1:. No idea wha|
00003160  74 20 74 68 65 20 73 69  7a 65 20 69 73 20 67 6f  |t the size is go|
00003170  69 6e 67 20 74 6f 20 62  65 0d 0c e4 24 42 6c 6f  |ing to be...$Blo|
00003180  63 6b 21 34 30 3d 26 46  46 46 3a f4 20 46 69 6c  |ck!40=&FFF:. Fil|
00003190  65 74 79 70 65 20 6f 66  20 54 65 78 74 0d 0c ee  |etype of Text...|
000031a0  1c 24 28 42 6c 6f 63 6b  2b 34 34 29 3d 44 72 61  |.$(Block+44)=Dra|
000031b0  67 67 69 6e 67 24 2b bd  30 0d 0c f8 40 c8 99 20  |gging$+.0...@.. |
000031c0  22 57 69 6d 70 5f 53 65  6e 64 4d 65 73 73 61 67  |"Wimp_SendMessag|
000031d0  65 22 2c 31 37 2c 42 6c  6f 63 6b 2c 44 72 61 67  |e",17,Block,Drag|
000031e0  67 65 64 54 6f 57 69 6e  64 6f 77 2c 44 72 61 67  |gedToWindow,Drag|
000031f0  67 65 64 54 6f 49 63 6f  6e 0d 0d 02 42 f4 20 44  |gedToIcon...B. D|
00003200  72 61 67 67 65 64 54 6f  49 63 6f 6e 20 69 6e 63  |raggedToIcon inc|
00003210  6c 75 64 65 64 20 69 6e  20 63 61 73 65 20 44 72  |luded in case Dr|
00003220  61 67 67 65 64 54 6f 57  69 6e 64 6f 77 3d 2d 32  |aggedToWindow=-2|
00003230  20 28 69 63 6f 6e 20 62  61 72 29 0d 0d 0c 05 e1  | (icon bar).....|
00003240  0d 0d 16 05 3a 0d 0d 20  11 dd 20 f2 4b 65 79 50  |....:.. .. .KeyP|
00003250  72 65 73 73 65 64 0d 0d  2a 32 57 69 6e 64 6f 77  |ressed..*2Window|
00003260  3d 42 6c 6f 63 6b 21 30  3a 49 63 6f 6e 3d 42 6c  |=Block!0:Icon=Bl|
00003270  6f 63 6b 21 34 3a 43 68  61 72 61 63 74 65 72 3d  |ock!4:Character=|
00003280  42 6c 6f 63 6b 21 32 34  0d 0d 34 0f c8 8e 20 57  |Block!24..4... W|
00003290  69 6e 64 6f 77 20 ca 0d  0d 3e 0d 20 20 c9 20 53  |indow ...>.  . S|
000032a0  61 76 65 3a 0d 0d 48 18  20 20 20 20 e7 20 43 68  |ave:..H.    . Ch|
000032b0  61 72 61 63 74 65 72 3d  31 33 20 8c 0d 0d 52 4d  |aracter=13 ...RM|
000032c0  20 20 20 20 20 20 42 6c  6f 63 6b 21 38 3d 34 3a  |      Block!8=4:|
000032d0  42 6c 6f 63 6b 21 31 32  3d 53 61 76 65 3a 42 6c  |Block!12=Save:Bl|
000032e0  6f 63 6b 21 31 36 3d 33  3a c8 99 20 22 49 6e 74  |ock!16=3:.. "Int|
000032f0  65 72 66 61 63 65 5f 53  6c 61 62 42 75 74 74 6f  |erface_SlabButto|
00003300  6e 22 2c 2c 42 6c 6f 63  6b 0d 0d 5c 39 20 20 20  |n",,Block..\9   |
00003310  20 20 20 41 24 3d a4 52  65 61 64 49 63 6f 6e 53  |   A$=.ReadIconS|
00003320  74 72 28 53 61 76 65 2c  32 29 3a e7 20 41 24 3d  |tr(Save,2):. A$=|
00003330  22 22 20 8c 20 41 24 3d  22 53 57 49 a0 4c 69 73  |"" . A$="SWI.Lis|
00003340  74 22 0d 0d 66 20 20 20  20 20 20 20 f2 55 70 64  |t"..f       .Upd|
00003350  61 74 65 49 63 6f 6e 28  53 61 76 65 2c 32 2c 41  |ateIcon(Save,2,A|
00003360  24 29 0d 0d 70 94 20 20  20 20 20 20 e7 20 a7 41  |$)..p.      . .A|
00003370  24 2c 22 2e 22 29 3d 30  20 8c 20 42 6c 6f 63 6b  |$,".")=0 . Block|
00003380  21 38 3d 30 3a 42 6c 6f  63 6b 21 31 32 3d 53 61  |!8=0:Block!12=Sa|
00003390  76 65 3a 42 6c 6f 63 6b  21 31 36 3d 33 3a c8 99  |ve:Block!16=3:..|
000033a0  20 22 49 6e 74 65 72 66  61 63 65 5f 53 6c 61 62  | "Interface_Slab|
000033b0  42 75 74 74 6f 6e 22 2c  2c 42 6c 6f 63 6b 3a 85  |Button",,Block:.|
000033c0  20 39 39 39 39 2c 22 54  6f 20 73 61 76 65 2c 20  | 9999,"To save, |
000033d0  64 72 61 67 20 74 68 65  20 69 63 6f 6e 20 74 6f  |drag the icon to|
000033e0  20 61 20 64 69 72 65 63  74 6f 72 79 20 64 69 73  | a directory dis|
000033f0  70 6c 61 79 2e 22 0d 0d  7a ae 20 20 20 20 20 20  |play."..z.      |
00003400  e7 20 ac 20 a4 53 61 76  65 53 57 49 4c 69 73 74  |. . .SaveSWIList|
00003410  54 6f 46 69 6c 65 28 41  24 29 20 8c 20 f2 44 65  |ToFile(A$) . .De|
00003420  6c 65 74 65 57 69 6d 70  53 63 72 61 70 3a 42 6c  |leteWimpScrap:Bl|
00003430  6f 63 6b 21 38 3d 30 3a  42 6c 6f 63 6b 21 31 32  |ock!8=0:Block!12|
00003440  3d 53 61 76 65 3a 42 6c  6f 63 6b 21 31 36 3d 33  |=Save:Block!16=3|
00003450  3a c8 99 20 22 49 6e 74  65 72 66 61 63 65 5f 53  |:.. "Interface_S|
00003460  6c 61 62 42 75 74 74 6f  6e 22 2c 2c 42 6c 6f 63  |labButton",,Bloc|
00003470  6b 3a 85 20 39 39 39 39  2c 22 41 6e 20 65 72 72  |k:. 9999,"An err|
00003480  6f 72 20 6f 63 63 75 72  72 65 64 20 77 68 69 6c  |or occurred whil|
00003490  73 74 20 73 61 76 69 6e  67 20 74 68 65 20 66 69  |st saving the fi|
000034a0  6c 65 2e 22 0d 0d 84 4d  20 20 20 20 20 20 42 6c  |le."...M      Bl|
000034b0  6f 63 6b 21 38 3d 30 3a  42 6c 6f 63 6b 21 31 32  |ock!8=0:Block!12|
000034c0  3d 53 61 76 65 3a 42 6c  6f 63 6b 21 31 36 3d 33  |=Save:Block!16=3|
000034d0  3a c8 99 20 22 49 6e 74  65 72 66 61 63 65 5f 53  |:.. "Interface_S|
000034e0  6c 61 62 42 75 74 74 6f  6e 22 2c 2c 42 6c 6f 63  |labButton",,Bloc|
000034f0  6b 0d 0d 8e 22 20 20 20  20 20 20 c8 99 20 22 57  |k..."      .. "W|
00003500  69 6d 70 5f 43 72 65 61  74 65 4d 65 6e 75 22 2c  |imp_CreateMenu",|
00003510  2c 2d 31 0d 0d 98 09 20  20 20 20 cc 0d 0d a2 28  |,-1....    ....(|
00003520  20 20 20 20 20 20 c8 99  20 22 57 69 6d 70 5f 50  |      .. "Wimp_P|
00003530  72 6f 63 65 73 73 4b 65  79 22 2c 43 68 61 72 61  |rocessKey",Chara|
00003540  63 74 65 72 0d 0d ac 09  20 20 20 20 cd 0d 0d b6  |cter....    ....|
00003550  07 20 20 7f 0d 0d c0 26  20 20 20 20 c8 99 20 22  |.  ....&    .. "|
00003560  57 69 6d 70 5f 50 72 6f  63 65 73 73 4b 65 79 22  |Wimp_ProcessKey"|
00003570  2c 43 68 61 72 61 63 74  65 72 0d 0d ca 05 cb 0d  |,Character......|
00003580  0d d4 05 e1 0d 0d de 05  3a 0d 0d e8 11 dd 20 f2  |........:..... .|
00003590  44 65 63 6f 64 65 4d 65  6e 75 0d 0d f2 2a 53 75  |DecodeMenu...*Su|
000035a0  62 30 3d 42 6c 6f 63 6b  21 30 3a 53 75 62 31 3d  |b0=Block!0:Sub1=|
000035b0  42 6c 6f 63 6b 21 34 3a  53 75 62 32 3d 42 6c 6f  |Block!4:Sub2=Blo|
000035c0  63 6b 21 38 0d 0d fc 0f  43 6c 6f 73 65 4d 65 6e  |ck!8....CloseMen|
000035d0  75 3d a3 0d 0e 06 0b c8  8e 20 4d 25 20 ca 0d 0e  |u=....... M% ...|
000035e0  10 0f 20 20 c9 20 49 42  4d 65 6e 75 3a 0d 0e 1a  |..  . IBMenu:...|
000035f0  11 20 20 20 20 c8 8e 20  53 75 62 30 20 ca 0d 0e  |.    .. Sub0 ...|
00003600  24 0d 20 20 20 20 20 20  c9 20 30 0d 0e 2e 2b 20  |$.      . 0...+ |
00003610  20 20 20 20 20 20 20 c8  99 20 22 57 69 6d 70 5f  |       .. "Wimp_|
00003620  47 65 74 50 6f 69 6e 74  65 72 49 6e 66 6f 22 2c  |GetPointerInfo",|
00003630  2c 42 6c 6f 63 6b 0d 0e  38 3c 20 20 20 20 20 20  |,Block..8<      |
00003640  20 20 c8 99 20 22 57 69  6d 70 5f 43 72 65 61 74  |  .. "Wimp_Creat|
00003650  65 4d 65 6e 75 22 2c 2c  49 6e 66 6f 2c 42 6c 6f  |eMenu",,Info,Blo|
00003660  63 6b 21 30 2d 32 34 2c  42 6c 6f 63 6b 21 34 2b  |ck!0-24,Block!4+|
00003670  32 34 0d 0e 42 17 20 20  20 20 20 20 20 20 43 6c  |24..B.        Cl|
00003680  6f 73 65 4d 65 6e 75 3d  b9 0d 0e 4c 0d 20 20 20  |oseMenu=...L.   |
00003690  20 20 20 c9 20 31 0d 0e  56 12 20 20 20 20 20 20  |   . 1..V.      |
000036a0  20 20 44 6f 6e 65 3d b9  0d 0e 60 09 20 20 20 20  |  Done=...`.    |
000036b0  cb 0d 0e 6a 11 20 20 c9  20 4d 61 69 6e 4d 65 6e  |...j.  . MainMen|
000036c0  75 3a 0d 0e 74 11 20 20  20 20 c8 8e 20 53 75 62  |u:..t.    .. Sub|
000036d0  30 20 ca 0d 0e 7e 0d 20  20 20 20 20 20 c9 20 30  |0 ...~.      . 0|
000036e0  0d 0e 88 2b 20 20 20 20  20 20 20 20 c8 99 20 22  |...+        .. "|
000036f0  57 69 6d 70 5f 47 65 74  50 6f 69 6e 74 65 72 49  |Wimp_GetPointerI|
00003700  6e 66 6f 22 2c 2c 42 6c  6f 63 6b 0d 0e 92 3c 20  |nfo",,Block...< |
00003710  20 20 20 20 20 20 20 c8  99 20 22 57 69 6d 70 5f  |       .. "Wimp_|
00003720  43 72 65 61 74 65 4d 65  6e 75 22 2c 2c 49 6e 66  |CreateMenu",,Inf|
00003730  6f 2c 42 6c 6f 63 6b 21  30 2d 32 34 2c 42 6c 6f  |o,Block!0-24,Blo|
00003740  63 6b 21 34 2b 32 34 0d  0e 9c 17 20 20 20 20 20  |ck!4+24....     |
00003750  20 20 20 43 6c 6f 73 65  4d 65 6e 75 3d b9 0d 0e  |   CloseMenu=...|
00003760  a6 0d 20 20 20 20 20 20  c9 20 31 0d 0e b0 15 20  |..      . 1.... |
00003770  20 20 20 20 20 20 20 c8  8e 20 53 75 62 31 20 ca  |       .. Sub1 .|
00003780  0d 0e ba 1f 20 20 20 20  20 20 20 20 20 20 c9 20  |....          . |
00003790  2d 31 3a f4 20 44 6f 20  6e 6f 74 68 69 6e 67 0d  |-1:. Do nothing.|
000037a0  0e c4 1e 20 20 20 20 20  20 20 20 20 20 c9 20 30  |...          . 0|
000037b0  3a f2 53 63 61 6e 4d 6f  64 75 6c 65 73 0d 0e ce  |:.ScanModules...|
000037c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000037d0  20 20 43 6c 6f 73 65 4d  65 6e 75 3d b9 0d 0e d8  |  CloseMenu=....|
000037e0  32 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |2               |
000037f0  20 20 49 6e 64 65 78 3d  a4 43 72 65 61 74 65 49  |  Index=.CreateI|
00003800  6e 64 65 78 57 69 6e 64  6f 77 28 30 2c a3 29 0d  |ndexWindow(0,.).|
00003810  0e e2 37 20 20 20 20 20  20 20 20 20 20 20 20 20  |..7             |
00003820  20 20 20 20 f2 4f 70 65  6e 28 49 6e 64 65 78 2c  |    .Open(Index,|
00003830  a3 2c 58 50 6f 73 69 74  69 6f 6e 2c 59 50 6f 73  |.,XPosition,YPos|
00003840  69 74 69 6f 6e 29 0d 0e  ec 37 20 20 20 20 20 20  |ition)...7      |
00003850  20 20 20 20 20 20 20 20  20 20 20 f2 4f 70 65 6e  |           .Open|
00003860  28 49 6e 64 65 78 2c a3  2c 58 50 6f 73 69 74 69  |(Index,.,XPositi|
00003870  6f 6e 2c 59 50 6f 73 69  74 69 6f 6e 29 0d 0e f6  |on,YPosition)...|
00003880  0f 20 20 20 20 20 20 20  20 20 20 7f 0d 0f 00 31  |.          ....1|
00003890  20 20 20 20 20 20 20 20  20 20 20 20 e7 20 ac 20  |            . . |
000038a0  a4 4d 65 6e 75 54 69 63  6b 65 64 28 49 6e 64 65  |.MenuTicked(Inde|
000038b0  78 4d 65 6e 75 2c 53 75  62 31 29 20 8c 0d 0f 0a  |xMenu,Sub1) ....|
000038c0  34 20 20 20 20 20 20 20  20 20 20 20 20 20 20 49  |4              I|
000038d0  6e 64 65 78 3d a4 43 72  65 61 74 65 49 6e 64 65  |ndex=.CreateInde|
000038e0  78 57 69 6e 64 6f 77 28  53 75 62 31 2d 31 2c b9  |xWindow(Sub1-1,.|
000038f0  29 0d 0f 14 26 20 20 20  20 20 20 20 20 20 20 20  |)...&           |
00003900  20 20 20 e3 20 4e 3d 31  20 b8 20 54 6f 74 61 6c  |   . N=1 . Total|
00003910  4d 6f 64 75 6c 65 73 0d  0f 1e 31 20 20 20 20 20  |Modules...1     |
00003920  20 20 20 20 20 20 20 20  20 20 20 f2 54 69 63 6b  |           .Tick|
00003930  4d 65 6e 75 28 49 6e 64  65 78 4d 65 6e 75 2c 4e  |Menu(IndexMenu,N|
00003940  2c 4e 3d 53 75 62 31 29  0d 0f 28 13 20 20 20 20  |,N=Sub1)..(.    |
00003950  20 20 20 20 20 20 20 20  20 20 ed 0d 0f 32 34 20  |          ...24 |
00003960  20 20 20 20 20 20 20 20  20 20 20 20 20 f2 4f 70  |             .Op|
00003970  65 6e 28 49 6e 64 65 78  2c a3 2c 58 50 6f 73 69  |en(Index,.,XPosi|
00003980  74 69 6f 6e 2c 59 50 6f  73 69 74 69 6f 6e 29 0d  |tion,YPosition).|
00003990  0f 3c 34 20 20 20 20 20  20 20 20 20 20 20 20 20  |.<4             |
000039a0  20 f2 4f 70 65 6e 28 49  6e 64 65 78 2c a3 2c 58  | .Open(Index,.,X|
000039b0  50 6f 73 69 74 69 6f 6e  2c 59 50 6f 73 69 74 69  |Position,YPositi|
000039c0  6f 6e 29 0d 0f 46 11 20  20 20 20 20 20 20 20 20  |on)..F.         |
000039d0  20 20 20 cd 0d 0f 50 0d  20 20 20 20 20 20 20 20  |   ...P.        |
000039e0  cb 0d 0f 5a 0d 20 20 20  20 20 20 c9 20 32 0d 0f  |...Z.      . 2..|
000039f0  64 18 20 20 20 20 20 20  20 20 e7 20 53 75 62 31  |d.        . Sub1|
00003a00  3c 3e 2d 31 20 8c 0d 0f  6e 2b 20 20 20 20 20 20  |<>-1 ...n+      |
00003a10  20 20 20 20 41 24 3d 24  28 50 52 4d 4d 65 6e 75  |    A$=$(PRMMenu|
00003a20  2b 32 38 2b 28 32 34 2a  53 75 62 31 29 2b 31 32  |+28+(24*Sub1)+12|
00003a30  29 0d 0f 78 1a 20 20 20  20 20 20 20 20 20 20 e7  |)..x.          .|
00003a40  20 41 24 3c 3e 50 52 4d  24 20 8c 0d 0f 82 17 20  | A$<>PRM$ ..... |
00003a50  20 20 20 20 20 20 20 20  20 20 20 50 52 4d 24 3d  |           PRM$=|
00003a60  41 24 0d 0f 8c 1c 20 20  20 20 20 20 20 20 20 20  |A$....          |
00003a70  20 20 4d 25 3d 50 52 4d  4d 65 6e 75 2b 34 0d 0f  |  M%=PRMMenu+4..|
00003a80  96 1a 20 20 20 20 20 20  20 20 20 20 20 20 43 6f  |..            Co|
00003a90  75 6e 74 65 72 3d 2d 31  0d 0f a0 11 20 20 20 20  |unter=-1....    |
00003aa0  20 20 20 20 20 20 20 20  f5 0d 0f aa 23 20 20 20  |        ....#   |
00003ab0  20 20 20 20 20 20 20 20  20 20 20 43 6f 75 6e 74  |           Count|
00003ac0  65 72 2b 3d 31 3a 4d 25  2b 3d 32 34 0d 0f b4 39  |er+=1:M%+=24...9|
00003ad0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 f2 54  |              .T|
00003ae0  69 63 6b 4d 65 6e 75 28  50 52 4d 4d 65 6e 75 2c  |ickMenu(PRMMenu,|
00003af0  43 6f 75 6e 74 65 72 2c  43 6f 75 6e 74 65 72 3d  |Counter,Counter=|
00003b00  53 75 62 31 29 0d 0f be  24 20 20 20 20 20 20 20  |Sub1)...$       |
00003b10  20 20 20 20 20 fd 20 28  28 4d 25 21 30 29 20 80  |     . ((M%!0) .|
00003b20  20 31 32 38 29 3d 31 32  38 0d 0f c8 23 20 20 20  | 128)=128...#   |
00003b30  20 20 20 20 20 20 20 20  20 f2 4c 6f 61 64 50 52  |         .LoadPR|
00003b40  4d 49 6e 64 65 78 28 50  52 4d 24 29 0d 0f d2 19  |MIndex(PRM$)....|
00003b50  20 20 20 20 20 20 20 20  20 20 20 20 43 6f 75 6e  |            Coun|
00003b60  74 65 72 3d 30 0d 0f dc  3d 20 20 20 20 20 20 20  |ter=0...=       |
00003b70  20 20 20 20 20 f5 3a 43  6f 75 6e 74 65 72 2b 3d  |     .:Counter+=|
00003b80  31 3a fd 20 a4 4d 65 6e  75 54 69 63 6b 65 64 28  |1:. .MenuTicked(|
00003b90  49 6e 64 65 78 4d 65 6e  75 2c 43 6f 75 6e 74 65  |IndexMenu,Counte|
00003ba0  72 29 0d 0f e6 35 20 20  20 20 20 20 20 20 20 20  |r)...5          |
00003bb0  20 20 49 6e 64 65 78 3d  a4 43 72 65 61 74 65 49  |  Index=.CreateI|
00003bc0  6e 64 65 78 57 69 6e 64  6f 77 28 43 6f 75 6e 74  |ndexWindow(Count|
00003bd0  65 72 2d 31 2c a3 29 0d  0f f0 32 20 20 20 20 20  |er-1,.)...2     |
00003be0  20 20 20 20 20 20 20 f2  4f 70 65 6e 28 49 6e 64  |       .Open(Ind|
00003bf0  65 78 2c a3 2c 58 50 6f  73 69 74 69 6f 6e 2c 59  |ex,.,XPosition,Y|
00003c00  50 6f 73 69 74 69 6f 6e  29 0d 0f fa 32 20 20 20  |Position)...2   |
00003c10  20 20 20 20 20 20 20 20  20 f2 4f 70 65 6e 28 49  |         .Open(I|
00003c20  6e 64 65 78 2c a3 2c 58  50 6f 73 69 74 69 6f 6e  |ndex,.,XPosition|
00003c30  2c 59 50 6f 73 69 74 69  6f 6e 29 0d 10 04 0f 20  |,YPosition).... |
00003c40  20 20 20 20 20 20 20 20  20 cd 0d 10 0e 19 20 20  |         .....  |
00003c50  20 20 20 20 20 20 20 20  4d 25 3d 4d 61 69 6e 4d  |        M%=MainM|
00003c60  65 6e 75 0d 10 18 0d 20  20 20 20 20 20 20 20 cd  |enu....        .|
00003c70  0d 10 22 0d 20 20 20 20  20 20 c9 20 33 0d 10 2c  |..".      . 3..,|
00003c80  2b 20 20 20 20 20 20 20  20 c8 99 20 22 57 69 6d  |+        .. "Wim|
00003c90  70 5f 47 65 74 50 6f 69  6e 74 65 72 49 6e 66 6f  |p_GetPointerInfo|
00003ca0  22 2c 2c 42 6c 6f 63 6b  0d 10 36 3b 20 20 20 20  |",,Block..6;    |
00003cb0  20 20 20 20 c8 99 20 22  57 69 6d 70 5f 43 72 65  |    .. "Wimp_Cre|
00003cc0  61 74 65 4d 65 6e 75 22  2c 2c 4c 6f 63 2c 42 6c  |ateMenu",,Loc,Bl|
00003cd0  6f 63 6b 21 30 2d 32 34  2c 42 6c 6f 63 6b 21 34  |ock!0-24,Block!4|
00003ce0  2b 32 34 0d 10 40 17 20  20 20 20 20 20 20 20 43  |+24..@.        C|
00003cf0  6c 6f 73 65 4d 65 6e 75  3d b9 0d 10 4a 0d 20 20  |loseMenu=...J.  |
00003d00  20 20 20 20 c9 20 34 0d  10 54 2b 20 20 20 20 20  |    . 4..T+     |
00003d10  20 20 20 c8 99 20 22 57  69 6d 70 5f 47 65 74 50  |   .. "Wimp_GetP|
00003d20  6f 69 6e 74 65 72 49 6e  66 6f 22 2c 2c 42 6c 6f  |ointerInfo",,Blo|
00003d30  63 6b 0d 10 5e 3d 20 20  20 20 20 20 20 20 c8 99  |ck..^=        ..|
00003d40  20 22 57 69 6d 70 5f 43  72 65 61 74 65 4d 65 6e  | "Wimp_CreateMen|
00003d50  75 22 2c 2c 53 61 76 65  2c 42 6c 6f 63 6b 21 30  |u",,Save,Block!0|
00003d60  2d 31 34 36 2c 42 6c 6f  63 6b 21 34 2b 36 30 0d  |-146,Block!4+60.|
00003d70  10 68 17 20 20 20 20 20  20 20 20 43 6c 6f 73 65  |.h.        Close|
00003d80  4d 65 6e 75 3d b9 0d 10  72 0d 20 20 20 20 20 20  |Menu=...r.      |
00003d90  c9 20 35 0d 10 7c 5c 20  20 20 20 20 20 20 20 e7  |. 5..|\        .|
00003da0  20 ac 20 a4 53 61 76 65  53 65 74 74 69 6e 67 73  | . .SaveSettings|
00003db0  20 8c 20 85 20 39 39 39  39 2c 22 41 6e 20 65 72  | . . 9999,"An er|
00003dc0  72 6f 72 20 6f 63 63 75  72 72 65 64 20 77 68 69  |ror occurred whi|
00003dd0  6c 73 74 20 77 72 69 74  69 6e 67 20 74 68 65 20  |lst writing the |
00003de0  73 65 74 74 69 6e 67 73  20 66 69 6c 65 2e 22 0d  |settings file.".|
00003df0  10 86 09 20 20 20 20 cb  0d 10 90 05 cb 0d 10 9a  |...    .........|
00003e00  23 c8 99 20 22 57 69 6d  70 5f 47 65 74 50 6f 69  |#.. "Wimp_GetPoi|
00003e10  6e 74 65 72 49 6e 66 6f  22 2c 2c 42 6c 6f 63 6b  |nterInfo",,Block|
00003e20  0d 10 a4 33 e7 20 28 28  42 6c 6f 63 6b 21 38 20  |...3. ((Block!8 |
00003e30  80 20 31 29 3d 31 29 20  80 20 28 ac 20 43 6c 6f  |. 1)=1) . (. Clo|
00003e40  73 65 4d 65 6e 75 29 20  8c 20 f2 4d 61 6b 65 4d  |seMenu) . .MakeM|
00003e50  65 6e 75 0d 10 ae 05 e1  0d 10 b8 05 3a 0d 10 c2  |enu.........:...|
00003e60  4f f4 20 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |O. -------------|
00003e70  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00003ea0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 0d 10 cc 13  |------------....|
00003eb0  f4 20 4d 65 6e 75 20 72  6f 75 74 69 6e 65 73 0d  |. Menu routines.|
00003ec0  10 d6 4f f4 20 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |..O. -----------|
00003ed0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00003f00  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0d 10  |--------------..|
00003f10  e0 05 3a 0d 10 ea 11 dd  20 f2 42 75 69 6c 64 4d  |..:..... .BuildM|
00003f20  65 6e 75 73 0d 10 f4 49  f4 20 54 68 69 73 20 70  |enus...I. This p|
00003f30  72 6f 63 65 64 75 72 65  20 73 68 6f 75 6c 64 20  |rocedure should |
00003f40  6f 6e 6c 79 20 62 65 20  76 69 73 69 74 65 64 20  |only be visited |
00003f50  6f 6e 63 65 2c 20 73 69  6e 63 65 20 69 74 20 63  |once, since it c|
00003f60  6f 6e 74 61 69 6e 73 20  44 49 4d 73 2e 0d 10 fe  |ontains DIMs....|
00003f70  07 20 20 3a 0d 11 08 4f  f4 20 49 6e 20 74 68 65  |.  :...O. In the|
00003f80  20 6d 65 6e 75 20 74 69  74 6c 65 20 73 74 72 69  | menu title stri|
00003f90  6e 67 73 20 62 65 6c 6f  77 2c 20 69 66 20 61 20  |ngs below, if a |
00003fa0  22 7c 22 20 63 68 61 72  61 63 74 65 72 20 69 73  |"|" character is|
00003fb0  20 70 72 65 73 65 6e 74  20 69 74 20 77 69 6c 6c  | present it will|
00003fc0  20 62 65 0d 11 12 4f f4  20 72 65 70 6c 61 63 65  | be...O. replace|
00003fd0  64 20 62 79 20 61 20 73  70 61 63 65 20 75 6e 64  |d by a space und|
00003fe0  65 72 20 52 49 53 43 20  4f 53 20 33 2e 31 20 28  |er RISC OS 3.1 (|
00003ff0  6f 72 20 67 72 65 61 74  65 72 29 2c 20 6f 72 20  |or greater), or |
00004000  77 69 6c 6c 20 74 65 72  6d 69 6e 61 74 65 20 74  |will terminate t|
00004010  68 65 0d 11 1c 4f f4 20  73 74 72 69 6e 67 20 75  |he...O. string u|
00004020  6e 64 65 72 20 65 61 72  6c 69 65 72 20 76 65 72  |nder earlier ver|
00004030  73 69 6f 6e 73 20 6f 66  20 74 68 65 20 77 69 6d  |sions of the wim|
00004040  70 2e 20 54 68 69 73 20  61 6c 6c 6f 77 73 20 74  |p. This allows t|
00004050  68 65 20 6e 65 77 20 69  6e 64 69 72 65 63 74 65  |he new indirecte|
00004060  64 0d 11 26 46 f4 20 6d  65 6e 75 20 74 69 74 6c  |d..&F. menu titl|
00004070  65 73 20 74 6f 20 62 65  20 75 73 65 64 20 28 77  |es to be used (w|
00004080  68 69 63 68 20 77 65 72  65 20 69 6e 74 72 6f 64  |hich were introd|
00004090  75 63 65 64 20 77 69 74  68 20 52 49 53 43 20 4f  |uced with RISC O|
000040a0  53 20 33 2e 31 29 2e 0d  11 30 07 20 20 3a 0d 11  |S 3.1)...0.  :..|
000040b0  3a 23 49 6e 64 69 72 65  63 74 4d 65 6e 75 54 65  |:#IndirectMenuTe|
000040c0  78 74 4f 66 66 73 65 74  50 6f 69 6e 74 65 72 3d  |xtOffsetPointer=|
000040d0  30 0d 11 44 4e f4 20 54  68 69 73 20 70 6f 69 6e  |0..DN. This poin|
000040e0  74 73 20 74 6f 20 61 20  70 6f 6f 6c 20 74 6f 20  |ts to a pool to |
000040f0  62 65 20 75 73 65 64 20  62 79 20 61 6c 6c 20 6d  |be used by all m|
00004100  65 6e 75 73 20 66 6f 72  20 74 68 65 69 72 20 69  |enus for their i|
00004110  6e 64 69 72 65 63 74 65  64 20 74 65 78 74 2e 0d  |ndirected text..|
00004120  11 4e 07 20 20 3a 0d 11  58 0d 4d 25 3d 49 42 4d  |.N.  :..X.M%=IBM|
00004130  65 6e 75 0d 11 62 48 54  69 74 6c 65 24 3d 22 53  |enu..bHTitle$="S|
00004140  57 49 20 49 6e 64 65 78  22 3a de 20 49 42 4d 65  |WI Index":. IBMe|
00004150  6e 75 54 69 74 6c 65 20  a9 28 54 69 74 6c 65 24  |nuTitle .(Title$|
00004160  29 2b 31 3a 24 49 42 4d  65 6e 75 54 69 74 6c 65  |)+1:$IBMenuTitle|
00004170  3d 54 69 74 6c 65 24 2b  bd 31 33 0d 11 6c 1a f2  |=Title$+.13..l..|
00004180  4d 65 6e 75 49 6e 69 74  28 49 42 4d 65 6e 75 54  |MenuInit(IBMenuT|
00004190  69 74 6c 65 29 0d 11 76  1c f2 4d 65 6e 75 49 74  |itle)..v..MenuIt|
000041a0  65 6d 28 22 49 6e 66 6f  22 2c 30 2c 49 6e 66 6f  |em("Info",0,Info|
000041b0  29 0d 11 80 1c f2 4d 65  6e 75 49 74 65 6d 28 22  |).....MenuItem("|
000041c0  51 75 69 74 22 2c 31 32  38 2c 2d 31 29 0d 11 8a  |Quit",128,-1)...|
000041d0  07 20 20 3a 0d 11 94 0f  4d 25 3d 4d 61 69 6e 4d  |.  :....M%=MainM|
000041e0  65 6e 75 0d 11 9e 4c 54  69 74 6c 65 24 3d 22 53  |enu...LTitle$="S|
000041f0  57 49 20 49 6e 64 65 78  22 3a de 20 4d 61 69 6e  |WI Index":. Main|
00004200  4d 65 6e 75 54 69 74 6c  65 20 a9 28 54 69 74 6c  |MenuTitle .(Titl|
00004210  65 24 29 2b 32 3a 24 4d  61 69 6e 4d 65 6e 75 54  |e$)+2:$MainMenuT|
00004220  69 74 6c 65 3d 54 69 74  6c 65 24 2b bd 31 33 0d  |itle=Title$+.13.|
00004230  11 a8 1c f2 4d 65 6e 75  49 6e 69 74 28 4d 61 69  |....MenuInit(Mai|
00004240  6e 4d 65 6e 75 54 69 74  6c 65 29 0d 11 b2 1c f2  |nMenuTitle).....|
00004250  4d 65 6e 75 49 74 65 6d  28 22 49 6e 66 6f 22 2c  |MenuItem("Info",|
00004260  32 2c 49 6e 66 6f 29 0d  11 bc 29 f2 4d 65 6e 75  |2,Info)...).Menu|
00004270  49 74 65 6d 28 22 4d 6f  64 75 6c 65 20 69 6e 64  |Item("Module ind|
00004280  65 78 22 2c 30 2c 49 6e  64 65 78 4d 65 6e 75 29  |ex",0,IndexMenu)|
00004290  0d 11 c6 29 f2 4d 65 6e  75 49 74 65 6d 28 22 50  |...).MenuItem("P|
000042a0  52 4d 20 70 61 67 65 20  69 6e 64 65 78 22 2c 30  |RM page index",0|
000042b0  2c 50 52 4d 4d 65 6e 75  29 0d 11 d0 26 f2 4d 65  |,PRMMenu)...&.Me|
000042c0  6e 75 49 74 65 6d 28 22  57 69 6e 64 6f 77 20 70  |nuItem("Window p|
000042d0  6f 73 69 74 69 6f 6e 22  2c 32 2c 4c 6f 63 29 0d  |osition",2,Loc).|
000042e0  11 da 25 f2 4d 65 6e 75  49 74 65 6d 28 22 53 61  |..%.MenuItem("Sa|
000042f0  76 65 20 53 57 49 20 6c  69 73 74 22 2c 30 2c 53  |ve SWI list",0,S|
00004300  61 76 65 29 0d 11 e4 25  f2 4d 65 6e 75 49 74 65  |ave)...%.MenuIte|
00004310  6d 28 22 53 61 76 65 20  73 65 74 74 69 6e 67 73  |m("Save settings|
00004320  22 2c 31 32 38 2c 2d 31  29 0d 11 ee 05 e1 0d 11  |",128,-1).......|
00004330  f8 05 3a 0d 12 02 0f dd  20 f2 4d 61 6b 65 4d 65  |..:..... .MakeMe|
00004340  6e 75 0d 12 0c 17 e7 20  4d 65 6e 75 58 3c 30 20  |nu..... MenuX<0 |
00004350  8c 20 4d 65 6e 75 58 3d  30 0d 12 16 2a e7 20 4d  |. MenuX=0...*. M|
00004360  65 6e 75 59 3c 31 38 34  20 8c 20 4d 65 6e 75 59  |enuY<184 . MenuY|
00004370  3d 31 38 34 3a f4 20 66  6f 72 20 69 63 6f 6e 20  |=184:. for icon |
00004380  62 61 72 0d 12 20 37 c8  99 20 22 57 69 6d 70 5f  |bar.. 7.. "Wimp_|
00004390  43 72 65 61 74 65 4d 65  6e 75 22 2c 2c 4d 25 2c  |CreateMenu",,M%,|
000043a0  4d 65 6e 75 58 2d 28 28  33 36 2b 4d 25 21 31 36  |MenuX-((36+M%!16|
000043b0  29 2f 32 29 2c 4d 65 6e  75 59 0d 12 2a 05 e1 0d  |)/2),MenuY..*...|
000043c0  12 34 05 3a 0d 12 3e 1a  dd 20 f2 4d 65 6e 75 49  |.4.:..>.. .MenuI|
000043d0  6e 69 74 28 4d 65 6e 75  54 69 74 6c 65 29 0d 12  |nit(MenuTitle)..|
000043e0  48 11 e7 20 77 69 6d 70  3e 3d 33 31 30 20 8c 0d  |H.. wimp>=310 ..|
000043f0  12 52 37 20 20 41 3d a7  24 4d 65 6e 75 54 69 74  |.R7  A=.$MenuTit|
00004400  6c 65 2c 22 7c 22 29 3a  e7 20 41 3c 3e 30 20 8c  |le,"|"):. A<>0 .|
00004410  20 3f 28 4d 65 6e 75 54  69 74 6c 65 2b 28 41 2d  | ?(MenuTitle+(A-|
00004420  31 29 29 3d 33 32 0d 12  5c 1b 20 20 4d 65 6e 75  |1))=32..\.  Menu|
00004430  4d 61 78 3d a9 28 24 4d  65 6e 75 54 69 74 6c 65  |Max=.($MenuTitle|
00004440  29 0d 12 66 14 20 20 4d  25 21 30 3d 4d 65 6e 75  |)..f.  M%!0=Menu|
00004450  54 69 74 6c 65 0d 12 70  05 cc 0d 12 7a 37 20 20  |Title..p....z7  |
00004460  41 3d a7 24 4d 65 6e 75  54 69 74 6c 65 2c 22 7c  |A=.$MenuTitle,"||
00004470  22 29 3a e7 20 41 3c 3e  30 20 8c 20 3f 28 4d 65  |"):. A<>0 . ?(Me|
00004480  6e 75 54 69 74 6c 65 2b  28 41 2d 31 29 29 3d 31  |nuTitle+(A-1))=1|
00004490  33 0d 12 84 20 20 20 4d  65 6e 75 4d 61 78 3d a9  |3...   MenuMax=.|
000044a0  28 c0 24 4d 65 6e 75 54  69 74 6c 65 2c 31 32 29  |(.$MenuTitle,12)|
000044b0  29 0d 12 8e 19 20 20 24  4d 25 3d c0 24 4d 65 6e  |)....  $M%=.$Men|
000044c0  75 54 69 74 6c 65 2c 31  32 29 0d 12 98 05 cd 0d  |uTitle,12)......|
000044d0  12 a2 24 4d 25 3f 31 32  3d 37 3a 4d 25 3f 31 33  |..$M%?12=7:M%?13|
000044e0  3d 32 3a 4d 25 3f 31 34  3d 31 31 3a 4d 25 3f 31  |=2:M%?14=11:M%?1|
000044f0  35 3d 30 0d 12 ac 14 4d  25 21 31 36 3d 4d 65 6e  |5=0....M%!16=Men|
00004500  75 4d 61 78 2a 31 36 0d  12 b6 14 4d 25 21 32 30  |uMax*16....M%!20|
00004510  3d 34 34 3a 4d 25 21 32  34 3d 30 0d 12 c0 0c 50  |=44:M%!24=0....P|
00004520  25 3d 4d 25 2b 32 38 0d  12 ca 05 e1 0d 12 d4 05  |%=M%+28.........|
00004530  3a 0d 12 de 21 dd 20 f2  4d 65 6e 75 49 74 65 6d  |:...!. .MenuItem|
00004540  28 54 65 78 74 24 2c 46  6c 61 67 73 2c 4c 69 6e  |(Text$,Flags,Lin|
00004550  6b 29 0d 12 e8 4b f4 20  46 6c 61 67 73 3a 20 31  |k)...K. Flags: 1|
00004560  2d 74 69 63 6b 65 64 2c  20 32 2d 64 61 73 68 65  |-ticked, 2-dashe|
00004570  64 20 6c 69 6e 65 2c 20  34 2d 77 72 69 74 65 61  |d line, 4-writea|
00004580  62 6c 65 2c 20 38 2d 6d  65 73 73 61 67 65 2c 20  |ble, 8-message, |
00004590  31 32 38 2d 6c 61 73 74  20 69 74 65 6d 0d 12 f2  |128-last item...|
000045a0  31 f4 20 4c 69 6e 6b 3a  20 6d 65 6e 75 20 6f 72  |1. Link: menu or|
000045b0  20 77 69 6e 64 6f 77 20  68 61 6e 64 6c 65 20 66  | window handle f|
000045c0  6f 72 20 73 75 62 2d 70  6f 69 6e 74 65 72 0d 12  |or sub-pointer..|
000045d0  fc 18 50 25 21 30 3d 46  6c 61 67 73 3a 50 25 21  |..P%!0=Flags:P%!|
000045e0  34 3d 4c 69 6e 6b 0d 13  06 14 e7 20 a9 28 54 65  |4=Link..... .(Te|
000045f0  78 74 24 29 3c 3d 31 32  20 8c 0d 13 10 25 20 20  |xt$)<=12 ....%  |
00004600  50 25 21 38 3d 26 30 37  30 30 33 30 32 31 3a f4  |P%!8=&07003021:.|
00004610  20 4e 6f 74 20 69 6e 64  69 72 65 63 74 65 64 0d  | Not indirected.|
00004620  13 1a 14 20 20 24 28 50  25 2b 31 32 29 3d 54 65  |...  $(P%+12)=Te|
00004630  78 74 24 0d 13 24 05 cc  0d 13 2e 21 20 20 50 25  |xt$..$.....!  P%|
00004640  21 38 3d 26 30 37 30 30  33 31 32 31 3a f4 20 49  |!8=&07003121:. I|
00004650  6e 64 69 72 65 63 74 65  64 0d 13 38 3a 20 20 50  |ndirected..8:  P|
00004660  25 21 31 32 3d 49 6e 64  69 72 65 63 74 4d 65 6e  |%!12=IndirectMen|
00004670  75 54 65 78 74 2b 49 6e  64 69 72 65 63 74 4d 65  |uText+IndirectMe|
00004680  6e 75 54 65 78 74 4f 66  66 73 65 74 50 6f 69 6e  |nuTextOffsetPoin|
00004690  74 65 72 0d 13 42 15 20  20 50 25 21 31 36 3d 30  |ter..B.  P%!16=0|
000046a0  3a 50 25 21 32 30 3d 30  0d 13 4c 41 20 20 24 28  |:P%!20=0..LA  $(|
000046b0  49 6e 64 69 72 65 63 74  4d 65 6e 75 54 65 78 74  |IndirectMenuText|
000046c0  2b 49 6e 64 69 72 65 63  74 4d 65 6e 75 54 65 78  |+IndirectMenuTex|
000046d0  74 4f 66 66 73 65 74 50  6f 69 6e 74 65 72 29 3d  |tOffsetPointer)=|
000046e0  54 65 78 74 24 2b bd 31  33 0d 13 56 2f 20 20 49  |Text$+.13..V/  I|
000046f0  6e 64 69 72 65 63 74 4d  65 6e 75 54 65 78 74 4f  |ndirectMenuTextO|
00004700  66 66 73 65 74 50 6f 69  6e 74 65 72 2b 3d a9 28  |ffsetPointer+=.(|
00004710  54 65 78 74 24 29 2b 31  0d 13 60 82 20 20 e7 20  |Text$)+1..`.  . |
00004720  49 6e 64 69 72 65 63 74  4d 65 6e 75 54 65 78 74  |IndirectMenuText|
00004730  4f 66 66 73 65 74 50 6f  69 6e 74 65 72 3e 49 6e  |OffsetPointer>In|
00004740  64 4d 65 6e 75 4d 61 78  20 8c 20 85 20 30 2c 22  |dMenuMax . . 0,"|
00004750  54 68 65 20 69 6e 64 69  72 65 63 74 20 6d 65 6e  |The indirect men|
00004760  75 20 74 65 78 74 20 62  75 66 66 65 72 20 68 61  |u text buffer ha|
00004770  73 20 6f 76 65 72 66 6c  6f 77 65 64 2e 20 50 6c  |s overflowed. Pl|
00004780  65 61 73 65 20 61 6c 6c  6f 63 61 74 65 20 6d 6f  |ease allocate mo|
00004790  72 65 20 73 70 61 63 65  2e 22 0d 13 6a 05 cd 0d  |re space."..j...|
000047a0  13 74 0a 50 25 2b 3d 32  34 0d 13 7e 3e e7 20 4d  |.t.P%+=24..~>. M|
000047b0  65 6e 75 4d 61 78 3c a9  28 54 65 78 74 24 29 20  |enuMax<.(Text$) |
000047c0  8c 20 4d 65 6e 75 4d 61  78 3d a9 28 54 65 78 74  |. MenuMax=.(Text|
000047d0  24 29 3a 4d 25 21 31 36  3d 28 4d 65 6e 75 4d 61  |$):M%!16=(MenuMa|
000047e0  78 2b 31 29 2a 31 36 0d  13 88 41 e7 20 28 46 6c  |x+1)*16...A. (Fl|
000047f0  61 67 73 3d 31 32 38 29  20 80 20 28 77 69 6d 70  |ags=128) . (wimp|
00004800  3e 3d 33 31 30 29 20 8c  20 4d 25 21 32 38 3d 28  |>=310) . M%!28=(|
00004810  28 28 4d 25 21 32 38 29  20 80 20 ac 20 32 35 36  |((M%!28) . . 256|
00004820  29 20 82 20 32 35 36 29  0d 13 92 37 20 20 f4 20  |) . 256)...7  . |
00004830  49 6e 64 69 72 65 63 74  65 64 20 6d 65 6e 75 20  |Indirected menu |
00004840  74 69 74 6c 65 73 20 66  6f 72 20 52 49 53 43 20  |titles for RISC |
00004850  4f 53 20 33 2e 31 20 75  70 77 61 72 64 73 2e 0d  |OS 3.1 upwards..|
00004860  13 9c 05 e1 0d 13 a6 05  3a 0d 13 b0 4f f4 20 2d  |........:...O. -|
00004870  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000048b0  2d 2d 2d 2d 2d 2d 2d 2d  0d 13 ba 29 f4 20 52 65  |--------...). Re|
000048c0  73 70 6f 6e 73 65 73 20  74 6f 20 69 6e 63 6f 6d  |sponses to incom|
000048d0  69 6e 67 20 77 69 6d 70  20 6d 65 73 73 61 67 65  |ing wimp message|
000048e0  73 0d 13 c4 4f f4 20 2d  2d 2d 2d 2d 2d 2d 2d 2d  |s...O. ---------|
000048f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00004930  0d 13 ce 05 3a 0d 13 d8  18 dd 20 f2 53 61 76 65  |....:..... .Save|
00004940  44 65 73 6b 74 6f 70 28  46 69 6c 65 29 0d 13 e2  |Desktop(File)...|
00004950  07 ea 20 85 0d 13 ec 47  ee 20 85 20 ea 20 42 6c  |.. ....G. . . Bl|
00004960  6f 63 6b 21 31 32 3d 42  6c 6f 63 6b 21 38 3a c8  |ock!12=Block!8:.|
00004970  99 20 22 57 69 6d 70 5f  53 65 6e 64 4d 65 73 73  |. "Wimp_SendMess|
00004980  61 67 65 22 2c 31 39 2c  42 6c 6f 63 6b 2c 42 6c  |age",19,Block,Bl|
00004990  6f 63 6b 21 34 3a f7 20  85 3a e1 0d 13 f6 49 f4  |ock!4:. .:....I.|
000049a0  20 54 68 65 20 61 62 6f  76 65 20 6c 69 6e 65 20  | The above line |
000049b0  61 63 6b 6e 6f 77 6c 65  64 67 65 73 20 74 68 65  |acknowledges the|
000049c0  20 6d 65 73 73 61 67 65  20 69 66 20 61 6e 20 65  | message if an e|
000049d0  72 72 6f 72 20 6f 63 63  75 72 73 2c 20 74 68 65  |rror occurs, the|
000049e0  72 65 62 79 0d 14 00 20  f4 20 61 62 6f 72 74 69  |reby... . aborti|
000049f0  6e 67 20 74 68 65 20 64  65 73 6b 74 6f 70 20 73  |ng the desktop s|
00004a00  61 76 65 2e 0d 14 0a 2b  d5 23 46 69 6c 65 2c 22  |ave....+.#File,"|
00004a10  52 75 6e 20 22 2b 4f 75  72 50 61 74 68 4e 61 6d  |Run "+OurPathNam|
00004a20  65 24 2b 4f 75 72 46 69  6c 65 4e 61 6d 65 24 0d  |e$+OurFileName$.|
00004a30  14 14 05 e1 0d 14 1e 05  3a 0d 14 28 0b dd 20 f2  |........:..(.. .|
00004a40  48 65 6c 70 0d 14 32 34  42 6c 6f 63 6b 21 31 32  |Help..24Block!12|
00004a50  3d 42 6c 6f 63 6b 21 38  3a 42 6c 6f 63 6b 21 31  |=Block!8:Block!1|
00004a60  36 3d 26 35 30 33 3a 48  65 6c 70 49 6e 66 6f 3d  |6=&503:HelpInfo=|
00004a70  42 6c 6f 63 6b 2b 32 30  0d 14 3c 07 20 20 3a 0d  |Block+20..<.  :.|
00004a80  14 46 30 f4 20 42 6c 6f  63 6b 21 33 32 20 67 69  |.F0. Block!32 gi|
00004a90  76 65 73 20 77 69 6e 64  6f 77 2c 20 42 6c 6f 63  |ves window, Bloc|
00004aa0  6b 21 33 36 20 67 69 76  65 73 20 69 63 6f 6e 0d  |k!36 gives icon.|
00004ab0  14 50 07 20 20 3a 0d 14  5a 11 c8 8e 20 42 6c 6f  |.P.  :..Z... Blo|
00004ac0  63 6b 21 33 32 20 ca 0d  14 64 2f 20 20 c9 20 2d  |ck!32 ...d/  . -|
00004ad0  32 3a f2 53 65 6e 64 28  22 54 68 69 73 20 69 73  |2:.Send("This is|
00004ae0  20 74 68 65 20 53 57 49  20 49 6e 64 65 78 20 69  | the SWI Index i|
00004af0  63 6f 6e 2e 22 29 0d 14  6e 3d 20 20 20 20 20 20  |con.")..n=      |
00004b00  20 20 20 20 f2 53 65 6e  64 28 22 43 6c 69 63 6b  |    .Send("Click|
00004b10  20 4d 45 4e 55 20 66 6f  72 20 69 6e 66 6f 72 6d  | MENU for inform|
00004b20  61 74 69 6f 6e 20 6f 72  20 74 6f 20 71 75 69 74  |ation or to quit|
00004b30  2e 22 29 0d 14 78 41 20  20 20 20 20 20 20 20 20  |.")..xA         |
00004b40  20 f2 53 65 6e 64 28 22  43 6c 69 63 6b 20 53 45  | .Send("Click SE|
00004b50  4c 45 43 54 20 74 6f 20  6f 70 65 6e 20 74 68 65  |LECT to open the|
00004b60  20 53 57 49 20 49 6e 64  65 78 20 77 69 6e 64 6f  | SWI Index windo|
00004b70  77 2e 22 29 0d 14 82 aa  20 20 c9 20 49 6e 64 65  |w.")....  . Inde|
00004b80  78 3a f2 53 65 6e 64 28  22 54 68 69 73 20 77 69  |x:.Send("This wi|
00004b90  6e 64 6f 77 20 64 69 73  70 6c 61 79 73 20 61 6c  |ndow displays al|
00004ba0  6c 20 74 68 65 20 53 57  49 20 63 61 6c 6c 73 20  |l the SWI calls |
00004bb0  70 72 6f 76 69 64 65 64  20 62 79 20 61 20 6d 6f  |provided by a mo|
00004bc0  64 75 6c 65 2c 20 61 6e  64 20 74 68 65 69 72 20  |dule, and their |
00004bd0  70 61 67 65 20 72 65 66  65 72 65 6e 63 65 73 20  |page references |
00004be0  69 66 20 74 68 65 79 20  61 72 65 20 64 6f 63 75  |if they are docu|
00004bf0  6d 65 6e 74 65 64 20 69  6e 20 74 68 65 20 50 72  |mented in the Pr|
00004c00  6f 67 72 61 6d 6d 65 72  27 73 20 52 65 66 65 72  |ogrammer's Refer|
00004c10  65 6e 63 65 20 4d 61 6e  75 61 6c 2e 22 29 0d 14  |ence Manual.")..|
00004c20  8c 4a 20 20 20 20 20 20  20 20 20 20 20 20 20 f2  |.J             .|
00004c30  53 65 6e 64 28 22 54 68  65 20 77 6f 72 64 20 6f  |Send("The word o|
00004c40  6e 20 74 68 65 20 72 61  69 73 65 64 20 62 6f 72  |n the raised bor|
00004c50  64 65 72 20 69 73 20 74  68 65 20 53 57 49 20 70  |der is the SWI p|
00004c60  72 65 66 69 78 2e 22 29  0d 14 96 37 20 20 20 20  |refix.")...7    |
00004c70  20 20 20 20 20 20 20 20  20 f2 53 65 6e 64 28 22  |         .Send("|
00004c80  43 6c 69 63 6b 20 4d 45  4e 55 20 66 6f 72 20 74  |Click MENU for t|
00004c90  68 65 20 6d 61 69 6e 20  6d 65 6e 75 2e 22 29 0d  |he main menu.").|
00004ca0  14 a0 47 20 20 c9 20 49  6e 66 6f 3a f2 53 65 6e  |..G  . Info:.Sen|
00004cb0  64 28 22 54 68 69 73 20  77 69 6e 64 6f 77 20 64  |d("This window d|
00004cc0  69 73 70 6c 61 79 73 20  69 6e 66 6f 72 6d 61 74  |isplays informat|
00004cd0  69 6f 6e 20 61 62 6f 75  74 20 53 57 49 20 49 6e  |ion about SWI In|
00004ce0  64 65 78 2e 22 29 0d 14  aa 5a 20 20 20 20 20 20  |dex.")...Z      |
00004cf0  20 20 20 20 20 20 f2 53  65 6e 64 28 22 53 57 49  |      .Send("SWI|
00004d00  20 49 6e 64 65 78 20 69  73 20 61 20 6d 65 6d 62  | Index is a memb|
00004d10  65 72 20 6f 66 20 74 68  65 20 4f 6d 6e 69 44 65  |er of the OmniDe|
00004d20  73 6b 20 53 75 69 74 65  20 6f 66 20 64 65 73 6b  |sk Suite of desk|
00004d30  74 6f 70 20 75 74 69 6c  69 74 69 65 73 2e 22 29  |top utilities.")|
00004d40  0d 14 b4 0c 20 20 c9 20  4c 6f 63 3a 0d 14 be 0d  |....  . Loc:....|
00004d50  20 20 20 c8 8e 20 b9 20  ca 0d 14 c8 6d 20 20 20  |   .. . ....m   |
00004d60  20 20 c9 20 28 28 42 6c  6f 63 6b 21 33 36 29 3c  |  . ((Block!36)<|
00004d70  36 29 3a f2 53 65 6e 64  28 22 54 68 69 73 20 77  |6):.Send("This w|
00004d80  69 6e 64 6f 77 20 6c 65  74 73 20 79 6f 75 20 73  |indow lets you s|
00004d90  6e 61 70 20 74 68 65 20  6d 61 67 6e 69 66 69 65  |nap the magnifie|
00004da0  72 20 77 69 6e 64 6f 77  20 74 6f 20 61 6e 20 69  |r window to an i|
00004db0  6e 76 69 73 62 6c 65 20  73 63 72 65 65 6e 20 67  |nvisble screen g|
00004dc0  72 69 64 2e 22 29 0d 14  d2 9d 20 20 20 20 20 20  |rid.")....      |
00004dd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004de0  20 20 20 f2 53 65 6e 64  28 22 54 68 65 20 73 65  |   .Send("The se|
00004df0  63 6f 6e 64 20 70 6f 73  69 74 69 6f 6e 20 75 70  |cond position up|
00004e00  20 70 75 74 73 20 74 68  65 20 77 69 6e 64 6f 77  | puts the window|
00004e10  20 6a 75 73 74 20 61 62  6f 76 65 20 74 68 65 20  | just above the |
00004e20  69 63 6f 6e 2d 62 61 72  2c 20 61 6e 64 20 69 73  |icon-bar, and is|
00004e30  20 74 68 65 72 65 66 6f  72 65 20 6e 6f 74 20 65  | therefore not e|
00004e40  76 65 6e 6c 79 20 73 70  61 63 65 64 20 77 69 74  |venly spaced wit|
00004e50  68 20 74 68 65 20 6f 74  68 65 72 20 72 6f 77 73  |h the other rows|
00004e60  2e 22 29 0d 14 dc 87 20  20 20 20 20 7f 20 f2 53  |.")....     . .S|
00004e70  65 6e 64 28 22 43 6c 69  63 6b 20 53 45 4c 45 43  |end("Click SELEC|
00004e80  54 20 6f 6e 20 74 68 65  20 70 6f 73 69 74 69 6f  |T on the positio|
00004e90  6e 20 79 6f 75 20 77 61  6e 74 20 74 68 65 20 77  |n you want the w|
00004ea0  69 6e 64 6f 77 20 74 6f  20 73 6e 61 70 20 74 6f  |indow to snap to|
00004eb0  2c 20 6f 72 20 41 44 4a  55 53 54 20 6f 6e 20 74  |, or ADJUST on t|
00004ec0  68 65 20 77 69 6e 64 6f  77 20 69 63 6f 6e 20 74  |he window icon t|
00004ed0  6f 20 74 75 72 6e 20 74  68 65 20 73 6e 61 70 70  |o turn the snapp|
00004ee0  69 6e 67 20 6f 66 66 2e  22 29 0d 14 e6 75 20 20  |ing off.")...u  |
00004ef0  20 20 20 20 20 20 20 20  20 20 20 20 20 f2 53 65  |             .Se|
00004f00  6e 64 28 22 49 66 20 73  6e 61 70 70 69 6e 67 20  |nd("If snapping |
00004f10  69 73 20 6f 6e 2c 20 74  68 65 20 77 69 6e 64 6f  |is on, the windo|
00004f20  77 20 77 69 6c 6c 20 6f  70 65 6e 20 61 74 20 74  |w will open at t|
00004f30  68 65 20 61 70 70 72 6f  70 72 69 61 74 65 20 70  |he appropriate p|
00004f40  6f 73 69 74 69 6f 6e 20  77 68 65 6e 20 79 6f 75  |osition when you|
00004f50  20 63 68 61 6e 67 65 20  6d 6f 64 65 2e 22 29 0d  | change mode.").|
00004f60  14 f0 08 20 20 20 cb 0d  14 fa 0c 20 c9 20 53 61  |...   ..... . Sa|
00004f70  76 65 3a 0d 15 04 14 20  20 20 c8 8e 20 42 6c 6f  |ve:....   .. Blo|
00004f80  63 6b 21 33 36 20 ca 0d  15 0e ad 20 20 20 20 20  |ck!36 .....     |
00004f90  c9 20 30 3a f2 53 65 6e  64 28 22 44 72 61 67 20  |. 0:.Send("Drag |
00004fa0  74 68 65 20 66 69 6c 65  20 69 63 6f 6e 20 74 6f  |the file icon to|
00004fb0  20 61 20 66 69 6c 65 72  20 77 69 6e 64 6f 77 20  | a filer window |
00004fc0  6f 72 20 74 6f 20 61 6e  6f 74 68 65 72 20 61 70  |or to another ap|
00004fd0  70 6c 69 63 61 74 69 6f  6e 20 77 68 69 63 68 20  |plication which |
00004fe0  63 61 6e 20 61 63 63 65  70 74 20 74 65 78 74 20  |can accept text |
00004ff0  66 69 6c 65 73 2c 20 6f  72 20 65 6e 74 65 72 20  |files, or enter |
00005000  61 20 66 69 6c 65 6e 61  6d 65 20 61 6e 64 20 63  |a filename and c|
00005010  6c 69 63 6b 20 4f 4b 20  28 6f 72 20 70 72 65 73  |lick OK (or pres|
00005020  73 20 52 45 54 55 52 4e  29 20 74 6f 20 73 61 76  |s RETURN) to sav|
00005030  65 2e 22 29 0d 15 18 6d  20 20 20 20 20 c9 20 31  |e.")...m     . 1|
00005040  3a f2 53 65 6e 64 28 22  44 72 61 67 20 74 68 69  |:.Send("Drag thi|
00005050  73 20 69 63 6f 6e 20 74  6f 20 61 20 66 69 6c 65  |s icon to a file|
00005060  72 20 77 69 6e 64 6f 77  20 6f 72 20 74 6f 20 61  |r window or to a|
00005070  6e 6f 74 68 65 72 20 61  70 70 6c 69 63 61 74 69  |nother applicati|
00005080  6f 6e 20 77 68 69 63 68  20 63 61 6e 20 61 63 63  |on which can acc|
00005090  65 70 74 20 74 65 78 74  20 66 69 6c 65 73 2e 22  |ept text files."|
000050a0  29 0d 15 22 b2 20 20 20  20 20 c9 20 32 3a f2 53  |)..".     . 2:.S|
000050b0  65 6e 64 28 22 45 6e 74  65 72 20 61 20 66 69 6c  |end("Enter a fil|
000050c0  65 6e 61 6d 65 20 68 65  72 65 20 61 6e 64 20 63  |ename here and c|
000050d0  6c 69 63 6b 20 4f 4b 20  28 6f 72 20 70 72 65 73  |lick OK (or pres|
000050e0  73 20 52 45 54 55 52 4e  29 20 74 6f 20 73 61 76  |s RETURN) to sav|
000050f0  65 2c 20 6f 72 20 64 72  61 67 20 74 68 65 20 66  |e, or drag the f|
00005100  69 6c 65 20 69 63 6f 6e  20 74 6f 20 61 20 66 69  |ile icon to a fi|
00005110  6c 65 72 20 77 69 6e 64  6f 77 20 6f 72 20 74 6f  |ler window or to|
00005120  20 61 6e 6f 74 68 65 72  20 61 70 70 6c 69 63 61  | another applica|
00005130  74 69 6f 6e 20 77 68 69  63 68 20 63 61 6e 20 61  |tion which can a|
00005140  63 63 65 70 74 20 74 65  78 74 20 66 69 6c 65 73  |ccept text files|
00005150  2e 22 29 0d 15 2c a1 20  20 20 20 20 c9 20 33 3a  |.")..,.     . 3:|
00005160  f2 53 65 6e 64 28 22 43  6c 69 63 6b 20 4f 4b 20  |.Send("Click OK |
00005170  28 6f 72 20 70 72 65 73  73 20 52 45 54 55 52 4e  |(or press RETURN|
00005180  29 20 74 6f 20 73 61 76  65 20 74 68 65 20 66 69  |) to save the fi|
00005190  6c 65 2c 20 6f 72 20 64  72 61 67 20 74 68 65 20  |le, or drag the |
000051a0  66 69 6c 65 20 69 63 6f  6e 20 74 6f 20 61 20 66  |file icon to a f|
000051b0  69 6c 65 72 20 77 69 6e  64 6f 77 20 6f 72 20 74  |iler window or t|
000051c0  6f 20 61 6e 6f 74 68 65  72 20 61 70 70 6c 69 63  |o another applic|
000051d0  61 74 69 6f 6e 20 77 68  69 63 68 20 63 61 6e 20  |ation which can |
000051e0  61 63 63 65 70 74 20 74  65 78 74 20 66 69 6c 65  |accept text file|
000051f0  73 2e 22 29 0d 15 36 8e  20 20 20 20 20 c9 20 34  |s.")..6.     . 4|
00005200  3a f2 53 65 6e 64 28 22  43 6c 69 63 6b 20 53 45  |:.Send("Click SE|
00005210  4c 45 43 54 20 6f 72 20  41 44 4a 55 53 54 20 74  |LECT or ADJUST t|
00005220  6f 20 74 6f 67 67 6c 65  20 62 65 74 77 65 65 6e  |o toggle between|
00005230  20 73 61 76 69 6e 67 20  64 65 74 61 69 6c 73 20  | saving details |
00005240  6f 66 20 6a 75 73 74 20  74 68 65 20 64 69 73 70  |of just the disp|
00005250  6c 61 79 65 64 20 6d 6f  64 75 6c 65 20 6f 72 20  |layed module or |
00005260  6f 66 20 61 6c 6c 20 63  75 72 72 65 6e 74 6c 79  |of all currently|
00005270  20 6c 6f 61 64 65 64 20  6d 6f 64 75 6c 65 73 2e  | loaded modules.|
00005280  22 29 0d 15 40 2c 20 20  20 20 20 7f 20 f2 53 65  |")..@,     . .Se|
00005290  6e 64 28 22 54 68 69 73  20 69 73 20 74 68 65 20  |nd("This is the |
000052a0  53 61 76 65 20 77 69 6e  64 6f 77 2e 22 29 0d 15  |Save window.")..|
000052b0  4a cf 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |J.              |
000052c0  20 f2 53 65 6e 64 28 22  54 68 65 20 66 69 6c 65  | .Send("The file|
000052d0  20 73 61 76 65 64 20 77  69 6c 6c 20 65 69 74 68  | saved will eith|
000052e0  65 72 20 63 6f 6e 74 61  69 6e 20 64 65 74 61 69  |er contain detai|
000052f0  6c 73 20 6f 66 20 74 68  65 20 53 57 49 20 63 61  |ls of the SWI ca|
00005300  6c 6c 73 20 70 72 6f 76  69 64 65 64 20 62 79 20  |lls provided by |
00005310  74 68 65 20 64 69 73 70  6c 61 79 65 64 20 6d 6f  |the displayed mo|
00005320  64 75 6c 65 20 6f 72 20  62 79 20 61 6c 6c 20 6d  |dule or by all m|
00005330  6f 64 75 6c 65 73 2c 20  64 65 70 65 6e 64 69 6e  |odules, dependin|
00005340  67 20 6f 6e 20 74 68 65  20 73 65 74 74 69 6e 67  |g on the setting|
00005350  20 6f 66 20 74 68 65 20  73 77 69 74 63 68 20 61  | of the switch a|
00005360  74 20 74 68 65 20 62 6f  74 74 6f 6d 20 6f 66 20  |t the bottom of |
00005370  74 68 65 20 77 69 6e 64  6f 77 2e 22 29 0d 15 54  |the window.")..T|
00005380  08 20 20 20 cb 0d 15 5e  05 7f 0d 15 68 13 20 20  |.   ...^....h.  |
00005390  e7 20 77 69 6d 70 3e 3d  32 31 37 20 8c 0d 15 72  |. wimp>=217 ...r|
000053a0  31 20 20 20 20 4d 65 6e  75 48 65 6c 70 21 30 3d  |1    MenuHelp!0=|
000053b0  2d 31 3a 4d 65 6e 75 48  65 6c 70 21 34 3d 2d 31  |-1:MenuHelp!4=-1|
000053c0  3a 4d 65 6e 75 48 65 6c  70 21 38 3d 2d 31 0d 15  |:MenuHelp!8=-1..|
000053d0  7c 3b 20 20 20 20 c8 99  20 22 57 69 6d 70 5f 47  ||;    .. "Wimp_G|
000053e0  65 74 4d 65 6e 75 53 74  61 74 65 22 2c 31 2c 4d  |etMenuState",1,M|
000053f0  65 6e 75 48 65 6c 70 2c  42 6c 6f 63 6b 21 33 32  |enuHelp,Block!32|
00005400  2c 42 6c 6f 63 6b 21 33  36 0d 15 86 0f 20 20 20  |,Block!36....   |
00005410  20 c8 8e 20 4d 25 20 ca  0d 15 90 13 20 20 20 20  | .. M% .....    |
00005420  20 20 c9 20 49 42 4d 65  6e 75 3a 0d 15 9a 1d 20  |  . IBMenu:.... |
00005430  20 20 20 20 20 20 20 e7  20 4d 65 6e 75 48 65 6c  |       . MenuHel|
00005440  70 21 34 3d 2d 31 20 8c  0d 15 a4 1d 20 20 20 20  |p!4=-1 .....    |
00005450  20 20 20 20 20 20 c8 8e  20 4d 65 6e 75 48 65 6c  |      .. MenuHel|
00005460  70 21 30 20 ca 0d 15 ae  57 20 20 20 20 20 20 20  |p!0 ....W       |
00005470  20 20 20 20 20 c9 20 30  3a f2 53 65 6e 64 28 22  |     . 0:.Send("|
00005480  4d 6f 76 65 20 74 68 65  20 70 6f 69 6e 74 65 72  |Move the pointer|
00005490  20 72 69 67 68 74 20 74  6f 20 73 65 65 20 69 6e  | right to see in|
000054a0  66 6f 72 6d 61 74 69 6f  6e 20 61 62 6f 75 74 20  |formation about |
000054b0  53 57 49 20 49 6e 64 65  78 2e 22 29 0d 15 b8 3c  |SWI Index.")...<|
000054c0  20 20 20 20 20 20 20 20  20 20 20 20 c9 20 31 3a  |            . 1:|
000054d0  f2 53 65 6e 64 28 22 43  6c 69 63 6b 20 53 45 4c  |.Send("Click SEL|
000054e0  45 43 54 20 74 6f 20 71  75 69 74 20 53 57 49 20  |ECT to quit SWI |
000054f0  49 6e 64 65 78 2e 22 29  0d 15 c2 3f 20 20 20 20  |Index.")...?    |
00005500  20 20 20 20 20 20 20 20  7f 20 f2 53 65 6e 64 28  |        . .Send(|
00005510  22 54 68 69 73 20 69 73  20 74 68 65 20 53 57 49  |"This is the SWI|
00005520  20 49 6e 64 65 78 20 69  63 6f 6e 2d 62 61 72 20  | Index icon-bar |
00005530  6d 65 6e 75 2e 22 29 0d  15 cc 0f 20 20 20 20 20  |menu.")....     |
00005540  20 20 20 20 20 cb 0d 15  d6 0d 20 20 20 20 20 20  |     .....      |
00005550  20 20 cd 0d 15 e0 15 20  20 20 20 20 20 c9 20 4d  |  .....      . M|
00005560  61 69 6e 4d 65 6e 75 3a  0d 15 ea 57 20 20 20 20  |ainMenu:...W    |
00005570  20 20 20 20 44 69 72 65  63 74 69 6f 6e 24 3d 22  |    Direction$="|
00005580  72 69 67 68 74 22 3a e7  20 77 69 6d 70 3e 3d 33  |right":. wimp>=3|
00005590  31 30 20 80 20 bd 28 4d  61 69 6e 4d 65 6e 75 54  |10 . .(MainMenuT|
000055a0  69 74 6c 65 3f 30 29 3d  22 5c 22 20 8c 20 44 69  |itle?0)="\" . Di|
000055b0  72 65 63 74 69 6f 6e 24  3d 22 6c 65 66 74 22 0d  |rection$="left".|
000055c0  15 f4 1b 20 20 20 20 20  20 20 20 c8 8e 20 4d 65  |...        .. Me|
000055d0  6e 75 48 65 6c 70 21 30  20 ca 0d 15 fe 5e 20 20  |nuHelp!0 ....^  |
000055e0  20 20 20 20 20 20 20 20  c9 20 30 3a f2 53 65 6e  |        . 0:.Sen|
000055f0  64 28 22 4d 6f 76 65 20  74 68 65 20 70 6f 69 6e  |d("Move the poin|
00005600  74 65 72 20 22 2b 44 69  72 65 63 74 69 6f 6e 24  |ter "+Direction$|
00005610  2b 22 20 74 6f 20 73 65  65 20 69 6e 66 6f 72 6d  |+" to see inform|
00005620  61 74 69 6f 6e 20 61 62  6f 75 74 20 53 57 49 20  |ation about SWI |
00005630  49 6e 64 65 78 2e 22 29  0d 16 08 21 20 20 20 20  |Index.")...!    |
00005640  20 20 20 20 20 20 c9 20  31 3a c8 8e 20 4d 65 6e  |      . 1:.. Men|
00005650  75 48 65 6c 70 21 34 20  ca 0d 16 12 83 20 20 20  |uHelp!4 .....   |
00005660  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005670  c9 20 2d 31 3a f2 53 65  6e 64 28 22 54 68 65 20  |. -1:.Send("The |
00005680  6d 6f 64 75 6c 65 20 69  6e 64 65 78 20 6d 65 6e  |module index men|
00005690  75 20 63 6f 6e 74 61 69  6e 73 20 61 20 6c 69 73  |u contains a lis|
000056a0  74 20 6f 66 20 74 68 65  20 63 75 72 72 65 6e 74  |t of the current|
000056b0  6c 79 20 6c 6f 61 64 65  64 20 6d 6f 64 75 6c 65  |ly loaded module|
000056c0  73 20 77 68 69 63 68 20  70 72 6f 76 69 64 65 20  |s which provide |
000056d0  53 57 49 20 63 61 6c 6c  73 2e 22 29 0d 16 1c 59  |SWI calls.")...Y|
000056e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000056f0  20 20 20 c9 20 30 3a f2  53 65 6e 64 28 22 43 6c  |   . 0:.Send("Cl|
00005700  69 63 6b 20 53 45 4c 45  43 54 20 6f 72 20 41 44  |ick SELECT or AD|
00005710  4a 55 53 54 20 74 6f 20  75 70 64 61 74 65 20 74  |JUST to update t|
00005720  68 65 20 6c 69 73 74 20  6f 66 20 6d 6f 64 75 6c  |he list of modul|
00005730  65 73 2e 22 29 0d 16 26  84 20 20 20 20 20 20 20  |es.")..&.       |
00005740  20 20 20 20 20 20 20 20  20 20 20 20 7f 20 f2 53  |            . .S|
00005750  65 6e 64 28 22 43 6c 69  63 6b 20 53 45 4c 45 43  |end("Click SELEC|
00005760  54 20 6f 72 20 41 44 4a  55 53 54 20 74 6f 20 64  |T or ADJUST to d|
00005770  69 73 70 6c 61 79 20 64  65 74 61 69 6c 73 20 6f  |isplay details o|
00005780  66 20 74 68 69 73 20 6d  6f 64 75 6c 65 27 73 20  |f this module's |
00005790  53 57 49 20 63 61 6c 6c  73 20 69 6e 20 74 68 65  |SWI calls in the|
000057a0  20 6d 61 69 6e 20 53 57  49 20 49 6e 64 65 78 20  | main SWI Index |
000057b0  77 69 6e 64 6f 77 2e 22  29 0d 16 30 16 20 20 20  |window.")..0.   |
000057c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 cb 0d  |              ..|
000057d0  16 3a 72 20 20 20 20 20  20 20 20 20 20 c9 20 32  |.:r          . 2|
000057e0  3a f2 53 65 6e 64 28 22  43 68 6f 6f 73 65 20 79  |:.Send("Choose y|
000057f0  6f 75 72 20 65 64 69 74  69 6f 6e 20 6f 66 20 74  |our edition of t|
00005800  68 65 20 50 72 6f 67 72  61 6d 6d 65 72 27 73 20  |he Programmer's |
00005810  52 65 66 65 72 65 6e 63  65 20 4d 61 6e 75 61 6c  |Reference Manual|
00005820  20 66 72 6f 6d 20 74 68  65 20 50 52 4d 20 45 64  | from the PRM Ed|
00005830  69 74 69 6f 6e 20 73 75  62 2d 6d 65 6e 75 2e 22  |ition sub-menu."|
00005840  29 0d 16 44 69 20 20 20  20 20 20 20 20 20 20 20  |)..Di           |
00005850  20 20 20 20 20 20 f2 53  65 6e 64 28 22 54 68 65  |      .Send("The|
00005860  20 70 61 67 65 20 72 65  66 65 72 65 6e 63 65 73  | page references|
00005870  20 69 6e 20 74 68 65 20  53 57 49 20 49 6e 64 65  | in the SWI Inde|
00005880  78 20 77 69 6e 64 6f 77  20 77 69 6c 6c 20 62 65  |x window will be|
00005890  20 75 70 64 61 74 65 64  20 61 73 20 61 70 70 72  | updated as appr|
000058a0  6f 70 72 69 61 74 65 2e  22 29 0d 16 4e 75 20 20  |opriate.")..Nu  |
000058b0  20 20 20 20 20 20 20 20  c9 20 33 3a f2 53 65 6e  |        . 3:.Sen|
000058c0  64 28 22 4d 6f 76 65 20  74 68 65 20 70 6f 69 6e  |d("Move the poin|
000058d0  74 65 72 20 22 2b 44 69  72 65 63 74 69 6f 6e 24  |ter "+Direction$|
000058e0  2b 22 20 74 6f 20 73 65  74 20 74 68 65 20 70 6f  |+" to set the po|
000058f0  73 69 74 69 6f 6e 20 6f  66 20 74 68 65 20 53 57  |sition of the SW|
00005900  49 20 49 6e 64 65 78 20  77 69 6e 64 6f 77 20 6f  |I Index window o|
00005910  6e 20 74 68 65 20 73 63  72 65 65 6e 2e 22 29 0d  |n the screen.").|
00005920  16 58 87 20 20 20 20 20  20 20 20 20 20 c9 20 34  |.X.          . 4|
00005930  3a f2 53 65 6e 64 28 22  4d 6f 76 65 20 74 68 65  |:.Send("Move the|
00005940  20 70 6f 69 6e 74 65 72  20 22 2b 44 69 72 65 63  | pointer "+Direc|
00005950  74 69 6f 6e 24 2b 22 20  74 6f 20 73 61 76 65 20  |tion$+" to save |
00005960  64 65 74 61 69 6c 73 20  6f 66 20 74 68 65 20 53  |details of the S|
00005970  57 49 20 63 61 6c 6c 73  20 70 72 6f 76 69 64 65  |WI calls provide|
00005980  64 20 62 79 20 74 68 69  73 20 6d 6f 64 75 6c 65  |d by this module|
00005990  2c 20 6f 72 20 62 79 20  61 6c 6c 20 6d 6f 64 75  |, or by all modu|
000059a0  6c 65 73 2e 22 29 0d 16  62 75 20 20 20 20 20 20  |les.")..bu      |
000059b0  20 20 20 20 c9 20 35 3a  f2 53 65 6e 64 28 22 43  |    . 5:.Send("C|
000059c0  6c 69 63 6b 20 53 45 4c  45 43 54 20 6f 72 20 41  |lick SELECT or A|
000059d0  44 4a 55 53 54 20 74 6f  20 73 61 76 65 20 74 68  |DJUST to save th|
000059e0  65 20 53 57 49 20 49 6e  64 65 78 20 77 69 6e 64  |e SWI Index wind|
000059f0  6f 77 20 70 6f 73 69 74  69 6f 6e 20 61 6e 64 20  |ow position and |
00005a00  74 68 65 20 73 65 6c 65  63 74 65 64 20 50 52 4d  |the selected PRM|
00005a10  20 65 64 69 74 69 6f 6e  2e 22 29 0d 16 6c 39 20  | edition.")..l9 |
00005a20  20 20 20 20 20 20 20 20  20 7f 20 f2 53 65 6e 64  |         . .Send|
00005a30  28 22 54 68 69 73 20 69  73 20 74 68 65 20 53 57  |("This is the SW|
00005a40  49 20 49 6e 64 65 78 20  6d 61 69 6e 20 6d 65 6e  |I Index main men|
00005a50  75 2e 22 29 0d 16 76 0d  20 20 20 20 20 20 20 20  |u.")..v.        |
00005a60  cb 0d 16 80 09 20 20 20  20 cb 0d 16 8a 07 20 20  |.....    .....  |
00005a70  cd 0d 16 94 05 cb 0d 16  9e 07 20 20 3a 0d 16 a8  |..........  :...|
00005a80  0f 3f 48 65 6c 70 49 6e  66 6f 3d 30 0d 16 b2 24  |.?HelpInfo=0...$|
00005a90  42 6c 6f 63 6b 21 30 3d  28 48 65 6c 70 49 6e 66  |Block!0=(HelpInf|
00005aa0  6f 2b 34 2d 42 6c 6f 63  6b 29 20 80 20 ac 20 33  |o+4-Block) . . 3|
00005ab0  0d 16 bc 2a c8 99 20 22  57 69 6d 70 5f 53 65 6e  |...*.. "Wimp_Sen|
00005ac0  64 4d 65 73 73 61 67 65  22 2c 31 37 2c 42 6c 6f  |dMessage",17,Blo|
00005ad0  63 6b 2c 42 6c 6f 63 6b  21 34 0d 16 c6 05 e1 0d  |ck,Block!4......|
00005ae0  16 d0 05 3a 0d 16 da 1a  dd 20 a4 4f 6d 6e 69 48  |...:..... .OmniH|
00005af0  65 6c 70 4d 65 73 73 61  67 65 28 41 24 29 0d 16  |elpMessage(A$)..|
00005b00  e4 39 e7 20 41 24 3d 22  43 4c 49 43 4b 22 20 8c  |.9. A$="CLICK" .|
00005b10  20 3d c0 22 6f 70 65 6e  20 74 68 65 20 53 57 49  | =."open the SWI|
00005b20  20 49 6e 64 65 78 20 77  69 6e 64 6f 77 2e 22 2c  | Index window.",|
00005b30  37 36 29 2b bd 31 33 0d  16 ee 1e e7 20 41 24 3d  |76)+.13..... A$=|
00005b40  22 44 52 41 47 22 20 8c  20 3d c0 22 22 2c 37 36  |"DRAG" . =."",76|
00005b50  29 2b bd 31 33 0d 16 f8  07 3d 22 22 0d 17 02 05  |)+.13....=""....|
00005b60  3a 0d 17 0c 12 dd 20 f2  53 65 6e 64 28 54 65 78  |:..... .Send(Tex|
00005b70  74 24 29 0d 17 16 18 24  48 65 6c 70 49 6e 66 6f  |t$)....$HelpInfo|
00005b80  3d 54 65 78 74 24 2b 22  7c 4d 22 0d 17 20 18 48  |=Text$+"|M".. .H|
00005b90  65 6c 70 49 6e 66 6f 2b  3d a9 28 54 65 78 74 24  |elpInfo+=.(Text$|
00005ba0  29 2b 32 0d 17 2a 05 e1  0d 17 34 05 3a 0d 17 3e  |)+2..*....4.:..>|
00005bb0  16 dd 20 f2 4f 6d 6e 69  44 65 73 6b 43 61 6c 6c  |.. .OmniDeskCall|
00005bc0  69 6e 67 0d 17 48 14 e7  20 4f 6d 6e 69 44 65 73  |ing..H.. OmniDes|
00005bd0  6b 3d 30 20 8c 20 e1 0d  17 52 49 f4 20 54 68 69  |k=0 . ...RI. Thi|
00005be0  73 20 66 69 72 73 74 20  6c 69 6e 65 20 69 73 20  |s first line is |
00005bf0  66 6f 72 20 69 66 20 61  20 62 72 6f 61 64 63 61  |for if a broadca|
00005c00  73 74 20 6d 65 73 73 61  67 65 20 69 73 20 72 65  |st message is re|
00005c10  63 65 69 76 65 64 20 77  68 69 63 68 20 77 61 73  |ceived which was|
00005c20  0d 17 5c 41 f4 20 69 6e  74 65 6e 64 65 64 20 66  |..\A. intended f|
00005c30  6f 72 20 61 20 74 72 61  6e 73 69 65 6e 74 20 63  |or a transient c|
00005c40  6f 70 79 20 6f 66 20 74  68 65 20 75 74 69 6c 69  |opy of the utili|
00005c50  74 79 2e 20 41 20 73 74  61 6e 64 2d 61 6c 6f 6e  |ty. A stand-alon|
00005c60  65 0d 17 66 3f f4 20 69  6e 73 74 61 6e 74 69 61  |e..f?. instantia|
00005c70  74 69 6f 6e 20 6f 66 20  74 68 65 20 75 74 69 6c  |tion of the util|
00005c80  69 74 79 20 73 68 6f 75  6c 64 20 69 67 6e 6f 72  |ity should ignor|
00005c90  65 20 73 75 63 68 20 6d  65 73 73 61 67 65 73 2e  |e such messages.|
00005ca0  0d 17 70 11 c8 8e 20 42  6c 6f 63 6b 21 32 30 20  |..p... Block!20 |
00005cb0  ca 0d 17 7a 2b 20 20 c9  20 34 3a e7 20 ac 20 53  |...z+  . 4:. . S|
00005cc0  63 61 6e 6e 65 64 4d 6f  64 75 6c 65 73 20 8c 20  |cannedModules . |
00005cd0  f2 53 63 61 6e 4d 6f 64  75 6c 65 73 0d 17 84 37  |.ScanModules...7|
00005ce0  20 20 20 20 20 20 20 20  20 e7 20 49 6e 64 65 78  |         . Index|
00005cf0  3d 2d 31 20 8c 20 49 6e  64 65 78 3d a4 43 72 65  |=-1 . Index=.Cre|
00005d00  61 74 65 49 6e 64 65 78  57 69 6e 64 6f 77 28 30  |ateIndexWindow(0|
00005d10  2c b9 29 0d 17 8e 2f 20  20 20 20 20 20 20 20 20  |,.).../         |
00005d20  f2 4f 70 65 6e 28 49 6e  64 65 78 2c b9 2c 58 50  |.Open(Index,.,XP|
00005d30  6f 73 69 74 69 6f 6e 2c  59 50 6f 73 69 74 69 6f  |osition,YPositio|
00005d40  6e 29 0d 17 98 05 cb 0d  17 a2 05 e1 0d 17 ac 05  |n)..............|
00005d50  3a 0d 17 b6 11 dd 20 f2  4d 6f 64 65 43 68 61 6e  |:..... .ModeChan|
00005d60  67 65 0d 17 c0 12 44 6f  4d 6f 64 65 43 68 61 6e  |ge....DoModeChan|
00005d70  67 65 3d b9 0d 17 ca 3e  e7 20 4f 6d 6e 69 44 65  |ge=....>. OmniDe|
00005d80  73 6b 3d 30 20 8c 20 f2  55 70 64 61 74 65 49 63  |sk=0 . .UpdateIc|
00005d90  6f 6e 46 6f 72 4d 6f 64  65 28 22 21 53 57 49 a0  |onForMode("!SWI.|
00005da0  49 6e 64 65 78 22 2c 2d  32 2c 49 63 6f 6e 42 61  |Index",-2,IconBa|
00005db0  72 29 0d 17 d4 05 e1 0d  17 de 05 3a 0d 17 e8 4f  |r).........:...O|
00005dc0  f4 20 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |. --------------|
00005dd0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00005e00  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 17 f2 38 f4  |-----------...8.|
00005e10  20 47 65 6e 65 72 61 6c  20 6e 6f 6e 2d 73 70 65  | General non-spe|
00005e20  63 69 66 69 63 20 75 73  65 66 75 6c 20 72 6f 75  |cific useful rou|
00005e30  74 69 6e 65 73 20 28 6d  6f 73 74 6c 79 20 77 69  |tines (mostly wi|
00005e40  6d 70 29 0d 17 fc 4f f4  20 2d 2d 2d 2d 2d 2d 2d  |mp)...O. -------|
00005e50  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00005e90  2d 2d 0d 18 06 05 3a 0d  18 10 20 dd 20 f2 55 70  |--....:... . .Up|
00005ea0  64 61 74 65 49 63 6f 6e  28 57 6e 64 77 2c 49 63  |dateIcon(Wndw,Ic|
00005eb0  6e 2c 54 78 74 24 29 0d  18 1a 3a 42 6c 6f 63 6b  |n,Txt$)...:Block|
00005ec0  21 30 3d 57 6e 64 77 3a  42 6c 6f 63 6b 21 34 3d  |!0=Wndw:Block!4=|
00005ed0  49 63 6e 3a c8 99 20 22  57 69 6d 70 5f 47 65 74  |Icn:.. "Wimp_Get|
00005ee0  49 63 6f 6e 53 74 61 74  65 22 2c 2c 42 6c 6f 63  |IconState",,Bloc|
00005ef0  6b 0d 18 24 1c e7 20 a9  28 54 78 74 24 29 3e 28  |k..$.. .(Txt$)>(|
00005f00  42 6c 6f 63 6b 21 33 36  29 2d 31 20 8c 0d 18 2e  |Block!36)-1 ....|
00005f10  26 20 20 e7 20 28 28 42  6c 6f 63 6b 21 32 34 29  |&  . ((Block!24)|
00005f20  20 80 20 28 31 3c 3c 39  29 29 3d 28 31 3c 3c 39  | . (1<<9))=(1<<9|
00005f30  29 20 8c 0d 18 38 19 20  20 20 20 f4 20 52 69 67  |) ...8.    . Rig|
00005f40  68 74 2d 6a 75 73 74 69  66 69 65 64 0d 18 42 24  |ht-justified..B$|
00005f50  20 20 20 20 54 78 74 24  3d 22 88 22 2b c2 54 78  |    Txt$="."+.Tx|
00005f60  74 24 2c 28 42 6c 6f 63  6b 21 33 36 29 2d 32 29  |t$,(Block!36)-2)|
00005f70  0d 18 4c 07 20 20 cc 0d  18 56 23 20 20 20 20 f4  |..L.  ...V#    .|
00005f80  20 4c 65 66 74 2d 6a 75  73 74 69 66 69 65 64 20  | Left-justified |
00005f90  6f 72 20 63 65 6e 74 72  65 64 0d 18 60 2b 20 20  |or centred..`+  |
00005fa0  20 20 54 78 74 24 3d c0  54 78 74 24 2c 28 42 6c  |  Txt$=.Txt$,(Bl|
00005fb0  6f 63 6b 21 33 36 29 2d  31 29 3a c2 54 78 74 24  |ock!36)-1):.Txt$|
00005fc0  29 3d 22 89 22 0d 18 6a  07 20 20 cd 0d 18 74 05  |)="."..j.  ...t.|
00005fd0  cd 0d 18 7e 46 f4 20 5e  20 45 6e 73 75 72 65 73  |...~F. ^ Ensures|
00005fe0  20 74 68 65 20 74 65 78  74 20 63 61 6e 27 74 20  | the text can't |
00005ff0  6f 76 65 72 66 6c 6f 77  20 74 68 65 20 6d 61 78  |overflow the max|
00006000  69 6d 75 6d 20 73 70 61  63 65 20 69 6e 20 74 68  |imum space in th|
00006010  65 20 69 63 6f 6e 2e 0d  18 88 19 e7 20 24 28 42  |e icon...... $(B|
00006020  6c 6f 63 6b 21 32 38 29  3c 3e 54 78 74 24 20 8c  |lock!28)<>Txt$ .|
00006030  0d 18 92 2b 20 20 24 28  42 6c 6f 63 6b 21 32 38  |...+  $(Block!28|
00006040  29 3d 54 78 74 24 3a 42  6c 6f 63 6b 21 38 3d 30  |)=Txt$:Block!8=0|
00006050  3a 42 6c 6f 63 6b 21 31  32 3d 30 0d 18 9c 23 20  |:Block!12=0...# |
00006060  20 c8 99 20 22 57 69 6d  70 5f 53 65 74 49 63 6f  | .. "Wimp_SetIco|
00006070  6e 53 74 61 74 65 22 2c  2c 42 6c 6f 63 6b 0d 18  |nState",,Block..|
00006080  a6 05 cd 0d 18 b0 25 c8  99 20 22 57 69 6d 70 5f  |......%.. "Wimp_|
00006090  47 65 74 43 61 72 65 74  50 6f 73 69 74 69 6f 6e  |GetCaretPosition|
000060a0  22 2c 2c 42 6c 6f 63 6b  0d 18 ba 22 e7 20 42 6c  |",,Block...". Bl|
000060b0  6f 63 6b 21 30 3d 57 6e  64 77 20 80 20 42 6c 6f  |ock!0=Wndw . Blo|
000060c0  63 6b 21 34 3d 49 63 6e  20 8c 0d 18 c4 3c 20 20  |ck!4=Icn ....<  |
000060d0  f4 20 49 66 20 74 68 69  73 20 69 63 6f 6e 20 6f  |. If this icon o|
000060e0  77 6e 73 20 74 68 65 20  63 61 72 65 74 2c 20 74  |wns the caret, t|
000060f0  68 65 6e 20 70 75 74 20  69 74 20 61 74 20 74 68  |hen put it at th|
00006100  65 20 65 6e 64 2e 0d 18  ce 38 20 20 c8 99 20 22  |e end....8  .. "|
00006110  57 69 6d 70 5f 53 65 74  43 61 72 65 74 50 6f 73  |Wimp_SetCaretPos|
00006120  69 74 69 6f 6e 22 2c 57  6e 64 77 2c 49 63 6e 2c  |ition",Wndw,Icn,|
00006130  30 2c 30 2c 2d 31 2c a9  28 54 78 74 24 29 0d 18  |0,0,-1,.(Txt$)..|
00006140  d8 05 cd 0d 18 e2 05 e1  0d 18 ec 05 3a 0d 18 f6  |............:...|
00006150  2b dd 20 f2 55 70 64 61  74 65 49 63 6f 6e 43 6f  |+. .UpdateIconCo|
00006160  6c 6f 75 72 28 57 6e 64  77 2c 49 63 6e 2c 46 43  |lour(Wndw,Icn,FC|
00006170  6f 6c 2c 42 43 6f 6c 29  0d 19 00 1e f4 20 43 68  |ol,BCol)..... Ch|
00006180  61 6e 67 65 20 61 6e 20  69 63 6f 6e 27 73 20 63  |ange an icon's c|
00006190  6f 6c 6f 75 72 73 0d 19  0a 3a 42 6c 6f 63 6b 21  |olours...:Block!|
000061a0  30 3d 57 6e 64 77 3a 42  6c 6f 63 6b 21 34 3d 49  |0=Wndw:Block!4=I|
000061b0  63 6e 3a c8 99 20 22 57  69 6d 70 5f 47 65 74 49  |cn:.. "Wimp_GetI|
000061c0  63 6f 6e 53 74 61 74 65  22 2c 2c 42 6c 6f 63 6b  |conState",,Block|
000061d0  0d 19 14 3b e7 20 28 28  28 42 6c 6f 63 6b 3f 32  |...;. (((Block?2|
000061e0  37 29 3e 3e 34 29 3d 42  43 6f 6c 29 20 80 20 28  |7)>>4)=BCol) . (|
000061f0  28 28 42 6c 6f 63 6b 3f  32 37 29 20 83 20 31 36  |((Block?27) . 16|
00006200  29 3d 46 43 6f 6c 29 20  8c 20 e1 0d 19 1e 27 20  |)=FCol) . ....' |
00006210  20 f4 20 5e 20 53 61 6d  65 20 63 6f 6c 6f 75 72  | . ^ Same colour|
00006220  2c 20 73 6f 20 64 6f 6e  27 74 20 63 68 61 6e 67  |, so don't chang|
00006230  65 2e 0d 19 28 3a 42 6c  6f 63 6b 21 31 32 3d 28  |e...(:Block!12=(|
00006240  25 31 31 31 31 31 31 31  31 3c 3c 32 34 29 3a 42  |%11111111<<24):B|
00006250  6c 6f 63 6b 21 38 3d 28  42 43 6f 6c 3c 3c 32 38  |lock!8=(BCol<<28|
00006260  29 2b 28 46 43 6f 6c 3c  3c 32 34 29 0d 19 32 21  |)+(FCol<<24)..2!|
00006270  c8 99 20 22 57 69 6d 70  5f 53 65 74 49 63 6f 6e  |.. "Wimp_SetIcon|
00006280  53 74 61 74 65 22 2c 2c  42 6c 6f 63 6b 0d 19 3c  |State",,Block..<|
00006290  05 e1 0d 19 46 05 3a 0d  19 50 29 dd 20 f2 55 70  |....F.:..P). .Up|
000062a0  64 61 74 65 53 65 6c 65  63 74 65 64 46 6c 61 67  |dateSelectedFlag|
000062b0  28 57 6e 64 77 2c 49 63  6e 2c 53 74 61 74 65 29  |(Wndw,Icn,State)|
000062c0  0d 19 5a 31 f4 20 55 73  65 20 53 74 61 74 65 3d  |..Z1. Use State=|
000062d0  54 52 55 45 20 74 6f 20  6d 61 6b 65 20 69 63 6f  |TRUE to make ico|
000062e0  6e 20 62 65 63 6f 6d 65  20 73 65 6c 65 63 74 65  |n become selecte|
000062f0  64 0d 19 64 3a 42 6c 6f  63 6b 21 30 3d 57 6e 64  |d..d:Block!0=Wnd|
00006300  77 3a 42 6c 6f 63 6b 21  34 3d 49 63 6e 3a c8 99  |w:Block!4=Icn:..|
00006310  20 22 57 69 6d 70 5f 47  65 74 49 63 6f 6e 53 74  | "Wimp_GetIconSt|
00006320  61 74 65 22 2c 2c 42 6c  6f 63 6b 0d 19 6e 2f e7  |ate",,Block..n/.|
00006330  20 28 28 42 6c 6f 63 6b  21 32 34 29 20 80 20 28  | ((Block!24) . (|
00006340  31 3c 3c 32 31 29 29 3d  28 28 2d 53 74 61 74 65  |1<<21))=((-State|
00006350  29 3c 3c 32 31 29 20 8c  20 e1 0d 19 78 40 42 6c  |)<<21) . ...x@Bl|
00006360  6f 63 6b 21 31 32 3d 28  31 3c 3c 32 31 29 3a e7  |ock!12=(1<<21):.|
00006370  20 53 74 61 74 65 20 8c  20 42 6c 6f 63 6b 21 38  | State . Block!8|
00006380  3d 28 31 3c 3c 32 31 29  20 8b 20 42 6c 6f 63 6b  |=(1<<21) . Block|
00006390  21 38 3d 28 30 3c 3c 32  31 29 0d 19 82 21 c8 99  |!8=(0<<21)...!..|
000063a0  20 22 57 69 6d 70 5f 53  65 74 49 63 6f 6e 53 74  | "Wimp_SetIconSt|
000063b0  61 74 65 22 2c 2c 42 6c  6f 63 6b 0d 19 8c 05 e1  |ate",,Block.....|
000063c0  0d 19 96 05 3a 0d 19 a0  27 dd 20 f2 55 70 64 61  |....:...'. .Upda|
000063d0  74 65 53 68 61 64 65 64  46 6c 61 67 28 57 6e 64  |teShadedFlag(Wnd|
000063e0  77 2c 49 63 6e 2c 53 74  61 74 65 29 0d 19 aa 2f  |w,Icn,State).../|
000063f0  f4 20 55 73 65 20 53 74  61 74 65 3d 54 52 55 45  |. Use State=TRUE|
00006400  20 74 6f 20 6d 61 6b 65  20 69 63 6f 6e 20 62 65  | to make icon be|
00006410  63 6f 6d 65 20 73 68 61  64 65 64 0d 19 b4 3a 42  |come shaded...:B|
00006420  6c 6f 63 6b 21 30 3d 57  6e 64 77 3a 42 6c 6f 63  |lock!0=Wndw:Bloc|
00006430  6b 21 34 3d 49 63 6e 3a  c8 99 20 22 57 69 6d 70  |k!4=Icn:.. "Wimp|
00006440  5f 47 65 74 49 63 6f 6e  53 74 61 74 65 22 2c 2c  |_GetIconState",,|
00006450  42 6c 6f 63 6b 0d 19 be  2f e7 20 28 28 42 6c 6f  |Block.../. ((Blo|
00006460  63 6b 21 32 34 29 20 80  20 28 31 3c 3c 32 32 29  |ck!24) . (1<<22)|
00006470  29 3d 28 28 2d 53 74 61  74 65 29 3c 3c 32 32 29  |)=((-State)<<22)|
00006480  20 8c 20 e1 0d 19 c8 40  42 6c 6f 63 6b 21 31 32  | . ....@Block!12|
00006490  3d 28 31 3c 3c 32 32 29  3a e7 20 53 74 61 74 65  |=(1<<22):. State|
000064a0  20 8c 20 42 6c 6f 63 6b  21 38 3d 28 31 3c 3c 32  | . Block!8=(1<<2|
000064b0  32 29 20 8b 20 42 6c 6f  63 6b 21 38 3d 28 30 3c  |2) . Block!8=(0<|
000064c0  3c 32 32 29 0d 19 d2 21  c8 99 20 22 57 69 6d 70  |<22)...!.. "Wimp|
000064d0  5f 53 65 74 49 63 6f 6e  53 74 61 74 65 22 2c 2c  |_SetIconState",,|
000064e0  42 6c 6f 63 6b 0d 19 dc  05 e1 0d 19 e6 05 3a 0d  |Block.........:.|
000064f0  19 f0 1e dd 20 a4 53 65  6c 65 63 74 65 64 53 74  |.... .SelectedSt|
00006500  61 74 65 28 57 6e 64 77  2c 49 63 6e 29 0d 19 fa  |ate(Wndw,Icn)...|
00006510  3a 42 6c 6f 63 6b 21 30  3d 57 6e 64 77 3a 42 6c  |:Block!0=Wndw:Bl|
00006520  6f 63 6b 21 34 3d 49 63  6e 3a c8 99 20 22 57 69  |ock!4=Icn:.. "Wi|
00006530  6d 70 5f 47 65 74 49 63  6f 6e 53 74 61 74 65 22  |mp_GetIconState"|
00006540  2c 2c 42 6c 6f 63 6b 0d  1a 04 29 e7 20 28 28 42  |,,Block...). ((B|
00006550  6c 6f 63 6b 21 32 34 29  20 80 20 28 31 3c 3c 32  |lock!24) . (1<<2|
00006560  31 29 29 3d 28 31 3c 3c  32 31 29 20 8c 20 3d b9  |1))=(1<<21) . =.|
00006570  0d 1a 0e 06 3d a3 0d 1a  18 05 3a 0d 1a 22 1c dd  |....=.....:.."..|
00006580  20 a4 53 68 61 64 65 64  53 74 61 74 65 28 57 6e  | .ShadedState(Wn|
00006590  64 77 2c 49 63 6e 29 0d  1a 2c 3a 42 6c 6f 63 6b  |dw,Icn)..,:Block|
000065a0  21 30 3d 57 6e 64 77 3a  42 6c 6f 63 6b 21 34 3d  |!0=Wndw:Block!4=|
000065b0  49 63 6e 3a c8 99 20 22  57 69 6d 70 5f 47 65 74  |Icn:.. "Wimp_Get|
000065c0  49 63 6f 6e 53 74 61 74  65 22 2c 2c 42 6c 6f 63  |IconState",,Bloc|
000065d0  6b 0d 1a 36 29 e7 20 28  28 42 6c 6f 63 6b 21 32  |k..6). ((Block!2|
000065e0  34 29 20 80 20 28 31 3c  3c 32 32 29 29 3d 28 31  |4) . (1<<22))=(1|
000065f0  3c 3c 32 32 29 20 8c 20  3d b9 0d 1a 40 06 3d a3  |<<22) . =...@.=.|
00006600  0d 1a 4a 05 3a 0d 1a 54  16 dd 20 a4 4f 70 65 6e  |..J.:..T.. .Open|
00006610  53 74 61 74 65 28 57 6e  64 77 29 0d 1a 5e 35 f4  |State(Wndw)..^5.|
00006620  20 52 65 74 75 72 6e 73  20 54 52 55 45 20 69 66  | Returns TRUE if|
00006630  20 77 69 6e 64 6f 77 20  69 73 20 6f 70 65 6e 3b  | window is open;|
00006640  20 66 61 6c 73 65 20 6f  74 68 65 72 77 69 73 65  | false otherwise|
00006650  0d 1a 68 30 42 6c 6f 63  6b 21 30 3d 57 6e 64 77  |..h0Block!0=Wndw|
00006660  3a c8 99 20 22 57 69 6d  70 5f 47 65 74 57 69 6e  |:.. "Wimp_GetWin|
00006670  64 6f 77 53 74 61 74 65  22 2c 2c 42 6c 6f 63 6b  |dowState",,Block|
00006680  0d 1a 72 29 e7 20 28 28  42 6c 6f 63 6b 21 33 32  |..r). ((Block!32|
00006690  29 20 80 20 28 31 3c 3c  31 36 29 29 3d 28 31 3c  |) . (1<<16))=(1<|
000066a0  3c 31 36 29 20 8c 20 3d  b9 0d 1a 7c 06 3d a3 0d  |<16) . =...|.=..|
000066b0  1a 86 05 3a 0d 1a 90 21  dd 20 f2 53 68 61 64 65  |...:...!. .Shade|
000066c0  4d 65 6e 75 28 4d 65 6e  75 2c 49 74 65 6d 2c 53  |Menu(Menu,Item,S|
000066d0  74 61 74 65 29 0d 1a 9a  50 21 28 4d 65 6e 75 2b  |tate)...P!(Menu+|
000066e0  32 38 2b 28 32 34 2a 49  74 65 6d 29 2b 38 29 3d  |28+(24*Item)+8)=|
000066f0  28 21 28 4d 65 6e 75 2b  32 38 2b 28 32 34 2a 49  |(!(Menu+28+(24*I|
00006700  74 65 6d 29 2b 38 29 20  80 20 ac 20 28 31 3c 3c  |tem)+8) . . (1<<|
00006710  32 32 29 29 20 82 20 28  28 2d 53 74 61 74 65 29  |22)) . ((-State)|
00006720  3c 3c 32 32 29 0d 1a a4  05 e1 0d 1a ae 05 3a 0d  |<<22).........:.|
00006730  1a b8 20 dd 20 f2 54 69  63 6b 4d 65 6e 75 28 4d  |.. . .TickMenu(M|
00006740  65 6e 75 2c 49 74 65 6d  2c 53 74 61 74 65 29 0d  |enu,Item,State).|
00006750  1a c2 40 21 28 4d 65 6e  75 2b 32 38 2b 28 32 34  |..@!(Menu+28+(24|
00006760  2a 49 74 65 6d 29 29 3d  28 21 28 4d 65 6e 75 2b  |*Item))=(!(Menu+|
00006770  32 38 2b 28 32 34 2a 49  74 65 6d 29 29 20 80 20  |28+(24*Item)) . |
00006780  ac 20 31 29 20 82 20 28  2d 53 74 61 74 65 29 0d  |. 1) . (-State).|
00006790  1a cc 05 e1 0d 1a d6 05  3a 0d 1a e0 1c dd 20 a4  |........:..... .|
000067a0  4d 65 6e 75 53 68 61 64  65 64 28 4d 65 6e 75 2c  |MenuShaded(Menu,|
000067b0  49 74 65 6d 29 0d 1a ea  35 e7 20 28 21 28 4d 65  |Item)...5. (!(Me|
000067c0  6e 75 2b 32 38 2b 28 32  34 2a 49 74 65 6d 29 2b  |nu+28+(24*Item)+|
000067d0  38 29 20 80 20 28 31 3c  3c 32 32 29 29 3d 28 31  |8) . (1<<22))=(1|
000067e0  3c 3c 32 32 29 20 8c 20  3d b9 0d 1a f4 06 3d a3  |<<22) . =.....=.|
000067f0  0d 1a fe 05 3a 0d 1b 08  1c dd 20 a4 4d 65 6e 75  |....:..... .Menu|
00006800  54 69 63 6b 65 64 28 4d  65 6e 75 2c 49 74 65 6d  |Ticked(Menu,Item|
00006810  29 0d 1b 12 27 e7 20 28  21 28 4d 65 6e 75 2b 32  |)...'. (!(Menu+2|
00006820  38 2b 28 32 34 2a 49 74  65 6d 29 29 20 80 20 31  |8+(24*Item)) . 1|
00006830  29 3d 31 20 8c 20 3d b9  0d 1b 1c 06 3d a3 0d 1b  |)=1 . =.....=...|
00006840  26 05 3a 0d 1b 30 19 dd  20 a4 52 65 61 64 49 63  |&.:..0.. .ReadIc|
00006850  6f 6e 28 57 6e 64 77 2c  49 63 6e 29 0d 1b 3a 20  |on(Wndw,Icn)..: |
00006860  f4 20 52 65 61 64 20 6e  75 6d 65 72 69 63 20 76  |. Read numeric v|
00006870  61 6c 75 65 20 6f 66 20  69 63 6f 6e 0d 1b 44 3a  |alue of icon..D:|
00006880  42 6c 6f 63 6b 21 30 3d  57 6e 64 77 3a 42 6c 6f  |Block!0=Wndw:Blo|
00006890  63 6b 21 34 3d 49 63 6e  3a c8 99 20 22 57 69 6d  |ck!4=Icn:.. "Wim|
000068a0  70 5f 47 65 74 49 63 6f  6e 53 74 61 74 65 22 2c  |p_GetIconState",|
000068b0  2c 42 6c 6f 63 6b 0d 1b  4e 13 3d bb 28 24 28 42  |,Block..N.=.($(B|
000068c0  6c 6f 63 6b 21 32 38 29  29 0d 1b 58 05 3a 0d 1b  |lock!28))..X.:..|
000068d0  62 1c dd 20 a4 52 65 61  64 49 63 6f 6e 53 74 72  |b.. .ReadIconStr|
000068e0  28 57 6e 64 77 2c 49 63  6e 29 0d 1b 6c 1f f4 20  |(Wndw,Icn)..l.. |
000068f0  52 65 61 64 20 73 74 72  69 6e 67 20 76 61 6c 75  |Read string valu|
00006900  65 20 6f 66 20 69 63 6f  6e 0d 1b 76 3a 42 6c 6f  |e of icon..v:Blo|
00006910  63 6b 21 30 3d 57 6e 64  77 3a 42 6c 6f 63 6b 21  |ck!0=Wndw:Block!|
00006920  34 3d 49 63 6e 3a c8 99  20 22 57 69 6d 70 5f 47  |4=Icn:.. "Wimp_G|
00006930  65 74 49 63 6f 6e 53 74  61 74 65 22 2c 2c 42 6c  |etIconState",,Bl|
00006940  6f 63 6b 0d 1b 80 10 3d  24 28 42 6c 6f 63 6b 21  |ock....=$(Block!|
00006950  32 38 29 0d 1b 8a 05 3a  0d 1b 94 1a dd 20 a4 4d  |28)....:..... .M|
00006960  6f 64 65 49 6e 66 6f 28  76 61 72 24 2c 6d 6f 64  |odeInfo(var$,mod|
00006970  65 29 0d 1b 9e 29 f4 20  55 73 65 20 6d 6f 64 65  |e)...). Use mode|
00006980  3d 2d 31 20 66 6f 72 20  63 75 72 72 65 6e 74 20  |=-1 for current |
00006990  73 63 72 65 65 6e 20 6d  6f 64 65 0d 1b a8 0d c8  |screen mode.....|
000069a0  8e 20 76 61 72 24 20 ca  0d 1b b2 3a 20 20 c9 20  |. var$ ....:  . |
000069b0  22 58 50 69 78 65 6c 73  22 3a c8 99 20 22 4f 53  |"XPixels":.. "OS|
000069c0  5f 52 65 61 64 4d 6f 64  65 56 61 72 69 61 62 6c  |_ReadModeVariabl|
000069d0  65 22 2c 6d 6f 64 65 2c  31 31 20 b8 20 2c 2c 76  |e",mode,11 . ,,v|
000069e0  61 72 0d 1b bc 3a 20 20  c9 20 22 59 50 69 78 65  |ar...:  . "YPixe|
000069f0  6c 73 22 3a c8 99 20 22  4f 53 5f 52 65 61 64 4d  |ls":.. "OS_ReadM|
00006a00  6f 64 65 56 61 72 69 61  62 6c 65 22 2c 6d 6f 64  |odeVariable",mod|
00006a10  65 2c 31 32 20 b8 20 2c  2c 76 61 72 0d 1b c6 36  |e,12 . ,,var...6|
00006a20  20 20 c9 20 22 4e 43 6f  6c 22 3a c8 99 20 22 4f  |  . "NCol":.. "O|
00006a30  53 5f 52 65 61 64 4d 6f  64 65 56 61 72 69 61 62  |S_ReadModeVariab|
00006a40  6c 65 22 2c 6d 6f 64 65  2c 33 20 b8 20 2c 2c 76  |le",mode,3 . ,,v|
00006a50  61 72 0d 1b d0 3c 20 20  c9 20 22 58 45 69 67 46  |ar...<  . "XEigF|
00006a60  61 63 74 6f 72 22 3a c8  99 20 22 4f 53 5f 52 65  |actor":.. "OS_Re|
00006a70  61 64 4d 6f 64 65 56 61  72 69 61 62 6c 65 22 2c  |adModeVariable",|
00006a80  6d 6f 64 65 2c 34 20 b8  20 2c 2c 76 61 72 0d 1b  |mode,4 . ,,var..|
00006a90  da 3c 20 20 c9 20 22 59  45 69 67 46 61 63 74 6f  |.<  . "YEigFacto|
00006aa0  72 22 3a c8 99 20 22 4f  53 5f 52 65 61 64 4d 6f  |r":.. "OS_ReadMo|
00006ab0  64 65 56 61 72 69 61 62  6c 65 22 2c 6d 6f 64 65  |deVariable",mode|
00006ac0  2c 35 20 b8 20 2c 2c 76  61 72 0d 1b e4 3f 20 20  |,5 . ,,var...?  |
00006ad0  c9 20 22 42 50 50 22 3a  c8 99 20 22 4f 53 5f 52  |. "BPP":.. "OS_R|
00006ae0  65 61 64 4d 6f 64 65 56  61 72 69 61 62 6c 65 22  |eadModeVariable"|
00006af0  2c 6d 6f 64 65 2c 39 20  b8 20 2c 2c 76 61 72 3a  |,mode,9 . ,,var:|
00006b00  76 61 72 3d 32 5e 76 61  72 0d 1b ee 36 20 20 7f  |var=2^var...6  .|
00006b10  20 76 61 72 3d 2d 31 3a  f4 20 46 61 6c 6c 2d 74  | var=-1:. Fall-t|
00006b20  68 72 6f 75 67 68 20 66  6f 72 20 61 20 66 61 75  |hrough for a fau|
00006b30  6c 74 79 20 69 6e 70 75  74 20 76 61 6c 75 65 0d  |lty input value.|
00006b40  1b f8 05 cb 0d 1c 02 08  3d 76 61 72 0d 1c 0c 05  |........=var....|
00006b50  3a 0d 1c 16 2b dd 20 f2  55 70 64 61 74 65 49 63  |:...+. .UpdateIc|
00006b60  6f 6e 46 6f 72 4d 6f 64  65 28 41 70 70 6e 61 6d  |onForMode(Appnam|
00006b70  65 24 2c 57 6e 64 77 2c  49 63 6e 29 0d 1c 20 4e  |e$,Wndw,Icn).. N|
00006b80  f4 20 54 68 69 73 20 70  72 6f 63 65 64 75 72 65  |. This procedure|
00006b90  20 72 65 71 75 69 72 65  73 20 74 68 61 74 20 41  | requires that A|
00006ba0  4c 4c 20 74 68 65 20 69  63 6f 6e 20 73 70 72 69  |LL the icon spri|
00006bb0  74 65 73 20 61 72 65 20  64 65 66 69 6e 65 64 20  |tes are defined |
00006bc0  69 6e 20 6d 6f 64 65 20  32 30 0d 1c 2a 4e f4 20  |in mode 20..*N. |
00006bd0  6f 72 20 6d 6f 64 65 20  32 37 20 28 77 68 69 63  |or mode 27 (whic|
00006be0  68 20 69 73 20 65 71 75  69 76 61 6c 65 6e 74 29  |h is equivalent)|
00006bf0  20 77 69 74 68 20 61 20  6d 61 73 6b 20 62 75 74  | with a mask but|
00006c00  20 6e 6f 20 70 61 6c 65  74 74 65 2e 20 54 68 65  | no palette. The|
00006c10  79 20 73 68 6f 75 6c 64  0d 1c 34 4e f4 20 73 74  |y should..4N. st|
00006c20  69 6c 6c 20 61 70 70 65  61 72 20 74 6f 20 68 61  |ill appear to ha|
00006c30  76 65 20 74 68 65 20 65  78 70 65 63 74 65 64 20  |ve the expected |
00006c40  72 65 73 6f 6c 75 74 69  6f 6e 73 20 61 6e 64 20  |resolutions and |
00006c50  6e 75 6d 62 65 72 20 6f  66 20 63 6f 6c 6f 75 72  |number of colour|
00006c60  73 2c 20 69 2e 65 0d 1c  3e 4e f4 20 21 53 70 72  |s, i.e..>N. !Spr|
00006c70  69 74 65 73 32 33 3a 20  74 77 6f 20 63 6f 6c 6f  |ites23: two colo|
00006c80  75 72 73 2c 20 68 69 67  68 20 72 65 73 6f 6c 75  |urs, high resolu|
00006c90  74 69 6f 6e 2c 20 21 53  70 72 69 74 65 73 20 28  |tion, !Sprites (|
00006ca0  61 63 74 75 61 6c 6c 79  20 21 53 70 72 69 74 65  |actually !Sprite|
00006cb0  73 32 34 29 0d 1c 48 4c  f4 20 61 74 20 6d 6f 64  |s24)..HL. at mod|
00006cc0  65 20 31 32 20 72 65 73  6f 6c 75 74 69 6f 6e 20  |e 12 resolution |
00006cd0  28 64 6f 75 62 6c 65 20  68 65 69 67 68 74 20 70  |(double height p|
00006ce0  69 78 65 6c 73 29 20 69  6e 20 31 36 20 63 6f 6c  |ixels) in 16 col|
00006cf0  6f 75 72 73 2c 20 61 6e  64 20 6e 6f 72 6d 61 6c  |ours, and normal|
00006d00  0d 1c 52 4c f4 20 6d 6f  64 65 20 32 30 20 72 65  |..RL. mode 20 re|
00006d10  73 6f 6c 75 74 69 6f 6e  2c 20 31 36 20 63 6f 6c  |solution, 16 col|
00006d20  6f 75 72 73 20 66 6f 72  20 74 68 65 20 21 53 70  |ours for the !Sp|
00006d30  72 69 74 65 73 32 32 20  69 63 6f 6e 2e 20 49 66  |rites22 icon. If|
00006d40  20 74 68 69 73 20 69 73  20 6e 6f 74 0d 1c 5c 49  | this is not..\I|
00006d50  f4 20 61 64 68 65 72 65  64 20 74 6f 2c 20 74 68  |. adhered to, th|
00006d60  65 6e 20 6d 65 6d 6f 72  79 20 73 68 6f 72 74 61  |en memory shorta|
00006d70  67 65 20 65 72 72 6f 72  73 20 6d 61 79 20 6f 63  |ge errors may oc|
00006d80  63 75 72 20 6f 6e 20 61  20 6d 6f 64 65 20 63 68  |cur on a mode ch|
00006d90  61 6e 67 65 2e 0d 1c 66  13 45 78 74 65 6e 73 69  |ange...f.Extensi|
00006da0  6f 6e 24 3d 22 32 34 22  0d 1c 70 24 e7 20 a4 4d  |on$="24"..p$. .M|
00006db0  6f 64 65 49 6e 66 6f 28  22 59 45 69 67 46 61 63  |odeInfo("YEigFac|
00006dc0  74 6f 72 22 2c 2d 31 29  3c 32 20 8c 0d 1c 7a 20  |tor",-1)<2 ...z |
00006dd0  20 20 e7 20 a4 4d 6f 64  65 49 6e 66 6f 28 22 4e  |  . .ModeInfo("N|
00006de0  43 6f 6c 22 2c 2d 31 29  3e 32 20 8c 0d 1c 84 17  |Col",-1)>2 .....|
00006df0  20 20 20 20 45 78 74 65  6e 73 69 6f 6e 24 3d 22  |    Extension$="|
00006e00  32 32 22 0d 1c 8e 07 20  20 cc 0d 1c 98 17 20 20  |22"....  .....  |
00006e10  20 20 45 78 74 65 6e 73  69 6f 6e 24 3d 22 32 33  |  Extension$="23|
00006e20  22 0d 1c a2 07 20 20 cd  0d 1c ac 05 cd 0d 1c b6  |"....  .........|
00006e30  2a c8 99 20 22 57 69 6d  70 5f 42 61 73 65 4f 66  |*.. "Wimp_BaseOf|
00006e40  53 70 72 69 74 65 73 22  20 b8 20 2c 69 63 6f 6e  |Sprites" . ,icon|
00006e50  73 70 72 69 74 65 25 0d  1c c0 45 c8 99 20 22 4f  |sprite%...E.. "O|
00006e60  53 5f 53 70 72 69 74 65  4f 70 22 2c 32 35 36 2b  |S_SpriteOp",256+|
00006e70  32 35 2c 69 63 6f 6e 73  70 72 69 74 65 25 2c 41  |25,iconsprite%,A|
00006e80  70 70 6e 61 6d 65 24 3a  f4 20 44 65 6c 65 74 65  |ppname$:. Delete|
00006e90  20 69 63 6f 6e 20 73 70  72 69 74 65 0d 1c ca 3d  | icon sprite...=|
00006ea0  f4 20 54 68 65 20 66 6f  6c 6c 6f 77 69 6e 67 20  |. The following |
00006eb0  74 68 72 65 65 20 6c 69  6e 65 73 20 61 73 73 75  |three lines assu|
00006ec0  6d 65 20 61 20 6d 61 73  6b 20 62 75 74 20 6e 6f  |me a mask but no|
00006ed0  20 70 61 6c 65 74 74 65  3a 0d 1c d4 62 c8 99 20  | palette:...b.. |
00006ee0  22 4f 53 5f 53 70 72 69  74 65 4f 70 22 2c 32 35  |"OS_SpriteOp",25|
00006ef0  36 2b 34 30 2c 53 70 72  69 74 65 73 2c 41 70 70  |6+40,Sprites,App|
00006f00  6e 61 6d 65 24 2b 45 78  74 65 6e 73 69 6f 6e 24  |name$+Extension$|
00006f10  20 b8 20 2c 2c 2c 77 2c  68 2c 2c 6d 6f 64 65 3a  | . ,,,w,h,,mode:|
00006f20  f4 20 47 65 74 20 69 6e  66 6f 20 61 62 6f 75 74  |. Get info about|
00006f30  20 6e 65 77 20 73 70 72  69 74 65 0d 1c de 5c c8  | new sprite...\.|
00006f40  99 20 22 4f 53 5f 53 70  72 69 74 65 4f 70 22 2c  |. "OS_SpriteOp",|
00006f50  32 35 36 2b 31 35 2c 69  63 6f 6e 73 70 72 69 74  |256+15,iconsprit|
00006f60  65 25 2c 41 70 70 6e 61  6d 65 24 2c 30 2c 77 2c  |e%,Appname$,0,w,|
00006f70  68 2c 6d 6f 64 65 3a f4  20 43 72 65 61 74 65 20  |h,mode:. Create |
00006f80  72 65 70 6c 61 63 65 6d  65 6e 74 20 69 63 6f 6e  |replacement icon|
00006f90  20 73 70 72 69 74 65 0d  1c e8 3e c8 99 20 22 4f  | sprite...>.. "O|
00006fa0  53 5f 53 70 72 69 74 65  4f 70 22 2c 32 35 36 2b  |S_SpriteOp",256+|
00006fb0  32 39 2c 69 63 6f 6e 73  70 72 69 74 65 25 2c 41  |29,iconsprite%,A|
00006fc0  70 70 6e 61 6d 65 24 3a  f4 20 43 72 65 61 74 65  |ppname$:. Create|
00006fd0  20 6d 61 73 6b 0d 1c f2  07 20 20 3a 0d 1c fc 2d  | mask....  :...-|
00006fe0  f4 20 50 61 69 6e 74 20  73 70 72 69 74 65 20 6d  |. Paint sprite m|
00006ff0  61 73 6b 20 69 6e 74 6f  20 69 63 6f 6e 73 70 72  |ask into iconspr|
00007000  69 74 65 20 6d 61 73 6b  3a 0d 1d 06 51 c8 99 20  |ite mask:...Q.. |
00007010  22 4f 53 5f 53 70 72 69  74 65 4f 70 22 2c 32 35  |"OS_SpriteOp",25|
00007020  36 2b 36 31 2c 69 63 6f  6e 73 70 72 69 74 65 25  |6+61,iconsprite%|
00007030  2c 41 70 70 6e 61 6d 65  24 2c 30 20 b8 20 72 30  |,Appname$,0 . r0|
00007040  2c 72 31 2c 72 32 2c 72  33 3a f4 20 4f 75 74 70  |,r1,r2,r3:. Outp|
00007050  75 74 20 74 6f 20 6d 61  73 6b 0d 1d 10 55 c8 99  |ut to mask...U..|
00007060  20 22 4f 53 5f 53 70 72  69 74 65 4f 70 22 2c 32  | "OS_SpriteOp",2|
00007070  35 36 2b 34 39 2c 53 70  72 69 74 65 73 2c 41 70  |56+49,Sprites,Ap|
00007080  70 6e 61 6d 65 24 2b 45  78 74 65 6e 73 69 6f 6e  |pname$+Extension|
00007090  24 2c 30 2c 30 3a f4 20  50 61 69 6e 74 20 6d 61  |$,0,0:. Paint ma|
000070a0  73 6b 20 66 72 6f 6d 20  53 70 72 69 74 65 73 0d  |sk from Sprites.|
000070b0  1d 1a 37 e6 20 34 2c 31  32 38 3a da 3a f4 20 49  |..7. 4,128:.:. I|
000070c0  6e 76 65 72 74 20 74 6f  20 6d 61 6b 65 20 6d 61  |nvert to make ma|
000070d0  73 6b 20 74 68 65 20 72  69 67 68 74 20 77 61 79  |sk the right way|
000070e0  20 72 6f 75 6e 64 0d 1d  24 36 c8 99 20 22 4f 53  | round..$6.. "OS|
000070f0  5f 53 70 72 69 74 65 4f  70 22 2c 72 30 2c 72 31  |_SpriteOp",r0,r1|
00007100  2c 72 32 2c 72 33 3a f4  20 52 65 73 65 74 20 73  |,r2,r3:. Reset s|
00007110  63 72 65 65 6e 20 6f 75  74 70 75 74 0d 1d 2e 07  |creen output....|
00007120  20 20 3a 0d 1d 38 23 f4  20 50 61 69 6e 74 20 73  |  :..8#. Paint s|
00007130  70 72 69 74 65 20 69 6e  74 6f 20 69 63 6f 6e 73  |prite into icons|
00007140  70 72 69 74 65 3a 0d 1d  42 5c c8 99 20 22 4f 53  |prite:..B\.. "OS|
00007150  5f 53 70 72 69 74 65 4f  70 22 2c 32 35 36 2b 36  |_SpriteOp",256+6|
00007160  30 2c 69 63 6f 6e 73 70  72 69 74 65 25 2c 41 70  |0,iconsprite%,Ap|
00007170  70 6e 61 6d 65 24 2c 30  20 b8 20 72 30 2c 72 31  |pname$,0 . r0,r1|
00007180  2c 72 32 2c 72 33 3a f4  20 4f 75 74 70 75 74 20  |,r2,r3:. Output |
00007190  74 6f 20 6e 65 77 20 69  63 6f 6e 20 73 70 72 69  |to new icon spri|
000071a0  74 65 0d 1d 4c 57 c8 99  20 22 4f 53 5f 53 70 72  |te..LW.. "OS_Spr|
000071b0  69 74 65 4f 70 22 2c 32  35 36 2b 33 34 2c 53 70  |iteOp",256+34,Sp|
000071c0  72 69 74 65 73 2c 41 70  70 6e 61 6d 65 24 2b 45  |rites,Appname$+E|
000071d0  78 74 65 6e 73 69 6f 6e  24 2c 30 2c 30 2c 38 3a  |xtension$,0,0,8:|
000071e0  f4 20 50 61 69 6e 74 20  63 6f 70 79 20 66 72 6f  |. Paint copy fro|
000071f0  6d 20 53 70 72 69 74 65  73 0d 1d 56 36 c8 99 20  |m Sprites..V6.. |
00007200  22 4f 53 5f 53 70 72 69  74 65 4f 70 22 2c 72 30  |"OS_SpriteOp",r0|
00007210  2c 72 31 2c 72 32 2c 72  33 3a f4 20 52 65 73 65  |,r1,r2,r3:. Rese|
00007220  74 20 73 63 72 65 65 6e  20 6f 75 74 70 75 74 0d  |t screen output.|
00007230  1d 60 3a 42 6c 6f 63 6b  21 30 3d 57 6e 64 77 3a  |.`:Block!0=Wndw:|
00007240  42 6c 6f 63 6b 21 34 3d  49 63 6e 3a c8 99 20 22  |Block!4=Icn:.. "|
00007250  57 69 6d 70 5f 47 65 74  49 63 6f 6e 53 74 61 74  |Wimp_GetIconStat|
00007260  65 22 2c 2c 42 6c 6f 63  6b 0d 1d 6a 45 42 6c 6f  |e",,Block..jEBlo|
00007270  63 6b 21 38 3d 30 3a 42  6c 6f 63 6b 21 31 32 3d  |ck!8=0:Block!12=|
00007280  30 3a c8 99 20 22 57 69  6d 70 5f 53 65 74 49 63  |0:.. "Wimp_SetIc|
00007290  6f 6e 53 74 61 74 65 22  2c 2c 42 6c 6f 63 6b 3a  |onState",,Block:|
000072a0  f4 20 52 65 2d 70 6c 6f  74 20 69 63 6f 6e 0d 1d  |. Re-plot icon..|
000072b0  74 05 e1 0d 1d 7e 05 3a  0d 1d 88 d8 dd 20 a4 43  |t....~.:..... .C|
000072c0  72 65 61 74 65 57 69 6e  64 6f 77 28 6d 69 6e 58  |reateWindow(minX|
000072d0  2c 6d 69 6e 59 2c 6d 61  78 58 2c 6d 61 78 59 2c  |,minY,maxX,maxY,|
000072e0  58 6f 66 66 73 65 74 2c  59 6f 66 66 73 65 74 2c  |Xoffset,Yoffset,|
000072f0  48 61 6e 64 6c 65 2c 46  6c 61 67 73 2c 54 69 74  |Handle,Flags,Tit|
00007300  6c 65 43 6f 6c 2c 54 69  74 6c 65 42 61 63 6b 43  |leCol,TitleBackC|
00007310  6f 6c 2c 57 6f 72 6b 43  6f 6c 2c 57 6f 72 6b 42  |ol,WorkCol,WorkB|
00007320  61 63 6b 43 6f 6c 2c 53  63 72 6f 6c 6c 43 6f 6c  |ackCol,ScrollCol|
00007330  2c 53 6c 69 64 65 72 43  6f 6c 2c 49 6e 70 75 74  |,SliderCol,Input|
00007340  43 6f 6c 2c 57 6d 69 6e  58 2c 57 6d 69 6e 59 2c  |Col,WminX,WminY,|
00007350  57 6d 61 78 58 2c 57 6d  61 78 59 2c 54 69 74 6c  |WmaxX,WmaxY,Titl|
00007360  65 46 6c 61 67 73 2c 57  62 75 74 74 6f 6e 2c 53  |eFlags,Wbutton,S|
00007370  70 72 69 74 65 50 6f 69  6e 74 2c 4d 69 6e 57 2c  |pritePoint,MinW,|
00007380  4d 69 6e 48 2c 54 69 74  6c 65 44 61 74 61 24 29  |MinH,TitleData$)|
00007390  0d 1d 92 5a 42 6c 6f 63  6b 21 30 3d 6d 69 6e 58  |...ZBlock!0=minX|
000073a0  3a 42 6c 6f 63 6b 21 34  3d 6d 69 6e 59 3a 42 6c  |:Block!4=minY:Bl|
000073b0  6f 63 6b 21 38 3d 6d 61  78 58 3a 42 6c 6f 63 6b  |ock!8=maxX:Block|
000073c0  21 31 32 3d 6d 61 78 59  3a 42 6c 6f 63 6b 21 31  |!12=maxY:Block!1|
000073d0  36 3d 58 6f 66 66 73 65  74 3a 42 6c 6f 63 6b 21  |6=Xoffset:Block!|
000073e0  32 30 3d 59 6f 66 66 73  65 74 0d 1d 9c 22 42 6c  |20=Yoffset..."Bl|
000073f0  6f 63 6b 21 32 34 3d 48  61 6e 64 6c 65 3a 42 6c  |ock!24=Handle:Bl|
00007400  6f 63 6b 21 32 38 3d 46  6c 61 67 73 0d 1d a6 51  |ock!28=Flags...Q|
00007410  42 6c 6f 63 6b 3f 33 32  3d 54 69 74 6c 65 43 6f  |Block?32=TitleCo|
00007420  6c 3a 42 6c 6f 63 6b 3f  33 33 3d 54 69 74 6c 65  |l:Block?33=Title|
00007430  42 61 63 6b 43 6f 6c 3a  42 6c 6f 63 6b 3f 33 34  |BackCol:Block?34|
00007440  3d 57 6f 72 6b 43 6f 6c  3a 42 6c 6f 63 6b 3f 33  |=WorkCol:Block?3|
00007450  35 3d 57 6f 72 6b 42 61  63 6b 43 6f 6c 0d 1d b0  |5=WorkBackCol...|
00007460  46 42 6c 6f 63 6b 3f 33  36 3d 53 63 72 6f 6c 6c  |FBlock?36=Scroll|
00007470  43 6f 6c 3a 42 6c 6f 63  6b 3f 33 37 3d 53 6c 69  |Col:Block?37=Sli|
00007480  64 65 72 43 6f 6c 3a 42  6c 6f 63 6b 3f 33 38 3d  |derCol:Block?38=|
00007490  49 6e 70 75 74 43 6f 6c  3a 42 6c 6f 63 6b 3f 33  |InputCol:Block?3|
000074a0  39 3d 30 0d 1d ba 3f 42  6c 6f 63 6b 21 34 30 3d  |9=0...?Block!40=|
000074b0  57 6d 69 6e 58 3a 42 6c  6f 63 6b 21 34 34 3d 57  |WminX:Block!44=W|
000074c0  6d 69 6e 59 3a 42 6c 6f  63 6b 21 34 38 3d 57 6d  |minY:Block!48=Wm|
000074d0  61 78 58 3a 42 6c 6f 63  6b 21 35 32 3d 57 6d 61  |axX:Block!52=Wma|
000074e0  78 59 0d 1d c4 3d 42 6c  6f 63 6b 21 35 36 3d 54  |xY...=Block!56=T|
000074f0  69 74 6c 65 46 6c 61 67  73 3a 42 6c 6f 63 6b 21  |itleFlags:Block!|
00007500  36 30 3d 57 62 75 74 74  6f 6e 3a 42 6c 6f 63 6b  |60=Wbutton:Block|
00007510  21 36 34 3d 53 70 72 69  74 65 50 6f 69 6e 74 0d  |!64=SpritePoint.|
00007520  1d ce 5f 42 6c 6f 63 6b  21 36 38 3d 28 4d 69 6e  |.._Block!68=(Min|
00007530  48 3c 3c 31 35 29 2b 4d  69 6e 57 20 3a 3a 3a 3a  |H<<15)+MinW ::::|
00007540  3a 3a 3a 3a 3a 3a 3a 3a  20 f4 20 30 2c 30 20 73  |:::::::: . 0,0 s|
00007550  65 74 73 20 74 68 65 20  6d 69 6e 69 6d 75 6d 20  |ets the minimum |
00007560  77 69 6e 64 6f 77 20 77  69 74 68 20 74 6f 20 74  |window with to t|
00007570  68 65 20 74 69 74 6c 65  20 77 69 64 74 68 0d 1d  |he title width..|
00007580  d8 3e 24 28 42 6c 6f 63  6b 2b 37 32 29 3d 54 69  |.>$(Block+72)=Ti|
00007590  74 6c 65 44 61 74 61 24  3a 42 6c 6f 63 6b 21 38  |tleData$:Block!8|
000075a0  34 3d 30 20 3a 3a 3a 20  f4 20 4e 6f 20 69 63 6f  |4=0 ::: . No ico|
000075b0  6e 73 20 69 6e 69 74 69  61 6c 6c 79 0d 1d e2 30  |ns initially...0|
000075c0  c8 99 20 22 57 69 6d 70  5f 43 72 65 61 74 65 57  |.. "Wimp_CreateW|
000075d0  69 6e 64 6f 77 22 2c 2c  42 6c 6f 63 6b 20 b8 20  |indow",,Block . |
000075e0  57 69 6e 64 6f 77 48 61  6e 64 6c 65 0d 1d ec 11  |WindowHandle....|
000075f0  3d 57 69 6e 64 6f 77 48  61 6e 64 6c 65 0d 1d f6  |=WindowHandle...|
00007600  05 3a 0d 1e 00 42 dd 20  a4 43 72 65 61 74 65 49  |.:...B. .CreateI|
00007610  63 6f 6e 28 57 69 6e 64  6f 77 48 61 6e 64 6c 65  |con(WindowHandle|
00007620  2c 6d 69 6e 58 2c 6d 69  6e 59 2c 6d 61 78 58 2c  |,minX,minY,maxX,|
00007630  6d 61 78 59 2c 46 6c 61  67 73 2c 49 63 6f 6e 44  |maxY,Flags,IconD|
00007640  61 74 61 29 0d 1e 0a 18  42 6c 6f 63 6b 21 30 3d  |ata)....Block!0=|
00007650  57 69 6e 64 6f 77 48 61  6e 64 6c 65 0d 1e 14 48  |WindowHandle...H|
00007660  42 6c 6f 63 6b 21 34 3d  6d 69 6e 58 3a 42 6c 6f  |Block!4=minX:Blo|
00007670  63 6b 21 38 3d 6d 69 6e  59 3a 42 6c 6f 63 6b 21  |ck!8=minY:Block!|
00007680  31 32 3d 6d 61 78 58 3a  42 6c 6f 63 6b 21 31 36  |12=maxX:Block!16|
00007690  3d 6d 61 78 59 3a 42 6c  6f 63 6b 21 32 30 3d 46  |=maxY:Block!20=F|
000076a0  6c 61 67 73 0d 1e 1e 3f  42 6c 6f 63 6b 21 32 34  |lags...?Block!24|
000076b0  3d 49 63 6f 6e 44 61 74  61 21 30 3a 42 6c 6f 63  |=IconData!0:Bloc|
000076c0  6b 21 32 38 3d 49 63 6f  6e 44 61 74 61 21 34 3a  |k!28=IconData!4:|
000076d0  42 6c 6f 63 6b 21 33 32  3d 49 63 6f 6e 44 61 74  |Block!32=IconDat|
000076e0  61 21 38 0d 1e 28 2c c8  99 20 22 57 69 6d 70 5f  |a!8..(,.. "Wimp_|
000076f0  43 72 65 61 74 65 49 63  6f 6e 22 2c 2c 42 6c 6f  |CreateIcon",,Blo|
00007700  63 6b 20 b8 20 49 63 6f  6e 48 61 6e 64 6c 65 0d  |ck . IconHandle.|
00007710  1e 32 0f 3d 49 63 6f 6e  48 61 6e 64 6c 65 0d 1e  |.2.=IconHandle..|
00007720  3c 05 3a 0d 1e 46 11 dd  20 f2 49 6e 69 74 69 61  |<.:..F.. .Initia|
00007730  6c 69 73 65 0d 1e 50 2d  41 70 70 53 69 7a 65 3d  |lise..P-AppSize=|
00007740  93 2d 26 38 30 30 30 3a  4d 69 6e 53 69 7a 65 3d  |.-&8000:MinSize=|
00007750  41 70 70 53 69 7a 65 3a  53 6c 6f 74 45 6e 64 3d  |AppSize:SlotEnd=|
00007760  93 0d 1e 5a 05 e1 0d 1e  64 05 3a 0d 1e 6e 1f dd  |...Z....d.:..n..|
00007770  20 a4 41 6c 6c 6f 63 61  74 65 4d 65 6d 6f 72 79  | .AllocateMemory|
00007780  28 52 65 71 75 69 72 65  64 29 0d 1e 78 1a 53 6c  |(Required)..x.Sl|
00007790  6f 74 53 69 7a 65 3d a4  53 6c 6f 74 53 69 7a 65  |otSize=.SlotSize|
000077a0  28 2d 31 29 0d 1e 82 92  e7 20 53 6c 6f 74 53 69  |(-1)..... SlotSi|
000077b0  7a 65 3c 52 65 71 75 69  72 65 64 20 8c 20 4e 65  |ze<Required . Ne|
000077c0  77 53 69 7a 65 3d a4 53  6c 6f 74 53 69 7a 65 28  |wSize=.SlotSize(|
000077d0  52 65 71 75 69 72 65 64  29 3a e7 20 4e 65 77 53  |Required):. NewS|
000077e0  69 7a 65 3c 52 65 71 75  69 72 65 64 20 8c 20 53  |ize<Required . S|
000077f0  6c 6f 74 53 69 7a 65 3d  a4 53 6c 6f 74 53 69 7a  |lotSize=.SlotSiz|
00007800  65 28 41 70 70 53 69 7a  65 29 3a 3d 30 3a f4 20  |e(AppSize):=0:. |
00007810  52 65 74 75 72 6e 73 2c  20 69 6e 64 69 63 61 74  |Returns, indicat|
00007820  69 6e 67 20 6d 65 6d 6f  72 79 20 6e 6f 74 20 63  |ing memory not c|
00007830  6c 61 69 6d 65 64 0d 1e  8c 36 e7 20 53 6c 6f 74  |laimed...6. Slot|
00007840  53 69 7a 65 3e 52 65 71  75 69 72 65 64 20 8c 20  |Size>Required . |
00007850  53 6c 6f 74 53 69 7a 65  3d a4 53 6c 6f 74 53 69  |SlotSize=.SlotSi|
00007860  7a 65 28 52 65 71 75 69  72 65 64 29 0d 1e 96 2a  |ze(Required)...*|
00007870  3d 53 6c 6f 74 53 69 7a  65 3a f4 20 52 65 74 75  |=SlotSize:. Retu|
00007880  72 6e 73 20 77 69 74 68  20 62 79 74 65 73 20 63  |rns with bytes c|
00007890  6c 61 69 6d 65 64 0d 1e  a0 05 3a 0d 1e aa 16 dd  |laimed....:.....|
000078a0  20 a4 53 6c 6f 74 53 69  7a 65 28 42 79 74 65 73  | .SlotSize(Bytes|
000078b0  29 0d 1e b4 27 c8 99 20  22 57 69 6d 70 5f 53 6c  |)...'.. "Wimp_Sl|
000078c0  6f 74 53 69 7a 65 22 2c  42 79 74 65 73 2c 2d 31  |otSize",Bytes,-1|
000078d0  20 b8 20 42 79 74 65 73  0d 1e be 0a 3d 42 79 74  | . Bytes....=Byt|
000078e0  65 73 0d 1e c8 05 3a 0d  1e d2 17 dd 20 f2 4d 69  |es....:..... .Mi|
000078f0  6e 69 6d 69 73 65 57 69  6d 70 53 6c 6f 74 0d 1e  |nimiseWimpSlot..|
00007900  dc 22 64 75 6d 6d 79 3d  a4 41 6c 6c 6f 63 61 74  |."dummy=.Allocat|
00007910  65 4d 65 6d 6f 72 79 28  4d 69 6e 53 69 7a 65 29  |eMemory(MinSize)|
00007920  0d 1e e6 05 e1 0d 1e f0  05 3a 0d 1e fa 22 dd 20  |.........:...". |
00007930  f2 43 6c 6f 73 65 46 69  6c 65 49 66 50 6f 73 73  |.CloseFileIfPoss|
00007940  28 46 69 6c 65 48 61 6e  64 6c 65 29 0d 1f 04 07  |(FileHandle)....|
00007950  ea 20 85 0d 1f 0e 26 ee  20 85 20 ea 20 f7 20 85  |. ....&. . . . .|
00007960  3a e1 3a f4 20 55 6e 61  62 6c 65 20 74 6f 20 63  |:.:. Unable to c|
00007970  6c 6f 73 65 20 66 69 6c  65 0d 1f 18 10 d9 23 46  |lose file.....#F|
00007980  69 6c 65 48 61 6e 64 6c  65 0d 1f 22 05 e1 0d 1f  |ileHandle.."....|
00007990  2c 05 3a 0d 1f 36 1e dd  20 a4 46 69 6e 64 46 69  |,.:..6.. .FindFi|
000079a0  6c 65 53 69 7a 65 28 46  69 6c 65 4e 61 6d 65 24  |leSize(FileName$|
000079b0  29 0d 1f 40 20 e7 20 46  69 6c 65 4e 61 6d 65 24  |)..@ . FileName$|
000079c0  3d 22 3c 57 69 6d 70 24  53 63 72 61 70 3e 22 20  |="<Wimp$Scrap>" |
000079d0  8c 0d 1f 4a 3a 20 20 c8  99 20 22 4f 53 5f 46 69  |...J:  .. "OS_Fi|
000079e0  6c 65 22 2c 31 35 2c 46  69 6c 65 4e 61 6d 65 24  |le",15,FileName$|
000079f0  2c 2c 2c 46 69 6c 65 4e  61 6d 65 24 20 b8 20 2c  |,,,FileName$ . ,|
00007a00  2c 2c 2c 46 69 6c 65 53  69 7a 65 0d 1f 54 05 cc  |,,,FileSize..T..|
00007a10  0d 1f 5e 34 20 20 4e 3d  2d 31 3a f5 3a 4e 2b 3d  |..^4  N=-1:.:N+=|
00007a20  31 3a fd 20 c1 46 69 6c  65 4e 61 6d 65 24 2c a9  |1:. .FileName$,.|
00007a30  28 46 69 6c 65 4e 61 6d  65 24 29 2d 4e 2c 31 29  |(FileName$)-N,1)|
00007a40  3d 22 2e 22 0d 1f 68 42  20 20 50 61 74 68 4e 61  |="."..hB  PathNa|
00007a50  6d 65 24 3d c0 46 69 6c  65 4e 61 6d 65 24 2c a9  |me$=.FileName$,.|
00007a60  28 46 69 6c 65 4e 61 6d  65 24 29 2d 4e 29 3a 4c  |(FileName$)-N):L|
00007a70  65 61 66 4e 61 6d 65 24  3d c2 46 69 6c 65 4e 61  |eafName$=.FileNa|
00007a80  6d 65 24 2c 4e 29 0d 1f  72 3a 20 20 c8 99 20 22  |me$,N)..r:  .. "|
00007a90  4f 53 5f 46 69 6c 65 22  2c 31 33 2c 4c 65 61 66  |OS_File",13,Leaf|
00007aa0  4e 61 6d 65 24 2c 2c 2c  50 61 74 68 4e 61 6d 65  |Name$,,,PathName|
00007ab0  24 20 b8 20 2c 2c 2c 2c  46 69 6c 65 53 69 7a 65  |$ . ,,,,FileSize|
00007ac0  0d 1f 7c 05 cd 0d 1f 86  0d 3d 46 69 6c 65 53 69  |..|......=FileSi|
00007ad0  7a 65 0d 1f 90 05 3a 0d  1f 9a 10 dd 20 a4 4e 65  |ze....:..... .Ne|
00007ae0  78 74 45 6e 74 72 79 0d  1f a4 48 f4 20 47 65 74  |xtEntry...H. Get|
00007af0  73 20 6e 65 78 74 20 65  6e 74 72 79 20 28 63 72  |s next entry (cr|
00007b00  65 61 74 65 64 20 62 79  20 42 50 55 54 23 44 61  |eated by BPUT#Da|
00007b10  74 61 2c 41 24 29 20 66  72 6f 6d 20 61 20 66 69  |ta,A$) from a fi|
00007b20  6c 65 20 61 73 20 61 20  73 74 72 69 6e 67 2e 0d  |le as a string..|
00007b30  1f ae 1c f4 20 55 73 65  20 61 73 20 41 24 3d 46  |.... Use as A$=F|
00007b40  4e 4e 65 78 74 45 6e 74  72 79 2e 0d 1f b8 07 ea  |NNextEntry......|
00007b50  20 85 0d 1f c2 26 ee 20  85 20 ea 20 f7 20 85 3a  | ....&. . . . .:|
00007b60  3d 22 22 3a f4 20 45 72  72 6f 72 20 72 65 61 64  |="":. Error read|
00007b70  69 6e 67 20 66 69 6c 65  0d 1f cc 0e 4e 45 24 3d  |ing file....NE$=|
00007b80  be 23 44 61 74 61 0d 1f  d6 12 c8 95 20 c0 4e 45  |.#Data...... .NE|
00007b90  24 2c 31 29 3d 22 7c 22  0d 1f e0 10 20 20 4e 45  |$,1)="|"....  NE|
00007ba0  24 3d be 23 44 61 74 61  0d 1f ea 05 ce 0d 1f f4  |$=.#Data........|
00007bb0  08 3d 4e 45 24 0d 1f fe  05 3a 0d 20 08 47 dd 20  |.=NE$....:. .G. |
00007bc0  f2 44 72 61 67 42 6f 78  28 57 69 6e 64 6f 77 48  |.DragBox(WindowH|
00007bd0  61 6e 64 6c 65 2c 49 63  6f 6e 48 61 6e 64 6c 65  |andle,IconHandle|
00007be0  2c 44 72 61 67 54 79 70  65 2c 53 70 72 69 74 65  |,DragType,Sprite|
00007bf0  41 72 65 61 2c 53 70 72  69 74 65 4e 61 6d 65 24  |Area,SpriteName$|
00007c00  29 0d 20 12 38 42 6c 6f  63 6b 21 30 3d 57 69 6e  |). .8Block!0=Win|
00007c10  64 6f 77 48 61 6e 64 6c  65 3a c8 99 20 22 57 69  |dowHandle:.. "Wi|
00007c20  6d 70 5f 47 65 74 57 69  6e 64 6f 77 53 74 61 74  |mp_GetWindowStat|
00007c30  65 22 2c 2c 42 6c 6f 63  6b 0d 20 1c 20 77 6d 69  |e",,Block. . wmi|
00007c40  6e 78 3d 42 6c 6f 63 6b  21 34 3a 77 6d 61 78 79  |nx=Block!4:wmaxy|
00007c50  3d 42 6c 6f 63 6b 21 31  36 0d 20 26 49 42 6c 6f  |=Block!16. &IBlo|
00007c60  63 6b 21 30 3d 57 69 6e  64 6f 77 48 61 6e 64 6c  |ck!0=WindowHandl|
00007c70  65 3a 42 6c 6f 63 6b 21  34 3d 49 63 6f 6e 48 61  |e:Block!4=IconHa|
00007c80  6e 64 6c 65 3a c8 99 20  22 57 69 6d 70 5f 47 65  |ndle:.. "Wimp_Ge|
00007c90  74 49 63 6f 6e 53 74 61  74 65 22 2c 2c 42 6c 6f  |tIconState",,Blo|
00007ca0  63 6b 0d 20 30 3e 69 6d  69 6e 78 3d 42 6c 6f 63  |ck. 0>iminx=Bloc|
00007cb0  6b 21 38 3a 69 6d 69 6e  79 3d 42 6c 6f 63 6b 21  |k!8:iminy=Block!|
00007cc0  31 32 3a 69 6d 61 78 78  3d 42 6c 6f 63 6b 21 31  |12:imaxx=Block!1|
00007cd0  36 3a 69 6d 61 78 79 3d  42 6c 6f 63 6b 21 32 30  |6:imaxy=Block!20|
00007ce0  0d 20 3a 29 42 6c 6f 63  6b 21 30 3d 57 69 6e 64  |. :)Block!0=Wind|
00007cf0  6f 77 48 61 6e 64 6c 65  3a 42 6c 6f 63 6b 21 34  |owHandle:Block!4|
00007d00  3d 44 72 61 67 54 79 70  65 0d 20 44 19 42 6c 6f  |=DragType. D.Blo|
00007d10  63 6b 21 38 3d 28 77 6d  69 6e 78 2b 69 6d 69 6e  |ck!8=(wminx+imin|
00007d20  78 29 0d 20 4e 1a 42 6c  6f 63 6b 21 31 32 3d 28  |x). N.Block!12=(|
00007d30  77 6d 61 78 79 2b 69 6d  69 6e 79 29 0d 20 58 1a  |wmaxy+iminy). X.|
00007d40  42 6c 6f 63 6b 21 31 36  3d 28 77 6d 69 6e 78 2b  |Block!16=(wminx+|
00007d50  69 6d 61 78 78 29 0d 20  62 1a 42 6c 6f 63 6b 21  |imaxx). b.Block!|
00007d60  32 30 3d 28 77 6d 61 78  79 2b 69 6d 61 78 79 29  |20=(wmaxy+imaxy)|
00007d70  0d 20 6c 19 42 6c 6f 63  6b 21 32 34 3d 31 3a 42  |. l.Block!24=1:B|
00007d80  6c 6f 63 6b 21 32 38 3d  31 0d 20 76 47 42 6c 6f  |lock!28=1. vGBlo|
00007d90  63 6b 21 33 32 3d 28 a4  4d 6f 64 65 49 6e 66 6f  |ck!32=(.ModeInfo|
00007da0  28 22 58 70 69 78 65 6c  73 22 2c 2d 31 29 2b 31  |("Xpixels",-1)+1|
00007db0  29 2a 28 32 5e a4 4d 6f  64 65 49 6e 66 6f 28 22  |)*(2^.ModeInfo("|
00007dc0  58 45 69 67 46 61 63 74  6f 72 22 2c 2d 31 29 29  |XEigFactor",-1))|
00007dd0  0d 20 80 47 42 6c 6f 63  6b 21 33 36 3d 28 a4 4d  |. .GBlock!36=(.M|
00007de0  6f 64 65 49 6e 66 6f 28  22 59 70 69 78 65 6c 73  |odeInfo("Ypixels|
00007df0  22 2c 2d 31 29 2b 31 29  2a 28 32 5e a4 4d 6f 64  |",-1)+1)*(2^.Mod|
00007e00  65 49 6e 66 6f 28 22 59  45 69 67 46 61 63 74 6f  |eInfo("YEigFacto|
00007e10  72 22 2c 2d 31 29 29 0d  20 8a 13 e7 20 44 72 61  |r",-1)). ... Dra|
00007e20  67 41 53 70 72 69 74 65  20 8c 0d 20 94 45 20 20  |gASprite .. .E  |
00007e30  c8 99 20 22 44 72 61 67  41 53 70 72 69 74 65 5f  |.. "DragASprite_|
00007e40  53 74 61 72 74 22 2c 25  31 30 30 30 30 31 30 31  |Start",%10000101|
00007e50  2c 53 70 72 69 74 65 41  72 65 61 2c 53 70 72 69  |,SpriteArea,Spri|
00007e60  74 65 4e 61 6d 65 24 2c  42 6c 6f 63 6b 2b 38 0d  |teName$,Block+8.|
00007e70  20 9e 05 cc 0d 20 a8 1e  20 20 c8 99 20 22 57 69  | .... ..  .. "Wi|
00007e80  6d 70 5f 44 72 61 67 42  6f 78 22 2c 2c 42 6c 6f  |mp_DragBox",,Blo|
00007e90  63 6b 0d 20 b2 05 cd 0d  20 bc 05 e1 0d 20 c6 05  |ck. .... .... ..|
00007ea0  3a 0d 20 d0 4f f4 20 2d  2d 2d 2d 2d 2d 2d 2d 2d  |:. .O. ---------|
00007eb0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00007ef0  0d 20 da 2f f4 20 52 6f  75 74 69 6e 65 73 20 63  |. ./. Routines c|
00007f00  6f 6d 6d 6f 6e 20 74 6f  20 74 68 65 20 4f 6d 6e  |ommon to the Omn|
00007f10  69 44 65 73 6b 20 75 74  69 6c 69 74 69 65 73 0d  |iDesk utilities.|
00007f20  20 e4 4f f4 20 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  | .O. -----------|
00007f30  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00007f60  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0d 20  |--------------. |
00007f70  ee 05 3a 0d 20 f8 18 dd  20 f2 44 65 63 6c 61 72  |..:. ... .Declar|
00007f80  65 54 6f 4f 6d 6e 69 44  65 73 6b 0d 21 02 2f 42  |eToOmniDesk.!./B|
00007f90  6c 6f 63 6b 21 30 3d 32  30 38 3a 42 6c 6f 63 6b  |lock!0=208:Block|
00007fa0  21 31 32 3d 30 3a 42 6c  6f 63 6b 21 31 36 3d 55  |!12=0:Block!16=U|
00007fb0  74 69 6c 44 65 63 6c 61  72 65 0d 21 0c 11 42 6c  |tilDeclare.!..Bl|
00007fc0  6f 63 6b 21 32 30 3d 54  61 73 6b 0d 21 16 19 24  |ock!20=Task.!..$|
00007fd0  28 42 6c 6f 63 6b 2b 32  34 29 3d 54 61 73 6b 6e  |(Block+24)=Taskn|
00007fe0  61 6d 65 24 0d 21 20 1c  24 28 42 6c 6f 63 6b 2b  |ame$.! .$(Block+|
00007ff0  34 34 29 3d 4f 75 72 46  69 6c 65 4e 61 6d 65 24  |44)=OurFileName$|
00008000  0d 21 2a 29 24 28 42 6c  6f 63 6b 2b 35 35 29 3d  |.!*)$(Block+55)=|
00008010  a4 4f 6d 6e 69 48 65 6c  70 4d 65 73 73 61 67 65  |.OmniHelpMessage|
00008020  28 22 43 4c 49 43 4b 22  29 0d 21 34 29 24 28 42  |("CLICK").!4)$(B|
00008030  6c 6f 63 6b 2b 31 33 32  29 3d a4 4f 6d 6e 69 48  |lock+132)=.OmniH|
00008040  65 6c 70 4d 65 73 73 61  67 65 28 22 44 52 41 47  |elpMessage("DRAG|
00008050  22 29 0d 21 3e 2b c8 99  20 22 57 69 6d 70 5f 53  |").!>+.. "Wimp_S|
00008060  65 6e 64 4d 65 73 73 61  67 65 22 2c 31 37 2c 42  |endMessage",17,B|
00008070  6c 6f 63 6b 2c 4f 6d 6e  69 44 65 73 6b 0d 21 48  |lock,OmniDesk.!H|
00008080  05 e1 0d 21 52 05 3a 0d  21 5c 11 dd 20 f2 53 61  |...!R.:.!\.. .Sa|
00008090  79 47 6f 6f 64 62 79 65  0d 21 66 13 e7 20 4f 6d  |yGoodbye.!f.. Om|
000080a0  6e 69 44 65 73 6b 3c 3e  30 20 8c 0d 21 70 31 20  |niDesk<>0 ..!p1 |
000080b0  20 42 6c 6f 63 6b 21 30  3d 32 34 3a 42 6c 6f 63  | Block!0=24:Bloc|
000080c0  6b 21 31 32 3d 30 3a 42  6c 6f 63 6b 21 31 36 3d  |k!12=0:Block!16=|
000080d0  55 74 69 6c 51 75 69 74  74 69 6e 67 0d 21 7a 13  |UtilQuitting.!z.|
000080e0  20 20 42 6c 6f 63 6b 21  32 30 3d 54 61 73 6b 0d  |  Block!20=Task.|
000080f0  21 84 2d 20 20 c8 99 20  22 57 69 6d 70 5f 53 65  |!.-  .. "Wimp_Se|
00008100  6e 64 4d 65 73 73 61 67  65 22 2c 31 37 2c 42 6c  |ndMessage",17,Bl|
00008110  6f 63 6b 2c 4f 6d 6e 69  44 65 73 6b 0d 21 8e 05  |ock,OmniDesk.!..|
00008120  cd 0d 21 98 21 c8 99 20  22 49 6e 74 65 72 66 61  |..!.!.. "Interfa|
00008130  63 65 5f 43 6c 6f 73 65  44 6f 77 6e 22 2c 54 61  |ce_CloseDown",Ta|
00008140  73 6b 0d 21 a2 26 c8 99  20 22 57 69 6d 70 5f 43  |sk.!.&.. "Wimp_C|
00008150  6c 6f 73 65 44 6f 77 6e  22 2c 54 61 73 6b 2c 26  |loseDown",Task,&|
00008160  34 42 35 33 34 31 35 34  0d 21 ac 05 e1 0d 21 b6  |4B534154.!....!.|
00008170  05 3a 0d 21 c0 18 dd 20  a4 52 65 61 64 53 74 61  |.:.!... .ReadSta|
00008180  72 74 75 70 53 74 72 69  6e 67 0d 21 ca 4d f4 20  |rtupString.!.M. |
00008190  52 65 74 75 72 6e 73 20  74 61 73 6b 20 68 61 6e  |Returns task han|
000081a0  64 6c 65 20 6f 66 20 4f  6d 6e 69 44 65 73 6b 20  |dle of OmniDesk |
000081b0  28 77 68 69 63 68 20 69  73 20 70 61 73 73 65 64  |(which is passed|
000081c0  20 69 6e 20 74 68 65 20  63 6f 6d 6d 61 6e 64 20  | in the command |
000081d0  73 74 72 69 6e 67 29 0d  21 d4 26 f4 20 6f 72 20  |string).!.&. or |
000081e0  30 20 69 66 20 6e 6f 74  20 73 74 61 72 74 65 64  |0 if not started|
000081f0  20 62 79 20 4f 6d 6e 69  44 65 73 6b 2e 0d 21 de  | by OmniDesk..!.|
00008200  1d c8 99 20 22 4f 53 5f  47 65 74 45 6e 76 22 20  |... "OS_GetEnv" |
00008210  b8 20 43 6f 6d 6d 61 6e  64 24 0d 21 e8 1b 41 3d  |. Command$.!..A=|
00008220  a7 43 6f 6d 6d 61 6e 64  24 2c 22 2d 53 74 61 72  |.Command$,"-Star|
00008230  74 75 70 22 29 0d 21 f2  16 e7 20 41 3c 3e 30 20  |tup").!... A<>0 |
00008240  8c 20 53 74 61 72 74 75  70 3d b9 0d 21 fc 18 41  |. Startup=..!..A|
00008250  3d a7 43 6f 6d 6d 61 6e  64 24 2c 22 2d 45 78 69  |=.Command$,"-Exi|
00008260  74 22 29 0d 22 06 13 e7  20 41 3c 3e 30 20 8c 20  |t")."... A<>0 . |
00008270  45 78 69 74 3d b9 0d 22  10 1c 41 3d a7 43 6f 6d  |Exit=.."..A=.Com|
00008280  6d 61 6e 64 24 2c 22 2d  4f 6d 6e 69 44 65 73 6b  |mand$,"-OmniDesk|
00008290  22 29 0d 22 1a 0e e7 20  41 3d 30 20 8c 20 3d 30  |")."... A=0 . =0|
000082a0  0d 22 24 16 3d bb 28 c1  43 6f 6d 6d 61 6e 64 24  |."$.=.(.Command$|
000082b0  2c 41 2b 39 29 29 0d 22  2e 05 3a 0d 22 38 20 dd  |,A+9))."..:."8 .|
000082c0  20 a4 52 65 61 64 57 69  6e 64 6f 77 4c 6f 63 61  | .ReadWindowLoca|
000082d0  74 69 6f 6e 28 41 78 69  73 24 29 0d 22 42 48 f4  |tion(Axis$)."BH.|
000082e0  20 52 65 61 64 73 20 77  68 69 63 68 20 72 61 64  | Reads which rad|
000082f0  69 6f 20 69 63 6f 6e 20  28 69 66 20 61 6e 79 29  |io icon (if any)|
00008300  20 69 73 20 73 65 6c 65  63 74 65 64 20 69 6e 20  | is selected in |
00008310  74 68 65 20 57 69 6e 64  6f 77 20 50 6f 73 69 74  |the Window Posit|
00008320  69 6f 6e 0d 22 4c 48 f4  20 73 65 6c 65 63 74 6f  |ion."LH. selecto|
00008330  72 20 77 69 6e 64 6f 77  20 61 6e 64 20 72 65 74  |r window and ret|
00008340  75 72 6e 73 20 74 68 65  20 61 78 69 73 20 63 6f  |urns the axis co|
00008350  6f 72 64 69 6e 61 74 65  20 28 74 77 6f 20 63 61  |ordinate (two ca|
00008360  6c 6c 73 20 6e 65 65 64  65 64 29 0d 22 56 25 f4  |lls needed)."V%.|
00008370  20 6f 72 20 2d 31 20 66  6f 72 20 6e 6f 20 70 6f  | or -1 for no po|
00008380  73 69 74 69 6f 6e 20 73  65 6c 65 63 74 65 64 2e  |sition selected.|
00008390  0d 22 60 3f 49 63 6f 6e  3d 35 3a f5 3a 49 63 6f  |."`?Icon=5:.:Ico|
000083a0  6e 2b 3d 31 3a fd 20 28  a4 53 65 6c 65 63 74 65  |n+=1:. (.Selecte|
000083b0  64 53 74 61 74 65 28 4c  6f 63 2c 49 63 6f 6e 29  |dState(Loc,Icon)|
000083c0  3d b9 29 20 84 20 28 49  63 6f 6e 3d 33 31 29 0d  |=.) . (Icon=31).|
000083d0  22 6a 2a e7 20 49 63 6f  6e 3d 33 31 20 8c 20 3d  |"j*. Icon=31 . =|
000083e0  2d 31 3a f4 20 41 6c 6c  20 69 63 6f 6e 73 20 64  |-1:. All icons d|
000083f0  65 73 65 6c 65 63 74 65  64 0d 22 74 34 4c 6f 63  |eselected."t4Loc|
00008400  61 74 69 6f 6e 3d 2d 31  3a 49 63 6f 6e 2d 3d 36  |ation=-1:Icon-=6|
00008410  3a f4 20 42 72 69 6e 67  20 69 63 6f 6e 20 69 6e  |:. Bring icon in|
00008420  74 6f 20 72 61 6e 67 65  20 30 2d 31 34 0d 22 7e  |to range 0-14."~|
00008430  0e c8 8e 20 41 78 69 73  24 20 ca 0d 22 88 21 20  |... Axis$ ..".! |
00008440  20 c9 20 22 58 22 2c 22  78 22 3a 4c 6f 63 61 74  | . "X","x":Locat|
00008450  69 6f 6e 3d 49 63 6f 6e  20 81 20 35 0d 22 92 25  |ion=Icon . 5.".%|
00008460  20 20 c9 20 22 59 22 2c  22 79 22 3a 4c 6f 63 61  |  . "Y","y":Loca|
00008470  74 69 6f 6e 3d 34 2d 28  49 63 6f 6e 20 83 20 35  |tion=4-(Icon . 5|
00008480  29 0d 22 9c 05 cb 0d 22  a6 0d 3d 4c 6f 63 61 74  |)."...."..=Locat|
00008490  69 6f 6e 0d 22 b0 05 3a  0d 22 ba 17 dd 20 f2 43  |ion."..:."... .C|
000084a0  6c 65 61 6e 55 70 4c 6f  63 57 69 6e 64 6f 77 0d  |leanUpLocWindow.|
000084b0  22 c4 4f f4 20 4d 61 6b  65 73 20 73 75 72 65 20  |".O. Makes sure |
000084c0  74 68 61 74 20 6e 6f 6e  65 20 6f 66 20 74 68 65  |that none of the|
000084d0  20 27 77 69 6e 64 6f 77  27 20 69 63 6f 6e 73 20  | 'window' icons |
000084e0  69 6e 20 74 68 65 20 4c  6f 63 20 77 69 6e 64 6f  |in the Loc windo|
000084f0  77 20 69 73 20 73 65 6c  65 63 74 65 64 2e 0d 22  |w is selected.."|
00008500  ce 09 4e 3d 35 3a f5 0d  22 d8 27 4e 2b 3d 31 3a  |..N=5:..".'N+=1:|
00008510  fd 20 4e 3d 33 30 20 84  20 a4 53 65 6c 65 63 74  |. N=30 . .Select|
00008520  65 64 53 74 61 74 65 28  4c 6f 63 2c 4e 29 0d 22  |edState(Loc,N)."|
00008530  e2 20 f2 55 70 64 61 74  65 53 65 6c 65 63 74 65  |. .UpdateSelecte|
00008540  64 46 6c 61 67 28 4c 6f  63 2c 4e 2c a3 29 0d 22  |dFlag(Loc,N,.)."|
00008550  ec 05 e1 0d 22 f6 05 3a  0d 23 00 4f f4 20 2d 2d  |...."..:.#.O. --|
00008560  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000085a0  2d 2d 2d 2d 2d 2d 2d 0d  23 0a 2c f4 20 53 70 65  |-------.#.,. Spe|
000085b0  63 69 61 6c 20 72 6f 75  74 69 6e 65 73 20 66 6f  |cial routines fo|
000085c0  72 20 74 68 69 73 20 70  72 6f 67 72 61 6d 20 6f  |r this program o|
000085d0  6e 6c 79 0d 23 14 4f f4  20 2d 2d 2d 2d 2d 2d 2d  |nly.#.O. -------|
000085e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00008620  2d 2d 0d 23 1e 05 3a 0d  23 28 12 dd 20 f2 53 63  |--.#..:.#(.. .Sc|
00008630  61 6e 4d 6f 64 75 6c 65  73 0d 23 32 4b f2 4d 69  |anModules.#2K.Mi|
00008640  6e 69 6d 69 73 65 57 69  6d 70 53 6c 6f 74 3a f4  |nimiseWimpSlot:.|
00008650  20 57 65 20 68 61 76 65  20 73 65 74 20 74 68 69  | We have set thi|
00008660  6e 67 73 20 75 70 20 73  6f 20 74 68 61 74 20 74  |ngs up so that t|
00008670  68 69 73 20 77 69 6c 6c  20 4e 4f 54 20 64 69 73  |his will NOT dis|
00008680  74 75 72 62 0d 23 3c 35  20 20 20 20 20 20 20 20  |turb.#<5        |
00008690  20 20 20 20 20 20 20 20  20 20 20 20 20 f4 20 74  |             . t|
000086a0  68 65 20 6c 6f 61 64 65  64 20 50 52 4d 20 69 6e  |he loaded PRM in|
000086b0  64 65 78 20 66 69 6c 65  2e 0d 23 46 2c 54 6f 74  |dex file..#F,Tot|
000086c0  61 6c 4d 6f 64 75 6c 65  73 3d a4 43 6f 75 6e 74  |alModules=.Count|
000086d0  4c 6f 61 64 65 64 4d 6f  64 75 6c 65 73 57 69 74  |LoadedModulesWit|
000086e0  68 53 57 49 73 0d 23 50  46 54 6f 74 61 6c 4d 6f  |hSWIs.#PFTotalMo|
000086f0  64 75 6c 65 73 2b 3d 31  3a f4 20 57 65 20 6e 65  |dules+=1:. We ne|
00008700  65 64 20 74 6f 20 69 6e  73 65 72 74 20 74 68 65  |ed to insert the|
00008710  20 4f 53 20 53 57 49 73  20 74 6f 6f 2c 20 77 68  | OS SWIs too, wh|
00008720  69 63 68 20 61 72 65 20  6e 6f 74 0d 23 5a 32 20  |ich are not.#Z2 |
00008730  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 f4  |               .|
00008740  20 70 72 6f 76 69 64 65  64 20 62 79 20 61 20 6e  | provided by a n|
00008750  6f 72 6d 61 6c 20 6d 6f  64 75 6c 65 2e 0d 23 64  |ormal module..#d|
00008760  45 f4 20 57 65 20 61 72  65 20 61 62 6f 75 74 20  |E. We are about |
00008770  74 6f 20 62 75 69 6c 64  20 74 68 65 20 69 6e 64  |to build the ind|
00008780  65 78 20 6d 65 6e 75 20  69 6e 64 69 72 65 63 74  |ex menu indirect|
00008790  65 64 20 64 61 74 61 20  73 74 72 75 63 74 75 72  |ed data structur|
000087a0  65 2e 0d 23 6e 4d f4 20  54 68 69 73 20 73 74 72  |e..#nM. This str|
000087b0  75 63 74 75 72 65 20 77  69 6c 6c 20 73 74 6f 72  |ucture will stor|
000087c0  65 20 74 68 65 20 6d 65  6e 75 20 63 6f 6e 74 65  |e the menu conte|
000087d0  6e 74 73 20 61 6e 64 20  69 6e 66 6f 72 6d 61 74  |nts and informat|
000087e0  69 6f 6e 20 66 6f 72 20  6f 70 65 6e 69 6e 67 0d  |ion for opening.|
000087f0  23 78 43 f4 20 74 68 65  20 69 6e 64 65 78 20 77  |#xC. the index w|
00008800  69 6e 64 6f 77 20 28 69  2e 65 2e 20 6e 75 6d 62  |indow (i.e. numb|
00008810  65 72 20 6f 66 20 53 57  49 73 20 66 6f 72 20 64  |er of SWIs for d|
00008820  65 70 74 68 20 63 61 6c  63 75 6c 61 74 69 6f 6e  |epth calculation|
00008830  29 2e 0d 23 82 4d f4 20  57 65 20 77 61 6e 74 20  |)..#.M. We want |
00008840  33 32 20 62 79 74 65 73  20 66 6f 72 20 65 61 63  |32 bytes for eac|
00008850  68 20 6d 6f 64 75 6c 65  3a 20 31 20 66 6f 72 20  |h module: 1 for |
00008860  74 68 65 20 6e 75 6d 62  65 72 20 6f 66 20 53 57  |the number of SW|
00008870  49 73 20 28 6d 61 78 69  6d 75 6d 20 61 6e 79 0d  |Is (maximum any.|
00008880  23 8c 46 f4 20 6d 6f 64  75 6c 65 20 63 61 6e 20  |#.F. module can |
00008890  68 61 76 65 20 69 73 20  36 34 29 3b 20 34 20 66  |have is 64); 4 f|
000088a0  6f 72 20 74 68 65 20 62  61 73 65 20 6e 75 6d 62  |or the base numb|
000088b0  65 72 20 6f 66 20 74 68  65 20 6d 6f 64 75 6c 65  |er of the module|
000088c0  3b 20 61 6e 64 0d 23 96  45 f4 20 32 37 20 66 6f  |; and.#.E. 27 fo|
000088d0  72 20 74 68 65 20 6d 6f  64 75 6c 65 20 74 69 74  |r the module tit|
000088e0  6c 65 20 73 74 72 69 6e  67 20 74 6f 20 67 6f 20  |le string to go |
000088f0  69 6e 74 6f 20 74 68 65  20 6d 65 6e 75 2e 20 4e  |into the menu. N|
00008900  42 20 32 37 20 69 73 20  61 6e 0d 23 a0 4b f4 20  |B 27 is an.#.K. |
00008910  61 72 62 69 74 72 61 72  79 20 6d 61 78 69 6d 75  |arbitrary maximu|
00008920  6d 3b 20 68 6f 77 65 76  65 72 2c 20 74 68 65 20  |m; however, the |
00008930  74 77 6f 20 6d 6f 64 75  6c 65 73 20 49 6e 74 65  |two modules Inte|
00008940  72 6e 61 74 69 6f 6e 61  6c 4b 65 79 62 6f 61 72  |rnationalKeyboar|
00008950  64 20 61 6e 64 0d 23 aa  4e f4 20 4c 61 73 65 72  |d and.#.N. Laser|
00008960  44 69 72 65 63 74 43 6f  6e 74 72 6f 6c 6c 65 72  |DirectController|
00008970  20 62 6f 74 68 20 72 65  71 75 69 72 65 20 32 31  | both require 21|
00008980  20 63 68 61 72 61 63 74  65 72 73 2c 20 73 6f 20  | characters, so |
00008990  77 65 20 6d 61 79 20 61  73 20 77 65 6c 6c 20 66  |we may as well f|
000089a0  69 6c 6c 0d 23 b4 4b f4  20 75 70 20 33 32 20 62  |ill.#.K. up 32 b|
000089b0  79 74 65 73 20 77 69 74  68 20 74 68 69 73 20 6d  |ytes with this m|
000089c0  75 63 68 20 73 70 61 63  65 20 70 6c 75 73 20 61  |uch space plus a|
000089d0  20 6c 69 74 74 6c 65 20  65 78 74 72 61 20 74 6f  | little extra to|
000089e0  20 62 65 20 73 61 66 65  20 28 69 2e 65 2e 0d 23  | be safe (i.e..#|
000089f0  be 44 f4 20 74 69 74 6c  65 20 6c 65 6e 67 74 68  |.D. title length|
00008a00  20 69 73 20 6d 61 78 69  6d 75 6d 20 32 36 20 63  | is maximum 26 c|
00008a10  68 61 72 61 63 74 65 72  73 20 70 6c 75 73 20 61  |haracters plus a|
00008a20  20 63 61 72 72 69 61 67  65 20 72 65 74 75 72 6e  | carriage return|
00008a30  29 2e 0d 23 c8 2d f4 20  53 75 6d 6d 61 72 79 3a  |)..#.-. Summary:|
00008a40  20 4d 6f 64 44 61 74 61  53 74 72 75 63 20 20 4c  | ModDataStruc  L|
00008a50  65 6e 67 74 68 20 20 43  6f 6e 74 65 6e 74 73 0d  |ength  Contents.|
00008a60  23 d2 3d f4 20 20 20 20  20 20 20 20 20 20 20 20  |#.=.            |
00008a70  20 20 20 20 20 20 20 20  2b 30 20 20 20 20 20 20  |        +0      |
00008a80  20 31 20 20 4e 75 6d 62  65 72 20 6f 66 20 53 57  | 1  Number of SW|
00008a90  49 73 20 69 6e 20 6d 6f  64 75 6c 65 0d 23 dc 30  |Is in module.#.0|
00008aa0  f4 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
00008ab0  20 20 20 20 20 2b 31 20  20 20 20 20 20 20 34 20  |     +1       4 |
00008ac0  20 4d 6f 64 75 6c 65 20  62 61 73 65 0d 23 e6 4a  | Module base.#.J|
00008ad0  f4 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
00008ae0  20 20 20 20 20 2b 35 20  20 20 20 20 20 32 37 20  |     +5      27 |
00008af0  20 4d 6f 64 75 6c 65 20  74 69 74 6c 65 20 28 6d  | Module title (m|
00008b00  61 78 2e 20 32 36 20 63  68 61 72 73 20 2b 20 43  |ax. 26 chars + C|
00008b10  48 52 24 31 33 29 0d 23  f0 07 20 20 3a 0d 23 fa  |HR$13).#..  :.#.|
00008b20  52 f4 20 49 6e 20 74 68  65 20 6e 65 78 74 20 6c  |R. In the next l|
00008b30  69 6e 65 20 74 68 65 20  27 32 38 2b 32 34 2b 28  |ine the '28+24+(|
00008b40  32 34 2a 54 6f 74 61 6c  4d 6f 64 75 6c 65 73 29  |24*TotalModules)|
00008b50  27 20 69 73 20 66 6f 72  20 74 68 65 20 69 6e 64  |' is for the ind|
00008b60  65 78 20 6d 65 6e 75 20  69 74 73 65 6c 66 2e 0d  |ex menu itself..|
00008b70  24 04 41 52 65 71 75 69  72 65 64 4d 65 6d 3d 4d  |$.ARequiredMem=M|
00008b80  69 6e 53 69 7a 65 2b 28  33 32 2a 54 6f 74 61 6c  |inSize+(32*Total|
00008b90  4d 6f 64 75 6c 65 73 29  2b 32 38 2b 32 34 2b 28  |Modules)+28+24+(|
00008ba0  32 34 2a 54 6f 74 61 6c  4d 6f 64 75 6c 65 73 29  |24*TotalModules)|
00008bb0  0d 24 0e 07 20 20 3a 0d  24 18 26 e7 20 a4 41 6c  |.$..  :.$.&. .Al|
00008bc0  6c 6f 63 61 74 65 4d 65  6d 6f 72 79 28 52 65 71  |locateMemory(Req|
00008bd0  75 69 72 65 64 4d 65 6d  29 3d 30 20 8c 0d 24 22  |uiredMem)=0 ..$"|
00008be0  3f 20 20 e7 20 49 6e 64  65 78 3c 3e 2d 31 20 8c  |?  . Index<>-1 .|
00008bf0  20 42 6c 6f 63 6b 21 30  3d 49 6e 64 65 78 3a c8  | Block!0=Index:.|
00008c00  99 20 22 57 69 6d 70 5f  44 65 6c 65 74 65 57 69  |. "Wimp_DeleteWi|
00008c10  6e 64 6f 77 22 2c 2c 42  6c 6f 63 6b 0d 24 2c 37  |ndow",,Block.$,7|
00008c20  20 20 49 6e 64 65 78 3d  2d 31 3a f4 20 4d 61 72  |  Index=-1:. Mar|
00008c30  6b 20 49 6e 64 65 78 20  77 69 6e 64 6f 77 20 61  |k Index window a|
00008c40  73 20 27 6e 6f 74 20 79  65 74 20 63 72 65 61 74  |s 'not yet creat|
00008c50  65 64 27 0d 24 36 54 20  20 85 20 39 39 39 39 2c  |ed'.$6T  . 9999,|
00008c60  22 55 6e 61 62 6c 65 20  74 6f 20 63 6c 61 69 6d  |"Unable to claim|
00008c70  20 65 6e 6f 75 67 68 20  6d 65 6d 6f 72 79 20 66  | enough memory f|
00008c80  6f 72 20 74 68 65 20 69  6e 64 65 78 20 6d 65 6e  |or the index men|
00008c90  75 20 61 6e 64 20 61 73  73 6f 63 69 61 74 65 64  |u and associated|
00008ca0  20 64 61 74 61 2e 22 0d  24 40 05 cd 0d 24 4a 07  | data.".$@...$J.|
00008cb0  20 20 3a 0d 24 54 18 4d  6f 64 44 61 74 61 53 74  |  :.$T.ModDataSt|
00008cc0  72 75 63 3d 53 6c 6f 74  45 6e 64 0d 24 5e 22 f4  |ruc=SlotEnd.$^".|
00008cd0  20 46 69 72 73 74 20 73  74 61 72 74 20 6f 66 66  | First start off|
00008ce0  20 77 69 74 68 20 74 68  65 20 4f 53 3a 0d 24 68  | with the OS:.$h|
00008cf0  1e 4e 61 6d 65 50 6f 69  6e 74 65 72 3d 4d 6f 64  |.NamePointer=Mod|
00008d00  44 61 74 61 53 74 72 75  63 2b 35 0d 24 72 19 24  |DataStruc+5.$r.$|
00008d10  4e 61 6d 65 50 6f 69 6e  74 65 72 3d 22 4f 53 22  |NamePointer="OS"|
00008d20  2b bd 31 33 0d 24 7c 14  4d 6f 64 44 61 74 61 53  |+.13.$|.ModDataS|
00008d30  74 72 75 63 21 31 3d 30  0d 24 86 0f 54 6f 74 61  |truc!1=0.$..Tota|
00008d40  6c 53 57 49 73 3d 30 0d  24 90 07 20 20 3a 0d 24  |lSWIs=0.$..  :.$|
00008d50  9a 15 c8 99 20 22 48 6f  75 72 67 6c 61 73 73 5f  |.... "Hourglass_|
00008d60  4f 6e 22 0d 24 a4 1f c8  99 20 22 48 6f 75 72 67  |On".$.... "Hourg|
00008d70  6c 61 73 73 5f 50 65 72  63 65 6e 74 61 67 65 22  |lass_Percentage"|
00008d80  2c 30 0d 24 ae 07 20 20  3a 0d 24 b8 36 f4 20 4f  |,0.$..  :.$.6. O|
00008d90  53 20 53 57 49 73 20 61  72 65 20 6e 75 6d 62 65  |S SWIs are numbe|
00008da0  72 65 64 20 30 2d 32 35  35 2c 20 74 68 65 6e 20  |red 0-255, then |
00008db0  74 68 65 20 73 65 74 20  32 35 36 2d 35 31 31 0d  |the set 256-511.|
00008dc0  24 c2 30 f4 20 61 72 65  20 74 68 65 20 76 61 72  |$.0. are the var|
00008dd0  69 6f 75 73 20 70 65 72  6d 75 74 61 74 69 6f 6e  |ious permutation|
00008de0  73 20 6f 66 20 4f 53 5f  57 72 69 74 65 49 2e 0d  |s of OS_WriteI..|
00008df0  24 cc 34 f4 20 57 65 27  72 65 20 67 6f 69 6e 67  |$.4. We're going|
00008e00  20 74 6f 20 69 67 6e 6f  72 65 20 61 6c 6c 20 62  | to ignore all b|
00008e10  75 74 20 74 68 65 20 66  69 72 73 74 20 6f 66 20  |ut the first of |
00008e20  74 68 65 0d 24 d6 33 f4  20 4f 53 5f 57 72 69 74  |the.$.3. OS_Writ|
00008e30  65 49 20 53 57 49 73 2c  20 61 6e 64 20 6d 61 6b  |eI SWIs, and mak|
00008e40  65 20 61 20 67 65 6e 65  72 61 6c 20 72 65 66 65  |e a general refe|
00008e50  72 65 6e 63 65 2e 0d 24  e0 0f e3 20 4e 3d 30 20  |rence..$... N=0 |
00008e60  b8 20 32 35 36 0d 24 ea  21 20 20 41 24 3d a4 53  |. 256.$.!  A$=.S|
00008e70  57 49 4e 61 6d 65 28 4e  2c 42 75 66 66 65 72 2c  |WIName(N,Buffer,|
00008e80  32 35 36 2c 4e 29 0d 24  f4 1d 20 20 e7 20 41 24  |256,N).$..  . A$|
00008e90  3c 3e 22 22 20 8c 20 54  6f 74 61 6c 53 57 49 73  |<>"" . TotalSWIs|
00008ea0  2b 3d 31 0d 24 fe 05 ed  0d 25 08 07 20 20 3a 0d  |+=1.$....%..  :.|
00008eb0  25 12 1c 4d 6f 64 44 61  74 61 53 74 72 75 63 3f  |%..ModDataStruc?|
00008ec0  30 3d 54 6f 74 61 6c 53  57 49 73 0d 25 1c 07 20  |0=TotalSWIs.%.. |
00008ed0  20 3a 0d 25 26 4a f4 20  4e 6f 77 20 67 6f 20 74  | :.%&J. Now go t|
00008ee0  68 72 6f 75 67 68 20 61  6c 6c 20 74 68 65 20 6f  |hrough all the o|
00008ef0  74 68 65 72 20 6d 6f 64  75 6c 65 73 20 77 68 69  |ther modules whi|
00008f00  63 68 20 61 72 65 20 6c  6f 61 64 65 64 20 61 74  |ch are loaded at|
00008f10  20 74 68 65 20 6d 6f 6d  65 6e 74 3a 0d 25 30 47  | the moment:.%0G|
00008f20  4d 6f 64 4e 75 6d 3d 30  3a 4d 6f 64 42 61 73 65  |ModNum=0:ModBase|
00008f30  3d 30 3a 53 57 49 43 68  75 6e 6b 3d 30 3a 50 72  |=0:SWIChunk=0:Pr|
00008f40  65 66 69 78 24 3d 22 22  3a 4d 6f 64 4e 61 6d 65  |efix$="":ModName|
00008f50  24 3d 22 22 3a 49 6e 64  65 78 43 6f 75 6e 74 65  |$="":IndexCounte|
00008f60  72 3d 30 0d 25 3a 3c c8  95 20 a4 4e 65 78 74 53  |r=0.%:<.. .NextS|
00008f70  57 49 4d 6f 64 28 4d 6f  64 4e 75 6d 2c 4d 6f 64  |WIMod(ModNum,Mod|
00008f80  42 61 73 65 2c 53 57 49  43 68 75 6e 6b 2c 50 72  |Base,SWIChunk,Pr|
00008f90  65 66 69 78 24 2c 4d 6f  64 4e 61 6d 65 24 29 0d  |efix$,ModName$).|
00008fa0  25 44 2c 20 20 f4 20 57  65 20 68 61 76 65 6e 27  |%D,  . We haven'|
00008fb0  74 20 72 75 6e 20 6f 75  74 20 6f 66 20 6d 6f 64  |t run out of mod|
00008fc0  75 6c 65 73 20 79 65 74  2e 2e 2e 0d 25 4e 15 20  |ules yet....%N. |
00008fd0  20 49 6e 64 65 78 43 6f  75 6e 74 65 72 2b 3d 31  | IndexCounter+=1|
00008fe0  0d 25 58 3f 20 20 c8 99  20 22 48 6f 75 72 67 6c  |.%X?  .. "Hourgl|
00008ff0  61 73 73 5f 50 65 72 63  65 6e 74 61 67 65 22 2c  |ass_Percentage",|
00009000  28 31 30 30 2f 54 6f 74  61 6c 4d 6f 64 75 6c 65  |(100/TotalModule|
00009010  73 29 2a 49 6e 64 65 78  43 6f 75 6e 74 65 72 0d  |s)*IndexCounter.|
00009020  25 62 3d 20 20 3f 28 4d  6f 64 44 61 74 61 53 74  |%b=  ?(ModDataSt|
00009030  72 75 63 2b 28 33 32 2a  49 6e 64 65 78 43 6f 75  |ruc+(32*IndexCou|
00009040  6e 74 65 72 29 2b 30 29  3d a4 43 6f 75 6e 74 53  |nter)+0)=.CountS|
00009050  57 49 73 28 4d 6f 64 42  61 73 65 29 0d 25 6c 31  |WIs(ModBase).%l1|
00009060  20 20 21 28 4d 6f 64 44  61 74 61 53 74 72 75 63  |  !(ModDataStruc|
00009070  2b 28 33 32 2a 49 6e 64  65 78 43 6f 75 6e 74 65  |+(32*IndexCounte|
00009080  72 29 2b 31 29 3d 4d 6f  64 42 61 73 65 0d 25 76  |r)+1)=ModBase.%v|
00009090  3b 20 20 24 28 4d 6f 64  44 61 74 61 53 74 72 75  |;  $(ModDataStru|
000090a0  63 2b 28 33 32 2a 49 6e  64 65 78 43 6f 75 6e 74  |c+(32*IndexCount|
000090b0  65 72 29 2b 35 29 3d c0  4d 6f 64 4e 61 6d 65 24  |er)+5)=.ModName$|
000090c0  2c 32 36 29 2b bd 31 33  0d 25 80 05 ce 0d 25 8a  |,26)+.13.%....%.|
000090d0  07 20 20 3a 0d 25 94 43  f4 20 57 65 20 6e 6f 77  |.  :.%.C. We now|
000090e0  20 68 61 76 65 20 61 6c  6c 20 74 68 65 20 72 65  | have all the re|
000090f0  6c 65 76 61 6e 74 20 6d  6f 64 75 6c 65 73 20 73  |levant modules s|
00009100  74 6f 72 65 64 20 69 6e  20 74 68 65 20 64 61 74  |tored in the dat|
00009110  61 20 61 72 65 61 2e 0d  25 9e 3b f4 20 48 6f 77  |a area..%.;. How|
00009120  65 76 65 72 2c 20 74 68  65 20 4f 53 20 6c 69 73  |ever, the OS lis|
00009130  74 73 20 74 68 65 6d 20  69 6e 20 61 20 76 65 72  |ts them in a ver|
00009140  79 20 75 6e 68 65 6c 70  66 75 6c 20 6f 72 64 65  |y unhelpful orde|
00009150  72 2e 0d 25 a8 40 f4 20  49 74 20 77 6f 75 6c 64  |r..%.@. It would|
00009160  20 62 65 20 6d 75 63 68  20 6e 69 63 65 72 20 69  | be much nicer i|
00009170  66 20 74 68 65 79 20 77  65 72 65 20 6c 69 73 74  |f they were list|
00009180  65 64 20 61 6c 70 68 61  62 65 74 69 63 61 6c 6c  |ed alphabeticall|
00009190  79 2c 0d 25 b2 43 f4 20  73 6f 20 77 65 27 6c 6c  |y,.%.C. so we'll|
000091a0  20 6e 6f 77 20 73 6f 72  74 20 74 68 65 6d 20 69  | now sort them i|
000091b0  6e 74 6f 20 61 6c 70 68  61 62 65 74 69 63 61 6c  |nto alphabetical|
000091c0  20 6f 72 64 65 72 20 75  73 69 6e 67 20 61 20 73  | order using a s|
000091d0  69 6d 70 6c 65 0d 25 bc  19 f4 20 62 75 62 62 6c  |imple.%... bubbl|
000091e0  65 2d 73 6f 72 74 20 6d  65 74 68 6f 64 3a 0d 25  |e-sort method:.%|
000091f0  c6 07 20 20 3a 0d 25 d0  1a e3 20 4e 3d 31 20 b8  |..  :.%... N=1 .|
00009200  20 54 6f 74 61 6c 4d 6f  64 75 6c 65 73 2d 31 0d  | TotalModules-1.|
00009210  25 da 1c 20 20 e3 20 4d  3d 4e 2b 31 20 b8 20 54  |%..  . M=N+1 . T|
00009220  6f 74 61 6c 4d 6f 64 75  6c 65 73 0d 25 e4 45 20  |otalModules.%.E |
00009230  20 20 20 e7 20 24 28 4d  6f 64 44 61 74 61 53 74  |   . $(ModDataSt|
00009240  72 75 63 2b 28 33 32 2a  28 4e 2d 31 29 29 2b 35  |ruc+(32*(N-1))+5|
00009250  29 3e 24 28 4d 6f 64 44  61 74 61 53 74 72 75 63  |)>$(ModDataStruc|
00009260  2b 28 33 32 2a 28 4d 2d  31 29 29 2b 35 29 20 8c  |+(32*(M-1))+5) .|
00009270  0d 25 ee 46 20 20 20 20  20 20 c8 94 20 3f 28 4d  |.%.F      .. ?(M|
00009280  6f 64 44 61 74 61 53 74  72 75 63 2b 28 33 32 2a  |odDataStruc+(32*|
00009290  28 4e 2d 31 29 29 2b 30  29 2c 3f 28 4d 6f 64 44  |(N-1))+0),?(ModD|
000092a0  61 74 61 53 74 72 75 63  2b 28 33 32 2a 28 4d 2d  |ataStruc+(32*(M-|
000092b0  31 29 29 2b 30 29 0d 25  f8 46 20 20 20 20 20 20  |1))+0).%.F      |
000092c0  c8 94 20 21 28 4d 6f 64  44 61 74 61 53 74 72 75  |.. !(ModDataStru|
000092d0  63 2b 28 33 32 2a 28 4e  2d 31 29 29 2b 31 29 2c  |c+(32*(N-1))+1),|
000092e0  21 28 4d 6f 64 44 61 74  61 53 74 72 75 63 2b 28  |!(ModDataStruc+(|
000092f0  33 32 2a 28 4d 2d 31 29  29 2b 31 29 0d 26 02 46  |32*(M-1))+1).&.F|
00009300  20 20 20 20 20 20 c8 94  20 24 28 4d 6f 64 44 61  |      .. $(ModDa|
00009310  74 61 53 74 72 75 63 2b  28 33 32 2a 28 4e 2d 31  |taStruc+(32*(N-1|
00009320  29 29 2b 35 29 2c 24 28  4d 6f 64 44 61 74 61 53  |))+5),$(ModDataS|
00009330  74 72 75 63 2b 28 33 32  2a 28 4d 2d 31 29 29 2b  |truc+(32*(M-1))+|
00009340  35 29 0d 26 0c 09 20 20  20 20 cd 0d 26 16 07 20  |5).&..    ..&.. |
00009350  20 ed 0d 26 20 05 ed 0d  26 2a 07 20 20 3a 0d 26  | ..& ...&*.  :.&|
00009360  34 2a f4 20 4e 6f 77 20  77 65 20 77 61 6e 74 20  |4*. Now we want |
00009370  74 6f 20 62 75 69 6c 64  20 74 68 65 20 69 6e 64  |to build the ind|
00009380  65 78 20 6d 65 6e 75 3a  0d 26 3e 2c 49 6e 64 65  |ex menu:.&>,Inde|
00009390  78 4d 65 6e 75 3d 4d 6f  64 44 61 74 61 53 74 72  |xMenu=ModDataStr|
000093a0  75 63 2b 28 33 32 2a 54  6f 74 61 6c 4d 6f 64 75  |uc+(32*TotalModu|
000093b0  6c 65 73 29 0d 26 48 34  4d 25 3d 49 6e 64 65 78  |les).&H4M%=Index|
000093c0  4d 65 6e 75 3a 49 6e 64  65 78 4d 65 6e 75 57 69  |Menu:IndexMenuWi|
000093d0  64 74 68 3d a9 28 22 52  65 2d 73 63 61 6e 20 6d  |dth=.("Re-scan m|
000093e0  6f 64 75 6c 65 73 22 29  0d 26 52 43 f2 4d 65 6e  |odules").&RC.Men|
000093f0  75 49 6e 69 74 28 49 6e  64 65 78 4d 65 6e 75 54  |uInit(IndexMenuT|
00009400  69 74 6c 65 29 3a f4 20  49 6e 69 74 69 61 6c 69  |itle):. Initiali|
00009410  73 65 73 20 50 25 20 61  73 20 6d 65 6e 75 20 69  |ses P% as menu i|
00009420  74 65 6d 20 70 6f 69 6e  74 65 72 0d 26 5c 54 41  |tem pointer.&\TA|
00009430  24 3d 22 52 65 2d 73 63  61 6e 20 6d 6f 64 75 6c  |$="Re-scan modul|
00009440  65 73 22 3a f2 4d 65 6e  75 49 74 65 6d 28 41 24  |es":.MenuItem(A$|
00009450  2c 32 2c 2d 31 29 3a 49  6e 64 69 72 65 63 74 4d  |,2,-1):IndirectM|
00009460  65 6e 75 54 65 78 74 4f  66 66 73 65 74 50 6f 69  |enuTextOffsetPoi|
00009470  6e 74 65 72 2d 3d 28 a9  28 41 24 29 2b 31 29 0d  |nter-=(.(A$)+1).|
00009480  26 66 4e f4 20 54 68 65  20 6c 69 6e 65 20 61 62  |&fN. The line ab|
00009490  6f 76 65 20 6d 6f 76 65  73 20 74 68 65 20 6d 65  |ove moves the me|
000094a0  6e 75 20 69 6e 64 69 72  65 63 74 20 74 65 78 74  |nu indirect text|
000094b0  20 70 6f 69 6e 74 65 72  20 62 61 63 6b 20 74 6f  | pointer back to|
000094c0  20 74 68 65 20 73 74 61  72 74 20 6f 66 0d 26 70  | the start of.&p|
000094d0  4b f4 20 74 68 65 20 73  74 72 69 6e 67 20 66 6f  |K. the string fo|
000094e0  72 20 74 68 69 73 20 6d  65 6e 75 20 69 74 65 6d  |r this menu item|
000094f0  2e 20 54 68 65 20 72 65  61 73 6f 6e 20 66 6f 72  |. The reason for|
00009500  20 74 68 69 73 20 69 73  20 74 68 61 74 20 72 65  | this is that re|
00009510  62 75 69 6c 64 69 6e 67  0d 26 7a 4a f4 20 74 68  |building.&zJ. th|
00009520  69 73 20 6d 65 6e 75 20  77 6f 75 6c 64 20 6b 65  |is menu would ke|
00009530  65 70 20 61 64 64 69 6e  67 20 74 68 69 73 20 69  |ep adding this i|
00009540  74 65 6d 20 69 6e 74 6f  20 74 68 65 20 62 75 66  |tem into the buf|
00009550  66 65 72 20 75 6e 74 69  6c 20 69 74 20 6f 76 65  |fer until it ove|
00009560  72 2d 0d 26 84 4a f4 20  66 6c 6f 77 65 64 2e 20  |r-.&.J. flowed. |
00009570  53 69 6e 63 65 20 74 68  69 73 20 69 73 20 74 68  |Since this is th|
00009580  65 20 6c 61 73 74 20 6d  65 6e 75 20 77 65 20 62  |e last menu we b|
00009590  75 69 6c 64 20 28 61 6e  64 20 74 68 65 20 6f 6e  |uild (and the on|
000095a0  6c 79 20 6f 6e 65 20 77  68 69 63 68 0d 26 8e 3c  |ly one which.&.<|
000095b0  f4 20 77 65 20 72 65 62  75 69 6c 64 29 2c 20 69  |. we rebuild), i|
000095c0  74 27 73 20 73 61 66 65  20 74 6f 20 6d 65 73 73  |t's safe to mess|
000095d0  20 61 62 6f 75 74 20 77  69 74 68 20 74 68 65 20  | about with the |
000095e0  70 6f 69 6e 74 65 72 2e  0d 26 98 1a e3 20 4e 3d  |pointer..&... N=|
000095f0  30 20 b8 20 54 6f 74 61  6c 4d 6f 64 75 6c 65 73  |0 . TotalModules|
00009600  2d 31 0d 26 a2 17 20 20  f4 20 4d 61 6b 65 20 6d  |-1.&..  . Make m|
00009610  65 6e 75 20 69 74 65 6d  3a 0d 26 ac 27 20 20 4e  |enu item:.&.'  N|
00009620  61 6d 65 50 6f 69 6e 74  65 72 3d 4d 6f 64 44 61  |amePointer=ModDa|
00009630  74 61 53 74 72 75 63 2b  28 33 32 2a 4e 29 2b 35  |taStruc+(32*N)+5|
00009640  0d 26 b6 30 20 20 50 25  21 30 3d 30 3a 50 25 21  |.&.0  P%!0=0:P%!|
00009650  34 3d 2d 31 3a 50 25 21  38 3d 26 30 37 30 30 33  |4=-1:P%!8=&07003|
00009660  31 32 31 3a f4 20 49 6e  64 69 72 65 63 74 65 64  |121:. Indirected|
00009670  0d 26 c0 2e 20 20 50 25  21 31 32 3d 4e 61 6d 65  |.&..  P%!12=Name|
00009680  50 6f 69 6e 74 65 72 3a  50 25 21 31 36 3d 30 3a  |Pointer:P%!16=0:|
00009690  50 25 21 32 30 3d 30 3a  50 25 2b 3d 32 34 0d 26  |P%!20=0:P%+=24.&|
000096a0  ca 63 20 20 e7 20 49 6e  64 65 78 4d 65 6e 75 57  |.c  . IndexMenuW|
000096b0  69 64 74 68 3c a9 28 24  4e 61 6d 65 50 6f 69 6e  |idth<.($NamePoin|
000096c0  74 65 72 29 20 8c 20 49  6e 64 65 78 4d 65 6e 75  |ter) . IndexMenu|
000096d0  57 69 64 74 68 3d a9 28  24 4e 61 6d 65 50 6f 69  |Width=.($NamePoi|
000096e0  6e 74 65 72 29 3a 4d 25  21 31 36 3d 28 49 6e 64  |nter):M%!16=(Ind|
000096f0  65 78 4d 65 6e 75 57 69  64 74 68 2b 31 29 2a 31  |exMenuWidth+1)*1|
00009700  36 0d 26 d4 05 ed 0d 26  de 2d 50 25 2d 3d 32 34  |6.&....&.-P%-=24|
00009710  3a 50 25 21 30 3d 31 32  38 3a f4 20 4d 61 72 6b  |:P%!0=128:. Mark|
00009720  20 6c 61 73 74 20 69 74  65 6d 20 61 73 20 66 69  | last item as fi|
00009730  6e 61 6c 0d 26 e8 49 e7  20 77 69 6d 70 3e 3d 33  |nal.&.I. wimp>=3|
00009740  31 30 20 8c 20 4d 25 21  32 38 3d 28 28 28 4d 25  |10 . M%!28=(((M%|
00009750  21 32 38 29 20 80 20 ac  20 32 35 36 29 20 82 20  |!28) . . 256) . |
00009760  32 35 36 29 3a f4 20 49  6e 64 69 72 65 63 74 65  |256):. Indirecte|
00009770  64 20 6d 65 6e 75 20 74  69 74 6c 65 0d 26 f2 44  |d menu title.&.D|
00009780  f4 20 54 68 61 74 27 73  20 62 75 69 6c 74 20 74  |. That's built t|
00009790  68 65 20 6d 65 6e 75 3b  20 6e 6f 77 20 61 74 74  |he menu; now att|
000097a0  61 63 68 20 69 74 73 20  68 61 6e 64 6c 65 20 74  |ach its handle t|
000097b0  6f 20 74 68 65 20 6d 61  69 6e 20 6d 65 6e 75 3a  |o the main menu:|
000097c0  0d 26 fc 20 4d 61 69 6e  4d 65 6e 75 21 28 32 38  |.&. MainMenu!(28|
000097d0  2b 32 34 2b 34 29 3d 49  6e 64 65 78 4d 65 6e 75  |+24+4)=IndexMenu|
000097e0  0d 27 06 1c f2 54 69 63  6b 4d 65 6e 75 28 49 6e  |.'...TickMenu(In|
000097f0  64 65 78 4d 65 6e 75 2c  31 2c b9 29 0d 27 10 16  |dexMenu,1,.).'..|
00009800  c8 99 20 22 48 6f 75 72  67 6c 61 73 73 5f 4f 66  |.. "Hourglass_Of|
00009810  66 22 0d 27 1a 14 53 63  61 6e 6e 65 64 4d 6f 64  |f".'..ScannedMod|
00009820  75 6c 65 73 3d b9 0d 27  24 21 49 6e 64 65 78 3d  |ules=..'$!Index=|
00009830  a4 43 72 65 61 74 65 49  6e 64 65 78 57 69 6e 64  |.CreateIndexWind|
00009840  6f 77 28 30 2c b9 29 0d  27 2e 05 e1 0d 27 38 05  |ow(0,.).'....'8.|
00009850  3a 0d 27 42 2c dd 20 a4  43 72 65 61 74 65 49 6e  |:.'B,. .CreateIn|
00009860  64 65 78 57 69 6e 64 6f  77 28 4d 6f 64 75 6c 65  |dexWindow(Module|
00009870  2c 52 65 73 65 74 53 63  72 6f 6c 6c 29 0d 27 4c  |,ResetScroll).'L|
00009880  1b c8 99 20 22 48 6f 75  72 67 6c 61 73 73 5f 53  |... "Hourglass_S|
00009890  74 61 72 74 22 2c 35 30  0d 27 56 39 f4 20 46 69  |tart",50.'V9. Fi|
000098a0  72 73 74 20 64 65 6c 65  74 65 20 74 68 65 20 6f  |rst delete the o|
000098b0  6c 64 20 77 69 6e 64 6f  77 20 61 6e 64 20 72 65  |ld window and re|
000098c0  74 75 72 6e 20 75 73 65  64 20 6d 65 6d 6f 72 79  |turn used memory|
000098d0  3a 0d 27 60 07 20 20 3a  0d 27 6a 11 e7 20 49 6e  |:.'`.  :.'j.. In|
000098e0  64 65 78 3c 3e 2d 31 20  8c 0d 27 74 33 20 20 42  |dex<>-1 ..'t3  B|
000098f0  6c 6f 63 6b 21 30 3d 49  6e 64 65 78 3a c8 99 20  |lock!0=Index:.. |
00009900  22 57 69 6d 70 5f 47 65  74 57 69 6e 64 6f 77 53  |"Wimp_GetWindowS|
00009910  74 61 74 65 22 2c 2c 42  6c 6f 63 6b 0d 27 7e 2c  |tate",,Block.'~,|
00009920  20 20 53 63 72 6f 6c 6c  59 3d 42 6c 6f 63 6b 21  |  ScrollY=Block!|
00009930  32 34 3a 42 65 68 69 6e  64 57 69 6e 64 6f 77 3d  |24:BehindWindow=|
00009940  42 6c 6f 63 6b 21 32 38  0d 27 88 0c 20 20 4d 69  |Block!28.'..  Mi|
00009950  6e 58 3d 30 0d 27 92 3f  20 20 4d 61 78 59 3d a4  |nX=0.'.?  MaxY=.|
00009960  4d 6f 64 65 49 6e 66 6f  28 22 59 50 69 78 65 6c  |ModeInfo("YPixel|
00009970  73 22 2c 2d 31 29 2a 32  5e a4 4d 6f 64 65 49 6e  |s",-1)*2^.ModeIn|
00009980  66 6f 28 22 59 45 69 67  46 61 63 74 6f 72 22 2c  |fo("YEigFactor",|
00009990  2d 31 29 0d 27 9c 40 20  20 e7 20 58 50 6f 73 69  |-1).'.@  . XPosi|
000099a0  74 69 6f 6e 3d 2d 31 20  84 20 59 50 6f 73 69 74  |tion=-1 . YPosit|
000099b0  69 6f 6e 3d 2d 31 20 8c  20 4d 69 6e 58 3d 42 6c  |ion=-1 . MinX=Bl|
000099c0  6f 63 6b 21 34 3a 4d 61  78 59 3d 42 6c 6f 63 6b  |ock!4:MaxY=Block|
000099d0  21 31 36 0d 27 a6 23 20  20 c8 99 20 22 57 69 6d  |!16.'.#  .. "Wim|
000099e0  70 5f 44 65 6c 65 74 65  57 69 6e 64 6f 77 22 2c  |p_DeleteWindow",|
000099f0  2c 42 6c 6f 63 6b 0d 27  b0 0e 20 20 49 6e 64 65  |,Block.'..  Inde|
00009a00  78 3d 2d 31 0d 27 ba 1f  20 20 e7 20 52 65 73 65  |x=-1.'..  . Rese|
00009a10  74 53 63 72 6f 6c 6c 20  8c 20 53 63 72 6f 6c 6c  |tScroll . Scroll|
00009a20  59 3d 30 0d 27 c4 05 cc  0d 27 ce 1f 20 20 53 63  |Y=0.'....'..  Sc|
00009a30  72 6f 6c 6c 59 3d 30 3a  42 65 68 69 6e 64 57 69  |rollY=0:BehindWi|
00009a40  6e 64 6f 77 3d 2d 31 0d  27 d8 43 20 20 4d 69 6e  |ndow=-1.'.C  Min|
00009a50  58 3d 28 a4 4d 6f 64 65  49 6e 66 6f 28 22 58 50  |X=(.ModeInfo("XP|
00009a60  69 78 65 6c 73 22 2c 2d  31 29 2a 32 5e a4 4d 6f  |ixels",-1)*2^.Mo|
00009a70  64 65 49 6e 66 6f 28 22  58 45 69 67 46 61 63 74  |deInfo("XEigFact|
00009a80  6f 72 22 2c 2d 31 29 29  2f 36 0d 27 e2 7c 20 20  |or",-1))/6.'.|  |
00009a90  4d 61 78 59 3d 28 a4 4d  6f 64 65 49 6e 66 6f 28  |MaxY=(.ModeInfo(|
00009aa0  22 59 50 69 78 65 6c 73  22 2c 2d 31 29 2a 32 5e  |"YPixels",-1)*2^|
00009ab0  a4 4d 6f 64 65 49 6e 66  6f 28 22 59 45 69 67 46  |.ModeInfo("YEigF|
00009ac0  61 63 74 6f 72 22 2c 2d  31 29 29 2d 28 28 a4 4d  |actor",-1))-((.M|
00009ad0  6f 64 65 49 6e 66 6f 28  22 59 50 69 78 65 6c 73  |odeInfo("YPixels|
00009ae0  22 2c 2d 31 29 2a 32 5e  a4 4d 6f 64 65 49 6e 66  |",-1)*2^.ModeInf|
00009af0  6f 28 22 59 45 69 67 46  61 63 74 6f 72 22 2c 2d  |o("YEigFactor",-|
00009b00  31 29 29 2f 36 29 0d 27  ec 05 cd 0d 27 f6 36 49  |1))/6).'....'.6I|
00009b10  6e 64 69 72 65 63 74 49  63 6f 6e 42 61 73 65 3d  |ndirectIconBase=|
00009b20  49 6e 64 65 78 4d 65 6e  75 2b 32 38 2b 32 34 2b  |IndexMenu+28+24+|
00009b30  28 32 34 2a 54 6f 74 61  6c 4d 6f 64 75 6c 65 73  |(24*TotalModules|
00009b40  29 0d 28 00 41 52 65 71  75 69 72 65 64 4d 65 6d  |).(.ARequiredMem|
00009b50  3d 4d 69 6e 53 69 7a 65  2b 28 33 32 2a 54 6f 74  |=MinSize+(32*Tot|
00009b60  61 6c 4d 6f 64 75 6c 65  73 29 2b 32 38 2b 32 34  |alModules)+28+24|
00009b70  2b 28 32 34 2a 54 6f 74  61 6c 4d 6f 64 75 6c 65  |+(24*TotalModule|
00009b80  73 29 0d 28 0a 26 64 75  6d 6d 79 3d a4 41 6c 6c  |s).(.&dummy=.All|
00009b90  6f 63 61 74 65 4d 65 6d  6f 72 79 28 52 65 71 75  |ocateMemory(Requ|
00009ba0  69 72 65 64 4d 65 6d 29  0d 28 14 59 f4 20 4d 69  |iredMem).(.Y. Mi|
00009bb0  6e 69 6d 69 73 65 73 20  77 69 6d 70 73 6c 6f 74  |nimises wimpslot|
00009bc0  20 77 68 69 6c 73 74 20  70 72 65 73 65 72 76 69  | whilst preservi|
00009bd0  6e 67 20 50 52 4d 20 69  6e 64 65 78 20 66 69 6c  |ng PRM index fil|
00009be0  65 20 61 6e 64 20 6d 6f  64 75 6c 65 20 64 61 74  |e and module dat|
00009bf0  61 20 73 74 72 75 63 74  75 72 65 2f 6d 65 6e 75  |a structure/menu|
00009c00  2e 0d 28 1e 07 20 20 3a  0d 28 28 5a f4 20 4e 6f  |..(..  :.((Z. No|
00009c10  77 20 77 65 20 6e 65 65  64 20 74 6f 20 77 6f 72  |w we need to wor|
00009c20  6b 20 6f 75 74 20 68 6f  77 20 6d 75 63 68 20 69  |k out how much i|
00009c30  6e 64 69 72 65 63 74 65  64 20 73 70 61 63 65 20  |ndirected space |
00009c40  69 73 20 72 65 71 75 69  72 65 64 20 66 6f 72 20  |is required for |
00009c50  74 68 65 20 65 6e 74 69  72 65 20 77 69 6e 64 6f  |the entire windo|
00009c60  77 2e 0d 28 32 29 f4 20  54 68 65 20 6c 61 62 65  |w..(2). The labe|
00009c70  6c 20 69 63 6f 6e 73 20  61 74 20 74 68 65 20 74  |l icons at the t|
00009c80  6f 70 20 72 65 71 75 69  72 65 3a 0d 28 3c 38 f4  |op require:.(<8.|
00009c90  20 20 20 53 57 49 20 43  61 6c 6c 20 20 3a 20 20  |   SWI Call  :  |
00009ca0  39 20 62 79 74 65 73 20  74 65 78 74 20 20 3a 20  |9 bytes text  : |
00009cb0  20 33 20 62 79 74 65 73  20 76 61 6c 69 64 61 74  | 3 bytes validat|
00009cc0  69 6f 6e 0d 28 46 38 f4  20 20 20 53 57 49 20 26  |ion.(F8.   SWI &|
00009cd0  20 20 20 20 20 3a 20 20  36 20 62 79 74 65 73 20  |     :  6 bytes |
00009ce0  74 65 78 74 20 20 3a 20  20 33 20 62 79 74 65 73  |text  :  3 bytes|
00009cf0  20 76 61 6c 69 64 61 74  69 6f 6e 0d 28 50 38 f4  | validation.(P8.|
00009d00  20 20 20 50 52 4d 20 50  61 67 65 20 20 3a 20 20  |   PRM Page  :  |
00009d10  39 20 62 79 74 65 73 20  74 65 78 74 20 20 3a 20  |9 bytes text  : |
00009d20  20 33 20 62 79 74 65 73  20 76 61 6c 69 64 61 74  | 3 bytes validat|
00009d30  69 6f 6e 0d 28 5a 38 f4  20 20 20 20 20 20 20 20  |ion.(Z8.        |
00009d40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00009d50  20 20 20 20 20 20 20 20  20 20 20 3d 20 33 33 20  |           = 33 |
00009d60  62 79 74 65 73 20 74 6f  74 61 6c 0d 28 64 29 f4  |bytes total.(d).|
00009d70  20 54 68 65 20 72 65 73  74 20 6f 66 20 74 68 65  | The rest of the|
00009d80  20 77 69 6e 64 6f 77 20  63 6f 6e 73 69 73 74 73  | window consists|
00009d90  20 6f 66 3a 0d 28 6e 2e  f4 20 28 31 29 3a 20 53  | of:.(n.. (1): S|
00009da0  57 49 20 70 72 65 66 69  78 20 6c 61 62 65 6c 20  |WI prefix label |
00009db0  61 6e 64 20 33 44 20 62  6f 72 64 65 72 3b 20 61  |and 3D border; a|
00009dc0  6e 64 0d 28 78 30 f4 20  28 32 29 3a 20 4f 6e 65  |nd.(x0. (2): One|
00009dd0  20 69 6e 64 69 72 65 63  74 65 64 20 69 63 6f 6e  | indirected icon|
00009de0  20 66 6f 72 20 65 61 63  68 20 53 57 49 20 6e 61  | for each SWI na|
00009df0  6d 65 0d 28 82 2e f4 20  28 33 29 3a 20 4f 6e 65  |me.(... (3): One|
00009e00  20 64 69 72 65 63 74 20  69 63 6f 6e 20 66 6f 72  | direct icon for|
00009e10  20 65 61 63 68 20 53 57  49 20 6e 75 6d 62 65 72  | each SWI number|
00009e20  0d 28 8c 32 f4 20 28 34  29 3a 20 4f 6e 65 20 64  |.(.2. (4): One d|
00009e30  69 72 65 63 74 20 69 63  6f 6e 20 66 6f 72 20 65  |irect icon for e|
00009e40  61 63 68 20 70 61 67 65  20 72 65 66 65 72 65 6e  |ach page referen|
00009e50  63 65 0d 28 96 41 f4 20  57 65 20 64 6f 6e 27 74  |ce.(.A. We don't|
00009e60  20 6b 6e 6f 77 20 68 6f  77 20 6c 6f 6e 67 20 74  | know how long t|
00009e70  68 65 20 53 57 49 20 70  72 65 66 69 78 20 6c 61  |he SWI prefix la|
00009e80  62 65 6c 20 69 73 20 67  6f 69 6e 67 20 74 6f 20  |bel is going to |
00009e90  62 65 2c 0d 28 a0 3e f4  20 62 75 74 20 74 68 65  |be,.(.>. but the|
00009ea0  20 6c 6f 6e 67 65 73 74  20 62 75 69 6c 74 2d 69  | longest built-i|
00009eb0  6e 20 53 57 49 20 70 72  65 66 69 78 20 6b 6e 6f  |n SWI prefix kno|
00009ec0  77 6e 20 61 74 20 74 68  65 20 74 69 6d 65 20 6f  |wn at the time o|
00009ed0  66 0d 28 aa 3d f4 20 77  72 69 74 69 6e 67 20 28  |f.(.=. writing (|
00009ee0  6f 6e 20 52 49 53 43 20  4f 53 20 33 b7 31 29 20  |on RISC OS 3.1) |
00009ef0  69 73 20 53 68 61 72 65  64 43 4c 69 62 72 61 72  |is SharedCLibrar|
00009f00  79 2c 20 77 68 69 63 68  20 69 73 20 31 34 0d 28  |y, which is 14.(|
00009f10  b4 42 f4 20 63 68 61 72  61 63 74 65 72 73 20 6c  |.B. characters l|
00009f20  6f 6e 67 2e 20 53 6f 20  77 65 27 6c 6c 20 61 6c  |ong. So we'll al|
00009f30  6c 6f 77 20 31 38 20 62  79 74 65 73 20 74 6f 20  |low 18 bytes to |
00009f40  61 63 63 6f 6d 6d 6f 64  61 74 65 20 74 68 69 73  |accommodate this|
00009f50  0d 28 be 46 f4 20 70 6c  75 73 20 61 20 62 69 74  |.(.F. plus a bit|
00009f60  20 6d 6f 72 65 20 74 6f  20 62 65 20 6f 6e 20 74  | more to be on t|
00009f70  68 65 20 73 61 66 65 20  73 69 64 65 20 28 31 37  |he safe side (17|
00009f80  20 63 68 61 72 61 63 74  65 72 73 20 2b 20 43 48  | characters + CH|
00009f90  52 24 31 33 29 2e 0d 28  c8 44 f4 20 4e 6f 20 76  |R$13)..(.D. No v|
00009fa0  61 6c 69 64 61 74 69 6f  6e 20 73 74 72 69 6e 67  |alidation string|
00009fb0  20 69 73 20 6e 65 65 64  65 64 20 66 6f 72 20 74  | is needed for t|
00009fc0  68 65 20 53 57 49 20 6c  61 62 65 6c 73 2c 20 61  |he SWI labels, a|
00009fd0  6e 64 20 6e 6f 20 74 65  78 74 0d 28 d2 25 f4 20  |nd no text.(.%. |
00009fe0  69 73 20 6e 65 65 64 65  64 20 66 6f 72 20 62 6f  |is needed for bo|
00009ff0  72 64 65 72 20 69 63 6f  6e 73 2e 20 53 6f 3a 0d  |rder icons. So:.|
0000a000  28 dc 46 f4 20 20 20 53  57 49 20 70 72 65 66 69  |(.F.   SWI prefi|
0000a010  78 20 6c 61 62 65 6c 20  20 20 20 20 20 20 3a 20  |x label       : |
0000a020  20 31 38 20 62 79 74 65  73 20 74 65 78 74 20 20  | 18 bytes text  |
0000a030  3a 20 20 33 20 62 79 74  65 73 20 76 61 6c 69 64  |:  3 bytes valid|
0000a040  61 74 69 6f 6e 0d 28 e6  46 f4 20 20 20 33 44 20  |ation.(.F.   3D |
0000a050  73 75 72 72 6f 75 6e 64  69 6e 67 20 62 6f 72 64  |surrounding bord|
0000a060  65 72 20 20 3a 20 20 20  31 20 62 79 74 65 20 20  |er  :   1 byte  |
0000a070  74 65 78 74 20 20 3a 20  20 33 20 62 79 74 65 73  |text  :  3 bytes|
0000a080  20 76 61 6c 69 64 61 74  69 6f 6e 0d 28 f0 46 f4  | validation.(.F.|
0000a090  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
0000a0c0  20 3d 20 32 34 20 62 79  74 65 73 20 74 6f 74 61  | = 24 bytes tota|
0000a0d0  6c 0d 28 fa 46 f4 20 20  20 31 20 69 63 6f 6e 20  |l.(.F.   1 icon |
0000a0e0  70 65 72 20 53 57 49 20  63 61 6c 6c 20 20 20 20  |per SWI call    |
0000a0f0  3a 20 20 35 30 20 62 79  74 65 73 20 74 65 78 74  |:  50 bytes text|
0000a100  20 20 3a 20 20 30 20 62  79 74 65 73 20 76 61 6c  |  :  0 bytes val|
0000a110  69 64 61 74 69 6f 6e 0d  29 04 28 f4 20 54 68 65  |idation.).(. The|
0000a120  20 53 57 49 20 6c 61 62  65 6c 20 69 63 6f 6e 20  | SWI label icon |
0000a130  69 73 20 6f 66 20 74 68  65 20 66 6f 72 6d 3a 0d  |is of the form:.|
0000a140  29 0e 39 f4 20 20 20 3c  53 57 49 20 6e 61 6d 65  |).9.   <SWI name|
0000a150  20 65 78 63 6c 75 64 69  6e 67 20 70 72 65 66 69  | excluding prefi|
0000a160  78 3e 20 7b 33 31 20 63  68 61 72 61 63 74 65 72  |x> {31 character|
0000a170  73 7d 20 2b 20 22 20 22  0d 29 18 39 f4 20 20 20  |s} + " ".).9.   |
0000a180  2b 20 3c 53 57 49 20 4e  75 6d 62 65 72 20 65 78  |+ <SWI Number ex|
0000a190  63 6c 75 64 69 6e 67 20  26 3e 20 20 7b 20 36 20  |cluding &>  { 6 |
0000a1a0  63 68 61 72 61 63 74 65  72 73 7d 20 2b 20 22 20  |characters} + " |
0000a1b0  22 0d 29 22 44 f4 20 20  20 2b 20 3c 50 52 4d 20  |".)"D.   + <PRM |
0000a1c0  70 61 67 65 20 72 65 66  65 72 65 6e 63 65 20 69  |page reference i|
0000a1d0  66 20 61 76 61 69 6c 61  62 6c 65 3e 20 7b 31 30  |f available> {10|
0000a1e0  20 63 68 61 72 61 63 74  65 72 73 7d 20 2b 20 43  | characters} + C|
0000a1f0  48 52 24 31 33 0d 29 2c  18 f4 20 20 20 3d 20 35  |HR$13.),..   = 5|
0000a200  30 20 62 79 74 65 73 20  74 6f 74 61 6c 0d 29 36  |0 bytes total.)6|
0000a210  45 f4 20 20 20 54 68 65  20 53 57 49 20 6e 61 6d  |E.   The SWI nam|
0000a220  65 20 61 6e 64 20 6e 75  6d 62 65 72 20 61 72 65  |e and number are|
0000a230  20 73 65 70 61 72 61 74  65 64 20 62 79 20 61 20  | separated by a |
0000a240  72 6f 77 20 6f 66 20 64  6f 74 73 20 77 69 74 68  |row of dots with|
0000a250  20 61 0d 29 40 1c f4 20  20 20 73 70 61 63 65 20  | a.)@..   space |
0000a260  61 74 20 65 69 74 68 65  72 20 65 6e 64 2e 0d 29  |at either end..)|
0000a270  4a 37 f4 20 53 6f 3a 20  74 6f 74 61 6c 20 73 70  |J7. So: total sp|
0000a280  61 63 65 20 72 65 71 75  69 72 65 64 20 69 73 20  |ace required is |
0000a290  33 33 20 2b 20 32 34 20  2b 20 28 35 30 20 d7 a0  |33 + 24 + (50 ..|
0000a2a0  53 57 49 73 29 0d 29 54  37 52 65 71 75 69 72 65  |SWIs).)T7Require|
0000a2b0  64 4d 65 6d 2b 3d 33 33  2b 32 34 2b 28 35 30 2a  |dMem+=33+24+(50*|
0000a2c0  3f 28 4d 6f 64 44 61 74  61 53 74 72 75 63 2b 28  |?(ModDataStruc+(|
0000a2d0  33 32 2a 4d 6f 64 75 6c  65 29 29 29 0d 29 5e 07  |32*Module))).)^.|
0000a2e0  20 20 3a 0d 29 68 5c e7  20 a4 41 6c 6c 6f 63 61  |  :.)h\. .Alloca|
0000a2f0  74 65 4d 65 6d 6f 72 79  28 52 65 71 75 69 72 65  |teMemory(Require|
0000a300  64 4d 65 6d 29 3d 30 20  8c 20 85 20 39 39 39 39  |dMem)=0 . . 9999|
0000a310  2c 22 55 6e 61 62 6c 65  20 74 6f 20 63 6c 61 69  |,"Unable to clai|
0000a320  6d 20 6d 65 6d 6f 72 79  20 66 6f 72 20 74 68 65  |m memory for the|
0000a330  20 69 6e 64 65 78 20 77  69 6e 64 6f 77 2e 22 0d  | index window.".|
0000a340  29 72 07 20 20 3a 0d 29  7c 2c 4d 6f 64 75 6c 65  |)r.  :.)|,Module|
0000a350  42 61 73 65 3d 21 28 4d  6f 64 44 61 74 61 53 74  |Base=!(ModDataSt|
0000a360  72 75 63 2b 28 33 32 2a  4d 6f 64 75 6c 65 29 2b  |ruc+(32*Module)+|
0000a370  31 29 0d 29 86 47 24 28  49 6e 64 69 72 65 63 74  |1).).G$(Indirect|
0000a380  49 63 6f 6e 42 61 73 65  2b 30 29 3d 22 53 57 49  |IconBase+0)="SWI|
0000a390  20 43 61 6c 6c 22 2b bd  31 33 3a 24 28 49 6e 64  | Call"+.13:$(Ind|
0000a3a0  69 72 65 63 74 49 63 6f  6e 42 61 73 65 2b 39 29  |irectIconBase+9)|
0000a3b0  3d 22 5a 33 22 2b bd 31  33 0d 29 90 46 24 28 49  |="Z3"+.13.).F$(I|
0000a3c0  6e 64 69 72 65 63 74 49  63 6f 6e 42 61 73 65 2b  |ndirectIconBase+|
0000a3d0  31 32 29 3d 22 53 57 49  20 26 22 2b bd 31 33 3a  |12)="SWI &"+.13:|
0000a3e0  24 28 49 6e 64 69 72 65  63 74 49 63 6f 6e 42 61  |$(IndirectIconBa|
0000a3f0  73 65 2b 31 38 29 3d 22  5a 33 22 2b bd 31 33 0d  |se+18)="Z3"+.13.|
0000a400  29 9a 49 24 28 49 6e 64  69 72 65 63 74 49 63 6f  |).I$(IndirectIco|
0000a410  6e 42 61 73 65 2b 32 31  29 3d 22 50 52 4d 20 50  |nBase+21)="PRM P|
0000a420  61 67 65 22 2b bd 31 33  3a 24 28 49 6e 64 69 72  |age"+.13:$(Indir|
0000a430  65 63 74 49 63 6f 6e 42  61 73 65 2b 33 30 29 3d  |ectIconBase+30)=|
0000a440  22 5a 33 22 2b bd 31 33  0d 29 a4 50 f4 20 54 68  |"Z3"+.13.).P. Th|
0000a450  61 74 27 73 20 74 68 65  20 64 61 74 61 20 73 65  |at's the data se|
0000a460  74 20 75 70 20 66 6f 72  20 74 68 65 20 74 68 72  |t up for the thr|
0000a470  65 65 20 6c 61 62 65 6c  20 69 63 6f 6e 73 20 61  |ee label icons a|
0000a480  74 20 74 68 65 20 74 6f  70 20 6f 66 20 74 68 65  |t the top of the|
0000a490  20 77 69 6e 64 6f 77 2e  0d 29 ae 4b 50 72 65 66  | window..).KPref|
0000a4a0  69 78 24 3d a4 53 57 49  50 72 65 66 69 78 28 4d  |ix$=.SWIPrefix(M|
0000a4b0  6f 64 75 6c 65 42 61 73  65 2c 42 75 66 66 65 72  |oduleBase,Buffer|
0000a4c0  2c 32 35 36 29 3a e7 20  4d 6f 64 75 6c 65 42 61  |,256):. ModuleBa|
0000a4d0  73 65 3d 30 20 8c 20 50  72 65 66 69 78 24 3d 22  |se=0 . Prefix$="|
0000a4e0  4f 53 22 0d 29 b8 4b 24  28 49 6e 64 69 72 65 63  |OS".).K$(Indirec|
0000a4f0  74 49 63 6f 6e 42 61 73  65 2b 33 33 29 3d c0 50  |tIconBase+33)=.P|
0000a500  72 65 66 69 78 24 2c 31  37 29 2b bd 31 33 3a 24  |refix$,17)+.13:$|
0000a510  28 49 6e 64 69 72 65 63  74 49 63 6f 6e 42 61 73  |(IndirectIconBas|
0000a520  65 2b 35 31 29 3d 22 5a  30 22 2b bd 31 33 0d 29  |e+51)="Z0"+.13.)|
0000a530  c2 3e 24 28 49 6e 64 69  72 65 63 74 49 63 6f 6e  |.>$(IndirectIcon|
0000a540  42 61 73 65 2b 35 34 29  3d bd 31 33 3a 24 28 49  |Base+54)=.13:$(I|
0000a550  6e 64 69 72 65 63 74 49  63 6f 6e 42 61 73 65 2b  |ndirectIconBase+|
0000a560  35 35 29 3d 22 5a 31 22  2b bd 31 33 0d 29 cc 50  |55)="Z1"+.13.).P|
0000a570  f4 20 54 68 61 74 27 73  20 74 68 65 20 64 61 74  |. That's the dat|
0000a580  61 20 73 65 74 20 75 70  20 66 6f 72 20 74 68 65  |a set up for the|
0000a590  20 53 57 49 20 70 72 65  66 69 78 20 6c 61 62 65  | SWI prefix labe|
0000a5a0  6c 20 61 6e 64 20 33 44  20 73 75 72 72 6f 75 6e  |l and 3D surroun|
0000a5b0  64 69 6e 67 20 62 6f 72  64 65 72 2e 0d 29 d6 07  |ding border..)..|
0000a5c0  20 20 3a 0d 29 e0 5f f4  20 57 65 20 6e 6f 77 20  |  :.)._. We now |
0000a5d0  67 6f 20 74 68 72 6f 75  67 68 20 61 6c 6c 20 74  |go through all t|
0000a5e0  68 65 20 53 57 49 73 20  69 6e 20 74 68 65 20 6d  |he SWIs in the m|
0000a5f0  6f 64 75 6c 65 20 61 6e  64 20 70 75 74 20 74 68  |odule and put th|
0000a600  65 69 72 20 74 65 78 74  20 69 6e 74 6f 20 74 68  |eir text into th|
0000a610  65 20 69 6e 64 69 72 65  63 74 65 64 20 69 63 6f  |e indirected ico|
0000a620  6e 73 0d 29 ea 07 20 20  3a 0d 29 f4 2f 53 57 49  |ns.)..  :.)./SWI|
0000a630  43 6f 75 6e 74 3d 30 3a  53 57 49 4e 75 6d 3d 4d  |Count=0:SWINum=M|
0000a640  6f 64 75 6c 65 42 61 73  65 21 32 38 3a 54 6f 70  |oduleBase!28:Top|
0000a650  4c 69 6d 69 74 3d 36 33  0d 29 fe 2f e7 20 4d 6f  |Limit=63.)./. Mo|
0000a660  64 75 6c 65 42 61 73 65  3d 30 20 8c 20 53 57 49  |duleBase=0 . SWI|
0000a670  4e 75 6d 3d 30 3a 54 6f  70 4c 69 6d 69 74 3d 32  |Num=0:TopLimit=2|
0000a680  35 36 3a f4 20 4f 53 0d  2a 08 07 20 20 3a 0d 2a  |56:. OS.*..  :.*|
0000a690  12 34 f4 20 43 61 6e 20  77 65 20 66 69 6e 64 20  |.4. Can we find |
0000a6a0  74 68 65 20 70 72 65 66  69 78 20 69 6e 20 74 68  |the prefix in th|
0000a6b0  65 20 50 52 4d 20 69 6e  64 65 78 20 73 74 6f 72  |e PRM index stor|
0000a6c0  65 3f 0d 2a 1c 28 50 61  67 65 49 6e 64 65 78 3d  |e?.*.(PageIndex=|
0000a6d0  a4 50 61 67 65 49 6e 64  65 78 50 72 65 73 65 6e  |.PageIndexPresen|
0000a6e0  74 28 50 72 65 66 69 78  24 29 0d 2a 26 4e f4 20  |t(Prefix$).*&N. |
0000a6f0  41 20 76 61 6c 75 65 20  6f 66 20 30 20 6d 65 61  |A value of 0 mea|
0000a700  6e 73 20 6e 6f 74 20 70  72 65 73 65 6e 74 3b 20  |ns not present; |
0000a710  6f 74 68 65 72 77 69 73  65 20 77 65 20 67 65 74  |otherwise we get|
0000a720  20 74 68 65 20 73 65 61  72 63 68 20 62 61 73 65  | the search base|
0000a730  20 61 64 64 72 65 73 73  0d 2a 30 07 20 20 3a 0d  | address.*0.  :.|
0000a740  2a 3a 14 e3 20 4e 3d 30  20 b8 20 54 6f 70 4c 69  |*:.. N=0 . TopLi|
0000a750  6d 69 74 0d 2a 44 2c 20  20 53 57 49 4e 61 6d 65  |mit.*D,  SWIName|
0000a760  24 3d a4 53 57 49 4e 61  6d 65 28 53 57 49 4e 75  |$=.SWIName(SWINu|
0000a770  6d 2c 42 75 66 66 65 72  2c 32 35 36 2c 4e 29 0d  |m,Buffer,256,N).|
0000a780  2a 4e 16 20 20 e7 20 53  57 49 4e 61 6d 65 24 3c  |*N.  . SWIName$<|
0000a790  3e 22 22 20 8c 0d 2a 58  18 20 20 20 20 53 24 3d  |>"" ..*X.    S$=|
0000a7a0  c0 53 57 49 4e 61 6d 65  24 2c 33 31 29 0d 2a 62  |.SWIName$,31).*b|
0000a7b0  45 20 20 20 20 e7 20 4e  3d 32 35 36 20 8c 20 53  |E    . N=256 . S|
0000a7c0  24 3d 22 57 72 69 74 65  49 22 3a f4 20 4f 75 72  |$="WriteI":. Our|
0000a7d0  20 68 6f 6d 61 67 65 20  74 6f 20 74 68 69 73 20  | homage to this |
0000a7e0  67 61 72 67 61 6e 74 75  61 6e 20 73 65 74 20 2e  |gargantuan set .|
0000a7f0  2e 2e 0d 2a 6c 1c 20 20  20 20 e7 20 a9 28 53 24  |...*l.    . .(S$|
0000a800  29 3c 33 31 20 8c 20 53  24 2b 3d 22 20 22 0d 2a  |)<31 . S$+=" ".*|
0000a810  76 1a 20 20 20 20 53 24  2b 3d c4 33 31 2d a9 28  |v.    S$+=.31-.(|
0000a820  53 24 29 2c 22 2e 22 29  0d 2a 80 1f 20 20 20 20  |S$),".").*..    |
0000a830  53 24 2b 3d c4 35 2d a9  28 c3 7e 53 57 49 4e 75  |S$+=.5-.(.~SWINu|
0000a840  6d 29 2c 22 2e 22 29 0d  2a 8a 0f 20 20 20 20 53  |m),".").*..    S|
0000a850  24 2b 3d 22 20 22 0d 2a  94 14 20 20 20 20 53 24  |$+=" ".*..    S$|
0000a860  2b 3d c3 7e 53 57 49 4e  75 6d 0d 2a 9e 0f 20 20  |+=.~SWINum.*..  |
0000a870  20 20 53 24 2b 3d 22 20  22 0d 2a a8 18 20 20 20  |  S$+=" ".*..   |
0000a880  20 e7 20 50 61 67 65 49  6e 64 65 78 3c 3e 30 20  | . PageIndex<>0 |
0000a890  8c 0d 2a b2 41 20 20 20  20 20 20 54 24 3d c4 31  |..*.A      T$=.1|
0000a8a0  30 2c 22 2e 22 29 3a c2  54 24 29 3d c2 22 20 22  |0,"."):.T$)=." "|
0000a8b0  2b a4 4c 6f 6f 6b 55 70  50 61 67 65 28 53 57 49  |+.LookUpPage(SWI|
0000a8c0  4e 75 6d 2c 50 61 67 65  49 6e 64 65 78 29 2c 31  |Num,PageIndex),1|
0000a8d0  30 29 0d 2a bc 10 20 20  20 20 20 20 53 24 2b 3d  |0).*..      S$+=|
0000a8e0  54 24 0d 2a c6 09 20 20  20 20 cd 0d 2a d0 50 20  |T$.*..    ..*.P |
0000a8f0  20 20 20 24 28 49 6e 64  69 72 65 63 74 49 63 6f  |   $(IndirectIco|
0000a900  6e 42 61 73 65 2b 35 38  2b 28 35 30 2a 53 57 49  |nBase+58+(50*SWI|
0000a910  43 6f 75 6e 74 29 29 3d  c0 53 24 2c 34 39 29 2b  |Count))=.S$,49)+|
0000a920  bd 31 33 3a f4 20 4c 45  46 54 24 20 6a 75 73 74  |.13:. LEFT$ just|
0000a930  20 69 6e 20 63 61 73 65  2e 2e 2e 0d 2a da 13 20  | in case....*.. |
0000a940  20 20 20 53 57 49 43 6f  75 6e 74 2b 3d 31 0d 2a  |   SWICount+=1.*|
0000a950  e4 07 20 20 cd 0d 2a ee  0f 20 20 53 57 49 4e 75  |..  ..*..  SWINu|
0000a960  6d 2b 3d 31 0d 2a f8 05  ed 0d 2b 02 26 57 6f 72  |m+=1.*....+.&Wor|
0000a970  6b 45 78 74 65 6e 74 3d  2d 31 33 32 2d 28 34 30  |kExtent=-132-(40|
0000a980  2a 53 57 49 43 6f 75 6e  74 2b 31 29 2d 31 32 0d  |*SWICount+1)-12.|
0000a990  2b 0c 35 e7 20 50 61 67  65 49 6e 64 65 78 3d 30  |+.5. PageIndex=0|
0000a9a0  20 8c 20 57 69 6e 64 6f  77 57 69 64 74 68 3d 36  | . WindowWidth=6|
0000a9b0  33 30 20 8b 20 57 69 6e  64 6f 77 57 69 64 74 68  |30 . WindowWidth|
0000a9c0  3d 38 31 30 0d 2b 16 c1  49 6e 64 65 78 3d a4 43  |=810.+..Index=.C|
0000a9d0  72 65 61 74 65 57 69 6e  64 6f 77 28 4d 69 6e 58  |reateWindow(MinX|
0000a9e0  2c 57 6f 72 6b 45 78 74  65 6e 74 2c 57 69 6e 64  |,WorkExtent,Wind|
0000a9f0  6f 77 57 69 64 74 68 2c  4d 61 78 59 2c 30 2c 53  |owWidth,MaxY,0,S|
0000aa00  63 72 6f 6c 6c 59 2c 42  65 68 69 6e 64 57 69 6e  |crollY,BehindWin|
0000aa10  64 6f 77 2c 25 31 30 31  31 30 31 31 31 30 30 30  |dow,%10110111000|
0000aa20  30 30 30 30 30 30 30 30  30 30 30 30 30 30 30 30  |0000000000000000|
0000aa30  30 30 30 31 30 2c 37 2c  32 2c 37 2c 31 2c 33 2c  |00010,7,2,7,1,3,|
0000aa40  31 2c 31 32 2c 30 2c 57  6f 72 6b 45 78 74 65 6e  |1,12,0,WorkExten|
0000aa50  74 2c 57 69 6e 64 6f 77  57 69 64 74 68 2c 30 2c  |t,WindowWidth,0,|
0000aa60  25 31 31 31 30 31 2c 33  2c 31 2c 57 69 6e 64 6f  |%11101,3,1,Windo|
0000aa70  77 57 69 64 74 68 2c 30  2c 22 53 57 49 a0 49 6e  |wWidth,0,"SWI.In|
0000aa80  64 65 78 22 29 0d 2b 20  4c 49 63 6f 6e 44 61 74  |dex").+ LIconDat|
0000aa90  61 21 30 3d 49 6e 64 69  72 65 63 74 49 63 6f 6e  |a!0=IndirectIcon|
0000aaa0  42 61 73 65 2b 30 3a 49  63 6f 6e 44 61 74 61 21  |Base+0:IconData!|
0000aab0  34 3d 49 6e 64 69 72 65  63 74 49 63 6f 6e 42 61  |4=IndirectIconBa|
0000aac0  73 65 2b 39 3a 49 63 6f  6e 44 61 74 61 21 38 3d  |se+9:IconData!8=|
0000aad0  39 0d 2b 2a 48 49 63 6f  6e 3d a4 43 72 65 61 74  |9.+*HIcon=.Creat|
0000aae0  65 49 63 6f 6e 28 49 6e  64 65 78 2c 31 34 2c 2d  |eIcon(Index,14,-|
0000aaf0  36 30 2c 32 30 36 2c 2d  31 32 2c 26 31 37 30 30  |60,206,-12,&1700|
0000ab00  30 31 33 39 2c 49 63 6f  6e 44 61 74 61 29 3a f4  |0139,IconData):.|
0000ab10  20 53 57 49 20 43 61 6c  6c 0d 2b 34 4e 49 63 6f  | SWI Call.+4NIco|
0000ab20  6e 44 61 74 61 21 30 3d  49 6e 64 69 72 65 63 74  |nData!0=Indirect|
0000ab30  49 63 6f 6e 42 61 73 65  2b 31 32 3a 49 63 6f 6e  |IconBase+12:Icon|
0000ab40  44 61 74 61 21 34 3d 49  6e 64 69 72 65 63 74 49  |Data!4=IndirectI|
0000ab50  63 6f 6e 42 61 73 65 2b  31 38 3a 49 63 6f 6e 44  |conBase+18:IconD|
0000ab60  61 74 61 21 38 3d 36 0d  2b 3e 46 49 63 6f 6e 3d  |ata!8=6.+>FIcon=|
0000ab70  a4 43 72 65 61 74 65 49  63 6f 6e 28 49 6e 64 65  |.CreateIcon(Inde|
0000ab80  78 2c 35 31 38 2c 2d 36  30 2c 36 31 38 2c 2d 31  |x,518,-60,618,-1|
0000ab90  32 2c 26 31 37 30 30 30  31 33 39 2c 49 63 6f 6e  |2,&17000139,Icon|
0000aba0  44 61 74 61 29 3a f4 20  53 57 49 20 26 0d 2b 48  |Data):. SWI &.+H|
0000abb0  4e 49 63 6f 6e 44 61 74  61 21 30 3d 49 6e 64 69  |NIconData!0=Indi|
0000abc0  72 65 63 74 49 63 6f 6e  42 61 73 65 2b 32 31 3a  |rectIconBase+21:|
0000abd0  49 63 6f 6e 44 61 74 61  21 34 3d 49 6e 64 69 72  |IconData!4=Indir|
0000abe0  65 63 74 49 63 6f 6e 42  61 73 65 2b 33 30 3a 49  |ectIconBase+30:I|
0000abf0  63 6f 6e 44 61 74 61 21  38 3d 39 0d 2b 52 49 49  |conData!8=9.+RII|
0000ac00  63 6f 6e 3d a4 43 72 65  61 74 65 49 63 6f 6e 28  |con=.CreateIcon(|
0000ac10  49 6e 64 65 78 2c 36 33  38 2c 2d 36 30 2c 37 39  |Index,638,-60,79|
0000ac20  38 2c 2d 31 32 2c 26 31  37 30 30 30 31 33 39 2c  |8,-12,&17000139,|
0000ac30  49 63 6f 6e 44 61 74 61  29 3a f4 20 50 52 4d 20  |IconData):. PRM |
0000ac40  50 61 67 65 0d 2b 5c 4f  49 63 6f 6e 44 61 74 61  |Page.+\OIconData|
0000ac50  21 30 3d 49 6e 64 69 72  65 63 74 49 63 6f 6e 42  |!0=IndirectIconB|
0000ac60  61 73 65 2b 33 33 3a 49  63 6f 6e 44 61 74 61 21  |ase+33:IconData!|
0000ac70  34 3d 49 6e 64 69 72 65  63 74 49 63 6f 6e 42 61  |4=IndirectIconBa|
0000ac80  73 65 2b 35 31 3a 49 63  6f 6e 44 61 74 61 21 38  |se+51:IconData!8|
0000ac90  3d 31 38 0d 2b 66 5d 49  63 6f 6e 3d a4 43 72 65  |=18.+f]Icon=.Cre|
0000aca0  61 74 65 49 63 6f 6e 28  49 6e 64 65 78 2c 32 34  |ateIcon(Index,24|
0000acb0  2c 2d 31 32 38 2c 32 34  2b 28 31 36 2a a9 28 50  |,-128,24+(16*.(P|
0000acc0  72 65 66 69 78 24 29 29  2b 33 32 2c 2d 38 30 2c  |refix$))+32,-80,|
0000acd0  26 31 37 30 30 30 31 33  39 2c 49 63 6f 6e 44 61  |&17000139,IconDa|
0000ace0  74 61 29 3a f4 20 53 57  49 20 50 72 65 66 69 78  |ta):. SWI Prefix|
0000acf0  0d 2b 70 4e 49 63 6f 6e  44 61 74 61 21 30 3d 49  |.+pNIconData!0=I|
0000ad00  6e 64 69 72 65 63 74 49  63 6f 6e 42 61 73 65 2b  |ndirectIconBase+|
0000ad10  35 34 3a 49 63 6f 6e 44  61 74 61 21 34 3d 49 6e  |54:IconData!4=In|
0000ad20  64 69 72 65 63 74 49 63  6f 6e 42 61 73 65 2b 35  |directIconBase+5|
0000ad30  35 3a 49 63 6f 6e 44 61  74 61 21 38 3d 31 0d 2b  |5:IconData!8=1.+|
0000ad40  7a 66 49 63 6f 6e 3d a4  43 72 65 61 74 65 49 63  |zfIcon=.CreateIc|
0000ad50  6f 6e 28 49 6e 64 65 78  2c 31 32 2c 2d 31 33 32  |on(Index,12,-132|
0000ad60  2d 28 34 30 2a 53 57 49  43 6f 75 6e 74 2b 31 29  |-(40*SWICount+1)|
0000ad70  2c 57 69 6e 64 6f 77 57  69 64 74 68 2d 31 34 2c  |,WindowWidth-14,|
0000ad80  2d 31 30 38 2c 26 31 37  30 30 30 31 31 39 2c 49  |-108,&17000119,I|
0000ad90  63 6f 6e 44 61 74 61 29  3a f4 20 33 44 20 42 6f  |conData):. 3D Bo|
0000ada0  72 64 65 72 0d 2b 84 16  e3 20 4e 3d 30 20 b8 20  |rder.+... N=0 . |
0000adb0  53 57 49 43 6f 75 6e 74  2d 31 0d 2b 8e 47 20 20  |SWICount-1.+.G  |
0000adc0  49 63 6f 6e 44 61 74 61  21 30 3d 49 6e 64 69 72  |IconData!0=Indir|
0000add0  65 63 74 49 63 6f 6e 42  61 73 65 2b 35 38 2b 28  |ectIconBase+58+(|
0000ade0  35 30 2a 4e 29 3a 49 63  6f 6e 44 61 74 61 21 34  |50*N):IconData!4|
0000adf0  3d 2d 31 3a 49 63 6f 6e  44 61 74 61 21 38 3d 35  |=-1:IconData!8=5|
0000ae00  30 0d 2b 98 61 20 20 49  63 6f 6e 3d a4 43 72 65  |0.+.a  Icon=.Cre|
0000ae10  61 74 65 49 63 6f 6e 28  49 6e 64 65 78 2c 31 32  |ateIcon(Index,12|
0000ae20  2c 2d 31 33 32 2d 28 34  30 2a 4e 2b 31 29 2d 34  |,-132-(40*N+1)-4|
0000ae30  30 2c 57 69 6e 64 6f 77  57 69 64 74 68 2d 31 34  |0,WindowWidth-14|
0000ae40  2c 2d 31 33 32 2d 28 34  30 2a 4e 2b 31 29 2c 26  |,-132-(40*N+1),&|
0000ae50  31 37 30 30 30 31 31 31  2c 49 63 6f 6e 44 61 74  |17000111,IconDat|
0000ae60  61 29 0d 2b a2 05 ed 0d  2b ac 16 c8 99 20 22 48  |a).+....+.... "H|
0000ae70  6f 75 72 67 6c 61 73 73  5f 4f 66 66 22 0d 2b b6  |ourglass_Off".+.|
0000ae80  0a 3d 49 6e 64 65 78 0d  2b c0 05 3a 0d 2b ca 45  |.=Index.+..:.+.E|
0000ae90  dd 20 a4 4e 65 78 74 53  57 49 4d 6f 64 28 f8 20  |. .NextSWIMod(. |
0000aea0  4d 6f 64 4e 75 6d 2c f8  20 4d 6f 64 42 61 73 65  |ModNum,. ModBase|
0000aeb0  2c f8 20 53 57 49 43 68  75 6e 6b 2c f8 20 50 72  |,. SWIChunk,. Pr|
0000aec0  65 66 69 78 24 2c f8 20  4d 6f 64 4e 61 6d 65 24  |efix$,. ModName$|
0000aed0  29 0d 2b d4 4c f4 20 52  65 74 75 72 6e 20 64 65  |).+.L. Return de|
0000aee0  74 61 69 6c 73 20 6f 66  20 74 68 65 20 63 75 72  |tails of the cur|
0000aef0  72 65 6e 74 20 6d 6f 64  75 6c 65 20 62 61 73 65  |rent module base|
0000af00  20 6e 75 6d 62 65 72 2c  20 6e 61 6d 65 20 61 6e  | number, name an|
0000af10  64 20 53 57 49 20 70 72  65 66 69 78 2c 0d 2b de  |d SWI prefix,.+.|
0000af20  41 f4 20 61 6e 64 20 75  70 64 61 74 65 20 74 68  |A. and update th|
0000af30  65 20 6d 6f 64 75 6c 65  20 6e 75 6d 62 65 72 20  |e module number |
0000af40  74 6f 20 74 68 65 20 6e  65 78 74 20 6d 6f 64 75  |to the next modu|
0000af50  6c 65 20 69 6e 20 74 68  65 20 6c 69 73 74 0d 2b  |le in the list.+|
0000af60  e8 43 f4 20 28 6f 72 20  72 65 74 75 72 6e 20 46  |.C. (or return F|
0000af70  41 4c 53 45 20 66 6f 72  20 6e 6f 20 6d 6f 72 65  |ALSE for no more|
0000af80  20 6d 6f 64 75 6c 65 73  29 2e 20 53 6b 69 70 20  | modules). Skip |
0000af90  61 6e 79 20 6d 6f 64 75  6c 65 73 20 77 68 69 63  |any modules whic|
0000afa0  68 0d 2b f2 19 f4 20 64  6f 6e 27 74 20 70 72 6f  |h.+... don't pro|
0000afb0  76 69 64 65 20 53 57 49  73 2e 0d 2b fc 07 ea 20  |vide SWIs..+... |
0000afc0  85 0d 2c 06 10 ee 20 85  20 ea 20 f7 20 85 3a 3d  |..,... . . . .:=|
0000afd0  a3 0d 2c 10 05 f5 0d 2c  1a 07 20 20 f5 0d 2c 24  |..,....,..  ..,$|
0000afe0  27 20 20 20 20 49 6e 73  4e 75 6d 3d 30 3a f4 20  |'    InsNum=0:. |
0000aff0  49 6e 73 74 61 6e 74 69  61 74 69 6f 6e 20 6e 75  |Instantiation nu|
0000b000  6d 62 65 72 0d 2c 2e 09  20 20 20 20 f5 0d 2c 38  |mber.,..    ..,8|
0000b010  2e 20 20 20 20 20 20 f4  20 49 67 6e 6f 72 65 20  |.      . Ignore |
0000b020  61 6c 74 65 72 6e 61 74  69 76 65 20 69 6e 73 74  |alternative inst|
0000b030  61 6e 74 69 61 74 69 6f  6e 73 3a 0d 2c 42 28 20  |antiations:.,B( |
0000b040  20 20 20 20 20 f4 20 74  68 65 79 20 61 6c 6c 20  |     . they all |
0000b050  68 61 76 65 20 74 68 65  20 73 61 6d 65 20 53 57  |have the same SW|
0000b060  49 73 2e 0d 2c 4c 42 20  20 20 20 20 20 c8 99 20  |Is..,LB      .. |
0000b070  22 4f 53 5f 4d 6f 64 75  6c 65 22 2c 31 32 2c 4d  |"OS_Module",12,M|
0000b080  6f 64 4e 75 6d 2c 49 6e  73 4e 75 6d 20 b8 20 2c  |odNum,InsNum . ,|
0000b090  4d 6f 64 4e 75 6d 2c 49  6e 73 4e 75 6d 2c 4d 6f  |ModNum,InsNum,Mo|
0000b0a0  64 42 61 73 65 0d 2c 56  12 20 20 20 20 fd 20 49  |dBase.,V.    . I|
0000b0b0  6e 73 4e 75 6d 3d 30 0d  2c 60 1b 20 20 20 20 53  |nsNum=0.,`.    S|
0000b0c0  57 49 43 68 75 6e 6b 3d  4d 6f 64 42 61 73 65 21  |WIChunk=ModBase!|
0000b0d0  32 38 0d 2c 6a 13 20 20  fd 20 53 57 49 43 68 75  |28.,j.  . SWIChu|
0000b0e0  6e 6b 3c 3e 30 0d 2c 74  2c 20 20 50 72 65 66 69  |nk<>0.,t,  Prefi|
0000b0f0  78 24 3d a4 53 57 49 50  72 65 66 69 78 28 4d 6f  |x$=.SWIPrefix(Mo|
0000b100  64 42 61 73 65 2c 42 75  66 66 65 72 2c 32 35 36  |dBase,Buffer,256|
0000b110  29 0d 2c 7e 11 fd 20 50  72 65 66 69 78 24 3c 3e  |).,~.. Prefix$<>|
0000b120  22 22 0d 2c 88 1e 4d 6f  64 4e 61 6d 65 24 3d a4  |"".,..ModName$=.|
0000b130  4d 6f 64 4e 61 6d 65 28  4d 6f 64 42 61 73 65 29  |ModName(ModBase)|
0000b140  0d 2c 92 06 3d b9 0d 2c  9c 05 3a 0d 2c a6 17 dd  |.,..=..,..:.,...|
0000b150  20 a4 4d 6f 64 4e 61 6d  65 28 4d 6f 64 42 61 73  | .ModName(ModBas|
0000b160  65 29 0d 2c b0 40 f4 20  46 69 6e 64 20 61 20 6d  |e).,.@. Find a m|
0000b170  6f 64 75 6c 65 20 6e 61  6d 65 20 28 53 57 49 20  |odule name (SWI |
0000b180  70 72 65 66 69 78 29 20  67 69 76 65 6e 20 61 20  |prefix) given a |
0000b190  6d 6f 64 75 6c 65 20 62  61 73 65 20 6e 75 6d 62  |module base numb|
0000b1a0  65 72 0d 2c ba 1d 4d 6f  64 4e 61 6d 65 24 3d 22  |er.,..ModName$="|
0000b1b0  22 3a 53 74 72 69 6e 67  43 6f 75 6e 74 3d 30 0d  |":StringCount=0.|
0000b1c0  2c c4 2e c8 95 20 3f 28  4d 6f 64 42 61 73 65 2b  |,.... ?(ModBase+|
0000b1d0  28 4d 6f 64 42 61 73 65  21 31 36 29 2b 53 74 72  |(ModBase!16)+Str|
0000b1e0  69 6e 67 43 6f 75 6e 74  29 3e 3d 33 32 0d 2c ce  |ingCount)>=32.,.|
0000b1f0  36 20 20 4d 6f 64 4e 61  6d 65 24 2b 3d bd 28 3f  |6  ModName$+=.(?|
0000b200  28 4d 6f 64 42 61 73 65  2b 28 4d 6f 64 42 61 73  |(ModBase+(ModBas|
0000b210  65 21 31 36 29 2b 53 74  72 69 6e 67 43 6f 75 6e  |e!16)+StringCoun|
0000b220  74 29 29 0d 2c d8 14 20  20 53 74 72 69 6e 67 43  |t)).,..  StringC|
0000b230  6f 75 6e 74 2b 3d 31 0d  2c e2 05 ce 0d 2c ec 0d  |ount+=1.,....,..|
0000b240  3d 4d 6f 64 4e 61 6d 65  24 0d 2c f6 05 3a 0d 2d  |=ModName$.,..:.-|
0000b250  00 2a dd 20 a4 53 57 49  50 72 65 66 69 78 28 4d  |.*. .SWIPrefix(M|
0000b260  6f 64 42 61 73 65 2c 42  75 66 66 65 72 2c 42 75  |odBase,Buffer,Bu|
0000b270  66 66 65 72 4c 65 6e 29  0d 2d 0a 17 53 57 49 4e  |fferLen).-..SWIN|
0000b280  75 6d 3d 28 4d 6f 64 42  61 73 65 21 32 38 29 0d  |um=(ModBase!28).|
0000b290  2d 14 3d c8 99 20 22 4f  53 5f 53 57 49 4e 75 6d  |-.=.. "OS_SWINum|
0000b2a0  62 65 72 54 6f 53 74 72  69 6e 67 22 2c 53 57 49  |berToString",SWI|
0000b2b0  4e 75 6d 2c 42 75 66 66  65 72 2c 42 75 66 66 65  |Num,Buffer,Buffe|
0000b2c0  72 4c 65 6e 20 b8 20 2c  2c 4c 65 6e 0d 2d 1e 15  |rLen . ,,Len.-..|
0000b2d0  42 75 66 66 65 72 3f 28  4c 65 6e 2d 31 29 3d 31  |Buffer?(Len-1)=1|
0000b2e0  33 0d 2d 28 13 41 3d a7  24 42 75 66 66 65 72 2c  |3.-(.A=.$Buffer,|
0000b2f0  22 5f 22 29 0d 2d 32 0f  e7 20 41 3d 30 20 8c 20  |"_").-2.. A=0 . |
0000b300  3d 22 22 0d 2d 3c 12 3d  c0 24 42 75 66 66 65 72  |="".-<.=.$Buffer|
0000b310  2c 41 2d 31 29 0d 2d 46  05 3a 0d 2d 50 32 dd 20  |,A-1).-F.:.-P2. |
0000b320  a4 53 57 49 4e 61 6d 65  28 53 57 49 4e 75 6d 2c  |.SWIName(SWINum,|
0000b330  42 75 66 66 65 72 2c 42  75 66 66 65 72 4c 65 6e  |Buffer,BufferLen|
0000b340  2c 53 57 49 43 6f 75 6e  74 65 72 29 0d 2d 5a 3f  |,SWICounter).-Z?|
0000b350  f4 20 54 68 69 73 20 66  75 6e 63 74 69 6f 6e 20  |. This function |
0000b360  72 65 74 75 72 6e 73 20  61 20 53 57 49 20 6e 61  |returns a SWI na|
0000b370  6d 65 20 77 69 74 68 20  69 74 73 20 70 72 65 66  |me with its pref|
0000b380  69 78 20 72 65 6d 6f 76  65 64 2e 0d 2d 64 35 f4  |ix removed..-d5.|
0000b390  20 55 6e 64 65 66 69 6e  65 64 20 53 57 49 73 20  | Undefined SWIs |
0000b3a0  61 72 65 20 72 65 74 75  72 6e 65 64 20 61 73 20  |are returned as |
0000b3b0  61 6e 20 65 6d 70 74 79  20 73 74 72 69 6e 67 2e  |an empty string.|
0000b3c0  0d 2d 6e 3e f4 20 54 68  65 20 6c 61 73 74 20 70  |.-n>. The last p|
0000b3d0  61 72 61 6d 65 74 65 72  20 28 53 57 49 43 6f 75  |arameter (SWICou|
0000b3e0  6e 74 65 72 29 20 69 73  20 74 68 65 20 6e 75 6d  |nter) is the num|
0000b3f0  62 65 72 20 6f 66 20 74  68 65 20 53 57 49 0d 2d  |ber of the SWI.-|
0000b400  78 3f f4 20 77 69 74 68  69 6e 20 74 68 65 20 6d  |x?. within the m|
0000b410  6f 64 75 6c 65 2e 20 57  65 20 6e 65 65 64 20 69  |odule. We need i|
0000b420  74 20 73 6f 20 74 68 61  74 20 77 65 20 63 61 6e  |t so that we can|
0000b430  20 72 65 74 75 72 6e 20  61 73 20 61 6e 0d 2d 82  | return as an.-.|
0000b440  40 f4 20 65 6d 70 74 79  20 73 74 72 69 6e 67 20  |@. empty string |
0000b450  53 57 49 73 20 6f 66 20  74 68 65 20 66 6f 72 6d  |SWIs of the form|
0000b460  20 22 4d 6f 64 75 6c 65  5f 23 23 22 20 28 69 2e  | "Module_##" (i.|
0000b470  65 2e 20 75 6e 64 65 66  69 6e 65 64 2c 0d 2d 8c  |e. undefined,.-.|
0000b480  29 f4 20 77 68 65 72 65  20 23 23 20 69 73 20 61  |). where ## is a|
0000b490  20 6e 75 6d 62 65 72 20  66 72 6f 6d 20 30 20 74  | number from 0 t|
0000b4a0  6f 20 36 33 29 2e 0d 2d  96 07 20 20 3a 0d 2d a0  |o 63)..-..  :.-.|
0000b4b0  3d c8 99 20 22 4f 53 5f  53 57 49 4e 75 6d 62 65  |=.. "OS_SWINumbe|
0000b4c0  72 54 6f 53 74 72 69 6e  67 22 2c 53 57 49 4e 75  |rToString",SWINu|
0000b4d0  6d 2c 42 75 66 66 65 72  2c 42 75 66 66 65 72 4c  |m,Buffer,BufferL|
0000b4e0  65 6e 20 b8 20 2c 2c 4c  65 6e 0d 2d aa 15 42 75  |en . ,,Len.-..Bu|
0000b4f0  66 66 65 72 3f 28 4c 65  6e 2d 31 29 3d 31 33 0d  |ffer?(Len-1)=13.|
0000b500  2d b4 13 41 3d a7 24 42  75 66 66 65 72 2c 22 5f  |-..A=.$Buffer,"_|
0000b510  22 29 0d 2d be 0f e7 20  41 3d 30 20 8c 20 3d 22  |").-... A=0 . ="|
0000b520  22 0d 2d c8 22 24 42 75  66 66 65 72 3d c2 24 42  |".-."$Buffer=.$B|
0000b530  75 66 66 65 72 2c a9 28  24 42 75 66 66 65 72 29  |uffer,.($Buffer)|
0000b540  2d 41 29 0d 2d d2 21 e7  20 24 42 75 66 66 65 72  |-A).-.!. $Buffer|
0000b550  3d c3 28 53 57 49 43 6f  75 6e 74 65 72 29 20 8c  |=.(SWICounter) .|
0000b560  20 3d 22 22 0d 2d dc 1f  e7 20 24 42 75 66 66 65  | ="".-... $Buffe|
0000b570  72 3d 22 55 6e 64 65 66  69 6e 65 64 22 20 8c 20  |r="Undefined" . |
0000b580  3d 22 22 0d 2d e6 19 e7  20 24 42 75 66 66 65 72  |="".-... $Buffer|
0000b590  3d 22 4e 4f 50 22 20 8c  20 3d 22 22 0d 2d f0 33  |="NOP" . ="".-.3|
0000b5a0  e7 20 c0 24 42 75 66 66  65 72 2c 38 29 3d 22 52  |. .$Buffer,8)="R|
0000b5b0  65 73 65 72 76 65 64 22  20 80 20 a9 28 24 42 75  |eserved" . .($Bu|
0000b5c0  66 66 65 72 29 3c 3d 31  30 20 8c 20 3d 22 22 0d  |ffer)<=10 . ="".|
0000b5d0  2d fa 0c 3d 24 42 75 66  66 65 72 0d 2e 04 05 3a  |-..=$Buffer....:|
0000b5e0  0d 2e 0e 21 dd 20 a4 43  6f 75 6e 74 4c 6f 61 64  |...!. .CountLoad|
0000b5f0  65 64 4d 6f 64 75 6c 65  73 57 69 74 68 53 57 49  |edModulesWithSWI|
0000b600  73 0d 2e 18 11 43 6f 75  6e 74 65 72 3d 30 3a 4e  |s....Counter=0:N|
0000b610  3d 30 0d 2e 22 1e f5 20  fd 20 ac 20 a4 4d 6f 72  |=0..".. . . .Mor|
0000b620  65 4d 6f 64 73 28 4e 2c  43 6f 75 6e 74 65 72 29  |eMods(N,Counter)|
0000b630  0d 2e 2c 0c 3d 43 6f 75  6e 74 65 72 0d 2e 36 05  |..,.=Counter..6.|
0000b640  3a 0d 2e 40 19 dd 20 a4  43 6f 75 6e 74 53 57 49  |:..@.. .CountSWI|
0000b650  73 28 4d 6f 64 42 61 73  65 29 0d 2e 4a 21 53 57  |s(ModBase)..J!SW|
0000b660  49 4e 75 6d 3d 28 4d 6f  64 42 61 73 65 21 32 38  |INum=(ModBase!28|
0000b670  29 3a 43 6f 75 6e 74 65  72 3d 30 0d 2e 54 3d f4  |):Counter=0..T=.|
0000b680  20 57 65 20 6d 75 73 74  20 65 78 61 6d 69 6e 65  | We must examine|
0000b690  20 61 6c 6c 20 53 57 49  73 20 28 75 70 20 74 6f  | all SWIs (up to|
0000b6a0  20 36 34 20 64 65 66 69  6e 65 64 20 70 65 72 20  | 64 defined per |
0000b6b0  6d 6f 64 75 6c 65 29 2e  0d 2e 5e 32 f4 20 55 6e  |module)...^2. Un|
0000b6c0  66 6f 72 74 75 6e 61 74  65 6c 79 2c 20 77 65 20  |fortunately, we |
0000b6d0  63 61 6e 27 74 20 73 74  6f 70 20 77 68 65 6e 20  |can't stop when |
0000b6e0  77 65 20 66 69 6e 64 20  61 6e 0d 2e 68 3a f4 20  |we find an..h:. |
0000b6f0  75 6e 64 65 66 69 6e 65  64 20 53 57 49 2c 20 62  |undefined SWI, b|
0000b700  65 63 61 75 73 65 20 74  68 65 20 64 65 66 69 6e  |ecause the defin|
0000b710  65 64 20 53 57 49 73 20  64 6f 6e 27 74 20 61 6c  |ed SWIs don't al|
0000b720  77 61 79 73 0d 2e 72 39  f4 20 61 70 70 65 61 72  |ways..r9. appear|
0000b730  20 69 6e 20 61 20 63 6f  6e 74 69 67 75 6f 75 73  | in a contiguous|
0000b740  20 62 6c 6f 63 6b 2e 20  54 68 65 72 65 66 6f 72  | block. Therefor|
0000b750  65 2c 20 77 65 20 68 61  76 65 20 74 6f 0d 2e 7c  |e, we have to..||
0000b760  30 f4 20 73 65 61 72 63  68 20 74 68 72 6f 75 67  |0. search throug|
0000b770  68 20 61 6c 6c 20 36 34  20 53 57 49 73 20 69 6e  |h all 64 SWIs in|
0000b780  20 65 61 63 68 20 6d 6f  64 75 6c 65 2e 0d 2e 86  | each module....|
0000b790  05 f5 0d 2e 90 38 20 20  41 24 3d a4 53 57 49 4e  |.....8  A$=.SWIN|
0000b7a0  61 6d 65 28 53 57 49 4e  75 6d 2c 42 75 66 66 65  |ame(SWINum,Buffe|
0000b7b0  72 2c 32 35 36 2c 53 57  49 4e 75 6d 2d 28 4d 6f  |r,256,SWINum-(Mo|
0000b7c0  64 42 61 73 65 21 32 38  29 29 0d 2e 9a 1b 20 20  |dBase!28))....  |
0000b7d0  e7 20 41 24 3c 3e 22 22  20 8c 20 43 6f 75 6e 74  |. A$<>"" . Count|
0000b7e0  65 72 2b 3d 31 0d 2e a4  0f 20 20 53 57 49 4e 75  |er+=1....  SWINu|
0000b7f0  6d 2b 3d 31 0d 2e ae 1c  fd 20 53 57 49 4e 75 6d  |m+=1..... SWINum|
0000b800  3d 28 4d 6f 64 42 61 73  65 21 32 38 29 2b 36 34  |=(ModBase!28)+64|
0000b810  0d 2e b8 0c 3d 43 6f 75  6e 74 65 72 0d 2e c2 05  |....=Counter....|
0000b820  3a 0d 2e cc 1e dd 20 a4  4d 6f 72 65 4d 6f 64 73  |:..... .MoreMods|
0000b830  28 f8 20 4e 2c f8 20 43  6f 75 6e 74 65 72 29 0d  |(. N,. Counter).|
0000b840  2e d6 07 ea 20 85 0d 2e  e0 10 ee 20 85 20 ea 20  |.... ...... . . |
0000b850  f7 20 85 3a 3d a3 0d 2e  ea 23 49 6e 73 4e 75 6d  |. .:=....#InsNum|
0000b860  3d 30 3a f4 20 49 6e 73  74 61 6e 74 69 61 74 69  |=0:. Instantiati|
0000b870  6f 6e 20 6e 75 6d 62 65  72 0d 2e f4 05 f5 0d 2e  |on number.......|
0000b880  fe 2a 20 20 f4 20 49 67  6e 6f 72 65 20 61 6c 74  |.*  . Ignore alt|
0000b890  65 72 6e 61 74 69 76 65  20 69 6e 73 74 61 6e 74  |ernative instant|
0000b8a0  69 61 74 69 6f 6e 73 3a  0d 2f 08 24 20 20 f4 20  |iations:./.$  . |
0000b8b0  74 68 65 79 20 61 6c 6c  20 68 61 76 65 20 74 68  |they all have th|
0000b8c0  65 20 73 61 6d 65 20 53  57 49 73 2e 0d 2f 12 34  |e same SWIs../.4|
0000b8d0  20 20 c8 99 20 22 4f 53  5f 4d 6f 64 75 6c 65 22  |  .. "OS_Module"|
0000b8e0  2c 31 32 2c 4e 2c 49 6e  73 4e 75 6d 20 b8 20 2c  |,12,N,InsNum . ,|
0000b8f0  4e 2c 49 6e 73 4e 75 6d  2c 4d 6f 64 42 61 73 65  |N,InsNum,ModBase|
0000b900  0d 2f 1c 0e fd 20 49 6e  73 4e 75 6d 3d 30 0d 2f  |./... InsNum=0./|
0000b910  26 17 e7 20 28 4d 6f 64  42 61 73 65 21 32 38 29  |&.. (ModBase!28)|
0000b920  3c 3e 30 20 8c 0d 2f 30  3f 20 20 c8 99 20 22 4f  |<>0 ../0?  .. "O|
0000b930  53 5f 53 57 49 4e 75 6d  62 65 72 54 6f 53 74 72  |S_SWINumberToStr|
0000b940  69 6e 67 22 2c 28 4d 6f  64 42 61 73 65 21 32 38  |ing",(ModBase!28|
0000b950  29 2c 42 75 66 66 65 72  2c 32 35 36 20 b8 20 2c  |),Buffer,256 . ,|
0000b960  2c 4c 65 6e 0d 2f 3a 17  20 20 42 75 66 66 65 72  |,Len./:.  Buffer|
0000b970  3f 28 4c 65 6e 2d 31 29  3d 31 33 0d 2f 44 15 20  |?(Len-1)=13./D. |
0000b980  20 41 3d a7 24 42 75 66  66 65 72 2c 22 5f 22 29  | A=.$Buffer,"_")|
0000b990  0d 2f 4e 18 20 20 e7 20  41 3e 30 20 8c 20 43 6f  |./N.  . A>0 . Co|
0000b9a0  75 6e 74 65 72 2b 3d 31  0d 2f 58 05 cd 0d 2f 62  |unter+=1./X.../b|
0000b9b0  06 3d b9 0d 2f 6c 05 3a  0d 2f 76 1c dd 20 f2 54  |.=../l.:./v.. .T|
0000b9c0  69 63 6b 50 52 4d 63 68  6f 69 63 65 28 f8 20 50  |ickPRMchoice(. P|
0000b9d0  52 4d 24 29 0d 2f 80 43  f4 20 54 68 65 20 66 6f  |RM$)./.C. The fo|
0000b9e0  6c 6c 6f 77 69 6e 67 20  77 69 6c 6c 20 66 69 6e  |llowing will fin|
0000b9f0  64 20 74 68 65 20 50 52  4d 20 66 69 6c 65 20 69  |d the PRM file i|
0000ba00  6e 20 74 68 65 20 6d 65  6e 75 20 61 6e 64 20 74  |n the menu and t|
0000ba10  69 63 6b 20 69 74 2c 0d  2f 8a 38 f4 20 6f 72 20  |ick it,./.8. or |
0000ba20  74 69 63 6b 20 74 68 65  20 66 69 72 73 74 20 69  |tick the first i|
0000ba30  74 65 6d 20 69 66 20 74  68 65 20 66 69 6c 65 20  |tem if the file |
0000ba40  69 73 20 6e 6f 74 20 70  72 65 73 65 6e 74 3a 0d  |is not present:.|
0000ba50  2f 94 1b 4d 25 3d 50 52  4d 4d 65 6e 75 2b 34 3a  |/..M%=PRMMenu+4:|
0000ba60  43 6f 75 6e 74 65 72 3d  2d 31 0d 2f 9e 05 f5 0d  |Counter=-1./....|
0000ba70  2f a8 17 20 20 4d 25 2b  3d 32 34 3a 43 6f 75 6e  |/..  M%+=24:Coun|
0000ba80  74 65 72 2b 3d 31 0d 2f  b2 32 fd 20 28 24 28 4d  |ter+=1./.2. ($(M|
0000ba90  25 2b 31 32 29 3d 50 52  4d 24 29 20 84 20 28 28  |%+12)=PRM$) . ((|
0000baa0  28 4d 25 21 30 29 20 80  20 28 31 3c 3c 37 29 29  |(M%!0) . (1<<7))|
0000bab0  3d 28 31 3c 3c 37 29 29  0d 2f bc 67 e7 20 24 28  |=(1<<7))./.g. $(|
0000bac0  4d 25 2b 31 32 29 3d 50  52 4d 24 20 8c 20 f2 54  |M%+12)=PRM$ . .T|
0000bad0  69 63 6b 4d 65 6e 75 28  50 52 4d 4d 65 6e 75 2c  |ickMenu(PRMMenu,|
0000bae0  43 6f 75 6e 74 65 72 2c  b9 29 20 8b 20 4d 25 3d  |Counter,.) . M%=|
0000baf0  50 52 4d 4d 65 6e 75 2b  32 38 3a 50 52 4d 24 3d  |PRMMenu+28:PRM$=|
0000bb00  24 28 4d 25 2b 31 32 29  3a f2 54 69 63 6b 4d 65  |$(M%+12):.TickMe|
0000bb10  6e 75 28 50 52 4d 4d 65  6e 75 2c 30 2c b9 29 0d  |nu(PRMMenu,0,.).|
0000bb20  2f c6 05 e1 0d 2f d0 05  3a 0d 2f da 20 dd 20 a4  |/..../..:./. . .|
0000bb30  50 61 67 65 49 6e 64 65  78 50 72 65 73 65 6e 74  |PageIndexPresent|
0000bb40  28 50 72 65 66 69 78 24  29 0d 2f e4 14 41 64 64  |(Prefix$)./..Add|
0000bb50  72 65 73 73 3d 50 52 4d  53 74 6f 72 65 0d 2f ee  |ress=PRMStore./.|
0000bb60  05 f5 0d 2f f8 13 20 20  41 24 3d 24 28 41 64 64  |.../..  A$=$(Add|
0000bb70  72 65 73 73 29 0d 30 02  16 20 20 41 64 64 72 65  |ress).0..  Addre|
0000bb80  73 73 2b 3d a9 28 41 24  29 2b 31 0d 30 0c 1f fd  |ss+=.(A$)+1.0...|
0000bb90  20 28 41 24 3d 22 2a 2a  2a 22 29 20 84 20 28 41  | (A$="***") . (A|
0000bba0  24 3d 50 72 65 66 69 78  24 29 0d 30 16 13 e7 20  |$=Prefix$).0... |
0000bbb0  41 24 3d 22 2a 2a 2a 22  20 8c 20 3d 30 0d 30 20  |A$="***" . =0.0 |
0000bbc0  0c 3d 41 64 64 72 65 73  73 0d 30 2a 05 3a 0d 30  |.=Address.0*.:.0|
0000bbd0  34 23 dd 20 a4 4c 6f 6f  6b 55 70 50 61 67 65 28  |4#. .LookUpPage(|
0000bbe0  53 57 49 4e 75 6d 2c f8  20 41 64 64 72 65 73 73  |SWINum,. Address|
0000bbf0  29 0d 30 3e 11 41 24 3d  24 28 41 64 64 72 65 73  |).0>.A$=$(Addres|
0000bc00  73 29 0d 30 48 18 e7 20  c0 41 24 2c 31 29 3c 3e  |s).0H.. .A$,1)<>|
0000bc10  22 26 22 20 8c 20 3d 22  2d 22 0d 30 52 19 41 64  |"&" . ="-".0R.Ad|
0000bc20  64 72 65 73 73 4f 66 66  73 65 74 3d 41 64 64 72  |dressOffset=Addr|
0000bc30  65 73 73 0d 30 5c 05 f5  0d 30 66 19 20 20 41 24  |ess.0\...0f.  A$|
0000bc40  3d 24 28 41 64 64 72 65  73 73 4f 66 66 73 65 74  |=$(AddressOffset|
0000bc50  29 0d 30 70 1c 20 20 41  64 64 72 65 73 73 4f 66  |).0p.  AddressOf|
0000bc60  66 73 65 74 2b 3d a9 28  41 24 29 2b 31 0d 30 7a  |fset+=.(A$)+1.0z|
0000bc70  34 fd 20 28 c0 41 24 2c  a7 41 24 2c 22 2c 22 29  |4. (.A$,.A$,",")|
0000bc80  2d 31 29 3d 22 26 22 2b  c3 7e 53 57 49 4e 75 6d  |-1)="&"+.~SWINum|
0000bc90  29 20 84 20 28 c0 41 24  2c 31 29 3c 3e 22 26 22  |) . (.A$,1)<>"&"|
0000bca0  29 0d 30 84 18 e7 20 c0  41 24 2c 31 29 3c 3e 22  |).0... .A$,1)<>"|
0000bcb0  26 22 20 8c 20 3d 22 2d  22 0d 30 8e 19 41 64 64  |&" . ="-".0..Add|
0000bcc0  72 65 73 73 3d 41 64 64  72 65 73 73 4f 66 66 73  |ress=AddressOffs|
0000bcd0  65 74 0d 30 98 18 3d c2  41 24 2c a9 28 41 24 29  |et.0..=.A$,.(A$)|
0000bce0  2d a7 41 24 2c 22 2c 22  29 29 0d 30 a2 05 3a 0d  |-.A$,",")).0..:.|
0000bcf0  30 ac 19 dd 20 f2 4c 6f  61 64 50 52 4d 49 6e 64  |0... .LoadPRMInd|
0000bd00  65 78 28 50 52 4d 24 29  0d 30 b6 4c f4 20 57 65  |ex(PRM$).0.L. We|
0000bd10  20 77 61 6e 74 20 74 6f  20 6c 6f 61 64 20 74 68  | want to load th|
0000bd20  65 20 50 52 4d 20 49 6e  64 65 78 20 66 69 6c 65  |e PRM Index file|
0000bd30  20 69 6e 74 6f 20 6d 65  6d 6f 72 79 20 66 6f 72  | into memory for|
0000bd40  20 66 61 73 74 65 72 20  72 65 66 65 72 65 6e 63  | faster referenc|
0000bd50  69 6e 67 2e 0d 30 c0 44  f4 20 50 52 4d 53 74 6f  |ing..0.D. PRMSto|
0000bd60  72 65 20 69 73 20 64 65  66 69 6e 65 64 20 77 68  |re is defined wh|
0000bd70  65 6e 20 74 68 65 20 6d  65 6e 75 73 20 61 72 65  |en the menus are|
0000bd80  20 62 65 69 6e 67 20 62  75 69 6c 74 20 61 74 20  | being built at |
0000bd90  73 74 61 72 74 75 70 2e  0d 30 ca 42 c8 99 20 22  |startup..0.B.. "|
0000bda0  4f 53 5f 46 69 6c 65 22  2c 31 36 2c 4f 75 72 50  |OS_File",16,OurP|
0000bdb0  61 74 68 4e 61 6d 65 24  2b 22 21 53 57 49 a0 49  |athName$+"!SWI.I|
0000bdc0  6e 64 65 78 2e 50 52 4d  2e 22 2b 50 52 4d 24 2c  |ndex.PRM."+PRM$,|
0000bdd0  50 52 4d 53 74 6f 72 65  2c 30 0d 30 d4 05 e1 0d  |PRMStore,0.0....|
0000bde0  30 de 05 3a 0d 30 e8 13  dd 20 a4 42 75 69 6c 64  |0..:.0... .Build|
0000bdf0  50 52 4d 4d 65 6e 75 0d  30 f2 0e 4d 25 3d 50 52  |PRMMenu.0..M%=PR|
0000be00  4d 4d 65 6e 75 0d 30 fc  4c 54 69 74 6c 65 24 3d  |MMenu.0.LTitle$=|
0000be10  22 50 52 4d 20 45 64 69  74 69 6f 6e 22 3a de 20  |"PRM Edition":. |
0000be20  50 52 4d 4d 65 6e 75 54  69 74 6c 65 20 a9 28 54  |PRMMenuTitle .(T|
0000be30  69 74 6c 65 24 29 2b 31  3a 24 50 52 4d 4d 65 6e  |itle$)+1:$PRMMen|
0000be40  75 54 69 74 6c 65 3d 54  69 74 6c 65 24 2b bd 31  |uTitle=Title$+.1|
0000be50  33 0d 31 06 1b f2 4d 65  6e 75 49 6e 69 74 28 50  |3.1...MenuInit(P|
0000be60  52 4d 4d 65 6e 75 54 69  74 6c 65 29 0d 31 10 47  |RMMenuTitle).1.G|
0000be70  f4 20 54 68 65 20 66 6f  6c 6c 6f 77 69 6e 67 20  |. The following |
0000be80  63 6f 64 65 20 77 69 6c  6c 20 62 75 69 6c 64 20  |code will build |
0000be90  74 68 65 20 50 52 4d 20  45 64 69 74 69 6f 6e 20  |the PRM Edition |
0000bea0  6d 65 6e 75 2c 20 61 6e  64 20 77 69 6c 6c 20 61  |menu, and will a|
0000beb0  6c 73 6f 0d 31 1a 48 f4  20 66 69 6e 64 20 6f 75  |lso.1.H. find ou|
0000bec0  74 20 74 68 65 20 73 69  7a 65 20 6f 66 20 74 68  |t the size of th|
0000bed0  65 20 6c 61 72 67 65 73  74 20 50 52 4d 20 66 69  |e largest PRM fi|
0000bee0  6c 65 20 73 6f 20 74 68  61 74 20 77 65 20 63 61  |le so that we ca|
0000bef0  6e 20 70 75 74 20 61 73  69 64 65 0d 31 24 41 f4  |n put aside.1$A.|
0000bf00  20 74 68 61 74 20 61 6d  6f 75 6e 74 20 6f 66 20  | that amount of |
0000bf10  6d 65 6d 6f 72 79 20 74  6f 20 6c 6f 61 64 20 61  |memory to load a|
0000bf20  6e 79 20 72 65 71 75 65  73 74 65 64 20 50 52 4d  |ny requested PRM|
0000bf30  20 69 6e 64 65 78 20 66  69 6c 65 2e 0d 31 2e 17  | index file..1..|
0000bf40  46 69 6c 65 3d 30 3a 4c  61 72 67 65 73 74 50 52  |File=0:LargestPR|
0000bf50  4d 3d 30 0d 31 38 0f c8  95 20 46 69 6c 65 3c 3e  |M=0.18... File<>|
0000bf60  2d 31 0d 31 42 4a 20 20  c8 99 20 22 4f 53 5f 47  |-1.1BJ  .. "OS_G|
0000bf70  42 50 42 22 2c 31 30 2c  22 3c 53 57 49 49 6e 64  |BPB",10,"<SWIInd|
0000bf80  65 78 24 44 69 72 3e 2e  50 52 4d 22 2c 42 6c 6f  |ex$Dir>.PRM",Blo|
0000bf90  63 6b 2c 31 2c 46 69 6c  65 2c 32 35 36 2c 22 2a  |ck,1,File,256,"*|
0000bfa0  22 20 b8 20 2c 2c 2c 2c  46 69 6c 65 0d 31 4c 2f  |" . ,,,,File.1L/|
0000bfb0  20 20 e7 20 4c 61 72 67  65 73 74 50 52 4d 3c 42  |  . LargestPRM<B|
0000bfc0  6c 6f 63 6b 21 38 20 8c  20 4c 61 72 67 65 73 74  |lock!8 . Largest|
0000bfd0  50 52 4d 3d 42 6c 6f 63  6b 21 38 0d 31 56 3d 20  |PRM=Block!8.1V= |
0000bfe0  20 4e 61 6d 65 24 3d 22  22 3a 4e 3d 32 30 3a c8  | Name$="":N=20:.|
0000bff0  95 20 28 42 6c 6f 63 6b  3f 4e 29 3e 3d 33 32 3a  |. (Block?N)>=32:|
0000c000  4e 61 6d 65 24 2b 3d bd  28 42 6c 6f 63 6b 3f 4e  |Name$+=.(Block?N|
0000c010  29 3a 4e 2b 3d 31 3a ce  0d 31 60 4c 20 20 e7 20  |):N+=1:..1`L  . |
0000c020  28 28 42 6c 6f 63 6b 21  31 36 3e 2d 31 29 20 80  |((Block!16>-1) .|
0000c030  20 28 42 6c 6f 63 6b 21  31 36 3c 34 30 39 36 29  | (Block!16<4096)|
0000c040  29 20 80 20 46 69 6c 65  3c 3e 2d 31 20 8c 20 f2  |) . File<>-1 . .|
0000c050  4d 65 6e 75 49 74 65 6d  28 4e 61 6d 65 24 2c 30  |MenuItem(Name$,0|
0000c060  2c 2d 31 29 0d 31 6a 05  ce 0d 31 74 45 50 25 2d  |,-1).1j...1tEP%-|
0000c070  3d 32 34 3a f4 20 52 65  73 65 74 20 6d 65 6e 75  |=24:. Reset menu|
0000c080  20 69 74 65 6d 20 70 6f  69 6e 74 65 72 20 74 6f  | item pointer to|
0000c090  20 66 69 6e 61 6c 20 69  74 65 6d 20 61 6e 64 20  | final item and |
0000c0a0  6d 61 72 6b 20 61 73 20  27 6c 61 73 74 27 0d 31  |mark as 'last'.1|
0000c0b0  7e 1f 50 25 21 30 3d 28  28 50 25 21 30 29 20 80  |~.P%!0=((P%!0) .|
0000c0c0  20 ac 20 31 32 38 29 20  82 20 31 32 38 0d 31 88  | . 128) . 128.1.|
0000c0d0  49 e7 20 77 69 6d 70 3e  3d 33 31 30 20 8c 20 4d  |I. wimp>=310 . M|
0000c0e0  25 21 32 38 3d 28 28 28  4d 25 21 32 38 29 20 80  |%!28=(((M%!28) .|
0000c0f0  20 ac 20 32 35 36 29 20  82 20 32 35 36 29 3a f4  | . 256) . 256):.|
0000c100  20 49 6e 64 69 72 65 63  74 65 64 20 6d 65 6e 75  | Indirected menu|
0000c110  20 74 69 74 6c 65 0d 31  92 4c f4 20 57 65 20 6d  | title.1.L. We m|
0000c120  75 73 74 20 62 65 20 61  62 73 6f 6c 75 74 65 6c  |ust be absolutel|
0000c130  79 20 73 75 72 65 20 74  68 61 74 20 4c 61 72 67  |y sure that Larg|
0000c140  65 73 74 50 52 4d 20 69  73 20 61 20 6d 75 6c 74  |estPRM is a mult|
0000c150  69 70 6c 65 20 6f 66 20  34 3a 20 69 66 20 6e 6f  |iple of 4: if no|
0000c160  74 2c 0d 31 9c 4a f4 20  74 68 65 6e 20 50 52 4f  |t,.1.J. then PRO|
0000c170  43 53 63 61 6e 4d 6f 64  75 6c 65 73 20 77 6f 75  |CScanModules wou|
0000c180  6c 64 20 74 72 79 20 74  6f 20 62 75 69 6c 64 20  |ld try to build |
0000c190  74 68 65 20 69 6e 64 65  78 20 6d 65 6e 75 20 6f  |the index menu o|
0000c1a0  6e 20 61 6e 20 61 64 64  72 65 73 73 0d 31 a6 4b  |n an address.1.K|
0000c1b0  f4 20 77 68 69 63 68 20  66 61 6c 6c 73 20 61 63  |. which falls ac|
0000c1c0  72 6f 73 73 20 61 20 77  6f 72 64 20 62 6f 75 6e  |ross a word boun|
0000c1d0  64 61 72 79 2c 20 77 68  69 63 68 20 77 6f 75 6c  |dary, which woul|
0000c1e0  64 20 72 65 73 75 6c 74  20 69 6e 20 61 6e 20 27  |d result in an '|
0000c1f0  49 6e 76 61 6c 69 64 0d  31 b0 4d f4 20 77 69 6e  |Invalid.1.M. win|
0000c200  64 6f 77 20 68 61 6e 64  6c 65 27 20 65 72 72 6f  |dow handle' erro|
0000c210  72 20 77 68 65 6e 20 74  72 79 69 6e 67 20 74 6f  |r when trying to|
0000c220  20 61 63 63 65 73 73 20  74 68 65 20 6d 65 6e 75  | access the menu|
0000c230  2e 20 54 68 65 20 6e 65  78 74 20 6c 69 6e 65 20  |. The next line |
0000c240  77 69 6c 6c 0d 31 ba 4d  f4 20 69 6e 63 72 65 61  |will.1.M. increa|
0000c250  73 65 20 4c 61 72 67 65  73 74 50 52 4d 20 62 79  |se LargestPRM by|
0000c260  20 75 70 20 74 6f 20 33  20 62 79 74 65 73 20 74  | up to 3 bytes t|
0000c270  6f 20 6d 61 6b 65 20 69  74 20 61 20 77 68 6f 6c  |o make it a whol|
0000c280  65 20 6e 75 6d 62 65 72  20 6f 66 20 77 6f 72 64  |e number of word|
0000c290  73 0d 31 c4 0b f4 20 6c  6f 6e 67 3a 0d 31 ce 22  |s.1... long:.1."|
0000c2a0  4c 61 72 67 65 73 74 50  52 4d 2b 3d 34 2d 28 4c  |LargestPRM+=4-(L|
0000c2b0  61 72 67 65 73 74 50 52  4d 20 83 20 34 29 0d 31  |argestPRM . 4).1|
0000c2c0  d8 0f 3d 4c 61 72 67 65  73 74 50 52 4d 0d 31 e2  |..=LargestPRM.1.|
0000c2d0  05 3a 0d 31 ec 21 dd 20  f2 43 72 65 61 74 65 50  |.:.1.!. .CreateP|
0000c2e0  52 4d 53 74 6f 72 65 28  4c 61 72 67 65 73 74 50  |RMStore(LargestP|
0000c2f0  52 4d 29 0d 31 f6 30 50  52 4d 53 74 6f 72 65 3d  |RM).1.0PRMStore=|
0000c300  a4 41 6c 6c 6f 63 61 74  65 4d 65 6d 6f 72 79 28  |.AllocateMemory(|
0000c310  41 70 70 53 69 7a 65 2b  4c 61 72 67 65 73 74 50  |AppSize+LargestP|
0000c320  52 4d 29 0d 32 00 56 e7  20 50 52 4d 53 74 6f 72  |RM).2.V. PRMStor|
0000c330  65 3d 30 20 8c 20 44 6f  6e 65 3d b9 3a 85 20 39  |e=0 . Done=.:. 9|
0000c340  39 39 39 2c 22 55 6e 61  62 6c 65 20 74 6f 20 63  |999,"Unable to c|
0000c350  6c 61 69 6d 20 65 6e 6f  75 67 68 20 6d 65 6d 6f  |laim enough memo|
0000c360  72 79 20 74 6f 20 73 74  61 72 74 20 75 70 20 70  |ry to start up p|
0000c370  72 6f 70 65 72 6c 79 2e  22 0d 32 0a 1e 4d 69 6e  |roperly.".2..Min|
0000c380  53 69 7a 65 3d 41 70 70  53 69 7a 65 2b 4c 61 72  |Size=AppSize+Lar|
0000c390  67 65 73 74 50 52 4d 0d  32 14 28 50 52 4d 53 74  |gestPRM.2.(PRMSt|
0000c3a0  6f 72 65 3d 53 6c 6f 74  45 6e 64 3a 53 6c 6f 74  |ore=SlotEnd:Slot|
0000c3b0  45 6e 64 2b 3d 4c 61 72  67 65 73 74 50 52 4d 0d  |End+=LargestPRM.|
0000c3c0  32 1e 05 e1 0d 32 28 05  3a 0d 32 32 21 dd 20 a4  |2....2(.:.22!. .|
0000c3d0  53 61 76 65 53 57 49 4c  69 73 74 54 6f 46 69 6c  |SaveSWIListToFil|
0000c3e0  65 28 4f 75 74 70 75 74  24 29 0d 32 3c 07 ea 20  |e(Output$).2<.. |
0000c3f0  85 0d 32 46 51 ee 20 85  20 ea 20 f7 20 85 3a c8  |..2FQ. . . . .:.|
0000c400  99 20 22 48 6f 75 72 67  6c 61 73 73 5f 53 6d 61  |. "Hourglass_Sma|
0000c410  73 68 22 3a f2 43 6c 6f  73 65 46 69 6c 65 49 66  |sh":.CloseFileIf|
0000c420  50 6f 73 73 28 46 69 6c  65 29 3a 3d a3 3a f4 20  |Poss(File):=.:. |
0000c430  45 72 72 6f 72 20 77 72  69 74 69 6e 67 20 66 69  |Error writing fi|
0000c440  6c 65 0d 32 50 07 20 20  3a 0d 32 5a 16 20 20 46  |le.2P.  :.2Z.  F|
0000c450  69 6c 65 3d ae 20 28 4f  75 74 70 75 74 24 29 0d  |ile=. (Output$).|
0000c460  32 64 12 20 20 e7 20 46  75 6c 6c 53 61 76 65 20  |2d.  . FullSave |
0000c470  8c 0d 32 6e 19 20 20 20  20 c8 99 20 22 48 6f 75  |..2n.    .. "Hou|
0000c480  72 67 6c 61 73 73 5f 4f  6e 22 0d 32 78 1e 20 20  |rglass_On".2x.  |
0000c490  20 20 e3 20 4e 3d 30 20  b8 20 54 6f 74 61 6c 4d  |  . N=0 . TotalM|
0000c4a0  6f 64 75 6c 65 73 2d 31  0d 32 82 38 20 20 20 20  |odules-1.2.8    |
0000c4b0  20 20 c8 99 20 22 48 6f  75 72 67 6c 61 73 73 5f  |  .. "Hourglass_|
0000c4c0  50 65 72 63 65 6e 74 61  67 65 22 2c 28 31 30 30  |Percentage",(100|
0000c4d0  2f 54 6f 74 61 6c 4d 6f  64 75 6c 65 73 29 2a 4e  |/TotalModules)*N|
0000c4e0  0d 32 8c 19 20 20 20 20  20 20 f2 57 72 69 74 65  |.2..      .Write|
0000c4f0  4d 6f 64 75 6c 65 28 4e  29 0d 32 96 2a 20 20 20  |Module(N).2.*   |
0000c500  20 20 20 e7 20 4e 3c 28  54 6f 74 61 6c 4d 6f 64  |   . N<(TotalMod|
0000c510  75 6c 65 73 2d 31 29 20  8c 20 d5 23 46 69 6c 65  |ules-1) . .#File|
0000c520  2c 22 22 0d 32 a0 09 20  20 20 20 ed 0d 32 aa 1a  |,"".2..    ..2..|
0000c530  20 20 20 20 c8 99 20 22  48 6f 75 72 67 6c 61 73  |    .. "Hourglas|
0000c540  73 5f 4f 66 66 22 0d 32  b4 07 20 20 cc 0d 32 be  |s_Off".2..  ..2.|
0000c550  3f 20 20 20 20 43 6f 75  6e 74 65 72 3d 30 3a f5  |?    Counter=0:.|
0000c560  3a 43 6f 75 6e 74 65 72  2b 3d 31 3a fd 20 a4 4d  |:Counter+=1:. .M|
0000c570  65 6e 75 54 69 63 6b 65  64 28 49 6e 64 65 78 4d  |enuTicked(IndexM|
0000c580  65 6e 75 2c 43 6f 75 6e  74 65 72 29 0d 32 c8 1f  |enu,Counter).2..|
0000c590  20 20 20 20 f2 57 72 69  74 65 4d 6f 64 75 6c 65  |    .WriteModule|
0000c5a0  28 43 6f 75 6e 74 65 72  2d 31 29 0d 32 d2 07 20  |(Counter-1).2.. |
0000c5b0  20 cd 0d 32 dc 0c 20 20  d9 23 46 69 6c 65 0d 32  | ..2..  .#File.2|
0000c5c0  e6 23 20 20 ff 28 22 53  65 74 74 79 70 65 20 22  |.#  .("Settype "|
0000c5d0  2b 4f 75 74 70 75 74 24  2b 22 20 54 65 78 74 22  |+Output$+" Text"|
0000c5e0  29 0d 32 f0 07 20 20 3a  0d 32 fa 06 3d b9 0d 33  |).2..  :.2..=..3|
0000c5f0  04 05 3a 0d 33 0e 1a dd  20 f2 57 72 69 74 65 4d  |..:.3... .WriteM|
0000c600  6f 64 75 6c 65 28 4d 6f  64 75 6c 65 29 0d 33 18  |odule(Module).3.|
0000c610  2c 4d 6f 64 75 6c 65 42  61 73 65 3d 21 28 4d 6f  |,ModuleBase=!(Mo|
0000c620  64 44 61 74 61 53 74 72  75 63 2b 28 33 32 2a 4d  |dDataStruc+(32*M|
0000c630  6f 64 75 6c 65 29 2b 31  29 0d 33 22 18 53 57 49  |odule)+1).3".SWI|
0000c640  4e 75 6d 3d 4d 6f 64 75  6c 65 42 61 73 65 21 32  |Num=ModuleBase!2|
0000c650  38 0d 33 2c 2d 50 72 65  66 69 78 24 3d a4 53 57  |8.3,-Prefix$=.SW|
0000c660  49 50 72 65 66 69 78 28  4d 6f 64 75 6c 65 42 61  |IPrefix(ModuleBa|
0000c670  73 65 2c 42 75 66 66 65  72 2c 32 35 36 29 0d 33  |se,Buffer,256).3|
0000c680  36 21 e7 20 4d 6f 64 75  6c 65 42 61 73 65 3d 30  |6!. ModuleBase=0|
0000c690  20 8c 20 50 72 65 66 69  78 24 3d 22 4f 53 22 0d  | . Prefix$="OS".|
0000c6a0  33 40 38 e7 20 50 72 65  66 69 78 24 3d 22 4f 53  |3@8. Prefix$="OS|
0000c6b0  22 20 8c 20 54 6f 70 4c  69 6d 69 74 3d 32 35 35  |" . TopLimit=255|
0000c6c0  3a 53 57 49 4e 75 6d 3d  30 20 8b 20 54 6f 70 4c  |:SWINum=0 . TopL|
0000c6d0  69 6d 69 74 3d 36 33 0d  33 4a 33 d5 23 46 69 6c  |imit=63.3J3.#Fil|
0000c6e0  65 2c 22 4d 6f 64 75 6c  65 3a 20 22 2b 24 28 4d  |e,"Module: "+$(M|
0000c6f0  6f 64 44 61 74 61 53 74  72 75 63 2b 28 33 32 2a  |odDataStruc+(32*|
0000c700  4d 6f 64 75 6c 65 29 2b  35 29 0d 33 54 14 e3 20  |Module)+5).3T.. |
0000c710  53 3d 30 20 b8 20 54 6f  70 4c 69 6d 69 74 0d 33  |S=0 . TopLimit.3|
0000c720  5e 2c 20 20 53 57 49 4e  61 6d 65 24 3d a4 53 57  |^,  SWIName$=.SW|
0000c730  49 4e 61 6d 65 28 53 57  49 4e 75 6d 2c 42 75 66  |IName(SWINum,Buf|
0000c740  66 65 72 2c 32 35 36 2c  53 29 0d 33 68 16 20 20  |fer,256,S).3h.  |
0000c750  e7 20 53 57 49 4e 61 6d  65 24 3c 3e 22 22 20 8c  |. SWIName$<>"" .|
0000c760  0d 33 72 12 20 20 20 20  41 24 3d c4 37 2c 22 20  |.3r.    A$=.7," |
0000c770  22 29 0d 33 7c 17 20 20  20 20 c2 41 24 29 3d c3  |").3|.    .A$)=.|
0000c780  7e 28 53 57 49 4e 75 6d  29 0d 33 86 0f 20 20 20  |~(SWINum).3..   |
0000c790  20 41 24 2b 3d 22 20 22  0d 33 90 17 20 20 20 20  | A$+=" ".3..    |
0000c7a0  41 24 2b 3d 50 72 65 66  69 78 24 2b 22 5f 22 0d  |A$+=Prefix$+"_".|
0000c7b0  33 9a 14 20 20 20 20 41  24 2b 3d 53 57 49 4e 61  |3..    A$+=SWINa|
0000c7c0  6d 65 24 0d 33 a4 11 20  20 20 20 d5 23 46 69 6c  |me$.3..    .#Fil|
0000c7d0  65 2c 41 24 0d 33 ae 07  20 20 cd 0d 33 b8 0f 20  |e,A$.3..  ..3.. |
0000c7e0  20 53 57 49 4e 75 6d 2b  3d 31 0d 33 c2 05 ed 0d  | SWINum+=1.3....|
0000c7f0  33 cc 2f e7 20 50 72 65  66 69 78 24 3d 22 4f 53  |3./. Prefix$="OS|
0000c800  22 20 8c 20 d5 23 46 69  6c 65 2c 22 20 20 20 20  |" . .#File,"    |
0000c810  31 30 30 20 4f 53 5f 57  72 69 74 65 49 22 0d 33  |100 OS_WriteI".3|
0000c820  d6 05 e1 0d 33 e0 05 3a  0d 33 ea 13 dd 20 a4 53  |....3..:.3... .S|
0000c830  61 76 65 53 65 74 74 69  6e 67 73 0d 33 f4 07 ea  |aveSettings.3...|
0000c840  20 85 0d 33 fe 3c ee 20  85 20 ea 20 f7 20 85 3a  | ..3.<. . . . .:|
0000c850  f2 43 6c 6f 73 65 46 69  6c 65 49 66 50 6f 73 73  |.CloseFileIfPoss|
0000c860  28 44 61 74 61 29 3a 3d  a3 3a f4 20 45 72 72 6f  |(Data):=.:. Erro|
0000c870  72 20 77 72 69 74 69 6e  67 20 66 69 6c 65 0d 34  |r writing file.4|
0000c880  08 07 20 20 3a 0d 34 12  28 20 20 44 61 74 61 3d  |..  :.4.(  Data=|
0000c890  ae 20 28 22 3c 53 57 49  49 6e 64 65 78 24 44 69  |. ("<SWIIndex$Di|
0000c8a0  72 3e 2e 53 65 74 74 69  6e 67 73 22 29 0d 34 1c  |r>.Settings").4.|
0000c8b0  3e 20 20 d5 23 44 61 74  61 2c 22 7c 20 58 20 61  |>  .#Data,"| X a|
0000c8c0  6e 64 20 59 20 67 72 69  64 20 63 6f 6f 72 64 69  |nd Y grid coordi|
0000c8d0  6e 61 74 65 73 20 6f 66  20 53 57 49 20 49 6e 64  |nates of SWI Ind|
0000c8e0  65 78 20 77 69 6e 64 6f  77 3a 22 0d 34 26 19 20  |ex window:".4&. |
0000c8f0  20 d5 23 44 61 74 61 2c  c3 28 58 50 6f 73 69 74  | .#Data,.(XPosit|
0000c900  69 6f 6e 29 0d 34 30 19  20 20 d5 23 44 61 74 61  |ion).40.  .#Data|
0000c910  2c c3 28 59 50 6f 73 69  74 69 6f 6e 29 0d 34 3a  |,.(YPosition).4:|
0000c920  1d 20 20 d5 23 44 61 74  61 2c 22 7c 20 50 52 4d  |.  .#Data,"| PRM|
0000c930  20 45 64 69 74 69 6f 6e  3a 22 0d 34 44 11 20 20  | Edition:".4D.  |
0000c940  d5 23 44 61 74 61 2c 50  52 4d 24 0d 34 4e 0c 20  |.#Data,PRM$.4N. |
0000c950  20 d9 23 44 61 74 61 0d  34 58 2f 20 20 ff 28 22  | .#Data.4X/  .("|
0000c960  53 65 74 74 79 70 65 20  3c 53 57 49 49 6e 64 65  |Settype <SWIInde|
0000c970  78 24 44 69 72 3e 2e 53  65 74 74 69 6e 67 73 20  |x$Dir>.Settings |
0000c980  54 65 78 74 22 29 0d 34  62 07 20 20 3a 0d 34 6c  |Text").4b.  :.4l|
0000c990  06 3d b9 0d 34 76 05 3a  0d 34 80 13 dd 20 a4 4c  |.=..4v.:.4... .L|
0000c9a0  6f 61 64 53 65 74 74 69  6e 67 73 0d 34 8a 07 ea  |oadSettings.4...|
0000c9b0  20 85 0d 34 94 4f ee 20  85 20 ea 20 f7 20 85 3a  | ..4.O. . . . .:|
0000c9c0  f2 43 6c 6f 73 65 46 69  6c 65 49 66 50 6f 73 73  |.CloseFileIfPoss|
0000c9d0  28 44 61 74 61 29 3a 3d  a3 3a f4 20 27 53 65 74  |(Data):=.:. 'Set|
0000c9e0  74 69 6e 67 73 27 20 66  69 6c 65 20 69 73 20 64  |tings' file is d|
0000c9f0  61 6d 61 67 65 64 20 6f  72 20 6d 69 73 73 69 6e  |amaged or missin|
0000ca00  67 0d 34 9e 07 20 20 3a  0d 34 a8 26 20 20 44 61  |g.4..  :.4.&  Da|
0000ca10  74 61 3d 8e 20 22 3c 53  57 49 49 6e 64 65 78 24  |ta=. "<SWIIndex$|
0000ca20  44 69 72 3e 2e 53 65 74  74 69 6e 67 73 22 0d 34  |Dir>.Settings".4|
0000ca30  b2 1d 20 20 58 50 6f 73  69 74 69 6f 6e 3d bb 28  |..  XPosition=.(|
0000ca40  a4 4e 65 78 74 45 6e 74  72 79 29 0d 34 bc 1d 20  |.NextEntry).4.. |
0000ca50  20 59 50 6f 73 69 74 69  6f 6e 3d bb 28 a4 4e 65  | YPosition=.(.Ne|
0000ca60  78 74 45 6e 74 72 79 29  0d 34 c6 15 20 20 50 52  |xtEntry).4..  PR|
0000ca70  4d 24 3d a4 4e 65 78 74  45 6e 74 72 79 0d 34 d0  |M$=.NextEntry.4.|
0000ca80  0c 20 20 d9 23 44 61 74  61 0d 34 da 07 20 20 3a  |.  .#Data.4..  :|
0000ca90  0d 34 e4 62 20 20 e7 20  58 50 6f 73 69 74 69 6f  |.4.b  . XPositio|
0000caa0  6e 3c 3e 2d 31 20 80 20  59 50 6f 73 69 74 69 6f  |n<>-1 . YPositio|
0000cab0  6e 3c 3e 2d 31 20 8c 20  f2 55 70 64 61 74 65 53  |n<>-1 . .UpdateS|
0000cac0  65 6c 65 63 74 65 64 46  6c 61 67 28 4c 6f 63 2c  |electedFlag(Loc,|
0000cad0  36 2b 28 28 35 2a 58 50  6f 73 69 74 69 6f 6e 29  |6+((5*XPosition)|
0000cae0  2b 28 34 2d 59 50 6f 73  69 74 69 6f 6e 29 29 2c  |+(4-YPosition)),|
0000caf0  b9 29 0d 34 ee 07 20 20  3a 0d 34 f8 06 3d b9 0d  |.).4..  :.4..=..|
0000cb00  35 02 05 3a 0d 35 0c 16  dd 20 f2 44 65 66 61 75  |5..:.5... .Defau|
0000cb10  6c 74 53 65 74 74 69 6e  67 73 0d 35 16 1b 58 50  |ltSettings.5..XP|
0000cb20  6f 73 69 74 69 6f 6e 3d  34 3a 59 50 6f 73 69 74  |osition=4:YPosit|
0000cb30  69 6f 6e 3d 34 0d 35 20  3e f2 55 70 64 61 74 65  |ion=4.5 >.Update|
0000cb40  53 65 6c 65 63 74 65 64  46 6c 61 67 28 4c 6f 63  |SelectedFlag(Loc|
0000cb50  2c 36 2b 28 28 35 2a 58  50 6f 73 69 74 69 6f 6e  |,6+((5*XPosition|
0000cb60  29 2b 28 34 2d 59 50 6f  73 69 74 69 6f 6e 29 29  |)+(4-YPosition))|
0000cb70  2c b9 29 0d 35 2a 05 e1  0d ff                    |,.).5*....|
0000cb7a