Home » Archimedes archive » Archimedes World » AW-1995-01-Disc2.adf » Disk2Jan95 » !AWJan95/Goodies/Event/!EvntShell/ShellLib

!AWJan95/Goodies/Event/!EvntShell/ShellLib

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 » Archimedes archive » Archimedes World » AW-1995-01-Disc2.adf » Disk2Jan95
Filename: !AWJan95/Goodies/Event/!EvntShell/ShellLib
Read OK:
File size: 355DF bytes
Load address: 0000
Exec address: 0000
File contents
    1REM >EvntShell:ShellLib
    2*|Start FNshell_LibraryVersion
    3DEF FNshell_LibraryVersion
    4=1.33 * 100
    5REM 30/05/94
    6REM 1.33b
    7REM Added PROCshell_MenuDelete
    8REM Added Calling of DataSave routines when SELECT & ADJUST pressed over icon 0  
    9:
   10*|Stop FNshell_LibraryVersion
   11
   12REM routine to find handle of parent needed..
   13REM or search all submenu handles so that it can be changed..
   14REM or store a list of menu item handles together with the submenu handles..
   15
   16*|Start PROCshell_Error
   17DEF PROCshell_Error
   18LOCAL pos%,report$
   19REM ON ERROR OFF
   20IF ERR <> &D00 AND ERR <> &903 THEN
   21  REM fatal error..
   22  SYS "XHourglass_Smash"
   23  IF FNshell_OSCheckVersion(3) AND FNshell_FileExists("Resources:$.Resources.Edit.ThrowBack") THEN
   24    PROCshell_Exit
   25    OSCLI("Set Basic$File <"+FNshell_GetAppName+"$BasicFile>")
   26    CHAIN "Edit:ThrowBack"
   27  ELSE
   28    PROCshell_ErrorBox("Unexpected error:- "+REPORT$+" Internal error code "+STR$ERL)
   29    END
   30  ENDIF
   31ELSE
   32  REM Non-fatal error from shell_OK, or out of memory error from heap
   33  REM manager routines....strip out name of library file..
   34  pos% = INSTR(REPORT$,"in " + CHR$34 + "EvntShell:ShellLib")
   35  IF pos% > 0 THEN report$ = LEFT$(REPORT$,pos% - 1)
   36  PROCshell_ErrorBox(report$)
   37ENDIF
   38SYS "XHourglass_Smash"
   39REM RESTORE ERROR
   40ENDPROC
   41:
   42*|Stop PROCshell_Error
   43
   44*|Start PROCshell_OK
   45DEF PROCshell_OK(e$)
   46ERROR &D00,e$
   47ENDPROC
   48:
   49*|Stop PROCshell_OK
   50
   51*|Start PROCshell_ErrorBox
   52DEF PROCshell_ErrorBox(r$)
   53LOCAL r%,err_blk%
   54err_blk% = _shell_blk%
   55!err_blk% = ERR:$(err_blk% + 4) = r$ + CHR$(0)
   56IF ERR = &D00 OR ERR = &903 THEN
   57  SYS "XWimp_ReportError",err_blk%,%10001,"Message from " + FNshell_GetAppName TO r%
   58ELSE
   59  SYS "XWimp_ReportError",err_blk%,1,FNshell_GetAppName TO r%
   60ENDIF
   61REM IF r%=2 THEN _closedown%=TRUE
   62ENDPROC
   63:
   64*|Stop PROCshell_ErrorBox
   65
   66*|Start FNshell_GetLastSecureFileName
   67DEF FNshell_GetLastSecureFileName
   68LOCAL temp%
   69temp%=_U%!80
   70IF temp%=0 THEN =""
   71=$temp%
   72:
   73*|Stop FNshell_GetLastSecureFileName
   74
   75*|Start FNshell_GetString
   76DEF FNshell_GetString(Address%)
   77LOCAL String$,Len%
   78WHILE ((Address%?Len%)>31 AND Len%<255)
   79  String$+=CHR$(Address%?Len%)
   80  Len%+=1
   81ENDWHILE
   82=String$
   83:
   84*|Stop FNshell_GetString
   85
   86*|Start FNshell_GetEventHandler
   87DEF FNshell_GetEventHandler(wh%,ic%,e_type%)
   88LOCAL ptr%,event_list%,found%,list_size%,fn$
   89IF wh%=-1 THEN wh%=-2
   90list_size%=FNshell_HeapBlockInfo(_U%!12)-8
   91ptr%=0
   92found%=FALSE
   93event_list%=_U%!12
   94fn$=""
   95REPEAT
   96  IF (event_list%!ptr%=wh%) THEN
   97    CASE event_list%!(ptr%+4) OF
   98    WHEN -1
   99      REM window handle found, icon handle is -1
  100      REM check that a pointer has been defined to a heap block
  101      REM containing a function name (if it is 0 then no event
  102      REM defined)...
  103      IF event_list%!(ptr%+(12+(e_type%*4)))>&8000 THEN
  104        fn$=$(event_list%!(ptr%+(12+(e_type%*4))))
  105        found%=TRUE
  106      ELSE
  107        ptr%+=48
  108      ENDIF
  109    OTHERWISE
  110      REM check icon handle in event block as well...
  111      IF event_list%!(ptr%+4)=ic% THEN
  112        REM window/icon handle event block found...
  113        REM check that a pointer has been defined to a heap block
  114        REM containing a function name (if it is 0 then no event
  115        REM defined)...
  116        IF event_list%!(ptr%+(12+(e_type%*4)))>&8000 THEN
  117          fn$=$(event_list%!(ptr%+(12+(e_type%*4))))
  118          found%=TRUE
  119        ELSE
  120          ptr%+=48
  121        ENDIF
  122      ELSE
  123        ptr%+=48
  124      ENDIF
  125    ENDCASE
  126  ELSE
  127    ptr%+=48
  128  ENDIF
  129UNTIL ((ptr%>=list_size%) OR found%)
  130=fn$
  131:
  132*|Stop FNshell_GetEventHandler
  133
  134*|Start FNshell_GetEventMenu
  135DEF FNshell_GetEventMenu(button%,wh%,ic%)
  136LOCAL ptr%,event_list%,found%,list_size%,menu%
  137IF wh%=-1 THEN wh%=-2
  138list_size%=FNshell_HeapBlockInfo(_U%!12)-8
  139ptr%=0
  140found%=FALSE
  141event_list%=_U%!12
  142fn$=""
  143REM PROCshell_Tracef0("GetEventMenu:Started..")
  144REM PROCshell_Tracef0("GetEventMenu:button is "+STR$button%)
  145REM PROCshell_Tracef0("GetEventMenu:window is "+STR$wh%)
  146REM PROCshell_Tracef0("GetEventMenu:icon   is "+STR$ic%)
  147REPEAT
  148  IF (event_list%!ptr%=wh%) THEN
  149    PROCshell_Tracef0("GetEventMenu:window handle matched..") 
  150    IF event_list%!(ptr%+4) = ic% THEN
  151      REM PROCshell_Tracef0("GetEventMenu:icon handle matched..")
  152      menu%=event_list%!(ptr%+8)
  153      IF menu%=-2 THEN menu%=_U%!252
  154      found%=TRUE
  155    ELSE
  156      REM PROCshell_Tracef0("GetEventMenu:icon handle NOT matched..")
  157      REM IF event_list%!(ptr%+4) = -1 THEN
  158      REM   IF button%=2 THEN
  159      REM     menu%=event_list%!(ptr%+8)
  160      REM     IF menu%=-2 THEN menu%=_U%!252
  161      REM     found%=TRUE
  162      REM   ELSE
  163      REM     ptr%+=48
  164      REM   ENDIF
  165      REM ELSE
  166      REM ptr%+=48
  167      REM ENDIF
  168    ENDIF
  169  ENDIF
  170ptr% += 48
  171UNTIL (ptr%>=list_size% OR found%)
  172=menu%
  173:
  174*|Stop FNshell_GetEventMenu
  175
  176*|Start FNshell_GetEventListOffset
  177DEF FNshell_GetEventListOffset(wh%,ih%,event_list%,rec_size%,add%)
  178REM find offset of data in event list block given the window/icon
  179REM handles. returns -1 if no events found, -2 if heapblock not defined
  180REM if add% is FALSE. when add is TRUE then the list is extended and the
  181REM offset to the new record is returned.
  182LOCAL list_size%,ptr%,found%,offset%,empty%,temp%
  183IF (!event_list%=0 AND add%=FALSE) THEN =-2:REM no heapblock defined
  184IF (!event_list%=0) THEN
  185  REM no heap block defined and add flag is true...
  186  !event_list%=FNshell_HeapBlockFetch(rec_size%)
  187  temp%=!event_list%:temp%!0=0:temp%!4=0
  188  =0
  189ENDIF
  190list_size%=FNshell_HeapBlockInfo(!event_list%)-8
  191ptr%=0:found%=FALSE:offset%=-1:empty%=-1
  192temp%=!event_list%
  193REPEAT
  194  REM PROCshell_Tracef0("GetEventListOffset:window handle=&"+STR$~temp%!ptr%)
  195  REM when scanning list note offset of first empty record for use when
  196  REM adding a new event to the list. Empty records have 0 for both
  197  REM window and icon handles
  198  IF empty%<0 THEN
  199    IF (temp%!ptr%=0 AND temp%!ptr%+4=0) THEN empty%=ptr%
  200  ENDIF
  201  IF (temp%!ptr%=wh%) THEN
  202    REM events attached to no particular icon are registered with
  203    REM an icon handle of -1
  204    REM PROCshell_Tracef0("GetEventListOffset:window handle found")
  205    IF ih%=-1 THEN
  206      REM icon handle is -1, so event has been found
  207      REM PROCshell_Tracef0("GetEventListOffset:icon handle is -1")
  208      offset%=ptr%
  209      found%=TRUE
  210    ELSE
  211      REM check icon handle in event block as well..
  212*|ifdef PROCshell_TraceInit
  213      PROCshell_Tracef0("GetEventListOffset:icon handle is not -1")
  214*|endif
  215      IF temp%!(ptr%+4)=ih% THEN
  216          offset%=ptr%
  217          found%=TRUE
  218      ELSE
  219        ptr%+=rec_size%
  220      ENDIF
  221    ENDIF
  222  ELSE
  223    REM no match, so check next event..
  224    ptr%+=rec_size%
  225  ENDIF
  226UNTIL ((ptr%>=list_size%) OR found%)
  227IF found% THEN
  228  REM PROCshell_Tracef0("GetEventListOffset:Event found")
  229ELSE
  230  REM PROCshell_Tracef0("GetEventListOffset:End of event list - event not found")
  231ENDIF
  232IF (offset%=-1 AND add%) THEN
  233  IF empty%<0 THEN
  234    REM no empty records found to use for the new one
  235    offset%=list_size%
  236    !event_list%=FNshell_HeapBlockExtend(!event_list%,rec_size%)
  237    temp%=!event_list%
  238    temp%+=offset%:temp%!0=0:temp%!4=0
  239  ELSE
  240    REM re-use old deleted event
  241    offset%=empty%
  242  ENDIF
  243ENDIF
  244=offset%
  245:
  246*|Stop FNshell_GetEventListOffset
  247
  248*|Start PROCshell_AttachPane
  249DEF PROCshell_AttachPane(wh%,RETURN pane_handle%,flags%,x_off%,y_off%)
  250LOCAL blk%,offset%,temp%,nr_pane_events%,pane_flags%
  251PROCshell_Tracef0("AttachPane:Attaching Pane Handler")
  252REM first check that the flags of the pane window are correctly set..
  253pane_flags%=FNshell_WindowGetFlags(pane_handle%)
  254IF (pane_flags% AND 1<<5)=0 THEN
  255  PROCshell_Tracef0("AttachPane:'Pane' bit of pane window is not set, fixing..")
  256  PROCshell_WindowToggleFlags(pane_handle%,1<<5)
  257ENDIF
  258IF (pane_flags% AND 1<<1) THEN
  259  PROCshell_Tracef0("AttachPane:'Moveable' bit of pane window is set, fixing..")
  260  PROCshell_WindowToggleFlags(pane_handle%,1<<1)
  261ENDIF
  262offset%=FNshell_GetEventListOffset(wh%,-1,_U%+92,24,FALSE)
  263IF offset%<0 THEN
  264  REM no existing pane event block
  265  PROCshell_Tracef0("AttachPane:Creating pane event block")
  266  offset%=FNshell_GetEventListOffset(wh%,-1,_U%+92,24,TRUE)
  267  blk%=_U%!92+offset%
  268  blk%!0=wh%:blk%!4=-1
  269  blk%!8=FNshell_HeapBlockFetch(4)
  270  blk%!12=FNshell_HeapBlockFetch(4)
  271  blk%!16=FNshell_HeapBlockFetch(4)
  272  blk%!20=FNshell_HeapBlockFetch(4)
  273  temp%=blk%!8:!temp%=-1
  274  temp%=blk%!12:!temp%=-1
  275  temp%=blk%!16:!temp%=-1
  276  temp%=blk%!20:!temp%=-1
  277ENDIF
  278blk%=_U%!92+offset%
  279temp%=blk%!8:ctr%=0:nr_pane_events%=0
  280WHILE temp%!ctr%<>-1
  281  ctr%+=4
  282  nr_pane_events%+=1
  283ENDWHILE
  284blk%!8=FNshell_HeapBlockExtend(blk%!8,4)
  285temp%=blk%!8:temp%!(nr_pane_events%*4)=pane_handle%
  286temp%!((nr_pane_events%+1)*4)=-1
  287blk%!12=FNshell_HeapBlockExtend(blk%!12,4)
  288temp%=blk%!12:temp%!(nr_pane_events%*4)=flags%
  289temp%!((nr_pane_events%+1)*4)=-1
  290blk%!16=FNshell_HeapBlockExtend(blk%!16,4)
  291temp%=blk%!16:temp%!(nr_pane_events%*4)=x_off%
  292temp%!((nr_pane_events%+1)*4)=-1
  293blk%!20=FNshell_HeapBlockExtend(blk%!20,4)
  294temp%=blk%!20:temp%!(nr_pane_events%*4)=y_off%
  295temp%!((nr_pane_events%+1)*4)=-1
  296ENDPROC
  297:
  298*|Stop PROCshell_AttachPane
  299
  300*|Start PROCshell_AttachDataLoad
  301DEF PROCshell_AttachDataLoad(wh%,ih%,type%,fn$,no_load%)
  302LOCAL blk%,temp%,offset%,cmdline$
  303PROCshell_Tracef0("AttachDataLoad:Attaching DataLoad Handler")
  304IF wh%=-1 THEN wh%=-2
  305IF no_load% THEN type%=type% OR 1<<31
  306offset%=FNshell_GetEventListOffset(wh%,ih%,_U%+96,16,TRUE)
  307REM modify above to set first two words to 0 to denote a new
  308REM empty event block
  309blk%=_U%!96+offset%
  310
  311IF blk%!0=0 AND blk%!4=0 THEN
  312  REM this is first event......
  313  PROCshell_Tracef0("AttachDataLoad:This is the first DataLoad Event...")
  314  blk%!0=wh%:blk%!4=ih%
  315  blk%!8=FNshell_HeapBlockFetch(8)
  316  temp%=blk%!8
  317  temp%!0=type%:temp%!4=-1
  318  blk%!12=FNshell_HeapBlockFetch(8)
  319  temp%=blk%!12
  320  temp%!0=FNshell_HeapBlockFetch(LEN(fn$)+1)
  321  temp%!4=-1
  322  temp%=temp%!0:$temp%=fn$
  323ELSE
  324  REM adding new filetype/function to an existing event
  325  REM extend filetype heapblock...
  326  PROCshell_Tracef0("AttachDataLoad:This is another DataLoad Event...")
  327  blk%!8=FNshell_HeapBlockExtend(blk%!8,4)
  328  REM and function name heapblock...
  329  blk%!12=FNshell_HeapBlockExtend(blk%!12,4)
  330  REM find out how many filetypes there are now...
  331  ctr%=0:temp%=blk%!8
  332  WHILE temp%!ctr%<>-1
  333    ctr%+=4
  334  ENDWHILE
  335  temp%!ctr%=type%:temp%!(ctr%+4)=-1
  336  temp%=blk%!12
  337  temp%!ctr%=FNshell_HeapBlockFetch(LENfn$+1)
  338  temp%=temp%!ctr%:$temp%=fn$
  339ENDIF
  340REM Now check if program was started by double clicking on a data file...
  341cmdline$ = FNshell_GetCmdLineArgs
  342PROCshell_Tracef0("AttachDataLoad:cmdline  ="+cmdline$)
  343PROCshell_Tracef0("AttachDataLoad:flag bit ="+STR$((_U%!100 AND 1 << 5)))
  344PROCshell_Tracef0("AttachDataLoad:wh%      ="+STR$~wh%)
  345PROCshell_Tracef0("AttachDataLoad:type%    ="+STR$~type%)
  346IF cmdline$ <> "" AND wh% < 0 AND (_U%!100 AND 1 << 5) THEN
  347  REM It was, check file is correct type, ignoring the top bit...
  348  IF type% AND 1 << 31 THEN temp% = type% EOR 1 << 31 ELSE temp% = type%
  349  IF FNshell_FileType(cmdline$) = temp% THEN
  350    REM It is, so load it...
  351    PROCshell_Tracef0("AttachDataLoad:Loading file..")
  352    PROCshell_MessageSendDataLoad(temp%,cmdline$)
  353    _U%!100 = _U%!100 EOR (1 << 5) : REM Unset load pending flag bit...
  354  ENDIF
  355ENDIF
  356ENDPROC
  357:
  358*|Stop PROCshell_AttachDataLoad
  359
  360*|Start PROCshell_AttachDataSave
  361DEF PROCshell_AttachDataSave(wh%,ih%,address%,type%,name_ic%,fn$)
  362LOCAL blk%,temp%,offset%
  363REM check file icon is a sprite icon, complain otherwise..
  364IF NOT FNshell_IconIsSprite(wh%,ih%) THEN PROCshell_OK(FNshell_MessageNoArgs("SHELLMSG29"))
  365REM change file type icon button type to click/drag..
  366PROCshell_IconSetButtonType(wh%,ih%,6)
  367IF address%=0 THEN address%=100:REM estimated size - wild guess.
  368*|ifdef TraceInit
  369PROCshell_Tracef0("AttachDataSave:Attaching DataSave Handler to icon "+STR$ih%+" in window &"+STR$~wh%)
  370PROCshell_Tracef0("AttachDataSave:Handler function is '"+fn$+"'")
  371*|endif
  372offset%=FNshell_GetEventListOffset(wh%,ih%,_U%+72,24,TRUE)
  373blk%=_U%!72+offset%
  374blk%!0=wh%:blk%!4=ih%:blk%!8=address%:blk%!12=type%
  375blk%!16=name_ic%
  376blk%!20=FNshell_HeapBlockFetch(LEN(fn$)+1)
  377temp%=blk%!20:$temp%=fn$
  378CASE type% OF
  379  WHEN &FF9
  380    REM kludge for sprite files as first word should not
  381    REM be saved
  382    IF address%>&8000 THEN
  383      _U%!136=FNshell_HeapBlockInfo(address%)-8
  384    ELSE
  385      _U%!136=address%
  386    ENDIF
  387  OTHERWISE
  388    IF address%>&8000 THEN
  389      _U%!136=FNshell_HeapBlockInfo(address%)-4
  390    ELSE
  391      _U%!136=address%
  392    ENDIF
  393ENDCASE
  394_U%!140=type%
  395REM _U%!144 holds address of file heapblock buffer. If address%<&8000 then
  396REM file is not in a buffer and address% is actually the estimated size..
  397_U%!144=address%
  398ENDPROC
  399:
  400*|Stop PROCshell_AttachDataSave
  401
  402*|Start PROCshell_AttachMenu
  403DEF PROCshell_AttachMenu(wh%,ic%,menu%,shift%,ctrl%,alt%)
  404LOCAL offset%
  405IF wh%>0 AND ic%>=0 THEN PROCshell_IconSetButtonType(wh%,ic%,3)
  406offset%=FNshell_SearchStatic(_U%!184,wh%)
  407IF offset%=-1 THEN PROCshell_OK(FNshell_MessageNoArgs("SHELLMSG30"))
  408*|ifdef TraceInit
  409PROCshell_Tracef0("AttachMenu:Attaching menu handle &"+STR$~menu%+" to window handle &"+STR$~wh%)
  410*|endif
  411PROCshell_EventAdd(wh%,ic%,0,menu%,"")
  412ENDPROC
  413:
  414*|Stop PROCshell_AttachMenu
  415
  416*|Start PROCshell_AttachMenuMaker
  417DEF PROCshell_AttachMenuMaker(wh%,ic%,fn$)
  418PROCshell_Tracef0("AttachMenuMaker:Attaching menumaker function '"+fn$+"'")
  419PROCshell_EventAdd(wh%,ic%,1,0,fn$)
  420ENDPROC
  421:
  422*|Stop PROCshell_AttachMenuMaker
  423
  424*|Start PROCshell_AttachMenuDBox
  425DEF PROCshell_AttachMenuDBox(item%,window$,preopenfn$,postopenfn$)
  426REM Check current submenu handle. We should release any memory
  427REM allocated by previous calls (when I work out how to do it)
  428LOCAL blk%,temp%,addr%
  429IF NOT FNshell_WindowLoaded(window$) THEN ERROR 99,FNshell_MessageOneArg("SHELLMSG03",window$)
  430blk%=FNshell_HeapBlockFetch(12)
  431blk%!0=FNshell_HeapBlockFetch(LENwindow$+1)
  432temp%=blk%!0:$temp%=window$
  433blk%!4=FNshell_HeapBlockFetch(LENpreopenfn$+1)
  434temp%=blk%!4:$temp%=preopenfn$
  435blk%!8=FNshell_HeapBlockFetch(LENpostopenfn$+1)
  436temp%=blk%!8:$temp%=postopenfn$
  437REM Store address of heapblock in submenu pointer word of
  438REM menu item definition. Cunning huh........
  439SYS "MenuUtil_SubMenu",item%,blk%
  440SYS "MenuUtil_Warning",,TRUE
  441ENDPROC
  442:
  443*|Stop PROCshell_AttachMenuDBox
  444
  445*|Start PROCshell_AttachClickSelect
  446DEF PROCshell_AttachClickSelect(wh%,ic%,fn$)
  447PROCshell_EventAdd(wh%,ic%,2,0,fn$)
  448ENDPROC
  449:
  450*|Stop PROCshell_AttachClickSelect
  451
  452*|Start PROCshell_AttachClickAdjust
  453DEF PROCshell_AttachClickAdjust(wh%,ic%,fn$)
  454PROCshell_EventAdd(wh%,ic%,3,0,fn$)
  455ENDPROC
  456:
  457*|Stop PROCshell_AttachClickAdjust
  458
  459*|Start PROCshell_AttachUserRedraw
  460DEF PROCshell_AttachUserRedraw(RETURN wh%,fn$)
  461LOCAL blk%,f%
  462blk%=FNshell_HeapBlockFetch(40)
  463!blk%=wh%:SYS "Wimp_GetWindowState",,blk%
  464f%=blk%!32
  465PROCshell_HeapBlockReturn(blk%)
  466REM PROCshell_Tracef0("AttachUserRedraw:flag%=&"+STR$~f%)
  467IF (f% AND 1<<4) THEN
  468*|ifdef TraceInit
  469  PROCshell_Tracef0("AttachUserRedraw:auto redraw set!!")
  470*|endif
  471  REM store original handle in case the wimp allocates a new handle..
  472  PROCshell_WindowToggleFlags(wh%,1 << 4)
  473ENDIF
  474PROCshell_EventAdd(wh%,-1,4,0,fn$)
  475ENDPROC
  476:
  477*|Stop PROCshell_AttachUserRedraw
  478
  479*|Start PROCshell_AttachDrag
  480DEF PROCshell_AttachDrag(wh%,ic%,est_size%,fn$)
  481PROCshell_EventAdd(wh%,ic%,6,0,fn$)
  482ENDPROC
  483:
  484*|Stop PROCshell_AttachDrag
  485
  486*|Start PROCshell_AttachHelpTag
  487DEF PROCshell_AttachHelpTag(wh%,ic%,tag$)
  488PROCshell_EventAdd(wh%,ic%,8,0,tag$)
  489ENDPROC
  490:
  491*|Stop PROCshell_AttachHelpTag
  492
  493*|Start PROCshell_EventAdd
  494DEF PROCshell_EventAdd(wh%,ic%,e_type%,menu%,fn$)
  495LOCAL ptr%,fn%,event_list%,list_size%,found%
  496LOCAL fn_addr%
  497ptr%=0:found%=FALSE
  498IF wh%=-1 THEN wh%=-2
  499list_size%=FNshell_HeapBlockInfo(_U%!12)-8
  500event_list%=_U%!12
  501REM PROCshell_Tracef0("XX:checking for wh &"+STR$~wh%+" ih &"+STR$~ic%)
  502REPEAT
  503  IF (event_list%!ptr%=wh%) THEN
  504    REM PROCshell_Tracef0("XX:ptr%="+STR$ptr%)
  505    REM PROCshell_Tracef0("XX:found window handle in list, checking icon handle..")
  506    IF event_list%!(ptr%+4)=ic% THEN
  507      found%=TRUE
  508    ELSE
  509      ptr%+=48
  510    ENDIF
  511  ELSE
  512    ptr%+=48
  513  ENDIF
  514UNTIL (ptr%>=list_size% OR found%)
  515IF found%=FALSE THEN
  516 ptr%=0
  517 WHILE (event_list%!ptr%<>0 )
  518   ptr%+=48
  519   IF ptr%>=list_size% THEN
  520     _U%!12=FNshell_HeapBlockExtend(_U%!12,48)
  521     event_list%=_U%!12
  522     event_list%!(ptr%+0)=0
  523     event_list%!(ptr%+4)=0
  524     event_list%!(ptr%+8)=0
  525     event_list%!(ptr%+12)=0
  526     event_list%!(ptr%+16)=0
  527     event_list%!(ptr%+20)=0
  528     event_list%!(ptr%+24)=0
  529     event_list%!(ptr%+28)=0
  530     event_list%!(ptr%+32)=0
  531     event_list%!(ptr%+36)=0
  532     event_list%!(ptr%+40)=0
  533     event_list%!(ptr%+44)=0
  534   ENDIF
  535 ENDWHILE
  536ENDIF
  537event_list%!(ptr%+0)=wh%
  538event_list%!(ptr%+4)=ic%
  539IF menu%<>0 THEN
  540  event_list%!(ptr%+8)=menu%
  541ENDIF
  542fn_addr%=ptr%+(12+(e_type%*4))
  543IF event_list%!fn_addr%<>0 THEN
  544  PROCshell_HeapBlockReturn(event_list%!fn_addr%)
  545ENDIF
  546fn%=FNshell_HeapBlockFetch(LENfn$+1)
  547$fn%=fn$
  548event_list%!fn_addr%=fn%
  549ENDPROC
  550:
  551*|Stop PROCshell_EventAdd
  552
  553*|Start PROCshell_EventDeleteAll
  554DEF PROCshell_EventDeleteAll(wh%)
  555LOCAL ptr%,menu%,found%,list_size%,event_list%,loop%
  556ptr%=0:menu%=0:found%=FALSE
  557IF wh%=-1 THEN wh%=-2
  558list_size%=FNshell_HeapBlockInfo(_U%!12)-8
  559event_list%=_U%!12
  560REPEAT
  561  IF (event_list%!ptr%=wh%) THEN
  562    found%=TRUE
  563  ELSE
  564    ptr%+=48
  565  ENDIF
  566UNTIL (ptr%>=list_size% OR found%)
  567IF found% THEN
  568  event_list%!(ptr%+0)=0
  569  event_list%!(ptr%+4)=0
  570  event_list%!(ptr%+8)=0
  571  FOR loop%=12 TO 44 STEP 4
  572    IF event_list%!(ptr%+loop%)<>0 THEN
  573      PROCshell_HeapBlockReturn(event_list%!(ptr%+loop%))
  574      event_list%!(ptr%+loop%)=0
  575    ENDIF
  576  NEXT loop%
  577ENDIF
  578REM remove all DataSave events for the current window...
  579PROCshell_Tracef0("EventDeleteAll:wh%=&"+STR$~wh%)
  580PROCshell_DeleteEventDataSave(wh%,-1)
  581PROCshell_DeleteEventBump(wh%,-1)
  582PROCshell_DeleteEventSlider(wh%,-1)
  583REM should reduce size of event list block if possible.......
  584ENDPROC
  585:
  586*|Stop PROCshell_EventDeleteAll
  587
  588*|Start PROCshell_DeleteEventBump
  589DEF PROCshell_DeleteEventBump(wh%,ih%)
  590REM if I can find which words point to a heap block they could be
  591REM automatically detected and released. A general purpose routine
  592REM shell_DeleteEvent could then be written!
  593REM If ih%=-1 remove all events for window handle wh%
  594LOCAL offset%,blk%,list_size%,event_list%,temp%
  595event_list%=_U%!104
  596REPEAT
  597  offset%=FNshell_GetEventListOffset(wh%,ih%,_U%+104,16,FALSE)
  598*|ifdef TraceInit
  599  PROCshell_Tracef0("DeleteEventBump:offset%="+STR$offset%)
  600*|endif
  601  IF offset%>=0 THEN
  602    IF ih%=-1 THEN
  603*|ifdef TraceInit
  604      PROCshell_Tracef0("DeleteEventBump:Deleting Bump Event (all events for window handle &"+STR$~wh%+")")
  605*|endif
  606    ELSE
  607*|ifdef TraceInit
  608      PROCshell_Tracef0("DeleteEventBump:Deleting Bump Event (window handle was &"+STR$~wh%+" icon handle was "+STR$ih%+")")
  609*|endif
  610    ENDIF
  611    REM event for window/icon is in list
  612    list_size%=FNshell_HeapBlockInfo(_U%!104)-8
  613    IF offset%=list_size%-16 THEN
  614      REM it is the last one in this list
  615      IF offset%=0 THEN
  616        REM only one event in the list
  617        info_blk%=event_list%!12
  618        temp%=info_blk%!12
  619        PROCshell_HeapBlockReturn(temp%!12)
  620        PROCshell_HeapBlockReturn(temp%!16)
  621        PROCshell_HeapBlockReturn(temp%)
  622        PROCshell_HeapBlockReturn(_U%!104)
  623        _U%!104=0
  624*|ifdef TraceInit
  625        PROCshell_Tracef0("DeleteEventBump:No Bump events now registered")
  626*|endif
  627      ELSE
  628        REM more than one event in the list
  629        _U%!104=FNshell_HeapBlockExtend(_U%!104,-16)
  630      ENDIF
  631    ELSE
  632      REM not the last one in the list
  633      blk%=event_list%+offset%
  634      blk%!0=0:blk%!4=0:blk%!8=0
  635      info_blk%=blk%!12
  636      PROCshell_HeapBlockReturn(info_blk%!12)
  637      PROCshell_HeapBlockReturn(info_blk%!16)
  638      PROCshell_HeapBlockReturn(info_blk%)
  639    ENDIF
  640  ENDIF
  641  REM repeat loop until offset%=-1 (event not found)
  642  REM or offset%=-2 (event block doesn't exist)
  643UNTIL offset%<0
  644ENDPROC
  645:
  646*|Stop PROCshell_DeleteEventBump
  647
  648*|Start PROCshell_DeleteEventDataSave
  649DEF PROCshell_DeleteEventDataSave(wh%,ih%)
  650REM if I can find which words point to a heap block they could be
  651REM automatically detected and released. A general purpose routine
  652REM shell_DeleteEvent could then be written!
  653REM If ih%=-1 remove all events for window handle wh%
  654LOCAL offset%,blk%,list_size%
  655REM PROCshell_Tracef0("DeleteEventDataSave:wh%=&"+STR$~wh%)
  656REM PROCshell_Tracef0("DeleteEventDataSave:ih%="+STR$ih%)
  657REPEAT
  658  offset%=FNshell_GetEventListOffset(wh%,ih%,_U%+72,24,FALSE)
  659  REM PROCshell_Tracef0("DeleteEventDataSave:offset%="+STR$offset%)
  660  IF offset%>=0 THEN
  661    IF ih%=-1 THEN
  662  PROCshell_Tracef0("DeleteEventDataSave:Deleting DataSave Event (all events for window handle &"+STR$~wh%+")")
  663    ELSE
  664  PROCshell_Tracef0("DeleteEventDataSave:Deleting DataSave Event (window handle was &"+STR$~wh%+" icon handle was "+STR$ih%+")")
  665    ENDIF
  666    REM event for window/icon is in list
  667    list_size%=FNshell_HeapBlockInfo(_U%!72)-8
  668    IF offset%=list_size%-24 THEN
  669      REM it is the last one in this list
  670      IF offset%=0 THEN
  671        REM only one event in the list
  672        PROCshell_HeapBlockReturn(_U%!72)
  673        _U%!72=0
  674*|ifdef TraceInit
  675      PROCshell_Tracef0("DeleteEventDataSave:No DataSave events now registered")
  676*|endif
  677      ELSE
  678        REM more than one event in the list
  679        _U%!72=FNshell_HeapBlockExtend(_U%!72,-24)
  680      ENDIF
  681    ELSE
  682      REM not the last one in the list
  683      blk%=event_list%+offset%
  684      blk%!0=0:blk%!4=0:blk%!8=0:blk%!12=0:blk%!16=0
  685      PROCshell_HeapBlockReturn(blk%!20):blk%!20=0
  686    ENDIF
  687  ENDIF
  688  REM repeat loop until offset%=-1 (event not found)
  689  REM or offset%=-2 (event block doesn't exist)
  690UNTIL offset%<0
  691ENDPROC
  692:
  693*|Stop PROCshell_DeleteEventDataSave
  694
  695*|Start FNshell_MessageNoArgs
  696DEF FNshell_MessageNoArgs(tag$)
  697=FNshell_MessageLookup(tag$,"","")
  698:
  699*|Stop FNshell_MessageNoArgs
  700
  701*|Start FNshell_MessageOneArg
  702DEF FNshell_MessageOneArg(tag$,arg1$)
  703=FNshell_MessageLookup(tag$,arg1$,"")
  704:
  705*|Stop FNshell_MessageOneArg
  706
  707*|Start FNshell_MessageLookup
  708DEF FNshell_MessageLookup(tag$,arg1$,arg2$)
  709LOCAL flags%,L%,m$,ms_text%,ms_desc%
  710IF LEFT$(tag$,8)="SHELLMSG" THEN
  711  ms_text%=_U%!284:ms_desc%=_U%!280
  712ELSE
  713  ms_text%=_U%!64:ms_desc%=_U%!68
  714ENDIF
  715SYS "XMessageTrans_Lookup",ms_desc%,tag$,ms_text%,256,arg1$,arg2$ TO ,,,L%;flags%
  716IF flags% AND 1 THEN
  717  REM m$="Message tag '"+tag$+"' not found in message file!"
  718ELSE
  719  ms_text%?L%=13
  720  m$=$(ms_text%)
  721ENDIF
  722=m$
  723:
  724*|Stop FNshell_MessageLookup
  725
  726*|Start FNshell_WimpInit
  727DEF FNshell_WimpInit(Version%,TaskName$)
  728LOCAL Taskid%
  729SYS "Wimp_Initialise",Version%,&4B534154,TaskName$ TO Version%,Taskid%
  730IF _U%!100 AND 1 << 6 THEN
  731  SYS "WimpExt_Initialise",14,Taskid%
  732ENDIF
  733_U%!148=Taskid%
  734=Taskid%
  735:
  736*|Stop FNshell_WimpInit
  737
  738*|Start FNshell_WimpInit_I
  739DEF FNshell_WimpInit_I(Version%,TaskName$)
  740SYS "Wimp_Initialise",Version%,&4B534154,TaskName$ TO Version%,Taskid%
  741IF _U%!100 AND 1 << 6 THEN
  742  SYS "WimpExt_Initialise",14,Taskid%
  743ENDIF
  744_U%!148=Taskid%
  745SYS "Interface_Initialise",Taskid%
  746=Taskid%
  747:
  748*|Stop FNshell_WimpInit_I
  749
  750*|Start PROCshell_WimpCloseDown_I
  751DEF PROCshell_WimpCloseDown_I(Taskid%)
  752PROCshell_LoseFonts
  753*|ifdef Using_FontMenu
  754IF _U%!240<>-1 THEN SYS "XFontMenu_Release"
  755*|endif
  756IF _U%!100 AND 1 << 6 THEN
  757  SYS "WimpExt_Initialise",14,Taskid%
  758ENDIF
  759SYS "XWimp_CloseDown",Taskid%,&4B534154
  760SYS "XInterface_CloseDown",Taskid%
  761IF _U%!100 AND 1 << 2 THEN SYS "XImpulse_CloseDown",_U%!148
  762ENDPROC
  763:
  764*|Stop PROCshell_WimpCloseDown_I
  765
  766*|Start PROCWimpCloseDown
  767DEF PROCWimpCloseDown(Taskid%)
  768PROCshell_LoseFonts
  769*|ifdef Using_FontMenu
  770IF _U%!240<>-1 THEN SYS "XFontMenu_Release"
  771*|endif
  772IF _U%!100 AND 1 << 6 THEN
  773  SYS "WimpExt_Initialise",14,Taskid%
  774ENDIF
  775SYS "XWimp_CloseDown",Taskid%,&4B534154
  776IF _U%!100 AND 1<<2 THEN SYS "XImpulse_CloseDown",_U%!148
  777OSCLI("Unset "+_shell_AppName$+"$BasicFile")
  778ENDPROC
  779:
  780*|Stop PROCWimpCloseDown
  781
  782*|Start PROCshell_LoseFonts
  783DEF PROCshell_LoseFonts
  784LOCAL loop%,temp%
  785temp%=_U%!232
  786FOR loop%=0 TO 255
  787WHILE temp%?loop%>0
  788  SYS "Font_LoseFont",loop%
  789  temp%?loop%-=1
  790ENDWHILE
  791NEXT loop%
  792ENDPROC
  793:
  794*|Stop PROCshell_LoseFonts
  795
  796*|Start FNshell_FindFont
  797DEF FNshell_FindFont(font$,pointsize%)
  798LOCAL f%,fontcounts%
  799fontcounts%=_U%!232
  800SYS "Font_FindFont",,font$,pointsize%*16,p*16,0,0 TO f%
  801fontcounts%?f%+=1
  802IF fontcounts%?f%>=255 THEN PROCshell_OK(FNshell_MessageNoArgs("SHELLMSG18"))
  803=f%
  804:
  805*|Stop FNshell_FindFont
  806
  807*|Start PROCshell_Init
  808DEF PROCshell_Init
  809LOCAL elist%,loop%,temp%,cmdline$
  810LOCAL OSVarBuff%,shell_AppDir$,shell_AppName$
  811DIM _U% 360,_shell_blk% 260
  812_Q%=FNshell_HeapBlockFetch(3000)
  813elist%=FNshell_HeapBlockFetch(48)
  814elist%!00=0
  815elist%!04=0
  816elist%!08=0
  817elist%!12=0
  818elist%!16=0
  819elist%!20=0               
  820elist%!24=0
  821elist%!28=0
  822elist%!32=0
  823elist%!36=0
  824elist%!40=0
  825elist%!44=0
  826_U%!0=0          :REM nr of templates
  827_U%!4=0          :REM pointer to window blocks
  828_U%!8=0          :REM pointer to menu block
  829_U%!12=elist%    :REM pointer to event list
  830_U%!16=1         :REM address of user sprite area
  831_U%!20=0         :REM handle of last dynamic window
  832_U%!24=0         :REM address of current menu
  833_U%!28=0         :REM last window clicked over (select & adjust)
  834_U%!32=0         :REM last icon clicked over   (select & adjust)
  835_U%!36=0         :REM last menu x position
  836_U%!40=0         :REM last menu y position
  837_U%!44=-1        :REM handle of tracefile
  838_U%!48=0         :REM ArtWorks Renderer redraw block
  839                 :REM   +00 Address of VduVars heapblock (256)
  840                 :REM   +04 Address of Matrix  heapblock (24)
  841                 :REM   +08 Address of Info    heapblock (36)
  842                 :REM   +12 Address of WorkBlk heapblock (&1000)
  843                 :REM   +16 Address of CallbackRoutine returned by fileinit call
  844_U%!52=0         :REM last window clicked over (menu button)
  845_U%!56=0         :REM last icon   clicked over (menu button)
  846_U%!60=0         :REM pointer to 'HotKey' handler event list
  847_U%!64=0         :REM pointer to message block
  848_U%!68=0         :REM pointer to message block
  849_U%!72=0         :REM pointer to datasave event block
  850_U%!76=FNshell_HeapBlockFetch(256):REM message block
  851_U%!80=0         :REM pointer to last full file name
  852_U%!84=-1        :REM store my_ref from save operation
  853_U%!88=0         :REM ??????????
  854_U%!92=0         :REM pointer to pane handler event block
  855_U%!96=0         :REM pointer to dataload event block
  856_U%!100=0        :REM EvntShell bit flags
  857                 :REM bit  0  - DragASprite operation in progress
  858                 :REM bit  1  - Top bit dataload in progress
  859                 :REM bit  2  - Impulse module initialised
  860                 :REM bit  3  - ResFind in operation
  861                 :REM bit  4  - Trace init message pending (set in TraceInit,
  862                 :REM           cleared when ack received from ShellDBug)
  863                 :REM bit  5  - command line contains arguments..
  864                 :REM bit  6  - WimpEXT module is loaded
  865                 :REM bit  7  - StrongHlp system initialised for this app
  866                 :REM bit  8  - AWRender code assembled
  867                 :REM bit  9  - Tracing flag (0 = off, 1 = on)
  868                 :REM bit 10  - RISC OS 3 or better available
  869                 :REM bit 11  - Slider drag in progress
  870                 :REM bit 12  - Interactive help on/off
  871_U%!104=0        :REM pointer to bump handler event block
  872_U%!108=-1       :REM ScrpRef%
  873_U%!112=-1       :REM FtchRef%
  874_U%!116=-1       :REM LoadRef%
  875_U%!120=-1       :REM SaveRef%
  876_U%!124=-1       :REM DragRef%
  877_U%!128=0        :REM RAMPtr%
  878_U%!132=0        :REM RAMSize%
  879_U%!136=-1       :REM FileSize% from last datasave message
  880_U%!140=-1       :REM FileType% from last datasave message
  881_U%!144=-1       :REM FileBuff% from last datasave message
  882_U%!148=0        :REM taskid%
  883_U%!152=0        :REM Buffer list of loaded files, -1 terminator
  884_U%!156=0        :REM HeapBlock with copy of DataSave message block
  885                 :REM for when RAM transfer fails
  886_U%!160=0        :REM Pointer to ModeChange event function
  887_U%!164=0        :REM Pointer to PaletteChange event function
  888_U%!168=0        :REM Pointer to TaskInitialise event function
  889_U%!172=0        :REM Pointer to TaskCloseDown event function
  890_U%!176=0        :REM Pointer to current menu title
  891_U%!180=0        :REM nr of 'hotkey' events registered
  892_U%!184=0        :REM Pointer to list of static windows
  893_U%!188=0        :REM to shell_AppDir$ buffer
  894_U%!192=0        :REM to shell_AppDataDir$ buffer
  895_U%!196=0        :REM to shell_AppName$ buffer
  896_U%!200=0        :REM window handle from last DataSave message
  897_U%!204=0        :REM icon handle from last DataSave message
  898_U%!208=-1       :REM helphandle% (task handle of StrongHlp)
  899_U%!212=-1       :REM icontry%    (used by StrongHlp find routine)
  900_U%!216=0        :REM pointer to pending$ buffer for StrongHlp command
  901_U%!220=0        :REM pointer to menu warning event block
  902_U%!224=0        :REM pointer to last menu_warn fn called
  903_U%!228=0        :REM handle of warning dialog used for menu items that
  904                 :REM have not had a dialog box attached
  905_U%!232=FNshell_HeapBlockFetch(256):REM fontcounts% array..
  906_U%!236=FNshell_HeapBlockFetch(256):REM fontbinding% array..
  907_U%!240=-1       :REM nr of outline fonts on system, -1 if "FontMenu_Create"
  908                 :REM has not been called
  909_U%!244=0        :REM ptr to currently selected font name in FontMenu
  910_U%!248=0        :REM ptr to last known Font$Path
  911_U%!252=0        :REM last known ptr to FontMenu structure
  912_U%!256=0        :REM ptr to heapblock holding 'MenusSelectionSoFar' string
  913_U%!260=1        :REM SystemFont flag for FontMenu 0 no sysfont, 1 sysfont
  914_U%!264=0        :REM FontMenu is opened (1 or 0)
  915_U%!268=0        :REM FontMenu valid selection flag 0 non valid, 1 valid
  916_U%!272=0        :REM x coord last mouse click (screen coords)
  917_U%!276=0        :REM y coord last mouse click (screen coords)
  918_U%!280=0        :REM m_filedesc% for system message file
  919_U%!284=0        :REM m_buffer%   for system message file
  920_U%!288=-1       :REM window handle for last bump event
  921_U%!292=-1       :REM icon handle for last bump event
  922_U%!296=-1       :REM last event offset for bump handler
  923_U%!300=0        :REM pointer to PreQuit Handler routine
  924_U%!304=0        :REM pointer to OpenWindow event block
  925_U%!308=0        :REM pointer to CloseWindow event block
  926_U%!312=0        :REM pointer to Shutdown Handler routine
  927_U%!316=0        :REM OS version nr as returned by Wimp_Initialise
  928_U%!320=0        :REM Last mouse button pressed
  929_U%!324=0        :REM stores command line arg (if any)
  930_U%!328=0        :REM Slider last x position
  931_U%!332=0        :REM Slider event block
  932_U%!336=0        :REM Nr of copies still to print
  933_U%!340=0        :REM Popup handler event block
  934_U%!344=0        :REM Txt control block
  935PROCshell_MemFill(_U%!232,256,0)
  936PROCshell_MemFill(_U%!236,256,0)
  937OSVarBuff%=FNshell_HeapBlockFetch(256)
  938shell_AppDir$=FNshell_OSVarGetVal(OSVarBuff%,256,"Obey$Dir",1)
  939PROCshell_HeapBlockReturn(OSVarBuff%)
  940shell_AppName$=MID$(FNshell_Leaf(shell_AppDir$),2)
  941_U%!188=FNshell_HeapBlockFetch((LENshell_AppDir$)+1)
  942_U%!196=FNshell_HeapBlockFetch((LENshell_AppName$)+1)
  943temp%=_U%!188:$temp%=shell_AppDir$
  944temp%=_U%!196:$temp%=shell_AppName$
  945REM Now have a look at the command line used to start the program...
  946cmdline$ = FNshell_OSReadCommandArg(1)
  947IF cmdline$ <> "" THEN
  948  _U%!100 = _U%!100 OR 1 << 5:REM set 'command line args' flag...
  949  REM Store command line for later reference...
  950  temp% = FNshell_HeapBlockFetch(LENcmdline$ + 1)
  951  $(temp%) = cmdline$ : _U%!324 = temp%
  952ENDIF
  953REM Check if WimpEXT module is loaded..
  954temp% = FNshell_OSModuleCheckVersion("WimpExtension",1.98)
  955IF temp% = TRUE THEN _U%!100 = _U%!100 OR 1 << 6 :REM Set WExt flag bit..
  956temp% = FNRO3_Present
  957IF temp% = TRUE THEN _U%!100 = _U%!100 OR 1 << 10:REM Set RO3  flag bit..
  958_U%!100 = _U%!100 OR 1 << 12:REM turn on interactive help..
  959ENDPROC
  960:
  961*|Stop PROCshell_Init
  962
  963*|Start FNshell_GetCmdLineArgs
  964DEF FNshell_GetCmdLineArgs
  965LOCAL cmdline$
  966IF _U%!324 <> 0 THEN
  967  cmdline$ = $(_U%!324)
  968ENDIF
  969PROCshell_Tracef0("GetCmdLineArgs:cmdline was "+cmdline$)
  970= cmdline$
  971:
  972*|Stop FNshell_GetCmdLineArgs
  973
  974*|Start FNshell_FileType
  975DEF FNshell_FileType(object$)
  976LOCAL type%
  977SYS "OS_File",5,object$ TO ,,type%
  978type%=(type% AND &FFF00)>>>8
  979=type%
  980:
  981*|Stop FNshell_FileType
  982
  983*|Start FNshell_FileExists
  984DEF FNshell_FileExists(object$)
  985IF FNshell_CatInfoRead(object$)="Not Found":=FALSE
  986=TRUE
  987:
  988*|Stop FNshell_FileExists
  989
  990*|Start FNshell_CatInfoRead
  991DEF FNshell_CatInfoRead(object$)
  992LOCAL type%,load_addr%,exec_addr%,length%,atts%,string$
  993SYS "OS_File",5,object$ TO type%,,load_addr%,exec_addr%,length%,atts%
  994IF type%=0 THEN = "Not Found"
  995IF atts%=51  THEN string$+="WR "
  996IF atts%=187 THEN string$+="LWR"
  997IF atts%=136 THEN string$+="DL "
  998string$+=" "+FNshell_StringPadLeading(STR$~load_addr%,"0",8)
  999string$+=" "+FNshell_StringPadLeading(STR$~exec_addr%,"0",8)
 1000string$+=" "+FNshell_StringPadLeading(STR$~length%,"0",8)
 1001=string$
 1002:
 1003*|Stop FNshell_CatInfoRead
 1004*|Start FNshell_GetAppDir
 1005DEF FNshell_GetAppDir
 1006LOCAL temp%
 1007temp%=_U%!188
 1008=$temp%
 1009:
 1010*|Stop FNshell_GetAppDir
 1011*|Start FNshell_GetAppDataDir
 1012DEF FNshell_GetAppDataDir
 1013LOCAL temp%
 1014temp%=_U%!192
 1015=$temp%
 1016:
 1017*|Stop FNshell_GetAppDataDir
 1018*|Start FNshell_GetAppName
 1019DEF FNshell_GetAppName
 1020LOCAL temp%
 1021temp%=_U%!196
 1022=$temp%
 1023:
 1024*|Stop FNshell_GetAppName
 1025
 1026*|Start PROCshell_ResourcesInit
 1027DEF PROCshell_ResourcesInit
 1028LOCAL shell_AppDataDir$,temp%,shell_AppName$,shell_AppDir$,use_3d%
 1029LOCAL OSVarBuff%,YEigFactor%,XEigFactor%
 1030shell_AppName$=FNshell_GetAppName
 1031shell_AppDir$ =FNshell_GetAppDir
 1032OSVarBuff%=FNshell_HeapBlockFetch(256)
 1033IF FNshell_OSVarExists(OSVarBuff%,shell_AppName$+"Res$Path") THEN
 1034  _U%!100=_U%!100 OR 1<<3:REM set 'ResFind' flag..
 1035ENDIF
 1036IF FNshell_OSVarExists(OSVarBuff%,shell_AppName$+"Data$Dir") THEN
 1037  shell_AppDataDir$=FNshell_OSVarGetVal(OSVarBuff%,256,shell_AppName$+"Data$Dir",1)
 1038  _U%!192=FNshell_HeapBlockFetch((LENshell_AppDataDir$)+1)
 1039  temp%=_U%!192:$temp%=shell_AppDataDir$
 1040ELSE
 1041  _U%!192=FNshell_HeapBlockFetch((LENshell_AppDir$)+1)
 1042  temp%=_U%!192:$temp%=shell_AppDir$
 1043ENDIF
 1044IF _U%!100 AND 1<<3 THEN
 1045  REM ResFind initialised..
 1046*|define Using_ResFind
 1047  IF FNshell_FileExists(shell_AppName$+"Res:Messages") THEN
 1048    PROCshell_MessagesInit(shell_AppName$+"Res:Messages",_U%!68,_U%!64)
 1049  ENDIF
 1050  IF FNshell_FileExists(shell_AppName$+"Res:ShellMsgs") THEN
 1051   PROCshell_MessagesInit(shell_AppName$+"Res:ShellMsgs",_U%!280,_U%!284)
 1052  ELSE
 1053    PROCshell_MessagesInit("EvntShellRes:ShellMsgs",_U%!280,_U%!284)
 1054  ENDIF
 1055  SYS "XOS_ReadModeVariable",-1,04 TO ,,XEigFactor%
 1056  SYS "XOS_ReadModeVariable",-1,05 TO ,,YEigFactor%
 1057  IF YEigFactor% = 1 AND FNshell_FileExists(shell_AppName$+"Res:Sprites22") THEN
 1058    REM Screen mode is hi-res, and hi-res sprite file exists...
 1059    _U%!16 = FNshell_SpriteAreaLoad(shell_AppName$+"Res:Sprites22")
 1060  ELSE
 1061    IF FNshell_FileExists(shell_AppName$+"Res:Sprites") THEN
 1062      REM No hi-res sprite file, load normal one...
 1063      _U%!16=FNshell_SpriteAreaLoad(shell_AppName$+"Res:Sprites")
 1064    ELSE
 1065      _U%!16=1:REM use wimp sprite pool if no 'Sprites' file
 1066    ENDIF
 1067  ENDIF
 1068  REM check if templates need loading
 1069  use_3d% = FNshell_3DEnabled
 1070  IF use_3d% AND FNshell_FileExists(shell_AppName$+"Res:Templates3") THEN
 1071    PROCshell_TemplatesInit(shell_AppName$+"Res:Templates3")
 1072  ELSE
 1073    IF FNshell_FileExists(shell_AppName$+"Res:Templates") THEN
 1074      PROCshell_TemplatesInit(shell_AppName$+"Res:Templates")
 1075    ENDIF
 1076  ENDIF
 1077ELSE
 1078  REM ResFind NOT initialised..
 1079  IF FNshell_FileExists(shell_AppDir$+".Messages") THEN
 1080    PROCshell_MessagesInit(shell_AppDir$+".Messages",_U%!68,_U%!64)
 1081  ENDIF
 1082  IF FNshell_FileExists(shell_AppDir$+".ShellMsgs") THEN
 1083    PROCshell_MessagesInit(shell_AppDir$+".ShellMsgs",_U%!280,_U%!284)
 1084  ELSE
 1085    PROCshell_MessagesInit("EvntShellRes:ShellMsgs",_U%!280,_U%!284)
 1086  ENDIF
 1087  REM Check if user sprites need loading, but first check if program
 1088  REM has been started in a hi-res screen mode...
 1089  SYS "XOS_ReadModeVariable",-1,04 TO ,,XEigFactor%
 1090  SYS "XOS_ReadModeVariable",-1,05 TO ,,YEigFactor%
 1091  IF YEigFactor% = 1 AND FNshell_FileExists(shell_AppDir$+".Sprites22") THEN
 1092    REM Screen mode is hi-res, and hi-res sprite file exists...
 1093    _U%!16 = FNshell_SpriteAreaLoad(shell_AppDir$+".Sprites22")
 1094  ELSE
 1095    IF FNshell_FileExists(shell_AppDir$+".Sprites") THEN
 1096      _U%!16=FNshell_SpriteAreaLoad(shell_AppDir$+".Sprites")
 1097    ELSE
 1098      _U%!16=1:REM use wimp sprite pool if no 'Sprites' file
 1099    ENDIF
 1100  ENDIF
 1101  REM check if templates need loading
 1102  use_3d% = FNshell_3DEnabled
 1103  IF use_3d% AND FNshell_FileExists(shell_AppDir$+".Templates3") THEN
 1104    PROCshell_TemplatesInit(shell_AppDir$+".Templates3")
 1105  ELSE
 1106    IF FNshell_FileExists(shell_AppDir$+".Templates") THEN
 1107      PROCshell_TemplatesInit(shell_AppDir$+".Templates")
 1108    ENDIF
 1109  ENDIF
 1110ENDIF
 1111SYS "MenuUtil_Initialise"
 1112PROCshell_HeapBlockReturn(_Q%)
 1113_Q%=FNshell_HeapBlockFetch(1024):REM reduce global wimp block
 1114PROCshell_HeapBlockReturn(OSVarBuff%)
 1115ENDPROC
 1116:
 1117*|Stop PROCshell_ResourcesInit
 1118
 1119*|Start FNshell_SpriteAreaLoad
 1120DEF FNshell_SpriteAreaLoad(filename$)
 1121LOCAL sp%,S%,T%
 1122S%=OPENIN (filename$):T%=EXT#S%+16:CLOSE #S%
 1123sp%=FNshell_HeapBlockFetch(T%)
 1124!sp%=T%:sp%!4=0
 1125sp%!8=16:sp%!12=16
 1126SYS "OS_SpriteOp",&209,sp%
 1127SYS "OS_SpriteOp",&20A,sp%,filename$
 1128*|ifdef TraceInit
 1129PROCshell_Tracef0("SpriteLoad:Sprite file loaded at &"+STR$~sp%)
 1130*|endif
 1131=sp%
 1132:
 1133*|Stop FNshell_SpriteAreaLoad
 1134
 1135*|Start FNshell_UserSpritesBase
 1136DEF FNshell_UserSpritesBase
 1137=_U%!16
 1138:
 1139*|Stop FNshell_UserSpritesBase
 1140
 1141*|Start FNshell_SpriteGetPtr
 1142DEF FNshell_SpriteGetPtr(spritearea%,name$)
 1143LOCAL buffer%,ptr%
 1144buffer%=FNshell_HeapBlockFetch(21)
 1145$buffer%=name$
 1146SYS "OS_SpriteOp",&118,spritearea%,buffer% TO ,,ptr%
 1147PROCshell_HeapBlockReturn(buffer%)
 1148=ptr%
 1149:
 1150*|Stop FNshell_SpriteGetPtr
 1151
 1152*|Start PROCshell_TemplatesInit
 1153DEF PROCshell_TemplatesInit(filename$)
 1154LOCAL TemplatePtr%,IndirectPtr%,IndirectEnd%,X%,ptr%,buff_size%
 1155LOCAL filelen%,pos%,name_buffer%,name$,nr_templates%,flgs%,result%
 1156LOCAL file_offset%,data_size%,entry_type%,char%,identifier$,buff%
 1157name_buffer% = FNshell_HeapBlockFetch(20)
 1158pos% = 0 : nr_templates% = 0
 1159filelen% = FNshell_FileLength(filename$)
 1160
 1161REM Reserve space for window definitions
 1162TemplateBlk% = FNshell_HeapBlockFetch(filelen%)
 1163TemplatePtr% = TemplateBlk%
 1164PROCshell_TemplateFileInfo(filename$,buff_size%,nr_templates%,result%)
 1165IF result% = 0 THEN
 1166  REM Reserve a block to hold window identifiers (12 bytes) plus address of
 1167  REM window block (4 bytes)
 1168  _U%!4 = FNshell_HeapBlockFetch(20 * nr_templates%)
 1169  REM Reserve space for indirected icon data (size of largest window definition
 1170  REM plus all of the indirected data)..
 1171  IndirectBlk%  = FNshell_HeapBlockFetch(buff_size%)
 1172  IndirectPtr%  = IndirectBlk%
 1173  IndirectEnd%  = IndirectBlk% + buff_size%
 1174  
 1175  nr_templates% = 0
 1176  SYS "XWimp_OpenTemplate",,filename$ TO ;flgs%
 1177  IF (flgs% AND 1) THEN
 1178    ERROR 99,FNshell_MessageTwoArgs("SHELLMSG34","template",filename$)
 1179  ELSE
 1180    REPEAT
 1181      $name_buffer%="*"
 1182      SYS "Wimp_LoadTemplate",,TemplatePtr%,IndirectPtr%,IndirectEnd%,_U%!232,name_buffer%,pos% TO ,,IndirectPtr%,,,name$,pos%
 1183      IF pos%<>0 THEN
 1184        !((_U%!4)  + (16 * nr_templates%)) = TemplatePtr%
 1185        $(((_U%!4) + (16 * nr_templates%)) + 4) = name$
 1186*|ifdef TraceInit
 1187        PROCshell_Tracef0("TemplatesInit:  Template Loaded: "+name$)
 1188*|endif
 1189        TemplatePtr%  += (88 + (TemplatePtr%!84) * 32)
 1190        nr_templates% += 1
 1191      ENDIF
 1192    UNTIL pos% = 0
 1193    SYS "Wimp_CloseTemplate"
 1194    _U%!0 = nr_templates%
 1195*|ifdef TraceInit
 1196    PROCshell_Tracef0("TemplatesInit:Templates resource file loaded at       &"+STR$~TemplateBlk%+" ("+STR$nr_templates%+" templates)")
 1197    PROCshell_Tracef0("TemplatesInit:Indirected buffer size used for loading &"+STR$~buff_size%)
 1198*|endif
 1199  ENDIF
 1200ELSE
 1201  CASE result% OF
 1202    WHEN -1:ERROR 99,FNshell_MessageTwoArgs("SHELLMSG35","template",filename$)
 1203    WHEN -2:ERROR 99,FNshell_MessageTwoArgs("SHELLMSG36",filename$,"template")
 1204  ENDCASE
 1205ENDIF
 1206PROCshell_HeapBlockReturn(name_buffer%)
 1207ENDPROC
 1208:
 1209*|Stop PROCshell_TemplatesInit
 1210
 1211*|Start FNshell_WindowLoaded
 1212DEF FNshell_WindowLoaded(window$)
 1213LOCAL loop%,found%
 1214IF LEN(window$)>12 THEN ERROR 99,FNshell_MessageOneArg("SHELLMSG02",window$)
 1215found%=FALSE
 1216FOR loop%=0 TO (_U%!0)-1
 1217  IF $(((_U%!4)+(16*loop%))+4)=window$ THEN
 1218    found%=TRUE:loop%=(_U%!0)-1
 1219  ENDIF
 1220NEXT loop%
 1221=found%
 1222:
 1223*|Stop FNshell_WindowLoaded
 1224*|Start FNshell_GetWB
 1225DEF FNshell_GetWB(window$)
 1226LOCAL loop%,found%
 1227IF LEN(window$)>12 THEN ERROR 99,FNshell_MessageOneArg("SHELLMSG02",window$)
 1228found%=-1
 1229FOR loop%=0 TO (_U%!0)-1
 1230  IF $(((_U%!4)+(16*loop%))+4)=window$ THEN
 1231    found%=loop%:loop%=(_U%!0)-1
 1232  ENDIF
 1233NEXT loop%
 1234IF found%>-1 THEN
 1235  =!((_U%!4)+(16*found%))
 1236ELSE
 1237  ERROR 99,FNshell_MessageOneArg("SHELLMSG03",window$)
 1238ENDIF
 1239=FALSE
 1240:
 1241
 1242*|Stop FNshell_GetWB
 1243*|Start FNshell_MessageExpand
 1244DEF FNshell_MessageExpand(h$)
 1245LOCAL s$, m$, index%
 1246s$=""
 1247WHILE INSTR(h$,"\")>0
 1248  index%=INSTR(h$,"\")
 1249  s$+=LEFT$(h$,index%-1)
 1250  m$=MID$(h$,index%+1,1)
 1251  h$=MID$(h$,index%+2)
 1252  CASE m$ OF
 1253    WHEN "A":s$+="Click ADJUST to"
 1254    WHEN "a":s$+="ADJUST"
 1255    WHEN "D":s$+="Drag with SELECT to"
 1256    WHEN "d":s$+="Drag with ADJUST to"
 1257    WHEN "G":s$+="This option is greyed out because"
 1258    WHEN "R":s$+="Move the pointer right"
 1259    WHEN "S":s$+="Click SELECT to"
 1260    WHEN "s":s$+="SELECT"
 1261    WHEN "T":s$+="This is the"
 1262    WHEN "W":s$+="This window is"
 1263    WHEN "w":s$+="window"
 1264  OTHERWISE
 1265    s$+="\"+m$
 1266  ENDCASE
 1267ENDWHILE
 1268=s$+h$
 1269:
 1270REM ----------------------------------------------------------
 1271:
 1272*|Stop FNshell_MessageExpand
 1273
 1274*|Start PROCshell_OpenMenu
 1275DEF PROCshell_OpenMenu(x%,y%,m%)
 1276LOCAL fn$
 1277fn$=FNshell_GetEventHandler(_U%!28,_U%!32,1)
 1278IF fn$<>"" THEN
 1279*|ifdef TraceInit
 1280  PROCshell_Tracef0("OpenMenu:About to call "+"FN"+fn$+"("+STR$_U%!28+","+STR$_U%!32+")")
 1281*|endif
 1282  void%=EVAL("FN"+fn$+"(_U%!28,_U%!32)"):REM call menumaker
 1283ELSE
 1284  PROCshell_Tracef0("OpenMenu:no menumaker function registered")
 1285ENDIF
 1286IF m%<>_U%!24 THEN
 1287  REM If menu is not being re-opened by an adjust click, discard stored
 1288  REM 'SelectionSoFar' string used by FontMenu routines..
 1289  IF FNshell_HeapBlockExists(_U%!256) THEN
 1290    PROCshell_HeapBlockReturn(_U%!256):_U%!256=0
 1291  ENDIF
 1292  REM And the name of the currently selected font in this menu..
 1293  IF FNshell_HeapBlockExists(_U%!244 ) THEN
 1294    PROCshell_HeapBlockReturn(_U%!244):_U%!244=0
 1295  ENDIF
 1296ENDIF
 1297IF m%=_U%!252 THEN
 1298  SYS "Wimp_CreateMenu",,m%,x% - 64,y%
 1299  _U%!264=1
 1300ELSE
 1301  _Q%!0 = x%:_Q%!4 = y%
 1302  SYS "MenuUtil_Show",m%,_Q%
 1303  _U%!264=0
 1304ENDIF
 1305_U%!24=m%:REM store handle of currently open menu
 1306_U%!36=x%:REM store menu x position
 1307_U%!40=y%:REM store menu y position
 1308_U%!52=_U%!28:REM store window
 1309_U%!56=_U%!32:REM store icon
 1310ENDPROC
 1311:
 1312*|Stop PROCshell_OpenMenu
 1313
 1314*|Start FNshell_MenuLastXPos
 1315DEF FNshell_MenuLastXPos
 1316=_U%!36
 1317:
 1318*|Stop FNshell_MenuLastXPos
 1319
 1320*|Start FNshell_MenuLastYPos
 1321DEF FNshell_MenuLastYPos
 1322=_U%!40
 1323:
 1324*|Stop FNshell_MenuLastYPos
 1325
 1326*|Start PROCshell_MenuAttachDbox
 1327DEF PROCshell_MenuAttachDbox(menu$)
 1328REM attach a dummy window handle for now, just so that the sub window arrow
 1329REM appears on the menu!
 1330SYS "Menu_SetSubHandle",_U%!8,FNshell_MenuString(menu$),1
 1331PROCshell_Tracef0("MenuAttachDbox:Dialog box ("+menu$+") attached")
 1332ENDPROC
 1333:
 1334*|Stop PROCshell_MenuAttachDbox
 1335
 1336*|Start FNshell_MessageWindow
 1337DEF FNshell_MessageWindow(text$,cancel%,progname$,head$)
 1338LOCAL keys%,err_blk%
 1339err_blk%=FNshell_HeapBlockFetch(260)
 1340!err_blk%=0:$(err_blk%+4)=text$+CHR$(0)
 1341IF head$="" THEN head$="Message from "+progname$
 1342IF cancel% THEN
 1343 SYS "Wimp_ReportError",err_blk%,19,head$ TO ,keys%
 1344ELSE
 1345 SYS "Wimp_ReportError",err_blk%,17,head$ TO ,keys%
 1346ENDIF
 1347PROCshell_HeapBlockReturn(err_blk%)
 1348=keys%
 1349:
 1350*|Stop FNshell_MessageWindow
 1351
 1352*|Start PROCshell_CreateWindow
 1353DEF PROCshell_CreateWindow(ident$,RETURN handle%)
 1354LOCAL wb_ptr%
 1355wb_ptr%=FNshell_GetWB(ident$)
 1356REM set 'sprite area' pointer to usersprites area
 1357wb_ptr%!64=_U%!16
 1358SYS "Wimp_CreateWindow",,wb_ptr% TO handle%
 1359ENDPROC
 1360:
 1361*|Stop PROCshell_CreateWindow
 1362*|Start FNshell_CreateWindow2
 1363DEF FNshell_CreateWindow2(title,flags%,fgcol%,bgcol%,maxx%,miny%,l%,b%,r%,t%)
 1364LOCAL Q%
 1365Q%=FNshell_HeapBlockFetch(3000)
 1366Q%!0=l%:Q%!4=b%:Q%!8=r%:Q%!12=t%:Q%!16=0
 1367Q%!20=0:Q%!24=-1:Q%!28=flags%:Q%?32=7
 1368Q%?33=2:Q%?34=fgcol%:Q%?35=bgcol%
 1369Q%?36=3:Q%?37=1
 1370Q%?38=2:Q%?39=0:Q%!40=0:Q%!44=miny%
 1371Q%!48=maxx%:Q%!52=0:Q%!56=&13D:Q%!60=&3000
 1372Q%!68=1:Q%!72=title:Q%!76=-1:Q%!80=LEN$title:Q%!84=0
 1373SYS "Wimp_CreateWindow",,Q% TO handle%
 1374PROCshell_HeapBlockReturn(Q%)
 1375=handle%
 1376:
 1377*|Stop FNshell_CreateWindow2
 1378
 1379*|Start FNshell_WindowHasTitleBar
 1380DEF FNshell_WindowHasTitleBar(wh%)
 1381=(FNshell_WindowGetFlags(wh%) AND 1<<26)
 1382:
 1383*|Stop FNshell_WindowHasTitleBar
 1384
 1385*|Start FNshell_WindowIsMoveable
 1386
 1387DEF FNshell_WindowIsMoveable(wh%)
 1388=(FNshell_WindowGetFlags(wh%) AND 1<<1)
 1389:
 1390*|Stop FNshell_WindowIsMoveable
 1391
 1392*|Start FNshell_WindowIsAPane
 1393DEF FNshell_WindowIsAPane(wh%)
 1394=(FNshell_WindowGetFlags(wh%) AND 1<<5)
 1395:
 1396*|Stop FNshell_WindowIsAPane
 1397
 1398*|Start FNshell_WindowIsNotBounded
 1399DEF FNshell_WindowIsNotBounded(wh%)
 1400=(FNshell_WindowGetFlags(wh%) AND 1<<6)
 1401:
 1402*|Stop FNshell_WindowIsNotBounded
 1403
 1404*|Start FNshell_WindowTrapsHotKeys
 1405DEF FNshell_WindowTrapsHotKeys(wh%)
 1406=(FNshell_WindowGetFlags(wh%) AND 1<<12)
 1407:
 1408*|Stop FNshell_WindowTrapsHotKeys
 1409
 1410*|Start FNshell_WindowIsOpen
 1411DEF FNshell_WindowIsOpen(wh%)
 1412=(FNshell_WindowGetFlags(wh%) AND 1<<16)
 1413:
 1414*|Stop FNshell_WindowIsOpen
 1415
 1416*|Start FNshell_WindowIsOnTop
 1417DEF FNshell_WindowIsOnTop(wh%)
 1418=(FNshell_WindowGetFlags(wh%) AND 1<<17)
 1419:
 1420*|Stop FNshell_WindowIsOnTop
 1421
 1422*|Start FNshell_WindowHasBeenToggled
 1423DEF FNshell_WindowHasBeenToggled(wh%)
 1424=(FNshell_WindowGetFlags(wh%) AND 1<<18)
 1425:
 1426*|Stop FNshell_WindowHasBeenToggled
 1427
 1428*|Start FNshell_WindowHasInputFocus
 1429DEF FNshell_WindowHasInputFocus(wh%)
 1430=(FNshell_WindowGetFlags(wh%) AND 1<<20)
 1431:
 1432*|Stop FNshell_WindowHasInputFocus
 1433
 1434*|Start FNshell_WindowHasBackIcon
 1435DEF FNshell_WindowHasBackIcon(wh%)
 1436=(FNshell_WindowGetFlags(wh%) AND 1<<24)
 1437:
 1438*|Stop FNshell_WindowHasBackIcon
 1439
 1440*|Start FNshell_WindowHasCloseIcon
 1441DEF FNshell_WindowHasCloseIcon(wh%)
 1442=(FNshell_WindowGetFlags(wh%) AND 1<<25)
 1443:
 1444*|Stop FNshell_WindowHasCloseIcon
 1445
 1446*|Start FNshell_WindowHasToggleIcon
 1447DEF FNshell_WindowHasToggleIcon(wh%)
 1448=(FNshell_WindowGetFlags(wh%) AND 1<<27)
 1449:
 1450*|Stop FNshell_WindowHasToggleIcon
 1451
 1452*|Start FNshell_WindowHasVScrollBar
 1453DEF FNshell_WindowHasVScrollBar(wh%)
 1454=(FNshell_WindowGetFlags(wh%) AND 1<<28)
 1455:
 1456*|Stop FNshell_WindowHasVScrollBar
 1457
 1458*|Start FNshell_WindowHasAdjustSizeIcon
 1459DEF FNshell_WindowHasAdjustSizeIcon(wh%)
 1460=(FNshell_WindowGetFlags(wh%) AND 1<<29)
 1461:
 1462*|Stop FNshell_WindowHasAdjustSizeIcon
 1463
 1464*|Start FNshell_WindowHasHScrollBar
 1465DEF FNshell_WindowHasHScrollBar(wh%)
 1466=(FNshell_WindowGetFlags(wh%) AND 1<<30)
 1467:
 1468*|Stop FNshell_WindowHasHScrollBar
 1469
 1470*|Start FNshell_WindowGetFlags
 1471DEF FNshell_WindowGetFlags(wh%)
 1472LOCAL flags%,blk%
 1473blk%=FNshell_HeapBlockFetch(36)
 1474blk%!0=wh%
 1475SYS "Wimp_GetWindowState",,blk%
 1476flags%=blk%!32
 1477PROCshell_HeapBlockReturn(blk%)
 1478=flags%
 1479:
 1480*|Stop FNshell_WindowGetFlags
 1481
 1482*|Start FNshell_WindowGetTitleFlags
 1483DEF FNshell_WindowGetTitleFlags(wh%)
 1484LOCAL flags%,blk%
 1485blk%=FNshell_HeapBlockFetch(100 + (FNshell_WindowCountIcons(wh%) * 32))
 1486blk%!0=wh%
 1487SYS "Wimp_GetWindowInfo",,blk%
 1488flags%=blk%!60
 1489PROCshell_HeapBlockReturn(blk%)
 1490=flags%
 1491:
 1492*|Stop FNshell_WindowGetTitleFlags
 1493
 1494*|Start FNshell_IconGetFlags
 1495DEF FNshell_IconGetFlags(wh%,ih%)
 1496LOCAL flags%,blk%
 1497REM claim a block as temporary workspace big enough for data
 1498REM returned by SWI call (icon block + 8 bytes)
 1499blk%=FNshell_HeapBlockFetch(50)
 1500blk%!0=wh%:blk%!4=ih%
 1501SYS "Wimp_GetIconState",,blk%
 1502flags%=blk%!24
 1503PROCshell_HeapBlockReturn(blk%)
 1504=flags%
 1505:
 1506*|Stop FNshell_IconGetFlags
 1507
 1508*|Start FNshell_WindowTitleFlags
 1509DEF FNshell_WindowTitleFlags(wh%)
 1510LOCAL flags%,blk%
 1511blk%=FNshell_HeapBlockFetch(100 + (FNshell_WindowCountIcons(wh%) * 32))
 1512blk%!0=wh%
 1513SYS "Wimp_GetWindowInfo",,blk%
 1514flags%=blk%!60
 1515PROCshell_HeapBlockReturn(blk%)
 1516=flags%
 1517:
 1518*|Stop FNshell_WindowTitleFlags
 1519
 1520*|Start FNshell_WindowTitleHasBorder
 1521DEF FNshell_WindowTitleHasBorder(wh%)
 1522=(FNshell_WindowTitleFlags(wh%) AND 1<<2)
 1523:
 1524*|Stop FNshell_WindowTitleHasBorder
 1525
 1526*|Start FNshell_WindowTitleIsSprite
 1527DEF FNshell_WindowTitleIsSprite(wh%)
 1528=(FNshell_WindowTitleFlags(wh%) AND 1<<1)
 1529:
 1530*|Stop FNshell_WindowTitleIsSprite
 1531
 1532*|Start FNshell_WindowTitleIsText
 1533DEF FNshell_WindowTitleIsText(wh%)
 1534=(FNshell_WindowTitleFlags(wh%) AND 1<<0)
 1535:
 1536*|Stop FNshell_WindowTitleIsText
 1537
 1538*|Start FNshell_WindowTitleIsHCentred
 1539DEF FNshell_WindowTitleIsHCentred(wh%)
 1540=(FNshell_WindowTitleFlags(wh%) AND 1<<3)
 1541:
 1542*|Stop FNshell_WindowTitleIsHCentred
 1543
 1544*|Start FNshell_WindowTitleIsVCentred
 1545DEF FNshell_WindowTitleIsVCentred(wh%)
 1546=(FNshell_WindowTitleFlags(wh%) AND 1<<4)
 1547:
 1548*|Stop FNshell_WindowTitleIsVCentred
 1549
 1550*|Start FNshell_WindowTitleIsFilled
 1551DEF FNshell_WindowTitleIsFilled(wh%)
 1552=(FNshell_WindowTitleFlags(wh%) AND 1<<5)
 1553:
 1554*|Stop FNshell_WindowTitleIsFilled
 1555
 1556*|Start FNshell_WindowTitleIsAAliased
 1557DEF FNshell_WindowTitleIsAAliased(wh%)
 1558=(FNshell_WindowTitleFlags(wh%) AND 1<<6)
 1559:
 1560*|Stop FNshell_WindowTitleIsAAliased
 1561
 1562*|Start FNshell_WindowTitleIsIndirected
 1563DEF FNshell_WindowTitleIsIndirected(wh%)
 1564=(FNshell_WindowTitleFlags(wh%) AND 1<<8)
 1565:
 1566*|Stop FNshell_WindowTitleIsIndirected
 1567
 1568*|Start FNshell_WindowGetTitle
 1569DEF FNshell_WindowGetTitle(wh%)
 1570LOCAL title$,blk%
 1571REM Check if window has a title bar..
 1572blk%=FNshell_HeapBlockFetch(100 + (FNshell_WindowCountIcons(wh%) * 32))
 1573blk%!0=wh%
 1574SYS "Wimp_GetWindowInfo",,blk%
 1575IF (blk%!32 AND 1<<26) THEN
 1576  IF ((blk%!60) AND &100)=0 THEN
 1577    REM Title is not indirected..
 1578    title$=$(blk%+76)
 1579  ELSE
 1580    REM Title is indirected..
 1581    title$=$(!(blk%+76))
 1582  ENDIF
 1583ENDIF
 1584PROCshell_HeapBlockReturn(blk%)
 1585=title$
 1586:
 1587*|Stop FNshell_WindowGetTitle
 1588
 1589*|Start FNshell_WindowTitleBufferLength
 1590DEF FNshell_WindowTitleBufferLength(wh%)
 1591LOCAL result%,blk%
 1592blk%=FNshell_HeapBlockFetch(100 + (FNshell_WindowCountIcons(wh%) * 32))
 1593blk%!0=wh%
 1594SYS "Wimp_GetWindowInfo",,blk%
 1595  IF ((blk%!60) AND &100)=0 THEN
 1596    result%=12
 1597  ELSE
 1598    result%=blk%!84
 1599  ENDIF
 1600PROCshell_HeapBlockReturn(blk%)
 1601=result%
 1602:
 1603*|Stop FNshell_WindowTitleBufferLength
 1604
 1605*|Start PROCshell_WindowMoveToIcon
 1606DEF PROCshell_WindowMoveToIcon(wh%,iwh%,ih%,x_off%,y_off%)
 1607LOCAL i_blk%,w_blk%
 1608i_blk%    = FNshell_HeapBlockFetch(50)
 1609w_blk%    = FNshell_HeapBlockFetch(36)
 1610w_blk%!20 = 0
 1611IF FNshell_OSCheckVersion(3) THEN
 1612  IF iwh% = -1 THEN !w_blk% = -2 ELSE !w_blk% = iwh%
 1613  SYS "Wimp_GetWindowState",,w_blk%
 1614ENDIF
 1615i_blk%!0 = iwh% : i_blk%!4 = ih%
 1616SYS "Wimp_GetIconState",,i_blk%
 1617PROCshell_WindowMoveTo(wh%,i_blk%!8+x_off%-w_blk%!20,i_blk%!20+y_off%)
 1618REM PROCshell_WindowMoveTo(wh%,i_blk%!8+x_off%,i_blk%!20+y_off%)
 1619PROCshell_HeapBlockReturn(i_blk%)
 1620PROCshell_HeapBlockReturn(w_blk%)
 1621ENDPROC
 1622:
 1623*|Stop PROCshell_WindowMoveToIcon
 1624
 1625*|Start PROCshell_WindowMoveTo
 1626DEF PROCshell_WindowMoveTo(wh%,x%,y%)
 1627LOCAL win_width%,win_height%,offset%,blk%
 1628blk%=FNshell_HeapBlockFetch(100 + (FNshell_WindowCountIcons(wh%) * 32))
 1629blk%!0=wh%
 1630SYS "Wimp_GetWindowInfo",,blk%
 1631win_width% =blk%!12-blk%!4
 1632win_height%=blk%!16-blk%!8
 1633blk%!4=x%
 1634blk%!8=y%
 1635blk%!12=x%+win_width%
 1636blk%!16=y%+win_height%
 1637REM this looks really silly, but is necessary to tell the
 1638REM window manager the new window coords. The shell_OpenWindow
 1639REM call sets up any panes and actually opens the window in
 1640REM the new position
 1641SYS "Wimp_OpenWindow",,blk%
 1642SYS "Wimp_CloseWindow",,blk%
 1643offset%=FNshell_SearchStatic(_U%!184,wh%)
 1644IF offset%>-1 THEN
 1645  PROCshell_OpenWindowStatic(wh%)
 1646ELSE
 1647  PROCshell_OpenWindowDynamic2(wh%,0,0)
 1648ENDIF
 1649PROCshell_HeapBlockReturn(blk%)
 1650ENDPROC
 1651:
 1652*|Stop PROCshell_WindowMoveTo
 1653
 1654*|Start PROCshell_WindowBringToTop
 1655DEF PROCshell_WindowBringToTop(wh%)
 1656LOCAL msg%
 1657msg%=FNshell_HeapBlockFetch(256)
 1658msg%!0=wh%
 1659SYS "Wimp_GetWindowState",,msg%
 1660msg%!28=-1
 1661SYS "Wimp_SendMessage",2,msg%,wh%
 1662REM now call wimp poll as this action must happen
 1663REM without waiting for next wimp poll...
 1664SYS "Wimp_Poll",0,msg%
 1665PROCshell_HeapBlockReturn(msg%)
 1666ENDPROC
 1667:
 1668*|Stop PROCshell_WindowBringToTop
 1669
 1670*|Start PROCshell_UpdateWindow
 1671DEF PROCshell_UpdateWindow(handle%,l%,b%,r%,t%)
 1672LOCAL blk%
 1673blk%=FNshell_HeapBlockFetch(blk%)
 1674blk%!0=handle%:blk%!4=l%:blk%!8=b%:blk%!12=r%:blk%!16=t%
 1675SYS "Wimp_UpdateWindow",,blk% TO more%
 1676SYS "Wimp_GetWindowState",,blk%
 1677PROCshell_HeapBlockReturn(blk%)
 1678ENDPROC
 1679:
 1680*|Stop PROCshell_UpdateWindow
 1681
 1682*|Start PROCshell_OpenWindowDynamic2
 1683DEF PROCshell_OpenWindowDynamic2(wh%,x_off%,y_off%)
 1684LOCAL void%,ptr_blk%
 1685ptr_blk%=FNshell_HeapBlockFetch(20)
 1686_U%!20=wh%
 1687SYS "Wimp_GetPointerInfo",,ptr_blk%
 1688SYS "Wimp_CreateMenu",,wh%,ptr_blk%!0+x_off%,ptr_blk%!4+y_off%
 1689PROCshell_HeapBlockReturn(ptr_blk%)
 1690ENDPROC
 1691:
 1692*|Stop PROCshell_OpenWindowDynamic2
 1693
 1694*|Start FNshell_ClaimKeypress
 1695DEF FNshell_ClaimKeypress
 1696REM Bodge to ensure that shell_OpenWindowDynamic works properly..
 1697IF _U%!20<>0 THEN
 1698  SYS "Wimp_CreateMenu",,-1
 1699  void%=FNshell_DeleteWindow(_U%!20)
 1700  _U%!20=0
 1701ENDIF
 1702=TRUE
 1703:
 1704*|Stop FNshell_ClaimKeypress
 1705
 1706*|Start PROCshell_OpenWindow
 1707DEF PROCshell_OpenWindow(wh%,full%,front%)
 1708LOCAL offset%,blk%,paneblk%,ctr%,first_pane%,behind%,height%,width%
 1709LOCAL flag%,toggle%,t%,last_pane%,prev_pane%,res%,ptr_info_blk%
 1710REM check for openwindow event
 1711offset% = FNshell_GetEventListOffset(wh%,-1,_U%+304,12,FALSE)
 1712IF offset% >= 0 THEN
 1713  blk%  =_U%!304 + offset%
 1714  temp% = blk%!8
 1715*|ifdef TraceInit
 1716  PROCshell_Tracef0("OpenWindow:About to call "+"FN"+$temp%)
 1717*|endif
 1718  res% = EVAL("FN"+$temp%)
 1719  IF res% = 0 THEN ENDPROC
 1720ENDIF
 1721
 1722toggle% = FALSE
 1723t%   = FNshell_HeapBlockFetch(40)
 1724t%!0 = wh%
 1725SYS "Wimp_GetWindowState",,t%
 1726IF (t%!32 AND &80000) = &80000 THEN toggle% = TRUE ELSE toggle% = FALSE
 1727PROCshell_HeapBlockReturn(t%)
 1728
 1729ptr_info_blk% = FNshell_HeapBlockFetch(20)
 1730SYS "Wimp_GetPointerInfo",,ptr_info_blk%
 1731
 1732_Q%!0 = wh%
 1733IF NOT full% THEN SYS "Wimp_GetWindowState",,_Q%
 1734IF toggle% THEN
 1735  SYS "Wimp_OpenWindow",,_Q%
 1736ENDIF
 1737offset% = FNshell_GetEventListOffset(wh%,-1,_U% + 92,24,FALSE)
 1738IF offset% > -1 THEN
 1739  blk%=(_U%!92) + offset%
 1740  REM pane handler event found
 1741  ptr8% = blk%!8:ptr12% = blk%!12:ptr16% = blk%!16:ptr20% = blk%!20
 1742  _Q%!0=wh%
 1743  IF front% THEN behind%=-1 ELSE behind%=_Q%!28
 1744  IF NOT full% THEN
 1745    SYS "Wimp_OpenWindow",,_Q%     :REM vbase fudge..
 1746    SYS "Wimp_GetWindowState",,_Q%
 1747    SYS "Wimp_CloseWindow",,_Q%    :REM vbase fudge..
 1748  ENDIF
 1749  REM reserve 1k as buffer - hope it's enough.....
 1750  paneblk% = FNshell_HeapBlockFetch(40)
 1751  ctr% = 0
 1752  WHILE ptr8%!ctr% <> -1
 1753    paneblk%!0 = ptr8%!ctr%:REM handle of 'pane'
 1754    IF first_pane% = 0 THEN first_pane% = paneblk%!0
 1755    last_pane% = paneblk%!0
 1756    SYS "Wimp_GetWindowState",,paneblk%
 1757    IF ptr_info_blk%!16 = -9 OR toggle% OR ptr_info_blk%!16 > -5 OR front% THEN
 1758      REM open pane
 1759      REM Check flag word in pane event block...
 1760      flag% = ptr12%!ctr%
 1761      CASE flag% OF
 1762      WHEN 0,1
 1763        height%=paneblk%!16-paneblk%!8
 1764        width%=paneblk%!12-paneblk%!4
 1765        paneblk%!4=_Q%!4+ptr16%!ctr%
 1766        paneblk%!12=paneblk%!4+width%
 1767        paneblk%!16=_Q%!16+ptr20%!ctr%
 1768        paneblk%!8=paneblk%!16-height%
 1769      WHEN 2
 1770        REM Attached to top edge.....
 1771        height%=paneblk%!16-paneblk%!8
 1772        width%=_Q%!12-_Q%!4
 1773        paneblk%!4=_Q%!4+ptr16%!ctr%
 1774        paneblk%!12=_Q%!12
 1775        paneblk%!16=_Q%!16+ptr20%!ctr%
 1776        paneblk%!8=paneblk%!16-height%
 1777      WHEN 3
 1778        REM Attached to left edge...
 1779        height%=_Q%!16-_Q%!8
 1780        width%=paneblk%!12-paneblk%!4
 1781        paneblk%!4=_Q%!4+ptr16%!ctr%
 1782        paneblk%!12=paneblk%!4+width%
 1783        paneblk%!16=_Q%!16             :REM min y
 1784        paneblk%!8=_Q%!8+ptr20%!ctr%   :REM max y
 1785      WHEN 4
 1786        REM Attached to bottom edge...
 1787        height%=paneblk%!16-paneblk%!8
 1788        width%=_Q%!12-_Q%!4
 1789        paneblk%!4=_Q%!4+ptr16%!ctr%
 1790        paneblk%!12=_Q%!12
 1791        paneblk%!16=_Q%!8+height%+ptr20%!ctr%
 1792        paneblk%!8=paneblk%!16+height%
 1793      WHEN 5
 1794        REM Attached to right edge...
 1795        height%=_Q%!16-_Q%!8
 1796        width%=paneblk%!12-paneblk%!4
 1797        paneblk%!4=_Q%!12-width%+ptr16%!ctr%
 1798        paneblk%!12=paneblk%!4+width%
 1799        paneblk%!16=_Q%!16 :REM min y
 1800        paneblk%!8=_Q%!8   :REM max y
 1801      ENDCASE
 1802      IF ctr%=0 THEN
 1803        paneblk%!28 = behind%
 1804      ELSE
 1805        paneblk%!28 = prev_pane%
 1806      ENDIF
 1807      SYS "Wimp_OpenWindow",,paneblk%
 1808    ENDIF
 1809    prev_pane% = paneblk%!0
 1810    ctr% += 4
 1811  ENDWHILE
 1812  IF NOT toggle% THEN
 1813    _Q%!28 = last_pane%
 1814    SYS "Wimp_OpenWindow",,_Q%
 1815  ENDIF
 1816  PROCshell_HeapBlockReturn(paneblk%)
 1817ELSE
 1818  REM no pane event...
 1819  _Q%!0 = wh%
 1820  IF NOT full% THEN SYS "Wimp_GetWindowState",,_Q%
 1821  IF behind% = -2 THEN _Q%!28 = -2
 1822  IF front%  = -1 THEN _Q%!28 = -1
 1823  SYS "Wimp_OpenWindow",,_Q%
 1824ENDIF
 1825PROCshell_HeapBlockReturn(ptr_info_blk%)
 1826ENDPROC
 1827:
 1828*|Stop PROCshell_OpenWindow
 1829
 1830*|Start PROCshell_CloseWindow
 1831DEF PROCshell_CloseWindow(wh%)
 1832LOCAL offset%,blk%,ptr8%,ptr12%,ptr16%,ptr20%,win_blk%,res%
 1833offset%=FNshell_GetEventListOffset(wh%,-1,_U%+308,12,FALSE)
 1834IF offset%>=0 THEN
 1835  blk%=_U%!308+offset%
 1836  temp%=blk%!8
 1837*|ifdef TraceInit
 1838  PROCshell_Tracef0("CloseWindow:About to call "+"FN"+$temp%)
 1839*|endif
 1840  res%=EVAL("FN"+$temp%)
 1841  IF res%=0 THEN ENDPROC
 1842ENDIF
 1843win_blk%=FNshell_HeapBlockFetch(60)
 1844IF wh%>0 THEN
 1845  offset%=FNshell_GetEventListOffset(wh%,-1,_U%+92,24,FALSE)
 1846  IF offset%>-1 THEN
 1847    blk%=(_U%!92)+offset%
 1848    ptr12%=blk%!12:ptr16%=blk%!16:ptr20%=blk%!20
 1849    ctr%=0:ptr8%=blk%!8
 1850    WHILE ptr8%!ctr%<>-1
 1851      REM close pane windows
 1852      win_blk%!0=ptr8%!ctr%
 1853      SYS "Wimp_CloseWindow",,win_blk%
 1854      ctr%+=4
 1855    ENDWHILE
 1856    REM PROCshell_HeapBlockReturn(ptr8%)
 1857    REM PROCshell_HeapBlockReturn(ptr12%)
 1858    REM PROCshell_HeapBlockReturn(ptr16%)
 1859    REM PROCshell_HeapBlockReturn(ptr20%)
 1860  ENDIF
 1861  REM close parent window
 1862  win_blk%!0=wh%:SYS "Wimp_CloseWindow",,win_blk%
 1863ENDIF
 1864PROCshell_HeapBlockReturn(win_blk%)
 1865ENDPROC
 1866:
 1867*|Stop PROCshell_CloseWindow
 1868
 1869*|Start FNshell_DeleteWindow
 1870DEF FNshell_DeleteWindow(handle%)
 1871LOCAL win_blk%
 1872win_blk%=FNshell_HeapBlockFetch(20)
 1873IF handle%<>0 THEN
 1874  IF FNoktodeletew(handle%) THEN
 1875    PROCshell_EventDeleteAll(handle%)
 1876    IF handle%=_U%!20 THEN _U%!20=0
 1877    offset%=FNshell_SearchStatic(_U%!184,handle%)
 1878    IF offset%>-1 THEN
 1879      temp%=_U%!184+offset%
 1880      temp%!0=0:REM wipe window handle in static list
 1881    ENDIF
 1882    REM and now actually delete the window..
 1883    win_blk%!0=handle%
 1884    SYS "Wimp_DeleteWindow",,win_blk%
 1885    handle%=0
 1886  ENDIF
 1887ENDIF
 1888PROCshell_HeapBlockReturn(win_blk%)
 1889=handle%
 1890:
 1891*|Stop FNshell_DeleteWindow
 1892*|Start FNoktodeletew
 1893DEF FNoktodeletew(handle%)
 1894=-1
 1895:
 1896*|Stop FNoktodeletew
 1897*|Start FNoktoclosew
 1898DEF FNoktoclosew(handle%)
 1899=-1
 1900:
 1901*|Stop FNoktoclosew
 1902*|Start PROCcliprect
 1903DEF PROCcliprect(b,RETURN x1%,RETURN y1%,RETURN x2%,RETURN y2%)
 1904LOCAL x0%,y0%
 1905PROClwaorigin(b,x0%,y0%):x1%=b!24-x0%:y1%=b!28-y0%:x2%=b!32-x0%
 1906y2%=b!36-y0%
 1907ENDPROC
 1908:
 1909*|Stop PROCcliprect
 1910
 1911*|Start FNpoll
 1912DEF FNpoll(mask%,task%)
 1913IF _U%!100 AND 1 << 6 THEN SYS "WimpExt_PrePoll"
 1914SYS "Wimp_Poll",mask%,_Q% TO a%
 1915IF _U%!100 AND 1 << 6 THEN SYS "WimpExt_Action",_U%!148,_Q%,a%
 1916=a%
 1917:
 1918*|Stop FNpoll
 1919
 1920*|Start FNshell_Poll_I
 1921DEF FNshell_Poll_I(mask%,task%)
 1922IF _U%!100 AND 1 << 6 THEN SYS "WimpExt_PrePoll"
 1923SYS "Wimp_Poll",mask%,_Q% TO a%
 1924IF _U%!100 AND 1 << 6 THEN SYS "WimpExt_Action",_U%!148,_Q%,a%
 1925SYS "Interface_Poll",a%,,task%
 1926=a%
 1927:
 1928*|Stop FNshell_Poll_I
 1929
 1930*|Start PROCshell_DoBackgroundTask
 1931DEF PROCshell_DoBackgroundTask
 1932ENDPROC
 1933:
 1934*|Stop PROCshell_DoBackgroundTask
 1935
 1936*|Start FNshell_IconIsDraggable
 1937DEF FNshell_IconIsDraggable(wh%,ih%)
 1938LOCAL flags%
 1939flags%=FNshell_IconGetFlags(wh%,ih%)
 1940temp%=(flags% AND &6000)
 1941IF temp%=&6000 =TRUE ELSE =FALSE
 1942:
 1943*|Stop FNshell_IconIsDraggable
 1944
 1945*|Start FNshell_IconIsSprite
 1946DEF FNshell_IconIsSprite(wh%,ih%)
 1947LOCAL flags%,temp%
 1948flags%=FNshell_IconGetFlags(wh%,ih%)
 1949temp%=(flags% AND 1<<1)
 1950IF temp%=(1<<1) THEN =TRUE ELSE =FALSE
 1951:
 1952*|Stop FNshell_IconIsSprite
 1953
 1954*|Start PROCshell_IconDragBox
 1955DEF PROCshell_IconDragBox(wh%,ih%)
 1956LOCAL blk%,wex,wey,e_offset%,flags%,f%,DragASprite%,spr_area%,valid%,spr$
 1957LOCAL name_ic%,name$
 1958REM check if an event has been registered for when the drag ends..
 1959e_offset% = FNshell_GetEventListOffset(wh%,ih%,_U% + 72,24,FALSE)
 1960IF e_offset% >= 0 THEN
 1961  REM it has, so go ahead and allow the drag, but first check if a filename
 1962  REM is present in the filename icon..
 1963  blk%=_U%!72+e_offset%
 1964  name_ic%=blk%!16
 1965  name$=FNshell_IconGetData(wh%,name_ic%)
 1966  IF name$="" THEN PROCshell_OK(FNshell_MessageNoArgs("SHELLMSG28"))
 1967  blk%=FNshell_HeapBlockFetch(100 + (FNshell_WindowCountIcons(wh%) * 32))
 1968  !blk%=wh%
 1969  SYS "Wimp_GetWindowInfo",,blk%
 1970  wex = blk%!4 - blk%!20:wey = blk%!16 - blk%!24
 1971  spr_area% = blk%!68
 1972  blk%!4 = ih%
 1973  SYS "Wimp_GetIconState",,blk%
 1974  !blk%=wh%:blk%!4=5:flags%=blk%!24:valid%=blk%!32
 1975  blk%!08 = blk%!08 + wex
 1976  blk%!12 = blk%!12 + wey
 1977  blk%!16 = blk%!16 + wex
 1978  blk%!20 = blk%!20 + wey
 1979  blk%!24 = 0:blk%!28 = 0
 1980  blk%!32 = &7FFFFFFF
 1981  blk%!36 = &7FFFFFFF
 1982  REM check dragasprite bit in CMOS RAM..
 1983  SYS "OS_Byte",161,28 TO ,,f%
 1984  DragASprite% = ((f% AND 2) = 2)
 1985  IF DragASprite% THEN
 1986    f% = flags%
 1987    IF (f% AND &100) THEN
 1988      spr$ = FNshell_IconGetCommand(valid%,"s")
 1989    ENDIF
 1990    IF (f% AND 2) = 0 THEN PROCshell_OK(FNshell_MessageNoArgs("SHELLMSG19"))
 1991    IF spr$ <> "" THEN
 1992      SYS "DragASprite_Start",%10000101,spr_area%,spr$,blk% + 8
 1993      _U%!100 = _U%!100 OR 1:REM set 'dragasprite' flag..
 1994    ELSE
 1995      SYS "Wimp_DragBox",,blk%
 1996    ENDIF
 1997  ELSE
 1998    SYS "Wimp_DragBox",,blk%
 1999  ENDIF
 2000  PROCshell_HeapBlockReturn(blk%)
 2001ELSE
 2002*|ifdef TraceInit
 2003  PROCshell_Tracef0("IconDragBox:WARNING! no user drag handler registered for this icon!")
 2004  PROCshell_Tracef0("IconDragBox:now checking for a slider drag event..")
 2005*|endif
 2006  e_offset% = FNshell_GetEventListOffset2(wh%,ih%,_U% + 332,32,FALSE)
 2007  PROCshell_Tracef0("IconDragBox:event offset is " + STR$e_offset%)
 2008  IF e_offset% >= 0 THEN PROCshell_HandleSlider(wh%,ih%,e_offset%)
 2009ENDIF
 2010ENDPROC
 2011:
 2012*|Stop PROCshell_IconDragBox
 2013
 2014*|Start PROCshell_HandleAttachedMenu
 2015DEF PROCshell_HandleAttachedMenu(_Q%,wh%,ih%)
 2016LOCAL menu%
 2017LOCAL ERROR
 2018ON ERROR LOCAL:RESTORE ERROR:ENDPROC
 2019REM Only executed when SELECT is pressed over an icon that has an
 2020REM attached menu..
 2021IF ih% <> -1 AND wh% > -1 THEN
 2022  menu% = FNshell_GetEventMenu(_Q%!8,wh%,ih%)
 2023  IF menu% <> 0 THEN
 2024    PROCshell_HandleMenuOpen(_Q%,menu%,wh%,ih%,TRUE)
 2025  ENDIF
 2026ENDIF
 2027ENDPROC
 2028:
 2029*|Stop PROCshell_HandleAttachedMenu
 2030
 2031*|Start PROCshell_Action
 2032DEF PROCshell_Action(evnt%)
 2033LOCAL fn$,menu%,menu$,select$,menu_buffer%,mx%,my%,claimed%
 2034LOCAL wh%,ih%,void%,_temp28%,_temp32%,_temp24%,_temp%,fontmenuflag%
 2035LOCAL CheckSelect%,offset%
 2036CASE evnt% OF
 2037  WHEN 0:PROCshell_DoBackgroundTask
 2038         IF (_U%!100 AND 1 << 11) THEN
 2039           PROCshell_Slider
 2040         ENDIF
 2041  WHEN 1:PROCshell_RedrawWindow(_Q%!0)
 2042  WHEN 2:PROCshell_OpenWindow(_Q%!0,TRUE,0)
 2043  WHEN 3:PROCshell_CloseWindow(_Q%!0)
 2044*|ifdef PROCshell_PointerLeavingWindow
 2045  WHEN 4:PROCshell_PointerLeavingWindow(_Q%)
 2046*|endif
 2047*|ifdef PROCshell_PointerEnteringWindow
 2048  WHEN 5:PROCshell_PointerEnteringWindow(_Q%)
 2049*|endif
 2050  WHEN 6:_U%!28=_Q%!12:_U%!32=_Q%!16:mx%=_Q%!0:my%=_Q%!4
 2051         _U%!272=_Q%!0:_U%!276=_Q%!4:_U%!320=_Q%!8
 2052         _temp28%=_Q%!12:_temp32%=_Q%!16:ih%=_Q%!16
 2053*|ifdef TraceInit
 2054         PROCshell_Tracef0("Action:Mouse_Click event detected")
 2055         PROCshell_Tracef0("Action:Window Handle was &"+STR$~_Q%!12+" Icon Handle was "+STR$_Q%!16)
 2056*|endif
 2057         IF _Q%!12=_U%!288 AND _Q%!16=_U%!292 THEN
 2058           REM same icon pressed again, use stored event offset..
 2059           PROCshell_HandleBumpIcons(_U%!296,_Q%!12,_Q%!16,_Q%!8)
 2060         ELSE
 2061           _U%!288=-1:_U%!292=-1:_U%!296=-1
 2062           IF _Q%!16>=0 THEN
 2063             offset%=FNshell_GetEventListOffset2(_Q%!12,_Q%!16,_U%+104,16,0)
 2064             PROCshell_Tracef0("DEBUG::bump event offset is "+STR$offset%)
 2065             IF offset%>=0 THEN PROCshell_HandleBumpIcons(offset%,_Q%!12,_Q%!16,_Q%!8)
 2066           ENDIF
 2067         ENDIF
 2068         REM check first for drag flag!
 2069         IF (_Q%!8=64) THEN
 2070           REM only check for SELECT and ADJUST buttons
 2071           result%=FNshell_IconIsDraggable(_Q%!12,_Q%!16)
 2072           IF result% THEN
 2073             mess$="Icon is draggable"
 2074             REM so now draw the drag box
 2075             PROCshell_IconDragBox(_Q%!12,_Q%!16)
 2076           ELSE
 2077             mess$="Icon is not draggable"
 2078           ENDIF
 2079           PROCshell_Tracef0("Action:"+mess$)
 2080         ENDIF
 2081         CASE _Q%!8 OF
 2082           WHEN 4:PROCshell_ActionSelectButton
 2083           WHEN 2:PROCshell_ActionMenuButton
 2084           WHEN 1:PROCshell_ActionAdjustButton
 2085         ENDCASE
 2086  WHEN 7:IF _U%!100 AND 1 THEN
 2087           SYS "DragASprite_Stop"
 2088           _U%!100 = _U%!100 EOR 1
 2089         ENDIF
 2090         _U%!128 = 0:REM set RAMPtr% to 0 in case a RAMFetch follows..
 2091         REM have to use last window/icon handles from _U% block as
 2092         REM _Q% block could be corrupted by other poll calls
 2093         IF (_U%!100 AND 1 << 11) = 0 THEN
 2094           REM it was not a slider drag that just ended..
 2095           fn$ = FNshell_GetEventHandler(_U%!28,_U%!32,6)
 2096           IF fn$ <> "" THEN
 2097             PROCshell_Tracef0("Action:Drag event detected - function is "+fn$)
 2098             void%=EVAL("FN"+fn$+"(_temp28%,_temp32%)")
 2099           ELSE
 2100             PROCshell_Tracef0("Action:Drag event detected - no handler function")
 2101             REM set up datasave message
 2102             PROCshell_SendDataSave(_U%!28,_U%!32)
 2103           ENDIF
 2104         ELSE
 2105           REM unset 'slider drag in progress' flag
 2106           _U%!100 = _U%!100 EOR 1 << 11
 2107         ENDIF
 2108  WHEN 8:
 2109         PROCshell_Tracef0("Action:keypress is="+STR$_Q%!24)
 2110         CASE _Q%!24 OF
 2111         WHEN &0D,394,398,399,410,430,431
 2112           claimed%=FNshell_WritableIconHandler(_Q%!0,_Q%!4,_Q%!24)
 2113         OTHERWISE
 2114           claimed%=FNshell_HotKeyProcess(_Q%!24)
 2115         ENDCASE
 2116         IF NOT claimed% THEN
 2117           PROCshell_Tracef0("Action:Keypress not claimed, passing it on")
 2118           SYS "Wimp_ProcessKey",_Q%!24
 2119         ELSE
 2120           PROCshell_Tracef0("Action:Keypress claimed by this application")
 2121         ENDIF
 2122  WHEN 9:PROCshell_ActionMenuSelect(_Q%)
 2123  WHEN 17,18:PROCshell_Receive(_Q%)
 2124  WHEN 19   :PROCshell_UserMessageAcknowledge(_Q%)
 2125ENDCASE
 2126ENDPROC
 2127:
 2128*|Stop PROCshell_Action
 2129
 2130*|Start PROCshell_ActionSelectButton
 2131DEF PROCshell_ActionSelectButton
 2132LOCAL offset%
 2133*|ifdef TraceInit
 2134PROCshell_Tracef0("ActionSelectButton:Mouse Button was SELECT")
 2135*|endif
 2136IF _U%!32 >= 0 THEN
 2137  REM last mouse click was over an icon, check if icon has popup menu attached..
 2138  offset% = FNshell_GetEventListOffset2(_Q%!12,_Q%!16,_U% + 340,24,FALSE)
 2139ENDIF
 2140IF offset% > 0 THEN
 2141  REM Popup event found..
 2142  REM is it a colour menu?
 2143  IF !(_U%!340 + offset% + 16) = 1 THEN
 2144    PROCshell_MenuTickOnly1(!(_U%!340 + offset% + 20),FNshell_IconGetBGColour(_Q%!12,!(_U%!340 + offset% + 8)))
 2145  ENDIF
 2146  PROCshell_HandleMenuOpen(_Q%,!(_U%!340 + offset% + 20),_Q%!12,_Q%!16,TRUE)
 2147ELSE
 2148  PROCshell_HandleAttachedMenu(_Q%,_U%!28,_U%!32)
 2149  IF _U%!32 = 0 THEN PROCshell_HandleAttachedDataSave(_Q%,_U%!28,_U%!32)
 2150  fn$ = FNshell_GetEventHandler(_U%!28,_U%!32,2)
 2151  IF fn$ <> "" THEN
 2152    PROCshell_IconSlab(4,_U%!28,_U%!32)
 2153*|ifdef TraceInit
 2154    PROCshell_Tracef0("ActionSelectButton:About to call "+"FN"+fn$+"("+STR$_temp28%+","+STR$_temp32%+")")
 2155*|endif
 2156    void% = EVAL("FN" + fn$ + "(_temp28%,_temp32%)")
 2157  ENDIF
 2158  REM if icon was 0 and dbox is dynamic then close dbox/menu
 2159  IF _U%!32=0 THEN
 2160    IF _U%!28=_U%!20 THEN
 2161      SYS "Wimp_CreateMenu",,-1
 2162    ENDIF
 2163  ENDIF
 2164ENDIF
 2165ENDPROC
 2166*|Stop PROCshell_ActionSelectButton
 2167
 2168*|Start PROCshell_ActionMenuButton
 2169DEF PROCshell_ActionMenuButton
 2170LOCAL temp%,menu%,popup%,offset%
 2171popup% = FALSE
 2172*|ifdef PROCshell_TraceInit
 2173PROCshell_Tracef0("ActionMenuButton:Mouse Button was MENU")
 2174*|endif
 2175IF _Q%!16 >= 0 THEN
 2176  offset% = FNshell_GetEventListOffset2(_Q%!12,_Q%!16,_U% + 340,24,FALSE)
 2177ENDIF
 2178IF offset% > 0 THEN
 2179  REM Popup event found..
 2180  PROCshell_HandleMenuOpen(_Q%,!(_U%!340 + offset% + 20),_Q%!12,_Q%!16,TRUE)
 2181ELSE
 2182  temp%=TRUE
 2183  IF INKEY(-1) THEN temp%=FNshiftmenuclick(_Q%!12,_Q%!16)
 2184  IF temp% THEN
 2185*|ifdef PROCshell_TraceInit
 2186    PROCshell_Tracef0("ActionMenuButton:Checking menu events..")
 2187    PROCshell_Tracef0("ActionMenuButton:button="+STR$_Q%!8+" _Q%!12="+STR$_Q%!12+" _Q%!16="+STR$_Q%!16)
 2188*|endif
 2189    IF _Q%!16 >= 0 THEN menu%=FNshell_GetEventMenu(_Q%!8,_Q%!12,_Q%!16)
 2190    IF (menu% <> 0 AND _Q%!12 > 0 AND _Q%!16 >= 0) THEN popup% = TRUE
 2191    IF menu% = 0 THEN
 2192      REM No menu attached to the icon that was clicked over, therefore
 2193      REM look for a menu attached to the window work area..
 2194      menu%  = FNshell_GetEventMenu(_Q%!8,_Q%!12,-1)
 2195    ENDIF
 2196*|ifdef PROCshell_TraceInit
 2197    PROCshell_Tracef0("ActionMenuButton:Menu handle is:&"+STR$~menu%)
 2198*|endif
 2199    IF menu%<>0 THEN PROCshell_HandleMenuOpen(_Q%,menu%,_Q%!12,_Q%!16,popup%)
 2200  ENDIF
 2201ENDIF
 2202ENDPROC
 2203:
 2204*|Stop PROCshell_ActionMenuButton
 2205
 2206*|Start PROCshell_HandleMenuOpen
 2207DEF PROCshell_HandleMenuOpen(_Q%,menu%,wh%,ih%,popup%)
 2208LOCAL i_blk%,w_blk%
 2209REM This routine handles the case of 'popup' menus, adjusting the menu
 2210REM and pointer positions before opening to conform to the Style Guide
 2211REM recommendations..
 2212IF popup% = FALSE THEN
 2213  REM Menu is a normal menu attached to a window, or to an icon on the
 2214  REM iconbar, so MenuUtils will open it in the correct place..
 2215  PROCshell_OpenMenu(_Q%!0,_Q%!4,menu%)
 2216ELSE
 2217  REM Menu is a 'popup', i.e attached to a specific icon in a window that
 2218  REM is not the iconbar. Therefore open the menu to right right of the
 2219  REM icon as required by the Style Guide..
 2220  i_blk% = FNshell_HeapBlockFetch(50)
 2221  w_blk% = FNshell_HeapBlockFetch(36)
 2222  REM read coordinates of icon that has menu attached and open menu
 2223  REM to the right of it..
 2224  i_blk%!0 = wh%:i_blk%!4 = ih%
 2225  SYS "Wimp_GetIconState",,i_blk%
 2226  w_blk%!0 = wh%
 2227  SYS "Wimp_GetWindowState",,w_blk%
 2228  PROCshell_OpenMenu(w_blk%!4 + i_blk%!16  + 64,_Q%!4,menu%)
 2229  REM And move the pointer appropriately..
 2230  MOUSE TO w_blk%!4+i_blk%!16 + 64,_Q%!4
 2231  PROCshell_HeapBlockReturn(i_blk%)
 2232  PROCshell_HeapBlockReturn(w_blk%)
 2233ENDIF
 2234ENDPROC
 2235:
 2236*|Stop PROCshell_HandleMenuOpen
 2237
 2238*|Start PROCshell_ActionMenuSelect
 2239DEF PROCshell_ActionMenuSelect(_Q%)
 2240LOCAL handler%,menu_buffer%,CheckSelect%,fontmenuflag%,void%,h_blk%,offset%
 2241offset% = FNshell_GetEventListOffset2(_U%!28,_U%!32,_U% + 340,24,FALSE)
 2242IF offset% >= 0 THEN PROCshell_DoPopupSelect(_Q%,offset%)
 2243h_blk%=FNshell_HeapBlockFetch(256)
 2244*|ifdef PROCshell_TraceInit
 2245PROCshell_Tracef0("ActionMenuSelect:Menu_Select event detected")
 2246*|endif
 2247SYS "Wimp_GetPointerInfo",,_shell_blk%
 2248*|ifdef Using_FontMenu
 2249menu_buffer%=FNshell_HeapBlockFetch(256)
 2250IF _U%!24=_U%!252 THEN
 2251  REM Current menu is FontMenu..
 2252  CheckSelect%=0:_U%!264=1
 2253ELSE
 2254  CheckSelect%=FNshell_CheckSelection(_Q%)
 2255  IF CheckSelect%>-1 THEN _U%!264=1 ELSE _U%!264=0
 2256ENDIF
 2257IF _U%!264>0 THEN
 2258  SYS "FontMenu_DecodeFontMenu",_Q%+CheckSelect%,menu_buffer% TO fontmenuflag%
 2259  IF fontmenuflag%=1 THEN
 2260    REM 'sensible' selection made..
 2261*|ifdef PROCshell_TraceInit
 2262    PROCshell_Tracef0("ActionMenuSelect:FontMenu selection ("+FNshell_GetString(menu_buffer%)+")")
 2263*|endif
 2264    PROCshell_FontMenuSelectFont(FNshell_GetString(menu_buffer%),_U%!260)
 2265    IF _shell_FontMenuSelFN$="" THEN
 2266      SYS "Wimp_DecodeMenu",,_U%!24,_Q%,menu_buffer%
 2267      fn$=FNshell_GetEventHandler(_U%!52,_U%!56,0)
 2268      _temp%=menu_buffer%
 2269      $_temp%=FNshell_StringStripTrailing($_temp%," ")
 2270      IF fn$<>"" THEN void%=EVAL("FN"+fn$+"($_temp%)")
 2271    ELSE
 2272      IF _shell_FontMenuSelFN$<>"" THEN
 2273        void%=EVAL("FN"+_shell_FontMenuSelFN$+"(FNshell_FontMenuGetLastSelectedFont)")
 2274      ENDIF
 2275    ENDIF
 2276  ENDIF
 2277ENDIF
 2278PROCshell_HeapBlockReturn(menu_buffer%)
 2279*|endif
 2280IF _U%!264=0 THEN
 2281  SYS "MenuUtil_Decode",_U%!24,_Q% TO handler%,,h_blk%
 2282  IF handler% THEN PROCshell_MenuCallHandler(handler%,h_blk%)
 2283ENDIF
 2284IF _shell_blk%!8=1 THEN
 2285  IF FNshell_HeapBlockExists(_U%!224) THEN
 2286    _temp%=_U%!224
 2287    IF $_temp%<>"" THEN
 2288      REM Call last menuwarning fn
 2289      void%=EVAL("FN"+$_temp%+"(_U%!52,_U%!56)")
 2290    ENDIF
 2291  ENDIF
 2292  PROCshell_OpenMenu(_U%!36,_U%!40,_U%!24)
 2293ELSE
 2294  _shell_FontMenuSelFN$=""
 2295ENDIF
 2296PROCshell_HeapBlockReturn(h_blk%)
 2297ENDPROC
 2298:
 2299*|Stop PROCshell_ActionMenuSelect
 2300
 2301*|Start PROCshell_ActionAdjustButton
 2302DEF PROCshell_ActionAdjustButton
 2303LOCAL flags%,fn$,void%,sel_blk%,ctr%
 2304sel_blk% = FNshell_HeapBlockFetch(12 + (FNshell_WindowCountIcons(_U%!28) * 32))
 2305*|ifdef TraceInit
 2306PROCshell_Tracef0("Action:Mouse Button was ADJUST")
 2307*|endif
 2308REM PROCshell_HandleAttachedMenu(_Q%,_U%!28,_U%!32)
 2309
 2310REM Check if icon is a radio one and window is not the iconbar, if so select
 2311REM icon to avoid Wimp deselecting it...
 2312IF _U%!28 > 0 THEN
 2313  SYS "Wimp_WhichIcon",_U%!28,sel_blk%,&0000F000,&0000B000
 2314  ctr% = 0
 2315  WHILE sel_blk%!ctr% <> -1
 2316    IF sel_blk%!ctr% = _U%!32 THEN PROCshell_IconSet(_U%!28,_U%!32,1)
 2317    ctr% += 4
 2318  ENDWHILE
 2319ENDIF
 2320
 2321IF _U%!32 = 0 THEN PROCshell_HandleAttachedDataSave(_Q%,_U%!28,_U%!32)
 2322fn$=FNshell_GetEventHandler(_U%!28,_U%!32,3)
 2323IF fn$<>"" THEN
 2324  PROCshell_IconSlab(1,_U%!28,_U%!32)
 2325  void%=EVAL("FN"+fn$+"(_temp28%,_temp32%)")
 2326ENDIF
 2327PROCshell_HeapBlockReturn(sel_blk%)
 2328ENDPROC
 2329:
 2330*|Stop PROCshell_ActionAdjustButton
 2331
 2332*|Start FNshiftmenuclick
 2333DEF FNshiftmenuclick(wh%,ih%)
 2334=TRUE
 2335:
 2336*|Stop FNshiftmenuclick
 2337*|Start PROCshell_IconSlab
 2338DEF PROCshell_IconSlab(button%,wh%,ih%)
 2339LOCAL blk%
 2340blk%=FNshell_HeapBlockFetch(50)
 2341blk%!8=button%:blk%!12=wh%:blk%!16=ih%
 2342SYS "Interface_SlabButton",,blk%
 2343blk%!8=0
 2344SYS "Interface_SlabButton",,blk%
 2345PROCshell_HeapBlockReturn(blk%)
 2346ENDPROC
 2347:
 2348*|Stop PROCshell_IconSlab
 2349
 2350*|Start PROCshell_PointerLeavingWindow
 2351DEF PROCshell_PointerLeavingWindow(_Q%)
 2352LOCAL i_blk%,void%
 2353i_blk% = FNshell_HeapBlockFetch(12)
 2354SYS "Wimp_WhichIcon",!_Q%,i_blk%,&003F0000,15 << 16
 2355IF !i_blk% <> -1 THEN
 2356  REM PROCshell_Tracef0("LL:"+STR$(!i_blk%))
 2357  void% = EVAL("FN" + FNshell_IconGetData(!_Q%,!i_blk%))
 2358ENDIF
 2359PROCshell_HeapBlockReturn(i_blk%)
 2360ENDPROC
 2361:                                  
 2362*|Stop PROCshell_PointerLeavingWindow
 2363
 2364*|Start PROCshell_PointerEnteringWindow
 2365DEF PROCshell_PointerEnteringWindow(_Q%)
 2366LOCAL i_blk%,void%,wh%
 2367wh% = _Q%!0
 2368i_blk% = FNshell_HeapBlockFetch(12)
 2369SYS "Wimp_WhichIcon",wh%,i_blk%,&003F0000,14 << 16
 2370IF !i_blk% <> -1 THEN
 2371  REM PROCshell_Tracef0("LL:"+STR$(!i_blk%))
 2372  REM PROCshell_Tracef0("LL:"+"FN" + FNshell_IconGetData(wh%,!i_blk%))
 2373  void% = EVAL("FN" + FNshell_IconGetData(wh%,!i_blk%))
 2374ENDIF
 2375PROCshell_HeapBlockReturn(i_blk%)
 2376ENDPROC
 2377:
 2378*|Stop PROCshell_PointerEnteringWindow
 2379
 2380*|Start PROCshell_RedrawWindow
 2381DEF PROCshell_RedrawWindow(handle%)
 2382LOCAL more%,fn$,x0%,y0%,blk%,i_blk%
 2383i_blk% = FNshell_HeapBlockFetch(12)
 2384SYS "Wimp_WhichIcon",handle%,i_blk%,&003F0000,13 << 16
 2385IF !i_blk% <> -1 THEN
 2386  REM PROCshell_Tracef0("LL:"+STR$(!i_blk%))
 2387  REM PROCshell_Tracef0("LL:"+"FN" + FNshell_IconGetData(handle%,!i_blk%))
 2388  fn$ = FNshell_IconGetData(handle%,!i_blk%)
 2389ENDIF
 2390PROCshell_HeapBlockReturn(i_blk%)
 2391blk%=FNshell_HeapBlockFetch(100)
 2392IF fn$ = "" THEN
 2393  REM Can't find the clever version of an attached event, check the
 2394  REM dumb one...
 2395  fn$=FNshell_GetEventHandler(handle%,-1,4)
 2396ENDIF
 2397blk%!0=handle%
 2398SYS "Wimp_RedrawWindow",,blk% TO more%
 2399x0%=blk%!4-blk%!20:y0%=blk%!16-blk%!24
 2400WHILE more%
 2401  SYS "Interface_Render3dWindow",,blk%
 2402  IF fn$<>"" THEN void%=EVAL("FN"+fn$+"("+STR$blk%+","+STR$x0%+","+STR$y0%+")")
 2403  SYS "Wimp_GetRectangle",,blk% TO more%
 2404ENDWHILE
 2405PROCshell_HeapBlockReturn(blk%)
 2406ENDPROC
 2407:
 2408*|Stop PROCshell_RedrawWindow
 2409
 2410*|Start PROCshell_Receive
 2411DEF PROCshell_Receive(_Q%)
 2412LOCAL temp%,void%
 2413CASE _Q%!16 OF
 2414WHEN 0     :PROCshell_Exit:END
 2415WHEN 1     :PROCshell_DataSave(_Q%)
 2416WHEN 2     :PROCshell_DataSaveAck(_Q%)
 2417WHEN 3     :PROCshell_DataLoad(_Q%,FALSE)
 2418WHEN 4     :PROCshell_DataLoadAck(_Q%)
 2419WHEN 5     :PROCshell_DataLoad(_Q%,TRUE)
 2420WHEN 6     :PROCshell_RAMFetch(_Q%)
 2421WHEN 7     :PROCshell_RAMTransmit(_Q%)
 2422WHEN 8     :PROCshell_Message_PreQuit(_Q%)
 2423WHEN 9     :IF _U%!164>0 THEN
 2424*|ifdef TraceInit
 2425              PROCshell_Tracef0("Receive:PaletteChange message received")
 2426*|endif
 2427              temp%=_U%!164
 2428              void%=EVAL("FN"+$temp%)
 2429            ENDIF
 2430WHEN 10    :PROCshell_Message_SaveDesktop(_Q%)
 2431WHEN 14    :PROCshell_Message_Shutdown(_Q%)
 2432WHEN &502  :PROCshell_InteractiveHelp(_Q%)
 2433WHEN &400C0:PROCshell_MenuWarning(_Q%)
 2434WHEN &400C1:PROCshell_Message_ModeChange(_Q%)
 2435WHEN &400C2:REM TaskInitialise
 2436            IF _U%!168>0 THEN
 2437*|ifdef TraceInit
 2438              PROCshell_Tracef0("Receive:TaskInitialise message received")
 2439*|endif
 2440              temp%=_U%!168
 2441              void%=EVAL("FN"+$temp%+"("+STR$(_Q%!4)+","+CHR$34+FNshell_GetString(_Q%+28)+CHR$34+")")
 2442            ENDIF
 2443            IF _U%!208=-1 AND FNshell_GetString(_Q%+28)="StrongHelp" THEN
 2444              _U%!208=_Q%!4
 2445              PROCshell_StrongHlpMsg("Help_Install -DieWithTask "+FNshell_GetAppDir+"."+FNshell_GetAppName)
 2446              temp%=_U%!216
 2447              IF $temp%<>"" THEN
 2448                PROCshell_HelpWord($temp%)
 2449                PROCshell_HeapBlockReturn(_U%!216)
 2450                _U%!216=0
 2451              ENDIF
 2452            ENDIF
 2453WHEN &400C3
 2454  REM TaskCloseDown
 2455  IF _U%!172>0 THEN
 2456*|ifdef TraceInit
 2457    PROCshell_Tracef0("Receive:TaskCloseDown message received")
 2458*|endif
 2459    temp% = _U%!172
 2460    void% = EVAL("FN"+$temp%)
 2461  ENDIF
 2462  IF _Q%!4 = _U%!208 THEN _U%!208 = -1
 2463WHEN &400C7
 2464  REM TaskNameIs
 2465*|ifdef TraceInit
 2466  PROCshell_Tracef0("Receive:TaskNameIs message received")
 2467*|endif
 2468  IF FNshell_GetString(_Q%+28) = "StrongHelp" THEN
 2469    _U%!208=_Q%!20:REM store task handle of StrongHlp...
 2470  ELSE
 2471    PROCshell_ScanForHelp
 2472  ENDIF
 2473
 2474WHEN &80140
 2475  REM Message_PrintFile
 2476  PROCshell_HandlePrintFile(_Q%)
 2477WHEN &80143
 2478  REM Message_PrintError
 2479  PROCshell_HandlePrintError(_Q%)
 2480WHEN &80145
 2481  REM Message_PrintTypeOdd
 2482  PROCshell_HandlePrintTypeOdd(_Q%)
 2483WHEN &80147
 2484  REM Message_SetPrinter
 2485  PROCshell_HandleSetPrinter(_Q%)
 2486
 2487OTHERWISE  :PROCshell_HandleUnknownMessage2(_Q%)
 2488ENDCASE
 2489ENDPROC
 2490:
 2491*|Stop PROCshell_Receive
 2492
 2493*|Start PROCshell_Message_ModeChange
 2494DEF PROCshell_Message_ModeChange(_Q%)
 2495LOCAL offset%,ctr%,sw_list%,w_blk%
 2496sw_list%=_U%!184
 2497IF _U%!160>0 THEN
 2498  PROCshell_Tracef0("Message_ModeChange:ModeChange message received")
 2499  temp%=_U%!160
 2500  void%=EVAL("FN"+$temp%)
 2501ENDIF
 2502REM SYS "FontWindow_ModeChange",_U%!148
 2503
 2504REM Now check if any windows containing panes are open, and if so
 2505REM reopen them to avoid problems with panes appearing in the wrong
 2506REM position...
 2507w_blk%=FNshell_HeapBlockFetch(100)
 2508IF sw_list%<>0 THEN
 2509*|ifdef TraceInit
 2510  PROCshell_Tracef0("Message_ModeChange:Checking static window list for pane events")
 2511*|endif
 2512  WHILE sw_list%!ctr%<>-1
 2513    REM now check pane event list..
 2514    offset%=FNshell_GetEventListOffset(sw_list%!ctr%,-1,_U%+92,24,FALSE)
 2515    IF offset%>-1 THEN
 2516*|ifdef TraceInit
 2517      PROCshell_Tracef0("Message_ModeChange:Static window handle found")
 2518*|endif
 2519      IF FNshell_WindowIsOpen(sw_list%!ctr%) THEN
 2520*|ifdef TraceInit
 2521        PROCshell_Tracef0("Message_ModeChange:Window is open..")
 2522*|endif
 2523        REM Reopen window if already open..
 2524        !w_blk%=sw_list%!ctr%
 2525        SYS "Wimp_CloseWindow",,w_blk%
 2526        PROCshell_OpenWindow(sw_list%!ctr%,0,-1)
 2527      ENDIF
 2528    ENDIF
 2529    ctr%+=4
 2530  ENDWHILE
 2531ENDIF
 2532PROCshell_HeapBlockReturn(w_blk%)
 2533
 2534ENDPROC
 2535*|Stop PROCshell_Message_ModeChange
 2536
 2537*|Start PROCshell_Message_Shutdown
 2538DEF PROCshell_Message_Shutdown(_Q%)
 2539IF _U%!312>0 THEN
 2540  PROCshell_Tracef0("Message_Shutdown:Shutdown message received")
 2541  temp%=_U%!312
 2542  void%=EVAL("FN"+$temp%)
 2543ENDIF
 2544ENDPROC
 2545*|Stop PROCshell_Message_Shutdown
 2546
 2547*|Start PROCshell_HandleUnknownMessage2
 2548DEF PROCshell_HandleUnknownMessage2(_Q%)
 2549LOCAL message$
 2550REM I want to handle message &43B00 here as I use it for
 2551REM communications between EvntShell applications..
 2552CASE _Q%!16 OF
 2553  WHEN &43B00:REM incoming EvntShell message...
 2554    message$=$(_Q%+20)
 2555    IF LEFT$(message$,30)="EvntShellLib:ShellDBug started" THEN
 2556      IF _U%!100 AND 1<<4 THEN
 2557        REM trace init message pending..
 2558        _U%!100 = (_U%!100 EOR 1 << 4)
 2559        PROCshell_BroadcastMessage(&43B00,"ShellDBug:Init Debug messages from "+FNshell_GetAppName)
 2560      ENDIF
 2561    ENDIF
 2562    IF LEFT$(message$,25)="EvntShellLib:TraceInitAck" THEN
 2563      REM unset trace init message pending flag, ShellDBug has acknowledged..
 2564      _U%!100=(_U%!100 EOR 1<<4)
 2565    ENDIF
 2566    IF LEFT$(message$,20)="EvntShellLib:TraceOn" THEN
 2567      PROCshell_TraceOn
 2568    ENDIF
 2569    IF LEFT$(message$,21)="EvntShellLib:TraceOff" THEN
 2570      PROCshell_TraceOff
 2571    ENDIF
 2572    IF LEFT$(message$,28)="EvntShellLib:ListClickSelect" THEN
 2573      PROCshell_ListClickSelect
 2574    ENDIF
 2575    IF LEFT$(message$,28)="EvntShellLib:ListClickAdjust" THEN
 2576      PROCshell_ListClickAdjust
 2577    ENDIF
 2578    IF LEFT$(message$,25)="EvntShellLib:ListHelpTags" THEN
 2579      PROCshell_ListHelpTags
 2580    ENDIF
 2581ENDCASE
 2582REM Pass message block on in case the user wants it too..
 2583PROCshell_HandleUnknownMessage(_Q%)
 2584ENDPROC
 2585:
 2586*|Stop PROCshell_HandleUnknownMessage2
 2587
 2588*|Start PROCshell_HandleUnknownMessage
 2589DEF PROCshell_HandleUnknownMessage(_Q%)
 2590ENDPROC
 2591:
 2592*|Stop PROCshell_HandleUnknownMessage
 2593
 2594*|Start PROCshell_AttachPreQuitHandler
 2595DEF PROCshell_AttachPreQuitHandler(fn$)
 2596LOCAL temp%,void%
 2597IF _U%!300>0 THEN PROCshell_HeapBlockReturn(_U%!300)
 2598_U%!300=FNshell_HeapBlockFetch(LENfn$+1)
 2599temp%=_U%!300:$temp%=fn$
 2600ENDPROC
 2601:
 2602*|Stop PROCshell_AttachPreQuitHandler
 2603
 2604*|Start PROCshell_AttachShutdownHandler
 2605DEF PROCshell_AttachShutdownHandler(fn$)
 2606LOCAL temp%,void%
 2607IF _U%!312>0 THEN PROCshell_HeapBlockReturn(_U%!312)
 2608_U%!312=FNshell_HeapBlockFetch(LENfn$+1)
 2609temp%=_U%!312:$temp%=fn$
 2610ENDPROC
 2611:
 2612*|Stop PROCshell_AttachShutdownHandler
 2613
 2614*|Start PROCshell_AttachModeChangeHandler
 2615DEF PROCshell_AttachModeChangeHandler(fn$)
 2616LOCAL temp%,void%
 2617IF _U%!160>0 THEN PROCshell_HeapBlockReturn(_U%!160)
 2618_U%!160=FNshell_HeapBlockFetch(LENfn$+1)
 2619temp%=_U%!160:$temp%=fn$
 2620void%=EVAL("FN"+fn$)
 2621ENDPROC
 2622:
 2623*|Stop PROCshell_AttachModeChangeHandler
 2624
 2625*|Start PROCshell_AttachPaletteChangeHandler
 2626DEF PROCshell_AttachPaletteChangeHandler(fn$)
 2627LOCAL temp%,void%
 2628IF _U%!164>0 THEN PROCshell_HeapBlockReturn(_U%!164)
 2629_U%!164=FNshell_HeapBlockFetch(LENfn$+1)
 2630temp%=_U%!164:$temp%=fn$
 2631void%=EVAL("FN"+fn$)
 2632ENDPROC
 2633:
 2634*|Stop PROCshell_AttachPaletteChangeHandler
 2635
 2636*|Start PROCshell_AttachTaskInitialiseHandler
 2637DEF PROCshell_AttachTaskInitialiseHandler(fn$)
 2638LOCAL temp%,void%
 2639IF _U%!168>0 THEN PROCshell_HeapBlockReturn(_U%!168)
 2640_U%!168=FNshell_HeapBlockFetch(LENfn$+1)
 2641temp%=_U%!168:$temp%=fn$
 2642ENDPROC
 2643:
 2644*|Stop PROCshell_AttachTaskInitialiseHandler
 2645
 2646*|Start PROCshell_AttachTaskCloseDownHandler
 2647DEF PROCshell_AttachTaskCloseDownHandler(fn$)
 2648LOCAL temp%,void%
 2649IF _U%!172>0 THEN PROCshell_HeapBlockReturn(_U%!172)
 2650_U%!172=FNshell_HeapBlockFetch(LENfn$+1)
 2651temp%=_U%!172:$temp%=fn$
 2652ENDPROC
 2653:
 2654*|Stop PROCshell_AttachTaskCloseDownHandler
 2655
 2656*|Start PROCshell_RAMFetch
 2657DEF PROCshell_RAMFetch(_Q%)
 2658LOCAL RAMFetch_buffer%,len_data%,done%
 2659done%=FALSE
 2660REM If the address in the data save event block <&8000 then it is an
 2661REM estimated size and the file is not already present in a RAM buffer.
 2662REM In this case ignore RAMFetch message as the data will be written to a
 2663REM file anyway..
 2664IF _U%!144>&8000 THEN
 2665  REM Send file to application
 2666  REM send RAMTransmit message...
 2667*|ifdef TraceInit
 2668  PROCshell_Tracef0("RAMFetch:RAMFetch called..")
 2669*|endif
 2670  _Q%!12=_Q%!08
 2671  _Q%!16=7:REM message action RAMTransmit
 2672  REM get buffer length..
 2673  len_data%=_U%!136
 2674  IF _U%!140=&FF9 THEN
 2675    REM kludge for sprite files because when saving to a physical file
 2676    REM with "OS_SpriteOp" the first word is dropped. Hence for the RAM
 2677    REM save we have to incrememt the address the data is held at by 4!
 2678    REM The estimated size has already been kludged in shell_AttachDataSave
 2679    _U%!144+=4
 2680  ENDIF
 2681  IF (len_data%-_U%!128)<_Q%!24 THEN
 2682    REM  This will be the last block
 2683    _Q%!24=len_data%-_U%!128
 2684    done%=TRUE
 2685  ELSE
 2686*|ifdef TraceInit
 2687  PROCshell_Tracef0("RAMFetch:Sending block")
 2688*|endif
 2689  ENDIF
 2690  SYS "Wimp_TransferBlock",_U%!148,_U%!144+_U%!128,_Q%!04,_Q%!20,_Q%!24
 2691  SYS "Wimp_SendMessage",17,_Q%,_Q%!04
 2692  _U%!120=_Q%!8  :REM SaveRef%
 2693  _U%!128+=_Q%!24:REM RAMPtr%
 2694  IF done% THEN _U%!128=0
 2695ENDIF
 2696ENDPROC
 2697:
 2698*|Stop PROCshell_RAMFetch
 2699*|Start PROCshell_RAMTransmit
 2700DEF PROCshell_RAMTransmit(_Q%)
 2701LOCAL offset%,blk%,f_name$,temp%
 2702REM Receive file from application via RAM transfer..
 2703IF _Q%!12=_U%!112 THEN
 2704  _U%!128+=_Q%!24
 2705  IF _Q%!24<_U%!132 THEN
 2706    REM This was the last block
 2707*|ifdef TraceInit
 2708  PROCshell_Tracef0("RAMTransmit:Last block received")
 2709*|endif
 2710    offset%=FNshell_GetEventListOffset(_U%!28,_U%!32,_U%+96,16,FALSE)
 2711    blk%=_U%!96+offset%
 2712*|ifdef TraceInit
 2713  PROCshell_Tracef0("RAMTransmit:_U%!28="+STR$_U%!28)
 2714  PROCshell_Tracef0("RAMTransmit:_U%!32="+STR$_U%!32)
 2715  PROCshell_Tracef0("RAMTransmit:offset%="+STR$offset%)
 2716*|endif
 2717    REM now call user function after file load...
 2718    REM use copy of datasave message block to find file type, file name...
 2719    temp%=_U%!156
 2720    f_name$=FNshell_GetString(temp%+44)
 2721    PROCshell_UserFNLoadFile(temp%!40,_U%!152,blk%!8,f_name$,_U%!132,blk%)
 2722  ELSE
 2723    REM There are more blocks to come
 2724*|ifdef TraceInit
 2725  PROCshell_Tracef0("RAMTransmit:Block received")
 2726*|endif
 2727    REM check size of incoming block and increase buffer if
 2728    REM required...
 2729    IF _U%!128>_U%!132 THEN
 2730*|ifdef TraceInit
 2731  PROCshell_Tracef0("RAMTransmit:Increasing buffer size..")
 2732*|endif
 2733      _U%!152=FNshell_HeapBlockExtend(_U%!152,_U%!128,_U%!132)
 2734    ENDIF
 2735    _Q%!12=_Q%!08
 2736    _Q%!16=6
 2737    _Q%!20=_U%!152+_U%!128
 2738    _Q%!24=_U%!132
 2739    SYS "Wimp_SendMessage",18,_Q%,_Q%!04
 2740    _U%!112=_Q%!08
 2741  ENDIF
 2742ELSE
 2743  REM too much data sent...
 2744  PROCshell_HeapBlockReturn(_U%!152)
 2745  _U%!152=0
 2746  PROCshell_OK(FNshell_MessageNoArgs("SHELLMSG15"))
 2747ENDIF
 2748ENDPROC
 2749:
 2750*|Stop PROCshell_RAMTransmit
 2751*|Start FNshell_LoadFile
 2752DEF FNshell_LoadFile(Scrap%)
 2753LOCAL Name$,FileSize%,Flags%,loadloc%
 2754Name$=FNshell_GetString(_Q%+44)
 2755FileSize%=FNshell_FileLength(Name$)
 2756IF FileSize%<0 THEN PROCshell_OK(FNshell_MessageNoArgs("SHELLMSG16"))
 2757loadloc%=FNshell_HeapBlockFetch(FileSize%)
 2758SYS "XOS_File",16,Name$,loadloc%,0 TO ;Flags%
 2759IF FNshell_VFlag(Flags%) THEN
 2760  PROCshell_HeapBlockReturn(loadloc%)
 2761  PROCshell_OK(FNshell_MessageNoArgs("SHELLMSG17"))
 2762ELSE
 2763*|ifdef TraceInit
 2764  PROCshell_Tracef0("LoadFile:File "+Name$+" loaded ok at &"+STR$~loadloc%)
 2765*|endif
 2766ENDIF
 2767REM Stuff for fileinfo box...........
 2768REM PROCDate(FNFileTimeAndDate(Name$))
 2769REM IF Scrap% THEN
 2770REM   SYS "XOS_FSControl",27,(_Q%+44),,2
 2771REM   PROCModified(TRUE)
 2772REM ELSE
 2773REM   PROCName(Name$)
 2774REM   PROCType(_Q%!40)
 2775REM   PROCModified(FALSE)
 2776REM ENDIF
 2777REM PROCNewFile
 2778=loadloc%
 2779:
 2780*|Stop FNshell_LoadFile
 2781
 2782*|Start FNshell_VFlag
 2783DEF FNshell_VFlag(Flags%)
 2784=((Flags% AND %0001)=%0001)
 2785:
 2786*|Stop FNshell_VFlag
 2787
 2788*|Start FNshell_CheckType
 2789DEF FNshell_CheckType(type%,type_list%,DataOpen%)
 2790REM Exclude directories, applications & unstamped files
 2791REM type_list% is address of heapblock holding a list
 2792REM of allowable filetypes terminated by -1..
 2793LOCAL Ok%,ctr%,found%,temp%,topbit_load%
 2794ctr%=0:found%=-1:topbit_load%=FALSE
 2795IF _U%!100 AND 1<<1 THEN _U%!100=_U%!100 EOR 1<<1
 2796WHILE type_list%!ctr%<>-1
 2797  temp%=type_list%!ctr%
 2798  IF temp% AND 1<<31 THEN
 2799    temp%=temp% EOR 1<<31
 2800    topbit_load%=TRUE
 2801  ELSE
 2802    topbit_load%=FALSE
 2803  ENDIF
 2804  IF temp%=type% THEN
 2805    found%=ctr%
 2806    IF topbit_load% THEN
 2807      _U%!100=_U%!100 OR 1<<1
 2808*|ifdef TraceInit
 2809      PROCshell_Tracef0("CheckType:Top Bit Load detected..")
 2810*|endif
 2811    ENDIF
 2812  ENDIF
 2813  ctr%+=4
 2814ENDWHILE
 2815IF DataOpen% AND (type%>=&1000) THEN found%=-1
 2816*|ifdef TraceInit
 2817IF found%>-1 THEN
 2818  PROCshell_Tracef0("CheckType:File type OK "+STR$~type_list%!found%)
 2819ELSE
 2820  PROCshell_Tracef0("CheckType:File type NOT ok "+STR$~type%)
 2821ENDIF
 2822*|endif
 2823IF found%<>-1 THEN =TRUE ELSE =FALSE
 2824:
 2825*|Stop FNshell_CheckType
 2826
 2827*|Start PROCshell_Exit
 2828DEF PROCshell_Exit
 2829LOCAL ms_desc%
 2830ms_desc%=_U%!68
 2831SYS "XMessageTrans_CloseFile",ms_desc%
 2832SYS "XOS_Module",7,,ms_desc%
 2833*|ifdef TraceInit
 2834PROCshell_Tracef0("Exit:Application closing down")
 2835*|endif
 2836PROCshell_TraceExit
 2837SYS "XHourglass_Smash"
 2838SYS "XWimp_DragBox",,-1
 2839PROCshell_WimpCloseDown_I(_U%!148)
 2840ENDPROC
 2841:
 2842*|Stop PROCshell_Exit
 2843
 2844*|Start PROCshell_DataLoad
 2845DEF PROCshell_DataLoad(_Q%,DataOpen%)
 2846LOCAL reference%,offset%,blk%,_temp%,type_list%,type%,fname$
 2847IF FNshell_DataOpenOKToLoad(DataOpen%,_Q%!40) THEN
 2848  type%  = _Q%!40
 2849  fname$ = FNshell_GetString(_Q% + 44)
 2850*|ifdef TraceInit
 2851  PROCshell_Tracef0("DataLoad:DataLoad message received")
 2852*|endif
 2853  REM check my_file_type set up in shell_AttachDataLoad
 2854  REM only works when dragging a file as when DataOpen% is TRUE
 2855  REM the _Q% block is set up differently!!
 2856  IF DataOpen% THEN
 2857    REM double click load..
 2858    REM check if there are any dataload events set up...
 2859    IF _U%!96<>0 THEN
 2860      offset%=0:REM look at first dataload event only...
 2861    ELSE
 2862      offset%=-1:REM ignore it...
 2863    ENDIF
 2864  ELSE
 2865    REM drag load, check for specific window/icon event..
 2866    offset%=FNshell_GetEventListOffset(_Q%!20,_Q%!24,_U%+96,16,FALSE)
 2867    IF offset%=-1 THEN
 2868      REM now check for window handle only..
 2869      offset%=FNshell_GetEventListOffset(_Q%!20,-1,_U%+96,16,FALSE)
 2870    ENDIF
 2871  ENDIF
 2872  IF offset%>-1 THEN
 2873    REM DataLoadEvent exists
 2874    blk%=_U%!96+offset%
 2875    IF FNshell_CheckType(_Q%!40,blk%!8,DataOpen%) THEN
 2876      REM file type is ok...
 2877*|ifdef TraceInit
 2878      PROCshell_Tracef0("DataLoad:File type recognised (&"+STR$~_Q%!40+")")
 2879*|endif
 2880      Reference%=_Q%!12
 2881      _Q%!12=_Q%!8
 2882      _Q%!16=4
 2883      SYS "Wimp_SendMessage",18,_Q%,_Q%!4
 2884      IF _U%!100 AND 1 << 1 THEN
 2885        loadloc% = -1
 2886        _U%!100  = _U%!100 EOR 1 << 1
 2887      ELSE
 2888        loadloc% = FNshell_LoadFile(Reference% = _U%!108)
 2889      ENDIF
 2890      PROCshell_UserFNLoadFile(type%,loadloc%,blk%!8,fname$,_Q%!36,blk%)
 2891      REM return copy of datasave message block...
 2892      IF _U%!156<>0 THEN
 2893        PROCshell_HeapBlockReturn(_U%!156)
 2894        _U%!156=0
 2895      ENDIF
 2896    ELSE
 2897*|ifdef TraceInit
 2898    PROCshell_Tracef0("DataLoad:File type NOT recognised (&"+STR$~_Q%!40+")")
 2899*|endif
 2900    ENDIF
 2901  ENDIF
 2902ENDIF
 2903ENDPROC
 2904:
 2905*|Stop PROCshell_DataLoad
 2906
 2907*|Start FNshell_DataOpenOKToLoad
 2908DEF FNshell_DataOpenOKToLoad(DataOpen%,type%)
 2909LOCAL result%,var_buff%,var$,branch$
 2910REM Check to see if this application should open the file. If the application
 2911REM named in the Run$Type variable does not match then return FALSE to abort
 2912REM the load, otherwise the file would be loaded by the wrong application on
 2913REM a double click in a Filer window..
 2914IF DataOpen% = FALSE THEN
 2915  REM Message reason code was 3, normal drag load..
 2916  result% = TRUE
 2917  PROCshell_Tracef0("DataOpenOKToLoad:Message reason code was 3, normal drag load..")
 2918ELSE
 2919  REM Message reason code was 5, double click load..
 2920  REM Read value of Alias$@RunType_xxx variable where xxx = filetype in hex..
 2921  PROCshell_Tracef0("DataOpenOKToLoad:Message reason code was 5, double click load..")
 2922  var_buff% = FNshell_HeapBlockFetch(256)
 2923  var$      = FNshell_OSVarGetVal(var_buff%,256,"Alias$@RunType_" + STR$~type%,1)
 2924  PROCshell_Tracef0("DataOpenOKToLoad:Alias$@RunType="+var$)
 2925  PROCshell_HeapBlockReturn(var_buff%)
 2926  REM Compare name of app that set up Alias$@RunType with running app - of
 2927  REM course all apps have unique names don't they..
 2928  branch$ = FNshell_Branch(var$)
 2929  PROCshell_Tracef0("DataOpenOKToLoad:dbug "+branch$)
 2930  IF FNshell_Leaf(branch$) = "!"+FNshell_GetAppName THEN result% = TRUE ELSE result% = FALSE
 2931ENDIF
 2932= result%
 2933:
 2934*|Stop FNshell_DataOpenOKToLoad
 2935
 2936*|Start PROCshell_UserFNLoadFile
 2937DEF PROCshell_UserFNLoadFile(type%,loadloc%,type_list%,_filename$,_file_size%,blk%)
 2938LOCAL ctr%,found%,temp%,void%
 2939REM call user function after loading file...
 2940ctr%=0:found%=-1
 2941WHILE type_list%!ctr%<>-1
 2942  temp%=type_list%!ctr%
 2943  IF temp% AND 1<<31 THEN temp%=temp% EOR 1<<31
 2944  IF temp%=type% THEN found%=ctr%
 2945  ctr%+=4
 2946ENDWHILE
 2947temp%=blk%!12
 2948void%=EVAL("FN"+$(temp%!found%)+"("+STR$loadloc%+","+STR$type%+",_filename$,"+STR$_file_size%+")")
 2949ENDPROC
 2950:
 2951*|Stop PROCshell_UserFNLoadFile
 2952
 2953*|Start PROCshell_DataSave
 2954DEF PROCshell_DataSave(_Q%)
 2955LOCAL temp%,offset%,blk%,loop%
 2956REM Called when another application wants to save data to our one..
 2957*|ifdef TraceInit
 2958PROCshell_Tracef0("DataSave:DataSave message received")
 2959*|endif
 2960REM Receive file from application, but check first it didn't come from 
 2961REM this one!
 2962IF _Q%!04<>_U%!148 THEN
 2963  REM check event list for window/icon at this point to see
 2964  REM which filetypes are valid...
 2965  offset%=FNshell_GetEventListOffset(_Q%!20,_Q%!24,_U%+96,16,FALSE)
 2966  IF offset%>-1 THEN
 2967    blk%=_U%!96+offset%
 2968    IF FNshell_CheckType(_Q%!40,blk%!8,FALSE) THEN
 2969*|ifdef TraceInit
 2970      PROCshell_Tracef0("DataSave:Filetype recognized (&"+STR$~_Q%!40+")")
 2971*|endif
 2972      IF FNshell_TopBitLoadInProgress THEN
 2973        REM 'no load' load taking place, just need the full filename so that
 2974        REM the user app can do the load - therefore send Message_DataSaveAck
 2975        REM with Wimp$Scrap as the filename..
 2976*|ifdef TraceInit
 2977        PROCshell_Tracef0("DataSave:'no load' flag set")
 2978        PROCshell_Tracef0("DataSave:Sending Message_DataSaveAck")
 2979*|endif
 2980        _Q%!00=256
 2981        _Q%!12=_Q%!08:_Q%!36=-1:_Q%!16=2:REM Message_DataSaveAck
 2982        $(_Q%+44)=FNshell_GetAppDir+".ScrapFile"+CHR$0
 2983       SYS "Wimp_SendMessage",18,_Q%,_Q%!04
 2984      ELSE
 2985        REM Normal load from another application therefore offer to perform
 2986        REM a RAM file transfer with Message_RAMFetch..
 2987        REM Make a copy of the message block as I need it when RAM transfer
 2988        REM is not supported by the sender of this message
 2989        PROCshell_HeapBlockReturn(_U%!156):REM return temp message blk..
 2990        _U%!156=FNshell_HeapBlockFetch((_Q%!0)+8)
 2991        temp%=_U%!156
 2992        FOR loop%=0 TO _Q%!0 STEP 4:REM first word is size...
 2993          temp%!loop%=_Q%!loop%
 2994        NEXT loop%
 2995        REM store destination window/icon handles for later...
 2996        _U%!28=_Q%!20:_U%!32=_Q%!24
 2997        _U%!128=0
 2998        _U%!132=_Q%!36:REM RAMSize%=est_size%
 2999        REM set up heapblock to hold loaded file...
 3000        _U%!152=FNshell_HeapBlockFetch(_Q%!36)
 3001        REM And here we go !
 3002        _Q%!00=28
 3003        _Q%!12=_Q%!08
 3004        _Q%!16=6:REM Message_RAMFetch..
 3005        _Q%!20=_U%!152+_U%!128
 3006        _Q%!24=_U%!132
 3007        SYS "Wimp_SendMessage",18,_Q%,_Q%!04
 3008        _U%!112=_Q%!08
 3009*|ifdef TraceInit
 3010        PROCshell_Tracef0("DataSave:Sending Message_RAMFetch")
 3011*|endif
 3012      ENDIF
 3013    ELSE
 3014*|ifdef TraceInit
 3015      PROCshell_Tracef0("DataSave:Filetype NOT recognized")
 3016*|endif
 3017    ENDIF
 3018  ENDIF
 3019ENDIF
 3020ENDPROC
 3021:
 3022*|Stop PROCshell_DataSave
 3023
 3024REM Set all this stuff beforehand as RAM transfer
 3025REM procedures may be entered more than once !
 3026REM PROCName(FNLeaf(FNGetString(PollPtr%+44)))
 3027REM PROCType(PollPtr%!40)
 3028REM PROCModified(TRUE)
 3029REM PROCDate(FNCurrentTimeAndDate)
 3030*|Start FNshell_TopBitLoadInProgress
 3031DEF FNshell_TopBitLoadInProgress
 3032IF _U%!100 AND 1<<1 THEN =TRUE ELSE =FALSE
 3033:
 3034*|Stop  FNshell_TopBitLoadInProgress
 3035
 3036*|Start PROCshell_SendDataSave
 3037DEF PROCshell_SendDataSave(wh%,ih%)
 3038LOCAL blk%,msgblk%,tmpblk%,offset%,FileSize%,void%
 3039tmpblk% = FNshell_HeapBlockFetch(30)
 3040REM retrieve current position of pointer (window and icon over which
 3041REM the drag event ended plus pointer position)
 3042SYS "Wimp_GetPointerInfo",,tmpblk%
 3043offset%=FNshell_GetEventListOffset(wh%,ih%,_U%+72,24,FALSE)
 3044IF offset%=-1 OR offset%=-2 THEN
 3045  void%=FNshell_MessageWindow(FNshell_MessageNoArgs("SHELLMSG13"),0,"",FNshell_MessageNoArgs("warning"))
 3046ELSE
 3047  blk%=(_U%!72)+offset%
 3048  IF blk%!8>&8000 THEN
 3049    FileSize%=FNshell_HeapBlockInfo(blk%!8)-4
 3050  ELSE
 3051    FileSize%=blk%!8
 3052  ENDIF
 3053  msgblk%=_U%!76
 3054  msgblk%!0 =256       :REM length of message block
 3055  msgblk%!12=0         :REM myref 0=originating
 3056  msgblk%!16=1         :REM message action
 3057  msgblk%!20=tmpblk%!12:REM destination window handle
 3058  msgblk%!24=tmpblk%!16:REM destination icon handle
 3059  msgblk%!28=tmpblk%!0 :REM mouse x coord
 3060  msgblk%!32=tmpblk%!4 :REM mouse y coord
 3061  msgblk%!36=FileSize% :REM estimated size of file
 3062  msgblk%!40=blk%!12   :REM file type
 3063  $(msgblk%+44)=FNshell_Leaf(FNshell_IconGetData(wh%,blk%!16))
 3064  SYS "Wimp_SendMessage",18,msgblk%,msgblk%!20,msgblk%!24
 3065  _U%!120=_Q%!8
 3066  _U%!136=FileSize% :REM FileSize%
 3067  _U%!140=blk%!12   :REM FileType%
 3068  _U%!144=blk%!8    :REM FileBuff%
 3069  _U%!156=blk%!4    :REM TaskHandle%
 3070  _U%!200=msgblk%!20:REM window handle
 3071  _U%!204=msgblk%!24:REM icon handle
 3072ENDIF
 3073PROCshell_HeapBlockReturn(tmpblk%)
 3074ENDPROC
 3075:
 3076*|Stop PROCshell_SendDataSave
 3077
 3078*|Start PROCshell_DataSaveAck
 3079DEF PROCshell_DataSaveAck(_Q%)
 3080LOCAL _fullname$,a%,b%,blk%,temp%,void%
 3081*|ifdef TraceInit
 3082PROCshell_Tracef0("DataSaveAck:DataSaveAck message received")
 3083*|endif
 3084a%=0:b%=_Q%?(44+a%)
 3085WHILE b%<>0
 3086  _fullname$+=CHR$(b%)
 3087  a%+=1
 3088  b%=_Q%?(44+a%)
 3089ENDWHILE
 3090*|ifdef TraceInit
 3091PROCshell_Tracef0("DataSaveAck:Full save name is: "+_fullname$)
 3092PROCshell_Tracef0("DataSaveAck:task   = &"+STR$_Q%!4)
 3093PROCshell_Tracef0("DataSaveAck:mytask = &"+STR$_U%!148)
 3094*|endif
 3095offset% = FNshell_GetEventListOffset(_U%!28,_U%!32,_U%+72,24,FALSE)
 3096REM IF offset% = -1 OR offset% = -2 THEN ERROR 99,FNshell_MessageNoArgs("SHELLMSG05")
 3097PROCshell_Tracef0("DataSaveAck:offset% = "+STR$offset%)
 3098IF offset% >= 0 THEN
 3099  blk%=(_U%!72)+offset%
 3100  temp%=blk%!20
 3101  REM now call the file saving routine......
 3102  IF $temp%<>"" THEN
 3103    void%=EVAL("FN"+$temp%+"(_fullname$)")
 3104  ELSE
 3105    REM no file saving routine specified for this event, so check if data is in a
 3106    REM heapblock..
 3107    IF FNshell_HeapBlockExists(blk%!8) THEN
 3108      REM default save routine, just save the whole heapblock to disk..
 3109      SYS "OS_File",10,_fullname$,blk%!12,,blk%!8,blk%!8+FNshell_HeapBlockInfo(blk%!8)+1
 3110    ELSE
 3111      REM Whoops! not a heapblock - someone's screwed up..
 3112      ERROR 99,FNshell_MessageNoArgs("SHELLMSG21")
 3113    ENDIF
 3114  ENDIF
 3115  IF _Q%!36>-1 THEN
 3116    REM file is secure
 3117    IF _U%!80<>0 THEN PROCshell_HeapBlockReturn(_U%!80)
 3118    _U%!80=FNshell_HeapBlockFetch(LEN_fullname$+1)
 3119    temp%=_U%!80
 3120    $temp%=_fullname$
 3121  ENDIF
 3122  _Q%!16=3:!_Q%=256:_Q%!20=_U%!200:_Q%!24=_U%!204:_Q%!40=_U%!140
 3123  _Q%!36=FNshell_FileLength(_fullname$):_Q%!12=_Q%!8
 3124*|ifdef TraceInit
 3125  PROCshell_Tracef0("DataSaveAck:File length is "+STR$_Q%!36+" bytes")
 3126*|endif
 3127  $(_Q%+44)=_fullname$+CHR$(0)
 3128  REM send dataload message
 3129  REM store my_ref
 3130  _U%!84=_Q%!8
 3131*|ifdef TraceInit
 3132  PROCshell_Tracef0("DataSaveAck:Sending DataLoad Message")
 3133*|endif
 3134  SYS "Wimp_SendMessage",18,_Q%,_Q%!20,_Q%!24
 3135  REM now close window that save originated from if it is not a
 3136  REM 'dynamic' dbox
 3137  IF _U%!28<>_U%!20 THEN
 3138    PROCshell_CloseWindow(_U%!28)
 3139  ENDIF
 3140  SYS "Wimp_CreateMenu",,-1:REM close any open menus
 3141ELSE
 3142  PROCshell_PrintSave(_fullname$,_Q%!20,_Q%!24,_Q%!8,_Q%!40)
 3143  PROCshell_Tracef0("DEBUG:: copies = "+STR$(_U%!336))
 3144  IF _U%!336 > 0 THEN
 3145    _U%!336 -= 1
 3146    PROCshell_DoSendPrintSave(&FFF)
 3147  ENDIF
 3148ENDIF
 3149ENDPROC
 3150:
 3151*|Stop PROCshell_DataSaveAck
 3152
 3153*|Start PROCshell_DataSaveCheckName
 3154DEF PROCshell_DataSaveCheckName(wh%,ih%)
 3155LOCAL offset%,blk%,list_size%
 3156REM Routine to check if a 'datasave' event exists in the window wh%.
 3157REM If it does then the filename is checked for a '.' character. An
 3158REM error is generated if no '.' is found. This routine is called by
 3159REM the library when a mouse click on icon 0 is detected.
 3160blk%=_U%!72:offset%=0
 3161IF blk%<>0 THEN
 3162  list_size%=FNshell_HeapBlockInfo(blk%)-8
 3163  REM blk%<>0 therefore a datasave event list exists..
 3164  REPEAT
 3165    REM check window handles of events in list..
 3166    IF !(blk%+offset%)=wh% THEN
 3167      REM check for a valid path name..
 3168      name$=FNshell_IconGetData(!blk%,blk%!16)
 3169      IF INSTR(name$,".")=0 THEN PROCshell_OK(FNshell_MessageNoArgs("SHELLMSG01"))
 3170      offset%=list_size%:REM window handle found so abort check..
 3171    ENDIF
 3172    offset%+=24:REM check next event..
 3173  UNTIL offset%>=list_size%
 3174ENDIF
 3175ENDPROC
 3176:
 3177*|Stop PROCshell_DataSaveCheckName
 3178
 3179*|Start PROCshell_DataLoadAck
 3180DEF PROCshell_DataLoadAck(_Q%)
 3181*|ifdef TraceInit
 3182PROCshell_Tracef0("DataLoadAck:DataLoadAck message received (file received ok)")
 3183*|endif
 3184ENDPROC
 3185:
 3186*|Stop PROCshell_DataLoadAck
 3187
 3188*|Start PROCshell_UserMessageAcknowledge
 3189DEF PROCshell_UserMessageAcknowledge(_Q%)
 3190CASE _Q%!16 OF
 3191  WHEN 3:PROCshell_AckDataLoad(_Q%)
 3192  WHEN 6:PROCshell_AckRAMFetch(_Q%)
 3193ENDCASE
 3194ENDPROC
 3195:
 3196*|Stop PROCshell_UserMessageAcknowledge
 3197
 3198*|Start PROCshell_AckDataLoad
 3199DEF PROCshell_AckDataLoad(_Q%)
 3200IF _Q%!12<>_U%!84 THEN
 3201  REM Reference hasn't been updated,
 3202  REM therefore the Wimp returned my call
 3203  REM The receiver didn't understand scrap transfer
 3204  SYS "XOS_File",6,"<Wimp$Scrap>"
 3205  ERROR 255,"Data Transfer failed: Receiver died"
 3206ENDIF
 3207ENDPROC
 3208:
 3209*|Stop PROCshell_AckDataLoad
 3210
 3211*|Start PROCshell_AckRAMFetch
 3212DEF PROCshell_AckRAMFetch(_Q%)
 3213LOCAL Exist%,temp%
 3214temp%=_U%!156
 3215*|ifdef TraceInit
 3216PROCshell_Tracef0("AckRAMFetch:AckRAMFetch called....")
 3217*|endif
 3218IF _Q%!12<>_U%!112 THEN
 3219  REM Reference hasn't been updated,
 3220  REM therefore the Wimp returned my call
 3221  IF _U%!128=0 THEN
 3222    REM The receiver didn't support RAM transfer
 3223*|ifdef TraceInit
 3224  PROCshell_Tracef0("AckRAMFetch:Receiver does not support RAM transfer")
 3225*|endif
 3226    SYS "XOS_ReadVarVal","Wimp$Scrap",,-1,0,3 TO ,,Exist%
 3227    IF Exist%<>0 THEN
 3228      $(temp%+44)="<Wimp$Scrap>"+CHR$(0)
 3229      temp%!00=(49+LEN(FNshell_GetString(temp%+44)))ANDNOT3
 3230      temp%!12=temp%!08
 3231      temp%!16=2
 3232      temp%!36=-1
 3233      SYS "Wimp_SendMessage",18,temp%,temp%!4
 3234      _U%!108=temp%!08
 3235    ELSE
 3236       PROCshell_OK(FNshell_MessageNoArgs("SHELLMSG14"))
 3237    ENDIF
 3238  ELSE
 3239    REM The receiver has initiated RAM transfer, and this
 3240    REM was successful once, but I expected more data to come
 3241*|ifdef TraceInit
 3242  PROCshell_Tracef0("AckRAMFetch:RAM transfer started, but not enough data sent. Sender died?")
 3243*|endif
 3244    PROCshell_HeapBlockReturn(_U%!152)
 3245    _U%!152=0
 3246    PROCshell_OK("SHELLMSG06")
 3247  ENDIF
 3248ENDIF
 3249ENDPROC
 3250:
 3251*|Stop PROCshell_AckRAMFetch
 3252
 3253*|Start PROCshell_MenuWarning
 3254DEF PROCshell_MenuWarning(_Q%)
 3255LOCAL fn$,menu_buffer%,x%,y%,void%,_temp%,a%,warn_fn$,item_addr%,blk%
 3256x%=_Q%!24:y%=_Q%!28:_U%!264=0
 3257IF _U%!20<>0 THEN
 3258*|ifdef PROCshell_TraceInit
 3259  PROCshell_Tracef0("MenuWarning:Removing last dynamic dbox (handle=&"+STR$~_U%!20+")")
 3260*|endif
 3261  void%=FNshell_DeleteWindow(_U%!20)
 3262*|ifdef PROCshell_TraceInit
 3263  PROCshell_Tracef0("MenuWarning:Last dynamic dbox removed")
 3264*|endif
 3265ENDIF
 3266REM Check submenu pointer and create window found there
 3267REM Then call pre and post open FNs
 3268REM If submenu pointer is the warning window, open it to remind the user
 3269REM that no dbox has been attached to this menu entry..
 3270CASE _Q%!20 OF
 3271WHEN _U%!228:REM handle of warning dbox..
 3272  REM won't need to do this if title/icon messages are substituted
 3273  REM when loading the templates
 3274  PROCshell_WindowRetitle(_U%!228,FNshell_MessageNoArgs("warning"))
 3275  REM still need to set up the message though...
 3276  PROCshell_IconPutData(_U%!228,1,FNshell_MessageNoArgs("SHELLMSG07"),0)
 3277  SYS "Wimp_CreateSubMenu",,_U%!228,x%,y%
 3278OTHERWISE
 3279  REM Sub menu is either a dialog box, or a menu!!
 3280  item_addr%=FNshell_MenuGetItemAddress(_U%!24,_Q%+32)
 3281  IF FNshell_HeapBlockExists(item_addr%!4) THEN
 3282    REM DBox is attached..
 3283    PROCshell_MenuWarnDBox(item_addr%,x%,y%)
 3284  ELSE
 3285    REM Submenu attached..
 3286    blk%=FNshell_HeapBlockFetch(32)
 3287    SYS "MenuUtil_Decode",_U%!24,_Q%+32 TO ,,blk%
 3288    PROCshell_FindMenuWarnEvent(blk%!8,warn_fn$,sel_fn$)
 3289    PROCshell_HeapBlockReturn(blk%)
 3290    PROCshell_MenuWarnSubMenu(_Q%!20,x%,y%,warn_fn$,sel_fn$)
 3291  ENDIF
 3292ENDCASE
 3293ENDPROC
 3294:
 3295*|Stop PROCshell_MenuWarning
 3296
 3297*|Start PROCshell_MenuWarnDBox
 3298DEF PROCshell_MenuWarnDBox(addr%,x%,y%)
 3299LOCAL temp%,h%,void%
 3300LOCAL ERROR
 3301ON ERROR LOCAL:RESTORE ERROR:ENDPROC
 3302temp%=addr%!4
 3303PROCshell_CreateWindow($temp%!0,h%)
 3304RESTORE ERROR
 3305*|ifdef TraceInit
 3306PROCshell_Tracef0("MenuWarnDBox:Creating new dynamic dbox (handle=&"+STR$~h%+")")
 3307*|endif
 3308IF $temp%!4<>"" THEN
 3309*|ifdef TraceInit
 3310  PROCshell_Tracef0("MenuWarnDBox:Calling preopen FN '"+$temp%!4+"'")
 3311*|endif
 3312  void%=EVAL("FN"+$temp%!4+"("+STR$h%+")")
 3313ENDIF
 3314IF $temp%!8<>"" THEN
 3315*|ifdef TraceInit
 3316  PROCshell_Tracef0("MenuWarnDBox:Calling postopen FN '"+$temp%!8+"'")
 3317*|endif
 3318  void%=EVAL("FN"+$temp%!8+"("+STR$h%+")")
 3319ENDIF
 3320REM h% is new window handle....
 3321SYS "Wimp_CreateSubMenu",,h%,x%,y%
 3322_U%!20=h%
 3323ENDPROC
 3324:
 3325*|Stop PROCshell_MenuWarnDBox
 3326
 3327*|Start PROCshell_FindMenuWarnEvent
 3328DEF PROCshell_FindMenuWarnEvent(item_handle%,RETURN warn_fn$,RETURN sel_fn$)
 3329LOCAL result%,e_list%,temp%,offset%,found%,list_size%,temp2%,ctr%
 3330LOCAL submenu%
 3331submenu%=0:REM If still 0 on return then no event found..
 3332e_list%=_U%!220:offset%=0:found%=FALSE:warn_fn$="":submenu%=0
 3333IF FNshell_HeapBlockExists(e_list%) THEN
 3334  REPEAT
 3335    ctr%+=4
 3336  UNTIL e_list%!ctr%=-1
 3337  list_size%=ctr%:ctr%=0
 3338*|ifdef PROCshell_TraceInit
 3339  PROCshell_Tracef0("FindMenuWarnEvent:list_size%="+STR$list_size%)
 3340*|endif
 3341  REPEAT
 3342    temp%=!(e_list%+offset%+0)
 3343    IF temp%<>-1 THEN
 3344      IF temp%=item_handle% THEN
 3345        found%=TRUE
 3346        temp2%=e_list%!(offset%+4):warn_fn$=$temp2%
 3347        submenu%=e_list%!(offset%+8)
 3348        temp2%=e_list%!(offset%+12):sel_fn$=$temp2%
 3349*|ifdef PROCshell_TraceInit
 3350  PROCshell_Tracef0("FindMenuWarnEvent:submenu found")
 3351*|endif
 3352      ENDIF
 3353      offset%+=16
 3354    ELSE
 3355      offset%=list_size%
 3356    ENDIF
 3357  UNTIL found% OR offset%>=list_size%
 3358ELSE
 3359  warn_fn$="":sel_fn$=""
 3360ENDIF
 3361*|ifdef PROCshell_TraceInit
 3362IF submenu%=0 THEN PROCshell_Tracef0("FindMenuWarnEvent:warn fn not found..")
 3363*|endif
 3364ENDPROC
 3365:
 3366*|Stop PROCshell_FindMenuWarnEvent
 3367
 3368*|Start PROCshell_MenuWarnSubMenu
 3369DEF PROCshell_MenuWarnSubMenu(s_menu%,x%,y%,warn_fn$,sel_fn$)
 3370LOCAL void%,temp%,f_menu%,ctr%
 3371_shell_FontMenuSelFN$=sel_fn$
 3372IF FNshell_HeapBlockExists(_U%!224) THEN PROCshell_HeapBlockReturn(_U%!224)
 3373_U%!224=FNshell_HeapBlockFetch(LENwarn_fn$+1)
 3374temp%=_U%!224:$temp%=warn_fn$
 3375IF warn_fn$<>"" THEN
 3376  void%=EVAL("FN"+warn_fn$+"(_U%!52,_U%!56)")
 3377*|ifdef PROCshell_TraceInit
 3378  PROCshell_Tracef0("MenuWarnSubMenu:Calling FN"+warn_fn$)
 3379*|endif
 3380ENDIF
 3381*|ifdef Using_FontMenu
 3382IF s_menu%=_U%!252 THEN
 3383  REM Submenu is FontMenu menu..
 3384*|ifdef PROCshell_TraceInit
 3385  PROCshell_Tracef0("MenuWarnSubMenu:FontMenu opening..")
 3386*|endif
 3387  IF FNshell_HeapBlockExists(_U%!256) THEN PROCshell_HeapBlockReturn(_U%!256)
 3388  REM Store current menu selection for testing later..
 3389  REM First work out how many levels are in the selection..
 3390  ctr%=0:REPEAT:ctr%+=4:UNTIL !(_Q%+32+ctr%)=-1:ctr%+=4
 3391  _U%!256=FNshell_HeapBlockFetch(ctr%):temp%=_U%!256
 3392  ctr%=0
 3393  REPEAT
 3394    temp%!ctr%=!(_Q%+32+ctr%)
 3395    ctr%+=4
 3396  UNTIL !(_Q%+32+ctr%)=-1
 3397  temp%!ctr%=!(_Q%+32+ctr%)
 3398  temp%=_U%!256
 3399*|ifdef PROCshell_TraceInit
 3400  PROCshell_Tracef0("MenuWarnSubMenu:Selecting '"+FNshell_FontMenuGetLastSelectedFont+"' in FontMenu..")
 3401*|endif
 3402  SYS "FontMenu_Select",FNshell_FontMenuGetLastSelectedFont,_U%!260 TO ,f_menu%
 3403  _U%!264=1:REM Set 'FontMenuOpen' flag..
 3404  IF f_menu%<>_U%!252 THEN
 3405    REM FontMenu ptr has changed..
 3406    PROCshell_FontMenuUpdatePtr(f_menu%)
 3407    _U%!252=f_menu%:s_menu%=f_menu%
 3408  ENDIF
 3409ELSE
 3410  _U%!264=0:REM Clear 'FontMenuOpen' flag..
 3411ENDIF
 3412*|endif
 3413SYS "Wimp_CreateSubMenu",,s_menu%,x%,y%
 3414ENDPROC
 3415:
 3416*|Stop PROCshell_MenuWarnSubMenu
 3417
 3418*|Start PROCshell_AttachSubMenu
 3419DEF PROCshell_AttachSubMenu(item%,submenu%,warn_fn$)
 3420SYS "MenuUtil_SubMenu",item%,submenu%
 3421IF warn_fn$<>"" THEN
 3422  SYS "MenuUtil_Warning",,TRUE
 3423  PROCshell_EventListMenuWarn(item%,submenu%,warn_fn$,"")
 3424ENDIF
 3425ENDPROC
 3426:
 3427*|Stop PROCshell_AttachSubMenu
 3428
 3429*|Start PROCshell_EventListMenuWarn
 3430DEF PROCshell_EventListMenuWarn(item%,submenu_ptr%,warn_fn$,sel_fn$)
 3431LOCAL temp%,temp2%,ctr%,e_list%
 3432IF _U%!220=0 THEN
 3433  REM Create event list..
 3434  _U%!220=FNshell_HeapBlockFetch(32)
 3435  temp%=_U%!220
 3436  temp%!0=item%
 3437  temp%!4=FNshell_HeapBlockFetch(LENwarn_fn$+1)
 3438  $(temp%!4)=warn_fn$
 3439  temp%!8=submenu_ptr%
 3440  temp%!12=FNshell_HeapBlockFetch(LENsel_fn$+1)
 3441  $(temp%!12)=sel_fn$
 3442  temp%!16=-1:temp%!20=-1:temp%!24=-1:temp%!28=-1
 3443ELSE
 3444  REM Extend existing event list..
 3445  e_list%=FNshell_HeapBlockExtend(_U%!220,32)
 3446  _U%!220=e_list%:ctr%=0
 3447  REPEAT
 3448    ctr%+=16
 3449  UNTIL e_list%!ctr%=-1
 3450  temp%=_U%!220
 3451  temp%!ctr%=item%
 3452  temp%!(ctr%+4)=FNshell_HeapBlockFetch(LENwarn_fn$+1)
 3453  temp2%=temp%!(ctr%+4):$(temp2%)=warn_fn$
 3454  temp%!(ctr%+8)=submenu_ptr%
 3455  temp%!(ctr%+12)=FNshell_HeapBlockFetch(LENsel_fn$+1)
 3456  temp2%=temp%!(ctr%+12):$(temp2%)=sel_fn$
 3457  temp%!(ctr%+16)=-1:temp%!(ctr%+20)=-1:temp%!(ctr%+24)=-1
 3458  temp%!(ctr%+28)=-1
 3459ENDIF
 3460ENDPROC
 3461:
 3462*|Stop PROCshell_EventListMenuWarn
 3463
 3464*|Start PROCshell_InteractiveHelp
 3465DEF PROCshell_InteractiveHelp(_Q%)
 3466LOCAL tag$,mess$,validation$,pos1%,pos2%,help$,i_blk%
 3467i_blk% = FNshell_HeapBlockFetch(12)
 3468SYS "Wimp_WhichIcon",_Q%!32,i_blk%,&003F0000,12 << 16
 3469IF !i_blk% <> -1 THEN
 3470  REM PROCshell_Tracef0("LL:"+STR$(!i_blk%))
 3471  REM PROCshell_Tracef0("LL:"+"FN" + FNshell_IconGetData(_Q%!32,!i_blk%))
 3472  tag$ = FNshell_IconGetData(_Q%!32,!i_blk%)
 3473ENDIF
 3474PROCshell_HeapBlockReturn(i_blk%)
 3475IF tag$ = "" THEN tag$=FNshell_GetEventHandler(_Q%!32,_Q%!36,8)
 3476REM check validation string - this overrides attached help tags!
 3477validation$=FNshell_IconGetValidation(_Q%!32,_Q%!36)
 3478IF validation$<>"" THEN
 3479  IF FNshell_StringUpperCase(LEFT$(validation$,1))="I" THEN
 3480    pos1%=INSTR(validation$,";")
 3481    REM i is first modifier
 3482    IF pos1%=0 THEN
 3483      tag$=MID$(validation$,2)
 3484    ELSE
 3485      tag$=MID$(validation$,2,pos1%-2)
 3486    ENDIF
 3487  ELSE
 3488    pos1%=INSTR(FNshell_StringUpperCase(validation$),FNshell_StringUpperCase(";i"))
 3489    pos2%=INSTR(FNshell_StringUpperCase(validation$),FNshell_StringUpperCase(";"),pos1%+1)
 3490    IF pos1%>0 THEN
 3491      IF pos2%>0 THEN
 3492        tag$=MID$(validation$,pos1%+2,pos2%-pos1%-2)
 3493      ELSE
 3494        tag$=MID$(validation$,pos1%+2)
 3495      ENDIF
 3496    ENDIF
 3497  ENDIF
 3498ENDIF
 3499IF tag$<>"" THEN
 3500  _Q%!16=&503:_Q%!12=_Q%!8
 3501  mess$=FNshell_MessageLookup(tag$,"","")
 3502  mess$=FNshell_MessageExpand(mess$)
 3503  $(_Q%+20)=mess$
 3504  !_Q%=(LENmess$+25) AND NOT 3
 3505  SYS "Wimp_SendMessage",17,_Q%,_Q%!4
 3506ENDIF
 3507ENDPROC
 3508:
 3509*|Stop PROCshell_InteractiveHelp
 3510*|Start PROCack
 3511DEF PROCack
 3512ENDPROC
 3513:
 3514*|Stop PROCack
 3515
 3516*|Start PROCshell_Message_PreQuit
 3517DEF PROCshell_Message_PreQuit(_Q%)
 3518LOCAL temp%,quitsender%,blk%,loop%,flagword%
 3519IF _U%!300>0 THEN
 3520  blk%=FNshell_HeapBlockFetch(256)
 3521  REM copy message block to private area..
 3522  FOR loop%=0 TO _Q%!0 STEP 4:REM first word is size...
 3523    blk%!loop%=_Q%!loop%
 3524  NEXT loop%
 3525*|ifdef TraceInit
 3526  PROCshell_Tracef0("Message_PreQuit:PreQuit message received")
 3527*|endif
 3528  temp%=_U%!300
 3529  quitsender%=blk%!4
 3530  IF !blk%<24 THEN flagword%=0 ELSE flagword%=blk%!20
 3531  REM acknowledge message - this aborts shutdown..
 3532  blk%!12=blk%!8:SYS "Wimp_SendMessage",19,blk%,quitsender%
 3533  IF EVAL("FN"+$temp%)<>0 THEN
 3534    REM ok to quit..
 3535    IF flagword% AND 1 THEN
 3536      REM quit just this task..
 3537      _closedown%=TRUE
 3538    ELSE
 3539      REM shutdown desktop..
 3540      !blk%=24:blk%!24=&1FC
 3541      SYS "Wimp_SendMessage",8,blk%,quitsender%
 3542      _closedown%=TRUE
 3543    ENDIF
 3544  ENDIF
 3545  PROCshell_HeapBlockReturn(blk%)
 3546ENDIF
 3547ENDPROC
 3548:
 3549*|Stop PROCshell_Message_PreQuit
 3550
 3551*|Start PROClwaorigin
 3552DEF PROClwaorigin(b,RETURN x%,RETURN y%)
 3553x%=b!0-b!16:y%=b!12-b!20
 3554ENDPROC
 3555:
 3556*|Stop PROClwaorigin
 3557
 3558*|Start FNshell_Iconbar
 3559DEF FNshell_Iconbar(pos%,sname$,text$,w%,menu%,shift%,ctrl%,alt%)
 3560LOCAL handle%
 3561IF text$="" THEN
 3562  !_Q%=pos%:_Q%!4=0:_Q%!8=0:_Q%!12=70:_Q%!16=70:_Q%!20=&301A:$(_Q%+24)=sname$
 3563ELSE
 3564  !_Q%=pos%:_Q%!4=0:_Q%!8=-16:_Q%!12=w%:_Q%!16=90:_Q%!20=&1700210B
 3565  DIM _Q%!24 12
 3566  DIM _Q%!28 LEN(sname$)+2
 3567  $(_Q%!24)=text$
 3568  $(_Q%!28)="S"+sname$
 3569  _Q%!32=12
 3570ENDIF
 3571SYS "Wimp_CreateIcon",,_Q% TO handle%
 3572PROCshell_AttachMenu(-2,handle%,menu%,shift%,ctrl%,alt%)
 3573=handle%
 3574:
 3575*|Stop FNshell_Iconbar
 3576
 3577*|Start PROCshell_IconbarSetText
 3578DEF PROCshell_IconbarSetText(h%,in%,s$)
 3579LOCAL icon_blk%,w_blk%
 3580icon_blk%=FNshell_HeapBlockFetch(40)
 3581w_blk%    = FNshell_HeapBlockFetch(36)
 3582w_blk%!20 = 0
 3583IF FNshell_OSCheckVersion(3) THEN
 3584  IF h% = -1 THEN !w_blk% = -2 ELSE !w_blk% = h%
 3585  SYS "Wimp_GetWindowState",,w_blk%
 3586ENDIF
 3587!icon_blk% = h%:icon_blk%!4 = in%
 3588SYS "Wimp_GetIconState",,icon_blk%
 3589$(icon_blk%!28)=s$
 3590SYS "Wimp_ForceRedraw",-1,icon_blk%!8-100-w_blk%!20,icon_blk%!12,icon_blk%!16+100-w_blk%!20,icon_blk%!20
 3591PROCshell_HeapBlockReturn(icon_blk%)
 3592PROCshell_HeapBlockReturn(w_blk%)
 3593ENDPROC
 3594:
 3595*|Stop PROCshell_IconbarSetText
 3596
 3597*|Start FNshell_WritableIconHandler
 3598DEF FNshell_WritableIconHandler(wh%,ih%,key%)
 3599LOCAL nr_icons%,first_write%,last_write%,ctr%
 3600LOCAL prev_icon%,next_icon%,index%,mx%,my%,temp_blk%,caret_blk%
 3601
 3602REM caret_blk% should be just large enough for the number of icons
 3603REM actually in the window (limit is 254 icons)...
 3604caret_blk% = FNshell_HeapBlockFetch(1024)
 3605SYS "Wimp_GetCaretPosition",,caret_blk%
 3606IF !caret_blk% = -1 THEN
 3607  PROCshell_HeapBlockReturn(caret_blk%)
 3608  = FALSE :REM no caret so abort
 3609ENDIF
 3610
 3611REM must be icons in the window as the caret is present
 3612SYS "Wimp_WhichIcon",wh%,caret_blk%,&0040E000,&0000E000
 3613
 3614first_write% = !caret_blk%:ctr%  =0
 3615REPEAT
 3616  IF caret_blk%!ctr% = ih% THEN
 3617    prev_icon% = caret_blk%!(ctr% - 4)
 3618    next_icon%  = caret_blk%!(ctr% + 4)
 3619  ENDIF
 3620  ctr% += 4
 3621UNTIL caret_blk%!ctr% = -1
 3622last_write% = caret_blk%!(ctr%-4)
 3623
 3624CASE key% OF
 3625  WHEN &0D  :REM return
 3626      PROCshell_FakeMouseClick(wh%,0,4)
 3627  WHEN &18E,394 :REM cursor down,TAB
 3628    IF ih% = last_write% THEN
 3629      SYS "Wimp_SetCaretPosition",wh%,first_write%,-1,-1,-1,LEN(FNshell_IconGetData(wh%,first_write%))
 3630    ELSE
 3631      SYS "Wimp_SetCaretPosition",wh%,next_icon%,-1,-1,-1,LEN(FNshell_IconGetData(wh%,next_icon%))
 3632    ENDIF
 3633  WHEN &18F,410 :REM cursor up,SHIFT TAB
 3634    IF ih% = first_write% THEN
 3635      SYS "Wimp_SetCaretPosition",wh%,last_write%,-1,-1,-1,LEN(FNshell_IconGetData(wh%,last_write%))
 3636    ELSE
 3637      SYS "Wimp_SetCaretPosition",wh%,prev_icon%,-1,-1,-1,LEN(FNshell_IconGetData(wh%,prev_icon%))
 3638    ENDIF
 3639  WHEN 431 :REM CTRL Cursor Up (move to first writable icon)
 3640    SYS "Wimp_SetCaretPosition",wh%,first_write%,-1,-1,-1,LEN(FNshell_IconGetData(wh%,first_write%))
 3641  WHEN 430 :REM CTRL Cursor Down (move to last writable icon)
 3642    SYS "Wimp_SetCaretPosition",wh%,last_write%,-1,-1,-1,LEN(FNshell_IconGetData(wh%,last_write%))
 3643ENDCASE
 3644PROCshell_HeapBlockReturn(caret_blk%)
 3645= TRUE
 3646:
 3647*|Stop FNshell_WritableIconHandler
 3648
 3649*|Start PROCshell_FakeMouseClick
 3650DEF PROCshell_FakeMouseClick(wh%,ih%,button%)
 3651SYS "OS_Byte",15,1:REM flush input buffer
 3652_Q%!8=button%:_Q%!12=wh%:_Q%!16=ih%
 3653PROCshell_Action(6)
 3654ENDPROC
 3655:
 3656*|Stop PROCshell_FakeMouseClick
 3657*|Start FNshell_IconCreate
 3658DEF FNshell_IconCreate(wh%,minx%,miny%,w%,h%,fg%,bg%,flg%,data$,addr%,len%,validation$)
 3659LOCAL i%,handle%,valid%,icon_blk%
 3660icon_blk%=FNshell_HeapBlockFetch(40)
 3661icon_blk%!0=wh%
 3662icon_blk%!4=minx%:icon_blk%!8=miny%
 3663icon_blk%!12=minx%+w%:icon_blk%!16=miny%+h%
 3664icon_blk%!20=flg% OR bg%<<28 OR fg%<<24
 3665IF icon_blk%!20 AND &100 THEN
 3666  i%=INSTR(data$,",")
 3667  icon_blk%!24=addr%
 3668  IF validation$<>"" THEN
 3669    valid%=FNshell_HeapBlockFetch(LENvalidation$+1)
 3670    $valid%=validation$
 3671    icon_blk%!28=valid%
 3672  ELSE
 3673    icon_blk%!28=-1
 3674  ENDIF
 3675  icon_blk%!32=len%
 3676ELSE
 3677  $(icon_blk%+24)=LEFT$(data$,11)
 3678ENDIF
 3679SYS "Wimp_CreateIcon",,icon_blk% TO handle%
 3680PROCshell_HeapBlockReturn(icon_blk%)
 3681=handle%
 3682:
 3683*|Stop FNshell_IconCreate
 3684*|Start PROCshell_IconDelete
 3685DEF PROCshell_IconDelete(wh%,ih%)
 3686PROCshell_DoIconDelete(wh%,ih%,FALSE)
 3687ENDPROC
 3688:
 3689*|Stop PROCshell_IconDelete
 3690*|Start PROCshell_IconDelete2
 3691DEF PROCshell_IconDelete2(wh%,ih%)
 3692PROCshell_DoIconDelete(wh%,ih%,TRUE)
 3693ENDPROC
 3694:
 3695*|Stop PROCshell_IconDelete2
 3696*|Start PROCshell_DoIconDelete
 3697DEF PROCshell_DoIconDelete(wh%,ih%,redraw%)
 3698LOCAL blk%,x0%,y0%,x1%,y1%
 3699blk%=FNshell_HeapBlockFetch(40)
 3700blk%!0=wh%:blk%!4=ih%
 3701SYS "Wimp_GetIconState",,blk%
 3702SYS "Interface_BoundingBox",,blk%+8
 3703x0%=blk%!8:y0%=blk%!12:x1%=blk%!16:y1%=blk%!20
 3704SYS "Wimp_GetIconState",,blk%
 3705IF FNshell_HeapBlockExists(blk%!28) THEN PROCshell_HeapBlockReturn(blk%!28)
 3706IF FNshell_HeapBlockExists(blk%!32) THEN PROCshell_HeapBlockReturn(blk%!32)
 3707SYS "Wimp_DeleteIcon",,blk%
 3708IF redraw% THEN
 3709  SYS "Wimp_ForceRedraw",wh%,x0%,y0%,x1%,y1%
 3710ENDIF
 3711PROCshell_HeapBlockReturn(blk%)
 3712ENDPROC
 3713:
 3714*|Stop PROCshell_DoIconDelete
 3715
 3716*|Start PROCshell_IconPutData
 3717DEF PROCshell_IconPutData(whandle%,ihandle%,data$,redraw)
 3718LOCAL blk%,old_str$
 3719old_str$ = FNshell_IconGetData(whandle%,ihandle%)
 3720IF data$ <> old_str$ THEN
 3721  blk%=FNshell_HeapBlockFetch(40)
 3722  blk%!0 = whandle%
 3723  blk%!4 = ihandle%
 3724  SYS "Wimp_GetIconState",,blk%
 3725  IF (blk%!24 AND (1<<8)) <> 0 THEN
 3726    IF LENdata$ > blk%!36 THEN ERROR 99,FNshell_MessageNoArgs("SHELLMSG12")
 3727    $(blk%!28) = data$
 3728  ELSE
 3729    $(blk% + 28) = LEFT$(data$,11)
 3730  ENDIF
 3731  IF redraw <> 0 THEN
 3732    blk%!8 = 0:blk%!12 = 0
 3733    SYS "Wimp_SetIconState",,blk%
 3734  ENDIF
 3735  PROCshell_HeapBlockReturn(blk%)
 3736ENDIF
 3737ENDPROC
 3738:
 3739*|Stop PROCshell_IconPutData
 3740
 3741*|Start PROCshell_IconPutDataNow
 3742DEF PROCshell_IconPutDataNow(whandle%,ihandle%,data$)
 3743LOCAL blk%
 3744blk%=FNshell_HeapBlockFetch(50) 
 3745blk%!0=whandle%
 3746blk%!4=ihandle%
 3747SYS "Wimp_GetIconState",,blk%
 3748IF (blk%!24 AND (1<<8))<>0 THEN
 3749  IF LENdata$>blk%!36 THEN ERROR 99,FNshell_MessageNoArgs("SHELLMSG12")
 3750  $(blk%!28)=data$
 3751ELSE
 3752  $(blk%+28)=LEFT$(data$,11)
 3753ENDIF
 3754blk%!8=0:blk%!12=0
 3755SYS "Wimp_SetIconState",,blk%
 3756REM Call wimp poll immediately in case the user program doesn't..
 3757PROCshell_EnsurePoll
 3758PROCshell_HeapBlockReturn(blk%)
 3759ENDPROC 
 3760*|Stop PROCshell_IconPutDataNow
 3761
 3762*|Start FNshell_IconNewSprite
 3763DEF FNshell_IconNewSprite(whandle%,ihandle%,newname$,redraw)
 3764LOCAL icon_blk%
 3765icon_blk%=FNshell_HeapBlockFetch(40)
 3766icon_blk%!0=whandle%:icon_blk%!4=ihandle%
 3767SYS "Wimp_GetIconState",,icon_blk%
 3768SYS "Wimp_DeleteIcon",,icon_blk%
 3769icon_blk%!4=icon_blk%!8:icon_blk%!8=icon_blk%!12:icon_blk%!12=icon_blk%!16
 3770icon_blk%!16=icon_blk%!20:icon_blk%!20=icon_blk%!24:$(icon_blk%+24)=newname$
 3771SYS "Wimp_CreateIcon",,icon_blk% TO ihandle%
 3772IF redraw THEN SYS "Wimp_ForceRedraw",icon_blk%!0,icon_blk%!4,icon_blk%!8,icon_blk%!12,icon_blk%!16
 3773PROCshell_HeapBlockReturn(icon_blk%)
 3774=ihandle%
 3775:
 3776*|Stop FNshell_IconNewSprite
 3777
 3778*|Start FNshell_IconGetData
 3779DEF FNshell_IconGetData(whandle%,ihandle%)
 3780LOCAL result$,icon_blk%
 3781icon_blk%=FNshell_HeapBlockFetch(40)
 3782icon_blk%!0=whandle%
 3783icon_blk%!4=ihandle%
 3784SYS "Wimp_GetIconState",,icon_blk%
 3785IF (icon_blk%!24 AND (1<<8))<>0 THEN result$=$(icon_blk%!28) ELSE result$=$(icon_blk%+28)
 3786PROCshell_HeapBlockReturn(icon_blk%)
 3787=result$
 3788:
 3789*|Stop FNshell_IconGetData
 3790
 3791*|Start FNshell_IconMove2
 3792DEF FNshell_IconMove2(wh%,ih%,d_x%,d_y%)
 3793LOCAL m_blk%
 3794m_blk%=FNshell_HeapBlockFetch(40)
 3795!m_blk%=wh%:m_blk%!4=ih%
 3796SYS "Wimp_GetIconState",,m_blk%
 3797m_blk%!8+=d_x%:m_blk%!16+=d_x%
 3798m_blk%!12+=d_y%:m_blk%!20+=d_y%
 3799ih%=FNshell_IconMove(wh%,ih%,m_blk%!8,m_blk%!12,m_blk%!16,m_blk%!20)
 3800PROCshell_HeapBlockReturn(m_blk%)
 3801=ih%
 3802:
 3803*|Stop FNshell_IconMove2
 3804*|Start FNshell_IconResize
 3805DEF FNshell_IconResize(wh%,ih%,x0%,y0%,x1%,y1%)
 3806=FNshell_IconMove(wh%,ih%,x0%,y0%,x1%,y1%)
 3807:
 3808*|Stop FNshell_IconResize
 3809*|Start FNshell_IconMove
 3810DEF FNshell_IconMove(wh%,ih%,x0%,y0%,x1%,y1%)
 3811LOCAL i_blk%,i_flags%,i_data%,bdr%,blk%
 3812LOCAL oldflags%,odt0%,odt1%,odt2%
 3813i_blk%=FNshell_HeapBlockFetch(40)
 3814blk%=FNshell_HeapBlockFetch(40)
 3815!i_blk%=wh%:i_blk%!4=ih%:SYS "Wimp_GetIconState",,i_blk%
 3816!blk%=wh%:blk%!4=ih%
 3817SYS "Wimp_GetIconState",,blk%
 3818SYS "Interface_BoundingBox",,blk%+8
 3819iflags%=i_blk%!24:idata%=i_blk%+28
 3820oldflags%=iflags%:odt0%=idata%!0:odt1%=idata%!4:odt2%=idata%!8
 3821bdr%=i_blk%!8-blk%!8
 3822SYS "Wimp_DeleteIcon",,i_blk%
 3823SYS "Wimp_ForceRedraw",!i_blk%,i_blk%!8-bdr%,i_blk%!12-bdr%,i_blk%!16+bdr%,i_blk%!20+bdr%
 3824ih%=FNshell_CreateIcon2(wh%,x0%,y0%,x1%,y1%,oldflags%,odt0%,odt1%,odt2%,bdr%)
 3825PROCshell_HeapBlockReturn(i_blk%)
 3826PROCshell_HeapBlockReturn(blk%)
 3827=ih%
 3828:
 3829*|Stop FNshell_IconMove
 3830*|Start FNshell_CreateIcon2
 3831DEF FNshell_CreateIcon2(handle%,x0%,y0%,x1%,y1%,flags%,dt0%,dt1%,dt2%,bdr%)
 3832LOCAL ic%,q%,text$,sprite$,minx%,miny%
 3833q%=FNshell_HeapBlockFetch(60)
 3834!q%=handle%
 3835q%!20=flags%:q%!24=dt0%:q%!28=dt1%:q%!32=dt2%
 3836text$="":sprite$=""
 3837IF flags% AND 1 THEN
 3838 IF flags% AND &100 text$=$(q%!24) ELSE text$=$(q%+24)
 3839ENDIF
 3840IF flags% AND 2 THEN
 3841 IF flags% AND &100 THEN
 3842  sprite$=FNshell_IconGetCommand(q%!28,"S")
 3843 ELSE
 3844  sprite$=$(q%+24)
 3845 ENDIF
 3846ENDIF
 3847PROCshell_GetMinXY(flags%,text$,sprite$)
 3848IF x1%-x0%<minx% THEN x1%=x0%+minx%
 3849IF y1%-y0%<miny% THEN y1%=y0%+miny%
 3850q%!4=x0%:q%!8=y0%:q%!12=x1%:q%!16=y1%
 3851SYS "Wimp_CreateIcon",,q% TO ic%
 3852SYS "Wimp_ForceRedraw",!q%,q%!4-bdr%,q%!8-bdr%,q%!12+bdr%,q%!16+bdr%
 3853SYS "Wimp_GetCaretPosition",,q%
 3854IF !q%=handle%:IFq%!4=ic%:SYS "Wimp_SetCaretPosition",handle%,ic%,0,0,-1,0
 3855PROCshell_HeapBlockReturn(q%)
 3856=ic%
 3857:
 3858*|Stop FNshell_CreateIcon2
 3859
 3860*|Start PROCshell_GetMinXY
 3861DEF PROCshell_GetMinXY(flags%,text$,sprite$)
 3862LOCAL x0%,y0%,x1%,y1%,mx%,my%
 3863minx%=0:miny%=0
 3864IF flags%AND&01 AND text$<>"" THEN
 3865  IF flags%AND&40 THEN
 3866       SYS "Font_ReadInfo",flags%>>24 TO ,,y0%,,y1%
 3867       SYS "Font_StringBBox",,CHR$26+CHR$(flags%>>24)+text$ TO ,x0%,,x1%
 3868       SYS "Font_ConverttoOS",,x0% TO ,x0%
 3869       SYS "Font_ConverttoOS",,x1% TO ,x1%
 3870       minx%=x1%-x0%:miny%=y1%-y0%
 3871  ELSE minx%=6*dx%+16*LENtext$:miny%=32
 3872  ENDIF
 3873  IF flags%AND&04 miny%+=2*dy%
 3874ENDIF
 3875IF flags%AND&02 AND sprite$<>"" THEN
 3876   SYS "XOS_SpriteOp",&128,FNshell_UserSpritesBase,sprite$ TO ,,,mx%,my%,,spm% ; P%
 3877   IF (P%AND1)=0 THEN
 3878      SYS "XOS_ReadModeVariable",spm%,4 TO ,,spx%:mx%=mx%<<spx%
 3879      SYS "XOS_ReadModeVariable",spm%,5 TO ,,spy%:my%=my%<<spy%
 3880      IF flags%AND&800 mx%=mx%/2:my%=my%/2
 3881      IF (flags%AND&21B)=&13 mx%=minx%+mx% :REM sprite+text (V~H~R)
 3882      IF mx%>minx% minx%=mx%
 3883      IF my%>miny% miny%=my%
 3884   ENDIF
 3885ENDIF
 3886ENDPROC
 3887:
 3888*|Stop PROCshell_GetMinXY
 3889
 3890*|Start FNshell_IconGetCommand
 3891DEF FNshell_IconGetCommand(v%,c$)
 3892LOCAL I%,result$
 3893IF v%<=0 THEN
 3894  result$=""
 3895ELSE
 3896  I%=INSTR(";"+FNshell_StringUpperCase($v%),";"+FNshell_StringUpperCase(c$))
 3897  IF I%=0 THEN
 3898    result$=""
 3899  ELSE
 3900    result$=LEFT$($(v%+I%),INSTR($(v%+I%)+";",";")-1)
 3901  ENDIF
 3902ENDIF
 3903=result$
 3904:
 3905*|Stop FNshell_IconGetCommand
 3906*|Start PROCshell_IconRedraw
 3907DEF PROCshell_IconRedraw(wh%,ih%)
 3908LOCAL blk%
 3909blk%=FNshell_HeapBlockFetch(40)
 3910!blk%=wh%:blk%!4=ih%
 3911SYS "Wimp_GetIconState",,blk%
 3912SYS "Interface_BoundingBox",,blk%+8
 3913SYS "Wimp_ForceRedraw",wh%,blk%!8,blk%!12,blk%!16,blk%!20
 3914PROCshell_Action(FNshell_Poll_I(0,_U%!148))
 3915PROCshell_HeapBlockReturn(blk%)
 3916ENDPROC
 3917:
 3918*|Stop PROCshell_IconRedraw
 3919*|Start FNshell_IconGetValidation
 3920DEF FNshell_IconGetValidation(wh%,ih%)
 3921LOCAL blk%,validation$,flags%
 3922IF ih%=-1 THEN =""
 3923validation$=""
 3924blk%=FNshell_HeapBlockFetch(100)
 3925blk%!0=wh%:blk%!4=ih%
 3926SYS "Wimp_GetIconState",,blk%
 3927REM check flags first to see if it has a
 3928REM validation string!
 3929flags%=blk%!24
 3930IF flags% AND &100 THEN
 3931  IF blk%!32>0 THEN validation$=$(blk%!32)
 3932ENDIF
 3933PROCshell_HeapBlockReturn(blk%)
 3934=validation$
 3935:
 3936*|Stop FNshell_IconGetValidation
 3937*|Start PROCshell_IconPutValidation
 3938DEF PROCshell_IconPutValidation(wh%,ih%,valid$)
 3939LOCAL blk%,flags%
 3940blk%=FNshell_HeapBlockFetch(100)
 3941blk%!0=wh%:blk%!4=ih%
 3942SYS "Wimp_GetIconState",,blk%
 3943flags%=blk%!24
 3944IF flags% AND &100 THEN
 3945  $(blk%!32)=valid$
 3946ENDIF
 3947PROCshell_HeapBlockReturn(blk%)
 3948ENDPROC
 3949:
 3950*|Stop PROCshell_IconPutValidation
 3951*|Start FNshell_IsIconSelected
 3952DEF FNshell_IsIconSelected(WindowHandle%,IconHandle%)
 3953LOCAL temp%
 3954PROCshell_IconGetState(WindowHandle%,IconHandle%)
 3955flags%=_Q%!24
 3956temp%=(flags% AND &200000)
 3957IF temp%=0 THEN =FALSE
 3958=TRUE
 3959:
 3960*|Stop FNshell_IsIconSelected
 3961
 3962*|Start PROCshell_IconSelect
 3963DEF PROCshell_IconSelect(WindowHandle%,IconHandle%)
 3964PROCshell_IconSetState(WindowHandle%,IconHandle%,&200000,&200000)
 3965ENDPROC
 3966:
 3967*|Stop PROCshell_IconSelect
 3968
 3969*|Start PROCshell_IconDeselect
 3970DEF PROCshell_IconDeselect(WindowHandle%,IconHandle%)
 3971PROCshell_IconSetState(WindowHandle%,IconHandle%,0,&200000)
 3972ENDPROC
 3973:
 3974*|Stop PROCshell_IconDeselect
 3975
 3976*|Start PROCshell_IconGetState
 3977DEF PROCshell_IconGetState(WindowHandle%,IconHandle%)
 3978!_Q%=WindowHandle%
 3979_Q%!4=IconHandle%
 3980SYS "Wimp_GetIconState",,_Q%
 3981ENDPROC
 3982:
 3983*|Stop PROCshell_IconGetState
 3984
 3985*|Start PROCshell_IconSetSelected
 3986DEF PROCshell_IconSetSelected(wh%,ih%,state%)
 3987IF state%=0 THEN
 3988  PROCshell_IconDeselect(wh%,ih%)
 3989ELSE
 3990  PROCshell_IconSelect(wh%,ih%)
 3991ENDIF
 3992ENDPROC
 3993:
 3994*|Stop PROCshell_IconSetSelected
 3995
 3996*|Start PROCshell_IconSet
 3997DEF PROCshell_IconSet(wh%,ih%,state%)
 3998IF state%=0 THEN
 3999  PROCshell_IconDeselect(wh%,ih%)
 4000ELSE
 4001  PROCshell_IconSelect(wh%,ih%)
 4002ENDIF
 4003ENDPROC
 4004:
 4005*|Stop PROCshell_IconSet
 4006*|Start PROCshell_IconSetState
 4007DEF PROCshell_IconSetState(WindowHandle%,IconHandle%,EorWord%,ClearWord%)
 4008LOCAL icon_blk%
 4009icon_blk%=FNshell_HeapBlockFetch(16)
 4010!icon_blk%=WindowHandle%
 4011icon_blk%!04=IconHandle%
 4012icon_blk%!08=EorWord%
 4013icon_blk%!12=ClearWord%
 4014SYS "Wimp_SetIconState",,icon_blk%
 4015PROCshell_HeapBlockReturn(icon_blk%)
 4016ENDPROC
 4017:
 4018*|Stop PROCshell_IconSetState
 4019
 4020*|Start PROCshell_IconUnselectable
 4021DEF PROCshell_IconUnselectable(handle%,icon%)
 4022PROCshell_IconSetState(handle%,icon%,&400000,&40000)
 4023ENDPROC
 4024:
 4025*|Stop PROCshell_IconUnselectable
 4026
 4027*|Start PROCshell_IconSetBGColour
 4028DEF PROCshell_IconSetBGColour(wh%,ih%,col%)
 4029IF col%<0 OR col%>15 THEN ERROR 99,FNshell_MessageOneArg("SHELLMSG24","PROCshell_IconSetBGColour")
 4030PROCshell_IconSetState(wh%,ih%,col%<<28,&F0000000)
 4031ENDPROC
 4032:
 4033*|Stop PROCshell_IconSetBGColour
 4034
 4035*|Start PROCshell_IconSetFGColour
 4036DEF PROCshell_IconSetFGColour(wh%,ih%,col%)
 4037IF col%<0 OR col%>15 THEN ERROR 99,FNshell_MessageOneArg("SHELLMSG24","PROCshell_IconSetFGColour")
 4038PROCshell_IconSetState(wh%,ih%,col%<<24,&0F000000)
 4039ENDPROC
 4040:
 4041*|Stop PROCshell_IconSetFGColour
 4042
 4043*|Start PROCshell_CaretSetPosition
 4044DEF PROCshell_CaretSetPosition(whandle%,ihandle%,xoff%,yoff%,height%,index%)
 4045SYS "Wimp_SetCaretPosition",whandle%,ihandle%,xoff%,yoff%,height%,index%
 4046ENDPROC
 4047:
 4048*|Stop PROCshell_CaretSetPosition
 4049
 4050*|Start PROCshell_IconSetButtonType
 4051DEF PROCshell_IconSetButtonType(wh%,ih%,button_type%)
 4052IF button_type%=12 OR button_type%=13 THEN ERROR 99,FNshell_MessageOneArg("SHELLMSG23","PROCshell_IconSetButtonType")
 4053IF button_type%<0 OR button_type%>15 THEN ERROR 99,FNshell_MessageOneArg("SHELLMSG22","PROCshell_IconSetButtonType")
 4054PROCshell_IconSetState(wh%,ih%,button_type%<<12,&F000)
 4055ENDPROC
 4056:
 4057*|Stop PROCshell_IconSetButtonType
 4058*|Start PROCshell_IconSetESG
 4059DEF PROCshell_IconSetESG(wh%,ih%,esg%)
 4060IF esg%<0 OR esg%>31 THEN ERROR 99,FNshell_MessageOneArg("SHELLMSG25","PROCshell_IconSetESG")
 4061PROCshell_IconSetState(wh%,ih%,esg%<<16,&1F0000)
 4062ENDPROC
 4063:
 4064*|Stop PROCshell_IconSetESG
 4065
 4066*|Start PROCshell_IconSetText
 4067DEF PROCshell_IconSetText(wh%,ih%,action%)
 4068IF action%<>0 THEN action%=1<<0
 4069PROCshell_IconSetState(wh%,ih%,action%,1<<0)
 4070ENDPROC
 4071:
 4072*|Stop PROCshell_IconSetText
 4073
 4074*|Start PROCshell_IconSetSprite
 4075DEF PROCshell_IconSetSprite(wh%,ih%,action%)
 4076IF action%<>0 THEN action%=1<<1
 4077PROCshell_IconSetState(wh%,ih%,action%,1<<1)
 4078ENDPROC
 4079:
 4080*|Stop PROCshell_IconSetSprite
 4081*|Start PROCshell_IconSetBorder
 4082DEF PROCshell_IconSetBorder(wh%,ih%,action%)
 4083IF action%<>0 THEN action%=1<<2
 4084PROCshell_IconSetState(wh%,ih%,action%,1<<2)
 4085ENDPROC
 4086:
 4087*|Stop PROCshell_IconSetBorder
 4088
 4089*|Start PROCshell_IconSetHCentred
 4090DEF PROCshell_IconSetHCentred(wh%,ih%,action%)
 4091PROCshell_IconSetState(wh%,ih%,0,1<<9):REM unset right justified bit...
 4092IF action%<>0 THEN action%=1<<3
 4093PROCshell_IconSetState(wh%,ih%,action%,1<<3)
 4094ENDPROC
 4095:
 4096*|Stop PROCshell_IconSetHCentred
 4097
 4098*|Start PROCshell_IconSetVCentred
 4099DEF PROCshell_IconSetVCentred(wh%,ih%,action%)
 4100IF action%<>0 THEN action%=1<<4
 4101PROCshell_IconSetState(wh%,ih%,action%,1<<4)
 4102ENDPROC
 4103:
 4104*|Stop PROCshell_IconSetVCentred
 4105
 4106*|Start PROCshell_IconSetFilled
 4107DEF PROCshell_IconSetFilled(wh%,ih%,action%)
 4108IF action%<>0 THEN action%=1<<5
 4109PROCshell_IconSetState(wh%,ih%,action%,1<<5)
 4110ENDPROC
 4111:
 4112*|Stop PROCshell_IconSetFilled
 4113
 4114*|Start PROCshell_IconSetRightJust
 4115DEF PROCshell_IconSetRightJust(wh%,ih%,action%)
 4116PROCshell_IconSetHCentred(wh%,ih%,0)
 4117IF action%<>0 THEN action%=1<<9
 4118PROCshell_IconSetState(wh%,ih%,action%,1<<9)
 4119ENDPROC
 4120:
 4121*|Stop PROCshell_IconSetRightJust
 4122
 4123*|Start PROCshell_IconSetLeftJust
 4124DEF PROCshell_IconSetLeftJust(wh%,ih%)
 4125PROCshell_IconSetHCentred(wh%,ih%,0)
 4126PROCshell_IconSetRightJust(wh%,ih%,0)
 4127ENDPROC
 4128:
 4129*|Stop PROCshell_IconSetLeftJust
 4130
 4131*|Start PROCshell_IconSetUnselectable
 4132DEF PROCshell_IconSetUnselectable(wh%,ih%,state%)
 4133LOCAL caret_blk%
 4134IF state%<>0 THEN state%=1<<22
 4135PROCshell_IconSetState(wh%,ih%,state%,1<<22)
 4136IF state%<>0 THEN
 4137  REM check if icon has the caret, lose it if it has..
 4138  caret_blk%=FNshell_HeapBlockFetch(24)
 4139  SYS "Wimp_GetCaretPosition",,caret_blk%
 4140  IF !caret_blk%=wh% AND caret_blk%!4=ih% THEN
 4141    SYS "Wimp_SetCaretPosition",-1
 4142  ENDIF
 4143  PROCshell_HeapBlockReturn(caret_blk%)
 4144ENDIF
 4145ENDPROC
 4146:
 4147*|Stop PROCshell_IconSetUnselectable
 4148
 4149*|Start PROCshell_CaretSetRight
 4150DEF PROCshell_CaretSetRight(wh%,ih%)
 4151SYS "Wimp_SetCaretPosition",wh%,ih%,-1,-1,-1,LEN(FNshell_IconGetData(wh%,ih%))
 4152ENDPROC
 4153:
 4154*|Stop PROCshell_CaretSetRight
 4155
 4156*|Start PROCprint_text
 4157DEF PROCprint_text(X,Y,text$)
 4158IF FNin(X,Y-32,X+16*LEN(text$),Y) THEN
 4159  MOVE X,Y
 4160  PRINT text$
 4161ENDIF
 4162ENDPROC
 4163:
 4164*|Stop PROCprint_text
 4165*|Start FNin
 4166DEF FNin(A%,B%,C%,D%)
 4167IF C%<gbx THEN =FALSE
 4168IF A%>gtx THEN =FALSE
 4169IF B%>gty THEN =FALSE
 4170IF D%<gby THEN =FALSE
 4171=TRUE
 4172:
 4173*|Stop FNin
 4174*|Start PROCnewvals
 4175DEF PROCnewvals
 4176gbx=_Q%!28:gby=_Q%!32
 4177gtx=_Q%!36:gty=_Q%!40
 4178wbx=_Q%!4:wby=_Q%!8
 4179wtx=_Q%!12:wty=_Q%!16
 4180xsc=_Q%!20:ysc=_Q%!24
 4181hp=wtx-wbx:vp=wty-wby:ebx=xsc
 4182etx=xsc+hp:ety=ysc:eby=ysc-vp
 4183ENDPROC
 4184:
 4185*|Stop PROCnewvals
 4186DEF FNmax(a%,b%)
 4187IF a%<b% THEN =b%
 4188=a%
 4189:
 4190*|Start FNshell_Leaf
 4191DEF FNshell_Leaf(path$)
 4192WHILE INSTR(path$,".")
 4193  path$=MID$(path$,INSTR(path$,".")+1)
 4194ENDWHILE
 4195=path$
 4196:
 4197*|Stop FNshell_Leaf
 4198*|Start FNshell_Branch
 4199DEF FNshell_Branch(fname$)
 4200LOCAL pos%,br$,temp%
 4201IF INSTR(fname$,".")=0 THEN
 4202  br$=""
 4203ELSE
 4204  temp%=0
 4205  REPEAT
 4206    pos%=temp%+1
 4207    temp%=INSTR(fname$,".",pos%)
 4208  UNTIL temp%=0
 4209  br$=LEFT$(fname$,pos%-2)
 4210ENDIF
 4211=br$
 4212:
 4213*|Stop FNshell_Branch
 4214*|Start FNgname
 4215DEF FNgname(ptr)
 4216f$=""
 4217WHILE ?ptr<>0 AND ?ptr<>13
 4218  f$=f$+CHR$?ptr:ptr+=1
 4219ENDWHILE
 4220=f$
 4221:
 4222*|Stop FNgname
 4223*|Start PROCshell_WindowResize
 4224DEF PROCshell_WindowResize(whandle%,bx%,by%,tx%,ty%,open%)
 4225!_Q%=bx%:_Q%!4=by%:_Q%!8=tx%:_Q%!12=ty%
 4226SYS "Wimp_SetExtent",whandle%,_Q%
 4227IF open% THEN
 4228  _Q%!0=whandle%
 4229  SYS "Wimp_GetWindowInfo",,_Q%
 4230  SYS "Wimp_OpenWindow",,_Q%
 4231ENDIF
 4232ENDPROC
 4233:
 4234*|Stop PROCshell_WindowResize
 4235
 4236*|Start PROCshell_WindowRetitle
 4237DEF PROCshell_WindowRetitle(RETURN whandle%,title$)
 4238LOCAL temp%,win_blk%,handle%,t_buffer_len%
 4239win_blk%   = FNshell_HeapBlockFetch(100 + (FNshell_WindowCountIcons(whandle%) * 32))
 4240win_blk%!0 = whandle%
 4241SYS "Wimp_GetWindowInfo",,win_blk%
 4242IF ((win_blk%!60) AND &100) = 0 THEN
 4243  REM window title is not indirected..
 4244  temp% = win_blk% + 76
 4245  $temp% = LEFT$(title$,11)
 4246  SYS "Wimp_DeleteWindow",,win_blk%
 4247  SYS "Wimp_CreateWindow",,win_blk% + 4 TO handle%
 4248  IF handle% <> whandle% THEN
 4249    REM Window handle has changed, update event data...
 4250    PROCshell_UpdateWindowHandle(whandle%,handle%)
 4251    whandle% = handle%
 4252  ENDIF
 4253ELSE
 4254  REM Window title is indirected, find buffer size..
 4255  t_buffer_len% = win_blk%!84
 4256  REM Truncate title if it won't fit the buffer...
 4257  $(!(win_blk% + 76)) = LEFT$(title$,t_buffer_len% - 1)
 4258  IF ((win_blk%!32) AND (1 << 16)) <> 0 THEN
 4259    REM Window is open, so redraw the title bar area...
 4260    SYS "Wimp_ForceRedraw",-1,win_blk%!4,win_blk%!16,win_blk%!12,win_blk%!16 + 44
 4261  ENDIF
 4262  PROCshell_HeapBlockReturn(win_blk%)
 4263ENDIF
 4264ENDPROC
 4265:
 4266*|Stop PROCshell_WindowRetitle
 4267
 4268*|Start FNshell_WindowTitleIndirected
 4269DEF FNshell_WindowTitleIndirected(flag%)
 4270IF (flag% AND (1<<8))=(1<<8) THEN =TRUE
 4271=FALSE
 4272:
 4273*|Stop FNshell_WindowTitleIndirected
 4274*|Start PROCshell_ScreenToWindowCoords
 4275DEF PROCshell_ScreenToWindowCoords(WHandle%,RETURN X%,RETURN Y%)
 4276LOCAL Temp%,WXMin%,WYMin%,XScroll%,YScroll%,Scratch%
 4277Scratch%=FNshell_HeapBlockFetch(100 + (FNshell_WindowCountIcons(WHandle%) * 32))
 4278Temp%=Scratch%
 4279!Temp%=WHandle%
 4280SYS "Wimp_GetWindowInfo",,Temp%
 4281WXMin%=Scratch%!4
 4282WYMax%=Scratch%!16
 4283XScroll%=Scratch%!20
 4284YScroll%=Scratch%!24
 4285X%=X%+(XScroll%-WXMin%)
 4286Y%=Y%+(YScroll%-WYMax%)
 4287PROCshell_HeapBlockReturn(Scratch%)
 4288ENDPROC
 4289:
 4290*|Stop PROCshell_ScreenToWindowCoords
 4291*|Start FNshell_WimpSlotReadEnd
 4292DEF FNshell_WimpSlotReadEnd
 4293LOCAL mem%
 4294SYS "Wimp_SlotSize",-1,-1 TO mem%
 4295=mem%
 4296:
 4297*|Stop FNshell_WimpSlotReadEnd
 4298*|Start FNshell_WimpSlotClaimMemory
 4299DEF FNshell_WimpSlotClaimMemory(mem%,size%)
 4300LOCAL ssize%
 4301SYS "Wimp_SlotSize",mem%+size%,-1 TO ssize%
 4302IF ssize%<mem%+size% THEN =-1
 4303= ssize%
 4304:
 4305*|Stop FNshell_WimpSlotClaimMemory
 4306*|Start PROCshell_WimpSlotReleaseMemory
 4307DEF PROCshell_WimpSlotReleaseMemory
 4308SYS "Wimp_SlotSize",mem%,-1
 4309ENDPROC
 4310:
 4311*|Stop PROCshell_WimpSlotReleaseMemory
 4312*|Start PROCshell_MouseLimit
 4313DEF PROCshell_MouseLimit(b,whandle%)
 4314b!0=whandle%:SYS "Wimp_GetWindowState",,b
 4315PROCmouse_rectangle(b!4,b!8,b!12-b!4,b!16-b!8)
 4316ENDPROC
 4317:
 4318*|Stop PROCshell_MouseLimit
 4319*|Start FNshell_NameOfFirstSprite
 4320DEF FNshell_NameOfFirstSprite(File$)
 4321LOCAL X%,N%,S$
 4322X%=OPENIN(File$)
 4323PTR#X%=4
 4324N%=BGET#X%
 4325N%+=BGET#X%*&100
 4326N%+=BGET#X%*&10000
 4327N%+=BGET#X%*&1000000
 4328PTR#X%=N%
 4329S$=""
 4330FOR N%=0 TO 11
 4331S$+=CHR$(BGET#X%)
 4332NEXT
 4333CLOSE#X%
 4334=S$
 4335:
 4336*|Stop FNshell_NameOfFirstSprite
 4337
 4338*|Start PROCInitialiseSpriteArea
 4339DEF PROCInitialiseSpriteArea(S%,Length%)
 4340!S%=Length%
 4341S%!8=16
 4342SYS "OS_SpriteOp",9+256,S%
 4343ENDPROC
 4344:
 4345*|Stop PROCInitialiseSpriteArea
 4346
 4347*|Start PROCshell_ListEvents
 4348DEF PROCshell_ListEvents(wh%,ic%)
 4349LOCAL menu%,menu$
 4350IF wh%=-1 THEN wh%=-2
 4351PROCshell_Tracef0("MenuSelection="+FNshell_GetEventHandler(wh%,ic%,0))
 4352PROCshell_Tracef0("MenuMaker    ="+FNshell_GetEventHandler(wh%,ic%,1))
 4353PROCshell_Tracef0("ClickSelect  ="+FNshell_GetEventHandler(wh%,ic%,2))
 4354PROCshell_Tracef0("ClickAdjust  ="+FNshell_GetEventHandler(wh%,ic%,3))
 4355PROCshell_Tracef0("Redraw       ="+FNshell_GetEventHandler(wh%,ic%,4))
 4356PROCshell_Tracef0("Keypress     ="+FNshell_GetEventHandler(wh%,ic%,5))
 4357PROCshell_Tracef0("Drag         ="+FNshell_GetEventHandler(wh%,ic%,6))
 4358PROCshell_Tracef0("Menu Warning ="+FNshell_GetEventHandler(wh%,ic%,7))
 4359PROCshell_Tracef0("HelpTag      ="+FNshell_GetEventHandler(wh%,ic%,8))
 4360menu%=FNshell_GetEventMenu(2,wh%,ic%)
 4361IF menu%=0 THEN
 4362  menu$="None"
 4363ELSE
 4364  menu$=STR$menu%
 4365ENDIF
 4366PROCshell_Tracef0("Menu handle =&"+menu$)
 4367ENDPROC
 4368*|Stop PROCshell_ListEvents
 4369
 4370REM ----------- Heap Manager Routines ------------------------------------
 4371
 4372REM Function to load heap manager machine code
 4373
 4374*|Start PROCshell_HeapManagerInit
 4375DEF PROCshell_HeapManagerInit(path$,space%)
 4376DIM _heap_code% 900
 4377OSCLI("LOAD "+path$+"heapcode "+STR$~_heap_code%)
 4378CALL _heap_code%+0,space%
 4379ENDPROC
 4380:
 4381*|Stop PROCshell_HeapManagerInit
 4382
 4383*|Start FNshell_HeapBlockExists
 4384DEF FNshell_HeapBlockExists(addr%)
 4385LOCAL void%
 4386LOCAL ERROR
 4387ON ERROR LOCAL:RESTORE ERROR:=FALSE
 4388IF addr%<&8000 THEN ERROR 99,"No heapblock defined at this address"
 4389void%=FNshell_HeapBlockInfo(addr%)
 4390RESTORE ERROR:=TRUE
 4391*|Stop FNshell_HeapBlockExists
 4392
 4393*|Start FNshell_HeapBlockExtend
 4394
 4395
 4396*|!Function to extend already allocated heap block.
 4397*|!a% = current address of block
 4398*|!b% = amount to increase or decrease block size by (-ve to decrease)
 4399*|!returns address of block (block may be moved)
 4400DEF FNshell_HeapBlockExtend(a%,b%)
 4401CALL _heap_code%+12,a%,b%
 4402=a%
 4403*|Stop FNshell_HeapBlockExtend
 4404
 4405*|Start FNshell_HeapBlockFetch
 4406*|!Function to allocate a block on the heap
 4407*|!a% = size of block to fetch from heap
 4408*|!returns address of allocated block
 4409DEF FNshell_HeapBlockFetch(a%)
 4410LOCAL addr%
 4411CALL _heap_code%+4,addr%,a%
 4412=addr%
 4413*|Stop FNshell_HeapBlockFetch
 4414
 4415*|Start PROCshell_HeapBlockReturn
 4416*|!Procedure to return a heap block to the heap
 4417*|!a% = address of block to deallocate
 4418DEF PROCshell_HeapBlockReturn(RETURN a%)
 4419IF FNshell_HeapBlockExists(a%) THEN CALL _heap_code%+8,a%
 4420a%=0
 4421ENDPROC
 4422*|Stop PROCshell_HeapBlockReturn
 4423
 4424*|Start FNshell_HeapBlockInfo
 4425*|!Function to return current length of a heap block
 4426*|!a% = addr of heap block
 4427DEF FNshell_HeapBlockInfo(a%)
 4428LOCAL r3
 4429SYS "OS_Heap",6,!(_heap_code%+28),a% TO ,,,r3
 4430=r3
 4431:
 4432*|Stop FNshell_HeapBlockInfo
 4433
 4434*|Start FNshell_OSVarExists
 4435DEF FNshell_OSVarExists(buffer%,varname$)
 4436LOCAL nr_bytes
 4437SYS "XOS_ReadVarVal",varname$,buffer%,-1,0,0 TO ,,nr_bytes
 4438IF nr_bytes<0 THEN =TRUE
 4439=FALSE
 4440:
 4441*|Stop FNshell_OSVarExists
 4442
 4443*|Start FNshell_OSVarGetVal
 4444DEF FNshell_OSVarGetVal(buffer%,size%,varname$,expand)
 4445LOCAL value$,nr_bytes,nameptr%
 4446SYS "XOS_ReadVarVal",varname$,buffer%,size%,0,-3*(expand=TRUE) TO ,,nr_bytes,nameptr%,type%
 4447FOR loop%=0 TO nr_bytes-1
 4448  value$=value$+CHR$(buffer%?loop%)
 4449NEXT loop%
 4450=value$
 4451:
 4452*|Stop FNshell_OSVarGetVal
 4453
 4454*|Start FNshell_OSReadCommandArg
 4455DEF FNshell_OSReadCommandArg(opt)
 4456LOCAL pointer%,command$,offset%
 4457command$="":offset%=0
 4458SYS "OS_GetEnv" TO pointer%
 4459WHILE pointer%?offset%<>0
 4460  command$+=CHR$(pointer%?offset%)
 4461  offset%+=1
 4462ENDWHILE
 4463CASE opt OF
 4464  WHEN 0
 4465  WHEN 1
 4466    command$=MID$(command$,INSTR(command$,CHR$34)+1)
 4467    command$=MID$(command$,INSTR(command$,CHR$34)+2)
 4468ENDCASE
 4469=command$
 4470:
 4471*|Stop FNshell_OSReadCommandArg
 4472
 4473*|Start FNshell_StringStripTrailing
 4474DEF FNshell_StringStripTrailing(string$,char$)
 4475WHILE RIGHT$(string$,1) = char$
 4476  string$ = LEFT$(string$,LEN(string$) - 1)
 4477ENDWHILE
 4478= string$
 4479:
 4480*|Stop FNshell_StringStripTrailing
 4481*|Start FNshell_StringStripLeading
 4482DEF FNshell_StringStripLeading(string$,char$)
 4483WHILE LEFT$(string$,1) = char$
 4484  string$ = MID$(string$,2)
 4485ENDWHILE
 4486= string$
 4487:
 4488*|Stop FNshell_StringStripLeading
 4489*|Start FNshell_StringStripAll
 4490DEF FNshell_StringStripAll(string$,char$)
 4491LOCAL done,pos
 4492done=TRUE
 4493REPEAT
 4494  pos=INSTR(string$,char$)
 4495  IF pos THEN
 4496    done=FALSE
 4497    string$=LEFT$(string$,pos-1)+MID$(string$,pos+1)
 4498  ELSE
 4499    done=TRUE
 4500  ENDIF
 4501UNTIL done
 4502=string$
 4503:
 4504*|Stop FNshell_StringStripAll
 4505
 4506*|Start FNshell_StringPadTrailing
 4507DEF FNshell_StringPadTrailing(string$,char$,length%)
 4508WHILE LEN(string$) < length%
 4509  string$ = string$ + STRING$(length% - LEN(string$),char$)
 4510ENDWHILE
 4511= string$
 4512:
 4513*|Stop FNshell_StringPadTrailing
 4514
 4515*|Start FNshell_StringPadLeading
 4516DEF FNshell_StringPadLeading(string$,char$,length%)
 4517WHILE LEN(string$) < length%
 4518  string$ = STRING$(length% - LEN(string$),char$) + string$
 4519ENDWHILE
 4520= string$
 4521:
 4522*|Stop FNshell_StringPadLeading
 4523
 4524*|Start FNshell_StringUpperCase
 4525DEF FNshell_StringUpperCase(string$)
 4526LOCAL loop%
 4527IF LEN(string$) > 0 THEN
 4528 FOR loop% = 1 TO LEN(string$)
 4529   IF MID$(string$,loop%,1)>="a" AND MID$(string$,loop%,1)<="z" THEN
 4530     MID$(string$,loop%,1) = CHR$(ASC(MID$(string$,loop%,1)) AND &DF)
 4531   ENDIF
 4532 NEXT loop%
 4533ENDIF
 4534= string$
 4535:
 4536*|Stop FNshell_StringUpperCase
 4537
 4538*|Start FNshell_StringExchange
 4539DEF FNshell_StringExchange(string$,target$,sub$)
 4540LOCAL index%
 4541IF  INSTR(string$,target$) THEN
 4542  index%=INSTR(string$,target$)
 4543  string$=LEFT$(string$,index%-1)+sub$+MID$(string$,index%+LENtarget$)
 4544ENDIF
 4545=string$
 4546:
 4547*|Stop FNshell_StringExchange
 4548*|Start FNshell_StringArrayGetLongest
 4549DEF FNshell_StringArrayGetLongest(array$(),nr%)
 4550LOCAL loop%,longest%
 4551longest% = 0
 4552FOR loop% = 0 TO nr%
 4553  IF LEN(array$(loop%)) > longest% THEN
 4554    longest% = LEN(array$(loop%))
 4555  ENDIF
 4556NEXT loop%
 4557= longest%
 4558:
 4559*|Stop FNshell_StringArrayGetLongest
 4560*|Start FNmem_to_string
 4561DEF FNmem_to_string(block%,offset%,term%)
 4562LOCAL string$
 4563WHILE block%?offset%<>term%
 4564  string$+=CHR$(block%?offset%)
 4565  offset%+=1
 4566ENDWHILE
 4567=string$
 4568:
 4569*|Stop FNmem_to_string
 4570
 4571*|Start FNshell_FileLength
 4572DEF FNshell_FileLength(object$)
 4573LOCAL type%,load_addr%,exec_addr%,length%,atts%,string$
 4574SYS "OS_File",5,object$ TO type%,,load_addr%,exec_addr%,length%,atts%
 4575=length%
 4576:
 4577*|Stop FNshell_FileLength
 4578
 4579*|Start PROCshell_TraceOn
 4580DEF PROCshell_TraceOn
 4581_U%!100 = _U%!100 OR 1 << 9
 4582PROCshell_BroadcastMessage(&43B00,"ShellDBug:TraceOn")
 4583ENDPROC
 4584:
 4585*|Stop PROCshell_TraceOn
 4586
 4587*|Start PROCshell_TraceOff
 4588DEF PROCshell_TraceOff
 4589IF (_U%!100 AND (1 << 9)) THEN _U%!100 = _U%!100 EOR (1 << 9)
 4590PROCshell_BroadcastMessage(&43B00,"ShellDBug:TraceOff")
 4591ENDPROC
 4592:
 4593*|Stop PROCshell_TraceOff
 4594
 4595*|Start PROCshell_TraceInit
 4596*|Define TraceInit
 4597DEF PROCshell_TraceInit(file$)
 4598LOCAL f%,blk%,shell_AppName$,shell_AppDir$
 4599IF file$<>"" THEN
 4600  f%=OPENOUT(file$)
 4601  _U%!44=f%
 4602ENDIF
 4603blk%=FNshell_HeapBlockFetch(256)
 4604shell_AppDir$=FNshell_OSVarGetVal(blk%,256,"Obey$Dir",1)
 4605shell_AppName$=MID$(FNshell_Leaf(shell_AppDir$),2)
 4606
 4607PROCshell_BroadcastMessage(&43B00,"ShellDBug:Init Debug messages from "+shell_AppName$)
 4608PROCshell_HeapBlockReturn(blk%)
 4609REM set bit 4 of shell flag word. If ShellDBug start up is detected then
 4610REM send init message again (ShellDBug was started after this task). Clear
 4611REM bit when ShellDBug sends its ack message.
 4612IF _U%!100 AND 1<<4 THEN
 4613ELSE
 4614  _U%!100=(_U%!100 EOR 1<<4)
 4615ENDIF
 4616ENDPROC
 4617:
 4618*|Stop PROCshell_TraceInit
 4619
 4620*|Start FNshell_TraceIsOn
 4621DEF FNshell_TraceIsOn
 4622IF _U%!100 AND (1 << 9) THEN = TRUE ELSE = FALSE
 4623:
 4624*|Stop FNshell_TraceIsOn
 4625
 4626*|Start PROCshell_Tracef0
 4627DEF PROCshell_Tracef0(a$)
 4628LOCAL f%
 4629IF NOT(FNshell_TraceIsOn) THEN ENDPROC
 4630IF _U%!44<>-1 THEN
 4631  f%=_U%!44
 4632  BPUT#f%,a$
 4633ENDIF
 4634REM check if task id has been set up...
 4635IF _U%!148>0 THEN
 4636  PROCshell_BroadcastMessage(&43B00,"ShellDBug:Trace "+a$)
 4637  REM PROCshell_EnsurePoll
 4638ENDIF
 4639ENDPROC
 4640:
 4641*|Stop PROCshell_Tracef0
 4642
 4643*|Start PROCshell_Tracef2
 4644DEF PROCshell_Tracef2(addr%)
 4645OSCLI("MEDIT "+STR$~addr%)
 4646ENDPROC
 4647:
 4648*|Stop PROCshell_Tracef2
 4649
 4650*|Start PROCshell_TraceExit
 4651DEF PROCshell_TraceExit
 4652IF _U%!44<>-1 THEN CLOSE#(_U%!44):_U%!44=-1
 4653REM _U%!44=-1:_U%!48=FALSE
 4654ENDPROC
 4655:
 4656*|Stop PROCshell_TraceExit
 4657
 4658*|Start PROCshell_AttachHotKey
 4659DEF PROCshell_AttachHotKey(key$,shift%,ctrl%,alt%,window$,wh%,fn1$,fn2$)
 4660LOCAL e_list%,offset%,temp%,temp2%,key%,f_key%
 4661f_key%=TRUE
 4662IF _U%!60=0 THEN
 4663  _U%!60=FNshell_HeapBlockFetch(24)
 4664  offset%=0:_U%!180=1
 4665ELSE
 4666  offset%=_U%!180*24
 4667  _U%!60=FNshell_HeapBlockExtend(_U%!60,24)
 4668  _U%!180=(_U%!180)+1
 4669ENDIF
 4670e_list%=_U%!60
 4671CASE key$ OF
 4672  WHEN "F1" :key%=385
 4673  WHEN "F2" :key%=386
 4674  WHEN "F3" :key%=387
 4675  WHEN "F4" :key%=388
 4676  WHEN "F5" :key%=389
 4677  WHEN "F6" :key%=390
 4678  WHEN "F7" :key%=391
 4679  WHEN "F8" :key%=392
 4680  WHEN "F9" :key%=393
 4681  WHEN "F10":key%=458
 4682  WHEN "F11":key%=459
 4683OTHERWISE
 4684  key%=(ASCkey$)-64:f_key%=FALSE
 4685ENDCASE
 4686IF f_key% THEN
 4687  IF shift% THEN key%+=16
 4688  IF ctrl%  THEN key%+=32
 4689ENDIF
 4690temp%=e_list%+offset%
 4691temp%!0=key%
 4692temp%?4=shift%:REM shift flag
 4693temp%?5=ctrl% :REM ctrl  flag
 4694temp%?6=alt%  :REM alt   flag
 4695temp%!8=FNshell_HeapBlockFetch(LENwindow$+1)
 4696temp2%=temp%!8:$temp2%=window$
 4697IF wh%>0 THEN
 4698  REM check window handle is in static list...
 4699  offset%=FNshell_SearchStatic(_U%!184,wh%)
 4700  IF offset%=-1 THEN ERROR 99,FNshell_MessageNoArgs("SHELLMSG09")
 4701ENDIF
 4702temp%!12=wh%:REM >0 denotes a window handle to open as static
 4703temp%!16=FNshell_HeapBlockFetch(LENfn1$+1)
 4704temp2%=temp%!16:$temp2%=fn1$
 4705temp%!20=FNshell_HeapBlockFetch(LENfn2$+1)
 4706temp2%=temp%!20:$temp2%=fn2$
 4707ENDPROC
 4708:
 4709*|Stop PROCshell_AttachHotKey
 4710
 4711*|Start FNshell_HotKeyProcess
 4712DEF FNshell_HotKeyProcess(key%)
 4713LOCAL e_list%,list_size%,found%,ptr%,h%,win$,fn1$,fn2$
 4714LOCAL ctrl%,shift%,alt%,x_off%,y_off%,flag%,key_flags%,offset%
 4715LOCAL result%,win_blk%
 4716e_list%=_U%!60
 4717list_size%=_U%!180*24
 4718found%=FALSE:ptr%=0
 4719REPEAT
 4720  IF e_list%!ptr%=key% THEN
 4721    found%=TRUE
 4722  ELSE
 4723    ptr%+=24
 4724  ENDIF
 4725UNTIL found% OR ptr%>=list_size%
 4726IF found% THEN
 4727  temp%=e_list%+ptr%
 4728  win$=$(temp%!8)
 4729*|ifdef TraceInit
 4730  PROCshell_Tracef0("HotKeyProcess:Template name is '"+win$+"'")
 4731*|endif
 4732  IF (win$<>"" AND temp%!12=0) THEN
 4733    REM only create a window if it is a dynamic one
 4734    REM static windows have already been created
 4735    PROCshell_CreateWindow(win$,h%)
 4736*|ifdef TraceInit
 4737    PROCshell_Tracef0("HotKeyProcess:Creating new dynamic window (handle is &"+STR$~h%+")")
 4738*|endif
 4739    win_blk%=FNshell_HeapBlockFetch(36)
 4740    win_blk%!0=h%
 4741    SYS "Wimp_GetWindowState",,win_blk%
 4742    x_off%=(win_blk%!4-win_blk%!12)/2
 4743    y_off%=(win_blk%!16-win_blk%!8)/2
 4744    PROCshell_HeapBlockReturn(win_blk%)
 4745  ENDIF
 4746  fn1$=$(temp%!16)
 4747  IF fn1$<>"" THEN
 4748*|ifdef TraceInit
 4749    PROCshell_Tracef0("HotKeyProcess:Calling Pre-Open FN '"+fn1$+"'")
 4750*|endif
 4751    IF temp%!12>0 THEN
 4752      void%=EVAL("FN"+fn1$+"("+STR$temp%!12+")")
 4753    ELSE
 4754      void%=EVAL("FN"+fn1$+"("+STR$h%+")")
 4755    ENDIF
 4756  ELSE
 4757*|ifdef TraceInit
 4758  PROCshell_Tracef0("HotKeyProcess:No Pre-Open FN registered")
 4759*|endif
 4760  ENDIF
 4761    offset%=FNshell_SearchStatic(_U%!184,temp%!12)
 4762    IF offset%>-1 THEN
 4763      PROCshell_OpenWindowStatic(temp%!12)
 4764    ELSE
 4765      IF temp%!12>0 THEN
 4766        REM request to open a static window, but window handle
 4767        REM has not been registered with shell_CreateWindowStatic
 4768        ERROR 99,FNshell_MessageNoArgs("SHELLMSG09")
 4769      ELSE
 4770        REM must be a dynamic window then...
 4771        PROCshell_OpenWindowDynamic2(h%,x_off%,y_off%)
 4772      ENDIF
 4773    ENDIF
 4774  fn2$=$(temp%!20)
 4775  IF fn2$<>"" THEN
 4776*|ifdef TraceInit
 4777    PROCshell_Tracef0("HotKeyProcess:Calling Post-Open FN '"+fn2$+"'")
 4778*|endif
 4779    IF temp%!12>0 THEN
 4780      void%=EVAL("FN"+fn1$+"("+STR$temp%!12+")")
 4781    ELSE
 4782      void%=EVAL("FN"+fn2$+"("+STR$h%+")")
 4783    ENDIF
 4784  ELSE
 4785*|ifdef TraceInit
 4786    PROCshell_Tracef0("HotKeyProcess:No Post-Open FN registered")
 4787*|endif
 4788  ENDIF
 4789  result%=TRUE
 4790ELSE
 4791  win$="":fn1$="":fn2$="":result%=FALSE
 4792ENDIF
 4793=result%
 4794:
 4795*|Stop FNshell_HotKeyProcess
 4796
 4797*|Start PROCshell_WindowCentreOnPointer
 4798DEF PROCshell_WindowCentreOnPointer(h%)
 4799LOCAL w_blk%,p_blk%,x_off%,y_off%
 4800p_blk%   = FNshell_HeapBlockFetch(20)
 4801SYS "Wimp_GetPointerInfo",,p_blk%
 4802win_blk% = FNshell_HeapBlockFetch(36)
 4803win_blk%!0 = h%
 4804SYS "Wimp_GetWindowState",,win_blk%
 4805x_off% = (win_blk%!04 - win_blk%!12) / 2
 4806y_off% = (win_blk%!16 - win_blk%!08) / 2
 4807PROCshell_WindowMoveTo(h%,p_blk%!0 + x_off%,p_blk%!4 - y_off%)
 4808PROCshell_HeapBlockReturn(win_blk%)
 4809PROCshell_HeapBlockReturn(p_blk%)
 4810ENDPROC
 4811:
 4812*|Stop PROCshell_WindowCentreOnPointer
 4813
 4814*|Start PROCshell_WindowCentreOnScreen
 4815DEF PROCshell_WindowCentreOnScreen(h%)
 4816LOCAL w_blk%,scrn_xmax%,scrn_ymax%,width%,height%,XEigFactor%,YEigFactor%
 4817SYS "XOS_ReadModeVariable",-1,04 TO ,,XEigFactor%
 4818SYS "XOS_ReadModeVariable",-1,05 TO ,,YEigFactor%
 4819SYS "XOS_ReadModeVariable",-1,11 TO ,,scrn_xmax%
 4820SYS "XOS_ReadModeVariable",-1,12 TO ,,scrn_ymax%
 4821scrn_xmax% = scrn_xmax% << XEigFactor%:REM Convert pixels to screen coords..
 4822scrn_ymax% = scrn_ymax% << YEigFactor%:REM Convert pixels to screen coords..
 4823win_blk%   = FNshell_HeapBlockFetch(36)
 4824win_blk%!0 = h%
 4825SYS "Wimp_GetWindowState",,win_blk%
 4826width%  = (win_blk%!12 - win_blk%!04)
 4827height% = (win_blk%!16 - win_blk%!08)
 4828PROCshell_WindowMoveTo(h%,(scrn_xmax% / 2) - (width% / 2),(scrn_ymax% - height%) / 2)
 4829PROCshell_HeapBlockReturn(win_blk%)
 4830ENDPROC
 4831:
 4832*|Stop PROCshell_WindowCentreOnScreen
 4833
 4834*|Start PROCshell_OpenWindowStaticNewView
 4835DEF PROCshell_OpenWindowStaticNewView(wh%)
 4836PROCshell_OpenWindow(wh%,FALSE,-1)
 4837ENDPROC
 4838:
 4839*|Stop PROCshell_OpenWindowStaticNewView
 4840
 4841*|Start PROCshell_OpenWindowStatic
 4842DEF PROCshell_OpenWindowStatic(handle%)
 4843IF FNshell_SearchStatic(_U%!184,handle%) > -1 THEN
 4844  PROCshell_OpenWindow(handle%,0,-1)
 4845ELSE
 4846  REM ERROR 99,FNshell_MessageNoArgs("SHELLMSG09")
 4847ENDIF
 4848ENDPROC
 4849:
 4850*|Stop PROCshell_OpenWindowStatic
 4851
 4852*|Start FNshell_SearchStatic
 4853DEF FNshell_SearchStatic(w_list%,handle%)
 4854REM search static window list by window handle
 4855LOCAL found%,ctr%
 4856found% = -1:ctr% = 0
 4857IF handle% < 0 THEN = 0 :REM Iconbar, must be static!
 4858REM PROCshell_Tracef0("DEBUG::old handle = &"+STR$~handle%)
 4859IF w_list% <> 0 THEN
 4860  WHILE w_list%!ctr% <> -1
 4861    REM PROCshell_Tracef0("DEBUG::searching.. handle is &"+STR$~(w_list%!ctr%))
 4862    IF w_list%!ctr% = handle% THEN
 4863      found% = ctr%
 4864      REM PROCshell_Tracef0("DEBUG::found...")
 4865      = found%
 4866    ENDIF
 4867    ctr% += 4
 4868  ENDWHILE
 4869ENDIF
 4870=found%
 4871:
 4872*|Stop FNshell_SearchStatic
 4873
 4874*|Start PROCshell_CreateWindowStatic
 4875DEF PROCshell_CreateWindowStatic(ident$,RETURN handle%)
 4876LOCAL wb_ptr%,w_list%,temp%,offset%
 4877wb_ptr%=FNshell_GetWB(ident$)
 4878REM set 'sprite area' pointer to usersprites area
 4879wb_ptr%!64=_U%!16
 4880SYS "Wimp_CreateWindow",,wb_ptr% TO handle%
 4881w_list%=_U%!184
 4882IF w_list%=0 THEN
 4883  REM empty list
 4884*|ifdef TraceInit
 4885  PROCshell_Tracef0("CreateWindowStatic:Empty List")
 4886*|endif
 4887  _U%!184=FNshell_HeapBlockFetch(8)
 4888  w_list%=_U%!184
 4889  w_list%!0=handle%:w_list%!4=-1
 4890ELSE
 4891  REM search list for window handle
 4892*|ifdef TraceInit
 4893  PROCshell_Tracef0("CreateWindowStatic:Searching for window handle")
 4894*|endif
 4895  offset%=FNshell_SearchStatic(_U%!184,handle%)
 4896  IF offset%=-1 THEN
 4897    REM add window handle to static list
 4898*|ifdef TraceInit
 4899  PROCshell_Tracef0("CreateWindowStatic:Not found - adding window handle to list")
 4900*|endif
 4901    offset%=FNshell_SearchStatic(_U%!184,0)
 4902    IF offset%=-1 THEN
 4903*|ifdef TraceInit
 4904  PROCshell_Tracef0("CreateWindowStatic:Extending window handle list")
 4905*|endif
 4906      ctr%=0
 4907      WHILE w_list%!ctr%<>-1
 4908        ctr%+=4
 4909      ENDWHILE
 4910      _U%!184=FNshell_HeapBlockExtend(_U%!184,4)
 4911      w_list%=_U%!184
 4912    ELSE
 4913*|ifdef TraceInit
 4914  PROCshell_Tracef0("CreateWindowStatic:Found unused space in list")
 4915*|endif
 4916      ctr%=offset%
 4917    ENDIF
 4918    temp%=w_list%+ctr%
 4919    temp%!0=handle%:temp%!4=-1
 4920  ENDIF
 4921ENDIF
 4922ENDPROC
 4923:
 4924*|Stop PROCshell_CreateWindowStatic
 4925
 4926*|Start PROCshell_InitHelpSystem
 4927DEF PROCshell_InitHelpSystem(path$,die%)
 4928LOCAL tail$,pos%,OSVarBuff%,respath$,help_found%,abort%
 4929_U%!212 = 0:IF _U%!216 <> 0 THEN PROCshell_HeapBlockReturn(_U%!216)
 4930_U%!216 = 0:REM clear pending command buffer...
 4931PROCshell_ScanForHelp:REM check if StrongHlp is running...
 4932IF die% THEN tail$ = " -DieWithTask" ELSE tail$=""
 4933IF _U%!100 AND 1 << 3 THEN
 4934  REM ResFind initialised, check ResPath..
 4935  path$      = ""
 4936  OSVarBuff% = FNshell_HeapBlockFetch(256)
 4937  respath$   = FNshell_OSVarGetVal(OSVarBuff%,256,FNshell_GetAppName+"Res$Path",-1)
 4938  PROCshell_HeapBlockReturn(OSVarBuff%)
 4939  REPEAT
 4940    pos% = INSTR(respath$,",")
 4941    IF pos% > 0 THEN
 4942      IF FNshell_FileExists(LEFT$(respath$,pos% - 1) + FNshell_GetAppName) THEN
 4943        path$ = LEFT$(respath$,pos% - 1) + FNshell_GetAppName
 4944        IF FNshell_StrongHlpChkFiles(path$) THEN help_found% = TRUE
 4945      ELSE
 4946        respath$ = MID$(respath$,pos% + 1)
 4947      ENDIF
 4948    ELSE
 4949      IF FNshell_FileExists(respath$ + FNshell_GetAppName) THEN
 4950        path$ = respath$ + FNshell_GetAppName
 4951        IF FNshell_StrongHlpChkFiles(path$) THEN help_found% = TRUE
 4952      ELSE
 4953        abort% = TRUE
 4954        PROCshell_OK(FNshell_MessageOneArg("SHELLMSG26",FNshell_GetAppName))
 4955      ENDIF
 4956    ENDIF
 4957  UNTIL path$ <> "" OR help_found% OR abort%
 4958ELSE
 4959  REM ResFind not being used..
 4960  IF FNshell_FileExists(path$) THEN
 4961    REM Directory exists, check if files do..
 4962    IF NOT FNshell_StrongHlpChkFiles(path$) THEN abort% = TRUE
 4963  ELSE
 4964     ERROR 99,FNshell_MessageOneArg("SHELLMSG33",path$)
 4965  ENDIF
 4966ENDIF
 4967IF abort% = 0 THEN
 4968  PROCshell_StrongHlpMsg("Help_Install " + path$ + tail$)
 4969  _U%!100 = _U%!100 OR 1 << 7
 4970ENDIF
 4971ENDPROC
 4972:
 4973*|Stop PROCshell_InitHelpSystem
 4974
 4975*|Start PROCshell_HelpWord
 4976DEF PROCshell_HelpWord(word$)
 4977LOCAL read%,temp%,buff%
 4978buff%=FNshell_HeapBlockFetch(512)
 4979IF _U%!208 = -1 THEN
 4980  REM  StrongHelp is not loaded. Try to run it..
 4981  IF FNshell_OSVarExists(buff%,"StrongHelp$Dir") THEN
 4982    REM Variable exists, so attempt to run StrongHlp..
 4983    SYS "XWimp_StartTask","<StrongHelp$Dir>"
 4984    IF _U%!216<>0 THEN PROCshell_HeapBlockReturn(_U%!216)
 4985    _U%!216=FNshell_HeapBlockFetch(LENword$+1)
 4986    temp%=_U%!216
 4987    $temp%=word$
 4988  ELSE
 4989    REM It doesn't, so complain, but first release buffer as an
 4990    REM error is about to be generated..
 4991    PROCshell_HeapBlockReturn(buff%)
 4992    PROCshell_OK(FNshell_MessageNoArgs("SHELLMSG11"))
 4993  ENDIF
 4994ELSE
 4995  PROCshell_StrongHlpMsg("Help_Word "+word$)
 4996ENDIF
 4997PROCshell_HeapBlockReturn(buff%)
 4998ENDPROC
 4999:
 5000*|Stop PROCshell_HelpWord
 5001
 5002*|Start PROCshell_StrongHlpMsg
 5003DEF PROCshell_StrongHlpMsg(msg$)
 5004PROCshell_BroadcastMessage(&43B00,msg$)
 5005ENDPROC
 5006:
 5007*|Stop PROCshell_StrongHlpMsg
 5008*|Start PROCshell_ScanForHelp
 5009DEF PROCshell_ScanForHelp
 5010LOCAL wrk%,owner_taskhandle%
 5011wrk%=FNshell_HeapBlockFetch(256):REM block for messages
 5012REM  Finds out if StrongHelp is already running.
 5013REM  Does this by scanning the tasks installed on the iconbar..
 5014REM  This again is done by getting the task's handle, and sending a
 5015REM  sending a TaskNameRq to the taskhandler. When this returns
 5016REM  (as a TaskNameIs message) we compare the string with "StrongHelp".
 5017REM  If not equal, this routine is called again to check next icon..
 5018
 5019REPEAT
 5020  REM  This Wimp_SendMessage does *not* send a message to the owner of
 5021  REM  the icon. It merely returns the taskhandle of the owner.
 5022  wrk%!12 = 0
 5023  SYS "Wimp_SendMessage",19,wrk%,-2,_U%!212 TO ,,owner_taskhandle%
 5024  _U%!212=_U%!212+1:REM icontry%
 5025UNTIL owner_taskhandle% <> -1 OR (_U%!212) > 64
 5026
 5027IF owner_taskhandle% <> -1 THEN
 5028  REM Send request for name of this task.
 5029  wrk%!0  = 24
 5030  wrk%!12 = 0
 5031  wrk%!16 = &400C6
 5032  wrk%!20 = owner_taskhandle%
 5033  SYS "Wimp_SendMessage",17,wrk%,0
 5034ENDIF
 5035PROCshell_HeapBlockReturn(wrk%)
 5036ENDPROC
 5037:
 5038*|Stop PROCshell_ScanForHelp
 5039
 5040*|Start PROCshell_BroadcastMessage
 5041DEF PROCshell_BroadcastMessage(reason_code%,msg$)
 5042LOCAL m_blk%,m_len%
 5043m_len% = (LENmsg$ + 30) AND NOT 3
 5044m_blk% = FNshell_HeapBlockFetch(m_len%)
 5045m_blk%!12 = 0
 5046m_blk%!16 = reason_code%
 5047$(m_blk% + 20) = msg$ + CHR$(0)
 5048m_blk%!0 = m_len%
 5049REM use XSWI in case error occurs between trace init call and wimp init
 5050REM call - can't broadcast unless we have launched the wimp task..
 5051SYS "XWimp_SendMessage",17,m_blk%,0:REM broadcast message
 5052PROCshell_HeapBlockReturn(m_blk%)
 5053ENDPROC
 5054:
 5055*|Stop PROCshell_BroadcastMessage
 5056
 5057*|Start PROCshell_WindowToggleBackIcon
 5058DEF PROCshell_WindowToggleBackIcon(RETURN wh%)
 5059PROCshell_WindowToggleFlags(wh%,1<<24)
 5060ENDPROC
 5061:
 5062*|Stop PROCshell_WindowToggleBackIcon
 5063*|Start PROCshell_WindowToggleCloseIcon
 5064DEF PROCshell_WindowToggleCloseIcon(RETURN wh%)
 5065PROCshell_WindowToggleFlags(wh%,1<<25)
 5066ENDPROC
 5067:
 5068*|Stop PROCshell_WindowToggleCloseIcon
 5069*|Start PROCshell_WindowToggleTitleBar
 5070DEF PROCshell_WindowToggleTitleBar(RETURN wh%)
 5071PROCshell_WindowToggleFlags(wh%,1<<26)
 5072ENDPROC
 5073:
 5074*|Stop PROCshell_WindowToggleTitleBar
 5075*|Start PROCshell_WindowToggleToggleIcon
 5076DEF PROCshell_WindowToggleToggleIcon(RETURN wh%)
 5077PROCshell_WindowToggleFlags(wh%,1<<27)
 5078ENDPROC
 5079:
 5080*|Stop PROCshell_WindowToggleToggleIcon
 5081*|Start PROCshell_WindowToggleHScrollBar
 5082DEF PROCshell_WindowToggleHScrollBar(RETURN wh%)
 5083PROCshell_WindowToggleFlags(wh%,1<<30)
 5084ENDPROC
 5085:
 5086*|Stop PROCshell_WindowToggleHScrollBar
 5087*|Start PROCshell_WindowToggleAdjustSizeIcon
 5088DEF PROCshell_WindowToggleAdjustSizeIcon(RETURN wh%)
 5089PROCshell_WindowToggleFlags(wh%,1<<29)
 5090ENDPROC
 5091:
 5092*|Stop PROCshell_WindowToggleAdjustSizeIcon
 5093*|Start PROCshell_WindowToggleVScrollBar
 5094DEF PROCshell_WindowToggleVScrollBar(RETURN wh%)
 5095PROCshell_WindowToggleFlags(wh%,1<<28)
 5096ENDPROC
 5097:
 5098*|Stop PROCshell_WindowToggleVScrollBar
 5099
 5100*|Start PROCshell_WindowToggleFlags
 5101DEF PROCshell_WindowToggleFlags(RETURN wh%,mask%)
 5102LOCAL blk%,flags%,open%,handle%
 5103*|ifdef TraceInit
 5104PROCshell_Tracef0("WindowToggleFlags:wh%=&"+STR$~wh%)
 5105*|endif
 5106open%=FNshell_WindowIsOpen(wh%)
 5107blk%=FNshell_HeapBlockFetch(100 + (FNshell_WindowCountIcons(wh%) * 32))
 5108blk%!0=wh%
 5109SYS "Wimp_GetWindowInfo",,blk%
 5110flags%=blk%!32
 5111flags%=(flags% EOR mask%)
 5112blk%!32=flags%
 5113SYS "Wimp_DeleteWindow",,blk%
 5114SYS "Wimp_CreateWindow",,blk%+4 TO handle%
 5115!blk%=handle%
 5116IF open% THEN
 5117  REM If window was open, open it again..
 5118  SYS "Wimp_OpenWindow",,blk%
 5119ENDIF
 5120PROCshell_HeapBlockReturn(blk%)
 5121IF handle%<>wh% THEN
 5122  PROCshell_UpdateWindowHandle(wh%,handle%)
 5123  wh%=handle%
 5124ENDIF
 5125ENDPROC
 5126:
 5127*|Stop PROCshell_WindowToggleFlags
 5128
 5129*|Start PROCshell_ListClickSelect
 5130DEF PROCshell_ListClickSelect
 5131LOCAL e_list%,ptr%,list_size%,temp%,temp2%
 5132e_list%=_U%!12
 5133list_size%=FNshell_HeapBlockInfo(e_list%)
 5134*|ifdef TraceInit
 5135PROCshell_Tracef0(" ")
 5136PROCshell_Tracef0("List of ClickSelect events:")
 5137*|endif
 5138ptr%=0
 5139REPEAT
 5140  temp%=e_list%!(ptr%+20):temp2%=e_list%+ptr%
 5141  IF FNshell_HeapBlockExists(temp%) THEN
 5142    IF $temp%<>"" THEN
 5143*|ifdef TraceInit
 5144  PROCshell_Tracef0("&"+FNshell_StringPadTrailing(STR$~temp2%!0," ",8)+" &"+FNshell_StringPadTrailing(STR$~temp2%!4," ",8)+"   "+$temp%)
 5145*|endif
 5146    ENDIF
 5147  ENDIF
 5148  ptr%+=48
 5149UNTIL (ptr%>=list_size%)
 5150*|ifdef TraceInit
 5151PROCshell_Tracef0(" ")
 5152*|endif
 5153ENDPROC
 5154:
 5155*|Stop PROCshell_ListClickSelect
 5156*|Start PROCshell_ListClickAdjust
 5157DEF PROCshell_ListClickAdjust
 5158LOCAL e_list%,ptr%,list_size%,temp%,temp2%
 5159e_list%=_U%!12
 5160list_size%=FNshell_HeapBlockInfo(e_list%)
 5161*|ifdef TraceInit
 5162PROCshell_Tracef0(" ")
 5163PROCshell_Tracef0("List of ClickAdjust events:")
 5164*|endif
 5165ptr%=0
 5166REPEAT
 5167  temp%=e_list%!(ptr%+24):temp2%=e_list%+ptr%
 5168  IF FNshell_HeapBlockExists(temp%) THEN
 5169    IF $temp%<>"" THEN
 5170*|ifdef TraceInit
 5171  PROCshell_Tracef0("&"+FNshell_StringPadTrailing(STR$~temp2%!0," ",8)+" &"+FNshell_StringPadTrailing(STR$~temp2%!4," ",8)+"   "+$temp%)
 5172*|endif
 5173    ENDIF
 5174  ENDIF
 5175  ptr%+=48
 5176UNTIL (ptr%>=list_size%)
 5177*|ifdef TraceInit
 5178PROCshell_Tracef0(" ")
 5179*|endif
 5180ENDPROC
 5181:
 5182*|Stop PROCshell_ListClickAdjust
 5183*|Start PROCshell_ListHelpTags
 5184DEF PROCshell_ListHelpTags
 5185LOCAL e_list%,ptr%,list_size%,temp%,temp2%
 5186e_list%=_U%!12
 5187list_size%=FNshell_HeapBlockInfo(e_list%)
 5188*|ifdef TraceInit
 5189PROCshell_Tracef0(" ")
 5190PROCshell_Tracef0("List of attached help tags:")
 5191*|endif
 5192ptr%=0
 5193REPEAT
 5194  temp%=e_list%!(ptr%+44):temp2%=e_list%+ptr%
 5195  IF FNshell_HeapBlockExists(temp%) THEN
 5196    IF $temp%<>"" THEN
 5197*|ifdef TraceInit
 5198  PROCshell_Tracef0("&"+FNshell_StringPadTrailing(STR$~temp2%!0," ",8)+" &"+FNshell_StringPadTrailing(STR$~temp2%!4," ",8)+"   "+$temp%)
 5199*|endif
 5200    ENDIF
 5201  ENDIF
 5202  ptr%+=48
 5203UNTIL (ptr%>=list_size%)
 5204*|ifdef TraceInit
 5205PROCshell_Tracef0(" ")
 5206*|endif
 5207ENDPROC
 5208:
 5209*|Stop PROCshell_ListHelpTags
 5210*|Start PROCshell_MemFill
 5211DEF PROCshell_MemFill(start%,nr_bytes%,value%)
 5212LOCAL I%,nr_words%,remainder%
 5213nr_words%=nr_bytes% DIV 4
 5214remainder%=nr_bytes% MOD 4
 5215IF nr_words%>0 THEN
 5216  FOR I%=1 TO (nr_words%*4) STEP 4
 5217    start%!(I%-1)=value%
 5218  NEXT I%
 5219ENDIF
 5220IF remainder%>0 THEN
 5221  start%=start%+(nr_words%*4)
 5222  FOR I%=0 TO remainder%-1
 5223    start%?I%=value%
 5224  NEXT I%
 5225ENDIF
 5226ENDPROC
 5227:
 5228*|Stop PROCshell_MemFill
 5229
 5230*|Start PROCshell_AttachFontMenu
 5231*|Define Using_FontMenu
 5232DEF PROCshell_AttachFontMenu(wh%,ih%,sel_fn$,maker_fn$)
 5233LOCAL menu%
 5234PROCshell_FontMenuInit
 5235SYS "FontMenu_Select",""+CHR$0,_U%!260 TO ,menu%
 5236REM Store menu ptr in shell memory..
 5237_U%!252=menu%
 5238PROCshell_EventAdd(wh%,ih%,0,-2,sel_fn$)
 5239*|ifdef PROCshell_TraceInit
 5240PROCshell_Tracef0("AttachFontMenu:Attaching font menu")
 5241*|endif
 5242IF maker_fn$<>"" THEN PROCshell_AttachMenuMaker(wh%,ih%,maker_fn$)
 5243ENDPROC
 5244:
 5245*|Stop PROCshell_AttachFontMenu
 5246
 5247*|Start PROCshell_AttachFontSubMenu
 5248*|Define Using_FontMenu
 5249DEF PROCshell_AttachFontSubMenu(item%,warn_fn$,sel_fn$)
 5250LOCAL itemstart%,menu%,temp%,ctr%
 5251PROCshell_FontMenuInit
 5252SYS "FontMenu_Select",""+CHR$0,_U%!260 TO ,menu%
 5253SYS "MenuUtil_SubMenu",item%,menu%
 5254SYS "MenuUtil_Warning",,TRUE
 5255REM Store menu ptr in shell memory..
 5256_U%!252=menu%
 5257PROCshell_EventListMenuWarn(item%,menu%,warn_fn$,sel_fn$)
 5258*|ifdef PROCshell_TraceInit
 5259PROCshell_Tracef0("AttachFontSubMenu:Attaching font menu &"+STR$~menu%)
 5260*|endif
 5261ENDPROC
 5262:
 5263*|Stop PROCshell_AttachFontSubMenu
 5264
 5265*|Start PROCshell_FontMenuInit
 5266DEF PROCshell_FontMenuInit
 5267OSCLI ("RMEnsure FontMenu 1.16 RMLoad <EvntShell$Path>FontMenu")
 5268OSCLI ("RMEnsure FontMenu 1.16 Error Couldn't load FontMenu module")
 5269IF _U%!240=-1 THEN
 5270  REM The above flag ensures that the library knows that "FontMenu_Create"
 5271  REM has been called. It should only be called once in a program as it
 5272  REM registers the program as a FontMenu module user..
 5273  SYS "FontMenu_Create" TO _U%!240
 5274ENDIF
 5275PROCshell_FontMenuSelectFont("",TRUE)
 5276ENDPROC
 5277:
 5278*|Stop PROCshell_FontMenuInit
 5279*|Start PROCshell_FontMenuSelectFont
 5280DEF PROCshell_FontMenuSelectFont(fontname$,systemfont%)
 5281LOCAL temp%,f_menu%
 5282IF FNshell_HeapBlockExists(_U%!244) THEN PROCshell_HeapBlockReturn(_U%!244)
 5283_U%!244=FNshell_HeapBlockFetch(LENfontname$+1)
 5284temp%=_U%!244:$temp%=fontname$
 5285IF systemfont%<>0 THEN systemfont%=1
 5286_U%!260=systemfont%
 5287SYS "FontMenu_Select",fontname$,_U%!260 TO ,f_menu%
 5288IF f_menu%<>_U%!252 THEN
 5289  REM FontMenu ptr has changed..
 5290  PROCshell_FontMenuUpdatePtr(f_menu%)
 5291  _U%!252=f_menu%
 5292ENDIF
 5293*|ifdef TraceInit
 5294PROCshell_Tracef0("FontMenuSelectFont:Font is '"+fontname$+"'")
 5295*|endif
 5296ENDPROC
 5297:
 5298*|Stop PROCshell_FontMenuSelectFont
 5299*|Start FNshell_FontMenuGetLastSelectedFont
 5300DEF FNshell_FontMenuGetLastSelectedFont
 5301LOCAL temp%
 5302IF NOT FNshell_HeapBlockExists(_U%!244) THEN  =""
 5303temp%=_U%!244:=$temp%
 5304:
 5305*|Stop FNshell_FontMenuGetLastSelectedFont
 5306
 5307*|Start PROCshell_FontMenuUpdatePtr
 5308DEF PROCshell_FontMenuUpdatePtr(ptr%)
 5309LOCAL e_list%,ctr%
 5310*|ifdef TraceInit
 5311PROCshell_Tracef0("FontMenuUpdatePtr:Started..")
 5312*|endif
 5313IF FNshell_HeapBlockExists(_U%!220) THEN
 5314*|ifdef TraceInit
 5315  PROCshell_Tracef0("FontMenuUpdatePtr:HeapBlock found..")
 5316*|endif
 5317  e_list%=_U%!220:ctr%=0
 5318  REPEAT
 5319*|ifdef TraceInit
 5320  PROCshell_Tracef0("FontMenuUpdatePtr:Substituting ptr..")
 5321*|endif
 5322    e_list%!(ctr%+8)=ptr%
 5323    ctr%+=12
 5324  UNTIL e_list%!ctr%=-1
 5325ENDIF
 5326ENDPROC
 5327:
 5328*|Stop PROCshell_FontMenuUpdatePtr
 5329
 5330*|Start PROCshell_MenuUpdateHandle
 5331DEF PROCshell_MenuUpdateHandle(old_h%,new_h%)
 5332LOCAL list_size%,ptr%,event_list%,menu%
 5333list_size%=FNshell_HeapBlockInfo(_U%!12)-8
 5334ptr%=0
 5335found%=FALSE
 5336event_list%=_U%!12
 5337REPEAT
 5338  menu%=event_list%!(ptr% + 8)
 5339  IF menu% = old_h% THEN event_list%!(ptr% + 8) = new_h%
 5340  ptr%+=48
 5341UNTIL (ptr% >= list_size%)
 5342IF _U%!24 = old_h% THEN _U%!24 = new_h%
 5343ENDPROC
 5344*|Stop PROCshell_MenuUpdateHandle
 5345
 5346*|Start PROCshell_FindFont
 5347DEF PROCshell_FindFont(RETURN font$,x_pt%,y_pt%,RETURN font_handle%)
 5348IF NOT FNshell_FontIsAvailable(font$,x_pt%,y_pt%) THEN
 5349  font$="Trinity.Medium"
 5350ENDIF
 5351SYS "Font_FindFont",,font$,x_pt%*16,y_pt%*16,0,0 TO font_handle%
 5352ENDPROC
 5353:
 5354*|Stop PROCshell_FindFont
 5355
 5356*|Start FNshell_FontIsAvailable
 5357DEF FNshell_FontIsAvailable(font$,x_pt%,y_pt%)
 5358LOCAL ERROR
 5359ON ERROR LOCAL:RESTORE ERROR:=FALSE
 5360SYS "Font_FindFont",0,font$,x_pt%*16,y_pt%*16,0,0 TO font_handle%
 5361SYS "Font_LoseFont",font_handle%
 5362=TRUE
 5363:
 5364*|Stop FNshell_FontIsAvailable
 5365
 5366*|Start FNshell_CheckSelection
 5367DEF FNshell_CheckSelection(sel%)
 5368LOCAL temp%,ctr%
 5369temp%=_U%!256
 5370IF temp%=0 THEN =-1
 5371IF _U%!24=_U%!252 THEN =0
 5372REPEAT
 5373  IF sel%!ctr%<>temp%!ctr% THEN =-1
 5374  ctr%+=4
 5375UNTIL temp%!ctr%=-1
 5376=ctr%
 5377:
 5378*|Stop FNshell_CheckSelection
 5379
 5380*|Start FNshell_MenuGetItemAddress
 5381DEF FNshell_MenuGetItemAddress(menu%,selection%)
 5382LOCAL ctr%,item_addr%
 5383SYS "MenuUtil_Info",menu% TO menu%
 5384REPEAT
 5385  item_addr%=menu%+28+((selection%!ctr%)*24)
 5386  menu%=item_addr%!4:REM address of submenu..
 5387  ctr%+=4
 5388UNTIL selection%!ctr%=-1
 5389=item_addr%
 5390:
 5391*|Stop FNshell_MenuGetItemAddress
 5392
 5393*|Start FNshell_GetLastMouseXPos
 5394DEF FNshell_GetLastMouseXPos
 5395=_U%!272
 5396:
 5397*|Stop FNshell_GetLastMouseXPos
 5398
 5399*|Start FNshell_GetLastMouseYPos
 5400DEF FNshell_GetLastMouseYPos
 5401=_U%!276
 5402:
 5403*|Stop FNshell_GetLastMouseYPos
 5404
 5405*|Start PROCshell_UpdateWindowHandle
 5406DEF PROCshell_UpdateWindowHandle(old_handle%,new_handle%)
 5407*|ifdef TraceInit
 5408PROCshell_Tracef0("UpdateWindowHandle:Updating stored window handles")
 5409PROCshell_Tracef0("UpdateWindowHandle:old handle=&"+STR$~old_handle%)
 5410PROCshell_Tracef0("UpdateWindowHandle:new handle=&"+STR$~new_handle%)
 5411*|endif
 5412IF new_handle%<>old_handle% THEN
 5413  IF _U%!28=old_handle% THEN _U%!28=new_handle%
 5414  PROCshell_FixEventBlock(old_handle%,new_handle%,_U%!12,48)  :REM main event block
 5415  PROCshell_FixEventBlock(old_handle%,new_handle%,_U%!96,16)  :REM DataLoad events
 5416  PROCshell_FixEventBlock(old_handle%,new_handle%,_U%!72,24)  :REM DataSave events
 5417  PROCshell_FixEventBlock(old_handle%,new_handle%,_U%!92,24)  :REM Pane events
 5418  PROCshell_FixEventBlock2(old_handle%,new_handle%,_U%!104,16):REM Bump events
 5419  PROCshell_FixEventBlock2(old_handle%,new_handle%,_U%!332,32):REM Slider events
 5420  PROCshell_UpdateStaticWindows(old_handle%,new_handle%)
 5421ENDIF
 5422ENDPROC
 5423:
 5424*|Stop PROCshell_UpdateWindowHandle
 5425
 5426*|Start PROCshell_UpdateStaticWindows
 5427DEF PROCshell_UpdateStaticWindows(old_handle%,new_handle%)
 5428LOCAL offset%,w_list%
 5429*|ifdef TraceInit
 5430PROCshell_Tracef0("UpdateStaticWindows:Correcting static window list..")
 5431*|endif
 5432w_list%=_U%!184
 5433offset%=FNshell_SearchStatic(_U%!184,old_handle%)
 5434w_list%!offset%=new_handle%
 5435ENDPROC
 5436:
 5437*|Stop PROCshell_UpdateStaticWindows
 5438
 5439*|Start PROCshell_FixEventBlock
 5440DEF PROCshell_FixEventBlock(old_handle%,new_handle%,event_list%,offset%)
 5441LOCAL ptr%,list_size%
 5442IF FNshell_HeapBlockExists(event_list%) THEN
 5443  list_size%=FNshell_HeapBlockInfo(event_list%)-8
 5444  REPEAT
 5445    IF (event_list%!ptr%=old_handle%) THEN
 5446      event_list%!ptr%=new_handle%
 5447    ENDIF
 5448    ptr%+=offset%
 5449  UNTIL (ptr%>=list_size%)
 5450ENDIF
 5451ENDPROC
 5452:
 5453*|Stop PROCshell_FixEventBlock
 5454
 5455*|Start PROCshell_FixEventBlock2
 5456DEF PROCshell_FixEventBlock2(old_handle%,new_handle%,event_list%,offset%)
 5457LOCAL ptr%,list_size%
 5458ptr% = 4 :REM first word is always size..
 5459IF FNshell_HeapBlockExists(event_list%) THEN
 5460  list_size% = !event_list%
 5461  REPEAT
 5462    IF (event_list%!ptr% = old_handle%) THEN
 5463      event_list%!ptr%   = new_handle%
 5464    ENDIF
 5465    ptr% += offset%
 5466  UNTIL (ptr%> = list_size%)
 5467ENDIF
 5468ENDPROC
 5469:
 5470*|Stop PROCshell_FixEventBlock2
 5471
 5472*|Start PROCshell_IconSelectAll
 5473DEF PROCshell_IconSelectAll(wh%)
 5474LOCAL blk%,I%
 5475blk%=FNshell_HeapBlockFetch(2000)
 5476I%=blk%+&40:!blk%=wh%
 5477blk%!8=1<<21:blk%!12=1<<21
 5478SYS "Wimp_WhichIcon",!blk%,I%,5<<21,0<<21
 5479WHILE !I%>-1
 5480  blk%!4=!I%
 5481  SYS "Wimp_SetIconState",,blk%
 5482  I%+=4
 5483ENDWHILE
 5484PROCshell_HeapBlockReturn(blk%)
 5485ENDPROC
 5486:
 5487*|Stop PROCshell_IconSelectAll
 5488*|Start PROCshell_IconDeselectAll
 5489DEF PROCshell_IconDeselectAll(wh%)
 5490LOCAL blk%,I%
 5491blk%=FNshell_HeapBlockFetch(2000)
 5492I%=blk%+&40:!blk%=wh%:blk%!8=0:blk%!12=1<<21
 5493SYS "Wimp_WhichIcon",!blk%,I%,5<<21,1<<21
 5494WHILE !I%>-1
 5495  blk%!4=!I%
 5496  SYS "Wimp_SetIconState",,blk%
 5497  I%+=4
 5498ENDWHILE
 5499PROCshell_HeapBlockReturn(blk%)
 5500ENDPROC
 5501:
 5502*|Stop PROCshell_IconDeselectAll
 5503
 5504*|Start PROCshell_Message_SaveDesktop
 5505DEF PROCshell_Message_SaveDesktop(Q%)
 5506LOCAL boot$
 5507boot$="Run "+FNshell_GetAppDir+CHR$10
 5508SYS "OS_GBPB",2,Q%!20,boot$,LENboot$
 5509ENDPROC
 5510:
 5511*|Stop PROCshell_Message_SaveDesktop
 5512
 5513*|Start PROCshell_MessagesInit
 5514DEF PROCshell_MessagesInit(filename$,RETURN m_filedesc%,RETURN m_buffer%)
 5515LOCAL size%,flags%
 5516LOCAL ERROR
 5517ON ERROR LOCAL RESTORE ERROR:ERROR 3,"Cannot open message file '"+filename$+"'"
 5518SYS "MessageTrans_FileInfo",,filename$ TO flags%,,size%
 5519IF flags% AND 1 THEN m_buffer%=0 ELSE m_buffer%=FNshell_HeapBlockFetch(size%)
 5520SYS "OS_Module",6,,,17+LEN(filename$) TO ,,m_filedesc%
 5521$(m_filedesc%+16)=filename$
 5522SYS "MessageTrans_OpenFile",m_filedesc%,m_filedesc%+16
 5523*|ifdef TraceInit
 5524PROCshell_Tracef0("MessagesInit:Message resource file '"+filename$+"' loaded")
 5525*|endif
 5526ENDPROC
 5527:
 5528*|Stop PROCshell_MessagesInit
 5529
 5530*|Start FNshell_PrinterOnLine
 5531DEF FNshell_PrinterOnLine
 5532LOCAL inbuf%,online%
 5533inbuf%=ADVAL(-4)
 5534VDU2,1,0,1,0,1,0
 5535TIME=0:REPEAT:UNTIL TIME>30
 5536online%=NOT(ADVAL(-4)<inbuf%)
 5537*FX21,3
 5538VDU3
 5539=online%
 5540:
 5541*|Stop FNshell_PrinterOnLine
 5542
 5543*|Start PROCshell_AttachBumpHandler
 5544DEF PROCshell_AttachBumpHandler(wh%,ih%,incr%,decr%,l_limit%,u_limit%,step%,wrap%,disp_fn$,decode_fn$)
 5545LOCAL e_blk%,offset%,temp%,temp2%,bump_info_blk%
 5546
 5547REM format of bump handler event block..
 5548REM +00 window handle
 5549REM +04 bump icon handle
 5550REM +08 step size (-ve for decr icon)
 5551REM +12 pointer to second info block
 5552REM
 5553REM format of second block..
 5554REM +00 display icon handle
 5555REM +04 lower limit
 5556REM +08 upper limit
 5557REM +12 pointer to display function
 5558REM +16 pointer to display decode function
 5559REM +20 flags (1 byte)
 5560REM     bit 0 wrap upper
 5561REM     bit 1 wrap lower
 5562
 5563REM deal with incr% icon event first..
 5564offset%=FNshell_GetEventListOffset2(wh%,incr%,_U%+104,16,TRUE)
 5565e_blk%=_U%!104+offset%:REM pointer to event list..
 5566
 5567  e_blk%!0=wh%:e_blk%!4=incr%:e_blk%!8=step%
 5568  e_blk%!12=FNshell_HeapBlockFetch(24)
 5569  bump_info_blk%=e_blk%!12
 5570  bump_info_blk%!0=ih%
 5571  bump_info_blk%!4=l_limit%
 5572  bump_info_blk%!8=u_limit%
 5573  IF LENdisp_fn$>0 THEN
 5574    bump_info_blk%!12=FNshell_HeapBlockFetch((LENdisp_fn$)+1)
 5575    temp2%=bump_info_blk%!12:$temp2%=disp_fn$
 5576  ELSE
 5577    bump_info_blk%!12=0
 5578  ENDIF
 5579  IF LENdecode_fn$>0 THEN
 5580    bump_info_blk%!16=FNshell_HeapBlockFetch((LENdecode_fn$)+1)
 5581    temp2%=bump_info_blk%!16:$temp2%=decode_fn$
 5582  ELSE
 5583    bump_info_blk%!16=0
 5584  ENDIF
 5585  IF wrap%=-1 THEN bump_info_blk%!20=1 ELSE bump_info_blk%!20=0
 5586
 5587  offset%=FNshell_GetEventListOffset2(wh%,decr%,_U%+104,16,TRUE)
 5588  e_blk%=_U%!104+offset%:REM pointer to event list..
 5589
 5590  e_blk%!0=wh%:e_blk%!4=decr%:e_blk%!8=step%*(-1)
 5591  e_blk%!12=bump_info_blk%
 5592
 5593ENDPROC
 5594:
 5595*|Stop PROCshell_AttachBumpHandler
 5596
 5597*|Start PROCshell_HandleBumpIcons
 5598DEF PROCshell_HandleBumpIcons(offset%,wh%,ih%,_button%)
 5599LOCAL display_ih%,info_blk%,e_blk%,curr_val%,_temp$,fn2%
 5600LOCAL new_val%,fn%
 5601IF _button% <> 2 THEN
 5602  e_blk%=_U%!104+offset%
 5603  _U%!288=wh%:_U%!292=ih%:_U%!296=offset%
 5604  REM e_blk%!8 holds step value
 5605  info_blk%=e_blk%!12
 5606  REM info_blk%!0  holds display icon handle
 5607  REM info_blk%!4  holds lower limit
 5608  REM info_blk%!8  holds upper limit
 5609  REM info_blk%!20 holds wrap flag
 5610  fn2%=info_blk%!16
 5611  IF fn2%<>0 THEN
 5612    _temp$=FNshell_IconGetData(wh%,info_blk%!0)
 5613    curr_val%=EVAL("FN"+$fn2%+"(_temp$)")
 5614  ELSE
 5615    curr_val%=VAL(FNshell_IconGetData(wh%,info_blk%!0))
 5616  ENDIF
 5617  IF _button%=1 THEN
 5618    REM button is ADJUST, invert step value..
 5619    _new_val%=curr_val%+((e_blk%!8)*(-1))
 5620  ELSE
 5621    _new_val%=curr_val%+e_blk%!8
 5622  ENDIF
 5623  IF info_blk%!20=0 THEN
 5624    REM no wrap..
 5625    IF _new_val%>info_blk%!8 THEN _new_val%=info_blk%!8
 5626    IF _new_val%<info_blk%!4 THEN _new_val%=info_blk%!4
 5627  ELSE
 5628    REM wrap..
 5629    IF _new_val%>info_blk%!8 THEN _new_val%=info_blk%!4
 5630    IF _new_val%<info_blk%!4 THEN _new_val%=info_blk%!8
 5631  ENDIF
 5632  fn%=info_blk%!12
 5633  IF fn%<>0 THEN
 5634    _new_val$=EVAL("FN"+$fn%+"(_new_val%,_button%)")
 5635  ELSE
 5636    _new_val$=STR$_new_val%
 5637  ENDIF
 5638  IF _new_val%<>curr_val% THEN
 5639    PROCshell_IconPutData(wh%,info_blk%!0,_new_val$,-1)
 5640  ENDIF
 5641ENDIF
 5642ENDPROC
 5643:
 5644*|Stop PROCshell_HandleBumpIcons
 5645
 5646*|Start FNshell_WindowSetSpriteArea
 5647DEF FNshell_WindowSetSpriteArea(h%,SpriteArea%)
 5648LOCAL blk%,new_handle%,icon%,ib%
 5649blk%  = FNshell_HeapBlockFetch(100 + (FNshell_WindowCountIcons(h%) * 32))
 5650!blk% = h%
 5651SYS "Wimp_GetWindowInfo",,blk%
 5652blk%!68 = SpriteArea%
 5653PROCshell_IconSetSpriteArea(blk%!60,blk% + 76,SpriteArea%)
 5654IF (blk%!88) > 0 THEN
 5655  FOR icon% = 0 TO (blk%!88) - 1
 5656    ib% = blk% + 92 + icon% * 32
 5657    PROCshell_IconSetSpriteArea(ib%!16,ib% + 20,SpriteArea%)
 5658  NEXT icon%
 5659ENDIF
 5660SYS "Wimp_DeleteWindow",,blk%
 5661SYS "Wimp_CreateWindow",,blk% + 4 TO new_handle%
 5662IF new_handle% <> h% THEN
 5663  PROCshell_UpdateWindowHandle(h%,new_handle%)
 5664  h% = new_handle%
 5665ENDIF
 5666PROCshell_HeapBlockReturn(blk%)
 5667= h%
 5668:
 5669*|Stop FNshell_WindowSetSpriteArea
 5670
 5671*|Start PROCshell_IconSetSpriteArea
 5672DEF PROCshell_IconSetSpriteArea(flags%,data%,area%)
 5673IF ((flags% AND 3) = 2) AND ((flags% AND &100) <> 0) THEN
 5674  data%!4 = area%
 5675ENDIF
 5676ENDPROC
 5677*|Stop PROCshell_IconSetSpriteArea
 5678
 5679*|Start FNshell_StrongHlpIsAvailable
 5680DEF FNshell_StrongHlpIsAvailable
 5681LOCAL r%,buff%
 5682r% = FALSE
 5683IF _U%!100 AND 1 << 7 THEN
 5684  REM StrongHlp initialisation succeeded..
 5685  buff% = FNshell_HeapBlockFetch(256)
 5686  r%    = FNshell_OSVarExists(buff%,"StrongHelp$Dir")
 5687  PROCshell_HeapBlockReturn(buff%)
 5688ENDIF
 5689= r%
 5690:
 5691*|Stop FNshell_StrongHlpIsAvailable
 5692
 5693*|Start FNshell_MenuNew
 5694DEF FNshell_MenuNew(title$)
 5695LOCAL handle%
 5696*|ifdef TraceInit
 5697PROCshell_Tracef0("MenuNew:Creating new menu (" + title$ + ")")
 5698*|endif
 5699SYS "MenuUtil_New",,title$ TO handle%
 5700= handle%
 5701:
 5702*|Stop FNshell_MenuNew
 5703
 5704*|Start FNshell_MenuAdd
 5705DEF FNshell_MenuAdd(handle%,item$,sel_fn$)
 5706LOCAL ret_handle%
 5707*|ifdef TraceInit
 5708PROCshell_Tracef0("MenuAdd:Adding item ("+item$+")")
 5709*|endif
 5710IF sel_fn$ <> "" THEN
 5711  SYS "MenuUtil_Add",handle%,item$,sel_fn$ TO ret_handle%
 5712ELSE
 5713  SYS "MenuUtil_Add",handle%,item$ TO ret_handle%
 5714ENDIF
 5715IF handle% <> ret_handle% THEN
 5716*|ifdef TraceInit
 5717  PROCshell_Tracef0("MenuAdd:Menu handle has changed, updating event lists..")
 5718*|endif
 5719REM   PROCshell_MenuUpdateHandle(handle%,ret_handle%)
 5720ENDIF
 5721= ret_handle%
 5722:
 5723*|Stop FNshell_MenuAdd
 5724
 5725*|Start PROCshell_MenuTick
 5726DEF PROCshell_MenuTick(item_handle%,state%)
 5727SYS "MenuUtil_Tick",item_handle%,state%
 5728ENDPROC
 5729:
 5730*|Stop PROCshell_MenuTick
 5731
 5732*|Start PROCshell_MenuTickOnly1
 5733DEF PROCshell_MenuTickOnly1(menu_handle%,pos%)
 5734SYS "MenuUtil_TickOnly",menu_handle%,pos%
 5735ENDPROC
 5736:
 5737*|Stop PROCshell_MenuTickOnly1
 5738
 5739*|Start PROCshell_MenuTickOnly2
 5740DEF PROCshell_MenuTickOnly2(item_handle%)
 5741SYS "MenuUtil_TickOnly",item_handle%
 5742ENDPROC
 5743:
 5744*|Stop PROCshell_MenuTickOnly2
 5745
 5746*|Start PROCshell_MenuShade
 5747DEF PROCshell_MenuShade(handle%,state%)
 5748SYS "MenuUtil_Fade",handle%,state%
 5749ENDPROC
 5750:
 5751*|Stop PROCshell_MenuShade
 5752
 5753*|Start PROCshell_MenuDotted
 5754DEF PROCshell_MenuDotted(item_handle%,state%)
 5755SYS "MenuUtil_Dots",item_handle%,state%
 5756ENDPROC
 5757:
 5758*|Stop PROCshell_MenuDotted
 5759
 5760*|Start PROCshell_MenuColours
 5761DEF PROCshell_MenuColours(item_handle%,fg%,bg%)
 5762SYS "MenuUtil_Colours",item_handle%,fg%,bg%
 5763ENDPROC
 5764:
 5765*|Stop PROCshell_MenuColours
 5766
 5767*|Start PROCshell_MenuWritable
 5768DEF PROCshell_MenuWritable(item_handle%,state%,size%,valid$)
 5769SYS "MenuUtil_Writable",item_handle%,state%,size%,valid$
 5770ENDPROC
 5771:
 5772*|Stop PROCshell_MenuWritable
 5773
 5774*|Start PROCshell_MenuPutData
 5775DEF PROCshell_MenuPutData(item_handle%,data$)
 5776SYS "MenuUtil_Text",item_handle%,data$
 5777ENDPROC
 5778:
 5779*|Stop PROCshell_MenuPutData
 5780
 5781*|Start PROCshell_MenuCallHandler
 5782DEF PROCshell_MenuCallHandler(h%,_h_blk%)
 5783LOCAL ERROR
 5784ON ERROR LOCAL:RESTORE ERROR:ENDPROC
 5785IF EVAL("FN"+$h%+"(_h_blk%)")
 5786ENDPROC
 5787:
 5788*|Stop PROCshell_MenuCallHandler
 5789
 5790*|Start PROCshell_AttachOpenWindow
 5791DEF PROCshell_AttachOpenWindow(wh%,fn$)
 5792LOCAL blk%,temp%,offset%
 5793*|ifdef TraceInit
 5794PROCshell_Tracef0("AttachOpenWindow:Attaching OpenWindow Handler")
 5795*|endif
 5796IF wh%<0 THEN ERROR 99,PROCshell_MessageOneArg("SHELLMSG27","AttachOpenWindow")
 5797offset%=FNshell_GetEventListOffset(wh%,-1,_U%+304,12,TRUE)
 5798blk%=_U%!304+offset%
 5799blk%!0=wh%:blk%!4=-1
 5800blk%!8=FNshell_HeapBlockFetch(LEN(fn$)+1)
 5801temp%=blk%!8:$temp%=fn$
 5802ENDPROC
 5803:
 5804*|Stop PROCshell_AttachOpenWindow
 5805
 5806*|Start PROCshell_AttachCloseWindowHandler
 5807DEF PROCshell_AttachCloseWindowHandler(wh%,fn$)
 5808LOCAL blk%,temp%,offset%
 5809*|ifdef TraceInit
 5810PROCshell_Tracef0("AttachCloseWindowHandler:Attaching CloseWindow Handler")
 5811*|endif
 5812IF wh%<0 THEN ERROR 99,PROCshell_MessageOneArg("SHELLMSG27","AttachCloseWindow")
 5813offset%=FNshell_GetEventListOffset(wh%,-1,_U%+308,12,TRUE)
 5814blk%=_U%!308+offset%
 5815blk%!0=wh%:blk%!4=-1
 5816blk%!8=FNshell_HeapBlockFetch(LEN(fn$)+1)
 5817temp%=blk%!8:$temp%=fn$
 5818ENDPROC
 5819:
 5820*|Stop PROCshell_AttachCloseWindowHandler
 5821
 5822*|Start PROCshell_SpriteRename
 5823DEF PROCshell_SpriteRename(spritearea%,old$,new$)
 5824SYS "OS_SpriteOp",&200+26,spritearea%,FNshell_SpriteGetPtr(spritearea%,old$),new$
 5825ENDPROC
 5826:
 5827*|Stop PROCshell_SpriteRename
 5828
 5829*|Start PROCshell_SpriteAreaSave
 5830DEF PROCshell_SpriteAreaSave(spritearea%,filename$)
 5831SYS "OS_SpriteOp",&200+12,spritearea%,filename$
 5832ENDPROC
 5833:
 5834*|Stop PROCshell_SpriteAreaSave
 5835
 5836*|Start PROCshell_EnsurePoll
 5837DEF PROCshell_EnsurePoll
 5838LOCAL action%
 5839REPEAT
 5840  action% = FNshell_Poll_I(0,_U%!148)
 5841  PROCshell_Action(action%)
 5842UNTIL action% = 0
 5843ENDPROC
 5844:
 5845*|Stop PROCshell_EnsurePoll
 5846
 5847*|Start FNshell_WimpGetVersion
 5848DEF FNshell_WimpGetVersion
 5849=_U%!316
 5850*|Stop FNshell_WimpGetVersion
 5851
 5852*|Start FNshell_OSCheckVersion
 5853DEF FNshell_OSCheckVersion(version%)
 5854=FNshell_OSModuleCheckVersion("UtilityModule",version%)
 5855*|Stop FNshell_OSCheckVersion
 5856
 5857*|Start FNshell_OSModuleCheckVersion
 5858DEF FNshell_OSModuleCheckVersion(module$,version)
 5859LOCAL blk%,len%,result$
 5860blk%=FNshell_HeapBlockFetch(256)
 5861OSCLI("Set Module$Check Y")
 5862OSCLI("RMEnsure " + module$ + " "+STR$version + " Set Module$Check N")
 5863SYS "OS_ReadVarVal","Module$Check",blk%,256,0,0 TO ,,len%
 5864blk%?len% = 13
 5865OSCLI("Unset Module$Check")
 5866result$ = $blk%
 5867PROCshell_HeapBlockReturn(blk%)
 5868IF result$ = "N" THEN = FALSE ELSE = TRUE
 5869:
 5870*|Stop FNshell_OSModuleCheckVersion
 5871
 5872*|Start PROCshell_MessageSendDataLoad
 5873DEF PROCshell_MessageSendDataLoad(type%,name$)
 5874LOCAL m_blk%
 5875m_blk%    = FNshell_HeapBlockFetch(256)
 5876m_blk%!00 = 256   :REM Size of message
 5877m_blk%!04 = 0     :REM Not used on entry
 5878m_blk%!12 = 0     :REM your_ref (0 = original message not a reply)
 5879m_blk%!16 = 5     :REM DataOpen message action code
 5880m_blk%!20 = 0     :REM Normally Filer window handle containing the file 
 5881m_blk%!28 = 0     :REM Normally x offset of icon clicked on
 5882m_blk%!32 = 0     :REM Normally y offset of icon clicked on
 5883m_blk%!36 = 0     :REM Must be 0
 5884m_blk%!40 = type% :REM File type
 5885$(m_blk% + 44) = name$ + CHR$(0)
 5886SYS "Wimp_SendMessage",17,m_blk%,0
 5887PROCshell_HeapBlockReturn(m_blk%)
 5888ENDPROC
 5889:
 5890*|Stop PROCshell_MessageSendDataLoad
 5891
 5892*|Start FNshell_MenuMakeFromFile
 5893DEF FNshell_MenuMakeFromFile(title$,menuselectFN$,file$)
 5894LOCAL handle%,X%,string$
 5895IF FNshell_FileExists(file$) THEN
 5896  handle% = FNshell_MenuNew(title$)
 5897  X% = OPENIN(file$)
 5898  REPEAT
 5899    string$ = GET$# X%
 5900    handle% = FNshell_MenuAdd(handle%,string$,menuselectFN$)
 5901  UNTIL EOF# X%
 5902  CLOSE# X%
 5903ENDIF
 5904= handle%
 5905:
 5906*|Stop FNshell_MenuMakeFromFile
 5907
 5908*|Start FNshell_BinarySearch
 5909DEF FNshell_BinarySearch(_search_term$,get_termFN$,comp_FN$,lo%,hi%)
 5910LOCAL _pos%,m%,_wp$,off%,p%,hipos%,lopos%,lp2%,found%,missing%
 5911hi% += 1
 5912missing% = FALSE
 5913found%   = FALSE
 5914m%       = hi%
 5915off%     = 0
 5916_pos%     = m% DIV 2
 5917lopos%   = lo% - 1
 5918hipos%   = hi%
 5919REPEAT
 5920  _wp$=EVAL("FN"+get_termFN$+"(_pos%)")
 5921  lastpos% = _pos%
 5922  IF _search_term$ = _wp$ THEN
 5923    found% = TRUE
 5924  ELSE
 5925    IF EVAL("FN"+comp_FN$+"(_search_term$,_wp$)") THEN
 5926      REM search lower half..
 5927      hipos% = _pos%
 5928      m%     = _pos% - lopos%
 5929      _pos%  = m% DIV 2 + off%
 5930    ELSE
 5931      REM search upper half..
 5932      lopos% = _pos%
 5933      off%   = _pos%
 5934      m%     = hipos% - _pos%
 5935      _pos%  = m% DIV 2 +off%
 5936    ENDIF
 5937  ENDIF
 5938  IF lp2% = lastpos% THEN missing% = TRUE
 5939  lp2% = lastpos%
 5940UNTIL found% OR missing%
 5941IF NOT found% THEN =-1 ELSE = lastpos%
 5942:
 5943*|Stop FNshell_BinarySearch
 5944
 5945*|Start FNshell_IconLastClicked
 5946DEF FNshell_IconLastClicked
 5947=_U%!32
 5948:
 5949*|Stop FNshell_IconLastClicked
 5950
 5951*|Start FNshell_MenuGetNrItems
 5952DEF FNshell_MenuGetNrItems(menu_handle%)
 5953LOCAL menu%,result%,items%
 5954SYS "MenuUtil_Info",menu_handle% TO menu%
 5955menu% += 28
 5956REPEAT
 5957  result% = (menu%?0 AND &80)
 5958  items% += 1
 5959  menu%  += 24
 5960UNTIL result%
 5961=items%
 5962:
 5963*|Stop FNshell_MenuGetNrItems
 5964
 5965*|Start FNshell_MenuGetNrDotted
 5966DEF FNshell_MenuGetNrDotted(menu_handle%)
 5967LOCAL menu%,result%,nr%
 5968SYS "MenuUtil_Info",menu_handle% TO menu%
 5969menu% += 28 
 5970REPEAT    
 5971  result% = (menu%?0 AND &80)
 5972  IF (menu%?0 AND 2) THEN nr% += 1
 5973  menu% += 24
 5974UNTIL result% = -1
 5975=nr% 
 5976:
 5977*|Stop FNshell_MenuGetNrDotted 
 5978
 5979*|Start FNshell_MenuGetItemHandler
 5980DEF FNshell_MenuGetItemHandler(menu_handle%,item_nr%)
 5981LOCAL m_sel_blk%,ptr%,handler$
 5982m_sel_blk%    = FNshell_HeapBlockFetch(8)
 5983m_sel_blk%!00 = item_nr%  
 5984m_sel_blk%!04 = -1 
 5985SYS "MenuUtil_Decode",menu_handle%,m_sel_blk% TO ptr% 
 5986IF ptr% = 0 THEN
 5987  handler$ = ""
 5988ELSE
 5989  handler$ = $(ptr%)
 5990ENDIF
 5991PROCshell_HeapBlockReturn(m_sel_blk%) 
 5992= handler$
 5993:
 5994*|Stop FNshell_MenuGetItemHandler
 5995
 5996*|Start FNshell_MenuGetItemText
 5997DEF FNshell_MenuGetItemText(menu_handle%,item_nr%)
 5998LOCAL m_sel_blk%,ptr%,text$
 5999m_sel_blk% = FNshell_HeapBlockFetch(8)
 6000m_sel_blk%!00 = item_nr%
 6001m_sel_blk%!04 = -1
 6002SYS "MenuUtil_Decode",menu_handle%,m_sel_blk% TO ,,ptr%
 6003text$ = $(ptr%!12)
 6004PROCshell_HeapBlockReturn(m_sel_blk%)
 6005= text$
 6006:
 6007*|Stop FNshell_MenuGetItemText
 6008
 6009*|Start FNshell_MenuGetItemHandle
 6010DEF FNshell_MenuGetItemHandle(menu_handle%,item_nr%)
 6011LOCAL m_sel_blk%,ptr%,handle%
 6012m_sel_blk% = FNshell_HeapBlockFetch(8)
 6013m_sel_blk%!00 = item_nr%
 6014m_sel_blk%!04 = -1
 6015SYS "MenuUtil_Decode",menu_handle%,m_sel_blk% TO ,,ptr%
 6016handle% = ptr%!08
 6017PROCshell_HeapBlockReturn(m_sel_blk%)
 6018= handle%
 6019:
 6020*|Stop FNshell_MenuGetItemHandle
 6021
 6022*|Start FNshell_MenuGetItemHeight
 6023DEF FNshell_MenuGetItemHeight(menu_handle%)
 6024LOCAL menu%
 6025SYS "MenuUtil_Info",menu_handle% TO menu%
 6026= menu%!20
 6027:
 6028*|Stop FNshell_MenuGetItemHeight
 6029
 6030*|Start FNshell_MenuCalculateHeight
 6031DEF FNshell_MenuCalculateHeight(menu_handle%)
 6032LOCAL height%
 6033height% = FNshell_MenuGetNrItems(menu_handle%)*FNshell_MenuGetItemHeight(menu_handle%)
 6034= height% + (FNshell_MenuGetNrDotted(menu_handle%) * 24)
 6035:
 6036*|Stop FNshell_MenuCalculateHeight
 6037
 6038*|Start PROCshell_MenuSortItems
 6039DEF PROCshell_MenuSortItems(menu%,compFN$,asc%,start%,end%)
 6040LOCAL nr_items%
 6041nr_items% = FNshell_MenuGetNrItems(menu%) - 1
 6042_shell_MS_handle% = menu%
 6043IF end% > nr_items% THEN end% = nr_items%
 6044SYS "Hourglass_On"
 6045PROCshell_QuickSort(compFN$,"_shell_MS_swap",asc%,0,end%)
 6046SYS "Hourglass_Off"
 6047ENDPROC
 6048:
 6049*|Stop PROCshell_MenuSortItems
 6050
 6051*|Start PROCshell_QuickSort
 6052DEF PROCshell_QuickSort(comp_FN$,swap_FN$,_asc%,_start%,_end%)
 6053LOCAL _lo%,_h%,_F%,_temp%,void%
 6054_lo% = _start%:_hi% = _end%:_F% = TRUE
 6055_temp% = _lo% -1 + RND(_hi% + 1 - _lo%)
 6056void% = EVAL("FN"+swap_FN$+"(_lo%,_temp%)")
 6057REPEAT
 6058  IF _asc% = 0 THEN
 6059    IF EVAL("FN"+comp_FN$+"(_lo%,_hi%)") THEN
 6060      void% = EVAL("FN"+swap_FN$+"(_lo%,_hi%)")
 6061      _F% = NOT _F%
 6062    ENDIF
 6063  ELSE
 6064    IF EVAL("FN"+comp_FN$+"(_hi%,_lo%)") THEN
 6065      void% = EVAL("FN"+swap_FN$+"(_hi%,_lo%)")
 6066      _F% = NOT _F%
 6067    ENDIF
 6068  ENDIF
 6069  IF _F% THEN _hi% = _hi% - 1 ELSE _lo% = _lo% + 1
 6070UNTIL _lo% = _hi%
 6071IF _start% < _lo% - 1 THEN PROCshell_QuickSort(comp_FN$,swap_FN$,_asc%,_start%,_lo% - 1)
 6072IF _hi% + 1 < _end%   THEN PROCshell_QuickSort(comp_FN$,swap_FN$,_asc%,_hi% + 1,_end%)
 6073ENDPROC
 6074:
 6075*|Stop PROCshell_QuickSort
 6076
 6077*|Start FNshell_MS_swap
 6078DEF FN_shell_MS_swap(e1%,e2%)
 6079LOCAL term1$,term2$,h1%,h2%
 6080term1$ = FNshell_MenuGetItemText(_shell_MS_handle%,e1%)
 6081term2$ = FNshell_MenuGetItemText(_shell_MS_handle%,e2%)
 6082h1%    = FNshell_MenuGetItemHandle(_shell_MS_handle%,e1%)
 6083h2%    = FNshell_MenuGetItemHandle(_shell_MS_handle%,e2%)
 6084PROCshell_MenuPutData(h1%,term2$)
 6085PROCshell_MenuPutData(h2%,term1$)
 6086=0
 6087:
 6088*|Stop FNshell_MS_swap
 6089
 6090*|Start FN_shell_MS_comp
 6091DEF FN_shell_MS_comp(e1%,e2%)
 6092LOCAL term1$,term2$
 6093term1$ = FNshell_MenuGetItemText(_shell_MS_handle%,e1%)
 6094term2$ = FNshell_MenuGetItemText(_shell_MS_handle%,e2%)
 6095IF VALterm1$ < VALterm2$ THEN = TRUE ELSE = FALSE
 6096:
 6097*|Stop FN_shell_MS_comp
 6098
 6099*|Start PROCshell_WindowSetTitleRightJust
 6100DEF PROCshell_WindowSetTitleRightJust(RETURN wh%)
 6101LOCAL w_blk%,t_flags%,handle%,reopen%
 6102reopen% = FNshell_WindowIsOpen(wh%)
 6103w_blk% = FNshell_HeapBlockFetch(100 + (FNshell_WindowCountIcons(wh%) * 32))
 6104!w_blk% = wh%
 6105SYS "Wimp_GetWindowInfo",,w_blk%
 6106t_flags% = w_blk%!60
 6107IF (t_flags% AND (1 << 3)) THEN
 6108*|ifdef TraceInit
 6109  PROCshell_Tracef0("WindowSetTitleRightJust:title flags = &"+STR$~t_flags%)
 6110  PROCshell_Tracef0("WindowSetTitleRightJust:Horizontally centred bit set..")
 6111  PROCshell_Tracef0("WindowSetTitleRightJust:Unsetting horizontally centred bit..")
 6112*|endif
 6113  t_flags% = t_flags% EOR (1 << 3)
 6114*|ifdef TraceInit
 6115  PROCshell_Tracef0("WindowSetTitleRightJust:title flags = &"+STR$~t_flags%)
 6116*|endif
 6117ELSE
 6118*|ifdef TraceInit
 6119  PROCshell_Tracef0("WindowSetTitleRightJust:Horizontally centred bit NOT set..")
 6120*|endif
 6121ENDIF
 6122*|ifdef TraceInit
 6123PROCshell_Tracef0("WindowSetTitleRightJust:Setting right justified bit..")
 6124*|endif
 6125t_flags% = t_flags% OR (1 << 9)
 6126w_blk%!60 = t_flags%
 6127SYS "Wimp_DeleteWindow",,w_blk%
 6128SYS "Wimp_CreateWindow",,w_blk% + 4 TO handle%
 6129IF wh% <> handle% THEN
 6130*|ifdef TraceInit
 6131  PROCshell_Tracef0("WindowSetTitleRightJust:Updating window handle...")
 6132*|endif
 6133  PROCshell_UpdateWindowHandle(wh%,handle%)
 6134  wh% = handle%
 6135ENDIF
 6136IF reopen% THEN PROCshell_OpenWindow(handle%,0,0)
 6137PROCshell_HeapBlockReturn(w_blk%)
 6138ENDPROC
 6139:
 6140*|Stop PROCshell_WindowSetTitleRightJust
 6141
 6142*|Start PROCshell_WindowSetTitleCentreJust
 6143DEF PROCshell_WindowSetTitleCentreJust(RETURN wh%)
 6144LOCAL w_blk%,t_flags%,handle%,reopen%
 6145reopen% = FNshell_WindowIsOpen(wh%)
 6146w_blk% = FNshell_HeapBlockFetch(100 + (FNshell_WindowCountIcons(wh%) * 32))
 6147!w_blk% = wh%
 6148SYS "Wimp_GetWindowInfo",,w_blk%
 6149t_flags% = w_blk%!60
 6150PROCshell_Tracef0("WindowSetTitleCentreJust:title flags = &"+STR$~t_flags%)
 6151PROCshell_Tracef0("WindowSetTitleCentreJust:t_flags% AND (1 << 3) = "+STR$~(t_flags% AND (1 << 3)))
 6152IF (t_flags% AND (1 << 3)) = 0 THEN
 6153*|ifdef TraceInit
 6154  PROCshell_Tracef0("WindowSetTitleCentreJust:Horizontally centred bit not set..")
 6155  PROCshell_Tracef0("WindowSetTitleCentreJust:Setting horizontally centred bit..")
 6156*|endif
 6157  t_flags% = t_flags% EOR (1 << 3)
 6158*|ifdef TraceInit
 6159  PROCshell_Tracef0("WindowSetTitleCentreJust:title flags = &"+STR$~t_flags%)
 6160*|endif
 6161  w_blk%!60 = t_flags%
 6162  SYS "Wimp_DeleteWindow",,w_blk%
 6163  SYS "Wimp_CreateWindow",,w_blk% + 4 TO handle%
 6164  IF wh% <> handle% THEN
 6165  *|ifdef TraceInit
 6166    PROCshell_Tracef0("WindowSetTitleCentreJust:Updating window handle...")
 6167  *|endif
 6168    PROCshell_UpdateWindowHandle(wh%,handle%)
 6169    wh% = handle%
 6170  ENDIF
 6171  IF reopen% THEN PROCshell_OpenWindow(handle%,0,0)
 6172ENDIF
 6173
 6174PROCshell_HeapBlockReturn(w_blk%)
 6175ENDPROC
 6176:
 6177*|Stop PROCshell_WindowSetTitleCentreJust
 6178
 6179*|Start PROCshell_IconGetSelectedIcons
 6180DEF PROCshell_IconGetSelectedIcons(wh%,esg%,RETURN i_blk%)
 6181LOCAL imask%
 6182imask%   = (esg% << 16) + (1 << 21)
 6183SYS "Wimp_WhichIcon",wh%,i_blk%,imask%,(esg% << 16) + (1 << 21)
 6184ENDPROC
 6185:
 6186*|Stop PROCshell_IconGetSelectedIcons
 6187
 6188*|Start FNshell_GetLastMouseButton
 6189DEF FNshell_GetLastMouseButton
 6190= _U%!320
 6191:
 6192*|Stop FNshell_GetLastMouseButton
 6193
 6194*|Start FNshell_GetLastWindowClicked
 6195DEF FNshell_GetLastWindowClicked
 6196= _U%!28
 6197:
 6198*|Stop FNshell_GetLastWindowClicked
 6199
 6200*|Start FNshell_GetLastIconClicked
 6201DEF FNshell_GetLastIconClicked
 6202= _U%!32
 6203:
 6204*|Stop FNshell_GetLastIconClicked
 6205
 6206*|Start FNshell_IconIndirSize
 6207DEF FNshell_IconIndirSize(file_offset%,flags%,data%,X%)
 6208LOCAL size%,valid_offset%,ctr%,char%
 6209IF (flags% AND &800100) = &100 THEN
 6210  size% = data%!8
 6211  IF (flags% AND 1) AND (data%!4 <> -1) THEN
 6212    valid_offset% = data%!4
 6213    PTR# X% = file_offset% + valid_offset%
 6214    ctr% = 0
 6215    REPEAT
 6216      char% = BGET# X%
 6217      ctr% += 1
 6218    UNTIL char% < 32
 6219    size% += + ctr%
 6220  ENDIF
 6221ELSE
 6222  size% = 0
 6223ENDIF
 6224= size%
 6225:
 6226*|Stop FNshell_IconIndirSize
 6227
 6228*|Start FNshell_StrongHlpChkFiles
 6229DEF FNshell_StrongHlpChkFiles(path$)
 6230LOCAL abort%
 6231IF NOT FNshell_FileExists(path$ + ".HelpData") THEN
 6232  REM HelpData file is missing..
 6233  abort% = -1
 6234  ERROR 99,FNshell_MessageOneArg("SHELLMSG32","HelpData")
 6235ENDIF
 6236IF NOT FNshell_FileExists(path$ + ".Index") THEN
 6237  REM Index file is missing..
 6238  abort% = -1
 6239  ERROR 99,FNshell_MessageOneArg("SHELLMSG32","Index")
 6240ENDIF
 6241IF abort% = FALSE THEN = TRUE ELSE = FALSE
 6242:
 6243*|Stop FNshell_StrongHlpChkFiles
 6244
 6245*|Start PROCshell_CaretMoveCaret
 6246DEF PROCshell_CaretMoveCaret(wh%,action%)
 6247LOCAL caret_blk%,current_icon%,ctr%,ptr%,icon_nr%
 6248ctr% = 0 :ptr% = 0
 6249caret_blk% = FNshell_HeapBlockFetch(2048)
 6250REM Find current icon conatining the caret..
 6251SYS "Wimp_GetCaretPosition",,caret_blk%
 6252IF caret_blk%!4 <> -1 THEN
 6253  REM There is a caret..
 6254  current_icon% = caret_blk%!4
 6255  REM Get a list of writable icons in this window..
 6256  SYS "Wimp_WhichIcon",wh%,caret_blk%,&0040E000,&0000E000
 6257  REPEAT
 6258    IF caret_blk%!ctr% = current_icon% THEN ptr% = ctr%
 6259    ctr% += 4
 6260  UNTIL caret_blk%!ctr% = -1
 6261  CASE action% OF
 6262    WHEN 0:
 6263      REM to first icon
 6264      icon_nr% = !caret_blk%
 6265    WHEN 1:
 6266      REM to last icon
 6267      icon_nr% = caret_blk%!(ctr% - 4)
 6268    WHEN 2:
 6269      REM to next icon
 6270      IF caret_blk%!(ptr% + 4) <> -1 THEN
 6271        icon_nr% = caret_blk%!(ptr% + 4)
 6272      ELSE
 6273        icon_nr% = !caret_blk%
 6274      ENDIF
 6275    WHEN 3:
 6276      REM to previous icon
 6277      IF ptr% > 0 THEN
 6278        icon_nr% = caret_blk%!(ptr% - 4)
 6279      ELSE
 6280        icon_nr% = caret_blk%!(ctr% - 4)
 6281      ENDIF
 6282  ENDCASE
 6283  SYS "Wimp_SetCaretPosition",wh%,icon_nr%,-1,-1,-1,LEN(FNshell_IconGetData(wh%,icon_nr%))
 6284ENDIF
 6285PROCshell_HeapBlockReturn(caret_blk%)
 6286ENDPROC
 6287:
 6288*|Stop PROCshell_CaretMoveCaret
 6289
 6290*|Start PROCshell_CaretPutFirstIcon
 6291DEF PROCshell_CaretPutFirstIcon(wh%)
 6292PROCshell_CaretMoveCaret(wh%,0)
 6293ENDPROC
 6294:
 6295*|Stop PROCshell_CaretPutFirstIcon
 6296
 6297*|Start PROCshell_CaretPutLastIcon
 6298DEF PROCshell_CaretPutLastIcon(wh%)
 6299PROCshell_CaretMoveCaret(wh%,1)
 6300ENDPROC
 6301:
 6302*|Stop PROCshell_CaretPutLastIcon
 6303
 6304*|Start PROCshell_CaretPutNextIcon
 6305DEF PROCshell_CaretPutNextIcon(wh%)
 6306PROCshell_CaretMoveCaret(wh%,2)
 6307ENDPROC
 6308:
 6309*|Stop PROCshell_CaretPutNextIcon
 6310
 6311*|Start PROCshell_CaretPutPrevIcon
 6312DEF PROCshell_CaretPutPrevIcon(wh%)
 6313PROCshell_CaretMoveCaret(wh%,3)
 6314ENDPROC
 6315:
 6316*|Stop PROCshell_CaretPutPrevIcon
 6317
 6318*|Start PROCshell_TemplateFileInfo
 6319REM Returns the size of the buffer needed by "Wimp_LoadTemplate" and
 6320REM the number of templates in the file
 6321REM   Returns  0 if routine executed without errors
 6322REM           -1 if filename did not exist
 6323REM           -2 if file exists but is not a template file
 6324REM   If the returned result is < 0 then buffer size and number of templates
 6325REM   will be meaningless!
 6326
 6327DEF PROCshell_TemplateFileInfo(filename$,RETURN buff_size%,RETURN nr_templates%,RETURN result%)
 6328LOCAL RO3%
 6329RO3% = FNRO3_Present
 6330IF RO3% THEN
 6331  PROCshell_TemplateFileInfo3(filename$,buff_size%,nr_templates%,result%)
 6332ELSE
 6333  PROCshell_TemplateFileInfo2(filename$,buff_size%,nr_templates%,result%)
 6334ENDIF
 6335ENDPROC
 6336:
 6337*|Stop PROCshell_TemplateFileInfo
 6338
 6339*|Start PROCshell_TemplateFileInfo2
 6340DEF PROCshell_TemplateFileInfo2(filename$,RETURN buff_size%,RETURN nr_templates%,RETURN result%)
 6341LOCAL pos%,total_indirsize%,largest_def%
 6342LOCAL buff%,X%,data_size%,entry_type%
 6343LOCAL ctr%,char%,old_ptr%,nr_icons%,j%,flags%
 6344pos% = 0:nr_templates% = 0:total_indirsize% = 0:largest_def% = 0:result% = 0
 6345REM First check that the filename exists and it is a template file..
 6346IF NOT FNshell_FileExists(filename$) THEN   result% = -1
 6347IF FNshell_FileType(filename$) <> &FEC THEN result% = -2
 6348IF result% = 0 THEN
 6349  buff%    = FNshell_HeapBlockFetch(13)
 6350  X%       = OPENIN(filename$)  :REM Open the template file
 6351  PTR# X%  = 16                 :REM Skip header info
 6352  REPEAT
 6353    SYS "OS_GBPB",4,X%,buff%,4
 6354    file_offset% = !buff%: REM File offset for this entry
 6355    IF file_offset% > 0 THEN
 6356      nr_templates%   += 1
 6357      indirected_size% = 0
 6358      SYS "OS_GBPB",4,X%,buff%,4
 6359      data_size%  = !buff%         :REM Size of data for this entry
 6360      SYS "OS_GBPB",4,X%,buff%,4   :REM Read entry type
 6361      entry_type% = !buff%         :REM Entry type (1 = window)
 6362      SYS "OS_GBPB",4,X%,buff%,12  :REM Read window identifier string
 6363      old_ptr% = PTR# X%           :REM Save current pointer position..
 6364      PTR# X%  = file_offset% + 56 :REM Move pointer to title flags word..
 6365      SYS "OS_GBPB",4,X%,buff%,4   :REM Read title bar flag word..
 6366      flags% = !buff%
 6367      PTR# X% = file_offset% + 72  :REM Move pointer to start of title bar data..
 6368      SYS "OS_GBPB",4,X%,buff%,12  :REM Read 3 words of title bar data..
 6369      indirected_size%  += FNshell_IconIndirSize(file_offset%,flags%,buff%,X%)
 6370      PTR# X% =  file_offset% + 84 :REM Move pointer to icon count word..
 6371      SYS "OS_GBPB",4,X%,buff%,4   :REM Read nr of icons..
 6372      nr_icons% = !buff%
 6373      IF nr_icons% > 0 THEN
 6374        FOR j% = 0 TO nr_icons% - 1
 6375          PTR# X% = file_offset% + 88 + (j% * 32) + 16
 6376          SYS "OS_GBPB",4,X%,buff%,4 :REM Read icon flag word..
 6377          flags% = !buff%
 6378          PTR# X% = file_offset% + 88 + (j% * 32) + 20
 6379          SYS "OS_GBPB",4,X%,buff%,12  :REM Read 3 words of icon data..
 6380          indirected_size%  += FNshell_IconIndirSize(file_offset%,flags%,buff%,X%)
 6381        NEXT j%
 6382      ENDIF
 6383      PTR# X% = old_ptr%
 6384      total_indirsize% += indirected_size%
 6385      IF data_size% > largest_def% THEN
 6386        largest_def% = data_size%
 6387      ENDIF
 6388    ENDIF
 6389  UNTIL file_offset% = 0
 6390  CLOSE# X%                        :REM Close the template file
 6391  PROCshell_HeapBlockReturn(buff%) :REM Release workspace buffer
 6392  buff_size% =  largest_def% + total_indirsize%
 6393ENDIF
 6394ENDPROC
 6395:
 6396*|Stop PROCshell_TemplateFileInfo2
 6397
 6398*|Start PROCshell_TemplateFileInfo3
 6399DEF PROCshell_TemplateFileInfo3(filename$,RETURN buff_size%,RETURN nr_templates%,RETURN result%)
 6400LOCAL pos%,total_indirsize%,largest_def%,file_offset%
 6401LOCAL buff%
 6402LOCAL ctr%,char%,old_ptr%,nr_icons%,j%,flags%
 6403REM Returns the size of the buffer needed by "Wimp_LoadTemplate"
 6404REM and the number of templates in the file
 6405pos% = 0:nr_templates% = 0:total_indirsize% = 0:largest_def% = 0
 6406buff% = FNshell_HeapBlockFetch(13)
 6407SYS "Wimp_OpenTemplate",,filename$
 6408REPEAT
 6409  $buff% = "*"
 6410  REM the following only works on RISC OS 3...
 6411  SYS "Wimp_LoadTemplate",,-1,,,,buff%,pos% TO ,buff_size%,indirsize%,,,,pos%
 6412  IF pos% <> 0 THEN
 6413    IF buff_size% > largest_def% THEN largest_def% = buff_size%
 6414    total_indirsize% += indirsize%
 6415    nr_templates% += 1
 6416  ENDIF
 6417UNTIL pos% = 0
 6418SYS "Wimp_CloseTemplate"
 6419buff_size% = largest_def% + total_indirsize%
 6420PROCshell_HeapBlockReturn(buff%)
 6421ENDPROC
 6422:
 6423*|Stop PROCshell_TemplateFileInfo3
 6424
 6425*|Start FNRO3_Present
 6426DEF FNRO3_Present
 6427LOCAL blk%,len%,result$
 6428REM Returns TRUE if RISC OS 3 is present, otherwise FALSE
 6429blk% = FNshell_HeapBlockFetch(256)     :REM Claim some workspace
 6430OSCLI("Set RO3$Check Y")    :REM Set a system variable to "Y"
 6431REM The next line sets the system variable to "N" if RISC OS 3 or better is
 6432REM not present.
 6433OSCLI("RMEnsure UtilityModule 3.00 Set RO3$Check N")
 6434REM Now we check the value of the system variable by reading it into a buffer
 6435SYS "OS_ReadVarVal","RO3$Check",blk%,256,0,0 TO ,,len%
 6436REM Add string terminator so that BASIC can read it
 6437blk%?len% = 13
 6438REM Unset the system variable to tidy things up
 6439OSCLI("Unset RO3$Check")
 6440result$ = $blk%
 6441PROCshell_HeapBlockReturn(blk%)
 6442IF result$ = "N" THEN = FALSE ELSE = TRUE
 6443*|Stop FNRO3_Present
 6444
 6445*|Start FNshell_WindowCountIcons
 6446DEF FNshell_WindowCountIcons(wh%)
 6447LOCAL w_buff%,RO3%,nr_icons%
 6448IF (_U%!100 AND 1 << 10) THEN RO3% = TRUE ELSE RO3% = FALSE
 6449IF RO3% THEN
 6450*|ifdef TraceInit
 6451  PROCshell_Tracef0("WindowCountIcons:RISC OS 3 detected..")
 6452*|endif
 6453  IF wh% = -1 THEN wh% = -2 :REM iconbar
 6454  w_buff%  = FNshell_HeapBlockFetch(88)
 6455  !w_buff% = wh%           :REM Store window handle in first word of block
 6456  SYS "Wimp_GetWindowInfo",,w_buff% + 1
 6457  nr_icons% = w_buff%!88
 6458*|ifdef TraceInit
 6459  PROCshell_Tracef0("WindowCountIcons:nr_icons% = "+STR$nr_icons%)
 6460*|endif
 6461ELSE
 6462*|ifdef TraceInit
 6463  PROCshell_Tracef0("WindowCountIcons:RISC OS 3 NOT found..")
 6464*|endif
 6465  w_buff%   = FNshell_HeapBlockFetch(6000)
 6466  IF wh% > 0 THEN
 6467    !w_buff%  = wh%          :REM Store window handle in first word of block
 6468    SYS "Wimp_GetWindowInfo",,w_buff%
 6469    nr_icons% = w_buff%!88
 6470  ENDIF
 6471*|ifdef TraceInit
 6472  PROCshell_Tracef0("WindowCountIcons:nr_icons% = "+STR$nr_icons%)
 6473*|endif
 6474ENDIF
 6475PROCshell_HeapBlockReturn(w_buff%)
 6476= nr_icons%
 6477:
 6478*|Stop FNshell_WindowCountIcons
 6479
 6480*|Start FNshell_SliderGetValue
 6481DEF FNshell_SliderGetValue(handle%)
 6482= (_U%!332 + handle%)!28
 6483:
 6484*|Stop FNshell_SliderGetValue
 6485
 6486*|Start PROCshell_HandleSlider
 6487DEF PROCshell_HandleSlider(wh%,ih%,e_offset%)
 6488LOCAL drag_blk%,x%,y%,blk%,e_blk%
 6489*|ifdef TraceInit
 6490PROCshell_Tracef0("HandleSlider:slider drag event found..")
 6491*|endif
 6492e_blk%    = _U%!332 + e_offset%
 6493drag_blk% = FNshell_HeapBlockFetch(50)
 6494
 6495drag_blk%!0 = wh%
 6496drag_blk%!4 = e_blk%!8              :REM icon nr of background icon
 6497SYS "Wimp_GetIconState",,drag_blk%
 6498blk%    = _U%!328
 6499blk%!00 = 0                         :REM old x position of slider
 6500blk%!04 = drag_blk%!16 - drag_blk%!8:REM length of background icon
 6501blk%!08 = ih%                       :REM slider icon
 6502blk%!12 = e_blk%!12                 :REM display icon
 6503blk%!16 = e_blk%                    :REM address of event block
 6504blk%!24 = e_blk%!24                 :REM address of notify FN string
 6505
 6506drag_blk%!00 = wh%
 6507SYS "Wimp_GetWindowState",,drag_blk%
 6508x% = drag_blk%!04 - drag_blk%!20
 6509y% = drag_blk%!16 - drag_blk%!24
 6510drag_blk%!04 = ih%
 6511SYS "Wimp_GetIconState",,drag_blk%
 6512drag_blk%!04  = 7 :REM drag type
 6513drag_blk%!08 += x%
 6514drag_blk%!12 += y%
 6515drag_blk%!16 += x%
 6516drag_blk%!20 += y%
 6517drag_blk%!24  = drag_blk%!08
 6518drag_blk%!28  = drag_blk%!12
 6519drag_blk%!32  = drag_blk%!24 + blk%!4
 6520drag_blk%!36  = drag_blk%!20
 6521SYS "Wimp_DragBox",,drag_blk%
 6522
 6523PROCshell_HeapBlockReturn(drag_blk%)
 6524_U%!100 = _U%!100 OR 1 << 11 :REM set 'slider drag in progress' flag bit
 6525ENDPROC
 6526:
 6527*|Stop PROCshell_HandleSlider
 6528
 6529*|Start PROCshell_Slider
 6530DEF PROCshell_Slider
 6531LOCAL ptr_blk%,blk%,xp%,slider%,wh%,x%,x$,t_blk%,_value%,void%
 6532ptr_blk% = FNshell_HeapBlockFetch(20)
 6533t_blk%   = _U%!328
 6534SYS "Wimp_GetPointerInfo",,ptr_blk%
 6535wh%     = ptr_blk%!12
 6536slider% = t_blk%!8
 6537xp%     = !ptr_blk%
 6538IF xp% <> !t_blk% THEN
 6539  REM value has changed..
 6540  blk%  = FNshell_HeapBlockFetch(50)
 6541  !blk% = wh%
 6542  SYS "Wimp_GetWindowState",,blk%
 6543  x% = xp% - blk%!4
 6544  blk%!4 = slider%
 6545  SYS "Wimp_GetIconState",,blk%
 6546  SYS "Wimp_DeleteIcon",,blk%
 6547  blk%!04 = wh%
 6548  blk%!16 = x%
 6549  SYS "Wimp_CreateIcon",,blk% + 4
 6550  SYS "Wimp_ForceRedraw",wh%,blk%!8,blk%!12,blk%!8 + t_blk%!4,blk%!20
 6551  _value% = INT(((x% - blk%!8) * 100)/t_blk%!4)
 6552  temp% = t_blk%!16
 6553  temp%!28 = _value%
 6554  IF t_blk%!24 <> -1 THEN
 6555    void% = EVAL("FN" + $(t_blk%!24) + "(_value%)")
 6556  ENDIF
 6557  IF t_blk%!12 >= 0 THEN
 6558    x$ = STR$(_value%)
 6559    PROCshell_IconPutData(wh%,t_blk%!12,x$,-1)
 6560  ENDIF
 6561  WAIT
 6562  !t_blk% = xp%
 6563  PROCshell_HeapBlockReturn(blk%)
 6564ENDIF
 6565PROCshell_HeapBlockReturn(ptr_blk%)
 6566ENDPROC
 6567:
 6568*|Stop PROCshell_Slider
 6569
 6570*|Start FNshell_GetEventListOffset2
 6571DEF FNshell_GetEventListOffset2(wh%,ih%,event_list%,rec_size%,add%)
 6572REM find offset of data in event list block given the window/icon
 6573REM handles. returns -1 if no events found, -2 if heapblock not defined
 6574REM if add% is FALSE. when add is TRUE then the list is extended and the
 6575REM offset to the new record is returned. First word is always size of list!
 6576LOCAL list_size%,ptr%,found%,offset%,empty%,temp%
 6577IF (!event_list% = 0 AND add% = FALSE) THEN = -2:REM no heapblock defined
 6578IF (!event_list% = 0) THEN
 6579  REM no heap block defined and add flag is true...
 6580  !event_list% = FNshell_HeapBlockFetch(rec_size% + 4)
 6581  temp%   = !event_list%
 6582  temp%!0 = rec_size%
 6583  temp%!4 = 0
 6584  temp%!8 = 0
 6585  = 4
 6586ENDIF
 6587temp%      = !event_list%
 6588list_size% = !temp%
 6589
 6590PROCshell_Tracef0("GetEventListOffset2:list size is "+STR$list_size%)
 6591ptr%    = 4
 6592found%  = FALSE
 6593offset% = -1
 6594empty%  = -1
 6595temp%   = !event_list%
 6596REPEAT
 6597  PROCshell_Tracef0("GetEventListOffset2:window handle=&"+STR$~temp%!ptr%)
 6598  REM when scanning list note offset of first empty record for use when
 6599  REM adding a new event to the list. Empty records have 0 for both
 6600  REM window and icon handles
 6601  IF empty% < 0 THEN
 6602    IF (temp%!ptr% = 0 AND temp%!ptr% + 4 = 0) THEN empty% = ptr%
 6603  ENDIF
 6604  IF (temp%!ptr% = wh%) THEN
 6605    REM events attached to no particular icon are registered with
 6606    REM an icon handle of -1
 6607    REM PROCshell_Tracef0("GetEventListOffset2:window handle found")
 6608    IF ih%=-1 THEN
 6609      REM icon handle is -1, so event has been found
 6610      REM PROCshell_Tracef0("GetEventListOffset2:icon handle is -1")
 6611      offset% = ptr%
 6612      found%  = TRUE
 6613    ELSE
 6614      REM check icon handle in event block as well..
 6615*|ifdef PROCshell_TraceInit
 6616      REM PROCshell_Tracef0("GetEventListOffset2:icon handle is not -1")
 6617*|endif
 6618      IF temp%!(ptr% + 4) = ih% THEN
 6619          offset% = ptr%
 6620          found%  = TRUE
 6621      ELSE
 6622        ptr% += rec_size%
 6623      ENDIF
 6624    ENDIF
 6625  ELSE
 6626    REM no match, so check next event..
 6627    ptr% += rec_size%
 6628  ENDIF
 6629UNTIL ((ptr% >= (list_size% + 4)) OR found%)
 6630IF found% THEN
 6631  REM PROCshell_Tracef0("GetEventListOffset2:Event found")
 6632ELSE
 6633  REM PROCshell_Tracef0("GetEventListOffset2:End of event list - event not found")
 6634ENDIF
 6635IF (offset% = -1 AND add%) THEN
 6636  IF empty% < 0 THEN
 6637    REM no empty records found to use for the new one
 6638    offset% = list_size% + 4
 6639    !event_list% = FNshell_HeapBlockExtend(!event_list%,rec_size%)
 6640    temp%    = !event_list%
 6641    temp%!0 += rec_size%
 6642    temp%   += offset%
 6643    temp%!4  = 0
 6644    temp%!8  = 0
 6645  ELSE
 6646    REM re-use old deleted event
 6647    offset% = empty%
 6648  ENDIF
 6649ENDIF
 6650= offset%
 6651:
 6652*|Stop FNshell_GetEventListOffset2
 6653
 6654*|Start PROCshell_SliderSetValue
 6655DEF PROCshell_SliderSetValue(handle%,_value%)
 6656LOCAL e_blk%,slider%,blk%,backgr%,max_x%,displayic%,min_x%
 6657LOCAL min_y%,max_y%
 6658e_blk%    = _U%!332 + handle%
 6659slider%   = e_blk%!04
 6660wh%       = e_blk%!00
 6661backgr%   = e_blk%!08
 6662displayic%= e_blk%!12
 6663blk%      = FNshell_HeapBlockFetch(50)
 6664blk%!00   = wh%
 6665blk%!04   = backgr%
 6666SYS "Wimp_GetIconState",,blk%
 6667max_x%    = blk%!16
 6668min_x%    = blk%!08
 6669min_y%    = blk%!12
 6670max_y%    = blk%!20
 6671blk%!04   = slider%
 6672SYS "Wimp_GetIconState",,blk%
 6673SYS "Wimp_DeleteIcon",,blk%
 6674blk%!04   = wh%
 6675IF _value% > 100 THEN _value% = 100
 6676IF _value% <= 0 THEN
 6677  _value% = 0
 6678  blk%!16 = blk%!8
 6679ELSE
 6680  blk%!16   = min_x% + (max_x% * (_value% / 100)) - (min_x% * (_value% / 100))
 6681ENDIF
 6682e_blk%!28 = _value%
 6683SYS "Wimp_CreateIcon",,blk% + 4
 6684SYS "Wimp_ForceRedraw",wh%,min_x%,min_y%,max_x%,max_y%
 6685IF e_blk%!24 <> -1 THEN
 6686 void% = EVAL("FN" + $(e_blk%!24) + "(_value%)")
 6687ENDIF
 6688IF displayic% >= 0 THEN
 6689  PROCshell_IconPutData(wh%,displayic%,STR$_value%,TRUE)
 6690ENDIF
 6691PROCshell_HeapBlockReturn(blk%)
 6692ENDPROC
 6693:
 6694*|Stop PROCshell_SliderSetValue
 6695
 6696*|Start PROCshell_AttachSliderHandler
 6697DEF FNshell_AttachSliderHandler(wh%,backgic%,slideric%,dispic%,incric%,decric%,notify_fn$)
 6698LOCAL e_blk%,offset%
 6699
 6700REM format of slider handler event block..
 6701REM
 6702REM Each Event...
 6703REM  +00 window handle
 6704REM  +04 icon handle of slider icon
 6705REM  +08 icon handle of background icon
 6706REM  +12 icon handle of value display icon (-1 if none)
 6707REM  +16 icon handle of bump up icon       (-1 if none)
 6708REM  +20 icon handle of bump down icon     (-1 if none)
 6709REM  +24 pointer to block containing FN name to call on value change (-1 if none)
 6710REM  +28 slider value
 6711
 6712REM first set up event block to handle clicks on slider bar itself..
 6713offset% = FNshell_GetEventListOffset2(wh%,slideric%,_U% + 332,32,TRUE)
 6714e_blk%  = _U%!332 + offset% : REM pointer to event list..
 6715
 6716e_blk%!00    = wh%
 6717e_blk%!04    = slideric%
 6718e_blk%!08    = backgic%
 6719e_blk%!12    = dispic%
 6720e_blk%!16    = incric%
 6721e_blk%!20    = decric%
 6722IF notify_fn$ <> "" THEN
 6723  e_blk%!24    = FNshell_HeapBlockFetch(LENnotify_fn$ + 1)
 6724  $(e_blk%!24) = notify_fn$
 6725ELSE
 6726  e_blk%!24  = -1
 6727ENDIF
 6728e_blk%!28    = 0
 6729
 6730IF _U%!328 = 0 THEN _U%!328 = FNshell_HeapBlockFetch(24)
 6731
 6732REM attach click select routines to slider and background..
 6733PROCshell_AttachClickSelect(wh%,slideric%,"_shell_icondrag")
 6734PROCshell_AttachClickSelect(wh%,backgic%,"_shell_icondrag2")
 6735
 6736REM attach click select routines for bump icons (if present)
 6737IF incric% >= 0 THEN
 6738  PROCshell_AttachClickSelect(wh%,incric%,"_shell_sliderbumpupS")
 6739  PROCshell_AttachClickSelect(wh%,decric%,"_shell_sliderbumpdownS")
 6740  PROCshell_AttachClickAdjust(wh%,incric%,"_shell_sliderbumpdownA")
 6741  PROCshell_AttachClickAdjust(wh%,decric%,"_shell_sliderbumpupA")
 6742ENDIF
 6743
 6744= offset%
 6745:
 6746*|Stop PROCshell_AttachSliderHandler
 6747
 6748*|Start FN_shell_icondrag
 6749DEF FN_shell_icondrag(wh%,ih%)
 6750PROCshell_IconDragBox(wh%,ih%)
 6751=0
 6752:
 6753*|Stop FN_shell_icondrag
 6754
 6755*|Start FN_shell_icondrag2
 6756DEF FN_shell_icondrag2(wh%,ih%)
 6757LOCAL e_size%,e_blk%,e_ptr%,found%,slideric%
 6758e_blk%  = _U%!332
 6759e_size% = !e_blk%
 6760e_ptr%  = 4
 6761PROCshell_Tracef0("Event block size is "+STR$e_size%)
 6762REPEAT
 6763  REM scan for background icon handle in slider event block
 6764  IF e_blk%!(e_ptr% + 8) = ih% THEN
 6765    found% = TRUE : slideric% = e_blk%!(e_ptr% + 4)
 6766  ENDIF
 6767  e_ptr% += 32
 6768UNTIL e_ptr% >= e_size% OR found%
 6769PROCshell_IconDragBox(wh%,slideric%)
 6770=0
 6771:
 6772*|Stop FN_shell_icondrag2
 6773
 6774*|Start FN_shell_sliderbumpupS
 6775DEF FN_shell_sliderbumpupS(wh%,ih%)
 6776LOCAL void%
 6777void% = FN_shell_sliderbumpup(wh%,ih%,4)
 6778=0
 6779:
 6780*|Stop FN_shell_sliderbumpupS
 6781
 6782*|Start FN_shell_sliderbumpupA
 6783DEF FN_shell_sliderbumpupA(wh%,ih%)
 6784LOCAL void%
 6785void% = FN_shell_sliderbumpup(wh%,ih%,1)
 6786=0
 6787:
 6788*|Stop FN_shell_sliderbumpupA
 6789
 6790*|Start FN_shell_sliderbumpdownS
 6791DEF FN_shell_sliderbumpdownS(wh%,ih%)
 6792LOCAL void%
 6793void% = FN_shell_sliderbumpdown(wh%,ih%,4)
 6794=0
 6795:
 6796*|Stop FN_shell_sliderbumpdownS
 6797
 6798*|Start FN_shell_sliderbumpdownA
 6799DEF FN_shell_sliderbumpdownA(wh%,ih%)
 6800LOCAL void%
 6801void% = FN_shell_sliderbumpdown(wh%,ih%,1)
 6802=0
 6803:
 6804*|Stop FN_shell_sliderbumpdownA
 6805
 6806*|Start FN_shell_sliderbumpup
 6807DEF FN_shell_sliderbumpup(wh%,ih%,button%)
 6808LOCAL e_size%,e_blk%,e_ptr%,found%,ptr%,_value%,bump_ic%
 6809PROCshell_Tracef0("In sliderbumpup routine")
 6810e_blk%  = _U%!332
 6811e_size% = !e_blk%
 6812e_ptr%  = 4
 6813PROCshell_Tracef0("Event block size is "+STR$e_size%)
 6814IF button% = 4 THEN bump_ic% = 16 ELSE bump_ic% = 20
 6815REPEAT
 6816  REM scan for bump icon handle in slider event block
 6817  IF e_blk%!(e_ptr% + bump_ic%) = ih% THEN
 6818    found% = TRUE : ptr% = e_ptr% :_value% = e_blk%!(ptr% + 28)
 6819    PROCshell_Tracef0("Current slider value = "+STR$_value%)
 6820    PROCshell_Tracef0("Slider handle is     = "+STR$ptr%)
 6821  ENDIF
 6822  e_ptr% += 32
 6823UNTIL e_ptr% >= e_size% OR found%
 6824IF found% THEN
 6825  PROCshell_SliderSetValue(ptr%,_value% + 1)
 6826ENDIF
 6827= 0
 6828:
 6829*|Stop FN_shell_sliderbumpup
 6830
 6831*|Start FN_shell_sliderbumpdown
 6832DEF FN_shell_sliderbumpdown(wh%,ih%,button%)
 6833LOCAL e_size%,e_blk%,e_ptr%,found%,ptr%,_value%,bump_ic%
 6834PROCshell_Tracef0("In sliderbumpdown routine")
 6835e_blk%  = _U%!332
 6836e_size% = !e_blk%
 6837e_ptr%  = 4
 6838PROCshell_Tracef0("Event block size is "+STR$e_size%)
 6839IF button% = 4 THEN bump_ic% = 20 ELSE bump_ic% = 16
 6840REPEAT
 6841  REM scan for bump icon handle in slider event block
 6842  IF e_blk%!(e_ptr% + bump_ic%) = ih% THEN
 6843    found% = TRUE : ptr% = e_ptr% :_value% = e_blk%!(ptr% + 28)
 6844    PROCshell_Tracef0("Current slider value = "+STR$_value%)
 6845    PROCshell_Tracef0("Slider handle is     = "+STR$ptr%)
 6846  ENDIF
 6847  e_ptr% += 32
 6848UNTIL e_ptr% >= e_size% OR found%
 6849IF found% THEN
 6850  PROCshell_SliderSetValue(ptr%,_value% - 1)
 6851ENDIF
 6852= 0
 6853:
 6854*|Stop FN_shell_sliderbumpdown
 6855
 6856*|Start PROCshell_DeleteEventSlider
 6857DEF PROCshell_DeleteEventSlider(wh%,ih%)
 6858REM if I can find which words point to a heap block they could be
 6859REM automatically detected and released. A general purpose routine
 6860REM shell_DeleteEvent could then be written!
 6861REM If ih%=-1 remove all events for window handle wh%
 6862LOCAL offset%,blk%,list_size%,event_list%,temp%
 6863event_list% = _U%!332
 6864REPEAT
 6865  offset% = FNshell_GetEventListOffset2(wh%,ih%,_U%+332,32,FALSE)
 6866*|ifdef TraceInit
 6867  PROCshell_Tracef0("DeleteEventSlider:offset% = " + STR$offset%)
 6868*|endif
 6869  IF offset% >= 0 THEN
 6870    IF ih%=-1 THEN
 6871*|ifdef TraceInit
 6872       PROCshell_Tracef0("DeleteEventSlider:Deleting Slider Event (all events for window handle &"+STR$~wh%+")")
 6873*|endif
 6874    ELSE
 6875*|ifdef TraceInit
 6876      PROCshell_Tracef0("DeleteEventSlider:Deleting Slider Event (window handle was &"+STR$~wh%+" icon handle was "+STR$ih%+")")
 6877*|endif
 6878    ENDIF
 6879    REM event for window/icon is in list
 6880    list_size% = !event_list%
 6881    IF offset% = list_size% - 32 THEN
 6882      REM it is the last one in this list
 6883      IF offset% = 0 THEN
 6884        REM only one event in the list
 6885        PROCshell_HeapBlockReturn(event_list% + offset% + 24)
 6886        PROCshell_HeapBlockReturn(_U%!332)
 6887        _U%!332 = 0
 6888*|ifdef TraceInit
 6889        PROCshell_Tracef0("DeleteEventSlider:No Slider events now registered")
 6890*|endif
 6891      ELSE
 6892        REM more than one event in the list
 6893        _U%!332 = FNshell_HeapBlockExtend(_U%!332,- 32)
 6894        event_list% = _U%!332
 6895        !event_list% -= 32
 6896      ENDIF
 6897    ELSE
 6898      REM not the last one in the list
 6899      blk% = event_list% + offset%
 6900      blk%!0 = 0:blk%!4 = 0
 6901      PROCshell_HeapBlockReturn(blk% + 24)
 6902    ENDIF
 6903  ENDIF
 6904  REM repeat loop until offset%=-1 (event not found)
 6905  REM or offset%=-2 (event block doesn't exist)
 6906UNTIL offset% < 0
 6907ENDPROC
 6908:
 6909*|Stop PROCshell_DeleteEventSlider
 6910
 6911*|Start PROCshell_OpenWindowDynamic
 6912DEF PROCshell_OpenWindowDynamic(template$,preopen_fn$,postopen_fn$)
 6913LOCAL h%,x_off%,y_off%,win_blk%
 6914
 6915PROCshell_CreateWindow(template$,h%)
 6916*|ifdef TraceInit
 6917PROCshell_Tracef0("OpenWindowDynamic:Creating new dynamic window (handle is &"+STR$~h%+")")
 6918*|endif
 6919win_blk%   = FNshell_HeapBlockFetch(36)
 6920win_blk%!0 = h%
 6921SYS "Wimp_GetWindowState",,win_blk%
 6922x_off% = (win_blk%!04 - win_blk%!12) / 2
 6923y_off% = (win_blk%!16 - win_blk%!08) / 2
 6924PROCshell_HeapBlockReturn(win_blk%)
 6925IF _U%!20 <> 0 THEN
 6926  REM Delete last dynamic window opened..
 6927  SYS "Wimp_CreateMenu",,-1
 6928  void%=FNshell_DeleteWindow(_U%!20)
 6929ENDIF
 6930_U%!20 = wh%
 6931IF preopen_fn$ <> "" THEN
 6932*|ifdef TraceInit
 6933  PROCshell_Tracef0("OpenWindowDynamic:Calling Pre-Open FN '"+preopen_fn$+"'")
 6934*|endif
 6935  void% = EVAL("FN" + preopen_fn$ + "(" + STR$h% + ")")
 6936ELSE
 6937*|ifdef TraceInit
 6938  PROCshell_Tracef0("OpenWindowDynamic:No Pre-Open FN")
 6939*|endif
 6940ENDIF
 6941PROCshell_OpenWindowDynamic2(h%,x_off%,y_off%)
 6942IF postopen_fn$ <> "" THEN
 6943*|ifdef TraceInit
 6944  PROCshell_Tracef0("OpenWindowDynamic:Calling Post-Open FN '"+postopen_fn$+"'")
 6945*|endif
 6946  void% = EVAL("FN" + postopen_fn$ + "(" + STR$h% + ")")
 6947ELSE
 6948*|ifdef TraceInit
 6949  PROCshell_Tracef0("OpenWindowDynamic:No Post-Open FN")
 6950*|endif
 6951ENDIF
 6952ENDPROC
 6953:
 6954*|Stop PROCshell_OpenWindowDynamic
 6955
 6956*|Start PROCshell_InteractiveHelpOn
 6957DEF PROCshell_InteractiveHelpOn
 6958IF (_U%!100 AND 1 << 12) <> 0 THEN
 6959ELSE
 6960  _U%!100 = _U%!100 EOR 1 << 12
 6961ENDIF
 6962ENDPROC
 6963:
 6964*|Stop PROCshell_InteractiveHelpOn
 6965
 6966*|Start PROCshell_InteractiveHelpOff
 6967DEF PROCshell_InteractiveHelpOff
 6968IF (_U%!100 AND 1 << 12) <> 0 THEN
 6969  _U%!100 = _U%!100 EOR 1 << 12
 6970ENDIF
 6971ENDPROC
 6972:
 6973*|Stop PROCshell_InteractiveHelpOff
 6974
 6975*|Start PROCshell_MessageSendPrintSave
 6976DEF PROCshell_MessageSendPrintSave(FileType%,copies%)
 6977IF copies% > 1 THEN _U%!336 = copies% - 1 ELSE _U%!336 = 0
 6978PROCshell_DoSendPrintSave(FileType%)
 6979ENDPROC
 6980:
 6981*|Stop PROCshell_MessageSendPrintSave
 6982
 6983*|Start PROCshell_DoSendPrintSave
 6984DEF PROCshell_DoSendPrintSave(FileType%)
 6985LOCAL msgblk%
 6986msgblk%    = FNshell_HeapBlockFetch(256)
 6987msgblk%!0  = 256       :REM length of message block
 6988msgblk%!12 = 0         :REM myref 0=originating
 6989msgblk%!16 = &80142    :REM message action (PrintSave)
 6990msgblk%!20 = 0         :REM destination window handle
 6991msgblk%!24 = 0         :REM destination icon handle
 6992msgblk%!28 = 0         :REM mouse x coord
 6993msgblk%!32 = 0         :REM mouse y coord
 6994msgblk%!36 = 256       :REM estimated size of file
 6995msgblk%!40 = FileType% :REM file type
 6996$(msgblk% + 44) = "PrintOut" + CHR$(0)
 6997*|ifdef TraceInit
 6998PROCshell_Tracef0("MessageSendPrintSave:Sending PrintSave message..")
 6999*|endif
 7000SYS "Wimp_SendMessage",18,msgblk%,msgblk%!20,msgblk%!24
 7001PROCshell_HeapBlockReturn(msgblk%)
 7002ENDPROC
 7003:
 7004*|Stop PROCshell_DoSendPrintSave
 7005
 7006*|Start PROCshell_HandlePrintFile
 7007DEF PROCshell_HandlePrintFile(_Q%)
 7008*|ifdef TraceInit
 7009PROCshell_Tracef0("HandlePrintFile:Message_PrintFile received")
 7010*|endif
 7011ENDPROC
 7012:
 7013*|Stop PROCshell_HandlePrintFile
 7014
 7015*|Start PROCshell_HandlePrintError
 7016DEF PROCshell_HandlePrintError(_Q%)
 7017*|ifdef TraceInit
 7018PROCshell_Tracef0("HandlePrintError:Message_PrintError received")
 7019*|endif
 7020ENDPROC
 7021:
 7022*|Stop PROCshell_HandlePrintError
 7023
 7024*|Start PROCshell_HandlePrintTypeOdd
 7025DEF PROCshell_HandlePrintTypeOdd(_Q%)
 7026*|ifdef TraceInit
 7027PROCshell_Tracef0("HandlePrintTypeOdd:Message_PrintTypeOdd received")
 7028*|endif
 7029ENDPROC
 7030:
 7031*|Stop PROCshell_HandlePrintTypeOdd
 7032
 7033*|Start PROCshell_HandleSetPrinter
 7034DEF PROCshell_HandleSetPrinter(_Q%)
 7035*|ifdef TraceInit
 7036PROCshell_Tracef0("HandleSetPrinter:Message_SetPrinter received")
 7037*|endif
 7038ENDPROC
 7039:
 7040*|Stop PROCshell_HandleSetPrinter
 7041
 7042*|Start FNshell_PrinterDriverLoaded
 7043DEF FNshell_PrinterDriverLoaded
 7044LOCAL flgs%
 7045SYS "XPDriver_Info" TO ;flgs%
 7046IF flgs% AND 1 THEN = FALSE ELSE = TRUE
 7047:
 7048*|Stop FNshell_PrinterDriverLoaded
 7049
 7050*|Start FNshell_PrinterDriverGetName
 7051DEF FNshell_PrinterDriverGetName
 7052LOCAL flgs%,name%
 7053SYS "XPDriver_Info" TO ,,,,name%;flgs%
 7054IF flgs% AND 1 THEN = "" ELSE = FNshell_GetString(name%)
 7055:
 7056*|Stop FNshell_PrinterDriverGetName
 7057
 7058*|Start FNshell_IconGetBGColour
 7059DEF FNshell_IconGetBGColour(wh%,ih%)
 7060LOCAL col%,icon_blk%
 7061icon_blk%=FNshell_HeapBlockFetch(40)
 7062icon_blk%!0=wh%
 7063icon_blk%!4=ih%
 7064SYS "Wimp_GetIconState",,icon_blk%
 7065col% = (icon_blk%!24 >> 28) AND %1111
 7066PROCshell_HeapBlockReturn(icon_blk%)
 7067= col%
 7068:
 7069*|Stop FNshell_IconGetBGColour
 7070
 7071*|Start FNshell_IconGetFGColour
 7072DEF FNshell_IconGetFGColour(wh%,ih%)
 7073LOCAL col%,icon_blk%
 7074icon_blk%=FNshell_HeapBlockFetch(40)
 7075icon_blk%!0=wh%
 7076icon_blk%!4=ih%
 7077SYS "Wimp_GetIconState",,icon_blk%
 7078col% = (icon_blk%!24 >> 24) AND %1111
 7079PROCshell_HeapBlockReturn(icon_blk%)
 7080= col%
 7081:
 7082*|Stop FNshell_IconGetFGColour
 7083
 7084*|Start PROCshell_AttachPopupMenu
 7085DEF PROCshell_AttachPopupMenu(wh%,menuic%,dispic%,menu%,notify_fn$)
 7086PROCshell_DoAttachPopupHandler(wh%,menuic%,dispic%,menu%,notify_fn$,0)
 7087ENDPROC
 7088:
 7089*|Stop PROCshell_AttachPopupMenu
 7090
 7091*|Start PROCshell_AttachColourPopupMenu
 7092DEF PROCshell_AttachColourPopupMenu(wh%,menuic%,dispic%,menu%,notify_fn$)
 7093PROCshell_DoAttachPopupHandler(wh%,menuic%,dispic%,menu%,notify_fn$,1)
 7094ENDPROC
 7095:
 7096*|Stop PROCshell_AttachColourPopupMenu
 7097
 7098*|Start PROCshell_AttachPopupHandler
 7099DEF PROCshell_DoAttachPopupHandler(wh%,menuic%,dispic%,menu%,notify_fn$,flag%)
 7100LOCAL e_blk%,offset%
 7101
 7102REM format of popup handler event block..
 7103REM
 7104REM Each Event...
 7105REM  +00 window handle
 7106REM  +04 icon handle of menu icon
 7107REM  +08 icon handle of value display icon (-1 if none)
 7108REM  +12 pointer to block containing FN name to call on value change (-1 if none)
 7109REM  +16 flag word bit 0 set if a wimp colour menu is being used
 7110REM  +20 menu handle to attach
 7111
 7112offset% = FNshell_GetEventListOffset2(wh%,menuic%,_U% + 340,24,TRUE)
 7113e_blk%  = _U%!340 + offset% : REM pointer to event list..
 7114
 7115e_blk%!00    = wh%
 7116e_blk%!04    = menuic%
 7117e_blk%!08    = dispic%
 7118IF notify_fn$ <> "" THEN
 7119  e_blk%!12    = FNshell_HeapBlockFetch(LENnotify_fn$ + 1)
 7120  $(e_blk%!12) = notify_fn$
 7121ELSE
 7122  e_blk%!12  = -1
 7123ENDIF
 7124e_blk%!16 = flag%
 7125e_blk%!20 = menu%
 7126
 7127IF wh% > 0 AND menuic% >= 0 THEN PROCshell_IconSetButtonType(wh%,menuic%,3)
 7128ENDPROC
 7129:
 7130*|Stop PROCshell_DoAttachPopupHandler
 7131
 7132*|Start PROCshell_DoPopupSelect
 7133DEF PROCshell_DoPopupSelect(_Q%,offset%)
 7134LOCAL e_blk%,notify_fn$
 7135REM format of popup handler event block..
 7136REM
 7137REM Each Event...
 7138REM  +00 window handle
 7139REM  +04 icon handle of menu icon
 7140REM  +08 icon handle of value display icon (-1 if none)
 7141REM  +12 pointer to block containing FN name to call on value change (-1 if none)
 7142REM  +16 flag word bit 0 set if a wimp colour menu is being used
 7143REM  +20 menu handle to attach
 7144e_blk%  = _U%!340 + offset%
 7145
 7146IF e_blk%!12 = -1 THEN
 7147  REM no notify FN, just put menu text into display icon, or set background colour
 7148  REM of display icon if a colour menu is involved...
 7149  IF e_blk%!16 = 0 THEN
 7150    PROCshell_IconPutData(!e_blk%,e_blk%!08,FNshell_MenuGetItemText(e_blk%!20,!_Q%),TRUE)
 7151  ELSE
 7152    PROCshell_IconSetBGColour(!e_blk%,e_blk%!08,!_Q%)
 7153  ENDIF
 7154ELSE
 7155  notify_fn$ = $(e_blk%!12)
 7156ENDIF
 7157ENDPROC
 7158:
 7159*|Stop PROCshell_DoPopupSelect
 7160
 7161*|Start FNshell_3DEnabled
 7162DEF FNshell_3DEnabled
 7163LOCAL val%,_3d%
 7164IF _U%!100 AND (1 << 10) THEN
 7165  REM RISC OS 3 detected..
 7166  SYS "OS_Byte",161,140 TO ,,val%
 7167  IF (val% AND 1) THEN _3d% = TRUE ELSE _3d% = FALSE
 7168ELSE
 7169  REM No RISC OS 3..
 7170  _3d% = FALSE
 7171ENDIF
 7172= _3d%
 7173:
 7174*|Stop FNshell_3DEnabled
 7175
 7176*|Start PROCshell_MenuDelete
 7177DEF PROCshell_MenuDelete(handle%,recursive%)
 7178LOCAL ptr%,list_size%,event_list%
 7179IF handle% <> 0 THEN
 7180  SYS "XMenuUtil_Delete",handle%,recursive%
 7181  list_size%  = FNshell_HeapBlockInfo(_U%!12) - 8
 7182  event_list% = _U%!12
 7183  REPEAT
 7184    IF (event_list%!(ptr% + 8) = handle%) THEN
 7185      event_list%!(ptr% + 8) = 0 :REM remove reference to menu handle (detach)
 7186    ELSE
 7187      ptr% += 48
 7188    ENDIF
 7189  UNTIL (ptr% >= list_size%)
 7190ENDIF
 7191ENDPROC
 7192:
 7193*|Stop PROCshell_MenuDelete
 7194
 7195*|Start PROCshell_HandleAttachedDataSave
 7196DEF PROCshell_HandleAttachedDataSave(_Q%,wh%,ih%)
 7197LOCAL e_offset%,blk%,name_ic%,_name$,temp%,void%
 7198REM check filename in icon if datasave event exists
 7199REM icon was 0.....
 7200PROCshell_DataSaveCheckName(wh%,ih%)
 7201REM check if an event has been registered for when the drag ends..
 7202e_offset% = FNshell_GetEventListOffset(wh%,-1,_U% + 72,24,FALSE)
 7203IF e_offset% >= 0 THEN
 7204  blk% = _U%!72 + e_offset%
 7205  name_ic% = blk%!16
 7206  _name$   = FNshell_IconGetData(wh%,name_ic%)
 7207  temp%    = blk%!20
 7208  IF $temp% <> "" THEN void% = EVAL("FN" + $temp%+"(_name$)")
 7209ENDIF
 7210ENDPROC
 7211:
 7212*|Stop PROCshell_HandleAttachedDataSave
� >EvntShell:ShellLib
"*|Start FNshell_LibraryVersion
� �shell_LibraryVersion
=1.33 * 100
� 30/05/94
� 1.33b
 � Added PROCshell_MenuDelete
S� Added Calling of DataSave routines when SELECT & ADJUST pressed over icon 0  
	:

!*|Stop FNshell_LibraryVersion

/� routine to find handle of parent needed..

?� or search all submenu handles so that it can be changed..
N� or store a list of menu item handles together with the submenu handles..

*|Start PROCshell_Error
� �shell_Error
� pos%,report$
� ON ERROR OFF
� � <> &D00 � � <> &903 �
  � fatal error..
  È™ "XHourglass_Smash"
^  � �shell_OSCheckVersion(3) � �shell_FileExists("Resources:$.Resources.Edit.ThrowBack") �
    �shell_Exit
=    �("Set Basic$File <"+�shell_GetAppName+"$BasicFile>")
    � "Edit:ThrowBack"
  �
L    �shell_ErrorBox("Unexpected error:- "+�$+" Internal error code "+Þ)
	    �
  �
�
 G  � Non-fatal error from shell_OK, or out of memory error from heap
!<  � manager routines....strip out name of library file..
"4  pos% = ��$,"in " + �34 + "EvntShell:ShellLib")
#*  � pos% > 0 � report$ = ��$,pos% - 1)
$  �shell_ErrorBox(report$)
%�
&È™ "XHourglass_Smash"
'� RESTORE ERROR
(�
):
**|Stop PROCshell_Error
+
,*|Start PROCshell_OK
-� �shell_OK(e$)
.
� &D00,e$
/�
0:
1*|Stop PROCshell_OK
2
3*|Start PROCshell_ErrorBox
4� �shell_ErrorBox(r$)
5� r%,err_blk%
6err_blk% = _shell_blk%
7-!err_blk% = �:$(err_blk% + 4) = r$ + �(0)
8� � = &D00 � � = &903 �
9U  ș "XWimp_ReportError",err_blk%,%10001,"Message from " + �shell_GetAppName � r%
:�
;>  ș "XWimp_ReportError",err_blk%,1,�shell_GetAppName � r%
<�
=#� IF r%=2 THEN _closedown%=TRUE
>�
?:
@*|Stop PROCshell_ErrorBox
A
B)*|Start FNshell_GetLastSecureFileName
C"� �shell_GetLastSecureFileName
D� temp%
Etemp%=_U%!80
F� temp%=0 � =""
G=$temp%
H:
I(*|Stop FNshell_GetLastSecureFileName
J
K*|Start FNshell_GetString
L � �shell_GetString(Address%)
M� String$,Len%
N&ȕ ((Address%?Len%)>31 � Len%<255)
O  String$+=�(Address%?Len%)
P
  Len%+=1
Q�
R=String$
S:
T*|Stop FNshell_GetString
U
V#*|Start FNshell_GetEventHandler
W-� �shell_GetEventHandler(wh%,ic%,e_type%)
X,� ptr%,event_list%,found%,list_size%,fn$
Y� wh%=-1 � wh%=-2
Z-list_size%=�shell_HeapBlockInfo(_U%!12)-8
[
ptr%=0
\found%=�
]event_list%=_U%!12
^
fn$=""
_�
`   � (event_list%!ptr%=wh%) �
a!    Ȏ event_list%!(ptr%+4) �
b    � -1
c2      � window handle found, icon handle is -1
dA      � check that a pointer has been defined to a heap block
e@      � containing a function name (if it is 0 then no event
f      � defined)...
g7      � event_list%!(ptr%+(12+(e_type%*4)))>&8000 �
h6        fn$=$(event_list%!(ptr%+(12+(e_type%*4))))
i        found%=�
j      �
k        ptr%+=48
l      �
m	    
n7      � check icon handle in event block as well...
o&      � event_list%!(ptr%+4)=ic% �
p5        � window/icon handle event block found...
qC        � check that a pointer has been defined to a heap block
rB        � containing a function name (if it is 0 then no event
s        � defined)...
t9        � event_list%!(ptr%+(12+(e_type%*4)))>&8000 �
u8          fn$=$(event_list%!(ptr%+(12+(e_type%*4))))
v          found%=�
w
        �
x          ptr%+=48
y
        �
z      �
{        ptr%+=48
|      �
}	    �
~  �
    ptr%+=48
�  �
�#� ((ptr%>=list_size%) � found%)
�=fn$
�:
�"*|Stop FNshell_GetEventHandler
�
� *|Start FNshell_GetEventMenu
�*� �shell_GetEventMenu(button%,wh%,ic%)
�.� ptr%,event_list%,found%,list_size%,menu%
�� wh%=-1 � wh%=-2
�-list_size%=�shell_HeapBlockInfo(_U%!12)-8
�
ptr%=0
�found%=�
�event_list%=_U%!12
�
fn$=""
�1� PROCshell_Tracef0("GetEventMenu:Started..")
�>� PROCshell_Tracef0("GetEventMenu:button is "+STR$button%)
�:� PROCshell_Tracef0("GetEventMenu:window is "+STR$wh%)
�:� PROCshell_Tracef0("GetEventMenu:icon   is "+STR$ic%)
��
�   � (event_list%!ptr%=wh%) �
�?    �shell_Tracef0("GetEventMenu:window handle matched..") 
�&    � event_list%!(ptr%+4) = ic% �
�C      � PROCshell_Tracef0("GetEventMenu:icon handle matched..")
�$      menu%=event_list%!(ptr%+8)
�$      � menu%=-2 � menu%=_U%!252
�      found%=�
�	    �
�G      � PROCshell_Tracef0("GetEventMenu:icon handle NOT matched..")
�-      � IF event_list%!(ptr%+4) = -1 THEN
�      �   IF button%=2 THEN
�*      �     menu%=event_list%!(ptr%+8)
�.      �     IF menu%=-2 THEN menu%=_U%!252
�      �     found%=TRUE
�      �   ELSE
�      �     ptr%+=48
�      �   ENDIF
�      � ELSE
�      � ptr%+=48
�      � ENDIF
�	    �
�  �
�ptr% += 48
�!� (ptr%>=list_size% � found%)
�
=menu%
�:
�*|Stop FNshell_GetEventMenu
�
�&*|Start FNshell_GetEventListOffset
�C� �shell_GetEventListOffset(wh%,ih%,event_list%,rec_size%,add%)
�C� find offset of data in event list block given the window/icon
�I� handles. returns -1 if no events found, -2 if heapblock not defined
�J� if add% is FALSE. when add is TRUE then the list is extended and the
�+� offset to the new record is returned.
�1� list_size%,ptr%,found%,offset%,empty%,temp%
�<� (!event_list%=0 � add%=�) � =-2:� no heapblock defined
�� (!event_list%=0) �
�5  � no heap block defined and add flag is true...
�3  !event_list%=�shell_HeapBlockFetch(rec_size%)
�,  temp%=!event_list%:temp%!0=0:temp%!4=0
�  =0
��
�3list_size%=�shell_HeapBlockInfo(!event_list%)-8
�(ptr%=0:found%=�:offset%=-1:empty%=-1
�temp%=!event_list%
��
�O  � PROCshell_Tracef0("GetEventListOffset:window handle=&"+STR$~temp%!ptr%)
�I  � when scanning list note offset of first empty record for use when
�E  � adding a new event to the list. Empty records have 0 for both
�  � window and icon handles
�  � empty%<0 �
�7    � (temp%!ptr%=0 � temp%!ptr%+4=0) � empty%=ptr%
�  �
�  � (temp%!ptr%=wh%) �
�C    � events attached to no particular icon are registered with
�    � an icon handle of -1
�E    � PROCshell_Tracef0("GetEventListOffset:window handle found")
�    � ih%=-1 �
�6      � icon handle is -1, so event has been found
�E      � PROCshell_Tracef0("GetEventListOffset:icon handle is -1")
�      offset%=ptr%
�      found%=�
�	    �
�6      � check icon handle in event block as well..
�*|ifdef PROCshell_TraceInit
�D      �shell_Tracef0("GetEventListOffset:icon handle is not -1")
�*|endif
�       � temp%!(ptr%+4)=ih% �
�          offset%=ptr%
�          found%=�
�      �
�        ptr%+=rec_size%
�      �
�	    �
�  �
�)    � no match, so check next event..
�    ptr%+=rec_size%
�  �
�#� ((ptr%>=list_size%) � found%)
�� found% �
�;  � PROCshell_Tracef0("GetEventListOffset:Event found")
��
�S  � PROCshell_Tracef0("GetEventListOffset:End of event list - event not found")
��
�� (offset%=-1 � add%) �
�  � empty%<0 �
�7    � no empty records found to use for the new one
�    offset%=list_size%
�C    !event_list%=�shell_HeapBlockExtend(!event_list%,rec_size%)
�    temp%=!event_list%
�*    temp%+=offset%:temp%!0=0:temp%!4=0
�  �
�"    � re-use old deleted event
�    offset%=empty%
�  �
��
�=offset%
�:
�%*|Stop FNshell_GetEventListOffset
�
� *|Start PROCshell_AttachPane
�@� �shell_AttachPane(wh%,� pane_handle%,flags%,x_off%,y_off%)
�4� blk%,offset%,temp%,nr_pane_events%,pane_flags%
�7�shell_Tracef0("AttachPane:Attaching Pane Handler")
�G� first check that the flags of the pane window are correctly set..
�3pane_flags%=�shell_WindowGetFlags(pane_handle%)
�� (pane_flags% � 1<<5)=0 �
�Q  �shell_Tracef0("AttachPane:'Pane' bit of pane window is not set, fixing..")
1  �shell_WindowToggleFlags(pane_handle%,1<<5)
�
� (pane_flags% � 1<<1) �
Q  �shell_Tracef0("AttachPane:'Moveable' bit of pane window is set, fixing..")
1  �shell_WindowToggleFlags(pane_handle%,1<<1)
�
9offset%=�shell_GetEventListOffset(wh%,-1,_U%+92,24,�)
� offset%<0 �
$  � no existing pane event block
	<  �shell_Tracef0("AttachPane:Creating pane event block")

;  offset%=�shell_GetEventListOffset(wh%,-1,_U%+92,24,�)
  blk%=_U%!92+offset%
  blk%!0=wh%:blk%!4=-1

%  blk%!8=�shell_HeapBlockFetch(4)
&  blk%!12=�shell_HeapBlockFetch(4)
&  blk%!16=�shell_HeapBlockFetch(4)
&  blk%!20=�shell_HeapBlockFetch(4)
  temp%=blk%!8:!temp%=-1
  temp%=blk%!12:!temp%=-1
  temp%=blk%!16:!temp%=-1
  temp%=blk%!20:!temp%=-1
�
blk%=_U%!92+offset%
)temp%=blk%!8:ctr%=0:nr_pane_events%=0
È• temp%!ctr%<>-1

  ctr%+=4
  nr_pane_events%+=1
�
+blk%!8=�shell_HeapBlockExtend(blk%!8,4)
7temp%=blk%!8:temp%!(nr_pane_events%*4)=pane_handle%
$temp%!((nr_pane_events%+1)*4)=-1
-blk%!12=�shell_HeapBlockExtend(blk%!12,4)
 2temp%=blk%!12:temp%!(nr_pane_events%*4)=flags%
!$temp%!((nr_pane_events%+1)*4)=-1
"-blk%!16=�shell_HeapBlockExtend(blk%!16,4)
#2temp%=blk%!16:temp%!(nr_pane_events%*4)=x_off%
$$temp%!((nr_pane_events%+1)*4)=-1
%-blk%!20=�shell_HeapBlockExtend(blk%!20,4)
&2temp%=blk%!20:temp%!(nr_pane_events%*4)=y_off%
'$temp%!((nr_pane_events%+1)*4)=-1
(�
):
**|Stop PROCshell_AttachPane
+
,$*|Start PROCshell_AttachDataLoad
-7� �shell_AttachDataLoad(wh%,ih%,type%,fn$,no_load%)
.!� blk%,temp%,offset%,cmdline$
/?�shell_Tracef0("AttachDataLoad:Attaching DataLoad Handler")
0� wh%=-1 � wh%=-2
1$� no_load% � type%=type% � 1<<31
2:offset%=�shell_GetEventListOffset(wh%,ih%,_U%+96,16,�)
3>� modify above to set first two words to 0 to denote a new
4� empty event block
5blk%=_U%!96+offset%
6
7� blk%!0=0 � blk%!4=0 �
8!  � this is first event......
9J  �shell_Tracef0("AttachDataLoad:This is the first DataLoad Event...")
:  blk%!0=wh%:blk%!4=ih%
;%  blk%!8=�shell_HeapBlockFetch(8)
<  temp%=blk%!8
=  temp%!0=type%:temp%!4=-1
>&  blk%!12=�shell_HeapBlockFetch(8)
?  temp%=blk%!12
@-  temp%!0=�shell_HeapBlockFetch(�(fn$)+1)
A  temp%!4=-1
B  temp%=temp%!0:$temp%=fn$
C�
D9  � adding new filetype/function to an existing event
E$  � extend filetype heapblock...
FH  �shell_Tracef0("AttachDataLoad:This is another DataLoad Event...")
G-  blk%!8=�shell_HeapBlockExtend(blk%!8,4)
H&  � and function name heapblock...
I/  blk%!12=�shell_HeapBlockExtend(blk%!12,4)
J4  � find out how many filetypes there are now...
K  ctr%=0:temp%=blk%!8
L  È• temp%!ctr%<>-1
M    ctr%+=4
N  �
O(  temp%!ctr%=type%:temp%!(ctr%+4)=-1
P  temp%=blk%!12
Q.  temp%!ctr%=�shell_HeapBlockFetch(�fn$+1)
R!  temp%=temp%!ctr%:$temp%=fn$
S�
TK� Now check if program was started by double clicking on a data file...
U$cmdline$ = �shell_GetCmdLineArgs
V8�shell_Tracef0("AttachDataLoad:cmdline  ="+cmdline$)
WE�shell_Tracef0("AttachDataLoad:flag bit ="+�((_U%!100 � 1 << 5)))
X5�shell_Tracef0("AttachDataLoad:wh%      ="+�~wh%)
Y7�shell_Tracef0("AttachDataLoad:type%    ="+�~type%)
Z5� cmdline$ <> "" � wh% < 0 � (_U%!100 � 1 << 5) �
[C  � It was, check file is correct type, ignoring the top bit...
\A  � type% � 1 << 31 � temp% = type% � 1 << 31 � temp% = type%
]+  � �shell_FileType(cmdline$) = temp% �
^    � It is, so load it...
_7    �shell_Tracef0("AttachDataLoad:Loading file..")
`2    �shell_MessageSendDataLoad(temp%,cmdline$)
aG    _U%!100 = _U%!100 � (1 << 5) : � Unset load pending flag bit...
b  �
c�
d�
e:
f#*|Stop PROCshell_AttachDataLoad
g
h$*|Start PROCshell_AttachDataSave
i@� �shell_AttachDataSave(wh%,ih%,address%,type%,name_ic%,fn$)
j� blk%,temp%,offset%
k<� check file icon is a sprite icon, complain otherwise..
lT� � �shell_IconIsSprite(wh%,ih%) � �shell_OK(�shell_MessageNoArgs("SHELLMSG29"))
m7� change file type icon button type to click/drag..
n'�shell_IconSetButtonType(wh%,ih%,6)
o>� address%=0 � address%=100:� estimated size - wild guess.
p*|ifdef TraceInit
qb�shell_Tracef0("AttachDataSave:Attaching DataSave Handler to icon "+�ih%+" in window &"+�~wh%)
rB�shell_Tracef0("AttachDataSave:Handler function is '"+fn$+"'")
s*|endif
t:offset%=�shell_GetEventListOffset(wh%,ih%,_U%+72,24,�)
ublk%=_U%!72+offset%
v7blk%!0=wh%:blk%!4=ih%:blk%!8=address%:blk%!12=type%
wblk%!16=name_ic%
x+blk%!20=�shell_HeapBlockFetch(�(fn$)+1)
ytemp%=blk%!20:$temp%=fn$
zȎ type% �
{  � &FF9
|:    � kludge for sprite files as first word should not
}    � be saved
~    � address%>&8000 �
2      _U%!136=�shell_HeapBlockInfo(address%)-8
�	    �
�      _U%!136=address%
�	    �
�  
�    � address%>&8000 �
�2      _U%!136=�shell_HeapBlockInfo(address%)-4
�	    �
�      _U%!136=address%
�	    �
��
�_U%!140=type%
�L� _U%!144 holds address of file heapblock buffer. If address%<&8000 then
�K� file is not in a buffer and address% is actually the estimated size..
�_U%!144=address%
��
�:
�#*|Stop PROCshell_AttachDataSave
�
� *|Start PROCshell_AttachMenu
�8� �shell_AttachMenu(wh%,ic%,menu%,shift%,ctrl%,alt%)
�
� offset%
�:� wh%>0 � ic%>=0 � �shell_IconSetButtonType(wh%,ic%,3)
�,offset%=�shell_SearchStatic(_U%!184,wh%)
�@� offset%=-1 � �shell_OK(�shell_MessageNoArgs("SHELLMSG30"))
�*|ifdef TraceInit
�\�shell_Tracef0("AttachMenu:Attaching menu handle &"+�~menu%+" to window handle &"+�~wh%)
�*|endif
�'�shell_EventAdd(wh%,ic%,0,menu%,"")
��
�:
�*|Stop PROCshell_AttachMenu
�
�%*|Start PROCshell_AttachMenuMaker
�)� �shell_AttachMenuMaker(wh%,ic%,fn$)
�L�shell_Tracef0("AttachMenuMaker:Attaching menumaker function '"+fn$+"'")
�$�shell_EventAdd(wh%,ic%,1,0,fn$)
��
�:
�$*|Stop PROCshell_AttachMenuMaker
�
�$*|Start PROCshell_AttachMenuDBox
�A� �shell_AttachMenuDBox(item%,window$,preopenfn$,postopenfn$)
�@� Check current submenu handle. We should release any memory
�@� allocated by previous calls (when I work out how to do it)
�� blk%,temp%,addr%
�V� � �shell_WindowLoaded(window$) � � 99,�shell_MessageOneArg("SHELLMSG03",window$)
�"blk%=�shell_HeapBlockFetch(12)
�,blk%!0=�shell_HeapBlockFetch(�window$+1)
�temp%=blk%!0:$temp%=window$
�/blk%!4=�shell_HeapBlockFetch(�preopenfn$+1)
�"temp%=blk%!4:$temp%=preopenfn$
�0blk%!8=�shell_HeapBlockFetch(�postopenfn$+1)
�#temp%=blk%!8:$temp%=postopenfn$
�;� Store address of heapblock in submenu pointer word of
�/� menu item definition. Cunning huh........
�$ș "MenuUtil_SubMenu",item%,blk%
�ș "MenuUtil_Warning",,�
��
�:
�#*|Stop PROCshell_AttachMenuDBox
�
�'*|Start PROCshell_AttachClickSelect
�+� �shell_AttachClickSelect(wh%,ic%,fn$)
�$�shell_EventAdd(wh%,ic%,2,0,fn$)
��
�:
�&*|Stop PROCshell_AttachClickSelect
�
�'*|Start PROCshell_AttachClickAdjust
�+� �shell_AttachClickAdjust(wh%,ic%,fn$)
�$�shell_EventAdd(wh%,ic%,3,0,fn$)
��
�:
�&*|Stop PROCshell_AttachClickAdjust
�
�&*|Start PROCshell_AttachUserRedraw
�(� �shell_AttachUserRedraw(� wh%,fn$)
�
� blk%,f%
�"blk%=�shell_HeapBlockFetch(40)
�,!blk%=wh%:ș "Wimp_GetWindowState",,blk%
�f%=blk%!32
� �shell_HeapBlockReturn(blk%)
�;� PROCshell_Tracef0("AttachUserRedraw:flag%=&"+STR$~f%)
�� (f% � 1<<4) �
�*|ifdef TraceInit
�:  �shell_Tracef0("AttachUserRedraw:auto redraw set!!")
�*|endif
�G  � store original handle in case the wimp allocates a new handle..
�*  �shell_WindowToggleFlags(wh%,1 << 4)
��
�#�shell_EventAdd(wh%,-1,4,0,fn$)
��
�:
�%*|Stop PROCshell_AttachUserRedraw
�
� *|Start PROCshell_AttachDrag
�.� �shell_AttachDrag(wh%,ic%,est_size%,fn$)
�$�shell_EventAdd(wh%,ic%,6,0,fn$)
��
�:
�*|Stop PROCshell_AttachDrag
�
�#*|Start PROCshell_AttachHelpTag
�(� �shell_AttachHelpTag(wh%,ic%,tag$)
�%�shell_EventAdd(wh%,ic%,8,0,tag$)
��
�:
�"*|Stop PROCshell_AttachHelpTag
�
�*|Start PROCshell_EventAdd
�0� �shell_EventAdd(wh%,ic%,e_type%,menu%,fn$)
�,� ptr%,fn%,event_list%,list_size%,found%
�� fn_addr%
�ptr%=0:found%=�
�� wh%=-1 � wh%=-2
�-list_size%=�shell_HeapBlockInfo(_U%!12)-8
�event_list%=_U%!12
�I� PROCshell_Tracef0("XX:checking for wh &"+STR$~wh%+" ih &"+STR$~ic%)
��
�   � (event_list%!ptr%=wh%) �
�0    � PROCshell_Tracef0("XX:ptr%="+STR$ptr%)
�U    � PROCshell_Tracef0("XX:found window handle in list, checking icon handle..")
�$    � event_list%!(ptr%+4)=ic% �
�      found%=�
�	    �
�      ptr%+=48
�	    �
�  �
    ptr%+=48
  �
!� (ptr%>=list_size% � found%)
� found%=� �
 ptr%=0
 È• (event_list%!ptr%<>0 )
   ptr%+=48
   � ptr%>=list_size% �
1     _U%!12=�shell_HeapBlockExtend(_U%!12,48)
	     event_list%=_U%!12

     event_list%!(ptr%+0)=0
     event_list%!(ptr%+4)=0
     event_list%!(ptr%+8)=0

      event_list%!(ptr%+12)=0
      event_list%!(ptr%+16)=0
      event_list%!(ptr%+20)=0
      event_list%!(ptr%+24)=0
      event_list%!(ptr%+28)=0
      event_list%!(ptr%+32)=0
      event_list%!(ptr%+36)=0
      event_list%!(ptr%+40)=0
      event_list%!(ptr%+44)=0
   �
 �
�
event_list%!(ptr%+0)=wh%
event_list%!(ptr%+4)=ic%
� menu%<>0 �
   event_list%!(ptr%+8)=menu%
�
"fn_addr%=ptr%+(12+(e_type%*4))
� event_list%!fn_addr%<>0 �
 2  �shell_HeapBlockReturn(event_list%!fn_addr%)
!�
"%fn%=�shell_HeapBlockFetch(�fn$+1)
#$fn%=fn$
$event_list%!fn_addr%=fn%
%�
&:
'*|Stop PROCshell_EventAdd
(
)$*|Start PROCshell_EventDeleteAll
* � �shell_EventDeleteAll(wh%)
+4� ptr%,menu%,found%,list_size%,event_list%,loop%
,ptr%=0:menu%=0:found%=�
-� wh%=-1 � wh%=-2
.-list_size%=�shell_HeapBlockInfo(_U%!12)-8
/event_list%=_U%!12
0�
1   � (event_list%!ptr%=wh%) �
2    found%=�
3  �
4    ptr%+=48
5  �
6!� (ptr%>=list_size% � found%)
7� found% �
8  event_list%!(ptr%+0)=0
9  event_list%!(ptr%+4)=0
:  event_list%!(ptr%+8)=0
;  � loop%=12 � 44 � 4
<'    � event_list%!(ptr%+loop%)<>0 �
=:      �shell_HeapBlockReturn(event_list%!(ptr%+loop%))
>$      event_list%!(ptr%+loop%)=0
?	    �
@
  � loop%
A�
B:� remove all DataSave events for the current window...
C0�shell_Tracef0("EventDeleteAll:wh%=&"+�~wh%)
D&�shell_DeleteEventDataSave(wh%,-1)
E"�shell_DeleteEventBump(wh%,-1)
F$�shell_DeleteEventSlider(wh%,-1)
G?� should reduce size of event list block if possible.......
H�
I:
J#*|Stop PROCshell_EventDeleteAll
K
L%*|Start PROCshell_DeleteEventBump
M%� �shell_DeleteEventBump(wh%,ih%)
NC� if I can find which words point to a heap block they could be
OD� automatically detected and released. A general purpose routine
P.� shell_DeleteEvent could then be written!
Q7� If ih%=-1 remove all events for window handle wh%
R/� offset%,blk%,list_size%,event_list%,temp%
Sevent_list%=_U%!104
T�
U=  offset%=�shell_GetEventListOffset(wh%,ih%,_U%+104,16,�)
V*|ifdef TraceInit
W9  �shell_Tracef0("DeleteEventBump:offset%="+�offset%)
X*|endif
Y  � offset%>=0 �
Z    � ih%=-1 �
[*|ifdef TraceInit
\i      �shell_Tracef0("DeleteEventBump:Deleting Bump Event (all events for window handle &"+�~wh%+")")
]*|endif
^	    �
_*|ifdef TraceInit
`w      �shell_Tracef0("DeleteEventBump:Deleting Bump Event (window handle was &"+�~wh%+" icon handle was "+�ih%+")")
a*|endif
b	    �
c*    � event for window/icon is in list
d2    list_size%=�shell_HeapBlockInfo(_U%!104)-8
e!    � offset%=list_size%-16 �
f+      � it is the last one in this list
g      � offset%=0 �
h(        � only one event in the list
i$        info_blk%=event_list%!12
j        temp%=info_blk%!12
k,        �shell_HeapBlockReturn(temp%!12)
l,        �shell_HeapBlockReturn(temp%!16)
m)        �shell_HeapBlockReturn(temp%)
n+        �shell_HeapBlockReturn(_U%!104)
o        _U%!104=0
p*|ifdef TraceInit
qK        �shell_Tracef0("DeleteEventBump:No Bump events now registered")
r*|endif
s      �
t-        � more than one event in the list
u7        _U%!104=�shell_HeapBlockExtend(_U%!104,-16)
v      �
w	    �
x(      � not the last one in the list
y"      blk%=event_list%+offset%
z$      blk%!0=0:blk%!4=0:blk%!8=0
{      info_blk%=blk%!12
|.      �shell_HeapBlockReturn(info_blk%!12)
}.      �shell_HeapBlockReturn(info_blk%!16)
~+      �shell_HeapBlockReturn(info_blk%)
	    �
�  �
�6  � repeat loop until offset%=-1 (event not found)
�1  � or offset%=-2 (event block doesn't exist)
�� offset%<0
��
�:
�$*|Stop PROCshell_DeleteEventBump
�
�)*|Start PROCshell_DeleteEventDataSave
�)� �shell_DeleteEventDataSave(wh%,ih%)
�C� if I can find which words point to a heap block they could be
�D� automatically detected and released. A general purpose routine
�.� shell_DeleteEvent could then be written!
�7� If ih%=-1 remove all events for window handle wh%
�� offset%,blk%,list_size%
�=� PROCshell_Tracef0("DeleteEventDataSave:wh%=&"+STR$~wh%)
�;� PROCshell_Tracef0("DeleteEventDataSave:ih%="+STR$ih%)
��
�<  offset%=�shell_GetEventListOffset(wh%,ih%,_U%+72,24,�)
�E  � PROCshell_Tracef0("DeleteEventDataSave:offset%="+STR$offset%)
�  � offset%>=0 �
�    � ih%=-1 �
�m  �shell_Tracef0("DeleteEventDataSave:Deleting DataSave Event (all events for window handle &"+�~wh%+")")
�	    �
�{  �shell_Tracef0("DeleteEventDataSave:Deleting DataSave Event (window handle was &"+�~wh%+" icon handle was "+�ih%+")")
�	    �
�*    � event for window/icon is in list
�1    list_size%=�shell_HeapBlockInfo(_U%!72)-8
�!    � offset%=list_size%-24 �
�+      � it is the last one in this list
�      � offset%=0 �
�(        � only one event in the list
�*        �shell_HeapBlockReturn(_U%!72)
�        _U%!72=0
�*|ifdef TraceInit
�Q      �shell_Tracef0("DeleteEventDataSave:No DataSave events now registered")
�*|endif
�      �
�-        � more than one event in the list
�5        _U%!72=�shell_HeapBlockExtend(_U%!72,-24)
�      �
�	    �
�(      � not the last one in the list
�"      blk%=event_list%+offset%
�8      blk%!0=0:blk%!4=0:blk%!8=0:blk%!12=0:blk%!16=0
�3      �shell_HeapBlockReturn(blk%!20):blk%!20=0
�	    �
�  �
�6  � repeat loop until offset%=-1 (event not found)
�1  � or offset%=-2 (event block doesn't exist)
�� offset%<0
��
�:
�(*|Stop PROCshell_DeleteEventDataSave
�
�!*|Start FNshell_MessageNoArgs
� � �shell_MessageNoArgs(tag$)
�%=�shell_MessageLookup(tag$,"","")
�:
� *|Stop FNshell_MessageNoArgs
�
�!*|Start FNshell_MessageOneArg
�&� �shell_MessageOneArg(tag$,arg1$)
�(=�shell_MessageLookup(tag$,arg1$,"")
�:
� *|Stop FNshell_MessageOneArg
�
�!*|Start FNshell_MessageLookup
�,� �shell_MessageLookup(tag$,arg1$,arg2$)
�$� flags%,L%,m$,ms_text%,ms_desc%
�� �tag$,8)="SHELLMSG" �
�'  ms_text%=_U%!284:ms_desc%=_U%!280
��
�%  ms_text%=_U%!64:ms_desc%=_U%!68
��
�Sș "XMessageTrans_Lookup",ms_desc%,tag$,ms_text%,256,arg1$,arg2$ � ,,,L%;flags%
�� flags% � 1 �
�>  � m$="Message tag '"+tag$+"' not found in message file!"
��
�  ms_text%?L%=13
�  m$=$(ms_text%)
��
�=m$
�:
� *|Stop FNshell_MessageLookup
�
�*|Start FNshell_WimpInit
�)� �shell_WimpInit(Version%,TaskName$)
�
� Taskid%
�Hș "Wimp_Initialise",Version%,&4B534154,TaskName$ � Version%,Taskid%
�� _U%!100 � 1 << 6 �
�(  ș "WimpExt_Initialise",14,Taskid%
��
�_U%!148=Taskid%
�=Taskid%
�:
�*|Stop FNshell_WimpInit
�
�*|Start FNshell_WimpInit_I
�+� �shell_WimpInit_I(Version%,TaskName$)
�Hș "Wimp_Initialise",Version%,&4B534154,TaskName$ � Version%,Taskid%
�� _U%!100 � 1 << 6 �
�(  ș "WimpExt_Initialise",14,Taskid%
��
�_U%!148=Taskid%
�%ș "Interface_Initialise",Taskid%
�=Taskid%
�:
�*|Stop FNshell_WimpInit_I
�
�%*|Start PROCshell_WimpCloseDown_I
�%� �shell_WimpCloseDown_I(Taskid%)
��shell_LoseFonts
�*|ifdef Using_FontMenu
�*� _U%!240<>-1 � ș "XFontMenu_Release"
�*|endif
�� _U%!100 � 1 << 6 �
�(  ș "WimpExt_Initialise",14,Taskid%
��
�*ș "XWimp_CloseDown",Taskid%,&4B534154
�%ș "XInterface_CloseDown",Taskid%
�8� _U%!100 � 1 << 2 � ș "XImpulse_CloseDown",_U%!148
��
�:
�$*|Stop PROCshell_WimpCloseDown_I
�
�*|Start PROCWimpCloseDown
�� �WimpCloseDown(Taskid%)
�shell_LoseFonts
*|ifdef Using_FontMenu
*� _U%!240<>-1 � ș "XFontMenu_Release"
*|endif
� _U%!100 � 1 << 6 �
(  È™ "WimpExt_Initialise",14,Taskid%
�
*È™ "XWimp_CloseDown",Taskid%,&4B534154
6� _U%!100 � 1<<2 � ș "XImpulse_CloseDown",_U%!148
	,�("Unset "+_shell_AppName$+"$BasicFile")

�
:
*|Stop PROCWimpCloseDown


*|Start PROCshell_LoseFonts
� �shell_LoseFonts
� loop%,temp%
temp%=_U%!232
� loop%=0 � 255
È• temp%?loop%>0
  È™ "Font_LoseFont",loop%
  temp%?loop%-=1
�
� loop%
�
:
*|Stop PROCshell_LoseFonts

*|Start FNshell_FindFont
'� �shell_FindFont(font$,pointsize%)
� f%,fontcounts%
fontcounts%=_U%!232
 9ș "Font_FindFont",,font$,pointsize%*16,p*16,0,0 � f%
!fontcounts%?f%+=1
"I� fontcounts%?f%>=255 � �shell_OK(�shell_MessageNoArgs("SHELLMSG18"))
#=f%
$:
%*|Stop FNshell_FindFont
&
'*|Start PROCshell_Init
(� �shell_Init
)!� elist%,loop%,temp%,cmdline$
*-� OSVarBuff%,shell_AppDir$,shell_AppName$
+� _U% 360,_shell_blk% 260
,#_Q%=�shell_HeapBlockFetch(3000)
-$elist%=�shell_HeapBlockFetch(48)
.elist%!00=0
/elist%!04=0
0elist%!08=0
1elist%!12=0
2elist%!16=0
3elist%!20=0               
4elist%!24=0
5elist%!28=0
6elist%!32=0
7elist%!36=0
8elist%!40=0
9elist%!44=0
:'_U%!0=0          :� nr of templates
;0_U%!4=0          :� pointer to window blocks
<-_U%!8=0          :� pointer to menu block
=-_U%!12=elist%    :� pointer to event list
>3_U%!16=1         :� address of user sprite area
?5_U%!20=0         :� handle of last dynamic window
@/_U%!24=0         :� address of current menu
AB_U%!28=0         :� last window clicked over (select & adjust)
BB_U%!32=0         :� last icon clicked over   (select & adjust)
C,_U%!36=0         :� last menu x position
D,_U%!40=0         :� last menu y position
E+_U%!44=-1        :� handle of tracefile
F6_U%!48=0         :� ArtWorks Renderer redraw block
G@                 :�   +00 Address of VduVars heapblock (256)
H?                 :�   +04 Address of Matrix  heapblock (24)
I?                 :�   +08 Address of Info    heapblock (36)
JB                 :�   +12 Address of WorkBlk heapblock (&1000)
KR                 :�   +16 Address of CallbackRoutine returned by fileinit call
L>_U%!52=0         :� last window clicked over (menu button)
M>_U%!56=0         :� last icon   clicked over (menu button)
N>_U%!60=0         :� pointer to 'HotKey' handler event list
O0_U%!64=0         :� pointer to message block
P0_U%!68=0         :� pointer to message block
Q7_U%!72=0         :� pointer to datasave event block
R5_U%!76=�shell_HeapBlockFetch(256):� message block
S6_U%!80=0         :� pointer to last full file name
T8_U%!84=-1        :� store my_ref from save operation
U"_U%!88=0         :� ??????????
V;_U%!92=0         :� pointer to pane handler event block
W7_U%!96=0         :� pointer to dataload event block
X+_U%!100=0        :� EvntShell bit flags
YC                 :� bit  0  - DragASprite operation in progress
Z>                 :� bit  1  - Top bit dataload in progress
[<                 :� bit  2  - Impulse module initialised
\6                 :� bit  3  - ResFind in operation
]O                 :� bit  4  - Trace init message pending (set in TraceInit,
^K                 :�           cleared when ack received from ShellDBug)
_C                 :� bit  5  - command line contains arguments..
`:                 :� bit  6  - WimpEXT module is loaded
aK                 :� bit  7  - StrongHlp system initialised for this app
b9                 :� bit  8  - AWRender code assembled
c@                 :� bit  9  - Tracing flag (0 = off, 1 = on)
d?                 :� bit 10  - RISC OS 3 or better available
e9                 :� bit 11  - Slider drag in progress
f9                 :� bit 12  - Interactive help on/off
g;_U%!104=0        :� pointer to bump handler event block
h _U%!108=-1       :� ScrpRef%
i _U%!112=-1       :� FtchRef%
j _U%!116=-1       :� LoadRef%
k _U%!120=-1       :� SaveRef%
l _U%!124=-1       :� DragRef%
m_U%!128=0        :� RAMPtr%
n _U%!132=0        :� RAMSize%
o<_U%!136=-1       :� FileSize% from last datasave message
p<_U%!140=-1       :� FileType% from last datasave message
q<_U%!144=-1       :� FileBuff% from last datasave message
r_U%!148=0        :� taskid%
sB_U%!152=0        :� Buffer list of loaded files, -1 terminator
tE_U%!156=0        :� HeapBlock with copy of DataSave message block
u3                 :� for when RAM transfer fails
v<_U%!160=0        :� Pointer to ModeChange event function
w?_U%!164=0        :� Pointer to PaletteChange event function
x@_U%!168=0        :� Pointer to TaskInitialise event function
y?_U%!172=0        :� Pointer to TaskCloseDown event function
z5_U%!176=0        :� Pointer to current menu title
{8_U%!180=0        :� nr of 'hotkey' events registered
|9_U%!184=0        :� Pointer to list of static windows
}/_U%!188=0        :� to shell_AppDir$ buffer
~3_U%!192=0        :� to shell_AppDataDir$ buffer
0_U%!196=0        :� to shell_AppName$ buffer
�@_U%!200=0        :� window handle from last DataSave message
�>_U%!204=0        :� icon handle from last DataSave message
�>_U%!208=-1       :� helphandle% (task handle of StrongHlp)
�D_U%!212=-1       :� icontry%    (used by StrongHlp find routine)
�H_U%!216=0        :� pointer to pending$ buffer for StrongHlp command
�;_U%!220=0        :� pointer to menu warning event block
�;_U%!224=0        :� pointer to last menu_warn fn called
�I_U%!228=0        :� handle of warning dialog used for menu items that
�:                 :� have not had a dialog box attached
�<_U%!232=�shell_HeapBlockFetch(256):� fontcounts% array..
�=_U%!236=�shell_HeapBlockFetch(256):� fontbinding% array..
�N_U%!240=-1       :� nr of outline fonts on system, -1 if "FontMenu_Create"
�+                 :� has not been called
�G_U%!244=0        :� ptr to currently selected font name in FontMenu
�3_U%!248=0        :� ptr to last known Font$Path
�<_U%!252=0        :� last known ptr to FontMenu structure
�M_U%!256=0        :� ptr to heapblock holding 'MenusSelectionSoFar' string
�L_U%!260=1        :� SystemFont flag for FontMenu 0 no sysfont, 1 sysfont
�3_U%!264=0        :� FontMenu is opened (1 or 0)
�J_U%!268=0        :� FontMenu valid selection flag 0 non valid, 1 valid
�@_U%!272=0        :� x coord last mouse click (screen coords)
�@_U%!276=0        :� y coord last mouse click (screen coords)
�;_U%!280=0        :� m_filedesc% for system message file
�;_U%!284=0        :� m_buffer%   for system message file
�9_U%!288=-1       :� window handle for last bump event
�7_U%!292=-1       :� icon handle for last bump event
�:_U%!296=-1       :� last event offset for bump handler
�:_U%!300=0        :� pointer to PreQuit Handler routine
�9_U%!304=0        :� pointer to OpenWindow event block
�:_U%!308=0        :� pointer to CloseWindow event block
�;_U%!312=0        :� pointer to Shutdown Handler routine
�D_U%!316=0        :� OS version nr as returned by Wimp_Initialise
�1_U%!320=0        :� Last mouse button pressed
�8_U%!324=0        :� stores command line arg (if any)
�._U%!328=0        :� Slider last x position
�*_U%!332=0        :� Slider event block
�3_U%!336=0        :� Nr of copies still to print
�1_U%!340=0        :� Popup handler event block
�)_U%!344=0        :� Txt control block
�!�shell_MemFill(_U%!232,256,0)
�!�shell_MemFill(_U%!236,256,0)
�)OSVarBuff%=�shell_HeapBlockFetch(256)
�Ashell_AppDir$=�shell_OSVarGetVal(OSVarBuff%,256,"Obey$Dir",1)
�&�shell_HeapBlockReturn(OSVarBuff%)
�1shell_AppName$=��shell_Leaf(shell_AppDir$),2)
�5_U%!188=�shell_HeapBlockFetch((�shell_AppDir$)+1)
�6_U%!196=�shell_HeapBlockFetch((�shell_AppName$)+1)
�&temp%=_U%!188:$temp%=shell_AppDir$
�'temp%=_U%!196:$temp%=shell_AppName$
�F� Now have a look at the command line used to start the program...
�)cmdline$ = �shell_OSReadCommandArg(1)
�� cmdline$ <> "" �
�B  _U%!100 = _U%!100 � 1 << 5:� set 'command line args' flag...
�1  � Store command line for later reference...
�2  temp% = �shell_HeapBlockFetch(�cmdline$ + 1)
�+  $(temp%) = cmdline$ : _U%!324 = temp%
��
�)� Check if WimpEXT module is loaded..
�=temp% = �shell_OSModuleCheckVersion("WimpExtension",1.98)
�C� temp% = � � _U%!100 = _U%!100 � 1 << 6 :� Set WExt flag bit..
�temp% = �RO3_Present
�C� temp% = � � _U%!100 = _U%!100 � 1 << 10:� Set RO3  flag bit..
�<_U%!100 = _U%!100 � 1 << 12:� turn on interactive help..
��
�:
�*|Stop PROCshell_Init
�
�"*|Start FNshell_GetCmdLineArgs
�� �shell_GetCmdLineArgs
�� cmdline$
�� _U%!324 <> 0 �
�  cmdline$ = $(_U%!324)
��
�:�shell_Tracef0("GetCmdLineArgs:cmdline was "+cmdline$)
�= cmdline$
�:
�!*|Stop FNshell_GetCmdLineArgs
�
�*|Start FNshell_FileType
�� �shell_FileType(object$)
�� type%
�$ș "OS_File",5,object$ � ,,type%
�type%=(type% � &FFF00)>>>8
�
=type%
�:
�*|Stop FNshell_FileType
�
�*|Start FNshell_FileExists
� � �shell_FileExists(object$)
�0� �shell_CatInfoRead(object$)="Not Found":=�
�=�
�:
�*|Stop FNshell_FileExists
�
�*|Start FNshell_CatInfoRead
�!� �shell_CatInfoRead(object$)
�7� type%,load_addr%,exec_addr%,length%,atts%,string$
�Gș "OS_File",5,object$ � type%,,load_addr%,exec_addr%,length%,atts%
�� type%=0 � = "Not Found"
� � atts%=51  � string$+="WR "
� � atts%=187 � string$+="LWR"
� � atts%=136 � string$+="DL "
�<string$+=" "+�shell_StringPadLeading(�~load_addr%,"0",8)
�<string$+=" "+�shell_StringPadLeading(�~exec_addr%,"0",8)
�9string$+=" "+�shell_StringPadLeading(�~length%,"0",8)
�=string$
�:
�*|Stop FNshell_CatInfoRead
�*|Start FNshell_GetAppDir
�� �shell_GetAppDir
�� temp%
�temp%=_U%!188
�=$temp%
�:
�*|Stop FNshell_GetAppDir
�!*|Start FNshell_GetAppDataDir
�� �shell_GetAppDataDir
�� temp%
�temp%=_U%!192
�=$temp%
�:
� *|Stop FNshell_GetAppDataDir
�*|Start FNshell_GetAppName
�� �shell_GetAppName
�� temp%
�temp%=_U%!196
�=$temp%
�:
*|Stop FNshell_GetAppName

#*|Start PROCshell_ResourcesInit
� �shell_ResourcesInit
B� shell_AppDataDir$,temp%,shell_AppName$,shell_AppDir$,use_3d%
(� OSVarBuff%,YEigFactor%,XEigFactor%
$shell_AppName$=�shell_GetAppName
#shell_AppDir$ =�shell_GetAppDir
)OSVarBuff%=�shell_HeapBlockFetch(256)
	@� �shell_OSVarExists(OSVarBuff%,shell_AppName$+"Res$Path") �

3  _U%!100=_U%!100 � 1<<3:� set 'ResFind' flag..
�
@� �shell_OSVarExists(OSVarBuff%,shell_AppName$+"Data$Dir") �

V  shell_AppDataDir$=�shell_OSVarGetVal(OSVarBuff%,256,shell_AppName$+"Data$Dir",1)
;  _U%!192=�shell_HeapBlockFetch((�shell_AppDataDir$)+1)
,  temp%=_U%!192:$temp%=shell_AppDataDir$
�
7  _U%!192=�shell_HeapBlockFetch((�shell_AppDir$)+1)
(  temp%=_U%!192:$temp%=shell_AppDir$
�
� _U%!100 � 1<<3 �
  � ResFind initialised..
*|define Using_ResFind
:  � �shell_FileExists(shell_AppName$+"Res:Messages") �
H    �shell_MessagesInit(shell_AppName$+"Res:Messages",_U%!68,_U%!64)
  �
;  � �shell_FileExists(shell_AppName$+"Res:ShellMsgs") �
J   �shell_MessagesInit(shell_AppName$+"Res:ShellMsgs",_U%!280,_U%!284)
  �
E    �shell_MessagesInit("EvntShellRes:ShellMsgs",_U%!280,_U%!284)
  �
5  ș "XOS_ReadModeVariable",-1,04 � ,,XEigFactor%
 5  ș "XOS_ReadModeVariable",-1,05 � ,,YEigFactor%
!M  � YEigFactor% = 1 � �shell_FileExists(shell_AppName$+"Res:Sprites22") �
"A    � Screen mode is hi-res, and hi-res sprite file exists...
#F    _U%!16 = �shell_SpriteAreaLoad(shell_AppName$+"Res:Sprites22")
$  �
%;    � �shell_FileExists(shell_AppName$+"Res:Sprites") �
&5      � No hi-res sprite file, load normal one...
'D      _U%!16=�shell_SpriteAreaLoad(shell_AppName$+"Res:Sprites")
(	    �
)>      _U%!16=1:� use wimp sprite pool if no 'Sprites' file
*	    �
+  �
,'  � check if templates need loading
-   use_3d% = �shell_3DEnabled
.F  � use_3d% � �shell_FileExists(shell_AppName$+"Res:Templates3") �
/=    �shell_TemplatesInit(shell_AppName$+"Res:Templates3")
0  �
1=    � �shell_FileExists(shell_AppName$+"Res:Templates") �
2>      �shell_TemplatesInit(shell_AppName$+"Res:Templates")
3	    �
4  �
5�
6!  � ResFind NOT initialised..
76  � �shell_FileExists(shell_AppDir$+".Messages") �
8D    �shell_MessagesInit(shell_AppDir$+".Messages",_U%!68,_U%!64)
9  �
:7  � �shell_FileExists(shell_AppDir$+".ShellMsgs") �
;G    �shell_MessagesInit(shell_AppDir$+".ShellMsgs",_U%!280,_U%!284)
<  �
=E    �shell_MessagesInit("EvntShellRes:ShellMsgs",_U%!280,_U%!284)
>  �
?F  � Check if user sprites need loading, but first check if program
@3  � has been started in a hi-res screen mode...
A5  ș "XOS_ReadModeVariable",-1,04 � ,,XEigFactor%
B5  ș "XOS_ReadModeVariable",-1,05 � ,,YEigFactor%
CI  � YEigFactor% = 1 � �shell_FileExists(shell_AppDir$+".Sprites22") �
DA    � Screen mode is hi-res, and hi-res sprite file exists...
EB    _U%!16 = �shell_SpriteAreaLoad(shell_AppDir$+".Sprites22")
F  �
G7    � �shell_FileExists(shell_AppDir$+".Sprites") �
H@      _U%!16=�shell_SpriteAreaLoad(shell_AppDir$+".Sprites")
I	    �
J>      _U%!16=1:� use wimp sprite pool if no 'Sprites' file
K	    �
L  �
M'  � check if templates need loading
N   use_3d% = �shell_3DEnabled
OB  � use_3d% � �shell_FileExists(shell_AppDir$+".Templates3") �
P9    �shell_TemplatesInit(shell_AppDir$+".Templates3")
Q  �
R9    � �shell_FileExists(shell_AppDir$+".Templates") �
S:      �shell_TemplatesInit(shell_AppDir$+".Templates")
T	    �
U  �
V�
WÈ™ "MenuUtil_Initialise"
X�shell_HeapBlockReturn(_Q%)
Y>_Q%=�shell_HeapBlockFetch(1024):� reduce global wimp block
Z&�shell_HeapBlockReturn(OSVarBuff%)
[�
\:
]"*|Stop PROCshell_ResourcesInit
^
_"*|Start FNshell_SpriteAreaLoad
`&� �shell_SpriteAreaLoad(filename$)
a� sp%,S%,T%
b%S%=� (filename$):T%=�#S%+16:� #S%
c!sp%=�shell_HeapBlockFetch(T%)
d!sp%=T%:sp%!4=0
esp%!8=16:sp%!12=16
fÈ™ "OS_SpriteOp",&209,sp%
g'È™ "OS_SpriteOp",&20A,sp%,filename$
h*|ifdef TraceInit
i>�shell_Tracef0("SpriteLoad:Sprite file loaded at &"+�~sp%)
j*|endif
k=sp%
l:
m!*|Stop FNshell_SpriteAreaLoad
n
o#*|Start FNshell_UserSpritesBase
p� �shell_UserSpritesBase
q=_U%!16
r:
s"*|Stop FNshell_UserSpritesBase
t
u *|Start FNshell_SpriteGetPtr
v,� �shell_SpriteGetPtr(spritearea%,name$)
w� buffer%,ptr%
x%buffer%=�shell_HeapBlockFetch(21)
y$buffer%=name$
z6ș "OS_SpriteOp",&118,spritearea%,buffer% � ,,ptr%
{#�shell_HeapBlockReturn(buffer%)
|	=ptr%
}:
~*|Stop FNshell_SpriteGetPtr

�#*|Start PROCshell_TemplatesInit
�%� �shell_TemplatesInit(filename$)
�?� TemplatePtr%,IndirectPtr%,IndirectEnd%,X%,ptr%,buff_size%
�B� filelen%,pos%,name_buffer%,name$,nr_templates%,flgs%,result%
�A� file_offset%,data_size%,entry_type%,char%,identifier$,buff%
�,name_buffer% = �shell_HeapBlockFetch(20)
� pos% = 0 : nr_templates% = 0
�+filelen% = �shell_FileLength(filename$)
�
�*� Reserve space for window definitions
�2TemplateBlk% = �shell_HeapBlockFetch(filelen%)
�TemplatePtr% = TemplateBlk%
�G�shell_TemplateFileInfo(filename$,buff_size%,nr_templates%,result%)
�� result% = 0 �
�M  � Reserve a block to hold window identifiers (12 bytes) plus address of
�  � window block (4 bytes)
�7  _U%!4 = �shell_HeapBlockFetch(20 * nr_templates%)
�Q  � Reserve space for indirected icon data (size of largest window definition
�*  � plus all of the indirected data)..
�7  IndirectBlk%  = �shell_HeapBlockFetch(buff_size%)
�"  IndirectPtr%  = IndirectBlk%
�/  IndirectEnd%  = IndirectBlk% + buff_size%
�  
�  nr_templates% = 0
�1  ș "XWimp_OpenTemplate",,filename$ � ;flgs%
�  � (flgs% � 1) �
�E    � 99,�shell_MessageTwoArgs("SHELLMSG34","template",filename$)
�  �
�	    �
�      $name_buffer%="*"
��      ș "Wimp_LoadTemplate",,TemplatePtr%,IndirectPtr%,IndirectEnd%,_U%!232,name_buffer%,pos% � ,,IndirectPtr%,,,name$,pos%
�      � pos%<>0 �
�=        !((_U%!4)  + (16 * nr_templates%)) = TemplatePtr%
�;        $(((_U%!4) + (16 * nr_templates%)) + 4) = name$
�*|ifdef TraceInit
�E        �shell_Tracef0("TemplatesInit:  Template Loaded: "+name$)
�*|endif
�:        TemplatePtr%  += (88 + (TemplatePtr%!84) * 32)
�        nr_templates% += 1
�      �
�    � pos% = 0
�    ș "Wimp_CloseTemplate"
�    _U%!0 = nr_templates%
�*|ifdef TraceInit
��    �shell_Tracef0("TemplatesInit:Templates resource file loaded at       &"+�~TemplateBlk%+" ("+�nr_templates%+" templates)")
�^    �shell_Tracef0("TemplatesInit:Indirected buffer size used for loading &"+�~buff_size%)
�*|endif
�  �
��
�  Ȏ result% �
�J    � -1:� 99,�shell_MessageTwoArgs("SHELLMSG35","template",filename$)
�J    � -2:� 99,�shell_MessageTwoArgs("SHELLMSG36",filename$,"template")
�  �
��
�(�shell_HeapBlockReturn(name_buffer%)
��
�:
�"*|Stop PROCshell_TemplatesInit
�
� *|Start FNshell_WindowLoaded
�"� �shell_WindowLoaded(window$)
�� loop%,found%
�E� �(window$)>12 � � 99,�shell_MessageOneArg("SHELLMSG02",window$)
�found%=�
�� loop%=0 � (_U%!0)-1
�+  � $(((_U%!4)+(16*loop%))+4)=window$ �
�     found%=�:loop%=(_U%!0)-1
�  �
�� loop%
�=found%
�:
�*|Stop FNshell_WindowLoaded
�*|Start FNshell_GetWB
�� �shell_GetWB(window$)
�� loop%,found%
�E� �(window$)>12 � � 99,�shell_MessageOneArg("SHELLMSG02",window$)
�
found%=-1
�� loop%=0 � (_U%!0)-1
�+  � $(((_U%!4)+(16*loop%))+4)=window$ �
�$    found%=loop%:loop%=(_U%!0)-1
�  �
�� loop%
�� found%>-1 �
�  =!((_U%!4)+(16*found%))
��
�5  � 99,�shell_MessageOneArg("SHELLMSG03",window$)
��
�=�
�:
�
�*|Stop FNshell_GetWB
�!*|Start FNshell_MessageExpand
�� �shell_MessageExpand(h$)
�� s$, m$, index%
�	s$=""
�ȕ �h$,"\")>0
�  index%=�h$,"\")
�  s$+=�h$,index%-1)
�  m$=�h$,index%+1,1)
�  h$=�h$,index%+2)
�
  Ȏ m$ �
�#    � "A":s$+="Click ADJUST to"
�    � "a":s$+="ADJUST"
�'    � "D":s$+="Drag with SELECT to"
�'    � "d":s$+="Drag with ADJUST to"
�5    � "G":s$+="This option is greyed out because"
�*    � "R":s$+="Move the pointer right"
�#    � "S":s$+="Click SELECT to"
�    � "s":s$+="SELECT"
�    � "T":s$+="This is the"
�"    � "W":s$+="This window is"
�    � "w":s$+="window"
�  
�    s$+="\"+m$
�  �
��
�
=s$+h$
�:
�@� ----------------------------------------------------------
�:
� *|Stop FNshell_MessageExpand
�
�*|Start PROCshell_OpenMenu
�� �shell_OpenMenu(x%,y%,m%)
�	� fn$
�/fn$=�shell_GetEventHandler(_U%!28,_U%!32,1)
�� fn$<>"" �
�*|ifdef TraceInit
T  �shell_Tracef0("OpenMenu:About to call "+"FN"+fn$+"("+�_U%!28+","+�_U%!32+")")
*|endif
:  void%=�("FN"+fn$+"(_U%!28,_U%!32)"):� call menumaker
�
A  �shell_Tracef0("OpenMenu:no menumaker function registered")
�
� m%<>_U%!24 �
I  � If menu is not being re-opened by an adjust click, discard stored
;  � 'SelectionSoFar' string used by FontMenu routines..
	)  � �shell_HeapBlockExists(_U%!256) �

1    �shell_HeapBlockReturn(_U%!256):_U%!256=0
  �
B  � And the name of the currently selected font in this menu..

*  � �shell_HeapBlockExists(_U%!244 ) �
1    �shell_HeapBlockReturn(_U%!244):_U%!244=0
  �
�
� m%=_U%!252 �
)  È™ "Wimp_CreateMenu",,m%,x% - 64,y%
  _U%!264=1
�
  _Q%!0 = x%:_Q%!4 = y%
  È™ "MenuUtil_Show",m%,_Q%
  _U%!264=0
�
3_U%!24=m%:� store handle of currently open menu
%_U%!36=x%:� store menu x position
%_U%!40=y%:� store menu y position
 _U%!52=_U%!28:� store window
_U%!56=_U%!32:� store icon
�
:
 *|Stop PROCshell_OpenMenu
!
" *|Start FNshell_MenuLastXPos
#� �shell_MenuLastXPos
$=_U%!36
%:
&*|Stop FNshell_MenuLastXPos
'
( *|Start FNshell_MenuLastYPos
)� �shell_MenuLastYPos
*=_U%!40
+:
,*|Stop FNshell_MenuLastYPos
-
.$*|Start PROCshell_MenuAttachDbox
/"� �shell_MenuAttachDbox(menu$)
0M� attach a dummy window handle for now, just so that the sub window arrow
1� appears on the menu!
2;ș "Menu_SetSubHandle",_U%!8,�shell_MenuString(menu$),1
3D�shell_Tracef0("MenuAttachDbox:Dialog box ("+menu$+") attached")
4�
5:
6#*|Stop PROCshell_MenuAttachDbox
7
8!*|Start FNshell_MessageWindow
99� �shell_MessageWindow(text$,cancel%,progname$,head$)
:� keys%,err_blk%
;'err_blk%=�shell_HeapBlockFetch(260)
<(!err_blk%=0:$(err_blk%+4)=text$+�(0)
=0� head$="" � head$="Message from "+progname$
>� cancel% �
?5 ș "Wimp_ReportError",err_blk%,19,head$ � ,keys%
@�
A5 ș "Wimp_ReportError",err_blk%,17,head$ � ,keys%
B�
C$�shell_HeapBlockReturn(err_blk%)
D
=keys%
E:
F *|Stop FNshell_MessageWindow
G
H"*|Start PROCshell_CreateWindow
I+� �shell_CreateWindow(ident$,� handle%)
J
� wb_ptr%
K wb_ptr%=�shell_GetWB(ident$)
L3� set 'sprite area' pointer to usersprites area
Mwb_ptr%!64=_U%!16
N-ș "Wimp_CreateWindow",,wb_ptr% � handle%
O�
P:
Q!*|Stop PROCshell_CreateWindow
R!*|Start FNshell_CreateWindow2
SN� �shell_CreateWindow2(title,flags%,fgcol%,bgcol%,maxx%,miny%,l%,b%,r%,t%)
T� Q%
U"Q%=�shell_HeapBlockFetch(3000)
V,Q%!0=l%:Q%!4=b%:Q%!8=r%:Q%!12=t%:Q%!16=0
W)Q%!20=0:Q%!24=-1:Q%!28=flags%:Q%?32=7
X%Q%?33=2:Q%?34=fgcol%:Q%?35=bgcol%
YQ%?36=3:Q%?37=1
Z'Q%?38=2:Q%?39=0:Q%!40=0:Q%!44=miny%
[.Q%!48=maxx%:Q%!52=0:Q%!56=&13D:Q%!60=&3000
\6Q%!68=1:Q%!72=title:Q%!76=-1:Q%!80=�$title:Q%!84=0
](ș "Wimp_CreateWindow",,Q% � handle%
^�shell_HeapBlockReturn(Q%)
_=handle%
`:
a *|Stop FNshell_CreateWindow2
b
c%*|Start FNshell_WindowHasTitleBar
d#� �shell_WindowHasTitleBar(wh%)
e)=(�shell_WindowGetFlags(wh%) � 1<<26)
f:
g$*|Stop FNshell_WindowHasTitleBar
h
i$*|Start FNshell_WindowIsMoveable
j
k"� �shell_WindowIsMoveable(wh%)
l(=(�shell_WindowGetFlags(wh%) � 1<<1)
m:
n#*|Stop FNshell_WindowIsMoveable
o
p!*|Start FNshell_WindowIsAPane
q� �shell_WindowIsAPane(wh%)
r(=(�shell_WindowGetFlags(wh%) � 1<<5)
s:
t *|Stop FNshell_WindowIsAPane
u
v&*|Start FNshell_WindowIsNotBounded
w$� �shell_WindowIsNotBounded(wh%)
x(=(�shell_WindowGetFlags(wh%) � 1<<6)
y:
z%*|Stop FNshell_WindowIsNotBounded
{
|&*|Start FNshell_WindowTrapsHotKeys
}$� �shell_WindowTrapsHotKeys(wh%)
~)=(�shell_WindowGetFlags(wh%) � 1<<12)
:
�%*|Stop FNshell_WindowTrapsHotKeys
�
� *|Start FNshell_WindowIsOpen
�� �shell_WindowIsOpen(wh%)
�)=(�shell_WindowGetFlags(wh%) � 1<<16)
�:
�*|Stop FNshell_WindowIsOpen
�
�!*|Start FNshell_WindowIsOnTop
�� �shell_WindowIsOnTop(wh%)
�)=(�shell_WindowGetFlags(wh%) � 1<<17)
�:
� *|Stop FNshell_WindowIsOnTop
�
�(*|Start FNshell_WindowHasBeenToggled
�&� �shell_WindowHasBeenToggled(wh%)
�)=(�shell_WindowGetFlags(wh%) � 1<<18)
�:
�'*|Stop FNshell_WindowHasBeenToggled
�
�'*|Start FNshell_WindowHasInputFocus
�%� �shell_WindowHasInputFocus(wh%)
�)=(�shell_WindowGetFlags(wh%) � 1<<20)
�:
�&*|Stop FNshell_WindowHasInputFocus
�
�%*|Start FNshell_WindowHasBackIcon
�#� �shell_WindowHasBackIcon(wh%)
�)=(�shell_WindowGetFlags(wh%) � 1<<24)
�:
�$*|Stop FNshell_WindowHasBackIcon
�
�&*|Start FNshell_WindowHasCloseIcon
�$� �shell_WindowHasCloseIcon(wh%)
�)=(�shell_WindowGetFlags(wh%) � 1<<25)
�:
�%*|Stop FNshell_WindowHasCloseIcon
�
�'*|Start FNshell_WindowHasToggleIcon
�%� �shell_WindowHasToggleIcon(wh%)
�)=(�shell_WindowGetFlags(wh%) � 1<<27)
�:
�&*|Stop FNshell_WindowHasToggleIcon
�
�'*|Start FNshell_WindowHasVScrollBar
�%� �shell_WindowHasVScrollBar(wh%)
�)=(�shell_WindowGetFlags(wh%) � 1<<28)
�:
�&*|Stop FNshell_WindowHasVScrollBar
�
�+*|Start FNshell_WindowHasAdjustSizeIcon
�)� �shell_WindowHasAdjustSizeIcon(wh%)
�)=(�shell_WindowGetFlags(wh%) � 1<<29)
�:
�**|Stop FNshell_WindowHasAdjustSizeIcon
�
�'*|Start FNshell_WindowHasHScrollBar
�%� �shell_WindowHasHScrollBar(wh%)
�)=(�shell_WindowGetFlags(wh%) � 1<<30)
�:
�&*|Stop FNshell_WindowHasHScrollBar
�
�"*|Start FNshell_WindowGetFlags
� � �shell_WindowGetFlags(wh%)
�� flags%,blk%
�"blk%=�shell_HeapBlockFetch(36)
�blk%!0=wh%
�"ș "Wimp_GetWindowState",,blk%
�flags%=blk%!32
� �shell_HeapBlockReturn(blk%)
�=flags%
�:
�!*|Stop FNshell_WindowGetFlags
�
�'*|Start FNshell_WindowGetTitleFlags
�%� �shell_WindowGetTitleFlags(wh%)
�� flags%,blk%
�Iblk%=�shell_HeapBlockFetch(100 + (�shell_WindowCountIcons(wh%) * 32))
�blk%!0=wh%
�!ș "Wimp_GetWindowInfo",,blk%
�flags%=blk%!60
� �shell_HeapBlockReturn(blk%)
�=flags%
�:
�&*|Stop FNshell_WindowGetTitleFlags
�
� *|Start FNshell_IconGetFlags
�"� �shell_IconGetFlags(wh%,ih%)
�� flags%,blk%
�>� claim a block as temporary workspace big enough for data
�1� returned by SWI call (icon block + 8 bytes)
�"blk%=�shell_HeapBlockFetch(50)
�blk%!0=wh%:blk%!4=ih%
� ș "Wimp_GetIconState",,blk%
�flags%=blk%!24
� �shell_HeapBlockReturn(blk%)
�=flags%
�:
�*|Stop FNshell_IconGetFlags
�
�$*|Start FNshell_WindowTitleFlags
�"� �shell_WindowTitleFlags(wh%)
�� flags%,blk%
�Iblk%=�shell_HeapBlockFetch(100 + (�shell_WindowCountIcons(wh%) * 32))
�blk%!0=wh%
�!ș "Wimp_GetWindowInfo",,blk%
�flags%=blk%!60
� �shell_HeapBlockReturn(blk%)
�=flags%
�:
�#*|Stop FNshell_WindowTitleFlags
�
�(*|Start FNshell_WindowTitleHasBorder
�&� �shell_WindowTitleHasBorder(wh%)
�*=(�shell_WindowTitleFlags(wh%) � 1<<2)
�:
�'*|Stop FNshell_WindowTitleHasBorder
�
�'*|Start FNshell_WindowTitleIsSprite
�%� �shell_WindowTitleIsSprite(wh%)
�*=(�shell_WindowTitleFlags(wh%) � 1<<1)
�:
�&*|Stop FNshell_WindowTitleIsSprite
�
�%*|Start FNshell_WindowTitleIsText
�#� �shell_WindowTitleIsText(wh%)
�*=(�shell_WindowTitleFlags(wh%) � 1<<0)
�:
$*|Stop FNshell_WindowTitleIsText

)*|Start FNshell_WindowTitleIsHCentred
'� �shell_WindowTitleIsHCentred(wh%)
*=(�shell_WindowTitleFlags(wh%) � 1<<3)
:
(*|Stop FNshell_WindowTitleIsHCentred

)*|Start FNshell_WindowTitleIsVCentred
	'� �shell_WindowTitleIsVCentred(wh%)

*=(�shell_WindowTitleFlags(wh%) � 1<<4)
:
(*|Stop FNshell_WindowTitleIsVCentred


'*|Start FNshell_WindowTitleIsFilled
%� �shell_WindowTitleIsFilled(wh%)
*=(�shell_WindowTitleFlags(wh%) � 1<<5)
:
&*|Stop FNshell_WindowTitleIsFilled

)*|Start FNshell_WindowTitleIsAAliased
'� �shell_WindowTitleIsAAliased(wh%)
*=(�shell_WindowTitleFlags(wh%) � 1<<6)
:
(*|Stop FNshell_WindowTitleIsAAliased

+*|Start FNshell_WindowTitleIsIndirected
)� �shell_WindowTitleIsIndirected(wh%)
*=(�shell_WindowTitleFlags(wh%) � 1<<8)
:
**|Stop FNshell_WindowTitleIsIndirected

 "*|Start FNshell_WindowGetTitle
! � �shell_WindowGetTitle(wh%)
"� title$,blk%
#'� Check if window has a title bar..
$Iblk%=�shell_HeapBlockFetch(100 + (�shell_WindowCountIcons(wh%) * 32))
%blk%!0=wh%
&!È™ "Wimp_GetWindowInfo",,blk%
'� (blk%!32 � 1<<26) �
(  � ((blk%!60) � &100)=0 �
)#    � Title is not indirected..
*    title$=$(blk%+76)
+  �
,    � Title is indirected..
-    title$=$(!(blk%+76))
.  �
/�
0 �shell_HeapBlockReturn(blk%)
1=title$
2:
3!*|Stop FNshell_WindowGetTitle
4
5+*|Start FNshell_WindowTitleBufferLength
6)� �shell_WindowTitleBufferLength(wh%)
7� result%,blk%
8Iblk%=�shell_HeapBlockFetch(100 + (�shell_WindowCountIcons(wh%) * 32))
9blk%!0=wh%
:!È™ "Wimp_GetWindowInfo",,blk%
;  � ((blk%!60) � &100)=0 �
<    result%=12
=  �
>    result%=blk%!84
?  �
@ �shell_HeapBlockReturn(blk%)
A=result%
B:
C**|Stop FNshell_WindowTitleBufferLength
D
E&*|Start PROCshell_WindowMoveToIcon
F9� �shell_WindowMoveToIcon(wh%,iwh%,ih%,x_off%,y_off%)
G� i_blk%,w_blk%
H)i_blk%    = �shell_HeapBlockFetch(50)
I)w_blk%    = �shell_HeapBlockFetch(36)
Jw_blk%!20 = 0
K � �shell_OSCheckVersion(3) �
L1  � iwh% = -1 � !w_blk% = -2 � !w_blk% = iwh%
M&  È™ "Wimp_GetWindowState",,w_blk%
N�
O$i_blk%!0 = iwh% : i_blk%!4 = ih%
P"È™ "Wimp_GetIconState",,i_blk%
QG�shell_WindowMoveTo(wh%,i_blk%!8+x_off%-w_blk%!20,i_blk%!20+y_off%)
RB� PROCshell_WindowMoveTo(wh%,i_blk%!8+x_off%,i_blk%!20+y_off%)
S"�shell_HeapBlockReturn(i_blk%)
T"�shell_HeapBlockReturn(w_blk%)
U�
V:
W%*|Stop PROCshell_WindowMoveToIcon
X
Y"*|Start PROCshell_WindowMoveTo
Z$� �shell_WindowMoveTo(wh%,x%,y%)
[)� win_width%,win_height%,offset%,blk%
\Iblk%=�shell_HeapBlockFetch(100 + (�shell_WindowCountIcons(wh%) * 32))
]blk%!0=wh%
^!È™ "Wimp_GetWindowInfo",,blk%
_win_width% =blk%!12-blk%!4
`win_height%=blk%!16-blk%!8
a
blk%!4=x%
b
blk%!8=y%
cblk%!12=x%+win_width%
dblk%!16=y%+win_height%
e;� this looks really silly, but is necessary to tell the
f@� window manager the new window coords. The shell_OpenWindow
g=� call sets up any panes and actually opens the window in
h� the new position
iÈ™ "Wimp_OpenWindow",,blk%
jÈ™ "Wimp_CloseWindow",,blk%
k,offset%=�shell_SearchStatic(_U%!184,wh%)
l� offset%>-1 �
m"  �shell_OpenWindowStatic(wh%)
n�
o(  �shell_OpenWindowDynamic2(wh%,0,0)
p�
q �shell_HeapBlockReturn(blk%)
r�
s:
t!*|Stop PROCshell_WindowMoveTo
u
v&*|Start PROCshell_WindowBringToTop
w"� �shell_WindowBringToTop(wh%)
x
� msg%
y#msg%=�shell_HeapBlockFetch(256)
zmsg%!0=wh%
{"È™ "Wimp_GetWindowState",,msg%
|msg%!28=-1
}$È™ "Wimp_SendMessage",2,msg%,wh%
~3� now call wimp poll as this action must happen
+� without waiting for next wimp poll...
�ș "Wimp_Poll",0,msg%
� �shell_HeapBlockReturn(msg%)
��
�:
�%*|Stop PROCshell_WindowBringToTop
�
�"*|Start PROCshell_UpdateWindow
�.� �shell_UpdateWindow(handle%,l%,b%,r%,t%)
�
� blk%
�$blk%=�shell_HeapBlockFetch(blk%)
�<blk%!0=handle%:blk%!4=l%:blk%!8=b%:blk%!12=r%:blk%!16=t%
�(ș "Wimp_UpdateWindow",,blk% � more%
�"ș "Wimp_GetWindowState",,blk%
� �shell_HeapBlockReturn(blk%)
��
�:
�!*|Stop PROCshell_UpdateWindow
�
�(*|Start PROCshell_OpenWindowDynamic2
�2� �shell_OpenWindowDynamic2(wh%,x_off%,y_off%)
�� void%,ptr_blk%
�&ptr_blk%=�shell_HeapBlockFetch(20)
�_U%!20=wh%
�&ș "Wimp_GetPointerInfo",,ptr_blk%
�Aș "Wimp_CreateMenu",,wh%,ptr_blk%!0+x_off%,ptr_blk%!4+y_off%
�$�shell_HeapBlockReturn(ptr_blk%)
��
�:
�'*|Stop PROCshell_OpenWindowDynamic2
�
�!*|Start FNshell_ClaimKeypress
�� �shell_ClaimKeypress
�C� Bodge to ensure that shell_OpenWindowDynamic works properly..
�� _U%!20<>0 �
�  ș "Wimp_CreateMenu",,-1
�'  void%=�shell_DeleteWindow(_U%!20)
�  _U%!20=0
��
�=�
�:
� *|Stop FNshell_ClaimKeypress
�
� *|Start PROCshell_OpenWindow
�)� �shell_OpenWindow(wh%,full%,front%)
�C� offset%,blk%,paneblk%,ctr%,first_pane%,behind%,height%,width%
�?� flag%,toggle%,t%,last_pane%,prev_pane%,res%,ptr_info_blk%
� � check for openwindow event
�<offset% = �shell_GetEventListOffset(wh%,-1,_U%+304,12,�)
�� offset% >= 0 �
�  blk%  =_U%!304 + offset%
�  temp% = blk%!8
�*|ifdef TraceInit
�=  �shell_Tracef0("OpenWindow:About to call "+"FN"+$temp%)
�*|endif
�  res% = �("FN"+$temp%)
�  � res% = 0 � �
��
�
�toggle% = �
�$t%   = �shell_HeapBlockFetch(40)
�t%!0 = wh%
� ș "Wimp_GetWindowState",,t%
�;� (t%!32 � &80000) = &80000 � toggle% = � � toggle% = �
��shell_HeapBlockReturn(t%)
�
�-ptr_info_blk% = �shell_HeapBlockFetch(20)
�+ș "Wimp_GetPointerInfo",,ptr_info_blk%
�
�_Q%!0 = wh%
�-� � full% � ș "Wimp_GetWindowState",,_Q%
�� toggle% �
�  ș "Wimp_OpenWindow",,_Q%
��
�=offset% = �shell_GetEventListOffset(wh%,-1,_U% + 92,24,�)
�� offset% > -1 �
�  blk%=(_U%!92) + offset%
�   � pane handler event found
�G  ptr8% = blk%!8:ptr12% = blk%!12:ptr16% = blk%!16:ptr20% = blk%!20
�  _Q%!0=wh%
�,  � front% � behind%=-1 � behind%=_Q%!28
�  � � full% �
�6    ș "Wimp_OpenWindow",,_Q%     :� vbase fudge..
�%    ș "Wimp_GetWindowState",,_Q%
�6    ș "Wimp_CloseWindow",,_Q%    :� vbase fudge..
�  �
�4  � reserve 1k as buffer - hope it's enough.....
�*  paneblk% = �shell_HeapBlockFetch(40)
�  ctr% = 0
�  ȕ ptr8%!ctr% <> -1
�2    paneblk%!0 = ptr8%!ctr%:� handle of 'pane'
�4    � first_pane% = 0 � first_pane% = paneblk%!0
�    last_pane% = paneblk%!0
�*    ș "Wimp_GetWindowState",,paneblk%
�L    � ptr_info_blk%!16 = -9 � toggle% � ptr_info_blk%!16 > -5 � front% �
�      � open pane
�2      � Check flag word in pane event block...
�      flag% = ptr12%!ctr%
�      Ȏ flag% �
�      � 0,1
�*        height%=paneblk%!16-paneblk%!8
�)        width%=paneblk%!12-paneblk%!4
�(        paneblk%!4=_Q%!4+ptr16%!ctr%
�)        paneblk%!12=paneblk%!4+width%
�*        paneblk%!16=_Q%!16+ptr20%!ctr%
�*        paneblk%!8=paneblk%!16-height%
�
      � 2
�'        � Attached to top edge.....
�*        height%=paneblk%!16-paneblk%!8
�        width%=_Q%!12-_Q%!4
�(        paneblk%!4=_Q%!4+ptr16%!ctr%
�        paneblk%!12=_Q%!12
�*        paneblk%!16=_Q%!16+ptr20%!ctr%
�*        paneblk%!8=paneblk%!16-height%
�
      � 3
�&        � Attached to left edge...
�         height%=_Q%!16-_Q%!8
�)        width%=paneblk%!12-paneblk%!4
�(        paneblk%!4=_Q%!4+ptr16%!ctr%
�)        paneblk%!12=paneblk%!4+width%
�3        paneblk%!16=_Q%!16             :� min y
�3        paneblk%!8=_Q%!8+ptr20%!ctr%   :� max y
�
      � 4
�(        � Attached to bottom edge...
�*        height%=paneblk%!16-paneblk%!8
�        width%=_Q%!12-_Q%!4
�(        paneblk%!4=_Q%!4+ptr16%!ctr%
�        paneblk%!12=_Q%!12
�1        paneblk%!16=_Q%!8+height%+ptr20%!ctr%
*        paneblk%!8=paneblk%!16+height%

      � 5
'        � Attached to right edge...
         height%=_Q%!16-_Q%!8
)        width%=paneblk%!12-paneblk%!4
0        paneblk%!4=_Q%!12-width%+ptr16%!ctr%
)        paneblk%!12=paneblk%!4+width%
'        paneblk%!16=_Q%!16 :� min y
'        paneblk%!8=_Q%!8   :� max y
	      �

      � ctr%=0 �
!        paneblk%!28 = behind%
      �

$        paneblk%!28 = prev_pane%
      �
(      È™ "Wimp_OpenWindow",,paneblk%
	    �
    prev_pane% = paneblk%!0
    ctr% += 4
  �
  � � toggle% �
    _Q%!28 = last_pane%
!    È™ "Wimp_OpenWindow",,_Q%
  �
&  �shell_HeapBlockReturn(paneblk%)
�
  � no pane event...
  _Q%!0 = wh%
/  � � full% � ș "Wimp_GetWindowState",,_Q%
"  � behind% = -2 � _Q%!28 = -2
"  � front%  = -1 � _Q%!28 = -1
  È™ "Wimp_OpenWindow",,_Q%
 �
!)�shell_HeapBlockReturn(ptr_info_blk%)
"�
#:
$*|Stop PROCshell_OpenWindow
%
&!*|Start PROCshell_CloseWindow
'� �shell_CloseWindow(wh%)
(;� offset%,blk%,ptr8%,ptr12%,ptr16%,ptr20%,win_blk%,res%
):offset%=�shell_GetEventListOffset(wh%,-1,_U%+308,12,�)
*� offset%>=0 �
+  blk%=_U%!308+offset%
,  temp%=blk%!8
-*|ifdef TraceInit
.>  �shell_Tracef0("CloseWindow:About to call "+"FN"+$temp%)
/*|endif
0  res%=�("FN"+$temp%)
1  � res%=0 � �
2�
3&win_blk%=�shell_HeapBlockFetch(60)
4
� wh%>0 �
5;  offset%=�shell_GetEventListOffset(wh%,-1,_U%+92,24,�)
6  � offset%>-1 �
7    blk%=(_U%!92)+offset%
84    ptr12%=blk%!12:ptr16%=blk%!16:ptr20%=blk%!20
9    ctr%=0:ptr8%=blk%!8
:    È• ptr8%!ctr%<>-1
;      � close pane windows
<      win_blk%!0=ptr8%!ctr%
=)      È™ "Wimp_CloseWindow",,win_blk%
>      ctr%+=4
?	    �
@*    � PROCshell_HeapBlockReturn(ptr8%)
A+    � PROCshell_HeapBlockReturn(ptr12%)
B+    � PROCshell_HeapBlockReturn(ptr16%)
C+    � PROCshell_HeapBlockReturn(ptr20%)
D  �
E  � close parent window
F4  win_blk%!0=wh%:È™ "Wimp_CloseWindow",,win_blk%
G�
H$�shell_HeapBlockReturn(win_blk%)
I�
J:
K *|Stop PROCshell_CloseWindow
L
M *|Start FNshell_DeleteWindow
N"� �shell_DeleteWindow(handle%)
O� win_blk%
P&win_blk%=�shell_HeapBlockFetch(20)
Q� handle%<>0 �
R  � �oktodeletew(handle%) �
S&    �shell_EventDeleteAll(handle%)
T#    � handle%=_U%!20 � _U%!20=0
U4    offset%=�shell_SearchStatic(_U%!184,handle%)
V    � offset%>-1 �
W      temp%=_U%!184+offset%
X7      temp%!0=0:� wipe window handle in static list
Y	    �
Z.    � and now actually delete the window..
[    win_blk%!0=handle%
\(    È™ "Wimp_DeleteWindow",,win_blk%
]    handle%=0
^  �
_�
`$�shell_HeapBlockReturn(win_blk%)
a=handle%
b:
c*|Stop FNshell_DeleteWindow
d*|Start FNoktodeletew
e� �oktodeletew(handle%)
f=-1
g:
h*|Stop FNoktodeletew
i*|Start FNoktoclosew
j� �oktoclosew(handle%)
k=-1
l:
m*|Stop FNoktoclosew
n*|Start PROCcliprect
o*� �cliprect(b,� x1%,� y1%,� x2%,� y2%)
p
� x0%,y0%
q@�lwaorigin(b,x0%,y0%):x1%=b!24-x0%:y1%=b!28-y0%:x2%=b!32-x0%
ry2%=b!36-y0%
s�
t:
u*|Stop PROCcliprect
v
w*|Start FNpoll
x� �poll(mask%,task%)
y-� _U%!100 � 1 << 6 � ș "WimpExt_PrePoll"
z!ș "Wimp_Poll",mask%,_Q% � a%
{;� _U%!100 � 1 << 6 � ș "WimpExt_Action",_U%!148,_Q%,a%
|=a%
}:
~*|Stop FNpoll

�*|Start FNshell_Poll_I
� � �shell_Poll_I(mask%,task%)
�-� _U%!100 � 1 << 6 � ș "WimpExt_PrePoll"
�!ș "Wimp_Poll",mask%,_Q% � a%
�;� _U%!100 � 1 << 6 � ș "WimpExt_Action",_U%!148,_Q%,a%
�!ș "Interface_Poll",a%,,task%
�=a%
�:
�*|Stop FNshell_Poll_I
�
�&*|Start PROCshell_DoBackgroundTask
�� �shell_DoBackgroundTask
��
�:
�%*|Stop PROCshell_DoBackgroundTask
�
�#*|Start FNshell_IconIsDraggable
�%� �shell_IconIsDraggable(wh%,ih%)
�� flags%
�'flags%=�shell_IconGetFlags(wh%,ih%)
�temp%=(flags% � &6000)
�� temp%=&6000 =� � =�
�:
�"*|Stop FNshell_IconIsDraggable
�
� *|Start FNshell_IconIsSprite
�"� �shell_IconIsSprite(wh%,ih%)
�� flags%,temp%
�'flags%=�shell_IconGetFlags(wh%,ih%)
�temp%=(flags% � 1<<1)
�� temp%=(1<<1) � =� � =�
�:
�*|Stop FNshell_IconIsSprite
�
�!*|Start PROCshell_IconDragBox
�!� �shell_IconDragBox(wh%,ih%)
�I� blk%,wex,wey,e_offset%,flags%,f%,DragASprite%,spr_area%,valid%,spr$
�� name_ic%,name$
�D� check if an event has been registered for when the drag ends..
�@e_offset% = �shell_GetEventListOffset(wh%,ih%,_U% + 72,24,�)
�� e_offset% >= 0 �
�M  � it has, so go ahead and allow the drag, but first check if a filename
�)  � is present in the filename icon..
�  blk%=_U%!72+e_offset%
�  name_ic%=blk%!16
�,  name$=�shell_IconGetData(wh%,name_ic%)
�@  � name$="" � �shell_OK(�shell_MessageNoArgs("SHELLMSG28"))
�K  blk%=�shell_HeapBlockFetch(100 + (�shell_WindowCountIcons(wh%) * 32))
�  !blk%=wh%
�#  ș "Wimp_GetWindowInfo",,blk%
�4  wex = blk%!4 - blk%!20:wey = blk%!16 - blk%!24
�  spr_area% = blk%!68
�  blk%!4 = ih%
�"  ș "Wimp_GetIconState",,blk%
�6  !blk%=wh%:blk%!4=5:flags%=blk%!24:valid%=blk%!32
�  blk%!08 = blk%!08 + wex
�  blk%!12 = blk%!12 + wey
�  blk%!16 = blk%!16 + wex
�  blk%!20 = blk%!20 + wey
�  blk%!24 = 0:blk%!28 = 0
�  blk%!32 = &7FFFFFFF
�  blk%!36 = &7FFFFFFF
�+  � check dragasprite bit in CMOS RAM..
�   ș "OS_Byte",161,28 � ,,f%
�#  DragASprite% = ((f% � 2) = 2)
�  � DragASprite% �
�    f% = flags%
�    � (f% � &100) �
�2      spr$ = �shell_IconGetCommand(valid%,"s")
�	    �
�F    � (f% � 2) = 0 � �shell_OK(�shell_MessageNoArgs("SHELLMSG19"))
�    � spr$ <> "" �
�B      ș "DragASprite_Start",%10000101,spr_area%,spr$,blk% + 8
�:      _U%!100 = _U%!100 � 1:� set 'dragasprite' flag..
�	    �
�!      ș "Wimp_DragBox",,blk%
�	    �
�  �
�    ș "Wimp_DragBox",,blk%
�  �
�"  �shell_HeapBlockReturn(blk%)
��
�*|ifdef TraceInit
�[  �shell_Tracef0("IconDragBox:WARNING! no user drag handler registered for this icon!")
�J  �shell_Tracef0("IconDragBox:now checking for a slider drag event..")
�*|endif
�D  e_offset% = �shell_GetEventListOffset2(wh%,ih%,_U% + 332,32,�)
�A  �shell_Tracef0("IconDragBox:event offset is " + �e_offset%)
�?  � e_offset% >= 0 � �shell_HandleSlider(wh%,ih%,e_offset%)
��
��
�:
� *|Stop PROCshell_IconDragBox
�
�(*|Start PROCshell_HandleAttachedMenu
�,� �shell_HandleAttachedMenu(_Q%,wh%,ih%)
�� menu%
�� �
�� � �:� �:�
�C� Only executed when SELECT is pressed over an icon that has an
�� attached menu..
�� ih% <> -1 � wh% > -1 �
�0  menu% = �shell_GetEventMenu(_Q%!8,wh%,ih%)
�  � menu% <> 0 �
�2    �shell_HandleMenuOpen(_Q%,menu%,wh%,ih%,�)
�  �
��
��
�:
�'*|Stop PROCshell_HandleAttachedMenu
�
�*|Start PROCshell_Action
�� �shell_Action(evnt%)
�;� fn$,menu%,menu$,select$,menu_buffer%,mx%,my%,claimed%
�C� wh%,ih%,void%,_temp28%,_temp32%,_temp24%,_temp%,fontmenuflag%
�� CheckSelect%,offset%
�Ȏ evnt% �
�!  � 0:�shell_DoBackgroundTask
�$         � (_U%!100 � 1 << 11) �
�           �shell_Slider
�         �
�$  � 1:�shell_RedrawWindow(_Q%!0)
�&  � 2:�shell_OpenWindow(_Q%!0,�,0)
�#  � 3:�shell_CloseWindow(_Q%!0)
�**|ifdef PROCshell_PointerLeavingWindow
�*  � 4:�shell_PointerLeavingWindow(_Q%)
�*|endif
�+*|ifdef PROCshell_PointerEnteringWindow
+  � 5:�shell_PointerEnteringWindow(_Q%)
*|endif
9  � 6:_U%!28=_Q%!12:_U%!32=_Q%!16:mx%=_Q%!0:my%=_Q%!4
6         _U%!272=_Q%!0:_U%!276=_Q%!4:_U%!320=_Q%!8
7         _temp28%=_Q%!12:_temp32%=_Q%!16:ih%=_Q%!16
*|ifdef TraceInit
@         �shell_Tracef0("Action:Mouse_Click event detected")
^         �shell_Tracef0("Action:Window Handle was &"+�~_Q%!12+" Icon Handle was "+�_Q%!16)
*|endif
	0         � _Q%!12=_U%!288 � _Q%!16=_U%!292 �

C           � same icon pressed again, use stored event offset..
B           �shell_HandleBumpIcons(_U%!296,_Q%!12,_Q%!16,_Q%!8)
         �

/           _U%!288=-1:_U%!292=-1:_U%!296=-1
           � _Q%!16>=0 �
O             offset%=�shell_GetEventListOffset2(_Q%!12,_Q%!16,_U%+104,16,0)
H             �shell_Tracef0("DEBUG::bump event offset is "+�offset%)
S             � offset%>=0 � �shell_HandleBumpIcons(offset%,_Q%!12,_Q%!16,_Q%!8)
           �
         �
)         � check first for drag flag!
         � (_Q%!8=64) �
9           � only check for SELECT and ADJUST buttons
<           result%=�shell_IconIsDraggable(_Q%!12,_Q%!16)
           � result% �
*             mess$="Icon is draggable"
+             � so now draw the drag box
2             �shell_IconDragBox(_Q%!12,_Q%!16)
           �
.             mess$="Icon is not draggable"
           �
.           �shell_Tracef0("Action:"+mess$)
          �
!         Ȏ _Q%!8 �
",           � 4:�shell_ActionSelectButton
#*           � 2:�shell_ActionMenuButton
$,           � 1:�shell_ActionAdjustButton
%         �
&  � 7:� _U%!100 � 1 �
'$           È™ "DragASprite_Stop"
($           _U%!100 = _U%!100 � 1
)         �
*H         _U%!128 = 0:� set RAMPtr% to 0 in case a RAMFetch follows..
+E         � have to use last window/icon handles from _U% block as
,?         � _Q% block could be corrupted by other poll calls
-(         � (_U%!100 � 1 << 11) = 0 �
.;           � it was not a slider drag that just ended..
/<           fn$ = �shell_GetEventHandler(_U%!28,_U%!32,6)
0           � fn$ <> "" �
1P             �shell_Tracef0("Action:Drag event detected - function is "+fn$)
28             void%=�("FN"+fn$+"(_temp28%,_temp32%)")
3           �
4S             �shell_Tracef0("Action:Drag event detected - no handler function")
5*             � set up datasave message
63             �shell_SendDataSave(_U%!28,_U%!32)
7           �
8         �
95           � unset 'slider drag in progress' flag
:*           _U%!100 = _U%!100 � 1 << 11
;         �
<
  � 8:
=:         �shell_Tracef0("Action:keypress is="+�_Q%!24)
>         Ȏ _Q%!24 �
?*         � &0D,394,398,399,410,430,431
@F           claimed%=�shell_WritableIconHandler(_Q%!0,_Q%!4,_Q%!24)
A         
B4           claimed%=�shell_HotKeyProcess(_Q%!24)
C         �
D         � � claimed% �
EK           �shell_Tracef0("Action:Keypress not claimed, passing it on")
F*           È™ "Wimp_ProcessKey",_Q%!24
G         �
HL           �shell_Tracef0("Action:Keypress claimed by this application")
I         �
J&  � 9:�shell_ActionMenuSelect(_Q%)
K!  � 17,18:�shell_Receive(_Q%)
L0  � 19   :�shell_UserMessageAcknowledge(_Q%)
M�
N�
O:
P*|Stop PROCshell_Action
Q
R(*|Start PROCshell_ActionSelectButton
S� �shell_ActionSelectButton
T
� offset%
U*|ifdef TraceInit
V@�shell_Tracef0("ActionSelectButton:Mouse Button was SELECT")
W*|endif
X� _U%!32 >= 0 �
YR  � last mouse click was over an icon, check if icon has popup menu attached..
ZH  offset% = �shell_GetEventListOffset2(_Q%!12,_Q%!16,_U% + 340,24,�)
[�
\� offset% > 0 �
]  � Popup event found..
^  � is it a colour menu?
_'  � !(_U%!340 + offset% + 16) = 1 �
`o    �shell_MenuTickOnly1(!(_U%!340 + offset% + 20),�shell_IconGetBGColour(_Q%!12,!(_U%!340 + offset% + 8)))
a  �
bJ  �shell_HandleMenuOpen(_Q%,!(_U%!340 + offset% + 20),_Q%!12,_Q%!16,�)
c�
d2  �shell_HandleAttachedMenu(_Q%,_U%!28,_U%!32)
eE  � _U%!32 = 0 � �shell_HandleAttachedDataSave(_Q%,_U%!28,_U%!32)
f3  fn$ = �shell_GetEventHandler(_U%!28,_U%!32,2)
g  � fn$ <> "" �
h(    �shell_IconSlab(4,_U%!28,_U%!32)
i*|ifdef TraceInit
jd    �shell_Tracef0("ActionSelectButton:About to call "+"FN"+fn$+"("+�_temp28%+","+�_temp32%+")")
k*|endif
l5    void% = �("FN" + fn$ + "(_temp28%,_temp32%)")
m  �
n>  � if icon was 0 and dbox is dynamic then close dbox/menu
o  � _U%!32=0 �
p    � _U%!28=_U%!20 �
q"      È™ "Wimp_CreateMenu",,-1
r	    �
s  �
t�
u�
v'*|Stop PROCshell_ActionSelectButton
w
x&*|Start PROCshell_ActionMenuButton
y� �shell_ActionMenuButton
z � temp%,menu%,popup%,offset%
{popup% = �
|*|ifdef PROCshell_TraceInit
}<�shell_Tracef0("ActionMenuButton:Mouse Button was MENU")
~*|endif
� _Q%!16 >= 0 �
�H  offset% = �shell_GetEventListOffset2(_Q%!12,_Q%!16,_U% + 340,24,�)
��
�� offset% > 0 �
�  � Popup event found..
�J  �shell_HandleMenuOpen(_Q%,!(_U%!340 + offset% + 20),_Q%!12,_Q%!16,�)
��
�
  temp%=�
�4  � �(-1) � temp%=�shiftmenuclick(_Q%!12,_Q%!16)
�  � temp% �
�*|ifdef PROCshell_TraceInit
�A    �shell_Tracef0("ActionMenuButton:Checking menu events..")
�_    �shell_Tracef0("ActionMenuButton:button="+�_Q%!8+" _Q%!12="+�_Q%!12+" _Q%!16="+�_Q%!16)
�*|endif
�F    � _Q%!16 >= 0 � menu%=�shell_GetEventMenu(_Q%!8,_Q%!12,_Q%!16)
�>    � (menu% <> 0 � _Q%!12 > 0 � _Q%!16 >= 0) � popup% = �
�    � menu% = 0 �
�I      � No menu attached to the icon that was clicked over, therefore
�>      � look for a menu attached to the window work area..
�7      menu%  = �shell_GetEventMenu(_Q%!8,_Q%!12,-1)
�	    �
�*|ifdef PROCshell_TraceInit
�C    �shell_Tracef0("ActionMenuButton:Menu handle is:&"+�~menu%)
�*|endif
�J    � menu%<>0 � �shell_HandleMenuOpen(_Q%,menu%,_Q%!12,_Q%!16,popup%)
�  �
��
��
�:
�%*|Stop PROCshell_ActionMenuButton
�
�$*|Start PROCshell_HandleMenuOpen
�5� �shell_HandleMenuOpen(_Q%,menu%,wh%,ih%,popup%)
�� i_blk%,w_blk%
�H� This routine handles the case of 'popup' menus, adjusting the menu
�H� and pointer positions before opening to conform to the Style Guide
�� recommendations..
�� popup% = � �
�H  � Menu is a normal menu attached to a window, or to an icon on the
�A  � iconbar, so MenuUtils will open it in the correct place..
�(  �shell_OpenMenu(_Q%!0,_Q%!4,menu%)
��
�K  � Menu is a 'popup', i.e attached to a specific icon in a window that
�I  � is not the iconbar. Therefore open the menu to right right of the
�-  � icon as required by the Style Guide..
�(  i_blk% = �shell_HeapBlockFetch(50)
�(  w_blk% = �shell_HeapBlockFetch(36)
�E  � read coordinates of icon that has menu attached and open menu
�  � to the right of it..
�#  i_blk%!0 = wh%:i_blk%!4 = ih%
�$  ș "Wimp_GetIconState",,i_blk%
�  w_blk%!0 = wh%
�&  ș "Wimp_GetWindowState",,w_blk%
�=  �shell_OpenMenu(w_blk%!4 + i_blk%!16  + 64,_Q%!4,menu%)
�,  � And move the pointer appropriately..
�(  ȗ � w_blk%!4+i_blk%!16 + 64,_Q%!4
�$  �shell_HeapBlockReturn(i_blk%)
�$  �shell_HeapBlockReturn(w_blk%)
��
��
�:
�#*|Stop PROCshell_HandleMenuOpen
�
�&*|Start PROCshell_ActionMenuSelect
�"� �shell_ActionMenuSelect(_Q%)
�K� handler%,menu_buffer%,CheckSelect%,fontmenuflag%,void%,h_blk%,offset%
�Foffset% = �shell_GetEventListOffset2(_U%!28,_U%!32,_U% + 340,24,�)
�6� offset% >= 0 � �shell_DoPopupSelect(_Q%,offset%)
�%h_blk%=�shell_HeapBlockFetch(256)
�*|ifdef PROCshell_TraceInit
�A�shell_Tracef0("ActionMenuSelect:Menu_Select event detected")
�*|endif
�)ș "Wimp_GetPointerInfo",,_shell_blk%
�*|ifdef Using_FontMenu
�+menu_buffer%=�shell_HeapBlockFetch(256)
�� _U%!24=_U%!252 �
�"  � Current menu is FontMenu..
�  CheckSelect%=0:_U%!264=1
��
�-  CheckSelect%=�shell_CheckSelection(_Q%)
�/  � CheckSelect%>-1 � _U%!264=1 � _U%!264=0
��
�� _U%!264>0 �
�P  ș "FontMenu_DecodeFontMenu",_Q%+CheckSelect%,menu_buffer% � fontmenuflag%
�  � fontmenuflag%=1 �
�%    � 'sensible' selection made..
�*|ifdef PROCshell_TraceInit
�b    �shell_Tracef0("ActionMenuSelect:FontMenu selection ("+�shell_GetString(menu_buffer%)+")")
�*|endif
�I    �shell_FontMenuSelectFont(�shell_GetString(menu_buffer%),_U%!260)
�$    � _shell_FontMenuSelFN$="" �
�7      ș "Wimp_DecodeMenu",,_U%!24,_Q%,menu_buffer%
�5      fn$=�shell_GetEventHandler(_U%!52,_U%!56,0)
�      _temp%=menu_buffer%
�9      $_temp%=�shell_StringStripTrailing($_temp%," ")
�3      � fn$<>"" � void%=�("FN"+fn$+"($_temp%)")
�	    �
�'      � _shell_FontMenuSelFN$<>"" �
�W        void%=�("FN"+_shell_FontMenuSelFN$+"(FNshell_FontMenuGetLastSelectedFont)")
�      �
�	    �
�  �
��
�(�shell_HeapBlockReturn(menu_buffer%)
�*|endif
�� _U%!264=0 �
�8  ș "MenuUtil_Decode",_U%!24,_Q% � handler%,,h_blk%
�:  � handler% � �shell_MenuCallHandler(handler%,h_blk%)
��
�� _shell_blk%!8=1 �
�)  � �shell_HeapBlockExists(_U%!224) �
�    _temp%=_U%!224
�    � $_temp%<>"" �
�$      � Call last menuwarning fn
�1      void%=�("FN"+$_temp%+"(_U%!52,_U%!56)")
�	    �
�  �
�+  �shell_OpenMenu(_U%!36,_U%!40,_U%!24)
��
�  _shell_FontMenuSelFN$=""
��
�"�shell_HeapBlockReturn(h_blk%)
��
�:
�%*|Stop PROCshell_ActionMenuSelect
�
�(*|Start PROCshell_ActionAdjustButton
�� �shell_ActionAdjustButton
�$� flags%,fn$,void%,sel_blk%,ctr%
	Qsel_blk% = �shell_HeapBlockFetch(12 + (�shell_WindowCountIcons(_U%!28) * 32))
	*|ifdef TraceInit
	4�shell_Tracef0("Action:Mouse Button was ADJUST")
	*|endif
	5� PROCshell_HandleAttachedMenu(_Q%,_U%!28,_U%!32)
	
	N� Check if icon is a radio one and window is not the iconbar, if so select
	*� icon to avoid Wimp deselecting it...
	� _U%!28 > 0 �
		=  È™ "Wimp_WhichIcon",_U%!28,sel_blk%,&0000F000,&0000B000
	
  ctr% = 0
	  È• sel_blk%!ctr% <> -1
	B    � sel_blk%!ctr% = _U%!32 � �shell_IconSet(_U%!28,_U%!32,1)
	
    ctr% += 4
	  �
	�
	
	C� _U%!32 = 0 � �shell_HandleAttachedDataSave(_Q%,_U%!28,_U%!32)
	/fn$=�shell_GetEventHandler(_U%!28,_U%!32,3)
	� fn$<>"" �
	&  �shell_IconSlab(1,_U%!28,_U%!32)
	-  void%=�("FN"+fn$+"(_temp28%,_temp32%)")
	�
	$�shell_HeapBlockReturn(sel_blk%)
	�
	:
	'*|Stop PROCshell_ActionAdjustButton
	
	*|Start FNshiftmenuclick
	� �shiftmenuclick(wh%,ih%)
	=�
	:
	 *|Stop FNshiftmenuclick
	!*|Start PROCshell_IconSlab
	"&� �shell_IconSlab(button%,wh%,ih%)
	#
� blk%
	$"blk%=�shell_HeapBlockFetch(50)
	%*blk%!8=button%:blk%!12=wh%:blk%!16=ih%
	&#È™ "Interface_SlabButton",,blk%
	'blk%!8=0
	(#È™ "Interface_SlabButton",,blk%
	) �shell_HeapBlockReturn(blk%)
	*�
	+:
	,*|Stop PROCshell_IconSlab
	-
	.**|Start PROCshell_PointerLeavingWindow
	/&� �shell_PointerLeavingWindow(_Q%)
	0� i_blk%,void%
	1&i_blk% = �shell_HeapBlockFetch(12)
	26È™ "Wimp_WhichIcon",!_Q%,i_blk%,&003F0000,15 << 16
	3� !i_blk% <> -1 �
	4.  � PROCshell_Tracef0("LL:"+STR$(!i_blk%))
	58  void% = �("FN" + �shell_IconGetData(!_Q%,!i_blk%))
	6�
	7"�shell_HeapBlockReturn(i_blk%)
	8�
	9':                                  
	:)*|Stop PROCshell_PointerLeavingWindow
	;
	<+*|Start PROCshell_PointerEnteringWindow
	='� �shell_PointerEnteringWindow(_Q%)
	>� i_blk%,void%,wh%
	?wh% = _Q%!0
	@&i_blk% = �shell_HeapBlockFetch(12)
	A5È™ "Wimp_WhichIcon",wh%,i_blk%,&003F0000,14 << 16
	B� !i_blk% <> -1 �
	C.  � PROCshell_Tracef0("LL:"+STR$(!i_blk%))
	DH  � PROCshell_Tracef0("LL:"+"FN" + FNshell_IconGetData(wh%,!i_blk%))
	E7  void% = �("FN" + �shell_IconGetData(wh%,!i_blk%))
	F�
	G"�shell_HeapBlockReturn(i_blk%)
	H�
	I:
	J**|Stop PROCshell_PointerEnteringWindow
	K
	L"*|Start PROCshell_RedrawWindow
	M"� �shell_RedrawWindow(handle%)
	N#� more%,fn$,x0%,y0%,blk%,i_blk%
	O&i_blk% = �shell_HeapBlockFetch(12)
	P9È™ "Wimp_WhichIcon",handle%,i_blk%,&003F0000,13 << 16
	Q� !i_blk% <> -1 �
	R.  � PROCshell_Tracef0("LL:"+STR$(!i_blk%))
	SL  � PROCshell_Tracef0("LL:"+"FN" + FNshell_IconGetData(handle%,!i_blk%))
	T/  fn$ = �shell_IconGetData(handle%,!i_blk%)
	U�
	V"�shell_HeapBlockReturn(i_blk%)
	W#blk%=�shell_HeapBlockFetch(100)
	X� fn$ = "" �
	YE  � Can't find the clever version of an attached event, check the
	Z  � dumb one...
	[.  fn$=�shell_GetEventHandler(handle%,-1,4)
	\�
	]blk%!0=handle%
	^(ș "Wimp_RedrawWindow",,blk% � more%
	_*x0%=blk%!4-blk%!20:y0%=blk%!16-blk%!24
	`È• more%
	a)  È™ "Interface_Render3dWindow",,blk%
	bC  � fn$<>"" � void%=�("FN"+fn$+"("+�blk%+","+�x0%+","+�y0%+")")
	c*  ș "Wimp_GetRectangle",,blk% � more%
	d�
	e �shell_HeapBlockReturn(blk%)
	f�
	g:
	h!*|Stop PROCshell_RedrawWindow
	i
	j*|Start PROCshell_Receive
	k� �shell_Receive(_Q%)
	l� temp%,void%
	mȎ _Q%!16 �
	n� 0     :�shell_Exit:�
	o!� 1     :�shell_DataSave(_Q%)
	p$� 2     :�shell_DataSaveAck(_Q%)
	q#� 3     :�shell_DataLoad(_Q%,�)
	r$� 4     :�shell_DataLoadAck(_Q%)
	s#� 5     :�shell_DataLoad(_Q%,�)
	t!� 6     :�shell_RAMFetch(_Q%)
	u$� 7     :�shell_RAMTransmit(_Q%)
	v(� 8     :�shell_Message_PreQuit(_Q%)
	w� 9     :� _U%!164>0 �
	x*|ifdef TraceInit
	yJ              �shell_Tracef0("Receive:PaletteChange message received")
	z*|endif
	{              temp%=_U%!164
	|&              void%=�("FN"+$temp%)
	}            �
	~,� 10    :�shell_Message_SaveDesktop(_Q%)
	)� 14    :�shell_Message_Shutdown(_Q%)
	�(� &502  :�shell_InteractiveHelp(_Q%)
	�$� &400C0:�shell_MenuWarning(_Q%)
	�+� &400C1:�shell_Message_ModeChange(_Q%)
	�� &400C2:� TaskInitialise
	�            � _U%!168>0 �
	�*|ifdef TraceInit
	�K              �shell_Tracef0("Receive:TaskInitialise message received")
	�*|endif
	�              temp%=_U%!168
	�\              void%=�("FN"+$temp%+"("+�(_Q%!4)+","+�34+�shell_GetString(_Q%+28)+�34+")")
	�            �
	�F            � _U%!208=-1 � �shell_GetString(_Q%+28)="StrongHelp" �
	�              _U%!208=_Q%!4
	�j              �shell_StrongHlpMsg("Help_Install -DieWithTask "+�shell_GetAppDir+"."+�shell_GetAppName)
	�              temp%=_U%!216
	�               � $temp%<>"" �
	�+                �shell_HelpWord($temp%)
	�3                �shell_HeapBlockReturn(_U%!216)
	�                _U%!216=0
	�              �
	�            �
	�� &400C3
	�  � TaskCloseDown
	�  � _U%!172>0 �
	�*|ifdef TraceInit
	�@    �shell_Tracef0("Receive:TaskCloseDown message received")
	�*|endif
	�    temp% = _U%!172
	�    void% = �("FN"+$temp%)
	�  �
	�&  � _Q%!4 = _U%!208 � _U%!208 = -1
	�� &400C7
	�  � TaskNameIs
	�*|ifdef TraceInit
	�;  �shell_Tracef0("Receive:TaskNameIs message received")
	�*|endif
	�1  � �shell_GetString(_Q%+28) = "StrongHelp" �
	�:    _U%!208=_Q%!20:� store task handle of StrongHlp...
	�  �
	�    �shell_ScanForHelp
	�  �
	�
	�� &80140
	�  � Message_PrintFile
	�!  �shell_HandlePrintFile(_Q%)
	�� &80143
	�  � Message_PrintError
	�"  �shell_HandlePrintError(_Q%)
	�� &80145
	�  � Message_PrintTypeOdd
	�$  �shell_HandlePrintTypeOdd(_Q%)
	�� &80147
	�  � Message_SetPrinter
	�"  �shell_HandleSetPrinter(_Q%)
	�
	�)  :�shell_HandleUnknownMessage2(_Q%)
	��
	��
	�:
	�*|Stop PROCshell_Receive
	�
	�(*|Start PROCshell_Message_ModeChange
	�$� �shell_Message_ModeChange(_Q%)
	�"� offset%,ctr%,sw_list%,w_blk%
	�sw_list%=_U%!184
	�� _U%!160>0 �
	�F  �shell_Tracef0("Message_ModeChange:ModeChange message received")
	�  temp%=_U%!160
	�  void%=�("FN"+$temp%)
	��
	�)� SYS "FontWindow_ModeChange",_U%!148
	�
	�C� Now check if any windows containing panes are open, and if so
	�E� reopen them to avoid problems with panes appearing in the wrong
	�� position...
	�%w_blk%=�shell_HeapBlockFetch(100)
	�� sw_list%<>0 �
	�*|ifdef TraceInit
	�V  �shell_Tracef0("Message_ModeChange:Checking static window list for pane events")
	�*|endif
	�  È• sw_list%!ctr%<>-1
	�%    � now check pane event list..
	�G    offset%=�shell_GetEventListOffset(sw_list%!ctr%,-1,_U%+92,24,�)
	�    � offset%>-1 �
	�*|ifdef TraceInit
	�I      �shell_Tracef0("Message_ModeChange:Static window handle found")
	�*|endif
	�0      � �shell_WindowIsOpen(sw_list%!ctr%) �
	�*|ifdef TraceInit
	�A        �shell_Tracef0("Message_ModeChange:Window is open..")
	�*|endif
	�-        � Reopen window if already open..
	�!        !w_blk%=sw_list%!ctr%
	�)        ș "Wimp_CloseWindow",,w_blk%
	�1        �shell_OpenWindow(sw_list%!ctr%,0,-1)
	�      �
	�	    �
	�    ctr%+=4
	�  �
	��
	�"�shell_HeapBlockReturn(w_blk%)
	�
	��
	�'*|Stop PROCshell_Message_ModeChange
	�
	�&*|Start PROCshell_Message_Shutdown
	�"� �shell_Message_Shutdown(_Q%)
	�� _U%!312>0 �
	�B  �shell_Tracef0("Message_Shutdown:Shutdown message received")
	�  temp%=_U%!312
	�  void%=�("FN"+$temp%)
	��
	��
	�%*|Stop PROCshell_Message_Shutdown
	�
	�+*|Start PROCshell_HandleUnknownMessage2
	�'� �shell_HandleUnknownMessage2(_Q%)
	�� message$
	�:� I want to handle message &43B00 here as I use it for
	�5� communications between EvntShell applications..
	�Ȏ _Q%!16 �
	�.  � &43B00:� incoming EvntShell message...
	�    message$=$(_Q%+20)
	�:    � �message$,30)="EvntShellLib:ShellDBug started" �
	�      � _U%!100 � 1<<4 �
	�*        � trace init message pending..
	�(        _U%!100 = (_U%!100 � 1 << 4)
	�c        �shell_BroadcastMessage(&43B00,"ShellDBug:Init Debug messages from "+�shell_GetAppName)
      �
	    �
5    � �message$,25)="EvntShellLib:TraceInitAck" �
O      � unset trace init message pending flag, ShellDBug has acknowledged..
"      _U%!100=(_U%!100 � 1<<4)
	    �
0    � �message$,20)="EvntShellLib:TraceOn" �
      �shell_TraceOn
	    �
	1    � �message$,21)="EvntShellLib:TraceOff" �

      �shell_TraceOff
	    �
8    � �message$,28)="EvntShellLib:ListClickSelect" �

       �shell_ListClickSelect
	    �
8    � �message$,28)="EvntShellLib:ListClickAdjust" �
       �shell_ListClickAdjust
	    �
5    � �message$,25)="EvntShellLib:ListHelpTags" �
      �shell_ListHelpTags
	    �
�
;� Pass message block on in case the user wants it too..
$�shell_HandleUnknownMessage(_Q%)
�
:
**|Stop PROCshell_HandleUnknownMessage2

**|Start PROCshell_HandleUnknownMessage
&� �shell_HandleUnknownMessage(_Q%)
�
:
 )*|Stop PROCshell_HandleUnknownMessage
!
"**|Start PROCshell_AttachPreQuitHandler
#&� �shell_AttachPreQuitHandler(fn$)
$� temp%,void%
%1� _U%!300>0 � �shell_HeapBlockReturn(_U%!300)
&)_U%!300=�shell_HeapBlockFetch(�fn$+1)
'temp%=_U%!300:$temp%=fn$
(�
):
*)*|Stop PROCshell_AttachPreQuitHandler
+
,+*|Start PROCshell_AttachShutdownHandler
-'� �shell_AttachShutdownHandler(fn$)
.� temp%,void%
/1� _U%!312>0 � �shell_HeapBlockReturn(_U%!312)
0)_U%!312=�shell_HeapBlockFetch(�fn$+1)
1temp%=_U%!312:$temp%=fn$
2�
3:
4**|Stop PROCshell_AttachShutdownHandler
5
6-*|Start PROCshell_AttachModeChangeHandler
7)� �shell_AttachModeChangeHandler(fn$)
8� temp%,void%
91� _U%!160>0 � �shell_HeapBlockReturn(_U%!160)
:)_U%!160=�shell_HeapBlockFetch(�fn$+1)
;temp%=_U%!160:$temp%=fn$
<void%=�("FN"+fn$)
=�
>:
?,*|Stop PROCshell_AttachModeChangeHandler
@
A0*|Start PROCshell_AttachPaletteChangeHandler
B,� �shell_AttachPaletteChangeHandler(fn$)
C� temp%,void%
D1� _U%!164>0 � �shell_HeapBlockReturn(_U%!164)
E)_U%!164=�shell_HeapBlockFetch(�fn$+1)
Ftemp%=_U%!164:$temp%=fn$
Gvoid%=�("FN"+fn$)
H�
I:
J/*|Stop PROCshell_AttachPaletteChangeHandler
K
L1*|Start PROCshell_AttachTaskInitialiseHandler
M-� �shell_AttachTaskInitialiseHandler(fn$)
N� temp%,void%
O1� _U%!168>0 � �shell_HeapBlockReturn(_U%!168)
P)_U%!168=�shell_HeapBlockFetch(�fn$+1)
Qtemp%=_U%!168:$temp%=fn$
R�
S:
T0*|Stop PROCshell_AttachTaskInitialiseHandler
U
V0*|Start PROCshell_AttachTaskCloseDownHandler
W,� �shell_AttachTaskCloseDownHandler(fn$)
X� temp%,void%
Y1� _U%!172>0 � �shell_HeapBlockReturn(_U%!172)
Z)_U%!172=�shell_HeapBlockFetch(�fn$+1)
[temp%=_U%!172:$temp%=fn$
\�
]:
^/*|Stop PROCshell_AttachTaskCloseDownHandler
_
`*|Start PROCshell_RAMFetch
a� �shell_RAMFetch(_Q%)
b&� RAMFetch_buffer%,len_data%,done%
cdone%=�
dF� If the address in the data save event block <&8000 then it is an
eI� estimated size and the file is not already present in a RAM buffer.
fK� In this case ignore RAMFetch message as the data will be written to a
g� file anyway..
h� _U%!144>&8000 �
i   � Send file to application
j#  � send RAMTransmit message...
k*|ifdef TraceInit
l2  �shell_Tracef0("RAMFetch:RAMFetch called..")
m*|endif
n  _Q%!12=_Q%!08
o+  _Q%!16=7:� message action RAMTransmit
p  � get buffer length..
q  len_data%=_U%!136
r  � _U%!140=&FF9 �
sH    � kludge for sprite files because when saving to a physical file
tI    � with "OS_SpriteOp" the first word is dropped. Hence for the RAM
uI    � save we have to incrememt the address the data is held at by 4!
vM    � The estimated size has already been kludged in shell_AttachDataSave
w    _U%!144+=4
x  �
y$  � (len_data%-_U%!128)<_Q%!24 �
z&    �  This will be the last block
{     _Q%!24=len_data%-_U%!128
|    done%=�
}  �
~*|ifdef TraceInit
.  �shell_Tracef0("RAMFetch:Sending block")
�*|endif
�  �
�J  ș "Wimp_TransferBlock",_U%!148,_U%!144+_U%!128,_Q%!04,_Q%!20,_Q%!24
�)  ș "Wimp_SendMessage",17,_Q%,_Q%!04
�   _U%!120=_Q%!8  :� SaveRef%
�  _U%!128+=_Q%!24:� RAMPtr%
�  � done% � _U%!128=0
��
��
�:
�*|Stop PROCshell_RAMFetch
�!*|Start PROCshell_RAMTransmit
�� �shell_RAMTransmit(_Q%)
� � offset%,blk%,f_name$,temp%
�6� Receive file from application via RAM transfer..
�� _Q%!12=_U%!112 �
�  _U%!128+=_Q%!24
�  � _Q%!24<_U%!132 �
�!    � This was the last block
�*|ifdef TraceInit
�7  �shell_Tracef0("RAMTransmit:Last block received")
�*|endif
�D    offset%=�shell_GetEventListOffset(_U%!28,_U%!32,_U%+96,16,�)
�    blk%=_U%!96+offset%
�*|ifdef TraceInit
�3  �shell_Tracef0("RAMTransmit:_U%!28="+�_U%!28)
�3  �shell_Tracef0("RAMTransmit:_U%!32="+�_U%!32)
�5  �shell_Tracef0("RAMTransmit:offset%="+�offset%)
�*|endif
�3    � now call user function after file load...
�L    � use copy of datasave message block to find file type, file name...
�    temp%=_U%!156
�*    f_name$=�shell_GetString(temp%+44)
�K    �shell_UserFNLoadFile(temp%!40,_U%!152,blk%!8,f_name$,_U%!132,blk%)
�  �
�'    � There are more blocks to come
�*|ifdef TraceInit
�2  �shell_Tracef0("RAMTransmit:Block received")
�*|endif
�=    � check size of incoming block and increase buffer if
�    � required...
�    � _U%!128>_U%!132 �
�*|ifdef TraceInit
�<  �shell_Tracef0("RAMTransmit:Increasing buffer size..")
�*|endif
�A      _U%!152=�shell_HeapBlockExtend(_U%!152,_U%!128,_U%!132)
�	    �
�    _Q%!12=_Q%!08
�    _Q%!16=6
�    _Q%!20=_U%!152+_U%!128
�    _Q%!24=_U%!132
�+    ș "Wimp_SendMessage",18,_Q%,_Q%!04
�    _U%!112=_Q%!08
�  �
��
�  � too much data sent...
�%  �shell_HeapBlockReturn(_U%!152)
�  _U%!152=0
�3  �shell_OK(�shell_MessageNoArgs("SHELLMSG15"))
��
��
�:
� *|Stop PROCshell_RAMTransmit
�*|Start FNshell_LoadFile
�� �shell_LoadFile(Scrap%)
�%� Name$,FileSize%,Flags%,loadloc%
�"Name$=�shell_GetString(_Q%+44)
�&FileSize%=�shell_FileLength(Name$)
�A� FileSize%<0 � �shell_OK(�shell_MessageNoArgs("SHELLMSG16"))
�-loadloc%=�shell_HeapBlockFetch(FileSize%)
�/ș "XOS_File",16,Name$,loadloc%,0 � ;Flags%
�� �shell_VFlag(Flags%) �
�&  �shell_HeapBlockReturn(loadloc%)
�3  �shell_OK(�shell_MessageNoArgs("SHELLMSG17"))
��
�*|ifdef TraceInit
�I  �shell_Tracef0("LoadFile:File "+Name$+" loaded ok at &"+�~loadloc%)
�*|endif
��
�'� Stuff for fileinfo box...........
�(� PROCDate(FNFileTimeAndDate(Name$))
�� IF Scrap% THEN
�*�   SYS "XOS_FSControl",27,(_Q%+44),,2
��   PROCModified(TRUE)
�
� ELSE
��   PROCName(Name$)
��   PROCType(_Q%!40)
��   PROCModified(FALSE)
�� ENDIF
�� PROCNewFile
�
=loadloc%
�:
�*|Stop FNshell_LoadFile
�
�*|Start FNshell_VFlag
�� �shell_VFlag(Flags%)
�=((Flags% � %0001)=%0001)
�:
�*|Stop FNshell_VFlag
�
�*|Start FNshell_CheckType
�2� �shell_CheckType(type%,type_list%,DataOpen%)
�9� Exclude directories, applications & unstamped files
�7� type_list% is address of heapblock holding a list
�/� of allowable filetypes terminated by -1..
�(� Ok%,ctr%,found%,temp%,topbit_load%
�#ctr%=0:found%=-1:topbit_load%=�
�-� _U%!100 � 1<<1 � _U%!100=_U%!100 � 1<<1
�ȕ type_list%!ctr%<>-1
�  temp%=type_list%!ctr%
�  � temp% � 1<<31 �
�    temp%=temp% � 1<<31
�    topbit_load%=�
�  �
�    topbit_load%=�
�  �
�  � temp%=type% �
�    found%=ctr%
�    � topbit_load% �
�       _U%!100=_U%!100 � 1<<1
�*|ifdef TraceInit
�=      �shell_Tracef0("CheckType:Top Bit Load detected..")
�*|endif
�	    �
�  �
�
  ctr%+=4
��
�,� DataOpen% � (type%>=&1000) � found%=-1
*|ifdef TraceInit
� found%>-1 �
C  �shell_Tracef0("CheckType:File type OK "+�~type_list%!found%)
�
;  �shell_Tracef0("CheckType:File type NOT ok "+�~type%)
�
*|endif
� found%<>-1 � =� � =�
:
	*|Stop FNshell_CheckType


*|Start PROCshell_Exit
� �shell_Exit

� ms_desc%
ms_desc%=_U%!68
)È™ "XMessageTrans_CloseFile",ms_desc%
È™ "XOS_Module",7,,ms_desc%
*|ifdef TraceInit
3�shell_Tracef0("Exit:Application closing down")
*|endif
�shell_TraceExit
È™ "XHourglass_Smash"
È™ "XWimp_DragBox",,-1
#�shell_WimpCloseDown_I(_U%!148)
�
:
*|Stop PROCshell_Exit

*|Start PROCshell_DataLoad
$� �shell_DataLoad(_Q%,DataOpen%)
<� reference%,offset%,blk%,_temp%,type_list%,type%,fname$
1� �shell_DataOpenOKToLoad(DataOpen%,_Q%!40) �
   type%  = _Q%!40
!)  fname$ = �shell_GetString(_Q% + 44)
"*|ifdef TraceInit
#:  �shell_Tracef0("DataLoad:DataLoad message received")
$*|endif
%9  � check my_file_type set up in shell_AttachDataLoad
&A  � only works when dragging a file as when DataOpen% is TRUE
'-  � the _Q% block is set up differently!!
(  � DataOpen% �
)    � double click load..
*:    � check if there are any dataload events set up...
+    � _U%!96<>0 �
,:      offset%=0:� look at first dataload event only...
-	    �
.#      offset%=-1:� ignore it...
/	    �
0  �
1;    � drag load, check for specific window/icon event..
2D    offset%=�shell_GetEventListOffset(_Q%!20,_Q%!24,_U%+96,16,�)
3    � offset%=-1 �
4.      � now check for window handle only..
5B      offset%=�shell_GetEventListOffset(_Q%!20,-1,_U%+96,16,�)
6	    �
7  �
8  � offset%>-1 �
9    � DataLoadEvent exists
:    blk%=_U%!96+offset%
;5    � �shell_CheckType(_Q%!40,blk%!8,DataOpen%) �
<      � file type is ok...
=*|ifdef TraceInit
>I      �shell_Tracef0("DataLoad:File type recognised (&"+�~_Q%!40+")")
?*|endif
@      Reference%=_Q%!12
A      _Q%!12=_Q%!8
B      _Q%!16=4
C,      È™ "Wimp_SendMessage",18,_Q%,_Q%!4
D      � _U%!100 � 1 << 1 �
E        loadloc% = -1
F'        _U%!100  = _U%!100 � 1 << 1
G      �
H<        loadloc% = �shell_LoadFile(Reference% = _U%!108)
I      �
JI      �shell_UserFNLoadFile(type%,loadloc%,blk%!8,fname$,_Q%!36,blk%)
K4      � return copy of datasave message block...
L      � _U%!156<>0 �
M+        �shell_HeapBlockReturn(_U%!156)
N        _U%!156=0
O      �
P	    �
Q*|ifdef TraceInit
RK    �shell_Tracef0("DataLoad:File type NOT recognised (&"+�~_Q%!40+")")
S*|endif
T	    �
U  �
V�
W�
X:
Y*|Stop PROCshell_DataLoad
Z
[$*|Start FNshell_DataOpenOKToLoad
\.� �shell_DataOpenOKToLoad(DataOpen%,type%)
]$� result%,var_buff%,var$,branch$
^O� Check to see if this application should open the file. If the application
_N� named in the Run$Type variable does not match then return FALSE to abort
`N� the load, otherwise the file would be loaded by the wrong application on
a(� a double click in a Filer window..
b� DataOpen% = � �
c5  � Message reason code was 3, normal drag load..
d  result% = �
eV  �shell_Tracef0("DataOpenOKToLoad:Message reason code was 3, normal drag load..")
f�
g6  � Message reason code was 5, double click load..
hO  � Read value of Alias$@RunType_xxx variable where xxx = filetype in hex..
iW  �shell_Tracef0("DataOpenOKToLoad:Message reason code was 5, double click load..")
j,  var_buff% = �shell_HeapBlockFetch(256)
kQ  var$      = �shell_OSVarGetVal(var_buff%,256,"Alias$@RunType_" + �~type%,1)
l=  �shell_Tracef0("DataOpenOKToLoad:Alias$@RunType="+var$)
m'  �shell_HeapBlockReturn(var_buff%)
nL  � Compare name of app that set up Alias$@RunType with running app - of
o6  � course all apps have unique names don't they..
p#  branch$ = �shell_Branch(var$)
q6  �shell_Tracef0("DataOpenOKToLoad:dbug "+branch$)
rP  � �shell_Leaf(branch$) = "!"+�shell_GetAppName � result% = � � result% = �
s�
t
= result%
u:
v#*|Stop FNshell_DataOpenOKToLoad
w
x$*|Start PROCshell_UserFNLoadFile
yR� �shell_UserFNLoadFile(type%,loadloc%,type_list%,_filename$,_file_size%,blk%)
z� ctr%,found%,temp%,void%
{.� call user function after loading file...
|ctr%=0:found%=-1
}È• type_list%!ctr%<>-1
~  temp%=type_list%!ctr%
+  � temp% � 1<<31 � temp%=temp% � 1<<31
�!  � temp%=type% � found%=ctr%
�
  ctr%+=4
��
�temp%=blk%!12
�Zvoid%=�("FN"+$(temp%!found%)+"("+�loadloc%+","+�type%+",_filename$,"+�_file_size%+")")
��
�:
�#*|Stop PROCshell_UserFNLoadFile
�
�*|Start PROCshell_DataSave
�� �shell_DataSave(_Q%)
�� temp%,offset%,blk%,loop%
�E� Called when another application wants to save data to our one..
�*|ifdef TraceInit
�8�shell_Tracef0("DataSave:DataSave message received")
�*|endif
�I� Receive file from application, but check first it didn't come from 
�� this one!
�� _Q%!04<>_U%!148 �
�=  � check event list for window/icon at this point to see
�$  � which filetypes are valid...
�B  offset%=�shell_GetEventListOffset(_Q%!20,_Q%!24,_U%+96,16,�)
�  � offset%>-1 �
�    blk%=_U%!96+offset%
�-    � �shell_CheckType(_Q%!40,blk%!8,�) �
�*|ifdef TraceInit
�H      �shell_Tracef0("DataSave:Filetype recognized (&"+�~_Q%!40+")")
�*|endif
�)      � �shell_TopBitLoadInProgress �
�N        � 'no load' load taking place, just need the full filename so that
�O        � the user app can do the load - therefore send Message_DataSaveAck
�/        � with Wimp$Scrap as the filename..
�*|ifdef TraceInit
�9        �shell_Tracef0("DataSave:'no load' flag set")
�B        �shell_Tracef0("DataSave:Sending Message_DataSaveAck")
�*|endif
�        _Q%!00=256
�B        _Q%!12=_Q%!08:_Q%!36=-1:_Q%!16=2:� Message_DataSaveAck
�6        $(_Q%+44)=�shell_GetAppDir+".ScrapFile"+�0
�.       ș "Wimp_SendMessage",18,_Q%,_Q%!04
�      �
�M        � Normal load from another application therefore offer to perform
�9        � a RAM file transfer with Message_RAMFetch..
�M        � Make a copy of the message block as I need it when RAM transfer
�<        � is not supported by the sender of this message
�G        �shell_HeapBlockReturn(_U%!156):� return temp message blk..
�4        _U%!156=�shell_HeapBlockFetch((_Q%!0)+8)
�        temp%=_U%!156
�9        � loop%=0 � _Q%!0 � 4:� first word is size...
�#          temp%!loop%=_Q%!loop%
�        � loop%
�@        � store destination window/icon handles for later...
�'        _U%!28=_Q%!20:_U%!32=_Q%!24
�        _U%!128=0
�/        _U%!132=_Q%!36:� RAMSize%=est_size%
�5        � set up heapblock to hold loaded file...
�1        _U%!152=�shell_HeapBlockFetch(_Q%!36)
�        � And here we go !
�        _Q%!00=28
�        _Q%!12=_Q%!08
�)        _Q%!16=6:� Message_RAMFetch..
�"        _Q%!20=_U%!152+_U%!128
�        _Q%!24=_U%!132
�/        ș "Wimp_SendMessage",18,_Q%,_Q%!04
�        _U%!112=_Q%!08
�*|ifdef TraceInit
�?        �shell_Tracef0("DataSave:Sending Message_RAMFetch")
�*|endif
�      �
�	    �
�*|ifdef TraceInit
�<      �shell_Tracef0("DataSave:Filetype NOT recognized")
�*|endif
�	    �
�  �
��
��
�:
�*|Stop PROCshell_DataSave
�
�3� Set all this stuff beforehand as RAM transfer
�0� procedures may be entered more than once !
�0� PROCName(FNLeaf(FNGetString(PollPtr%+44)))
�� PROCType(PollPtr%!40)
�� PROCModified(TRUE)
�$� PROCDate(FNCurrentTimeAndDate)
�(*|Start FNshell_TopBitLoadInProgress
�!� �shell_TopBitLoadInProgress
�� _U%!100 � 1<<1 � =� � =�
�:
�(*|Stop  FNshell_TopBitLoadInProgress
�
�"*|Start PROCshell_SendDataSave
�"� �shell_SendDataSave(wh%,ih%)
�2� blk%,msgblk%,tmpblk%,offset%,FileSize%,void%
�'tmpblk% = �shell_HeapBlockFetch(30)
�F� retrieve current position of pointer (window and icon over which
�1� the drag event ended plus pointer position)
�%ș "Wimp_GetPointerInfo",,tmpblk%
�:offset%=�shell_GetEventListOffset(wh%,ih%,_U%+72,24,�)
�� offset%=-1 � offset%=-2 �
�i  void%=�shell_MessageWindow(�shell_MessageNoArgs("SHELLMSG13"),0,"",�shell_MessageNoArgs("warning"))
��
�  blk%=(_U%!72)+offset%
�  � blk%!8>&8000 �
�0    FileSize%=�shell_HeapBlockInfo(blk%!8)-4
�  �
�    FileSize%=blk%!8
�  �
�  msgblk%=_U%!76
�5  msgblk%!0 =256       :� length of message block
�1  msgblk%!12=0         :� myref 0=originating
�,  msgblk%!16=1         :� message action
�7  msgblk%!20=tmpblk%!12:� destination window handle
�5  msgblk%!24=tmpblk%!16:� destination icon handle
�+  msgblk%!28=tmpblk%!0 :� mouse x coord
�+  msgblk%!32=tmpblk%!4 :� mouse y coord
�4  msgblk%!36=FileSize% :� estimated size of file
�'  msgblk%!40=blk%!12   :� file type
�@  $(msgblk%+44)=�shell_Leaf(�shell_IconGetData(wh%,blk%!16))
�<  ș "Wimp_SendMessage",18,msgblk%,msgblk%!20,msgblk%!24
�  _U%!120=_Q%!8
�$  _U%!136=FileSize% :� FileSize%
�$  _U%!140=blk%!12   :� FileType%
�$  _U%!144=blk%!8    :� FileBuff%
�&  _U%!156=blk%!4    :� TaskHandle%
�(  _U%!200=msgblk%!20:� window handle
�&  _U%!204=msgblk%!24:� icon handle
�
#�shell_HeapBlockReturn(tmpblk%)
�
:
!*|Stop PROCshell_SendDataSave

!*|Start PROCshell_DataSaveAck
� �shell_DataSaveAck(_Q%)
'� _fullname$,a%,b%,blk%,temp%,void%
	*|ifdef TraceInit

>�shell_Tracef0("DataSaveAck:DataSaveAck message received")
*|endif
a%=0:b%=_Q%?(44+a%)

È• b%<>0
  _fullname$+=�(b%)
  a%+=1
  b%=_Q%?(44+a%)
�
*|ifdef TraceInit
@�shell_Tracef0("DataSaveAck:Full save name is: "+_fullname$)
3�shell_Tracef0("DataSaveAck:task   = &"+�_Q%!4)
5�shell_Tracef0("DataSaveAck:mytask = &"+�_U%!148)
*|endif
Boffset% = �shell_GetEventListOffset(_U%!28,_U%!32,_U%+72,24,�)
W� IF offset% = -1 OR offset% = -2 THEN ERROR 99,FNshell_MessageNoArgs("SHELLMSG05")
5�shell_Tracef0("DataSaveAck:offset% = "+�offset%)
� offset% >= 0 �
  blk%=(_U%!72)+offset%
  temp%=blk%!20
.  � now call the file saving routine......
  � $temp%<>"" �
+    void%=�("FN"+$temp%+"(_fullname$)")
   �
!S    � no file saving routine specified for this event, so check if data is in a
"    � heapblock..
#*    � �shell_HeapBlockExists(blk%!8) �
$I      � default save routine, just save the whole heapblock to disk..
%Z      ș "OS_File",10,_fullname$,blk%!12,,blk%!8,blk%!8+�shell_HeapBlockInfo(blk%!8)+1
&	    �
'<      � Whoops! not a heapblock - someone's screwed up..
(1      � 99,�shell_MessageNoArgs("SHELLMSG21")
)	    �
*  �
+  � _Q%!36>-1 �
,    � file is secure
-4    � _U%!80<>0 � �shell_HeapBlockReturn(_U%!80)
.3    _U%!80=�shell_HeapBlockFetch(�_fullname$+1)
/    temp%=_U%!80
0    $temp%=_fullname$
1  �
2D  _Q%!16=3:!_Q%=256:_Q%!20=_U%!200:_Q%!24=_U%!204:_Q%!40=_U%!140
37  _Q%!36=�shell_FileLength(_fullname$):_Q%!12=_Q%!8
4*|ifdef TraceInit
5D  �shell_Tracef0("DataSaveAck:File length is "+�_Q%!36+" bytes")
6*|endif
7  $(_Q%+44)=_fullname$+�(0)
8  � send dataload message
9  � store my_ref
:  _U%!84=_Q%!8
;*|ifdef TraceInit
<<  �shell_Tracef0("DataSaveAck:Sending DataLoad Message")
=*|endif
>0  È™ "Wimp_SendMessage",18,_Q%,_Q%!20,_Q%!24
?A  � now close window that save originated from if it is not a
@  � 'dynamic' dbox
A  � _U%!28<>_U%!20 �
B"    �shell_CloseWindow(_U%!28)
C  �
D5  ș "Wimp_CreateMenu",,-1:� close any open menus
E�
F=  �shell_PrintSave(_fullname$,_Q%!20,_Q%!24,_Q%!8,_Q%!40)
G4  �shell_Tracef0("DEBUG:: copies = "+�(_U%!336))
H  � _U%!336 > 0 �
I    _U%!336 -= 1
J$    �shell_DoSendPrintSave(&FFF)
K  �
L�
M�
N:
O *|Stop PROCshell_DataSaveAck
P
Q'*|Start PROCshell_DataSaveCheckName
R'� �shell_DataSaveCheckName(wh%,ih%)
S� offset%,blk%,list_size%
TF� Routine to check if a 'datasave' event exists in the window wh%.
UE� If it does then the filename is checked for a '.' character. An
VF� error is generated if no '.' is found. This routine is called by
W;� the library when a mouse click on icon 0 is detected.
Xblk%=_U%!72:offset%=0
Y� blk%<>0 �
Z-  list_size%=�shell_HeapBlockInfo(blk%)-8
[8  � blk%<>0 therefore a datasave event list exists..
\  �
]2    � check window handles of events in list..
^    � !(blk%+offset%)=wh% �
_)      � check for a valid path name..
`1      name$=�shell_IconGetData(!blk%,blk%!16)
aI      � �name$,".")=0 � �shell_OK(�shell_MessageNoArgs("SHELLMSG01"))
bC      offset%=list_size%:� window handle found so abort check..
c	    �
d(    offset%+=24:� check next event..
e  � offset%>=list_size%
f�
g�
h:
i&*|Stop PROCshell_DataSaveCheckName
j
k!*|Start PROCshell_DataLoadAck
l� �shell_DataLoadAck(_Q%)
m*|ifdef TraceInit
nQ�shell_Tracef0("DataLoadAck:DataLoadAck message received (file received ok)")
o*|endif
p�
q:
r *|Stop PROCshell_DataLoadAck
s
t,*|Start PROCshell_UserMessageAcknowledge
u(� �shell_UserMessageAcknowledge(_Q%)
vȎ _Q%!16 �
w!  � 3:�shell_AckDataLoad(_Q%)
x!  � 6:�shell_AckRAMFetch(_Q%)
y�
z�
{:
|+*|Stop PROCshell_UserMessageAcknowledge
}
~!*|Start PROCshell_AckDataLoad
� �shell_AckDataLoad(_Q%)
�� _Q%!12<>_U%!84 �
�&  � Reference hasn't been updated,
�+  � therefore the Wimp returned my call
�5  � The receiver didn't understand scrap transfer
�$  ș "XOS_File",6,"<Wimp$Scrap>"
�1  � 255,"Data Transfer failed: Receiver died"
��
��
�:
� *|Stop PROCshell_AckDataLoad
�
�!*|Start PROCshell_AckRAMFetch
�� �shell_AckRAMFetch(_Q%)
�� Exist%,temp%
�temp%=_U%!156
�*|ifdef TraceInit
�8�shell_Tracef0("AckRAMFetch:AckRAMFetch called....")
�*|endif
�� _Q%!12<>_U%!112 �
�&  � Reference hasn't been updated,
�+  � therefore the Wimp returned my call
�  � _U%!128=0 �
�2    � The receiver didn't support RAM transfer
�*|ifdef TraceInit
�J  �shell_Tracef0("AckRAMFetch:Receiver does not support RAM transfer")
�*|endif
�;    ș "XOS_ReadVarVal","Wimp$Scrap",,-1,0,3 � ,,Exist%
�    � Exist%<>0 �
�)      $(temp%+44)="<Wimp$Scrap>"+�(0)
�8      temp%!00=(49+�(�shell_GetString(temp%+44)))��3
�      temp%!12=temp%!08
�      temp%!16=2
�      temp%!36=-1
�0      ș "Wimp_SendMessage",18,temp%,temp%!4
�      _U%!108=temp%!08
�	    �
�8       �shell_OK(�shell_MessageNoArgs("SHELLMSG14"))
�	    �
�  �
�;    � The receiver has initiated RAM transfer, and this
�?    � was successful once, but I expected more data to come
�*|ifdef TraceInit
�`  �shell_Tracef0("AckRAMFetch:RAM transfer started, but not enough data sent. Sender died?")
�*|endif
�'    �shell_HeapBlockReturn(_U%!152)
�    _U%!152=0
�    �shell_OK("SHELLMSG06")
�  �
��
��
�:
� *|Stop PROCshell_AckRAMFetch
�
�!*|Start PROCshell_MenuWarning
�� �shell_MenuWarning(_Q%)
�E� fn$,menu_buffer%,x%,y%,void%,_temp%,a%,warn_fn$,item_addr%,blk%
�!x%=_Q%!24:y%=_Q%!28:_U%!264=0
�� _U%!20<>0 �
�*|ifdef PROCshell_TraceInit
�U  �shell_Tracef0("MenuWarning:Removing last dynamic dbox (handle=&"+�~_U%!20+")")
�*|endif
�'  void%=�shell_DeleteWindow(_U%!20)
�*|ifdef PROCshell_TraceInit
�=  �shell_Tracef0("MenuWarning:Last dynamic dbox removed")
�*|endif
��
�9� Check submenu pointer and create window found there
�%� Then call pre and post open FNs
�J� If submenu pointer is the warning window, open it to remind the user
�9� that no dbox has been attached to this menu entry..
�Ȏ _Q%!20 �
�(� _U%!228:� handle of warning dbox..
�D  � won't need to do this if title/icon messages are substituted
�"  � when loading the templates
�C  �shell_WindowRetitle(_U%!228,�shell_MessageNoArgs("warning"))
�2  � still need to set up the message though...
�H  �shell_IconPutData(_U%!228,1,�shell_MessageNoArgs("SHELLMSG07"),0)
�,  ș "Wimp_CreateSubMenu",,_U%!228,x%,y%
�
�4  � Sub menu is either a dialog box, or a menu!!
�9  item_addr%=�shell_MenuGetItemAddress(_U%!24,_Q%+32)
�.  � �shell_HeapBlockExists(item_addr%!4) �
�    � DBox is attached..
�-    �shell_MenuWarnDBox(item_addr%,x%,y%)
�  �
�    � Submenu attached..
�&    blk%=�shell_HeapBlockFetch(32)
�3    ș "MenuUtil_Decode",_U%!24,_Q%+32 � ,,blk%
�9    �shell_FindMenuWarnEvent(blk%!8,warn_fn$,sel_fn$)
�$    �shell_HeapBlockReturn(blk%)
�=    �shell_MenuWarnSubMenu(_Q%!20,x%,y%,warn_fn$,sel_fn$)
�  �
��
��
�:
� *|Stop PROCshell_MenuWarning
�
�"*|Start PROCshell_MenuWarnDBox
�&� �shell_MenuWarnDBox(addr%,x%,y%)
�� temp%,h%,void%
�� �
�� � �:� �:�
�temp%=addr%!4
�$�shell_CreateWindow($temp%!0,h%)
�� �
�*|ifdef TraceInit
�O�shell_Tracef0("MenuWarnDBox:Creating new dynamic dbox (handle=&"+�~h%+")")
�*|endif
�� $temp%!4<>"" �
�*|ifdef TraceInit
�F  �shell_Tracef0("MenuWarnDBox:Calling preopen FN '"+$temp%!4+"'")
�*|endif
�(  void%=�("FN"+$temp%!4+"("+�h%+")")
��
�� $temp%!8<>"" �
�*|ifdef TraceInit
�G  �shell_Tracef0("MenuWarnDBox:Calling postopen FN '"+$temp%!8+"'")
�*|endif
�(  void%=�("FN"+$temp%!8+"("+�h%+")")
��
�!� h% is new window handle....
�%ș "Wimp_CreateSubMenu",,h%,x%,y%
�
_U%!20=h%
��
�:
�!*|Stop PROCshell_MenuWarnDBox
�
�'*|Start PROCshell_FindMenuWarnEvent

A� �shell_FindMenuWarnEvent(item_handle%,� warn_fn$,� sel_fn$)

A� result%,e_list%,temp%,offset%,found%,list_size%,temp2%,ctr%

� submenu%

;submenu%=0:� If still 0 on return then no event found..

=e_list%=_U%!220:offset%=0:found%=�:warn_fn$="":submenu%=0

'� �shell_HeapBlockExists(e_list%) �

  �

    ctr%+=4

  � e_list%!ctr%=-1

	  list_size%=ctr%:ctr%=0

*|ifdef PROCshell_TraceInit

A  �shell_Tracef0("FindMenuWarnEvent:list_size%="+�list_size%)

*|endif


  �

"    temp%=!(e_list%+offset%+0)

    � temp%<>-1 �

       � temp%=item_handle% �

        found%=�

7        temp2%=e_list%!(offset%+4):warn_fn$=$temp2%

(        submenu%=e_list%!(offset%+8)

7        temp2%=e_list%!(offset%+12):sel_fn$=$temp2%

*|ifdef PROCshell_TraceInit

7  �shell_Tracef0("FindMenuWarnEvent:submenu found")

*|endif

      �

      offset%+=16

	    �

      offset%=list_size%

	    �

$  � found% � offset%>=list_size%

�

  warn_fn$="":sel_fn$=""

 �

!*|ifdef PROCshell_TraceInit

"J� submenu%=0 � �shell_Tracef0("FindMenuWarnEvent:warn fn not found..")

#*|endif

$�

%:

&&*|Stop PROCshell_FindMenuWarnEvent

'

(%*|Start PROCshell_MenuWarnSubMenu

)<� �shell_MenuWarnSubMenu(s_menu%,x%,y%,warn_fn$,sel_fn$)

*� void%,temp%,f_menu%,ctr%

+!_shell_FontMenuSelFN$=sel_fn$

,G� �shell_HeapBlockExists(_U%!224) � �shell_HeapBlockReturn(_U%!224)

-._U%!224=�shell_HeapBlockFetch(�warn_fn$+1)

.!temp%=_U%!224:$temp%=warn_fn$

/� warn_fn$<>"" �

0.  void%=�("FN"+warn_fn$+"(_U%!52,_U%!56)")

1*|ifdef PROCshell_TraceInit

2;  �shell_Tracef0("MenuWarnSubMenu:Calling FN"+warn_fn$)

3*|endif

4�

5*|ifdef Using_FontMenu

6� s_menu%=_U%!252 �

7"  � Submenu is FontMenu menu..

8*|ifdef PROCshell_TraceInit

9:  �shell_Tracef0("MenuWarnSubMenu:FontMenu opening..")

:*|endif

;I  � �shell_HeapBlockExists(_U%!256) � �shell_HeapBlockReturn(_U%!256)

<8  � Store current menu selection for testing later..

==  � First work out how many levels are in the selection..

>2  ctr%=0:�:ctr%+=4:� !(_Q%+32+ctr%)=-1:ctr%+=4

?7  _U%!256=�shell_HeapBlockFetch(ctr%):temp%=_U%!256

@  ctr%=0

A  �

B!    temp%!ctr%=!(_Q%+32+ctr%)

C    ctr%+=4

D  � !(_Q%+32+ctr%)=-1

E  temp%!ctr%=!(_Q%+32+ctr%)

F  temp%=_U%!256

G*|ifdef PROCshell_TraceInit

Hh  �shell_Tracef0("MenuWarnSubMenu:Selecting '"+�shell_FontMenuGetLastSelectedFont+"' in FontMenu..")

I*|endif

JP  ș "FontMenu_Select",�shell_FontMenuGetLastSelectedFont,_U%!260 � ,f_menu%

K+  _U%!264=1:� Set 'FontMenuOpen' flag..

L  � f_menu%<>_U%!252 �

M$    � FontMenu ptr has changed..

N)    �shell_FontMenuUpdatePtr(f_menu%)

O'    _U%!252=f_menu%:s_menu%=f_menu%

P  �

Q�

R-  _U%!264=0:� Clear 'FontMenuOpen' flag..

S�

T*|endif

U*È™ "Wimp_CreateSubMenu",,s_menu%,x%,y%

V�

W:

X$*|Stop PROCshell_MenuWarnSubMenu

Y

Z#*|Start PROCshell_AttachSubMenu

[3� �shell_AttachSubMenu(item%,submenu%,warn_fn$)

\(È™ "MenuUtil_SubMenu",item%,submenu%

]� warn_fn$<>"" �

^  ș "MenuUtil_Warning",,�

_:  �shell_EventListMenuWarn(item%,submenu%,warn_fn$,"")

`�

a�

b:

c"*|Stop PROCshell_AttachSubMenu

d

e'*|Start PROCshell_EventListMenuWarn

fC� �shell_EventListMenuWarn(item%,submenu_ptr%,warn_fn$,sel_fn$)

g� temp%,temp2%,ctr%,e_list%

h� _U%!220=0 �

i  � Create event list..

j'  _U%!220=�shell_HeapBlockFetch(32)

k  temp%=_U%!220

l  temp%!0=item%

m0  temp%!4=�shell_HeapBlockFetch(�warn_fn$+1)

n  $(temp%!4)=warn_fn$

o  temp%!8=submenu_ptr%

p0  temp%!12=�shell_HeapBlockFetch(�sel_fn$+1)

q  $(temp%!12)=sel_fn$

r5  temp%!16=-1:temp%!20=-1:temp%!24=-1:temp%!28=-1

s�

t$  � Extend existing event list..

u0  e_list%=�shell_HeapBlockExtend(_U%!220,32)

v  _U%!220=e_list%:ctr%=0

w  �

x    ctr%+=16

y  � e_list%!ctr%=-1

z  temp%=_U%!220

{  temp%!ctr%=item%

|7  temp%!(ctr%+4)=�shell_HeapBlockFetch(�warn_fn$+1)

}.  temp2%=temp%!(ctr%+4):$(temp2%)=warn_fn$

~!  temp%!(ctr%+8)=submenu_ptr%

7  temp%!(ctr%+12)=�shell_HeapBlockFetch(�sel_fn$+1)

�.  temp2%=temp%!(ctr%+12):$(temp2%)=sel_fn$

�>  temp%!(ctr%+16)=-1:temp%!(ctr%+20)=-1:temp%!(ctr%+24)=-1

�  temp%!(ctr%+28)=-1

��

��

�:

�&*|Stop PROCshell_EventListMenuWarn

�

�%*|Start PROCshell_InteractiveHelp

�!� �shell_InteractiveHelp(_Q%)

�5� tag$,mess$,validation$,pos1%,pos2%,help$,i_blk%

�&i_blk% = �shell_HeapBlockFetch(12)

�8ș "Wimp_WhichIcon",_Q%!32,i_blk%,&003F0000,12 << 16

�� !i_blk% <> -1 �

�.  � PROCshell_Tracef0("LL:"+STR$(!i_blk%))

�K  � PROCshell_Tracef0("LL:"+"FN" + FNshell_IconGetData(_Q%!32,!i_blk%))

�/  tag$ = �shell_IconGetData(_Q%!32,!i_blk%)

��

�"�shell_HeapBlockReturn(i_blk%)

�>� tag$ = "" � tag$=�shell_GetEventHandler(_Q%!32,_Q%!36,8)

�B� check validation string - this overrides attached help tags!

�7validation$=�shell_IconGetValidation(_Q%!32,_Q%!36)

�� validation$<>"" �

�5  � �shell_StringUpperCase(�validation$,1))="I" �

�    pos1%=�validation$,";")

�    � i is first modifier

�    � pos1%=0 �

�      tag$=�validation$,2)

�	    �

�&      tag$=�validation$,2,pos1%-2)

�	    �

�  �

�P    pos1%=��shell_StringUpperCase(validation$),�shell_StringUpperCase(";i"))

�W    pos2%=��shell_StringUpperCase(validation$),�shell_StringUpperCase(";"),pos1%+1)

�    � pos1%>0 �

�      � pos2%>0 �

�4        tag$=�validation$,pos1%+2,pos2%-pos1%-2)

�      �

�&        tag$=�validation$,pos1%+2)

�      �

�	    �

�  �

��

�� tag$<>"" �

�  _Q%!16=&503:_Q%!12=_Q%!8

�,  mess$=�shell_MessageLookup(tag$,"","")

�'  mess$=�shell_MessageExpand(mess$)

�  $(_Q%+20)=mess$

�  !_Q%=(�mess$+25) � � 3

�(  ș "Wimp_SendMessage",17,_Q%,_Q%!4

��

��

�:

�$*|Stop PROCshell_InteractiveHelp

�*|Start PROCack

�
� �ack

��

�:

�*|Stop PROCack

�

�%*|Start PROCshell_Message_PreQuit

�!� �shell_Message_PreQuit(_Q%)

�,� temp%,quitsender%,blk%,loop%,flagword%

�� _U%!300>0 �

�%  blk%=�shell_HeapBlockFetch(256)

�,  � copy message block to private area..

�3  � loop%=0 � _Q%!0 � 4:� first word is size...

�    blk%!loop%=_Q%!loop%

�
  � loop%

�*|ifdef TraceInit

�@  �shell_Tracef0("Message_PreQuit:PreQuit message received")

�*|endif

�  temp%=_U%!300

�  quitsender%=blk%!4

�2  � !blk%<24 � flagword%=0 � flagword%=blk%!20

�4  � acknowledge message - this aborts shutdown..

�>  blk%!12=blk%!8:ș "Wimp_SendMessage",19,blk%,quitsender%

�  � �("FN"+$temp%)<>0 �

�    � ok to quit..

�    � flagword% � 1 �

�!      � quit just this task..

�      _closedown%=�

�	    �

�      � shutdown desktop..

�      !blk%=24:blk%!24=&1FC

�2      ș "Wimp_SendMessage",8,blk%,quitsender%

�      _closedown%=�

�	    �

�  �

�"  �shell_HeapBlockReturn(blk%)

��

��

�:

�$*|Stop PROCshell_Message_PreQuit

�

�*|Start PROClwaorigin

�� �lwaorigin(b,� x%,� y%)

�x%=b!0-b!16:y%=b!12-b!20

��

�:

�*|Stop PROClwaorigin

�

�*|Start FNshell_Iconbar

�B� �shell_Iconbar(pos%,sname$,text$,w%,menu%,shift%,ctrl%,alt%)

�
� handle%

�� text$="" �

�Q  !_Q%=pos%:_Q%!4=0:_Q%!8=0:_Q%!12=70:_Q%!16=70:_Q%!20=&301A:$(_Q%+24)=sname$

��

�F  !_Q%=pos%:_Q%!4=0:_Q%!8=-16:_Q%!12=w%:_Q%!16=90:_Q%!20=&1700210B

�  � _Q%!24 12

�  � _Q%!28 �(sname$)+2

�  $(_Q%!24)=text$

�  $(_Q%!28)="S"+sname$

�  _Q%!32=12

��

�'ș "Wimp_CreateIcon",,_Q% � handle%

�9�shell_AttachMenu(-2,handle%,menu%,shift%,ctrl%,alt%)

�=handle%

�:

�*|Stop FNshell_Iconbar

�

�$*|Start PROCshell_IconbarSetText

�&� �shell_IconbarSetText(h%,in%,s$)

�� icon_blk%,w_blk%

�'icon_blk%=�shell_HeapBlockFetch(40)

�)w_blk%    = �shell_HeapBlockFetch(36)

�w_blk%!20 = 0

� � �shell_OSCheckVersion(3) �
-  � h% = -1 � !w_blk% = -2 � !w_blk% = h%
&  È™ "Wimp_GetWindowState",,w_blk%
�
%!icon_blk% = h%:icon_blk%!4 = in%
%È™ "Wimp_GetIconState",,icon_blk%
$(icon_blk%!28)=s$
kÈ™ "Wimp_ForceRedraw",-1,icon_blk%!8-100-w_blk%!20,icon_blk%!12,icon_blk%!16+100-w_blk%!20,icon_blk%!20
%�shell_HeapBlockReturn(icon_blk%)
"�shell_HeapBlockReturn(w_blk%)
	�

:
#*|Stop PROCshell_IconbarSetText


'*|Start FNshell_WritableIconHandler
.� �shell_WritableIconHandler(wh%,ih%,key%)
-� nr_icons%,first_write%,last_write%,ctr%
?� prev_icon%,next_icon%,index%,mx%,my%,temp_blk%,caret_blk%

D� caret_blk% should be just large enough for the number of icons
4� actually in the window (limit is 254 icons)...
,caret_blk% = �shell_HeapBlockFetch(1024)
*È™ "Wimp_GetCaretPosition",,caret_blk%
� !caret_blk% = -1 �
(  �shell_HeapBlockReturn(caret_blk%)
  = � :� no caret so abort
�

9� must be icons in the window as the caret is present
:È™ "Wimp_WhichIcon",wh%,caret_blk%,&0040E000,&0000E000

'first_write% = !caret_blk%:ctr%  =0
�
   � caret_blk%!ctr% = ih% �
!*    prev_icon% = caret_blk%!(ctr% - 4)
"+    next_icon%  = caret_blk%!(ctr% + 4)
#  �
$  ctr% += 4
%� caret_blk%!ctr% = -1
&%last_write% = caret_blk%!(ctr%-4)
'
(
Ȏ key% �
)  � &0D  :� return
*(      �shell_FakeMouseClick(wh%,0,4)
+#  � &18E,394 :� cursor down,TAB
,    � ih% = last_write% �
-f      ș "Wimp_SetCaretPosition",wh%,first_write%,-1,-1,-1,�(�shell_IconGetData(wh%,first_write%))
.	    �
/b      ș "Wimp_SetCaretPosition",wh%,next_icon%,-1,-1,-1,�(�shell_IconGetData(wh%,next_icon%))
0	    �
1'  � &18F,410 :� cursor up,SHIFT TAB
2    � ih% = first_write% �
3d      ș "Wimp_SetCaretPosition",wh%,last_write%,-1,-1,-1,�(�shell_IconGetData(wh%,last_write%))
4	    �
5b      ș "Wimp_SetCaretPosition",wh%,prev_icon%,-1,-1,-1,�(�shell_IconGetData(wh%,prev_icon%))
6	    �
7;  � 431 :� CTRL Cursor Up (move to first writable icon)
8d    ș "Wimp_SetCaretPosition",wh%,first_write%,-1,-1,-1,�(�shell_IconGetData(wh%,first_write%))
9<  � 430 :� CTRL Cursor Down (move to last writable icon)
:b    ș "Wimp_SetCaretPosition",wh%,last_write%,-1,-1,-1,�(�shell_IconGetData(wh%,last_write%))
;�
<&�shell_HeapBlockReturn(caret_blk%)
== �
>:
?&*|Stop FNshell_WritableIconHandler
@
A$*|Start PROCshell_FakeMouseClick
B,� �shell_FakeMouseClick(wh%,ih%,button%)
C*ș "OS_Byte",15,1:� flush input buffer
D'_Q%!8=button%:_Q%!12=wh%:_Q%!16=ih%
E�shell_Action(6)
F�
G:
H#*|Stop PROCshell_FakeMouseClick
I*|Start FNshell_IconCreate
JX� �shell_IconCreate(wh%,minx%,miny%,w%,h%,fg%,bg%,flg%,data$,addr%,len%,validation$)
K!� i%,handle%,valid%,icon_blk%
L'icon_blk%=�shell_HeapBlockFetch(40)
Micon_blk%!0=wh%
N'icon_blk%!4=minx%:icon_blk%!8=miny%
O/icon_blk%!12=minx%+w%:icon_blk%!16=miny%+h%
P)icon_blk%!20=flg% � bg%<<28 � fg%<<24
Q� icon_blk%!20 � &100 �
R  i%=�data$,",")
S  icon_blk%!24=addr%
T  � validation$<>"" �
U4    valid%=�shell_HeapBlockFetch(�validation$+1)
V    $valid%=validation$
W    icon_blk%!28=valid%
X  �
Y    icon_blk%!28=-1
Z  �
[  icon_blk%!32=len%
\�
]   $(icon_blk%+24)=�data$,11)
^�
_-ș "Wimp_CreateIcon",,icon_blk% � handle%
`%�shell_HeapBlockReturn(icon_blk%)
a=handle%
b:
c*|Stop FNshell_IconCreate
d *|Start PROCshell_IconDelete
e � �shell_IconDelete(wh%,ih%)
f"�shell_DoIconDelete(wh%,ih%,�)
g�
h:
i*|Stop PROCshell_IconDelete
j!*|Start PROCshell_IconDelete2
k!� �shell_IconDelete2(wh%,ih%)
l"�shell_DoIconDelete(wh%,ih%,�)
m�
n:
o *|Stop PROCshell_IconDelete2
p"*|Start PROCshell_DoIconDelete
q*� �shell_DoIconDelete(wh%,ih%,redraw%)
r� blk%,x0%,y0%,x1%,y1%
s"blk%=�shell_HeapBlockFetch(40)
tblk%!0=wh%:blk%!4=ih%
u È™ "Wimp_GetIconState",,blk%
v&È™ "Interface_BoundingBox",,blk%+8
w2x0%=blk%!8:y0%=blk%!12:x1%=blk%!16:y1%=blk%!20
x È™ "Wimp_GetIconState",,blk%
yG� �shell_HeapBlockExists(blk%!28) � �shell_HeapBlockReturn(blk%!28)
zG� �shell_HeapBlockExists(blk%!32) � �shell_HeapBlockReturn(blk%!32)
{È™ "Wimp_DeleteIcon",,blk%
|� redraw% �
}/  È™ "Wimp_ForceRedraw",wh%,x0%,y0%,x1%,y1%
~�
 �shell_HeapBlockReturn(blk%)
��
�:
�!*|Stop PROCshell_DoIconDelete
�
�!*|Start PROCshell_IconPutData
�8� �shell_IconPutData(whandle%,ihandle%,data$,redraw)
�� blk%,old_str$
�4old_str$ = �shell_IconGetData(whandle%,ihandle%)
�� data$ <> old_str$ �
�$  blk%=�shell_HeapBlockFetch(40)
�  blk%!0 = whandle%
�  blk%!4 = ihandle%
�"  ș "Wimp_GetIconState",,blk%
�!  � (blk%!24 � (1<<8)) <> 0 �
�D    � �data$ > blk%!36 � � 99,�shell_MessageNoArgs("SHELLMSG12")
�    $(blk%!28) = data$
�  �
�!    $(blk% + 28) = �data$,11)
�  �
�  � redraw <> 0 �
�    blk%!8 = 0:blk%!12 = 0
�$    ș "Wimp_SetIconState",,blk%
�  �
�"  �shell_HeapBlockReturn(blk%)
��
��
�:
� *|Stop PROCshell_IconPutData
�
�$*|Start PROCshell_IconPutDataNow
�4� �shell_IconPutDataNow(whandle%,ihandle%,data$)
�
� blk%
�#blk%=�shell_HeapBlockFetch(50) 
�blk%!0=whandle%
�blk%!4=ihandle%
� ș "Wimp_GetIconState",,blk%
�� (blk%!24 � (1<<8))<>0 �
�@  � �data$>blk%!36 � � 99,�shell_MessageNoArgs("SHELLMSG12")
�  $(blk%!28)=data$
��
�  $(blk%+28)=�data$,11)
��
�blk%!8=0:blk%!12=0
� ș "Wimp_SetIconState",,blk%
�C� Call wimp poll immediately in case the user program doesn't..
��shell_EnsurePoll
� �shell_HeapBlockReturn(blk%)
�� 
�#*|Stop PROCshell_IconPutDataNow
�
�!*|Start FNshell_IconNewSprite
�=� �shell_IconNewSprite(whandle%,ihandle%,newname$,redraw)
�� icon_blk%
�'icon_blk%=�shell_HeapBlockFetch(40)
�-icon_blk%!0=whandle%:icon_blk%!4=ihandle%
�%ș "Wimp_GetIconState",,icon_blk%
�#ș "Wimp_DeleteIcon",,icon_blk%
�Nicon_blk%!4=icon_blk%!8:icon_blk%!8=icon_blk%!12:icon_blk%!12=icon_blk%!16
�Picon_blk%!16=icon_blk%!20:icon_blk%!20=icon_blk%!24:$(icon_blk%+24)=newname$
�.ș "Wimp_CreateIcon",,icon_blk% � ihandle%
�b� redraw � ș "Wimp_ForceRedraw",icon_blk%!0,icon_blk%!4,icon_blk%!8,icon_blk%!12,icon_blk%!16
�%�shell_HeapBlockReturn(icon_blk%)
�
=ihandle%
�:
� *|Stop FNshell_IconNewSprite
�
�*|Start FNshell_IconGetData
�+� �shell_IconGetData(whandle%,ihandle%)
�� result$,icon_blk%
�'icon_blk%=�shell_HeapBlockFetch(40)
�icon_blk%!0=whandle%
�icon_blk%!4=ihandle%
�%ș "Wimp_GetIconState",,icon_blk%
�T� (icon_blk%!24 � (1<<8))<>0 � result$=$(icon_blk%!28) � result$=$(icon_blk%+28)
�%�shell_HeapBlockReturn(icon_blk%)
�=result$
�:
�*|Stop FNshell_IconGetData
�
�*|Start FNshell_IconMove2
�)� �shell_IconMove2(wh%,ih%,d_x%,d_y%)
�� m_blk%
�$m_blk%=�shell_HeapBlockFetch(40)
�!m_blk%=wh%:m_blk%!4=ih%
�"ș "Wimp_GetIconState",,m_blk%
�"m_blk%!8+=d_x%:m_blk%!16+=d_x%
�#m_blk%!12+=d_y%:m_blk%!20+=d_y%
�Gih%=�shell_IconMove(wh%,ih%,m_blk%!8,m_blk%!12,m_blk%!16,m_blk%!20)
�"�shell_HeapBlockReturn(m_blk%)
�=ih%
�:
�*|Stop FNshell_IconMove2
�*|Start FNshell_IconResize
�0� �shell_IconResize(wh%,ih%,x0%,y0%,x1%,y1%)
�-=�shell_IconMove(wh%,ih%,x0%,y0%,x1%,y1%)
�:
�*|Stop FNshell_IconResize
�*|Start FNshell_IconMove
�.� �shell_IconMove(wh%,ih%,x0%,y0%,x1%,y1%)
�'� i_blk%,i_flags%,i_data%,bdr%,blk%
�!� oldflags%,odt0%,odt1%,odt2%
�$i_blk%=�shell_HeapBlockFetch(40)
�"blk%=�shell_HeapBlockFetch(40)
�;!i_blk%=wh%:i_blk%!4=ih%:ș "Wimp_GetIconState",,i_blk%
�!blk%=wh%:blk%!4=ih%
� ș "Wimp_GetIconState",,blk%
�&ș "Interface_BoundingBox",,blk%+8
�&iflags%=i_blk%!24:idata%=i_blk%+28
�Boldflags%=iflags%:odt0%=idata%!0:odt1%=idata%!4:odt2%=idata%!8
�bdr%=i_blk%!8-blk%!8
� ș "Wimp_DeleteIcon",,i_blk%
�\ș "Wimp_ForceRedraw",!i_blk%,i_blk%!8-bdr%,i_blk%!12-bdr%,i_blk%!16+bdr%,i_blk%!20+bdr%
�Pih%=�shell_CreateIcon2(wh%,x0%,y0%,x1%,y1%,oldflags%,odt0%,odt1%,odt2%,bdr%)
�"�shell_HeapBlockReturn(i_blk%)
� �shell_HeapBlockReturn(blk%)
�=ih%
�:
�*|Stop FNshell_IconMove
�*|Start FNshell_CreateIcon2
�L� �shell_CreateIcon2(handle%,x0%,y0%,x1%,y1%,flags%,dt0%,dt1%,dt2%,bdr%)
�&� ic%,q%,text$,sprite$,minx%,miny%
� q%=�shell_HeapBlockFetch(60)
�!q%=handle%
�1q%!20=flags%:q%!24=dt0%:q%!28=dt1%:q%!32=dt2%
�text$="":sprite$=""
�� flags% � 1 �
�4 � flags% � &100 text$=$(q%!24) � text$=$(q%+24)
��
� flags% � 2 �
 � flags% � &100 �
.  sprite$=�shell_IconGetCommand(q%!28,"S")
 �
  sprite$=$(q%+24)
 �
�
)�shell_GetMinXY(flags%,text$,sprite$)
#� x1%-x0%<minx% � x1%=x0%+minx%
	#� y1%-y0%<miny% � y1%=y0%+miny%

)q%!4=x0%:q%!8=y0%:q%!12=x1%:q%!16=y1%
"ș "Wimp_CreateIcon",,q% � ic%
GÈ™ "Wimp_ForceRedraw",!q%,q%!4-bdr%,q%!8-bdr%,q%!12+bdr%,q%!16+bdr%

"È™ "Wimp_GetCaretPosition",,q%
K� !q%=handle%:�q%!4=ic%:ș "Wimp_SetCaretPosition",handle%,ic%,0,0,-1,0
�shell_HeapBlockReturn(q%)
=ic%
:
*|Stop FNshell_CreateIcon2

*|Start PROCshell_GetMinXY
+� �shell_GetMinXY(flags%,text$,sprite$)
� x0%,y0%,x1%,y1%,mx%,my%
minx%=0:miny%=0
� flags%�&01 � text$<>"" �
  � flags%�&40 �
5       È™ "Font_ReadInfo",flags%>>24 � ,,y0%,,y1%
D       ș "Font_StringBBox",,�26+�(flags%>>24)+text$ � ,x0%,,x1%
,       ș "Font_ConverttoOS",,x0% � ,x0%
,       ș "Font_ConverttoOS",,x1% � ,x1%
&       minx%=x1%-x0%:miny%=y1%-y0%
&  � minx%=6*dx%+16*�text$:miny%=32
   �
!  � flags%�&04 miny%+=2*dy%
"�
# � flags%�&02 � sprite$<>"" �
$T   ș "XOS_SpriteOp",&128,�shell_UserSpritesBase,sprite$ � ,,,mx%,my%,,spm% ; P%
%   � (P%�1)=0 �
&A      ș "XOS_ReadModeVariable",spm%,4 � ,,spx%:mx%=mx%<<spx%
'A      ș "XOS_ReadModeVariable",spm%,5 � ,,spy%:my%=my%<<spy%
(+      � flags%�&800 mx%=mx%/2:my%=my%/2
)B      � (flags%�&21B)=&13 mx%=minx%+mx% :� sprite+text (V~H~R)
*      � mx%>minx% minx%=mx%
+      � my%>miny% miny%=my%
,   �
-�
.�
/:
0*|Stop PROCshell_GetMinXY
1
2"*|Start FNshell_IconGetCommand
3"� �shell_IconGetCommand(v%,c$)
4� I%,result$
5
� v%<=0 �
6  result$=""
7�
8I  I%=�";"+�shell_StringUpperCase($v%),";"+�shell_StringUpperCase(c$))
9  � I%=0 �
:    result$=""
;  �
</    result$=�$(v%+I%),�$(v%+I%)+";",";")-1)
=  �
>�
?=result$
@:
A!*|Stop FNshell_IconGetCommand
B *|Start PROCshell_IconRedraw
C � �shell_IconRedraw(wh%,ih%)
D
� blk%
E"blk%=�shell_HeapBlockFetch(40)
F!blk%=wh%:blk%!4=ih%
G È™ "Wimp_GetIconState",,blk%
H&È™ "Interface_BoundingBox",,blk%+8
I<È™ "Wimp_ForceRedraw",wh%,blk%!8,blk%!12,blk%!16,blk%!20
J+�shell_Action(�shell_Poll_I(0,_U%!148))
K �shell_HeapBlockReturn(blk%)
L�
M:
N*|Stop PROCshell_IconRedraw
O%*|Start FNshell_IconGetValidation
P'� �shell_IconGetValidation(wh%,ih%)
Q� blk%,validation$,flags%
R� ih%=-1 � =""
Svalidation$=""
T#blk%=�shell_HeapBlockFetch(100)
Ublk%!0=wh%:blk%!4=ih%
V È™ "Wimp_GetIconState",,blk%
W*� check flags first to see if it has a
X� validation string!
Yflags%=blk%!24
Z� flags% � &100 �
[*  � blk%!32>0 � validation$=$(blk%!32)
\�
] �shell_HeapBlockReturn(blk%)
^=validation$
_:
`$*|Stop FNshell_IconGetValidation
a'*|Start PROCshell_IconPutValidation
b.� �shell_IconPutValidation(wh%,ih%,valid$)
c� blk%,flags%
d#blk%=�shell_HeapBlockFetch(100)
eblk%!0=wh%:blk%!4=ih%
f È™ "Wimp_GetIconState",,blk%
gflags%=blk%!24
h� flags% � &100 �
i  $(blk%!32)=valid$
j�
k �shell_HeapBlockReturn(blk%)
l�
m:
n&*|Stop PROCshell_IconPutValidation
o"*|Start FNshell_IsIconSelected
p6� �shell_IsIconSelected(WindowHandle%,IconHandle%)
q� temp%
r2�shell_IconGetState(WindowHandle%,IconHandle%)
sflags%=_Q%!24
ttemp%=(flags% � &200000)
u� temp%=0 � =�
v=�
w:
x!*|Stop FNshell_IsIconSelected
y
z *|Start PROCshell_IconSelect
{2� �shell_IconSelect(WindowHandle%,IconHandle%)
|B�shell_IconSetState(WindowHandle%,IconHandle%,&200000,&200000)
}�
~:
*|Stop PROCshell_IconSelect
�
�"*|Start PROCshell_IconDeselect
�4� �shell_IconDeselect(WindowHandle%,IconHandle%)
�<�shell_IconSetState(WindowHandle%,IconHandle%,0,&200000)
��
�:
�!*|Stop PROCshell_IconDeselect
�
�"*|Start PROCshell_IconGetState
�4� �shell_IconGetState(WindowHandle%,IconHandle%)
�!_Q%=WindowHandle%
�_Q%!4=IconHandle%
�ș "Wimp_GetIconState",,_Q%
��
�:
�!*|Stop PROCshell_IconGetState
�
�%*|Start PROCshell_IconSetSelected
�,� �shell_IconSetSelected(wh%,ih%,state%)
�� state%=0 �
�"  �shell_IconDeselect(wh%,ih%)
��
�   �shell_IconSelect(wh%,ih%)
��
��
�:
�$*|Stop PROCshell_IconSetSelected
�
�*|Start PROCshell_IconSet
�$� �shell_IconSet(wh%,ih%,state%)
�� state%=0 �
�"  �shell_IconDeselect(wh%,ih%)
��
�   �shell_IconSelect(wh%,ih%)
��
��
�:
�*|Stop PROCshell_IconSet
�"*|Start PROCshell_IconSetState
�H� �shell_IconSetState(WindowHandle%,IconHandle%,EorWord%,ClearWord%)
�� icon_blk%
�'icon_blk%=�shell_HeapBlockFetch(16)
�!icon_blk%=WindowHandle%
�icon_blk%!04=IconHandle%
�icon_blk%!08=EorWord%
�icon_blk%!12=ClearWord%
�%ș "Wimp_SetIconState",,icon_blk%
�%�shell_HeapBlockReturn(icon_blk%)
��
�:
�!*|Stop PROCshell_IconSetState
�
�&*|Start PROCshell_IconUnselectable
�,� �shell_IconUnselectable(handle%,icon%)
�5�shell_IconSetState(handle%,icon%,&400000,&40000)
��
�:
�%*|Stop PROCshell_IconUnselectable
�
�%*|Start PROCshell_IconSetBGColour
�*� �shell_IconSetBGColour(wh%,ih%,col%)
�\� col%<0 � col%>15 � � 99,�shell_MessageOneArg("SHELLMSG24","PROCshell_IconSetBGColour")
�3�shell_IconSetState(wh%,ih%,col%<<28,&F0000000)
��
�:
�$*|Stop PROCshell_IconSetBGColour
�
�%*|Start PROCshell_IconSetFGColour
�*� �shell_IconSetFGColour(wh%,ih%,col%)
�\� col%<0 � col%>15 � � 99,�shell_MessageOneArg("SHELLMSG24","PROCshell_IconSetFGColour")
�3�shell_IconSetState(wh%,ih%,col%<<24,&0F000000)
��
�:
�$*|Stop PROCshell_IconSetFGColour
�
�&*|Start PROCshell_CaretSetPosition
�K� �shell_CaretSetPosition(whandle%,ihandle%,xoff%,yoff%,height%,index%)
�Kș "Wimp_SetCaretPosition",whandle%,ihandle%,xoff%,yoff%,height%,index%
��
�:
�%*|Stop PROCshell_CaretSetPosition
�
�'*|Start PROCshell_IconSetButtonType
�4� �shell_IconSetButtonType(wh%,ih%,button_type%)
�o� button_type%=12 � button_type%=13 � � 99,�shell_MessageOneArg("SHELLMSG23","PROCshell_IconSetButtonType")
�n� button_type%<0 � button_type%>15 � � 99,�shell_MessageOneArg("SHELLMSG22","PROCshell_IconSetButtonType")
�7�shell_IconSetState(wh%,ih%,button_type%<<12,&F000)
��
�:
�&*|Stop PROCshell_IconSetButtonType
� *|Start PROCshell_IconSetESG
�%� �shell_IconSetESG(wh%,ih%,esg%)
�W� esg%<0 � esg%>31 � � 99,�shell_MessageOneArg("SHELLMSG25","PROCshell_IconSetESG")
�1�shell_IconSetState(wh%,ih%,esg%<<16,&1F0000)
��
�:
�*|Stop PROCshell_IconSetESG
�
�!*|Start PROCshell_IconSetText
�)� �shell_IconSetText(wh%,ih%,action%)
�� action%<>0 � action%=1<<0
�-�shell_IconSetState(wh%,ih%,action%,1<<0)
��
�:
� *|Stop PROCshell_IconSetText
�
�#*|Start PROCshell_IconSetSprite
�+� �shell_IconSetSprite(wh%,ih%,action%)
�� action%<>0 � action%=1<<1
�-�shell_IconSetState(wh%,ih%,action%,1<<1)
��
�:
�"*|Stop PROCshell_IconSetSprite
�#*|Start PROCshell_IconSetBorder
�+� �shell_IconSetBorder(wh%,ih%,action%)
�� action%<>0 � action%=1<<2
�-�shell_IconSetState(wh%,ih%,action%,1<<2)
��
�:
�"*|Stop PROCshell_IconSetBorder
�
�%*|Start PROCshell_IconSetHCentred
�-� �shell_IconSetHCentred(wh%,ih%,action%)
�F�shell_IconSetState(wh%,ih%,0,1<<9):� unset right justified bit...
�� action%<>0 � action%=1<<3
�-�shell_IconSetState(wh%,ih%,action%,1<<3)
��
�:
$*|Stop PROCshell_IconSetHCentred

%*|Start PROCshell_IconSetVCentred
-� �shell_IconSetVCentred(wh%,ih%,action%)
� action%<>0 � action%=1<<4
-�shell_IconSetState(wh%,ih%,action%,1<<4)
�
:
$*|Stop PROCshell_IconSetVCentred
	

#*|Start PROCshell_IconSetFilled
+� �shell_IconSetFilled(wh%,ih%,action%)
� action%<>0 � action%=1<<5

-�shell_IconSetState(wh%,ih%,action%,1<<5)
�
:
"*|Stop PROCshell_IconSetFilled

&*|Start PROCshell_IconSetRightJust
.� �shell_IconSetRightJust(wh%,ih%,action%)
%�shell_IconSetHCentred(wh%,ih%,0)
� action%<>0 � action%=1<<9
-�shell_IconSetState(wh%,ih%,action%,1<<9)
�
:
%*|Stop PROCshell_IconSetRightJust

%*|Start PROCshell_IconSetLeftJust
%� �shell_IconSetLeftJust(wh%,ih%)
%�shell_IconSetHCentred(wh%,ih%,0)
&�shell_IconSetRightJust(wh%,ih%,0)
�
 :
!$*|Stop PROCshell_IconSetLeftJust
"
#)*|Start PROCshell_IconSetUnselectable
$0� �shell_IconSetUnselectable(wh%,ih%,state%)
%� caret_blk%
&� state%<>0 � state%=1<<22
'-�shell_IconSetState(wh%,ih%,state%,1<<22)
(� state%<>0 �
)8  � check if icon has the caret, lose it if it has..
**  caret_blk%=�shell_HeapBlockFetch(24)
+,  È™ "Wimp_GetCaretPosition",,caret_blk%
,,  � !caret_blk%=wh% � caret_blk%!4=ih% �
-%    È™ "Wimp_SetCaretPosition",-1
.  �
/(  �shell_HeapBlockReturn(caret_blk%)
0�
1�
2:
3(*|Stop PROCshell_IconSetUnselectable
4
5#*|Start PROCshell_CaretSetRight
6#� �shell_CaretSetRight(wh%,ih%)
7Nș "Wimp_SetCaretPosition",wh%,ih%,-1,-1,-1,�(�shell_IconGetData(wh%,ih%))
8�
9:
:"*|Stop PROCshell_CaretSetRight
;
<*|Start PROCprint_text
=� �print_text(X,Y,text$)
>#� �in(X,Y-32,X+16*�(text$),Y) �
?  � X,Y
@
  � text$
A�
B�
C:
D*|Stop PROCprint_text
E*|Start FNin
F� �in(A%,B%,C%,D%)
G� C%<gbx � =�
H� A%>gtx � =�
I� B%>gty � =�
J� D%<gby � =�
K=�
L:
M*|Stop FNin
N*|Start PROCnewvals
O� �newvals
Pgbx=_Q%!28:gby=_Q%!32
Qgtx=_Q%!36:gty=_Q%!40
Rwbx=_Q%!4:wby=_Q%!8
Swtx=_Q%!12:wty=_Q%!16
Txsc=_Q%!20:ysc=_Q%!24
U!hp=wtx-wbx:vp=wty-wby:ebx=xsc
V!etx=xsc+hp:ety=ysc:eby=ysc-vp
W�
X:
Y*|Stop PROCnewvals
Z� �max(a%,b%)
[� a%<b% � =b%
\=a%
]:
^*|Start FNshell_Leaf
_� �shell_Leaf(path$)
`ȕ �path$,".")
a!  path$=�path$,�path$,".")+1)
b�
c
=path$
d:
e*|Stop FNshell_Leaf
f*|Start FNshell_Branch
g� �shell_Branch(fname$)
h� pos%,br$,temp%
i� �fname$,".")=0 �
j  br$=""
k�
l
  temp%=0
m  �
n    pos%=temp%+1
o    temp%=�fname$,".",pos%)
p  � temp%=0
q  br$=�fname$,pos%-2)
r�
s=br$
t:
u*|Stop FNshell_Branch
v*|Start FNgname
w� �gname(ptr)
x	f$=""
yȕ ?ptr<>0 � ?ptr<>13
z  f$=f$+�?ptr:ptr+=1
{�
|=f$
}:
~*|Stop FNgname
"*|Start PROCshell_WindowResize
�9� �shell_WindowResize(whandle%,bx%,by%,tx%,ty%,open%)
�+!_Q%=bx%:_Q%!4=by%:_Q%!8=tx%:_Q%!12=ty%
�$ș "Wimp_SetExtent",whandle%,_Q%
�
� open% �
�  _Q%!0=whandle%
�"  ș "Wimp_GetWindowInfo",,_Q%
�  ș "Wimp_OpenWindow",,_Q%
��
��
�:
�!*|Stop PROCshell_WindowResize
�
�#*|Start PROCshell_WindowRetitle
�-� �shell_WindowRetitle(� whandle%,title$)
�*� temp%,win_blk%,handle%,t_buffer_len%
�Vwin_blk%   = �shell_HeapBlockFetch(100 + (�shell_WindowCountIcons(whandle%) * 32))
�win_blk%!0 = whandle%
�%ș "Wimp_GetWindowInfo",,win_blk%
�"� ((win_blk%!60) � &100) = 0 �
�(  � window title is not indirected..
�  temp% = win_blk% + 76
�  $temp% = �title$,11)
�&  ș "Wimp_DeleteWindow",,win_blk%
�4  ș "Wimp_CreateWindow",,win_blk% + 4 � handle%
�  � handle% <> whandle% �
�9    � Window handle has changed, update event data...
�3    �shell_UpdateWindowHandle(whandle%,handle%)
�    whandle% = handle%
�  �
��
�6  � Window title is indirected, find buffer size..
�!  t_buffer_len% = win_blk%!84
�4  � Truncate title if it won't fit the buffer...
�6  $(!(win_blk% + 76)) = �title$,t_buffer_len% - 1)
�*  � ((win_blk%!32) � (1 << 16)) <> 0 �
�9    � Window is open, so redraw the title bar area...
�T    ș "Wimp_ForceRedraw",-1,win_blk%!4,win_blk%!16,win_blk%!12,win_blk%!16 + 44
�  �
�&  �shell_HeapBlockReturn(win_blk%)
��
��
�:
�"*|Stop PROCshell_WindowRetitle
�
�)*|Start FNshell_WindowTitleIndirected
�)� �shell_WindowTitleIndirected(flag%)
�"� (flag% � (1<<8))=(1<<8) � =�
�=�
�:
�(*|Stop FNshell_WindowTitleIndirected
�**|Start PROCshell_ScreenToWindowCoords
�5� �shell_ScreenToWindowCoords(WHandle%,� X%,� Y%)
�4� Temp%,WXMin%,WYMin%,XScroll%,YScroll%,Scratch%
�RScratch%=�shell_HeapBlockFetch(100 + (�shell_WindowCountIcons(WHandle%) * 32))
�Temp%=Scratch%
�!Temp%=WHandle%
�"ș "Wimp_GetWindowInfo",,Temp%
�WXMin%=Scratch%!4
�WYMax%=Scratch%!16
�XScroll%=Scratch%!20
�YScroll%=Scratch%!24
�X%=X%+(XScroll%-WXMin%)
�Y%=Y%+(YScroll%-WYMax%)
�$�shell_HeapBlockReturn(Scratch%)
��
�:
�)*|Stop PROCshell_ScreenToWindowCoords
�#*|Start FNshell_WimpSlotReadEnd
�� �shell_WimpSlotReadEnd
�
� mem%
�#ș "Wimp_SlotSize",-1,-1 � mem%
�	=mem%
�:
�"*|Stop FNshell_WimpSlotReadEnd
�'*|Start FNshell_WimpSlotClaimMemory
�,� �shell_WimpSlotClaimMemory(mem%,size%)
�� ssize%
�-ș "Wimp_SlotSize",mem%+size%,-1 � ssize%
�� ssize%<mem%+size% � =-1
�= ssize%
�:
�&*|Stop FNshell_WimpSlotClaimMemory
�+*|Start PROCshell_WimpSlotReleaseMemory
�"� �shell_WimpSlotReleaseMemory
�ș "Wimp_SlotSize",mem%,-1
��
�:
�**|Stop PROCshell_WimpSlotReleaseMemory
� *|Start PROCshell_MouseLimit
�#� �shell_MouseLimit(b,whandle%)
�,b!0=whandle%:ș "Wimp_GetWindowState",,b
�/�mouse_rectangle(b!4,b!8,b!12-b!4,b!16-b!8)
��
�:
�*|Stop PROCshell_MouseLimit
�%*|Start FNshell_NameOfFirstSprite
�%� �shell_NameOfFirstSprite(File$)
�� X%,N%,S$
�X%=�(File$)
�
�#X%=4
�N%=�#X%
�N%+=�#X%*&100
�N%+=�#X%*&10000
�N%+=�#X%*&1000000
��#X%=N%
�	S$=""
�� N%=0 � 11
�S$+=�(�#X%)
��
��#X%
�=S$
�:
�$*|Stop FNshell_NameOfFirstSprite
�
�$*|Start PROCInitialiseSpriteArea
�'� �InitialiseSpriteArea(S%,Length%)
�!S%=Length%
�S%!8=16
�ș "OS_SpriteOp",9+256,S%
��
�:
�#*|Stop PROCInitialiseSpriteArea
�
� *|Start PROCshell_ListEvents
� � �shell_ListEvents(wh%,ic%)
�� menu%,menu$
�� wh%=-1 � wh%=-2
�F�shell_Tracef0("MenuSelection="+�shell_GetEventHandler(wh%,ic%,0))
F�shell_Tracef0("MenuMaker    ="+�shell_GetEventHandler(wh%,ic%,1))
F�shell_Tracef0("ClickSelect  ="+�shell_GetEventHandler(wh%,ic%,2))
F�shell_Tracef0("ClickAdjust  ="+�shell_GetEventHandler(wh%,ic%,3))
F�shell_Tracef0("Redraw       ="+�shell_GetEventHandler(wh%,ic%,4))
F�shell_Tracef0("Keypress     ="+�shell_GetEventHandler(wh%,ic%,5))
F�shell_Tracef0("Drag         ="+�shell_GetEventHandler(wh%,ic%,6))
F�shell_Tracef0("Menu Warning ="+�shell_GetEventHandler(wh%,ic%,7))
F�shell_Tracef0("HelpTag      ="+�shell_GetEventHandler(wh%,ic%,8))
(menu%=�shell_GetEventMenu(2,wh%,ic%)
	� menu%=0 �

  menu$="None"
�
  menu$=�menu%

�
*�shell_Tracef0("Menu handle =&"+menu$)
�
*|Stop PROCshell_ListEvents

L� ----------- Heap Manager Routines ------------------------------------

0� Function to load heap manager machine code

%*|Start PROCshell_HeapManagerInit
*� �shell_HeapManagerInit(path$,space%)
� _heap_code% 900
.�("LOAD "+path$+"heapcode "+�~_heap_code%)
� _heap_code%+0,space%
�
:
$*|Stop PROCshell_HeapManagerInit

#*|Start FNshell_HeapBlockExists
 #� �shell_HeapBlockExists(addr%)
!� void%
"� �
#� � �:� �:=�
$?� addr%<&8000 � � 99,"No heapblock defined at this address"
%%void%=�shell_HeapBlockInfo(addr%)
&
� �:=�
'"*|Stop FNshell_HeapBlockExists
(
)#*|Start FNshell_HeapBlockExtend
*
+
,7*|!Function to extend already allocated heap block.
-$*|!a% = current address of block
.J*|!b% = amount to increase or decrease block size by (-ve to decrease)
/4*|!returns address of block (block may be moved)
0#� �shell_HeapBlockExtend(a%,b%)
1� _heap_code%+12,a%,b%
2=a%
3"*|Stop FNshell_HeapBlockExtend
4
5"*|Start FNshell_HeapBlockFetch
6/*|!Function to allocate a block on the heap
7,*|!a% = size of block to fetch from heap
8)*|!returns address of allocated block
9� �shell_HeapBlockFetch(a%)
:� addr%
;� _heap_code%+4,addr%,a%
<
=addr%
=!*|Stop FNshell_HeapBlockFetch
>
?%*|Start PROCshell_HeapBlockReturn
@3*|!Procedure to return a heap block to the heap
A**|!a% = address of block to deallocate
B"� �shell_HeapBlockReturn(� a%)
C5� �shell_HeapBlockExists(a%) � � _heap_code%+8,a%
Da%=0
E�
F$*|Stop PROCshell_HeapBlockReturn
G
H!*|Start FNshell_HeapBlockInfo
I8*|!Function to return current length of a heap block
J*|!a% = addr of heap block
K� �shell_HeapBlockInfo(a%)
L� r3
M/ș "OS_Heap",6,!(_heap_code%+28),a% � ,,,r3
N=r3
O:
P *|Stop FNshell_HeapBlockInfo
Q
R*|Start FNshell_OSVarExists
S*� �shell_OSVarExists(buffer%,varname$)
T� nr_bytes
U<ș "XOS_ReadVarVal",varname$,buffer%,-1,0,0 � ,,nr_bytes
V� nr_bytes<0 � =�
W=�
X:
Y*|Stop FNshell_OSVarExists
Z
[*|Start FNshell_OSVarGetVal
\7� �shell_OSVarGetVal(buffer%,size%,varname$,expand)
]� value$,nr_bytes,nameptr%
^Zș "XOS_ReadVarVal",varname$,buffer%,size%,0,-3*(expand=�) � ,,nr_bytes,nameptr%,type%
_� loop%=0 � nr_bytes-1
`$  value$=value$+�(buffer%?loop%)
a� loop%
b=value$
c:
d*|Stop FNshell_OSVarGetVal
e
f$*|Start FNshell_OSReadCommandArg
g"� �shell_OSReadCommandArg(opt)
h� pointer%,command$,offset%
icommand$="":offset%=0
jș "OS_GetEnv" � pointer%
kȕ pointer%?offset%<>0
l#  command$+=�(pointer%?offset%)
m  offset%+=1
n�
oȎ opt �
p	  � 0
q	  � 1
r,    command$=�command$,�command$,�34)+1)
s,    command$=�command$,�command$,�34)+2)
t�
u
=command$
v:
w#*|Stop FNshell_OSReadCommandArg
x
y'*|Start FNshell_StringStripTrailing
z/� �shell_StringStripTrailing(string$,char$)
{È• �string$,1) = char$
|(  string$ = �string$,�(string$) - 1)
}�
~
= string$
:
�&*|Stop FNshell_StringStripTrailing
�&*|Start FNshell_StringStripLeading
�.� �shell_StringStripLeading(string$,char$)
�ȕ �string$,1) = char$
�  string$ = �string$,2)
��
�
= string$
�:
�%*|Stop FNshell_StringStripLeading
�"*|Start FNshell_StringStripAll
�*� �shell_StringStripAll(string$,char$)
�� done,pos
�
done=�
��
�  pos=�string$,char$)
�
  � pos �
�    done=�
�/    string$=�string$,pos-1)+�string$,pos+1)
�  �
�    done=�
�  �
�
� done
�=string$
�:
�!*|Stop FNshell_StringStripAll
�
�%*|Start FNshell_StringPadTrailing
�5� �shell_StringPadTrailing(string$,char$,length%)
�ȕ �(string$) < length%
�6  string$ = string$ + �length% - �(string$),char$)
��
�
= string$
�:
�$*|Stop FNshell_StringPadTrailing
�
�$*|Start FNshell_StringPadLeading
�4� �shell_StringPadLeading(string$,char$,length%)
�ȕ �(string$) < length%
�6  string$ = �length% - �(string$),char$) + string$
��
�
= string$
�:
�#*|Stop FNshell_StringPadLeading
�
�#*|Start FNshell_StringUpperCase
�%� �shell_StringUpperCase(string$)
�� loop%
�� �(string$) > 0 �
� � loop% = 1 � �(string$)
�:   � �string$,loop%,1)>="a" � �string$,loop%,1)<="z" �
�:     �string$,loop%,1) = �(�(�string$,loop%,1)) � &DF)
�   �
� � loop%
��
�
= string$
�:
�"*|Stop FNshell_StringUpperCase
�
�"*|Start FNshell_StringExchange
�1� �shell_StringExchange(string$,target$,sub$)
�� index%
��  �string$,target$) �
�  index%=�string$,target$)
�?  string$=�string$,index%-1)+sub$+�string$,index%+�target$)
��
�=string$
�:
�!*|Stop FNshell_StringExchange
�)*|Start FNshell_StringArrayGetLongest
�0� �shell_StringArrayGetLongest(array$(),nr%)
�� loop%,longest%
�longest% = 0
�� loop% = 0 � nr%
�%  � �(array$(loop%)) > longest% �
�#    longest% = �(array$(loop%))
�  �
�� loop%
�= longest%
�:
�(*|Stop FNshell_StringArrayGetLongest
�*|Start FNmem_to_string
�*� �mem_to_string(block%,offset%,term%)
�
� string$
�ȕ block%?offset%<>term%
�   string$+=�(block%?offset%)
�  offset%+=1
��
�=string$
�:
�*|Stop FNmem_to_string
�
�*|Start FNshell_FileLength
� � �shell_FileLength(object$)
�7� type%,load_addr%,exec_addr%,length%,atts%,string$
�Gș "OS_File",5,object$ � type%,,load_addr%,exec_addr%,length%,atts%
�=length%
�:
�*|Stop FNshell_FileLength
�
�*|Start PROCshell_TraceOn
�� �shell_TraceOn
�_U%!100 = _U%!100 � 1 << 9
�7�shell_BroadcastMessage(&43B00,"ShellDBug:TraceOn")
��
�:
�*|Stop PROCshell_TraceOn
�
�*|Start PROCshell_TraceOff
�� �shell_TraceOff
�9� (_U%!100 � (1 << 9)) � _U%!100 = _U%!100 � (1 << 9)
�8�shell_BroadcastMessage(&43B00,"ShellDBug:TraceOff")
��
�:
�*|Stop PROCshell_TraceOff
�
�*|Start PROCshell_TraceInit
�*|Define TraceInit
�� �shell_TraceInit(file$)
�*� f%,blk%,shell_AppName$,shell_AppDir$
�� file$<>"" �
�  f%=�(file$)
�  _U%!44=f%
��
�#blk%=�shell_HeapBlockFetch(256)
�;shell_AppDir$=�shell_OSVarGetVal(blk%,256,"Obey$Dir",1)
�1shell_AppName$=��shell_Leaf(shell_AppDir$),2)
�
�X�shell_BroadcastMessage(&43B00,"ShellDBug:Init Debug messages from "+shell_AppName$)
 �shell_HeapBlockReturn(blk%)
J� set bit 4 of shell flag word. If ShellDBug start up is detected then
L� send init message again (ShellDBug was started after this task). Clear
/� bit when ShellDBug sends its ack message.
� _U%!100 � 1<<4 �
�
  _U%!100=(_U%!100 � 1<<4)
�
�
	:

*|Stop PROCshell_TraceInit

*|Start FNshell_TraceIsOn

� �shell_TraceIsOn
$� _U%!100 � (1 << 9) � = � � = �
:
*|Stop FNshell_TraceIsOn

*|Start PROCshell_Tracef0
� �shell_Tracef0(a$)
� f%
� �(�shell_TraceIsOn) � �
� _U%!44<>-1 �
  f%=_U%!44

  �#f%,a$
�
)� check if task id has been set up...
� _U%!148>0 �
;  �shell_BroadcastMessage(&43B00,"ShellDBug:Trace "+a$)
  � PROCshell_EnsurePoll
�
�
 :
!*|Stop PROCshell_Tracef0
"
#*|Start PROCshell_Tracef2
$� �shell_Tracef2(addr%)
%�("MEDIT "+�~addr%)
&�
':
(*|Stop PROCshell_Tracef2
)
**|Start PROCshell_TraceExit
+� �shell_TraceExit
,'� _U%!44<>-1 � �#(_U%!44):_U%!44=-1
-� _U%!44=-1:_U%!48=FALSE
.�
/:
0*|Stop PROCshell_TraceExit
1
2"*|Start PROCshell_AttachHotKey
3G� �shell_AttachHotKey(key$,shift%,ctrl%,alt%,window$,wh%,fn1$,fn2$)
4.� e_list%,offset%,temp%,temp2%,key%,f_key%
5f_key%=�
6� _U%!60=0 �
7&  _U%!60=�shell_HeapBlockFetch(24)
8  offset%=0:_U%!180=1
9�
:  offset%=_U%!180*24
;.  _U%!60=�shell_HeapBlockExtend(_U%!60,24)
<  _U%!180=(_U%!180)+1
=�
>e_list%=_U%!60
?
Ȏ key$ �
@  � "F1" :key%=385
A  � "F2" :key%=386
B  � "F3" :key%=387
C  � "F4" :key%=388
D  � "F5" :key%=389
E  � "F6" :key%=390
F  � "F7" :key%=391
G  � "F8" :key%=392
H  � "F9" :key%=393
I  � "F10":key%=458
J  � "F11":key%=459
K
L  key%=(�key$)-64:f_key%=�
M�
N� f_key% �
O  � shift% � key%+=16
P  � ctrl%  � key%+=32
Q�
Rtemp%=e_list%+offset%
Stemp%!0=key%
Ttemp%?4=shift%:� shift flag
Utemp%?5=ctrl% :� ctrl  flag
Vtemp%?6=alt%  :� alt   flag
W-temp%!8=�shell_HeapBlockFetch(�window$+1)
X"temp2%=temp%!8:$temp2%=window$
Y
� wh%>0 �
Z0  � check window handle is in static list...
[.  offset%=�shell_SearchStatic(_U%!184,wh%)
\<  � offset%=-1 � � 99,�shell_MessageNoArgs("SHELLMSG09")
]�
^?temp%!12=wh%:� >0 denotes a window handle to open as static
_+temp%!16=�shell_HeapBlockFetch(�fn1$+1)
` temp2%=temp%!16:$temp2%=fn1$
a+temp%!20=�shell_HeapBlockFetch(�fn2$+1)
b temp2%=temp%!20:$temp2%=fn2$
c�
d:
e!*|Stop PROCshell_AttachHotKey
f
g!*|Start FNshell_HotKeyProcess
h � �shell_HotKeyProcess(key%)
i6� e_list%,list_size%,found%,ptr%,h%,win$,fn1$,fn2$
j>� ctrl%,shift%,alt%,x_off%,y_off%,flag%,key_flags%,offset%
k� result%,win_blk%
le_list%=_U%!60
mlist_size%=_U%!180*24
nfound%=�:ptr%=0
o�
p  � e_list%!ptr%=key% �
q    found%=�
r  �
s    ptr%+=24
t  �
u� found% � ptr%>=list_size%
v� found% �
w  temp%=e_list%+ptr%
x  win$=$(temp%!8)
y*|ifdef TraceInit
zA  �shell_Tracef0("HotKeyProcess:Template name is '"+win$+"'")
{*|endif
|!  � (win$<>"" � temp%!12=0) �
}5    � only create a window if it is a dynamic one
~2    � static windows have already been created
$    �shell_CreateWindow(win$,h%)
�*|ifdef TraceInit
�Y    �shell_Tracef0("HotKeyProcess:Creating new dynamic window (handle is &"+�~h%+")")
�*|endif
�*    win_blk%=�shell_HeapBlockFetch(36)
�    win_blk%!0=h%
�*    ș "Wimp_GetWindowState",,win_blk%
�)    x_off%=(win_blk%!4-win_blk%!12)/2
�)    y_off%=(win_blk%!16-win_blk%!8)/2
�(    �shell_HeapBlockReturn(win_blk%)
�  �
�  fn1$=$(temp%!16)
�  � fn1$<>"" �
�*|ifdef TraceInit
�F    �shell_Tracef0("HotKeyProcess:Calling Pre-Open FN '"+fn1$+"'")
�*|endif
�    � temp%!12>0 �
�.      void%=�("FN"+fn1$+"("+�temp%!12+")")
�	    �
�(      void%=�("FN"+fn1$+"("+�h%+")")
�	    �
�  �
�*|ifdef TraceInit
�?  �shell_Tracef0("HotKeyProcess:No Pre-Open FN registered")
�*|endif
�  �
�5    offset%=�shell_SearchStatic(_U%!184,temp%!12)
�    � offset%>-1 �
�+      �shell_OpenWindowStatic(temp%!12)
�	    �
�      � temp%!12>0 �
�@        � request to open a static window, but window handle
�C        � has not been registered with shell_CreateWindowStatic
�3        � 99,�shell_MessageNoArgs("SHELLMSG09")
�      �
�.        � must be a dynamic window then...
�7        �shell_OpenWindowDynamic2(h%,x_off%,y_off%)
�      �
�	    �
�  fn2$=$(temp%!20)
�  � fn2$<>"" �
�*|ifdef TraceInit
�G    �shell_Tracef0("HotKeyProcess:Calling Post-Open FN '"+fn2$+"'")
�*|endif
�    � temp%!12>0 �
�.      void%=�("FN"+fn1$+"("+�temp%!12+")")
�	    �
�(      void%=�("FN"+fn2$+"("+�h%+")")
�	    �
�  �
�*|ifdef TraceInit
�B    �shell_Tracef0("HotKeyProcess:No Post-Open FN registered")
�*|endif
�  �
�  result%=�
��
�'  win$="":fn1$="":fn2$="":result%=�
��
�=result%
�:
� *|Stop FNshell_HotKeyProcess
�
�+*|Start PROCshell_WindowCentreOnPointer
�&� �shell_WindowCentreOnPointer(h%)
�!� w_blk%,p_blk%,x_off%,y_off%
�(p_blk%   = �shell_HeapBlockFetch(20)
�$ș "Wimp_GetPointerInfo",,p_blk%
�(win_blk% = �shell_HeapBlockFetch(36)
�win_blk%!0 = h%
�&ș "Wimp_GetWindowState",,win_blk%
�,x_off% = (win_blk%!04 - win_blk%!12) / 2
�,y_off% = (win_blk%!16 - win_blk%!08) / 2
�?�shell_WindowMoveTo(h%,p_blk%!0 + x_off%,p_blk%!4 - y_off%)
�$�shell_HeapBlockReturn(win_blk%)
�"�shell_HeapBlockReturn(p_blk%)
��
�:
�**|Stop PROCshell_WindowCentreOnPointer
�
�**|Start PROCshell_WindowCentreOnScreen
�%� �shell_WindowCentreOnScreen(h%)
�I� w_blk%,scrn_xmax%,scrn_ymax%,width%,height%,XEigFactor%,YEigFactor%
�3ș "XOS_ReadModeVariable",-1,04 � ,,XEigFactor%
�3ș "XOS_ReadModeVariable",-1,05 � ,,YEigFactor%
�2ș "XOS_ReadModeVariable",-1,11 � ,,scrn_xmax%
�2ș "XOS_ReadModeVariable",-1,12 � ,,scrn_ymax%
�Nscrn_xmax% = scrn_xmax% << XEigFactor%:� Convert pixels to screen coords..
�Nscrn_ymax% = scrn_ymax% << YEigFactor%:� Convert pixels to screen coords..
�*win_blk%   = �shell_HeapBlockFetch(36)
�win_blk%!0 = h%
�&ș "Wimp_GetWindowState",,win_blk%
�)width%  = (win_blk%!12 - win_blk%!04)
�)height% = (win_blk%!16 - win_blk%!08)
�V�shell_WindowMoveTo(h%,(scrn_xmax% / 2) - (width% / 2),(scrn_ymax% - height%) / 2)
�$�shell_HeapBlockReturn(win_blk%)
��
�:
�)*|Stop PROCshell_WindowCentreOnScreen
�
�-*|Start PROCshell_OpenWindowStaticNewView
�)� �shell_OpenWindowStaticNewView(wh%)
��shell_OpenWindow(wh%,�,-1)
��
�:
�,*|Stop PROCshell_OpenWindowStaticNewView
�
�&*|Start PROCshell_OpenWindowStatic
�&� �shell_OpenWindowStatic(handle%)
�1� �shell_SearchStatic(_U%!184,handle%) > -1 �
�%  �shell_OpenWindow(handle%,0,-1)
��
�4  � ERROR 99,FNshell_MessageNoArgs("SHELLMSG09")
��
��
�:
�%*|Stop PROCshell_OpenWindowStatic
�
� *|Start FNshell_SearchStatic
�*� �shell_SearchStatic(w_list%,handle%)
�0� search static window list by window handle
�� found%,ctr%
�found% = -1:ctr% = 0
�3� handle% < 0 � = 0 :� Iconbar, must be static!
�=� PROCshell_Tracef0("DEBUG::old handle = &"+STR$~handle%)
�� w_list% <> 0 �
�  ȕ w_list%!ctr% <> -1
�Q    � PROCshell_Tracef0("DEBUG::searching.. handle is &"+STR$~(w_list%!ctr%))
�"    � w_list%!ctr% = handle% �
�      found% = ctr%
0      � PROCshell_Tracef0("DEBUG::found...")
      = found%
	    �
    ctr% += 4
  �
�
=found%
:
*|Stop FNshell_SearchStatic
	

(*|Start PROCshell_CreateWindowStatic
1� �shell_CreateWindowStatic(ident$,� handle%)
#� wb_ptr%,w_list%,temp%,offset%

 wb_ptr%=�shell_GetWB(ident$)
3� set 'sprite area' pointer to usersprites area
wb_ptr%!64=_U%!16
-ș "Wimp_CreateWindow",,wb_ptr% � handle%
w_list%=_U%!184
� w_list%=0 �
  � empty list
*|ifdef TraceInit
5  �shell_Tracef0("CreateWindowStatic:Empty List")
*|endif
&  _U%!184=�shell_HeapBlockFetch(8)
  w_list%=_U%!184
$  w_list%!0=handle%:w_list%!4=-1
�
%  � search list for window handle
*|ifdef TraceInit
F  �shell_Tracef0("CreateWindowStatic:Searching for window handle")
*|endif
2  offset%=�shell_SearchStatic(_U%!184,handle%)
   � offset%=-1 �
!*    � add window handle to static list
"*|ifdef TraceInit
#S  �shell_Tracef0("CreateWindowStatic:Not found - adding window handle to list")
$*|endif
%.    offset%=�shell_SearchStatic(_U%!184,0)
&    � offset%=-1 �
'*|ifdef TraceInit
(G  �shell_Tracef0("CreateWindowStatic:Extending window handle list")
)*|endif
*      ctr%=0
+      È• w_list%!ctr%<>-1
,        ctr%+=4
-      �
.3      _U%!184=�shell_HeapBlockExtend(_U%!184,4)
/      w_list%=_U%!184
0	    �
1*|ifdef TraceInit
2E  �shell_Tracef0("CreateWindowStatic:Found unused space in list")
3*|endif
4      ctr%=offset%
5	    �
6    temp%=w_list%+ctr%
7"    temp%!0=handle%:temp%!4=-1
8  �
9�
:�
;:
<'*|Stop PROCshell_CreateWindowStatic
=
>$*|Start PROCshell_InitHelpSystem
?'� �shell_InitHelpSystem(path$,die%)
@7� tail$,pos%,OSVarBuff%,respath$,help_found%,abort%
A@_U%!212 = 0:� _U%!216 <> 0 � �shell_HeapBlockReturn(_U%!216)
B1_U%!216 = 0:� clear pending command buffer...
C9�shell_ScanForHelp:� check if StrongHlp is running...
D/� die% � tail$ = " -DieWithTask" � tail$=""
E� _U%!100 � 1 << 3 �
F,  � ResFind initialised, check ResPath..
G  path$      = ""
H-  OSVarBuff% = �shell_HeapBlockFetch(256)
IU  respath$   = �shell_OSVarGetVal(OSVarBuff%,256,�shell_GetAppName+"Res$Path",-1)
J(  �shell_HeapBlockReturn(OSVarBuff%)
K  �
L    pos% = �respath$,",")
M    � pos% > 0 �
NH      � �shell_FileExists(�respath$,pos% - 1) + �shell_GetAppName) �
O;        path$ = �respath$,pos% - 1) + �shell_GetAppName
P?        � �shell_StrongHlpChkFiles(path$) � help_found% = �
Q      �
R*        respath$ = �respath$,pos% + 1)
S      �
T	    �
U=      � �shell_FileExists(respath$ + �shell_GetAppName) �
V0        path$ = respath$ + �shell_GetAppName
W?        � �shell_StrongHlpChkFiles(path$) � help_found% = �
X      �
Y        abort% = �
ZK        �shell_OK(�shell_MessageOneArg("SHELLMSG26",�shell_GetAppName))
[      �
\	    �
]*  � path$ <> "" � help_found% � abort%
^�
_   � ResFind not being used..
`"  � �shell_FileExists(path$) �
a/    � Directory exists, check if files do..
b8    � � �shell_StrongHlpChkFiles(path$) � abort% = �
c  �
d6     � 99,�shell_MessageOneArg("SHELLMSG33",path$)
e  �
f�
g� abort% = 0 �
h:  �shell_StrongHlpMsg("Help_Install " + path$ + tail$)
i   _U%!100 = _U%!100 � 1 << 7
j�
k�
l:
m#*|Stop PROCshell_InitHelpSystem
n
o*|Start PROCshell_HelpWord
p� �shell_HelpWord(word$)
q� read%,temp%,buff%
r$buff%=�shell_HeapBlockFetch(512)
s� _U%!208 = -1 �
t2  �  StrongHelp is not loaded. Try to run it..
u4  � �shell_OSVarExists(buff%,"StrongHelp$Dir") �
v8    � Variable exists, so attempt to run StrongHlp..
w/    È™ "XWimp_StartTask","<StrongHelp$Dir>"
x6    � _U%!216<>0 � �shell_HeapBlockReturn(_U%!216)
y/    _U%!216=�shell_HeapBlockFetch(�word$+1)
z    temp%=_U%!216
{    $temp%=word$
|  �
}A    � It doesn't, so complain, but first release buffer as an
~*    � error is about to be generated..
%    �shell_HeapBlockReturn(buff%)
�5    �shell_OK(�shell_MessageNoArgs("SHELLMSG11"))
�  �
��
�-  �shell_StrongHlpMsg("Help_Word "+word$)
��
�!�shell_HeapBlockReturn(buff%)
��
�:
�*|Stop PROCshell_HelpWord
�
�"*|Start PROCshell_StrongHlpMsg
�� �shell_StrongHlpMsg(msg$)
�(�shell_BroadcastMessage(&43B00,msg$)
��
�:
�!*|Stop PROCshell_StrongHlpMsg
�!*|Start PROCshell_ScanForHelp
�� �shell_ScanForHelp
�� wrk%,owner_taskhandle%
�8wrk%=�shell_HeapBlockFetch(256):� block for messages
�2�  Finds out if StrongHelp is already running.
�A�  Does this by scanning the tasks installed on the iconbar..
�E�  This again is done by getting the task's handle, and sending a
�A�  sending a TaskNameRq to the taskhandler. When this returns
�I�  (as a TaskNameIs message) we compare the string with "StrongHelp".
�F�  If not equal, this routine is called again to check next icon..
�
��
�H  �  This Wimp_SendMessage does *not* send a message to the owner of
�A  �  the icon. It merely returns the taskhandle of the owner.
�  wrk%!12 = 0
�D  ș "Wimp_SendMessage",19,wrk%,-2,_U%!212 � ,,owner_taskhandle%
�"  _U%!212=_U%!212+1:� icontry%
�.� owner_taskhandle% <> -1 � (_U%!212) > 64
�
�� owner_taskhandle% <> -1 �
�+  � Send request for name of this task.
�  wrk%!0  = 24
�  wrk%!12 = 0
�  wrk%!16 = &400C6
�!  wrk%!20 = owner_taskhandle%
�%  ș "Wimp_SendMessage",17,wrk%,0
��
� �shell_HeapBlockReturn(wrk%)
��
�:
� *|Stop PROCshell_ScanForHelp
�
�&*|Start PROCshell_BroadcastMessage
�0� �shell_BroadcastMessage(reason_code%,msg$)
�� m_blk%,m_len%
�m_len% = (�msg$ + 30) � � 3
�*m_blk% = �shell_HeapBlockFetch(m_len%)
�m_blk%!12 = 0
�m_blk%!16 = reason_code%
� $(m_blk% + 20) = msg$ + �(0)
�m_blk%!0 = m_len%
�I� use XSWI in case error occurs between trace init call and wimp init
�D� call - can't broadcast unless we have launched the wimp task..
�:ș "XWimp_SendMessage",17,m_blk%,0:� broadcast message
�"�shell_HeapBlockReturn(m_blk%)
��
�:
�%*|Stop PROCshell_BroadcastMessage
�
�**|Start PROCshell_WindowToggleBackIcon
�(� �shell_WindowToggleBackIcon(� wh%)
�'�shell_WindowToggleFlags(wh%,1<<24)
��
�:
�)*|Stop PROCshell_WindowToggleBackIcon
�+*|Start PROCshell_WindowToggleCloseIcon
�)� �shell_WindowToggleCloseIcon(� wh%)
�'�shell_WindowToggleFlags(wh%,1<<25)
��
�:
�**|Stop PROCshell_WindowToggleCloseIcon
�**|Start PROCshell_WindowToggleTitleBar
�(� �shell_WindowToggleTitleBar(� wh%)
�'�shell_WindowToggleFlags(wh%,1<<26)
��
�:
�)*|Stop PROCshell_WindowToggleTitleBar
�,*|Start PROCshell_WindowToggleToggleIcon
�*� �shell_WindowToggleToggleIcon(� wh%)
�'�shell_WindowToggleFlags(wh%,1<<27)
��
�:
�+*|Stop PROCshell_WindowToggleToggleIcon
�,*|Start PROCshell_WindowToggleHScrollBar
�*� �shell_WindowToggleHScrollBar(� wh%)
�'�shell_WindowToggleFlags(wh%,1<<30)
��
�:
�+*|Stop PROCshell_WindowToggleHScrollBar
�0*|Start PROCshell_WindowToggleAdjustSizeIcon
�.� �shell_WindowToggleAdjustSizeIcon(� wh%)
�'�shell_WindowToggleFlags(wh%,1<<29)
��
�:
�/*|Stop PROCshell_WindowToggleAdjustSizeIcon
�,*|Start PROCshell_WindowToggleVScrollBar
�*� �shell_WindowToggleVScrollBar(� wh%)
�'�shell_WindowToggleFlags(wh%,1<<28)
��
�:
�+*|Stop PROCshell_WindowToggleVScrollBar
�
�'*|Start PROCshell_WindowToggleFlags
�+� �shell_WindowToggleFlags(� wh%,mask%)
�� blk%,flags%,open%,handle%
�*|ifdef TraceInit
�3�shell_Tracef0("WindowToggleFlags:wh%=&"+�~wh%)
�*|endif
�"open%=�shell_WindowIsOpen(wh%)
�Iblk%=�shell_HeapBlockFetch(100 + (�shell_WindowCountIcons(wh%) * 32))
�blk%!0=wh%
�!ș "Wimp_GetWindowInfo",,blk%
�flags%=blk%!32
�flags%=(flags% � mask%)
�blk%!32=flags%
� ș "Wimp_DeleteWindow",,blk%
�,ș "Wimp_CreateWindow",,blk%+4 � handle%
�!blk%=handle%
�
� open% �
�+  � If window was open, open it again..
�   ș "Wimp_OpenWindow",,blk%
��
 �shell_HeapBlockReturn(blk%)
� handle%<>wh% �
,  �shell_UpdateWindowHandle(wh%,handle%)
  wh%=handle%
�
�
:
&*|Stop PROCshell_WindowToggleFlags

	%*|Start PROCshell_ListClickSelect

� �shell_ListClickSelect
*� e_list%,ptr%,list_size%,temp%,temp2%
e_list%=_U%!12

,list_size%=�shell_HeapBlockInfo(e_list%)
*|ifdef TraceInit
�shell_Tracef0(" ")
1�shell_Tracef0("List of ClickSelect events:")
*|endif

ptr%=0
�
1  temp%=e_list%!(ptr%+20):temp2%=e_list%+ptr%
'  � �shell_HeapBlockExists(temp%) �
    � $temp%<>"" �
*|ifdef TraceInit
�  �shell_Tracef0("&"+�shell_StringPadTrailing(�~temp2%!0," ",8)+" &"+�shell_StringPadTrailing(�~temp2%!4," ",8)+"   "+$temp%)
*|endif
	    �
  �
  ptr%+=48
� (ptr%>=list_size%)
*|ifdef TraceInit
�shell_Tracef0(" ")
 *|endif
!�
":
#$*|Stop PROCshell_ListClickSelect
$%*|Start PROCshell_ListClickAdjust
%� �shell_ListClickAdjust
&*� e_list%,ptr%,list_size%,temp%,temp2%
'e_list%=_U%!12
(,list_size%=�shell_HeapBlockInfo(e_list%)
)*|ifdef TraceInit
*�shell_Tracef0(" ")
+1�shell_Tracef0("List of ClickAdjust events:")
,*|endif
-
ptr%=0
.�
/1  temp%=e_list%!(ptr%+24):temp2%=e_list%+ptr%
0'  � �shell_HeapBlockExists(temp%) �
1    � $temp%<>"" �
2*|ifdef TraceInit
3�  �shell_Tracef0("&"+�shell_StringPadTrailing(�~temp2%!0," ",8)+" &"+�shell_StringPadTrailing(�~temp2%!4," ",8)+"   "+$temp%)
4*|endif
5	    �
6  �
7  ptr%+=48
8� (ptr%>=list_size%)
9*|ifdef TraceInit
:�shell_Tracef0(" ")
;*|endif
<�
=:
>$*|Stop PROCshell_ListClickAdjust
?"*|Start PROCshell_ListHelpTags
@� �shell_ListHelpTags
A*� e_list%,ptr%,list_size%,temp%,temp2%
Be_list%=_U%!12
C,list_size%=�shell_HeapBlockInfo(e_list%)
D*|ifdef TraceInit
E�shell_Tracef0(" ")
F1�shell_Tracef0("List of attached help tags:")
G*|endif
H
ptr%=0
I�
J1  temp%=e_list%!(ptr%+44):temp2%=e_list%+ptr%
K'  � �shell_HeapBlockExists(temp%) �
L    � $temp%<>"" �
M*|ifdef TraceInit
N�  �shell_Tracef0("&"+�shell_StringPadTrailing(�~temp2%!0," ",8)+" &"+�shell_StringPadTrailing(�~temp2%!4," ",8)+"   "+$temp%)
O*|endif
P	    �
Q  �
R  ptr%+=48
S� (ptr%>=list_size%)
T*|ifdef TraceInit
U�shell_Tracef0(" ")
V*|endif
W�
X:
Y!*|Stop PROCshell_ListHelpTags
Z*|Start PROCshell_MemFill
[-� �shell_MemFill(start%,nr_bytes%,value%)
\� I%,nr_words%,remainder%
]nr_words%=nr_bytes% � 4
^remainder%=nr_bytes% � 4
_� nr_words%>0 �
`   � I%=1 � (nr_words%*4) � 4
a    start%!(I%-1)=value%
b
  � I%
c�
d� remainder%>0 �
e!  start%=start%+(nr_words%*4)
f  � I%=0 � remainder%-1
g    start%?I%=value%
h
  � I%
i�
j�
k:
l*|Stop PROCshell_MemFill
m
n$*|Start PROCshell_AttachFontMenu
o*|Define Using_FontMenu
p6� �shell_AttachFontMenu(wh%,ih%,sel_fn$,maker_fn$)
q� menu%
r�shell_FontMenuInit
s/ș "FontMenu_Select",""+�0,_U%!260 � ,menu%
t&� Store menu ptr in shell memory..
u_U%!252=menu%
v)�shell_EventAdd(wh%,ih%,0,-2,sel_fn$)
w*|ifdef PROCshell_TraceInit
x8�shell_Tracef0("AttachFontMenu:Attaching font menu")
y*|endif
z?� maker_fn$<>"" � �shell_AttachMenuMaker(wh%,ih%,maker_fn$)
{�
|:
}#*|Stop PROCshell_AttachFontMenu
~
'*|Start PROCshell_AttachFontSubMenu
�*|Define Using_FontMenu
�6� �shell_AttachFontSubMenu(item%,warn_fn$,sel_fn$)
�!� itemstart%,menu%,temp%,ctr%
��shell_FontMenuInit
�/ș "FontMenu_Select",""+�0,_U%!260 � ,menu%
�%ș "MenuUtil_SubMenu",item%,menu%
�ș "MenuUtil_Warning",,�
�&� Store menu ptr in shell memory..
�_U%!252=menu%
�:�shell_EventListMenuWarn(item%,menu%,warn_fn$,sel_fn$)
�*|ifdef PROCshell_TraceInit
�E�shell_Tracef0("AttachFontSubMenu:Attaching font menu &"+�~menu%)
�*|endif
��
�:
�&*|Stop PROCshell_AttachFontSubMenu
�
�"*|Start PROCshell_FontMenuInit
�� �shell_FontMenuInit
�@� ("RMEnsure FontMenu 1.16 RMLoad <EvntShell$Path>FontMenu")
�D� ("RMEnsure FontMenu 1.16 Error Couldn't load FontMenu module")
�� _U%!240=-1 �
�L  � The above flag ensures that the library knows that "FontMenu_Create"
�I  � has been called. It should only be called once in a program as it
�9  � registers the program as a FontMenu module user..
�$  ș "FontMenu_Create" � _U%!240
��
�#�shell_FontMenuSelectFont("",�)
��
�:
�!*|Stop PROCshell_FontMenuInit
�(*|Start PROCshell_FontMenuSelectFont
�6� �shell_FontMenuSelectFont(fontname$,systemfont%)
�� temp%,f_menu%
�G� �shell_HeapBlockExists(_U%!244) � �shell_HeapBlockReturn(_U%!244)
�/_U%!244=�shell_HeapBlockFetch(�fontname$+1)
�"temp%=_U%!244:$temp%=fontname$
�$� systemfont%<>0 � systemfont%=1
�_U%!260=systemfont%
�5ș "FontMenu_Select",fontname$,_U%!260 � ,f_menu%
�� f_menu%<>_U%!252 �
�"  � FontMenu ptr has changed..
�'  �shell_FontMenuUpdatePtr(f_menu%)
�  _U%!252=f_menu%
��
�*|ifdef TraceInit
�@�shell_Tracef0("FontMenuSelectFont:Font is '"+fontname$+"'")
�*|endif
��
�:
�'*|Stop PROCshell_FontMenuSelectFont
�/*|Start FNshell_FontMenuGetLastSelectedFont
�(� �shell_FontMenuGetLastSelectedFont
�� temp%
�.� � �shell_HeapBlockExists(_U%!244) �  =""
�temp%=_U%!244:=$temp%
�:
�.*|Stop FNshell_FontMenuGetLastSelectedFont
�
�'*|Start PROCshell_FontMenuUpdatePtr
�$� �shell_FontMenuUpdatePtr(ptr%)
�� e_list%,ctr%
�*|ifdef TraceInit
�1�shell_Tracef0("FontMenuUpdatePtr:Started..")
�*|endif
�'� �shell_HeapBlockExists(_U%!220) �
�*|ifdef TraceInit
�;  �shell_Tracef0("FontMenuUpdatePtr:HeapBlock found..")
�*|endif
�  e_list%=_U%!220:ctr%=0
�  �
�*|ifdef TraceInit
�<  �shell_Tracef0("FontMenuUpdatePtr:Substituting ptr..")
�*|endif
�    e_list%!(ctr%+8)=ptr%
�    ctr%+=12
�  � e_list%!ctr%=-1
��
��
�:
�&*|Stop PROCshell_FontMenuUpdatePtr
�
�&*|Start PROCshell_MenuUpdateHandle
�,� �shell_MenuUpdateHandle(old_h%,new_h%)
�'� list_size%,ptr%,event_list%,menu%
�-list_size%=�shell_HeapBlockInfo(_U%!12)-8
�
ptr%=0
�found%=�
�event_list%=_U%!12
��
�"  menu%=event_list%!(ptr% + 8)
�8  � menu% = old_h% � event_list%!(ptr% + 8) = new_h%
�  ptr%+=48
�� (ptr% >= list_size%)
�'� _U%!24 = old_h% � _U%!24 = new_h%
��
�%*|Stop PROCshell_MenuUpdateHandle
�
�*|Start PROCshell_FindFont
�9� �shell_FindFont(� font$,x_pt%,y_pt%,� font_handle%)
�3� � �shell_FontIsAvailable(font$,x_pt%,y_pt%) �
�  font$="Trinity.Medium"
��
�Bș "Font_FindFont",,font$,x_pt%*16,y_pt%*16,0,0 � font_handle%
��
�:
�*|Stop PROCshell_FindFont
�
�#*|Start FNshell_FontIsAvailable
�/� �shell_FontIsAvailable(font$,x_pt%,y_pt%)
�� �
�� � �:� �:=�
�Cș "Font_FindFont",0,font$,x_pt%*16,y_pt%*16,0,0 � font_handle%
�#ș "Font_LoseFont",font_handle%
�=�
�:
�"*|Stop FNshell_FontIsAvailable
�
�"*|Start FNshell_CheckSelection
�!� �shell_CheckSelection(sel%)
�� temp%,ctr%
�temp%=_U%!256
�� temp%=0 � =-1
�� _U%!24=_U%!252 � =0
��
�#  � sel%!ctr%<>temp%!ctr% � =-1
�
  ctr%+=4
�� temp%!ctr%=-1
	=ctr%
:
!*|Stop FNshell_CheckSelection

&*|Start FNshell_MenuGetItemAddress
1� �shell_MenuGetItemAddress(menu%,selection%)
� ctr%,item_addr%
$ș "MenuUtil_Info",menu% � menu%
�
	0  item_addr%=menu%+28+((selection%!ctr%)*24)

/  menu%=item_addr%!4:� address of submenu..

  ctr%+=4
� selection%!ctr%=-1

=item_addr%
:
%*|Stop FNshell_MenuGetItemAddress

$*|Start FNshell_GetLastMouseXPos
� �shell_GetLastMouseXPos
=_U%!272
:
#*|Stop FNshell_GetLastMouseXPos

$*|Start FNshell_GetLastMouseYPos
� �shell_GetLastMouseYPos
=_U%!276
:
#*|Stop FNshell_GetLastMouseYPos

(*|Start PROCshell_UpdateWindowHandle
8� �shell_UpdateWindowHandle(old_handle%,new_handle%)
*|ifdef TraceInit
 G�shell_Tracef0("UpdateWindowHandle:Updating stored window handles")
!C�shell_Tracef0("UpdateWindowHandle:old handle=&"+�~old_handle%)
"C�shell_Tracef0("UpdateWindowHandle:new handle=&"+�~new_handle%)
#*|endif
$ � new_handle%<>old_handle% �
%/  � _U%!28=old_handle% � _U%!28=new_handle%
&R  �shell_FixEventBlock(old_handle%,new_handle%,_U%!12,48)  :� main event block
'Q  �shell_FixEventBlock(old_handle%,new_handle%,_U%!96,16)  :� DataLoad events
(Q  �shell_FixEventBlock(old_handle%,new_handle%,_U%!72,24)  :� DataSave events
)M  �shell_FixEventBlock(old_handle%,new_handle%,_U%!92,24)  :� Pane events
*M  �shell_FixEventBlock2(old_handle%,new_handle%,_U%!104,16):� Bump events
+O  �shell_FixEventBlock2(old_handle%,new_handle%,_U%!332,32):� Slider events
,9  �shell_UpdateStaticWindows(old_handle%,new_handle%)
-�
.�
/:
0'*|Stop PROCshell_UpdateWindowHandle
1
2)*|Start PROCshell_UpdateStaticWindows
39� �shell_UpdateStaticWindows(old_handle%,new_handle%)
4� offset%,w_list%
5*|ifdef TraceInit
6I�shell_Tracef0("UpdateStaticWindows:Correcting static window list..")
7*|endif
8w_list%=_U%!184
94offset%=�shell_SearchStatic(_U%!184,old_handle%)
:w_list%!offset%=new_handle%
;�
<:
=(*|Stop PROCshell_UpdateStaticWindows
>
?#*|Start PROCshell_FixEventBlock
@G� �shell_FixEventBlock(old_handle%,new_handle%,event_list%,offset%)
A� ptr%,list_size%
B+� �shell_HeapBlockExists(event_list%) �
C4  list_size%=�shell_HeapBlockInfo(event_list%)-8
D  �
E*    � (event_list%!ptr%=old_handle%) �
F&      event_list%!ptr%=new_handle%
G	    �
H    ptr%+=offset%
I  � (ptr%>=list_size%)
J�
K�
L:
M"*|Stop PROCshell_FixEventBlock
N
O$*|Start PROCshell_FixEventBlock2
PH� �shell_FixEventBlock2(old_handle%,new_handle%,event_list%,offset%)
Q� ptr%,list_size%
R+ptr% = 4 :� first word is always size..
S+� �shell_HeapBlockExists(event_list%) �
T  list_size% = !event_list%
U  �
V,    � (event_list%!ptr% = old_handle%) �
W*      event_list%!ptr%   = new_handle%
X	    �
Y    ptr% += offset%
Z  � (ptr%> = list_size%)
[�
\�
]:
^#*|Stop PROCshell_FixEventBlock2
_
`#*|Start PROCshell_IconSelectAll
a� �shell_IconSelectAll(wh%)
b
� blk%,I%
c$blk%=�shell_HeapBlockFetch(2000)
dI%=blk%+&40:!blk%=wh%
eblk%!8=1<<21:blk%!12=1<<21
f,È™ "Wimp_WhichIcon",!blk%,I%,5<<21,0<<21
g
È• !I%>-1
h  blk%!4=!I%
i"  È™ "Wimp_SetIconState",,blk%
j  I%+=4
k�
l �shell_HeapBlockReturn(blk%)
m�
n:
o"*|Stop PROCshell_IconSelectAll
p%*|Start PROCshell_IconDeselectAll
q!� �shell_IconDeselectAll(wh%)
r
� blk%,I%
s$blk%=�shell_HeapBlockFetch(2000)
t0I%=blk%+&40:!blk%=wh%:blk%!8=0:blk%!12=1<<21
u,È™ "Wimp_WhichIcon",!blk%,I%,5<<21,1<<21
v
È• !I%>-1
w  blk%!4=!I%
x"  È™ "Wimp_SetIconState",,blk%
y  I%+=4
z�
{ �shell_HeapBlockReturn(blk%)
|�
}:
~$*|Stop PROCshell_IconDeselectAll

�)*|Start PROCshell_Message_SaveDesktop
�$� �shell_Message_SaveDesktop(Q%)
�� boot$
�%boot$="Run "+�shell_GetAppDir+�10
�%ș "OS_GBPB",2,Q%!20,boot$,�boot$
��
�:
�(*|Stop PROCshell_Message_SaveDesktop
�
�"*|Start PROCshell_MessagesInit
�>� �shell_MessagesInit(filename$,� m_filedesc%,� m_buffer%)
�� size%,flags%
�� �
�<� � � � �:� 3,"Cannot open message file '"+filename$+"'"
�9ș "MessageTrans_FileInfo",,filename$ � flags%,,size%
�G� flags% � 1 � m_buffer%=0 � m_buffer%=�shell_HeapBlockFetch(size%)
�6ș "OS_Module",6,,,17+�(filename$) � ,,m_filedesc%
�$(m_filedesc%+16)=filename$
�9ș "MessageTrans_OpenFile",m_filedesc%,m_filedesc%+16
�*|ifdef TraceInit
�O�shell_Tracef0("MessagesInit:Message resource file '"+filename$+"' loaded")
�*|endif
��
�:
�!*|Stop PROCshell_MessagesInit
�
�!*|Start FNshell_PrinterOnLine
�� �shell_PrinterOnLine
�� inbuf%,online%
�inbuf%=�(-4)
��2,1,0,1,0,1,0
��=0:�:� �>30
�online%=�(�(-4)<inbuf%)
�*FX21,3
��3
�=online%
�:
� *|Stop FNshell_PrinterOnLine
�
�'*|Start PROCshell_AttachBumpHandler
�e� �shell_AttachBumpHandler(wh%,ih%,incr%,decr%,l_limit%,u_limit%,step%,wrap%,disp_fn$,decode_fn$)
�0� e_blk%,offset%,temp%,temp2%,bump_info_blk%
�
�*� format of bump handler event block..
�� +00 window handle
�� +04 bump icon handle
�'� +08 step size (-ve for decr icon)
�&� +12 pointer to second info block
��
�� format of second block..
�� +00 display icon handle
�� +04 lower limit
�� +08 upper limit
�%� +12 pointer to display function
�,� +16 pointer to display decode function
�� +20 flags (1 byte)
��     bit 0 wrap upper
��     bit 1 wrap lower
�
�(� deal with incr% icon event first..
�>offset%=�shell_GetEventListOffset2(wh%,incr%,_U%+104,16,�)
�4e_blk%=_U%!104+offset%:� pointer to event list..
�
�0  e_blk%!0=wh%:e_blk%!4=incr%:e_blk%!8=step%
�)  e_blk%!12=�shell_HeapBlockFetch(24)
�  bump_info_blk%=e_blk%!12
�  bump_info_blk%!0=ih%
�  bump_info_blk%!4=l_limit%
�  bump_info_blk%!8=u_limit%
�  � �disp_fn$>0 �
�>    bump_info_blk%!12=�shell_HeapBlockFetch((�disp_fn$)+1)
�1    temp2%=bump_info_blk%!12:$temp2%=disp_fn$
�  �
�    bump_info_blk%!12=0
�  �
�  � �decode_fn$>0 �
�@    bump_info_blk%!16=�shell_HeapBlockFetch((�decode_fn$)+1)
�3    temp2%=bump_info_blk%!16:$temp2%=decode_fn$
�  �
�    bump_info_blk%!16=0
�  �
�<  � wrap%=-1 � bump_info_blk%!20=1 � bump_info_blk%!20=0
�
�@  offset%=�shell_GetEventListOffset2(wh%,decr%,_U%+104,16,�)
�6  e_blk%=_U%!104+offset%:� pointer to event list..
�
�5  e_blk%!0=wh%:e_blk%!4=decr%:e_blk%!8=step%*(-1)
�  e_blk%!12=bump_info_blk%
�
��
�:
�&*|Stop PROCshell_AttachBumpHandler
�
�%*|Start PROCshell_HandleBumpIcons
�6� �shell_HandleBumpIcons(offset%,wh%,ih%,_button%)
�8� display_ih%,info_blk%,e_blk%,curr_val%,_temp$,fn2%
�� new_val%,fn%
�� _button% <> 2 �
�  e_blk%=_U%!104+offset%
�-  _U%!288=wh%:_U%!292=ih%:_U%!296=offset%
�!  � e_blk%!8 holds step value
�  info_blk%=e_blk%!12
�.  � info_blk%!0  holds display icon handle
�&  � info_blk%!4  holds lower limit
�&  � info_blk%!8  holds upper limit
�$  � info_blk%!20 holds wrap flag
�  fn2%=info_blk%!16
�  � fn2%<>0 �
�2    _temp$=�shell_IconGetData(wh%,info_blk%!0)
�*    curr_val%=�("FN"+$fn2%+"(_temp$)")
�  �
�8    curr_val%=�(�shell_IconGetData(wh%,info_blk%!0))
�  �
�  � _button%=1 �
�/    � button is ADJUST, invert step value..
�-    _new_val%=curr_val%+((e_blk%!8)*(-1))
�  �
�$    _new_val%=curr_val%+e_blk%!8
�  �
�  � info_blk%!20=0 �
�    � no wrap..
�7    � _new_val%>info_blk%!8 � _new_val%=info_blk%!8
�7    � _new_val%<info_blk%!4 � _new_val%=info_blk%!4
�  �
�    � wrap..
�7    � _new_val%>info_blk%!8 � _new_val%=info_blk%!4
�7    � _new_val%<info_blk%!4 � _new_val%=info_blk%!8
�  �
  fn%=info_blk%!12
  � fn%<>0 �
5    _new_val$=�("FN"+$fn%+"(_new_val%,_button%)")
  �
    _new_val$=�_new_val%
  �
  � _new_val%<>curr_val% �
8    �shell_IconPutData(wh%,info_blk%!0,_new_val$,-1)
  �
	�

�
:
$*|Stop PROCshell_HandleBumpIcons


'*|Start FNshell_WindowSetSpriteArea
0� �shell_WindowSetSpriteArea(h%,SpriteArea%)
 � blk%,new_handle%,icon%,ib%
Kblk%  = �shell_HeapBlockFetch(100 + (�shell_WindowCountIcons(h%) * 32))
!blk% = h%
!È™ "Wimp_GetWindowInfo",,blk%
blk%!68 = SpriteArea%
;�shell_IconSetSpriteArea(blk%!60,blk% + 76,SpriteArea%)
� (blk%!88) > 0 �
!  � icon% = 0 � (blk%!88) - 1
$    ib% = blk% + 92 + icon% * 32
=    �shell_IconSetSpriteArea(ib%!16,ib% + 20,SpriteArea%)

  � icon%
�
 È™ "Wimp_DeleteWindow",,blk%
2ș "Wimp_CreateWindow",,blk% + 4 � new_handle%
� new_handle% <> h% �
/  �shell_UpdateWindowHandle(h%,new_handle%)
   h% = new_handle%
!�
" �shell_HeapBlockReturn(blk%)
#= h%
$:
%&*|Stop FNshell_WindowSetSpriteArea
&
''*|Start PROCshell_IconSetSpriteArea
(2� �shell_IconSetSpriteArea(flags%,data%,area%)
)3� ((flags% � 3) = 2) � ((flags% � &100) <> 0) �
*  data%!4 = area%
+�
,�
-&*|Stop PROCshell_IconSetSpriteArea
.
/(*|Start FNshell_StrongHlpIsAvailable
0!� �shell_StrongHlpIsAvailable
1� r%,buff%
2
r% = �
3� _U%!100 � 1 << 7 �
4,  � StrongHlp initialisation succeeded..
5(  buff% = �shell_HeapBlockFetch(256)
68  r%    = �shell_OSVarExists(buff%,"StrongHelp$Dir")
7#  �shell_HeapBlockReturn(buff%)
8�
9= r%
::
;'*|Stop FNshell_StrongHlpIsAvailable
<
=*|Start FNshell_MenuNew
>� �shell_MenuNew(title$)
?
� handle%
@*|ifdef TraceInit
A@�shell_Tracef0("MenuNew:Creating new menu (" + title$ + ")")
B*|endif
C'ș "MenuUtil_New",,title$ � handle%
D
= handle%
E:
F*|Stop FNshell_MenuNew
G
H*|Start FNshell_MenuAdd
I+� �shell_MenuAdd(handle%,item$,sel_fn$)
J� ret_handle%
K*|ifdef TraceInit
L5�shell_Tracef0("MenuAdd:Adding item ("+item$+")")
M*|endif
N� sel_fn$ <> "" �
O;  ș "MenuUtil_Add",handle%,item$,sel_fn$ � ret_handle%
P�
Q3  ș "MenuUtil_Add",handle%,item$ � ret_handle%
R�
S� handle% <> ret_handle% �
T*|ifdef TraceInit
UO  �shell_Tracef0("MenuAdd:Menu handle has changed, updating event lists..")
V*|endif
W7�   PROCshell_MenuUpdateHandle(handle%,ret_handle%)
X�
Y= ret_handle%
Z:
[*|Stop FNshell_MenuAdd
\
]*|Start PROCshell_MenuTick
^*� �shell_MenuTick(item_handle%,state%)
_*È™ "MenuUtil_Tick",item_handle%,state%
`�
a:
b*|Stop PROCshell_MenuTick
c
d#*|Start PROCshell_MenuTickOnly1
e-� �shell_MenuTickOnly1(menu_handle%,pos%)
f,È™ "MenuUtil_TickOnly",menu_handle%,pos%
g�
h:
i"*|Stop PROCshell_MenuTickOnly1
j
k#*|Start PROCshell_MenuTickOnly2
l(� �shell_MenuTickOnly2(item_handle%)
m'È™ "MenuUtil_TickOnly",item_handle%
n�
o:
p"*|Stop PROCshell_MenuTickOnly2
q
r*|Start PROCshell_MenuShade
s&� �shell_MenuShade(handle%,state%)
t%È™ "MenuUtil_Fade",handle%,state%
u�
v:
w*|Stop PROCshell_MenuShade
x
y *|Start PROCshell_MenuDotted
z,� �shell_MenuDotted(item_handle%,state%)
{*È™ "MenuUtil_Dots",item_handle%,state%
|�
}:
~*|Stop PROCshell_MenuDotted

�!*|Start PROCshell_MenuColours
�.� �shell_MenuColours(item_handle%,fg%,bg%)
�.ș "MenuUtil_Colours",item_handle%,fg%,bg%
��
�:
� *|Stop PROCshell_MenuColours
�
�"*|Start PROCshell_MenuWritable
�;� �shell_MenuWritable(item_handle%,state%,size%,valid$)
�;ș "MenuUtil_Writable",item_handle%,state%,size%,valid$
��
�:
�!*|Stop PROCshell_MenuWritable
�
�!*|Start PROCshell_MenuPutData
�,� �shell_MenuPutData(item_handle%,data$)
�)ș "MenuUtil_Text",item_handle%,data$
��
�:
� *|Stop PROCshell_MenuPutData
�
�%*|Start PROCshell_MenuCallHandler
�(� �shell_MenuCallHandler(h%,_h_blk%)
�� �
�� � �:� �:�
�� �("FN"+$h%+"(_h_blk%)")
��
�:
�$*|Stop PROCshell_MenuCallHandler
�
�&*|Start PROCshell_AttachOpenWindow
�&� �shell_AttachOpenWindow(wh%,fn$)
�� blk%,temp%,offset%
�*|ifdef TraceInit
�C�shell_Tracef0("AttachOpenWindow:Attaching OpenWindow Handler")
�*|endif
�H� wh%<0 � � 99,�shell_MessageOneArg("SHELLMSG27","AttachOpenWindow")
�:offset%=�shell_GetEventListOffset(wh%,-1,_U%+304,12,�)
�blk%=_U%!304+offset%
�blk%!0=wh%:blk%!4=-1
�*blk%!8=�shell_HeapBlockFetch(�(fn$)+1)
�temp%=blk%!8:$temp%=fn$
��
�:
�%*|Stop PROCshell_AttachOpenWindow
�
�.*|Start PROCshell_AttachCloseWindowHandler
�.� �shell_AttachCloseWindowHandler(wh%,fn$)
�� blk%,temp%,offset%
�*|ifdef TraceInit
�L�shell_Tracef0("AttachCloseWindowHandler:Attaching CloseWindow Handler")
�*|endif
�I� wh%<0 � � 99,�shell_MessageOneArg("SHELLMSG27","AttachCloseWindow")
�:offset%=�shell_GetEventListOffset(wh%,-1,_U%+308,12,�)
�blk%=_U%!308+offset%
�blk%!0=wh%:blk%!4=-1
�*blk%!8=�shell_HeapBlockFetch(�(fn$)+1)
�temp%=blk%!8:$temp%=fn$
��
�:
�-*|Stop PROCshell_AttachCloseWindowHandler
�
�"*|Start PROCshell_SpriteRename
�0� �shell_SpriteRename(spritearea%,old$,new$)
�Sș "OS_SpriteOp",&200+26,spritearea%,�shell_SpriteGetPtr(spritearea%,old$),new$
��
�:
�!*|Stop PROCshell_SpriteRename
�
�$*|Start PROCshell_SpriteAreaSave
�2� �shell_SpriteAreaSave(spritearea%,filename$)
�2ș "OS_SpriteOp",&200+12,spritearea%,filename$
��
�:
�#*|Stop PROCshell_SpriteAreaSave
�
� *|Start PROCshell_EnsurePoll
�� �shell_EnsurePoll
�
� action%
��
�(  action% = �shell_Poll_I(0,_U%!148)
�  �shell_Action(action%)
�� action% = 0
��
�:
�*|Stop PROCshell_EnsurePoll
�
�"*|Start FNshell_WimpGetVersion
�� �shell_WimpGetVersion
�=_U%!316
�!*|Stop FNshell_WimpGetVersion
�
�"*|Start FNshell_OSCheckVersion
�%� �shell_OSCheckVersion(version%)
�:=�shell_OSModuleCheckVersion("UtilityModule",version%)
�!*|Stop FNshell_OSCheckVersion
�
�(*|Start FNshell_OSModuleCheckVersion
�2� �shell_OSModuleCheckVersion(module$,version)
�� blk%,len%,result$
�#blk%=�shell_HeapBlockFetch(256)
��("Set Module$Check Y")
�C�("RMEnsure " + module$ + " "+�version + " Set Module$Check N")
�;ș "OS_ReadVarVal","Module$Check",blk%,256,0,0 � ,,len%
�blk%?len% = 13
��("Unset Module$Check")
�result$ = $blk%
� �shell_HeapBlockReturn(blk%)
�� result$ = "N" � = � � = �
�:
�'*|Stop FNshell_OSModuleCheckVersion
�
�)*|Start PROCshell_MessageSendDataLoad
�-� �shell_MessageSendDataLoad(type%,name$)
�� m_blk%
�*m_blk%    = �shell_HeapBlockFetch(256)
�(m_blk%!00 = 256   :� Size of message
�*m_blk%!04 = 0     :� Not used on entry
�Dm_blk%!12 = 0     :� your_ref (0 = original message not a reply)
�5m_blk%!16 = 5     :� DataOpen message action code
�Jm_blk%!20 = 0     :� Normally Filer window handle containing the file 
�=m_blk%!28 = 0     :� Normally x offset of icon clicked on
�=m_blk%!32 = 0     :� Normally y offset of icon clicked on
�"m_blk%!36 = 0     :� Must be 0
�"m_blk%!40 = type% :� File type
�!$(m_blk% + 44) = name$ + �(0)
�%ș "Wimp_SendMessage",17,m_blk%,0
�"�shell_HeapBlockReturn(m_blk%)
�
:
(*|Stop PROCshell_MessageSendDataLoad

$*|Start FNshell_MenuMakeFromFile
9� �shell_MenuMakeFromFile(title$,menuselectFN$,file$)
� handle%,X%,string$
 � �shell_FileExists(file$) �
&  handle% = �shell_MenuNew(title$)
	  X% = �(file$)

  �
    string$ = �# X%
?    handle% = �shell_MenuAdd(handle%,string$,menuselectFN$)


  � �# X%
  �# X%
�

= handle%
:
#*|Stop FNshell_MenuMakeFromFile

 *|Start FNshell_BinarySearch
E� �shell_BinarySearch(_search_term$,get_termFN$,comp_FN$,lo%,hi%)
>� _pos%,m%,_wp$,off%,p%,hipos%,lopos%,lp2%,found%,missing%
hi% += 1
missing% = �
found%   = �
m%       = hi%
off%     = 0
_pos%     = m% � 2
lopos%   = lo% - 1
hipos%   = hi%
�
 (  _wp$=�("FN"+get_termFN$+"(_pos%)")
!  lastpos% = _pos%
"  � _search_term$ = _wp$ �
#    found% = �
$  �
%3    � �("FN"+comp_FN$+"(_search_term$,_wp$)") �
&      � search lower half..
'      hipos% = _pos%
(!      m%     = _pos% - lopos%
)       _pos%  = m% � 2 + off%
*	    �
+      � search upper half..
,      lopos% = _pos%
-      off%   = _pos%
.!      m%     = hipos% - _pos%
/      _pos%  = m% � 2 +off%
0	    �
1  �
2&  � lp2% = lastpos% � missing% = �
3  lp2% = lastpos%
4� found% � missing%
5!� � found% � =-1 � = lastpos%
6:
7*|Stop FNshell_BinarySearch
8
9#*|Start FNshell_IconLastClicked
:� �shell_IconLastClicked
;=_U%!32
<:
="*|Stop FNshell_IconLastClicked
>
?"*|Start FNshell_MenuGetNrItems
@)� �shell_MenuGetNrItems(menu_handle%)
A� menu%,result%,items%
B+ș "MenuUtil_Info",menu_handle% � menu%
Cmenu% += 28
D�
E  result% = (menu%?0 � &80)
F  items% += 1
G  menu%  += 24
H
� result%
I=items%
J:
K!*|Stop FNshell_MenuGetNrItems
L
M#*|Start FNshell_MenuGetNrDotted
N*� �shell_MenuGetNrDotted(menu_handle%)
O� menu%,result%,nr%
P+ș "MenuUtil_Info",menu_handle% � menu%
Qmenu% += 28 
R	�    
S  result% = (menu%?0 � &80)
T   � (menu%?0 � 2) � nr% += 1
U  menu% += 24
V� result% = -1
W	=nr% 
X:
Y#*|Stop FNshell_MenuGetNrDotted 
Z
[&*|Start FNshell_MenuGetItemHandler
\6� �shell_MenuGetItemHandler(menu_handle%,item_nr%)
]� m_sel_blk%,ptr%,handler$
^,m_sel_blk%    = �shell_HeapBlockFetch(8)
_m_sel_blk%!00 = item_nr%  
`m_sel_blk%!04 = -1 
a8ș "MenuUtil_Decode",menu_handle%,m_sel_blk% � ptr% 
b� ptr% = 0 �
c  handler$ = ""
d�
e  handler$ = $(ptr%)
f�
g'�shell_HeapBlockReturn(m_sel_blk%) 
h= handler$
i:
j%*|Stop FNshell_MenuGetItemHandler
k
l#*|Start FNshell_MenuGetItemText
m3� �shell_MenuGetItemText(menu_handle%,item_nr%)
n� m_sel_blk%,ptr%,text$
o)m_sel_blk% = �shell_HeapBlockFetch(8)
pm_sel_blk%!00 = item_nr%
qm_sel_blk%!04 = -1
r9ș "MenuUtil_Decode",menu_handle%,m_sel_blk% � ,,ptr%
stext$ = $(ptr%!12)
t&�shell_HeapBlockReturn(m_sel_blk%)
u= text$
v:
w"*|Stop FNshell_MenuGetItemText
x
y%*|Start FNshell_MenuGetItemHandle
z5� �shell_MenuGetItemHandle(menu_handle%,item_nr%)
{� m_sel_blk%,ptr%,handle%
|)m_sel_blk% = �shell_HeapBlockFetch(8)
}m_sel_blk%!00 = item_nr%
~m_sel_blk%!04 = -1
9ș "MenuUtil_Decode",menu_handle%,m_sel_blk% � ,,ptr%
�handle% = ptr%!08
�&�shell_HeapBlockReturn(m_sel_blk%)
�
= handle%
�:
�$*|Stop FNshell_MenuGetItemHandle
�
�%*|Start FNshell_MenuGetItemHeight
�,� �shell_MenuGetItemHeight(menu_handle%)
�� menu%
�+ș "MenuUtil_Info",menu_handle% � menu%
�= menu%!20
�:
�$*|Stop FNshell_MenuGetItemHeight
�
�'*|Start FNshell_MenuCalculateHeight
�.� �shell_MenuCalculateHeight(menu_handle%)
�
� height%
�Xheight% = �shell_MenuGetNrItems(menu_handle%)*�shell_MenuGetItemHeight(menu_handle%)
�;= height% + (�shell_MenuGetNrDotted(menu_handle%) * 24)
�:
�&*|Stop FNshell_MenuCalculateHeight
�
�#*|Start PROCshell_MenuSortItems
�:� �shell_MenuSortItems(menu%,compFN$,asc%,start%,end%)
�� nr_items%
�0nr_items% = �shell_MenuGetNrItems(menu%) - 1
�_shell_MS_handle% = menu%
�)� end% > nr_items% � end% = nr_items%
�ș "Hourglass_On"
�:�shell_QuickSort(compFN$,"_shell_MS_swap",asc%,0,end%)
�ș "Hourglass_Off"
��
�:
�"*|Stop PROCshell_MenuSortItems
�
�*|Start PROCshell_QuickSort
�=� �shell_QuickSort(comp_FN$,swap_FN$,_asc%,_start%,_end%)
�� _lo%,_h%,_F%,_temp%,void%
�'_lo% = _start%:_hi% = _end%:_F% = �
�)_temp% = _lo% -1 + �(_hi% + 1 - _lo%)
�,void% = �("FN"+swap_FN$+"(_lo%,_temp%)")
��
�  � _asc% = 0 �
�*    � �("FN"+comp_FN$+"(_lo%,_hi%)") �
�0      void% = �("FN"+swap_FN$+"(_lo%,_hi%)")
�      _F% = � _F%
�	    �
�  �
�*    � �("FN"+comp_FN$+"(_hi%,_lo%)") �
�0      void% = �("FN"+swap_FN$+"(_hi%,_lo%)")
�      _F% = � _F%
�	    �
�  �
�/  � _F% � _hi% = _hi% - 1 � _lo% = _lo% + 1
�� _lo% = _hi%
�U� _start% < _lo% - 1 � �shell_QuickSort(comp_FN$,swap_FN$,_asc%,_start%,_lo% - 1)
�S� _hi% + 1 < _end%   � �shell_QuickSort(comp_FN$,swap_FN$,_asc%,_hi% + 1,_end%)
��
�:
�*|Stop PROCshell_QuickSort
�
�*|Start FNshell_MS_swap
�� �_shell_MS_swap(e1%,e2%)
�� term1$,term2$,h1%,h2%
�:term1$ = �shell_MenuGetItemText(_shell_MS_handle%,e1%)
�:term2$ = �shell_MenuGetItemText(_shell_MS_handle%,e2%)
�<h1%    = �shell_MenuGetItemHandle(_shell_MS_handle%,e1%)
�<h2%    = �shell_MenuGetItemHandle(_shell_MS_handle%,e2%)
�"�shell_MenuPutData(h1%,term2$)
�"�shell_MenuPutData(h2%,term1$)
�=0
�:
�*|Stop FNshell_MS_swap
�
�*|Start FN_shell_MS_comp
�� �_shell_MS_comp(e1%,e2%)
�� term1$,term2$
�:term1$ = �shell_MenuGetItemText(_shell_MS_handle%,e1%)
�:term2$ = �shell_MenuGetItemText(_shell_MS_handle%,e2%)
�#� �term1$ < �term2$ � = � � = �
�:
�*|Stop FN_shell_MS_comp
�
�-*|Start PROCshell_WindowSetTitleRightJust
�+� �shell_WindowSetTitleRightJust(� wh%)
�%� w_blk%,t_flags%,handle%,reopen%
�&reopen% = �shell_WindowIsOpen(wh%)
�Mw_blk% = �shell_HeapBlockFetch(100 + (�shell_WindowCountIcons(wh%) * 32))
�!w_blk% = wh%
�#ș "Wimp_GetWindowInfo",,w_blk%
�t_flags% = w_blk%!60
�� (t_flags% � (1 << 3)) �
�*|ifdef TraceInit
�J  �shell_Tracef0("WindowSetTitleRightJust:title flags = &"+�~t_flags%)
�N  �shell_Tracef0("WindowSetTitleRightJust:Horizontally centred bit set..")
�T  �shell_Tracef0("WindowSetTitleRightJust:Unsetting horizontally centred bit..")
�*|endif
�$  t_flags% = t_flags% � (1 << 3)
�*|ifdef TraceInit
�J  �shell_Tracef0("WindowSetTitleRightJust:title flags = &"+�~t_flags%)
�*|endif
��
�*|ifdef TraceInit
�R  �shell_Tracef0("WindowSetTitleRightJust:Horizontally centred bit NOT set..")
�*|endif
��
�*|ifdef TraceInit
�K�shell_Tracef0("WindowSetTitleRightJust:Setting right justified bit..")
�*|endif
�"t_flags% = t_flags% � (1 << 9)
�w_blk%!60 = t_flags%
�"ș "Wimp_DeleteWindow",,w_blk%
�0ș "Wimp_CreateWindow",,w_blk% + 4 � handle%
�� wh% <> handle% �
�*|ifdef TraceInit
�I  �shell_Tracef0("WindowSetTitleRightJust:Updating window handle...")
�*|endif
�,  �shell_UpdateWindowHandle(wh%,handle%)
�  wh% = handle%
��
�.� reopen% � �shell_OpenWindow(handle%,0,0)
�"�shell_HeapBlockReturn(w_blk%)
��
�:
�,*|Stop PROCshell_WindowSetTitleRightJust
�
�.*|Start PROCshell_WindowSetTitleCentreJust
�,� �shell_WindowSetTitleCentreJust(� wh%)
%� w_blk%,t_flags%,handle%,reopen%
&reopen% = �shell_WindowIsOpen(wh%)
Mw_blk% = �shell_HeapBlockFetch(100 + (�shell_WindowCountIcons(wh%) * 32))
!w_blk% = wh%
#È™ "Wimp_GetWindowInfo",,w_blk%
t_flags% = w_blk%!60
I�shell_Tracef0("WindowSetTitleCentreJust:title flags = &"+�~t_flags%)
_�shell_Tracef0("WindowSetTitleCentreJust:t_flags% AND (1 << 3) = "+�~(t_flags% � (1 << 3)))
!� (t_flags% � (1 << 3)) = 0 �
	*|ifdef TraceInit

S  �shell_Tracef0("WindowSetTitleCentreJust:Horizontally centred bit not set..")
S  �shell_Tracef0("WindowSetTitleCentreJust:Setting horizontally centred bit..")
*|endif

$  t_flags% = t_flags% � (1 << 3)
*|ifdef TraceInit
K  �shell_Tracef0("WindowSetTitleCentreJust:title flags = &"+�~t_flags%)
*|endif
  w_blk%!60 = t_flags%
$  È™ "Wimp_DeleteWindow",,w_blk%
2  ș "Wimp_CreateWindow",,w_blk% + 4 � handle%
  � wh% <> handle% �
  *|ifdef TraceInit
L    �shell_Tracef0("WindowSetTitleCentreJust:Updating window handle...")

  *|endif
.    �shell_UpdateWindowHandle(wh%,handle%)
    wh% = handle%
  �
0  � reopen% � �shell_OpenWindow(handle%,0,0)
�

"�shell_HeapBlockReturn(w_blk%)
�
 :
!-*|Stop PROCshell_WindowSetTitleCentreJust
"
#**|Start PROCshell_IconGetSelectedIcons
$4� �shell_IconGetSelectedIcons(wh%,esg%,� i_blk%)
%� imask%
&'imask%   = (esg% << 16) + (1 << 21)
'BÈ™ "Wimp_WhichIcon",wh%,i_blk%,imask%,(esg% << 16) + (1 << 21)
(�
):
*)*|Stop PROCshell_IconGetSelectedIcons
+
,&*|Start FNshell_GetLastMouseButton
-� �shell_GetLastMouseButton
.
= _U%!320
/:
0%*|Stop FNshell_GetLastMouseButton
1
2(*|Start FNshell_GetLastWindowClicked
3!� �shell_GetLastWindowClicked
4= _U%!28
5:
6'*|Stop FNshell_GetLastWindowClicked
7
8&*|Start FNshell_GetLastIconClicked
9� �shell_GetLastIconClicked
:= _U%!32
;:
<%*|Stop FNshell_GetLastIconClicked
=
>!*|Start FNshell_IconIndirSize
?8� �shell_IconIndirSize(file_offset%,flags%,data%,X%)
@$� size%,valid_offset%,ctr%,char%
A!� (flags% � &800100) = &100 �
B  size% = data%!8
C(  � (flags% � 1) � (data%!4 <> -1) �
D    valid_offset% = data%!4
E,    �# X% = file_offset% + valid_offset%
F    ctr% = 0
G	    �
H      char% = �# X%
I      ctr% += 1
J    � char% < 32
K    size% += + ctr%
L  �
M�
N  size% = 0
O�
P= size%
Q:
R *|Stop FNshell_IconIndirSize
S
T%*|Start FNshell_StrongHlpChkFiles
U%� �shell_StrongHlpChkFiles(path$)
V� abort%
W0� � �shell_FileExists(path$ + ".HelpData") �
X"  � HelpData file is missing..
Y  abort% = -1
Z8  � 99,�shell_MessageOneArg("SHELLMSG32","HelpData")
[�
\-� � �shell_FileExists(path$ + ".Index") �
]  � Index file is missing..
^  abort% = -1
_5  � 99,�shell_MessageOneArg("SHELLMSG32","Index")
`�
a� abort% = � � = � � = �
b:
c$*|Stop FNshell_StrongHlpChkFiles
d
e$*|Start PROCshell_CaretMoveCaret
f(� �shell_CaretMoveCaret(wh%,action%)
g1� caret_blk%,current_icon%,ctr%,ptr%,icon_nr%
hctr% = 0 :ptr% = 0
i,caret_blk% = �shell_HeapBlockFetch(2048)
j.� Find current icon conatining the caret..
k*È™ "Wimp_GetCaretPosition",,caret_blk%
l� caret_blk%!4 <> -1 �
m  � There is a caret..
n"  current_icon% = caret_blk%!4
o5  � Get a list of writable icons in this window..
p<  È™ "Wimp_WhichIcon",wh%,caret_blk%,&0040E000,&0000E000
q  �
r7    � caret_blk%!ctr% = current_icon% � ptr% = ctr%
s    ctr% += 4
t  � caret_blk%!ctr% = -1
u  Ȏ action% �
v    � 0:
w      � to first icon
x       icon_nr% = !caret_blk%
y    � 1:
z      � to last icon
{*      icon_nr% = caret_blk%!(ctr% - 4)
|    � 2:
}      � to next icon
~)      � caret_blk%!(ptr% + 4) <> -1 �
,        icon_nr% = caret_blk%!(ptr% + 4)
�      �
�"        icon_nr% = !caret_blk%
�      �
�    � 3:
�      � to previous icon
�      � ptr% > 0 �
�,        icon_nr% = caret_blk%!(ptr% - 4)
�      �
�,        icon_nr% = caret_blk%!(ctr% - 4)
�      �
�  �
�Z  ș "Wimp_SetCaretPosition",wh%,icon_nr%,-1,-1,-1,�(�shell_IconGetData(wh%,icon_nr%))
��
�&�shell_HeapBlockReturn(caret_blk%)
��
�:
�#*|Stop PROCshell_CaretMoveCaret
�
�'*|Start PROCshell_CaretPutFirstIcon
�#� �shell_CaretPutFirstIcon(wh%)
� �shell_CaretMoveCaret(wh%,0)
��
�:
�&*|Stop PROCshell_CaretPutFirstIcon
�
�&*|Start PROCshell_CaretPutLastIcon
�"� �shell_CaretPutLastIcon(wh%)
� �shell_CaretMoveCaret(wh%,1)
��
�:
�%*|Stop PROCshell_CaretPutLastIcon
�
�&*|Start PROCshell_CaretPutNextIcon
�"� �shell_CaretPutNextIcon(wh%)
� �shell_CaretMoveCaret(wh%,2)
��
�:
�%*|Stop PROCshell_CaretPutNextIcon
�
�&*|Start PROCshell_CaretPutPrevIcon
�"� �shell_CaretPutPrevIcon(wh%)
� �shell_CaretMoveCaret(wh%,3)
��
�:
�%*|Stop PROCshell_CaretPutPrevIcon
�
�&*|Start PROCshell_TemplateFileInfo
�F� Returns the size of the buffer needed by "Wimp_LoadTemplate" and
�)� the number of templates in the file
�5�   Returns  0 if routine executed without errors
�,�           -1 if filename did not exist
�<�           -2 if file exists but is not a template file
�N�   If the returned result is < 0 then buffer size and number of templates
��   will be meaningless!
�
�O� �shell_TemplateFileInfo(filename$,� buff_size%,� nr_templates%,� result%)
�
� RO3%
�RO3% = �RO3_Present
�� RO3% �
�J  �shell_TemplateFileInfo3(filename$,buff_size%,nr_templates%,result%)
��
�J  �shell_TemplateFileInfo2(filename$,buff_size%,nr_templates%,result%)
��
��
�:
�%*|Stop PROCshell_TemplateFileInfo
�
�'*|Start PROCshell_TemplateFileInfo2
�P� �shell_TemplateFileInfo2(filename$,� buff_size%,� nr_templates%,� result%)
�(� pos%,total_indirsize%,largest_def%
�%� buff%,X%,data_size%,entry_type%
�-� ctr%,char%,old_ptr%,nr_icons%,j%,flags%
�Ppos% = 0:nr_templates% = 0:total_indirsize% = 0:largest_def% = 0:result% = 0
�F� First check that the filename exists and it is a template file..
�5� � �shell_FileExists(filename$) �   result% = -1
�7� �shell_FileType(filename$) <> &FEC � result% = -2
�� result% = 0 �
�*  buff%    = �shell_HeapBlockFetch(13)
�8  X%       = �(filename$)  :� Open the template file
�5  �# X%  = 16                 :� Skip header info
�  �
�!    ș "OS_GBPB",4,X%,buff%,4
�;    file_offset% = !buff%: � File offset for this entry
�    � file_offset% > 0 �
�      nr_templates%   += 1
�      indirected_size% = 0
�#      ș "OS_GBPB",4,X%,buff%,4
�E      data_size%  = !buff%         :� Size of data for this entry
�8      ș "OS_GBPB",4,X%,buff%,4   :� Read entry type
�A      entry_type% = !buff%         :� Entry type (1 = window)
�F      ș "OS_GBPB",4,X%,buff%,12  :� Read window identifier string
�G      old_ptr% = �# X%           :� Save current pointer position..
�J      �# X%  = file_offset% + 56 :� Move pointer to title flags word..
�C      ș "OS_GBPB",4,X%,buff%,4   :� Read title bar flag word..
�      flags% = !buff%
�Q      �# X% = file_offset% + 72  :� Move pointer to start of title bar data..
�I      ș "OS_GBPB",4,X%,buff%,12  :� Read 3 words of title bar data..
�Q      indirected_size%  += �shell_IconIndirSize(file_offset%,flags%,buff%,X%)
�I      �# X% =  file_offset% + 84 :� Move pointer to icon count word..
�;      ș "OS_GBPB",4,X%,buff%,4   :� Read nr of icons..
�      nr_icons% = !buff%
�      � nr_icons% > 0 �
�$        � j% = 0 � nr_icons% - 1
�8          �# X% = file_offset% + 88 + (j% * 32) + 16
�@          ș "OS_GBPB",4,X%,buff%,4 :� Read icon flag word..
�          flags% = !buff%
�8          �# X% = file_offset% + 88 + (j% * 32) + 20
�H          ș "OS_GBPB",4,X%,buff%,12  :� Read 3 words of icon data..
�U          indirected_size%  += �shell_IconIndirSize(file_offset%,flags%,buff%,X%)
�        � j%
�      �
�      �# X% = old_ptr%
�.      total_indirsize% += indirected_size%
�'      � data_size% > largest_def% �
�%        largest_def% = data_size%
�      �
�	    �
�  � file_offset% = 0
�=  �# X%                        :� Close the template file
�?  �shell_HeapBlockReturn(buff%) :� Release workspace buffer
�3  buff_size% =  largest_def% + total_indirsize%
��
��
�:
�&*|Stop PROCshell_TemplateFileInfo2
�
�'*|Start PROCshell_TemplateFileInfo3
�P� �shell_TemplateFileInfo3(filename$,� buff_size%,� nr_templates%,� result%)
5� pos%,total_indirsize%,largest_def%,file_offset%
� buff%
-� ctr%,char%,old_ptr%,nr_icons%,j%,flags%
B� Returns the size of the buffer needed by "Wimp_LoadTemplate"
-� and the number of templates in the file
Dpos% = 0:nr_templates% = 0:total_indirsize% = 0:largest_def% = 0
%buff% = �shell_HeapBlockFetch(13)
%È™ "Wimp_OpenTemplate",,filename$
�
	  $buff% = "*"

0  � the following only works on RISC OS 3...
O  ș "Wimp_LoadTemplate",,-1,,,,buff%,pos% � ,buff_size%,indirsize%,,,,pos%
  � pos% <> 0 �

?    � buff_size% > largest_def% � largest_def% = buff_size%
&    total_indirsize% += indirsize%
    nr_templates% += 1
  �
� pos% = 0
È™ "Wimp_CloseTemplate"
0buff_size% = largest_def% + total_indirsize%
!�shell_HeapBlockReturn(buff%)
�
:
&*|Stop PROCshell_TemplateFileInfo3

*|Start FNRO3_Present
� �RO3_Present
� blk%,len%,result$
;� Returns TRUE if RISC OS 3 is present, otherwise FALSE
Ablk% = �shell_HeapBlockFetch(256)     :� Claim some workspace
;�("Set RO3$Check Y")    :� Set a system variable to "Y"
M� The next line sets the system variable to "N" if RISC OS 3 or better is
 � not present.
!4�("RMEnsure UtilityModule 3.00 Set RO3$Check N")
"O� Now we check the value of the system variable by reading it into a buffer
#8ș "OS_ReadVarVal","RO3$Check",blk%,256,0,0 � ,,len%
$5� Add string terminator so that BASIC can read it
%blk%?len% = 13
&1� Unset the system variable to tidy things up
'�("Unset RO3$Check")
(result$ = $blk%
) �shell_HeapBlockReturn(blk%)
*� result$ = "N" � = � � = �
+*|Stop FNRO3_Present
,
-$*|Start FNshell_WindowCountIcons
."� �shell_WindowCountIcons(wh%)
/� w_buff%,RO3%,nr_icons%
0/� (_U%!100 � 1 << 10) � RO3% = � � RO3% = �
1� RO3% �
2*|ifdef TraceInit
3=  �shell_Tracef0("WindowCountIcons:RISC OS 3 detected..")
4*|endif
5&  � wh% = -1 � wh% = -2 :� iconbar
6*  w_buff%  = �shell_HeapBlockFetch(88)
7L  !w_buff% = wh%           :� Store window handle in first word of block
8*  È™ "Wimp_GetWindowInfo",,w_buff% + 1
9  nr_icons% = w_buff%!88
:*|ifdef TraceInit
;@  �shell_Tracef0("WindowCountIcons:nr_icons% = "+�nr_icons%)
<*|endif
=�
>*|ifdef TraceInit
?>  �shell_Tracef0("WindowCountIcons:RISC OS 3 NOT found..")
@*|endif
A-  w_buff%   = �shell_HeapBlockFetch(6000)
B  � wh% > 0 �
CN    !w_buff%  = wh%          :� Store window handle in first word of block
D(    È™ "Wimp_GetWindowInfo",,w_buff%
E    nr_icons% = w_buff%!88
F  �
G*|ifdef TraceInit
H@  �shell_Tracef0("WindowCountIcons:nr_icons% = "+�nr_icons%)
I*|endif
J�
K#�shell_HeapBlockReturn(w_buff%)
L= nr_icons%
M:
N#*|Stop FNshell_WindowCountIcons
O
P"*|Start FNshell_SliderGetValue
Q$� �shell_SliderGetValue(handle%)
R= (_U%!332 + handle%)!28
S:
T!*|Stop FNshell_SliderGetValue
U
V"*|Start PROCshell_HandleSlider
W,� �shell_HandleSlider(wh%,ih%,e_offset%)
X!� drag_blk%,x%,y%,blk%,e_blk%
Y*|ifdef TraceInit
Z<�shell_Tracef0("HandleSlider:slider drag event found..")
[*|endif
\#e_blk%    = _U%!332 + e_offset%
])drag_blk% = �shell_HeapBlockFetch(50)
^
_drag_blk%!0 = wh%
`Edrag_blk%!4 = e_blk%!8              :� icon nr of background icon
a%È™ "Wimp_GetIconState",,drag_blk%
bblk%    = _U%!328
cCblk%!00 = 0                         :� old x position of slider
dDblk%!04 = drag_blk%!16 - drag_blk%!8:� length of background icon
e6blk%!08 = ih%                       :� slider icon
f7blk%!12 = e_blk%!12                 :� display icon
gAblk%!16 = e_blk%                    :� address of event block
hFblk%!24 = e_blk%!24                 :� address of notify FN string
i
jdrag_blk%!00 = wh%
k'È™ "Wimp_GetWindowState",,drag_blk%
l$x% = drag_blk%!04 - drag_blk%!20
m$y% = drag_blk%!16 - drag_blk%!24
ndrag_blk%!04 = ih%
o%È™ "Wimp_GetIconState",,drag_blk%
p"drag_blk%!04  = 7 :� drag type
qdrag_blk%!08 += x%
rdrag_blk%!12 += y%
sdrag_blk%!16 += x%
tdrag_blk%!20 += y%
u drag_blk%!24  = drag_blk%!08
v drag_blk%!28  = drag_blk%!12
w)drag_blk%!32  = drag_blk%!24 + blk%!4
x drag_blk%!36  = drag_blk%!20
y È™ "Wimp_DragBox",,drag_blk%
z
{%�shell_HeapBlockReturn(drag_blk%)
|I_U%!100 = _U%!100 � 1 << 11 :� set 'slider drag in progress' flag bit
}�
~:
!*|Stop PROCshell_HandleSlider
�
�*|Start PROCshell_Slider
�� �shell_Slider
�>� ptr_blk%,blk%,xp%,slider%,wh%,x%,x$,t_blk%,_value%,void%
�(ptr_blk% = �shell_HeapBlockFetch(20)
�t_blk%   = _U%!328
�&ș "Wimp_GetPointerInfo",,ptr_blk%
�wh%     = ptr_blk%!12
�slider% = t_blk%!8
�xp%     = !ptr_blk%
�� xp% <> !t_blk% �
�  � value has changed..
�'  blk%  = �shell_HeapBlockFetch(50)
�  !blk% = wh%
�$  ș "Wimp_GetWindowState",,blk%
�  x% = xp% - blk%!4
�  blk%!4 = slider%
�"  ș "Wimp_GetIconState",,blk%
�   ș "Wimp_DeleteIcon",,blk%
�  blk%!04 = wh%
�  blk%!16 = x%
�$  ș "Wimp_CreateIcon",,blk% + 4
�H  ș "Wimp_ForceRedraw",wh%,blk%!8,blk%!12,blk%!8 + t_blk%!4,blk%!20
�1  _value% = �(((x% - blk%!8) * 100)/t_blk%!4)
�  temp% = t_blk%!16
�  temp%!28 = _value%
�  � t_blk%!24 <> -1 �
�4    void% = �("FN" + $(t_blk%!24) + "(_value%)")
�  �
�  � t_blk%!12 >= 0 �
�    x$ = �(_value%)
�/    �shell_IconPutData(wh%,t_blk%!12,x$,-1)
�  �
�  Ȗ
�  !t_blk% = xp%
�"  �shell_HeapBlockReturn(blk%)
��
�$�shell_HeapBlockReturn(ptr_blk%)
��
�:
�*|Stop PROCshell_Slider
�
�'*|Start FNshell_GetEventListOffset2
�D� �shell_GetEventListOffset2(wh%,ih%,event_list%,rec_size%,add%)
�C� find offset of data in event list block given the window/icon
�I� handles. returns -1 if no events found, -2 if heapblock not defined
�J� if add% is FALSE. when add is TRUE then the list is extended and the
�N� offset to the new record is returned. First word is always size of list!
�1� list_size%,ptr%,found%,offset%,empty%,temp%
�A� (!event_list% = 0 � add% = �) � = -2:� no heapblock defined
�� (!event_list% = 0) �
�5  � no heap block defined and add flag is true...
�9  !event_list% = �shell_HeapBlockFetch(rec_size% + 4)
�  temp%   = !event_list%
�  temp%!0 = rec_size%
�  temp%!4 = 0
�  temp%!8 = 0
�	  = 4
��
�temp%      = !event_list%
�list_size% = !temp%
�
�C�shell_Tracef0("GetEventListOffset2:list size is "+�list_size%)
�ptr%    = 4
�found%  = �
�offset% = -1
�empty%  = -1
�temp%   = !event_list%
��
�H  �shell_Tracef0("GetEventListOffset2:window handle=&"+�~temp%!ptr%)
�I  � when scanning list note offset of first empty record for use when
�E  � adding a new event to the list. Empty records have 0 for both
�  � window and icon handles
�  � empty% < 0 �
�?    � (temp%!ptr% = 0 � temp%!ptr% + 4 = 0) � empty% = ptr%
�  �
�  � (temp%!ptr% = wh%) �
�C    � events attached to no particular icon are registered with
�    � an icon handle of -1
�F    � PROCshell_Tracef0("GetEventListOffset2:window handle found")
�    � ih%=-1 �
�6      � icon handle is -1, so event has been found
�F      � PROCshell_Tracef0("GetEventListOffset2:icon handle is -1")
�      offset% = ptr%
�      found%  = �
�	    �
�6      � check icon handle in event block as well..
�*|ifdef PROCshell_TraceInit
�J      � PROCshell_Tracef0("GetEventListOffset2:icon handle is not -1")
�*|endif
�$      � temp%!(ptr% + 4) = ih% �
�          offset% = ptr%
�          found%  = �
�      �
�        ptr% += rec_size%
�      �
�	    �
�  �
�)    � no match, so check next event..
�    ptr% += rec_size%
�  �
�+� ((ptr% >= (list_size% + 4)) � found%)
�� found% �
�<  � PROCshell_Tracef0("GetEventListOffset2:Event found")
��
�T  � PROCshell_Tracef0("GetEventListOffset2:End of event list - event not found")
��
�� (offset% = -1 � add%) �
�  � empty% < 0 �
�7    � no empty records found to use for the new one
�     offset% = list_size% + 4
�E    !event_list% = �shell_HeapBlockExtend(!event_list%,rec_size%)
�    temp%    = !event_list%
�    temp%!0 += rec_size%
�    temp%   += offset%
�    temp%!4  = 0
�    temp%!8  = 0
�  �
�"    � re-use old deleted event
�    offset% = empty%
�  �
��
�
= offset%
�:
�&*|Stop FNshell_GetEventListOffset2
�
�$*|Start PROCshell_SliderSetValue
�,� �shell_SliderSetValue(handle%,_value%)
:� e_blk%,slider%,blk%,backgr%,max_x%,displayic%,min_x%
� min_y%,max_y%
!e_blk%    = _U%!332 + handle%
slider%   = e_blk%!04
wh%       = e_blk%!00
backgr%   = e_blk%!08
displayic%= e_blk%!12
)blk%      = �shell_HeapBlockFetch(50)
blk%!00   = wh%
	blk%!04   = backgr%

 È™ "Wimp_GetIconState",,blk%
max_x%    = blk%!16
min_x%    = blk%!08

min_y%    = blk%!12
max_y%    = blk%!20
blk%!04   = slider%
 È™ "Wimp_GetIconState",,blk%
È™ "Wimp_DeleteIcon",,blk%
blk%!04   = wh%
#� _value% > 100 � _value% = 100
� _value% <= 0 �
  _value% = 0
  blk%!16 = blk%!8
�
R  blk%!16   = min_x% + (max_x% * (_value% / 100)) - (min_x% * (_value% / 100))
�
e_blk%!28 = _value%
"È™ "Wimp_CreateIcon",,blk% + 4
9È™ "Wimp_ForceRedraw",wh%,min_x%,min_y%,max_x%,max_y%
� e_blk%!24 <> -1 �
1 void% = �("FN" + $(e_blk%!24) + "(_value%)")
�
 � displayic% >= 0 �
!3  �shell_IconPutData(wh%,displayic%,�_value%,�)
"�
# �shell_HeapBlockReturn(blk%)
$�
%:
&#*|Stop PROCshell_SliderSetValue
'
()*|Start PROCshell_AttachSliderHandler
)[� �shell_AttachSliderHandler(wh%,backgic%,slideric%,dispic%,incric%,decric%,notify_fn$)
*� e_blk%,offset%
+
,,� format of slider handler event block..
-�
.� Each Event...
/�  +00 window handle
0%�  +04 icon handle of slider icon
1)�  +08 icon handle of background icon
29�  +12 icon handle of value display icon (-1 if none)
39�  +16 icon handle of bump up icon       (-1 if none)
49�  +20 icon handle of bump down icon     (-1 if none)
5S�  +24 pointer to block containing FN name to call on value change (-1 if none)
6�  +28 slider value
7
8F� first set up event block to handle clicks on slider bar itself..
9Foffset% = �shell_GetEventListOffset2(wh%,slideric%,_U% + 332,32,�)
:;e_blk%  = _U%!332 + offset% : � pointer to event list..
;
<e_blk%!00    = wh%
=e_blk%!04    = slideric%
>e_blk%!08    = backgic%
?e_blk%!12    = dispic%
@e_blk%!16    = incric%
Ae_blk%!20    = decric%
B� notify_fn$ <> "" �
C;  e_blk%!24    = �shell_HeapBlockFetch(�notify_fn$ + 1)
D  $(e_blk%!24) = notify_fn$
E�
F  e_blk%!24  = -1
G�
He_blk%!28    = 0
I
J7� _U%!328 = 0 � _U%!328 = �shell_HeapBlockFetch(24)
K
L=� attach click select routines to slider and background..
M=�shell_AttachClickSelect(wh%,slideric%,"_shell_icondrag")
N=�shell_AttachClickSelect(wh%,backgic%,"_shell_icondrag2")
O
P>� attach click select routines for bump icons (if present)
Q� incric% >= 0 �
RB  �shell_AttachClickSelect(wh%,incric%,"_shell_sliderbumpupS")
SD  �shell_AttachClickSelect(wh%,decric%,"_shell_sliderbumpdownS")
TD  �shell_AttachClickAdjust(wh%,incric%,"_shell_sliderbumpdownA")
UB  �shell_AttachClickAdjust(wh%,decric%,"_shell_sliderbumpupA")
V�
W
X
= offset%
Y:
Z(*|Stop PROCshell_AttachSliderHandler
[
\*|Start FN_shell_icondrag
]� �_shell_icondrag(wh%,ih%)
^�shell_IconDragBox(wh%,ih%)
_=0
`:
a*|Stop FN_shell_icondrag
b
c*|Start FN_shell_icondrag2
d � �_shell_icondrag2(wh%,ih%)
e,� e_size%,e_blk%,e_ptr%,found%,slideric%
fe_blk%  = _U%!332
ge_size% = !e_blk%
he_ptr%  = 4
i3�shell_Tracef0("Event block size is "+�e_size%)
j�
k=  � scan for background icon handle in slider event block
l#  � e_blk%!(e_ptr% + 8) = ih% �
m4    found% = � : slideric% = e_blk%!(e_ptr% + 4)
n  �
o  e_ptr% += 32
p � e_ptr% >= e_size% � found%
q%�shell_IconDragBox(wh%,slideric%)
r=0
s:
t*|Stop FN_shell_icondrag2
u
v"*|Start FN_shell_sliderbumpupS
w$� �_shell_sliderbumpupS(wh%,ih%)
x� void%
y+void% = �_shell_sliderbumpup(wh%,ih%,4)
z=0
{:
|!*|Stop FN_shell_sliderbumpupS
}
~"*|Start FN_shell_sliderbumpupA
$� �_shell_sliderbumpupA(wh%,ih%)
�� void%
�+void% = �_shell_sliderbumpup(wh%,ih%,1)
�=0
�:
�!*|Stop FN_shell_sliderbumpupA
�
�$*|Start FN_shell_sliderbumpdownS
�&� �_shell_sliderbumpdownS(wh%,ih%)
�� void%
�-void% = �_shell_sliderbumpdown(wh%,ih%,4)
�=0
�:
�#*|Stop FN_shell_sliderbumpdownS
�
�$*|Start FN_shell_sliderbumpdownA
�&� �_shell_sliderbumpdownA(wh%,ih%)
�� void%
�-void% = �_shell_sliderbumpdown(wh%,ih%,1)
�=0
�:
�#*|Stop FN_shell_sliderbumpdownA
�
�!*|Start FN_shell_sliderbumpup
�+� �_shell_sliderbumpup(wh%,ih%,button%)
�8� e_size%,e_blk%,e_ptr%,found%,ptr%,_value%,bump_ic%
�-�shell_Tracef0("In sliderbumpup routine")
�e_blk%  = _U%!332
�e_size% = !e_blk%
�e_ptr%  = 4
�3�shell_Tracef0("Event block size is "+�e_size%)
�1� button% = 4 � bump_ic% = 16 � bump_ic% = 20
��
�7  � scan for bump icon handle in slider event block
�*  � e_blk%!(e_ptr% + bump_ic%) = ih% �
�@    found% = � : ptr% = e_ptr% :_value% = e_blk%!(ptr% + 28)
�:    �shell_Tracef0("Current slider value = "+�_value%)
�7    �shell_Tracef0("Slider handle is     = "+�ptr%)
�  �
�  e_ptr% += 32
� � e_ptr% >= e_size% � found%
�� found% �
�-  �shell_SliderSetValue(ptr%,_value% + 1)
��
�= 0
�:
� *|Stop FN_shell_sliderbumpup
�
�#*|Start FN_shell_sliderbumpdown
�-� �_shell_sliderbumpdown(wh%,ih%,button%)
�8� e_size%,e_blk%,e_ptr%,found%,ptr%,_value%,bump_ic%
�/�shell_Tracef0("In sliderbumpdown routine")
�e_blk%  = _U%!332
�e_size% = !e_blk%
�e_ptr%  = 4
�3�shell_Tracef0("Event block size is "+�e_size%)
�1� button% = 4 � bump_ic% = 20 � bump_ic% = 16
��
�7  � scan for bump icon handle in slider event block
�*  � e_blk%!(e_ptr% + bump_ic%) = ih% �
�@    found% = � : ptr% = e_ptr% :_value% = e_blk%!(ptr% + 28)
�:    �shell_Tracef0("Current slider value = "+�_value%)
�7    �shell_Tracef0("Slider handle is     = "+�ptr%)
�  �
�  e_ptr% += 32
� � e_ptr% >= e_size% � found%
�� found% �
�-  �shell_SliderSetValue(ptr%,_value% - 1)
��
�= 0
�:
�"*|Stop FN_shell_sliderbumpdown
�
�'*|Start PROCshell_DeleteEventSlider
�'� �shell_DeleteEventSlider(wh%,ih%)
�C� if I can find which words point to a heap block they could be
�D� automatically detected and released. A general purpose routine
�.� shell_DeleteEvent could then be written!
�7� If ih%=-1 remove all events for window handle wh%
�/� offset%,blk%,list_size%,event_list%,temp%
�event_list% = _U%!332
��
�@  offset% = �shell_GetEventListOffset2(wh%,ih%,_U%+332,32,�)
�*|ifdef TraceInit
�?  �shell_Tracef0("DeleteEventSlider:offset% = " + �offset%)
�*|endif
�  � offset% >= 0 �
�    � ih%=-1 �
�*|ifdef TraceInit
�n       �shell_Tracef0("DeleteEventSlider:Deleting Slider Event (all events for window handle &"+�~wh%+")")
�*|endif
�	    �
�*|ifdef TraceInit
�{      �shell_Tracef0("DeleteEventSlider:Deleting Slider Event (window handle was &"+�~wh%+" icon handle was "+�ih%+")")
�*|endif
�	    �
�*    � event for window/icon is in list
�!    list_size% = !event_list%
�%    � offset% = list_size% - 32 �
�+      � it is the last one in this list
�      � offset% = 0 �
�(        � only one event in the list
�>        �shell_HeapBlockReturn(event_list% + offset% + 24)
�+        �shell_HeapBlockReturn(_U%!332)
�        _U%!332 = 0
�*|ifdef TraceInit
�O        �shell_Tracef0("DeleteEventSlider:No Slider events now registered")
�*|endif
�      �
�-        � more than one event in the list
�:        _U%!332 = �shell_HeapBlockExtend(_U%!332,- 32)
�!        event_list% = _U%!332
�        !event_list% -= 32
�      �
�	    �
�(      � not the last one in the list
�&      blk% = event_list% + offset%
�      blk%!0 = 0:blk%!4 = 0
�+      �shell_HeapBlockReturn(blk% + 24)
�	    �
�  �
�6  � repeat loop until offset%=-1 (event not found)
�1  � or offset%=-2 (event block doesn't exist)
�� offset% < 0
��
�:
�&*|Stop PROCshell_DeleteEventSlider
�
�'*|Start PROCshell_OpenWindowDynamic
B� �shell_OpenWindowDynamic(template$,preopen_fn$,postopen_fn$)
� h%,x_off%,y_off%,win_blk%

%�shell_CreateWindow(template$,h%)
*|ifdef TraceInit
Y�shell_Tracef0("OpenWindowDynamic:Creating new dynamic window (handle is &"+�~h%+")")
*|endif
*win_blk%   = �shell_HeapBlockFetch(36)
win_blk%!0 = h%
	&È™ "Wimp_GetWindowState",,win_blk%

,x_off% = (win_blk%!04 - win_blk%!12) / 2
,y_off% = (win_blk%!16 - win_blk%!08) / 2
$�shell_HeapBlockReturn(win_blk%)

� _U%!20 <> 0 �
+  � Delete last dynamic window opened..
  È™ "Wimp_CreateMenu",,-1
'  void%=�shell_DeleteWindow(_U%!20)
�
_U%!20 = wh%
� preopen_fn$ <> "" �
*|ifdef TraceInit
O  �shell_Tracef0("OpenWindowDynamic:Calling Pre-Open FN '"+preopen_fn$+"'")
*|endif
5  void% = �("FN" + preopen_fn$ + "(" + �h% + ")")
�
*|ifdef TraceInit
8  �shell_Tracef0("OpenWindowDynamic:No Pre-Open FN")
*|endif
�
/�shell_OpenWindowDynamic2(h%,x_off%,y_off%)
� postopen_fn$ <> "" �
*|ifdef TraceInit
 Q  �shell_Tracef0("OpenWindowDynamic:Calling Post-Open FN '"+postopen_fn$+"'")
!*|endif
"6  void% = �("FN" + postopen_fn$ + "(" + �h% + ")")
#�
$*|ifdef TraceInit
%9  �shell_Tracef0("OpenWindowDynamic:No Post-Open FN")
&*|endif
'�
(�
):
*&*|Stop PROCshell_OpenWindowDynamic
+
,'*|Start PROCshell_InteractiveHelpOn
-� �shell_InteractiveHelpOn
. � (_U%!100 � 1 << 12) <> 0 �
/�
0!  _U%!100 = _U%!100 � 1 << 12
1�
2�
3:
4&*|Stop PROCshell_InteractiveHelpOn
5
6(*|Start PROCshell_InteractiveHelpOff
7� �shell_InteractiveHelpOff
8 � (_U%!100 � 1 << 12) <> 0 �
9!  _U%!100 = _U%!100 � 1 << 12
:�
;�
<:
='*|Stop PROCshell_InteractiveHelpOff
>
?**|Start PROCshell_MessageSendPrintSave
@4� �shell_MessageSendPrintSave(FileType%,copies%)
A7� copies% > 1 � _U%!336 = copies% - 1 � _U%!336 = 0
B%�shell_DoSendPrintSave(FileType%)
C�
D:
E)*|Stop PROCshell_MessageSendPrintSave
F
G%*|Start PROCshell_DoSendPrintSave
H'� �shell_DoSendPrintSave(FileType%)
I
� msgblk%
J+msgblk%    = �shell_HeapBlockFetch(256)
K5msgblk%!0  = 256       :� length of message block
L1msgblk%!12 = 0         :� myref 0=originating
M8msgblk%!16 = &80142    :� message action (PrintSave)
N7msgblk%!20 = 0         :� destination window handle
O5msgblk%!24 = 0         :� destination icon handle
P+msgblk%!28 = 0         :� mouse x coord
Q+msgblk%!32 = 0         :� mouse y coord
R4msgblk%!36 = 256       :� estimated size of file
S'msgblk%!40 = FileType% :� file type
T'$(msgblk% + 44) = "PrintOut" + �(0)
U*|ifdef TraceInit
VF�shell_Tracef0("MessageSendPrintSave:Sending PrintSave message..")
W*|endif
X:È™ "Wimp_SendMessage",18,msgblk%,msgblk%!20,msgblk%!24
Y#�shell_HeapBlockReturn(msgblk%)
Z�
[:
\$*|Stop PROCshell_DoSendPrintSave
]
^%*|Start PROCshell_HandlePrintFile
_!� �shell_HandlePrintFile(_Q%)
`*|ifdef TraceInit
a@�shell_Tracef0("HandlePrintFile:Message_PrintFile received")
b*|endif
c�
d:
e$*|Stop PROCshell_HandlePrintFile
f
g&*|Start PROCshell_HandlePrintError
h"� �shell_HandlePrintError(_Q%)
i*|ifdef TraceInit
jB�shell_Tracef0("HandlePrintError:Message_PrintError received")
k*|endif
l�
m:
n%*|Stop PROCshell_HandlePrintError
o
p(*|Start PROCshell_HandlePrintTypeOdd
q$� �shell_HandlePrintTypeOdd(_Q%)
r*|ifdef TraceInit
sF�shell_Tracef0("HandlePrintTypeOdd:Message_PrintTypeOdd received")
t*|endif
u�
v:
w'*|Stop PROCshell_HandlePrintTypeOdd
x
y&*|Start PROCshell_HandleSetPrinter
z"� �shell_HandleSetPrinter(_Q%)
{*|ifdef TraceInit
|B�shell_Tracef0("HandleSetPrinter:Message_SetPrinter received")
}*|endif
~�
:
�%*|Stop PROCshell_HandleSetPrinter
�
�'*|Start FNshell_PrinterDriverLoaded
� � �shell_PrinterDriverLoaded
�� flgs%
�ș "XPDriver_Info" � ;flgs%
�� flgs% � 1 � = � � = �
�:
�&*|Stop FNshell_PrinterDriverLoaded
�
�(*|Start FNshell_PrinterDriverGetName
�!� �shell_PrinterDriverGetName
�� flgs%,name%
�(ș "XPDriver_Info" � ,,,,name%;flgs%
�2� flgs% � 1 � = "" � = �shell_GetString(name%)
�:
�'*|Stop FNshell_PrinterDriverGetName
�
�#*|Start FNshell_IconGetBGColour
�%� �shell_IconGetBGColour(wh%,ih%)
�� col%,icon_blk%
�'icon_blk%=�shell_HeapBlockFetch(40)
�icon_blk%!0=wh%
�icon_blk%!4=ih%
�%ș "Wimp_GetIconState",,icon_blk%
�'col% = (icon_blk%!24 >> 28) � %1111
�%�shell_HeapBlockReturn(icon_blk%)
�
= col%
�:
�"*|Stop FNshell_IconGetBGColour
�
�#*|Start FNshell_IconGetFGColour
�%� �shell_IconGetFGColour(wh%,ih%)
�� col%,icon_blk%
�'icon_blk%=�shell_HeapBlockFetch(40)
�icon_blk%!0=wh%
�icon_blk%!4=ih%
�%ș "Wimp_GetIconState",,icon_blk%
�'col% = (icon_blk%!24 >> 24) � %1111
�%�shell_HeapBlockReturn(icon_blk%)
�
= col%
�:
�"*|Stop FNshell_IconGetFGColour
�
�%*|Start PROCshell_AttachPopupMenu
�B� �shell_AttachPopupMenu(wh%,menuic%,dispic%,menu%,notify_fn$)
�G�shell_DoAttachPopupHandler(wh%,menuic%,dispic%,menu%,notify_fn$,0)
��
�:
�$*|Stop PROCshell_AttachPopupMenu
�
�+*|Start PROCshell_AttachColourPopupMenu
�H� �shell_AttachColourPopupMenu(wh%,menuic%,dispic%,menu%,notify_fn$)
�G�shell_DoAttachPopupHandler(wh%,menuic%,dispic%,menu%,notify_fn$,1)
��
�:
�**|Stop PROCshell_AttachColourPopupMenu
�
�(*|Start PROCshell_AttachPopupHandler
�M� �shell_DoAttachPopupHandler(wh%,menuic%,dispic%,menu%,notify_fn$,flag%)
�� e_blk%,offset%
�
�+� format of popup handler event block..
��
�� Each Event...
��  +00 window handle
�#�  +04 icon handle of menu icon
�9�  +08 icon handle of value display icon (-1 if none)
�S�  +12 pointer to block containing FN name to call on value change (-1 if none)
�B�  +16 flag word bit 0 set if a wimp colour menu is being used
� �  +20 menu handle to attach
�
�Doffset% = �shell_GetEventListOffset2(wh%,menuic%,_U% + 340,24,�)
�;e_blk%  = _U%!340 + offset% : � pointer to event list..
�
�e_blk%!00    = wh%
�e_blk%!04    = menuic%
�e_blk%!08    = dispic%
�� notify_fn$ <> "" �
�;  e_blk%!12    = �shell_HeapBlockFetch(�notify_fn$ + 1)
�  $(e_blk%!12) = notify_fn$
��
�  e_blk%!12  = -1
��
�e_blk%!16 = flag%
�e_blk%!20 = menu%
�
�F� wh% > 0 � menuic% >= 0 � �shell_IconSetButtonType(wh%,menuic%,3)
��
�:
�)*|Stop PROCshell_DoAttachPopupHandler
�
�#*|Start PROCshell_DoPopupSelect
�'� �shell_DoPopupSelect(_Q%,offset%)
�� e_blk%,notify_fn$
�+� format of popup handler event block..
��
�� Each Event...
��  +00 window handle
�#�  +04 icon handle of menu icon
�9�  +08 icon handle of value display icon (-1 if none)
�S�  +12 pointer to block containing FN name to call on value change (-1 if none)
�B�  +16 flag word bit 0 set if a wimp colour menu is being used
� �  +20 menu handle to attach
�e_blk%  = _U%!340 + offset%
�
�� e_blk%!12 = -1 �
�T  � no notify FN, just put menu text into display icon, or set background colour
�7  � of display icon if a colour menu is involved...
�  � e_blk%!16 = 0 �
�V    �shell_IconPutData(!e_blk%,e_blk%!08,�shell_MenuGetItemText(e_blk%!20,!_Q%),�)
�  �
�6    �shell_IconSetBGColour(!e_blk%,e_blk%!08,!_Q%)
�  �
��
�  notify_fn$ = $(e_blk%!12)
��
��
�:
�"*|Stop PROCshell_DoPopupSelect
�
�*|Start FNshell_3DEnabled
�� �shell_3DEnabled
�� val%,_3d%
�� _U%!100 � (1 << 10) �
�  � RISC OS 3 detected..
�#  ș "OS_Byte",161,140 � ,,val%
�(  � (val% � 1) � _3d% = � � _3d% = �
�
  � No RISC OS 3..
  _3d% = �
�

= _3d%
:
*|Stop FNshell_3DEnabled

 *|Start PROCshell_MenuDelete
	+� �shell_MenuDelete(handle%,recursive%)

!� ptr%,list_size%,event_list%
� handle% <> 0 �
.  È™ "XMenuUtil_Delete",handle%,recursive%

4  list_size%  = �shell_HeapBlockInfo(_U%!12) - 8
  event_list% = _U%!12
  �
.    � (event_list%!(ptr% + 8) = handle%) �
P      event_list%!(ptr% + 8) = 0 :� remove reference to menu handle (detach)
	    �
      ptr% += 48
	    �
  � (ptr% >= list_size%)
�
�
:
*|Stop PROCshell_MenuDelete

,*|Start PROCshell_HandleAttachedDataSave
0� �shell_HandleAttachedDataSave(_Q%,wh%,ih%)
0� e_offset%,blk%,name_ic%,_name$,temp%,void%
5� check filename in icon if datasave event exists
� icon was 0.....
 %�shell_DataSaveCheckName(wh%,ih%)
!D� check if an event has been registered for when the drag ends..
"?e_offset% = �shell_GetEventListOffset(wh%,-1,_U% + 72,24,�)
#� e_offset% >= 0 �
$  blk% = _U%!72 + e_offset%
%  name_ic% = blk%!16
&1  _name$   = �shell_IconGetData(wh%,name_ic%)
'  temp%    = blk%!20
(:  � $temp% <> "" � void% = �("FN" + $temp%+"(_name$)")
)�
*�
+:
,+*|Stop PROCshell_HandleAttachedDataSave
�
00000000  0d 00 01 19 f4 20 3e 45  76 6e 74 53 68 65 6c 6c  |..... >EvntShell|
00000010  3a 53 68 65 6c 6c 4c 69  62 0d 00 02 22 2a 7c 53  |:ShellLib..."*|S|
00000020  74 61 72 74 20 46 4e 73  68 65 6c 6c 5f 4c 69 62  |tart FNshell_Lib|
00000030  72 61 72 79 56 65 72 73  69 6f 6e 0d 00 03 1b dd  |raryVersion.....|
00000040  20 a4 73 68 65 6c 6c 5f  4c 69 62 72 61 72 79 56  | .shell_LibraryV|
00000050  65 72 73 69 6f 6e 0d 00  04 0f 3d 31 2e 33 33 20  |ersion....=1.33 |
00000060  2a 20 31 30 30 0d 00 05  0e f4 20 33 30 2f 30 35  |* 100..... 30/05|
00000070  2f 39 34 0d 00 06 0b f4  20 31 2e 33 33 62 0d 00  |/94..... 1.33b..|
00000080  07 20 f4 20 41 64 64 65  64 20 50 52 4f 43 73 68  |. . Added PROCsh|
00000090  65 6c 6c 5f 4d 65 6e 75  44 65 6c 65 74 65 0d 00  |ell_MenuDelete..|
000000a0  08 53 f4 20 41 64 64 65  64 20 43 61 6c 6c 69 6e  |.S. Added Callin|
000000b0  67 20 6f 66 20 44 61 74  61 53 61 76 65 20 72 6f  |g of DataSave ro|
000000c0  75 74 69 6e 65 73 20 77  68 65 6e 20 53 45 4c 45  |utines when SELE|
000000d0  43 54 20 26 20 41 44 4a  55 53 54 20 70 72 65 73  |CT & ADJUST pres|
000000e0  73 65 64 20 6f 76 65 72  20 69 63 6f 6e 20 30 20  |sed over icon 0 |
000000f0  20 0d 00 09 05 3a 0d 00  0a 21 2a 7c 53 74 6f 70  | ....:...!*|Stop|
00000100  20 46 4e 73 68 65 6c 6c  5f 4c 69 62 72 61 72 79  | FNshell_Library|
00000110  56 65 72 73 69 6f 6e 0d  00 0b 04 0d 00 0c 2f f4  |Version......./.|
00000120  20 72 6f 75 74 69 6e 65  20 74 6f 20 66 69 6e 64  | routine to find|
00000130  20 68 61 6e 64 6c 65 20  6f 66 20 70 61 72 65 6e  | handle of paren|
00000140  74 20 6e 65 65 64 65 64  2e 2e 0d 00 0d 3f f4 20  |t needed.....?. |
00000150  6f 72 20 73 65 61 72 63  68 20 61 6c 6c 20 73 75  |or search all su|
00000160  62 6d 65 6e 75 20 68 61  6e 64 6c 65 73 20 73 6f  |bmenu handles so|
00000170  20 74 68 61 74 20 69 74  20 63 61 6e 20 62 65 20  | that it can be |
00000180  63 68 61 6e 67 65 64 2e  2e 0d 00 0e 4e f4 20 6f  |changed.....N. o|
00000190  72 20 73 74 6f 72 65 20  61 20 6c 69 73 74 20 6f  |r store a list o|
000001a0  66 20 6d 65 6e 75 20 69  74 65 6d 20 68 61 6e 64  |f menu item hand|
000001b0  6c 65 73 20 74 6f 67 65  74 68 65 72 20 77 69 74  |les together wit|
000001c0  68 20 74 68 65 20 73 75  62 6d 65 6e 75 20 68 61  |h the submenu ha|
000001d0  6e 64 6c 65 73 2e 2e 0d  00 0f 04 0d 00 10 1b 2a  |ndles..........*|
000001e0  7c 53 74 61 72 74 20 50  52 4f 43 73 68 65 6c 6c  ||Start PROCshell|
000001f0  5f 45 72 72 6f 72 0d 00  11 12 dd 20 f2 73 68 65  |_Error..... .she|
00000200  6c 6c 5f 45 72 72 6f 72  0d 00 12 12 ea 20 70 6f  |ll_Error..... po|
00000210  73 25 2c 72 65 70 6f 72  74 24 0d 00 13 12 f4 20  |s%,report$..... |
00000220  4f 4e 20 45 52 52 4f 52  20 4f 46 46 0d 00 14 1d  |ON ERROR OFF....|
00000230  e7 20 9f 20 3c 3e 20 26  44 30 30 20 80 20 9f 20  |. . <> &D00 . . |
00000240  3c 3e 20 26 39 30 33 20  8c 0d 00 15 15 20 20 f4  |<> &903 .....  .|
00000250  20 66 61 74 61 6c 20 65  72 72 6f 72 2e 2e 0d 00  | fatal error....|
00000260  16 1b 20 20 c8 99 20 22  58 48 6f 75 72 67 6c 61  |..  .. "XHourgla|
00000270  73 73 5f 53 6d 61 73 68  22 0d 00 17 5e 20 20 e7  |ss_Smash"...^  .|
00000280  20 a4 73 68 65 6c 6c 5f  4f 53 43 68 65 63 6b 56  | .shell_OSCheckV|
00000290  65 72 73 69 6f 6e 28 33  29 20 80 20 a4 73 68 65  |ersion(3) . .she|
000002a0  6c 6c 5f 46 69 6c 65 45  78 69 73 74 73 28 22 52  |ll_FileExists("R|
000002b0  65 73 6f 75 72 63 65 73  3a 24 2e 52 65 73 6f 75  |esources:$.Resou|
000002c0  72 63 65 73 2e 45 64 69  74 2e 54 68 72 6f 77 42  |rces.Edit.ThrowB|
000002d0  61 63 6b 22 29 20 8c 0d  00 18 13 20 20 20 20 f2  |ack") .....    .|
000002e0  73 68 65 6c 6c 5f 45 78  69 74 0d 00 19 3d 20 20  |shell_Exit...=  |
000002f0  20 20 ff 28 22 53 65 74  20 42 61 73 69 63 24 46  |  .("Set Basic$F|
00000300  69 6c 65 20 3c 22 2b a4  73 68 65 6c 6c 5f 47 65  |ile <"+.shell_Ge|
00000310  74 41 70 70 4e 61 6d 65  2b 22 24 42 61 73 69 63  |tAppName+"$Basic|
00000320  46 69 6c 65 3e 22 29 0d  00 1a 1a 20 20 20 20 d7  |File>")....    .|
00000330  20 22 45 64 69 74 3a 54  68 72 6f 77 42 61 63 6b  | "Edit:ThrowBack|
00000340  22 0d 00 1b 07 20 20 cc  0d 00 1c 4c 20 20 20 20  |"....  ....L    |
00000350  f2 73 68 65 6c 6c 5f 45  72 72 6f 72 42 6f 78 28  |.shell_ErrorBox(|
00000360  22 55 6e 65 78 70 65 63  74 65 64 20 65 72 72 6f  |"Unexpected erro|
00000370  72 3a 2d 20 22 2b f6 24  2b 22 20 49 6e 74 65 72  |r:- "+.$+" Inter|
00000380  6e 61 6c 20 65 72 72 6f  72 20 63 6f 64 65 20 22  |nal error code "|
00000390  2b c3 9e 29 0d 00 1d 09  20 20 20 20 e0 0d 00 1e  |+..)....    ....|
000003a0  07 20 20 cd 0d 00 1f 05  cc 0d 00 20 47 20 20 f4  |.  ........ G  .|
000003b0  20 4e 6f 6e 2d 66 61 74  61 6c 20 65 72 72 6f 72  | Non-fatal error|
000003c0  20 66 72 6f 6d 20 73 68  65 6c 6c 5f 4f 4b 2c 20  | from shell_OK, |
000003d0  6f 72 20 6f 75 74 20 6f  66 20 6d 65 6d 6f 72 79  |or out of memory|
000003e0  20 65 72 72 6f 72 20 66  72 6f 6d 20 68 65 61 70  | error from heap|
000003f0  0d 00 21 3c 20 20 f4 20  6d 61 6e 61 67 65 72 20  |..!<  . manager |
00000400  72 6f 75 74 69 6e 65 73  2e 2e 2e 2e 73 74 72 69  |routines....stri|
00000410  70 20 6f 75 74 20 6e 61  6d 65 20 6f 66 20 6c 69  |p out name of li|
00000420  62 72 61 72 79 20 66 69  6c 65 2e 2e 0d 00 22 34  |brary file...."4|
00000430  20 20 70 6f 73 25 20 3d  20 a7 f6 24 2c 22 69 6e  |  pos% = ..$,"in|
00000440  20 22 20 2b 20 bd 33 34  20 2b 20 22 45 76 6e 74  | " + .34 + "Evnt|
00000450  53 68 65 6c 6c 3a 53 68  65 6c 6c 4c 69 62 22 29  |Shell:ShellLib")|
00000460  0d 00 23 2a 20 20 e7 20  70 6f 73 25 20 3e 20 30  |..#*  . pos% > 0|
00000470  20 8c 20 72 65 70 6f 72  74 24 20 3d 20 c0 f6 24  | . report$ = ..$|
00000480  2c 70 6f 73 25 20 2d 20  31 29 0d 00 24 1e 20 20  |,pos% - 1)..$.  |
00000490  f2 73 68 65 6c 6c 5f 45  72 72 6f 72 42 6f 78 28  |.shell_ErrorBox(|
000004a0  72 65 70 6f 72 74 24 29  0d 00 25 05 cd 0d 00 26  |report$)..%....&|
000004b0  19 c8 99 20 22 58 48 6f  75 72 67 6c 61 73 73 5f  |... "XHourglass_|
000004c0  53 6d 61 73 68 22 0d 00  27 13 f4 20 52 45 53 54  |Smash"..'.. REST|
000004d0  4f 52 45 20 45 52 52 4f  52 0d 00 28 05 e1 0d 00  |ORE ERROR..(....|
000004e0  29 05 3a 0d 00 2a 1a 2a  7c 53 74 6f 70 20 50 52  |).:..*.*|Stop PR|
000004f0  4f 43 73 68 65 6c 6c 5f  45 72 72 6f 72 0d 00 2b  |OCshell_Error..+|
00000500  04 0d 00 2c 18 2a 7c 53  74 61 72 74 20 50 52 4f  |...,.*|Start PRO|
00000510  43 73 68 65 6c 6c 5f 4f  4b 0d 00 2d 13 dd 20 f2  |Cshell_OK..-.. .|
00000520  73 68 65 6c 6c 5f 4f 4b  28 65 24 29 0d 00 2e 0d  |shell_OK(e$)....|
00000530  85 20 26 44 30 30 2c 65  24 0d 00 2f 05 e1 0d 00  |. &D00,e$../....|
00000540  30 05 3a 0d 00 31 17 2a  7c 53 74 6f 70 20 50 52  |0.:..1.*|Stop PR|
00000550  4f 43 73 68 65 6c 6c 5f  4f 4b 0d 00 32 04 0d 00  |OCshell_OK..2...|
00000560  33 1e 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |3.*|Start PROCsh|
00000570  65 6c 6c 5f 45 72 72 6f  72 42 6f 78 0d 00 34 19  |ell_ErrorBox..4.|
00000580  dd 20 f2 73 68 65 6c 6c  5f 45 72 72 6f 72 42 6f  |. .shell_ErrorBo|
00000590  78 28 72 24 29 0d 00 35  11 ea 20 72 25 2c 65 72  |x(r$)..5.. r%,er|
000005a0  72 5f 62 6c 6b 25 0d 00  36 1a 65 72 72 5f 62 6c  |r_blk%..6.err_bl|
000005b0  6b 25 20 3d 20 5f 73 68  65 6c 6c 5f 62 6c 6b 25  |k% = _shell_blk%|
000005c0  0d 00 37 2d 21 65 72 72  5f 62 6c 6b 25 20 3d 20  |..7-!err_blk% = |
000005d0  9f 3a 24 28 65 72 72 5f  62 6c 6b 25 20 2b 20 34  |.:$(err_blk% + 4|
000005e0  29 20 3d 20 72 24 20 2b  20 bd 28 30 29 0d 00 38  |) = r$ + .(0)..8|
000005f0  1b e7 20 9f 20 3d 20 26  44 30 30 20 84 20 9f 20  |.. . = &D00 . . |
00000600  3d 20 26 39 30 33 20 8c  0d 00 39 55 20 20 c8 99  |= &903 ...9U  ..|
00000610  20 22 58 57 69 6d 70 5f  52 65 70 6f 72 74 45 72  | "XWimp_ReportEr|
00000620  72 6f 72 22 2c 65 72 72  5f 62 6c 6b 25 2c 25 31  |ror",err_blk%,%1|
00000630  30 30 30 31 2c 22 4d 65  73 73 61 67 65 20 66 72  |0001,"Message fr|
00000640  6f 6d 20 22 20 2b 20 a4  73 68 65 6c 6c 5f 47 65  |om " + .shell_Ge|
00000650  74 41 70 70 4e 61 6d 65  20 b8 20 72 25 0d 00 3a  |tAppName . r%..:|
00000660  05 cc 0d 00 3b 3e 20 20  c8 99 20 22 58 57 69 6d  |....;>  .. "XWim|
00000670  70 5f 52 65 70 6f 72 74  45 72 72 6f 72 22 2c 65  |p_ReportError",e|
00000680  72 72 5f 62 6c 6b 25 2c  31 2c a4 73 68 65 6c 6c  |rr_blk%,1,.shell|
00000690  5f 47 65 74 41 70 70 4e  61 6d 65 20 b8 20 72 25  |_GetAppName . r%|
000006a0  0d 00 3c 05 cd 0d 00 3d  23 f4 20 49 46 20 72 25  |..<....=#. IF r%|
000006b0  3d 32 20 54 48 45 4e 20  5f 63 6c 6f 73 65 64 6f  |=2 THEN _closedo|
000006c0  77 6e 25 3d 54 52 55 45  0d 00 3e 05 e1 0d 00 3f  |wn%=TRUE..>....?|
000006d0  05 3a 0d 00 40 1d 2a 7c  53 74 6f 70 20 50 52 4f  |.:..@.*|Stop PRO|
000006e0  43 73 68 65 6c 6c 5f 45  72 72 6f 72 42 6f 78 0d  |Cshell_ErrorBox.|
000006f0  00 41 04 0d 00 42 29 2a  7c 53 74 61 72 74 20 46  |.A...B)*|Start F|
00000700  4e 73 68 65 6c 6c 5f 47  65 74 4c 61 73 74 53 65  |Nshell_GetLastSe|
00000710  63 75 72 65 46 69 6c 65  4e 61 6d 65 0d 00 43 22  |cureFileName..C"|
00000720  dd 20 a4 73 68 65 6c 6c  5f 47 65 74 4c 61 73 74  |. .shell_GetLast|
00000730  53 65 63 75 72 65 46 69  6c 65 4e 61 6d 65 0d 00  |SecureFileName..|
00000740  44 0b ea 20 74 65 6d 70  25 0d 00 45 10 74 65 6d  |D.. temp%..E.tem|
00000750  70 25 3d 5f 55 25 21 38  30 0d 00 46 13 e7 20 74  |p%=_U%!80..F.. t|
00000760  65 6d 70 25 3d 30 20 8c  20 3d 22 22 0d 00 47 0b  |emp%=0 . =""..G.|
00000770  3d 24 74 65 6d 70 25 0d  00 48 05 3a 0d 00 49 28  |=$temp%..H.:..I(|
00000780  2a 7c 53 74 6f 70 20 46  4e 73 68 65 6c 6c 5f 47  |*|Stop FNshell_G|
00000790  65 74 4c 61 73 74 53 65  63 75 72 65 46 69 6c 65  |etLastSecureFile|
000007a0  4e 61 6d 65 0d 00 4a 04  0d 00 4b 1d 2a 7c 53 74  |Name..J...K.*|St|
000007b0  61 72 74 20 46 4e 73 68  65 6c 6c 5f 47 65 74 53  |art FNshell_GetS|
000007c0  74 72 69 6e 67 0d 00 4c  20 dd 20 a4 73 68 65 6c  |tring..L . .shel|
000007d0  6c 5f 47 65 74 53 74 72  69 6e 67 28 41 64 64 72  |l_GetString(Addr|
000007e0  65 73 73 25 29 0d 00 4d  12 ea 20 53 74 72 69 6e  |ess%)..M.. Strin|
000007f0  67 24 2c 4c 65 6e 25 0d  00 4e 26 c8 95 20 28 28  |g$,Len%..N&.. ((|
00000800  41 64 64 72 65 73 73 25  3f 4c 65 6e 25 29 3e 33  |Address%?Len%)>3|
00000810  31 20 80 20 4c 65 6e 25  3c 32 35 35 29 0d 00 4f  |1 . Len%<255)..O|
00000820  1f 20 20 53 74 72 69 6e  67 24 2b 3d bd 28 41 64  |.  String$+=.(Ad|
00000830  64 72 65 73 73 25 3f 4c  65 6e 25 29 0d 00 50 0d  |dress%?Len%)..P.|
00000840  20 20 4c 65 6e 25 2b 3d  31 0d 00 51 05 ce 0d 00  |  Len%+=1..Q....|
00000850  52 0c 3d 53 74 72 69 6e  67 24 0d 00 53 05 3a 0d  |R.=String$..S.:.|
00000860  00 54 1c 2a 7c 53 74 6f  70 20 46 4e 73 68 65 6c  |.T.*|Stop FNshel|
00000870  6c 5f 47 65 74 53 74 72  69 6e 67 0d 00 55 04 0d  |l_GetString..U..|
00000880  00 56 23 2a 7c 53 74 61  72 74 20 46 4e 73 68 65  |.V#*|Start FNshe|
00000890  6c 6c 5f 47 65 74 45 76  65 6e 74 48 61 6e 64 6c  |ll_GetEventHandl|
000008a0  65 72 0d 00 57 2d dd 20  a4 73 68 65 6c 6c 5f 47  |er..W-. .shell_G|
000008b0  65 74 45 76 65 6e 74 48  61 6e 64 6c 65 72 28 77  |etEventHandler(w|
000008c0  68 25 2c 69 63 25 2c 65  5f 74 79 70 65 25 29 0d  |h%,ic%,e_type%).|
000008d0  00 58 2c ea 20 70 74 72  25 2c 65 76 65 6e 74 5f  |.X,. ptr%,event_|
000008e0  6c 69 73 74 25 2c 66 6f  75 6e 64 25 2c 6c 69 73  |list%,found%,lis|
000008f0  74 5f 73 69 7a 65 25 2c  66 6e 24 0d 00 59 15 e7  |t_size%,fn$..Y..|
00000900  20 77 68 25 3d 2d 31 20  8c 20 77 68 25 3d 2d 32  | wh%=-1 . wh%=-2|
00000910  0d 00 5a 2d 6c 69 73 74  5f 73 69 7a 65 25 3d a4  |..Z-list_size%=.|
00000920  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 49  |shell_HeapBlockI|
00000930  6e 66 6f 28 5f 55 25 21  31 32 29 2d 38 0d 00 5b  |nfo(_U%!12)-8..[|
00000940  0a 70 74 72 25 3d 30 0d  00 5c 0c 66 6f 75 6e 64  |.ptr%=0..\.found|
00000950  25 3d a3 0d 00 5d 16 65  76 65 6e 74 5f 6c 69 73  |%=...].event_lis|
00000960  74 25 3d 5f 55 25 21 31  32 0d 00 5e 0a 66 6e 24  |t%=_U%!12..^.fn$|
00000970  3d 22 22 0d 00 5f 05 f5  0d 00 60 20 20 20 e7 20  |="".._....`   . |
00000980  28 65 76 65 6e 74 5f 6c  69 73 74 25 21 70 74 72  |(event_list%!ptr|
00000990  25 3d 77 68 25 29 20 8c  0d 00 61 21 20 20 20 20  |%=wh%) ...a!    |
000009a0  c8 8e 20 65 76 65 6e 74  5f 6c 69 73 74 25 21 28  |.. event_list%!(|
000009b0  70 74 72 25 2b 34 29 20  ca 0d 00 62 0c 20 20 20  |ptr%+4) ...b.   |
000009c0  20 c9 20 2d 31 0d 00 63  32 20 20 20 20 20 20 f4  | . -1..c2      .|
000009d0  20 77 69 6e 64 6f 77 20  68 61 6e 64 6c 65 20 66  | window handle f|
000009e0  6f 75 6e 64 2c 20 69 63  6f 6e 20 68 61 6e 64 6c  |ound, icon handl|
000009f0  65 20 69 73 20 2d 31 0d  00 64 41 20 20 20 20 20  |e is -1..dA     |
00000a00  20 f4 20 63 68 65 63 6b  20 74 68 61 74 20 61 20  | . check that a |
00000a10  70 6f 69 6e 74 65 72 20  68 61 73 20 62 65 65 6e  |pointer has been|
00000a20  20 64 65 66 69 6e 65 64  20 74 6f 20 61 20 68 65  | defined to a he|
00000a30  61 70 20 62 6c 6f 63 6b  0d 00 65 40 20 20 20 20  |ap block..e@    |
00000a40  20 20 f4 20 63 6f 6e 74  61 69 6e 69 6e 67 20 61  |  . containing a|
00000a50  20 66 75 6e 63 74 69 6f  6e 20 6e 61 6d 65 20 28  | function name (|
00000a60  69 66 20 69 74 20 69 73  20 30 20 74 68 65 6e 20  |if it is 0 then |
00000a70  6e 6f 20 65 76 65 6e 74  0d 00 66 17 20 20 20 20  |no event..f.    |
00000a80  20 20 f4 20 64 65 66 69  6e 65 64 29 2e 2e 2e 0d  |  . defined)....|
00000a90  00 67 37 20 20 20 20 20  20 e7 20 65 76 65 6e 74  |.g7      . event|
00000aa0  5f 6c 69 73 74 25 21 28  70 74 72 25 2b 28 31 32  |_list%!(ptr%+(12|
00000ab0  2b 28 65 5f 74 79 70 65  25 2a 34 29 29 29 3e 26  |+(e_type%*4)))>&|
00000ac0  38 30 30 30 20 8c 0d 00  68 36 20 20 20 20 20 20  |8000 ...h6      |
00000ad0  20 20 66 6e 24 3d 24 28  65 76 65 6e 74 5f 6c 69  |  fn$=$(event_li|
00000ae0  73 74 25 21 28 70 74 72  25 2b 28 31 32 2b 28 65  |st%!(ptr%+(12+(e|
00000af0  5f 74 79 70 65 25 2a 34  29 29 29 29 0d 00 69 14  |_type%*4))))..i.|
00000b00  20 20 20 20 20 20 20 20  66 6f 75 6e 64 25 3d b9  |        found%=.|
00000b10  0d 00 6a 0b 20 20 20 20  20 20 cc 0d 00 6b 14 20  |..j.      ...k. |
00000b20  20 20 20 20 20 20 20 70  74 72 25 2b 3d 34 38 0d  |       ptr%+=48.|
00000b30  00 6c 0b 20 20 20 20 20  20 cd 0d 00 6d 09 20 20  |.l.      ...m.  |
00000b40  20 20 7f 0d 00 6e 37 20  20 20 20 20 20 f4 20 63  |  ...n7      . c|
00000b50  68 65 63 6b 20 69 63 6f  6e 20 68 61 6e 64 6c 65  |heck icon handle|
00000b60  20 69 6e 20 65 76 65 6e  74 20 62 6c 6f 63 6b 20  | in event block |
00000b70  61 73 20 77 65 6c 6c 2e  2e 2e 0d 00 6f 26 20 20  |as well.....o&  |
00000b80  20 20 20 20 e7 20 65 76  65 6e 74 5f 6c 69 73 74  |    . event_list|
00000b90  25 21 28 70 74 72 25 2b  34 29 3d 69 63 25 20 8c  |%!(ptr%+4)=ic% .|
00000ba0  0d 00 70 35 20 20 20 20  20 20 20 20 f4 20 77 69  |..p5        . wi|
00000bb0  6e 64 6f 77 2f 69 63 6f  6e 20 68 61 6e 64 6c 65  |ndow/icon handle|
00000bc0  20 65 76 65 6e 74 20 62  6c 6f 63 6b 20 66 6f 75  | event block fou|
00000bd0  6e 64 2e 2e 2e 0d 00 71  43 20 20 20 20 20 20 20  |nd.....qC       |
00000be0  20 f4 20 63 68 65 63 6b  20 74 68 61 74 20 61 20  | . check that a |
00000bf0  70 6f 69 6e 74 65 72 20  68 61 73 20 62 65 65 6e  |pointer has been|
00000c00  20 64 65 66 69 6e 65 64  20 74 6f 20 61 20 68 65  | defined to a he|
00000c10  61 70 20 62 6c 6f 63 6b  0d 00 72 42 20 20 20 20  |ap block..rB    |
00000c20  20 20 20 20 f4 20 63 6f  6e 74 61 69 6e 69 6e 67  |    . containing|
00000c30  20 61 20 66 75 6e 63 74  69 6f 6e 20 6e 61 6d 65  | a function name|
00000c40  20 28 69 66 20 69 74 20  69 73 20 30 20 74 68 65  | (if it is 0 the|
00000c50  6e 20 6e 6f 20 65 76 65  6e 74 0d 00 73 19 20 20  |n no event..s.  |
00000c60  20 20 20 20 20 20 f4 20  64 65 66 69 6e 65 64 29  |      . defined)|
00000c70  2e 2e 2e 0d 00 74 39 20  20 20 20 20 20 20 20 e7  |.....t9        .|
00000c80  20 65 76 65 6e 74 5f 6c  69 73 74 25 21 28 70 74  | event_list%!(pt|
00000c90  72 25 2b 28 31 32 2b 28  65 5f 74 79 70 65 25 2a  |r%+(12+(e_type%*|
00000ca0  34 29 29 29 3e 26 38 30  30 30 20 8c 0d 00 75 38  |4)))>&8000 ...u8|
00000cb0  20 20 20 20 20 20 20 20  20 20 66 6e 24 3d 24 28  |          fn$=$(|
00000cc0  65 76 65 6e 74 5f 6c 69  73 74 25 21 28 70 74 72  |event_list%!(ptr|
00000cd0  25 2b 28 31 32 2b 28 65  5f 74 79 70 65 25 2a 34  |%+(12+(e_type%*4|
00000ce0  29 29 29 29 0d 00 76 16  20 20 20 20 20 20 20 20  |))))..v.        |
00000cf0  20 20 66 6f 75 6e 64 25  3d b9 0d 00 77 0d 20 20  |  found%=...w.  |
00000d00  20 20 20 20 20 20 cc 0d  00 78 16 20 20 20 20 20  |      ...x.     |
00000d10  20 20 20 20 20 70 74 72  25 2b 3d 34 38 0d 00 79  |     ptr%+=48..y|
00000d20  0d 20 20 20 20 20 20 20  20 cd 0d 00 7a 0b 20 20  |.        ...z.  |
00000d30  20 20 20 20 cc 0d 00 7b  14 20 20 20 20 20 20 20  |    ...{.       |
00000d40  20 70 74 72 25 2b 3d 34  38 0d 00 7c 0b 20 20 20  | ptr%+=48..|.   |
00000d50  20 20 20 cd 0d 00 7d 09  20 20 20 20 cb 0d 00 7e  |   ...}.    ...~|
00000d60  07 20 20 cc 0d 00 7f 10  20 20 20 20 70 74 72 25  |.  .....    ptr%|
00000d70  2b 3d 34 38 0d 00 80 07  20 20 cd 0d 00 81 23 fd  |+=48....  ....#.|
00000d80  20 28 28 70 74 72 25 3e  3d 6c 69 73 74 5f 73 69  | ((ptr%>=list_si|
00000d90  7a 65 25 29 20 84 20 66  6f 75 6e 64 25 29 0d 00  |ze%) . found%)..|
00000da0  82 08 3d 66 6e 24 0d 00  83 05 3a 0d 00 84 22 2a  |..=fn$....:..."*|
00000db0  7c 53 74 6f 70 20 46 4e  73 68 65 6c 6c 5f 47 65  ||Stop FNshell_Ge|
00000dc0  74 45 76 65 6e 74 48 61  6e 64 6c 65 72 0d 00 85  |tEventHandler...|
00000dd0  04 0d 00 86 20 2a 7c 53  74 61 72 74 20 46 4e 73  |.... *|Start FNs|
00000de0  68 65 6c 6c 5f 47 65 74  45 76 65 6e 74 4d 65 6e  |hell_GetEventMen|
00000df0  75 0d 00 87 2a dd 20 a4  73 68 65 6c 6c 5f 47 65  |u...*. .shell_Ge|
00000e00  74 45 76 65 6e 74 4d 65  6e 75 28 62 75 74 74 6f  |tEventMenu(butto|
00000e10  6e 25 2c 77 68 25 2c 69  63 25 29 0d 00 88 2e ea  |n%,wh%,ic%).....|
00000e20  20 70 74 72 25 2c 65 76  65 6e 74 5f 6c 69 73 74  | ptr%,event_list|
00000e30  25 2c 66 6f 75 6e 64 25  2c 6c 69 73 74 5f 73 69  |%,found%,list_si|
00000e40  7a 65 25 2c 6d 65 6e 75  25 0d 00 89 15 e7 20 77  |ze%,menu%..... w|
00000e50  68 25 3d 2d 31 20 8c 20  77 68 25 3d 2d 32 0d 00  |h%=-1 . wh%=-2..|
00000e60  8a 2d 6c 69 73 74 5f 73  69 7a 65 25 3d a4 73 68  |.-list_size%=.sh|
00000e70  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 49 6e 66  |ell_HeapBlockInf|
00000e80  6f 28 5f 55 25 21 31 32  29 2d 38 0d 00 8b 0a 70  |o(_U%!12)-8....p|
00000e90  74 72 25 3d 30 0d 00 8c  0c 66 6f 75 6e 64 25 3d  |tr%=0....found%=|
00000ea0  a3 0d 00 8d 16 65 76 65  6e 74 5f 6c 69 73 74 25  |.....event_list%|
00000eb0  3d 5f 55 25 21 31 32 0d  00 8e 0a 66 6e 24 3d 22  |=_U%!12....fn$="|
00000ec0  22 0d 00 8f 31 f4 20 50  52 4f 43 73 68 65 6c 6c  |"...1. PROCshell|
00000ed0  5f 54 72 61 63 65 66 30  28 22 47 65 74 45 76 65  |_Tracef0("GetEve|
00000ee0  6e 74 4d 65 6e 75 3a 53  74 61 72 74 65 64 2e 2e  |ntMenu:Started..|
00000ef0  22 29 0d 00 90 3e f4 20  50 52 4f 43 73 68 65 6c  |")...>. PROCshel|
00000f00  6c 5f 54 72 61 63 65 66  30 28 22 47 65 74 45 76  |l_Tracef0("GetEv|
00000f10  65 6e 74 4d 65 6e 75 3a  62 75 74 74 6f 6e 20 69  |entMenu:button i|
00000f20  73 20 22 2b 53 54 52 24  62 75 74 74 6f 6e 25 29  |s "+STR$button%)|
00000f30  0d 00 91 3a f4 20 50 52  4f 43 73 68 65 6c 6c 5f  |...:. PROCshell_|
00000f40  54 72 61 63 65 66 30 28  22 47 65 74 45 76 65 6e  |Tracef0("GetEven|
00000f50  74 4d 65 6e 75 3a 77 69  6e 64 6f 77 20 69 73 20  |tMenu:window is |
00000f60  22 2b 53 54 52 24 77 68  25 29 0d 00 92 3a f4 20  |"+STR$wh%)...:. |
00000f70  50 52 4f 43 73 68 65 6c  6c 5f 54 72 61 63 65 66  |PROCshell_Tracef|
00000f80  30 28 22 47 65 74 45 76  65 6e 74 4d 65 6e 75 3a  |0("GetEventMenu:|
00000f90  69 63 6f 6e 20 20 20 69  73 20 22 2b 53 54 52 24  |icon   is "+STR$|
00000fa0  69 63 25 29 0d 00 93 05  f5 0d 00 94 20 20 20 e7  |ic%)........   .|
00000fb0  20 28 65 76 65 6e 74 5f  6c 69 73 74 25 21 70 74  | (event_list%!pt|
00000fc0  72 25 3d 77 68 25 29 20  8c 0d 00 95 3f 20 20 20  |r%=wh%) ....?   |
00000fd0  20 f2 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  | .shell_Tracef0(|
00000fe0  22 47 65 74 45 76 65 6e  74 4d 65 6e 75 3a 77 69  |"GetEventMenu:wi|
00000ff0  6e 64 6f 77 20 68 61 6e  64 6c 65 20 6d 61 74 63  |ndow handle matc|
00001000  68 65 64 2e 2e 22 29 20  0d 00 96 26 20 20 20 20  |hed..") ...&    |
00001010  e7 20 65 76 65 6e 74 5f  6c 69 73 74 25 21 28 70  |. event_list%!(p|
00001020  74 72 25 2b 34 29 20 3d  20 69 63 25 20 8c 0d 00  |tr%+4) = ic% ...|
00001030  97 43 20 20 20 20 20 20  f4 20 50 52 4f 43 73 68  |.C      . PROCsh|
00001040  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 47 65 74  |ell_Tracef0("Get|
00001050  45 76 65 6e 74 4d 65 6e  75 3a 69 63 6f 6e 20 68  |EventMenu:icon h|
00001060  61 6e 64 6c 65 20 6d 61  74 63 68 65 64 2e 2e 22  |andle matched.."|
00001070  29 0d 00 98 24 20 20 20  20 20 20 6d 65 6e 75 25  |)...$      menu%|
00001080  3d 65 76 65 6e 74 5f 6c  69 73 74 25 21 28 70 74  |=event_list%!(pt|
00001090  72 25 2b 38 29 0d 00 99  24 20 20 20 20 20 20 e7  |r%+8)...$      .|
000010a0  20 6d 65 6e 75 25 3d 2d  32 20 8c 20 6d 65 6e 75  | menu%=-2 . menu|
000010b0  25 3d 5f 55 25 21 32 35  32 0d 00 9a 12 20 20 20  |%=_U%!252....   |
000010c0  20 20 20 66 6f 75 6e 64  25 3d b9 0d 00 9b 09 20  |   found%=..... |
000010d0  20 20 20 cc 0d 00 9c 47  20 20 20 20 20 20 f4 20  |   ....G      . |
000010e0  50 52 4f 43 73 68 65 6c  6c 5f 54 72 61 63 65 66  |PROCshell_Tracef|
000010f0  30 28 22 47 65 74 45 76  65 6e 74 4d 65 6e 75 3a  |0("GetEventMenu:|
00001100  69 63 6f 6e 20 68 61 6e  64 6c 65 20 4e 4f 54 20  |icon handle NOT |
00001110  6d 61 74 63 68 65 64 2e  2e 22 29 0d 00 9d 2d 20  |matched..")...- |
00001120  20 20 20 20 20 f4 20 49  46 20 65 76 65 6e 74 5f  |     . IF event_|
00001130  6c 69 73 74 25 21 28 70  74 72 25 2b 34 29 20 3d  |list%!(ptr%+4) =|
00001140  20 2d 31 20 54 48 45 4e  0d 00 9e 1f 20 20 20 20  | -1 THEN....    |
00001150  20 20 f4 20 20 20 49 46  20 62 75 74 74 6f 6e 25  |  .   IF button%|
00001160  3d 32 20 54 48 45 4e 0d  00 9f 2a 20 20 20 20 20  |=2 THEN...*     |
00001170  20 f4 20 20 20 20 20 6d  65 6e 75 25 3d 65 76 65  | .     menu%=eve|
00001180  6e 74 5f 6c 69 73 74 25  21 28 70 74 72 25 2b 38  |nt_list%!(ptr%+8|
00001190  29 0d 00 a0 2e 20 20 20  20 20 20 f4 20 20 20 20  |)....      .    |
000011a0  20 49 46 20 6d 65 6e 75  25 3d 2d 32 20 54 48 45  | IF menu%=-2 THE|
000011b0  4e 20 6d 65 6e 75 25 3d  5f 55 25 21 32 35 32 0d  |N menu%=_U%!252.|
000011c0  00 a1 1b 20 20 20 20 20  20 f4 20 20 20 20 20 66  |...      .     f|
000011d0  6f 75 6e 64 25 3d 54 52  55 45 0d 00 a2 12 20 20  |ound%=TRUE....  |
000011e0  20 20 20 20 f4 20 20 20  45 4c 53 45 0d 00 a3 18  |    .   ELSE....|
000011f0  20 20 20 20 20 20 f4 20  20 20 20 20 70 74 72 25  |      .     ptr%|
00001200  2b 3d 34 38 0d 00 a4 13  20 20 20 20 20 20 f4 20  |+=48....      . |
00001210  20 20 45 4e 44 49 46 0d  00 a5 10 20 20 20 20 20  |  ENDIF....     |
00001220  20 f4 20 45 4c 53 45 0d  00 a6 14 20 20 20 20 20  | . ELSE....     |
00001230  20 f4 20 70 74 72 25 2b  3d 34 38 0d 00 a7 11 20  | . ptr%+=48.... |
00001240  20 20 20 20 20 f4 20 45  4e 44 49 46 0d 00 a8 09  |     . ENDIF....|
00001250  20 20 20 20 cd 0d 00 a9  07 20 20 cd 0d 00 aa 0e  |    .....  .....|
00001260  70 74 72 25 20 2b 3d 20  34 38 0d 00 ab 21 fd 20  |ptr% += 48...!. |
00001270  28 70 74 72 25 3e 3d 6c  69 73 74 5f 73 69 7a 65  |(ptr%>=list_size|
00001280  25 20 84 20 66 6f 75 6e  64 25 29 0d 00 ac 0a 3d  |% . found%)....=|
00001290  6d 65 6e 75 25 0d 00 ad  05 3a 0d 00 ae 1f 2a 7c  |menu%....:....*||
000012a0  53 74 6f 70 20 46 4e 73  68 65 6c 6c 5f 47 65 74  |Stop FNshell_Get|
000012b0  45 76 65 6e 74 4d 65 6e  75 0d 00 af 04 0d 00 b0  |EventMenu.......|
000012c0  26 2a 7c 53 74 61 72 74  20 46 4e 73 68 65 6c 6c  |&*|Start FNshell|
000012d0  5f 47 65 74 45 76 65 6e  74 4c 69 73 74 4f 66 66  |_GetEventListOff|
000012e0  73 65 74 0d 00 b1 43 dd  20 a4 73 68 65 6c 6c 5f  |set...C. .shell_|
000012f0  47 65 74 45 76 65 6e 74  4c 69 73 74 4f 66 66 73  |GetEventListOffs|
00001300  65 74 28 77 68 25 2c 69  68 25 2c 65 76 65 6e 74  |et(wh%,ih%,event|
00001310  5f 6c 69 73 74 25 2c 72  65 63 5f 73 69 7a 65 25  |_list%,rec_size%|
00001320  2c 61 64 64 25 29 0d 00  b2 43 f4 20 66 69 6e 64  |,add%)...C. find|
00001330  20 6f 66 66 73 65 74 20  6f 66 20 64 61 74 61 20  | offset of data |
00001340  69 6e 20 65 76 65 6e 74  20 6c 69 73 74 20 62 6c  |in event list bl|
00001350  6f 63 6b 20 67 69 76 65  6e 20 74 68 65 20 77 69  |ock given the wi|
00001360  6e 64 6f 77 2f 69 63 6f  6e 0d 00 b3 49 f4 20 68  |ndow/icon...I. h|
00001370  61 6e 64 6c 65 73 2e 20  72 65 74 75 72 6e 73 20  |andles. returns |
00001380  2d 31 20 69 66 20 6e 6f  20 65 76 65 6e 74 73 20  |-1 if no events |
00001390  66 6f 75 6e 64 2c 20 2d  32 20 69 66 20 68 65 61  |found, -2 if hea|
000013a0  70 62 6c 6f 63 6b 20 6e  6f 74 20 64 65 66 69 6e  |pblock not defin|
000013b0  65 64 0d 00 b4 4a f4 20  69 66 20 61 64 64 25 20  |ed...J. if add% |
000013c0  69 73 20 46 41 4c 53 45  2e 20 77 68 65 6e 20 61  |is FALSE. when a|
000013d0  64 64 20 69 73 20 54 52  55 45 20 74 68 65 6e 20  |dd is TRUE then |
000013e0  74 68 65 20 6c 69 73 74  20 69 73 20 65 78 74 65  |the list is exte|
000013f0  6e 64 65 64 20 61 6e 64  20 74 68 65 0d 00 b5 2b  |nded and the...+|
00001400  f4 20 6f 66 66 73 65 74  20 74 6f 20 74 68 65 20  |. offset to the |
00001410  6e 65 77 20 72 65 63 6f  72 64 20 69 73 20 72 65  |new record is re|
00001420  74 75 72 6e 65 64 2e 0d  00 b6 31 ea 20 6c 69 73  |turned....1. lis|
00001430  74 5f 73 69 7a 65 25 2c  70 74 72 25 2c 66 6f 75  |t_size%,ptr%,fou|
00001440  6e 64 25 2c 6f 66 66 73  65 74 25 2c 65 6d 70 74  |nd%,offset%,empt|
00001450  79 25 2c 74 65 6d 70 25  0d 00 b7 3c e7 20 28 21  |y%,temp%...<. (!|
00001460  65 76 65 6e 74 5f 6c 69  73 74 25 3d 30 20 80 20  |event_list%=0 . |
00001470  61 64 64 25 3d a3 29 20  8c 20 3d 2d 32 3a f4 20  |add%=.) . =-2:. |
00001480  6e 6f 20 68 65 61 70 62  6c 6f 63 6b 20 64 65 66  |no heapblock def|
00001490  69 6e 65 64 0d 00 b8 18  e7 20 28 21 65 76 65 6e  |ined..... (!even|
000014a0  74 5f 6c 69 73 74 25 3d  30 29 20 8c 0d 00 b9 35  |t_list%=0) ....5|
000014b0  20 20 f4 20 6e 6f 20 68  65 61 70 20 62 6c 6f 63  |  . no heap bloc|
000014c0  6b 20 64 65 66 69 6e 65  64 20 61 6e 64 20 61 64  |k defined and ad|
000014d0  64 20 66 6c 61 67 20 69  73 20 74 72 75 65 2e 2e  |d flag is true..|
000014e0  2e 0d 00 ba 33 20 20 21  65 76 65 6e 74 5f 6c 69  |....3  !event_li|
000014f0  73 74 25 3d a4 73 68 65  6c 6c 5f 48 65 61 70 42  |st%=.shell_HeapB|
00001500  6c 6f 63 6b 46 65 74 63  68 28 72 65 63 5f 73 69  |lockFetch(rec_si|
00001510  7a 65 25 29 0d 00 bb 2c  20 20 74 65 6d 70 25 3d  |ze%)...,  temp%=|
00001520  21 65 76 65 6e 74 5f 6c  69 73 74 25 3a 74 65 6d  |!event_list%:tem|
00001530  70 25 21 30 3d 30 3a 74  65 6d 70 25 21 34 3d 30  |p%!0=0:temp%!4=0|
00001540  0d 00 bc 08 20 20 3d 30  0d 00 bd 05 cd 0d 00 be  |....  =0........|
00001550  33 6c 69 73 74 5f 73 69  7a 65 25 3d a4 73 68 65  |3list_size%=.she|
00001560  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 49 6e 66 6f  |ll_HeapBlockInfo|
00001570  28 21 65 76 65 6e 74 5f  6c 69 73 74 25 29 2d 38  |(!event_list%)-8|
00001580  0d 00 bf 28 70 74 72 25  3d 30 3a 66 6f 75 6e 64  |...(ptr%=0:found|
00001590  25 3d a3 3a 6f 66 66 73  65 74 25 3d 2d 31 3a 65  |%=.:offset%=-1:e|
000015a0  6d 70 74 79 25 3d 2d 31  0d 00 c0 16 74 65 6d 70  |mpty%=-1....temp|
000015b0  25 3d 21 65 76 65 6e 74  5f 6c 69 73 74 25 0d 00  |%=!event_list%..|
000015c0  c1 05 f5 0d 00 c2 4f 20  20 f4 20 50 52 4f 43 73  |......O  . PROCs|
000015d0  68 65 6c 6c 5f 54 72 61  63 65 66 30 28 22 47 65  |hell_Tracef0("Ge|
000015e0  74 45 76 65 6e 74 4c 69  73 74 4f 66 66 73 65 74  |tEventListOffset|
000015f0  3a 77 69 6e 64 6f 77 20  68 61 6e 64 6c 65 3d 26  |:window handle=&|
00001600  22 2b 53 54 52 24 7e 74  65 6d 70 25 21 70 74 72  |"+STR$~temp%!ptr|
00001610  25 29 0d 00 c3 49 20 20  f4 20 77 68 65 6e 20 73  |%)...I  . when s|
00001620  63 61 6e 6e 69 6e 67 20  6c 69 73 74 20 6e 6f 74  |canning list not|
00001630  65 20 6f 66 66 73 65 74  20 6f 66 20 66 69 72 73  |e offset of firs|
00001640  74 20 65 6d 70 74 79 20  72 65 63 6f 72 64 20 66  |t empty record f|
00001650  6f 72 20 75 73 65 20 77  68 65 6e 0d 00 c4 45 20  |or use when...E |
00001660  20 f4 20 61 64 64 69 6e  67 20 61 20 6e 65 77 20  | . adding a new |
00001670  65 76 65 6e 74 20 74 6f  20 74 68 65 20 6c 69 73  |event to the lis|
00001680  74 2e 20 45 6d 70 74 79  20 72 65 63 6f 72 64 73  |t. Empty records|
00001690  20 68 61 76 65 20 30 20  66 6f 72 20 62 6f 74 68  | have 0 for both|
000016a0  0d 00 c5 1f 20 20 f4 20  77 69 6e 64 6f 77 20 61  |....  . window a|
000016b0  6e 64 20 69 63 6f 6e 20  68 61 6e 64 6c 65 73 0d  |nd icon handles.|
000016c0  00 c6 12 20 20 e7 20 65  6d 70 74 79 25 3c 30 20  |...  . empty%<0 |
000016d0  8c 0d 00 c7 37 20 20 20  20 e7 20 28 74 65 6d 70  |....7    . (temp|
000016e0  25 21 70 74 72 25 3d 30  20 80 20 74 65 6d 70 25  |%!ptr%=0 . temp%|
000016f0  21 70 74 72 25 2b 34 3d  30 29 20 8c 20 65 6d 70  |!ptr%+4=0) . emp|
00001700  74 79 25 3d 70 74 72 25  0d 00 c8 07 20 20 cd 0d  |ty%=ptr%....  ..|
00001710  00 c9 1a 20 20 e7 20 28  74 65 6d 70 25 21 70 74  |...  . (temp%!pt|
00001720  72 25 3d 77 68 25 29 20  8c 0d 00 ca 43 20 20 20  |r%=wh%) ....C   |
00001730  20 f4 20 65 76 65 6e 74  73 20 61 74 74 61 63 68  | . events attach|
00001740  65 64 20 74 6f 20 6e 6f  20 70 61 72 74 69 63 75  |ed to no particu|
00001750  6c 61 72 20 69 63 6f 6e  20 61 72 65 20 72 65 67  |lar icon are reg|
00001760  69 73 74 65 72 65 64 20  77 69 74 68 0d 00 cb 1e  |istered with....|
00001770  20 20 20 20 f4 20 61 6e  20 69 63 6f 6e 20 68 61  |    . an icon ha|
00001780  6e 64 6c 65 20 6f 66 20  2d 31 0d 00 cc 45 20 20  |ndle of -1...E  |
00001790  20 20 f4 20 50 52 4f 43  73 68 65 6c 6c 5f 54 72  |  . PROCshell_Tr|
000017a0  61 63 65 66 30 28 22 47  65 74 45 76 65 6e 74 4c  |acef0("GetEventL|
000017b0  69 73 74 4f 66 66 73 65  74 3a 77 69 6e 64 6f 77  |istOffset:window|
000017c0  20 68 61 6e 64 6c 65 20  66 6f 75 6e 64 22 29 0d  | handle found").|
000017d0  00 cd 12 20 20 20 20 e7  20 69 68 25 3d 2d 31 20  |...    . ih%=-1 |
000017e0  8c 0d 00 ce 36 20 20 20  20 20 20 f4 20 69 63 6f  |....6      . ico|
000017f0  6e 20 68 61 6e 64 6c 65  20 69 73 20 2d 31 2c 20  |n handle is -1, |
00001800  73 6f 20 65 76 65 6e 74  20 68 61 73 20 62 65 65  |so event has bee|
00001810  6e 20 66 6f 75 6e 64 0d  00 cf 45 20 20 20 20 20  |n found...E     |
00001820  20 f4 20 50 52 4f 43 73  68 65 6c 6c 5f 54 72 61  | . PROCshell_Tra|
00001830  63 65 66 30 28 22 47 65  74 45 76 65 6e 74 4c 69  |cef0("GetEventLi|
00001840  73 74 4f 66 66 73 65 74  3a 69 63 6f 6e 20 68 61  |stOffset:icon ha|
00001850  6e 64 6c 65 20 69 73 20  2d 31 22 29 0d 00 d0 16  |ndle is -1")....|
00001860  20 20 20 20 20 20 6f 66  66 73 65 74 25 3d 70 74  |      offset%=pt|
00001870  72 25 0d 00 d1 12 20 20  20 20 20 20 66 6f 75 6e  |r%....      foun|
00001880  64 25 3d b9 0d 00 d2 09  20 20 20 20 cc 0d 00 d3  |d%=.....    ....|
00001890  36 20 20 20 20 20 20 f4  20 63 68 65 63 6b 20 69  |6      . check i|
000018a0  63 6f 6e 20 68 61 6e 64  6c 65 20 69 6e 20 65 76  |con handle in ev|
000018b0  65 6e 74 20 62 6c 6f 63  6b 20 61 73 20 77 65 6c  |ent block as wel|
000018c0  6c 2e 2e 0d 00 d4 1f 2a  7c 69 66 64 65 66 20 50  |l......*|ifdef P|
000018d0  52 4f 43 73 68 65 6c 6c  5f 54 72 61 63 65 49 6e  |ROCshell_TraceIn|
000018e0  69 74 0d 00 d5 44 20 20  20 20 20 20 f2 73 68 65  |it...D      .she|
000018f0  6c 6c 5f 54 72 61 63 65  66 30 28 22 47 65 74 45  |ll_Tracef0("GetE|
00001900  76 65 6e 74 4c 69 73 74  4f 66 66 73 65 74 3a 69  |ventListOffset:i|
00001910  63 6f 6e 20 68 61 6e 64  6c 65 20 69 73 20 6e 6f  |con handle is no|
00001920  74 20 2d 31 22 29 0d 00  d6 0b 2a 7c 65 6e 64 69  |t -1")....*|endi|
00001930  66 0d 00 d7 20 20 20 20  20 20 20 e7 20 74 65 6d  |f...       . tem|
00001940  70 25 21 28 70 74 72 25  2b 34 29 3d 69 68 25 20  |p%!(ptr%+4)=ih% |
00001950  8c 0d 00 d8 1a 20 20 20  20 20 20 20 20 20 20 6f  |.....          o|
00001960  66 66 73 65 74 25 3d 70  74 72 25 0d 00 d9 16 20  |ffset%=ptr%.... |
00001970  20 20 20 20 20 20 20 20  20 66 6f 75 6e 64 25 3d  |         found%=|
00001980  b9 0d 00 da 0b 20 20 20  20 20 20 cc 0d 00 db 1b  |.....      .....|
00001990  20 20 20 20 20 20 20 20  70 74 72 25 2b 3d 72 65  |        ptr%+=re|
000019a0  63 5f 73 69 7a 65 25 0d  00 dc 0b 20 20 20 20 20  |c_size%....     |
000019b0  20 cd 0d 00 dd 09 20 20  20 20 cd 0d 00 de 07 20  | .....    ..... |
000019c0  20 cc 0d 00 df 29 20 20  20 20 f4 20 6e 6f 20 6d  | ....)    . no m|
000019d0  61 74 63 68 2c 20 73 6f  20 63 68 65 63 6b 20 6e  |atch, so check n|
000019e0  65 78 74 20 65 76 65 6e  74 2e 2e 0d 00 e0 17 20  |ext event...... |
000019f0  20 20 20 70 74 72 25 2b  3d 72 65 63 5f 73 69 7a  |   ptr%+=rec_siz|
00001a00  65 25 0d 00 e1 07 20 20  cd 0d 00 e2 23 fd 20 28  |e%....  ....#. (|
00001a10  28 70 74 72 25 3e 3d 6c  69 73 74 5f 73 69 7a 65  |(ptr%>=list_size|
00001a20  25 29 20 84 20 66 6f 75  6e 64 25 29 0d 00 e3 0e  |%) . found%)....|
00001a30  e7 20 66 6f 75 6e 64 25  20 8c 0d 00 e4 3b 20 20  |. found% ....;  |
00001a40  f4 20 50 52 4f 43 73 68  65 6c 6c 5f 54 72 61 63  |. PROCshell_Trac|
00001a50  65 66 30 28 22 47 65 74  45 76 65 6e 74 4c 69 73  |ef0("GetEventLis|
00001a60  74 4f 66 66 73 65 74 3a  45 76 65 6e 74 20 66 6f  |tOffset:Event fo|
00001a70  75 6e 64 22 29 0d 00 e5  05 cc 0d 00 e6 53 20 20  |und")........S  |
00001a80  f4 20 50 52 4f 43 73 68  65 6c 6c 5f 54 72 61 63  |. PROCshell_Trac|
00001a90  65 66 30 28 22 47 65 74  45 76 65 6e 74 4c 69 73  |ef0("GetEventLis|
00001aa0  74 4f 66 66 73 65 74 3a  45 6e 64 20 6f 66 20 65  |tOffset:End of e|
00001ab0  76 65 6e 74 20 6c 69 73  74 20 2d 20 65 76 65 6e  |vent list - even|
00001ac0  74 20 6e 6f 74 20 66 6f  75 6e 64 22 29 0d 00 e7  |t not found")...|
00001ad0  05 cd 0d 00 e8 1b e7 20  28 6f 66 66 73 65 74 25  |....... (offset%|
00001ae0  3d 2d 31 20 80 20 61 64  64 25 29 20 8c 0d 00 e9  |=-1 . add%) ....|
00001af0  12 20 20 e7 20 65 6d 70  74 79 25 3c 30 20 8c 0d  |.  . empty%<0 ..|
00001b00  00 ea 37 20 20 20 20 f4  20 6e 6f 20 65 6d 70 74  |..7    . no empt|
00001b10  79 20 72 65 63 6f 72 64  73 20 66 6f 75 6e 64 20  |y records found |
00001b20  74 6f 20 75 73 65 20 66  6f 72 20 74 68 65 20 6e  |to use for the n|
00001b30  65 77 20 6f 6e 65 0d 00  eb 1a 20 20 20 20 6f 66  |ew one....    of|
00001b40  66 73 65 74 25 3d 6c 69  73 74 5f 73 69 7a 65 25  |fset%=list_size%|
00001b50  0d 00 ec 43 20 20 20 20  21 65 76 65 6e 74 5f 6c  |...C    !event_l|
00001b60  69 73 74 25 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |ist%=.shell_Heap|
00001b70  42 6c 6f 63 6b 45 78 74  65 6e 64 28 21 65 76 65  |BlockExtend(!eve|
00001b80  6e 74 5f 6c 69 73 74 25  2c 72 65 63 5f 73 69 7a  |nt_list%,rec_siz|
00001b90  65 25 29 0d 00 ed 1a 20  20 20 20 74 65 6d 70 25  |e%)....    temp%|
00001ba0  3d 21 65 76 65 6e 74 5f  6c 69 73 74 25 0d 00 ee  |=!event_list%...|
00001bb0  2a 20 20 20 20 74 65 6d  70 25 2b 3d 6f 66 66 73  |*    temp%+=offs|
00001bc0  65 74 25 3a 74 65 6d 70  25 21 30 3d 30 3a 74 65  |et%:temp%!0=0:te|
00001bd0  6d 70 25 21 34 3d 30 0d  00 ef 07 20 20 cc 0d 00  |mp%!4=0....  ...|
00001be0  f0 22 20 20 20 20 f4 20  72 65 2d 75 73 65 20 6f  |."    . re-use o|
00001bf0  6c 64 20 64 65 6c 65 74  65 64 20 65 76 65 6e 74  |ld deleted event|
00001c00  0d 00 f1 16 20 20 20 20  6f 66 66 73 65 74 25 3d  |....    offset%=|
00001c10  65 6d 70 74 79 25 0d 00  f2 07 20 20 cd 0d 00 f3  |empty%....  ....|
00001c20  05 cd 0d 00 f4 0c 3d 6f  66 66 73 65 74 25 0d 00  |......=offset%..|
00001c30  f5 05 3a 0d 00 f6 25 2a  7c 53 74 6f 70 20 46 4e  |..:...%*|Stop FN|
00001c40  73 68 65 6c 6c 5f 47 65  74 45 76 65 6e 74 4c 69  |shell_GetEventLi|
00001c50  73 74 4f 66 66 73 65 74  0d 00 f7 04 0d 00 f8 20  |stOffset....... |
00001c60  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
00001c70  6c 5f 41 74 74 61 63 68  50 61 6e 65 0d 00 f9 40  |l_AttachPane...@|
00001c80  dd 20 f2 73 68 65 6c 6c  5f 41 74 74 61 63 68 50  |. .shell_AttachP|
00001c90  61 6e 65 28 77 68 25 2c  f8 20 70 61 6e 65 5f 68  |ane(wh%,. pane_h|
00001ca0  61 6e 64 6c 65 25 2c 66  6c 61 67 73 25 2c 78 5f  |andle%,flags%,x_|
00001cb0  6f 66 66 25 2c 79 5f 6f  66 66 25 29 0d 00 fa 34  |off%,y_off%)...4|
00001cc0  ea 20 62 6c 6b 25 2c 6f  66 66 73 65 74 25 2c 74  |. blk%,offset%,t|
00001cd0  65 6d 70 25 2c 6e 72 5f  70 61 6e 65 5f 65 76 65  |emp%,nr_pane_eve|
00001ce0  6e 74 73 25 2c 70 61 6e  65 5f 66 6c 61 67 73 25  |nts%,pane_flags%|
00001cf0  0d 00 fb 37 f2 73 68 65  6c 6c 5f 54 72 61 63 65  |...7.shell_Trace|
00001d00  66 30 28 22 41 74 74 61  63 68 50 61 6e 65 3a 41  |f0("AttachPane:A|
00001d10  74 74 61 63 68 69 6e 67  20 50 61 6e 65 20 48 61  |ttaching Pane Ha|
00001d20  6e 64 6c 65 72 22 29 0d  00 fc 47 f4 20 66 69 72  |ndler")...G. fir|
00001d30  73 74 20 63 68 65 63 6b  20 74 68 61 74 20 74 68  |st check that th|
00001d40  65 20 66 6c 61 67 73 20  6f 66 20 74 68 65 20 70  |e flags of the p|
00001d50  61 6e 65 20 77 69 6e 64  6f 77 20 61 72 65 20 63  |ane window are c|
00001d60  6f 72 72 65 63 74 6c 79  20 73 65 74 2e 2e 0d 00  |orrectly set....|
00001d70  fd 33 70 61 6e 65 5f 66  6c 61 67 73 25 3d a4 73  |.3pane_flags%=.s|
00001d80  68 65 6c 6c 5f 57 69 6e  64 6f 77 47 65 74 46 6c  |hell_WindowGetFl|
00001d90  61 67 73 28 70 61 6e 65  5f 68 61 6e 64 6c 65 25  |ags(pane_handle%|
00001da0  29 0d 00 fe 1e e7 20 28  70 61 6e 65 5f 66 6c 61  |)..... (pane_fla|
00001db0  67 73 25 20 80 20 31 3c  3c 35 29 3d 30 20 8c 0d  |gs% . 1<<5)=0 ..|
00001dc0  00 ff 51 20 20 f2 73 68  65 6c 6c 5f 54 72 61 63  |..Q  .shell_Trac|
00001dd0  65 66 30 28 22 41 74 74  61 63 68 50 61 6e 65 3a  |ef0("AttachPane:|
00001de0  27 50 61 6e 65 27 20 62  69 74 20 6f 66 20 70 61  |'Pane' bit of pa|
00001df0  6e 65 20 77 69 6e 64 6f  77 20 69 73 20 6e 6f 74  |ne window is not|
00001e00  20 73 65 74 2c 20 66 69  78 69 6e 67 2e 2e 22 29  | set, fixing..")|
00001e10  0d 01 00 31 20 20 f2 73  68 65 6c 6c 5f 57 69 6e  |...1  .shell_Win|
00001e20  64 6f 77 54 6f 67 67 6c  65 46 6c 61 67 73 28 70  |dowToggleFlags(p|
00001e30  61 6e 65 5f 68 61 6e 64  6c 65 25 2c 31 3c 3c 35  |ane_handle%,1<<5|
00001e40  29 0d 01 01 05 cd 0d 01  02 1c e7 20 28 70 61 6e  |).......... (pan|
00001e50  65 5f 66 6c 61 67 73 25  20 80 20 31 3c 3c 31 29  |e_flags% . 1<<1)|
00001e60  20 8c 0d 01 03 51 20 20  f2 73 68 65 6c 6c 5f 54  | ....Q  .shell_T|
00001e70  72 61 63 65 66 30 28 22  41 74 74 61 63 68 50 61  |racef0("AttachPa|
00001e80  6e 65 3a 27 4d 6f 76 65  61 62 6c 65 27 20 62 69  |ne:'Moveable' bi|
00001e90  74 20 6f 66 20 70 61 6e  65 20 77 69 6e 64 6f 77  |t of pane window|
00001ea0  20 69 73 20 73 65 74 2c  20 66 69 78 69 6e 67 2e  | is set, fixing.|
00001eb0  2e 22 29 0d 01 04 31 20  20 f2 73 68 65 6c 6c 5f  |.")...1  .shell_|
00001ec0  57 69 6e 64 6f 77 54 6f  67 67 6c 65 46 6c 61 67  |WindowToggleFlag|
00001ed0  73 28 70 61 6e 65 5f 68  61 6e 64 6c 65 25 2c 31  |s(pane_handle%,1|
00001ee0  3c 3c 31 29 0d 01 05 05  cd 0d 01 06 39 6f 66 66  |<<1)........9off|
00001ef0  73 65 74 25 3d a4 73 68  65 6c 6c 5f 47 65 74 45  |set%=.shell_GetE|
00001f00  76 65 6e 74 4c 69 73 74  4f 66 66 73 65 74 28 77  |ventListOffset(w|
00001f10  68 25 2c 2d 31 2c 5f 55  25 2b 39 32 2c 32 34 2c  |h%,-1,_U%+92,24,|
00001f20  a3 29 0d 01 07 11 e7 20  6f 66 66 73 65 74 25 3c  |.)..... offset%<|
00001f30  30 20 8c 0d 01 08 24 20  20 f4 20 6e 6f 20 65 78  |0 ....$  . no ex|
00001f40  69 73 74 69 6e 67 20 70  61 6e 65 20 65 76 65 6e  |isting pane even|
00001f50  74 20 62 6c 6f 63 6b 0d  01 09 3c 20 20 f2 73 68  |t block...<  .sh|
00001f60  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 41 74 74  |ell_Tracef0("Att|
00001f70  61 63 68 50 61 6e 65 3a  43 72 65 61 74 69 6e 67  |achPane:Creating|
00001f80  20 70 61 6e 65 20 65 76  65 6e 74 20 62 6c 6f 63  | pane event bloc|
00001f90  6b 22 29 0d 01 0a 3b 20  20 6f 66 66 73 65 74 25  |k")...;  offset%|
00001fa0  3d a4 73 68 65 6c 6c 5f  47 65 74 45 76 65 6e 74  |=.shell_GetEvent|
00001fb0  4c 69 73 74 4f 66 66 73  65 74 28 77 68 25 2c 2d  |ListOffset(wh%,-|
00001fc0  31 2c 5f 55 25 2b 39 32  2c 32 34 2c b9 29 0d 01  |1,_U%+92,24,.)..|
00001fd0  0b 19 20 20 62 6c 6b 25  3d 5f 55 25 21 39 32 2b  |..  blk%=_U%!92+|
00001fe0  6f 66 66 73 65 74 25 0d  01 0c 1a 20 20 62 6c 6b  |offset%....  blk|
00001ff0  25 21 30 3d 77 68 25 3a  62 6c 6b 25 21 34 3d 2d  |%!0=wh%:blk%!4=-|
00002000  31 0d 01 0d 25 20 20 62  6c 6b 25 21 38 3d a4 73  |1...%  blk%!8=.s|
00002010  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 46 65  |hell_HeapBlockFe|
00002020  74 63 68 28 34 29 0d 01  0e 26 20 20 62 6c 6b 25  |tch(4)...&  blk%|
00002030  21 31 32 3d a4 73 68 65  6c 6c 5f 48 65 61 70 42  |!12=.shell_HeapB|
00002040  6c 6f 63 6b 46 65 74 63  68 28 34 29 0d 01 0f 26  |lockFetch(4)...&|
00002050  20 20 62 6c 6b 25 21 31  36 3d a4 73 68 65 6c 6c  |  blk%!16=.shell|
00002060  5f 48 65 61 70 42 6c 6f  63 6b 46 65 74 63 68 28  |_HeapBlockFetch(|
00002070  34 29 0d 01 10 26 20 20  62 6c 6b 25 21 32 30 3d  |4)...&  blk%!20=|
00002080  a4 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
00002090  46 65 74 63 68 28 34 29  0d 01 11 1c 20 20 74 65  |Fetch(4)....  te|
000020a0  6d 70 25 3d 62 6c 6b 25  21 38 3a 21 74 65 6d 70  |mp%=blk%!8:!temp|
000020b0  25 3d 2d 31 0d 01 12 1d  20 20 74 65 6d 70 25 3d  |%=-1....  temp%=|
000020c0  62 6c 6b 25 21 31 32 3a  21 74 65 6d 70 25 3d 2d  |blk%!12:!temp%=-|
000020d0  31 0d 01 13 1d 20 20 74  65 6d 70 25 3d 62 6c 6b  |1....  temp%=blk|
000020e0  25 21 31 36 3a 21 74 65  6d 70 25 3d 2d 31 0d 01  |%!16:!temp%=-1..|
000020f0  14 1d 20 20 74 65 6d 70  25 3d 62 6c 6b 25 21 32  |..  temp%=blk%!2|
00002100  30 3a 21 74 65 6d 70 25  3d 2d 31 0d 01 15 05 cd  |0:!temp%=-1.....|
00002110  0d 01 16 17 62 6c 6b 25  3d 5f 55 25 21 39 32 2b  |....blk%=_U%!92+|
00002120  6f 66 66 73 65 74 25 0d  01 17 29 74 65 6d 70 25  |offset%...)temp%|
00002130  3d 62 6c 6b 25 21 38 3a  63 74 72 25 3d 30 3a 6e  |=blk%!8:ctr%=0:n|
00002140  72 5f 70 61 6e 65 5f 65  76 65 6e 74 73 25 3d 30  |r_pane_events%=0|
00002150  0d 01 18 15 c8 95 20 74  65 6d 70 25 21 63 74 72  |...... temp%!ctr|
00002160  25 3c 3e 2d 31 0d 01 19  0d 20 20 63 74 72 25 2b  |%<>-1....  ctr%+|
00002170  3d 34 0d 01 1a 18 20 20  6e 72 5f 70 61 6e 65 5f  |=4....  nr_pane_|
00002180  65 76 65 6e 74 73 25 2b  3d 31 0d 01 1b 05 ce 0d  |events%+=1......|
00002190  01 1c 2b 62 6c 6b 25 21  38 3d a4 73 68 65 6c 6c  |..+blk%!8=.shell|
000021a0  5f 48 65 61 70 42 6c 6f  63 6b 45 78 74 65 6e 64  |_HeapBlockExtend|
000021b0  28 62 6c 6b 25 21 38 2c  34 29 0d 01 1d 37 74 65  |(blk%!8,4)...7te|
000021c0  6d 70 25 3d 62 6c 6b 25  21 38 3a 74 65 6d 70 25  |mp%=blk%!8:temp%|
000021d0  21 28 6e 72 5f 70 61 6e  65 5f 65 76 65 6e 74 73  |!(nr_pane_events|
000021e0  25 2a 34 29 3d 70 61 6e  65 5f 68 61 6e 64 6c 65  |%*4)=pane_handle|
000021f0  25 0d 01 1e 24 74 65 6d  70 25 21 28 28 6e 72 5f  |%...$temp%!((nr_|
00002200  70 61 6e 65 5f 65 76 65  6e 74 73 25 2b 31 29 2a  |pane_events%+1)*|
00002210  34 29 3d 2d 31 0d 01 1f  2d 62 6c 6b 25 21 31 32  |4)=-1...-blk%!12|
00002220  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
00002230  6b 45 78 74 65 6e 64 28  62 6c 6b 25 21 31 32 2c  |kExtend(blk%!12,|
00002240  34 29 0d 01 20 32 74 65  6d 70 25 3d 62 6c 6b 25  |4).. 2temp%=blk%|
00002250  21 31 32 3a 74 65 6d 70  25 21 28 6e 72 5f 70 61  |!12:temp%!(nr_pa|
00002260  6e 65 5f 65 76 65 6e 74  73 25 2a 34 29 3d 66 6c  |ne_events%*4)=fl|
00002270  61 67 73 25 0d 01 21 24  74 65 6d 70 25 21 28 28  |ags%..!$temp%!((|
00002280  6e 72 5f 70 61 6e 65 5f  65 76 65 6e 74 73 25 2b  |nr_pane_events%+|
00002290  31 29 2a 34 29 3d 2d 31  0d 01 22 2d 62 6c 6b 25  |1)*4)=-1.."-blk%|
000022a0  21 31 36 3d a4 73 68 65  6c 6c 5f 48 65 61 70 42  |!16=.shell_HeapB|
000022b0  6c 6f 63 6b 45 78 74 65  6e 64 28 62 6c 6b 25 21  |lockExtend(blk%!|
000022c0  31 36 2c 34 29 0d 01 23  32 74 65 6d 70 25 3d 62  |16,4)..#2temp%=b|
000022d0  6c 6b 25 21 31 36 3a 74  65 6d 70 25 21 28 6e 72  |lk%!16:temp%!(nr|
000022e0  5f 70 61 6e 65 5f 65 76  65 6e 74 73 25 2a 34 29  |_pane_events%*4)|
000022f0  3d 78 5f 6f 66 66 25 0d  01 24 24 74 65 6d 70 25  |=x_off%..$$temp%|
00002300  21 28 28 6e 72 5f 70 61  6e 65 5f 65 76 65 6e 74  |!((nr_pane_event|
00002310  73 25 2b 31 29 2a 34 29  3d 2d 31 0d 01 25 2d 62  |s%+1)*4)=-1..%-b|
00002320  6c 6b 25 21 32 30 3d a4  73 68 65 6c 6c 5f 48 65  |lk%!20=.shell_He|
00002330  61 70 42 6c 6f 63 6b 45  78 74 65 6e 64 28 62 6c  |apBlockExtend(bl|
00002340  6b 25 21 32 30 2c 34 29  0d 01 26 32 74 65 6d 70  |k%!20,4)..&2temp|
00002350  25 3d 62 6c 6b 25 21 32  30 3a 74 65 6d 70 25 21  |%=blk%!20:temp%!|
00002360  28 6e 72 5f 70 61 6e 65  5f 65 76 65 6e 74 73 25  |(nr_pane_events%|
00002370  2a 34 29 3d 79 5f 6f 66  66 25 0d 01 27 24 74 65  |*4)=y_off%..'$te|
00002380  6d 70 25 21 28 28 6e 72  5f 70 61 6e 65 5f 65 76  |mp%!((nr_pane_ev|
00002390  65 6e 74 73 25 2b 31 29  2a 34 29 3d 2d 31 0d 01  |ents%+1)*4)=-1..|
000023a0  28 05 e1 0d 01 29 05 3a  0d 01 2a 1f 2a 7c 53 74  |(....).:..*.*|St|
000023b0  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 41 74 74  |op PROCshell_Att|
000023c0  61 63 68 50 61 6e 65 0d  01 2b 04 0d 01 2c 24 2a  |achPane..+...,$*|
000023d0  7c 53 74 61 72 74 20 50  52 4f 43 73 68 65 6c 6c  ||Start PROCshell|
000023e0  5f 41 74 74 61 63 68 44  61 74 61 4c 6f 61 64 0d  |_AttachDataLoad.|
000023f0  01 2d 37 dd 20 f2 73 68  65 6c 6c 5f 41 74 74 61  |.-7. .shell_Atta|
00002400  63 68 44 61 74 61 4c 6f  61 64 28 77 68 25 2c 69  |chDataLoad(wh%,i|
00002410  68 25 2c 74 79 70 65 25  2c 66 6e 24 2c 6e 6f 5f  |h%,type%,fn$,no_|
00002420  6c 6f 61 64 25 29 0d 01  2e 21 ea 20 62 6c 6b 25  |load%)...!. blk%|
00002430  2c 74 65 6d 70 25 2c 6f  66 66 73 65 74 25 2c 63  |,temp%,offset%,c|
00002440  6d 64 6c 69 6e 65 24 0d  01 2f 3f f2 73 68 65 6c  |mdline$../?.shel|
00002450  6c 5f 54 72 61 63 65 66  30 28 22 41 74 74 61 63  |l_Tracef0("Attac|
00002460  68 44 61 74 61 4c 6f 61  64 3a 41 74 74 61 63 68  |hDataLoad:Attach|
00002470  69 6e 67 20 44 61 74 61  4c 6f 61 64 20 48 61 6e  |ing DataLoad Han|
00002480  64 6c 65 72 22 29 0d 01  30 15 e7 20 77 68 25 3d  |dler")..0.. wh%=|
00002490  2d 31 20 8c 20 77 68 25  3d 2d 32 0d 01 31 24 e7  |-1 . wh%=-2..1$.|
000024a0  20 6e 6f 5f 6c 6f 61 64  25 20 8c 20 74 79 70 65  | no_load% . type|
000024b0  25 3d 74 79 70 65 25 20  84 20 31 3c 3c 33 31 0d  |%=type% . 1<<31.|
000024c0  01 32 3a 6f 66 66 73 65  74 25 3d a4 73 68 65 6c  |.2:offset%=.shel|
000024d0  6c 5f 47 65 74 45 76 65  6e 74 4c 69 73 74 4f 66  |l_GetEventListOf|
000024e0  66 73 65 74 28 77 68 25  2c 69 68 25 2c 5f 55 25  |fset(wh%,ih%,_U%|
000024f0  2b 39 36 2c 31 36 2c b9  29 0d 01 33 3e f4 20 6d  |+96,16,.)..3>. m|
00002500  6f 64 69 66 79 20 61 62  6f 76 65 20 74 6f 20 73  |odify above to s|
00002510  65 74 20 66 69 72 73 74  20 74 77 6f 20 77 6f 72  |et first two wor|
00002520  64 73 20 74 6f 20 30 20  74 6f 20 64 65 6e 6f 74  |ds to 0 to denot|
00002530  65 20 61 20 6e 65 77 0d  01 34 17 f4 20 65 6d 70  |e a new..4.. emp|
00002540  74 79 20 65 76 65 6e 74  20 62 6c 6f 63 6b 0d 01  |ty event block..|
00002550  35 17 62 6c 6b 25 3d 5f  55 25 21 39 36 2b 6f 66  |5.blk%=_U%!96+of|
00002560  66 73 65 74 25 0d 01 36  04 0d 01 37 1b e7 20 62  |fset%..6...7.. b|
00002570  6c 6b 25 21 30 3d 30 20  80 20 62 6c 6b 25 21 34  |lk%!0=0 . blk%!4|
00002580  3d 30 20 8c 0d 01 38 21  20 20 f4 20 74 68 69 73  |=0 ...8!  . this|
00002590  20 69 73 20 66 69 72 73  74 20 65 76 65 6e 74 2e  | is first event.|
000025a0  2e 2e 2e 2e 2e 0d 01 39  4a 20 20 f2 73 68 65 6c  |.......9J  .shel|
000025b0  6c 5f 54 72 61 63 65 66  30 28 22 41 74 74 61 63  |l_Tracef0("Attac|
000025c0  68 44 61 74 61 4c 6f 61  64 3a 54 68 69 73 20 69  |hDataLoad:This i|
000025d0  73 20 74 68 65 20 66 69  72 73 74 20 44 61 74 61  |s the first Data|
000025e0  4c 6f 61 64 20 45 76 65  6e 74 2e 2e 2e 22 29 0d  |Load Event...").|
000025f0  01 3a 1b 20 20 62 6c 6b  25 21 30 3d 77 68 25 3a  |.:.  blk%!0=wh%:|
00002600  62 6c 6b 25 21 34 3d 69  68 25 0d 01 3b 25 20 20  |blk%!4=ih%..;%  |
00002610  62 6c 6b 25 21 38 3d a4  73 68 65 6c 6c 5f 48 65  |blk%!8=.shell_He|
00002620  61 70 42 6c 6f 63 6b 46  65 74 63 68 28 38 29 0d  |apBlockFetch(8).|
00002630  01 3c 12 20 20 74 65 6d  70 25 3d 62 6c 6b 25 21  |.<.  temp%=blk%!|
00002640  38 0d 01 3d 1e 20 20 74  65 6d 70 25 21 30 3d 74  |8..=.  temp%!0=t|
00002650  79 70 65 25 3a 74 65 6d  70 25 21 34 3d 2d 31 0d  |ype%:temp%!4=-1.|
00002660  01 3e 26 20 20 62 6c 6b  25 21 31 32 3d a4 73 68  |.>&  blk%!12=.sh|
00002670  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
00002680  63 68 28 38 29 0d 01 3f  13 20 20 74 65 6d 70 25  |ch(8)..?.  temp%|
00002690  3d 62 6c 6b 25 21 31 32  0d 01 40 2d 20 20 74 65  |=blk%!12..@-  te|
000026a0  6d 70 25 21 30 3d a4 73  68 65 6c 6c 5f 48 65 61  |mp%!0=.shell_Hea|
000026b0  70 42 6c 6f 63 6b 46 65  74 63 68 28 a9 28 66 6e  |pBlockFetch(.(fn|
000026c0  24 29 2b 31 29 0d 01 41  10 20 20 74 65 6d 70 25  |$)+1)..A.  temp%|
000026d0  21 34 3d 2d 31 0d 01 42  1e 20 20 74 65 6d 70 25  |!4=-1..B.  temp%|
000026e0  3d 74 65 6d 70 25 21 30  3a 24 74 65 6d 70 25 3d  |=temp%!0:$temp%=|
000026f0  66 6e 24 0d 01 43 05 cc  0d 01 44 39 20 20 f4 20  |fn$..C....D9  . |
00002700  61 64 64 69 6e 67 20 6e  65 77 20 66 69 6c 65 74  |adding new filet|
00002710  79 70 65 2f 66 75 6e 63  74 69 6f 6e 20 74 6f 20  |ype/function to |
00002720  61 6e 20 65 78 69 73 74  69 6e 67 20 65 76 65 6e  |an existing even|
00002730  74 0d 01 45 24 20 20 f4  20 65 78 74 65 6e 64 20  |t..E$  . extend |
00002740  66 69 6c 65 74 79 70 65  20 68 65 61 70 62 6c 6f  |filetype heapblo|
00002750  63 6b 2e 2e 2e 0d 01 46  48 20 20 f2 73 68 65 6c  |ck.....FH  .shel|
00002760  6c 5f 54 72 61 63 65 66  30 28 22 41 74 74 61 63  |l_Tracef0("Attac|
00002770  68 44 61 74 61 4c 6f 61  64 3a 54 68 69 73 20 69  |hDataLoad:This i|
00002780  73 20 61 6e 6f 74 68 65  72 20 44 61 74 61 4c 6f  |s another DataLo|
00002790  61 64 20 45 76 65 6e 74  2e 2e 2e 22 29 0d 01 47  |ad Event...")..G|
000027a0  2d 20 20 62 6c 6b 25 21  38 3d a4 73 68 65 6c 6c  |-  blk%!8=.shell|
000027b0  5f 48 65 61 70 42 6c 6f  63 6b 45 78 74 65 6e 64  |_HeapBlockExtend|
000027c0  28 62 6c 6b 25 21 38 2c  34 29 0d 01 48 26 20 20  |(blk%!8,4)..H&  |
000027d0  f4 20 61 6e 64 20 66 75  6e 63 74 69 6f 6e 20 6e  |. and function n|
000027e0  61 6d 65 20 68 65 61 70  62 6c 6f 63 6b 2e 2e 2e  |ame heapblock...|
000027f0  0d 01 49 2f 20 20 62 6c  6b 25 21 31 32 3d a4 73  |..I/  blk%!12=.s|
00002800  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 45 78  |hell_HeapBlockEx|
00002810  74 65 6e 64 28 62 6c 6b  25 21 31 32 2c 34 29 0d  |tend(blk%!12,4).|
00002820  01 4a 34 20 20 f4 20 66  69 6e 64 20 6f 75 74 20  |.J4  . find out |
00002830  68 6f 77 20 6d 61 6e 79  20 66 69 6c 65 74 79 70  |how many filetyp|
00002840  65 73 20 74 68 65 72 65  20 61 72 65 20 6e 6f 77  |es there are now|
00002850  2e 2e 2e 0d 01 4b 19 20  20 63 74 72 25 3d 30 3a  |.....K.  ctr%=0:|
00002860  74 65 6d 70 25 3d 62 6c  6b 25 21 38 0d 01 4c 17  |temp%=blk%!8..L.|
00002870  20 20 c8 95 20 74 65 6d  70 25 21 63 74 72 25 3c  |  .. temp%!ctr%<|
00002880  3e 2d 31 0d 01 4d 0f 20  20 20 20 63 74 72 25 2b  |>-1..M.    ctr%+|
00002890  3d 34 0d 01 4e 07 20 20  ce 0d 01 4f 28 20 20 74  |=4..N.  ...O(  t|
000028a0  65 6d 70 25 21 63 74 72  25 3d 74 79 70 65 25 3a  |emp%!ctr%=type%:|
000028b0  74 65 6d 70 25 21 28 63  74 72 25 2b 34 29 3d 2d  |temp%!(ctr%+4)=-|
000028c0  31 0d 01 50 13 20 20 74  65 6d 70 25 3d 62 6c 6b  |1..P.  temp%=blk|
000028d0  25 21 31 32 0d 01 51 2e  20 20 74 65 6d 70 25 21  |%!12..Q.  temp%!|
000028e0  63 74 72 25 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |ctr%=.shell_Heap|
000028f0  42 6c 6f 63 6b 46 65 74  63 68 28 a9 66 6e 24 2b  |BlockFetch(.fn$+|
00002900  31 29 0d 01 52 21 20 20  74 65 6d 70 25 3d 74 65  |1)..R!  temp%=te|
00002910  6d 70 25 21 63 74 72 25  3a 24 74 65 6d 70 25 3d  |mp%!ctr%:$temp%=|
00002920  66 6e 24 0d 01 53 05 cd  0d 01 54 4b f4 20 4e 6f  |fn$..S....TK. No|
00002930  77 20 63 68 65 63 6b 20  69 66 20 70 72 6f 67 72  |w check if progr|
00002940  61 6d 20 77 61 73 20 73  74 61 72 74 65 64 20 62  |am was started b|
00002950  79 20 64 6f 75 62 6c 65  20 63 6c 69 63 6b 69 6e  |y double clickin|
00002960  67 20 6f 6e 20 61 20 64  61 74 61 20 66 69 6c 65  |g on a data file|
00002970  2e 2e 2e 0d 01 55 24 63  6d 64 6c 69 6e 65 24 20  |.....U$cmdline$ |
00002980  3d 20 a4 73 68 65 6c 6c  5f 47 65 74 43 6d 64 4c  |= .shell_GetCmdL|
00002990  69 6e 65 41 72 67 73 0d  01 56 38 f2 73 68 65 6c  |ineArgs..V8.shel|
000029a0  6c 5f 54 72 61 63 65 66  30 28 22 41 74 74 61 63  |l_Tracef0("Attac|
000029b0  68 44 61 74 61 4c 6f 61  64 3a 63 6d 64 6c 69 6e  |hDataLoad:cmdlin|
000029c0  65 20 20 3d 22 2b 63 6d  64 6c 69 6e 65 24 29 0d  |e  ="+cmdline$).|
000029d0  01 57 45 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |.WE.shell_Tracef|
000029e0  30 28 22 41 74 74 61 63  68 44 61 74 61 4c 6f 61  |0("AttachDataLoa|
000029f0  64 3a 66 6c 61 67 20 62  69 74 20 3d 22 2b c3 28  |d:flag bit ="+.(|
00002a00  28 5f 55 25 21 31 30 30  20 80 20 31 20 3c 3c 20  |(_U%!100 . 1 << |
00002a10  35 29 29 29 0d 01 58 35  f2 73 68 65 6c 6c 5f 54  |5)))..X5.shell_T|
00002a20  72 61 63 65 66 30 28 22  41 74 74 61 63 68 44 61  |racef0("AttachDa|
00002a30  74 61 4c 6f 61 64 3a 77  68 25 20 20 20 20 20 20  |taLoad:wh%      |
00002a40  3d 22 2b c3 7e 77 68 25  29 0d 01 59 37 f2 73 68  |="+.~wh%)..Y7.sh|
00002a50  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 41 74 74  |ell_Tracef0("Att|
00002a60  61 63 68 44 61 74 61 4c  6f 61 64 3a 74 79 70 65  |achDataLoad:type|
00002a70  25 20 20 20 20 3d 22 2b  c3 7e 74 79 70 65 25 29  |%    ="+.~type%)|
00002a80  0d 01 5a 35 e7 20 63 6d  64 6c 69 6e 65 24 20 3c  |..Z5. cmdline$ <|
00002a90  3e 20 22 22 20 80 20 77  68 25 20 3c 20 30 20 80  |> "" . wh% < 0 .|
00002aa0  20 28 5f 55 25 21 31 30  30 20 80 20 31 20 3c 3c  | (_U%!100 . 1 <<|
00002ab0  20 35 29 20 8c 0d 01 5b  43 20 20 f4 20 49 74 20  | 5) ...[C  . It |
00002ac0  77 61 73 2c 20 63 68 65  63 6b 20 66 69 6c 65 20  |was, check file |
00002ad0  69 73 20 63 6f 72 72 65  63 74 20 74 79 70 65 2c  |is correct type,|
00002ae0  20 69 67 6e 6f 72 69 6e  67 20 74 68 65 20 74 6f  | ignoring the to|
00002af0  70 20 62 69 74 2e 2e 2e  0d 01 5c 41 20 20 e7 20  |p bit.....\A  . |
00002b00  74 79 70 65 25 20 80 20  31 20 3c 3c 20 33 31 20  |type% . 1 << 31 |
00002b10  8c 20 74 65 6d 70 25 20  3d 20 74 79 70 65 25 20  |. temp% = type% |
00002b20  82 20 31 20 3c 3c 20 33  31 20 8b 20 74 65 6d 70  |. 1 << 31 . temp|
00002b30  25 20 3d 20 74 79 70 65  25 0d 01 5d 2b 20 20 e7  |% = type%..]+  .|
00002b40  20 a4 73 68 65 6c 6c 5f  46 69 6c 65 54 79 70 65  | .shell_FileType|
00002b50  28 63 6d 64 6c 69 6e 65  24 29 20 3d 20 74 65 6d  |(cmdline$) = tem|
00002b60  70 25 20 8c 0d 01 5e 1e  20 20 20 20 f4 20 49 74  |p% ...^.    . It|
00002b70  20 69 73 2c 20 73 6f 20  6c 6f 61 64 20 69 74 2e  | is, so load it.|
00002b80  2e 2e 0d 01 5f 37 20 20  20 20 f2 73 68 65 6c 6c  |...._7    .shell|
00002b90  5f 54 72 61 63 65 66 30  28 22 41 74 74 61 63 68  |_Tracef0("Attach|
00002ba0  44 61 74 61 4c 6f 61 64  3a 4c 6f 61 64 69 6e 67  |DataLoad:Loading|
00002bb0  20 66 69 6c 65 2e 2e 22  29 0d 01 60 32 20 20 20  | file..")..`2   |
00002bc0  20 f2 73 68 65 6c 6c 5f  4d 65 73 73 61 67 65 53  | .shell_MessageS|
00002bd0  65 6e 64 44 61 74 61 4c  6f 61 64 28 74 65 6d 70  |endDataLoad(temp|
00002be0  25 2c 63 6d 64 6c 69 6e  65 24 29 0d 01 61 47 20  |%,cmdline$)..aG |
00002bf0  20 20 20 5f 55 25 21 31  30 30 20 3d 20 5f 55 25  |   _U%!100 = _U%|
00002c00  21 31 30 30 20 82 20 28  31 20 3c 3c 20 35 29 20  |!100 . (1 << 5) |
00002c10  3a 20 f4 20 55 6e 73 65  74 20 6c 6f 61 64 20 70  |: . Unset load p|
00002c20  65 6e 64 69 6e 67 20 66  6c 61 67 20 62 69 74 2e  |ending flag bit.|
00002c30  2e 2e 0d 01 62 07 20 20  cd 0d 01 63 05 cd 0d 01  |....b.  ...c....|
00002c40  64 05 e1 0d 01 65 05 3a  0d 01 66 23 2a 7c 53 74  |d....e.:..f#*|St|
00002c50  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 41 74 74  |op PROCshell_Att|
00002c60  61 63 68 44 61 74 61 4c  6f 61 64 0d 01 67 04 0d  |achDataLoad..g..|
00002c70  01 68 24 2a 7c 53 74 61  72 74 20 50 52 4f 43 73  |.h$*|Start PROCs|
00002c80  68 65 6c 6c 5f 41 74 74  61 63 68 44 61 74 61 53  |hell_AttachDataS|
00002c90  61 76 65 0d 01 69 40 dd  20 f2 73 68 65 6c 6c 5f  |ave..i@. .shell_|
00002ca0  41 74 74 61 63 68 44 61  74 61 53 61 76 65 28 77  |AttachDataSave(w|
00002cb0  68 25 2c 69 68 25 2c 61  64 64 72 65 73 73 25 2c  |h%,ih%,address%,|
00002cc0  74 79 70 65 25 2c 6e 61  6d 65 5f 69 63 25 2c 66  |type%,name_ic%,f|
00002cd0  6e 24 29 0d 01 6a 18 ea  20 62 6c 6b 25 2c 74 65  |n$)..j.. blk%,te|
00002ce0  6d 70 25 2c 6f 66 66 73  65 74 25 0d 01 6b 3c f4  |mp%,offset%..k<.|
00002cf0  20 63 68 65 63 6b 20 66  69 6c 65 20 69 63 6f 6e  | check file icon|
00002d00  20 69 73 20 61 20 73 70  72 69 74 65 20 69 63 6f  | is a sprite ico|
00002d10  6e 2c 20 63 6f 6d 70 6c  61 69 6e 20 6f 74 68 65  |n, complain othe|
00002d20  72 77 69 73 65 2e 2e 0d  01 6c 54 e7 20 ac 20 a4  |rwise....lT. . .|
00002d30  73 68 65 6c 6c 5f 49 63  6f 6e 49 73 53 70 72 69  |shell_IconIsSpri|
00002d40  74 65 28 77 68 25 2c 69  68 25 29 20 8c 20 f2 73  |te(wh%,ih%) . .s|
00002d50  68 65 6c 6c 5f 4f 4b 28  a4 73 68 65 6c 6c 5f 4d  |hell_OK(.shell_M|
00002d60  65 73 73 61 67 65 4e 6f  41 72 67 73 28 22 53 48  |essageNoArgs("SH|
00002d70  45 4c 4c 4d 53 47 32 39  22 29 29 0d 01 6d 37 f4  |ELLMSG29"))..m7.|
00002d80  20 63 68 61 6e 67 65 20  66 69 6c 65 20 74 79 70  | change file typ|
00002d90  65 20 69 63 6f 6e 20 62  75 74 74 6f 6e 20 74 79  |e icon button ty|
00002da0  70 65 20 74 6f 20 63 6c  69 63 6b 2f 64 72 61 67  |pe to click/drag|
00002db0  2e 2e 0d 01 6e 27 f2 73  68 65 6c 6c 5f 49 63 6f  |....n'.shell_Ico|
00002dc0  6e 53 65 74 42 75 74 74  6f 6e 54 79 70 65 28 77  |nSetButtonType(w|
00002dd0  68 25 2c 69 68 25 2c 36  29 0d 01 6f 3e e7 20 61  |h%,ih%,6)..o>. a|
00002de0  64 64 72 65 73 73 25 3d  30 20 8c 20 61 64 64 72  |ddress%=0 . addr|
00002df0  65 73 73 25 3d 31 30 30  3a f4 20 65 73 74 69 6d  |ess%=100:. estim|
00002e00  61 74 65 64 20 73 69 7a  65 20 2d 20 77 69 6c 64  |ated size - wild|
00002e10  20 67 75 65 73 73 2e 0d  01 70 15 2a 7c 69 66 64  | guess...p.*|ifd|
00002e20  65 66 20 54 72 61 63 65  49 6e 69 74 0d 01 71 62  |ef TraceInit..qb|
00002e30  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
00002e40  41 74 74 61 63 68 44 61  74 61 53 61 76 65 3a 41  |AttachDataSave:A|
00002e50  74 74 61 63 68 69 6e 67  20 44 61 74 61 53 61 76  |ttaching DataSav|
00002e60  65 20 48 61 6e 64 6c 65  72 20 74 6f 20 69 63 6f  |e Handler to ico|
00002e70  6e 20 22 2b c3 69 68 25  2b 22 20 69 6e 20 77 69  |n "+.ih%+" in wi|
00002e80  6e 64 6f 77 20 26 22 2b  c3 7e 77 68 25 29 0d 01  |ndow &"+.~wh%)..|
00002e90  72 42 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |rB.shell_Tracef0|
00002ea0  28 22 41 74 74 61 63 68  44 61 74 61 53 61 76 65  |("AttachDataSave|
00002eb0  3a 48 61 6e 64 6c 65 72  20 66 75 6e 63 74 69 6f  |:Handler functio|
00002ec0  6e 20 69 73 20 27 22 2b  66 6e 24 2b 22 27 22 29  |n is '"+fn$+"'")|
00002ed0  0d 01 73 0b 2a 7c 65 6e  64 69 66 0d 01 74 3a 6f  |..s.*|endif..t:o|
00002ee0  66 66 73 65 74 25 3d a4  73 68 65 6c 6c 5f 47 65  |ffset%=.shell_Ge|
00002ef0  74 45 76 65 6e 74 4c 69  73 74 4f 66 66 73 65 74  |tEventListOffset|
00002f00  28 77 68 25 2c 69 68 25  2c 5f 55 25 2b 37 32 2c  |(wh%,ih%,_U%+72,|
00002f10  32 34 2c b9 29 0d 01 75  17 62 6c 6b 25 3d 5f 55  |24,.)..u.blk%=_U|
00002f20  25 21 37 32 2b 6f 66 66  73 65 74 25 0d 01 76 37  |%!72+offset%..v7|
00002f30  62 6c 6b 25 21 30 3d 77  68 25 3a 62 6c 6b 25 21  |blk%!0=wh%:blk%!|
00002f40  34 3d 69 68 25 3a 62 6c  6b 25 21 38 3d 61 64 64  |4=ih%:blk%!8=add|
00002f50  72 65 73 73 25 3a 62 6c  6b 25 21 31 32 3d 74 79  |ress%:blk%!12=ty|
00002f60  70 65 25 0d 01 77 14 62  6c 6b 25 21 31 36 3d 6e  |pe%..w.blk%!16=n|
00002f70  61 6d 65 5f 69 63 25 0d  01 78 2b 62 6c 6b 25 21  |ame_ic%..x+blk%!|
00002f80  32 30 3d a4 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |20=.shell_HeapBl|
00002f90  6f 63 6b 46 65 74 63 68  28 a9 28 66 6e 24 29 2b  |ockFetch(.(fn$)+|
00002fa0  31 29 0d 01 79 1c 74 65  6d 70 25 3d 62 6c 6b 25  |1)..y.temp%=blk%|
00002fb0  21 32 30 3a 24 74 65 6d  70 25 3d 66 6e 24 0d 01  |!20:$temp%=fn$..|
00002fc0  7a 0e c8 8e 20 74 79 70  65 25 20 ca 0d 01 7b 0c  |z... type% ...{.|
00002fd0  20 20 c9 20 26 46 46 39  0d 01 7c 3a 20 20 20 20  |  . &FF9..|:    |
00002fe0  f4 20 6b 6c 75 64 67 65  20 66 6f 72 20 73 70 72  |. kludge for spr|
00002ff0  69 74 65 20 66 69 6c 65  73 20 61 73 20 66 69 72  |ite files as fir|
00003000  73 74 20 77 6f 72 64 20  73 68 6f 75 6c 64 20 6e  |st word should n|
00003010  6f 74 0d 01 7d 12 20 20  20 20 f4 20 62 65 20 73  |ot..}.    . be s|
00003020  61 76 65 64 0d 01 7e 1a  20 20 20 20 e7 20 61 64  |aved..~.    . ad|
00003030  64 72 65 73 73 25 3e 26  38 30 30 30 20 8c 0d 01  |dress%>&8000 ...|
00003040  7f 32 20 20 20 20 20 20  5f 55 25 21 31 33 36 3d  |.2      _U%!136=|
00003050  a4 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
00003060  49 6e 66 6f 28 61 64 64  72 65 73 73 25 29 2d 38  |Info(address%)-8|
00003070  0d 01 80 09 20 20 20 20  cc 0d 01 81 1a 20 20 20  |....    .....   |
00003080  20 20 20 5f 55 25 21 31  33 36 3d 61 64 64 72 65  |   _U%!136=addre|
00003090  73 73 25 0d 01 82 09 20  20 20 20 cd 0d 01 83 07  |ss%....    .....|
000030a0  20 20 7f 0d 01 84 1a 20  20 20 20 e7 20 61 64 64  |  .....    . add|
000030b0  72 65 73 73 25 3e 26 38  30 30 30 20 8c 0d 01 85  |ress%>&8000 ....|
000030c0  32 20 20 20 20 20 20 5f  55 25 21 31 33 36 3d a4  |2      _U%!136=.|
000030d0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 49  |shell_HeapBlockI|
000030e0  6e 66 6f 28 61 64 64 72  65 73 73 25 29 2d 34 0d  |nfo(address%)-4.|
000030f0  01 86 09 20 20 20 20 cc  0d 01 87 1a 20 20 20 20  |...    .....    |
00003100  20 20 5f 55 25 21 31 33  36 3d 61 64 64 72 65 73  |  _U%!136=addres|
00003110  73 25 0d 01 88 09 20 20  20 20 cd 0d 01 89 05 cb  |s%....    ......|
00003120  0d 01 8a 11 5f 55 25 21  31 34 30 3d 74 79 70 65  |...._U%!140=type|
00003130  25 0d 01 8b 4c f4 20 5f  55 25 21 31 34 34 20 68  |%...L. _U%!144 h|
00003140  6f 6c 64 73 20 61 64 64  72 65 73 73 20 6f 66 20  |olds address of |
00003150  66 69 6c 65 20 68 65 61  70 62 6c 6f 63 6b 20 62  |file heapblock b|
00003160  75 66 66 65 72 2e 20 49  66 20 61 64 64 72 65 73  |uffer. If addres|
00003170  73 25 3c 26 38 30 30 30  20 74 68 65 6e 0d 01 8c  |s%<&8000 then...|
00003180  4b f4 20 66 69 6c 65 20  69 73 20 6e 6f 74 20 69  |K. file is not i|
00003190  6e 20 61 20 62 75 66 66  65 72 20 61 6e 64 20 61  |n a buffer and a|
000031a0  64 64 72 65 73 73 25 20  69 73 20 61 63 74 75 61  |ddress% is actua|
000031b0  6c 6c 79 20 74 68 65 20  65 73 74 69 6d 61 74 65  |lly the estimate|
000031c0  64 20 73 69 7a 65 2e 2e  0d 01 8d 14 5f 55 25 21  |d size......_U%!|
000031d0  31 34 34 3d 61 64 64 72  65 73 73 25 0d 01 8e 05  |144=address%....|
000031e0  e1 0d 01 8f 05 3a 0d 01  90 23 2a 7c 53 74 6f 70  |.....:...#*|Stop|
000031f0  20 50 52 4f 43 73 68 65  6c 6c 5f 41 74 74 61 63  | PROCshell_Attac|
00003200  68 44 61 74 61 53 61 76  65 0d 01 91 04 0d 01 92  |hDataSave.......|
00003210  20 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  | *|Start PROCshe|
00003220  6c 6c 5f 41 74 74 61 63  68 4d 65 6e 75 0d 01 93  |ll_AttachMenu...|
00003230  38 dd 20 f2 73 68 65 6c  6c 5f 41 74 74 61 63 68  |8. .shell_Attach|
00003240  4d 65 6e 75 28 77 68 25  2c 69 63 25 2c 6d 65 6e  |Menu(wh%,ic%,men|
00003250  75 25 2c 73 68 69 66 74  25 2c 63 74 72 6c 25 2c  |u%,shift%,ctrl%,|
00003260  61 6c 74 25 29 0d 01 94  0d ea 20 6f 66 66 73 65  |alt%)..... offse|
00003270  74 25 0d 01 95 3a e7 20  77 68 25 3e 30 20 80 20  |t%...:. wh%>0 . |
00003280  69 63 25 3e 3d 30 20 8c  20 f2 73 68 65 6c 6c 5f  |ic%>=0 . .shell_|
00003290  49 63 6f 6e 53 65 74 42  75 74 74 6f 6e 54 79 70  |IconSetButtonTyp|
000032a0  65 28 77 68 25 2c 69 63  25 2c 33 29 0d 01 96 2c  |e(wh%,ic%,3)...,|
000032b0  6f 66 66 73 65 74 25 3d  a4 73 68 65 6c 6c 5f 53  |offset%=.shell_S|
000032c0  65 61 72 63 68 53 74 61  74 69 63 28 5f 55 25 21  |earchStatic(_U%!|
000032d0  31 38 34 2c 77 68 25 29  0d 01 97 40 e7 20 6f 66  |184,wh%)...@. of|
000032e0  66 73 65 74 25 3d 2d 31  20 8c 20 f2 73 68 65 6c  |fset%=-1 . .shel|
000032f0  6c 5f 4f 4b 28 a4 73 68  65 6c 6c 5f 4d 65 73 73  |l_OK(.shell_Mess|
00003300  61 67 65 4e 6f 41 72 67  73 28 22 53 48 45 4c 4c  |ageNoArgs("SHELL|
00003310  4d 53 47 33 30 22 29 29  0d 01 98 15 2a 7c 69 66  |MSG30"))....*|if|
00003320  64 65 66 20 54 72 61 63  65 49 6e 69 74 0d 01 99  |def TraceInit...|
00003330  5c f2 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  |\.shell_Tracef0(|
00003340  22 41 74 74 61 63 68 4d  65 6e 75 3a 41 74 74 61  |"AttachMenu:Atta|
00003350  63 68 69 6e 67 20 6d 65  6e 75 20 68 61 6e 64 6c  |ching menu handl|
00003360  65 20 26 22 2b c3 7e 6d  65 6e 75 25 2b 22 20 74  |e &"+.~menu%+" t|
00003370  6f 20 77 69 6e 64 6f 77  20 68 61 6e 64 6c 65 20  |o window handle |
00003380  26 22 2b c3 7e 77 68 25  29 0d 01 9a 0b 2a 7c 65  |&"+.~wh%)....*|e|
00003390  6e 64 69 66 0d 01 9b 27  f2 73 68 65 6c 6c 5f 45  |ndif...'.shell_E|
000033a0  76 65 6e 74 41 64 64 28  77 68 25 2c 69 63 25 2c  |ventAdd(wh%,ic%,|
000033b0  30 2c 6d 65 6e 75 25 2c  22 22 29 0d 01 9c 05 e1  |0,menu%,"").....|
000033c0  0d 01 9d 05 3a 0d 01 9e  1f 2a 7c 53 74 6f 70 20  |....:....*|Stop |
000033d0  50 52 4f 43 73 68 65 6c  6c 5f 41 74 74 61 63 68  |PROCshell_Attach|
000033e0  4d 65 6e 75 0d 01 9f 04  0d 01 a0 25 2a 7c 53 74  |Menu.......%*|St|
000033f0  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 41 74  |art PROCshell_At|
00003400  74 61 63 68 4d 65 6e 75  4d 61 6b 65 72 0d 01 a1  |tachMenuMaker...|
00003410  29 dd 20 f2 73 68 65 6c  6c 5f 41 74 74 61 63 68  |). .shell_Attach|
00003420  4d 65 6e 75 4d 61 6b 65  72 28 77 68 25 2c 69 63  |MenuMaker(wh%,ic|
00003430  25 2c 66 6e 24 29 0d 01  a2 4c f2 73 68 65 6c 6c  |%,fn$)...L.shell|
00003440  5f 54 72 61 63 65 66 30  28 22 41 74 74 61 63 68  |_Tracef0("Attach|
00003450  4d 65 6e 75 4d 61 6b 65  72 3a 41 74 74 61 63 68  |MenuMaker:Attach|
00003460  69 6e 67 20 6d 65 6e 75  6d 61 6b 65 72 20 66 75  |ing menumaker fu|
00003470  6e 63 74 69 6f 6e 20 27  22 2b 66 6e 24 2b 22 27  |nction '"+fn$+"'|
00003480  22 29 0d 01 a3 24 f2 73  68 65 6c 6c 5f 45 76 65  |")...$.shell_Eve|
00003490  6e 74 41 64 64 28 77 68  25 2c 69 63 25 2c 31 2c  |ntAdd(wh%,ic%,1,|
000034a0  30 2c 66 6e 24 29 0d 01  a4 05 e1 0d 01 a5 05 3a  |0,fn$).........:|
000034b0  0d 01 a6 24 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |...$*|Stop PROCs|
000034c0  68 65 6c 6c 5f 41 74 74  61 63 68 4d 65 6e 75 4d  |hell_AttachMenuM|
000034d0  61 6b 65 72 0d 01 a7 04  0d 01 a8 24 2a 7c 53 74  |aker.......$*|St|
000034e0  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 41 74  |art PROCshell_At|
000034f0  74 61 63 68 4d 65 6e 75  44 42 6f 78 0d 01 a9 41  |tachMenuDBox...A|
00003500  dd 20 f2 73 68 65 6c 6c  5f 41 74 74 61 63 68 4d  |. .shell_AttachM|
00003510  65 6e 75 44 42 6f 78 28  69 74 65 6d 25 2c 77 69  |enuDBox(item%,wi|
00003520  6e 64 6f 77 24 2c 70 72  65 6f 70 65 6e 66 6e 24  |ndow$,preopenfn$|
00003530  2c 70 6f 73 74 6f 70 65  6e 66 6e 24 29 0d 01 aa  |,postopenfn$)...|
00003540  40 f4 20 43 68 65 63 6b  20 63 75 72 72 65 6e 74  |@. Check current|
00003550  20 73 75 62 6d 65 6e 75  20 68 61 6e 64 6c 65 2e  | submenu handle.|
00003560  20 57 65 20 73 68 6f 75  6c 64 20 72 65 6c 65 61  | We should relea|
00003570  73 65 20 61 6e 79 20 6d  65 6d 6f 72 79 0d 01 ab  |se any memory...|
00003580  40 f4 20 61 6c 6c 6f 63  61 74 65 64 20 62 79 20  |@. allocated by |
00003590  70 72 65 76 69 6f 75 73  20 63 61 6c 6c 73 20 28  |previous calls (|
000035a0  77 68 65 6e 20 49 20 77  6f 72 6b 20 6f 75 74 20  |when I work out |
000035b0  68 6f 77 20 74 6f 20 64  6f 20 69 74 29 0d 01 ac  |how to do it)...|
000035c0  16 ea 20 62 6c 6b 25 2c  74 65 6d 70 25 2c 61 64  |.. blk%,temp%,ad|
000035d0  64 72 25 0d 01 ad 56 e7  20 ac 20 a4 73 68 65 6c  |dr%...V. . .shel|
000035e0  6c 5f 57 69 6e 64 6f 77  4c 6f 61 64 65 64 28 77  |l_WindowLoaded(w|
000035f0  69 6e 64 6f 77 24 29 20  8c 20 85 20 39 39 2c a4  |indow$) . . 99,.|
00003600  73 68 65 6c 6c 5f 4d 65  73 73 61 67 65 4f 6e 65  |shell_MessageOne|
00003610  41 72 67 28 22 53 48 45  4c 4c 4d 53 47 30 33 22  |Arg("SHELLMSG03"|
00003620  2c 77 69 6e 64 6f 77 24  29 0d 01 ae 22 62 6c 6b  |,window$)..."blk|
00003630  25 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |%=.shell_HeapBlo|
00003640  63 6b 46 65 74 63 68 28  31 32 29 0d 01 af 2c 62  |ckFetch(12)...,b|
00003650  6c 6b 25 21 30 3d a4 73  68 65 6c 6c 5f 48 65 61  |lk%!0=.shell_Hea|
00003660  70 42 6c 6f 63 6b 46 65  74 63 68 28 a9 77 69 6e  |pBlockFetch(.win|
00003670  64 6f 77 24 2b 31 29 0d  01 b0 1f 74 65 6d 70 25  |dow$+1)....temp%|
00003680  3d 62 6c 6b 25 21 30 3a  24 74 65 6d 70 25 3d 77  |=blk%!0:$temp%=w|
00003690  69 6e 64 6f 77 24 0d 01  b1 2f 62 6c 6b 25 21 34  |indow$.../blk%!4|
000036a0  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
000036b0  6b 46 65 74 63 68 28 a9  70 72 65 6f 70 65 6e 66  |kFetch(.preopenf|
000036c0  6e 24 2b 31 29 0d 01 b2  22 74 65 6d 70 25 3d 62  |n$+1)..."temp%=b|
000036d0  6c 6b 25 21 34 3a 24 74  65 6d 70 25 3d 70 72 65  |lk%!4:$temp%=pre|
000036e0  6f 70 65 6e 66 6e 24 0d  01 b3 30 62 6c 6b 25 21  |openfn$...0blk%!|
000036f0  38 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |8=.shell_HeapBlo|
00003700  63 6b 46 65 74 63 68 28  a9 70 6f 73 74 6f 70 65  |ckFetch(.postope|
00003710  6e 66 6e 24 2b 31 29 0d  01 b4 23 74 65 6d 70 25  |nfn$+1)...#temp%|
00003720  3d 62 6c 6b 25 21 38 3a  24 74 65 6d 70 25 3d 70  |=blk%!8:$temp%=p|
00003730  6f 73 74 6f 70 65 6e 66  6e 24 0d 01 b5 3b f4 20  |ostopenfn$...;. |
00003740  53 74 6f 72 65 20 61 64  64 72 65 73 73 20 6f 66  |Store address of|
00003750  20 68 65 61 70 62 6c 6f  63 6b 20 69 6e 20 73 75  | heapblock in su|
00003760  62 6d 65 6e 75 20 70 6f  69 6e 74 65 72 20 77 6f  |bmenu pointer wo|
00003770  72 64 20 6f 66 0d 01 b6  2f f4 20 6d 65 6e 75 20  |rd of.../. menu |
00003780  69 74 65 6d 20 64 65 66  69 6e 69 74 69 6f 6e 2e  |item definition.|
00003790  20 43 75 6e 6e 69 6e 67  20 68 75 68 2e 2e 2e 2e  | Cunning huh....|
000037a0  2e 2e 2e 2e 0d 01 b7 24  c8 99 20 22 4d 65 6e 75  |.......$.. "Menu|
000037b0  55 74 69 6c 5f 53 75 62  4d 65 6e 75 22 2c 69 74  |Util_SubMenu",it|
000037c0  65 6d 25 2c 62 6c 6b 25  0d 01 b8 1c c8 99 20 22  |em%,blk%...... "|
000037d0  4d 65 6e 75 55 74 69 6c  5f 57 61 72 6e 69 6e 67  |MenuUtil_Warning|
000037e0  22 2c 2c b9 0d 01 b9 05  e1 0d 01 ba 05 3a 0d 01  |",,..........:..|
000037f0  bb 23 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |.#*|Stop PROCshe|
00003800  6c 6c 5f 41 74 74 61 63  68 4d 65 6e 75 44 42 6f  |ll_AttachMenuDBo|
00003810  78 0d 01 bc 04 0d 01 bd  27 2a 7c 53 74 61 72 74  |x.......'*|Start|
00003820  20 50 52 4f 43 73 68 65  6c 6c 5f 41 74 74 61 63  | PROCshell_Attac|
00003830  68 43 6c 69 63 6b 53 65  6c 65 63 74 0d 01 be 2b  |hClickSelect...+|
00003840  dd 20 f2 73 68 65 6c 6c  5f 41 74 74 61 63 68 43  |. .shell_AttachC|
00003850  6c 69 63 6b 53 65 6c 65  63 74 28 77 68 25 2c 69  |lickSelect(wh%,i|
00003860  63 25 2c 66 6e 24 29 0d  01 bf 24 f2 73 68 65 6c  |c%,fn$)...$.shel|
00003870  6c 5f 45 76 65 6e 74 41  64 64 28 77 68 25 2c 69  |l_EventAdd(wh%,i|
00003880  63 25 2c 32 2c 30 2c 66  6e 24 29 0d 01 c0 05 e1  |c%,2,0,fn$).....|
00003890  0d 01 c1 05 3a 0d 01 c2  26 2a 7c 53 74 6f 70 20  |....:...&*|Stop |
000038a0  50 52 4f 43 73 68 65 6c  6c 5f 41 74 74 61 63 68  |PROCshell_Attach|
000038b0  43 6c 69 63 6b 53 65 6c  65 63 74 0d 01 c3 04 0d  |ClickSelect.....|
000038c0  01 c4 27 2a 7c 53 74 61  72 74 20 50 52 4f 43 73  |..'*|Start PROCs|
000038d0  68 65 6c 6c 5f 41 74 74  61 63 68 43 6c 69 63 6b  |hell_AttachClick|
000038e0  41 64 6a 75 73 74 0d 01  c5 2b dd 20 f2 73 68 65  |Adjust...+. .she|
000038f0  6c 6c 5f 41 74 74 61 63  68 43 6c 69 63 6b 41 64  |ll_AttachClickAd|
00003900  6a 75 73 74 28 77 68 25  2c 69 63 25 2c 66 6e 24  |just(wh%,ic%,fn$|
00003910  29 0d 01 c6 24 f2 73 68  65 6c 6c 5f 45 76 65 6e  |)...$.shell_Even|
00003920  74 41 64 64 28 77 68 25  2c 69 63 25 2c 33 2c 30  |tAdd(wh%,ic%,3,0|
00003930  2c 66 6e 24 29 0d 01 c7  05 e1 0d 01 c8 05 3a 0d  |,fn$).........:.|
00003940  01 c9 26 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |..&*|Stop PROCsh|
00003950  65 6c 6c 5f 41 74 74 61  63 68 43 6c 69 63 6b 41  |ell_AttachClickA|
00003960  64 6a 75 73 74 0d 01 ca  04 0d 01 cb 26 2a 7c 53  |djust.......&*|S|
00003970  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 41  |tart PROCshell_A|
00003980  74 74 61 63 68 55 73 65  72 52 65 64 72 61 77 0d  |ttachUserRedraw.|
00003990  01 cc 28 dd 20 f2 73 68  65 6c 6c 5f 41 74 74 61  |..(. .shell_Atta|
000039a0  63 68 55 73 65 72 52 65  64 72 61 77 28 f8 20 77  |chUserRedraw(. w|
000039b0  68 25 2c 66 6e 24 29 0d  01 cd 0d ea 20 62 6c 6b  |h%,fn$)..... blk|
000039c0  25 2c 66 25 0d 01 ce 22  62 6c 6b 25 3d a4 73 68  |%,f%..."blk%=.sh|
000039d0  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
000039e0  63 68 28 34 30 29 0d 01  cf 2c 21 62 6c 6b 25 3d  |ch(40)...,!blk%=|
000039f0  77 68 25 3a c8 99 20 22  57 69 6d 70 5f 47 65 74  |wh%:.. "Wimp_Get|
00003a00  57 69 6e 64 6f 77 53 74  61 74 65 22 2c 2c 62 6c  |WindowState",,bl|
00003a10  6b 25 0d 01 d0 0e 66 25  3d 62 6c 6b 25 21 33 32  |k%....f%=blk%!32|
00003a20  0d 01 d1 20 f2 73 68 65  6c 6c 5f 48 65 61 70 42  |... .shell_HeapB|
00003a30  6c 6f 63 6b 52 65 74 75  72 6e 28 62 6c 6b 25 29  |lockReturn(blk%)|
00003a40  0d 01 d2 3b f4 20 50 52  4f 43 73 68 65 6c 6c 5f  |...;. PROCshell_|
00003a50  54 72 61 63 65 66 30 28  22 41 74 74 61 63 68 55  |Tracef0("AttachU|
00003a60  73 65 72 52 65 64 72 61  77 3a 66 6c 61 67 25 3d  |serRedraw:flag%=|
00003a70  26 22 2b 53 54 52 24 7e  66 25 29 0d 01 d3 13 e7  |&"+STR$~f%).....|
00003a80  20 28 66 25 20 80 20 31  3c 3c 34 29 20 8c 0d 01  | (f% . 1<<4) ...|
00003a90  d4 15 2a 7c 69 66 64 65  66 20 54 72 61 63 65 49  |..*|ifdef TraceI|
00003aa0  6e 69 74 0d 01 d5 3a 20  20 f2 73 68 65 6c 6c 5f  |nit...:  .shell_|
00003ab0  54 72 61 63 65 66 30 28  22 41 74 74 61 63 68 55  |Tracef0("AttachU|
00003ac0  73 65 72 52 65 64 72 61  77 3a 61 75 74 6f 20 72  |serRedraw:auto r|
00003ad0  65 64 72 61 77 20 73 65  74 21 21 22 29 0d 01 d6  |edraw set!!")...|
00003ae0  0b 2a 7c 65 6e 64 69 66  0d 01 d7 47 20 20 f4 20  |.*|endif...G  . |
00003af0  73 74 6f 72 65 20 6f 72  69 67 69 6e 61 6c 20 68  |store original h|
00003b00  61 6e 64 6c 65 20 69 6e  20 63 61 73 65 20 74 68  |andle in case th|
00003b10  65 20 77 69 6d 70 20 61  6c 6c 6f 63 61 74 65 73  |e wimp allocates|
00003b20  20 61 20 6e 65 77 20 68  61 6e 64 6c 65 2e 2e 0d  | a new handle...|
00003b30  01 d8 2a 20 20 f2 73 68  65 6c 6c 5f 57 69 6e 64  |..*  .shell_Wind|
00003b40  6f 77 54 6f 67 67 6c 65  46 6c 61 67 73 28 77 68  |owToggleFlags(wh|
00003b50  25 2c 31 20 3c 3c 20 34  29 0d 01 d9 05 cd 0d 01  |%,1 << 4).......|
00003b60  da 23 f2 73 68 65 6c 6c  5f 45 76 65 6e 74 41 64  |.#.shell_EventAd|
00003b70  64 28 77 68 25 2c 2d 31  2c 34 2c 30 2c 66 6e 24  |d(wh%,-1,4,0,fn$|
00003b80  29 0d 01 db 05 e1 0d 01  dc 05 3a 0d 01 dd 25 2a  |).........:...%*|
00003b90  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
00003ba0  41 74 74 61 63 68 55 73  65 72 52 65 64 72 61 77  |AttachUserRedraw|
00003bb0  0d 01 de 04 0d 01 df 20  2a 7c 53 74 61 72 74 20  |....... *|Start |
00003bc0  50 52 4f 43 73 68 65 6c  6c 5f 41 74 74 61 63 68  |PROCshell_Attach|
00003bd0  44 72 61 67 0d 01 e0 2e  dd 20 f2 73 68 65 6c 6c  |Drag..... .shell|
00003be0  5f 41 74 74 61 63 68 44  72 61 67 28 77 68 25 2c  |_AttachDrag(wh%,|
00003bf0  69 63 25 2c 65 73 74 5f  73 69 7a 65 25 2c 66 6e  |ic%,est_size%,fn|
00003c00  24 29 0d 01 e1 24 f2 73  68 65 6c 6c 5f 45 76 65  |$)...$.shell_Eve|
00003c10  6e 74 41 64 64 28 77 68  25 2c 69 63 25 2c 36 2c  |ntAdd(wh%,ic%,6,|
00003c20  30 2c 66 6e 24 29 0d 01  e2 05 e1 0d 01 e3 05 3a  |0,fn$).........:|
00003c30  0d 01 e4 1f 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |....*|Stop PROCs|
00003c40  68 65 6c 6c 5f 41 74 74  61 63 68 44 72 61 67 0d  |hell_AttachDrag.|
00003c50  01 e5 04 0d 01 e6 23 2a  7c 53 74 61 72 74 20 50  |......#*|Start P|
00003c60  52 4f 43 73 68 65 6c 6c  5f 41 74 74 61 63 68 48  |ROCshell_AttachH|
00003c70  65 6c 70 54 61 67 0d 01  e7 28 dd 20 f2 73 68 65  |elpTag...(. .she|
00003c80  6c 6c 5f 41 74 74 61 63  68 48 65 6c 70 54 61 67  |ll_AttachHelpTag|
00003c90  28 77 68 25 2c 69 63 25  2c 74 61 67 24 29 0d 01  |(wh%,ic%,tag$)..|
00003ca0  e8 25 f2 73 68 65 6c 6c  5f 45 76 65 6e 74 41 64  |.%.shell_EventAd|
00003cb0  64 28 77 68 25 2c 69 63  25 2c 38 2c 30 2c 74 61  |d(wh%,ic%,8,0,ta|
00003cc0  67 24 29 0d 01 e9 05 e1  0d 01 ea 05 3a 0d 01 eb  |g$).........:...|
00003cd0  22 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  |"*|Stop PROCshel|
00003ce0  6c 5f 41 74 74 61 63 68  48 65 6c 70 54 61 67 0d  |l_AttachHelpTag.|
00003cf0  01 ec 04 0d 01 ed 1e 2a  7c 53 74 61 72 74 20 50  |.......*|Start P|
00003d00  52 4f 43 73 68 65 6c 6c  5f 45 76 65 6e 74 41 64  |ROCshell_EventAd|
00003d10  64 0d 01 ee 30 dd 20 f2  73 68 65 6c 6c 5f 45 76  |d...0. .shell_Ev|
00003d20  65 6e 74 41 64 64 28 77  68 25 2c 69 63 25 2c 65  |entAdd(wh%,ic%,e|
00003d30  5f 74 79 70 65 25 2c 6d  65 6e 75 25 2c 66 6e 24  |_type%,menu%,fn$|
00003d40  29 0d 01 ef 2c ea 20 70  74 72 25 2c 66 6e 25 2c  |)...,. ptr%,fn%,|
00003d50  65 76 65 6e 74 5f 6c 69  73 74 25 2c 6c 69 73 74  |event_list%,list|
00003d60  5f 73 69 7a 65 25 2c 66  6f 75 6e 64 25 0d 01 f0  |_size%,found%...|
00003d70  0e ea 20 66 6e 5f 61 64  64 72 25 0d 01 f1 13 70  |.. fn_addr%....p|
00003d80  74 72 25 3d 30 3a 66 6f  75 6e 64 25 3d a3 0d 01  |tr%=0:found%=...|
00003d90  f2 15 e7 20 77 68 25 3d  2d 31 20 8c 20 77 68 25  |... wh%=-1 . wh%|
00003da0  3d 2d 32 0d 01 f3 2d 6c  69 73 74 5f 73 69 7a 65  |=-2...-list_size|
00003db0  25 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |%=.shell_HeapBlo|
00003dc0  63 6b 49 6e 66 6f 28 5f  55 25 21 31 32 29 2d 38  |ckInfo(_U%!12)-8|
00003dd0  0d 01 f4 16 65 76 65 6e  74 5f 6c 69 73 74 25 3d  |....event_list%=|
00003de0  5f 55 25 21 31 32 0d 01  f5 49 f4 20 50 52 4f 43  |_U%!12...I. PROC|
00003df0  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 58  |shell_Tracef0("X|
00003e00  58 3a 63 68 65 63 6b 69  6e 67 20 66 6f 72 20 77  |X:checking for w|
00003e10  68 20 26 22 2b 53 54 52  24 7e 77 68 25 2b 22 20  |h &"+STR$~wh%+" |
00003e20  69 68 20 26 22 2b 53 54  52 24 7e 69 63 25 29 0d  |ih &"+STR$~ic%).|
00003e30  01 f6 05 f5 0d 01 f7 20  20 20 e7 20 28 65 76 65  |.......   . (eve|
00003e40  6e 74 5f 6c 69 73 74 25  21 70 74 72 25 3d 77 68  |nt_list%!ptr%=wh|
00003e50  25 29 20 8c 0d 01 f8 30  20 20 20 20 f4 20 50 52  |%) ....0    . PR|
00003e60  4f 43 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  |OCshell_Tracef0(|
00003e70  22 58 58 3a 70 74 72 25  3d 22 2b 53 54 52 24 70  |"XX:ptr%="+STR$p|
00003e80  74 72 25 29 0d 01 f9 55  20 20 20 20 f4 20 50 52  |tr%)...U    . PR|
00003e90  4f 43 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  |OCshell_Tracef0(|
00003ea0  22 58 58 3a 66 6f 75 6e  64 20 77 69 6e 64 6f 77  |"XX:found window|
00003eb0  20 68 61 6e 64 6c 65 20  69 6e 20 6c 69 73 74 2c  | handle in list,|
00003ec0  20 63 68 65 63 6b 69 6e  67 20 69 63 6f 6e 20 68  | checking icon h|
00003ed0  61 6e 64 6c 65 2e 2e 22  29 0d 01 fa 24 20 20 20  |andle..")...$   |
00003ee0  20 e7 20 65 76 65 6e 74  5f 6c 69 73 74 25 21 28  | . event_list%!(|
00003ef0  70 74 72 25 2b 34 29 3d  69 63 25 20 8c 0d 01 fb  |ptr%+4)=ic% ....|
00003f00  12 20 20 20 20 20 20 66  6f 75 6e 64 25 3d b9 0d  |.      found%=..|
00003f10  01 fc 09 20 20 20 20 cc  0d 01 fd 12 20 20 20 20  |...    .....    |
00003f20  20 20 70 74 72 25 2b 3d  34 38 0d 01 fe 09 20 20  |  ptr%+=48....  |
00003f30  20 20 cd 0d 01 ff 07 20  20 cc 0d 02 00 10 20 20  |  .....  .....  |
00003f40  20 20 70 74 72 25 2b 3d  34 38 0d 02 01 07 20 20  |  ptr%+=48....  |
00003f50  cd 0d 02 02 21 fd 20 28  70 74 72 25 3e 3d 6c 69  |....!. (ptr%>=li|
00003f60  73 74 5f 73 69 7a 65 25  20 84 20 66 6f 75 6e 64  |st_size% . found|
00003f70  25 29 0d 02 03 10 e7 20  66 6f 75 6e 64 25 3d a3  |%)..... found%=.|
00003f80  20 8c 0d 02 04 0b 20 70  74 72 25 3d 30 0d 02 05  | ..... ptr%=0...|
00003f90  1e 20 c8 95 20 28 65 76  65 6e 74 5f 6c 69 73 74  |. .. (event_list|
00003fa0  25 21 70 74 72 25 3c 3e  30 20 29 0d 02 06 0f 20  |%!ptr%<>0 ).... |
00003fb0  20 20 70 74 72 25 2b 3d  34 38 0d 02 07 1b 20 20  |  ptr%+=48....  |
00003fc0  20 e7 20 70 74 72 25 3e  3d 6c 69 73 74 5f 73 69  | . ptr%>=list_si|
00003fd0  7a 65 25 20 8c 0d 02 08  31 20 20 20 20 20 5f 55  |ze% ....1     _U|
00003fe0  25 21 31 32 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |%!12=.shell_Heap|
00003ff0  42 6c 6f 63 6b 45 78 74  65 6e 64 28 5f 55 25 21  |BlockExtend(_U%!|
00004000  31 32 2c 34 38 29 0d 02  09 1b 20 20 20 20 20 65  |12,48)....     e|
00004010  76 65 6e 74 5f 6c 69 73  74 25 3d 5f 55 25 21 31  |vent_list%=_U%!1|
00004020  32 0d 02 0a 1f 20 20 20  20 20 65 76 65 6e 74 5f  |2....     event_|
00004030  6c 69 73 74 25 21 28 70  74 72 25 2b 30 29 3d 30  |list%!(ptr%+0)=0|
00004040  0d 02 0b 1f 20 20 20 20  20 65 76 65 6e 74 5f 6c  |....     event_l|
00004050  69 73 74 25 21 28 70 74  72 25 2b 34 29 3d 30 0d  |ist%!(ptr%+4)=0.|
00004060  02 0c 1f 20 20 20 20 20  65 76 65 6e 74 5f 6c 69  |...     event_li|
00004070  73 74 25 21 28 70 74 72  25 2b 38 29 3d 30 0d 02  |st%!(ptr%+8)=0..|
00004080  0d 20 20 20 20 20 20 65  76 65 6e 74 5f 6c 69 73  |.      event_lis|
00004090  74 25 21 28 70 74 72 25  2b 31 32 29 3d 30 0d 02  |t%!(ptr%+12)=0..|
000040a0  0e 20 20 20 20 20 20 65  76 65 6e 74 5f 6c 69 73  |.      event_lis|
000040b0  74 25 21 28 70 74 72 25  2b 31 36 29 3d 30 0d 02  |t%!(ptr%+16)=0..|
000040c0  0f 20 20 20 20 20 20 65  76 65 6e 74 5f 6c 69 73  |.      event_lis|
000040d0  74 25 21 28 70 74 72 25  2b 32 30 29 3d 30 0d 02  |t%!(ptr%+20)=0..|
000040e0  10 20 20 20 20 20 20 65  76 65 6e 74 5f 6c 69 73  |.      event_lis|
000040f0  74 25 21 28 70 74 72 25  2b 32 34 29 3d 30 0d 02  |t%!(ptr%+24)=0..|
00004100  11 20 20 20 20 20 20 65  76 65 6e 74 5f 6c 69 73  |.      event_lis|
00004110  74 25 21 28 70 74 72 25  2b 32 38 29 3d 30 0d 02  |t%!(ptr%+28)=0..|
00004120  12 20 20 20 20 20 20 65  76 65 6e 74 5f 6c 69 73  |.      event_lis|
00004130  74 25 21 28 70 74 72 25  2b 33 32 29 3d 30 0d 02  |t%!(ptr%+32)=0..|
00004140  13 20 20 20 20 20 20 65  76 65 6e 74 5f 6c 69 73  |.      event_lis|
00004150  74 25 21 28 70 74 72 25  2b 33 36 29 3d 30 0d 02  |t%!(ptr%+36)=0..|
00004160  14 20 20 20 20 20 20 65  76 65 6e 74 5f 6c 69 73  |.      event_lis|
00004170  74 25 21 28 70 74 72 25  2b 34 30 29 3d 30 0d 02  |t%!(ptr%+40)=0..|
00004180  15 20 20 20 20 20 20 65  76 65 6e 74 5f 6c 69 73  |.      event_lis|
00004190  74 25 21 28 70 74 72 25  2b 34 34 29 3d 30 0d 02  |t%!(ptr%+44)=0..|
000041a0  16 08 20 20 20 cd 0d 02  17 06 20 ce 0d 02 18 05  |..   ..... .....|
000041b0  cd 0d 02 19 1c 65 76 65  6e 74 5f 6c 69 73 74 25  |.....event_list%|
000041c0  21 28 70 74 72 25 2b 30  29 3d 77 68 25 0d 02 1a  |!(ptr%+0)=wh%...|
000041d0  1c 65 76 65 6e 74 5f 6c  69 73 74 25 21 28 70 74  |.event_list%!(pt|
000041e0  72 25 2b 34 29 3d 69 63  25 0d 02 1b 10 e7 20 6d  |r%+4)=ic%..... m|
000041f0  65 6e 75 25 3c 3e 30 20  8c 0d 02 1c 20 20 20 65  |enu%<>0 ....   e|
00004200  76 65 6e 74 5f 6c 69 73  74 25 21 28 70 74 72 25  |vent_list%!(ptr%|
00004210  2b 38 29 3d 6d 65 6e 75  25 0d 02 1d 05 cd 0d 02  |+8)=menu%.......|
00004220  1e 22 66 6e 5f 61 64 64  72 25 3d 70 74 72 25 2b  |."fn_addr%=ptr%+|
00004230  28 31 32 2b 28 65 5f 74  79 70 65 25 2a 34 29 29  |(12+(e_type%*4))|
00004240  0d 02 1f 1f e7 20 65 76  65 6e 74 5f 6c 69 73 74  |..... event_list|
00004250  25 21 66 6e 5f 61 64 64  72 25 3c 3e 30 20 8c 0d  |%!fn_addr%<>0 ..|
00004260  02 20 32 20 20 f2 73 68  65 6c 6c 5f 48 65 61 70  |. 2  .shell_Heap|
00004270  42 6c 6f 63 6b 52 65 74  75 72 6e 28 65 76 65 6e  |BlockReturn(even|
00004280  74 5f 6c 69 73 74 25 21  66 6e 5f 61 64 64 72 25  |t_list%!fn_addr%|
00004290  29 0d 02 21 05 cd 0d 02  22 25 66 6e 25 3d a4 73  |)..!...."%fn%=.s|
000042a0  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 46 65  |hell_HeapBlockFe|
000042b0  74 63 68 28 a9 66 6e 24  2b 31 29 0d 02 23 0c 24  |tch(.fn$+1)..#.$|
000042c0  66 6e 25 3d 66 6e 24 0d  02 24 1c 65 76 65 6e 74  |fn%=fn$..$.event|
000042d0  5f 6c 69 73 74 25 21 66  6e 5f 61 64 64 72 25 3d  |_list%!fn_addr%=|
000042e0  66 6e 25 0d 02 25 05 e1  0d 02 26 05 3a 0d 02 27  |fn%..%....&.:..'|
000042f0  1d 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  |.*|Stop PROCshel|
00004300  6c 5f 45 76 65 6e 74 41  64 64 0d 02 28 04 0d 02  |l_EventAdd..(...|
00004310  29 24 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |)$*|Start PROCsh|
00004320  65 6c 6c 5f 45 76 65 6e  74 44 65 6c 65 74 65 41  |ell_EventDeleteA|
00004330  6c 6c 0d 02 2a 20 dd 20  f2 73 68 65 6c 6c 5f 45  |ll..* . .shell_E|
00004340  76 65 6e 74 44 65 6c 65  74 65 41 6c 6c 28 77 68  |ventDeleteAll(wh|
00004350  25 29 0d 02 2b 34 ea 20  70 74 72 25 2c 6d 65 6e  |%)..+4. ptr%,men|
00004360  75 25 2c 66 6f 75 6e 64  25 2c 6c 69 73 74 5f 73  |u%,found%,list_s|
00004370  69 7a 65 25 2c 65 76 65  6e 74 5f 6c 69 73 74 25  |ize%,event_list%|
00004380  2c 6c 6f 6f 70 25 0d 02  2c 1b 70 74 72 25 3d 30  |,loop%..,.ptr%=0|
00004390  3a 6d 65 6e 75 25 3d 30  3a 66 6f 75 6e 64 25 3d  |:menu%=0:found%=|
000043a0  a3 0d 02 2d 15 e7 20 77  68 25 3d 2d 31 20 8c 20  |...-.. wh%=-1 . |
000043b0  77 68 25 3d 2d 32 0d 02  2e 2d 6c 69 73 74 5f 73  |wh%=-2...-list_s|
000043c0  69 7a 65 25 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |ize%=.shell_Heap|
000043d0  42 6c 6f 63 6b 49 6e 66  6f 28 5f 55 25 21 31 32  |BlockInfo(_U%!12|
000043e0  29 2d 38 0d 02 2f 16 65  76 65 6e 74 5f 6c 69 73  |)-8../.event_lis|
000043f0  74 25 3d 5f 55 25 21 31  32 0d 02 30 05 f5 0d 02  |t%=_U%!12..0....|
00004400  31 20 20 20 e7 20 28 65  76 65 6e 74 5f 6c 69 73  |1   . (event_lis|
00004410  74 25 21 70 74 72 25 3d  77 68 25 29 20 8c 0d 02  |t%!ptr%=wh%) ...|
00004420  32 10 20 20 20 20 66 6f  75 6e 64 25 3d b9 0d 02  |2.    found%=...|
00004430  33 07 20 20 cc 0d 02 34  10 20 20 20 20 70 74 72  |3.  ...4.    ptr|
00004440  25 2b 3d 34 38 0d 02 35  07 20 20 cd 0d 02 36 21  |%+=48..5.  ...6!|
00004450  fd 20 28 70 74 72 25 3e  3d 6c 69 73 74 5f 73 69  |. (ptr%>=list_si|
00004460  7a 65 25 20 84 20 66 6f  75 6e 64 25 29 0d 02 37  |ze% . found%)..7|
00004470  0e e7 20 66 6f 75 6e 64  25 20 8c 0d 02 38 1c 20  |.. found% ...8. |
00004480  20 65 76 65 6e 74 5f 6c  69 73 74 25 21 28 70 74  | event_list%!(pt|
00004490  72 25 2b 30 29 3d 30 0d  02 39 1c 20 20 65 76 65  |r%+0)=0..9.  eve|
000044a0  6e 74 5f 6c 69 73 74 25  21 28 70 74 72 25 2b 34  |nt_list%!(ptr%+4|
000044b0  29 3d 30 0d 02 3a 1c 20  20 65 76 65 6e 74 5f 6c  |)=0..:.  event_l|
000044c0  69 73 74 25 21 28 70 74  72 25 2b 38 29 3d 30 0d  |ist%!(ptr%+8)=0.|
000044d0  02 3b 19 20 20 e3 20 6c  6f 6f 70 25 3d 31 32 20  |.;.  . loop%=12 |
000044e0  b8 20 34 34 20 88 20 34  0d 02 3c 27 20 20 20 20  |. 44 . 4..<'    |
000044f0  e7 20 65 76 65 6e 74 5f  6c 69 73 74 25 21 28 70  |. event_list%!(p|
00004500  74 72 25 2b 6c 6f 6f 70  25 29 3c 3e 30 20 8c 0d  |tr%+loop%)<>0 ..|
00004510  02 3d 3a 20 20 20 20 20  20 f2 73 68 65 6c 6c 5f  |.=:      .shell_|
00004520  48 65 61 70 42 6c 6f 63  6b 52 65 74 75 72 6e 28  |HeapBlockReturn(|
00004530  65 76 65 6e 74 5f 6c 69  73 74 25 21 28 70 74 72  |event_list%!(ptr|
00004540  25 2b 6c 6f 6f 70 25 29  29 0d 02 3e 24 20 20 20  |%+loop%))..>$   |
00004550  20 20 20 65 76 65 6e 74  5f 6c 69 73 74 25 21 28  |   event_list%!(|
00004560  70 74 72 25 2b 6c 6f 6f  70 25 29 3d 30 0d 02 3f  |ptr%+loop%)=0..?|
00004570  09 20 20 20 20 cd 0d 02  40 0d 20 20 ed 20 6c 6f  |.    ...@.  . lo|
00004580  6f 70 25 0d 02 41 05 cd  0d 02 42 3a f4 20 72 65  |op%..A....B:. re|
00004590  6d 6f 76 65 20 61 6c 6c  20 44 61 74 61 53 61 76  |move all DataSav|
000045a0  65 20 65 76 65 6e 74 73  20 66 6f 72 20 74 68 65  |e events for the|
000045b0  20 63 75 72 72 65 6e 74  20 77 69 6e 64 6f 77 2e  | current window.|
000045c0  2e 2e 0d 02 43 30 f2 73  68 65 6c 6c 5f 54 72 61  |....C0.shell_Tra|
000045d0  63 65 66 30 28 22 45 76  65 6e 74 44 65 6c 65 74  |cef0("EventDelet|
000045e0  65 41 6c 6c 3a 77 68 25  3d 26 22 2b c3 7e 77 68  |eAll:wh%=&"+.~wh|
000045f0  25 29 0d 02 44 26 f2 73  68 65 6c 6c 5f 44 65 6c  |%)..D&.shell_Del|
00004600  65 74 65 45 76 65 6e 74  44 61 74 61 53 61 76 65  |eteEventDataSave|
00004610  28 77 68 25 2c 2d 31 29  0d 02 45 22 f2 73 68 65  |(wh%,-1)..E".she|
00004620  6c 6c 5f 44 65 6c 65 74  65 45 76 65 6e 74 42 75  |ll_DeleteEventBu|
00004630  6d 70 28 77 68 25 2c 2d  31 29 0d 02 46 24 f2 73  |mp(wh%,-1)..F$.s|
00004640  68 65 6c 6c 5f 44 65 6c  65 74 65 45 76 65 6e 74  |hell_DeleteEvent|
00004650  53 6c 69 64 65 72 28 77  68 25 2c 2d 31 29 0d 02  |Slider(wh%,-1)..|
00004660  47 3f f4 20 73 68 6f 75  6c 64 20 72 65 64 75 63  |G?. should reduc|
00004670  65 20 73 69 7a 65 20 6f  66 20 65 76 65 6e 74 20  |e size of event |
00004680  6c 69 73 74 20 62 6c 6f  63 6b 20 69 66 20 70 6f  |list block if po|
00004690  73 73 69 62 6c 65 2e 2e  2e 2e 2e 2e 2e 0d 02 48  |ssible.........H|
000046a0  05 e1 0d 02 49 05 3a 0d  02 4a 23 2a 7c 53 74 6f  |....I.:..J#*|Sto|
000046b0  70 20 50 52 4f 43 73 68  65 6c 6c 5f 45 76 65 6e  |p PROCshell_Even|
000046c0  74 44 65 6c 65 74 65 41  6c 6c 0d 02 4b 04 0d 02  |tDeleteAll..K...|
000046d0  4c 25 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |L%*|Start PROCsh|
000046e0  65 6c 6c 5f 44 65 6c 65  74 65 45 76 65 6e 74 42  |ell_DeleteEventB|
000046f0  75 6d 70 0d 02 4d 25 dd  20 f2 73 68 65 6c 6c 5f  |ump..M%. .shell_|
00004700  44 65 6c 65 74 65 45 76  65 6e 74 42 75 6d 70 28  |DeleteEventBump(|
00004710  77 68 25 2c 69 68 25 29  0d 02 4e 43 f4 20 69 66  |wh%,ih%)..NC. if|
00004720  20 49 20 63 61 6e 20 66  69 6e 64 20 77 68 69 63  | I can find whic|
00004730  68 20 77 6f 72 64 73 20  70 6f 69 6e 74 20 74 6f  |h words point to|
00004740  20 61 20 68 65 61 70 20  62 6c 6f 63 6b 20 74 68  | a heap block th|
00004750  65 79 20 63 6f 75 6c 64  20 62 65 0d 02 4f 44 f4  |ey could be..OD.|
00004760  20 61 75 74 6f 6d 61 74  69 63 61 6c 6c 79 20 64  | automatically d|
00004770  65 74 65 63 74 65 64 20  61 6e 64 20 72 65 6c 65  |etected and rele|
00004780  61 73 65 64 2e 20 41 20  67 65 6e 65 72 61 6c 20  |ased. A general |
00004790  70 75 72 70 6f 73 65 20  72 6f 75 74 69 6e 65 0d  |purpose routine.|
000047a0  02 50 2e f4 20 73 68 65  6c 6c 5f 44 65 6c 65 74  |.P.. shell_Delet|
000047b0  65 45 76 65 6e 74 20 63  6f 75 6c 64 20 74 68 65  |eEvent could the|
000047c0  6e 20 62 65 20 77 72 69  74 74 65 6e 21 0d 02 51  |n be written!..Q|
000047d0  37 f4 20 49 66 20 69 68  25 3d 2d 31 20 72 65 6d  |7. If ih%=-1 rem|
000047e0  6f 76 65 20 61 6c 6c 20  65 76 65 6e 74 73 20 66  |ove all events f|
000047f0  6f 72 20 77 69 6e 64 6f  77 20 68 61 6e 64 6c 65  |or window handle|
00004800  20 77 68 25 0d 02 52 2f  ea 20 6f 66 66 73 65 74  | wh%..R/. offset|
00004810  25 2c 62 6c 6b 25 2c 6c  69 73 74 5f 73 69 7a 65  |%,blk%,list_size|
00004820  25 2c 65 76 65 6e 74 5f  6c 69 73 74 25 2c 74 65  |%,event_list%,te|
00004830  6d 70 25 0d 02 53 17 65  76 65 6e 74 5f 6c 69 73  |mp%..S.event_lis|
00004840  74 25 3d 5f 55 25 21 31  30 34 0d 02 54 05 f5 0d  |t%=_U%!104..T...|
00004850  02 55 3d 20 20 6f 66 66  73 65 74 25 3d a4 73 68  |.U=  offset%=.sh|
00004860  65 6c 6c 5f 47 65 74 45  76 65 6e 74 4c 69 73 74  |ell_GetEventList|
00004870  4f 66 66 73 65 74 28 77  68 25 2c 69 68 25 2c 5f  |Offset(wh%,ih%,_|
00004880  55 25 2b 31 30 34 2c 31  36 2c a3 29 0d 02 56 15  |U%+104,16,.)..V.|
00004890  2a 7c 69 66 64 65 66 20  54 72 61 63 65 49 6e 69  |*|ifdef TraceIni|
000048a0  74 0d 02 57 39 20 20 f2  73 68 65 6c 6c 5f 54 72  |t..W9  .shell_Tr|
000048b0  61 63 65 66 30 28 22 44  65 6c 65 74 65 45 76 65  |acef0("DeleteEve|
000048c0  6e 74 42 75 6d 70 3a 6f  66 66 73 65 74 25 3d 22  |ntBump:offset%="|
000048d0  2b c3 6f 66 66 73 65 74  25 29 0d 02 58 0b 2a 7c  |+.offset%)..X.*||
000048e0  65 6e 64 69 66 0d 02 59  14 20 20 e7 20 6f 66 66  |endif..Y.  . off|
000048f0  73 65 74 25 3e 3d 30 20  8c 0d 02 5a 12 20 20 20  |set%>=0 ...Z.   |
00004900  20 e7 20 69 68 25 3d 2d  31 20 8c 0d 02 5b 15 2a  | . ih%=-1 ...[.*|
00004910  7c 69 66 64 65 66 20 54  72 61 63 65 49 6e 69 74  ||ifdef TraceInit|
00004920  0d 02 5c 69 20 20 20 20  20 20 f2 73 68 65 6c 6c  |..\i      .shell|
00004930  5f 54 72 61 63 65 66 30  28 22 44 65 6c 65 74 65  |_Tracef0("Delete|
00004940  45 76 65 6e 74 42 75 6d  70 3a 44 65 6c 65 74 69  |EventBump:Deleti|
00004950  6e 67 20 42 75 6d 70 20  45 76 65 6e 74 20 28 61  |ng Bump Event (a|
00004960  6c 6c 20 65 76 65 6e 74  73 20 66 6f 72 20 77 69  |ll events for wi|
00004970  6e 64 6f 77 20 68 61 6e  64 6c 65 20 26 22 2b c3  |ndow handle &"+.|
00004980  7e 77 68 25 2b 22 29 22  29 0d 02 5d 0b 2a 7c 65  |~wh%+")")..].*|e|
00004990  6e 64 69 66 0d 02 5e 09  20 20 20 20 cc 0d 02 5f  |ndif..^.    ..._|
000049a0  15 2a 7c 69 66 64 65 66  20 54 72 61 63 65 49 6e  |.*|ifdef TraceIn|
000049b0  69 74 0d 02 60 77 20 20  20 20 20 20 f2 73 68 65  |it..`w      .she|
000049c0  6c 6c 5f 54 72 61 63 65  66 30 28 22 44 65 6c 65  |ll_Tracef0("Dele|
000049d0  74 65 45 76 65 6e 74 42  75 6d 70 3a 44 65 6c 65  |teEventBump:Dele|
000049e0  74 69 6e 67 20 42 75 6d  70 20 45 76 65 6e 74 20  |ting Bump Event |
000049f0  28 77 69 6e 64 6f 77 20  68 61 6e 64 6c 65 20 77  |(window handle w|
00004a00  61 73 20 26 22 2b c3 7e  77 68 25 2b 22 20 69 63  |as &"+.~wh%+" ic|
00004a10  6f 6e 20 68 61 6e 64 6c  65 20 77 61 73 20 22 2b  |on handle was "+|
00004a20  c3 69 68 25 2b 22 29 22  29 0d 02 61 0b 2a 7c 65  |.ih%+")")..a.*|e|
00004a30  6e 64 69 66 0d 02 62 09  20 20 20 20 cd 0d 02 63  |ndif..b.    ...c|
00004a40  2a 20 20 20 20 f4 20 65  76 65 6e 74 20 66 6f 72  |*    . event for|
00004a50  20 77 69 6e 64 6f 77 2f  69 63 6f 6e 20 69 73 20  | window/icon is |
00004a60  69 6e 20 6c 69 73 74 0d  02 64 32 20 20 20 20 6c  |in list..d2    l|
00004a70  69 73 74 5f 73 69 7a 65  25 3d a4 73 68 65 6c 6c  |ist_size%=.shell|
00004a80  5f 48 65 61 70 42 6c 6f  63 6b 49 6e 66 6f 28 5f  |_HeapBlockInfo(_|
00004a90  55 25 21 31 30 34 29 2d  38 0d 02 65 21 20 20 20  |U%!104)-8..e!   |
00004aa0  20 e7 20 6f 66 66 73 65  74 25 3d 6c 69 73 74 5f  | . offset%=list_|
00004ab0  73 69 7a 65 25 2d 31 36  20 8c 0d 02 66 2b 20 20  |size%-16 ...f+  |
00004ac0  20 20 20 20 f4 20 69 74  20 69 73 20 74 68 65 20  |    . it is the |
00004ad0  6c 61 73 74 20 6f 6e 65  20 69 6e 20 74 68 69 73  |last one in this|
00004ae0  20 6c 69 73 74 0d 02 67  17 20 20 20 20 20 20 e7  | list..g.      .|
00004af0  20 6f 66 66 73 65 74 25  3d 30 20 8c 0d 02 68 28  | offset%=0 ...h(|
00004b00  20 20 20 20 20 20 20 20  f4 20 6f 6e 6c 79 20 6f  |        . only o|
00004b10  6e 65 20 65 76 65 6e 74  20 69 6e 20 74 68 65 20  |ne event in the |
00004b20  6c 69 73 74 0d 02 69 24  20 20 20 20 20 20 20 20  |list..i$        |
00004b30  69 6e 66 6f 5f 62 6c 6b  25 3d 65 76 65 6e 74 5f  |info_blk%=event_|
00004b40  6c 69 73 74 25 21 31 32  0d 02 6a 1e 20 20 20 20  |list%!12..j.    |
00004b50  20 20 20 20 74 65 6d 70  25 3d 69 6e 66 6f 5f 62  |    temp%=info_b|
00004b60  6c 6b 25 21 31 32 0d 02  6b 2c 20 20 20 20 20 20  |lk%!12..k,      |
00004b70  20 20 f2 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |  .shell_HeapBlo|
00004b80  63 6b 52 65 74 75 72 6e  28 74 65 6d 70 25 21 31  |ckReturn(temp%!1|
00004b90  32 29 0d 02 6c 2c 20 20  20 20 20 20 20 20 f2 73  |2)..l,        .s|
00004ba0  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 52 65  |hell_HeapBlockRe|
00004bb0  74 75 72 6e 28 74 65 6d  70 25 21 31 36 29 0d 02  |turn(temp%!16)..|
00004bc0  6d 29 20 20 20 20 20 20  20 20 f2 73 68 65 6c 6c  |m)        .shell|
00004bd0  5f 48 65 61 70 42 6c 6f  63 6b 52 65 74 75 72 6e  |_HeapBlockReturn|
00004be0  28 74 65 6d 70 25 29 0d  02 6e 2b 20 20 20 20 20  |(temp%)..n+     |
00004bf0  20 20 20 f2 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |   .shell_HeapBl|
00004c00  6f 63 6b 52 65 74 75 72  6e 28 5f 55 25 21 31 30  |ockReturn(_U%!10|
00004c10  34 29 0d 02 6f 15 20 20  20 20 20 20 20 20 5f 55  |4)..o.        _U|
00004c20  25 21 31 30 34 3d 30 0d  02 70 15 2a 7c 69 66 64  |%!104=0..p.*|ifd|
00004c30  65 66 20 54 72 61 63 65  49 6e 69 74 0d 02 71 4b  |ef TraceInit..qK|
00004c40  20 20 20 20 20 20 20 20  f2 73 68 65 6c 6c 5f 54  |        .shell_T|
00004c50  72 61 63 65 66 30 28 22  44 65 6c 65 74 65 45 76  |racef0("DeleteEv|
00004c60  65 6e 74 42 75 6d 70 3a  4e 6f 20 42 75 6d 70 20  |entBump:No Bump |
00004c70  65 76 65 6e 74 73 20 6e  6f 77 20 72 65 67 69 73  |events now regis|
00004c80  74 65 72 65 64 22 29 0d  02 72 0b 2a 7c 65 6e 64  |tered")..r.*|end|
00004c90  69 66 0d 02 73 0b 20 20  20 20 20 20 cc 0d 02 74  |if..s.      ...t|
00004ca0  2d 20 20 20 20 20 20 20  20 f4 20 6d 6f 72 65 20  |-        . more |
00004cb0  74 68 61 6e 20 6f 6e 65  20 65 76 65 6e 74 20 69  |than one event i|
00004cc0  6e 20 74 68 65 20 6c 69  73 74 0d 02 75 37 20 20  |n the list..u7  |
00004cd0  20 20 20 20 20 20 5f 55  25 21 31 30 34 3d a4 73  |      _U%!104=.s|
00004ce0  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 45 78  |hell_HeapBlockEx|
00004cf0  74 65 6e 64 28 5f 55 25  21 31 30 34 2c 2d 31 36  |tend(_U%!104,-16|
00004d00  29 0d 02 76 0b 20 20 20  20 20 20 cd 0d 02 77 09  |)..v.      ...w.|
00004d10  20 20 20 20 cc 0d 02 78  28 20 20 20 20 20 20 f4  |    ...x(      .|
00004d20  20 6e 6f 74 20 74 68 65  20 6c 61 73 74 20 6f 6e  | not the last on|
00004d30  65 20 69 6e 20 74 68 65  20 6c 69 73 74 0d 02 79  |e in the list..y|
00004d40  22 20 20 20 20 20 20 62  6c 6b 25 3d 65 76 65 6e  |"      blk%=even|
00004d50  74 5f 6c 69 73 74 25 2b  6f 66 66 73 65 74 25 0d  |t_list%+offset%.|
00004d60  02 7a 24 20 20 20 20 20  20 62 6c 6b 25 21 30 3d  |.z$      blk%!0=|
00004d70  30 3a 62 6c 6b 25 21 34  3d 30 3a 62 6c 6b 25 21  |0:blk%!4=0:blk%!|
00004d80  38 3d 30 0d 02 7b 1b 20  20 20 20 20 20 69 6e 66  |8=0..{.      inf|
00004d90  6f 5f 62 6c 6b 25 3d 62  6c 6b 25 21 31 32 0d 02  |o_blk%=blk%!12..|
00004da0  7c 2e 20 20 20 20 20 20  f2 73 68 65 6c 6c 5f 48  ||.      .shell_H|
00004db0  65 61 70 42 6c 6f 63 6b  52 65 74 75 72 6e 28 69  |eapBlockReturn(i|
00004dc0  6e 66 6f 5f 62 6c 6b 25  21 31 32 29 0d 02 7d 2e  |nfo_blk%!12)..}.|
00004dd0  20 20 20 20 20 20 f2 73  68 65 6c 6c 5f 48 65 61  |      .shell_Hea|
00004de0  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 69 6e 66  |pBlockReturn(inf|
00004df0  6f 5f 62 6c 6b 25 21 31  36 29 0d 02 7e 2b 20 20  |o_blk%!16)..~+  |
00004e00  20 20 20 20 f2 73 68 65  6c 6c 5f 48 65 61 70 42  |    .shell_HeapB|
00004e10  6c 6f 63 6b 52 65 74 75  72 6e 28 69 6e 66 6f 5f  |lockReturn(info_|
00004e20  62 6c 6b 25 29 0d 02 7f  09 20 20 20 20 cd 0d 02  |blk%)....    ...|
00004e30  80 07 20 20 cd 0d 02 81  36 20 20 f4 20 72 65 70  |..  ....6  . rep|
00004e40  65 61 74 20 6c 6f 6f 70  20 75 6e 74 69 6c 20 6f  |eat loop until o|
00004e50  66 66 73 65 74 25 3d 2d  31 20 28 65 76 65 6e 74  |ffset%=-1 (event|
00004e60  20 6e 6f 74 20 66 6f 75  6e 64 29 0d 02 82 31 20  | not found)...1 |
00004e70  20 f4 20 6f 72 20 6f 66  66 73 65 74 25 3d 2d 32  | . or offset%=-2|
00004e80  20 28 65 76 65 6e 74 20  62 6c 6f 63 6b 20 64 6f  | (event block do|
00004e90  65 73 6e 27 74 20 65 78  69 73 74 29 0d 02 83 0f  |esn't exist)....|
00004ea0  fd 20 6f 66 66 73 65 74  25 3c 30 0d 02 84 05 e1  |. offset%<0.....|
00004eb0  0d 02 85 05 3a 0d 02 86  24 2a 7c 53 74 6f 70 20  |....:...$*|Stop |
00004ec0  50 52 4f 43 73 68 65 6c  6c 5f 44 65 6c 65 74 65  |PROCshell_Delete|
00004ed0  45 76 65 6e 74 42 75 6d  70 0d 02 87 04 0d 02 88  |EventBump.......|
00004ee0  29 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |)*|Start PROCshe|
00004ef0  6c 6c 5f 44 65 6c 65 74  65 45 76 65 6e 74 44 61  |ll_DeleteEventDa|
00004f00  74 61 53 61 76 65 0d 02  89 29 dd 20 f2 73 68 65  |taSave...). .she|
00004f10  6c 6c 5f 44 65 6c 65 74  65 45 76 65 6e 74 44 61  |ll_DeleteEventDa|
00004f20  74 61 53 61 76 65 28 77  68 25 2c 69 68 25 29 0d  |taSave(wh%,ih%).|
00004f30  02 8a 43 f4 20 69 66 20  49 20 63 61 6e 20 66 69  |..C. if I can fi|
00004f40  6e 64 20 77 68 69 63 68  20 77 6f 72 64 73 20 70  |nd which words p|
00004f50  6f 69 6e 74 20 74 6f 20  61 20 68 65 61 70 20 62  |oint to a heap b|
00004f60  6c 6f 63 6b 20 74 68 65  79 20 63 6f 75 6c 64 20  |lock they could |
00004f70  62 65 0d 02 8b 44 f4 20  61 75 74 6f 6d 61 74 69  |be...D. automati|
00004f80  63 61 6c 6c 79 20 64 65  74 65 63 74 65 64 20 61  |cally detected a|
00004f90  6e 64 20 72 65 6c 65 61  73 65 64 2e 20 41 20 67  |nd released. A g|
00004fa0  65 6e 65 72 61 6c 20 70  75 72 70 6f 73 65 20 72  |eneral purpose r|
00004fb0  6f 75 74 69 6e 65 0d 02  8c 2e f4 20 73 68 65 6c  |outine..... shel|
00004fc0  6c 5f 44 65 6c 65 74 65  45 76 65 6e 74 20 63 6f  |l_DeleteEvent co|
00004fd0  75 6c 64 20 74 68 65 6e  20 62 65 20 77 72 69 74  |uld then be writ|
00004fe0  74 65 6e 21 0d 02 8d 37  f4 20 49 66 20 69 68 25  |ten!...7. If ih%|
00004ff0  3d 2d 31 20 72 65 6d 6f  76 65 20 61 6c 6c 20 65  |=-1 remove all e|
00005000  76 65 6e 74 73 20 66 6f  72 20 77 69 6e 64 6f 77  |vents for window|
00005010  20 68 61 6e 64 6c 65 20  77 68 25 0d 02 8e 1d ea  | handle wh%.....|
00005020  20 6f 66 66 73 65 74 25  2c 62 6c 6b 25 2c 6c 69  | offset%,blk%,li|
00005030  73 74 5f 73 69 7a 65 25  0d 02 8f 3d f4 20 50 52  |st_size%...=. PR|
00005040  4f 43 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  |OCshell_Tracef0(|
00005050  22 44 65 6c 65 74 65 45  76 65 6e 74 44 61 74 61  |"DeleteEventData|
00005060  53 61 76 65 3a 77 68 25  3d 26 22 2b 53 54 52 24  |Save:wh%=&"+STR$|
00005070  7e 77 68 25 29 0d 02 90  3b f4 20 50 52 4f 43 73  |~wh%)...;. PROCs|
00005080  68 65 6c 6c 5f 54 72 61  63 65 66 30 28 22 44 65  |hell_Tracef0("De|
00005090  6c 65 74 65 45 76 65 6e  74 44 61 74 61 53 61 76  |leteEventDataSav|
000050a0  65 3a 69 68 25 3d 22 2b  53 54 52 24 69 68 25 29  |e:ih%="+STR$ih%)|
000050b0  0d 02 91 05 f5 0d 02 92  3c 20 20 6f 66 66 73 65  |........<  offse|
000050c0  74 25 3d a4 73 68 65 6c  6c 5f 47 65 74 45 76 65  |t%=.shell_GetEve|
000050d0  6e 74 4c 69 73 74 4f 66  66 73 65 74 28 77 68 25  |ntListOffset(wh%|
000050e0  2c 69 68 25 2c 5f 55 25  2b 37 32 2c 32 34 2c a3  |,ih%,_U%+72,24,.|
000050f0  29 0d 02 93 45 20 20 f4  20 50 52 4f 43 73 68 65  |)...E  . PROCshe|
00005100  6c 6c 5f 54 72 61 63 65  66 30 28 22 44 65 6c 65  |ll_Tracef0("Dele|
00005110  74 65 45 76 65 6e 74 44  61 74 61 53 61 76 65 3a  |teEventDataSave:|
00005120  6f 66 66 73 65 74 25 3d  22 2b 53 54 52 24 6f 66  |offset%="+STR$of|
00005130  66 73 65 74 25 29 0d 02  94 14 20 20 e7 20 6f 66  |fset%)....  . of|
00005140  66 73 65 74 25 3e 3d 30  20 8c 0d 02 95 12 20 20  |fset%>=0 .....  |
00005150  20 20 e7 20 69 68 25 3d  2d 31 20 8c 0d 02 96 6d  |  . ih%=-1 ....m|
00005160  20 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |  .shell_Tracef0|
00005170  28 22 44 65 6c 65 74 65  45 76 65 6e 74 44 61 74  |("DeleteEventDat|
00005180  61 53 61 76 65 3a 44 65  6c 65 74 69 6e 67 20 44  |aSave:Deleting D|
00005190  61 74 61 53 61 76 65 20  45 76 65 6e 74 20 28 61  |ataSave Event (a|
000051a0  6c 6c 20 65 76 65 6e 74  73 20 66 6f 72 20 77 69  |ll events for wi|
000051b0  6e 64 6f 77 20 68 61 6e  64 6c 65 20 26 22 2b c3  |ndow handle &"+.|
000051c0  7e 77 68 25 2b 22 29 22  29 0d 02 97 09 20 20 20  |~wh%+")")....   |
000051d0  20 cc 0d 02 98 7b 20 20  f2 73 68 65 6c 6c 5f 54  | ....{  .shell_T|
000051e0  72 61 63 65 66 30 28 22  44 65 6c 65 74 65 45 76  |racef0("DeleteEv|
000051f0  65 6e 74 44 61 74 61 53  61 76 65 3a 44 65 6c 65  |entDataSave:Dele|
00005200  74 69 6e 67 20 44 61 74  61 53 61 76 65 20 45 76  |ting DataSave Ev|
00005210  65 6e 74 20 28 77 69 6e  64 6f 77 20 68 61 6e 64  |ent (window hand|
00005220  6c 65 20 77 61 73 20 26  22 2b c3 7e 77 68 25 2b  |le was &"+.~wh%+|
00005230  22 20 69 63 6f 6e 20 68  61 6e 64 6c 65 20 77 61  |" icon handle wa|
00005240  73 20 22 2b c3 69 68 25  2b 22 29 22 29 0d 02 99  |s "+.ih%+")")...|
00005250  09 20 20 20 20 cd 0d 02  9a 2a 20 20 20 20 f4 20  |.    ....*    . |
00005260  65 76 65 6e 74 20 66 6f  72 20 77 69 6e 64 6f 77  |event for window|
00005270  2f 69 63 6f 6e 20 69 73  20 69 6e 20 6c 69 73 74  |/icon is in list|
00005280  0d 02 9b 31 20 20 20 20  6c 69 73 74 5f 73 69 7a  |...1    list_siz|
00005290  65 25 3d a4 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |e%=.shell_HeapBl|
000052a0  6f 63 6b 49 6e 66 6f 28  5f 55 25 21 37 32 29 2d  |ockInfo(_U%!72)-|
000052b0  38 0d 02 9c 21 20 20 20  20 e7 20 6f 66 66 73 65  |8...!    . offse|
000052c0  74 25 3d 6c 69 73 74 5f  73 69 7a 65 25 2d 32 34  |t%=list_size%-24|
000052d0  20 8c 0d 02 9d 2b 20 20  20 20 20 20 f4 20 69 74  | ....+      . it|
000052e0  20 69 73 20 74 68 65 20  6c 61 73 74 20 6f 6e 65  | is the last one|
000052f0  20 69 6e 20 74 68 69 73  20 6c 69 73 74 0d 02 9e  | in this list...|
00005300  17 20 20 20 20 20 20 e7  20 6f 66 66 73 65 74 25  |.      . offset%|
00005310  3d 30 20 8c 0d 02 9f 28  20 20 20 20 20 20 20 20  |=0 ....(        |
00005320  f4 20 6f 6e 6c 79 20 6f  6e 65 20 65 76 65 6e 74  |. only one event|
00005330  20 69 6e 20 74 68 65 20  6c 69 73 74 0d 02 a0 2a  | in the list...*|
00005340  20 20 20 20 20 20 20 20  f2 73 68 65 6c 6c 5f 48  |        .shell_H|
00005350  65 61 70 42 6c 6f 63 6b  52 65 74 75 72 6e 28 5f  |eapBlockReturn(_|
00005360  55 25 21 37 32 29 0d 02  a1 14 20 20 20 20 20 20  |U%!72)....      |
00005370  20 20 5f 55 25 21 37 32  3d 30 0d 02 a2 15 2a 7c  |  _U%!72=0....*||
00005380  69 66 64 65 66 20 54 72  61 63 65 49 6e 69 74 0d  |ifdef TraceInit.|
00005390  02 a3 51 20 20 20 20 20  20 f2 73 68 65 6c 6c 5f  |..Q      .shell_|
000053a0  54 72 61 63 65 66 30 28  22 44 65 6c 65 74 65 45  |Tracef0("DeleteE|
000053b0  76 65 6e 74 44 61 74 61  53 61 76 65 3a 4e 6f 20  |ventDataSave:No |
000053c0  44 61 74 61 53 61 76 65  20 65 76 65 6e 74 73 20  |DataSave events |
000053d0  6e 6f 77 20 72 65 67 69  73 74 65 72 65 64 22 29  |now registered")|
000053e0  0d 02 a4 0b 2a 7c 65 6e  64 69 66 0d 02 a5 0b 20  |....*|endif.... |
000053f0  20 20 20 20 20 cc 0d 02  a6 2d 20 20 20 20 20 20  |     ....-      |
00005400  20 20 f4 20 6d 6f 72 65  20 74 68 61 6e 20 6f 6e  |  . more than on|
00005410  65 20 65 76 65 6e 74 20  69 6e 20 74 68 65 20 6c  |e event in the l|
00005420  69 73 74 0d 02 a7 35 20  20 20 20 20 20 20 20 5f  |ist...5        _|
00005430  55 25 21 37 32 3d a4 73  68 65 6c 6c 5f 48 65 61  |U%!72=.shell_Hea|
00005440  70 42 6c 6f 63 6b 45 78  74 65 6e 64 28 5f 55 25  |pBlockExtend(_U%|
00005450  21 37 32 2c 2d 32 34 29  0d 02 a8 0b 20 20 20 20  |!72,-24)....    |
00005460  20 20 cd 0d 02 a9 09 20  20 20 20 cc 0d 02 aa 28  |  .....    ....(|
00005470  20 20 20 20 20 20 f4 20  6e 6f 74 20 74 68 65 20  |      . not the |
00005480  6c 61 73 74 20 6f 6e 65  20 69 6e 20 74 68 65 20  |last one in the |
00005490  6c 69 73 74 0d 02 ab 22  20 20 20 20 20 20 62 6c  |list..."      bl|
000054a0  6b 25 3d 65 76 65 6e 74  5f 6c 69 73 74 25 2b 6f  |k%=event_list%+o|
000054b0  66 66 73 65 74 25 0d 02  ac 38 20 20 20 20 20 20  |ffset%...8      |
000054c0  62 6c 6b 25 21 30 3d 30  3a 62 6c 6b 25 21 34 3d  |blk%!0=0:blk%!4=|
000054d0  30 3a 62 6c 6b 25 21 38  3d 30 3a 62 6c 6b 25 21  |0:blk%!8=0:blk%!|
000054e0  31 32 3d 30 3a 62 6c 6b  25 21 31 36 3d 30 0d 02  |12=0:blk%!16=0..|
000054f0  ad 33 20 20 20 20 20 20  f2 73 68 65 6c 6c 5f 48  |.3      .shell_H|
00005500  65 61 70 42 6c 6f 63 6b  52 65 74 75 72 6e 28 62  |eapBlockReturn(b|
00005510  6c 6b 25 21 32 30 29 3a  62 6c 6b 25 21 32 30 3d  |lk%!20):blk%!20=|
00005520  30 0d 02 ae 09 20 20 20  20 cd 0d 02 af 07 20 20  |0....    .....  |
00005530  cd 0d 02 b0 36 20 20 f4  20 72 65 70 65 61 74 20  |....6  . repeat |
00005540  6c 6f 6f 70 20 75 6e 74  69 6c 20 6f 66 66 73 65  |loop until offse|
00005550  74 25 3d 2d 31 20 28 65  76 65 6e 74 20 6e 6f 74  |t%=-1 (event not|
00005560  20 66 6f 75 6e 64 29 0d  02 b1 31 20 20 f4 20 6f  | found)...1  . o|
00005570  72 20 6f 66 66 73 65 74  25 3d 2d 32 20 28 65 76  |r offset%=-2 (ev|
00005580  65 6e 74 20 62 6c 6f 63  6b 20 64 6f 65 73 6e 27  |ent block doesn'|
00005590  74 20 65 78 69 73 74 29  0d 02 b2 0f fd 20 6f 66  |t exist)..... of|
000055a0  66 73 65 74 25 3c 30 0d  02 b3 05 e1 0d 02 b4 05  |fset%<0.........|
000055b0  3a 0d 02 b5 28 2a 7c 53  74 6f 70 20 50 52 4f 43  |:...(*|Stop PROC|
000055c0  73 68 65 6c 6c 5f 44 65  6c 65 74 65 45 76 65 6e  |shell_DeleteEven|
000055d0  74 44 61 74 61 53 61 76  65 0d 02 b6 04 0d 02 b7  |tDataSave.......|
000055e0  21 2a 7c 53 74 61 72 74  20 46 4e 73 68 65 6c 6c  |!*|Start FNshell|
000055f0  5f 4d 65 73 73 61 67 65  4e 6f 41 72 67 73 0d 02  |_MessageNoArgs..|
00005600  b8 20 dd 20 a4 73 68 65  6c 6c 5f 4d 65 73 73 61  |. . .shell_Messa|
00005610  67 65 4e 6f 41 72 67 73  28 74 61 67 24 29 0d 02  |geNoArgs(tag$)..|
00005620  b9 25 3d a4 73 68 65 6c  6c 5f 4d 65 73 73 61 67  |.%=.shell_Messag|
00005630  65 4c 6f 6f 6b 75 70 28  74 61 67 24 2c 22 22 2c  |eLookup(tag$,"",|
00005640  22 22 29 0d 02 ba 05 3a  0d 02 bb 20 2a 7c 53 74  |"")....:... *|St|
00005650  6f 70 20 46 4e 73 68 65  6c 6c 5f 4d 65 73 73 61  |op FNshell_Messa|
00005660  67 65 4e 6f 41 72 67 73  0d 02 bc 04 0d 02 bd 21  |geNoArgs.......!|
00005670  2a 7c 53 74 61 72 74 20  46 4e 73 68 65 6c 6c 5f  |*|Start FNshell_|
00005680  4d 65 73 73 61 67 65 4f  6e 65 41 72 67 0d 02 be  |MessageOneArg...|
00005690  26 dd 20 a4 73 68 65 6c  6c 5f 4d 65 73 73 61 67  |&. .shell_Messag|
000056a0  65 4f 6e 65 41 72 67 28  74 61 67 24 2c 61 72 67  |eOneArg(tag$,arg|
000056b0  31 24 29 0d 02 bf 28 3d  a4 73 68 65 6c 6c 5f 4d  |1$)...(=.shell_M|
000056c0  65 73 73 61 67 65 4c 6f  6f 6b 75 70 28 74 61 67  |essageLookup(tag|
000056d0  24 2c 61 72 67 31 24 2c  22 22 29 0d 02 c0 05 3a  |$,arg1$,"")....:|
000056e0  0d 02 c1 20 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |... *|Stop FNshe|
000056f0  6c 6c 5f 4d 65 73 73 61  67 65 4f 6e 65 41 72 67  |ll_MessageOneArg|
00005700  0d 02 c2 04 0d 02 c3 21  2a 7c 53 74 61 72 74 20  |.......!*|Start |
00005710  46 4e 73 68 65 6c 6c 5f  4d 65 73 73 61 67 65 4c  |FNshell_MessageL|
00005720  6f 6f 6b 75 70 0d 02 c4  2c dd 20 a4 73 68 65 6c  |ookup...,. .shel|
00005730  6c 5f 4d 65 73 73 61 67  65 4c 6f 6f 6b 75 70 28  |l_MessageLookup(|
00005740  74 61 67 24 2c 61 72 67  31 24 2c 61 72 67 32 24  |tag$,arg1$,arg2$|
00005750  29 0d 02 c5 24 ea 20 66  6c 61 67 73 25 2c 4c 25  |)...$. flags%,L%|
00005760  2c 6d 24 2c 6d 73 5f 74  65 78 74 25 2c 6d 73 5f  |,m$,ms_text%,ms_|
00005770  64 65 73 63 25 0d 02 c6  1b e7 20 c0 74 61 67 24  |desc%..... .tag$|
00005780  2c 38 29 3d 22 53 48 45  4c 4c 4d 53 47 22 20 8c  |,8)="SHELLMSG" .|
00005790  0d 02 c7 27 20 20 6d 73  5f 74 65 78 74 25 3d 5f  |...'  ms_text%=_|
000057a0  55 25 21 32 38 34 3a 6d  73 5f 64 65 73 63 25 3d  |U%!284:ms_desc%=|
000057b0  5f 55 25 21 32 38 30 0d  02 c8 05 cc 0d 02 c9 25  |_U%!280........%|
000057c0  20 20 6d 73 5f 74 65 78  74 25 3d 5f 55 25 21 36  |  ms_text%=_U%!6|
000057d0  34 3a 6d 73 5f 64 65 73  63 25 3d 5f 55 25 21 36  |4:ms_desc%=_U%!6|
000057e0  38 0d 02 ca 05 cd 0d 02  cb 53 c8 99 20 22 58 4d  |8........S.. "XM|
000057f0  65 73 73 61 67 65 54 72  61 6e 73 5f 4c 6f 6f 6b  |essageTrans_Look|
00005800  75 70 22 2c 6d 73 5f 64  65 73 63 25 2c 74 61 67  |up",ms_desc%,tag|
00005810  24 2c 6d 73 5f 74 65 78  74 25 2c 32 35 36 2c 61  |$,ms_text%,256,a|
00005820  72 67 31 24 2c 61 72 67  32 24 20 b8 20 2c 2c 2c  |rg1$,arg2$ . ,,,|
00005830  4c 25 3b 66 6c 61 67 73  25 0d 02 cc 12 e7 20 66  |L%;flags%..... f|
00005840  6c 61 67 73 25 20 80 20  31 20 8c 0d 02 cd 3e 20  |lags% . 1 ....> |
00005850  20 f4 20 6d 24 3d 22 4d  65 73 73 61 67 65 20 74  | . m$="Message t|
00005860  61 67 20 27 22 2b 74 61  67 24 2b 22 27 20 6e 6f  |ag '"+tag$+"' no|
00005870  74 20 66 6f 75 6e 64 20  69 6e 20 6d 65 73 73 61  |t found in messa|
00005880  67 65 20 66 69 6c 65 21  22 0d 02 ce 05 cc 0d 02  |ge file!".......|
00005890  cf 14 20 20 6d 73 5f 74  65 78 74 25 3f 4c 25 3d  |..  ms_text%?L%=|
000058a0  31 33 0d 02 d0 14 20 20  6d 24 3d 24 28 6d 73 5f  |13....  m$=$(ms_|
000058b0  74 65 78 74 25 29 0d 02  d1 05 cd 0d 02 d2 07 3d  |text%).........=|
000058c0  6d 24 0d 02 d3 05 3a 0d  02 d4 20 2a 7c 53 74 6f  |m$....:... *|Sto|
000058d0  70 20 46 4e 73 68 65 6c  6c 5f 4d 65 73 73 61 67  |p FNshell_Messag|
000058e0  65 4c 6f 6f 6b 75 70 0d  02 d5 04 0d 02 d6 1c 2a  |eLookup........*|
000058f0  7c 53 74 61 72 74 20 46  4e 73 68 65 6c 6c 5f 57  ||Start FNshell_W|
00005900  69 6d 70 49 6e 69 74 0d  02 d7 29 dd 20 a4 73 68  |impInit...). .sh|
00005910  65 6c 6c 5f 57 69 6d 70  49 6e 69 74 28 56 65 72  |ell_WimpInit(Ver|
00005920  73 69 6f 6e 25 2c 54 61  73 6b 4e 61 6d 65 24 29  |sion%,TaskName$)|
00005930  0d 02 d8 0d ea 20 54 61  73 6b 69 64 25 0d 02 d9  |..... Taskid%...|
00005940  48 c8 99 20 22 57 69 6d  70 5f 49 6e 69 74 69 61  |H.. "Wimp_Initia|
00005950  6c 69 73 65 22 2c 56 65  72 73 69 6f 6e 25 2c 26  |lise",Version%,&|
00005960  34 42 35 33 34 31 35 34  2c 54 61 73 6b 4e 61 6d  |4B534154,TaskNam|
00005970  65 24 20 b8 20 56 65 72  73 69 6f 6e 25 2c 54 61  |e$ . Version%,Ta|
00005980  73 6b 69 64 25 0d 02 da  18 e7 20 5f 55 25 21 31  |skid%..... _U%!1|
00005990  30 30 20 80 20 31 20 3c  3c 20 36 20 8c 0d 02 db  |00 . 1 << 6 ....|
000059a0  28 20 20 c8 99 20 22 57  69 6d 70 45 78 74 5f 49  |(  .. "WimpExt_I|
000059b0  6e 69 74 69 61 6c 69 73  65 22 2c 31 34 2c 54 61  |nitialise",14,Ta|
000059c0  73 6b 69 64 25 0d 02 dc  05 cd 0d 02 dd 13 5f 55  |skid%........._U|
000059d0  25 21 31 34 38 3d 54 61  73 6b 69 64 25 0d 02 de  |%!148=Taskid%...|
000059e0  0c 3d 54 61 73 6b 69 64  25 0d 02 df 05 3a 0d 02  |.=Taskid%....:..|
000059f0  e0 1b 2a 7c 53 74 6f 70  20 46 4e 73 68 65 6c 6c  |..*|Stop FNshell|
00005a00  5f 57 69 6d 70 49 6e 69  74 0d 02 e1 04 0d 02 e2  |_WimpInit.......|
00005a10  1e 2a 7c 53 74 61 72 74  20 46 4e 73 68 65 6c 6c  |.*|Start FNshell|
00005a20  5f 57 69 6d 70 49 6e 69  74 5f 49 0d 02 e3 2b dd  |_WimpInit_I...+.|
00005a30  20 a4 73 68 65 6c 6c 5f  57 69 6d 70 49 6e 69 74  | .shell_WimpInit|
00005a40  5f 49 28 56 65 72 73 69  6f 6e 25 2c 54 61 73 6b  |_I(Version%,Task|
00005a50  4e 61 6d 65 24 29 0d 02  e4 48 c8 99 20 22 57 69  |Name$)...H.. "Wi|
00005a60  6d 70 5f 49 6e 69 74 69  61 6c 69 73 65 22 2c 56  |mp_Initialise",V|
00005a70  65 72 73 69 6f 6e 25 2c  26 34 42 35 33 34 31 35  |ersion%,&4B53415|
00005a80  34 2c 54 61 73 6b 4e 61  6d 65 24 20 b8 20 56 65  |4,TaskName$ . Ve|
00005a90  72 73 69 6f 6e 25 2c 54  61 73 6b 69 64 25 0d 02  |rsion%,Taskid%..|
00005aa0  e5 18 e7 20 5f 55 25 21  31 30 30 20 80 20 31 20  |... _U%!100 . 1 |
00005ab0  3c 3c 20 36 20 8c 0d 02  e6 28 20 20 c8 99 20 22  |<< 6 ....(  .. "|
00005ac0  57 69 6d 70 45 78 74 5f  49 6e 69 74 69 61 6c 69  |WimpExt_Initiali|
00005ad0  73 65 22 2c 31 34 2c 54  61 73 6b 69 64 25 0d 02  |se",14,Taskid%..|
00005ae0  e7 05 cd 0d 02 e8 13 5f  55 25 21 31 34 38 3d 54  |......._U%!148=T|
00005af0  61 73 6b 69 64 25 0d 02  e9 25 c8 99 20 22 49 6e  |askid%...%.. "In|
00005b00  74 65 72 66 61 63 65 5f  49 6e 69 74 69 61 6c 69  |terface_Initiali|
00005b10  73 65 22 2c 54 61 73 6b  69 64 25 0d 02 ea 0c 3d  |se",Taskid%....=|
00005b20  54 61 73 6b 69 64 25 0d  02 eb 05 3a 0d 02 ec 1d  |Taskid%....:....|
00005b30  2a 7c 53 74 6f 70 20 46  4e 73 68 65 6c 6c 5f 57  |*|Stop FNshell_W|
00005b40  69 6d 70 49 6e 69 74 5f  49 0d 02 ed 04 0d 02 ee  |impInit_I.......|
00005b50  25 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |%*|Start PROCshe|
00005b60  6c 6c 5f 57 69 6d 70 43  6c 6f 73 65 44 6f 77 6e  |ll_WimpCloseDown|
00005b70  5f 49 0d 02 ef 25 dd 20  f2 73 68 65 6c 6c 5f 57  |_I...%. .shell_W|
00005b80  69 6d 70 43 6c 6f 73 65  44 6f 77 6e 5f 49 28 54  |impCloseDown_I(T|
00005b90  61 73 6b 69 64 25 29 0d  02 f0 14 f2 73 68 65 6c  |askid%).....shel|
00005ba0  6c 5f 4c 6f 73 65 46 6f  6e 74 73 0d 02 f1 1a 2a  |l_LoseFonts....*|
00005bb0  7c 69 66 64 65 66 20 55  73 69 6e 67 5f 46 6f 6e  ||ifdef Using_Fon|
00005bc0  74 4d 65 6e 75 0d 02 f2  2a e7 20 5f 55 25 21 32  |tMenu...*. _U%!2|
00005bd0  34 30 3c 3e 2d 31 20 8c  20 c8 99 20 22 58 46 6f  |40<>-1 . .. "XFo|
00005be0  6e 74 4d 65 6e 75 5f 52  65 6c 65 61 73 65 22 0d  |ntMenu_Release".|
00005bf0  02 f3 0b 2a 7c 65 6e 64  69 66 0d 02 f4 18 e7 20  |...*|endif..... |
00005c00  5f 55 25 21 31 30 30 20  80 20 31 20 3c 3c 20 36  |_U%!100 . 1 << 6|
00005c10  20 8c 0d 02 f5 28 20 20  c8 99 20 22 57 69 6d 70  | ....(  .. "Wimp|
00005c20  45 78 74 5f 49 6e 69 74  69 61 6c 69 73 65 22 2c  |Ext_Initialise",|
00005c30  31 34 2c 54 61 73 6b 69  64 25 0d 02 f6 05 cd 0d  |14,Taskid%......|
00005c40  02 f7 2a c8 99 20 22 58  57 69 6d 70 5f 43 6c 6f  |..*.. "XWimp_Clo|
00005c50  73 65 44 6f 77 6e 22 2c  54 61 73 6b 69 64 25 2c  |seDown",Taskid%,|
00005c60  26 34 42 35 33 34 31 35  34 0d 02 f8 25 c8 99 20  |&4B534154...%.. |
00005c70  22 58 49 6e 74 65 72 66  61 63 65 5f 43 6c 6f 73  |"XInterface_Clos|
00005c80  65 44 6f 77 6e 22 2c 54  61 73 6b 69 64 25 0d 02  |eDown",Taskid%..|
00005c90  f9 38 e7 20 5f 55 25 21  31 30 30 20 80 20 31 20  |.8. _U%!100 . 1 |
00005ca0  3c 3c 20 32 20 8c 20 c8  99 20 22 58 49 6d 70 75  |<< 2 . .. "XImpu|
00005cb0  6c 73 65 5f 43 6c 6f 73  65 44 6f 77 6e 22 2c 5f  |lse_CloseDown",_|
00005cc0  55 25 21 31 34 38 0d 02  fa 05 e1 0d 02 fb 05 3a  |U%!148.........:|
00005cd0  0d 02 fc 24 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |...$*|Stop PROCs|
00005ce0  68 65 6c 6c 5f 57 69 6d  70 43 6c 6f 73 65 44 6f  |hell_WimpCloseDo|
00005cf0  77 6e 5f 49 0d 02 fd 04  0d 02 fe 1d 2a 7c 53 74  |wn_I........*|St|
00005d00  61 72 74 20 50 52 4f 43  57 69 6d 70 43 6c 6f 73  |art PROCWimpClos|
00005d10  65 44 6f 77 6e 0d 02 ff  1d dd 20 f2 57 69 6d 70  |eDown..... .Wimp|
00005d20  43 6c 6f 73 65 44 6f 77  6e 28 54 61 73 6b 69 64  |CloseDown(Taskid|
00005d30  25 29 0d 03 00 14 f2 73  68 65 6c 6c 5f 4c 6f 73  |%).....shell_Los|
00005d40  65 46 6f 6e 74 73 0d 03  01 1a 2a 7c 69 66 64 65  |eFonts....*|ifde|
00005d50  66 20 55 73 69 6e 67 5f  46 6f 6e 74 4d 65 6e 75  |f Using_FontMenu|
00005d60  0d 03 02 2a e7 20 5f 55  25 21 32 34 30 3c 3e 2d  |...*. _U%!240<>-|
00005d70  31 20 8c 20 c8 99 20 22  58 46 6f 6e 74 4d 65 6e  |1 . .. "XFontMen|
00005d80  75 5f 52 65 6c 65 61 73  65 22 0d 03 03 0b 2a 7c  |u_Release"....*||
00005d90  65 6e 64 69 66 0d 03 04  18 e7 20 5f 55 25 21 31  |endif..... _U%!1|
00005da0  30 30 20 80 20 31 20 3c  3c 20 36 20 8c 0d 03 05  |00 . 1 << 6 ....|
00005db0  28 20 20 c8 99 20 22 57  69 6d 70 45 78 74 5f 49  |(  .. "WimpExt_I|
00005dc0  6e 69 74 69 61 6c 69 73  65 22 2c 31 34 2c 54 61  |nitialise",14,Ta|
00005dd0  73 6b 69 64 25 0d 03 06  05 cd 0d 03 07 2a c8 99  |skid%........*..|
00005de0  20 22 58 57 69 6d 70 5f  43 6c 6f 73 65 44 6f 77  | "XWimp_CloseDow|
00005df0  6e 22 2c 54 61 73 6b 69  64 25 2c 26 34 42 35 33  |n",Taskid%,&4B53|
00005e00  34 31 35 34 0d 03 08 36  e7 20 5f 55 25 21 31 30  |4154...6. _U%!10|
00005e10  30 20 80 20 31 3c 3c 32  20 8c 20 c8 99 20 22 58  |0 . 1<<2 . .. "X|
00005e20  49 6d 70 75 6c 73 65 5f  43 6c 6f 73 65 44 6f 77  |Impulse_CloseDow|
00005e30  6e 22 2c 5f 55 25 21 31  34 38 0d 03 09 2c ff 28  |n",_U%!148...,.(|
00005e40  22 55 6e 73 65 74 20 22  2b 5f 73 68 65 6c 6c 5f  |"Unset "+_shell_|
00005e50  41 70 70 4e 61 6d 65 24  2b 22 24 42 61 73 69 63  |AppName$+"$Basic|
00005e60  46 69 6c 65 22 29 0d 03  0a 05 e1 0d 03 0b 05 3a  |File").........:|
00005e70  0d 03 0c 1c 2a 7c 53 74  6f 70 20 50 52 4f 43 57  |....*|Stop PROCW|
00005e80  69 6d 70 43 6c 6f 73 65  44 6f 77 6e 0d 03 0d 04  |impCloseDown....|
00005e90  0d 03 0e 1f 2a 7c 53 74  61 72 74 20 50 52 4f 43  |....*|Start PROC|
00005ea0  73 68 65 6c 6c 5f 4c 6f  73 65 46 6f 6e 74 73 0d  |shell_LoseFonts.|
00005eb0  03 0f 16 dd 20 f2 73 68  65 6c 6c 5f 4c 6f 73 65  |.... .shell_Lose|
00005ec0  46 6f 6e 74 73 0d 03 10  11 ea 20 6c 6f 6f 70 25  |Fonts..... loop%|
00005ed0  2c 74 65 6d 70 25 0d 03  11 11 74 65 6d 70 25 3d  |,temp%....temp%=|
00005ee0  5f 55 25 21 32 33 32 0d  03 12 13 e3 20 6c 6f 6f  |_U%!232..... loo|
00005ef0  70 25 3d 30 20 b8 20 32  35 35 0d 03 13 14 c8 95  |p%=0 . 255......|
00005f00  20 74 65 6d 70 25 3f 6c  6f 6f 70 25 3e 30 0d 03  | temp%?loop%>0..|
00005f10  14 1e 20 20 c8 99 20 22  46 6f 6e 74 5f 4c 6f 73  |..  .. "Font_Los|
00005f20  65 46 6f 6e 74 22 2c 6c  6f 6f 70 25 0d 03 15 14  |eFont",loop%....|
00005f30  20 20 74 65 6d 70 25 3f  6c 6f 6f 70 25 2d 3d 31  |  temp%?loop%-=1|
00005f40  0d 03 16 05 ce 0d 03 17  0b ed 20 6c 6f 6f 70 25  |.......... loop%|
00005f50  0d 03 18 05 e1 0d 03 19  05 3a 0d 03 1a 1e 2a 7c  |.........:....*||
00005f60  53 74 6f 70 20 50 52 4f  43 73 68 65 6c 6c 5f 4c  |Stop PROCshell_L|
00005f70  6f 73 65 46 6f 6e 74 73  0d 03 1b 04 0d 03 1c 1c  |oseFonts........|
00005f80  2a 7c 53 74 61 72 74 20  46 4e 73 68 65 6c 6c 5f  |*|Start FNshell_|
00005f90  46 69 6e 64 46 6f 6e 74  0d 03 1d 27 dd 20 a4 73  |FindFont...'. .s|
00005fa0  68 65 6c 6c 5f 46 69 6e  64 46 6f 6e 74 28 66 6f  |hell_FindFont(fo|
00005fb0  6e 74 24 2c 70 6f 69 6e  74 73 69 7a 65 25 29 0d  |nt$,pointsize%).|
00005fc0  03 1e 14 ea 20 66 25 2c  66 6f 6e 74 63 6f 75 6e  |.... f%,fontcoun|
00005fd0  74 73 25 0d 03 1f 17 66  6f 6e 74 63 6f 75 6e 74  |ts%....fontcount|
00005fe0  73 25 3d 5f 55 25 21 32  33 32 0d 03 20 39 c8 99  |s%=_U%!232.. 9..|
00005ff0  20 22 46 6f 6e 74 5f 46  69 6e 64 46 6f 6e 74 22  | "Font_FindFont"|
00006000  2c 2c 66 6f 6e 74 24 2c  70 6f 69 6e 74 73 69 7a  |,,font$,pointsiz|
00006010  65 25 2a 31 36 2c 70 2a  31 36 2c 30 2c 30 20 b8  |e%*16,p*16,0,0 .|
00006020  20 66 25 0d 03 21 15 66  6f 6e 74 63 6f 75 6e 74  | f%..!.fontcount|
00006030  73 25 3f 66 25 2b 3d 31  0d 03 22 49 e7 20 66 6f  |s%?f%+=1.."I. fo|
00006040  6e 74 63 6f 75 6e 74 73  25 3f 66 25 3e 3d 32 35  |ntcounts%?f%>=25|
00006050  35 20 8c 20 f2 73 68 65  6c 6c 5f 4f 4b 28 a4 73  |5 . .shell_OK(.s|
00006060  68 65 6c 6c 5f 4d 65 73  73 61 67 65 4e 6f 41 72  |hell_MessageNoAr|
00006070  67 73 28 22 53 48 45 4c  4c 4d 53 47 31 38 22 29  |gs("SHELLMSG18")|
00006080  29 0d 03 23 07 3d 66 25  0d 03 24 05 3a 0d 03 25  |)..#.=f%..$.:..%|
00006090  1b 2a 7c 53 74 6f 70 20  46 4e 73 68 65 6c 6c 5f  |.*|Stop FNshell_|
000060a0  46 69 6e 64 46 6f 6e 74  0d 03 26 04 0d 03 27 1a  |FindFont..&...'.|
000060b0  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
000060c0  6c 5f 49 6e 69 74 0d 03  28 11 dd 20 f2 73 68 65  |l_Init..(.. .she|
000060d0  6c 6c 5f 49 6e 69 74 0d  03 29 21 ea 20 65 6c 69  |ll_Init..)!. eli|
000060e0  73 74 25 2c 6c 6f 6f 70  25 2c 74 65 6d 70 25 2c  |st%,loop%,temp%,|
000060f0  63 6d 64 6c 69 6e 65 24  0d 03 2a 2d ea 20 4f 53  |cmdline$..*-. OS|
00006100  56 61 72 42 75 66 66 25  2c 73 68 65 6c 6c 5f 41  |VarBuff%,shell_A|
00006110  70 70 44 69 72 24 2c 73  68 65 6c 6c 5f 41 70 70  |ppDir$,shell_App|
00006120  4e 61 6d 65 24 0d 03 2b  1d de 20 5f 55 25 20 33  |Name$..+.. _U% 3|
00006130  36 30 2c 5f 73 68 65 6c  6c 5f 62 6c 6b 25 20 32  |60,_shell_blk% 2|
00006140  36 30 0d 03 2c 23 5f 51  25 3d a4 73 68 65 6c 6c  |60..,#_Q%=.shell|
00006150  5f 48 65 61 70 42 6c 6f  63 6b 46 65 74 63 68 28  |_HeapBlockFetch(|
00006160  33 30 30 30 29 0d 03 2d  24 65 6c 69 73 74 25 3d  |3000)..-$elist%=|
00006170  a4 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
00006180  46 65 74 63 68 28 34 38  29 0d 03 2e 0f 65 6c 69  |Fetch(48)....eli|
00006190  73 74 25 21 30 30 3d 30  0d 03 2f 0f 65 6c 69 73  |st%!00=0../.elis|
000061a0  74 25 21 30 34 3d 30 0d  03 30 0f 65 6c 69 73 74  |t%!04=0..0.elist|
000061b0  25 21 30 38 3d 30 0d 03  31 0f 65 6c 69 73 74 25  |%!08=0..1.elist%|
000061c0  21 31 32 3d 30 0d 03 32  0f 65 6c 69 73 74 25 21  |!12=0..2.elist%!|
000061d0  31 36 3d 30 0d 03 33 1e  65 6c 69 73 74 25 21 32  |16=0..3.elist%!2|
000061e0  30 3d 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |0=0             |
000061f0  20 20 0d 03 34 0f 65 6c  69 73 74 25 21 32 34 3d  |  ..4.elist%!24=|
00006200  30 0d 03 35 0f 65 6c 69  73 74 25 21 32 38 3d 30  |0..5.elist%!28=0|
00006210  0d 03 36 0f 65 6c 69 73  74 25 21 33 32 3d 30 0d  |..6.elist%!32=0.|
00006220  03 37 0f 65 6c 69 73 74  25 21 33 36 3d 30 0d 03  |.7.elist%!36=0..|
00006230  38 0f 65 6c 69 73 74 25  21 34 30 3d 30 0d 03 39  |8.elist%!40=0..9|
00006240  0f 65 6c 69 73 74 25 21  34 34 3d 30 0d 03 3a 27  |.elist%!44=0..:'|
00006250  5f 55 25 21 30 3d 30 20  20 20 20 20 20 20 20 20  |_U%!0=0         |
00006260  20 3a f4 20 6e 72 20 6f  66 20 74 65 6d 70 6c 61  | :. nr of templa|
00006270  74 65 73 0d 03 3b 30 5f  55 25 21 34 3d 30 20 20  |tes..;0_U%!4=0  |
00006280  20 20 20 20 20 20 20 20  3a f4 20 70 6f 69 6e 74  |        :. point|
00006290  65 72 20 74 6f 20 77 69  6e 64 6f 77 20 62 6c 6f  |er to window blo|
000062a0  63 6b 73 0d 03 3c 2d 5f  55 25 21 38 3d 30 20 20  |cks..<-_U%!8=0  |
000062b0  20 20 20 20 20 20 20 20  3a f4 20 70 6f 69 6e 74  |        :. point|
000062c0  65 72 20 74 6f 20 6d 65  6e 75 20 62 6c 6f 63 6b  |er to menu block|
000062d0  0d 03 3d 2d 5f 55 25 21  31 32 3d 65 6c 69 73 74  |..=-_U%!12=elist|
000062e0  25 20 20 20 20 3a f4 20  70 6f 69 6e 74 65 72 20  |%    :. pointer |
000062f0  74 6f 20 65 76 65 6e 74  20 6c 69 73 74 0d 03 3e  |to event list..>|
00006300  33 5f 55 25 21 31 36 3d  31 20 20 20 20 20 20 20  |3_U%!16=1       |
00006310  20 20 3a f4 20 61 64 64  72 65 73 73 20 6f 66 20  |  :. address of |
00006320  75 73 65 72 20 73 70 72  69 74 65 20 61 72 65 61  |user sprite area|
00006330  0d 03 3f 35 5f 55 25 21  32 30 3d 30 20 20 20 20  |..?5_U%!20=0    |
00006340  20 20 20 20 20 3a f4 20  68 61 6e 64 6c 65 20 6f  |     :. handle o|
00006350  66 20 6c 61 73 74 20 64  79 6e 61 6d 69 63 20 77  |f last dynamic w|
00006360  69 6e 64 6f 77 0d 03 40  2f 5f 55 25 21 32 34 3d  |indow..@/_U%!24=|
00006370  30 20 20 20 20 20 20 20  20 20 3a f4 20 61 64 64  |0         :. add|
00006380  72 65 73 73 20 6f 66 20  63 75 72 72 65 6e 74 20  |ress of current |
00006390  6d 65 6e 75 0d 03 41 42  5f 55 25 21 32 38 3d 30  |menu..AB_U%!28=0|
000063a0  20 20 20 20 20 20 20 20  20 3a f4 20 6c 61 73 74  |         :. last|
000063b0  20 77 69 6e 64 6f 77 20  63 6c 69 63 6b 65 64 20  | window clicked |
000063c0  6f 76 65 72 20 28 73 65  6c 65 63 74 20 26 20 61  |over (select & a|
000063d0  64 6a 75 73 74 29 0d 03  42 42 5f 55 25 21 33 32  |djust)..BB_U%!32|
000063e0  3d 30 20 20 20 20 20 20  20 20 20 3a f4 20 6c 61  |=0         :. la|
000063f0  73 74 20 69 63 6f 6e 20  63 6c 69 63 6b 65 64 20  |st icon clicked |
00006400  6f 76 65 72 20 20 20 28  73 65 6c 65 63 74 20 26  |over   (select &|
00006410  20 61 64 6a 75 73 74 29  0d 03 43 2c 5f 55 25 21  | adjust)..C,_U%!|
00006420  33 36 3d 30 20 20 20 20  20 20 20 20 20 3a f4 20  |36=0         :. |
00006430  6c 61 73 74 20 6d 65 6e  75 20 78 20 70 6f 73 69  |last menu x posi|
00006440  74 69 6f 6e 0d 03 44 2c  5f 55 25 21 34 30 3d 30  |tion..D,_U%!40=0|
00006450  20 20 20 20 20 20 20 20  20 3a f4 20 6c 61 73 74  |         :. last|
00006460  20 6d 65 6e 75 20 79 20  70 6f 73 69 74 69 6f 6e  | menu y position|
00006470  0d 03 45 2b 5f 55 25 21  34 34 3d 2d 31 20 20 20  |..E+_U%!44=-1   |
00006480  20 20 20 20 20 3a f4 20  68 61 6e 64 6c 65 20 6f  |     :. handle o|
00006490  66 20 74 72 61 63 65 66  69 6c 65 0d 03 46 36 5f  |f tracefile..F6_|
000064a0  55 25 21 34 38 3d 30 20  20 20 20 20 20 20 20 20  |U%!48=0         |
000064b0  3a f4 20 41 72 74 57 6f  72 6b 73 20 52 65 6e 64  |:. ArtWorks Rend|
000064c0  65 72 65 72 20 72 65 64  72 61 77 20 62 6c 6f 63  |erer redraw bloc|
000064d0  6b 0d 03 47 40 20 20 20  20 20 20 20 20 20 20 20  |k..G@           |
000064e0  20 20 20 20 20 20 3a f4  20 20 20 2b 30 30 20 41  |      :.   +00 A|
000064f0  64 64 72 65 73 73 20 6f  66 20 56 64 75 56 61 72  |ddress of VduVar|
00006500  73 20 68 65 61 70 62 6c  6f 63 6b 20 28 32 35 36  |s heapblock (256|
00006510  29 0d 03 48 3f 20 20 20  20 20 20 20 20 20 20 20  |)..H?           |
00006520  20 20 20 20 20 20 3a f4  20 20 20 2b 30 34 20 41  |      :.   +04 A|
00006530  64 64 72 65 73 73 20 6f  66 20 4d 61 74 72 69 78  |ddress of Matrix|
00006540  20 20 68 65 61 70 62 6c  6f 63 6b 20 28 32 34 29  |  heapblock (24)|
00006550  0d 03 49 3f 20 20 20 20  20 20 20 20 20 20 20 20  |..I?            |
00006560  20 20 20 20 20 3a f4 20  20 20 2b 30 38 20 41 64  |     :.   +08 Ad|
00006570  64 72 65 73 73 20 6f 66  20 49 6e 66 6f 20 20 20  |dress of Info   |
00006580  20 68 65 61 70 62 6c 6f  63 6b 20 28 33 36 29 0d  | heapblock (36).|
00006590  03 4a 42 20 20 20 20 20  20 20 20 20 20 20 20 20  |.JB             |
000065a0  20 20 20 20 3a f4 20 20  20 2b 31 32 20 41 64 64  |    :.   +12 Add|
000065b0  72 65 73 73 20 6f 66 20  57 6f 72 6b 42 6c 6b 20  |ress of WorkBlk |
000065c0  68 65 61 70 62 6c 6f 63  6b 20 28 26 31 30 30 30  |heapblock (&1000|
000065d0  29 0d 03 4b 52 20 20 20  20 20 20 20 20 20 20 20  |)..KR           |
000065e0  20 20 20 20 20 20 3a f4  20 20 20 2b 31 36 20 41  |      :.   +16 A|
000065f0  64 64 72 65 73 73 20 6f  66 20 43 61 6c 6c 62 61  |ddress of Callba|
00006600  63 6b 52 6f 75 74 69 6e  65 20 72 65 74 75 72 6e  |ckRoutine return|
00006610  65 64 20 62 79 20 66 69  6c 65 69 6e 69 74 20 63  |ed by fileinit c|
00006620  61 6c 6c 0d 03 4c 3e 5f  55 25 21 35 32 3d 30 20  |all..L>_U%!52=0 |
00006630  20 20 20 20 20 20 20 20  3a f4 20 6c 61 73 74 20  |        :. last |
00006640  77 69 6e 64 6f 77 20 63  6c 69 63 6b 65 64 20 6f  |window clicked o|
00006650  76 65 72 20 28 6d 65 6e  75 20 62 75 74 74 6f 6e  |ver (menu button|
00006660  29 0d 03 4d 3e 5f 55 25  21 35 36 3d 30 20 20 20  |)..M>_U%!56=0   |
00006670  20 20 20 20 20 20 3a f4  20 6c 61 73 74 20 69 63  |      :. last ic|
00006680  6f 6e 20 20 20 63 6c 69  63 6b 65 64 20 6f 76 65  |on   clicked ove|
00006690  72 20 28 6d 65 6e 75 20  62 75 74 74 6f 6e 29 0d  |r (menu button).|
000066a0  03 4e 3e 5f 55 25 21 36  30 3d 30 20 20 20 20 20  |.N>_U%!60=0     |
000066b0  20 20 20 20 3a f4 20 70  6f 69 6e 74 65 72 20 74  |    :. pointer t|
000066c0  6f 20 27 48 6f 74 4b 65  79 27 20 68 61 6e 64 6c  |o 'HotKey' handl|
000066d0  65 72 20 65 76 65 6e 74  20 6c 69 73 74 0d 03 4f  |er event list..O|
000066e0  30 5f 55 25 21 36 34 3d  30 20 20 20 20 20 20 20  |0_U%!64=0       |
000066f0  20 20 3a f4 20 70 6f 69  6e 74 65 72 20 74 6f 20  |  :. pointer to |
00006700  6d 65 73 73 61 67 65 20  62 6c 6f 63 6b 0d 03 50  |message block..P|
00006710  30 5f 55 25 21 36 38 3d  30 20 20 20 20 20 20 20  |0_U%!68=0       |
00006720  20 20 3a f4 20 70 6f 69  6e 74 65 72 20 74 6f 20  |  :. pointer to |
00006730  6d 65 73 73 61 67 65 20  62 6c 6f 63 6b 0d 03 51  |message block..Q|
00006740  37 5f 55 25 21 37 32 3d  30 20 20 20 20 20 20 20  |7_U%!72=0       |
00006750  20 20 3a f4 20 70 6f 69  6e 74 65 72 20 74 6f 20  |  :. pointer to |
00006760  64 61 74 61 73 61 76 65  20 65 76 65 6e 74 20 62  |datasave event b|
00006770  6c 6f 63 6b 0d 03 52 35  5f 55 25 21 37 36 3d a4  |lock..R5_U%!76=.|
00006780  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
00006790  65 74 63 68 28 32 35 36  29 3a f4 20 6d 65 73 73  |etch(256):. mess|
000067a0  61 67 65 20 62 6c 6f 63  6b 0d 03 53 36 5f 55 25  |age block..S6_U%|
000067b0  21 38 30 3d 30 20 20 20  20 20 20 20 20 20 3a f4  |!80=0         :.|
000067c0  20 70 6f 69 6e 74 65 72  20 74 6f 20 6c 61 73 74  | pointer to last|
000067d0  20 66 75 6c 6c 20 66 69  6c 65 20 6e 61 6d 65 0d  | full file name.|
000067e0  03 54 38 5f 55 25 21 38  34 3d 2d 31 20 20 20 20  |.T8_U%!84=-1    |
000067f0  20 20 20 20 3a f4 20 73  74 6f 72 65 20 6d 79 5f  |    :. store my_|
00006800  72 65 66 20 66 72 6f 6d  20 73 61 76 65 20 6f 70  |ref from save op|
00006810  65 72 61 74 69 6f 6e 0d  03 55 22 5f 55 25 21 38  |eration..U"_U%!8|
00006820  38 3d 30 20 20 20 20 20  20 20 20 20 3a f4 20 3f  |8=0         :. ?|
00006830  3f 3f 3f 3f 3f 3f 3f 3f  3f 0d 03 56 3b 5f 55 25  |?????????..V;_U%|
00006840  21 39 32 3d 30 20 20 20  20 20 20 20 20 20 3a f4  |!92=0         :.|
00006850  20 70 6f 69 6e 74 65 72  20 74 6f 20 70 61 6e 65  | pointer to pane|
00006860  20 68 61 6e 64 6c 65 72  20 65 76 65 6e 74 20 62  | handler event b|
00006870  6c 6f 63 6b 0d 03 57 37  5f 55 25 21 39 36 3d 30  |lock..W7_U%!96=0|
00006880  20 20 20 20 20 20 20 20  20 3a f4 20 70 6f 69 6e  |         :. poin|
00006890  74 65 72 20 74 6f 20 64  61 74 61 6c 6f 61 64 20  |ter to dataload |
000068a0  65 76 65 6e 74 20 62 6c  6f 63 6b 0d 03 58 2b 5f  |event block..X+_|
000068b0  55 25 21 31 30 30 3d 30  20 20 20 20 20 20 20 20  |U%!100=0        |
000068c0  3a f4 20 45 76 6e 74 53  68 65 6c 6c 20 62 69 74  |:. EvntShell bit|
000068d0  20 66 6c 61 67 73 0d 03  59 43 20 20 20 20 20 20  | flags..YC      |
000068e0  20 20 20 20 20 20 20 20  20 20 20 3a f4 20 62 69  |           :. bi|
000068f0  74 20 20 30 20 20 2d 20  44 72 61 67 41 53 70 72  |t  0  - DragASpr|
00006900  69 74 65 20 6f 70 65 72  61 74 69 6f 6e 20 69 6e  |ite operation in|
00006910  20 70 72 6f 67 72 65 73  73 0d 03 5a 3e 20 20 20  | progress..Z>   |
00006920  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3a f4  |              :.|
00006930  20 62 69 74 20 20 31 20  20 2d 20 54 6f 70 20 62  | bit  1  - Top b|
00006940  69 74 20 64 61 74 61 6c  6f 61 64 20 69 6e 20 70  |it dataload in p|
00006950  72 6f 67 72 65 73 73 0d  03 5b 3c 20 20 20 20 20  |rogress..[<     |
00006960  20 20 20 20 20 20 20 20  20 20 20 20 3a f4 20 62  |            :. b|
00006970  69 74 20 20 32 20 20 2d  20 49 6d 70 75 6c 73 65  |it  2  - Impulse|
00006980  20 6d 6f 64 75 6c 65 20  69 6e 69 74 69 61 6c 69  | module initiali|
00006990  73 65 64 0d 03 5c 36 20  20 20 20 20 20 20 20 20  |sed..\6         |
000069a0  20 20 20 20 20 20 20 20  3a f4 20 62 69 74 20 20  |        :. bit  |
000069b0  33 20 20 2d 20 52 65 73  46 69 6e 64 20 69 6e 20  |3  - ResFind in |
000069c0  6f 70 65 72 61 74 69 6f  6e 0d 03 5d 4f 20 20 20  |operation..]O   |
000069d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3a f4  |              :.|
000069e0  20 62 69 74 20 20 34 20  20 2d 20 54 72 61 63 65  | bit  4  - Trace|
000069f0  20 69 6e 69 74 20 6d 65  73 73 61 67 65 20 70 65  | init message pe|
00006a00  6e 64 69 6e 67 20 28 73  65 74 20 69 6e 20 54 72  |nding (set in Tr|
00006a10  61 63 65 49 6e 69 74 2c  0d 03 5e 4b 20 20 20 20  |aceInit,..^K    |
00006a20  20 20 20 20 20 20 20 20  20 20 20 20 20 3a f4 20  |             :. |
00006a30  20 20 20 20 20 20 20 20  20 20 63 6c 65 61 72 65  |          cleare|
00006a40  64 20 77 68 65 6e 20 61  63 6b 20 72 65 63 65 69  |d when ack recei|
00006a50  76 65 64 20 66 72 6f 6d  20 53 68 65 6c 6c 44 42  |ved from ShellDB|
00006a60  75 67 29 0d 03 5f 43 20  20 20 20 20 20 20 20 20  |ug).._C         |
00006a70  20 20 20 20 20 20 20 20  3a f4 20 62 69 74 20 20  |        :. bit  |
00006a80  35 20 20 2d 20 63 6f 6d  6d 61 6e 64 20 6c 69 6e  |5  - command lin|
00006a90  65 20 63 6f 6e 74 61 69  6e 73 20 61 72 67 75 6d  |e contains argum|
00006aa0  65 6e 74 73 2e 2e 0d 03  60 3a 20 20 20 20 20 20  |ents....`:      |
00006ab0  20 20 20 20 20 20 20 20  20 20 20 3a f4 20 62 69  |           :. bi|
00006ac0  74 20 20 36 20 20 2d 20  57 69 6d 70 45 58 54 20  |t  6  - WimpEXT |
00006ad0  6d 6f 64 75 6c 65 20 69  73 20 6c 6f 61 64 65 64  |module is loaded|
00006ae0  0d 03 61 4b 20 20 20 20  20 20 20 20 20 20 20 20  |..aK            |
00006af0  20 20 20 20 20 3a f4 20  62 69 74 20 20 37 20 20  |     :. bit  7  |
00006b00  2d 20 53 74 72 6f 6e 67  48 6c 70 20 73 79 73 74  |- StrongHlp syst|
00006b10  65 6d 20 69 6e 69 74 69  61 6c 69 73 65 64 20 66  |em initialised f|
00006b20  6f 72 20 74 68 69 73 20  61 70 70 0d 03 62 39 20  |or this app..b9 |
00006b30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006b40  3a f4 20 62 69 74 20 20  38 20 20 2d 20 41 57 52  |:. bit  8  - AWR|
00006b50  65 6e 64 65 72 20 63 6f  64 65 20 61 73 73 65 6d  |ender code assem|
00006b60  62 6c 65 64 0d 03 63 40  20 20 20 20 20 20 20 20  |bled..c@        |
00006b70  20 20 20 20 20 20 20 20  20 3a f4 20 62 69 74 20  |         :. bit |
00006b80  20 39 20 20 2d 20 54 72  61 63 69 6e 67 20 66 6c  | 9  - Tracing fl|
00006b90  61 67 20 28 30 20 3d 20  6f 66 66 2c 20 31 20 3d  |ag (0 = off, 1 =|
00006ba0  20 6f 6e 29 0d 03 64 3f  20 20 20 20 20 20 20 20  | on)..d?        |
00006bb0  20 20 20 20 20 20 20 20  20 3a f4 20 62 69 74 20  |         :. bit |
00006bc0  31 30 20 20 2d 20 52 49  53 43 20 4f 53 20 33 20  |10  - RISC OS 3 |
00006bd0  6f 72 20 62 65 74 74 65  72 20 61 76 61 69 6c 61  |or better availa|
00006be0  62 6c 65 0d 03 65 39 20  20 20 20 20 20 20 20 20  |ble..e9         |
00006bf0  20 20 20 20 20 20 20 20  3a f4 20 62 69 74 20 31  |        :. bit 1|
00006c00  31 20 20 2d 20 53 6c 69  64 65 72 20 64 72 61 67  |1  - Slider drag|
00006c10  20 69 6e 20 70 72 6f 67  72 65 73 73 0d 03 66 39  | in progress..f9|
00006c20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006c30  20 3a f4 20 62 69 74 20  31 32 20 20 2d 20 49 6e  | :. bit 12  - In|
00006c40  74 65 72 61 63 74 69 76  65 20 68 65 6c 70 20 6f  |teractive help o|
00006c50  6e 2f 6f 66 66 0d 03 67  3b 5f 55 25 21 31 30 34  |n/off..g;_U%!104|
00006c60  3d 30 20 20 20 20 20 20  20 20 3a f4 20 70 6f 69  |=0        :. poi|
00006c70  6e 74 65 72 20 74 6f 20  62 75 6d 70 20 68 61 6e  |nter to bump han|
00006c80  64 6c 65 72 20 65 76 65  6e 74 20 62 6c 6f 63 6b  |dler event block|
00006c90  0d 03 68 20 5f 55 25 21  31 30 38 3d 2d 31 20 20  |..h _U%!108=-1  |
00006ca0  20 20 20 20 20 3a f4 20  53 63 72 70 52 65 66 25  |     :. ScrpRef%|
00006cb0  0d 03 69 20 5f 55 25 21  31 31 32 3d 2d 31 20 20  |..i _U%!112=-1  |
00006cc0  20 20 20 20 20 3a f4 20  46 74 63 68 52 65 66 25  |     :. FtchRef%|
00006cd0  0d 03 6a 20 5f 55 25 21  31 31 36 3d 2d 31 20 20  |..j _U%!116=-1  |
00006ce0  20 20 20 20 20 3a f4 20  4c 6f 61 64 52 65 66 25  |     :. LoadRef%|
00006cf0  0d 03 6b 20 5f 55 25 21  31 32 30 3d 2d 31 20 20  |..k _U%!120=-1  |
00006d00  20 20 20 20 20 3a f4 20  53 61 76 65 52 65 66 25  |     :. SaveRef%|
00006d10  0d 03 6c 20 5f 55 25 21  31 32 34 3d 2d 31 20 20  |..l _U%!124=-1  |
00006d20  20 20 20 20 20 3a f4 20  44 72 61 67 52 65 66 25  |     :. DragRef%|
00006d30  0d 03 6d 1f 5f 55 25 21  31 32 38 3d 30 20 20 20  |..m._U%!128=0   |
00006d40  20 20 20 20 20 3a f4 20  52 41 4d 50 74 72 25 0d  |     :. RAMPtr%.|
00006d50  03 6e 20 5f 55 25 21 31  33 32 3d 30 20 20 20 20  |.n _U%!132=0    |
00006d60  20 20 20 20 3a f4 20 52  41 4d 53 69 7a 65 25 0d  |    :. RAMSize%.|
00006d70  03 6f 3c 5f 55 25 21 31  33 36 3d 2d 31 20 20 20  |.o<_U%!136=-1   |
00006d80  20 20 20 20 3a f4 20 46  69 6c 65 53 69 7a 65 25  |    :. FileSize%|
00006d90  20 66 72 6f 6d 20 6c 61  73 74 20 64 61 74 61 73  | from last datas|
00006da0  61 76 65 20 6d 65 73 73  61 67 65 0d 03 70 3c 5f  |ave message..p<_|
00006db0  55 25 21 31 34 30 3d 2d  31 20 20 20 20 20 20 20  |U%!140=-1       |
00006dc0  3a f4 20 46 69 6c 65 54  79 70 65 25 20 66 72 6f  |:. FileType% fro|
00006dd0  6d 20 6c 61 73 74 20 64  61 74 61 73 61 76 65 20  |m last datasave |
00006de0  6d 65 73 73 61 67 65 0d  03 71 3c 5f 55 25 21 31  |message..q<_U%!1|
00006df0  34 34 3d 2d 31 20 20 20  20 20 20 20 3a f4 20 46  |44=-1       :. F|
00006e00  69 6c 65 42 75 66 66 25  20 66 72 6f 6d 20 6c 61  |ileBuff% from la|
00006e10  73 74 20 64 61 74 61 73  61 76 65 20 6d 65 73 73  |st datasave mess|
00006e20  61 67 65 0d 03 72 1f 5f  55 25 21 31 34 38 3d 30  |age..r._U%!148=0|
00006e30  20 20 20 20 20 20 20 20  3a f4 20 74 61 73 6b 69  |        :. taski|
00006e40  64 25 0d 03 73 42 5f 55  25 21 31 35 32 3d 30 20  |d%..sB_U%!152=0 |
00006e50  20 20 20 20 20 20 20 3a  f4 20 42 75 66 66 65 72  |       :. Buffer|
00006e60  20 6c 69 73 74 20 6f 66  20 6c 6f 61 64 65 64 20  | list of loaded |
00006e70  66 69 6c 65 73 2c 20 2d  31 20 74 65 72 6d 69 6e  |files, -1 termin|
00006e80  61 74 6f 72 0d 03 74 45  5f 55 25 21 31 35 36 3d  |ator..tE_U%!156=|
00006e90  30 20 20 20 20 20 20 20  20 3a f4 20 48 65 61 70  |0        :. Heap|
00006ea0  42 6c 6f 63 6b 20 77 69  74 68 20 63 6f 70 79 20  |Block with copy |
00006eb0  6f 66 20 44 61 74 61 53  61 76 65 20 6d 65 73 73  |of DataSave mess|
00006ec0  61 67 65 20 62 6c 6f 63  6b 0d 03 75 33 20 20 20  |age block..u3   |
00006ed0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3a f4  |              :.|
00006ee0  20 66 6f 72 20 77 68 65  6e 20 52 41 4d 20 74 72  | for when RAM tr|
00006ef0  61 6e 73 66 65 72 20 66  61 69 6c 73 0d 03 76 3c  |ansfer fails..v<|
00006f00  5f 55 25 21 31 36 30 3d  30 20 20 20 20 20 20 20  |_U%!160=0       |
00006f10  20 3a f4 20 50 6f 69 6e  74 65 72 20 74 6f 20 4d  | :. Pointer to M|
00006f20  6f 64 65 43 68 61 6e 67  65 20 65 76 65 6e 74 20  |odeChange event |
00006f30  66 75 6e 63 74 69 6f 6e  0d 03 77 3f 5f 55 25 21  |function..w?_U%!|
00006f40  31 36 34 3d 30 20 20 20  20 20 20 20 20 3a f4 20  |164=0        :. |
00006f50  50 6f 69 6e 74 65 72 20  74 6f 20 50 61 6c 65 74  |Pointer to Palet|
00006f60  74 65 43 68 61 6e 67 65  20 65 76 65 6e 74 20 66  |teChange event f|
00006f70  75 6e 63 74 69 6f 6e 0d  03 78 40 5f 55 25 21 31  |unction..x@_U%!1|
00006f80  36 38 3d 30 20 20 20 20  20 20 20 20 3a f4 20 50  |68=0        :. P|
00006f90  6f 69 6e 74 65 72 20 74  6f 20 54 61 73 6b 49 6e  |ointer to TaskIn|
00006fa0  69 74 69 61 6c 69 73 65  20 65 76 65 6e 74 20 66  |itialise event f|
00006fb0  75 6e 63 74 69 6f 6e 0d  03 79 3f 5f 55 25 21 31  |unction..y?_U%!1|
00006fc0  37 32 3d 30 20 20 20 20  20 20 20 20 3a f4 20 50  |72=0        :. P|
00006fd0  6f 69 6e 74 65 72 20 74  6f 20 54 61 73 6b 43 6c  |ointer to TaskCl|
00006fe0  6f 73 65 44 6f 77 6e 20  65 76 65 6e 74 20 66 75  |oseDown event fu|
00006ff0  6e 63 74 69 6f 6e 0d 03  7a 35 5f 55 25 21 31 37  |nction..z5_U%!17|
00007000  36 3d 30 20 20 20 20 20  20 20 20 3a f4 20 50 6f  |6=0        :. Po|
00007010  69 6e 74 65 72 20 74 6f  20 63 75 72 72 65 6e 74  |inter to current|
00007020  20 6d 65 6e 75 20 74 69  74 6c 65 0d 03 7b 38 5f  | menu title..{8_|
00007030  55 25 21 31 38 30 3d 30  20 20 20 20 20 20 20 20  |U%!180=0        |
00007040  3a f4 20 6e 72 20 6f 66  20 27 68 6f 74 6b 65 79  |:. nr of 'hotkey|
00007050  27 20 65 76 65 6e 74 73  20 72 65 67 69 73 74 65  |' events registe|
00007060  72 65 64 0d 03 7c 39 5f  55 25 21 31 38 34 3d 30  |red..|9_U%!184=0|
00007070  20 20 20 20 20 20 20 20  3a f4 20 50 6f 69 6e 74  |        :. Point|
00007080  65 72 20 74 6f 20 6c 69  73 74 20 6f 66 20 73 74  |er to list of st|
00007090  61 74 69 63 20 77 69 6e  64 6f 77 73 0d 03 7d 2f  |atic windows..}/|
000070a0  5f 55 25 21 31 38 38 3d  30 20 20 20 20 20 20 20  |_U%!188=0       |
000070b0  20 3a f4 20 74 6f 20 73  68 65 6c 6c 5f 41 70 70  | :. to shell_App|
000070c0  44 69 72 24 20 62 75 66  66 65 72 0d 03 7e 33 5f  |Dir$ buffer..~3_|
000070d0  55 25 21 31 39 32 3d 30  20 20 20 20 20 20 20 20  |U%!192=0        |
000070e0  3a f4 20 74 6f 20 73 68  65 6c 6c 5f 41 70 70 44  |:. to shell_AppD|
000070f0  61 74 61 44 69 72 24 20  62 75 66 66 65 72 0d 03  |ataDir$ buffer..|
00007100  7f 30 5f 55 25 21 31 39  36 3d 30 20 20 20 20 20  |.0_U%!196=0     |
00007110  20 20 20 3a f4 20 74 6f  20 73 68 65 6c 6c 5f 41  |   :. to shell_A|
00007120  70 70 4e 61 6d 65 24 20  62 75 66 66 65 72 0d 03  |ppName$ buffer..|
00007130  80 40 5f 55 25 21 32 30  30 3d 30 20 20 20 20 20  |.@_U%!200=0     |
00007140  20 20 20 3a f4 20 77 69  6e 64 6f 77 20 68 61 6e  |   :. window han|
00007150  64 6c 65 20 66 72 6f 6d  20 6c 61 73 74 20 44 61  |dle from last Da|
00007160  74 61 53 61 76 65 20 6d  65 73 73 61 67 65 0d 03  |taSave message..|
00007170  81 3e 5f 55 25 21 32 30  34 3d 30 20 20 20 20 20  |.>_U%!204=0     |
00007180  20 20 20 3a f4 20 69 63  6f 6e 20 68 61 6e 64 6c  |   :. icon handl|
00007190  65 20 66 72 6f 6d 20 6c  61 73 74 20 44 61 74 61  |e from last Data|
000071a0  53 61 76 65 20 6d 65 73  73 61 67 65 0d 03 82 3e  |Save message...>|
000071b0  5f 55 25 21 32 30 38 3d  2d 31 20 20 20 20 20 20  |_U%!208=-1      |
000071c0  20 3a f4 20 68 65 6c 70  68 61 6e 64 6c 65 25 20  | :. helphandle% |
000071d0  28 74 61 73 6b 20 68 61  6e 64 6c 65 20 6f 66 20  |(task handle of |
000071e0  53 74 72 6f 6e 67 48 6c  70 29 0d 03 83 44 5f 55  |StrongHlp)...D_U|
000071f0  25 21 32 31 32 3d 2d 31  20 20 20 20 20 20 20 3a  |%!212=-1       :|
00007200  f4 20 69 63 6f 6e 74 72  79 25 20 20 20 20 28 75  |. icontry%    (u|
00007210  73 65 64 20 62 79 20 53  74 72 6f 6e 67 48 6c 70  |sed by StrongHlp|
00007220  20 66 69 6e 64 20 72 6f  75 74 69 6e 65 29 0d 03  | find routine)..|
00007230  84 48 5f 55 25 21 32 31  36 3d 30 20 20 20 20 20  |.H_U%!216=0     |
00007240  20 20 20 3a f4 20 70 6f  69 6e 74 65 72 20 74 6f  |   :. pointer to|
00007250  20 70 65 6e 64 69 6e 67  24 20 62 75 66 66 65 72  | pending$ buffer|
00007260  20 66 6f 72 20 53 74 72  6f 6e 67 48 6c 70 20 63  | for StrongHlp c|
00007270  6f 6d 6d 61 6e 64 0d 03  85 3b 5f 55 25 21 32 32  |ommand...;_U%!22|
00007280  30 3d 30 20 20 20 20 20  20 20 20 3a f4 20 70 6f  |0=0        :. po|
00007290  69 6e 74 65 72 20 74 6f  20 6d 65 6e 75 20 77 61  |inter to menu wa|
000072a0  72 6e 69 6e 67 20 65 76  65 6e 74 20 62 6c 6f 63  |rning event bloc|
000072b0  6b 0d 03 86 3b 5f 55 25  21 32 32 34 3d 30 20 20  |k...;_U%!224=0  |
000072c0  20 20 20 20 20 20 3a f4  20 70 6f 69 6e 74 65 72  |      :. pointer|
000072d0  20 74 6f 20 6c 61 73 74  20 6d 65 6e 75 5f 77 61  | to last menu_wa|
000072e0  72 6e 20 66 6e 20 63 61  6c 6c 65 64 0d 03 87 49  |rn fn called...I|
000072f0  5f 55 25 21 32 32 38 3d  30 20 20 20 20 20 20 20  |_U%!228=0       |
00007300  20 3a f4 20 68 61 6e 64  6c 65 20 6f 66 20 77 61  | :. handle of wa|
00007310  72 6e 69 6e 67 20 64 69  61 6c 6f 67 20 75 73 65  |rning dialog use|
00007320  64 20 66 6f 72 20 6d 65  6e 75 20 69 74 65 6d 73  |d for menu items|
00007330  20 74 68 61 74 0d 03 88  3a 20 20 20 20 20 20 20  | that...:       |
00007340  20 20 20 20 20 20 20 20  20 20 3a f4 20 68 61 76  |          :. hav|
00007350  65 20 6e 6f 74 20 68 61  64 20 61 20 64 69 61 6c  |e not had a dial|
00007360  6f 67 20 62 6f 78 20 61  74 74 61 63 68 65 64 0d  |og box attached.|
00007370  03 89 3c 5f 55 25 21 32  33 32 3d a4 73 68 65 6c  |..<_U%!232=.shel|
00007380  6c 5f 48 65 61 70 42 6c  6f 63 6b 46 65 74 63 68  |l_HeapBlockFetch|
00007390  28 32 35 36 29 3a f4 20  66 6f 6e 74 63 6f 75 6e  |(256):. fontcoun|
000073a0  74 73 25 20 61 72 72 61  79 2e 2e 0d 03 8a 3d 5f  |ts% array.....=_|
000073b0  55 25 21 32 33 36 3d a4  73 68 65 6c 6c 5f 48 65  |U%!236=.shell_He|
000073c0  61 70 42 6c 6f 63 6b 46  65 74 63 68 28 32 35 36  |apBlockFetch(256|
000073d0  29 3a f4 20 66 6f 6e 74  62 69 6e 64 69 6e 67 25  |):. fontbinding%|
000073e0  20 61 72 72 61 79 2e 2e  0d 03 8b 4e 5f 55 25 21  | array.....N_U%!|
000073f0  32 34 30 3d 2d 31 20 20  20 20 20 20 20 3a f4 20  |240=-1       :. |
00007400  6e 72 20 6f 66 20 6f 75  74 6c 69 6e 65 20 66 6f  |nr of outline fo|
00007410  6e 74 73 20 6f 6e 20 73  79 73 74 65 6d 2c 20 2d  |nts on system, -|
00007420  31 20 69 66 20 22 46 6f  6e 74 4d 65 6e 75 5f 43  |1 if "FontMenu_C|
00007430  72 65 61 74 65 22 0d 03  8c 2b 20 20 20 20 20 20  |reate"...+      |
00007440  20 20 20 20 20 20 20 20  20 20 20 3a f4 20 68 61  |           :. ha|
00007450  73 20 6e 6f 74 20 62 65  65 6e 20 63 61 6c 6c 65  |s not been calle|
00007460  64 0d 03 8d 47 5f 55 25  21 32 34 34 3d 30 20 20  |d...G_U%!244=0  |
00007470  20 20 20 20 20 20 3a f4  20 70 74 72 20 74 6f 20  |      :. ptr to |
00007480  63 75 72 72 65 6e 74 6c  79 20 73 65 6c 65 63 74  |currently select|
00007490  65 64 20 66 6f 6e 74 20  6e 61 6d 65 20 69 6e 20  |ed font name in |
000074a0  46 6f 6e 74 4d 65 6e 75  0d 03 8e 33 5f 55 25 21  |FontMenu...3_U%!|
000074b0  32 34 38 3d 30 20 20 20  20 20 20 20 20 3a f4 20  |248=0        :. |
000074c0  70 74 72 20 74 6f 20 6c  61 73 74 20 6b 6e 6f 77  |ptr to last know|
000074d0  6e 20 46 6f 6e 74 24 50  61 74 68 0d 03 8f 3c 5f  |n Font$Path...<_|
000074e0  55 25 21 32 35 32 3d 30  20 20 20 20 20 20 20 20  |U%!252=0        |
000074f0  3a f4 20 6c 61 73 74 20  6b 6e 6f 77 6e 20 70 74  |:. last known pt|
00007500  72 20 74 6f 20 46 6f 6e  74 4d 65 6e 75 20 73 74  |r to FontMenu st|
00007510  72 75 63 74 75 72 65 0d  03 90 4d 5f 55 25 21 32  |ructure...M_U%!2|
00007520  35 36 3d 30 20 20 20 20  20 20 20 20 3a f4 20 70  |56=0        :. p|
00007530  74 72 20 74 6f 20 68 65  61 70 62 6c 6f 63 6b 20  |tr to heapblock |
00007540  68 6f 6c 64 69 6e 67 20  27 4d 65 6e 75 73 53 65  |holding 'MenusSe|
00007550  6c 65 63 74 69 6f 6e 53  6f 46 61 72 27 20 73 74  |lectionSoFar' st|
00007560  72 69 6e 67 0d 03 91 4c  5f 55 25 21 32 36 30 3d  |ring...L_U%!260=|
00007570  31 20 20 20 20 20 20 20  20 3a f4 20 53 79 73 74  |1        :. Syst|
00007580  65 6d 46 6f 6e 74 20 66  6c 61 67 20 66 6f 72 20  |emFont flag for |
00007590  46 6f 6e 74 4d 65 6e 75  20 30 20 6e 6f 20 73 79  |FontMenu 0 no sy|
000075a0  73 66 6f 6e 74 2c 20 31  20 73 79 73 66 6f 6e 74  |sfont, 1 sysfont|
000075b0  0d 03 92 33 5f 55 25 21  32 36 34 3d 30 20 20 20  |...3_U%!264=0   |
000075c0  20 20 20 20 20 3a f4 20  46 6f 6e 74 4d 65 6e 75  |     :. FontMenu|
000075d0  20 69 73 20 6f 70 65 6e  65 64 20 28 31 20 6f 72  | is opened (1 or|
000075e0  20 30 29 0d 03 93 4a 5f  55 25 21 32 36 38 3d 30  | 0)...J_U%!268=0|
000075f0  20 20 20 20 20 20 20 20  3a f4 20 46 6f 6e 74 4d  |        :. FontM|
00007600  65 6e 75 20 76 61 6c 69  64 20 73 65 6c 65 63 74  |enu valid select|
00007610  69 6f 6e 20 66 6c 61 67  20 30 20 6e 6f 6e 20 76  |ion flag 0 non v|
00007620  61 6c 69 64 2c 20 31 20  76 61 6c 69 64 0d 03 94  |alid, 1 valid...|
00007630  40 5f 55 25 21 32 37 32  3d 30 20 20 20 20 20 20  |@_U%!272=0      |
00007640  20 20 3a f4 20 78 20 63  6f 6f 72 64 20 6c 61 73  |  :. x coord las|
00007650  74 20 6d 6f 75 73 65 20  63 6c 69 63 6b 20 28 73  |t mouse click (s|
00007660  63 72 65 65 6e 20 63 6f  6f 72 64 73 29 0d 03 95  |creen coords)...|
00007670  40 5f 55 25 21 32 37 36  3d 30 20 20 20 20 20 20  |@_U%!276=0      |
00007680  20 20 3a f4 20 79 20 63  6f 6f 72 64 20 6c 61 73  |  :. y coord las|
00007690  74 20 6d 6f 75 73 65 20  63 6c 69 63 6b 20 28 73  |t mouse click (s|
000076a0  63 72 65 65 6e 20 63 6f  6f 72 64 73 29 0d 03 96  |creen coords)...|
000076b0  3b 5f 55 25 21 32 38 30  3d 30 20 20 20 20 20 20  |;_U%!280=0      |
000076c0  20 20 3a f4 20 6d 5f 66  69 6c 65 64 65 73 63 25  |  :. m_filedesc%|
000076d0  20 66 6f 72 20 73 79 73  74 65 6d 20 6d 65 73 73  | for system mess|
000076e0  61 67 65 20 66 69 6c 65  0d 03 97 3b 5f 55 25 21  |age file...;_U%!|
000076f0  32 38 34 3d 30 20 20 20  20 20 20 20 20 3a f4 20  |284=0        :. |
00007700  6d 5f 62 75 66 66 65 72  25 20 20 20 66 6f 72 20  |m_buffer%   for |
00007710  73 79 73 74 65 6d 20 6d  65 73 73 61 67 65 20 66  |system message f|
00007720  69 6c 65 0d 03 98 39 5f  55 25 21 32 38 38 3d 2d  |ile...9_U%!288=-|
00007730  31 20 20 20 20 20 20 20  3a f4 20 77 69 6e 64 6f  |1       :. windo|
00007740  77 20 68 61 6e 64 6c 65  20 66 6f 72 20 6c 61 73  |w handle for las|
00007750  74 20 62 75 6d 70 20 65  76 65 6e 74 0d 03 99 37  |t bump event...7|
00007760  5f 55 25 21 32 39 32 3d  2d 31 20 20 20 20 20 20  |_U%!292=-1      |
00007770  20 3a f4 20 69 63 6f 6e  20 68 61 6e 64 6c 65 20  | :. icon handle |
00007780  66 6f 72 20 6c 61 73 74  20 62 75 6d 70 20 65 76  |for last bump ev|
00007790  65 6e 74 0d 03 9a 3a 5f  55 25 21 32 39 36 3d 2d  |ent...:_U%!296=-|
000077a0  31 20 20 20 20 20 20 20  3a f4 20 6c 61 73 74 20  |1       :. last |
000077b0  65 76 65 6e 74 20 6f 66  66 73 65 74 20 66 6f 72  |event offset for|
000077c0  20 62 75 6d 70 20 68 61  6e 64 6c 65 72 0d 03 9b  | bump handler...|
000077d0  3a 5f 55 25 21 33 30 30  3d 30 20 20 20 20 20 20  |:_U%!300=0      |
000077e0  20 20 3a f4 20 70 6f 69  6e 74 65 72 20 74 6f 20  |  :. pointer to |
000077f0  50 72 65 51 75 69 74 20  48 61 6e 64 6c 65 72 20  |PreQuit Handler |
00007800  72 6f 75 74 69 6e 65 0d  03 9c 39 5f 55 25 21 33  |routine...9_U%!3|
00007810  30 34 3d 30 20 20 20 20  20 20 20 20 3a f4 20 70  |04=0        :. p|
00007820  6f 69 6e 74 65 72 20 74  6f 20 4f 70 65 6e 57 69  |ointer to OpenWi|
00007830  6e 64 6f 77 20 65 76 65  6e 74 20 62 6c 6f 63 6b  |ndow event block|
00007840  0d 03 9d 3a 5f 55 25 21  33 30 38 3d 30 20 20 20  |...:_U%!308=0   |
00007850  20 20 20 20 20 3a f4 20  70 6f 69 6e 74 65 72 20  |     :. pointer |
00007860  74 6f 20 43 6c 6f 73 65  57 69 6e 64 6f 77 20 65  |to CloseWindow e|
00007870  76 65 6e 74 20 62 6c 6f  63 6b 0d 03 9e 3b 5f 55  |vent block...;_U|
00007880  25 21 33 31 32 3d 30 20  20 20 20 20 20 20 20 3a  |%!312=0        :|
00007890  f4 20 70 6f 69 6e 74 65  72 20 74 6f 20 53 68 75  |. pointer to Shu|
000078a0  74 64 6f 77 6e 20 48 61  6e 64 6c 65 72 20 72 6f  |tdown Handler ro|
000078b0  75 74 69 6e 65 0d 03 9f  44 5f 55 25 21 33 31 36  |utine...D_U%!316|
000078c0  3d 30 20 20 20 20 20 20  20 20 3a f4 20 4f 53 20  |=0        :. OS |
000078d0  76 65 72 73 69 6f 6e 20  6e 72 20 61 73 20 72 65  |version nr as re|
000078e0  74 75 72 6e 65 64 20 62  79 20 57 69 6d 70 5f 49  |turned by Wimp_I|
000078f0  6e 69 74 69 61 6c 69 73  65 0d 03 a0 31 5f 55 25  |nitialise...1_U%|
00007900  21 33 32 30 3d 30 20 20  20 20 20 20 20 20 3a f4  |!320=0        :.|
00007910  20 4c 61 73 74 20 6d 6f  75 73 65 20 62 75 74 74  | Last mouse butt|
00007920  6f 6e 20 70 72 65 73 73  65 64 0d 03 a1 38 5f 55  |on pressed...8_U|
00007930  25 21 33 32 34 3d 30 20  20 20 20 20 20 20 20 3a  |%!324=0        :|
00007940  f4 20 73 74 6f 72 65 73  20 63 6f 6d 6d 61 6e 64  |. stores command|
00007950  20 6c 69 6e 65 20 61 72  67 20 28 69 66 20 61 6e  | line arg (if an|
00007960  79 29 0d 03 a2 2e 5f 55  25 21 33 32 38 3d 30 20  |y)...._U%!328=0 |
00007970  20 20 20 20 20 20 20 3a  f4 20 53 6c 69 64 65 72  |       :. Slider|
00007980  20 6c 61 73 74 20 78 20  70 6f 73 69 74 69 6f 6e  | last x position|
00007990  0d 03 a3 2a 5f 55 25 21  33 33 32 3d 30 20 20 20  |...*_U%!332=0   |
000079a0  20 20 20 20 20 3a f4 20  53 6c 69 64 65 72 20 65  |     :. Slider e|
000079b0  76 65 6e 74 20 62 6c 6f  63 6b 0d 03 a4 33 5f 55  |vent block...3_U|
000079c0  25 21 33 33 36 3d 30 20  20 20 20 20 20 20 20 3a  |%!336=0        :|
000079d0  f4 20 4e 72 20 6f 66 20  63 6f 70 69 65 73 20 73  |. Nr of copies s|
000079e0  74 69 6c 6c 20 74 6f 20  70 72 69 6e 74 0d 03 a5  |till to print...|
000079f0  31 5f 55 25 21 33 34 30  3d 30 20 20 20 20 20 20  |1_U%!340=0      |
00007a00  20 20 3a f4 20 50 6f 70  75 70 20 68 61 6e 64 6c  |  :. Popup handl|
00007a10  65 72 20 65 76 65 6e 74  20 62 6c 6f 63 6b 0d 03  |er event block..|
00007a20  a6 29 5f 55 25 21 33 34  34 3d 30 20 20 20 20 20  |.)_U%!344=0     |
00007a30  20 20 20 3a f4 20 54 78  74 20 63 6f 6e 74 72 6f  |   :. Txt contro|
00007a40  6c 20 62 6c 6f 63 6b 0d  03 a7 21 f2 73 68 65 6c  |l block...!.shel|
00007a50  6c 5f 4d 65 6d 46 69 6c  6c 28 5f 55 25 21 32 33  |l_MemFill(_U%!23|
00007a60  32 2c 32 35 36 2c 30 29  0d 03 a8 21 f2 73 68 65  |2,256,0)...!.she|
00007a70  6c 6c 5f 4d 65 6d 46 69  6c 6c 28 5f 55 25 21 32  |ll_MemFill(_U%!2|
00007a80  33 36 2c 32 35 36 2c 30  29 0d 03 a9 29 4f 53 56  |36,256,0)...)OSV|
00007a90  61 72 42 75 66 66 25 3d  a4 73 68 65 6c 6c 5f 48  |arBuff%=.shell_H|
00007aa0  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 32 35  |eapBlockFetch(25|
00007ab0  36 29 0d 03 aa 41 73 68  65 6c 6c 5f 41 70 70 44  |6)...Ashell_AppD|
00007ac0  69 72 24 3d a4 73 68 65  6c 6c 5f 4f 53 56 61 72  |ir$=.shell_OSVar|
00007ad0  47 65 74 56 61 6c 28 4f  53 56 61 72 42 75 66 66  |GetVal(OSVarBuff|
00007ae0  25 2c 32 35 36 2c 22 4f  62 65 79 24 44 69 72 22  |%,256,"Obey$Dir"|
00007af0  2c 31 29 0d 03 ab 26 f2  73 68 65 6c 6c 5f 48 65  |,1)...&.shell_He|
00007b00  61 70 42 6c 6f 63 6b 52  65 74 75 72 6e 28 4f 53  |apBlockReturn(OS|
00007b10  56 61 72 42 75 66 66 25  29 0d 03 ac 31 73 68 65  |VarBuff%)...1she|
00007b20  6c 6c 5f 41 70 70 4e 61  6d 65 24 3d c1 a4 73 68  |ll_AppName$=..sh|
00007b30  65 6c 6c 5f 4c 65 61 66  28 73 68 65 6c 6c 5f 41  |ell_Leaf(shell_A|
00007b40  70 70 44 69 72 24 29 2c  32 29 0d 03 ad 35 5f 55  |ppDir$),2)...5_U|
00007b50  25 21 31 38 38 3d a4 73  68 65 6c 6c 5f 48 65 61  |%!188=.shell_Hea|
00007b60  70 42 6c 6f 63 6b 46 65  74 63 68 28 28 a9 73 68  |pBlockFetch((.sh|
00007b70  65 6c 6c 5f 41 70 70 44  69 72 24 29 2b 31 29 0d  |ell_AppDir$)+1).|
00007b80  03 ae 36 5f 55 25 21 31  39 36 3d a4 73 68 65 6c  |..6_U%!196=.shel|
00007b90  6c 5f 48 65 61 70 42 6c  6f 63 6b 46 65 74 63 68  |l_HeapBlockFetch|
00007ba0  28 28 a9 73 68 65 6c 6c  5f 41 70 70 4e 61 6d 65  |((.shell_AppName|
00007bb0  24 29 2b 31 29 0d 03 af  26 74 65 6d 70 25 3d 5f  |$)+1)...&temp%=_|
00007bc0  55 25 21 31 38 38 3a 24  74 65 6d 70 25 3d 73 68  |U%!188:$temp%=sh|
00007bd0  65 6c 6c 5f 41 70 70 44  69 72 24 0d 03 b0 27 74  |ell_AppDir$...'t|
00007be0  65 6d 70 25 3d 5f 55 25  21 31 39 36 3a 24 74 65  |emp%=_U%!196:$te|
00007bf0  6d 70 25 3d 73 68 65 6c  6c 5f 41 70 70 4e 61 6d  |mp%=shell_AppNam|
00007c00  65 24 0d 03 b1 46 f4 20  4e 6f 77 20 68 61 76 65  |e$...F. Now have|
00007c10  20 61 20 6c 6f 6f 6b 20  61 74 20 74 68 65 20 63  | a look at the c|
00007c20  6f 6d 6d 61 6e 64 20 6c  69 6e 65 20 75 73 65 64  |ommand line used|
00007c30  20 74 6f 20 73 74 61 72  74 20 74 68 65 20 70 72  | to start the pr|
00007c40  6f 67 72 61 6d 2e 2e 2e  0d 03 b2 29 63 6d 64 6c  |ogram......)cmdl|
00007c50  69 6e 65 24 20 3d 20 a4  73 68 65 6c 6c 5f 4f 53  |ine$ = .shell_OS|
00007c60  52 65 61 64 43 6f 6d 6d  61 6e 64 41 72 67 28 31  |ReadCommandArg(1|
00007c70  29 0d 03 b3 16 e7 20 63  6d 64 6c 69 6e 65 24 20  |)..... cmdline$ |
00007c80  3c 3e 20 22 22 20 8c 0d  03 b4 42 20 20 5f 55 25  |<> "" ....B  _U%|
00007c90  21 31 30 30 20 3d 20 5f  55 25 21 31 30 30 20 84  |!100 = _U%!100 .|
00007ca0  20 31 20 3c 3c 20 35 3a  f4 20 73 65 74 20 27 63  | 1 << 5:. set 'c|
00007cb0  6f 6d 6d 61 6e 64 20 6c  69 6e 65 20 61 72 67 73  |ommand line args|
00007cc0  27 20 66 6c 61 67 2e 2e  2e 0d 03 b5 31 20 20 f4  |' flag......1  .|
00007cd0  20 53 74 6f 72 65 20 63  6f 6d 6d 61 6e 64 20 6c  | Store command l|
00007ce0  69 6e 65 20 66 6f 72 20  6c 61 74 65 72 20 72 65  |ine for later re|
00007cf0  66 65 72 65 6e 63 65 2e  2e 2e 0d 03 b6 32 20 20  |ference......2  |
00007d00  74 65 6d 70 25 20 3d 20  a4 73 68 65 6c 6c 5f 48  |temp% = .shell_H|
00007d10  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 a9 63  |eapBlockFetch(.c|
00007d20  6d 64 6c 69 6e 65 24 20  2b 20 31 29 0d 03 b7 2b  |mdline$ + 1)...+|
00007d30  20 20 24 28 74 65 6d 70  25 29 20 3d 20 63 6d 64  |  $(temp%) = cmd|
00007d40  6c 69 6e 65 24 20 3a 20  5f 55 25 21 33 32 34 20  |line$ : _U%!324 |
00007d50  3d 20 74 65 6d 70 25 0d  03 b8 05 cd 0d 03 b9 29  |= temp%........)|
00007d60  f4 20 43 68 65 63 6b 20  69 66 20 57 69 6d 70 45  |. Check if WimpE|
00007d70  58 54 20 6d 6f 64 75 6c  65 20 69 73 20 6c 6f 61  |XT module is loa|
00007d80  64 65 64 2e 2e 0d 03 ba  3d 74 65 6d 70 25 20 3d  |ded.....=temp% =|
00007d90  20 a4 73 68 65 6c 6c 5f  4f 53 4d 6f 64 75 6c 65  | .shell_OSModule|
00007da0  43 68 65 63 6b 56 65 72  73 69 6f 6e 28 22 57 69  |CheckVersion("Wi|
00007db0  6d 70 45 78 74 65 6e 73  69 6f 6e 22 2c 31 2e 39  |mpExtension",1.9|
00007dc0  38 29 0d 03 bb 43 e7 20  74 65 6d 70 25 20 3d 20  |8)...C. temp% = |
00007dd0  b9 20 8c 20 5f 55 25 21  31 30 30 20 3d 20 5f 55  |. . _U%!100 = _U|
00007de0  25 21 31 30 30 20 84 20  31 20 3c 3c 20 36 20 3a  |%!100 . 1 << 6 :|
00007df0  f4 20 53 65 74 20 57 45  78 74 20 66 6c 61 67 20  |. Set WExt flag |
00007e00  62 69 74 2e 2e 0d 03 bc  18 74 65 6d 70 25 20 3d  |bit......temp% =|
00007e10  20 a4 52 4f 33 5f 50 72  65 73 65 6e 74 0d 03 bd  | .RO3_Present...|
00007e20  43 e7 20 74 65 6d 70 25  20 3d 20 b9 20 8c 20 5f  |C. temp% = . . _|
00007e30  55 25 21 31 30 30 20 3d  20 5f 55 25 21 31 30 30  |U%!100 = _U%!100|
00007e40  20 84 20 31 20 3c 3c 20  31 30 3a f4 20 53 65 74  | . 1 << 10:. Set|
00007e50  20 52 4f 33 20 20 66 6c  61 67 20 62 69 74 2e 2e  | RO3  flag bit..|
00007e60  0d 03 be 3c 5f 55 25 21  31 30 30 20 3d 20 5f 55  |...<_U%!100 = _U|
00007e70  25 21 31 30 30 20 84 20  31 20 3c 3c 20 31 32 3a  |%!100 . 1 << 12:|
00007e80  f4 20 74 75 72 6e 20 6f  6e 20 69 6e 74 65 72 61  |. turn on intera|
00007e90  63 74 69 76 65 20 68 65  6c 70 2e 2e 0d 03 bf 05  |ctive help......|
00007ea0  e1 0d 03 c0 05 3a 0d 03  c1 19 2a 7c 53 74 6f 70  |.....:....*|Stop|
00007eb0  20 50 52 4f 43 73 68 65  6c 6c 5f 49 6e 69 74 0d  | PROCshell_Init.|
00007ec0  03 c2 04 0d 03 c3 22 2a  7c 53 74 61 72 74 20 46  |......"*|Start F|
00007ed0  4e 73 68 65 6c 6c 5f 47  65 74 43 6d 64 4c 69 6e  |Nshell_GetCmdLin|
00007ee0  65 41 72 67 73 0d 03 c4  1b dd 20 a4 73 68 65 6c  |eArgs..... .shel|
00007ef0  6c 5f 47 65 74 43 6d 64  4c 69 6e 65 41 72 67 73  |l_GetCmdLineArgs|
00007f00  0d 03 c5 0e ea 20 63 6d  64 6c 69 6e 65 24 0d 03  |..... cmdline$..|
00007f10  c6 14 e7 20 5f 55 25 21  33 32 34 20 3c 3e 20 30  |... _U%!324 <> 0|
00007f20  20 8c 0d 03 c7 1b 20 20  63 6d 64 6c 69 6e 65 24  | .....  cmdline$|
00007f30  20 3d 20 24 28 5f 55 25  21 33 32 34 29 0d 03 c8  | = $(_U%!324)...|
00007f40  05 cd 0d 03 c9 3a f2 73  68 65 6c 6c 5f 54 72 61  |.....:.shell_Tra|
00007f50  63 65 66 30 28 22 47 65  74 43 6d 64 4c 69 6e 65  |cef0("GetCmdLine|
00007f60  41 72 67 73 3a 63 6d 64  6c 69 6e 65 20 77 61 73  |Args:cmdline was|
00007f70  20 22 2b 63 6d 64 6c 69  6e 65 24 29 0d 03 ca 0e  | "+cmdline$)....|
00007f80  3d 20 63 6d 64 6c 69 6e  65 24 0d 03 cb 05 3a 0d  |= cmdline$....:.|
00007f90  03 cc 21 2a 7c 53 74 6f  70 20 46 4e 73 68 65 6c  |..!*|Stop FNshel|
00007fa0  6c 5f 47 65 74 43 6d 64  4c 69 6e 65 41 72 67 73  |l_GetCmdLineArgs|
00007fb0  0d 03 cd 04 0d 03 ce 1c  2a 7c 53 74 61 72 74 20  |........*|Start |
00007fc0  46 4e 73 68 65 6c 6c 5f  46 69 6c 65 54 79 70 65  |FNshell_FileType|
00007fd0  0d 03 cf 1e dd 20 a4 73  68 65 6c 6c 5f 46 69 6c  |..... .shell_Fil|
00007fe0  65 54 79 70 65 28 6f 62  6a 65 63 74 24 29 0d 03  |eType(object$)..|
00007ff0  d0 0b ea 20 74 79 70 65  25 0d 03 d1 24 c8 99 20  |... type%...$.. |
00008000  22 4f 53 5f 46 69 6c 65  22 2c 35 2c 6f 62 6a 65  |"OS_File",5,obje|
00008010  63 74 24 20 b8 20 2c 2c  74 79 70 65 25 0d 03 d2  |ct$ . ,,type%...|
00008020  1e 74 79 70 65 25 3d 28  74 79 70 65 25 20 80 20  |.type%=(type% . |
00008030  26 46 46 46 30 30 29 3e  3e 3e 38 0d 03 d3 0a 3d  |&FFF00)>>>8....=|
00008040  74 79 70 65 25 0d 03 d4  05 3a 0d 03 d5 1b 2a 7c  |type%....:....*||
00008050  53 74 6f 70 20 46 4e 73  68 65 6c 6c 5f 46 69 6c  |Stop FNshell_Fil|
00008060  65 54 79 70 65 0d 03 d6  04 0d 03 d7 1e 2a 7c 53  |eType........*|S|
00008070  74 61 72 74 20 46 4e 73  68 65 6c 6c 5f 46 69 6c  |tart FNshell_Fil|
00008080  65 45 78 69 73 74 73 0d  03 d8 20 dd 20 a4 73 68  |eExists... . .sh|
00008090  65 6c 6c 5f 46 69 6c 65  45 78 69 73 74 73 28 6f  |ell_FileExists(o|
000080a0  62 6a 65 63 74 24 29 0d  03 d9 30 e7 20 a4 73 68  |bject$)...0. .sh|
000080b0  65 6c 6c 5f 43 61 74 49  6e 66 6f 52 65 61 64 28  |ell_CatInfoRead(|
000080c0  6f 62 6a 65 63 74 24 29  3d 22 4e 6f 74 20 46 6f  |object$)="Not Fo|
000080d0  75 6e 64 22 3a 3d a3 0d  03 da 06 3d b9 0d 03 db  |und":=.....=....|
000080e0  05 3a 0d 03 dc 1d 2a 7c  53 74 6f 70 20 46 4e 73  |.:....*|Stop FNs|
000080f0  68 65 6c 6c 5f 46 69 6c  65 45 78 69 73 74 73 0d  |hell_FileExists.|
00008100  03 dd 04 0d 03 de 1f 2a  7c 53 74 61 72 74 20 46  |.......*|Start F|
00008110  4e 73 68 65 6c 6c 5f 43  61 74 49 6e 66 6f 52 65  |Nshell_CatInfoRe|
00008120  61 64 0d 03 df 21 dd 20  a4 73 68 65 6c 6c 5f 43  |ad...!. .shell_C|
00008130  61 74 49 6e 66 6f 52 65  61 64 28 6f 62 6a 65 63  |atInfoRead(objec|
00008140  74 24 29 0d 03 e0 37 ea  20 74 79 70 65 25 2c 6c  |t$)...7. type%,l|
00008150  6f 61 64 5f 61 64 64 72  25 2c 65 78 65 63 5f 61  |oad_addr%,exec_a|
00008160  64 64 72 25 2c 6c 65 6e  67 74 68 25 2c 61 74 74  |ddr%,length%,att|
00008170  73 25 2c 73 74 72 69 6e  67 24 0d 03 e1 47 c8 99  |s%,string$...G..|
00008180  20 22 4f 53 5f 46 69 6c  65 22 2c 35 2c 6f 62 6a  | "OS_File",5,obj|
00008190  65 63 74 24 20 b8 20 74  79 70 65 25 2c 2c 6c 6f  |ect$ . type%,,lo|
000081a0  61 64 5f 61 64 64 72 25  2c 65 78 65 63 5f 61 64  |ad_addr%,exec_ad|
000081b0  64 72 25 2c 6c 65 6e 67  74 68 25 2c 61 74 74 73  |dr%,length%,atts|
000081c0  25 0d 03 e2 1d e7 20 74  79 70 65 25 3d 30 20 8c  |%..... type%=0 .|
000081d0  20 3d 20 22 4e 6f 74 20  46 6f 75 6e 64 22 0d 03  | = "Not Found"..|
000081e0  e3 20 e7 20 61 74 74 73  25 3d 35 31 20 20 8c 20  |. . atts%=51  . |
000081f0  73 74 72 69 6e 67 24 2b  3d 22 57 52 20 22 0d 03  |string$+="WR "..|
00008200  e4 20 e7 20 61 74 74 73  25 3d 31 38 37 20 8c 20  |. . atts%=187 . |
00008210  73 74 72 69 6e 67 24 2b  3d 22 4c 57 52 22 0d 03  |string$+="LWR"..|
00008220  e5 20 e7 20 61 74 74 73  25 3d 31 33 36 20 8c 20  |. . atts%=136 . |
00008230  73 74 72 69 6e 67 24 2b  3d 22 44 4c 20 22 0d 03  |string$+="DL "..|
00008240  e6 3c 73 74 72 69 6e 67  24 2b 3d 22 20 22 2b a4  |.<string$+=" "+.|
00008250  73 68 65 6c 6c 5f 53 74  72 69 6e 67 50 61 64 4c  |shell_StringPadL|
00008260  65 61 64 69 6e 67 28 c3  7e 6c 6f 61 64 5f 61 64  |eading(.~load_ad|
00008270  64 72 25 2c 22 30 22 2c  38 29 0d 03 e7 3c 73 74  |dr%,"0",8)...<st|
00008280  72 69 6e 67 24 2b 3d 22  20 22 2b a4 73 68 65 6c  |ring$+=" "+.shel|
00008290  6c 5f 53 74 72 69 6e 67  50 61 64 4c 65 61 64 69  |l_StringPadLeadi|
000082a0  6e 67 28 c3 7e 65 78 65  63 5f 61 64 64 72 25 2c  |ng(.~exec_addr%,|
000082b0  22 30 22 2c 38 29 0d 03  e8 39 73 74 72 69 6e 67  |"0",8)...9string|
000082c0  24 2b 3d 22 20 22 2b a4  73 68 65 6c 6c 5f 53 74  |$+=" "+.shell_St|
000082d0  72 69 6e 67 50 61 64 4c  65 61 64 69 6e 67 28 c3  |ringPadLeading(.|
000082e0  7e 6c 65 6e 67 74 68 25  2c 22 30 22 2c 38 29 0d  |~length%,"0",8).|
000082f0  03 e9 0c 3d 73 74 72 69  6e 67 24 0d 03 ea 05 3a  |...=string$....:|
00008300  0d 03 eb 1e 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |....*|Stop FNshe|
00008310  6c 6c 5f 43 61 74 49 6e  66 6f 52 65 61 64 0d 03  |ll_CatInfoRead..|
00008320  ec 1d 2a 7c 53 74 61 72  74 20 46 4e 73 68 65 6c  |..*|Start FNshel|
00008330  6c 5f 47 65 74 41 70 70  44 69 72 0d 03 ed 16 dd  |l_GetAppDir.....|
00008340  20 a4 73 68 65 6c 6c 5f  47 65 74 41 70 70 44 69  | .shell_GetAppDi|
00008350  72 0d 03 ee 0b ea 20 74  65 6d 70 25 0d 03 ef 11  |r..... temp%....|
00008360  74 65 6d 70 25 3d 5f 55  25 21 31 38 38 0d 03 f0  |temp%=_U%!188...|
00008370  0b 3d 24 74 65 6d 70 25  0d 03 f1 05 3a 0d 03 f2  |.=$temp%....:...|
00008380  1c 2a 7c 53 74 6f 70 20  46 4e 73 68 65 6c 6c 5f  |.*|Stop FNshell_|
00008390  47 65 74 41 70 70 44 69  72 0d 03 f3 21 2a 7c 53  |GetAppDir...!*|S|
000083a0  74 61 72 74 20 46 4e 73  68 65 6c 6c 5f 47 65 74  |tart FNshell_Get|
000083b0  41 70 70 44 61 74 61 44  69 72 0d 03 f4 1a dd 20  |AppDataDir..... |
000083c0  a4 73 68 65 6c 6c 5f 47  65 74 41 70 70 44 61 74  |.shell_GetAppDat|
000083d0  61 44 69 72 0d 03 f5 0b  ea 20 74 65 6d 70 25 0d  |aDir..... temp%.|
000083e0  03 f6 11 74 65 6d 70 25  3d 5f 55 25 21 31 39 32  |...temp%=_U%!192|
000083f0  0d 03 f7 0b 3d 24 74 65  6d 70 25 0d 03 f8 05 3a  |....=$temp%....:|
00008400  0d 03 f9 20 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |... *|Stop FNshe|
00008410  6c 6c 5f 47 65 74 41 70  70 44 61 74 61 44 69 72  |ll_GetAppDataDir|
00008420  0d 03 fa 1e 2a 7c 53 74  61 72 74 20 46 4e 73 68  |....*|Start FNsh|
00008430  65 6c 6c 5f 47 65 74 41  70 70 4e 61 6d 65 0d 03  |ell_GetAppName..|
00008440  fb 17 dd 20 a4 73 68 65  6c 6c 5f 47 65 74 41 70  |... .shell_GetAp|
00008450  70 4e 61 6d 65 0d 03 fc  0b ea 20 74 65 6d 70 25  |pName..... temp%|
00008460  0d 03 fd 11 74 65 6d 70  25 3d 5f 55 25 21 31 39  |....temp%=_U%!19|
00008470  36 0d 03 fe 0b 3d 24 74  65 6d 70 25 0d 03 ff 05  |6....=$temp%....|
00008480  3a 0d 04 00 1d 2a 7c 53  74 6f 70 20 46 4e 73 68  |:....*|Stop FNsh|
00008490  65 6c 6c 5f 47 65 74 41  70 70 4e 61 6d 65 0d 04  |ell_GetAppName..|
000084a0  01 04 0d 04 02 23 2a 7c  53 74 61 72 74 20 50 52  |.....#*|Start PR|
000084b0  4f 43 73 68 65 6c 6c 5f  52 65 73 6f 75 72 63 65  |OCshell_Resource|
000084c0  73 49 6e 69 74 0d 04 03  1a dd 20 f2 73 68 65 6c  |sInit..... .shel|
000084d0  6c 5f 52 65 73 6f 75 72  63 65 73 49 6e 69 74 0d  |l_ResourcesInit.|
000084e0  04 04 42 ea 20 73 68 65  6c 6c 5f 41 70 70 44 61  |..B. shell_AppDa|
000084f0  74 61 44 69 72 24 2c 74  65 6d 70 25 2c 73 68 65  |taDir$,temp%,she|
00008500  6c 6c 5f 41 70 70 4e 61  6d 65 24 2c 73 68 65 6c  |ll_AppName$,shel|
00008510  6c 5f 41 70 70 44 69 72  24 2c 75 73 65 5f 33 64  |l_AppDir$,use_3d|
00008520  25 0d 04 05 28 ea 20 4f  53 56 61 72 42 75 66 66  |%...(. OSVarBuff|
00008530  25 2c 59 45 69 67 46 61  63 74 6f 72 25 2c 58 45  |%,YEigFactor%,XE|
00008540  69 67 46 61 63 74 6f 72  25 0d 04 06 24 73 68 65  |igFactor%...$she|
00008550  6c 6c 5f 41 70 70 4e 61  6d 65 24 3d a4 73 68 65  |ll_AppName$=.she|
00008560  6c 6c 5f 47 65 74 41 70  70 4e 61 6d 65 0d 04 07  |ll_GetAppName...|
00008570  23 73 68 65 6c 6c 5f 41  70 70 44 69 72 24 20 3d  |#shell_AppDir$ =|
00008580  a4 73 68 65 6c 6c 5f 47  65 74 41 70 70 44 69 72  |.shell_GetAppDir|
00008590  0d 04 08 29 4f 53 56 61  72 42 75 66 66 25 3d a4  |...)OSVarBuff%=.|
000085a0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
000085b0  65 74 63 68 28 32 35 36  29 0d 04 09 40 e7 20 a4  |etch(256)...@. .|
000085c0  73 68 65 6c 6c 5f 4f 53  56 61 72 45 78 69 73 74  |shell_OSVarExist|
000085d0  73 28 4f 53 56 61 72 42  75 66 66 25 2c 73 68 65  |s(OSVarBuff%,she|
000085e0  6c 6c 5f 41 70 70 4e 61  6d 65 24 2b 22 52 65 73  |ll_AppName$+"Res|
000085f0  24 50 61 74 68 22 29 20  8c 0d 04 0a 33 20 20 5f  |$Path") ....3  _|
00008600  55 25 21 31 30 30 3d 5f  55 25 21 31 30 30 20 84  |U%!100=_U%!100 .|
00008610  20 31 3c 3c 33 3a f4 20  73 65 74 20 27 52 65 73  | 1<<3:. set 'Res|
00008620  46 69 6e 64 27 20 66 6c  61 67 2e 2e 0d 04 0b 05  |Find' flag......|
00008630  cd 0d 04 0c 40 e7 20 a4  73 68 65 6c 6c 5f 4f 53  |....@. .shell_OS|
00008640  56 61 72 45 78 69 73 74  73 28 4f 53 56 61 72 42  |VarExists(OSVarB|
00008650  75 66 66 25 2c 73 68 65  6c 6c 5f 41 70 70 4e 61  |uff%,shell_AppNa|
00008660  6d 65 24 2b 22 44 61 74  61 24 44 69 72 22 29 20  |me$+"Data$Dir") |
00008670  8c 0d 04 0d 56 20 20 73  68 65 6c 6c 5f 41 70 70  |....V  shell_App|
00008680  44 61 74 61 44 69 72 24  3d a4 73 68 65 6c 6c 5f  |DataDir$=.shell_|
00008690  4f 53 56 61 72 47 65 74  56 61 6c 28 4f 53 56 61  |OSVarGetVal(OSVa|
000086a0  72 42 75 66 66 25 2c 32  35 36 2c 73 68 65 6c 6c  |rBuff%,256,shell|
000086b0  5f 41 70 70 4e 61 6d 65  24 2b 22 44 61 74 61 24  |_AppName$+"Data$|
000086c0  44 69 72 22 2c 31 29 0d  04 0e 3b 20 20 5f 55 25  |Dir",1)...;  _U%|
000086d0  21 31 39 32 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |!192=.shell_Heap|
000086e0  42 6c 6f 63 6b 46 65 74  63 68 28 28 a9 73 68 65  |BlockFetch((.she|
000086f0  6c 6c 5f 41 70 70 44 61  74 61 44 69 72 24 29 2b  |ll_AppDataDir$)+|
00008700  31 29 0d 04 0f 2c 20 20  74 65 6d 70 25 3d 5f 55  |1)...,  temp%=_U|
00008710  25 21 31 39 32 3a 24 74  65 6d 70 25 3d 73 68 65  |%!192:$temp%=she|
00008720  6c 6c 5f 41 70 70 44 61  74 61 44 69 72 24 0d 04  |ll_AppDataDir$..|
00008730  10 05 cc 0d 04 11 37 20  20 5f 55 25 21 31 39 32  |......7  _U%!192|
00008740  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
00008750  6b 46 65 74 63 68 28 28  a9 73 68 65 6c 6c 5f 41  |kFetch((.shell_A|
00008760  70 70 44 69 72 24 29 2b  31 29 0d 04 12 28 20 20  |ppDir$)+1)...(  |
00008770  74 65 6d 70 25 3d 5f 55  25 21 31 39 32 3a 24 74  |temp%=_U%!192:$t|
00008780  65 6d 70 25 3d 73 68 65  6c 6c 5f 41 70 70 44 69  |emp%=shell_AppDi|
00008790  72 24 0d 04 13 05 cd 0d  04 14 16 e7 20 5f 55 25  |r$.......... _U%|
000087a0  21 31 30 30 20 80 20 31  3c 3c 33 20 8c 0d 04 15  |!100 . 1<<3 ....|
000087b0  1d 20 20 f4 20 52 65 73  46 69 6e 64 20 69 6e 69  |.  . ResFind ini|
000087c0  74 69 61 6c 69 73 65 64  2e 2e 0d 04 16 1a 2a 7c  |tialised......*||
000087d0  64 65 66 69 6e 65 20 55  73 69 6e 67 5f 52 65 73  |define Using_Res|
000087e0  46 69 6e 64 0d 04 17 3a  20 20 e7 20 a4 73 68 65  |Find...:  . .she|
000087f0  6c 6c 5f 46 69 6c 65 45  78 69 73 74 73 28 73 68  |ll_FileExists(sh|
00008800  65 6c 6c 5f 41 70 70 4e  61 6d 65 24 2b 22 52 65  |ell_AppName$+"Re|
00008810  73 3a 4d 65 73 73 61 67  65 73 22 29 20 8c 0d 04  |s:Messages") ...|
00008820  18 48 20 20 20 20 f2 73  68 65 6c 6c 5f 4d 65 73  |.H    .shell_Mes|
00008830  73 61 67 65 73 49 6e 69  74 28 73 68 65 6c 6c 5f  |sagesInit(shell_|
00008840  41 70 70 4e 61 6d 65 24  2b 22 52 65 73 3a 4d 65  |AppName$+"Res:Me|
00008850  73 73 61 67 65 73 22 2c  5f 55 25 21 36 38 2c 5f  |ssages",_U%!68,_|
00008860  55 25 21 36 34 29 0d 04  19 07 20 20 cd 0d 04 1a  |U%!64)....  ....|
00008870  3b 20 20 e7 20 a4 73 68  65 6c 6c 5f 46 69 6c 65  |;  . .shell_File|
00008880  45 78 69 73 74 73 28 73  68 65 6c 6c 5f 41 70 70  |Exists(shell_App|
00008890  4e 61 6d 65 24 2b 22 52  65 73 3a 53 68 65 6c 6c  |Name$+"Res:Shell|
000088a0  4d 73 67 73 22 29 20 8c  0d 04 1b 4a 20 20 20 f2  |Msgs") ....J   .|
000088b0  73 68 65 6c 6c 5f 4d 65  73 73 61 67 65 73 49 6e  |shell_MessagesIn|
000088c0  69 74 28 73 68 65 6c 6c  5f 41 70 70 4e 61 6d 65  |it(shell_AppName|
000088d0  24 2b 22 52 65 73 3a 53  68 65 6c 6c 4d 73 67 73  |$+"Res:ShellMsgs|
000088e0  22 2c 5f 55 25 21 32 38  30 2c 5f 55 25 21 32 38  |",_U%!280,_U%!28|
000088f0  34 29 0d 04 1c 07 20 20  cc 0d 04 1d 45 20 20 20  |4)....  ....E   |
00008900  20 f2 73 68 65 6c 6c 5f  4d 65 73 73 61 67 65 73  | .shell_Messages|
00008910  49 6e 69 74 28 22 45 76  6e 74 53 68 65 6c 6c 52  |Init("EvntShellR|
00008920  65 73 3a 53 68 65 6c 6c  4d 73 67 73 22 2c 5f 55  |es:ShellMsgs",_U|
00008930  25 21 32 38 30 2c 5f 55  25 21 32 38 34 29 0d 04  |%!280,_U%!284)..|
00008940  1e 07 20 20 cd 0d 04 1f  35 20 20 c8 99 20 22 58  |..  ....5  .. "X|
00008950  4f 53 5f 52 65 61 64 4d  6f 64 65 56 61 72 69 61  |OS_ReadModeVaria|
00008960  62 6c 65 22 2c 2d 31 2c  30 34 20 b8 20 2c 2c 58  |ble",-1,04 . ,,X|
00008970  45 69 67 46 61 63 74 6f  72 25 0d 04 20 35 20 20  |EigFactor%.. 5  |
00008980  c8 99 20 22 58 4f 53 5f  52 65 61 64 4d 6f 64 65  |.. "XOS_ReadMode|
00008990  56 61 72 69 61 62 6c 65  22 2c 2d 31 2c 30 35 20  |Variable",-1,05 |
000089a0  b8 20 2c 2c 59 45 69 67  46 61 63 74 6f 72 25 0d  |. ,,YEigFactor%.|
000089b0  04 21 4d 20 20 e7 20 59  45 69 67 46 61 63 74 6f  |.!M  . YEigFacto|
000089c0  72 25 20 3d 20 31 20 80  20 a4 73 68 65 6c 6c 5f  |r% = 1 . .shell_|
000089d0  46 69 6c 65 45 78 69 73  74 73 28 73 68 65 6c 6c  |FileExists(shell|
000089e0  5f 41 70 70 4e 61 6d 65  24 2b 22 52 65 73 3a 53  |_AppName$+"Res:S|
000089f0  70 72 69 74 65 73 32 32  22 29 20 8c 0d 04 22 41  |prites22") ..."A|
00008a00  20 20 20 20 f4 20 53 63  72 65 65 6e 20 6d 6f 64  |    . Screen mod|
00008a10  65 20 69 73 20 68 69 2d  72 65 73 2c 20 61 6e 64  |e is hi-res, and|
00008a20  20 68 69 2d 72 65 73 20  73 70 72 69 74 65 20 66  | hi-res sprite f|
00008a30  69 6c 65 20 65 78 69 73  74 73 2e 2e 2e 0d 04 23  |ile exists.....#|
00008a40  46 20 20 20 20 5f 55 25  21 31 36 20 3d 20 a4 73  |F    _U%!16 = .s|
00008a50  68 65 6c 6c 5f 53 70 72  69 74 65 41 72 65 61 4c  |hell_SpriteAreaL|
00008a60  6f 61 64 28 73 68 65 6c  6c 5f 41 70 70 4e 61 6d  |oad(shell_AppNam|
00008a70  65 24 2b 22 52 65 73 3a  53 70 72 69 74 65 73 32  |e$+"Res:Sprites2|
00008a80  32 22 29 0d 04 24 07 20  20 cc 0d 04 25 3b 20 20  |2")..$.  ...%;  |
00008a90  20 20 e7 20 a4 73 68 65  6c 6c 5f 46 69 6c 65 45  |  . .shell_FileE|
00008aa0  78 69 73 74 73 28 73 68  65 6c 6c 5f 41 70 70 4e  |xists(shell_AppN|
00008ab0  61 6d 65 24 2b 22 52 65  73 3a 53 70 72 69 74 65  |ame$+"Res:Sprite|
00008ac0  73 22 29 20 8c 0d 04 26  35 20 20 20 20 20 20 f4  |s") ...&5      .|
00008ad0  20 4e 6f 20 68 69 2d 72  65 73 20 73 70 72 69 74  | No hi-res sprit|
00008ae0  65 20 66 69 6c 65 2c 20  6c 6f 61 64 20 6e 6f 72  |e file, load nor|
00008af0  6d 61 6c 20 6f 6e 65 2e  2e 2e 0d 04 27 44 20 20  |mal one.....'D  |
00008b00  20 20 20 20 5f 55 25 21  31 36 3d a4 73 68 65 6c  |    _U%!16=.shel|
00008b10  6c 5f 53 70 72 69 74 65  41 72 65 61 4c 6f 61 64  |l_SpriteAreaLoad|
00008b20  28 73 68 65 6c 6c 5f 41  70 70 4e 61 6d 65 24 2b  |(shell_AppName$+|
00008b30  22 52 65 73 3a 53 70 72  69 74 65 73 22 29 0d 04  |"Res:Sprites")..|
00008b40  28 09 20 20 20 20 cc 0d  04 29 3e 20 20 20 20 20  |(.    ...)>     |
00008b50  20 5f 55 25 21 31 36 3d  31 3a f4 20 75 73 65 20  | _U%!16=1:. use |
00008b60  77 69 6d 70 20 73 70 72  69 74 65 20 70 6f 6f 6c  |wimp sprite pool|
00008b70  20 69 66 20 6e 6f 20 27  53 70 72 69 74 65 73 27  | if no 'Sprites'|
00008b80  20 66 69 6c 65 0d 04 2a  09 20 20 20 20 cd 0d 04  | file..*.    ...|
00008b90  2b 07 20 20 cd 0d 04 2c  27 20 20 f4 20 63 68 65  |+.  ...,'  . che|
00008ba0  63 6b 20 69 66 20 74 65  6d 70 6c 61 74 65 73 20  |ck if templates |
00008bb0  6e 65 65 64 20 6c 6f 61  64 69 6e 67 0d 04 2d 20  |need loading..- |
00008bc0  20 20 75 73 65 5f 33 64  25 20 3d 20 a4 73 68 65  |  use_3d% = .she|
00008bd0  6c 6c 5f 33 44 45 6e 61  62 6c 65 64 0d 04 2e 46  |ll_3DEnabled...F|
00008be0  20 20 e7 20 75 73 65 5f  33 64 25 20 80 20 a4 73  |  . use_3d% . .s|
00008bf0  68 65 6c 6c 5f 46 69 6c  65 45 78 69 73 74 73 28  |hell_FileExists(|
00008c00  73 68 65 6c 6c 5f 41 70  70 4e 61 6d 65 24 2b 22  |shell_AppName$+"|
00008c10  52 65 73 3a 54 65 6d 70  6c 61 74 65 73 33 22 29  |Res:Templates3")|
00008c20  20 8c 0d 04 2f 3d 20 20  20 20 f2 73 68 65 6c 6c  | .../=    .shell|
00008c30  5f 54 65 6d 70 6c 61 74  65 73 49 6e 69 74 28 73  |_TemplatesInit(s|
00008c40  68 65 6c 6c 5f 41 70 70  4e 61 6d 65 24 2b 22 52  |hell_AppName$+"R|
00008c50  65 73 3a 54 65 6d 70 6c  61 74 65 73 33 22 29 0d  |es:Templates3").|
00008c60  04 30 07 20 20 cc 0d 04  31 3d 20 20 20 20 e7 20  |.0.  ...1=    . |
00008c70  a4 73 68 65 6c 6c 5f 46  69 6c 65 45 78 69 73 74  |.shell_FileExist|
00008c80  73 28 73 68 65 6c 6c 5f  41 70 70 4e 61 6d 65 24  |s(shell_AppName$|
00008c90  2b 22 52 65 73 3a 54 65  6d 70 6c 61 74 65 73 22  |+"Res:Templates"|
00008ca0  29 20 8c 0d 04 32 3e 20  20 20 20 20 20 f2 73 68  |) ...2>      .sh|
00008cb0  65 6c 6c 5f 54 65 6d 70  6c 61 74 65 73 49 6e 69  |ell_TemplatesIni|
00008cc0  74 28 73 68 65 6c 6c 5f  41 70 70 4e 61 6d 65 24  |t(shell_AppName$|
00008cd0  2b 22 52 65 73 3a 54 65  6d 70 6c 61 74 65 73 22  |+"Res:Templates"|
00008ce0  29 0d 04 33 09 20 20 20  20 cd 0d 04 34 07 20 20  |)..3.    ...4.  |
00008cf0  cd 0d 04 35 05 cc 0d 04  36 21 20 20 f4 20 52 65  |...5....6!  . Re|
00008d00  73 46 69 6e 64 20 4e 4f  54 20 69 6e 69 74 69 61  |sFind NOT initia|
00008d10  6c 69 73 65 64 2e 2e 0d  04 37 36 20 20 e7 20 a4  |lised....76  . .|
00008d20  73 68 65 6c 6c 5f 46 69  6c 65 45 78 69 73 74 73  |shell_FileExists|
00008d30  28 73 68 65 6c 6c 5f 41  70 70 44 69 72 24 2b 22  |(shell_AppDir$+"|
00008d40  2e 4d 65 73 73 61 67 65  73 22 29 20 8c 0d 04 38  |.Messages") ...8|
00008d50  44 20 20 20 20 f2 73 68  65 6c 6c 5f 4d 65 73 73  |D    .shell_Mess|
00008d60  61 67 65 73 49 6e 69 74  28 73 68 65 6c 6c 5f 41  |agesInit(shell_A|
00008d70  70 70 44 69 72 24 2b 22  2e 4d 65 73 73 61 67 65  |ppDir$+".Message|
00008d80  73 22 2c 5f 55 25 21 36  38 2c 5f 55 25 21 36 34  |s",_U%!68,_U%!64|
00008d90  29 0d 04 39 07 20 20 cd  0d 04 3a 37 20 20 e7 20  |)..9.  ...:7  . |
00008da0  a4 73 68 65 6c 6c 5f 46  69 6c 65 45 78 69 73 74  |.shell_FileExist|
00008db0  73 28 73 68 65 6c 6c 5f  41 70 70 44 69 72 24 2b  |s(shell_AppDir$+|
00008dc0  22 2e 53 68 65 6c 6c 4d  73 67 73 22 29 20 8c 0d  |".ShellMsgs") ..|
00008dd0  04 3b 47 20 20 20 20 f2  73 68 65 6c 6c 5f 4d 65  |.;G    .shell_Me|
00008de0  73 73 61 67 65 73 49 6e  69 74 28 73 68 65 6c 6c  |ssagesInit(shell|
00008df0  5f 41 70 70 44 69 72 24  2b 22 2e 53 68 65 6c 6c  |_AppDir$+".Shell|
00008e00  4d 73 67 73 22 2c 5f 55  25 21 32 38 30 2c 5f 55  |Msgs",_U%!280,_U|
00008e10  25 21 32 38 34 29 0d 04  3c 07 20 20 cc 0d 04 3d  |%!284)..<.  ...=|
00008e20  45 20 20 20 20 f2 73 68  65 6c 6c 5f 4d 65 73 73  |E    .shell_Mess|
00008e30  61 67 65 73 49 6e 69 74  28 22 45 76 6e 74 53 68  |agesInit("EvntSh|
00008e40  65 6c 6c 52 65 73 3a 53  68 65 6c 6c 4d 73 67 73  |ellRes:ShellMsgs|
00008e50  22 2c 5f 55 25 21 32 38  30 2c 5f 55 25 21 32 38  |",_U%!280,_U%!28|
00008e60  34 29 0d 04 3e 07 20 20  cd 0d 04 3f 46 20 20 f4  |4)..>.  ...?F  .|
00008e70  20 43 68 65 63 6b 20 69  66 20 75 73 65 72 20 73  | Check if user s|
00008e80  70 72 69 74 65 73 20 6e  65 65 64 20 6c 6f 61 64  |prites need load|
00008e90  69 6e 67 2c 20 62 75 74  20 66 69 72 73 74 20 63  |ing, but first c|
00008ea0  68 65 63 6b 20 69 66 20  70 72 6f 67 72 61 6d 0d  |heck if program.|
00008eb0  04 40 33 20 20 f4 20 68  61 73 20 62 65 65 6e 20  |.@3  . has been |
00008ec0  73 74 61 72 74 65 64 20  69 6e 20 61 20 68 69 2d  |started in a hi-|
00008ed0  72 65 73 20 73 63 72 65  65 6e 20 6d 6f 64 65 2e  |res screen mode.|
00008ee0  2e 2e 0d 04 41 35 20 20  c8 99 20 22 58 4f 53 5f  |....A5  .. "XOS_|
00008ef0  52 65 61 64 4d 6f 64 65  56 61 72 69 61 62 6c 65  |ReadModeVariable|
00008f00  22 2c 2d 31 2c 30 34 20  b8 20 2c 2c 58 45 69 67  |",-1,04 . ,,XEig|
00008f10  46 61 63 74 6f 72 25 0d  04 42 35 20 20 c8 99 20  |Factor%..B5  .. |
00008f20  22 58 4f 53 5f 52 65 61  64 4d 6f 64 65 56 61 72  |"XOS_ReadModeVar|
00008f30  69 61 62 6c 65 22 2c 2d  31 2c 30 35 20 b8 20 2c  |iable",-1,05 . ,|
00008f40  2c 59 45 69 67 46 61 63  74 6f 72 25 0d 04 43 49  |,YEigFactor%..CI|
00008f50  20 20 e7 20 59 45 69 67  46 61 63 74 6f 72 25 20  |  . YEigFactor% |
00008f60  3d 20 31 20 80 20 a4 73  68 65 6c 6c 5f 46 69 6c  |= 1 . .shell_Fil|
00008f70  65 45 78 69 73 74 73 28  73 68 65 6c 6c 5f 41 70  |eExists(shell_Ap|
00008f80  70 44 69 72 24 2b 22 2e  53 70 72 69 74 65 73 32  |pDir$+".Sprites2|
00008f90  32 22 29 20 8c 0d 04 44  41 20 20 20 20 f4 20 53  |2") ...DA    . S|
00008fa0  63 72 65 65 6e 20 6d 6f  64 65 20 69 73 20 68 69  |creen mode is hi|
00008fb0  2d 72 65 73 2c 20 61 6e  64 20 68 69 2d 72 65 73  |-res, and hi-res|
00008fc0  20 73 70 72 69 74 65 20  66 69 6c 65 20 65 78 69  | sprite file exi|
00008fd0  73 74 73 2e 2e 2e 0d 04  45 42 20 20 20 20 5f 55  |sts.....EB    _U|
00008fe0  25 21 31 36 20 3d 20 a4  73 68 65 6c 6c 5f 53 70  |%!16 = .shell_Sp|
00008ff0  72 69 74 65 41 72 65 61  4c 6f 61 64 28 73 68 65  |riteAreaLoad(she|
00009000  6c 6c 5f 41 70 70 44 69  72 24 2b 22 2e 53 70 72  |ll_AppDir$+".Spr|
00009010  69 74 65 73 32 32 22 29  0d 04 46 07 20 20 cc 0d  |ites22")..F.  ..|
00009020  04 47 37 20 20 20 20 e7  20 a4 73 68 65 6c 6c 5f  |.G7    . .shell_|
00009030  46 69 6c 65 45 78 69 73  74 73 28 73 68 65 6c 6c  |FileExists(shell|
00009040  5f 41 70 70 44 69 72 24  2b 22 2e 53 70 72 69 74  |_AppDir$+".Sprit|
00009050  65 73 22 29 20 8c 0d 04  48 40 20 20 20 20 20 20  |es") ...H@      |
00009060  5f 55 25 21 31 36 3d a4  73 68 65 6c 6c 5f 53 70  |_U%!16=.shell_Sp|
00009070  72 69 74 65 41 72 65 61  4c 6f 61 64 28 73 68 65  |riteAreaLoad(she|
00009080  6c 6c 5f 41 70 70 44 69  72 24 2b 22 2e 53 70 72  |ll_AppDir$+".Spr|
00009090  69 74 65 73 22 29 0d 04  49 09 20 20 20 20 cc 0d  |ites")..I.    ..|
000090a0  04 4a 3e 20 20 20 20 20  20 5f 55 25 21 31 36 3d  |.J>      _U%!16=|
000090b0  31 3a f4 20 75 73 65 20  77 69 6d 70 20 73 70 72  |1:. use wimp spr|
000090c0  69 74 65 20 70 6f 6f 6c  20 69 66 20 6e 6f 20 27  |ite pool if no '|
000090d0  53 70 72 69 74 65 73 27  20 66 69 6c 65 0d 04 4b  |Sprites' file..K|
000090e0  09 20 20 20 20 cd 0d 04  4c 07 20 20 cd 0d 04 4d  |.    ...L.  ...M|
000090f0  27 20 20 f4 20 63 68 65  63 6b 20 69 66 20 74 65  |'  . check if te|
00009100  6d 70 6c 61 74 65 73 20  6e 65 65 64 20 6c 6f 61  |mplates need loa|
00009110  64 69 6e 67 0d 04 4e 20  20 20 75 73 65 5f 33 64  |ding..N   use_3d|
00009120  25 20 3d 20 a4 73 68 65  6c 6c 5f 33 44 45 6e 61  |% = .shell_3DEna|
00009130  62 6c 65 64 0d 04 4f 42  20 20 e7 20 75 73 65 5f  |bled..OB  . use_|
00009140  33 64 25 20 80 20 a4 73  68 65 6c 6c 5f 46 69 6c  |3d% . .shell_Fil|
00009150  65 45 78 69 73 74 73 28  73 68 65 6c 6c 5f 41 70  |eExists(shell_Ap|
00009160  70 44 69 72 24 2b 22 2e  54 65 6d 70 6c 61 74 65  |pDir$+".Template|
00009170  73 33 22 29 20 8c 0d 04  50 39 20 20 20 20 f2 73  |s3") ...P9    .s|
00009180  68 65 6c 6c 5f 54 65 6d  70 6c 61 74 65 73 49 6e  |hell_TemplatesIn|
00009190  69 74 28 73 68 65 6c 6c  5f 41 70 70 44 69 72 24  |it(shell_AppDir$|
000091a0  2b 22 2e 54 65 6d 70 6c  61 74 65 73 33 22 29 0d  |+".Templates3").|
000091b0  04 51 07 20 20 cc 0d 04  52 39 20 20 20 20 e7 20  |.Q.  ...R9    . |
000091c0  a4 73 68 65 6c 6c 5f 46  69 6c 65 45 78 69 73 74  |.shell_FileExist|
000091d0  73 28 73 68 65 6c 6c 5f  41 70 70 44 69 72 24 2b  |s(shell_AppDir$+|
000091e0  22 2e 54 65 6d 70 6c 61  74 65 73 22 29 20 8c 0d  |".Templates") ..|
000091f0  04 53 3a 20 20 20 20 20  20 f2 73 68 65 6c 6c 5f  |.S:      .shell_|
00009200  54 65 6d 70 6c 61 74 65  73 49 6e 69 74 28 73 68  |TemplatesInit(sh|
00009210  65 6c 6c 5f 41 70 70 44  69 72 24 2b 22 2e 54 65  |ell_AppDir$+".Te|
00009220  6d 70 6c 61 74 65 73 22  29 0d 04 54 09 20 20 20  |mplates")..T.   |
00009230  20 cd 0d 04 55 07 20 20  cd 0d 04 56 05 cd 0d 04  | ...U.  ...V....|
00009240  57 1c c8 99 20 22 4d 65  6e 75 55 74 69 6c 5f 49  |W... "MenuUtil_I|
00009250  6e 69 74 69 61 6c 69 73  65 22 0d 04 58 1f f2 73  |nitialise"..X..s|
00009260  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 52 65  |hell_HeapBlockRe|
00009270  74 75 72 6e 28 5f 51 25  29 0d 04 59 3e 5f 51 25  |turn(_Q%)..Y>_Q%|
00009280  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
00009290  6b 46 65 74 63 68 28 31  30 32 34 29 3a f4 20 72  |kFetch(1024):. r|
000092a0  65 64 75 63 65 20 67 6c  6f 62 61 6c 20 77 69 6d  |educe global wim|
000092b0  70 20 62 6c 6f 63 6b 0d  04 5a 26 f2 73 68 65 6c  |p block..Z&.shel|
000092c0  6c 5f 48 65 61 70 42 6c  6f 63 6b 52 65 74 75 72  |l_HeapBlockRetur|
000092d0  6e 28 4f 53 56 61 72 42  75 66 66 25 29 0d 04 5b  |n(OSVarBuff%)..[|
000092e0  05 e1 0d 04 5c 05 3a 0d  04 5d 22 2a 7c 53 74 6f  |....\.:..]"*|Sto|
000092f0  70 20 50 52 4f 43 73 68  65 6c 6c 5f 52 65 73 6f  |p PROCshell_Reso|
00009300  75 72 63 65 73 49 6e 69  74 0d 04 5e 04 0d 04 5f  |urcesInit..^..._|
00009310  22 2a 7c 53 74 61 72 74  20 46 4e 73 68 65 6c 6c  |"*|Start FNshell|
00009320  5f 53 70 72 69 74 65 41  72 65 61 4c 6f 61 64 0d  |_SpriteAreaLoad.|
00009330  04 60 26 dd 20 a4 73 68  65 6c 6c 5f 53 70 72 69  |.`&. .shell_Spri|
00009340  74 65 41 72 65 61 4c 6f  61 64 28 66 69 6c 65 6e  |teAreaLoad(filen|
00009350  61 6d 65 24 29 0d 04 61  0f ea 20 73 70 25 2c 53  |ame$)..a.. sp%,S|
00009360  25 2c 54 25 0d 04 62 25  53 25 3d 8e 20 28 66 69  |%,T%..b%S%=. (fi|
00009370  6c 65 6e 61 6d 65 24 29  3a 54 25 3d a2 23 53 25  |lename$):T%=.#S%|
00009380  2b 31 36 3a d9 20 23 53  25 0d 04 63 21 73 70 25  |+16:. #S%..c!sp%|
00009390  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
000093a0  6b 46 65 74 63 68 28 54  25 29 0d 04 64 13 21 73  |kFetch(T%)..d.!s|
000093b0  70 25 3d 54 25 3a 73 70  25 21 34 3d 30 0d 04 65  |p%=T%:sp%!4=0..e|
000093c0  16 73 70 25 21 38 3d 31  36 3a 73 70 25 21 31 32  |.sp%!8=16:sp%!12|
000093d0  3d 31 36 0d 04 66 1d c8  99 20 22 4f 53 5f 53 70  |=16..f... "OS_Sp|
000093e0  72 69 74 65 4f 70 22 2c  26 32 30 39 2c 73 70 25  |riteOp",&209,sp%|
000093f0  0d 04 67 27 c8 99 20 22  4f 53 5f 53 70 72 69 74  |..g'.. "OS_Sprit|
00009400  65 4f 70 22 2c 26 32 30  41 2c 73 70 25 2c 66 69  |eOp",&20A,sp%,fi|
00009410  6c 65 6e 61 6d 65 24 0d  04 68 15 2a 7c 69 66 64  |lename$..h.*|ifd|
00009420  65 66 20 54 72 61 63 65  49 6e 69 74 0d 04 69 3e  |ef TraceInit..i>|
00009430  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
00009440  53 70 72 69 74 65 4c 6f  61 64 3a 53 70 72 69 74  |SpriteLoad:Sprit|
00009450  65 20 66 69 6c 65 20 6c  6f 61 64 65 64 20 61 74  |e file loaded at|
00009460  20 26 22 2b c3 7e 73 70  25 29 0d 04 6a 0b 2a 7c  | &"+.~sp%)..j.*||
00009470  65 6e 64 69 66 0d 04 6b  08 3d 73 70 25 0d 04 6c  |endif..k.=sp%..l|
00009480  05 3a 0d 04 6d 21 2a 7c  53 74 6f 70 20 46 4e 73  |.:..m!*|Stop FNs|
00009490  68 65 6c 6c 5f 53 70 72  69 74 65 41 72 65 61 4c  |hell_SpriteAreaL|
000094a0  6f 61 64 0d 04 6e 04 0d  04 6f 23 2a 7c 53 74 61  |oad..n...o#*|Sta|
000094b0  72 74 20 46 4e 73 68 65  6c 6c 5f 55 73 65 72 53  |rt FNshell_UserS|
000094c0  70 72 69 74 65 73 42 61  73 65 0d 04 70 1c dd 20  |pritesBase..p.. |
000094d0  a4 73 68 65 6c 6c 5f 55  73 65 72 53 70 72 69 74  |.shell_UserSprit|
000094e0  65 73 42 61 73 65 0d 04  71 0b 3d 5f 55 25 21 31  |esBase..q.=_U%!1|
000094f0  36 0d 04 72 05 3a 0d 04  73 22 2a 7c 53 74 6f 70  |6..r.:..s"*|Stop|
00009500  20 46 4e 73 68 65 6c 6c  5f 55 73 65 72 53 70 72  | FNshell_UserSpr|
00009510  69 74 65 73 42 61 73 65  0d 04 74 04 0d 04 75 20  |itesBase..t...u |
00009520  2a 7c 53 74 61 72 74 20  46 4e 73 68 65 6c 6c 5f  |*|Start FNshell_|
00009530  53 70 72 69 74 65 47 65  74 50 74 72 0d 04 76 2c  |SpriteGetPtr..v,|
00009540  dd 20 a4 73 68 65 6c 6c  5f 53 70 72 69 74 65 47  |. .shell_SpriteG|
00009550  65 74 50 74 72 28 73 70  72 69 74 65 61 72 65 61  |etPtr(spritearea|
00009560  25 2c 6e 61 6d 65 24 29  0d 04 77 12 ea 20 62 75  |%,name$)..w.. bu|
00009570  66 66 65 72 25 2c 70 74  72 25 0d 04 78 25 62 75  |ffer%,ptr%..x%bu|
00009580  66 66 65 72 25 3d a4 73  68 65 6c 6c 5f 48 65 61  |ffer%=.shell_Hea|
00009590  70 42 6c 6f 63 6b 46 65  74 63 68 28 32 31 29 0d  |pBlockFetch(21).|
000095a0  04 79 12 24 62 75 66 66  65 72 25 3d 6e 61 6d 65  |.y.$buffer%=name|
000095b0  24 0d 04 7a 36 c8 99 20  22 4f 53 5f 53 70 72 69  |$..z6.. "OS_Spri|
000095c0  74 65 4f 70 22 2c 26 31  31 38 2c 73 70 72 69 74  |teOp",&118,sprit|
000095d0  65 61 72 65 61 25 2c 62  75 66 66 65 72 25 20 b8  |earea%,buffer% .|
000095e0  20 2c 2c 70 74 72 25 0d  04 7b 23 f2 73 68 65 6c  | ,,ptr%..{#.shel|
000095f0  6c 5f 48 65 61 70 42 6c  6f 63 6b 52 65 74 75 72  |l_HeapBlockRetur|
00009600  6e 28 62 75 66 66 65 72  25 29 0d 04 7c 09 3d 70  |n(buffer%)..|.=p|
00009610  74 72 25 0d 04 7d 05 3a  0d 04 7e 1f 2a 7c 53 74  |tr%..}.:..~.*|St|
00009620  6f 70 20 46 4e 73 68 65  6c 6c 5f 53 70 72 69 74  |op FNshell_Sprit|
00009630  65 47 65 74 50 74 72 0d  04 7f 04 0d 04 80 23 2a  |eGetPtr.......#*|
00009640  7c 53 74 61 72 74 20 50  52 4f 43 73 68 65 6c 6c  ||Start PROCshell|
00009650  5f 54 65 6d 70 6c 61 74  65 73 49 6e 69 74 0d 04  |_TemplatesInit..|
00009660  81 25 dd 20 f2 73 68 65  6c 6c 5f 54 65 6d 70 6c  |.%. .shell_Templ|
00009670  61 74 65 73 49 6e 69 74  28 66 69 6c 65 6e 61 6d  |atesInit(filenam|
00009680  65 24 29 0d 04 82 3f ea  20 54 65 6d 70 6c 61 74  |e$)...?. Templat|
00009690  65 50 74 72 25 2c 49 6e  64 69 72 65 63 74 50 74  |ePtr%,IndirectPt|
000096a0  72 25 2c 49 6e 64 69 72  65 63 74 45 6e 64 25 2c  |r%,IndirectEnd%,|
000096b0  58 25 2c 70 74 72 25 2c  62 75 66 66 5f 73 69 7a  |X%,ptr%,buff_siz|
000096c0  65 25 0d 04 83 42 ea 20  66 69 6c 65 6c 65 6e 25  |e%...B. filelen%|
000096d0  2c 70 6f 73 25 2c 6e 61  6d 65 5f 62 75 66 66 65  |,pos%,name_buffe|
000096e0  72 25 2c 6e 61 6d 65 24  2c 6e 72 5f 74 65 6d 70  |r%,name$,nr_temp|
000096f0  6c 61 74 65 73 25 2c 66  6c 67 73 25 2c 72 65 73  |lates%,flgs%,res|
00009700  75 6c 74 25 0d 04 84 41  ea 20 66 69 6c 65 5f 6f  |ult%...A. file_o|
00009710  66 66 73 65 74 25 2c 64  61 74 61 5f 73 69 7a 65  |ffset%,data_size|
00009720  25 2c 65 6e 74 72 79 5f  74 79 70 65 25 2c 63 68  |%,entry_type%,ch|
00009730  61 72 25 2c 69 64 65 6e  74 69 66 69 65 72 24 2c  |ar%,identifier$,|
00009740  62 75 66 66 25 0d 04 85  2c 6e 61 6d 65 5f 62 75  |buff%...,name_bu|
00009750  66 66 65 72 25 20 3d 20  a4 73 68 65 6c 6c 5f 48  |ffer% = .shell_H|
00009760  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 32 30  |eapBlockFetch(20|
00009770  29 0d 04 86 20 70 6f 73  25 20 3d 20 30 20 3a 20  |)... pos% = 0 : |
00009780  6e 72 5f 74 65 6d 70 6c  61 74 65 73 25 20 3d 20  |nr_templates% = |
00009790  30 0d 04 87 2b 66 69 6c  65 6c 65 6e 25 20 3d 20  |0...+filelen% = |
000097a0  a4 73 68 65 6c 6c 5f 46  69 6c 65 4c 65 6e 67 74  |.shell_FileLengt|
000097b0  68 28 66 69 6c 65 6e 61  6d 65 24 29 0d 04 88 04  |h(filename$)....|
000097c0  0d 04 89 2a f4 20 52 65  73 65 72 76 65 20 73 70  |...*. Reserve sp|
000097d0  61 63 65 20 66 6f 72 20  77 69 6e 64 6f 77 20 64  |ace for window d|
000097e0  65 66 69 6e 69 74 69 6f  6e 73 0d 04 8a 32 54 65  |efinitions...2Te|
000097f0  6d 70 6c 61 74 65 42 6c  6b 25 20 3d 20 a4 73 68  |mplateBlk% = .sh|
00009800  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
00009810  63 68 28 66 69 6c 65 6c  65 6e 25 29 0d 04 8b 1f  |ch(filelen%)....|
00009820  54 65 6d 70 6c 61 74 65  50 74 72 25 20 3d 20 54  |TemplatePtr% = T|
00009830  65 6d 70 6c 61 74 65 42  6c 6b 25 0d 04 8c 47 f2  |emplateBlk%...G.|
00009840  73 68 65 6c 6c 5f 54 65  6d 70 6c 61 74 65 46 69  |shell_TemplateFi|
00009850  6c 65 49 6e 66 6f 28 66  69 6c 65 6e 61 6d 65 24  |leInfo(filename$|
00009860  2c 62 75 66 66 5f 73 69  7a 65 25 2c 6e 72 5f 74  |,buff_size%,nr_t|
00009870  65 6d 70 6c 61 74 65 73  25 2c 72 65 73 75 6c 74  |emplates%,result|
00009880  25 29 0d 04 8d 13 e7 20  72 65 73 75 6c 74 25 20  |%)..... result% |
00009890  3d 20 30 20 8c 0d 04 8e  4d 20 20 f4 20 52 65 73  |= 0 ....M  . Res|
000098a0  65 72 76 65 20 61 20 62  6c 6f 63 6b 20 74 6f 20  |erve a block to |
000098b0  68 6f 6c 64 20 77 69 6e  64 6f 77 20 69 64 65 6e  |hold window iden|
000098c0  74 69 66 69 65 72 73 20  28 31 32 20 62 79 74 65  |tifiers (12 byte|
000098d0  73 29 20 70 6c 75 73 20  61 64 64 72 65 73 73 20  |s) plus address |
000098e0  6f 66 0d 04 8f 1e 20 20  f4 20 77 69 6e 64 6f 77  |of....  . window|
000098f0  20 62 6c 6f 63 6b 20 28  34 20 62 79 74 65 73 29  | block (4 bytes)|
00009900  0d 04 90 37 20 20 5f 55  25 21 34 20 3d 20 a4 73  |...7  _U%!4 = .s|
00009910  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 46 65  |hell_HeapBlockFe|
00009920  74 63 68 28 32 30 20 2a  20 6e 72 5f 74 65 6d 70  |tch(20 * nr_temp|
00009930  6c 61 74 65 73 25 29 0d  04 91 51 20 20 f4 20 52  |lates%)...Q  . R|
00009940  65 73 65 72 76 65 20 73  70 61 63 65 20 66 6f 72  |eserve space for|
00009950  20 69 6e 64 69 72 65 63  74 65 64 20 69 63 6f 6e  | indirected icon|
00009960  20 64 61 74 61 20 28 73  69 7a 65 20 6f 66 20 6c  | data (size of l|
00009970  61 72 67 65 73 74 20 77  69 6e 64 6f 77 20 64 65  |argest window de|
00009980  66 69 6e 69 74 69 6f 6e  0d 04 92 2a 20 20 f4 20  |finition...*  . |
00009990  70 6c 75 73 20 61 6c 6c  20 6f 66 20 74 68 65 20  |plus all of the |
000099a0  69 6e 64 69 72 65 63 74  65 64 20 64 61 74 61 29  |indirected data)|
000099b0  2e 2e 0d 04 93 37 20 20  49 6e 64 69 72 65 63 74  |.....7  Indirect|
000099c0  42 6c 6b 25 20 20 3d 20  a4 73 68 65 6c 6c 5f 48  |Blk%  = .shell_H|
000099d0  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 62 75  |eapBlockFetch(bu|
000099e0  66 66 5f 73 69 7a 65 25  29 0d 04 94 22 20 20 49  |ff_size%)..."  I|
000099f0  6e 64 69 72 65 63 74 50  74 72 25 20 20 3d 20 49  |ndirectPtr%  = I|
00009a00  6e 64 69 72 65 63 74 42  6c 6b 25 0d 04 95 2f 20  |ndirectBlk%.../ |
00009a10  20 49 6e 64 69 72 65 63  74 45 6e 64 25 20 20 3d  | IndirectEnd%  =|
00009a20  20 49 6e 64 69 72 65 63  74 42 6c 6b 25 20 2b 20  | IndirectBlk% + |
00009a30  62 75 66 66 5f 73 69 7a  65 25 0d 04 96 06 20 20  |buff_size%....  |
00009a40  0d 04 97 17 20 20 6e 72  5f 74 65 6d 70 6c 61 74  |....  nr_templat|
00009a50  65 73 25 20 3d 20 30 0d  04 98 31 20 20 c8 99 20  |es% = 0...1  .. |
00009a60  22 58 57 69 6d 70 5f 4f  70 65 6e 54 65 6d 70 6c  |"XWimp_OpenTempl|
00009a70  61 74 65 22 2c 2c 66 69  6c 65 6e 61 6d 65 24 20  |ate",,filename$ |
00009a80  b8 20 3b 66 6c 67 73 25  0d 04 99 15 20 20 e7 20  |. ;flgs%....  . |
00009a90  28 66 6c 67 73 25 20 80  20 31 29 20 8c 0d 04 9a  |(flgs% . 1) ....|
00009aa0  45 20 20 20 20 85 20 39  39 2c a4 73 68 65 6c 6c  |E    . 99,.shell|
00009ab0  5f 4d 65 73 73 61 67 65  54 77 6f 41 72 67 73 28  |_MessageTwoArgs(|
00009ac0  22 53 48 45 4c 4c 4d 53  47 33 34 22 2c 22 74 65  |"SHELLMSG34","te|
00009ad0  6d 70 6c 61 74 65 22 2c  66 69 6c 65 6e 61 6d 65  |mplate",filename|
00009ae0  24 29 0d 04 9b 07 20 20  cc 0d 04 9c 09 20 20 20  |$)....  .....   |
00009af0  20 f5 0d 04 9d 1b 20 20  20 20 20 20 24 6e 61 6d  | .....      $nam|
00009b00  65 5f 62 75 66 66 65 72  25 3d 22 2a 22 0d 04 9e  |e_buffer%="*"...|
00009b10  80 20 20 20 20 20 20 c8  99 20 22 57 69 6d 70 5f  |.      .. "Wimp_|
00009b20  4c 6f 61 64 54 65 6d 70  6c 61 74 65 22 2c 2c 54  |LoadTemplate",,T|
00009b30  65 6d 70 6c 61 74 65 50  74 72 25 2c 49 6e 64 69  |emplatePtr%,Indi|
00009b40  72 65 63 74 50 74 72 25  2c 49 6e 64 69 72 65 63  |rectPtr%,Indirec|
00009b50  74 45 6e 64 25 2c 5f 55  25 21 32 33 32 2c 6e 61  |tEnd%,_U%!232,na|
00009b60  6d 65 5f 62 75 66 66 65  72 25 2c 70 6f 73 25 20  |me_buffer%,pos% |
00009b70  b8 20 2c 2c 49 6e 64 69  72 65 63 74 50 74 72 25  |. ,,IndirectPtr%|
00009b80  2c 2c 2c 6e 61 6d 65 24  2c 70 6f 73 25 0d 04 9f  |,,,name$,pos%...|
00009b90  15 20 20 20 20 20 20 e7  20 70 6f 73 25 3c 3e 30  |.      . pos%<>0|
00009ba0  20 8c 0d 04 a0 3d 20 20  20 20 20 20 20 20 21 28  | ....=        !(|
00009bb0  28 5f 55 25 21 34 29 20  20 2b 20 28 31 36 20 2a  |(_U%!4)  + (16 *|
00009bc0  20 6e 72 5f 74 65 6d 70  6c 61 74 65 73 25 29 29  | nr_templates%))|
00009bd0  20 3d 20 54 65 6d 70 6c  61 74 65 50 74 72 25 0d  | = TemplatePtr%.|
00009be0  04 a1 3b 20 20 20 20 20  20 20 20 24 28 28 28 5f  |..;        $(((_|
00009bf0  55 25 21 34 29 20 2b 20  28 31 36 20 2a 20 6e 72  |U%!4) + (16 * nr|
00009c00  5f 74 65 6d 70 6c 61 74  65 73 25 29 29 20 2b 20  |_templates%)) + |
00009c10  34 29 20 3d 20 6e 61 6d  65 24 0d 04 a2 15 2a 7c  |4) = name$....*||
00009c20  69 66 64 65 66 20 54 72  61 63 65 49 6e 69 74 0d  |ifdef TraceInit.|
00009c30  04 a3 45 20 20 20 20 20  20 20 20 f2 73 68 65 6c  |..E        .shel|
00009c40  6c 5f 54 72 61 63 65 66  30 28 22 54 65 6d 70 6c  |l_Tracef0("Templ|
00009c50  61 74 65 73 49 6e 69 74  3a 20 20 54 65 6d 70 6c  |atesInit:  Templ|
00009c60  61 74 65 20 4c 6f 61 64  65 64 3a 20 22 2b 6e 61  |ate Loaded: "+na|
00009c70  6d 65 24 29 0d 04 a4 0b  2a 7c 65 6e 64 69 66 0d  |me$)....*|endif.|
00009c80  04 a5 3a 20 20 20 20 20  20 20 20 54 65 6d 70 6c  |..:        Templ|
00009c90  61 74 65 50 74 72 25 20  20 2b 3d 20 28 38 38 20  |atePtr%  += (88 |
00009ca0  2b 20 28 54 65 6d 70 6c  61 74 65 50 74 72 25 21  |+ (TemplatePtr%!|
00009cb0  38 34 29 20 2a 20 33 32  29 0d 04 a6 1e 20 20 20  |84) * 32)....   |
00009cc0  20 20 20 20 20 6e 72 5f  74 65 6d 70 6c 61 74 65  |     nr_template|
00009cd0  73 25 20 2b 3d 20 31 0d  04 a7 0b 20 20 20 20 20  |s% += 1....     |
00009ce0  20 cd 0d 04 a8 12 20 20  20 20 fd 20 70 6f 73 25  | .....    . pos%|
00009cf0  20 3d 20 30 0d 04 a9 1f  20 20 20 20 c8 99 20 22  | = 0....    .. "|
00009d00  57 69 6d 70 5f 43 6c 6f  73 65 54 65 6d 70 6c 61  |Wimp_CloseTempla|
00009d10  74 65 22 0d 04 aa 1d 20  20 20 20 5f 55 25 21 30  |te"....    _U%!0|
00009d20  20 3d 20 6e 72 5f 74 65  6d 70 6c 61 74 65 73 25  | = nr_templates%|
00009d30  0d 04 ab 15 2a 7c 69 66  64 65 66 20 54 72 61 63  |....*|ifdef Trac|
00009d40  65 49 6e 69 74 0d 04 ac  82 20 20 20 20 f2 73 68  |eInit....    .sh|
00009d50  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 54 65 6d  |ell_Tracef0("Tem|
00009d60  70 6c 61 74 65 73 49 6e  69 74 3a 54 65 6d 70 6c  |platesInit:Templ|
00009d70  61 74 65 73 20 72 65 73  6f 75 72 63 65 20 66 69  |ates resource fi|
00009d80  6c 65 20 6c 6f 61 64 65  64 20 61 74 20 20 20 20  |le loaded at    |
00009d90  20 20 20 26 22 2b c3 7e  54 65 6d 70 6c 61 74 65  |   &"+.~Template|
00009da0  42 6c 6b 25 2b 22 20 28  22 2b c3 6e 72 5f 74 65  |Blk%+" ("+.nr_te|
00009db0  6d 70 6c 61 74 65 73 25  2b 22 20 74 65 6d 70 6c  |mplates%+" templ|
00009dc0  61 74 65 73 29 22 29 0d  04 ad 5e 20 20 20 20 f2  |ates)")...^    .|
00009dd0  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 54  |shell_Tracef0("T|
00009de0  65 6d 70 6c 61 74 65 73  49 6e 69 74 3a 49 6e 64  |emplatesInit:Ind|
00009df0  69 72 65 63 74 65 64 20  62 75 66 66 65 72 20 73  |irected buffer s|
00009e00  69 7a 65 20 75 73 65 64  20 66 6f 72 20 6c 6f 61  |ize used for loa|
00009e10  64 69 6e 67 20 26 22 2b  c3 7e 62 75 66 66 5f 73  |ding &"+.~buff_s|
00009e20  69 7a 65 25 29 0d 04 ae  0b 2a 7c 65 6e 64 69 66  |ize%)....*|endif|
00009e30  0d 04 af 07 20 20 cd 0d  04 b0 05 cc 0d 04 b1 12  |....  ..........|
00009e40  20 20 c8 8e 20 72 65 73  75 6c 74 25 20 ca 0d 04  |  .. result% ...|
00009e50  b2 4a 20 20 20 20 c9 20  2d 31 3a 85 20 39 39 2c  |.J    . -1:. 99,|
00009e60  a4 73 68 65 6c 6c 5f 4d  65 73 73 61 67 65 54 77  |.shell_MessageTw|
00009e70  6f 41 72 67 73 28 22 53  48 45 4c 4c 4d 53 47 33  |oArgs("SHELLMSG3|
00009e80  35 22 2c 22 74 65 6d 70  6c 61 74 65 22 2c 66 69  |5","template",fi|
00009e90  6c 65 6e 61 6d 65 24 29  0d 04 b3 4a 20 20 20 20  |lename$)...J    |
00009ea0  c9 20 2d 32 3a 85 20 39  39 2c a4 73 68 65 6c 6c  |. -2:. 99,.shell|
00009eb0  5f 4d 65 73 73 61 67 65  54 77 6f 41 72 67 73 28  |_MessageTwoArgs(|
00009ec0  22 53 48 45 4c 4c 4d 53  47 33 36 22 2c 66 69 6c  |"SHELLMSG36",fil|
00009ed0  65 6e 61 6d 65 24 2c 22  74 65 6d 70 6c 61 74 65  |ename$,"template|
00009ee0  22 29 0d 04 b4 07 20 20  cb 0d 04 b5 05 cd 0d 04  |")....  ........|
00009ef0  b6 28 f2 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |.(.shell_HeapBlo|
00009f00  63 6b 52 65 74 75 72 6e  28 6e 61 6d 65 5f 62 75  |ckReturn(name_bu|
00009f10  66 66 65 72 25 29 0d 04  b7 05 e1 0d 04 b8 05 3a  |ffer%).........:|
00009f20  0d 04 b9 22 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |..."*|Stop PROCs|
00009f30  68 65 6c 6c 5f 54 65 6d  70 6c 61 74 65 73 49 6e  |hell_TemplatesIn|
00009f40  69 74 0d 04 ba 04 0d 04  bb 20 2a 7c 53 74 61 72  |it....... *|Star|
00009f50  74 20 46 4e 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |t FNshell_Window|
00009f60  4c 6f 61 64 65 64 0d 04  bc 22 dd 20 a4 73 68 65  |Loaded...". .she|
00009f70  6c 6c 5f 57 69 6e 64 6f  77 4c 6f 61 64 65 64 28  |ll_WindowLoaded(|
00009f80  77 69 6e 64 6f 77 24 29  0d 04 bd 12 ea 20 6c 6f  |window$)..... lo|
00009f90  6f 70 25 2c 66 6f 75 6e  64 25 0d 04 be 45 e7 20  |op%,found%...E. |
00009fa0  a9 28 77 69 6e 64 6f 77  24 29 3e 31 32 20 8c 20  |.(window$)>12 . |
00009fb0  85 20 39 39 2c a4 73 68  65 6c 6c 5f 4d 65 73 73  |. 99,.shell_Mess|
00009fc0  61 67 65 4f 6e 65 41 72  67 28 22 53 48 45 4c 4c  |ageOneArg("SHELL|
00009fd0  4d 53 47 30 32 22 2c 77  69 6e 64 6f 77 24 29 0d  |MSG02",window$).|
00009fe0  04 bf 0c 66 6f 75 6e 64  25 3d a3 0d 04 c0 19 e3  |...found%=......|
00009ff0  20 6c 6f 6f 70 25 3d 30  20 b8 20 28 5f 55 25 21  | loop%=0 . (_U%!|
0000a000  30 29 2d 31 0d 04 c1 2b  20 20 e7 20 24 28 28 28  |0)-1...+  . $(((|
0000a010  5f 55 25 21 34 29 2b 28  31 36 2a 6c 6f 6f 70 25  |_U%!4)+(16*loop%|
0000a020  29 29 2b 34 29 3d 77 69  6e 64 6f 77 24 20 8c 0d  |))+4)=window$ ..|
0000a030  04 c2 20 20 20 20 20 66  6f 75 6e 64 25 3d b9 3a  |..     found%=.:|
0000a040  6c 6f 6f 70 25 3d 28 5f  55 25 21 30 29 2d 31 0d  |loop%=(_U%!0)-1.|
0000a050  04 c3 07 20 20 cd 0d 04  c4 0b ed 20 6c 6f 6f 70  |...  ...... loop|
0000a060  25 0d 04 c5 0b 3d 66 6f  75 6e 64 25 0d 04 c6 05  |%....=found%....|
0000a070  3a 0d 04 c7 1f 2a 7c 53  74 6f 70 20 46 4e 73 68  |:....*|Stop FNsh|
0000a080  65 6c 6c 5f 57 69 6e 64  6f 77 4c 6f 61 64 65 64  |ell_WindowLoaded|
0000a090  0d 04 c8 19 2a 7c 53 74  61 72 74 20 46 4e 73 68  |....*|Start FNsh|
0000a0a0  65 6c 6c 5f 47 65 74 57  42 0d 04 c9 1b dd 20 a4  |ell_GetWB..... .|
0000a0b0  73 68 65 6c 6c 5f 47 65  74 57 42 28 77 69 6e 64  |shell_GetWB(wind|
0000a0c0  6f 77 24 29 0d 04 ca 12  ea 20 6c 6f 6f 70 25 2c  |ow$)..... loop%,|
0000a0d0  66 6f 75 6e 64 25 0d 04  cb 45 e7 20 a9 28 77 69  |found%...E. .(wi|
0000a0e0  6e 64 6f 77 24 29 3e 31  32 20 8c 20 85 20 39 39  |ndow$)>12 . . 99|
0000a0f0  2c a4 73 68 65 6c 6c 5f  4d 65 73 73 61 67 65 4f  |,.shell_MessageO|
0000a100  6e 65 41 72 67 28 22 53  48 45 4c 4c 4d 53 47 30  |neArg("SHELLMSG0|
0000a110  32 22 2c 77 69 6e 64 6f  77 24 29 0d 04 cc 0d 66  |2",window$)....f|
0000a120  6f 75 6e 64 25 3d 2d 31  0d 04 cd 19 e3 20 6c 6f  |ound%=-1..... lo|
0000a130  6f 70 25 3d 30 20 b8 20  28 5f 55 25 21 30 29 2d  |op%=0 . (_U%!0)-|
0000a140  31 0d 04 ce 2b 20 20 e7  20 24 28 28 28 5f 55 25  |1...+  . $(((_U%|
0000a150  21 34 29 2b 28 31 36 2a  6c 6f 6f 70 25 29 29 2b  |!4)+(16*loop%))+|
0000a160  34 29 3d 77 69 6e 64 6f  77 24 20 8c 0d 04 cf 24  |4)=window$ ....$|
0000a170  20 20 20 20 66 6f 75 6e  64 25 3d 6c 6f 6f 70 25  |    found%=loop%|
0000a180  3a 6c 6f 6f 70 25 3d 28  5f 55 25 21 30 29 2d 31  |:loop%=(_U%!0)-1|
0000a190  0d 04 d0 07 20 20 cd 0d  04 d1 0b ed 20 6c 6f 6f  |....  ...... loo|
0000a1a0  70 25 0d 04 d2 11 e7 20  66 6f 75 6e 64 25 3e 2d  |p%..... found%>-|
0000a1b0  31 20 8c 0d 04 d3 1d 20  20 3d 21 28 28 5f 55 25  |1 .....  =!((_U%|
0000a1c0  21 34 29 2b 28 31 36 2a  66 6f 75 6e 64 25 29 29  |!4)+(16*found%))|
0000a1d0  0d 04 d4 05 cc 0d 04 d5  35 20 20 85 20 39 39 2c  |........5  . 99,|
0000a1e0  a4 73 68 65 6c 6c 5f 4d  65 73 73 61 67 65 4f 6e  |.shell_MessageOn|
0000a1f0  65 41 72 67 28 22 53 48  45 4c 4c 4d 53 47 30 33  |eArg("SHELLMSG03|
0000a200  22 2c 77 69 6e 64 6f 77  24 29 0d 04 d6 05 cd 0d  |",window$)......|
0000a210  04 d7 06 3d a3 0d 04 d8  05 3a 0d 04 d9 04 0d 04  |...=.....:......|
0000a220  da 18 2a 7c 53 74 6f 70  20 46 4e 73 68 65 6c 6c  |..*|Stop FNshell|
0000a230  5f 47 65 74 57 42 0d 04  db 21 2a 7c 53 74 61 72  |_GetWB...!*|Star|
0000a240  74 20 46 4e 73 68 65 6c  6c 5f 4d 65 73 73 61 67  |t FNshell_Messag|
0000a250  65 45 78 70 61 6e 64 0d  04 dc 1e dd 20 a4 73 68  |eExpand..... .sh|
0000a260  65 6c 6c 5f 4d 65 73 73  61 67 65 45 78 70 61 6e  |ell_MessageExpan|
0000a270  64 28 68 24 29 0d 04 dd  14 ea 20 73 24 2c 20 6d  |d(h$)..... s$, m|
0000a280  24 2c 20 69 6e 64 65 78  25 0d 04 de 09 73 24 3d  |$, index%....s$=|
0000a290  22 22 0d 04 df 11 c8 95  20 a7 68 24 2c 22 5c 22  |""...... .h$,"\"|
0000a2a0  29 3e 30 0d 04 e0 15 20  20 69 6e 64 65 78 25 3d  |)>0....  index%=|
0000a2b0  a7 68 24 2c 22 5c 22 29  0d 04 e1 17 20 20 73 24  |.h$,"\")....  s$|
0000a2c0  2b 3d c0 68 24 2c 69 6e  64 65 78 25 2d 31 29 0d  |+=.h$,index%-1).|
0000a2d0  04 e2 18 20 20 6d 24 3d  c1 68 24 2c 69 6e 64 65  |...  m$=.h$,inde|
0000a2e0  78 25 2b 31 2c 31 29 0d  04 e3 16 20 20 68 24 3d  |x%+1,1)....  h$=|
0000a2f0  c1 68 24 2c 69 6e 64 65  78 25 2b 32 29 0d 04 e4  |.h$,index%+2)...|
0000a300  0d 20 20 c8 8e 20 6d 24  20 ca 0d 04 e5 23 20 20  |.  .. m$ ....#  |
0000a310  20 20 c9 20 22 41 22 3a  73 24 2b 3d 22 43 6c 69  |  . "A":s$+="Cli|
0000a320  63 6b 20 41 44 4a 55 53  54 20 74 6f 22 0d 04 e6  |ck ADJUST to"...|
0000a330  1a 20 20 20 20 c9 20 22  61 22 3a 73 24 2b 3d 22  |.    . "a":s$+="|
0000a340  41 44 4a 55 53 54 22 0d  04 e7 27 20 20 20 20 c9  |ADJUST"...'    .|
0000a350  20 22 44 22 3a 73 24 2b  3d 22 44 72 61 67 20 77  | "D":s$+="Drag w|
0000a360  69 74 68 20 53 45 4c 45  43 54 20 74 6f 22 0d 04  |ith SELECT to"..|
0000a370  e8 27 20 20 20 20 c9 20  22 64 22 3a 73 24 2b 3d  |.'    . "d":s$+=|
0000a380  22 44 72 61 67 20 77 69  74 68 20 41 44 4a 55 53  |"Drag with ADJUS|
0000a390  54 20 74 6f 22 0d 04 e9  35 20 20 20 20 c9 20 22  |T to"...5    . "|
0000a3a0  47 22 3a 73 24 2b 3d 22  54 68 69 73 20 6f 70 74  |G":s$+="This opt|
0000a3b0  69 6f 6e 20 69 73 20 67  72 65 79 65 64 20 6f 75  |ion is greyed ou|
0000a3c0  74 20 62 65 63 61 75 73  65 22 0d 04 ea 2a 20 20  |t because"...*  |
0000a3d0  20 20 c9 20 22 52 22 3a  73 24 2b 3d 22 4d 6f 76  |  . "R":s$+="Mov|
0000a3e0  65 20 74 68 65 20 70 6f  69 6e 74 65 72 20 72 69  |e the pointer ri|
0000a3f0  67 68 74 22 0d 04 eb 23  20 20 20 20 c9 20 22 53  |ght"...#    . "S|
0000a400  22 3a 73 24 2b 3d 22 43  6c 69 63 6b 20 53 45 4c  |":s$+="Click SEL|
0000a410  45 43 54 20 74 6f 22 0d  04 ec 1a 20 20 20 20 c9  |ECT to"....    .|
0000a420  20 22 73 22 3a 73 24 2b  3d 22 53 45 4c 45 43 54  | "s":s$+="SELECT|
0000a430  22 0d 04 ed 1f 20 20 20  20 c9 20 22 54 22 3a 73  |"....    . "T":s|
0000a440  24 2b 3d 22 54 68 69 73  20 69 73 20 74 68 65 22  |$+="This is the"|
0000a450  0d 04 ee 22 20 20 20 20  c9 20 22 57 22 3a 73 24  |..."    . "W":s$|
0000a460  2b 3d 22 54 68 69 73 20  77 69 6e 64 6f 77 20 69  |+="This window i|
0000a470  73 22 0d 04 ef 1a 20 20  20 20 c9 20 22 77 22 3a  |s"....    . "w":|
0000a480  73 24 2b 3d 22 77 69 6e  64 6f 77 22 0d 04 f0 07  |s$+="window"....|
0000a490  20 20 7f 0d 04 f1 12 20  20 20 20 73 24 2b 3d 22  |  .....    s$+="|
0000a4a0  5c 22 2b 6d 24 0d 04 f2  07 20 20 cb 0d 04 f3 05  |\"+m$....  .....|
0000a4b0  ce 0d 04 f4 0a 3d 73 24  2b 68 24 0d 04 f5 05 3a  |.....=s$+h$....:|
0000a4c0  0d 04 f6 40 f4 20 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |...@. ----------|
0000a4d0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0000a500  0d 04 f7 05 3a 0d 04 f8  20 2a 7c 53 74 6f 70 20  |....:... *|Stop |
0000a510  46 4e 73 68 65 6c 6c 5f  4d 65 73 73 61 67 65 45  |FNshell_MessageE|
0000a520  78 70 61 6e 64 0d 04 f9  04 0d 04 fa 1e 2a 7c 53  |xpand........*|S|
0000a530  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 4f  |tart PROCshell_O|
0000a540  70 65 6e 4d 65 6e 75 0d  04 fb 1f dd 20 f2 73 68  |penMenu..... .sh|
0000a550  65 6c 6c 5f 4f 70 65 6e  4d 65 6e 75 28 78 25 2c  |ell_OpenMenu(x%,|
0000a560  79 25 2c 6d 25 29 0d 04  fc 09 ea 20 66 6e 24 0d  |y%,m%)..... fn$.|
0000a570  04 fd 2f 66 6e 24 3d a4  73 68 65 6c 6c 5f 47 65  |../fn$=.shell_Ge|
0000a580  74 45 76 65 6e 74 48 61  6e 64 6c 65 72 28 5f 55  |tEventHandler(_U|
0000a590  25 21 32 38 2c 5f 55 25  21 33 32 2c 31 29 0d 04  |%!28,_U%!32,1)..|
0000a5a0  fe 0f e7 20 66 6e 24 3c  3e 22 22 20 8c 0d 04 ff  |... fn$<>"" ....|
0000a5b0  15 2a 7c 69 66 64 65 66  20 54 72 61 63 65 49 6e  |.*|ifdef TraceIn|
0000a5c0  69 74 0d 05 00 54 20 20  f2 73 68 65 6c 6c 5f 54  |it...T  .shell_T|
0000a5d0  72 61 63 65 66 30 28 22  4f 70 65 6e 4d 65 6e 75  |racef0("OpenMenu|
0000a5e0  3a 41 62 6f 75 74 20 74  6f 20 63 61 6c 6c 20 22  |:About to call "|
0000a5f0  2b 22 46 4e 22 2b 66 6e  24 2b 22 28 22 2b c3 5f  |+"FN"+fn$+"("+._|
0000a600  55 25 21 32 38 2b 22 2c  22 2b c3 5f 55 25 21 33  |U%!28+","+._U%!3|
0000a610  32 2b 22 29 22 29 0d 05  01 0b 2a 7c 65 6e 64 69  |2+")")....*|endi|
0000a620  66 0d 05 02 3a 20 20 76  6f 69 64 25 3d a0 28 22  |f...:  void%=.("|
0000a630  46 4e 22 2b 66 6e 24 2b  22 28 5f 55 25 21 32 38  |FN"+fn$+"(_U%!28|
0000a640  2c 5f 55 25 21 33 32 29  22 29 3a f4 20 63 61 6c  |,_U%!32)"):. cal|
0000a650  6c 20 6d 65 6e 75 6d 61  6b 65 72 0d 05 03 05 cc  |l menumaker.....|
0000a660  0d 05 04 41 20 20 f2 73  68 65 6c 6c 5f 54 72 61  |...A  .shell_Tra|
0000a670  63 65 66 30 28 22 4f 70  65 6e 4d 65 6e 75 3a 6e  |cef0("OpenMenu:n|
0000a680  6f 20 6d 65 6e 75 6d 61  6b 65 72 20 66 75 6e 63  |o menumaker func|
0000a690  74 69 6f 6e 20 72 65 67  69 73 74 65 72 65 64 22  |tion registered"|
0000a6a0  29 0d 05 05 05 cd 0d 05  06 12 e7 20 6d 25 3c 3e  |).......... m%<>|
0000a6b0  5f 55 25 21 32 34 20 8c  0d 05 07 49 20 20 f4 20  |_U%!24 ....I  . |
0000a6c0  49 66 20 6d 65 6e 75 20  69 73 20 6e 6f 74 20 62  |If menu is not b|
0000a6d0  65 69 6e 67 20 72 65 2d  6f 70 65 6e 65 64 20 62  |eing re-opened b|
0000a6e0  79 20 61 6e 20 61 64 6a  75 73 74 20 63 6c 69 63  |y an adjust clic|
0000a6f0  6b 2c 20 64 69 73 63 61  72 64 20 73 74 6f 72 65  |k, discard store|
0000a700  64 0d 05 08 3b 20 20 f4  20 27 53 65 6c 65 63 74  |d...;  . 'Select|
0000a710  69 6f 6e 53 6f 46 61 72  27 20 73 74 72 69 6e 67  |ionSoFar' string|
0000a720  20 75 73 65 64 20 62 79  20 46 6f 6e 74 4d 65 6e  | used by FontMen|
0000a730  75 20 72 6f 75 74 69 6e  65 73 2e 2e 0d 05 09 29  |u routines.....)|
0000a740  20 20 e7 20 a4 73 68 65  6c 6c 5f 48 65 61 70 42  |  . .shell_HeapB|
0000a750  6c 6f 63 6b 45 78 69 73  74 73 28 5f 55 25 21 32  |lockExists(_U%!2|
0000a760  35 36 29 20 8c 0d 05 0a  31 20 20 20 20 f2 73 68  |56) ....1    .sh|
0000a770  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 52 65 74  |ell_HeapBlockRet|
0000a780  75 72 6e 28 5f 55 25 21  32 35 36 29 3a 5f 55 25  |urn(_U%!256):_U%|
0000a790  21 32 35 36 3d 30 0d 05  0b 07 20 20 cd 0d 05 0c  |!256=0....  ....|
0000a7a0  42 20 20 f4 20 41 6e 64  20 74 68 65 20 6e 61 6d  |B  . And the nam|
0000a7b0  65 20 6f 66 20 74 68 65  20 63 75 72 72 65 6e 74  |e of the current|
0000a7c0  6c 79 20 73 65 6c 65 63  74 65 64 20 66 6f 6e 74  |ly selected font|
0000a7d0  20 69 6e 20 74 68 69 73  20 6d 65 6e 75 2e 2e 0d  | in this menu...|
0000a7e0  05 0d 2a 20 20 e7 20 a4  73 68 65 6c 6c 5f 48 65  |..*  . .shell_He|
0000a7f0  61 70 42 6c 6f 63 6b 45  78 69 73 74 73 28 5f 55  |apBlockExists(_U|
0000a800  25 21 32 34 34 20 29 20  8c 0d 05 0e 31 20 20 20  |%!244 ) ....1   |
0000a810  20 f2 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
0000a820  6b 52 65 74 75 72 6e 28  5f 55 25 21 32 34 34 29  |kReturn(_U%!244)|
0000a830  3a 5f 55 25 21 32 34 34  3d 30 0d 05 0f 07 20 20  |:_U%!244=0....  |
0000a840  cd 0d 05 10 05 cd 0d 05  11 12 e7 20 6d 25 3d 5f  |........... m%=_|
0000a850  55 25 21 32 35 32 20 8c  0d 05 12 29 20 20 c8 99  |U%!252 ....)  ..|
0000a860  20 22 57 69 6d 70 5f 43  72 65 61 74 65 4d 65 6e  | "Wimp_CreateMen|
0000a870  75 22 2c 2c 6d 25 2c 78  25 20 2d 20 36 34 2c 79  |u",,m%,x% - 64,y|
0000a880  25 0d 05 13 0f 20 20 5f  55 25 21 32 36 34 3d 31  |%....  _U%!264=1|
0000a890  0d 05 14 05 cc 0d 05 15  1b 20 20 5f 51 25 21 30  |.........  _Q%!0|
0000a8a0  20 3d 20 78 25 3a 5f 51  25 21 34 20 3d 20 79 25  | = x%:_Q%!4 = y%|
0000a8b0  0d 05 16 1f 20 20 c8 99  20 22 4d 65 6e 75 55 74  |....  .. "MenuUt|
0000a8c0  69 6c 5f 53 68 6f 77 22  2c 6d 25 2c 5f 51 25 0d  |il_Show",m%,_Q%.|
0000a8d0  05 17 0f 20 20 5f 55 25  21 32 36 34 3d 30 0d 05  |...  _U%!264=0..|
0000a8e0  18 05 cd 0d 05 19 33 5f  55 25 21 32 34 3d 6d 25  |......3_U%!24=m%|
0000a8f0  3a f4 20 73 74 6f 72 65  20 68 61 6e 64 6c 65 20  |:. store handle |
0000a900  6f 66 20 63 75 72 72 65  6e 74 6c 79 20 6f 70 65  |of currently ope|
0000a910  6e 20 6d 65 6e 75 0d 05  1a 25 5f 55 25 21 33 36  |n menu...%_U%!36|
0000a920  3d 78 25 3a f4 20 73 74  6f 72 65 20 6d 65 6e 75  |=x%:. store menu|
0000a930  20 78 20 70 6f 73 69 74  69 6f 6e 0d 05 1b 25 5f  | x position...%_|
0000a940  55 25 21 34 30 3d 79 25  3a f4 20 73 74 6f 72 65  |U%!40=y%:. store|
0000a950  20 6d 65 6e 75 20 79 20  70 6f 73 69 74 69 6f 6e  | menu y position|
0000a960  0d 05 1c 20 5f 55 25 21  35 32 3d 5f 55 25 21 32  |... _U%!52=_U%!2|
0000a970  38 3a f4 20 73 74 6f 72  65 20 77 69 6e 64 6f 77  |8:. store window|
0000a980  0d 05 1d 1e 5f 55 25 21  35 36 3d 5f 55 25 21 33  |...._U%!56=_U%!3|
0000a990  32 3a f4 20 73 74 6f 72  65 20 69 63 6f 6e 0d 05  |2:. store icon..|
0000a9a0  1e 05 e1 0d 05 1f 05 3a  0d 05 20 1d 2a 7c 53 74  |.......:.. .*|St|
0000a9b0  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 4f 70 65  |op PROCshell_Ope|
0000a9c0  6e 4d 65 6e 75 0d 05 21  04 0d 05 22 20 2a 7c 53  |nMenu..!..." *|S|
0000a9d0  74 61 72 74 20 46 4e 73  68 65 6c 6c 5f 4d 65 6e  |tart FNshell_Men|
0000a9e0  75 4c 61 73 74 58 50 6f  73 0d 05 23 19 dd 20 a4  |uLastXPos..#.. .|
0000a9f0  73 68 65 6c 6c 5f 4d 65  6e 75 4c 61 73 74 58 50  |shell_MenuLastXP|
0000aa00  6f 73 0d 05 24 0b 3d 5f  55 25 21 33 36 0d 05 25  |os..$.=_U%!36..%|
0000aa10  05 3a 0d 05 26 1f 2a 7c  53 74 6f 70 20 46 4e 73  |.:..&.*|Stop FNs|
0000aa20  68 65 6c 6c 5f 4d 65 6e  75 4c 61 73 74 58 50 6f  |hell_MenuLastXPo|
0000aa30  73 0d 05 27 04 0d 05 28  20 2a 7c 53 74 61 72 74  |s..'...( *|Start|
0000aa40  20 46 4e 73 68 65 6c 6c  5f 4d 65 6e 75 4c 61 73  | FNshell_MenuLas|
0000aa50  74 59 50 6f 73 0d 05 29  19 dd 20 a4 73 68 65 6c  |tYPos..).. .shel|
0000aa60  6c 5f 4d 65 6e 75 4c 61  73 74 59 50 6f 73 0d 05  |l_MenuLastYPos..|
0000aa70  2a 0b 3d 5f 55 25 21 34  30 0d 05 2b 05 3a 0d 05  |*.=_U%!40..+.:..|
0000aa80  2c 1f 2a 7c 53 74 6f 70  20 46 4e 73 68 65 6c 6c  |,.*|Stop FNshell|
0000aa90  5f 4d 65 6e 75 4c 61 73  74 59 50 6f 73 0d 05 2d  |_MenuLastYPos..-|
0000aaa0  04 0d 05 2e 24 2a 7c 53  74 61 72 74 20 50 52 4f  |....$*|Start PRO|
0000aab0  43 73 68 65 6c 6c 5f 4d  65 6e 75 41 74 74 61 63  |Cshell_MenuAttac|
0000aac0  68 44 62 6f 78 0d 05 2f  22 dd 20 f2 73 68 65 6c  |hDbox../". .shel|
0000aad0  6c 5f 4d 65 6e 75 41 74  74 61 63 68 44 62 6f 78  |l_MenuAttachDbox|
0000aae0  28 6d 65 6e 75 24 29 0d  05 30 4d f4 20 61 74 74  |(menu$)..0M. att|
0000aaf0  61 63 68 20 61 20 64 75  6d 6d 79 20 77 69 6e 64  |ach a dummy wind|
0000ab00  6f 77 20 68 61 6e 64 6c  65 20 66 6f 72 20 6e 6f  |ow handle for no|
0000ab10  77 2c 20 6a 75 73 74 20  73 6f 20 74 68 61 74 20  |w, just so that |
0000ab20  74 68 65 20 73 75 62 20  77 69 6e 64 6f 77 20 61  |the sub window a|
0000ab30  72 72 6f 77 0d 05 31 1a  f4 20 61 70 70 65 61 72  |rrow..1.. appear|
0000ab40  73 20 6f 6e 20 74 68 65  20 6d 65 6e 75 21 0d 05  |s on the menu!..|
0000ab50  32 3b c8 99 20 22 4d 65  6e 75 5f 53 65 74 53 75  |2;.. "Menu_SetSu|
0000ab60  62 48 61 6e 64 6c 65 22  2c 5f 55 25 21 38 2c a4  |bHandle",_U%!8,.|
0000ab70  73 68 65 6c 6c 5f 4d 65  6e 75 53 74 72 69 6e 67  |shell_MenuString|
0000ab80  28 6d 65 6e 75 24 29 2c  31 0d 05 33 44 f2 73 68  |(menu$),1..3D.sh|
0000ab90  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 4d 65 6e  |ell_Tracef0("Men|
0000aba0  75 41 74 74 61 63 68 44  62 6f 78 3a 44 69 61 6c  |uAttachDbox:Dial|
0000abb0  6f 67 20 62 6f 78 20 28  22 2b 6d 65 6e 75 24 2b  |og box ("+menu$+|
0000abc0  22 29 20 61 74 74 61 63  68 65 64 22 29 0d 05 34  |") attached")..4|
0000abd0  05 e1 0d 05 35 05 3a 0d  05 36 23 2a 7c 53 74 6f  |....5.:..6#*|Sto|
0000abe0  70 20 50 52 4f 43 73 68  65 6c 6c 5f 4d 65 6e 75  |p PROCshell_Menu|
0000abf0  41 74 74 61 63 68 44 62  6f 78 0d 05 37 04 0d 05  |AttachDbox..7...|
0000ac00  38 21 2a 7c 53 74 61 72  74 20 46 4e 73 68 65 6c  |8!*|Start FNshel|
0000ac10  6c 5f 4d 65 73 73 61 67  65 57 69 6e 64 6f 77 0d  |l_MessageWindow.|
0000ac20  05 39 39 dd 20 a4 73 68  65 6c 6c 5f 4d 65 73 73  |.99. .shell_Mess|
0000ac30  61 67 65 57 69 6e 64 6f  77 28 74 65 78 74 24 2c  |ageWindow(text$,|
0000ac40  63 61 6e 63 65 6c 25 2c  70 72 6f 67 6e 61 6d 65  |cancel%,progname|
0000ac50  24 2c 68 65 61 64 24 29  0d 05 3a 14 ea 20 6b 65  |$,head$)..:.. ke|
0000ac60  79 73 25 2c 65 72 72 5f  62 6c 6b 25 0d 05 3b 27  |ys%,err_blk%..;'|
0000ac70  65 72 72 5f 62 6c 6b 25  3d a4 73 68 65 6c 6c 5f  |err_blk%=.shell_|
0000ac80  48 65 61 70 42 6c 6f 63  6b 46 65 74 63 68 28 32  |HeapBlockFetch(2|
0000ac90  36 30 29 0d 05 3c 28 21  65 72 72 5f 62 6c 6b 25  |60)..<(!err_blk%|
0000aca0  3d 30 3a 24 28 65 72 72  5f 62 6c 6b 25 2b 34 29  |=0:$(err_blk%+4)|
0000acb0  3d 74 65 78 74 24 2b bd  28 30 29 0d 05 3d 30 e7  |=text$+.(0)..=0.|
0000acc0  20 68 65 61 64 24 3d 22  22 20 8c 20 68 65 61 64  | head$="" . head|
0000acd0  24 3d 22 4d 65 73 73 61  67 65 20 66 72 6f 6d 20  |$="Message from |
0000ace0  22 2b 70 72 6f 67 6e 61  6d 65 24 0d 05 3e 0f e7  |"+progname$..>..|
0000acf0  20 63 61 6e 63 65 6c 25  20 8c 0d 05 3f 35 20 c8  | cancel% ...?5 .|
0000ad00  99 20 22 57 69 6d 70 5f  52 65 70 6f 72 74 45 72  |. "Wimp_ReportEr|
0000ad10  72 6f 72 22 2c 65 72 72  5f 62 6c 6b 25 2c 31 39  |ror",err_blk%,19|
0000ad20  2c 68 65 61 64 24 20 b8  20 2c 6b 65 79 73 25 0d  |,head$ . ,keys%.|
0000ad30  05 40 05 cc 0d 05 41 35  20 c8 99 20 22 57 69 6d  |.@....A5 .. "Wim|
0000ad40  70 5f 52 65 70 6f 72 74  45 72 72 6f 72 22 2c 65  |p_ReportError",e|
0000ad50  72 72 5f 62 6c 6b 25 2c  31 37 2c 68 65 61 64 24  |rr_blk%,17,head$|
0000ad60  20 b8 20 2c 6b 65 79 73  25 0d 05 42 05 cd 0d 05  | . ,keys%..B....|
0000ad70  43 24 f2 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |C$.shell_HeapBlo|
0000ad80  63 6b 52 65 74 75 72 6e  28 65 72 72 5f 62 6c 6b  |ckReturn(err_blk|
0000ad90  25 29 0d 05 44 0a 3d 6b  65 79 73 25 0d 05 45 05  |%)..D.=keys%..E.|
0000ada0  3a 0d 05 46 20 2a 7c 53  74 6f 70 20 46 4e 73 68  |:..F *|Stop FNsh|
0000adb0  65 6c 6c 5f 4d 65 73 73  61 67 65 57 69 6e 64 6f  |ell_MessageWindo|
0000adc0  77 0d 05 47 04 0d 05 48  22 2a 7c 53 74 61 72 74  |w..G...H"*|Start|
0000add0  20 50 52 4f 43 73 68 65  6c 6c 5f 43 72 65 61 74  | PROCshell_Creat|
0000ade0  65 57 69 6e 64 6f 77 0d  05 49 2b dd 20 f2 73 68  |eWindow..I+. .sh|
0000adf0  65 6c 6c 5f 43 72 65 61  74 65 57 69 6e 64 6f 77  |ell_CreateWindow|
0000ae00  28 69 64 65 6e 74 24 2c  f8 20 68 61 6e 64 6c 65  |(ident$,. handle|
0000ae10  25 29 0d 05 4a 0d ea 20  77 62 5f 70 74 72 25 0d  |%)..J.. wb_ptr%.|
0000ae20  05 4b 20 77 62 5f 70 74  72 25 3d a4 73 68 65 6c  |.K wb_ptr%=.shel|
0000ae30  6c 5f 47 65 74 57 42 28  69 64 65 6e 74 24 29 0d  |l_GetWB(ident$).|
0000ae40  05 4c 33 f4 20 73 65 74  20 27 73 70 72 69 74 65  |.L3. set 'sprite|
0000ae50  20 61 72 65 61 27 20 70  6f 69 6e 74 65 72 20 74  | area' pointer t|
0000ae60  6f 20 75 73 65 72 73 70  72 69 74 65 73 20 61 72  |o usersprites ar|
0000ae70  65 61 0d 05 4d 15 77 62  5f 70 74 72 25 21 36 34  |ea..M.wb_ptr%!64|
0000ae80  3d 5f 55 25 21 31 36 0d  05 4e 2d c8 99 20 22 57  |=_U%!16..N-.. "W|
0000ae90  69 6d 70 5f 43 72 65 61  74 65 57 69 6e 64 6f 77  |imp_CreateWindow|
0000aea0  22 2c 2c 77 62 5f 70 74  72 25 20 b8 20 68 61 6e  |",,wb_ptr% . han|
0000aeb0  64 6c 65 25 0d 05 4f 05  e1 0d 05 50 05 3a 0d 05  |dle%..O....P.:..|
0000aec0  51 21 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |Q!*|Stop PROCshe|
0000aed0  6c 6c 5f 43 72 65 61 74  65 57 69 6e 64 6f 77 0d  |ll_CreateWindow.|
0000aee0  05 52 21 2a 7c 53 74 61  72 74 20 46 4e 73 68 65  |.R!*|Start FNshe|
0000aef0  6c 6c 5f 43 72 65 61 74  65 57 69 6e 64 6f 77 32  |ll_CreateWindow2|
0000af00  0d 05 53 4e dd 20 a4 73  68 65 6c 6c 5f 43 72 65  |..SN. .shell_Cre|
0000af10  61 74 65 57 69 6e 64 6f  77 32 28 74 69 74 6c 65  |ateWindow2(title|
0000af20  2c 66 6c 61 67 73 25 2c  66 67 63 6f 6c 25 2c 62  |,flags%,fgcol%,b|
0000af30  67 63 6f 6c 25 2c 6d 61  78 78 25 2c 6d 69 6e 79  |gcol%,maxx%,miny|
0000af40  25 2c 6c 25 2c 62 25 2c  72 25 2c 74 25 29 0d 05  |%,l%,b%,r%,t%)..|
0000af50  54 08 ea 20 51 25 0d 05  55 22 51 25 3d a4 73 68  |T.. Q%..U"Q%=.sh|
0000af60  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
0000af70  63 68 28 33 30 30 30 29  0d 05 56 2c 51 25 21 30  |ch(3000)..V,Q%!0|
0000af80  3d 6c 25 3a 51 25 21 34  3d 62 25 3a 51 25 21 38  |=l%:Q%!4=b%:Q%!8|
0000af90  3d 72 25 3a 51 25 21 31  32 3d 74 25 3a 51 25 21  |=r%:Q%!12=t%:Q%!|
0000afa0  31 36 3d 30 0d 05 57 29  51 25 21 32 30 3d 30 3a  |16=0..W)Q%!20=0:|
0000afb0  51 25 21 32 34 3d 2d 31  3a 51 25 21 32 38 3d 66  |Q%!24=-1:Q%!28=f|
0000afc0  6c 61 67 73 25 3a 51 25  3f 33 32 3d 37 0d 05 58  |lags%:Q%?32=7..X|
0000afd0  25 51 25 3f 33 33 3d 32  3a 51 25 3f 33 34 3d 66  |%Q%?33=2:Q%?34=f|
0000afe0  67 63 6f 6c 25 3a 51 25  3f 33 35 3d 62 67 63 6f  |gcol%:Q%?35=bgco|
0000aff0  6c 25 0d 05 59 13 51 25  3f 33 36 3d 33 3a 51 25  |l%..Y.Q%?36=3:Q%|
0000b000  3f 33 37 3d 31 0d 05 5a  27 51 25 3f 33 38 3d 32  |?37=1..Z'Q%?38=2|
0000b010  3a 51 25 3f 33 39 3d 30  3a 51 25 21 34 30 3d 30  |:Q%?39=0:Q%!40=0|
0000b020  3a 51 25 21 34 34 3d 6d  69 6e 79 25 0d 05 5b 2e  |:Q%!44=miny%..[.|
0000b030  51 25 21 34 38 3d 6d 61  78 78 25 3a 51 25 21 35  |Q%!48=maxx%:Q%!5|
0000b040  32 3d 30 3a 51 25 21 35  36 3d 26 31 33 44 3a 51  |2=0:Q%!56=&13D:Q|
0000b050  25 21 36 30 3d 26 33 30  30 30 0d 05 5c 36 51 25  |%!60=&3000..\6Q%|
0000b060  21 36 38 3d 31 3a 51 25  21 37 32 3d 74 69 74 6c  |!68=1:Q%!72=titl|
0000b070  65 3a 51 25 21 37 36 3d  2d 31 3a 51 25 21 38 30  |e:Q%!76=-1:Q%!80|
0000b080  3d a9 24 74 69 74 6c 65  3a 51 25 21 38 34 3d 30  |=.$title:Q%!84=0|
0000b090  0d 05 5d 28 c8 99 20 22  57 69 6d 70 5f 43 72 65  |..](.. "Wimp_Cre|
0000b0a0  61 74 65 57 69 6e 64 6f  77 22 2c 2c 51 25 20 b8  |ateWindow",,Q% .|
0000b0b0  20 68 61 6e 64 6c 65 25  0d 05 5e 1e f2 73 68 65  | handle%..^..she|
0000b0c0  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 52 65 74 75  |ll_HeapBlockRetu|
0000b0d0  72 6e 28 51 25 29 0d 05  5f 0c 3d 68 61 6e 64 6c  |rn(Q%).._.=handl|
0000b0e0  65 25 0d 05 60 05 3a 0d  05 61 20 2a 7c 53 74 6f  |e%..`.:..a *|Sto|
0000b0f0  70 20 46 4e 73 68 65 6c  6c 5f 43 72 65 61 74 65  |p FNshell_Create|
0000b100  57 69 6e 64 6f 77 32 0d  05 62 04 0d 05 63 25 2a  |Window2..b...c%*|
0000b110  7c 53 74 61 72 74 20 46  4e 73 68 65 6c 6c 5f 57  ||Start FNshell_W|
0000b120  69 6e 64 6f 77 48 61 73  54 69 74 6c 65 42 61 72  |indowHasTitleBar|
0000b130  0d 05 64 23 dd 20 a4 73  68 65 6c 6c 5f 57 69 6e  |..d#. .shell_Win|
0000b140  64 6f 77 48 61 73 54 69  74 6c 65 42 61 72 28 77  |dowHasTitleBar(w|
0000b150  68 25 29 0d 05 65 29 3d  28 a4 73 68 65 6c 6c 5f  |h%)..e)=(.shell_|
0000b160  57 69 6e 64 6f 77 47 65  74 46 6c 61 67 73 28 77  |WindowGetFlags(w|
0000b170  68 25 29 20 80 20 31 3c  3c 32 36 29 0d 05 66 05  |h%) . 1<<26)..f.|
0000b180  3a 0d 05 67 24 2a 7c 53  74 6f 70 20 46 4e 73 68  |:..g$*|Stop FNsh|
0000b190  65 6c 6c 5f 57 69 6e 64  6f 77 48 61 73 54 69 74  |ell_WindowHasTit|
0000b1a0  6c 65 42 61 72 0d 05 68  04 0d 05 69 24 2a 7c 53  |leBar..h...i$*|S|
0000b1b0  74 61 72 74 20 46 4e 73  68 65 6c 6c 5f 57 69 6e  |tart FNshell_Win|
0000b1c0  64 6f 77 49 73 4d 6f 76  65 61 62 6c 65 0d 05 6a  |dowIsMoveable..j|
0000b1d0  04 0d 05 6b 22 dd 20 a4  73 68 65 6c 6c 5f 57 69  |...k". .shell_Wi|
0000b1e0  6e 64 6f 77 49 73 4d 6f  76 65 61 62 6c 65 28 77  |ndowIsMoveable(w|
0000b1f0  68 25 29 0d 05 6c 28 3d  28 a4 73 68 65 6c 6c 5f  |h%)..l(=(.shell_|
0000b200  57 69 6e 64 6f 77 47 65  74 46 6c 61 67 73 28 77  |WindowGetFlags(w|
0000b210  68 25 29 20 80 20 31 3c  3c 31 29 0d 05 6d 05 3a  |h%) . 1<<1)..m.:|
0000b220  0d 05 6e 23 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |..n#*|Stop FNshe|
0000b230  6c 6c 5f 57 69 6e 64 6f  77 49 73 4d 6f 76 65 61  |ll_WindowIsMovea|
0000b240  62 6c 65 0d 05 6f 04 0d  05 70 21 2a 7c 53 74 61  |ble..o...p!*|Sta|
0000b250  72 74 20 46 4e 73 68 65  6c 6c 5f 57 69 6e 64 6f  |rt FNshell_Windo|
0000b260  77 49 73 41 50 61 6e 65  0d 05 71 1f dd 20 a4 73  |wIsAPane..q.. .s|
0000b270  68 65 6c 6c 5f 57 69 6e  64 6f 77 49 73 41 50 61  |hell_WindowIsAPa|
0000b280  6e 65 28 77 68 25 29 0d  05 72 28 3d 28 a4 73 68  |ne(wh%)..r(=(.sh|
0000b290  65 6c 6c 5f 57 69 6e 64  6f 77 47 65 74 46 6c 61  |ell_WindowGetFla|
0000b2a0  67 73 28 77 68 25 29 20  80 20 31 3c 3c 35 29 0d  |gs(wh%) . 1<<5).|
0000b2b0  05 73 05 3a 0d 05 74 20  2a 7c 53 74 6f 70 20 46  |.s.:..t *|Stop F|
0000b2c0  4e 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 49 73 41  |Nshell_WindowIsA|
0000b2d0  50 61 6e 65 0d 05 75 04  0d 05 76 26 2a 7c 53 74  |Pane..u...v&*|St|
0000b2e0  61 72 74 20 46 4e 73 68  65 6c 6c 5f 57 69 6e 64  |art FNshell_Wind|
0000b2f0  6f 77 49 73 4e 6f 74 42  6f 75 6e 64 65 64 0d 05  |owIsNotBounded..|
0000b300  77 24 dd 20 a4 73 68 65  6c 6c 5f 57 69 6e 64 6f  |w$. .shell_Windo|
0000b310  77 49 73 4e 6f 74 42 6f  75 6e 64 65 64 28 77 68  |wIsNotBounded(wh|
0000b320  25 29 0d 05 78 28 3d 28  a4 73 68 65 6c 6c 5f 57  |%)..x(=(.shell_W|
0000b330  69 6e 64 6f 77 47 65 74  46 6c 61 67 73 28 77 68  |indowGetFlags(wh|
0000b340  25 29 20 80 20 31 3c 3c  36 29 0d 05 79 05 3a 0d  |%) . 1<<6)..y.:.|
0000b350  05 7a 25 2a 7c 53 74 6f  70 20 46 4e 73 68 65 6c  |.z%*|Stop FNshel|
0000b360  6c 5f 57 69 6e 64 6f 77  49 73 4e 6f 74 42 6f 75  |l_WindowIsNotBou|
0000b370  6e 64 65 64 0d 05 7b 04  0d 05 7c 26 2a 7c 53 74  |nded..{...|&*|St|
0000b380  61 72 74 20 46 4e 73 68  65 6c 6c 5f 57 69 6e 64  |art FNshell_Wind|
0000b390  6f 77 54 72 61 70 73 48  6f 74 4b 65 79 73 0d 05  |owTrapsHotKeys..|
0000b3a0  7d 24 dd 20 a4 73 68 65  6c 6c 5f 57 69 6e 64 6f  |}$. .shell_Windo|
0000b3b0  77 54 72 61 70 73 48 6f  74 4b 65 79 73 28 77 68  |wTrapsHotKeys(wh|
0000b3c0  25 29 0d 05 7e 29 3d 28  a4 73 68 65 6c 6c 5f 57  |%)..~)=(.shell_W|
0000b3d0  69 6e 64 6f 77 47 65 74  46 6c 61 67 73 28 77 68  |indowGetFlags(wh|
0000b3e0  25 29 20 80 20 31 3c 3c  31 32 29 0d 05 7f 05 3a  |%) . 1<<12)....:|
0000b3f0  0d 05 80 25 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |...%*|Stop FNshe|
0000b400  6c 6c 5f 57 69 6e 64 6f  77 54 72 61 70 73 48 6f  |ll_WindowTrapsHo|
0000b410  74 4b 65 79 73 0d 05 81  04 0d 05 82 20 2a 7c 53  |tKeys....... *|S|
0000b420  74 61 72 74 20 46 4e 73  68 65 6c 6c 5f 57 69 6e  |tart FNshell_Win|
0000b430  64 6f 77 49 73 4f 70 65  6e 0d 05 83 1e dd 20 a4  |dowIsOpen..... .|
0000b440  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 49 73 4f 70  |shell_WindowIsOp|
0000b450  65 6e 28 77 68 25 29 0d  05 84 29 3d 28 a4 73 68  |en(wh%)...)=(.sh|
0000b460  65 6c 6c 5f 57 69 6e 64  6f 77 47 65 74 46 6c 61  |ell_WindowGetFla|
0000b470  67 73 28 77 68 25 29 20  80 20 31 3c 3c 31 36 29  |gs(wh%) . 1<<16)|
0000b480  0d 05 85 05 3a 0d 05 86  1f 2a 7c 53 74 6f 70 20  |....:....*|Stop |
0000b490  46 4e 73 68 65 6c 6c 5f  57 69 6e 64 6f 77 49 73  |FNshell_WindowIs|
0000b4a0  4f 70 65 6e 0d 05 87 04  0d 05 88 21 2a 7c 53 74  |Open.......!*|St|
0000b4b0  61 72 74 20 46 4e 73 68  65 6c 6c 5f 57 69 6e 64  |art FNshell_Wind|
0000b4c0  6f 77 49 73 4f 6e 54 6f  70 0d 05 89 1f dd 20 a4  |owIsOnTop..... .|
0000b4d0  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 49 73 4f 6e  |shell_WindowIsOn|
0000b4e0  54 6f 70 28 77 68 25 29  0d 05 8a 29 3d 28 a4 73  |Top(wh%)...)=(.s|
0000b4f0  68 65 6c 6c 5f 57 69 6e  64 6f 77 47 65 74 46 6c  |hell_WindowGetFl|
0000b500  61 67 73 28 77 68 25 29  20 80 20 31 3c 3c 31 37  |ags(wh%) . 1<<17|
0000b510  29 0d 05 8b 05 3a 0d 05  8c 20 2a 7c 53 74 6f 70  |)....:... *|Stop|
0000b520  20 46 4e 73 68 65 6c 6c  5f 57 69 6e 64 6f 77 49  | FNshell_WindowI|
0000b530  73 4f 6e 54 6f 70 0d 05  8d 04 0d 05 8e 28 2a 7c  |sOnTop.......(*||
0000b540  53 74 61 72 74 20 46 4e  73 68 65 6c 6c 5f 57 69  |Start FNshell_Wi|
0000b550  6e 64 6f 77 48 61 73 42  65 65 6e 54 6f 67 67 6c  |ndowHasBeenToggl|
0000b560  65 64 0d 05 8f 26 dd 20  a4 73 68 65 6c 6c 5f 57  |ed...&. .shell_W|
0000b570  69 6e 64 6f 77 48 61 73  42 65 65 6e 54 6f 67 67  |indowHasBeenTogg|
0000b580  6c 65 64 28 77 68 25 29  0d 05 90 29 3d 28 a4 73  |led(wh%)...)=(.s|
0000b590  68 65 6c 6c 5f 57 69 6e  64 6f 77 47 65 74 46 6c  |hell_WindowGetFl|
0000b5a0  61 67 73 28 77 68 25 29  20 80 20 31 3c 3c 31 38  |ags(wh%) . 1<<18|
0000b5b0  29 0d 05 91 05 3a 0d 05  92 27 2a 7c 53 74 6f 70  |)....:...'*|Stop|
0000b5c0  20 46 4e 73 68 65 6c 6c  5f 57 69 6e 64 6f 77 48  | FNshell_WindowH|
0000b5d0  61 73 42 65 65 6e 54 6f  67 67 6c 65 64 0d 05 93  |asBeenToggled...|
0000b5e0  04 0d 05 94 27 2a 7c 53  74 61 72 74 20 46 4e 73  |....'*|Start FNs|
0000b5f0  68 65 6c 6c 5f 57 69 6e  64 6f 77 48 61 73 49 6e  |hell_WindowHasIn|
0000b600  70 75 74 46 6f 63 75 73  0d 05 95 25 dd 20 a4 73  |putFocus...%. .s|
0000b610  68 65 6c 6c 5f 57 69 6e  64 6f 77 48 61 73 49 6e  |hell_WindowHasIn|
0000b620  70 75 74 46 6f 63 75 73  28 77 68 25 29 0d 05 96  |putFocus(wh%)...|
0000b630  29 3d 28 a4 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |)=(.shell_Window|
0000b640  47 65 74 46 6c 61 67 73  28 77 68 25 29 20 80 20  |GetFlags(wh%) . |
0000b650  31 3c 3c 32 30 29 0d 05  97 05 3a 0d 05 98 26 2a  |1<<20)....:...&*|
0000b660  7c 53 74 6f 70 20 46 4e  73 68 65 6c 6c 5f 57 69  ||Stop FNshell_Wi|
0000b670  6e 64 6f 77 48 61 73 49  6e 70 75 74 46 6f 63 75  |ndowHasInputFocu|
0000b680  73 0d 05 99 04 0d 05 9a  25 2a 7c 53 74 61 72 74  |s.......%*|Start|
0000b690  20 46 4e 73 68 65 6c 6c  5f 57 69 6e 64 6f 77 48  | FNshell_WindowH|
0000b6a0  61 73 42 61 63 6b 49 63  6f 6e 0d 05 9b 23 dd 20  |asBackIcon...#. |
0000b6b0  a4 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 48 61 73  |.shell_WindowHas|
0000b6c0  42 61 63 6b 49 63 6f 6e  28 77 68 25 29 0d 05 9c  |BackIcon(wh%)...|
0000b6d0  29 3d 28 a4 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |)=(.shell_Window|
0000b6e0  47 65 74 46 6c 61 67 73  28 77 68 25 29 20 80 20  |GetFlags(wh%) . |
0000b6f0  31 3c 3c 32 34 29 0d 05  9d 05 3a 0d 05 9e 24 2a  |1<<24)....:...$*|
0000b700  7c 53 74 6f 70 20 46 4e  73 68 65 6c 6c 5f 57 69  ||Stop FNshell_Wi|
0000b710  6e 64 6f 77 48 61 73 42  61 63 6b 49 63 6f 6e 0d  |ndowHasBackIcon.|
0000b720  05 9f 04 0d 05 a0 26 2a  7c 53 74 61 72 74 20 46  |......&*|Start F|
0000b730  4e 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 48 61 73  |Nshell_WindowHas|
0000b740  43 6c 6f 73 65 49 63 6f  6e 0d 05 a1 24 dd 20 a4  |CloseIcon...$. .|
0000b750  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 48 61 73 43  |shell_WindowHasC|
0000b760  6c 6f 73 65 49 63 6f 6e  28 77 68 25 29 0d 05 a2  |loseIcon(wh%)...|
0000b770  29 3d 28 a4 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |)=(.shell_Window|
0000b780  47 65 74 46 6c 61 67 73  28 77 68 25 29 20 80 20  |GetFlags(wh%) . |
0000b790  31 3c 3c 32 35 29 0d 05  a3 05 3a 0d 05 a4 25 2a  |1<<25)....:...%*|
0000b7a0  7c 53 74 6f 70 20 46 4e  73 68 65 6c 6c 5f 57 69  ||Stop FNshell_Wi|
0000b7b0  6e 64 6f 77 48 61 73 43  6c 6f 73 65 49 63 6f 6e  |ndowHasCloseIcon|
0000b7c0  0d 05 a5 04 0d 05 a6 27  2a 7c 53 74 61 72 74 20  |.......'*|Start |
0000b7d0  46 4e 73 68 65 6c 6c 5f  57 69 6e 64 6f 77 48 61  |FNshell_WindowHa|
0000b7e0  73 54 6f 67 67 6c 65 49  63 6f 6e 0d 05 a7 25 dd  |sToggleIcon...%.|
0000b7f0  20 a4 73 68 65 6c 6c 5f  57 69 6e 64 6f 77 48 61  | .shell_WindowHa|
0000b800  73 54 6f 67 67 6c 65 49  63 6f 6e 28 77 68 25 29  |sToggleIcon(wh%)|
0000b810  0d 05 a8 29 3d 28 a4 73  68 65 6c 6c 5f 57 69 6e  |...)=(.shell_Win|
0000b820  64 6f 77 47 65 74 46 6c  61 67 73 28 77 68 25 29  |dowGetFlags(wh%)|
0000b830  20 80 20 31 3c 3c 32 37  29 0d 05 a9 05 3a 0d 05  | . 1<<27)....:..|
0000b840  aa 26 2a 7c 53 74 6f 70  20 46 4e 73 68 65 6c 6c  |.&*|Stop FNshell|
0000b850  5f 57 69 6e 64 6f 77 48  61 73 54 6f 67 67 6c 65  |_WindowHasToggle|
0000b860  49 63 6f 6e 0d 05 ab 04  0d 05 ac 27 2a 7c 53 74  |Icon.......'*|St|
0000b870  61 72 74 20 46 4e 73 68  65 6c 6c 5f 57 69 6e 64  |art FNshell_Wind|
0000b880  6f 77 48 61 73 56 53 63  72 6f 6c 6c 42 61 72 0d  |owHasVScrollBar.|
0000b890  05 ad 25 dd 20 a4 73 68  65 6c 6c 5f 57 69 6e 64  |..%. .shell_Wind|
0000b8a0  6f 77 48 61 73 56 53 63  72 6f 6c 6c 42 61 72 28  |owHasVScrollBar(|
0000b8b0  77 68 25 29 0d 05 ae 29  3d 28 a4 73 68 65 6c 6c  |wh%)...)=(.shell|
0000b8c0  5f 57 69 6e 64 6f 77 47  65 74 46 6c 61 67 73 28  |_WindowGetFlags(|
0000b8d0  77 68 25 29 20 80 20 31  3c 3c 32 38 29 0d 05 af  |wh%) . 1<<28)...|
0000b8e0  05 3a 0d 05 b0 26 2a 7c  53 74 6f 70 20 46 4e 73  |.:...&*|Stop FNs|
0000b8f0  68 65 6c 6c 5f 57 69 6e  64 6f 77 48 61 73 56 53  |hell_WindowHasVS|
0000b900  63 72 6f 6c 6c 42 61 72  0d 05 b1 04 0d 05 b2 2b  |crollBar.......+|
0000b910  2a 7c 53 74 61 72 74 20  46 4e 73 68 65 6c 6c 5f  |*|Start FNshell_|
0000b920  57 69 6e 64 6f 77 48 61  73 41 64 6a 75 73 74 53  |WindowHasAdjustS|
0000b930  69 7a 65 49 63 6f 6e 0d  05 b3 29 dd 20 a4 73 68  |izeIcon...). .sh|
0000b940  65 6c 6c 5f 57 69 6e 64  6f 77 48 61 73 41 64 6a  |ell_WindowHasAdj|
0000b950  75 73 74 53 69 7a 65 49  63 6f 6e 28 77 68 25 29  |ustSizeIcon(wh%)|
0000b960  0d 05 b4 29 3d 28 a4 73  68 65 6c 6c 5f 57 69 6e  |...)=(.shell_Win|
0000b970  64 6f 77 47 65 74 46 6c  61 67 73 28 77 68 25 29  |dowGetFlags(wh%)|
0000b980  20 80 20 31 3c 3c 32 39  29 0d 05 b5 05 3a 0d 05  | . 1<<29)....:..|
0000b990  b6 2a 2a 7c 53 74 6f 70  20 46 4e 73 68 65 6c 6c  |.**|Stop FNshell|
0000b9a0  5f 57 69 6e 64 6f 77 48  61 73 41 64 6a 75 73 74  |_WindowHasAdjust|
0000b9b0  53 69 7a 65 49 63 6f 6e  0d 05 b7 04 0d 05 b8 27  |SizeIcon.......'|
0000b9c0  2a 7c 53 74 61 72 74 20  46 4e 73 68 65 6c 6c 5f  |*|Start FNshell_|
0000b9d0  57 69 6e 64 6f 77 48 61  73 48 53 63 72 6f 6c 6c  |WindowHasHScroll|
0000b9e0  42 61 72 0d 05 b9 25 dd  20 a4 73 68 65 6c 6c 5f  |Bar...%. .shell_|
0000b9f0  57 69 6e 64 6f 77 48 61  73 48 53 63 72 6f 6c 6c  |WindowHasHScroll|
0000ba00  42 61 72 28 77 68 25 29  0d 05 ba 29 3d 28 a4 73  |Bar(wh%)...)=(.s|
0000ba10  68 65 6c 6c 5f 57 69 6e  64 6f 77 47 65 74 46 6c  |hell_WindowGetFl|
0000ba20  61 67 73 28 77 68 25 29  20 80 20 31 3c 3c 33 30  |ags(wh%) . 1<<30|
0000ba30  29 0d 05 bb 05 3a 0d 05  bc 26 2a 7c 53 74 6f 70  |)....:...&*|Stop|
0000ba40  20 46 4e 73 68 65 6c 6c  5f 57 69 6e 64 6f 77 48  | FNshell_WindowH|
0000ba50  61 73 48 53 63 72 6f 6c  6c 42 61 72 0d 05 bd 04  |asHScrollBar....|
0000ba60  0d 05 be 22 2a 7c 53 74  61 72 74 20 46 4e 73 68  |..."*|Start FNsh|
0000ba70  65 6c 6c 5f 57 69 6e 64  6f 77 47 65 74 46 6c 61  |ell_WindowGetFla|
0000ba80  67 73 0d 05 bf 20 dd 20  a4 73 68 65 6c 6c 5f 57  |gs... . .shell_W|
0000ba90  69 6e 64 6f 77 47 65 74  46 6c 61 67 73 28 77 68  |indowGetFlags(wh|
0000baa0  25 29 0d 05 c0 11 ea 20  66 6c 61 67 73 25 2c 62  |%)..... flags%,b|
0000bab0  6c 6b 25 0d 05 c1 22 62  6c 6b 25 3d a4 73 68 65  |lk%..."blk%=.she|
0000bac0  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 46 65 74 63  |ll_HeapBlockFetc|
0000bad0  68 28 33 36 29 0d 05 c2  0e 62 6c 6b 25 21 30 3d  |h(36)....blk%!0=|
0000bae0  77 68 25 0d 05 c3 22 c8  99 20 22 57 69 6d 70 5f  |wh%...".. "Wimp_|
0000baf0  47 65 74 57 69 6e 64 6f  77 53 74 61 74 65 22 2c  |GetWindowState",|
0000bb00  2c 62 6c 6b 25 0d 05 c4  12 66 6c 61 67 73 25 3d  |,blk%....flags%=|
0000bb10  62 6c 6b 25 21 33 32 0d  05 c5 20 f2 73 68 65 6c  |blk%!32... .shel|
0000bb20  6c 5f 48 65 61 70 42 6c  6f 63 6b 52 65 74 75 72  |l_HeapBlockRetur|
0000bb30  6e 28 62 6c 6b 25 29 0d  05 c6 0b 3d 66 6c 61 67  |n(blk%)....=flag|
0000bb40  73 25 0d 05 c7 05 3a 0d  05 c8 21 2a 7c 53 74 6f  |s%....:...!*|Sto|
0000bb50  70 20 46 4e 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |p FNshell_Window|
0000bb60  47 65 74 46 6c 61 67 73  0d 05 c9 04 0d 05 ca 27  |GetFlags.......'|
0000bb70  2a 7c 53 74 61 72 74 20  46 4e 73 68 65 6c 6c 5f  |*|Start FNshell_|
0000bb80  57 69 6e 64 6f 77 47 65  74 54 69 74 6c 65 46 6c  |WindowGetTitleFl|
0000bb90  61 67 73 0d 05 cb 25 dd  20 a4 73 68 65 6c 6c 5f  |ags...%. .shell_|
0000bba0  57 69 6e 64 6f 77 47 65  74 54 69 74 6c 65 46 6c  |WindowGetTitleFl|
0000bbb0  61 67 73 28 77 68 25 29  0d 05 cc 11 ea 20 66 6c  |ags(wh%)..... fl|
0000bbc0  61 67 73 25 2c 62 6c 6b  25 0d 05 cd 49 62 6c 6b  |ags%,blk%...Iblk|
0000bbd0  25 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |%=.shell_HeapBlo|
0000bbe0  63 6b 46 65 74 63 68 28  31 30 30 20 2b 20 28 a4  |ckFetch(100 + (.|
0000bbf0  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 43 6f 75 6e  |shell_WindowCoun|
0000bc00  74 49 63 6f 6e 73 28 77  68 25 29 20 2a 20 33 32  |tIcons(wh%) * 32|
0000bc10  29 29 0d 05 ce 0e 62 6c  6b 25 21 30 3d 77 68 25  |))....blk%!0=wh%|
0000bc20  0d 05 cf 21 c8 99 20 22  57 69 6d 70 5f 47 65 74  |...!.. "Wimp_Get|
0000bc30  57 69 6e 64 6f 77 49 6e  66 6f 22 2c 2c 62 6c 6b  |WindowInfo",,blk|
0000bc40  25 0d 05 d0 12 66 6c 61  67 73 25 3d 62 6c 6b 25  |%....flags%=blk%|
0000bc50  21 36 30 0d 05 d1 20 f2  73 68 65 6c 6c 5f 48 65  |!60... .shell_He|
0000bc60  61 70 42 6c 6f 63 6b 52  65 74 75 72 6e 28 62 6c  |apBlockReturn(bl|
0000bc70  6b 25 29 0d 05 d2 0b 3d  66 6c 61 67 73 25 0d 05  |k%)....=flags%..|
0000bc80  d3 05 3a 0d 05 d4 26 2a  7c 53 74 6f 70 20 46 4e  |..:...&*|Stop FN|
0000bc90  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 47 65 74 54  |shell_WindowGetT|
0000bca0  69 74 6c 65 46 6c 61 67  73 0d 05 d5 04 0d 05 d6  |itleFlags.......|
0000bcb0  20 2a 7c 53 74 61 72 74  20 46 4e 73 68 65 6c 6c  | *|Start FNshell|
0000bcc0  5f 49 63 6f 6e 47 65 74  46 6c 61 67 73 0d 05 d7  |_IconGetFlags...|
0000bcd0  22 dd 20 a4 73 68 65 6c  6c 5f 49 63 6f 6e 47 65  |". .shell_IconGe|
0000bce0  74 46 6c 61 67 73 28 77  68 25 2c 69 68 25 29 0d  |tFlags(wh%,ih%).|
0000bcf0  05 d8 11 ea 20 66 6c 61  67 73 25 2c 62 6c 6b 25  |.... flags%,blk%|
0000bd00  0d 05 d9 3e f4 20 63 6c  61 69 6d 20 61 20 62 6c  |...>. claim a bl|
0000bd10  6f 63 6b 20 61 73 20 74  65 6d 70 6f 72 61 72 79  |ock as temporary|
0000bd20  20 77 6f 72 6b 73 70 61  63 65 20 62 69 67 20 65  | workspace big e|
0000bd30  6e 6f 75 67 68 20 66 6f  72 20 64 61 74 61 0d 05  |nough for data..|
0000bd40  da 31 f4 20 72 65 74 75  72 6e 65 64 20 62 79 20  |.1. returned by |
0000bd50  53 57 49 20 63 61 6c 6c  20 28 69 63 6f 6e 20 62  |SWI call (icon b|
0000bd60  6c 6f 63 6b 20 2b 20 38  20 62 79 74 65 73 29 0d  |lock + 8 bytes).|
0000bd70  05 db 22 62 6c 6b 25 3d  a4 73 68 65 6c 6c 5f 48  |.."blk%=.shell_H|
0000bd80  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 35 30  |eapBlockFetch(50|
0000bd90  29 0d 05 dc 19 62 6c 6b  25 21 30 3d 77 68 25 3a  |)....blk%!0=wh%:|
0000bda0  62 6c 6b 25 21 34 3d 69  68 25 0d 05 dd 20 c8 99  |blk%!4=ih%... ..|
0000bdb0  20 22 57 69 6d 70 5f 47  65 74 49 63 6f 6e 53 74  | "Wimp_GetIconSt|
0000bdc0  61 74 65 22 2c 2c 62 6c  6b 25 0d 05 de 12 66 6c  |ate",,blk%....fl|
0000bdd0  61 67 73 25 3d 62 6c 6b  25 21 32 34 0d 05 df 20  |ags%=blk%!24... |
0000bde0  f2 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
0000bdf0  52 65 74 75 72 6e 28 62  6c 6b 25 29 0d 05 e0 0b  |Return(blk%)....|
0000be00  3d 66 6c 61 67 73 25 0d  05 e1 05 3a 0d 05 e2 1f  |=flags%....:....|
0000be10  2a 7c 53 74 6f 70 20 46  4e 73 68 65 6c 6c 5f 49  |*|Stop FNshell_I|
0000be20  63 6f 6e 47 65 74 46 6c  61 67 73 0d 05 e3 04 0d  |conGetFlags.....|
0000be30  05 e4 24 2a 7c 53 74 61  72 74 20 46 4e 73 68 65  |..$*|Start FNshe|
0000be40  6c 6c 5f 57 69 6e 64 6f  77 54 69 74 6c 65 46 6c  |ll_WindowTitleFl|
0000be50  61 67 73 0d 05 e5 22 dd  20 a4 73 68 65 6c 6c 5f  |ags...". .shell_|
0000be60  57 69 6e 64 6f 77 54 69  74 6c 65 46 6c 61 67 73  |WindowTitleFlags|
0000be70  28 77 68 25 29 0d 05 e6  11 ea 20 66 6c 61 67 73  |(wh%)..... flags|
0000be80  25 2c 62 6c 6b 25 0d 05  e7 49 62 6c 6b 25 3d a4  |%,blk%...Iblk%=.|
0000be90  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
0000bea0  65 74 63 68 28 31 30 30  20 2b 20 28 a4 73 68 65  |etch(100 + (.she|
0000beb0  6c 6c 5f 57 69 6e 64 6f  77 43 6f 75 6e 74 49 63  |ll_WindowCountIc|
0000bec0  6f 6e 73 28 77 68 25 29  20 2a 20 33 32 29 29 0d  |ons(wh%) * 32)).|
0000bed0  05 e8 0e 62 6c 6b 25 21  30 3d 77 68 25 0d 05 e9  |...blk%!0=wh%...|
0000bee0  21 c8 99 20 22 57 69 6d  70 5f 47 65 74 57 69 6e  |!.. "Wimp_GetWin|
0000bef0  64 6f 77 49 6e 66 6f 22  2c 2c 62 6c 6b 25 0d 05  |dowInfo",,blk%..|
0000bf00  ea 12 66 6c 61 67 73 25  3d 62 6c 6b 25 21 36 30  |..flags%=blk%!60|
0000bf10  0d 05 eb 20 f2 73 68 65  6c 6c 5f 48 65 61 70 42  |... .shell_HeapB|
0000bf20  6c 6f 63 6b 52 65 74 75  72 6e 28 62 6c 6b 25 29  |lockReturn(blk%)|
0000bf30  0d 05 ec 0b 3d 66 6c 61  67 73 25 0d 05 ed 05 3a  |....=flags%....:|
0000bf40  0d 05 ee 23 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |...#*|Stop FNshe|
0000bf50  6c 6c 5f 57 69 6e 64 6f  77 54 69 74 6c 65 46 6c  |ll_WindowTitleFl|
0000bf60  61 67 73 0d 05 ef 04 0d  05 f0 28 2a 7c 53 74 61  |ags.......(*|Sta|
0000bf70  72 74 20 46 4e 73 68 65  6c 6c 5f 57 69 6e 64 6f  |rt FNshell_Windo|
0000bf80  77 54 69 74 6c 65 48 61  73 42 6f 72 64 65 72 0d  |wTitleHasBorder.|
0000bf90  05 f1 26 dd 20 a4 73 68  65 6c 6c 5f 57 69 6e 64  |..&. .shell_Wind|
0000bfa0  6f 77 54 69 74 6c 65 48  61 73 42 6f 72 64 65 72  |owTitleHasBorder|
0000bfb0  28 77 68 25 29 0d 05 f2  2a 3d 28 a4 73 68 65 6c  |(wh%)...*=(.shel|
0000bfc0  6c 5f 57 69 6e 64 6f 77  54 69 74 6c 65 46 6c 61  |l_WindowTitleFla|
0000bfd0  67 73 28 77 68 25 29 20  80 20 31 3c 3c 32 29 0d  |gs(wh%) . 1<<2).|
0000bfe0  05 f3 05 3a 0d 05 f4 27  2a 7c 53 74 6f 70 20 46  |...:...'*|Stop F|
0000bff0  4e 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 54 69 74  |Nshell_WindowTit|
0000c000  6c 65 48 61 73 42 6f 72  64 65 72 0d 05 f5 04 0d  |leHasBorder.....|
0000c010  05 f6 27 2a 7c 53 74 61  72 74 20 46 4e 73 68 65  |..'*|Start FNshe|
0000c020  6c 6c 5f 57 69 6e 64 6f  77 54 69 74 6c 65 49 73  |ll_WindowTitleIs|
0000c030  53 70 72 69 74 65 0d 05  f7 25 dd 20 a4 73 68 65  |Sprite...%. .she|
0000c040  6c 6c 5f 57 69 6e 64 6f  77 54 69 74 6c 65 49 73  |ll_WindowTitleIs|
0000c050  53 70 72 69 74 65 28 77  68 25 29 0d 05 f8 2a 3d  |Sprite(wh%)...*=|
0000c060  28 a4 73 68 65 6c 6c 5f  57 69 6e 64 6f 77 54 69  |(.shell_WindowTi|
0000c070  74 6c 65 46 6c 61 67 73  28 77 68 25 29 20 80 20  |tleFlags(wh%) . |
0000c080  31 3c 3c 31 29 0d 05 f9  05 3a 0d 05 fa 26 2a 7c  |1<<1)....:...&*||
0000c090  53 74 6f 70 20 46 4e 73  68 65 6c 6c 5f 57 69 6e  |Stop FNshell_Win|
0000c0a0  64 6f 77 54 69 74 6c 65  49 73 53 70 72 69 74 65  |dowTitleIsSprite|
0000c0b0  0d 05 fb 04 0d 05 fc 25  2a 7c 53 74 61 72 74 20  |.......%*|Start |
0000c0c0  46 4e 73 68 65 6c 6c 5f  57 69 6e 64 6f 77 54 69  |FNshell_WindowTi|
0000c0d0  74 6c 65 49 73 54 65 78  74 0d 05 fd 23 dd 20 a4  |tleIsText...#. .|
0000c0e0  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 54 69 74 6c  |shell_WindowTitl|
0000c0f0  65 49 73 54 65 78 74 28  77 68 25 29 0d 05 fe 2a  |eIsText(wh%)...*|
0000c100  3d 28 a4 73 68 65 6c 6c  5f 57 69 6e 64 6f 77 54  |=(.shell_WindowT|
0000c110  69 74 6c 65 46 6c 61 67  73 28 77 68 25 29 20 80  |itleFlags(wh%) .|
0000c120  20 31 3c 3c 30 29 0d 05  ff 05 3a 0d 06 00 24 2a  | 1<<0)....:...$*|
0000c130  7c 53 74 6f 70 20 46 4e  73 68 65 6c 6c 5f 57 69  ||Stop FNshell_Wi|
0000c140  6e 64 6f 77 54 69 74 6c  65 49 73 54 65 78 74 0d  |ndowTitleIsText.|
0000c150  06 01 04 0d 06 02 29 2a  7c 53 74 61 72 74 20 46  |......)*|Start F|
0000c160  4e 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 54 69 74  |Nshell_WindowTit|
0000c170  6c 65 49 73 48 43 65 6e  74 72 65 64 0d 06 03 27  |leIsHCentred...'|
0000c180  dd 20 a4 73 68 65 6c 6c  5f 57 69 6e 64 6f 77 54  |. .shell_WindowT|
0000c190  69 74 6c 65 49 73 48 43  65 6e 74 72 65 64 28 77  |itleIsHCentred(w|
0000c1a0  68 25 29 0d 06 04 2a 3d  28 a4 73 68 65 6c 6c 5f  |h%)...*=(.shell_|
0000c1b0  57 69 6e 64 6f 77 54 69  74 6c 65 46 6c 61 67 73  |WindowTitleFlags|
0000c1c0  28 77 68 25 29 20 80 20  31 3c 3c 33 29 0d 06 05  |(wh%) . 1<<3)...|
0000c1d0  05 3a 0d 06 06 28 2a 7c  53 74 6f 70 20 46 4e 73  |.:...(*|Stop FNs|
0000c1e0  68 65 6c 6c 5f 57 69 6e  64 6f 77 54 69 74 6c 65  |hell_WindowTitle|
0000c1f0  49 73 48 43 65 6e 74 72  65 64 0d 06 07 04 0d 06  |IsHCentred......|
0000c200  08 29 2a 7c 53 74 61 72  74 20 46 4e 73 68 65 6c  |.)*|Start FNshel|
0000c210  6c 5f 57 69 6e 64 6f 77  54 69 74 6c 65 49 73 56  |l_WindowTitleIsV|
0000c220  43 65 6e 74 72 65 64 0d  06 09 27 dd 20 a4 73 68  |Centred...'. .sh|
0000c230  65 6c 6c 5f 57 69 6e 64  6f 77 54 69 74 6c 65 49  |ell_WindowTitleI|
0000c240  73 56 43 65 6e 74 72 65  64 28 77 68 25 29 0d 06  |sVCentred(wh%)..|
0000c250  0a 2a 3d 28 a4 73 68 65  6c 6c 5f 57 69 6e 64 6f  |.*=(.shell_Windo|
0000c260  77 54 69 74 6c 65 46 6c  61 67 73 28 77 68 25 29  |wTitleFlags(wh%)|
0000c270  20 80 20 31 3c 3c 34 29  0d 06 0b 05 3a 0d 06 0c  | . 1<<4)....:...|
0000c280  28 2a 7c 53 74 6f 70 20  46 4e 73 68 65 6c 6c 5f  |(*|Stop FNshell_|
0000c290  57 69 6e 64 6f 77 54 69  74 6c 65 49 73 56 43 65  |WindowTitleIsVCe|
0000c2a0  6e 74 72 65 64 0d 06 0d  04 0d 06 0e 27 2a 7c 53  |ntred.......'*|S|
0000c2b0  74 61 72 74 20 46 4e 73  68 65 6c 6c 5f 57 69 6e  |tart FNshell_Win|
0000c2c0  64 6f 77 54 69 74 6c 65  49 73 46 69 6c 6c 65 64  |dowTitleIsFilled|
0000c2d0  0d 06 0f 25 dd 20 a4 73  68 65 6c 6c 5f 57 69 6e  |...%. .shell_Win|
0000c2e0  64 6f 77 54 69 74 6c 65  49 73 46 69 6c 6c 65 64  |dowTitleIsFilled|
0000c2f0  28 77 68 25 29 0d 06 10  2a 3d 28 a4 73 68 65 6c  |(wh%)...*=(.shel|
0000c300  6c 5f 57 69 6e 64 6f 77  54 69 74 6c 65 46 6c 61  |l_WindowTitleFla|
0000c310  67 73 28 77 68 25 29 20  80 20 31 3c 3c 35 29 0d  |gs(wh%) . 1<<5).|
0000c320  06 11 05 3a 0d 06 12 26  2a 7c 53 74 6f 70 20 46  |...:...&*|Stop F|
0000c330  4e 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 54 69 74  |Nshell_WindowTit|
0000c340  6c 65 49 73 46 69 6c 6c  65 64 0d 06 13 04 0d 06  |leIsFilled......|
0000c350  14 29 2a 7c 53 74 61 72  74 20 46 4e 73 68 65 6c  |.)*|Start FNshel|
0000c360  6c 5f 57 69 6e 64 6f 77  54 69 74 6c 65 49 73 41  |l_WindowTitleIsA|
0000c370  41 6c 69 61 73 65 64 0d  06 15 27 dd 20 a4 73 68  |Aliased...'. .sh|
0000c380  65 6c 6c 5f 57 69 6e 64  6f 77 54 69 74 6c 65 49  |ell_WindowTitleI|
0000c390  73 41 41 6c 69 61 73 65  64 28 77 68 25 29 0d 06  |sAAliased(wh%)..|
0000c3a0  16 2a 3d 28 a4 73 68 65  6c 6c 5f 57 69 6e 64 6f  |.*=(.shell_Windo|
0000c3b0  77 54 69 74 6c 65 46 6c  61 67 73 28 77 68 25 29  |wTitleFlags(wh%)|
0000c3c0  20 80 20 31 3c 3c 36 29  0d 06 17 05 3a 0d 06 18  | . 1<<6)....:...|
0000c3d0  28 2a 7c 53 74 6f 70 20  46 4e 73 68 65 6c 6c 5f  |(*|Stop FNshell_|
0000c3e0  57 69 6e 64 6f 77 54 69  74 6c 65 49 73 41 41 6c  |WindowTitleIsAAl|
0000c3f0  69 61 73 65 64 0d 06 19  04 0d 06 1a 2b 2a 7c 53  |iased.......+*|S|
0000c400  74 61 72 74 20 46 4e 73  68 65 6c 6c 5f 57 69 6e  |tart FNshell_Win|
0000c410  64 6f 77 54 69 74 6c 65  49 73 49 6e 64 69 72 65  |dowTitleIsIndire|
0000c420  63 74 65 64 0d 06 1b 29  dd 20 a4 73 68 65 6c 6c  |cted...). .shell|
0000c430  5f 57 69 6e 64 6f 77 54  69 74 6c 65 49 73 49 6e  |_WindowTitleIsIn|
0000c440  64 69 72 65 63 74 65 64  28 77 68 25 29 0d 06 1c  |directed(wh%)...|
0000c450  2a 3d 28 a4 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |*=(.shell_Window|
0000c460  54 69 74 6c 65 46 6c 61  67 73 28 77 68 25 29 20  |TitleFlags(wh%) |
0000c470  80 20 31 3c 3c 38 29 0d  06 1d 05 3a 0d 06 1e 2a  |. 1<<8)....:...*|
0000c480  2a 7c 53 74 6f 70 20 46  4e 73 68 65 6c 6c 5f 57  |*|Stop FNshell_W|
0000c490  69 6e 64 6f 77 54 69 74  6c 65 49 73 49 6e 64 69  |indowTitleIsIndi|
0000c4a0  72 65 63 74 65 64 0d 06  1f 04 0d 06 20 22 2a 7c  |rected...... "*||
0000c4b0  53 74 61 72 74 20 46 4e  73 68 65 6c 6c 5f 57 69  |Start FNshell_Wi|
0000c4c0  6e 64 6f 77 47 65 74 54  69 74 6c 65 0d 06 21 20  |ndowGetTitle..! |
0000c4d0  dd 20 a4 73 68 65 6c 6c  5f 57 69 6e 64 6f 77 47  |. .shell_WindowG|
0000c4e0  65 74 54 69 74 6c 65 28  77 68 25 29 0d 06 22 11  |etTitle(wh%)..".|
0000c4f0  ea 20 74 69 74 6c 65 24  2c 62 6c 6b 25 0d 06 23  |. title$,blk%..#|
0000c500  27 f4 20 43 68 65 63 6b  20 69 66 20 77 69 6e 64  |'. Check if wind|
0000c510  6f 77 20 68 61 73 20 61  20 74 69 74 6c 65 20 62  |ow has a title b|
0000c520  61 72 2e 2e 0d 06 24 49  62 6c 6b 25 3d a4 73 68  |ar....$Iblk%=.sh|
0000c530  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
0000c540  63 68 28 31 30 30 20 2b  20 28 a4 73 68 65 6c 6c  |ch(100 + (.shell|
0000c550  5f 57 69 6e 64 6f 77 43  6f 75 6e 74 49 63 6f 6e  |_WindowCountIcon|
0000c560  73 28 77 68 25 29 20 2a  20 33 32 29 29 0d 06 25  |s(wh%) * 32))..%|
0000c570  0e 62 6c 6b 25 21 30 3d  77 68 25 0d 06 26 21 c8  |.blk%!0=wh%..&!.|
0000c580  99 20 22 57 69 6d 70 5f  47 65 74 57 69 6e 64 6f  |. "Wimp_GetWindo|
0000c590  77 49 6e 66 6f 22 2c 2c  62 6c 6b 25 0d 06 27 19  |wInfo",,blk%..'.|
0000c5a0  e7 20 28 62 6c 6b 25 21  33 32 20 80 20 31 3c 3c  |. (blk%!32 . 1<<|
0000c5b0  32 36 29 20 8c 0d 06 28  1e 20 20 e7 20 28 28 62  |26) ...(.  . ((b|
0000c5c0  6c 6b 25 21 36 30 29 20  80 20 26 31 30 30 29 3d  |lk%!60) . &100)=|
0000c5d0  30 20 8c 0d 06 29 23 20  20 20 20 f4 20 54 69 74  |0 ...)#    . Tit|
0000c5e0  6c 65 20 69 73 20 6e 6f  74 20 69 6e 64 69 72 65  |le is not indire|
0000c5f0  63 74 65 64 2e 2e 0d 06  2a 19 20 20 20 20 74 69  |cted....*.    ti|
0000c600  74 6c 65 24 3d 24 28 62  6c 6b 25 2b 37 36 29 0d  |tle$=$(blk%+76).|
0000c610  06 2b 07 20 20 cc 0d 06  2c 1f 20 20 20 20 f4 20  |.+.  ...,.    . |
0000c620  54 69 74 6c 65 20 69 73  20 69 6e 64 69 72 65 63  |Title is indirec|
0000c630  74 65 64 2e 2e 0d 06 2d  1c 20 20 20 20 74 69 74  |ted....-.    tit|
0000c640  6c 65 24 3d 24 28 21 28  62 6c 6b 25 2b 37 36 29  |le$=$(!(blk%+76)|
0000c650  29 0d 06 2e 07 20 20 cd  0d 06 2f 05 cd 0d 06 30  |)....  .../....0|
0000c660  20 f2 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
0000c670  6b 52 65 74 75 72 6e 28  62 6c 6b 25 29 0d 06 31  |kReturn(blk%)..1|
0000c680  0b 3d 74 69 74 6c 65 24  0d 06 32 05 3a 0d 06 33  |.=title$..2.:..3|
0000c690  21 2a 7c 53 74 6f 70 20  46 4e 73 68 65 6c 6c 5f  |!*|Stop FNshell_|
0000c6a0  57 69 6e 64 6f 77 47 65  74 54 69 74 6c 65 0d 06  |WindowGetTitle..|
0000c6b0  34 04 0d 06 35 2b 2a 7c  53 74 61 72 74 20 46 4e  |4...5+*|Start FN|
0000c6c0  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 54 69 74 6c  |shell_WindowTitl|
0000c6d0  65 42 75 66 66 65 72 4c  65 6e 67 74 68 0d 06 36  |eBufferLength..6|
0000c6e0  29 dd 20 a4 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |). .shell_Window|
0000c6f0  54 69 74 6c 65 42 75 66  66 65 72 4c 65 6e 67 74  |TitleBufferLengt|
0000c700  68 28 77 68 25 29 0d 06  37 12 ea 20 72 65 73 75  |h(wh%)..7.. resu|
0000c710  6c 74 25 2c 62 6c 6b 25  0d 06 38 49 62 6c 6b 25  |lt%,blk%..8Iblk%|
0000c720  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
0000c730  6b 46 65 74 63 68 28 31  30 30 20 2b 20 28 a4 73  |kFetch(100 + (.s|
0000c740  68 65 6c 6c 5f 57 69 6e  64 6f 77 43 6f 75 6e 74  |hell_WindowCount|
0000c750  49 63 6f 6e 73 28 77 68  25 29 20 2a 20 33 32 29  |Icons(wh%) * 32)|
0000c760  29 0d 06 39 0e 62 6c 6b  25 21 30 3d 77 68 25 0d  |)..9.blk%!0=wh%.|
0000c770  06 3a 21 c8 99 20 22 57  69 6d 70 5f 47 65 74 57  |.:!.. "Wimp_GetW|
0000c780  69 6e 64 6f 77 49 6e 66  6f 22 2c 2c 62 6c 6b 25  |indowInfo",,blk%|
0000c790  0d 06 3b 1e 20 20 e7 20  28 28 62 6c 6b 25 21 36  |..;.  . ((blk%!6|
0000c7a0  30 29 20 80 20 26 31 30  30 29 3d 30 20 8c 0d 06  |0) . &100)=0 ...|
0000c7b0  3c 12 20 20 20 20 72 65  73 75 6c 74 25 3d 31 32  |<.    result%=12|
0000c7c0  0d 06 3d 07 20 20 cc 0d  06 3e 17 20 20 20 20 72  |..=.  ...>.    r|
0000c7d0  65 73 75 6c 74 25 3d 62  6c 6b 25 21 38 34 0d 06  |esult%=blk%!84..|
0000c7e0  3f 07 20 20 cd 0d 06 40  20 f2 73 68 65 6c 6c 5f  |?.  ...@ .shell_|
0000c7f0  48 65 61 70 42 6c 6f 63  6b 52 65 74 75 72 6e 28  |HeapBlockReturn(|
0000c800  62 6c 6b 25 29 0d 06 41  0c 3d 72 65 73 75 6c 74  |blk%)..A.=result|
0000c810  25 0d 06 42 05 3a 0d 06  43 2a 2a 7c 53 74 6f 70  |%..B.:..C**|Stop|
0000c820  20 46 4e 73 68 65 6c 6c  5f 57 69 6e 64 6f 77 54  | FNshell_WindowT|
0000c830  69 74 6c 65 42 75 66 66  65 72 4c 65 6e 67 74 68  |itleBufferLength|
0000c840  0d 06 44 04 0d 06 45 26  2a 7c 53 74 61 72 74 20  |..D...E&*|Start |
0000c850  50 52 4f 43 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |PROCshell_Window|
0000c860  4d 6f 76 65 54 6f 49 63  6f 6e 0d 06 46 39 dd 20  |MoveToIcon..F9. |
0000c870  f2 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 4d 6f 76  |.shell_WindowMov|
0000c880  65 54 6f 49 63 6f 6e 28  77 68 25 2c 69 77 68 25  |eToIcon(wh%,iwh%|
0000c890  2c 69 68 25 2c 78 5f 6f  66 66 25 2c 79 5f 6f 66  |,ih%,x_off%,y_of|
0000c8a0  66 25 29 0d 06 47 13 ea  20 69 5f 62 6c 6b 25 2c  |f%)..G.. i_blk%,|
0000c8b0  77 5f 62 6c 6b 25 0d 06  48 29 69 5f 62 6c 6b 25  |w_blk%..H)i_blk%|
0000c8c0  20 20 20 20 3d 20 a4 73  68 65 6c 6c 5f 48 65 61  |    = .shell_Hea|
0000c8d0  70 42 6c 6f 63 6b 46 65  74 63 68 28 35 30 29 0d  |pBlockFetch(50).|
0000c8e0  06 49 29 77 5f 62 6c 6b  25 20 20 20 20 3d 20 a4  |.I)w_blk%    = .|
0000c8f0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
0000c900  65 74 63 68 28 33 36 29  0d 06 4a 11 77 5f 62 6c  |etch(36)..J.w_bl|
0000c910  6b 25 21 32 30 20 3d 20  30 0d 06 4b 20 e7 20 a4  |k%!20 = 0..K . .|
0000c920  73 68 65 6c 6c 5f 4f 53  43 68 65 63 6b 56 65 72  |shell_OSCheckVer|
0000c930  73 69 6f 6e 28 33 29 20  8c 0d 06 4c 31 20 20 e7  |sion(3) ...L1  .|
0000c940  20 69 77 68 25 20 3d 20  2d 31 20 8c 20 21 77 5f  | iwh% = -1 . !w_|
0000c950  62 6c 6b 25 20 3d 20 2d  32 20 8b 20 21 77 5f 62  |blk% = -2 . !w_b|
0000c960  6c 6b 25 20 3d 20 69 77  68 25 0d 06 4d 26 20 20  |lk% = iwh%..M&  |
0000c970  c8 99 20 22 57 69 6d 70  5f 47 65 74 57 69 6e 64  |.. "Wimp_GetWind|
0000c980  6f 77 53 74 61 74 65 22  2c 2c 77 5f 62 6c 6b 25  |owState",,w_blk%|
0000c990  0d 06 4e 05 cd 0d 06 4f  24 69 5f 62 6c 6b 25 21  |..N....O$i_blk%!|
0000c9a0  30 20 3d 20 69 77 68 25  20 3a 20 69 5f 62 6c 6b  |0 = iwh% : i_blk|
0000c9b0  25 21 34 20 3d 20 69 68  25 0d 06 50 22 c8 99 20  |%!4 = ih%..P".. |
0000c9c0  22 57 69 6d 70 5f 47 65  74 49 63 6f 6e 53 74 61  |"Wimp_GetIconSta|
0000c9d0  74 65 22 2c 2c 69 5f 62  6c 6b 25 0d 06 51 47 f2  |te",,i_blk%..QG.|
0000c9e0  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 4d 6f 76 65  |shell_WindowMove|
0000c9f0  54 6f 28 77 68 25 2c 69  5f 62 6c 6b 25 21 38 2b  |To(wh%,i_blk%!8+|
0000ca00  78 5f 6f 66 66 25 2d 77  5f 62 6c 6b 25 21 32 30  |x_off%-w_blk%!20|
0000ca10  2c 69 5f 62 6c 6b 25 21  32 30 2b 79 5f 6f 66 66  |,i_blk%!20+y_off|
0000ca20  25 29 0d 06 52 42 f4 20  50 52 4f 43 73 68 65 6c  |%)..RB. PROCshel|
0000ca30  6c 5f 57 69 6e 64 6f 77  4d 6f 76 65 54 6f 28 77  |l_WindowMoveTo(w|
0000ca40  68 25 2c 69 5f 62 6c 6b  25 21 38 2b 78 5f 6f 66  |h%,i_blk%!8+x_of|
0000ca50  66 25 2c 69 5f 62 6c 6b  25 21 32 30 2b 79 5f 6f  |f%,i_blk%!20+y_o|
0000ca60  66 66 25 29 0d 06 53 22  f2 73 68 65 6c 6c 5f 48  |ff%)..S".shell_H|
0000ca70  65 61 70 42 6c 6f 63 6b  52 65 74 75 72 6e 28 69  |eapBlockReturn(i|
0000ca80  5f 62 6c 6b 25 29 0d 06  54 22 f2 73 68 65 6c 6c  |_blk%)..T".shell|
0000ca90  5f 48 65 61 70 42 6c 6f  63 6b 52 65 74 75 72 6e  |_HeapBlockReturn|
0000caa0  28 77 5f 62 6c 6b 25 29  0d 06 55 05 e1 0d 06 56  |(w_blk%)..U....V|
0000cab0  05 3a 0d 06 57 25 2a 7c  53 74 6f 70 20 50 52 4f  |.:..W%*|Stop PRO|
0000cac0  43 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 4d 6f 76  |Cshell_WindowMov|
0000cad0  65 54 6f 49 63 6f 6e 0d  06 58 04 0d 06 59 22 2a  |eToIcon..X...Y"*|
0000cae0  7c 53 74 61 72 74 20 50  52 4f 43 73 68 65 6c 6c  ||Start PROCshell|
0000caf0  5f 57 69 6e 64 6f 77 4d  6f 76 65 54 6f 0d 06 5a  |_WindowMoveTo..Z|
0000cb00  24 dd 20 f2 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |$. .shell_Window|
0000cb10  4d 6f 76 65 54 6f 28 77  68 25 2c 78 25 2c 79 25  |MoveTo(wh%,x%,y%|
0000cb20  29 0d 06 5b 29 ea 20 77  69 6e 5f 77 69 64 74 68  |)..[). win_width|
0000cb30  25 2c 77 69 6e 5f 68 65  69 67 68 74 25 2c 6f 66  |%,win_height%,of|
0000cb40  66 73 65 74 25 2c 62 6c  6b 25 0d 06 5c 49 62 6c  |fset%,blk%..\Ibl|
0000cb50  6b 25 3d a4 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |k%=.shell_HeapBl|
0000cb60  6f 63 6b 46 65 74 63 68  28 31 30 30 20 2b 20 28  |ockFetch(100 + (|
0000cb70  a4 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 43 6f 75  |.shell_WindowCou|
0000cb80  6e 74 49 63 6f 6e 73 28  77 68 25 29 20 2a 20 33  |ntIcons(wh%) * 3|
0000cb90  32 29 29 0d 06 5d 0e 62  6c 6b 25 21 30 3d 77 68  |2))..].blk%!0=wh|
0000cba0  25 0d 06 5e 21 c8 99 20  22 57 69 6d 70 5f 47 65  |%..^!.. "Wimp_Ge|
0000cbb0  74 57 69 6e 64 6f 77 49  6e 66 6f 22 2c 2c 62 6c  |tWindowInfo",,bl|
0000cbc0  6b 25 0d 06 5f 1e 77 69  6e 5f 77 69 64 74 68 25  |k%.._.win_width%|
0000cbd0  20 3d 62 6c 6b 25 21 31  32 2d 62 6c 6b 25 21 34  | =blk%!12-blk%!4|
0000cbe0  0d 06 60 1e 77 69 6e 5f  68 65 69 67 68 74 25 3d  |..`.win_height%=|
0000cbf0  62 6c 6b 25 21 31 36 2d  62 6c 6b 25 21 38 0d 06  |blk%!16-blk%!8..|
0000cc00  61 0d 62 6c 6b 25 21 34  3d 78 25 0d 06 62 0d 62  |a.blk%!4=x%..b.b|
0000cc10  6c 6b 25 21 38 3d 79 25  0d 06 63 19 62 6c 6b 25  |lk%!8=y%..c.blk%|
0000cc20  21 31 32 3d 78 25 2b 77  69 6e 5f 77 69 64 74 68  |!12=x%+win_width|
0000cc30  25 0d 06 64 1a 62 6c 6b  25 21 31 36 3d 79 25 2b  |%..d.blk%!16=y%+|
0000cc40  77 69 6e 5f 68 65 69 67  68 74 25 0d 06 65 3b f4  |win_height%..e;.|
0000cc50  20 74 68 69 73 20 6c 6f  6f 6b 73 20 72 65 61 6c  | this looks real|
0000cc60  6c 79 20 73 69 6c 6c 79  2c 20 62 75 74 20 69 73  |ly silly, but is|
0000cc70  20 6e 65 63 65 73 73 61  72 79 20 74 6f 20 74 65  | necessary to te|
0000cc80  6c 6c 20 74 68 65 0d 06  66 40 f4 20 77 69 6e 64  |ll the..f@. wind|
0000cc90  6f 77 20 6d 61 6e 61 67  65 72 20 74 68 65 20 6e  |ow manager the n|
0000cca0  65 77 20 77 69 6e 64 6f  77 20 63 6f 6f 72 64 73  |ew window coords|
0000ccb0  2e 20 54 68 65 20 73 68  65 6c 6c 5f 4f 70 65 6e  |. The shell_Open|
0000ccc0  57 69 6e 64 6f 77 0d 06  67 3d f4 20 63 61 6c 6c  |Window..g=. call|
0000ccd0  20 73 65 74 73 20 75 70  20 61 6e 79 20 70 61 6e  | sets up any pan|
0000cce0  65 73 20 61 6e 64 20 61  63 74 75 61 6c 6c 79 20  |es and actually |
0000ccf0  6f 70 65 6e 73 20 74 68  65 20 77 69 6e 64 6f 77  |opens the window|
0000cd00  20 69 6e 0d 06 68 16 f4  20 74 68 65 20 6e 65 77  | in..h.. the new|
0000cd10  20 70 6f 73 69 74 69 6f  6e 0d 06 69 1e c8 99 20  | position..i... |
0000cd20  22 57 69 6d 70 5f 4f 70  65 6e 57 69 6e 64 6f 77  |"Wimp_OpenWindow|
0000cd30  22 2c 2c 62 6c 6b 25 0d  06 6a 1f c8 99 20 22 57  |",,blk%..j... "W|
0000cd40  69 6d 70 5f 43 6c 6f 73  65 57 69 6e 64 6f 77 22  |imp_CloseWindow"|
0000cd50  2c 2c 62 6c 6b 25 0d 06  6b 2c 6f 66 66 73 65 74  |,,blk%..k,offset|
0000cd60  25 3d a4 73 68 65 6c 6c  5f 53 65 61 72 63 68 53  |%=.shell_SearchS|
0000cd70  74 61 74 69 63 28 5f 55  25 21 31 38 34 2c 77 68  |tatic(_U%!184,wh|
0000cd80  25 29 0d 06 6c 12 e7 20  6f 66 66 73 65 74 25 3e  |%)..l.. offset%>|
0000cd90  2d 31 20 8c 0d 06 6d 22  20 20 f2 73 68 65 6c 6c  |-1 ...m"  .shell|
0000cda0  5f 4f 70 65 6e 57 69 6e  64 6f 77 53 74 61 74 69  |_OpenWindowStati|
0000cdb0  63 28 77 68 25 29 0d 06  6e 05 cc 0d 06 6f 28 20  |c(wh%)..n....o( |
0000cdc0  20 f2 73 68 65 6c 6c 5f  4f 70 65 6e 57 69 6e 64  | .shell_OpenWind|
0000cdd0  6f 77 44 79 6e 61 6d 69  63 32 28 77 68 25 2c 30  |owDynamic2(wh%,0|
0000cde0  2c 30 29 0d 06 70 05 cd  0d 06 71 20 f2 73 68 65  |,0)..p....q .she|
0000cdf0  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 52 65 74 75  |ll_HeapBlockRetu|
0000ce00  72 6e 28 62 6c 6b 25 29  0d 06 72 05 e1 0d 06 73  |rn(blk%)..r....s|
0000ce10  05 3a 0d 06 74 21 2a 7c  53 74 6f 70 20 50 52 4f  |.:..t!*|Stop PRO|
0000ce20  43 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 4d 6f 76  |Cshell_WindowMov|
0000ce30  65 54 6f 0d 06 75 04 0d  06 76 26 2a 7c 53 74 61  |eTo..u...v&*|Sta|
0000ce40  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 57 69 6e  |rt PROCshell_Win|
0000ce50  64 6f 77 42 72 69 6e 67  54 6f 54 6f 70 0d 06 77  |dowBringToTop..w|
0000ce60  22 dd 20 f2 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |". .shell_Window|
0000ce70  42 72 69 6e 67 54 6f 54  6f 70 28 77 68 25 29 0d  |BringToTop(wh%).|
0000ce80  06 78 0a ea 20 6d 73 67  25 0d 06 79 23 6d 73 67  |.x.. msg%..y#msg|
0000ce90  25 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |%=.shell_HeapBlo|
0000cea0  63 6b 46 65 74 63 68 28  32 35 36 29 0d 06 7a 0e  |ckFetch(256)..z.|
0000ceb0  6d 73 67 25 21 30 3d 77  68 25 0d 06 7b 22 c8 99  |msg%!0=wh%..{"..|
0000cec0  20 22 57 69 6d 70 5f 47  65 74 57 69 6e 64 6f 77  | "Wimp_GetWindow|
0000ced0  53 74 61 74 65 22 2c 2c  6d 73 67 25 0d 06 7c 0e  |State",,msg%..|.|
0000cee0  6d 73 67 25 21 32 38 3d  2d 31 0d 06 7d 24 c8 99  |msg%!28=-1..}$..|
0000cef0  20 22 57 69 6d 70 5f 53  65 6e 64 4d 65 73 73 61  | "Wimp_SendMessa|
0000cf00  67 65 22 2c 32 2c 6d 73  67 25 2c 77 68 25 0d 06  |ge",2,msg%,wh%..|
0000cf10  7e 33 f4 20 6e 6f 77 20  63 61 6c 6c 20 77 69 6d  |~3. now call wim|
0000cf20  70 20 70 6f 6c 6c 20 61  73 20 74 68 69 73 20 61  |p poll as this a|
0000cf30  63 74 69 6f 6e 20 6d 75  73 74 20 68 61 70 70 65  |ction must happe|
0000cf40  6e 0d 06 7f 2b f4 20 77  69 74 68 6f 75 74 20 77  |n...+. without w|
0000cf50  61 69 74 69 6e 67 20 66  6f 72 20 6e 65 78 74 20  |aiting for next |
0000cf60  77 69 6d 70 20 70 6f 6c  6c 2e 2e 2e 0d 06 80 19  |wimp poll.......|
0000cf70  c8 99 20 22 57 69 6d 70  5f 50 6f 6c 6c 22 2c 30  |.. "Wimp_Poll",0|
0000cf80  2c 6d 73 67 25 0d 06 81  20 f2 73 68 65 6c 6c 5f  |,msg%... .shell_|
0000cf90  48 65 61 70 42 6c 6f 63  6b 52 65 74 75 72 6e 28  |HeapBlockReturn(|
0000cfa0  6d 73 67 25 29 0d 06 82  05 e1 0d 06 83 05 3a 0d  |msg%).........:.|
0000cfb0  06 84 25 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |..%*|Stop PROCsh|
0000cfc0  65 6c 6c 5f 57 69 6e 64  6f 77 42 72 69 6e 67 54  |ell_WindowBringT|
0000cfd0  6f 54 6f 70 0d 06 85 04  0d 06 86 22 2a 7c 53 74  |oTop......."*|St|
0000cfe0  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 55 70  |art PROCshell_Up|
0000cff0  64 61 74 65 57 69 6e 64  6f 77 0d 06 87 2e dd 20  |dateWindow..... |
0000d000  f2 73 68 65 6c 6c 5f 55  70 64 61 74 65 57 69 6e  |.shell_UpdateWin|
0000d010  64 6f 77 28 68 61 6e 64  6c 65 25 2c 6c 25 2c 62  |dow(handle%,l%,b|
0000d020  25 2c 72 25 2c 74 25 29  0d 06 88 0a ea 20 62 6c  |%,r%,t%)..... bl|
0000d030  6b 25 0d 06 89 24 62 6c  6b 25 3d a4 73 68 65 6c  |k%...$blk%=.shel|
0000d040  6c 5f 48 65 61 70 42 6c  6f 63 6b 46 65 74 63 68  |l_HeapBlockFetch|
0000d050  28 62 6c 6b 25 29 0d 06  8a 3c 62 6c 6b 25 21 30  |(blk%)...<blk%!0|
0000d060  3d 68 61 6e 64 6c 65 25  3a 62 6c 6b 25 21 34 3d  |=handle%:blk%!4=|
0000d070  6c 25 3a 62 6c 6b 25 21  38 3d 62 25 3a 62 6c 6b  |l%:blk%!8=b%:blk|
0000d080  25 21 31 32 3d 72 25 3a  62 6c 6b 25 21 31 36 3d  |%!12=r%:blk%!16=|
0000d090  74 25 0d 06 8b 28 c8 99  20 22 57 69 6d 70 5f 55  |t%...(.. "Wimp_U|
0000d0a0  70 64 61 74 65 57 69 6e  64 6f 77 22 2c 2c 62 6c  |pdateWindow",,bl|
0000d0b0  6b 25 20 b8 20 6d 6f 72  65 25 0d 06 8c 22 c8 99  |k% . more%..."..|
0000d0c0  20 22 57 69 6d 70 5f 47  65 74 57 69 6e 64 6f 77  | "Wimp_GetWindow|
0000d0d0  53 74 61 74 65 22 2c 2c  62 6c 6b 25 0d 06 8d 20  |State",,blk%... |
0000d0e0  f2 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
0000d0f0  52 65 74 75 72 6e 28 62  6c 6b 25 29 0d 06 8e 05  |Return(blk%)....|
0000d100  e1 0d 06 8f 05 3a 0d 06  90 21 2a 7c 53 74 6f 70  |.....:...!*|Stop|
0000d110  20 50 52 4f 43 73 68 65  6c 6c 5f 55 70 64 61 74  | PROCshell_Updat|
0000d120  65 57 69 6e 64 6f 77 0d  06 91 04 0d 06 92 28 2a  |eWindow.......(*|
0000d130  7c 53 74 61 72 74 20 50  52 4f 43 73 68 65 6c 6c  ||Start PROCshell|
0000d140  5f 4f 70 65 6e 57 69 6e  64 6f 77 44 79 6e 61 6d  |_OpenWindowDynam|
0000d150  69 63 32 0d 06 93 32 dd  20 f2 73 68 65 6c 6c 5f  |ic2...2. .shell_|
0000d160  4f 70 65 6e 57 69 6e 64  6f 77 44 79 6e 61 6d 69  |OpenWindowDynami|
0000d170  63 32 28 77 68 25 2c 78  5f 6f 66 66 25 2c 79 5f  |c2(wh%,x_off%,y_|
0000d180  6f 66 66 25 29 0d 06 94  14 ea 20 76 6f 69 64 25  |off%)..... void%|
0000d190  2c 70 74 72 5f 62 6c 6b  25 0d 06 95 26 70 74 72  |,ptr_blk%...&ptr|
0000d1a0  5f 62 6c 6b 25 3d a4 73  68 65 6c 6c 5f 48 65 61  |_blk%=.shell_Hea|
0000d1b0  70 42 6c 6f 63 6b 46 65  74 63 68 28 32 30 29 0d  |pBlockFetch(20).|
0000d1c0  06 96 0e 5f 55 25 21 32  30 3d 77 68 25 0d 06 97  |..._U%!20=wh%...|
0000d1d0  26 c8 99 20 22 57 69 6d  70 5f 47 65 74 50 6f 69  |&.. "Wimp_GetPoi|
0000d1e0  6e 74 65 72 49 6e 66 6f  22 2c 2c 70 74 72 5f 62  |nterInfo",,ptr_b|
0000d1f0  6c 6b 25 0d 06 98 41 c8  99 20 22 57 69 6d 70 5f  |lk%...A.. "Wimp_|
0000d200  43 72 65 61 74 65 4d 65  6e 75 22 2c 2c 77 68 25  |CreateMenu",,wh%|
0000d210  2c 70 74 72 5f 62 6c 6b  25 21 30 2b 78 5f 6f 66  |,ptr_blk%!0+x_of|
0000d220  66 25 2c 70 74 72 5f 62  6c 6b 25 21 34 2b 79 5f  |f%,ptr_blk%!4+y_|
0000d230  6f 66 66 25 0d 06 99 24  f2 73 68 65 6c 6c 5f 48  |off%...$.shell_H|
0000d240  65 61 70 42 6c 6f 63 6b  52 65 74 75 72 6e 28 70  |eapBlockReturn(p|
0000d250  74 72 5f 62 6c 6b 25 29  0d 06 9a 05 e1 0d 06 9b  |tr_blk%)........|
0000d260  05 3a 0d 06 9c 27 2a 7c  53 74 6f 70 20 50 52 4f  |.:...'*|Stop PRO|
0000d270  43 73 68 65 6c 6c 5f 4f  70 65 6e 57 69 6e 64 6f  |Cshell_OpenWindo|
0000d280  77 44 79 6e 61 6d 69 63  32 0d 06 9d 04 0d 06 9e  |wDynamic2.......|
0000d290  21 2a 7c 53 74 61 72 74  20 46 4e 73 68 65 6c 6c  |!*|Start FNshell|
0000d2a0  5f 43 6c 61 69 6d 4b 65  79 70 72 65 73 73 0d 06  |_ClaimKeypress..|
0000d2b0  9f 1a dd 20 a4 73 68 65  6c 6c 5f 43 6c 61 69 6d  |... .shell_Claim|
0000d2c0  4b 65 79 70 72 65 73 73  0d 06 a0 43 f4 20 42 6f  |Keypress...C. Bo|
0000d2d0  64 67 65 20 74 6f 20 65  6e 73 75 72 65 20 74 68  |dge to ensure th|
0000d2e0  61 74 20 73 68 65 6c 6c  5f 4f 70 65 6e 57 69 6e  |at shell_OpenWin|
0000d2f0  64 6f 77 44 79 6e 61 6d  69 63 20 77 6f 72 6b 73  |dowDynamic works|
0000d300  20 70 72 6f 70 65 72 6c  79 2e 2e 0d 06 a1 11 e7  | properly.......|
0000d310  20 5f 55 25 21 32 30 3c  3e 30 20 8c 0d 06 a2 1e  | _U%!20<>0 .....|
0000d320  20 20 c8 99 20 22 57 69  6d 70 5f 43 72 65 61 74  |  .. "Wimp_Creat|
0000d330  65 4d 65 6e 75 22 2c 2c  2d 31 0d 06 a3 27 20 20  |eMenu",,-1...'  |
0000d340  76 6f 69 64 25 3d a4 73  68 65 6c 6c 5f 44 65 6c  |void%=.shell_Del|
0000d350  65 74 65 57 69 6e 64 6f  77 28 5f 55 25 21 32 30  |eteWindow(_U%!20|
0000d360  29 0d 06 a4 0e 20 20 5f  55 25 21 32 30 3d 30 0d  |)....  _U%!20=0.|
0000d370  06 a5 05 cd 0d 06 a6 06  3d b9 0d 06 a7 05 3a 0d  |........=.....:.|
0000d380  06 a8 20 2a 7c 53 74 6f  70 20 46 4e 73 68 65 6c  |.. *|Stop FNshel|
0000d390  6c 5f 43 6c 61 69 6d 4b  65 79 70 72 65 73 73 0d  |l_ClaimKeypress.|
0000d3a0  06 a9 04 0d 06 aa 20 2a  7c 53 74 61 72 74 20 50  |...... *|Start P|
0000d3b0  52 4f 43 73 68 65 6c 6c  5f 4f 70 65 6e 57 69 6e  |ROCshell_OpenWin|
0000d3c0  64 6f 77 0d 06 ab 29 dd  20 f2 73 68 65 6c 6c 5f  |dow...). .shell_|
0000d3d0  4f 70 65 6e 57 69 6e 64  6f 77 28 77 68 25 2c 66  |OpenWindow(wh%,f|
0000d3e0  75 6c 6c 25 2c 66 72 6f  6e 74 25 29 0d 06 ac 43  |ull%,front%)...C|
0000d3f0  ea 20 6f 66 66 73 65 74  25 2c 62 6c 6b 25 2c 70  |. offset%,blk%,p|
0000d400  61 6e 65 62 6c 6b 25 2c  63 74 72 25 2c 66 69 72  |aneblk%,ctr%,fir|
0000d410  73 74 5f 70 61 6e 65 25  2c 62 65 68 69 6e 64 25  |st_pane%,behind%|
0000d420  2c 68 65 69 67 68 74 25  2c 77 69 64 74 68 25 0d  |,height%,width%.|
0000d430  06 ad 3f ea 20 66 6c 61  67 25 2c 74 6f 67 67 6c  |..?. flag%,toggl|
0000d440  65 25 2c 74 25 2c 6c 61  73 74 5f 70 61 6e 65 25  |e%,t%,last_pane%|
0000d450  2c 70 72 65 76 5f 70 61  6e 65 25 2c 72 65 73 25  |,prev_pane%,res%|
0000d460  2c 70 74 72 5f 69 6e 66  6f 5f 62 6c 6b 25 0d 06  |,ptr_info_blk%..|
0000d470  ae 20 f4 20 63 68 65 63  6b 20 66 6f 72 20 6f 70  |. . check for op|
0000d480  65 6e 77 69 6e 64 6f 77  20 65 76 65 6e 74 0d 06  |enwindow event..|
0000d490  af 3c 6f 66 66 73 65 74  25 20 3d 20 a4 73 68 65  |.<offset% = .she|
0000d4a0  6c 6c 5f 47 65 74 45 76  65 6e 74 4c 69 73 74 4f  |ll_GetEventListO|
0000d4b0  66 66 73 65 74 28 77 68  25 2c 2d 31 2c 5f 55 25  |ffset(wh%,-1,_U%|
0000d4c0  2b 33 30 34 2c 31 32 2c  a3 29 0d 06 b0 14 e7 20  |+304,12,.)..... |
0000d4d0  6f 66 66 73 65 74 25 20  3e 3d 20 30 20 8c 0d 06  |offset% >= 0 ...|
0000d4e0  b1 1e 20 20 62 6c 6b 25  20 20 3d 5f 55 25 21 33  |..  blk%  =_U%!3|
0000d4f0  30 34 20 2b 20 6f 66 66  73 65 74 25 0d 06 b2 14  |04 + offset%....|
0000d500  20 20 74 65 6d 70 25 20  3d 20 62 6c 6b 25 21 38  |  temp% = blk%!8|
0000d510  0d 06 b3 15 2a 7c 69 66  64 65 66 20 54 72 61 63  |....*|ifdef Trac|
0000d520  65 49 6e 69 74 0d 06 b4  3d 20 20 f2 73 68 65 6c  |eInit...=  .shel|
0000d530  6c 5f 54 72 61 63 65 66  30 28 22 4f 70 65 6e 57  |l_Tracef0("OpenW|
0000d540  69 6e 64 6f 77 3a 41 62  6f 75 74 20 74 6f 20 63  |indow:About to c|
0000d550  61 6c 6c 20 22 2b 22 46  4e 22 2b 24 74 65 6d 70  |all "+"FN"+$temp|
0000d560  25 29 0d 06 b5 0b 2a 7c  65 6e 64 69 66 0d 06 b6  |%)....*|endif...|
0000d570  1b 20 20 72 65 73 25 20  3d 20 a0 28 22 46 4e 22  |.  res% = .("FN"|
0000d580  2b 24 74 65 6d 70 25 29  0d 06 b7 14 20 20 e7 20  |+$temp%)....  . |
0000d590  72 65 73 25 20 3d 20 30  20 8c 20 e1 0d 06 b8 05  |res% = 0 . .....|
0000d5a0  cd 0d 06 b9 04 0d 06 ba  0f 74 6f 67 67 6c 65 25  |.........toggle%|
0000d5b0  20 3d 20 a3 0d 06 bb 24  74 25 20 20 20 3d 20 a4  | = ....$t%   = .|
0000d5c0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
0000d5d0  65 74 63 68 28 34 30 29  0d 06 bc 0e 74 25 21 30  |etch(40)....t%!0|
0000d5e0  20 3d 20 77 68 25 0d 06  bd 20 c8 99 20 22 57 69  | = wh%... .. "Wi|
0000d5f0  6d 70 5f 47 65 74 57 69  6e 64 6f 77 53 74 61 74  |mp_GetWindowStat|
0000d600  65 22 2c 2c 74 25 0d 06  be 3b e7 20 28 74 25 21  |e",,t%...;. (t%!|
0000d610  33 32 20 80 20 26 38 30  30 30 30 29 20 3d 20 26  |32 . &80000) = &|
0000d620  38 30 30 30 30 20 8c 20  74 6f 67 67 6c 65 25 20  |80000 . toggle% |
0000d630  3d 20 b9 20 8b 20 74 6f  67 67 6c 65 25 20 3d 20  |= . . toggle% = |
0000d640  a3 0d 06 bf 1e f2 73 68  65 6c 6c 5f 48 65 61 70  |......shell_Heap|
0000d650  42 6c 6f 63 6b 52 65 74  75 72 6e 28 74 25 29 0d  |BlockReturn(t%).|
0000d660  06 c0 04 0d 06 c1 2d 70  74 72 5f 69 6e 66 6f 5f  |......-ptr_info_|
0000d670  62 6c 6b 25 20 3d 20 a4  73 68 65 6c 6c 5f 48 65  |blk% = .shell_He|
0000d680  61 70 42 6c 6f 63 6b 46  65 74 63 68 28 32 30 29  |apBlockFetch(20)|
0000d690  0d 06 c2 2b c8 99 20 22  57 69 6d 70 5f 47 65 74  |...+.. "Wimp_Get|
0000d6a0  50 6f 69 6e 74 65 72 49  6e 66 6f 22 2c 2c 70 74  |PointerInfo",,pt|
0000d6b0  72 5f 69 6e 66 6f 5f 62  6c 6b 25 0d 06 c3 04 0d  |r_info_blk%.....|
0000d6c0  06 c4 0f 5f 51 25 21 30  20 3d 20 77 68 25 0d 06  |..._Q%!0 = wh%..|
0000d6d0  c5 2d e7 20 ac 20 66 75  6c 6c 25 20 8c 20 c8 99  |.-. . full% . ..|
0000d6e0  20 22 57 69 6d 70 5f 47  65 74 57 69 6e 64 6f 77  | "Wimp_GetWindow|
0000d6f0  53 74 61 74 65 22 2c 2c  5f 51 25 0d 06 c6 0f e7  |State",,_Q%.....|
0000d700  20 74 6f 67 67 6c 65 25  20 8c 0d 06 c7 1f 20 20  | toggle% .....  |
0000d710  c8 99 20 22 57 69 6d 70  5f 4f 70 65 6e 57 69 6e  |.. "Wimp_OpenWin|
0000d720  64 6f 77 22 2c 2c 5f 51  25 0d 06 c8 05 cd 0d 06  |dow",,_Q%.......|
0000d730  c9 3d 6f 66 66 73 65 74  25 20 3d 20 a4 73 68 65  |.=offset% = .she|
0000d740  6c 6c 5f 47 65 74 45 76  65 6e 74 4c 69 73 74 4f  |ll_GetEventListO|
0000d750  66 66 73 65 74 28 77 68  25 2c 2d 31 2c 5f 55 25  |ffset(wh%,-1,_U%|
0000d760  20 2b 20 39 32 2c 32 34  2c a3 29 0d 06 ca 14 e7  | + 92,24,.).....|
0000d770  20 6f 66 66 73 65 74 25  20 3e 20 2d 31 20 8c 0d  | offset% > -1 ..|
0000d780  06 cb 1d 20 20 62 6c 6b  25 3d 28 5f 55 25 21 39  |...  blk%=(_U%!9|
0000d790  32 29 20 2b 20 6f 66 66  73 65 74 25 0d 06 cc 20  |2) + offset%... |
0000d7a0  20 20 f4 20 70 61 6e 65  20 68 61 6e 64 6c 65 72  |  . pane handler|
0000d7b0  20 65 76 65 6e 74 20 66  6f 75 6e 64 0d 06 cd 47  | event found...G|
0000d7c0  20 20 70 74 72 38 25 20  3d 20 62 6c 6b 25 21 38  |  ptr8% = blk%!8|
0000d7d0  3a 70 74 72 31 32 25 20  3d 20 62 6c 6b 25 21 31  |:ptr12% = blk%!1|
0000d7e0  32 3a 70 74 72 31 36 25  20 3d 20 62 6c 6b 25 21  |2:ptr16% = blk%!|
0000d7f0  31 36 3a 70 74 72 32 30  25 20 3d 20 62 6c 6b 25  |16:ptr20% = blk%|
0000d800  21 32 30 0d 06 ce 0f 20  20 5f 51 25 21 30 3d 77  |!20....  _Q%!0=w|
0000d810  68 25 0d 06 cf 2c 20 20  e7 20 66 72 6f 6e 74 25  |h%...,  . front%|
0000d820  20 8c 20 62 65 68 69 6e  64 25 3d 2d 31 20 8b 20  | . behind%=-1 . |
0000d830  62 65 68 69 6e 64 25 3d  5f 51 25 21 32 38 0d 06  |behind%=_Q%!28..|
0000d840  d0 11 20 20 e7 20 ac 20  66 75 6c 6c 25 20 8c 0d  |..  . . full% ..|
0000d850  06 d1 36 20 20 20 20 c8  99 20 22 57 69 6d 70 5f  |..6    .. "Wimp_|
0000d860  4f 70 65 6e 57 69 6e 64  6f 77 22 2c 2c 5f 51 25  |OpenWindow",,_Q%|
0000d870  20 20 20 20 20 3a f4 20  76 62 61 73 65 20 66 75  |     :. vbase fu|
0000d880  64 67 65 2e 2e 0d 06 d2  25 20 20 20 20 c8 99 20  |dge.....%    .. |
0000d890  22 57 69 6d 70 5f 47 65  74 57 69 6e 64 6f 77 53  |"Wimp_GetWindowS|
0000d8a0  74 61 74 65 22 2c 2c 5f  51 25 0d 06 d3 36 20 20  |tate",,_Q%...6  |
0000d8b0  20 20 c8 99 20 22 57 69  6d 70 5f 43 6c 6f 73 65  |  .. "Wimp_Close|
0000d8c0  57 69 6e 64 6f 77 22 2c  2c 5f 51 25 20 20 20 20  |Window",,_Q%    |
0000d8d0  3a f4 20 76 62 61 73 65  20 66 75 64 67 65 2e 2e  |:. vbase fudge..|
0000d8e0  0d 06 d4 07 20 20 cd 0d  06 d5 34 20 20 f4 20 72  |....  ....4  . r|
0000d8f0  65 73 65 72 76 65 20 31  6b 20 61 73 20 62 75 66  |eserve 1k as buf|
0000d900  66 65 72 20 2d 20 68 6f  70 65 20 69 74 27 73 20  |fer - hope it's |
0000d910  65 6e 6f 75 67 68 2e 2e  2e 2e 2e 0d 06 d6 2a 20  |enough........* |
0000d920  20 70 61 6e 65 62 6c 6b  25 20 3d 20 a4 73 68 65  | paneblk% = .she|
0000d930  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 46 65 74 63  |ll_HeapBlockFetc|
0000d940  68 28 34 30 29 0d 06 d7  0e 20 20 63 74 72 25 20  |h(40)....  ctr% |
0000d950  3d 20 30 0d 06 d8 19 20  20 c8 95 20 70 74 72 38  |= 0....  .. ptr8|
0000d960  25 21 63 74 72 25 20 3c  3e 20 2d 31 0d 06 d9 32  |%!ctr% <> -1...2|
0000d970  20 20 20 20 70 61 6e 65  62 6c 6b 25 21 30 20 3d  |    paneblk%!0 =|
0000d980  20 70 74 72 38 25 21 63  74 72 25 3a f4 20 68 61  | ptr8%!ctr%:. ha|
0000d990  6e 64 6c 65 20 6f 66 20  27 70 61 6e 65 27 0d 06  |ndle of 'pane'..|
0000d9a0  da 34 20 20 20 20 e7 20  66 69 72 73 74 5f 70 61  |.4    . first_pa|
0000d9b0  6e 65 25 20 3d 20 30 20  8c 20 66 69 72 73 74 5f  |ne% = 0 . first_|
0000d9c0  70 61 6e 65 25 20 3d 20  70 61 6e 65 62 6c 6b 25  |pane% = paneblk%|
0000d9d0  21 30 0d 06 db 1f 20 20  20 20 6c 61 73 74 5f 70  |!0....    last_p|
0000d9e0  61 6e 65 25 20 3d 20 70  61 6e 65 62 6c 6b 25 21  |ane% = paneblk%!|
0000d9f0  30 0d 06 dc 2a 20 20 20  20 c8 99 20 22 57 69 6d  |0...*    .. "Wim|
0000da00  70 5f 47 65 74 57 69 6e  64 6f 77 53 74 61 74 65  |p_GetWindowState|
0000da10  22 2c 2c 70 61 6e 65 62  6c 6b 25 0d 06 dd 4c 20  |",,paneblk%...L |
0000da20  20 20 20 e7 20 70 74 72  5f 69 6e 66 6f 5f 62 6c  |   . ptr_info_bl|
0000da30  6b 25 21 31 36 20 3d 20  2d 39 20 84 20 74 6f 67  |k%!16 = -9 . tog|
0000da40  67 6c 65 25 20 84 20 70  74 72 5f 69 6e 66 6f 5f  |gle% . ptr_info_|
0000da50  62 6c 6b 25 21 31 36 20  3e 20 2d 35 20 84 20 66  |blk%!16 > -5 . f|
0000da60  72 6f 6e 74 25 20 8c 0d  06 de 15 20 20 20 20 20  |ront% .....     |
0000da70  20 f4 20 6f 70 65 6e 20  70 61 6e 65 0d 06 df 32  | . open pane...2|
0000da80  20 20 20 20 20 20 f4 20  43 68 65 63 6b 20 66 6c  |      . Check fl|
0000da90  61 67 20 77 6f 72 64 20  69 6e 20 70 61 6e 65 20  |ag word in pane |
0000daa0  65 76 65 6e 74 20 62 6c  6f 63 6b 2e 2e 2e 0d 06  |event block.....|
0000dab0  e0 1d 20 20 20 20 20 20  66 6c 61 67 25 20 3d 20  |..      flag% = |
0000dac0  70 74 72 31 32 25 21 63  74 72 25 0d 06 e1 14 20  |ptr12%!ctr%.... |
0000dad0  20 20 20 20 20 c8 8e 20  66 6c 61 67 25 20 ca 0d  |     .. flag% ..|
0000dae0  06 e2 0f 20 20 20 20 20  20 c9 20 30 2c 31 0d 06  |...      . 0,1..|
0000daf0  e3 2a 20 20 20 20 20 20  20 20 68 65 69 67 68 74  |.*        height|
0000db00  25 3d 70 61 6e 65 62 6c  6b 25 21 31 36 2d 70 61  |%=paneblk%!16-pa|
0000db10  6e 65 62 6c 6b 25 21 38  0d 06 e4 29 20 20 20 20  |neblk%!8...)    |
0000db20  20 20 20 20 77 69 64 74  68 25 3d 70 61 6e 65 62  |    width%=paneb|
0000db30  6c 6b 25 21 31 32 2d 70  61 6e 65 62 6c 6b 25 21  |lk%!12-paneblk%!|
0000db40  34 0d 06 e5 28 20 20 20  20 20 20 20 20 70 61 6e  |4...(        pan|
0000db50  65 62 6c 6b 25 21 34 3d  5f 51 25 21 34 2b 70 74  |eblk%!4=_Q%!4+pt|
0000db60  72 31 36 25 21 63 74 72  25 0d 06 e6 29 20 20 20  |r16%!ctr%...)   |
0000db70  20 20 20 20 20 70 61 6e  65 62 6c 6b 25 21 31 32  |     paneblk%!12|
0000db80  3d 70 61 6e 65 62 6c 6b  25 21 34 2b 77 69 64 74  |=paneblk%!4+widt|
0000db90  68 25 0d 06 e7 2a 20 20  20 20 20 20 20 20 70 61  |h%...*        pa|
0000dba0  6e 65 62 6c 6b 25 21 31  36 3d 5f 51 25 21 31 36  |neblk%!16=_Q%!16|
0000dbb0  2b 70 74 72 32 30 25 21  63 74 72 25 0d 06 e8 2a  |+ptr20%!ctr%...*|
0000dbc0  20 20 20 20 20 20 20 20  70 61 6e 65 62 6c 6b 25  |        paneblk%|
0000dbd0  21 38 3d 70 61 6e 65 62  6c 6b 25 21 31 36 2d 68  |!8=paneblk%!16-h|
0000dbe0  65 69 67 68 74 25 0d 06  e9 0d 20 20 20 20 20 20  |eight%....      |
0000dbf0  c9 20 32 0d 06 ea 27 20  20 20 20 20 20 20 20 f4  |. 2...'        .|
0000dc00  20 41 74 74 61 63 68 65  64 20 74 6f 20 74 6f 70  | Attached to top|
0000dc10  20 65 64 67 65 2e 2e 2e  2e 2e 0d 06 eb 2a 20 20  | edge........*  |
0000dc20  20 20 20 20 20 20 68 65  69 67 68 74 25 3d 70 61  |      height%=pa|
0000dc30  6e 65 62 6c 6b 25 21 31  36 2d 70 61 6e 65 62 6c  |neblk%!16-panebl|
0000dc40  6b 25 21 38 0d 06 ec 1f  20 20 20 20 20 20 20 20  |k%!8....        |
0000dc50  77 69 64 74 68 25 3d 5f  51 25 21 31 32 2d 5f 51  |width%=_Q%!12-_Q|
0000dc60  25 21 34 0d 06 ed 28 20  20 20 20 20 20 20 20 70  |%!4...(        p|
0000dc70  61 6e 65 62 6c 6b 25 21  34 3d 5f 51 25 21 34 2b  |aneblk%!4=_Q%!4+|
0000dc80  70 74 72 31 36 25 21 63  74 72 25 0d 06 ee 1e 20  |ptr16%!ctr%.... |
0000dc90  20 20 20 20 20 20 20 70  61 6e 65 62 6c 6b 25 21  |       paneblk%!|
0000dca0  31 32 3d 5f 51 25 21 31  32 0d 06 ef 2a 20 20 20  |12=_Q%!12...*   |
0000dcb0  20 20 20 20 20 70 61 6e  65 62 6c 6b 25 21 31 36  |     paneblk%!16|
0000dcc0  3d 5f 51 25 21 31 36 2b  70 74 72 32 30 25 21 63  |=_Q%!16+ptr20%!c|
0000dcd0  74 72 25 0d 06 f0 2a 20  20 20 20 20 20 20 20 70  |tr%...*        p|
0000dce0  61 6e 65 62 6c 6b 25 21  38 3d 70 61 6e 65 62 6c  |aneblk%!8=panebl|
0000dcf0  6b 25 21 31 36 2d 68 65  69 67 68 74 25 0d 06 f1  |k%!16-height%...|
0000dd00  0d 20 20 20 20 20 20 c9  20 33 0d 06 f2 26 20 20  |.      . 3...&  |
0000dd10  20 20 20 20 20 20 f4 20  41 74 74 61 63 68 65 64  |      . Attached|
0000dd20  20 74 6f 20 6c 65 66 74  20 65 64 67 65 2e 2e 2e  | to left edge...|
0000dd30  0d 06 f3 20 20 20 20 20  20 20 20 20 68 65 69 67  |...         heig|
0000dd40  68 74 25 3d 5f 51 25 21  31 36 2d 5f 51 25 21 38  |ht%=_Q%!16-_Q%!8|
0000dd50  0d 06 f4 29 20 20 20 20  20 20 20 20 77 69 64 74  |...)        widt|
0000dd60  68 25 3d 70 61 6e 65 62  6c 6b 25 21 31 32 2d 70  |h%=paneblk%!12-p|
0000dd70  61 6e 65 62 6c 6b 25 21  34 0d 06 f5 28 20 20 20  |aneblk%!4...(   |
0000dd80  20 20 20 20 20 70 61 6e  65 62 6c 6b 25 21 34 3d  |     paneblk%!4=|
0000dd90  5f 51 25 21 34 2b 70 74  72 31 36 25 21 63 74 72  |_Q%!4+ptr16%!ctr|
0000dda0  25 0d 06 f6 29 20 20 20  20 20 20 20 20 70 61 6e  |%...)        pan|
0000ddb0  65 62 6c 6b 25 21 31 32  3d 70 61 6e 65 62 6c 6b  |eblk%!12=paneblk|
0000ddc0  25 21 34 2b 77 69 64 74  68 25 0d 06 f7 33 20 20  |%!4+width%...3  |
0000ddd0  20 20 20 20 20 20 70 61  6e 65 62 6c 6b 25 21 31  |      paneblk%!1|
0000dde0  36 3d 5f 51 25 21 31 36  20 20 20 20 20 20 20 20  |6=_Q%!16        |
0000ddf0  20 20 20 20 20 3a f4 20  6d 69 6e 20 79 0d 06 f8  |     :. min y...|
0000de00  33 20 20 20 20 20 20 20  20 70 61 6e 65 62 6c 6b  |3        paneblk|
0000de10  25 21 38 3d 5f 51 25 21  38 2b 70 74 72 32 30 25  |%!8=_Q%!8+ptr20%|
0000de20  21 63 74 72 25 20 20 20  3a f4 20 6d 61 78 20 79  |!ctr%   :. max y|
0000de30  0d 06 f9 0d 20 20 20 20  20 20 c9 20 34 0d 06 fa  |....      . 4...|
0000de40  28 20 20 20 20 20 20 20  20 f4 20 41 74 74 61 63  |(        . Attac|
0000de50  68 65 64 20 74 6f 20 62  6f 74 74 6f 6d 20 65 64  |hed to bottom ed|
0000de60  67 65 2e 2e 2e 0d 06 fb  2a 20 20 20 20 20 20 20  |ge......*       |
0000de70  20 68 65 69 67 68 74 25  3d 70 61 6e 65 62 6c 6b  | height%=paneblk|
0000de80  25 21 31 36 2d 70 61 6e  65 62 6c 6b 25 21 38 0d  |%!16-paneblk%!8.|
0000de90  06 fc 1f 20 20 20 20 20  20 20 20 77 69 64 74 68  |...        width|
0000dea0  25 3d 5f 51 25 21 31 32  2d 5f 51 25 21 34 0d 06  |%=_Q%!12-_Q%!4..|
0000deb0  fd 28 20 20 20 20 20 20  20 20 70 61 6e 65 62 6c  |.(        panebl|
0000dec0  6b 25 21 34 3d 5f 51 25  21 34 2b 70 74 72 31 36  |k%!4=_Q%!4+ptr16|
0000ded0  25 21 63 74 72 25 0d 06  fe 1e 20 20 20 20 20 20  |%!ctr%....      |
0000dee0  20 20 70 61 6e 65 62 6c  6b 25 21 31 32 3d 5f 51  |  paneblk%!12=_Q|
0000def0  25 21 31 32 0d 06 ff 31  20 20 20 20 20 20 20 20  |%!12...1        |
0000df00  70 61 6e 65 62 6c 6b 25  21 31 36 3d 5f 51 25 21  |paneblk%!16=_Q%!|
0000df10  38 2b 68 65 69 67 68 74  25 2b 70 74 72 32 30 25  |8+height%+ptr20%|
0000df20  21 63 74 72 25 0d 07 00  2a 20 20 20 20 20 20 20  |!ctr%...*       |
0000df30  20 70 61 6e 65 62 6c 6b  25 21 38 3d 70 61 6e 65  | paneblk%!8=pane|
0000df40  62 6c 6b 25 21 31 36 2b  68 65 69 67 68 74 25 0d  |blk%!16+height%.|
0000df50  07 01 0d 20 20 20 20 20  20 c9 20 35 0d 07 02 27  |...      . 5...'|
0000df60  20 20 20 20 20 20 20 20  f4 20 41 74 74 61 63 68  |        . Attach|
0000df70  65 64 20 74 6f 20 72 69  67 68 74 20 65 64 67 65  |ed to right edge|
0000df80  2e 2e 2e 0d 07 03 20 20  20 20 20 20 20 20 20 68  |......         h|
0000df90  65 69 67 68 74 25 3d 5f  51 25 21 31 36 2d 5f 51  |eight%=_Q%!16-_Q|
0000dfa0  25 21 38 0d 07 04 29 20  20 20 20 20 20 20 20 77  |%!8...)        w|
0000dfb0  69 64 74 68 25 3d 70 61  6e 65 62 6c 6b 25 21 31  |idth%=paneblk%!1|
0000dfc0  32 2d 70 61 6e 65 62 6c  6b 25 21 34 0d 07 05 30  |2-paneblk%!4...0|
0000dfd0  20 20 20 20 20 20 20 20  70 61 6e 65 62 6c 6b 25  |        paneblk%|
0000dfe0  21 34 3d 5f 51 25 21 31  32 2d 77 69 64 74 68 25  |!4=_Q%!12-width%|
0000dff0  2b 70 74 72 31 36 25 21  63 74 72 25 0d 07 06 29  |+ptr16%!ctr%...)|
0000e000  20 20 20 20 20 20 20 20  70 61 6e 65 62 6c 6b 25  |        paneblk%|
0000e010  21 31 32 3d 70 61 6e 65  62 6c 6b 25 21 34 2b 77  |!12=paneblk%!4+w|
0000e020  69 64 74 68 25 0d 07 07  27 20 20 20 20 20 20 20  |idth%...'       |
0000e030  20 70 61 6e 65 62 6c 6b  25 21 31 36 3d 5f 51 25  | paneblk%!16=_Q%|
0000e040  21 31 36 20 3a f4 20 6d  69 6e 20 79 0d 07 08 27  |!16 :. min y...'|
0000e050  20 20 20 20 20 20 20 20  70 61 6e 65 62 6c 6b 25  |        paneblk%|
0000e060  21 38 3d 5f 51 25 21 38  20 20 20 3a f4 20 6d 61  |!8=_Q%!8   :. ma|
0000e070  78 20 79 0d 07 09 0b 20  20 20 20 20 20 cb 0d 07  |x y....      ...|
0000e080  0a 14 20 20 20 20 20 20  e7 20 63 74 72 25 3d 30  |..      . ctr%=0|
0000e090  20 8c 0d 07 0b 21 20 20  20 20 20 20 20 20 70 61  | ....!        pa|
0000e0a0  6e 65 62 6c 6b 25 21 32  38 20 3d 20 62 65 68 69  |neblk%!28 = behi|
0000e0b0  6e 64 25 0d 07 0c 0b 20  20 20 20 20 20 cc 0d 07  |nd%....      ...|
0000e0c0  0d 24 20 20 20 20 20 20  20 20 70 61 6e 65 62 6c  |.$        panebl|
0000e0d0  6b 25 21 32 38 20 3d 20  70 72 65 76 5f 70 61 6e  |k%!28 = prev_pan|
0000e0e0  65 25 0d 07 0e 0b 20 20  20 20 20 20 cd 0d 07 0f  |e%....      ....|
0000e0f0  28 20 20 20 20 20 20 c8  99 20 22 57 69 6d 70 5f  |(      .. "Wimp_|
0000e100  4f 70 65 6e 57 69 6e 64  6f 77 22 2c 2c 70 61 6e  |OpenWindow",,pan|
0000e110  65 62 6c 6b 25 0d 07 10  09 20 20 20 20 cd 0d 07  |eblk%....    ...|
0000e120  11 1f 20 20 20 20 70 72  65 76 5f 70 61 6e 65 25  |..    prev_pane%|
0000e130  20 3d 20 70 61 6e 65 62  6c 6b 25 21 30 0d 07 12  | = paneblk%!0...|
0000e140  11 20 20 20 20 63 74 72  25 20 2b 3d 20 34 0d 07  |.    ctr% += 4..|
0000e150  13 07 20 20 ce 0d 07 14  13 20 20 e7 20 ac 20 74  |..  .....  . . t|
0000e160  6f 67 67 6c 65 25 20 8c  0d 07 15 1b 20 20 20 20  |oggle% .....    |
0000e170  5f 51 25 21 32 38 20 3d  20 6c 61 73 74 5f 70 61  |_Q%!28 = last_pa|
0000e180  6e 65 25 0d 07 16 21 20  20 20 20 c8 99 20 22 57  |ne%...!    .. "W|
0000e190  69 6d 70 5f 4f 70 65 6e  57 69 6e 64 6f 77 22 2c  |imp_OpenWindow",|
0000e1a0  2c 5f 51 25 0d 07 17 07  20 20 cd 0d 07 18 26 20  |,_Q%....  ....& |
0000e1b0  20 f2 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
0000e1c0  6b 52 65 74 75 72 6e 28  70 61 6e 65 62 6c 6b 25  |kReturn(paneblk%|
0000e1d0  29 0d 07 19 05 cc 0d 07  1a 18 20 20 f4 20 6e 6f  |).........  . no|
0000e1e0  20 70 61 6e 65 20 65 76  65 6e 74 2e 2e 2e 0d 07  | pane event.....|
0000e1f0  1b 11 20 20 5f 51 25 21  30 20 3d 20 77 68 25 0d  |..  _Q%!0 = wh%.|
0000e200  07 1c 2f 20 20 e7 20 ac  20 66 75 6c 6c 25 20 8c  |../  . . full% .|
0000e210  20 c8 99 20 22 57 69 6d  70 5f 47 65 74 57 69 6e  | .. "Wimp_GetWin|
0000e220  64 6f 77 53 74 61 74 65  22 2c 2c 5f 51 25 0d 07  |dowState",,_Q%..|
0000e230  1d 22 20 20 e7 20 62 65  68 69 6e 64 25 20 3d 20  |."  . behind% = |
0000e240  2d 32 20 8c 20 5f 51 25  21 32 38 20 3d 20 2d 32  |-2 . _Q%!28 = -2|
0000e250  0d 07 1e 22 20 20 e7 20  66 72 6f 6e 74 25 20 20  |..."  . front%  |
0000e260  3d 20 2d 31 20 8c 20 5f  51 25 21 32 38 20 3d 20  |= -1 . _Q%!28 = |
0000e270  2d 31 0d 07 1f 1f 20 20  c8 99 20 22 57 69 6d 70  |-1....  .. "Wimp|
0000e280  5f 4f 70 65 6e 57 69 6e  64 6f 77 22 2c 2c 5f 51  |_OpenWindow",,_Q|
0000e290  25 0d 07 20 05 cd 0d 07  21 29 f2 73 68 65 6c 6c  |%.. ....!).shell|
0000e2a0  5f 48 65 61 70 42 6c 6f  63 6b 52 65 74 75 72 6e  |_HeapBlockReturn|
0000e2b0  28 70 74 72 5f 69 6e 66  6f 5f 62 6c 6b 25 29 0d  |(ptr_info_blk%).|
0000e2c0  07 22 05 e1 0d 07 23 05  3a 0d 07 24 1f 2a 7c 53  |."....#.:..$.*|S|
0000e2d0  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 4f 70  |top PROCshell_Op|
0000e2e0  65 6e 57 69 6e 64 6f 77  0d 07 25 04 0d 07 26 21  |enWindow..%...&!|
0000e2f0  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
0000e300  6c 5f 43 6c 6f 73 65 57  69 6e 64 6f 77 0d 07 27  |l_CloseWindow..'|
0000e310  1d dd 20 f2 73 68 65 6c  6c 5f 43 6c 6f 73 65 57  |.. .shell_CloseW|
0000e320  69 6e 64 6f 77 28 77 68  25 29 0d 07 28 3b ea 20  |indow(wh%)..(;. |
0000e330  6f 66 66 73 65 74 25 2c  62 6c 6b 25 2c 70 74 72  |offset%,blk%,ptr|
0000e340  38 25 2c 70 74 72 31 32  25 2c 70 74 72 31 36 25  |8%,ptr12%,ptr16%|
0000e350  2c 70 74 72 32 30 25 2c  77 69 6e 5f 62 6c 6b 25  |,ptr20%,win_blk%|
0000e360  2c 72 65 73 25 0d 07 29  3a 6f 66 66 73 65 74 25  |,res%..):offset%|
0000e370  3d a4 73 68 65 6c 6c 5f  47 65 74 45 76 65 6e 74  |=.shell_GetEvent|
0000e380  4c 69 73 74 4f 66 66 73  65 74 28 77 68 25 2c 2d  |ListOffset(wh%,-|
0000e390  31 2c 5f 55 25 2b 33 30  38 2c 31 32 2c a3 29 0d  |1,_U%+308,12,.).|
0000e3a0  07 2a 12 e7 20 6f 66 66  73 65 74 25 3e 3d 30 20  |.*.. offset%>=0 |
0000e3b0  8c 0d 07 2b 1a 20 20 62  6c 6b 25 3d 5f 55 25 21  |...+.  blk%=_U%!|
0000e3c0  33 30 38 2b 6f 66 66 73  65 74 25 0d 07 2c 12 20  |308+offset%..,. |
0000e3d0  20 74 65 6d 70 25 3d 62  6c 6b 25 21 38 0d 07 2d  | temp%=blk%!8..-|
0000e3e0  15 2a 7c 69 66 64 65 66  20 54 72 61 63 65 49 6e  |.*|ifdef TraceIn|
0000e3f0  69 74 0d 07 2e 3e 20 20  f2 73 68 65 6c 6c 5f 54  |it...>  .shell_T|
0000e400  72 61 63 65 66 30 28 22  43 6c 6f 73 65 57 69 6e  |racef0("CloseWin|
0000e410  64 6f 77 3a 41 62 6f 75  74 20 74 6f 20 63 61 6c  |dow:About to cal|
0000e420  6c 20 22 2b 22 46 4e 22  2b 24 74 65 6d 70 25 29  |l "+"FN"+$temp%)|
0000e430  0d 07 2f 0b 2a 7c 65 6e  64 69 66 0d 07 30 19 20  |../.*|endif..0. |
0000e440  20 72 65 73 25 3d a0 28  22 46 4e 22 2b 24 74 65  | res%=.("FN"+$te|
0000e450  6d 70 25 29 0d 07 31 12  20 20 e7 20 72 65 73 25  |mp%)..1.  . res%|
0000e460  3d 30 20 8c 20 e1 0d 07  32 05 cd 0d 07 33 26 77  |=0 . ...2....3&w|
0000e470  69 6e 5f 62 6c 6b 25 3d  a4 73 68 65 6c 6c 5f 48  |in_blk%=.shell_H|
0000e480  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 36 30  |eapBlockFetch(60|
0000e490  29 0d 07 34 0d e7 20 77  68 25 3e 30 20 8c 0d 07  |)..4.. wh%>0 ...|
0000e4a0  35 3b 20 20 6f 66 66 73  65 74 25 3d a4 73 68 65  |5;  offset%=.she|
0000e4b0  6c 6c 5f 47 65 74 45 76  65 6e 74 4c 69 73 74 4f  |ll_GetEventListO|
0000e4c0  66 66 73 65 74 28 77 68  25 2c 2d 31 2c 5f 55 25  |ffset(wh%,-1,_U%|
0000e4d0  2b 39 32 2c 32 34 2c a3  29 0d 07 36 14 20 20 e7  |+92,24,.)..6.  .|
0000e4e0  20 6f 66 66 73 65 74 25  3e 2d 31 20 8c 0d 07 37  | offset%>-1 ...7|
0000e4f0  1d 20 20 20 20 62 6c 6b  25 3d 28 5f 55 25 21 39  |.    blk%=(_U%!9|
0000e500  32 29 2b 6f 66 66 73 65  74 25 0d 07 38 34 20 20  |2)+offset%..84  |
0000e510  20 20 70 74 72 31 32 25  3d 62 6c 6b 25 21 31 32  |  ptr12%=blk%!12|
0000e520  3a 70 74 72 31 36 25 3d  62 6c 6b 25 21 31 36 3a  |:ptr16%=blk%!16:|
0000e530  70 74 72 32 30 25 3d 62  6c 6b 25 21 32 30 0d 07  |ptr20%=blk%!20..|
0000e540  39 1b 20 20 20 20 63 74  72 25 3d 30 3a 70 74 72  |9.    ctr%=0:ptr|
0000e550  38 25 3d 62 6c 6b 25 21  38 0d 07 3a 19 20 20 20  |8%=blk%!8..:.   |
0000e560  20 c8 95 20 70 74 72 38  25 21 63 74 72 25 3c 3e  | .. ptr8%!ctr%<>|
0000e570  2d 31 0d 07 3b 1e 20 20  20 20 20 20 f4 20 63 6c  |-1..;.      . cl|
0000e580  6f 73 65 20 70 61 6e 65  20 77 69 6e 64 6f 77 73  |ose pane windows|
0000e590  0d 07 3c 1f 20 20 20 20  20 20 77 69 6e 5f 62 6c  |..<.      win_bl|
0000e5a0  6b 25 21 30 3d 70 74 72  38 25 21 63 74 72 25 0d  |k%!0=ptr8%!ctr%.|
0000e5b0  07 3d 29 20 20 20 20 20  20 c8 99 20 22 57 69 6d  |.=)      .. "Wim|
0000e5c0  70 5f 43 6c 6f 73 65 57  69 6e 64 6f 77 22 2c 2c  |p_CloseWindow",,|
0000e5d0  77 69 6e 5f 62 6c 6b 25  0d 07 3e 11 20 20 20 20  |win_blk%..>.    |
0000e5e0  20 20 63 74 72 25 2b 3d  34 0d 07 3f 09 20 20 20  |  ctr%+=4..?.   |
0000e5f0  20 ce 0d 07 40 2a 20 20  20 20 f4 20 50 52 4f 43  | ...@*    . PROC|
0000e600  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 52  |shell_HeapBlockR|
0000e610  65 74 75 72 6e 28 70 74  72 38 25 29 0d 07 41 2b  |eturn(ptr8%)..A+|
0000e620  20 20 20 20 f4 20 50 52  4f 43 73 68 65 6c 6c 5f  |    . PROCshell_|
0000e630  48 65 61 70 42 6c 6f 63  6b 52 65 74 75 72 6e 28  |HeapBlockReturn(|
0000e640  70 74 72 31 32 25 29 0d  07 42 2b 20 20 20 20 f4  |ptr12%)..B+    .|
0000e650  20 50 52 4f 43 73 68 65  6c 6c 5f 48 65 61 70 42  | PROCshell_HeapB|
0000e660  6c 6f 63 6b 52 65 74 75  72 6e 28 70 74 72 31 36  |lockReturn(ptr16|
0000e670  25 29 0d 07 43 2b 20 20  20 20 f4 20 50 52 4f 43  |%)..C+    . PROC|
0000e680  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 52  |shell_HeapBlockR|
0000e690  65 74 75 72 6e 28 70 74  72 32 30 25 29 0d 07 44  |eturn(ptr20%)..D|
0000e6a0  07 20 20 cd 0d 07 45 1b  20 20 f4 20 63 6c 6f 73  |.  ...E.  . clos|
0000e6b0  65 20 70 61 72 65 6e 74  20 77 69 6e 64 6f 77 0d  |e parent window.|
0000e6c0  07 46 34 20 20 77 69 6e  5f 62 6c 6b 25 21 30 3d  |.F4  win_blk%!0=|
0000e6d0  77 68 25 3a c8 99 20 22  57 69 6d 70 5f 43 6c 6f  |wh%:.. "Wimp_Clo|
0000e6e0  73 65 57 69 6e 64 6f 77  22 2c 2c 77 69 6e 5f 62  |seWindow",,win_b|
0000e6f0  6c 6b 25 0d 07 47 05 cd  0d 07 48 24 f2 73 68 65  |lk%..G....H$.she|
0000e700  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 52 65 74 75  |ll_HeapBlockRetu|
0000e710  72 6e 28 77 69 6e 5f 62  6c 6b 25 29 0d 07 49 05  |rn(win_blk%)..I.|
0000e720  e1 0d 07 4a 05 3a 0d 07  4b 20 2a 7c 53 74 6f 70  |...J.:..K *|Stop|
0000e730  20 50 52 4f 43 73 68 65  6c 6c 5f 43 6c 6f 73 65  | PROCshell_Close|
0000e740  57 69 6e 64 6f 77 0d 07  4c 04 0d 07 4d 20 2a 7c  |Window..L...M *||
0000e750  53 74 61 72 74 20 46 4e  73 68 65 6c 6c 5f 44 65  |Start FNshell_De|
0000e760  6c 65 74 65 57 69 6e 64  6f 77 0d 07 4e 22 dd 20  |leteWindow..N". |
0000e770  a4 73 68 65 6c 6c 5f 44  65 6c 65 74 65 57 69 6e  |.shell_DeleteWin|
0000e780  64 6f 77 28 68 61 6e 64  6c 65 25 29 0d 07 4f 0e  |dow(handle%)..O.|
0000e790  ea 20 77 69 6e 5f 62 6c  6b 25 0d 07 50 26 77 69  |. win_blk%..P&wi|
0000e7a0  6e 5f 62 6c 6b 25 3d a4  73 68 65 6c 6c 5f 48 65  |n_blk%=.shell_He|
0000e7b0  61 70 42 6c 6f 63 6b 46  65 74 63 68 28 32 30 29  |apBlockFetch(20)|
0000e7c0  0d 07 51 12 e7 20 68 61  6e 64 6c 65 25 3c 3e 30  |..Q.. handle%<>0|
0000e7d0  20 8c 0d 07 52 1f 20 20  e7 20 a4 6f 6b 74 6f 64  | ...R.  . .oktod|
0000e7e0  65 6c 65 74 65 77 28 68  61 6e 64 6c 65 25 29 20  |eletew(handle%) |
0000e7f0  8c 0d 07 53 26 20 20 20  20 f2 73 68 65 6c 6c 5f  |...S&    .shell_|
0000e800  45 76 65 6e 74 44 65 6c  65 74 65 41 6c 6c 28 68  |EventDeleteAll(h|
0000e810  61 6e 64 6c 65 25 29 0d  07 54 23 20 20 20 20 e7  |andle%)..T#    .|
0000e820  20 68 61 6e 64 6c 65 25  3d 5f 55 25 21 32 30 20  | handle%=_U%!20 |
0000e830  8c 20 5f 55 25 21 32 30  3d 30 0d 07 55 34 20 20  |. _U%!20=0..U4  |
0000e840  20 20 6f 66 66 73 65 74  25 3d a4 73 68 65 6c 6c  |  offset%=.shell|
0000e850  5f 53 65 61 72 63 68 53  74 61 74 69 63 28 5f 55  |_SearchStatic(_U|
0000e860  25 21 31 38 34 2c 68 61  6e 64 6c 65 25 29 0d 07  |%!184,handle%)..|
0000e870  56 16 20 20 20 20 e7 20  6f 66 66 73 65 74 25 3e  |V.    . offset%>|
0000e880  2d 31 20 8c 0d 07 57 1f  20 20 20 20 20 20 74 65  |-1 ...W.      te|
0000e890  6d 70 25 3d 5f 55 25 21  31 38 34 2b 6f 66 66 73  |mp%=_U%!184+offs|
0000e8a0  65 74 25 0d 07 58 37 20  20 20 20 20 20 74 65 6d  |et%..X7      tem|
0000e8b0  70 25 21 30 3d 30 3a f4  20 77 69 70 65 20 77 69  |p%!0=0:. wipe wi|
0000e8c0  6e 64 6f 77 20 68 61 6e  64 6c 65 20 69 6e 20 73  |ndow handle in s|
0000e8d0  74 61 74 69 63 20 6c 69  73 74 0d 07 59 09 20 20  |tatic list..Y.  |
0000e8e0  20 20 cd 0d 07 5a 2e 20  20 20 20 f4 20 61 6e 64  |  ...Z.    . and|
0000e8f0  20 6e 6f 77 20 61 63 74  75 61 6c 6c 79 20 64 65  | now actually de|
0000e900  6c 65 74 65 20 74 68 65  20 77 69 6e 64 6f 77 2e  |lete the window.|
0000e910  2e 0d 07 5b 1a 20 20 20  20 77 69 6e 5f 62 6c 6b  |...[.    win_blk|
0000e920  25 21 30 3d 68 61 6e 64  6c 65 25 0d 07 5c 28 20  |%!0=handle%..\( |
0000e930  20 20 20 c8 99 20 22 57  69 6d 70 5f 44 65 6c 65  |   .. "Wimp_Dele|
0000e940  74 65 57 69 6e 64 6f 77  22 2c 2c 77 69 6e 5f 62  |teWindow",,win_b|
0000e950  6c 6b 25 0d 07 5d 11 20  20 20 20 68 61 6e 64 6c  |lk%..].    handl|
0000e960  65 25 3d 30 0d 07 5e 07  20 20 cd 0d 07 5f 05 cd  |e%=0..^.  ..._..|
0000e970  0d 07 60 24 f2 73 68 65  6c 6c 5f 48 65 61 70 42  |..`$.shell_HeapB|
0000e980  6c 6f 63 6b 52 65 74 75  72 6e 28 77 69 6e 5f 62  |lockReturn(win_b|
0000e990  6c 6b 25 29 0d 07 61 0c  3d 68 61 6e 64 6c 65 25  |lk%)..a.=handle%|
0000e9a0  0d 07 62 05 3a 0d 07 63  1f 2a 7c 53 74 6f 70 20  |..b.:..c.*|Stop |
0000e9b0  46 4e 73 68 65 6c 6c 5f  44 65 6c 65 74 65 57 69  |FNshell_DeleteWi|
0000e9c0  6e 64 6f 77 0d 07 64 19  2a 7c 53 74 61 72 74 20  |ndow..d.*|Start |
0000e9d0  46 4e 6f 6b 74 6f 64 65  6c 65 74 65 77 0d 07 65  |FNoktodeletew..e|
0000e9e0  1b dd 20 a4 6f 6b 74 6f  64 65 6c 65 74 65 77 28  |.. .oktodeletew(|
0000e9f0  68 61 6e 64 6c 65 25 29  0d 07 66 07 3d 2d 31 0d  |handle%)..f.=-1.|
0000ea00  07 67 05 3a 0d 07 68 18  2a 7c 53 74 6f 70 20 46  |.g.:..h.*|Stop F|
0000ea10  4e 6f 6b 74 6f 64 65 6c  65 74 65 77 0d 07 69 18  |Noktodeletew..i.|
0000ea20  2a 7c 53 74 61 72 74 20  46 4e 6f 6b 74 6f 63 6c  |*|Start FNoktocl|
0000ea30  6f 73 65 77 0d 07 6a 1a  dd 20 a4 6f 6b 74 6f 63  |osew..j.. .oktoc|
0000ea40  6c 6f 73 65 77 28 68 61  6e 64 6c 65 25 29 0d 07  |losew(handle%)..|
0000ea50  6b 07 3d 2d 31 0d 07 6c  05 3a 0d 07 6d 17 2a 7c  |k.=-1..l.:..m.*||
0000ea60  53 74 6f 70 20 46 4e 6f  6b 74 6f 63 6c 6f 73 65  |Stop FNoktoclose|
0000ea70  77 0d 07 6e 18 2a 7c 53  74 61 72 74 20 50 52 4f  |w..n.*|Start PRO|
0000ea80  43 63 6c 69 70 72 65 63  74 0d 07 6f 2a dd 20 f2  |Ccliprect..o*. .|
0000ea90  63 6c 69 70 72 65 63 74  28 62 2c f8 20 78 31 25  |cliprect(b,. x1%|
0000eaa0  2c f8 20 79 31 25 2c f8  20 78 32 25 2c f8 20 79  |,. y1%,. x2%,. y|
0000eab0  32 25 29 0d 07 70 0d ea  20 78 30 25 2c 79 30 25  |2%)..p.. x0%,y0%|
0000eac0  0d 07 71 40 f2 6c 77 61  6f 72 69 67 69 6e 28 62  |..q@.lwaorigin(b|
0000ead0  2c 78 30 25 2c 79 30 25  29 3a 78 31 25 3d 62 21  |,x0%,y0%):x1%=b!|
0000eae0  32 34 2d 78 30 25 3a 79  31 25 3d 62 21 32 38 2d  |24-x0%:y1%=b!28-|
0000eaf0  79 30 25 3a 78 32 25 3d  62 21 33 32 2d 78 30 25  |y0%:x2%=b!32-x0%|
0000eb00  0d 07 72 10 79 32 25 3d  62 21 33 36 2d 79 30 25  |..r.y2%=b!36-y0%|
0000eb10  0d 07 73 05 e1 0d 07 74  05 3a 0d 07 75 17 2a 7c  |..s....t.:..u.*||
0000eb20  53 74 6f 70 20 50 52 4f  43 63 6c 69 70 72 65 63  |Stop PROCcliprec|
0000eb30  74 0d 07 76 04 0d 07 77  12 2a 7c 53 74 61 72 74  |t..v...w.*|Start|
0000eb40  20 46 4e 70 6f 6c 6c 0d  07 78 18 dd 20 a4 70 6f  | FNpoll..x.. .po|
0000eb50  6c 6c 28 6d 61 73 6b 25  2c 74 61 73 6b 25 29 0d  |ll(mask%,task%).|
0000eb60  07 79 2d e7 20 5f 55 25  21 31 30 30 20 80 20 31  |.y-. _U%!100 . 1|
0000eb70  20 3c 3c 20 36 20 8c 20  c8 99 20 22 57 69 6d 70  | << 6 . .. "Wimp|
0000eb80  45 78 74 5f 50 72 65 50  6f 6c 6c 22 0d 07 7a 21  |Ext_PrePoll"..z!|
0000eb90  c8 99 20 22 57 69 6d 70  5f 50 6f 6c 6c 22 2c 6d  |.. "Wimp_Poll",m|
0000eba0  61 73 6b 25 2c 5f 51 25  20 b8 20 61 25 0d 07 7b  |ask%,_Q% . a%..{|
0000ebb0  3b e7 20 5f 55 25 21 31  30 30 20 80 20 31 20 3c  |;. _U%!100 . 1 <|
0000ebc0  3c 20 36 20 8c 20 c8 99  20 22 57 69 6d 70 45 78  |< 6 . .. "WimpEx|
0000ebd0  74 5f 41 63 74 69 6f 6e  22 2c 5f 55 25 21 31 34  |t_Action",_U%!14|
0000ebe0  38 2c 5f 51 25 2c 61 25  0d 07 7c 07 3d 61 25 0d  |8,_Q%,a%..|.=a%.|
0000ebf0  07 7d 05 3a 0d 07 7e 11  2a 7c 53 74 6f 70 20 46  |.}.:..~.*|Stop F|
0000ec00  4e 70 6f 6c 6c 0d 07 7f  04 0d 07 80 1a 2a 7c 53  |Npoll........*|S|
0000ec10  74 61 72 74 20 46 4e 73  68 65 6c 6c 5f 50 6f 6c  |tart FNshell_Pol|
0000ec20  6c 5f 49 0d 07 81 20 dd  20 a4 73 68 65 6c 6c 5f  |l_I... . .shell_|
0000ec30  50 6f 6c 6c 5f 49 28 6d  61 73 6b 25 2c 74 61 73  |Poll_I(mask%,tas|
0000ec40  6b 25 29 0d 07 82 2d e7  20 5f 55 25 21 31 30 30  |k%)...-. _U%!100|
0000ec50  20 80 20 31 20 3c 3c 20  36 20 8c 20 c8 99 20 22  | . 1 << 6 . .. "|
0000ec60  57 69 6d 70 45 78 74 5f  50 72 65 50 6f 6c 6c 22  |WimpExt_PrePoll"|
0000ec70  0d 07 83 21 c8 99 20 22  57 69 6d 70 5f 50 6f 6c  |...!.. "Wimp_Pol|
0000ec80  6c 22 2c 6d 61 73 6b 25  2c 5f 51 25 20 b8 20 61  |l",mask%,_Q% . a|
0000ec90  25 0d 07 84 3b e7 20 5f  55 25 21 31 30 30 20 80  |%...;. _U%!100 .|
0000eca0  20 31 20 3c 3c 20 36 20  8c 20 c8 99 20 22 57 69  | 1 << 6 . .. "Wi|
0000ecb0  6d 70 45 78 74 5f 41 63  74 69 6f 6e 22 2c 5f 55  |mpExt_Action",_U|
0000ecc0  25 21 31 34 38 2c 5f 51  25 2c 61 25 0d 07 85 21  |%!148,_Q%,a%...!|
0000ecd0  c8 99 20 22 49 6e 74 65  72 66 61 63 65 5f 50 6f  |.. "Interface_Po|
0000ece0  6c 6c 22 2c 61 25 2c 2c  74 61 73 6b 25 0d 07 86  |ll",a%,,task%...|
0000ecf0  07 3d 61 25 0d 07 87 05  3a 0d 07 88 19 2a 7c 53  |.=a%....:....*|S|
0000ed00  74 6f 70 20 46 4e 73 68  65 6c 6c 5f 50 6f 6c 6c  |top FNshell_Poll|
0000ed10  5f 49 0d 07 89 04 0d 07  8a 26 2a 7c 53 74 61 72  |_I.......&*|Star|
0000ed20  74 20 50 52 4f 43 73 68  65 6c 6c 5f 44 6f 42 61  |t PROCshell_DoBa|
0000ed30  63 6b 67 72 6f 75 6e 64  54 61 73 6b 0d 07 8b 1d  |ckgroundTask....|
0000ed40  dd 20 f2 73 68 65 6c 6c  5f 44 6f 42 61 63 6b 67  |. .shell_DoBackg|
0000ed50  72 6f 75 6e 64 54 61 73  6b 0d 07 8c 05 e1 0d 07  |roundTask.......|
0000ed60  8d 05 3a 0d 07 8e 25 2a  7c 53 74 6f 70 20 50 52  |..:...%*|Stop PR|
0000ed70  4f 43 73 68 65 6c 6c 5f  44 6f 42 61 63 6b 67 72  |OCshell_DoBackgr|
0000ed80  6f 75 6e 64 54 61 73 6b  0d 07 8f 04 0d 07 90 23  |oundTask.......#|
0000ed90  2a 7c 53 74 61 72 74 20  46 4e 73 68 65 6c 6c 5f  |*|Start FNshell_|
0000eda0  49 63 6f 6e 49 73 44 72  61 67 67 61 62 6c 65 0d  |IconIsDraggable.|
0000edb0  07 91 25 dd 20 a4 73 68  65 6c 6c 5f 49 63 6f 6e  |..%. .shell_Icon|
0000edc0  49 73 44 72 61 67 67 61  62 6c 65 28 77 68 25 2c  |IsDraggable(wh%,|
0000edd0  69 68 25 29 0d 07 92 0c  ea 20 66 6c 61 67 73 25  |ih%)..... flags%|
0000ede0  0d 07 93 27 66 6c 61 67  73 25 3d a4 73 68 65 6c  |...'flags%=.shel|
0000edf0  6c 5f 49 63 6f 6e 47 65  74 46 6c 61 67 73 28 77  |l_IconGetFlags(w|
0000ee00  68 25 2c 69 68 25 29 0d  07 94 1a 74 65 6d 70 25  |h%,ih%)....temp%|
0000ee10  3d 28 66 6c 61 67 73 25  20 80 20 26 36 30 30 30  |=(flags% . &6000|
0000ee20  29 0d 07 95 19 e7 20 74  65 6d 70 25 3d 26 36 30  |)..... temp%=&60|
0000ee30  30 30 20 3d b9 20 8b 20  3d a3 0d 07 96 05 3a 0d  |00 =. . =.....:.|
0000ee40  07 97 22 2a 7c 53 74 6f  70 20 46 4e 73 68 65 6c  |.."*|Stop FNshel|
0000ee50  6c 5f 49 63 6f 6e 49 73  44 72 61 67 67 61 62 6c  |l_IconIsDraggabl|
0000ee60  65 0d 07 98 04 0d 07 99  20 2a 7c 53 74 61 72 74  |e....... *|Start|
0000ee70  20 46 4e 73 68 65 6c 6c  5f 49 63 6f 6e 49 73 53  | FNshell_IconIsS|
0000ee80  70 72 69 74 65 0d 07 9a  22 dd 20 a4 73 68 65 6c  |prite...". .shel|
0000ee90  6c 5f 49 63 6f 6e 49 73  53 70 72 69 74 65 28 77  |l_IconIsSprite(w|
0000eea0  68 25 2c 69 68 25 29 0d  07 9b 12 ea 20 66 6c 61  |h%,ih%)..... fla|
0000eeb0  67 73 25 2c 74 65 6d 70  25 0d 07 9c 27 66 6c 61  |gs%,temp%...'fla|
0000eec0  67 73 25 3d a4 73 68 65  6c 6c 5f 49 63 6f 6e 47  |gs%=.shell_IconG|
0000eed0  65 74 46 6c 61 67 73 28  77 68 25 2c 69 68 25 29  |etFlags(wh%,ih%)|
0000eee0  0d 07 9d 19 74 65 6d 70  25 3d 28 66 6c 61 67 73  |....temp%=(flags|
0000eef0  25 20 80 20 31 3c 3c 31  29 0d 07 9e 1c e7 20 74  |% . 1<<1)..... t|
0000ef00  65 6d 70 25 3d 28 31 3c  3c 31 29 20 8c 20 3d b9  |emp%=(1<<1) . =.|
0000ef10  20 8b 20 3d a3 0d 07 9f  05 3a 0d 07 a0 1f 2a 7c  | . =.....:....*||
0000ef20  53 74 6f 70 20 46 4e 73  68 65 6c 6c 5f 49 63 6f  |Stop FNshell_Ico|
0000ef30  6e 49 73 53 70 72 69 74  65 0d 07 a1 04 0d 07 a2  |nIsSprite.......|
0000ef40  21 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |!*|Start PROCshe|
0000ef50  6c 6c 5f 49 63 6f 6e 44  72 61 67 42 6f 78 0d 07  |ll_IconDragBox..|
0000ef60  a3 21 dd 20 f2 73 68 65  6c 6c 5f 49 63 6f 6e 44  |.!. .shell_IconD|
0000ef70  72 61 67 42 6f 78 28 77  68 25 2c 69 68 25 29 0d  |ragBox(wh%,ih%).|
0000ef80  07 a4 49 ea 20 62 6c 6b  25 2c 77 65 78 2c 77 65  |..I. blk%,wex,we|
0000ef90  79 2c 65 5f 6f 66 66 73  65 74 25 2c 66 6c 61 67  |y,e_offset%,flag|
0000efa0  73 25 2c 66 25 2c 44 72  61 67 41 53 70 72 69 74  |s%,f%,DragASprit|
0000efb0  65 25 2c 73 70 72 5f 61  72 65 61 25 2c 76 61 6c  |e%,spr_area%,val|
0000efc0  69 64 25 2c 73 70 72 24  0d 07 a5 14 ea 20 6e 61  |id%,spr$..... na|
0000efd0  6d 65 5f 69 63 25 2c 6e  61 6d 65 24 0d 07 a6 44  |me_ic%,name$...D|
0000efe0  f4 20 63 68 65 63 6b 20  69 66 20 61 6e 20 65 76  |. check if an ev|
0000eff0  65 6e 74 20 68 61 73 20  62 65 65 6e 20 72 65 67  |ent has been reg|
0000f000  69 73 74 65 72 65 64 20  66 6f 72 20 77 68 65 6e  |istered for when|
0000f010  20 74 68 65 20 64 72 61  67 20 65 6e 64 73 2e 2e  | the drag ends..|
0000f020  0d 07 a7 40 65 5f 6f 66  66 73 65 74 25 20 3d 20  |...@e_offset% = |
0000f030  a4 73 68 65 6c 6c 5f 47  65 74 45 76 65 6e 74 4c  |.shell_GetEventL|
0000f040  69 73 74 4f 66 66 73 65  74 28 77 68 25 2c 69 68  |istOffset(wh%,ih|
0000f050  25 2c 5f 55 25 20 2b 20  37 32 2c 32 34 2c a3 29  |%,_U% + 72,24,.)|
0000f060  0d 07 a8 16 e7 20 65 5f  6f 66 66 73 65 74 25 20  |..... e_offset% |
0000f070  3e 3d 20 30 20 8c 0d 07  a9 4d 20 20 f4 20 69 74  |>= 0 ....M  . it|
0000f080  20 68 61 73 2c 20 73 6f  20 67 6f 20 61 68 65 61  | has, so go ahea|
0000f090  64 20 61 6e 64 20 61 6c  6c 6f 77 20 74 68 65 20  |d and allow the |
0000f0a0  64 72 61 67 2c 20 62 75  74 20 66 69 72 73 74 20  |drag, but first |
0000f0b0  63 68 65 63 6b 20 69 66  20 61 20 66 69 6c 65 6e  |check if a filen|
0000f0c0  61 6d 65 0d 07 aa 29 20  20 f4 20 69 73 20 70 72  |ame...)  . is pr|
0000f0d0  65 73 65 6e 74 20 69 6e  20 74 68 65 20 66 69 6c  |esent in the fil|
0000f0e0  65 6e 61 6d 65 20 69 63  6f 6e 2e 2e 0d 07 ab 1b  |ename icon......|
0000f0f0  20 20 62 6c 6b 25 3d 5f  55 25 21 37 32 2b 65 5f  |  blk%=_U%!72+e_|
0000f100  6f 66 66 73 65 74 25 0d  07 ac 16 20 20 6e 61 6d  |offset%....  nam|
0000f110  65 5f 69 63 25 3d 62 6c  6b 25 21 31 36 0d 07 ad  |e_ic%=blk%!16...|
0000f120  2c 20 20 6e 61 6d 65 24  3d a4 73 68 65 6c 6c 5f  |,  name$=.shell_|
0000f130  49 63 6f 6e 47 65 74 44  61 74 61 28 77 68 25 2c  |IconGetData(wh%,|
0000f140  6e 61 6d 65 5f 69 63 25  29 0d 07 ae 40 20 20 e7  |name_ic%)...@  .|
0000f150  20 6e 61 6d 65 24 3d 22  22 20 8c 20 f2 73 68 65  | name$="" . .she|
0000f160  6c 6c 5f 4f 4b 28 a4 73  68 65 6c 6c 5f 4d 65 73  |ll_OK(.shell_Mes|
0000f170  73 61 67 65 4e 6f 41 72  67 73 28 22 53 48 45 4c  |sageNoArgs("SHEL|
0000f180  4c 4d 53 47 32 38 22 29  29 0d 07 af 4b 20 20 62  |LMSG28"))...K  b|
0000f190  6c 6b 25 3d a4 73 68 65  6c 6c 5f 48 65 61 70 42  |lk%=.shell_HeapB|
0000f1a0  6c 6f 63 6b 46 65 74 63  68 28 31 30 30 20 2b 20  |lockFetch(100 + |
0000f1b0  28 a4 73 68 65 6c 6c 5f  57 69 6e 64 6f 77 43 6f  |(.shell_WindowCo|
0000f1c0  75 6e 74 49 63 6f 6e 73  28 77 68 25 29 20 2a 20  |untIcons(wh%) * |
0000f1d0  33 32 29 29 0d 07 b0 0f  20 20 21 62 6c 6b 25 3d  |32))....  !blk%=|
0000f1e0  77 68 25 0d 07 b1 23 20  20 c8 99 20 22 57 69 6d  |wh%...#  .. "Wim|
0000f1f0  70 5f 47 65 74 57 69 6e  64 6f 77 49 6e 66 6f 22  |p_GetWindowInfo"|
0000f200  2c 2c 62 6c 6b 25 0d 07  b2 34 20 20 77 65 78 20  |,,blk%...4  wex |
0000f210  3d 20 62 6c 6b 25 21 34  20 2d 20 62 6c 6b 25 21  |= blk%!4 - blk%!|
0000f220  32 30 3a 77 65 79 20 3d  20 62 6c 6b 25 21 31 36  |20:wey = blk%!16|
0000f230  20 2d 20 62 6c 6b 25 21  32 34 0d 07 b3 19 20 20  | - blk%!24....  |
0000f240  73 70 72 5f 61 72 65 61  25 20 3d 20 62 6c 6b 25  |spr_area% = blk%|
0000f250  21 36 38 0d 07 b4 12 20  20 62 6c 6b 25 21 34 20  |!68....  blk%!4 |
0000f260  3d 20 69 68 25 0d 07 b5  22 20 20 c8 99 20 22 57  |= ih%..."  .. "W|
0000f270  69 6d 70 5f 47 65 74 49  63 6f 6e 53 74 61 74 65  |imp_GetIconState|
0000f280  22 2c 2c 62 6c 6b 25 0d  07 b6 36 20 20 21 62 6c  |",,blk%...6  !bl|
0000f290  6b 25 3d 77 68 25 3a 62  6c 6b 25 21 34 3d 35 3a  |k%=wh%:blk%!4=5:|
0000f2a0  66 6c 61 67 73 25 3d 62  6c 6b 25 21 32 34 3a 76  |flags%=blk%!24:v|
0000f2b0  61 6c 69 64 25 3d 62 6c  6b 25 21 33 32 0d 07 b7  |alid%=blk%!32...|
0000f2c0  1d 20 20 62 6c 6b 25 21  30 38 20 3d 20 62 6c 6b  |.  blk%!08 = blk|
0000f2d0  25 21 30 38 20 2b 20 77  65 78 0d 07 b8 1d 20 20  |%!08 + wex....  |
0000f2e0  62 6c 6b 25 21 31 32 20  3d 20 62 6c 6b 25 21 31  |blk%!12 = blk%!1|
0000f2f0  32 20 2b 20 77 65 79 0d  07 b9 1d 20 20 62 6c 6b  |2 + wey....  blk|
0000f300  25 21 31 36 20 3d 20 62  6c 6b 25 21 31 36 20 2b  |%!16 = blk%!16 +|
0000f310  20 77 65 78 0d 07 ba 1d  20 20 62 6c 6b 25 21 32  | wex....  blk%!2|
0000f320  30 20 3d 20 62 6c 6b 25  21 32 30 20 2b 20 77 65  |0 = blk%!20 + we|
0000f330  79 0d 07 bb 1d 20 20 62  6c 6b 25 21 32 34 20 3d  |y....  blk%!24 =|
0000f340  20 30 3a 62 6c 6b 25 21  32 38 20 3d 20 30 0d 07  | 0:blk%!28 = 0..|
0000f350  bc 19 20 20 62 6c 6b 25  21 33 32 20 3d 20 26 37  |..  blk%!32 = &7|
0000f360  46 46 46 46 46 46 46 0d  07 bd 19 20 20 62 6c 6b  |FFFFFFF....  blk|
0000f370  25 21 33 36 20 3d 20 26  37 46 46 46 46 46 46 46  |%!36 = &7FFFFFFF|
0000f380  0d 07 be 2b 20 20 f4 20  63 68 65 63 6b 20 64 72  |...+  . check dr|
0000f390  61 67 61 73 70 72 69 74  65 20 62 69 74 20 69 6e  |agasprite bit in|
0000f3a0  20 43 4d 4f 53 20 52 41  4d 2e 2e 0d 07 bf 20 20  | CMOS RAM.....  |
0000f3b0  20 c8 99 20 22 4f 53 5f  42 79 74 65 22 2c 31 36  | .. "OS_Byte",16|
0000f3c0  31 2c 32 38 20 b8 20 2c  2c 66 25 0d 07 c0 23 20  |1,28 . ,,f%...# |
0000f3d0  20 44 72 61 67 41 53 70  72 69 74 65 25 20 3d 20  | DragASprite% = |
0000f3e0  28 28 66 25 20 80 20 32  29 20 3d 20 32 29 0d 07  |((f% . 2) = 2)..|
0000f3f0  c1 16 20 20 e7 20 44 72  61 67 41 53 70 72 69 74  |..  . DragASprit|
0000f400  65 25 20 8c 0d 07 c2 13  20 20 20 20 66 25 20 3d  |e% .....    f% =|
0000f410  20 66 6c 61 67 73 25 0d  07 c3 17 20 20 20 20 e7  | flags%....    .|
0000f420  20 28 66 25 20 80 20 26  31 30 30 29 20 8c 0d 07  | (f% . &100) ...|
0000f430  c4 32 20 20 20 20 20 20  73 70 72 24 20 3d 20 a4  |.2      spr$ = .|
0000f440  73 68 65 6c 6c 5f 49 63  6f 6e 47 65 74 43 6f 6d  |shell_IconGetCom|
0000f450  6d 61 6e 64 28 76 61 6c  69 64 25 2c 22 73 22 29  |mand(valid%,"s")|
0000f460  0d 07 c5 09 20 20 20 20  cd 0d 07 c6 46 20 20 20  |....    ....F   |
0000f470  20 e7 20 28 66 25 20 80  20 32 29 20 3d 20 30 20  | . (f% . 2) = 0 |
0000f480  8c 20 f2 73 68 65 6c 6c  5f 4f 4b 28 a4 73 68 65  |. .shell_OK(.she|
0000f490  6c 6c 5f 4d 65 73 73 61  67 65 4e 6f 41 72 67 73  |ll_MessageNoArgs|
0000f4a0  28 22 53 48 45 4c 4c 4d  53 47 31 39 22 29 29 0d  |("SHELLMSG19")).|
0000f4b0  07 c7 16 20 20 20 20 e7  20 73 70 72 24 20 3c 3e  |...    . spr$ <>|
0000f4c0  20 22 22 20 8c 0d 07 c8  42 20 20 20 20 20 20 c8  | "" ....B      .|
0000f4d0  99 20 22 44 72 61 67 41  53 70 72 69 74 65 5f 53  |. "DragASprite_S|
0000f4e0  74 61 72 74 22 2c 25 31  30 30 30 30 31 30 31 2c  |tart",%10000101,|
0000f4f0  73 70 72 5f 61 72 65 61  25 2c 73 70 72 24 2c 62  |spr_area%,spr$,b|
0000f500  6c 6b 25 20 2b 20 38 0d  07 c9 3a 20 20 20 20 20  |lk% + 8...:     |
0000f510  20 5f 55 25 21 31 30 30  20 3d 20 5f 55 25 21 31  | _U%!100 = _U%!1|
0000f520  30 30 20 84 20 31 3a f4  20 73 65 74 20 27 64 72  |00 . 1:. set 'dr|
0000f530  61 67 61 73 70 72 69 74  65 27 20 66 6c 61 67 2e  |agasprite' flag.|
0000f540  2e 0d 07 ca 09 20 20 20  20 cc 0d 07 cb 21 20 20  |.....    ....!  |
0000f550  20 20 20 20 c8 99 20 22  57 69 6d 70 5f 44 72 61  |    .. "Wimp_Dra|
0000f560  67 42 6f 78 22 2c 2c 62  6c 6b 25 0d 07 cc 09 20  |gBox",,blk%.... |
0000f570  20 20 20 cd 0d 07 cd 07  20 20 cc 0d 07 ce 1f 20  |   .....  ..... |
0000f580  20 20 20 c8 99 20 22 57  69 6d 70 5f 44 72 61 67  |   .. "Wimp_Drag|
0000f590  42 6f 78 22 2c 2c 62 6c  6b 25 0d 07 cf 07 20 20  |Box",,blk%....  |
0000f5a0  cd 0d 07 d0 22 20 20 f2  73 68 65 6c 6c 5f 48 65  |...."  .shell_He|
0000f5b0  61 70 42 6c 6f 63 6b 52  65 74 75 72 6e 28 62 6c  |apBlockReturn(bl|
0000f5c0  6b 25 29 0d 07 d1 05 cc  0d 07 d2 15 2a 7c 69 66  |k%).........*|if|
0000f5d0  64 65 66 20 54 72 61 63  65 49 6e 69 74 0d 07 d3  |def TraceInit...|
0000f5e0  5b 20 20 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |[  .shell_Tracef|
0000f5f0  30 28 22 49 63 6f 6e 44  72 61 67 42 6f 78 3a 57  |0("IconDragBox:W|
0000f600  41 52 4e 49 4e 47 21 20  6e 6f 20 75 73 65 72 20  |ARNING! no user |
0000f610  64 72 61 67 20 68 61 6e  64 6c 65 72 20 72 65 67  |drag handler reg|
0000f620  69 73 74 65 72 65 64 20  66 6f 72 20 74 68 69 73  |istered for this|
0000f630  20 69 63 6f 6e 21 22 29  0d 07 d4 4a 20 20 f2 73  | icon!")...J  .s|
0000f640  68 65 6c 6c 5f 54 72 61  63 65 66 30 28 22 49 63  |hell_Tracef0("Ic|
0000f650  6f 6e 44 72 61 67 42 6f  78 3a 6e 6f 77 20 63 68  |onDragBox:now ch|
0000f660  65 63 6b 69 6e 67 20 66  6f 72 20 61 20 73 6c 69  |ecking for a sli|
0000f670  64 65 72 20 64 72 61 67  20 65 76 65 6e 74 2e 2e  |der drag event..|
0000f680  22 29 0d 07 d5 0b 2a 7c  65 6e 64 69 66 0d 07 d6  |")....*|endif...|
0000f690  44 20 20 65 5f 6f 66 66  73 65 74 25 20 3d 20 a4  |D  e_offset% = .|
0000f6a0  73 68 65 6c 6c 5f 47 65  74 45 76 65 6e 74 4c 69  |shell_GetEventLi|
0000f6b0  73 74 4f 66 66 73 65 74  32 28 77 68 25 2c 69 68  |stOffset2(wh%,ih|
0000f6c0  25 2c 5f 55 25 20 2b 20  33 33 32 2c 33 32 2c a3  |%,_U% + 332,32,.|
0000f6d0  29 0d 07 d7 41 20 20 f2  73 68 65 6c 6c 5f 54 72  |)...A  .shell_Tr|
0000f6e0  61 63 65 66 30 28 22 49  63 6f 6e 44 72 61 67 42  |acef0("IconDragB|
0000f6f0  6f 78 3a 65 76 65 6e 74  20 6f 66 66 73 65 74 20  |ox:event offset |
0000f700  69 73 20 22 20 2b 20 c3  65 5f 6f 66 66 73 65 74  |is " + .e_offset|
0000f710  25 29 0d 07 d8 3f 20 20  e7 20 65 5f 6f 66 66 73  |%)...?  . e_offs|
0000f720  65 74 25 20 3e 3d 20 30  20 8c 20 f2 73 68 65 6c  |et% >= 0 . .shel|
0000f730  6c 5f 48 61 6e 64 6c 65  53 6c 69 64 65 72 28 77  |l_HandleSlider(w|
0000f740  68 25 2c 69 68 25 2c 65  5f 6f 66 66 73 65 74 25  |h%,ih%,e_offset%|
0000f750  29 0d 07 d9 05 cd 0d 07  da 05 e1 0d 07 db 05 3a  |)..............:|
0000f760  0d 07 dc 20 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |... *|Stop PROCs|
0000f770  68 65 6c 6c 5f 49 63 6f  6e 44 72 61 67 42 6f 78  |hell_IconDragBox|
0000f780  0d 07 dd 04 0d 07 de 28  2a 7c 53 74 61 72 74 20  |.......(*|Start |
0000f790  50 52 4f 43 73 68 65 6c  6c 5f 48 61 6e 64 6c 65  |PROCshell_Handle|
0000f7a0  41 74 74 61 63 68 65 64  4d 65 6e 75 0d 07 df 2c  |AttachedMenu...,|
0000f7b0  dd 20 f2 73 68 65 6c 6c  5f 48 61 6e 64 6c 65 41  |. .shell_HandleA|
0000f7c0  74 74 61 63 68 65 64 4d  65 6e 75 28 5f 51 25 2c  |ttachedMenu(_Q%,|
0000f7d0  77 68 25 2c 69 68 25 29  0d 07 e0 0b ea 20 6d 65  |wh%,ih%)..... me|
0000f7e0  6e 75 25 0d 07 e1 07 ea  20 85 0d 07 e2 0f ee 20  |nu%..... ...... |
0000f7f0  85 20 ea 3a f7 20 85 3a  e1 0d 07 e3 43 f4 20 4f  |. .:. .:....C. O|
0000f800  6e 6c 79 20 65 78 65 63  75 74 65 64 20 77 68 65  |nly executed whe|
0000f810  6e 20 53 45 4c 45 43 54  20 69 73 20 70 72 65 73  |n SELECT is pres|
0000f820  73 65 64 20 6f 76 65 72  20 61 6e 20 69 63 6f 6e  |sed over an icon|
0000f830  20 74 68 61 74 20 68 61  73 20 61 6e 0d 07 e4 15  | that has an....|
0000f840  f4 20 61 74 74 61 63 68  65 64 20 6d 65 6e 75 2e  |. attached menu.|
0000f850  2e 0d 07 e5 1c e7 20 69  68 25 20 3c 3e 20 2d 31  |...... ih% <> -1|
0000f860  20 80 20 77 68 25 20 3e  20 2d 31 20 8c 0d 07 e6  | . wh% > -1 ....|
0000f870  30 20 20 6d 65 6e 75 25  20 3d 20 a4 73 68 65 6c  |0  menu% = .shel|
0000f880  6c 5f 47 65 74 45 76 65  6e 74 4d 65 6e 75 28 5f  |l_GetEventMenu(_|
0000f890  51 25 21 38 2c 77 68 25  2c 69 68 25 29 0d 07 e7  |Q%!8,wh%,ih%)...|
0000f8a0  14 20 20 e7 20 6d 65 6e  75 25 20 3c 3e 20 30 20  |.  . menu% <> 0 |
0000f8b0  8c 0d 07 e8 32 20 20 20  20 f2 73 68 65 6c 6c 5f  |....2    .shell_|
0000f8c0  48 61 6e 64 6c 65 4d 65  6e 75 4f 70 65 6e 28 5f  |HandleMenuOpen(_|
0000f8d0  51 25 2c 6d 65 6e 75 25  2c 77 68 25 2c 69 68 25  |Q%,menu%,wh%,ih%|
0000f8e0  2c b9 29 0d 07 e9 07 20  20 cd 0d 07 ea 05 cd 0d  |,.)....  .......|
0000f8f0  07 eb 05 e1 0d 07 ec 05  3a 0d 07 ed 27 2a 7c 53  |........:...'*|S|
0000f900  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 48 61  |top PROCshell_Ha|
0000f910  6e 64 6c 65 41 74 74 61  63 68 65 64 4d 65 6e 75  |ndleAttachedMenu|
0000f920  0d 07 ee 04 0d 07 ef 1c  2a 7c 53 74 61 72 74 20  |........*|Start |
0000f930  50 52 4f 43 73 68 65 6c  6c 5f 41 63 74 69 6f 6e  |PROCshell_Action|
0000f940  0d 07 f0 1a dd 20 f2 73  68 65 6c 6c 5f 41 63 74  |..... .shell_Act|
0000f950  69 6f 6e 28 65 76 6e 74  25 29 0d 07 f1 3b ea 20  |ion(evnt%)...;. |
0000f960  66 6e 24 2c 6d 65 6e 75  25 2c 6d 65 6e 75 24 2c  |fn$,menu%,menu$,|
0000f970  73 65 6c 65 63 74 24 2c  6d 65 6e 75 5f 62 75 66  |select$,menu_buf|
0000f980  66 65 72 25 2c 6d 78 25  2c 6d 79 25 2c 63 6c 61  |fer%,mx%,my%,cla|
0000f990  69 6d 65 64 25 0d 07 f2  43 ea 20 77 68 25 2c 69  |imed%...C. wh%,i|
0000f9a0  68 25 2c 76 6f 69 64 25  2c 5f 74 65 6d 70 32 38  |h%,void%,_temp28|
0000f9b0  25 2c 5f 74 65 6d 70 33  32 25 2c 5f 74 65 6d 70  |%,_temp32%,_temp|
0000f9c0  32 34 25 2c 5f 74 65 6d  70 25 2c 66 6f 6e 74 6d  |24%,_temp%,fontm|
0000f9d0  65 6e 75 66 6c 61 67 25  0d 07 f3 1a ea 20 43 68  |enuflag%..... Ch|
0000f9e0  65 63 6b 53 65 6c 65 63  74 25 2c 6f 66 66 73 65  |eckSelect%,offse|
0000f9f0  74 25 0d 07 f4 0e c8 8e  20 65 76 6e 74 25 20 ca  |t%...... evnt% .|
0000fa00  0d 07 f5 21 20 20 c9 20  30 3a f2 73 68 65 6c 6c  |...!  . 0:.shell|
0000fa10  5f 44 6f 42 61 63 6b 67  72 6f 75 6e 64 54 61 73  |_DoBackgroundTas|
0000fa20  6b 0d 07 f6 24 20 20 20  20 20 20 20 20 20 e7 20  |k...$         . |
0000fa30  28 5f 55 25 21 31 30 30  20 80 20 31 20 3c 3c 20  |(_U%!100 . 1 << |
0000fa40  31 31 29 20 8c 0d 07 f7  1c 20 20 20 20 20 20 20  |11) .....       |
0000fa50  20 20 20 20 f2 73 68 65  6c 6c 5f 53 6c 69 64 65  |    .shell_Slide|
0000fa60  72 0d 07 f8 0e 20 20 20  20 20 20 20 20 20 cd 0d  |r....         ..|
0000fa70  07 f9 24 20 20 c9 20 31  3a f2 73 68 65 6c 6c 5f  |..$  . 1:.shell_|
0000fa80  52 65 64 72 61 77 57 69  6e 64 6f 77 28 5f 51 25  |RedrawWindow(_Q%|
0000fa90  21 30 29 0d 07 fa 26 20  20 c9 20 32 3a f2 73 68  |!0)...&  . 2:.sh|
0000faa0  65 6c 6c 5f 4f 70 65 6e  57 69 6e 64 6f 77 28 5f  |ell_OpenWindow(_|
0000fab0  51 25 21 30 2c b9 2c 30  29 0d 07 fb 23 20 20 c9  |Q%!0,.,0)...#  .|
0000fac0  20 33 3a f2 73 68 65 6c  6c 5f 43 6c 6f 73 65 57  | 3:.shell_CloseW|
0000fad0  69 6e 64 6f 77 28 5f 51  25 21 30 29 0d 07 fc 2a  |indow(_Q%!0)...*|
0000fae0  2a 7c 69 66 64 65 66 20  50 52 4f 43 73 68 65 6c  |*|ifdef PROCshel|
0000faf0  6c 5f 50 6f 69 6e 74 65  72 4c 65 61 76 69 6e 67  |l_PointerLeaving|
0000fb00  57 69 6e 64 6f 77 0d 07  fd 2a 20 20 c9 20 34 3a  |Window...*  . 4:|
0000fb10  f2 73 68 65 6c 6c 5f 50  6f 69 6e 74 65 72 4c 65  |.shell_PointerLe|
0000fb20  61 76 69 6e 67 57 69 6e  64 6f 77 28 5f 51 25 29  |avingWindow(_Q%)|
0000fb30  0d 07 fe 0b 2a 7c 65 6e  64 69 66 0d 07 ff 2b 2a  |....*|endif...+*|
0000fb40  7c 69 66 64 65 66 20 50  52 4f 43 73 68 65 6c 6c  ||ifdef PROCshell|
0000fb50  5f 50 6f 69 6e 74 65 72  45 6e 74 65 72 69 6e 67  |_PointerEntering|
0000fb60  57 69 6e 64 6f 77 0d 08  00 2b 20 20 c9 20 35 3a  |Window...+  . 5:|
0000fb70  f2 73 68 65 6c 6c 5f 50  6f 69 6e 74 65 72 45 6e  |.shell_PointerEn|
0000fb80  74 65 72 69 6e 67 57 69  6e 64 6f 77 28 5f 51 25  |teringWindow(_Q%|
0000fb90  29 0d 08 01 0b 2a 7c 65  6e 64 69 66 0d 08 02 39  |)....*|endif...9|
0000fba0  20 20 c9 20 36 3a 5f 55  25 21 32 38 3d 5f 51 25  |  . 6:_U%!28=_Q%|
0000fbb0  21 31 32 3a 5f 55 25 21  33 32 3d 5f 51 25 21 31  |!12:_U%!32=_Q%!1|
0000fbc0  36 3a 6d 78 25 3d 5f 51  25 21 30 3a 6d 79 25 3d  |6:mx%=_Q%!0:my%=|
0000fbd0  5f 51 25 21 34 0d 08 03  36 20 20 20 20 20 20 20  |_Q%!4...6       |
0000fbe0  20 20 5f 55 25 21 32 37  32 3d 5f 51 25 21 30 3a  |  _U%!272=_Q%!0:|
0000fbf0  5f 55 25 21 32 37 36 3d  5f 51 25 21 34 3a 5f 55  |_U%!276=_Q%!4:_U|
0000fc00  25 21 33 32 30 3d 5f 51  25 21 38 0d 08 04 37 20  |%!320=_Q%!8...7 |
0000fc10  20 20 20 20 20 20 20 20  5f 74 65 6d 70 32 38 25  |        _temp28%|
0000fc20  3d 5f 51 25 21 31 32 3a  5f 74 65 6d 70 33 32 25  |=_Q%!12:_temp32%|
0000fc30  3d 5f 51 25 21 31 36 3a  69 68 25 3d 5f 51 25 21  |=_Q%!16:ih%=_Q%!|
0000fc40  31 36 0d 08 05 15 2a 7c  69 66 64 65 66 20 54 72  |16....*|ifdef Tr|
0000fc50  61 63 65 49 6e 69 74 0d  08 06 40 20 20 20 20 20  |aceInit...@     |
0000fc60  20 20 20 20 f2 73 68 65  6c 6c 5f 54 72 61 63 65  |    .shell_Trace|
0000fc70  66 30 28 22 41 63 74 69  6f 6e 3a 4d 6f 75 73 65  |f0("Action:Mouse|
0000fc80  5f 43 6c 69 63 6b 20 65  76 65 6e 74 20 64 65 74  |_Click event det|
0000fc90  65 63 74 65 64 22 29 0d  08 07 5e 20 20 20 20 20  |ected")...^     |
0000fca0  20 20 20 20 f2 73 68 65  6c 6c 5f 54 72 61 63 65  |    .shell_Trace|
0000fcb0  66 30 28 22 41 63 74 69  6f 6e 3a 57 69 6e 64 6f  |f0("Action:Windo|
0000fcc0  77 20 48 61 6e 64 6c 65  20 77 61 73 20 26 22 2b  |w Handle was &"+|
0000fcd0  c3 7e 5f 51 25 21 31 32  2b 22 20 49 63 6f 6e 20  |.~_Q%!12+" Icon |
0000fce0  48 61 6e 64 6c 65 20 77  61 73 20 22 2b c3 5f 51  |Handle was "+._Q|
0000fcf0  25 21 31 36 29 0d 08 08  0b 2a 7c 65 6e 64 69 66  |%!16)....*|endif|
0000fd00  0d 08 09 30 20 20 20 20  20 20 20 20 20 e7 20 5f  |...0         . _|
0000fd10  51 25 21 31 32 3d 5f 55  25 21 32 38 38 20 80 20  |Q%!12=_U%!288 . |
0000fd20  5f 51 25 21 31 36 3d 5f  55 25 21 32 39 32 20 8c  |_Q%!16=_U%!292 .|
0000fd30  0d 08 0a 43 20 20 20 20  20 20 20 20 20 20 20 f4  |...C           .|
0000fd40  20 73 61 6d 65 20 69 63  6f 6e 20 70 72 65 73 73  | same icon press|
0000fd50  65 64 20 61 67 61 69 6e  2c 20 75 73 65 20 73 74  |ed again, use st|
0000fd60  6f 72 65 64 20 65 76 65  6e 74 20 6f 66 66 73 65  |ored event offse|
0000fd70  74 2e 2e 0d 08 0b 42 20  20 20 20 20 20 20 20 20  |t.....B         |
0000fd80  20 20 f2 73 68 65 6c 6c  5f 48 61 6e 64 6c 65 42  |  .shell_HandleB|
0000fd90  75 6d 70 49 63 6f 6e 73  28 5f 55 25 21 32 39 36  |umpIcons(_U%!296|
0000fda0  2c 5f 51 25 21 31 32 2c  5f 51 25 21 31 36 2c 5f  |,_Q%!12,_Q%!16,_|
0000fdb0  51 25 21 38 29 0d 08 0c  0e 20 20 20 20 20 20 20  |Q%!8)....       |
0000fdc0  20 20 cc 0d 08 0d 2f 20  20 20 20 20 20 20 20 20  |  ..../         |
0000fdd0  20 20 5f 55 25 21 32 38  38 3d 2d 31 3a 5f 55 25  |  _U%!288=-1:_U%|
0000fde0  21 32 39 32 3d 2d 31 3a  5f 55 25 21 32 39 36 3d  |!292=-1:_U%!296=|
0000fdf0  2d 31 0d 08 0e 1c 20 20  20 20 20 20 20 20 20 20  |-1....          |
0000fe00  20 e7 20 5f 51 25 21 31  36 3e 3d 30 20 8c 0d 08  | . _Q%!16>=0 ...|
0000fe10  0f 4f 20 20 20 20 20 20  20 20 20 20 20 20 20 6f  |.O             o|
0000fe20  66 66 73 65 74 25 3d a4  73 68 65 6c 6c 5f 47 65  |ffset%=.shell_Ge|
0000fe30  74 45 76 65 6e 74 4c 69  73 74 4f 66 66 73 65 74  |tEventListOffset|
0000fe40  32 28 5f 51 25 21 31 32  2c 5f 51 25 21 31 36 2c  |2(_Q%!12,_Q%!16,|
0000fe50  5f 55 25 2b 31 30 34 2c  31 36 2c 30 29 0d 08 10  |_U%+104,16,0)...|
0000fe60  48 20 20 20 20 20 20 20  20 20 20 20 20 20 f2 73  |H             .s|
0000fe70  68 65 6c 6c 5f 54 72 61  63 65 66 30 28 22 44 45  |hell_Tracef0("DE|
0000fe80  42 55 47 3a 3a 62 75 6d  70 20 65 76 65 6e 74 20  |BUG::bump event |
0000fe90  6f 66 66 73 65 74 20 69  73 20 22 2b c3 6f 66 66  |offset is "+.off|
0000fea0  73 65 74 25 29 0d 08 11  53 20 20 20 20 20 20 20  |set%)...S       |
0000feb0  20 20 20 20 20 20 e7 20  6f 66 66 73 65 74 25 3e  |      . offset%>|
0000fec0  3d 30 20 8c 20 f2 73 68  65 6c 6c 5f 48 61 6e 64  |=0 . .shell_Hand|
0000fed0  6c 65 42 75 6d 70 49 63  6f 6e 73 28 6f 66 66 73  |leBumpIcons(offs|
0000fee0  65 74 25 2c 5f 51 25 21  31 32 2c 5f 51 25 21 31  |et%,_Q%!12,_Q%!1|
0000fef0  36 2c 5f 51 25 21 38 29  0d 08 12 10 20 20 20 20  |6,_Q%!8)....    |
0000ff00  20 20 20 20 20 20 20 cd  0d 08 13 0e 20 20 20 20  |       .....    |
0000ff10  20 20 20 20 20 cd 0d 08  14 29 20 20 20 20 20 20  |     ....)      |
0000ff20  20 20 20 f4 20 63 68 65  63 6b 20 66 69 72 73 74  |   . check first|
0000ff30  20 66 6f 72 20 64 72 61  67 20 66 6c 61 67 21 0d  | for drag flag!.|
0000ff40  08 15 1b 20 20 20 20 20  20 20 20 20 e7 20 28 5f  |...         . (_|
0000ff50  51 25 21 38 3d 36 34 29  20 8c 0d 08 16 39 20 20  |Q%!8=64) ....9  |
0000ff60  20 20 20 20 20 20 20 20  20 f4 20 6f 6e 6c 79 20  |         . only |
0000ff70  63 68 65 63 6b 20 66 6f  72 20 53 45 4c 45 43 54  |check for SELECT|
0000ff80  20 61 6e 64 20 41 44 4a  55 53 54 20 62 75 74 74  | and ADJUST butt|
0000ff90  6f 6e 73 0d 08 17 3c 20  20 20 20 20 20 20 20 20  |ons...<         |
0000ffa0  20 20 72 65 73 75 6c 74  25 3d a4 73 68 65 6c 6c  |  result%=.shell|
0000ffb0  5f 49 63 6f 6e 49 73 44  72 61 67 67 61 62 6c 65  |_IconIsDraggable|
0000ffc0  28 5f 51 25 21 31 32 2c  5f 51 25 21 31 36 29 0d  |(_Q%!12,_Q%!16).|
0000ffd0  08 18 1a 20 20 20 20 20  20 20 20 20 20 20 e7 20  |...           . |
0000ffe0  72 65 73 75 6c 74 25 20  8c 0d 08 19 2a 20 20 20  |result% ....*   |
0000fff0  20 20 20 20 20 20 20 20  20 20 6d 65 73 73 24 3d  |          mess$=|
00010000  22 49 63 6f 6e 20 69 73  20 64 72 61 67 67 61 62  |"Icon is draggab|
00010010  6c 65 22 0d 08 1a 2b 20  20 20 20 20 20 20 20 20  |le"...+         |
00010020  20 20 20 20 f4 20 73 6f  20 6e 6f 77 20 64 72 61  |    . so now dra|
00010030  77 20 74 68 65 20 64 72  61 67 20 62 6f 78 0d 08  |w the drag box..|
00010040  1b 32 20 20 20 20 20 20  20 20 20 20 20 20 20 f2  |.2             .|
00010050  73 68 65 6c 6c 5f 49 63  6f 6e 44 72 61 67 42 6f  |shell_IconDragBo|
00010060  78 28 5f 51 25 21 31 32  2c 5f 51 25 21 31 36 29  |x(_Q%!12,_Q%!16)|
00010070  0d 08 1c 10 20 20 20 20  20 20 20 20 20 20 20 cc  |....           .|
00010080  0d 08 1d 2e 20 20 20 20  20 20 20 20 20 20 20 20  |....            |
00010090  20 6d 65 73 73 24 3d 22  49 63 6f 6e 20 69 73 20  | mess$="Icon is |
000100a0  6e 6f 74 20 64 72 61 67  67 61 62 6c 65 22 0d 08  |not draggable"..|
000100b0  1e 10 20 20 20 20 20 20  20 20 20 20 20 cd 0d 08  |..           ...|
000100c0  1f 2e 20 20 20 20 20 20  20 20 20 20 20 f2 73 68  |..           .sh|
000100d0  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 41 63 74  |ell_Tracef0("Act|
000100e0  69 6f 6e 3a 22 2b 6d 65  73 73 24 29 0d 08 20 0e  |ion:"+mess$).. .|
000100f0  20 20 20 20 20 20 20 20  20 cd 0d 08 21 17 20 20  |         ...!.  |
00010100  20 20 20 20 20 20 20 c8  8e 20 5f 51 25 21 38 20  |       .. _Q%!8 |
00010110  ca 0d 08 22 2c 20 20 20  20 20 20 20 20 20 20 20  |...",           |
00010120  c9 20 34 3a f2 73 68 65  6c 6c 5f 41 63 74 69 6f  |. 4:.shell_Actio|
00010130  6e 53 65 6c 65 63 74 42  75 74 74 6f 6e 0d 08 23  |nSelectButton..#|
00010140  2a 20 20 20 20 20 20 20  20 20 20 20 c9 20 32 3a  |*           . 2:|
00010150  f2 73 68 65 6c 6c 5f 41  63 74 69 6f 6e 4d 65 6e  |.shell_ActionMen|
00010160  75 42 75 74 74 6f 6e 0d  08 24 2c 20 20 20 20 20  |uButton..$,     |
00010170  20 20 20 20 20 20 c9 20  31 3a f2 73 68 65 6c 6c  |      . 1:.shell|
00010180  5f 41 63 74 69 6f 6e 41  64 6a 75 73 74 42 75 74  |_ActionAdjustBut|
00010190  74 6f 6e 0d 08 25 0e 20  20 20 20 20 20 20 20 20  |ton..%.         |
000101a0  cb 0d 08 26 19 20 20 c9  20 37 3a e7 20 5f 55 25  |...&.  . 7:. _U%|
000101b0  21 31 30 30 20 80 20 31  20 8c 0d 08 27 24 20 20  |!100 . 1 ...'$  |
000101c0  20 20 20 20 20 20 20 20  20 c8 99 20 22 44 72 61  |         .. "Dra|
000101d0  67 41 53 70 72 69 74 65  5f 53 74 6f 70 22 0d 08  |gASprite_Stop"..|
000101e0  28 24 20 20 20 20 20 20  20 20 20 20 20 5f 55 25  |($           _U%|
000101f0  21 31 30 30 20 3d 20 5f  55 25 21 31 30 30 20 82  |!100 = _U%!100 .|
00010200  20 31 0d 08 29 0e 20 20  20 20 20 20 20 20 20 cd  | 1..).         .|
00010210  0d 08 2a 48 20 20 20 20  20 20 20 20 20 5f 55 25  |..*H         _U%|
00010220  21 31 32 38 20 3d 20 30  3a f4 20 73 65 74 20 52  |!128 = 0:. set R|
00010230  41 4d 50 74 72 25 20 74  6f 20 30 20 69 6e 20 63  |AMPtr% to 0 in c|
00010240  61 73 65 20 61 20 52 41  4d 46 65 74 63 68 20 66  |ase a RAMFetch f|
00010250  6f 6c 6c 6f 77 73 2e 2e  0d 08 2b 45 20 20 20 20  |ollows....+E    |
00010260  20 20 20 20 20 f4 20 68  61 76 65 20 74 6f 20 75  |     . have to u|
00010270  73 65 20 6c 61 73 74 20  77 69 6e 64 6f 77 2f 69  |se last window/i|
00010280  63 6f 6e 20 68 61 6e 64  6c 65 73 20 66 72 6f 6d  |con handles from|
00010290  20 5f 55 25 20 62 6c 6f  63 6b 20 61 73 0d 08 2c  | _U% block as..,|
000102a0  3f 20 20 20 20 20 20 20  20 20 f4 20 5f 51 25 20  |?         . _Q% |
000102b0  62 6c 6f 63 6b 20 63 6f  75 6c 64 20 62 65 20 63  |block could be c|
000102c0  6f 72 72 75 70 74 65 64  20 62 79 20 6f 74 68 65  |orrupted by othe|
000102d0  72 20 70 6f 6c 6c 20 63  61 6c 6c 73 0d 08 2d 28  |r poll calls..-(|
000102e0  20 20 20 20 20 20 20 20  20 e7 20 28 5f 55 25 21  |         . (_U%!|
000102f0  31 30 30 20 80 20 31 20  3c 3c 20 31 31 29 20 3d  |100 . 1 << 11) =|
00010300  20 30 20 8c 0d 08 2e 3b  20 20 20 20 20 20 20 20  | 0 ....;        |
00010310  20 20 20 f4 20 69 74 20  77 61 73 20 6e 6f 74 20  |   . it was not |
00010320  61 20 73 6c 69 64 65 72  20 64 72 61 67 20 74 68  |a slider drag th|
00010330  61 74 20 6a 75 73 74 20  65 6e 64 65 64 2e 2e 0d  |at just ended...|
00010340  08 2f 3c 20 20 20 20 20  20 20 20 20 20 20 66 6e  |./<           fn|
00010350  24 20 3d 20 a4 73 68 65  6c 6c 5f 47 65 74 45 76  |$ = .shell_GetEv|
00010360  65 6e 74 48 61 6e 64 6c  65 72 28 5f 55 25 21 32  |entHandler(_U%!2|
00010370  38 2c 5f 55 25 21 33 32  2c 36 29 0d 08 30 1c 20  |8,_U%!32,6)..0. |
00010380  20 20 20 20 20 20 20 20  20 20 e7 20 66 6e 24 20  |          . fn$ |
00010390  3c 3e 20 22 22 20 8c 0d  08 31 50 20 20 20 20 20  |<> "" ...1P     |
000103a0  20 20 20 20 20 20 20 20  f2 73 68 65 6c 6c 5f 54  |        .shell_T|
000103b0  72 61 63 65 66 30 28 22  41 63 74 69 6f 6e 3a 44  |racef0("Action:D|
000103c0  72 61 67 20 65 76 65 6e  74 20 64 65 74 65 63 74  |rag event detect|
000103d0  65 64 20 2d 20 66 75 6e  63 74 69 6f 6e 20 69 73  |ed - function is|
000103e0  20 22 2b 66 6e 24 29 0d  08 32 38 20 20 20 20 20  | "+fn$)..28     |
000103f0  20 20 20 20 20 20 20 20  76 6f 69 64 25 3d a0 28  |        void%=.(|
00010400  22 46 4e 22 2b 66 6e 24  2b 22 28 5f 74 65 6d 70  |"FN"+fn$+"(_temp|
00010410  32 38 25 2c 5f 74 65 6d  70 33 32 25 29 22 29 0d  |28%,_temp32%)").|
00010420  08 33 10 20 20 20 20 20  20 20 20 20 20 20 cc 0d  |.3.           ..|
00010430  08 34 53 20 20 20 20 20  20 20 20 20 20 20 20 20  |.4S             |
00010440  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
00010450  41 63 74 69 6f 6e 3a 44  72 61 67 20 65 76 65 6e  |Action:Drag even|
00010460  74 20 64 65 74 65 63 74  65 64 20 2d 20 6e 6f 20  |t detected - no |
00010470  68 61 6e 64 6c 65 72 20  66 75 6e 63 74 69 6f 6e  |handler function|
00010480  22 29 0d 08 35 2a 20 20  20 20 20 20 20 20 20 20  |")..5*          |
00010490  20 20 20 f4 20 73 65 74  20 75 70 20 64 61 74 61  |   . set up data|
000104a0  73 61 76 65 20 6d 65 73  73 61 67 65 0d 08 36 33  |save message..63|
000104b0  20 20 20 20 20 20 20 20  20 20 20 20 20 f2 73 68  |             .sh|
000104c0  65 6c 6c 5f 53 65 6e 64  44 61 74 61 53 61 76 65  |ell_SendDataSave|
000104d0  28 5f 55 25 21 32 38 2c  5f 55 25 21 33 32 29 0d  |(_U%!28,_U%!32).|
000104e0  08 37 10 20 20 20 20 20  20 20 20 20 20 20 cd 0d  |.7.           ..|
000104f0  08 38 0e 20 20 20 20 20  20 20 20 20 cc 0d 08 39  |.8.         ...9|
00010500  35 20 20 20 20 20 20 20  20 20 20 20 f4 20 75 6e  |5           . un|
00010510  73 65 74 20 27 73 6c 69  64 65 72 20 64 72 61 67  |set 'slider drag|
00010520  20 69 6e 20 70 72 6f 67  72 65 73 73 27 20 66 6c  | in progress' fl|
00010530  61 67 0d 08 3a 2a 20 20  20 20 20 20 20 20 20 20  |ag..:*          |
00010540  20 5f 55 25 21 31 30 30  20 3d 20 5f 55 25 21 31  | _U%!100 = _U%!1|
00010550  30 30 20 82 20 31 20 3c  3c 20 31 31 0d 08 3b 0e  |00 . 1 << 11..;.|
00010560  20 20 20 20 20 20 20 20  20 cd 0d 08 3c 0a 20 20  |         ...<.  |
00010570  c9 20 38 3a 0d 08 3d 3a  20 20 20 20 20 20 20 20  |. 8:..=:        |
00010580  20 f2 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  | .shell_Tracef0(|
00010590  22 41 63 74 69 6f 6e 3a  6b 65 79 70 72 65 73 73  |"Action:keypress|
000105a0  20 69 73 3d 22 2b c3 5f  51 25 21 32 34 29 0d 08  | is="+._Q%!24)..|
000105b0  3e 18 20 20 20 20 20 20  20 20 20 c8 8e 20 5f 51  |>.         .. _Q|
000105c0  25 21 32 34 20 ca 0d 08  3f 2a 20 20 20 20 20 20  |%!24 ...?*      |
000105d0  20 20 20 c9 20 26 30 44  2c 33 39 34 2c 33 39 38  |   . &0D,394,398|
000105e0  2c 33 39 39 2c 34 31 30  2c 34 33 30 2c 34 33 31  |,399,410,430,431|
000105f0  0d 08 40 46 20 20 20 20  20 20 20 20 20 20 20 63  |..@F           c|
00010600  6c 61 69 6d 65 64 25 3d  a4 73 68 65 6c 6c 5f 57  |laimed%=.shell_W|
00010610  72 69 74 61 62 6c 65 49  63 6f 6e 48 61 6e 64 6c  |ritableIconHandl|
00010620  65 72 28 5f 51 25 21 30  2c 5f 51 25 21 34 2c 5f  |er(_Q%!0,_Q%!4,_|
00010630  51 25 21 32 34 29 0d 08  41 0e 20 20 20 20 20 20  |Q%!24)..A.      |
00010640  20 20 20 7f 0d 08 42 34  20 20 20 20 20 20 20 20  |   ...B4        |
00010650  20 20 20 63 6c 61 69 6d  65 64 25 3d a4 73 68 65  |   claimed%=.she|
00010660  6c 6c 5f 48 6f 74 4b 65  79 50 72 6f 63 65 73 73  |ll_HotKeyProcess|
00010670  28 5f 51 25 21 32 34 29  0d 08 43 0e 20 20 20 20  |(_Q%!24)..C.    |
00010680  20 20 20 20 20 cb 0d 08  44 1b 20 20 20 20 20 20  |     ...D.      |
00010690  20 20 20 e7 20 ac 20 63  6c 61 69 6d 65 64 25 20  |   . . claimed% |
000106a0  8c 0d 08 45 4b 20 20 20  20 20 20 20 20 20 20 20  |...EK           |
000106b0  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
000106c0  41 63 74 69 6f 6e 3a 4b  65 79 70 72 65 73 73 20  |Action:Keypress |
000106d0  6e 6f 74 20 63 6c 61 69  6d 65 64 2c 20 70 61 73  |not claimed, pas|
000106e0  73 69 6e 67 20 69 74 20  6f 6e 22 29 0d 08 46 2a  |sing it on")..F*|
000106f0  20 20 20 20 20 20 20 20  20 20 20 c8 99 20 22 57  |           .. "W|
00010700  69 6d 70 5f 50 72 6f 63  65 73 73 4b 65 79 22 2c  |imp_ProcessKey",|
00010710  5f 51 25 21 32 34 0d 08  47 0e 20 20 20 20 20 20  |_Q%!24..G.      |
00010720  20 20 20 cc 0d 08 48 4c  20 20 20 20 20 20 20 20  |   ...HL        |
00010730  20 20 20 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |   .shell_Tracef|
00010740  30 28 22 41 63 74 69 6f  6e 3a 4b 65 79 70 72 65  |0("Action:Keypre|
00010750  73 73 20 63 6c 61 69 6d  65 64 20 62 79 20 74 68  |ss claimed by th|
00010760  69 73 20 61 70 70 6c 69  63 61 74 69 6f 6e 22 29  |is application")|
00010770  0d 08 49 0e 20 20 20 20  20 20 20 20 20 cd 0d 08  |..I.         ...|
00010780  4a 26 20 20 c9 20 39 3a  f2 73 68 65 6c 6c 5f 41  |J&  . 9:.shell_A|
00010790  63 74 69 6f 6e 4d 65 6e  75 53 65 6c 65 63 74 28  |ctionMenuSelect(|
000107a0  5f 51 25 29 0d 08 4b 21  20 20 c9 20 31 37 2c 31  |_Q%)..K!  . 17,1|
000107b0  38 3a f2 73 68 65 6c 6c  5f 52 65 63 65 69 76 65  |8:.shell_Receive|
000107c0  28 5f 51 25 29 0d 08 4c  30 20 20 c9 20 31 39 20  |(_Q%)..L0  . 19 |
000107d0  20 20 3a f2 73 68 65 6c  6c 5f 55 73 65 72 4d 65  |  :.shell_UserMe|
000107e0  73 73 61 67 65 41 63 6b  6e 6f 77 6c 65 64 67 65  |ssageAcknowledge|
000107f0  28 5f 51 25 29 0d 08 4d  05 cb 0d 08 4e 05 e1 0d  |(_Q%)..M....N...|
00010800  08 4f 05 3a 0d 08 50 1b  2a 7c 53 74 6f 70 20 50  |.O.:..P.*|Stop P|
00010810  52 4f 43 73 68 65 6c 6c  5f 41 63 74 69 6f 6e 0d  |ROCshell_Action.|
00010820  08 51 04 0d 08 52 28 2a  7c 53 74 61 72 74 20 50  |.Q...R(*|Start P|
00010830  52 4f 43 73 68 65 6c 6c  5f 41 63 74 69 6f 6e 53  |ROCshell_ActionS|
00010840  65 6c 65 63 74 42 75 74  74 6f 6e 0d 08 53 1f dd  |electButton..S..|
00010850  20 f2 73 68 65 6c 6c 5f  41 63 74 69 6f 6e 53 65  | .shell_ActionSe|
00010860  6c 65 63 74 42 75 74 74  6f 6e 0d 08 54 0d ea 20  |lectButton..T.. |
00010870  6f 66 66 73 65 74 25 0d  08 55 15 2a 7c 69 66 64  |offset%..U.*|ifd|
00010880  65 66 20 54 72 61 63 65  49 6e 69 74 0d 08 56 40  |ef TraceInit..V@|
00010890  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
000108a0  41 63 74 69 6f 6e 53 65  6c 65 63 74 42 75 74 74  |ActionSelectButt|
000108b0  6f 6e 3a 4d 6f 75 73 65  20 42 75 74 74 6f 6e 20  |on:Mouse Button |
000108c0  77 61 73 20 53 45 4c 45  43 54 22 29 0d 08 57 0b  |was SELECT")..W.|
000108d0  2a 7c 65 6e 64 69 66 0d  08 58 13 e7 20 5f 55 25  |*|endif..X.. _U%|
000108e0  21 33 32 20 3e 3d 20 30  20 8c 0d 08 59 52 20 20  |!32 >= 0 ...YR  |
000108f0  f4 20 6c 61 73 74 20 6d  6f 75 73 65 20 63 6c 69  |. last mouse cli|
00010900  63 6b 20 77 61 73 20 6f  76 65 72 20 61 6e 20 69  |ck was over an i|
00010910  63 6f 6e 2c 20 63 68 65  63 6b 20 69 66 20 69 63  |con, check if ic|
00010920  6f 6e 20 68 61 73 20 70  6f 70 75 70 20 6d 65 6e  |on has popup men|
00010930  75 20 61 74 74 61 63 68  65 64 2e 2e 0d 08 5a 48  |u attached....ZH|
00010940  20 20 6f 66 66 73 65 74  25 20 3d 20 a4 73 68 65  |  offset% = .she|
00010950  6c 6c 5f 47 65 74 45 76  65 6e 74 4c 69 73 74 4f  |ll_GetEventListO|
00010960  66 66 73 65 74 32 28 5f  51 25 21 31 32 2c 5f 51  |ffset2(_Q%!12,_Q|
00010970  25 21 31 36 2c 5f 55 25  20 2b 20 33 34 30 2c 32  |%!16,_U% + 340,2|
00010980  34 2c a3 29 0d 08 5b 05  cd 0d 08 5c 13 e7 20 6f  |4,.)..[....\.. o|
00010990  66 66 73 65 74 25 20 3e  20 30 20 8c 0d 08 5d 1b  |ffset% > 0 ...].|
000109a0  20 20 f4 20 50 6f 70 75  70 20 65 76 65 6e 74 20  |  . Popup event |
000109b0  66 6f 75 6e 64 2e 2e 0d  08 5e 1c 20 20 f4 20 69  |found....^.  . i|
000109c0  73 20 69 74 20 61 20 63  6f 6c 6f 75 72 20 6d 65  |s it a colour me|
000109d0  6e 75 3f 0d 08 5f 27 20  20 e7 20 21 28 5f 55 25  |nu?.._'  . !(_U%|
000109e0  21 33 34 30 20 2b 20 6f  66 66 73 65 74 25 20 2b  |!340 + offset% +|
000109f0  20 31 36 29 20 3d 20 31  20 8c 0d 08 60 6f 20 20  | 16) = 1 ...`o  |
00010a00  20 20 f2 73 68 65 6c 6c  5f 4d 65 6e 75 54 69 63  |  .shell_MenuTic|
00010a10  6b 4f 6e 6c 79 31 28 21  28 5f 55 25 21 33 34 30  |kOnly1(!(_U%!340|
00010a20  20 2b 20 6f 66 66 73 65  74 25 20 2b 20 32 30 29  | + offset% + 20)|
00010a30  2c a4 73 68 65 6c 6c 5f  49 63 6f 6e 47 65 74 42  |,.shell_IconGetB|
00010a40  47 43 6f 6c 6f 75 72 28  5f 51 25 21 31 32 2c 21  |GColour(_Q%!12,!|
00010a50  28 5f 55 25 21 33 34 30  20 2b 20 6f 66 66 73 65  |(_U%!340 + offse|
00010a60  74 25 20 2b 20 38 29 29  29 0d 08 61 07 20 20 cd  |t% + 8)))..a.  .|
00010a70  0d 08 62 4a 20 20 f2 73  68 65 6c 6c 5f 48 61 6e  |..bJ  .shell_Han|
00010a80  64 6c 65 4d 65 6e 75 4f  70 65 6e 28 5f 51 25 2c  |dleMenuOpen(_Q%,|
00010a90  21 28 5f 55 25 21 33 34  30 20 2b 20 6f 66 66 73  |!(_U%!340 + offs|
00010aa0  65 74 25 20 2b 20 32 30  29 2c 5f 51 25 21 31 32  |et% + 20),_Q%!12|
00010ab0  2c 5f 51 25 21 31 36 2c  b9 29 0d 08 63 05 cc 0d  |,_Q%!16,.)..c...|
00010ac0  08 64 32 20 20 f2 73 68  65 6c 6c 5f 48 61 6e 64  |.d2  .shell_Hand|
00010ad0  6c 65 41 74 74 61 63 68  65 64 4d 65 6e 75 28 5f  |leAttachedMenu(_|
00010ae0  51 25 2c 5f 55 25 21 32  38 2c 5f 55 25 21 33 32  |Q%,_U%!28,_U%!32|
00010af0  29 0d 08 65 45 20 20 e7  20 5f 55 25 21 33 32 20  |)..eE  . _U%!32 |
00010b00  3d 20 30 20 8c 20 f2 73  68 65 6c 6c 5f 48 61 6e  |= 0 . .shell_Han|
00010b10  64 6c 65 41 74 74 61 63  68 65 64 44 61 74 61 53  |dleAttachedDataS|
00010b20  61 76 65 28 5f 51 25 2c  5f 55 25 21 32 38 2c 5f  |ave(_Q%,_U%!28,_|
00010b30  55 25 21 33 32 29 0d 08  66 33 20 20 66 6e 24 20  |U%!32)..f3  fn$ |
00010b40  3d 20 a4 73 68 65 6c 6c  5f 47 65 74 45 76 65 6e  |= .shell_GetEven|
00010b50  74 48 61 6e 64 6c 65 72  28 5f 55 25 21 32 38 2c  |tHandler(_U%!28,|
00010b60  5f 55 25 21 33 32 2c 32  29 0d 08 67 13 20 20 e7  |_U%!32,2)..g.  .|
00010b70  20 66 6e 24 20 3c 3e 20  22 22 20 8c 0d 08 68 28  | fn$ <> "" ...h(|
00010b80  20 20 20 20 f2 73 68 65  6c 6c 5f 49 63 6f 6e 53  |    .shell_IconS|
00010b90  6c 61 62 28 34 2c 5f 55  25 21 32 38 2c 5f 55 25  |lab(4,_U%!28,_U%|
00010ba0  21 33 32 29 0d 08 69 15  2a 7c 69 66 64 65 66 20  |!32)..i.*|ifdef |
00010bb0  54 72 61 63 65 49 6e 69  74 0d 08 6a 64 20 20 20  |TraceInit..jd   |
00010bc0  20 f2 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  | .shell_Tracef0(|
00010bd0  22 41 63 74 69 6f 6e 53  65 6c 65 63 74 42 75 74  |"ActionSelectBut|
00010be0  74 6f 6e 3a 41 62 6f 75  74 20 74 6f 20 63 61 6c  |ton:About to cal|
00010bf0  6c 20 22 2b 22 46 4e 22  2b 66 6e 24 2b 22 28 22  |l "+"FN"+fn$+"("|
00010c00  2b c3 5f 74 65 6d 70 32  38 25 2b 22 2c 22 2b c3  |+._temp28%+","+.|
00010c10  5f 74 65 6d 70 33 32 25  2b 22 29 22 29 0d 08 6b  |_temp32%+")")..k|
00010c20  0b 2a 7c 65 6e 64 69 66  0d 08 6c 35 20 20 20 20  |.*|endif..l5    |
00010c30  76 6f 69 64 25 20 3d 20  a0 28 22 46 4e 22 20 2b  |void% = .("FN" +|
00010c40  20 66 6e 24 20 2b 20 22  28 5f 74 65 6d 70 32 38  | fn$ + "(_temp28|
00010c50  25 2c 5f 74 65 6d 70 33  32 25 29 22 29 0d 08 6d  |%,_temp32%)")..m|
00010c60  07 20 20 cd 0d 08 6e 3e  20 20 f4 20 69 66 20 69  |.  ...n>  . if i|
00010c70  63 6f 6e 20 77 61 73 20  30 20 61 6e 64 20 64 62  |con was 0 and db|
00010c80  6f 78 20 69 73 20 64 79  6e 61 6d 69 63 20 74 68  |ox is dynamic th|
00010c90  65 6e 20 63 6c 6f 73 65  20 64 62 6f 78 2f 6d 65  |en close dbox/me|
00010ca0  6e 75 0d 08 6f 12 20 20  e7 20 5f 55 25 21 33 32  |nu..o.  . _U%!32|
00010cb0  3d 30 20 8c 0d 08 70 19  20 20 20 20 e7 20 5f 55  |=0 ...p.    . _U|
00010cc0  25 21 32 38 3d 5f 55 25  21 32 30 20 8c 0d 08 71  |%!28=_U%!20 ...q|
00010cd0  22 20 20 20 20 20 20 c8  99 20 22 57 69 6d 70 5f  |"      .. "Wimp_|
00010ce0  43 72 65 61 74 65 4d 65  6e 75 22 2c 2c 2d 31 0d  |CreateMenu",,-1.|
00010cf0  08 72 09 20 20 20 20 cd  0d 08 73 07 20 20 cd 0d  |.r.    ...s.  ..|
00010d00  08 74 05 cd 0d 08 75 05  e1 0d 08 76 27 2a 7c 53  |.t....u....v'*|S|
00010d10  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 41 63  |top PROCshell_Ac|
00010d20  74 69 6f 6e 53 65 6c 65  63 74 42 75 74 74 6f 6e  |tionSelectButton|
00010d30  0d 08 77 04 0d 08 78 26  2a 7c 53 74 61 72 74 20  |..w...x&*|Start |
00010d40  50 52 4f 43 73 68 65 6c  6c 5f 41 63 74 69 6f 6e  |PROCshell_Action|
00010d50  4d 65 6e 75 42 75 74 74  6f 6e 0d 08 79 1d dd 20  |MenuButton..y.. |
00010d60  f2 73 68 65 6c 6c 5f 41  63 74 69 6f 6e 4d 65 6e  |.shell_ActionMen|
00010d70  75 42 75 74 74 6f 6e 0d  08 7a 20 ea 20 74 65 6d  |uButton..z . tem|
00010d80  70 25 2c 6d 65 6e 75 25  2c 70 6f 70 75 70 25 2c  |p%,menu%,popup%,|
00010d90  6f 66 66 73 65 74 25 0d  08 7b 0e 70 6f 70 75 70  |offset%..{.popup|
00010da0  25 20 3d 20 a3 0d 08 7c  1f 2a 7c 69 66 64 65 66  |% = ...|.*|ifdef|
00010db0  20 50 52 4f 43 73 68 65  6c 6c 5f 54 72 61 63 65  | PROCshell_Trace|
00010dc0  49 6e 69 74 0d 08 7d 3c  f2 73 68 65 6c 6c 5f 54  |Init..}<.shell_T|
00010dd0  72 61 63 65 66 30 28 22  41 63 74 69 6f 6e 4d 65  |racef0("ActionMe|
00010de0  6e 75 42 75 74 74 6f 6e  3a 4d 6f 75 73 65 20 42  |nuButton:Mouse B|
00010df0  75 74 74 6f 6e 20 77 61  73 20 4d 45 4e 55 22 29  |utton was MENU")|
00010e00  0d 08 7e 0b 2a 7c 65 6e  64 69 66 0d 08 7f 13 e7  |..~.*|endif.....|
00010e10  20 5f 51 25 21 31 36 20  3e 3d 20 30 20 8c 0d 08  | _Q%!16 >= 0 ...|
00010e20  80 48 20 20 6f 66 66 73  65 74 25 20 3d 20 a4 73  |.H  offset% = .s|
00010e30  68 65 6c 6c 5f 47 65 74  45 76 65 6e 74 4c 69 73  |hell_GetEventLis|
00010e40  74 4f 66 66 73 65 74 32  28 5f 51 25 21 31 32 2c  |tOffset2(_Q%!12,|
00010e50  5f 51 25 21 31 36 2c 5f  55 25 20 2b 20 33 34 30  |_Q%!16,_U% + 340|
00010e60  2c 32 34 2c a3 29 0d 08  81 05 cd 0d 08 82 13 e7  |,24,.)..........|
00010e70  20 6f 66 66 73 65 74 25  20 3e 20 30 20 8c 0d 08  | offset% > 0 ...|
00010e80  83 1b 20 20 f4 20 50 6f  70 75 70 20 65 76 65 6e  |..  . Popup even|
00010e90  74 20 66 6f 75 6e 64 2e  2e 0d 08 84 4a 20 20 f2  |t found.....J  .|
00010ea0  73 68 65 6c 6c 5f 48 61  6e 64 6c 65 4d 65 6e 75  |shell_HandleMenu|
00010eb0  4f 70 65 6e 28 5f 51 25  2c 21 28 5f 55 25 21 33  |Open(_Q%,!(_U%!3|
00010ec0  34 30 20 2b 20 6f 66 66  73 65 74 25 20 2b 20 32  |40 + offset% + 2|
00010ed0  30 29 2c 5f 51 25 21 31  32 2c 5f 51 25 21 31 36  |0),_Q%!12,_Q%!16|
00010ee0  2c b9 29 0d 08 85 05 cc  0d 08 86 0d 20 20 74 65  |,.).........  te|
00010ef0  6d 70 25 3d b9 0d 08 87  34 20 20 e7 20 a6 28 2d  |mp%=....4  . .(-|
00010f00  31 29 20 8c 20 74 65 6d  70 25 3d a4 73 68 69 66  |1) . temp%=.shif|
00010f10  74 6d 65 6e 75 63 6c 69  63 6b 28 5f 51 25 21 31  |tmenuclick(_Q%!1|
00010f20  32 2c 5f 51 25 21 31 36  29 0d 08 88 0f 20 20 e7  |2,_Q%!16)....  .|
00010f30  20 74 65 6d 70 25 20 8c  0d 08 89 1f 2a 7c 69 66  | temp% .....*|if|
00010f40  64 65 66 20 50 52 4f 43  73 68 65 6c 6c 5f 54 72  |def PROCshell_Tr|
00010f50  61 63 65 49 6e 69 74 0d  08 8a 41 20 20 20 20 f2  |aceInit...A    .|
00010f60  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 41  |shell_Tracef0("A|
00010f70  63 74 69 6f 6e 4d 65 6e  75 42 75 74 74 6f 6e 3a  |ctionMenuButton:|
00010f80  43 68 65 63 6b 69 6e 67  20 6d 65 6e 75 20 65 76  |Checking menu ev|
00010f90  65 6e 74 73 2e 2e 22 29  0d 08 8b 5f 20 20 20 20  |ents..")..._    |
00010fa0  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
00010fb0  41 63 74 69 6f 6e 4d 65  6e 75 42 75 74 74 6f 6e  |ActionMenuButton|
00010fc0  3a 62 75 74 74 6f 6e 3d  22 2b c3 5f 51 25 21 38  |:button="+._Q%!8|
00010fd0  2b 22 20 5f 51 25 21 31  32 3d 22 2b c3 5f 51 25  |+" _Q%!12="+._Q%|
00010fe0  21 31 32 2b 22 20 5f 51  25 21 31 36 3d 22 2b c3  |!12+" _Q%!16="+.|
00010ff0  5f 51 25 21 31 36 29 0d  08 8c 0b 2a 7c 65 6e 64  |_Q%!16)....*|end|
00011000  69 66 0d 08 8d 46 20 20  20 20 e7 20 5f 51 25 21  |if...F    . _Q%!|
00011010  31 36 20 3e 3d 20 30 20  8c 20 6d 65 6e 75 25 3d  |16 >= 0 . menu%=|
00011020  a4 73 68 65 6c 6c 5f 47  65 74 45 76 65 6e 74 4d  |.shell_GetEventM|
00011030  65 6e 75 28 5f 51 25 21  38 2c 5f 51 25 21 31 32  |enu(_Q%!8,_Q%!12|
00011040  2c 5f 51 25 21 31 36 29  0d 08 8e 3e 20 20 20 20  |,_Q%!16)...>    |
00011050  e7 20 28 6d 65 6e 75 25  20 3c 3e 20 30 20 80 20  |. (menu% <> 0 . |
00011060  5f 51 25 21 31 32 20 3e  20 30 20 80 20 5f 51 25  |_Q%!12 > 0 . _Q%|
00011070  21 31 36 20 3e 3d 20 30  29 20 8c 20 70 6f 70 75  |!16 >= 0) . popu|
00011080  70 25 20 3d 20 b9 0d 08  8f 15 20 20 20 20 e7 20  |p% = .....    . |
00011090  6d 65 6e 75 25 20 3d 20  30 20 8c 0d 08 90 49 20  |menu% = 0 ....I |
000110a0  20 20 20 20 20 f4 20 4e  6f 20 6d 65 6e 75 20 61  |     . No menu a|
000110b0  74 74 61 63 68 65 64 20  74 6f 20 74 68 65 20 69  |ttached to the i|
000110c0  63 6f 6e 20 74 68 61 74  20 77 61 73 20 63 6c 69  |con that was cli|
000110d0  63 6b 65 64 20 6f 76 65  72 2c 20 74 68 65 72 65  |cked over, there|
000110e0  66 6f 72 65 0d 08 91 3e  20 20 20 20 20 20 f4 20  |fore...>      . |
000110f0  6c 6f 6f 6b 20 66 6f 72  20 61 20 6d 65 6e 75 20  |look for a menu |
00011100  61 74 74 61 63 68 65 64  20 74 6f 20 74 68 65 20  |attached to the |
00011110  77 69 6e 64 6f 77 20 77  6f 72 6b 20 61 72 65 61  |window work area|
00011120  2e 2e 0d 08 92 37 20 20  20 20 20 20 6d 65 6e 75  |.....7      menu|
00011130  25 20 20 3d 20 a4 73 68  65 6c 6c 5f 47 65 74 45  |%  = .shell_GetE|
00011140  76 65 6e 74 4d 65 6e 75  28 5f 51 25 21 38 2c 5f  |ventMenu(_Q%!8,_|
00011150  51 25 21 31 32 2c 2d 31  29 0d 08 93 09 20 20 20  |Q%!12,-1)....   |
00011160  20 cd 0d 08 94 1f 2a 7c  69 66 64 65 66 20 50 52  | .....*|ifdef PR|
00011170  4f 43 73 68 65 6c 6c 5f  54 72 61 63 65 49 6e 69  |OCshell_TraceIni|
00011180  74 0d 08 95 43 20 20 20  20 f2 73 68 65 6c 6c 5f  |t...C    .shell_|
00011190  54 72 61 63 65 66 30 28  22 41 63 74 69 6f 6e 4d  |Tracef0("ActionM|
000111a0  65 6e 75 42 75 74 74 6f  6e 3a 4d 65 6e 75 20 68  |enuButton:Menu h|
000111b0  61 6e 64 6c 65 20 69 73  3a 26 22 2b c3 7e 6d 65  |andle is:&"+.~me|
000111c0  6e 75 25 29 0d 08 96 0b  2a 7c 65 6e 64 69 66 0d  |nu%)....*|endif.|
000111d0  08 97 4a 20 20 20 20 e7  20 6d 65 6e 75 25 3c 3e  |..J    . menu%<>|
000111e0  30 20 8c 20 f2 73 68 65  6c 6c 5f 48 61 6e 64 6c  |0 . .shell_Handl|
000111f0  65 4d 65 6e 75 4f 70 65  6e 28 5f 51 25 2c 6d 65  |eMenuOpen(_Q%,me|
00011200  6e 75 25 2c 5f 51 25 21  31 32 2c 5f 51 25 21 31  |nu%,_Q%!12,_Q%!1|
00011210  36 2c 70 6f 70 75 70 25  29 0d 08 98 07 20 20 cd  |6,popup%)....  .|
00011220  0d 08 99 05 cd 0d 08 9a  05 e1 0d 08 9b 05 3a 0d  |..............:.|
00011230  08 9c 25 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |..%*|Stop PROCsh|
00011240  65 6c 6c 5f 41 63 74 69  6f 6e 4d 65 6e 75 42 75  |ell_ActionMenuBu|
00011250  74 74 6f 6e 0d 08 9d 04  0d 08 9e 24 2a 7c 53 74  |tton.......$*|St|
00011260  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 48 61  |art PROCshell_Ha|
00011270  6e 64 6c 65 4d 65 6e 75  4f 70 65 6e 0d 08 9f 35  |ndleMenuOpen...5|
00011280  dd 20 f2 73 68 65 6c 6c  5f 48 61 6e 64 6c 65 4d  |. .shell_HandleM|
00011290  65 6e 75 4f 70 65 6e 28  5f 51 25 2c 6d 65 6e 75  |enuOpen(_Q%,menu|
000112a0  25 2c 77 68 25 2c 69 68  25 2c 70 6f 70 75 70 25  |%,wh%,ih%,popup%|
000112b0  29 0d 08 a0 13 ea 20 69  5f 62 6c 6b 25 2c 77 5f  |)..... i_blk%,w_|
000112c0  62 6c 6b 25 0d 08 a1 48  f4 20 54 68 69 73 20 72  |blk%...H. This r|
000112d0  6f 75 74 69 6e 65 20 68  61 6e 64 6c 65 73 20 74  |outine handles t|
000112e0  68 65 20 63 61 73 65 20  6f 66 20 27 70 6f 70 75  |he case of 'popu|
000112f0  70 27 20 6d 65 6e 75 73  2c 20 61 64 6a 75 73 74  |p' menus, adjust|
00011300  69 6e 67 20 74 68 65 20  6d 65 6e 75 0d 08 a2 48  |ing the menu...H|
00011310  f4 20 61 6e 64 20 70 6f  69 6e 74 65 72 20 70 6f  |. and pointer po|
00011320  73 69 74 69 6f 6e 73 20  62 65 66 6f 72 65 20 6f  |sitions before o|
00011330  70 65 6e 69 6e 67 20 74  6f 20 63 6f 6e 66 6f 72  |pening to confor|
00011340  6d 20 74 6f 20 74 68 65  20 53 74 79 6c 65 20 47  |m to the Style G|
00011350  75 69 64 65 0d 08 a3 17  f4 20 72 65 63 6f 6d 6d  |uide..... recomm|
00011360  65 6e 64 61 74 69 6f 6e  73 2e 2e 0d 08 a4 12 e7  |endations.......|
00011370  20 70 6f 70 75 70 25 20  3d 20 a3 20 8c 0d 08 a5  | popup% = . ....|
00011380  48 20 20 f4 20 4d 65 6e  75 20 69 73 20 61 20 6e  |H  . Menu is a n|
00011390  6f 72 6d 61 6c 20 6d 65  6e 75 20 61 74 74 61 63  |ormal menu attac|
000113a0  68 65 64 20 74 6f 20 61  20 77 69 6e 64 6f 77 2c  |hed to a window,|
000113b0  20 6f 72 20 74 6f 20 61  6e 20 69 63 6f 6e 20 6f  | or to an icon o|
000113c0  6e 20 74 68 65 0d 08 a6  41 20 20 f4 20 69 63 6f  |n the...A  . ico|
000113d0  6e 62 61 72 2c 20 73 6f  20 4d 65 6e 75 55 74 69  |nbar, so MenuUti|
000113e0  6c 73 20 77 69 6c 6c 20  6f 70 65 6e 20 69 74 20  |ls will open it |
000113f0  69 6e 20 74 68 65 20 63  6f 72 72 65 63 74 20 70  |in the correct p|
00011400  6c 61 63 65 2e 2e 0d 08  a7 28 20 20 f2 73 68 65  |lace.....(  .she|
00011410  6c 6c 5f 4f 70 65 6e 4d  65 6e 75 28 5f 51 25 21  |ll_OpenMenu(_Q%!|
00011420  30 2c 5f 51 25 21 34 2c  6d 65 6e 75 25 29 0d 08  |0,_Q%!4,menu%)..|
00011430  a8 05 cc 0d 08 a9 4b 20  20 f4 20 4d 65 6e 75 20  |......K  . Menu |
00011440  69 73 20 61 20 27 70 6f  70 75 70 27 2c 20 69 2e  |is a 'popup', i.|
00011450  65 20 61 74 74 61 63 68  65 64 20 74 6f 20 61 20  |e attached to a |
00011460  73 70 65 63 69 66 69 63  20 69 63 6f 6e 20 69 6e  |specific icon in|
00011470  20 61 20 77 69 6e 64 6f  77 20 74 68 61 74 0d 08  | a window that..|
00011480  aa 49 20 20 f4 20 69 73  20 6e 6f 74 20 74 68 65  |.I  . is not the|
00011490  20 69 63 6f 6e 62 61 72  2e 20 54 68 65 72 65 66  | iconbar. Theref|
000114a0  6f 72 65 20 6f 70 65 6e  20 74 68 65 20 6d 65 6e  |ore open the men|
000114b0  75 20 74 6f 20 72 69 67  68 74 20 72 69 67 68 74  |u to right right|
000114c0  20 6f 66 20 74 68 65 0d  08 ab 2d 20 20 f4 20 69  | of the...-  . i|
000114d0  63 6f 6e 20 61 73 20 72  65 71 75 69 72 65 64 20  |con as required |
000114e0  62 79 20 74 68 65 20 53  74 79 6c 65 20 47 75 69  |by the Style Gui|
000114f0  64 65 2e 2e 0d 08 ac 28  20 20 69 5f 62 6c 6b 25  |de.....(  i_blk%|
00011500  20 3d 20 a4 73 68 65 6c  6c 5f 48 65 61 70 42 6c  | = .shell_HeapBl|
00011510  6f 63 6b 46 65 74 63 68  28 35 30 29 0d 08 ad 28  |ockFetch(50)...(|
00011520  20 20 77 5f 62 6c 6b 25  20 3d 20 a4 73 68 65 6c  |  w_blk% = .shel|
00011530  6c 5f 48 65 61 70 42 6c  6f 63 6b 46 65 74 63 68  |l_HeapBlockFetch|
00011540  28 33 36 29 0d 08 ae 45  20 20 f4 20 72 65 61 64  |(36)...E  . read|
00011550  20 63 6f 6f 72 64 69 6e  61 74 65 73 20 6f 66 20  | coordinates of |
00011560  69 63 6f 6e 20 74 68 61  74 20 68 61 73 20 6d 65  |icon that has me|
00011570  6e 75 20 61 74 74 61 63  68 65 64 20 61 6e 64 20  |nu attached and |
00011580  6f 70 65 6e 20 6d 65 6e  75 0d 08 af 1c 20 20 f4  |open menu....  .|
00011590  20 74 6f 20 74 68 65 20  72 69 67 68 74 20 6f 66  | to the right of|
000115a0  20 69 74 2e 2e 0d 08 b0  23 20 20 69 5f 62 6c 6b  | it.....#  i_blk|
000115b0  25 21 30 20 3d 20 77 68  25 3a 69 5f 62 6c 6b 25  |%!0 = wh%:i_blk%|
000115c0  21 34 20 3d 20 69 68 25  0d 08 b1 24 20 20 c8 99  |!4 = ih%...$  ..|
000115d0  20 22 57 69 6d 70 5f 47  65 74 49 63 6f 6e 53 74  | "Wimp_GetIconSt|
000115e0  61 74 65 22 2c 2c 69 5f  62 6c 6b 25 0d 08 b2 14  |ate",,i_blk%....|
000115f0  20 20 77 5f 62 6c 6b 25  21 30 20 3d 20 77 68 25  |  w_blk%!0 = wh%|
00011600  0d 08 b3 26 20 20 c8 99  20 22 57 69 6d 70 5f 47  |...&  .. "Wimp_G|
00011610  65 74 57 69 6e 64 6f 77  53 74 61 74 65 22 2c 2c  |etWindowState",,|
00011620  77 5f 62 6c 6b 25 0d 08  b4 3d 20 20 f2 73 68 65  |w_blk%...=  .she|
00011630  6c 6c 5f 4f 70 65 6e 4d  65 6e 75 28 77 5f 62 6c  |ll_OpenMenu(w_bl|
00011640  6b 25 21 34 20 2b 20 69  5f 62 6c 6b 25 21 31 36  |k%!4 + i_blk%!16|
00011650  20 20 2b 20 36 34 2c 5f  51 25 21 34 2c 6d 65 6e  |  + 64,_Q%!4,men|
00011660  75 25 29 0d 08 b5 2c 20  20 f4 20 41 6e 64 20 6d  |u%)...,  . And m|
00011670  6f 76 65 20 74 68 65 20  70 6f 69 6e 74 65 72 20  |ove the pointer |
00011680  61 70 70 72 6f 70 72 69  61 74 65 6c 79 2e 2e 0d  |appropriately...|
00011690  08 b6 28 20 20 c8 97 20  b8 20 77 5f 62 6c 6b 25  |..(  .. . w_blk%|
000116a0  21 34 2b 69 5f 62 6c 6b  25 21 31 36 20 2b 20 36  |!4+i_blk%!16 + 6|
000116b0  34 2c 5f 51 25 21 34 0d  08 b7 24 20 20 f2 73 68  |4,_Q%!4...$  .sh|
000116c0  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 52 65 74  |ell_HeapBlockRet|
000116d0  75 72 6e 28 69 5f 62 6c  6b 25 29 0d 08 b8 24 20  |urn(i_blk%)...$ |
000116e0  20 f2 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
000116f0  6b 52 65 74 75 72 6e 28  77 5f 62 6c 6b 25 29 0d  |kReturn(w_blk%).|
00011700  08 b9 05 cd 0d 08 ba 05  e1 0d 08 bb 05 3a 0d 08  |.............:..|
00011710  bc 23 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |.#*|Stop PROCshe|
00011720  6c 6c 5f 48 61 6e 64 6c  65 4d 65 6e 75 4f 70 65  |ll_HandleMenuOpe|
00011730  6e 0d 08 bd 04 0d 08 be  26 2a 7c 53 74 61 72 74  |n.......&*|Start|
00011740  20 50 52 4f 43 73 68 65  6c 6c 5f 41 63 74 69 6f  | PROCshell_Actio|
00011750  6e 4d 65 6e 75 53 65 6c  65 63 74 0d 08 bf 22 dd  |nMenuSelect...".|
00011760  20 f2 73 68 65 6c 6c 5f  41 63 74 69 6f 6e 4d 65  | .shell_ActionMe|
00011770  6e 75 53 65 6c 65 63 74  28 5f 51 25 29 0d 08 c0  |nuSelect(_Q%)...|
00011780  4b ea 20 68 61 6e 64 6c  65 72 25 2c 6d 65 6e 75  |K. handler%,menu|
00011790  5f 62 75 66 66 65 72 25  2c 43 68 65 63 6b 53 65  |_buffer%,CheckSe|
000117a0  6c 65 63 74 25 2c 66 6f  6e 74 6d 65 6e 75 66 6c  |lect%,fontmenufl|
000117b0  61 67 25 2c 76 6f 69 64  25 2c 68 5f 62 6c 6b 25  |ag%,void%,h_blk%|
000117c0  2c 6f 66 66 73 65 74 25  0d 08 c1 46 6f 66 66 73  |,offset%...Foffs|
000117d0  65 74 25 20 3d 20 a4 73  68 65 6c 6c 5f 47 65 74  |et% = .shell_Get|
000117e0  45 76 65 6e 74 4c 69 73  74 4f 66 66 73 65 74 32  |EventListOffset2|
000117f0  28 5f 55 25 21 32 38 2c  5f 55 25 21 33 32 2c 5f  |(_U%!28,_U%!32,_|
00011800  55 25 20 2b 20 33 34 30  2c 32 34 2c a3 29 0d 08  |U% + 340,24,.)..|
00011810  c2 36 e7 20 6f 66 66 73  65 74 25 20 3e 3d 20 30  |.6. offset% >= 0|
00011820  20 8c 20 f2 73 68 65 6c  6c 5f 44 6f 50 6f 70 75  | . .shell_DoPopu|
00011830  70 53 65 6c 65 63 74 28  5f 51 25 2c 6f 66 66 73  |pSelect(_Q%,offs|
00011840  65 74 25 29 0d 08 c3 25  68 5f 62 6c 6b 25 3d a4  |et%)...%h_blk%=.|
00011850  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
00011860  65 74 63 68 28 32 35 36  29 0d 08 c4 1f 2a 7c 69  |etch(256)....*|i|
00011870  66 64 65 66 20 50 52 4f  43 73 68 65 6c 6c 5f 54  |fdef PROCshell_T|
00011880  72 61 63 65 49 6e 69 74  0d 08 c5 41 f2 73 68 65  |raceInit...A.she|
00011890  6c 6c 5f 54 72 61 63 65  66 30 28 22 41 63 74 69  |ll_Tracef0("Acti|
000118a0  6f 6e 4d 65 6e 75 53 65  6c 65 63 74 3a 4d 65 6e  |onMenuSelect:Men|
000118b0  75 5f 53 65 6c 65 63 74  20 65 76 65 6e 74 20 64  |u_Select event d|
000118c0  65 74 65 63 74 65 64 22  29 0d 08 c6 0b 2a 7c 65  |etected")....*|e|
000118d0  6e 64 69 66 0d 08 c7 29  c8 99 20 22 57 69 6d 70  |ndif...).. "Wimp|
000118e0  5f 47 65 74 50 6f 69 6e  74 65 72 49 6e 66 6f 22  |_GetPointerInfo"|
000118f0  2c 2c 5f 73 68 65 6c 6c  5f 62 6c 6b 25 0d 08 c8  |,,_shell_blk%...|
00011900  1a 2a 7c 69 66 64 65 66  20 55 73 69 6e 67 5f 46  |.*|ifdef Using_F|
00011910  6f 6e 74 4d 65 6e 75 0d  08 c9 2b 6d 65 6e 75 5f  |ontMenu...+menu_|
00011920  62 75 66 66 65 72 25 3d  a4 73 68 65 6c 6c 5f 48  |buffer%=.shell_H|
00011930  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 32 35  |eapBlockFetch(25|
00011940  36 29 0d 08 ca 16 e7 20  5f 55 25 21 32 34 3d 5f  |6)..... _U%!24=_|
00011950  55 25 21 32 35 32 20 8c  0d 08 cb 22 20 20 f4 20  |U%!252 ...."  . |
00011960  43 75 72 72 65 6e 74 20  6d 65 6e 75 20 69 73 20  |Current menu is |
00011970  46 6f 6e 74 4d 65 6e 75  2e 2e 0d 08 cc 1e 20 20  |FontMenu......  |
00011980  43 68 65 63 6b 53 65 6c  65 63 74 25 3d 30 3a 5f  |CheckSelect%=0:_|
00011990  55 25 21 32 36 34 3d 31  0d 08 cd 05 cc 0d 08 ce  |U%!264=1........|
000119a0  2d 20 20 43 68 65 63 6b  53 65 6c 65 63 74 25 3d  |-  CheckSelect%=|
000119b0  a4 73 68 65 6c 6c 5f 43  68 65 63 6b 53 65 6c 65  |.shell_CheckSele|
000119c0  63 74 69 6f 6e 28 5f 51  25 29 0d 08 cf 2f 20 20  |ction(_Q%).../  |
000119d0  e7 20 43 68 65 63 6b 53  65 6c 65 63 74 25 3e 2d  |. CheckSelect%>-|
000119e0  31 20 8c 20 5f 55 25 21  32 36 34 3d 31 20 8b 20  |1 . _U%!264=1 . |
000119f0  5f 55 25 21 32 36 34 3d  30 0d 08 d0 05 cd 0d 08  |_U%!264=0.......|
00011a00  d1 11 e7 20 5f 55 25 21  32 36 34 3e 30 20 8c 0d  |... _U%!264>0 ..|
00011a10  08 d2 50 20 20 c8 99 20  22 46 6f 6e 74 4d 65 6e  |..P  .. "FontMen|
00011a20  75 5f 44 65 63 6f 64 65  46 6f 6e 74 4d 65 6e 75  |u_DecodeFontMenu|
00011a30  22 2c 5f 51 25 2b 43 68  65 63 6b 53 65 6c 65 63  |",_Q%+CheckSelec|
00011a40  74 25 2c 6d 65 6e 75 5f  62 75 66 66 65 72 25 20  |t%,menu_buffer% |
00011a50  b8 20 66 6f 6e 74 6d 65  6e 75 66 6c 61 67 25 0d  |. fontmenuflag%.|
00011a60  08 d3 19 20 20 e7 20 66  6f 6e 74 6d 65 6e 75 66  |...  . fontmenuf|
00011a70  6c 61 67 25 3d 31 20 8c  0d 08 d4 25 20 20 20 20  |lag%=1 ....%    |
00011a80  f4 20 27 73 65 6e 73 69  62 6c 65 27 20 73 65 6c  |. 'sensible' sel|
00011a90  65 63 74 69 6f 6e 20 6d  61 64 65 2e 2e 0d 08 d5  |ection made.....|
00011aa0  1f 2a 7c 69 66 64 65 66  20 50 52 4f 43 73 68 65  |.*|ifdef PROCshe|
00011ab0  6c 6c 5f 54 72 61 63 65  49 6e 69 74 0d 08 d6 62  |ll_TraceInit...b|
00011ac0  20 20 20 20 f2 73 68 65  6c 6c 5f 54 72 61 63 65  |    .shell_Trace|
00011ad0  66 30 28 22 41 63 74 69  6f 6e 4d 65 6e 75 53 65  |f0("ActionMenuSe|
00011ae0  6c 65 63 74 3a 46 6f 6e  74 4d 65 6e 75 20 73 65  |lect:FontMenu se|
00011af0  6c 65 63 74 69 6f 6e 20  28 22 2b a4 73 68 65 6c  |lection ("+.shel|
00011b00  6c 5f 47 65 74 53 74 72  69 6e 67 28 6d 65 6e 75  |l_GetString(menu|
00011b10  5f 62 75 66 66 65 72 25  29 2b 22 29 22 29 0d 08  |_buffer%)+")")..|
00011b20  d7 0b 2a 7c 65 6e 64 69  66 0d 08 d8 49 20 20 20  |..*|endif...I   |
00011b30  20 f2 73 68 65 6c 6c 5f  46 6f 6e 74 4d 65 6e 75  | .shell_FontMenu|
00011b40  53 65 6c 65 63 74 46 6f  6e 74 28 a4 73 68 65 6c  |SelectFont(.shel|
00011b50  6c 5f 47 65 74 53 74 72  69 6e 67 28 6d 65 6e 75  |l_GetString(menu|
00011b60  5f 62 75 66 66 65 72 25  29 2c 5f 55 25 21 32 36  |_buffer%),_U%!26|
00011b70  30 29 0d 08 d9 24 20 20  20 20 e7 20 5f 73 68 65  |0)...$    . _she|
00011b80  6c 6c 5f 46 6f 6e 74 4d  65 6e 75 53 65 6c 46 4e  |ll_FontMenuSelFN|
00011b90  24 3d 22 22 20 8c 0d 08  da 37 20 20 20 20 20 20  |$="" ....7      |
00011ba0  c8 99 20 22 57 69 6d 70  5f 44 65 63 6f 64 65 4d  |.. "Wimp_DecodeM|
00011bb0  65 6e 75 22 2c 2c 5f 55  25 21 32 34 2c 5f 51 25  |enu",,_U%!24,_Q%|
00011bc0  2c 6d 65 6e 75 5f 62 75  66 66 65 72 25 0d 08 db  |,menu_buffer%...|
00011bd0  35 20 20 20 20 20 20 66  6e 24 3d a4 73 68 65 6c  |5      fn$=.shel|
00011be0  6c 5f 47 65 74 45 76 65  6e 74 48 61 6e 64 6c 65  |l_GetEventHandle|
00011bf0  72 28 5f 55 25 21 35 32  2c 5f 55 25 21 35 36 2c  |r(_U%!52,_U%!56,|
00011c00  30 29 0d 08 dc 1d 20 20  20 20 20 20 5f 74 65 6d  |0)....      _tem|
00011c10  70 25 3d 6d 65 6e 75 5f  62 75 66 66 65 72 25 0d  |p%=menu_buffer%.|
00011c20  08 dd 39 20 20 20 20 20  20 24 5f 74 65 6d 70 25  |..9      $_temp%|
00011c30  3d a4 73 68 65 6c 6c 5f  53 74 72 69 6e 67 53 74  |=.shell_StringSt|
00011c40  72 69 70 54 72 61 69 6c  69 6e 67 28 24 5f 74 65  |ripTrailing($_te|
00011c50  6d 70 25 2c 22 20 22 29  0d 08 de 33 20 20 20 20  |mp%," ")...3    |
00011c60  20 20 e7 20 66 6e 24 3c  3e 22 22 20 8c 20 76 6f  |  . fn$<>"" . vo|
00011c70  69 64 25 3d a0 28 22 46  4e 22 2b 66 6e 24 2b 22  |id%=.("FN"+fn$+"|
00011c80  28 24 5f 74 65 6d 70 25  29 22 29 0d 08 df 09 20  |($_temp%)").... |
00011c90  20 20 20 cc 0d 08 e0 27  20 20 20 20 20 20 e7 20  |   ....'      . |
00011ca0  5f 73 68 65 6c 6c 5f 46  6f 6e 74 4d 65 6e 75 53  |_shell_FontMenuS|
00011cb0  65 6c 46 4e 24 3c 3e 22  22 20 8c 0d 08 e1 57 20  |elFN$<>"" ....W |
00011cc0  20 20 20 20 20 20 20 76  6f 69 64 25 3d a0 28 22  |       void%=.("|
00011cd0  46 4e 22 2b 5f 73 68 65  6c 6c 5f 46 6f 6e 74 4d  |FN"+_shell_FontM|
00011ce0  65 6e 75 53 65 6c 46 4e  24 2b 22 28 46 4e 73 68  |enuSelFN$+"(FNsh|
00011cf0  65 6c 6c 5f 46 6f 6e 74  4d 65 6e 75 47 65 74 4c  |ell_FontMenuGetL|
00011d00  61 73 74 53 65 6c 65 63  74 65 64 46 6f 6e 74 29  |astSelectedFont)|
00011d10  22 29 0d 08 e2 0b 20 20  20 20 20 20 cd 0d 08 e3  |")....      ....|
00011d20  09 20 20 20 20 cd 0d 08  e4 07 20 20 cd 0d 08 e5  |.    .....  ....|
00011d30  05 cd 0d 08 e6 28 f2 73  68 65 6c 6c 5f 48 65 61  |.....(.shell_Hea|
00011d40  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 6d 65 6e  |pBlockReturn(men|
00011d50  75 5f 62 75 66 66 65 72  25 29 0d 08 e7 0b 2a 7c  |u_buffer%)....*||
00011d60  65 6e 64 69 66 0d 08 e8  11 e7 20 5f 55 25 21 32  |endif..... _U%!2|
00011d70  36 34 3d 30 20 8c 0d 08  e9 38 20 20 c8 99 20 22  |64=0 ....8  .. "|
00011d80  4d 65 6e 75 55 74 69 6c  5f 44 65 63 6f 64 65 22  |MenuUtil_Decode"|
00011d90  2c 5f 55 25 21 32 34 2c  5f 51 25 20 b8 20 68 61  |,_U%!24,_Q% . ha|
00011da0  6e 64 6c 65 72 25 2c 2c  68 5f 62 6c 6b 25 0d 08  |ndler%,,h_blk%..|
00011db0  ea 3a 20 20 e7 20 68 61  6e 64 6c 65 72 25 20 8c  |.:  . handler% .|
00011dc0  20 f2 73 68 65 6c 6c 5f  4d 65 6e 75 43 61 6c 6c  | .shell_MenuCall|
00011dd0  48 61 6e 64 6c 65 72 28  68 61 6e 64 6c 65 72 25  |Handler(handler%|
00011de0  2c 68 5f 62 6c 6b 25 29  0d 08 eb 05 cd 0d 08 ec  |,h_blk%)........|
00011df0  17 e7 20 5f 73 68 65 6c  6c 5f 62 6c 6b 25 21 38  |.. _shell_blk%!8|
00011e00  3d 31 20 8c 0d 08 ed 29  20 20 e7 20 a4 73 68 65  |=1 ....)  . .she|
00011e10  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 45 78 69 73  |ll_HeapBlockExis|
00011e20  74 73 28 5f 55 25 21 32  32 34 29 20 8c 0d 08 ee  |ts(_U%!224) ....|
00011e30  16 20 20 20 20 5f 74 65  6d 70 25 3d 5f 55 25 21  |.    _temp%=_U%!|
00011e40  32 32 34 0d 08 ef 17 20  20 20 20 e7 20 24 5f 74  |224....    . $_t|
00011e50  65 6d 70 25 3c 3e 22 22  20 8c 0d 08 f0 24 20 20  |emp%<>"" ....$  |
00011e60  20 20 20 20 f4 20 43 61  6c 6c 20 6c 61 73 74 20  |    . Call last |
00011e70  6d 65 6e 75 77 61 72 6e  69 6e 67 20 66 6e 0d 08  |menuwarning fn..|
00011e80  f1 31 20 20 20 20 20 20  76 6f 69 64 25 3d a0 28  |.1      void%=.(|
00011e90  22 46 4e 22 2b 24 5f 74  65 6d 70 25 2b 22 28 5f  |"FN"+$_temp%+"(_|
00011ea0  55 25 21 35 32 2c 5f 55  25 21 35 36 29 22 29 0d  |U%!52,_U%!56)").|
00011eb0  08 f2 09 20 20 20 20 cd  0d 08 f3 07 20 20 cd 0d  |...    .....  ..|
00011ec0  08 f4 2b 20 20 f2 73 68  65 6c 6c 5f 4f 70 65 6e  |..+  .shell_Open|
00011ed0  4d 65 6e 75 28 5f 55 25  21 33 36 2c 5f 55 25 21  |Menu(_U%!36,_U%!|
00011ee0  34 30 2c 5f 55 25 21 32  34 29 0d 08 f5 05 cc 0d  |40,_U%!24)......|
00011ef0  08 f6 1e 20 20 5f 73 68  65 6c 6c 5f 46 6f 6e 74  |...  _shell_Font|
00011f00  4d 65 6e 75 53 65 6c 46  4e 24 3d 22 22 0d 08 f7  |MenuSelFN$=""...|
00011f10  05 cd 0d 08 f8 22 f2 73  68 65 6c 6c 5f 48 65 61  |.....".shell_Hea|
00011f20  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 68 5f 62  |pBlockReturn(h_b|
00011f30  6c 6b 25 29 0d 08 f9 05  e1 0d 08 fa 05 3a 0d 08  |lk%).........:..|
00011f40  fb 25 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |.%*|Stop PROCshe|
00011f50  6c 6c 5f 41 63 74 69 6f  6e 4d 65 6e 75 53 65 6c  |ll_ActionMenuSel|
00011f60  65 63 74 0d 08 fc 04 0d  08 fd 28 2a 7c 53 74 61  |ect.......(*|Sta|
00011f70  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 41 63 74  |rt PROCshell_Act|
00011f80  69 6f 6e 41 64 6a 75 73  74 42 75 74 74 6f 6e 0d  |ionAdjustButton.|
00011f90  08 fe 1f dd 20 f2 73 68  65 6c 6c 5f 41 63 74 69  |.... .shell_Acti|
00011fa0  6f 6e 41 64 6a 75 73 74  42 75 74 74 6f 6e 0d 08  |onAdjustButton..|
00011fb0  ff 24 ea 20 66 6c 61 67  73 25 2c 66 6e 24 2c 76  |.$. flags%,fn$,v|
00011fc0  6f 69 64 25 2c 73 65 6c  5f 62 6c 6b 25 2c 63 74  |oid%,sel_blk%,ct|
00011fd0  72 25 0d 09 00 51 73 65  6c 5f 62 6c 6b 25 20 3d  |r%...Qsel_blk% =|
00011fe0  20 a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
00011ff0  6b 46 65 74 63 68 28 31  32 20 2b 20 28 a4 73 68  |kFetch(12 + (.sh|
00012000  65 6c 6c 5f 57 69 6e 64  6f 77 43 6f 75 6e 74 49  |ell_WindowCountI|
00012010  63 6f 6e 73 28 5f 55 25  21 32 38 29 20 2a 20 33  |cons(_U%!28) * 3|
00012020  32 29 29 0d 09 01 15 2a  7c 69 66 64 65 66 20 54  |2))....*|ifdef T|
00012030  72 61 63 65 49 6e 69 74  0d 09 02 34 f2 73 68 65  |raceInit...4.she|
00012040  6c 6c 5f 54 72 61 63 65  66 30 28 22 41 63 74 69  |ll_Tracef0("Acti|
00012050  6f 6e 3a 4d 6f 75 73 65  20 42 75 74 74 6f 6e 20  |on:Mouse Button |
00012060  77 61 73 20 41 44 4a 55  53 54 22 29 0d 09 03 0b  |was ADJUST")....|
00012070  2a 7c 65 6e 64 69 66 0d  09 04 35 f4 20 50 52 4f  |*|endif...5. PRO|
00012080  43 73 68 65 6c 6c 5f 48  61 6e 64 6c 65 41 74 74  |Cshell_HandleAtt|
00012090  61 63 68 65 64 4d 65 6e  75 28 5f 51 25 2c 5f 55  |achedMenu(_Q%,_U|
000120a0  25 21 32 38 2c 5f 55 25  21 33 32 29 0d 09 05 04  |%!28,_U%!32)....|
000120b0  0d 09 06 4e f4 20 43 68  65 63 6b 20 69 66 20 69  |...N. Check if i|
000120c0  63 6f 6e 20 69 73 20 61  20 72 61 64 69 6f 20 6f  |con is a radio o|
000120d0  6e 65 20 61 6e 64 20 77  69 6e 64 6f 77 20 69 73  |ne and window is|
000120e0  20 6e 6f 74 20 74 68 65  20 69 63 6f 6e 62 61 72  | not the iconbar|
000120f0  2c 20 69 66 20 73 6f 20  73 65 6c 65 63 74 0d 09  |, if so select..|
00012100  07 2a f4 20 69 63 6f 6e  20 74 6f 20 61 76 6f 69  |.*. icon to avoi|
00012110  64 20 57 69 6d 70 20 64  65 73 65 6c 65 63 74 69  |d Wimp deselecti|
00012120  6e 67 20 69 74 2e 2e 2e  0d 09 08 12 e7 20 5f 55  |ng it........ _U|
00012130  25 21 32 38 20 3e 20 30  20 8c 0d 09 09 3d 20 20  |%!28 > 0 ....=  |
00012140  c8 99 20 22 57 69 6d 70  5f 57 68 69 63 68 49 63  |.. "Wimp_WhichIc|
00012150  6f 6e 22 2c 5f 55 25 21  32 38 2c 73 65 6c 5f 62  |on",_U%!28,sel_b|
00012160  6c 6b 25 2c 26 30 30 30  30 46 30 30 30 2c 26 30  |lk%,&0000F000,&0|
00012170  30 30 30 42 30 30 30 0d  09 0a 0e 20 20 63 74 72  |000B000....  ctr|
00012180  25 20 3d 20 30 0d 09 0b  1c 20 20 c8 95 20 73 65  |% = 0....  .. se|
00012190  6c 5f 62 6c 6b 25 21 63  74 72 25 20 3c 3e 20 2d  |l_blk%!ctr% <> -|
000121a0  31 0d 09 0c 42 20 20 20  20 e7 20 73 65 6c 5f 62  |1...B    . sel_b|
000121b0  6c 6b 25 21 63 74 72 25  20 3d 20 5f 55 25 21 33  |lk%!ctr% = _U%!3|
000121c0  32 20 8c 20 f2 73 68 65  6c 6c 5f 49 63 6f 6e 53  |2 . .shell_IconS|
000121d0  65 74 28 5f 55 25 21 32  38 2c 5f 55 25 21 33 32  |et(_U%!28,_U%!32|
000121e0  2c 31 29 0d 09 0d 11 20  20 20 20 63 74 72 25 20  |,1)....    ctr% |
000121f0  2b 3d 20 34 0d 09 0e 07  20 20 ce 0d 09 0f 05 cd  |+= 4....  ......|
00012200  0d 09 10 04 0d 09 11 43  e7 20 5f 55 25 21 33 32  |.......C. _U%!32|
00012210  20 3d 20 30 20 8c 20 f2  73 68 65 6c 6c 5f 48 61  | = 0 . .shell_Ha|
00012220  6e 64 6c 65 41 74 74 61  63 68 65 64 44 61 74 61  |ndleAttachedData|
00012230  53 61 76 65 28 5f 51 25  2c 5f 55 25 21 32 38 2c  |Save(_Q%,_U%!28,|
00012240  5f 55 25 21 33 32 29 0d  09 12 2f 66 6e 24 3d a4  |_U%!32).../fn$=.|
00012250  73 68 65 6c 6c 5f 47 65  74 45 76 65 6e 74 48 61  |shell_GetEventHa|
00012260  6e 64 6c 65 72 28 5f 55  25 21 32 38 2c 5f 55 25  |ndler(_U%!28,_U%|
00012270  21 33 32 2c 33 29 0d 09  13 0f e7 20 66 6e 24 3c  |!32,3)..... fn$<|
00012280  3e 22 22 20 8c 0d 09 14  26 20 20 f2 73 68 65 6c  |>"" ....&  .shel|
00012290  6c 5f 49 63 6f 6e 53 6c  61 62 28 31 2c 5f 55 25  |l_IconSlab(1,_U%|
000122a0  21 32 38 2c 5f 55 25 21  33 32 29 0d 09 15 2d 20  |!28,_U%!32)...- |
000122b0  20 76 6f 69 64 25 3d a0  28 22 46 4e 22 2b 66 6e  | void%=.("FN"+fn|
000122c0  24 2b 22 28 5f 74 65 6d  70 32 38 25 2c 5f 74 65  |$+"(_temp28%,_te|
000122d0  6d 70 33 32 25 29 22 29  0d 09 16 05 cd 0d 09 17  |mp32%)")........|
000122e0  24 f2 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |$.shell_HeapBloc|
000122f0  6b 52 65 74 75 72 6e 28  73 65 6c 5f 62 6c 6b 25  |kReturn(sel_blk%|
00012300  29 0d 09 18 05 e1 0d 09  19 05 3a 0d 09 1a 27 2a  |).........:...'*|
00012310  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
00012320  41 63 74 69 6f 6e 41 64  6a 75 73 74 42 75 74 74  |ActionAdjustButt|
00012330  6f 6e 0d 09 1b 04 0d 09  1c 1c 2a 7c 53 74 61 72  |on........*|Star|
00012340  74 20 46 4e 73 68 69 66  74 6d 65 6e 75 63 6c 69  |t FNshiftmenucli|
00012350  63 6b 0d 09 1d 1e dd 20  a4 73 68 69 66 74 6d 65  |ck..... .shiftme|
00012360  6e 75 63 6c 69 63 6b 28  77 68 25 2c 69 68 25 29  |nuclick(wh%,ih%)|
00012370  0d 09 1e 06 3d b9 0d 09  1f 05 3a 0d 09 20 1b 2a  |....=.....:.. .*|
00012380  7c 53 74 6f 70 20 46 4e  73 68 69 66 74 6d 65 6e  ||Stop FNshiftmen|
00012390  75 63 6c 69 63 6b 0d 09  21 1e 2a 7c 53 74 61 72  |uclick..!.*|Star|
000123a0  74 20 50 52 4f 43 73 68  65 6c 6c 5f 49 63 6f 6e  |t PROCshell_Icon|
000123b0  53 6c 61 62 0d 09 22 26  dd 20 f2 73 68 65 6c 6c  |Slab.."&. .shell|
000123c0  5f 49 63 6f 6e 53 6c 61  62 28 62 75 74 74 6f 6e  |_IconSlab(button|
000123d0  25 2c 77 68 25 2c 69 68  25 29 0d 09 23 0a ea 20  |%,wh%,ih%)..#.. |
000123e0  62 6c 6b 25 0d 09 24 22  62 6c 6b 25 3d a4 73 68  |blk%..$"blk%=.sh|
000123f0  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
00012400  63 68 28 35 30 29 0d 09  25 2a 62 6c 6b 25 21 38  |ch(50)..%*blk%!8|
00012410  3d 62 75 74 74 6f 6e 25  3a 62 6c 6b 25 21 31 32  |=button%:blk%!12|
00012420  3d 77 68 25 3a 62 6c 6b  25 21 31 36 3d 69 68 25  |=wh%:blk%!16=ih%|
00012430  0d 09 26 23 c8 99 20 22  49 6e 74 65 72 66 61 63  |..&#.. "Interfac|
00012440  65 5f 53 6c 61 62 42 75  74 74 6f 6e 22 2c 2c 62  |e_SlabButton",,b|
00012450  6c 6b 25 0d 09 27 0c 62  6c 6b 25 21 38 3d 30 0d  |lk%..'.blk%!8=0.|
00012460  09 28 23 c8 99 20 22 49  6e 74 65 72 66 61 63 65  |.(#.. "Interface|
00012470  5f 53 6c 61 62 42 75 74  74 6f 6e 22 2c 2c 62 6c  |_SlabButton",,bl|
00012480  6b 25 0d 09 29 20 f2 73  68 65 6c 6c 5f 48 65 61  |k%..) .shell_Hea|
00012490  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 62 6c 6b  |pBlockReturn(blk|
000124a0  25 29 0d 09 2a 05 e1 0d  09 2b 05 3a 0d 09 2c 1d  |%)..*....+.:..,.|
000124b0  2a 7c 53 74 6f 70 20 50  52 4f 43 73 68 65 6c 6c  |*|Stop PROCshell|
000124c0  5f 49 63 6f 6e 53 6c 61  62 0d 09 2d 04 0d 09 2e  |_IconSlab..-....|
000124d0  2a 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |**|Start PROCshe|
000124e0  6c 6c 5f 50 6f 69 6e 74  65 72 4c 65 61 76 69 6e  |ll_PointerLeavin|
000124f0  67 57 69 6e 64 6f 77 0d  09 2f 26 dd 20 f2 73 68  |gWindow../&. .sh|
00012500  65 6c 6c 5f 50 6f 69 6e  74 65 72 4c 65 61 76 69  |ell_PointerLeavi|
00012510  6e 67 57 69 6e 64 6f 77  28 5f 51 25 29 0d 09 30  |ngWindow(_Q%)..0|
00012520  12 ea 20 69 5f 62 6c 6b  25 2c 76 6f 69 64 25 0d  |.. i_blk%,void%.|
00012530  09 31 26 69 5f 62 6c 6b  25 20 3d 20 a4 73 68 65  |.1&i_blk% = .she|
00012540  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 46 65 74 63  |ll_HeapBlockFetc|
00012550  68 28 31 32 29 0d 09 32  36 c8 99 20 22 57 69 6d  |h(12)..26.. "Wim|
00012560  70 5f 57 68 69 63 68 49  63 6f 6e 22 2c 21 5f 51  |p_WhichIcon",!_Q|
00012570  25 2c 69 5f 62 6c 6b 25  2c 26 30 30 33 46 30 30  |%,i_blk%,&003F00|
00012580  30 30 2c 31 35 20 3c 3c  20 31 36 0d 09 33 15 e7  |00,15 << 16..3..|
00012590  20 21 69 5f 62 6c 6b 25  20 3c 3e 20 2d 31 20 8c  | !i_blk% <> -1 .|
000125a0  0d 09 34 2e 20 20 f4 20  50 52 4f 43 73 68 65 6c  |..4.  . PROCshel|
000125b0  6c 5f 54 72 61 63 65 66  30 28 22 4c 4c 3a 22 2b  |l_Tracef0("LL:"+|
000125c0  53 54 52 24 28 21 69 5f  62 6c 6b 25 29 29 0d 09  |STR$(!i_blk%))..|
000125d0  35 38 20 20 76 6f 69 64  25 20 3d 20 a0 28 22 46  |58  void% = .("F|
000125e0  4e 22 20 2b 20 a4 73 68  65 6c 6c 5f 49 63 6f 6e  |N" + .shell_Icon|
000125f0  47 65 74 44 61 74 61 28  21 5f 51 25 2c 21 69 5f  |GetData(!_Q%,!i_|
00012600  62 6c 6b 25 29 29 0d 09  36 05 cd 0d 09 37 22 f2  |blk%))..6....7".|
00012610  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 52  |shell_HeapBlockR|
00012620  65 74 75 72 6e 28 69 5f  62 6c 6b 25 29 0d 09 38  |eturn(i_blk%)..8|
00012630  05 e1 0d 09 39 27 3a 20  20 20 20 20 20 20 20 20  |....9':         |
00012640  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00012650  20 20 20 20 20 20 20 20  20 0d 09 3a 29 2a 7c 53  |         ..:)*|S|
00012660  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 50 6f  |top PROCshell_Po|
00012670  69 6e 74 65 72 4c 65 61  76 69 6e 67 57 69 6e 64  |interLeavingWind|
00012680  6f 77 0d 09 3b 04 0d 09  3c 2b 2a 7c 53 74 61 72  |ow..;...<+*|Star|
00012690  74 20 50 52 4f 43 73 68  65 6c 6c 5f 50 6f 69 6e  |t PROCshell_Poin|
000126a0  74 65 72 45 6e 74 65 72  69 6e 67 57 69 6e 64 6f  |terEnteringWindo|
000126b0  77 0d 09 3d 27 dd 20 f2  73 68 65 6c 6c 5f 50 6f  |w..='. .shell_Po|
000126c0  69 6e 74 65 72 45 6e 74  65 72 69 6e 67 57 69 6e  |interEnteringWin|
000126d0  64 6f 77 28 5f 51 25 29  0d 09 3e 16 ea 20 69 5f  |dow(_Q%)..>.. i_|
000126e0  62 6c 6b 25 2c 76 6f 69  64 25 2c 77 68 25 0d 09  |blk%,void%,wh%..|
000126f0  3f 0f 77 68 25 20 3d 20  5f 51 25 21 30 0d 09 40  |?.wh% = _Q%!0..@|
00012700  26 69 5f 62 6c 6b 25 20  3d 20 a4 73 68 65 6c 6c  |&i_blk% = .shell|
00012710  5f 48 65 61 70 42 6c 6f  63 6b 46 65 74 63 68 28  |_HeapBlockFetch(|
00012720  31 32 29 0d 09 41 35 c8  99 20 22 57 69 6d 70 5f  |12)..A5.. "Wimp_|
00012730  57 68 69 63 68 49 63 6f  6e 22 2c 77 68 25 2c 69  |WhichIcon",wh%,i|
00012740  5f 62 6c 6b 25 2c 26 30  30 33 46 30 30 30 30 2c  |_blk%,&003F0000,|
00012750  31 34 20 3c 3c 20 31 36  0d 09 42 15 e7 20 21 69  |14 << 16..B.. !i|
00012760  5f 62 6c 6b 25 20 3c 3e  20 2d 31 20 8c 0d 09 43  |_blk% <> -1 ...C|
00012770  2e 20 20 f4 20 50 52 4f  43 73 68 65 6c 6c 5f 54  |.  . PROCshell_T|
00012780  72 61 63 65 66 30 28 22  4c 4c 3a 22 2b 53 54 52  |racef0("LL:"+STR|
00012790  24 28 21 69 5f 62 6c 6b  25 29 29 0d 09 44 48 20  |$(!i_blk%))..DH |
000127a0  20 f4 20 50 52 4f 43 73  68 65 6c 6c 5f 54 72 61  | . PROCshell_Tra|
000127b0  63 65 66 30 28 22 4c 4c  3a 22 2b 22 46 4e 22 20  |cef0("LL:"+"FN" |
000127c0  2b 20 46 4e 73 68 65 6c  6c 5f 49 63 6f 6e 47 65  |+ FNshell_IconGe|
000127d0  74 44 61 74 61 28 77 68  25 2c 21 69 5f 62 6c 6b  |tData(wh%,!i_blk|
000127e0  25 29 29 0d 09 45 37 20  20 76 6f 69 64 25 20 3d  |%))..E7  void% =|
000127f0  20 a0 28 22 46 4e 22 20  2b 20 a4 73 68 65 6c 6c  | .("FN" + .shell|
00012800  5f 49 63 6f 6e 47 65 74  44 61 74 61 28 77 68 25  |_IconGetData(wh%|
00012810  2c 21 69 5f 62 6c 6b 25  29 29 0d 09 46 05 cd 0d  |,!i_blk%))..F...|
00012820  09 47 22 f2 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |.G".shell_HeapBl|
00012830  6f 63 6b 52 65 74 75 72  6e 28 69 5f 62 6c 6b 25  |ockReturn(i_blk%|
00012840  29 0d 09 48 05 e1 0d 09  49 05 3a 0d 09 4a 2a 2a  |)..H....I.:..J**|
00012850  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
00012860  50 6f 69 6e 74 65 72 45  6e 74 65 72 69 6e 67 57  |PointerEnteringW|
00012870  69 6e 64 6f 77 0d 09 4b  04 0d 09 4c 22 2a 7c 53  |indow..K...L"*|S|
00012880  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 52  |tart PROCshell_R|
00012890  65 64 72 61 77 57 69 6e  64 6f 77 0d 09 4d 22 dd  |edrawWindow..M".|
000128a0  20 f2 73 68 65 6c 6c 5f  52 65 64 72 61 77 57 69  | .shell_RedrawWi|
000128b0  6e 64 6f 77 28 68 61 6e  64 6c 65 25 29 0d 09 4e  |ndow(handle%)..N|
000128c0  23 ea 20 6d 6f 72 65 25  2c 66 6e 24 2c 78 30 25  |#. more%,fn$,x0%|
000128d0  2c 79 30 25 2c 62 6c 6b  25 2c 69 5f 62 6c 6b 25  |,y0%,blk%,i_blk%|
000128e0  0d 09 4f 26 69 5f 62 6c  6b 25 20 3d 20 a4 73 68  |..O&i_blk% = .sh|
000128f0  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
00012900  63 68 28 31 32 29 0d 09  50 39 c8 99 20 22 57 69  |ch(12)..P9.. "Wi|
00012910  6d 70 5f 57 68 69 63 68  49 63 6f 6e 22 2c 68 61  |mp_WhichIcon",ha|
00012920  6e 64 6c 65 25 2c 69 5f  62 6c 6b 25 2c 26 30 30  |ndle%,i_blk%,&00|
00012930  33 46 30 30 30 30 2c 31  33 20 3c 3c 20 31 36 0d  |3F0000,13 << 16.|
00012940  09 51 15 e7 20 21 69 5f  62 6c 6b 25 20 3c 3e 20  |.Q.. !i_blk% <> |
00012950  2d 31 20 8c 0d 09 52 2e  20 20 f4 20 50 52 4f 43  |-1 ...R.  . PROC|
00012960  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 4c  |shell_Tracef0("L|
00012970  4c 3a 22 2b 53 54 52 24  28 21 69 5f 62 6c 6b 25  |L:"+STR$(!i_blk%|
00012980  29 29 0d 09 53 4c 20 20  f4 20 50 52 4f 43 73 68  |))..SL  . PROCsh|
00012990  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 4c 4c 3a  |ell_Tracef0("LL:|
000129a0  22 2b 22 46 4e 22 20 2b  20 46 4e 73 68 65 6c 6c  |"+"FN" + FNshell|
000129b0  5f 49 63 6f 6e 47 65 74  44 61 74 61 28 68 61 6e  |_IconGetData(han|
000129c0  64 6c 65 25 2c 21 69 5f  62 6c 6b 25 29 29 0d 09  |dle%,!i_blk%))..|
000129d0  54 2f 20 20 66 6e 24 20  3d 20 a4 73 68 65 6c 6c  |T/  fn$ = .shell|
000129e0  5f 49 63 6f 6e 47 65 74  44 61 74 61 28 68 61 6e  |_IconGetData(han|
000129f0  64 6c 65 25 2c 21 69 5f  62 6c 6b 25 29 0d 09 55  |dle%,!i_blk%)..U|
00012a00  05 cd 0d 09 56 22 f2 73  68 65 6c 6c 5f 48 65 61  |....V".shell_Hea|
00012a10  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 69 5f 62  |pBlockReturn(i_b|
00012a20  6c 6b 25 29 0d 09 57 23  62 6c 6b 25 3d a4 73 68  |lk%)..W#blk%=.sh|
00012a30  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
00012a40  63 68 28 31 30 30 29 0d  09 58 10 e7 20 66 6e 24  |ch(100)..X.. fn$|
00012a50  20 3d 20 22 22 20 8c 0d  09 59 45 20 20 f4 20 43  | = "" ...YE  . C|
00012a60  61 6e 27 74 20 66 69 6e  64 20 74 68 65 20 63 6c  |an't find the cl|
00012a70  65 76 65 72 20 76 65 72  73 69 6f 6e 20 6f 66 20  |ever version of |
00012a80  61 6e 20 61 74 74 61 63  68 65 64 20 65 76 65 6e  |an attached even|
00012a90  74 2c 20 63 68 65 63 6b  20 74 68 65 0d 09 5a 13  |t, check the..Z.|
00012aa0  20 20 f4 20 64 75 6d 62  20 6f 6e 65 2e 2e 2e 0d  |  . dumb one....|
00012ab0  09 5b 2e 20 20 66 6e 24  3d a4 73 68 65 6c 6c 5f  |.[.  fn$=.shell_|
00012ac0  47 65 74 45 76 65 6e 74  48 61 6e 64 6c 65 72 28  |GetEventHandler(|
00012ad0  68 61 6e 64 6c 65 25 2c  2d 31 2c 34 29 0d 09 5c  |handle%,-1,4)..\|
00012ae0  05 cd 0d 09 5d 12 62 6c  6b 25 21 30 3d 68 61 6e  |....].blk%!0=han|
00012af0  64 6c 65 25 0d 09 5e 28  c8 99 20 22 57 69 6d 70  |dle%..^(.. "Wimp|
00012b00  5f 52 65 64 72 61 77 57  69 6e 64 6f 77 22 2c 2c  |_RedrawWindow",,|
00012b10  62 6c 6b 25 20 b8 20 6d  6f 72 65 25 0d 09 5f 2a  |blk% . more%.._*|
00012b20  78 30 25 3d 62 6c 6b 25  21 34 2d 62 6c 6b 25 21  |x0%=blk%!4-blk%!|
00012b30  32 30 3a 79 30 25 3d 62  6c 6b 25 21 31 36 2d 62  |20:y0%=blk%!16-b|
00012b40  6c 6b 25 21 32 34 0d 09  60 0c c8 95 20 6d 6f 72  |lk%!24..`... mor|
00012b50  65 25 0d 09 61 29 20 20  c8 99 20 22 49 6e 74 65  |e%..a)  .. "Inte|
00012b60  72 66 61 63 65 5f 52 65  6e 64 65 72 33 64 57 69  |rface_Render3dWi|
00012b70  6e 64 6f 77 22 2c 2c 62  6c 6b 25 0d 09 62 43 20  |ndow",,blk%..bC |
00012b80  20 e7 20 66 6e 24 3c 3e  22 22 20 8c 20 76 6f 69  | . fn$<>"" . voi|
00012b90  64 25 3d a0 28 22 46 4e  22 2b 66 6e 24 2b 22 28  |d%=.("FN"+fn$+"(|
00012ba0  22 2b c3 62 6c 6b 25 2b  22 2c 22 2b c3 78 30 25  |"+.blk%+","+.x0%|
00012bb0  2b 22 2c 22 2b c3 79 30  25 2b 22 29 22 29 0d 09  |+","+.y0%+")")..|
00012bc0  63 2a 20 20 c8 99 20 22  57 69 6d 70 5f 47 65 74  |c*  .. "Wimp_Get|
00012bd0  52 65 63 74 61 6e 67 6c  65 22 2c 2c 62 6c 6b 25  |Rectangle",,blk%|
00012be0  20 b8 20 6d 6f 72 65 25  0d 09 64 05 ce 0d 09 65  | . more%..d....e|
00012bf0  20 f2 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
00012c00  6b 52 65 74 75 72 6e 28  62 6c 6b 25 29 0d 09 66  |kReturn(blk%)..f|
00012c10  05 e1 0d 09 67 05 3a 0d  09 68 21 2a 7c 53 74 6f  |....g.:..h!*|Sto|
00012c20  70 20 50 52 4f 43 73 68  65 6c 6c 5f 52 65 64 72  |p PROCshell_Redr|
00012c30  61 77 57 69 6e 64 6f 77  0d 09 69 04 0d 09 6a 1d  |awWindow..i...j.|
00012c40  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
00012c50  6c 5f 52 65 63 65 69 76  65 0d 09 6b 19 dd 20 f2  |l_Receive..k.. .|
00012c60  73 68 65 6c 6c 5f 52 65  63 65 69 76 65 28 5f 51  |shell_Receive(_Q|
00012c70  25 29 0d 09 6c 11 ea 20  74 65 6d 70 25 2c 76 6f  |%)..l.. temp%,vo|
00012c80  69 64 25 0d 09 6d 0f c8  8e 20 5f 51 25 21 31 36  |id%..m... _Q%!16|
00012c90  20 ca 0d 09 6e 1a c9 20  30 20 20 20 20 20 3a f2  | ...n.. 0     :.|
00012ca0  73 68 65 6c 6c 5f 45 78  69 74 3a e0 0d 09 6f 21  |shell_Exit:...o!|
00012cb0  c9 20 31 20 20 20 20 20  3a f2 73 68 65 6c 6c 5f  |. 1     :.shell_|
00012cc0  44 61 74 61 53 61 76 65  28 5f 51 25 29 0d 09 70  |DataSave(_Q%)..p|
00012cd0  24 c9 20 32 20 20 20 20  20 3a f2 73 68 65 6c 6c  |$. 2     :.shell|
00012ce0  5f 44 61 74 61 53 61 76  65 41 63 6b 28 5f 51 25  |_DataSaveAck(_Q%|
00012cf0  29 0d 09 71 23 c9 20 33  20 20 20 20 20 3a f2 73  |)..q#. 3     :.s|
00012d00  68 65 6c 6c 5f 44 61 74  61 4c 6f 61 64 28 5f 51  |hell_DataLoad(_Q|
00012d10  25 2c a3 29 0d 09 72 24  c9 20 34 20 20 20 20 20  |%,.)..r$. 4     |
00012d20  3a f2 73 68 65 6c 6c 5f  44 61 74 61 4c 6f 61 64  |:.shell_DataLoad|
00012d30  41 63 6b 28 5f 51 25 29  0d 09 73 23 c9 20 35 20  |Ack(_Q%)..s#. 5 |
00012d40  20 20 20 20 3a f2 73 68  65 6c 6c 5f 44 61 74 61  |    :.shell_Data|
00012d50  4c 6f 61 64 28 5f 51 25  2c b9 29 0d 09 74 21 c9  |Load(_Q%,.)..t!.|
00012d60  20 36 20 20 20 20 20 3a  f2 73 68 65 6c 6c 5f 52  | 6     :.shell_R|
00012d70  41 4d 46 65 74 63 68 28  5f 51 25 29 0d 09 75 24  |AMFetch(_Q%)..u$|
00012d80  c9 20 37 20 20 20 20 20  3a f2 73 68 65 6c 6c 5f  |. 7     :.shell_|
00012d90  52 41 4d 54 72 61 6e 73  6d 69 74 28 5f 51 25 29  |RAMTransmit(_Q%)|
00012da0  0d 09 76 28 c9 20 38 20  20 20 20 20 3a f2 73 68  |..v(. 8     :.sh|
00012db0  65 6c 6c 5f 4d 65 73 73  61 67 65 5f 50 72 65 51  |ell_Message_PreQ|
00012dc0  75 69 74 28 5f 51 25 29  0d 09 77 1a c9 20 39 20  |uit(_Q%)..w.. 9 |
00012dd0  20 20 20 20 3a e7 20 5f  55 25 21 31 36 34 3e 30  |    :. _U%!164>0|
00012de0  20 8c 0d 09 78 15 2a 7c  69 66 64 65 66 20 54 72  | ...x.*|ifdef Tr|
00012df0  61 63 65 49 6e 69 74 0d  09 79 4a 20 20 20 20 20  |aceInit..yJ     |
00012e00  20 20 20 20 20 20 20 20  20 f2 73 68 65 6c 6c 5f  |         .shell_|
00012e10  54 72 61 63 65 66 30 28  22 52 65 63 65 69 76 65  |Tracef0("Receive|
00012e20  3a 50 61 6c 65 74 74 65  43 68 61 6e 67 65 20 6d  |:PaletteChange m|
00012e30  65 73 73 61 67 65 20 72  65 63 65 69 76 65 64 22  |essage received"|
00012e40  29 0d 09 7a 0b 2a 7c 65  6e 64 69 66 0d 09 7b 1f  |)..z.*|endif..{.|
00012e50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 74 65  |              te|
00012e60  6d 70 25 3d 5f 55 25 21  31 36 34 0d 09 7c 26 20  |mp%=_U%!164..|& |
00012e70  20 20 20 20 20 20 20 20  20 20 20 20 20 76 6f 69  |             voi|
00012e80  64 25 3d a0 28 22 46 4e  22 2b 24 74 65 6d 70 25  |d%=.("FN"+$temp%|
00012e90  29 0d 09 7d 11 20 20 20  20 20 20 20 20 20 20 20  |)..}.           |
00012ea0  20 cd 0d 09 7e 2c c9 20  31 30 20 20 20 20 3a f2  | ...~,. 10    :.|
00012eb0  73 68 65 6c 6c 5f 4d 65  73 73 61 67 65 5f 53 61  |shell_Message_Sa|
00012ec0  76 65 44 65 73 6b 74 6f  70 28 5f 51 25 29 0d 09  |veDesktop(_Q%)..|
00012ed0  7f 29 c9 20 31 34 20 20  20 20 3a f2 73 68 65 6c  |.). 14    :.shel|
00012ee0  6c 5f 4d 65 73 73 61 67  65 5f 53 68 75 74 64 6f  |l_Message_Shutdo|
00012ef0  77 6e 28 5f 51 25 29 0d  09 80 28 c9 20 26 35 30  |wn(_Q%)...(. &50|
00012f00  32 20 20 3a f2 73 68 65  6c 6c 5f 49 6e 74 65 72  |2  :.shell_Inter|
00012f10  61 63 74 69 76 65 48 65  6c 70 28 5f 51 25 29 0d  |activeHelp(_Q%).|
00012f20  09 81 24 c9 20 26 34 30  30 43 30 3a f2 73 68 65  |..$. &400C0:.she|
00012f30  6c 6c 5f 4d 65 6e 75 57  61 72 6e 69 6e 67 28 5f  |ll_MenuWarning(_|
00012f40  51 25 29 0d 09 82 2b c9  20 26 34 30 30 43 31 3a  |Q%)...+. &400C1:|
00012f50  f2 73 68 65 6c 6c 5f 4d  65 73 73 61 67 65 5f 4d  |.shell_Message_M|
00012f60  6f 64 65 43 68 61 6e 67  65 28 5f 51 25 29 0d 09  |odeChange(_Q%)..|
00012f70  83 1d c9 20 26 34 30 30  43 32 3a f4 20 54 61 73  |... &400C2:. Tas|
00012f80  6b 49 6e 69 74 69 61 6c  69 73 65 0d 09 84 1d 20  |kInitialise.... |
00012f90  20 20 20 20 20 20 20 20  20 20 20 e7 20 5f 55 25  |           . _U%|
00012fa0  21 31 36 38 3e 30 20 8c  0d 09 85 15 2a 7c 69 66  |!168>0 .....*|if|
00012fb0  64 65 66 20 54 72 61 63  65 49 6e 69 74 0d 09 86  |def TraceInit...|
00012fc0  4b 20 20 20 20 20 20 20  20 20 20 20 20 20 20 f2  |K              .|
00012fd0  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 52  |shell_Tracef0("R|
00012fe0  65 63 65 69 76 65 3a 54  61 73 6b 49 6e 69 74 69  |eceive:TaskIniti|
00012ff0  61 6c 69 73 65 20 6d 65  73 73 61 67 65 20 72 65  |alise message re|
00013000  63 65 69 76 65 64 22 29  0d 09 87 0b 2a 7c 65 6e  |ceived")....*|en|
00013010  64 69 66 0d 09 88 1f 20  20 20 20 20 20 20 20 20  |dif....         |
00013020  20 20 20 20 20 74 65 6d  70 25 3d 5f 55 25 21 31  |     temp%=_U%!1|
00013030  36 38 0d 09 89 5c 20 20  20 20 20 20 20 20 20 20  |68...\          |
00013040  20 20 20 20 76 6f 69 64  25 3d a0 28 22 46 4e 22  |    void%=.("FN"|
00013050  2b 24 74 65 6d 70 25 2b  22 28 22 2b c3 28 5f 51  |+$temp%+"("+.(_Q|
00013060  25 21 34 29 2b 22 2c 22  2b bd 33 34 2b a4 73 68  |%!4)+","+.34+.sh|
00013070  65 6c 6c 5f 47 65 74 53  74 72 69 6e 67 28 5f 51  |ell_GetString(_Q|
00013080  25 2b 32 38 29 2b bd 33  34 2b 22 29 22 29 0d 09  |%+28)+.34+")")..|
00013090  8a 11 20 20 20 20 20 20  20 20 20 20 20 20 cd 0d  |..            ..|
000130a0  09 8b 46 20 20 20 20 20  20 20 20 20 20 20 20 e7  |..F            .|
000130b0  20 5f 55 25 21 32 30 38  3d 2d 31 20 80 20 a4 73  | _U%!208=-1 . .s|
000130c0  68 65 6c 6c 5f 47 65 74  53 74 72 69 6e 67 28 5f  |hell_GetString(_|
000130d0  51 25 2b 32 38 29 3d 22  53 74 72 6f 6e 67 48 65  |Q%+28)="StrongHe|
000130e0  6c 70 22 20 8c 0d 09 8c  1f 20 20 20 20 20 20 20  |lp" .....       |
000130f0  20 20 20 20 20 20 20 5f  55 25 21 32 30 38 3d 5f  |       _U%!208=_|
00013100  51 25 21 34 0d 09 8d 6a  20 20 20 20 20 20 20 20  |Q%!4...j        |
00013110  20 20 20 20 20 20 f2 73  68 65 6c 6c 5f 53 74 72  |      .shell_Str|
00013120  6f 6e 67 48 6c 70 4d 73  67 28 22 48 65 6c 70 5f  |ongHlpMsg("Help_|
00013130  49 6e 73 74 61 6c 6c 20  2d 44 69 65 57 69 74 68  |Install -DieWith|
00013140  54 61 73 6b 20 22 2b a4  73 68 65 6c 6c 5f 47 65  |Task "+.shell_Ge|
00013150  74 41 70 70 44 69 72 2b  22 2e 22 2b a4 73 68 65  |tAppDir+"."+.she|
00013160  6c 6c 5f 47 65 74 41 70  70 4e 61 6d 65 29 0d 09  |ll_GetAppName)..|
00013170  8e 1f 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |..              |
00013180  74 65 6d 70 25 3d 5f 55  25 21 32 31 36 0d 09 8f  |temp%=_U%!216...|
00013190  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 e7  |               .|
000131a0  20 24 74 65 6d 70 25 3c  3e 22 22 20 8c 0d 09 90  | $temp%<>"" ....|
000131b0  2b 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |+               |
000131c0  20 f2 73 68 65 6c 6c 5f  48 65 6c 70 57 6f 72 64  | .shell_HelpWord|
000131d0  28 24 74 65 6d 70 25 29  0d 09 91 33 20 20 20 20  |($temp%)...3    |
000131e0  20 20 20 20 20 20 20 20  20 20 20 20 f2 73 68 65  |            .she|
000131f0  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 52 65 74 75  |ll_HeapBlockRetu|
00013200  72 6e 28 5f 55 25 21 32  31 36 29 0d 09 92 1d 20  |rn(_U%!216).... |
00013210  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 5f  |               _|
00013220  55 25 21 32 31 36 3d 30  0d 09 93 13 20 20 20 20  |U%!216=0....    |
00013230  20 20 20 20 20 20 20 20  20 20 cd 0d 09 94 11 20  |          ..... |
00013240  20 20 20 20 20 20 20 20  20 20 20 cd 0d 09 95 0c  |           .....|
00013250  c9 20 26 34 30 30 43 33  0d 09 96 15 20 20 f4 20  |. &400C3....  . |
00013260  54 61 73 6b 43 6c 6f 73  65 44 6f 77 6e 0d 09 97  |TaskCloseDown...|
00013270  13 20 20 e7 20 5f 55 25  21 31 37 32 3e 30 20 8c  |.  . _U%!172>0 .|
00013280  0d 09 98 15 2a 7c 69 66  64 65 66 20 54 72 61 63  |....*|ifdef Trac|
00013290  65 49 6e 69 74 0d 09 99  40 20 20 20 20 f2 73 68  |eInit...@    .sh|
000132a0  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 52 65 63  |ell_Tracef0("Rec|
000132b0  65 69 76 65 3a 54 61 73  6b 43 6c 6f 73 65 44 6f  |eive:TaskCloseDo|
000132c0  77 6e 20 6d 65 73 73 61  67 65 20 72 65 63 65 69  |wn message recei|
000132d0  76 65 64 22 29 0d 09 9a  0b 2a 7c 65 6e 64 69 66  |ved")....*|endif|
000132e0  0d 09 9b 17 20 20 20 20  74 65 6d 70 25 20 3d 20  |....    temp% = |
000132f0  5f 55 25 21 31 37 32 0d  09 9c 1e 20 20 20 20 76  |_U%!172....    v|
00013300  6f 69 64 25 20 3d 20 a0  28 22 46 4e 22 2b 24 74  |oid% = .("FN"+$t|
00013310  65 6d 70 25 29 0d 09 9d  07 20 20 cd 0d 09 9e 26  |emp%)....  ....&|
00013320  20 20 e7 20 5f 51 25 21  34 20 3d 20 5f 55 25 21  |  . _Q%!4 = _U%!|
00013330  32 30 38 20 8c 20 5f 55  25 21 32 30 38 20 3d 20  |208 . _U%!208 = |
00013340  2d 31 0d 09 9f 0c c9 20  26 34 30 30 43 37 0d 09  |-1..... &400C7..|
00013350  a0 12 20 20 f4 20 54 61  73 6b 4e 61 6d 65 49 73  |..  . TaskNameIs|
00013360  0d 09 a1 15 2a 7c 69 66  64 65 66 20 54 72 61 63  |....*|ifdef Trac|
00013370  65 49 6e 69 74 0d 09 a2  3b 20 20 f2 73 68 65 6c  |eInit...;  .shel|
00013380  6c 5f 54 72 61 63 65 66  30 28 22 52 65 63 65 69  |l_Tracef0("Recei|
00013390  76 65 3a 54 61 73 6b 4e  61 6d 65 49 73 20 6d 65  |ve:TaskNameIs me|
000133a0  73 73 61 67 65 20 72 65  63 65 69 76 65 64 22 29  |ssage received")|
000133b0  0d 09 a3 0b 2a 7c 65 6e  64 69 66 0d 09 a4 31 20  |....*|endif...1 |
000133c0  20 e7 20 a4 73 68 65 6c  6c 5f 47 65 74 53 74 72  | . .shell_GetStr|
000133d0  69 6e 67 28 5f 51 25 2b  32 38 29 20 3d 20 22 53  |ing(_Q%+28) = "S|
000133e0  74 72 6f 6e 67 48 65 6c  70 22 20 8c 0d 09 a5 3a  |trongHelp" ....:|
000133f0  20 20 20 20 5f 55 25 21  32 30 38 3d 5f 51 25 21  |    _U%!208=_Q%!|
00013400  32 30 3a f4 20 73 74 6f  72 65 20 74 61 73 6b 20  |20:. store task |
00013410  68 61 6e 64 6c 65 20 6f  66 20 53 74 72 6f 6e 67  |handle of Strong|
00013420  48 6c 70 2e 2e 2e 0d 09  a6 07 20 20 cc 0d 09 a7  |Hlp.......  ....|
00013430  1a 20 20 20 20 f2 73 68  65 6c 6c 5f 53 63 61 6e  |.    .shell_Scan|
00013440  46 6f 72 48 65 6c 70 0d  09 a8 07 20 20 cd 0d 09  |ForHelp....  ...|
00013450  a9 04 0d 09 aa 0c c9 20  26 38 30 31 34 30 0d 09  |....... &80140..|
00013460  ab 19 20 20 f4 20 4d 65  73 73 61 67 65 5f 50 72  |..  . Message_Pr|
00013470  69 6e 74 46 69 6c 65 0d  09 ac 21 20 20 f2 73 68  |intFile...!  .sh|
00013480  65 6c 6c 5f 48 61 6e 64  6c 65 50 72 69 6e 74 46  |ell_HandlePrintF|
00013490  69 6c 65 28 5f 51 25 29  0d 09 ad 0c c9 20 26 38  |ile(_Q%)..... &8|
000134a0  30 31 34 33 0d 09 ae 1a  20 20 f4 20 4d 65 73 73  |0143....  . Mess|
000134b0  61 67 65 5f 50 72 69 6e  74 45 72 72 6f 72 0d 09  |age_PrintError..|
000134c0  af 22 20 20 f2 73 68 65  6c 6c 5f 48 61 6e 64 6c  |."  .shell_Handl|
000134d0  65 50 72 69 6e 74 45 72  72 6f 72 28 5f 51 25 29  |ePrintError(_Q%)|
000134e0  0d 09 b0 0c c9 20 26 38  30 31 34 35 0d 09 b1 1c  |..... &80145....|
000134f0  20 20 f4 20 4d 65 73 73  61 67 65 5f 50 72 69 6e  |  . Message_Prin|
00013500  74 54 79 70 65 4f 64 64  0d 09 b2 24 20 20 f2 73  |tTypeOdd...$  .s|
00013510  68 65 6c 6c 5f 48 61 6e  64 6c 65 50 72 69 6e 74  |hell_HandlePrint|
00013520  54 79 70 65 4f 64 64 28  5f 51 25 29 0d 09 b3 0c  |TypeOdd(_Q%)....|
00013530  c9 20 26 38 30 31 34 37  0d 09 b4 1a 20 20 f4 20  |. &80147....  . |
00013540  4d 65 73 73 61 67 65 5f  53 65 74 50 72 69 6e 74  |Message_SetPrint|
00013550  65 72 0d 09 b5 22 20 20  f2 73 68 65 6c 6c 5f 48  |er..."  .shell_H|
00013560  61 6e 64 6c 65 53 65 74  50 72 69 6e 74 65 72 28  |andleSetPrinter(|
00013570  5f 51 25 29 0d 09 b6 04  0d 09 b7 29 7f 20 20 3a  |_Q%).......).  :|
00013580  f2 73 68 65 6c 6c 5f 48  61 6e 64 6c 65 55 6e 6b  |.shell_HandleUnk|
00013590  6e 6f 77 6e 4d 65 73 73  61 67 65 32 28 5f 51 25  |nownMessage2(_Q%|
000135a0  29 0d 09 b8 05 cb 0d 09  b9 05 e1 0d 09 ba 05 3a  |)..............:|
000135b0  0d 09 bb 1c 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |....*|Stop PROCs|
000135c0  68 65 6c 6c 5f 52 65 63  65 69 76 65 0d 09 bc 04  |hell_Receive....|
000135d0  0d 09 bd 28 2a 7c 53 74  61 72 74 20 50 52 4f 43  |...(*|Start PROC|
000135e0  73 68 65 6c 6c 5f 4d 65  73 73 61 67 65 5f 4d 6f  |shell_Message_Mo|
000135f0  64 65 43 68 61 6e 67 65  0d 09 be 24 dd 20 f2 73  |deChange...$. .s|
00013600  68 65 6c 6c 5f 4d 65 73  73 61 67 65 5f 4d 6f 64  |hell_Message_Mod|
00013610  65 43 68 61 6e 67 65 28  5f 51 25 29 0d 09 bf 22  |eChange(_Q%)..."|
00013620  ea 20 6f 66 66 73 65 74  25 2c 63 74 72 25 2c 73  |. offset%,ctr%,s|
00013630  77 5f 6c 69 73 74 25 2c  77 5f 62 6c 6b 25 0d 09  |w_list%,w_blk%..|
00013640  c0 14 73 77 5f 6c 69 73  74 25 3d 5f 55 25 21 31  |..sw_list%=_U%!1|
00013650  38 34 0d 09 c1 11 e7 20  5f 55 25 21 31 36 30 3e  |84..... _U%!160>|
00013660  30 20 8c 0d 09 c2 46 20  20 f2 73 68 65 6c 6c 5f  |0 ....F  .shell_|
00013670  54 72 61 63 65 66 30 28  22 4d 65 73 73 61 67 65  |Tracef0("Message|
00013680  5f 4d 6f 64 65 43 68 61  6e 67 65 3a 4d 6f 64 65  |_ModeChange:Mode|
00013690  43 68 61 6e 67 65 20 6d  65 73 73 61 67 65 20 72  |Change message r|
000136a0  65 63 65 69 76 65 64 22  29 0d 09 c3 13 20 20 74  |eceived")....  t|
000136b0  65 6d 70 25 3d 5f 55 25  21 31 36 30 0d 09 c4 1a  |emp%=_U%!160....|
000136c0  20 20 76 6f 69 64 25 3d  a0 28 22 46 4e 22 2b 24  |  void%=.("FN"+$|
000136d0  74 65 6d 70 25 29 0d 09  c5 05 cd 0d 09 c6 29 f4  |temp%)........).|
000136e0  20 53 59 53 20 22 46 6f  6e 74 57 69 6e 64 6f 77  | SYS "FontWindow|
000136f0  5f 4d 6f 64 65 43 68 61  6e 67 65 22 2c 5f 55 25  |_ModeChange",_U%|
00013700  21 31 34 38 0d 09 c7 04  0d 09 c8 43 f4 20 4e 6f  |!148.......C. No|
00013710  77 20 63 68 65 63 6b 20  69 66 20 61 6e 79 20 77  |w check if any w|
00013720  69 6e 64 6f 77 73 20 63  6f 6e 74 61 69 6e 69 6e  |indows containin|
00013730  67 20 70 61 6e 65 73 20  61 72 65 20 6f 70 65 6e  |g panes are open|
00013740  2c 20 61 6e 64 20 69 66  20 73 6f 0d 09 c9 45 f4  |, and if so...E.|
00013750  20 72 65 6f 70 65 6e 20  74 68 65 6d 20 74 6f 20  | reopen them to |
00013760  61 76 6f 69 64 20 70 72  6f 62 6c 65 6d 73 20 77  |avoid problems w|
00013770  69 74 68 20 70 61 6e 65  73 20 61 70 70 65 61 72  |ith panes appear|
00013780  69 6e 67 20 69 6e 20 74  68 65 20 77 72 6f 6e 67  |ing in the wrong|
00013790  0d 09 ca 11 f4 20 70 6f  73 69 74 69 6f 6e 2e 2e  |..... position..|
000137a0  2e 0d 09 cb 25 77 5f 62  6c 6b 25 3d a4 73 68 65  |....%w_blk%=.she|
000137b0  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 46 65 74 63  |ll_HeapBlockFetc|
000137c0  68 28 31 30 30 29 0d 09  cc 13 e7 20 73 77 5f 6c  |h(100)..... sw_l|
000137d0  69 73 74 25 3c 3e 30 20  8c 0d 09 cd 15 2a 7c 69  |ist%<>0 .....*|i|
000137e0  66 64 65 66 20 54 72 61  63 65 49 6e 69 74 0d 09  |fdef TraceInit..|
000137f0  ce 56 20 20 f2 73 68 65  6c 6c 5f 54 72 61 63 65  |.V  .shell_Trace|
00013800  66 30 28 22 4d 65 73 73  61 67 65 5f 4d 6f 64 65  |f0("Message_Mode|
00013810  43 68 61 6e 67 65 3a 43  68 65 63 6b 69 6e 67 20  |Change:Checking |
00013820  73 74 61 74 69 63 20 77  69 6e 64 6f 77 20 6c 69  |static window li|
00013830  73 74 20 66 6f 72 20 70  61 6e 65 20 65 76 65 6e  |st for pane even|
00013840  74 73 22 29 0d 09 cf 0b  2a 7c 65 6e 64 69 66 0d  |ts")....*|endif.|
00013850  09 d0 1a 20 20 c8 95 20  73 77 5f 6c 69 73 74 25  |...  .. sw_list%|
00013860  21 63 74 72 25 3c 3e 2d  31 0d 09 d1 25 20 20 20  |!ctr%<>-1...%   |
00013870  20 f4 20 6e 6f 77 20 63  68 65 63 6b 20 70 61 6e  | . now check pan|
00013880  65 20 65 76 65 6e 74 20  6c 69 73 74 2e 2e 0d 09  |e event list....|
00013890  d2 47 20 20 20 20 6f 66  66 73 65 74 25 3d a4 73  |.G    offset%=.s|
000138a0  68 65 6c 6c 5f 47 65 74  45 76 65 6e 74 4c 69 73  |hell_GetEventLis|
000138b0  74 4f 66 66 73 65 74 28  73 77 5f 6c 69 73 74 25  |tOffset(sw_list%|
000138c0  21 63 74 72 25 2c 2d 31  2c 5f 55 25 2b 39 32 2c  |!ctr%,-1,_U%+92,|
000138d0  32 34 2c a3 29 0d 09 d3  16 20 20 20 20 e7 20 6f  |24,.)....    . o|
000138e0  66 66 73 65 74 25 3e 2d  31 20 8c 0d 09 d4 15 2a  |ffset%>-1 .....*|
000138f0  7c 69 66 64 65 66 20 54  72 61 63 65 49 6e 69 74  ||ifdef TraceInit|
00013900  0d 09 d5 49 20 20 20 20  20 20 f2 73 68 65 6c 6c  |...I      .shell|
00013910  5f 54 72 61 63 65 66 30  28 22 4d 65 73 73 61 67  |_Tracef0("Messag|
00013920  65 5f 4d 6f 64 65 43 68  61 6e 67 65 3a 53 74 61  |e_ModeChange:Sta|
00013930  74 69 63 20 77 69 6e 64  6f 77 20 68 61 6e 64 6c  |tic window handl|
00013940  65 20 66 6f 75 6e 64 22  29 0d 09 d6 0b 2a 7c 65  |e found")....*|e|
00013950  6e 64 69 66 0d 09 d7 30  20 20 20 20 20 20 e7 20  |ndif...0      . |
00013960  a4 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 49 73 4f  |.shell_WindowIsO|
00013970  70 65 6e 28 73 77 5f 6c  69 73 74 25 21 63 74 72  |pen(sw_list%!ctr|
00013980  25 29 20 8c 0d 09 d8 15  2a 7c 69 66 64 65 66 20  |%) .....*|ifdef |
00013990  54 72 61 63 65 49 6e 69  74 0d 09 d9 41 20 20 20  |TraceInit...A   |
000139a0  20 20 20 20 20 f2 73 68  65 6c 6c 5f 54 72 61 63  |     .shell_Trac|
000139b0  65 66 30 28 22 4d 65 73  73 61 67 65 5f 4d 6f 64  |ef0("Message_Mod|
000139c0  65 43 68 61 6e 67 65 3a  57 69 6e 64 6f 77 20 69  |eChange:Window i|
000139d0  73 20 6f 70 65 6e 2e 2e  22 29 0d 09 da 0b 2a 7c  |s open..")....*||
000139e0  65 6e 64 69 66 0d 09 db  2d 20 20 20 20 20 20 20  |endif...-       |
000139f0  20 f4 20 52 65 6f 70 65  6e 20 77 69 6e 64 6f 77  | . Reopen window|
00013a00  20 69 66 20 61 6c 72 65  61 64 79 20 6f 70 65 6e  | if already open|
00013a10  2e 2e 0d 09 dc 21 20 20  20 20 20 20 20 20 21 77  |.....!        !w|
00013a20  5f 62 6c 6b 25 3d 73 77  5f 6c 69 73 74 25 21 63  |_blk%=sw_list%!c|
00013a30  74 72 25 0d 09 dd 29 20  20 20 20 20 20 20 20 c8  |tr%...)        .|
00013a40  99 20 22 57 69 6d 70 5f  43 6c 6f 73 65 57 69 6e  |. "Wimp_CloseWin|
00013a50  64 6f 77 22 2c 2c 77 5f  62 6c 6b 25 0d 09 de 31  |dow",,w_blk%...1|
00013a60  20 20 20 20 20 20 20 20  f2 73 68 65 6c 6c 5f 4f  |        .shell_O|
00013a70  70 65 6e 57 69 6e 64 6f  77 28 73 77 5f 6c 69 73  |penWindow(sw_lis|
00013a80  74 25 21 63 74 72 25 2c  30 2c 2d 31 29 0d 09 df  |t%!ctr%,0,-1)...|
00013a90  0b 20 20 20 20 20 20 cd  0d 09 e0 09 20 20 20 20  |.      .....    |
00013aa0  cd 0d 09 e1 0f 20 20 20  20 63 74 72 25 2b 3d 34  |.....    ctr%+=4|
00013ab0  0d 09 e2 07 20 20 ce 0d  09 e3 05 cd 0d 09 e4 22  |....  ........."|
00013ac0  f2 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
00013ad0  52 65 74 75 72 6e 28 77  5f 62 6c 6b 25 29 0d 09  |Return(w_blk%)..|
00013ae0  e5 04 0d 09 e6 05 e1 0d  09 e7 27 2a 7c 53 74 6f  |..........'*|Sto|
00013af0  70 20 50 52 4f 43 73 68  65 6c 6c 5f 4d 65 73 73  |p PROCshell_Mess|
00013b00  61 67 65 5f 4d 6f 64 65  43 68 61 6e 67 65 0d 09  |age_ModeChange..|
00013b10  e8 04 0d 09 e9 26 2a 7c  53 74 61 72 74 20 50 52  |.....&*|Start PR|
00013b20  4f 43 73 68 65 6c 6c 5f  4d 65 73 73 61 67 65 5f  |OCshell_Message_|
00013b30  53 68 75 74 64 6f 77 6e  0d 09 ea 22 dd 20 f2 73  |Shutdown...". .s|
00013b40  68 65 6c 6c 5f 4d 65 73  73 61 67 65 5f 53 68 75  |hell_Message_Shu|
00013b50  74 64 6f 77 6e 28 5f 51  25 29 0d 09 eb 11 e7 20  |tdown(_Q%)..... |
00013b60  5f 55 25 21 33 31 32 3e  30 20 8c 0d 09 ec 42 20  |_U%!312>0 ....B |
00013b70  20 f2 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  | .shell_Tracef0(|
00013b80  22 4d 65 73 73 61 67 65  5f 53 68 75 74 64 6f 77  |"Message_Shutdow|
00013b90  6e 3a 53 68 75 74 64 6f  77 6e 20 6d 65 73 73 61  |n:Shutdown messa|
00013ba0  67 65 20 72 65 63 65 69  76 65 64 22 29 0d 09 ed  |ge received")...|
00013bb0  13 20 20 74 65 6d 70 25  3d 5f 55 25 21 33 31 32  |.  temp%=_U%!312|
00013bc0  0d 09 ee 1a 20 20 76 6f  69 64 25 3d a0 28 22 46  |....  void%=.("F|
00013bd0  4e 22 2b 24 74 65 6d 70  25 29 0d 09 ef 05 cd 0d  |N"+$temp%)......|
00013be0  09 f0 05 e1 0d 09 f1 25  2a 7c 53 74 6f 70 20 50  |.......%*|Stop P|
00013bf0  52 4f 43 73 68 65 6c 6c  5f 4d 65 73 73 61 67 65  |ROCshell_Message|
00013c00  5f 53 68 75 74 64 6f 77  6e 0d 09 f2 04 0d 09 f3  |_Shutdown.......|
00013c10  2b 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |+*|Start PROCshe|
00013c20  6c 6c 5f 48 61 6e 64 6c  65 55 6e 6b 6e 6f 77 6e  |ll_HandleUnknown|
00013c30  4d 65 73 73 61 67 65 32  0d 09 f4 27 dd 20 f2 73  |Message2...'. .s|
00013c40  68 65 6c 6c 5f 48 61 6e  64 6c 65 55 6e 6b 6e 6f  |hell_HandleUnkno|
00013c50  77 6e 4d 65 73 73 61 67  65 32 28 5f 51 25 29 0d  |wnMessage2(_Q%).|
00013c60  09 f5 0e ea 20 6d 65 73  73 61 67 65 24 0d 09 f6  |.... message$...|
00013c70  3a f4 20 49 20 77 61 6e  74 20 74 6f 20 68 61 6e  |:. I want to han|
00013c80  64 6c 65 20 6d 65 73 73  61 67 65 20 26 34 33 42  |dle message &43B|
00013c90  30 30 20 68 65 72 65 20  61 73 20 49 20 75 73 65  |00 here as I use|
00013ca0  20 69 74 20 66 6f 72 0d  09 f7 35 f4 20 63 6f 6d  | it for...5. com|
00013cb0  6d 75 6e 69 63 61 74 69  6f 6e 73 20 62 65 74 77  |munications betw|
00013cc0  65 65 6e 20 45 76 6e 74  53 68 65 6c 6c 20 61 70  |een EvntShell ap|
00013cd0  70 6c 69 63 61 74 69 6f  6e 73 2e 2e 0d 09 f8 0f  |plications......|
00013ce0  c8 8e 20 5f 51 25 21 31  36 20 ca 0d 09 f9 2e 20  |.. _Q%!16 ..... |
00013cf0  20 c9 20 26 34 33 42 30  30 3a f4 20 69 6e 63 6f  | . &43B00:. inco|
00013d00  6d 69 6e 67 20 45 76 6e  74 53 68 65 6c 6c 20 6d  |ming EvntShell m|
00013d10  65 73 73 61 67 65 2e 2e  2e 0d 09 fa 1a 20 20 20  |essage.......   |
00013d20  20 6d 65 73 73 61 67 65  24 3d 24 28 5f 51 25 2b  | message$=$(_Q%+|
00013d30  32 30 29 0d 09 fb 3a 20  20 20 20 e7 20 c0 6d 65  |20)...:    . .me|
00013d40  73 73 61 67 65 24 2c 33  30 29 3d 22 45 76 6e 74  |ssage$,30)="Evnt|
00013d50  53 68 65 6c 6c 4c 69 62  3a 53 68 65 6c 6c 44 42  |ShellLib:ShellDB|
00013d60  75 67 20 73 74 61 72 74  65 64 22 20 8c 0d 09 fc  |ug started" ....|
00013d70  1c 20 20 20 20 20 20 e7  20 5f 55 25 21 31 30 30  |.      . _U%!100|
00013d80  20 80 20 31 3c 3c 34 20  8c 0d 09 fd 2a 20 20 20  | . 1<<4 ....*   |
00013d90  20 20 20 20 20 f4 20 74  72 61 63 65 20 69 6e 69  |     . trace ini|
00013da0  74 20 6d 65 73 73 61 67  65 20 70 65 6e 64 69 6e  |t message pendin|
00013db0  67 2e 2e 0d 09 fe 28 20  20 20 20 20 20 20 20 5f  |g.....(        _|
00013dc0  55 25 21 31 30 30 20 3d  20 28 5f 55 25 21 31 30  |U%!100 = (_U%!10|
00013dd0  30 20 82 20 31 20 3c 3c  20 34 29 0d 09 ff 63 20  |0 . 1 << 4)...c |
00013de0  20 20 20 20 20 20 20 f2  73 68 65 6c 6c 5f 42 72  |       .shell_Br|
00013df0  6f 61 64 63 61 73 74 4d  65 73 73 61 67 65 28 26  |oadcastMessage(&|
00013e00  34 33 42 30 30 2c 22 53  68 65 6c 6c 44 42 75 67  |43B00,"ShellDBug|
00013e10  3a 49 6e 69 74 20 44 65  62 75 67 20 6d 65 73 73  |:Init Debug mess|
00013e20  61 67 65 73 20 66 72 6f  6d 20 22 2b a4 73 68 65  |ages from "+.she|
00013e30  6c 6c 5f 47 65 74 41 70  70 4e 61 6d 65 29 0d 0a  |ll_GetAppName)..|
00013e40  00 0b 20 20 20 20 20 20  cd 0d 0a 01 09 20 20 20  |..      .....   |
00013e50  20 cd 0d 0a 02 35 20 20  20 20 e7 20 c0 6d 65 73  | ....5    . .mes|
00013e60  73 61 67 65 24 2c 32 35  29 3d 22 45 76 6e 74 53  |sage$,25)="EvntS|
00013e70  68 65 6c 6c 4c 69 62 3a  54 72 61 63 65 49 6e 69  |hellLib:TraceIni|
00013e80  74 41 63 6b 22 20 8c 0d  0a 03 4f 20 20 20 20 20  |tAck" ....O     |
00013e90  20 f4 20 75 6e 73 65 74  20 74 72 61 63 65 20 69  | . unset trace i|
00013ea0  6e 69 74 20 6d 65 73 73  61 67 65 20 70 65 6e 64  |nit message pend|
00013eb0  69 6e 67 20 66 6c 61 67  2c 20 53 68 65 6c 6c 44  |ing flag, ShellD|
00013ec0  42 75 67 20 68 61 73 20  61 63 6b 6e 6f 77 6c 65  |Bug has acknowle|
00013ed0  64 67 65 64 2e 2e 0d 0a  04 22 20 20 20 20 20 20  |dged....."      |
00013ee0  5f 55 25 21 31 30 30 3d  28 5f 55 25 21 31 30 30  |_U%!100=(_U%!100|
00013ef0  20 82 20 31 3c 3c 34 29  0d 0a 05 09 20 20 20 20  | . 1<<4)....    |
00013f00  cd 0d 0a 06 30 20 20 20  20 e7 20 c0 6d 65 73 73  |....0    . .mess|
00013f10  61 67 65 24 2c 32 30 29  3d 22 45 76 6e 74 53 68  |age$,20)="EvntSh|
00013f20  65 6c 6c 4c 69 62 3a 54  72 61 63 65 4f 6e 22 20  |ellLib:TraceOn" |
00013f30  8c 0d 0a 07 18 20 20 20  20 20 20 f2 73 68 65 6c  |.....      .shel|
00013f40  6c 5f 54 72 61 63 65 4f  6e 0d 0a 08 09 20 20 20  |l_TraceOn....   |
00013f50  20 cd 0d 0a 09 31 20 20  20 20 e7 20 c0 6d 65 73  | ....1    . .mes|
00013f60  73 61 67 65 24 2c 32 31  29 3d 22 45 76 6e 74 53  |sage$,21)="EvntS|
00013f70  68 65 6c 6c 4c 69 62 3a  54 72 61 63 65 4f 66 66  |hellLib:TraceOff|
00013f80  22 20 8c 0d 0a 0a 19 20  20 20 20 20 20 f2 73 68  |" .....      .sh|
00013f90  65 6c 6c 5f 54 72 61 63  65 4f 66 66 0d 0a 0b 09  |ell_TraceOff....|
00013fa0  20 20 20 20 cd 0d 0a 0c  38 20 20 20 20 e7 20 c0  |    ....8    . .|
00013fb0  6d 65 73 73 61 67 65 24  2c 32 38 29 3d 22 45 76  |message$,28)="Ev|
00013fc0  6e 74 53 68 65 6c 6c 4c  69 62 3a 4c 69 73 74 43  |ntShellLib:ListC|
00013fd0  6c 69 63 6b 53 65 6c 65  63 74 22 20 8c 0d 0a 0d  |lickSelect" ....|
00013fe0  20 20 20 20 20 20 20 f2  73 68 65 6c 6c 5f 4c 69  |       .shell_Li|
00013ff0  73 74 43 6c 69 63 6b 53  65 6c 65 63 74 0d 0a 0e  |stClickSelect...|
00014000  09 20 20 20 20 cd 0d 0a  0f 38 20 20 20 20 e7 20  |.    ....8    . |
00014010  c0 6d 65 73 73 61 67 65  24 2c 32 38 29 3d 22 45  |.message$,28)="E|
00014020  76 6e 74 53 68 65 6c 6c  4c 69 62 3a 4c 69 73 74  |vntShellLib:List|
00014030  43 6c 69 63 6b 41 64 6a  75 73 74 22 20 8c 0d 0a  |ClickAdjust" ...|
00014040  10 20 20 20 20 20 20 20  f2 73 68 65 6c 6c 5f 4c  |.       .shell_L|
00014050  69 73 74 43 6c 69 63 6b  41 64 6a 75 73 74 0d 0a  |istClickAdjust..|
00014060  11 09 20 20 20 20 cd 0d  0a 12 35 20 20 20 20 e7  |..    ....5    .|
00014070  20 c0 6d 65 73 73 61 67  65 24 2c 32 35 29 3d 22  | .message$,25)="|
00014080  45 76 6e 74 53 68 65 6c  6c 4c 69 62 3a 4c 69 73  |EvntShellLib:Lis|
00014090  74 48 65 6c 70 54 61 67  73 22 20 8c 0d 0a 13 1d  |tHelpTags" .....|
000140a0  20 20 20 20 20 20 f2 73  68 65 6c 6c 5f 4c 69 73  |      .shell_Lis|
000140b0  74 48 65 6c 70 54 61 67  73 0d 0a 14 09 20 20 20  |tHelpTags....   |
000140c0  20 cd 0d 0a 15 05 cb 0d  0a 16 3b f4 20 50 61 73  | .........;. Pas|
000140d0  73 20 6d 65 73 73 61 67  65 20 62 6c 6f 63 6b 20  |s message block |
000140e0  6f 6e 20 69 6e 20 63 61  73 65 20 74 68 65 20 75  |on in case the u|
000140f0  73 65 72 20 77 61 6e 74  73 20 69 74 20 74 6f 6f  |ser wants it too|
00014100  2e 2e 0d 0a 17 24 f2 73  68 65 6c 6c 5f 48 61 6e  |.....$.shell_Han|
00014110  64 6c 65 55 6e 6b 6e 6f  77 6e 4d 65 73 73 61 67  |dleUnknownMessag|
00014120  65 28 5f 51 25 29 0d 0a  18 05 e1 0d 0a 19 05 3a  |e(_Q%).........:|
00014130  0d 0a 1a 2a 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |...**|Stop PROCs|
00014140  68 65 6c 6c 5f 48 61 6e  64 6c 65 55 6e 6b 6e 6f  |hell_HandleUnkno|
00014150  77 6e 4d 65 73 73 61 67  65 32 0d 0a 1b 04 0d 0a  |wnMessage2......|
00014160  1c 2a 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |.**|Start PROCsh|
00014170  65 6c 6c 5f 48 61 6e 64  6c 65 55 6e 6b 6e 6f 77  |ell_HandleUnknow|
00014180  6e 4d 65 73 73 61 67 65  0d 0a 1d 26 dd 20 f2 73  |nMessage...&. .s|
00014190  68 65 6c 6c 5f 48 61 6e  64 6c 65 55 6e 6b 6e 6f  |hell_HandleUnkno|
000141a0  77 6e 4d 65 73 73 61 67  65 28 5f 51 25 29 0d 0a  |wnMessage(_Q%)..|
000141b0  1e 05 e1 0d 0a 1f 05 3a  0d 0a 20 29 2a 7c 53 74  |.......:.. )*|St|
000141c0  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 48 61 6e  |op PROCshell_Han|
000141d0  64 6c 65 55 6e 6b 6e 6f  77 6e 4d 65 73 73 61 67  |dleUnknownMessag|
000141e0  65 0d 0a 21 04 0d 0a 22  2a 2a 7c 53 74 61 72 74  |e..!..."**|Start|
000141f0  20 50 52 4f 43 73 68 65  6c 6c 5f 41 74 74 61 63  | PROCshell_Attac|
00014200  68 50 72 65 51 75 69 74  48 61 6e 64 6c 65 72 0d  |hPreQuitHandler.|
00014210  0a 23 26 dd 20 f2 73 68  65 6c 6c 5f 41 74 74 61  |.#&. .shell_Atta|
00014220  63 68 50 72 65 51 75 69  74 48 61 6e 64 6c 65 72  |chPreQuitHandler|
00014230  28 66 6e 24 29 0d 0a 24  11 ea 20 74 65 6d 70 25  |(fn$)..$.. temp%|
00014240  2c 76 6f 69 64 25 0d 0a  25 31 e7 20 5f 55 25 21  |,void%..%1. _U%!|
00014250  33 30 30 3e 30 20 8c 20  f2 73 68 65 6c 6c 5f 48  |300>0 . .shell_H|
00014260  65 61 70 42 6c 6f 63 6b  52 65 74 75 72 6e 28 5f  |eapBlockReturn(_|
00014270  55 25 21 33 30 30 29 0d  0a 26 29 5f 55 25 21 33  |U%!300)..&)_U%!3|
00014280  30 30 3d a4 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |00=.shell_HeapBl|
00014290  6f 63 6b 46 65 74 63 68  28 a9 66 6e 24 2b 31 29  |ockFetch(.fn$+1)|
000142a0  0d 0a 27 1c 74 65 6d 70  25 3d 5f 55 25 21 33 30  |..'.temp%=_U%!30|
000142b0  30 3a 24 74 65 6d 70 25  3d 66 6e 24 0d 0a 28 05  |0:$temp%=fn$..(.|
000142c0  e1 0d 0a 29 05 3a 0d 0a  2a 29 2a 7c 53 74 6f 70  |...).:..*)*|Stop|
000142d0  20 50 52 4f 43 73 68 65  6c 6c 5f 41 74 74 61 63  | PROCshell_Attac|
000142e0  68 50 72 65 51 75 69 74  48 61 6e 64 6c 65 72 0d  |hPreQuitHandler.|
000142f0  0a 2b 04 0d 0a 2c 2b 2a  7c 53 74 61 72 74 20 50  |.+...,+*|Start P|
00014300  52 4f 43 73 68 65 6c 6c  5f 41 74 74 61 63 68 53  |ROCshell_AttachS|
00014310  68 75 74 64 6f 77 6e 48  61 6e 64 6c 65 72 0d 0a  |hutdownHandler..|
00014320  2d 27 dd 20 f2 73 68 65  6c 6c 5f 41 74 74 61 63  |-'. .shell_Attac|
00014330  68 53 68 75 74 64 6f 77  6e 48 61 6e 64 6c 65 72  |hShutdownHandler|
00014340  28 66 6e 24 29 0d 0a 2e  11 ea 20 74 65 6d 70 25  |(fn$)..... temp%|
00014350  2c 76 6f 69 64 25 0d 0a  2f 31 e7 20 5f 55 25 21  |,void%../1. _U%!|
00014360  33 31 32 3e 30 20 8c 20  f2 73 68 65 6c 6c 5f 48  |312>0 . .shell_H|
00014370  65 61 70 42 6c 6f 63 6b  52 65 74 75 72 6e 28 5f  |eapBlockReturn(_|
00014380  55 25 21 33 31 32 29 0d  0a 30 29 5f 55 25 21 33  |U%!312)..0)_U%!3|
00014390  31 32 3d a4 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |12=.shell_HeapBl|
000143a0  6f 63 6b 46 65 74 63 68  28 a9 66 6e 24 2b 31 29  |ockFetch(.fn$+1)|
000143b0  0d 0a 31 1c 74 65 6d 70  25 3d 5f 55 25 21 33 31  |..1.temp%=_U%!31|
000143c0  32 3a 24 74 65 6d 70 25  3d 66 6e 24 0d 0a 32 05  |2:$temp%=fn$..2.|
000143d0  e1 0d 0a 33 05 3a 0d 0a  34 2a 2a 7c 53 74 6f 70  |...3.:..4**|Stop|
000143e0  20 50 52 4f 43 73 68 65  6c 6c 5f 41 74 74 61 63  | PROCshell_Attac|
000143f0  68 53 68 75 74 64 6f 77  6e 48 61 6e 64 6c 65 72  |hShutdownHandler|
00014400  0d 0a 35 04 0d 0a 36 2d  2a 7c 53 74 61 72 74 20  |..5...6-*|Start |
00014410  50 52 4f 43 73 68 65 6c  6c 5f 41 74 74 61 63 68  |PROCshell_Attach|
00014420  4d 6f 64 65 43 68 61 6e  67 65 48 61 6e 64 6c 65  |ModeChangeHandle|
00014430  72 0d 0a 37 29 dd 20 f2  73 68 65 6c 6c 5f 41 74  |r..7). .shell_At|
00014440  74 61 63 68 4d 6f 64 65  43 68 61 6e 67 65 48 61  |tachModeChangeHa|
00014450  6e 64 6c 65 72 28 66 6e  24 29 0d 0a 38 11 ea 20  |ndler(fn$)..8.. |
00014460  74 65 6d 70 25 2c 76 6f  69 64 25 0d 0a 39 31 e7  |temp%,void%..91.|
00014470  20 5f 55 25 21 31 36 30  3e 30 20 8c 20 f2 73 68  | _U%!160>0 . .sh|
00014480  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 52 65 74  |ell_HeapBlockRet|
00014490  75 72 6e 28 5f 55 25 21  31 36 30 29 0d 0a 3a 29  |urn(_U%!160)..:)|
000144a0  5f 55 25 21 31 36 30 3d  a4 73 68 65 6c 6c 5f 48  |_U%!160=.shell_H|
000144b0  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 a9 66  |eapBlockFetch(.f|
000144c0  6e 24 2b 31 29 0d 0a 3b  1c 74 65 6d 70 25 3d 5f  |n$+1)..;.temp%=_|
000144d0  55 25 21 31 36 30 3a 24  74 65 6d 70 25 3d 66 6e  |U%!160:$temp%=fn|
000144e0  24 0d 0a 3c 15 76 6f 69  64 25 3d a0 28 22 46 4e  |$..<.void%=.("FN|
000144f0  22 2b 66 6e 24 29 0d 0a  3d 05 e1 0d 0a 3e 05 3a  |"+fn$)..=....>.:|
00014500  0d 0a 3f 2c 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |..?,*|Stop PROCs|
00014510  68 65 6c 6c 5f 41 74 74  61 63 68 4d 6f 64 65 43  |hell_AttachModeC|
00014520  68 61 6e 67 65 48 61 6e  64 6c 65 72 0d 0a 40 04  |hangeHandler..@.|
00014530  0d 0a 41 30 2a 7c 53 74  61 72 74 20 50 52 4f 43  |..A0*|Start PROC|
00014540  73 68 65 6c 6c 5f 41 74  74 61 63 68 50 61 6c 65  |shell_AttachPale|
00014550  74 74 65 43 68 61 6e 67  65 48 61 6e 64 6c 65 72  |tteChangeHandler|
00014560  0d 0a 42 2c dd 20 f2 73  68 65 6c 6c 5f 41 74 74  |..B,. .shell_Att|
00014570  61 63 68 50 61 6c 65 74  74 65 43 68 61 6e 67 65  |achPaletteChange|
00014580  48 61 6e 64 6c 65 72 28  66 6e 24 29 0d 0a 43 11  |Handler(fn$)..C.|
00014590  ea 20 74 65 6d 70 25 2c  76 6f 69 64 25 0d 0a 44  |. temp%,void%..D|
000145a0  31 e7 20 5f 55 25 21 31  36 34 3e 30 20 8c 20 f2  |1. _U%!164>0 . .|
000145b0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 52  |shell_HeapBlockR|
000145c0  65 74 75 72 6e 28 5f 55  25 21 31 36 34 29 0d 0a  |eturn(_U%!164)..|
000145d0  45 29 5f 55 25 21 31 36  34 3d a4 73 68 65 6c 6c  |E)_U%!164=.shell|
000145e0  5f 48 65 61 70 42 6c 6f  63 6b 46 65 74 63 68 28  |_HeapBlockFetch(|
000145f0  a9 66 6e 24 2b 31 29 0d  0a 46 1c 74 65 6d 70 25  |.fn$+1)..F.temp%|
00014600  3d 5f 55 25 21 31 36 34  3a 24 74 65 6d 70 25 3d  |=_U%!164:$temp%=|
00014610  66 6e 24 0d 0a 47 15 76  6f 69 64 25 3d a0 28 22  |fn$..G.void%=.("|
00014620  46 4e 22 2b 66 6e 24 29  0d 0a 48 05 e1 0d 0a 49  |FN"+fn$)..H....I|
00014630  05 3a 0d 0a 4a 2f 2a 7c  53 74 6f 70 20 50 52 4f  |.:..J/*|Stop PRO|
00014640  43 73 68 65 6c 6c 5f 41  74 74 61 63 68 50 61 6c  |Cshell_AttachPal|
00014650  65 74 74 65 43 68 61 6e  67 65 48 61 6e 64 6c 65  |etteChangeHandle|
00014660  72 0d 0a 4b 04 0d 0a 4c  31 2a 7c 53 74 61 72 74  |r..K...L1*|Start|
00014670  20 50 52 4f 43 73 68 65  6c 6c 5f 41 74 74 61 63  | PROCshell_Attac|
00014680  68 54 61 73 6b 49 6e 69  74 69 61 6c 69 73 65 48  |hTaskInitialiseH|
00014690  61 6e 64 6c 65 72 0d 0a  4d 2d dd 20 f2 73 68 65  |andler..M-. .she|
000146a0  6c 6c 5f 41 74 74 61 63  68 54 61 73 6b 49 6e 69  |ll_AttachTaskIni|
000146b0  74 69 61 6c 69 73 65 48  61 6e 64 6c 65 72 28 66  |tialiseHandler(f|
000146c0  6e 24 29 0d 0a 4e 11 ea  20 74 65 6d 70 25 2c 76  |n$)..N.. temp%,v|
000146d0  6f 69 64 25 0d 0a 4f 31  e7 20 5f 55 25 21 31 36  |oid%..O1. _U%!16|
000146e0  38 3e 30 20 8c 20 f2 73  68 65 6c 6c 5f 48 65 61  |8>0 . .shell_Hea|
000146f0  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 5f 55 25  |pBlockReturn(_U%|
00014700  21 31 36 38 29 0d 0a 50  29 5f 55 25 21 31 36 38  |!168)..P)_U%!168|
00014710  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
00014720  6b 46 65 74 63 68 28 a9  66 6e 24 2b 31 29 0d 0a  |kFetch(.fn$+1)..|
00014730  51 1c 74 65 6d 70 25 3d  5f 55 25 21 31 36 38 3a  |Q.temp%=_U%!168:|
00014740  24 74 65 6d 70 25 3d 66  6e 24 0d 0a 52 05 e1 0d  |$temp%=fn$..R...|
00014750  0a 53 05 3a 0d 0a 54 30  2a 7c 53 74 6f 70 20 50  |.S.:..T0*|Stop P|
00014760  52 4f 43 73 68 65 6c 6c  5f 41 74 74 61 63 68 54  |ROCshell_AttachT|
00014770  61 73 6b 49 6e 69 74 69  61 6c 69 73 65 48 61 6e  |askInitialiseHan|
00014780  64 6c 65 72 0d 0a 55 04  0d 0a 56 30 2a 7c 53 74  |dler..U...V0*|St|
00014790  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 41 74  |art PROCshell_At|
000147a0  74 61 63 68 54 61 73 6b  43 6c 6f 73 65 44 6f 77  |tachTaskCloseDow|
000147b0  6e 48 61 6e 64 6c 65 72  0d 0a 57 2c dd 20 f2 73  |nHandler..W,. .s|
000147c0  68 65 6c 6c 5f 41 74 74  61 63 68 54 61 73 6b 43  |hell_AttachTaskC|
000147d0  6c 6f 73 65 44 6f 77 6e  48 61 6e 64 6c 65 72 28  |loseDownHandler(|
000147e0  66 6e 24 29 0d 0a 58 11  ea 20 74 65 6d 70 25 2c  |fn$)..X.. temp%,|
000147f0  76 6f 69 64 25 0d 0a 59  31 e7 20 5f 55 25 21 31  |void%..Y1. _U%!1|
00014800  37 32 3e 30 20 8c 20 f2  73 68 65 6c 6c 5f 48 65  |72>0 . .shell_He|
00014810  61 70 42 6c 6f 63 6b 52  65 74 75 72 6e 28 5f 55  |apBlockReturn(_U|
00014820  25 21 31 37 32 29 0d 0a  5a 29 5f 55 25 21 31 37  |%!172)..Z)_U%!17|
00014830  32 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |2=.shell_HeapBlo|
00014840  63 6b 46 65 74 63 68 28  a9 66 6e 24 2b 31 29 0d  |ckFetch(.fn$+1).|
00014850  0a 5b 1c 74 65 6d 70 25  3d 5f 55 25 21 31 37 32  |.[.temp%=_U%!172|
00014860  3a 24 74 65 6d 70 25 3d  66 6e 24 0d 0a 5c 05 e1  |:$temp%=fn$..\..|
00014870  0d 0a 5d 05 3a 0d 0a 5e  2f 2a 7c 53 74 6f 70 20  |..].:..^/*|Stop |
00014880  50 52 4f 43 73 68 65 6c  6c 5f 41 74 74 61 63 68  |PROCshell_Attach|
00014890  54 61 73 6b 43 6c 6f 73  65 44 6f 77 6e 48 61 6e  |TaskCloseDownHan|
000148a0  64 6c 65 72 0d 0a 5f 04  0d 0a 60 1e 2a 7c 53 74  |dler.._...`.*|St|
000148b0  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 52 41  |art PROCshell_RA|
000148c0  4d 46 65 74 63 68 0d 0a  61 1a dd 20 f2 73 68 65  |MFetch..a.. .she|
000148d0  6c 6c 5f 52 41 4d 46 65  74 63 68 28 5f 51 25 29  |ll_RAMFetch(_Q%)|
000148e0  0d 0a 62 26 ea 20 52 41  4d 46 65 74 63 68 5f 62  |..b&. RAMFetch_b|
000148f0  75 66 66 65 72 25 2c 6c  65 6e 5f 64 61 74 61 25  |uffer%,len_data%|
00014900  2c 64 6f 6e 65 25 0d 0a  63 0b 64 6f 6e 65 25 3d  |,done%..c.done%=|
00014910  a3 0d 0a 64 46 f4 20 49  66 20 74 68 65 20 61 64  |...dF. If the ad|
00014920  64 72 65 73 73 20 69 6e  20 74 68 65 20 64 61 74  |dress in the dat|
00014930  61 20 73 61 76 65 20 65  76 65 6e 74 20 62 6c 6f  |a save event blo|
00014940  63 6b 20 3c 26 38 30 30  30 20 74 68 65 6e 20 69  |ck <&8000 then i|
00014950  74 20 69 73 20 61 6e 0d  0a 65 49 f4 20 65 73 74  |t is an..eI. est|
00014960  69 6d 61 74 65 64 20 73  69 7a 65 20 61 6e 64 20  |imated size and |
00014970  74 68 65 20 66 69 6c 65  20 69 73 20 6e 6f 74 20  |the file is not |
00014980  61 6c 72 65 61 64 79 20  70 72 65 73 65 6e 74 20  |already present |
00014990  69 6e 20 61 20 52 41 4d  20 62 75 66 66 65 72 2e  |in a RAM buffer.|
000149a0  0d 0a 66 4b f4 20 49 6e  20 74 68 69 73 20 63 61  |..fK. In this ca|
000149b0  73 65 20 69 67 6e 6f 72  65 20 52 41 4d 46 65 74  |se ignore RAMFet|
000149c0  63 68 20 6d 65 73 73 61  67 65 20 61 73 20 74 68  |ch message as th|
000149d0  65 20 64 61 74 61 20 77  69 6c 6c 20 62 65 20 77  |e data will be w|
000149e0  72 69 74 74 65 6e 20 74  6f 20 61 0d 0a 67 13 f4  |ritten to a..g..|
000149f0  20 66 69 6c 65 20 61 6e  79 77 61 79 2e 2e 0d 0a  | file anyway....|
00014a00  68 15 e7 20 5f 55 25 21  31 34 34 3e 26 38 30 30  |h.. _U%!144>&800|
00014a10  30 20 8c 0d 0a 69 20 20  20 f4 20 53 65 6e 64 20  |0 ...i   . Send |
00014a20  66 69 6c 65 20 74 6f 20  61 70 70 6c 69 63 61 74  |file to applicat|
00014a30  69 6f 6e 0d 0a 6a 23 20  20 f4 20 73 65 6e 64 20  |ion..j#  . send |
00014a40  52 41 4d 54 72 61 6e 73  6d 69 74 20 6d 65 73 73  |RAMTransmit mess|
00014a50  61 67 65 2e 2e 2e 0d 0a  6b 15 2a 7c 69 66 64 65  |age.....k.*|ifde|
00014a60  66 20 54 72 61 63 65 49  6e 69 74 0d 0a 6c 32 20  |f TraceInit..l2 |
00014a70  20 f2 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  | .shell_Tracef0(|
00014a80  22 52 41 4d 46 65 74 63  68 3a 52 41 4d 46 65 74  |"RAMFetch:RAMFet|
00014a90  63 68 20 63 61 6c 6c 65  64 2e 2e 22 29 0d 0a 6d  |ch called..")..m|
00014aa0  0b 2a 7c 65 6e 64 69 66  0d 0a 6e 13 20 20 5f 51  |.*|endif..n.  _Q|
00014ab0  25 21 31 32 3d 5f 51 25  21 30 38 0d 0a 6f 2b 20  |%!12=_Q%!08..o+ |
00014ac0  20 5f 51 25 21 31 36 3d  37 3a f4 20 6d 65 73 73  | _Q%!16=7:. mess|
00014ad0  61 67 65 20 61 63 74 69  6f 6e 20 52 41 4d 54 72  |age action RAMTr|
00014ae0  61 6e 73 6d 69 74 0d 0a  70 1b 20 20 f4 20 67 65  |ansmit..p.  . ge|
00014af0  74 20 62 75 66 66 65 72  20 6c 65 6e 67 74 68 2e  |t buffer length.|
00014b00  2e 0d 0a 71 17 20 20 6c  65 6e 5f 64 61 74 61 25  |...q.  len_data%|
00014b10  3d 5f 55 25 21 31 33 36  0d 0a 72 16 20 20 e7 20  |=_U%!136..r.  . |
00014b20  5f 55 25 21 31 34 30 3d  26 46 46 39 20 8c 0d 0a  |_U%!140=&FF9 ...|
00014b30  73 48 20 20 20 20 f4 20  6b 6c 75 64 67 65 20 66  |sH    . kludge f|
00014b40  6f 72 20 73 70 72 69 74  65 20 66 69 6c 65 73 20  |or sprite files |
00014b50  62 65 63 61 75 73 65 20  77 68 65 6e 20 73 61 76  |because when sav|
00014b60  69 6e 67 20 74 6f 20 61  20 70 68 79 73 69 63 61  |ing to a physica|
00014b70  6c 20 66 69 6c 65 0d 0a  74 49 20 20 20 20 f4 20  |l file..tI    . |
00014b80  77 69 74 68 20 22 4f 53  5f 53 70 72 69 74 65 4f  |with "OS_SpriteO|
00014b90  70 22 20 74 68 65 20 66  69 72 73 74 20 77 6f 72  |p" the first wor|
00014ba0  64 20 69 73 20 64 72 6f  70 70 65 64 2e 20 48 65  |d is dropped. He|
00014bb0  6e 63 65 20 66 6f 72 20  74 68 65 20 52 41 4d 0d  |nce for the RAM.|
00014bc0  0a 75 49 20 20 20 20 f4  20 73 61 76 65 20 77 65  |.uI    . save we|
00014bd0  20 68 61 76 65 20 74 6f  20 69 6e 63 72 65 6d 65  | have to increme|
00014be0  6d 74 20 74 68 65 20 61  64 64 72 65 73 73 20 74  |mt the address t|
00014bf0  68 65 20 64 61 74 61 20  69 73 20 68 65 6c 64 20  |he data is held |
00014c00  61 74 20 62 79 20 34 21  0d 0a 76 4d 20 20 20 20  |at by 4!..vM    |
00014c10  f4 20 54 68 65 20 65 73  74 69 6d 61 74 65 64 20  |. The estimated |
00014c20  73 69 7a 65 20 68 61 73  20 61 6c 72 65 61 64 79  |size has already|
00014c30  20 62 65 65 6e 20 6b 6c  75 64 67 65 64 20 69 6e  | been kludged in|
00014c40  20 73 68 65 6c 6c 5f 41  74 74 61 63 68 44 61 74  | shell_AttachDat|
00014c50  61 53 61 76 65 0d 0a 77  12 20 20 20 20 5f 55 25  |aSave..w.    _U%|
00014c60  21 31 34 34 2b 3d 34 0d  0a 78 07 20 20 cd 0d 0a  |!144+=4..x.  ...|
00014c70  79 24 20 20 e7 20 28 6c  65 6e 5f 64 61 74 61 25  |y$  . (len_data%|
00014c80  2d 5f 55 25 21 31 32 38  29 3c 5f 51 25 21 32 34  |-_U%!128)<_Q%!24|
00014c90  20 8c 0d 0a 7a 26 20 20  20 20 f4 20 20 54 68 69  | ...z&    .  Thi|
00014ca0  73 20 77 69 6c 6c 20 62  65 20 74 68 65 20 6c 61  |s will be the la|
00014cb0  73 74 20 62 6c 6f 63 6b  0d 0a 7b 20 20 20 20 20  |st block..{     |
00014cc0  5f 51 25 21 32 34 3d 6c  65 6e 5f 64 61 74 61 25  |_Q%!24=len_data%|
00014cd0  2d 5f 55 25 21 31 32 38  0d 0a 7c 0f 20 20 20 20  |-_U%!128..|.    |
00014ce0  64 6f 6e 65 25 3d b9 0d  0a 7d 07 20 20 cc 0d 0a  |done%=...}.  ...|
00014cf0  7e 15 2a 7c 69 66 64 65  66 20 54 72 61 63 65 49  |~.*|ifdef TraceI|
00014d00  6e 69 74 0d 0a 7f 2e 20  20 f2 73 68 65 6c 6c 5f  |nit....  .shell_|
00014d10  54 72 61 63 65 66 30 28  22 52 41 4d 46 65 74 63  |Tracef0("RAMFetc|
00014d20  68 3a 53 65 6e 64 69 6e  67 20 62 6c 6f 63 6b 22  |h:Sending block"|
00014d30  29 0d 0a 80 0b 2a 7c 65  6e 64 69 66 0d 0a 81 07  |)....*|endif....|
00014d40  20 20 cd 0d 0a 82 4a 20  20 c8 99 20 22 57 69 6d  |  ....J  .. "Wim|
00014d50  70 5f 54 72 61 6e 73 66  65 72 42 6c 6f 63 6b 22  |p_TransferBlock"|
00014d60  2c 5f 55 25 21 31 34 38  2c 5f 55 25 21 31 34 34  |,_U%!148,_U%!144|
00014d70  2b 5f 55 25 21 31 32 38  2c 5f 51 25 21 30 34 2c  |+_U%!128,_Q%!04,|
00014d80  5f 51 25 21 32 30 2c 5f  51 25 21 32 34 0d 0a 83  |_Q%!20,_Q%!24...|
00014d90  29 20 20 c8 99 20 22 57  69 6d 70 5f 53 65 6e 64  |)  .. "Wimp_Send|
00014da0  4d 65 73 73 61 67 65 22  2c 31 37 2c 5f 51 25 2c  |Message",17,_Q%,|
00014db0  5f 51 25 21 30 34 0d 0a  84 20 20 20 5f 55 25 21  |_Q%!04...   _U%!|
00014dc0  31 32 30 3d 5f 51 25 21  38 20 20 3a f4 20 53 61  |120=_Q%!8  :. Sa|
00014dd0  76 65 52 65 66 25 0d 0a  85 1f 20 20 5f 55 25 21  |veRef%....  _U%!|
00014de0  31 32 38 2b 3d 5f 51 25  21 32 34 3a f4 20 52 41  |128+=_Q%!24:. RA|
00014df0  4d 50 74 72 25 0d 0a 86  19 20 20 e7 20 64 6f 6e  |MPtr%....  . don|
00014e00  65 25 20 8c 20 5f 55 25  21 31 32 38 3d 30 0d 0a  |e% . _U%!128=0..|
00014e10  87 05 cd 0d 0a 88 05 e1  0d 0a 89 05 3a 0d 0a 8a  |............:...|
00014e20  1d 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  |.*|Stop PROCshel|
00014e30  6c 5f 52 41 4d 46 65 74  63 68 0d 0a 8b 21 2a 7c  |l_RAMFetch...!*||
00014e40  53 74 61 72 74 20 50 52  4f 43 73 68 65 6c 6c 5f  |Start PROCshell_|
00014e50  52 41 4d 54 72 61 6e 73  6d 69 74 0d 0a 8c 1d dd  |RAMTransmit.....|
00014e60  20 f2 73 68 65 6c 6c 5f  52 41 4d 54 72 61 6e 73  | .shell_RAMTrans|
00014e70  6d 69 74 28 5f 51 25 29  0d 0a 8d 20 ea 20 6f 66  |mit(_Q%)... . of|
00014e80  66 73 65 74 25 2c 62 6c  6b 25 2c 66 5f 6e 61 6d  |fset%,blk%,f_nam|
00014e90  65 24 2c 74 65 6d 70 25  0d 0a 8e 36 f4 20 52 65  |e$,temp%...6. Re|
00014ea0  63 65 69 76 65 20 66 69  6c 65 20 66 72 6f 6d 20  |ceive file from |
00014eb0  61 70 70 6c 69 63 61 74  69 6f 6e 20 76 69 61 20  |application via |
00014ec0  52 41 4d 20 74 72 61 6e  73 66 65 72 2e 2e 0d 0a  |RAM transfer....|
00014ed0  8f 16 e7 20 5f 51 25 21  31 32 3d 5f 55 25 21 31  |... _Q%!12=_U%!1|
00014ee0  31 32 20 8c 0d 0a 90 15  20 20 5f 55 25 21 31 32  |12 .....  _U%!12|
00014ef0  38 2b 3d 5f 51 25 21 32  34 0d 0a 91 18 20 20 e7  |8+=_Q%!24....  .|
00014f00  20 5f 51 25 21 32 34 3c  5f 55 25 21 31 33 32 20  | _Q%!24<_U%!132 |
00014f10  8c 0d 0a 92 21 20 20 20  20 f4 20 54 68 69 73 20  |....!    . This |
00014f20  77 61 73 20 74 68 65 20  6c 61 73 74 20 62 6c 6f  |was the last blo|
00014f30  63 6b 0d 0a 93 15 2a 7c  69 66 64 65 66 20 54 72  |ck....*|ifdef Tr|
00014f40  61 63 65 49 6e 69 74 0d  0a 94 37 20 20 f2 73 68  |aceInit...7  .sh|
00014f50  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 52 41 4d  |ell_Tracef0("RAM|
00014f60  54 72 61 6e 73 6d 69 74  3a 4c 61 73 74 20 62 6c  |Transmit:Last bl|
00014f70  6f 63 6b 20 72 65 63 65  69 76 65 64 22 29 0d 0a  |ock received")..|
00014f80  95 0b 2a 7c 65 6e 64 69  66 0d 0a 96 44 20 20 20  |..*|endif...D   |
00014f90  20 6f 66 66 73 65 74 25  3d a4 73 68 65 6c 6c 5f  | offset%=.shell_|
00014fa0  47 65 74 45 76 65 6e 74  4c 69 73 74 4f 66 66 73  |GetEventListOffs|
00014fb0  65 74 28 5f 55 25 21 32  38 2c 5f 55 25 21 33 32  |et(_U%!28,_U%!32|
00014fc0  2c 5f 55 25 2b 39 36 2c  31 36 2c a3 29 0d 0a 97  |,_U%+96,16,.)...|
00014fd0  1b 20 20 20 20 62 6c 6b  25 3d 5f 55 25 21 39 36  |.    blk%=_U%!96|
00014fe0  2b 6f 66 66 73 65 74 25  0d 0a 98 15 2a 7c 69 66  |+offset%....*|if|
00014ff0  64 65 66 20 54 72 61 63  65 49 6e 69 74 0d 0a 99  |def TraceInit...|
00015000  33 20 20 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |3  .shell_Tracef|
00015010  30 28 22 52 41 4d 54 72  61 6e 73 6d 69 74 3a 5f  |0("RAMTransmit:_|
00015020  55 25 21 32 38 3d 22 2b  c3 5f 55 25 21 32 38 29  |U%!28="+._U%!28)|
00015030  0d 0a 9a 33 20 20 f2 73  68 65 6c 6c 5f 54 72 61  |...3  .shell_Tra|
00015040  63 65 66 30 28 22 52 41  4d 54 72 61 6e 73 6d 69  |cef0("RAMTransmi|
00015050  74 3a 5f 55 25 21 33 32  3d 22 2b c3 5f 55 25 21  |t:_U%!32="+._U%!|
00015060  33 32 29 0d 0a 9b 35 20  20 f2 73 68 65 6c 6c 5f  |32)...5  .shell_|
00015070  54 72 61 63 65 66 30 28  22 52 41 4d 54 72 61 6e  |Tracef0("RAMTran|
00015080  73 6d 69 74 3a 6f 66 66  73 65 74 25 3d 22 2b c3  |smit:offset%="+.|
00015090  6f 66 66 73 65 74 25 29  0d 0a 9c 0b 2a 7c 65 6e  |offset%)....*|en|
000150a0  64 69 66 0d 0a 9d 33 20  20 20 20 f4 20 6e 6f 77  |dif...3    . now|
000150b0  20 63 61 6c 6c 20 75 73  65 72 20 66 75 6e 63 74  | call user funct|
000150c0  69 6f 6e 20 61 66 74 65  72 20 66 69 6c 65 20 6c  |ion after file l|
000150d0  6f 61 64 2e 2e 2e 0d 0a  9e 4c 20 20 20 20 f4 20  |oad......L    . |
000150e0  75 73 65 20 63 6f 70 79  20 6f 66 20 64 61 74 61  |use copy of data|
000150f0  73 61 76 65 20 6d 65 73  73 61 67 65 20 62 6c 6f  |save message blo|
00015100  63 6b 20 74 6f 20 66 69  6e 64 20 66 69 6c 65 20  |ck to find file |
00015110  74 79 70 65 2c 20 66 69  6c 65 20 6e 61 6d 65 2e  |type, file name.|
00015120  2e 2e 0d 0a 9f 15 20 20  20 20 74 65 6d 70 25 3d  |......    temp%=|
00015130  5f 55 25 21 31 35 36 0d  0a a0 2a 20 20 20 20 66  |_U%!156...*    f|
00015140  5f 6e 61 6d 65 24 3d a4  73 68 65 6c 6c 5f 47 65  |_name$=.shell_Ge|
00015150  74 53 74 72 69 6e 67 28  74 65 6d 70 25 2b 34 34  |tString(temp%+44|
00015160  29 0d 0a a1 4b 20 20 20  20 f2 73 68 65 6c 6c 5f  |)...K    .shell_|
00015170  55 73 65 72 46 4e 4c 6f  61 64 46 69 6c 65 28 74  |UserFNLoadFile(t|
00015180  65 6d 70 25 21 34 30 2c  5f 55 25 21 31 35 32 2c  |emp%!40,_U%!152,|
00015190  62 6c 6b 25 21 38 2c 66  5f 6e 61 6d 65 24 2c 5f  |blk%!8,f_name$,_|
000151a0  55 25 21 31 33 32 2c 62  6c 6b 25 29 0d 0a a2 07  |U%!132,blk%)....|
000151b0  20 20 cc 0d 0a a3 27 20  20 20 20 f4 20 54 68 65  |  ....'    . The|
000151c0  72 65 20 61 72 65 20 6d  6f 72 65 20 62 6c 6f 63  |re are more bloc|
000151d0  6b 73 20 74 6f 20 63 6f  6d 65 0d 0a a4 15 2a 7c  |ks to come....*||
000151e0  69 66 64 65 66 20 54 72  61 63 65 49 6e 69 74 0d  |ifdef TraceInit.|
000151f0  0a a5 32 20 20 f2 73 68  65 6c 6c 5f 54 72 61 63  |..2  .shell_Trac|
00015200  65 66 30 28 22 52 41 4d  54 72 61 6e 73 6d 69 74  |ef0("RAMTransmit|
00015210  3a 42 6c 6f 63 6b 20 72  65 63 65 69 76 65 64 22  |:Block received"|
00015220  29 0d 0a a6 0b 2a 7c 65  6e 64 69 66 0d 0a a7 3d  |)....*|endif...=|
00015230  20 20 20 20 f4 20 63 68  65 63 6b 20 73 69 7a 65  |    . check size|
00015240  20 6f 66 20 69 6e 63 6f  6d 69 6e 67 20 62 6c 6f  | of incoming blo|
00015250  63 6b 20 61 6e 64 20 69  6e 63 72 65 61 73 65 20  |ck and increase |
00015260  62 75 66 66 65 72 20 69  66 0d 0a a8 15 20 20 20  |buffer if....   |
00015270  20 f4 20 72 65 71 75 69  72 65 64 2e 2e 2e 0d 0a  | . required.....|
00015280  a9 1b 20 20 20 20 e7 20  5f 55 25 21 31 32 38 3e  |..    . _U%!128>|
00015290  5f 55 25 21 31 33 32 20  8c 0d 0a aa 15 2a 7c 69  |_U%!132 .....*|i|
000152a0  66 64 65 66 20 54 72 61  63 65 49 6e 69 74 0d 0a  |fdef TraceInit..|
000152b0  ab 3c 20 20 f2 73 68 65  6c 6c 5f 54 72 61 63 65  |.<  .shell_Trace|
000152c0  66 30 28 22 52 41 4d 54  72 61 6e 73 6d 69 74 3a  |f0("RAMTransmit:|
000152d0  49 6e 63 72 65 61 73 69  6e 67 20 62 75 66 66 65  |Increasing buffe|
000152e0  72 20 73 69 7a 65 2e 2e  22 29 0d 0a ac 0b 2a 7c  |r size..")....*||
000152f0  65 6e 64 69 66 0d 0a ad  41 20 20 20 20 20 20 5f  |endif...A      _|
00015300  55 25 21 31 35 32 3d a4  73 68 65 6c 6c 5f 48 65  |U%!152=.shell_He|
00015310  61 70 42 6c 6f 63 6b 45  78 74 65 6e 64 28 5f 55  |apBlockExtend(_U|
00015320  25 21 31 35 32 2c 5f 55  25 21 31 32 38 2c 5f 55  |%!152,_U%!128,_U|
00015330  25 21 31 33 32 29 0d 0a  ae 09 20 20 20 20 cd 0d  |%!132)....    ..|
00015340  0a af 15 20 20 20 20 5f  51 25 21 31 32 3d 5f 51  |...    _Q%!12=_Q|
00015350  25 21 30 38 0d 0a b0 10  20 20 20 20 5f 51 25 21  |%!08....    _Q%!|
00015360  31 36 3d 36 0d 0a b1 1e  20 20 20 20 5f 51 25 21  |16=6....    _Q%!|
00015370  32 30 3d 5f 55 25 21 31  35 32 2b 5f 55 25 21 31  |20=_U%!152+_U%!1|
00015380  32 38 0d 0a b2 16 20 20  20 20 5f 51 25 21 32 34  |28....    _Q%!24|
00015390  3d 5f 55 25 21 31 33 32  0d 0a b3 2b 20 20 20 20  |=_U%!132...+    |
000153a0  c8 99 20 22 57 69 6d 70  5f 53 65 6e 64 4d 65 73  |.. "Wimp_SendMes|
000153b0  73 61 67 65 22 2c 31 38  2c 5f 51 25 2c 5f 51 25  |sage",18,_Q%,_Q%|
000153c0  21 30 34 0d 0a b4 16 20  20 20 20 5f 55 25 21 31  |!04....    _U%!1|
000153d0  31 32 3d 5f 51 25 21 30  38 0d 0a b5 07 20 20 cd  |12=_Q%!08....  .|
000153e0  0d 0a b6 05 cc 0d 0a b7  1d 20 20 f4 20 74 6f 6f  |.........  . too|
000153f0  20 6d 75 63 68 20 64 61  74 61 20 73 65 6e 74 2e  | much data sent.|
00015400  2e 2e 0d 0a b8 25 20 20  f2 73 68 65 6c 6c 5f 48  |.....%  .shell_H|
00015410  65 61 70 42 6c 6f 63 6b  52 65 74 75 72 6e 28 5f  |eapBlockReturn(_|
00015420  55 25 21 31 35 32 29 0d  0a b9 0f 20 20 5f 55 25  |U%!152)....  _U%|
00015430  21 31 35 32 3d 30 0d 0a  ba 33 20 20 f2 73 68 65  |!152=0...3  .she|
00015440  6c 6c 5f 4f 4b 28 a4 73  68 65 6c 6c 5f 4d 65 73  |ll_OK(.shell_Mes|
00015450  73 61 67 65 4e 6f 41 72  67 73 28 22 53 48 45 4c  |sageNoArgs("SHEL|
00015460  4c 4d 53 47 31 35 22 29  29 0d 0a bb 05 cd 0d 0a  |LMSG15")).......|
00015470  bc 05 e1 0d 0a bd 05 3a  0d 0a be 20 2a 7c 53 74  |.......:... *|St|
00015480  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 52 41 4d  |op PROCshell_RAM|
00015490  54 72 61 6e 73 6d 69 74  0d 0a bf 1c 2a 7c 53 74  |Transmit....*|St|
000154a0  61 72 74 20 46 4e 73 68  65 6c 6c 5f 4c 6f 61 64  |art FNshell_Load|
000154b0  46 69 6c 65 0d 0a c0 1d  dd 20 a4 73 68 65 6c 6c  |File..... .shell|
000154c0  5f 4c 6f 61 64 46 69 6c  65 28 53 63 72 61 70 25  |_LoadFile(Scrap%|
000154d0  29 0d 0a c1 25 ea 20 4e  61 6d 65 24 2c 46 69 6c  |)...%. Name$,Fil|
000154e0  65 53 69 7a 65 25 2c 46  6c 61 67 73 25 2c 6c 6f  |eSize%,Flags%,lo|
000154f0  61 64 6c 6f 63 25 0d 0a  c2 22 4e 61 6d 65 24 3d  |adloc%..."Name$=|
00015500  a4 73 68 65 6c 6c 5f 47  65 74 53 74 72 69 6e 67  |.shell_GetString|
00015510  28 5f 51 25 2b 34 34 29  0d 0a c3 26 46 69 6c 65  |(_Q%+44)...&File|
00015520  53 69 7a 65 25 3d a4 73  68 65 6c 6c 5f 46 69 6c  |Size%=.shell_Fil|
00015530  65 4c 65 6e 67 74 68 28  4e 61 6d 65 24 29 0d 0a  |eLength(Name$)..|
00015540  c4 41 e7 20 46 69 6c 65  53 69 7a 65 25 3c 30 20  |.A. FileSize%<0 |
00015550  8c 20 f2 73 68 65 6c 6c  5f 4f 4b 28 a4 73 68 65  |. .shell_OK(.she|
00015560  6c 6c 5f 4d 65 73 73 61  67 65 4e 6f 41 72 67 73  |ll_MessageNoArgs|
00015570  28 22 53 48 45 4c 4c 4d  53 47 31 36 22 29 29 0d  |("SHELLMSG16")).|
00015580  0a c5 2d 6c 6f 61 64 6c  6f 63 25 3d a4 73 68 65  |..-loadloc%=.she|
00015590  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 46 65 74 63  |ll_HeapBlockFetc|
000155a0  68 28 46 69 6c 65 53 69  7a 65 25 29 0d 0a c6 2f  |h(FileSize%).../|
000155b0  c8 99 20 22 58 4f 53 5f  46 69 6c 65 22 2c 31 36  |.. "XOS_File",16|
000155c0  2c 4e 61 6d 65 24 2c 6c  6f 61 64 6c 6f 63 25 2c  |,Name$,loadloc%,|
000155d0  30 20 b8 20 3b 46 6c 61  67 73 25 0d 0a c7 1c e7  |0 . ;Flags%.....|
000155e0  20 a4 73 68 65 6c 6c 5f  56 46 6c 61 67 28 46 6c  | .shell_VFlag(Fl|
000155f0  61 67 73 25 29 20 8c 0d  0a c8 26 20 20 f2 73 68  |ags%) ....&  .sh|
00015600  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 52 65 74  |ell_HeapBlockRet|
00015610  75 72 6e 28 6c 6f 61 64  6c 6f 63 25 29 0d 0a c9  |urn(loadloc%)...|
00015620  33 20 20 f2 73 68 65 6c  6c 5f 4f 4b 28 a4 73 68  |3  .shell_OK(.sh|
00015630  65 6c 6c 5f 4d 65 73 73  61 67 65 4e 6f 41 72 67  |ell_MessageNoArg|
00015640  73 28 22 53 48 45 4c 4c  4d 53 47 31 37 22 29 29  |s("SHELLMSG17"))|
00015650  0d 0a ca 05 cc 0d 0a cb  15 2a 7c 69 66 64 65 66  |.........*|ifdef|
00015660  20 54 72 61 63 65 49 6e  69 74 0d 0a cc 49 20 20  | TraceInit...I  |
00015670  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
00015680  4c 6f 61 64 46 69 6c 65  3a 46 69 6c 65 20 22 2b  |LoadFile:File "+|
00015690  4e 61 6d 65 24 2b 22 20  6c 6f 61 64 65 64 20 6f  |Name$+" loaded o|
000156a0  6b 20 61 74 20 26 22 2b  c3 7e 6c 6f 61 64 6c 6f  |k at &"+.~loadlo|
000156b0  63 25 29 0d 0a cd 0b 2a  7c 65 6e 64 69 66 0d 0a  |c%)....*|endif..|
000156c0  ce 05 cd 0d 0a cf 27 f4  20 53 74 75 66 66 20 66  |......'. Stuff f|
000156d0  6f 72 20 66 69 6c 65 69  6e 66 6f 20 62 6f 78 2e  |or fileinfo box.|
000156e0  2e 2e 2e 2e 2e 2e 2e 2e  2e 2e 0d 0a d0 28 f4 20  |.............(. |
000156f0  50 52 4f 43 44 61 74 65  28 46 4e 46 69 6c 65 54  |PROCDate(FNFileT|
00015700  69 6d 65 41 6e 64 44 61  74 65 28 4e 61 6d 65 24  |imeAndDate(Name$|
00015710  29 29 0d 0a d1 14 f4 20  49 46 20 53 63 72 61 70  |))..... IF Scrap|
00015720  25 20 54 48 45 4e 0d 0a  d2 2a f4 20 20 20 53 59  |% THEN...*.   SY|
00015730  53 20 22 58 4f 53 5f 46  53 43 6f 6e 74 72 6f 6c  |S "XOS_FSControl|
00015740  22 2c 32 37 2c 28 5f 51  25 2b 34 34 29 2c 2c 32  |",27,(_Q%+44),,2|
00015750  0d 0a d3 1a f4 20 20 20  50 52 4f 43 4d 6f 64 69  |.....   PROCModi|
00015760  66 69 65 64 28 54 52 55  45 29 0d 0a d4 0a f4 20  |fied(TRUE)..... |
00015770  45 4c 53 45 0d 0a d5 17  f4 20 20 20 50 52 4f 43  |ELSE.....   PROC|
00015780  4e 61 6d 65 28 4e 61 6d  65 24 29 0d 0a d6 18 f4  |Name(Name$).....|
00015790  20 20 20 50 52 4f 43 54  79 70 65 28 5f 51 25 21  |   PROCType(_Q%!|
000157a0  34 30 29 0d 0a d7 1b f4  20 20 20 50 52 4f 43 4d  |40).....   PROCM|
000157b0  6f 64 69 66 69 65 64 28  46 41 4c 53 45 29 0d 0a  |odified(FALSE)..|
000157c0  d8 0b f4 20 45 4e 44 49  46 0d 0a d9 11 f4 20 50  |... ENDIF..... P|
000157d0  52 4f 43 4e 65 77 46 69  6c 65 0d 0a da 0d 3d 6c  |ROCNewFile....=l|
000157e0  6f 61 64 6c 6f 63 25 0d  0a db 05 3a 0d 0a dc 1b  |oadloc%....:....|
000157f0  2a 7c 53 74 6f 70 20 46  4e 73 68 65 6c 6c 5f 4c  |*|Stop FNshell_L|
00015800  6f 61 64 46 69 6c 65 0d  0a dd 04 0d 0a de 19 2a  |oadFile........*|
00015810  7c 53 74 61 72 74 20 46  4e 73 68 65 6c 6c 5f 56  ||Start FNshell_V|
00015820  46 6c 61 67 0d 0a df 1a  dd 20 a4 73 68 65 6c 6c  |Flag..... .shell|
00015830  5f 56 46 6c 61 67 28 46  6c 61 67 73 25 29 0d 0a  |_VFlag(Flags%)..|
00015840  e0 1d 3d 28 28 46 6c 61  67 73 25 20 80 20 25 30  |..=((Flags% . %0|
00015850  30 30 31 29 3d 25 30 30  30 31 29 0d 0a e1 05 3a  |001)=%0001)....:|
00015860  0d 0a e2 18 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |....*|Stop FNshe|
00015870  6c 6c 5f 56 46 6c 61 67  0d 0a e3 04 0d 0a e4 1d  |ll_VFlag........|
00015880  2a 7c 53 74 61 72 74 20  46 4e 73 68 65 6c 6c 5f  |*|Start FNshell_|
00015890  43 68 65 63 6b 54 79 70  65 0d 0a e5 32 dd 20 a4  |CheckType...2. .|
000158a0  73 68 65 6c 6c 5f 43 68  65 63 6b 54 79 70 65 28  |shell_CheckType(|
000158b0  74 79 70 65 25 2c 74 79  70 65 5f 6c 69 73 74 25  |type%,type_list%|
000158c0  2c 44 61 74 61 4f 70 65  6e 25 29 0d 0a e6 39 f4  |,DataOpen%)...9.|
000158d0  20 45 78 63 6c 75 64 65  20 64 69 72 65 63 74 6f  | Exclude directo|
000158e0  72 69 65 73 2c 20 61 70  70 6c 69 63 61 74 69 6f  |ries, applicatio|
000158f0  6e 73 20 26 20 75 6e 73  74 61 6d 70 65 64 20 66  |ns & unstamped f|
00015900  69 6c 65 73 0d 0a e7 37  f4 20 74 79 70 65 5f 6c  |iles...7. type_l|
00015910  69 73 74 25 20 69 73 20  61 64 64 72 65 73 73 20  |ist% is address |
00015920  6f 66 20 68 65 61 70 62  6c 6f 63 6b 20 68 6f 6c  |of heapblock hol|
00015930  64 69 6e 67 20 61 20 6c  69 73 74 0d 0a e8 2f f4  |ding a list.../.|
00015940  20 6f 66 20 61 6c 6c 6f  77 61 62 6c 65 20 66 69  | of allowable fi|
00015950  6c 65 74 79 70 65 73 20  74 65 72 6d 69 6e 61 74  |letypes terminat|
00015960  65 64 20 62 79 20 2d 31  2e 2e 0d 0a e9 28 ea 20  |ed by -1.....(. |
00015970  4f 6b 25 2c 63 74 72 25  2c 66 6f 75 6e 64 25 2c  |Ok%,ctr%,found%,|
00015980  74 65 6d 70 25 2c 74 6f  70 62 69 74 5f 6c 6f 61  |temp%,topbit_loa|
00015990  64 25 0d 0a ea 23 63 74  72 25 3d 30 3a 66 6f 75  |d%...#ctr%=0:fou|
000159a0  6e 64 25 3d 2d 31 3a 74  6f 70 62 69 74 5f 6c 6f  |nd%=-1:topbit_lo|
000159b0  61 64 25 3d a3 0d 0a eb  2d e7 20 5f 55 25 21 31  |ad%=....-. _U%!1|
000159c0  30 30 20 80 20 31 3c 3c  31 20 8c 20 5f 55 25 21  |00 . 1<<1 . _U%!|
000159d0  31 30 30 3d 5f 55 25 21  31 30 30 20 82 20 31 3c  |100=_U%!100 . 1<|
000159e0  3c 31 0d 0a ec 1a c8 95  20 74 79 70 65 5f 6c 69  |<1...... type_li|
000159f0  73 74 25 21 63 74 72 25  3c 3e 2d 31 0d 0a ed 1b  |st%!ctr%<>-1....|
00015a00  20 20 74 65 6d 70 25 3d  74 79 70 65 5f 6c 69 73  |  temp%=type_lis|
00015a10  74 25 21 63 74 72 25 0d  0a ee 17 20 20 e7 20 74  |t%!ctr%....  . t|
00015a20  65 6d 70 25 20 80 20 31  3c 3c 33 31 20 8c 0d 0a  |emp% . 1<<31 ...|
00015a30  ef 1b 20 20 20 20 74 65  6d 70 25 3d 74 65 6d 70  |..    temp%=temp|
00015a40  25 20 82 20 31 3c 3c 33  31 0d 0a f0 16 20 20 20  |% . 1<<31....   |
00015a50  20 74 6f 70 62 69 74 5f  6c 6f 61 64 25 3d b9 0d  | topbit_load%=..|
00015a60  0a f1 07 20 20 cc 0d 0a  f2 16 20 20 20 20 74 6f  |...  .....    to|
00015a70  70 62 69 74 5f 6c 6f 61  64 25 3d a3 0d 0a f3 07  |pbit_load%=.....|
00015a80  20 20 cd 0d 0a f4 15 20  20 e7 20 74 65 6d 70 25  |  .....  . temp%|
00015a90  3d 74 79 70 65 25 20 8c  0d 0a f5 13 20 20 20 20  |=type% .....    |
00015aa0  66 6f 75 6e 64 25 3d 63  74 72 25 0d 0a f6 18 20  |found%=ctr%.... |
00015ab0  20 20 20 e7 20 74 6f 70  62 69 74 5f 6c 6f 61 64  |   . topbit_load|
00015ac0  25 20 8c 0d 0a f7 20 20  20 20 20 20 20 5f 55 25  |% ....       _U%|
00015ad0  21 31 30 30 3d 5f 55 25  21 31 30 30 20 84 20 31  |!100=_U%!100 . 1|
00015ae0  3c 3c 31 0d 0a f8 15 2a  7c 69 66 64 65 66 20 54  |<<1....*|ifdef T|
00015af0  72 61 63 65 49 6e 69 74  0d 0a f9 3d 20 20 20 20  |raceInit...=    |
00015b00  20 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |  .shell_Tracef0|
00015b10  28 22 43 68 65 63 6b 54  79 70 65 3a 54 6f 70 20  |("CheckType:Top |
00015b20  42 69 74 20 4c 6f 61 64  20 64 65 74 65 63 74 65  |Bit Load detecte|
00015b30  64 2e 2e 22 29 0d 0a fa  0b 2a 7c 65 6e 64 69 66  |d..")....*|endif|
00015b40  0d 0a fb 09 20 20 20 20  cd 0d 0a fc 07 20 20 cd  |....    .....  .|
00015b50  0d 0a fd 0d 20 20 63 74  72 25 2b 3d 34 0d 0a fe  |....  ctr%+=4...|
00015b60  05 ce 0d 0a ff 2c e7 20  44 61 74 61 4f 70 65 6e  |.....,. DataOpen|
00015b70  25 20 80 20 28 74 79 70  65 25 3e 3d 26 31 30 30  |% . (type%>=&100|
00015b80  30 29 20 8c 20 66 6f 75  6e 64 25 3d 2d 31 0d 0b  |0) . found%=-1..|
00015b90  00 15 2a 7c 69 66 64 65  66 20 54 72 61 63 65 49  |..*|ifdef TraceI|
00015ba0  6e 69 74 0d 0b 01 11 e7  20 66 6f 75 6e 64 25 3e  |nit..... found%>|
00015bb0  2d 31 20 8c 0d 0b 02 43  20 20 f2 73 68 65 6c 6c  |-1 ....C  .shell|
00015bc0  5f 54 72 61 63 65 66 30  28 22 43 68 65 63 6b 54  |_Tracef0("CheckT|
00015bd0  79 70 65 3a 46 69 6c 65  20 74 79 70 65 20 4f 4b  |ype:File type OK|
00015be0  20 22 2b c3 7e 74 79 70  65 5f 6c 69 73 74 25 21  | "+.~type_list%!|
00015bf0  66 6f 75 6e 64 25 29 0d  0b 03 05 cc 0d 0b 04 3b  |found%)........;|
00015c00  20 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |  .shell_Tracef0|
00015c10  28 22 43 68 65 63 6b 54  79 70 65 3a 46 69 6c 65  |("CheckType:File|
00015c20  20 74 79 70 65 20 4e 4f  54 20 6f 6b 20 22 2b c3  | type NOT ok "+.|
00015c30  7e 74 79 70 65 25 29 0d  0b 05 05 cd 0d 0b 06 0b  |~type%).........|
00015c40  2a 7c 65 6e 64 69 66 0d  0b 07 1a e7 20 66 6f 75  |*|endif..... fou|
00015c50  6e 64 25 3c 3e 2d 31 20  8c 20 3d b9 20 8b 20 3d  |nd%<>-1 . =. . =|
00015c60  a3 0d 0b 08 05 3a 0d 0b  09 1c 2a 7c 53 74 6f 70  |.....:....*|Stop|
00015c70  20 46 4e 73 68 65 6c 6c  5f 43 68 65 63 6b 54 79  | FNshell_CheckTy|
00015c80  70 65 0d 0b 0a 04 0d 0b  0b 1a 2a 7c 53 74 61 72  |pe........*|Star|
00015c90  74 20 50 52 4f 43 73 68  65 6c 6c 5f 45 78 69 74  |t PROCshell_Exit|
00015ca0  0d 0b 0c 11 dd 20 f2 73  68 65 6c 6c 5f 45 78 69  |..... .shell_Exi|
00015cb0  74 0d 0b 0d 0e ea 20 6d  73 5f 64 65 73 63 25 0d  |t..... ms_desc%.|
00015cc0  0b 0e 13 6d 73 5f 64 65  73 63 25 3d 5f 55 25 21  |...ms_desc%=_U%!|
00015cd0  36 38 0d 0b 0f 29 c8 99  20 22 58 4d 65 73 73 61  |68...).. "XMessa|
00015ce0  67 65 54 72 61 6e 73 5f  43 6c 6f 73 65 46 69 6c  |geTrans_CloseFil|
00015cf0  65 22 2c 6d 73 5f 64 65  73 63 25 0d 0b 10 1f c8  |e",ms_desc%.....|
00015d00  99 20 22 58 4f 53 5f 4d  6f 64 75 6c 65 22 2c 37  |. "XOS_Module",7|
00015d10  2c 2c 6d 73 5f 64 65 73  63 25 0d 0b 11 15 2a 7c  |,,ms_desc%....*||
00015d20  69 66 64 65 66 20 54 72  61 63 65 49 6e 69 74 0d  |ifdef TraceInit.|
00015d30  0b 12 33 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |..3.shell_Tracef|
00015d40  30 28 22 45 78 69 74 3a  41 70 70 6c 69 63 61 74  |0("Exit:Applicat|
00015d50  69 6f 6e 20 63 6c 6f 73  69 6e 67 20 64 6f 77 6e  |ion closing down|
00015d60  22 29 0d 0b 13 0b 2a 7c  65 6e 64 69 66 0d 0b 14  |")....*|endif...|
00015d70  14 f2 73 68 65 6c 6c 5f  54 72 61 63 65 45 78 69  |..shell_TraceExi|
00015d80  74 0d 0b 15 19 c8 99 20  22 58 48 6f 75 72 67 6c  |t...... "XHourgl|
00015d90  61 73 73 5f 53 6d 61 73  68 22 0d 0b 16 1a c8 99  |ass_Smash"......|
00015da0  20 22 58 57 69 6d 70 5f  44 72 61 67 42 6f 78 22  | "XWimp_DragBox"|
00015db0  2c 2c 2d 31 0d 0b 17 23  f2 73 68 65 6c 6c 5f 57  |,,-1...#.shell_W|
00015dc0  69 6d 70 43 6c 6f 73 65  44 6f 77 6e 5f 49 28 5f  |impCloseDown_I(_|
00015dd0  55 25 21 31 34 38 29 0d  0b 18 05 e1 0d 0b 19 05  |U%!148).........|
00015de0  3a 0d 0b 1a 19 2a 7c 53  74 6f 70 20 50 52 4f 43  |:....*|Stop PROC|
00015df0  73 68 65 6c 6c 5f 45 78  69 74 0d 0b 1b 04 0d 0b  |shell_Exit......|
00015e00  1c 1e 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |..*|Start PROCsh|
00015e10  65 6c 6c 5f 44 61 74 61  4c 6f 61 64 0d 0b 1d 24  |ell_DataLoad...$|
00015e20  dd 20 f2 73 68 65 6c 6c  5f 44 61 74 61 4c 6f 61  |. .shell_DataLoa|
00015e30  64 28 5f 51 25 2c 44 61  74 61 4f 70 65 6e 25 29  |d(_Q%,DataOpen%)|
00015e40  0d 0b 1e 3c ea 20 72 65  66 65 72 65 6e 63 65 25  |...<. reference%|
00015e50  2c 6f 66 66 73 65 74 25  2c 62 6c 6b 25 2c 5f 74  |,offset%,blk%,_t|
00015e60  65 6d 70 25 2c 74 79 70  65 5f 6c 69 73 74 25 2c  |emp%,type_list%,|
00015e70  74 79 70 65 25 2c 66 6e  61 6d 65 24 0d 0b 1f 31  |type%,fname$...1|
00015e80  e7 20 a4 73 68 65 6c 6c  5f 44 61 74 61 4f 70 65  |. .shell_DataOpe|
00015e90  6e 4f 4b 54 6f 4c 6f 61  64 28 44 61 74 61 4f 70  |nOKToLoad(DataOp|
00015ea0  65 6e 25 2c 5f 51 25 21  34 30 29 20 8c 0d 0b 20  |en%,_Q%!40) ... |
00015eb0  15 20 20 74 79 70 65 25  20 20 3d 20 5f 51 25 21  |.  type%  = _Q%!|
00015ec0  34 30 0d 0b 21 29 20 20  66 6e 61 6d 65 24 20 3d  |40..!)  fname$ =|
00015ed0  20 a4 73 68 65 6c 6c 5f  47 65 74 53 74 72 69 6e  | .shell_GetStrin|
00015ee0  67 28 5f 51 25 20 2b 20  34 34 29 0d 0b 22 15 2a  |g(_Q% + 44)..".*|
00015ef0  7c 69 66 64 65 66 20 54  72 61 63 65 49 6e 69 74  ||ifdef TraceInit|
00015f00  0d 0b 23 3a 20 20 f2 73  68 65 6c 6c 5f 54 72 61  |..#:  .shell_Tra|
00015f10  63 65 66 30 28 22 44 61  74 61 4c 6f 61 64 3a 44  |cef0("DataLoad:D|
00015f20  61 74 61 4c 6f 61 64 20  6d 65 73 73 61 67 65 20  |ataLoad message |
00015f30  72 65 63 65 69 76 65 64  22 29 0d 0b 24 0b 2a 7c  |received")..$.*||
00015f40  65 6e 64 69 66 0d 0b 25  39 20 20 f4 20 63 68 65  |endif..%9  . che|
00015f50  63 6b 20 6d 79 5f 66 69  6c 65 5f 74 79 70 65 20  |ck my_file_type |
00015f60  73 65 74 20 75 70 20 69  6e 20 73 68 65 6c 6c 5f  |set up in shell_|
00015f70  41 74 74 61 63 68 44 61  74 61 4c 6f 61 64 0d 0b  |AttachDataLoad..|
00015f80  26 41 20 20 f4 20 6f 6e  6c 79 20 77 6f 72 6b 73  |&A  . only works|
00015f90  20 77 68 65 6e 20 64 72  61 67 67 69 6e 67 20 61  | when dragging a|
00015fa0  20 66 69 6c 65 20 61 73  20 77 68 65 6e 20 44 61  | file as when Da|
00015fb0  74 61 4f 70 65 6e 25 20  69 73 20 54 52 55 45 0d  |taOpen% is TRUE.|
00015fc0  0b 27 2d 20 20 f4 20 74  68 65 20 5f 51 25 20 62  |.'-  . the _Q% b|
00015fd0  6c 6f 63 6b 20 69 73 20  73 65 74 20 75 70 20 64  |lock is set up d|
00015fe0  69 66 66 65 72 65 6e 74  6c 79 21 21 0d 0b 28 13  |ifferently!!..(.|
00015ff0  20 20 e7 20 44 61 74 61  4f 70 65 6e 25 20 8c 0d  |  . DataOpen% ..|
00016000  0b 29 1d 20 20 20 20 f4  20 64 6f 75 62 6c 65 20  |.).    . double |
00016010  63 6c 69 63 6b 20 6c 6f  61 64 2e 2e 0d 0b 2a 3a  |click load....*:|
00016020  20 20 20 20 f4 20 63 68  65 63 6b 20 69 66 20 74  |    . check if t|
00016030  68 65 72 65 20 61 72 65  20 61 6e 79 20 64 61 74  |here are any dat|
00016040  61 6c 6f 61 64 20 65 76  65 6e 74 73 20 73 65 74  |aload events set|
00016050  20 75 70 2e 2e 2e 0d 0b  2b 15 20 20 20 20 e7 20  | up.....+.    . |
00016060  5f 55 25 21 39 36 3c 3e  30 20 8c 0d 0b 2c 3a 20  |_U%!96<>0 ...,: |
00016070  20 20 20 20 20 6f 66 66  73 65 74 25 3d 30 3a f4  |     offset%=0:.|
00016080  20 6c 6f 6f 6b 20 61 74  20 66 69 72 73 74 20 64  | look at first d|
00016090  61 74 61 6c 6f 61 64 20  65 76 65 6e 74 20 6f 6e  |ataload event on|
000160a0  6c 79 2e 2e 2e 0d 0b 2d  09 20 20 20 20 cc 0d 0b  |ly.....-.    ...|
000160b0  2e 23 20 20 20 20 20 20  6f 66 66 73 65 74 25 3d  |.#      offset%=|
000160c0  2d 31 3a f4 20 69 67 6e  6f 72 65 20 69 74 2e 2e  |-1:. ignore it..|
000160d0  2e 0d 0b 2f 09 20 20 20  20 cd 0d 0b 30 07 20 20  |.../.    ...0.  |
000160e0  cc 0d 0b 31 3b 20 20 20  20 f4 20 64 72 61 67 20  |...1;    . drag |
000160f0  6c 6f 61 64 2c 20 63 68  65 63 6b 20 66 6f 72 20  |load, check for |
00016100  73 70 65 63 69 66 69 63  20 77 69 6e 64 6f 77 2f  |specific window/|
00016110  69 63 6f 6e 20 65 76 65  6e 74 2e 2e 0d 0b 32 44  |icon event....2D|
00016120  20 20 20 20 6f 66 66 73  65 74 25 3d a4 73 68 65  |    offset%=.she|
00016130  6c 6c 5f 47 65 74 45 76  65 6e 74 4c 69 73 74 4f  |ll_GetEventListO|
00016140  66 66 73 65 74 28 5f 51  25 21 32 30 2c 5f 51 25  |ffset(_Q%!20,_Q%|
00016150  21 32 34 2c 5f 55 25 2b  39 36 2c 31 36 2c a3 29  |!24,_U%+96,16,.)|
00016160  0d 0b 33 16 20 20 20 20  e7 20 6f 66 66 73 65 74  |..3.    . offset|
00016170  25 3d 2d 31 20 8c 0d 0b  34 2e 20 20 20 20 20 20  |%=-1 ...4.      |
00016180  f4 20 6e 6f 77 20 63 68  65 63 6b 20 66 6f 72 20  |. now check for |
00016190  77 69 6e 64 6f 77 20 68  61 6e 64 6c 65 20 6f 6e  |window handle on|
000161a0  6c 79 2e 2e 0d 0b 35 42  20 20 20 20 20 20 6f 66  |ly....5B      of|
000161b0  66 73 65 74 25 3d a4 73  68 65 6c 6c 5f 47 65 74  |fset%=.shell_Get|
000161c0  45 76 65 6e 74 4c 69 73  74 4f 66 66 73 65 74 28  |EventListOffset(|
000161d0  5f 51 25 21 32 30 2c 2d  31 2c 5f 55 25 2b 39 36  |_Q%!20,-1,_U%+96|
000161e0  2c 31 36 2c a3 29 0d 0b  36 09 20 20 20 20 cd 0d  |,16,.)..6.    ..|
000161f0  0b 37 07 20 20 cd 0d 0b  38 14 20 20 e7 20 6f 66  |.7.  ...8.  . of|
00016200  66 73 65 74 25 3e 2d 31  20 8c 0d 0b 39 1e 20 20  |fset%>-1 ...9.  |
00016210  20 20 f4 20 44 61 74 61  4c 6f 61 64 45 76 65 6e  |  . DataLoadEven|
00016220  74 20 65 78 69 73 74 73  0d 0b 3a 1b 20 20 20 20  |t exists..:.    |
00016230  62 6c 6b 25 3d 5f 55 25  21 39 36 2b 6f 66 66 73  |blk%=_U%!96+offs|
00016240  65 74 25 0d 0b 3b 35 20  20 20 20 e7 20 a4 73 68  |et%..;5    . .sh|
00016250  65 6c 6c 5f 43 68 65 63  6b 54 79 70 65 28 5f 51  |ell_CheckType(_Q|
00016260  25 21 34 30 2c 62 6c 6b  25 21 38 2c 44 61 74 61  |%!40,blk%!8,Data|
00016270  4f 70 65 6e 25 29 20 8c  0d 0b 3c 1e 20 20 20 20  |Open%) ...<.    |
00016280  20 20 f4 20 66 69 6c 65  20 74 79 70 65 20 69 73  |  . file type is|
00016290  20 6f 6b 2e 2e 2e 0d 0b  3d 15 2a 7c 69 66 64 65  | ok.....=.*|ifde|
000162a0  66 20 54 72 61 63 65 49  6e 69 74 0d 0b 3e 49 20  |f TraceInit..>I |
000162b0  20 20 20 20 20 f2 73 68  65 6c 6c 5f 54 72 61 63  |     .shell_Trac|
000162c0  65 66 30 28 22 44 61 74  61 4c 6f 61 64 3a 46 69  |ef0("DataLoad:Fi|
000162d0  6c 65 20 74 79 70 65 20  72 65 63 6f 67 6e 69 73  |le type recognis|
000162e0  65 64 20 28 26 22 2b c3  7e 5f 51 25 21 34 30 2b  |ed (&"+.~_Q%!40+|
000162f0  22 29 22 29 0d 0b 3f 0b  2a 7c 65 6e 64 69 66 0d  |")")..?.*|endif.|
00016300  0b 40 1b 20 20 20 20 20  20 52 65 66 65 72 65 6e  |.@.      Referen|
00016310  63 65 25 3d 5f 51 25 21  31 32 0d 0b 41 16 20 20  |ce%=_Q%!12..A.  |
00016320  20 20 20 20 5f 51 25 21  31 32 3d 5f 51 25 21 38  |    _Q%!12=_Q%!8|
00016330  0d 0b 42 12 20 20 20 20  20 20 5f 51 25 21 31 36  |..B.      _Q%!16|
00016340  3d 34 0d 0b 43 2c 20 20  20 20 20 20 c8 99 20 22  |=4..C,      .. "|
00016350  57 69 6d 70 5f 53 65 6e  64 4d 65 73 73 61 67 65  |Wimp_SendMessage|
00016360  22 2c 31 38 2c 5f 51 25  2c 5f 51 25 21 34 0d 0b  |",18,_Q%,_Q%!4..|
00016370  44 1e 20 20 20 20 20 20  e7 20 5f 55 25 21 31 30  |D.      . _U%!10|
00016380  30 20 80 20 31 20 3c 3c  20 31 20 8c 0d 0b 45 19  |0 . 1 << 1 ...E.|
00016390  20 20 20 20 20 20 20 20  6c 6f 61 64 6c 6f 63 25  |        loadloc%|
000163a0  20 3d 20 2d 31 0d 0b 46  27 20 20 20 20 20 20 20  | = -1..F'       |
000163b0  20 5f 55 25 21 31 30 30  20 20 3d 20 5f 55 25 21  | _U%!100  = _U%!|
000163c0  31 30 30 20 82 20 31 20  3c 3c 20 31 0d 0b 47 0b  |100 . 1 << 1..G.|
000163d0  20 20 20 20 20 20 cc 0d  0b 48 3c 20 20 20 20 20  |      ...H<     |
000163e0  20 20 20 6c 6f 61 64 6c  6f 63 25 20 3d 20 a4 73  |   loadloc% = .s|
000163f0  68 65 6c 6c 5f 4c 6f 61  64 46 69 6c 65 28 52 65  |hell_LoadFile(Re|
00016400  66 65 72 65 6e 63 65 25  20 3d 20 5f 55 25 21 31  |ference% = _U%!1|
00016410  30 38 29 0d 0b 49 0b 20  20 20 20 20 20 cd 0d 0b  |08)..I.      ...|
00016420  4a 49 20 20 20 20 20 20  f2 73 68 65 6c 6c 5f 55  |JI      .shell_U|
00016430  73 65 72 46 4e 4c 6f 61  64 46 69 6c 65 28 74 79  |serFNLoadFile(ty|
00016440  70 65 25 2c 6c 6f 61 64  6c 6f 63 25 2c 62 6c 6b  |pe%,loadloc%,blk|
00016450  25 21 38 2c 66 6e 61 6d  65 24 2c 5f 51 25 21 33  |%!8,fname$,_Q%!3|
00016460  36 2c 62 6c 6b 25 29 0d  0b 4b 34 20 20 20 20 20  |6,blk%)..K4     |
00016470  20 f4 20 72 65 74 75 72  6e 20 63 6f 70 79 20 6f  | . return copy o|
00016480  66 20 64 61 74 61 73 61  76 65 20 6d 65 73 73 61  |f datasave messa|
00016490  67 65 20 62 6c 6f 63 6b  2e 2e 2e 0d 0b 4c 18 20  |ge block.....L. |
000164a0  20 20 20 20 20 e7 20 5f  55 25 21 31 35 36 3c 3e  |     . _U%!156<>|
000164b0  30 20 8c 0d 0b 4d 2b 20  20 20 20 20 20 20 20 f2  |0 ...M+        .|
000164c0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 52  |shell_HeapBlockR|
000164d0  65 74 75 72 6e 28 5f 55  25 21 31 35 36 29 0d 0b  |eturn(_U%!156)..|
000164e0  4e 15 20 20 20 20 20 20  20 20 5f 55 25 21 31 35  |N.        _U%!15|
000164f0  36 3d 30 0d 0b 4f 0b 20  20 20 20 20 20 cd 0d 0b  |6=0..O.      ...|
00016500  50 09 20 20 20 20 cc 0d  0b 51 15 2a 7c 69 66 64  |P.    ...Q.*|ifd|
00016510  65 66 20 54 72 61 63 65  49 6e 69 74 0d 0b 52 4b  |ef TraceInit..RK|
00016520  20 20 20 20 f2 73 68 65  6c 6c 5f 54 72 61 63 65  |    .shell_Trace|
00016530  66 30 28 22 44 61 74 61  4c 6f 61 64 3a 46 69 6c  |f0("DataLoad:Fil|
00016540  65 20 74 79 70 65 20 4e  4f 54 20 72 65 63 6f 67  |e type NOT recog|
00016550  6e 69 73 65 64 20 28 26  22 2b c3 7e 5f 51 25 21  |nised (&"+.~_Q%!|
00016560  34 30 2b 22 29 22 29 0d  0b 53 0b 2a 7c 65 6e 64  |40+")")..S.*|end|
00016570  69 66 0d 0b 54 09 20 20  20 20 cd 0d 0b 55 07 20  |if..T.    ...U. |
00016580  20 cd 0d 0b 56 05 cd 0d  0b 57 05 e1 0d 0b 58 05  | ...V....W....X.|
00016590  3a 0d 0b 59 1d 2a 7c 53  74 6f 70 20 50 52 4f 43  |:..Y.*|Stop PROC|
000165a0  73 68 65 6c 6c 5f 44 61  74 61 4c 6f 61 64 0d 0b  |shell_DataLoad..|
000165b0  5a 04 0d 0b 5b 24 2a 7c  53 74 61 72 74 20 46 4e  |Z...[$*|Start FN|
000165c0  73 68 65 6c 6c 5f 44 61  74 61 4f 70 65 6e 4f 4b  |shell_DataOpenOK|
000165d0  54 6f 4c 6f 61 64 0d 0b  5c 2e dd 20 a4 73 68 65  |ToLoad..\.. .she|
000165e0  6c 6c 5f 44 61 74 61 4f  70 65 6e 4f 4b 54 6f 4c  |ll_DataOpenOKToL|
000165f0  6f 61 64 28 44 61 74 61  4f 70 65 6e 25 2c 74 79  |oad(DataOpen%,ty|
00016600  70 65 25 29 0d 0b 5d 24  ea 20 72 65 73 75 6c 74  |pe%)..]$. result|
00016610  25 2c 76 61 72 5f 62 75  66 66 25 2c 76 61 72 24  |%,var_buff%,var$|
00016620  2c 62 72 61 6e 63 68 24  0d 0b 5e 4f f4 20 43 68  |,branch$..^O. Ch|
00016630  65 63 6b 20 74 6f 20 73  65 65 20 69 66 20 74 68  |eck to see if th|
00016640  69 73 20 61 70 70 6c 69  63 61 74 69 6f 6e 20 73  |is application s|
00016650  68 6f 75 6c 64 20 6f 70  65 6e 20 74 68 65 20 66  |hould open the f|
00016660  69 6c 65 2e 20 49 66 20  74 68 65 20 61 70 70 6c  |ile. If the appl|
00016670  69 63 61 74 69 6f 6e 0d  0b 5f 4e f4 20 6e 61 6d  |ication.._N. nam|
00016680  65 64 20 69 6e 20 74 68  65 20 52 75 6e 24 54 79  |ed in the Run$Ty|
00016690  70 65 20 76 61 72 69 61  62 6c 65 20 64 6f 65 73  |pe variable does|
000166a0  20 6e 6f 74 20 6d 61 74  63 68 20 74 68 65 6e 20  | not match then |
000166b0  72 65 74 75 72 6e 20 46  41 4c 53 45 20 74 6f 20  |return FALSE to |
000166c0  61 62 6f 72 74 0d 0b 60  4e f4 20 74 68 65 20 6c  |abort..`N. the l|
000166d0  6f 61 64 2c 20 6f 74 68  65 72 77 69 73 65 20 74  |oad, otherwise t|
000166e0  68 65 20 66 69 6c 65 20  77 6f 75 6c 64 20 62 65  |he file would be|
000166f0  20 6c 6f 61 64 65 64 20  62 79 20 74 68 65 20 77  | loaded by the w|
00016700  72 6f 6e 67 20 61 70 70  6c 69 63 61 74 69 6f 6e  |rong application|
00016710  20 6f 6e 0d 0b 61 28 f4  20 61 20 64 6f 75 62 6c  | on..a(. a doubl|
00016720  65 20 63 6c 69 63 6b 20  69 6e 20 61 20 46 69 6c  |e click in a Fil|
00016730  65 72 20 77 69 6e 64 6f  77 2e 2e 0d 0b 62 15 e7  |er window....b..|
00016740  20 44 61 74 61 4f 70 65  6e 25 20 3d 20 a3 20 8c  | DataOpen% = . .|
00016750  0d 0b 63 35 20 20 f4 20  4d 65 73 73 61 67 65 20  |..c5  . Message |
00016760  72 65 61 73 6f 6e 20 63  6f 64 65 20 77 61 73 20  |reason code was |
00016770  33 2c 20 6e 6f 72 6d 61  6c 20 64 72 61 67 20 6c  |3, normal drag l|
00016780  6f 61 64 2e 2e 0d 0b 64  11 20 20 72 65 73 75 6c  |oad....d.  resul|
00016790  74 25 20 3d 20 b9 0d 0b  65 56 20 20 f2 73 68 65  |t% = ...eV  .she|
000167a0  6c 6c 5f 54 72 61 63 65  66 30 28 22 44 61 74 61  |ll_Tracef0("Data|
000167b0  4f 70 65 6e 4f 4b 54 6f  4c 6f 61 64 3a 4d 65 73  |OpenOKToLoad:Mes|
000167c0  73 61 67 65 20 72 65 61  73 6f 6e 20 63 6f 64 65  |sage reason code|
000167d0  20 77 61 73 20 33 2c 20  6e 6f 72 6d 61 6c 20 64  | was 3, normal d|
000167e0  72 61 67 20 6c 6f 61 64  2e 2e 22 29 0d 0b 66 05  |rag load..")..f.|
000167f0  cc 0d 0b 67 36 20 20 f4  20 4d 65 73 73 61 67 65  |...g6  . Message|
00016800  20 72 65 61 73 6f 6e 20  63 6f 64 65 20 77 61 73  | reason code was|
00016810  20 35 2c 20 64 6f 75 62  6c 65 20 63 6c 69 63 6b  | 5, double click|
00016820  20 6c 6f 61 64 2e 2e 0d  0b 68 4f 20 20 f4 20 52  | load....hO  . R|
00016830  65 61 64 20 76 61 6c 75  65 20 6f 66 20 41 6c 69  |ead value of Ali|
00016840  61 73 24 40 52 75 6e 54  79 70 65 5f 78 78 78 20  |as$@RunType_xxx |
00016850  76 61 72 69 61 62 6c 65  20 77 68 65 72 65 20 78  |variable where x|
00016860  78 78 20 3d 20 66 69 6c  65 74 79 70 65 20 69 6e  |xx = filetype in|
00016870  20 68 65 78 2e 2e 0d 0b  69 57 20 20 f2 73 68 65  | hex....iW  .she|
00016880  6c 6c 5f 54 72 61 63 65  66 30 28 22 44 61 74 61  |ll_Tracef0("Data|
00016890  4f 70 65 6e 4f 4b 54 6f  4c 6f 61 64 3a 4d 65 73  |OpenOKToLoad:Mes|
000168a0  73 61 67 65 20 72 65 61  73 6f 6e 20 63 6f 64 65  |sage reason code|
000168b0  20 77 61 73 20 35 2c 20  64 6f 75 62 6c 65 20 63  | was 5, double c|
000168c0  6c 69 63 6b 20 6c 6f 61  64 2e 2e 22 29 0d 0b 6a  |lick load..")..j|
000168d0  2c 20 20 76 61 72 5f 62  75 66 66 25 20 3d 20 a4  |,  var_buff% = .|
000168e0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
000168f0  65 74 63 68 28 32 35 36  29 0d 0b 6b 51 20 20 76  |etch(256)..kQ  v|
00016900  61 72 24 20 20 20 20 20  20 3d 20 a4 73 68 65 6c  |ar$      = .shel|
00016910  6c 5f 4f 53 56 61 72 47  65 74 56 61 6c 28 76 61  |l_OSVarGetVal(va|
00016920  72 5f 62 75 66 66 25 2c  32 35 36 2c 22 41 6c 69  |r_buff%,256,"Ali|
00016930  61 73 24 40 52 75 6e 54  79 70 65 5f 22 20 2b 20  |as$@RunType_" + |
00016940  c3 7e 74 79 70 65 25 2c  31 29 0d 0b 6c 3d 20 20  |.~type%,1)..l=  |
00016950  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
00016960  44 61 74 61 4f 70 65 6e  4f 4b 54 6f 4c 6f 61 64  |DataOpenOKToLoad|
00016970  3a 41 6c 69 61 73 24 40  52 75 6e 54 79 70 65 3d  |:Alias$@RunType=|
00016980  22 2b 76 61 72 24 29 0d  0b 6d 27 20 20 f2 73 68  |"+var$)..m'  .sh|
00016990  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 52 65 74  |ell_HeapBlockRet|
000169a0  75 72 6e 28 76 61 72 5f  62 75 66 66 25 29 0d 0b  |urn(var_buff%)..|
000169b0  6e 4c 20 20 f4 20 43 6f  6d 70 61 72 65 20 6e 61  |nL  . Compare na|
000169c0  6d 65 20 6f 66 20 61 70  70 20 74 68 61 74 20 73  |me of app that s|
000169d0  65 74 20 75 70 20 41 6c  69 61 73 24 40 52 75 6e  |et up Alias$@Run|
000169e0  54 79 70 65 20 77 69 74  68 20 72 75 6e 6e 69 6e  |Type with runnin|
000169f0  67 20 61 70 70 20 2d 20  6f 66 0d 0b 6f 36 20 20  |g app - of..o6  |
00016a00  f4 20 63 6f 75 72 73 65  20 61 6c 6c 20 61 70 70  |. course all app|
00016a10  73 20 68 61 76 65 20 75  6e 69 71 75 65 20 6e 61  |s have unique na|
00016a20  6d 65 73 20 64 6f 6e 27  74 20 74 68 65 79 2e 2e  |mes don't they..|
00016a30  0d 0b 70 23 20 20 62 72  61 6e 63 68 24 20 3d 20  |..p#  branch$ = |
00016a40  a4 73 68 65 6c 6c 5f 42  72 61 6e 63 68 28 76 61  |.shell_Branch(va|
00016a50  72 24 29 0d 0b 71 36 20  20 f2 73 68 65 6c 6c 5f  |r$)..q6  .shell_|
00016a60  54 72 61 63 65 66 30 28  22 44 61 74 61 4f 70 65  |Tracef0("DataOpe|
00016a70  6e 4f 4b 54 6f 4c 6f 61  64 3a 64 62 75 67 20 22  |nOKToLoad:dbug "|
00016a80  2b 62 72 61 6e 63 68 24  29 0d 0b 72 50 20 20 e7  |+branch$)..rP  .|
00016a90  20 a4 73 68 65 6c 6c 5f  4c 65 61 66 28 62 72 61  | .shell_Leaf(bra|
00016aa0  6e 63 68 24 29 20 3d 20  22 21 22 2b a4 73 68 65  |nch$) = "!"+.she|
00016ab0  6c 6c 5f 47 65 74 41 70  70 4e 61 6d 65 20 8c 20  |ll_GetAppName . |
00016ac0  72 65 73 75 6c 74 25 20  3d 20 b9 20 8b 20 72 65  |result% = . . re|
00016ad0  73 75 6c 74 25 20 3d 20  a3 0d 0b 73 05 cd 0d 0b  |sult% = ...s....|
00016ae0  74 0d 3d 20 72 65 73 75  6c 74 25 0d 0b 75 05 3a  |t.= result%..u.:|
00016af0  0d 0b 76 23 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |..v#*|Stop FNshe|
00016b00  6c 6c 5f 44 61 74 61 4f  70 65 6e 4f 4b 54 6f 4c  |ll_DataOpenOKToL|
00016b10  6f 61 64 0d 0b 77 04 0d  0b 78 24 2a 7c 53 74 61  |oad..w...x$*|Sta|
00016b20  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 55 73 65  |rt PROCshell_Use|
00016b30  72 46 4e 4c 6f 61 64 46  69 6c 65 0d 0b 79 52 dd  |rFNLoadFile..yR.|
00016b40  20 f2 73 68 65 6c 6c 5f  55 73 65 72 46 4e 4c 6f  | .shell_UserFNLo|
00016b50  61 64 46 69 6c 65 28 74  79 70 65 25 2c 6c 6f 61  |adFile(type%,loa|
00016b60  64 6c 6f 63 25 2c 74 79  70 65 5f 6c 69 73 74 25  |dloc%,type_list%|
00016b70  2c 5f 66 69 6c 65 6e 61  6d 65 24 2c 5f 66 69 6c  |,_filename$,_fil|
00016b80  65 5f 73 69 7a 65 25 2c  62 6c 6b 25 29 0d 0b 7a  |e_size%,blk%)..z|
00016b90  1d ea 20 63 74 72 25 2c  66 6f 75 6e 64 25 2c 74  |.. ctr%,found%,t|
00016ba0  65 6d 70 25 2c 76 6f 69  64 25 0d 0b 7b 2e f4 20  |emp%,void%..{.. |
00016bb0  63 61 6c 6c 20 75 73 65  72 20 66 75 6e 63 74 69  |call user functi|
00016bc0  6f 6e 20 61 66 74 65 72  20 6c 6f 61 64 69 6e 67  |on after loading|
00016bd0  20 66 69 6c 65 2e 2e 2e  0d 0b 7c 14 63 74 72 25  | file.....|.ctr%|
00016be0  3d 30 3a 66 6f 75 6e 64  25 3d 2d 31 0d 0b 7d 1a  |=0:found%=-1..}.|
00016bf0  c8 95 20 74 79 70 65 5f  6c 69 73 74 25 21 63 74  |.. type_list%!ct|
00016c00  72 25 3c 3e 2d 31 0d 0b  7e 1b 20 20 74 65 6d 70  |r%<>-1..~.  temp|
00016c10  25 3d 74 79 70 65 5f 6c  69 73 74 25 21 63 74 72  |%=type_list%!ctr|
00016c20  25 0d 0b 7f 2b 20 20 e7  20 74 65 6d 70 25 20 80  |%...+  . temp% .|
00016c30  20 31 3c 3c 33 31 20 8c  20 74 65 6d 70 25 3d 74  | 1<<31 . temp%=t|
00016c40  65 6d 70 25 20 82 20 31  3c 3c 33 31 0d 0b 80 21  |emp% . 1<<31...!|
00016c50  20 20 e7 20 74 65 6d 70  25 3d 74 79 70 65 25 20  |  . temp%=type% |
00016c60  8c 20 66 6f 75 6e 64 25  3d 63 74 72 25 0d 0b 81  |. found%=ctr%...|
00016c70  0d 20 20 63 74 72 25 2b  3d 34 0d 0b 82 05 ce 0d  |.  ctr%+=4......|
00016c80  0b 83 11 74 65 6d 70 25  3d 62 6c 6b 25 21 31 32  |...temp%=blk%!12|
00016c90  0d 0b 84 5a 76 6f 69 64  25 3d a0 28 22 46 4e 22  |...Zvoid%=.("FN"|
00016ca0  2b 24 28 74 65 6d 70 25  21 66 6f 75 6e 64 25 29  |+$(temp%!found%)|
00016cb0  2b 22 28 22 2b c3 6c 6f  61 64 6c 6f 63 25 2b 22  |+"("+.loadloc%+"|
00016cc0  2c 22 2b c3 74 79 70 65  25 2b 22 2c 5f 66 69 6c  |,"+.type%+",_fil|
00016cd0  65 6e 61 6d 65 24 2c 22  2b c3 5f 66 69 6c 65 5f  |ename$,"+._file_|
00016ce0  73 69 7a 65 25 2b 22 29  22 29 0d 0b 85 05 e1 0d  |size%+")")......|
00016cf0  0b 86 05 3a 0d 0b 87 23  2a 7c 53 74 6f 70 20 50  |...:...#*|Stop P|
00016d00  52 4f 43 73 68 65 6c 6c  5f 55 73 65 72 46 4e 4c  |ROCshell_UserFNL|
00016d10  6f 61 64 46 69 6c 65 0d  0b 88 04 0d 0b 89 1e 2a  |oadFile........*|
00016d20  7c 53 74 61 72 74 20 50  52 4f 43 73 68 65 6c 6c  ||Start PROCshell|
00016d30  5f 44 61 74 61 53 61 76  65 0d 0b 8a 1a dd 20 f2  |_DataSave..... .|
00016d40  73 68 65 6c 6c 5f 44 61  74 61 53 61 76 65 28 5f  |shell_DataSave(_|
00016d50  51 25 29 0d 0b 8b 1e ea  20 74 65 6d 70 25 2c 6f  |Q%)..... temp%,o|
00016d60  66 66 73 65 74 25 2c 62  6c 6b 25 2c 6c 6f 6f 70  |ffset%,blk%,loop|
00016d70  25 0d 0b 8c 45 f4 20 43  61 6c 6c 65 64 20 77 68  |%...E. Called wh|
00016d80  65 6e 20 61 6e 6f 74 68  65 72 20 61 70 70 6c 69  |en another appli|
00016d90  63 61 74 69 6f 6e 20 77  61 6e 74 73 20 74 6f 20  |cation wants to |
00016da0  73 61 76 65 20 64 61 74  61 20 74 6f 20 6f 75 72  |save data to our|
00016db0  20 6f 6e 65 2e 2e 0d 0b  8d 15 2a 7c 69 66 64 65  | one......*|ifde|
00016dc0  66 20 54 72 61 63 65 49  6e 69 74 0d 0b 8e 38 f2  |f TraceInit...8.|
00016dd0  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 44  |shell_Tracef0("D|
00016de0  61 74 61 53 61 76 65 3a  44 61 74 61 53 61 76 65  |ataSave:DataSave|
00016df0  20 6d 65 73 73 61 67 65  20 72 65 63 65 69 76 65  | message receive|
00016e00  64 22 29 0d 0b 8f 0b 2a  7c 65 6e 64 69 66 0d 0b  |d")....*|endif..|
00016e10  90 49 f4 20 52 65 63 65  69 76 65 20 66 69 6c 65  |.I. Receive file|
00016e20  20 66 72 6f 6d 20 61 70  70 6c 69 63 61 74 69 6f  | from applicatio|
00016e30  6e 2c 20 62 75 74 20 63  68 65 63 6b 20 66 69 72  |n, but check fir|
00016e40  73 74 20 69 74 20 64 69  64 6e 27 74 20 63 6f 6d  |st it didn't com|
00016e50  65 20 66 72 6f 6d 20 0d  0b 91 0f f4 20 74 68 69  |e from ..... thi|
00016e60  73 20 6f 6e 65 21 0d 0b  92 17 e7 20 5f 51 25 21  |s one!..... _Q%!|
00016e70  30 34 3c 3e 5f 55 25 21  31 34 38 20 8c 0d 0b 93  |04<>_U%!148 ....|
00016e80  3d 20 20 f4 20 63 68 65  63 6b 20 65 76 65 6e 74  |=  . check event|
00016e90  20 6c 69 73 74 20 66 6f  72 20 77 69 6e 64 6f 77  | list for window|
00016ea0  2f 69 63 6f 6e 20 61 74  20 74 68 69 73 20 70 6f  |/icon at this po|
00016eb0  69 6e 74 20 74 6f 20 73  65 65 0d 0b 94 24 20 20  |int to see...$  |
00016ec0  f4 20 77 68 69 63 68 20  66 69 6c 65 74 79 70 65  |. which filetype|
00016ed0  73 20 61 72 65 20 76 61  6c 69 64 2e 2e 2e 0d 0b  |s are valid.....|
00016ee0  95 42 20 20 6f 66 66 73  65 74 25 3d a4 73 68 65  |.B  offset%=.she|
00016ef0  6c 6c 5f 47 65 74 45 76  65 6e 74 4c 69 73 74 4f  |ll_GetEventListO|
00016f00  66 66 73 65 74 28 5f 51  25 21 32 30 2c 5f 51 25  |ffset(_Q%!20,_Q%|
00016f10  21 32 34 2c 5f 55 25 2b  39 36 2c 31 36 2c a3 29  |!24,_U%+96,16,.)|
00016f20  0d 0b 96 14 20 20 e7 20  6f 66 66 73 65 74 25 3e  |....  . offset%>|
00016f30  2d 31 20 8c 0d 0b 97 1b  20 20 20 20 62 6c 6b 25  |-1 .....    blk%|
00016f40  3d 5f 55 25 21 39 36 2b  6f 66 66 73 65 74 25 0d  |=_U%!96+offset%.|
00016f50  0b 98 2d 20 20 20 20 e7  20 a4 73 68 65 6c 6c 5f  |..-    . .shell_|
00016f60  43 68 65 63 6b 54 79 70  65 28 5f 51 25 21 34 30  |CheckType(_Q%!40|
00016f70  2c 62 6c 6b 25 21 38 2c  a3 29 20 8c 0d 0b 99 15  |,blk%!8,.) .....|
00016f80  2a 7c 69 66 64 65 66 20  54 72 61 63 65 49 6e 69  |*|ifdef TraceIni|
00016f90  74 0d 0b 9a 48 20 20 20  20 20 20 f2 73 68 65 6c  |t...H      .shel|
00016fa0  6c 5f 54 72 61 63 65 66  30 28 22 44 61 74 61 53  |l_Tracef0("DataS|
00016fb0  61 76 65 3a 46 69 6c 65  74 79 70 65 20 72 65 63  |ave:Filetype rec|
00016fc0  6f 67 6e 69 7a 65 64 20  28 26 22 2b c3 7e 5f 51  |ognized (&"+.~_Q|
00016fd0  25 21 34 30 2b 22 29 22  29 0d 0b 9b 0b 2a 7c 65  |%!40+")")....*|e|
00016fe0  6e 64 69 66 0d 0b 9c 29  20 20 20 20 20 20 e7 20  |ndif...)      . |
00016ff0  a4 73 68 65 6c 6c 5f 54  6f 70 42 69 74 4c 6f 61  |.shell_TopBitLoa|
00017000  64 49 6e 50 72 6f 67 72  65 73 73 20 8c 0d 0b 9d  |dInProgress ....|
00017010  4e 20 20 20 20 20 20 20  20 f4 20 27 6e 6f 20 6c  |N        . 'no l|
00017020  6f 61 64 27 20 6c 6f 61  64 20 74 61 6b 69 6e 67  |oad' load taking|
00017030  20 70 6c 61 63 65 2c 20  6a 75 73 74 20 6e 65 65  | place, just nee|
00017040  64 20 74 68 65 20 66 75  6c 6c 20 66 69 6c 65 6e  |d the full filen|
00017050  61 6d 65 20 73 6f 20 74  68 61 74 0d 0b 9e 4f 20  |ame so that...O |
00017060  20 20 20 20 20 20 20 f4  20 74 68 65 20 75 73 65  |       . the use|
00017070  72 20 61 70 70 20 63 61  6e 20 64 6f 20 74 68 65  |r app can do the|
00017080  20 6c 6f 61 64 20 2d 20  74 68 65 72 65 66 6f 72  | load - therefor|
00017090  65 20 73 65 6e 64 20 4d  65 73 73 61 67 65 5f 44  |e send Message_D|
000170a0  61 74 61 53 61 76 65 41  63 6b 0d 0b 9f 2f 20 20  |ataSaveAck.../  |
000170b0  20 20 20 20 20 20 f4 20  77 69 74 68 20 57 69 6d  |      . with Wim|
000170c0  70 24 53 63 72 61 70 20  61 73 20 74 68 65 20 66  |p$Scrap as the f|
000170d0  69 6c 65 6e 61 6d 65 2e  2e 0d 0b a0 15 2a 7c 69  |ilename......*|i|
000170e0  66 64 65 66 20 54 72 61  63 65 49 6e 69 74 0d 0b  |fdef TraceInit..|
000170f0  a1 39 20 20 20 20 20 20  20 20 f2 73 68 65 6c 6c  |.9        .shell|
00017100  5f 54 72 61 63 65 66 30  28 22 44 61 74 61 53 61  |_Tracef0("DataSa|
00017110  76 65 3a 27 6e 6f 20 6c  6f 61 64 27 20 66 6c 61  |ve:'no load' fla|
00017120  67 20 73 65 74 22 29 0d  0b a2 42 20 20 20 20 20  |g set")...B     |
00017130  20 20 20 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |   .shell_Tracef|
00017140  30 28 22 44 61 74 61 53  61 76 65 3a 53 65 6e 64  |0("DataSave:Send|
00017150  69 6e 67 20 4d 65 73 73  61 67 65 5f 44 61 74 61  |ing Message_Data|
00017160  53 61 76 65 41 63 6b 22  29 0d 0b a3 0b 2a 7c 65  |SaveAck")....*|e|
00017170  6e 64 69 66 0d 0b a4 16  20 20 20 20 20 20 20 20  |ndif....        |
00017180  5f 51 25 21 30 30 3d 32  35 36 0d 0b a5 42 20 20  |_Q%!00=256...B  |
00017190  20 20 20 20 20 20 5f 51  25 21 31 32 3d 5f 51 25  |      _Q%!12=_Q%|
000171a0  21 30 38 3a 5f 51 25 21  33 36 3d 2d 31 3a 5f 51  |!08:_Q%!36=-1:_Q|
000171b0  25 21 31 36 3d 32 3a f4  20 4d 65 73 73 61 67 65  |%!16=2:. Message|
000171c0  5f 44 61 74 61 53 61 76  65 41 63 6b 0d 0b a6 36  |_DataSaveAck...6|
000171d0  20 20 20 20 20 20 20 20  24 28 5f 51 25 2b 34 34  |        $(_Q%+44|
000171e0  29 3d a4 73 68 65 6c 6c  5f 47 65 74 41 70 70 44  |)=.shell_GetAppD|
000171f0  69 72 2b 22 2e 53 63 72  61 70 46 69 6c 65 22 2b  |ir+".ScrapFile"+|
00017200  bd 30 0d 0b a7 2e 20 20  20 20 20 20 20 c8 99 20  |.0....       .. |
00017210  22 57 69 6d 70 5f 53 65  6e 64 4d 65 73 73 61 67  |"Wimp_SendMessag|
00017220  65 22 2c 31 38 2c 5f 51  25 2c 5f 51 25 21 30 34  |e",18,_Q%,_Q%!04|
00017230  0d 0b a8 0b 20 20 20 20  20 20 cc 0d 0b a9 4d 20  |....      ....M |
00017240  20 20 20 20 20 20 20 f4  20 4e 6f 72 6d 61 6c 20  |       . Normal |
00017250  6c 6f 61 64 20 66 72 6f  6d 20 61 6e 6f 74 68 65  |load from anothe|
00017260  72 20 61 70 70 6c 69 63  61 74 69 6f 6e 20 74 68  |r application th|
00017270  65 72 65 66 6f 72 65 20  6f 66 66 65 72 20 74 6f  |erefore offer to|
00017280  20 70 65 72 66 6f 72 6d  0d 0b aa 39 20 20 20 20  | perform...9    |
00017290  20 20 20 20 f4 20 61 20  52 41 4d 20 66 69 6c 65  |    . a RAM file|
000172a0  20 74 72 61 6e 73 66 65  72 20 77 69 74 68 20 4d  | transfer with M|
000172b0  65 73 73 61 67 65 5f 52  41 4d 46 65 74 63 68 2e  |essage_RAMFetch.|
000172c0  2e 0d 0b ab 4d 20 20 20  20 20 20 20 20 f4 20 4d  |....M        . M|
000172d0  61 6b 65 20 61 20 63 6f  70 79 20 6f 66 20 74 68  |ake a copy of th|
000172e0  65 20 6d 65 73 73 61 67  65 20 62 6c 6f 63 6b 20  |e message block |
000172f0  61 73 20 49 20 6e 65 65  64 20 69 74 20 77 68 65  |as I need it whe|
00017300  6e 20 52 41 4d 20 74 72  61 6e 73 66 65 72 0d 0b  |n RAM transfer..|
00017310  ac 3c 20 20 20 20 20 20  20 20 f4 20 69 73 20 6e  |.<        . is n|
00017320  6f 74 20 73 75 70 70 6f  72 74 65 64 20 62 79 20  |ot supported by |
00017330  74 68 65 20 73 65 6e 64  65 72 20 6f 66 20 74 68  |the sender of th|
00017340  69 73 20 6d 65 73 73 61  67 65 0d 0b ad 47 20 20  |is message...G  |
00017350  20 20 20 20 20 20 f2 73  68 65 6c 6c 5f 48 65 61  |      .shell_Hea|
00017360  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 5f 55 25  |pBlockReturn(_U%|
00017370  21 31 35 36 29 3a f4 20  72 65 74 75 72 6e 20 74  |!156):. return t|
00017380  65 6d 70 20 6d 65 73 73  61 67 65 20 62 6c 6b 2e  |emp message blk.|
00017390  2e 0d 0b ae 34 20 20 20  20 20 20 20 20 5f 55 25  |....4        _U%|
000173a0  21 31 35 36 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |!156=.shell_Heap|
000173b0  42 6c 6f 63 6b 46 65 74  63 68 28 28 5f 51 25 21  |BlockFetch((_Q%!|
000173c0  30 29 2b 38 29 0d 0b af  19 20 20 20 20 20 20 20  |0)+8)....       |
000173d0  20 74 65 6d 70 25 3d 5f  55 25 21 31 35 36 0d 0b  | temp%=_U%!156..|
000173e0  b0 39 20 20 20 20 20 20  20 20 e3 20 6c 6f 6f 70  |.9        . loop|
000173f0  25 3d 30 20 b8 20 5f 51  25 21 30 20 88 20 34 3a  |%=0 . _Q%!0 . 4:|
00017400  f4 20 66 69 72 73 74 20  77 6f 72 64 20 69 73 20  |. first word is |
00017410  73 69 7a 65 2e 2e 2e 0d  0b b1 23 20 20 20 20 20  |size......#     |
00017420  20 20 20 20 20 74 65 6d  70 25 21 6c 6f 6f 70 25  |     temp%!loop%|
00017430  3d 5f 51 25 21 6c 6f 6f  70 25 0d 0b b2 13 20 20  |=_Q%!loop%....  |
00017440  20 20 20 20 20 20 ed 20  6c 6f 6f 70 25 0d 0b b3  |      . loop%...|
00017450  40 20 20 20 20 20 20 20  20 f4 20 73 74 6f 72 65  |@        . store|
00017460  20 64 65 73 74 69 6e 61  74 69 6f 6e 20 77 69 6e  | destination win|
00017470  64 6f 77 2f 69 63 6f 6e  20 68 61 6e 64 6c 65 73  |dow/icon handles|
00017480  20 66 6f 72 20 6c 61 74  65 72 2e 2e 2e 0d 0b b4  | for later......|
00017490  27 20 20 20 20 20 20 20  20 5f 55 25 21 32 38 3d  |'        _U%!28=|
000174a0  5f 51 25 21 32 30 3a 5f  55 25 21 33 32 3d 5f 51  |_Q%!20:_U%!32=_Q|
000174b0  25 21 32 34 0d 0b b5 15  20 20 20 20 20 20 20 20  |%!24....        |
000174c0  5f 55 25 21 31 32 38 3d  30 0d 0b b6 2f 20 20 20  |_U%!128=0.../   |
000174d0  20 20 20 20 20 5f 55 25  21 31 33 32 3d 5f 51 25  |     _U%!132=_Q%|
000174e0  21 33 36 3a f4 20 52 41  4d 53 69 7a 65 25 3d 65  |!36:. RAMSize%=e|
000174f0  73 74 5f 73 69 7a 65 25  0d 0b b7 35 20 20 20 20  |st_size%...5    |
00017500  20 20 20 20 f4 20 73 65  74 20 75 70 20 68 65 61  |    . set up hea|
00017510  70 62 6c 6f 63 6b 20 74  6f 20 68 6f 6c 64 20 6c  |pblock to hold l|
00017520  6f 61 64 65 64 20 66 69  6c 65 2e 2e 2e 0d 0b b8  |oaded file......|
00017530  31 20 20 20 20 20 20 20  20 5f 55 25 21 31 35 32  |1        _U%!152|
00017540  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
00017550  6b 46 65 74 63 68 28 5f  51 25 21 33 36 29 0d 0b  |kFetch(_Q%!36)..|
00017560  b9 1e 20 20 20 20 20 20  20 20 f4 20 41 6e 64 20  |..        . And |
00017570  68 65 72 65 20 77 65 20  67 6f 20 21 0d 0b ba 15  |here we go !....|
00017580  20 20 20 20 20 20 20 20  5f 51 25 21 30 30 3d 32  |        _Q%!00=2|
00017590  38 0d 0b bb 19 20 20 20  20 20 20 20 20 5f 51 25  |8....        _Q%|
000175a0  21 31 32 3d 5f 51 25 21  30 38 0d 0b bc 29 20 20  |!12=_Q%!08...)  |
000175b0  20 20 20 20 20 20 5f 51  25 21 31 36 3d 36 3a f4  |      _Q%!16=6:.|
000175c0  20 4d 65 73 73 61 67 65  5f 52 41 4d 46 65 74 63  | Message_RAMFetc|
000175d0  68 2e 2e 0d 0b bd 22 20  20 20 20 20 20 20 20 5f  |h....."        _|
000175e0  51 25 21 32 30 3d 5f 55  25 21 31 35 32 2b 5f 55  |Q%!20=_U%!152+_U|
000175f0  25 21 31 32 38 0d 0b be  1a 20 20 20 20 20 20 20  |%!128....       |
00017600  20 5f 51 25 21 32 34 3d  5f 55 25 21 31 33 32 0d  | _Q%!24=_U%!132.|
00017610  0b bf 2f 20 20 20 20 20  20 20 20 c8 99 20 22 57  |../        .. "W|
00017620  69 6d 70 5f 53 65 6e 64  4d 65 73 73 61 67 65 22  |imp_SendMessage"|
00017630  2c 31 38 2c 5f 51 25 2c  5f 51 25 21 30 34 0d 0b  |,18,_Q%,_Q%!04..|
00017640  c0 1a 20 20 20 20 20 20  20 20 5f 55 25 21 31 31  |..        _U%!11|
00017650  32 3d 5f 51 25 21 30 38  0d 0b c1 15 2a 7c 69 66  |2=_Q%!08....*|if|
00017660  64 65 66 20 54 72 61 63  65 49 6e 69 74 0d 0b c2  |def TraceInit...|
00017670  3f 20 20 20 20 20 20 20  20 f2 73 68 65 6c 6c 5f  |?        .shell_|
00017680  54 72 61 63 65 66 30 28  22 44 61 74 61 53 61 76  |Tracef0("DataSav|
00017690  65 3a 53 65 6e 64 69 6e  67 20 4d 65 73 73 61 67  |e:Sending Messag|
000176a0  65 5f 52 41 4d 46 65 74  63 68 22 29 0d 0b c3 0b  |e_RAMFetch")....|
000176b0  2a 7c 65 6e 64 69 66 0d  0b c4 0b 20 20 20 20 20  |*|endif....     |
000176c0  20 cd 0d 0b c5 09 20 20  20 20 cc 0d 0b c6 15 2a  | .....    .....*|
000176d0  7c 69 66 64 65 66 20 54  72 61 63 65 49 6e 69 74  ||ifdef TraceInit|
000176e0  0d 0b c7 3c 20 20 20 20  20 20 f2 73 68 65 6c 6c  |...<      .shell|
000176f0  5f 54 72 61 63 65 66 30  28 22 44 61 74 61 53 61  |_Tracef0("DataSa|
00017700  76 65 3a 46 69 6c 65 74  79 70 65 20 4e 4f 54 20  |ve:Filetype NOT |
00017710  72 65 63 6f 67 6e 69 7a  65 64 22 29 0d 0b c8 0b  |recognized")....|
00017720  2a 7c 65 6e 64 69 66 0d  0b c9 09 20 20 20 20 cd  |*|endif....    .|
00017730  0d 0b ca 07 20 20 cd 0d  0b cb 05 cd 0d 0b cc 05  |....  ..........|
00017740  e1 0d 0b cd 05 3a 0d 0b  ce 1d 2a 7c 53 74 6f 70  |.....:....*|Stop|
00017750  20 50 52 4f 43 73 68 65  6c 6c 5f 44 61 74 61 53  | PROCshell_DataS|
00017760  61 76 65 0d 0b cf 04 0d  0b d0 33 f4 20 53 65 74  |ave.......3. Set|
00017770  20 61 6c 6c 20 74 68 69  73 20 73 74 75 66 66 20  | all this stuff |
00017780  62 65 66 6f 72 65 68 61  6e 64 20 61 73 20 52 41  |beforehand as RA|
00017790  4d 20 74 72 61 6e 73 66  65 72 0d 0b d1 30 f4 20  |M transfer...0. |
000177a0  70 72 6f 63 65 64 75 72  65 73 20 6d 61 79 20 62  |procedures may b|
000177b0  65 20 65 6e 74 65 72 65  64 20 6d 6f 72 65 20 74  |e entered more t|
000177c0  68 61 6e 20 6f 6e 63 65  20 21 0d 0b d2 30 f4 20  |han once !...0. |
000177d0  50 52 4f 43 4e 61 6d 65  28 46 4e 4c 65 61 66 28  |PROCName(FNLeaf(|
000177e0  46 4e 47 65 74 53 74 72  69 6e 67 28 50 6f 6c 6c  |FNGetString(Poll|
000177f0  50 74 72 25 2b 34 34 29  29 29 0d 0b d3 1b f4 20  |Ptr%+44)))..... |
00017800  50 52 4f 43 54 79 70 65  28 50 6f 6c 6c 50 74 72  |PROCType(PollPtr|
00017810  25 21 34 30 29 0d 0b d4  18 f4 20 50 52 4f 43 4d  |%!40)..... PROCM|
00017820  6f 64 69 66 69 65 64 28  54 52 55 45 29 0d 0b d5  |odified(TRUE)...|
00017830  24 f4 20 50 52 4f 43 44  61 74 65 28 46 4e 43 75  |$. PROCDate(FNCu|
00017840  72 72 65 6e 74 54 69 6d  65 41 6e 64 44 61 74 65  |rrentTimeAndDate|
00017850  29 0d 0b d6 28 2a 7c 53  74 61 72 74 20 46 4e 73  |)...(*|Start FNs|
00017860  68 65 6c 6c 5f 54 6f 70  42 69 74 4c 6f 61 64 49  |hell_TopBitLoadI|
00017870  6e 50 72 6f 67 72 65 73  73 0d 0b d7 21 dd 20 a4  |nProgress...!. .|
00017880  73 68 65 6c 6c 5f 54 6f  70 42 69 74 4c 6f 61 64  |shell_TopBitLoad|
00017890  49 6e 50 72 6f 67 72 65  73 73 0d 0b d8 1e e7 20  |InProgress..... |
000178a0  5f 55 25 21 31 30 30 20  80 20 31 3c 3c 31 20 8c  |_U%!100 . 1<<1 .|
000178b0  20 3d b9 20 8b 20 3d a3  0d 0b d9 05 3a 0d 0b da  | =. . =.....:...|
000178c0  28 2a 7c 53 74 6f 70 20  20 46 4e 73 68 65 6c 6c  |(*|Stop  FNshell|
000178d0  5f 54 6f 70 42 69 74 4c  6f 61 64 49 6e 50 72 6f  |_TopBitLoadInPro|
000178e0  67 72 65 73 73 0d 0b db  04 0d 0b dc 22 2a 7c 53  |gress......."*|S|
000178f0  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 53  |tart PROCshell_S|
00017900  65 6e 64 44 61 74 61 53  61 76 65 0d 0b dd 22 dd  |endDataSave...".|
00017910  20 f2 73 68 65 6c 6c 5f  53 65 6e 64 44 61 74 61  | .shell_SendData|
00017920  53 61 76 65 28 77 68 25  2c 69 68 25 29 0d 0b de  |Save(wh%,ih%)...|
00017930  32 ea 20 62 6c 6b 25 2c  6d 73 67 62 6c 6b 25 2c  |2. blk%,msgblk%,|
00017940  74 6d 70 62 6c 6b 25 2c  6f 66 66 73 65 74 25 2c  |tmpblk%,offset%,|
00017950  46 69 6c 65 53 69 7a 65  25 2c 76 6f 69 64 25 0d  |FileSize%,void%.|
00017960  0b df 27 74 6d 70 62 6c  6b 25 20 3d 20 a4 73 68  |..'tmpblk% = .sh|
00017970  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
00017980  63 68 28 33 30 29 0d 0b  e0 46 f4 20 72 65 74 72  |ch(30)...F. retr|
00017990  69 65 76 65 20 63 75 72  72 65 6e 74 20 70 6f 73  |ieve current pos|
000179a0  69 74 69 6f 6e 20 6f 66  20 70 6f 69 6e 74 65 72  |ition of pointer|
000179b0  20 28 77 69 6e 64 6f 77  20 61 6e 64 20 69 63 6f  | (window and ico|
000179c0  6e 20 6f 76 65 72 20 77  68 69 63 68 0d 0b e1 31  |n over which...1|
000179d0  f4 20 74 68 65 20 64 72  61 67 20 65 76 65 6e 74  |. the drag event|
000179e0  20 65 6e 64 65 64 20 70  6c 75 73 20 70 6f 69 6e  | ended plus poin|
000179f0  74 65 72 20 70 6f 73 69  74 69 6f 6e 29 0d 0b e2  |ter position)...|
00017a00  25 c8 99 20 22 57 69 6d  70 5f 47 65 74 50 6f 69  |%.. "Wimp_GetPoi|
00017a10  6e 74 65 72 49 6e 66 6f  22 2c 2c 74 6d 70 62 6c  |nterInfo",,tmpbl|
00017a20  6b 25 0d 0b e3 3a 6f 66  66 73 65 74 25 3d a4 73  |k%...:offset%=.s|
00017a30  68 65 6c 6c 5f 47 65 74  45 76 65 6e 74 4c 69 73  |hell_GetEventLis|
00017a40  74 4f 66 66 73 65 74 28  77 68 25 2c 69 68 25 2c  |tOffset(wh%,ih%,|
00017a50  5f 55 25 2b 37 32 2c 32  34 2c a3 29 0d 0b e4 1f  |_U%+72,24,.)....|
00017a60  e7 20 6f 66 66 73 65 74  25 3d 2d 31 20 84 20 6f  |. offset%=-1 . o|
00017a70  66 66 73 65 74 25 3d 2d  32 20 8c 0d 0b e5 69 20  |ffset%=-2 ....i |
00017a80  20 76 6f 69 64 25 3d a4  73 68 65 6c 6c 5f 4d 65  | void%=.shell_Me|
00017a90  73 73 61 67 65 57 69 6e  64 6f 77 28 a4 73 68 65  |ssageWindow(.she|
00017aa0  6c 6c 5f 4d 65 73 73 61  67 65 4e 6f 41 72 67 73  |ll_MessageNoArgs|
00017ab0  28 22 53 48 45 4c 4c 4d  53 47 31 33 22 29 2c 30  |("SHELLMSG13"),0|
00017ac0  2c 22 22 2c a4 73 68 65  6c 6c 5f 4d 65 73 73 61  |,"",.shell_Messa|
00017ad0  67 65 4e 6f 41 72 67 73  28 22 77 61 72 6e 69 6e  |geNoArgs("warnin|
00017ae0  67 22 29 29 0d 0b e6 05  cc 0d 0b e7 1b 20 20 62  |g")).........  b|
00017af0  6c 6b 25 3d 28 5f 55 25  21 37 32 29 2b 6f 66 66  |lk%=(_U%!72)+off|
00017b00  73 65 74 25 0d 0b e8 16  20 20 e7 20 62 6c 6b 25  |set%....  . blk%|
00017b10  21 38 3e 26 38 30 30 30  20 8c 0d 0b e9 30 20 20  |!8>&8000 ....0  |
00017b20  20 20 46 69 6c 65 53 69  7a 65 25 3d a4 73 68 65  |  FileSize%=.she|
00017b30  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 49 6e 66 6f  |ll_HeapBlockInfo|
00017b40  28 62 6c 6b 25 21 38 29  2d 34 0d 0b ea 07 20 20  |(blk%!8)-4....  |
00017b50  cc 0d 0b eb 18 20 20 20  20 46 69 6c 65 53 69 7a  |.....    FileSiz|
00017b60  65 25 3d 62 6c 6b 25 21  38 0d 0b ec 07 20 20 cd  |e%=blk%!8....  .|
00017b70  0d 0b ed 14 20 20 6d 73  67 62 6c 6b 25 3d 5f 55  |....  msgblk%=_U|
00017b80  25 21 37 36 0d 0b ee 35  20 20 6d 73 67 62 6c 6b  |%!76...5  msgblk|
00017b90  25 21 30 20 3d 32 35 36  20 20 20 20 20 20 20 3a  |%!0 =256       :|
00017ba0  f4 20 6c 65 6e 67 74 68  20 6f 66 20 6d 65 73 73  |. length of mess|
00017bb0  61 67 65 20 62 6c 6f 63  6b 0d 0b ef 31 20 20 6d  |age block...1  m|
00017bc0  73 67 62 6c 6b 25 21 31  32 3d 30 20 20 20 20 20  |sgblk%!12=0     |
00017bd0  20 20 20 20 3a f4 20 6d  79 72 65 66 20 30 3d 6f  |    :. myref 0=o|
00017be0  72 69 67 69 6e 61 74 69  6e 67 0d 0b f0 2c 20 20  |riginating...,  |
00017bf0  6d 73 67 62 6c 6b 25 21  31 36 3d 31 20 20 20 20  |msgblk%!16=1    |
00017c00  20 20 20 20 20 3a f4 20  6d 65 73 73 61 67 65 20  |     :. message |
00017c10  61 63 74 69 6f 6e 0d 0b  f1 37 20 20 6d 73 67 62  |action...7  msgb|
00017c20  6c 6b 25 21 32 30 3d 74  6d 70 62 6c 6b 25 21 31  |lk%!20=tmpblk%!1|
00017c30  32 3a f4 20 64 65 73 74  69 6e 61 74 69 6f 6e 20  |2:. destination |
00017c40  77 69 6e 64 6f 77 20 68  61 6e 64 6c 65 0d 0b f2  |window handle...|
00017c50  35 20 20 6d 73 67 62 6c  6b 25 21 32 34 3d 74 6d  |5  msgblk%!24=tm|
00017c60  70 62 6c 6b 25 21 31 36  3a f4 20 64 65 73 74 69  |pblk%!16:. desti|
00017c70  6e 61 74 69 6f 6e 20 69  63 6f 6e 20 68 61 6e 64  |nation icon hand|
00017c80  6c 65 0d 0b f3 2b 20 20  6d 73 67 62 6c 6b 25 21  |le...+  msgblk%!|
00017c90  32 38 3d 74 6d 70 62 6c  6b 25 21 30 20 3a f4 20  |28=tmpblk%!0 :. |
00017ca0  6d 6f 75 73 65 20 78 20  63 6f 6f 72 64 0d 0b f4  |mouse x coord...|
00017cb0  2b 20 20 6d 73 67 62 6c  6b 25 21 33 32 3d 74 6d  |+  msgblk%!32=tm|
00017cc0  70 62 6c 6b 25 21 34 20  3a f4 20 6d 6f 75 73 65  |pblk%!4 :. mouse|
00017cd0  20 79 20 63 6f 6f 72 64  0d 0b f5 34 20 20 6d 73  | y coord...4  ms|
00017ce0  67 62 6c 6b 25 21 33 36  3d 46 69 6c 65 53 69 7a  |gblk%!36=FileSiz|
00017cf0  65 25 20 3a f4 20 65 73  74 69 6d 61 74 65 64 20  |e% :. estimated |
00017d00  73 69 7a 65 20 6f 66 20  66 69 6c 65 0d 0b f6 27  |size of file...'|
00017d10  20 20 6d 73 67 62 6c 6b  25 21 34 30 3d 62 6c 6b  |  msgblk%!40=blk|
00017d20  25 21 31 32 20 20 20 3a  f4 20 66 69 6c 65 20 74  |%!12   :. file t|
00017d30  79 70 65 0d 0b f7 40 20  20 24 28 6d 73 67 62 6c  |ype...@  $(msgbl|
00017d40  6b 25 2b 34 34 29 3d a4  73 68 65 6c 6c 5f 4c 65  |k%+44)=.shell_Le|
00017d50  61 66 28 a4 73 68 65 6c  6c 5f 49 63 6f 6e 47 65  |af(.shell_IconGe|
00017d60  74 44 61 74 61 28 77 68  25 2c 62 6c 6b 25 21 31  |tData(wh%,blk%!1|
00017d70  36 29 29 0d 0b f8 3c 20  20 c8 99 20 22 57 69 6d  |6))...<  .. "Wim|
00017d80  70 5f 53 65 6e 64 4d 65  73 73 61 67 65 22 2c 31  |p_SendMessage",1|
00017d90  38 2c 6d 73 67 62 6c 6b  25 2c 6d 73 67 62 6c 6b  |8,msgblk%,msgblk|
00017da0  25 21 32 30 2c 6d 73 67  62 6c 6b 25 21 32 34 0d  |%!20,msgblk%!24.|
00017db0  0b f9 13 20 20 5f 55 25  21 31 32 30 3d 5f 51 25  |...  _U%!120=_Q%|
00017dc0  21 38 0d 0b fa 24 20 20  5f 55 25 21 31 33 36 3d  |!8...$  _U%!136=|
00017dd0  46 69 6c 65 53 69 7a 65  25 20 3a f4 20 46 69 6c  |FileSize% :. Fil|
00017de0  65 53 69 7a 65 25 0d 0b  fb 24 20 20 5f 55 25 21  |eSize%...$  _U%!|
00017df0  31 34 30 3d 62 6c 6b 25  21 31 32 20 20 20 3a f4  |140=blk%!12   :.|
00017e00  20 46 69 6c 65 54 79 70  65 25 0d 0b fc 24 20 20  | FileType%...$  |
00017e10  5f 55 25 21 31 34 34 3d  62 6c 6b 25 21 38 20 20  |_U%!144=blk%!8  |
00017e20  20 20 3a f4 20 46 69 6c  65 42 75 66 66 25 0d 0b  |  :. FileBuff%..|
00017e30  fd 26 20 20 5f 55 25 21  31 35 36 3d 62 6c 6b 25  |.&  _U%!156=blk%|
00017e40  21 34 20 20 20 20 3a f4  20 54 61 73 6b 48 61 6e  |!4    :. TaskHan|
00017e50  64 6c 65 25 0d 0b fe 28  20 20 5f 55 25 21 32 30  |dle%...(  _U%!20|
00017e60  30 3d 6d 73 67 62 6c 6b  25 21 32 30 3a f4 20 77  |0=msgblk%!20:. w|
00017e70  69 6e 64 6f 77 20 68 61  6e 64 6c 65 0d 0b ff 26  |indow handle...&|
00017e80  20 20 5f 55 25 21 32 30  34 3d 6d 73 67 62 6c 6b  |  _U%!204=msgblk|
00017e90  25 21 32 34 3a f4 20 69  63 6f 6e 20 68 61 6e 64  |%!24:. icon hand|
00017ea0  6c 65 0d 0c 00 05 cd 0d  0c 01 23 f2 73 68 65 6c  |le........#.shel|
00017eb0  6c 5f 48 65 61 70 42 6c  6f 63 6b 52 65 74 75 72  |l_HeapBlockRetur|
00017ec0  6e 28 74 6d 70 62 6c 6b  25 29 0d 0c 02 05 e1 0d  |n(tmpblk%)......|
00017ed0  0c 03 05 3a 0d 0c 04 21  2a 7c 53 74 6f 70 20 50  |...:...!*|Stop P|
00017ee0  52 4f 43 73 68 65 6c 6c  5f 53 65 6e 64 44 61 74  |ROCshell_SendDat|
00017ef0  61 53 61 76 65 0d 0c 05  04 0d 0c 06 21 2a 7c 53  |aSave.......!*|S|
00017f00  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 44  |tart PROCshell_D|
00017f10  61 74 61 53 61 76 65 41  63 6b 0d 0c 07 1d dd 20  |ataSaveAck..... |
00017f20  f2 73 68 65 6c 6c 5f 44  61 74 61 53 61 76 65 41  |.shell_DataSaveA|
00017f30  63 6b 28 5f 51 25 29 0d  0c 08 27 ea 20 5f 66 75  |ck(_Q%)...'. _fu|
00017f40  6c 6c 6e 61 6d 65 24 2c  61 25 2c 62 25 2c 62 6c  |llname$,a%,b%,bl|
00017f50  6b 25 2c 74 65 6d 70 25  2c 76 6f 69 64 25 0d 0c  |k%,temp%,void%..|
00017f60  09 15 2a 7c 69 66 64 65  66 20 54 72 61 63 65 49  |..*|ifdef TraceI|
00017f70  6e 69 74 0d 0c 0a 3e f2  73 68 65 6c 6c 5f 54 72  |nit...>.shell_Tr|
00017f80  61 63 65 66 30 28 22 44  61 74 61 53 61 76 65 41  |acef0("DataSaveA|
00017f90  63 6b 3a 44 61 74 61 53  61 76 65 41 63 6b 20 6d  |ck:DataSaveAck m|
00017fa0  65 73 73 61 67 65 20 72  65 63 65 69 76 65 64 22  |essage received"|
00017fb0  29 0d 0c 0b 0b 2a 7c 65  6e 64 69 66 0d 0c 0c 17  |)....*|endif....|
00017fc0  61 25 3d 30 3a 62 25 3d  5f 51 25 3f 28 34 34 2b  |a%=0:b%=_Q%?(44+|
00017fd0  61 25 29 0d 0c 0d 0c c8  95 20 62 25 3c 3e 30 0d  |a%)...... b%<>0.|
00017fe0  0c 0e 17 20 20 5f 66 75  6c 6c 6e 61 6d 65 24 2b  |...  _fullname$+|
00017ff0  3d bd 28 62 25 29 0d 0c  0f 0b 20 20 61 25 2b 3d  |=.(b%)....  a%+=|
00018000  31 0d 0c 10 14 20 20 62  25 3d 5f 51 25 3f 28 34  |1....  b%=_Q%?(4|
00018010  34 2b 61 25 29 0d 0c 11  05 ce 0d 0c 12 15 2a 7c  |4+a%).........*||
00018020  69 66 64 65 66 20 54 72  61 63 65 49 6e 69 74 0d  |ifdef TraceInit.|
00018030  0c 13 40 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |..@.shell_Tracef|
00018040  30 28 22 44 61 74 61 53  61 76 65 41 63 6b 3a 46  |0("DataSaveAck:F|
00018050  75 6c 6c 20 73 61 76 65  20 6e 61 6d 65 20 69 73  |ull save name is|
00018060  3a 20 22 2b 5f 66 75 6c  6c 6e 61 6d 65 24 29 0d  |: "+_fullname$).|
00018070  0c 14 33 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |..3.shell_Tracef|
00018080  30 28 22 44 61 74 61 53  61 76 65 41 63 6b 3a 74  |0("DataSaveAck:t|
00018090  61 73 6b 20 20 20 3d 20  26 22 2b c3 5f 51 25 21  |ask   = &"+._Q%!|
000180a0  34 29 0d 0c 15 35 f2 73  68 65 6c 6c 5f 54 72 61  |4)...5.shell_Tra|
000180b0  63 65 66 30 28 22 44 61  74 61 53 61 76 65 41 63  |cef0("DataSaveAc|
000180c0  6b 3a 6d 79 74 61 73 6b  20 3d 20 26 22 2b c3 5f  |k:mytask = &"+._|
000180d0  55 25 21 31 34 38 29 0d  0c 16 0b 2a 7c 65 6e 64  |U%!148)....*|end|
000180e0  69 66 0d 0c 17 42 6f 66  66 73 65 74 25 20 3d 20  |if...Boffset% = |
000180f0  a4 73 68 65 6c 6c 5f 47  65 74 45 76 65 6e 74 4c  |.shell_GetEventL|
00018100  69 73 74 4f 66 66 73 65  74 28 5f 55 25 21 32 38  |istOffset(_U%!28|
00018110  2c 5f 55 25 21 33 32 2c  5f 55 25 2b 37 32 2c 32  |,_U%!32,_U%+72,2|
00018120  34 2c a3 29 0d 0c 18 57  f4 20 49 46 20 6f 66 66  |4,.)...W. IF off|
00018130  73 65 74 25 20 3d 20 2d  31 20 4f 52 20 6f 66 66  |set% = -1 OR off|
00018140  73 65 74 25 20 3d 20 2d  32 20 54 48 45 4e 20 45  |set% = -2 THEN E|
00018150  52 52 4f 52 20 39 39 2c  46 4e 73 68 65 6c 6c 5f  |RROR 99,FNshell_|
00018160  4d 65 73 73 61 67 65 4e  6f 41 72 67 73 28 22 53  |MessageNoArgs("S|
00018170  48 45 4c 4c 4d 53 47 30  35 22 29 0d 0c 19 35 f2  |HELLMSG05")...5.|
00018180  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 44  |shell_Tracef0("D|
00018190  61 74 61 53 61 76 65 41  63 6b 3a 6f 66 66 73 65  |ataSaveAck:offse|
000181a0  74 25 20 3d 20 22 2b c3  6f 66 66 73 65 74 25 29  |t% = "+.offset%)|
000181b0  0d 0c 1a 14 e7 20 6f 66  66 73 65 74 25 20 3e 3d  |..... offset% >=|
000181c0  20 30 20 8c 0d 0c 1b 1b  20 20 62 6c 6b 25 3d 28  | 0 .....  blk%=(|
000181d0  5f 55 25 21 37 32 29 2b  6f 66 66 73 65 74 25 0d  |_U%!72)+offset%.|
000181e0  0c 1c 13 20 20 74 65 6d  70 25 3d 62 6c 6b 25 21  |...  temp%=blk%!|
000181f0  32 30 0d 0c 1d 2e 20 20  f4 20 6e 6f 77 20 63 61  |20....  . now ca|
00018200  6c 6c 20 74 68 65 20 66  69 6c 65 20 73 61 76 69  |ll the file savi|
00018210  6e 67 20 72 6f 75 74 69  6e 65 2e 2e 2e 2e 2e 2e  |ng routine......|
00018220  0d 0c 1e 14 20 20 e7 20  24 74 65 6d 70 25 3c 3e  |....  . $temp%<>|
00018230  22 22 20 8c 0d 0c 1f 2b  20 20 20 20 76 6f 69 64  |"" ....+    void|
00018240  25 3d a0 28 22 46 4e 22  2b 24 74 65 6d 70 25 2b  |%=.("FN"+$temp%+|
00018250  22 28 5f 66 75 6c 6c 6e  61 6d 65 24 29 22 29 0d  |"(_fullname$)").|
00018260  0c 20 07 20 20 cc 0d 0c  21 53 20 20 20 20 f4 20  |. .  ...!S    . |
00018270  6e 6f 20 66 69 6c 65 20  73 61 76 69 6e 67 20 72  |no file saving r|
00018280  6f 75 74 69 6e 65 20 73  70 65 63 69 66 69 65 64  |outine specified|
00018290  20 66 6f 72 20 74 68 69  73 20 65 76 65 6e 74 2c  | for this event,|
000182a0  20 73 6f 20 63 68 65 63  6b 20 69 66 20 64 61 74  | so check if dat|
000182b0  61 20 69 73 20 69 6e 20  61 0d 0c 22 15 20 20 20  |a is in a..".   |
000182c0  20 f4 20 68 65 61 70 62  6c 6f 63 6b 2e 2e 0d 0c  | . heapblock....|
000182d0  23 2a 20 20 20 20 e7 20  a4 73 68 65 6c 6c 5f 48  |#*    . .shell_H|
000182e0  65 61 70 42 6c 6f 63 6b  45 78 69 73 74 73 28 62  |eapBlockExists(b|
000182f0  6c 6b 25 21 38 29 20 8c  0d 0c 24 49 20 20 20 20  |lk%!8) ...$I    |
00018300  20 20 f4 20 64 65 66 61  75 6c 74 20 73 61 76 65  |  . default save|
00018310  20 72 6f 75 74 69 6e 65  2c 20 6a 75 73 74 20 73  | routine, just s|
00018320  61 76 65 20 74 68 65 20  77 68 6f 6c 65 20 68 65  |ave the whole he|
00018330  61 70 62 6c 6f 63 6b 20  74 6f 20 64 69 73 6b 2e  |apblock to disk.|
00018340  2e 0d 0c 25 5a 20 20 20  20 20 20 c8 99 20 22 4f  |...%Z      .. "O|
00018350  53 5f 46 69 6c 65 22 2c  31 30 2c 5f 66 75 6c 6c  |S_File",10,_full|
00018360  6e 61 6d 65 24 2c 62 6c  6b 25 21 31 32 2c 2c 62  |name$,blk%!12,,b|
00018370  6c 6b 25 21 38 2c 62 6c  6b 25 21 38 2b a4 73 68  |lk%!8,blk%!8+.sh|
00018380  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 49 6e 66  |ell_HeapBlockInf|
00018390  6f 28 62 6c 6b 25 21 38  29 2b 31 0d 0c 26 09 20  |o(blk%!8)+1..&. |
000183a0  20 20 20 cc 0d 0c 27 3c  20 20 20 20 20 20 f4 20  |   ...'<      . |
000183b0  57 68 6f 6f 70 73 21 20  6e 6f 74 20 61 20 68 65  |Whoops! not a he|
000183c0  61 70 62 6c 6f 63 6b 20  2d 20 73 6f 6d 65 6f 6e  |apblock - someon|
000183d0  65 27 73 20 73 63 72 65  77 65 64 20 75 70 2e 2e  |e's screwed up..|
000183e0  0d 0c 28 31 20 20 20 20  20 20 85 20 39 39 2c a4  |..(1      . 99,.|
000183f0  73 68 65 6c 6c 5f 4d 65  73 73 61 67 65 4e 6f 41  |shell_MessageNoA|
00018400  72 67 73 28 22 53 48 45  4c 4c 4d 53 47 32 31 22  |rgs("SHELLMSG21"|
00018410  29 0d 0c 29 09 20 20 20  20 cd 0d 0c 2a 07 20 20  |)..).    ...*.  |
00018420  cd 0d 0c 2b 13 20 20 e7  20 5f 51 25 21 33 36 3e  |...+.  . _Q%!36>|
00018430  2d 31 20 8c 0d 0c 2c 18  20 20 20 20 f4 20 66 69  |-1 ...,.    . fi|
00018440  6c 65 20 69 73 20 73 65  63 75 72 65 0d 0c 2d 34  |le is secure..-4|
00018450  20 20 20 20 e7 20 5f 55  25 21 38 30 3c 3e 30 20  |    . _U%!80<>0 |
00018460  8c 20 f2 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |. .shell_HeapBlo|
00018470  63 6b 52 65 74 75 72 6e  28 5f 55 25 21 38 30 29  |ckReturn(_U%!80)|
00018480  0d 0c 2e 33 20 20 20 20  5f 55 25 21 38 30 3d a4  |...3    _U%!80=.|
00018490  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
000184a0  65 74 63 68 28 a9 5f 66  75 6c 6c 6e 61 6d 65 24  |etch(._fullname$|
000184b0  2b 31 29 0d 0c 2f 14 20  20 20 20 74 65 6d 70 25  |+1)../.    temp%|
000184c0  3d 5f 55 25 21 38 30 0d  0c 30 19 20 20 20 20 24  |=_U%!80..0.    $|
000184d0  74 65 6d 70 25 3d 5f 66  75 6c 6c 6e 61 6d 65 24  |temp%=_fullname$|
000184e0  0d 0c 31 07 20 20 cd 0d  0c 32 44 20 20 5f 51 25  |..1.  ...2D  _Q%|
000184f0  21 31 36 3d 33 3a 21 5f  51 25 3d 32 35 36 3a 5f  |!16=3:!_Q%=256:_|
00018500  51 25 21 32 30 3d 5f 55  25 21 32 30 30 3a 5f 51  |Q%!20=_U%!200:_Q|
00018510  25 21 32 34 3d 5f 55 25  21 32 30 34 3a 5f 51 25  |%!24=_U%!204:_Q%|
00018520  21 34 30 3d 5f 55 25 21  31 34 30 0d 0c 33 37 20  |!40=_U%!140..37 |
00018530  20 5f 51 25 21 33 36 3d  a4 73 68 65 6c 6c 5f 46  | _Q%!36=.shell_F|
00018540  69 6c 65 4c 65 6e 67 74  68 28 5f 66 75 6c 6c 6e  |ileLength(_fulln|
00018550  61 6d 65 24 29 3a 5f 51  25 21 31 32 3d 5f 51 25  |ame$):_Q%!12=_Q%|
00018560  21 38 0d 0c 34 15 2a 7c  69 66 64 65 66 20 54 72  |!8..4.*|ifdef Tr|
00018570  61 63 65 49 6e 69 74 0d  0c 35 44 20 20 f2 73 68  |aceInit..5D  .sh|
00018580  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 44 61 74  |ell_Tracef0("Dat|
00018590  61 53 61 76 65 41 63 6b  3a 46 69 6c 65 20 6c 65  |aSaveAck:File le|
000185a0  6e 67 74 68 20 69 73 20  22 2b c3 5f 51 25 21 33  |ngth is "+._Q%!3|
000185b0  36 2b 22 20 62 79 74 65  73 22 29 0d 0c 36 0b 2a  |6+" bytes")..6.*|
000185c0  7c 65 6e 64 69 66 0d 0c  37 1f 20 20 24 28 5f 51  ||endif..7.  $(_Q|
000185d0  25 2b 34 34 29 3d 5f 66  75 6c 6c 6e 61 6d 65 24  |%+44)=_fullname$|
000185e0  2b bd 28 30 29 0d 0c 38  1d 20 20 f4 20 73 65 6e  |+.(0)..8.  . sen|
000185f0  64 20 64 61 74 61 6c 6f  61 64 20 6d 65 73 73 61  |d dataload messa|
00018600  67 65 0d 0c 39 14 20 20  f4 20 73 74 6f 72 65 20  |ge..9.  . store |
00018610  6d 79 5f 72 65 66 0d 0c  3a 12 20 20 5f 55 25 21  |my_ref..:.  _U%!|
00018620  38 34 3d 5f 51 25 21 38  0d 0c 3b 15 2a 7c 69 66  |84=_Q%!8..;.*|if|
00018630  64 65 66 20 54 72 61 63  65 49 6e 69 74 0d 0c 3c  |def TraceInit..<|
00018640  3c 20 20 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |<  .shell_Tracef|
00018650  30 28 22 44 61 74 61 53  61 76 65 41 63 6b 3a 53  |0("DataSaveAck:S|
00018660  65 6e 64 69 6e 67 20 44  61 74 61 4c 6f 61 64 20  |ending DataLoad |
00018670  4d 65 73 73 61 67 65 22  29 0d 0c 3d 0b 2a 7c 65  |Message")..=.*|e|
00018680  6e 64 69 66 0d 0c 3e 30  20 20 c8 99 20 22 57 69  |ndif..>0  .. "Wi|
00018690  6d 70 5f 53 65 6e 64 4d  65 73 73 61 67 65 22 2c  |mp_SendMessage",|
000186a0  31 38 2c 5f 51 25 2c 5f  51 25 21 32 30 2c 5f 51  |18,_Q%,_Q%!20,_Q|
000186b0  25 21 32 34 0d 0c 3f 41  20 20 f4 20 6e 6f 77 20  |%!24..?A  . now |
000186c0  63 6c 6f 73 65 20 77 69  6e 64 6f 77 20 74 68 61  |close window tha|
000186d0  74 20 73 61 76 65 20 6f  72 69 67 69 6e 61 74 65  |t save originate|
000186e0  64 20 66 72 6f 6d 20 69  66 20 69 74 20 69 73 20  |d from if it is |
000186f0  6e 6f 74 20 61 0d 0c 40  16 20 20 f4 20 27 64 79  |not a..@.  . 'dy|
00018700  6e 61 6d 69 63 27 20 64  62 6f 78 0d 0c 41 18 20  |namic' dbox..A. |
00018710  20 e7 20 5f 55 25 21 32  38 3c 3e 5f 55 25 21 32  | . _U%!28<>_U%!2|
00018720  30 20 8c 0d 0c 42 22 20  20 20 20 f2 73 68 65 6c  |0 ...B"    .shel|
00018730  6c 5f 43 6c 6f 73 65 57  69 6e 64 6f 77 28 5f 55  |l_CloseWindow(_U|
00018740  25 21 32 38 29 0d 0c 43  07 20 20 cd 0d 0c 44 35  |%!28)..C.  ...D5|
00018750  20 20 c8 99 20 22 57 69  6d 70 5f 43 72 65 61 74  |  .. "Wimp_Creat|
00018760  65 4d 65 6e 75 22 2c 2c  2d 31 3a f4 20 63 6c 6f  |eMenu",,-1:. clo|
00018770  73 65 20 61 6e 79 20 6f  70 65 6e 20 6d 65 6e 75  |se any open menu|
00018780  73 0d 0c 45 05 cc 0d 0c  46 3d 20 20 f2 73 68 65  |s..E....F=  .she|
00018790  6c 6c 5f 50 72 69 6e 74  53 61 76 65 28 5f 66 75  |ll_PrintSave(_fu|
000187a0  6c 6c 6e 61 6d 65 24 2c  5f 51 25 21 32 30 2c 5f  |llname$,_Q%!20,_|
000187b0  51 25 21 32 34 2c 5f 51  25 21 38 2c 5f 51 25 21  |Q%!24,_Q%!8,_Q%!|
000187c0  34 30 29 0d 0c 47 34 20  20 f2 73 68 65 6c 6c 5f  |40)..G4  .shell_|
000187d0  54 72 61 63 65 66 30 28  22 44 45 42 55 47 3a 3a  |Tracef0("DEBUG::|
000187e0  20 63 6f 70 69 65 73 20  3d 20 22 2b c3 28 5f 55  | copies = "+.(_U|
000187f0  25 21 33 33 36 29 29 0d  0c 48 15 20 20 e7 20 5f  |%!336))..H.  . _|
00018800  55 25 21 33 33 36 20 3e  20 30 20 8c 0d 0c 49 14  |U%!336 > 0 ...I.|
00018810  20 20 20 20 5f 55 25 21  33 33 36 20 2d 3d 20 31  |    _U%!336 -= 1|
00018820  0d 0c 4a 24 20 20 20 20  f2 73 68 65 6c 6c 5f 44  |..J$    .shell_D|
00018830  6f 53 65 6e 64 50 72 69  6e 74 53 61 76 65 28 26  |oSendPrintSave(&|
00018840  46 46 46 29 0d 0c 4b 07  20 20 cd 0d 0c 4c 05 cd  |FFF)..K.  ...L..|
00018850  0d 0c 4d 05 e1 0d 0c 4e  05 3a 0d 0c 4f 20 2a 7c  |..M....N.:..O *||
00018860  53 74 6f 70 20 50 52 4f  43 73 68 65 6c 6c 5f 44  |Stop PROCshell_D|
00018870  61 74 61 53 61 76 65 41  63 6b 0d 0c 50 04 0d 0c  |ataSaveAck..P...|
00018880  51 27 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |Q'*|Start PROCsh|
00018890  65 6c 6c 5f 44 61 74 61  53 61 76 65 43 68 65 63  |ell_DataSaveChec|
000188a0  6b 4e 61 6d 65 0d 0c 52  27 dd 20 f2 73 68 65 6c  |kName..R'. .shel|
000188b0  6c 5f 44 61 74 61 53 61  76 65 43 68 65 63 6b 4e  |l_DataSaveCheckN|
000188c0  61 6d 65 28 77 68 25 2c  69 68 25 29 0d 0c 53 1d  |ame(wh%,ih%)..S.|
000188d0  ea 20 6f 66 66 73 65 74  25 2c 62 6c 6b 25 2c 6c  |. offset%,blk%,l|
000188e0  69 73 74 5f 73 69 7a 65  25 0d 0c 54 46 f4 20 52  |ist_size%..TF. R|
000188f0  6f 75 74 69 6e 65 20 74  6f 20 63 68 65 63 6b 20  |outine to check |
00018900  69 66 20 61 20 27 64 61  74 61 73 61 76 65 27 20  |if a 'datasave' |
00018910  65 76 65 6e 74 20 65 78  69 73 74 73 20 69 6e 20  |event exists in |
00018920  74 68 65 20 77 69 6e 64  6f 77 20 77 68 25 2e 0d  |the window wh%..|
00018930  0c 55 45 f4 20 49 66 20  69 74 20 64 6f 65 73 20  |.UE. If it does |
00018940  74 68 65 6e 20 74 68 65  20 66 69 6c 65 6e 61 6d  |then the filenam|
00018950  65 20 69 73 20 63 68 65  63 6b 65 64 20 66 6f 72  |e is checked for|
00018960  20 61 20 27 2e 27 20 63  68 61 72 61 63 74 65 72  | a '.' character|
00018970  2e 20 41 6e 0d 0c 56 46  f4 20 65 72 72 6f 72 20  |. An..VF. error |
00018980  69 73 20 67 65 6e 65 72  61 74 65 64 20 69 66 20  |is generated if |
00018990  6e 6f 20 27 2e 27 20 69  73 20 66 6f 75 6e 64 2e  |no '.' is found.|
000189a0  20 54 68 69 73 20 72 6f  75 74 69 6e 65 20 69 73  | This routine is|
000189b0  20 63 61 6c 6c 65 64 20  62 79 0d 0c 57 3b f4 20  | called by..W;. |
000189c0  74 68 65 20 6c 69 62 72  61 72 79 20 77 68 65 6e  |the library when|
000189d0  20 61 20 6d 6f 75 73 65  20 63 6c 69 63 6b 20 6f  | a mouse click o|
000189e0  6e 20 69 63 6f 6e 20 30  20 69 73 20 64 65 74 65  |n icon 0 is dete|
000189f0  63 74 65 64 2e 0d 0c 58  19 62 6c 6b 25 3d 5f 55  |cted...X.blk%=_U|
00018a00  25 21 37 32 3a 6f 66 66  73 65 74 25 3d 30 0d 0c  |%!72:offset%=0..|
00018a10  59 0f e7 20 62 6c 6b 25  3c 3e 30 20 8c 0d 0c 5a  |Y.. blk%<>0 ...Z|
00018a20  2d 20 20 6c 69 73 74 5f  73 69 7a 65 25 3d a4 73  |-  list_size%=.s|
00018a30  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 49 6e  |hell_HeapBlockIn|
00018a40  66 6f 28 62 6c 6b 25 29  2d 38 0d 0c 5b 38 20 20  |fo(blk%)-8..[8  |
00018a50  f4 20 62 6c 6b 25 3c 3e  30 20 74 68 65 72 65 66  |. blk%<>0 theref|
00018a60  6f 72 65 20 61 20 64 61  74 61 73 61 76 65 20 65  |ore a datasave e|
00018a70  76 65 6e 74 20 6c 69 73  74 20 65 78 69 73 74 73  |vent list exists|
00018a80  2e 2e 0d 0c 5c 07 20 20  f5 0d 0c 5d 32 20 20 20  |....\.  ...]2   |
00018a90  20 f4 20 63 68 65 63 6b  20 77 69 6e 64 6f 77 20  | . check window |
00018aa0  68 61 6e 64 6c 65 73 20  6f 66 20 65 76 65 6e 74  |handles of event|
00018ab0  73 20 69 6e 20 6c 69 73  74 2e 2e 0d 0c 5e 1f 20  |s in list....^. |
00018ac0  20 20 20 e7 20 21 28 62  6c 6b 25 2b 6f 66 66 73  |   . !(blk%+offs|
00018ad0  65 74 25 29 3d 77 68 25  20 8c 0d 0c 5f 29 20 20  |et%)=wh% ..._)  |
00018ae0  20 20 20 20 f4 20 63 68  65 63 6b 20 66 6f 72 20  |    . check for |
00018af0  61 20 76 61 6c 69 64 20  70 61 74 68 20 6e 61 6d  |a valid path nam|
00018b00  65 2e 2e 0d 0c 60 31 20  20 20 20 20 20 6e 61 6d  |e....`1      nam|
00018b10  65 24 3d a4 73 68 65 6c  6c 5f 49 63 6f 6e 47 65  |e$=.shell_IconGe|
00018b20  74 44 61 74 61 28 21 62  6c 6b 25 2c 62 6c 6b 25  |tData(!blk%,blk%|
00018b30  21 31 36 29 0d 0c 61 49  20 20 20 20 20 20 e7 20  |!16)..aI      . |
00018b40  a7 6e 61 6d 65 24 2c 22  2e 22 29 3d 30 20 8c 20  |.name$,".")=0 . |
00018b50  f2 73 68 65 6c 6c 5f 4f  4b 28 a4 73 68 65 6c 6c  |.shell_OK(.shell|
00018b60  5f 4d 65 73 73 61 67 65  4e 6f 41 72 67 73 28 22  |_MessageNoArgs("|
00018b70  53 48 45 4c 4c 4d 53 47  30 31 22 29 29 0d 0c 62  |SHELLMSG01"))..b|
00018b80  43 20 20 20 20 20 20 6f  66 66 73 65 74 25 3d 6c  |C      offset%=l|
00018b90  69 73 74 5f 73 69 7a 65  25 3a f4 20 77 69 6e 64  |ist_size%:. wind|
00018ba0  6f 77 20 68 61 6e 64 6c  65 20 66 6f 75 6e 64 20  |ow handle found |
00018bb0  73 6f 20 61 62 6f 72 74  20 63 68 65 63 6b 2e 2e  |so abort check..|
00018bc0  0d 0c 63 09 20 20 20 20  cd 0d 0c 64 28 20 20 20  |..c.    ...d(   |
00018bd0  20 6f 66 66 73 65 74 25  2b 3d 32 34 3a f4 20 63  | offset%+=24:. c|
00018be0  68 65 63 6b 20 6e 65 78  74 20 65 76 65 6e 74 2e  |heck next event.|
00018bf0  2e 0d 0c 65 1b 20 20 fd  20 6f 66 66 73 65 74 25  |...e.  . offset%|
00018c00  3e 3d 6c 69 73 74 5f 73  69 7a 65 25 0d 0c 66 05  |>=list_size%..f.|
00018c10  cd 0d 0c 67 05 e1 0d 0c  68 05 3a 0d 0c 69 26 2a  |...g....h.:..i&*|
00018c20  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
00018c30  44 61 74 61 53 61 76 65  43 68 65 63 6b 4e 61 6d  |DataSaveCheckNam|
00018c40  65 0d 0c 6a 04 0d 0c 6b  21 2a 7c 53 74 61 72 74  |e..j...k!*|Start|
00018c50  20 50 52 4f 43 73 68 65  6c 6c 5f 44 61 74 61 4c  | PROCshell_DataL|
00018c60  6f 61 64 41 63 6b 0d 0c  6c 1d dd 20 f2 73 68 65  |oadAck..l.. .she|
00018c70  6c 6c 5f 44 61 74 61 4c  6f 61 64 41 63 6b 28 5f  |ll_DataLoadAck(_|
00018c80  51 25 29 0d 0c 6d 15 2a  7c 69 66 64 65 66 20 54  |Q%)..m.*|ifdef T|
00018c90  72 61 63 65 49 6e 69 74  0d 0c 6e 51 f2 73 68 65  |raceInit..nQ.she|
00018ca0  6c 6c 5f 54 72 61 63 65  66 30 28 22 44 61 74 61  |ll_Tracef0("Data|
00018cb0  4c 6f 61 64 41 63 6b 3a  44 61 74 61 4c 6f 61 64  |LoadAck:DataLoad|
00018cc0  41 63 6b 20 6d 65 73 73  61 67 65 20 72 65 63 65  |Ack message rece|
00018cd0  69 76 65 64 20 28 66 69  6c 65 20 72 65 63 65 69  |ived (file recei|
00018ce0  76 65 64 20 6f 6b 29 22  29 0d 0c 6f 0b 2a 7c 65  |ved ok)")..o.*|e|
00018cf0  6e 64 69 66 0d 0c 70 05  e1 0d 0c 71 05 3a 0d 0c  |ndif..p....q.:..|
00018d00  72 20 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |r *|Stop PROCshe|
00018d10  6c 6c 5f 44 61 74 61 4c  6f 61 64 41 63 6b 0d 0c  |ll_DataLoadAck..|
00018d20  73 04 0d 0c 74 2c 2a 7c  53 74 61 72 74 20 50 52  |s...t,*|Start PR|
00018d30  4f 43 73 68 65 6c 6c 5f  55 73 65 72 4d 65 73 73  |OCshell_UserMess|
00018d40  61 67 65 41 63 6b 6e 6f  77 6c 65 64 67 65 0d 0c  |ageAcknowledge..|
00018d50  75 28 dd 20 f2 73 68 65  6c 6c 5f 55 73 65 72 4d  |u(. .shell_UserM|
00018d60  65 73 73 61 67 65 41 63  6b 6e 6f 77 6c 65 64 67  |essageAcknowledg|
00018d70  65 28 5f 51 25 29 0d 0c  76 0f c8 8e 20 5f 51 25  |e(_Q%)..v... _Q%|
00018d80  21 31 36 20 ca 0d 0c 77  21 20 20 c9 20 33 3a f2  |!16 ...w!  . 3:.|
00018d90  73 68 65 6c 6c 5f 41 63  6b 44 61 74 61 4c 6f 61  |shell_AckDataLoa|
00018da0  64 28 5f 51 25 29 0d 0c  78 21 20 20 c9 20 36 3a  |d(_Q%)..x!  . 6:|
00018db0  f2 73 68 65 6c 6c 5f 41  63 6b 52 41 4d 46 65 74  |.shell_AckRAMFet|
00018dc0  63 68 28 5f 51 25 29 0d  0c 79 05 cb 0d 0c 7a 05  |ch(_Q%)..y....z.|
00018dd0  e1 0d 0c 7b 05 3a 0d 0c  7c 2b 2a 7c 53 74 6f 70  |...{.:..|+*|Stop|
00018de0  20 50 52 4f 43 73 68 65  6c 6c 5f 55 73 65 72 4d  | PROCshell_UserM|
00018df0  65 73 73 61 67 65 41 63  6b 6e 6f 77 6c 65 64 67  |essageAcknowledg|
00018e00  65 0d 0c 7d 04 0d 0c 7e  21 2a 7c 53 74 61 72 74  |e..}...~!*|Start|
00018e10  20 50 52 4f 43 73 68 65  6c 6c 5f 41 63 6b 44 61  | PROCshell_AckDa|
00018e20  74 61 4c 6f 61 64 0d 0c  7f 1d dd 20 f2 73 68 65  |taLoad..... .she|
00018e30  6c 6c 5f 41 63 6b 44 61  74 61 4c 6f 61 64 28 5f  |ll_AckDataLoad(_|
00018e40  51 25 29 0d 0c 80 16 e7  20 5f 51 25 21 31 32 3c  |Q%)..... _Q%!12<|
00018e50  3e 5f 55 25 21 38 34 20  8c 0d 0c 81 26 20 20 f4  |>_U%!84 ....&  .|
00018e60  20 52 65 66 65 72 65 6e  63 65 20 68 61 73 6e 27  | Reference hasn'|
00018e70  74 20 62 65 65 6e 20 75  70 64 61 74 65 64 2c 0d  |t been updated,.|
00018e80  0c 82 2b 20 20 f4 20 74  68 65 72 65 66 6f 72 65  |..+  . therefore|
00018e90  20 74 68 65 20 57 69 6d  70 20 72 65 74 75 72 6e  | the Wimp return|
00018ea0  65 64 20 6d 79 20 63 61  6c 6c 0d 0c 83 35 20 20  |ed my call...5  |
00018eb0  f4 20 54 68 65 20 72 65  63 65 69 76 65 72 20 64  |. The receiver d|
00018ec0  69 64 6e 27 74 20 75 6e  64 65 72 73 74 61 6e 64  |idn't understand|
00018ed0  20 73 63 72 61 70 20 74  72 61 6e 73 66 65 72 0d  | scrap transfer.|
00018ee0  0c 84 24 20 20 c8 99 20  22 58 4f 53 5f 46 69 6c  |..$  .. "XOS_Fil|
00018ef0  65 22 2c 36 2c 22 3c 57  69 6d 70 24 53 63 72 61  |e",6,"<Wimp$Scra|
00018f00  70 3e 22 0d 0c 85 31 20  20 85 20 32 35 35 2c 22  |p>"...1  . 255,"|
00018f10  44 61 74 61 20 54 72 61  6e 73 66 65 72 20 66 61  |Data Transfer fa|
00018f20  69 6c 65 64 3a 20 52 65  63 65 69 76 65 72 20 64  |iled: Receiver d|
00018f30  69 65 64 22 0d 0c 86 05  cd 0d 0c 87 05 e1 0d 0c  |ied"............|
00018f40  88 05 3a 0d 0c 89 20 2a  7c 53 74 6f 70 20 50 52  |..:... *|Stop PR|
00018f50  4f 43 73 68 65 6c 6c 5f  41 63 6b 44 61 74 61 4c  |OCshell_AckDataL|
00018f60  6f 61 64 0d 0c 8a 04 0d  0c 8b 21 2a 7c 53 74 61  |oad.......!*|Sta|
00018f70  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 41 63 6b  |rt PROCshell_Ack|
00018f80  52 41 4d 46 65 74 63 68  0d 0c 8c 1d dd 20 f2 73  |RAMFetch..... .s|
00018f90  68 65 6c 6c 5f 41 63 6b  52 41 4d 46 65 74 63 68  |hell_AckRAMFetch|
00018fa0  28 5f 51 25 29 0d 0c 8d  12 ea 20 45 78 69 73 74  |(_Q%)..... Exist|
00018fb0  25 2c 74 65 6d 70 25 0d  0c 8e 11 74 65 6d 70 25  |%,temp%....temp%|
00018fc0  3d 5f 55 25 21 31 35 36  0d 0c 8f 15 2a 7c 69 66  |=_U%!156....*|if|
00018fd0  64 65 66 20 54 72 61 63  65 49 6e 69 74 0d 0c 90  |def TraceInit...|
00018fe0  38 f2 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  |8.shell_Tracef0(|
00018ff0  22 41 63 6b 52 41 4d 46  65 74 63 68 3a 41 63 6b  |"AckRAMFetch:Ack|
00019000  52 41 4d 46 65 74 63 68  20 63 61 6c 6c 65 64 2e  |RAMFetch called.|
00019010  2e 2e 2e 22 29 0d 0c 91  0b 2a 7c 65 6e 64 69 66  |...")....*|endif|
00019020  0d 0c 92 17 e7 20 5f 51  25 21 31 32 3c 3e 5f 55  |..... _Q%!12<>_U|
00019030  25 21 31 31 32 20 8c 0d  0c 93 26 20 20 f4 20 52  |%!112 ....&  . R|
00019040  65 66 65 72 65 6e 63 65  20 68 61 73 6e 27 74 20  |eference hasn't |
00019050  62 65 65 6e 20 75 70 64  61 74 65 64 2c 0d 0c 94  |been updated,...|
00019060  2b 20 20 f4 20 74 68 65  72 65 66 6f 72 65 20 74  |+  . therefore t|
00019070  68 65 20 57 69 6d 70 20  72 65 74 75 72 6e 65 64  |he Wimp returned|
00019080  20 6d 79 20 63 61 6c 6c  0d 0c 95 13 20 20 e7 20  | my call....  . |
00019090  5f 55 25 21 31 32 38 3d  30 20 8c 0d 0c 96 32 20  |_U%!128=0 ....2 |
000190a0  20 20 20 f4 20 54 68 65  20 72 65 63 65 69 76 65  |   . The receive|
000190b0  72 20 64 69 64 6e 27 74  20 73 75 70 70 6f 72 74  |r didn't support|
000190c0  20 52 41 4d 20 74 72 61  6e 73 66 65 72 0d 0c 97  | RAM transfer...|
000190d0  15 2a 7c 69 66 64 65 66  20 54 72 61 63 65 49 6e  |.*|ifdef TraceIn|
000190e0  69 74 0d 0c 98 4a 20 20  f2 73 68 65 6c 6c 5f 54  |it...J  .shell_T|
000190f0  72 61 63 65 66 30 28 22  41 63 6b 52 41 4d 46 65  |racef0("AckRAMFe|
00019100  74 63 68 3a 52 65 63 65  69 76 65 72 20 64 6f 65  |tch:Receiver doe|
00019110  73 20 6e 6f 74 20 73 75  70 70 6f 72 74 20 52 41  |s not support RA|
00019120  4d 20 74 72 61 6e 73 66  65 72 22 29 0d 0c 99 0b  |M transfer")....|
00019130  2a 7c 65 6e 64 69 66 0d  0c 9a 3b 20 20 20 20 c8  |*|endif...;    .|
00019140  99 20 22 58 4f 53 5f 52  65 61 64 56 61 72 56 61  |. "XOS_ReadVarVa|
00019150  6c 22 2c 22 57 69 6d 70  24 53 63 72 61 70 22 2c  |l","Wimp$Scrap",|
00019160  2c 2d 31 2c 30 2c 33 20  b8 20 2c 2c 45 78 69 73  |,-1,0,3 . ,,Exis|
00019170  74 25 0d 0c 9b 15 20 20  20 20 e7 20 45 78 69 73  |t%....    . Exis|
00019180  74 25 3c 3e 30 20 8c 0d  0c 9c 29 20 20 20 20 20  |t%<>0 ....)     |
00019190  20 24 28 74 65 6d 70 25  2b 34 34 29 3d 22 3c 57  | $(temp%+44)="<W|
000191a0  69 6d 70 24 53 63 72 61  70 3e 22 2b bd 28 30 29  |imp$Scrap>"+.(0)|
000191b0  0d 0c 9d 38 20 20 20 20  20 20 74 65 6d 70 25 21  |...8      temp%!|
000191c0  30 30 3d 28 34 39 2b a9  28 a4 73 68 65 6c 6c 5f  |00=(49+.(.shell_|
000191d0  47 65 74 53 74 72 69 6e  67 28 74 65 6d 70 25 2b  |GetString(temp%+|
000191e0  34 34 29 29 29 80 ac 33  0d 0c 9e 1b 20 20 20 20  |44)))..3....    |
000191f0  20 20 74 65 6d 70 25 21  31 32 3d 74 65 6d 70 25  |  temp%!12=temp%|
00019200  21 30 38 0d 0c 9f 14 20  20 20 20 20 20 74 65 6d  |!08....      tem|
00019210  70 25 21 31 36 3d 32 0d  0c a0 15 20 20 20 20 20  |p%!16=2....     |
00019220  20 74 65 6d 70 25 21 33  36 3d 2d 31 0d 0c a1 30  | temp%!36=-1...0|
00019230  20 20 20 20 20 20 c8 99  20 22 57 69 6d 70 5f 53  |      .. "Wimp_S|
00019240  65 6e 64 4d 65 73 73 61  67 65 22 2c 31 38 2c 74  |endMessage",18,t|
00019250  65 6d 70 25 2c 74 65 6d  70 25 21 34 0d 0c a2 1a  |emp%,temp%!4....|
00019260  20 20 20 20 20 20 5f 55  25 21 31 30 38 3d 74 65  |      _U%!108=te|
00019270  6d 70 25 21 30 38 0d 0c  a3 09 20 20 20 20 cc 0d  |mp%!08....    ..|
00019280  0c a4 38 20 20 20 20 20  20 20 f2 73 68 65 6c 6c  |..8       .shell|
00019290  5f 4f 4b 28 a4 73 68 65  6c 6c 5f 4d 65 73 73 61  |_OK(.shell_Messa|
000192a0  67 65 4e 6f 41 72 67 73  28 22 53 48 45 4c 4c 4d  |geNoArgs("SHELLM|
000192b0  53 47 31 34 22 29 29 0d  0c a5 09 20 20 20 20 cd  |SG14"))....    .|
000192c0  0d 0c a6 07 20 20 cc 0d  0c a7 3b 20 20 20 20 f4  |....  ....;    .|
000192d0  20 54 68 65 20 72 65 63  65 69 76 65 72 20 68 61  | The receiver ha|
000192e0  73 20 69 6e 69 74 69 61  74 65 64 20 52 41 4d 20  |s initiated RAM |
000192f0  74 72 61 6e 73 66 65 72  2c 20 61 6e 64 20 74 68  |transfer, and th|
00019300  69 73 0d 0c a8 3f 20 20  20 20 f4 20 77 61 73 20  |is...?    . was |
00019310  73 75 63 63 65 73 73 66  75 6c 20 6f 6e 63 65 2c  |successful once,|
00019320  20 62 75 74 20 49 20 65  78 70 65 63 74 65 64 20  | but I expected |
00019330  6d 6f 72 65 20 64 61 74  61 20 74 6f 20 63 6f 6d  |more data to com|
00019340  65 0d 0c a9 15 2a 7c 69  66 64 65 66 20 54 72 61  |e....*|ifdef Tra|
00019350  63 65 49 6e 69 74 0d 0c  aa 60 20 20 f2 73 68 65  |ceInit...`  .she|
00019360  6c 6c 5f 54 72 61 63 65  66 30 28 22 41 63 6b 52  |ll_Tracef0("AckR|
00019370  41 4d 46 65 74 63 68 3a  52 41 4d 20 74 72 61 6e  |AMFetch:RAM tran|
00019380  73 66 65 72 20 73 74 61  72 74 65 64 2c 20 62 75  |sfer started, bu|
00019390  74 20 6e 6f 74 20 65 6e  6f 75 67 68 20 64 61 74  |t not enough dat|
000193a0  61 20 73 65 6e 74 2e 20  53 65 6e 64 65 72 20 64  |a sent. Sender d|
000193b0  69 65 64 3f 22 29 0d 0c  ab 0b 2a 7c 65 6e 64 69  |ied?")....*|endi|
000193c0  66 0d 0c ac 27 20 20 20  20 f2 73 68 65 6c 6c 5f  |f...'    .shell_|
000193d0  48 65 61 70 42 6c 6f 63  6b 52 65 74 75 72 6e 28  |HeapBlockReturn(|
000193e0  5f 55 25 21 31 35 32 29  0d 0c ad 11 20 20 20 20  |_U%!152)....    |
000193f0  5f 55 25 21 31 35 32 3d  30 0d 0c ae 1f 20 20 20  |_U%!152=0....   |
00019400  20 f2 73 68 65 6c 6c 5f  4f 4b 28 22 53 48 45 4c  | .shell_OK("SHEL|
00019410  4c 4d 53 47 30 36 22 29  0d 0c af 07 20 20 cd 0d  |LMSG06")....  ..|
00019420  0c b0 05 cd 0d 0c b1 05  e1 0d 0c b2 05 3a 0d 0c  |.............:..|
00019430  b3 20 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |. *|Stop PROCshe|
00019440  6c 6c 5f 41 63 6b 52 41  4d 46 65 74 63 68 0d 0c  |ll_AckRAMFetch..|
00019450  b4 04 0d 0c b5 21 2a 7c  53 74 61 72 74 20 50 52  |.....!*|Start PR|
00019460  4f 43 73 68 65 6c 6c 5f  4d 65 6e 75 57 61 72 6e  |OCshell_MenuWarn|
00019470  69 6e 67 0d 0c b6 1d dd  20 f2 73 68 65 6c 6c 5f  |ing..... .shell_|
00019480  4d 65 6e 75 57 61 72 6e  69 6e 67 28 5f 51 25 29  |MenuWarning(_Q%)|
00019490  0d 0c b7 45 ea 20 66 6e  24 2c 6d 65 6e 75 5f 62  |...E. fn$,menu_b|
000194a0  75 66 66 65 72 25 2c 78  25 2c 79 25 2c 76 6f 69  |uffer%,x%,y%,voi|
000194b0  64 25 2c 5f 74 65 6d 70  25 2c 61 25 2c 77 61 72  |d%,_temp%,a%,war|
000194c0  6e 5f 66 6e 24 2c 69 74  65 6d 5f 61 64 64 72 25  |n_fn$,item_addr%|
000194d0  2c 62 6c 6b 25 0d 0c b8  21 78 25 3d 5f 51 25 21  |,blk%...!x%=_Q%!|
000194e0  32 34 3a 79 25 3d 5f 51  25 21 32 38 3a 5f 55 25  |24:y%=_Q%!28:_U%|
000194f0  21 32 36 34 3d 30 0d 0c  b9 11 e7 20 5f 55 25 21  |!264=0..... _U%!|
00019500  32 30 3c 3e 30 20 8c 0d  0c ba 1f 2a 7c 69 66 64  |20<>0 .....*|ifd|
00019510  65 66 20 50 52 4f 43 73  68 65 6c 6c 5f 54 72 61  |ef PROCshell_Tra|
00019520  63 65 49 6e 69 74 0d 0c  bb 55 20 20 f2 73 68 65  |ceInit...U  .she|
00019530  6c 6c 5f 54 72 61 63 65  66 30 28 22 4d 65 6e 75  |ll_Tracef0("Menu|
00019540  57 61 72 6e 69 6e 67 3a  52 65 6d 6f 76 69 6e 67  |Warning:Removing|
00019550  20 6c 61 73 74 20 64 79  6e 61 6d 69 63 20 64 62  | last dynamic db|
00019560  6f 78 20 28 68 61 6e 64  6c 65 3d 26 22 2b c3 7e  |ox (handle=&"+.~|
00019570  5f 55 25 21 32 30 2b 22  29 22 29 0d 0c bc 0b 2a  |_U%!20+")")....*|
00019580  7c 65 6e 64 69 66 0d 0c  bd 27 20 20 76 6f 69 64  ||endif...'  void|
00019590  25 3d a4 73 68 65 6c 6c  5f 44 65 6c 65 74 65 57  |%=.shell_DeleteW|
000195a0  69 6e 64 6f 77 28 5f 55  25 21 32 30 29 0d 0c be  |indow(_U%!20)...|
000195b0  1f 2a 7c 69 66 64 65 66  20 50 52 4f 43 73 68 65  |.*|ifdef PROCshe|
000195c0  6c 6c 5f 54 72 61 63 65  49 6e 69 74 0d 0c bf 3d  |ll_TraceInit...=|
000195d0  20 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |  .shell_Tracef0|
000195e0  28 22 4d 65 6e 75 57 61  72 6e 69 6e 67 3a 4c 61  |("MenuWarning:La|
000195f0  73 74 20 64 79 6e 61 6d  69 63 20 64 62 6f 78 20  |st dynamic dbox |
00019600  72 65 6d 6f 76 65 64 22  29 0d 0c c0 0b 2a 7c 65  |removed")....*|e|
00019610  6e 64 69 66 0d 0c c1 05  cd 0d 0c c2 39 f4 20 43  |ndif........9. C|
00019620  68 65 63 6b 20 73 75 62  6d 65 6e 75 20 70 6f 69  |heck submenu poi|
00019630  6e 74 65 72 20 61 6e 64  20 63 72 65 61 74 65 20  |nter and create |
00019640  77 69 6e 64 6f 77 20 66  6f 75 6e 64 20 74 68 65  |window found the|
00019650  72 65 0d 0c c3 25 f4 20  54 68 65 6e 20 63 61 6c  |re...%. Then cal|
00019660  6c 20 70 72 65 20 61 6e  64 20 70 6f 73 74 20 6f  |l pre and post o|
00019670  70 65 6e 20 46 4e 73 0d  0c c4 4a f4 20 49 66 20  |pen FNs...J. If |
00019680  73 75 62 6d 65 6e 75 20  70 6f 69 6e 74 65 72 20  |submenu pointer |
00019690  69 73 20 74 68 65 20 77  61 72 6e 69 6e 67 20 77  |is the warning w|
000196a0  69 6e 64 6f 77 2c 20 6f  70 65 6e 20 69 74 20 74  |indow, open it t|
000196b0  6f 20 72 65 6d 69 6e 64  20 74 68 65 20 75 73 65  |o remind the use|
000196c0  72 0d 0c c5 39 f4 20 74  68 61 74 20 6e 6f 20 64  |r...9. that no d|
000196d0  62 6f 78 20 68 61 73 20  62 65 65 6e 20 61 74 74  |box has been att|
000196e0  61 63 68 65 64 20 74 6f  20 74 68 69 73 20 6d 65  |ached to this me|
000196f0  6e 75 20 65 6e 74 72 79  2e 2e 0d 0c c6 0f c8 8e  |nu entry........|
00019700  20 5f 51 25 21 32 30 20  ca 0d 0c c7 28 c9 20 5f  | _Q%!20 ....(. _|
00019710  55 25 21 32 32 38 3a f4  20 68 61 6e 64 6c 65 20  |U%!228:. handle |
00019720  6f 66 20 77 61 72 6e 69  6e 67 20 64 62 6f 78 2e  |of warning dbox.|
00019730  2e 0d 0c c8 44 20 20 f4  20 77 6f 6e 27 74 20 6e  |....D  . won't n|
00019740  65 65 64 20 74 6f 20 64  6f 20 74 68 69 73 20 69  |eed to do this i|
00019750  66 20 74 69 74 6c 65 2f  69 63 6f 6e 20 6d 65 73  |f title/icon mes|
00019760  73 61 67 65 73 20 61 72  65 20 73 75 62 73 74 69  |sages are substi|
00019770  74 75 74 65 64 0d 0c c9  22 20 20 f4 20 77 68 65  |tuted..."  . whe|
00019780  6e 20 6c 6f 61 64 69 6e  67 20 74 68 65 20 74 65  |n loading the te|
00019790  6d 70 6c 61 74 65 73 0d  0c ca 43 20 20 f2 73 68  |mplates...C  .sh|
000197a0  65 6c 6c 5f 57 69 6e 64  6f 77 52 65 74 69 74 6c  |ell_WindowRetitl|
000197b0  65 28 5f 55 25 21 32 32  38 2c a4 73 68 65 6c 6c  |e(_U%!228,.shell|
000197c0  5f 4d 65 73 73 61 67 65  4e 6f 41 72 67 73 28 22  |_MessageNoArgs("|
000197d0  77 61 72 6e 69 6e 67 22  29 29 0d 0c cb 32 20 20  |warning"))...2  |
000197e0  f4 20 73 74 69 6c 6c 20  6e 65 65 64 20 74 6f 20  |. still need to |
000197f0  73 65 74 20 75 70 20 74  68 65 20 6d 65 73 73 61  |set up the messa|
00019800  67 65 20 74 68 6f 75 67  68 2e 2e 2e 0d 0c cc 48  |ge though......H|
00019810  20 20 f2 73 68 65 6c 6c  5f 49 63 6f 6e 50 75 74  |  .shell_IconPut|
00019820  44 61 74 61 28 5f 55 25  21 32 32 38 2c 31 2c a4  |Data(_U%!228,1,.|
00019830  73 68 65 6c 6c 5f 4d 65  73 73 61 67 65 4e 6f 41  |shell_MessageNoA|
00019840  72 67 73 28 22 53 48 45  4c 4c 4d 53 47 30 37 22  |rgs("SHELLMSG07"|
00019850  29 2c 30 29 0d 0c cd 2c  20 20 c8 99 20 22 57 69  |),0)...,  .. "Wi|
00019860  6d 70 5f 43 72 65 61 74  65 53 75 62 4d 65 6e 75  |mp_CreateSubMenu|
00019870  22 2c 2c 5f 55 25 21 32  32 38 2c 78 25 2c 79 25  |",,_U%!228,x%,y%|
00019880  0d 0c ce 05 7f 0d 0c cf  34 20 20 f4 20 53 75 62  |........4  . Sub|
00019890  20 6d 65 6e 75 20 69 73  20 65 69 74 68 65 72 20  | menu is either |
000198a0  61 20 64 69 61 6c 6f 67  20 62 6f 78 2c 20 6f 72  |a dialog box, or|
000198b0  20 61 20 6d 65 6e 75 21  21 0d 0c d0 39 20 20 69  | a menu!!...9  i|
000198c0  74 65 6d 5f 61 64 64 72  25 3d a4 73 68 65 6c 6c  |tem_addr%=.shell|
000198d0  5f 4d 65 6e 75 47 65 74  49 74 65 6d 41 64 64 72  |_MenuGetItemAddr|
000198e0  65 73 73 28 5f 55 25 21  32 34 2c 5f 51 25 2b 33  |ess(_U%!24,_Q%+3|
000198f0  32 29 0d 0c d1 2e 20 20  e7 20 a4 73 68 65 6c 6c  |2)....  . .shell|
00019900  5f 48 65 61 70 42 6c 6f  63 6b 45 78 69 73 74 73  |_HeapBlockExists|
00019910  28 69 74 65 6d 5f 61 64  64 72 25 21 34 29 20 8c  |(item_addr%!4) .|
00019920  0d 0c d2 1c 20 20 20 20  f4 20 44 42 6f 78 20 69  |....    . DBox i|
00019930  73 20 61 74 74 61 63 68  65 64 2e 2e 0d 0c d3 2d  |s attached.....-|
00019940  20 20 20 20 f2 73 68 65  6c 6c 5f 4d 65 6e 75 57  |    .shell_MenuW|
00019950  61 72 6e 44 42 6f 78 28  69 74 65 6d 5f 61 64 64  |arnDBox(item_add|
00019960  72 25 2c 78 25 2c 79 25  29 0d 0c d4 07 20 20 cc  |r%,x%,y%)....  .|
00019970  0d 0c d5 1c 20 20 20 20  f4 20 53 75 62 6d 65 6e  |....    . Submen|
00019980  75 20 61 74 74 61 63 68  65 64 2e 2e 0d 0c d6 26  |u attached.....&|
00019990  20 20 20 20 62 6c 6b 25  3d a4 73 68 65 6c 6c 5f  |    blk%=.shell_|
000199a0  48 65 61 70 42 6c 6f 63  6b 46 65 74 63 68 28 33  |HeapBlockFetch(3|
000199b0  32 29 0d 0c d7 33 20 20  20 20 c8 99 20 22 4d 65  |2)...3    .. "Me|
000199c0  6e 75 55 74 69 6c 5f 44  65 63 6f 64 65 22 2c 5f  |nuUtil_Decode",_|
000199d0  55 25 21 32 34 2c 5f 51  25 2b 33 32 20 b8 20 2c  |U%!24,_Q%+32 . ,|
000199e0  2c 62 6c 6b 25 0d 0c d8  39 20 20 20 20 f2 73 68  |,blk%...9    .sh|
000199f0  65 6c 6c 5f 46 69 6e 64  4d 65 6e 75 57 61 72 6e  |ell_FindMenuWarn|
00019a00  45 76 65 6e 74 28 62 6c  6b 25 21 38 2c 77 61 72  |Event(blk%!8,war|
00019a10  6e 5f 66 6e 24 2c 73 65  6c 5f 66 6e 24 29 0d 0c  |n_fn$,sel_fn$)..|
00019a20  d9 24 20 20 20 20 f2 73  68 65 6c 6c 5f 48 65 61  |.$    .shell_Hea|
00019a30  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 62 6c 6b  |pBlockReturn(blk|
00019a40  25 29 0d 0c da 3d 20 20  20 20 f2 73 68 65 6c 6c  |%)...=    .shell|
00019a50  5f 4d 65 6e 75 57 61 72  6e 53 75 62 4d 65 6e 75  |_MenuWarnSubMenu|
00019a60  28 5f 51 25 21 32 30 2c  78 25 2c 79 25 2c 77 61  |(_Q%!20,x%,y%,wa|
00019a70  72 6e 5f 66 6e 24 2c 73  65 6c 5f 66 6e 24 29 0d  |rn_fn$,sel_fn$).|
00019a80  0c db 07 20 20 cd 0d 0c  dc 05 cb 0d 0c dd 05 e1  |...  ...........|
00019a90  0d 0c de 05 3a 0d 0c df  20 2a 7c 53 74 6f 70 20  |....:... *|Stop |
00019aa0  50 52 4f 43 73 68 65 6c  6c 5f 4d 65 6e 75 57 61  |PROCshell_MenuWa|
00019ab0  72 6e 69 6e 67 0d 0c e0  04 0d 0c e1 22 2a 7c 53  |rning......."*|S|
00019ac0  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 4d  |tart PROCshell_M|
00019ad0  65 6e 75 57 61 72 6e 44  42 6f 78 0d 0c e2 26 dd  |enuWarnDBox...&.|
00019ae0  20 f2 73 68 65 6c 6c 5f  4d 65 6e 75 57 61 72 6e  | .shell_MenuWarn|
00019af0  44 42 6f 78 28 61 64 64  72 25 2c 78 25 2c 79 25  |DBox(addr%,x%,y%|
00019b00  29 0d 0c e3 14 ea 20 74  65 6d 70 25 2c 68 25 2c  |)..... temp%,h%,|
00019b10  76 6f 69 64 25 0d 0c e4  07 ea 20 85 0d 0c e5 0f  |void%..... .....|
00019b20  ee 20 85 20 ea 3a f7 20  85 3a e1 0d 0c e6 11 74  |. . .:. .:.....t|
00019b30  65 6d 70 25 3d 61 64 64  72 25 21 34 0d 0c e7 24  |emp%=addr%!4...$|
00019b40  f2 73 68 65 6c 6c 5f 43  72 65 61 74 65 57 69 6e  |.shell_CreateWin|
00019b50  64 6f 77 28 24 74 65 6d  70 25 21 30 2c 68 25 29  |dow($temp%!0,h%)|
00019b60  0d 0c e8 07 f7 20 85 0d  0c e9 15 2a 7c 69 66 64  |..... .....*|ifd|
00019b70  65 66 20 54 72 61 63 65  49 6e 69 74 0d 0c ea 4f  |ef TraceInit...O|
00019b80  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
00019b90  4d 65 6e 75 57 61 72 6e  44 42 6f 78 3a 43 72 65  |MenuWarnDBox:Cre|
00019ba0  61 74 69 6e 67 20 6e 65  77 20 64 79 6e 61 6d 69  |ating new dynami|
00019bb0  63 20 64 62 6f 78 20 28  68 61 6e 64 6c 65 3d 26  |c dbox (handle=&|
00019bc0  22 2b c3 7e 68 25 2b 22  29 22 29 0d 0c eb 0b 2a  |"+.~h%+")")....*|
00019bd0  7c 65 6e 64 69 66 0d 0c  ec 14 e7 20 24 74 65 6d  ||endif..... $tem|
00019be0  70 25 21 34 3c 3e 22 22  20 8c 0d 0c ed 15 2a 7c  |p%!4<>"" .....*||
00019bf0  69 66 64 65 66 20 54 72  61 63 65 49 6e 69 74 0d  |ifdef TraceInit.|
00019c00  0c ee 46 20 20 f2 73 68  65 6c 6c 5f 54 72 61 63  |..F  .shell_Trac|
00019c10  65 66 30 28 22 4d 65 6e  75 57 61 72 6e 44 42 6f  |ef0("MenuWarnDBo|
00019c20  78 3a 43 61 6c 6c 69 6e  67 20 70 72 65 6f 70 65  |x:Calling preope|
00019c30  6e 20 46 4e 20 27 22 2b  24 74 65 6d 70 25 21 34  |n FN '"+$temp%!4|
00019c40  2b 22 27 22 29 0d 0c ef  0b 2a 7c 65 6e 64 69 66  |+"'")....*|endif|
00019c50  0d 0c f0 28 20 20 76 6f  69 64 25 3d a0 28 22 46  |...(  void%=.("F|
00019c60  4e 22 2b 24 74 65 6d 70  25 21 34 2b 22 28 22 2b  |N"+$temp%!4+"("+|
00019c70  c3 68 25 2b 22 29 22 29  0d 0c f1 05 cd 0d 0c f2  |.h%+")")........|
00019c80  14 e7 20 24 74 65 6d 70  25 21 38 3c 3e 22 22 20  |.. $temp%!8<>"" |
00019c90  8c 0d 0c f3 15 2a 7c 69  66 64 65 66 20 54 72 61  |.....*|ifdef Tra|
00019ca0  63 65 49 6e 69 74 0d 0c  f4 47 20 20 f2 73 68 65  |ceInit...G  .she|
00019cb0  6c 6c 5f 54 72 61 63 65  66 30 28 22 4d 65 6e 75  |ll_Tracef0("Menu|
00019cc0  57 61 72 6e 44 42 6f 78  3a 43 61 6c 6c 69 6e 67  |WarnDBox:Calling|
00019cd0  20 70 6f 73 74 6f 70 65  6e 20 46 4e 20 27 22 2b  | postopen FN '"+|
00019ce0  24 74 65 6d 70 25 21 38  2b 22 27 22 29 0d 0c f5  |$temp%!8+"'")...|
00019cf0  0b 2a 7c 65 6e 64 69 66  0d 0c f6 28 20 20 76 6f  |.*|endif...(  vo|
00019d00  69 64 25 3d a0 28 22 46  4e 22 2b 24 74 65 6d 70  |id%=.("FN"+$temp|
00019d10  25 21 38 2b 22 28 22 2b  c3 68 25 2b 22 29 22 29  |%!8+"("+.h%+")")|
00019d20  0d 0c f7 05 cd 0d 0c f8  21 f4 20 68 25 20 69 73  |........!. h% is|
00019d30  20 6e 65 77 20 77 69 6e  64 6f 77 20 68 61 6e 64  | new window hand|
00019d40  6c 65 2e 2e 2e 2e 0d 0c  f9 25 c8 99 20 22 57 69  |le.......%.. "Wi|
00019d50  6d 70 5f 43 72 65 61 74  65 53 75 62 4d 65 6e 75  |mp_CreateSubMenu|
00019d60  22 2c 2c 68 25 2c 78 25  2c 79 25 0d 0c fa 0d 5f  |",,h%,x%,y%...._|
00019d70  55 25 21 32 30 3d 68 25  0d 0c fb 05 e1 0d 0c fc  |U%!20=h%........|
00019d80  05 3a 0d 0c fd 21 2a 7c  53 74 6f 70 20 50 52 4f  |.:...!*|Stop PRO|
00019d90  43 73 68 65 6c 6c 5f 4d  65 6e 75 57 61 72 6e 44  |Cshell_MenuWarnD|
00019da0  42 6f 78 0d 0c fe 04 0d  0c ff 27 2a 7c 53 74 61  |Box.......'*|Sta|
00019db0  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 46 69 6e  |rt PROCshell_Fin|
00019dc0  64 4d 65 6e 75 57 61 72  6e 45 76 65 6e 74 0d 0d  |dMenuWarnEvent..|
00019dd0  00 41 dd 20 f2 73 68 65  6c 6c 5f 46 69 6e 64 4d  |.A. .shell_FindM|
00019de0  65 6e 75 57 61 72 6e 45  76 65 6e 74 28 69 74 65  |enuWarnEvent(ite|
00019df0  6d 5f 68 61 6e 64 6c 65  25 2c f8 20 77 61 72 6e  |m_handle%,. warn|
00019e00  5f 66 6e 24 2c f8 20 73  65 6c 5f 66 6e 24 29 0d  |_fn$,. sel_fn$).|
00019e10  0d 01 41 ea 20 72 65 73  75 6c 74 25 2c 65 5f 6c  |..A. result%,e_l|
00019e20  69 73 74 25 2c 74 65 6d  70 25 2c 6f 66 66 73 65  |ist%,temp%,offse|
00019e30  74 25 2c 66 6f 75 6e 64  25 2c 6c 69 73 74 5f 73  |t%,found%,list_s|
00019e40  69 7a 65 25 2c 74 65 6d  70 32 25 2c 63 74 72 25  |ize%,temp2%,ctr%|
00019e50  0d 0d 02 0e ea 20 73 75  62 6d 65 6e 75 25 0d 0d  |..... submenu%..|
00019e60  03 3b 73 75 62 6d 65 6e  75 25 3d 30 3a f4 20 49  |.;submenu%=0:. I|
00019e70  66 20 73 74 69 6c 6c 20  30 20 6f 6e 20 72 65 74  |f still 0 on ret|
00019e80  75 72 6e 20 74 68 65 6e  20 6e 6f 20 65 76 65 6e  |urn then no even|
00019e90  74 20 66 6f 75 6e 64 2e  2e 0d 0d 04 3d 65 5f 6c  |t found.....=e_l|
00019ea0  69 73 74 25 3d 5f 55 25  21 32 32 30 3a 6f 66 66  |ist%=_U%!220:off|
00019eb0  73 65 74 25 3d 30 3a 66  6f 75 6e 64 25 3d a3 3a  |set%=0:found%=.:|
00019ec0  77 61 72 6e 5f 66 6e 24  3d 22 22 3a 73 75 62 6d  |warn_fn$="":subm|
00019ed0  65 6e 75 25 3d 30 0d 0d  05 27 e7 20 a4 73 68 65  |enu%=0...'. .she|
00019ee0  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 45 78 69 73  |ll_HeapBlockExis|
00019ef0  74 73 28 65 5f 6c 69 73  74 25 29 20 8c 0d 0d 06  |ts(e_list%) ....|
00019f00  07 20 20 f5 0d 0d 07 0f  20 20 20 20 63 74 72 25  |.  .....    ctr%|
00019f10  2b 3d 34 0d 0d 08 17 20  20 fd 20 65 5f 6c 69 73  |+=4....  . e_lis|
00019f20  74 25 21 63 74 72 25 3d  2d 31 0d 0d 09 1c 20 20  |t%!ctr%=-1....  |
00019f30  6c 69 73 74 5f 73 69 7a  65 25 3d 63 74 72 25 3a  |list_size%=ctr%:|
00019f40  63 74 72 25 3d 30 0d 0d  0a 1f 2a 7c 69 66 64 65  |ctr%=0....*|ifde|
00019f50  66 20 50 52 4f 43 73 68  65 6c 6c 5f 54 72 61 63  |f PROCshell_Trac|
00019f60  65 49 6e 69 74 0d 0d 0b  41 20 20 f2 73 68 65 6c  |eInit...A  .shel|
00019f70  6c 5f 54 72 61 63 65 66  30 28 22 46 69 6e 64 4d  |l_Tracef0("FindM|
00019f80  65 6e 75 57 61 72 6e 45  76 65 6e 74 3a 6c 69 73  |enuWarnEvent:lis|
00019f90  74 5f 73 69 7a 65 25 3d  22 2b c3 6c 69 73 74 5f  |t_size%="+.list_|
00019fa0  73 69 7a 65 25 29 0d 0d  0c 0b 2a 7c 65 6e 64 69  |size%)....*|endi|
00019fb0  66 0d 0d 0d 07 20 20 f5  0d 0d 0e 22 20 20 20 20  |f....  ...."    |
00019fc0  74 65 6d 70 25 3d 21 28  65 5f 6c 69 73 74 25 2b  |temp%=!(e_list%+|
00019fd0  6f 66 66 73 65 74 25 2b  30 29 0d 0d 0f 15 20 20  |offset%+0)....  |
00019fe0  20 20 e7 20 74 65 6d 70  25 3c 3e 2d 31 20 8c 0d  |  . temp%<>-1 ..|
00019ff0  0d 10 20 20 20 20 20 20  20 e7 20 74 65 6d 70 25  |..       . temp%|
0001a000  3d 69 74 65 6d 5f 68 61  6e 64 6c 65 25 20 8c 0d  |=item_handle% ..|
0001a010  0d 11 14 20 20 20 20 20  20 20 20 66 6f 75 6e 64  |...        found|
0001a020  25 3d b9 0d 0d 12 37 20  20 20 20 20 20 20 20 74  |%=....7        t|
0001a030  65 6d 70 32 25 3d 65 5f  6c 69 73 74 25 21 28 6f  |emp2%=e_list%!(o|
0001a040  66 66 73 65 74 25 2b 34  29 3a 77 61 72 6e 5f 66  |ffset%+4):warn_f|
0001a050  6e 24 3d 24 74 65 6d 70  32 25 0d 0d 13 28 20 20  |n$=$temp2%...(  |
0001a060  20 20 20 20 20 20 73 75  62 6d 65 6e 75 25 3d 65  |      submenu%=e|
0001a070  5f 6c 69 73 74 25 21 28  6f 66 66 73 65 74 25 2b  |_list%!(offset%+|
0001a080  38 29 0d 0d 14 37 20 20  20 20 20 20 20 20 74 65  |8)...7        te|
0001a090  6d 70 32 25 3d 65 5f 6c  69 73 74 25 21 28 6f 66  |mp2%=e_list%!(of|
0001a0a0  66 73 65 74 25 2b 31 32  29 3a 73 65 6c 5f 66 6e  |fset%+12):sel_fn|
0001a0b0  24 3d 24 74 65 6d 70 32  25 0d 0d 15 1f 2a 7c 69  |$=$temp2%....*|i|
0001a0c0  66 64 65 66 20 50 52 4f  43 73 68 65 6c 6c 5f 54  |fdef PROCshell_T|
0001a0d0  72 61 63 65 49 6e 69 74  0d 0d 16 37 20 20 f2 73  |raceInit...7  .s|
0001a0e0  68 65 6c 6c 5f 54 72 61  63 65 66 30 28 22 46 69  |hell_Tracef0("Fi|
0001a0f0  6e 64 4d 65 6e 75 57 61  72 6e 45 76 65 6e 74 3a  |ndMenuWarnEvent:|
0001a100  73 75 62 6d 65 6e 75 20  66 6f 75 6e 64 22 29 0d  |submenu found").|
0001a110  0d 17 0b 2a 7c 65 6e 64  69 66 0d 0d 18 0b 20 20  |...*|endif....  |
0001a120  20 20 20 20 cd 0d 0d 19  15 20 20 20 20 20 20 6f  |    .....      o|
0001a130  66 66 73 65 74 25 2b 3d  31 36 0d 0d 1a 09 20 20  |ffset%+=16....  |
0001a140  20 20 cc 0d 0d 1b 1c 20  20 20 20 20 20 6f 66 66  |  .....      off|
0001a150  73 65 74 25 3d 6c 69 73  74 5f 73 69 7a 65 25 0d  |set%=list_size%.|
0001a160  0d 1c 09 20 20 20 20 cd  0d 0d 1d 24 20 20 fd 20  |...    ....$  . |
0001a170  66 6f 75 6e 64 25 20 84  20 6f 66 66 73 65 74 25  |found% . offset%|
0001a180  3e 3d 6c 69 73 74 5f 73  69 7a 65 25 0d 0d 1e 05  |>=list_size%....|
0001a190  cc 0d 0d 1f 1c 20 20 77  61 72 6e 5f 66 6e 24 3d  |.....  warn_fn$=|
0001a1a0  22 22 3a 73 65 6c 5f 66  6e 24 3d 22 22 0d 0d 20  |"":sel_fn$="".. |
0001a1b0  05 cd 0d 0d 21 1f 2a 7c  69 66 64 65 66 20 50 52  |....!.*|ifdef PR|
0001a1c0  4f 43 73 68 65 6c 6c 5f  54 72 61 63 65 49 6e 69  |OCshell_TraceIni|
0001a1d0  74 0d 0d 22 4a e7 20 73  75 62 6d 65 6e 75 25 3d  |t.."J. submenu%=|
0001a1e0  30 20 8c 20 f2 73 68 65  6c 6c 5f 54 72 61 63 65  |0 . .shell_Trace|
0001a1f0  66 30 28 22 46 69 6e 64  4d 65 6e 75 57 61 72 6e  |f0("FindMenuWarn|
0001a200  45 76 65 6e 74 3a 77 61  72 6e 20 66 6e 20 6e 6f  |Event:warn fn no|
0001a210  74 20 66 6f 75 6e 64 2e  2e 22 29 0d 0d 23 0b 2a  |t found..")..#.*|
0001a220  7c 65 6e 64 69 66 0d 0d  24 05 e1 0d 0d 25 05 3a  ||endif..$....%.:|
0001a230  0d 0d 26 26 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |..&&*|Stop PROCs|
0001a240  68 65 6c 6c 5f 46 69 6e  64 4d 65 6e 75 57 61 72  |hell_FindMenuWar|
0001a250  6e 45 76 65 6e 74 0d 0d  27 04 0d 0d 28 25 2a 7c  |nEvent..'...(%*||
0001a260  53 74 61 72 74 20 50 52  4f 43 73 68 65 6c 6c 5f  |Start PROCshell_|
0001a270  4d 65 6e 75 57 61 72 6e  53 75 62 4d 65 6e 75 0d  |MenuWarnSubMenu.|
0001a280  0d 29 3c dd 20 f2 73 68  65 6c 6c 5f 4d 65 6e 75  |.)<. .shell_Menu|
0001a290  57 61 72 6e 53 75 62 4d  65 6e 75 28 73 5f 6d 65  |WarnSubMenu(s_me|
0001a2a0  6e 75 25 2c 78 25 2c 79  25 2c 77 61 72 6e 5f 66  |nu%,x%,y%,warn_f|
0001a2b0  6e 24 2c 73 65 6c 5f 66  6e 24 29 0d 0d 2a 1e ea  |n$,sel_fn$)..*..|
0001a2c0  20 76 6f 69 64 25 2c 74  65 6d 70 25 2c 66 5f 6d  | void%,temp%,f_m|
0001a2d0  65 6e 75 25 2c 63 74 72  25 0d 0d 2b 21 5f 73 68  |enu%,ctr%..+!_sh|
0001a2e0  65 6c 6c 5f 46 6f 6e 74  4d 65 6e 75 53 65 6c 46  |ell_FontMenuSelF|
0001a2f0  4e 24 3d 73 65 6c 5f 66  6e 24 0d 0d 2c 47 e7 20  |N$=sel_fn$..,G. |
0001a300  a4 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
0001a310  45 78 69 73 74 73 28 5f  55 25 21 32 32 34 29 20  |Exists(_U%!224) |
0001a320  8c 20 f2 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |. .shell_HeapBlo|
0001a330  63 6b 52 65 74 75 72 6e  28 5f 55 25 21 32 32 34  |ckReturn(_U%!224|
0001a340  29 0d 0d 2d 2e 5f 55 25  21 32 32 34 3d a4 73 68  |)..-._U%!224=.sh|
0001a350  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
0001a360  63 68 28 a9 77 61 72 6e  5f 66 6e 24 2b 31 29 0d  |ch(.warn_fn$+1).|
0001a370  0d 2e 21 74 65 6d 70 25  3d 5f 55 25 21 32 32 34  |..!temp%=_U%!224|
0001a380  3a 24 74 65 6d 70 25 3d  77 61 72 6e 5f 66 6e 24  |:$temp%=warn_fn$|
0001a390  0d 0d 2f 14 e7 20 77 61  72 6e 5f 66 6e 24 3c 3e  |../.. warn_fn$<>|
0001a3a0  22 22 20 8c 0d 0d 30 2e  20 20 76 6f 69 64 25 3d  |"" ...0.  void%=|
0001a3b0  a0 28 22 46 4e 22 2b 77  61 72 6e 5f 66 6e 24 2b  |.("FN"+warn_fn$+|
0001a3c0  22 28 5f 55 25 21 35 32  2c 5f 55 25 21 35 36 29  |"(_U%!52,_U%!56)|
0001a3d0  22 29 0d 0d 31 1f 2a 7c  69 66 64 65 66 20 50 52  |")..1.*|ifdef PR|
0001a3e0  4f 43 73 68 65 6c 6c 5f  54 72 61 63 65 49 6e 69  |OCshell_TraceIni|
0001a3f0  74 0d 0d 32 3b 20 20 f2  73 68 65 6c 6c 5f 54 72  |t..2;  .shell_Tr|
0001a400  61 63 65 66 30 28 22 4d  65 6e 75 57 61 72 6e 53  |acef0("MenuWarnS|
0001a410  75 62 4d 65 6e 75 3a 43  61 6c 6c 69 6e 67 20 46  |ubMenu:Calling F|
0001a420  4e 22 2b 77 61 72 6e 5f  66 6e 24 29 0d 0d 33 0b  |N"+warn_fn$)..3.|
0001a430  2a 7c 65 6e 64 69 66 0d  0d 34 05 cd 0d 0d 35 1a  |*|endif..4....5.|
0001a440  2a 7c 69 66 64 65 66 20  55 73 69 6e 67 5f 46 6f  |*|ifdef Using_Fo|
0001a450  6e 74 4d 65 6e 75 0d 0d  36 17 e7 20 73 5f 6d 65  |ntMenu..6.. s_me|
0001a460  6e 75 25 3d 5f 55 25 21  32 35 32 20 8c 0d 0d 37  |nu%=_U%!252 ...7|
0001a470  22 20 20 f4 20 53 75 62  6d 65 6e 75 20 69 73 20  |"  . Submenu is |
0001a480  46 6f 6e 74 4d 65 6e 75  20 6d 65 6e 75 2e 2e 0d  |FontMenu menu...|
0001a490  0d 38 1f 2a 7c 69 66 64  65 66 20 50 52 4f 43 73  |.8.*|ifdef PROCs|
0001a4a0  68 65 6c 6c 5f 54 72 61  63 65 49 6e 69 74 0d 0d  |hell_TraceInit..|
0001a4b0  39 3a 20 20 f2 73 68 65  6c 6c 5f 54 72 61 63 65  |9:  .shell_Trace|
0001a4c0  66 30 28 22 4d 65 6e 75  57 61 72 6e 53 75 62 4d  |f0("MenuWarnSubM|
0001a4d0  65 6e 75 3a 46 6f 6e 74  4d 65 6e 75 20 6f 70 65  |enu:FontMenu ope|
0001a4e0  6e 69 6e 67 2e 2e 22 29  0d 0d 3a 0b 2a 7c 65 6e  |ning..")..:.*|en|
0001a4f0  64 69 66 0d 0d 3b 49 20  20 e7 20 a4 73 68 65 6c  |dif..;I  . .shel|
0001a500  6c 5f 48 65 61 70 42 6c  6f 63 6b 45 78 69 73 74  |l_HeapBlockExist|
0001a510  73 28 5f 55 25 21 32 35  36 29 20 8c 20 f2 73 68  |s(_U%!256) . .sh|
0001a520  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 52 65 74  |ell_HeapBlockRet|
0001a530  75 72 6e 28 5f 55 25 21  32 35 36 29 0d 0d 3c 38  |urn(_U%!256)..<8|
0001a540  20 20 f4 20 53 74 6f 72  65 20 63 75 72 72 65 6e  |  . Store curren|
0001a550  74 20 6d 65 6e 75 20 73  65 6c 65 63 74 69 6f 6e  |t menu selection|
0001a560  20 66 6f 72 20 74 65 73  74 69 6e 67 20 6c 61 74  | for testing lat|
0001a570  65 72 2e 2e 0d 0d 3d 3d  20 20 f4 20 46 69 72 73  |er....==  . Firs|
0001a580  74 20 77 6f 72 6b 20 6f  75 74 20 68 6f 77 20 6d  |t work out how m|
0001a590  61 6e 79 20 6c 65 76 65  6c 73 20 61 72 65 20 69  |any levels are i|
0001a5a0  6e 20 74 68 65 20 73 65  6c 65 63 74 69 6f 6e 2e  |n the selection.|
0001a5b0  2e 0d 0d 3e 32 20 20 63  74 72 25 3d 30 3a f5 3a  |...>2  ctr%=0:.:|
0001a5c0  63 74 72 25 2b 3d 34 3a  fd 20 21 28 5f 51 25 2b  |ctr%+=4:. !(_Q%+|
0001a5d0  33 32 2b 63 74 72 25 29  3d 2d 31 3a 63 74 72 25  |32+ctr%)=-1:ctr%|
0001a5e0  2b 3d 34 0d 0d 3f 37 20  20 5f 55 25 21 32 35 36  |+=4..?7  _U%!256|
0001a5f0  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
0001a600  6b 46 65 74 63 68 28 63  74 72 25 29 3a 74 65 6d  |kFetch(ctr%):tem|
0001a610  70 25 3d 5f 55 25 21 32  35 36 0d 0d 40 0c 20 20  |p%=_U%!256..@.  |
0001a620  63 74 72 25 3d 30 0d 0d  41 07 20 20 f5 0d 0d 42  |ctr%=0..A.  ...B|
0001a630  21 20 20 20 20 74 65 6d  70 25 21 63 74 72 25 3d  |!    temp%!ctr%=|
0001a640  21 28 5f 51 25 2b 33 32  2b 63 74 72 25 29 0d 0d  |!(_Q%+32+ctr%)..|
0001a650  43 0f 20 20 20 20 63 74  72 25 2b 3d 34 0d 0d 44  |C.    ctr%+=4..D|
0001a660  19 20 20 fd 20 21 28 5f  51 25 2b 33 32 2b 63 74  |.  . !(_Q%+32+ct|
0001a670  72 25 29 3d 2d 31 0d 0d  45 1f 20 20 74 65 6d 70  |r%)=-1..E.  temp|
0001a680  25 21 63 74 72 25 3d 21  28 5f 51 25 2b 33 32 2b  |%!ctr%=!(_Q%+32+|
0001a690  63 74 72 25 29 0d 0d 46  13 20 20 74 65 6d 70 25  |ctr%)..F.  temp%|
0001a6a0  3d 5f 55 25 21 32 35 36  0d 0d 47 1f 2a 7c 69 66  |=_U%!256..G.*|if|
0001a6b0  64 65 66 20 50 52 4f 43  73 68 65 6c 6c 5f 54 72  |def PROCshell_Tr|
0001a6c0  61 63 65 49 6e 69 74 0d  0d 48 68 20 20 f2 73 68  |aceInit..Hh  .sh|
0001a6d0  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 4d 65 6e  |ell_Tracef0("Men|
0001a6e0  75 57 61 72 6e 53 75 62  4d 65 6e 75 3a 53 65 6c  |uWarnSubMenu:Sel|
0001a6f0  65 63 74 69 6e 67 20 27  22 2b a4 73 68 65 6c 6c  |ecting '"+.shell|
0001a700  5f 46 6f 6e 74 4d 65 6e  75 47 65 74 4c 61 73 74  |_FontMenuGetLast|
0001a710  53 65 6c 65 63 74 65 64  46 6f 6e 74 2b 22 27 20  |SelectedFont+"' |
0001a720  69 6e 20 46 6f 6e 74 4d  65 6e 75 2e 2e 22 29 0d  |in FontMenu..").|
0001a730  0d 49 0b 2a 7c 65 6e 64  69 66 0d 0d 4a 50 20 20  |.I.*|endif..JP  |
0001a740  c8 99 20 22 46 6f 6e 74  4d 65 6e 75 5f 53 65 6c  |.. "FontMenu_Sel|
0001a750  65 63 74 22 2c a4 73 68  65 6c 6c 5f 46 6f 6e 74  |ect",.shell_Font|
0001a760  4d 65 6e 75 47 65 74 4c  61 73 74 53 65 6c 65 63  |MenuGetLastSelec|
0001a770  74 65 64 46 6f 6e 74 2c  5f 55 25 21 32 36 30 20  |tedFont,_U%!260 |
0001a780  b8 20 2c 66 5f 6d 65 6e  75 25 0d 0d 4b 2b 20 20  |. ,f_menu%..K+  |
0001a790  5f 55 25 21 32 36 34 3d  31 3a f4 20 53 65 74 20  |_U%!264=1:. Set |
0001a7a0  27 46 6f 6e 74 4d 65 6e  75 4f 70 65 6e 27 20 66  |'FontMenuOpen' f|
0001a7b0  6c 61 67 2e 2e 0d 0d 4c  1a 20 20 e7 20 66 5f 6d  |lag....L.  . f_m|
0001a7c0  65 6e 75 25 3c 3e 5f 55  25 21 32 35 32 20 8c 0d  |enu%<>_U%!252 ..|
0001a7d0  0d 4d 24 20 20 20 20 f4  20 46 6f 6e 74 4d 65 6e  |.M$    . FontMen|
0001a7e0  75 20 70 74 72 20 68 61  73 20 63 68 61 6e 67 65  |u ptr has change|
0001a7f0  64 2e 2e 0d 0d 4e 29 20  20 20 20 f2 73 68 65 6c  |d....N)    .shel|
0001a800  6c 5f 46 6f 6e 74 4d 65  6e 75 55 70 64 61 74 65  |l_FontMenuUpdate|
0001a810  50 74 72 28 66 5f 6d 65  6e 75 25 29 0d 0d 4f 27  |Ptr(f_menu%)..O'|
0001a820  20 20 20 20 5f 55 25 21  32 35 32 3d 66 5f 6d 65  |    _U%!252=f_me|
0001a830  6e 75 25 3a 73 5f 6d 65  6e 75 25 3d 66 5f 6d 65  |nu%:s_menu%=f_me|
0001a840  6e 75 25 0d 0d 50 07 20  20 cd 0d 0d 51 05 cc 0d  |nu%..P.  ...Q...|
0001a850  0d 52 2d 20 20 5f 55 25  21 32 36 34 3d 30 3a f4  |.R-  _U%!264=0:.|
0001a860  20 43 6c 65 61 72 20 27  46 6f 6e 74 4d 65 6e 75  | Clear 'FontMenu|
0001a870  4f 70 65 6e 27 20 66 6c  61 67 2e 2e 0d 0d 53 05  |Open' flag....S.|
0001a880  cd 0d 0d 54 0b 2a 7c 65  6e 64 69 66 0d 0d 55 2a  |...T.*|endif..U*|
0001a890  c8 99 20 22 57 69 6d 70  5f 43 72 65 61 74 65 53  |.. "Wimp_CreateS|
0001a8a0  75 62 4d 65 6e 75 22 2c  2c 73 5f 6d 65 6e 75 25  |ubMenu",,s_menu%|
0001a8b0  2c 78 25 2c 79 25 0d 0d  56 05 e1 0d 0d 57 05 3a  |,x%,y%..V....W.:|
0001a8c0  0d 0d 58 24 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |..X$*|Stop PROCs|
0001a8d0  68 65 6c 6c 5f 4d 65 6e  75 57 61 72 6e 53 75 62  |hell_MenuWarnSub|
0001a8e0  4d 65 6e 75 0d 0d 59 04  0d 0d 5a 23 2a 7c 53 74  |Menu..Y...Z#*|St|
0001a8f0  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 41 74  |art PROCshell_At|
0001a900  74 61 63 68 53 75 62 4d  65 6e 75 0d 0d 5b 33 dd  |tachSubMenu..[3.|
0001a910  20 f2 73 68 65 6c 6c 5f  41 74 74 61 63 68 53 75  | .shell_AttachSu|
0001a920  62 4d 65 6e 75 28 69 74  65 6d 25 2c 73 75 62 6d  |bMenu(item%,subm|
0001a930  65 6e 75 25 2c 77 61 72  6e 5f 66 6e 24 29 0d 0d  |enu%,warn_fn$)..|
0001a940  5c 28 c8 99 20 22 4d 65  6e 75 55 74 69 6c 5f 53  |\(.. "MenuUtil_S|
0001a950  75 62 4d 65 6e 75 22 2c  69 74 65 6d 25 2c 73 75  |ubMenu",item%,su|
0001a960  62 6d 65 6e 75 25 0d 0d  5d 14 e7 20 77 61 72 6e  |bmenu%..].. warn|
0001a970  5f 66 6e 24 3c 3e 22 22  20 8c 0d 0d 5e 1e 20 20  |_fn$<>"" ...^.  |
0001a980  c8 99 20 22 4d 65 6e 75  55 74 69 6c 5f 57 61 72  |.. "MenuUtil_War|
0001a990  6e 69 6e 67 22 2c 2c b9  0d 0d 5f 3a 20 20 f2 73  |ning",,..._:  .s|
0001a9a0  68 65 6c 6c 5f 45 76 65  6e 74 4c 69 73 74 4d 65  |hell_EventListMe|
0001a9b0  6e 75 57 61 72 6e 28 69  74 65 6d 25 2c 73 75 62  |nuWarn(item%,sub|
0001a9c0  6d 65 6e 75 25 2c 77 61  72 6e 5f 66 6e 24 2c 22  |menu%,warn_fn$,"|
0001a9d0  22 29 0d 0d 60 05 cd 0d  0d 61 05 e1 0d 0d 62 05  |")..`....a....b.|
0001a9e0  3a 0d 0d 63 22 2a 7c 53  74 6f 70 20 50 52 4f 43  |:..c"*|Stop PROC|
0001a9f0  73 68 65 6c 6c 5f 41 74  74 61 63 68 53 75 62 4d  |shell_AttachSubM|
0001aa00  65 6e 75 0d 0d 64 04 0d  0d 65 27 2a 7c 53 74 61  |enu..d...e'*|Sta|
0001aa10  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 45 76 65  |rt PROCshell_Eve|
0001aa20  6e 74 4c 69 73 74 4d 65  6e 75 57 61 72 6e 0d 0d  |ntListMenuWarn..|
0001aa30  66 43 dd 20 f2 73 68 65  6c 6c 5f 45 76 65 6e 74  |fC. .shell_Event|
0001aa40  4c 69 73 74 4d 65 6e 75  57 61 72 6e 28 69 74 65  |ListMenuWarn(ite|
0001aa50  6d 25 2c 73 75 62 6d 65  6e 75 5f 70 74 72 25 2c  |m%,submenu_ptr%,|
0001aa60  77 61 72 6e 5f 66 6e 24  2c 73 65 6c 5f 66 6e 24  |warn_fn$,sel_fn$|
0001aa70  29 0d 0d 67 1f ea 20 74  65 6d 70 25 2c 74 65 6d  |)..g.. temp%,tem|
0001aa80  70 32 25 2c 63 74 72 25  2c 65 5f 6c 69 73 74 25  |p2%,ctr%,e_list%|
0001aa90  0d 0d 68 11 e7 20 5f 55  25 21 32 32 30 3d 30 20  |..h.. _U%!220=0 |
0001aaa0  8c 0d 0d 69 1b 20 20 f4  20 43 72 65 61 74 65 20  |...i.  . Create |
0001aab0  65 76 65 6e 74 20 6c 69  73 74 2e 2e 0d 0d 6a 27  |event list....j'|
0001aac0  20 20 5f 55 25 21 32 32  30 3d a4 73 68 65 6c 6c  |  _U%!220=.shell|
0001aad0  5f 48 65 61 70 42 6c 6f  63 6b 46 65 74 63 68 28  |_HeapBlockFetch(|
0001aae0  33 32 29 0d 0d 6b 13 20  20 74 65 6d 70 25 3d 5f  |32)..k.  temp%=_|
0001aaf0  55 25 21 32 32 30 0d 0d  6c 13 20 20 74 65 6d 70  |U%!220..l.  temp|
0001ab00  25 21 30 3d 69 74 65 6d  25 0d 0d 6d 30 20 20 74  |%!0=item%..m0  t|
0001ab10  65 6d 70 25 21 34 3d a4  73 68 65 6c 6c 5f 48 65  |emp%!4=.shell_He|
0001ab20  61 70 42 6c 6f 63 6b 46  65 74 63 68 28 a9 77 61  |apBlockFetch(.wa|
0001ab30  72 6e 5f 66 6e 24 2b 31  29 0d 0d 6e 19 20 20 24  |rn_fn$+1)..n.  $|
0001ab40  28 74 65 6d 70 25 21 34  29 3d 77 61 72 6e 5f 66  |(temp%!4)=warn_f|
0001ab50  6e 24 0d 0d 6f 1a 20 20  74 65 6d 70 25 21 38 3d  |n$..o.  temp%!8=|
0001ab60  73 75 62 6d 65 6e 75 5f  70 74 72 25 0d 0d 70 30  |submenu_ptr%..p0|
0001ab70  20 20 74 65 6d 70 25 21  31 32 3d a4 73 68 65 6c  |  temp%!12=.shel|
0001ab80  6c 5f 48 65 61 70 42 6c  6f 63 6b 46 65 74 63 68  |l_HeapBlockFetch|
0001ab90  28 a9 73 65 6c 5f 66 6e  24 2b 31 29 0d 0d 71 19  |(.sel_fn$+1)..q.|
0001aba0  20 20 24 28 74 65 6d 70  25 21 31 32 29 3d 73 65  |  $(temp%!12)=se|
0001abb0  6c 5f 66 6e 24 0d 0d 72  35 20 20 74 65 6d 70 25  |l_fn$..r5  temp%|
0001abc0  21 31 36 3d 2d 31 3a 74  65 6d 70 25 21 32 30 3d  |!16=-1:temp%!20=|
0001abd0  2d 31 3a 74 65 6d 70 25  21 32 34 3d 2d 31 3a 74  |-1:temp%!24=-1:t|
0001abe0  65 6d 70 25 21 32 38 3d  2d 31 0d 0d 73 05 cc 0d  |emp%!28=-1..s...|
0001abf0  0d 74 24 20 20 f4 20 45  78 74 65 6e 64 20 65 78  |.t$  . Extend ex|
0001ac00  69 73 74 69 6e 67 20 65  76 65 6e 74 20 6c 69 73  |isting event lis|
0001ac10  74 2e 2e 0d 0d 75 30 20  20 65 5f 6c 69 73 74 25  |t....u0  e_list%|
0001ac20  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
0001ac30  6b 45 78 74 65 6e 64 28  5f 55 25 21 32 32 30 2c  |kExtend(_U%!220,|
0001ac40  33 32 29 0d 0d 76 1c 20  20 5f 55 25 21 32 32 30  |32)..v.  _U%!220|
0001ac50  3d 65 5f 6c 69 73 74 25  3a 63 74 72 25 3d 30 0d  |=e_list%:ctr%=0.|
0001ac60  0d 77 07 20 20 f5 0d 0d  78 10 20 20 20 20 63 74  |.w.  ...x.    ct|
0001ac70  72 25 2b 3d 31 36 0d 0d  79 17 20 20 fd 20 65 5f  |r%+=16..y.  . e_|
0001ac80  6c 69 73 74 25 21 63 74  72 25 3d 2d 31 0d 0d 7a  |list%!ctr%=-1..z|
0001ac90  13 20 20 74 65 6d 70 25  3d 5f 55 25 21 32 32 30  |.  temp%=_U%!220|
0001aca0  0d 0d 7b 16 20 20 74 65  6d 70 25 21 63 74 72 25  |..{.  temp%!ctr%|
0001acb0  3d 69 74 65 6d 25 0d 0d  7c 37 20 20 74 65 6d 70  |=item%..|7  temp|
0001acc0  25 21 28 63 74 72 25 2b  34 29 3d a4 73 68 65 6c  |%!(ctr%+4)=.shel|
0001acd0  6c 5f 48 65 61 70 42 6c  6f 63 6b 46 65 74 63 68  |l_HeapBlockFetch|
0001ace0  28 a9 77 61 72 6e 5f 66  6e 24 2b 31 29 0d 0d 7d  |(.warn_fn$+1)..}|
0001acf0  2e 20 20 74 65 6d 70 32  25 3d 74 65 6d 70 25 21  |.  temp2%=temp%!|
0001ad00  28 63 74 72 25 2b 34 29  3a 24 28 74 65 6d 70 32  |(ctr%+4):$(temp2|
0001ad10  25 29 3d 77 61 72 6e 5f  66 6e 24 0d 0d 7e 21 20  |%)=warn_fn$..~! |
0001ad20  20 74 65 6d 70 25 21 28  63 74 72 25 2b 38 29 3d  | temp%!(ctr%+8)=|
0001ad30  73 75 62 6d 65 6e 75 5f  70 74 72 25 0d 0d 7f 37  |submenu_ptr%...7|
0001ad40  20 20 74 65 6d 70 25 21  28 63 74 72 25 2b 31 32  |  temp%!(ctr%+12|
0001ad50  29 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |)=.shell_HeapBlo|
0001ad60  63 6b 46 65 74 63 68 28  a9 73 65 6c 5f 66 6e 24  |ckFetch(.sel_fn$|
0001ad70  2b 31 29 0d 0d 80 2e 20  20 74 65 6d 70 32 25 3d  |+1)....  temp2%=|
0001ad80  74 65 6d 70 25 21 28 63  74 72 25 2b 31 32 29 3a  |temp%!(ctr%+12):|
0001ad90  24 28 74 65 6d 70 32 25  29 3d 73 65 6c 5f 66 6e  |$(temp2%)=sel_fn|
0001ada0  24 0d 0d 81 3e 20 20 74  65 6d 70 25 21 28 63 74  |$...>  temp%!(ct|
0001adb0  72 25 2b 31 36 29 3d 2d  31 3a 74 65 6d 70 25 21  |r%+16)=-1:temp%!|
0001adc0  28 63 74 72 25 2b 32 30  29 3d 2d 31 3a 74 65 6d  |(ctr%+20)=-1:tem|
0001add0  70 25 21 28 63 74 72 25  2b 32 34 29 3d 2d 31 0d  |p%!(ctr%+24)=-1.|
0001ade0  0d 82 18 20 20 74 65 6d  70 25 21 28 63 74 72 25  |...  temp%!(ctr%|
0001adf0  2b 32 38 29 3d 2d 31 0d  0d 83 05 cd 0d 0d 84 05  |+28)=-1.........|
0001ae00  e1 0d 0d 85 05 3a 0d 0d  86 26 2a 7c 53 74 6f 70  |.....:...&*|Stop|
0001ae10  20 50 52 4f 43 73 68 65  6c 6c 5f 45 76 65 6e 74  | PROCshell_Event|
0001ae20  4c 69 73 74 4d 65 6e 75  57 61 72 6e 0d 0d 87 04  |ListMenuWarn....|
0001ae30  0d 0d 88 25 2a 7c 53 74  61 72 74 20 50 52 4f 43  |...%*|Start PROC|
0001ae40  73 68 65 6c 6c 5f 49 6e  74 65 72 61 63 74 69 76  |shell_Interactiv|
0001ae50  65 48 65 6c 70 0d 0d 89  21 dd 20 f2 73 68 65 6c  |eHelp...!. .shel|
0001ae60  6c 5f 49 6e 74 65 72 61  63 74 69 76 65 48 65 6c  |l_InteractiveHel|
0001ae70  70 28 5f 51 25 29 0d 0d  8a 35 ea 20 74 61 67 24  |p(_Q%)...5. tag$|
0001ae80  2c 6d 65 73 73 24 2c 76  61 6c 69 64 61 74 69 6f  |,mess$,validatio|
0001ae90  6e 24 2c 70 6f 73 31 25  2c 70 6f 73 32 25 2c 68  |n$,pos1%,pos2%,h|
0001aea0  65 6c 70 24 2c 69 5f 62  6c 6b 25 0d 0d 8b 26 69  |elp$,i_blk%...&i|
0001aeb0  5f 62 6c 6b 25 20 3d 20  a4 73 68 65 6c 6c 5f 48  |_blk% = .shell_H|
0001aec0  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 31 32  |eapBlockFetch(12|
0001aed0  29 0d 0d 8c 38 c8 99 20  22 57 69 6d 70 5f 57 68  |)...8.. "Wimp_Wh|
0001aee0  69 63 68 49 63 6f 6e 22  2c 5f 51 25 21 33 32 2c  |ichIcon",_Q%!32,|
0001aef0  69 5f 62 6c 6b 25 2c 26  30 30 33 46 30 30 30 30  |i_blk%,&003F0000|
0001af00  2c 31 32 20 3c 3c 20 31  36 0d 0d 8d 15 e7 20 21  |,12 << 16..... !|
0001af10  69 5f 62 6c 6b 25 20 3c  3e 20 2d 31 20 8c 0d 0d  |i_blk% <> -1 ...|
0001af20  8e 2e 20 20 f4 20 50 52  4f 43 73 68 65 6c 6c 5f  |..  . PROCshell_|
0001af30  54 72 61 63 65 66 30 28  22 4c 4c 3a 22 2b 53 54  |Tracef0("LL:"+ST|
0001af40  52 24 28 21 69 5f 62 6c  6b 25 29 29 0d 0d 8f 4b  |R$(!i_blk%))...K|
0001af50  20 20 f4 20 50 52 4f 43  73 68 65 6c 6c 5f 54 72  |  . PROCshell_Tr|
0001af60  61 63 65 66 30 28 22 4c  4c 3a 22 2b 22 46 4e 22  |acef0("LL:"+"FN"|
0001af70  20 2b 20 46 4e 73 68 65  6c 6c 5f 49 63 6f 6e 47  | + FNshell_IconG|
0001af80  65 74 44 61 74 61 28 5f  51 25 21 33 32 2c 21 69  |etData(_Q%!32,!i|
0001af90  5f 62 6c 6b 25 29 29 0d  0d 90 2f 20 20 74 61 67  |_blk%)).../  tag|
0001afa0  24 20 3d 20 a4 73 68 65  6c 6c 5f 49 63 6f 6e 47  |$ = .shell_IconG|
0001afb0  65 74 44 61 74 61 28 5f  51 25 21 33 32 2c 21 69  |etData(_Q%!32,!i|
0001afc0  5f 62 6c 6b 25 29 0d 0d  91 05 cd 0d 0d 92 22 f2  |_blk%)........".|
0001afd0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 52  |shell_HeapBlockR|
0001afe0  65 74 75 72 6e 28 69 5f  62 6c 6b 25 29 0d 0d 93  |eturn(i_blk%)...|
0001aff0  3e e7 20 74 61 67 24 20  3d 20 22 22 20 8c 20 74  |>. tag$ = "" . t|
0001b000  61 67 24 3d a4 73 68 65  6c 6c 5f 47 65 74 45 76  |ag$=.shell_GetEv|
0001b010  65 6e 74 48 61 6e 64 6c  65 72 28 5f 51 25 21 33  |entHandler(_Q%!3|
0001b020  32 2c 5f 51 25 21 33 36  2c 38 29 0d 0d 94 42 f4  |2,_Q%!36,8)...B.|
0001b030  20 63 68 65 63 6b 20 76  61 6c 69 64 61 74 69 6f  | check validatio|
0001b040  6e 20 73 74 72 69 6e 67  20 2d 20 74 68 69 73 20  |n string - this |
0001b050  6f 76 65 72 72 69 64 65  73 20 61 74 74 61 63 68  |overrides attach|
0001b060  65 64 20 68 65 6c 70 20  74 61 67 73 21 0d 0d 95  |ed help tags!...|
0001b070  37 76 61 6c 69 64 61 74  69 6f 6e 24 3d a4 73 68  |7validation$=.sh|
0001b080  65 6c 6c 5f 49 63 6f 6e  47 65 74 56 61 6c 69 64  |ell_IconGetValid|
0001b090  61 74 69 6f 6e 28 5f 51  25 21 33 32 2c 5f 51 25  |ation(_Q%!32,_Q%|
0001b0a0  21 33 36 29 0d 0d 96 17  e7 20 76 61 6c 69 64 61  |!36)..... valida|
0001b0b0  74 69 6f 6e 24 3c 3e 22  22 20 8c 0d 0d 97 35 20  |tion$<>"" ....5 |
0001b0c0  20 e7 20 a4 73 68 65 6c  6c 5f 53 74 72 69 6e 67  | . .shell_String|
0001b0d0  55 70 70 65 72 43 61 73  65 28 c0 76 61 6c 69 64  |UpperCase(.valid|
0001b0e0  61 74 69 6f 6e 24 2c 31  29 29 3d 22 49 22 20 8c  |ation$,1))="I" .|
0001b0f0  0d 0d 98 1f 20 20 20 20  70 6f 73 31 25 3d a7 76  |....    pos1%=.v|
0001b100  61 6c 69 64 61 74 69 6f  6e 24 2c 22 3b 22 29 0d  |alidation$,";").|
0001b110  0d 99 1d 20 20 20 20 f4  20 69 20 69 73 20 66 69  |...    . i is fi|
0001b120  72 73 74 20 6d 6f 64 69  66 69 65 72 0d 0d 9a 13  |rst modifier....|
0001b130  20 20 20 20 e7 20 70 6f  73 31 25 3d 30 20 8c 0d  |    . pos1%=0 ..|
0001b140  0d 9b 1e 20 20 20 20 20  20 74 61 67 24 3d c1 76  |...      tag$=.v|
0001b150  61 6c 69 64 61 74 69 6f  6e 24 2c 32 29 0d 0d 9c  |alidation$,2)...|
0001b160  09 20 20 20 20 cc 0d 0d  9d 26 20 20 20 20 20 20  |.    ....&      |
0001b170  74 61 67 24 3d c1 76 61  6c 69 64 61 74 69 6f 6e  |tag$=.validation|
0001b180  24 2c 32 2c 70 6f 73 31  25 2d 32 29 0d 0d 9e 09  |$,2,pos1%-2)....|
0001b190  20 20 20 20 cd 0d 0d 9f  07 20 20 cc 0d 0d a0 50  |    .....  ....P|
0001b1a0  20 20 20 20 70 6f 73 31  25 3d a7 a4 73 68 65 6c  |    pos1%=..shel|
0001b1b0  6c 5f 53 74 72 69 6e 67  55 70 70 65 72 43 61 73  |l_StringUpperCas|
0001b1c0  65 28 76 61 6c 69 64 61  74 69 6f 6e 24 29 2c a4  |e(validation$),.|
0001b1d0  73 68 65 6c 6c 5f 53 74  72 69 6e 67 55 70 70 65  |shell_StringUppe|
0001b1e0  72 43 61 73 65 28 22 3b  69 22 29 29 0d 0d a1 57  |rCase(";i"))...W|
0001b1f0  20 20 20 20 70 6f 73 32  25 3d a7 a4 73 68 65 6c  |    pos2%=..shel|
0001b200  6c 5f 53 74 72 69 6e 67  55 70 70 65 72 43 61 73  |l_StringUpperCas|
0001b210  65 28 76 61 6c 69 64 61  74 69 6f 6e 24 29 2c a4  |e(validation$),.|
0001b220  73 68 65 6c 6c 5f 53 74  72 69 6e 67 55 70 70 65  |shell_StringUppe|
0001b230  72 43 61 73 65 28 22 3b  22 29 2c 70 6f 73 31 25  |rCase(";"),pos1%|
0001b240  2b 31 29 0d 0d a2 13 20  20 20 20 e7 20 70 6f 73  |+1)....    . pos|
0001b250  31 25 3e 30 20 8c 0d 0d  a3 15 20 20 20 20 20 20  |1%>0 .....      |
0001b260  e7 20 70 6f 73 32 25 3e  30 20 8c 0d 0d a4 34 20  |. pos2%>0 ....4 |
0001b270  20 20 20 20 20 20 20 74  61 67 24 3d c1 76 61 6c  |       tag$=.val|
0001b280  69 64 61 74 69 6f 6e 24  2c 70 6f 73 31 25 2b 32  |idation$,pos1%+2|
0001b290  2c 70 6f 73 32 25 2d 70  6f 73 31 25 2d 32 29 0d  |,pos2%-pos1%-2).|
0001b2a0  0d a5 0b 20 20 20 20 20  20 cc 0d 0d a6 26 20 20  |...      ....&  |
0001b2b0  20 20 20 20 20 20 74 61  67 24 3d c1 76 61 6c 69  |      tag$=.vali|
0001b2c0  64 61 74 69 6f 6e 24 2c  70 6f 73 31 25 2b 32 29  |dation$,pos1%+2)|
0001b2d0  0d 0d a7 0b 20 20 20 20  20 20 cd 0d 0d a8 09 20  |....      ..... |
0001b2e0  20 20 20 cd 0d 0d a9 07  20 20 cd 0d 0d aa 05 cd  |   .....  ......|
0001b2f0  0d 0d ab 10 e7 20 74 61  67 24 3c 3e 22 22 20 8c  |..... tag$<>"" .|
0001b300  0d 0d ac 1e 20 20 5f 51  25 21 31 36 3d 26 35 30  |....  _Q%!16=&50|
0001b310  33 3a 5f 51 25 21 31 32  3d 5f 51 25 21 38 0d 0d  |3:_Q%!12=_Q%!8..|
0001b320  ad 2c 20 20 6d 65 73 73  24 3d a4 73 68 65 6c 6c  |.,  mess$=.shell|
0001b330  5f 4d 65 73 73 61 67 65  4c 6f 6f 6b 75 70 28 74  |_MessageLookup(t|
0001b340  61 67 24 2c 22 22 2c 22  22 29 0d 0d ae 27 20 20  |ag$,"","")...'  |
0001b350  6d 65 73 73 24 3d a4 73  68 65 6c 6c 5f 4d 65 73  |mess$=.shell_Mes|
0001b360  73 61 67 65 45 78 70 61  6e 64 28 6d 65 73 73 24  |sageExpand(mess$|
0001b370  29 0d 0d af 15 20 20 24  28 5f 51 25 2b 32 30 29  |)....  $(_Q%+20)|
0001b380  3d 6d 65 73 73 24 0d 0d  b0 1c 20 20 21 5f 51 25  |=mess$....  !_Q%|
0001b390  3d 28 a9 6d 65 73 73 24  2b 32 35 29 20 80 20 ac  |=(.mess$+25) . .|
0001b3a0  20 33 0d 0d b1 28 20 20  c8 99 20 22 57 69 6d 70  | 3...(  .. "Wimp|
0001b3b0  5f 53 65 6e 64 4d 65 73  73 61 67 65 22 2c 31 37  |_SendMessage",17|
0001b3c0  2c 5f 51 25 2c 5f 51 25  21 34 0d 0d b2 05 cd 0d  |,_Q%,_Q%!4......|
0001b3d0  0d b3 05 e1 0d 0d b4 05  3a 0d 0d b5 24 2a 7c 53  |........:...$*|S|
0001b3e0  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 49 6e  |top PROCshell_In|
0001b3f0  74 65 72 61 63 74 69 76  65 48 65 6c 70 0d 0d b6  |teractiveHelp...|
0001b400  13 2a 7c 53 74 61 72 74  20 50 52 4f 43 61 63 6b  |.*|Start PROCack|
0001b410  0d 0d b7 0a dd 20 f2 61  63 6b 0d 0d b8 05 e1 0d  |..... .ack......|
0001b420  0d b9 05 3a 0d 0d ba 12  2a 7c 53 74 6f 70 20 50  |...:....*|Stop P|
0001b430  52 4f 43 61 63 6b 0d 0d  bb 04 0d 0d bc 25 2a 7c  |ROCack.......%*||
0001b440  53 74 61 72 74 20 50 52  4f 43 73 68 65 6c 6c 5f  |Start PROCshell_|
0001b450  4d 65 73 73 61 67 65 5f  50 72 65 51 75 69 74 0d  |Message_PreQuit.|
0001b460  0d bd 21 dd 20 f2 73 68  65 6c 6c 5f 4d 65 73 73  |..!. .shell_Mess|
0001b470  61 67 65 5f 50 72 65 51  75 69 74 28 5f 51 25 29  |age_PreQuit(_Q%)|
0001b480  0d 0d be 2c ea 20 74 65  6d 70 25 2c 71 75 69 74  |...,. temp%,quit|
0001b490  73 65 6e 64 65 72 25 2c  62 6c 6b 25 2c 6c 6f 6f  |sender%,blk%,loo|
0001b4a0  70 25 2c 66 6c 61 67 77  6f 72 64 25 0d 0d bf 11  |p%,flagword%....|
0001b4b0  e7 20 5f 55 25 21 33 30  30 3e 30 20 8c 0d 0d c0  |. _U%!300>0 ....|
0001b4c0  25 20 20 62 6c 6b 25 3d  a4 73 68 65 6c 6c 5f 48  |%  blk%=.shell_H|
0001b4d0  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 32 35  |eapBlockFetch(25|
0001b4e0  36 29 0d 0d c1 2c 20 20  f4 20 63 6f 70 79 20 6d  |6)...,  . copy m|
0001b4f0  65 73 73 61 67 65 20 62  6c 6f 63 6b 20 74 6f 20  |essage block to |
0001b500  70 72 69 76 61 74 65 20  61 72 65 61 2e 2e 0d 0d  |private area....|
0001b510  c2 33 20 20 e3 20 6c 6f  6f 70 25 3d 30 20 b8 20  |.3  . loop%=0 . |
0001b520  5f 51 25 21 30 20 88 20  34 3a f4 20 66 69 72 73  |_Q%!0 . 4:. firs|
0001b530  74 20 77 6f 72 64 20 69  73 20 73 69 7a 65 2e 2e  |t word is size..|
0001b540  2e 0d 0d c3 1c 20 20 20  20 62 6c 6b 25 21 6c 6f  |.....    blk%!lo|
0001b550  6f 70 25 3d 5f 51 25 21  6c 6f 6f 70 25 0d 0d c4  |op%=_Q%!loop%...|
0001b560  0d 20 20 ed 20 6c 6f 6f  70 25 0d 0d c5 15 2a 7c  |.  . loop%....*||
0001b570  69 66 64 65 66 20 54 72  61 63 65 49 6e 69 74 0d  |ifdef TraceInit.|
0001b580  0d c6 40 20 20 f2 73 68  65 6c 6c 5f 54 72 61 63  |..@  .shell_Trac|
0001b590  65 66 30 28 22 4d 65 73  73 61 67 65 5f 50 72 65  |ef0("Message_Pre|
0001b5a0  51 75 69 74 3a 50 72 65  51 75 69 74 20 6d 65 73  |Quit:PreQuit mes|
0001b5b0  73 61 67 65 20 72 65 63  65 69 76 65 64 22 29 0d  |sage received").|
0001b5c0  0d c7 0b 2a 7c 65 6e 64  69 66 0d 0d c8 13 20 20  |...*|endif....  |
0001b5d0  74 65 6d 70 25 3d 5f 55  25 21 33 30 30 0d 0d c9  |temp%=_U%!300...|
0001b5e0  18 20 20 71 75 69 74 73  65 6e 64 65 72 25 3d 62  |.  quitsender%=b|
0001b5f0  6c 6b 25 21 34 0d 0d ca  32 20 20 e7 20 21 62 6c  |lk%!4...2  . !bl|
0001b600  6b 25 3c 32 34 20 8c 20  66 6c 61 67 77 6f 72 64  |k%<24 . flagword|
0001b610  25 3d 30 20 8b 20 66 6c  61 67 77 6f 72 64 25 3d  |%=0 . flagword%=|
0001b620  62 6c 6b 25 21 32 30 0d  0d cb 34 20 20 f4 20 61  |blk%!20...4  . a|
0001b630  63 6b 6e 6f 77 6c 65 64  67 65 20 6d 65 73 73 61  |cknowledge messa|
0001b640  67 65 20 2d 20 74 68 69  73 20 61 62 6f 72 74 73  |ge - this aborts|
0001b650  20 73 68 75 74 64 6f 77  6e 2e 2e 0d 0d cc 3e 20  | shutdown.....> |
0001b660  20 62 6c 6b 25 21 31 32  3d 62 6c 6b 25 21 38 3a  | blk%!12=blk%!8:|
0001b670  c8 99 20 22 57 69 6d 70  5f 53 65 6e 64 4d 65 73  |.. "Wimp_SendMes|
0001b680  73 61 67 65 22 2c 31 39  2c 62 6c 6b 25 2c 71 75  |sage",19,blk%,qu|
0001b690  69 74 73 65 6e 64 65 72  25 0d 0d cd 1b 20 20 e7  |itsender%....  .|
0001b6a0  20 a0 28 22 46 4e 22 2b  24 74 65 6d 70 25 29 3c  | .("FN"+$temp%)<|
0001b6b0  3e 30 20 8c 0d 0d ce 16  20 20 20 20 f4 20 6f 6b  |>0 .....    . ok|
0001b6c0  20 74 6f 20 71 75 69 74  2e 2e 0d 0d cf 19 20 20  | to quit......  |
0001b6d0  20 20 e7 20 66 6c 61 67  77 6f 72 64 25 20 80 20  |  . flagword% . |
0001b6e0  31 20 8c 0d 0d d0 21 20  20 20 20 20 20 f4 20 71  |1 ....!      . q|
0001b6f0  75 69 74 20 6a 75 73 74  20 74 68 69 73 20 74 61  |uit just this ta|
0001b700  73 6b 2e 2e 0d 0d d1 17  20 20 20 20 20 20 5f 63  |sk......      _c|
0001b710  6c 6f 73 65 64 6f 77 6e  25 3d b9 0d 0d d2 09 20  |losedown%=..... |
0001b720  20 20 20 cc 0d 0d d3 1e  20 20 20 20 20 20 f4 20  |   .....      . |
0001b730  73 68 75 74 64 6f 77 6e  20 64 65 73 6b 74 6f 70  |shutdown desktop|
0001b740  2e 2e 0d 0d d4 1f 20 20  20 20 20 20 21 62 6c 6b  |......      !blk|
0001b750  25 3d 32 34 3a 62 6c 6b  25 21 32 34 3d 26 31 46  |%=24:blk%!24=&1F|
0001b760  43 0d 0d d5 32 20 20 20  20 20 20 c8 99 20 22 57  |C...2      .. "W|
0001b770  69 6d 70 5f 53 65 6e 64  4d 65 73 73 61 67 65 22  |imp_SendMessage"|
0001b780  2c 38 2c 62 6c 6b 25 2c  71 75 69 74 73 65 6e 64  |,8,blk%,quitsend|
0001b790  65 72 25 0d 0d d6 17 20  20 20 20 20 20 5f 63 6c  |er%....      _cl|
0001b7a0  6f 73 65 64 6f 77 6e 25  3d b9 0d 0d d7 09 20 20  |osedown%=.....  |
0001b7b0  20 20 cd 0d 0d d8 07 20  20 cd 0d 0d d9 22 20 20  |  .....  ...."  |
0001b7c0  f2 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
0001b7d0  52 65 74 75 72 6e 28 62  6c 6b 25 29 0d 0d da 05  |Return(blk%)....|
0001b7e0  cd 0d 0d db 05 e1 0d 0d  dc 05 3a 0d 0d dd 24 2a  |..........:...$*|
0001b7f0  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
0001b800  4d 65 73 73 61 67 65 5f  50 72 65 51 75 69 74 0d  |Message_PreQuit.|
0001b810  0d de 04 0d 0d df 19 2a  7c 53 74 61 72 74 20 50  |.......*|Start P|
0001b820  52 4f 43 6c 77 61 6f 72  69 67 69 6e 0d 0d e0 1d  |ROClwaorigin....|
0001b830  dd 20 f2 6c 77 61 6f 72  69 67 69 6e 28 62 2c f8  |. .lwaorigin(b,.|
0001b840  20 78 25 2c f8 20 79 25  29 0d 0d e1 1c 78 25 3d  | x%,. y%)....x%=|
0001b850  62 21 30 2d 62 21 31 36  3a 79 25 3d 62 21 31 32  |b!0-b!16:y%=b!12|
0001b860  2d 62 21 32 30 0d 0d e2  05 e1 0d 0d e3 05 3a 0d  |-b!20.........:.|
0001b870  0d e4 18 2a 7c 53 74 6f  70 20 50 52 4f 43 6c 77  |...*|Stop PROClw|
0001b880  61 6f 72 69 67 69 6e 0d  0d e5 04 0d 0d e6 1b 2a  |aorigin........*|
0001b890  7c 53 74 61 72 74 20 46  4e 73 68 65 6c 6c 5f 49  ||Start FNshell_I|
0001b8a0  63 6f 6e 62 61 72 0d 0d  e7 42 dd 20 a4 73 68 65  |conbar...B. .she|
0001b8b0  6c 6c 5f 49 63 6f 6e 62  61 72 28 70 6f 73 25 2c  |ll_Iconbar(pos%,|
0001b8c0  73 6e 61 6d 65 24 2c 74  65 78 74 24 2c 77 25 2c  |sname$,text$,w%,|
0001b8d0  6d 65 6e 75 25 2c 73 68  69 66 74 25 2c 63 74 72  |menu%,shift%,ctr|
0001b8e0  6c 25 2c 61 6c 74 25 29  0d 0d e8 0d ea 20 68 61  |l%,alt%)..... ha|
0001b8f0  6e 64 6c 65 25 0d 0d e9  10 e7 20 74 65 78 74 24  |ndle%..... text$|
0001b900  3d 22 22 20 8c 0d 0d ea  51 20 20 21 5f 51 25 3d  |="" ....Q  !_Q%=|
0001b910  70 6f 73 25 3a 5f 51 25  21 34 3d 30 3a 5f 51 25  |pos%:_Q%!4=0:_Q%|
0001b920  21 38 3d 30 3a 5f 51 25  21 31 32 3d 37 30 3a 5f  |!8=0:_Q%!12=70:_|
0001b930  51 25 21 31 36 3d 37 30  3a 5f 51 25 21 32 30 3d  |Q%!16=70:_Q%!20=|
0001b940  26 33 30 31 41 3a 24 28  5f 51 25 2b 32 34 29 3d  |&301A:$(_Q%+24)=|
0001b950  73 6e 61 6d 65 24 0d 0d  eb 05 cc 0d 0d ec 46 20  |sname$........F |
0001b960  20 21 5f 51 25 3d 70 6f  73 25 3a 5f 51 25 21 34  | !_Q%=pos%:_Q%!4|
0001b970  3d 30 3a 5f 51 25 21 38  3d 2d 31 36 3a 5f 51 25  |=0:_Q%!8=-16:_Q%|
0001b980  21 31 32 3d 77 25 3a 5f  51 25 21 31 36 3d 39 30  |!12=w%:_Q%!16=90|
0001b990  3a 5f 51 25 21 32 30 3d  26 31 37 30 30 32 31 30  |:_Q%!20=&1700210|
0001b9a0  42 0d 0d ed 11 20 20 de  20 5f 51 25 21 32 34 20  |B....  . _Q%!24 |
0001b9b0  31 32 0d 0d ee 1a 20 20  de 20 5f 51 25 21 32 38  |12....  . _Q%!28|
0001b9c0  20 a9 28 73 6e 61 6d 65  24 29 2b 32 0d 0d ef 15  | .(sname$)+2....|
0001b9d0  20 20 24 28 5f 51 25 21  32 34 29 3d 74 65 78 74  |  $(_Q%!24)=text|
0001b9e0  24 0d 0d f0 1a 20 20 24  28 5f 51 25 21 32 38 29  |$....  $(_Q%!28)|
0001b9f0  3d 22 53 22 2b 73 6e 61  6d 65 24 0d 0d f1 0f 20  |="S"+sname$.... |
0001ba00  20 5f 51 25 21 33 32 3d  31 32 0d 0d f2 05 cd 0d  | _Q%!32=12......|
0001ba10  0d f3 27 c8 99 20 22 57  69 6d 70 5f 43 72 65 61  |..'.. "Wimp_Crea|
0001ba20  74 65 49 63 6f 6e 22 2c  2c 5f 51 25 20 b8 20 68  |teIcon",,_Q% . h|
0001ba30  61 6e 64 6c 65 25 0d 0d  f4 39 f2 73 68 65 6c 6c  |andle%...9.shell|
0001ba40  5f 41 74 74 61 63 68 4d  65 6e 75 28 2d 32 2c 68  |_AttachMenu(-2,h|
0001ba50  61 6e 64 6c 65 25 2c 6d  65 6e 75 25 2c 73 68 69  |andle%,menu%,shi|
0001ba60  66 74 25 2c 63 74 72 6c  25 2c 61 6c 74 25 29 0d  |ft%,ctrl%,alt%).|
0001ba70  0d f5 0c 3d 68 61 6e 64  6c 65 25 0d 0d f6 05 3a  |...=handle%....:|
0001ba80  0d 0d f7 1a 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |....*|Stop FNshe|
0001ba90  6c 6c 5f 49 63 6f 6e 62  61 72 0d 0d f8 04 0d 0d  |ll_Iconbar......|
0001baa0  f9 24 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |.$*|Start PROCsh|
0001bab0  65 6c 6c 5f 49 63 6f 6e  62 61 72 53 65 74 54 65  |ell_IconbarSetTe|
0001bac0  78 74 0d 0d fa 26 dd 20  f2 73 68 65 6c 6c 5f 49  |xt...&. .shell_I|
0001bad0  63 6f 6e 62 61 72 53 65  74 54 65 78 74 28 68 25  |conbarSetText(h%|
0001bae0  2c 69 6e 25 2c 73 24 29  0d 0d fb 16 ea 20 69 63  |,in%,s$)..... ic|
0001baf0  6f 6e 5f 62 6c 6b 25 2c  77 5f 62 6c 6b 25 0d 0d  |on_blk%,w_blk%..|
0001bb00  fc 27 69 63 6f 6e 5f 62  6c 6b 25 3d a4 73 68 65  |.'icon_blk%=.she|
0001bb10  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 46 65 74 63  |ll_HeapBlockFetc|
0001bb20  68 28 34 30 29 0d 0d fd  29 77 5f 62 6c 6b 25 20  |h(40)...)w_blk% |
0001bb30  20 20 20 3d 20 a4 73 68  65 6c 6c 5f 48 65 61 70  |   = .shell_Heap|
0001bb40  42 6c 6f 63 6b 46 65 74  63 68 28 33 36 29 0d 0d  |BlockFetch(36)..|
0001bb50  fe 11 77 5f 62 6c 6b 25  21 32 30 20 3d 20 30 0d  |..w_blk%!20 = 0.|
0001bb60  0d ff 20 e7 20 a4 73 68  65 6c 6c 5f 4f 53 43 68  |.. . .shell_OSCh|
0001bb70  65 63 6b 56 65 72 73 69  6f 6e 28 33 29 20 8c 0d  |eckVersion(3) ..|
0001bb80  0e 00 2d 20 20 e7 20 68  25 20 3d 20 2d 31 20 8c  |..-  . h% = -1 .|
0001bb90  20 21 77 5f 62 6c 6b 25  20 3d 20 2d 32 20 8b 20  | !w_blk% = -2 . |
0001bba0  21 77 5f 62 6c 6b 25 20  3d 20 68 25 0d 0e 01 26  |!w_blk% = h%...&|
0001bbb0  20 20 c8 99 20 22 57 69  6d 70 5f 47 65 74 57 69  |  .. "Wimp_GetWi|
0001bbc0  6e 64 6f 77 53 74 61 74  65 22 2c 2c 77 5f 62 6c  |ndowState",,w_bl|
0001bbd0  6b 25 0d 0e 02 05 cd 0d  0e 03 25 21 69 63 6f 6e  |k%........%!icon|
0001bbe0  5f 62 6c 6b 25 20 3d 20  68 25 3a 69 63 6f 6e 5f  |_blk% = h%:icon_|
0001bbf0  62 6c 6b 25 21 34 20 3d  20 69 6e 25 0d 0e 04 25  |blk%!4 = in%...%|
0001bc00  c8 99 20 22 57 69 6d 70  5f 47 65 74 49 63 6f 6e  |.. "Wimp_GetIcon|
0001bc10  53 74 61 74 65 22 2c 2c  69 63 6f 6e 5f 62 6c 6b  |State",,icon_blk|
0001bc20  25 0d 0e 05 16 24 28 69  63 6f 6e 5f 62 6c 6b 25  |%....$(icon_blk%|
0001bc30  21 32 38 29 3d 73 24 0d  0e 06 6b c8 99 20 22 57  |!28)=s$...k.. "W|
0001bc40  69 6d 70 5f 46 6f 72 63  65 52 65 64 72 61 77 22  |imp_ForceRedraw"|
0001bc50  2c 2d 31 2c 69 63 6f 6e  5f 62 6c 6b 25 21 38 2d  |,-1,icon_blk%!8-|
0001bc60  31 30 30 2d 77 5f 62 6c  6b 25 21 32 30 2c 69 63  |100-w_blk%!20,ic|
0001bc70  6f 6e 5f 62 6c 6b 25 21  31 32 2c 69 63 6f 6e 5f  |on_blk%!12,icon_|
0001bc80  62 6c 6b 25 21 31 36 2b  31 30 30 2d 77 5f 62 6c  |blk%!16+100-w_bl|
0001bc90  6b 25 21 32 30 2c 69 63  6f 6e 5f 62 6c 6b 25 21  |k%!20,icon_blk%!|
0001bca0  32 30 0d 0e 07 25 f2 73  68 65 6c 6c 5f 48 65 61  |20...%.shell_Hea|
0001bcb0  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 69 63 6f  |pBlockReturn(ico|
0001bcc0  6e 5f 62 6c 6b 25 29 0d  0e 08 22 f2 73 68 65 6c  |n_blk%)...".shel|
0001bcd0  6c 5f 48 65 61 70 42 6c  6f 63 6b 52 65 74 75 72  |l_HeapBlockRetur|
0001bce0  6e 28 77 5f 62 6c 6b 25  29 0d 0e 09 05 e1 0d 0e  |n(w_blk%).......|
0001bcf0  0a 05 3a 0d 0e 0b 23 2a  7c 53 74 6f 70 20 50 52  |..:...#*|Stop PR|
0001bd00  4f 43 73 68 65 6c 6c 5f  49 63 6f 6e 62 61 72 53  |OCshell_IconbarS|
0001bd10  65 74 54 65 78 74 0d 0e  0c 04 0d 0e 0d 27 2a 7c  |etText.......'*||
0001bd20  53 74 61 72 74 20 46 4e  73 68 65 6c 6c 5f 57 72  |Start FNshell_Wr|
0001bd30  69 74 61 62 6c 65 49 63  6f 6e 48 61 6e 64 6c 65  |itableIconHandle|
0001bd40  72 0d 0e 0e 2e dd 20 a4  73 68 65 6c 6c 5f 57 72  |r..... .shell_Wr|
0001bd50  69 74 61 62 6c 65 49 63  6f 6e 48 61 6e 64 6c 65  |itableIconHandle|
0001bd60  72 28 77 68 25 2c 69 68  25 2c 6b 65 79 25 29 0d  |r(wh%,ih%,key%).|
0001bd70  0e 0f 2d ea 20 6e 72 5f  69 63 6f 6e 73 25 2c 66  |..-. nr_icons%,f|
0001bd80  69 72 73 74 5f 77 72 69  74 65 25 2c 6c 61 73 74  |irst_write%,last|
0001bd90  5f 77 72 69 74 65 25 2c  63 74 72 25 0d 0e 10 3f  |_write%,ctr%...?|
0001bda0  ea 20 70 72 65 76 5f 69  63 6f 6e 25 2c 6e 65 78  |. prev_icon%,nex|
0001bdb0  74 5f 69 63 6f 6e 25 2c  69 6e 64 65 78 25 2c 6d  |t_icon%,index%,m|
0001bdc0  78 25 2c 6d 79 25 2c 74  65 6d 70 5f 62 6c 6b 25  |x%,my%,temp_blk%|
0001bdd0  2c 63 61 72 65 74 5f 62  6c 6b 25 0d 0e 11 04 0d  |,caret_blk%.....|
0001bde0  0e 12 44 f4 20 63 61 72  65 74 5f 62 6c 6b 25 20  |..D. caret_blk% |
0001bdf0  73 68 6f 75 6c 64 20 62  65 20 6a 75 73 74 20 6c  |should be just l|
0001be00  61 72 67 65 20 65 6e 6f  75 67 68 20 66 6f 72 20  |arge enough for |
0001be10  74 68 65 20 6e 75 6d 62  65 72 20 6f 66 20 69 63  |the number of ic|
0001be20  6f 6e 73 0d 0e 13 34 f4  20 61 63 74 75 61 6c 6c  |ons...4. actuall|
0001be30  79 20 69 6e 20 74 68 65  20 77 69 6e 64 6f 77 20  |y in the window |
0001be40  28 6c 69 6d 69 74 20 69  73 20 32 35 34 20 69 63  |(limit is 254 ic|
0001be50  6f 6e 73 29 2e 2e 2e 0d  0e 14 2c 63 61 72 65 74  |ons)......,caret|
0001be60  5f 62 6c 6b 25 20 3d 20  a4 73 68 65 6c 6c 5f 48  |_blk% = .shell_H|
0001be70  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 31 30  |eapBlockFetch(10|
0001be80  32 34 29 0d 0e 15 2a c8  99 20 22 57 69 6d 70 5f  |24)...*.. "Wimp_|
0001be90  47 65 74 43 61 72 65 74  50 6f 73 69 74 69 6f 6e  |GetCaretPosition|
0001bea0  22 2c 2c 63 61 72 65 74  5f 62 6c 6b 25 0d 0e 16  |",,caret_blk%...|
0001beb0  18 e7 20 21 63 61 72 65  74 5f 62 6c 6b 25 20 3d  |.. !caret_blk% =|
0001bec0  20 2d 31 20 8c 0d 0e 17  28 20 20 f2 73 68 65 6c  | -1 ....(  .shel|
0001bed0  6c 5f 48 65 61 70 42 6c  6f 63 6b 52 65 74 75 72  |l_HeapBlockRetur|
0001bee0  6e 28 63 61 72 65 74 5f  62 6c 6b 25 29 0d 0e 18  |n(caret_blk%)...|
0001bef0  1e 20 20 3d 20 a3 20 3a  f4 20 6e 6f 20 63 61 72  |.  = . :. no car|
0001bf00  65 74 20 73 6f 20 61 62  6f 72 74 0d 0e 19 05 cd  |et so abort.....|
0001bf10  0d 0e 1a 04 0d 0e 1b 39  f4 20 6d 75 73 74 20 62  |.......9. must b|
0001bf20  65 20 69 63 6f 6e 73 20  69 6e 20 74 68 65 20 77  |e icons in the w|
0001bf30  69 6e 64 6f 77 20 61 73  20 74 68 65 20 63 61 72  |indow as the car|
0001bf40  65 74 20 69 73 20 70 72  65 73 65 6e 74 0d 0e 1c  |et is present...|
0001bf50  3a c8 99 20 22 57 69 6d  70 5f 57 68 69 63 68 49  |:.. "Wimp_WhichI|
0001bf60  63 6f 6e 22 2c 77 68 25  2c 63 61 72 65 74 5f 62  |con",wh%,caret_b|
0001bf70  6c 6b 25 2c 26 30 30 34  30 45 30 30 30 2c 26 30  |lk%,&0040E000,&0|
0001bf80  30 30 30 45 30 30 30 0d  0e 1d 04 0d 0e 1e 27 66  |000E000.......'f|
0001bf90  69 72 73 74 5f 77 72 69  74 65 25 20 3d 20 21 63  |irst_write% = !c|
0001bfa0  61 72 65 74 5f 62 6c 6b  25 3a 63 74 72 25 20 20  |aret_blk%:ctr%  |
0001bfb0  3d 30 0d 0e 1f 05 f5 0d  0e 20 1f 20 20 e7 20 63  |=0....... .  . c|
0001bfc0  61 72 65 74 5f 62 6c 6b  25 21 63 74 72 25 20 3d  |aret_blk%!ctr% =|
0001bfd0  20 69 68 25 20 8c 0d 0e  21 2a 20 20 20 20 70 72  | ih% ...!*    pr|
0001bfe0  65 76 5f 69 63 6f 6e 25  20 3d 20 63 61 72 65 74  |ev_icon% = caret|
0001bff0  5f 62 6c 6b 25 21 28 63  74 72 25 20 2d 20 34 29  |_blk%!(ctr% - 4)|
0001c000  0d 0e 22 2b 20 20 20 20  6e 65 78 74 5f 69 63 6f  |.."+    next_ico|
0001c010  6e 25 20 20 3d 20 63 61  72 65 74 5f 62 6c 6b 25  |n%  = caret_blk%|
0001c020  21 28 63 74 72 25 20 2b  20 34 29 0d 0e 23 07 20  |!(ctr% + 4)..#. |
0001c030  20 cd 0d 0e 24 0f 20 20  63 74 72 25 20 2b 3d 20  | ...$.  ctr% += |
0001c040  34 0d 0e 25 1a fd 20 63  61 72 65 74 5f 62 6c 6b  |4..%.. caret_blk|
0001c050  25 21 63 74 72 25 20 3d  20 2d 31 0d 0e 26 25 6c  |%!ctr% = -1..&%l|
0001c060  61 73 74 5f 77 72 69 74  65 25 20 3d 20 63 61 72  |ast_write% = car|
0001c070  65 74 5f 62 6c 6b 25 21  28 63 74 72 25 2d 34 29  |et_blk%!(ctr%-4)|
0001c080  0d 0e 27 04 0d 0e 28 0d  c8 8e 20 6b 65 79 25 20  |..'...(... key% |
0001c090  ca 0d 0e 29 16 20 20 c9  20 26 30 44 20 20 3a f4  |...).  . &0D  :.|
0001c0a0  20 72 65 74 75 72 6e 0d  0e 2a 28 20 20 20 20 20  | return..*(     |
0001c0b0  20 f2 73 68 65 6c 6c 5f  46 61 6b 65 4d 6f 75 73  | .shell_FakeMous|
0001c0c0  65 43 6c 69 63 6b 28 77  68 25 2c 30 2c 34 29 0d  |eClick(wh%,0,4).|
0001c0d0  0e 2b 23 20 20 c9 20 26  31 38 45 2c 33 39 34 20  |.+#  . &18E,394 |
0001c0e0  3a f4 20 63 75 72 73 6f  72 20 64 6f 77 6e 2c 54  |:. cursor down,T|
0001c0f0  41 42 0d 0e 2c 1d 20 20  20 20 e7 20 69 68 25 20  |AB..,.    . ih% |
0001c100  3d 20 6c 61 73 74 5f 77  72 69 74 65 25 20 8c 0d  |= last_write% ..|
0001c110  0e 2d 66 20 20 20 20 20  20 c8 99 20 22 57 69 6d  |.-f      .. "Wim|
0001c120  70 5f 53 65 74 43 61 72  65 74 50 6f 73 69 74 69  |p_SetCaretPositi|
0001c130  6f 6e 22 2c 77 68 25 2c  66 69 72 73 74 5f 77 72  |on",wh%,first_wr|
0001c140  69 74 65 25 2c 2d 31 2c  2d 31 2c 2d 31 2c a9 28  |ite%,-1,-1,-1,.(|
0001c150  a4 73 68 65 6c 6c 5f 49  63 6f 6e 47 65 74 44 61  |.shell_IconGetDa|
0001c160  74 61 28 77 68 25 2c 66  69 72 73 74 5f 77 72 69  |ta(wh%,first_wri|
0001c170  74 65 25 29 29 0d 0e 2e  09 20 20 20 20 cc 0d 0e  |te%))....    ...|
0001c180  2f 62 20 20 20 20 20 20  c8 99 20 22 57 69 6d 70  |/b      .. "Wimp|
0001c190  5f 53 65 74 43 61 72 65  74 50 6f 73 69 74 69 6f  |_SetCaretPositio|
0001c1a0  6e 22 2c 77 68 25 2c 6e  65 78 74 5f 69 63 6f 6e  |n",wh%,next_icon|
0001c1b0  25 2c 2d 31 2c 2d 31 2c  2d 31 2c a9 28 a4 73 68  |%,-1,-1,-1,.(.sh|
0001c1c0  65 6c 6c 5f 49 63 6f 6e  47 65 74 44 61 74 61 28  |ell_IconGetData(|
0001c1d0  77 68 25 2c 6e 65 78 74  5f 69 63 6f 6e 25 29 29  |wh%,next_icon%))|
0001c1e0  0d 0e 30 09 20 20 20 20  cd 0d 0e 31 27 20 20 c9  |..0.    ...1'  .|
0001c1f0  20 26 31 38 46 2c 34 31  30 20 3a f4 20 63 75 72  | &18F,410 :. cur|
0001c200  73 6f 72 20 75 70 2c 53  48 49 46 54 20 54 41 42  |sor up,SHIFT TAB|
0001c210  0d 0e 32 1e 20 20 20 20  e7 20 69 68 25 20 3d 20  |..2.    . ih% = |
0001c220  66 69 72 73 74 5f 77 72  69 74 65 25 20 8c 0d 0e  |first_write% ...|
0001c230  33 64 20 20 20 20 20 20  c8 99 20 22 57 69 6d 70  |3d      .. "Wimp|
0001c240  5f 53 65 74 43 61 72 65  74 50 6f 73 69 74 69 6f  |_SetCaretPositio|
0001c250  6e 22 2c 77 68 25 2c 6c  61 73 74 5f 77 72 69 74  |n",wh%,last_writ|
0001c260  65 25 2c 2d 31 2c 2d 31  2c 2d 31 2c a9 28 a4 73  |e%,-1,-1,-1,.(.s|
0001c270  68 65 6c 6c 5f 49 63 6f  6e 47 65 74 44 61 74 61  |hell_IconGetData|
0001c280  28 77 68 25 2c 6c 61 73  74 5f 77 72 69 74 65 25  |(wh%,last_write%|
0001c290  29 29 0d 0e 34 09 20 20  20 20 cc 0d 0e 35 62 20  |))..4.    ...5b |
0001c2a0  20 20 20 20 20 c8 99 20  22 57 69 6d 70 5f 53 65  |     .. "Wimp_Se|
0001c2b0  74 43 61 72 65 74 50 6f  73 69 74 69 6f 6e 22 2c  |tCaretPosition",|
0001c2c0  77 68 25 2c 70 72 65 76  5f 69 63 6f 6e 25 2c 2d  |wh%,prev_icon%,-|
0001c2d0  31 2c 2d 31 2c 2d 31 2c  a9 28 a4 73 68 65 6c 6c  |1,-1,-1,.(.shell|
0001c2e0  5f 49 63 6f 6e 47 65 74  44 61 74 61 28 77 68 25  |_IconGetData(wh%|
0001c2f0  2c 70 72 65 76 5f 69 63  6f 6e 25 29 29 0d 0e 36  |,prev_icon%))..6|
0001c300  09 20 20 20 20 cd 0d 0e  37 3b 20 20 c9 20 34 33  |.    ...7;  . 43|
0001c310  31 20 3a f4 20 43 54 52  4c 20 43 75 72 73 6f 72  |1 :. CTRL Cursor|
0001c320  20 55 70 20 28 6d 6f 76  65 20 74 6f 20 66 69 72  | Up (move to fir|
0001c330  73 74 20 77 72 69 74 61  62 6c 65 20 69 63 6f 6e  |st writable icon|
0001c340  29 0d 0e 38 64 20 20 20  20 c8 99 20 22 57 69 6d  |)..8d    .. "Wim|
0001c350  70 5f 53 65 74 43 61 72  65 74 50 6f 73 69 74 69  |p_SetCaretPositi|
0001c360  6f 6e 22 2c 77 68 25 2c  66 69 72 73 74 5f 77 72  |on",wh%,first_wr|
0001c370  69 74 65 25 2c 2d 31 2c  2d 31 2c 2d 31 2c a9 28  |ite%,-1,-1,-1,.(|
0001c380  a4 73 68 65 6c 6c 5f 49  63 6f 6e 47 65 74 44 61  |.shell_IconGetDa|
0001c390  74 61 28 77 68 25 2c 66  69 72 73 74 5f 77 72 69  |ta(wh%,first_wri|
0001c3a0  74 65 25 29 29 0d 0e 39  3c 20 20 c9 20 34 33 30  |te%))..9<  . 430|
0001c3b0  20 3a f4 20 43 54 52 4c  20 43 75 72 73 6f 72 20  | :. CTRL Cursor |
0001c3c0  44 6f 77 6e 20 28 6d 6f  76 65 20 74 6f 20 6c 61  |Down (move to la|
0001c3d0  73 74 20 77 72 69 74 61  62 6c 65 20 69 63 6f 6e  |st writable icon|
0001c3e0  29 0d 0e 3a 62 20 20 20  20 c8 99 20 22 57 69 6d  |)..:b    .. "Wim|
0001c3f0  70 5f 53 65 74 43 61 72  65 74 50 6f 73 69 74 69  |p_SetCaretPositi|
0001c400  6f 6e 22 2c 77 68 25 2c  6c 61 73 74 5f 77 72 69  |on",wh%,last_wri|
0001c410  74 65 25 2c 2d 31 2c 2d  31 2c 2d 31 2c a9 28 a4  |te%,-1,-1,-1,.(.|
0001c420  73 68 65 6c 6c 5f 49 63  6f 6e 47 65 74 44 61 74  |shell_IconGetDat|
0001c430  61 28 77 68 25 2c 6c 61  73 74 5f 77 72 69 74 65  |a(wh%,last_write|
0001c440  25 29 29 0d 0e 3b 05 cb  0d 0e 3c 26 f2 73 68 65  |%))..;....<&.she|
0001c450  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 52 65 74 75  |ll_HeapBlockRetu|
0001c460  72 6e 28 63 61 72 65 74  5f 62 6c 6b 25 29 0d 0e  |rn(caret_blk%)..|
0001c470  3d 07 3d 20 b9 0d 0e 3e  05 3a 0d 0e 3f 26 2a 7c  |=.= ...>.:..?&*||
0001c480  53 74 6f 70 20 46 4e 73  68 65 6c 6c 5f 57 72 69  |Stop FNshell_Wri|
0001c490  74 61 62 6c 65 49 63 6f  6e 48 61 6e 64 6c 65 72  |tableIconHandler|
0001c4a0  0d 0e 40 04 0d 0e 41 24  2a 7c 53 74 61 72 74 20  |..@...A$*|Start |
0001c4b0  50 52 4f 43 73 68 65 6c  6c 5f 46 61 6b 65 4d 6f  |PROCshell_FakeMo|
0001c4c0  75 73 65 43 6c 69 63 6b  0d 0e 42 2c dd 20 f2 73  |useClick..B,. .s|
0001c4d0  68 65 6c 6c 5f 46 61 6b  65 4d 6f 75 73 65 43 6c  |hell_FakeMouseCl|
0001c4e0  69 63 6b 28 77 68 25 2c  69 68 25 2c 62 75 74 74  |ick(wh%,ih%,butt|
0001c4f0  6f 6e 25 29 0d 0e 43 2a  c8 99 20 22 4f 53 5f 42  |on%)..C*.. "OS_B|
0001c500  79 74 65 22 2c 31 35 2c  31 3a f4 20 66 6c 75 73  |yte",15,1:. flus|
0001c510  68 20 69 6e 70 75 74 20  62 75 66 66 65 72 0d 0e  |h input buffer..|
0001c520  44 27 5f 51 25 21 38 3d  62 75 74 74 6f 6e 25 3a  |D'_Q%!8=button%:|
0001c530  5f 51 25 21 31 32 3d 77  68 25 3a 5f 51 25 21 31  |_Q%!12=wh%:_Q%!1|
0001c540  36 3d 69 68 25 0d 0e 45  14 f2 73 68 65 6c 6c 5f  |6=ih%..E..shell_|
0001c550  41 63 74 69 6f 6e 28 36  29 0d 0e 46 05 e1 0d 0e  |Action(6)..F....|
0001c560  47 05 3a 0d 0e 48 23 2a  7c 53 74 6f 70 20 50 52  |G.:..H#*|Stop PR|
0001c570  4f 43 73 68 65 6c 6c 5f  46 61 6b 65 4d 6f 75 73  |OCshell_FakeMous|
0001c580  65 43 6c 69 63 6b 0d 0e  49 1e 2a 7c 53 74 61 72  |eClick..I.*|Star|
0001c590  74 20 46 4e 73 68 65 6c  6c 5f 49 63 6f 6e 43 72  |t FNshell_IconCr|
0001c5a0  65 61 74 65 0d 0e 4a 58  dd 20 a4 73 68 65 6c 6c  |eate..JX. .shell|
0001c5b0  5f 49 63 6f 6e 43 72 65  61 74 65 28 77 68 25 2c  |_IconCreate(wh%,|
0001c5c0  6d 69 6e 78 25 2c 6d 69  6e 79 25 2c 77 25 2c 68  |minx%,miny%,w%,h|
0001c5d0  25 2c 66 67 25 2c 62 67  25 2c 66 6c 67 25 2c 64  |%,fg%,bg%,flg%,d|
0001c5e0  61 74 61 24 2c 61 64 64  72 25 2c 6c 65 6e 25 2c  |ata$,addr%,len%,|
0001c5f0  76 61 6c 69 64 61 74 69  6f 6e 24 29 0d 0e 4b 21  |validation$)..K!|
0001c600  ea 20 69 25 2c 68 61 6e  64 6c 65 25 2c 76 61 6c  |. i%,handle%,val|
0001c610  69 64 25 2c 69 63 6f 6e  5f 62 6c 6b 25 0d 0e 4c  |id%,icon_blk%..L|
0001c620  27 69 63 6f 6e 5f 62 6c  6b 25 3d a4 73 68 65 6c  |'icon_blk%=.shel|
0001c630  6c 5f 48 65 61 70 42 6c  6f 63 6b 46 65 74 63 68  |l_HeapBlockFetch|
0001c640  28 34 30 29 0d 0e 4d 13  69 63 6f 6e 5f 62 6c 6b  |(40)..M.icon_blk|
0001c650  25 21 30 3d 77 68 25 0d  0e 4e 27 69 63 6f 6e 5f  |%!0=wh%..N'icon_|
0001c660  62 6c 6b 25 21 34 3d 6d  69 6e 78 25 3a 69 63 6f  |blk%!4=minx%:ico|
0001c670  6e 5f 62 6c 6b 25 21 38  3d 6d 69 6e 79 25 0d 0e  |n_blk%!8=miny%..|
0001c680  4f 2f 69 63 6f 6e 5f 62  6c 6b 25 21 31 32 3d 6d  |O/icon_blk%!12=m|
0001c690  69 6e 78 25 2b 77 25 3a  69 63 6f 6e 5f 62 6c 6b  |inx%+w%:icon_blk|
0001c6a0  25 21 31 36 3d 6d 69 6e  79 25 2b 68 25 0d 0e 50  |%!16=miny%+h%..P|
0001c6b0  29 69 63 6f 6e 5f 62 6c  6b 25 21 32 30 3d 66 6c  |)icon_blk%!20=fl|
0001c6c0  67 25 20 84 20 62 67 25  3c 3c 32 38 20 84 20 66  |g% . bg%<<28 . f|
0001c6d0  67 25 3c 3c 32 34 0d 0e  51 1b e7 20 69 63 6f 6e  |g%<<24..Q.. icon|
0001c6e0  5f 62 6c 6b 25 21 32 30  20 80 20 26 31 30 30 20  |_blk%!20 . &100 |
0001c6f0  8c 0d 0e 52 14 20 20 69  25 3d a7 64 61 74 61 24  |...R.  i%=.data$|
0001c700  2c 22 2c 22 29 0d 0e 53  18 20 20 69 63 6f 6e 5f  |,",")..S.  icon_|
0001c710  62 6c 6b 25 21 32 34 3d  61 64 64 72 25 0d 0e 54  |blk%!24=addr%..T|
0001c720  19 20 20 e7 20 76 61 6c  69 64 61 74 69 6f 6e 24  |.  . validation$|
0001c730  3c 3e 22 22 20 8c 0d 0e  55 34 20 20 20 20 76 61  |<>"" ...U4    va|
0001c740  6c 69 64 25 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |lid%=.shell_Heap|
0001c750  42 6c 6f 63 6b 46 65 74  63 68 28 a9 76 61 6c 69  |BlockFetch(.vali|
0001c760  64 61 74 69 6f 6e 24 2b  31 29 0d 0e 56 1b 20 20  |dation$+1)..V.  |
0001c770  20 20 24 76 61 6c 69 64  25 3d 76 61 6c 69 64 61  |  $valid%=valida|
0001c780  74 69 6f 6e 24 0d 0e 57  1b 20 20 20 20 69 63 6f  |tion$..W.    ico|
0001c790  6e 5f 62 6c 6b 25 21 32  38 3d 76 61 6c 69 64 25  |n_blk%!28=valid%|
0001c7a0  0d 0e 58 07 20 20 cc 0d  0e 59 17 20 20 20 20 69  |..X.  ...Y.    i|
0001c7b0  63 6f 6e 5f 62 6c 6b 25  21 32 38 3d 2d 31 0d 0e  |con_blk%!28=-1..|
0001c7c0  5a 07 20 20 cd 0d 0e 5b  17 20 20 69 63 6f 6e 5f  |Z.  ...[.  icon_|
0001c7d0  62 6c 6b 25 21 33 32 3d  6c 65 6e 25 0d 0e 5c 05  |blk%!32=len%..\.|
0001c7e0  cc 0d 0e 5d 20 20 20 24  28 69 63 6f 6e 5f 62 6c  |...]   $(icon_bl|
0001c7f0  6b 25 2b 32 34 29 3d c0  64 61 74 61 24 2c 31 31  |k%+24)=.data$,11|
0001c800  29 0d 0e 5e 05 cd 0d 0e  5f 2d c8 99 20 22 57 69  |)..^...._-.. "Wi|
0001c810  6d 70 5f 43 72 65 61 74  65 49 63 6f 6e 22 2c 2c  |mp_CreateIcon",,|
0001c820  69 63 6f 6e 5f 62 6c 6b  25 20 b8 20 68 61 6e 64  |icon_blk% . hand|
0001c830  6c 65 25 0d 0e 60 25 f2  73 68 65 6c 6c 5f 48 65  |le%..`%.shell_He|
0001c840  61 70 42 6c 6f 63 6b 52  65 74 75 72 6e 28 69 63  |apBlockReturn(ic|
0001c850  6f 6e 5f 62 6c 6b 25 29  0d 0e 61 0c 3d 68 61 6e  |on_blk%)..a.=han|
0001c860  64 6c 65 25 0d 0e 62 05  3a 0d 0e 63 1d 2a 7c 53  |dle%..b.:..c.*|S|
0001c870  74 6f 70 20 46 4e 73 68  65 6c 6c 5f 49 63 6f 6e  |top FNshell_Icon|
0001c880  43 72 65 61 74 65 0d 0e  64 20 2a 7c 53 74 61 72  |Create..d *|Star|
0001c890  74 20 50 52 4f 43 73 68  65 6c 6c 5f 49 63 6f 6e  |t PROCshell_Icon|
0001c8a0  44 65 6c 65 74 65 0d 0e  65 20 dd 20 f2 73 68 65  |Delete..e . .she|
0001c8b0  6c 6c 5f 49 63 6f 6e 44  65 6c 65 74 65 28 77 68  |ll_IconDelete(wh|
0001c8c0  25 2c 69 68 25 29 0d 0e  66 22 f2 73 68 65 6c 6c  |%,ih%)..f".shell|
0001c8d0  5f 44 6f 49 63 6f 6e 44  65 6c 65 74 65 28 77 68  |_DoIconDelete(wh|
0001c8e0  25 2c 69 68 25 2c a3 29  0d 0e 67 05 e1 0d 0e 68  |%,ih%,.)..g....h|
0001c8f0  05 3a 0d 0e 69 1f 2a 7c  53 74 6f 70 20 50 52 4f  |.:..i.*|Stop PRO|
0001c900  43 73 68 65 6c 6c 5f 49  63 6f 6e 44 65 6c 65 74  |Cshell_IconDelet|
0001c910  65 0d 0e 6a 21 2a 7c 53  74 61 72 74 20 50 52 4f  |e..j!*|Start PRO|
0001c920  43 73 68 65 6c 6c 5f 49  63 6f 6e 44 65 6c 65 74  |Cshell_IconDelet|
0001c930  65 32 0d 0e 6b 21 dd 20  f2 73 68 65 6c 6c 5f 49  |e2..k!. .shell_I|
0001c940  63 6f 6e 44 65 6c 65 74  65 32 28 77 68 25 2c 69  |conDelete2(wh%,i|
0001c950  68 25 29 0d 0e 6c 22 f2  73 68 65 6c 6c 5f 44 6f  |h%)..l".shell_Do|
0001c960  49 63 6f 6e 44 65 6c 65  74 65 28 77 68 25 2c 69  |IconDelete(wh%,i|
0001c970  68 25 2c b9 29 0d 0e 6d  05 e1 0d 0e 6e 05 3a 0d  |h%,.)..m....n.:.|
0001c980  0e 6f 20 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |.o *|Stop PROCsh|
0001c990  65 6c 6c 5f 49 63 6f 6e  44 65 6c 65 74 65 32 0d  |ell_IconDelete2.|
0001c9a0  0e 70 22 2a 7c 53 74 61  72 74 20 50 52 4f 43 73  |.p"*|Start PROCs|
0001c9b0  68 65 6c 6c 5f 44 6f 49  63 6f 6e 44 65 6c 65 74  |hell_DoIconDelet|
0001c9c0  65 0d 0e 71 2a dd 20 f2  73 68 65 6c 6c 5f 44 6f  |e..q*. .shell_Do|
0001c9d0  49 63 6f 6e 44 65 6c 65  74 65 28 77 68 25 2c 69  |IconDelete(wh%,i|
0001c9e0  68 25 2c 72 65 64 72 61  77 25 29 0d 0e 72 1a ea  |h%,redraw%)..r..|
0001c9f0  20 62 6c 6b 25 2c 78 30  25 2c 79 30 25 2c 78 31  | blk%,x0%,y0%,x1|
0001ca00  25 2c 79 31 25 0d 0e 73  22 62 6c 6b 25 3d a4 73  |%,y1%..s"blk%=.s|
0001ca10  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 46 65  |hell_HeapBlockFe|
0001ca20  74 63 68 28 34 30 29 0d  0e 74 19 62 6c 6b 25 21  |tch(40)..t.blk%!|
0001ca30  30 3d 77 68 25 3a 62 6c  6b 25 21 34 3d 69 68 25  |0=wh%:blk%!4=ih%|
0001ca40  0d 0e 75 20 c8 99 20 22  57 69 6d 70 5f 47 65 74  |..u .. "Wimp_Get|
0001ca50  49 63 6f 6e 53 74 61 74  65 22 2c 2c 62 6c 6b 25  |IconState",,blk%|
0001ca60  0d 0e 76 26 c8 99 20 22  49 6e 74 65 72 66 61 63  |..v&.. "Interfac|
0001ca70  65 5f 42 6f 75 6e 64 69  6e 67 42 6f 78 22 2c 2c  |e_BoundingBox",,|
0001ca80  62 6c 6b 25 2b 38 0d 0e  77 32 78 30 25 3d 62 6c  |blk%+8..w2x0%=bl|
0001ca90  6b 25 21 38 3a 79 30 25  3d 62 6c 6b 25 21 31 32  |k%!8:y0%=blk%!12|
0001caa0  3a 78 31 25 3d 62 6c 6b  25 21 31 36 3a 79 31 25  |:x1%=blk%!16:y1%|
0001cab0  3d 62 6c 6b 25 21 32 30  0d 0e 78 20 c8 99 20 22  |=blk%!20..x .. "|
0001cac0  57 69 6d 70 5f 47 65 74  49 63 6f 6e 53 74 61 74  |Wimp_GetIconStat|
0001cad0  65 22 2c 2c 62 6c 6b 25  0d 0e 79 47 e7 20 a4 73  |e",,blk%..yG. .s|
0001cae0  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 45 78  |hell_HeapBlockEx|
0001caf0  69 73 74 73 28 62 6c 6b  25 21 32 38 29 20 8c 20  |ists(blk%!28) . |
0001cb00  f2 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
0001cb10  52 65 74 75 72 6e 28 62  6c 6b 25 21 32 38 29 0d  |Return(blk%!28).|
0001cb20  0e 7a 47 e7 20 a4 73 68  65 6c 6c 5f 48 65 61 70  |.zG. .shell_Heap|
0001cb30  42 6c 6f 63 6b 45 78 69  73 74 73 28 62 6c 6b 25  |BlockExists(blk%|
0001cb40  21 33 32 29 20 8c 20 f2  73 68 65 6c 6c 5f 48 65  |!32) . .shell_He|
0001cb50  61 70 42 6c 6f 63 6b 52  65 74 75 72 6e 28 62 6c  |apBlockReturn(bl|
0001cb60  6b 25 21 33 32 29 0d 0e  7b 1e c8 99 20 22 57 69  |k%!32)..{... "Wi|
0001cb70  6d 70 5f 44 65 6c 65 74  65 49 63 6f 6e 22 2c 2c  |mp_DeleteIcon",,|
0001cb80  62 6c 6b 25 0d 0e 7c 0f  e7 20 72 65 64 72 61 77  |blk%..|.. redraw|
0001cb90  25 20 8c 0d 0e 7d 2f 20  20 c8 99 20 22 57 69 6d  |% ...}/  .. "Wim|
0001cba0  70 5f 46 6f 72 63 65 52  65 64 72 61 77 22 2c 77  |p_ForceRedraw",w|
0001cbb0  68 25 2c 78 30 25 2c 79  30 25 2c 78 31 25 2c 79  |h%,x0%,y0%,x1%,y|
0001cbc0  31 25 0d 0e 7e 05 cd 0d  0e 7f 20 f2 73 68 65 6c  |1%..~..... .shel|
0001cbd0  6c 5f 48 65 61 70 42 6c  6f 63 6b 52 65 74 75 72  |l_HeapBlockRetur|
0001cbe0  6e 28 62 6c 6b 25 29 0d  0e 80 05 e1 0d 0e 81 05  |n(blk%).........|
0001cbf0  3a 0d 0e 82 21 2a 7c 53  74 6f 70 20 50 52 4f 43  |:...!*|Stop PROC|
0001cc00  73 68 65 6c 6c 5f 44 6f  49 63 6f 6e 44 65 6c 65  |shell_DoIconDele|
0001cc10  74 65 0d 0e 83 04 0d 0e  84 21 2a 7c 53 74 61 72  |te.......!*|Star|
0001cc20  74 20 50 52 4f 43 73 68  65 6c 6c 5f 49 63 6f 6e  |t PROCshell_Icon|
0001cc30  50 75 74 44 61 74 61 0d  0e 85 38 dd 20 f2 73 68  |PutData...8. .sh|
0001cc40  65 6c 6c 5f 49 63 6f 6e  50 75 74 44 61 74 61 28  |ell_IconPutData(|
0001cc50  77 68 61 6e 64 6c 65 25  2c 69 68 61 6e 64 6c 65  |whandle%,ihandle|
0001cc60  25 2c 64 61 74 61 24 2c  72 65 64 72 61 77 29 0d  |%,data$,redraw).|
0001cc70  0e 86 13 ea 20 62 6c 6b  25 2c 6f 6c 64 5f 73 74  |.... blk%,old_st|
0001cc80  72 24 0d 0e 87 34 6f 6c  64 5f 73 74 72 24 20 3d  |r$...4old_str$ =|
0001cc90  20 a4 73 68 65 6c 6c 5f  49 63 6f 6e 47 65 74 44  | .shell_IconGetD|
0001cca0  61 74 61 28 77 68 61 6e  64 6c 65 25 2c 69 68 61  |ata(whandle%,iha|
0001ccb0  6e 64 6c 65 25 29 0d 0e  88 19 e7 20 64 61 74 61  |ndle%)..... data|
0001ccc0  24 20 3c 3e 20 6f 6c 64  5f 73 74 72 24 20 8c 0d  |$ <> old_str$ ..|
0001ccd0  0e 89 24 20 20 62 6c 6b  25 3d a4 73 68 65 6c 6c  |..$  blk%=.shell|
0001cce0  5f 48 65 61 70 42 6c 6f  63 6b 46 65 74 63 68 28  |_HeapBlockFetch(|
0001ccf0  34 30 29 0d 0e 8a 17 20  20 62 6c 6b 25 21 30 20  |40)....  blk%!0 |
0001cd00  3d 20 77 68 61 6e 64 6c  65 25 0d 0e 8b 17 20 20  |= whandle%....  |
0001cd10  62 6c 6b 25 21 34 20 3d  20 69 68 61 6e 64 6c 65  |blk%!4 = ihandle|
0001cd20  25 0d 0e 8c 22 20 20 c8  99 20 22 57 69 6d 70 5f  |%..."  .. "Wimp_|
0001cd30  47 65 74 49 63 6f 6e 53  74 61 74 65 22 2c 2c 62  |GetIconState",,b|
0001cd40  6c 6b 25 0d 0e 8d 21 20  20 e7 20 28 62 6c 6b 25  |lk%...!  . (blk%|
0001cd50  21 32 34 20 80 20 28 31  3c 3c 38 29 29 20 3c 3e  |!24 . (1<<8)) <>|
0001cd60  20 30 20 8c 0d 0e 8e 44  20 20 20 20 e7 20 a9 64  | 0 ....D    . .d|
0001cd70  61 74 61 24 20 3e 20 62  6c 6b 25 21 33 36 20 8c  |ata$ > blk%!36 .|
0001cd80  20 85 20 39 39 2c a4 73  68 65 6c 6c 5f 4d 65 73  | . 99,.shell_Mes|
0001cd90  73 61 67 65 4e 6f 41 72  67 73 28 22 53 48 45 4c  |sageNoArgs("SHEL|
0001cda0  4c 4d 53 47 31 32 22 29  0d 0e 8f 1a 20 20 20 20  |LMSG12")....    |
0001cdb0  24 28 62 6c 6b 25 21 32  38 29 20 3d 20 64 61 74  |$(blk%!28) = dat|
0001cdc0  61 24 0d 0e 90 07 20 20  cc 0d 0e 91 21 20 20 20  |a$....  ....!   |
0001cdd0  20 24 28 62 6c 6b 25 20  2b 20 32 38 29 20 3d 20  | $(blk% + 28) = |
0001cde0  c0 64 61 74 61 24 2c 31  31 29 0d 0e 92 07 20 20  |.data$,11)....  |
0001cdf0  cd 0d 0e 93 15 20 20 e7  20 72 65 64 72 61 77 20  |.....  . redraw |
0001ce00  3c 3e 20 30 20 8c 0d 0e  94 1e 20 20 20 20 62 6c  |<> 0 .....    bl|
0001ce10  6b 25 21 38 20 3d 20 30  3a 62 6c 6b 25 21 31 32  |k%!8 = 0:blk%!12|
0001ce20  20 3d 20 30 0d 0e 95 24  20 20 20 20 c8 99 20 22  | = 0...$    .. "|
0001ce30  57 69 6d 70 5f 53 65 74  49 63 6f 6e 53 74 61 74  |Wimp_SetIconStat|
0001ce40  65 22 2c 2c 62 6c 6b 25  0d 0e 96 07 20 20 cd 0d  |e",,blk%....  ..|
0001ce50  0e 97 22 20 20 f2 73 68  65 6c 6c 5f 48 65 61 70  |.."  .shell_Heap|
0001ce60  42 6c 6f 63 6b 52 65 74  75 72 6e 28 62 6c 6b 25  |BlockReturn(blk%|
0001ce70  29 0d 0e 98 05 cd 0d 0e  99 05 e1 0d 0e 9a 05 3a  |)..............:|
0001ce80  0d 0e 9b 20 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |... *|Stop PROCs|
0001ce90  68 65 6c 6c 5f 49 63 6f  6e 50 75 74 44 61 74 61  |hell_IconPutData|
0001cea0  0d 0e 9c 04 0d 0e 9d 24  2a 7c 53 74 61 72 74 20  |.......$*|Start |
0001ceb0  50 52 4f 43 73 68 65 6c  6c 5f 49 63 6f 6e 50 75  |PROCshell_IconPu|
0001cec0  74 44 61 74 61 4e 6f 77  0d 0e 9e 34 dd 20 f2 73  |tDataNow...4. .s|
0001ced0  68 65 6c 6c 5f 49 63 6f  6e 50 75 74 44 61 74 61  |hell_IconPutData|
0001cee0  4e 6f 77 28 77 68 61 6e  64 6c 65 25 2c 69 68 61  |Now(whandle%,iha|
0001cef0  6e 64 6c 65 25 2c 64 61  74 61 24 29 0d 0e 9f 0a  |ndle%,data$)....|
0001cf00  ea 20 62 6c 6b 25 0d 0e  a0 23 62 6c 6b 25 3d a4  |. blk%...#blk%=.|
0001cf10  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
0001cf20  65 74 63 68 28 35 30 29  20 0d 0e a1 13 62 6c 6b  |etch(50) ....blk|
0001cf30  25 21 30 3d 77 68 61 6e  64 6c 65 25 0d 0e a2 13  |%!0=whandle%....|
0001cf40  62 6c 6b 25 21 34 3d 69  68 61 6e 64 6c 65 25 0d  |blk%!4=ihandle%.|
0001cf50  0e a3 20 c8 99 20 22 57  69 6d 70 5f 47 65 74 49  |.. .. "Wimp_GetI|
0001cf60  63 6f 6e 53 74 61 74 65  22 2c 2c 62 6c 6b 25 0d  |conState",,blk%.|
0001cf70  0e a4 1d e7 20 28 62 6c  6b 25 21 32 34 20 80 20  |.... (blk%!24 . |
0001cf80  28 31 3c 3c 38 29 29 3c  3e 30 20 8c 0d 0e a5 40  |(1<<8))<>0 ....@|
0001cf90  20 20 e7 20 a9 64 61 74  61 24 3e 62 6c 6b 25 21  |  . .data$>blk%!|
0001cfa0  33 36 20 8c 20 85 20 39  39 2c a4 73 68 65 6c 6c  |36 . . 99,.shell|
0001cfb0  5f 4d 65 73 73 61 67 65  4e 6f 41 72 67 73 28 22  |_MessageNoArgs("|
0001cfc0  53 48 45 4c 4c 4d 53 47  31 32 22 29 0d 0e a6 16  |SHELLMSG12")....|
0001cfd0  20 20 24 28 62 6c 6b 25  21 32 38 29 3d 64 61 74  |  $(blk%!28)=dat|
0001cfe0  61 24 0d 0e a7 05 cc 0d  0e a8 1b 20 20 24 28 62  |a$.........  $(b|
0001cff0  6c 6b 25 2b 32 38 29 3d  c0 64 61 74 61 24 2c 31  |lk%+28)=.data$,1|
0001d000  31 29 0d 0e a9 05 cd 0d  0e aa 16 62 6c 6b 25 21  |1).........blk%!|
0001d010  38 3d 30 3a 62 6c 6b 25  21 31 32 3d 30 0d 0e ab  |8=0:blk%!12=0...|
0001d020  20 c8 99 20 22 57 69 6d  70 5f 53 65 74 49 63 6f  | .. "Wimp_SetIco|
0001d030  6e 53 74 61 74 65 22 2c  2c 62 6c 6b 25 0d 0e ac  |nState",,blk%...|
0001d040  43 f4 20 43 61 6c 6c 20  77 69 6d 70 20 70 6f 6c  |C. Call wimp pol|
0001d050  6c 20 69 6d 6d 65 64 69  61 74 65 6c 79 20 69 6e  |l immediately in|
0001d060  20 63 61 73 65 20 74 68  65 20 75 73 65 72 20 70  | case the user p|
0001d070  72 6f 67 72 61 6d 20 64  6f 65 73 6e 27 74 2e 2e  |rogram doesn't..|
0001d080  0d 0e ad 15 f2 73 68 65  6c 6c 5f 45 6e 73 75 72  |.....shell_Ensur|
0001d090  65 50 6f 6c 6c 0d 0e ae  20 f2 73 68 65 6c 6c 5f  |ePoll... .shell_|
0001d0a0  48 65 61 70 42 6c 6f 63  6b 52 65 74 75 72 6e 28  |HeapBlockReturn(|
0001d0b0  62 6c 6b 25 29 0d 0e af  06 e1 20 0d 0e b0 23 2a  |blk%)..... ...#*|
0001d0c0  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
0001d0d0  49 63 6f 6e 50 75 74 44  61 74 61 4e 6f 77 0d 0e  |IconPutDataNow..|
0001d0e0  b1 04 0d 0e b2 21 2a 7c  53 74 61 72 74 20 46 4e  |.....!*|Start FN|
0001d0f0  73 68 65 6c 6c 5f 49 63  6f 6e 4e 65 77 53 70 72  |shell_IconNewSpr|
0001d100  69 74 65 0d 0e b3 3d dd  20 a4 73 68 65 6c 6c 5f  |ite...=. .shell_|
0001d110  49 63 6f 6e 4e 65 77 53  70 72 69 74 65 28 77 68  |IconNewSprite(wh|
0001d120  61 6e 64 6c 65 25 2c 69  68 61 6e 64 6c 65 25 2c  |andle%,ihandle%,|
0001d130  6e 65 77 6e 61 6d 65 24  2c 72 65 64 72 61 77 29  |newname$,redraw)|
0001d140  0d 0e b4 0f ea 20 69 63  6f 6e 5f 62 6c 6b 25 0d  |..... icon_blk%.|
0001d150  0e b5 27 69 63 6f 6e 5f  62 6c 6b 25 3d a4 73 68  |..'icon_blk%=.sh|
0001d160  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
0001d170  63 68 28 34 30 29 0d 0e  b6 2d 69 63 6f 6e 5f 62  |ch(40)...-icon_b|
0001d180  6c 6b 25 21 30 3d 77 68  61 6e 64 6c 65 25 3a 69  |lk%!0=whandle%:i|
0001d190  63 6f 6e 5f 62 6c 6b 25  21 34 3d 69 68 61 6e 64  |con_blk%!4=ihand|
0001d1a0  6c 65 25 0d 0e b7 25 c8  99 20 22 57 69 6d 70 5f  |le%...%.. "Wimp_|
0001d1b0  47 65 74 49 63 6f 6e 53  74 61 74 65 22 2c 2c 69  |GetIconState",,i|
0001d1c0  63 6f 6e 5f 62 6c 6b 25  0d 0e b8 23 c8 99 20 22  |con_blk%...#.. "|
0001d1d0  57 69 6d 70 5f 44 65 6c  65 74 65 49 63 6f 6e 22  |Wimp_DeleteIcon"|
0001d1e0  2c 2c 69 63 6f 6e 5f 62  6c 6b 25 0d 0e b9 4e 69  |,,icon_blk%...Ni|
0001d1f0  63 6f 6e 5f 62 6c 6b 25  21 34 3d 69 63 6f 6e 5f  |con_blk%!4=icon_|
0001d200  62 6c 6b 25 21 38 3a 69  63 6f 6e 5f 62 6c 6b 25  |blk%!8:icon_blk%|
0001d210  21 38 3d 69 63 6f 6e 5f  62 6c 6b 25 21 31 32 3a  |!8=icon_blk%!12:|
0001d220  69 63 6f 6e 5f 62 6c 6b  25 21 31 32 3d 69 63 6f  |icon_blk%!12=ico|
0001d230  6e 5f 62 6c 6b 25 21 31  36 0d 0e ba 50 69 63 6f  |n_blk%!16...Pico|
0001d240  6e 5f 62 6c 6b 25 21 31  36 3d 69 63 6f 6e 5f 62  |n_blk%!16=icon_b|
0001d250  6c 6b 25 21 32 30 3a 69  63 6f 6e 5f 62 6c 6b 25  |lk%!20:icon_blk%|
0001d260  21 32 30 3d 69 63 6f 6e  5f 62 6c 6b 25 21 32 34  |!20=icon_blk%!24|
0001d270  3a 24 28 69 63 6f 6e 5f  62 6c 6b 25 2b 32 34 29  |:$(icon_blk%+24)|
0001d280  3d 6e 65 77 6e 61 6d 65  24 0d 0e bb 2e c8 99 20  |=newname$...... |
0001d290  22 57 69 6d 70 5f 43 72  65 61 74 65 49 63 6f 6e  |"Wimp_CreateIcon|
0001d2a0  22 2c 2c 69 63 6f 6e 5f  62 6c 6b 25 20 b8 20 69  |",,icon_blk% . i|
0001d2b0  68 61 6e 64 6c 65 25 0d  0e bc 62 e7 20 72 65 64  |handle%...b. red|
0001d2c0  72 61 77 20 8c 20 c8 99  20 22 57 69 6d 70 5f 46  |raw . .. "Wimp_F|
0001d2d0  6f 72 63 65 52 65 64 72  61 77 22 2c 69 63 6f 6e  |orceRedraw",icon|
0001d2e0  5f 62 6c 6b 25 21 30 2c  69 63 6f 6e 5f 62 6c 6b  |_blk%!0,icon_blk|
0001d2f0  25 21 34 2c 69 63 6f 6e  5f 62 6c 6b 25 21 38 2c  |%!4,icon_blk%!8,|
0001d300  69 63 6f 6e 5f 62 6c 6b  25 21 31 32 2c 69 63 6f  |icon_blk%!12,ico|
0001d310  6e 5f 62 6c 6b 25 21 31  36 0d 0e bd 25 f2 73 68  |n_blk%!16...%.sh|
0001d320  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 52 65 74  |ell_HeapBlockRet|
0001d330  75 72 6e 28 69 63 6f 6e  5f 62 6c 6b 25 29 0d 0e  |urn(icon_blk%)..|
0001d340  be 0d 3d 69 68 61 6e 64  6c 65 25 0d 0e bf 05 3a  |..=ihandle%....:|
0001d350  0d 0e c0 20 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |... *|Stop FNshe|
0001d360  6c 6c 5f 49 63 6f 6e 4e  65 77 53 70 72 69 74 65  |ll_IconNewSprite|
0001d370  0d 0e c1 04 0d 0e c2 1f  2a 7c 53 74 61 72 74 20  |........*|Start |
0001d380  46 4e 73 68 65 6c 6c 5f  49 63 6f 6e 47 65 74 44  |FNshell_IconGetD|
0001d390  61 74 61 0d 0e c3 2b dd  20 a4 73 68 65 6c 6c 5f  |ata...+. .shell_|
0001d3a0  49 63 6f 6e 47 65 74 44  61 74 61 28 77 68 61 6e  |IconGetData(whan|
0001d3b0  64 6c 65 25 2c 69 68 61  6e 64 6c 65 25 29 0d 0e  |dle%,ihandle%)..|
0001d3c0  c4 17 ea 20 72 65 73 75  6c 74 24 2c 69 63 6f 6e  |... result$,icon|
0001d3d0  5f 62 6c 6b 25 0d 0e c5  27 69 63 6f 6e 5f 62 6c  |_blk%...'icon_bl|
0001d3e0  6b 25 3d a4 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |k%=.shell_HeapBl|
0001d3f0  6f 63 6b 46 65 74 63 68  28 34 30 29 0d 0e c6 18  |ockFetch(40)....|
0001d400  69 63 6f 6e 5f 62 6c 6b  25 21 30 3d 77 68 61 6e  |icon_blk%!0=whan|
0001d410  64 6c 65 25 0d 0e c7 18  69 63 6f 6e 5f 62 6c 6b  |dle%....icon_blk|
0001d420  25 21 34 3d 69 68 61 6e  64 6c 65 25 0d 0e c8 25  |%!4=ihandle%...%|
0001d430  c8 99 20 22 57 69 6d 70  5f 47 65 74 49 63 6f 6e  |.. "Wimp_GetIcon|
0001d440  53 74 61 74 65 22 2c 2c  69 63 6f 6e 5f 62 6c 6b  |State",,icon_blk|
0001d450  25 0d 0e c9 54 e7 20 28  69 63 6f 6e 5f 62 6c 6b  |%...T. (icon_blk|
0001d460  25 21 32 34 20 80 20 28  31 3c 3c 38 29 29 3c 3e  |%!24 . (1<<8))<>|
0001d470  30 20 8c 20 72 65 73 75  6c 74 24 3d 24 28 69 63  |0 . result$=$(ic|
0001d480  6f 6e 5f 62 6c 6b 25 21  32 38 29 20 8b 20 72 65  |on_blk%!28) . re|
0001d490  73 75 6c 74 24 3d 24 28  69 63 6f 6e 5f 62 6c 6b  |sult$=$(icon_blk|
0001d4a0  25 2b 32 38 29 0d 0e ca  25 f2 73 68 65 6c 6c 5f  |%+28)...%.shell_|
0001d4b0  48 65 61 70 42 6c 6f 63  6b 52 65 74 75 72 6e 28  |HeapBlockReturn(|
0001d4c0  69 63 6f 6e 5f 62 6c 6b  25 29 0d 0e cb 0c 3d 72  |icon_blk%)....=r|
0001d4d0  65 73 75 6c 74 24 0d 0e  cc 05 3a 0d 0e cd 1e 2a  |esult$....:....*|
0001d4e0  7c 53 74 6f 70 20 46 4e  73 68 65 6c 6c 5f 49 63  ||Stop FNshell_Ic|
0001d4f0  6f 6e 47 65 74 44 61 74  61 0d 0e ce 04 0d 0e cf  |onGetData.......|
0001d500  1d 2a 7c 53 74 61 72 74  20 46 4e 73 68 65 6c 6c  |.*|Start FNshell|
0001d510  5f 49 63 6f 6e 4d 6f 76  65 32 0d 0e d0 29 dd 20  |_IconMove2...). |
0001d520  a4 73 68 65 6c 6c 5f 49  63 6f 6e 4d 6f 76 65 32  |.shell_IconMove2|
0001d530  28 77 68 25 2c 69 68 25  2c 64 5f 78 25 2c 64 5f  |(wh%,ih%,d_x%,d_|
0001d540  79 25 29 0d 0e d1 0c ea  20 6d 5f 62 6c 6b 25 0d  |y%)..... m_blk%.|
0001d550  0e d2 24 6d 5f 62 6c 6b  25 3d a4 73 68 65 6c 6c  |..$m_blk%=.shell|
0001d560  5f 48 65 61 70 42 6c 6f  63 6b 46 65 74 63 68 28  |_HeapBlockFetch(|
0001d570  34 30 29 0d 0e d3 1c 21  6d 5f 62 6c 6b 25 3d 77  |40)....!m_blk%=w|
0001d580  68 25 3a 6d 5f 62 6c 6b  25 21 34 3d 69 68 25 0d  |h%:m_blk%!4=ih%.|
0001d590  0e d4 22 c8 99 20 22 57  69 6d 70 5f 47 65 74 49  |..".. "Wimp_GetI|
0001d5a0  63 6f 6e 53 74 61 74 65  22 2c 2c 6d 5f 62 6c 6b  |conState",,m_blk|
0001d5b0  25 0d 0e d5 22 6d 5f 62  6c 6b 25 21 38 2b 3d 64  |%..."m_blk%!8+=d|
0001d5c0  5f 78 25 3a 6d 5f 62 6c  6b 25 21 31 36 2b 3d 64  |_x%:m_blk%!16+=d|
0001d5d0  5f 78 25 0d 0e d6 23 6d  5f 62 6c 6b 25 21 31 32  |_x%...#m_blk%!12|
0001d5e0  2b 3d 64 5f 79 25 3a 6d  5f 62 6c 6b 25 21 32 30  |+=d_y%:m_blk%!20|
0001d5f0  2b 3d 64 5f 79 25 0d 0e  d7 47 69 68 25 3d a4 73  |+=d_y%...Gih%=.s|
0001d600  68 65 6c 6c 5f 49 63 6f  6e 4d 6f 76 65 28 77 68  |hell_IconMove(wh|
0001d610  25 2c 69 68 25 2c 6d 5f  62 6c 6b 25 21 38 2c 6d  |%,ih%,m_blk%!8,m|
0001d620  5f 62 6c 6b 25 21 31 32  2c 6d 5f 62 6c 6b 25 21  |_blk%!12,m_blk%!|
0001d630  31 36 2c 6d 5f 62 6c 6b  25 21 32 30 29 0d 0e d8  |16,m_blk%!20)...|
0001d640  22 f2 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |".shell_HeapBloc|
0001d650  6b 52 65 74 75 72 6e 28  6d 5f 62 6c 6b 25 29 0d  |kReturn(m_blk%).|
0001d660  0e d9 08 3d 69 68 25 0d  0e da 05 3a 0d 0e db 1c  |...=ih%....:....|
0001d670  2a 7c 53 74 6f 70 20 46  4e 73 68 65 6c 6c 5f 49  |*|Stop FNshell_I|
0001d680  63 6f 6e 4d 6f 76 65 32  0d 0e dc 1e 2a 7c 53 74  |conMove2....*|St|
0001d690  61 72 74 20 46 4e 73 68  65 6c 6c 5f 49 63 6f 6e  |art FNshell_Icon|
0001d6a0  52 65 73 69 7a 65 0d 0e  dd 30 dd 20 a4 73 68 65  |Resize...0. .she|
0001d6b0  6c 6c 5f 49 63 6f 6e 52  65 73 69 7a 65 28 77 68  |ll_IconResize(wh|
0001d6c0  25 2c 69 68 25 2c 78 30  25 2c 79 30 25 2c 78 31  |%,ih%,x0%,y0%,x1|
0001d6d0  25 2c 79 31 25 29 0d 0e  de 2d 3d a4 73 68 65 6c  |%,y1%)...-=.shel|
0001d6e0  6c 5f 49 63 6f 6e 4d 6f  76 65 28 77 68 25 2c 69  |l_IconMove(wh%,i|
0001d6f0  68 25 2c 78 30 25 2c 79  30 25 2c 78 31 25 2c 79  |h%,x0%,y0%,x1%,y|
0001d700  31 25 29 0d 0e df 05 3a  0d 0e e0 1d 2a 7c 53 74  |1%)....:....*|St|
0001d710  6f 70 20 46 4e 73 68 65  6c 6c 5f 49 63 6f 6e 52  |op FNshell_IconR|
0001d720  65 73 69 7a 65 0d 0e e1  1c 2a 7c 53 74 61 72 74  |esize....*|Start|
0001d730  20 46 4e 73 68 65 6c 6c  5f 49 63 6f 6e 4d 6f 76  | FNshell_IconMov|
0001d740  65 0d 0e e2 2e dd 20 a4  73 68 65 6c 6c 5f 49 63  |e..... .shell_Ic|
0001d750  6f 6e 4d 6f 76 65 28 77  68 25 2c 69 68 25 2c 78  |onMove(wh%,ih%,x|
0001d760  30 25 2c 79 30 25 2c 78  31 25 2c 79 31 25 29 0d  |0%,y0%,x1%,y1%).|
0001d770  0e e3 27 ea 20 69 5f 62  6c 6b 25 2c 69 5f 66 6c  |..'. i_blk%,i_fl|
0001d780  61 67 73 25 2c 69 5f 64  61 74 61 25 2c 62 64 72  |ags%,i_data%,bdr|
0001d790  25 2c 62 6c 6b 25 0d 0e  e4 21 ea 20 6f 6c 64 66  |%,blk%...!. oldf|
0001d7a0  6c 61 67 73 25 2c 6f 64  74 30 25 2c 6f 64 74 31  |lags%,odt0%,odt1|
0001d7b0  25 2c 6f 64 74 32 25 0d  0e e5 24 69 5f 62 6c 6b  |%,odt2%...$i_blk|
0001d7c0  25 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |%=.shell_HeapBlo|
0001d7d0  63 6b 46 65 74 63 68 28  34 30 29 0d 0e e6 22 62  |ckFetch(40)..."b|
0001d7e0  6c 6b 25 3d a4 73 68 65  6c 6c 5f 48 65 61 70 42  |lk%=.shell_HeapB|
0001d7f0  6c 6f 63 6b 46 65 74 63  68 28 34 30 29 0d 0e e7  |lockFetch(40)...|
0001d800  3b 21 69 5f 62 6c 6b 25  3d 77 68 25 3a 69 5f 62  |;!i_blk%=wh%:i_b|
0001d810  6c 6b 25 21 34 3d 69 68  25 3a c8 99 20 22 57 69  |lk%!4=ih%:.. "Wi|
0001d820  6d 70 5f 47 65 74 49 63  6f 6e 53 74 61 74 65 22  |mp_GetIconState"|
0001d830  2c 2c 69 5f 62 6c 6b 25  0d 0e e8 18 21 62 6c 6b  |,,i_blk%....!blk|
0001d840  25 3d 77 68 25 3a 62 6c  6b 25 21 34 3d 69 68 25  |%=wh%:blk%!4=ih%|
0001d850  0d 0e e9 20 c8 99 20 22  57 69 6d 70 5f 47 65 74  |... .. "Wimp_Get|
0001d860  49 63 6f 6e 53 74 61 74  65 22 2c 2c 62 6c 6b 25  |IconState",,blk%|
0001d870  0d 0e ea 26 c8 99 20 22  49 6e 74 65 72 66 61 63  |...&.. "Interfac|
0001d880  65 5f 42 6f 75 6e 64 69  6e 67 42 6f 78 22 2c 2c  |e_BoundingBox",,|
0001d890  62 6c 6b 25 2b 38 0d 0e  eb 26 69 66 6c 61 67 73  |blk%+8...&iflags|
0001d8a0  25 3d 69 5f 62 6c 6b 25  21 32 34 3a 69 64 61 74  |%=i_blk%!24:idat|
0001d8b0  61 25 3d 69 5f 62 6c 6b  25 2b 32 38 0d 0e ec 42  |a%=i_blk%+28...B|
0001d8c0  6f 6c 64 66 6c 61 67 73  25 3d 69 66 6c 61 67 73  |oldflags%=iflags|
0001d8d0  25 3a 6f 64 74 30 25 3d  69 64 61 74 61 25 21 30  |%:odt0%=idata%!0|
0001d8e0  3a 6f 64 74 31 25 3d 69  64 61 74 61 25 21 34 3a  |:odt1%=idata%!4:|
0001d8f0  6f 64 74 32 25 3d 69 64  61 74 61 25 21 38 0d 0e  |odt2%=idata%!8..|
0001d900  ed 18 62 64 72 25 3d 69  5f 62 6c 6b 25 21 38 2d  |..bdr%=i_blk%!8-|
0001d910  62 6c 6b 25 21 38 0d 0e  ee 20 c8 99 20 22 57 69  |blk%!8... .. "Wi|
0001d920  6d 70 5f 44 65 6c 65 74  65 49 63 6f 6e 22 2c 2c  |mp_DeleteIcon",,|
0001d930  69 5f 62 6c 6b 25 0d 0e  ef 5c c8 99 20 22 57 69  |i_blk%...\.. "Wi|
0001d940  6d 70 5f 46 6f 72 63 65  52 65 64 72 61 77 22 2c  |mp_ForceRedraw",|
0001d950  21 69 5f 62 6c 6b 25 2c  69 5f 62 6c 6b 25 21 38  |!i_blk%,i_blk%!8|
0001d960  2d 62 64 72 25 2c 69 5f  62 6c 6b 25 21 31 32 2d  |-bdr%,i_blk%!12-|
0001d970  62 64 72 25 2c 69 5f 62  6c 6b 25 21 31 36 2b 62  |bdr%,i_blk%!16+b|
0001d980  64 72 25 2c 69 5f 62 6c  6b 25 21 32 30 2b 62 64  |dr%,i_blk%!20+bd|
0001d990  72 25 0d 0e f0 50 69 68  25 3d a4 73 68 65 6c 6c  |r%...Pih%=.shell|
0001d9a0  5f 43 72 65 61 74 65 49  63 6f 6e 32 28 77 68 25  |_CreateIcon2(wh%|
0001d9b0  2c 78 30 25 2c 79 30 25  2c 78 31 25 2c 79 31 25  |,x0%,y0%,x1%,y1%|
0001d9c0  2c 6f 6c 64 66 6c 61 67  73 25 2c 6f 64 74 30 25  |,oldflags%,odt0%|
0001d9d0  2c 6f 64 74 31 25 2c 6f  64 74 32 25 2c 62 64 72  |,odt1%,odt2%,bdr|
0001d9e0  25 29 0d 0e f1 22 f2 73  68 65 6c 6c 5f 48 65 61  |%)...".shell_Hea|
0001d9f0  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 69 5f 62  |pBlockReturn(i_b|
0001da00  6c 6b 25 29 0d 0e f2 20  f2 73 68 65 6c 6c 5f 48  |lk%)... .shell_H|
0001da10  65 61 70 42 6c 6f 63 6b  52 65 74 75 72 6e 28 62  |eapBlockReturn(b|
0001da20  6c 6b 25 29 0d 0e f3 08  3d 69 68 25 0d 0e f4 05  |lk%)....=ih%....|
0001da30  3a 0d 0e f5 1b 2a 7c 53  74 6f 70 20 46 4e 73 68  |:....*|Stop FNsh|
0001da40  65 6c 6c 5f 49 63 6f 6e  4d 6f 76 65 0d 0e f6 1f  |ell_IconMove....|
0001da50  2a 7c 53 74 61 72 74 20  46 4e 73 68 65 6c 6c 5f  |*|Start FNshell_|
0001da60  43 72 65 61 74 65 49 63  6f 6e 32 0d 0e f7 4c dd  |CreateIcon2...L.|
0001da70  20 a4 73 68 65 6c 6c 5f  43 72 65 61 74 65 49 63  | .shell_CreateIc|
0001da80  6f 6e 32 28 68 61 6e 64  6c 65 25 2c 78 30 25 2c  |on2(handle%,x0%,|
0001da90  79 30 25 2c 78 31 25 2c  79 31 25 2c 66 6c 61 67  |y0%,x1%,y1%,flag|
0001daa0  73 25 2c 64 74 30 25 2c  64 74 31 25 2c 64 74 32  |s%,dt0%,dt1%,dt2|
0001dab0  25 2c 62 64 72 25 29 0d  0e f8 26 ea 20 69 63 25  |%,bdr%)...&. ic%|
0001dac0  2c 71 25 2c 74 65 78 74  24 2c 73 70 72 69 74 65  |,q%,text$,sprite|
0001dad0  24 2c 6d 69 6e 78 25 2c  6d 69 6e 79 25 0d 0e f9  |$,minx%,miny%...|
0001dae0  20 71 25 3d a4 73 68 65  6c 6c 5f 48 65 61 70 42  | q%=.shell_HeapB|
0001daf0  6c 6f 63 6b 46 65 74 63  68 28 36 30 29 0d 0e fa  |lockFetch(60)...|
0001db00  0f 21 71 25 3d 68 61 6e  64 6c 65 25 0d 0e fb 31  |.!q%=handle%...1|
0001db10  71 25 21 32 30 3d 66 6c  61 67 73 25 3a 71 25 21  |q%!20=flags%:q%!|
0001db20  32 34 3d 64 74 30 25 3a  71 25 21 32 38 3d 64 74  |24=dt0%:q%!28=dt|
0001db30  31 25 3a 71 25 21 33 32  3d 64 74 32 25 0d 0e fc  |1%:q%!32=dt2%...|
0001db40  17 74 65 78 74 24 3d 22  22 3a 73 70 72 69 74 65  |.text$="":sprite|
0001db50  24 3d 22 22 0d 0e fd 12  e7 20 66 6c 61 67 73 25  |$=""..... flags%|
0001db60  20 80 20 31 20 8c 0d 0e  fe 34 20 e7 20 66 6c 61  | . 1 ....4 . fla|
0001db70  67 73 25 20 80 20 26 31  30 30 20 74 65 78 74 24  |gs% . &100 text$|
0001db80  3d 24 28 71 25 21 32 34  29 20 8b 20 74 65 78 74  |=$(q%!24) . text|
0001db90  24 3d 24 28 71 25 2b 32  34 29 0d 0e ff 05 cd 0d  |$=$(q%+24)......|
0001dba0  0f 00 12 e7 20 66 6c 61  67 73 25 20 80 20 32 20  |.... flags% . 2 |
0001dbb0  8c 0d 0f 01 16 20 e7 20  66 6c 61 67 73 25 20 80  |..... . flags% .|
0001dbc0  20 26 31 30 30 20 8c 0d  0f 02 2e 20 20 73 70 72  | &100 .....  spr|
0001dbd0  69 74 65 24 3d a4 73 68  65 6c 6c 5f 49 63 6f 6e  |ite$=.shell_Icon|
0001dbe0  47 65 74 43 6f 6d 6d 61  6e 64 28 71 25 21 32 38  |GetCommand(q%!28|
0001dbf0  2c 22 53 22 29 0d 0f 03  06 20 cc 0d 0f 04 16 20  |,"S").... ..... |
0001dc00  20 73 70 72 69 74 65 24  3d 24 28 71 25 2b 32 34  | sprite$=$(q%+24|
0001dc10  29 0d 0f 05 06 20 cd 0d  0f 06 05 cd 0d 0f 07 29  |).... .........)|
0001dc20  f2 73 68 65 6c 6c 5f 47  65 74 4d 69 6e 58 59 28  |.shell_GetMinXY(|
0001dc30  66 6c 61 67 73 25 2c 74  65 78 74 24 2c 73 70 72  |flags%,text$,spr|
0001dc40  69 74 65 24 29 0d 0f 08  23 e7 20 78 31 25 2d 78  |ite$)...#. x1%-x|
0001dc50  30 25 3c 6d 69 6e 78 25  20 8c 20 78 31 25 3d 78  |0%<minx% . x1%=x|
0001dc60  30 25 2b 6d 69 6e 78 25  0d 0f 09 23 e7 20 79 31  |0%+minx%...#. y1|
0001dc70  25 2d 79 30 25 3c 6d 69  6e 79 25 20 8c 20 79 31  |%-y0%<miny% . y1|
0001dc80  25 3d 79 30 25 2b 6d 69  6e 79 25 0d 0f 0a 29 71  |%=y0%+miny%...)q|
0001dc90  25 21 34 3d 78 30 25 3a  71 25 21 38 3d 79 30 25  |%!4=x0%:q%!8=y0%|
0001dca0  3a 71 25 21 31 32 3d 78  31 25 3a 71 25 21 31 36  |:q%!12=x1%:q%!16|
0001dcb0  3d 79 31 25 0d 0f 0b 22  c8 99 20 22 57 69 6d 70  |=y1%...".. "Wimp|
0001dcc0  5f 43 72 65 61 74 65 49  63 6f 6e 22 2c 2c 71 25  |_CreateIcon",,q%|
0001dcd0  20 b8 20 69 63 25 0d 0f  0c 47 c8 99 20 22 57 69  | . ic%...G.. "Wi|
0001dce0  6d 70 5f 46 6f 72 63 65  52 65 64 72 61 77 22 2c  |mp_ForceRedraw",|
0001dcf0  21 71 25 2c 71 25 21 34  2d 62 64 72 25 2c 71 25  |!q%,q%!4-bdr%,q%|
0001dd00  21 38 2d 62 64 72 25 2c  71 25 21 31 32 2b 62 64  |!8-bdr%,q%!12+bd|
0001dd10  72 25 2c 71 25 21 31 36  2b 62 64 72 25 0d 0f 0d  |r%,q%!16+bdr%...|
0001dd20  22 c8 99 20 22 57 69 6d  70 5f 47 65 74 43 61 72  |".. "Wimp_GetCar|
0001dd30  65 74 50 6f 73 69 74 69  6f 6e 22 2c 2c 71 25 0d  |etPosition",,q%.|
0001dd40  0f 0e 4b e7 20 21 71 25  3d 68 61 6e 64 6c 65 25  |..K. !q%=handle%|
0001dd50  3a e7 71 25 21 34 3d 69  63 25 3a c8 99 20 22 57  |:.q%!4=ic%:.. "W|
0001dd60  69 6d 70 5f 53 65 74 43  61 72 65 74 50 6f 73 69  |imp_SetCaretPosi|
0001dd70  74 69 6f 6e 22 2c 68 61  6e 64 6c 65 25 2c 69 63  |tion",handle%,ic|
0001dd80  25 2c 30 2c 30 2c 2d 31  2c 30 0d 0f 0f 1e f2 73  |%,0,0,-1,0.....s|
0001dd90  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 52 65  |hell_HeapBlockRe|
0001dda0  74 75 72 6e 28 71 25 29  0d 0f 10 08 3d 69 63 25  |turn(q%)....=ic%|
0001ddb0  0d 0f 11 05 3a 0d 0f 12  1e 2a 7c 53 74 6f 70 20  |....:....*|Stop |
0001ddc0  46 4e 73 68 65 6c 6c 5f  43 72 65 61 74 65 49 63  |FNshell_CreateIc|
0001ddd0  6f 6e 32 0d 0f 13 04 0d  0f 14 1e 2a 7c 53 74 61  |on2........*|Sta|
0001dde0  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 47 65 74  |rt PROCshell_Get|
0001ddf0  4d 69 6e 58 59 0d 0f 15  2b dd 20 f2 73 68 65 6c  |MinXY...+. .shel|
0001de00  6c 5f 47 65 74 4d 69 6e  58 59 28 66 6c 61 67 73  |l_GetMinXY(flags|
0001de10  25 2c 74 65 78 74 24 2c  73 70 72 69 74 65 24 29  |%,text$,sprite$)|
0001de20  0d 0f 16 1d ea 20 78 30  25 2c 79 30 25 2c 78 31  |..... x0%,y0%,x1|
0001de30  25 2c 79 31 25 2c 6d 78  25 2c 6d 79 25 0d 0f 17  |%,y1%,mx%,my%...|
0001de40  13 6d 69 6e 78 25 3d 30  3a 6d 69 6e 79 25 3d 30  |.minx%=0:miny%=0|
0001de50  0d 0f 18 1e e7 20 66 6c  61 67 73 25 80 26 30 31  |..... flags%.&01|
0001de60  20 80 20 74 65 78 74 24  3c 3e 22 22 20 8c 0d 0f  | . text$<>"" ...|
0001de70  19 14 20 20 e7 20 66 6c  61 67 73 25 80 26 34 30  |..  . flags%.&40|
0001de80  20 8c 0d 0f 1a 35 20 20  20 20 20 20 20 c8 99 20  | ....5       .. |
0001de90  22 46 6f 6e 74 5f 52 65  61 64 49 6e 66 6f 22 2c  |"Font_ReadInfo",|
0001dea0  66 6c 61 67 73 25 3e 3e  32 34 20 b8 20 2c 2c 79  |flags%>>24 . ,,y|
0001deb0  30 25 2c 2c 79 31 25 0d  0f 1b 44 20 20 20 20 20  |0%,,y1%...D     |
0001dec0  20 20 c8 99 20 22 46 6f  6e 74 5f 53 74 72 69 6e  |  .. "Font_Strin|
0001ded0  67 42 42 6f 78 22 2c 2c  bd 32 36 2b bd 28 66 6c  |gBBox",,.26+.(fl|
0001dee0  61 67 73 25 3e 3e 32 34  29 2b 74 65 78 74 24 20  |ags%>>24)+text$ |
0001def0  b8 20 2c 78 30 25 2c 2c  78 31 25 0d 0f 1c 2c 20  |. ,x0%,,x1%..., |
0001df00  20 20 20 20 20 20 c8 99  20 22 46 6f 6e 74 5f 43  |      .. "Font_C|
0001df10  6f 6e 76 65 72 74 74 6f  4f 53 22 2c 2c 78 30 25  |onverttoOS",,x0%|
0001df20  20 b8 20 2c 78 30 25 0d  0f 1d 2c 20 20 20 20 20  | . ,x0%...,     |
0001df30  20 20 c8 99 20 22 46 6f  6e 74 5f 43 6f 6e 76 65  |  .. "Font_Conve|
0001df40  72 74 74 6f 4f 53 22 2c  2c 78 31 25 20 b8 20 2c  |rttoOS",,x1% . ,|
0001df50  78 31 25 0d 0f 1e 26 20  20 20 20 20 20 20 6d 69  |x1%...&       mi|
0001df60  6e 78 25 3d 78 31 25 2d  78 30 25 3a 6d 69 6e 79  |nx%=x1%-x0%:miny|
0001df70  25 3d 79 31 25 2d 79 30  25 0d 0f 1f 26 20 20 cc  |%=y1%-y0%...&  .|
0001df80  20 6d 69 6e 78 25 3d 36  2a 64 78 25 2b 31 36 2a  | minx%=6*dx%+16*|
0001df90  a9 74 65 78 74 24 3a 6d  69 6e 79 25 3d 33 32 0d  |.text$:miny%=32.|
0001dfa0  0f 20 07 20 20 cd 0d 0f  21 1f 20 20 e7 20 66 6c  |. .  ...!.  . fl|
0001dfb0  61 67 73 25 80 26 30 34  20 6d 69 6e 79 25 2b 3d  |ags%.&04 miny%+=|
0001dfc0  32 2a 64 79 25 0d 0f 22  05 cd 0d 0f 23 20 e7 20  |2*dy%.."....# . |
0001dfd0  66 6c 61 67 73 25 80 26  30 32 20 80 20 73 70 72  |flags%.&02 . spr|
0001dfe0  69 74 65 24 3c 3e 22 22  20 8c 0d 0f 24 54 20 20  |ite$<>"" ...$T  |
0001dff0  20 c8 99 20 22 58 4f 53  5f 53 70 72 69 74 65 4f  | .. "XOS_SpriteO|
0001e000  70 22 2c 26 31 32 38 2c  a4 73 68 65 6c 6c 5f 55  |p",&128,.shell_U|
0001e010  73 65 72 53 70 72 69 74  65 73 42 61 73 65 2c 73  |serSpritesBase,s|
0001e020  70 72 69 74 65 24 20 b8  20 2c 2c 2c 6d 78 25 2c  |prite$ . ,,,mx%,|
0001e030  6d 79 25 2c 2c 73 70 6d  25 20 3b 20 50 25 0d 0f  |my%,,spm% ; P%..|
0001e040  25 13 20 20 20 e7 20 28  50 25 80 31 29 3d 30 20  |%.   . (P%.1)=0 |
0001e050  8c 0d 0f 26 41 20 20 20  20 20 20 c8 99 20 22 58  |...&A      .. "X|
0001e060  4f 53 5f 52 65 61 64 4d  6f 64 65 56 61 72 69 61  |OS_ReadModeVaria|
0001e070  62 6c 65 22 2c 73 70 6d  25 2c 34 20 b8 20 2c 2c  |ble",spm%,4 . ,,|
0001e080  73 70 78 25 3a 6d 78 25  3d 6d 78 25 3c 3c 73 70  |spx%:mx%=mx%<<sp|
0001e090  78 25 0d 0f 27 41 20 20  20 20 20 20 c8 99 20 22  |x%..'A      .. "|
0001e0a0  58 4f 53 5f 52 65 61 64  4d 6f 64 65 56 61 72 69  |XOS_ReadModeVari|
0001e0b0  61 62 6c 65 22 2c 73 70  6d 25 2c 35 20 b8 20 2c  |able",spm%,5 . ,|
0001e0c0  2c 73 70 79 25 3a 6d 79  25 3d 6d 79 25 3c 3c 73  |,spy%:my%=my%<<s|
0001e0d0  70 79 25 0d 0f 28 2b 20  20 20 20 20 20 e7 20 66  |py%..(+      . f|
0001e0e0  6c 61 67 73 25 80 26 38  30 30 20 6d 78 25 3d 6d  |lags%.&800 mx%=m|
0001e0f0  78 25 2f 32 3a 6d 79 25  3d 6d 79 25 2f 32 0d 0f  |x%/2:my%=my%/2..|
0001e100  29 42 20 20 20 20 20 20  e7 20 28 66 6c 61 67 73  |)B      . (flags|
0001e110  25 80 26 32 31 42 29 3d  26 31 33 20 6d 78 25 3d  |%.&21B)=&13 mx%=|
0001e120  6d 69 6e 78 25 2b 6d 78  25 20 3a f4 20 73 70 72  |minx%+mx% :. spr|
0001e130  69 74 65 2b 74 65 78 74  20 28 56 7e 48 7e 52 29  |ite+text (V~H~R)|
0001e140  0d 0f 2a 1f 20 20 20 20  20 20 e7 20 6d 78 25 3e  |..*.      . mx%>|
0001e150  6d 69 6e 78 25 20 6d 69  6e 78 25 3d 6d 78 25 0d  |minx% minx%=mx%.|
0001e160  0f 2b 1f 20 20 20 20 20  20 e7 20 6d 79 25 3e 6d  |.+.      . my%>m|
0001e170  69 6e 79 25 20 6d 69 6e  79 25 3d 6d 79 25 0d 0f  |iny% miny%=my%..|
0001e180  2c 08 20 20 20 cd 0d 0f  2d 05 cd 0d 0f 2e 05 e1  |,.   ...-.......|
0001e190  0d 0f 2f 05 3a 0d 0f 30  1d 2a 7c 53 74 6f 70 20  |../.:..0.*|Stop |
0001e1a0  50 52 4f 43 73 68 65 6c  6c 5f 47 65 74 4d 69 6e  |PROCshell_GetMin|
0001e1b0  58 59 0d 0f 31 04 0d 0f  32 22 2a 7c 53 74 61 72  |XY..1...2"*|Star|
0001e1c0  74 20 46 4e 73 68 65 6c  6c 5f 49 63 6f 6e 47 65  |t FNshell_IconGe|
0001e1d0  74 43 6f 6d 6d 61 6e 64  0d 0f 33 22 dd 20 a4 73  |tCommand..3". .s|
0001e1e0  68 65 6c 6c 5f 49 63 6f  6e 47 65 74 43 6f 6d 6d  |hell_IconGetComm|
0001e1f0  61 6e 64 28 76 25 2c 63  24 29 0d 0f 34 10 ea 20  |and(v%,c$)..4.. |
0001e200  49 25 2c 72 65 73 75 6c  74 24 0d 0f 35 0d e7 20  |I%,result$..5.. |
0001e210  76 25 3c 3d 30 20 8c 0d  0f 36 10 20 20 72 65 73  |v%<=0 ...6.  res|
0001e220  75 6c 74 24 3d 22 22 0d  0f 37 05 cc 0d 0f 38 49  |ult$=""..7....8I|
0001e230  20 20 49 25 3d a7 22 3b  22 2b a4 73 68 65 6c 6c  |  I%=.";"+.shell|
0001e240  5f 53 74 72 69 6e 67 55  70 70 65 72 43 61 73 65  |_StringUpperCase|
0001e250  28 24 76 25 29 2c 22 3b  22 2b a4 73 68 65 6c 6c  |($v%),";"+.shell|
0001e260  5f 53 74 72 69 6e 67 55  70 70 65 72 43 61 73 65  |_StringUpperCase|
0001e270  28 63 24 29 29 0d 0f 39  0e 20 20 e7 20 49 25 3d  |(c$))..9.  . I%=|
0001e280  30 20 8c 0d 0f 3a 12 20  20 20 20 72 65 73 75 6c  |0 ...:.    resul|
0001e290  74 24 3d 22 22 0d 0f 3b  07 20 20 cc 0d 0f 3c 2f  |t$=""..;.  ...</|
0001e2a0  20 20 20 20 72 65 73 75  6c 74 24 3d c0 24 28 76  |    result$=.$(v|
0001e2b0  25 2b 49 25 29 2c a7 24  28 76 25 2b 49 25 29 2b  |%+I%),.$(v%+I%)+|
0001e2c0  22 3b 22 2c 22 3b 22 29  2d 31 29 0d 0f 3d 07 20  |";",";")-1)..=. |
0001e2d0  20 cd 0d 0f 3e 05 cd 0d  0f 3f 0c 3d 72 65 73 75  | ...>....?.=resu|
0001e2e0  6c 74 24 0d 0f 40 05 3a  0d 0f 41 21 2a 7c 53 74  |lt$..@.:..A!*|St|
0001e2f0  6f 70 20 46 4e 73 68 65  6c 6c 5f 49 63 6f 6e 47  |op FNshell_IconG|
0001e300  65 74 43 6f 6d 6d 61 6e  64 0d 0f 42 20 2a 7c 53  |etCommand..B *|S|
0001e310  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 49  |tart PROCshell_I|
0001e320  63 6f 6e 52 65 64 72 61  77 0d 0f 43 20 dd 20 f2  |conRedraw..C . .|
0001e330  73 68 65 6c 6c 5f 49 63  6f 6e 52 65 64 72 61 77  |shell_IconRedraw|
0001e340  28 77 68 25 2c 69 68 25  29 0d 0f 44 0a ea 20 62  |(wh%,ih%)..D.. b|
0001e350  6c 6b 25 0d 0f 45 22 62  6c 6b 25 3d a4 73 68 65  |lk%..E"blk%=.she|
0001e360  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 46 65 74 63  |ll_HeapBlockFetc|
0001e370  68 28 34 30 29 0d 0f 46  18 21 62 6c 6b 25 3d 77  |h(40)..F.!blk%=w|
0001e380  68 25 3a 62 6c 6b 25 21  34 3d 69 68 25 0d 0f 47  |h%:blk%!4=ih%..G|
0001e390  20 c8 99 20 22 57 69 6d  70 5f 47 65 74 49 63 6f  | .. "Wimp_GetIco|
0001e3a0  6e 53 74 61 74 65 22 2c  2c 62 6c 6b 25 0d 0f 48  |nState",,blk%..H|
0001e3b0  26 c8 99 20 22 49 6e 74  65 72 66 61 63 65 5f 42  |&.. "Interface_B|
0001e3c0  6f 75 6e 64 69 6e 67 42  6f 78 22 2c 2c 62 6c 6b  |oundingBox",,blk|
0001e3d0  25 2b 38 0d 0f 49 3c c8  99 20 22 57 69 6d 70 5f  |%+8..I<.. "Wimp_|
0001e3e0  46 6f 72 63 65 52 65 64  72 61 77 22 2c 77 68 25  |ForceRedraw",wh%|
0001e3f0  2c 62 6c 6b 25 21 38 2c  62 6c 6b 25 21 31 32 2c  |,blk%!8,blk%!12,|
0001e400  62 6c 6b 25 21 31 36 2c  62 6c 6b 25 21 32 30 0d  |blk%!16,blk%!20.|
0001e410  0f 4a 2b f2 73 68 65 6c  6c 5f 41 63 74 69 6f 6e  |.J+.shell_Action|
0001e420  28 a4 73 68 65 6c 6c 5f  50 6f 6c 6c 5f 49 28 30  |(.shell_Poll_I(0|
0001e430  2c 5f 55 25 21 31 34 38  29 29 0d 0f 4b 20 f2 73  |,_U%!148))..K .s|
0001e440  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 52 65  |hell_HeapBlockRe|
0001e450  74 75 72 6e 28 62 6c 6b  25 29 0d 0f 4c 05 e1 0d  |turn(blk%)..L...|
0001e460  0f 4d 05 3a 0d 0f 4e 1f  2a 7c 53 74 6f 70 20 50  |.M.:..N.*|Stop P|
0001e470  52 4f 43 73 68 65 6c 6c  5f 49 63 6f 6e 52 65 64  |ROCshell_IconRed|
0001e480  72 61 77 0d 0f 4f 25 2a  7c 53 74 61 72 74 20 46  |raw..O%*|Start F|
0001e490  4e 73 68 65 6c 6c 5f 49  63 6f 6e 47 65 74 56 61  |Nshell_IconGetVa|
0001e4a0  6c 69 64 61 74 69 6f 6e  0d 0f 50 27 dd 20 a4 73  |lidation..P'. .s|
0001e4b0  68 65 6c 6c 5f 49 63 6f  6e 47 65 74 56 61 6c 69  |hell_IconGetVali|
0001e4c0  64 61 74 69 6f 6e 28 77  68 25 2c 69 68 25 29 0d  |dation(wh%,ih%).|
0001e4d0  0f 51 1d ea 20 62 6c 6b  25 2c 76 61 6c 69 64 61  |.Q.. blk%,valida|
0001e4e0  74 69 6f 6e 24 2c 66 6c  61 67 73 25 0d 0f 52 12  |tion$,flags%..R.|
0001e4f0  e7 20 69 68 25 3d 2d 31  20 8c 20 3d 22 22 0d 0f  |. ih%=-1 . =""..|
0001e500  53 12 76 61 6c 69 64 61  74 69 6f 6e 24 3d 22 22  |S.validation$=""|
0001e510  0d 0f 54 23 62 6c 6b 25  3d a4 73 68 65 6c 6c 5f  |..T#blk%=.shell_|
0001e520  48 65 61 70 42 6c 6f 63  6b 46 65 74 63 68 28 31  |HeapBlockFetch(1|
0001e530  30 30 29 0d 0f 55 19 62  6c 6b 25 21 30 3d 77 68  |00)..U.blk%!0=wh|
0001e540  25 3a 62 6c 6b 25 21 34  3d 69 68 25 0d 0f 56 20  |%:blk%!4=ih%..V |
0001e550  c8 99 20 22 57 69 6d 70  5f 47 65 74 49 63 6f 6e  |.. "Wimp_GetIcon|
0001e560  53 74 61 74 65 22 2c 2c  62 6c 6b 25 0d 0f 57 2a  |State",,blk%..W*|
0001e570  f4 20 63 68 65 63 6b 20  66 6c 61 67 73 20 66 69  |. check flags fi|
0001e580  72 73 74 20 74 6f 20 73  65 65 20 69 66 20 69 74  |rst to see if it|
0001e590  20 68 61 73 20 61 0d 0f  58 18 f4 20 76 61 6c 69  | has a..X.. vali|
0001e5a0  64 61 74 69 6f 6e 20 73  74 72 69 6e 67 21 0d 0f  |dation string!..|
0001e5b0  59 12 66 6c 61 67 73 25  3d 62 6c 6b 25 21 32 34  |Y.flags%=blk%!24|
0001e5c0  0d 0f 5a 15 e7 20 66 6c  61 67 73 25 20 80 20 26  |..Z.. flags% . &|
0001e5d0  31 30 30 20 8c 0d 0f 5b  2a 20 20 e7 20 62 6c 6b  |100 ...[*  . blk|
0001e5e0  25 21 33 32 3e 30 20 8c  20 76 61 6c 69 64 61 74  |%!32>0 . validat|
0001e5f0  69 6f 6e 24 3d 24 28 62  6c 6b 25 21 33 32 29 0d  |ion$=$(blk%!32).|
0001e600  0f 5c 05 cd 0d 0f 5d 20  f2 73 68 65 6c 6c 5f 48  |.\....] .shell_H|
0001e610  65 61 70 42 6c 6f 63 6b  52 65 74 75 72 6e 28 62  |eapBlockReturn(b|
0001e620  6c 6b 25 29 0d 0f 5e 10  3d 76 61 6c 69 64 61 74  |lk%)..^.=validat|
0001e630  69 6f 6e 24 0d 0f 5f 05  3a 0d 0f 60 24 2a 7c 53  |ion$.._.:..`$*|S|
0001e640  74 6f 70 20 46 4e 73 68  65 6c 6c 5f 49 63 6f 6e  |top FNshell_Icon|
0001e650  47 65 74 56 61 6c 69 64  61 74 69 6f 6e 0d 0f 61  |GetValidation..a|
0001e660  27 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |'*|Start PROCshe|
0001e670  6c 6c 5f 49 63 6f 6e 50  75 74 56 61 6c 69 64 61  |ll_IconPutValida|
0001e680  74 69 6f 6e 0d 0f 62 2e  dd 20 f2 73 68 65 6c 6c  |tion..b.. .shell|
0001e690  5f 49 63 6f 6e 50 75 74  56 61 6c 69 64 61 74 69  |_IconPutValidati|
0001e6a0  6f 6e 28 77 68 25 2c 69  68 25 2c 76 61 6c 69 64  |on(wh%,ih%,valid|
0001e6b0  24 29 0d 0f 63 11 ea 20  62 6c 6b 25 2c 66 6c 61  |$)..c.. blk%,fla|
0001e6c0  67 73 25 0d 0f 64 23 62  6c 6b 25 3d a4 73 68 65  |gs%..d#blk%=.she|
0001e6d0  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 46 65 74 63  |ll_HeapBlockFetc|
0001e6e0  68 28 31 30 30 29 0d 0f  65 19 62 6c 6b 25 21 30  |h(100)..e.blk%!0|
0001e6f0  3d 77 68 25 3a 62 6c 6b  25 21 34 3d 69 68 25 0d  |=wh%:blk%!4=ih%.|
0001e700  0f 66 20 c8 99 20 22 57  69 6d 70 5f 47 65 74 49  |.f .. "Wimp_GetI|
0001e710  63 6f 6e 53 74 61 74 65  22 2c 2c 62 6c 6b 25 0d  |conState",,blk%.|
0001e720  0f 67 12 66 6c 61 67 73  25 3d 62 6c 6b 25 21 32  |.g.flags%=blk%!2|
0001e730  34 0d 0f 68 15 e7 20 66  6c 61 67 73 25 20 80 20  |4..h.. flags% . |
0001e740  26 31 30 30 20 8c 0d 0f  69 17 20 20 24 28 62 6c  |&100 ...i.  $(bl|
0001e750  6b 25 21 33 32 29 3d 76  61 6c 69 64 24 0d 0f 6a  |k%!32)=valid$..j|
0001e760  05 cd 0d 0f 6b 20 f2 73  68 65 6c 6c 5f 48 65 61  |....k .shell_Hea|
0001e770  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 62 6c 6b  |pBlockReturn(blk|
0001e780  25 29 0d 0f 6c 05 e1 0d  0f 6d 05 3a 0d 0f 6e 26  |%)..l....m.:..n&|
0001e790  2a 7c 53 74 6f 70 20 50  52 4f 43 73 68 65 6c 6c  |*|Stop PROCshell|
0001e7a0  5f 49 63 6f 6e 50 75 74  56 61 6c 69 64 61 74 69  |_IconPutValidati|
0001e7b0  6f 6e 0d 0f 6f 22 2a 7c  53 74 61 72 74 20 46 4e  |on..o"*|Start FN|
0001e7c0  73 68 65 6c 6c 5f 49 73  49 63 6f 6e 53 65 6c 65  |shell_IsIconSele|
0001e7d0  63 74 65 64 0d 0f 70 36  dd 20 a4 73 68 65 6c 6c  |cted..p6. .shell|
0001e7e0  5f 49 73 49 63 6f 6e 53  65 6c 65 63 74 65 64 28  |_IsIconSelected(|
0001e7f0  57 69 6e 64 6f 77 48 61  6e 64 6c 65 25 2c 49 63  |WindowHandle%,Ic|
0001e800  6f 6e 48 61 6e 64 6c 65  25 29 0d 0f 71 0b ea 20  |onHandle%)..q.. |
0001e810  74 65 6d 70 25 0d 0f 72  32 f2 73 68 65 6c 6c 5f  |temp%..r2.shell_|
0001e820  49 63 6f 6e 47 65 74 53  74 61 74 65 28 57 69 6e  |IconGetState(Win|
0001e830  64 6f 77 48 61 6e 64 6c  65 25 2c 49 63 6f 6e 48  |dowHandle%,IconH|
0001e840  61 6e 64 6c 65 25 29 0d  0f 73 11 66 6c 61 67 73  |andle%)..s.flags|
0001e850  25 3d 5f 51 25 21 32 34  0d 0f 74 1c 74 65 6d 70  |%=_Q%!24..t.temp|
0001e860  25 3d 28 66 6c 61 67 73  25 20 80 20 26 32 30 30  |%=(flags% . &200|
0001e870  30 30 30 29 0d 0f 75 12  e7 20 74 65 6d 70 25 3d  |000)..u.. temp%=|
0001e880  30 20 8c 20 3d a3 0d 0f  76 06 3d b9 0d 0f 77 05  |0 . =...v.=...w.|
0001e890  3a 0d 0f 78 21 2a 7c 53  74 6f 70 20 46 4e 73 68  |:..x!*|Stop FNsh|
0001e8a0  65 6c 6c 5f 49 73 49 63  6f 6e 53 65 6c 65 63 74  |ell_IsIconSelect|
0001e8b0  65 64 0d 0f 79 04 0d 0f  7a 20 2a 7c 53 74 61 72  |ed..y...z *|Star|
0001e8c0  74 20 50 52 4f 43 73 68  65 6c 6c 5f 49 63 6f 6e  |t PROCshell_Icon|
0001e8d0  53 65 6c 65 63 74 0d 0f  7b 32 dd 20 f2 73 68 65  |Select..{2. .she|
0001e8e0  6c 6c 5f 49 63 6f 6e 53  65 6c 65 63 74 28 57 69  |ll_IconSelect(Wi|
0001e8f0  6e 64 6f 77 48 61 6e 64  6c 65 25 2c 49 63 6f 6e  |ndowHandle%,Icon|
0001e900  48 61 6e 64 6c 65 25 29  0d 0f 7c 42 f2 73 68 65  |Handle%)..|B.she|
0001e910  6c 6c 5f 49 63 6f 6e 53  65 74 53 74 61 74 65 28  |ll_IconSetState(|
0001e920  57 69 6e 64 6f 77 48 61  6e 64 6c 65 25 2c 49 63  |WindowHandle%,Ic|
0001e930  6f 6e 48 61 6e 64 6c 65  25 2c 26 32 30 30 30 30  |onHandle%,&20000|
0001e940  30 2c 26 32 30 30 30 30  30 29 0d 0f 7d 05 e1 0d  |0,&200000)..}...|
0001e950  0f 7e 05 3a 0d 0f 7f 1f  2a 7c 53 74 6f 70 20 50  |.~.:....*|Stop P|
0001e960  52 4f 43 73 68 65 6c 6c  5f 49 63 6f 6e 53 65 6c  |ROCshell_IconSel|
0001e970  65 63 74 0d 0f 80 04 0d  0f 81 22 2a 7c 53 74 61  |ect......."*|Sta|
0001e980  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 49 63 6f  |rt PROCshell_Ico|
0001e990  6e 44 65 73 65 6c 65 63  74 0d 0f 82 34 dd 20 f2  |nDeselect...4. .|
0001e9a0  73 68 65 6c 6c 5f 49 63  6f 6e 44 65 73 65 6c 65  |shell_IconDesele|
0001e9b0  63 74 28 57 69 6e 64 6f  77 48 61 6e 64 6c 65 25  |ct(WindowHandle%|
0001e9c0  2c 49 63 6f 6e 48 61 6e  64 6c 65 25 29 0d 0f 83  |,IconHandle%)...|
0001e9d0  3c f2 73 68 65 6c 6c 5f  49 63 6f 6e 53 65 74 53  |<.shell_IconSetS|
0001e9e0  74 61 74 65 28 57 69 6e  64 6f 77 48 61 6e 64 6c  |tate(WindowHandl|
0001e9f0  65 25 2c 49 63 6f 6e 48  61 6e 64 6c 65 25 2c 30  |e%,IconHandle%,0|
0001ea00  2c 26 32 30 30 30 30 30  29 0d 0f 84 05 e1 0d 0f  |,&200000).......|
0001ea10  85 05 3a 0d 0f 86 21 2a  7c 53 74 6f 70 20 50 52  |..:...!*|Stop PR|
0001ea20  4f 43 73 68 65 6c 6c 5f  49 63 6f 6e 44 65 73 65  |OCshell_IconDese|
0001ea30  6c 65 63 74 0d 0f 87 04  0d 0f 88 22 2a 7c 53 74  |lect......."*|St|
0001ea40  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 49 63  |art PROCshell_Ic|
0001ea50  6f 6e 47 65 74 53 74 61  74 65 0d 0f 89 34 dd 20  |onGetState...4. |
0001ea60  f2 73 68 65 6c 6c 5f 49  63 6f 6e 47 65 74 53 74  |.shell_IconGetSt|
0001ea70  61 74 65 28 57 69 6e 64  6f 77 48 61 6e 64 6c 65  |ate(WindowHandle|
0001ea80  25 2c 49 63 6f 6e 48 61  6e 64 6c 65 25 29 0d 0f  |%,IconHandle%)..|
0001ea90  8a 16 21 5f 51 25 3d 57  69 6e 64 6f 77 48 61 6e  |..!_Q%=WindowHan|
0001eaa0  64 6c 65 25 0d 0f 8b 15  5f 51 25 21 34 3d 49 63  |dle%...._Q%!4=Ic|
0001eab0  6f 6e 48 61 6e 64 6c 65  25 0d 0f 8c 1f c8 99 20  |onHandle%...... |
0001eac0  22 57 69 6d 70 5f 47 65  74 49 63 6f 6e 53 74 61  |"Wimp_GetIconSta|
0001ead0  74 65 22 2c 2c 5f 51 25  0d 0f 8d 05 e1 0d 0f 8e  |te",,_Q%........|
0001eae0  05 3a 0d 0f 8f 21 2a 7c  53 74 6f 70 20 50 52 4f  |.:...!*|Stop PRO|
0001eaf0  43 73 68 65 6c 6c 5f 49  63 6f 6e 47 65 74 53 74  |Cshell_IconGetSt|
0001eb00  61 74 65 0d 0f 90 04 0d  0f 91 25 2a 7c 53 74 61  |ate.......%*|Sta|
0001eb10  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 49 63 6f  |rt PROCshell_Ico|
0001eb20  6e 53 65 74 53 65 6c 65  63 74 65 64 0d 0f 92 2c  |nSetSelected...,|
0001eb30  dd 20 f2 73 68 65 6c 6c  5f 49 63 6f 6e 53 65 74  |. .shell_IconSet|
0001eb40  53 65 6c 65 63 74 65 64  28 77 68 25 2c 69 68 25  |Selected(wh%,ih%|
0001eb50  2c 73 74 61 74 65 25 29  0d 0f 93 10 e7 20 73 74  |,state%)..... st|
0001eb60  61 74 65 25 3d 30 20 8c  0d 0f 94 22 20 20 f2 73  |ate%=0 ...."  .s|
0001eb70  68 65 6c 6c 5f 49 63 6f  6e 44 65 73 65 6c 65 63  |hell_IconDeselec|
0001eb80  74 28 77 68 25 2c 69 68  25 29 0d 0f 95 05 cc 0d  |t(wh%,ih%)......|
0001eb90  0f 96 20 20 20 f2 73 68  65 6c 6c 5f 49 63 6f 6e  |..   .shell_Icon|
0001eba0  53 65 6c 65 63 74 28 77  68 25 2c 69 68 25 29 0d  |Select(wh%,ih%).|
0001ebb0  0f 97 05 cd 0d 0f 98 05  e1 0d 0f 99 05 3a 0d 0f  |.............:..|
0001ebc0  9a 24 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |.$*|Stop PROCshe|
0001ebd0  6c 6c 5f 49 63 6f 6e 53  65 74 53 65 6c 65 63 74  |ll_IconSetSelect|
0001ebe0  65 64 0d 0f 9b 04 0d 0f  9c 1d 2a 7c 53 74 61 72  |ed........*|Star|
0001ebf0  74 20 50 52 4f 43 73 68  65 6c 6c 5f 49 63 6f 6e  |t PROCshell_Icon|
0001ec00  53 65 74 0d 0f 9d 24 dd  20 f2 73 68 65 6c 6c 5f  |Set...$. .shell_|
0001ec10  49 63 6f 6e 53 65 74 28  77 68 25 2c 69 68 25 2c  |IconSet(wh%,ih%,|
0001ec20  73 74 61 74 65 25 29 0d  0f 9e 10 e7 20 73 74 61  |state%)..... sta|
0001ec30  74 65 25 3d 30 20 8c 0d  0f 9f 22 20 20 f2 73 68  |te%=0 ...."  .sh|
0001ec40  65 6c 6c 5f 49 63 6f 6e  44 65 73 65 6c 65 63 74  |ell_IconDeselect|
0001ec50  28 77 68 25 2c 69 68 25  29 0d 0f a0 05 cc 0d 0f  |(wh%,ih%).......|
0001ec60  a1 20 20 20 f2 73 68 65  6c 6c 5f 49 63 6f 6e 53  |.   .shell_IconS|
0001ec70  65 6c 65 63 74 28 77 68  25 2c 69 68 25 29 0d 0f  |elect(wh%,ih%)..|
0001ec80  a2 05 cd 0d 0f a3 05 e1  0d 0f a4 05 3a 0d 0f a5  |............:...|
0001ec90  1c 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  |.*|Stop PROCshel|
0001eca0  6c 5f 49 63 6f 6e 53 65  74 0d 0f a6 22 2a 7c 53  |l_IconSet..."*|S|
0001ecb0  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 49  |tart PROCshell_I|
0001ecc0  63 6f 6e 53 65 74 53 74  61 74 65 0d 0f a7 48 dd  |conSetState...H.|
0001ecd0  20 f2 73 68 65 6c 6c 5f  49 63 6f 6e 53 65 74 53  | .shell_IconSetS|
0001ece0  74 61 74 65 28 57 69 6e  64 6f 77 48 61 6e 64 6c  |tate(WindowHandl|
0001ecf0  65 25 2c 49 63 6f 6e 48  61 6e 64 6c 65 25 2c 45  |e%,IconHandle%,E|
0001ed00  6f 72 57 6f 72 64 25 2c  43 6c 65 61 72 57 6f 72  |orWord%,ClearWor|
0001ed10  64 25 29 0d 0f a8 0f ea  20 69 63 6f 6e 5f 62 6c  |d%)..... icon_bl|
0001ed20  6b 25 0d 0f a9 27 69 63  6f 6e 5f 62 6c 6b 25 3d  |k%...'icon_blk%=|
0001ed30  a4 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
0001ed40  46 65 74 63 68 28 31 36  29 0d 0f aa 1c 21 69 63  |Fetch(16)....!ic|
0001ed50  6f 6e 5f 62 6c 6b 25 3d  57 69 6e 64 6f 77 48 61  |on_blk%=WindowHa|
0001ed60  6e 64 6c 65 25 0d 0f ab  1c 69 63 6f 6e 5f 62 6c  |ndle%....icon_bl|
0001ed70  6b 25 21 30 34 3d 49 63  6f 6e 48 61 6e 64 6c 65  |k%!04=IconHandle|
0001ed80  25 0d 0f ac 19 69 63 6f  6e 5f 62 6c 6b 25 21 30  |%....icon_blk%!0|
0001ed90  38 3d 45 6f 72 57 6f 72  64 25 0d 0f ad 1b 69 63  |8=EorWord%....ic|
0001eda0  6f 6e 5f 62 6c 6b 25 21  31 32 3d 43 6c 65 61 72  |on_blk%!12=Clear|
0001edb0  57 6f 72 64 25 0d 0f ae  25 c8 99 20 22 57 69 6d  |Word%...%.. "Wim|
0001edc0  70 5f 53 65 74 49 63 6f  6e 53 74 61 74 65 22 2c  |p_SetIconState",|
0001edd0  2c 69 63 6f 6e 5f 62 6c  6b 25 0d 0f af 25 f2 73  |,icon_blk%...%.s|
0001ede0  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 52 65  |hell_HeapBlockRe|
0001edf0  74 75 72 6e 28 69 63 6f  6e 5f 62 6c 6b 25 29 0d  |turn(icon_blk%).|
0001ee00  0f b0 05 e1 0d 0f b1 05  3a 0d 0f b2 21 2a 7c 53  |........:...!*|S|
0001ee10  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 49 63  |top PROCshell_Ic|
0001ee20  6f 6e 53 65 74 53 74 61  74 65 0d 0f b3 04 0d 0f  |onSetState......|
0001ee30  b4 26 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |.&*|Start PROCsh|
0001ee40  65 6c 6c 5f 49 63 6f 6e  55 6e 73 65 6c 65 63 74  |ell_IconUnselect|
0001ee50  61 62 6c 65 0d 0f b5 2c  dd 20 f2 73 68 65 6c 6c  |able...,. .shell|
0001ee60  5f 49 63 6f 6e 55 6e 73  65 6c 65 63 74 61 62 6c  |_IconUnselectabl|
0001ee70  65 28 68 61 6e 64 6c 65  25 2c 69 63 6f 6e 25 29  |e(handle%,icon%)|
0001ee80  0d 0f b6 35 f2 73 68 65  6c 6c 5f 49 63 6f 6e 53  |...5.shell_IconS|
0001ee90  65 74 53 74 61 74 65 28  68 61 6e 64 6c 65 25 2c  |etState(handle%,|
0001eea0  69 63 6f 6e 25 2c 26 34  30 30 30 30 30 2c 26 34  |icon%,&400000,&4|
0001eeb0  30 30 30 30 29 0d 0f b7  05 e1 0d 0f b8 05 3a 0d  |0000).........:.|
0001eec0  0f b9 25 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |..%*|Stop PROCsh|
0001eed0  65 6c 6c 5f 49 63 6f 6e  55 6e 73 65 6c 65 63 74  |ell_IconUnselect|
0001eee0  61 62 6c 65 0d 0f ba 04  0d 0f bb 25 2a 7c 53 74  |able.......%*|St|
0001eef0  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 49 63  |art PROCshell_Ic|
0001ef00  6f 6e 53 65 74 42 47 43  6f 6c 6f 75 72 0d 0f bc  |onSetBGColour...|
0001ef10  2a dd 20 f2 73 68 65 6c  6c 5f 49 63 6f 6e 53 65  |*. .shell_IconSe|
0001ef20  74 42 47 43 6f 6c 6f 75  72 28 77 68 25 2c 69 68  |tBGColour(wh%,ih|
0001ef30  25 2c 63 6f 6c 25 29 0d  0f bd 5c e7 20 63 6f 6c  |%,col%)...\. col|
0001ef40  25 3c 30 20 84 20 63 6f  6c 25 3e 31 35 20 8c 20  |%<0 . col%>15 . |
0001ef50  85 20 39 39 2c a4 73 68  65 6c 6c 5f 4d 65 73 73  |. 99,.shell_Mess|
0001ef60  61 67 65 4f 6e 65 41 72  67 28 22 53 48 45 4c 4c  |ageOneArg("SHELL|
0001ef70  4d 53 47 32 34 22 2c 22  50 52 4f 43 73 68 65 6c  |MSG24","PROCshel|
0001ef80  6c 5f 49 63 6f 6e 53 65  74 42 47 43 6f 6c 6f 75  |l_IconSetBGColou|
0001ef90  72 22 29 0d 0f be 33 f2  73 68 65 6c 6c 5f 49 63  |r")...3.shell_Ic|
0001efa0  6f 6e 53 65 74 53 74 61  74 65 28 77 68 25 2c 69  |onSetState(wh%,i|
0001efb0  68 25 2c 63 6f 6c 25 3c  3c 32 38 2c 26 46 30 30  |h%,col%<<28,&F00|
0001efc0  30 30 30 30 30 29 0d 0f  bf 05 e1 0d 0f c0 05 3a  |00000).........:|
0001efd0  0d 0f c1 24 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |...$*|Stop PROCs|
0001efe0  68 65 6c 6c 5f 49 63 6f  6e 53 65 74 42 47 43 6f  |hell_IconSetBGCo|
0001eff0  6c 6f 75 72 0d 0f c2 04  0d 0f c3 25 2a 7c 53 74  |lour.......%*|St|
0001f000  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 49 63  |art PROCshell_Ic|
0001f010  6f 6e 53 65 74 46 47 43  6f 6c 6f 75 72 0d 0f c4  |onSetFGColour...|
0001f020  2a dd 20 f2 73 68 65 6c  6c 5f 49 63 6f 6e 53 65  |*. .shell_IconSe|
0001f030  74 46 47 43 6f 6c 6f 75  72 28 77 68 25 2c 69 68  |tFGColour(wh%,ih|
0001f040  25 2c 63 6f 6c 25 29 0d  0f c5 5c e7 20 63 6f 6c  |%,col%)...\. col|
0001f050  25 3c 30 20 84 20 63 6f  6c 25 3e 31 35 20 8c 20  |%<0 . col%>15 . |
0001f060  85 20 39 39 2c a4 73 68  65 6c 6c 5f 4d 65 73 73  |. 99,.shell_Mess|
0001f070  61 67 65 4f 6e 65 41 72  67 28 22 53 48 45 4c 4c  |ageOneArg("SHELL|
0001f080  4d 53 47 32 34 22 2c 22  50 52 4f 43 73 68 65 6c  |MSG24","PROCshel|
0001f090  6c 5f 49 63 6f 6e 53 65  74 46 47 43 6f 6c 6f 75  |l_IconSetFGColou|
0001f0a0  72 22 29 0d 0f c6 33 f2  73 68 65 6c 6c 5f 49 63  |r")...3.shell_Ic|
0001f0b0  6f 6e 53 65 74 53 74 61  74 65 28 77 68 25 2c 69  |onSetState(wh%,i|
0001f0c0  68 25 2c 63 6f 6c 25 3c  3c 32 34 2c 26 30 46 30  |h%,col%<<24,&0F0|
0001f0d0  30 30 30 30 30 29 0d 0f  c7 05 e1 0d 0f c8 05 3a  |00000).........:|
0001f0e0  0d 0f c9 24 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |...$*|Stop PROCs|
0001f0f0  68 65 6c 6c 5f 49 63 6f  6e 53 65 74 46 47 43 6f  |hell_IconSetFGCo|
0001f100  6c 6f 75 72 0d 0f ca 04  0d 0f cb 26 2a 7c 53 74  |lour.......&*|St|
0001f110  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 43 61  |art PROCshell_Ca|
0001f120  72 65 74 53 65 74 50 6f  73 69 74 69 6f 6e 0d 0f  |retSetPosition..|
0001f130  cc 4b dd 20 f2 73 68 65  6c 6c 5f 43 61 72 65 74  |.K. .shell_Caret|
0001f140  53 65 74 50 6f 73 69 74  69 6f 6e 28 77 68 61 6e  |SetPosition(whan|
0001f150  64 6c 65 25 2c 69 68 61  6e 64 6c 65 25 2c 78 6f  |dle%,ihandle%,xo|
0001f160  66 66 25 2c 79 6f 66 66  25 2c 68 65 69 67 68 74  |ff%,yoff%,height|
0001f170  25 2c 69 6e 64 65 78 25  29 0d 0f cd 4b c8 99 20  |%,index%)...K.. |
0001f180  22 57 69 6d 70 5f 53 65  74 43 61 72 65 74 50 6f  |"Wimp_SetCaretPo|
0001f190  73 69 74 69 6f 6e 22 2c  77 68 61 6e 64 6c 65 25  |sition",whandle%|
0001f1a0  2c 69 68 61 6e 64 6c 65  25 2c 78 6f 66 66 25 2c  |,ihandle%,xoff%,|
0001f1b0  79 6f 66 66 25 2c 68 65  69 67 68 74 25 2c 69 6e  |yoff%,height%,in|
0001f1c0  64 65 78 25 0d 0f ce 05  e1 0d 0f cf 05 3a 0d 0f  |dex%.........:..|
0001f1d0  d0 25 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |.%*|Stop PROCshe|
0001f1e0  6c 6c 5f 43 61 72 65 74  53 65 74 50 6f 73 69 74  |ll_CaretSetPosit|
0001f1f0  69 6f 6e 0d 0f d1 04 0d  0f d2 27 2a 7c 53 74 61  |ion.......'*|Sta|
0001f200  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 49 63 6f  |rt PROCshell_Ico|
0001f210  6e 53 65 74 42 75 74 74  6f 6e 54 79 70 65 0d 0f  |nSetButtonType..|
0001f220  d3 34 dd 20 f2 73 68 65  6c 6c 5f 49 63 6f 6e 53  |.4. .shell_IconS|
0001f230  65 74 42 75 74 74 6f 6e  54 79 70 65 28 77 68 25  |etButtonType(wh%|
0001f240  2c 69 68 25 2c 62 75 74  74 6f 6e 5f 74 79 70 65  |,ih%,button_type|
0001f250  25 29 0d 0f d4 6f e7 20  62 75 74 74 6f 6e 5f 74  |%)...o. button_t|
0001f260  79 70 65 25 3d 31 32 20  84 20 62 75 74 74 6f 6e  |ype%=12 . button|
0001f270  5f 74 79 70 65 25 3d 31  33 20 8c 20 85 20 39 39  |_type%=13 . . 99|
0001f280  2c a4 73 68 65 6c 6c 5f  4d 65 73 73 61 67 65 4f  |,.shell_MessageO|
0001f290  6e 65 41 72 67 28 22 53  48 45 4c 4c 4d 53 47 32  |neArg("SHELLMSG2|
0001f2a0  33 22 2c 22 50 52 4f 43  73 68 65 6c 6c 5f 49 63  |3","PROCshell_Ic|
0001f2b0  6f 6e 53 65 74 42 75 74  74 6f 6e 54 79 70 65 22  |onSetButtonType"|
0001f2c0  29 0d 0f d5 6e e7 20 62  75 74 74 6f 6e 5f 74 79  |)...n. button_ty|
0001f2d0  70 65 25 3c 30 20 84 20  62 75 74 74 6f 6e 5f 74  |pe%<0 . button_t|
0001f2e0  79 70 65 25 3e 31 35 20  8c 20 85 20 39 39 2c a4  |ype%>15 . . 99,.|
0001f2f0  73 68 65 6c 6c 5f 4d 65  73 73 61 67 65 4f 6e 65  |shell_MessageOne|
0001f300  41 72 67 28 22 53 48 45  4c 4c 4d 53 47 32 32 22  |Arg("SHELLMSG22"|
0001f310  2c 22 50 52 4f 43 73 68  65 6c 6c 5f 49 63 6f 6e  |,"PROCshell_Icon|
0001f320  53 65 74 42 75 74 74 6f  6e 54 79 70 65 22 29 0d  |SetButtonType").|
0001f330  0f d6 37 f2 73 68 65 6c  6c 5f 49 63 6f 6e 53 65  |..7.shell_IconSe|
0001f340  74 53 74 61 74 65 28 77  68 25 2c 69 68 25 2c 62  |tState(wh%,ih%,b|
0001f350  75 74 74 6f 6e 5f 74 79  70 65 25 3c 3c 31 32 2c  |utton_type%<<12,|
0001f360  26 46 30 30 30 29 0d 0f  d7 05 e1 0d 0f d8 05 3a  |&F000).........:|
0001f370  0d 0f d9 26 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |...&*|Stop PROCs|
0001f380  68 65 6c 6c 5f 49 63 6f  6e 53 65 74 42 75 74 74  |hell_IconSetButt|
0001f390  6f 6e 54 79 70 65 0d 0f  da 20 2a 7c 53 74 61 72  |onType... *|Star|
0001f3a0  74 20 50 52 4f 43 73 68  65 6c 6c 5f 49 63 6f 6e  |t PROCshell_Icon|
0001f3b0  53 65 74 45 53 47 0d 0f  db 25 dd 20 f2 73 68 65  |SetESG...%. .she|
0001f3c0  6c 6c 5f 49 63 6f 6e 53  65 74 45 53 47 28 77 68  |ll_IconSetESG(wh|
0001f3d0  25 2c 69 68 25 2c 65 73  67 25 29 0d 0f dc 57 e7  |%,ih%,esg%)...W.|
0001f3e0  20 65 73 67 25 3c 30 20  84 20 65 73 67 25 3e 33  | esg%<0 . esg%>3|
0001f3f0  31 20 8c 20 85 20 39 39  2c a4 73 68 65 6c 6c 5f  |1 . . 99,.shell_|
0001f400  4d 65 73 73 61 67 65 4f  6e 65 41 72 67 28 22 53  |MessageOneArg("S|
0001f410  48 45 4c 4c 4d 53 47 32  35 22 2c 22 50 52 4f 43  |HELLMSG25","PROC|
0001f420  73 68 65 6c 6c 5f 49 63  6f 6e 53 65 74 45 53 47  |shell_IconSetESG|
0001f430  22 29 0d 0f dd 31 f2 73  68 65 6c 6c 5f 49 63 6f  |")...1.shell_Ico|
0001f440  6e 53 65 74 53 74 61 74  65 28 77 68 25 2c 69 68  |nSetState(wh%,ih|
0001f450  25 2c 65 73 67 25 3c 3c  31 36 2c 26 31 46 30 30  |%,esg%<<16,&1F00|
0001f460  30 30 29 0d 0f de 05 e1  0d 0f df 05 3a 0d 0f e0  |00).........:...|
0001f470  1f 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  |.*|Stop PROCshel|
0001f480  6c 5f 49 63 6f 6e 53 65  74 45 53 47 0d 0f e1 04  |l_IconSetESG....|
0001f490  0d 0f e2 21 2a 7c 53 74  61 72 74 20 50 52 4f 43  |...!*|Start PROC|
0001f4a0  73 68 65 6c 6c 5f 49 63  6f 6e 53 65 74 54 65 78  |shell_IconSetTex|
0001f4b0  74 0d 0f e3 29 dd 20 f2  73 68 65 6c 6c 5f 49 63  |t...). .shell_Ic|
0001f4c0  6f 6e 53 65 74 54 65 78  74 28 77 68 25 2c 69 68  |onSetText(wh%,ih|
0001f4d0  25 2c 61 63 74 69 6f 6e  25 29 0d 0f e4 1f e7 20  |%,action%)..... |
0001f4e0  61 63 74 69 6f 6e 25 3c  3e 30 20 8c 20 61 63 74  |action%<>0 . act|
0001f4f0  69 6f 6e 25 3d 31 3c 3c  30 0d 0f e5 2d f2 73 68  |ion%=1<<0...-.sh|
0001f500  65 6c 6c 5f 49 63 6f 6e  53 65 74 53 74 61 74 65  |ell_IconSetState|
0001f510  28 77 68 25 2c 69 68 25  2c 61 63 74 69 6f 6e 25  |(wh%,ih%,action%|
0001f520  2c 31 3c 3c 30 29 0d 0f  e6 05 e1 0d 0f e7 05 3a  |,1<<0).........:|
0001f530  0d 0f e8 20 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |... *|Stop PROCs|
0001f540  68 65 6c 6c 5f 49 63 6f  6e 53 65 74 54 65 78 74  |hell_IconSetText|
0001f550  0d 0f e9 04 0d 0f ea 23  2a 7c 53 74 61 72 74 20  |.......#*|Start |
0001f560  50 52 4f 43 73 68 65 6c  6c 5f 49 63 6f 6e 53 65  |PROCshell_IconSe|
0001f570  74 53 70 72 69 74 65 0d  0f eb 2b dd 20 f2 73 68  |tSprite...+. .sh|
0001f580  65 6c 6c 5f 49 63 6f 6e  53 65 74 53 70 72 69 74  |ell_IconSetSprit|
0001f590  65 28 77 68 25 2c 69 68  25 2c 61 63 74 69 6f 6e  |e(wh%,ih%,action|
0001f5a0  25 29 0d 0f ec 1f e7 20  61 63 74 69 6f 6e 25 3c  |%)..... action%<|
0001f5b0  3e 30 20 8c 20 61 63 74  69 6f 6e 25 3d 31 3c 3c  |>0 . action%=1<<|
0001f5c0  31 0d 0f ed 2d f2 73 68  65 6c 6c 5f 49 63 6f 6e  |1...-.shell_Icon|
0001f5d0  53 65 74 53 74 61 74 65  28 77 68 25 2c 69 68 25  |SetState(wh%,ih%|
0001f5e0  2c 61 63 74 69 6f 6e 25  2c 31 3c 3c 31 29 0d 0f  |,action%,1<<1)..|
0001f5f0  ee 05 e1 0d 0f ef 05 3a  0d 0f f0 22 2a 7c 53 74  |.......:..."*|St|
0001f600  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 49 63 6f  |op PROCshell_Ico|
0001f610  6e 53 65 74 53 70 72 69  74 65 0d 0f f1 23 2a 7c  |nSetSprite...#*||
0001f620  53 74 61 72 74 20 50 52  4f 43 73 68 65 6c 6c 5f  |Start PROCshell_|
0001f630  49 63 6f 6e 53 65 74 42  6f 72 64 65 72 0d 0f f2  |IconSetBorder...|
0001f640  2b dd 20 f2 73 68 65 6c  6c 5f 49 63 6f 6e 53 65  |+. .shell_IconSe|
0001f650  74 42 6f 72 64 65 72 28  77 68 25 2c 69 68 25 2c  |tBorder(wh%,ih%,|
0001f660  61 63 74 69 6f 6e 25 29  0d 0f f3 1f e7 20 61 63  |action%)..... ac|
0001f670  74 69 6f 6e 25 3c 3e 30  20 8c 20 61 63 74 69 6f  |tion%<>0 . actio|
0001f680  6e 25 3d 31 3c 3c 32 0d  0f f4 2d f2 73 68 65 6c  |n%=1<<2...-.shel|
0001f690  6c 5f 49 63 6f 6e 53 65  74 53 74 61 74 65 28 77  |l_IconSetState(w|
0001f6a0  68 25 2c 69 68 25 2c 61  63 74 69 6f 6e 25 2c 31  |h%,ih%,action%,1|
0001f6b0  3c 3c 32 29 0d 0f f5 05  e1 0d 0f f6 05 3a 0d 0f  |<<2).........:..|
0001f6c0  f7 22 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |."*|Stop PROCshe|
0001f6d0  6c 6c 5f 49 63 6f 6e 53  65 74 42 6f 72 64 65 72  |ll_IconSetBorder|
0001f6e0  0d 0f f8 04 0d 0f f9 25  2a 7c 53 74 61 72 74 20  |.......%*|Start |
0001f6f0  50 52 4f 43 73 68 65 6c  6c 5f 49 63 6f 6e 53 65  |PROCshell_IconSe|
0001f700  74 48 43 65 6e 74 72 65  64 0d 0f fa 2d dd 20 f2  |tHCentred...-. .|
0001f710  73 68 65 6c 6c 5f 49 63  6f 6e 53 65 74 48 43 65  |shell_IconSetHCe|
0001f720  6e 74 72 65 64 28 77 68  25 2c 69 68 25 2c 61 63  |ntred(wh%,ih%,ac|
0001f730  74 69 6f 6e 25 29 0d 0f  fb 46 f2 73 68 65 6c 6c  |tion%)...F.shell|
0001f740  5f 49 63 6f 6e 53 65 74  53 74 61 74 65 28 77 68  |_IconSetState(wh|
0001f750  25 2c 69 68 25 2c 30 2c  31 3c 3c 39 29 3a f4 20  |%,ih%,0,1<<9):. |
0001f760  75 6e 73 65 74 20 72 69  67 68 74 20 6a 75 73 74  |unset right just|
0001f770  69 66 69 65 64 20 62 69  74 2e 2e 2e 0d 0f fc 1f  |ified bit.......|
0001f780  e7 20 61 63 74 69 6f 6e  25 3c 3e 30 20 8c 20 61  |. action%<>0 . a|
0001f790  63 74 69 6f 6e 25 3d 31  3c 3c 33 0d 0f fd 2d f2  |ction%=1<<3...-.|
0001f7a0  73 68 65 6c 6c 5f 49 63  6f 6e 53 65 74 53 74 61  |shell_IconSetSta|
0001f7b0  74 65 28 77 68 25 2c 69  68 25 2c 61 63 74 69 6f  |te(wh%,ih%,actio|
0001f7c0  6e 25 2c 31 3c 3c 33 29  0d 0f fe 05 e1 0d 0f ff  |n%,1<<3)........|
0001f7d0  05 3a 0d 10 00 24 2a 7c  53 74 6f 70 20 50 52 4f  |.:...$*|Stop PRO|
0001f7e0  43 73 68 65 6c 6c 5f 49  63 6f 6e 53 65 74 48 43  |Cshell_IconSetHC|
0001f7f0  65 6e 74 72 65 64 0d 10  01 04 0d 10 02 25 2a 7c  |entred.......%*||
0001f800  53 74 61 72 74 20 50 52  4f 43 73 68 65 6c 6c 5f  |Start PROCshell_|
0001f810  49 63 6f 6e 53 65 74 56  43 65 6e 74 72 65 64 0d  |IconSetVCentred.|
0001f820  10 03 2d dd 20 f2 73 68  65 6c 6c 5f 49 63 6f 6e  |..-. .shell_Icon|
0001f830  53 65 74 56 43 65 6e 74  72 65 64 28 77 68 25 2c  |SetVCentred(wh%,|
0001f840  69 68 25 2c 61 63 74 69  6f 6e 25 29 0d 10 04 1f  |ih%,action%)....|
0001f850  e7 20 61 63 74 69 6f 6e  25 3c 3e 30 20 8c 20 61  |. action%<>0 . a|
0001f860  63 74 69 6f 6e 25 3d 31  3c 3c 34 0d 10 05 2d f2  |ction%=1<<4...-.|
0001f870  73 68 65 6c 6c 5f 49 63  6f 6e 53 65 74 53 74 61  |shell_IconSetSta|
0001f880  74 65 28 77 68 25 2c 69  68 25 2c 61 63 74 69 6f  |te(wh%,ih%,actio|
0001f890  6e 25 2c 31 3c 3c 34 29  0d 10 06 05 e1 0d 10 07  |n%,1<<4)........|
0001f8a0  05 3a 0d 10 08 24 2a 7c  53 74 6f 70 20 50 52 4f  |.:...$*|Stop PRO|
0001f8b0  43 73 68 65 6c 6c 5f 49  63 6f 6e 53 65 74 56 43  |Cshell_IconSetVC|
0001f8c0  65 6e 74 72 65 64 0d 10  09 04 0d 10 0a 23 2a 7c  |entred.......#*||
0001f8d0  53 74 61 72 74 20 50 52  4f 43 73 68 65 6c 6c 5f  |Start PROCshell_|
0001f8e0  49 63 6f 6e 53 65 74 46  69 6c 6c 65 64 0d 10 0b  |IconSetFilled...|
0001f8f0  2b dd 20 f2 73 68 65 6c  6c 5f 49 63 6f 6e 53 65  |+. .shell_IconSe|
0001f900  74 46 69 6c 6c 65 64 28  77 68 25 2c 69 68 25 2c  |tFilled(wh%,ih%,|
0001f910  61 63 74 69 6f 6e 25 29  0d 10 0c 1f e7 20 61 63  |action%)..... ac|
0001f920  74 69 6f 6e 25 3c 3e 30  20 8c 20 61 63 74 69 6f  |tion%<>0 . actio|
0001f930  6e 25 3d 31 3c 3c 35 0d  10 0d 2d f2 73 68 65 6c  |n%=1<<5...-.shel|
0001f940  6c 5f 49 63 6f 6e 53 65  74 53 74 61 74 65 28 77  |l_IconSetState(w|
0001f950  68 25 2c 69 68 25 2c 61  63 74 69 6f 6e 25 2c 31  |h%,ih%,action%,1|
0001f960  3c 3c 35 29 0d 10 0e 05  e1 0d 10 0f 05 3a 0d 10  |<<5).........:..|
0001f970  10 22 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |."*|Stop PROCshe|
0001f980  6c 6c 5f 49 63 6f 6e 53  65 74 46 69 6c 6c 65 64  |ll_IconSetFilled|
0001f990  0d 10 11 04 0d 10 12 26  2a 7c 53 74 61 72 74 20  |.......&*|Start |
0001f9a0  50 52 4f 43 73 68 65 6c  6c 5f 49 63 6f 6e 53 65  |PROCshell_IconSe|
0001f9b0  74 52 69 67 68 74 4a 75  73 74 0d 10 13 2e dd 20  |tRightJust..... |
0001f9c0  f2 73 68 65 6c 6c 5f 49  63 6f 6e 53 65 74 52 69  |.shell_IconSetRi|
0001f9d0  67 68 74 4a 75 73 74 28  77 68 25 2c 69 68 25 2c  |ghtJust(wh%,ih%,|
0001f9e0  61 63 74 69 6f 6e 25 29  0d 10 14 25 f2 73 68 65  |action%)...%.she|
0001f9f0  6c 6c 5f 49 63 6f 6e 53  65 74 48 43 65 6e 74 72  |ll_IconSetHCentr|
0001fa00  65 64 28 77 68 25 2c 69  68 25 2c 30 29 0d 10 15  |ed(wh%,ih%,0)...|
0001fa10  1f e7 20 61 63 74 69 6f  6e 25 3c 3e 30 20 8c 20  |.. action%<>0 . |
0001fa20  61 63 74 69 6f 6e 25 3d  31 3c 3c 39 0d 10 16 2d  |action%=1<<9...-|
0001fa30  f2 73 68 65 6c 6c 5f 49  63 6f 6e 53 65 74 53 74  |.shell_IconSetSt|
0001fa40  61 74 65 28 77 68 25 2c  69 68 25 2c 61 63 74 69  |ate(wh%,ih%,acti|
0001fa50  6f 6e 25 2c 31 3c 3c 39  29 0d 10 17 05 e1 0d 10  |on%,1<<9).......|
0001fa60  18 05 3a 0d 10 19 25 2a  7c 53 74 6f 70 20 50 52  |..:...%*|Stop PR|
0001fa70  4f 43 73 68 65 6c 6c 5f  49 63 6f 6e 53 65 74 52  |OCshell_IconSetR|
0001fa80  69 67 68 74 4a 75 73 74  0d 10 1a 04 0d 10 1b 25  |ightJust.......%|
0001fa90  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
0001faa0  6c 5f 49 63 6f 6e 53 65  74 4c 65 66 74 4a 75 73  |l_IconSetLeftJus|
0001fab0  74 0d 10 1c 25 dd 20 f2  73 68 65 6c 6c 5f 49 63  |t...%. .shell_Ic|
0001fac0  6f 6e 53 65 74 4c 65 66  74 4a 75 73 74 28 77 68  |onSetLeftJust(wh|
0001fad0  25 2c 69 68 25 29 0d 10  1d 25 f2 73 68 65 6c 6c  |%,ih%)...%.shell|
0001fae0  5f 49 63 6f 6e 53 65 74  48 43 65 6e 74 72 65 64  |_IconSetHCentred|
0001faf0  28 77 68 25 2c 69 68 25  2c 30 29 0d 10 1e 26 f2  |(wh%,ih%,0)...&.|
0001fb00  73 68 65 6c 6c 5f 49 63  6f 6e 53 65 74 52 69 67  |shell_IconSetRig|
0001fb10  68 74 4a 75 73 74 28 77  68 25 2c 69 68 25 2c 30  |htJust(wh%,ih%,0|
0001fb20  29 0d 10 1f 05 e1 0d 10  20 05 3a 0d 10 21 24 2a  |)....... .:..!$*|
0001fb30  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
0001fb40  49 63 6f 6e 53 65 74 4c  65 66 74 4a 75 73 74 0d  |IconSetLeftJust.|
0001fb50  10 22 04 0d 10 23 29 2a  7c 53 74 61 72 74 20 50  |."...#)*|Start P|
0001fb60  52 4f 43 73 68 65 6c 6c  5f 49 63 6f 6e 53 65 74  |ROCshell_IconSet|
0001fb70  55 6e 73 65 6c 65 63 74  61 62 6c 65 0d 10 24 30  |Unselectable..$0|
0001fb80  dd 20 f2 73 68 65 6c 6c  5f 49 63 6f 6e 53 65 74  |. .shell_IconSet|
0001fb90  55 6e 73 65 6c 65 63 74  61 62 6c 65 28 77 68 25  |Unselectable(wh%|
0001fba0  2c 69 68 25 2c 73 74 61  74 65 25 29 0d 10 25 10  |,ih%,state%)..%.|
0001fbb0  ea 20 63 61 72 65 74 5f  62 6c 6b 25 0d 10 26 1e  |. caret_blk%..&.|
0001fbc0  e7 20 73 74 61 74 65 25  3c 3e 30 20 8c 20 73 74  |. state%<>0 . st|
0001fbd0  61 74 65 25 3d 31 3c 3c  32 32 0d 10 27 2d f2 73  |ate%=1<<22..'-.s|
0001fbe0  68 65 6c 6c 5f 49 63 6f  6e 53 65 74 53 74 61 74  |hell_IconSetStat|
0001fbf0  65 28 77 68 25 2c 69 68  25 2c 73 74 61 74 65 25  |e(wh%,ih%,state%|
0001fc00  2c 31 3c 3c 32 32 29 0d  10 28 11 e7 20 73 74 61  |,1<<22)..(.. sta|
0001fc10  74 65 25 3c 3e 30 20 8c  0d 10 29 38 20 20 f4 20  |te%<>0 ...)8  . |
0001fc20  63 68 65 63 6b 20 69 66  20 69 63 6f 6e 20 68 61  |check if icon ha|
0001fc30  73 20 74 68 65 20 63 61  72 65 74 2c 20 6c 6f 73  |s the caret, los|
0001fc40  65 20 69 74 20 69 66 20  69 74 20 68 61 73 2e 2e  |e it if it has..|
0001fc50  0d 10 2a 2a 20 20 63 61  72 65 74 5f 62 6c 6b 25  |..**  caret_blk%|
0001fc60  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
0001fc70  6b 46 65 74 63 68 28 32  34 29 0d 10 2b 2c 20 20  |kFetch(24)..+,  |
0001fc80  c8 99 20 22 57 69 6d 70  5f 47 65 74 43 61 72 65  |.. "Wimp_GetCare|
0001fc90  74 50 6f 73 69 74 69 6f  6e 22 2c 2c 63 61 72 65  |tPosition",,care|
0001fca0  74 5f 62 6c 6b 25 0d 10  2c 2c 20 20 e7 20 21 63  |t_blk%..,,  . !c|
0001fcb0  61 72 65 74 5f 62 6c 6b  25 3d 77 68 25 20 80 20  |aret_blk%=wh% . |
0001fcc0  63 61 72 65 74 5f 62 6c  6b 25 21 34 3d 69 68 25  |caret_blk%!4=ih%|
0001fcd0  20 8c 0d 10 2d 25 20 20  20 20 c8 99 20 22 57 69  | ...-%    .. "Wi|
0001fce0  6d 70 5f 53 65 74 43 61  72 65 74 50 6f 73 69 74  |mp_SetCaretPosit|
0001fcf0  69 6f 6e 22 2c 2d 31 0d  10 2e 07 20 20 cd 0d 10  |ion",-1....  ...|
0001fd00  2f 28 20 20 f2 73 68 65  6c 6c 5f 48 65 61 70 42  |/(  .shell_HeapB|
0001fd10  6c 6f 63 6b 52 65 74 75  72 6e 28 63 61 72 65 74  |lockReturn(caret|
0001fd20  5f 62 6c 6b 25 29 0d 10  30 05 cd 0d 10 31 05 e1  |_blk%)..0....1..|
0001fd30  0d 10 32 05 3a 0d 10 33  28 2a 7c 53 74 6f 70 20  |..2.:..3(*|Stop |
0001fd40  50 52 4f 43 73 68 65 6c  6c 5f 49 63 6f 6e 53 65  |PROCshell_IconSe|
0001fd50  74 55 6e 73 65 6c 65 63  74 61 62 6c 65 0d 10 34  |tUnselectable..4|
0001fd60  04 0d 10 35 23 2a 7c 53  74 61 72 74 20 50 52 4f  |...5#*|Start PRO|
0001fd70  43 73 68 65 6c 6c 5f 43  61 72 65 74 53 65 74 52  |Cshell_CaretSetR|
0001fd80  69 67 68 74 0d 10 36 23  dd 20 f2 73 68 65 6c 6c  |ight..6#. .shell|
0001fd90  5f 43 61 72 65 74 53 65  74 52 69 67 68 74 28 77  |_CaretSetRight(w|
0001fda0  68 25 2c 69 68 25 29 0d  10 37 4e c8 99 20 22 57  |h%,ih%)..7N.. "W|
0001fdb0  69 6d 70 5f 53 65 74 43  61 72 65 74 50 6f 73 69  |imp_SetCaretPosi|
0001fdc0  74 69 6f 6e 22 2c 77 68  25 2c 69 68 25 2c 2d 31  |tion",wh%,ih%,-1|
0001fdd0  2c 2d 31 2c 2d 31 2c a9  28 a4 73 68 65 6c 6c 5f  |,-1,-1,.(.shell_|
0001fde0  49 63 6f 6e 47 65 74 44  61 74 61 28 77 68 25 2c  |IconGetData(wh%,|
0001fdf0  69 68 25 29 29 0d 10 38  05 e1 0d 10 39 05 3a 0d  |ih%))..8....9.:.|
0001fe00  10 3a 22 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |.:"*|Stop PROCsh|
0001fe10  65 6c 6c 5f 43 61 72 65  74 53 65 74 52 69 67 68  |ell_CaretSetRigh|
0001fe20  74 0d 10 3b 04 0d 10 3c  1a 2a 7c 53 74 61 72 74  |t..;...<.*|Start|
0001fe30  20 50 52 4f 43 70 72 69  6e 74 5f 74 65 78 74 0d  | PROCprint_text.|
0001fe40  10 3d 1c dd 20 f2 70 72  69 6e 74 5f 74 65 78 74  |.=.. .print_text|
0001fe50  28 58 2c 59 2c 74 65 78  74 24 29 0d 10 3e 23 e7  |(X,Y,text$)..>#.|
0001fe60  20 a4 69 6e 28 58 2c 59  2d 33 32 2c 58 2b 31 36  | .in(X,Y-32,X+16|
0001fe70  2a a9 28 74 65 78 74 24  29 2c 59 29 20 8c 0d 10  |*.(text$),Y) ...|
0001fe80  3f 0b 20 20 ec 20 58 2c  59 0d 10 40 0d 20 20 f1  |?.  . X,Y..@.  .|
0001fe90  20 74 65 78 74 24 0d 10  41 05 cd 0d 10 42 05 e1  | text$..A....B..|
0001fea0  0d 10 43 05 3a 0d 10 44  19 2a 7c 53 74 6f 70 20  |..C.:..D.*|Stop |
0001feb0  50 52 4f 43 70 72 69 6e  74 5f 74 65 78 74 0d 10  |PROCprint_text..|
0001fec0  45 10 2a 7c 53 74 61 72  74 20 46 4e 69 6e 0d 10  |E.*|Start FNin..|
0001fed0  46 16 dd 20 a4 69 6e 28  41 25 2c 42 25 2c 43 25  |F.. .in(A%,B%,C%|
0001fee0  2c 44 25 29 0d 10 47 11  e7 20 43 25 3c 67 62 78  |,D%)..G.. C%<gbx|
0001fef0  20 8c 20 3d a3 0d 10 48  11 e7 20 41 25 3e 67 74  | . =...H.. A%>gt|
0001ff00  78 20 8c 20 3d a3 0d 10  49 11 e7 20 42 25 3e 67  |x . =...I.. B%>g|
0001ff10  74 79 20 8c 20 3d a3 0d  10 4a 11 e7 20 44 25 3c  |ty . =...J.. D%<|
0001ff20  67 62 79 20 8c 20 3d a3  0d 10 4b 06 3d b9 0d 10  |gby . =...K.=...|
0001ff30  4c 05 3a 0d 10 4d 0f 2a  7c 53 74 6f 70 20 46 4e  |L.:..M.*|Stop FN|
0001ff40  69 6e 0d 10 4e 17 2a 7c  53 74 61 72 74 20 50 52  |in..N.*|Start PR|
0001ff50  4f 43 6e 65 77 76 61 6c  73 0d 10 4f 0e dd 20 f2  |OCnewvals..O.. .|
0001ff60  6e 65 77 76 61 6c 73 0d  10 50 19 67 62 78 3d 5f  |newvals..P.gbx=_|
0001ff70  51 25 21 32 38 3a 67 62  79 3d 5f 51 25 21 33 32  |Q%!28:gby=_Q%!32|
0001ff80  0d 10 51 19 67 74 78 3d  5f 51 25 21 33 36 3a 67  |..Q.gtx=_Q%!36:g|
0001ff90  74 79 3d 5f 51 25 21 34  30 0d 10 52 17 77 62 78  |ty=_Q%!40..R.wbx|
0001ffa0  3d 5f 51 25 21 34 3a 77  62 79 3d 5f 51 25 21 38  |=_Q%!4:wby=_Q%!8|
0001ffb0  0d 10 53 19 77 74 78 3d  5f 51 25 21 31 32 3a 77  |..S.wtx=_Q%!12:w|
0001ffc0  74 79 3d 5f 51 25 21 31  36 0d 10 54 19 78 73 63  |ty=_Q%!16..T.xsc|
0001ffd0  3d 5f 51 25 21 32 30 3a  79 73 63 3d 5f 51 25 21  |=_Q%!20:ysc=_Q%!|
0001ffe0  32 34 0d 10 55 21 68 70  3d 77 74 78 2d 77 62 78  |24..U!hp=wtx-wbx|
0001fff0  3a 76 70 3d 77 74 79 2d  77 62 79 3a 65 62 78 3d  |:vp=wty-wby:ebx=|
00020000  78 73 63 0d 10 56 21 65  74 78 3d 78 73 63 2b 68  |xsc..V!etx=xsc+h|
00020010  70 3a 65 74 79 3d 79 73  63 3a 65 62 79 3d 79 73  |p:ety=ysc:eby=ys|
00020020  63 2d 76 70 0d 10 57 05  e1 0d 10 58 05 3a 0d 10  |c-vp..W....X.:..|
00020030  59 16 2a 7c 53 74 6f 70  20 50 52 4f 43 6e 65 77  |Y.*|Stop PROCnew|
00020040  76 61 6c 73 0d 10 5a 11  dd 20 a4 6d 61 78 28 61  |vals..Z.. .max(a|
00020050  25 2c 62 25 29 0d 10 5b  11 e7 20 61 25 3c 62 25  |%,b%)..[.. a%<b%|
00020060  20 8c 20 3d 62 25 0d 10  5c 07 3d 61 25 0d 10 5d  | . =b%..\.=a%..]|
00020070  05 3a 0d 10 5e 18 2a 7c  53 74 61 72 74 20 46 4e  |.:..^.*|Start FN|
00020080  73 68 65 6c 6c 5f 4c 65  61 66 0d 10 5f 18 dd 20  |shell_Leaf.._.. |
00020090  a4 73 68 65 6c 6c 5f 4c  65 61 66 28 70 61 74 68  |.shell_Leaf(path|
000200a0  24 29 0d 10 60 12 c8 95  20 a7 70 61 74 68 24 2c  |$)..`... .path$,|
000200b0  22 2e 22 29 0d 10 61 21  20 20 70 61 74 68 24 3d  |".")..a!  path$=|
000200c0  c1 70 61 74 68 24 2c a7  70 61 74 68 24 2c 22 2e  |.path$,.path$,".|
000200d0  22 29 2b 31 29 0d 10 62  05 ce 0d 10 63 0a 3d 70  |")+1)..b....c.=p|
000200e0  61 74 68 24 0d 10 64 05  3a 0d 10 65 17 2a 7c 53  |ath$..d.:..e.*|S|
000200f0  74 6f 70 20 46 4e 73 68  65 6c 6c 5f 4c 65 61 66  |top FNshell_Leaf|
00020100  0d 10 66 1a 2a 7c 53 74  61 72 74 20 46 4e 73 68  |..f.*|Start FNsh|
00020110  65 6c 6c 5f 42 72 61 6e  63 68 0d 10 67 1b dd 20  |ell_Branch..g.. |
00020120  a4 73 68 65 6c 6c 5f 42  72 61 6e 63 68 28 66 6e  |.shell_Branch(fn|
00020130  61 6d 65 24 29 0d 10 68  14 ea 20 70 6f 73 25 2c  |ame$)..h.. pos%,|
00020140  62 72 24 2c 74 65 6d 70  25 0d 10 69 16 e7 20 a7  |br$,temp%..i.. .|
00020150  66 6e 61 6d 65 24 2c 22  2e 22 29 3d 30 20 8c 0d  |fname$,".")=0 ..|
00020160  10 6a 0c 20 20 62 72 24  3d 22 22 0d 10 6b 05 cc  |.j.  br$=""..k..|
00020170  0d 10 6c 0d 20 20 74 65  6d 70 25 3d 30 0d 10 6d  |..l.  temp%=0..m|
00020180  07 20 20 f5 0d 10 6e 14  20 20 20 20 70 6f 73 25  |.  ...n.    pos%|
00020190  3d 74 65 6d 70 25 2b 31  0d 10 6f 1f 20 20 20 20  |=temp%+1..o.    |
000201a0  74 65 6d 70 25 3d a7 66  6e 61 6d 65 24 2c 22 2e  |temp%=.fname$,".|
000201b0  22 2c 70 6f 73 25 29 0d  10 70 0f 20 20 fd 20 74  |",pos%)..p.  . t|
000201c0  65 6d 70 25 3d 30 0d 10  71 19 20 20 62 72 24 3d  |emp%=0..q.  br$=|
000201d0  c0 66 6e 61 6d 65 24 2c  70 6f 73 25 2d 32 29 0d  |.fname$,pos%-2).|
000201e0  10 72 05 cd 0d 10 73 08  3d 62 72 24 0d 10 74 05  |.r....s.=br$..t.|
000201f0  3a 0d 10 75 19 2a 7c 53  74 6f 70 20 46 4e 73 68  |:..u.*|Stop FNsh|
00020200  65 6c 6c 5f 42 72 61 6e  63 68 0d 10 76 13 2a 7c  |ell_Branch..v.*||
00020210  53 74 61 72 74 20 46 4e  67 6e 61 6d 65 0d 10 77  |Start FNgname..w|
00020220  11 dd 20 a4 67 6e 61 6d  65 28 70 74 72 29 0d 10  |.. .gname(ptr)..|
00020230  78 09 66 24 3d 22 22 0d  10 79 19 c8 95 20 3f 70  |x.f$=""..y... ?p|
00020240  74 72 3c 3e 30 20 80 20  3f 70 74 72 3c 3e 31 33  |tr<>0 . ?ptr<>13|
00020250  0d 10 7a 18 20 20 66 24  3d 66 24 2b bd 3f 70 74  |..z.  f$=f$+.?pt|
00020260  72 3a 70 74 72 2b 3d 31  0d 10 7b 05 ce 0d 10 7c  |r:ptr+=1..{....||
00020270  07 3d 66 24 0d 10 7d 05  3a 0d 10 7e 12 2a 7c 53  |.=f$..}.:..~.*|S|
00020280  74 6f 70 20 46 4e 67 6e  61 6d 65 0d 10 7f 22 2a  |top FNgname..."*|
00020290  7c 53 74 61 72 74 20 50  52 4f 43 73 68 65 6c 6c  ||Start PROCshell|
000202a0  5f 57 69 6e 64 6f 77 52  65 73 69 7a 65 0d 10 80  |_WindowResize...|
000202b0  39 dd 20 f2 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |9. .shell_Window|
000202c0  52 65 73 69 7a 65 28 77  68 61 6e 64 6c 65 25 2c  |Resize(whandle%,|
000202d0  62 78 25 2c 62 79 25 2c  74 78 25 2c 74 79 25 2c  |bx%,by%,tx%,ty%,|
000202e0  6f 70 65 6e 25 29 0d 10  81 2b 21 5f 51 25 3d 62  |open%)...+!_Q%=b|
000202f0  78 25 3a 5f 51 25 21 34  3d 62 79 25 3a 5f 51 25  |x%:_Q%!4=by%:_Q%|
00020300  21 38 3d 74 78 25 3a 5f  51 25 21 31 32 3d 74 79  |!8=tx%:_Q%!12=ty|
00020310  25 0d 10 82 24 c8 99 20  22 57 69 6d 70 5f 53 65  |%...$.. "Wimp_Se|
00020320  74 45 78 74 65 6e 74 22  2c 77 68 61 6e 64 6c 65  |tExtent",whandle|
00020330  25 2c 5f 51 25 0d 10 83  0d e7 20 6f 70 65 6e 25  |%,_Q%..... open%|
00020340  20 8c 0d 10 84 14 20 20  5f 51 25 21 30 3d 77 68  | .....  _Q%!0=wh|
00020350  61 6e 64 6c 65 25 0d 10  85 22 20 20 c8 99 20 22  |andle%..."  .. "|
00020360  57 69 6d 70 5f 47 65 74  57 69 6e 64 6f 77 49 6e  |Wimp_GetWindowIn|
00020370  66 6f 22 2c 2c 5f 51 25  0d 10 86 1f 20 20 c8 99  |fo",,_Q%....  ..|
00020380  20 22 57 69 6d 70 5f 4f  70 65 6e 57 69 6e 64 6f  | "Wimp_OpenWindo|
00020390  77 22 2c 2c 5f 51 25 0d  10 87 05 cd 0d 10 88 05  |w",,_Q%.........|
000203a0  e1 0d 10 89 05 3a 0d 10  8a 21 2a 7c 53 74 6f 70  |.....:...!*|Stop|
000203b0  20 50 52 4f 43 73 68 65  6c 6c 5f 57 69 6e 64 6f  | PROCshell_Windo|
000203c0  77 52 65 73 69 7a 65 0d  10 8b 04 0d 10 8c 23 2a  |wResize.......#*|
000203d0  7c 53 74 61 72 74 20 50  52 4f 43 73 68 65 6c 6c  ||Start PROCshell|
000203e0  5f 57 69 6e 64 6f 77 52  65 74 69 74 6c 65 0d 10  |_WindowRetitle..|
000203f0  8d 2d dd 20 f2 73 68 65  6c 6c 5f 57 69 6e 64 6f  |.-. .shell_Windo|
00020400  77 52 65 74 69 74 6c 65  28 f8 20 77 68 61 6e 64  |wRetitle(. whand|
00020410  6c 65 25 2c 74 69 74 6c  65 24 29 0d 10 8e 2a ea  |le%,title$)...*.|
00020420  20 74 65 6d 70 25 2c 77  69 6e 5f 62 6c 6b 25 2c  | temp%,win_blk%,|
00020430  68 61 6e 64 6c 65 25 2c  74 5f 62 75 66 66 65 72  |handle%,t_buffer|
00020440  5f 6c 65 6e 25 0d 10 8f  56 77 69 6e 5f 62 6c 6b  |_len%...Vwin_blk|
00020450  25 20 20 20 3d 20 a4 73  68 65 6c 6c 5f 48 65 61  |%   = .shell_Hea|
00020460  70 42 6c 6f 63 6b 46 65  74 63 68 28 31 30 30 20  |pBlockFetch(100 |
00020470  2b 20 28 a4 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |+ (.shell_Window|
00020480  43 6f 75 6e 74 49 63 6f  6e 73 28 77 68 61 6e 64  |CountIcons(whand|
00020490  6c 65 25 29 20 2a 20 33  32 29 29 0d 10 90 19 77  |le%) * 32))....w|
000204a0  69 6e 5f 62 6c 6b 25 21  30 20 3d 20 77 68 61 6e  |in_blk%!0 = whan|
000204b0  64 6c 65 25 0d 10 91 25  c8 99 20 22 57 69 6d 70  |dle%...%.. "Wimp|
000204c0  5f 47 65 74 57 69 6e 64  6f 77 49 6e 66 6f 22 2c  |_GetWindowInfo",|
000204d0  2c 77 69 6e 5f 62 6c 6b  25 0d 10 92 22 e7 20 28  |,win_blk%...". (|
000204e0  28 77 69 6e 5f 62 6c 6b  25 21 36 30 29 20 80 20  |(win_blk%!60) . |
000204f0  26 31 30 30 29 20 3d 20  30 20 8c 0d 10 93 28 20  |&100) = 0 ....( |
00020500  20 f4 20 77 69 6e 64 6f  77 20 74 69 74 6c 65 20  | . window title |
00020510  69 73 20 6e 6f 74 20 69  6e 64 69 72 65 63 74 65  |is not indirecte|
00020520  64 2e 2e 0d 10 94 1b 20  20 74 65 6d 70 25 20 3d  |d......  temp% =|
00020530  20 77 69 6e 5f 62 6c 6b  25 20 2b 20 37 36 0d 10  | win_blk% + 76..|
00020540  95 1a 20 20 24 74 65 6d  70 25 20 3d 20 c0 74 69  |..  $temp% = .ti|
00020550  74 6c 65 24 2c 31 31 29  0d 10 96 26 20 20 c8 99  |tle$,11)...&  ..|
00020560  20 22 57 69 6d 70 5f 44  65 6c 65 74 65 57 69 6e  | "Wimp_DeleteWin|
00020570  64 6f 77 22 2c 2c 77 69  6e 5f 62 6c 6b 25 0d 10  |dow",,win_blk%..|
00020580  97 34 20 20 c8 99 20 22  57 69 6d 70 5f 43 72 65  |.4  .. "Wimp_Cre|
00020590  61 74 65 57 69 6e 64 6f  77 22 2c 2c 77 69 6e 5f  |ateWindow",,win_|
000205a0  62 6c 6b 25 20 2b 20 34  20 b8 20 68 61 6e 64 6c  |blk% + 4 . handl|
000205b0  65 25 0d 10 98 1d 20 20  e7 20 68 61 6e 64 6c 65  |e%....  . handle|
000205c0  25 20 3c 3e 20 77 68 61  6e 64 6c 65 25 20 8c 0d  |% <> whandle% ..|
000205d0  10 99 39 20 20 20 20 f4  20 57 69 6e 64 6f 77 20  |..9    . Window |
000205e0  68 61 6e 64 6c 65 20 68  61 73 20 63 68 61 6e 67  |handle has chang|
000205f0  65 64 2c 20 75 70 64 61  74 65 20 65 76 65 6e 74  |ed, update event|
00020600  20 64 61 74 61 2e 2e 2e  0d 10 9a 33 20 20 20 20  | data......3    |
00020610  f2 73 68 65 6c 6c 5f 55  70 64 61 74 65 57 69 6e  |.shell_UpdateWin|
00020620  64 6f 77 48 61 6e 64 6c  65 28 77 68 61 6e 64 6c  |dowHandle(whandl|
00020630  65 25 2c 68 61 6e 64 6c  65 25 29 0d 10 9b 1a 20  |e%,handle%).... |
00020640  20 20 20 77 68 61 6e 64  6c 65 25 20 3d 20 68 61  |   whandle% = ha|
00020650  6e 64 6c 65 25 0d 10 9c  07 20 20 cd 0d 10 9d 05  |ndle%....  .....|
00020660  cc 0d 10 9e 36 20 20 f4  20 57 69 6e 64 6f 77 20  |....6  . Window |
00020670  74 69 74 6c 65 20 69 73  20 69 6e 64 69 72 65 63  |title is indirec|
00020680  74 65 64 2c 20 66 69 6e  64 20 62 75 66 66 65 72  |ted, find buffer|
00020690  20 73 69 7a 65 2e 2e 0d  10 9f 21 20 20 74 5f 62  | size.....!  t_b|
000206a0  75 66 66 65 72 5f 6c 65  6e 25 20 3d 20 77 69 6e  |uffer_len% = win|
000206b0  5f 62 6c 6b 25 21 38 34  0d 10 a0 34 20 20 f4 20  |_blk%!84...4  . |
000206c0  54 72 75 6e 63 61 74 65  20 74 69 74 6c 65 20 69  |Truncate title i|
000206d0  66 20 69 74 20 77 6f 6e  27 74 20 66 69 74 20 74  |f it won't fit t|
000206e0  68 65 20 62 75 66 66 65  72 2e 2e 2e 0d 10 a1 36  |he buffer......6|
000206f0  20 20 24 28 21 28 77 69  6e 5f 62 6c 6b 25 20 2b  |  $(!(win_blk% +|
00020700  20 37 36 29 29 20 3d 20  c0 74 69 74 6c 65 24 2c  | 76)) = .title$,|
00020710  74 5f 62 75 66 66 65 72  5f 6c 65 6e 25 20 2d 20  |t_buffer_len% - |
00020720  31 29 0d 10 a2 2a 20 20  e7 20 28 28 77 69 6e 5f  |1)...*  . ((win_|
00020730  62 6c 6b 25 21 33 32 29  20 80 20 28 31 20 3c 3c  |blk%!32) . (1 <<|
00020740  20 31 36 29 29 20 3c 3e  20 30 20 8c 0d 10 a3 39  | 16)) <> 0 ....9|
00020750  20 20 20 20 f4 20 57 69  6e 64 6f 77 20 69 73 20  |    . Window is |
00020760  6f 70 65 6e 2c 20 73 6f  20 72 65 64 72 61 77 20  |open, so redraw |
00020770  74 68 65 20 74 69 74 6c  65 20 62 61 72 20 61 72  |the title bar ar|
00020780  65 61 2e 2e 2e 0d 10 a4  54 20 20 20 20 c8 99 20  |ea......T    .. |
00020790  22 57 69 6d 70 5f 46 6f  72 63 65 52 65 64 72 61  |"Wimp_ForceRedra|
000207a0  77 22 2c 2d 31 2c 77 69  6e 5f 62 6c 6b 25 21 34  |w",-1,win_blk%!4|
000207b0  2c 77 69 6e 5f 62 6c 6b  25 21 31 36 2c 77 69 6e  |,win_blk%!16,win|
000207c0  5f 62 6c 6b 25 21 31 32  2c 77 69 6e 5f 62 6c 6b  |_blk%!12,win_blk|
000207d0  25 21 31 36 20 2b 20 34  34 0d 10 a5 07 20 20 cd  |%!16 + 44....  .|
000207e0  0d 10 a6 26 20 20 f2 73  68 65 6c 6c 5f 48 65 61  |...&  .shell_Hea|
000207f0  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 77 69 6e  |pBlockReturn(win|
00020800  5f 62 6c 6b 25 29 0d 10  a7 05 cd 0d 10 a8 05 e1  |_blk%)..........|
00020810  0d 10 a9 05 3a 0d 10 aa  22 2a 7c 53 74 6f 70 20  |....:..."*|Stop |
00020820  50 52 4f 43 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |PROCshell_Window|
00020830  52 65 74 69 74 6c 65 0d  10 ab 04 0d 10 ac 29 2a  |Retitle.......)*|
00020840  7c 53 74 61 72 74 20 46  4e 73 68 65 6c 6c 5f 57  ||Start FNshell_W|
00020850  69 6e 64 6f 77 54 69 74  6c 65 49 6e 64 69 72 65  |indowTitleIndire|
00020860  63 74 65 64 0d 10 ad 29  dd 20 a4 73 68 65 6c 6c  |cted...). .shell|
00020870  5f 57 69 6e 64 6f 77 54  69 74 6c 65 49 6e 64 69  |_WindowTitleIndi|
00020880  72 65 63 74 65 64 28 66  6c 61 67 25 29 0d 10 ae  |rected(flag%)...|
00020890  22 e7 20 28 66 6c 61 67  25 20 80 20 28 31 3c 3c  |". (flag% . (1<<|
000208a0  38 29 29 3d 28 31 3c 3c  38 29 20 8c 20 3d b9 0d  |8))=(1<<8) . =..|
000208b0  10 af 06 3d a3 0d 10 b0  05 3a 0d 10 b1 28 2a 7c  |...=.....:...(*||
000208c0  53 74 6f 70 20 46 4e 73  68 65 6c 6c 5f 57 69 6e  |Stop FNshell_Win|
000208d0  64 6f 77 54 69 74 6c 65  49 6e 64 69 72 65 63 74  |dowTitleIndirect|
000208e0  65 64 0d 10 b2 2a 2a 7c  53 74 61 72 74 20 50 52  |ed...**|Start PR|
000208f0  4f 43 73 68 65 6c 6c 5f  53 63 72 65 65 6e 54 6f  |OCshell_ScreenTo|
00020900  57 69 6e 64 6f 77 43 6f  6f 72 64 73 0d 10 b3 35  |WindowCoords...5|
00020910  dd 20 f2 73 68 65 6c 6c  5f 53 63 72 65 65 6e 54  |. .shell_ScreenT|
00020920  6f 57 69 6e 64 6f 77 43  6f 6f 72 64 73 28 57 48  |oWindowCoords(WH|
00020930  61 6e 64 6c 65 25 2c f8  20 58 25 2c f8 20 59 25  |andle%,. X%,. Y%|
00020940  29 0d 10 b4 34 ea 20 54  65 6d 70 25 2c 57 58 4d  |)...4. Temp%,WXM|
00020950  69 6e 25 2c 57 59 4d 69  6e 25 2c 58 53 63 72 6f  |in%,WYMin%,XScro|
00020960  6c 6c 25 2c 59 53 63 72  6f 6c 6c 25 2c 53 63 72  |ll%,YScroll%,Scr|
00020970  61 74 63 68 25 0d 10 b5  52 53 63 72 61 74 63 68  |atch%...RScratch|
00020980  25 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |%=.shell_HeapBlo|
00020990  63 6b 46 65 74 63 68 28  31 30 30 20 2b 20 28 a4  |ckFetch(100 + (.|
000209a0  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 43 6f 75 6e  |shell_WindowCoun|
000209b0  74 49 63 6f 6e 73 28 57  48 61 6e 64 6c 65 25 29  |tIcons(WHandle%)|
000209c0  20 2a 20 33 32 29 29 0d  10 b6 12 54 65 6d 70 25  | * 32))....Temp%|
000209d0  3d 53 63 72 61 74 63 68  25 0d 10 b7 13 21 54 65  |=Scratch%....!Te|
000209e0  6d 70 25 3d 57 48 61 6e  64 6c 65 25 0d 10 b8 22  |mp%=WHandle%..."|
000209f0  c8 99 20 22 57 69 6d 70  5f 47 65 74 57 69 6e 64  |.. "Wimp_GetWind|
00020a00  6f 77 49 6e 66 6f 22 2c  2c 54 65 6d 70 25 0d 10  |owInfo",,Temp%..|
00020a10  b9 15 57 58 4d 69 6e 25  3d 53 63 72 61 74 63 68  |..WXMin%=Scratch|
00020a20  25 21 34 0d 10 ba 16 57  59 4d 61 78 25 3d 53 63  |%!4....WYMax%=Sc|
00020a30  72 61 74 63 68 25 21 31  36 0d 10 bb 18 58 53 63  |ratch%!16....XSc|
00020a40  72 6f 6c 6c 25 3d 53 63  72 61 74 63 68 25 21 32  |roll%=Scratch%!2|
00020a50  30 0d 10 bc 18 59 53 63  72 6f 6c 6c 25 3d 53 63  |0....YScroll%=Sc|
00020a60  72 61 74 63 68 25 21 32  34 0d 10 bd 1b 58 25 3d  |ratch%!24....X%=|
00020a70  58 25 2b 28 58 53 63 72  6f 6c 6c 25 2d 57 58 4d  |X%+(XScroll%-WXM|
00020a80  69 6e 25 29 0d 10 be 1b  59 25 3d 59 25 2b 28 59  |in%)....Y%=Y%+(Y|
00020a90  53 63 72 6f 6c 6c 25 2d  57 59 4d 61 78 25 29 0d  |Scroll%-WYMax%).|
00020aa0  10 bf 24 f2 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |..$.shell_HeapBl|
00020ab0  6f 63 6b 52 65 74 75 72  6e 28 53 63 72 61 74 63  |ockReturn(Scratc|
00020ac0  68 25 29 0d 10 c0 05 e1  0d 10 c1 05 3a 0d 10 c2  |h%).........:...|
00020ad0  29 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  |)*|Stop PROCshel|
00020ae0  6c 5f 53 63 72 65 65 6e  54 6f 57 69 6e 64 6f 77  |l_ScreenToWindow|
00020af0  43 6f 6f 72 64 73 0d 10  c3 23 2a 7c 53 74 61 72  |Coords...#*|Star|
00020b00  74 20 46 4e 73 68 65 6c  6c 5f 57 69 6d 70 53 6c  |t FNshell_WimpSl|
00020b10  6f 74 52 65 61 64 45 6e  64 0d 10 c4 1c dd 20 a4  |otReadEnd..... .|
00020b20  73 68 65 6c 6c 5f 57 69  6d 70 53 6c 6f 74 52 65  |shell_WimpSlotRe|
00020b30  61 64 45 6e 64 0d 10 c5  0a ea 20 6d 65 6d 25 0d  |adEnd..... mem%.|
00020b40  10 c6 23 c8 99 20 22 57  69 6d 70 5f 53 6c 6f 74  |..#.. "Wimp_Slot|
00020b50  53 69 7a 65 22 2c 2d 31  2c 2d 31 20 b8 20 6d 65  |Size",-1,-1 . me|
00020b60  6d 25 0d 10 c7 09 3d 6d  65 6d 25 0d 10 c8 05 3a  |m%....=mem%....:|
00020b70  0d 10 c9 22 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |..."*|Stop FNshe|
00020b80  6c 6c 5f 57 69 6d 70 53  6c 6f 74 52 65 61 64 45  |ll_WimpSlotReadE|
00020b90  6e 64 0d 10 ca 27 2a 7c  53 74 61 72 74 20 46 4e  |nd...'*|Start FN|
00020ba0  73 68 65 6c 6c 5f 57 69  6d 70 53 6c 6f 74 43 6c  |shell_WimpSlotCl|
00020bb0  61 69 6d 4d 65 6d 6f 72  79 0d 10 cb 2c dd 20 a4  |aimMemory...,. .|
00020bc0  73 68 65 6c 6c 5f 57 69  6d 70 53 6c 6f 74 43 6c  |shell_WimpSlotCl|
00020bd0  61 69 6d 4d 65 6d 6f 72  79 28 6d 65 6d 25 2c 73  |aimMemory(mem%,s|
00020be0  69 7a 65 25 29 0d 10 cc  0c ea 20 73 73 69 7a 65  |ize%)..... ssize|
00020bf0  25 0d 10 cd 2d c8 99 20  22 57 69 6d 70 5f 53 6c  |%...-.. "Wimp_Sl|
00020c00  6f 74 53 69 7a 65 22 2c  6d 65 6d 25 2b 73 69 7a  |otSize",mem%+siz|
00020c10  65 25 2c 2d 31 20 b8 20  73 73 69 7a 65 25 0d 10  |e%,-1 . ssize%..|
00020c20  ce 1d e7 20 73 73 69 7a  65 25 3c 6d 65 6d 25 2b  |... ssize%<mem%+|
00020c30  73 69 7a 65 25 20 8c 20  3d 2d 31 0d 10 cf 0c 3d  |size% . =-1....=|
00020c40  20 73 73 69 7a 65 25 0d  10 d0 05 3a 0d 10 d1 26  | ssize%....:...&|
00020c50  2a 7c 53 74 6f 70 20 46  4e 73 68 65 6c 6c 5f 57  |*|Stop FNshell_W|
00020c60  69 6d 70 53 6c 6f 74 43  6c 61 69 6d 4d 65 6d 6f  |impSlotClaimMemo|
00020c70  72 79 0d 10 d2 2b 2a 7c  53 74 61 72 74 20 50 52  |ry...+*|Start PR|
00020c80  4f 43 73 68 65 6c 6c 5f  57 69 6d 70 53 6c 6f 74  |OCshell_WimpSlot|
00020c90  52 65 6c 65 61 73 65 4d  65 6d 6f 72 79 0d 10 d3  |ReleaseMemory...|
00020ca0  22 dd 20 f2 73 68 65 6c  6c 5f 57 69 6d 70 53 6c  |". .shell_WimpSl|
00020cb0  6f 74 52 65 6c 65 61 73  65 4d 65 6d 6f 72 79 0d  |otReleaseMemory.|
00020cc0  10 d4 1e c8 99 20 22 57  69 6d 70 5f 53 6c 6f 74  |..... "Wimp_Slot|
00020cd0  53 69 7a 65 22 2c 6d 65  6d 25 2c 2d 31 0d 10 d5  |Size",mem%,-1...|
00020ce0  05 e1 0d 10 d6 05 3a 0d  10 d7 2a 2a 7c 53 74 6f  |......:...**|Sto|
00020cf0  70 20 50 52 4f 43 73 68  65 6c 6c 5f 57 69 6d 70  |p PROCshell_Wimp|
00020d00  53 6c 6f 74 52 65 6c 65  61 73 65 4d 65 6d 6f 72  |SlotReleaseMemor|
00020d10  79 0d 10 d8 20 2a 7c 53  74 61 72 74 20 50 52 4f  |y... *|Start PRO|
00020d20  43 73 68 65 6c 6c 5f 4d  6f 75 73 65 4c 69 6d 69  |Cshell_MouseLimi|
00020d30  74 0d 10 d9 23 dd 20 f2  73 68 65 6c 6c 5f 4d 6f  |t...#. .shell_Mo|
00020d40  75 73 65 4c 69 6d 69 74  28 62 2c 77 68 61 6e 64  |useLimit(b,whand|
00020d50  6c 65 25 29 0d 10 da 2c  62 21 30 3d 77 68 61 6e  |le%)...,b!0=whan|
00020d60  64 6c 65 25 3a c8 99 20  22 57 69 6d 70 5f 47 65  |dle%:.. "Wimp_Ge|
00020d70  74 57 69 6e 64 6f 77 53  74 61 74 65 22 2c 2c 62  |tWindowState",,b|
00020d80  0d 10 db 2f f2 6d 6f 75  73 65 5f 72 65 63 74 61  |.../.mouse_recta|
00020d90  6e 67 6c 65 28 62 21 34  2c 62 21 38 2c 62 21 31  |ngle(b!4,b!8,b!1|
00020da0  32 2d 62 21 34 2c 62 21  31 36 2d 62 21 38 29 0d  |2-b!4,b!16-b!8).|
00020db0  10 dc 05 e1 0d 10 dd 05  3a 0d 10 de 1f 2a 7c 53  |........:....*|S|
00020dc0  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 4d 6f  |top PROCshell_Mo|
00020dd0  75 73 65 4c 69 6d 69 74  0d 10 df 25 2a 7c 53 74  |useLimit...%*|St|
00020de0  61 72 74 20 46 4e 73 68  65 6c 6c 5f 4e 61 6d 65  |art FNshell_Name|
00020df0  4f 66 46 69 72 73 74 53  70 72 69 74 65 0d 10 e0  |OfFirstSprite...|
00020e00  25 dd 20 a4 73 68 65 6c  6c 5f 4e 61 6d 65 4f 66  |%. .shell_NameOf|
00020e10  46 69 72 73 74 53 70 72  69 74 65 28 46 69 6c 65  |FirstSprite(File|
00020e20  24 29 0d 10 e1 0e ea 20  58 25 2c 4e 25 2c 53 24  |$)..... X%,N%,S$|
00020e30  0d 10 e2 0f 58 25 3d 8e  28 46 69 6c 65 24 29 0d  |....X%=.(File$).|
00020e40  10 e3 0a cf 23 58 25 3d  34 0d 10 e4 0b 4e 25 3d  |....#X%=4....N%=|
00020e50  9a 23 58 25 0d 10 e5 11  4e 25 2b 3d 9a 23 58 25  |.#X%....N%+=.#X%|
00020e60  2a 26 31 30 30 0d 10 e6  13 4e 25 2b 3d 9a 23 58  |*&100....N%+=.#X|
00020e70  25 2a 26 31 30 30 30 30  0d 10 e7 15 4e 25 2b 3d  |%*&10000....N%+=|
00020e80  9a 23 58 25 2a 26 31 30  30 30 30 30 30 0d 10 e8  |.#X%*&1000000...|
00020e90  0b cf 23 58 25 3d 4e 25  0d 10 e9 09 53 24 3d 22  |..#X%=N%....S$="|
00020ea0  22 0d 10 ea 0f e3 20 4e  25 3d 30 20 b8 20 31 31  |"..... N%=0 . 11|
00020eb0  0d 10 eb 0f 53 24 2b 3d  bd 28 9a 23 58 25 29 0d  |....S$+=.(.#X%).|
00020ec0  10 ec 05 ed 0d 10 ed 08  d9 23 58 25 0d 10 ee 07  |.........#X%....|
00020ed0  3d 53 24 0d 10 ef 05 3a  0d 10 f0 24 2a 7c 53 74  |=S$....:...$*|St|
00020ee0  6f 70 20 46 4e 73 68 65  6c 6c 5f 4e 61 6d 65 4f  |op FNshell_NameO|
00020ef0  66 46 69 72 73 74 53 70  72 69 74 65 0d 10 f1 04  |fFirstSprite....|
00020f00  0d 10 f2 24 2a 7c 53 74  61 72 74 20 50 52 4f 43  |...$*|Start PROC|
00020f10  49 6e 69 74 69 61 6c 69  73 65 53 70 72 69 74 65  |InitialiseSprite|
00020f20  41 72 65 61 0d 10 f3 27  dd 20 f2 49 6e 69 74 69  |Area...'. .Initi|
00020f30  61 6c 69 73 65 53 70 72  69 74 65 41 72 65 61 28  |aliseSpriteArea(|
00020f40  53 25 2c 4c 65 6e 67 74  68 25 29 0d 10 f4 0f 21  |S%,Length%)....!|
00020f50  53 25 3d 4c 65 6e 67 74  68 25 0d 10 f5 0b 53 25  |S%=Length%....S%|
00020f60  21 38 3d 31 36 0d 10 f6  1d c8 99 20 22 4f 53 5f  |!8=16...... "OS_|
00020f70  53 70 72 69 74 65 4f 70  22 2c 39 2b 32 35 36 2c  |SpriteOp",9+256,|
00020f80  53 25 0d 10 f7 05 e1 0d  10 f8 05 3a 0d 10 f9 23  |S%.........:...#|
00020f90  2a 7c 53 74 6f 70 20 50  52 4f 43 49 6e 69 74 69  |*|Stop PROCIniti|
00020fa0  61 6c 69 73 65 53 70 72  69 74 65 41 72 65 61 0d  |aliseSpriteArea.|
00020fb0  10 fa 04 0d 10 fb 20 2a  7c 53 74 61 72 74 20 50  |...... *|Start P|
00020fc0  52 4f 43 73 68 65 6c 6c  5f 4c 69 73 74 45 76 65  |ROCshell_ListEve|
00020fd0  6e 74 73 0d 10 fc 20 dd  20 f2 73 68 65 6c 6c 5f  |nts... . .shell_|
00020fe0  4c 69 73 74 45 76 65 6e  74 73 28 77 68 25 2c 69  |ListEvents(wh%,i|
00020ff0  63 25 29 0d 10 fd 11 ea  20 6d 65 6e 75 25 2c 6d  |c%)..... menu%,m|
00021000  65 6e 75 24 0d 10 fe 15  e7 20 77 68 25 3d 2d 31  |enu$..... wh%=-1|
00021010  20 8c 20 77 68 25 3d 2d  32 0d 10 ff 46 f2 73 68  | . wh%=-2...F.sh|
00021020  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 4d 65 6e  |ell_Tracef0("Men|
00021030  75 53 65 6c 65 63 74 69  6f 6e 3d 22 2b a4 73 68  |uSelection="+.sh|
00021040  65 6c 6c 5f 47 65 74 45  76 65 6e 74 48 61 6e 64  |ell_GetEventHand|
00021050  6c 65 72 28 77 68 25 2c  69 63 25 2c 30 29 29 0d  |ler(wh%,ic%,0)).|
00021060  11 00 46 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |..F.shell_Tracef|
00021070  30 28 22 4d 65 6e 75 4d  61 6b 65 72 20 20 20 20  |0("MenuMaker    |
00021080  3d 22 2b a4 73 68 65 6c  6c 5f 47 65 74 45 76 65  |="+.shell_GetEve|
00021090  6e 74 48 61 6e 64 6c 65  72 28 77 68 25 2c 69 63  |ntHandler(wh%,ic|
000210a0  25 2c 31 29 29 0d 11 01  46 f2 73 68 65 6c 6c 5f  |%,1))...F.shell_|
000210b0  54 72 61 63 65 66 30 28  22 43 6c 69 63 6b 53 65  |Tracef0("ClickSe|
000210c0  6c 65 63 74 20 20 3d 22  2b a4 73 68 65 6c 6c 5f  |lect  ="+.shell_|
000210d0  47 65 74 45 76 65 6e 74  48 61 6e 64 6c 65 72 28  |GetEventHandler(|
000210e0  77 68 25 2c 69 63 25 2c  32 29 29 0d 11 02 46 f2  |wh%,ic%,2))...F.|
000210f0  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 43  |shell_Tracef0("C|
00021100  6c 69 63 6b 41 64 6a 75  73 74 20 20 3d 22 2b a4  |lickAdjust  ="+.|
00021110  73 68 65 6c 6c 5f 47 65  74 45 76 65 6e 74 48 61  |shell_GetEventHa|
00021120  6e 64 6c 65 72 28 77 68  25 2c 69 63 25 2c 33 29  |ndler(wh%,ic%,3)|
00021130  29 0d 11 03 46 f2 73 68  65 6c 6c 5f 54 72 61 63  |)...F.shell_Trac|
00021140  65 66 30 28 22 52 65 64  72 61 77 20 20 20 20 20  |ef0("Redraw     |
00021150  20 20 3d 22 2b a4 73 68  65 6c 6c 5f 47 65 74 45  |  ="+.shell_GetE|
00021160  76 65 6e 74 48 61 6e 64  6c 65 72 28 77 68 25 2c  |ventHandler(wh%,|
00021170  69 63 25 2c 34 29 29 0d  11 04 46 f2 73 68 65 6c  |ic%,4))...F.shel|
00021180  6c 5f 54 72 61 63 65 66  30 28 22 4b 65 79 70 72  |l_Tracef0("Keypr|
00021190  65 73 73 20 20 20 20 20  3d 22 2b a4 73 68 65 6c  |ess     ="+.shel|
000211a0  6c 5f 47 65 74 45 76 65  6e 74 48 61 6e 64 6c 65  |l_GetEventHandle|
000211b0  72 28 77 68 25 2c 69 63  25 2c 35 29 29 0d 11 05  |r(wh%,ic%,5))...|
000211c0  46 f2 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  |F.shell_Tracef0(|
000211d0  22 44 72 61 67 20 20 20  20 20 20 20 20 20 3d 22  |"Drag         ="|
000211e0  2b a4 73 68 65 6c 6c 5f  47 65 74 45 76 65 6e 74  |+.shell_GetEvent|
000211f0  48 61 6e 64 6c 65 72 28  77 68 25 2c 69 63 25 2c  |Handler(wh%,ic%,|
00021200  36 29 29 0d 11 06 46 f2  73 68 65 6c 6c 5f 54 72  |6))...F.shell_Tr|
00021210  61 63 65 66 30 28 22 4d  65 6e 75 20 57 61 72 6e  |acef0("Menu Warn|
00021220  69 6e 67 20 3d 22 2b a4  73 68 65 6c 6c 5f 47 65  |ing ="+.shell_Ge|
00021230  74 45 76 65 6e 74 48 61  6e 64 6c 65 72 28 77 68  |tEventHandler(wh|
00021240  25 2c 69 63 25 2c 37 29  29 0d 11 07 46 f2 73 68  |%,ic%,7))...F.sh|
00021250  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 48 65 6c  |ell_Tracef0("Hel|
00021260  70 54 61 67 20 20 20 20  20 20 3d 22 2b a4 73 68  |pTag      ="+.sh|
00021270  65 6c 6c 5f 47 65 74 45  76 65 6e 74 48 61 6e 64  |ell_GetEventHand|
00021280  6c 65 72 28 77 68 25 2c  69 63 25 2c 38 29 29 0d  |ler(wh%,ic%,8)).|
00021290  11 08 28 6d 65 6e 75 25  3d a4 73 68 65 6c 6c 5f  |..(menu%=.shell_|
000212a0  47 65 74 45 76 65 6e 74  4d 65 6e 75 28 32 2c 77  |GetEventMenu(2,w|
000212b0  68 25 2c 69 63 25 29 0d  11 09 0f e7 20 6d 65 6e  |h%,ic%)..... men|
000212c0  75 25 3d 30 20 8c 0d 11  0a 12 20 20 6d 65 6e 75  |u%=0 .....  menu|
000212d0  24 3d 22 4e 6f 6e 65 22  0d 11 0b 05 cc 0d 11 0c  |$="None"........|
000212e0  12 20 20 6d 65 6e 75 24  3d c3 6d 65 6e 75 25 0d  |.  menu$=.menu%.|
000212f0  11 0d 05 cd 0d 11 0e 2a  f2 73 68 65 6c 6c 5f 54  |.......*.shell_T|
00021300  72 61 63 65 66 30 28 22  4d 65 6e 75 20 68 61 6e  |racef0("Menu han|
00021310  64 6c 65 20 3d 26 22 2b  6d 65 6e 75 24 29 0d 11  |dle =&"+menu$)..|
00021320  0f 05 e1 0d 11 10 1f 2a  7c 53 74 6f 70 20 50 52  |.......*|Stop PR|
00021330  4f 43 73 68 65 6c 6c 5f  4c 69 73 74 45 76 65 6e  |OCshell_ListEven|
00021340  74 73 0d 11 11 04 0d 11  12 4c f4 20 2d 2d 2d 2d  |ts.......L. ----|
00021350  2d 2d 2d 2d 2d 2d 2d 20  48 65 61 70 20 4d 61 6e  |------- Heap Man|
00021360  61 67 65 72 20 52 6f 75  74 69 6e 65 73 20 2d 2d  |ager Routines --|
00021370  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00021390  2d 2d 0d 11 13 04 0d 11  14 30 f4 20 46 75 6e 63  |--.......0. Func|
000213a0  74 69 6f 6e 20 74 6f 20  6c 6f 61 64 20 68 65 61  |tion to load hea|
000213b0  70 20 6d 61 6e 61 67 65  72 20 6d 61 63 68 69 6e  |p manager machin|
000213c0  65 20 63 6f 64 65 0d 11  15 04 0d 11 16 25 2a 7c  |e code.......%*||
000213d0  53 74 61 72 74 20 50 52  4f 43 73 68 65 6c 6c 5f  |Start PROCshell_|
000213e0  48 65 61 70 4d 61 6e 61  67 65 72 49 6e 69 74 0d  |HeapManagerInit.|
000213f0  11 17 2a dd 20 f2 73 68  65 6c 6c 5f 48 65 61 70  |..*. .shell_Heap|
00021400  4d 61 6e 61 67 65 72 49  6e 69 74 28 70 61 74 68  |ManagerInit(path|
00021410  24 2c 73 70 61 63 65 25  29 0d 11 18 15 de 20 5f  |$,space%)..... _|
00021420  68 65 61 70 5f 63 6f 64  65 25 20 39 30 30 0d 11  |heap_code% 900..|
00021430  19 2e ff 28 22 4c 4f 41  44 20 22 2b 70 61 74 68  |...("LOAD "+path|
00021440  24 2b 22 68 65 61 70 63  6f 64 65 20 22 2b c3 7e  |$+"heapcode "+.~|
00021450  5f 68 65 61 70 5f 63 6f  64 65 25 29 0d 11 1a 1a  |_heap_code%)....|
00021460  d6 20 5f 68 65 61 70 5f  63 6f 64 65 25 2b 30 2c  |. _heap_code%+0,|
00021470  73 70 61 63 65 25 0d 11  1b 05 e1 0d 11 1c 05 3a  |space%.........:|
00021480  0d 11 1d 24 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |...$*|Stop PROCs|
00021490  68 65 6c 6c 5f 48 65 61  70 4d 61 6e 61 67 65 72  |hell_HeapManager|
000214a0  49 6e 69 74 0d 11 1e 04  0d 11 1f 23 2a 7c 53 74  |Init.......#*|St|
000214b0  61 72 74 20 46 4e 73 68  65 6c 6c 5f 48 65 61 70  |art FNshell_Heap|
000214c0  42 6c 6f 63 6b 45 78 69  73 74 73 0d 11 20 23 dd  |BlockExists.. #.|
000214d0  20 a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
000214e0  6b 45 78 69 73 74 73 28  61 64 64 72 25 29 0d 11  |kExists(addr%)..|
000214f0  21 0b ea 20 76 6f 69 64  25 0d 11 22 07 ea 20 85  |!.. void%..".. .|
00021500  0d 11 23 10 ee 20 85 20  ea 3a f7 20 85 3a 3d a3  |..#.. . .:. .:=.|
00021510  0d 11 24 3f e7 20 61 64  64 72 25 3c 26 38 30 30  |..$?. addr%<&800|
00021520  30 20 8c 20 85 20 39 39  2c 22 4e 6f 20 68 65 61  |0 . . 99,"No hea|
00021530  70 62 6c 6f 63 6b 20 64  65 66 69 6e 65 64 20 61  |pblock defined a|
00021540  74 20 74 68 69 73 20 61  64 64 72 65 73 73 22 0d  |t this address".|
00021550  11 25 25 76 6f 69 64 25  3d a4 73 68 65 6c 6c 5f  |.%%void%=.shell_|
00021560  48 65 61 70 42 6c 6f 63  6b 49 6e 66 6f 28 61 64  |HeapBlockInfo(ad|
00021570  64 72 25 29 0d 11 26 0a  f7 20 85 3a 3d b9 0d 11  |dr%)..&.. .:=...|
00021580  27 22 2a 7c 53 74 6f 70  20 46 4e 73 68 65 6c 6c  |'"*|Stop FNshell|
00021590  5f 48 65 61 70 42 6c 6f  63 6b 45 78 69 73 74 73  |_HeapBlockExists|
000215a0  0d 11 28 04 0d 11 29 23  2a 7c 53 74 61 72 74 20  |..(...)#*|Start |
000215b0  46 4e 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |FNshell_HeapBloc|
000215c0  6b 45 78 74 65 6e 64 0d  11 2a 04 0d 11 2b 04 0d  |kExtend..*...+..|
000215d0  11 2c 37 2a 7c 21 46 75  6e 63 74 69 6f 6e 20 74  |.,7*|!Function t|
000215e0  6f 20 65 78 74 65 6e 64  20 61 6c 72 65 61 64 79  |o extend already|
000215f0  20 61 6c 6c 6f 63 61 74  65 64 20 68 65 61 70 20  | allocated heap |
00021600  62 6c 6f 63 6b 2e 0d 11  2d 24 2a 7c 21 61 25 20  |block...-$*|!a% |
00021610  3d 20 63 75 72 72 65 6e  74 20 61 64 64 72 65 73  |= current addres|
00021620  73 20 6f 66 20 62 6c 6f  63 6b 0d 11 2e 4a 2a 7c  |s of block...J*||
00021630  21 62 25 20 3d 20 61 6d  6f 75 6e 74 20 74 6f 20  |!b% = amount to |
00021640  69 6e 63 72 65 61 73 65  20 6f 72 20 64 65 63 72  |increase or decr|
00021650  65 61 73 65 20 62 6c 6f  63 6b 20 73 69 7a 65 20  |ease block size |
00021660  62 79 20 28 2d 76 65 20  74 6f 20 64 65 63 72 65  |by (-ve to decre|
00021670  61 73 65 29 0d 11 2f 34  2a 7c 21 72 65 74 75 72  |ase)../4*|!retur|
00021680  6e 73 20 61 64 64 72 65  73 73 20 6f 66 20 62 6c  |ns address of bl|
00021690  6f 63 6b 20 28 62 6c 6f  63 6b 20 6d 61 79 20 62  |ock (block may b|
000216a0  65 20 6d 6f 76 65 64 29  0d 11 30 23 dd 20 a4 73  |e moved)..0#. .s|
000216b0  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 45 78  |hell_HeapBlockEx|
000216c0  74 65 6e 64 28 61 25 2c  62 25 29 0d 11 31 1a d6  |tend(a%,b%)..1..|
000216d0  20 5f 68 65 61 70 5f 63  6f 64 65 25 2b 31 32 2c  | _heap_code%+12,|
000216e0  61 25 2c 62 25 0d 11 32  07 3d 61 25 0d 11 33 22  |a%,b%..2.=a%..3"|
000216f0  2a 7c 53 74 6f 70 20 46  4e 73 68 65 6c 6c 5f 48  |*|Stop FNshell_H|
00021700  65 61 70 42 6c 6f 63 6b  45 78 74 65 6e 64 0d 11  |eapBlockExtend..|
00021710  34 04 0d 11 35 22 2a 7c  53 74 61 72 74 20 46 4e  |4...5"*|Start FN|
00021720  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
00021730  65 74 63 68 0d 11 36 2f  2a 7c 21 46 75 6e 63 74  |etch..6/*|!Funct|
00021740  69 6f 6e 20 74 6f 20 61  6c 6c 6f 63 61 74 65 20  |ion to allocate |
00021750  61 20 62 6c 6f 63 6b 20  6f 6e 20 74 68 65 20 68  |a block on the h|
00021760  65 61 70 0d 11 37 2c 2a  7c 21 61 25 20 3d 20 73  |eap..7,*|!a% = s|
00021770  69 7a 65 20 6f 66 20 62  6c 6f 63 6b 20 74 6f 20  |ize of block to |
00021780  66 65 74 63 68 20 66 72  6f 6d 20 68 65 61 70 0d  |fetch from heap.|
00021790  11 38 29 2a 7c 21 72 65  74 75 72 6e 73 20 61 64  |.8)*|!returns ad|
000217a0  64 72 65 73 73 20 6f 66  20 61 6c 6c 6f 63 61 74  |dress of allocat|
000217b0  65 64 20 62 6c 6f 63 6b  0d 11 39 1f dd 20 a4 73  |ed block..9.. .s|
000217c0  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 46 65  |hell_HeapBlockFe|
000217d0  74 63 68 28 61 25 29 0d  11 3a 0b ea 20 61 64 64  |tch(a%)..:.. add|
000217e0  72 25 0d 11 3b 1c d6 20  5f 68 65 61 70 5f 63 6f  |r%..;.. _heap_co|
000217f0  64 65 25 2b 34 2c 61 64  64 72 25 2c 61 25 0d 11  |de%+4,addr%,a%..|
00021800  3c 0a 3d 61 64 64 72 25  0d 11 3d 21 2a 7c 53 74  |<.=addr%..=!*|St|
00021810  6f 70 20 46 4e 73 68 65  6c 6c 5f 48 65 61 70 42  |op FNshell_HeapB|
00021820  6c 6f 63 6b 46 65 74 63  68 0d 11 3e 04 0d 11 3f  |lockFetch..>...?|
00021830  25 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |%*|Start PROCshe|
00021840  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 52 65 74 75  |ll_HeapBlockRetu|
00021850  72 6e 0d 11 40 33 2a 7c  21 50 72 6f 63 65 64 75  |rn..@3*|!Procedu|
00021860  72 65 20 74 6f 20 72 65  74 75 72 6e 20 61 20 68  |re to return a h|
00021870  65 61 70 20 62 6c 6f 63  6b 20 74 6f 20 74 68 65  |eap block to the|
00021880  20 68 65 61 70 0d 11 41  2a 2a 7c 21 61 25 20 3d  | heap..A**|!a% =|
00021890  20 61 64 64 72 65 73 73  20 6f 66 20 62 6c 6f 63  | address of bloc|
000218a0  6b 20 74 6f 20 64 65 61  6c 6c 6f 63 61 74 65 0d  |k to deallocate.|
000218b0  11 42 22 dd 20 f2 73 68  65 6c 6c 5f 48 65 61 70  |.B". .shell_Heap|
000218c0  42 6c 6f 63 6b 52 65 74  75 72 6e 28 f8 20 61 25  |BlockReturn(. a%|
000218d0  29 0d 11 43 35 e7 20 a4  73 68 65 6c 6c 5f 48 65  |)..C5. .shell_He|
000218e0  61 70 42 6c 6f 63 6b 45  78 69 73 74 73 28 61 25  |apBlockExists(a%|
000218f0  29 20 8c 20 d6 20 5f 68  65 61 70 5f 63 6f 64 65  |) . . _heap_code|
00021900  25 2b 38 2c 61 25 0d 11  44 08 61 25 3d 30 0d 11  |%+8,a%..D.a%=0..|
00021910  45 05 e1 0d 11 46 24 2a  7c 53 74 6f 70 20 50 52  |E....F$*|Stop PR|
00021920  4f 43 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |OCshell_HeapBloc|
00021930  6b 52 65 74 75 72 6e 0d  11 47 04 0d 11 48 21 2a  |kReturn..G...H!*|
00021940  7c 53 74 61 72 74 20 46  4e 73 68 65 6c 6c 5f 48  ||Start FNshell_H|
00021950  65 61 70 42 6c 6f 63 6b  49 6e 66 6f 0d 11 49 38  |eapBlockInfo..I8|
00021960  2a 7c 21 46 75 6e 63 74  69 6f 6e 20 74 6f 20 72  |*|!Function to r|
00021970  65 74 75 72 6e 20 63 75  72 72 65 6e 74 20 6c 65  |eturn current le|
00021980  6e 67 74 68 20 6f 66 20  61 20 68 65 61 70 20 62  |ngth of a heap b|
00021990  6c 6f 63 6b 0d 11 4a 1e  2a 7c 21 61 25 20 3d 20  |lock..J.*|!a% = |
000219a0  61 64 64 72 20 6f 66 20  68 65 61 70 20 62 6c 6f  |addr of heap blo|
000219b0  63 6b 0d 11 4b 1e dd 20  a4 73 68 65 6c 6c 5f 48  |ck..K.. .shell_H|
000219c0  65 61 70 42 6c 6f 63 6b  49 6e 66 6f 28 61 25 29  |eapBlockInfo(a%)|
000219d0  0d 11 4c 08 ea 20 72 33  0d 11 4d 2f c8 99 20 22  |..L.. r3..M/.. "|
000219e0  4f 53 5f 48 65 61 70 22  2c 36 2c 21 28 5f 68 65  |OS_Heap",6,!(_he|
000219f0  61 70 5f 63 6f 64 65 25  2b 32 38 29 2c 61 25 20  |ap_code%+28),a% |
00021a00  b8 20 2c 2c 2c 72 33 0d  11 4e 07 3d 72 33 0d 11  |. ,,,r3..N.=r3..|
00021a10  4f 05 3a 0d 11 50 20 2a  7c 53 74 6f 70 20 46 4e  |O.:..P *|Stop FN|
00021a20  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 49  |shell_HeapBlockI|
00021a30  6e 66 6f 0d 11 51 04 0d  11 52 1f 2a 7c 53 74 61  |nfo..Q...R.*|Sta|
00021a40  72 74 20 46 4e 73 68 65  6c 6c 5f 4f 53 56 61 72  |rt FNshell_OSVar|
00021a50  45 78 69 73 74 73 0d 11  53 2a dd 20 a4 73 68 65  |Exists..S*. .she|
00021a60  6c 6c 5f 4f 53 56 61 72  45 78 69 73 74 73 28 62  |ll_OSVarExists(b|
00021a70  75 66 66 65 72 25 2c 76  61 72 6e 61 6d 65 24 29  |uffer%,varname$)|
00021a80  0d 11 54 0e ea 20 6e 72  5f 62 79 74 65 73 0d 11  |..T.. nr_bytes..|
00021a90  55 3c c8 99 20 22 58 4f  53 5f 52 65 61 64 56 61  |U<.. "XOS_ReadVa|
00021aa0  72 56 61 6c 22 2c 76 61  72 6e 61 6d 65 24 2c 62  |rVal",varname$,b|
00021ab0  75 66 66 65 72 25 2c 2d  31 2c 30 2c 30 20 b8 20  |uffer%,-1,0,0 . |
00021ac0  2c 2c 6e 72 5f 62 79 74  65 73 0d 11 56 15 e7 20  |,,nr_bytes..V.. |
00021ad0  6e 72 5f 62 79 74 65 73  3c 30 20 8c 20 3d b9 0d  |nr_bytes<0 . =..|
00021ae0  11 57 06 3d a3 0d 11 58  05 3a 0d 11 59 1e 2a 7c  |.W.=...X.:..Y.*||
00021af0  53 74 6f 70 20 46 4e 73  68 65 6c 6c 5f 4f 53 56  |Stop FNshell_OSV|
00021b00  61 72 45 78 69 73 74 73  0d 11 5a 04 0d 11 5b 1f  |arExists..Z...[.|
00021b10  2a 7c 53 74 61 72 74 20  46 4e 73 68 65 6c 6c 5f  |*|Start FNshell_|
00021b20  4f 53 56 61 72 47 65 74  56 61 6c 0d 11 5c 37 dd  |OSVarGetVal..\7.|
00021b30  20 a4 73 68 65 6c 6c 5f  4f 53 56 61 72 47 65 74  | .shell_OSVarGet|
00021b40  56 61 6c 28 62 75 66 66  65 72 25 2c 73 69 7a 65  |Val(buffer%,size|
00021b50  25 2c 76 61 72 6e 61 6d  65 24 2c 65 78 70 61 6e  |%,varname$,expan|
00021b60  64 29 0d 11 5d 1e ea 20  76 61 6c 75 65 24 2c 6e  |d)..].. value$,n|
00021b70  72 5f 62 79 74 65 73 2c  6e 61 6d 65 70 74 72 25  |r_bytes,nameptr%|
00021b80  0d 11 5e 5a c8 99 20 22  58 4f 53 5f 52 65 61 64  |..^Z.. "XOS_Read|
00021b90  56 61 72 56 61 6c 22 2c  76 61 72 6e 61 6d 65 24  |VarVal",varname$|
00021ba0  2c 62 75 66 66 65 72 25  2c 73 69 7a 65 25 2c 30  |,buffer%,size%,0|
00021bb0  2c 2d 33 2a 28 65 78 70  61 6e 64 3d b9 29 20 b8  |,-3*(expand=.) .|
00021bc0  20 2c 2c 6e 72 5f 62 79  74 65 73 2c 6e 61 6d 65  | ,,nr_bytes,name|
00021bd0  70 74 72 25 2c 74 79 70  65 25 0d 11 5f 1a e3 20  |ptr%,type%.._.. |
00021be0  6c 6f 6f 70 25 3d 30 20  b8 20 6e 72 5f 62 79 74  |loop%=0 . nr_byt|
00021bf0  65 73 2d 31 0d 11 60 24  20 20 76 61 6c 75 65 24  |es-1..`$  value$|
00021c00  3d 76 61 6c 75 65 24 2b  bd 28 62 75 66 66 65 72  |=value$+.(buffer|
00021c10  25 3f 6c 6f 6f 70 25 29  0d 11 61 0b ed 20 6c 6f  |%?loop%)..a.. lo|
00021c20  6f 70 25 0d 11 62 0b 3d  76 61 6c 75 65 24 0d 11  |op%..b.=value$..|
00021c30  63 05 3a 0d 11 64 1e 2a  7c 53 74 6f 70 20 46 4e  |c.:..d.*|Stop FN|
00021c40  73 68 65 6c 6c 5f 4f 53  56 61 72 47 65 74 56 61  |shell_OSVarGetVa|
00021c50  6c 0d 11 65 04 0d 11 66  24 2a 7c 53 74 61 72 74  |l..e...f$*|Start|
00021c60  20 46 4e 73 68 65 6c 6c  5f 4f 53 52 65 61 64 43  | FNshell_OSReadC|
00021c70  6f 6d 6d 61 6e 64 41 72  67 0d 11 67 22 dd 20 a4  |ommandArg..g". .|
00021c80  73 68 65 6c 6c 5f 4f 53  52 65 61 64 43 6f 6d 6d  |shell_OSReadComm|
00021c90  61 6e 64 41 72 67 28 6f  70 74 29 0d 11 68 1f ea  |andArg(opt)..h..|
00021ca0  20 70 6f 69 6e 74 65 72  25 2c 63 6f 6d 6d 61 6e  | pointer%,comman|
00021cb0  64 24 2c 6f 66 66 73 65  74 25 0d 11 69 19 63 6f  |d$,offset%..i.co|
00021cc0  6d 6d 61 6e 64 24 3d 22  22 3a 6f 66 66 73 65 74  |mmand$="":offset|
00021cd0  25 3d 30 0d 11 6a 1d c8  99 20 22 4f 53 5f 47 65  |%=0..j... "OS_Ge|
00021ce0  74 45 6e 76 22 20 b8 20  70 6f 69 6e 74 65 72 25  |tEnv" . pointer%|
00021cf0  0d 11 6b 1a c8 95 20 70  6f 69 6e 74 65 72 25 3f  |..k... pointer%?|
00021d00  6f 66 66 73 65 74 25 3c  3e 30 0d 11 6c 23 20 20  |offset%<>0..l#  |
00021d10  63 6f 6d 6d 61 6e 64 24  2b 3d bd 28 70 6f 69 6e  |command$+=.(poin|
00021d20  74 65 72 25 3f 6f 66 66  73 65 74 25 29 0d 11 6d  |ter%?offset%)..m|
00021d30  10 20 20 6f 66 66 73 65  74 25 2b 3d 31 0d 11 6e  |.  offset%+=1..n|
00021d40  05 ce 0d 11 6f 0c c8 8e  20 6f 70 74 20 ca 0d 11  |....o... opt ...|
00021d50  70 09 20 20 c9 20 30 0d  11 71 09 20 20 c9 20 31  |p.  . 0..q.  . 1|
00021d60  0d 11 72 2c 20 20 20 20  63 6f 6d 6d 61 6e 64 24  |..r,    command$|
00021d70  3d c1 63 6f 6d 6d 61 6e  64 24 2c a7 63 6f 6d 6d  |=.command$,.comm|
00021d80  61 6e 64 24 2c bd 33 34  29 2b 31 29 0d 11 73 2c  |and$,.34)+1)..s,|
00021d90  20 20 20 20 63 6f 6d 6d  61 6e 64 24 3d c1 63 6f  |    command$=.co|
00021da0  6d 6d 61 6e 64 24 2c a7  63 6f 6d 6d 61 6e 64 24  |mmand$,.command$|
00021db0  2c bd 33 34 29 2b 32 29  0d 11 74 05 cb 0d 11 75  |,.34)+2)..t....u|
00021dc0  0d 3d 63 6f 6d 6d 61 6e  64 24 0d 11 76 05 3a 0d  |.=command$..v.:.|
00021dd0  11 77 23 2a 7c 53 74 6f  70 20 46 4e 73 68 65 6c  |.w#*|Stop FNshel|
00021de0  6c 5f 4f 53 52 65 61 64  43 6f 6d 6d 61 6e 64 41  |l_OSReadCommandA|
00021df0  72 67 0d 11 78 04 0d 11  79 27 2a 7c 53 74 61 72  |rg..x...y'*|Star|
00021e00  74 20 46 4e 73 68 65 6c  6c 5f 53 74 72 69 6e 67  |t FNshell_String|
00021e10  53 74 72 69 70 54 72 61  69 6c 69 6e 67 0d 11 7a  |StripTrailing..z|
00021e20  2f dd 20 a4 73 68 65 6c  6c 5f 53 74 72 69 6e 67  |/. .shell_String|
00021e30  53 74 72 69 70 54 72 61  69 6c 69 6e 67 28 73 74  |StripTrailing(st|
00021e40  72 69 6e 67 24 2c 63 68  61 72 24 29 0d 11 7b 1a  |ring$,char$)..{.|
00021e50  c8 95 20 c2 73 74 72 69  6e 67 24 2c 31 29 20 3d  |.. .string$,1) =|
00021e60  20 63 68 61 72 24 0d 11  7c 28 20 20 73 74 72 69  | char$..|(  stri|
00021e70  6e 67 24 20 3d 20 c0 73  74 72 69 6e 67 24 2c a9  |ng$ = .string$,.|
00021e80  28 73 74 72 69 6e 67 24  29 20 2d 20 31 29 0d 11  |(string$) - 1)..|
00021e90  7d 05 ce 0d 11 7e 0d 3d  20 73 74 72 69 6e 67 24  |}....~.= string$|
00021ea0  0d 11 7f 05 3a 0d 11 80  26 2a 7c 53 74 6f 70 20  |....:...&*|Stop |
00021eb0  46 4e 73 68 65 6c 6c 5f  53 74 72 69 6e 67 53 74  |FNshell_StringSt|
00021ec0  72 69 70 54 72 61 69 6c  69 6e 67 0d 11 81 26 2a  |ripTrailing...&*|
00021ed0  7c 53 74 61 72 74 20 46  4e 73 68 65 6c 6c 5f 53  ||Start FNshell_S|
00021ee0  74 72 69 6e 67 53 74 72  69 70 4c 65 61 64 69 6e  |tringStripLeadin|
00021ef0  67 0d 11 82 2e dd 20 a4  73 68 65 6c 6c 5f 53 74  |g..... .shell_St|
00021f00  72 69 6e 67 53 74 72 69  70 4c 65 61 64 69 6e 67  |ringStripLeading|
00021f10  28 73 74 72 69 6e 67 24  2c 63 68 61 72 24 29 0d  |(string$,char$).|
00021f20  11 83 1a c8 95 20 c0 73  74 72 69 6e 67 24 2c 31  |..... .string$,1|
00021f30  29 20 3d 20 63 68 61 72  24 0d 11 84 1b 20 20 73  |) = char$....  s|
00021f40  74 72 69 6e 67 24 20 3d  20 c1 73 74 72 69 6e 67  |tring$ = .string|
00021f50  24 2c 32 29 0d 11 85 05  ce 0d 11 86 0d 3d 20 73  |$,2).........= s|
00021f60  74 72 69 6e 67 24 0d 11  87 05 3a 0d 11 88 25 2a  |tring$....:...%*|
00021f70  7c 53 74 6f 70 20 46 4e  73 68 65 6c 6c 5f 53 74  ||Stop FNshell_St|
00021f80  72 69 6e 67 53 74 72 69  70 4c 65 61 64 69 6e 67  |ringStripLeading|
00021f90  0d 11 89 22 2a 7c 53 74  61 72 74 20 46 4e 73 68  |..."*|Start FNsh|
00021fa0  65 6c 6c 5f 53 74 72 69  6e 67 53 74 72 69 70 41  |ell_StringStripA|
00021fb0  6c 6c 0d 11 8a 2a dd 20  a4 73 68 65 6c 6c 5f 53  |ll...*. .shell_S|
00021fc0  74 72 69 6e 67 53 74 72  69 70 41 6c 6c 28 73 74  |tringStripAll(st|
00021fd0  72 69 6e 67 24 2c 63 68  61 72 24 29 0d 11 8b 0e  |ring$,char$)....|
00021fe0  ea 20 64 6f 6e 65 2c 70  6f 73 0d 11 8c 0a 64 6f  |. done,pos....do|
00021ff0  6e 65 3d b9 0d 11 8d 05  f5 0d 11 8e 19 20 20 70  |ne=..........  p|
00022000  6f 73 3d a7 73 74 72 69  6e 67 24 2c 63 68 61 72  |os=.string$,char|
00022010  24 29 0d 11 8f 0d 20 20  e7 20 70 6f 73 20 8c 0d  |$)....  . pos ..|
00022020  11 90 0e 20 20 20 20 64  6f 6e 65 3d a3 0d 11 91  |...    done=....|
00022030  2f 20 20 20 20 73 74 72  69 6e 67 24 3d c0 73 74  |/    string$=.st|
00022040  72 69 6e 67 24 2c 70 6f  73 2d 31 29 2b c1 73 74  |ring$,pos-1)+.st|
00022050  72 69 6e 67 24 2c 70 6f  73 2b 31 29 0d 11 92 07  |ring$,pos+1)....|
00022060  20 20 cc 0d 11 93 0e 20  20 20 20 64 6f 6e 65 3d  |  .....    done=|
00022070  b9 0d 11 94 07 20 20 cd  0d 11 95 0a fd 20 64 6f  |.....  ...... do|
00022080  6e 65 0d 11 96 0c 3d 73  74 72 69 6e 67 24 0d 11  |ne....=string$..|
00022090  97 05 3a 0d 11 98 21 2a  7c 53 74 6f 70 20 46 4e  |..:...!*|Stop FN|
000220a0  73 68 65 6c 6c 5f 53 74  72 69 6e 67 53 74 72 69  |shell_StringStri|
000220b0  70 41 6c 6c 0d 11 99 04  0d 11 9a 25 2a 7c 53 74  |pAll.......%*|St|
000220c0  61 72 74 20 46 4e 73 68  65 6c 6c 5f 53 74 72 69  |art FNshell_Stri|
000220d0  6e 67 50 61 64 54 72 61  69 6c 69 6e 67 0d 11 9b  |ngPadTrailing...|
000220e0  35 dd 20 a4 73 68 65 6c  6c 5f 53 74 72 69 6e 67  |5. .shell_String|
000220f0  50 61 64 54 72 61 69 6c  69 6e 67 28 73 74 72 69  |PadTrailing(stri|
00022100  6e 67 24 2c 63 68 61 72  24 2c 6c 65 6e 67 74 68  |ng$,char$,length|
00022110  25 29 0d 11 9c 1b c8 95  20 a9 28 73 74 72 69 6e  |%)...... .(strin|
00022120  67 24 29 20 3c 20 6c 65  6e 67 74 68 25 0d 11 9d  |g$) < length%...|
00022130  36 20 20 73 74 72 69 6e  67 24 20 3d 20 73 74 72  |6  string$ = str|
00022140  69 6e 67 24 20 2b 20 c4  6c 65 6e 67 74 68 25 20  |ing$ + .length% |
00022150  2d 20 a9 28 73 74 72 69  6e 67 24 29 2c 63 68 61  |- .(string$),cha|
00022160  72 24 29 0d 11 9e 05 ce  0d 11 9f 0d 3d 20 73 74  |r$).........= st|
00022170  72 69 6e 67 24 0d 11 a0  05 3a 0d 11 a1 24 2a 7c  |ring$....:...$*||
00022180  53 74 6f 70 20 46 4e 73  68 65 6c 6c 5f 53 74 72  |Stop FNshell_Str|
00022190  69 6e 67 50 61 64 54 72  61 69 6c 69 6e 67 0d 11  |ingPadTrailing..|
000221a0  a2 04 0d 11 a3 24 2a 7c  53 74 61 72 74 20 46 4e  |.....$*|Start FN|
000221b0  73 68 65 6c 6c 5f 53 74  72 69 6e 67 50 61 64 4c  |shell_StringPadL|
000221c0  65 61 64 69 6e 67 0d 11  a4 34 dd 20 a4 73 68 65  |eading...4. .she|
000221d0  6c 6c 5f 53 74 72 69 6e  67 50 61 64 4c 65 61 64  |ll_StringPadLead|
000221e0  69 6e 67 28 73 74 72 69  6e 67 24 2c 63 68 61 72  |ing(string$,char|
000221f0  24 2c 6c 65 6e 67 74 68  25 29 0d 11 a5 1b c8 95  |$,length%)......|
00022200  20 a9 28 73 74 72 69 6e  67 24 29 20 3c 20 6c 65  | .(string$) < le|
00022210  6e 67 74 68 25 0d 11 a6  36 20 20 73 74 72 69 6e  |ngth%...6  strin|
00022220  67 24 20 3d 20 c4 6c 65  6e 67 74 68 25 20 2d 20  |g$ = .length% - |
00022230  a9 28 73 74 72 69 6e 67  24 29 2c 63 68 61 72 24  |.(string$),char$|
00022240  29 20 2b 20 73 74 72 69  6e 67 24 0d 11 a7 05 ce  |) + string$.....|
00022250  0d 11 a8 0d 3d 20 73 74  72 69 6e 67 24 0d 11 a9  |....= string$...|
00022260  05 3a 0d 11 aa 23 2a 7c  53 74 6f 70 20 46 4e 73  |.:...#*|Stop FNs|
00022270  68 65 6c 6c 5f 53 74 72  69 6e 67 50 61 64 4c 65  |hell_StringPadLe|
00022280  61 64 69 6e 67 0d 11 ab  04 0d 11 ac 23 2a 7c 53  |ading.......#*|S|
00022290  74 61 72 74 20 46 4e 73  68 65 6c 6c 5f 53 74 72  |tart FNshell_Str|
000222a0  69 6e 67 55 70 70 65 72  43 61 73 65 0d 11 ad 25  |ingUpperCase...%|
000222b0  dd 20 a4 73 68 65 6c 6c  5f 53 74 72 69 6e 67 55  |. .shell_StringU|
000222c0  70 70 65 72 43 61 73 65  28 73 74 72 69 6e 67 24  |pperCase(string$|
000222d0  29 0d 11 ae 0b ea 20 6c  6f 6f 70 25 0d 11 af 16  |)..... loop%....|
000222e0  e7 20 a9 28 73 74 72 69  6e 67 24 29 20 3e 20 30  |. .(string$) > 0|
000222f0  20 8c 0d 11 b0 1d 20 e3  20 6c 6f 6f 70 25 20 3d  | ..... . loop% =|
00022300  20 31 20 b8 20 a9 28 73  74 72 69 6e 67 24 29 0d  | 1 . .(string$).|
00022310  11 b1 3a 20 20 20 e7 20  c1 73 74 72 69 6e 67 24  |..:   . .string$|
00022320  2c 6c 6f 6f 70 25 2c 31  29 3e 3d 22 61 22 20 80  |,loop%,1)>="a" .|
00022330  20 c1 73 74 72 69 6e 67  24 2c 6c 6f 6f 70 25 2c  | .string$,loop%,|
00022340  31 29 3c 3d 22 7a 22 20  8c 0d 11 b2 3a 20 20 20  |1)<="z" ....:   |
00022350  20 20 c1 73 74 72 69 6e  67 24 2c 6c 6f 6f 70 25  |  .string$,loop%|
00022360  2c 31 29 20 3d 20 bd 28  97 28 c1 73 74 72 69 6e  |,1) = .(.(.strin|
00022370  67 24 2c 6c 6f 6f 70 25  2c 31 29 29 20 80 20 26  |g$,loop%,1)) . &|
00022380  44 46 29 0d 11 b3 08 20  20 20 cd 0d 11 b4 0c 20  |DF)....   ..... |
00022390  ed 20 6c 6f 6f 70 25 0d  11 b5 05 cd 0d 11 b6 0d  |. loop%.........|
000223a0  3d 20 73 74 72 69 6e 67  24 0d 11 b7 05 3a 0d 11  |= string$....:..|
000223b0  b8 22 2a 7c 53 74 6f 70  20 46 4e 73 68 65 6c 6c  |."*|Stop FNshell|
000223c0  5f 53 74 72 69 6e 67 55  70 70 65 72 43 61 73 65  |_StringUpperCase|
000223d0  0d 11 b9 04 0d 11 ba 22  2a 7c 53 74 61 72 74 20  |......."*|Start |
000223e0  46 4e 73 68 65 6c 6c 5f  53 74 72 69 6e 67 45 78  |FNshell_StringEx|
000223f0  63 68 61 6e 67 65 0d 11  bb 31 dd 20 a4 73 68 65  |change...1. .she|
00022400  6c 6c 5f 53 74 72 69 6e  67 45 78 63 68 61 6e 67  |ll_StringExchang|
00022410  65 28 73 74 72 69 6e 67  24 2c 74 61 72 67 65 74  |e(string$,target|
00022420  24 2c 73 75 62 24 29 0d  11 bc 0c ea 20 69 6e 64  |$,sub$)..... ind|
00022430  65 78 25 0d 11 bd 1a e7  20 20 a7 73 74 72 69 6e  |ex%.....  .strin|
00022440  67 24 2c 74 61 72 67 65  74 24 29 20 8c 0d 11 be  |g$,target$) ....|
00022450  1e 20 20 69 6e 64 65 78  25 3d a7 73 74 72 69 6e  |.  index%=.strin|
00022460  67 24 2c 74 61 72 67 65  74 24 29 0d 11 bf 3f 20  |g$,target$)...? |
00022470  20 73 74 72 69 6e 67 24  3d c0 73 74 72 69 6e 67  | string$=.string|
00022480  24 2c 69 6e 64 65 78 25  2d 31 29 2b 73 75 62 24  |$,index%-1)+sub$|
00022490  2b c1 73 74 72 69 6e 67  24 2c 69 6e 64 65 78 25  |+.string$,index%|
000224a0  2b a9 74 61 72 67 65 74  24 29 0d 11 c0 05 cd 0d  |+.target$)......|
000224b0  11 c1 0c 3d 73 74 72 69  6e 67 24 0d 11 c2 05 3a  |...=string$....:|
000224c0  0d 11 c3 21 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |...!*|Stop FNshe|
000224d0  6c 6c 5f 53 74 72 69 6e  67 45 78 63 68 61 6e 67  |ll_StringExchang|
000224e0  65 0d 11 c4 29 2a 7c 53  74 61 72 74 20 46 4e 73  |e...)*|Start FNs|
000224f0  68 65 6c 6c 5f 53 74 72  69 6e 67 41 72 72 61 79  |hell_StringArray|
00022500  47 65 74 4c 6f 6e 67 65  73 74 0d 11 c5 30 dd 20  |GetLongest...0. |
00022510  a4 73 68 65 6c 6c 5f 53  74 72 69 6e 67 41 72 72  |.shell_StringArr|
00022520  61 79 47 65 74 4c 6f 6e  67 65 73 74 28 61 72 72  |ayGetLongest(arr|
00022530  61 79 24 28 29 2c 6e 72  25 29 0d 11 c6 14 ea 20  |ay$(),nr%)..... |
00022540  6c 6f 6f 70 25 2c 6c 6f  6e 67 65 73 74 25 0d 11  |loop%,longest%..|
00022550  c7 10 6c 6f 6e 67 65 73  74 25 20 3d 20 30 0d 11  |..longest% = 0..|
00022560  c8 15 e3 20 6c 6f 6f 70  25 20 3d 20 30 20 b8 20  |... loop% = 0 . |
00022570  6e 72 25 0d 11 c9 25 20  20 e7 20 a9 28 61 72 72  |nr%...%  . .(arr|
00022580  61 79 24 28 6c 6f 6f 70  25 29 29 20 3e 20 6c 6f  |ay$(loop%)) > lo|
00022590  6e 67 65 73 74 25 20 8c  0d 11 ca 23 20 20 20 20  |ngest% ....#    |
000225a0  6c 6f 6e 67 65 73 74 25  20 3d 20 a9 28 61 72 72  |longest% = .(arr|
000225b0  61 79 24 28 6c 6f 6f 70  25 29 29 0d 11 cb 07 20  |ay$(loop%)).... |
000225c0  20 cd 0d 11 cc 0b ed 20  6c 6f 6f 70 25 0d 11 cd  | ...... loop%...|
000225d0  0e 3d 20 6c 6f 6e 67 65  73 74 25 0d 11 ce 05 3a  |.= longest%....:|
000225e0  0d 11 cf 28 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |...(*|Stop FNshe|
000225f0  6c 6c 5f 53 74 72 69 6e  67 41 72 72 61 79 47 65  |ll_StringArrayGe|
00022600  74 4c 6f 6e 67 65 73 74  0d 11 d0 1b 2a 7c 53 74  |tLongest....*|St|
00022610  61 72 74 20 46 4e 6d 65  6d 5f 74 6f 5f 73 74 72  |art FNmem_to_str|
00022620  69 6e 67 0d 11 d1 2a dd  20 a4 6d 65 6d 5f 74 6f  |ing...*. .mem_to|
00022630  5f 73 74 72 69 6e 67 28  62 6c 6f 63 6b 25 2c 6f  |_string(block%,o|
00022640  66 66 73 65 74 25 2c 74  65 72 6d 25 29 0d 11 d2  |ffset%,term%)...|
00022650  0d ea 20 73 74 72 69 6e  67 24 0d 11 d3 1c c8 95  |.. string$......|
00022660  20 62 6c 6f 63 6b 25 3f  6f 66 66 73 65 74 25 3c  | block%?offset%<|
00022670  3e 74 65 72 6d 25 0d 11  d4 20 20 20 73 74 72 69  |>term%...   stri|
00022680  6e 67 24 2b 3d bd 28 62  6c 6f 63 6b 25 3f 6f 66  |ng$+=.(block%?of|
00022690  66 73 65 74 25 29 0d 11  d5 10 20 20 6f 66 66 73  |fset%)....  offs|
000226a0  65 74 25 2b 3d 31 0d 11  d6 05 ce 0d 11 d7 0c 3d  |et%+=1.........=|
000226b0  73 74 72 69 6e 67 24 0d  11 d8 05 3a 0d 11 d9 1a  |string$....:....|
000226c0  2a 7c 53 74 6f 70 20 46  4e 6d 65 6d 5f 74 6f 5f  |*|Stop FNmem_to_|
000226d0  73 74 72 69 6e 67 0d 11  da 04 0d 11 db 1e 2a 7c  |string........*||
000226e0  53 74 61 72 74 20 46 4e  73 68 65 6c 6c 5f 46 69  |Start FNshell_Fi|
000226f0  6c 65 4c 65 6e 67 74 68  0d 11 dc 20 dd 20 a4 73  |leLength... . .s|
00022700  68 65 6c 6c 5f 46 69 6c  65 4c 65 6e 67 74 68 28  |hell_FileLength(|
00022710  6f 62 6a 65 63 74 24 29  0d 11 dd 37 ea 20 74 79  |object$)...7. ty|
00022720  70 65 25 2c 6c 6f 61 64  5f 61 64 64 72 25 2c 65  |pe%,load_addr%,e|
00022730  78 65 63 5f 61 64 64 72  25 2c 6c 65 6e 67 74 68  |xec_addr%,length|
00022740  25 2c 61 74 74 73 25 2c  73 74 72 69 6e 67 24 0d  |%,atts%,string$.|
00022750  11 de 47 c8 99 20 22 4f  53 5f 46 69 6c 65 22 2c  |..G.. "OS_File",|
00022760  35 2c 6f 62 6a 65 63 74  24 20 b8 20 74 79 70 65  |5,object$ . type|
00022770  25 2c 2c 6c 6f 61 64 5f  61 64 64 72 25 2c 65 78  |%,,load_addr%,ex|
00022780  65 63 5f 61 64 64 72 25  2c 6c 65 6e 67 74 68 25  |ec_addr%,length%|
00022790  2c 61 74 74 73 25 0d 11  df 0c 3d 6c 65 6e 67 74  |,atts%....=lengt|
000227a0  68 25 0d 11 e0 05 3a 0d  11 e1 1d 2a 7c 53 74 6f  |h%....:....*|Sto|
000227b0  70 20 46 4e 73 68 65 6c  6c 5f 46 69 6c 65 4c 65  |p FNshell_FileLe|
000227c0  6e 67 74 68 0d 11 e2 04  0d 11 e3 1d 2a 7c 53 74  |ngth........*|St|
000227d0  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 54 72  |art PROCshell_Tr|
000227e0  61 63 65 4f 6e 0d 11 e4  14 dd 20 f2 73 68 65 6c  |aceOn..... .shel|
000227f0  6c 5f 54 72 61 63 65 4f  6e 0d 11 e5 1e 5f 55 25  |l_TraceOn...._U%|
00022800  21 31 30 30 20 3d 20 5f  55 25 21 31 30 30 20 84  |!100 = _U%!100 .|
00022810  20 31 20 3c 3c 20 39 0d  11 e6 37 f2 73 68 65 6c  | 1 << 9...7.shel|
00022820  6c 5f 42 72 6f 61 64 63  61 73 74 4d 65 73 73 61  |l_BroadcastMessa|
00022830  67 65 28 26 34 33 42 30  30 2c 22 53 68 65 6c 6c  |ge(&43B00,"Shell|
00022840  44 42 75 67 3a 54 72 61  63 65 4f 6e 22 29 0d 11  |DBug:TraceOn")..|
00022850  e7 05 e1 0d 11 e8 05 3a  0d 11 e9 1c 2a 7c 53 74  |.......:....*|St|
00022860  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 54 72 61  |op PROCshell_Tra|
00022870  63 65 4f 6e 0d 11 ea 04  0d 11 eb 1e 2a 7c 53 74  |ceOn........*|St|
00022880  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 54 72  |art PROCshell_Tr|
00022890  61 63 65 4f 66 66 0d 11  ec 15 dd 20 f2 73 68 65  |aceOff..... .she|
000228a0  6c 6c 5f 54 72 61 63 65  4f 66 66 0d 11 ed 39 e7  |ll_TraceOff...9.|
000228b0  20 28 5f 55 25 21 31 30  30 20 80 20 28 31 20 3c  | (_U%!100 . (1 <|
000228c0  3c 20 39 29 29 20 8c 20  5f 55 25 21 31 30 30 20  |< 9)) . _U%!100 |
000228d0  3d 20 5f 55 25 21 31 30  30 20 82 20 28 31 20 3c  |= _U%!100 . (1 <|
000228e0  3c 20 39 29 0d 11 ee 38  f2 73 68 65 6c 6c 5f 42  |< 9)...8.shell_B|
000228f0  72 6f 61 64 63 61 73 74  4d 65 73 73 61 67 65 28  |roadcastMessage(|
00022900  26 34 33 42 30 30 2c 22  53 68 65 6c 6c 44 42 75  |&43B00,"ShellDBu|
00022910  67 3a 54 72 61 63 65 4f  66 66 22 29 0d 11 ef 05  |g:TraceOff")....|
00022920  e1 0d 11 f0 05 3a 0d 11  f1 1d 2a 7c 53 74 6f 70  |.....:....*|Stop|
00022930  20 50 52 4f 43 73 68 65  6c 6c 5f 54 72 61 63 65  | PROCshell_Trace|
00022940  4f 66 66 0d 11 f2 04 0d  11 f3 1f 2a 7c 53 74 61  |Off........*|Sta|
00022950  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 54 72 61  |rt PROCshell_Tra|
00022960  63 65 49 6e 69 74 0d 11  f4 16 2a 7c 44 65 66 69  |ceInit....*|Defi|
00022970  6e 65 20 54 72 61 63 65  49 6e 69 74 0d 11 f5 1d  |ne TraceInit....|
00022980  dd 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 49 6e  |. .shell_TraceIn|
00022990  69 74 28 66 69 6c 65 24  29 0d 11 f6 2a ea 20 66  |it(file$)...*. f|
000229a0  25 2c 62 6c 6b 25 2c 73  68 65 6c 6c 5f 41 70 70  |%,blk%,shell_App|
000229b0  4e 61 6d 65 24 2c 73 68  65 6c 6c 5f 41 70 70 44  |Name$,shell_AppD|
000229c0  69 72 24 0d 11 f7 11 e7  20 66 69 6c 65 24 3c 3e  |ir$..... file$<>|
000229d0  22 22 20 8c 0d 11 f8 11  20 20 66 25 3d ae 28 66  |"" .....  f%=.(f|
000229e0  69 6c 65 24 29 0d 11 f9  0f 20 20 5f 55 25 21 34  |ile$)....  _U%!4|
000229f0  34 3d 66 25 0d 11 fa 05  cd 0d 11 fb 23 62 6c 6b  |4=f%........#blk|
00022a00  25 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |%=.shell_HeapBlo|
00022a10  63 6b 46 65 74 63 68 28  32 35 36 29 0d 11 fc 3b  |ckFetch(256)...;|
00022a20  73 68 65 6c 6c 5f 41 70  70 44 69 72 24 3d a4 73  |shell_AppDir$=.s|
00022a30  68 65 6c 6c 5f 4f 53 56  61 72 47 65 74 56 61 6c  |hell_OSVarGetVal|
00022a40  28 62 6c 6b 25 2c 32 35  36 2c 22 4f 62 65 79 24  |(blk%,256,"Obey$|
00022a50  44 69 72 22 2c 31 29 0d  11 fd 31 73 68 65 6c 6c  |Dir",1)...1shell|
00022a60  5f 41 70 70 4e 61 6d 65  24 3d c1 a4 73 68 65 6c  |_AppName$=..shel|
00022a70  6c 5f 4c 65 61 66 28 73  68 65 6c 6c 5f 41 70 70  |l_Leaf(shell_App|
00022a80  44 69 72 24 29 2c 32 29  0d 11 fe 04 0d 11 ff 58  |Dir$),2).......X|
00022a90  f2 73 68 65 6c 6c 5f 42  72 6f 61 64 63 61 73 74  |.shell_Broadcast|
00022aa0  4d 65 73 73 61 67 65 28  26 34 33 42 30 30 2c 22  |Message(&43B00,"|
00022ab0  53 68 65 6c 6c 44 42 75  67 3a 49 6e 69 74 20 44  |ShellDBug:Init D|
00022ac0  65 62 75 67 20 6d 65 73  73 61 67 65 73 20 66 72  |ebug messages fr|
00022ad0  6f 6d 20 22 2b 73 68 65  6c 6c 5f 41 70 70 4e 61  |om "+shell_AppNa|
00022ae0  6d 65 24 29 0d 12 00 20  f2 73 68 65 6c 6c 5f 48  |me$)... .shell_H|
00022af0  65 61 70 42 6c 6f 63 6b  52 65 74 75 72 6e 28 62  |eapBlockReturn(b|
00022b00  6c 6b 25 29 0d 12 01 4a  f4 20 73 65 74 20 62 69  |lk%)...J. set bi|
00022b10  74 20 34 20 6f 66 20 73  68 65 6c 6c 20 66 6c 61  |t 4 of shell fla|
00022b20  67 20 77 6f 72 64 2e 20  49 66 20 53 68 65 6c 6c  |g word. If Shell|
00022b30  44 42 75 67 20 73 74 61  72 74 20 75 70 20 69 73  |DBug start up is|
00022b40  20 64 65 74 65 63 74 65  64 20 74 68 65 6e 0d 12  | detected then..|
00022b50  02 4c f4 20 73 65 6e 64  20 69 6e 69 74 20 6d 65  |.L. send init me|
00022b60  73 73 61 67 65 20 61 67  61 69 6e 20 28 53 68 65  |ssage again (She|
00022b70  6c 6c 44 42 75 67 20 77  61 73 20 73 74 61 72 74  |llDBug was start|
00022b80  65 64 20 61 66 74 65 72  20 74 68 69 73 20 74 61  |ed after this ta|
00022b90  73 6b 29 2e 20 43 6c 65  61 72 0d 12 03 2f f4 20  |sk). Clear.../. |
00022ba0  62 69 74 20 77 68 65 6e  20 53 68 65 6c 6c 44 42  |bit when ShellDB|
00022bb0  75 67 20 73 65 6e 64 73  20 69 74 73 20 61 63 6b  |ug sends its ack|
00022bc0  20 6d 65 73 73 61 67 65  2e 0d 12 04 16 e7 20 5f  | message...... _|
00022bd0  55 25 21 31 30 30 20 80  20 31 3c 3c 34 20 8c 0d  |U%!100 . 1<<4 ..|
00022be0  12 05 05 cc 0d 12 06 1e  20 20 5f 55 25 21 31 30  |........  _U%!10|
00022bf0  30 3d 28 5f 55 25 21 31  30 30 20 82 20 31 3c 3c  |0=(_U%!100 . 1<<|
00022c00  34 29 0d 12 07 05 cd 0d  12 08 05 e1 0d 12 09 05  |4)..............|
00022c10  3a 0d 12 0a 1e 2a 7c 53  74 6f 70 20 50 52 4f 43  |:....*|Stop PROC|
00022c20  73 68 65 6c 6c 5f 54 72  61 63 65 49 6e 69 74 0d  |shell_TraceInit.|
00022c30  12 0b 04 0d 12 0c 1d 2a  7c 53 74 61 72 74 20 46  |.......*|Start F|
00022c40  4e 73 68 65 6c 6c 5f 54  72 61 63 65 49 73 4f 6e  |Nshell_TraceIsOn|
00022c50  0d 12 0d 16 dd 20 a4 73  68 65 6c 6c 5f 54 72 61  |..... .shell_Tra|
00022c60  63 65 49 73 4f 6e 0d 12  0e 24 e7 20 5f 55 25 21  |ceIsOn...$. _U%!|
00022c70  31 30 30 20 80 20 28 31  20 3c 3c 20 39 29 20 8c  |100 . (1 << 9) .|
00022c80  20 3d 20 b9 20 8b 20 3d  20 a3 0d 12 0f 05 3a 0d  | = . . = .....:.|
00022c90  12 10 1c 2a 7c 53 74 6f  70 20 46 4e 73 68 65 6c  |...*|Stop FNshel|
00022ca0  6c 5f 54 72 61 63 65 49  73 4f 6e 0d 12 11 04 0d  |l_TraceIsOn.....|
00022cb0  12 12 1d 2a 7c 53 74 61  72 74 20 50 52 4f 43 73  |...*|Start PROCs|
00022cc0  68 65 6c 6c 5f 54 72 61  63 65 66 30 0d 12 13 18  |hell_Tracef0....|
00022cd0  dd 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |. .shell_Tracef0|
00022ce0  28 61 24 29 0d 12 14 08  ea 20 66 25 0d 12 15 1d  |(a$)..... f%....|
00022cf0  e7 20 ac 28 a4 73 68 65  6c 6c 5f 54 72 61 63 65  |. .(.shell_Trace|
00022d00  49 73 4f 6e 29 20 8c 20  e1 0d 12 16 12 e7 20 5f  |IsOn) . ...... _|
00022d10  55 25 21 34 34 3c 3e 2d  31 20 8c 0d 12 17 0f 20  |U%!44<>-1 ..... |
00022d20  20 66 25 3d 5f 55 25 21  34 34 0d 12 18 0d 20 20  | f%=_U%!44....  |
00022d30  d5 23 66 25 2c 61 24 0d  12 19 05 cd 0d 12 1a 29  |.#f%,a$........)|
00022d40  f4 20 63 68 65 63 6b 20  69 66 20 74 61 73 6b 20  |. check if task |
00022d50  69 64 20 68 61 73 20 62  65 65 6e 20 73 65 74 20  |id has been set |
00022d60  75 70 2e 2e 2e 0d 12 1b  11 e7 20 5f 55 25 21 31  |up........ _U%!1|
00022d70  34 38 3e 30 20 8c 0d 12  1c 3b 20 20 f2 73 68 65  |48>0 ....;  .she|
00022d80  6c 6c 5f 42 72 6f 61 64  63 61 73 74 4d 65 73 73  |ll_BroadcastMess|
00022d90  61 67 65 28 26 34 33 42  30 30 2c 22 53 68 65 6c  |age(&43B00,"Shel|
00022da0  6c 44 42 75 67 3a 54 72  61 63 65 20 22 2b 61 24  |lDBug:Trace "+a$|
00022db0  29 0d 12 1d 1c 20 20 f4  20 50 52 4f 43 73 68 65  |)....  . PROCshe|
00022dc0  6c 6c 5f 45 6e 73 75 72  65 50 6f 6c 6c 0d 12 1e  |ll_EnsurePoll...|
00022dd0  05 cd 0d 12 1f 05 e1 0d  12 20 05 3a 0d 12 21 1c  |......... .:..!.|
00022de0  2a 7c 53 74 6f 70 20 50  52 4f 43 73 68 65 6c 6c  |*|Stop PROCshell|
00022df0  5f 54 72 61 63 65 66 30  0d 12 22 04 0d 12 23 1d  |_Tracef0.."...#.|
00022e00  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
00022e10  6c 5f 54 72 61 63 65 66  32 0d 12 24 1b dd 20 f2  |l_Tracef2..$.. .|
00022e20  73 68 65 6c 6c 5f 54 72  61 63 65 66 32 28 61 64  |shell_Tracef2(ad|
00022e30  64 72 25 29 0d 12 25 17  ff 28 22 4d 45 44 49 54  |dr%)..%..("MEDIT|
00022e40  20 22 2b c3 7e 61 64 64  72 25 29 0d 12 26 05 e1  | "+.~addr%)..&..|
00022e50  0d 12 27 05 3a 0d 12 28  1c 2a 7c 53 74 6f 70 20  |..'.:..(.*|Stop |
00022e60  50 52 4f 43 73 68 65 6c  6c 5f 54 72 61 63 65 66  |PROCshell_Tracef|
00022e70  32 0d 12 29 04 0d 12 2a  1f 2a 7c 53 74 61 72 74  |2..)...*.*|Start|
00022e80  20 50 52 4f 43 73 68 65  6c 6c 5f 54 72 61 63 65  | PROCshell_Trace|
00022e90  45 78 69 74 0d 12 2b 16  dd 20 f2 73 68 65 6c 6c  |Exit..+.. .shell|
00022ea0  5f 54 72 61 63 65 45 78  69 74 0d 12 2c 27 e7 20  |_TraceExit..,'. |
00022eb0  5f 55 25 21 34 34 3c 3e  2d 31 20 8c 20 d9 23 28  |_U%!44<>-1 . .#(|
00022ec0  5f 55 25 21 34 34 29 3a  5f 55 25 21 34 34 3d 2d  |_U%!44):_U%!44=-|
00022ed0  31 0d 12 2d 1c f4 20 5f  55 25 21 34 34 3d 2d 31  |1..-.. _U%!44=-1|
00022ee0  3a 5f 55 25 21 34 38 3d  46 41 4c 53 45 0d 12 2e  |:_U%!48=FALSE...|
00022ef0  05 e1 0d 12 2f 05 3a 0d  12 30 1e 2a 7c 53 74 6f  |..../.:..0.*|Sto|
00022f00  70 20 50 52 4f 43 73 68  65 6c 6c 5f 54 72 61 63  |p PROCshell_Trac|
00022f10  65 45 78 69 74 0d 12 31  04 0d 12 32 22 2a 7c 53  |eExit..1...2"*|S|
00022f20  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 41  |tart PROCshell_A|
00022f30  74 74 61 63 68 48 6f 74  4b 65 79 0d 12 33 47 dd  |ttachHotKey..3G.|
00022f40  20 f2 73 68 65 6c 6c 5f  41 74 74 61 63 68 48 6f  | .shell_AttachHo|
00022f50  74 4b 65 79 28 6b 65 79  24 2c 73 68 69 66 74 25  |tKey(key$,shift%|
00022f60  2c 63 74 72 6c 25 2c 61  6c 74 25 2c 77 69 6e 64  |,ctrl%,alt%,wind|
00022f70  6f 77 24 2c 77 68 25 2c  66 6e 31 24 2c 66 6e 32  |ow$,wh%,fn1$,fn2|
00022f80  24 29 0d 12 34 2e ea 20  65 5f 6c 69 73 74 25 2c  |$)..4.. e_list%,|
00022f90  6f 66 66 73 65 74 25 2c  74 65 6d 70 25 2c 74 65  |offset%,temp%,te|
00022fa0  6d 70 32 25 2c 6b 65 79  25 2c 66 5f 6b 65 79 25  |mp2%,key%,f_key%|
00022fb0  0d 12 35 0c 66 5f 6b 65  79 25 3d b9 0d 12 36 10  |..5.f_key%=...6.|
00022fc0  e7 20 5f 55 25 21 36 30  3d 30 20 8c 0d 12 37 26  |. _U%!60=0 ...7&|
00022fd0  20 20 5f 55 25 21 36 30  3d a4 73 68 65 6c 6c 5f  |  _U%!60=.shell_|
00022fe0  48 65 61 70 42 6c 6f 63  6b 46 65 74 63 68 28 32  |HeapBlockFetch(2|
00022ff0  34 29 0d 12 38 19 20 20  6f 66 66 73 65 74 25 3d  |4)..8.  offset%=|
00023000  30 3a 5f 55 25 21 31 38  30 3d 31 0d 12 39 05 cc  |0:_U%!180=1..9..|
00023010  0d 12 3a 18 20 20 6f 66  66 73 65 74 25 3d 5f 55  |..:.  offset%=_U|
00023020  25 21 31 38 30 2a 32 34  0d 12 3b 2e 20 20 5f 55  |%!180*24..;.  _U|
00023030  25 21 36 30 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |%!60=.shell_Heap|
00023040  42 6c 6f 63 6b 45 78 74  65 6e 64 28 5f 55 25 21  |BlockExtend(_U%!|
00023050  36 30 2c 32 34 29 0d 12  3c 19 20 20 5f 55 25 21  |60,24)..<.  _U%!|
00023060  31 38 30 3d 28 5f 55 25  21 31 38 30 29 2b 31 0d  |180=(_U%!180)+1.|
00023070  12 3d 05 cd 0d 12 3e 12  65 5f 6c 69 73 74 25 3d  |.=....>.e_list%=|
00023080  5f 55 25 21 36 30 0d 12  3f 0d c8 8e 20 6b 65 79  |_U%!60..?... key|
00023090  24 20 ca 0d 12 40 16 20  20 c9 20 22 46 31 22 20  |$ ...@.  . "F1" |
000230a0  3a 6b 65 79 25 3d 33 38  35 0d 12 41 16 20 20 c9  |:key%=385..A.  .|
000230b0  20 22 46 32 22 20 3a 6b  65 79 25 3d 33 38 36 0d  | "F2" :key%=386.|
000230c0  12 42 16 20 20 c9 20 22  46 33 22 20 3a 6b 65 79  |.B.  . "F3" :key|
000230d0  25 3d 33 38 37 0d 12 43  16 20 20 c9 20 22 46 34  |%=387..C.  . "F4|
000230e0  22 20 3a 6b 65 79 25 3d  33 38 38 0d 12 44 16 20  |" :key%=388..D. |
000230f0  20 c9 20 22 46 35 22 20  3a 6b 65 79 25 3d 33 38  | . "F5" :key%=38|
00023100  39 0d 12 45 16 20 20 c9  20 22 46 36 22 20 3a 6b  |9..E.  . "F6" :k|
00023110  65 79 25 3d 33 39 30 0d  12 46 16 20 20 c9 20 22  |ey%=390..F.  . "|
00023120  46 37 22 20 3a 6b 65 79  25 3d 33 39 31 0d 12 47  |F7" :key%=391..G|
00023130  16 20 20 c9 20 22 46 38  22 20 3a 6b 65 79 25 3d  |.  . "F8" :key%=|
00023140  33 39 32 0d 12 48 16 20  20 c9 20 22 46 39 22 20  |392..H.  . "F9" |
00023150  3a 6b 65 79 25 3d 33 39  33 0d 12 49 16 20 20 c9  |:key%=393..I.  .|
00023160  20 22 46 31 30 22 3a 6b  65 79 25 3d 34 35 38 0d  | "F10":key%=458.|
00023170  12 4a 16 20 20 c9 20 22  46 31 31 22 3a 6b 65 79  |.J.  . "F11":key|
00023180  25 3d 34 35 39 0d 12 4b  05 7f 0d 12 4c 1e 20 20  |%=459..K....L.  |
00023190  6b 65 79 25 3d 28 97 6b  65 79 24 29 2d 36 34 3a  |key%=(.key$)-64:|
000231a0  66 5f 6b 65 79 25 3d a3  0d 12 4d 05 cb 0d 12 4e  |f_key%=...M....N|
000231b0  0e e7 20 66 5f 6b 65 79  25 20 8c 0d 12 4f 19 20  |.. f_key% ...O. |
000231c0  20 e7 20 73 68 69 66 74  25 20 8c 20 6b 65 79 25  | . shift% . key%|
000231d0  2b 3d 31 36 0d 12 50 19  20 20 e7 20 63 74 72 6c  |+=16..P.  . ctrl|
000231e0  25 20 20 8c 20 6b 65 79  25 2b 3d 33 32 0d 12 51  |%  . key%+=32..Q|
000231f0  05 cd 0d 12 52 19 74 65  6d 70 25 3d 65 5f 6c 69  |....R.temp%=e_li|
00023200  73 74 25 2b 6f 66 66 73  65 74 25 0d 12 53 10 74  |st%+offset%..S.t|
00023210  65 6d 70 25 21 30 3d 6b  65 79 25 0d 12 54 1f 74  |emp%!0=key%..T.t|
00023220  65 6d 70 25 3f 34 3d 73  68 69 66 74 25 3a f4 20  |emp%?4=shift%:. |
00023230  73 68 69 66 74 20 66 6c  61 67 0d 12 55 1f 74 65  |shift flag..U.te|
00023240  6d 70 25 3f 35 3d 63 74  72 6c 25 20 3a f4 20 63  |mp%?5=ctrl% :. c|
00023250  74 72 6c 20 20 66 6c 61  67 0d 12 56 1f 74 65 6d  |trl  flag..V.tem|
00023260  70 25 3f 36 3d 61 6c 74  25 20 20 3a f4 20 61 6c  |p%?6=alt%  :. al|
00023270  74 20 20 20 66 6c 61 67  0d 12 57 2d 74 65 6d 70  |t   flag..W-temp|
00023280  25 21 38 3d a4 73 68 65  6c 6c 5f 48 65 61 70 42  |%!8=.shell_HeapB|
00023290  6c 6f 63 6b 46 65 74 63  68 28 a9 77 69 6e 64 6f  |lockFetch(.windo|
000232a0  77 24 2b 31 29 0d 12 58  22 74 65 6d 70 32 25 3d  |w$+1)..X"temp2%=|
000232b0  74 65 6d 70 25 21 38 3a  24 74 65 6d 70 32 25 3d  |temp%!8:$temp2%=|
000232c0  77 69 6e 64 6f 77 24 0d  12 59 0d e7 20 77 68 25  |window$..Y.. wh%|
000232d0  3e 30 20 8c 0d 12 5a 30  20 20 f4 20 63 68 65 63  |>0 ...Z0  . chec|
000232e0  6b 20 77 69 6e 64 6f 77  20 68 61 6e 64 6c 65 20  |k window handle |
000232f0  69 73 20 69 6e 20 73 74  61 74 69 63 20 6c 69 73  |is in static lis|
00023300  74 2e 2e 2e 0d 12 5b 2e  20 20 6f 66 66 73 65 74  |t.....[.  offset|
00023310  25 3d a4 73 68 65 6c 6c  5f 53 65 61 72 63 68 53  |%=.shell_SearchS|
00023320  74 61 74 69 63 28 5f 55  25 21 31 38 34 2c 77 68  |tatic(_U%!184,wh|
00023330  25 29 0d 12 5c 3c 20 20  e7 20 6f 66 66 73 65 74  |%)..\<  . offset|
00023340  25 3d 2d 31 20 8c 20 85  20 39 39 2c a4 73 68 65  |%=-1 . . 99,.she|
00023350  6c 6c 5f 4d 65 73 73 61  67 65 4e 6f 41 72 67 73  |ll_MessageNoArgs|
00023360  28 22 53 48 45 4c 4c 4d  53 47 30 39 22 29 0d 12  |("SHELLMSG09")..|
00023370  5d 05 cd 0d 12 5e 3f 74  65 6d 70 25 21 31 32 3d  |]....^?temp%!12=|
00023380  77 68 25 3a f4 20 3e 30  20 64 65 6e 6f 74 65 73  |wh%:. >0 denotes|
00023390  20 61 20 77 69 6e 64 6f  77 20 68 61 6e 64 6c 65  | a window handle|
000233a0  20 74 6f 20 6f 70 65 6e  20 61 73 20 73 74 61 74  | to open as stat|
000233b0  69 63 0d 12 5f 2b 74 65  6d 70 25 21 31 36 3d a4  |ic.._+temp%!16=.|
000233c0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
000233d0  65 74 63 68 28 a9 66 6e  31 24 2b 31 29 0d 12 60  |etch(.fn1$+1)..`|
000233e0  20 74 65 6d 70 32 25 3d  74 65 6d 70 25 21 31 36  | temp2%=temp%!16|
000233f0  3a 24 74 65 6d 70 32 25  3d 66 6e 31 24 0d 12 61  |:$temp2%=fn1$..a|
00023400  2b 74 65 6d 70 25 21 32  30 3d a4 73 68 65 6c 6c  |+temp%!20=.shell|
00023410  5f 48 65 61 70 42 6c 6f  63 6b 46 65 74 63 68 28  |_HeapBlockFetch(|
00023420  a9 66 6e 32 24 2b 31 29  0d 12 62 20 74 65 6d 70  |.fn2$+1)..b temp|
00023430  32 25 3d 74 65 6d 70 25  21 32 30 3a 24 74 65 6d  |2%=temp%!20:$tem|
00023440  70 32 25 3d 66 6e 32 24  0d 12 63 05 e1 0d 12 64  |p2%=fn2$..c....d|
00023450  05 3a 0d 12 65 21 2a 7c  53 74 6f 70 20 50 52 4f  |.:..e!*|Stop PRO|
00023460  43 73 68 65 6c 6c 5f 41  74 74 61 63 68 48 6f 74  |Cshell_AttachHot|
00023470  4b 65 79 0d 12 66 04 0d  12 67 21 2a 7c 53 74 61  |Key..f...g!*|Sta|
00023480  72 74 20 46 4e 73 68 65  6c 6c 5f 48 6f 74 4b 65  |rt FNshell_HotKe|
00023490  79 50 72 6f 63 65 73 73  0d 12 68 20 dd 20 a4 73  |yProcess..h . .s|
000234a0  68 65 6c 6c 5f 48 6f 74  4b 65 79 50 72 6f 63 65  |hell_HotKeyProce|
000234b0  73 73 28 6b 65 79 25 29  0d 12 69 36 ea 20 65 5f  |ss(key%)..i6. e_|
000234c0  6c 69 73 74 25 2c 6c 69  73 74 5f 73 69 7a 65 25  |list%,list_size%|
000234d0  2c 66 6f 75 6e 64 25 2c  70 74 72 25 2c 68 25 2c  |,found%,ptr%,h%,|
000234e0  77 69 6e 24 2c 66 6e 31  24 2c 66 6e 32 24 0d 12  |win$,fn1$,fn2$..|
000234f0  6a 3e ea 20 63 74 72 6c  25 2c 73 68 69 66 74 25  |j>. ctrl%,shift%|
00023500  2c 61 6c 74 25 2c 78 5f  6f 66 66 25 2c 79 5f 6f  |,alt%,x_off%,y_o|
00023510  66 66 25 2c 66 6c 61 67  25 2c 6b 65 79 5f 66 6c  |ff%,flag%,key_fl|
00023520  61 67 73 25 2c 6f 66 66  73 65 74 25 0d 12 6b 16  |ags%,offset%..k.|
00023530  ea 20 72 65 73 75 6c 74  25 2c 77 69 6e 5f 62 6c  |. result%,win_bl|
00023540  6b 25 0d 12 6c 12 65 5f  6c 69 73 74 25 3d 5f 55  |k%..l.e_list%=_U|
00023550  25 21 36 30 0d 12 6d 19  6c 69 73 74 5f 73 69 7a  |%!60..m.list_siz|
00023560  65 25 3d 5f 55 25 21 31  38 30 2a 32 34 0d 12 6e  |e%=_U%!180*24..n|
00023570  13 66 6f 75 6e 64 25 3d  a3 3a 70 74 72 25 3d 30  |.found%=.:ptr%=0|
00023580  0d 12 6f 05 f5 0d 12 70  1b 20 20 e7 20 65 5f 6c  |..o....p.  . e_l|
00023590  69 73 74 25 21 70 74 72  25 3d 6b 65 79 25 20 8c  |ist%!ptr%=key% .|
000235a0  0d 12 71 10 20 20 20 20  66 6f 75 6e 64 25 3d b9  |..q.    found%=.|
000235b0  0d 12 72 07 20 20 cc 0d  12 73 10 20 20 20 20 70  |..r.  ...s.    p|
000235c0  74 72 25 2b 3d 32 34 0d  12 74 07 20 20 cd 0d 12  |tr%+=24..t.  ...|
000235d0  75 1f fd 20 66 6f 75 6e  64 25 20 84 20 70 74 72  |u.. found% . ptr|
000235e0  25 3e 3d 6c 69 73 74 5f  73 69 7a 65 25 0d 12 76  |%>=list_size%..v|
000235f0  0e e7 20 66 6f 75 6e 64  25 20 8c 0d 12 77 18 20  |.. found% ...w. |
00023600  20 74 65 6d 70 25 3d 65  5f 6c 69 73 74 25 2b 70  | temp%=e_list%+p|
00023610  74 72 25 0d 12 78 15 20  20 77 69 6e 24 3d 24 28  |tr%..x.  win$=$(|
00023620  74 65 6d 70 25 21 38 29  0d 12 79 15 2a 7c 69 66  |temp%!8)..y.*|if|
00023630  64 65 66 20 54 72 61 63  65 49 6e 69 74 0d 12 7a  |def TraceInit..z|
00023640  41 20 20 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |A  .shell_Tracef|
00023650  30 28 22 48 6f 74 4b 65  79 50 72 6f 63 65 73 73  |0("HotKeyProcess|
00023660  3a 54 65 6d 70 6c 61 74  65 20 6e 61 6d 65 20 69  |:Template name i|
00023670  73 20 27 22 2b 77 69 6e  24 2b 22 27 22 29 0d 12  |s '"+win$+"'")..|
00023680  7b 0b 2a 7c 65 6e 64 69  66 0d 12 7c 21 20 20 e7  |{.*|endif..|!  .|
00023690  20 28 77 69 6e 24 3c 3e  22 22 20 80 20 74 65 6d  | (win$<>"" . tem|
000236a0  70 25 21 31 32 3d 30 29  20 8c 0d 12 7d 35 20 20  |p%!12=0) ...}5  |
000236b0  20 20 f4 20 6f 6e 6c 79  20 63 72 65 61 74 65 20  |  . only create |
000236c0  61 20 77 69 6e 64 6f 77  20 69 66 20 69 74 20 69  |a window if it i|
000236d0  73 20 61 20 64 79 6e 61  6d 69 63 20 6f 6e 65 0d  |s a dynamic one.|
000236e0  12 7e 32 20 20 20 20 f4  20 73 74 61 74 69 63 20  |.~2    . static |
000236f0  77 69 6e 64 6f 77 73 20  68 61 76 65 20 61 6c 72  |windows have alr|
00023700  65 61 64 79 20 62 65 65  6e 20 63 72 65 61 74 65  |eady been create|
00023710  64 0d 12 7f 24 20 20 20  20 f2 73 68 65 6c 6c 5f  |d...$    .shell_|
00023720  43 72 65 61 74 65 57 69  6e 64 6f 77 28 77 69 6e  |CreateWindow(win|
00023730  24 2c 68 25 29 0d 12 80  15 2a 7c 69 66 64 65 66  |$,h%)....*|ifdef|
00023740  20 54 72 61 63 65 49 6e  69 74 0d 12 81 59 20 20  | TraceInit...Y  |
00023750  20 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |  .shell_Tracef0|
00023760  28 22 48 6f 74 4b 65 79  50 72 6f 63 65 73 73 3a  |("HotKeyProcess:|
00023770  43 72 65 61 74 69 6e 67  20 6e 65 77 20 64 79 6e  |Creating new dyn|
00023780  61 6d 69 63 20 77 69 6e  64 6f 77 20 28 68 61 6e  |amic window (han|
00023790  64 6c 65 20 69 73 20 26  22 2b c3 7e 68 25 2b 22  |dle is &"+.~h%+"|
000237a0  29 22 29 0d 12 82 0b 2a  7c 65 6e 64 69 66 0d 12  |)")....*|endif..|
000237b0  83 2a 20 20 20 20 77 69  6e 5f 62 6c 6b 25 3d a4  |.*    win_blk%=.|
000237c0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
000237d0  65 74 63 68 28 33 36 29  0d 12 84 15 20 20 20 20  |etch(36)....    |
000237e0  77 69 6e 5f 62 6c 6b 25  21 30 3d 68 25 0d 12 85  |win_blk%!0=h%...|
000237f0  2a 20 20 20 20 c8 99 20  22 57 69 6d 70 5f 47 65  |*    .. "Wimp_Ge|
00023800  74 57 69 6e 64 6f 77 53  74 61 74 65 22 2c 2c 77  |tWindowState",,w|
00023810  69 6e 5f 62 6c 6b 25 0d  12 86 29 20 20 20 20 78  |in_blk%...)    x|
00023820  5f 6f 66 66 25 3d 28 77  69 6e 5f 62 6c 6b 25 21  |_off%=(win_blk%!|
00023830  34 2d 77 69 6e 5f 62 6c  6b 25 21 31 32 29 2f 32  |4-win_blk%!12)/2|
00023840  0d 12 87 29 20 20 20 20  79 5f 6f 66 66 25 3d 28  |...)    y_off%=(|
00023850  77 69 6e 5f 62 6c 6b 25  21 31 36 2d 77 69 6e 5f  |win_blk%!16-win_|
00023860  62 6c 6b 25 21 38 29 2f  32 0d 12 88 28 20 20 20  |blk%!8)/2...(   |
00023870  20 f2 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
00023880  6b 52 65 74 75 72 6e 28  77 69 6e 5f 62 6c 6b 25  |kReturn(win_blk%|
00023890  29 0d 12 89 07 20 20 cd  0d 12 8a 16 20 20 66 6e  |)....  .....  fn|
000238a0  31 24 3d 24 28 74 65 6d  70 25 21 31 36 29 0d 12  |1$=$(temp%!16)..|
000238b0  8b 12 20 20 e7 20 66 6e  31 24 3c 3e 22 22 20 8c  |..  . fn1$<>"" .|
000238c0  0d 12 8c 15 2a 7c 69 66  64 65 66 20 54 72 61 63  |....*|ifdef Trac|
000238d0  65 49 6e 69 74 0d 12 8d  46 20 20 20 20 f2 73 68  |eInit...F    .sh|
000238e0  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 48 6f 74  |ell_Tracef0("Hot|
000238f0  4b 65 79 50 72 6f 63 65  73 73 3a 43 61 6c 6c 69  |KeyProcess:Calli|
00023900  6e 67 20 50 72 65 2d 4f  70 65 6e 20 46 4e 20 27  |ng Pre-Open FN '|
00023910  22 2b 66 6e 31 24 2b 22  27 22 29 0d 12 8e 0b 2a  |"+fn1$+"'")....*|
00023920  7c 65 6e 64 69 66 0d 12  8f 16 20 20 20 20 e7 20  ||endif....    . |
00023930  74 65 6d 70 25 21 31 32  3e 30 20 8c 0d 12 90 2e  |temp%!12>0 .....|
00023940  20 20 20 20 20 20 76 6f  69 64 25 3d a0 28 22 46  |      void%=.("F|
00023950  4e 22 2b 66 6e 31 24 2b  22 28 22 2b c3 74 65 6d  |N"+fn1$+"("+.tem|
00023960  70 25 21 31 32 2b 22 29  22 29 0d 12 91 09 20 20  |p%!12+")")....  |
00023970  20 20 cc 0d 12 92 28 20  20 20 20 20 20 76 6f 69  |  ....(      voi|
00023980  64 25 3d a0 28 22 46 4e  22 2b 66 6e 31 24 2b 22  |d%=.("FN"+fn1$+"|
00023990  28 22 2b c3 68 25 2b 22  29 22 29 0d 12 93 09 20  |("+.h%+")").... |
000239a0  20 20 20 cd 0d 12 94 07  20 20 cc 0d 12 95 15 2a  |   .....  .....*|
000239b0  7c 69 66 64 65 66 20 54  72 61 63 65 49 6e 69 74  ||ifdef TraceInit|
000239c0  0d 12 96 3f 20 20 f2 73  68 65 6c 6c 5f 54 72 61  |...?  .shell_Tra|
000239d0  63 65 66 30 28 22 48 6f  74 4b 65 79 50 72 6f 63  |cef0("HotKeyProc|
000239e0  65 73 73 3a 4e 6f 20 50  72 65 2d 4f 70 65 6e 20  |ess:No Pre-Open |
000239f0  46 4e 20 72 65 67 69 73  74 65 72 65 64 22 29 0d  |FN registered").|
00023a00  12 97 0b 2a 7c 65 6e 64  69 66 0d 12 98 07 20 20  |...*|endif....  |
00023a10  cd 0d 12 99 35 20 20 20  20 6f 66 66 73 65 74 25  |....5    offset%|
00023a20  3d a4 73 68 65 6c 6c 5f  53 65 61 72 63 68 53 74  |=.shell_SearchSt|
00023a30  61 74 69 63 28 5f 55 25  21 31 38 34 2c 74 65 6d  |atic(_U%!184,tem|
00023a40  70 25 21 31 32 29 0d 12  9a 16 20 20 20 20 e7 20  |p%!12)....    . |
00023a50  6f 66 66 73 65 74 25 3e  2d 31 20 8c 0d 12 9b 2b  |offset%>-1 ....+|
00023a60  20 20 20 20 20 20 f2 73  68 65 6c 6c 5f 4f 70 65  |      .shell_Ope|
00023a70  6e 57 69 6e 64 6f 77 53  74 61 74 69 63 28 74 65  |nWindowStatic(te|
00023a80  6d 70 25 21 31 32 29 0d  12 9c 09 20 20 20 20 cc  |mp%!12)....    .|
00023a90  0d 12 9d 18 20 20 20 20  20 20 e7 20 74 65 6d 70  |....      . temp|
00023aa0  25 21 31 32 3e 30 20 8c  0d 12 9e 40 20 20 20 20  |%!12>0 ....@    |
00023ab0  20 20 20 20 f4 20 72 65  71 75 65 73 74 20 74 6f  |    . request to|
00023ac0  20 6f 70 65 6e 20 61 20  73 74 61 74 69 63 20 77  | open a static w|
00023ad0  69 6e 64 6f 77 2c 20 62  75 74 20 77 69 6e 64 6f  |indow, but windo|
00023ae0  77 20 68 61 6e 64 6c 65  0d 12 9f 43 20 20 20 20  |w handle...C    |
00023af0  20 20 20 20 f4 20 68 61  73 20 6e 6f 74 20 62 65  |    . has not be|
00023b00  65 6e 20 72 65 67 69 73  74 65 72 65 64 20 77 69  |en registered wi|
00023b10  74 68 20 73 68 65 6c 6c  5f 43 72 65 61 74 65 57  |th shell_CreateW|
00023b20  69 6e 64 6f 77 53 74 61  74 69 63 0d 12 a0 33 20  |indowStatic...3 |
00023b30  20 20 20 20 20 20 20 85  20 39 39 2c a4 73 68 65  |       . 99,.she|
00023b40  6c 6c 5f 4d 65 73 73 61  67 65 4e 6f 41 72 67 73  |ll_MessageNoArgs|
00023b50  28 22 53 48 45 4c 4c 4d  53 47 30 39 22 29 0d 12  |("SHELLMSG09")..|
00023b60  a1 0b 20 20 20 20 20 20  cc 0d 12 a2 2e 20 20 20  |..      .....   |
00023b70  20 20 20 20 20 f4 20 6d  75 73 74 20 62 65 20 61  |     . must be a|
00023b80  20 64 79 6e 61 6d 69 63  20 77 69 6e 64 6f 77 20  | dynamic window |
00023b90  74 68 65 6e 2e 2e 2e 0d  12 a3 37 20 20 20 20 20  |then......7     |
00023ba0  20 20 20 f2 73 68 65 6c  6c 5f 4f 70 65 6e 57 69  |   .shell_OpenWi|
00023bb0  6e 64 6f 77 44 79 6e 61  6d 69 63 32 28 68 25 2c  |ndowDynamic2(h%,|
00023bc0  78 5f 6f 66 66 25 2c 79  5f 6f 66 66 25 29 0d 12  |x_off%,y_off%)..|
00023bd0  a4 0b 20 20 20 20 20 20  cd 0d 12 a5 09 20 20 20  |..      .....   |
00023be0  20 cd 0d 12 a6 16 20 20  66 6e 32 24 3d 24 28 74  | .....  fn2$=$(t|
00023bf0  65 6d 70 25 21 32 30 29  0d 12 a7 12 20 20 e7 20  |emp%!20)....  . |
00023c00  66 6e 32 24 3c 3e 22 22  20 8c 0d 12 a8 15 2a 7c  |fn2$<>"" .....*||
00023c10  69 66 64 65 66 20 54 72  61 63 65 49 6e 69 74 0d  |ifdef TraceInit.|
00023c20  12 a9 47 20 20 20 20 f2  73 68 65 6c 6c 5f 54 72  |..G    .shell_Tr|
00023c30  61 63 65 66 30 28 22 48  6f 74 4b 65 79 50 72 6f  |acef0("HotKeyPro|
00023c40  63 65 73 73 3a 43 61 6c  6c 69 6e 67 20 50 6f 73  |cess:Calling Pos|
00023c50  74 2d 4f 70 65 6e 20 46  4e 20 27 22 2b 66 6e 32  |t-Open FN '"+fn2|
00023c60  24 2b 22 27 22 29 0d 12  aa 0b 2a 7c 65 6e 64 69  |$+"'")....*|endi|
00023c70  66 0d 12 ab 16 20 20 20  20 e7 20 74 65 6d 70 25  |f....    . temp%|
00023c80  21 31 32 3e 30 20 8c 0d  12 ac 2e 20 20 20 20 20  |!12>0 .....     |
00023c90  20 76 6f 69 64 25 3d a0  28 22 46 4e 22 2b 66 6e  | void%=.("FN"+fn|
00023ca0  31 24 2b 22 28 22 2b c3  74 65 6d 70 25 21 31 32  |1$+"("+.temp%!12|
00023cb0  2b 22 29 22 29 0d 12 ad  09 20 20 20 20 cc 0d 12  |+")")....    ...|
00023cc0  ae 28 20 20 20 20 20 20  76 6f 69 64 25 3d a0 28  |.(      void%=.(|
00023cd0  22 46 4e 22 2b 66 6e 32  24 2b 22 28 22 2b c3 68  |"FN"+fn2$+"("+.h|
00023ce0  25 2b 22 29 22 29 0d 12  af 09 20 20 20 20 cd 0d  |%+")")....    ..|
00023cf0  12 b0 07 20 20 cc 0d 12  b1 15 2a 7c 69 66 64 65  |...  .....*|ifde|
00023d00  66 20 54 72 61 63 65 49  6e 69 74 0d 12 b2 42 20  |f TraceInit...B |
00023d10  20 20 20 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |   .shell_Tracef|
00023d20  30 28 22 48 6f 74 4b 65  79 50 72 6f 63 65 73 73  |0("HotKeyProcess|
00023d30  3a 4e 6f 20 50 6f 73 74  2d 4f 70 65 6e 20 46 4e  |:No Post-Open FN|
00023d40  20 72 65 67 69 73 74 65  72 65 64 22 29 0d 12 b3  | registered")...|
00023d50  0b 2a 7c 65 6e 64 69 66  0d 12 b4 07 20 20 cd 0d  |.*|endif....  ..|
00023d60  12 b5 0f 20 20 72 65 73  75 6c 74 25 3d b9 0d 12  |...  result%=...|
00023d70  b6 05 cc 0d 12 b7 27 20  20 77 69 6e 24 3d 22 22  |......'  win$=""|
00023d80  3a 66 6e 31 24 3d 22 22  3a 66 6e 32 24 3d 22 22  |:fn1$="":fn2$=""|
00023d90  3a 72 65 73 75 6c 74 25  3d a3 0d 12 b8 05 cd 0d  |:result%=.......|
00023da0  12 b9 0c 3d 72 65 73 75  6c 74 25 0d 12 ba 05 3a  |...=result%....:|
00023db0  0d 12 bb 20 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |... *|Stop FNshe|
00023dc0  6c 6c 5f 48 6f 74 4b 65  79 50 72 6f 63 65 73 73  |ll_HotKeyProcess|
00023dd0  0d 12 bc 04 0d 12 bd 2b  2a 7c 53 74 61 72 74 20  |.......+*|Start |
00023de0  50 52 4f 43 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |PROCshell_Window|
00023df0  43 65 6e 74 72 65 4f 6e  50 6f 69 6e 74 65 72 0d  |CentreOnPointer.|
00023e00  12 be 26 dd 20 f2 73 68  65 6c 6c 5f 57 69 6e 64  |..&. .shell_Wind|
00023e10  6f 77 43 65 6e 74 72 65  4f 6e 50 6f 69 6e 74 65  |owCentreOnPointe|
00023e20  72 28 68 25 29 0d 12 bf  21 ea 20 77 5f 62 6c 6b  |r(h%)...!. w_blk|
00023e30  25 2c 70 5f 62 6c 6b 25  2c 78 5f 6f 66 66 25 2c  |%,p_blk%,x_off%,|
00023e40  79 5f 6f 66 66 25 0d 12  c0 28 70 5f 62 6c 6b 25  |y_off%...(p_blk%|
00023e50  20 20 20 3d 20 a4 73 68  65 6c 6c 5f 48 65 61 70  |   = .shell_Heap|
00023e60  42 6c 6f 63 6b 46 65 74  63 68 28 32 30 29 0d 12  |BlockFetch(20)..|
00023e70  c1 24 c8 99 20 22 57 69  6d 70 5f 47 65 74 50 6f  |.$.. "Wimp_GetPo|
00023e80  69 6e 74 65 72 49 6e 66  6f 22 2c 2c 70 5f 62 6c  |interInfo",,p_bl|
00023e90  6b 25 0d 12 c2 28 77 69  6e 5f 62 6c 6b 25 20 3d  |k%...(win_blk% =|
00023ea0  20 a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
00023eb0  6b 46 65 74 63 68 28 33  36 29 0d 12 c3 13 77 69  |kFetch(36)....wi|
00023ec0  6e 5f 62 6c 6b 25 21 30  20 3d 20 68 25 0d 12 c4  |n_blk%!0 = h%...|
00023ed0  26 c8 99 20 22 57 69 6d  70 5f 47 65 74 57 69 6e  |&.. "Wimp_GetWin|
00023ee0  64 6f 77 53 74 61 74 65  22 2c 2c 77 69 6e 5f 62  |dowState",,win_b|
00023ef0  6c 6b 25 0d 12 c5 2c 78  5f 6f 66 66 25 20 3d 20  |lk%...,x_off% = |
00023f00  28 77 69 6e 5f 62 6c 6b  25 21 30 34 20 2d 20 77  |(win_blk%!04 - w|
00023f10  69 6e 5f 62 6c 6b 25 21  31 32 29 20 2f 20 32 0d  |in_blk%!12) / 2.|
00023f20  12 c6 2c 79 5f 6f 66 66  25 20 3d 20 28 77 69 6e  |..,y_off% = (win|
00023f30  5f 62 6c 6b 25 21 31 36  20 2d 20 77 69 6e 5f 62  |_blk%!16 - win_b|
00023f40  6c 6b 25 21 30 38 29 20  2f 20 32 0d 12 c7 3f f2  |lk%!08) / 2...?.|
00023f50  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 4d 6f 76 65  |shell_WindowMove|
00023f60  54 6f 28 68 25 2c 70 5f  62 6c 6b 25 21 30 20 2b  |To(h%,p_blk%!0 +|
00023f70  20 78 5f 6f 66 66 25 2c  70 5f 62 6c 6b 25 21 34  | x_off%,p_blk%!4|
00023f80  20 2d 20 79 5f 6f 66 66  25 29 0d 12 c8 24 f2 73  | - y_off%)...$.s|
00023f90  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 52 65  |hell_HeapBlockRe|
00023fa0  74 75 72 6e 28 77 69 6e  5f 62 6c 6b 25 29 0d 12  |turn(win_blk%)..|
00023fb0  c9 22 f2 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |.".shell_HeapBlo|
00023fc0  63 6b 52 65 74 75 72 6e  28 70 5f 62 6c 6b 25 29  |ckReturn(p_blk%)|
00023fd0  0d 12 ca 05 e1 0d 12 cb  05 3a 0d 12 cc 2a 2a 7c  |.........:...**||
00023fe0  53 74 6f 70 20 50 52 4f  43 73 68 65 6c 6c 5f 57  |Stop PROCshell_W|
00023ff0  69 6e 64 6f 77 43 65 6e  74 72 65 4f 6e 50 6f 69  |indowCentreOnPoi|
00024000  6e 74 65 72 0d 12 cd 04  0d 12 ce 2a 2a 7c 53 74  |nter.......**|St|
00024010  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 57 69  |art PROCshell_Wi|
00024020  6e 64 6f 77 43 65 6e 74  72 65 4f 6e 53 63 72 65  |ndowCentreOnScre|
00024030  65 6e 0d 12 cf 25 dd 20  f2 73 68 65 6c 6c 5f 57  |en...%. .shell_W|
00024040  69 6e 64 6f 77 43 65 6e  74 72 65 4f 6e 53 63 72  |indowCentreOnScr|
00024050  65 65 6e 28 68 25 29 0d  12 d0 49 ea 20 77 5f 62  |een(h%)...I. w_b|
00024060  6c 6b 25 2c 73 63 72 6e  5f 78 6d 61 78 25 2c 73  |lk%,scrn_xmax%,s|
00024070  63 72 6e 5f 79 6d 61 78  25 2c 77 69 64 74 68 25  |crn_ymax%,width%|
00024080  2c 68 65 69 67 68 74 25  2c 58 45 69 67 46 61 63  |,height%,XEigFac|
00024090  74 6f 72 25 2c 59 45 69  67 46 61 63 74 6f 72 25  |tor%,YEigFactor%|
000240a0  0d 12 d1 33 c8 99 20 22  58 4f 53 5f 52 65 61 64  |...3.. "XOS_Read|
000240b0  4d 6f 64 65 56 61 72 69  61 62 6c 65 22 2c 2d 31  |ModeVariable",-1|
000240c0  2c 30 34 20 b8 20 2c 2c  58 45 69 67 46 61 63 74  |,04 . ,,XEigFact|
000240d0  6f 72 25 0d 12 d2 33 c8  99 20 22 58 4f 53 5f 52  |or%...3.. "XOS_R|
000240e0  65 61 64 4d 6f 64 65 56  61 72 69 61 62 6c 65 22  |eadModeVariable"|
000240f0  2c 2d 31 2c 30 35 20 b8  20 2c 2c 59 45 69 67 46  |,-1,05 . ,,YEigF|
00024100  61 63 74 6f 72 25 0d 12  d3 32 c8 99 20 22 58 4f  |actor%...2.. "XO|
00024110  53 5f 52 65 61 64 4d 6f  64 65 56 61 72 69 61 62  |S_ReadModeVariab|
00024120  6c 65 22 2c 2d 31 2c 31  31 20 b8 20 2c 2c 73 63  |le",-1,11 . ,,sc|
00024130  72 6e 5f 78 6d 61 78 25  0d 12 d4 32 c8 99 20 22  |rn_xmax%...2.. "|
00024140  58 4f 53 5f 52 65 61 64  4d 6f 64 65 56 61 72 69  |XOS_ReadModeVari|
00024150  61 62 6c 65 22 2c 2d 31  2c 31 32 20 b8 20 2c 2c  |able",-1,12 . ,,|
00024160  73 63 72 6e 5f 79 6d 61  78 25 0d 12 d5 4e 73 63  |scrn_ymax%...Nsc|
00024170  72 6e 5f 78 6d 61 78 25  20 3d 20 73 63 72 6e 5f  |rn_xmax% = scrn_|
00024180  78 6d 61 78 25 20 3c 3c  20 58 45 69 67 46 61 63  |xmax% << XEigFac|
00024190  74 6f 72 25 3a f4 20 43  6f 6e 76 65 72 74 20 70  |tor%:. Convert p|
000241a0  69 78 65 6c 73 20 74 6f  20 73 63 72 65 65 6e 20  |ixels to screen |
000241b0  63 6f 6f 72 64 73 2e 2e  0d 12 d6 4e 73 63 72 6e  |coords.....Nscrn|
000241c0  5f 79 6d 61 78 25 20 3d  20 73 63 72 6e 5f 79 6d  |_ymax% = scrn_ym|
000241d0  61 78 25 20 3c 3c 20 59  45 69 67 46 61 63 74 6f  |ax% << YEigFacto|
000241e0  72 25 3a f4 20 43 6f 6e  76 65 72 74 20 70 69 78  |r%:. Convert pix|
000241f0  65 6c 73 20 74 6f 20 73  63 72 65 65 6e 20 63 6f  |els to screen co|
00024200  6f 72 64 73 2e 2e 0d 12  d7 2a 77 69 6e 5f 62 6c  |ords.....*win_bl|
00024210  6b 25 20 20 20 3d 20 a4  73 68 65 6c 6c 5f 48 65  |k%   = .shell_He|
00024220  61 70 42 6c 6f 63 6b 46  65 74 63 68 28 33 36 29  |apBlockFetch(36)|
00024230  0d 12 d8 13 77 69 6e 5f  62 6c 6b 25 21 30 20 3d  |....win_blk%!0 =|
00024240  20 68 25 0d 12 d9 26 c8  99 20 22 57 69 6d 70 5f  | h%...&.. "Wimp_|
00024250  47 65 74 57 69 6e 64 6f  77 53 74 61 74 65 22 2c  |GetWindowState",|
00024260  2c 77 69 6e 5f 62 6c 6b  25 0d 12 da 29 77 69 64  |,win_blk%...)wid|
00024270  74 68 25 20 20 3d 20 28  77 69 6e 5f 62 6c 6b 25  |th%  = (win_blk%|
00024280  21 31 32 20 2d 20 77 69  6e 5f 62 6c 6b 25 21 30  |!12 - win_blk%!0|
00024290  34 29 0d 12 db 29 68 65  69 67 68 74 25 20 3d 20  |4)...)height% = |
000242a0  28 77 69 6e 5f 62 6c 6b  25 21 31 36 20 2d 20 77  |(win_blk%!16 - w|
000242b0  69 6e 5f 62 6c 6b 25 21  30 38 29 0d 12 dc 56 f2  |in_blk%!08)...V.|
000242c0  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 4d 6f 76 65  |shell_WindowMove|
000242d0  54 6f 28 68 25 2c 28 73  63 72 6e 5f 78 6d 61 78  |To(h%,(scrn_xmax|
000242e0  25 20 2f 20 32 29 20 2d  20 28 77 69 64 74 68 25  |% / 2) - (width%|
000242f0  20 2f 20 32 29 2c 28 73  63 72 6e 5f 79 6d 61 78  | / 2),(scrn_ymax|
00024300  25 20 2d 20 68 65 69 67  68 74 25 29 20 2f 20 32  |% - height%) / 2|
00024310  29 0d 12 dd 24 f2 73 68  65 6c 6c 5f 48 65 61 70  |)...$.shell_Heap|
00024320  42 6c 6f 63 6b 52 65 74  75 72 6e 28 77 69 6e 5f  |BlockReturn(win_|
00024330  62 6c 6b 25 29 0d 12 de  05 e1 0d 12 df 05 3a 0d  |blk%).........:.|
00024340  12 e0 29 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |..)*|Stop PROCsh|
00024350  65 6c 6c 5f 57 69 6e 64  6f 77 43 65 6e 74 72 65  |ell_WindowCentre|
00024360  4f 6e 53 63 72 65 65 6e  0d 12 e1 04 0d 12 e2 2d  |OnScreen.......-|
00024370  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
00024380  6c 5f 4f 70 65 6e 57 69  6e 64 6f 77 53 74 61 74  |l_OpenWindowStat|
00024390  69 63 4e 65 77 56 69 65  77 0d 12 e3 29 dd 20 f2  |icNewView...). .|
000243a0  73 68 65 6c 6c 5f 4f 70  65 6e 57 69 6e 64 6f 77  |shell_OpenWindow|
000243b0  53 74 61 74 69 63 4e 65  77 56 69 65 77 28 77 68  |StaticNewView(wh|
000243c0  25 29 0d 12 e4 1f f2 73  68 65 6c 6c 5f 4f 70 65  |%).....shell_Ope|
000243d0  6e 57 69 6e 64 6f 77 28  77 68 25 2c a3 2c 2d 31  |nWindow(wh%,.,-1|
000243e0  29 0d 12 e5 05 e1 0d 12  e6 05 3a 0d 12 e7 2c 2a  |).........:...,*|
000243f0  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
00024400  4f 70 65 6e 57 69 6e 64  6f 77 53 74 61 74 69 63  |OpenWindowStatic|
00024410  4e 65 77 56 69 65 77 0d  12 e8 04 0d 12 e9 26 2a  |NewView.......&*|
00024420  7c 53 74 61 72 74 20 50  52 4f 43 73 68 65 6c 6c  ||Start PROCshell|
00024430  5f 4f 70 65 6e 57 69 6e  64 6f 77 53 74 61 74 69  |_OpenWindowStati|
00024440  63 0d 12 ea 26 dd 20 f2  73 68 65 6c 6c 5f 4f 70  |c...&. .shell_Op|
00024450  65 6e 57 69 6e 64 6f 77  53 74 61 74 69 63 28 68  |enWindowStatic(h|
00024460  61 6e 64 6c 65 25 29 0d  12 eb 31 e7 20 a4 73 68  |andle%)...1. .sh|
00024470  65 6c 6c 5f 53 65 61 72  63 68 53 74 61 74 69 63  |ell_SearchStatic|
00024480  28 5f 55 25 21 31 38 34  2c 68 61 6e 64 6c 65 25  |(_U%!184,handle%|
00024490  29 20 3e 20 2d 31 20 8c  0d 12 ec 25 20 20 f2 73  |) > -1 ....%  .s|
000244a0  68 65 6c 6c 5f 4f 70 65  6e 57 69 6e 64 6f 77 28  |hell_OpenWindow(|
000244b0  68 61 6e 64 6c 65 25 2c  30 2c 2d 31 29 0d 12 ed  |handle%,0,-1)...|
000244c0  05 cc 0d 12 ee 34 20 20  f4 20 45 52 52 4f 52 20  |.....4  . ERROR |
000244d0  39 39 2c 46 4e 73 68 65  6c 6c 5f 4d 65 73 73 61  |99,FNshell_Messa|
000244e0  67 65 4e 6f 41 72 67 73  28 22 53 48 45 4c 4c 4d  |geNoArgs("SHELLM|
000244f0  53 47 30 39 22 29 0d 12  ef 05 cd 0d 12 f0 05 e1  |SG09")..........|
00024500  0d 12 f1 05 3a 0d 12 f2  25 2a 7c 53 74 6f 70 20  |....:...%*|Stop |
00024510  50 52 4f 43 73 68 65 6c  6c 5f 4f 70 65 6e 57 69  |PROCshell_OpenWi|
00024520  6e 64 6f 77 53 74 61 74  69 63 0d 12 f3 04 0d 12  |ndowStatic......|
00024530  f4 20 2a 7c 53 74 61 72  74 20 46 4e 73 68 65 6c  |. *|Start FNshel|
00024540  6c 5f 53 65 61 72 63 68  53 74 61 74 69 63 0d 12  |l_SearchStatic..|
00024550  f5 2a dd 20 a4 73 68 65  6c 6c 5f 53 65 61 72 63  |.*. .shell_Searc|
00024560  68 53 74 61 74 69 63 28  77 5f 6c 69 73 74 25 2c  |hStatic(w_list%,|
00024570  68 61 6e 64 6c 65 25 29  0d 12 f6 30 f4 20 73 65  |handle%)...0. se|
00024580  61 72 63 68 20 73 74 61  74 69 63 20 77 69 6e 64  |arch static wind|
00024590  6f 77 20 6c 69 73 74 20  62 79 20 77 69 6e 64 6f  |ow list by windo|
000245a0  77 20 68 61 6e 64 6c 65  0d 12 f7 11 ea 20 66 6f  |w handle..... fo|
000245b0  75 6e 64 25 2c 63 74 72  25 0d 12 f8 18 66 6f 75  |und%,ctr%....fou|
000245c0  6e 64 25 20 3d 20 2d 31  3a 63 74 72 25 20 3d 20  |nd% = -1:ctr% = |
000245d0  30 0d 12 f9 33 e7 20 68  61 6e 64 6c 65 25 20 3c  |0...3. handle% <|
000245e0  20 30 20 8c 20 3d 20 30  20 3a f4 20 49 63 6f 6e  | 0 . = 0 :. Icon|
000245f0  62 61 72 2c 20 6d 75 73  74 20 62 65 20 73 74 61  |bar, must be sta|
00024600  74 69 63 21 0d 12 fa 3d  f4 20 50 52 4f 43 73 68  |tic!...=. PROCsh|
00024610  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 44 45 42  |ell_Tracef0("DEB|
00024620  55 47 3a 3a 6f 6c 64 20  68 61 6e 64 6c 65 20 3d  |UG::old handle =|
00024630  20 26 22 2b 53 54 52 24  7e 68 61 6e 64 6c 65 25  | &"+STR$~handle%|
00024640  29 0d 12 fb 14 e7 20 77  5f 6c 69 73 74 25 20 3c  |)..... w_list% <|
00024650  3e 20 30 20 8c 0d 12 fc  1b 20 20 c8 95 20 77 5f  |> 0 .....  .. w_|
00024660  6c 69 73 74 25 21 63 74  72 25 20 3c 3e 20 2d 31  |list%!ctr% <> -1|
00024670  0d 12 fd 51 20 20 20 20  f4 20 50 52 4f 43 73 68  |...Q    . PROCsh|
00024680  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 44 45 42  |ell_Tracef0("DEB|
00024690  55 47 3a 3a 73 65 61 72  63 68 69 6e 67 2e 2e 20  |UG::searching.. |
000246a0  68 61 6e 64 6c 65 20 69  73 20 26 22 2b 53 54 52  |handle is &"+STR|
000246b0  24 7e 28 77 5f 6c 69 73  74 25 21 63 74 72 25 29  |$~(w_list%!ctr%)|
000246c0  29 0d 12 fe 22 20 20 20  20 e7 20 77 5f 6c 69 73  |)..."    . w_lis|
000246d0  74 25 21 63 74 72 25 20  3d 20 68 61 6e 64 6c 65  |t%!ctr% = handle|
000246e0  25 20 8c 0d 12 ff 17 20  20 20 20 20 20 66 6f 75  |% .....      fou|
000246f0  6e 64 25 20 3d 20 63 74  72 25 0d 13 00 30 20 20  |nd% = ctr%...0  |
00024700  20 20 20 20 f4 20 50 52  4f 43 73 68 65 6c 6c 5f  |    . PROCshell_|
00024710  54 72 61 63 65 66 30 28  22 44 45 42 55 47 3a 3a  |Tracef0("DEBUG::|
00024720  66 6f 75 6e 64 2e 2e 2e  22 29 0d 13 01 12 20 20  |found...")....  |
00024730  20 20 20 20 3d 20 66 6f  75 6e 64 25 0d 13 02 09  |    = found%....|
00024740  20 20 20 20 cd 0d 13 03  11 20 20 20 20 63 74 72  |    .....    ctr|
00024750  25 20 2b 3d 20 34 0d 13  04 07 20 20 ce 0d 13 05  |% += 4....  ....|
00024760  05 cd 0d 13 06 0b 3d 66  6f 75 6e 64 25 0d 13 07  |......=found%...|
00024770  05 3a 0d 13 08 1f 2a 7c  53 74 6f 70 20 46 4e 73  |.:....*|Stop FNs|
00024780  68 65 6c 6c 5f 53 65 61  72 63 68 53 74 61 74 69  |hell_SearchStati|
00024790  63 0d 13 09 04 0d 13 0a  28 2a 7c 53 74 61 72 74  |c.......(*|Start|
000247a0  20 50 52 4f 43 73 68 65  6c 6c 5f 43 72 65 61 74  | PROCshell_Creat|
000247b0  65 57 69 6e 64 6f 77 53  74 61 74 69 63 0d 13 0b  |eWindowStatic...|
000247c0  31 dd 20 f2 73 68 65 6c  6c 5f 43 72 65 61 74 65  |1. .shell_Create|
000247d0  57 69 6e 64 6f 77 53 74  61 74 69 63 28 69 64 65  |WindowStatic(ide|
000247e0  6e 74 24 2c f8 20 68 61  6e 64 6c 65 25 29 0d 13  |nt$,. handle%)..|
000247f0  0c 23 ea 20 77 62 5f 70  74 72 25 2c 77 5f 6c 69  |.#. wb_ptr%,w_li|
00024800  73 74 25 2c 74 65 6d 70  25 2c 6f 66 66 73 65 74  |st%,temp%,offset|
00024810  25 0d 13 0d 20 77 62 5f  70 74 72 25 3d a4 73 68  |%... wb_ptr%=.sh|
00024820  65 6c 6c 5f 47 65 74 57  42 28 69 64 65 6e 74 24  |ell_GetWB(ident$|
00024830  29 0d 13 0e 33 f4 20 73  65 74 20 27 73 70 72 69  |)...3. set 'spri|
00024840  74 65 20 61 72 65 61 27  20 70 6f 69 6e 74 65 72  |te area' pointer|
00024850  20 74 6f 20 75 73 65 72  73 70 72 69 74 65 73 20  | to usersprites |
00024860  61 72 65 61 0d 13 0f 15  77 62 5f 70 74 72 25 21  |area....wb_ptr%!|
00024870  36 34 3d 5f 55 25 21 31  36 0d 13 10 2d c8 99 20  |64=_U%!16...-.. |
00024880  22 57 69 6d 70 5f 43 72  65 61 74 65 57 69 6e 64  |"Wimp_CreateWind|
00024890  6f 77 22 2c 2c 77 62 5f  70 74 72 25 20 b8 20 68  |ow",,wb_ptr% . h|
000248a0  61 6e 64 6c 65 25 0d 13  11 13 77 5f 6c 69 73 74  |andle%....w_list|
000248b0  25 3d 5f 55 25 21 31 38  34 0d 13 12 11 e7 20 77  |%=_U%!184..... w|
000248c0  5f 6c 69 73 74 25 3d 30  20 8c 0d 13 13 12 20 20  |_list%=0 .....  |
000248d0  f4 20 65 6d 70 74 79 20  6c 69 73 74 0d 13 14 15  |. empty list....|
000248e0  2a 7c 69 66 64 65 66 20  54 72 61 63 65 49 6e 69  |*|ifdef TraceIni|
000248f0  74 0d 13 15 35 20 20 f2  73 68 65 6c 6c 5f 54 72  |t...5  .shell_Tr|
00024900  61 63 65 66 30 28 22 43  72 65 61 74 65 57 69 6e  |acef0("CreateWin|
00024910  64 6f 77 53 74 61 74 69  63 3a 45 6d 70 74 79 20  |dowStatic:Empty |
00024920  4c 69 73 74 22 29 0d 13  16 0b 2a 7c 65 6e 64 69  |List")....*|endi|
00024930  66 0d 13 17 26 20 20 5f  55 25 21 31 38 34 3d a4  |f...&  _U%!184=.|
00024940  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
00024950  65 74 63 68 28 38 29 0d  13 18 15 20 20 77 5f 6c  |etch(8)....  w_l|
00024960  69 73 74 25 3d 5f 55 25  21 31 38 34 0d 13 19 24  |ist%=_U%!184...$|
00024970  20 20 77 5f 6c 69 73 74  25 21 30 3d 68 61 6e 64  |  w_list%!0=hand|
00024980  6c 65 25 3a 77 5f 6c 69  73 74 25 21 34 3d 2d 31  |le%:w_list%!4=-1|
00024990  0d 13 1a 05 cc 0d 13 1b  25 20 20 f4 20 73 65 61  |........%  . sea|
000249a0  72 63 68 20 6c 69 73 74  20 66 6f 72 20 77 69 6e  |rch list for win|
000249b0  64 6f 77 20 68 61 6e 64  6c 65 0d 13 1c 15 2a 7c  |dow handle....*||
000249c0  69 66 64 65 66 20 54 72  61 63 65 49 6e 69 74 0d  |ifdef TraceInit.|
000249d0  13 1d 46 20 20 f2 73 68  65 6c 6c 5f 54 72 61 63  |..F  .shell_Trac|
000249e0  65 66 30 28 22 43 72 65  61 74 65 57 69 6e 64 6f  |ef0("CreateWindo|
000249f0  77 53 74 61 74 69 63 3a  53 65 61 72 63 68 69 6e  |wStatic:Searchin|
00024a00  67 20 66 6f 72 20 77 69  6e 64 6f 77 20 68 61 6e  |g for window han|
00024a10  64 6c 65 22 29 0d 13 1e  0b 2a 7c 65 6e 64 69 66  |dle")....*|endif|
00024a20  0d 13 1f 32 20 20 6f 66  66 73 65 74 25 3d a4 73  |...2  offset%=.s|
00024a30  68 65 6c 6c 5f 53 65 61  72 63 68 53 74 61 74 69  |hell_SearchStati|
00024a40  63 28 5f 55 25 21 31 38  34 2c 68 61 6e 64 6c 65  |c(_U%!184,handle|
00024a50  25 29 0d 13 20 14 20 20  e7 20 6f 66 66 73 65 74  |%).. .  . offset|
00024a60  25 3d 2d 31 20 8c 0d 13  21 2a 20 20 20 20 f4 20  |%=-1 ...!*    . |
00024a70  61 64 64 20 77 69 6e 64  6f 77 20 68 61 6e 64 6c  |add window handl|
00024a80  65 20 74 6f 20 73 74 61  74 69 63 20 6c 69 73 74  |e to static list|
00024a90  0d 13 22 15 2a 7c 69 66  64 65 66 20 54 72 61 63  |..".*|ifdef Trac|
00024aa0  65 49 6e 69 74 0d 13 23  53 20 20 f2 73 68 65 6c  |eInit..#S  .shel|
00024ab0  6c 5f 54 72 61 63 65 66  30 28 22 43 72 65 61 74  |l_Tracef0("Creat|
00024ac0  65 57 69 6e 64 6f 77 53  74 61 74 69 63 3a 4e 6f  |eWindowStatic:No|
00024ad0  74 20 66 6f 75 6e 64 20  2d 20 61 64 64 69 6e 67  |t found - adding|
00024ae0  20 77 69 6e 64 6f 77 20  68 61 6e 64 6c 65 20 74  | window handle t|
00024af0  6f 20 6c 69 73 74 22 29  0d 13 24 0b 2a 7c 65 6e  |o list")..$.*|en|
00024b00  64 69 66 0d 13 25 2e 20  20 20 20 6f 66 66 73 65  |dif..%.    offse|
00024b10  74 25 3d a4 73 68 65 6c  6c 5f 53 65 61 72 63 68  |t%=.shell_Search|
00024b20  53 74 61 74 69 63 28 5f  55 25 21 31 38 34 2c 30  |Static(_U%!184,0|
00024b30  29 0d 13 26 16 20 20 20  20 e7 20 6f 66 66 73 65  |)..&.    . offse|
00024b40  74 25 3d 2d 31 20 8c 0d  13 27 15 2a 7c 69 66 64  |t%=-1 ...'.*|ifd|
00024b50  65 66 20 54 72 61 63 65  49 6e 69 74 0d 13 28 47  |ef TraceInit..(G|
00024b60  20 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |  .shell_Tracef0|
00024b70  28 22 43 72 65 61 74 65  57 69 6e 64 6f 77 53 74  |("CreateWindowSt|
00024b80  61 74 69 63 3a 45 78 74  65 6e 64 69 6e 67 20 77  |atic:Extending w|
00024b90  69 6e 64 6f 77 20 68 61  6e 64 6c 65 20 6c 69 73  |indow handle lis|
00024ba0  74 22 29 0d 13 29 0b 2a  7c 65 6e 64 69 66 0d 13  |t")..).*|endif..|
00024bb0  2a 10 20 20 20 20 20 20  63 74 72 25 3d 30 0d 13  |*.      ctr%=0..|
00024bc0  2b 1d 20 20 20 20 20 20  c8 95 20 77 5f 6c 69 73  |+.      .. w_lis|
00024bd0  74 25 21 63 74 72 25 3c  3e 2d 31 0d 13 2c 13 20  |t%!ctr%<>-1..,. |
00024be0  20 20 20 20 20 20 20 63  74 72 25 2b 3d 34 0d 13  |       ctr%+=4..|
00024bf0  2d 0b 20 20 20 20 20 20  ce 0d 13 2e 33 20 20 20  |-.      ....3   |
00024c00  20 20 20 5f 55 25 21 31  38 34 3d a4 73 68 65 6c  |   _U%!184=.shel|
00024c10  6c 5f 48 65 61 70 42 6c  6f 63 6b 45 78 74 65 6e  |l_HeapBlockExten|
00024c20  64 28 5f 55 25 21 31 38  34 2c 34 29 0d 13 2f 19  |d(_U%!184,4)../.|
00024c30  20 20 20 20 20 20 77 5f  6c 69 73 74 25 3d 5f 55  |      w_list%=_U|
00024c40  25 21 31 38 34 0d 13 30  09 20 20 20 20 cc 0d 13  |%!184..0.    ...|
00024c50  31 15 2a 7c 69 66 64 65  66 20 54 72 61 63 65 49  |1.*|ifdef TraceI|
00024c60  6e 69 74 0d 13 32 45 20  20 f2 73 68 65 6c 6c 5f  |nit..2E  .shell_|
00024c70  54 72 61 63 65 66 30 28  22 43 72 65 61 74 65 57  |Tracef0("CreateW|
00024c80  69 6e 64 6f 77 53 74 61  74 69 63 3a 46 6f 75 6e  |indowStatic:Foun|
00024c90  64 20 75 6e 75 73 65 64  20 73 70 61 63 65 20 69  |d unused space i|
00024ca0  6e 20 6c 69 73 74 22 29  0d 13 33 0b 2a 7c 65 6e  |n list")..3.*|en|
00024cb0  64 69 66 0d 13 34 16 20  20 20 20 20 20 63 74 72  |dif..4.      ctr|
00024cc0  25 3d 6f 66 66 73 65 74  25 0d 13 35 09 20 20 20  |%=offset%..5.   |
00024cd0  20 cd 0d 13 36 1a 20 20  20 20 74 65 6d 70 25 3d  | ...6.    temp%=|
00024ce0  77 5f 6c 69 73 74 25 2b  63 74 72 25 0d 13 37 22  |w_list%+ctr%..7"|
00024cf0  20 20 20 20 74 65 6d 70  25 21 30 3d 68 61 6e 64  |    temp%!0=hand|
00024d00  6c 65 25 3a 74 65 6d 70  25 21 34 3d 2d 31 0d 13  |le%:temp%!4=-1..|
00024d10  38 07 20 20 cd 0d 13 39  05 cd 0d 13 3a 05 e1 0d  |8.  ...9....:...|
00024d20  13 3b 05 3a 0d 13 3c 27  2a 7c 53 74 6f 70 20 50  |.;.:..<'*|Stop P|
00024d30  52 4f 43 73 68 65 6c 6c  5f 43 72 65 61 74 65 57  |ROCshell_CreateW|
00024d40  69 6e 64 6f 77 53 74 61  74 69 63 0d 13 3d 04 0d  |indowStatic..=..|
00024d50  13 3e 24 2a 7c 53 74 61  72 74 20 50 52 4f 43 73  |.>$*|Start PROCs|
00024d60  68 65 6c 6c 5f 49 6e 69  74 48 65 6c 70 53 79 73  |hell_InitHelpSys|
00024d70  74 65 6d 0d 13 3f 27 dd  20 f2 73 68 65 6c 6c 5f  |tem..?'. .shell_|
00024d80  49 6e 69 74 48 65 6c 70  53 79 73 74 65 6d 28 70  |InitHelpSystem(p|
00024d90  61 74 68 24 2c 64 69 65  25 29 0d 13 40 37 ea 20  |ath$,die%)..@7. |
00024da0  74 61 69 6c 24 2c 70 6f  73 25 2c 4f 53 56 61 72  |tail$,pos%,OSVar|
00024db0  42 75 66 66 25 2c 72 65  73 70 61 74 68 24 2c 68  |Buff%,respath$,h|
00024dc0  65 6c 70 5f 66 6f 75 6e  64 25 2c 61 62 6f 72 74  |elp_found%,abort|
00024dd0  25 0d 13 41 40 5f 55 25  21 32 31 32 20 3d 20 30  |%..A@_U%!212 = 0|
00024de0  3a e7 20 5f 55 25 21 32  31 36 20 3c 3e 20 30 20  |:. _U%!216 <> 0 |
00024df0  8c 20 f2 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |. .shell_HeapBlo|
00024e00  63 6b 52 65 74 75 72 6e  28 5f 55 25 21 32 31 36  |ckReturn(_U%!216|
00024e10  29 0d 13 42 31 5f 55 25  21 32 31 36 20 3d 20 30  |)..B1_U%!216 = 0|
00024e20  3a f4 20 63 6c 65 61 72  20 70 65 6e 64 69 6e 67  |:. clear pending|
00024e30  20 63 6f 6d 6d 61 6e 64  20 62 75 66 66 65 72 2e  | command buffer.|
00024e40  2e 2e 0d 13 43 39 f2 73  68 65 6c 6c 5f 53 63 61  |....C9.shell_Sca|
00024e50  6e 46 6f 72 48 65 6c 70  3a f4 20 63 68 65 63 6b  |nForHelp:. check|
00024e60  20 69 66 20 53 74 72 6f  6e 67 48 6c 70 20 69 73  | if StrongHlp is|
00024e70  20 72 75 6e 6e 69 6e 67  2e 2e 2e 0d 13 44 2f e7  | running.....D/.|
00024e80  20 64 69 65 25 20 8c 20  74 61 69 6c 24 20 3d 20  | die% . tail$ = |
00024e90  22 20 2d 44 69 65 57 69  74 68 54 61 73 6b 22 20  |" -DieWithTask" |
00024ea0  8b 20 74 61 69 6c 24 3d  22 22 0d 13 45 18 e7 20  |. tail$=""..E.. |
00024eb0  5f 55 25 21 31 30 30 20  80 20 31 20 3c 3c 20 33  |_U%!100 . 1 << 3|
00024ec0  20 8c 0d 13 46 2c 20 20  f4 20 52 65 73 46 69 6e  | ...F,  . ResFin|
00024ed0  64 20 69 6e 69 74 69 61  6c 69 73 65 64 2c 20 63  |d initialised, c|
00024ee0  68 65 63 6b 20 52 65 73  50 61 74 68 2e 2e 0d 13  |heck ResPath....|
00024ef0  47 15 20 20 70 61 74 68  24 20 20 20 20 20 20 3d  |G.  path$      =|
00024f00  20 22 22 0d 13 48 2d 20  20 4f 53 56 61 72 42 75  | ""..H-  OSVarBu|
00024f10  66 66 25 20 3d 20 a4 73  68 65 6c 6c 5f 48 65 61  |ff% = .shell_Hea|
00024f20  70 42 6c 6f 63 6b 46 65  74 63 68 28 32 35 36 29  |pBlockFetch(256)|
00024f30  0d 13 49 55 20 20 72 65  73 70 61 74 68 24 20 20  |..IU  respath$  |
00024f40  20 3d 20 a4 73 68 65 6c  6c 5f 4f 53 56 61 72 47  | = .shell_OSVarG|
00024f50  65 74 56 61 6c 28 4f 53  56 61 72 42 75 66 66 25  |etVal(OSVarBuff%|
00024f60  2c 32 35 36 2c a4 73 68  65 6c 6c 5f 47 65 74 41  |,256,.shell_GetA|
00024f70  70 70 4e 61 6d 65 2b 22  52 65 73 24 50 61 74 68  |ppName+"Res$Path|
00024f80  22 2c 2d 31 29 0d 13 4a  28 20 20 f2 73 68 65 6c  |",-1)..J(  .shel|
00024f90  6c 5f 48 65 61 70 42 6c  6f 63 6b 52 65 74 75 72  |l_HeapBlockRetur|
00024fa0  6e 28 4f 53 56 61 72 42  75 66 66 25 29 0d 13 4b  |n(OSVarBuff%)..K|
00024fb0  07 20 20 f5 0d 13 4c 1d  20 20 20 20 70 6f 73 25  |.  ...L.    pos%|
00024fc0  20 3d 20 a7 72 65 73 70  61 74 68 24 2c 22 2c 22  | = .respath$,","|
00024fd0  29 0d 13 4d 14 20 20 20  20 e7 20 70 6f 73 25 20  |)..M.    . pos% |
00024fe0  3e 20 30 20 8c 0d 13 4e  48 20 20 20 20 20 20 e7  |> 0 ...NH      .|
00024ff0  20 a4 73 68 65 6c 6c 5f  46 69 6c 65 45 78 69 73  | .shell_FileExis|
00025000  74 73 28 c0 72 65 73 70  61 74 68 24 2c 70 6f 73  |ts(.respath$,pos|
00025010  25 20 2d 20 31 29 20 2b  20 a4 73 68 65 6c 6c 5f  |% - 1) + .shell_|
00025020  47 65 74 41 70 70 4e 61  6d 65 29 20 8c 0d 13 4f  |GetAppName) ...O|
00025030  3b 20 20 20 20 20 20 20  20 70 61 74 68 24 20 3d  |;        path$ =|
00025040  20 c0 72 65 73 70 61 74  68 24 2c 70 6f 73 25 20  | .respath$,pos% |
00025050  2d 20 31 29 20 2b 20 a4  73 68 65 6c 6c 5f 47 65  |- 1) + .shell_Ge|
00025060  74 41 70 70 4e 61 6d 65  0d 13 50 3f 20 20 20 20  |tAppName..P?    |
00025070  20 20 20 20 e7 20 a4 73  68 65 6c 6c 5f 53 74 72  |    . .shell_Str|
00025080  6f 6e 67 48 6c 70 43 68  6b 46 69 6c 65 73 28 70  |ongHlpChkFiles(p|
00025090  61 74 68 24 29 20 8c 20  68 65 6c 70 5f 66 6f 75  |ath$) . help_fou|
000250a0  6e 64 25 20 3d 20 b9 0d  13 51 0b 20 20 20 20 20  |nd% = ...Q.     |
000250b0  20 cc 0d 13 52 2a 20 20  20 20 20 20 20 20 72 65  | ...R*        re|
000250c0  73 70 61 74 68 24 20 3d  20 c1 72 65 73 70 61 74  |spath$ = .respat|
000250d0  68 24 2c 70 6f 73 25 20  2b 20 31 29 0d 13 53 0b  |h$,pos% + 1)..S.|
000250e0  20 20 20 20 20 20 cd 0d  13 54 09 20 20 20 20 cc  |      ...T.    .|
000250f0  0d 13 55 3d 20 20 20 20  20 20 e7 20 a4 73 68 65  |..U=      . .she|
00025100  6c 6c 5f 46 69 6c 65 45  78 69 73 74 73 28 72 65  |ll_FileExists(re|
00025110  73 70 61 74 68 24 20 2b  20 a4 73 68 65 6c 6c 5f  |spath$ + .shell_|
00025120  47 65 74 41 70 70 4e 61  6d 65 29 20 8c 0d 13 56  |GetAppName) ...V|
00025130  30 20 20 20 20 20 20 20  20 70 61 74 68 24 20 3d  |0        path$ =|
00025140  20 72 65 73 70 61 74 68  24 20 2b 20 a4 73 68 65  | respath$ + .she|
00025150  6c 6c 5f 47 65 74 41 70  70 4e 61 6d 65 0d 13 57  |ll_GetAppName..W|
00025160  3f 20 20 20 20 20 20 20  20 e7 20 a4 73 68 65 6c  |?        . .shel|
00025170  6c 5f 53 74 72 6f 6e 67  48 6c 70 43 68 6b 46 69  |l_StrongHlpChkFi|
00025180  6c 65 73 28 70 61 74 68  24 29 20 8c 20 68 65 6c  |les(path$) . hel|
00025190  70 5f 66 6f 75 6e 64 25  20 3d 20 b9 0d 13 58 0b  |p_found% = ...X.|
000251a0  20 20 20 20 20 20 cc 0d  13 59 16 20 20 20 20 20  |      ...Y.     |
000251b0  20 20 20 61 62 6f 72 74  25 20 3d 20 b9 0d 13 5a  |   abort% = ...Z|
000251c0  4b 20 20 20 20 20 20 20  20 f2 73 68 65 6c 6c 5f  |K        .shell_|
000251d0  4f 4b 28 a4 73 68 65 6c  6c 5f 4d 65 73 73 61 67  |OK(.shell_Messag|
000251e0  65 4f 6e 65 41 72 67 28  22 53 48 45 4c 4c 4d 53  |eOneArg("SHELLMS|
000251f0  47 32 36 22 2c a4 73 68  65 6c 6c 5f 47 65 74 41  |G26",.shell_GetA|
00025200  70 70 4e 61 6d 65 29 29  0d 13 5b 0b 20 20 20 20  |ppName))..[.    |
00025210  20 20 cd 0d 13 5c 09 20  20 20 20 cd 0d 13 5d 2a  |  ...\.    ...]*|
00025220  20 20 fd 20 70 61 74 68  24 20 3c 3e 20 22 22 20  |  . path$ <> "" |
00025230  84 20 68 65 6c 70 5f 66  6f 75 6e 64 25 20 84 20  |. help_found% . |
00025240  61 62 6f 72 74 25 0d 13  5e 05 cc 0d 13 5f 20 20  |abort%..^...._  |
00025250  20 f4 20 52 65 73 46 69  6e 64 20 6e 6f 74 20 62  | . ResFind not b|
00025260  65 69 6e 67 20 75 73 65  64 2e 2e 0d 13 60 22 20  |eing used....`" |
00025270  20 e7 20 a4 73 68 65 6c  6c 5f 46 69 6c 65 45 78  | . .shell_FileEx|
00025280  69 73 74 73 28 70 61 74  68 24 29 20 8c 0d 13 61  |ists(path$) ...a|
00025290  2f 20 20 20 20 f4 20 44  69 72 65 63 74 6f 72 79  |/    . Directory|
000252a0  20 65 78 69 73 74 73 2c  20 63 68 65 63 6b 20 69  | exists, check i|
000252b0  66 20 66 69 6c 65 73 20  64 6f 2e 2e 0d 13 62 38  |f files do....b8|
000252c0  20 20 20 20 e7 20 ac 20  a4 73 68 65 6c 6c 5f 53  |    . . .shell_S|
000252d0  74 72 6f 6e 67 48 6c 70  43 68 6b 46 69 6c 65 73  |trongHlpChkFiles|
000252e0  28 70 61 74 68 24 29 20  8c 20 61 62 6f 72 74 25  |(path$) . abort%|
000252f0  20 3d 20 b9 0d 13 63 07  20 20 cc 0d 13 64 36 20  | = ...c.  ...d6 |
00025300  20 20 20 20 85 20 39 39  2c a4 73 68 65 6c 6c 5f  |    . 99,.shell_|
00025310  4d 65 73 73 61 67 65 4f  6e 65 41 72 67 28 22 53  |MessageOneArg("S|
00025320  48 45 4c 4c 4d 53 47 33  33 22 2c 70 61 74 68 24  |HELLMSG33",path$|
00025330  29 0d 13 65 07 20 20 cd  0d 13 66 05 cd 0d 13 67  |)..e.  ...f....g|
00025340  12 e7 20 61 62 6f 72 74  25 20 3d 20 30 20 8c 0d  |.. abort% = 0 ..|
00025350  13 68 3a 20 20 f2 73 68  65 6c 6c 5f 53 74 72 6f  |.h:  .shell_Stro|
00025360  6e 67 48 6c 70 4d 73 67  28 22 48 65 6c 70 5f 49  |ngHlpMsg("Help_I|
00025370  6e 73 74 61 6c 6c 20 22  20 2b 20 70 61 74 68 24  |nstall " + path$|
00025380  20 2b 20 74 61 69 6c 24  29 0d 13 69 20 20 20 5f  | + tail$)..i   _|
00025390  55 25 21 31 30 30 20 3d  20 5f 55 25 21 31 30 30  |U%!100 = _U%!100|
000253a0  20 84 20 31 20 3c 3c 20  37 0d 13 6a 05 cd 0d 13  | . 1 << 7..j....|
000253b0  6b 05 e1 0d 13 6c 05 3a  0d 13 6d 23 2a 7c 53 74  |k....l.:..m#*|St|
000253c0  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 49 6e 69  |op PROCshell_Ini|
000253d0  74 48 65 6c 70 53 79 73  74 65 6d 0d 13 6e 04 0d  |tHelpSystem..n..|
000253e0  13 6f 1e 2a 7c 53 74 61  72 74 20 50 52 4f 43 73  |.o.*|Start PROCs|
000253f0  68 65 6c 6c 5f 48 65 6c  70 57 6f 72 64 0d 13 70  |hell_HelpWord..p|
00025400  1c dd 20 f2 73 68 65 6c  6c 5f 48 65 6c 70 57 6f  |.. .shell_HelpWo|
00025410  72 64 28 77 6f 72 64 24  29 0d 13 71 17 ea 20 72  |rd(word$)..q.. r|
00025420  65 61 64 25 2c 74 65 6d  70 25 2c 62 75 66 66 25  |ead%,temp%,buff%|
00025430  0d 13 72 24 62 75 66 66  25 3d a4 73 68 65 6c 6c  |..r$buff%=.shell|
00025440  5f 48 65 61 70 42 6c 6f  63 6b 46 65 74 63 68 28  |_HeapBlockFetch(|
00025450  35 31 32 29 0d 13 73 14  e7 20 5f 55 25 21 32 30  |512)..s.. _U%!20|
00025460  38 20 3d 20 2d 31 20 8c  0d 13 74 32 20 20 f4 20  |8 = -1 ...t2  . |
00025470  20 53 74 72 6f 6e 67 48  65 6c 70 20 69 73 20 6e  | StrongHelp is n|
00025480  6f 74 20 6c 6f 61 64 65  64 2e 20 54 72 79 20 74  |ot loaded. Try t|
00025490  6f 20 72 75 6e 20 69 74  2e 2e 0d 13 75 34 20 20  |o run it....u4  |
000254a0  e7 20 a4 73 68 65 6c 6c  5f 4f 53 56 61 72 45 78  |. .shell_OSVarEx|
000254b0  69 73 74 73 28 62 75 66  66 25 2c 22 53 74 72 6f  |ists(buff%,"Stro|
000254c0  6e 67 48 65 6c 70 24 44  69 72 22 29 20 8c 0d 13  |ngHelp$Dir") ...|
000254d0  76 38 20 20 20 20 f4 20  56 61 72 69 61 62 6c 65  |v8    . Variable|
000254e0  20 65 78 69 73 74 73 2c  20 73 6f 20 61 74 74 65  | exists, so atte|
000254f0  6d 70 74 20 74 6f 20 72  75 6e 20 53 74 72 6f 6e  |mpt to run Stron|
00025500  67 48 6c 70 2e 2e 0d 13  77 2f 20 20 20 20 c8 99  |gHlp....w/    ..|
00025510  20 22 58 57 69 6d 70 5f  53 74 61 72 74 54 61 73  | "XWimp_StartTas|
00025520  6b 22 2c 22 3c 53 74 72  6f 6e 67 48 65 6c 70 24  |k","<StrongHelp$|
00025530  44 69 72 3e 22 0d 13 78  36 20 20 20 20 e7 20 5f  |Dir>"..x6    . _|
00025540  55 25 21 32 31 36 3c 3e  30 20 8c 20 f2 73 68 65  |U%!216<>0 . .she|
00025550  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 52 65 74 75  |ll_HeapBlockRetu|
00025560  72 6e 28 5f 55 25 21 32  31 36 29 0d 13 79 2f 20  |rn(_U%!216)..y/ |
00025570  20 20 20 5f 55 25 21 32  31 36 3d a4 73 68 65 6c  |   _U%!216=.shel|
00025580  6c 5f 48 65 61 70 42 6c  6f 63 6b 46 65 74 63 68  |l_HeapBlockFetch|
00025590  28 a9 77 6f 72 64 24 2b  31 29 0d 13 7a 15 20 20  |(.word$+1)..z.  |
000255a0  20 20 74 65 6d 70 25 3d  5f 55 25 21 32 31 36 0d  |  temp%=_U%!216.|
000255b0  13 7b 14 20 20 20 20 24  74 65 6d 70 25 3d 77 6f  |.{.    $temp%=wo|
000255c0  72 64 24 0d 13 7c 07 20  20 cc 0d 13 7d 41 20 20  |rd$..|.  ...}A  |
000255d0  20 20 f4 20 49 74 20 64  6f 65 73 6e 27 74 2c 20  |  . It doesn't, |
000255e0  73 6f 20 63 6f 6d 70 6c  61 69 6e 2c 20 62 75 74  |so complain, but|
000255f0  20 66 69 72 73 74 20 72  65 6c 65 61 73 65 20 62  | first release b|
00025600  75 66 66 65 72 20 61 73  20 61 6e 0d 13 7e 2a 20  |uffer as an..~* |
00025610  20 20 20 f4 20 65 72 72  6f 72 20 69 73 20 61 62  |   . error is ab|
00025620  6f 75 74 20 74 6f 20 62  65 20 67 65 6e 65 72 61  |out to be genera|
00025630  74 65 64 2e 2e 0d 13 7f  25 20 20 20 20 f2 73 68  |ted.....%    .sh|
00025640  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 52 65 74  |ell_HeapBlockRet|
00025650  75 72 6e 28 62 75 66 66  25 29 0d 13 80 35 20 20  |urn(buff%)...5  |
00025660  20 20 f2 73 68 65 6c 6c  5f 4f 4b 28 a4 73 68 65  |  .shell_OK(.she|
00025670  6c 6c 5f 4d 65 73 73 61  67 65 4e 6f 41 72 67 73  |ll_MessageNoArgs|
00025680  28 22 53 48 45 4c 4c 4d  53 47 31 31 22 29 29 0d  |("SHELLMSG11")).|
00025690  13 81 07 20 20 cd 0d 13  82 05 cc 0d 13 83 2d 20  |...  .........- |
000256a0  20 f2 73 68 65 6c 6c 5f  53 74 72 6f 6e 67 48 6c  | .shell_StrongHl|
000256b0  70 4d 73 67 28 22 48 65  6c 70 5f 57 6f 72 64 20  |pMsg("Help_Word |
000256c0  22 2b 77 6f 72 64 24 29  0d 13 84 05 cd 0d 13 85  |"+word$)........|
000256d0  21 f2 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |!.shell_HeapBloc|
000256e0  6b 52 65 74 75 72 6e 28  62 75 66 66 25 29 0d 13  |kReturn(buff%)..|
000256f0  86 05 e1 0d 13 87 05 3a  0d 13 88 1d 2a 7c 53 74  |.......:....*|St|
00025700  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 48 65 6c  |op PROCshell_Hel|
00025710  70 57 6f 72 64 0d 13 89  04 0d 13 8a 22 2a 7c 53  |pWord......."*|S|
00025720  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 53  |tart PROCshell_S|
00025730  74 72 6f 6e 67 48 6c 70  4d 73 67 0d 13 8b 1f dd  |trongHlpMsg.....|
00025740  20 f2 73 68 65 6c 6c 5f  53 74 72 6f 6e 67 48 6c  | .shell_StrongHl|
00025750  70 4d 73 67 28 6d 73 67  24 29 0d 13 8c 28 f2 73  |pMsg(msg$)...(.s|
00025760  68 65 6c 6c 5f 42 72 6f  61 64 63 61 73 74 4d 65  |hell_BroadcastMe|
00025770  73 73 61 67 65 28 26 34  33 42 30 30 2c 6d 73 67  |ssage(&43B00,msg|
00025780  24 29 0d 13 8d 05 e1 0d  13 8e 05 3a 0d 13 8f 21  |$).........:...!|
00025790  2a 7c 53 74 6f 70 20 50  52 4f 43 73 68 65 6c 6c  |*|Stop PROCshell|
000257a0  5f 53 74 72 6f 6e 67 48  6c 70 4d 73 67 0d 13 90  |_StrongHlpMsg...|
000257b0  21 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |!*|Start PROCshe|
000257c0  6c 6c 5f 53 63 61 6e 46  6f 72 48 65 6c 70 0d 13  |ll_ScanForHelp..|
000257d0  91 18 dd 20 f2 73 68 65  6c 6c 5f 53 63 61 6e 46  |... .shell_ScanF|
000257e0  6f 72 48 65 6c 70 0d 13  92 1c ea 20 77 72 6b 25  |orHelp..... wrk%|
000257f0  2c 6f 77 6e 65 72 5f 74  61 73 6b 68 61 6e 64 6c  |,owner_taskhandl|
00025800  65 25 0d 13 93 38 77 72  6b 25 3d a4 73 68 65 6c  |e%...8wrk%=.shel|
00025810  6c 5f 48 65 61 70 42 6c  6f 63 6b 46 65 74 63 68  |l_HeapBlockFetch|
00025820  28 32 35 36 29 3a f4 20  62 6c 6f 63 6b 20 66 6f  |(256):. block fo|
00025830  72 20 6d 65 73 73 61 67  65 73 0d 13 94 32 f4 20  |r messages...2. |
00025840  20 46 69 6e 64 73 20 6f  75 74 20 69 66 20 53 74  | Finds out if St|
00025850  72 6f 6e 67 48 65 6c 70  20 69 73 20 61 6c 72 65  |rongHelp is alre|
00025860  61 64 79 20 72 75 6e 6e  69 6e 67 2e 0d 13 95 41  |ady running....A|
00025870  f4 20 20 44 6f 65 73 20  74 68 69 73 20 62 79 20  |.  Does this by |
00025880  73 63 61 6e 6e 69 6e 67  20 74 68 65 20 74 61 73  |scanning the tas|
00025890  6b 73 20 69 6e 73 74 61  6c 6c 65 64 20 6f 6e 20  |ks installed on |
000258a0  74 68 65 20 69 63 6f 6e  62 61 72 2e 2e 0d 13 96  |the iconbar.....|
000258b0  45 f4 20 20 54 68 69 73  20 61 67 61 69 6e 20 69  |E.  This again i|
000258c0  73 20 64 6f 6e 65 20 62  79 20 67 65 74 74 69 6e  |s done by gettin|
000258d0  67 20 74 68 65 20 74 61  73 6b 27 73 20 68 61 6e  |g the task's han|
000258e0  64 6c 65 2c 20 61 6e 64  20 73 65 6e 64 69 6e 67  |dle, and sending|
000258f0  20 61 0d 13 97 41 f4 20  20 73 65 6e 64 69 6e 67  | a...A.  sending|
00025900  20 61 20 54 61 73 6b 4e  61 6d 65 52 71 20 74 6f  | a TaskNameRq to|
00025910  20 74 68 65 20 74 61 73  6b 68 61 6e 64 6c 65 72  | the taskhandler|
00025920  2e 20 57 68 65 6e 20 74  68 69 73 20 72 65 74 75  |. When this retu|
00025930  72 6e 73 0d 13 98 49 f4  20 20 28 61 73 20 61 20  |rns...I.  (as a |
00025940  54 61 73 6b 4e 61 6d 65  49 73 20 6d 65 73 73 61  |TaskNameIs messa|
00025950  67 65 29 20 77 65 20 63  6f 6d 70 61 72 65 20 74  |ge) we compare t|
00025960  68 65 20 73 74 72 69 6e  67 20 77 69 74 68 20 22  |he string with "|
00025970  53 74 72 6f 6e 67 48 65  6c 70 22 2e 0d 13 99 46  |StrongHelp"....F|
00025980  f4 20 20 49 66 20 6e 6f  74 20 65 71 75 61 6c 2c  |.  If not equal,|
00025990  20 74 68 69 73 20 72 6f  75 74 69 6e 65 20 69 73  | this routine is|
000259a0  20 63 61 6c 6c 65 64 20  61 67 61 69 6e 20 74 6f  | called again to|
000259b0  20 63 68 65 63 6b 20 6e  65 78 74 20 69 63 6f 6e  | check next icon|
000259c0  2e 2e 0d 13 9a 04 0d 13  9b 05 f5 0d 13 9c 48 20  |..............H |
000259d0  20 f4 20 20 54 68 69 73  20 57 69 6d 70 5f 53 65  | .  This Wimp_Se|
000259e0  6e 64 4d 65 73 73 61 67  65 20 64 6f 65 73 20 2a  |ndMessage does *|
000259f0  6e 6f 74 2a 20 73 65 6e  64 20 61 20 6d 65 73 73  |not* send a mess|
00025a00  61 67 65 20 74 6f 20 74  68 65 20 6f 77 6e 65 72  |age to the owner|
00025a10  20 6f 66 0d 13 9d 41 20  20 f4 20 20 74 68 65 20  | of...A  .  the |
00025a20  69 63 6f 6e 2e 20 49 74  20 6d 65 72 65 6c 79 20  |icon. It merely |
00025a30  72 65 74 75 72 6e 73 20  74 68 65 20 74 61 73 6b  |returns the task|
00025a40  68 61 6e 64 6c 65 20 6f  66 20 74 68 65 20 6f 77  |handle of the ow|
00025a50  6e 65 72 2e 0d 13 9e 11  20 20 77 72 6b 25 21 31  |ner.....  wrk%!1|
00025a60  32 20 3d 20 30 0d 13 9f  44 20 20 c8 99 20 22 57  |2 = 0...D  .. "W|
00025a70  69 6d 70 5f 53 65 6e 64  4d 65 73 73 61 67 65 22  |imp_SendMessage"|
00025a80  2c 31 39 2c 77 72 6b 25  2c 2d 32 2c 5f 55 25 21  |,19,wrk%,-2,_U%!|
00025a90  32 31 32 20 b8 20 2c 2c  6f 77 6e 65 72 5f 74 61  |212 . ,,owner_ta|
00025aa0  73 6b 68 61 6e 64 6c 65  25 0d 13 a0 22 20 20 5f  |skhandle%..."  _|
00025ab0  55 25 21 32 31 32 3d 5f  55 25 21 32 31 32 2b 31  |U%!212=_U%!212+1|
00025ac0  3a f4 20 69 63 6f 6e 74  72 79 25 0d 13 a1 2e fd  |:. icontry%.....|
00025ad0  20 6f 77 6e 65 72 5f 74  61 73 6b 68 61 6e 64 6c  | owner_taskhandl|
00025ae0  65 25 20 3c 3e 20 2d 31  20 84 20 28 5f 55 25 21  |e% <> -1 . (_U%!|
00025af0  32 31 32 29 20 3e 20 36  34 0d 13 a2 04 0d 13 a3  |212) > 64.......|
00025b00  1f e7 20 6f 77 6e 65 72  5f 74 61 73 6b 68 61 6e  |.. owner_taskhan|
00025b10  64 6c 65 25 20 3c 3e 20  2d 31 20 8c 0d 13 a4 2b  |dle% <> -1 ....+|
00025b20  20 20 f4 20 53 65 6e 64  20 72 65 71 75 65 73 74  |  . Send request|
00025b30  20 66 6f 72 20 6e 61 6d  65 20 6f 66 20 74 68 69  | for name of thi|
00025b40  73 20 74 61 73 6b 2e 0d  13 a5 12 20 20 77 72 6b  |s task.....  wrk|
00025b50  25 21 30 20 20 3d 20 32  34 0d 13 a6 11 20 20 77  |%!0  = 24....  w|
00025b60  72 6b 25 21 31 32 20 3d  20 30 0d 13 a7 16 20 20  |rk%!12 = 0....  |
00025b70  77 72 6b 25 21 31 36 20  3d 20 26 34 30 30 43 36  |wrk%!16 = &400C6|
00025b80  0d 13 a8 21 20 20 77 72  6b 25 21 32 30 20 3d 20  |...!  wrk%!20 = |
00025b90  6f 77 6e 65 72 5f 74 61  73 6b 68 61 6e 64 6c 65  |owner_taskhandle|
00025ba0  25 0d 13 a9 25 20 20 c8  99 20 22 57 69 6d 70 5f  |%...%  .. "Wimp_|
00025bb0  53 65 6e 64 4d 65 73 73  61 67 65 22 2c 31 37 2c  |SendMessage",17,|
00025bc0  77 72 6b 25 2c 30 0d 13  aa 05 cd 0d 13 ab 20 f2  |wrk%,0........ .|
00025bd0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 52  |shell_HeapBlockR|
00025be0  65 74 75 72 6e 28 77 72  6b 25 29 0d 13 ac 05 e1  |eturn(wrk%).....|
00025bf0  0d 13 ad 05 3a 0d 13 ae  20 2a 7c 53 74 6f 70 20  |....:... *|Stop |
00025c00  50 52 4f 43 73 68 65 6c  6c 5f 53 63 61 6e 46 6f  |PROCshell_ScanFo|
00025c10  72 48 65 6c 70 0d 13 af  04 0d 13 b0 26 2a 7c 53  |rHelp.......&*|S|
00025c20  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 42  |tart PROCshell_B|
00025c30  72 6f 61 64 63 61 73 74  4d 65 73 73 61 67 65 0d  |roadcastMessage.|
00025c40  13 b1 30 dd 20 f2 73 68  65 6c 6c 5f 42 72 6f 61  |..0. .shell_Broa|
00025c50  64 63 61 73 74 4d 65 73  73 61 67 65 28 72 65 61  |dcastMessage(rea|
00025c60  73 6f 6e 5f 63 6f 64 65  25 2c 6d 73 67 24 29 0d  |son_code%,msg$).|
00025c70  13 b2 13 ea 20 6d 5f 62  6c 6b 25 2c 6d 5f 6c 65  |.... m_blk%,m_le|
00025c80  6e 25 0d 13 b3 1f 6d 5f  6c 65 6e 25 20 3d 20 28  |n%....m_len% = (|
00025c90  a9 6d 73 67 24 20 2b 20  33 30 29 20 80 20 ac 20  |.msg$ + 30) . . |
00025ca0  33 0d 13 b4 2a 6d 5f 62  6c 6b 25 20 3d 20 a4 73  |3...*m_blk% = .s|
00025cb0  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 46 65  |hell_HeapBlockFe|
00025cc0  74 63 68 28 6d 5f 6c 65  6e 25 29 0d 13 b5 11 6d  |tch(m_len%)....m|
00025cd0  5f 62 6c 6b 25 21 31 32  20 3d 20 30 0d 13 b6 1c  |_blk%!12 = 0....|
00025ce0  6d 5f 62 6c 6b 25 21 31  36 20 3d 20 72 65 61 73  |m_blk%!16 = reas|
00025cf0  6f 6e 5f 63 6f 64 65 25  0d 13 b7 20 24 28 6d 5f  |on_code%... $(m_|
00025d00  62 6c 6b 25 20 2b 20 32  30 29 20 3d 20 6d 73 67  |blk% + 20) = msg|
00025d10  24 20 2b 20 bd 28 30 29  0d 13 b8 15 6d 5f 62 6c  |$ + .(0)....m_bl|
00025d20  6b 25 21 30 20 3d 20 6d  5f 6c 65 6e 25 0d 13 b9  |k%!0 = m_len%...|
00025d30  49 f4 20 75 73 65 20 58  53 57 49 20 69 6e 20 63  |I. use XSWI in c|
00025d40  61 73 65 20 65 72 72 6f  72 20 6f 63 63 75 72 73  |ase error occurs|
00025d50  20 62 65 74 77 65 65 6e  20 74 72 61 63 65 20 69  | between trace i|
00025d60  6e 69 74 20 63 61 6c 6c  20 61 6e 64 20 77 69 6d  |nit call and wim|
00025d70  70 20 69 6e 69 74 0d 13  ba 44 f4 20 63 61 6c 6c  |p init...D. call|
00025d80  20 2d 20 63 61 6e 27 74  20 62 72 6f 61 64 63 61  | - can't broadca|
00025d90  73 74 20 75 6e 6c 65 73  73 20 77 65 20 68 61 76  |st unless we hav|
00025da0  65 20 6c 61 75 6e 63 68  65 64 20 74 68 65 20 77  |e launched the w|
00025db0  69 6d 70 20 74 61 73 6b  2e 2e 0d 13 bb 3a c8 99  |imp task.....:..|
00025dc0  20 22 58 57 69 6d 70 5f  53 65 6e 64 4d 65 73 73  | "XWimp_SendMess|
00025dd0  61 67 65 22 2c 31 37 2c  6d 5f 62 6c 6b 25 2c 30  |age",17,m_blk%,0|
00025de0  3a f4 20 62 72 6f 61 64  63 61 73 74 20 6d 65 73  |:. broadcast mes|
00025df0  73 61 67 65 0d 13 bc 22  f2 73 68 65 6c 6c 5f 48  |sage...".shell_H|
00025e00  65 61 70 42 6c 6f 63 6b  52 65 74 75 72 6e 28 6d  |eapBlockReturn(m|
00025e10  5f 62 6c 6b 25 29 0d 13  bd 05 e1 0d 13 be 05 3a  |_blk%).........:|
00025e20  0d 13 bf 25 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |...%*|Stop PROCs|
00025e30  68 65 6c 6c 5f 42 72 6f  61 64 63 61 73 74 4d 65  |hell_BroadcastMe|
00025e40  73 73 61 67 65 0d 13 c0  04 0d 13 c1 2a 2a 7c 53  |ssage.......**|S|
00025e50  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 57  |tart PROCshell_W|
00025e60  69 6e 64 6f 77 54 6f 67  67 6c 65 42 61 63 6b 49  |indowToggleBackI|
00025e70  63 6f 6e 0d 13 c2 28 dd  20 f2 73 68 65 6c 6c 5f  |con...(. .shell_|
00025e80  57 69 6e 64 6f 77 54 6f  67 67 6c 65 42 61 63 6b  |WindowToggleBack|
00025e90  49 63 6f 6e 28 f8 20 77  68 25 29 0d 13 c3 27 f2  |Icon(. wh%)...'.|
00025ea0  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 54 6f 67 67  |shell_WindowTogg|
00025eb0  6c 65 46 6c 61 67 73 28  77 68 25 2c 31 3c 3c 32  |leFlags(wh%,1<<2|
00025ec0  34 29 0d 13 c4 05 e1 0d  13 c5 05 3a 0d 13 c6 29  |4).........:...)|
00025ed0  2a 7c 53 74 6f 70 20 50  52 4f 43 73 68 65 6c 6c  |*|Stop PROCshell|
00025ee0  5f 57 69 6e 64 6f 77 54  6f 67 67 6c 65 42 61 63  |_WindowToggleBac|
00025ef0  6b 49 63 6f 6e 0d 13 c7  2b 2a 7c 53 74 61 72 74  |kIcon...+*|Start|
00025f00  20 50 52 4f 43 73 68 65  6c 6c 5f 57 69 6e 64 6f  | PROCshell_Windo|
00025f10  77 54 6f 67 67 6c 65 43  6c 6f 73 65 49 63 6f 6e  |wToggleCloseIcon|
00025f20  0d 13 c8 29 dd 20 f2 73  68 65 6c 6c 5f 57 69 6e  |...). .shell_Win|
00025f30  64 6f 77 54 6f 67 67 6c  65 43 6c 6f 73 65 49 63  |dowToggleCloseIc|
00025f40  6f 6e 28 f8 20 77 68 25  29 0d 13 c9 27 f2 73 68  |on(. wh%)...'.sh|
00025f50  65 6c 6c 5f 57 69 6e 64  6f 77 54 6f 67 67 6c 65  |ell_WindowToggle|
00025f60  46 6c 61 67 73 28 77 68  25 2c 31 3c 3c 32 35 29  |Flags(wh%,1<<25)|
00025f70  0d 13 ca 05 e1 0d 13 cb  05 3a 0d 13 cc 2a 2a 7c  |.........:...**||
00025f80  53 74 6f 70 20 50 52 4f  43 73 68 65 6c 6c 5f 57  |Stop PROCshell_W|
00025f90  69 6e 64 6f 77 54 6f 67  67 6c 65 43 6c 6f 73 65  |indowToggleClose|
00025fa0  49 63 6f 6e 0d 13 cd 2a  2a 7c 53 74 61 72 74 20  |Icon...**|Start |
00025fb0  50 52 4f 43 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |PROCshell_Window|
00025fc0  54 6f 67 67 6c 65 54 69  74 6c 65 42 61 72 0d 13  |ToggleTitleBar..|
00025fd0  ce 28 dd 20 f2 73 68 65  6c 6c 5f 57 69 6e 64 6f  |.(. .shell_Windo|
00025fe0  77 54 6f 67 67 6c 65 54  69 74 6c 65 42 61 72 28  |wToggleTitleBar(|
00025ff0  f8 20 77 68 25 29 0d 13  cf 27 f2 73 68 65 6c 6c  |. wh%)...'.shell|
00026000  5f 57 69 6e 64 6f 77 54  6f 67 67 6c 65 46 6c 61  |_WindowToggleFla|
00026010  67 73 28 77 68 25 2c 31  3c 3c 32 36 29 0d 13 d0  |gs(wh%,1<<26)...|
00026020  05 e1 0d 13 d1 05 3a 0d  13 d2 29 2a 7c 53 74 6f  |......:...)*|Sto|
00026030  70 20 50 52 4f 43 73 68  65 6c 6c 5f 57 69 6e 64  |p PROCshell_Wind|
00026040  6f 77 54 6f 67 67 6c 65  54 69 74 6c 65 42 61 72  |owToggleTitleBar|
00026050  0d 13 d3 2c 2a 7c 53 74  61 72 74 20 50 52 4f 43  |...,*|Start PROC|
00026060  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 54 6f 67 67  |shell_WindowTogg|
00026070  6c 65 54 6f 67 67 6c 65  49 63 6f 6e 0d 13 d4 2a  |leToggleIcon...*|
00026080  dd 20 f2 73 68 65 6c 6c  5f 57 69 6e 64 6f 77 54  |. .shell_WindowT|
00026090  6f 67 67 6c 65 54 6f 67  67 6c 65 49 63 6f 6e 28  |oggleToggleIcon(|
000260a0  f8 20 77 68 25 29 0d 13  d5 27 f2 73 68 65 6c 6c  |. wh%)...'.shell|
000260b0  5f 57 69 6e 64 6f 77 54  6f 67 67 6c 65 46 6c 61  |_WindowToggleFla|
000260c0  67 73 28 77 68 25 2c 31  3c 3c 32 37 29 0d 13 d6  |gs(wh%,1<<27)...|
000260d0  05 e1 0d 13 d7 05 3a 0d  13 d8 2b 2a 7c 53 74 6f  |......:...+*|Sto|
000260e0  70 20 50 52 4f 43 73 68  65 6c 6c 5f 57 69 6e 64  |p PROCshell_Wind|
000260f0  6f 77 54 6f 67 67 6c 65  54 6f 67 67 6c 65 49 63  |owToggleToggleIc|
00026100  6f 6e 0d 13 d9 2c 2a 7c  53 74 61 72 74 20 50 52  |on...,*|Start PR|
00026110  4f 43 73 68 65 6c 6c 5f  57 69 6e 64 6f 77 54 6f  |OCshell_WindowTo|
00026120  67 67 6c 65 48 53 63 72  6f 6c 6c 42 61 72 0d 13  |ggleHScrollBar..|
00026130  da 2a dd 20 f2 73 68 65  6c 6c 5f 57 69 6e 64 6f  |.*. .shell_Windo|
00026140  77 54 6f 67 67 6c 65 48  53 63 72 6f 6c 6c 42 61  |wToggleHScrollBa|
00026150  72 28 f8 20 77 68 25 29  0d 13 db 27 f2 73 68 65  |r(. wh%)...'.she|
00026160  6c 6c 5f 57 69 6e 64 6f  77 54 6f 67 67 6c 65 46  |ll_WindowToggleF|
00026170  6c 61 67 73 28 77 68 25  2c 31 3c 3c 33 30 29 0d  |lags(wh%,1<<30).|
00026180  13 dc 05 e1 0d 13 dd 05  3a 0d 13 de 2b 2a 7c 53  |........:...+*|S|
00026190  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 57 69  |top PROCshell_Wi|
000261a0  6e 64 6f 77 54 6f 67 67  6c 65 48 53 63 72 6f 6c  |ndowToggleHScrol|
000261b0  6c 42 61 72 0d 13 df 30  2a 7c 53 74 61 72 74 20  |lBar...0*|Start |
000261c0  50 52 4f 43 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |PROCshell_Window|
000261d0  54 6f 67 67 6c 65 41 64  6a 75 73 74 53 69 7a 65  |ToggleAdjustSize|
000261e0  49 63 6f 6e 0d 13 e0 2e  dd 20 f2 73 68 65 6c 6c  |Icon..... .shell|
000261f0  5f 57 69 6e 64 6f 77 54  6f 67 67 6c 65 41 64 6a  |_WindowToggleAdj|
00026200  75 73 74 53 69 7a 65 49  63 6f 6e 28 f8 20 77 68  |ustSizeIcon(. wh|
00026210  25 29 0d 13 e1 27 f2 73  68 65 6c 6c 5f 57 69 6e  |%)...'.shell_Win|
00026220  64 6f 77 54 6f 67 67 6c  65 46 6c 61 67 73 28 77  |dowToggleFlags(w|
00026230  68 25 2c 31 3c 3c 32 39  29 0d 13 e2 05 e1 0d 13  |h%,1<<29).......|
00026240  e3 05 3a 0d 13 e4 2f 2a  7c 53 74 6f 70 20 50 52  |..:.../*|Stop PR|
00026250  4f 43 73 68 65 6c 6c 5f  57 69 6e 64 6f 77 54 6f  |OCshell_WindowTo|
00026260  67 67 6c 65 41 64 6a 75  73 74 53 69 7a 65 49 63  |ggleAdjustSizeIc|
00026270  6f 6e 0d 13 e5 2c 2a 7c  53 74 61 72 74 20 50 52  |on...,*|Start PR|
00026280  4f 43 73 68 65 6c 6c 5f  57 69 6e 64 6f 77 54 6f  |OCshell_WindowTo|
00026290  67 67 6c 65 56 53 63 72  6f 6c 6c 42 61 72 0d 13  |ggleVScrollBar..|
000262a0  e6 2a dd 20 f2 73 68 65  6c 6c 5f 57 69 6e 64 6f  |.*. .shell_Windo|
000262b0  77 54 6f 67 67 6c 65 56  53 63 72 6f 6c 6c 42 61  |wToggleVScrollBa|
000262c0  72 28 f8 20 77 68 25 29  0d 13 e7 27 f2 73 68 65  |r(. wh%)...'.she|
000262d0  6c 6c 5f 57 69 6e 64 6f  77 54 6f 67 67 6c 65 46  |ll_WindowToggleF|
000262e0  6c 61 67 73 28 77 68 25  2c 31 3c 3c 32 38 29 0d  |lags(wh%,1<<28).|
000262f0  13 e8 05 e1 0d 13 e9 05  3a 0d 13 ea 2b 2a 7c 53  |........:...+*|S|
00026300  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 57 69  |top PROCshell_Wi|
00026310  6e 64 6f 77 54 6f 67 67  6c 65 56 53 63 72 6f 6c  |ndowToggleVScrol|
00026320  6c 42 61 72 0d 13 eb 04  0d 13 ec 27 2a 7c 53 74  |lBar.......'*|St|
00026330  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 57 69  |art PROCshell_Wi|
00026340  6e 64 6f 77 54 6f 67 67  6c 65 46 6c 61 67 73 0d  |ndowToggleFlags.|
00026350  13 ed 2b dd 20 f2 73 68  65 6c 6c 5f 57 69 6e 64  |..+. .shell_Wind|
00026360  6f 77 54 6f 67 67 6c 65  46 6c 61 67 73 28 f8 20  |owToggleFlags(. |
00026370  77 68 25 2c 6d 61 73 6b  25 29 0d 13 ee 1f ea 20  |wh%,mask%)..... |
00026380  62 6c 6b 25 2c 66 6c 61  67 73 25 2c 6f 70 65 6e  |blk%,flags%,open|
00026390  25 2c 68 61 6e 64 6c 65  25 0d 13 ef 15 2a 7c 69  |%,handle%....*|i|
000263a0  66 64 65 66 20 54 72 61  63 65 49 6e 69 74 0d 13  |fdef TraceInit..|
000263b0  f0 33 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |.3.shell_Tracef0|
000263c0  28 22 57 69 6e 64 6f 77  54 6f 67 67 6c 65 46 6c  |("WindowToggleFl|
000263d0  61 67 73 3a 77 68 25 3d  26 22 2b c3 7e 77 68 25  |ags:wh%=&"+.~wh%|
000263e0  29 0d 13 f1 0b 2a 7c 65  6e 64 69 66 0d 13 f2 22  |)....*|endif..."|
000263f0  6f 70 65 6e 25 3d a4 73  68 65 6c 6c 5f 57 69 6e  |open%=.shell_Win|
00026400  64 6f 77 49 73 4f 70 65  6e 28 77 68 25 29 0d 13  |dowIsOpen(wh%)..|
00026410  f3 49 62 6c 6b 25 3d a4  73 68 65 6c 6c 5f 48 65  |.Iblk%=.shell_He|
00026420  61 70 42 6c 6f 63 6b 46  65 74 63 68 28 31 30 30  |apBlockFetch(100|
00026430  20 2b 20 28 a4 73 68 65  6c 6c 5f 57 69 6e 64 6f  | + (.shell_Windo|
00026440  77 43 6f 75 6e 74 49 63  6f 6e 73 28 77 68 25 29  |wCountIcons(wh%)|
00026450  20 2a 20 33 32 29 29 0d  13 f4 0e 62 6c 6b 25 21  | * 32))....blk%!|
00026460  30 3d 77 68 25 0d 13 f5  21 c8 99 20 22 57 69 6d  |0=wh%...!.. "Wim|
00026470  70 5f 47 65 74 57 69 6e  64 6f 77 49 6e 66 6f 22  |p_GetWindowInfo"|
00026480  2c 2c 62 6c 6b 25 0d 13  f6 12 66 6c 61 67 73 25  |,,blk%....flags%|
00026490  3d 62 6c 6b 25 21 33 32  0d 13 f7 1b 66 6c 61 67  |=blk%!32....flag|
000264a0  73 25 3d 28 66 6c 61 67  73 25 20 82 20 6d 61 73  |s%=(flags% . mas|
000264b0  6b 25 29 0d 13 f8 12 62  6c 6b 25 21 33 32 3d 66  |k%)....blk%!32=f|
000264c0  6c 61 67 73 25 0d 13 f9  20 c8 99 20 22 57 69 6d  |lags%... .. "Wim|
000264d0  70 5f 44 65 6c 65 74 65  57 69 6e 64 6f 77 22 2c  |p_DeleteWindow",|
000264e0  2c 62 6c 6b 25 0d 13 fa  2c c8 99 20 22 57 69 6d  |,blk%...,.. "Wim|
000264f0  70 5f 43 72 65 61 74 65  57 69 6e 64 6f 77 22 2c  |p_CreateWindow",|
00026500  2c 62 6c 6b 25 2b 34 20  b8 20 68 61 6e 64 6c 65  |,blk%+4 . handle|
00026510  25 0d 13 fb 11 21 62 6c  6b 25 3d 68 61 6e 64 6c  |%....!blk%=handl|
00026520  65 25 0d 13 fc 0d e7 20  6f 70 65 6e 25 20 8c 0d  |e%..... open% ..|
00026530  13 fd 2b 20 20 f4 20 49  66 20 77 69 6e 64 6f 77  |..+  . If window|
00026540  20 77 61 73 20 6f 70 65  6e 2c 20 6f 70 65 6e 20  | was open, open |
00026550  69 74 20 61 67 61 69 6e  2e 2e 0d 13 fe 20 20 20  |it again.....   |
00026560  c8 99 20 22 57 69 6d 70  5f 4f 70 65 6e 57 69 6e  |.. "Wimp_OpenWin|
00026570  64 6f 77 22 2c 2c 62 6c  6b 25 0d 13 ff 05 cd 0d  |dow",,blk%......|
00026580  14 00 20 f2 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |.. .shell_HeapBl|
00026590  6f 63 6b 52 65 74 75 72  6e 28 62 6c 6b 25 29 0d  |ockReturn(blk%).|
000265a0  14 01 14 e7 20 68 61 6e  64 6c 65 25 3c 3e 77 68  |.... handle%<>wh|
000265b0  25 20 8c 0d 14 02 2c 20  20 f2 73 68 65 6c 6c 5f  |% ....,  .shell_|
000265c0  55 70 64 61 74 65 57 69  6e 64 6f 77 48 61 6e 64  |UpdateWindowHand|
000265d0  6c 65 28 77 68 25 2c 68  61 6e 64 6c 65 25 29 0d  |le(wh%,handle%).|
000265e0  14 03 11 20 20 77 68 25  3d 68 61 6e 64 6c 65 25  |...  wh%=handle%|
000265f0  0d 14 04 05 cd 0d 14 05  05 e1 0d 14 06 05 3a 0d  |..............:.|
00026600  14 07 26 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |..&*|Stop PROCsh|
00026610  65 6c 6c 5f 57 69 6e 64  6f 77 54 6f 67 67 6c 65  |ell_WindowToggle|
00026620  46 6c 61 67 73 0d 14 08  04 0d 14 09 25 2a 7c 53  |Flags.......%*|S|
00026630  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 4c  |tart PROCshell_L|
00026640  69 73 74 43 6c 69 63 6b  53 65 6c 65 63 74 0d 14  |istClickSelect..|
00026650  0a 1c dd 20 f2 73 68 65  6c 6c 5f 4c 69 73 74 43  |... .shell_ListC|
00026660  6c 69 63 6b 53 65 6c 65  63 74 0d 14 0b 2a ea 20  |lickSelect...*. |
00026670  65 5f 6c 69 73 74 25 2c  70 74 72 25 2c 6c 69 73  |e_list%,ptr%,lis|
00026680  74 5f 73 69 7a 65 25 2c  74 65 6d 70 25 2c 74 65  |t_size%,temp%,te|
00026690  6d 70 32 25 0d 14 0c 12  65 5f 6c 69 73 74 25 3d  |mp2%....e_list%=|
000266a0  5f 55 25 21 31 32 0d 14  0d 2c 6c 69 73 74 5f 73  |_U%!12...,list_s|
000266b0  69 7a 65 25 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |ize%=.shell_Heap|
000266c0  42 6c 6f 63 6b 49 6e 66  6f 28 65 5f 6c 69 73 74  |BlockInfo(e_list|
000266d0  25 29 0d 14 0e 15 2a 7c  69 66 64 65 66 20 54 72  |%)....*|ifdef Tr|
000266e0  61 63 65 49 6e 69 74 0d  14 0f 17 f2 73 68 65 6c  |aceInit.....shel|
000266f0  6c 5f 54 72 61 63 65 66  30 28 22 20 22 29 0d 14  |l_Tracef0(" ")..|
00026700  10 31 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |.1.shell_Tracef0|
00026710  28 22 4c 69 73 74 20 6f  66 20 43 6c 69 63 6b 53  |("List of ClickS|
00026720  65 6c 65 63 74 20 65 76  65 6e 74 73 3a 22 29 0d  |elect events:").|
00026730  14 11 0b 2a 7c 65 6e 64  69 66 0d 14 12 0a 70 74  |...*|endif....pt|
00026740  72 25 3d 30 0d 14 13 05  f5 0d 14 14 31 20 20 74  |r%=0........1  t|
00026750  65 6d 70 25 3d 65 5f 6c  69 73 74 25 21 28 70 74  |emp%=e_list%!(pt|
00026760  72 25 2b 32 30 29 3a 74  65 6d 70 32 25 3d 65 5f  |r%+20):temp2%=e_|
00026770  6c 69 73 74 25 2b 70 74  72 25 0d 14 15 27 20 20  |list%+ptr%...'  |
00026780  e7 20 a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |. .shell_HeapBlo|
00026790  63 6b 45 78 69 73 74 73  28 74 65 6d 70 25 29 20  |ckExists(temp%) |
000267a0  8c 0d 14 16 16 20 20 20  20 e7 20 24 74 65 6d 70  |.....    . $temp|
000267b0  25 3c 3e 22 22 20 8c 0d  14 17 15 2a 7c 69 66 64  |%<>"" .....*|ifd|
000267c0  65 66 20 54 72 61 63 65  49 6e 69 74 0d 14 18 81  |ef TraceInit....|
000267d0  20 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |  .shell_Tracef0|
000267e0  28 22 26 22 2b a4 73 68  65 6c 6c 5f 53 74 72 69  |("&"+.shell_Stri|
000267f0  6e 67 50 61 64 54 72 61  69 6c 69 6e 67 28 c3 7e  |ngPadTrailing(.~|
00026800  74 65 6d 70 32 25 21 30  2c 22 20 22 2c 38 29 2b  |temp2%!0," ",8)+|
00026810  22 20 26 22 2b a4 73 68  65 6c 6c 5f 53 74 72 69  |" &"+.shell_Stri|
00026820  6e 67 50 61 64 54 72 61  69 6c 69 6e 67 28 c3 7e  |ngPadTrailing(.~|
00026830  74 65 6d 70 32 25 21 34  2c 22 20 22 2c 38 29 2b  |temp2%!4," ",8)+|
00026840  22 20 20 20 22 2b 24 74  65 6d 70 25 29 0d 14 19  |"   "+$temp%)...|
00026850  0b 2a 7c 65 6e 64 69 66  0d 14 1a 09 20 20 20 20  |.*|endif....    |
00026860  cd 0d 14 1b 07 20 20 cd  0d 14 1c 0e 20 20 70 74  |.....  .....  pt|
00026870  72 25 2b 3d 34 38 0d 14  1d 18 fd 20 28 70 74 72  |r%+=48..... (ptr|
00026880  25 3e 3d 6c 69 73 74 5f  73 69 7a 65 25 29 0d 14  |%>=list_size%)..|
00026890  1e 15 2a 7c 69 66 64 65  66 20 54 72 61 63 65 49  |..*|ifdef TraceI|
000268a0  6e 69 74 0d 14 1f 17 f2  73 68 65 6c 6c 5f 54 72  |nit.....shell_Tr|
000268b0  61 63 65 66 30 28 22 20  22 29 0d 14 20 0b 2a 7c  |acef0(" ").. .*||
000268c0  65 6e 64 69 66 0d 14 21  05 e1 0d 14 22 05 3a 0d  |endif..!....".:.|
000268d0  14 23 24 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |.#$*|Stop PROCsh|
000268e0  65 6c 6c 5f 4c 69 73 74  43 6c 69 63 6b 53 65 6c  |ell_ListClickSel|
000268f0  65 63 74 0d 14 24 25 2a  7c 53 74 61 72 74 20 50  |ect..$%*|Start P|
00026900  52 4f 43 73 68 65 6c 6c  5f 4c 69 73 74 43 6c 69  |ROCshell_ListCli|
00026910  63 6b 41 64 6a 75 73 74  0d 14 25 1c dd 20 f2 73  |ckAdjust..%.. .s|
00026920  68 65 6c 6c 5f 4c 69 73  74 43 6c 69 63 6b 41 64  |hell_ListClickAd|
00026930  6a 75 73 74 0d 14 26 2a  ea 20 65 5f 6c 69 73 74  |just..&*. e_list|
00026940  25 2c 70 74 72 25 2c 6c  69 73 74 5f 73 69 7a 65  |%,ptr%,list_size|
00026950  25 2c 74 65 6d 70 25 2c  74 65 6d 70 32 25 0d 14  |%,temp%,temp2%..|
00026960  27 12 65 5f 6c 69 73 74  25 3d 5f 55 25 21 31 32  |'.e_list%=_U%!12|
00026970  0d 14 28 2c 6c 69 73 74  5f 73 69 7a 65 25 3d a4  |..(,list_size%=.|
00026980  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 49  |shell_HeapBlockI|
00026990  6e 66 6f 28 65 5f 6c 69  73 74 25 29 0d 14 29 15  |nfo(e_list%)..).|
000269a0  2a 7c 69 66 64 65 66 20  54 72 61 63 65 49 6e 69  |*|ifdef TraceIni|
000269b0  74 0d 14 2a 17 f2 73 68  65 6c 6c 5f 54 72 61 63  |t..*..shell_Trac|
000269c0  65 66 30 28 22 20 22 29  0d 14 2b 31 f2 73 68 65  |ef0(" ")..+1.she|
000269d0  6c 6c 5f 54 72 61 63 65  66 30 28 22 4c 69 73 74  |ll_Tracef0("List|
000269e0  20 6f 66 20 43 6c 69 63  6b 41 64 6a 75 73 74 20  | of ClickAdjust |
000269f0  65 76 65 6e 74 73 3a 22  29 0d 14 2c 0b 2a 7c 65  |events:")..,.*|e|
00026a00  6e 64 69 66 0d 14 2d 0a  70 74 72 25 3d 30 0d 14  |ndif..-.ptr%=0..|
00026a10  2e 05 f5 0d 14 2f 31 20  20 74 65 6d 70 25 3d 65  |...../1  temp%=e|
00026a20  5f 6c 69 73 74 25 21 28  70 74 72 25 2b 32 34 29  |_list%!(ptr%+24)|
00026a30  3a 74 65 6d 70 32 25 3d  65 5f 6c 69 73 74 25 2b  |:temp2%=e_list%+|
00026a40  70 74 72 25 0d 14 30 27  20 20 e7 20 a4 73 68 65  |ptr%..0'  . .she|
00026a50  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 45 78 69 73  |ll_HeapBlockExis|
00026a60  74 73 28 74 65 6d 70 25  29 20 8c 0d 14 31 16 20  |ts(temp%) ...1. |
00026a70  20 20 20 e7 20 24 74 65  6d 70 25 3c 3e 22 22 20  |   . $temp%<>"" |
00026a80  8c 0d 14 32 15 2a 7c 69  66 64 65 66 20 54 72 61  |...2.*|ifdef Tra|
00026a90  63 65 49 6e 69 74 0d 14  33 81 20 20 f2 73 68 65  |ceInit..3.  .she|
00026aa0  6c 6c 5f 54 72 61 63 65  66 30 28 22 26 22 2b a4  |ll_Tracef0("&"+.|
00026ab0  73 68 65 6c 6c 5f 53 74  72 69 6e 67 50 61 64 54  |shell_StringPadT|
00026ac0  72 61 69 6c 69 6e 67 28  c3 7e 74 65 6d 70 32 25  |railing(.~temp2%|
00026ad0  21 30 2c 22 20 22 2c 38  29 2b 22 20 26 22 2b a4  |!0," ",8)+" &"+.|
00026ae0  73 68 65 6c 6c 5f 53 74  72 69 6e 67 50 61 64 54  |shell_StringPadT|
00026af0  72 61 69 6c 69 6e 67 28  c3 7e 74 65 6d 70 32 25  |railing(.~temp2%|
00026b00  21 34 2c 22 20 22 2c 38  29 2b 22 20 20 20 22 2b  |!4," ",8)+"   "+|
00026b10  24 74 65 6d 70 25 29 0d  14 34 0b 2a 7c 65 6e 64  |$temp%)..4.*|end|
00026b20  69 66 0d 14 35 09 20 20  20 20 cd 0d 14 36 07 20  |if..5.    ...6. |
00026b30  20 cd 0d 14 37 0e 20 20  70 74 72 25 2b 3d 34 38  | ...7.  ptr%+=48|
00026b40  0d 14 38 18 fd 20 28 70  74 72 25 3e 3d 6c 69 73  |..8.. (ptr%>=lis|
00026b50  74 5f 73 69 7a 65 25 29  0d 14 39 15 2a 7c 69 66  |t_size%)..9.*|if|
00026b60  64 65 66 20 54 72 61 63  65 49 6e 69 74 0d 14 3a  |def TraceInit..:|
00026b70  17 f2 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  |..shell_Tracef0(|
00026b80  22 20 22 29 0d 14 3b 0b  2a 7c 65 6e 64 69 66 0d  |" ")..;.*|endif.|
00026b90  14 3c 05 e1 0d 14 3d 05  3a 0d 14 3e 24 2a 7c 53  |.<....=.:..>$*|S|
00026ba0  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 4c 69  |top PROCshell_Li|
00026bb0  73 74 43 6c 69 63 6b 41  64 6a 75 73 74 0d 14 3f  |stClickAdjust..?|
00026bc0  22 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |"*|Start PROCshe|
00026bd0  6c 6c 5f 4c 69 73 74 48  65 6c 70 54 61 67 73 0d  |ll_ListHelpTags.|
00026be0  14 40 19 dd 20 f2 73 68  65 6c 6c 5f 4c 69 73 74  |.@.. .shell_List|
00026bf0  48 65 6c 70 54 61 67 73  0d 14 41 2a ea 20 65 5f  |HelpTags..A*. e_|
00026c00  6c 69 73 74 25 2c 70 74  72 25 2c 6c 69 73 74 5f  |list%,ptr%,list_|
00026c10  73 69 7a 65 25 2c 74 65  6d 70 25 2c 74 65 6d 70  |size%,temp%,temp|
00026c20  32 25 0d 14 42 12 65 5f  6c 69 73 74 25 3d 5f 55  |2%..B.e_list%=_U|
00026c30  25 21 31 32 0d 14 43 2c  6c 69 73 74 5f 73 69 7a  |%!12..C,list_siz|
00026c40  65 25 3d a4 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |e%=.shell_HeapBl|
00026c50  6f 63 6b 49 6e 66 6f 28  65 5f 6c 69 73 74 25 29  |ockInfo(e_list%)|
00026c60  0d 14 44 15 2a 7c 69 66  64 65 66 20 54 72 61 63  |..D.*|ifdef Trac|
00026c70  65 49 6e 69 74 0d 14 45  17 f2 73 68 65 6c 6c 5f  |eInit..E..shell_|
00026c80  54 72 61 63 65 66 30 28  22 20 22 29 0d 14 46 31  |Tracef0(" ")..F1|
00026c90  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
00026ca0  4c 69 73 74 20 6f 66 20  61 74 74 61 63 68 65 64  |List of attached|
00026cb0  20 68 65 6c 70 20 74 61  67 73 3a 22 29 0d 14 47  | help tags:")..G|
00026cc0  0b 2a 7c 65 6e 64 69 66  0d 14 48 0a 70 74 72 25  |.*|endif..H.ptr%|
00026cd0  3d 30 0d 14 49 05 f5 0d  14 4a 31 20 20 74 65 6d  |=0..I....J1  tem|
00026ce0  70 25 3d 65 5f 6c 69 73  74 25 21 28 70 74 72 25  |p%=e_list%!(ptr%|
00026cf0  2b 34 34 29 3a 74 65 6d  70 32 25 3d 65 5f 6c 69  |+44):temp2%=e_li|
00026d00  73 74 25 2b 70 74 72 25  0d 14 4b 27 20 20 e7 20  |st%+ptr%..K'  . |
00026d10  a4 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
00026d20  45 78 69 73 74 73 28 74  65 6d 70 25 29 20 8c 0d  |Exists(temp%) ..|
00026d30  14 4c 16 20 20 20 20 e7  20 24 74 65 6d 70 25 3c  |.L.    . $temp%<|
00026d40  3e 22 22 20 8c 0d 14 4d  15 2a 7c 69 66 64 65 66  |>"" ...M.*|ifdef|
00026d50  20 54 72 61 63 65 49 6e  69 74 0d 14 4e 81 20 20  | TraceInit..N.  |
00026d60  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
00026d70  26 22 2b a4 73 68 65 6c  6c 5f 53 74 72 69 6e 67  |&"+.shell_String|
00026d80  50 61 64 54 72 61 69 6c  69 6e 67 28 c3 7e 74 65  |PadTrailing(.~te|
00026d90  6d 70 32 25 21 30 2c 22  20 22 2c 38 29 2b 22 20  |mp2%!0," ",8)+" |
00026da0  26 22 2b a4 73 68 65 6c  6c 5f 53 74 72 69 6e 67  |&"+.shell_String|
00026db0  50 61 64 54 72 61 69 6c  69 6e 67 28 c3 7e 74 65  |PadTrailing(.~te|
00026dc0  6d 70 32 25 21 34 2c 22  20 22 2c 38 29 2b 22 20  |mp2%!4," ",8)+" |
00026dd0  20 20 22 2b 24 74 65 6d  70 25 29 0d 14 4f 0b 2a  |  "+$temp%)..O.*|
00026de0  7c 65 6e 64 69 66 0d 14  50 09 20 20 20 20 cd 0d  ||endif..P.    ..|
00026df0  14 51 07 20 20 cd 0d 14  52 0e 20 20 70 74 72 25  |.Q.  ...R.  ptr%|
00026e00  2b 3d 34 38 0d 14 53 18  fd 20 28 70 74 72 25 3e  |+=48..S.. (ptr%>|
00026e10  3d 6c 69 73 74 5f 73 69  7a 65 25 29 0d 14 54 15  |=list_size%)..T.|
00026e20  2a 7c 69 66 64 65 66 20  54 72 61 63 65 49 6e 69  |*|ifdef TraceIni|
00026e30  74 0d 14 55 17 f2 73 68  65 6c 6c 5f 54 72 61 63  |t..U..shell_Trac|
00026e40  65 66 30 28 22 20 22 29  0d 14 56 0b 2a 7c 65 6e  |ef0(" ")..V.*|en|
00026e50  64 69 66 0d 14 57 05 e1  0d 14 58 05 3a 0d 14 59  |dif..W....X.:..Y|
00026e60  21 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  |!*|Stop PROCshel|
00026e70  6c 5f 4c 69 73 74 48 65  6c 70 54 61 67 73 0d 14  |l_ListHelpTags..|
00026e80  5a 1d 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |Z.*|Start PROCsh|
00026e90  65 6c 6c 5f 4d 65 6d 46  69 6c 6c 0d 14 5b 2d dd  |ell_MemFill..[-.|
00026ea0  20 f2 73 68 65 6c 6c 5f  4d 65 6d 46 69 6c 6c 28  | .shell_MemFill(|
00026eb0  73 74 61 72 74 25 2c 6e  72 5f 62 79 74 65 73 25  |start%,nr_bytes%|
00026ec0  2c 76 61 6c 75 65 25 29  0d 14 5c 1d ea 20 49 25  |,value%)..\.. I%|
00026ed0  2c 6e 72 5f 77 6f 72 64  73 25 2c 72 65 6d 61 69  |,nr_words%,remai|
00026ee0  6e 64 65 72 25 0d 14 5d  1b 6e 72 5f 77 6f 72 64  |nder%..].nr_word|
00026ef0  73 25 3d 6e 72 5f 62 79  74 65 73 25 20 81 20 34  |s%=nr_bytes% . 4|
00026f00  0d 14 5e 1c 72 65 6d 61  69 6e 64 65 72 25 3d 6e  |..^.remainder%=n|
00026f10  72 5f 62 79 74 65 73 25  20 83 20 34 0d 14 5f 13  |r_bytes% . 4.._.|
00026f20  e7 20 6e 72 5f 77 6f 72  64 73 25 3e 30 20 8c 0d  |. nr_words%>0 ..|
00026f30  14 60 20 20 20 e3 20 49  25 3d 31 20 b8 20 28 6e  |.`   . I%=1 . (n|
00026f40  72 5f 77 6f 72 64 73 25  2a 34 29 20 88 20 34 0d  |r_words%*4) . 4.|
00026f50  14 61 1c 20 20 20 20 73  74 61 72 74 25 21 28 49  |.a.    start%!(I|
00026f60  25 2d 31 29 3d 76 61 6c  75 65 25 0d 14 62 0a 20  |%-1)=value%..b. |
00026f70  20 ed 20 49 25 0d 14 63  05 cd 0d 14 64 14 e7 20  | . I%..c....d.. |
00026f80  72 65 6d 61 69 6e 64 65  72 25 3e 30 20 8c 0d 14  |remainder%>0 ...|
00026f90  65 21 20 20 73 74 61 72  74 25 3d 73 74 61 72 74  |e!  start%=start|
00026fa0  25 2b 28 6e 72 5f 77 6f  72 64 73 25 2a 34 29 0d  |%+(nr_words%*4).|
00026fb0  14 66 1b 20 20 e3 20 49  25 3d 30 20 b8 20 72 65  |.f.  . I%=0 . re|
00026fc0  6d 61 69 6e 64 65 72 25  2d 31 0d 14 67 18 20 20  |mainder%-1..g.  |
00026fd0  20 20 73 74 61 72 74 25  3f 49 25 3d 76 61 6c 75  |  start%?I%=valu|
00026fe0  65 25 0d 14 68 0a 20 20  ed 20 49 25 0d 14 69 05  |e%..h.  . I%..i.|
00026ff0  cd 0d 14 6a 05 e1 0d 14  6b 05 3a 0d 14 6c 1c 2a  |...j....k.:..l.*|
00027000  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
00027010  4d 65 6d 46 69 6c 6c 0d  14 6d 04 0d 14 6e 24 2a  |MemFill..m...n$*|
00027020  7c 53 74 61 72 74 20 50  52 4f 43 73 68 65 6c 6c  ||Start PROCshell|
00027030  5f 41 74 74 61 63 68 46  6f 6e 74 4d 65 6e 75 0d  |_AttachFontMenu.|
00027040  14 6f 1b 2a 7c 44 65 66  69 6e 65 20 55 73 69 6e  |.o.*|Define Usin|
00027050  67 5f 46 6f 6e 74 4d 65  6e 75 0d 14 70 36 dd 20  |g_FontMenu..p6. |
00027060  f2 73 68 65 6c 6c 5f 41  74 74 61 63 68 46 6f 6e  |.shell_AttachFon|
00027070  74 4d 65 6e 75 28 77 68  25 2c 69 68 25 2c 73 65  |tMenu(wh%,ih%,se|
00027080  6c 5f 66 6e 24 2c 6d 61  6b 65 72 5f 66 6e 24 29  |l_fn$,maker_fn$)|
00027090  0d 14 71 0b ea 20 6d 65  6e 75 25 0d 14 72 17 f2  |..q.. menu%..r..|
000270a0  73 68 65 6c 6c 5f 46 6f  6e 74 4d 65 6e 75 49 6e  |shell_FontMenuIn|
000270b0  69 74 0d 14 73 2f c8 99  20 22 46 6f 6e 74 4d 65  |it..s/.. "FontMe|
000270c0  6e 75 5f 53 65 6c 65 63  74 22 2c 22 22 2b bd 30  |nu_Select",""+.0|
000270d0  2c 5f 55 25 21 32 36 30  20 b8 20 2c 6d 65 6e 75  |,_U%!260 . ,menu|
000270e0  25 0d 14 74 26 f4 20 53  74 6f 72 65 20 6d 65 6e  |%..t&. Store men|
000270f0  75 20 70 74 72 20 69 6e  20 73 68 65 6c 6c 20 6d  |u ptr in shell m|
00027100  65 6d 6f 72 79 2e 2e 0d  14 75 11 5f 55 25 21 32  |emory....u._U%!2|
00027110  35 32 3d 6d 65 6e 75 25  0d 14 76 29 f2 73 68 65  |52=menu%..v).she|
00027120  6c 6c 5f 45 76 65 6e 74  41 64 64 28 77 68 25 2c  |ll_EventAdd(wh%,|
00027130  69 68 25 2c 30 2c 2d 32  2c 73 65 6c 5f 66 6e 24  |ih%,0,-2,sel_fn$|
00027140  29 0d 14 77 1f 2a 7c 69  66 64 65 66 20 50 52 4f  |)..w.*|ifdef PRO|
00027150  43 73 68 65 6c 6c 5f 54  72 61 63 65 49 6e 69 74  |Cshell_TraceInit|
00027160  0d 14 78 38 f2 73 68 65  6c 6c 5f 54 72 61 63 65  |..x8.shell_Trace|
00027170  66 30 28 22 41 74 74 61  63 68 46 6f 6e 74 4d 65  |f0("AttachFontMe|
00027180  6e 75 3a 41 74 74 61 63  68 69 6e 67 20 66 6f 6e  |nu:Attaching fon|
00027190  74 20 6d 65 6e 75 22 29  0d 14 79 0b 2a 7c 65 6e  |t menu")..y.*|en|
000271a0  64 69 66 0d 14 7a 3f e7  20 6d 61 6b 65 72 5f 66  |dif..z?. maker_f|
000271b0  6e 24 3c 3e 22 22 20 8c  20 f2 73 68 65 6c 6c 5f  |n$<>"" . .shell_|
000271c0  41 74 74 61 63 68 4d 65  6e 75 4d 61 6b 65 72 28  |AttachMenuMaker(|
000271d0  77 68 25 2c 69 68 25 2c  6d 61 6b 65 72 5f 66 6e  |wh%,ih%,maker_fn|
000271e0  24 29 0d 14 7b 05 e1 0d  14 7c 05 3a 0d 14 7d 23  |$)..{....|.:..}#|
000271f0  2a 7c 53 74 6f 70 20 50  52 4f 43 73 68 65 6c 6c  |*|Stop PROCshell|
00027200  5f 41 74 74 61 63 68 46  6f 6e 74 4d 65 6e 75 0d  |_AttachFontMenu.|
00027210  14 7e 04 0d 14 7f 27 2a  7c 53 74 61 72 74 20 50  |.~....'*|Start P|
00027220  52 4f 43 73 68 65 6c 6c  5f 41 74 74 61 63 68 46  |ROCshell_AttachF|
00027230  6f 6e 74 53 75 62 4d 65  6e 75 0d 14 80 1b 2a 7c  |ontSubMenu....*||
00027240  44 65 66 69 6e 65 20 55  73 69 6e 67 5f 46 6f 6e  |Define Using_Fon|
00027250  74 4d 65 6e 75 0d 14 81  36 dd 20 f2 73 68 65 6c  |tMenu...6. .shel|
00027260  6c 5f 41 74 74 61 63 68  46 6f 6e 74 53 75 62 4d  |l_AttachFontSubM|
00027270  65 6e 75 28 69 74 65 6d  25 2c 77 61 72 6e 5f 66  |enu(item%,warn_f|
00027280  6e 24 2c 73 65 6c 5f 66  6e 24 29 0d 14 82 21 ea  |n$,sel_fn$)...!.|
00027290  20 69 74 65 6d 73 74 61  72 74 25 2c 6d 65 6e 75  | itemstart%,menu|
000272a0  25 2c 74 65 6d 70 25 2c  63 74 72 25 0d 14 83 17  |%,temp%,ctr%....|
000272b0  f2 73 68 65 6c 6c 5f 46  6f 6e 74 4d 65 6e 75 49  |.shell_FontMenuI|
000272c0  6e 69 74 0d 14 84 2f c8  99 20 22 46 6f 6e 74 4d  |nit.../.. "FontM|
000272d0  65 6e 75 5f 53 65 6c 65  63 74 22 2c 22 22 2b bd  |enu_Select",""+.|
000272e0  30 2c 5f 55 25 21 32 36  30 20 b8 20 2c 6d 65 6e  |0,_U%!260 . ,men|
000272f0  75 25 0d 14 85 25 c8 99  20 22 4d 65 6e 75 55 74  |u%...%.. "MenuUt|
00027300  69 6c 5f 53 75 62 4d 65  6e 75 22 2c 69 74 65 6d  |il_SubMenu",item|
00027310  25 2c 6d 65 6e 75 25 0d  14 86 1c c8 99 20 22 4d  |%,menu%...... "M|
00027320  65 6e 75 55 74 69 6c 5f  57 61 72 6e 69 6e 67 22  |enuUtil_Warning"|
00027330  2c 2c b9 0d 14 87 26 f4  20 53 74 6f 72 65 20 6d  |,,....&. Store m|
00027340  65 6e 75 20 70 74 72 20  69 6e 20 73 68 65 6c 6c  |enu ptr in shell|
00027350  20 6d 65 6d 6f 72 79 2e  2e 0d 14 88 11 5f 55 25  | memory......_U%|
00027360  21 32 35 32 3d 6d 65 6e  75 25 0d 14 89 3a f2 73  |!252=menu%...:.s|
00027370  68 65 6c 6c 5f 45 76 65  6e 74 4c 69 73 74 4d 65  |hell_EventListMe|
00027380  6e 75 57 61 72 6e 28 69  74 65 6d 25 2c 6d 65 6e  |nuWarn(item%,men|
00027390  75 25 2c 77 61 72 6e 5f  66 6e 24 2c 73 65 6c 5f  |u%,warn_fn$,sel_|
000273a0  66 6e 24 29 0d 14 8a 1f  2a 7c 69 66 64 65 66 20  |fn$)....*|ifdef |
000273b0  50 52 4f 43 73 68 65 6c  6c 5f 54 72 61 63 65 49  |PROCshell_TraceI|
000273c0  6e 69 74 0d 14 8b 45 f2  73 68 65 6c 6c 5f 54 72  |nit...E.shell_Tr|
000273d0  61 63 65 66 30 28 22 41  74 74 61 63 68 46 6f 6e  |acef0("AttachFon|
000273e0  74 53 75 62 4d 65 6e 75  3a 41 74 74 61 63 68 69  |tSubMenu:Attachi|
000273f0  6e 67 20 66 6f 6e 74 20  6d 65 6e 75 20 26 22 2b  |ng font menu &"+|
00027400  c3 7e 6d 65 6e 75 25 29  0d 14 8c 0b 2a 7c 65 6e  |.~menu%)....*|en|
00027410  64 69 66 0d 14 8d 05 e1  0d 14 8e 05 3a 0d 14 8f  |dif.........:...|
00027420  26 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  |&*|Stop PROCshel|
00027430  6c 5f 41 74 74 61 63 68  46 6f 6e 74 53 75 62 4d  |l_AttachFontSubM|
00027440  65 6e 75 0d 14 90 04 0d  14 91 22 2a 7c 53 74 61  |enu......."*|Sta|
00027450  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 46 6f 6e  |rt PROCshell_Fon|
00027460  74 4d 65 6e 75 49 6e 69  74 0d 14 92 19 dd 20 f2  |tMenuInit..... .|
00027470  73 68 65 6c 6c 5f 46 6f  6e 74 4d 65 6e 75 49 6e  |shell_FontMenuIn|
00027480  69 74 0d 14 93 40 ff 20  28 22 52 4d 45 6e 73 75  |it...@. ("RMEnsu|
00027490  72 65 20 46 6f 6e 74 4d  65 6e 75 20 31 2e 31 36  |re FontMenu 1.16|
000274a0  20 52 4d 4c 6f 61 64 20  3c 45 76 6e 74 53 68 65  | RMLoad <EvntShe|
000274b0  6c 6c 24 50 61 74 68 3e  46 6f 6e 74 4d 65 6e 75  |ll$Path>FontMenu|
000274c0  22 29 0d 14 94 44 ff 20  28 22 52 4d 45 6e 73 75  |")...D. ("RMEnsu|
000274d0  72 65 20 46 6f 6e 74 4d  65 6e 75 20 31 2e 31 36  |re FontMenu 1.16|
000274e0  20 45 72 72 6f 72 20 43  6f 75 6c 64 6e 27 74 20  | Error Couldn't |
000274f0  6c 6f 61 64 20 46 6f 6e  74 4d 65 6e 75 20 6d 6f  |load FontMenu mo|
00027500  64 75 6c 65 22 29 0d 14  95 12 e7 20 5f 55 25 21  |dule")..... _U%!|
00027510  32 34 30 3d 2d 31 20 8c  0d 14 96 4c 20 20 f4 20  |240=-1 ....L  . |
00027520  54 68 65 20 61 62 6f 76  65 20 66 6c 61 67 20 65  |The above flag e|
00027530  6e 73 75 72 65 73 20 74  68 61 74 20 74 68 65 20  |nsures that the |
00027540  6c 69 62 72 61 72 79 20  6b 6e 6f 77 73 20 74 68  |library knows th|
00027550  61 74 20 22 46 6f 6e 74  4d 65 6e 75 5f 43 72 65  |at "FontMenu_Cre|
00027560  61 74 65 22 0d 14 97 49  20 20 f4 20 68 61 73 20  |ate"...I  . has |
00027570  62 65 65 6e 20 63 61 6c  6c 65 64 2e 20 49 74 20  |been called. It |
00027580  73 68 6f 75 6c 64 20 6f  6e 6c 79 20 62 65 20 63  |should only be c|
00027590  61 6c 6c 65 64 20 6f 6e  63 65 20 69 6e 20 61 20  |alled once in a |
000275a0  70 72 6f 67 72 61 6d 20  61 73 20 69 74 0d 14 98  |program as it...|
000275b0  39 20 20 f4 20 72 65 67  69 73 74 65 72 73 20 74  |9  . registers t|
000275c0  68 65 20 70 72 6f 67 72  61 6d 20 61 73 20 61 20  |he program as a |
000275d0  46 6f 6e 74 4d 65 6e 75  20 6d 6f 64 75 6c 65 20  |FontMenu module |
000275e0  75 73 65 72 2e 2e 0d 14  99 24 20 20 c8 99 20 22  |user.....$  .. "|
000275f0  46 6f 6e 74 4d 65 6e 75  5f 43 72 65 61 74 65 22  |FontMenu_Create"|
00027600  20 b8 20 5f 55 25 21 32  34 30 0d 14 9a 05 cd 0d  | . _U%!240......|
00027610  14 9b 23 f2 73 68 65 6c  6c 5f 46 6f 6e 74 4d 65  |..#.shell_FontMe|
00027620  6e 75 53 65 6c 65 63 74  46 6f 6e 74 28 22 22 2c  |nuSelectFont("",|
00027630  b9 29 0d 14 9c 05 e1 0d  14 9d 05 3a 0d 14 9e 21  |.).........:...!|
00027640  2a 7c 53 74 6f 70 20 50  52 4f 43 73 68 65 6c 6c  |*|Stop PROCshell|
00027650  5f 46 6f 6e 74 4d 65 6e  75 49 6e 69 74 0d 14 9f  |_FontMenuInit...|
00027660  28 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |(*|Start PROCshe|
00027670  6c 6c 5f 46 6f 6e 74 4d  65 6e 75 53 65 6c 65 63  |ll_FontMenuSelec|
00027680  74 46 6f 6e 74 0d 14 a0  36 dd 20 f2 73 68 65 6c  |tFont...6. .shel|
00027690  6c 5f 46 6f 6e 74 4d 65  6e 75 53 65 6c 65 63 74  |l_FontMenuSelect|
000276a0  46 6f 6e 74 28 66 6f 6e  74 6e 61 6d 65 24 2c 73  |Font(fontname$,s|
000276b0  79 73 74 65 6d 66 6f 6e  74 25 29 0d 14 a1 13 ea  |ystemfont%).....|
000276c0  20 74 65 6d 70 25 2c 66  5f 6d 65 6e 75 25 0d 14  | temp%,f_menu%..|
000276d0  a2 47 e7 20 a4 73 68 65  6c 6c 5f 48 65 61 70 42  |.G. .shell_HeapB|
000276e0  6c 6f 63 6b 45 78 69 73  74 73 28 5f 55 25 21 32  |lockExists(_U%!2|
000276f0  34 34 29 20 8c 20 f2 73  68 65 6c 6c 5f 48 65 61  |44) . .shell_Hea|
00027700  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 5f 55 25  |pBlockReturn(_U%|
00027710  21 32 34 34 29 0d 14 a3  2f 5f 55 25 21 32 34 34  |!244).../_U%!244|
00027720  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
00027730  6b 46 65 74 63 68 28 a9  66 6f 6e 74 6e 61 6d 65  |kFetch(.fontname|
00027740  24 2b 31 29 0d 14 a4 22  74 65 6d 70 25 3d 5f 55  |$+1)..."temp%=_U|
00027750  25 21 32 34 34 3a 24 74  65 6d 70 25 3d 66 6f 6e  |%!244:$temp%=fon|
00027760  74 6e 61 6d 65 24 0d 14  a5 24 e7 20 73 79 73 74  |tname$...$. syst|
00027770  65 6d 66 6f 6e 74 25 3c  3e 30 20 8c 20 73 79 73  |emfont%<>0 . sys|
00027780  74 65 6d 66 6f 6e 74 25  3d 31 0d 14 a6 17 5f 55  |temfont%=1...._U|
00027790  25 21 32 36 30 3d 73 79  73 74 65 6d 66 6f 6e 74  |%!260=systemfont|
000277a0  25 0d 14 a7 35 c8 99 20  22 46 6f 6e 74 4d 65 6e  |%...5.. "FontMen|
000277b0  75 5f 53 65 6c 65 63 74  22 2c 66 6f 6e 74 6e 61  |u_Select",fontna|
000277c0  6d 65 24 2c 5f 55 25 21  32 36 30 20 b8 20 2c 66  |me$,_U%!260 . ,f|
000277d0  5f 6d 65 6e 75 25 0d 14  a8 18 e7 20 66 5f 6d 65  |_menu%..... f_me|
000277e0  6e 75 25 3c 3e 5f 55 25  21 32 35 32 20 8c 0d 14  |nu%<>_U%!252 ...|
000277f0  a9 22 20 20 f4 20 46 6f  6e 74 4d 65 6e 75 20 70  |."  . FontMenu p|
00027800  74 72 20 68 61 73 20 63  68 61 6e 67 65 64 2e 2e  |tr has changed..|
00027810  0d 14 aa 27 20 20 f2 73  68 65 6c 6c 5f 46 6f 6e  |...'  .shell_Fon|
00027820  74 4d 65 6e 75 55 70 64  61 74 65 50 74 72 28 66  |tMenuUpdatePtr(f|
00027830  5f 6d 65 6e 75 25 29 0d  14 ab 15 20 20 5f 55 25  |_menu%)....  _U%|
00027840  21 32 35 32 3d 66 5f 6d  65 6e 75 25 0d 14 ac 05  |!252=f_menu%....|
00027850  cd 0d 14 ad 15 2a 7c 69  66 64 65 66 20 54 72 61  |.....*|ifdef Tra|
00027860  63 65 49 6e 69 74 0d 14  ae 40 f2 73 68 65 6c 6c  |ceInit...@.shell|
00027870  5f 54 72 61 63 65 66 30  28 22 46 6f 6e 74 4d 65  |_Tracef0("FontMe|
00027880  6e 75 53 65 6c 65 63 74  46 6f 6e 74 3a 46 6f 6e  |nuSelectFont:Fon|
00027890  74 20 69 73 20 27 22 2b  66 6f 6e 74 6e 61 6d 65  |t is '"+fontname|
000278a0  24 2b 22 27 22 29 0d 14  af 0b 2a 7c 65 6e 64 69  |$+"'")....*|endi|
000278b0  66 0d 14 b0 05 e1 0d 14  b1 05 3a 0d 14 b2 27 2a  |f.........:...'*|
000278c0  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
000278d0  46 6f 6e 74 4d 65 6e 75  53 65 6c 65 63 74 46 6f  |FontMenuSelectFo|
000278e0  6e 74 0d 14 b3 2f 2a 7c  53 74 61 72 74 20 46 4e  |nt.../*|Start FN|
000278f0  73 68 65 6c 6c 5f 46 6f  6e 74 4d 65 6e 75 47 65  |shell_FontMenuGe|
00027900  74 4c 61 73 74 53 65 6c  65 63 74 65 64 46 6f 6e  |tLastSelectedFon|
00027910  74 0d 14 b4 28 dd 20 a4  73 68 65 6c 6c 5f 46 6f  |t...(. .shell_Fo|
00027920  6e 74 4d 65 6e 75 47 65  74 4c 61 73 74 53 65 6c  |ntMenuGetLastSel|
00027930  65 63 74 65 64 46 6f 6e  74 0d 14 b5 0b ea 20 74  |ectedFont..... t|
00027940  65 6d 70 25 0d 14 b6 2e  e7 20 ac 20 a4 73 68 65  |emp%..... . .she|
00027950  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 45 78 69 73  |ll_HeapBlockExis|
00027960  74 73 28 5f 55 25 21 32  34 34 29 20 8c 20 20 3d  |ts(_U%!244) .  =|
00027970  22 22 0d 14 b7 19 74 65  6d 70 25 3d 5f 55 25 21  |""....temp%=_U%!|
00027980  32 34 34 3a 3d 24 74 65  6d 70 25 0d 14 b8 05 3a  |244:=$temp%....:|
00027990  0d 14 b9 2e 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |....*|Stop FNshe|
000279a0  6c 6c 5f 46 6f 6e 74 4d  65 6e 75 47 65 74 4c 61  |ll_FontMenuGetLa|
000279b0  73 74 53 65 6c 65 63 74  65 64 46 6f 6e 74 0d 14  |stSelectedFont..|
000279c0  ba 04 0d 14 bb 27 2a 7c  53 74 61 72 74 20 50 52  |.....'*|Start PR|
000279d0  4f 43 73 68 65 6c 6c 5f  46 6f 6e 74 4d 65 6e 75  |OCshell_FontMenu|
000279e0  55 70 64 61 74 65 50 74  72 0d 14 bc 24 dd 20 f2  |UpdatePtr...$. .|
000279f0  73 68 65 6c 6c 5f 46 6f  6e 74 4d 65 6e 75 55 70  |shell_FontMenuUp|
00027a00  64 61 74 65 50 74 72 28  70 74 72 25 29 0d 14 bd  |datePtr(ptr%)...|
00027a10  12 ea 20 65 5f 6c 69 73  74 25 2c 63 74 72 25 0d  |.. e_list%,ctr%.|
00027a20  14 be 15 2a 7c 69 66 64  65 66 20 54 72 61 63 65  |...*|ifdef Trace|
00027a30  49 6e 69 74 0d 14 bf 31  f2 73 68 65 6c 6c 5f 54  |Init...1.shell_T|
00027a40  72 61 63 65 66 30 28 22  46 6f 6e 74 4d 65 6e 75  |racef0("FontMenu|
00027a50  55 70 64 61 74 65 50 74  72 3a 53 74 61 72 74 65  |UpdatePtr:Starte|
00027a60  64 2e 2e 22 29 0d 14 c0  0b 2a 7c 65 6e 64 69 66  |d..")....*|endif|
00027a70  0d 14 c1 27 e7 20 a4 73  68 65 6c 6c 5f 48 65 61  |...'. .shell_Hea|
00027a80  70 42 6c 6f 63 6b 45 78  69 73 74 73 28 5f 55 25  |pBlockExists(_U%|
00027a90  21 32 32 30 29 20 8c 0d  14 c2 15 2a 7c 69 66 64  |!220) .....*|ifd|
00027aa0  65 66 20 54 72 61 63 65  49 6e 69 74 0d 14 c3 3b  |ef TraceInit...;|
00027ab0  20 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |  .shell_Tracef0|
00027ac0  28 22 46 6f 6e 74 4d 65  6e 75 55 70 64 61 74 65  |("FontMenuUpdate|
00027ad0  50 74 72 3a 48 65 61 70  42 6c 6f 63 6b 20 66 6f  |Ptr:HeapBlock fo|
00027ae0  75 6e 64 2e 2e 22 29 0d  14 c4 0b 2a 7c 65 6e 64  |und..")....*|end|
00027af0  69 66 0d 14 c5 1c 20 20  65 5f 6c 69 73 74 25 3d  |if....  e_list%=|
00027b00  5f 55 25 21 32 32 30 3a  63 74 72 25 3d 30 0d 14  |_U%!220:ctr%=0..|
00027b10  c6 07 20 20 f5 0d 14 c7  15 2a 7c 69 66 64 65 66  |..  .....*|ifdef|
00027b20  20 54 72 61 63 65 49 6e  69 74 0d 14 c8 3c 20 20  | TraceInit...<  |
00027b30  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
00027b40  46 6f 6e 74 4d 65 6e 75  55 70 64 61 74 65 50 74  |FontMenuUpdatePt|
00027b50  72 3a 53 75 62 73 74 69  74 75 74 69 6e 67 20 70  |r:Substituting p|
00027b60  74 72 2e 2e 22 29 0d 14  c9 0b 2a 7c 65 6e 64 69  |tr..")....*|endi|
00027b70  66 0d 14 ca 1d 20 20 20  20 65 5f 6c 69 73 74 25  |f....    e_list%|
00027b80  21 28 63 74 72 25 2b 38  29 3d 70 74 72 25 0d 14  |!(ctr%+8)=ptr%..|
00027b90  cb 10 20 20 20 20 63 74  72 25 2b 3d 31 32 0d 14  |..    ctr%+=12..|
00027ba0  cc 17 20 20 fd 20 65 5f  6c 69 73 74 25 21 63 74  |..  . e_list%!ct|
00027bb0  72 25 3d 2d 31 0d 14 cd  05 cd 0d 14 ce 05 e1 0d  |r%=-1...........|
00027bc0  14 cf 05 3a 0d 14 d0 26  2a 7c 53 74 6f 70 20 50  |...:...&*|Stop P|
00027bd0  52 4f 43 73 68 65 6c 6c  5f 46 6f 6e 74 4d 65 6e  |ROCshell_FontMen|
00027be0  75 55 70 64 61 74 65 50  74 72 0d 14 d1 04 0d 14  |uUpdatePtr......|
00027bf0  d2 26 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |.&*|Start PROCsh|
00027c00  65 6c 6c 5f 4d 65 6e 75  55 70 64 61 74 65 48 61  |ell_MenuUpdateHa|
00027c10  6e 64 6c 65 0d 14 d3 2c  dd 20 f2 73 68 65 6c 6c  |ndle...,. .shell|
00027c20  5f 4d 65 6e 75 55 70 64  61 74 65 48 61 6e 64 6c  |_MenuUpdateHandl|
00027c30  65 28 6f 6c 64 5f 68 25  2c 6e 65 77 5f 68 25 29  |e(old_h%,new_h%)|
00027c40  0d 14 d4 27 ea 20 6c 69  73 74 5f 73 69 7a 65 25  |...'. list_size%|
00027c50  2c 70 74 72 25 2c 65 76  65 6e 74 5f 6c 69 73 74  |,ptr%,event_list|
00027c60  25 2c 6d 65 6e 75 25 0d  14 d5 2d 6c 69 73 74 5f  |%,menu%...-list_|
00027c70  73 69 7a 65 25 3d a4 73  68 65 6c 6c 5f 48 65 61  |size%=.shell_Hea|
00027c80  70 42 6c 6f 63 6b 49 6e  66 6f 28 5f 55 25 21 31  |pBlockInfo(_U%!1|
00027c90  32 29 2d 38 0d 14 d6 0a  70 74 72 25 3d 30 0d 14  |2)-8....ptr%=0..|
00027ca0  d7 0c 66 6f 75 6e 64 25  3d a3 0d 14 d8 16 65 76  |..found%=.....ev|
00027cb0  65 6e 74 5f 6c 69 73 74  25 3d 5f 55 25 21 31 32  |ent_list%=_U%!12|
00027cc0  0d 14 d9 05 f5 0d 14 da  22 20 20 6d 65 6e 75 25  |........"  menu%|
00027cd0  3d 65 76 65 6e 74 5f 6c  69 73 74 25 21 28 70 74  |=event_list%!(pt|
00027ce0  72 25 20 2b 20 38 29 0d  14 db 38 20 20 e7 20 6d  |r% + 8)...8  . m|
00027cf0  65 6e 75 25 20 3d 20 6f  6c 64 5f 68 25 20 8c 20  |enu% = old_h% . |
00027d00  65 76 65 6e 74 5f 6c 69  73 74 25 21 28 70 74 72  |event_list%!(ptr|
00027d10  25 20 2b 20 38 29 20 3d  20 6e 65 77 5f 68 25 0d  |% + 8) = new_h%.|
00027d20  14 dc 0e 20 20 70 74 72  25 2b 3d 34 38 0d 14 dd  |...  ptr%+=48...|
00027d30  1a fd 20 28 70 74 72 25  20 3e 3d 20 6c 69 73 74  |.. (ptr% >= list|
00027d40  5f 73 69 7a 65 25 29 0d  14 de 27 e7 20 5f 55 25  |_size%)...'. _U%|
00027d50  21 32 34 20 3d 20 6f 6c  64 5f 68 25 20 8c 20 5f  |!24 = old_h% . _|
00027d60  55 25 21 32 34 20 3d 20  6e 65 77 5f 68 25 0d 14  |U%!24 = new_h%..|
00027d70  df 05 e1 0d 14 e0 25 2a  7c 53 74 6f 70 20 50 52  |......%*|Stop PR|
00027d80  4f 43 73 68 65 6c 6c 5f  4d 65 6e 75 55 70 64 61  |OCshell_MenuUpda|
00027d90  74 65 48 61 6e 64 6c 65  0d 14 e1 04 0d 14 e2 1e  |teHandle........|
00027da0  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
00027db0  6c 5f 46 69 6e 64 46 6f  6e 74 0d 14 e3 39 dd 20  |l_FindFont...9. |
00027dc0  f2 73 68 65 6c 6c 5f 46  69 6e 64 46 6f 6e 74 28  |.shell_FindFont(|
00027dd0  f8 20 66 6f 6e 74 24 2c  78 5f 70 74 25 2c 79 5f  |. font$,x_pt%,y_|
00027de0  70 74 25 2c f8 20 66 6f  6e 74 5f 68 61 6e 64 6c  |pt%,. font_handl|
00027df0  65 25 29 0d 14 e4 33 e7  20 ac 20 a4 73 68 65 6c  |e%)...3. . .shel|
00027e00  6c 5f 46 6f 6e 74 49 73  41 76 61 69 6c 61 62 6c  |l_FontIsAvailabl|
00027e10  65 28 66 6f 6e 74 24 2c  78 5f 70 74 25 2c 79 5f  |e(font$,x_pt%,y_|
00027e20  70 74 25 29 20 8c 0d 14  e5 1c 20 20 66 6f 6e 74  |pt%) .....  font|
00027e30  24 3d 22 54 72 69 6e 69  74 79 2e 4d 65 64 69 75  |$="Trinity.Mediu|
00027e40  6d 22 0d 14 e6 05 cd 0d  14 e7 42 c8 99 20 22 46  |m"........B.. "F|
00027e50  6f 6e 74 5f 46 69 6e 64  46 6f 6e 74 22 2c 2c 66  |ont_FindFont",,f|
00027e60  6f 6e 74 24 2c 78 5f 70  74 25 2a 31 36 2c 79 5f  |ont$,x_pt%*16,y_|
00027e70  70 74 25 2a 31 36 2c 30  2c 30 20 b8 20 66 6f 6e  |pt%*16,0,0 . fon|
00027e80  74 5f 68 61 6e 64 6c 65  25 0d 14 e8 05 e1 0d 14  |t_handle%.......|
00027e90  e9 05 3a 0d 14 ea 1d 2a  7c 53 74 6f 70 20 50 52  |..:....*|Stop PR|
00027ea0  4f 43 73 68 65 6c 6c 5f  46 69 6e 64 46 6f 6e 74  |OCshell_FindFont|
00027eb0  0d 14 eb 04 0d 14 ec 23  2a 7c 53 74 61 72 74 20  |.......#*|Start |
00027ec0  46 4e 73 68 65 6c 6c 5f  46 6f 6e 74 49 73 41 76  |FNshell_FontIsAv|
00027ed0  61 69 6c 61 62 6c 65 0d  14 ed 2f dd 20 a4 73 68  |ailable.../. .sh|
00027ee0  65 6c 6c 5f 46 6f 6e 74  49 73 41 76 61 69 6c 61  |ell_FontIsAvaila|
00027ef0  62 6c 65 28 66 6f 6e 74  24 2c 78 5f 70 74 25 2c  |ble(font$,x_pt%,|
00027f00  79 5f 70 74 25 29 0d 14  ee 07 ea 20 85 0d 14 ef  |y_pt%)..... ....|
00027f10  10 ee 20 85 20 ea 3a f7  20 85 3a 3d a3 0d 14 f0  |.. . .:. .:=....|
00027f20  43 c8 99 20 22 46 6f 6e  74 5f 46 69 6e 64 46 6f  |C.. "Font_FindFo|
00027f30  6e 74 22 2c 30 2c 66 6f  6e 74 24 2c 78 5f 70 74  |nt",0,font$,x_pt|
00027f40  25 2a 31 36 2c 79 5f 70  74 25 2a 31 36 2c 30 2c  |%*16,y_pt%*16,0,|
00027f50  30 20 b8 20 66 6f 6e 74  5f 68 61 6e 64 6c 65 25  |0 . font_handle%|
00027f60  0d 14 f1 23 c8 99 20 22  46 6f 6e 74 5f 4c 6f 73  |...#.. "Font_Los|
00027f70  65 46 6f 6e 74 22 2c 66  6f 6e 74 5f 68 61 6e 64  |eFont",font_hand|
00027f80  6c 65 25 0d 14 f2 06 3d  b9 0d 14 f3 05 3a 0d 14  |le%....=.....:..|
00027f90  f4 22 2a 7c 53 74 6f 70  20 46 4e 73 68 65 6c 6c  |."*|Stop FNshell|
00027fa0  5f 46 6f 6e 74 49 73 41  76 61 69 6c 61 62 6c 65  |_FontIsAvailable|
00027fb0  0d 14 f5 04 0d 14 f6 22  2a 7c 53 74 61 72 74 20  |......."*|Start |
00027fc0  46 4e 73 68 65 6c 6c 5f  43 68 65 63 6b 53 65 6c  |FNshell_CheckSel|
00027fd0  65 63 74 69 6f 6e 0d 14  f7 21 dd 20 a4 73 68 65  |ection...!. .she|
00027fe0  6c 6c 5f 43 68 65 63 6b  53 65 6c 65 63 74 69 6f  |ll_CheckSelectio|
00027ff0  6e 28 73 65 6c 25 29 0d  14 f8 10 ea 20 74 65 6d  |n(sel%)..... tem|
00028000  70 25 2c 63 74 72 25 0d  14 f9 11 74 65 6d 70 25  |p%,ctr%....temp%|
00028010  3d 5f 55 25 21 32 35 36  0d 14 fa 13 e7 20 74 65  |=_U%!256..... te|
00028020  6d 70 25 3d 30 20 8c 20  3d 2d 31 0d 14 fb 19 e7  |mp%=0 . =-1.....|
00028030  20 5f 55 25 21 32 34 3d  5f 55 25 21 32 35 32 20  | _U%!24=_U%!252 |
00028040  8c 20 3d 30 0d 14 fc 05  f5 0d 14 fd 23 20 20 e7  |. =0........#  .|
00028050  20 73 65 6c 25 21 63 74  72 25 3c 3e 74 65 6d 70  | sel%!ctr%<>temp|
00028060  25 21 63 74 72 25 20 8c  20 3d 2d 31 0d 14 fe 0d  |%!ctr% . =-1....|
00028070  20 20 63 74 72 25 2b 3d  34 0d 14 ff 13 fd 20 74  |  ctr%+=4..... t|
00028080  65 6d 70 25 21 63 74 72  25 3d 2d 31 0d 15 00 09  |emp%!ctr%=-1....|
00028090  3d 63 74 72 25 0d 15 01  05 3a 0d 15 02 21 2a 7c  |=ctr%....:...!*||
000280a0  53 74 6f 70 20 46 4e 73  68 65 6c 6c 5f 43 68 65  |Stop FNshell_Che|
000280b0  63 6b 53 65 6c 65 63 74  69 6f 6e 0d 15 03 04 0d  |ckSelection.....|
000280c0  15 04 26 2a 7c 53 74 61  72 74 20 46 4e 73 68 65  |..&*|Start FNshe|
000280d0  6c 6c 5f 4d 65 6e 75 47  65 74 49 74 65 6d 41 64  |ll_MenuGetItemAd|
000280e0  64 72 65 73 73 0d 15 05  31 dd 20 a4 73 68 65 6c  |dress...1. .shel|
000280f0  6c 5f 4d 65 6e 75 47 65  74 49 74 65 6d 41 64 64  |l_MenuGetItemAdd|
00028100  72 65 73 73 28 6d 65 6e  75 25 2c 73 65 6c 65 63  |ress(menu%,selec|
00028110  74 69 6f 6e 25 29 0d 15  06 15 ea 20 63 74 72 25  |tion%)..... ctr%|
00028120  2c 69 74 65 6d 5f 61 64  64 72 25 0d 15 07 24 c8  |,item_addr%...$.|
00028130  99 20 22 4d 65 6e 75 55  74 69 6c 5f 49 6e 66 6f  |. "MenuUtil_Info|
00028140  22 2c 6d 65 6e 75 25 20  b8 20 6d 65 6e 75 25 0d  |",menu% . menu%.|
00028150  15 08 05 f5 0d 15 09 30  20 20 69 74 65 6d 5f 61  |.......0  item_a|
00028160  64 64 72 25 3d 6d 65 6e  75 25 2b 32 38 2b 28 28  |ddr%=menu%+28+((|
00028170  73 65 6c 65 63 74 69 6f  6e 25 21 63 74 72 25 29  |selection%!ctr%)|
00028180  2a 32 34 29 0d 15 0a 2f  20 20 6d 65 6e 75 25 3d  |*24).../  menu%=|
00028190  69 74 65 6d 5f 61 64 64  72 25 21 34 3a f4 20 61  |item_addr%!4:. a|
000281a0  64 64 72 65 73 73 20 6f  66 20 73 75 62 6d 65 6e  |ddress of submen|
000281b0  75 2e 2e 0d 15 0b 0d 20  20 63 74 72 25 2b 3d 34  |u......  ctr%+=4|
000281c0  0d 15 0c 18 fd 20 73 65  6c 65 63 74 69 6f 6e 25  |..... selection%|
000281d0  21 63 74 72 25 3d 2d 31  0d 15 0d 0f 3d 69 74 65  |!ctr%=-1....=ite|
000281e0  6d 5f 61 64 64 72 25 0d  15 0e 05 3a 0d 15 0f 25  |m_addr%....:...%|
000281f0  2a 7c 53 74 6f 70 20 46  4e 73 68 65 6c 6c 5f 4d  |*|Stop FNshell_M|
00028200  65 6e 75 47 65 74 49 74  65 6d 41 64 64 72 65 73  |enuGetItemAddres|
00028210  73 0d 15 10 04 0d 15 11  24 2a 7c 53 74 61 72 74  |s.......$*|Start|
00028220  20 46 4e 73 68 65 6c 6c  5f 47 65 74 4c 61 73 74  | FNshell_GetLast|
00028230  4d 6f 75 73 65 58 50 6f  73 0d 15 12 1d dd 20 a4  |MouseXPos..... .|
00028240  73 68 65 6c 6c 5f 47 65  74 4c 61 73 74 4d 6f 75  |shell_GetLastMou|
00028250  73 65 58 50 6f 73 0d 15  13 0c 3d 5f 55 25 21 32  |seXPos....=_U%!2|
00028260  37 32 0d 15 14 05 3a 0d  15 15 23 2a 7c 53 74 6f  |72....:...#*|Sto|
00028270  70 20 46 4e 73 68 65 6c  6c 5f 47 65 74 4c 61 73  |p FNshell_GetLas|
00028280  74 4d 6f 75 73 65 58 50  6f 73 0d 15 16 04 0d 15  |tMouseXPos......|
00028290  17 24 2a 7c 53 74 61 72  74 20 46 4e 73 68 65 6c  |.$*|Start FNshel|
000282a0  6c 5f 47 65 74 4c 61 73  74 4d 6f 75 73 65 59 50  |l_GetLastMouseYP|
000282b0  6f 73 0d 15 18 1d dd 20  a4 73 68 65 6c 6c 5f 47  |os..... .shell_G|
000282c0  65 74 4c 61 73 74 4d 6f  75 73 65 59 50 6f 73 0d  |etLastMouseYPos.|
000282d0  15 19 0c 3d 5f 55 25 21  32 37 36 0d 15 1a 05 3a  |...=_U%!276....:|
000282e0  0d 15 1b 23 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |...#*|Stop FNshe|
000282f0  6c 6c 5f 47 65 74 4c 61  73 74 4d 6f 75 73 65 59  |ll_GetLastMouseY|
00028300  50 6f 73 0d 15 1c 04 0d  15 1d 28 2a 7c 53 74 61  |Pos.......(*|Sta|
00028310  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 55 70 64  |rt PROCshell_Upd|
00028320  61 74 65 57 69 6e 64 6f  77 48 61 6e 64 6c 65 0d  |ateWindowHandle.|
00028330  15 1e 38 dd 20 f2 73 68  65 6c 6c 5f 55 70 64 61  |..8. .shell_Upda|
00028340  74 65 57 69 6e 64 6f 77  48 61 6e 64 6c 65 28 6f  |teWindowHandle(o|
00028350  6c 64 5f 68 61 6e 64 6c  65 25 2c 6e 65 77 5f 68  |ld_handle%,new_h|
00028360  61 6e 64 6c 65 25 29 0d  15 1f 15 2a 7c 69 66 64  |andle%)....*|ifd|
00028370  65 66 20 54 72 61 63 65  49 6e 69 74 0d 15 20 47  |ef TraceInit.. G|
00028380  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
00028390  55 70 64 61 74 65 57 69  6e 64 6f 77 48 61 6e 64  |UpdateWindowHand|
000283a0  6c 65 3a 55 70 64 61 74  69 6e 67 20 73 74 6f 72  |le:Updating stor|
000283b0  65 64 20 77 69 6e 64 6f  77 20 68 61 6e 64 6c 65  |ed window handle|
000283c0  73 22 29 0d 15 21 43 f2  73 68 65 6c 6c 5f 54 72  |s")..!C.shell_Tr|
000283d0  61 63 65 66 30 28 22 55  70 64 61 74 65 57 69 6e  |acef0("UpdateWin|
000283e0  64 6f 77 48 61 6e 64 6c  65 3a 6f 6c 64 20 68 61  |dowHandle:old ha|
000283f0  6e 64 6c 65 3d 26 22 2b  c3 7e 6f 6c 64 5f 68 61  |ndle=&"+.~old_ha|
00028400  6e 64 6c 65 25 29 0d 15  22 43 f2 73 68 65 6c 6c  |ndle%).."C.shell|
00028410  5f 54 72 61 63 65 66 30  28 22 55 70 64 61 74 65  |_Tracef0("Update|
00028420  57 69 6e 64 6f 77 48 61  6e 64 6c 65 3a 6e 65 77  |WindowHandle:new|
00028430  20 68 61 6e 64 6c 65 3d  26 22 2b c3 7e 6e 65 77  | handle=&"+.~new|
00028440  5f 68 61 6e 64 6c 65 25  29 0d 15 23 0b 2a 7c 65  |_handle%)..#.*|e|
00028450  6e 64 69 66 0d 15 24 20  e7 20 6e 65 77 5f 68 61  |ndif..$ . new_ha|
00028460  6e 64 6c 65 25 3c 3e 6f  6c 64 5f 68 61 6e 64 6c  |ndle%<>old_handl|
00028470  65 25 20 8c 0d 15 25 2f  20 20 e7 20 5f 55 25 21  |e% ...%/  . _U%!|
00028480  32 38 3d 6f 6c 64 5f 68  61 6e 64 6c 65 25 20 8c  |28=old_handle% .|
00028490  20 5f 55 25 21 32 38 3d  6e 65 77 5f 68 61 6e 64  | _U%!28=new_hand|
000284a0  6c 65 25 0d 15 26 52 20  20 f2 73 68 65 6c 6c 5f  |le%..&R  .shell_|
000284b0  46 69 78 45 76 65 6e 74  42 6c 6f 63 6b 28 6f 6c  |FixEventBlock(ol|
000284c0  64 5f 68 61 6e 64 6c 65  25 2c 6e 65 77 5f 68 61  |d_handle%,new_ha|
000284d0  6e 64 6c 65 25 2c 5f 55  25 21 31 32 2c 34 38 29  |ndle%,_U%!12,48)|
000284e0  20 20 3a f4 20 6d 61 69  6e 20 65 76 65 6e 74 20  |  :. main event |
000284f0  62 6c 6f 63 6b 0d 15 27  51 20 20 f2 73 68 65 6c  |block..'Q  .shel|
00028500  6c 5f 46 69 78 45 76 65  6e 74 42 6c 6f 63 6b 28  |l_FixEventBlock(|
00028510  6f 6c 64 5f 68 61 6e 64  6c 65 25 2c 6e 65 77 5f  |old_handle%,new_|
00028520  68 61 6e 64 6c 65 25 2c  5f 55 25 21 39 36 2c 31  |handle%,_U%!96,1|
00028530  36 29 20 20 3a f4 20 44  61 74 61 4c 6f 61 64 20  |6)  :. DataLoad |
00028540  65 76 65 6e 74 73 0d 15  28 51 20 20 f2 73 68 65  |events..(Q  .she|
00028550  6c 6c 5f 46 69 78 45 76  65 6e 74 42 6c 6f 63 6b  |ll_FixEventBlock|
00028560  28 6f 6c 64 5f 68 61 6e  64 6c 65 25 2c 6e 65 77  |(old_handle%,new|
00028570  5f 68 61 6e 64 6c 65 25  2c 5f 55 25 21 37 32 2c  |_handle%,_U%!72,|
00028580  32 34 29 20 20 3a f4 20  44 61 74 61 53 61 76 65  |24)  :. DataSave|
00028590  20 65 76 65 6e 74 73 0d  15 29 4d 20 20 f2 73 68  | events..)M  .sh|
000285a0  65 6c 6c 5f 46 69 78 45  76 65 6e 74 42 6c 6f 63  |ell_FixEventBloc|
000285b0  6b 28 6f 6c 64 5f 68 61  6e 64 6c 65 25 2c 6e 65  |k(old_handle%,ne|
000285c0  77 5f 68 61 6e 64 6c 65  25 2c 5f 55 25 21 39 32  |w_handle%,_U%!92|
000285d0  2c 32 34 29 20 20 3a f4  20 50 61 6e 65 20 65 76  |,24)  :. Pane ev|
000285e0  65 6e 74 73 0d 15 2a 4d  20 20 f2 73 68 65 6c 6c  |ents..*M  .shell|
000285f0  5f 46 69 78 45 76 65 6e  74 42 6c 6f 63 6b 32 28  |_FixEventBlock2(|
00028600  6f 6c 64 5f 68 61 6e 64  6c 65 25 2c 6e 65 77 5f  |old_handle%,new_|
00028610  68 61 6e 64 6c 65 25 2c  5f 55 25 21 31 30 34 2c  |handle%,_U%!104,|
00028620  31 36 29 3a f4 20 42 75  6d 70 20 65 76 65 6e 74  |16):. Bump event|
00028630  73 0d 15 2b 4f 20 20 f2  73 68 65 6c 6c 5f 46 69  |s..+O  .shell_Fi|
00028640  78 45 76 65 6e 74 42 6c  6f 63 6b 32 28 6f 6c 64  |xEventBlock2(old|
00028650  5f 68 61 6e 64 6c 65 25  2c 6e 65 77 5f 68 61 6e  |_handle%,new_han|
00028660  64 6c 65 25 2c 5f 55 25  21 33 33 32 2c 33 32 29  |dle%,_U%!332,32)|
00028670  3a f4 20 53 6c 69 64 65  72 20 65 76 65 6e 74 73  |:. Slider events|
00028680  0d 15 2c 39 20 20 f2 73  68 65 6c 6c 5f 55 70 64  |..,9  .shell_Upd|
00028690  61 74 65 53 74 61 74 69  63 57 69 6e 64 6f 77 73  |ateStaticWindows|
000286a0  28 6f 6c 64 5f 68 61 6e  64 6c 65 25 2c 6e 65 77  |(old_handle%,new|
000286b0  5f 68 61 6e 64 6c 65 25  29 0d 15 2d 05 cd 0d 15  |_handle%)..-....|
000286c0  2e 05 e1 0d 15 2f 05 3a  0d 15 30 27 2a 7c 53 74  |...../.:..0'*|St|
000286d0  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 55 70 64  |op PROCshell_Upd|
000286e0  61 74 65 57 69 6e 64 6f  77 48 61 6e 64 6c 65 0d  |ateWindowHandle.|
000286f0  15 31 04 0d 15 32 29 2a  7c 53 74 61 72 74 20 50  |.1...2)*|Start P|
00028700  52 4f 43 73 68 65 6c 6c  5f 55 70 64 61 74 65 53  |ROCshell_UpdateS|
00028710  74 61 74 69 63 57 69 6e  64 6f 77 73 0d 15 33 39  |taticWindows..39|
00028720  dd 20 f2 73 68 65 6c 6c  5f 55 70 64 61 74 65 53  |. .shell_UpdateS|
00028730  74 61 74 69 63 57 69 6e  64 6f 77 73 28 6f 6c 64  |taticWindows(old|
00028740  5f 68 61 6e 64 6c 65 25  2c 6e 65 77 5f 68 61 6e  |_handle%,new_han|
00028750  64 6c 65 25 29 0d 15 34  15 ea 20 6f 66 66 73 65  |dle%)..4.. offse|
00028760  74 25 2c 77 5f 6c 69 73  74 25 0d 15 35 15 2a 7c  |t%,w_list%..5.*||
00028770  69 66 64 65 66 20 54 72  61 63 65 49 6e 69 74 0d  |ifdef TraceInit.|
00028780  15 36 49 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |.6I.shell_Tracef|
00028790  30 28 22 55 70 64 61 74  65 53 74 61 74 69 63 57  |0("UpdateStaticW|
000287a0  69 6e 64 6f 77 73 3a 43  6f 72 72 65 63 74 69 6e  |indows:Correctin|
000287b0  67 20 73 74 61 74 69 63  20 77 69 6e 64 6f 77 20  |g static window |
000287c0  6c 69 73 74 2e 2e 22 29  0d 15 37 0b 2a 7c 65 6e  |list..")..7.*|en|
000287d0  64 69 66 0d 15 38 13 77  5f 6c 69 73 74 25 3d 5f  |dif..8.w_list%=_|
000287e0  55 25 21 31 38 34 0d 15  39 34 6f 66 66 73 65 74  |U%!184..94offset|
000287f0  25 3d a4 73 68 65 6c 6c  5f 53 65 61 72 63 68 53  |%=.shell_SearchS|
00028800  74 61 74 69 63 28 5f 55  25 21 31 38 34 2c 6f 6c  |tatic(_U%!184,ol|
00028810  64 5f 68 61 6e 64 6c 65  25 29 0d 15 3a 1f 77 5f  |d_handle%)..:.w_|
00028820  6c 69 73 74 25 21 6f 66  66 73 65 74 25 3d 6e 65  |list%!offset%=ne|
00028830  77 5f 68 61 6e 64 6c 65  25 0d 15 3b 05 e1 0d 15  |w_handle%..;....|
00028840  3c 05 3a 0d 15 3d 28 2a  7c 53 74 6f 70 20 50 52  |<.:..=(*|Stop PR|
00028850  4f 43 73 68 65 6c 6c 5f  55 70 64 61 74 65 53 74  |OCshell_UpdateSt|
00028860  61 74 69 63 57 69 6e 64  6f 77 73 0d 15 3e 04 0d  |aticWindows..>..|
00028870  15 3f 23 2a 7c 53 74 61  72 74 20 50 52 4f 43 73  |.?#*|Start PROCs|
00028880  68 65 6c 6c 5f 46 69 78  45 76 65 6e 74 42 6c 6f  |hell_FixEventBlo|
00028890  63 6b 0d 15 40 47 dd 20  f2 73 68 65 6c 6c 5f 46  |ck..@G. .shell_F|
000288a0  69 78 45 76 65 6e 74 42  6c 6f 63 6b 28 6f 6c 64  |ixEventBlock(old|
000288b0  5f 68 61 6e 64 6c 65 25  2c 6e 65 77 5f 68 61 6e  |_handle%,new_han|
000288c0  64 6c 65 25 2c 65 76 65  6e 74 5f 6c 69 73 74 25  |dle%,event_list%|
000288d0  2c 6f 66 66 73 65 74 25  29 0d 15 41 15 ea 20 70  |,offset%)..A.. p|
000288e0  74 72 25 2c 6c 69 73 74  5f 73 69 7a 65 25 0d 15  |tr%,list_size%..|
000288f0  42 2b e7 20 a4 73 68 65  6c 6c 5f 48 65 61 70 42  |B+. .shell_HeapB|
00028900  6c 6f 63 6b 45 78 69 73  74 73 28 65 76 65 6e 74  |lockExists(event|
00028910  5f 6c 69 73 74 25 29 20  8c 0d 15 43 34 20 20 6c  |_list%) ...C4  l|
00028920  69 73 74 5f 73 69 7a 65  25 3d a4 73 68 65 6c 6c  |ist_size%=.shell|
00028930  5f 48 65 61 70 42 6c 6f  63 6b 49 6e 66 6f 28 65  |_HeapBlockInfo(e|
00028940  76 65 6e 74 5f 6c 69 73  74 25 29 2d 38 0d 15 44  |vent_list%)-8..D|
00028950  07 20 20 f5 0d 15 45 2a  20 20 20 20 e7 20 28 65  |.  ...E*    . (e|
00028960  76 65 6e 74 5f 6c 69 73  74 25 21 70 74 72 25 3d  |vent_list%!ptr%=|
00028970  6f 6c 64 5f 68 61 6e 64  6c 65 25 29 20 8c 0d 15  |old_handle%) ...|
00028980  46 26 20 20 20 20 20 20  65 76 65 6e 74 5f 6c 69  |F&      event_li|
00028990  73 74 25 21 70 74 72 25  3d 6e 65 77 5f 68 61 6e  |st%!ptr%=new_han|
000289a0  64 6c 65 25 0d 15 47 09  20 20 20 20 cd 0d 15 48  |dle%..G.    ...H|
000289b0  15 20 20 20 20 70 74 72  25 2b 3d 6f 66 66 73 65  |.    ptr%+=offse|
000289c0  74 25 0d 15 49 1a 20 20  fd 20 28 70 74 72 25 3e  |t%..I.  . (ptr%>|
000289d0  3d 6c 69 73 74 5f 73 69  7a 65 25 29 0d 15 4a 05  |=list_size%)..J.|
000289e0  cd 0d 15 4b 05 e1 0d 15  4c 05 3a 0d 15 4d 22 2a  |...K....L.:..M"*|
000289f0  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
00028a00  46 69 78 45 76 65 6e 74  42 6c 6f 63 6b 0d 15 4e  |FixEventBlock..N|
00028a10  04 0d 15 4f 24 2a 7c 53  74 61 72 74 20 50 52 4f  |...O$*|Start PRO|
00028a20  43 73 68 65 6c 6c 5f 46  69 78 45 76 65 6e 74 42  |Cshell_FixEventB|
00028a30  6c 6f 63 6b 32 0d 15 50  48 dd 20 f2 73 68 65 6c  |lock2..PH. .shel|
00028a40  6c 5f 46 69 78 45 76 65  6e 74 42 6c 6f 63 6b 32  |l_FixEventBlock2|
00028a50  28 6f 6c 64 5f 68 61 6e  64 6c 65 25 2c 6e 65 77  |(old_handle%,new|
00028a60  5f 68 61 6e 64 6c 65 25  2c 65 76 65 6e 74 5f 6c  |_handle%,event_l|
00028a70  69 73 74 25 2c 6f 66 66  73 65 74 25 29 0d 15 51  |ist%,offset%)..Q|
00028a80  15 ea 20 70 74 72 25 2c  6c 69 73 74 5f 73 69 7a  |.. ptr%,list_siz|
00028a90  65 25 0d 15 52 2b 70 74  72 25 20 3d 20 34 20 3a  |e%..R+ptr% = 4 :|
00028aa0  f4 20 66 69 72 73 74 20  77 6f 72 64 20 69 73 20  |. first word is |
00028ab0  61 6c 77 61 79 73 20 73  69 7a 65 2e 2e 0d 15 53  |always size....S|
00028ac0  2b e7 20 a4 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |+. .shell_HeapBl|
00028ad0  6f 63 6b 45 78 69 73 74  73 28 65 76 65 6e 74 5f  |ockExists(event_|
00028ae0  6c 69 73 74 25 29 20 8c  0d 15 54 1f 20 20 6c 69  |list%) ...T.  li|
00028af0  73 74 5f 73 69 7a 65 25  20 3d 20 21 65 76 65 6e  |st_size% = !even|
00028b00  74 5f 6c 69 73 74 25 0d  15 55 07 20 20 f5 0d 15  |t_list%..U.  ...|
00028b10  56 2c 20 20 20 20 e7 20  28 65 76 65 6e 74 5f 6c  |V,    . (event_l|
00028b20  69 73 74 25 21 70 74 72  25 20 3d 20 6f 6c 64 5f  |ist%!ptr% = old_|
00028b30  68 61 6e 64 6c 65 25 29  20 8c 0d 15 57 2a 20 20  |handle%) ...W*  |
00028b40  20 20 20 20 65 76 65 6e  74 5f 6c 69 73 74 25 21  |    event_list%!|
00028b50  70 74 72 25 20 20 20 3d  20 6e 65 77 5f 68 61 6e  |ptr%   = new_han|
00028b60  64 6c 65 25 0d 15 58 09  20 20 20 20 cd 0d 15 59  |dle%..X.    ...Y|
00028b70  17 20 20 20 20 70 74 72  25 20 2b 3d 20 6f 66 66  |.    ptr% += off|
00028b80  73 65 74 25 0d 15 5a 1c  20 20 fd 20 28 70 74 72  |set%..Z.  . (ptr|
00028b90  25 3e 20 3d 20 6c 69 73  74 5f 73 69 7a 65 25 29  |%> = list_size%)|
00028ba0  0d 15 5b 05 cd 0d 15 5c  05 e1 0d 15 5d 05 3a 0d  |..[....\....].:.|
00028bb0  15 5e 23 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |.^#*|Stop PROCsh|
00028bc0  65 6c 6c 5f 46 69 78 45  76 65 6e 74 42 6c 6f 63  |ell_FixEventBloc|
00028bd0  6b 32 0d 15 5f 04 0d 15  60 23 2a 7c 53 74 61 72  |k2.._...`#*|Star|
00028be0  74 20 50 52 4f 43 73 68  65 6c 6c 5f 49 63 6f 6e  |t PROCshell_Icon|
00028bf0  53 65 6c 65 63 74 41 6c  6c 0d 15 61 1f dd 20 f2  |SelectAll..a.. .|
00028c00  73 68 65 6c 6c 5f 49 63  6f 6e 53 65 6c 65 63 74  |shell_IconSelect|
00028c10  41 6c 6c 28 77 68 25 29  0d 15 62 0d ea 20 62 6c  |All(wh%)..b.. bl|
00028c20  6b 25 2c 49 25 0d 15 63  24 62 6c 6b 25 3d a4 73  |k%,I%..c$blk%=.s|
00028c30  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 46 65  |hell_HeapBlockFe|
00028c40  74 63 68 28 32 30 30 30  29 0d 15 64 19 49 25 3d  |tch(2000)..d.I%=|
00028c50  62 6c 6b 25 2b 26 34 30  3a 21 62 6c 6b 25 3d 77  |blk%+&40:!blk%=w|
00028c60  68 25 0d 15 65 1e 62 6c  6b 25 21 38 3d 31 3c 3c  |h%..e.blk%!8=1<<|
00028c70  32 31 3a 62 6c 6b 25 21  31 32 3d 31 3c 3c 32 31  |21:blk%!12=1<<21|
00028c80  0d 15 66 2c c8 99 20 22  57 69 6d 70 5f 57 68 69  |..f,.. "Wimp_Whi|
00028c90  63 68 49 63 6f 6e 22 2c  21 62 6c 6b 25 2c 49 25  |chIcon",!blk%,I%|
00028ca0  2c 35 3c 3c 32 31 2c 30  3c 3c 32 31 0d 15 67 0d  |,5<<21,0<<21..g.|
00028cb0  c8 95 20 21 49 25 3e 2d  31 0d 15 68 10 20 20 62  |.. !I%>-1..h.  b|
00028cc0  6c 6b 25 21 34 3d 21 49  25 0d 15 69 22 20 20 c8  |lk%!4=!I%..i"  .|
00028cd0  99 20 22 57 69 6d 70 5f  53 65 74 49 63 6f 6e 53  |. "Wimp_SetIconS|
00028ce0  74 61 74 65 22 2c 2c 62  6c 6b 25 0d 15 6a 0b 20  |tate",,blk%..j. |
00028cf0  20 49 25 2b 3d 34 0d 15  6b 05 ce 0d 15 6c 20 f2  | I%+=4..k....l .|
00028d00  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 52  |shell_HeapBlockR|
00028d10  65 74 75 72 6e 28 62 6c  6b 25 29 0d 15 6d 05 e1  |eturn(blk%)..m..|
00028d20  0d 15 6e 05 3a 0d 15 6f  22 2a 7c 53 74 6f 70 20  |..n.:..o"*|Stop |
00028d30  50 52 4f 43 73 68 65 6c  6c 5f 49 63 6f 6e 53 65  |PROCshell_IconSe|
00028d40  6c 65 63 74 41 6c 6c 0d  15 70 25 2a 7c 53 74 61  |lectAll..p%*|Sta|
00028d50  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 49 63 6f  |rt PROCshell_Ico|
00028d60  6e 44 65 73 65 6c 65 63  74 41 6c 6c 0d 15 71 21  |nDeselectAll..q!|
00028d70  dd 20 f2 73 68 65 6c 6c  5f 49 63 6f 6e 44 65 73  |. .shell_IconDes|
00028d80  65 6c 65 63 74 41 6c 6c  28 77 68 25 29 0d 15 72  |electAll(wh%)..r|
00028d90  0d ea 20 62 6c 6b 25 2c  49 25 0d 15 73 24 62 6c  |.. blk%,I%..s$bl|
00028da0  6b 25 3d a4 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |k%=.shell_HeapBl|
00028db0  6f 63 6b 46 65 74 63 68  28 32 30 30 30 29 0d 15  |ockFetch(2000)..|
00028dc0  74 30 49 25 3d 62 6c 6b  25 2b 26 34 30 3a 21 62  |t0I%=blk%+&40:!b|
00028dd0  6c 6b 25 3d 77 68 25 3a  62 6c 6b 25 21 38 3d 30  |lk%=wh%:blk%!8=0|
00028de0  3a 62 6c 6b 25 21 31 32  3d 31 3c 3c 32 31 0d 15  |:blk%!12=1<<21..|
00028df0  75 2c c8 99 20 22 57 69  6d 70 5f 57 68 69 63 68  |u,.. "Wimp_Which|
00028e00  49 63 6f 6e 22 2c 21 62  6c 6b 25 2c 49 25 2c 35  |Icon",!blk%,I%,5|
00028e10  3c 3c 32 31 2c 31 3c 3c  32 31 0d 15 76 0d c8 95  |<<21,1<<21..v...|
00028e20  20 21 49 25 3e 2d 31 0d  15 77 10 20 20 62 6c 6b  | !I%>-1..w.  blk|
00028e30  25 21 34 3d 21 49 25 0d  15 78 22 20 20 c8 99 20  |%!4=!I%..x"  .. |
00028e40  22 57 69 6d 70 5f 53 65  74 49 63 6f 6e 53 74 61  |"Wimp_SetIconSta|
00028e50  74 65 22 2c 2c 62 6c 6b  25 0d 15 79 0b 20 20 49  |te",,blk%..y.  I|
00028e60  25 2b 3d 34 0d 15 7a 05  ce 0d 15 7b 20 f2 73 68  |%+=4..z....{ .sh|
00028e70  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 52 65 74  |ell_HeapBlockRet|
00028e80  75 72 6e 28 62 6c 6b 25  29 0d 15 7c 05 e1 0d 15  |urn(blk%)..|....|
00028e90  7d 05 3a 0d 15 7e 24 2a  7c 53 74 6f 70 20 50 52  |}.:..~$*|Stop PR|
00028ea0  4f 43 73 68 65 6c 6c 5f  49 63 6f 6e 44 65 73 65  |OCshell_IconDese|
00028eb0  6c 65 63 74 41 6c 6c 0d  15 7f 04 0d 15 80 29 2a  |lectAll.......)*|
00028ec0  7c 53 74 61 72 74 20 50  52 4f 43 73 68 65 6c 6c  ||Start PROCshell|
00028ed0  5f 4d 65 73 73 61 67 65  5f 53 61 76 65 44 65 73  |_Message_SaveDes|
00028ee0  6b 74 6f 70 0d 15 81 24  dd 20 f2 73 68 65 6c 6c  |ktop...$. .shell|
00028ef0  5f 4d 65 73 73 61 67 65  5f 53 61 76 65 44 65 73  |_Message_SaveDes|
00028f00  6b 74 6f 70 28 51 25 29  0d 15 82 0b ea 20 62 6f  |ktop(Q%)..... bo|
00028f10  6f 74 24 0d 15 83 25 62  6f 6f 74 24 3d 22 52 75  |ot$...%boot$="Ru|
00028f20  6e 20 22 2b a4 73 68 65  6c 6c 5f 47 65 74 41 70  |n "+.shell_GetAp|
00028f30  70 44 69 72 2b bd 31 30  0d 15 84 25 c8 99 20 22  |pDir+.10...%.. "|
00028f40  4f 53 5f 47 42 50 42 22  2c 32 2c 51 25 21 32 30  |OS_GBPB",2,Q%!20|
00028f50  2c 62 6f 6f 74 24 2c a9  62 6f 6f 74 24 0d 15 85  |,boot$,.boot$...|
00028f60  05 e1 0d 15 86 05 3a 0d  15 87 28 2a 7c 53 74 6f  |......:...(*|Sto|
00028f70  70 20 50 52 4f 43 73 68  65 6c 6c 5f 4d 65 73 73  |p PROCshell_Mess|
00028f80  61 67 65 5f 53 61 76 65  44 65 73 6b 74 6f 70 0d  |age_SaveDesktop.|
00028f90  15 88 04 0d 15 89 22 2a  7c 53 74 61 72 74 20 50  |......"*|Start P|
00028fa0  52 4f 43 73 68 65 6c 6c  5f 4d 65 73 73 61 67 65  |ROCshell_Message|
00028fb0  73 49 6e 69 74 0d 15 8a  3e dd 20 f2 73 68 65 6c  |sInit...>. .shel|
00028fc0  6c 5f 4d 65 73 73 61 67  65 73 49 6e 69 74 28 66  |l_MessagesInit(f|
00028fd0  69 6c 65 6e 61 6d 65 24  2c f8 20 6d 5f 66 69 6c  |ilename$,. m_fil|
00028fe0  65 64 65 73 63 25 2c f8  20 6d 5f 62 75 66 66 65  |edesc%,. m_buffe|
00028ff0  72 25 29 0d 15 8b 12 ea  20 73 69 7a 65 25 2c 66  |r%)..... size%,f|
00029000  6c 61 67 73 25 0d 15 8c  07 ea 20 85 0d 15 8d 3c  |lags%..... ....<|
00029010  ee 20 85 20 ea 20 f7 20  85 3a 85 20 33 2c 22 43  |. . . . .:. 3,"C|
00029020  61 6e 6e 6f 74 20 6f 70  65 6e 20 6d 65 73 73 61  |annot open messa|
00029030  67 65 20 66 69 6c 65 20  27 22 2b 66 69 6c 65 6e  |ge file '"+filen|
00029040  61 6d 65 24 2b 22 27 22  0d 15 8e 39 c8 99 20 22  |ame$+"'"...9.. "|
00029050  4d 65 73 73 61 67 65 54  72 61 6e 73 5f 46 69 6c  |MessageTrans_Fil|
00029060  65 49 6e 66 6f 22 2c 2c  66 69 6c 65 6e 61 6d 65  |eInfo",,filename|
00029070  24 20 b8 20 66 6c 61 67  73 25 2c 2c 73 69 7a 65  |$ . flags%,,size|
00029080  25 0d 15 8f 47 e7 20 66  6c 61 67 73 25 20 80 20  |%...G. flags% . |
00029090  31 20 8c 20 6d 5f 62 75  66 66 65 72 25 3d 30 20  |1 . m_buffer%=0 |
000290a0  8b 20 6d 5f 62 75 66 66  65 72 25 3d a4 73 68 65  |. m_buffer%=.she|
000290b0  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 46 65 74 63  |ll_HeapBlockFetc|
000290c0  68 28 73 69 7a 65 25 29  0d 15 90 36 c8 99 20 22  |h(size%)...6.. "|
000290d0  4f 53 5f 4d 6f 64 75 6c  65 22 2c 36 2c 2c 2c 31  |OS_Module",6,,,1|
000290e0  37 2b a9 28 66 69 6c 65  6e 61 6d 65 24 29 20 b8  |7+.(filename$) .|
000290f0  20 2c 2c 6d 5f 66 69 6c  65 64 65 73 63 25 0d 15  | ,,m_filedesc%..|
00029100  91 1f 24 28 6d 5f 66 69  6c 65 64 65 73 63 25 2b  |..$(m_filedesc%+|
00029110  31 36 29 3d 66 69 6c 65  6e 61 6d 65 24 0d 15 92  |16)=filename$...|
00029120  39 c8 99 20 22 4d 65 73  73 61 67 65 54 72 61 6e  |9.. "MessageTran|
00029130  73 5f 4f 70 65 6e 46 69  6c 65 22 2c 6d 5f 66 69  |s_OpenFile",m_fi|
00029140  6c 65 64 65 73 63 25 2c  6d 5f 66 69 6c 65 64 65  |ledesc%,m_filede|
00029150  73 63 25 2b 31 36 0d 15  93 15 2a 7c 69 66 64 65  |sc%+16....*|ifde|
00029160  66 20 54 72 61 63 65 49  6e 69 74 0d 15 94 4f f2  |f TraceInit...O.|
00029170  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 4d  |shell_Tracef0("M|
00029180  65 73 73 61 67 65 73 49  6e 69 74 3a 4d 65 73 73  |essagesInit:Mess|
00029190  61 67 65 20 72 65 73 6f  75 72 63 65 20 66 69 6c  |age resource fil|
000291a0  65 20 27 22 2b 66 69 6c  65 6e 61 6d 65 24 2b 22  |e '"+filename$+"|
000291b0  27 20 6c 6f 61 64 65 64  22 29 0d 15 95 0b 2a 7c  |' loaded")....*||
000291c0  65 6e 64 69 66 0d 15 96  05 e1 0d 15 97 05 3a 0d  |endif.........:.|
000291d0  15 98 21 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |..!*|Stop PROCsh|
000291e0  65 6c 6c 5f 4d 65 73 73  61 67 65 73 49 6e 69 74  |ell_MessagesInit|
000291f0  0d 15 99 04 0d 15 9a 21  2a 7c 53 74 61 72 74 20  |.......!*|Start |
00029200  46 4e 73 68 65 6c 6c 5f  50 72 69 6e 74 65 72 4f  |FNshell_PrinterO|
00029210  6e 4c 69 6e 65 0d 15 9b  1a dd 20 a4 73 68 65 6c  |nLine..... .shel|
00029220  6c 5f 50 72 69 6e 74 65  72 4f 6e 4c 69 6e 65 0d  |l_PrinterOnLine.|
00029230  15 9c 14 ea 20 69 6e 62  75 66 25 2c 6f 6e 6c 69  |.... inbuf%,onli|
00029240  6e 65 25 0d 15 9d 10 69  6e 62 75 66 25 3d 96 28  |ne%....inbuf%=.(|
00029250  2d 34 29 0d 15 9e 12 ef  32 2c 31 2c 30 2c 31 2c  |-4).....2,1,0,1,|
00029260  30 2c 31 2c 30 0d 15 9f  10 d1 3d 30 3a f5 3a fd  |0,1,0.....=0:.:.|
00029270  20 91 3e 33 30 0d 15 a0  1b 6f 6e 6c 69 6e 65 25  | .>30....online%|
00029280  3d ac 28 96 28 2d 34 29  3c 69 6e 62 75 66 25 29  |=.(.(-4)<inbuf%)|
00029290  0d 15 a1 0b 2a 46 58 32  31 2c 33 0d 15 a2 06 ef  |....*FX21,3.....|
000292a0  33 0d 15 a3 0c 3d 6f 6e  6c 69 6e 65 25 0d 15 a4  |3....=online%...|
000292b0  05 3a 0d 15 a5 20 2a 7c  53 74 6f 70 20 46 4e 73  |.:... *|Stop FNs|
000292c0  68 65 6c 6c 5f 50 72 69  6e 74 65 72 4f 6e 4c 69  |hell_PrinterOnLi|
000292d0  6e 65 0d 15 a6 04 0d 15  a7 27 2a 7c 53 74 61 72  |ne.......'*|Star|
000292e0  74 20 50 52 4f 43 73 68  65 6c 6c 5f 41 74 74 61  |t PROCshell_Atta|
000292f0  63 68 42 75 6d 70 48 61  6e 64 6c 65 72 0d 15 a8  |chBumpHandler...|
00029300  65 dd 20 f2 73 68 65 6c  6c 5f 41 74 74 61 63 68  |e. .shell_Attach|
00029310  42 75 6d 70 48 61 6e 64  6c 65 72 28 77 68 25 2c  |BumpHandler(wh%,|
00029320  69 68 25 2c 69 6e 63 72  25 2c 64 65 63 72 25 2c  |ih%,incr%,decr%,|
00029330  6c 5f 6c 69 6d 69 74 25  2c 75 5f 6c 69 6d 69 74  |l_limit%,u_limit|
00029340  25 2c 73 74 65 70 25 2c  77 72 61 70 25 2c 64 69  |%,step%,wrap%,di|
00029350  73 70 5f 66 6e 24 2c 64  65 63 6f 64 65 5f 66 6e  |sp_fn$,decode_fn|
00029360  24 29 0d 15 a9 30 ea 20  65 5f 62 6c 6b 25 2c 6f  |$)...0. e_blk%,o|
00029370  66 66 73 65 74 25 2c 74  65 6d 70 25 2c 74 65 6d  |ffset%,temp%,tem|
00029380  70 32 25 2c 62 75 6d 70  5f 69 6e 66 6f 5f 62 6c  |p2%,bump_info_bl|
00029390  6b 25 0d 15 aa 04 0d 15  ab 2a f4 20 66 6f 72 6d  |k%.......*. form|
000293a0  61 74 20 6f 66 20 62 75  6d 70 20 68 61 6e 64 6c  |at of bump handl|
000293b0  65 72 20 65 76 65 6e 74  20 62 6c 6f 63 6b 2e 2e  |er event block..|
000293c0  0d 15 ac 17 f4 20 2b 30  30 20 77 69 6e 64 6f 77  |..... +00 window|
000293d0  20 68 61 6e 64 6c 65 0d  15 ad 1a f4 20 2b 30 34  | handle..... +04|
000293e0  20 62 75 6d 70 20 69 63  6f 6e 20 68 61 6e 64 6c  | bump icon handl|
000293f0  65 0d 15 ae 27 f4 20 2b  30 38 20 73 74 65 70 20  |e...'. +08 step |
00029400  73 69 7a 65 20 28 2d 76  65 20 66 6f 72 20 64 65  |size (-ve for de|
00029410  63 72 20 69 63 6f 6e 29  0d 15 af 26 f4 20 2b 31  |cr icon)...&. +1|
00029420  32 20 70 6f 69 6e 74 65  72 20 74 6f 20 73 65 63  |2 pointer to sec|
00029430  6f 6e 64 20 69 6e 66 6f  20 62 6c 6f 63 6b 0d 15  |ond info block..|
00029440  b0 05 f4 0d 15 b1 1e f4  20 66 6f 72 6d 61 74 20  |........ format |
00029450  6f 66 20 73 65 63 6f 6e  64 20 62 6c 6f 63 6b 2e  |of second block.|
00029460  2e 0d 15 b2 1d f4 20 2b  30 30 20 64 69 73 70 6c  |...... +00 displ|
00029470  61 79 20 69 63 6f 6e 20  68 61 6e 64 6c 65 0d 15  |ay icon handle..|
00029480  b3 15 f4 20 2b 30 34 20  6c 6f 77 65 72 20 6c 69  |... +04 lower li|
00029490  6d 69 74 0d 15 b4 15 f4  20 2b 30 38 20 75 70 70  |mit..... +08 upp|
000294a0  65 72 20 6c 69 6d 69 74  0d 15 b5 25 f4 20 2b 31  |er limit...%. +1|
000294b0  32 20 70 6f 69 6e 74 65  72 20 74 6f 20 64 69 73  |2 pointer to dis|
000294c0  70 6c 61 79 20 66 75 6e  63 74 69 6f 6e 0d 15 b6  |play function...|
000294d0  2c f4 20 2b 31 36 20 70  6f 69 6e 74 65 72 20 74  |,. +16 pointer t|
000294e0  6f 20 64 69 73 70 6c 61  79 20 64 65 63 6f 64 65  |o display decode|
000294f0  20 66 75 6e 63 74 69 6f  6e 0d 15 b7 18 f4 20 2b  | function..... +|
00029500  32 30 20 66 6c 61 67 73  20 28 31 20 62 79 74 65  |20 flags (1 byte|
00029510  29 0d 15 b8 1a f4 20 20  20 20 20 62 69 74 20 30  |).....     bit 0|
00029520  20 77 72 61 70 20 75 70  70 65 72 0d 15 b9 1a f4  | wrap upper.....|
00029530  20 20 20 20 20 62 69 74  20 31 20 77 72 61 70 20  |     bit 1 wrap |
00029540  6c 6f 77 65 72 0d 15 ba  04 0d 15 bb 28 f4 20 64  |lower.......(. d|
00029550  65 61 6c 20 77 69 74 68  20 69 6e 63 72 25 20 69  |eal with incr% i|
00029560  63 6f 6e 20 65 76 65 6e  74 20 66 69 72 73 74 2e  |con event first.|
00029570  2e 0d 15 bc 3e 6f 66 66  73 65 74 25 3d a4 73 68  |....>offset%=.sh|
00029580  65 6c 6c 5f 47 65 74 45  76 65 6e 74 4c 69 73 74  |ell_GetEventList|
00029590  4f 66 66 73 65 74 32 28  77 68 25 2c 69 6e 63 72  |Offset2(wh%,incr|
000295a0  25 2c 5f 55 25 2b 31 30  34 2c 31 36 2c b9 29 0d  |%,_U%+104,16,.).|
000295b0  15 bd 34 65 5f 62 6c 6b  25 3d 5f 55 25 21 31 30  |..4e_blk%=_U%!10|
000295c0  34 2b 6f 66 66 73 65 74  25 3a f4 20 70 6f 69 6e  |4+offset%:. poin|
000295d0  74 65 72 20 74 6f 20 65  76 65 6e 74 20 6c 69 73  |ter to event lis|
000295e0  74 2e 2e 0d 15 be 04 0d  15 bf 30 20 20 65 5f 62  |t.........0  e_b|
000295f0  6c 6b 25 21 30 3d 77 68  25 3a 65 5f 62 6c 6b 25  |lk%!0=wh%:e_blk%|
00029600  21 34 3d 69 6e 63 72 25  3a 65 5f 62 6c 6b 25 21  |!4=incr%:e_blk%!|
00029610  38 3d 73 74 65 70 25 0d  15 c0 29 20 20 65 5f 62  |8=step%...)  e_b|
00029620  6c 6b 25 21 31 32 3d a4  73 68 65 6c 6c 5f 48 65  |lk%!12=.shell_He|
00029630  61 70 42 6c 6f 63 6b 46  65 74 63 68 28 32 34 29  |apBlockFetch(24)|
00029640  0d 15 c1 1e 20 20 62 75  6d 70 5f 69 6e 66 6f 5f  |....  bump_info_|
00029650  62 6c 6b 25 3d 65 5f 62  6c 6b 25 21 31 32 0d 15  |blk%=e_blk%!12..|
00029660  c2 1a 20 20 62 75 6d 70  5f 69 6e 66 6f 5f 62 6c  |..  bump_info_bl|
00029670  6b 25 21 30 3d 69 68 25  0d 15 c3 1f 20 20 62 75  |k%!0=ih%....  bu|
00029680  6d 70 5f 69 6e 66 6f 5f  62 6c 6b 25 21 34 3d 6c  |mp_info_blk%!4=l|
00029690  5f 6c 69 6d 69 74 25 0d  15 c4 1f 20 20 62 75 6d  |_limit%....  bum|
000296a0  70 5f 69 6e 66 6f 5f 62  6c 6b 25 21 38 3d 75 5f  |p_info_blk%!8=u_|
000296b0  6c 69 6d 69 74 25 0d 15  c5 15 20 20 e7 20 a9 64  |limit%....  . .d|
000296c0  69 73 70 5f 66 6e 24 3e  30 20 8c 0d 15 c6 3e 20  |isp_fn$>0 ....> |
000296d0  20 20 20 62 75 6d 70 5f  69 6e 66 6f 5f 62 6c 6b  |   bump_info_blk|
000296e0  25 21 31 32 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |%!12=.shell_Heap|
000296f0  42 6c 6f 63 6b 46 65 74  63 68 28 28 a9 64 69 73  |BlockFetch((.dis|
00029700  70 5f 66 6e 24 29 2b 31  29 0d 15 c7 31 20 20 20  |p_fn$)+1)...1   |
00029710  20 74 65 6d 70 32 25 3d  62 75 6d 70 5f 69 6e 66  | temp2%=bump_inf|
00029720  6f 5f 62 6c 6b 25 21 31  32 3a 24 74 65 6d 70 32  |o_blk%!12:$temp2|
00029730  25 3d 64 69 73 70 5f 66  6e 24 0d 15 c8 07 20 20  |%=disp_fn$....  |
00029740  cc 0d 15 c9 1b 20 20 20  20 62 75 6d 70 5f 69 6e  |.....    bump_in|
00029750  66 6f 5f 62 6c 6b 25 21  31 32 3d 30 0d 15 ca 07  |fo_blk%!12=0....|
00029760  20 20 cd 0d 15 cb 17 20  20 e7 20 a9 64 65 63 6f  |  .....  . .deco|
00029770  64 65 5f 66 6e 24 3e 30  20 8c 0d 15 cc 40 20 20  |de_fn$>0 ....@  |
00029780  20 20 62 75 6d 70 5f 69  6e 66 6f 5f 62 6c 6b 25  |  bump_info_blk%|
00029790  21 31 36 3d a4 73 68 65  6c 6c 5f 48 65 61 70 42  |!16=.shell_HeapB|
000297a0  6c 6f 63 6b 46 65 74 63  68 28 28 a9 64 65 63 6f  |lockFetch((.deco|
000297b0  64 65 5f 66 6e 24 29 2b  31 29 0d 15 cd 33 20 20  |de_fn$)+1)...3  |
000297c0  20 20 74 65 6d 70 32 25  3d 62 75 6d 70 5f 69 6e  |  temp2%=bump_in|
000297d0  66 6f 5f 62 6c 6b 25 21  31 36 3a 24 74 65 6d 70  |fo_blk%!16:$temp|
000297e0  32 25 3d 64 65 63 6f 64  65 5f 66 6e 24 0d 15 ce  |2%=decode_fn$...|
000297f0  07 20 20 cc 0d 15 cf 1b  20 20 20 20 62 75 6d 70  |.  .....    bump|
00029800  5f 69 6e 66 6f 5f 62 6c  6b 25 21 31 36 3d 30 0d  |_info_blk%!16=0.|
00029810  15 d0 07 20 20 cd 0d 15  d1 3c 20 20 e7 20 77 72  |...  ....<  . wr|
00029820  61 70 25 3d 2d 31 20 8c  20 62 75 6d 70 5f 69 6e  |ap%=-1 . bump_in|
00029830  66 6f 5f 62 6c 6b 25 21  32 30 3d 31 20 8b 20 62  |fo_blk%!20=1 . b|
00029840  75 6d 70 5f 69 6e 66 6f  5f 62 6c 6b 25 21 32 30  |ump_info_blk%!20|
00029850  3d 30 0d 15 d2 04 0d 15  d3 40 20 20 6f 66 66 73  |=0.......@  offs|
00029860  65 74 25 3d a4 73 68 65  6c 6c 5f 47 65 74 45 76  |et%=.shell_GetEv|
00029870  65 6e 74 4c 69 73 74 4f  66 66 73 65 74 32 28 77  |entListOffset2(w|
00029880  68 25 2c 64 65 63 72 25  2c 5f 55 25 2b 31 30 34  |h%,decr%,_U%+104|
00029890  2c 31 36 2c b9 29 0d 15  d4 36 20 20 65 5f 62 6c  |,16,.)...6  e_bl|
000298a0  6b 25 3d 5f 55 25 21 31  30 34 2b 6f 66 66 73 65  |k%=_U%!104+offse|
000298b0  74 25 3a f4 20 70 6f 69  6e 74 65 72 20 74 6f 20  |t%:. pointer to |
000298c0  65 76 65 6e 74 20 6c 69  73 74 2e 2e 0d 15 d5 04  |event list......|
000298d0  0d 15 d6 35 20 20 65 5f  62 6c 6b 25 21 30 3d 77  |...5  e_blk%!0=w|
000298e0  68 25 3a 65 5f 62 6c 6b  25 21 34 3d 64 65 63 72  |h%:e_blk%!4=decr|
000298f0  25 3a 65 5f 62 6c 6b 25  21 38 3d 73 74 65 70 25  |%:e_blk%!8=step%|
00029900  2a 28 2d 31 29 0d 15 d7  1e 20 20 65 5f 62 6c 6b  |*(-1)....  e_blk|
00029910  25 21 31 32 3d 62 75 6d  70 5f 69 6e 66 6f 5f 62  |%!12=bump_info_b|
00029920  6c 6b 25 0d 15 d8 04 0d  15 d9 05 e1 0d 15 da 05  |lk%.............|
00029930  3a 0d 15 db 26 2a 7c 53  74 6f 70 20 50 52 4f 43  |:...&*|Stop PROC|
00029940  73 68 65 6c 6c 5f 41 74  74 61 63 68 42 75 6d 70  |shell_AttachBump|
00029950  48 61 6e 64 6c 65 72 0d  15 dc 04 0d 15 dd 25 2a  |Handler.......%*|
00029960  7c 53 74 61 72 74 20 50  52 4f 43 73 68 65 6c 6c  ||Start PROCshell|
00029970  5f 48 61 6e 64 6c 65 42  75 6d 70 49 63 6f 6e 73  |_HandleBumpIcons|
00029980  0d 15 de 36 dd 20 f2 73  68 65 6c 6c 5f 48 61 6e  |...6. .shell_Han|
00029990  64 6c 65 42 75 6d 70 49  63 6f 6e 73 28 6f 66 66  |dleBumpIcons(off|
000299a0  73 65 74 25 2c 77 68 25  2c 69 68 25 2c 5f 62 75  |set%,wh%,ih%,_bu|
000299b0  74 74 6f 6e 25 29 0d 15  df 38 ea 20 64 69 73 70  |tton%)...8. disp|
000299c0  6c 61 79 5f 69 68 25 2c  69 6e 66 6f 5f 62 6c 6b  |lay_ih%,info_blk|
000299d0  25 2c 65 5f 62 6c 6b 25  2c 63 75 72 72 5f 76 61  |%,e_blk%,curr_va|
000299e0  6c 25 2c 5f 74 65 6d 70  24 2c 66 6e 32 25 0d 15  |l%,_temp$,fn2%..|
000299f0  e0 12 ea 20 6e 65 77 5f  76 61 6c 25 2c 66 6e 25  |... new_val%,fn%|
00029a00  0d 15 e1 15 e7 20 5f 62  75 74 74 6f 6e 25 20 3c  |..... _button% <|
00029a10  3e 20 32 20 8c 0d 15 e2  1c 20 20 65 5f 62 6c 6b  |> 2 .....  e_blk|
00029a20  25 3d 5f 55 25 21 31 30  34 2b 6f 66 66 73 65 74  |%=_U%!104+offset|
00029a30  25 0d 15 e3 2d 20 20 5f  55 25 21 32 38 38 3d 77  |%...-  _U%!288=w|
00029a40  68 25 3a 5f 55 25 21 32  39 32 3d 69 68 25 3a 5f  |h%:_U%!292=ih%:_|
00029a50  55 25 21 32 39 36 3d 6f  66 66 73 65 74 25 0d 15  |U%!296=offset%..|
00029a60  e4 21 20 20 f4 20 65 5f  62 6c 6b 25 21 38 20 68  |.!  . e_blk%!8 h|
00029a70  6f 6c 64 73 20 73 74 65  70 20 76 61 6c 75 65 0d  |olds step value.|
00029a80  15 e5 19 20 20 69 6e 66  6f 5f 62 6c 6b 25 3d 65  |...  info_blk%=e|
00029a90  5f 62 6c 6b 25 21 31 32  0d 15 e6 2e 20 20 f4 20  |_blk%!12....  . |
00029aa0  69 6e 66 6f 5f 62 6c 6b  25 21 30 20 20 68 6f 6c  |info_blk%!0  hol|
00029ab0  64 73 20 64 69 73 70 6c  61 79 20 69 63 6f 6e 20  |ds display icon |
00029ac0  68 61 6e 64 6c 65 0d 15  e7 26 20 20 f4 20 69 6e  |handle...&  . in|
00029ad0  66 6f 5f 62 6c 6b 25 21  34 20 20 68 6f 6c 64 73  |fo_blk%!4  holds|
00029ae0  20 6c 6f 77 65 72 20 6c  69 6d 69 74 0d 15 e8 26  | lower limit...&|
00029af0  20 20 f4 20 69 6e 66 6f  5f 62 6c 6b 25 21 38 20  |  . info_blk%!8 |
00029b00  20 68 6f 6c 64 73 20 75  70 70 65 72 20 6c 69 6d  | holds upper lim|
00029b10  69 74 0d 15 e9 24 20 20  f4 20 69 6e 66 6f 5f 62  |it...$  . info_b|
00029b20  6c 6b 25 21 32 30 20 68  6f 6c 64 73 20 77 72 61  |lk%!20 holds wra|
00029b30  70 20 66 6c 61 67 0d 15  ea 17 20 20 66 6e 32 25  |p flag....  fn2%|
00029b40  3d 69 6e 66 6f 5f 62 6c  6b 25 21 31 36 0d 15 eb  |=info_blk%!16...|
00029b50  11 20 20 e7 20 66 6e 32  25 3c 3e 30 20 8c 0d 15  |.  . fn2%<>0 ...|
00029b60  ec 32 20 20 20 20 5f 74  65 6d 70 24 3d a4 73 68  |.2    _temp$=.sh|
00029b70  65 6c 6c 5f 49 63 6f 6e  47 65 74 44 61 74 61 28  |ell_IconGetData(|
00029b80  77 68 25 2c 69 6e 66 6f  5f 62 6c 6b 25 21 30 29  |wh%,info_blk%!0)|
00029b90  0d 15 ed 2a 20 20 20 20  63 75 72 72 5f 76 61 6c  |...*    curr_val|
00029ba0  25 3d a0 28 22 46 4e 22  2b 24 66 6e 32 25 2b 22  |%=.("FN"+$fn2%+"|
00029bb0  28 5f 74 65 6d 70 24 29  22 29 0d 15 ee 07 20 20  |(_temp$)")....  |
00029bc0  cc 0d 15 ef 38 20 20 20  20 63 75 72 72 5f 76 61  |....8    curr_va|
00029bd0  6c 25 3d bb 28 a4 73 68  65 6c 6c 5f 49 63 6f 6e  |l%=.(.shell_Icon|
00029be0  47 65 74 44 61 74 61 28  77 68 25 2c 69 6e 66 6f  |GetData(wh%,info|
00029bf0  5f 62 6c 6b 25 21 30 29  29 0d 15 f0 07 20 20 cd  |_blk%!0))....  .|
00029c00  0d 15 f1 14 20 20 e7 20  5f 62 75 74 74 6f 6e 25  |....  . _button%|
00029c10  3d 31 20 8c 0d 15 f2 2f  20 20 20 20 f4 20 62 75  |=1 ..../    . bu|
00029c20  74 74 6f 6e 20 69 73 20  41 44 4a 55 53 54 2c 20  |tton is ADJUST, |
00029c30  69 6e 76 65 72 74 20 73  74 65 70 20 76 61 6c 75  |invert step valu|
00029c40  65 2e 2e 0d 15 f3 2d 20  20 20 20 5f 6e 65 77 5f  |e.....-    _new_|
00029c50  76 61 6c 25 3d 63 75 72  72 5f 76 61 6c 25 2b 28  |val%=curr_val%+(|
00029c60  28 65 5f 62 6c 6b 25 21  38 29 2a 28 2d 31 29 29  |(e_blk%!8)*(-1))|
00029c70  0d 15 f4 07 20 20 cc 0d  15 f5 24 20 20 20 20 5f  |....  ....$    _|
00029c80  6e 65 77 5f 76 61 6c 25  3d 63 75 72 72 5f 76 61  |new_val%=curr_va|
00029c90  6c 25 2b 65 5f 62 6c 6b  25 21 38 0d 15 f6 07 20  |l%+e_blk%!8.... |
00029ca0  20 cd 0d 15 f7 18 20 20  e7 20 69 6e 66 6f 5f 62  | .....  . info_b|
00029cb0  6c 6b 25 21 32 30 3d 30  20 8c 0d 15 f8 13 20 20  |lk%!20=0 .....  |
00029cc0  20 20 f4 20 6e 6f 20 77  72 61 70 2e 2e 0d 15 f9  |  . no wrap.....|
00029cd0  37 20 20 20 20 e7 20 5f  6e 65 77 5f 76 61 6c 25  |7    . _new_val%|
00029ce0  3e 69 6e 66 6f 5f 62 6c  6b 25 21 38 20 8c 20 5f  |>info_blk%!8 . _|
00029cf0  6e 65 77 5f 76 61 6c 25  3d 69 6e 66 6f 5f 62 6c  |new_val%=info_bl|
00029d00  6b 25 21 38 0d 15 fa 37  20 20 20 20 e7 20 5f 6e  |k%!8...7    . _n|
00029d10  65 77 5f 76 61 6c 25 3c  69 6e 66 6f 5f 62 6c 6b  |ew_val%<info_blk|
00029d20  25 21 34 20 8c 20 5f 6e  65 77 5f 76 61 6c 25 3d  |%!4 . _new_val%=|
00029d30  69 6e 66 6f 5f 62 6c 6b  25 21 34 0d 15 fb 07 20  |info_blk%!4.... |
00029d40  20 cc 0d 15 fc 10 20 20  20 20 f4 20 77 72 61 70  | .....    . wrap|
00029d50  2e 2e 0d 15 fd 37 20 20  20 20 e7 20 5f 6e 65 77  |.....7    . _new|
00029d60  5f 76 61 6c 25 3e 69 6e  66 6f 5f 62 6c 6b 25 21  |_val%>info_blk%!|
00029d70  38 20 8c 20 5f 6e 65 77  5f 76 61 6c 25 3d 69 6e  |8 . _new_val%=in|
00029d80  66 6f 5f 62 6c 6b 25 21  34 0d 15 fe 37 20 20 20  |fo_blk%!4...7   |
00029d90  20 e7 20 5f 6e 65 77 5f  76 61 6c 25 3c 69 6e 66  | . _new_val%<inf|
00029da0  6f 5f 62 6c 6b 25 21 34  20 8c 20 5f 6e 65 77 5f  |o_blk%!4 . _new_|
00029db0  76 61 6c 25 3d 69 6e 66  6f 5f 62 6c 6b 25 21 38  |val%=info_blk%!8|
00029dc0  0d 15 ff 07 20 20 cd 0d  16 00 16 20 20 66 6e 25  |....  .....  fn%|
00029dd0  3d 69 6e 66 6f 5f 62 6c  6b 25 21 31 32 0d 16 01  |=info_blk%!12...|
00029de0  10 20 20 e7 20 66 6e 25  3c 3e 30 20 8c 0d 16 02  |.  . fn%<>0 ....|
00029df0  35 20 20 20 20 5f 6e 65  77 5f 76 61 6c 24 3d a0  |5    _new_val$=.|
00029e00  28 22 46 4e 22 2b 24 66  6e 25 2b 22 28 5f 6e 65  |("FN"+$fn%+"(_ne|
00029e10  77 5f 76 61 6c 25 2c 5f  62 75 74 74 6f 6e 25 29  |w_val%,_button%)|
00029e20  22 29 0d 16 03 07 20 20  cc 0d 16 04 1c 20 20 20  |")....  .....   |
00029e30  20 5f 6e 65 77 5f 76 61  6c 24 3d c3 5f 6e 65 77  | _new_val$=._new|
00029e40  5f 76 61 6c 25 0d 16 05  07 20 20 cd 0d 16 06 1e  |_val%....  .....|
00029e50  20 20 e7 20 5f 6e 65 77  5f 76 61 6c 25 3c 3e 63  |  . _new_val%<>c|
00029e60  75 72 72 5f 76 61 6c 25  20 8c 0d 16 07 38 20 20  |urr_val% ....8  |
00029e70  20 20 f2 73 68 65 6c 6c  5f 49 63 6f 6e 50 75 74  |  .shell_IconPut|
00029e80  44 61 74 61 28 77 68 25  2c 69 6e 66 6f 5f 62 6c  |Data(wh%,info_bl|
00029e90  6b 25 21 30 2c 5f 6e 65  77 5f 76 61 6c 24 2c 2d  |k%!0,_new_val$,-|
00029ea0  31 29 0d 16 08 07 20 20  cd 0d 16 09 05 cd 0d 16  |1)....  ........|
00029eb0  0a 05 e1 0d 16 0b 05 3a  0d 16 0c 24 2a 7c 53 74  |.......:...$*|St|
00029ec0  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 48 61 6e  |op PROCshell_Han|
00029ed0  64 6c 65 42 75 6d 70 49  63 6f 6e 73 0d 16 0d 04  |dleBumpIcons....|
00029ee0  0d 16 0e 27 2a 7c 53 74  61 72 74 20 46 4e 73 68  |...'*|Start FNsh|
00029ef0  65 6c 6c 5f 57 69 6e 64  6f 77 53 65 74 53 70 72  |ell_WindowSetSpr|
00029f00  69 74 65 41 72 65 61 0d  16 0f 30 dd 20 a4 73 68  |iteArea...0. .sh|
00029f10  65 6c 6c 5f 57 69 6e 64  6f 77 53 65 74 53 70 72  |ell_WindowSetSpr|
00029f20  69 74 65 41 72 65 61 28  68 25 2c 53 70 72 69 74  |iteArea(h%,Sprit|
00029f30  65 41 72 65 61 25 29 0d  16 10 20 ea 20 62 6c 6b  |eArea%)... . blk|
00029f40  25 2c 6e 65 77 5f 68 61  6e 64 6c 65 25 2c 69 63  |%,new_handle%,ic|
00029f50  6f 6e 25 2c 69 62 25 0d  16 11 4b 62 6c 6b 25 20  |on%,ib%...Kblk% |
00029f60  20 3d 20 a4 73 68 65 6c  6c 5f 48 65 61 70 42 6c  | = .shell_HeapBl|
00029f70  6f 63 6b 46 65 74 63 68  28 31 30 30 20 2b 20 28  |ockFetch(100 + (|
00029f80  a4 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 43 6f 75  |.shell_WindowCou|
00029f90  6e 74 49 63 6f 6e 73 28  68 25 29 20 2a 20 33 32  |ntIcons(h%) * 32|
00029fa0  29 29 0d 16 12 0e 21 62  6c 6b 25 20 3d 20 68 25  |))....!blk% = h%|
00029fb0  0d 16 13 21 c8 99 20 22  57 69 6d 70 5f 47 65 74  |...!.. "Wimp_Get|
00029fc0  57 69 6e 64 6f 77 49 6e  66 6f 22 2c 2c 62 6c 6b  |WindowInfo",,blk|
00029fd0  25 0d 16 14 19 62 6c 6b  25 21 36 38 20 3d 20 53  |%....blk%!68 = S|
00029fe0  70 72 69 74 65 41 72 65  61 25 0d 16 15 3b f2 73  |priteArea%...;.s|
00029ff0  68 65 6c 6c 5f 49 63 6f  6e 53 65 74 53 70 72 69  |hell_IconSetSpri|
0002a000  74 65 41 72 65 61 28 62  6c 6b 25 21 36 30 2c 62  |teArea(blk%!60,b|
0002a010  6c 6b 25 20 2b 20 37 36  2c 53 70 72 69 74 65 41  |lk% + 76,SpriteA|
0002a020  72 65 61 25 29 0d 16 16  15 e7 20 28 62 6c 6b 25  |rea%)..... (blk%|
0002a030  21 38 38 29 20 3e 20 30  20 8c 0d 16 17 21 20 20  |!88) > 0 ....!  |
0002a040  e3 20 69 63 6f 6e 25 20  3d 20 30 20 b8 20 28 62  |. icon% = 0 . (b|
0002a050  6c 6b 25 21 38 38 29 20  2d 20 31 0d 16 18 24 20  |lk%!88) - 1...$ |
0002a060  20 20 20 69 62 25 20 3d  20 62 6c 6b 25 20 2b 20  |   ib% = blk% + |
0002a070  39 32 20 2b 20 69 63 6f  6e 25 20 2a 20 33 32 0d  |92 + icon% * 32.|
0002a080  16 19 3d 20 20 20 20 f2  73 68 65 6c 6c 5f 49 63  |..=    .shell_Ic|
0002a090  6f 6e 53 65 74 53 70 72  69 74 65 41 72 65 61 28  |onSetSpriteArea(|
0002a0a0  69 62 25 21 31 36 2c 69  62 25 20 2b 20 32 30 2c  |ib%!16,ib% + 20,|
0002a0b0  53 70 72 69 74 65 41 72  65 61 25 29 0d 16 1a 0d  |SpriteArea%)....|
0002a0c0  20 20 ed 20 69 63 6f 6e  25 0d 16 1b 05 cd 0d 16  |  . icon%.......|
0002a0d0  1c 20 c8 99 20 22 57 69  6d 70 5f 44 65 6c 65 74  |. .. "Wimp_Delet|
0002a0e0  65 57 69 6e 64 6f 77 22  2c 2c 62 6c 6b 25 0d 16  |eWindow",,blk%..|
0002a0f0  1d 32 c8 99 20 22 57 69  6d 70 5f 43 72 65 61 74  |.2.. "Wimp_Creat|
0002a100  65 57 69 6e 64 6f 77 22  2c 2c 62 6c 6b 25 20 2b  |eWindow",,blk% +|
0002a110  20 34 20 b8 20 6e 65 77  5f 68 61 6e 64 6c 65 25  | 4 . new_handle%|
0002a120  0d 16 1e 19 e7 20 6e 65  77 5f 68 61 6e 64 6c 65  |..... new_handle|
0002a130  25 20 3c 3e 20 68 25 20  8c 0d 16 1f 2f 20 20 f2  |% <> h% ..../  .|
0002a140  73 68 65 6c 6c 5f 55 70  64 61 74 65 57 69 6e 64  |shell_UpdateWind|
0002a150  6f 77 48 61 6e 64 6c 65  28 68 25 2c 6e 65 77 5f  |owHandle(h%,new_|
0002a160  68 61 6e 64 6c 65 25 29  0d 16 20 16 20 20 68 25  |handle%).. .  h%|
0002a170  20 3d 20 6e 65 77 5f 68  61 6e 64 6c 65 25 0d 16  | = new_handle%..|
0002a180  21 05 cd 0d 16 22 20 f2  73 68 65 6c 6c 5f 48 65  |!...." .shell_He|
0002a190  61 70 42 6c 6f 63 6b 52  65 74 75 72 6e 28 62 6c  |apBlockReturn(bl|
0002a1a0  6b 25 29 0d 16 23 08 3d  20 68 25 0d 16 24 05 3a  |k%)..#.= h%..$.:|
0002a1b0  0d 16 25 26 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |..%&*|Stop FNshe|
0002a1c0  6c 6c 5f 57 69 6e 64 6f  77 53 65 74 53 70 72 69  |ll_WindowSetSpri|
0002a1d0  74 65 41 72 65 61 0d 16  26 04 0d 16 27 27 2a 7c  |teArea..&...''*||
0002a1e0  53 74 61 72 74 20 50 52  4f 43 73 68 65 6c 6c 5f  |Start PROCshell_|
0002a1f0  49 63 6f 6e 53 65 74 53  70 72 69 74 65 41 72 65  |IconSetSpriteAre|
0002a200  61 0d 16 28 32 dd 20 f2  73 68 65 6c 6c 5f 49 63  |a..(2. .shell_Ic|
0002a210  6f 6e 53 65 74 53 70 72  69 74 65 41 72 65 61 28  |onSetSpriteArea(|
0002a220  66 6c 61 67 73 25 2c 64  61 74 61 25 2c 61 72 65  |flags%,data%,are|
0002a230  61 25 29 0d 16 29 33 e7  20 28 28 66 6c 61 67 73  |a%)..)3. ((flags|
0002a240  25 20 80 20 33 29 20 3d  20 32 29 20 80 20 28 28  |% . 3) = 2) . ((|
0002a250  66 6c 61 67 73 25 20 80  20 26 31 30 30 29 20 3c  |flags% . &100) <|
0002a260  3e 20 30 29 20 8c 0d 16  2a 15 20 20 64 61 74 61  |> 0) ...*.  data|
0002a270  25 21 34 20 3d 20 61 72  65 61 25 0d 16 2b 05 cd  |%!4 = area%..+..|
0002a280  0d 16 2c 05 e1 0d 16 2d  26 2a 7c 53 74 6f 70 20  |..,....-&*|Stop |
0002a290  50 52 4f 43 73 68 65 6c  6c 5f 49 63 6f 6e 53 65  |PROCshell_IconSe|
0002a2a0  74 53 70 72 69 74 65 41  72 65 61 0d 16 2e 04 0d  |tSpriteArea.....|
0002a2b0  16 2f 28 2a 7c 53 74 61  72 74 20 46 4e 73 68 65  |./(*|Start FNshe|
0002a2c0  6c 6c 5f 53 74 72 6f 6e  67 48 6c 70 49 73 41 76  |ll_StrongHlpIsAv|
0002a2d0  61 69 6c 61 62 6c 65 0d  16 30 21 dd 20 a4 73 68  |ailable..0!. .sh|
0002a2e0  65 6c 6c 5f 53 74 72 6f  6e 67 48 6c 70 49 73 41  |ell_StrongHlpIsA|
0002a2f0  76 61 69 6c 61 62 6c 65  0d 16 31 0e ea 20 72 25  |vailable..1.. r%|
0002a300  2c 62 75 66 66 25 0d 16  32 0a 72 25 20 3d 20 a3  |,buff%..2.r% = .|
0002a310  0d 16 33 18 e7 20 5f 55  25 21 31 30 30 20 80 20  |..3.. _U%!100 . |
0002a320  31 20 3c 3c 20 37 20 8c  0d 16 34 2c 20 20 f4 20  |1 << 7 ...4,  . |
0002a330  53 74 72 6f 6e 67 48 6c  70 20 69 6e 69 74 69 61  |StrongHlp initia|
0002a340  6c 69 73 61 74 69 6f 6e  20 73 75 63 63 65 65 64  |lisation succeed|
0002a350  65 64 2e 2e 0d 16 35 28  20 20 62 75 66 66 25 20  |ed....5(  buff% |
0002a360  3d 20 a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |= .shell_HeapBlo|
0002a370  63 6b 46 65 74 63 68 28  32 35 36 29 0d 16 36 38  |ckFetch(256)..68|
0002a380  20 20 72 25 20 20 20 20  3d 20 a4 73 68 65 6c 6c  |  r%    = .shell|
0002a390  5f 4f 53 56 61 72 45 78  69 73 74 73 28 62 75 66  |_OSVarExists(buf|
0002a3a0  66 25 2c 22 53 74 72 6f  6e 67 48 65 6c 70 24 44  |f%,"StrongHelp$D|
0002a3b0  69 72 22 29 0d 16 37 23  20 20 f2 73 68 65 6c 6c  |ir")..7#  .shell|
0002a3c0  5f 48 65 61 70 42 6c 6f  63 6b 52 65 74 75 72 6e  |_HeapBlockReturn|
0002a3d0  28 62 75 66 66 25 29 0d  16 38 05 cd 0d 16 39 08  |(buff%)..8....9.|
0002a3e0  3d 20 72 25 0d 16 3a 05  3a 0d 16 3b 27 2a 7c 53  |= r%..:.:..;'*|S|
0002a3f0  74 6f 70 20 46 4e 73 68  65 6c 6c 5f 53 74 72 6f  |top FNshell_Stro|
0002a400  6e 67 48 6c 70 49 73 41  76 61 69 6c 61 62 6c 65  |ngHlpIsAvailable|
0002a410  0d 16 3c 04 0d 16 3d 1b  2a 7c 53 74 61 72 74 20  |..<...=.*|Start |
0002a420  46 4e 73 68 65 6c 6c 5f  4d 65 6e 75 4e 65 77 0d  |FNshell_MenuNew.|
0002a430  16 3e 1c dd 20 a4 73 68  65 6c 6c 5f 4d 65 6e 75  |.>.. .shell_Menu|
0002a440  4e 65 77 28 74 69 74 6c  65 24 29 0d 16 3f 0d ea  |New(title$)..?..|
0002a450  20 68 61 6e 64 6c 65 25  0d 16 40 15 2a 7c 69 66  | handle%..@.*|if|
0002a460  64 65 66 20 54 72 61 63  65 49 6e 69 74 0d 16 41  |def TraceInit..A|
0002a470  40 f2 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  |@.shell_Tracef0(|
0002a480  22 4d 65 6e 75 4e 65 77  3a 43 72 65 61 74 69 6e  |"MenuNew:Creatin|
0002a490  67 20 6e 65 77 20 6d 65  6e 75 20 28 22 20 2b 20  |g new menu (" + |
0002a4a0  74 69 74 6c 65 24 20 2b  20 22 29 22 29 0d 16 42  |title$ + ")")..B|
0002a4b0  0b 2a 7c 65 6e 64 69 66  0d 16 43 27 c8 99 20 22  |.*|endif..C'.. "|
0002a4c0  4d 65 6e 75 55 74 69 6c  5f 4e 65 77 22 2c 2c 74  |MenuUtil_New",,t|
0002a4d0  69 74 6c 65 24 20 b8 20  68 61 6e 64 6c 65 25 0d  |itle$ . handle%.|
0002a4e0  16 44 0d 3d 20 68 61 6e  64 6c 65 25 0d 16 45 05  |.D.= handle%..E.|
0002a4f0  3a 0d 16 46 1a 2a 7c 53  74 6f 70 20 46 4e 73 68  |:..F.*|Stop FNsh|
0002a500  65 6c 6c 5f 4d 65 6e 75  4e 65 77 0d 16 47 04 0d  |ell_MenuNew..G..|
0002a510  16 48 1b 2a 7c 53 74 61  72 74 20 46 4e 73 68 65  |.H.*|Start FNshe|
0002a520  6c 6c 5f 4d 65 6e 75 41  64 64 0d 16 49 2b dd 20  |ll_MenuAdd..I+. |
0002a530  a4 73 68 65 6c 6c 5f 4d  65 6e 75 41 64 64 28 68  |.shell_MenuAdd(h|
0002a540  61 6e 64 6c 65 25 2c 69  74 65 6d 24 2c 73 65 6c  |andle%,item$,sel|
0002a550  5f 66 6e 24 29 0d 16 4a  11 ea 20 72 65 74 5f 68  |_fn$)..J.. ret_h|
0002a560  61 6e 64 6c 65 25 0d 16  4b 15 2a 7c 69 66 64 65  |andle%..K.*|ifde|
0002a570  66 20 54 72 61 63 65 49  6e 69 74 0d 16 4c 35 f2  |f TraceInit..L5.|
0002a580  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 4d  |shell_Tracef0("M|
0002a590  65 6e 75 41 64 64 3a 41  64 64 69 6e 67 20 69 74  |enuAdd:Adding it|
0002a5a0  65 6d 20 28 22 2b 69 74  65 6d 24 2b 22 29 22 29  |em ("+item$+")")|
0002a5b0  0d 16 4d 0b 2a 7c 65 6e  64 69 66 0d 16 4e 15 e7  |..M.*|endif..N..|
0002a5c0  20 73 65 6c 5f 66 6e 24  20 3c 3e 20 22 22 20 8c  | sel_fn$ <> "" .|
0002a5d0  0d 16 4f 3b 20 20 c8 99  20 22 4d 65 6e 75 55 74  |..O;  .. "MenuUt|
0002a5e0  69 6c 5f 41 64 64 22 2c  68 61 6e 64 6c 65 25 2c  |il_Add",handle%,|
0002a5f0  69 74 65 6d 24 2c 73 65  6c 5f 66 6e 24 20 b8 20  |item$,sel_fn$ . |
0002a600  72 65 74 5f 68 61 6e 64  6c 65 25 0d 16 50 05 cc  |ret_handle%..P..|
0002a610  0d 16 51 33 20 20 c8 99  20 22 4d 65 6e 75 55 74  |..Q3  .. "MenuUt|
0002a620  69 6c 5f 41 64 64 22 2c  68 61 6e 64 6c 65 25 2c  |il_Add",handle%,|
0002a630  69 74 65 6d 24 20 b8 20  72 65 74 5f 68 61 6e 64  |item$ . ret_hand|
0002a640  6c 65 25 0d 16 52 05 cd  0d 16 53 1e e7 20 68 61  |le%..R....S.. ha|
0002a650  6e 64 6c 65 25 20 3c 3e  20 72 65 74 5f 68 61 6e  |ndle% <> ret_han|
0002a660  64 6c 65 25 20 8c 0d 16  54 15 2a 7c 69 66 64 65  |dle% ...T.*|ifde|
0002a670  66 20 54 72 61 63 65 49  6e 69 74 0d 16 55 4f 20  |f TraceInit..UO |
0002a680  20 f2 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  | .shell_Tracef0(|
0002a690  22 4d 65 6e 75 41 64 64  3a 4d 65 6e 75 20 68 61  |"MenuAdd:Menu ha|
0002a6a0  6e 64 6c 65 20 68 61 73  20 63 68 61 6e 67 65 64  |ndle has changed|
0002a6b0  2c 20 75 70 64 61 74 69  6e 67 20 65 76 65 6e 74  |, updating event|
0002a6c0  20 6c 69 73 74 73 2e 2e  22 29 0d 16 56 0b 2a 7c  | lists..")..V.*||
0002a6d0  65 6e 64 69 66 0d 16 57  37 f4 20 20 20 50 52 4f  |endif..W7.   PRO|
0002a6e0  43 73 68 65 6c 6c 5f 4d  65 6e 75 55 70 64 61 74  |Cshell_MenuUpdat|
0002a6f0  65 48 61 6e 64 6c 65 28  68 61 6e 64 6c 65 25 2c  |eHandle(handle%,|
0002a700  72 65 74 5f 68 61 6e 64  6c 65 25 29 0d 16 58 05  |ret_handle%)..X.|
0002a710  cd 0d 16 59 11 3d 20 72  65 74 5f 68 61 6e 64 6c  |...Y.= ret_handl|
0002a720  65 25 0d 16 5a 05 3a 0d  16 5b 1a 2a 7c 53 74 6f  |e%..Z.:..[.*|Sto|
0002a730  70 20 46 4e 73 68 65 6c  6c 5f 4d 65 6e 75 41 64  |p FNshell_MenuAd|
0002a740  64 0d 16 5c 04 0d 16 5d  1e 2a 7c 53 74 61 72 74  |d..\...].*|Start|
0002a750  20 50 52 4f 43 73 68 65  6c 6c 5f 4d 65 6e 75 54  | PROCshell_MenuT|
0002a760  69 63 6b 0d 16 5e 2a dd  20 f2 73 68 65 6c 6c 5f  |ick..^*. .shell_|
0002a770  4d 65 6e 75 54 69 63 6b  28 69 74 65 6d 5f 68 61  |MenuTick(item_ha|
0002a780  6e 64 6c 65 25 2c 73 74  61 74 65 25 29 0d 16 5f  |ndle%,state%).._|
0002a790  2a c8 99 20 22 4d 65 6e  75 55 74 69 6c 5f 54 69  |*.. "MenuUtil_Ti|
0002a7a0  63 6b 22 2c 69 74 65 6d  5f 68 61 6e 64 6c 65 25  |ck",item_handle%|
0002a7b0  2c 73 74 61 74 65 25 0d  16 60 05 e1 0d 16 61 05  |,state%..`....a.|
0002a7c0  3a 0d 16 62 1d 2a 7c 53  74 6f 70 20 50 52 4f 43  |:..b.*|Stop PROC|
0002a7d0  73 68 65 6c 6c 5f 4d 65  6e 75 54 69 63 6b 0d 16  |shell_MenuTick..|
0002a7e0  63 04 0d 16 64 23 2a 7c  53 74 61 72 74 20 50 52  |c...d#*|Start PR|
0002a7f0  4f 43 73 68 65 6c 6c 5f  4d 65 6e 75 54 69 63 6b  |OCshell_MenuTick|
0002a800  4f 6e 6c 79 31 0d 16 65  2d dd 20 f2 73 68 65 6c  |Only1..e-. .shel|
0002a810  6c 5f 4d 65 6e 75 54 69  63 6b 4f 6e 6c 79 31 28  |l_MenuTickOnly1(|
0002a820  6d 65 6e 75 5f 68 61 6e  64 6c 65 25 2c 70 6f 73  |menu_handle%,pos|
0002a830  25 29 0d 16 66 2c c8 99  20 22 4d 65 6e 75 55 74  |%)..f,.. "MenuUt|
0002a840  69 6c 5f 54 69 63 6b 4f  6e 6c 79 22 2c 6d 65 6e  |il_TickOnly",men|
0002a850  75 5f 68 61 6e 64 6c 65  25 2c 70 6f 73 25 0d 16  |u_handle%,pos%..|
0002a860  67 05 e1 0d 16 68 05 3a  0d 16 69 22 2a 7c 53 74  |g....h.:..i"*|St|
0002a870  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 4d 65 6e  |op PROCshell_Men|
0002a880  75 54 69 63 6b 4f 6e 6c  79 31 0d 16 6a 04 0d 16  |uTickOnly1..j...|
0002a890  6b 23 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |k#*|Start PROCsh|
0002a8a0  65 6c 6c 5f 4d 65 6e 75  54 69 63 6b 4f 6e 6c 79  |ell_MenuTickOnly|
0002a8b0  32 0d 16 6c 28 dd 20 f2  73 68 65 6c 6c 5f 4d 65  |2..l(. .shell_Me|
0002a8c0  6e 75 54 69 63 6b 4f 6e  6c 79 32 28 69 74 65 6d  |nuTickOnly2(item|
0002a8d0  5f 68 61 6e 64 6c 65 25  29 0d 16 6d 27 c8 99 20  |_handle%)..m'.. |
0002a8e0  22 4d 65 6e 75 55 74 69  6c 5f 54 69 63 6b 4f 6e  |"MenuUtil_TickOn|
0002a8f0  6c 79 22 2c 69 74 65 6d  5f 68 61 6e 64 6c 65 25  |ly",item_handle%|
0002a900  0d 16 6e 05 e1 0d 16 6f  05 3a 0d 16 70 22 2a 7c  |..n....o.:..p"*||
0002a910  53 74 6f 70 20 50 52 4f  43 73 68 65 6c 6c 5f 4d  |Stop PROCshell_M|
0002a920  65 6e 75 54 69 63 6b 4f  6e 6c 79 32 0d 16 71 04  |enuTickOnly2..q.|
0002a930  0d 16 72 1f 2a 7c 53 74  61 72 74 20 50 52 4f 43  |..r.*|Start PROC|
0002a940  73 68 65 6c 6c 5f 4d 65  6e 75 53 68 61 64 65 0d  |shell_MenuShade.|
0002a950  16 73 26 dd 20 f2 73 68  65 6c 6c 5f 4d 65 6e 75  |.s&. .shell_Menu|
0002a960  53 68 61 64 65 28 68 61  6e 64 6c 65 25 2c 73 74  |Shade(handle%,st|
0002a970  61 74 65 25 29 0d 16 74  25 c8 99 20 22 4d 65 6e  |ate%)..t%.. "Men|
0002a980  75 55 74 69 6c 5f 46 61  64 65 22 2c 68 61 6e 64  |uUtil_Fade",hand|
0002a990  6c 65 25 2c 73 74 61 74  65 25 0d 16 75 05 e1 0d  |le%,state%..u...|
0002a9a0  16 76 05 3a 0d 16 77 1e  2a 7c 53 74 6f 70 20 50  |.v.:..w.*|Stop P|
0002a9b0  52 4f 43 73 68 65 6c 6c  5f 4d 65 6e 75 53 68 61  |ROCshell_MenuSha|
0002a9c0  64 65 0d 16 78 04 0d 16  79 20 2a 7c 53 74 61 72  |de..x...y *|Star|
0002a9d0  74 20 50 52 4f 43 73 68  65 6c 6c 5f 4d 65 6e 75  |t PROCshell_Menu|
0002a9e0  44 6f 74 74 65 64 0d 16  7a 2c dd 20 f2 73 68 65  |Dotted..z,. .she|
0002a9f0  6c 6c 5f 4d 65 6e 75 44  6f 74 74 65 64 28 69 74  |ll_MenuDotted(it|
0002aa00  65 6d 5f 68 61 6e 64 6c  65 25 2c 73 74 61 74 65  |em_handle%,state|
0002aa10  25 29 0d 16 7b 2a c8 99  20 22 4d 65 6e 75 55 74  |%)..{*.. "MenuUt|
0002aa20  69 6c 5f 44 6f 74 73 22  2c 69 74 65 6d 5f 68 61  |il_Dots",item_ha|
0002aa30  6e 64 6c 65 25 2c 73 74  61 74 65 25 0d 16 7c 05  |ndle%,state%..|.|
0002aa40  e1 0d 16 7d 05 3a 0d 16  7e 1f 2a 7c 53 74 6f 70  |...}.:..~.*|Stop|
0002aa50  20 50 52 4f 43 73 68 65  6c 6c 5f 4d 65 6e 75 44  | PROCshell_MenuD|
0002aa60  6f 74 74 65 64 0d 16 7f  04 0d 16 80 21 2a 7c 53  |otted.......!*|S|
0002aa70  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 4d  |tart PROCshell_M|
0002aa80  65 6e 75 43 6f 6c 6f 75  72 73 0d 16 81 2e dd 20  |enuColours..... |
0002aa90  f2 73 68 65 6c 6c 5f 4d  65 6e 75 43 6f 6c 6f 75  |.shell_MenuColou|
0002aaa0  72 73 28 69 74 65 6d 5f  68 61 6e 64 6c 65 25 2c  |rs(item_handle%,|
0002aab0  66 67 25 2c 62 67 25 29  0d 16 82 2e c8 99 20 22  |fg%,bg%)...... "|
0002aac0  4d 65 6e 75 55 74 69 6c  5f 43 6f 6c 6f 75 72 73  |MenuUtil_Colours|
0002aad0  22 2c 69 74 65 6d 5f 68  61 6e 64 6c 65 25 2c 66  |",item_handle%,f|
0002aae0  67 25 2c 62 67 25 0d 16  83 05 e1 0d 16 84 05 3a  |g%,bg%.........:|
0002aaf0  0d 16 85 20 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |... *|Stop PROCs|
0002ab00  68 65 6c 6c 5f 4d 65 6e  75 43 6f 6c 6f 75 72 73  |hell_MenuColours|
0002ab10  0d 16 86 04 0d 16 87 22  2a 7c 53 74 61 72 74 20  |......."*|Start |
0002ab20  50 52 4f 43 73 68 65 6c  6c 5f 4d 65 6e 75 57 72  |PROCshell_MenuWr|
0002ab30  69 74 61 62 6c 65 0d 16  88 3b dd 20 f2 73 68 65  |itable...;. .she|
0002ab40  6c 6c 5f 4d 65 6e 75 57  72 69 74 61 62 6c 65 28  |ll_MenuWritable(|
0002ab50  69 74 65 6d 5f 68 61 6e  64 6c 65 25 2c 73 74 61  |item_handle%,sta|
0002ab60  74 65 25 2c 73 69 7a 65  25 2c 76 61 6c 69 64 24  |te%,size%,valid$|
0002ab70  29 0d 16 89 3b c8 99 20  22 4d 65 6e 75 55 74 69  |)...;.. "MenuUti|
0002ab80  6c 5f 57 72 69 74 61 62  6c 65 22 2c 69 74 65 6d  |l_Writable",item|
0002ab90  5f 68 61 6e 64 6c 65 25  2c 73 74 61 74 65 25 2c  |_handle%,state%,|
0002aba0  73 69 7a 65 25 2c 76 61  6c 69 64 24 0d 16 8a 05  |size%,valid$....|
0002abb0  e1 0d 16 8b 05 3a 0d 16  8c 21 2a 7c 53 74 6f 70  |.....:...!*|Stop|
0002abc0  20 50 52 4f 43 73 68 65  6c 6c 5f 4d 65 6e 75 57  | PROCshell_MenuW|
0002abd0  72 69 74 61 62 6c 65 0d  16 8d 04 0d 16 8e 21 2a  |ritable.......!*|
0002abe0  7c 53 74 61 72 74 20 50  52 4f 43 73 68 65 6c 6c  ||Start PROCshell|
0002abf0  5f 4d 65 6e 75 50 75 74  44 61 74 61 0d 16 8f 2c  |_MenuPutData...,|
0002ac00  dd 20 f2 73 68 65 6c 6c  5f 4d 65 6e 75 50 75 74  |. .shell_MenuPut|
0002ac10  44 61 74 61 28 69 74 65  6d 5f 68 61 6e 64 6c 65  |Data(item_handle|
0002ac20  25 2c 64 61 74 61 24 29  0d 16 90 29 c8 99 20 22  |%,data$)...).. "|
0002ac30  4d 65 6e 75 55 74 69 6c  5f 54 65 78 74 22 2c 69  |MenuUtil_Text",i|
0002ac40  74 65 6d 5f 68 61 6e 64  6c 65 25 2c 64 61 74 61  |tem_handle%,data|
0002ac50  24 0d 16 91 05 e1 0d 16  92 05 3a 0d 16 93 20 2a  |$.........:... *|
0002ac60  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
0002ac70  4d 65 6e 75 50 75 74 44  61 74 61 0d 16 94 04 0d  |MenuPutData.....|
0002ac80  16 95 25 2a 7c 53 74 61  72 74 20 50 52 4f 43 73  |..%*|Start PROCs|
0002ac90  68 65 6c 6c 5f 4d 65 6e  75 43 61 6c 6c 48 61 6e  |hell_MenuCallHan|
0002aca0  64 6c 65 72 0d 16 96 28  dd 20 f2 73 68 65 6c 6c  |dler...(. .shell|
0002acb0  5f 4d 65 6e 75 43 61 6c  6c 48 61 6e 64 6c 65 72  |_MenuCallHandler|
0002acc0  28 68 25 2c 5f 68 5f 62  6c 6b 25 29 0d 16 97 07  |(h%,_h_blk%)....|
0002acd0  ea 20 85 0d 16 98 0f ee  20 85 20 ea 3a f7 20 85  |. ...... . .:. .|
0002ace0  3a e1 0d 16 99 1d e7 20  a0 28 22 46 4e 22 2b 24  |:...... .("FN"+$|
0002acf0  68 25 2b 22 28 5f 68 5f  62 6c 6b 25 29 22 29 0d  |h%+"(_h_blk%)").|
0002ad00  16 9a 05 e1 0d 16 9b 05  3a 0d 16 9c 24 2a 7c 53  |........:...$*|S|
0002ad10  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 4d 65  |top PROCshell_Me|
0002ad20  6e 75 43 61 6c 6c 48 61  6e 64 6c 65 72 0d 16 9d  |nuCallHandler...|
0002ad30  04 0d 16 9e 26 2a 7c 53  74 61 72 74 20 50 52 4f  |....&*|Start PRO|
0002ad40  43 73 68 65 6c 6c 5f 41  74 74 61 63 68 4f 70 65  |Cshell_AttachOpe|
0002ad50  6e 57 69 6e 64 6f 77 0d  16 9f 26 dd 20 f2 73 68  |nWindow...&. .sh|
0002ad60  65 6c 6c 5f 41 74 74 61  63 68 4f 70 65 6e 57 69  |ell_AttachOpenWi|
0002ad70  6e 64 6f 77 28 77 68 25  2c 66 6e 24 29 0d 16 a0  |ndow(wh%,fn$)...|
0002ad80  18 ea 20 62 6c 6b 25 2c  74 65 6d 70 25 2c 6f 66  |.. blk%,temp%,of|
0002ad90  66 73 65 74 25 0d 16 a1  15 2a 7c 69 66 64 65 66  |fset%....*|ifdef|
0002ada0  20 54 72 61 63 65 49 6e  69 74 0d 16 a2 43 f2 73  | TraceInit...C.s|
0002adb0  68 65 6c 6c 5f 54 72 61  63 65 66 30 28 22 41 74  |hell_Tracef0("At|
0002adc0  74 61 63 68 4f 70 65 6e  57 69 6e 64 6f 77 3a 41  |tachOpenWindow:A|
0002add0  74 74 61 63 68 69 6e 67  20 4f 70 65 6e 57 69 6e  |ttaching OpenWin|
0002ade0  64 6f 77 20 48 61 6e 64  6c 65 72 22 29 0d 16 a3  |dow Handler")...|
0002adf0  0b 2a 7c 65 6e 64 69 66  0d 16 a4 48 e7 20 77 68  |.*|endif...H. wh|
0002ae00  25 3c 30 20 8c 20 85 20  39 39 2c f2 73 68 65 6c  |%<0 . . 99,.shel|
0002ae10  6c 5f 4d 65 73 73 61 67  65 4f 6e 65 41 72 67 28  |l_MessageOneArg(|
0002ae20  22 53 48 45 4c 4c 4d 53  47 32 37 22 2c 22 41 74  |"SHELLMSG27","At|
0002ae30  74 61 63 68 4f 70 65 6e  57 69 6e 64 6f 77 22 29  |tachOpenWindow")|
0002ae40  0d 16 a5 3a 6f 66 66 73  65 74 25 3d a4 73 68 65  |...:offset%=.she|
0002ae50  6c 6c 5f 47 65 74 45 76  65 6e 74 4c 69 73 74 4f  |ll_GetEventListO|
0002ae60  66 66 73 65 74 28 77 68  25 2c 2d 31 2c 5f 55 25  |ffset(wh%,-1,_U%|
0002ae70  2b 33 30 34 2c 31 32 2c  b9 29 0d 16 a6 18 62 6c  |+304,12,.)....bl|
0002ae80  6b 25 3d 5f 55 25 21 33  30 34 2b 6f 66 66 73 65  |k%=_U%!304+offse|
0002ae90  74 25 0d 16 a7 18 62 6c  6b 25 21 30 3d 77 68 25  |t%....blk%!0=wh%|
0002aea0  3a 62 6c 6b 25 21 34 3d  2d 31 0d 16 a8 2a 62 6c  |:blk%!4=-1...*bl|
0002aeb0  6b 25 21 38 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |k%!8=.shell_Heap|
0002aec0  42 6c 6f 63 6b 46 65 74  63 68 28 a9 28 66 6e 24  |BlockFetch(.(fn$|
0002aed0  29 2b 31 29 0d 16 a9 1b  74 65 6d 70 25 3d 62 6c  |)+1)....temp%=bl|
0002aee0  6b 25 21 38 3a 24 74 65  6d 70 25 3d 66 6e 24 0d  |k%!8:$temp%=fn$.|
0002aef0  16 aa 05 e1 0d 16 ab 05  3a 0d 16 ac 25 2a 7c 53  |........:...%*|S|
0002af00  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 41 74  |top PROCshell_At|
0002af10  74 61 63 68 4f 70 65 6e  57 69 6e 64 6f 77 0d 16  |tachOpenWindow..|
0002af20  ad 04 0d 16 ae 2e 2a 7c  53 74 61 72 74 20 50 52  |......*|Start PR|
0002af30  4f 43 73 68 65 6c 6c 5f  41 74 74 61 63 68 43 6c  |OCshell_AttachCl|
0002af40  6f 73 65 57 69 6e 64 6f  77 48 61 6e 64 6c 65 72  |oseWindowHandler|
0002af50  0d 16 af 2e dd 20 f2 73  68 65 6c 6c 5f 41 74 74  |..... .shell_Att|
0002af60  61 63 68 43 6c 6f 73 65  57 69 6e 64 6f 77 48 61  |achCloseWindowHa|
0002af70  6e 64 6c 65 72 28 77 68  25 2c 66 6e 24 29 0d 16  |ndler(wh%,fn$)..|
0002af80  b0 18 ea 20 62 6c 6b 25  2c 74 65 6d 70 25 2c 6f  |... blk%,temp%,o|
0002af90  66 66 73 65 74 25 0d 16  b1 15 2a 7c 69 66 64 65  |ffset%....*|ifde|
0002afa0  66 20 54 72 61 63 65 49  6e 69 74 0d 16 b2 4c f2  |f TraceInit...L.|
0002afb0  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 41  |shell_Tracef0("A|
0002afc0  74 74 61 63 68 43 6c 6f  73 65 57 69 6e 64 6f 77  |ttachCloseWindow|
0002afd0  48 61 6e 64 6c 65 72 3a  41 74 74 61 63 68 69 6e  |Handler:Attachin|
0002afe0  67 20 43 6c 6f 73 65 57  69 6e 64 6f 77 20 48 61  |g CloseWindow Ha|
0002aff0  6e 64 6c 65 72 22 29 0d  16 b3 0b 2a 7c 65 6e 64  |ndler")....*|end|
0002b000  69 66 0d 16 b4 49 e7 20  77 68 25 3c 30 20 8c 20  |if...I. wh%<0 . |
0002b010  85 20 39 39 2c f2 73 68  65 6c 6c 5f 4d 65 73 73  |. 99,.shell_Mess|
0002b020  61 67 65 4f 6e 65 41 72  67 28 22 53 48 45 4c 4c  |ageOneArg("SHELL|
0002b030  4d 53 47 32 37 22 2c 22  41 74 74 61 63 68 43 6c  |MSG27","AttachCl|
0002b040  6f 73 65 57 69 6e 64 6f  77 22 29 0d 16 b5 3a 6f  |oseWindow")...:o|
0002b050  66 66 73 65 74 25 3d a4  73 68 65 6c 6c 5f 47 65  |ffset%=.shell_Ge|
0002b060  74 45 76 65 6e 74 4c 69  73 74 4f 66 66 73 65 74  |tEventListOffset|
0002b070  28 77 68 25 2c 2d 31 2c  5f 55 25 2b 33 30 38 2c  |(wh%,-1,_U%+308,|
0002b080  31 32 2c b9 29 0d 16 b6  18 62 6c 6b 25 3d 5f 55  |12,.)....blk%=_U|
0002b090  25 21 33 30 38 2b 6f 66  66 73 65 74 25 0d 16 b7  |%!308+offset%...|
0002b0a0  18 62 6c 6b 25 21 30 3d  77 68 25 3a 62 6c 6b 25  |.blk%!0=wh%:blk%|
0002b0b0  21 34 3d 2d 31 0d 16 b8  2a 62 6c 6b 25 21 38 3d  |!4=-1...*blk%!8=|
0002b0c0  a4 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
0002b0d0  46 65 74 63 68 28 a9 28  66 6e 24 29 2b 31 29 0d  |Fetch(.(fn$)+1).|
0002b0e0  16 b9 1b 74 65 6d 70 25  3d 62 6c 6b 25 21 38 3a  |...temp%=blk%!8:|
0002b0f0  24 74 65 6d 70 25 3d 66  6e 24 0d 16 ba 05 e1 0d  |$temp%=fn$......|
0002b100  16 bb 05 3a 0d 16 bc 2d  2a 7c 53 74 6f 70 20 50  |...:...-*|Stop P|
0002b110  52 4f 43 73 68 65 6c 6c  5f 41 74 74 61 63 68 43  |ROCshell_AttachC|
0002b120  6c 6f 73 65 57 69 6e 64  6f 77 48 61 6e 64 6c 65  |loseWindowHandle|
0002b130  72 0d 16 bd 04 0d 16 be  22 2a 7c 53 74 61 72 74  |r......."*|Start|
0002b140  20 50 52 4f 43 73 68 65  6c 6c 5f 53 70 72 69 74  | PROCshell_Sprit|
0002b150  65 52 65 6e 61 6d 65 0d  16 bf 30 dd 20 f2 73 68  |eRename...0. .sh|
0002b160  65 6c 6c 5f 53 70 72 69  74 65 52 65 6e 61 6d 65  |ell_SpriteRename|
0002b170  28 73 70 72 69 74 65 61  72 65 61 25 2c 6f 6c 64  |(spritearea%,old|
0002b180  24 2c 6e 65 77 24 29 0d  16 c0 53 c8 99 20 22 4f  |$,new$)...S.. "O|
0002b190  53 5f 53 70 72 69 74 65  4f 70 22 2c 26 32 30 30  |S_SpriteOp",&200|
0002b1a0  2b 32 36 2c 73 70 72 69  74 65 61 72 65 61 25 2c  |+26,spritearea%,|
0002b1b0  a4 73 68 65 6c 6c 5f 53  70 72 69 74 65 47 65 74  |.shell_SpriteGet|
0002b1c0  50 74 72 28 73 70 72 69  74 65 61 72 65 61 25 2c  |Ptr(spritearea%,|
0002b1d0  6f 6c 64 24 29 2c 6e 65  77 24 0d 16 c1 05 e1 0d  |old$),new$......|
0002b1e0  16 c2 05 3a 0d 16 c3 21  2a 7c 53 74 6f 70 20 50  |...:...!*|Stop P|
0002b1f0  52 4f 43 73 68 65 6c 6c  5f 53 70 72 69 74 65 52  |ROCshell_SpriteR|
0002b200  65 6e 61 6d 65 0d 16 c4  04 0d 16 c5 24 2a 7c 53  |ename.......$*|S|
0002b210  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 53  |tart PROCshell_S|
0002b220  70 72 69 74 65 41 72 65  61 53 61 76 65 0d 16 c6  |priteAreaSave...|
0002b230  32 dd 20 f2 73 68 65 6c  6c 5f 53 70 72 69 74 65  |2. .shell_Sprite|
0002b240  41 72 65 61 53 61 76 65  28 73 70 72 69 74 65 61  |AreaSave(spritea|
0002b250  72 65 61 25 2c 66 69 6c  65 6e 61 6d 65 24 29 0d  |rea%,filename$).|
0002b260  16 c7 32 c8 99 20 22 4f  53 5f 53 70 72 69 74 65  |..2.. "OS_Sprite|
0002b270  4f 70 22 2c 26 32 30 30  2b 31 32 2c 73 70 72 69  |Op",&200+12,spri|
0002b280  74 65 61 72 65 61 25 2c  66 69 6c 65 6e 61 6d 65  |tearea%,filename|
0002b290  24 0d 16 c8 05 e1 0d 16  c9 05 3a 0d 16 ca 23 2a  |$.........:...#*|
0002b2a0  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
0002b2b0  53 70 72 69 74 65 41 72  65 61 53 61 76 65 0d 16  |SpriteAreaSave..|
0002b2c0  cb 04 0d 16 cc 20 2a 7c  53 74 61 72 74 20 50 52  |..... *|Start PR|
0002b2d0  4f 43 73 68 65 6c 6c 5f  45 6e 73 75 72 65 50 6f  |OCshell_EnsurePo|
0002b2e0  6c 6c 0d 16 cd 17 dd 20  f2 73 68 65 6c 6c 5f 45  |ll..... .shell_E|
0002b2f0  6e 73 75 72 65 50 6f 6c  6c 0d 16 ce 0d ea 20 61  |nsurePoll..... a|
0002b300  63 74 69 6f 6e 25 0d 16  cf 05 f5 0d 16 d0 28 20  |ction%........( |
0002b310  20 61 63 74 69 6f 6e 25  20 3d 20 a4 73 68 65 6c  | action% = .shel|
0002b320  6c 5f 50 6f 6c 6c 5f 49  28 30 2c 5f 55 25 21 31  |l_Poll_I(0,_U%!1|
0002b330  34 38 29 0d 16 d1 1c 20  20 f2 73 68 65 6c 6c 5f  |48)....  .shell_|
0002b340  41 63 74 69 6f 6e 28 61  63 74 69 6f 6e 25 29 0d  |Action(action%).|
0002b350  16 d2 11 fd 20 61 63 74  69 6f 6e 25 20 3d 20 30  |.... action% = 0|
0002b360  0d 16 d3 05 e1 0d 16 d4  05 3a 0d 16 d5 1f 2a 7c  |.........:....*||
0002b370  53 74 6f 70 20 50 52 4f  43 73 68 65 6c 6c 5f 45  |Stop PROCshell_E|
0002b380  6e 73 75 72 65 50 6f 6c  6c 0d 16 d6 04 0d 16 d7  |nsurePoll.......|
0002b390  22 2a 7c 53 74 61 72 74  20 46 4e 73 68 65 6c 6c  |"*|Start FNshell|
0002b3a0  5f 57 69 6d 70 47 65 74  56 65 72 73 69 6f 6e 0d  |_WimpGetVersion.|
0002b3b0  16 d8 1b dd 20 a4 73 68  65 6c 6c 5f 57 69 6d 70  |.... .shell_Wimp|
0002b3c0  47 65 74 56 65 72 73 69  6f 6e 0d 16 d9 0c 3d 5f  |GetVersion....=_|
0002b3d0  55 25 21 33 31 36 0d 16  da 21 2a 7c 53 74 6f 70  |U%!316...!*|Stop|
0002b3e0  20 46 4e 73 68 65 6c 6c  5f 57 69 6d 70 47 65 74  | FNshell_WimpGet|
0002b3f0  56 65 72 73 69 6f 6e 0d  16 db 04 0d 16 dc 22 2a  |Version......."*|
0002b400  7c 53 74 61 72 74 20 46  4e 73 68 65 6c 6c 5f 4f  ||Start FNshell_O|
0002b410  53 43 68 65 63 6b 56 65  72 73 69 6f 6e 0d 16 dd  |SCheckVersion...|
0002b420  25 dd 20 a4 73 68 65 6c  6c 5f 4f 53 43 68 65 63  |%. .shell_OSChec|
0002b430  6b 56 65 72 73 69 6f 6e  28 76 65 72 73 69 6f 6e  |kVersion(version|
0002b440  25 29 0d 16 de 3a 3d a4  73 68 65 6c 6c 5f 4f 53  |%)...:=.shell_OS|
0002b450  4d 6f 64 75 6c 65 43 68  65 63 6b 56 65 72 73 69  |ModuleCheckVersi|
0002b460  6f 6e 28 22 55 74 69 6c  69 74 79 4d 6f 64 75 6c  |on("UtilityModul|
0002b470  65 22 2c 76 65 72 73 69  6f 6e 25 29 0d 16 df 21  |e",version%)...!|
0002b480  2a 7c 53 74 6f 70 20 46  4e 73 68 65 6c 6c 5f 4f  |*|Stop FNshell_O|
0002b490  53 43 68 65 63 6b 56 65  72 73 69 6f 6e 0d 16 e0  |SCheckVersion...|
0002b4a0  04 0d 16 e1 28 2a 7c 53  74 61 72 74 20 46 4e 73  |....(*|Start FNs|
0002b4b0  68 65 6c 6c 5f 4f 53 4d  6f 64 75 6c 65 43 68 65  |hell_OSModuleChe|
0002b4c0  63 6b 56 65 72 73 69 6f  6e 0d 16 e2 32 dd 20 a4  |ckVersion...2. .|
0002b4d0  73 68 65 6c 6c 5f 4f 53  4d 6f 64 75 6c 65 43 68  |shell_OSModuleCh|
0002b4e0  65 63 6b 56 65 72 73 69  6f 6e 28 6d 6f 64 75 6c  |eckVersion(modul|
0002b4f0  65 24 2c 76 65 72 73 69  6f 6e 29 0d 16 e3 17 ea  |e$,version).....|
0002b500  20 62 6c 6b 25 2c 6c 65  6e 25 2c 72 65 73 75 6c  | blk%,len%,resul|
0002b510  74 24 0d 16 e4 23 62 6c  6b 25 3d a4 73 68 65 6c  |t$...#blk%=.shel|
0002b520  6c 5f 48 65 61 70 42 6c  6f 63 6b 46 65 74 63 68  |l_HeapBlockFetch|
0002b530  28 32 35 36 29 0d 16 e5  1b ff 28 22 53 65 74 20  |(256).....("Set |
0002b540  4d 6f 64 75 6c 65 24 43  68 65 63 6b 20 59 22 29  |Module$Check Y")|
0002b550  0d 16 e6 43 ff 28 22 52  4d 45 6e 73 75 72 65 20  |...C.("RMEnsure |
0002b560  22 20 2b 20 6d 6f 64 75  6c 65 24 20 2b 20 22 20  |" + module$ + " |
0002b570  22 2b c3 76 65 72 73 69  6f 6e 20 2b 20 22 20 53  |"+.version + " S|
0002b580  65 74 20 4d 6f 64 75 6c  65 24 43 68 65 63 6b 20  |et Module$Check |
0002b590  4e 22 29 0d 16 e7 3b c8  99 20 22 4f 53 5f 52 65  |N")...;.. "OS_Re|
0002b5a0  61 64 56 61 72 56 61 6c  22 2c 22 4d 6f 64 75 6c  |adVarVal","Modul|
0002b5b0  65 24 43 68 65 63 6b 22  2c 62 6c 6b 25 2c 32 35  |e$Check",blk%,25|
0002b5c0  36 2c 30 2c 30 20 b8 20  2c 2c 6c 65 6e 25 0d 16  |6,0,0 . ,,len%..|
0002b5d0  e8 12 62 6c 6b 25 3f 6c  65 6e 25 20 3d 20 31 33  |..blk%?len% = 13|
0002b5e0  0d 16 e9 1b ff 28 22 55  6e 73 65 74 20 4d 6f 64  |.....("Unset Mod|
0002b5f0  75 6c 65 24 43 68 65 63  6b 22 29 0d 16 ea 13 72  |ule$Check")....r|
0002b600  65 73 75 6c 74 24 20 3d  20 24 62 6c 6b 25 0d 16  |esult$ = $blk%..|
0002b610  eb 20 f2 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |. .shell_HeapBlo|
0002b620  63 6b 52 65 74 75 72 6e  28 62 6c 6b 25 29 0d 16  |ckReturn(blk%)..|
0002b630  ec 1f e7 20 72 65 73 75  6c 74 24 20 3d 20 22 4e  |... result$ = "N|
0002b640  22 20 8c 20 3d 20 a3 20  8b 20 3d 20 b9 0d 16 ed  |" . = . . = ....|
0002b650  05 3a 0d 16 ee 27 2a 7c  53 74 6f 70 20 46 4e 73  |.:...'*|Stop FNs|
0002b660  68 65 6c 6c 5f 4f 53 4d  6f 64 75 6c 65 43 68 65  |hell_OSModuleChe|
0002b670  63 6b 56 65 72 73 69 6f  6e 0d 16 ef 04 0d 16 f0  |ckVersion.......|
0002b680  29 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |)*|Start PROCshe|
0002b690  6c 6c 5f 4d 65 73 73 61  67 65 53 65 6e 64 44 61  |ll_MessageSendDa|
0002b6a0  74 61 4c 6f 61 64 0d 16  f1 2d dd 20 f2 73 68 65  |taLoad...-. .she|
0002b6b0  6c 6c 5f 4d 65 73 73 61  67 65 53 65 6e 64 44 61  |ll_MessageSendDa|
0002b6c0  74 61 4c 6f 61 64 28 74  79 70 65 25 2c 6e 61 6d  |taLoad(type%,nam|
0002b6d0  65 24 29 0d 16 f2 0c ea  20 6d 5f 62 6c 6b 25 0d  |e$)..... m_blk%.|
0002b6e0  16 f3 2a 6d 5f 62 6c 6b  25 20 20 20 20 3d 20 a4  |..*m_blk%    = .|
0002b6f0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
0002b700  65 74 63 68 28 32 35 36  29 0d 16 f4 28 6d 5f 62  |etch(256)...(m_b|
0002b710  6c 6b 25 21 30 30 20 3d  20 32 35 36 20 20 20 3a  |lk%!00 = 256   :|
0002b720  f4 20 53 69 7a 65 20 6f  66 20 6d 65 73 73 61 67  |. Size of messag|
0002b730  65 0d 16 f5 2a 6d 5f 62  6c 6b 25 21 30 34 20 3d  |e...*m_blk%!04 =|
0002b740  20 30 20 20 20 20 20 3a  f4 20 4e 6f 74 20 75 73  | 0     :. Not us|
0002b750  65 64 20 6f 6e 20 65 6e  74 72 79 0d 16 f6 44 6d  |ed on entry...Dm|
0002b760  5f 62 6c 6b 25 21 31 32  20 3d 20 30 20 20 20 20  |_blk%!12 = 0    |
0002b770  20 3a f4 20 79 6f 75 72  5f 72 65 66 20 28 30 20  | :. your_ref (0 |
0002b780  3d 20 6f 72 69 67 69 6e  61 6c 20 6d 65 73 73 61  |= original messa|
0002b790  67 65 20 6e 6f 74 20 61  20 72 65 70 6c 79 29 0d  |ge not a reply).|
0002b7a0  16 f7 35 6d 5f 62 6c 6b  25 21 31 36 20 3d 20 35  |..5m_blk%!16 = 5|
0002b7b0  20 20 20 20 20 3a f4 20  44 61 74 61 4f 70 65 6e  |     :. DataOpen|
0002b7c0  20 6d 65 73 73 61 67 65  20 61 63 74 69 6f 6e 20  | message action |
0002b7d0  63 6f 64 65 0d 16 f8 4a  6d 5f 62 6c 6b 25 21 32  |code...Jm_blk%!2|
0002b7e0  30 20 3d 20 30 20 20 20  20 20 3a f4 20 4e 6f 72  |0 = 0     :. Nor|
0002b7f0  6d 61 6c 6c 79 20 46 69  6c 65 72 20 77 69 6e 64  |mally Filer wind|
0002b800  6f 77 20 68 61 6e 64 6c  65 20 63 6f 6e 74 61 69  |ow handle contai|
0002b810  6e 69 6e 67 20 74 68 65  20 66 69 6c 65 20 0d 16  |ning the file ..|
0002b820  f9 3d 6d 5f 62 6c 6b 25  21 32 38 20 3d 20 30 20  |.=m_blk%!28 = 0 |
0002b830  20 20 20 20 3a f4 20 4e  6f 72 6d 61 6c 6c 79 20  |    :. Normally |
0002b840  78 20 6f 66 66 73 65 74  20 6f 66 20 69 63 6f 6e  |x offset of icon|
0002b850  20 63 6c 69 63 6b 65 64  20 6f 6e 0d 16 fa 3d 6d  | clicked on...=m|
0002b860  5f 62 6c 6b 25 21 33 32  20 3d 20 30 20 20 20 20  |_blk%!32 = 0    |
0002b870  20 3a f4 20 4e 6f 72 6d  61 6c 6c 79 20 79 20 6f  | :. Normally y o|
0002b880  66 66 73 65 74 20 6f 66  20 69 63 6f 6e 20 63 6c  |ffset of icon cl|
0002b890  69 63 6b 65 64 20 6f 6e  0d 16 fb 22 6d 5f 62 6c  |icked on..."m_bl|
0002b8a0  6b 25 21 33 36 20 3d 20  30 20 20 20 20 20 3a f4  |k%!36 = 0     :.|
0002b8b0  20 4d 75 73 74 20 62 65  20 30 0d 16 fc 22 6d 5f  | Must be 0..."m_|
0002b8c0  62 6c 6b 25 21 34 30 20  3d 20 74 79 70 65 25 20  |blk%!40 = type% |
0002b8d0  3a f4 20 46 69 6c 65 20  74 79 70 65 0d 16 fd 21  |:. File type...!|
0002b8e0  24 28 6d 5f 62 6c 6b 25  20 2b 20 34 34 29 20 3d  |$(m_blk% + 44) =|
0002b8f0  20 6e 61 6d 65 24 20 2b  20 bd 28 30 29 0d 16 fe  | name$ + .(0)...|
0002b900  25 c8 99 20 22 57 69 6d  70 5f 53 65 6e 64 4d 65  |%.. "Wimp_SendMe|
0002b910  73 73 61 67 65 22 2c 31  37 2c 6d 5f 62 6c 6b 25  |ssage",17,m_blk%|
0002b920  2c 30 0d 16 ff 22 f2 73  68 65 6c 6c 5f 48 65 61  |,0...".shell_Hea|
0002b930  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 6d 5f 62  |pBlockReturn(m_b|
0002b940  6c 6b 25 29 0d 17 00 05  e1 0d 17 01 05 3a 0d 17  |lk%).........:..|
0002b950  02 28 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |.(*|Stop PROCshe|
0002b960  6c 6c 5f 4d 65 73 73 61  67 65 53 65 6e 64 44 61  |ll_MessageSendDa|
0002b970  74 61 4c 6f 61 64 0d 17  03 04 0d 17 04 24 2a 7c  |taLoad.......$*||
0002b980  53 74 61 72 74 20 46 4e  73 68 65 6c 6c 5f 4d 65  |Start FNshell_Me|
0002b990  6e 75 4d 61 6b 65 46 72  6f 6d 46 69 6c 65 0d 17  |nuMakeFromFile..|
0002b9a0  05 39 dd 20 a4 73 68 65  6c 6c 5f 4d 65 6e 75 4d  |.9. .shell_MenuM|
0002b9b0  61 6b 65 46 72 6f 6d 46  69 6c 65 28 74 69 74 6c  |akeFromFile(titl|
0002b9c0  65 24 2c 6d 65 6e 75 73  65 6c 65 63 74 46 4e 24  |e$,menuselectFN$|
0002b9d0  2c 66 69 6c 65 24 29 0d  17 06 18 ea 20 68 61 6e  |,file$)..... han|
0002b9e0  64 6c 65 25 2c 58 25 2c  73 74 72 69 6e 67 24 0d  |dle%,X%,string$.|
0002b9f0  17 07 20 e7 20 a4 73 68  65 6c 6c 5f 46 69 6c 65  |.. . .shell_File|
0002ba00  45 78 69 73 74 73 28 66  69 6c 65 24 29 20 8c 0d  |Exists(file$) ..|
0002ba10  17 08 26 20 20 68 61 6e  64 6c 65 25 20 3d 20 a4  |..&  handle% = .|
0002ba20  73 68 65 6c 6c 5f 4d 65  6e 75 4e 65 77 28 74 69  |shell_MenuNew(ti|
0002ba30  74 6c 65 24 29 0d 17 09  13 20 20 58 25 20 3d 20  |tle$)....  X% = |
0002ba40  8e 28 66 69 6c 65 24 29  0d 17 0a 07 20 20 f5 0d  |.(file$)....  ..|
0002ba50  17 0b 17 20 20 20 20 73  74 72 69 6e 67 24 20 3d  |...    string$ =|
0002ba60  20 be 23 20 58 25 0d 17  0c 3f 20 20 20 20 68 61  | .# X%...?    ha|
0002ba70  6e 64 6c 65 25 20 3d 20  a4 73 68 65 6c 6c 5f 4d  |ndle% = .shell_M|
0002ba80  65 6e 75 41 64 64 28 68  61 6e 64 6c 65 25 2c 73  |enuAdd(handle%,s|
0002ba90  74 72 69 6e 67 24 2c 6d  65 6e 75 73 65 6c 65 63  |tring$,menuselec|
0002baa0  74 46 4e 24 29 0d 17 0d  0d 20 20 fd 20 c5 23 20  |tFN$)....  . .# |
0002bab0  58 25 0d 17 0e 0b 20 20  d9 23 20 58 25 0d 17 0f  |X%....  .# X%...|
0002bac0  05 cd 0d 17 10 0d 3d 20  68 61 6e 64 6c 65 25 0d  |......= handle%.|
0002bad0  17 11 05 3a 0d 17 12 23  2a 7c 53 74 6f 70 20 46  |...:...#*|Stop F|
0002bae0  4e 73 68 65 6c 6c 5f 4d  65 6e 75 4d 61 6b 65 46  |Nshell_MenuMakeF|
0002baf0  72 6f 6d 46 69 6c 65 0d  17 13 04 0d 17 14 20 2a  |romFile....... *|
0002bb00  7c 53 74 61 72 74 20 46  4e 73 68 65 6c 6c 5f 42  ||Start FNshell_B|
0002bb10  69 6e 61 72 79 53 65 61  72 63 68 0d 17 15 45 dd  |inarySearch...E.|
0002bb20  20 a4 73 68 65 6c 6c 5f  42 69 6e 61 72 79 53 65  | .shell_BinarySe|
0002bb30  61 72 63 68 28 5f 73 65  61 72 63 68 5f 74 65 72  |arch(_search_ter|
0002bb40  6d 24 2c 67 65 74 5f 74  65 72 6d 46 4e 24 2c 63  |m$,get_termFN$,c|
0002bb50  6f 6d 70 5f 46 4e 24 2c  6c 6f 25 2c 68 69 25 29  |omp_FN$,lo%,hi%)|
0002bb60  0d 17 16 3e ea 20 5f 70  6f 73 25 2c 6d 25 2c 5f  |...>. _pos%,m%,_|
0002bb70  77 70 24 2c 6f 66 66 25  2c 70 25 2c 68 69 70 6f  |wp$,off%,p%,hipo|
0002bb80  73 25 2c 6c 6f 70 6f 73  25 2c 6c 70 32 25 2c 66  |s%,lopos%,lp2%,f|
0002bb90  6f 75 6e 64 25 2c 6d 69  73 73 69 6e 67 25 0d 17  |ound%,missing%..|
0002bba0  17 0c 68 69 25 20 2b 3d  20 31 0d 17 18 10 6d 69  |..hi% += 1....mi|
0002bbb0  73 73 69 6e 67 25 20 3d  20 a3 0d 17 19 10 66 6f  |ssing% = .....fo|
0002bbc0  75 6e 64 25 20 20 20 3d  20 a3 0d 17 1a 12 6d 25  |und%   = .....m%|
0002bbd0  20 20 20 20 20 20 20 3d  20 68 69 25 0d 17 1b 10  |       = hi%....|
0002bbe0  6f 66 66 25 20 20 20 20  20 3d 20 30 0d 17 1c 16  |off%     = 0....|
0002bbf0  5f 70 6f 73 25 20 20 20  20 20 3d 20 6d 25 20 81  |_pos%     = m% .|
0002bc00  20 32 0d 17 1d 16 6c 6f  70 6f 73 25 20 20 20 3d  | 2....lopos%   =|
0002bc10  20 6c 6f 25 20 2d 20 31  0d 17 1e 12 68 69 70 6f  | lo% - 1....hipo|
0002bc20  73 25 20 20 20 3d 20 68  69 25 0d 17 1f 05 f5 0d  |s%   = hi%......|
0002bc30  17 20 28 20 20 5f 77 70  24 3d a0 28 22 46 4e 22  |. (  _wp$=.("FN"|
0002bc40  2b 67 65 74 5f 74 65 72  6d 46 4e 24 2b 22 28 5f  |+get_termFN$+"(_|
0002bc50  70 6f 73 25 29 22 29 0d  17 21 16 20 20 6c 61 73  |pos%)")..!.  las|
0002bc60  74 70 6f 73 25 20 3d 20  5f 70 6f 73 25 0d 17 22  |tpos% = _pos%.."|
0002bc70  1e 20 20 e7 20 5f 73 65  61 72 63 68 5f 74 65 72  |.  . _search_ter|
0002bc80  6d 24 20 3d 20 5f 77 70  24 20 8c 0d 17 23 12 20  |m$ = _wp$ ...#. |
0002bc90  20 20 20 66 6f 75 6e 64  25 20 3d 20 b9 0d 17 24  |   found% = ...$|
0002bca0  07 20 20 cc 0d 17 25 33  20 20 20 20 e7 20 a0 28  |.  ...%3    . .(|
0002bcb0  22 46 4e 22 2b 63 6f 6d  70 5f 46 4e 24 2b 22 28  |"FN"+comp_FN$+"(|
0002bcc0  5f 73 65 61 72 63 68 5f  74 65 72 6d 24 2c 5f 77  |_search_term$,_w|
0002bcd0  70 24 29 22 29 20 8c 0d  17 26 1f 20 20 20 20 20  |p$)") ...&.     |
0002bce0  20 f4 20 73 65 61 72 63  68 20 6c 6f 77 65 72 20  | . search lower |
0002bcf0  68 61 6c 66 2e 2e 0d 17  27 18 20 20 20 20 20 20  |half....'.      |
0002bd00  68 69 70 6f 73 25 20 3d  20 5f 70 6f 73 25 0d 17  |hipos% = _pos%..|
0002bd10  28 21 20 20 20 20 20 20  6d 25 20 20 20 20 20 3d  |(!      m%     =|
0002bd20  20 5f 70 6f 73 25 20 2d  20 6c 6f 70 6f 73 25 0d  | _pos% - lopos%.|
0002bd30  17 29 20 20 20 20 20 20  20 5f 70 6f 73 25 20 20  |.)       _pos%  |
0002bd40  3d 20 6d 25 20 81 20 32  20 2b 20 6f 66 66 25 0d  |= m% . 2 + off%.|
0002bd50  17 2a 09 20 20 20 20 cc  0d 17 2b 1f 20 20 20 20  |.*.    ...+.    |
0002bd60  20 20 f4 20 73 65 61 72  63 68 20 75 70 70 65 72  |  . search upper|
0002bd70  20 68 61 6c 66 2e 2e 0d  17 2c 18 20 20 20 20 20  | half....,.     |
0002bd80  20 6c 6f 70 6f 73 25 20  3d 20 5f 70 6f 73 25 0d  | lopos% = _pos%.|
0002bd90  17 2d 18 20 20 20 20 20  20 6f 66 66 25 20 20 20  |.-.      off%   |
0002bda0  3d 20 5f 70 6f 73 25 0d  17 2e 21 20 20 20 20 20  |= _pos%...!     |
0002bdb0  20 6d 25 20 20 20 20 20  3d 20 68 69 70 6f 73 25  | m%     = hipos%|
0002bdc0  20 2d 20 5f 70 6f 73 25  0d 17 2f 1f 20 20 20 20  | - _pos%../.    |
0002bdd0  20 20 5f 70 6f 73 25 20  20 3d 20 6d 25 20 81 20  |  _pos%  = m% . |
0002bde0  32 20 2b 6f 66 66 25 0d  17 30 09 20 20 20 20 cd  |2 +off%..0.    .|
0002bdf0  0d 17 31 07 20 20 cd 0d  17 32 26 20 20 e7 20 6c  |..1.  ...2&  . l|
0002be00  70 32 25 20 3d 20 6c 61  73 74 70 6f 73 25 20 8c  |p2% = lastpos% .|
0002be10  20 6d 69 73 73 69 6e 67  25 20 3d 20 b9 0d 17 33  | missing% = ...3|
0002be20  15 20 20 6c 70 32 25 20  3d 20 6c 61 73 74 70 6f  |.  lp2% = lastpo|
0002be30  73 25 0d 17 34 17 fd 20  66 6f 75 6e 64 25 20 84  |s%..4.. found% .|
0002be40  20 6d 69 73 73 69 6e 67  25 0d 17 35 21 e7 20 ac  | missing%..5!. .|
0002be50  20 66 6f 75 6e 64 25 20  8c 20 3d 2d 31 20 8b 20  | found% . =-1 . |
0002be60  3d 20 6c 61 73 74 70 6f  73 25 0d 17 36 05 3a 0d  |= lastpos%..6.:.|
0002be70  17 37 1f 2a 7c 53 74 6f  70 20 46 4e 73 68 65 6c  |.7.*|Stop FNshel|
0002be80  6c 5f 42 69 6e 61 72 79  53 65 61 72 63 68 0d 17  |l_BinarySearch..|
0002be90  38 04 0d 17 39 23 2a 7c  53 74 61 72 74 20 46 4e  |8...9#*|Start FN|
0002bea0  73 68 65 6c 6c 5f 49 63  6f 6e 4c 61 73 74 43 6c  |shell_IconLastCl|
0002beb0  69 63 6b 65 64 0d 17 3a  1c dd 20 a4 73 68 65 6c  |icked..:.. .shel|
0002bec0  6c 5f 49 63 6f 6e 4c 61  73 74 43 6c 69 63 6b 65  |l_IconLastClicke|
0002bed0  64 0d 17 3b 0b 3d 5f 55  25 21 33 32 0d 17 3c 05  |d..;.=_U%!32..<.|
0002bee0  3a 0d 17 3d 22 2a 7c 53  74 6f 70 20 46 4e 73 68  |:..="*|Stop FNsh|
0002bef0  65 6c 6c 5f 49 63 6f 6e  4c 61 73 74 43 6c 69 63  |ell_IconLastClic|
0002bf00  6b 65 64 0d 17 3e 04 0d  17 3f 22 2a 7c 53 74 61  |ked..>...?"*|Sta|
0002bf10  72 74 20 46 4e 73 68 65  6c 6c 5f 4d 65 6e 75 47  |rt FNshell_MenuG|
0002bf20  65 74 4e 72 49 74 65 6d  73 0d 17 40 29 dd 20 a4  |etNrItems..@). .|
0002bf30  73 68 65 6c 6c 5f 4d 65  6e 75 47 65 74 4e 72 49  |shell_MenuGetNrI|
0002bf40  74 65 6d 73 28 6d 65 6e  75 5f 68 61 6e 64 6c 65  |tems(menu_handle|
0002bf50  25 29 0d 17 41 1a ea 20  6d 65 6e 75 25 2c 72 65  |%)..A.. menu%,re|
0002bf60  73 75 6c 74 25 2c 69 74  65 6d 73 25 0d 17 42 2b  |sult%,items%..B+|
0002bf70  c8 99 20 22 4d 65 6e 75  55 74 69 6c 5f 49 6e 66  |.. "MenuUtil_Inf|
0002bf80  6f 22 2c 6d 65 6e 75 5f  68 61 6e 64 6c 65 25 20  |o",menu_handle% |
0002bf90  b8 20 6d 65 6e 75 25 0d  17 43 0f 6d 65 6e 75 25  |. menu%..C.menu%|
0002bfa0  20 2b 3d 20 32 38 0d 17  44 05 f5 0d 17 45 1f 20  | += 28..D....E. |
0002bfb0  20 72 65 73 75 6c 74 25  20 3d 20 28 6d 65 6e 75  | result% = (menu|
0002bfc0  25 3f 30 20 80 20 26 38  30 29 0d 17 46 11 20 20  |%?0 . &80)..F.  |
0002bfd0  69 74 65 6d 73 25 20 2b  3d 20 31 0d 17 47 12 20  |items% += 1..G. |
0002bfe0  20 6d 65 6e 75 25 20 20  2b 3d 20 32 34 0d 17 48  | menu%  += 24..H|
0002bff0  0d fd 20 72 65 73 75 6c  74 25 0d 17 49 0b 3d 69  |.. result%..I.=i|
0002c000  74 65 6d 73 25 0d 17 4a  05 3a 0d 17 4b 21 2a 7c  |tems%..J.:..K!*||
0002c010  53 74 6f 70 20 46 4e 73  68 65 6c 6c 5f 4d 65 6e  |Stop FNshell_Men|
0002c020  75 47 65 74 4e 72 49 74  65 6d 73 0d 17 4c 04 0d  |uGetNrItems..L..|
0002c030  17 4d 23 2a 7c 53 74 61  72 74 20 46 4e 73 68 65  |.M#*|Start FNshe|
0002c040  6c 6c 5f 4d 65 6e 75 47  65 74 4e 72 44 6f 74 74  |ll_MenuGetNrDott|
0002c050  65 64 0d 17 4e 2a dd 20  a4 73 68 65 6c 6c 5f 4d  |ed..N*. .shell_M|
0002c060  65 6e 75 47 65 74 4e 72  44 6f 74 74 65 64 28 6d  |enuGetNrDotted(m|
0002c070  65 6e 75 5f 68 61 6e 64  6c 65 25 29 0d 17 4f 17  |enu_handle%)..O.|
0002c080  ea 20 6d 65 6e 75 25 2c  72 65 73 75 6c 74 25 2c  |. menu%,result%,|
0002c090  6e 72 25 0d 17 50 2b c8  99 20 22 4d 65 6e 75 55  |nr%..P+.. "MenuU|
0002c0a0  74 69 6c 5f 49 6e 66 6f  22 2c 6d 65 6e 75 5f 68  |til_Info",menu_h|
0002c0b0  61 6e 64 6c 65 25 20 b8  20 6d 65 6e 75 25 0d 17  |andle% . menu%..|
0002c0c0  51 10 6d 65 6e 75 25 20  2b 3d 20 32 38 20 0d 17  |Q.menu% += 28 ..|
0002c0d0  52 09 f5 20 20 20 20 0d  17 53 1f 20 20 72 65 73  |R..    ..S.  res|
0002c0e0  75 6c 74 25 20 3d 20 28  6d 65 6e 75 25 3f 30 20  |ult% = (menu%?0 |
0002c0f0  80 20 26 38 30 29 0d 17  54 20 20 20 e7 20 28 6d  |. &80)..T   . (m|
0002c100  65 6e 75 25 3f 30 20 80  20 32 29 20 8c 20 6e 72  |enu%?0 . 2) . nr|
0002c110  25 20 2b 3d 20 31 0d 17  55 11 20 20 6d 65 6e 75  |% += 1..U.  menu|
0002c120  25 20 2b 3d 20 32 34 0d  17 56 12 fd 20 72 65 73  |% += 24..V.. res|
0002c130  75 6c 74 25 20 3d 20 2d  31 0d 17 57 09 3d 6e 72  |ult% = -1..W.=nr|
0002c140  25 20 0d 17 58 05 3a 0d  17 59 23 2a 7c 53 74 6f  |% ..X.:..Y#*|Sto|
0002c150  70 20 46 4e 73 68 65 6c  6c 5f 4d 65 6e 75 47 65  |p FNshell_MenuGe|
0002c160  74 4e 72 44 6f 74 74 65  64 20 0d 17 5a 04 0d 17  |tNrDotted ..Z...|
0002c170  5b 26 2a 7c 53 74 61 72  74 20 46 4e 73 68 65 6c  |[&*|Start FNshel|
0002c180  6c 5f 4d 65 6e 75 47 65  74 49 74 65 6d 48 61 6e  |l_MenuGetItemHan|
0002c190  64 6c 65 72 0d 17 5c 36  dd 20 a4 73 68 65 6c 6c  |dler..\6. .shell|
0002c1a0  5f 4d 65 6e 75 47 65 74  49 74 65 6d 48 61 6e 64  |_MenuGetItemHand|
0002c1b0  6c 65 72 28 6d 65 6e 75  5f 68 61 6e 64 6c 65 25  |ler(menu_handle%|
0002c1c0  2c 69 74 65 6d 5f 6e 72  25 29 0d 17 5d 1e ea 20  |,item_nr%)..].. |
0002c1d0  6d 5f 73 65 6c 5f 62 6c  6b 25 2c 70 74 72 25 2c  |m_sel_blk%,ptr%,|
0002c1e0  68 61 6e 64 6c 65 72 24  0d 17 5e 2c 6d 5f 73 65  |handler$..^,m_se|
0002c1f0  6c 5f 62 6c 6b 25 20 20  20 20 3d 20 a4 73 68 65  |l_blk%    = .she|
0002c200  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 46 65 74 63  |ll_HeapBlockFetc|
0002c210  68 28 38 29 0d 17 5f 1e  6d 5f 73 65 6c 5f 62 6c  |h(8).._.m_sel_bl|
0002c220  6b 25 21 30 30 20 3d 20  69 74 65 6d 5f 6e 72 25  |k%!00 = item_nr%|
0002c230  20 20 0d 17 60 17 6d 5f  73 65 6c 5f 62 6c 6b 25  |  ..`.m_sel_blk%|
0002c240  21 30 34 20 3d 20 2d 31  20 0d 17 61 38 c8 99 20  |!04 = -1 ..a8.. |
0002c250  22 4d 65 6e 75 55 74 69  6c 5f 44 65 63 6f 64 65  |"MenuUtil_Decode|
0002c260  22 2c 6d 65 6e 75 5f 68  61 6e 64 6c 65 25 2c 6d  |",menu_handle%,m|
0002c270  5f 73 65 6c 5f 62 6c 6b  25 20 b8 20 70 74 72 25  |_sel_blk% . ptr%|
0002c280  20 0d 17 62 10 e7 20 70  74 72 25 20 3d 20 30 20  | ..b.. ptr% = 0 |
0002c290  8c 0d 17 63 13 20 20 68  61 6e 64 6c 65 72 24 20  |...c.  handler$ |
0002c2a0  3d 20 22 22 0d 17 64 05  cc 0d 17 65 18 20 20 68  |= ""..d....e.  h|
0002c2b0  61 6e 64 6c 65 72 24 20  3d 20 24 28 70 74 72 25  |andler$ = $(ptr%|
0002c2c0  29 0d 17 66 05 cd 0d 17  67 27 f2 73 68 65 6c 6c  |)..f....g'.shell|
0002c2d0  5f 48 65 61 70 42 6c 6f  63 6b 52 65 74 75 72 6e  |_HeapBlockReturn|
0002c2e0  28 6d 5f 73 65 6c 5f 62  6c 6b 25 29 20 0d 17 68  |(m_sel_blk%) ..h|
0002c2f0  0e 3d 20 68 61 6e 64 6c  65 72 24 0d 17 69 05 3a  |.= handler$..i.:|
0002c300  0d 17 6a 25 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |..j%*|Stop FNshe|
0002c310  6c 6c 5f 4d 65 6e 75 47  65 74 49 74 65 6d 48 61  |ll_MenuGetItemHa|
0002c320  6e 64 6c 65 72 0d 17 6b  04 0d 17 6c 23 2a 7c 53  |ndler..k...l#*|S|
0002c330  74 61 72 74 20 46 4e 73  68 65 6c 6c 5f 4d 65 6e  |tart FNshell_Men|
0002c340  75 47 65 74 49 74 65 6d  54 65 78 74 0d 17 6d 33  |uGetItemText..m3|
0002c350  dd 20 a4 73 68 65 6c 6c  5f 4d 65 6e 75 47 65 74  |. .shell_MenuGet|
0002c360  49 74 65 6d 54 65 78 74  28 6d 65 6e 75 5f 68 61  |ItemText(menu_ha|
0002c370  6e 64 6c 65 25 2c 69 74  65 6d 5f 6e 72 25 29 0d  |ndle%,item_nr%).|
0002c380  17 6e 1b ea 20 6d 5f 73  65 6c 5f 62 6c 6b 25 2c  |.n.. m_sel_blk%,|
0002c390  70 74 72 25 2c 74 65 78  74 24 0d 17 6f 29 6d 5f  |ptr%,text$..o)m_|
0002c3a0  73 65 6c 5f 62 6c 6b 25  20 3d 20 a4 73 68 65 6c  |sel_blk% = .shel|
0002c3b0  6c 5f 48 65 61 70 42 6c  6f 63 6b 46 65 74 63 68  |l_HeapBlockFetch|
0002c3c0  28 38 29 0d 17 70 1c 6d  5f 73 65 6c 5f 62 6c 6b  |(8)..p.m_sel_blk|
0002c3d0  25 21 30 30 20 3d 20 69  74 65 6d 5f 6e 72 25 0d  |%!00 = item_nr%.|
0002c3e0  17 71 16 6d 5f 73 65 6c  5f 62 6c 6b 25 21 30 34  |.q.m_sel_blk%!04|
0002c3f0  20 3d 20 2d 31 0d 17 72  39 c8 99 20 22 4d 65 6e  | = -1..r9.. "Men|
0002c400  75 55 74 69 6c 5f 44 65  63 6f 64 65 22 2c 6d 65  |uUtil_Decode",me|
0002c410  6e 75 5f 68 61 6e 64 6c  65 25 2c 6d 5f 73 65 6c  |nu_handle%,m_sel|
0002c420  5f 62 6c 6b 25 20 b8 20  2c 2c 70 74 72 25 0d 17  |_blk% . ,,ptr%..|
0002c430  73 16 74 65 78 74 24 20  3d 20 24 28 70 74 72 25  |s.text$ = $(ptr%|
0002c440  21 31 32 29 0d 17 74 26  f2 73 68 65 6c 6c 5f 48  |!12)..t&.shell_H|
0002c450  65 61 70 42 6c 6f 63 6b  52 65 74 75 72 6e 28 6d  |eapBlockReturn(m|
0002c460  5f 73 65 6c 5f 62 6c 6b  25 29 0d 17 75 0b 3d 20  |_sel_blk%)..u.= |
0002c470  74 65 78 74 24 0d 17 76  05 3a 0d 17 77 22 2a 7c  |text$..v.:..w"*||
0002c480  53 74 6f 70 20 46 4e 73  68 65 6c 6c 5f 4d 65 6e  |Stop FNshell_Men|
0002c490  75 47 65 74 49 74 65 6d  54 65 78 74 0d 17 78 04  |uGetItemText..x.|
0002c4a0  0d 17 79 25 2a 7c 53 74  61 72 74 20 46 4e 73 68  |..y%*|Start FNsh|
0002c4b0  65 6c 6c 5f 4d 65 6e 75  47 65 74 49 74 65 6d 48  |ell_MenuGetItemH|
0002c4c0  61 6e 64 6c 65 0d 17 7a  35 dd 20 a4 73 68 65 6c  |andle..z5. .shel|
0002c4d0  6c 5f 4d 65 6e 75 47 65  74 49 74 65 6d 48 61 6e  |l_MenuGetItemHan|
0002c4e0  64 6c 65 28 6d 65 6e 75  5f 68 61 6e 64 6c 65 25  |dle(menu_handle%|
0002c4f0  2c 69 74 65 6d 5f 6e 72  25 29 0d 17 7b 1d ea 20  |,item_nr%)..{.. |
0002c500  6d 5f 73 65 6c 5f 62 6c  6b 25 2c 70 74 72 25 2c  |m_sel_blk%,ptr%,|
0002c510  68 61 6e 64 6c 65 25 0d  17 7c 29 6d 5f 73 65 6c  |handle%..|)m_sel|
0002c520  5f 62 6c 6b 25 20 3d 20  a4 73 68 65 6c 6c 5f 48  |_blk% = .shell_H|
0002c530  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 38 29  |eapBlockFetch(8)|
0002c540  0d 17 7d 1c 6d 5f 73 65  6c 5f 62 6c 6b 25 21 30  |..}.m_sel_blk%!0|
0002c550  30 20 3d 20 69 74 65 6d  5f 6e 72 25 0d 17 7e 16  |0 = item_nr%..~.|
0002c560  6d 5f 73 65 6c 5f 62 6c  6b 25 21 30 34 20 3d 20  |m_sel_blk%!04 = |
0002c570  2d 31 0d 17 7f 39 c8 99  20 22 4d 65 6e 75 55 74  |-1...9.. "MenuUt|
0002c580  69 6c 5f 44 65 63 6f 64  65 22 2c 6d 65 6e 75 5f  |il_Decode",menu_|
0002c590  68 61 6e 64 6c 65 25 2c  6d 5f 73 65 6c 5f 62 6c  |handle%,m_sel_bl|
0002c5a0  6b 25 20 b8 20 2c 2c 70  74 72 25 0d 17 80 15 68  |k% . ,,ptr%....h|
0002c5b0  61 6e 64 6c 65 25 20 3d  20 70 74 72 25 21 30 38  |andle% = ptr%!08|
0002c5c0  0d 17 81 26 f2 73 68 65  6c 6c 5f 48 65 61 70 42  |...&.shell_HeapB|
0002c5d0  6c 6f 63 6b 52 65 74 75  72 6e 28 6d 5f 73 65 6c  |lockReturn(m_sel|
0002c5e0  5f 62 6c 6b 25 29 0d 17  82 0d 3d 20 68 61 6e 64  |_blk%)....= hand|
0002c5f0  6c 65 25 0d 17 83 05 3a  0d 17 84 24 2a 7c 53 74  |le%....:...$*|St|
0002c600  6f 70 20 46 4e 73 68 65  6c 6c 5f 4d 65 6e 75 47  |op FNshell_MenuG|
0002c610  65 74 49 74 65 6d 48 61  6e 64 6c 65 0d 17 85 04  |etItemHandle....|
0002c620  0d 17 86 25 2a 7c 53 74  61 72 74 20 46 4e 73 68  |...%*|Start FNsh|
0002c630  65 6c 6c 5f 4d 65 6e 75  47 65 74 49 74 65 6d 48  |ell_MenuGetItemH|
0002c640  65 69 67 68 74 0d 17 87  2c dd 20 a4 73 68 65 6c  |eight...,. .shel|
0002c650  6c 5f 4d 65 6e 75 47 65  74 49 74 65 6d 48 65 69  |l_MenuGetItemHei|
0002c660  67 68 74 28 6d 65 6e 75  5f 68 61 6e 64 6c 65 25  |ght(menu_handle%|
0002c670  29 0d 17 88 0b ea 20 6d  65 6e 75 25 0d 17 89 2b  |)..... menu%...+|
0002c680  c8 99 20 22 4d 65 6e 75  55 74 69 6c 5f 49 6e 66  |.. "MenuUtil_Inf|
0002c690  6f 22 2c 6d 65 6e 75 5f  68 61 6e 64 6c 65 25 20  |o",menu_handle% |
0002c6a0  b8 20 6d 65 6e 75 25 0d  17 8a 0e 3d 20 6d 65 6e  |. menu%....= men|
0002c6b0  75 25 21 32 30 0d 17 8b  05 3a 0d 17 8c 24 2a 7c  |u%!20....:...$*||
0002c6c0  53 74 6f 70 20 46 4e 73  68 65 6c 6c 5f 4d 65 6e  |Stop FNshell_Men|
0002c6d0  75 47 65 74 49 74 65 6d  48 65 69 67 68 74 0d 17  |uGetItemHeight..|
0002c6e0  8d 04 0d 17 8e 27 2a 7c  53 74 61 72 74 20 46 4e  |.....'*|Start FN|
0002c6f0  73 68 65 6c 6c 5f 4d 65  6e 75 43 61 6c 63 75 6c  |shell_MenuCalcul|
0002c700  61 74 65 48 65 69 67 68  74 0d 17 8f 2e dd 20 a4  |ateHeight..... .|
0002c710  73 68 65 6c 6c 5f 4d 65  6e 75 43 61 6c 63 75 6c  |shell_MenuCalcul|
0002c720  61 74 65 48 65 69 67 68  74 28 6d 65 6e 75 5f 68  |ateHeight(menu_h|
0002c730  61 6e 64 6c 65 25 29 0d  17 90 0d ea 20 68 65 69  |andle%)..... hei|
0002c740  67 68 74 25 0d 17 91 58  68 65 69 67 68 74 25 20  |ght%...Xheight% |
0002c750  3d 20 a4 73 68 65 6c 6c  5f 4d 65 6e 75 47 65 74  |= .shell_MenuGet|
0002c760  4e 72 49 74 65 6d 73 28  6d 65 6e 75 5f 68 61 6e  |NrItems(menu_han|
0002c770  64 6c 65 25 29 2a a4 73  68 65 6c 6c 5f 4d 65 6e  |dle%)*.shell_Men|
0002c780  75 47 65 74 49 74 65 6d  48 65 69 67 68 74 28 6d  |uGetItemHeight(m|
0002c790  65 6e 75 5f 68 61 6e 64  6c 65 25 29 0d 17 92 3b  |enu_handle%)...;|
0002c7a0  3d 20 68 65 69 67 68 74  25 20 2b 20 28 a4 73 68  |= height% + (.sh|
0002c7b0  65 6c 6c 5f 4d 65 6e 75  47 65 74 4e 72 44 6f 74  |ell_MenuGetNrDot|
0002c7c0  74 65 64 28 6d 65 6e 75  5f 68 61 6e 64 6c 65 25  |ted(menu_handle%|
0002c7d0  29 20 2a 20 32 34 29 0d  17 93 05 3a 0d 17 94 26  |) * 24)....:...&|
0002c7e0  2a 7c 53 74 6f 70 20 46  4e 73 68 65 6c 6c 5f 4d  |*|Stop FNshell_M|
0002c7f0  65 6e 75 43 61 6c 63 75  6c 61 74 65 48 65 69 67  |enuCalculateHeig|
0002c800  68 74 0d 17 95 04 0d 17  96 23 2a 7c 53 74 61 72  |ht.......#*|Star|
0002c810  74 20 50 52 4f 43 73 68  65 6c 6c 5f 4d 65 6e 75  |t PROCshell_Menu|
0002c820  53 6f 72 74 49 74 65 6d  73 0d 17 97 3a dd 20 f2  |SortItems...:. .|
0002c830  73 68 65 6c 6c 5f 4d 65  6e 75 53 6f 72 74 49 74  |shell_MenuSortIt|
0002c840  65 6d 73 28 6d 65 6e 75  25 2c 63 6f 6d 70 46 4e  |ems(menu%,compFN|
0002c850  24 2c 61 73 63 25 2c 73  74 61 72 74 25 2c 65 6e  |$,asc%,start%,en|
0002c860  64 25 29 0d 17 98 0f ea  20 6e 72 5f 69 74 65 6d  |d%)..... nr_item|
0002c870  73 25 0d 17 99 30 6e 72  5f 69 74 65 6d 73 25 20  |s%...0nr_items% |
0002c880  3d 20 a4 73 68 65 6c 6c  5f 4d 65 6e 75 47 65 74  |= .shell_MenuGet|
0002c890  4e 72 49 74 65 6d 73 28  6d 65 6e 75 25 29 20 2d  |NrItems(menu%) -|
0002c8a0  20 31 0d 17 9a 1d 5f 73  68 65 6c 6c 5f 4d 53 5f  | 1...._shell_MS_|
0002c8b0  68 61 6e 64 6c 65 25 20  3d 20 6d 65 6e 75 25 0d  |handle% = menu%.|
0002c8c0  17 9b 29 e7 20 65 6e 64  25 20 3e 20 6e 72 5f 69  |..). end% > nr_i|
0002c8d0  74 65 6d 73 25 20 8c 20  65 6e 64 25 20 3d 20 6e  |tems% . end% = n|
0002c8e0  72 5f 69 74 65 6d 73 25  0d 17 9c 15 c8 99 20 22  |r_items%...... "|
0002c8f0  48 6f 75 72 67 6c 61 73  73 5f 4f 6e 22 0d 17 9d  |Hourglass_On"...|
0002c900  3a f2 73 68 65 6c 6c 5f  51 75 69 63 6b 53 6f 72  |:.shell_QuickSor|
0002c910  74 28 63 6f 6d 70 46 4e  24 2c 22 5f 73 68 65 6c  |t(compFN$,"_shel|
0002c920  6c 5f 4d 53 5f 73 77 61  70 22 2c 61 73 63 25 2c  |l_MS_swap",asc%,|
0002c930  30 2c 65 6e 64 25 29 0d  17 9e 16 c8 99 20 22 48  |0,end%)...... "H|
0002c940  6f 75 72 67 6c 61 73 73  5f 4f 66 66 22 0d 17 9f  |ourglass_Off"...|
0002c950  05 e1 0d 17 a0 05 3a 0d  17 a1 22 2a 7c 53 74 6f  |......:..."*|Sto|
0002c960  70 20 50 52 4f 43 73 68  65 6c 6c 5f 4d 65 6e 75  |p PROCshell_Menu|
0002c970  53 6f 72 74 49 74 65 6d  73 0d 17 a2 04 0d 17 a3  |SortItems.......|
0002c980  1f 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |.*|Start PROCshe|
0002c990  6c 6c 5f 51 75 69 63 6b  53 6f 72 74 0d 17 a4 3d  |ll_QuickSort...=|
0002c9a0  dd 20 f2 73 68 65 6c 6c  5f 51 75 69 63 6b 53 6f  |. .shell_QuickSo|
0002c9b0  72 74 28 63 6f 6d 70 5f  46 4e 24 2c 73 77 61 70  |rt(comp_FN$,swap|
0002c9c0  5f 46 4e 24 2c 5f 61 73  63 25 2c 5f 73 74 61 72  |_FN$,_asc%,_star|
0002c9d0  74 25 2c 5f 65 6e 64 25  29 0d 17 a5 1f ea 20 5f  |t%,_end%)..... _|
0002c9e0  6c 6f 25 2c 5f 68 25 2c  5f 46 25 2c 5f 74 65 6d  |lo%,_h%,_F%,_tem|
0002c9f0  70 25 2c 76 6f 69 64 25  0d 17 a6 27 5f 6c 6f 25  |p%,void%...'_lo%|
0002ca00  20 3d 20 5f 73 74 61 72  74 25 3a 5f 68 69 25 20  | = _start%:_hi% |
0002ca10  3d 20 5f 65 6e 64 25 3a  5f 46 25 20 3d 20 b9 0d  |= _end%:_F% = ..|
0002ca20  17 a7 29 5f 74 65 6d 70  25 20 3d 20 5f 6c 6f 25  |..)_temp% = _lo%|
0002ca30  20 2d 31 20 2b 20 b3 28  5f 68 69 25 20 2b 20 31  | -1 + .(_hi% + 1|
0002ca40  20 2d 20 5f 6c 6f 25 29  0d 17 a8 2c 76 6f 69 64  | - _lo%)...,void|
0002ca50  25 20 3d 20 a0 28 22 46  4e 22 2b 73 77 61 70 5f  |% = .("FN"+swap_|
0002ca60  46 4e 24 2b 22 28 5f 6c  6f 25 2c 5f 74 65 6d 70  |FN$+"(_lo%,_temp|
0002ca70  25 29 22 29 0d 17 a9 05  f5 0d 17 aa 13 20 20 e7  |%)").........  .|
0002ca80  20 5f 61 73 63 25 20 3d  20 30 20 8c 0d 17 ab 2a  | _asc% = 0 ....*|
0002ca90  20 20 20 20 e7 20 a0 28  22 46 4e 22 2b 63 6f 6d  |    . .("FN"+com|
0002caa0  70 5f 46 4e 24 2b 22 28  5f 6c 6f 25 2c 5f 68 69  |p_FN$+"(_lo%,_hi|
0002cab0  25 29 22 29 20 8c 0d 17  ac 30 20 20 20 20 20 20  |%)") ....0      |
0002cac0  76 6f 69 64 25 20 3d 20  a0 28 22 46 4e 22 2b 73  |void% = .("FN"+s|
0002cad0  77 61 70 5f 46 4e 24 2b  22 28 5f 6c 6f 25 2c 5f  |wap_FN$+"(_lo%,_|
0002cae0  68 69 25 29 22 29 0d 17  ad 15 20 20 20 20 20 20  |hi%)")....      |
0002caf0  5f 46 25 20 3d 20 ac 20  5f 46 25 0d 17 ae 09 20  |_F% = . _F%.... |
0002cb00  20 20 20 cd 0d 17 af 07  20 20 cc 0d 17 b0 2a 20  |   .....  ....* |
0002cb10  20 20 20 e7 20 a0 28 22  46 4e 22 2b 63 6f 6d 70  |   . .("FN"+comp|
0002cb20  5f 46 4e 24 2b 22 28 5f  68 69 25 2c 5f 6c 6f 25  |_FN$+"(_hi%,_lo%|
0002cb30  29 22 29 20 8c 0d 17 b1  30 20 20 20 20 20 20 76  |)") ....0      v|
0002cb40  6f 69 64 25 20 3d 20 a0  28 22 46 4e 22 2b 73 77  |oid% = .("FN"+sw|
0002cb50  61 70 5f 46 4e 24 2b 22  28 5f 68 69 25 2c 5f 6c  |ap_FN$+"(_hi%,_l|
0002cb60  6f 25 29 22 29 0d 17 b2  15 20 20 20 20 20 20 5f  |o%)")....      _|
0002cb70  46 25 20 3d 20 ac 20 5f  46 25 0d 17 b3 09 20 20  |F% = . _F%....  |
0002cb80  20 20 cd 0d 17 b4 07 20  20 cd 0d 17 b5 2f 20 20  |  .....  ..../  |
0002cb90  e7 20 5f 46 25 20 8c 20  5f 68 69 25 20 3d 20 5f  |. _F% . _hi% = _|
0002cba0  68 69 25 20 2d 20 31 20  8b 20 5f 6c 6f 25 20 3d  |hi% - 1 . _lo% =|
0002cbb0  20 5f 6c 6f 25 20 2b 20  31 0d 17 b6 11 fd 20 5f  | _lo% + 1..... _|
0002cbc0  6c 6f 25 20 3d 20 5f 68  69 25 0d 17 b7 55 e7 20  |lo% = _hi%...U. |
0002cbd0  5f 73 74 61 72 74 25 20  3c 20 5f 6c 6f 25 20 2d  |_start% < _lo% -|
0002cbe0  20 31 20 8c 20 f2 73 68  65 6c 6c 5f 51 75 69 63  | 1 . .shell_Quic|
0002cbf0  6b 53 6f 72 74 28 63 6f  6d 70 5f 46 4e 24 2c 73  |kSort(comp_FN$,s|
0002cc00  77 61 70 5f 46 4e 24 2c  5f 61 73 63 25 2c 5f 73  |wap_FN$,_asc%,_s|
0002cc10  74 61 72 74 25 2c 5f 6c  6f 25 20 2d 20 31 29 0d  |tart%,_lo% - 1).|
0002cc20  17 b8 53 e7 20 5f 68 69  25 20 2b 20 31 20 3c 20  |..S. _hi% + 1 < |
0002cc30  5f 65 6e 64 25 20 20 20  8c 20 f2 73 68 65 6c 6c  |_end%   . .shell|
0002cc40  5f 51 75 69 63 6b 53 6f  72 74 28 63 6f 6d 70 5f  |_QuickSort(comp_|
0002cc50  46 4e 24 2c 73 77 61 70  5f 46 4e 24 2c 5f 61 73  |FN$,swap_FN$,_as|
0002cc60  63 25 2c 5f 68 69 25 20  2b 20 31 2c 5f 65 6e 64  |c%,_hi% + 1,_end|
0002cc70  25 29 0d 17 b9 05 e1 0d  17 ba 05 3a 0d 17 bb 1e  |%).........:....|
0002cc80  2a 7c 53 74 6f 70 20 50  52 4f 43 73 68 65 6c 6c  |*|Stop PROCshell|
0002cc90  5f 51 75 69 63 6b 53 6f  72 74 0d 17 bc 04 0d 17  |_QuickSort......|
0002cca0  bd 1b 2a 7c 53 74 61 72  74 20 46 4e 73 68 65 6c  |..*|Start FNshel|
0002ccb0  6c 5f 4d 53 5f 73 77 61  70 0d 17 be 1e dd 20 a4  |l_MS_swap..... .|
0002ccc0  5f 73 68 65 6c 6c 5f 4d  53 5f 73 77 61 70 28 65  |_shell_MS_swap(e|
0002ccd0  31 25 2c 65 32 25 29 0d  17 bf 1b ea 20 74 65 72  |1%,e2%)..... ter|
0002cce0  6d 31 24 2c 74 65 72 6d  32 24 2c 68 31 25 2c 68  |m1$,term2$,h1%,h|
0002ccf0  32 25 0d 17 c0 3a 74 65  72 6d 31 24 20 3d 20 a4  |2%...:term1$ = .|
0002cd00  73 68 65 6c 6c 5f 4d 65  6e 75 47 65 74 49 74 65  |shell_MenuGetIte|
0002cd10  6d 54 65 78 74 28 5f 73  68 65 6c 6c 5f 4d 53 5f  |mText(_shell_MS_|
0002cd20  68 61 6e 64 6c 65 25 2c  65 31 25 29 0d 17 c1 3a  |handle%,e1%)...:|
0002cd30  74 65 72 6d 32 24 20 3d  20 a4 73 68 65 6c 6c 5f  |term2$ = .shell_|
0002cd40  4d 65 6e 75 47 65 74 49  74 65 6d 54 65 78 74 28  |MenuGetItemText(|
0002cd50  5f 73 68 65 6c 6c 5f 4d  53 5f 68 61 6e 64 6c 65  |_shell_MS_handle|
0002cd60  25 2c 65 32 25 29 0d 17  c2 3c 68 31 25 20 20 20  |%,e2%)...<h1%   |
0002cd70  20 3d 20 a4 73 68 65 6c  6c 5f 4d 65 6e 75 47 65  | = .shell_MenuGe|
0002cd80  74 49 74 65 6d 48 61 6e  64 6c 65 28 5f 73 68 65  |tItemHandle(_she|
0002cd90  6c 6c 5f 4d 53 5f 68 61  6e 64 6c 65 25 2c 65 31  |ll_MS_handle%,e1|
0002cda0  25 29 0d 17 c3 3c 68 32  25 20 20 20 20 3d 20 a4  |%)...<h2%    = .|
0002cdb0  73 68 65 6c 6c 5f 4d 65  6e 75 47 65 74 49 74 65  |shell_MenuGetIte|
0002cdc0  6d 48 61 6e 64 6c 65 28  5f 73 68 65 6c 6c 5f 4d  |mHandle(_shell_M|
0002cdd0  53 5f 68 61 6e 64 6c 65  25 2c 65 32 25 29 0d 17  |S_handle%,e2%)..|
0002cde0  c4 22 f2 73 68 65 6c 6c  5f 4d 65 6e 75 50 75 74  |.".shell_MenuPut|
0002cdf0  44 61 74 61 28 68 31 25  2c 74 65 72 6d 32 24 29  |Data(h1%,term2$)|
0002ce00  0d 17 c5 22 f2 73 68 65  6c 6c 5f 4d 65 6e 75 50  |...".shell_MenuP|
0002ce10  75 74 44 61 74 61 28 68  32 25 2c 74 65 72 6d 31  |utData(h2%,term1|
0002ce20  24 29 0d 17 c6 06 3d 30  0d 17 c7 05 3a 0d 17 c8  |$)....=0....:...|
0002ce30  1a 2a 7c 53 74 6f 70 20  46 4e 73 68 65 6c 6c 5f  |.*|Stop FNshell_|
0002ce40  4d 53 5f 73 77 61 70 0d  17 c9 04 0d 17 ca 1c 2a  |MS_swap........*|
0002ce50  7c 53 74 61 72 74 20 46  4e 5f 73 68 65 6c 6c 5f  ||Start FN_shell_|
0002ce60  4d 53 5f 63 6f 6d 70 0d  17 cb 1e dd 20 a4 5f 73  |MS_comp..... ._s|
0002ce70  68 65 6c 6c 5f 4d 53 5f  63 6f 6d 70 28 65 31 25  |hell_MS_comp(e1%|
0002ce80  2c 65 32 25 29 0d 17 cc  13 ea 20 74 65 72 6d 31  |,e2%)..... term1|
0002ce90  24 2c 74 65 72 6d 32 24  0d 17 cd 3a 74 65 72 6d  |$,term2$...:term|
0002cea0  31 24 20 3d 20 a4 73 68  65 6c 6c 5f 4d 65 6e 75  |1$ = .shell_Menu|
0002ceb0  47 65 74 49 74 65 6d 54  65 78 74 28 5f 73 68 65  |GetItemText(_she|
0002cec0  6c 6c 5f 4d 53 5f 68 61  6e 64 6c 65 25 2c 65 31  |ll_MS_handle%,e1|
0002ced0  25 29 0d 17 ce 3a 74 65  72 6d 32 24 20 3d 20 a4  |%)...:term2$ = .|
0002cee0  73 68 65 6c 6c 5f 4d 65  6e 75 47 65 74 49 74 65  |shell_MenuGetIte|
0002cef0  6d 54 65 78 74 28 5f 73  68 65 6c 6c 5f 4d 53 5f  |mText(_shell_MS_|
0002cf00  68 61 6e 64 6c 65 25 2c  65 32 25 29 0d 17 cf 23  |handle%,e2%)...#|
0002cf10  e7 20 bb 74 65 72 6d 31  24 20 3c 20 bb 74 65 72  |. .term1$ < .ter|
0002cf20  6d 32 24 20 8c 20 3d 20  b9 20 8b 20 3d 20 a3 0d  |m2$ . = . . = ..|
0002cf30  17 d0 05 3a 0d 17 d1 1b  2a 7c 53 74 6f 70 20 46  |...:....*|Stop F|
0002cf40  4e 5f 73 68 65 6c 6c 5f  4d 53 5f 63 6f 6d 70 0d  |N_shell_MS_comp.|
0002cf50  17 d2 04 0d 17 d3 2d 2a  7c 53 74 61 72 74 20 50  |......-*|Start P|
0002cf60  52 4f 43 73 68 65 6c 6c  5f 57 69 6e 64 6f 77 53  |ROCshell_WindowS|
0002cf70  65 74 54 69 74 6c 65 52  69 67 68 74 4a 75 73 74  |etTitleRightJust|
0002cf80  0d 17 d4 2b dd 20 f2 73  68 65 6c 6c 5f 57 69 6e  |...+. .shell_Win|
0002cf90  64 6f 77 53 65 74 54 69  74 6c 65 52 69 67 68 74  |dowSetTitleRight|
0002cfa0  4a 75 73 74 28 f8 20 77  68 25 29 0d 17 d5 25 ea  |Just(. wh%)...%.|
0002cfb0  20 77 5f 62 6c 6b 25 2c  74 5f 66 6c 61 67 73 25  | w_blk%,t_flags%|
0002cfc0  2c 68 61 6e 64 6c 65 25  2c 72 65 6f 70 65 6e 25  |,handle%,reopen%|
0002cfd0  0d 17 d6 26 72 65 6f 70  65 6e 25 20 3d 20 a4 73  |...&reopen% = .s|
0002cfe0  68 65 6c 6c 5f 57 69 6e  64 6f 77 49 73 4f 70 65  |hell_WindowIsOpe|
0002cff0  6e 28 77 68 25 29 0d 17  d7 4d 77 5f 62 6c 6b 25  |n(wh%)...Mw_blk%|
0002d000  20 3d 20 a4 73 68 65 6c  6c 5f 48 65 61 70 42 6c  | = .shell_HeapBl|
0002d010  6f 63 6b 46 65 74 63 68  28 31 30 30 20 2b 20 28  |ockFetch(100 + (|
0002d020  a4 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 43 6f 75  |.shell_WindowCou|
0002d030  6e 74 49 63 6f 6e 73 28  77 68 25 29 20 2a 20 33  |ntIcons(wh%) * 3|
0002d040  32 29 29 0d 17 d8 11 21  77 5f 62 6c 6b 25 20 3d  |2))....!w_blk% =|
0002d050  20 77 68 25 0d 17 d9 23  c8 99 20 22 57 69 6d 70  | wh%...#.. "Wimp|
0002d060  5f 47 65 74 57 69 6e 64  6f 77 49 6e 66 6f 22 2c  |_GetWindowInfo",|
0002d070  2c 77 5f 62 6c 6b 25 0d  17 da 18 74 5f 66 6c 61  |,w_blk%....t_fla|
0002d080  67 73 25 20 3d 20 77 5f  62 6c 6b 25 21 36 30 0d  |gs% = w_blk%!60.|
0002d090  17 db 1d e7 20 28 74 5f  66 6c 61 67 73 25 20 80  |.... (t_flags% .|
0002d0a0  20 28 31 20 3c 3c 20 33  29 29 20 8c 0d 17 dc 15  | (1 << 3)) .....|
0002d0b0  2a 7c 69 66 64 65 66 20  54 72 61 63 65 49 6e 69  |*|ifdef TraceIni|
0002d0c0  74 0d 17 dd 4a 20 20 f2  73 68 65 6c 6c 5f 54 72  |t...J  .shell_Tr|
0002d0d0  61 63 65 66 30 28 22 57  69 6e 64 6f 77 53 65 74  |acef0("WindowSet|
0002d0e0  54 69 74 6c 65 52 69 67  68 74 4a 75 73 74 3a 74  |TitleRightJust:t|
0002d0f0  69 74 6c 65 20 66 6c 61  67 73 20 3d 20 26 22 2b  |itle flags = &"+|
0002d100  c3 7e 74 5f 66 6c 61 67  73 25 29 0d 17 de 4e 20  |.~t_flags%)...N |
0002d110  20 f2 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  | .shell_Tracef0(|
0002d120  22 57 69 6e 64 6f 77 53  65 74 54 69 74 6c 65 52  |"WindowSetTitleR|
0002d130  69 67 68 74 4a 75 73 74  3a 48 6f 72 69 7a 6f 6e  |ightJust:Horizon|
0002d140  74 61 6c 6c 79 20 63 65  6e 74 72 65 64 20 62 69  |tally centred bi|
0002d150  74 20 73 65 74 2e 2e 22  29 0d 17 df 54 20 20 f2  |t set..")...T  .|
0002d160  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 57  |shell_Tracef0("W|
0002d170  69 6e 64 6f 77 53 65 74  54 69 74 6c 65 52 69 67  |indowSetTitleRig|
0002d180  68 74 4a 75 73 74 3a 55  6e 73 65 74 74 69 6e 67  |htJust:Unsetting|
0002d190  20 68 6f 72 69 7a 6f 6e  74 61 6c 6c 79 20 63 65  | horizontally ce|
0002d1a0  6e 74 72 65 64 20 62 69  74 2e 2e 22 29 0d 17 e0  |ntred bit..")...|
0002d1b0  0b 2a 7c 65 6e 64 69 66  0d 17 e1 24 20 20 74 5f  |.*|endif...$  t_|
0002d1c0  66 6c 61 67 73 25 20 3d  20 74 5f 66 6c 61 67 73  |flags% = t_flags|
0002d1d0  25 20 82 20 28 31 20 3c  3c 20 33 29 0d 17 e2 15  |% . (1 << 3)....|
0002d1e0  2a 7c 69 66 64 65 66 20  54 72 61 63 65 49 6e 69  |*|ifdef TraceIni|
0002d1f0  74 0d 17 e3 4a 20 20 f2  73 68 65 6c 6c 5f 54 72  |t...J  .shell_Tr|
0002d200  61 63 65 66 30 28 22 57  69 6e 64 6f 77 53 65 74  |acef0("WindowSet|
0002d210  54 69 74 6c 65 52 69 67  68 74 4a 75 73 74 3a 74  |TitleRightJust:t|
0002d220  69 74 6c 65 20 66 6c 61  67 73 20 3d 20 26 22 2b  |itle flags = &"+|
0002d230  c3 7e 74 5f 66 6c 61 67  73 25 29 0d 17 e4 0b 2a  |.~t_flags%)....*|
0002d240  7c 65 6e 64 69 66 0d 17  e5 05 cc 0d 17 e6 15 2a  ||endif.........*|
0002d250  7c 69 66 64 65 66 20 54  72 61 63 65 49 6e 69 74  ||ifdef TraceInit|
0002d260  0d 17 e7 52 20 20 f2 73  68 65 6c 6c 5f 54 72 61  |...R  .shell_Tra|
0002d270  63 65 66 30 28 22 57 69  6e 64 6f 77 53 65 74 54  |cef0("WindowSetT|
0002d280  69 74 6c 65 52 69 67 68  74 4a 75 73 74 3a 48 6f  |itleRightJust:Ho|
0002d290  72 69 7a 6f 6e 74 61 6c  6c 79 20 63 65 6e 74 72  |rizontally centr|
0002d2a0  65 64 20 62 69 74 20 4e  4f 54 20 73 65 74 2e 2e  |ed bit NOT set..|
0002d2b0  22 29 0d 17 e8 0b 2a 7c  65 6e 64 69 66 0d 17 e9  |")....*|endif...|
0002d2c0  05 cd 0d 17 ea 15 2a 7c  69 66 64 65 66 20 54 72  |......*|ifdef Tr|
0002d2d0  61 63 65 49 6e 69 74 0d  17 eb 4b f2 73 68 65 6c  |aceInit...K.shel|
0002d2e0  6c 5f 54 72 61 63 65 66  30 28 22 57 69 6e 64 6f  |l_Tracef0("Windo|
0002d2f0  77 53 65 74 54 69 74 6c  65 52 69 67 68 74 4a 75  |wSetTitleRightJu|
0002d300  73 74 3a 53 65 74 74 69  6e 67 20 72 69 67 68 74  |st:Setting right|
0002d310  20 6a 75 73 74 69 66 69  65 64 20 62 69 74 2e 2e  | justified bit..|
0002d320  22 29 0d 17 ec 0b 2a 7c  65 6e 64 69 66 0d 17 ed  |")....*|endif...|
0002d330  22 74 5f 66 6c 61 67 73  25 20 3d 20 74 5f 66 6c  |"t_flags% = t_fl|
0002d340  61 67 73 25 20 84 20 28  31 20 3c 3c 20 39 29 0d  |ags% . (1 << 9).|
0002d350  17 ee 18 77 5f 62 6c 6b  25 21 36 30 20 3d 20 74  |...w_blk%!60 = t|
0002d360  5f 66 6c 61 67 73 25 0d  17 ef 22 c8 99 20 22 57  |_flags%...".. "W|
0002d370  69 6d 70 5f 44 65 6c 65  74 65 57 69 6e 64 6f 77  |imp_DeleteWindow|
0002d380  22 2c 2c 77 5f 62 6c 6b  25 0d 17 f0 30 c8 99 20  |",,w_blk%...0.. |
0002d390  22 57 69 6d 70 5f 43 72  65 61 74 65 57 69 6e 64  |"Wimp_CreateWind|
0002d3a0  6f 77 22 2c 2c 77 5f 62  6c 6b 25 20 2b 20 34 20  |ow",,w_blk% + 4 |
0002d3b0  b8 20 68 61 6e 64 6c 65  25 0d 17 f1 16 e7 20 77  |. handle%..... w|
0002d3c0  68 25 20 3c 3e 20 68 61  6e 64 6c 65 25 20 8c 0d  |h% <> handle% ..|
0002d3d0  17 f2 15 2a 7c 69 66 64  65 66 20 54 72 61 63 65  |...*|ifdef Trace|
0002d3e0  49 6e 69 74 0d 17 f3 49  20 20 f2 73 68 65 6c 6c  |Init...I  .shell|
0002d3f0  5f 54 72 61 63 65 66 30  28 22 57 69 6e 64 6f 77  |_Tracef0("Window|
0002d400  53 65 74 54 69 74 6c 65  52 69 67 68 74 4a 75 73  |SetTitleRightJus|
0002d410  74 3a 55 70 64 61 74 69  6e 67 20 77 69 6e 64 6f  |t:Updating windo|
0002d420  77 20 68 61 6e 64 6c 65  2e 2e 2e 22 29 0d 17 f4  |w handle...")...|
0002d430  0b 2a 7c 65 6e 64 69 66  0d 17 f5 2c 20 20 f2 73  |.*|endif...,  .s|
0002d440  68 65 6c 6c 5f 55 70 64  61 74 65 57 69 6e 64 6f  |hell_UpdateWindo|
0002d450  77 48 61 6e 64 6c 65 28  77 68 25 2c 68 61 6e 64  |wHandle(wh%,hand|
0002d460  6c 65 25 29 0d 17 f6 13  20 20 77 68 25 20 3d 20  |le%)....  wh% = |
0002d470  68 61 6e 64 6c 65 25 0d  17 f7 05 cd 0d 17 f8 2e  |handle%.........|
0002d480  e7 20 72 65 6f 70 65 6e  25 20 8c 20 f2 73 68 65  |. reopen% . .she|
0002d490  6c 6c 5f 4f 70 65 6e 57  69 6e 64 6f 77 28 68 61  |ll_OpenWindow(ha|
0002d4a0  6e 64 6c 65 25 2c 30 2c  30 29 0d 17 f9 22 f2 73  |ndle%,0,0)...".s|
0002d4b0  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 52 65  |hell_HeapBlockRe|
0002d4c0  74 75 72 6e 28 77 5f 62  6c 6b 25 29 0d 17 fa 05  |turn(w_blk%)....|
0002d4d0  e1 0d 17 fb 05 3a 0d 17  fc 2c 2a 7c 53 74 6f 70  |.....:...,*|Stop|
0002d4e0  20 50 52 4f 43 73 68 65  6c 6c 5f 57 69 6e 64 6f  | PROCshell_Windo|
0002d4f0  77 53 65 74 54 69 74 6c  65 52 69 67 68 74 4a 75  |wSetTitleRightJu|
0002d500  73 74 0d 17 fd 04 0d 17  fe 2e 2a 7c 53 74 61 72  |st........*|Star|
0002d510  74 20 50 52 4f 43 73 68  65 6c 6c 5f 57 69 6e 64  |t PROCshell_Wind|
0002d520  6f 77 53 65 74 54 69 74  6c 65 43 65 6e 74 72 65  |owSetTitleCentre|
0002d530  4a 75 73 74 0d 17 ff 2c  dd 20 f2 73 68 65 6c 6c  |Just...,. .shell|
0002d540  5f 57 69 6e 64 6f 77 53  65 74 54 69 74 6c 65 43  |_WindowSetTitleC|
0002d550  65 6e 74 72 65 4a 75 73  74 28 f8 20 77 68 25 29  |entreJust(. wh%)|
0002d560  0d 18 00 25 ea 20 77 5f  62 6c 6b 25 2c 74 5f 66  |...%. w_blk%,t_f|
0002d570  6c 61 67 73 25 2c 68 61  6e 64 6c 65 25 2c 72 65  |lags%,handle%,re|
0002d580  6f 70 65 6e 25 0d 18 01  26 72 65 6f 70 65 6e 25  |open%...&reopen%|
0002d590  20 3d 20 a4 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  | = .shell_Window|
0002d5a0  49 73 4f 70 65 6e 28 77  68 25 29 0d 18 02 4d 77  |IsOpen(wh%)...Mw|
0002d5b0  5f 62 6c 6b 25 20 3d 20  a4 73 68 65 6c 6c 5f 48  |_blk% = .shell_H|
0002d5c0  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 31 30  |eapBlockFetch(10|
0002d5d0  30 20 2b 20 28 a4 73 68  65 6c 6c 5f 57 69 6e 64  |0 + (.shell_Wind|
0002d5e0  6f 77 43 6f 75 6e 74 49  63 6f 6e 73 28 77 68 25  |owCountIcons(wh%|
0002d5f0  29 20 2a 20 33 32 29 29  0d 18 03 11 21 77 5f 62  |) * 32))....!w_b|
0002d600  6c 6b 25 20 3d 20 77 68  25 0d 18 04 23 c8 99 20  |lk% = wh%...#.. |
0002d610  22 57 69 6d 70 5f 47 65  74 57 69 6e 64 6f 77 49  |"Wimp_GetWindowI|
0002d620  6e 66 6f 22 2c 2c 77 5f  62 6c 6b 25 0d 18 05 18  |nfo",,w_blk%....|
0002d630  74 5f 66 6c 61 67 73 25  20 3d 20 77 5f 62 6c 6b  |t_flags% = w_blk|
0002d640  25 21 36 30 0d 18 06 49  f2 73 68 65 6c 6c 5f 54  |%!60...I.shell_T|
0002d650  72 61 63 65 66 30 28 22  57 69 6e 64 6f 77 53 65  |racef0("WindowSe|
0002d660  74 54 69 74 6c 65 43 65  6e 74 72 65 4a 75 73 74  |tTitleCentreJust|
0002d670  3a 74 69 74 6c 65 20 66  6c 61 67 73 20 3d 20 26  |:title flags = &|
0002d680  22 2b c3 7e 74 5f 66 6c  61 67 73 25 29 0d 18 07  |"+.~t_flags%)...|
0002d690  5f f2 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  |_.shell_Tracef0(|
0002d6a0  22 57 69 6e 64 6f 77 53  65 74 54 69 74 6c 65 43  |"WindowSetTitleC|
0002d6b0  65 6e 74 72 65 4a 75 73  74 3a 74 5f 66 6c 61 67  |entreJust:t_flag|
0002d6c0  73 25 20 41 4e 44 20 28  31 20 3c 3c 20 33 29 20  |s% AND (1 << 3) |
0002d6d0  3d 20 22 2b c3 7e 28 74  5f 66 6c 61 67 73 25 20  |= "+.~(t_flags% |
0002d6e0  80 20 28 31 20 3c 3c 20  33 29 29 29 0d 18 08 21  |. (1 << 3)))...!|
0002d6f0  e7 20 28 74 5f 66 6c 61  67 73 25 20 80 20 28 31  |. (t_flags% . (1|
0002d700  20 3c 3c 20 33 29 29 20  3d 20 30 20 8c 0d 18 09  | << 3)) = 0 ....|
0002d710  15 2a 7c 69 66 64 65 66  20 54 72 61 63 65 49 6e  |.*|ifdef TraceIn|
0002d720  69 74 0d 18 0a 53 20 20  f2 73 68 65 6c 6c 5f 54  |it...S  .shell_T|
0002d730  72 61 63 65 66 30 28 22  57 69 6e 64 6f 77 53 65  |racef0("WindowSe|
0002d740  74 54 69 74 6c 65 43 65  6e 74 72 65 4a 75 73 74  |tTitleCentreJust|
0002d750  3a 48 6f 72 69 7a 6f 6e  74 61 6c 6c 79 20 63 65  |:Horizontally ce|
0002d760  6e 74 72 65 64 20 62 69  74 20 6e 6f 74 20 73 65  |ntred bit not se|
0002d770  74 2e 2e 22 29 0d 18 0b  53 20 20 f2 73 68 65 6c  |t..")...S  .shel|
0002d780  6c 5f 54 72 61 63 65 66  30 28 22 57 69 6e 64 6f  |l_Tracef0("Windo|
0002d790  77 53 65 74 54 69 74 6c  65 43 65 6e 74 72 65 4a  |wSetTitleCentreJ|
0002d7a0  75 73 74 3a 53 65 74 74  69 6e 67 20 68 6f 72 69  |ust:Setting hori|
0002d7b0  7a 6f 6e 74 61 6c 6c 79  20 63 65 6e 74 72 65 64  |zontally centred|
0002d7c0  20 62 69 74 2e 2e 22 29  0d 18 0c 0b 2a 7c 65 6e  | bit..")....*|en|
0002d7d0  64 69 66 0d 18 0d 24 20  20 74 5f 66 6c 61 67 73  |dif...$  t_flags|
0002d7e0  25 20 3d 20 74 5f 66 6c  61 67 73 25 20 82 20 28  |% = t_flags% . (|
0002d7f0  31 20 3c 3c 20 33 29 0d  18 0e 15 2a 7c 69 66 64  |1 << 3)....*|ifd|
0002d800  65 66 20 54 72 61 63 65  49 6e 69 74 0d 18 0f 4b  |ef TraceInit...K|
0002d810  20 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |  .shell_Tracef0|
0002d820  28 22 57 69 6e 64 6f 77  53 65 74 54 69 74 6c 65  |("WindowSetTitle|
0002d830  43 65 6e 74 72 65 4a 75  73 74 3a 74 69 74 6c 65  |CentreJust:title|
0002d840  20 66 6c 61 67 73 20 3d  20 26 22 2b c3 7e 74 5f  | flags = &"+.~t_|
0002d850  66 6c 61 67 73 25 29 0d  18 10 0b 2a 7c 65 6e 64  |flags%)....*|end|
0002d860  69 66 0d 18 11 1a 20 20  77 5f 62 6c 6b 25 21 36  |if....  w_blk%!6|
0002d870  30 20 3d 20 74 5f 66 6c  61 67 73 25 0d 18 12 24  |0 = t_flags%...$|
0002d880  20 20 c8 99 20 22 57 69  6d 70 5f 44 65 6c 65 74  |  .. "Wimp_Delet|
0002d890  65 57 69 6e 64 6f 77 22  2c 2c 77 5f 62 6c 6b 25  |eWindow",,w_blk%|
0002d8a0  0d 18 13 32 20 20 c8 99  20 22 57 69 6d 70 5f 43  |...2  .. "Wimp_C|
0002d8b0  72 65 61 74 65 57 69 6e  64 6f 77 22 2c 2c 77 5f  |reateWindow",,w_|
0002d8c0  62 6c 6b 25 20 2b 20 34  20 b8 20 68 61 6e 64 6c  |blk% + 4 . handl|
0002d8d0  65 25 0d 18 14 18 20 20  e7 20 77 68 25 20 3c 3e  |e%....  . wh% <>|
0002d8e0  20 68 61 6e 64 6c 65 25  20 8c 0d 18 15 17 20 20  | handle% .....  |
0002d8f0  2a 7c 69 66 64 65 66 20  54 72 61 63 65 49 6e 69  |*|ifdef TraceIni|
0002d900  74 0d 18 16 4c 20 20 20  20 f2 73 68 65 6c 6c 5f  |t...L    .shell_|
0002d910  54 72 61 63 65 66 30 28  22 57 69 6e 64 6f 77 53  |Tracef0("WindowS|
0002d920  65 74 54 69 74 6c 65 43  65 6e 74 72 65 4a 75 73  |etTitleCentreJus|
0002d930  74 3a 55 70 64 61 74 69  6e 67 20 77 69 6e 64 6f  |t:Updating windo|
0002d940  77 20 68 61 6e 64 6c 65  2e 2e 2e 22 29 0d 18 17  |w handle...")...|
0002d950  0d 20 20 2a 7c 65 6e 64  69 66 0d 18 18 2e 20 20  |.  *|endif....  |
0002d960  20 20 f2 73 68 65 6c 6c  5f 55 70 64 61 74 65 57  |  .shell_UpdateW|
0002d970  69 6e 64 6f 77 48 61 6e  64 6c 65 28 77 68 25 2c  |indowHandle(wh%,|
0002d980  68 61 6e 64 6c 65 25 29  0d 18 19 15 20 20 20 20  |handle%)....    |
0002d990  77 68 25 20 3d 20 68 61  6e 64 6c 65 25 0d 18 1a  |wh% = handle%...|
0002d9a0  07 20 20 cd 0d 18 1b 30  20 20 e7 20 72 65 6f 70  |.  ....0  . reop|
0002d9b0  65 6e 25 20 8c 20 f2 73  68 65 6c 6c 5f 4f 70 65  |en% . .shell_Ope|
0002d9c0  6e 57 69 6e 64 6f 77 28  68 61 6e 64 6c 65 25 2c  |nWindow(handle%,|
0002d9d0  30 2c 30 29 0d 18 1c 05  cd 0d 18 1d 04 0d 18 1e  |0,0)............|
0002d9e0  22 f2 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |".shell_HeapBloc|
0002d9f0  6b 52 65 74 75 72 6e 28  77 5f 62 6c 6b 25 29 0d  |kReturn(w_blk%).|
0002da00  18 1f 05 e1 0d 18 20 05  3a 0d 18 21 2d 2a 7c 53  |...... .:..!-*|S|
0002da10  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 57 69  |top PROCshell_Wi|
0002da20  6e 64 6f 77 53 65 74 54  69 74 6c 65 43 65 6e 74  |ndowSetTitleCent|
0002da30  72 65 4a 75 73 74 0d 18  22 04 0d 18 23 2a 2a 7c  |reJust.."...#**||
0002da40  53 74 61 72 74 20 50 52  4f 43 73 68 65 6c 6c 5f  |Start PROCshell_|
0002da50  49 63 6f 6e 47 65 74 53  65 6c 65 63 74 65 64 49  |IconGetSelectedI|
0002da60  63 6f 6e 73 0d 18 24 34  dd 20 f2 73 68 65 6c 6c  |cons..$4. .shell|
0002da70  5f 49 63 6f 6e 47 65 74  53 65 6c 65 63 74 65 64  |_IconGetSelected|
0002da80  49 63 6f 6e 73 28 77 68  25 2c 65 73 67 25 2c f8  |Icons(wh%,esg%,.|
0002da90  20 69 5f 62 6c 6b 25 29  0d 18 25 0c ea 20 69 6d  | i_blk%)..%.. im|
0002daa0  61 73 6b 25 0d 18 26 27  69 6d 61 73 6b 25 20 20  |ask%..&'imask%  |
0002dab0  20 3d 20 28 65 73 67 25  20 3c 3c 20 31 36 29 20  | = (esg% << 16) |
0002dac0  2b 20 28 31 20 3c 3c 20  32 31 29 0d 18 27 42 c8  |+ (1 << 21)..'B.|
0002dad0  99 20 22 57 69 6d 70 5f  57 68 69 63 68 49 63 6f  |. "Wimp_WhichIco|
0002dae0  6e 22 2c 77 68 25 2c 69  5f 62 6c 6b 25 2c 69 6d  |n",wh%,i_blk%,im|
0002daf0  61 73 6b 25 2c 28 65 73  67 25 20 3c 3c 20 31 36  |ask%,(esg% << 16|
0002db00  29 20 2b 20 28 31 20 3c  3c 20 32 31 29 0d 18 28  |) + (1 << 21)..(|
0002db10  05 e1 0d 18 29 05 3a 0d  18 2a 29 2a 7c 53 74 6f  |....).:..*)*|Sto|
0002db20  70 20 50 52 4f 43 73 68  65 6c 6c 5f 49 63 6f 6e  |p PROCshell_Icon|
0002db30  47 65 74 53 65 6c 65 63  74 65 64 49 63 6f 6e 73  |GetSelectedIcons|
0002db40  0d 18 2b 04 0d 18 2c 26  2a 7c 53 74 61 72 74 20  |..+...,&*|Start |
0002db50  46 4e 73 68 65 6c 6c 5f  47 65 74 4c 61 73 74 4d  |FNshell_GetLastM|
0002db60  6f 75 73 65 42 75 74 74  6f 6e 0d 18 2d 1f dd 20  |ouseButton..-.. |
0002db70  a4 73 68 65 6c 6c 5f 47  65 74 4c 61 73 74 4d 6f  |.shell_GetLastMo|
0002db80  75 73 65 42 75 74 74 6f  6e 0d 18 2e 0d 3d 20 5f  |useButton....= _|
0002db90  55 25 21 33 32 30 0d 18  2f 05 3a 0d 18 30 25 2a  |U%!320../.:..0%*|
0002dba0  7c 53 74 6f 70 20 46 4e  73 68 65 6c 6c 5f 47 65  ||Stop FNshell_Ge|
0002dbb0  74 4c 61 73 74 4d 6f 75  73 65 42 75 74 74 6f 6e  |tLastMouseButton|
0002dbc0  0d 18 31 04 0d 18 32 28  2a 7c 53 74 61 72 74 20  |..1...2(*|Start |
0002dbd0  46 4e 73 68 65 6c 6c 5f  47 65 74 4c 61 73 74 57  |FNshell_GetLastW|
0002dbe0  69 6e 64 6f 77 43 6c 69  63 6b 65 64 0d 18 33 21  |indowClicked..3!|
0002dbf0  dd 20 a4 73 68 65 6c 6c  5f 47 65 74 4c 61 73 74  |. .shell_GetLast|
0002dc00  57 69 6e 64 6f 77 43 6c  69 63 6b 65 64 0d 18 34  |WindowClicked..4|
0002dc10  0c 3d 20 5f 55 25 21 32  38 0d 18 35 05 3a 0d 18  |.= _U%!28..5.:..|
0002dc20  36 27 2a 7c 53 74 6f 70  20 46 4e 73 68 65 6c 6c  |6'*|Stop FNshell|
0002dc30  5f 47 65 74 4c 61 73 74  57 69 6e 64 6f 77 43 6c  |_GetLastWindowCl|
0002dc40  69 63 6b 65 64 0d 18 37  04 0d 18 38 26 2a 7c 53  |icked..7...8&*|S|
0002dc50  74 61 72 74 20 46 4e 73  68 65 6c 6c 5f 47 65 74  |tart FNshell_Get|
0002dc60  4c 61 73 74 49 63 6f 6e  43 6c 69 63 6b 65 64 0d  |LastIconClicked.|
0002dc70  18 39 1f dd 20 a4 73 68  65 6c 6c 5f 47 65 74 4c  |.9.. .shell_GetL|
0002dc80  61 73 74 49 63 6f 6e 43  6c 69 63 6b 65 64 0d 18  |astIconClicked..|
0002dc90  3a 0c 3d 20 5f 55 25 21  33 32 0d 18 3b 05 3a 0d  |:.= _U%!32..;.:.|
0002dca0  18 3c 25 2a 7c 53 74 6f  70 20 46 4e 73 68 65 6c  |.<%*|Stop FNshel|
0002dcb0  6c 5f 47 65 74 4c 61 73  74 49 63 6f 6e 43 6c 69  |l_GetLastIconCli|
0002dcc0  63 6b 65 64 0d 18 3d 04  0d 18 3e 21 2a 7c 53 74  |cked..=...>!*|St|
0002dcd0  61 72 74 20 46 4e 73 68  65 6c 6c 5f 49 63 6f 6e  |art FNshell_Icon|
0002dce0  49 6e 64 69 72 53 69 7a  65 0d 18 3f 38 dd 20 a4  |IndirSize..?8. .|
0002dcf0  73 68 65 6c 6c 5f 49 63  6f 6e 49 6e 64 69 72 53  |shell_IconIndirS|
0002dd00  69 7a 65 28 66 69 6c 65  5f 6f 66 66 73 65 74 25  |ize(file_offset%|
0002dd10  2c 66 6c 61 67 73 25 2c  64 61 74 61 25 2c 58 25  |,flags%,data%,X%|
0002dd20  29 0d 18 40 24 ea 20 73  69 7a 65 25 2c 76 61 6c  |)..@$. size%,val|
0002dd30  69 64 5f 6f 66 66 73 65  74 25 2c 63 74 72 25 2c  |id_offset%,ctr%,|
0002dd40  63 68 61 72 25 0d 18 41  21 e7 20 28 66 6c 61 67  |char%..A!. (flag|
0002dd50  73 25 20 80 20 26 38 30  30 31 30 30 29 20 3d 20  |s% . &800100) = |
0002dd60  26 31 30 30 20 8c 0d 18  42 15 20 20 73 69 7a 65  |&100 ...B.  size|
0002dd70  25 20 3d 20 64 61 74 61  25 21 38 0d 18 43 28 20  |% = data%!8..C( |
0002dd80  20 e7 20 28 66 6c 61 67  73 25 20 80 20 31 29 20  | . (flags% . 1) |
0002dd90  80 20 28 64 61 74 61 25  21 34 20 3c 3e 20 2d 31  |. (data%!4 <> -1|
0002dda0  29 20 8c 0d 18 44 1f 20  20 20 20 76 61 6c 69 64  |) ...D.    valid|
0002ddb0  5f 6f 66 66 73 65 74 25  20 3d 20 64 61 74 61 25  |_offset% = data%|
0002ddc0  21 34 0d 18 45 2c 20 20  20 20 cf 23 20 58 25 20  |!4..E,    .# X% |
0002ddd0  3d 20 66 69 6c 65 5f 6f  66 66 73 65 74 25 20 2b  |= file_offset% +|
0002dde0  20 76 61 6c 69 64 5f 6f  66 66 73 65 74 25 0d 18  | valid_offset%..|
0002ddf0  46 10 20 20 20 20 63 74  72 25 20 3d 20 30 0d 18  |F.    ctr% = 0..|
0002de00  47 09 20 20 20 20 f5 0d  18 48 17 20 20 20 20 20  |G.    ...H.     |
0002de10  20 63 68 61 72 25 20 3d  20 9a 23 20 58 25 0d 18  | char% = .# X%..|
0002de20  49 13 20 20 20 20 20 20  63 74 72 25 20 2b 3d 20  |I.      ctr% += |
0002de30  31 0d 18 4a 14 20 20 20  20 fd 20 63 68 61 72 25  |1..J.    . char%|
0002de40  20 3c 20 33 32 0d 18 4b  17 20 20 20 20 73 69 7a  | < 32..K.    siz|
0002de50  65 25 20 2b 3d 20 2b 20  63 74 72 25 0d 18 4c 07  |e% += + ctr%..L.|
0002de60  20 20 cd 0d 18 4d 05 cc  0d 18 4e 0f 20 20 73 69  |  ...M....N.  si|
0002de70  7a 65 25 20 3d 20 30 0d  18 4f 05 cd 0d 18 50 0b  |ze% = 0..O....P.|
0002de80  3d 20 73 69 7a 65 25 0d  18 51 05 3a 0d 18 52 20  |= size%..Q.:..R |
0002de90  2a 7c 53 74 6f 70 20 46  4e 73 68 65 6c 6c 5f 49  |*|Stop FNshell_I|
0002dea0  63 6f 6e 49 6e 64 69 72  53 69 7a 65 0d 18 53 04  |conIndirSize..S.|
0002deb0  0d 18 54 25 2a 7c 53 74  61 72 74 20 46 4e 73 68  |..T%*|Start FNsh|
0002dec0  65 6c 6c 5f 53 74 72 6f  6e 67 48 6c 70 43 68 6b  |ell_StrongHlpChk|
0002ded0  46 69 6c 65 73 0d 18 55  25 dd 20 a4 73 68 65 6c  |Files..U%. .shel|
0002dee0  6c 5f 53 74 72 6f 6e 67  48 6c 70 43 68 6b 46 69  |l_StrongHlpChkFi|
0002def0  6c 65 73 28 70 61 74 68  24 29 0d 18 56 0c ea 20  |les(path$)..V.. |
0002df00  61 62 6f 72 74 25 0d 18  57 30 e7 20 ac 20 a4 73  |abort%..W0. . .s|
0002df10  68 65 6c 6c 5f 46 69 6c  65 45 78 69 73 74 73 28  |hell_FileExists(|
0002df20  70 61 74 68 24 20 2b 20  22 2e 48 65 6c 70 44 61  |path$ + ".HelpDa|
0002df30  74 61 22 29 20 8c 0d 18  58 22 20 20 f4 20 48 65  |ta") ...X"  . He|
0002df40  6c 70 44 61 74 61 20 66  69 6c 65 20 69 73 20 6d  |lpData file is m|
0002df50  69 73 73 69 6e 67 2e 2e  0d 18 59 11 20 20 61 62  |issing....Y.  ab|
0002df60  6f 72 74 25 20 3d 20 2d  31 0d 18 5a 38 20 20 85  |ort% = -1..Z8  .|
0002df70  20 39 39 2c a4 73 68 65  6c 6c 5f 4d 65 73 73 61  | 99,.shell_Messa|
0002df80  67 65 4f 6e 65 41 72 67  28 22 53 48 45 4c 4c 4d  |geOneArg("SHELLM|
0002df90  53 47 33 32 22 2c 22 48  65 6c 70 44 61 74 61 22  |SG32","HelpData"|
0002dfa0  29 0d 18 5b 05 cd 0d 18  5c 2d e7 20 ac 20 a4 73  |)..[....\-. . .s|
0002dfb0  68 65 6c 6c 5f 46 69 6c  65 45 78 69 73 74 73 28  |hell_FileExists(|
0002dfc0  70 61 74 68 24 20 2b 20  22 2e 49 6e 64 65 78 22  |path$ + ".Index"|
0002dfd0  29 20 8c 0d 18 5d 1f 20  20 f4 20 49 6e 64 65 78  |) ...].  . Index|
0002dfe0  20 66 69 6c 65 20 69 73  20 6d 69 73 73 69 6e 67  | file is missing|
0002dff0  2e 2e 0d 18 5e 11 20 20  61 62 6f 72 74 25 20 3d  |....^.  abort% =|
0002e000  20 2d 31 0d 18 5f 35 20  20 85 20 39 39 2c a4 73  | -1.._5  . 99,.s|
0002e010  68 65 6c 6c 5f 4d 65 73  73 61 67 65 4f 6e 65 41  |hell_MessageOneA|
0002e020  72 67 28 22 53 48 45 4c  4c 4d 53 47 33 32 22 2c  |rg("SHELLMSG32",|
0002e030  22 49 6e 64 65 78 22 29  0d 18 60 05 cd 0d 18 61  |"Index")..`....a|
0002e040  1c e7 20 61 62 6f 72 74  25 20 3d 20 a3 20 8c 20  |.. abort% = . . |
0002e050  3d 20 b9 20 8b 20 3d 20  a3 0d 18 62 05 3a 0d 18  |= . . = ...b.:..|
0002e060  63 24 2a 7c 53 74 6f 70  20 46 4e 73 68 65 6c 6c  |c$*|Stop FNshell|
0002e070  5f 53 74 72 6f 6e 67 48  6c 70 43 68 6b 46 69 6c  |_StrongHlpChkFil|
0002e080  65 73 0d 18 64 04 0d 18  65 24 2a 7c 53 74 61 72  |es..d...e$*|Star|
0002e090  74 20 50 52 4f 43 73 68  65 6c 6c 5f 43 61 72 65  |t PROCshell_Care|
0002e0a0  74 4d 6f 76 65 43 61 72  65 74 0d 18 66 28 dd 20  |tMoveCaret..f(. |
0002e0b0  f2 73 68 65 6c 6c 5f 43  61 72 65 74 4d 6f 76 65  |.shell_CaretMove|
0002e0c0  43 61 72 65 74 28 77 68  25 2c 61 63 74 69 6f 6e  |Caret(wh%,action|
0002e0d0  25 29 0d 18 67 31 ea 20  63 61 72 65 74 5f 62 6c  |%)..g1. caret_bl|
0002e0e0  6b 25 2c 63 75 72 72 65  6e 74 5f 69 63 6f 6e 25  |k%,current_icon%|
0002e0f0  2c 63 74 72 25 2c 70 74  72 25 2c 69 63 6f 6e 5f  |,ctr%,ptr%,icon_|
0002e100  6e 72 25 0d 18 68 16 63  74 72 25 20 3d 20 30 20  |nr%..h.ctr% = 0 |
0002e110  3a 70 74 72 25 20 3d 20  30 0d 18 69 2c 63 61 72  |:ptr% = 0..i,car|
0002e120  65 74 5f 62 6c 6b 25 20  3d 20 a4 73 68 65 6c 6c  |et_blk% = .shell|
0002e130  5f 48 65 61 70 42 6c 6f  63 6b 46 65 74 63 68 28  |_HeapBlockFetch(|
0002e140  32 30 34 38 29 0d 18 6a  2e f4 20 46 69 6e 64 20  |2048)..j.. Find |
0002e150  63 75 72 72 65 6e 74 20  69 63 6f 6e 20 63 6f 6e  |current icon con|
0002e160  61 74 69 6e 69 6e 67 20  74 68 65 20 63 61 72 65  |atining the care|
0002e170  74 2e 2e 0d 18 6b 2a c8  99 20 22 57 69 6d 70 5f  |t....k*.. "Wimp_|
0002e180  47 65 74 43 61 72 65 74  50 6f 73 69 74 69 6f 6e  |GetCaretPosition|
0002e190  22 2c 2c 63 61 72 65 74  5f 62 6c 6b 25 0d 18 6c  |",,caret_blk%..l|
0002e1a0  1a e7 20 63 61 72 65 74  5f 62 6c 6b 25 21 34 20  |.. caret_blk%!4 |
0002e1b0  3c 3e 20 2d 31 20 8c 0d  18 6d 1a 20 20 f4 20 54  |<> -1 ...m.  . T|
0002e1c0  68 65 72 65 20 69 73 20  61 20 63 61 72 65 74 2e  |here is a caret.|
0002e1d0  2e 0d 18 6e 22 20 20 63  75 72 72 65 6e 74 5f 69  |...n"  current_i|
0002e1e0  63 6f 6e 25 20 3d 20 63  61 72 65 74 5f 62 6c 6b  |con% = caret_blk|
0002e1f0  25 21 34 0d 18 6f 35 20  20 f4 20 47 65 74 20 61  |%!4..o5  . Get a|
0002e200  20 6c 69 73 74 20 6f 66  20 77 72 69 74 61 62 6c  | list of writabl|
0002e210  65 20 69 63 6f 6e 73 20  69 6e 20 74 68 69 73 20  |e icons in this |
0002e220  77 69 6e 64 6f 77 2e 2e  0d 18 70 3c 20 20 c8 99  |window....p<  ..|
0002e230  20 22 57 69 6d 70 5f 57  68 69 63 68 49 63 6f 6e  | "Wimp_WhichIcon|
0002e240  22 2c 77 68 25 2c 63 61  72 65 74 5f 62 6c 6b 25  |",wh%,caret_blk%|
0002e250  2c 26 30 30 34 30 45 30  30 30 2c 26 30 30 30 30  |,&0040E000,&0000|
0002e260  45 30 30 30 0d 18 71 07  20 20 f5 0d 18 72 37 20  |E000..q.  ...r7 |
0002e270  20 20 20 e7 20 63 61 72  65 74 5f 62 6c 6b 25 21  |   . caret_blk%!|
0002e280  63 74 72 25 20 3d 20 63  75 72 72 65 6e 74 5f 69  |ctr% = current_i|
0002e290  63 6f 6e 25 20 8c 20 70  74 72 25 20 3d 20 63 74  |con% . ptr% = ct|
0002e2a0  72 25 0d 18 73 11 20 20  20 20 63 74 72 25 20 2b  |r%..s.    ctr% +|
0002e2b0  3d 20 34 0d 18 74 1c 20  20 fd 20 63 61 72 65 74  |= 4..t.  . caret|
0002e2c0  5f 62 6c 6b 25 21 63 74  72 25 20 3d 20 2d 31 0d  |_blk%!ctr% = -1.|
0002e2d0  18 75 12 20 20 c8 8e 20  61 63 74 69 6f 6e 25 20  |.u.  .. action% |
0002e2e0  ca 0d 18 76 0c 20 20 20  20 c9 20 30 3a 0d 18 77  |...v.    . 0:..w|
0002e2f0  19 20 20 20 20 20 20 f4  20 74 6f 20 66 69 72 73  |.      . to firs|
0002e300  74 20 69 63 6f 6e 0d 18  78 20 20 20 20 20 20 20  |t icon..x       |
0002e310  69 63 6f 6e 5f 6e 72 25  20 3d 20 21 63 61 72 65  |icon_nr% = !care|
0002e320  74 5f 62 6c 6b 25 0d 18  79 0c 20 20 20 20 c9 20  |t_blk%..y.    . |
0002e330  31 3a 0d 18 7a 18 20 20  20 20 20 20 f4 20 74 6f  |1:..z.      . to|
0002e340  20 6c 61 73 74 20 69 63  6f 6e 0d 18 7b 2a 20 20  | last icon..{*  |
0002e350  20 20 20 20 69 63 6f 6e  5f 6e 72 25 20 3d 20 63  |    icon_nr% = c|
0002e360  61 72 65 74 5f 62 6c 6b  25 21 28 63 74 72 25 20  |aret_blk%!(ctr% |
0002e370  2d 20 34 29 0d 18 7c 0c  20 20 20 20 c9 20 32 3a  |- 4)..|.    . 2:|
0002e380  0d 18 7d 18 20 20 20 20  20 20 f4 20 74 6f 20 6e  |..}.      . to n|
0002e390  65 78 74 20 69 63 6f 6e  0d 18 7e 29 20 20 20 20  |ext icon..~)    |
0002e3a0  20 20 e7 20 63 61 72 65  74 5f 62 6c 6b 25 21 28  |  . caret_blk%!(|
0002e3b0  70 74 72 25 20 2b 20 34  29 20 3c 3e 20 2d 31 20  |ptr% + 4) <> -1 |
0002e3c0  8c 0d 18 7f 2c 20 20 20  20 20 20 20 20 69 63 6f  |....,        ico|
0002e3d0  6e 5f 6e 72 25 20 3d 20  63 61 72 65 74 5f 62 6c  |n_nr% = caret_bl|
0002e3e0  6b 25 21 28 70 74 72 25  20 2b 20 34 29 0d 18 80  |k%!(ptr% + 4)...|
0002e3f0  0b 20 20 20 20 20 20 cc  0d 18 81 22 20 20 20 20  |.      ...."    |
0002e400  20 20 20 20 69 63 6f 6e  5f 6e 72 25 20 3d 20 21  |    icon_nr% = !|
0002e410  63 61 72 65 74 5f 62 6c  6b 25 0d 18 82 0b 20 20  |caret_blk%....  |
0002e420  20 20 20 20 cd 0d 18 83  0c 20 20 20 20 c9 20 33  |    .....    . 3|
0002e430  3a 0d 18 84 1c 20 20 20  20 20 20 f4 20 74 6f 20  |:....      . to |
0002e440  70 72 65 76 69 6f 75 73  20 69 63 6f 6e 0d 18 85  |previous icon...|
0002e450  16 20 20 20 20 20 20 e7  20 70 74 72 25 20 3e 20  |.      . ptr% > |
0002e460  30 20 8c 0d 18 86 2c 20  20 20 20 20 20 20 20 69  |0 ....,        i|
0002e470  63 6f 6e 5f 6e 72 25 20  3d 20 63 61 72 65 74 5f  |con_nr% = caret_|
0002e480  62 6c 6b 25 21 28 70 74  72 25 20 2d 20 34 29 0d  |blk%!(ptr% - 4).|
0002e490  18 87 0b 20 20 20 20 20  20 cc 0d 18 88 2c 20 20  |...      ....,  |
0002e4a0  20 20 20 20 20 20 69 63  6f 6e 5f 6e 72 25 20 3d  |      icon_nr% =|
0002e4b0  20 63 61 72 65 74 5f 62  6c 6b 25 21 28 63 74 72  | caret_blk%!(ctr|
0002e4c0  25 20 2d 20 34 29 0d 18  89 0b 20 20 20 20 20 20  |% - 4)....      |
0002e4d0  cd 0d 18 8a 07 20 20 cb  0d 18 8b 5a 20 20 c8 99  |.....  ....Z  ..|
0002e4e0  20 22 57 69 6d 70 5f 53  65 74 43 61 72 65 74 50  | "Wimp_SetCaretP|
0002e4f0  6f 73 69 74 69 6f 6e 22  2c 77 68 25 2c 69 63 6f  |osition",wh%,ico|
0002e500  6e 5f 6e 72 25 2c 2d 31  2c 2d 31 2c 2d 31 2c a9  |n_nr%,-1,-1,-1,.|
0002e510  28 a4 73 68 65 6c 6c 5f  49 63 6f 6e 47 65 74 44  |(.shell_IconGetD|
0002e520  61 74 61 28 77 68 25 2c  69 63 6f 6e 5f 6e 72 25  |ata(wh%,icon_nr%|
0002e530  29 29 0d 18 8c 05 cd 0d  18 8d 26 f2 73 68 65 6c  |))........&.shel|
0002e540  6c 5f 48 65 61 70 42 6c  6f 63 6b 52 65 74 75 72  |l_HeapBlockRetur|
0002e550  6e 28 63 61 72 65 74 5f  62 6c 6b 25 29 0d 18 8e  |n(caret_blk%)...|
0002e560  05 e1 0d 18 8f 05 3a 0d  18 90 23 2a 7c 53 74 6f  |......:...#*|Sto|
0002e570  70 20 50 52 4f 43 73 68  65 6c 6c 5f 43 61 72 65  |p PROCshell_Care|
0002e580  74 4d 6f 76 65 43 61 72  65 74 0d 18 91 04 0d 18  |tMoveCaret......|
0002e590  92 27 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |.'*|Start PROCsh|
0002e5a0  65 6c 6c 5f 43 61 72 65  74 50 75 74 46 69 72 73  |ell_CaretPutFirs|
0002e5b0  74 49 63 6f 6e 0d 18 93  23 dd 20 f2 73 68 65 6c  |tIcon...#. .shel|
0002e5c0  6c 5f 43 61 72 65 74 50  75 74 46 69 72 73 74 49  |l_CaretPutFirstI|
0002e5d0  63 6f 6e 28 77 68 25 29  0d 18 94 20 f2 73 68 65  |con(wh%)... .she|
0002e5e0  6c 6c 5f 43 61 72 65 74  4d 6f 76 65 43 61 72 65  |ll_CaretMoveCare|
0002e5f0  74 28 77 68 25 2c 30 29  0d 18 95 05 e1 0d 18 96  |t(wh%,0)........|
0002e600  05 3a 0d 18 97 26 2a 7c  53 74 6f 70 20 50 52 4f  |.:...&*|Stop PRO|
0002e610  43 73 68 65 6c 6c 5f 43  61 72 65 74 50 75 74 46  |Cshell_CaretPutF|
0002e620  69 72 73 74 49 63 6f 6e  0d 18 98 04 0d 18 99 26  |irstIcon.......&|
0002e630  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
0002e640  6c 5f 43 61 72 65 74 50  75 74 4c 61 73 74 49 63  |l_CaretPutLastIc|
0002e650  6f 6e 0d 18 9a 22 dd 20  f2 73 68 65 6c 6c 5f 43  |on...". .shell_C|
0002e660  61 72 65 74 50 75 74 4c  61 73 74 49 63 6f 6e 28  |aretPutLastIcon(|
0002e670  77 68 25 29 0d 18 9b 20  f2 73 68 65 6c 6c 5f 43  |wh%)... .shell_C|
0002e680  61 72 65 74 4d 6f 76 65  43 61 72 65 74 28 77 68  |aretMoveCaret(wh|
0002e690  25 2c 31 29 0d 18 9c 05  e1 0d 18 9d 05 3a 0d 18  |%,1).........:..|
0002e6a0  9e 25 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |.%*|Stop PROCshe|
0002e6b0  6c 6c 5f 43 61 72 65 74  50 75 74 4c 61 73 74 49  |ll_CaretPutLastI|
0002e6c0  63 6f 6e 0d 18 9f 04 0d  18 a0 26 2a 7c 53 74 61  |con.......&*|Sta|
0002e6d0  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 43 61 72  |rt PROCshell_Car|
0002e6e0  65 74 50 75 74 4e 65 78  74 49 63 6f 6e 0d 18 a1  |etPutNextIcon...|
0002e6f0  22 dd 20 f2 73 68 65 6c  6c 5f 43 61 72 65 74 50  |". .shell_CaretP|
0002e700  75 74 4e 65 78 74 49 63  6f 6e 28 77 68 25 29 0d  |utNextIcon(wh%).|
0002e710  18 a2 20 f2 73 68 65 6c  6c 5f 43 61 72 65 74 4d  |.. .shell_CaretM|
0002e720  6f 76 65 43 61 72 65 74  28 77 68 25 2c 32 29 0d  |oveCaret(wh%,2).|
0002e730  18 a3 05 e1 0d 18 a4 05  3a 0d 18 a5 25 2a 7c 53  |........:...%*|S|
0002e740  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 43 61  |top PROCshell_Ca|
0002e750  72 65 74 50 75 74 4e 65  78 74 49 63 6f 6e 0d 18  |retPutNextIcon..|
0002e760  a6 04 0d 18 a7 26 2a 7c  53 74 61 72 74 20 50 52  |.....&*|Start PR|
0002e770  4f 43 73 68 65 6c 6c 5f  43 61 72 65 74 50 75 74  |OCshell_CaretPut|
0002e780  50 72 65 76 49 63 6f 6e  0d 18 a8 22 dd 20 f2 73  |PrevIcon...". .s|
0002e790  68 65 6c 6c 5f 43 61 72  65 74 50 75 74 50 72 65  |hell_CaretPutPre|
0002e7a0  76 49 63 6f 6e 28 77 68  25 29 0d 18 a9 20 f2 73  |vIcon(wh%)... .s|
0002e7b0  68 65 6c 6c 5f 43 61 72  65 74 4d 6f 76 65 43 61  |hell_CaretMoveCa|
0002e7c0  72 65 74 28 77 68 25 2c  33 29 0d 18 aa 05 e1 0d  |ret(wh%,3)......|
0002e7d0  18 ab 05 3a 0d 18 ac 25  2a 7c 53 74 6f 70 20 50  |...:...%*|Stop P|
0002e7e0  52 4f 43 73 68 65 6c 6c  5f 43 61 72 65 74 50 75  |ROCshell_CaretPu|
0002e7f0  74 50 72 65 76 49 63 6f  6e 0d 18 ad 04 0d 18 ae  |tPrevIcon.......|
0002e800  26 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |&*|Start PROCshe|
0002e810  6c 6c 5f 54 65 6d 70 6c  61 74 65 46 69 6c 65 49  |ll_TemplateFileI|
0002e820  6e 66 6f 0d 18 af 46 f4  20 52 65 74 75 72 6e 73  |nfo...F. Returns|
0002e830  20 74 68 65 20 73 69 7a  65 20 6f 66 20 74 68 65  | the size of the|
0002e840  20 62 75 66 66 65 72 20  6e 65 65 64 65 64 20 62  | buffer needed b|
0002e850  79 20 22 57 69 6d 70 5f  4c 6f 61 64 54 65 6d 70  |y "Wimp_LoadTemp|
0002e860  6c 61 74 65 22 20 61 6e  64 0d 18 b0 29 f4 20 74  |late" and...). t|
0002e870  68 65 20 6e 75 6d 62 65  72 20 6f 66 20 74 65 6d  |he number of tem|
0002e880  70 6c 61 74 65 73 20 69  6e 20 74 68 65 20 66 69  |plates in the fi|
0002e890  6c 65 0d 18 b1 35 f4 20  20 20 52 65 74 75 72 6e  |le...5.   Return|
0002e8a0  73 20 20 30 20 69 66 20  72 6f 75 74 69 6e 65 20  |s  0 if routine |
0002e8b0  65 78 65 63 75 74 65 64  20 77 69 74 68 6f 75 74  |executed without|
0002e8c0  20 65 72 72 6f 72 73 0d  18 b2 2c f4 20 20 20 20  | errors...,.    |
0002e8d0  20 20 20 20 20 20 20 2d  31 20 69 66 20 66 69 6c  |       -1 if fil|
0002e8e0  65 6e 61 6d 65 20 64 69  64 20 6e 6f 74 20 65 78  |ename did not ex|
0002e8f0  69 73 74 0d 18 b3 3c f4  20 20 20 20 20 20 20 20  |ist...<.        |
0002e900  20 20 20 2d 32 20 69 66  20 66 69 6c 65 20 65 78  |   -2 if file ex|
0002e910  69 73 74 73 20 62 75 74  20 69 73 20 6e 6f 74 20  |ists but is not |
0002e920  61 20 74 65 6d 70 6c 61  74 65 20 66 69 6c 65 0d  |a template file.|
0002e930  18 b4 4e f4 20 20 20 49  66 20 74 68 65 20 72 65  |..N.   If the re|
0002e940  74 75 72 6e 65 64 20 72  65 73 75 6c 74 20 69 73  |turned result is|
0002e950  20 3c 20 30 20 74 68 65  6e 20 62 75 66 66 65 72  | < 0 then buffer|
0002e960  20 73 69 7a 65 20 61 6e  64 20 6e 75 6d 62 65 72  | size and number|
0002e970  20 6f 66 20 74 65 6d 70  6c 61 74 65 73 0d 18 b5  | of templates...|
0002e980  1c f4 20 20 20 77 69 6c  6c 20 62 65 20 6d 65 61  |..   will be mea|
0002e990  6e 69 6e 67 6c 65 73 73  21 0d 18 b6 04 0d 18 b7  |ningless!.......|
0002e9a0  4f dd 20 f2 73 68 65 6c  6c 5f 54 65 6d 70 6c 61  |O. .shell_Templa|
0002e9b0  74 65 46 69 6c 65 49 6e  66 6f 28 66 69 6c 65 6e  |teFileInfo(filen|
0002e9c0  61 6d 65 24 2c f8 20 62  75 66 66 5f 73 69 7a 65  |ame$,. buff_size|
0002e9d0  25 2c f8 20 6e 72 5f 74  65 6d 70 6c 61 74 65 73  |%,. nr_templates|
0002e9e0  25 2c f8 20 72 65 73 75  6c 74 25 29 0d 18 b8 0a  |%,. result%)....|
0002e9f0  ea 20 52 4f 33 25 0d 18  b9 17 52 4f 33 25 20 3d  |. RO3%....RO3% =|
0002ea00  20 a4 52 4f 33 5f 50 72  65 73 65 6e 74 0d 18 ba  | .RO3_Present...|
0002ea10  0c e7 20 52 4f 33 25 20  8c 0d 18 bb 4a 20 20 f2  |.. RO3% ....J  .|
0002ea20  73 68 65 6c 6c 5f 54 65  6d 70 6c 61 74 65 46 69  |shell_TemplateFi|
0002ea30  6c 65 49 6e 66 6f 33 28  66 69 6c 65 6e 61 6d 65  |leInfo3(filename|
0002ea40  24 2c 62 75 66 66 5f 73  69 7a 65 25 2c 6e 72 5f  |$,buff_size%,nr_|
0002ea50  74 65 6d 70 6c 61 74 65  73 25 2c 72 65 73 75 6c  |templates%,resul|
0002ea60  74 25 29 0d 18 bc 05 cc  0d 18 bd 4a 20 20 f2 73  |t%)........J  .s|
0002ea70  68 65 6c 6c 5f 54 65 6d  70 6c 61 74 65 46 69 6c  |hell_TemplateFil|
0002ea80  65 49 6e 66 6f 32 28 66  69 6c 65 6e 61 6d 65 24  |eInfo2(filename$|
0002ea90  2c 62 75 66 66 5f 73 69  7a 65 25 2c 6e 72 5f 74  |,buff_size%,nr_t|
0002eaa0  65 6d 70 6c 61 74 65 73  25 2c 72 65 73 75 6c 74  |emplates%,result|
0002eab0  25 29 0d 18 be 05 cd 0d  18 bf 05 e1 0d 18 c0 05  |%)..............|
0002eac0  3a 0d 18 c1 25 2a 7c 53  74 6f 70 20 50 52 4f 43  |:...%*|Stop PROC|
0002ead0  73 68 65 6c 6c 5f 54 65  6d 70 6c 61 74 65 46 69  |shell_TemplateFi|
0002eae0  6c 65 49 6e 66 6f 0d 18  c2 04 0d 18 c3 27 2a 7c  |leInfo.......'*||
0002eaf0  53 74 61 72 74 20 50 52  4f 43 73 68 65 6c 6c 5f  |Start PROCshell_|
0002eb00  54 65 6d 70 6c 61 74 65  46 69 6c 65 49 6e 66 6f  |TemplateFileInfo|
0002eb10  32 0d 18 c4 50 dd 20 f2  73 68 65 6c 6c 5f 54 65  |2...P. .shell_Te|
0002eb20  6d 70 6c 61 74 65 46 69  6c 65 49 6e 66 6f 32 28  |mplateFileInfo2(|
0002eb30  66 69 6c 65 6e 61 6d 65  24 2c f8 20 62 75 66 66  |filename$,. buff|
0002eb40  5f 73 69 7a 65 25 2c f8  20 6e 72 5f 74 65 6d 70  |_size%,. nr_temp|
0002eb50  6c 61 74 65 73 25 2c f8  20 72 65 73 75 6c 74 25  |lates%,. result%|
0002eb60  29 0d 18 c5 28 ea 20 70  6f 73 25 2c 74 6f 74 61  |)...(. pos%,tota|
0002eb70  6c 5f 69 6e 64 69 72 73  69 7a 65 25 2c 6c 61 72  |l_indirsize%,lar|
0002eb80  67 65 73 74 5f 64 65 66  25 0d 18 c6 25 ea 20 62  |gest_def%...%. b|
0002eb90  75 66 66 25 2c 58 25 2c  64 61 74 61 5f 73 69 7a  |uff%,X%,data_siz|
0002eba0  65 25 2c 65 6e 74 72 79  5f 74 79 70 65 25 0d 18  |e%,entry_type%..|
0002ebb0  c7 2d ea 20 63 74 72 25  2c 63 68 61 72 25 2c 6f  |.-. ctr%,char%,o|
0002ebc0  6c 64 5f 70 74 72 25 2c  6e 72 5f 69 63 6f 6e 73  |ld_ptr%,nr_icons|
0002ebd0  25 2c 6a 25 2c 66 6c 61  67 73 25 0d 18 c8 50 70  |%,j%,flags%...Pp|
0002ebe0  6f 73 25 20 3d 20 30 3a  6e 72 5f 74 65 6d 70 6c  |os% = 0:nr_templ|
0002ebf0  61 74 65 73 25 20 3d 20  30 3a 74 6f 74 61 6c 5f  |ates% = 0:total_|
0002ec00  69 6e 64 69 72 73 69 7a  65 25 20 3d 20 30 3a 6c  |indirsize% = 0:l|
0002ec10  61 72 67 65 73 74 5f 64  65 66 25 20 3d 20 30 3a  |argest_def% = 0:|
0002ec20  72 65 73 75 6c 74 25 20  3d 20 30 0d 18 c9 46 f4  |result% = 0...F.|
0002ec30  20 46 69 72 73 74 20 63  68 65 63 6b 20 74 68 61  | First check tha|
0002ec40  74 20 74 68 65 20 66 69  6c 65 6e 61 6d 65 20 65  |t the filename e|
0002ec50  78 69 73 74 73 20 61 6e  64 20 69 74 20 69 73 20  |xists and it is |
0002ec60  61 20 74 65 6d 70 6c 61  74 65 20 66 69 6c 65 2e  |a template file.|
0002ec70  2e 0d 18 ca 35 e7 20 ac  20 a4 73 68 65 6c 6c 5f  |....5. . .shell_|
0002ec80  46 69 6c 65 45 78 69 73  74 73 28 66 69 6c 65 6e  |FileExists(filen|
0002ec90  61 6d 65 24 29 20 8c 20  20 20 72 65 73 75 6c 74  |ame$) .   result|
0002eca0  25 20 3d 20 2d 31 0d 18  cb 37 e7 20 a4 73 68 65  |% = -1...7. .she|
0002ecb0  6c 6c 5f 46 69 6c 65 54  79 70 65 28 66 69 6c 65  |ll_FileType(file|
0002ecc0  6e 61 6d 65 24 29 20 3c  3e 20 26 46 45 43 20 8c  |name$) <> &FEC .|
0002ecd0  20 72 65 73 75 6c 74 25  20 3d 20 2d 32 0d 18 cc  | result% = -2...|
0002ece0  13 e7 20 72 65 73 75 6c  74 25 20 3d 20 30 20 8c  |.. result% = 0 .|
0002ecf0  0d 18 cd 2a 20 20 62 75  66 66 25 20 20 20 20 3d  |...*  buff%    =|
0002ed00  20 a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
0002ed10  6b 46 65 74 63 68 28 31  33 29 0d 18 ce 38 20 20  |kFetch(13)...8  |
0002ed20  58 25 20 20 20 20 20 20  20 3d 20 8e 28 66 69 6c  |X%       = .(fil|
0002ed30  65 6e 61 6d 65 24 29 20  20 3a f4 20 4f 70 65 6e  |ename$)  :. Open|
0002ed40  20 74 68 65 20 74 65 6d  70 6c 61 74 65 20 66 69  | the template fi|
0002ed50  6c 65 0d 18 cf 35 20 20  cf 23 20 58 25 20 20 3d  |le...5  .# X%  =|
0002ed60  20 31 36 20 20 20 20 20  20 20 20 20 20 20 20 20  | 16             |
0002ed70  20 20 20 20 3a f4 20 53  6b 69 70 20 68 65 61 64  |    :. Skip head|
0002ed80  65 72 20 69 6e 66 6f 0d  18 d0 07 20 20 f5 0d 18  |er info....  ...|
0002ed90  d1 21 20 20 20 20 c8 99  20 22 4f 53 5f 47 42 50  |.!    .. "OS_GBP|
0002eda0  42 22 2c 34 2c 58 25 2c  62 75 66 66 25 2c 34 0d  |B",4,X%,buff%,4.|
0002edb0  18 d2 3b 20 20 20 20 66  69 6c 65 5f 6f 66 66 73  |..;    file_offs|
0002edc0  65 74 25 20 3d 20 21 62  75 66 66 25 3a 20 f4 20  |et% = !buff%: . |
0002edd0  46 69 6c 65 20 6f 66 66  73 65 74 20 66 6f 72 20  |File offset for |
0002ede0  74 68 69 73 20 65 6e 74  72 79 0d 18 d3 1c 20 20  |this entry....  |
0002edf0  20 20 e7 20 66 69 6c 65  5f 6f 66 66 73 65 74 25  |  . file_offset%|
0002ee00  20 3e 20 30 20 8c 0d 18  d4 1e 20 20 20 20 20 20  | > 0 .....      |
0002ee10  6e 72 5f 74 65 6d 70 6c  61 74 65 73 25 20 20 20  |nr_templates%   |
0002ee20  2b 3d 20 31 0d 18 d5 1e  20 20 20 20 20 20 69 6e  |+= 1....      in|
0002ee30  64 69 72 65 63 74 65 64  5f 73 69 7a 65 25 20 3d  |directed_size% =|
0002ee40  20 30 0d 18 d6 23 20 20  20 20 20 20 c8 99 20 22  | 0...#      .. "|
0002ee50  4f 53 5f 47 42 50 42 22  2c 34 2c 58 25 2c 62 75  |OS_GBPB",4,X%,bu|
0002ee60  66 66 25 2c 34 0d 18 d7  45 20 20 20 20 20 20 64  |ff%,4...E      d|
0002ee70  61 74 61 5f 73 69 7a 65  25 20 20 3d 20 21 62 75  |ata_size%  = !bu|
0002ee80  66 66 25 20 20 20 20 20  20 20 20 20 3a f4 20 53  |ff%         :. S|
0002ee90  69 7a 65 20 6f 66 20 64  61 74 61 20 66 6f 72 20  |ize of data for |
0002eea0  74 68 69 73 20 65 6e 74  72 79 0d 18 d8 38 20 20  |this entry...8  |
0002eeb0  20 20 20 20 c8 99 20 22  4f 53 5f 47 42 50 42 22  |    .. "OS_GBPB"|
0002eec0  2c 34 2c 58 25 2c 62 75  66 66 25 2c 34 20 20 20  |,4,X%,buff%,4   |
0002eed0  3a f4 20 52 65 61 64 20  65 6e 74 72 79 20 74 79  |:. Read entry ty|
0002eee0  70 65 0d 18 d9 41 20 20  20 20 20 20 65 6e 74 72  |pe...A      entr|
0002eef0  79 5f 74 79 70 65 25 20  3d 20 21 62 75 66 66 25  |y_type% = !buff%|
0002ef00  20 20 20 20 20 20 20 20  20 3a f4 20 45 6e 74 72  |         :. Entr|
0002ef10  79 20 74 79 70 65 20 28  31 20 3d 20 77 69 6e 64  |y type (1 = wind|
0002ef20  6f 77 29 0d 18 da 46 20  20 20 20 20 20 c8 99 20  |ow)...F      .. |
0002ef30  22 4f 53 5f 47 42 50 42  22 2c 34 2c 58 25 2c 62  |"OS_GBPB",4,X%,b|
0002ef40  75 66 66 25 2c 31 32 20  20 3a f4 20 52 65 61 64  |uff%,12  :. Read|
0002ef50  20 77 69 6e 64 6f 77 20  69 64 65 6e 74 69 66 69  | window identifi|
0002ef60  65 72 20 73 74 72 69 6e  67 0d 18 db 47 20 20 20  |er string...G   |
0002ef70  20 20 20 6f 6c 64 5f 70  74 72 25 20 3d 20 8f 23  |   old_ptr% = .#|
0002ef80  20 58 25 20 20 20 20 20  20 20 20 20 20 20 3a f4  | X%           :.|
0002ef90  20 53 61 76 65 20 63 75  72 72 65 6e 74 20 70 6f  | Save current po|
0002efa0  69 6e 74 65 72 20 70 6f  73 69 74 69 6f 6e 2e 2e  |inter position..|
0002efb0  0d 18 dc 4a 20 20 20 20  20 20 cf 23 20 58 25 20  |...J      .# X% |
0002efc0  20 3d 20 66 69 6c 65 5f  6f 66 66 73 65 74 25 20  | = file_offset% |
0002efd0  2b 20 35 36 20 3a f4 20  4d 6f 76 65 20 70 6f 69  |+ 56 :. Move poi|
0002efe0  6e 74 65 72 20 74 6f 20  74 69 74 6c 65 20 66 6c  |nter to title fl|
0002eff0  61 67 73 20 77 6f 72 64  2e 2e 0d 18 dd 43 20 20  |ags word.....C  |
0002f000  20 20 20 20 c8 99 20 22  4f 53 5f 47 42 50 42 22  |    .. "OS_GBPB"|
0002f010  2c 34 2c 58 25 2c 62 75  66 66 25 2c 34 20 20 20  |,4,X%,buff%,4   |
0002f020  3a f4 20 52 65 61 64 20  74 69 74 6c 65 20 62 61  |:. Read title ba|
0002f030  72 20 66 6c 61 67 20 77  6f 72 64 2e 2e 0d 18 de  |r flag word.....|
0002f040  19 20 20 20 20 20 20 66  6c 61 67 73 25 20 3d 20  |.      flags% = |
0002f050  21 62 75 66 66 25 0d 18  df 51 20 20 20 20 20 20  |!buff%...Q      |
0002f060  cf 23 20 58 25 20 3d 20  66 69 6c 65 5f 6f 66 66  |.# X% = file_off|
0002f070  73 65 74 25 20 2b 20 37  32 20 20 3a f4 20 4d 6f  |set% + 72  :. Mo|
0002f080  76 65 20 70 6f 69 6e 74  65 72 20 74 6f 20 73 74  |ve pointer to st|
0002f090  61 72 74 20 6f 66 20 74  69 74 6c 65 20 62 61 72  |art of title bar|
0002f0a0  20 64 61 74 61 2e 2e 0d  18 e0 49 20 20 20 20 20  | data.....I     |
0002f0b0  20 c8 99 20 22 4f 53 5f  47 42 50 42 22 2c 34 2c  | .. "OS_GBPB",4,|
0002f0c0  58 25 2c 62 75 66 66 25  2c 31 32 20 20 3a f4 20  |X%,buff%,12  :. |
0002f0d0  52 65 61 64 20 33 20 77  6f 72 64 73 20 6f 66 20  |Read 3 words of |
0002f0e0  74 69 74 6c 65 20 62 61  72 20 64 61 74 61 2e 2e  |title bar data..|
0002f0f0  0d 18 e1 51 20 20 20 20  20 20 69 6e 64 69 72 65  |...Q      indire|
0002f100  63 74 65 64 5f 73 69 7a  65 25 20 20 2b 3d 20 a4  |cted_size%  += .|
0002f110  73 68 65 6c 6c 5f 49 63  6f 6e 49 6e 64 69 72 53  |shell_IconIndirS|
0002f120  69 7a 65 28 66 69 6c 65  5f 6f 66 66 73 65 74 25  |ize(file_offset%|
0002f130  2c 66 6c 61 67 73 25 2c  62 75 66 66 25 2c 58 25  |,flags%,buff%,X%|
0002f140  29 0d 18 e2 49 20 20 20  20 20 20 cf 23 20 58 25  |)...I      .# X%|
0002f150  20 3d 20 20 66 69 6c 65  5f 6f 66 66 73 65 74 25  | =  file_offset%|
0002f160  20 2b 20 38 34 20 3a f4  20 4d 6f 76 65 20 70 6f  | + 84 :. Move po|
0002f170  69 6e 74 65 72 20 74 6f  20 69 63 6f 6e 20 63 6f  |inter to icon co|
0002f180  75 6e 74 20 77 6f 72 64  2e 2e 0d 18 e3 3b 20 20  |unt word.....;  |
0002f190  20 20 20 20 c8 99 20 22  4f 53 5f 47 42 50 42 22  |    .. "OS_GBPB"|
0002f1a0  2c 34 2c 58 25 2c 62 75  66 66 25 2c 34 20 20 20  |,4,X%,buff%,4   |
0002f1b0  3a f4 20 52 65 61 64 20  6e 72 20 6f 66 20 69 63  |:. Read nr of ic|
0002f1c0  6f 6e 73 2e 2e 0d 18 e4  1c 20 20 20 20 20 20 6e  |ons......      n|
0002f1d0  72 5f 69 63 6f 6e 73 25  20 3d 20 21 62 75 66 66  |r_icons% = !buff|
0002f1e0  25 0d 18 e5 1b 20 20 20  20 20 20 e7 20 6e 72 5f  |%....      . nr_|
0002f1f0  69 63 6f 6e 73 25 20 3e  20 30 20 8c 0d 18 e6 24  |icons% > 0 ....$|
0002f200  20 20 20 20 20 20 20 20  e3 20 6a 25 20 3d 20 30  |        . j% = 0|
0002f210  20 b8 20 6e 72 5f 69 63  6f 6e 73 25 20 2d 20 31  | . nr_icons% - 1|
0002f220  0d 18 e7 38 20 20 20 20  20 20 20 20 20 20 cf 23  |...8          .#|
0002f230  20 58 25 20 3d 20 66 69  6c 65 5f 6f 66 66 73 65  | X% = file_offse|
0002f240  74 25 20 2b 20 38 38 20  2b 20 28 6a 25 20 2a 20  |t% + 88 + (j% * |
0002f250  33 32 29 20 2b 20 31 36  0d 18 e8 40 20 20 20 20  |32) + 16...@    |
0002f260  20 20 20 20 20 20 c8 99  20 22 4f 53 5f 47 42 50  |      .. "OS_GBP|
0002f270  42 22 2c 34 2c 58 25 2c  62 75 66 66 25 2c 34 20  |B",4,X%,buff%,4 |
0002f280  3a f4 20 52 65 61 64 20  69 63 6f 6e 20 66 6c 61  |:. Read icon fla|
0002f290  67 20 77 6f 72 64 2e 2e  0d 18 e9 1d 20 20 20 20  |g word......    |
0002f2a0  20 20 20 20 20 20 66 6c  61 67 73 25 20 3d 20 21  |      flags% = !|
0002f2b0  62 75 66 66 25 0d 18 ea  38 20 20 20 20 20 20 20  |buff%...8       |
0002f2c0  20 20 20 cf 23 20 58 25  20 3d 20 66 69 6c 65 5f  |   .# X% = file_|
0002f2d0  6f 66 66 73 65 74 25 20  2b 20 38 38 20 2b 20 28  |offset% + 88 + (|
0002f2e0  6a 25 20 2a 20 33 32 29  20 2b 20 32 30 0d 18 eb  |j% * 32) + 20...|
0002f2f0  48 20 20 20 20 20 20 20  20 20 20 c8 99 20 22 4f  |H          .. "O|
0002f300  53 5f 47 42 50 42 22 2c  34 2c 58 25 2c 62 75 66  |S_GBPB",4,X%,buf|
0002f310  66 25 2c 31 32 20 20 3a  f4 20 52 65 61 64 20 33  |f%,12  :. Read 3|
0002f320  20 77 6f 72 64 73 20 6f  66 20 69 63 6f 6e 20 64  | words of icon d|
0002f330  61 74 61 2e 2e 0d 18 ec  55 20 20 20 20 20 20 20  |ata.....U       |
0002f340  20 20 20 69 6e 64 69 72  65 63 74 65 64 5f 73 69  |   indirected_si|
0002f350  7a 65 25 20 20 2b 3d 20  a4 73 68 65 6c 6c 5f 49  |ze%  += .shell_I|
0002f360  63 6f 6e 49 6e 64 69 72  53 69 7a 65 28 66 69 6c  |conIndirSize(fil|
0002f370  65 5f 6f 66 66 73 65 74  25 2c 66 6c 61 67 73 25  |e_offset%,flags%|
0002f380  2c 62 75 66 66 25 2c 58  25 29 0d 18 ed 10 20 20  |,buff%,X%)....  |
0002f390  20 20 20 20 20 20 ed 20  6a 25 0d 18 ee 0b 20 20  |      . j%....  |
0002f3a0  20 20 20 20 cd 0d 18 ef  1a 20 20 20 20 20 20 cf  |    .....      .|
0002f3b0  23 20 58 25 20 3d 20 6f  6c 64 5f 70 74 72 25 0d  |# X% = old_ptr%.|
0002f3c0  18 f0 2e 20 20 20 20 20  20 74 6f 74 61 6c 5f 69  |...      total_i|
0002f3d0  6e 64 69 72 73 69 7a 65  25 20 2b 3d 20 69 6e 64  |ndirsize% += ind|
0002f3e0  69 72 65 63 74 65 64 5f  73 69 7a 65 25 0d 18 f1  |irected_size%...|
0002f3f0  27 20 20 20 20 20 20 e7  20 64 61 74 61 5f 73 69  |'      . data_si|
0002f400  7a 65 25 20 3e 20 6c 61  72 67 65 73 74 5f 64 65  |ze% > largest_de|
0002f410  66 25 20 8c 0d 18 f2 25  20 20 20 20 20 20 20 20  |f% ....%        |
0002f420  6c 61 72 67 65 73 74 5f  64 65 66 25 20 3d 20 64  |largest_def% = d|
0002f430  61 74 61 5f 73 69 7a 65  25 0d 18 f3 0b 20 20 20  |ata_size%....   |
0002f440  20 20 20 cd 0d 18 f4 09  20 20 20 20 cd 0d 18 f5  |   .....    ....|
0002f450  18 20 20 fd 20 66 69 6c  65 5f 6f 66 66 73 65 74  |.  . file_offset|
0002f460  25 20 3d 20 30 0d 18 f6  3d 20 20 d9 23 20 58 25  |% = 0...=  .# X%|
0002f470  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0002f480  20 20 20 20 20 20 20 20  3a f4 20 43 6c 6f 73 65  |        :. Close|
0002f490  20 74 68 65 20 74 65 6d  70 6c 61 74 65 20 66 69  | the template fi|
0002f4a0  6c 65 0d 18 f7 3f 20 20  f2 73 68 65 6c 6c 5f 48  |le...?  .shell_H|
0002f4b0  65 61 70 42 6c 6f 63 6b  52 65 74 75 72 6e 28 62  |eapBlockReturn(b|
0002f4c0  75 66 66 25 29 20 3a f4  20 52 65 6c 65 61 73 65  |uff%) :. Release|
0002f4d0  20 77 6f 72 6b 73 70 61  63 65 20 62 75 66 66 65  | workspace buffe|
0002f4e0  72 0d 18 f8 33 20 20 62  75 66 66 5f 73 69 7a 65  |r...3  buff_size|
0002f4f0  25 20 3d 20 20 6c 61 72  67 65 73 74 5f 64 65 66  |% =  largest_def|
0002f500  25 20 2b 20 74 6f 74 61  6c 5f 69 6e 64 69 72 73  |% + total_indirs|
0002f510  69 7a 65 25 0d 18 f9 05  cd 0d 18 fa 05 e1 0d 18  |ize%............|
0002f520  fb 05 3a 0d 18 fc 26 2a  7c 53 74 6f 70 20 50 52  |..:...&*|Stop PR|
0002f530  4f 43 73 68 65 6c 6c 5f  54 65 6d 70 6c 61 74 65  |OCshell_Template|
0002f540  46 69 6c 65 49 6e 66 6f  32 0d 18 fd 04 0d 18 fe  |FileInfo2.......|
0002f550  27 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |'*|Start PROCshe|
0002f560  6c 6c 5f 54 65 6d 70 6c  61 74 65 46 69 6c 65 49  |ll_TemplateFileI|
0002f570  6e 66 6f 33 0d 18 ff 50  dd 20 f2 73 68 65 6c 6c  |nfo3...P. .shell|
0002f580  5f 54 65 6d 70 6c 61 74  65 46 69 6c 65 49 6e 66  |_TemplateFileInf|
0002f590  6f 33 28 66 69 6c 65 6e  61 6d 65 24 2c f8 20 62  |o3(filename$,. b|
0002f5a0  75 66 66 5f 73 69 7a 65  25 2c f8 20 6e 72 5f 74  |uff_size%,. nr_t|
0002f5b0  65 6d 70 6c 61 74 65 73  25 2c f8 20 72 65 73 75  |emplates%,. resu|
0002f5c0  6c 74 25 29 0d 19 00 35  ea 20 70 6f 73 25 2c 74  |lt%)...5. pos%,t|
0002f5d0  6f 74 61 6c 5f 69 6e 64  69 72 73 69 7a 65 25 2c  |otal_indirsize%,|
0002f5e0  6c 61 72 67 65 73 74 5f  64 65 66 25 2c 66 69 6c  |largest_def%,fil|
0002f5f0  65 5f 6f 66 66 73 65 74  25 0d 19 01 0b ea 20 62  |e_offset%..... b|
0002f600  75 66 66 25 0d 19 02 2d  ea 20 63 74 72 25 2c 63  |uff%...-. ctr%,c|
0002f610  68 61 72 25 2c 6f 6c 64  5f 70 74 72 25 2c 6e 72  |har%,old_ptr%,nr|
0002f620  5f 69 63 6f 6e 73 25 2c  6a 25 2c 66 6c 61 67 73  |_icons%,j%,flags|
0002f630  25 0d 19 03 42 f4 20 52  65 74 75 72 6e 73 20 74  |%...B. Returns t|
0002f640  68 65 20 73 69 7a 65 20  6f 66 20 74 68 65 20 62  |he size of the b|
0002f650  75 66 66 65 72 20 6e 65  65 64 65 64 20 62 79 20  |uffer needed by |
0002f660  22 57 69 6d 70 5f 4c 6f  61 64 54 65 6d 70 6c 61  |"Wimp_LoadTempla|
0002f670  74 65 22 0d 19 04 2d f4  20 61 6e 64 20 74 68 65  |te"...-. and the|
0002f680  20 6e 75 6d 62 65 72 20  6f 66 20 74 65 6d 70 6c  | number of templ|
0002f690  61 74 65 73 20 69 6e 20  74 68 65 20 66 69 6c 65  |ates in the file|
0002f6a0  0d 19 05 44 70 6f 73 25  20 3d 20 30 3a 6e 72 5f  |...Dpos% = 0:nr_|
0002f6b0  74 65 6d 70 6c 61 74 65  73 25 20 3d 20 30 3a 74  |templates% = 0:t|
0002f6c0  6f 74 61 6c 5f 69 6e 64  69 72 73 69 7a 65 25 20  |otal_indirsize% |
0002f6d0  3d 20 30 3a 6c 61 72 67  65 73 74 5f 64 65 66 25  |= 0:largest_def%|
0002f6e0  20 3d 20 30 0d 19 06 25  62 75 66 66 25 20 3d 20  | = 0...%buff% = |
0002f6f0  a4 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
0002f700  46 65 74 63 68 28 31 33  29 0d 19 07 25 c8 99 20  |Fetch(13)...%.. |
0002f710  22 57 69 6d 70 5f 4f 70  65 6e 54 65 6d 70 6c 61  |"Wimp_OpenTempla|
0002f720  74 65 22 2c 2c 66 69 6c  65 6e 61 6d 65 24 0d 19  |te",,filename$..|
0002f730  08 05 f5 0d 19 09 12 20  20 24 62 75 66 66 25 20  |.......  $buff% |
0002f740  3d 20 22 2a 22 0d 19 0a  30 20 20 f4 20 74 68 65  |= "*"...0  . the|
0002f750  20 66 6f 6c 6c 6f 77 69  6e 67 20 6f 6e 6c 79 20  | following only |
0002f760  77 6f 72 6b 73 20 6f 6e  20 52 49 53 43 20 4f 53  |works on RISC OS|
0002f770  20 33 2e 2e 2e 0d 19 0b  4f 20 20 c8 99 20 22 57  | 3......O  .. "W|
0002f780  69 6d 70 5f 4c 6f 61 64  54 65 6d 70 6c 61 74 65  |imp_LoadTemplate|
0002f790  22 2c 2c 2d 31 2c 2c 2c  2c 62 75 66 66 25 2c 70  |",,-1,,,,buff%,p|
0002f7a0  6f 73 25 20 b8 20 2c 62  75 66 66 5f 73 69 7a 65  |os% . ,buff_size|
0002f7b0  25 2c 69 6e 64 69 72 73  69 7a 65 25 2c 2c 2c 2c  |%,indirsize%,,,,|
0002f7c0  70 6f 73 25 0d 19 0c 13  20 20 e7 20 70 6f 73 25  |pos%....  . pos%|
0002f7d0  20 3c 3e 20 30 20 8c 0d  19 0d 3f 20 20 20 20 e7  | <> 0 ....?    .|
0002f7e0  20 62 75 66 66 5f 73 69  7a 65 25 20 3e 20 6c 61  | buff_size% > la|
0002f7f0  72 67 65 73 74 5f 64 65  66 25 20 8c 20 6c 61 72  |rgest_def% . lar|
0002f800  67 65 73 74 5f 64 65 66  25 20 3d 20 62 75 66 66  |gest_def% = buff|
0002f810  5f 73 69 7a 65 25 0d 19  0e 26 20 20 20 20 74 6f  |_size%...&    to|
0002f820  74 61 6c 5f 69 6e 64 69  72 73 69 7a 65 25 20 2b  |tal_indirsize% +|
0002f830  3d 20 69 6e 64 69 72 73  69 7a 65 25 0d 19 0f 1a  |= indirsize%....|
0002f840  20 20 20 20 6e 72 5f 74  65 6d 70 6c 61 74 65 73  |    nr_templates|
0002f850  25 20 2b 3d 20 31 0d 19  10 07 20 20 cd 0d 19 11  |% += 1....  ....|
0002f860  0e fd 20 70 6f 73 25 20  3d 20 30 0d 19 12 1b c8  |.. pos% = 0.....|
0002f870  99 20 22 57 69 6d 70 5f  43 6c 6f 73 65 54 65 6d  |. "Wimp_CloseTem|
0002f880  70 6c 61 74 65 22 0d 19  13 30 62 75 66 66 5f 73  |plate"...0buff_s|
0002f890  69 7a 65 25 20 3d 20 6c  61 72 67 65 73 74 5f 64  |ize% = largest_d|
0002f8a0  65 66 25 20 2b 20 74 6f  74 61 6c 5f 69 6e 64 69  |ef% + total_indi|
0002f8b0  72 73 69 7a 65 25 0d 19  14 21 f2 73 68 65 6c 6c  |rsize%...!.shell|
0002f8c0  5f 48 65 61 70 42 6c 6f  63 6b 52 65 74 75 72 6e  |_HeapBlockReturn|
0002f8d0  28 62 75 66 66 25 29 0d  19 15 05 e1 0d 19 16 05  |(buff%).........|
0002f8e0  3a 0d 19 17 26 2a 7c 53  74 6f 70 20 50 52 4f 43  |:...&*|Stop PROC|
0002f8f0  73 68 65 6c 6c 5f 54 65  6d 70 6c 61 74 65 46 69  |shell_TemplateFi|
0002f900  6c 65 49 6e 66 6f 33 0d  19 18 04 0d 19 19 19 2a  |leInfo3........*|
0002f910  7c 53 74 61 72 74 20 46  4e 52 4f 33 5f 50 72 65  ||Start FNRO3_Pre|
0002f920  73 65 6e 74 0d 19 1a 12  dd 20 a4 52 4f 33 5f 50  |sent..... .RO3_P|
0002f930  72 65 73 65 6e 74 0d 19  1b 17 ea 20 62 6c 6b 25  |resent..... blk%|
0002f940  2c 6c 65 6e 25 2c 72 65  73 75 6c 74 24 0d 19 1c  |,len%,result$...|
0002f950  3b f4 20 52 65 74 75 72  6e 73 20 54 52 55 45 20  |;. Returns TRUE |
0002f960  69 66 20 52 49 53 43 20  4f 53 20 33 20 69 73 20  |if RISC OS 3 is |
0002f970  70 72 65 73 65 6e 74 2c  20 6f 74 68 65 72 77 69  |present, otherwi|
0002f980  73 65 20 46 41 4c 53 45  0d 19 1d 41 62 6c 6b 25  |se FALSE...Ablk%|
0002f990  20 3d 20 a4 73 68 65 6c  6c 5f 48 65 61 70 42 6c  | = .shell_HeapBl|
0002f9a0  6f 63 6b 46 65 74 63 68  28 32 35 36 29 20 20 20  |ockFetch(256)   |
0002f9b0  20 20 3a f4 20 43 6c 61  69 6d 20 73 6f 6d 65 20  |  :. Claim some |
0002f9c0  77 6f 72 6b 73 70 61 63  65 0d 19 1e 3b ff 28 22  |workspace...;.("|
0002f9d0  53 65 74 20 52 4f 33 24  43 68 65 63 6b 20 59 22  |Set RO3$Check Y"|
0002f9e0  29 20 20 20 20 3a f4 20  53 65 74 20 61 20 73 79  |)    :. Set a sy|
0002f9f0  73 74 65 6d 20 76 61 72  69 61 62 6c 65 20 74 6f  |stem variable to|
0002fa00  20 22 59 22 0d 19 1f 4d  f4 20 54 68 65 20 6e 65  | "Y"...M. The ne|
0002fa10  78 74 20 6c 69 6e 65 20  73 65 74 73 20 74 68 65  |xt line sets the|
0002fa20  20 73 79 73 74 65 6d 20  76 61 72 69 61 62 6c 65  | system variable|
0002fa30  20 74 6f 20 22 4e 22 20  69 66 20 52 49 53 43 20  | to "N" if RISC |
0002fa40  4f 53 20 33 20 6f 72 20  62 65 74 74 65 72 20 69  |OS 3 or better i|
0002fa50  73 0d 19 20 12 f4 20 6e  6f 74 20 70 72 65 73 65  |s.. .. not prese|
0002fa60  6e 74 2e 0d 19 21 34 ff  28 22 52 4d 45 6e 73 75  |nt...!4.("RMEnsu|
0002fa70  72 65 20 55 74 69 6c 69  74 79 4d 6f 64 75 6c 65  |re UtilityModule|
0002fa80  20 33 2e 30 30 20 53 65  74 20 52 4f 33 24 43 68  | 3.00 Set RO3$Ch|
0002fa90  65 63 6b 20 4e 22 29 0d  19 22 4f f4 20 4e 6f 77  |eck N").."O. Now|
0002faa0  20 77 65 20 63 68 65 63  6b 20 74 68 65 20 76 61  | we check the va|
0002fab0  6c 75 65 20 6f 66 20 74  68 65 20 73 79 73 74 65  |lue of the syste|
0002fac0  6d 20 76 61 72 69 61 62  6c 65 20 62 79 20 72 65  |m variable by re|
0002fad0  61 64 69 6e 67 20 69 74  20 69 6e 74 6f 20 61 20  |ading it into a |
0002fae0  62 75 66 66 65 72 0d 19  23 38 c8 99 20 22 4f 53  |buffer..#8.. "OS|
0002faf0  5f 52 65 61 64 56 61 72  56 61 6c 22 2c 22 52 4f  |_ReadVarVal","RO|
0002fb00  33 24 43 68 65 63 6b 22  2c 62 6c 6b 25 2c 32 35  |3$Check",blk%,25|
0002fb10  36 2c 30 2c 30 20 b8 20  2c 2c 6c 65 6e 25 0d 19  |6,0,0 . ,,len%..|
0002fb20  24 35 f4 20 41 64 64 20  73 74 72 69 6e 67 20 74  |$5. Add string t|
0002fb30  65 72 6d 69 6e 61 74 6f  72 20 73 6f 20 74 68 61  |erminator so tha|
0002fb40  74 20 42 41 53 49 43 20  63 61 6e 20 72 65 61 64  |t BASIC can read|
0002fb50  20 69 74 0d 19 25 12 62  6c 6b 25 3f 6c 65 6e 25  | it..%.blk%?len%|
0002fb60  20 3d 20 31 33 0d 19 26  31 f4 20 55 6e 73 65 74  | = 13..&1. Unset|
0002fb70  20 74 68 65 20 73 79 73  74 65 6d 20 76 61 72 69  | the system vari|
0002fb80  61 62 6c 65 20 74 6f 20  74 69 64 79 20 74 68 69  |able to tidy thi|
0002fb90  6e 67 73 20 75 70 0d 19  27 18 ff 28 22 55 6e 73  |ngs up..'..("Uns|
0002fba0  65 74 20 52 4f 33 24 43  68 65 63 6b 22 29 0d 19  |et RO3$Check")..|
0002fbb0  28 13 72 65 73 75 6c 74  24 20 3d 20 24 62 6c 6b  |(.result$ = $blk|
0002fbc0  25 0d 19 29 20 f2 73 68  65 6c 6c 5f 48 65 61 70  |%..) .shell_Heap|
0002fbd0  42 6c 6f 63 6b 52 65 74  75 72 6e 28 62 6c 6b 25  |BlockReturn(blk%|
0002fbe0  29 0d 19 2a 1f e7 20 72  65 73 75 6c 74 24 20 3d  |)..*.. result$ =|
0002fbf0  20 22 4e 22 20 8c 20 3d  20 a3 20 8b 20 3d 20 b9  | "N" . = . . = .|
0002fc00  0d 19 2b 18 2a 7c 53 74  6f 70 20 46 4e 52 4f 33  |..+.*|Stop FNRO3|
0002fc10  5f 50 72 65 73 65 6e 74  0d 19 2c 04 0d 19 2d 24  |_Present..,...-$|
0002fc20  2a 7c 53 74 61 72 74 20  46 4e 73 68 65 6c 6c 5f  |*|Start FNshell_|
0002fc30  57 69 6e 64 6f 77 43 6f  75 6e 74 49 63 6f 6e 73  |WindowCountIcons|
0002fc40  0d 19 2e 22 dd 20 a4 73  68 65 6c 6c 5f 57 69 6e  |...". .shell_Win|
0002fc50  64 6f 77 43 6f 75 6e 74  49 63 6f 6e 73 28 77 68  |dowCountIcons(wh|
0002fc60  25 29 0d 19 2f 1c ea 20  77 5f 62 75 66 66 25 2c  |%)../.. w_buff%,|
0002fc70  52 4f 33 25 2c 6e 72 5f  69 63 6f 6e 73 25 0d 19  |RO3%,nr_icons%..|
0002fc80  30 2f e7 20 28 5f 55 25  21 31 30 30 20 80 20 31  |0/. (_U%!100 . 1|
0002fc90  20 3c 3c 20 31 30 29 20  8c 20 52 4f 33 25 20 3d  | << 10) . RO3% =|
0002fca0  20 b9 20 8b 20 52 4f 33  25 20 3d 20 a3 0d 19 31  | . . RO3% = ...1|
0002fcb0  0c e7 20 52 4f 33 25 20  8c 0d 19 32 15 2a 7c 69  |.. RO3% ...2.*|i|
0002fcc0  66 64 65 66 20 54 72 61  63 65 49 6e 69 74 0d 19  |fdef TraceInit..|
0002fcd0  33 3d 20 20 f2 73 68 65  6c 6c 5f 54 72 61 63 65  |3=  .shell_Trace|
0002fce0  66 30 28 22 57 69 6e 64  6f 77 43 6f 75 6e 74 49  |f0("WindowCountI|
0002fcf0  63 6f 6e 73 3a 52 49 53  43 20 4f 53 20 33 20 64  |cons:RISC OS 3 d|
0002fd00  65 74 65 63 74 65 64 2e  2e 22 29 0d 19 34 0b 2a  |etected..")..4.*|
0002fd10  7c 65 6e 64 69 66 0d 19  35 26 20 20 e7 20 77 68  ||endif..5&  . wh|
0002fd20  25 20 3d 20 2d 31 20 8c  20 77 68 25 20 3d 20 2d  |% = -1 . wh% = -|
0002fd30  32 20 3a f4 20 69 63 6f  6e 62 61 72 0d 19 36 2a  |2 :. iconbar..6*|
0002fd40  20 20 77 5f 62 75 66 66  25 20 20 3d 20 a4 73 68  |  w_buff%  = .sh|
0002fd50  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
0002fd60  63 68 28 38 38 29 0d 19  37 4c 20 20 21 77 5f 62  |ch(88)..7L  !w_b|
0002fd70  75 66 66 25 20 3d 20 77  68 25 20 20 20 20 20 20  |uff% = wh%      |
0002fd80  20 20 20 20 20 3a f4 20  53 74 6f 72 65 20 77 69  |     :. Store wi|
0002fd90  6e 64 6f 77 20 68 61 6e  64 6c 65 20 69 6e 20 66  |ndow handle in f|
0002fda0  69 72 73 74 20 77 6f 72  64 20 6f 66 20 62 6c 6f  |irst word of blo|
0002fdb0  63 6b 0d 19 38 2a 20 20  c8 99 20 22 57 69 6d 70  |ck..8*  .. "Wimp|
0002fdc0  5f 47 65 74 57 69 6e 64  6f 77 49 6e 66 6f 22 2c  |_GetWindowInfo",|
0002fdd0  2c 77 5f 62 75 66 66 25  20 2b 20 31 0d 19 39 1c  |,w_buff% + 1..9.|
0002fde0  20 20 6e 72 5f 69 63 6f  6e 73 25 20 3d 20 77 5f  |  nr_icons% = w_|
0002fdf0  62 75 66 66 25 21 38 38  0d 19 3a 15 2a 7c 69 66  |buff%!88..:.*|if|
0002fe00  64 65 66 20 54 72 61 63  65 49 6e 69 74 0d 19 3b  |def TraceInit..;|
0002fe10  40 20 20 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |@  .shell_Tracef|
0002fe20  30 28 22 57 69 6e 64 6f  77 43 6f 75 6e 74 49 63  |0("WindowCountIc|
0002fe30  6f 6e 73 3a 6e 72 5f 69  63 6f 6e 73 25 20 3d 20  |ons:nr_icons% = |
0002fe40  22 2b c3 6e 72 5f 69 63  6f 6e 73 25 29 0d 19 3c  |"+.nr_icons%)..<|
0002fe50  0b 2a 7c 65 6e 64 69 66  0d 19 3d 05 cc 0d 19 3e  |.*|endif..=....>|
0002fe60  15 2a 7c 69 66 64 65 66  20 54 72 61 63 65 49 6e  |.*|ifdef TraceIn|
0002fe70  69 74 0d 19 3f 3e 20 20  f2 73 68 65 6c 6c 5f 54  |it..?>  .shell_T|
0002fe80  72 61 63 65 66 30 28 22  57 69 6e 64 6f 77 43 6f  |racef0("WindowCo|
0002fe90  75 6e 74 49 63 6f 6e 73  3a 52 49 53 43 20 4f 53  |untIcons:RISC OS|
0002fea0  20 33 20 4e 4f 54 20 66  6f 75 6e 64 2e 2e 22 29  | 3 NOT found..")|
0002feb0  0d 19 40 0b 2a 7c 65 6e  64 69 66 0d 19 41 2d 20  |..@.*|endif..A- |
0002fec0  20 77 5f 62 75 66 66 25  20 20 20 3d 20 a4 73 68  | w_buff%   = .sh|
0002fed0  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
0002fee0  63 68 28 36 30 30 30 29  0d 19 42 11 20 20 e7 20  |ch(6000)..B.  . |
0002fef0  77 68 25 20 3e 20 30 20  8c 0d 19 43 4e 20 20 20  |wh% > 0 ...CN   |
0002ff00  20 21 77 5f 62 75 66 66  25 20 20 3d 20 77 68 25  | !w_buff%  = wh%|
0002ff10  20 20 20 20 20 20 20 20  20 20 3a f4 20 53 74 6f  |          :. Sto|
0002ff20  72 65 20 77 69 6e 64 6f  77 20 68 61 6e 64 6c 65  |re window handle|
0002ff30  20 69 6e 20 66 69 72 73  74 20 77 6f 72 64 20 6f  | in first word o|
0002ff40  66 20 62 6c 6f 63 6b 0d  19 44 28 20 20 20 20 c8  |f block..D(    .|
0002ff50  99 20 22 57 69 6d 70 5f  47 65 74 57 69 6e 64 6f  |. "Wimp_GetWindo|
0002ff60  77 49 6e 66 6f 22 2c 2c  77 5f 62 75 66 66 25 0d  |wInfo",,w_buff%.|
0002ff70  19 45 1e 20 20 20 20 6e  72 5f 69 63 6f 6e 73 25  |.E.    nr_icons%|
0002ff80  20 3d 20 77 5f 62 75 66  66 25 21 38 38 0d 19 46  | = w_buff%!88..F|
0002ff90  07 20 20 cd 0d 19 47 15  2a 7c 69 66 64 65 66 20  |.  ...G.*|ifdef |
0002ffa0  54 72 61 63 65 49 6e 69  74 0d 19 48 40 20 20 f2  |TraceInit..H@  .|
0002ffb0  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 57  |shell_Tracef0("W|
0002ffc0  69 6e 64 6f 77 43 6f 75  6e 74 49 63 6f 6e 73 3a  |indowCountIcons:|
0002ffd0  6e 72 5f 69 63 6f 6e 73  25 20 3d 20 22 2b c3 6e  |nr_icons% = "+.n|
0002ffe0  72 5f 69 63 6f 6e 73 25  29 0d 19 49 0b 2a 7c 65  |r_icons%)..I.*|e|
0002fff0  6e 64 69 66 0d 19 4a 05  cd 0d 19 4b 23 f2 73 68  |ndif..J....K#.sh|
00030000  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 52 65 74  |ell_HeapBlockRet|
00030010  75 72 6e 28 77 5f 62 75  66 66 25 29 0d 19 4c 0f  |urn(w_buff%)..L.|
00030020  3d 20 6e 72 5f 69 63 6f  6e 73 25 0d 19 4d 05 3a  |= nr_icons%..M.:|
00030030  0d 19 4e 23 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |..N#*|Stop FNshe|
00030040  6c 6c 5f 57 69 6e 64 6f  77 43 6f 75 6e 74 49 63  |ll_WindowCountIc|
00030050  6f 6e 73 0d 19 4f 04 0d  19 50 22 2a 7c 53 74 61  |ons..O...P"*|Sta|
00030060  72 74 20 46 4e 73 68 65  6c 6c 5f 53 6c 69 64 65  |rt FNshell_Slide|
00030070  72 47 65 74 56 61 6c 75  65 0d 19 51 24 dd 20 a4  |rGetValue..Q$. .|
00030080  73 68 65 6c 6c 5f 53 6c  69 64 65 72 47 65 74 56  |shell_SliderGetV|
00030090  61 6c 75 65 28 68 61 6e  64 6c 65 25 29 0d 19 52  |alue(handle%)..R|
000300a0  1c 3d 20 28 5f 55 25 21  33 33 32 20 2b 20 68 61  |.= (_U%!332 + ha|
000300b0  6e 64 6c 65 25 29 21 32  38 0d 19 53 05 3a 0d 19  |ndle%)!28..S.:..|
000300c0  54 21 2a 7c 53 74 6f 70  20 46 4e 73 68 65 6c 6c  |T!*|Stop FNshell|
000300d0  5f 53 6c 69 64 65 72 47  65 74 56 61 6c 75 65 0d  |_SliderGetValue.|
000300e0  19 55 04 0d 19 56 22 2a  7c 53 74 61 72 74 20 50  |.U...V"*|Start P|
000300f0  52 4f 43 73 68 65 6c 6c  5f 48 61 6e 64 6c 65 53  |ROCshell_HandleS|
00030100  6c 69 64 65 72 0d 19 57  2c dd 20 f2 73 68 65 6c  |lider..W,. .shel|
00030110  6c 5f 48 61 6e 64 6c 65  53 6c 69 64 65 72 28 77  |l_HandleSlider(w|
00030120  68 25 2c 69 68 25 2c 65  5f 6f 66 66 73 65 74 25  |h%,ih%,e_offset%|
00030130  29 0d 19 58 21 ea 20 64  72 61 67 5f 62 6c 6b 25  |)..X!. drag_blk%|
00030140  2c 78 25 2c 79 25 2c 62  6c 6b 25 2c 65 5f 62 6c  |,x%,y%,blk%,e_bl|
00030150  6b 25 0d 19 59 15 2a 7c  69 66 64 65 66 20 54 72  |k%..Y.*|ifdef Tr|
00030160  61 63 65 49 6e 69 74 0d  19 5a 3c f2 73 68 65 6c  |aceInit..Z<.shel|
00030170  6c 5f 54 72 61 63 65 66  30 28 22 48 61 6e 64 6c  |l_Tracef0("Handl|
00030180  65 53 6c 69 64 65 72 3a  73 6c 69 64 65 72 20 64  |eSlider:slider d|
00030190  72 61 67 20 65 76 65 6e  74 20 66 6f 75 6e 64 2e  |rag event found.|
000301a0  2e 22 29 0d 19 5b 0b 2a  7c 65 6e 64 69 66 0d 19  |.")..[.*|endif..|
000301b0  5c 23 65 5f 62 6c 6b 25  20 20 20 20 3d 20 5f 55  |\#e_blk%    = _U|
000301c0  25 21 33 33 32 20 2b 20  65 5f 6f 66 66 73 65 74  |%!332 + e_offset|
000301d0  25 0d 19 5d 29 64 72 61  67 5f 62 6c 6b 25 20 3d  |%..])drag_blk% =|
000301e0  20 a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
000301f0  6b 46 65 74 63 68 28 35  30 29 0d 19 5e 04 0d 19  |kFetch(50)..^...|
00030200  5f 15 64 72 61 67 5f 62  6c 6b 25 21 30 20 3d 20  |_.drag_blk%!0 = |
00030210  77 68 25 0d 19 60 45 64  72 61 67 5f 62 6c 6b 25  |wh%..`Edrag_blk%|
00030220  21 34 20 3d 20 65 5f 62  6c 6b 25 21 38 20 20 20  |!4 = e_blk%!8   |
00030230  20 20 20 20 20 20 20 20  20 20 20 3a f4 20 69 63  |           :. ic|
00030240  6f 6e 20 6e 72 20 6f 66  20 62 61 63 6b 67 72 6f  |on nr of backgro|
00030250  75 6e 64 20 69 63 6f 6e  0d 19 61 25 c8 99 20 22  |und icon..a%.. "|
00030260  57 69 6d 70 5f 47 65 74  49 63 6f 6e 53 74 61 74  |Wimp_GetIconStat|
00030270  65 22 2c 2c 64 72 61 67  5f 62 6c 6b 25 0d 19 62  |e",,drag_blk%..b|
00030280  15 62 6c 6b 25 20 20 20  20 3d 20 5f 55 25 21 33  |.blk%    = _U%!3|
00030290  32 38 0d 19 63 43 62 6c  6b 25 21 30 30 20 3d 20  |28..cCblk%!00 = |
000302a0  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
000302b0  20 20 20 20 20 20 20 20  20 20 3a f4 20 6f 6c 64  |          :. old|
000302c0  20 78 20 70 6f 73 69 74  69 6f 6e 20 6f 66 20 73  | x position of s|
000302d0  6c 69 64 65 72 0d 19 64  44 62 6c 6b 25 21 30 34  |lider..dDblk%!04|
000302e0  20 3d 20 64 72 61 67 5f  62 6c 6b 25 21 31 36 20  | = drag_blk%!16 |
000302f0  2d 20 64 72 61 67 5f 62  6c 6b 25 21 38 3a f4 20  |- drag_blk%!8:. |
00030300  6c 65 6e 67 74 68 20 6f  66 20 62 61 63 6b 67 72  |length of backgr|
00030310  6f 75 6e 64 20 69 63 6f  6e 0d 19 65 36 62 6c 6b  |ound icon..e6blk|
00030320  25 21 30 38 20 3d 20 69  68 25 20 20 20 20 20 20  |%!08 = ih%      |
00030330  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00030340  20 3a f4 20 73 6c 69 64  65 72 20 69 63 6f 6e 0d  | :. slider icon.|
00030350  19 66 37 62 6c 6b 25 21  31 32 20 3d 20 65 5f 62  |.f7blk%!12 = e_b|
00030360  6c 6b 25 21 31 32 20 20  20 20 20 20 20 20 20 20  |lk%!12          |
00030370  20 20 20 20 20 20 20 3a  f4 20 64 69 73 70 6c 61  |       :. displa|
00030380  79 20 69 63 6f 6e 0d 19  67 41 62 6c 6b 25 21 31  |y icon..gAblk%!1|
00030390  36 20 3d 20 65 5f 62 6c  6b 25 20 20 20 20 20 20  |6 = e_blk%      |
000303a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3a f4  |              :.|
000303b0  20 61 64 64 72 65 73 73  20 6f 66 20 65 76 65 6e  | address of even|
000303c0  74 20 62 6c 6f 63 6b 0d  19 68 46 62 6c 6b 25 21  |t block..hFblk%!|
000303d0  32 34 20 3d 20 65 5f 62  6c 6b 25 21 32 34 20 20  |24 = e_blk%!24  |
000303e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3a  |               :|
000303f0  f4 20 61 64 64 72 65 73  73 20 6f 66 20 6e 6f 74  |. address of not|
00030400  69 66 79 20 46 4e 20 73  74 72 69 6e 67 0d 19 69  |ify FN string..i|
00030410  04 0d 19 6a 16 64 72 61  67 5f 62 6c 6b 25 21 30  |...j.drag_blk%!0|
00030420  30 20 3d 20 77 68 25 0d  19 6b 27 c8 99 20 22 57  |0 = wh%..k'.. "W|
00030430  69 6d 70 5f 47 65 74 57  69 6e 64 6f 77 53 74 61  |imp_GetWindowSta|
00030440  74 65 22 2c 2c 64 72 61  67 5f 62 6c 6b 25 0d 19  |te",,drag_blk%..|
00030450  6c 24 78 25 20 3d 20 64  72 61 67 5f 62 6c 6b 25  |l$x% = drag_blk%|
00030460  21 30 34 20 2d 20 64 72  61 67 5f 62 6c 6b 25 21  |!04 - drag_blk%!|
00030470  32 30 0d 19 6d 24 79 25  20 3d 20 64 72 61 67 5f  |20..m$y% = drag_|
00030480  62 6c 6b 25 21 31 36 20  2d 20 64 72 61 67 5f 62  |blk%!16 - drag_b|
00030490  6c 6b 25 21 32 34 0d 19  6e 16 64 72 61 67 5f 62  |lk%!24..n.drag_b|
000304a0  6c 6b 25 21 30 34 20 3d  20 69 68 25 0d 19 6f 25  |lk%!04 = ih%..o%|
000304b0  c8 99 20 22 57 69 6d 70  5f 47 65 74 49 63 6f 6e  |.. "Wimp_GetIcon|
000304c0  53 74 61 74 65 22 2c 2c  64 72 61 67 5f 62 6c 6b  |State",,drag_blk|
000304d0  25 0d 19 70 22 64 72 61  67 5f 62 6c 6b 25 21 30  |%..p"drag_blk%!0|
000304e0  34 20 20 3d 20 37 20 3a  f4 20 64 72 61 67 20 74  |4  = 7 :. drag t|
000304f0  79 70 65 0d 19 71 16 64  72 61 67 5f 62 6c 6b 25  |ype..q.drag_blk%|
00030500  21 30 38 20 2b 3d 20 78  25 0d 19 72 16 64 72 61  |!08 += x%..r.dra|
00030510  67 5f 62 6c 6b 25 21 31  32 20 2b 3d 20 79 25 0d  |g_blk%!12 += y%.|
00030520  19 73 16 64 72 61 67 5f  62 6c 6b 25 21 31 36 20  |.s.drag_blk%!16 |
00030530  2b 3d 20 78 25 0d 19 74  16 64 72 61 67 5f 62 6c  |+= x%..t.drag_bl|
00030540  6b 25 21 32 30 20 2b 3d  20 79 25 0d 19 75 20 64  |k%!20 += y%..u d|
00030550  72 61 67 5f 62 6c 6b 25  21 32 34 20 20 3d 20 64  |rag_blk%!24  = d|
00030560  72 61 67 5f 62 6c 6b 25  21 30 38 0d 19 76 20 64  |rag_blk%!08..v d|
00030570  72 61 67 5f 62 6c 6b 25  21 32 38 20 20 3d 20 64  |rag_blk%!28  = d|
00030580  72 61 67 5f 62 6c 6b 25  21 31 32 0d 19 77 29 64  |rag_blk%!12..w)d|
00030590  72 61 67 5f 62 6c 6b 25  21 33 32 20 20 3d 20 64  |rag_blk%!32  = d|
000305a0  72 61 67 5f 62 6c 6b 25  21 32 34 20 2b 20 62 6c  |rag_blk%!24 + bl|
000305b0  6b 25 21 34 0d 19 78 20  64 72 61 67 5f 62 6c 6b  |k%!4..x drag_blk|
000305c0  25 21 33 36 20 20 3d 20  64 72 61 67 5f 62 6c 6b  |%!36  = drag_blk|
000305d0  25 21 32 30 0d 19 79 20  c8 99 20 22 57 69 6d 70  |%!20..y .. "Wimp|
000305e0  5f 44 72 61 67 42 6f 78  22 2c 2c 64 72 61 67 5f  |_DragBox",,drag_|
000305f0  62 6c 6b 25 0d 19 7a 04  0d 19 7b 25 f2 73 68 65  |blk%..z...{%.she|
00030600  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 52 65 74 75  |ll_HeapBlockRetu|
00030610  72 6e 28 64 72 61 67 5f  62 6c 6b 25 29 0d 19 7c  |rn(drag_blk%)..||
00030620  49 5f 55 25 21 31 30 30  20 3d 20 5f 55 25 21 31  |I_U%!100 = _U%!1|
00030630  30 30 20 84 20 31 20 3c  3c 20 31 31 20 3a f4 20  |00 . 1 << 11 :. |
00030640  73 65 74 20 27 73 6c 69  64 65 72 20 64 72 61 67  |set 'slider drag|
00030650  20 69 6e 20 70 72 6f 67  72 65 73 73 27 20 66 6c  | in progress' fl|
00030660  61 67 20 62 69 74 0d 19  7d 05 e1 0d 19 7e 05 3a  |ag bit..}....~.:|
00030670  0d 19 7f 21 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |...!*|Stop PROCs|
00030680  68 65 6c 6c 5f 48 61 6e  64 6c 65 53 6c 69 64 65  |hell_HandleSlide|
00030690  72 0d 19 80 04 0d 19 81  1c 2a 7c 53 74 61 72 74  |r........*|Start|
000306a0  20 50 52 4f 43 73 68 65  6c 6c 5f 53 6c 69 64 65  | PROCshell_Slide|
000306b0  72 0d 19 82 13 dd 20 f2  73 68 65 6c 6c 5f 53 6c  |r..... .shell_Sl|
000306c0  69 64 65 72 0d 19 83 3e  ea 20 70 74 72 5f 62 6c  |ider...>. ptr_bl|
000306d0  6b 25 2c 62 6c 6b 25 2c  78 70 25 2c 73 6c 69 64  |k%,blk%,xp%,slid|
000306e0  65 72 25 2c 77 68 25 2c  78 25 2c 78 24 2c 74 5f  |er%,wh%,x%,x$,t_|
000306f0  62 6c 6b 25 2c 5f 76 61  6c 75 65 25 2c 76 6f 69  |blk%,_value%,voi|
00030700  64 25 0d 19 84 28 70 74  72 5f 62 6c 6b 25 20 3d  |d%...(ptr_blk% =|
00030710  20 a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
00030720  6b 46 65 74 63 68 28 32  30 29 0d 19 85 16 74 5f  |kFetch(20)....t_|
00030730  62 6c 6b 25 20 20 20 3d  20 5f 55 25 21 33 32 38  |blk%   = _U%!328|
00030740  0d 19 86 26 c8 99 20 22  57 69 6d 70 5f 47 65 74  |...&.. "Wimp_Get|
00030750  50 6f 69 6e 74 65 72 49  6e 66 6f 22 2c 2c 70 74  |PointerInfo",,pt|
00030760  72 5f 62 6c 6b 25 0d 19  87 19 77 68 25 20 20 20  |r_blk%....wh%   |
00030770  20 20 3d 20 70 74 72 5f  62 6c 6b 25 21 31 32 0d  |  = ptr_blk%!12.|
00030780  19 88 16 73 6c 69 64 65  72 25 20 3d 20 74 5f 62  |...slider% = t_b|
00030790  6c 6b 25 21 38 0d 19 89  17 78 70 25 20 20 20 20  |lk%!8....xp%    |
000307a0  20 3d 20 21 70 74 72 5f  62 6c 6b 25 0d 19 8a 16  | = !ptr_blk%....|
000307b0  e7 20 78 70 25 20 3c 3e  20 21 74 5f 62 6c 6b 25  |. xp% <> !t_blk%|
000307c0  20 8c 0d 19 8b 1b 20 20  f4 20 76 61 6c 75 65 20  | .....  . value |
000307d0  68 61 73 20 63 68 61 6e  67 65 64 2e 2e 0d 19 8c  |has changed.....|
000307e0  27 20 20 62 6c 6b 25 20  20 3d 20 a4 73 68 65 6c  |'  blk%  = .shel|
000307f0  6c 5f 48 65 61 70 42 6c  6f 63 6b 46 65 74 63 68  |l_HeapBlockFetch|
00030800  28 35 30 29 0d 19 8d 11  20 20 21 62 6c 6b 25 20  |(50)....  !blk% |
00030810  3d 20 77 68 25 0d 19 8e  24 20 20 c8 99 20 22 57  |= wh%...$  .. "W|
00030820  69 6d 70 5f 47 65 74 57  69 6e 64 6f 77 53 74 61  |imp_GetWindowSta|
00030830  74 65 22 2c 2c 62 6c 6b  25 0d 19 8f 17 20 20 78  |te",,blk%....  x|
00030840  25 20 3d 20 78 70 25 20  2d 20 62 6c 6b 25 21 34  |% = xp% - blk%!4|
00030850  0d 19 90 16 20 20 62 6c  6b 25 21 34 20 3d 20 73  |....  blk%!4 = s|
00030860  6c 69 64 65 72 25 0d 19  91 22 20 20 c8 99 20 22  |lider%..."  .. "|
00030870  57 69 6d 70 5f 47 65 74  49 63 6f 6e 53 74 61 74  |Wimp_GetIconStat|
00030880  65 22 2c 2c 62 6c 6b 25  0d 19 92 20 20 20 c8 99  |e",,blk%...   ..|
00030890  20 22 57 69 6d 70 5f 44  65 6c 65 74 65 49 63 6f  | "Wimp_DeleteIco|
000308a0  6e 22 2c 2c 62 6c 6b 25  0d 19 93 13 20 20 62 6c  |n",,blk%....  bl|
000308b0  6b 25 21 30 34 20 3d 20  77 68 25 0d 19 94 12 20  |k%!04 = wh%.... |
000308c0  20 62 6c 6b 25 21 31 36  20 3d 20 78 25 0d 19 95  | blk%!16 = x%...|
000308d0  24 20 20 c8 99 20 22 57  69 6d 70 5f 43 72 65 61  |$  .. "Wimp_Crea|
000308e0  74 65 49 63 6f 6e 22 2c  2c 62 6c 6b 25 20 2b 20  |teIcon",,blk% + |
000308f0  34 0d 19 96 48 20 20 c8  99 20 22 57 69 6d 70 5f  |4...H  .. "Wimp_|
00030900  46 6f 72 63 65 52 65 64  72 61 77 22 2c 77 68 25  |ForceRedraw",wh%|
00030910  2c 62 6c 6b 25 21 38 2c  62 6c 6b 25 21 31 32 2c  |,blk%!8,blk%!12,|
00030920  62 6c 6b 25 21 38 20 2b  20 74 5f 62 6c 6b 25 21  |blk%!8 + t_blk%!|
00030930  34 2c 62 6c 6b 25 21 32  30 0d 19 97 31 20 20 5f  |4,blk%!20...1  _|
00030940  76 61 6c 75 65 25 20 3d  20 a8 28 28 28 78 25 20  |value% = .(((x% |
00030950  2d 20 62 6c 6b 25 21 38  29 20 2a 20 31 30 30 29  |- blk%!8) * 100)|
00030960  2f 74 5f 62 6c 6b 25 21  34 29 0d 19 98 17 20 20  |/t_blk%!4)....  |
00030970  74 65 6d 70 25 20 3d 20  74 5f 62 6c 6b 25 21 31  |temp% = t_blk%!1|
00030980  36 0d 19 99 18 20 20 74  65 6d 70 25 21 32 38 20  |6....  temp%!28 |
00030990  3d 20 5f 76 61 6c 75 65  25 0d 19 9a 19 20 20 e7  |= _value%....  .|
000309a0  20 74 5f 62 6c 6b 25 21  32 34 20 3c 3e 20 2d 31  | t_blk%!24 <> -1|
000309b0  20 8c 0d 19 9b 34 20 20  20 20 76 6f 69 64 25 20  | ....4    void% |
000309c0  3d 20 a0 28 22 46 4e 22  20 2b 20 24 28 74 5f 62  |= .("FN" + $(t_b|
000309d0  6c 6b 25 21 32 34 29 20  2b 20 22 28 5f 76 61 6c  |lk%!24) + "(_val|
000309e0  75 65 25 29 22 29 0d 19  9c 07 20 20 cd 0d 19 9d  |ue%)")....  ....|
000309f0  18 20 20 e7 20 74 5f 62  6c 6b 25 21 31 32 20 3e  |.  . t_blk%!12 >|
00030a00  3d 20 30 20 8c 0d 19 9e  17 20 20 20 20 78 24 20  |= 0 .....    x$ |
00030a10  3d 20 c3 28 5f 76 61 6c  75 65 25 29 0d 19 9f 2f  |= .(_value%).../|
00030a20  20 20 20 20 f2 73 68 65  6c 6c 5f 49 63 6f 6e 50  |    .shell_IconP|
00030a30  75 74 44 61 74 61 28 77  68 25 2c 74 5f 62 6c 6b  |utData(wh%,t_blk|
00030a40  25 21 31 32 2c 78 24 2c  2d 31 29 0d 19 a0 07 20  |%!12,x$,-1).... |
00030a50  20 cd 0d 19 a1 08 20 20  c8 96 0d 19 a2 13 20 20  | .....  ......  |
00030a60  21 74 5f 62 6c 6b 25 20  3d 20 78 70 25 0d 19 a3  |!t_blk% = xp%...|
00030a70  22 20 20 f2 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |"  .shell_HeapBl|
00030a80  6f 63 6b 52 65 74 75 72  6e 28 62 6c 6b 25 29 0d  |ockReturn(blk%).|
00030a90  19 a4 05 cd 0d 19 a5 24  f2 73 68 65 6c 6c 5f 48  |.......$.shell_H|
00030aa0  65 61 70 42 6c 6f 63 6b  52 65 74 75 72 6e 28 70  |eapBlockReturn(p|
00030ab0  74 72 5f 62 6c 6b 25 29  0d 19 a6 05 e1 0d 19 a7  |tr_blk%)........|
00030ac0  05 3a 0d 19 a8 1b 2a 7c  53 74 6f 70 20 50 52 4f  |.:....*|Stop PRO|
00030ad0  43 73 68 65 6c 6c 5f 53  6c 69 64 65 72 0d 19 a9  |Cshell_Slider...|
00030ae0  04 0d 19 aa 27 2a 7c 53  74 61 72 74 20 46 4e 73  |....'*|Start FNs|
00030af0  68 65 6c 6c 5f 47 65 74  45 76 65 6e 74 4c 69 73  |hell_GetEventLis|
00030b00  74 4f 66 66 73 65 74 32  0d 19 ab 44 dd 20 a4 73  |tOffset2...D. .s|
00030b10  68 65 6c 6c 5f 47 65 74  45 76 65 6e 74 4c 69 73  |hell_GetEventLis|
00030b20  74 4f 66 66 73 65 74 32  28 77 68 25 2c 69 68 25  |tOffset2(wh%,ih%|
00030b30  2c 65 76 65 6e 74 5f 6c  69 73 74 25 2c 72 65 63  |,event_list%,rec|
00030b40  5f 73 69 7a 65 25 2c 61  64 64 25 29 0d 19 ac 43  |_size%,add%)...C|
00030b50  f4 20 66 69 6e 64 20 6f  66 66 73 65 74 20 6f 66  |. find offset of|
00030b60  20 64 61 74 61 20 69 6e  20 65 76 65 6e 74 20 6c  | data in event l|
00030b70  69 73 74 20 62 6c 6f 63  6b 20 67 69 76 65 6e 20  |ist block given |
00030b80  74 68 65 20 77 69 6e 64  6f 77 2f 69 63 6f 6e 0d  |the window/icon.|
00030b90  19 ad 49 f4 20 68 61 6e  64 6c 65 73 2e 20 72 65  |..I. handles. re|
00030ba0  74 75 72 6e 73 20 2d 31  20 69 66 20 6e 6f 20 65  |turns -1 if no e|
00030bb0  76 65 6e 74 73 20 66 6f  75 6e 64 2c 20 2d 32 20  |vents found, -2 |
00030bc0  69 66 20 68 65 61 70 62  6c 6f 63 6b 20 6e 6f 74  |if heapblock not|
00030bd0  20 64 65 66 69 6e 65 64  0d 19 ae 4a f4 20 69 66  | defined...J. if|
00030be0  20 61 64 64 25 20 69 73  20 46 41 4c 53 45 2e 20  | add% is FALSE. |
00030bf0  77 68 65 6e 20 61 64 64  20 69 73 20 54 52 55 45  |when add is TRUE|
00030c00  20 74 68 65 6e 20 74 68  65 20 6c 69 73 74 20 69  | then the list i|
00030c10  73 20 65 78 74 65 6e 64  65 64 20 61 6e 64 20 74  |s extended and t|
00030c20  68 65 0d 19 af 4e f4 20  6f 66 66 73 65 74 20 74  |he...N. offset t|
00030c30  6f 20 74 68 65 20 6e 65  77 20 72 65 63 6f 72 64  |o the new record|
00030c40  20 69 73 20 72 65 74 75  72 6e 65 64 2e 20 46 69  | is returned. Fi|
00030c50  72 73 74 20 77 6f 72 64  20 69 73 20 61 6c 77 61  |rst word is alwa|
00030c60  79 73 20 73 69 7a 65 20  6f 66 20 6c 69 73 74 21  |ys size of list!|
00030c70  0d 19 b0 31 ea 20 6c 69  73 74 5f 73 69 7a 65 25  |...1. list_size%|
00030c80  2c 70 74 72 25 2c 66 6f  75 6e 64 25 2c 6f 66 66  |,ptr%,found%,off|
00030c90  73 65 74 25 2c 65 6d 70  74 79 25 2c 74 65 6d 70  |set%,empty%,temp|
00030ca0  25 0d 19 b1 41 e7 20 28  21 65 76 65 6e 74 5f 6c  |%...A. (!event_l|
00030cb0  69 73 74 25 20 3d 20 30  20 80 20 61 64 64 25 20  |ist% = 0 . add% |
00030cc0  3d 20 a3 29 20 8c 20 3d  20 2d 32 3a f4 20 6e 6f  |= .) . = -2:. no|
00030cd0  20 68 65 61 70 62 6c 6f  63 6b 20 64 65 66 69 6e  | heapblock defin|
00030ce0  65 64 0d 19 b2 1a e7 20  28 21 65 76 65 6e 74 5f  |ed..... (!event_|
00030cf0  6c 69 73 74 25 20 3d 20  30 29 20 8c 0d 19 b3 35  |list% = 0) ....5|
00030d00  20 20 f4 20 6e 6f 20 68  65 61 70 20 62 6c 6f 63  |  . no heap bloc|
00030d10  6b 20 64 65 66 69 6e 65  64 20 61 6e 64 20 61 64  |k defined and ad|
00030d20  64 20 66 6c 61 67 20 69  73 20 74 72 75 65 2e 2e  |d flag is true..|
00030d30  2e 0d 19 b4 39 20 20 21  65 76 65 6e 74 5f 6c 69  |....9  !event_li|
00030d40  73 74 25 20 3d 20 a4 73  68 65 6c 6c 5f 48 65 61  |st% = .shell_Hea|
00030d50  70 42 6c 6f 63 6b 46 65  74 63 68 28 72 65 63 5f  |pBlockFetch(rec_|
00030d60  73 69 7a 65 25 20 2b 20  34 29 0d 19 b5 1c 20 20  |size% + 4)....  |
00030d70  74 65 6d 70 25 20 20 20  3d 20 21 65 76 65 6e 74  |temp%   = !event|
00030d80  5f 6c 69 73 74 25 0d 19  b6 19 20 20 74 65 6d 70  |_list%....  temp|
00030d90  25 21 30 20 3d 20 72 65  63 5f 73 69 7a 65 25 0d  |%!0 = rec_size%.|
00030da0  19 b7 11 20 20 74 65 6d  70 25 21 34 20 3d 20 30  |...  temp%!4 = 0|
00030db0  0d 19 b8 11 20 20 74 65  6d 70 25 21 38 20 3d 20  |....  temp%!8 = |
00030dc0  30 0d 19 b9 09 20 20 3d  20 34 0d 19 ba 05 cd 0d  |0....  = 4......|
00030dd0  19 bb 1d 74 65 6d 70 25  20 20 20 20 20 20 3d 20  |...temp%      = |
00030de0  21 65 76 65 6e 74 5f 6c  69 73 74 25 0d 19 bc 17  |!event_list%....|
00030df0  6c 69 73 74 5f 73 69 7a  65 25 20 3d 20 21 74 65  |list_size% = !te|
00030e00  6d 70 25 0d 19 bd 04 0d  19 be 43 f2 73 68 65 6c  |mp%.......C.shel|
00030e10  6c 5f 54 72 61 63 65 66  30 28 22 47 65 74 45 76  |l_Tracef0("GetEv|
00030e20  65 6e 74 4c 69 73 74 4f  66 66 73 65 74 32 3a 6c  |entListOffset2:l|
00030e30  69 73 74 20 73 69 7a 65  20 69 73 20 22 2b c3 6c  |ist size is "+.l|
00030e40  69 73 74 5f 73 69 7a 65  25 29 0d 19 bf 0f 70 74  |ist_size%)....pt|
00030e50  72 25 20 20 20 20 3d 20  34 0d 19 c0 0f 66 6f 75  |r%    = 4....fou|
00030e60  6e 64 25 20 20 3d 20 a3  0d 19 c1 10 6f 66 66 73  |nd%  = .....offs|
00030e70  65 74 25 20 3d 20 2d 31  0d 19 c2 10 65 6d 70 74  |et% = -1....empt|
00030e80  79 25 20 20 3d 20 2d 31  0d 19 c3 1a 74 65 6d 70  |y%  = -1....temp|
00030e90  25 20 20 20 3d 20 21 65  76 65 6e 74 5f 6c 69 73  |%   = !event_lis|
00030ea0  74 25 0d 19 c4 05 f5 0d  19 c5 48 20 20 f2 73 68  |t%........H  .sh|
00030eb0  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 47 65 74  |ell_Tracef0("Get|
00030ec0  45 76 65 6e 74 4c 69 73  74 4f 66 66 73 65 74 32  |EventListOffset2|
00030ed0  3a 77 69 6e 64 6f 77 20  68 61 6e 64 6c 65 3d 26  |:window handle=&|
00030ee0  22 2b c3 7e 74 65 6d 70  25 21 70 74 72 25 29 0d  |"+.~temp%!ptr%).|
00030ef0  19 c6 49 20 20 f4 20 77  68 65 6e 20 73 63 61 6e  |..I  . when scan|
00030f00  6e 69 6e 67 20 6c 69 73  74 20 6e 6f 74 65 20 6f  |ning list note o|
00030f10  66 66 73 65 74 20 6f 66  20 66 69 72 73 74 20 65  |ffset of first e|
00030f20  6d 70 74 79 20 72 65 63  6f 72 64 20 66 6f 72 20  |mpty record for |
00030f30  75 73 65 20 77 68 65 6e  0d 19 c7 45 20 20 f4 20  |use when...E  . |
00030f40  61 64 64 69 6e 67 20 61  20 6e 65 77 20 65 76 65  |adding a new eve|
00030f50  6e 74 20 74 6f 20 74 68  65 20 6c 69 73 74 2e 20  |nt to the list. |
00030f60  45 6d 70 74 79 20 72 65  63 6f 72 64 73 20 68 61  |Empty records ha|
00030f70  76 65 20 30 20 66 6f 72  20 62 6f 74 68 0d 19 c8  |ve 0 for both...|
00030f80  1f 20 20 f4 20 77 69 6e  64 6f 77 20 61 6e 64 20  |.  . window and |
00030f90  69 63 6f 6e 20 68 61 6e  64 6c 65 73 0d 19 c9 14  |icon handles....|
00030fa0  20 20 e7 20 65 6d 70 74  79 25 20 3c 20 30 20 8c  |  . empty% < 0 .|
00030fb0  0d 19 ca 3f 20 20 20 20  e7 20 28 74 65 6d 70 25  |...?    . (temp%|
00030fc0  21 70 74 72 25 20 3d 20  30 20 80 20 74 65 6d 70  |!ptr% = 0 . temp|
00030fd0  25 21 70 74 72 25 20 2b  20 34 20 3d 20 30 29 20  |%!ptr% + 4 = 0) |
00030fe0  8c 20 65 6d 70 74 79 25  20 3d 20 70 74 72 25 0d  |. empty% = ptr%.|
00030ff0  19 cb 07 20 20 cd 0d 19  cc 1c 20 20 e7 20 28 74  |...  .....  . (t|
00031000  65 6d 70 25 21 70 74 72  25 20 3d 20 77 68 25 29  |emp%!ptr% = wh%)|
00031010  20 8c 0d 19 cd 43 20 20  20 20 f4 20 65 76 65 6e  | ....C    . even|
00031020  74 73 20 61 74 74 61 63  68 65 64 20 74 6f 20 6e  |ts attached to n|
00031030  6f 20 70 61 72 74 69 63  75 6c 61 72 20 69 63 6f  |o particular ico|
00031040  6e 20 61 72 65 20 72 65  67 69 73 74 65 72 65 64  |n are registered|
00031050  20 77 69 74 68 0d 19 ce  1e 20 20 20 20 f4 20 61  | with....    . a|
00031060  6e 20 69 63 6f 6e 20 68  61 6e 64 6c 65 20 6f 66  |n icon handle of|
00031070  20 2d 31 0d 19 cf 46 20  20 20 20 f4 20 50 52 4f  | -1...F    . PRO|
00031080  43 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |Cshell_Tracef0("|
00031090  47 65 74 45 76 65 6e 74  4c 69 73 74 4f 66 66 73  |GetEventListOffs|
000310a0  65 74 32 3a 77 69 6e 64  6f 77 20 68 61 6e 64 6c  |et2:window handl|
000310b0  65 20 66 6f 75 6e 64 22  29 0d 19 d0 12 20 20 20  |e found")....   |
000310c0  20 e7 20 69 68 25 3d 2d  31 20 8c 0d 19 d1 36 20  | . ih%=-1 ....6 |
000310d0  20 20 20 20 20 f4 20 69  63 6f 6e 20 68 61 6e 64  |     . icon hand|
000310e0  6c 65 20 69 73 20 2d 31  2c 20 73 6f 20 65 76 65  |le is -1, so eve|
000310f0  6e 74 20 68 61 73 20 62  65 65 6e 20 66 6f 75 6e  |nt has been foun|
00031100  64 0d 19 d2 46 20 20 20  20 20 20 f4 20 50 52 4f  |d...F      . PRO|
00031110  43 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |Cshell_Tracef0("|
00031120  47 65 74 45 76 65 6e 74  4c 69 73 74 4f 66 66 73  |GetEventListOffs|
00031130  65 74 32 3a 69 63 6f 6e  20 68 61 6e 64 6c 65 20  |et2:icon handle |
00031140  69 73 20 2d 31 22 29 0d  19 d3 18 20 20 20 20 20  |is -1")....     |
00031150  20 6f 66 66 73 65 74 25  20 3d 20 70 74 72 25 0d  | offset% = ptr%.|
00031160  19 d4 15 20 20 20 20 20  20 66 6f 75 6e 64 25 20  |...      found% |
00031170  20 3d 20 b9 0d 19 d5 09  20 20 20 20 cc 0d 19 d6  | = .....    ....|
00031180  36 20 20 20 20 20 20 f4  20 63 68 65 63 6b 20 69  |6      . check i|
00031190  63 6f 6e 20 68 61 6e 64  6c 65 20 69 6e 20 65 76  |con handle in ev|
000311a0  65 6e 74 20 62 6c 6f 63  6b 20 61 73 20 77 65 6c  |ent block as wel|
000311b0  6c 2e 2e 0d 19 d7 1f 2a  7c 69 66 64 65 66 20 50  |l......*|ifdef P|
000311c0  52 4f 43 73 68 65 6c 6c  5f 54 72 61 63 65 49 6e  |ROCshell_TraceIn|
000311d0  69 74 0d 19 d8 4a 20 20  20 20 20 20 f4 20 50 52  |it...J      . PR|
000311e0  4f 43 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  |OCshell_Tracef0(|
000311f0  22 47 65 74 45 76 65 6e  74 4c 69 73 74 4f 66 66  |"GetEventListOff|
00031200  73 65 74 32 3a 69 63 6f  6e 20 68 61 6e 64 6c 65  |set2:icon handle|
00031210  20 69 73 20 6e 6f 74 20  2d 31 22 29 0d 19 d9 0b  | is not -1")....|
00031220  2a 7c 65 6e 64 69 66 0d  19 da 24 20 20 20 20 20  |*|endif...$     |
00031230  20 e7 20 74 65 6d 70 25  21 28 70 74 72 25 20 2b  | . temp%!(ptr% +|
00031240  20 34 29 20 3d 20 69 68  25 20 8c 0d 19 db 1c 20  | 4) = ih% ..... |
00031250  20 20 20 20 20 20 20 20  20 6f 66 66 73 65 74 25  |         offset%|
00031260  20 3d 20 70 74 72 25 0d  19 dc 19 20 20 20 20 20  | = ptr%....     |
00031270  20 20 20 20 20 66 6f 75  6e 64 25 20 20 3d 20 b9  |     found%  = .|
00031280  0d 19 dd 0b 20 20 20 20  20 20 cc 0d 19 de 1d 20  |....      ..... |
00031290  20 20 20 20 20 20 20 70  74 72 25 20 2b 3d 20 72  |       ptr% += r|
000312a0  65 63 5f 73 69 7a 65 25  0d 19 df 0b 20 20 20 20  |ec_size%....    |
000312b0  20 20 cd 0d 19 e0 09 20  20 20 20 cd 0d 19 e1 07  |  .....    .....|
000312c0  20 20 cc 0d 19 e2 29 20  20 20 20 f4 20 6e 6f 20  |  ....)    . no |
000312d0  6d 61 74 63 68 2c 20 73  6f 20 63 68 65 63 6b 20  |match, so check |
000312e0  6e 65 78 74 20 65 76 65  6e 74 2e 2e 0d 19 e3 19  |next event......|
000312f0  20 20 20 20 70 74 72 25  20 2b 3d 20 72 65 63 5f  |    ptr% += rec_|
00031300  73 69 7a 65 25 0d 19 e4  07 20 20 cd 0d 19 e5 2b  |size%....  ....+|
00031310  fd 20 28 28 70 74 72 25  20 3e 3d 20 28 6c 69 73  |. ((ptr% >= (lis|
00031320  74 5f 73 69 7a 65 25 20  2b 20 34 29 29 20 84 20  |t_size% + 4)) . |
00031330  66 6f 75 6e 64 25 29 0d  19 e6 0e e7 20 66 6f 75  |found%)..... fou|
00031340  6e 64 25 20 8c 0d 19 e7  3c 20 20 f4 20 50 52 4f  |nd% ....<  . PRO|
00031350  43 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |Cshell_Tracef0("|
00031360  47 65 74 45 76 65 6e 74  4c 69 73 74 4f 66 66 73  |GetEventListOffs|
00031370  65 74 32 3a 45 76 65 6e  74 20 66 6f 75 6e 64 22  |et2:Event found"|
00031380  29 0d 19 e8 05 cc 0d 19  e9 54 20 20 f4 20 50 52  |)........T  . PR|
00031390  4f 43 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  |OCshell_Tracef0(|
000313a0  22 47 65 74 45 76 65 6e  74 4c 69 73 74 4f 66 66  |"GetEventListOff|
000313b0  73 65 74 32 3a 45 6e 64  20 6f 66 20 65 76 65 6e  |set2:End of even|
000313c0  74 20 6c 69 73 74 20 2d  20 65 76 65 6e 74 20 6e  |t list - event n|
000313d0  6f 74 20 66 6f 75 6e 64  22 29 0d 19 ea 05 cd 0d  |ot found")......|
000313e0  19 eb 1d e7 20 28 6f 66  66 73 65 74 25 20 3d 20  |.... (offset% = |
000313f0  2d 31 20 80 20 61 64 64  25 29 20 8c 0d 19 ec 14  |-1 . add%) .....|
00031400  20 20 e7 20 65 6d 70 74  79 25 20 3c 20 30 20 8c  |  . empty% < 0 .|
00031410  0d 19 ed 37 20 20 20 20  f4 20 6e 6f 20 65 6d 70  |...7    . no emp|
00031420  74 79 20 72 65 63 6f 72  64 73 20 66 6f 75 6e 64  |ty records found|
00031430  20 74 6f 20 75 73 65 20  66 6f 72 20 74 68 65 20  | to use for the |
00031440  6e 65 77 20 6f 6e 65 0d  19 ee 20 20 20 20 20 6f  |new one...     o|
00031450  66 66 73 65 74 25 20 3d  20 6c 69 73 74 5f 73 69  |ffset% = list_si|
00031460  7a 65 25 20 2b 20 34 0d  19 ef 45 20 20 20 20 21  |ze% + 4...E    !|
00031470  65 76 65 6e 74 5f 6c 69  73 74 25 20 3d 20 a4 73  |event_list% = .s|
00031480  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 45 78  |hell_HeapBlockEx|
00031490  74 65 6e 64 28 21 65 76  65 6e 74 5f 6c 69 73 74  |tend(!event_list|
000314a0  25 2c 72 65 63 5f 73 69  7a 65 25 29 0d 19 f0 1f  |%,rec_size%)....|
000314b0  20 20 20 20 74 65 6d 70  25 20 20 20 20 3d 20 21  |    temp%    = !|
000314c0  65 76 65 6e 74 5f 6c 69  73 74 25 0d 19 f1 1c 20  |event_list%.... |
000314d0  20 20 20 74 65 6d 70 25  21 30 20 2b 3d 20 72 65  |   temp%!0 += re|
000314e0  63 5f 73 69 7a 65 25 0d  19 f2 1a 20 20 20 20 74  |c_size%....    t|
000314f0  65 6d 70 25 20 20 20 2b  3d 20 6f 66 66 73 65 74  |emp%   += offset|
00031500  25 0d 19 f3 14 20 20 20  20 74 65 6d 70 25 21 34  |%....    temp%!4|
00031510  20 20 3d 20 30 0d 19 f4  14 20 20 20 20 74 65 6d  |  = 0....    tem|
00031520  70 25 21 38 20 20 3d 20  30 0d 19 f5 07 20 20 cc  |p%!8  = 0....  .|
00031530  0d 19 f6 22 20 20 20 20  f4 20 72 65 2d 75 73 65  |..."    . re-use|
00031540  20 6f 6c 64 20 64 65 6c  65 74 65 64 20 65 76 65  | old deleted eve|
00031550  6e 74 0d 19 f7 18 20 20  20 20 6f 66 66 73 65 74  |nt....    offset|
00031560  25 20 3d 20 65 6d 70 74  79 25 0d 19 f8 07 20 20  |% = empty%....  |
00031570  cd 0d 19 f9 05 cd 0d 19  fa 0d 3d 20 6f 66 66 73  |..........= offs|
00031580  65 74 25 0d 19 fb 05 3a  0d 19 fc 26 2a 7c 53 74  |et%....:...&*|St|
00031590  6f 70 20 46 4e 73 68 65  6c 6c 5f 47 65 74 45 76  |op FNshell_GetEv|
000315a0  65 6e 74 4c 69 73 74 4f  66 66 73 65 74 32 0d 19  |entListOffset2..|
000315b0  fd 04 0d 19 fe 24 2a 7c  53 74 61 72 74 20 50 52  |.....$*|Start PR|
000315c0  4f 43 73 68 65 6c 6c 5f  53 6c 69 64 65 72 53 65  |OCshell_SliderSe|
000315d0  74 56 61 6c 75 65 0d 19  ff 2c dd 20 f2 73 68 65  |tValue...,. .she|
000315e0  6c 6c 5f 53 6c 69 64 65  72 53 65 74 56 61 6c 75  |ll_SliderSetValu|
000315f0  65 28 68 61 6e 64 6c 65  25 2c 5f 76 61 6c 75 65  |e(handle%,_value|
00031600  25 29 0d 1a 00 3a ea 20  65 5f 62 6c 6b 25 2c 73  |%)...:. e_blk%,s|
00031610  6c 69 64 65 72 25 2c 62  6c 6b 25 2c 62 61 63 6b  |lider%,blk%,back|
00031620  67 72 25 2c 6d 61 78 5f  78 25 2c 64 69 73 70 6c  |gr%,max_x%,displ|
00031630  61 79 69 63 25 2c 6d 69  6e 5f 78 25 0d 1a 01 13  |ayic%,min_x%....|
00031640  ea 20 6d 69 6e 5f 79 25  2c 6d 61 78 5f 79 25 0d  |. min_y%,max_y%.|
00031650  1a 02 21 65 5f 62 6c 6b  25 20 20 20 20 3d 20 5f  |..!e_blk%    = _|
00031660  55 25 21 33 33 32 20 2b  20 68 61 6e 64 6c 65 25  |U%!332 + handle%|
00031670  0d 1a 03 19 73 6c 69 64  65 72 25 20 20 20 3d 20  |....slider%   = |
00031680  65 5f 62 6c 6b 25 21 30  34 0d 1a 04 19 77 68 25  |e_blk%!04....wh%|
00031690  20 20 20 20 20 20 20 3d  20 65 5f 62 6c 6b 25 21  |       = e_blk%!|
000316a0  30 30 0d 1a 05 19 62 61  63 6b 67 72 25 20 20 20  |00....backgr%   |
000316b0  3d 20 65 5f 62 6c 6b 25  21 30 38 0d 1a 06 19 64  |= e_blk%!08....d|
000316c0  69 73 70 6c 61 79 69 63  25 3d 20 65 5f 62 6c 6b  |isplayic%= e_blk|
000316d0  25 21 31 32 0d 1a 07 29  62 6c 6b 25 20 20 20 20  |%!12...)blk%    |
000316e0  20 20 3d 20 a4 73 68 65  6c 6c 5f 48 65 61 70 42  |  = .shell_HeapB|
000316f0  6c 6f 63 6b 46 65 74 63  68 28 35 30 29 0d 1a 08  |lockFetch(50)...|
00031700  13 62 6c 6b 25 21 30 30  20 20 20 3d 20 77 68 25  |.blk%!00   = wh%|
00031710  0d 1a 09 17 62 6c 6b 25  21 30 34 20 20 20 3d 20  |....blk%!04   = |
00031720  62 61 63 6b 67 72 25 0d  1a 0a 20 c8 99 20 22 57  |backgr%... .. "W|
00031730  69 6d 70 5f 47 65 74 49  63 6f 6e 53 74 61 74 65  |imp_GetIconState|
00031740  22 2c 2c 62 6c 6b 25 0d  1a 0b 17 6d 61 78 5f 78  |",,blk%....max_x|
00031750  25 20 20 20 20 3d 20 62  6c 6b 25 21 31 36 0d 1a  |%    = blk%!16..|
00031760  0c 17 6d 69 6e 5f 78 25  20 20 20 20 3d 20 62 6c  |..min_x%    = bl|
00031770  6b 25 21 30 38 0d 1a 0d  17 6d 69 6e 5f 79 25 20  |k%!08....min_y% |
00031780  20 20 20 3d 20 62 6c 6b  25 21 31 32 0d 1a 0e 17  |   = blk%!12....|
00031790  6d 61 78 5f 79 25 20 20  20 20 3d 20 62 6c 6b 25  |max_y%    = blk%|
000317a0  21 32 30 0d 1a 0f 17 62  6c 6b 25 21 30 34 20 20  |!20....blk%!04  |
000317b0  20 3d 20 73 6c 69 64 65  72 25 0d 1a 10 20 c8 99  | = slider%... ..|
000317c0  20 22 57 69 6d 70 5f 47  65 74 49 63 6f 6e 53 74  | "Wimp_GetIconSt|
000317d0  61 74 65 22 2c 2c 62 6c  6b 25 0d 1a 11 1e c8 99  |ate",,blk%......|
000317e0  20 22 57 69 6d 70 5f 44  65 6c 65 74 65 49 63 6f  | "Wimp_DeleteIco|
000317f0  6e 22 2c 2c 62 6c 6b 25  0d 1a 12 13 62 6c 6b 25  |n",,blk%....blk%|
00031800  21 30 34 20 20 20 3d 20  77 68 25 0d 1a 13 23 e7  |!04   = wh%...#.|
00031810  20 5f 76 61 6c 75 65 25  20 3e 20 31 30 30 20 8c  | _value% > 100 .|
00031820  20 5f 76 61 6c 75 65 25  20 3d 20 31 30 30 0d 1a  | _value% = 100..|
00031830  14 14 e7 20 5f 76 61 6c  75 65 25 20 3c 3d 20 30  |... _value% <= 0|
00031840  20 8c 0d 1a 15 11 20 20  5f 76 61 6c 75 65 25 20  | .....  _value% |
00031850  3d 20 30 0d 1a 16 16 20  20 62 6c 6b 25 21 31 36  |= 0....  blk%!16|
00031860  20 3d 20 62 6c 6b 25 21  38 0d 1a 17 05 cc 0d 1a  | = blk%!8.......|
00031870  18 52 20 20 62 6c 6b 25  21 31 36 20 20 20 3d 20  |.R  blk%!16   = |
00031880  6d 69 6e 5f 78 25 20 2b  20 28 6d 61 78 5f 78 25  |min_x% + (max_x%|
00031890  20 2a 20 28 5f 76 61 6c  75 65 25 20 2f 20 31 30  | * (_value% / 10|
000318a0  30 29 29 20 2d 20 28 6d  69 6e 5f 78 25 20 2a 20  |0)) - (min_x% * |
000318b0  28 5f 76 61 6c 75 65 25  20 2f 20 31 30 30 29 29  |(_value% / 100))|
000318c0  0d 1a 19 05 cd 0d 1a 1a  17 65 5f 62 6c 6b 25 21  |.........e_blk%!|
000318d0  32 38 20 3d 20 5f 76 61  6c 75 65 25 0d 1a 1b 22  |28 = _value%..."|
000318e0  c8 99 20 22 57 69 6d 70  5f 43 72 65 61 74 65 49  |.. "Wimp_CreateI|
000318f0  63 6f 6e 22 2c 2c 62 6c  6b 25 20 2b 20 34 0d 1a  |con",,blk% + 4..|
00031900  1c 39 c8 99 20 22 57 69  6d 70 5f 46 6f 72 63 65  |.9.. "Wimp_Force|
00031910  52 65 64 72 61 77 22 2c  77 68 25 2c 6d 69 6e 5f  |Redraw",wh%,min_|
00031920  78 25 2c 6d 69 6e 5f 79  25 2c 6d 61 78 5f 78 25  |x%,min_y%,max_x%|
00031930  2c 6d 61 78 5f 79 25 0d  1a 1d 17 e7 20 65 5f 62  |,max_y%..... e_b|
00031940  6c 6b 25 21 32 34 20 3c  3e 20 2d 31 20 8c 0d 1a  |lk%!24 <> -1 ...|
00031950  1e 31 20 76 6f 69 64 25  20 3d 20 a0 28 22 46 4e  |.1 void% = .("FN|
00031960  22 20 2b 20 24 28 65 5f  62 6c 6b 25 21 32 34 29  |" + $(e_blk%!24)|
00031970  20 2b 20 22 28 5f 76 61  6c 75 65 25 29 22 29 0d  | + "(_value%)").|
00031980  1a 1f 05 cd 0d 1a 20 17  e7 20 64 69 73 70 6c 61  |...... .. displa|
00031990  79 69 63 25 20 3e 3d 20  30 20 8c 0d 1a 21 33 20  |yic% >= 0 ...!3 |
000319a0  20 f2 73 68 65 6c 6c 5f  49 63 6f 6e 50 75 74 44  | .shell_IconPutD|
000319b0  61 74 61 28 77 68 25 2c  64 69 73 70 6c 61 79 69  |ata(wh%,displayi|
000319c0  63 25 2c c3 5f 76 61 6c  75 65 25 2c b9 29 0d 1a  |c%,._value%,.)..|
000319d0  22 05 cd 0d 1a 23 20 f2  73 68 65 6c 6c 5f 48 65  |"....# .shell_He|
000319e0  61 70 42 6c 6f 63 6b 52  65 74 75 72 6e 28 62 6c  |apBlockReturn(bl|
000319f0  6b 25 29 0d 1a 24 05 e1  0d 1a 25 05 3a 0d 1a 26  |k%)..$....%.:..&|
00031a00  23 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  |#*|Stop PROCshel|
00031a10  6c 5f 53 6c 69 64 65 72  53 65 74 56 61 6c 75 65  |l_SliderSetValue|
00031a20  0d 1a 27 04 0d 1a 28 29  2a 7c 53 74 61 72 74 20  |..'...()*|Start |
00031a30  50 52 4f 43 73 68 65 6c  6c 5f 41 74 74 61 63 68  |PROCshell_Attach|
00031a40  53 6c 69 64 65 72 48 61  6e 64 6c 65 72 0d 1a 29  |SliderHandler..)|
00031a50  5b dd 20 a4 73 68 65 6c  6c 5f 41 74 74 61 63 68  |[. .shell_Attach|
00031a60  53 6c 69 64 65 72 48 61  6e 64 6c 65 72 28 77 68  |SliderHandler(wh|
00031a70  25 2c 62 61 63 6b 67 69  63 25 2c 73 6c 69 64 65  |%,backgic%,slide|
00031a80  72 69 63 25 2c 64 69 73  70 69 63 25 2c 69 6e 63  |ric%,dispic%,inc|
00031a90  72 69 63 25 2c 64 65 63  72 69 63 25 2c 6e 6f 74  |ric%,decric%,not|
00031aa0  69 66 79 5f 66 6e 24 29  0d 1a 2a 14 ea 20 65 5f  |ify_fn$)..*.. e_|
00031ab0  62 6c 6b 25 2c 6f 66 66  73 65 74 25 0d 1a 2b 04  |blk%,offset%..+.|
00031ac0  0d 1a 2c 2c f4 20 66 6f  72 6d 61 74 20 6f 66 20  |..,,. format of |
00031ad0  73 6c 69 64 65 72 20 68  61 6e 64 6c 65 72 20 65  |slider handler e|
00031ae0  76 65 6e 74 20 62 6c 6f  63 6b 2e 2e 0d 1a 2d 05  |vent block....-.|
00031af0  f4 0d 1a 2e 13 f4 20 45  61 63 68 20 45 76 65 6e  |...... Each Even|
00031b00  74 2e 2e 2e 0d 1a 2f 18  f4 20 20 2b 30 30 20 77  |t...../..  +00 w|
00031b10  69 6e 64 6f 77 20 68 61  6e 64 6c 65 0d 1a 30 25  |indow handle..0%|
00031b20  f4 20 20 2b 30 34 20 69  63 6f 6e 20 68 61 6e 64  |.  +04 icon hand|
00031b30  6c 65 20 6f 66 20 73 6c  69 64 65 72 20 69 63 6f  |le of slider ico|
00031b40  6e 0d 1a 31 29 f4 20 20  2b 30 38 20 69 63 6f 6e  |n..1).  +08 icon|
00031b50  20 68 61 6e 64 6c 65 20  6f 66 20 62 61 63 6b 67  | handle of backg|
00031b60  72 6f 75 6e 64 20 69 63  6f 6e 0d 1a 32 39 f4 20  |round icon..29. |
00031b70  20 2b 31 32 20 69 63 6f  6e 20 68 61 6e 64 6c 65  | +12 icon handle|
00031b80  20 6f 66 20 76 61 6c 75  65 20 64 69 73 70 6c 61  | of value displa|
00031b90  79 20 69 63 6f 6e 20 28  2d 31 20 69 66 20 6e 6f  |y icon (-1 if no|
00031ba0  6e 65 29 0d 1a 33 39 f4  20 20 2b 31 36 20 69 63  |ne)..39.  +16 ic|
00031bb0  6f 6e 20 68 61 6e 64 6c  65 20 6f 66 20 62 75 6d  |on handle of bum|
00031bc0  70 20 75 70 20 69 63 6f  6e 20 20 20 20 20 20 20  |p up icon       |
00031bd0  28 2d 31 20 69 66 20 6e  6f 6e 65 29 0d 1a 34 39  |(-1 if none)..49|
00031be0  f4 20 20 2b 32 30 20 69  63 6f 6e 20 68 61 6e 64  |.  +20 icon hand|
00031bf0  6c 65 20 6f 66 20 62 75  6d 70 20 64 6f 77 6e 20  |le of bump down |
00031c00  69 63 6f 6e 20 20 20 20  20 28 2d 31 20 69 66 20  |icon     (-1 if |
00031c10  6e 6f 6e 65 29 0d 1a 35  53 f4 20 20 2b 32 34 20  |none)..5S.  +24 |
00031c20  70 6f 69 6e 74 65 72 20  74 6f 20 62 6c 6f 63 6b  |pointer to block|
00031c30  20 63 6f 6e 74 61 69 6e  69 6e 67 20 46 4e 20 6e  | containing FN n|
00031c40  61 6d 65 20 74 6f 20 63  61 6c 6c 20 6f 6e 20 76  |ame to call on v|
00031c50  61 6c 75 65 20 63 68 61  6e 67 65 20 28 2d 31 20  |alue change (-1 |
00031c60  69 66 20 6e 6f 6e 65 29  0d 1a 36 17 f4 20 20 2b  |if none)..6..  +|
00031c70  32 38 20 73 6c 69 64 65  72 20 76 61 6c 75 65 0d  |28 slider value.|
00031c80  1a 37 04 0d 1a 38 46 f4  20 66 69 72 73 74 20 73  |.7...8F. first s|
00031c90  65 74 20 75 70 20 65 76  65 6e 74 20 62 6c 6f 63  |et up event bloc|
00031ca0  6b 20 74 6f 20 68 61 6e  64 6c 65 20 63 6c 69 63  |k to handle clic|
00031cb0  6b 73 20 6f 6e 20 73 6c  69 64 65 72 20 62 61 72  |ks on slider bar|
00031cc0  20 69 74 73 65 6c 66 2e  2e 0d 1a 39 46 6f 66 66  | itself....9Foff|
00031cd0  73 65 74 25 20 3d 20 a4  73 68 65 6c 6c 5f 47 65  |set% = .shell_Ge|
00031ce0  74 45 76 65 6e 74 4c 69  73 74 4f 66 66 73 65 74  |tEventListOffset|
00031cf0  32 28 77 68 25 2c 73 6c  69 64 65 72 69 63 25 2c  |2(wh%,slideric%,|
00031d00  5f 55 25 20 2b 20 33 33  32 2c 33 32 2c b9 29 0d  |_U% + 332,32,.).|
00031d10  1a 3a 3b 65 5f 62 6c 6b  25 20 20 3d 20 5f 55 25  |.:;e_blk%  = _U%|
00031d20  21 33 33 32 20 2b 20 6f  66 66 73 65 74 25 20 3a  |!332 + offset% :|
00031d30  20 f4 20 70 6f 69 6e 74  65 72 20 74 6f 20 65 76  | . pointer to ev|
00031d40  65 6e 74 20 6c 69 73 74  2e 2e 0d 1a 3b 04 0d 1a  |ent list....;...|
00031d50  3c 16 65 5f 62 6c 6b 25  21 30 30 20 20 20 20 3d  |<.e_blk%!00    =|
00031d60  20 77 68 25 0d 1a 3d 1c  65 5f 62 6c 6b 25 21 30  | wh%..=.e_blk%!0|
00031d70  34 20 20 20 20 3d 20 73  6c 69 64 65 72 69 63 25  |4    = slideric%|
00031d80  0d 1a 3e 1b 65 5f 62 6c  6b 25 21 30 38 20 20 20  |..>.e_blk%!08   |
00031d90  20 3d 20 62 61 63 6b 67  69 63 25 0d 1a 3f 1a 65  | = backgic%..?.e|
00031da0  5f 62 6c 6b 25 21 31 32  20 20 20 20 3d 20 64 69  |_blk%!12    = di|
00031db0  73 70 69 63 25 0d 1a 40  1a 65 5f 62 6c 6b 25 21  |spic%..@.e_blk%!|
00031dc0  31 36 20 20 20 20 3d 20  69 6e 63 72 69 63 25 0d  |16    = incric%.|
00031dd0  1a 41 1a 65 5f 62 6c 6b  25 21 32 30 20 20 20 20  |.A.e_blk%!20    |
00031de0  3d 20 64 65 63 72 69 63  25 0d 1a 42 18 e7 20 6e  |= decric%..B.. n|
00031df0  6f 74 69 66 79 5f 66 6e  24 20 3c 3e 20 22 22 20  |otify_fn$ <> "" |
00031e00  8c 0d 1a 43 3b 20 20 65  5f 62 6c 6b 25 21 32 34  |...C;  e_blk%!24|
00031e10  20 20 20 20 3d 20 a4 73  68 65 6c 6c 5f 48 65 61  |    = .shell_Hea|
00031e20  70 42 6c 6f 63 6b 46 65  74 63 68 28 a9 6e 6f 74  |pBlockFetch(.not|
00031e30  69 66 79 5f 66 6e 24 20  2b 20 31 29 0d 1a 44 1f  |ify_fn$ + 1)..D.|
00031e40  20 20 24 28 65 5f 62 6c  6b 25 21 32 34 29 20 3d  |  $(e_blk%!24) =|
00031e50  20 6e 6f 74 69 66 79 5f  66 6e 24 0d 1a 45 05 cc  | notify_fn$..E..|
00031e60  0d 1a 46 15 20 20 65 5f  62 6c 6b 25 21 32 34 20  |..F.  e_blk%!24 |
00031e70  20 3d 20 2d 31 0d 1a 47  05 cd 0d 1a 48 14 65 5f  | = -1..G....H.e_|
00031e80  62 6c 6b 25 21 32 38 20  20 20 20 3d 20 30 0d 1a  |blk%!28    = 0..|
00031e90  49 04 0d 1a 4a 37 e7 20  5f 55 25 21 33 32 38 20  |I...J7. _U%!328 |
00031ea0  3d 20 30 20 8c 20 5f 55  25 21 33 32 38 20 3d 20  |= 0 . _U%!328 = |
00031eb0  a4 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
00031ec0  46 65 74 63 68 28 32 34  29 0d 1a 4b 04 0d 1a 4c  |Fetch(24)..K...L|
00031ed0  3d f4 20 61 74 74 61 63  68 20 63 6c 69 63 6b 20  |=. attach click |
00031ee0  73 65 6c 65 63 74 20 72  6f 75 74 69 6e 65 73 20  |select routines |
00031ef0  74 6f 20 73 6c 69 64 65  72 20 61 6e 64 20 62 61  |to slider and ba|
00031f00  63 6b 67 72 6f 75 6e 64  2e 2e 0d 1a 4d 3d f2 73  |ckground....M=.s|
00031f10  68 65 6c 6c 5f 41 74 74  61 63 68 43 6c 69 63 6b  |hell_AttachClick|
00031f20  53 65 6c 65 63 74 28 77  68 25 2c 73 6c 69 64 65  |Select(wh%,slide|
00031f30  72 69 63 25 2c 22 5f 73  68 65 6c 6c 5f 69 63 6f  |ric%,"_shell_ico|
00031f40  6e 64 72 61 67 22 29 0d  1a 4e 3d f2 73 68 65 6c  |ndrag")..N=.shel|
00031f50  6c 5f 41 74 74 61 63 68  43 6c 69 63 6b 53 65 6c  |l_AttachClickSel|
00031f60  65 63 74 28 77 68 25 2c  62 61 63 6b 67 69 63 25  |ect(wh%,backgic%|
00031f70  2c 22 5f 73 68 65 6c 6c  5f 69 63 6f 6e 64 72 61  |,"_shell_icondra|
00031f80  67 32 22 29 0d 1a 4f 04  0d 1a 50 3e f4 20 61 74  |g2")..O...P>. at|
00031f90  74 61 63 68 20 63 6c 69  63 6b 20 73 65 6c 65 63  |tach click selec|
00031fa0  74 20 72 6f 75 74 69 6e  65 73 20 66 6f 72 20 62  |t routines for b|
00031fb0  75 6d 70 20 69 63 6f 6e  73 20 28 69 66 20 70 72  |ump icons (if pr|
00031fc0  65 73 65 6e 74 29 0d 1a  51 14 e7 20 69 6e 63 72  |esent)..Q.. incr|
00031fd0  69 63 25 20 3e 3d 20 30  20 8c 0d 1a 52 42 20 20  |ic% >= 0 ...RB  |
00031fe0  f2 73 68 65 6c 6c 5f 41  74 74 61 63 68 43 6c 69  |.shell_AttachCli|
00031ff0  63 6b 53 65 6c 65 63 74  28 77 68 25 2c 69 6e 63  |ckSelect(wh%,inc|
00032000  72 69 63 25 2c 22 5f 73  68 65 6c 6c 5f 73 6c 69  |ric%,"_shell_sli|
00032010  64 65 72 62 75 6d 70 75  70 53 22 29 0d 1a 53 44  |derbumpupS")..SD|
00032020  20 20 f2 73 68 65 6c 6c  5f 41 74 74 61 63 68 43  |  .shell_AttachC|
00032030  6c 69 63 6b 53 65 6c 65  63 74 28 77 68 25 2c 64  |lickSelect(wh%,d|
00032040  65 63 72 69 63 25 2c 22  5f 73 68 65 6c 6c 5f 73  |ecric%,"_shell_s|
00032050  6c 69 64 65 72 62 75 6d  70 64 6f 77 6e 53 22 29  |liderbumpdownS")|
00032060  0d 1a 54 44 20 20 f2 73  68 65 6c 6c 5f 41 74 74  |..TD  .shell_Att|
00032070  61 63 68 43 6c 69 63 6b  41 64 6a 75 73 74 28 77  |achClickAdjust(w|
00032080  68 25 2c 69 6e 63 72 69  63 25 2c 22 5f 73 68 65  |h%,incric%,"_she|
00032090  6c 6c 5f 73 6c 69 64 65  72 62 75 6d 70 64 6f 77  |ll_sliderbumpdow|
000320a0  6e 41 22 29 0d 1a 55 42  20 20 f2 73 68 65 6c 6c  |nA")..UB  .shell|
000320b0  5f 41 74 74 61 63 68 43  6c 69 63 6b 41 64 6a 75  |_AttachClickAdju|
000320c0  73 74 28 77 68 25 2c 64  65 63 72 69 63 25 2c 22  |st(wh%,decric%,"|
000320d0  5f 73 68 65 6c 6c 5f 73  6c 69 64 65 72 62 75 6d  |_shell_sliderbum|
000320e0  70 75 70 41 22 29 0d 1a  56 05 cd 0d 1a 57 04 0d  |pupA")..V....W..|
000320f0  1a 58 0d 3d 20 6f 66 66  73 65 74 25 0d 1a 59 05  |.X.= offset%..Y.|
00032100  3a 0d 1a 5a 28 2a 7c 53  74 6f 70 20 50 52 4f 43  |:..Z(*|Stop PROC|
00032110  73 68 65 6c 6c 5f 41 74  74 61 63 68 53 6c 69 64  |shell_AttachSlid|
00032120  65 72 48 61 6e 64 6c 65  72 0d 1a 5b 04 0d 1a 5c  |erHandler..[...\|
00032130  1d 2a 7c 53 74 61 72 74  20 46 4e 5f 73 68 65 6c  |.*|Start FN_shel|
00032140  6c 5f 69 63 6f 6e 64 72  61 67 0d 1a 5d 1f dd 20  |l_icondrag..].. |
00032150  a4 5f 73 68 65 6c 6c 5f  69 63 6f 6e 64 72 61 67  |._shell_icondrag|
00032160  28 77 68 25 2c 69 68 25  29 0d 1a 5e 1f f2 73 68  |(wh%,ih%)..^..sh|
00032170  65 6c 6c 5f 49 63 6f 6e  44 72 61 67 42 6f 78 28  |ell_IconDragBox(|
00032180  77 68 25 2c 69 68 25 29  0d 1a 5f 06 3d 30 0d 1a  |wh%,ih%).._.=0..|
00032190  60 05 3a 0d 1a 61 1c 2a  7c 53 74 6f 70 20 46 4e  |`.:..a.*|Stop FN|
000321a0  5f 73 68 65 6c 6c 5f 69  63 6f 6e 64 72 61 67 0d  |_shell_icondrag.|
000321b0  1a 62 04 0d 1a 63 1e 2a  7c 53 74 61 72 74 20 46  |.b...c.*|Start F|
000321c0  4e 5f 73 68 65 6c 6c 5f  69 63 6f 6e 64 72 61 67  |N_shell_icondrag|
000321d0  32 0d 1a 64 20 dd 20 a4  5f 73 68 65 6c 6c 5f 69  |2..d . ._shell_i|
000321e0  63 6f 6e 64 72 61 67 32  28 77 68 25 2c 69 68 25  |condrag2(wh%,ih%|
000321f0  29 0d 1a 65 2c ea 20 65  5f 73 69 7a 65 25 2c 65  |)..e,. e_size%,e|
00032200  5f 62 6c 6b 25 2c 65 5f  70 74 72 25 2c 66 6f 75  |_blk%,e_ptr%,fou|
00032210  6e 64 25 2c 73 6c 69 64  65 72 69 63 25 0d 1a 66  |nd%,slideric%..f|
00032220  15 65 5f 62 6c 6b 25 20  20 3d 20 5f 55 25 21 33  |.e_blk%  = _U%!3|
00032230  33 32 0d 1a 67 15 65 5f  73 69 7a 65 25 20 3d 20  |32..g.e_size% = |
00032240  21 65 5f 62 6c 6b 25 0d  1a 68 0f 65 5f 70 74 72  |!e_blk%..h.e_ptr|
00032250  25 20 20 3d 20 34 0d 1a  69 33 f2 73 68 65 6c 6c  |%  = 4..i3.shell|
00032260  5f 54 72 61 63 65 66 30  28 22 45 76 65 6e 74 20  |_Tracef0("Event |
00032270  62 6c 6f 63 6b 20 73 69  7a 65 20 69 73 20 22 2b  |block size is "+|
00032280  c3 65 5f 73 69 7a 65 25  29 0d 1a 6a 05 f5 0d 1a  |.e_size%)..j....|
00032290  6b 3d 20 20 f4 20 73 63  61 6e 20 66 6f 72 20 62  |k=  . scan for b|
000322a0  61 63 6b 67 72 6f 75 6e  64 20 69 63 6f 6e 20 68  |ackground icon h|
000322b0  61 6e 64 6c 65 20 69 6e  20 73 6c 69 64 65 72 20  |andle in slider |
000322c0  65 76 65 6e 74 20 62 6c  6f 63 6b 0d 1a 6c 23 20  |event block..l# |
000322d0  20 e7 20 65 5f 62 6c 6b  25 21 28 65 5f 70 74 72  | . e_blk%!(e_ptr|
000322e0  25 20 2b 20 38 29 20 3d  20 69 68 25 20 8c 0d 1a  |% + 8) = ih% ...|
000322f0  6d 34 20 20 20 20 66 6f  75 6e 64 25 20 3d 20 b9  |m4    found% = .|
00032300  20 3a 20 73 6c 69 64 65  72 69 63 25 20 3d 20 65  | : slideric% = e|
00032310  5f 62 6c 6b 25 21 28 65  5f 70 74 72 25 20 2b 20  |_blk%!(e_ptr% + |
00032320  34 29 0d 1a 6e 07 20 20  cd 0d 1a 6f 12 20 20 65  |4)..n.  ...o.  e|
00032330  5f 70 74 72 25 20 2b 3d  20 33 32 0d 1a 70 20 fd  |_ptr% += 32..p .|
00032340  20 65 5f 70 74 72 25 20  3e 3d 20 65 5f 73 69 7a  | e_ptr% >= e_siz|
00032350  65 25 20 84 20 66 6f 75  6e 64 25 0d 1a 71 25 f2  |e% . found%..q%.|
00032360  73 68 65 6c 6c 5f 49 63  6f 6e 44 72 61 67 42 6f  |shell_IconDragBo|
00032370  78 28 77 68 25 2c 73 6c  69 64 65 72 69 63 25 29  |x(wh%,slideric%)|
00032380  0d 1a 72 06 3d 30 0d 1a  73 05 3a 0d 1a 74 1d 2a  |..r.=0..s.:..t.*|
00032390  7c 53 74 6f 70 20 46 4e  5f 73 68 65 6c 6c 5f 69  ||Stop FN_shell_i|
000323a0  63 6f 6e 64 72 61 67 32  0d 1a 75 04 0d 1a 76 22  |condrag2..u...v"|
000323b0  2a 7c 53 74 61 72 74 20  46 4e 5f 73 68 65 6c 6c  |*|Start FN_shell|
000323c0  5f 73 6c 69 64 65 72 62  75 6d 70 75 70 53 0d 1a  |_sliderbumpupS..|
000323d0  77 24 dd 20 a4 5f 73 68  65 6c 6c 5f 73 6c 69 64  |w$. ._shell_slid|
000323e0  65 72 62 75 6d 70 75 70  53 28 77 68 25 2c 69 68  |erbumpupS(wh%,ih|
000323f0  25 29 0d 1a 78 0b ea 20  76 6f 69 64 25 0d 1a 79  |%)..x.. void%..y|
00032400  2b 76 6f 69 64 25 20 3d  20 a4 5f 73 68 65 6c 6c  |+void% = ._shell|
00032410  5f 73 6c 69 64 65 72 62  75 6d 70 75 70 28 77 68  |_sliderbumpup(wh|
00032420  25 2c 69 68 25 2c 34 29  0d 1a 7a 06 3d 30 0d 1a  |%,ih%,4)..z.=0..|
00032430  7b 05 3a 0d 1a 7c 21 2a  7c 53 74 6f 70 20 46 4e  |{.:..|!*|Stop FN|
00032440  5f 73 68 65 6c 6c 5f 73  6c 69 64 65 72 62 75 6d  |_shell_sliderbum|
00032450  70 75 70 53 0d 1a 7d 04  0d 1a 7e 22 2a 7c 53 74  |pupS..}...~"*|St|
00032460  61 72 74 20 46 4e 5f 73  68 65 6c 6c 5f 73 6c 69  |art FN_shell_sli|
00032470  64 65 72 62 75 6d 70 75  70 41 0d 1a 7f 24 dd 20  |derbumpupA...$. |
00032480  a4 5f 73 68 65 6c 6c 5f  73 6c 69 64 65 72 62 75  |._shell_sliderbu|
00032490  6d 70 75 70 41 28 77 68  25 2c 69 68 25 29 0d 1a  |mpupA(wh%,ih%)..|
000324a0  80 0b ea 20 76 6f 69 64  25 0d 1a 81 2b 76 6f 69  |... void%...+voi|
000324b0  64 25 20 3d 20 a4 5f 73  68 65 6c 6c 5f 73 6c 69  |d% = ._shell_sli|
000324c0  64 65 72 62 75 6d 70 75  70 28 77 68 25 2c 69 68  |derbumpup(wh%,ih|
000324d0  25 2c 31 29 0d 1a 82 06  3d 30 0d 1a 83 05 3a 0d  |%,1)....=0....:.|
000324e0  1a 84 21 2a 7c 53 74 6f  70 20 46 4e 5f 73 68 65  |..!*|Stop FN_she|
000324f0  6c 6c 5f 73 6c 69 64 65  72 62 75 6d 70 75 70 41  |ll_sliderbumpupA|
00032500  0d 1a 85 04 0d 1a 86 24  2a 7c 53 74 61 72 74 20  |.......$*|Start |
00032510  46 4e 5f 73 68 65 6c 6c  5f 73 6c 69 64 65 72 62  |FN_shell_sliderb|
00032520  75 6d 70 64 6f 77 6e 53  0d 1a 87 26 dd 20 a4 5f  |umpdownS...&. ._|
00032530  73 68 65 6c 6c 5f 73 6c  69 64 65 72 62 75 6d 70  |shell_sliderbump|
00032540  64 6f 77 6e 53 28 77 68  25 2c 69 68 25 29 0d 1a  |downS(wh%,ih%)..|
00032550  88 0b ea 20 76 6f 69 64  25 0d 1a 89 2d 76 6f 69  |... void%...-voi|
00032560  64 25 20 3d 20 a4 5f 73  68 65 6c 6c 5f 73 6c 69  |d% = ._shell_sli|
00032570  64 65 72 62 75 6d 70 64  6f 77 6e 28 77 68 25 2c  |derbumpdown(wh%,|
00032580  69 68 25 2c 34 29 0d 1a  8a 06 3d 30 0d 1a 8b 05  |ih%,4)....=0....|
00032590  3a 0d 1a 8c 23 2a 7c 53  74 6f 70 20 46 4e 5f 73  |:...#*|Stop FN_s|
000325a0  68 65 6c 6c 5f 73 6c 69  64 65 72 62 75 6d 70 64  |hell_sliderbumpd|
000325b0  6f 77 6e 53 0d 1a 8d 04  0d 1a 8e 24 2a 7c 53 74  |ownS.......$*|St|
000325c0  61 72 74 20 46 4e 5f 73  68 65 6c 6c 5f 73 6c 69  |art FN_shell_sli|
000325d0  64 65 72 62 75 6d 70 64  6f 77 6e 41 0d 1a 8f 26  |derbumpdownA...&|
000325e0  dd 20 a4 5f 73 68 65 6c  6c 5f 73 6c 69 64 65 72  |. ._shell_slider|
000325f0  62 75 6d 70 64 6f 77 6e  41 28 77 68 25 2c 69 68  |bumpdownA(wh%,ih|
00032600  25 29 0d 1a 90 0b ea 20  76 6f 69 64 25 0d 1a 91  |%)..... void%...|
00032610  2d 76 6f 69 64 25 20 3d  20 a4 5f 73 68 65 6c 6c  |-void% = ._shell|
00032620  5f 73 6c 69 64 65 72 62  75 6d 70 64 6f 77 6e 28  |_sliderbumpdown(|
00032630  77 68 25 2c 69 68 25 2c  31 29 0d 1a 92 06 3d 30  |wh%,ih%,1)....=0|
00032640  0d 1a 93 05 3a 0d 1a 94  23 2a 7c 53 74 6f 70 20  |....:...#*|Stop |
00032650  46 4e 5f 73 68 65 6c 6c  5f 73 6c 69 64 65 72 62  |FN_shell_sliderb|
00032660  75 6d 70 64 6f 77 6e 41  0d 1a 95 04 0d 1a 96 21  |umpdownA.......!|
00032670  2a 7c 53 74 61 72 74 20  46 4e 5f 73 68 65 6c 6c  |*|Start FN_shell|
00032680  5f 73 6c 69 64 65 72 62  75 6d 70 75 70 0d 1a 97  |_sliderbumpup...|
00032690  2b dd 20 a4 5f 73 68 65  6c 6c 5f 73 6c 69 64 65  |+. ._shell_slide|
000326a0  72 62 75 6d 70 75 70 28  77 68 25 2c 69 68 25 2c  |rbumpup(wh%,ih%,|
000326b0  62 75 74 74 6f 6e 25 29  0d 1a 98 38 ea 20 65 5f  |button%)...8. e_|
000326c0  73 69 7a 65 25 2c 65 5f  62 6c 6b 25 2c 65 5f 70  |size%,e_blk%,e_p|
000326d0  74 72 25 2c 66 6f 75 6e  64 25 2c 70 74 72 25 2c  |tr%,found%,ptr%,|
000326e0  5f 76 61 6c 75 65 25 2c  62 75 6d 70 5f 69 63 25  |_value%,bump_ic%|
000326f0  0d 1a 99 2d f2 73 68 65  6c 6c 5f 54 72 61 63 65  |...-.shell_Trace|
00032700  66 30 28 22 49 6e 20 73  6c 69 64 65 72 62 75 6d  |f0("In sliderbum|
00032710  70 75 70 20 72 6f 75 74  69 6e 65 22 29 0d 1a 9a  |pup routine")...|
00032720  15 65 5f 62 6c 6b 25 20  20 3d 20 5f 55 25 21 33  |.e_blk%  = _U%!3|
00032730  33 32 0d 1a 9b 15 65 5f  73 69 7a 65 25 20 3d 20  |32....e_size% = |
00032740  21 65 5f 62 6c 6b 25 0d  1a 9c 0f 65 5f 70 74 72  |!e_blk%....e_ptr|
00032750  25 20 20 3d 20 34 0d 1a  9d 33 f2 73 68 65 6c 6c  |%  = 4...3.shell|
00032760  5f 54 72 61 63 65 66 30  28 22 45 76 65 6e 74 20  |_Tracef0("Event |
00032770  62 6c 6f 63 6b 20 73 69  7a 65 20 69 73 20 22 2b  |block size is "+|
00032780  c3 65 5f 73 69 7a 65 25  29 0d 1a 9e 31 e7 20 62  |.e_size%)...1. b|
00032790  75 74 74 6f 6e 25 20 3d  20 34 20 8c 20 62 75 6d  |utton% = 4 . bum|
000327a0  70 5f 69 63 25 20 3d 20  31 36 20 8b 20 62 75 6d  |p_ic% = 16 . bum|
000327b0  70 5f 69 63 25 20 3d 20  32 30 0d 1a 9f 05 f5 0d  |p_ic% = 20......|
000327c0  1a a0 37 20 20 f4 20 73  63 61 6e 20 66 6f 72 20  |..7  . scan for |
000327d0  62 75 6d 70 20 69 63 6f  6e 20 68 61 6e 64 6c 65  |bump icon handle|
000327e0  20 69 6e 20 73 6c 69 64  65 72 20 65 76 65 6e 74  | in slider event|
000327f0  20 62 6c 6f 63 6b 0d 1a  a1 2a 20 20 e7 20 65 5f  | block...*  . e_|
00032800  62 6c 6b 25 21 28 65 5f  70 74 72 25 20 2b 20 62  |blk%!(e_ptr% + b|
00032810  75 6d 70 5f 69 63 25 29  20 3d 20 69 68 25 20 8c  |ump_ic%) = ih% .|
00032820  0d 1a a2 40 20 20 20 20  66 6f 75 6e 64 25 20 3d  |...@    found% =|
00032830  20 b9 20 3a 20 70 74 72  25 20 3d 20 65 5f 70 74  | . : ptr% = e_pt|
00032840  72 25 20 3a 5f 76 61 6c  75 65 25 20 3d 20 65 5f  |r% :_value% = e_|
00032850  62 6c 6b 25 21 28 70 74  72 25 20 2b 20 32 38 29  |blk%!(ptr% + 28)|
00032860  0d 1a a3 3a 20 20 20 20  f2 73 68 65 6c 6c 5f 54  |...:    .shell_T|
00032870  72 61 63 65 66 30 28 22  43 75 72 72 65 6e 74 20  |racef0("Current |
00032880  73 6c 69 64 65 72 20 76  61 6c 75 65 20 3d 20 22  |slider value = "|
00032890  2b c3 5f 76 61 6c 75 65  25 29 0d 1a a4 37 20 20  |+._value%)...7  |
000328a0  20 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |  .shell_Tracef0|
000328b0  28 22 53 6c 69 64 65 72  20 68 61 6e 64 6c 65 20  |("Slider handle |
000328c0  69 73 20 20 20 20 20 3d  20 22 2b c3 70 74 72 25  |is     = "+.ptr%|
000328d0  29 0d 1a a5 07 20 20 cd  0d 1a a6 12 20 20 65 5f  |)....  .....  e_|
000328e0  70 74 72 25 20 2b 3d 20  33 32 0d 1a a7 20 fd 20  |ptr% += 32... . |
000328f0  65 5f 70 74 72 25 20 3e  3d 20 65 5f 73 69 7a 65  |e_ptr% >= e_size|
00032900  25 20 84 20 66 6f 75 6e  64 25 0d 1a a8 0e e7 20  |% . found%..... |
00032910  66 6f 75 6e 64 25 20 8c  0d 1a a9 2d 20 20 f2 73  |found% ....-  .s|
00032920  68 65 6c 6c 5f 53 6c 69  64 65 72 53 65 74 56 61  |hell_SliderSetVa|
00032930  6c 75 65 28 70 74 72 25  2c 5f 76 61 6c 75 65 25  |lue(ptr%,_value%|
00032940  20 2b 20 31 29 0d 1a aa  05 cd 0d 1a ab 07 3d 20  | + 1).........= |
00032950  30 0d 1a ac 05 3a 0d 1a  ad 20 2a 7c 53 74 6f 70  |0....:... *|Stop|
00032960  20 46 4e 5f 73 68 65 6c  6c 5f 73 6c 69 64 65 72  | FN_shell_slider|
00032970  62 75 6d 70 75 70 0d 1a  ae 04 0d 1a af 23 2a 7c  |bumpup.......#*||
00032980  53 74 61 72 74 20 46 4e  5f 73 68 65 6c 6c 5f 73  |Start FN_shell_s|
00032990  6c 69 64 65 72 62 75 6d  70 64 6f 77 6e 0d 1a b0  |liderbumpdown...|
000329a0  2d dd 20 a4 5f 73 68 65  6c 6c 5f 73 6c 69 64 65  |-. ._shell_slide|
000329b0  72 62 75 6d 70 64 6f 77  6e 28 77 68 25 2c 69 68  |rbumpdown(wh%,ih|
000329c0  25 2c 62 75 74 74 6f 6e  25 29 0d 1a b1 38 ea 20  |%,button%)...8. |
000329d0  65 5f 73 69 7a 65 25 2c  65 5f 62 6c 6b 25 2c 65  |e_size%,e_blk%,e|
000329e0  5f 70 74 72 25 2c 66 6f  75 6e 64 25 2c 70 74 72  |_ptr%,found%,ptr|
000329f0  25 2c 5f 76 61 6c 75 65  25 2c 62 75 6d 70 5f 69  |%,_value%,bump_i|
00032a00  63 25 0d 1a b2 2f f2 73  68 65 6c 6c 5f 54 72 61  |c%.../.shell_Tra|
00032a10  63 65 66 30 28 22 49 6e  20 73 6c 69 64 65 72 62  |cef0("In sliderb|
00032a20  75 6d 70 64 6f 77 6e 20  72 6f 75 74 69 6e 65 22  |umpdown routine"|
00032a30  29 0d 1a b3 15 65 5f 62  6c 6b 25 20 20 3d 20 5f  |)....e_blk%  = _|
00032a40  55 25 21 33 33 32 0d 1a  b4 15 65 5f 73 69 7a 65  |U%!332....e_size|
00032a50  25 20 3d 20 21 65 5f 62  6c 6b 25 0d 1a b5 0f 65  |% = !e_blk%....e|
00032a60  5f 70 74 72 25 20 20 3d  20 34 0d 1a b6 33 f2 73  |_ptr%  = 4...3.s|
00032a70  68 65 6c 6c 5f 54 72 61  63 65 66 30 28 22 45 76  |hell_Tracef0("Ev|
00032a80  65 6e 74 20 62 6c 6f 63  6b 20 73 69 7a 65 20 69  |ent block size i|
00032a90  73 20 22 2b c3 65 5f 73  69 7a 65 25 29 0d 1a b7  |s "+.e_size%)...|
00032aa0  31 e7 20 62 75 74 74 6f  6e 25 20 3d 20 34 20 8c  |1. button% = 4 .|
00032ab0  20 62 75 6d 70 5f 69 63  25 20 3d 20 32 30 20 8b  | bump_ic% = 20 .|
00032ac0  20 62 75 6d 70 5f 69 63  25 20 3d 20 31 36 0d 1a  | bump_ic% = 16..|
00032ad0  b8 05 f5 0d 1a b9 37 20  20 f4 20 73 63 61 6e 20  |......7  . scan |
00032ae0  66 6f 72 20 62 75 6d 70  20 69 63 6f 6e 20 68 61  |for bump icon ha|
00032af0  6e 64 6c 65 20 69 6e 20  73 6c 69 64 65 72 20 65  |ndle in slider e|
00032b00  76 65 6e 74 20 62 6c 6f  63 6b 0d 1a ba 2a 20 20  |vent block...*  |
00032b10  e7 20 65 5f 62 6c 6b 25  21 28 65 5f 70 74 72 25  |. e_blk%!(e_ptr%|
00032b20  20 2b 20 62 75 6d 70 5f  69 63 25 29 20 3d 20 69  | + bump_ic%) = i|
00032b30  68 25 20 8c 0d 1a bb 40  20 20 20 20 66 6f 75 6e  |h% ....@    foun|
00032b40  64 25 20 3d 20 b9 20 3a  20 70 74 72 25 20 3d 20  |d% = . : ptr% = |
00032b50  65 5f 70 74 72 25 20 3a  5f 76 61 6c 75 65 25 20  |e_ptr% :_value% |
00032b60  3d 20 65 5f 62 6c 6b 25  21 28 70 74 72 25 20 2b  |= e_blk%!(ptr% +|
00032b70  20 32 38 29 0d 1a bc 3a  20 20 20 20 f2 73 68 65  | 28)...:    .she|
00032b80  6c 6c 5f 54 72 61 63 65  66 30 28 22 43 75 72 72  |ll_Tracef0("Curr|
00032b90  65 6e 74 20 73 6c 69 64  65 72 20 76 61 6c 75 65  |ent slider value|
00032ba0  20 3d 20 22 2b c3 5f 76  61 6c 75 65 25 29 0d 1a  | = "+._value%)..|
00032bb0  bd 37 20 20 20 20 f2 73  68 65 6c 6c 5f 54 72 61  |.7    .shell_Tra|
00032bc0  63 65 66 30 28 22 53 6c  69 64 65 72 20 68 61 6e  |cef0("Slider han|
00032bd0  64 6c 65 20 69 73 20 20  20 20 20 3d 20 22 2b c3  |dle is     = "+.|
00032be0  70 74 72 25 29 0d 1a be  07 20 20 cd 0d 1a bf 12  |ptr%)....  .....|
00032bf0  20 20 65 5f 70 74 72 25  20 2b 3d 20 33 32 0d 1a  |  e_ptr% += 32..|
00032c00  c0 20 fd 20 65 5f 70 74  72 25 20 3e 3d 20 65 5f  |. . e_ptr% >= e_|
00032c10  73 69 7a 65 25 20 84 20  66 6f 75 6e 64 25 0d 1a  |size% . found%..|
00032c20  c1 0e e7 20 66 6f 75 6e  64 25 20 8c 0d 1a c2 2d  |... found% ....-|
00032c30  20 20 f2 73 68 65 6c 6c  5f 53 6c 69 64 65 72 53  |  .shell_SliderS|
00032c40  65 74 56 61 6c 75 65 28  70 74 72 25 2c 5f 76 61  |etValue(ptr%,_va|
00032c50  6c 75 65 25 20 2d 20 31  29 0d 1a c3 05 cd 0d 1a  |lue% - 1).......|
00032c60  c4 07 3d 20 30 0d 1a c5  05 3a 0d 1a c6 22 2a 7c  |..= 0....:..."*||
00032c70  53 74 6f 70 20 46 4e 5f  73 68 65 6c 6c 5f 73 6c  |Stop FN_shell_sl|
00032c80  69 64 65 72 62 75 6d 70  64 6f 77 6e 0d 1a c7 04  |iderbumpdown....|
00032c90  0d 1a c8 27 2a 7c 53 74  61 72 74 20 50 52 4f 43  |...'*|Start PROC|
00032ca0  73 68 65 6c 6c 5f 44 65  6c 65 74 65 45 76 65 6e  |shell_DeleteEven|
00032cb0  74 53 6c 69 64 65 72 0d  1a c9 27 dd 20 f2 73 68  |tSlider...'. .sh|
00032cc0  65 6c 6c 5f 44 65 6c 65  74 65 45 76 65 6e 74 53  |ell_DeleteEventS|
00032cd0  6c 69 64 65 72 28 77 68  25 2c 69 68 25 29 0d 1a  |lider(wh%,ih%)..|
00032ce0  ca 43 f4 20 69 66 20 49  20 63 61 6e 20 66 69 6e  |.C. if I can fin|
00032cf0  64 20 77 68 69 63 68 20  77 6f 72 64 73 20 70 6f  |d which words po|
00032d00  69 6e 74 20 74 6f 20 61  20 68 65 61 70 20 62 6c  |int to a heap bl|
00032d10  6f 63 6b 20 74 68 65 79  20 63 6f 75 6c 64 20 62  |ock they could b|
00032d20  65 0d 1a cb 44 f4 20 61  75 74 6f 6d 61 74 69 63  |e...D. automatic|
00032d30  61 6c 6c 79 20 64 65 74  65 63 74 65 64 20 61 6e  |ally detected an|
00032d40  64 20 72 65 6c 65 61 73  65 64 2e 20 41 20 67 65  |d released. A ge|
00032d50  6e 65 72 61 6c 20 70 75  72 70 6f 73 65 20 72 6f  |neral purpose ro|
00032d60  75 74 69 6e 65 0d 1a cc  2e f4 20 73 68 65 6c 6c  |utine..... shell|
00032d70  5f 44 65 6c 65 74 65 45  76 65 6e 74 20 63 6f 75  |_DeleteEvent cou|
00032d80  6c 64 20 74 68 65 6e 20  62 65 20 77 72 69 74 74  |ld then be writt|
00032d90  65 6e 21 0d 1a cd 37 f4  20 49 66 20 69 68 25 3d  |en!...7. If ih%=|
00032da0  2d 31 20 72 65 6d 6f 76  65 20 61 6c 6c 20 65 76  |-1 remove all ev|
00032db0  65 6e 74 73 20 66 6f 72  20 77 69 6e 64 6f 77 20  |ents for window |
00032dc0  68 61 6e 64 6c 65 20 77  68 25 0d 1a ce 2f ea 20  |handle wh%.../. |
00032dd0  6f 66 66 73 65 74 25 2c  62 6c 6b 25 2c 6c 69 73  |offset%,blk%,lis|
00032de0  74 5f 73 69 7a 65 25 2c  65 76 65 6e 74 5f 6c 69  |t_size%,event_li|
00032df0  73 74 25 2c 74 65 6d 70  25 0d 1a cf 19 65 76 65  |st%,temp%....eve|
00032e00  6e 74 5f 6c 69 73 74 25  20 3d 20 5f 55 25 21 33  |nt_list% = _U%!3|
00032e10  33 32 0d 1a d0 05 f5 0d  1a d1 40 20 20 6f 66 66  |32........@  off|
00032e20  73 65 74 25 20 3d 20 a4  73 68 65 6c 6c 5f 47 65  |set% = .shell_Ge|
00032e30  74 45 76 65 6e 74 4c 69  73 74 4f 66 66 73 65 74  |tEventListOffset|
00032e40  32 28 77 68 25 2c 69 68  25 2c 5f 55 25 2b 33 33  |2(wh%,ih%,_U%+33|
00032e50  32 2c 33 32 2c a3 29 0d  1a d2 15 2a 7c 69 66 64  |2,32,.)....*|ifd|
00032e60  65 66 20 54 72 61 63 65  49 6e 69 74 0d 1a d3 3f  |ef TraceInit...?|
00032e70  20 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |  .shell_Tracef0|
00032e80  28 22 44 65 6c 65 74 65  45 76 65 6e 74 53 6c 69  |("DeleteEventSli|
00032e90  64 65 72 3a 6f 66 66 73  65 74 25 20 3d 20 22 20  |der:offset% = " |
00032ea0  2b 20 c3 6f 66 66 73 65  74 25 29 0d 1a d4 0b 2a  |+ .offset%)....*|
00032eb0  7c 65 6e 64 69 66 0d 1a  d5 16 20 20 e7 20 6f 66  ||endif....  . of|
00032ec0  66 73 65 74 25 20 3e 3d  20 30 20 8c 0d 1a d6 12  |fset% >= 0 .....|
00032ed0  20 20 20 20 e7 20 69 68  25 3d 2d 31 20 8c 0d 1a  |    . ih%=-1 ...|
00032ee0  d7 15 2a 7c 69 66 64 65  66 20 54 72 61 63 65 49  |..*|ifdef TraceI|
00032ef0  6e 69 74 0d 1a d8 6e 20  20 20 20 20 20 20 f2 73  |nit...n       .s|
00032f00  68 65 6c 6c 5f 54 72 61  63 65 66 30 28 22 44 65  |hell_Tracef0("De|
00032f10  6c 65 74 65 45 76 65 6e  74 53 6c 69 64 65 72 3a  |leteEventSlider:|
00032f20  44 65 6c 65 74 69 6e 67  20 53 6c 69 64 65 72 20  |Deleting Slider |
00032f30  45 76 65 6e 74 20 28 61  6c 6c 20 65 76 65 6e 74  |Event (all event|
00032f40  73 20 66 6f 72 20 77 69  6e 64 6f 77 20 68 61 6e  |s for window han|
00032f50  64 6c 65 20 26 22 2b c3  7e 77 68 25 2b 22 29 22  |dle &"+.~wh%+")"|
00032f60  29 0d 1a d9 0b 2a 7c 65  6e 64 69 66 0d 1a da 09  |)....*|endif....|
00032f70  20 20 20 20 cc 0d 1a db  15 2a 7c 69 66 64 65 66  |    .....*|ifdef|
00032f80  20 54 72 61 63 65 49 6e  69 74 0d 1a dc 7b 20 20  | TraceInit...{  |
00032f90  20 20 20 20 f2 73 68 65  6c 6c 5f 54 72 61 63 65  |    .shell_Trace|
00032fa0  66 30 28 22 44 65 6c 65  74 65 45 76 65 6e 74 53  |f0("DeleteEventS|
00032fb0  6c 69 64 65 72 3a 44 65  6c 65 74 69 6e 67 20 53  |lider:Deleting S|
00032fc0  6c 69 64 65 72 20 45 76  65 6e 74 20 28 77 69 6e  |lider Event (win|
00032fd0  64 6f 77 20 68 61 6e 64  6c 65 20 77 61 73 20 26  |dow handle was &|
00032fe0  22 2b c3 7e 77 68 25 2b  22 20 69 63 6f 6e 20 68  |"+.~wh%+" icon h|
00032ff0  61 6e 64 6c 65 20 77 61  73 20 22 2b c3 69 68 25  |andle was "+.ih%|
00033000  2b 22 29 22 29 0d 1a dd  0b 2a 7c 65 6e 64 69 66  |+")")....*|endif|
00033010  0d 1a de 09 20 20 20 20  cd 0d 1a df 2a 20 20 20  |....    ....*   |
00033020  20 f4 20 65 76 65 6e 74  20 66 6f 72 20 77 69 6e  | . event for win|
00033030  64 6f 77 2f 69 63 6f 6e  20 69 73 20 69 6e 20 6c  |dow/icon is in l|
00033040  69 73 74 0d 1a e0 21 20  20 20 20 6c 69 73 74 5f  |ist...!    list_|
00033050  73 69 7a 65 25 20 3d 20  21 65 76 65 6e 74 5f 6c  |size% = !event_l|
00033060  69 73 74 25 0d 1a e1 25  20 20 20 20 e7 20 6f 66  |ist%...%    . of|
00033070  66 73 65 74 25 20 3d 20  6c 69 73 74 5f 73 69 7a  |fset% = list_siz|
00033080  65 25 20 2d 20 33 32 20  8c 0d 1a e2 2b 20 20 20  |e% - 32 ....+   |
00033090  20 20 20 f4 20 69 74 20  69 73 20 74 68 65 20 6c  |   . it is the l|
000330a0  61 73 74 20 6f 6e 65 20  69 6e 20 74 68 69 73 20  |ast one in this |
000330b0  6c 69 73 74 0d 1a e3 19  20 20 20 20 20 20 e7 20  |list....      . |
000330c0  6f 66 66 73 65 74 25 20  3d 20 30 20 8c 0d 1a e4  |offset% = 0 ....|
000330d0  28 20 20 20 20 20 20 20  20 f4 20 6f 6e 6c 79 20  |(        . only |
000330e0  6f 6e 65 20 65 76 65 6e  74 20 69 6e 20 74 68 65  |one event in the|
000330f0  20 6c 69 73 74 0d 1a e5  3e 20 20 20 20 20 20 20  | list...>       |
00033100  20 f2 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
00033110  6b 52 65 74 75 72 6e 28  65 76 65 6e 74 5f 6c 69  |kReturn(event_li|
00033120  73 74 25 20 2b 20 6f 66  66 73 65 74 25 20 2b 20  |st% + offset% + |
00033130  32 34 29 0d 1a e6 2b 20  20 20 20 20 20 20 20 f2  |24)...+        .|
00033140  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 52  |shell_HeapBlockR|
00033150  65 74 75 72 6e 28 5f 55  25 21 33 33 32 29 0d 1a  |eturn(_U%!332)..|
00033160  e7 17 20 20 20 20 20 20  20 20 5f 55 25 21 33 33  |..        _U%!33|
00033170  32 20 3d 20 30 0d 1a e8  15 2a 7c 69 66 64 65 66  |2 = 0....*|ifdef|
00033180  20 54 72 61 63 65 49 6e  69 74 0d 1a e9 4f 20 20  | TraceInit...O  |
00033190  20 20 20 20 20 20 f2 73  68 65 6c 6c 5f 54 72 61  |      .shell_Tra|
000331a0  63 65 66 30 28 22 44 65  6c 65 74 65 45 76 65 6e  |cef0("DeleteEven|
000331b0  74 53 6c 69 64 65 72 3a  4e 6f 20 53 6c 69 64 65  |tSlider:No Slide|
000331c0  72 20 65 76 65 6e 74 73  20 6e 6f 77 20 72 65 67  |r events now reg|
000331d0  69 73 74 65 72 65 64 22  29 0d 1a ea 0b 2a 7c 65  |istered")....*|e|
000331e0  6e 64 69 66 0d 1a eb 0b  20 20 20 20 20 20 cc 0d  |ndif....      ..|
000331f0  1a ec 2d 20 20 20 20 20  20 20 20 f4 20 6d 6f 72  |..-        . mor|
00033200  65 20 74 68 61 6e 20 6f  6e 65 20 65 76 65 6e 74  |e than one event|
00033210  20 69 6e 20 74 68 65 20  6c 69 73 74 0d 1a ed 3a  | in the list...:|
00033220  20 20 20 20 20 20 20 20  5f 55 25 21 33 33 32 20  |        _U%!332 |
00033230  3d 20 a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |= .shell_HeapBlo|
00033240  63 6b 45 78 74 65 6e 64  28 5f 55 25 21 33 33 32  |ckExtend(_U%!332|
00033250  2c 2d 20 33 32 29 0d 1a  ee 21 20 20 20 20 20 20  |,- 32)...!      |
00033260  20 20 65 76 65 6e 74 5f  6c 69 73 74 25 20 3d 20  |  event_list% = |
00033270  5f 55 25 21 33 33 32 0d  1a ef 1e 20 20 20 20 20  |_U%!332....     |
00033280  20 20 20 21 65 76 65 6e  74 5f 6c 69 73 74 25 20  |   !event_list% |
00033290  2d 3d 20 33 32 0d 1a f0  0b 20 20 20 20 20 20 cd  |-= 32....      .|
000332a0  0d 1a f1 09 20 20 20 20  cc 0d 1a f2 28 20 20 20  |....    ....(   |
000332b0  20 20 20 f4 20 6e 6f 74  20 74 68 65 20 6c 61 73  |   . not the las|
000332c0  74 20 6f 6e 65 20 69 6e  20 74 68 65 20 6c 69 73  |t one in the lis|
000332d0  74 0d 1a f3 26 20 20 20  20 20 20 62 6c 6b 25 20  |t...&      blk% |
000332e0  3d 20 65 76 65 6e 74 5f  6c 69 73 74 25 20 2b 20  |= event_list% + |
000332f0  6f 66 66 73 65 74 25 0d  1a f4 1f 20 20 20 20 20  |offset%....     |
00033300  20 62 6c 6b 25 21 30 20  3d 20 30 3a 62 6c 6b 25  | blk%!0 = 0:blk%|
00033310  21 34 20 3d 20 30 0d 1a  f5 2b 20 20 20 20 20 20  |!4 = 0...+      |
00033320  f2 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
00033330  52 65 74 75 72 6e 28 62  6c 6b 25 20 2b 20 32 34  |Return(blk% + 24|
00033340  29 0d 1a f6 09 20 20 20  20 cd 0d 1a f7 07 20 20  |)....    .....  |
00033350  cd 0d 1a f8 36 20 20 f4  20 72 65 70 65 61 74 20  |....6  . repeat |
00033360  6c 6f 6f 70 20 75 6e 74  69 6c 20 6f 66 66 73 65  |loop until offse|
00033370  74 25 3d 2d 31 20 28 65  76 65 6e 74 20 6e 6f 74  |t%=-1 (event not|
00033380  20 66 6f 75 6e 64 29 0d  1a f9 31 20 20 f4 20 6f  | found)...1  . o|
00033390  72 20 6f 66 66 73 65 74  25 3d 2d 32 20 28 65 76  |r offset%=-2 (ev|
000333a0  65 6e 74 20 62 6c 6f 63  6b 20 64 6f 65 73 6e 27  |ent block doesn'|
000333b0  74 20 65 78 69 73 74 29  0d 1a fa 11 fd 20 6f 66  |t exist)..... of|
000333c0  66 73 65 74 25 20 3c 20  30 0d 1a fb 05 e1 0d 1a  |fset% < 0.......|
000333d0  fc 05 3a 0d 1a fd 26 2a  7c 53 74 6f 70 20 50 52  |..:...&*|Stop PR|
000333e0  4f 43 73 68 65 6c 6c 5f  44 65 6c 65 74 65 45 76  |OCshell_DeleteEv|
000333f0  65 6e 74 53 6c 69 64 65  72 0d 1a fe 04 0d 1a ff  |entSlider.......|
00033400  27 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |'*|Start PROCshe|
00033410  6c 6c 5f 4f 70 65 6e 57  69 6e 64 6f 77 44 79 6e  |ll_OpenWindowDyn|
00033420  61 6d 69 63 0d 1b 00 42  dd 20 f2 73 68 65 6c 6c  |amic...B. .shell|
00033430  5f 4f 70 65 6e 57 69 6e  64 6f 77 44 79 6e 61 6d  |_OpenWindowDynam|
00033440  69 63 28 74 65 6d 70 6c  61 74 65 24 2c 70 72 65  |ic(template$,pre|
00033450  6f 70 65 6e 5f 66 6e 24  2c 70 6f 73 74 6f 70 65  |open_fn$,postope|
00033460  6e 5f 66 6e 24 29 0d 1b  01 1f ea 20 68 25 2c 78  |n_fn$)..... h%,x|
00033470  5f 6f 66 66 25 2c 79 5f  6f 66 66 25 2c 77 69 6e  |_off%,y_off%,win|
00033480  5f 62 6c 6b 25 0d 1b 02  04 0d 1b 03 25 f2 73 68  |_blk%.......%.sh|
00033490  65 6c 6c 5f 43 72 65 61  74 65 57 69 6e 64 6f 77  |ell_CreateWindow|
000334a0  28 74 65 6d 70 6c 61 74  65 24 2c 68 25 29 0d 1b  |(template$,h%)..|
000334b0  04 15 2a 7c 69 66 64 65  66 20 54 72 61 63 65 49  |..*|ifdef TraceI|
000334c0  6e 69 74 0d 1b 05 59 f2  73 68 65 6c 6c 5f 54 72  |nit...Y.shell_Tr|
000334d0  61 63 65 66 30 28 22 4f  70 65 6e 57 69 6e 64 6f  |acef0("OpenWindo|
000334e0  77 44 79 6e 61 6d 69 63  3a 43 72 65 61 74 69 6e  |wDynamic:Creatin|
000334f0  67 20 6e 65 77 20 64 79  6e 61 6d 69 63 20 77 69  |g new dynamic wi|
00033500  6e 64 6f 77 20 28 68 61  6e 64 6c 65 20 69 73 20  |ndow (handle is |
00033510  26 22 2b c3 7e 68 25 2b  22 29 22 29 0d 1b 06 0b  |&"+.~h%+")")....|
00033520  2a 7c 65 6e 64 69 66 0d  1b 07 2a 77 69 6e 5f 62  |*|endif...*win_b|
00033530  6c 6b 25 20 20 20 3d 20  a4 73 68 65 6c 6c 5f 48  |lk%   = .shell_H|
00033540  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 33 36  |eapBlockFetch(36|
00033550  29 0d 1b 08 13 77 69 6e  5f 62 6c 6b 25 21 30 20  |)....win_blk%!0 |
00033560  3d 20 68 25 0d 1b 09 26  c8 99 20 22 57 69 6d 70  |= h%...&.. "Wimp|
00033570  5f 47 65 74 57 69 6e 64  6f 77 53 74 61 74 65 22  |_GetWindowState"|
00033580  2c 2c 77 69 6e 5f 62 6c  6b 25 0d 1b 0a 2c 78 5f  |,,win_blk%...,x_|
00033590  6f 66 66 25 20 3d 20 28  77 69 6e 5f 62 6c 6b 25  |off% = (win_blk%|
000335a0  21 30 34 20 2d 20 77 69  6e 5f 62 6c 6b 25 21 31  |!04 - win_blk%!1|
000335b0  32 29 20 2f 20 32 0d 1b  0b 2c 79 5f 6f 66 66 25  |2) / 2...,y_off%|
000335c0  20 3d 20 28 77 69 6e 5f  62 6c 6b 25 21 31 36 20  | = (win_blk%!16 |
000335d0  2d 20 77 69 6e 5f 62 6c  6b 25 21 30 38 29 20 2f  |- win_blk%!08) /|
000335e0  20 32 0d 1b 0c 24 f2 73  68 65 6c 6c 5f 48 65 61  | 2...$.shell_Hea|
000335f0  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 77 69 6e  |pBlockReturn(win|
00033600  5f 62 6c 6b 25 29 0d 1b  0d 13 e7 20 5f 55 25 21  |_blk%)..... _U%!|
00033610  32 30 20 3c 3e 20 30 20  8c 0d 1b 0e 2b 20 20 f4  |20 <> 0 ....+  .|
00033620  20 44 65 6c 65 74 65 20  6c 61 73 74 20 64 79 6e  | Delete last dyn|
00033630  61 6d 69 63 20 77 69 6e  64 6f 77 20 6f 70 65 6e  |amic window open|
00033640  65 64 2e 2e 0d 1b 0f 1e  20 20 c8 99 20 22 57 69  |ed......  .. "Wi|
00033650  6d 70 5f 43 72 65 61 74  65 4d 65 6e 75 22 2c 2c  |mp_CreateMenu",,|
00033660  2d 31 0d 1b 10 27 20 20  76 6f 69 64 25 3d a4 73  |-1...'  void%=.s|
00033670  68 65 6c 6c 5f 44 65 6c  65 74 65 57 69 6e 64 6f  |hell_DeleteWindo|
00033680  77 28 5f 55 25 21 32 30  29 0d 1b 11 05 cd 0d 1b  |w(_U%!20).......|
00033690  12 10 5f 55 25 21 32 30  20 3d 20 77 68 25 0d 1b  |.._U%!20 = wh%..|
000336a0  13 19 e7 20 70 72 65 6f  70 65 6e 5f 66 6e 24 20  |... preopen_fn$ |
000336b0  3c 3e 20 22 22 20 8c 0d  1b 14 15 2a 7c 69 66 64  |<> "" .....*|ifd|
000336c0  65 66 20 54 72 61 63 65  49 6e 69 74 0d 1b 15 4f  |ef TraceInit...O|
000336d0  20 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |  .shell_Tracef0|
000336e0  28 22 4f 70 65 6e 57 69  6e 64 6f 77 44 79 6e 61  |("OpenWindowDyna|
000336f0  6d 69 63 3a 43 61 6c 6c  69 6e 67 20 50 72 65 2d  |mic:Calling Pre-|
00033700  4f 70 65 6e 20 46 4e 20  27 22 2b 70 72 65 6f 70  |Open FN '"+preop|
00033710  65 6e 5f 66 6e 24 2b 22  27 22 29 0d 1b 16 0b 2a  |en_fn$+"'")....*|
00033720  7c 65 6e 64 69 66 0d 1b  17 35 20 20 76 6f 69 64  ||endif...5  void|
00033730  25 20 3d 20 a0 28 22 46  4e 22 20 2b 20 70 72 65  |% = .("FN" + pre|
00033740  6f 70 65 6e 5f 66 6e 24  20 2b 20 22 28 22 20 2b  |open_fn$ + "(" +|
00033750  20 c3 68 25 20 2b 20 22  29 22 29 0d 1b 18 05 cc  | .h% + ")").....|
00033760  0d 1b 19 15 2a 7c 69 66  64 65 66 20 54 72 61 63  |....*|ifdef Trac|
00033770  65 49 6e 69 74 0d 1b 1a  38 20 20 f2 73 68 65 6c  |eInit...8  .shel|
00033780  6c 5f 54 72 61 63 65 66  30 28 22 4f 70 65 6e 57  |l_Tracef0("OpenW|
00033790  69 6e 64 6f 77 44 79 6e  61 6d 69 63 3a 4e 6f 20  |indowDynamic:No |
000337a0  50 72 65 2d 4f 70 65 6e  20 46 4e 22 29 0d 1b 1b  |Pre-Open FN")...|
000337b0  0b 2a 7c 65 6e 64 69 66  0d 1b 1c 05 cd 0d 1b 1d  |.*|endif........|
000337c0  2f f2 73 68 65 6c 6c 5f  4f 70 65 6e 57 69 6e 64  |/.shell_OpenWind|
000337d0  6f 77 44 79 6e 61 6d 69  63 32 28 68 25 2c 78 5f  |owDynamic2(h%,x_|
000337e0  6f 66 66 25 2c 79 5f 6f  66 66 25 29 0d 1b 1e 1a  |off%,y_off%)....|
000337f0  e7 20 70 6f 73 74 6f 70  65 6e 5f 66 6e 24 20 3c  |. postopen_fn$ <|
00033800  3e 20 22 22 20 8c 0d 1b  1f 15 2a 7c 69 66 64 65  |> "" .....*|ifde|
00033810  66 20 54 72 61 63 65 49  6e 69 74 0d 1b 20 51 20  |f TraceInit.. Q |
00033820  20 f2 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  | .shell_Tracef0(|
00033830  22 4f 70 65 6e 57 69 6e  64 6f 77 44 79 6e 61 6d  |"OpenWindowDynam|
00033840  69 63 3a 43 61 6c 6c 69  6e 67 20 50 6f 73 74 2d  |ic:Calling Post-|
00033850  4f 70 65 6e 20 46 4e 20  27 22 2b 70 6f 73 74 6f  |Open FN '"+posto|
00033860  70 65 6e 5f 66 6e 24 2b  22 27 22 29 0d 1b 21 0b  |pen_fn$+"'")..!.|
00033870  2a 7c 65 6e 64 69 66 0d  1b 22 36 20 20 76 6f 69  |*|endif.."6  voi|
00033880  64 25 20 3d 20 a0 28 22  46 4e 22 20 2b 20 70 6f  |d% = .("FN" + po|
00033890  73 74 6f 70 65 6e 5f 66  6e 24 20 2b 20 22 28 22  |stopen_fn$ + "("|
000338a0  20 2b 20 c3 68 25 20 2b  20 22 29 22 29 0d 1b 23  | + .h% + ")")..#|
000338b0  05 cc 0d 1b 24 15 2a 7c  69 66 64 65 66 20 54 72  |....$.*|ifdef Tr|
000338c0  61 63 65 49 6e 69 74 0d  1b 25 39 20 20 f2 73 68  |aceInit..%9  .sh|
000338d0  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 4f 70 65  |ell_Tracef0("Ope|
000338e0  6e 57 69 6e 64 6f 77 44  79 6e 61 6d 69 63 3a 4e  |nWindowDynamic:N|
000338f0  6f 20 50 6f 73 74 2d 4f  70 65 6e 20 46 4e 22 29  |o Post-Open FN")|
00033900  0d 1b 26 0b 2a 7c 65 6e  64 69 66 0d 1b 27 05 cd  |..&.*|endif..'..|
00033910  0d 1b 28 05 e1 0d 1b 29  05 3a 0d 1b 2a 26 2a 7c  |..(....).:..*&*||
00033920  53 74 6f 70 20 50 52 4f  43 73 68 65 6c 6c 5f 4f  |Stop PROCshell_O|
00033930  70 65 6e 57 69 6e 64 6f  77 44 79 6e 61 6d 69 63  |penWindowDynamic|
00033940  0d 1b 2b 04 0d 1b 2c 27  2a 7c 53 74 61 72 74 20  |..+...,'*|Start |
00033950  50 52 4f 43 73 68 65 6c  6c 5f 49 6e 74 65 72 61  |PROCshell_Intera|
00033960  63 74 69 76 65 48 65 6c  70 4f 6e 0d 1b 2d 1e dd  |ctiveHelpOn..-..|
00033970  20 f2 73 68 65 6c 6c 5f  49 6e 74 65 72 61 63 74  | .shell_Interact|
00033980  69 76 65 48 65 6c 70 4f  6e 0d 1b 2e 20 e7 20 28  |iveHelpOn... . (|
00033990  5f 55 25 21 31 30 30 20  80 20 31 20 3c 3c 20 31  |_U%!100 . 1 << 1|
000339a0  32 29 20 3c 3e 20 30 20  8c 0d 1b 2f 05 cc 0d 1b  |2) <> 0 .../....|
000339b0  30 21 20 20 5f 55 25 21  31 30 30 20 3d 20 5f 55  |0!  _U%!100 = _U|
000339c0  25 21 31 30 30 20 82 20  31 20 3c 3c 20 31 32 0d  |%!100 . 1 << 12.|
000339d0  1b 31 05 cd 0d 1b 32 05  e1 0d 1b 33 05 3a 0d 1b  |.1....2....3.:..|
000339e0  34 26 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |4&*|Stop PROCshe|
000339f0  6c 6c 5f 49 6e 74 65 72  61 63 74 69 76 65 48 65  |ll_InteractiveHe|
00033a00  6c 70 4f 6e 0d 1b 35 04  0d 1b 36 28 2a 7c 53 74  |lpOn..5...6(*|St|
00033a10  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 49 6e  |art PROCshell_In|
00033a20  74 65 72 61 63 74 69 76  65 48 65 6c 70 4f 66 66  |teractiveHelpOff|
00033a30  0d 1b 37 1f dd 20 f2 73  68 65 6c 6c 5f 49 6e 74  |..7.. .shell_Int|
00033a40  65 72 61 63 74 69 76 65  48 65 6c 70 4f 66 66 0d  |eractiveHelpOff.|
00033a50  1b 38 20 e7 20 28 5f 55  25 21 31 30 30 20 80 20  |.8 . (_U%!100 . |
00033a60  31 20 3c 3c 20 31 32 29  20 3c 3e 20 30 20 8c 0d  |1 << 12) <> 0 ..|
00033a70  1b 39 21 20 20 5f 55 25  21 31 30 30 20 3d 20 5f  |.9!  _U%!100 = _|
00033a80  55 25 21 31 30 30 20 82  20 31 20 3c 3c 20 31 32  |U%!100 . 1 << 12|
00033a90  0d 1b 3a 05 cd 0d 1b 3b  05 e1 0d 1b 3c 05 3a 0d  |..:....;....<.:.|
00033aa0  1b 3d 27 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |.='*|Stop PROCsh|
00033ab0  65 6c 6c 5f 49 6e 74 65  72 61 63 74 69 76 65 48  |ell_InteractiveH|
00033ac0  65 6c 70 4f 66 66 0d 1b  3e 04 0d 1b 3f 2a 2a 7c  |elpOff..>...?**||
00033ad0  53 74 61 72 74 20 50 52  4f 43 73 68 65 6c 6c 5f  |Start PROCshell_|
00033ae0  4d 65 73 73 61 67 65 53  65 6e 64 50 72 69 6e 74  |MessageSendPrint|
00033af0  53 61 76 65 0d 1b 40 34  dd 20 f2 73 68 65 6c 6c  |Save..@4. .shell|
00033b00  5f 4d 65 73 73 61 67 65  53 65 6e 64 50 72 69 6e  |_MessageSendPrin|
00033b10  74 53 61 76 65 28 46 69  6c 65 54 79 70 65 25 2c  |tSave(FileType%,|
00033b20  63 6f 70 69 65 73 25 29  0d 1b 41 37 e7 20 63 6f  |copies%)..A7. co|
00033b30  70 69 65 73 25 20 3e 20  31 20 8c 20 5f 55 25 21  |pies% > 1 . _U%!|
00033b40  33 33 36 20 3d 20 63 6f  70 69 65 73 25 20 2d 20  |336 = copies% - |
00033b50  31 20 8b 20 5f 55 25 21  33 33 36 20 3d 20 30 0d  |1 . _U%!336 = 0.|
00033b60  1b 42 25 f2 73 68 65 6c  6c 5f 44 6f 53 65 6e 64  |.B%.shell_DoSend|
00033b70  50 72 69 6e 74 53 61 76  65 28 46 69 6c 65 54 79  |PrintSave(FileTy|
00033b80  70 65 25 29 0d 1b 43 05  e1 0d 1b 44 05 3a 0d 1b  |pe%)..C....D.:..|
00033b90  45 29 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |E)*|Stop PROCshe|
00033ba0  6c 6c 5f 4d 65 73 73 61  67 65 53 65 6e 64 50 72  |ll_MessageSendPr|
00033bb0  69 6e 74 53 61 76 65 0d  1b 46 04 0d 1b 47 25 2a  |intSave..F...G%*|
00033bc0  7c 53 74 61 72 74 20 50  52 4f 43 73 68 65 6c 6c  ||Start PROCshell|
00033bd0  5f 44 6f 53 65 6e 64 50  72 69 6e 74 53 61 76 65  |_DoSendPrintSave|
00033be0  0d 1b 48 27 dd 20 f2 73  68 65 6c 6c 5f 44 6f 53  |..H'. .shell_DoS|
00033bf0  65 6e 64 50 72 69 6e 74  53 61 76 65 28 46 69 6c  |endPrintSave(Fil|
00033c00  65 54 79 70 65 25 29 0d  1b 49 0d ea 20 6d 73 67  |eType%)..I.. msg|
00033c10  62 6c 6b 25 0d 1b 4a 2b  6d 73 67 62 6c 6b 25 20  |blk%..J+msgblk% |
00033c20  20 20 20 3d 20 a4 73 68  65 6c 6c 5f 48 65 61 70  |   = .shell_Heap|
00033c30  42 6c 6f 63 6b 46 65 74  63 68 28 32 35 36 29 0d  |BlockFetch(256).|
00033c40  1b 4b 35 6d 73 67 62 6c  6b 25 21 30 20 20 3d 20  |.K5msgblk%!0  = |
00033c50  32 35 36 20 20 20 20 20  20 20 3a f4 20 6c 65 6e  |256       :. len|
00033c60  67 74 68 20 6f 66 20 6d  65 73 73 61 67 65 20 62  |gth of message b|
00033c70  6c 6f 63 6b 0d 1b 4c 31  6d 73 67 62 6c 6b 25 21  |lock..L1msgblk%!|
00033c80  31 32 20 3d 20 30 20 20  20 20 20 20 20 20 20 3a  |12 = 0         :|
00033c90  f4 20 6d 79 72 65 66 20  30 3d 6f 72 69 67 69 6e  |. myref 0=origin|
00033ca0  61 74 69 6e 67 0d 1b 4d  38 6d 73 67 62 6c 6b 25  |ating..M8msgblk%|
00033cb0  21 31 36 20 3d 20 26 38  30 31 34 32 20 20 20 20  |!16 = &80142    |
00033cc0  3a f4 20 6d 65 73 73 61  67 65 20 61 63 74 69 6f  |:. message actio|
00033cd0  6e 20 28 50 72 69 6e 74  53 61 76 65 29 0d 1b 4e  |n (PrintSave)..N|
00033ce0  37 6d 73 67 62 6c 6b 25  21 32 30 20 3d 20 30 20  |7msgblk%!20 = 0 |
00033cf0  20 20 20 20 20 20 20 20  3a f4 20 64 65 73 74 69  |        :. desti|
00033d00  6e 61 74 69 6f 6e 20 77  69 6e 64 6f 77 20 68 61  |nation window ha|
00033d10  6e 64 6c 65 0d 1b 4f 35  6d 73 67 62 6c 6b 25 21  |ndle..O5msgblk%!|
00033d20  32 34 20 3d 20 30 20 20  20 20 20 20 20 20 20 3a  |24 = 0         :|
00033d30  f4 20 64 65 73 74 69 6e  61 74 69 6f 6e 20 69 63  |. destination ic|
00033d40  6f 6e 20 68 61 6e 64 6c  65 0d 1b 50 2b 6d 73 67  |on handle..P+msg|
00033d50  62 6c 6b 25 21 32 38 20  3d 20 30 20 20 20 20 20  |blk%!28 = 0     |
00033d60  20 20 20 20 3a f4 20 6d  6f 75 73 65 20 78 20 63  |    :. mouse x c|
00033d70  6f 6f 72 64 0d 1b 51 2b  6d 73 67 62 6c 6b 25 21  |oord..Q+msgblk%!|
00033d80  33 32 20 3d 20 30 20 20  20 20 20 20 20 20 20 3a  |32 = 0         :|
00033d90  f4 20 6d 6f 75 73 65 20  79 20 63 6f 6f 72 64 0d  |. mouse y coord.|
00033da0  1b 52 34 6d 73 67 62 6c  6b 25 21 33 36 20 3d 20  |.R4msgblk%!36 = |
00033db0  32 35 36 20 20 20 20 20  20 20 3a f4 20 65 73 74  |256       :. est|
00033dc0  69 6d 61 74 65 64 20 73  69 7a 65 20 6f 66 20 66  |imated size of f|
00033dd0  69 6c 65 0d 1b 53 27 6d  73 67 62 6c 6b 25 21 34  |ile..S'msgblk%!4|
00033de0  30 20 3d 20 46 69 6c 65  54 79 70 65 25 20 3a f4  |0 = FileType% :.|
00033df0  20 66 69 6c 65 20 74 79  70 65 0d 1b 54 27 24 28  | file type..T'$(|
00033e00  6d 73 67 62 6c 6b 25 20  2b 20 34 34 29 20 3d 20  |msgblk% + 44) = |
00033e10  22 50 72 69 6e 74 4f 75  74 22 20 2b 20 bd 28 30  |"PrintOut" + .(0|
00033e20  29 0d 1b 55 15 2a 7c 69  66 64 65 66 20 54 72 61  |)..U.*|ifdef Tra|
00033e30  63 65 49 6e 69 74 0d 1b  56 46 f2 73 68 65 6c 6c  |ceInit..VF.shell|
00033e40  5f 54 72 61 63 65 66 30  28 22 4d 65 73 73 61 67  |_Tracef0("Messag|
00033e50  65 53 65 6e 64 50 72 69  6e 74 53 61 76 65 3a 53  |eSendPrintSave:S|
00033e60  65 6e 64 69 6e 67 20 50  72 69 6e 74 53 61 76 65  |ending PrintSave|
00033e70  20 6d 65 73 73 61 67 65  2e 2e 22 29 0d 1b 57 0b  | message..")..W.|
00033e80  2a 7c 65 6e 64 69 66 0d  1b 58 3a c8 99 20 22 57  |*|endif..X:.. "W|
00033e90  69 6d 70 5f 53 65 6e 64  4d 65 73 73 61 67 65 22  |imp_SendMessage"|
00033ea0  2c 31 38 2c 6d 73 67 62  6c 6b 25 2c 6d 73 67 62  |,18,msgblk%,msgb|
00033eb0  6c 6b 25 21 32 30 2c 6d  73 67 62 6c 6b 25 21 32  |lk%!20,msgblk%!2|
00033ec0  34 0d 1b 59 23 f2 73 68  65 6c 6c 5f 48 65 61 70  |4..Y#.shell_Heap|
00033ed0  42 6c 6f 63 6b 52 65 74  75 72 6e 28 6d 73 67 62  |BlockReturn(msgb|
00033ee0  6c 6b 25 29 0d 1b 5a 05  e1 0d 1b 5b 05 3a 0d 1b  |lk%)..Z....[.:..|
00033ef0  5c 24 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |\$*|Stop PROCshe|
00033f00  6c 6c 5f 44 6f 53 65 6e  64 50 72 69 6e 74 53 61  |ll_DoSendPrintSa|
00033f10  76 65 0d 1b 5d 04 0d 1b  5e 25 2a 7c 53 74 61 72  |ve..]...^%*|Star|
00033f20  74 20 50 52 4f 43 73 68  65 6c 6c 5f 48 61 6e 64  |t PROCshell_Hand|
00033f30  6c 65 50 72 69 6e 74 46  69 6c 65 0d 1b 5f 21 dd  |lePrintFile.._!.|
00033f40  20 f2 73 68 65 6c 6c 5f  48 61 6e 64 6c 65 50 72  | .shell_HandlePr|
00033f50  69 6e 74 46 69 6c 65 28  5f 51 25 29 0d 1b 60 15  |intFile(_Q%)..`.|
00033f60  2a 7c 69 66 64 65 66 20  54 72 61 63 65 49 6e 69  |*|ifdef TraceIni|
00033f70  74 0d 1b 61 40 f2 73 68  65 6c 6c 5f 54 72 61 63  |t..a@.shell_Trac|
00033f80  65 66 30 28 22 48 61 6e  64 6c 65 50 72 69 6e 74  |ef0("HandlePrint|
00033f90  46 69 6c 65 3a 4d 65 73  73 61 67 65 5f 50 72 69  |File:Message_Pri|
00033fa0  6e 74 46 69 6c 65 20 72  65 63 65 69 76 65 64 22  |ntFile received"|
00033fb0  29 0d 1b 62 0b 2a 7c 65  6e 64 69 66 0d 1b 63 05  |)..b.*|endif..c.|
00033fc0  e1 0d 1b 64 05 3a 0d 1b  65 24 2a 7c 53 74 6f 70  |...d.:..e$*|Stop|
00033fd0  20 50 52 4f 43 73 68 65  6c 6c 5f 48 61 6e 64 6c  | PROCshell_Handl|
00033fe0  65 50 72 69 6e 74 46 69  6c 65 0d 1b 66 04 0d 1b  |ePrintFile..f...|
00033ff0  67 26 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |g&*|Start PROCsh|
00034000  65 6c 6c 5f 48 61 6e 64  6c 65 50 72 69 6e 74 45  |ell_HandlePrintE|
00034010  72 72 6f 72 0d 1b 68 22  dd 20 f2 73 68 65 6c 6c  |rror..h". .shell|
00034020  5f 48 61 6e 64 6c 65 50  72 69 6e 74 45 72 72 6f  |_HandlePrintErro|
00034030  72 28 5f 51 25 29 0d 1b  69 15 2a 7c 69 66 64 65  |r(_Q%)..i.*|ifde|
00034040  66 20 54 72 61 63 65 49  6e 69 74 0d 1b 6a 42 f2  |f TraceInit..jB.|
00034050  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 48  |shell_Tracef0("H|
00034060  61 6e 64 6c 65 50 72 69  6e 74 45 72 72 6f 72 3a  |andlePrintError:|
00034070  4d 65 73 73 61 67 65 5f  50 72 69 6e 74 45 72 72  |Message_PrintErr|
00034080  6f 72 20 72 65 63 65 69  76 65 64 22 29 0d 1b 6b  |or received")..k|
00034090  0b 2a 7c 65 6e 64 69 66  0d 1b 6c 05 e1 0d 1b 6d  |.*|endif..l....m|
000340a0  05 3a 0d 1b 6e 25 2a 7c  53 74 6f 70 20 50 52 4f  |.:..n%*|Stop PRO|
000340b0  43 73 68 65 6c 6c 5f 48  61 6e 64 6c 65 50 72 69  |Cshell_HandlePri|
000340c0  6e 74 45 72 72 6f 72 0d  1b 6f 04 0d 1b 70 28 2a  |ntError..o...p(*|
000340d0  7c 53 74 61 72 74 20 50  52 4f 43 73 68 65 6c 6c  ||Start PROCshell|
000340e0  5f 48 61 6e 64 6c 65 50  72 69 6e 74 54 79 70 65  |_HandlePrintType|
000340f0  4f 64 64 0d 1b 71 24 dd  20 f2 73 68 65 6c 6c 5f  |Odd..q$. .shell_|
00034100  48 61 6e 64 6c 65 50 72  69 6e 74 54 79 70 65 4f  |HandlePrintTypeO|
00034110  64 64 28 5f 51 25 29 0d  1b 72 15 2a 7c 69 66 64  |dd(_Q%)..r.*|ifd|
00034120  65 66 20 54 72 61 63 65  49 6e 69 74 0d 1b 73 46  |ef TraceInit..sF|
00034130  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
00034140  48 61 6e 64 6c 65 50 72  69 6e 74 54 79 70 65 4f  |HandlePrintTypeO|
00034150  64 64 3a 4d 65 73 73 61  67 65 5f 50 72 69 6e 74  |dd:Message_Print|
00034160  54 79 70 65 4f 64 64 20  72 65 63 65 69 76 65 64  |TypeOdd received|
00034170  22 29 0d 1b 74 0b 2a 7c  65 6e 64 69 66 0d 1b 75  |")..t.*|endif..u|
00034180  05 e1 0d 1b 76 05 3a 0d  1b 77 27 2a 7c 53 74 6f  |....v.:..w'*|Sto|
00034190  70 20 50 52 4f 43 73 68  65 6c 6c 5f 48 61 6e 64  |p PROCshell_Hand|
000341a0  6c 65 50 72 69 6e 74 54  79 70 65 4f 64 64 0d 1b  |lePrintTypeOdd..|
000341b0  78 04 0d 1b 79 26 2a 7c  53 74 61 72 74 20 50 52  |x...y&*|Start PR|
000341c0  4f 43 73 68 65 6c 6c 5f  48 61 6e 64 6c 65 53 65  |OCshell_HandleSe|
000341d0  74 50 72 69 6e 74 65 72  0d 1b 7a 22 dd 20 f2 73  |tPrinter..z". .s|
000341e0  68 65 6c 6c 5f 48 61 6e  64 6c 65 53 65 74 50 72  |hell_HandleSetPr|
000341f0  69 6e 74 65 72 28 5f 51  25 29 0d 1b 7b 15 2a 7c  |inter(_Q%)..{.*||
00034200  69 66 64 65 66 20 54 72  61 63 65 49 6e 69 74 0d  |ifdef TraceInit.|
00034210  1b 7c 42 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |.|B.shell_Tracef|
00034220  30 28 22 48 61 6e 64 6c  65 53 65 74 50 72 69 6e  |0("HandleSetPrin|
00034230  74 65 72 3a 4d 65 73 73  61 67 65 5f 53 65 74 50  |ter:Message_SetP|
00034240  72 69 6e 74 65 72 20 72  65 63 65 69 76 65 64 22  |rinter received"|
00034250  29 0d 1b 7d 0b 2a 7c 65  6e 64 69 66 0d 1b 7e 05  |)..}.*|endif..~.|
00034260  e1 0d 1b 7f 05 3a 0d 1b  80 25 2a 7c 53 74 6f 70  |.....:...%*|Stop|
00034270  20 50 52 4f 43 73 68 65  6c 6c 5f 48 61 6e 64 6c  | PROCshell_Handl|
00034280  65 53 65 74 50 72 69 6e  74 65 72 0d 1b 81 04 0d  |eSetPrinter.....|
00034290  1b 82 27 2a 7c 53 74 61  72 74 20 46 4e 73 68 65  |..'*|Start FNshe|
000342a0  6c 6c 5f 50 72 69 6e 74  65 72 44 72 69 76 65 72  |ll_PrinterDriver|
000342b0  4c 6f 61 64 65 64 0d 1b  83 20 dd 20 a4 73 68 65  |Loaded... . .she|
000342c0  6c 6c 5f 50 72 69 6e 74  65 72 44 72 69 76 65 72  |ll_PrinterDriver|
000342d0  4c 6f 61 64 65 64 0d 1b  84 0b ea 20 66 6c 67 73  |Loaded..... flgs|
000342e0  25 0d 1b 85 1f c8 99 20  22 58 50 44 72 69 76 65  |%...... "XPDrive|
000342f0  72 5f 49 6e 66 6f 22 20  b8 20 3b 66 6c 67 73 25  |r_Info" . ;flgs%|
00034300  0d 1b 86 1b e7 20 66 6c  67 73 25 20 80 20 31 20  |..... flgs% . 1 |
00034310  8c 20 3d 20 a3 20 8b 20  3d 20 b9 0d 1b 87 05 3a  |. = . . = .....:|
00034320  0d 1b 88 26 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |...&*|Stop FNshe|
00034330  6c 6c 5f 50 72 69 6e 74  65 72 44 72 69 76 65 72  |ll_PrinterDriver|
00034340  4c 6f 61 64 65 64 0d 1b  89 04 0d 1b 8a 28 2a 7c  |Loaded.......(*||
00034350  53 74 61 72 74 20 46 4e  73 68 65 6c 6c 5f 50 72  |Start FNshell_Pr|
00034360  69 6e 74 65 72 44 72 69  76 65 72 47 65 74 4e 61  |interDriverGetNa|
00034370  6d 65 0d 1b 8b 21 dd 20  a4 73 68 65 6c 6c 5f 50  |me...!. .shell_P|
00034380  72 69 6e 74 65 72 44 72  69 76 65 72 47 65 74 4e  |rinterDriverGetN|
00034390  61 6d 65 0d 1b 8c 11 ea  20 66 6c 67 73 25 2c 6e  |ame..... flgs%,n|
000343a0  61 6d 65 25 0d 1b 8d 28  c8 99 20 22 58 50 44 72  |ame%...(.. "XPDr|
000343b0  69 76 65 72 5f 49 6e 66  6f 22 20 b8 20 2c 2c 2c  |iver_Info" . ,,,|
000343c0  2c 6e 61 6d 65 25 3b 66  6c 67 73 25 0d 1b 8e 32  |,name%;flgs%...2|
000343d0  e7 20 66 6c 67 73 25 20  80 20 31 20 8c 20 3d 20  |. flgs% . 1 . = |
000343e0  22 22 20 8b 20 3d 20 a4  73 68 65 6c 6c 5f 47 65  |"" . = .shell_Ge|
000343f0  74 53 74 72 69 6e 67 28  6e 61 6d 65 25 29 0d 1b  |tString(name%)..|
00034400  8f 05 3a 0d 1b 90 27 2a  7c 53 74 6f 70 20 46 4e  |..:...'*|Stop FN|
00034410  73 68 65 6c 6c 5f 50 72  69 6e 74 65 72 44 72 69  |shell_PrinterDri|
00034420  76 65 72 47 65 74 4e 61  6d 65 0d 1b 91 04 0d 1b  |verGetName......|
00034430  92 23 2a 7c 53 74 61 72  74 20 46 4e 73 68 65 6c  |.#*|Start FNshel|
00034440  6c 5f 49 63 6f 6e 47 65  74 42 47 43 6f 6c 6f 75  |l_IconGetBGColou|
00034450  72 0d 1b 93 25 dd 20 a4  73 68 65 6c 6c 5f 49 63  |r...%. .shell_Ic|
00034460  6f 6e 47 65 74 42 47 43  6f 6c 6f 75 72 28 77 68  |onGetBGColour(wh|
00034470  25 2c 69 68 25 29 0d 1b  94 14 ea 20 63 6f 6c 25  |%,ih%)..... col%|
00034480  2c 69 63 6f 6e 5f 62 6c  6b 25 0d 1b 95 27 69 63  |,icon_blk%...'ic|
00034490  6f 6e 5f 62 6c 6b 25 3d  a4 73 68 65 6c 6c 5f 48  |on_blk%=.shell_H|
000344a0  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 34 30  |eapBlockFetch(40|
000344b0  29 0d 1b 96 13 69 63 6f  6e 5f 62 6c 6b 25 21 30  |)....icon_blk%!0|
000344c0  3d 77 68 25 0d 1b 97 13  69 63 6f 6e 5f 62 6c 6b  |=wh%....icon_blk|
000344d0  25 21 34 3d 69 68 25 0d  1b 98 25 c8 99 20 22 57  |%!4=ih%...%.. "W|
000344e0  69 6d 70 5f 47 65 74 49  63 6f 6e 53 74 61 74 65  |imp_GetIconState|
000344f0  22 2c 2c 69 63 6f 6e 5f  62 6c 6b 25 0d 1b 99 27  |",,icon_blk%...'|
00034500  63 6f 6c 25 20 3d 20 28  69 63 6f 6e 5f 62 6c 6b  |col% = (icon_blk|
00034510  25 21 32 34 20 3e 3e 20  32 38 29 20 80 20 25 31  |%!24 >> 28) . %1|
00034520  31 31 31 0d 1b 9a 25 f2  73 68 65 6c 6c 5f 48 65  |111...%.shell_He|
00034530  61 70 42 6c 6f 63 6b 52  65 74 75 72 6e 28 69 63  |apBlockReturn(ic|
00034540  6f 6e 5f 62 6c 6b 25 29  0d 1b 9b 0a 3d 20 63 6f  |on_blk%)....= co|
00034550  6c 25 0d 1b 9c 05 3a 0d  1b 9d 22 2a 7c 53 74 6f  |l%....:..."*|Sto|
00034560  70 20 46 4e 73 68 65 6c  6c 5f 49 63 6f 6e 47 65  |p FNshell_IconGe|
00034570  74 42 47 43 6f 6c 6f 75  72 0d 1b 9e 04 0d 1b 9f  |tBGColour.......|
00034580  23 2a 7c 53 74 61 72 74  20 46 4e 73 68 65 6c 6c  |#*|Start FNshell|
00034590  5f 49 63 6f 6e 47 65 74  46 47 43 6f 6c 6f 75 72  |_IconGetFGColour|
000345a0  0d 1b a0 25 dd 20 a4 73  68 65 6c 6c 5f 49 63 6f  |...%. .shell_Ico|
000345b0  6e 47 65 74 46 47 43 6f  6c 6f 75 72 28 77 68 25  |nGetFGColour(wh%|
000345c0  2c 69 68 25 29 0d 1b a1  14 ea 20 63 6f 6c 25 2c  |,ih%)..... col%,|
000345d0  69 63 6f 6e 5f 62 6c 6b  25 0d 1b a2 27 69 63 6f  |icon_blk%...'ico|
000345e0  6e 5f 62 6c 6b 25 3d a4  73 68 65 6c 6c 5f 48 65  |n_blk%=.shell_He|
000345f0  61 70 42 6c 6f 63 6b 46  65 74 63 68 28 34 30 29  |apBlockFetch(40)|
00034600  0d 1b a3 13 69 63 6f 6e  5f 62 6c 6b 25 21 30 3d  |....icon_blk%!0=|
00034610  77 68 25 0d 1b a4 13 69  63 6f 6e 5f 62 6c 6b 25  |wh%....icon_blk%|
00034620  21 34 3d 69 68 25 0d 1b  a5 25 c8 99 20 22 57 69  |!4=ih%...%.. "Wi|
00034630  6d 70 5f 47 65 74 49 63  6f 6e 53 74 61 74 65 22  |mp_GetIconState"|
00034640  2c 2c 69 63 6f 6e 5f 62  6c 6b 25 0d 1b a6 27 63  |,,icon_blk%...'c|
00034650  6f 6c 25 20 3d 20 28 69  63 6f 6e 5f 62 6c 6b 25  |ol% = (icon_blk%|
00034660  21 32 34 20 3e 3e 20 32  34 29 20 80 20 25 31 31  |!24 >> 24) . %11|
00034670  31 31 0d 1b a7 25 f2 73  68 65 6c 6c 5f 48 65 61  |11...%.shell_Hea|
00034680  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 69 63 6f  |pBlockReturn(ico|
00034690  6e 5f 62 6c 6b 25 29 0d  1b a8 0a 3d 20 63 6f 6c  |n_blk%)....= col|
000346a0  25 0d 1b a9 05 3a 0d 1b  aa 22 2a 7c 53 74 6f 70  |%....:..."*|Stop|
000346b0  20 46 4e 73 68 65 6c 6c  5f 49 63 6f 6e 47 65 74  | FNshell_IconGet|
000346c0  46 47 43 6f 6c 6f 75 72  0d 1b ab 04 0d 1b ac 25  |FGColour.......%|
000346d0  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
000346e0  6c 5f 41 74 74 61 63 68  50 6f 70 75 70 4d 65 6e  |l_AttachPopupMen|
000346f0  75 0d 1b ad 42 dd 20 f2  73 68 65 6c 6c 5f 41 74  |u...B. .shell_At|
00034700  74 61 63 68 50 6f 70 75  70 4d 65 6e 75 28 77 68  |tachPopupMenu(wh|
00034710  25 2c 6d 65 6e 75 69 63  25 2c 64 69 73 70 69 63  |%,menuic%,dispic|
00034720  25 2c 6d 65 6e 75 25 2c  6e 6f 74 69 66 79 5f 66  |%,menu%,notify_f|
00034730  6e 24 29 0d 1b ae 47 f2  73 68 65 6c 6c 5f 44 6f  |n$)...G.shell_Do|
00034740  41 74 74 61 63 68 50 6f  70 75 70 48 61 6e 64 6c  |AttachPopupHandl|
00034750  65 72 28 77 68 25 2c 6d  65 6e 75 69 63 25 2c 64  |er(wh%,menuic%,d|
00034760  69 73 70 69 63 25 2c 6d  65 6e 75 25 2c 6e 6f 74  |ispic%,menu%,not|
00034770  69 66 79 5f 66 6e 24 2c  30 29 0d 1b af 05 e1 0d  |ify_fn$,0)......|
00034780  1b b0 05 3a 0d 1b b1 24  2a 7c 53 74 6f 70 20 50  |...:...$*|Stop P|
00034790  52 4f 43 73 68 65 6c 6c  5f 41 74 74 61 63 68 50  |ROCshell_AttachP|
000347a0  6f 70 75 70 4d 65 6e 75  0d 1b b2 04 0d 1b b3 2b  |opupMenu.......+|
000347b0  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
000347c0  6c 5f 41 74 74 61 63 68  43 6f 6c 6f 75 72 50 6f  |l_AttachColourPo|
000347d0  70 75 70 4d 65 6e 75 0d  1b b4 48 dd 20 f2 73 68  |pupMenu...H. .sh|
000347e0  65 6c 6c 5f 41 74 74 61  63 68 43 6f 6c 6f 75 72  |ell_AttachColour|
000347f0  50 6f 70 75 70 4d 65 6e  75 28 77 68 25 2c 6d 65  |PopupMenu(wh%,me|
00034800  6e 75 69 63 25 2c 64 69  73 70 69 63 25 2c 6d 65  |nuic%,dispic%,me|
00034810  6e 75 25 2c 6e 6f 74 69  66 79 5f 66 6e 24 29 0d  |nu%,notify_fn$).|
00034820  1b b5 47 f2 73 68 65 6c  6c 5f 44 6f 41 74 74 61  |..G.shell_DoAtta|
00034830  63 68 50 6f 70 75 70 48  61 6e 64 6c 65 72 28 77  |chPopupHandler(w|
00034840  68 25 2c 6d 65 6e 75 69  63 25 2c 64 69 73 70 69  |h%,menuic%,dispi|
00034850  63 25 2c 6d 65 6e 75 25  2c 6e 6f 74 69 66 79 5f  |c%,menu%,notify_|
00034860  66 6e 24 2c 31 29 0d 1b  b6 05 e1 0d 1b b7 05 3a  |fn$,1).........:|
00034870  0d 1b b8 2a 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |...**|Stop PROCs|
00034880  68 65 6c 6c 5f 41 74 74  61 63 68 43 6f 6c 6f 75  |hell_AttachColou|
00034890  72 50 6f 70 75 70 4d 65  6e 75 0d 1b b9 04 0d 1b  |rPopupMenu......|
000348a0  ba 28 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |.(*|Start PROCsh|
000348b0  65 6c 6c 5f 41 74 74 61  63 68 50 6f 70 75 70 48  |ell_AttachPopupH|
000348c0  61 6e 64 6c 65 72 0d 1b  bb 4d dd 20 f2 73 68 65  |andler...M. .she|
000348d0  6c 6c 5f 44 6f 41 74 74  61 63 68 50 6f 70 75 70  |ll_DoAttachPopup|
000348e0  48 61 6e 64 6c 65 72 28  77 68 25 2c 6d 65 6e 75  |Handler(wh%,menu|
000348f0  69 63 25 2c 64 69 73 70  69 63 25 2c 6d 65 6e 75  |ic%,dispic%,menu|
00034900  25 2c 6e 6f 74 69 66 79  5f 66 6e 24 2c 66 6c 61  |%,notify_fn$,fla|
00034910  67 25 29 0d 1b bc 14 ea  20 65 5f 62 6c 6b 25 2c  |g%)..... e_blk%,|
00034920  6f 66 66 73 65 74 25 0d  1b bd 04 0d 1b be 2b f4  |offset%.......+.|
00034930  20 66 6f 72 6d 61 74 20  6f 66 20 70 6f 70 75 70  | format of popup|
00034940  20 68 61 6e 64 6c 65 72  20 65 76 65 6e 74 20 62  | handler event b|
00034950  6c 6f 63 6b 2e 2e 0d 1b  bf 05 f4 0d 1b c0 13 f4  |lock............|
00034960  20 45 61 63 68 20 45 76  65 6e 74 2e 2e 2e 0d 1b  | Each Event.....|
00034970  c1 18 f4 20 20 2b 30 30  20 77 69 6e 64 6f 77 20  |...  +00 window |
00034980  68 61 6e 64 6c 65 0d 1b  c2 23 f4 20 20 2b 30 34  |handle...#.  +04|
00034990  20 69 63 6f 6e 20 68 61  6e 64 6c 65 20 6f 66 20  | icon handle of |
000349a0  6d 65 6e 75 20 69 63 6f  6e 0d 1b c3 39 f4 20 20  |menu icon...9.  |
000349b0  2b 30 38 20 69 63 6f 6e  20 68 61 6e 64 6c 65 20  |+08 icon handle |
000349c0  6f 66 20 76 61 6c 75 65  20 64 69 73 70 6c 61 79  |of value display|
000349d0  20 69 63 6f 6e 20 28 2d  31 20 69 66 20 6e 6f 6e  | icon (-1 if non|
000349e0  65 29 0d 1b c4 53 f4 20  20 2b 31 32 20 70 6f 69  |e)...S.  +12 poi|
000349f0  6e 74 65 72 20 74 6f 20  62 6c 6f 63 6b 20 63 6f  |nter to block co|
00034a00  6e 74 61 69 6e 69 6e 67  20 46 4e 20 6e 61 6d 65  |ntaining FN name|
00034a10  20 74 6f 20 63 61 6c 6c  20 6f 6e 20 76 61 6c 75  | to call on valu|
00034a20  65 20 63 68 61 6e 67 65  20 28 2d 31 20 69 66 20  |e change (-1 if |
00034a30  6e 6f 6e 65 29 0d 1b c5  42 f4 20 20 2b 31 36 20  |none)...B.  +16 |
00034a40  66 6c 61 67 20 77 6f 72  64 20 62 69 74 20 30 20  |flag word bit 0 |
00034a50  73 65 74 20 69 66 20 61  20 77 69 6d 70 20 63 6f  |set if a wimp co|
00034a60  6c 6f 75 72 20 6d 65 6e  75 20 69 73 20 62 65 69  |lour menu is bei|
00034a70  6e 67 20 75 73 65 64 0d  1b c6 20 f4 20 20 2b 32  |ng used... .  +2|
00034a80  30 20 6d 65 6e 75 20 68  61 6e 64 6c 65 20 74 6f  |0 menu handle to|
00034a90  20 61 74 74 61 63 68 0d  1b c7 04 0d 1b c8 44 6f  | attach.......Do|
00034aa0  66 66 73 65 74 25 20 3d  20 a4 73 68 65 6c 6c 5f  |ffset% = .shell_|
00034ab0  47 65 74 45 76 65 6e 74  4c 69 73 74 4f 66 66 73  |GetEventListOffs|
00034ac0  65 74 32 28 77 68 25 2c  6d 65 6e 75 69 63 25 2c  |et2(wh%,menuic%,|
00034ad0  5f 55 25 20 2b 20 33 34  30 2c 32 34 2c b9 29 0d  |_U% + 340,24,.).|
00034ae0  1b c9 3b 65 5f 62 6c 6b  25 20 20 3d 20 5f 55 25  |..;e_blk%  = _U%|
00034af0  21 33 34 30 20 2b 20 6f  66 66 73 65 74 25 20 3a  |!340 + offset% :|
00034b00  20 f4 20 70 6f 69 6e 74  65 72 20 74 6f 20 65 76  | . pointer to ev|
00034b10  65 6e 74 20 6c 69 73 74  2e 2e 0d 1b ca 04 0d 1b  |ent list........|
00034b20  cb 16 65 5f 62 6c 6b 25  21 30 30 20 20 20 20 3d  |..e_blk%!00    =|
00034b30  20 77 68 25 0d 1b cc 1a  65 5f 62 6c 6b 25 21 30  | wh%....e_blk%!0|
00034b40  34 20 20 20 20 3d 20 6d  65 6e 75 69 63 25 0d 1b  |4    = menuic%..|
00034b50  cd 1a 65 5f 62 6c 6b 25  21 30 38 20 20 20 20 3d  |..e_blk%!08    =|
00034b60  20 64 69 73 70 69 63 25  0d 1b ce 18 e7 20 6e 6f  | dispic%..... no|
00034b70  74 69 66 79 5f 66 6e 24  20 3c 3e 20 22 22 20 8c  |tify_fn$ <> "" .|
00034b80  0d 1b cf 3b 20 20 65 5f  62 6c 6b 25 21 31 32 20  |...;  e_blk%!12 |
00034b90  20 20 20 3d 20 a4 73 68  65 6c 6c 5f 48 65 61 70  |   = .shell_Heap|
00034ba0  42 6c 6f 63 6b 46 65 74  63 68 28 a9 6e 6f 74 69  |BlockFetch(.noti|
00034bb0  66 79 5f 66 6e 24 20 2b  20 31 29 0d 1b d0 1f 20  |fy_fn$ + 1).... |
00034bc0  20 24 28 65 5f 62 6c 6b  25 21 31 32 29 20 3d 20  | $(e_blk%!12) = |
00034bd0  6e 6f 74 69 66 79 5f 66  6e 24 0d 1b d1 05 cc 0d  |notify_fn$......|
00034be0  1b d2 15 20 20 65 5f 62  6c 6b 25 21 31 32 20 20  |...  e_blk%!12  |
00034bf0  3d 20 2d 31 0d 1b d3 05  cd 0d 1b d4 15 65 5f 62  |= -1.........e_b|
00034c00  6c 6b 25 21 31 36 20 3d  20 66 6c 61 67 25 0d 1b  |lk%!16 = flag%..|
00034c10  d5 15 65 5f 62 6c 6b 25  21 32 30 20 3d 20 6d 65  |..e_blk%!20 = me|
00034c20  6e 75 25 0d 1b d6 04 0d  1b d7 46 e7 20 77 68 25  |nu%.......F. wh%|
00034c30  20 3e 20 30 20 80 20 6d  65 6e 75 69 63 25 20 3e  | > 0 . menuic% >|
00034c40  3d 20 30 20 8c 20 f2 73  68 65 6c 6c 5f 49 63 6f  |= 0 . .shell_Ico|
00034c50  6e 53 65 74 42 75 74 74  6f 6e 54 79 70 65 28 77  |nSetButtonType(w|
00034c60  68 25 2c 6d 65 6e 75 69  63 25 2c 33 29 0d 1b d8  |h%,menuic%,3)...|
00034c70  05 e1 0d 1b d9 05 3a 0d  1b da 29 2a 7c 53 74 6f  |......:...)*|Sto|
00034c80  70 20 50 52 4f 43 73 68  65 6c 6c 5f 44 6f 41 74  |p PROCshell_DoAt|
00034c90  74 61 63 68 50 6f 70 75  70 48 61 6e 64 6c 65 72  |tachPopupHandler|
00034ca0  0d 1b db 04 0d 1b dc 23  2a 7c 53 74 61 72 74 20  |.......#*|Start |
00034cb0  50 52 4f 43 73 68 65 6c  6c 5f 44 6f 50 6f 70 75  |PROCshell_DoPopu|
00034cc0  70 53 65 6c 65 63 74 0d  1b dd 27 dd 20 f2 73 68  |pSelect...'. .sh|
00034cd0  65 6c 6c 5f 44 6f 50 6f  70 75 70 53 65 6c 65 63  |ell_DoPopupSelec|
00034ce0  74 28 5f 51 25 2c 6f 66  66 73 65 74 25 29 0d 1b  |t(_Q%,offset%)..|
00034cf0  de 17 ea 20 65 5f 62 6c  6b 25 2c 6e 6f 74 69 66  |... e_blk%,notif|
00034d00  79 5f 66 6e 24 0d 1b df  2b f4 20 66 6f 72 6d 61  |y_fn$...+. forma|
00034d10  74 20 6f 66 20 70 6f 70  75 70 20 68 61 6e 64 6c  |t of popup handl|
00034d20  65 72 20 65 76 65 6e 74  20 62 6c 6f 63 6b 2e 2e  |er event block..|
00034d30  0d 1b e0 05 f4 0d 1b e1  13 f4 20 45 61 63 68 20  |.......... Each |
00034d40  45 76 65 6e 74 2e 2e 2e  0d 1b e2 18 f4 20 20 2b  |Event........  +|
00034d50  30 30 20 77 69 6e 64 6f  77 20 68 61 6e 64 6c 65  |00 window handle|
00034d60  0d 1b e3 23 f4 20 20 2b  30 34 20 69 63 6f 6e 20  |...#.  +04 icon |
00034d70  68 61 6e 64 6c 65 20 6f  66 20 6d 65 6e 75 20 69  |handle of menu i|
00034d80  63 6f 6e 0d 1b e4 39 f4  20 20 2b 30 38 20 69 63  |con...9.  +08 ic|
00034d90  6f 6e 20 68 61 6e 64 6c  65 20 6f 66 20 76 61 6c  |on handle of val|
00034da0  75 65 20 64 69 73 70 6c  61 79 20 69 63 6f 6e 20  |ue display icon |
00034db0  28 2d 31 20 69 66 20 6e  6f 6e 65 29 0d 1b e5 53  |(-1 if none)...S|
00034dc0  f4 20 20 2b 31 32 20 70  6f 69 6e 74 65 72 20 74  |.  +12 pointer t|
00034dd0  6f 20 62 6c 6f 63 6b 20  63 6f 6e 74 61 69 6e 69  |o block containi|
00034de0  6e 67 20 46 4e 20 6e 61  6d 65 20 74 6f 20 63 61  |ng FN name to ca|
00034df0  6c 6c 20 6f 6e 20 76 61  6c 75 65 20 63 68 61 6e  |ll on value chan|
00034e00  67 65 20 28 2d 31 20 69  66 20 6e 6f 6e 65 29 0d  |ge (-1 if none).|
00034e10  1b e6 42 f4 20 20 2b 31  36 20 66 6c 61 67 20 77  |..B.  +16 flag w|
00034e20  6f 72 64 20 62 69 74 20  30 20 73 65 74 20 69 66  |ord bit 0 set if|
00034e30  20 61 20 77 69 6d 70 20  63 6f 6c 6f 75 72 20 6d  | a wimp colour m|
00034e40  65 6e 75 20 69 73 20 62  65 69 6e 67 20 75 73 65  |enu is being use|
00034e50  64 0d 1b e7 20 f4 20 20  2b 32 30 20 6d 65 6e 75  |d... .  +20 menu|
00034e60  20 68 61 6e 64 6c 65 20  74 6f 20 61 74 74 61 63  | handle to attac|
00034e70  68 0d 1b e8 1f 65 5f 62  6c 6b 25 20 20 3d 20 5f  |h....e_blk%  = _|
00034e80  55 25 21 33 34 30 20 2b  20 6f 66 66 73 65 74 25  |U%!340 + offset%|
00034e90  0d 1b e9 04 0d 1b ea 16  e7 20 65 5f 62 6c 6b 25  |......... e_blk%|
00034ea0  21 31 32 20 3d 20 2d 31  20 8c 0d 1b eb 54 20 20  |!12 = -1 ....T  |
00034eb0  f4 20 6e 6f 20 6e 6f 74  69 66 79 20 46 4e 2c 20  |. no notify FN, |
00034ec0  6a 75 73 74 20 70 75 74  20 6d 65 6e 75 20 74 65  |just put menu te|
00034ed0  78 74 20 69 6e 74 6f 20  64 69 73 70 6c 61 79 20  |xt into display |
00034ee0  69 63 6f 6e 2c 20 6f 72  20 73 65 74 20 62 61 63  |icon, or set bac|
00034ef0  6b 67 72 6f 75 6e 64 20  63 6f 6c 6f 75 72 0d 1b  |kground colour..|
00034f00  ec 37 20 20 f4 20 6f 66  20 64 69 73 70 6c 61 79  |.7  . of display|
00034f10  20 69 63 6f 6e 20 69 66  20 61 20 63 6f 6c 6f 75  | icon if a colou|
00034f20  72 20 6d 65 6e 75 20 69  73 20 69 6e 76 6f 6c 76  |r menu is involv|
00034f30  65 64 2e 2e 2e 0d 1b ed  17 20 20 e7 20 65 5f 62  |ed.......  . e_b|
00034f40  6c 6b 25 21 31 36 20 3d  20 30 20 8c 0d 1b ee 56  |lk%!16 = 0 ....V|
00034f50  20 20 20 20 f2 73 68 65  6c 6c 5f 49 63 6f 6e 50  |    .shell_IconP|
00034f60  75 74 44 61 74 61 28 21  65 5f 62 6c 6b 25 2c 65  |utData(!e_blk%,e|
00034f70  5f 62 6c 6b 25 21 30 38  2c a4 73 68 65 6c 6c 5f  |_blk%!08,.shell_|
00034f80  4d 65 6e 75 47 65 74 49  74 65 6d 54 65 78 74 28  |MenuGetItemText(|
00034f90  65 5f 62 6c 6b 25 21 32  30 2c 21 5f 51 25 29 2c  |e_blk%!20,!_Q%),|
00034fa0  b9 29 0d 1b ef 07 20 20  cc 0d 1b f0 36 20 20 20  |.)....  ....6   |
00034fb0  20 f2 73 68 65 6c 6c 5f  49 63 6f 6e 53 65 74 42  | .shell_IconSetB|
00034fc0  47 43 6f 6c 6f 75 72 28  21 65 5f 62 6c 6b 25 2c  |GColour(!e_blk%,|
00034fd0  65 5f 62 6c 6b 25 21 30  38 2c 21 5f 51 25 29 0d  |e_blk%!08,!_Q%).|
00034fe0  1b f1 07 20 20 cd 0d 1b  f2 05 cc 0d 1b f3 1f 20  |...  .......... |
00034ff0  20 6e 6f 74 69 66 79 5f  66 6e 24 20 3d 20 24 28  | notify_fn$ = $(|
00035000  65 5f 62 6c 6b 25 21 31  32 29 0d 1b f4 05 cd 0d  |e_blk%!12)......|
00035010  1b f5 05 e1 0d 1b f6 05  3a 0d 1b f7 22 2a 7c 53  |........:..."*|S|
00035020  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 44 6f  |top PROCshell_Do|
00035030  50 6f 70 75 70 53 65 6c  65 63 74 0d 1b f8 04 0d  |PopupSelect.....|
00035040  1b f9 1d 2a 7c 53 74 61  72 74 20 46 4e 73 68 65  |...*|Start FNshe|
00035050  6c 6c 5f 33 44 45 6e 61  62 6c 65 64 0d 1b fa 16  |ll_3DEnabled....|
00035060  dd 20 a4 73 68 65 6c 6c  5f 33 44 45 6e 61 62 6c  |. .shell_3DEnabl|
00035070  65 64 0d 1b fb 0f ea 20  76 61 6c 25 2c 5f 33 64  |ed..... val%,_3d|
00035080  25 0d 1b fc 1b e7 20 5f  55 25 21 31 30 30 20 80  |%..... _U%!100 .|
00035090  20 28 31 20 3c 3c 20 31  30 29 20 8c 0d 1b fd 1c  | (1 << 10) .....|
000350a0  20 20 f4 20 52 49 53 43  20 4f 53 20 33 20 64 65  |  . RISC OS 3 de|
000350b0  74 65 63 74 65 64 2e 2e  0d 1b fe 23 20 20 c8 99  |tected.....#  ..|
000350c0  20 22 4f 53 5f 42 79 74  65 22 2c 31 36 31 2c 31  | "OS_Byte",161,1|
000350d0  34 30 20 b8 20 2c 2c 76  61 6c 25 0d 1b ff 28 20  |40 . ,,val%...( |
000350e0  20 e7 20 28 76 61 6c 25  20 80 20 31 29 20 8c 20  | . (val% . 1) . |
000350f0  5f 33 64 25 20 3d 20 b9  20 8b 20 5f 33 64 25 20  |_3d% = . . _3d% |
00035100  3d 20 a3 0d 1c 00 05 cc  0d 1c 01 16 20 20 f4 20  |= ..........  . |
00035110  4e 6f 20 52 49 53 43 20  4f 53 20 33 2e 2e 0d 1c  |No RISC OS 3....|
00035120  02 0e 20 20 5f 33 64 25  20 3d 20 a3 0d 1c 03 05  |..  _3d% = .....|
00035130  cd 0d 1c 04 0a 3d 20 5f  33 64 25 0d 1c 05 05 3a  |.....= _3d%....:|
00035140  0d 1c 06 1c 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |....*|Stop FNshe|
00035150  6c 6c 5f 33 44 45 6e 61  62 6c 65 64 0d 1c 07 04  |ll_3DEnabled....|
00035160  0d 1c 08 20 2a 7c 53 74  61 72 74 20 50 52 4f 43  |... *|Start PROC|
00035170  73 68 65 6c 6c 5f 4d 65  6e 75 44 65 6c 65 74 65  |shell_MenuDelete|
00035180  0d 1c 09 2b dd 20 f2 73  68 65 6c 6c 5f 4d 65 6e  |...+. .shell_Men|
00035190  75 44 65 6c 65 74 65 28  68 61 6e 64 6c 65 25 2c  |uDelete(handle%,|
000351a0  72 65 63 75 72 73 69 76  65 25 29 0d 1c 0a 21 ea  |recursive%)...!.|
000351b0  20 70 74 72 25 2c 6c 69  73 74 5f 73 69 7a 65 25  | ptr%,list_size%|
000351c0  2c 65 76 65 6e 74 5f 6c  69 73 74 25 0d 1c 0b 14  |,event_list%....|
000351d0  e7 20 68 61 6e 64 6c 65  25 20 3c 3e 20 30 20 8c  |. handle% <> 0 .|
000351e0  0d 1c 0c 2e 20 20 c8 99  20 22 58 4d 65 6e 75 55  |....  .. "XMenuU|
000351f0  74 69 6c 5f 44 65 6c 65  74 65 22 2c 68 61 6e 64  |til_Delete",hand|
00035200  6c 65 25 2c 72 65 63 75  72 73 69 76 65 25 0d 1c  |le%,recursive%..|
00035210  0d 34 20 20 6c 69 73 74  5f 73 69 7a 65 25 20 20  |.4  list_size%  |
00035220  3d 20 a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |= .shell_HeapBlo|
00035230  63 6b 49 6e 66 6f 28 5f  55 25 21 31 32 29 20 2d  |ckInfo(_U%!12) -|
00035240  20 38 0d 1c 0e 1a 20 20  65 76 65 6e 74 5f 6c 69  | 8....  event_li|
00035250  73 74 25 20 3d 20 5f 55  25 21 31 32 0d 1c 0f 07  |st% = _U%!12....|
00035260  20 20 f5 0d 1c 10 2e 20  20 20 20 e7 20 28 65 76  |  .....    . (ev|
00035270  65 6e 74 5f 6c 69 73 74  25 21 28 70 74 72 25 20  |ent_list%!(ptr% |
00035280  2b 20 38 29 20 3d 20 68  61 6e 64 6c 65 25 29 20  |+ 8) = handle%) |
00035290  8c 0d 1c 11 50 20 20 20  20 20 20 65 76 65 6e 74  |....P      event|
000352a0  5f 6c 69 73 74 25 21 28  70 74 72 25 20 2b 20 38  |_list%!(ptr% + 8|
000352b0  29 20 3d 20 30 20 3a f4  20 72 65 6d 6f 76 65 20  |) = 0 :. remove |
000352c0  72 65 66 65 72 65 6e 63  65 20 74 6f 20 6d 65 6e  |reference to men|
000352d0  75 20 68 61 6e 64 6c 65  20 28 64 65 74 61 63 68  |u handle (detach|
000352e0  29 0d 1c 12 09 20 20 20  20 cc 0d 1c 13 14 20 20  |)....    .....  |
000352f0  20 20 20 20 70 74 72 25  20 2b 3d 20 34 38 0d 1c  |    ptr% += 48..|
00035300  14 09 20 20 20 20 cd 0d  1c 15 1c 20 20 fd 20 28  |..    .....  . (|
00035310  70 74 72 25 20 3e 3d 20  6c 69 73 74 5f 73 69 7a  |ptr% >= list_siz|
00035320  65 25 29 0d 1c 16 05 cd  0d 1c 17 05 e1 0d 1c 18  |e%).............|
00035330  05 3a 0d 1c 19 1f 2a 7c  53 74 6f 70 20 50 52 4f  |.:....*|Stop PRO|
00035340  43 73 68 65 6c 6c 5f 4d  65 6e 75 44 65 6c 65 74  |Cshell_MenuDelet|
00035350  65 0d 1c 1a 04 0d 1c 1b  2c 2a 7c 53 74 61 72 74  |e.......,*|Start|
00035360  20 50 52 4f 43 73 68 65  6c 6c 5f 48 61 6e 64 6c  | PROCshell_Handl|
00035370  65 41 74 74 61 63 68 65  64 44 61 74 61 53 61 76  |eAttachedDataSav|
00035380  65 0d 1c 1c 30 dd 20 f2  73 68 65 6c 6c 5f 48 61  |e...0. .shell_Ha|
00035390  6e 64 6c 65 41 74 74 61  63 68 65 64 44 61 74 61  |ndleAttachedData|
000353a0  53 61 76 65 28 5f 51 25  2c 77 68 25 2c 69 68 25  |Save(_Q%,wh%,ih%|
000353b0  29 0d 1c 1d 30 ea 20 65  5f 6f 66 66 73 65 74 25  |)...0. e_offset%|
000353c0  2c 62 6c 6b 25 2c 6e 61  6d 65 5f 69 63 25 2c 5f  |,blk%,name_ic%,_|
000353d0  6e 61 6d 65 24 2c 74 65  6d 70 25 2c 76 6f 69 64  |name$,temp%,void|
000353e0  25 0d 1c 1e 35 f4 20 63  68 65 63 6b 20 66 69 6c  |%...5. check fil|
000353f0  65 6e 61 6d 65 20 69 6e  20 69 63 6f 6e 20 69 66  |ename in icon if|
00035400  20 64 61 74 61 73 61 76  65 20 65 76 65 6e 74 20  | datasave event |
00035410  65 78 69 73 74 73 0d 1c  1f 15 f4 20 69 63 6f 6e  |exists..... icon|
00035420  20 77 61 73 20 30 2e 2e  2e 2e 2e 0d 1c 20 25 f2  | was 0....... %.|
00035430  73 68 65 6c 6c 5f 44 61  74 61 53 61 76 65 43 68  |shell_DataSaveCh|
00035440  65 63 6b 4e 61 6d 65 28  77 68 25 2c 69 68 25 29  |eckName(wh%,ih%)|
00035450  0d 1c 21 44 f4 20 63 68  65 63 6b 20 69 66 20 61  |..!D. check if a|
00035460  6e 20 65 76 65 6e 74 20  68 61 73 20 62 65 65 6e  |n event has been|
00035470  20 72 65 67 69 73 74 65  72 65 64 20 66 6f 72 20  | registered for |
00035480  77 68 65 6e 20 74 68 65  20 64 72 61 67 20 65 6e  |when the drag en|
00035490  64 73 2e 2e 0d 1c 22 3f  65 5f 6f 66 66 73 65 74  |ds...."?e_offset|
000354a0  25 20 3d 20 a4 73 68 65  6c 6c 5f 47 65 74 45 76  |% = .shell_GetEv|
000354b0  65 6e 74 4c 69 73 74 4f  66 66 73 65 74 28 77 68  |entListOffset(wh|
000354c0  25 2c 2d 31 2c 5f 55 25  20 2b 20 37 32 2c 32 34  |%,-1,_U% + 72,24|
000354d0  2c a3 29 0d 1c 23 16 e7  20 65 5f 6f 66 66 73 65  |,.)..#.. e_offse|
000354e0  74 25 20 3e 3d 20 30 20  8c 0d 1c 24 1f 20 20 62  |t% >= 0 ...$.  b|
000354f0  6c 6b 25 20 3d 20 5f 55  25 21 37 32 20 2b 20 65  |lk% = _U%!72 + e|
00035500  5f 6f 66 66 73 65 74 25  0d 1c 25 18 20 20 6e 61  |_offset%..%.  na|
00035510  6d 65 5f 69 63 25 20 3d  20 62 6c 6b 25 21 31 36  |me_ic% = blk%!16|
00035520  0d 1c 26 31 20 20 5f 6e  61 6d 65 24 20 20 20 3d  |..&1  _name$   =|
00035530  20 a4 73 68 65 6c 6c 5f  49 63 6f 6e 47 65 74 44  | .shell_IconGetD|
00035540  61 74 61 28 77 68 25 2c  6e 61 6d 65 5f 69 63 25  |ata(wh%,name_ic%|
00035550  29 0d 1c 27 18 20 20 74  65 6d 70 25 20 20 20 20  |)..'.  temp%    |
00035560  3d 20 62 6c 6b 25 21 32  30 0d 1c 28 3a 20 20 e7  |= blk%!20..(:  .|
00035570  20 24 74 65 6d 70 25 20  3c 3e 20 22 22 20 8c 20  | $temp% <> "" . |
00035580  76 6f 69 64 25 20 3d 20  a0 28 22 46 4e 22 20 2b  |void% = .("FN" +|
00035590  20 24 74 65 6d 70 25 2b  22 28 5f 6e 61 6d 65 24  | $temp%+"(_name$|
000355a0  29 22 29 0d 1c 29 05 cd  0d 1c 2a 05 e1 0d 1c 2b  |)")..)....*....+|
000355b0  05 3a 0d 1c 2c 2b 2a 7c  53 74 6f 70 20 50 52 4f  |.:..,+*|Stop PRO|
000355c0  43 73 68 65 6c 6c 5f 48  61 6e 64 6c 65 41 74 74  |Cshell_HandleAtt|
000355d0  61 63 68 65 64 44 61 74  61 53 61 76 65 0d ff     |achedDataSave..|
000355df