Home » Archimedes archive » Acorn Computing » 1994 08 subscription disc.adf » 9408s » Shareware/Event/!ShellSys/ShellLib

Shareware/Event/!ShellSys/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 » Acorn Computing » 1994 08 subscription disc.adf » 9408s
Filename: Shareware/Event/!ShellSys/ShellLib
Read OK:
File size: 2510C bytes
Load address: 0000
Exec address: 0000
File contents
    1*|Start FNshell_LibraryVersion
    2DEF FNshell_LibraryVersion
    3=1.20*100
    4:
    5*|Stop FNshell_LibraryVersion
    6
    7*|Start PROCshell_Error
    8DEF PROCshell_Error
    9IF _error_flag%=3 THEN
   10  PROCshell_ErrorBox("Unexpected error:- "+REPORT$+" Internal error code "+STR$ERL)
   11  PROCshell_TraceOff
   12  PROCshell_TraceExit
   13ELSE
   14  PROCshell_ErrorBox(REPORT$)
   15ENDIF
   16_error_flag%=3
   17SYS "Hourglass_Smash"
   18ENDPROC
   19:
   20*|Stop PROCshell_Error
   21
   22*|Start PROCshell_OK
   23DEF PROCshell_OK(e$)
   24_error_flag%=1
   25ERROR 1,e$
   26ENDPROC
   27:
   28*|Stop PROCshell_OK
   29*|Start PROCshell_ErrorBox
   30DEF PROCshell_ErrorBox(r$)
   31LOCAL r%,err_blk%
   32err_blk%=FNshell_HeapBlockFetch(260)
   33!err_blk%=ERR:$(err_blk%+4)=r$+CHR$(0)
   34SYS "Wimp_ReportError",err_blk%,_error_flag%,FNshell_GetAppName TO r%
   35IF r%=2 THEN _closedown%=TRUE
   36PROCshell_HeapBlockReturn(err_blk%)
   37ENDPROC
   38:
   39*|Stop PROCshell_ErrorBox
   40*|Start FNshell_GetLastSecureFileName
   41DEF FNshell_GetLastSecureFileName
   42LOCAL temp%
   43temp%=_U%!80
   44IF temp%=0 THEN =""
   45=$temp%
   46:
   47*|Stop FNshell_GetLastSecureFileName
   48*|Start FNshell_GetString
   49DEF FNshell_GetString(Address%)
   50LOCAL String$,Len%
   51WHILE ((Address%?Len%)>31 AND Len%<255)
   52  String$+=CHR$(Address%?Len%)
   53  Len%+=1
   54ENDWHILE
   55=String$
   56:
   57*|Stop FNshell_GetString
   58*|Start FNshell_GetEventHandler
   59DEF FNshell_GetEventHandler(wh%,ic%,e_type%)
   60LOCAL ptr%,event_list%,found%,list_size%,fn$
   61IF wh%=-1 THEN wh%=-2
   62list_size%=FNshell_HeapBlockInfo(_U%!12)-8
   63ptr%=0
   64found%=FALSE
   65event_list%=_U%!12
   66fn$=""
   67REPEAT
   68  IF (event_list%!ptr%=wh%) THEN
   69    CASE event_list%!(ptr%+4) OF
   70    WHEN -1
   71      REM window handle found, icon handle is -1
   72      REM check that a pointer has been defined to a heap block
   73      REM containing a function name (if it is 0 then no event
   74      REM defined)...
   75      IF event_list%!(ptr%+(12+(e_type%*4)))>&8000 THEN
   76        fn$=$(event_list%!(ptr%+(12+(e_type%*4))))
   77        found%=TRUE
   78      ELSE
   79        ptr%+=48
   80      ENDIF
   81    OTHERWISE
   82      REM check icon handle in event block as well...
   83      IF event_list%!(ptr%+4)=ic% THEN
   84        REM window/icon handle event block found...
   85        REM check that a pointer has been defined to a heap block
   86        REM containing a function name (if it is 0 then no event
   87        REM defined)...
   88        IF event_list%!(ptr%+(12+(e_type%*4)))>&8000 THEN
   89          fn$=$(event_list%!(ptr%+(12+(e_type%*4))))
   90          found%=TRUE
   91        ELSE
   92          ptr%+=48
   93        ENDIF
   94      ELSE
   95        ptr%+=48
   96      ENDIF
   97    ENDCASE
   98  ELSE
   99    ptr%+=48
  100  ENDIF
  101UNTIL ((ptr%>=list_size%) OR found%)
  102=fn$
  103:
  104*|Stop FNshell_GetEventHandler
  105
  106*|Start FNshell_GetEventMenu
  107DEF FNshell_GetEventMenu(button%,wh%,ic%)
  108LOCAL ptr%,event_list%,found%,list_size%,menu%
  109IF wh%=-1 THEN wh%=-2
  110list_size%=FNshell_HeapBlockInfo(_U%!12)-8
  111ptr%=0
  112found%=FALSE
  113event_list%=_U%!12
  114fn$=""
  115REPEAT
  116  IF (event_list%!ptr%=wh%) THEN
  117    IF event_list%!(ptr%+4) = ic% THEN
  118      menu%=event_list%!(ptr%+8)
  119      IF menu%=-2 THEN menu%=_U%!252
  120      found%=TRUE
  121    ELSE
  122      IF event_list%!(ptr%+4) = -1 THEN
  123        IF button%=2 THEN
  124          menu%=event_list%!(ptr%+8)
  125          IF menu%=-2 THEN menu%=_U%!252
  126          found%=TRUE
  127        ELSE
  128          ptr%+=48
  129        ENDIF
  130      ELSE
  131        ptr%+=48
  132      ENDIF
  133    ENDIF
  134  ELSE
  135    ptr%+=48
  136  ENDIF
  137UNTIL (ptr%>=list_size% OR found%)
  138=menu%
  139:
  140*|Stop FNshell_GetEventMenu
  141
  142*|Start FNshell_GetEventListOffset
  143DEF FNshell_GetEventListOffset(wh%,ih%,event_list%,rec_size%,add%)
  144REM find offset of data in event list block given the window/icon
  145REM handles. returns -1 if no events found, -2 if heapblock not defined
  146REM if add% is FALSE. when add is TRUE then the list is extended and the
  147REM offset to the new record is returned.
  148LOCAL list_size%,ptr%,found%,offset%,empty%,temp%
  149IF (!event_list%=0 AND add%=FALSE) THEN =-2:REM no heapblock defined
  150IF (!event_list%=0) THEN
  151  REM no heap block defined and add flag is true...
  152  !event_list%=FNshell_HeapBlockFetch(rec_size%)
  153  temp%=!event_list%:temp%!0=0:temp%!4=0
  154  =0
  155ENDIF
  156list_size%=FNshell_HeapBlockInfo(!event_list%)-8
  157ptr%=0:found%=FALSE:offset%=-1:empty%=-1
  158temp%=!event_list%
  159REPEAT
  160  REM PROCshell_Tracef0("GetEventListOffset:window handle=&"+STR$~temp%!ptr%)
  161  REM when scanning list note offset of first empty record for use when
  162  REM adding a new event to the list. Empty records have 0 for both
  163  REM window and icon handles
  164  IF empty%<0 THEN
  165    IF (temp%!ptr%=0 AND temp%!ptr%+4=0) THEN empty%=ptr%
  166  ENDIF
  167  IF (temp%!ptr%=wh%) THEN
  168    REM events attached to no particular icon are registered with
  169    REM an icon handle of -1
  170    REM PROCshell_Tracef0("GetEventListOffset:window handle found")
  171    IF ih%=-1 THEN
  172      REM icon handle is -1, so event has been found
  173      REM PROCshell_Tracef0("GetEventListOffset:icon handle is -1")
  174      offset%=ptr%
  175      found%=TRUE
  176    ELSE
  177      REM check icon handle in event block as well..
  178      *|ifdef PROCshell_TraceInit
  179      PROCshell_Tracef0("GetEventListOffset:icon handle is not -1")
  180      *|endif
  181      IF temp%!(ptr%+4)=ih% THEN
  182          offset%=ptr%
  183          found%=TRUE
  184      ELSE
  185        ptr%+=rec_size%
  186      ENDIF
  187    ENDIF
  188  ELSE
  189    REM no match, so check next event..
  190    ptr%+=rec_size%
  191  ENDIF
  192UNTIL ((ptr%>=list_size%) OR found%)
  193IF found% THEN
  194  REM PROCshell_Tracef0("GetEventListOffset:Event found")
  195ELSE
  196  REM PROCshell_Tracef0("GetEventListOffset:End of event list - event not found")
  197ENDIF
  198IF (offset%=-1 AND add%) THEN
  199  IF empty%<0 THEN
  200    REM no empty records found to use for the new one
  201    offset%=list_size%
  202    !event_list%=FNshell_HeapBlockExtend(!event_list%,rec_size%)
  203    temp%=!event_list%
  204    temp%+=offset%:temp%!0=0:temp%!4=0
  205  ELSE
  206    REM re-use old deleted event
  207    offset%=empty%
  208  ENDIF
  209ENDIF
  210=offset%
  211:
  212*|Stop FNshell_GetEventListOffset
  213*|Start PROCshell_AttachPane
  214DEF PROCshell_AttachPane(wh%,RETURN pane_handle%,flags%,x_off%,y_off%)
  215LOCAL blk%,offset%,temp%,nr_pane_events%,pane_flags%
  216PROCshell_Tracef0("AttachPane:Attaching Pane Handler")
  217REM first check that the flags of the pane window are correctly set..
  218pane_flags%=FNshell_WindowGetFlags(pane_handle%)
  219IF (pane_flags% AND 1<<5)=0 THEN
  220  PROCshell_Tracef0("AttachPane:'Pane' bit of pane window is not set, fixing..")
  221  PROCshell_WindowToggleFlags(pane_handle%,1<<5)
  222ENDIF
  223IF (pane_flags% AND 1<<1) THEN
  224  PROCshell_Tracef0("AttachPane:'Moveable' bit of pane window is set, fixing..")
  225  PROCshell_WindowToggleFlags(pane_handle%,1<<1)
  226ENDIF
  227offset%=FNshell_GetEventListOffset(wh%,-1,_U%+92,24,FALSE)
  228IF offset%<0 THEN
  229  REM no existing pane event block
  230  PROCshell_Tracef0("AttachPane:Creating pane event block")
  231  offset%=FNshell_GetEventListOffset(wh%,-1,_U%+92,24,TRUE)
  232  blk%=_U%!92+offset%
  233  blk%!0=wh%:blk%!4=-1
  234  blk%!8=FNshell_HeapBlockFetch(4)
  235  blk%!12=FNshell_HeapBlockFetch(4)
  236  blk%!16=FNshell_HeapBlockFetch(4)
  237  blk%!20=FNshell_HeapBlockFetch(4)
  238  temp%=blk%!8:!temp%=-1
  239  temp%=blk%!12:!temp%=-1
  240  temp%=blk%!16:!temp%=-1
  241  temp%=blk%!20:!temp%=-1
  242ENDIF
  243blk%=_U%!92+offset%
  244temp%=blk%!8:ctr%=0:nr_pane_events%=0
  245WHILE temp%!ctr%<>-1
  246  ctr%+=4
  247  nr_pane_events%+=1
  248ENDWHILE
  249blk%!8=FNshell_HeapBlockExtend(blk%!8,4)
  250temp%=blk%!8:temp%!(nr_pane_events%*4)=pane_handle%
  251temp%!((nr_pane_events%+1)*4)=-1
  252blk%!12=FNshell_HeapBlockExtend(blk%!12,4)
  253temp%=blk%!12:temp%!(nr_pane_events%*4)=flags%
  254temp%!((nr_pane_events%+1)*4)=-1
  255blk%!16=FNshell_HeapBlockExtend(blk%!16,4)
  256temp%=blk%!16:temp%!(nr_pane_events%*4)=x_off%
  257temp%!((nr_pane_events%+1)*4)=-1
  258blk%!20=FNshell_HeapBlockExtend(blk%!20,4)
  259temp%=blk%!20:temp%!(nr_pane_events%*4)=y_off%
  260temp%!((nr_pane_events%+1)*4)=-1
  261ENDPROC
  262:
  263*|Stop PROCshell_AttachPane
  264
  265*|Start PROCshell_AttachDataLoad
  266DEF PROCshell_AttachDataLoad(wh%,ih%,type%,fn$,no_load%)
  267LOCAL blk%,temp%,offset%
  268PROCshell_Tracef0("AttachDataLoad:Attaching DataLoad Handler")
  269IF wh%=-1 THEN wh%=-2
  270IF no_load% THEN type%=type% OR 1<<31
  271offset%=FNshell_GetEventListOffset(wh%,ih%,_U%+96,16,TRUE)
  272REM modify above to set first two words to 0 to denote a new
  273REM empty event block
  274blk%=_U%!96+offset%
  275
  276IF blk%!0=0 AND blk%!4=0 THEN
  277  REM this is first event......
  278  PROCshell_Tracef0("AttachDataLoad:This is the first DataLoad Event...")
  279  blk%!0=wh%:blk%!4=ih%
  280  blk%!8=FNshell_HeapBlockFetch(8)
  281  temp%=blk%!8
  282  temp%!0=type%:temp%!4=-1
  283  blk%!12=FNshell_HeapBlockFetch(8)
  284  temp%=blk%!12
  285  temp%!0=FNshell_HeapBlockFetch(LEN(fn$)+1)
  286  temp%!4=-1
  287  temp%=temp%!0:$temp%=fn$
  288ELSE
  289  REM adding new filetype/function to an existing event
  290  REM extend filetype heapblock...
  291  PROCshell_Tracef0("AttachDataLoad:This is another DataLoad Event...")
  292  blk%!8=FNshell_HeapBlockExtend(blk%!8,4)
  293  REM and function name heapblock...
  294  blk%!12=FNshell_HeapBlockExtend(blk%!12,4)
  295  REM find out how many filetypes there are now...
  296  ctr%=0:temp%=blk%!8
  297  WHILE temp%!ctr%<>-1
  298    ctr%+=4
  299  ENDWHILE
  300  temp%!ctr%=type%:temp%!(ctr%+4)=-1
  301  temp%=blk%!12
  302  temp%!ctr%=FNshell_HeapBlockFetch(LENfn$+1)
  303  temp%=temp%!ctr%:$temp%=fn$
  304ENDIF
  305ENDPROC
  306:
  307*|Stop PROCshell_AttachDataLoad
  308
  309*|Start PROCshell_AttachDataSave
  310DEF PROCshell_AttachDataSave(wh%,ih%,address%,type%,name_ic%,fn$)
  311LOCAL blk%,temp%,offset%
  312IF address%=0 THEN address%=100:REM estimated size - wild guess..
  313PROCshell_Tracef0("AttachDataSave:Attaching DataSave Handler to icon "+STR$ih%+" in window &"+STR$~wh%)
  314PROCshell_Tracef0("AttachDataSave:Handler function is '"+fn$+"'")
  315offset%=FNshell_GetEventListOffset(wh%,ih%,_U%+72,24,TRUE)
  316blk%=_U%!72+offset%
  317blk%!0=wh%:blk%!4=ih%:blk%!8=address%:blk%!12=type%
  318blk%!16=name_ic%
  319blk%!20=FNshell_HeapBlockFetch(LEN(fn$)+1)
  320temp%=blk%!20:$temp%=fn$
  321CASE type% OF
  322  WHEN &FF9
  323    REM kludge for sprite files as first word should not
  324    REM be saved
  325    IF address%>&8000 THEN
  326      _U%!136=FNshell_HeapBlockInfo(address%)-8
  327    ELSE
  328      _U%!136=address%
  329    ENDIF
  330  OTHERWISE
  331    IF address%>&8000 THEN
  332      _U%!136=FNshell_HeapBlockInfo(address%)-4
  333    ELSE
  334      _U%!136=address%
  335    ENDIF
  336ENDCASE
  337_U%!140=type%
  338REM _U%!144 holds address of file heapblock buffer. If address%<&8000 then
  339REM file is not in a buffer and address% is actually the estimated size..
  340_U%!144=address%
  341ENDPROC
  342:
  343*|Stop PROCshell_AttachDataSave
  344
  345*|Start PROCshell_AttachMenu
  346DEF PROCshell_AttachMenu(wh%,ic%,menu%,shift%,ctrl%,alt%)
  347IF wh%>0 AND ic%>=0 THEN PROCshell_IconSetButtonType(wh%,ic%,1)
  348PROCshell_EventAdd(wh%,ic%,0,menu%,"")
  349ENDPROC
  350:
  351*|Stop PROCshell_AttachMenu
  352
  353*|Start PROCshell_AttachMenuMaker
  354DEF PROCshell_AttachMenuMaker(wh%,ic%,fn$)
  355PROCshell_Tracef0("AttachMenuMaker:Attaching menumaker function '"+fn$+"'")
  356PROCshell_EventAdd(wh%,ic%,1,0,fn$)
  357ENDPROC
  358:
  359*|Stop PROCshell_AttachMenuMaker
  360
  361*|Start PROCshell_AttachMenuDBox
  362DEF PROCshell_AttachMenuDBox(item%,window$,preopenfn$,postopenfn$)
  363REM Check current submenu handle. We should release any memory
  364REM allocated by previous calls (when I work out how to do it)
  365LOCAL blk%,temp%,addr%
  366IF NOT FNshell_WindowLoaded(window$) THEN ERROR 99,FNshell_MessageOneArg("SHELLMSG03",window$)
  367blk%=FNshell_HeapBlockFetch(12)
  368blk%!0=FNshell_HeapBlockFetch(LENwindow$+1)
  369temp%=blk%!0:$temp%=window$
  370blk%!4=FNshell_HeapBlockFetch(LENpreopenfn$+1)
  371temp%=blk%!4:$temp%=preopenfn$
  372blk%!8=FNshell_HeapBlockFetch(LENpostopenfn$+1)
  373temp%=blk%!8:$temp%=postopenfn$
  374REM Store address of heapblock in submenu pointer word of
  375REM menu item definition. Cunning huh........
  376SYS "MenuUtil_SubMenu",item%,blk%
  377SYS "MenuUtil_Warning",,TRUE
  378ENDPROC
  379:
  380*|Stop PROCshell_AttachMenuDBox
  381
  382*|Start PROCshell_AttachClickSelect
  383DEF PROCshell_AttachClickSelect(wh%,ic%,fn$)
  384PROCshell_EventAdd(wh%,ic%,2,0,fn$)
  385ENDPROC
  386:
  387*|Stop PROCshell_AttachClickSelect
  388*|Start PROCshell_AttachClickAdjust
  389DEF PROCshell_AttachClickAdjust(wh%,ic%,fn$)
  390PROCshell_EventAdd(wh%,ic%,3,0,fn$)
  391ENDPROC
  392:
  393*|Stop PROCshell_AttachClickAdjust
  394*|Start PROCshell_AttachUserRedraw
  395DEF PROCshell_AttachUserRedraw(RETURN wh%,fn$)
  396LOCAL blk%,f%,old_handle%
  397blk%=FNshell_HeapBlockFetch(40)
  398!blk%=wh%:SYS "Wimp_GetWindowState",,blk%
  399f%=blk%!32
  400PROCshell_HeapBlockReturn(blk%)
  401PROCshell_Tracef0("AttachUserRedraw:flag%=&"+STR$~f%)
  402IF (f% AND 1<<4) THEN
  403  PROCshell_Tracef0("AttachUserRedraw:auto redraw set!!")
  404  REM store original handle in case the wimp allocates a new handle..
  405  old_handle%=wh%
  406  PROCshell_WindowToggleFlags(wh%,1<<4)
  407  IF wh%<>old_handle% THEN
  408    PROCshell_UpdateWindowHandle(old_handle%,wh%)
  409  ENDIF
  410ENDIF
  411PROCshell_EventAdd(wh%,-1,4,0,fn$)
  412ENDPROC
  413:
  414*|Stop PROCshell_AttachUserRedraw
  415*|Start PROCshell_AttachKeypress
  416DEF PROCshell_AttachKeypress(wh%,ic%,fn$)
  417PROCshell_EventAdd(wh%,ic%,5,0,fn$)
  418ENDPROC
  419:
  420*|Stop PROCshell_AttachKeypress
  421*|Start PROCshell_AttachDrag
  422DEF PROCshell_AttachDrag(wh%,ic%,est_size%,fn$)
  423PROCshell_EventAdd(wh%,ic%,6,0,fn$)
  424ENDPROC
  425:
  426*|Stop PROCshell_AttachDrag
  427*|Start PROCshell_AttachHelpTag
  428DEF PROCshell_AttachHelpTag(wh%,ic%,tag$)
  429PROCshell_EventAdd(wh%,ic%,8,0,tag$)
  430ENDPROC
  431:
  432*|Stop PROCshell_AttachHelpTag
  433*|Start PROCshell_EventAdd
  434DEF PROCshell_EventAdd(wh%,ic%,e_type%,menu%,fn$)
  435LOCAL ptr%,fn%,event_list%,list_size%,found%
  436LOCAL fn_addr%
  437ptr%=0:found%=FALSE
  438IF wh%=-1 THEN wh%=-2
  439list_size%=FNshell_HeapBlockInfo(_U%!12)-8
  440event_list%=_U%!12
  441REPEAT
  442  IF (event_list%!ptr%=wh%) THEN
  443    CASE event_list%!(ptr%+4) OF
  444    WHEN -1
  445      found%=TRUE
  446    OTHERWISE
  447      IF event_list%!(ptr%+4)=ic% THEN
  448        found%=TRUE
  449      ELSE
  450        ptr%+=48
  451      ENDIF
  452    ENDCASE
  453  ELSE
  454    ptr%+=48
  455  ENDIF
  456UNTIL (ptr%>=list_size% OR found%)
  457IF found%=FALSE THEN
  458 ptr%=0
  459 WHILE (event_list%!ptr%<>0 )
  460   ptr%+=48
  461   IF ptr%>=list_size% THEN
  462     _U%!12=FNshell_HeapBlockExtend(_U%!12,48)
  463     event_list%=_U%!12
  464     event_list%!(ptr%+0)=0
  465     event_list%!(ptr%+4)=0
  466     event_list%!(ptr%+8)=0
  467     event_list%!(ptr%+12)=0
  468     event_list%!(ptr%+16)=0
  469     event_list%!(ptr%+20)=0
  470     event_list%!(ptr%+24)=0
  471     event_list%!(ptr%+28)=0
  472     event_list%!(ptr%+32)=0
  473     event_list%!(ptr%+36)=0
  474     event_list%!(ptr%+40)=0
  475     event_list%!(ptr%+44)=0
  476   ENDIF
  477 ENDWHILE
  478ENDIF
  479event_list%!(ptr%+0)=wh%
  480event_list%!(ptr%+4)=ic%
  481IF menu%<>0 THEN
  482  event_list%!(ptr%+8)=menu%
  483ENDIF
  484fn_addr%=ptr%+(12+(e_type%*4))
  485IF event_list%!fn_addr%<>0 THEN
  486  PROCshell_HeapBlockReturn(event_list%!fn_addr%)
  487ENDIF
  488fn%=FNshell_HeapBlockFetch(LENfn$+1)
  489$fn%=fn$
  490event_list%!fn_addr%=fn%
  491ENDPROC
  492:
  493*|Stop PROCshell_EventAdd
  494*|Start PROCshell_EventDeleteAll
  495DEF PROCshell_EventDeleteAll(wh%)
  496LOCAL ptr%,menu%,found%,list_size%,event_list%,loop%
  497ptr%=0:menu%=0:found%=FALSE
  498IF wh%=-1 THEN wh%=-2
  499list_size%=FNshell_HeapBlockInfo(_U%!12)-8
  500event_list%=_U%!12
  501REPEAT
  502  IF (event_list%!ptr%=wh%) THEN
  503    found%=TRUE
  504  ELSE
  505    ptr%+=48
  506  ENDIF
  507UNTIL (ptr%>=list_size% OR found%)
  508IF found% THEN
  509  event_list%!(ptr%+0)=0
  510  event_list%!(ptr%+4)=0
  511  event_list%!(ptr%+8)=0
  512  FOR loop%=12 TO 44 STEP 4
  513    IF event_list%!(ptr%+loop%)<>0 THEN
  514      PROCshell_HeapBlockReturn(event_list%!(ptr%+loop%))
  515      event_list%!(ptr%+loop%)=0
  516    ENDIF
  517  NEXT loop%
  518ENDIF
  519REM remove all DataSave events for the current window...
  520PROCshell_Tracef0("EventDeleteAll:wh%=&"+STR$~wh%)
  521PROCshell_DeleteEventDataSave(wh%,-1)
  522PROCshell_DeleteEventBump(wh%,-1)
  523REM should reduce size of event list block if possible.......
  524ENDPROC
  525:
  526*|Stop PROCshell_EventDeleteAll
  527*|Start PROCshell_DeleteEventBump
  528DEF PROCshell_DeleteEventBump(wh%,ih%)
  529REM if I can find which words point to a heap block they could be
  530REM automatically detected and released. A general purpose routine
  531REM shell_DeleteEvent could then be written!
  532REM If ih%=-1 remove all events for window handle wh%
  533LOCAL offset%,blk%,list_size%,event_list%,temp%
  534event_list%=_U%!104
  535REPEAT
  536  offset%=FNshell_GetEventListOffset(wh%,ih%,_U%+104,16,FALSE)
  537  PROCshell_Tracef0("DeleteEventBump:offset%="+STR$offset%)
  538  IF offset%>=0 THEN
  539    IF ih%=-1 THEN
  540  PROCshell_Tracef0("DeleteEventBump:Deleting Bump Event (all events for window handle &"+STR$~wh%+")")
  541    ELSE
  542      PROCshell_Tracef0("DeleteEventBump:Deleting Bump Event (window handle was &"+STR$~wh%+" icon handle was "+STR$ih%+")")
  543    ENDIF
  544    REM event for window/icon is in list
  545    list_size%=FNshell_HeapBlockInfo(_U%!104)-8
  546    IF offset%=list_size%-16 THEN
  547      REM it is the last one in this list
  548      IF offset%=0 THEN
  549        REM only one event in the list
  550        info_blk%=event_list%!12
  551        temp%=info_blk%!12
  552        PROCshell_HeapBlockReturn(temp%!12)
  553        PROCshell_HeapBlockReturn(temp%!16)
  554        PROCshell_HeapBlockReturn(temp%)
  555        PROCshell_HeapBlockReturn(_U%!104)
  556        _U%!104=0
  557        PROCshell_Tracef0("DeleteEventDataSave:No Bump events now registered")
  558      ELSE
  559        REM more than one event in the list
  560        _U%!104=FNshell_HeapBlockExtend(_U%!104,-16)
  561      ENDIF
  562    ELSE
  563      REM not the last one in the list
  564      blk%=event_list%+offset%
  565      blk%!0=0:blk%!4=0:blk%!8=0
  566      info_blk%=blk%!12
  567      PROCshell_HeapBlockReturn(info_blk%!12)
  568      PROCshell_HeapBlockReturn(info_blk%!16)
  569      PROCshell_HeapBlockReturn(info_blk%)
  570    ENDIF
  571  ENDIF
  572  REM repeat loop until offset%=-1 (event not found)
  573  REM or offset%=-2 (event block doesn't exist)
  574UNTIL offset%<0
  575ENDPROC
  576:
  577*|Stop PROCshell_DeleteEventBump
  578*|Start PROCshell_DeleteEventDataSave
  579DEF PROCshell_DeleteEventDataSave(wh%,ih%)
  580REM if I can find which words point to a heap block they could be
  581REM automatically detected and released. A general purpose routine
  582REM shell_DeleteEvent could then be written!
  583REM If ih%=-1 remove all events for window handle wh%
  584LOCAL offset%,blk%,list_size%
  585REM PROCshell_Tracef0("DeleteEventDataSave:wh%=&"+STR$~wh%)
  586REM PROCshell_Tracef0("DeleteEventDataSave:ih%="+STR$ih%)
  587REPEAT
  588  offset%=FNshell_GetEventListOffset(wh%,ih%,_U%+72,24,FALSE)
  589  REM PROCshell_Tracef0("DeleteEventDataSave:offset%="+STR$offset%)
  590  IF offset%>=0 THEN
  591    IF ih%=-1 THEN
  592  PROCshell_Tracef0("DeleteEventDataSave:Deleting DataSave Event (all events for window handle &"+STR$~wh%+")")
  593    ELSE
  594  PROCshell_Tracef0("DeleteEventDataSave:Deleting DataSave Event (window handle was &"+STR$~wh%+" icon handle was "+STR$ih%+")")
  595    ENDIF
  596    REM event for window/icon is in list
  597    list_size%=FNshell_HeapBlockInfo(_U%!72)-8
  598    IF offset%=list_size%-24 THEN
  599      REM it is the last one in this list
  600      IF offset%=0 THEN
  601        REM only one event in the list
  602        PROCshell_HeapBlockReturn(_U%!72)
  603        _U%!72=0
  604
  605PROCshell_Tracef0("DeleteEventDataSave:No DataSave events now registered")
  606      ELSE
  607        REM more than one event in the list
  608        _U%!72=FNshell_HeapBlockExtend(_U%!72,-24)
  609      ENDIF
  610    ELSE
  611      REM not the last one in the list
  612      blk%=event_list%+offset%
  613      blk%!0=0:blk%!4=0:blk%!8=0:blk%!12=0:blk%!16=0
  614      PROCshell_HeapBlockReturn(blk%!20):blk%!20=0
  615    ENDIF
  616  ENDIF
  617  REM repeat loop until offset%=-1 (event not found)
  618  REM or offset%=-2 (event block doesn't exist)
  619UNTIL offset%<0
  620ENDPROC
  621:
  622*|Stop PROCshell_DeleteEventDataSave
  623*|Start FNshell_MessageNoArgs
  624DEF FNshell_MessageNoArgs(tag$)
  625=FNshell_MessageLookup(tag$,"","")
  626:
  627*|Stop FNshell_MessageNoArgs
  628*|Start FNshell_MessageOneArg
  629DEF FNshell_MessageOneArg(tag$,arg1$)
  630=FNshell_MessageLookup(tag$,arg1$,"")
  631:
  632*|Stop FNshell_MessageOneArg
  633*|Start FNshell_MessageLookup
  634DEF FNshell_MessageLookup(tag$,arg1$,arg2$)
  635LOCAL flags%,L%,m$,ms_text%,ms_desc%
  636IF LEFT$(tag$,8)="SHELLMSG" THEN
  637  ms_text%=_U%!284:ms_desc%=_U%!280
  638ELSE
  639  ms_text%=_U%!64:ms_desc%=_U%!68
  640ENDIF
  641SYS "XMessageTrans_Lookup",ms_desc%,tag$,ms_text%,256,arg1$,arg2$ TO ,,,L%;flags%
  642IF flags% AND 1 THEN
  643  REM m$="Message tag '"+tag$+"' not found in message file!"
  644ELSE
  645  ms_text%?L%=13
  646  m$=$(ms_text%)
  647ENDIF
  648=m$
  649:
  650*|Stop FNshell_MessageLookup
  651
  652*|Start FNshell_WimpInit
  653DEF FNshell_WimpInit(Version%,TaskName$)
  654LOCAL Taskid%
  655SYS "Wimp_Initialise",Version%,&4B534154,TaskName$ TO Version%,Taskid%
  656_U%!148=Taskid%
  657=Taskid%
  658:
  659*|Stop FNshell_WimpInit
  660
  661*|Start FNshell_WimpInit_I
  662DEF FNshell_WimpInit_I(Version%,TaskName$)
  663SYS "Wimp_Initialise",Version%,&4B534154,TaskName$ TO Version%,Taskid%
  664_U%!148=Taskid%
  665SYS "Interface_Initialise",Taskid%
  666=Taskid%
  667:
  668*|Stop FNshell_WimpInit_I
  669
  670*|Start PROCshell_WimpCloseDown_I
  671DEF PROCshell_WimpCloseDown_I(Taskid%)
  672PROCshell_LoseFonts
  673*|ifdef Using_FontMenu
  674IF _U%!240<>-1 THEN SYS "FontMenu_Release"
  675*|endif
  676SYS "Wimp_CloseDown",Taskid%,&4B534154
  677SYS "Interface_CloseDown",Taskid%
  678IF _U%!100 AND 1<<2 THEN SYS "Impulse_CloseDown",_U%!148
  679ENDPROC
  680:
  681*|Stop PROCshell_WimpCloseDown_I
  682*|Start PROCWimpCloseDown
  683DEF PROCWimpCloseDown(Taskid%)
  684PROCshell_LoseFonts
  685*|ifdef Using_FontMenu
  686IF _U%!240<>-1 THEN SYS "FontMenu_Release"
  687*|endif
  688SYS "Wimp_CloseDown",Taskid%,&4B534154
  689IF _U%!100 AND 1<<2 THEN SYS "Impulse_CloseDown",_U%!148
  690  
  691ENDPROC
  692:
  693*|Stop PROCWimpCloseDown
  694*|Start PROCshell_LoseFonts
  695DEF PROCshell_LoseFonts
  696LOCAL loop%,temp%
  697temp%=_U%!232
  698FOR loop%=0 TO 255
  699WHILE temp%?loop%>0
  700  SYS "Font_LoseFont",loop%
  701  temp%?loop%-=1
  702ENDWHILE
  703NEXT loop%
  704ENDPROC
  705:
  706*|Stop PROCshell_LoseFonts
  707*|Start FNshell_FindFont
  708DEF FNshell_FindFont(font$,pointsize%)
  709LOCAL f%,fontcounts%
  710fontcounts%=_U%!232
  711SYS "Font_FindFont",,font$,pointsize%*16,p*16,0,0 TO f%
  712fontcounts%?f%+=1
  713IF fontcounts%?f%>=255 THEN ERROR 99,FNshell_MessageNoArgs("SHELLMSG18")
  714=f%
  715:
  716*|Stop FNshell_FindFont
  717
  718*|Start PROCshell_Init
  719DEF PROCshell_Init
  720LOCAL elist%,loop%,temp%
  721DIM _U% 320,_shell_blk% 100
  722_Q%=FNshell_HeapBlockFetch(3000)
  723elist%=FNshell_HeapBlockFetch(48)
  724elist%!0 =0
  725elist%!12=0
  726elist%!16=0
  727elist%!20=0
  728elist%!24=0
  729elist%!28=0
  730elist%!32=0
  731elist%!36=0
  732elist%!40=0
  733elist%!44=0
  734_U%!0=0          :REM nr of templates
  735_U%!4=0          :REM pointer to window blocks
  736_U%!8=0          :REM pointer to menu block
  737_U%!12=elist%    :REM pointer to event list
  738_U%!16=1         :REM address of user sprite area
  739_U%!20=0         :REM handle of last dynamic window
  740_U%!24=0         :REM address of current menu
  741_U%!28=0         :REM last window clicked over (select & adjust)
  742_U%!32=0         :REM last icon clicked over   (select & adjust)
  743_U%!36=0         :REM last menu x position
  744_U%!40=0         :REM last menu y position
  745_U%!44=-1        :REM handle of tracefile
  746_U%!48=0         :REM FALSE=not tracing,TRUE = tracing
  747_U%!52=0         :REM last window clicked over (menu button)
  748_U%!56=0         :REM last icon   clicked over (menu button)
  749_U%!60=0         :REM pointer to 'HotKey' handler event list
  750_U%!64=0         :REM pointer to message block
  751_U%!68=0         :REM pointer to message block
  752_U%!72=0         :REM pointer to datasave event block
  753_U%!76=FNshell_HeapBlockFetch(256):REM message block
  754_U%!80=0         :REM pointer to last full file name
  755_U%!84=-1        :REM store my_ref from save operation
  756_U%!88=0         :REM ??????????
  757_U%!92=0         :REM pointer to pane handler event block
  758_U%!96=0         :REM pointer to dataload event block
  759_U%!100=0        :REM EvntShell bit flags
  760                 :REM bit 0  - DragASprite operation in progress
  761                 :REM bit 1  - Top bit dataload in progress
  762                 :REM bit 2  - Impulse module initialised
  763                 :REM bit 3  - ResFind in operation
  764_U%!104=0        :REM pointer to bump handler event block
  765_U%!108=-1       :REM ScrpRef%
  766_U%!112=-1       :REM FtchRef%
  767_U%!116=-1       :REM LoadRef%
  768_U%!120=-1       :REM SaveRef%
  769_U%!124=-1       :REM DragRef%
  770_U%!128=0        :REM RAMPtr%
  771_U%!132=0        :REM RAMSize%
  772_U%!136=-1       :REM FileSize% from last datasave message
  773_U%!140=-1       :REM FileType% from last datasave message
  774_U%!144=-1       :REM FileBuff% from last datasave message
  775_U%!148=0        :REM taskid%
  776_U%!152=0        :REM Buffer list of loaded files, -1 terminator
  777_U%!156=0        :REM HeapBlock with copy of DataSave message block
  778                 :REM for when RAM transfer fails
  779_U%!160=0        :REM Pointer to ModeChange event function
  780_U%!164=0        :REM Pointer to PaletteChange event function
  781_U%!168=0        :REM Pointer to TaskInitialise event function
  782_U%!172=0        :REM Pointer to TaskCloseDown event function
  783_U%!176=0        :REM Pointer to current menu title
  784_U%!180=0        :REM nr of 'hotkey' events registered
  785_U%!184=0        :REM Pointer to list of static windows
  786_U%!188=0        :REM to shell_AppDir$ buffer
  787_U%!192=0        :REM to shell_AppDataDir$ buffer
  788_U%!196=0        :REM to shell_AppName$ buffer
  789_U%!200=0        :REM window handle from last DataSave message
  790_U%!204=0        :REM icon handle from last DataSave message
  791_U%!208=-1       :REM helphandle% (task handle of StrongHlp)
  792_U%!212=-1       :REM icontry%    (used by StrongHlp find routine)
  793_U%!216=0        :REM pointer to pending$ buffer for StrongHlp command
  794_U%!220=0        :REM pointer to menu warning event block
  795_U%!224=0        :REM pointer to last menu_warn fn called
  796_U%!228=0        :REM handle of warning dialog used for menu items that
  797                 :REM have not had a dialog box attached
  798_U%!232=FNshell_HeapBlockFetch(256):REM fontcounts% array..
  799_U%!236=FNshell_HeapBlockFetch(256):REM fontbinding% array..
  800_U%!240=-1       :REM nr of outline fonts on system, -1 if "FontMenu_Create"
  801                 :REM has not been called
  802_U%!244=0        :REM ptr to currently selected font name in FontMenu
  803_U%!248=0        :REM ptr to last known Font$Path
  804_U%!252=0        :REM last known ptr to FontMenu structure
  805_U%!256=0        :REM ptr to heapblock holding 'MenusSelectionSoFar' string
  806_U%!260=1        :REM SystemFont flag for FontMenu 0 no sysfont, 1 sysfont
  807_U%!264=0        :REM FontMenu is opened (1 or 0)
  808_U%!268=0        :REM FontMenu valid selection flag 0 non valid, 1 valid
  809_U%!272=0        :REM x coord last mouse click (screen coords)
  810_U%!276=0        :REM y coord last mouse click (screen coords)
  811_U%!280=0        :REM m_filedesc% for system message file
  812_U%!284=0        :REM m_buffer%   for system message file
  813_U%!288=-1       :REM window handle for last bump event
  814_U%!292=-1       :REM icon handle for last bump event
  815_U%!296=-1       :REM last event offset for bump handler
  816_U%!300=0        :REM pointer to PreQuit Handler routine
  817_U%!304=0        :REM pointer to OpenWindow event block
  818_U%!308=0        :REM pointer to CloseWindow event block
  819_U%!312=0        :REM pointer to Shutdown Handler routine
  820_U%!316=0        :REM OS version nr as returned by Wimp_Initialise
  821PROCshell_MemFill(_U%!232,256,0)
  822PROCshell_MemFill(_U%!236,256,0)
  823_error_flag%=3
  824ENDPROC
  825:
  826*|Stop PROCshell_Init
  827
  828*|Start FNshell_FileType
  829DEF FNshell_FileType(object$)
  830LOCAL type%
  831SYS "OS_File",5,object$ TO ,,type%
  832type%=(type% AND &FFF00)>>>8
  833=type%
  834:
  835*|Stop FNshell_FileType
  836
  837*|Start FNshell_FileExists
  838DEF FNshell_FileExists(object$)
  839IF FNshell_CatInfoRead(object$)="Not Found":=FALSE
  840=TRUE
  841:
  842*|Stop FNshell_FileExists
  843
  844*|Start FNshell_CatInfoRead
  845DEF FNshell_CatInfoRead(object$)
  846LOCAL type%,load_addr%,exec_addr%,length%,atts%,string$
  847SYS "OS_File",5,object$ TO type%,,load_addr%,exec_addr%,length%,atts%
  848IF type%=0 THEN = "Not Found"
  849IF atts%=51  THEN string$+="WR "
  850IF atts%=187 THEN string$+="LWR"
  851IF atts%=136 THEN string$+="DL "
  852string$+=" "+FNshell_StringPadLeading(STR$~load_addr%,"0",8)
  853string$+=" "+FNshell_StringPadLeading(STR$~exec_addr%,"0",8)
  854string$+=" "+FNshell_StringPadLeading(STR$~length%,"0",8)
  855=string$
  856:
  857*|Stop FNshell_CatInfoRead
  858*|Start FNshell_GetAppDir
  859DEF FNshell_GetAppDir
  860LOCAL temp%
  861temp%=_U%!188
  862=$temp%
  863:
  864*|Stop FNshell_GetAppDir
  865*|Start FNshell_GetAppDataDir
  866DEF FNshell_GetAppDataDir
  867LOCAL temp%
  868temp%=_U%!192
  869=$temp%
  870:
  871*|Stop FNshell_GetAppDataDir
  872*|Start FNshell_GetAppName
  873DEF FNshell_GetAppName
  874LOCAL temp%
  875temp%=_U%!196
  876=$temp%
  877:
  878*|Stop FNshell_GetAppName
  879
  880*|Start PROCshell_ResourcesInit
  881DEF PROCshell_ResourcesInit
  882LOCAL shell_AppDir$,shell_AppName$,shell_AppDataDir$,temp%
  883LOCAL OSVarBuff%
  884OSVarBuff%=FNshell_HeapBlockFetch(256)
  885shell_AppDir$=FNshell_OSVarGetVal(OSVarBuff%,256,"Obey$Dir",1)
  886shell_AppName$=MID$(FNshell_Leaf(shell_AppDir$),2)
  887_U%!188=FNshell_HeapBlockFetch((LENshell_AppDir$)+1)
  888_U%!196=FNshell_HeapBlockFetch((LENshell_AppName$)+1)
  889temp%=_U%!188:$temp%=shell_AppDir$
  890temp%=_U%!196:$temp%=shell_AppName$
  891IF FNshell_OSVarExists(OSVarBuff%,shell_AppName$+"Res$Path") THEN
  892  _U%!100=_U%!100 OR 1<<3:REM set 'ResFind' flag..
  893ENDIF
  894IF FNshell_OSVarExists(OSVarBuff%,shell_AppName$+"Data$Dir") THEN
  895  shell_AppDataDir$=FNshell_OSVarGetVal(OSVarBuff%,256,shell_AppName$+"Data$Dir",1)
  896  _U%!192=FNshell_HeapBlockFetch((LENshell_AppDataDir$)+1)
  897  temp%=_U%!192:$temp%=shell_AppDataDir$
  898ELSE
  899  _U%!192=FNshell_HeapBlockFetch((LENshell_AppDir$)+1)
  900  temp%=_U%!192:$temp%=shell_AppDir$
  901ENDIF
  902IF _U%!100 AND 1<<3 THEN
  903  REM ResFind initialised..
  904  *|define Using_ResFind
  905  IF FNshell_FileExists(shell_AppName$+"Res:Messages") THEN
  906    PROCshell_MessagesInit(shell_AppName$+"Res:Messages",_U%!68,_U%!64)
  907  ENDIF
  908  IF FNshell_FileExists(shell_AppName$+"Res:ShellMsgs") THEN
  909   PROCshell_MessagesInit(shell_AppName$+"Res:ShellMsgs",_U%!280,_U%!284)
  910  ELSE
  911    PROCshell_MessagesInit("ShellSysRes:ShellMsgs",_U%!280,_U%!284)
  912  ENDIF
  913  IF FNshell_FileExists(shell_AppName$+"Res:Sprites") THEN
  914    _U%!16=FNshell_SpriteAreaLoad(shell_AppName$+"Res:Sprites")
  915  ELSE
  916    _U%!16=1:REM use wimp sprite pool if no 'Sprites' file
  917  ENDIF
  918  REM check if templates need loading
  919  IF FNshell_FileExists(shell_AppName$+"Res:Templates") THEN
  920    PROCshell_TemplatesInit(shell_AppName$+"Res:Templates")
  921  ENDIF
  922ELSE
  923  REM ResFind NOT initialised..
  924  IF FNshell_FileExists(shell_AppDir$+".Messages") THEN
  925    PROCshell_MessagesInit(shell_AppDir$+".Messages",_U%!68,_U%!64)
  926  ENDIF
  927  IF FNshell_FileExists(shell_AppDir$+".ShellMsgs") THEN
  928    PROCshell_MessagesInit(shell_AppDir$+".ShellMsgs",_U%!280,_U%!284)
  929  ELSE
  930    PROCshell_MessagesInit("ShellSysRes:ShellMsgs",_U%!280,_U%!284)
  931  ENDIF
  932  REM check if user sprites need loading
  933  IF FNshell_FileExists(shell_AppDir$+".Sprites") THEN
  934    _U%!16=FNshell_SpriteAreaLoad(shell_AppDir$+".Sprites")
  935  ELSE
  936    _U%!16=1:REM use wimp sprite pool if no 'Sprites' file
  937  ENDIF
  938  REM check if templates need loading
  939  IF FNshell_FileExists(shell_AppDir$+".Templates") THEN
  940    PROCshell_TemplatesInit(shell_AppDir$+".Templates")
  941  ENDIF
  942ENDIF
  943SYS "MenuUtil_Initialise"
  944PROCshell_HeapBlockReturn(_Q%)
  945_Q%=FNshell_HeapBlockFetch(1024):REM reduce global wimp block
  946PROCshell_HeapBlockReturn(OSVarBuff%)
  947ENDPROC
  948:
  949*|Stop PROCshell_ResourcesInit
  950
  951*|Start FNshell_SpriteAreaLoad
  952DEF FNshell_SpriteAreaLoad(filename$)
  953LOCAL sp%,S%,T%
  954S%=OPENIN (filename$):T%=EXT#S%+16:CLOSE #S%
  955sp%=FNshell_HeapBlockFetch(T%)
  956!sp%=T%:sp%!4=0
  957sp%!8=16:sp%!12=16
  958SYS "OS_SpriteOp",&209,sp%
  959SYS "OS_SpriteOp",&20A,sp%,filename$
  960*|ifdef TraceInit
  961PROCshell_Tracef0("SpriteLoad:Sprite file loaded at &"+STR$~sp%)
  962*|endif
  963=sp%
  964:
  965*|Stop FNshell_SpriteAreaLoad
  966
  967*|Start FNshell_UserSpritesBase
  968DEF FNshell_UserSpritesBase
  969=_U%!16
  970:
  971*|Stop FNshell_UserSpritesBase
  972
  973*|Start FNshell_SpriteGetPtr
  974DEF FNshell_SpriteGetPtr(spritearea%,name$)
  975LOCAL buffer%,ptr%
  976buffer%=FNshell_HeapBlockFetch(21)
  977$buffer%=name$
  978SYS "OS_SpriteOp",&118,spritearea%,buffer% TO ,,ptr%
  979PROCshell_HeapBlockReturn(buffer%)
  980=ptr%
  981:
  982*|Stop FNshell_SpriteGetPtr
  983
  984*|Start PROCshell_TemplatesInit
  985DEF PROCshell_TemplatesInit(filename$)
  986LOCAL TemplatePtr%,IndirectPtr%,IndirectEnd%
  987LOCAL filelen% ,pos%,name_buffer%,name$,nr_templates%
  988DIM name_buffer% 20
  989WHILE (name_buffer% MOD 4)
  990  name_buffer%+=1
  991ENDWHILE
  992pos%=0:nr_templates%=0
  993filelen%=FNshell_FileLength(filename$)
  994REM reserve space for window definitions
  995TemplateBlk%=FNshell_HeapBlockFetch(filelen%)
  996TemplatePtr%=TemplateBlk%
  997REM reserve a block to hold window identifiers (12 bytes) plus address of window block (4 bytes)
  998_U%!4=FNshell_HeapBlockFetch(20*64)
  999REM reserve space for indirected icon data. Note that too much is reserved as filelen% is the total size
 1000REM of the template file i.e. templates + indirected data!
 1001IndirectBlk%=FNshell_HeapBlockFetch(filelen%)
 1002IndirectPtr%=IndirectBlk%
 1003IndirectEnd%=IndirectBlk%+filelen%
 1004SYS "Wimp_OpenTemplate",,filename$
 1005REPEAT
 1006  $name_buffer%="*"
 1007  SYS "Wimp_LoadTemplate",,TemplatePtr%,IndirectPtr%,IndirectEnd%,_U%!232,name_buffer%,pos% TO ,,IndirectPtr%,,,name$,pos%
 1008  IF pos%<>0 THEN
 1009    !((_U%!4)+(16*nr_templates%))=TemplatePtr%
 1010    $(((_U%!4)+(16*nr_templates%))+4)=name$
 1011    *|ifdef Trace_Init
 1012    PROCshell_Tracef0("TemplatesInit:  Template Loaded: "+name$)
 1013    *|endif
 1014    TemplatePtr%+=(88+(TemplatePtr%!84)*32)
 1015    nr_templates%+=1
 1016  ENDIF
 1017UNTIL pos%=0
 1018SYS "Wimp_CloseTemplate"
 1019_U%!0=nr_templates%
 1020*|ifdef Trace_Init
 1021PROCshell_Tracef0("TemplatesInit:Templates resource file loaded at &"+STR$~TemplateBlk%+" ("+STR$nr_templates%+" templates)")
 1022*|endif
 1023ENDPROC
 1024:
 1025*|Stop PROCshell_TemplatesInit
 1026
 1027*|Start FNshell_WindowLoaded
 1028DEF FNshell_WindowLoaded(window$)
 1029LOCAL loop%,found%
 1030IF LEN(window$)>12 THEN ERROR 99,FNshell_MessageOneArg("SHELLMSG02",window$)
 1031found%=FALSE
 1032FOR loop%=0 TO (_U%!0)-1
 1033  IF $(((_U%!4)+(16*loop%))+4)=window$ THEN
 1034    found%=TRUE:loop%=(_U%!0)-1
 1035  ENDIF
 1036NEXT loop%
 1037=found%
 1038:
 1039*|Stop FNshell_WindowLoaded
 1040*|Start FNshell_GetWB
 1041DEF FNshell_GetWB(window$)
 1042LOCAL loop%,found%
 1043IF LEN(window$)>12 THEN ERROR 99,FNshell_MessageOneArg("SHELLMSG02",window$)
 1044found%=-1
 1045FOR loop%=0 TO (_U%!0)-1
 1046  IF $(((_U%!4)+(16*loop%))+4)=window$ THEN
 1047    found%=loop%:loop%=(_U%!0)-1
 1048  ENDIF
 1049NEXT loop%
 1050IF found%>-1 THEN
 1051  =!((_U%!4)+(16*found%))
 1052ELSE
 1053  ERROR 99,FNshell_MessageOneArg("SHELLMSG03",window$)
 1054ENDIF
 1055=FALSE
 1056:
 1057
 1058*|Stop FNshell_GetWB
 1059*|Start FNshell_MessageExpand
 1060DEF FNshell_MessageExpand(h$)
 1061LOCAL s$, m$, index%
 1062s$=""
 1063WHILE INSTR(h$,"\")>0
 1064  index%=INSTR(h$,"\")
 1065  s$+=LEFT$(h$,index%-1)
 1066  m$=MID$(h$,index%+1,1)
 1067  h$=MID$(h$,index%+2)
 1068  CASE m$ OF
 1069    WHEN "A":s$+="Click ADJUST to"
 1070    WHEN "a":s$+="ADJUST"
 1071    WHEN "D":s$+="Drag with SELECT to"
 1072    WHEN "d":s$+="Drag with ADJUST to"
 1073    WHEN "G":s$+="This option is greyed out because"
 1074    WHEN "R":s$+="Move the pointer right"
 1075    WHEN "S":s$+="Click SELECT to"
 1076    WHEN "s":s$+="SELECT"
 1077    WHEN "T":s$+="This is the"
 1078    WHEN "W":s$+="This window is"
 1079    WHEN "w":s$+="window"
 1080  OTHERWISE
 1081    s$+="\"+m$
 1082  ENDCASE
 1083ENDWHILE
 1084=s$+h$
 1085:
 1086REM ----------------------------------------------------------
 1087:
 1088*|Stop FNshell_MessageExpand
 1089
 1090
 1091
 1092
 1093*|Start PROCshell_OpenMenu
 1094DEF PROCshell_OpenMenu(x%,y%,m%)
 1095LOCAL fn$
 1096fn$=FNshell_GetEventHandler(_U%!28,_U%!32,1)
 1097IF fn$<>"" THEN
 1098  *|ifdef Trace_Init
 1099  PROCshell_Tracef0("OpenMenu:About to call "+"FN"+fn$+"("+STR$_U%!28+","+STR$_U%!32+")")
 1100  *|endif
 1101  void%=EVAL("FN"+fn$+"(_U%!28,_U%!32)"):REM call menumaker
 1102ELSE
 1103  PROCshell_Tracef0("OpenMenu:no menumaker function registered")
 1104ENDIF
 1105IF m%<>_U%!24 THEN
 1106  REM If menu is not being re-opened by an adjust click, discard stored
 1107  REM 'SelectionSoFar' string used by FontMenu routines..
 1108  IF FNshell_HeapBlockExists(_U%!256) THEN
 1109    PROCshell_HeapBlockReturn(_U%!256):_U%!256=0
 1110  ENDIF
 1111  REM And the name of the currently selected font in this menu..
 1112  IF FNshell_HeapBlockExists(_U%!244 ) THEN
 1113    PROCshell_HeapBlockReturn(_U%!244):_U%!244=0
 1114  ENDIF
 1115ENDIF
 1116IF m%=_U%!252 THEN
 1117  SYS "Wimp_CreateMenu",,m%,x%,y%
 1118  _U%!264=1
 1119ELSE
 1120  SYS "MenuUtil_Show",m%,_Q%
 1121  _U%!264=0
 1122ENDIF
 1123_U%!24=m%:REM store address of currently open menu
 1124_U%!36=x%:REM store menu x position
 1125_U%!40=y%:REM store menu y position
 1126_U%!52=_U%!28:REM store window
 1127_U%!56=_U%!32:REM store icon
 1128ENDPROC
 1129:
 1130*|Stop PROCshell_OpenMenu
 1131
 1132*|Start FNshell_MenuLastXPos
 1133DEF FNshell_MenuLastXPos
 1134=_U%!36
 1135:
 1136*|Stop FNshell_MenuLastXPos
 1137
 1138*|Start FNshell_MenuLastYPos
 1139DEF FNshell_MenuLastYPos
 1140=_U%!40
 1141:
 1142*|Stop FNshell_MenuLastYPos
 1143
 1144*|Start PROCshell_MenuAttachDbox
 1145DEF PROCshell_MenuAttachDbox(menu$)
 1146REM attach a dummy window handle for now, just so that the sub window arrow
 1147REM appears on the menu!
 1148SYS "Menu_SetSubHandle",_U%!8,FNshell_MenuString(menu$),1
 1149PROCshell_Tracef0("MenuAttachDbox:Dialog box ("+menu$+") attached")
 1150ENDPROC
 1151:
 1152*|Stop PROCshell_MenuAttachDbox
 1153
 1154*|Start FNshell_MessageWindow
 1155DEF FNshell_MessageWindow(text$,cancel%,progname$,head$)
 1156LOCAL keys%,err_blk%
 1157err_blk%=FNshell_HeapBlockFetch(260)
 1158!err_blk%=0:$(err_blk%+4)=text$+CHR$(0)
 1159IF head$="" THEN head$="Message from "+progname$
 1160IF cancel% THEN
 1161 SYS "Wimp_ReportError",err_blk%,19,head$ TO ,keys%
 1162ELSE
 1163 SYS "Wimp_ReportError",err_blk%,17,head$ TO ,keys%
 1164ENDIF
 1165PROCshell_HeapBlockReturn(err_blk%)
 1166=keys%
 1167:
 1168*|Stop FNshell_MessageWindow
 1169
 1170*|Start PROCshell_CreateWindow
 1171DEF PROCshell_CreateWindow(ident$,RETURN handle%)
 1172LOCAL wb_ptr%
 1173wb_ptr%=FNshell_GetWB(ident$)
 1174REM set 'sprite area' pointer to usersprites area
 1175wb_ptr%!64=_U%!16
 1176SYS "Wimp_CreateWindow",,wb_ptr% TO handle%
 1177ENDPROC
 1178:
 1179*|Stop PROCshell_CreateWindow
 1180*|Start FNshell_CreateWindow2
 1181DEF FNshell_CreateWindow2(title,flags%,fgcol%,bgcol%,maxx%,miny%,l%,b%,r%,t%)
 1182LOCAL Q%
 1183Q%=FNshell_HeapBlockFetch(3000)
 1184Q%!0=l%:Q%!4=b%:Q%!8=r%:Q%!12=t%:Q%!16=0
 1185Q%!20=0:Q%!24=-1:Q%!28=flags%:Q%?32=7
 1186Q%?33=2:Q%?34=fgcol%:Q%?35=bgcol%
 1187Q%?36=3:Q%?37=1
 1188Q%?38=2:Q%?39=0:Q%!40=0:Q%!44=miny%
 1189Q%!48=maxx%:Q%!52=0:Q%!56=&13D:Q%!60=&3000
 1190Q%!68=1:Q%!72=title:Q%!76=-1:Q%!80=LEN$title:Q%!84=0
 1191SYS "Wimp_CreateWindow",,Q% TO handle%
 1192PROCshell_HeapBlockReturn(Q%)
 1193=handle%
 1194:
 1195*|Stop FNshell_CreateWindow2
 1196*|Start FNshell_WindowHasTitleBar
 1197DEF FNshell_WindowHasTitleBar(wh%)
 1198=(FNshell_WindowGetFlags(wh%) AND 1<<26)
 1199:
 1200*|Stop FNshell_WindowHasTitleBar
 1201*|Start FNshell_WindowIsMoveable
 1202DEF FNshell_WindowIsMoveable(wh%)
 1203=(FNshell_WindowGetFlags(wh%) AND 1<<1)
 1204:
 1205*|Stop FNshell_WindowIsMoveable
 1206*|Start FNshell_WindowIsAPane
 1207DEF FNshell_WindowIsAPane(wh%)
 1208=(FNshell_WindowGetFlags(wh%) AND 1<<5)
 1209:
 1210*|Stop FNshell_WindowIsAPane
 1211*|Start FNshell_WindowIsNotBounded
 1212DEF FNshell_WindowIsNotBounded(wh%)
 1213=(FNshell_WindowGetFlags(wh%) AND 1<<6)
 1214:
 1215*|Stop FNshell_WindowIsNotBounded
 1216*|Start FNshell_WindowTrapsHotKeys
 1217DEF FNshell_WindowTrapsHotKeys(wh%)
 1218=(FNshell_WindowGetFlags(wh%) AND 1<<12)
 1219:
 1220*|Stop FNshell_WindowTrapsHotKeys
 1221*|Start FNshell_WindowIsOpen
 1222DEF FNshell_WindowIsOpen(wh%)
 1223=(FNshell_WindowGetFlags(wh%) AND 1<<16)
 1224:
 1225*|Stop FNshell_WindowIsOpen
 1226*|Start FNshell_WindowIsOnTop
 1227DEF FNshell_WindowIsOnTop(wh%)
 1228=(FNshell_WindowGetFlags(wh%) AND 1<<17)
 1229:
 1230*|Stop FNshell_WindowIsOnTop
 1231*|Start FNshell_WindowHasBeenToggled
 1232DEF FNshell_WindowHasBeenToggled(wh%)
 1233=(FNshell_WindowGetFlags(wh%) AND 1<<18)
 1234:
 1235*|Stop FNshell_WindowHasBeenToggled
 1236*|Start FNshell_WindowHasInputFocus
 1237DEF FNshell_WindowHasInputFocus(wh%)
 1238=(FNshell_WindowGetFlags(wh%) AND 1<<20)
 1239:
 1240*|Stop FNshell_WindowHasInputFocus
 1241*|Start FNshell_WindowHasBackIcon
 1242DEF FNshell_WindowHasBackIcon(wh%)
 1243=(FNshell_WindowGetFlags(wh%) AND 1<<24)
 1244:
 1245*|Stop FNshell_WindowHasBackIcon
 1246*|Start FNshell_WindowHasCloseIcon
 1247DEF FNshell_WindowHasCloseIcon(wh%)
 1248=(FNshell_WindowGetFlags(wh%) AND 1<<25)
 1249:
 1250*|Stop FNshell_WindowHasCloseIcon
 1251*|Start FNshell_WindowHasToggleIcon
 1252DEF FNshell_WindowHasToggleIcon(wh%)
 1253=(FNshell_WindowGetFlags(wh%) AND 1<<27)
 1254:
 1255*|Stop FNshell_WindowHasToggleIcon
 1256*|Start FNshell_WindowHasVScrollBar
 1257DEF FNshell_WindowHasVScrollBar(wh%)
 1258=(FNshell_WindowGetFlags(wh%) AND 1<<28)
 1259:
 1260*|Stop FNshell_WindowHasVScrollBar
 1261*|Start FNshell_WindowHasAdjustSizeIcon
 1262DEF FNshell_WindowHasAdjustSizeIcon(wh%)
 1263=(FNshell_WindowGetFlags(wh%) AND 1<<29)
 1264:
 1265*|Stop FNshell_WindowHasAdjustSizeIcon
 1266*|Start FNshell_WindowHasHScrollBar
 1267DEF FNshell_WindowHasHScrollBar(wh%)
 1268=(FNshell_WindowGetFlags(wh%) AND 1<<30)
 1269:
 1270*|Stop FNshell_WindowHasHScrollBar
 1271*|Start FNshell_WindowGetFlags
 1272DEF FNshell_WindowGetFlags(wh%)
 1273LOCAL flags%,blk%
 1274blk%=FNshell_HeapBlockFetch(36)
 1275blk%!0=wh%
 1276SYS "Wimp_GetWindowState",,blk%
 1277flags%=blk%!32
 1278PROCshell_HeapBlockReturn(blk%)
 1279=flags%
 1280:
 1281*|Stop FNshell_WindowGetFlags
 1282*|Start FNshell_WindowTitleFlags
 1283DEF FNshell_WindowTitleFlags(wh%)
 1284LOCAL flags%,blk%
 1285blk%=FNshell_HeapBlockFetch(3000)
 1286blk%!0=wh%
 1287SYS "Wimp_GetWindowInfo",,blk%
 1288flags%=blk%!60
 1289PROCshell_HeapBlockReturn(blk%)
 1290=flags%
 1291:
 1292REM Hilke
 1293*|Stop FNshell_WindowTitleFlags
 1294*|Start FNshell_WindowTitleHasBorder
 1295DEF FNshell_WindowTitleHasBorder(wh%)
 1296=(FNshell_WindowTitleFlags(wh%) AND 1<<2)
 1297:
 1298*|Stop FNshell_WindowTitleHasBorder
 1299*|Start FNshell_WindowTitleIsSprite
 1300DEF FNshell_WindowTitleIsSprite(wh%)
 1301=(FNshell_WindowTitleFlags(wh%) AND 1<<1)
 1302:
 1303*|Stop FNshell_WindowTitleIsSprite
 1304*|Start FNshell_WindowTitleIsText
 1305DEF FNshell_WindowTitleIsText(wh%)
 1306=(FNshell_WindowTitleFlags(wh%) AND 1<<0)
 1307:
 1308*|Stop FNshell_WindowTitleIsText
 1309*|Start FNshell_WindowTitleIsHCentred
 1310DEF FNshell_WindowTitleIsHCentred(wh%)
 1311=(FNshell_WindowTitleFlags(wh%) AND 1<<3)
 1312:
 1313*|Stop FNshell_WindowTitleIsHCentred
 1314*|Start FNshell_WindowTitleIsVCentred
 1315DEF FNshell_WindowTitleIsVCentred(wh%)
 1316=(FNshell_WindowTitleFlags(wh%) AND 1<<4)
 1317:
 1318*|Stop FNshell_WindowTitleIsVCentred
 1319*|Start FNshell_WindowTitleIsFilled
 1320DEF FNshell_WindowTitleIsFilled(wh%)
 1321=(FNshell_WindowTitleFlags(wh%) AND 1<<5)
 1322:
 1323*|Stop FNshell_WindowTitleIsFilled
 1324*|Start FNshell_WindowTitleIsAAliased
 1325DEF FNshell_WindowTitleIsAAliased(wh%)
 1326=(FNshell_WindowTitleFlags(wh%) AND 1<<6)
 1327:
 1328*|Stop FNshell_WindowTitleIsAAliased
 1329*|Start FNshell_WindowTitleIsIndirected
 1330DEF FNshell_WindowTitleIsIndirected(wh%)
 1331=(FNshell_WindowTitleFlags(wh%) AND 1<<8)
 1332:
 1333*|Stop FNshell_WindowTitleIsIndirected
 1334*|Start FNshell_WindowGetTitle
 1335DEF FNshell_WindowGetTitle(wh%)
 1336LOCAL title$,blk%
 1337REM Check if window has a title bar..
 1338blk%=FNshell_HeapBlockFetch(3000)
 1339blk%!0=wh%
 1340SYS "Wimp_GetWindowInfo",,blk%
 1341IF (blk%!32 AND 1<<26) THEN
 1342  IF ((blk%!60) AND &100)=0 THEN
 1343    REM Title is not indirected..
 1344    title$=$(blk%+76)
 1345  ELSE
 1346    REM Title is indirected..
 1347    title$=$(!(blk%+76))
 1348  ENDIF
 1349ENDIF
 1350PROCshell_HeapBlockReturn(blk%)
 1351=title$
 1352:
 1353*|Stop FNshell_WindowGetTitle
 1354*|Start FNshell_WindowTitleBufferLength
 1355DEF FNshell_WindowTitleBufferLength(wh%)
 1356LOCAL result%,blk%
 1357blk%=FNshell_HeapBlockFetch(3000)
 1358blk%!0=wh%
 1359SYS "Wimp_GetWindowInfo",,blk%
 1360  IF ((blk%!60) AND &100)=0 THEN
 1361    result%=12
 1362  ELSE
 1363    result%=blk%!84
 1364  ENDIF
 1365PROCshell_HeapBlockReturn(blk%)
 1366=result%
 1367:
 1368*|Stop FNshell_WindowTitleBufferLength
 1369*|Start PROCshell_WindowMoveToIcon
 1370DEF PROCshell_WindowMoveToIcon(wh%,iwh%,ih%,x_off%,y_off%)
 1371LOCAL blk%
 1372blk%=FNshell_HeapBlockFetch(50)
 1373blk%!0=iwh%:blk%!4=ih%
 1374SYS "Wimp_GetIconState",,blk%
 1375PROCshell_WindowMoveTo(wh%,blk%!8+x_off%,blk%!20+y_off%)
 1376PROCshell_HeapBlockReturn(blk%)
 1377ENDPROC
 1378:
 1379*|Stop PROCshell_WindowMoveToIcon
 1380*|Start PROCshell_WindowMoveTo
 1381DEF PROCshell_WindowMoveTo(wh%,x%,y%)
 1382LOCAL win_width%,win_height%,offset%,blk%
 1383blk%=FNshell_HeapBlockFetch(3000)
 1384blk%!0=wh%
 1385SYS "Wimp_GetWindowInfo",,blk%
 1386win_width% =blk%!12-blk%!4
 1387win_height%=blk%!16-blk%!8
 1388blk%!4=x%
 1389blk%!8=y%
 1390blk%!12=x%+win_width%
 1391blk%!16=y%+win_height%
 1392REM this looks really silly, but is necessary to tell the
 1393REM window manager the new window coords. The shell_OpenWindow
 1394REM call sets up any panes and actually opens the window in
 1395REM the new position
 1396SYS "Wimp_OpenWindow",,blk%
 1397SYS "Wimp_CloseWindow",,blk%
 1398offset%=FNshell_SearchStatic(_U%!184,wh%)
 1399IF offset%>-1 THEN
 1400  PROCshell_OpenWindowStatic(wh%)
 1401ELSE
 1402  PROCshell_OpenWindowDynamic(wh%,0,0)
 1403ENDIF
 1404PROCshell_HeapBlockReturn(blk%)
 1405ENDPROC
 1406:
 1407*|Stop PROCshell_WindowMoveTo
 1408*|Start PROCshell_WindowBringToTop
 1409DEF PROCshell_WindowBringToTop(wh%)
 1410LOCAL msg%
 1411msg%=FNshell_HeapBlockFetch(256)
 1412msg%!0=wh%
 1413SYS "Wimp_GetWindowState",,msg%
 1414msg%!28=-1
 1415SYS "Wimp_SendMessage",2,msg%,wh%
 1416REM now call wimp poll as this action must happen
 1417REM without waiting for next wimp poll...
 1418SYS "Wimp_Poll",0,msg%
 1419PROCshell_HeapBlockReturn(msg%)
 1420ENDPROC
 1421:
 1422*|Stop PROCshell_WindowBringToTop
 1423*|Start PROCshell_UpdateWindow
 1424DEF PROCshell_UpdateWindow(handle%,l%,b%,r%,t%)
 1425LOCAL blk%
 1426blk%=FNshell_HeapBlockFetch(blk%)
 1427blk%!0=handle%:blk%!4=l%:blk%!8=b%:blk%!12=r%:blk%!16=t%
 1428SYS "Wimp_UpdateWindow",,blk% TO more%
 1429SYS "Wimp_GetWindowState",,blk%
 1430PROCshell_HeapBlockReturn(blk%)
 1431ENDPROC
 1432:
 1433*|Stop PROCshell_UpdateWindow
 1434*|Start PROCshell_OpenWindowDynamic
 1435DEF PROCshell_OpenWindowDynamic(wh%,x_off%,y_off%)
 1436LOCAL void%,ptr_blk%
 1437ptr_blk%=FNshell_HeapBlockFetch(20)
 1438_U%!20=wh%
 1439SYS "Wimp_GetPointerInfo",,ptr_blk%
 1440SYS "Wimp_CreateMenu",,wh%,ptr_blk%!0+x_off%,ptr_blk%!4+y_off%
 1441PROCshell_HeapBlockReturn(ptr_blk%)
 1442ENDPROC
 1443:
 1444*|Stop PROCshell_OpenWindowDynamic
 1445*|Start FNshell_ClaimKeypress
 1446DEF FNshell_ClaimKeypress
 1447REM Bodge to ensure that shell_OpenWindowDynamic works properly..
 1448IF _U%!20<>0 THEN
 1449  SYS "Wimp_CreateMenu",,-1
 1450  void%=FNshell_DeleteWindow(_U%!20)
 1451  _U%!20=0
 1452ENDIF
 1453=TRUE
 1454:
 1455*|Stop FNshell_ClaimKeypress
 1456
 1457*|Start PROCshell_OpenWindow
 1458DEF PROCshell_OpenWindow(wh%,full%,front%)
 1459LOCAL offset%,blk%,paneblk%,ctr%,first_pane%,behind%,height%,width%
 1460LOCAL flag%,toggle%,t%,last_pane%,prev_pane%,res%
 1461offset%=FNshell_GetEventListOffset(wh%,-1,_U%+304,12,FALSE)
 1462IF offset%>=0 THEN
 1463  blk%=_U%!304+offset%
 1464  temp%=blk%!8
 1465  *|ifdef Trace_Init
 1466  PROCshell_Tracef0("OpenWindow:About to call "+"FN"+$temp%)
 1467  *|endif
 1468  res%=EVAL("FN"+$temp%)
 1469  IF res%=0 THEN ENDPROC
 1470ENDIF
 1471toggle%=FALSE
 1472  t%=FNshell_HeapBlockFetch(100):t%!0=wh%
 1473  SYS "Wimp_GetWindowState",,t%
 1474  IF (t%!32 AND &80000)=&80000 THEN toggle%=TRUE ELSE toggle%=FALSE
 1475  PROCshell_HeapBlockReturn(t%)
 1476  _Q%!0=wh%
 1477  IF NOT full% THEN SYS "Wimp_GetWindowState",,_Q%
 1478  IF toggle% THEN
 1479    SYS "Wimp_OpenWindow",,_Q%
 1480  ENDIF
 1481offset%=FNshell_GetEventListOffset(wh%,-1,_U%+92,24,FALSE)
 1482IF offset%>-1 THEN
 1483  blk%=(_U%!92)+offset%
 1484  REM pane handler event found
 1485  ptr8%=blk%!8:ptr12%=blk%!12:ptr16%=blk%!16:ptr20%=blk%!20
 1486  _Q%!0=wh%
 1487  IF front% THEN behind%=-1 ELSE behind%=_Q%!28
 1488  IF NOT full% THEN
 1489    SYS "Wimp_GetWindowState",,_Q%
 1490  ENDIF
 1491  REM reserve 1k as buffer - hope it's enough.....
 1492  paneblk%=FNshell_HeapBlockFetch(1024)
 1493  ctr%=0
 1494  WHILE ptr8%!ctr%<>-1
 1495    paneblk%!0=ptr8%!ctr%:REM handle of 'pane'
 1496    IF first_pane%=0 THEN first_pane%=paneblk%!0
 1497    last_pane%=paneblk%!0
 1498    SYS "Wimp_GetWindowState",,paneblk%
 1499    REM Check flag word in pane event block...
 1500    flag%=ptr12%!ctr%
 1501    CASE flag% OF
 1502    WHEN 0,1
 1503      height%=paneblk%!16-paneblk%!8
 1504      width%=paneblk%!12-paneblk%!4
 1505      paneblk%!4=_Q%!4+ptr16%!ctr%
 1506      paneblk%!12=paneblk%!4+width%
 1507      paneblk%!16=_Q%!16+ptr20%!ctr%
 1508      paneblk%!8=paneblk%!16-height%
 1509    WHEN 2
 1510      REM Attached to top edge.....
 1511      height%=paneblk%!16-paneblk%!8
 1512      width%=_Q%!12-_Q%!4
 1513      paneblk%!4=_Q%!4+ptr16%!ctr%
 1514      paneblk%!12=_Q%!12
 1515      paneblk%!16=_Q%!16+ptr20%!ctr%
 1516      paneblk%!8=paneblk%!16-height%
 1517    WHEN 3
 1518      REM Attached to left edge...
 1519      height%=_Q%!16-_Q%!8
 1520      width%=paneblk%!12-paneblk%!4
 1521      paneblk%!4=_Q%!4+ptr16%!ctr%
 1522      paneblk%!12=paneblk%!4+width%
 1523      paneblk%!16=_Q%!16             :REM min y
 1524      paneblk%!8=_Q%!8+ptr20%!ctr%   :REM max y
 1525    WHEN 4
 1526      REM Attached to bottom edge...
 1527      height%=paneblk%!16-paneblk%!8
 1528      width%=_Q%!12-_Q%!4
 1529      paneblk%!4=_Q%!4+ptr16%!ctr%
 1530      paneblk%!12=_Q%!12
 1531      paneblk%!16=_Q%!8+height%+ptr20%!ctr%
 1532      paneblk%!8=paneblk%!16+height%
 1533    WHEN 5
 1534      REM Attached to right edge...
 1535      height%=_Q%!16-_Q%!8
 1536      width%=paneblk%!12-paneblk%!4
 1537      paneblk%!4=_Q%!12-width%+ptr16%!ctr%
 1538      paneblk%!12=paneblk%!4+width%
 1539      paneblk%!16=_Q%!16 :REM min y
 1540      paneblk%!8=_Q%!8   :REM max y
 1541    ENDCASE
 1542    IF ctr%=0 THEN
 1543      paneblk%!28=behind%
 1544    ELSE
 1545      paneblk%!28=prev_pane%
 1546    ENDIF
 1547    SYS "Wimp_OpenWindow",,paneblk%
 1548    prev_pane%=paneblk%!0
 1549    ctr%+=4
 1550  ENDWHILE
 1551  IF NOT toggle% THEN
 1552    _Q%!28=last_pane%
 1553    SYS "Wimp_OpenWindow",,_Q%
 1554  ENDIF
 1555  PROCshell_HeapBlockReturn(paneblk%)
 1556ELSE
 1557  REM no pane event...
 1558  _Q%!0=wh%
 1559  IF NOT full% THEN SYS "Wimp_GetWindowState",,_Q%
 1560  IF behind%=-2 THEN _Q%!28=-2
 1561  IF front%=-1 THEN _Q%!28=-1
 1562  SYS "Wimp_OpenWindow",,_Q%
 1563ENDIF
 1564ENDPROC
 1565:
 1566*|Stop PROCshell_OpenWindow
 1567
 1568*|Start PROCshell_CloseWindow
 1569DEF PROCshell_CloseWindow(wh%)
 1570LOCAL offset%,blk%,ptr8%,ptr12%,ptr16%,ptr20%,win_blk%,res%
 1571offset%=FNshell_GetEventListOffset(wh%,-1,_U%+308,12,FALSE)
 1572IF offset%>=0 THEN
 1573  blk%=_U%!308+offset%
 1574  temp%=blk%!8
 1575  *|ifdef Trace_Init
 1576  PROCshell_Tracef0("CloseWindow:About to call "+"FN"+$temp%)
 1577  *|endif
 1578  res%=EVAL("FN"+$temp%)
 1579  IF res%=0 THEN ENDPROC
 1580ENDIF
 1581win_blk%=FNshell_HeapBlockFetch(60)
 1582IF wh%>0 THEN
 1583  offset%=FNshell_GetEventListOffset(wh%,-1,_U%+92,24,FALSE)
 1584  IF offset%>-1 THEN
 1585    blk%=(_U%!92)+offset%
 1586    ptr12%=blk%!12:ptr16%=blk%!16:ptr20%=blk%!20
 1587    ctr%=0:ptr8%=blk%!8
 1588    WHILE ptr8%!ctr%<>-1
 1589      REM close pane windows
 1590      win_blk%!0=ptr8%!ctr%
 1591      SYS "Wimp_CloseWindow",,win_blk%
 1592      ctr%+=4
 1593    ENDWHILE
 1594    REM PROCshell_HeapBlockReturn(ptr8%)
 1595    REM PROCshell_HeapBlockReturn(ptr12%)
 1596    REM PROCshell_HeapBlockReturn(ptr16%)
 1597    REM PROCshell_HeapBlockReturn(ptr20%)
 1598  ENDIF
 1599  REM close parent window
 1600  win_blk%!0=wh%:SYS "Wimp_CloseWindow",,win_blk%
 1601ENDIF
 1602PROCshell_HeapBlockReturn(win_blk%)
 1603ENDPROC
 1604:
 1605*|Stop PROCshell_CloseWindow
 1606
 1607*|Start FNshell_DeleteWindow
 1608DEF FNshell_DeleteWindow(handle%)
 1609LOCAL win_blk%
 1610win_blk%=FNshell_HeapBlockFetch(20)
 1611IF handle%<>0 THEN
 1612  IF FNoktodeletew(handle%) THEN
 1613    PROCshell_EventDeleteAll(handle%)
 1614    IF handle%=_U%!20 THEN _U%!20=0
 1615    offset%=FNshell_SearchStatic(_U%!184,handle%)
 1616    IF offset%>-1 THEN
 1617      temp%=_U%!184+offset%
 1618      temp%!0=0:REM wipe window handle in static list
 1619    ENDIF
 1620    REM and now actually delete the window..
 1621    win_blk%!0=handle%
 1622    SYS "Wimp_DeleteWindow",,win_blk%
 1623    handle%=0
 1624  ENDIF
 1625ENDIF
 1626PROCshell_HeapBlockReturn(win_blk%)
 1627=handle%
 1628:
 1629*|Stop FNshell_DeleteWindow
 1630*|Start FNoktodeletew
 1631DEF FNoktodeletew(handle%)
 1632=-1
 1633:
 1634*|Stop FNoktodeletew
 1635*|Start FNoktoclosew
 1636DEF FNoktoclosew(handle%)
 1637=-1
 1638:
 1639*|Stop FNoktoclosew
 1640*|Start PROCcliprect
 1641DEF PROCcliprect(b,RETURN x1%,RETURN y1%,RETURN x2%,RETURN y2%)
 1642LOCAL x0%,y0%
 1643PROClwaorigin(b,x0%,y0%):x1%=b!24-x0%:y1%=b!28-y0%:x2%=b!32-x0%
 1644y2%=b!36-y0%
 1645ENDPROC
 1646:
 1647*|Stop PROCcliprect
 1648*|Start FNpoll
 1649DEF FNpoll(mask%,task%)
 1650SYS "Wimp_Poll",mask%,_Q% TO a%
 1651=a%
 1652:
 1653*|Stop FNpoll
 1654*|Start FNshell_Poll_I
 1655DEF FNshell_Poll_I(mask%,task%)
 1656SYS "Wimp_Poll",mask%,_Q% TO a%
 1657SYS "Interface_Poll",a%,,task%
 1658=a%
 1659:
 1660*|Stop FNshell_Poll_I
 1661DEF PROCshell_DoBackgroundTask
 1662ENDPROC
 1663:
 1664*|Start FNshell_IconIsDraggable
 1665DEF FNshell_IconIsDraggable(wh%,ih%)
 1666LOCAL flags%,temp%,blk%
 1667REM claim a block as temporary workspace big enough for data
 1668REM returned by SWI call (icon block + 8 bytes)
 1669blk%=FNshell_HeapBlockFetch(50)
 1670blk%!0=wh%:blk%!4=ih%
 1671SYS "Wimp_GetIconState",,blk%
 1672flags%=blk%!24
 1673temp%=(flags% AND &6000)
 1674PROCshell_HeapBlockReturn(blk%)
 1675IF temp%=&6000 =TRUE ELSE =FALSE
 1676=0
 1677:
 1678*|Stop FNshell_IconIsDraggable
 1679*|Start PROCshell_IconDragBox
 1680DEF PROCshell_IconDragBox(wh%,ih%)
 1681LOCAL blk%,wex,wey,e_offset%,flags%,f%,DragASprite%,spr_area%,valid%,spr$
 1682REM check if an event has been registered for when the drag ends..
 1683e_offset%=FNshell_GetEventListOffset(wh%,ih%,_U%+72,24,FALSE)
 1684IF e_offset%>=0 THEN
 1685  REM it has, so go ahead and allow the drag..
 1686  blk%=FNshell_HeapBlockFetch(6000)
 1687  !blk%=wh%
 1688  SYS "Wimp_GetWindowInfo",,blk%
 1689  wex=blk%!4-blk%!20:wey=blk%!16-blk%!24
 1690  spr_area%=blk%!68
 1691  blk%!4=ih%
 1692  SYS "Wimp_GetIconState",,blk%
 1693  !blk%=wh%:blk%!4=5:flags%=blk%!24:valid%=blk%!32
 1694  blk%!8=blk%!8+wex
 1695  blk%!12=blk%!12+wey
 1696  blk%!16=blk%!16+wex
 1697  blk%!20=blk%!20+wey
 1698  blk%!24=0:blk%!28=0
 1699  blk%!32=&7FFFFFFF:blk%!36=&7FFFFFFF
 1700  REM check dragasprite bit in CMOS RAM..
 1701  SYS "OS_Byte",161,28 TO ,,f%
 1702  DragASprite%=((f% AND 2)=2)
 1703  IF DragASprite% THEN
 1704    f%=flags%
 1705    IF (f% AND &100) THEN
 1706      spr$=FNshell_IconGetCommand(valid%,"s")
 1707    ENDIF
 1708    IF (f% AND 2)=0 THEN ERROR 99,FNshell_MessageNoArgs("SHELLMSG19")
 1709    IF spr$<>"" THEN
 1710      SYS "DragASprite_Start",%10000101,spr_area%,spr$,blk%+8
 1711      _U%!100=_U%!100 OR 1:REM set 'dragasprite' flag..
 1712    ELSE
 1713      SYS "Wimp_DragBox",,blk%
 1714    ENDIF
 1715  ELSE
 1716    SYS "Wimp_DragBox",,blk%
 1717  ENDIF
 1718  PROCshell_HeapBlockReturn(blk%)
 1719ELSE
 1720  PROCshell_Tracef0("IconDragBox:WARNING! no drag handler registered for this icon!")
 1721ENDIF
 1722ENDPROC
 1723:
 1724*|Stop PROCshell_IconDragBox
 1725
 1726*|Start PROCshell_HandleAttachedMenu
 1727DEF PROCshell_HandleAttachedMenu(_Q%,wh%,ih%)
 1728LOCAL menu%
 1729LOCAL ERROR
 1730ON ERROR LOCAL:RESTORE ERROR:ENDPROC
 1731IF ih%<>-1 AND wh%>-1 THEN
 1732  menu%=FNshell_GetEventMenu(_Q%!8,wh%,ih%)
 1733  IF menu%<>0 THEN
 1734    PROCshell_OpenMenu(_Q%!0-64,_Q%!4,menu%)
 1735  ENDIF
 1736ENDIF
 1737ENDPROC
 1738:
 1739*|Stop PROCshell_HandleAttachedMenu
 1740
 1741*|Start PROCshell_Action
 1742DEF PROCshell_Action(evnt%)
 1743LOCAL fn$,menu%,menu$,select$,menu_buffer%,mx%,my%,claimed%
 1744LOCAL wh%,ih%,void%,_temp28%,_temp32%,_temp24%,_temp%,fontmenuflag%
 1745LOCAL CheckSelect%,offset%
 1746CASE evnt% OF
 1747  *|ifdef PROCshell_DoBackgroundTask
 1748  WHEN 0:PROCshell_DoBackgroundTask
 1749  *|endif
 1750  WHEN 1:PROCshell_RedrawWindow(_Q%!0)
 1751  WHEN 2:PROCshell_OpenWindow(_Q%!0,TRUE,0)
 1752  WHEN 3:PROCshell_CloseWindow(_Q%!0)
 1753  *|ifdef PROCshell_PointerLeavingWindow
 1754  WHEN 4:PROCshell_PointerLeavingWindow
 1755  *|endif
 1756  *|ifdef PROCshell_PointerEnteringWindow
 1757  WHEN 5:PROCshell_PointerEnteringWindow
 1758  *|endif
 1759  WHEN 6:_U%!28=_Q%!12:_U%!32=_Q%!16:mx%=_Q%!0:my%=_Q%!4
 1760         _U%!272=_Q%!0:_U%!276=_Q%!4
 1761         _temp28%=_Q%!12:_temp32%=_Q%!16:ih%=_Q%!16
 1762         *|ifdef TraceInit
 1763         PROCshell_Tracef0("Action:Mouse_Click event detected")
 1764         PROCshell_Tracef0("Action:Window Handle was &"+STR$~_Q%!12+" Icon Handle was "+STR$_Q%!16)
 1765         *|endif
 1766         IF _Q%!12=_U%!288 AND _Q%!16=_U%!292 THEN
 1767           REM same icon pressed again, use stored event offset..
 1768           PROCshell_HandleBumpIcons(_U%!296,_Q%!12,_Q%!16)
 1769         ELSE
 1770           _U%!288=-1:_U%!292=-1:_U%!296=-1
 1771           IF _Q%!16>=0 THEN
 1772             offset%=FNshell_GetEventListOffset(_Q%!12,_Q%!16,_U%+104,16,0)
 1773             IF offset%>=0 THEN PROCshell_HandleBumpIcons(offset%,_Q%!12,_Q%!16)
 1774           ENDIF
 1775         ENDIF
 1776         REM check first for drag flag!
 1777         IF (_Q%!8=64) THEN
 1778           REM only check for SELECT and ADJUST buttons
 1779           result%=FNshell_IconIsDraggable(_Q%!12,_Q%!16)
 1780           IF result% THEN
 1781             mess$="Icon is draggable"
 1782             REM so now draw the drag box
 1783             PROCshell_IconDragBox(_Q%!12,_Q%!16)
 1784           ELSE
 1785             mess$="Icon is not draggable"
 1786           ENDIF
 1787           PROCshell_Tracef0("Action:"+mess$)
 1788         ENDIF
 1789         CASE _Q%!8 OF
 1790           WHEN 4:PROCshell_ActionSelectButton
 1791           WHEN 2:PROCshell_ActionMenuButton
 1792           WHEN 1:PROCshell_ActionAdjustButton
 1793         ENDCASE
 1794  WHEN 7:IF _U%!100 AND 1 THEN
 1795           SYS "DragASprite_Stop"
 1796           _U%!100=_U%!100 EOR 1
 1797         ENDIF
 1798         _U%!128=0:REM set RAMPtr% to 0 in case a RAMFetch follows..
 1799         REM have to use last window/icon handles from _U% block as
 1800         REM _Q% block could be corrupted by other poll calls
 1801         fn$=FNshell_GetEventHandler(_U%!28,_U%!32,6)
 1802         IF fn$<>"" THEN
 1803           PROCshell_Tracef0("Action:Drag event detected - function is "+fn$)
 1804           void%=EVAL("FN"+fn$+"(_temp28%,_temp32%)")
 1805         ELSE
 1806           PROCshell_Tracef0("Action:Drag event detected - no handler function")
 1807           REM set up datasave message
 1808           PROCshell_SendDataSave(_U%!28,_U%!32)
 1809         ENDIF
 1810  WHEN 8:
 1811         PROCshell_Tracef0("Action:keypress is="+STR$_Q%!24)
 1812         CASE _Q%!24 OF
 1813         WHEN &0D,398,399
 1814           claimed%=FNshell_WriteableIconHandler(_Q%!0,_Q%!4,_Q%!24)
 1815         OTHERWISE
 1816           claimed%=FNshell_HotKeyProcess(_Q%!24)
 1817         ENDCASE
 1818         IF NOT claimed% THEN
 1819           PROCshell_Tracef0("Action:Keypress not claimed, passing it on")
 1820           SYS "Wimp_ProcessKey",_Q%!24
 1821         ELSE
 1822           PROCshell_Tracef0("Action:Keypress claimed by this application")
 1823         ENDIF
 1824  WHEN 9:PROCshell_ActionMenuSelect(_Q%)
 1825  WHEN 17,18:PROCshell_Receive(_Q%)
 1826  WHEN 19   :PROCshell_UserMessageAcknowledge(_Q%)
 1827ENDCASE
 1828ENDPROC
 1829:
 1830*|Stop PROCshell_Action
 1831
 1832*|Start PROCshell_ActionSelectButton
 1833DEF PROCshell_ActionSelectButton
 1834PROCshell_Tracef0("ActionSelectButton:Mouse Button was SELECT")
 1835PROCshell_HandleAttachedMenu(_Q%,_U%!28,_U%!32)
 1836fn$=FNshell_GetEventHandler(_U%!28,_U%!32,2)
 1837REM check filename in icon if datasave event exists
 1838IF _U%!32=0 THEN
 1839  REM icon was 0.....
 1840  PROCshell_DataSaveCheckName(_U%!28,_U%!32)
 1841ENDIF
 1842IF fn$<>"" THEN
 1843  PROCshell_IconSlab(4,_U%!28,_U%!32)
 1844  *|ifdef Trace_Init
 1845  PROCshell_Tracef0("ActionSelectButton:About to call "+"FN"+fn$+"("+STR$_temp28%+","+STR$_temp32%+")")
 1846  *|endif
 1847  void%=EVAL("FN"+fn$+"(_temp28%,_temp32%)")
 1848ENDIF
 1849REM if icon was 0 and dbox is dynamic then close dbox/menu
 1850IF _U%!32=0 THEN
 1851  IF _U%!28=_U%!20 THEN
 1852    SYS "Wimp_CreateMenu",,-1
 1853  ENDIF
 1854ENDIF
 1855ENDPROC
 1856*|Stop PROCshell_ActionSelectButton
 1857
 1858*|Start PROCshell_ActionMenuButton
 1859DEF PROCshell_ActionMenuButton
 1860LOCAL temp%,menu%
 1861*|ifdef PROCshell_TraceInit
 1862PROCshell_Tracef0("ActionMenuButton:Mouse Button was MENU")
 1863*|endif
 1864temp%=TRUE
 1865IF INKEY(-1) THEN temp%=FNshiftmenuclick(_Q%!12,_Q%!16)
 1866IF temp% THEN
 1867  PROCshell_Tracef0("ActionMenuButton:Checking menu events..")
 1868  menu%=FNshell_GetEventMenu(_Q%!8,_Q%!12,_Q%!16)
 1869  PROCshell_Tracef0("ActionMenuButton:Menu handle is:"+STR$menu%)
 1870  IF menu%<>0 THEN
 1871    PROCshell_OpenMenu(_Q%!0,_Q%!4,menu%)
 1872    _U%!24=menu%
 1873    _U%!36=_Q%!00:REM store menu x position
 1874    _U%!40=_Q%!04:REM store menu y position
 1875    _U%!52=_U%!28:REM store window
 1876    _U%!56=_U%!32:REM store icon
 1877  ENDIF
 1878ENDIF
 1879ENDPROC
 1880:
 1881*|Stop PROCshell_ActionMenuButton
 1882
 1883*|Start PROCshell_ActionMenuSelect
 1884DEF PROCshell_ActionMenuSelect(_Q%)
 1885LOCAL handler%,menu_buffer%,CheckSelect%,fontmenuflag%,void%,h_blk%
 1886h_blk%=FNshell_HeapBlockFetch(256)
 1887*|ifdef PROCshell_TraceInit
 1888PROCshell_Tracef0("ActionMenuSelect:Menu_Select event detected")
 1889*|endif
 1890SYS "Wimp_GetPointerInfo",,_shell_blk%
 1891*|ifdef Using_FontMenu
 1892menu_buffer%=FNshell_HeapBlockFetch(256)
 1893IF _U%!24=_U%!252 THEN
 1894  REM Current menu is FontMenu..
 1895  CheckSelect%=0:_U%!264=1
 1896ELSE
 1897  CheckSelect%=FNshell_CheckSelection(_Q%)
 1898  IF CheckSelect%>-1 THEN _U%!264=1 ELSE _U%!264=0
 1899ENDIF
 1900IF _U%!264>0 THEN
 1901  SYS "FontMenu_DecodeFontMenu",_Q%+CheckSelect%,menu_buffer% TO fontmenuflag%
 1902  IF fontmenuflag%=1 THEN
 1903    REM 'sensible' selection made..
 1904    *|ifdef PROCshell_TraceInit
 1905    PROCshell_Tracef0("ActionMenuSelect:FontMenu selection ("+FNshell_GetString(menu_buffer%)+")")
 1906    *|endif
 1907    PROCshell_FontMenuSelectFont(FNshell_GetString(menu_buffer%),_U%!260)
 1908    IF _shell_FontMenuSelFN$="" THEN
 1909      SYS "Wimp_DecodeMenu",,_U%!24,_Q%,menu_buffer%
 1910      fn$=FNshell_GetEventHandler(_U%!52,_U%!56,0)
 1911      _temp%=menu_buffer%
 1912      $_temp%=FNshell_StringStripTrailing($_temp%," ")
 1913      IF fn$<>"" THEN void%=EVAL("FN"+fn$+"($_temp%)")
 1914    ELSE
 1915      IF _shell_FontMenuSelFN$<>"" THEN
 1916        void%=EVAL("FN"+_shell_FontMenuSelFN$+"(FNshell_FontMenuGetLastSelectedFont)")
 1917      ENDIF
 1918    ENDIF
 1919  ENDIF
 1920ENDIF
 1921PROCshell_HeapBlockReturn(menu_buffer%)
 1922*|endif
 1923IF _U%!264=0 THEN
 1924  SYS "MenuUtil_Decode",_U%!24,_Q% TO handler%,,h_blk%
 1925  IF handler% THEN PROCshell_MenuCallHandler(handler%,h_blk%)
 1926ENDIF
 1927IF _shell_blk%!8=1 THEN
 1928  PROCshell_Tracef0("HILKE::Adjust button")
 1929  IF FNshell_HeapBlockExists(_U%!224) THEN
 1930    PROCshell_Tracef0("HILKE::Stored warn_fn exists")
 1931    _temp%=_U%!224
 1932    IF $_temp%<>"" THEN
 1933      REM Call last menuwarning fn
 1934      PROCshell_Tracef0("HILKE::Calling last warn_fn ("+$_temp%+")")
 1935      void%=EVAL("FN"+$_temp%+"(_U%!52,_U%!56)")
 1936    ENDIF
 1937  ENDIF
 1938  PROCshell_OpenMenu(_U%!36,_U%!40,_U%!24)
 1939ELSE
 1940  _shell_FontMenuSelFN$=""
 1941ENDIF
 1942PROCshell_HeapBlockReturn(h_blk%)
 1943ENDPROC
 1944:
 1945*|Stop PROCshell_ActionMenuSelect
 1946
 1947*|Start PROCshell_ActionAdjustButton
 1948DEF PROCshell_ActionAdjustButton
 1949PROCshell_Tracef0("Action:Mouse Button was ADJUST")
 1950PROCshell_HandleAttachedMenu(_Q%,_U%!28,_U%!32)
 1951fn$=FNshell_GetEventHandler(_U%!28,_U%!32,3)
 1952IF fn$<>"" THEN
 1953  PROCshell_IconSlab(1,_U%!28,_U%!32)
 1954  void%=EVAL("FN"+fn$+"(_temp28%,_temp32%)")
 1955ENDIF
 1956ENDPROC
 1957*|Stop PROCshell_ActionAdjustButton
 1958*|Start FNshiftmenuclick
 1959DEF FNshiftmenuclick(wh%,ih%)
 1960=TRUE
 1961:
 1962*|Stop FNshiftmenuclick
 1963*|Start PROCshell_IconSlab
 1964DEF PROCshell_IconSlab(button%,wh%,ih%)
 1965LOCAL blk%
 1966blk%=FNshell_HeapBlockFetch(50)
 1967blk%!8=button%:blk%!12=wh%:blk%!16=ih%
 1968SYS "Interface_SlabButton",,blk%
 1969blk%!8=0
 1970SYS "Interface_SlabButton",,blk%
 1971PROCshell_HeapBlockReturn(blk%)
 1972ENDPROC
 1973:
 1974*|Stop PROCshell_IconSlab
 1975DEF PROCshell_PointerLeavingWindow
 1976ENDPROC
 1977:
 1978DEF PROCshell_PointerEnteringWindow
 1979ENDPROC
 1980:
 1981*|Start PROCshell_RedrawWindow
 1982DEF PROCshell_RedrawWindow(handle%)
 1983LOCAL more%,fn$,x0%,y0%,blk%
 1984blk%=FNshell_HeapBlockFetch(100)
 1985fn$=FNshell_GetEventHandler(handle%,-1,4)
 1986blk%!0=handle%
 1987SYS "Wimp_RedrawWindow",,blk% TO more%
 1988x0%=blk%!4-blk%!20:y0%=blk%!16-blk%!24
 1989WHILE more%
 1990  SYS "Interface_Render3dWindow",,blk%
 1991  IF fn$<>"" THEN void%=EVAL("FN"+fn$+"("+STR$blk%+","+STR$x0%+","+STR$y0%+")")
 1992  SYS "Wimp_GetRectangle",,blk% TO more%
 1993ENDWHILE
 1994PROCshell_HeapBlockReturn(blk%)
 1995ENDPROC
 1996:
 1997*|Stop PROCshell_RedrawWindow
 1998
 1999*|Start PROCshell_Receive
 2000DEF PROCshell_Receive(_Q%)
 2001LOCAL temp%,void%
 2002CASE _Q%!16 OF
 2003WHEN 0     :PROCshell_Exit:END
 2004WHEN 1     :PROCshell_DataSave(_Q%)
 2005WHEN 2     :PROCshell_DataSaveAck(_Q%)
 2006WHEN 3     :PROCshell_DataLoad(_Q%,FALSE)
 2007WHEN 4     :PROCshell_DataLoadAck(_Q%)
 2008WHEN 5     :PROCshell_DataLoad(_Q%,TRUE)
 2009WHEN 6     :PROCshell_RAMFetch(_Q%)
 2010WHEN 7     :PROCshell_RAMTransmit(_Q%)
 2011WHEN 8     :PROCshell_Message_PreQuit(_Q%)
 2012WHEN 9     :IF _U%!164>0 THEN
 2013              *|ifdef TraceInit
 2014              PROCshell_Tracef0("Receive:PaletteChange message received")
 2015              *|endif
 2016              temp%=_U%!164
 2017              void%=EVAL("FN"+$temp%)
 2018            ENDIF
 2019WHEN 10    :PROCshell_Message_SaveDesktop(_Q%)
 2020WHEN 14    :PROCshell_Message_Shutdown(_Q%)
 2021WHEN &502  :PROCshell_InteractiveHelp(_Q%)
 2022WHEN &400C0:PROCshell_MenuWarning(_Q%)
 2023WHEN &400C1:PROCshell_Message_ModeChange(_Q%)
 2024WHEN &400C2:REM TaskInitialise
 2025            IF _U%!168>0 THEN
 2026              *|ifdef TraceInit
 2027              PROCshell_Tracef0("Receive:TaskInitialise message received")
 2028              *|endif
 2029              temp%=_U%!168
 2030              void%=EVAL("FN"+$temp%)
 2031            ENDIF
 2032            IF _U%!208=-1 AND FNshell_GetString(_Q%+28)="StrongHelp" THEN
 2033              _U%!208=_Q%!4
 2034              PROCshell_StrongHlpMsg("Help_Install -DieWithTask "+FNshell_GetAppDir+"."+FNshell_GetAppName)
 2035              temp%=_U%!216
 2036              IF $temp%<>"" THEN
 2037                PROCshell_HelpWord($temp%)
 2038                PROCshell_HeapBlockReturn(_U%!216)
 2039                _U%!216=0
 2040              ENDIF
 2041            ENDIF
 2042WHEN &400C3:REM TaskCloseDown
 2043            IF _U%!172>0 THEN
 2044*|ifdef TraceInit
 2045  PROCshell_Tracef0("Receive:TaskCloseDown message received")
 2046*|endif
 2047              temp%=_U%!172
 2048              void%=EVAL("FN"+$temp%)
 2049            ENDIF
 2050            IF _Q%!4=_U%!208 THEN _U%!208=-1
 2051WHEN &400C7:REM TaskNameIs
 2052*|ifdef TraceInit
 2053  PROCshell_Tracef0("Receive:TaskNameIs message received")
 2054*|endif
 2055            IF FNshell_GetString(_Q%+28) = "StrongHelp" THEN
 2056              _U%!208=_Q%!20:REM store task handle of StrongHlp...
 2057            ELSE
 2058              PROCshell_ScanForHelp
 2059            ENDIF
 2060OTHERWISE  :PROCshell_HandleUnknownMessage2(_Q%)
 2061ENDCASE
 2062ENDPROC
 2063:
 2064*|Stop PROCshell_Receive
 2065
 2066*|Start PROCshell_Message_ModeChange
 2067DEF PROCshell_Message_ModeChange(_Q%)
 2068IF _U%!160>0 THEN
 2069  PROCshell_Tracef0("Message_ModeChange:ModeChange message received")
 2070  temp%=_U%!160
 2071  void%=EVAL("FN"+$temp%)
 2072ENDIF
 2073REM SYS "FontWindow_ModeChange",_U%!148
 2074ENDPROC
 2075*|Stop PROCshell_Message_ModeChange
 2076
 2077*|Start PROCshell_Message_Shutdown
 2078DEF PROCshell_Message_Shutdown(_Q%)
 2079IF _U%!312>0 THEN
 2080  PROCshell_Tracef0("Message_Shutdown:Shutdown message received")
 2081  temp%=_U%!312
 2082  void%=EVAL("FN"+$temp%)
 2083ENDIF
 2084ENDPROC
 2085*|Stop PROCshell_Message_Shutdown
 2086
 2087*|Start PROCshell_HandleUnknownMessage2
 2088DEF PROCshell_HandleUnknownMessage2(_Q%)
 2089LOCAL message$
 2090REM I want to handle message &43B00 here as I use it for
 2091REM communications between EvntShell applications..
 2092CASE _Q%!16 OF
 2093  WHEN &43B00:REM incoming EvntShell message...
 2094    message$=$(_Q%+20)
 2095    IF LEFT$(message$,20)="EvntShellLib:TraceOn" THEN
 2096      PROCshell_TraceOn
 2097    ENDIF
 2098    IF LEFT$(message$,21)="EvntShellLib:TraceOff" THEN
 2099      PROCshell_TraceOff
 2100    ENDIF
 2101    IF LEFT$(message$,28)="EvntShellLib:ListClickSelect" THEN
 2102      PROCshell_ListClickSelect
 2103    ENDIF
 2104    IF LEFT$(message$,28)="EvntShellLib:ListClickAdjust" THEN
 2105      PROCshell_ListClickAdjust
 2106    ENDIF
 2107    IF LEFT$(message$,25)="EvntShellLib:ListHelpTags" THEN
 2108      PROCshell_ListHelpTags
 2109    ENDIF
 2110ENDCASE
 2111REM Pass message block on in case the user wants it too..
 2112PROCshell_HandleUnknownMessage(_Q%)
 2113ENDPROC
 2114:
 2115*|Stop PROCshell_HandleUnknownMessage2
 2116
 2117*|Start PROCshell_HandleUnknownMessage
 2118DEF PROCshell_HandleUnknownMessage(_Q%)
 2119ENDPROC
 2120:
 2121*|Stop PROCshell_HandleUnknownMessage
 2122
 2123*|Start PROCshell_AttachPreQuitHandler
 2124DEF PROCshell_AttachPreQuitHandler(fn$)
 2125LOCAL temp%,void%
 2126IF _U%!300>0 THEN PROCshell_HeapBlockReturn(_U%!300)
 2127_U%!300=FNshell_HeapBlockFetch(LENfn$+1)
 2128temp%=_U%!300:$temp%=fn$
 2129ENDPROC
 2130:
 2131*|Stop PROCshell_AttachPreQuitHandler
 2132
 2133*|Start PROCshell_AttachShutdownHandler
 2134DEF PROCshell_AttachShutdownHandler(fn$)
 2135LOCAL temp%,void%
 2136IF _U%!312>0 THEN PROCshell_HeapBlockReturn(_U%!312)
 2137_U%!312=FNshell_HeapBlockFetch(LENfn$+1)
 2138temp%=_U%!312:$temp%=fn$
 2139ENDPROC
 2140:
 2141*|Stop PROCshell_AttachShutdownHandler
 2142
 2143*|Start PROCshell_AttachModeChangeHandler
 2144DEF PROCshell_AttachModeChangeHandler(fn$)
 2145LOCAL temp%,void%
 2146IF _U%!160>0 THEN PROCshell_HeapBlockReturn(_U%!160)
 2147_U%!160=FNshell_HeapBlockFetch(LENfn$+1)
 2148temp%=_U%!160:$temp%=fn$
 2149void%=EVAL("FN"+fn$)
 2150ENDPROC
 2151:
 2152*|Stop PROCshell_AttachModeChangeHandler
 2153
 2154*|Start PROCshell_AttachPaletteChangeHandler
 2155DEF PROCshell_AttachPaletteChangeHandler(fn$)
 2156LOCAL temp%,void%
 2157IF _U%!164>0 THEN PROCshell_HeapBlockReturn(_U%!164)
 2158_U%!164=FNshell_HeapBlockFetch(LENfn$+1)
 2159temp%=_U%!164:$temp%=fn$
 2160void%=EVAL("FN"+fn$)
 2161ENDPROC
 2162:
 2163*|Stop PROCshell_AttachPaletteChangeHandler
 2164
 2165*|Start PROCshell_AttachTaskInitialiseHandler
 2166DEF PROCshell_AttachTaskInitialiseHandler(fn$)
 2167LOCAL temp%,void%
 2168IF _U%!168>0 THEN PROCshell_HeapBlockReturn(_U%!168)
 2169_U%!168=FNshell_HeapBlockFetch(LENfn$+1)
 2170temp%=_U%!168:$temp%=fn$
 2171ENDPROC
 2172:
 2173*|Stop PROCshell_AttachTaskInitialiseHandler
 2174
 2175*|Start PROCshell_AttachTaskCloseDownHandler
 2176DEF PROCshell_AttachTaskCloseDownHandler(fn$)
 2177LOCAL temp%,void%
 2178IF _U%!172>0 THEN PROCshell_HeapBlockReturn(_U%!172)
 2179_U%!172=FNshell_HeapBlockFetch(LENfn$+1)
 2180temp%=_U%!172:$temp%=fn$
 2181ENDPROC
 2182:
 2183*|Stop PROCshell_AttachTaskCloseDownHandler
 2184
 2185*|Start PROCshell_RAMFetch
 2186DEF PROCshell_RAMFetch(_Q%)
 2187LOCAL RAMFetch_buffer%,len_data%,done%
 2188done%=FALSE
 2189REM If the address in the data save event block <&8000 then it is an
 2190REM estimated size and the file is not already present in a RAM buffer.
 2191REM In this case ignore RAMFetch message as the data will be written to a
 2192REM file anyway..
 2193IF _U%!144>&8000 THEN
 2194  REM Send file to application
 2195  REM send RAMTransmit message...
 2196*|ifdef TraceInit
 2197  PROCshell_Tracef0("RAMFetch:RAMFetch called..")
 2198*|endif
 2199  _Q%!12=_Q%!08
 2200  _Q%!16=7:REM message action RAMTransmit
 2201  REM get buffer length..
 2202  len_data%=_U%!136
 2203  IF _U%!140=&FF9 THEN
 2204    REM kludge for sprite files because when saving to a physical file
 2205    REM with "OS_SpriteOp" the first word is dropped. Hence for the RAM
 2206    REM save we have to incrememt the address the data is held at by 4!
 2207    REM The estimated size has already been kludged in shell_AttachDataSave
 2208    _U%!144+=4
 2209  ENDIF
 2210  IF (len_data%-_U%!128)<_Q%!24 THEN
 2211    REM  This will be the last block
 2212    _Q%!24=len_data%-_U%!128
 2213    done%=TRUE
 2214  ELSE
 2215*|ifdef TraceInit
 2216  PROCshell_Tracef0("RAMFetch:Sending block")
 2217*|endif
 2218  ENDIF
 2219  SYS "Wimp_TransferBlock",_U%!148,_U%!144+_U%!128,_Q%!04,_Q%!20,_Q%!24
 2220  SYS "Wimp_SendMessage",17,_Q%,_Q%!04
 2221  _U%!120=_Q%!8  :REM SaveRef%
 2222  _U%!128+=_Q%!24:REM RAMPtr%
 2223  IF done% THEN _U%!128=0
 2224ENDIF
 2225ENDPROC
 2226:
 2227*|Stop PROCshell_RAMFetch
 2228*|Start PROCshell_RAMTransmit
 2229DEF PROCshell_RAMTransmit(_Q%)
 2230LOCAL offset%,blk%,f_name$,temp%
 2231REM Receive file from application via RAM transfer..
 2232IF _Q%!12=_U%!112 THEN
 2233  _U%!128+=_Q%!24
 2234  IF _Q%!24<_U%!132 THEN
 2235    REM This was the last block
 2236*|ifdef TraceInit
 2237  PROCshell_Tracef0("RAMTransmit:Last block received")
 2238*|endif
 2239    offset%=FNshell_GetEventListOffset(_U%!28,_U%!32,_U%+96,16,FALSE)
 2240    blk%=_U%!96+offset%
 2241  *|ifdef TraceInit
 2242  PROCshell_Tracef0("RAMTransmit:_U%!28="+STR$_U%!28)
 2243  PROCshell_Tracef0("RAMTransmit:_U%!32="+STR$_U%!32)
 2244  PROCshell_Tracef0("RAMTransmit:offset%="+STR$offset%)
 2245  *|endif
 2246    REM now call user function after file load...
 2247    REM use copy of datasave message block to find file type, file name...
 2248    temp%=_U%!156
 2249    f_name$=FNshell_GetString(temp%+44)
 2250    PROCshell_UserFNLoadFile(temp%!40,_U%!152,blk%!8,f_name$,_U%!132,blk%)
 2251  ELSE
 2252    REM There are more blocks to come
 2253*|ifdef TraceInit
 2254  PROCshell_Tracef0("RAMTransmit:Block received")
 2255*|endif
 2256    REM check size of incoming block and increase buffer if
 2257    REM required...
 2258    IF _U%!128>_U%!132 THEN
 2259*|ifdef TraceInit
 2260  PROCshell_Tracef0("RAMTransmit:Increasing buffer size..")
 2261*|endif
 2262      _U%!152=FNshell_HeapBlockExtend(_U%!152,_U%!128,_U%!132)
 2263    ENDIF
 2264    _Q%!12=_Q%!08
 2265    _Q%!16=6
 2266    _Q%!20=_U%!152+_U%!128
 2267    _Q%!24=_U%!132
 2268    SYS "Wimp_SendMessage",18,_Q%,_Q%!04
 2269    _U%!112=_Q%!08
 2270  ENDIF
 2271ELSE
 2272  REM too much data sent...
 2273  PROCshell_HeapBlockReturn(_U%!152)
 2274  _U%!152=0
 2275  PROCshell_OK(FNshell_MessageNoArgs("SHELLMSG15"))
 2276ENDIF
 2277ENDPROC
 2278:
 2279*|Stop PROCshell_RAMTransmit
 2280*|Start FNshell_LoadFile
 2281DEF FNshell_LoadFile(Scrap%)
 2282LOCAL Name$,FileSize%,Flags%,loadloc%
 2283Name$=FNshell_GetString(_Q%+44)
 2284FileSize%=FNshell_FileLength(Name$)
 2285IF FileSize%<0 THEN PROCshell_OK(FNshell_MessageNoArgs("SHELLMSG16"))
 2286loadloc%=FNshell_HeapBlockFetch(FileSize%)
 2287SYS "XOS_File",16,Name$,loadloc%,0 TO ;Flags%
 2288IF FNshell_VFlag(Flags%) THEN
 2289  PROCshell_HeapBlockReturn(loadloc%)
 2290  PROCshell_OK(FNshell_MessageNoArgs("SHELLMSG17"))
 2291ELSE
 2292*|ifdef TraceInit
 2293  PROCshell_Tracef0("LoadFile:File "+Name$+" loaded ok at &"+STR$~loadloc%)
 2294*|endif
 2295ENDIF
 2296REM Stuff for fileinfo box...........
 2297REM PROCDate(FNFileTimeAndDate(Name$))
 2298REM IF Scrap% THEN
 2299REM   SYS "XOS_FSControl",27,(_Q%+44),,2
 2300REM   PROCModified(TRUE)
 2301REM ELSE
 2302REM   PROCName(Name$)
 2303REM   PROCType(_Q%!40)
 2304REM   PROCModified(FALSE)
 2305REM ENDIF
 2306REM PROCNewFile
 2307=loadloc%
 2308:
 2309*|Stop FNshell_LoadFile
 2310
 2311*|Start FNshell_VFlag
 2312DEF FNshell_VFlag(Flags%)
 2313=((Flags% AND %0001)=%0001)
 2314:
 2315*|Stop FNshell_VFlag
 2316
 2317*|Start FNshell_CheckType
 2318DEF FNshell_CheckType(type%,type_list%,DataOpen%)
 2319REM Exclude directories, applications & unstamped files
 2320REM type_list% is address of heapblock holding a list
 2321REM of allowable filetypes terminated by -1..
 2322LOCAL Ok%,ctr%,found%,temp%,topbit_load%
 2323ctr%=0:found%=-1:topbit_load%=FALSE
 2324IF _U%!100 AND 1<<1 THEN _U%!100=_U%!100 EOR 1<<1
 2325WHILE type_list%!ctr%<>-1
 2326  temp%=type_list%!ctr%
 2327  IF temp% AND 1<<31 THEN
 2328    temp%=temp% EOR 1<<31
 2329    topbit_load%=TRUE
 2330  ELSE
 2331    topbit_load%=FALSE
 2332  ENDIF
 2333  IF temp%=type% THEN
 2334    found%=ctr%
 2335    IF topbit_load% THEN
 2336      _U%!100=_U%!100 OR 1<<1
 2337      *|ifdef TraceInit
 2338      PROCshell_Tracef0("CheckType:Top Bit Load detected..")
 2339      *|endif
 2340    ENDIF
 2341  ENDIF
 2342  ctr%+=4
 2343ENDWHILE
 2344IF DataOpen% AND (type%>=&1000) THEN found%=-1
 2345*|ifdef TraceInit
 2346IF found%>-1 THEN
 2347  PROCshell_Tracef0("CheckType:File type OK "+STR$~type_list%!found%)
 2348ELSE
 2349  PROCshell_Tracef0("CheckType:File type NOT ok "+STR$~type%)
 2350ENDIF
 2351*|endif
 2352IF found%<>-1 THEN =TRUE ELSE =FALSE
 2353:
 2354*|Stop FNshell_CheckType
 2355
 2356*|Start PROCshell_Exit
 2357DEF PROCshell_Exit
 2358LOCAL ms_desc%
 2359ms_desc%=_U%!68
 2360SYS "XMessageTrans_CloseFile",ms_desc%
 2361SYS "XOS_Module",7,,ms_desc%
 2362*|ifdef TraceInit
 2363PROCshell_Tracef0("Exit:Application closing down")
 2364*|endif
 2365PROCshell_TraceExit
 2366SYS "Hourglass_Smash"
 2367SYS "Wimp_DragBox",,-1
 2368PROCshell_WimpCloseDown_I(_U%!148)
 2369ENDPROC
 2370:
 2371*|Stop PROCshell_Exit
 2372
 2373*|Start PROCshell_DataLoad
 2374DEF PROCshell_DataLoad(_Q%,DataOpen%)
 2375LOCAL reference%,offset%,blk%,_temp%,type_list%,type%,fname$
 2376type%=_Q%!40
 2377fname$=FNshell_GetString(_Q%+44)
 2378*|ifdef TraceInit
 2379PROCshell_Tracef0("DataLoad:DataLoad message received")
 2380*|endif
 2381REM check my_file_type set up in shell_AttachDataLoad
 2382REM only works when dragging a file as when DataOpen% is TRUE
 2383REM the _Q% block is set up differently!!
 2384IF DataOpen% THEN
 2385  REM double click load..
 2386  REM check if there are any dataload events set up...
 2387  IF _U%!96<>0 THEN
 2388    offset%=0:REM look at first dataload event only...
 2389  ELSE
 2390    offset%=-1:REM ignore it...
 2391  ENDIF
 2392ELSE
 2393  REM drag load, check for specific window/icon event..
 2394  offset%=FNshell_GetEventListOffset(_Q%!20,_Q%!24,_U%+96,16,FALSE)
 2395  IF offset%=-1 THEN
 2396    REM now check for window handle only..
 2397    offset%=FNshell_GetEventListOffset(_Q%!20,-1,_U%+96,16,FALSE)
 2398  ENDIF
 2399ENDIF
 2400IF offset%>-1 THEN
 2401  REM DataLoadEvent exists
 2402  blk%=_U%!96+offset%
 2403  IF FNshell_CheckType(_Q%!40,blk%!8,DataOpen%) THEN
 2404    REM file type is ok...
 2405    *|ifdef TraceInit
 2406    PROCshell_Tracef0("DataLoad:File type recognised (&"+STR$~_Q%!40+")")
 2407    *|endif
 2408    Reference%=_Q%!12
 2409    _Q%!12=_Q%!8
 2410    _Q%!16=4
 2411    SYS "Wimp_SendMessage",18,_Q%,_Q%!4
 2412    IF _U%!100 AND 1<<1 THEN
 2413      loadloc%=-1
 2414      _U%!100=_U%!100 EOR 1<<1
 2415    ELSE
 2416      loadloc%=FNshell_LoadFile(Reference%=_U%!108)
 2417    ENDIF
 2418    PROCshell_UserFNLoadFile(type%,loadloc%,blk%!8,fname$,_Q%!36,blk%)
 2419    REM return copy of datasave message block...
 2420    IF _U%!156<>0 THEN
 2421      PROCshell_HeapBlockReturn(_U%!156)
 2422      _U%!156=0
 2423    ENDIF
 2424  ELSE
 2425  *|ifdef TraceInit
 2426  PROCshell_Tracef0("DataLoad:File type NOT recognised (&"+STR$~_Q%!40+")")
 2427  *|endif
 2428  ENDIF
 2429ENDIF
 2430
 2431ENDPROC
 2432:
 2433*|Stop PROCshell_DataLoad
 2434
 2435*|Start PROCshell_UserFNLoadFile
 2436DEF PROCshell_UserFNLoadFile(type%,loadloc%,type_list%,_filename$,_file_size%,blk%)
 2437LOCAL ctr%,found%,temp%,void%
 2438REM call user function after loading file...
 2439ctr%=0:found%=-1
 2440WHILE type_list%!ctr%<>-1
 2441  temp%=type_list%!ctr%
 2442  IF temp% AND 1<<31 THEN temp%=temp% EOR 1<<31
 2443  IF temp%=type% THEN found%=ctr%
 2444  ctr%+=4
 2445ENDWHILE
 2446temp%=blk%!12
 2447void%=EVAL("FN"+$(temp%!found%)+"("+STR$loadloc%+","+STR$type%+",_filename$,"+STR$_file_size%+")")
 2448ENDPROC
 2449:
 2450*|Stop PROCshell_UserFNLoadFile
 2451
 2452*|Start PROCshell_DataSave
 2453DEF PROCshell_DataSave(_Q%)
 2454LOCAL temp%,offset%,blk%,loop%
 2455REM Called when another application wants to save data to our one..
 2456*|ifdef TraceInit
 2457PROCshell_Tracef0("DataSave:DataSave message received")
 2458*|endif
 2459REM Receive file from application, but check first it didn't come from 
 2460REM this one!
 2461IF _Q%!04<>_U%!148 THEN
 2462  REM check event list for window/icon at this point to see
 2463  REM which filetypes are valid...
 2464  offset%=FNshell_GetEventListOffset(_Q%!20,_Q%!24,_U%+96,16,FALSE)
 2465  IF offset%>-1 THEN
 2466    blk%=_U%!96+offset%
 2467    IF FNshell_CheckType(_Q%!40,blk%!8,FALSE) THEN
 2468      *|ifdef TraceInit
 2469      PROCshell_Tracef0("DataSave:Filetype recognized (&"+STR$~_Q%!40+")")
 2470      *|endif
 2471      IF FNshell_TopBitLoadInProgress THEN
 2472        REM 'no load' load taking place, just need the full filename so that
 2473        REM the user app can do the load - therefore send Message_DataSaveAck
 2474        REM with Wimp$Scrap as the filename..
 2475        *|ifdef TraceInit
 2476        PROCshell_Tracef0("DataSave:'no load' flag set")
 2477        PROCshell_Tracef0("DataSave:Sending Message_DataSaveAck")
 2478        *|endif
 2479        _Q%!00=256
 2480        _Q%!12=_Q%!08:_Q%!36=-1:_Q%!16=2:REM Message_DataSaveAck
 2481        $(_Q%+44)=FNshell_GetAppDir+".ScrapFile"+CHR$0
 2482       SYS "Wimp_SendMessage",18,_Q%,_Q%!04
 2483      ELSE
 2484        REM Normal load from another application therefore offer to perform
 2485        REM a RAM file transfer with Message_RAMFetch..
 2486        REM Make a copy of the message block as I need it when RAM transfer
 2487        REM is not supported by the sender of this message
 2488        PROCshell_HeapBlockReturn(_U%!156):REM return temp message blk..
 2489        _U%!156=FNshell_HeapBlockFetch((_Q%!0)+8)
 2490        temp%=_U%!156
 2491        FOR loop%=0 TO _Q%!0 STEP 4:REM first word is size...
 2492          temp%!loop%=_Q%!loop%
 2493        NEXT loop%
 2494        REM store destination window/icon handles for later...
 2495        _U%!28=_Q%!20:_U%!32=_Q%!24
 2496        _U%!128=0
 2497        _U%!132=_Q%!36:REM RAMSize%=est_size%
 2498        REM set up heapblock to hold loaded file...
 2499        _U%!152=FNshell_HeapBlockFetch(_Q%!36)
 2500        REM And here we go !
 2501        _Q%!00=28
 2502        _Q%!12=_Q%!08
 2503        _Q%!16=6:REM Message_RAMFetch..
 2504        _Q%!20=_U%!152+_U%!128
 2505        _Q%!24=_U%!132
 2506        SYS "Wimp_SendMessage",18,_Q%,_Q%!04
 2507        _U%!112=_Q%!08
 2508        *|ifdef TraceInit
 2509        PROCshell_Tracef0("DataSave:Sending Message_RAMFetch")
 2510        *|endif
 2511      ENDIF
 2512    ELSE
 2513      *|ifdef TraceInit
 2514      PROCshell_Tracef0("DataSave:Filetype NOT recognized")
 2515      *|endif
 2516    ENDIF
 2517  ENDIF
 2518ENDIF
 2519ENDPROC
 2520:
 2521*|Stop PROCshell_DataSave
 2522
 2523REM Set all this stuff beforehand as RAM transfer
 2524REM procedures may be entered more than once !
 2525REM PROCName(FNLeaf(FNGetString(PollPtr%+44)))
 2526REM PROCType(PollPtr%!40)
 2527REM PROCModified(TRUE)
 2528REM PROCDate(FNCurrentTimeAndDate)
 2529*|Start FNshell_TopBitLoadInProgress
 2530DEF FNshell_TopBitLoadInProgress
 2531IF _U%!100 AND 1<<1 THEN =TRUE ELSE =FALSE
 2532:
 2533*|Stop  FNshell_TopBitLoadInProgress
 2534*|Start PROCshell_SendDataSave
 2535DEF PROCshell_SendDataSave(wh%,ih%)
 2536LOCAL blk%,msgblk%,tmpblk%,offset%,FileSize%,void%
 2537tmpblk%=FNshell_HeapBlockFetch(30)
 2538REM retrieve current position of pointer (window and icon over which
 2539REM the drag event ended plus pointer position)
 2540SYS "Wimp_GetPointerInfo",,tmpblk%
 2541offset%=FNshell_GetEventListOffset(wh%,ih%,_U%+72,24,FALSE)
 2542IF offset%=-1 OR offset%=-2 THEN
 2543  void%=FNshell_MessageWindow(FNshell_MessageNoArgs("SHELLMSG13"),0,"",FNshell_MessageNoArgs("warning"))
 2544ELSE
 2545  blk%=(_U%!72)+offset%
 2546  IF blk%!8>&8000 THEN
 2547    FileSize%=FNshell_HeapBlockInfo(blk%!8)-4
 2548  ELSE
 2549    FileSize%=blk%!8
 2550  ENDIF
 2551  msgblk%=_U%!76
 2552  msgblk%!0 =256       :REM length of message block
 2553  msgblk%!12=0         :REM myref 0=originating
 2554  msgblk%!16=1         :REM message action
 2555  msgblk%!20=tmpblk%!12:REM destination window handle
 2556  msgblk%!24=tmpblk%!16:REM destination icon handle
 2557  msgblk%!28=tmpblk%!0 :REM mouse x coord
 2558  msgblk%!32=tmpblk%!4 :REM mouse y coord
 2559  msgblk%!36=FileSize% :REM estimated size of file
 2560  msgblk%!40=blk%!12   :REM file type
 2561  $(msgblk%+44)=FNshell_Leaf(FNshell_IconGetData(wh%,blk%!16))
 2562  SYS "Wimp_SendMessage",18,msgblk%,msgblk%!20,msgblk%!24
 2563  _U%!120=_Q%!8
 2564  _U%!136=FileSize% :REM FileSize%
 2565  _U%!140=blk%!12   :REM FileType%
 2566  _U%!144=blk%!8    :REM FileBuff%
 2567  _U%!156=blk%!4    :REM TaskHandle%
 2568  _U%!200=msgblk%!20:REM window handle
 2569  _U%!204=msgblk%!24:REM icon handle
 2570ENDIF
 2571PROCshell_HeapBlockReturn(tmpblk%)
 2572ENDPROC
 2573:
 2574*|Stop PROCshell_SendDataSave
 2575*|Start PROCshell_DataSaveAck
 2576DEF PROCshell_DataSaveAck(_Q%)
 2577LOCAL _fullname$,a%,b%,blk%,temp%,void%
 2578*|ifdef TraceInit
 2579PROCshell_Tracef0("DataSaveAck:DataSaveAck message received")
 2580*|endif
 2581a%=0:b%=_Q%?(44+a%)
 2582WHILE b%<>0
 2583  _fullname$+=CHR$(b%)
 2584  a%+=1
 2585  b%=_Q%?(44+a%)
 2586ENDWHILE
 2587*|ifdef TraceInit
 2588PROCshell_Tracef0("DataSaveAck:Full save name is: "+_fullname$)
 2589PROCshell_Tracef0("DataSaveAck:task="+STR$_Q%!4)
 2590PROCshell_Tracef0("DataSaveAck:mytask="+STR$_U%!148)
 2591*|endif
 2592offset%=FNshell_GetEventListOffset(_U%!28,_U%!32,_U%+72,24,FALSE)
 2593IF offset%=-1 OR offset%=-2 THEN ERROR 99,FNshell_MessageNoArgs("SHELLMSG05")
 2594blk%=(_U%!72)+offset%
 2595temp%=blk%!20
 2596REM now call the file saving routine......
 2597IF $temp%<>"" THEN
 2598  void%=EVAL("FN"+$temp%+"(_fullname$)")
 2599ELSE
 2600  REM no file saving routine specified for this event, so check if data is in a
 2601  REM heapblock..
 2602  IF FNshell_HeapBlockExists(blk%!8) THEN
 2603    REM default save routine, just save the whole heapblock to disk..
 2604    SYS "OS_File",10,_fullname$,blk%!12,,blk%!8,blk%!8+FNshell_HeapBlockInfo(blk%!8)+1
 2605  ELSE
 2606    REM Whoops! not a heapblock - someone's screwed up..
 2607    ERROR 99,FNshell_MessageNoArgs("SHELLMSG21")
 2608  ENDIF
 2609ENDIF
 2610IF _Q%!36>-1 THEN
 2611  REM file is secure
 2612  IF _U%!80<>0 THEN PROCshell_HeapBlockReturn(_U%!80)
 2613  _U%!80=FNshell_HeapBlockFetch(LEN_fullname$+1)
 2614  temp%=_U%!80
 2615  $temp%=_fullname$
 2616ENDIF
 2617_Q%!16=3:!_Q%=256:_Q%!20=_U%!200:_Q%!24=_U%!204:_Q%!40=_U%!140
 2618_Q%!36=FNshell_FileLength(_fullname$):_Q%!12=_Q%!8
 2619*|ifdef TraceInit
 2620PROCshell_Tracef0("DataSaveAck:File length is "+STR$_Q%!36+" bytes")
 2621*|endif
 2622$(_Q%+44)=_fullname$+CHR$(0)
 2623REM send dataload message
 2624REM store my_ref
 2625_U%!84=_Q%!8
 2626*|ifdef TraceInit
 2627PROCshell_Tracef0("DataSaveAck:Sending DataLoad Message")
 2628*|endif
 2629SYS "Wimp_SendMessage",18,_Q%,_Q%!20,_Q%!24
 2630REM now close window that save originated from if it is not a
 2631REM 'dynamic' dbox
 2632IF _U%!28<>_U%!20 THEN
 2633  PROCshell_CloseWindow(_U%!28)
 2634ENDIF
 2635SYS "Wimp_CreateMenu",,-1:REM close any open menus
 2636ENDPROC
 2637:
 2638*|Stop PROCshell_DataSaveAck
 2639*|Start PROCshell_DataSaveCheckName
 2640DEF PROCshell_DataSaveCheckName(wh%,ih%)
 2641LOCAL offset%,blk%,list_size%
 2642REM Routine to check if a 'datasave' event exists in the window wh%.
 2643REM If it does then the filename is checked for a '.' character. An
 2644REM error is generated if no '.' is found. This routine is called by
 2645REM the library when a mouse click on icon 0 is detected.
 2646blk%=_U%!72:offset%=0
 2647IF blk%<>0 THEN
 2648  list_size%=FNshell_HeapBlockInfo(blk%)-8
 2649  REM blk%<>0 therefore a datasave event list exists..
 2650  REPEAT
 2651    REM check window handles of events in list..
 2652    IF !(blk%+offset%)=wh% THEN
 2653      REM check for a valid path name..
 2654      name$=FNshell_IconGetData(!blk%,blk%!16)
 2655      IF INSTR(name$,".")=0 THEN PROCshell_OK(FNshell_MessageNoArgs("SHELLMSG01"))
 2656      offset%=list_size%:REM window handle found so abort check..
 2657    ENDIF
 2658    offset%+=24:REM check next event..
 2659  UNTIL offset%>=list_size%
 2660ENDIF
 2661ENDPROC
 2662:
 2663*|Stop PROCshell_DataSaveCheckName
 2664*|Start PROCshell_DataLoadAck
 2665DEF PROCshell_DataLoadAck(_Q%)
 2666*|ifdef TraceInit
 2667PROCshell_Tracef0("DataLoadAck:DataLoadAck message received (file received ok)")
 2668*|endif
 2669ENDPROC
 2670:
 2671*|Stop PROCshell_DataLoadAck
 2672*|Start PROCshell_UserMessageAcknowledge
 2673DEF PROCshell_UserMessageAcknowledge(_Q%)
 2674CASE _Q%!16 OF
 2675  WHEN 3:PROCshell_AckDataLoad(_Q%)
 2676  WHEN 6:PROCshell_AckRAMFetch(_Q%)
 2677ENDCASE
 2678ENDPROC
 2679:
 2680*|Stop PROCshell_UserMessageAcknowledge
 2681*|Start PROCshell_AckDataLoad
 2682DEF PROCshell_AckDataLoad(_Q%)
 2683IF _Q%!12<>_U%!84 THEN
 2684  REM Reference hasn't been updated,
 2685  REM therefore the Wimp returned my call
 2686  REM The receiver didn't understand scrap transfer
 2687  SYS "XOS_File",6,"<Wimp$Scrap>"
 2688  ERROR 255,"Data Transfer failed: Receiver died"
 2689ENDIF
 2690ENDPROC
 2691:
 2692*|Stop PROCshell_AckDataLoad
 2693*|Start PROCshell_AckRAMFetch
 2694DEF PROCshell_AckRAMFetch(_Q%)
 2695LOCAL Exist%,temp%
 2696temp%=_U%!156
 2697*|ifdef TraceInit
 2698PROCshell_Tracef0("AckRAMFetch:AckRAMFetch called....")
 2699*|endif
 2700IF _Q%!12<>_U%!112 THEN
 2701  REM Reference hasn't been updated,
 2702  REM therefore the Wimp returned my call
 2703  IF _U%!128=0 THEN
 2704    REM The receiver didn't support RAM transfer
 2705*|ifdef TraceInit
 2706  PROCshell_Tracef0("AckRAMFetch:Receiver does not support RAM transfer")
 2707*|endif
 2708    SYS "XOS_ReadVarVal","Wimp$Scrap",,-1,0,3 TO ,,Exist%
 2709    IF Exist%<>0 THEN
 2710      $(temp%+44)="<Wimp$Scrap>"+CHR$(0)
 2711      temp%!00=(49+LEN(FNshell_GetString(temp%+44)))ANDNOT3
 2712      temp%!12=temp%!08
 2713      temp%!16=2
 2714      temp%!36=-1
 2715      SYS "Wimp_SendMessage",18,temp%,temp%!4
 2716      _U%!108=temp%!08
 2717    ELSE
 2718       PROCshell_OK(FNshell_MessageNoArgs("SHELLMSG14"))
 2719    ENDIF
 2720  ELSE
 2721    REM The receiver has initiated RAM transfer, and this
 2722    REM was successful once, but I expected more data to come
 2723*|ifdef TraceInit
 2724  PROCshell_Tracef0("AckRAMFetch:RAM transfer started, but not enough data sent. Sender died?")
 2725*|endif
 2726    PROCshell_HeapBlockReturn(_U%!152)
 2727    _U%!152=0
 2728    PROCshell_OK("SHELLMSG06")
 2729  ENDIF
 2730ENDIF
 2731ENDPROC
 2732:
 2733*|Stop PROCshell_AckRAMFetch
 2734
 2735*|Start PROCshell_MenuWarning
 2736DEF PROCshell_MenuWarning(_Q%)
 2737LOCAL fn$,menu_buffer%,x%,y%,void%,_temp%,a%,warn_fn$,item_addr%,blk%
 2738x%=_Q%!24:y%=_Q%!28:_U%!264=0
 2739IF _U%!20<>0 THEN
 2740  *|ifdef PROCshell_TraceInit
 2741  PROCshell_Tracef0("MenuWarning:Removing last dynamic dbox (handle=&"+STR$~_U%!20+")")
 2742  *|endif
 2743  void%=FNshell_DeleteWindow(_U%!20)
 2744  *|ifdef PROCshell_TraceInit
 2745  PROCshell_Tracef0("MenuWarning:Last dynamic dbox removed")
 2746  *|endif
 2747ENDIF
 2748REM Check submenu pointer and create window found there
 2749REM Then call pre and post open FNs
 2750REM If submenu pointer is the warning window, open it to remind the user
 2751REM that no dbox has been attached to this menu entry..
 2752CASE _Q%!20 OF
 2753WHEN _U%!228:REM handle of warning dbox..
 2754  REM won't need to do this if title/icon messages are substituted
 2755  REM when loading the templates
 2756  PROCshell_WindowRetitle(_U%!228,FNshell_MessageNoArgs("warning"))
 2757  REM still need to set up the message though...
 2758  PROCshell_IconPutData(_U%!228,1,FNshell_MessageNoArgs("SHELLMSG07"),0)
 2759  VDU7
 2760  SYS "Wimp_CreateSubMenu",,_U%!228,x%,y%
 2761OTHERWISE
 2762  REM Sub menu is either a dialog box, or a menu!!
 2763  item_addr%=FNshell_MenuGetItemAddress(_U%!24,_Q%+32)
 2764  IF FNshell_HeapBlockExists(item_addr%!4) THEN
 2765    REM DBox is attached..
 2766    PROCshell_MenuWarnDBox(item_addr%,x%,y%)
 2767  ELSE
 2768    REM Submenu attached..
 2769    blk%=FNshell_HeapBlockFetch(32)
 2770    SYS "MenuUtil_Decode",_U%!24,_Q%+32 TO ,,blk%
 2771    PROCshell_FindMenuWarnEvent(blk%!8,warn_fn$,sel_fn$)
 2772    PROCshell_HeapBlockReturn(blk%)
 2773    PROCshell_MenuWarnSubMenu(_Q%!20,x%,y%,warn_fn$,sel_fn$)
 2774  ENDIF
 2775ENDCASE
 2776ENDPROC
 2777:
 2778*|Stop PROCshell_MenuWarning
 2779
 2780*|Start PROCshell_MenuWarnDBox
 2781DEF PROCshell_MenuWarnDBox(addr%,x%,y%)
 2782LOCAL temp%,h%,void%
 2783LOCAL ERROR
 2784ON ERROR LOCAL:RESTORE ERROR:ENDPROC
 2785temp%=addr%!4
 2786PROCshell_CreateWindow($temp%!0,h%)
 2787RESTORE ERROR
 2788*|ifdef TraceInit
 2789PROCshell_Tracef0("MenuWarnDBox:Creating new dynamic dbox (handle=&"+STR$~h%+")")
 2790*|endif
 2791IF $temp%!4<>"" THEN
 2792  *|ifdef TraceInit
 2793  PROCshell_Tracef0("MenuWarnDBox:Calling preopen FN '"+$temp%!4+"'")
 2794  *|endif
 2795  void%=EVAL("FN"+$temp%!4+"("+STR$h%+")")
 2796ENDIF
 2797IF $temp%!8<>"" THEN
 2798  *|ifdef TraceInit
 2799  PROCshell_Tracef0("MenuWarnDBox:Calling postopen FN '"+$temp%!8+"'")
 2800  *|endif
 2801  void%=EVAL("FN"+$temp%!8+"("+STR$h%+")")
 2802ENDIF
 2803REM h% is new window handle....
 2804SYS "Wimp_CreateSubMenu",,h%,x%,y%
 2805_U%!20=h%
 2806ENDPROC
 2807:
 2808*|Stop PROCshell_MenuWarnDBox
 2809
 2810*|Start PROCshell_FindMenuWarnEvent
 2811DEF PROCshell_FindMenuWarnEvent(item_handle%,RETURN warn_fn$,RETURN sel_fn$)
 2812LOCAL result%,e_list%,temp%,offset%,found%,list_size%,temp2%,ctr%
 2813LOCAL submenu%
 2814submenu%=0:REM If still 0 on return then no event found..
 2815e_list%=_U%!220:offset%=0:found%=FALSE:warn_fn$="":submenu%=0
 2816IF FNshell_HeapBlockExists(e_list%) THEN
 2817  REPEAT
 2818    ctr%+=4
 2819  UNTIL e_list%!ctr%=-1
 2820  list_size%=ctr%:ctr%=0
 2821  *|ifdef PROCshell_TraceInit
 2822  PROCshell_Tracef0("FindMenuWarnEvent:list_size%="+STR$list_size%)
 2823  *|endif
 2824  REPEAT
 2825    temp%=!(e_list%+offset%+0)
 2826    IF temp%<>-1 THEN
 2827      IF temp%=item_handle% THEN
 2828        found%=TRUE
 2829        temp2%=e_list%!(offset%+4):warn_fn$=$temp2%
 2830        submenu%=e_list%!(offset%+8)
 2831        temp2%=e_list%!(offset%+12):sel_fn$=$temp2%
 2832  *|ifdef PROCshell_TraceInit
 2833  PROCshell_Tracef0("FindMenuWarnEvent:submenu found")
 2834  *|endif
 2835      ENDIF
 2836      offset%+=16
 2837    ELSE
 2838      offset%=list_size%
 2839    ENDIF
 2840  UNTIL found% OR offset%>=list_size%
 2841ELSE
 2842  warn_fn$="":sel_fn$=""
 2843ENDIF
 2844*|ifdef PROCshell_TraceInit
 2845IF submenu%=0 THEN PROCshell_Tracef0("FindMenuWarnEvent:warn fn not found..")
 2846*|endif
 2847ENDPROC
 2848:
 2849*|Stop PROCshell_FindMenuWarnEvent
 2850
 2851*|Start PROCshell_MenuWarnSubMenu
 2852DEF PROCshell_MenuWarnSubMenu(s_menu%,x%,y%,warn_fn$,sel_fn$)
 2853LOCAL void%,temp%,f_menu%,ctr%
 2854_shell_FontMenuSelFN$=sel_fn$
 2855IF FNshell_HeapBlockExists(_U%!224) THEN PROCshell_HeapBlockReturn(_U%!224)
 2856_U%!224=FNshell_HeapBlockFetch(LENwarn_fn$+1)
 2857temp%=_U%!224:$temp%=warn_fn$
 2858IF warn_fn$<>"" THEN
 2859  void%=EVAL("FN"+warn_fn$+"(_U%!52,_U%!56)")
 2860  *|ifdef PROCshell_TraceInit
 2861  PROCshell_Tracef0("MenuWarnSubMenu:Calling FN"+warn_fn$)
 2862  *|endif
 2863ENDIF
 2864*|ifdef Using_FontMenu
 2865IF s_menu%=_U%!252 THEN
 2866  REM Submenu is FontMenu menu..
 2867  *|ifdef PROCshell_TraceInit
 2868  PROCshell_Tracef0("MenuWarnSubMenu:FontMenu opening..")
 2869  *|endif
 2870  IF FNshell_HeapBlockExists(_U%!256) THEN PROCshell_HeapBlockReturn(_U%!256)
 2871  REM Store current menu selection for testing later..
 2872  REM First work out how many levels are in the selection..
 2873  ctr%=0:REPEAT:ctr%+=4:UNTIL !(_Q%+32+ctr%)=-1:ctr%+=4
 2874  _U%!256=FNshell_HeapBlockFetch(ctr%):temp%=_U%!256
 2875  ctr%=0
 2876  REPEAT
 2877    temp%!ctr%=!(_Q%+32+ctr%)
 2878    ctr%+=4
 2879  UNTIL !(_Q%+32+ctr%)=-1
 2880  temp%!ctr%=!(_Q%+32+ctr%)
 2881  temp%=_U%!256
 2882  *|ifdef PROCshell_TraceInit
 2883  PROCshell_Tracef0("MenuWarnSubMenu:Selecting '"+FNshell_FontMenuGetLastSelectedFont+"' in FontMenu..")
 2884  *|endif
 2885  SYS "FontMenu_Select",FNshell_FontMenuGetLastSelectedFont,_U%!260 TO ,f_menu%
 2886  _U%!264=1:REM Set 'FontMenuOpen' flag..
 2887  IF f_menu%<>_U%!252 THEN
 2888    REM FontMenu ptr has changed..
 2889    PROCshell_FontMenuUpdatePtr(f_menu%)
 2890    _U%!252=f_menu%:s_menu%=f_menu%
 2891  ENDIF
 2892ELSE
 2893  _U%!264=0:REM Clear 'FontMenuOpen' flag..
 2894ENDIF
 2895*|endif
 2896SYS "Wimp_CreateSubMenu",,s_menu%,x%,y%
 2897ENDPROC
 2898:
 2899*|Stop PROCshell_MenuWarnSubMenu
 2900
 2901*|Start PROCshell_AttachSubMenu
 2902DEF PROCshell_AttachSubMenu(item%,submenu%,warn_fn$)
 2903SYS "MenuUtil_SubMenu",item%,submenu%
 2904IF warn_fn$<>"" THEN
 2905  SYS "MenuUtil_Warning",,TRUE
 2906  PROCshell_EventListMenuWarn(item%,submenu%,warn_fn$,"")
 2907ENDIF
 2908ENDPROC
 2909:
 2910*|Stop PROCshell_AttachSubMenu
 2911
 2912*|Start PROCshell_EventListMenuWarn
 2913DEF PROCshell_EventListMenuWarn(item%,submenu_ptr%,warn_fn$,sel_fn$)
 2914LOCAL temp%,temp2%,ctr%,e_list%
 2915IF _U%!220=0 THEN
 2916  REM Create event list..
 2917  _U%!220=FNshell_HeapBlockFetch(32)
 2918  temp%=_U%!220
 2919  temp%!0=item%
 2920  temp%!4=FNshell_HeapBlockFetch(LENwarn_fn$+1)
 2921  $(temp%!4)=warn_fn$
 2922  temp%!8=submenu_ptr%
 2923  temp%!12=FNshell_HeapBlockFetch(LENsel_fn$+1)
 2924  $(temp%!12)=sel_fn$
 2925  temp%!16=-1:temp%!20=-1:temp%!24=-1:temp%!28=-1
 2926ELSE
 2927  REM Extend existing event list..
 2928  e_list%=FNshell_HeapBlockExtend(_U%!220,32)
 2929  _U%!220=e_list%:ctr%=0
 2930  REPEAT
 2931    ctr%+=16
 2932  UNTIL e_list%!ctr%=-1
 2933  temp%=_U%!220
 2934  temp%!ctr%=item%
 2935  temp%!(ctr%+4)=FNshell_HeapBlockFetch(LENwarn_fn$+1)
 2936  temp2%=temp%!(ctr%+4):$(temp2%)=warn_fn$
 2937  temp%!(ctr%+8)=submenu_ptr%
 2938  temp%!(ctr%+12)=FNshell_HeapBlockFetch(LENsel_fn$+1)
 2939  temp2%=temp%!(ctr%+12):$(temp2%)=sel_fn$
 2940  temp%!(ctr%+16)=-1:temp%!(ctr%+20)=-1:temp%!(ctr%+24)=-1
 2941  temp%!(ctr%+28)=-1
 2942ENDIF
 2943ENDPROC
 2944:
 2945*|Stop PROCshell_EventListMenuWarn
 2946
 2947*|Start PROCshell_InteractiveHelp
 2948DEF PROCshell_InteractiveHelp(_Q%)
 2949LOCAL tag$,mess$,validation$,pos1%,pos2%,help$
 2950tag$=FNshell_GetEventHandler(_Q%!32,_Q%!36,8)
 2951REM check validation string - this overrides attached help tags!
 2952validation$=FNshell_IconGetValidation(_Q%!32,_Q%!36)
 2953IF validation$<>"" THEN
 2954  IF FNshell_StringUpperCase(LEFT$(validation$,1))="I" THEN
 2955    pos1%=INSTR(validation$,";")
 2956    REM i is first modifier
 2957    IF pos1%=0 THEN
 2958      tag$=MID$(validation$,2)
 2959    ELSE
 2960      tag$=MID$(validation$,2,pos1%-2)
 2961    ENDIF
 2962  ELSE
 2963    pos1%=INSTR(FNshell_StringUpperCase(validation$),FNshell_StringUpperCase(";i"))
 2964    pos2%=INSTR(FNshell_StringUpperCase(validation$),FNshell_StringUpperCase(";"),pos1%+1)
 2965    IF pos1%>0 THEN
 2966      IF pos2%>0 THEN
 2967        tag$=MID$(validation$,pos1%+2,pos2%-pos1%-2)
 2968      ELSE
 2969        tag$=MID$(validation$,pos1%+2)
 2970      ENDIF
 2971    ENDIF
 2972  ENDIF
 2973ENDIF
 2974IF tag$<>"" THEN
 2975  _Q%!16=&503:_Q%!12=_Q%!8
 2976  mess$=FNshell_MessageLookup(tag$,"","")
 2977  mess$=FNshell_MessageExpand(mess$)
 2978  $(_Q%+20)=mess$
 2979  !_Q%=(LENmess$+25) AND NOT 3
 2980  SYS "Wimp_SendMessage",17,_Q%,_Q%!4
 2981ENDIF
 2982ENDPROC
 2983:
 2984*|Stop PROCshell_InteractiveHelp
 2985*|Start PROCack
 2986DEF PROCack
 2987ENDPROC
 2988:
 2989*|Stop PROCack
 2990
 2991*|Start PROCshell_Message_PreQuit
 2992DEF PROCshell_Message_PreQuit(_Q%)
 2993LOCAL temp%,quitsender%,blk%,loop%,flagword%
 2994IF _U%!300>0 THEN
 2995  blk%=FNshell_HeapBlockFetch(256)
 2996  REM copy message block to private area..
 2997  FOR loop%=0 TO _Q%!0 STEP 4:REM first word is size...
 2998    blk%!loop%=_Q%!loop%
 2999  NEXT loop%
 3000  *|ifdef TraceInit
 3001  PROCshell_Tracef0("Message_PreQuit:PreQuit message received")
 3002  *|endif
 3003  temp%=_U%!300
 3004  quitsender%=blk%!4
 3005  IF !blk%<24 THEN flagword%=0 ELSE flagword%=blk%!20
 3006  REM acknowledge message - this aborts shutdown..
 3007  blk%!12=blk%!8:SYS "Wimp_SendMessage",19,blk%,quitsender%
 3008  IF EVAL("FN"+$temp%)<>0 THEN
 3009    REM ok to quit..
 3010    IF flagword% AND 1 THEN
 3011      REM quit just this task..
 3012      _closedown%=TRUE
 3013    ELSE
 3014      REM shutdown desktop..
 3015      !blk%=24:blk%!24=&1FC
 3016      SYS "Wimp_SendMessage",8,blk%,quitsender%
 3017      _closedown%=TRUE
 3018    ENDIF
 3019  ENDIF
 3020  PROCshell_HeapBlockReturn(blk%)
 3021ENDIF
 3022ENDPROC
 3023:
 3024*|Stop PROCshell_Message_PreQuit
 3025
 3026*|Start PROClwaorigin
 3027DEF PROClwaorigin(b,RETURN x%,RETURN y%)
 3028x%=b!0-b!16:y%=b!12-b!20
 3029ENDPROC
 3030:
 3031*|Stop PROClwaorigin
 3032
 3033*|Start FNshell_Iconbar
 3034DEF FNshell_Iconbar(pos%,sname$,text$,w%,menu%,shift%,ctrl%,alt%)
 3035LOCAL handle%
 3036IF text$="" THEN
 3037  !_Q%=pos%:_Q%!4=0:_Q%!8=0:_Q%!12=70:_Q%!16=70:_Q%!20=&301A:$(_Q%+24)=sname$
 3038ELSE
 3039  !_Q%=pos%:_Q%!4=0:_Q%!8=-16:_Q%!12=w%:_Q%!16=90:_Q%!20=&1700210B
 3040  DIM _Q%!24 12
 3041  DIM _Q%!28 LEN(sname$)+2
 3042  $(_Q%!24)=text$
 3043  $(_Q%!28)="S"+sname$
 3044  _Q%!32=12
 3045ENDIF
 3046SYS "Wimp_CreateIcon",,_Q% TO handle%
 3047PROCshell_AttachMenu(-2,handle%,menu%,shift%,ctrl%,alt%)
 3048=handle%
 3049:
 3050*|Stop FNshell_Iconbar
 3051
 3052*|Start PROCshell_IconbarSetText
 3053DEF PROCshell_IconbarSetText(h%,in%,s$)
 3054LOCAL icon_blk%
 3055icon_blk%=FNshell_HeapBlockFetch(40)
 3056!icon_blk%=h%:icon_blk%!4=in%
 3057SYS "Wimp_GetIconState",,icon_blk%
 3058$(icon_blk%!28)=s$
 3059SYS "Wimp_ForceRedraw",-1,icon_blk%!8-200,icon_blk%!12,icon_blk%!16+200,icon_blk%!20
 3060PROCshell_HeapBlockReturn(icon_blk%)
 3061ENDPROC
 3062:
 3063*|Stop PROCshell_IconbarSetText
 3064
 3065*|Start FNshell_WriteableIconHandler
 3066DEF FNshell_WriteableIconHandler(wh%,ih%,key%)
 3067LOCAL nr_icons%,first_write%,last_write%,ctr%
 3068LOCAL before%,after%,index%,mx%,my%,temp_blk%,caret_blk%
 3069caret_blk%=FNshell_HeapBlockFetch(24)
 3070SYS "Wimp_GetCaretPosition",,caret_blk%
 3071IF caret_blk%!0=-1 THEN
 3072  PROCshell_HeapBlockReturn(caret_blk%)
 3073  =FALSE :REM no caret so abort
 3074ENDIF
 3075REM must be icons in the window as the caret is present
 3076SYS "Wimp_WhichIcon",wh%,caret_blk%,&0040E000,&0000E000
 3077first_write%=caret_blk%!0:ctr%=0
 3078REPEAT
 3079  IF caret_blk%!ctr%=ih% THEN
 3080    before%=caret_blk%!(ctr%-4):after%=caret_blk%!(ctr%+4)
 3081  ENDIF
 3082  ctr%+=4
 3083UNTIL caret_blk%!ctr%=-1
 3084last_write%=caret_blk%!(ctr%-4)
 3085CASE key% OF
 3086  WHEN &0D  :REM return
 3087    IF ih%=last_write% THEN
 3088      REM fake a keypress on icon 0
 3089      SYS "Wimp_ProcessKey",&0D
 3090      REM PROCshell_FakeMouseClick(wh%,0,4)
 3091    ELSE
 3092      SYS "Wimp_SetCaretPosition",wh%,after%,-1,-1,-1,LEN(FNshell_IconGetData(wh%,after%))
 3093    ENDIF
 3094  WHEN &18E :REM cursor down
 3095    IF ih%=last_write% THEN
 3096      SYS "Wimp_SetCaretPosition",wh%,first_write%,-1,-1,-1,LEN(FNshell_IconGetData(wh%,first_write%))
 3097    ELSE
 3098      SYS "Wimp_SetCaretPosition",wh%,after%,-1,-1,-1,LEN(FNshell_IconGetData(wh%,after%))
 3099    ENDIF
 3100  WHEN &18F :REM cursor up
 3101    IF ih%=first_write% THEN
 3102      SYS "Wimp_SetCaretPosition",wh%,last_write%,-1,-1,-1,LEN(FNshell_IconGetData(wh%,last_write%))
 3103    ELSE
 3104      SYS "Wimp_SetCaretPosition",wh%,before%,-1,-1,-1,LEN(FNshell_IconGetData(wh%,before%))
 3105    ENDIF
 3106ENDCASE
 3107PROCshell_HeapBlockReturn(caret_blk%)
 3108=TRUE
 3109:
 3110*|Stop FNshell_WriteableIconHandler
 3111*|Start PROCshell_FakeMouseClick
 3112DEF PROCshell_FakeMouseClick(wh%,ih%,button%)
 3113SYS "OS_Byte",15,1:REM flush input buffer
 3114_Q%!8=button%:_Q%!12=wh%:_Q%!16=ih%
 3115PROCshell_Action(6)
 3116ENDPROC
 3117:
 3118*|Stop PROCshell_FakeMouseClick
 3119*|Start FNshell_IconCreate
 3120DEF FNshell_IconCreate(wh%,minx%,miny%,w%,h%,fg%,bg%,flg%,data$,addr%,len%,validation$)
 3121LOCAL i%,handle%,valid%,icon_blk%
 3122icon_blk%=FNshell_HeapBlockFetch(40)
 3123icon_blk%!0=wh%
 3124icon_blk%!4=minx%:icon_blk%!8=miny%
 3125icon_blk%!12=minx%+w%:icon_blk%!16=miny%+h%
 3126icon_blk%!20=flg% OR bg%<<28 OR fg%<<24
 3127IF icon_blk%!20 AND &100 THEN
 3128  i%=INSTR(data$,",")
 3129  icon_blk%!24=addr%
 3130  IF validation$<>"" THEN
 3131    valid%=FNshell_HeapBlockFetch(LENvalidation$+1)
 3132    $valid%=validation$
 3133    icon_blk%!28=valid%
 3134  ELSE
 3135    icon_blk%!28=-1
 3136  ENDIF
 3137  icon_blk%!32=len%
 3138ELSE
 3139  $(icon_blk%+24)=LEFT$(data$,11)
 3140ENDIF
 3141SYS "Wimp_CreateIcon",,icon_blk% TO handle%
 3142PROCshell_HeapBlockReturn(icon_blk%)
 3143=handle%
 3144:
 3145*|Stop FNshell_IconCreate
 3146*|Start PROCshell_IconDelete
 3147DEF PROCshell_IconDelete(wh%,ih%)
 3148PROCshell_DoIconDelete(wh%,ih%,FALSE)
 3149ENDPROC
 3150:
 3151*|Stop PROCshell_IconDelete
 3152*|Start PROCshell_IconDelete2
 3153DEF PROCshell_IconDelete2(wh%,ih%)
 3154PROCshell_DoIconDelete(wh%,ih%,TRUE)
 3155ENDPROC
 3156:
 3157*|Stop PROCshell_IconDelete2
 3158*|Start PROCshell_DoIconDelete
 3159DEF PROCshell_DoIconDelete(wh%,ih%,redraw%)
 3160LOCAL blk%,x0%,y0%,x1%,y1%
 3161blk%=FNshell_HeapBlockFetch(40)
 3162blk%!0=wh%:blk%!4=ih%
 3163SYS "Wimp_GetIconState",,blk%
 3164SYS "Interface_BoundingBox",,blk%+8
 3165x0%=blk%!8:y0%=blk%!12:x1%=blk%!16:y1%=blk%!20
 3166SYS "Wimp_GetIconState",,blk%
 3167IF FNshell_HeapBlockExists(blk%!28) THEN PROCshell_HeapBlockReturn(blk%!28)
 3168IF FNshell_HeapBlockExists(blk%!32) THEN PROCshell_HeapBlockReturn(blk%!32)
 3169SYS "Wimp_DeleteIcon",,blk%
 3170IF redraw% THEN
 3171  SYS "Wimp_ForceRedraw",wh%,x0%,y0%,x1%,y1%
 3172ENDIF
 3173PROCshell_HeapBlockReturn(blk%)
 3174ENDPROC
 3175:
 3176*|Stop PROCshell_DoIconDelete
 3177*|Start PROCshell_IconPutData
 3178DEF PROCshell_IconPutData(whandle%,ihandle%,data$,redraw)
 3179LOCAL blk%
 3180blk%=FNshell_HeapBlockFetch(50) 
 3181blk%!0=whandle%
 3182blk%!4=ihandle%
 3183SYS "Wimp_GetIconState",,blk%
 3184IF (blk%!24 AND (1<<8))<>0 THEN
 3185  IF LENdata$>blk%!36 THEN ERROR 99,FNshell_MessageNoArgs("SHELLMSG12")
 3186  $(blk%!28)=data$
 3187ELSE
 3188  $(blk%+28)=LEFT$(data$,11)
 3189ENDIF
 3190IF redraw<>0 THEN
 3191  blk%!8=0:blk%!12=0
 3192  SYS "Wimp_SetIconState",,blk%
 3193  REM Call wimp poll immediately in case the user program doesn't..
 3194  PROCshell_EnsurePoll
 3195ENDIF
 3196PROCshell_HeapBlockReturn(blk%)
 3197ENDPROC
 3198:
 3199*|Stop PROCshell_IconPutData
 3200*|Start FNshell_IconNewSprite
 3201DEF FNshell_IconNewSprite(whandle%,ihandle%,newname$,redraw)
 3202LOCAL icon_blk%
 3203icon_blk%=FNshell_HeapBlockFetch(40)
 3204icon_blk%!0=whandle%:icon_blk%!4=ihandle%
 3205SYS "Wimp_GetIconState",,icon_blk%
 3206SYS "Wimp_DeleteIcon",,icon_blk%
 3207icon_blk%!4=icon_blk%!8:icon_blk%!8=icon_blk%!12:icon_blk%!12=icon_blk%!16
 3208icon_blk%!16=icon_blk%!20:icon_blk%!20=icon_blk%!24:$(icon_blk%+24)=newname$
 3209SYS "Wimp_CreateIcon",,icon_blk% TO ihandle%
 3210IF redraw THEN SYS "Wimp_ForceRedraw",icon_blk%!0,icon_blk%!4,icon_blk%!8,icon_blk%!12,icon_blk%!16
 3211PROCshell_HeapBlockReturn(icon_blk%)
 3212=ihandle%
 3213:
 3214*|Stop FNshell_IconNewSprite
 3215*|Start FNshell_IconGetData
 3216DEF FNshell_IconGetData(whandle%,ihandle%)
 3217LOCAL result$,icon_blk%
 3218icon_blk%=FNshell_HeapBlockFetch(40)
 3219icon_blk%!0=whandle%
 3220icon_blk%!4=ihandle%
 3221SYS "Wimp_GetIconState",,icon_blk%
 3222IF (icon_blk%!24 AND (1<<8))<>0 THEN result$=$(icon_blk%!28) ELSE result$=$(icon_blk%+28)
 3223PROCshell_HeapBlockReturn(icon_blk%)
 3224=result$
 3225:
 3226*|Stop FNshell_IconGetData
 3227*|Start FNshell_IconMove2
 3228DEF FNshell_IconMove2(wh%,ih%,d_x%,d_y%)
 3229LOCAL m_blk%
 3230m_blk%=FNshell_HeapBlockFetch(40)
 3231!m_blk%=wh%:m_blk%!4=ih%
 3232SYS "Wimp_GetIconState",,m_blk%
 3233m_blk%!8+=d_x%:m_blk%!16+=d_x%
 3234m_blk%!12+=d_y%:m_blk%!20+=d_y%
 3235ih%=FNshell_IconMove(wh%,ih%,m_blk%!8,m_blk%!12,m_blk%!16,m_blk%!20)
 3236PROCshell_HeapBlockReturn(m_blk%)
 3237=ih%
 3238:
 3239*|Stop FNshell_IconMove2
 3240*|Start FNshell_IconResize
 3241DEF FNshell_IconResize(wh%,ih%,x0%,y0%,x1%,y1%)
 3242=FNshell_IconMove(wh%,ih%,x0%,y0%,x1%,y1%)
 3243:
 3244*|Stop FNshell_IconResize
 3245*|Start FNshell_IconMove
 3246DEF FNshell_IconMove(wh%,ih%,x0%,y0%,x1%,y1%)
 3247LOCAL i_blk%,i_flags%,i_data%,bdr%,blk%
 3248LOCAL oldflags%,odt0%,odt1%,odt2%
 3249i_blk%=FNshell_HeapBlockFetch(40)
 3250blk%=FNshell_HeapBlockFetch(40)
 3251!i_blk%=wh%:i_blk%!4=ih%:SYS "Wimp_GetIconState",,i_blk%
 3252!blk%=wh%:blk%!4=ih%
 3253SYS "Wimp_GetIconState",,blk%
 3254SYS "Interface_BoundingBox",,blk%+8
 3255iflags%=i_blk%!24:idata%=i_blk%+28
 3256oldflags%=iflags%:odt0%=idata%!0:odt1%=idata%!4:odt2%=idata%!8
 3257bdr%=i_blk%!8-blk%!8
 3258SYS "Wimp_DeleteIcon",,i_blk%
 3259SYS "Wimp_ForceRedraw",!i_blk%,i_blk%!8-bdr%,i_blk%!12-bdr%,i_blk%!16+bdr%,i_blk%!20+bdr%
 3260ih%=FNshell_CreateIcon2(wh%,x0%,y0%,x1%,y1%,oldflags%,odt0%,odt1%,odt2%,bdr%)
 3261PROCshell_HeapBlockReturn(i_blk%)
 3262PROCshell_HeapBlockReturn(blk%)
 3263=ih%
 3264:
 3265*|Stop FNshell_IconMove
 3266*|Start FNshell_CreateIcon2
 3267DEF FNshell_CreateIcon2(handle%,x0%,y0%,x1%,y1%,flags%,dt0%,dt1%,dt2%,bdr%)
 3268LOCAL ic%,q%,text$,sprite$,minx%,miny%
 3269q%=FNshell_HeapBlockFetch(60)
 3270!q%=handle%
 3271q%!20=flags%:q%!24=dt0%:q%!28=dt1%:q%!32=dt2%
 3272text$="":sprite$=""
 3273IF flags% AND 1 THEN
 3274 IF flags% AND &100 text$=$(q%!24) ELSE text$=$(q%+24)
 3275ENDIF
 3276IF flags% AND 2 THEN
 3277 IF flags% AND &100 THEN
 3278  sprite$=FNshell_IconGetCommand(q%!28,"S")
 3279 ELSE
 3280  sprite$=$(q%+24)
 3281 ENDIF
 3282ENDIF
 3283PROCshell_GetMinXY(flags%,text$,sprite$)
 3284IF x1%-x0%<minx% THEN x1%=x0%+minx%
 3285IF y1%-y0%<miny% THEN y1%=y0%+miny%
 3286q%!4=x0%:q%!8=y0%:q%!12=x1%:q%!16=y1%
 3287SYS "Wimp_CreateIcon",,q% TO ic%
 3288SYS "Wimp_ForceRedraw",!q%,q%!4-bdr%,q%!8-bdr%,q%!12+bdr%,q%!16+bdr%
 3289SYS "Wimp_GetCaretPosition",,q%
 3290IF !q%=handle%:IFq%!4=ic%:SYS "Wimp_SetCaretPosition",handle%,ic%,0,0,-1,0
 3291PROCshell_HeapBlockReturn(q%)
 3292=ic%
 3293:
 3294*|Stop FNshell_CreateIcon2
 3295*|Start PROCshell_GetMinXY
 3296DEF PROCshell_GetMinXY(flags%,text$,sprite$)
 3297LOCAL x0%,y0%,x1%,y1%,mx%,my%
 3298minx%=0:miny%=0
 3299IF flags%AND&01 AND text$<>"" THEN
 3300  IF flags%AND&40 THEN
 3301       SYS "Font_ReadInfo",flags%>>24 TO ,,y0%,,y1%
 3302       SYS "Font_StringBBox",,CHR$26+CHR$(flags%>>24)+text$ TO ,x0%,,x1%
 3303       SYS "Font_ConverttoOS",,x0% TO ,x0%
 3304       SYS "Font_ConverttoOS",,x1% TO ,x1%
 3305       minx%=x1%-x0%:miny%=y1%-y0%
 3306  ELSE minx%=6*dx%+16*LENtext$:miny%=32
 3307  ENDIF
 3308  IF flags%AND&04 miny%+=2*dy%
 3309ENDIF
 3310IF flags%AND&02 AND sprite$<>"" THEN
 3311   SYS "XOS_SpriteOp",&128,FNshell_UserSpritesBase,sprite$ TO ,,,mx%,my%,,spm% ; P%
 3312   IF (P%AND1)=0 THEN
 3313      SYS "XOS_ReadModeVariable",spm%,4 TO ,,spx%:mx%=mx%<<spx%
 3314      SYS "XOS_ReadModeVariable",spm%,5 TO ,,spy%:my%=my%<<spy%
 3315      IF flags%AND&800 mx%=mx%/2:my%=my%/2
 3316      IF (flags%AND&21B)=&13 mx%=minx%+mx% :REM sprite+text (V~H~R)
 3317      IF mx%>minx% minx%=mx%
 3318      IF my%>miny% miny%=my%
 3319   ENDIF
 3320ENDIF
 3321ENDPROC
 3322:
 3323*|Stop PROCshell_GetMinXY
 3324*|Start FNshell_IconGetCommand
 3325DEF FNshell_IconGetCommand(v%,c$)
 3326LOCAL I%,result$
 3327IF v%<=0 THEN
 3328  result$=""
 3329ELSE
 3330  I%=INSTR(";"+FNshell_StringUpperCase($v%),";"+FNshell_StringUpperCase(c$))
 3331  IF I%=0 THEN
 3332    result$=""
 3333  ELSE
 3334    result$=LEFT$($(v%+I%),INSTR($(v%+I%)+";",";")-1)
 3335  ENDIF
 3336ENDIF
 3337=result$
 3338:
 3339*|Stop FNshell_IconGetCommand
 3340*|Start PROCshell_IconRedraw
 3341DEF PROCshell_IconRedraw(wh%,ih%)
 3342LOCAL blk%
 3343blk%=FNshell_HeapBlockFetch(40)
 3344!blk%=wh%:blk%!4=ih%
 3345SYS "Wimp_GetIconState",,blk%
 3346SYS "Interface_BoundingBox",,blk%+8
 3347SYS "Wimp_ForceRedraw",wh%,blk%!8,blk%!12,blk%!16,blk%!20
 3348PROCshell_Action(FNshell_Poll_I(0,_U%!148))
 3349PROCshell_HeapBlockReturn(blk%)
 3350ENDPROC
 3351:
 3352*|Stop PROCshell_IconRedraw
 3353*|Start FNshell_IconGetValidation
 3354DEF FNshell_IconGetValidation(wh%,ih%)
 3355LOCAL blk%,validation$,flags%
 3356IF ih%=-1 THEN =""
 3357validation$=""
 3358blk%=FNshell_HeapBlockFetch(100)
 3359blk%!0=wh%:blk%!4=ih%
 3360SYS "Wimp_GetIconState",,blk%
 3361REM check flags first to see if it has a
 3362REM validation string!
 3363flags%=blk%!24
 3364IF flags% AND &100 THEN
 3365  IF blk%!32>0 THEN validation$=$(blk%!32)
 3366ENDIF
 3367PROCshell_HeapBlockReturn(blk%)
 3368=validation$
 3369:
 3370*|Stop FNshell_IconGetValidation
 3371*|Start PROCshell_IconPutValidation
 3372DEF PROCshell_IconPutValidation(wh%,ih%,valid$)
 3373LOCAL blk%,flags%
 3374blk%=FNshell_HeapBlockFetch(100)
 3375blk%!0=wh%:blk%!4=ih%
 3376SYS "Wimp_GetIconState",,blk%
 3377flags%=blk%!24
 3378IF flags% AND &100 THEN
 3379  $(blk%!32)=valid$
 3380ENDIF
 3381PROCshell_HeapBlockReturn(blk%)
 3382ENDPROC
 3383:
 3384*|Stop PROCshell_IconPutValidation
 3385*|Start FNshell_IsIconSelected
 3386DEF FNshell_IsIconSelected(WindowHandle%,IconHandle%)
 3387LOCAL temp%
 3388PROCshell_IconGetState(WindowHandle%,IconHandle%)
 3389flags%=_Q%!24
 3390temp%=(flags% AND &200000)
 3391IF temp%=0 THEN =FALSE
 3392=TRUE
 3393:
 3394*|Stop FNshell_IsIconSelected
 3395
 3396*|Start PROCshell_IconSelect
 3397DEF PROCshell_IconSelect(WindowHandle%,IconHandle%)
 3398PROCshell_IconSetState(WindowHandle%,IconHandle%,&200000,&200000)
 3399ENDPROC
 3400:
 3401*|Stop PROCshell_IconSelect
 3402
 3403*|Start PROCshell_IconDeselect
 3404DEF PROCshell_IconDeselect(WindowHandle%,IconHandle%)
 3405PROCshell_IconSetState(WindowHandle%,IconHandle%,0,&200000)
 3406ENDPROC
 3407:
 3408*|Stop PROCshell_IconDeselect
 3409
 3410*|Start PROCshell_IconGetState
 3411DEF PROCshell_IconGetState(WindowHandle%,IconHandle%)
 3412!_Q%=WindowHandle%
 3413_Q%!4=IconHandle%
 3414SYS "Wimp_GetIconState",,_Q%
 3415ENDPROC
 3416:
 3417*|Stop PROCshell_IconGetState
 3418
 3419*|Start PROCshell_IconSetSelected
 3420DEF PROCshell_IconSetSelected(wh%,ih%,state%)
 3421IF state%=0 THEN
 3422  PROCshell_IconDeselect(wh%,ih%)
 3423ELSE
 3424  PROCshell_IconSelect(wh%,ih%)
 3425ENDIF
 3426ENDPROC
 3427:
 3428*|Stop PROCshell_IconSetSelected
 3429
 3430*|Start PROCshell_IconSet
 3431DEF PROCshell_IconSet(wh%,ih%,state%)
 3432IF state%=0 THEN
 3433  PROCshell_IconDeselect(wh%,ih%)
 3434ELSE
 3435  PROCshell_IconSelect(wh%,ih%)
 3436ENDIF
 3437ENDPROC
 3438:
 3439*|Stop PROCshell_IconSet
 3440*|Start PROCshell_IconSetState
 3441DEF PROCshell_IconSetState(WindowHandle%,IconHandle%,EorWord%,ClearWord%)
 3442LOCAL icon_blk%
 3443icon_blk%=FNshell_HeapBlockFetch(16)
 3444!icon_blk%=WindowHandle%
 3445icon_blk%!04=IconHandle%
 3446icon_blk%!08=EorWord%
 3447icon_blk%!12=ClearWord%
 3448SYS "Wimp_SetIconState",,icon_blk%
 3449PROCshell_HeapBlockReturn(icon_blk%)
 3450ENDPROC
 3451:
 3452*|Stop PROCshell_IconSetState
 3453*|Start PROCshell_IconUnselectable
 3454DEF PROCshell_IconUnselectable(handle%,icon%)
 3455PROCshell_IconSetState(handle%,icon%,&400000,&40000)
 3456ENDPROC
 3457:
 3458*|Stop PROCshell_IconUnselectable
 3459*|Start PROCshell_IconSetBGColour
 3460DEF PROCshell_IconSetBGColour(wh%,ih%,col%)
 3461IF col%<0 OR col%>15 THEN ERROR 99,FNshell_MessageOneArg("SHELLMSG24","PROCshell_IconSetBGColour")
 3462PROCshell_IconSetState(wh%,ih%,col%<<28,&F0000000)
 3463ENDPROC
 3464:
 3465*|Stop PROCshell_IconSetBGColour
 3466*|Start PROCshell_IconSetFGColour
 3467DEF PROCshell_IconSetFGColour(wh%,ih%,col%)
 3468IF col%<0 OR col%>15 THEN ERROR 99,FNshell_MessageOneArg("SHELLMSG24","PROCshell_IconSetFGColour")
 3469PROCshell_IconSetState(wh%,ih%,col%<<24,&0F000000)
 3470ENDPROC
 3471:
 3472*|Stop PROCshell_IconSetFGColour
 3473
 3474*|Start PROCshell_CaretSetPosition
 3475DEF PROCshell_CaretSetPosition(whandle%,ihandle%,xoff%,yoff%,height%,index%)
 3476SYS "Wimp_SetCaretPosition",whandle%,ihandle%,xoff%,yoff%,height%,index%
 3477ENDPROC
 3478:
 3479*|Stop PROCshell_CaretSetPosition
 3480
 3481*|Start PROCshell_IconSetButtonType
 3482DEF PROCshell_IconSetButtonType(wh%,ih%,button_type%)
 3483IF button_type%=12 OR button_type%=13 THEN ERROR 99,FNshell_MessageOneArg("SHELLMSG23","PROCshell_IconSetButtonType")
 3484IF button_type%<0 OR button_type%>15 THEN ERROR 99,FNshell_MessageOneArg("SHELLMSG22","PROCshell_IconSetButtonType")
 3485PROCshell_IconSetState(wh%,ih%,button_type%<<12,&F000)
 3486ENDPROC
 3487:
 3488*|Stop PROCshell_IconSetButtonType
 3489*|Start PROCshell_IconSetESG
 3490DEF PROCshell_IconSetESG(wh%,ih%,esg%)
 3491IF esg%<0 OR esg%>31 THEN ERROR 99,FNshell_MessageOneArg("SHELLMSG25","PROCshell_IconSetESG")
 3492PROCshell_IconSetState(wh%,ih%,esg%<<16,&1F0000)
 3493ENDPROC
 3494:
 3495*|Stop PROCshell_IconSetESG
 3496
 3497*|Start PROCshell_IconSetText
 3498DEF PROCshell_IconSetText(wh%,ih%,action%)
 3499IF action%<>0 THEN action%=1<<0
 3500PROCshell_IconSetState(wh%,ih%,action%,1<<0)
 3501ENDPROC
 3502:
 3503*|Stop PROCshell_IconSetText
 3504
 3505*|Start PROCshell_IconSetSprite
 3506DEF PROCshell_IconSetSprite(wh%,ih%,action%)
 3507IF action%<>0 THEN action%=1<<1
 3508PROCshell_IconSetState(wh%,ih%,action%,1<<1)
 3509ENDPROC
 3510:
 3511*|Stop PROCshell_IconSetSprite
 3512*|Start PROCshell_IconSetBorder
 3513DEF PROCshell_IconSetBorder(wh%,ih%,action%)
 3514IF action%<>0 THEN action%=1<<2
 3515PROCshell_IconSetState(wh%,ih%,action%,1<<2)
 3516ENDPROC
 3517:
 3518*|Stop PROCshell_IconSetBorder
 3519
 3520*|Start PROCshell_IconSetHCentred
 3521DEF PROCshell_IconSetHCentred(wh%,ih%,action%)
 3522PROCshell_IconSetState(wh%,ih%,0,1<<9):REM unset right justified bit...
 3523IF action%<>0 THEN action%=1<<3
 3524PROCshell_IconSetState(wh%,ih%,action%,1<<3)
 3525ENDPROC
 3526:
 3527*|Stop PROCshell_IconSetHCentred
 3528
 3529*|Start PROCshell_IconSetVCentred
 3530DEF PROCshell_IconSetVCentred(wh%,ih%,action%)
 3531IF action%<>0 THEN action%=1<<4
 3532PROCshell_IconSetState(wh%,ih%,action%,1<<4)
 3533ENDPROC
 3534:
 3535*|Stop PROCshell_IconSetVCentred
 3536
 3537*|Start PROCshell_IconSetFilled
 3538DEF PROCshell_IconSetFilled(wh%,ih%,action%)
 3539IF action%<>0 THEN action%=1<<5
 3540PROCshell_IconSetState(wh%,ih%,action%,1<<5)
 3541ENDPROC
 3542:
 3543*|Stop PROCshell_IconSetFilled
 3544
 3545*|Start PROCshell_IconSetRightJust
 3546DEF PROCshell_IconSetRightJust(wh%,ih%,action%)
 3547PROCshell_IconSetHCentred(wh%,ih%,0)
 3548IF action%<>0 THEN action%=1<<9
 3549PROCshell_IconSetState(wh%,ih%,action%,1<<9)
 3550ENDPROC
 3551:
 3552*|Stop PROCshell_IconSetRightJust
 3553
 3554*|Start PROCshell_IconSetLeftJust
 3555DEF PROCshell_IconSetLeftJust(wh%,ih%)
 3556PROCshell_IconSetHCentred(wh%,ih%,0)
 3557PROCshell_IconSetRightJust(wh%,ih%,0)
 3558ENDPROC
 3559:
 3560*|Stop PROCshell_IconSetLeftJust
 3561
 3562*|Start PROCshell_IconSetUnselectable
 3563DEF PROCshell_IconSetUnselectable(wh%,ih%,state%)
 3564LOCAL caret_blk%
 3565IF state%<>0 THEN state%=1<<22
 3566PROCshell_IconSetState(wh%,ih%,state%,1<<22)
 3567IF state%<>0 THEN
 3568  REM check if icon has the caret, lose it if it has..
 3569  caret_blk%=FNshell_HeapBlockFetch(24)
 3570  SYS "Wimp_GetCaretPosition",,caret_blk%
 3571  IF !caret_blk%=wh% AND caret_blk%!4=ih% THEN
 3572    SYS "Wimp_SetCaretPosition",-1
 3573  ENDIF
 3574  PROCshell_HeapBlockReturn(caret_blk%)
 3575ENDIF
 3576ENDPROC
 3577:
 3578*|Stop PROCshell_IconSetUnselectable
 3579
 3580*|Start PROCshell_CaretSetRight
 3581DEF PROCshell_CaretSetRight(wh%,ih%)
 3582SYS "Wimp_SetCaretPosition",wh%,ih%,-1,-1,-1,LEN(FNshell_IconGetData(wh%,ih%))
 3583ENDPROC
 3584:
 3585*|Stop PROCshell_CaretSetRight
 3586
 3587*|Start PROCprint_text
 3588DEF PROCprint_text(X,Y,text$)
 3589IF FNin(X,Y-32,X+16*LEN(text$),Y) THEN
 3590  MOVE X,Y
 3591  PRINT text$
 3592ENDIF
 3593ENDPROC
 3594:
 3595*|Stop PROCprint_text
 3596*|Start FNin
 3597DEF FNin(A%,B%,C%,D%)
 3598IF C%<gbx THEN =FALSE
 3599IF A%>gtx THEN =FALSE
 3600IF B%>gty THEN =FALSE
 3601IF D%<gby THEN =FALSE
 3602=TRUE
 3603:
 3604*|Stop FNin
 3605*|Start PROCnewvals
 3606DEF PROCnewvals
 3607gbx=_Q%!28:gby=_Q%!32
 3608gtx=_Q%!36:gty=_Q%!40
 3609wbx=_Q%!4:wby=_Q%!8
 3610wtx=_Q%!12:wty=_Q%!16
 3611xsc=_Q%!20:ysc=_Q%!24
 3612hp=wtx-wbx:vp=wty-wby:ebx=xsc
 3613etx=xsc+hp:ety=ysc:eby=ysc-vp
 3614ENDPROC
 3615:
 3616*|Stop PROCnewvals
 3617DEF FNmax(a%,b%)
 3618IF a%<b% THEN =b%
 3619=a%
 3620:
 3621*|Start FNshell_Leaf
 3622DEF FNshell_Leaf(path$)
 3623WHILE INSTR(path$,".")
 3624  path$=MID$(path$,INSTR(path$,".")+1)
 3625ENDWHILE
 3626=path$
 3627:
 3628*|Stop FNshell_Leaf
 3629*|Start FNshell_Branch
 3630DEF FNshell_Branch(fname$)
 3631LOCAL pos%,br$,temp%
 3632IF INSTR(fname$,".")=0 THEN
 3633  br$=""
 3634ELSE
 3635  temp%=0
 3636  REPEAT
 3637    pos%=temp%+1
 3638    temp%=INSTR(fname$,".",pos%)
 3639  UNTIL temp%=0
 3640  br$=LEFT$(fname$,pos%-2)
 3641ENDIF
 3642=br$
 3643:
 3644*|Stop FNshell_Branch
 3645*|Start FNgname
 3646DEF FNgname(ptr)
 3647f$=""
 3648WHILE ?ptr<>0 AND ?ptr<>13
 3649  f$=f$+CHR$?ptr:ptr+=1
 3650ENDWHILE
 3651=f$
 3652:
 3653*|Stop FNgname
 3654*|Start PROCshell_WindowResize
 3655DEF PROCshell_WindowResize(whandle%,bx%,by%,tx%,ty%,open%)
 3656!_Q%=bx%:_Q%!4=by%:_Q%!8=tx%:_Q%!12=ty%
 3657SYS "Wimp_SetExtent",whandle%,_Q%
 3658IF open% THEN
 3659  _Q%!0=whandle%
 3660  SYS "Wimp_GetWindowInfo",,_Q%
 3661  SYS "Wimp_OpenWindow",,_Q%
 3662ENDIF
 3663ENDPROC
 3664:
 3665*|Stop PROCshell_WindowResize
 3666*|Start PROCshell_WindowRetitle
 3667DEF PROCshell_WindowRetitle(whandle%,title$)
 3668LOCAL temp%,win_blk%
 3669win_blk%=FNshell_HeapBlockFetch(6000)
 3670win_blk%!0=whandle%
 3671SYS "Wimp_GetWindowInfo",,win_blk%
 3672IF ((win_blk%!60) AND &100)=0 THEN
 3673  REM window title is not indirected..
 3674  temp%=win_blk%+76
 3675  $temp%=LEFT$(title$,11)
 3676  SYS "Wimp_DeleteWindow",,win_blk%
 3677  SYS "Wimp_CreateWindow",,win_blk%+4
 3678ELSE
 3679  REM window title is indirected..
 3680  REM should check buffer size here...
 3681  $(!(win_blk%+76))=title$
 3682  IF ((win_blk%!32) AND (1<<16))<>0 THEN
 3683    SYS "Wimp_ForceRedraw",-1,win_blk%!4,win_blk%!16,win_blk%!12,win_blk%!16+44
 3684  ENDIF
 3685PROCshell_HeapBlockReturn(win_blk%)
 3686ENDIF
 3687ENDPROC
 3688:
 3689*|Stop PROCshell_WindowRetitle
 3690*|Start FNshell_WindowTitleIndirected
 3691DEF FNshell_WindowTitleIndirected(flag%)
 3692IF (flag% AND (1<<8))=(1<<8) THEN =TRUE
 3693=FALSE
 3694:
 3695*|Stop FNshell_WindowTitleIndirected
 3696*|Start PROCshell_ScreenToWindowCoords
 3697DEF PROCshell_ScreenToWindowCoords(WHandle%,RETURN X%,RETURN Y%)
 3698LOCAL Temp%,WXMin%,WYMin%,XScroll%,YScroll%,Scratch%
 3699Scratch%=FNshell_HeapBlockFetch(600)
 3700Temp%=Scratch%
 3701!Temp%=WHandle%
 3702SYS "Wimp_GetWindowInfo",,Temp%
 3703WXMin%=Scratch%!4
 3704WYMax%=Scratch%!16
 3705XScroll%=Scratch%!20
 3706YScroll%=Scratch%!24
 3707X%=X%+(XScroll%-WXMin%)
 3708Y%=Y%+(YScroll%-WYMax%)
 3709PROCshell_HeapBlockReturn(Scratch%)
 3710ENDPROC
 3711:
 3712*|Stop PROCshell_ScreenToWindowCoords
 3713*|Start FNshell_WimpSlotReadEnd
 3714DEF FNshell_WimpSlotReadEnd
 3715LOCAL mem%
 3716SYS "Wimp_SlotSize",-1,-1 TO mem%
 3717=mem%
 3718:
 3719*|Stop FNshell_WimpSlotReadEnd
 3720*|Start FNshell_WimpSlotClaimMemory
 3721DEF FNshell_WimpSlotClaimMemory(mem%,size%)
 3722LOCAL ssize%
 3723SYS "Wimp_SlotSize",mem%+size%,-1 TO ssize%
 3724IF ssize%<mem%+size% THEN =-1
 3725= ssize%
 3726:
 3727*|Stop FNshell_WimpSlotClaimMemory
 3728*|Start PROCshell_WimpSlotReleaseMemory
 3729DEF PROCshell_WimpSlotReleaseMemory
 3730SYS "Wimp_SlotSize",mem%,-1
 3731ENDPROC
 3732:
 3733*|Stop PROCshell_WimpSlotReleaseMemory
 3734*|Start PROCshell_MouseLimit
 3735DEF PROCshell_MouseLimit(b,whandle%)
 3736b!0=whandle%:SYS "Wimp_GetWindowState",,b
 3737PROCmouse_rectangle(b!4,b!8,b!12-b!4,b!16-b!8)
 3738ENDPROC
 3739:
 3740*|Stop PROCshell_MouseLimit
 3741*|Start FNshell_NameOfFirstSprite
 3742DEF FNshell_NameOfFirstSprite(File$)
 3743LOCAL X%,N%,S$
 3744X%=OPENIN(File$)
 3745PTR#X%=4
 3746N%=BGET#X%
 3747N%+=BGET#X%*&100
 3748N%+=BGET#X%*&10000
 3749N%+=BGET#X%*&1000000
 3750PTR#X%=N%
 3751S$=""
 3752FOR N%=0 TO 11
 3753S$+=CHR$(BGET#X%)
 3754NEXT
 3755CLOSE#X%
 3756=S$
 3757:
 3758*|Stop FNshell_NameOfFirstSprite
 3759*|Start PROCInitialiseSpriteArea
 3760DEF PROCInitialiseSpriteArea(S%,Length%)
 3761!S%=Length%
 3762S%!8=16
 3763SYS "OS_SpriteOp",9+256,S%
 3764ENDPROC
 3765:
 3766*|Stop PROCInitialiseSpriteArea
 3767DEF PROCshell_ListEvents(wh%,ic%)
 3768IF wh%=-1 THEN wh%=-2
 3769PRINT"MenuSelection="+FNshell_GetEventHandler(wh%,ic%,0)
 3770PRINT"MenuMaker    ="+FNshell_GetEventHandler(wh%,ic%,1)
 3771PRINT"ClickSelect  ="+FNshell_GetEventHandler(wh%,ic%,2)
 3772PRINT"ClickAdjust  ="+FNshell_GetEventHandler(wh%,ic%,3)
 3773PRINT"Redraw       ="+FNshell_GetEventHandler(wh%,ic%,4)
 3774PRINT"Keypress     ="+FNshell_GetEventHandler(wh%,ic%,5)
 3775PRINT"Drag         ="+FNshell_GetEventHandler(wh%,ic%,6)
 3776PRINT"Menu Warning ="+FNshell_GetEventHandler(wh%,ic%,7)
 3777PRINT"HelpTag      ="+FNshell_GetEventHandler(wh%,ic%,8)
 3778menu%=FNshell_GetEventMenu(2,wh%,ic%)
 3779PRINT"Menu Address =";
 3780IF menu%=0 THEN
 3781  PRINT" None"
 3782ELSE
 3783  PRINT STR$menu%
 3784ENDIF
 3785ENDPROC
 3786:
 3787REM ----------- Heap Manager Routines ------------------------------------
 3788
 3789REM Function to load heap manager machine code
 3790
 3791*|Start PROCshell_HeapManagerInit
 3792DEF PROCshell_HeapManagerInit(path$,space%)
 3793DIM heap_code% 900
 3794OSCLI("LOAD "+path$+"heapcode "+STR$~heap_code%)
 3795CALL heap_code%+0,space%
 3796ENDPROC
 3797:
 3798*|Stop PROCshell_HeapManagerInit
 3799*|Start FNshell_HeapBlockExists
 3800DEF FNshell_HeapBlockExists(addr%)
 3801LOCAL void%
 3802LOCAL ERROR
 3803ON ERROR LOCAL:RESTORE ERROR:=FALSE
 3804IF addr%<&8000 THEN ERROR 99,"No heapblock defined at this address"
 3805void%=FNshell_HeapBlockInfo(addr%)
 3806RESTORE ERROR:=TRUE
 3807*|Stop FNshell_HeapBlockExists
 3808:
 3809*|Start FNshell_HeapBlockExtend
 3810*|!Function to extend already allocated heap block.
 3811*|!a% = current address of block
 3812*|!b% = amount to increase or decrease block size by (-ve to decrease)
 3813*|!returns address of block (block may be moved)
 3814DEF FNshell_HeapBlockExtend(a%,b%)
 3815CALL heap_code%+12,a%,b%
 3816=a%
 3817*|Stop FNshell_HeapBlockExtend
 3818*|Start FNshell_HeapBlockFetch
 3819*|!Function to allocate a block on the heap
 3820*|!a% = size of block to fetch from heap
 3821*|!returns address of allocated block
 3822DEF FNshell_HeapBlockFetch(a%)
 3823LOCAL addr%
 3824CALL heap_code%+4,addr%,a%
 3825=addr%
 3826*|Stop FNshell_HeapBlockFetch
 3827*|Start PROCshell_HeapBlockReturn
 3828*|!Procedure to return a heap block to the heap
 3829*|!a% = address of block to deallocate
 3830DEF PROCshell_HeapBlockReturn(RETURN a%)
 3831IF FNshell_HeapBlockExists(a%) THEN CALL heap_code%+8,a%
 3832a%=0
 3833ENDPROC
 3834*|Stop PROCshell_HeapBlockReturn
 3835*|Start FNshell_HeapBlockInfo
 3836*|!Function to return current length of a heap block
 3837*|!a% = addr of heap block
 3838DEF FNshell_HeapBlockInfo(a%)
 3839LOCAL r3
 3840SYS "OS_Heap",6,!(heap_code%+28),a% TO ,,,r3
 3841=r3
 3842:
 3843:
 3844*|Stop FNshell_HeapBlockInfo
 3845*|Start FNshell_OSVarExists
 3846DEF FNshell_OSVarExists(buffer%,varname$)
 3847LOCAL nr_bytes
 3848SYS "XOS_ReadVarVal",varname$,buffer%,-1,0,0 TO ,,nr_bytes
 3849IF nr_bytes<0 THEN =TRUE
 3850=FALSE
 3851:
 3852*|Stop FNshell_OSVarExists
 3853*|Start FNshell_OSVarGetVal
 3854DEF FNshell_OSVarGetVal(buffer%,size%,varname$,expand)
 3855LOCAL value$,nr_bytes,nameptr%
 3856SYS "XOS_ReadVarVal",varname$,buffer%,size%,0,-3*(expand=TRUE) TO ,,nr_bytes,nameptr%,type%
 3857FOR loop%=0 TO nr_bytes-1
 3858  value$=value$+CHR$(buffer%?loop%)
 3859NEXT loop%
 3860=value$
 3861:
 3862*|Stop FNshell_OSVarGetVal
 3863*|Start FNshell_OSReadCommandArg
 3864DEF FNshell_OSReadCommandArg(opt)
 3865LOCAL pointer%,command$,offset%
 3866command$="":offset%=0
 3867SYS "OS_GetEnv" TO pointer%
 3868WHILE pointer%?offset%<>0
 3869  command$+=CHR$(pointer%?offset%)
 3870  offset%+=1
 3871ENDWHILE
 3872CASE opt OF
 3873  WHEN 0
 3874  WHEN 1
 3875    command$=MID$(command$,INSTR(command$,CHR$34)+1)
 3876    command$=MID$(command$,INSTR(command$,CHR$34)+2)
 3877ENDCASE
 3878=command$
 3879:
 3880*|Stop FNshell_OSReadCommandArg
 3881*|Start FNshell_StringStripTrailing
 3882DEF FNshell_StringStripTrailing(string$,char$)
 3883WHILE RIGHT$(string$,1) = char$
 3884  string$ = LEFT$(string$,LEN(string$) - 1)
 3885ENDWHILE
 3886= string$
 3887:
 3888*|Stop FNshell_StringStripTrailing
 3889*|Start FNshell_StringStripLeading
 3890DEF FNshell_StringStripLeading(string$,char$)
 3891WHILE LEFT$(string$,1) = char$
 3892  string$ = MID$(string$,2)
 3893ENDWHILE
 3894= string$
 3895:
 3896*|Stop FNshell_StringStripLeading
 3897*|Start FNshell_StringStripAll
 3898DEF FNshell_StringStripAll(string$,char$)
 3899LOCAL done,pos
 3900done=TRUE
 3901REPEAT
 3902  pos=INSTR(string$,char$)
 3903  IF pos THEN
 3904    done=FALSE
 3905    string$=LEFT$(string$,pos-1)+MID$(string$,pos+1)
 3906  ELSE
 3907    done=TRUE
 3908  ENDIF
 3909UNTIL done
 3910=string$
 3911:
 3912*|Stop FNshell_StringStripAll
 3913*|Start FNshell_StringPadTrailing
 3914DEF FNshell_StringPadTrailing(string$,char$,length%)
 3915WHILE LEN(string$) < length%
 3916  string$ = string$ + STRING$(length% - LEN(string$),char$)
 3917ENDWHILE
 3918= string$
 3919:
 3920*|Stop FNshell_StringPadTrailing
 3921*|Start FNshell_StringPadLeading
 3922DEF FNshell_StringPadLeading(string$,char$,length%)
 3923WHILE LEN(string$) < length%
 3924  string$ = STRING$(length% - LEN(string$),char$) + string$
 3925ENDWHILE
 3926= string$
 3927:
 3928*|Stop FNshell_StringPadLeading
 3929*|Start FNshell_StringUpperCase
 3930DEF FNshell_StringUpperCase(string$)
 3931LOCAL loop%
 3932IF LEN(string$) > 0 THEN
 3933 FOR loop% = 1 TO LEN(string$)
 3934   IF MID$(string$,loop%,1)>="a" AND MID$(string$,loop%,1)<="z" THEN
 3935     MID$(string$,loop%,1) = CHR$(ASC(MID$(string$,loop%,1)) AND &DF)
 3936   ENDIF
 3937 NEXT loop%
 3938ENDIF
 3939= string$
 3940:
 3941*|Stop FNshell_StringUpperCase
 3942*|Start FNshell_StringExchange
 3943DEF FNshell_StringExchange(string$,target$,sub$)
 3944LOCAL index%
 3945IF  INSTR(string$,target$) THEN
 3946  index%=INSTR(string$,target$)
 3947  string$=LEFT$(string$,index%-1)+sub$+MID$(string$,index%+LENtarget$)
 3948ENDIF
 3949=string$
 3950:
 3951*|Stop FNshell_StringExchange
 3952*|Start FNshell_StringArrayGetLongest
 3953DEF FNshell_StringArrayGetLongest(array$(),nr%)
 3954LOCAL loop%,longest%
 3955longest% = 0
 3956FOR loop% = 0 TO nr%
 3957  IF LEN(array$(loop%)) > longest% THEN
 3958    longest% = LEN(array$(loop%))
 3959  ENDIF
 3960NEXT loop%
 3961= longest%
 3962:
 3963*|Stop FNshell_StringArrayGetLongest
 3964*|Start FNmem_to_string
 3965DEF FNmem_to_string(block%,offset%,term%)
 3966LOCAL string$
 3967WHILE block%?offset%<>term%
 3968  string$+=CHR$(block%?offset%)
 3969  offset%+=1
 3970ENDWHILE
 3971=string$
 3972:
 3973*|Stop FNmem_to_string
 3974*|Start FNshell_FileLength
 3975DEF FNshell_FileLength(object$)
 3976LOCAL type%,load_addr%,exec_addr%,length%,atts%,string$
 3977SYS "OS_File",5,object$ TO type%,,load_addr%,exec_addr%,length%,atts%
 3978=length%
 3979:
 3980*|Stop FNshell_FileLength
 3981*|Start PROCshell_TraceOn
 3982DEF PROCshell_TraceOn
 3983_U%!48=TRUE
 3984PROCshell_BroadcastMessage(&43B00,"ShellDBug:TraceOn")
 3985ENDPROC
 3986:
 3987*|Stop PROCshell_TraceOn
 3988*|Start PROCshell_TraceOff
 3989DEF PROCshell_TraceOff
 3990_U%!48=FALSE
 3991PROCshell_BroadcastMessage(&43B00,"ShellDBug:TraceOff")
 3992ENDPROC
 3993:
 3994*|Stop PROCshell_TraceOff
 3995*|Start PROCshell_TraceInit
 3996*|Define TraceInit
 3997DEF PROCshell_TraceInit(file$)
 3998LOCAL f%,blk%,shell_AppName$,shell_AppDir$
 3999IF file$<>"" THEN
 4000  f%=OPENOUT(file$)
 4001  _U%!44=f%
 4002ENDIF
 4003blk%=FNshell_HeapBlockFetch(1024)
 4004shell_AppDir$=FNshell_OSVarGetVal(blk%,1024,"Obey$Dir",1)
 4005shell_AppName$=MID$(FNshell_Leaf(shell_AppDir$),2)
 4006REM should check first if ShellDBug is running...
 4007PROCshell_BroadcastMessage(&43B00,"ShellDBug:Init Debug messages from "+shell_AppName$)
 4008PROCshell_HeapBlockReturn(blk%)
 4009ENDPROC
 4010:
 4011*|Stop PROCshell_TraceInit
 4012*|Start FNshell_TraceIsOn
 4013DEF FNshell_TraceIsOn
 4014=_U%!48
 4015:
 4016*|Stop FNshell_TraceIsOn
 4017*|Start PROCshell_Tracef0
 4018DEF PROCshell_Tracef0(a$)
 4019LOCAL f%
 4020IF NOT(FNshell_TraceIsOn) THEN ENDPROC
 4021IF _U%!44<>-1 THEN
 4022  f%=_U%!44
 4023  BPUT#f%,a$
 4024ENDIF
 4025REM check if task id has been set up...
 4026IF _U%!148>0 THEN PROCshell_BroadcastMessage(&43B00,"ShellDBug:Trace "+a$)
 4027ENDPROC
 4028:
 4029*|Stop PROCshell_Tracef0
 4030*|Start PROCshell_Tracef2
 4031DEF PROCshell_Tracef2(addr%)
 4032OSCLI("MEDIT "+STR$~addr%)
 4033ENDPROC
 4034:
 4035*|Stop PROCshell_Tracef2
 4036*|Start PROCshell_TraceExit
 4037DEF PROCshell_TraceExit
 4038IF _U%!44<>-1 THEN CLOSE#(_U%!44):_U%!44=-1
 4039REM _U%!44=-1:_U%!48=FALSE
 4040ENDPROC
 4041:
 4042*|Stop PROCshell_TraceExit
 4043*|Start PROCshell_AttachHotKey
 4044DEF PROCshell_AttachHotKey(key$,shift%,ctrl%,alt%,window$,wh%,fn1$,fn2$)
 4045LOCAL e_list%,offset%,temp%,temp2%,key%,f_key%
 4046f_key%=TRUE
 4047IF _U%!60=0 THEN
 4048  _U%!60=FNshell_HeapBlockFetch(24)
 4049  offset%=0:_U%!180=1
 4050ELSE
 4051  offset%=_U%!180*24
 4052  _U%!60=FNshell_HeapBlockExtend(_U%!60,24)
 4053  _U%!180=(_U%!180)+1
 4054ENDIF
 4055e_list%=_U%!60
 4056CASE key$ OF
 4057  WHEN "F1" :key%=385
 4058  WHEN "F2" :key%=386
 4059  WHEN "F3" :key%=387
 4060  WHEN "F4" :key%=388
 4061  WHEN "F5" :key%=389
 4062  WHEN "F6" :key%=390
 4063  WHEN "F7" :key%=391
 4064  WHEN "F8" :key%=392
 4065  WHEN "F9" :key%=393
 4066  WHEN "F10":key%=458
 4067  WHEN "F11":key%=459
 4068OTHERWISE
 4069  key%=(ASCkey$)-64:f_key%=FALSE
 4070ENDCASE
 4071IF f_key% THEN
 4072  IF shift% THEN key%+=16
 4073  IF ctrl%  THEN key%+=32
 4074ENDIF
 4075temp%=e_list%+offset%
 4076temp%!0=key%
 4077temp%?4=shift%:REM shift flag
 4078temp%?5=ctrl% :REM ctrl  flag
 4079temp%?6=alt%  :REM alt   flag
 4080temp%!8=FNshell_HeapBlockFetch(LENwindow$+1)
 4081temp2%=temp%!8:$temp2%=window$
 4082IF wh%>0 THEN
 4083  REM check window handle is in static list...
 4084  offset%=FNshell_SearchStatic(_U%!184,wh%)
 4085  IF offset%=-1 THEN ERROR 99,FNshell_MessageNoArgs("SHELLMSG09")
 4086ENDIF
 4087temp%!12=wh%:REM >0 denotes a window handle to open as static
 4088temp%!16=FNshell_HeapBlockFetch(LENfn1$+1)
 4089temp2%=temp%!16:$temp2%=fn1$
 4090temp%!20=FNshell_HeapBlockFetch(LENfn2$+1)
 4091temp2%=temp%!20:$temp2%=fn2$
 4092ENDPROC
 4093:
 4094*|Stop PROCshell_AttachHotKey
 4095
 4096*|Start FNshell_HotKeyProcess
 4097DEF FNshell_HotKeyProcess(key%)
 4098LOCAL e_list%,list_size%,found%,ptr%,h%,win$,fn1$,fn2$
 4099LOCAL ctrl%,shift%,alt%,x_off%,y_off%,flag%,key_flags%,offset%
 4100LOCAL result%,win_blk%
 4101e_list%=_U%!60
 4102list_size%=_U%!180*24
 4103found%=FALSE:ptr%=0
 4104REPEAT
 4105  IF e_list%!ptr%=key% THEN
 4106    found%=TRUE
 4107  ELSE
 4108    ptr%+=24
 4109  ENDIF
 4110UNTIL found% OR ptr%>=list_size%
 4111IF found% THEN
 4112  temp%=e_list%+ptr%
 4113  win$=$(temp%!8)
 4114  *|ifdef TraceInit
 4115  PROCshell_Tracef0("HotKeyProcess:Template name is '"+win$+"'")
 4116  *|endif
 4117  IF (win$<>"" AND temp%!12=0) THEN
 4118    REM only create a window if it is a dynamic one
 4119    REM static windows have already been created
 4120    PROCshell_CreateWindow(win$,h%)
 4121    *|ifdef TraceInit
 4122    PROCshell_Tracef0("HotKeyProcess:Creating new dynamic window (handle is &"+STR$~h%+")")
 4123    *|endif
 4124    win_blk%=FNshell_HeapBlockFetch(36)
 4125    win_blk%!0=h%
 4126    SYS "Wimp_GetWindowState",,win_blk%
 4127    x_off%=(win_blk%!4-win_blk%!12)/2
 4128    y_off%=(win_blk%!16-win_blk%!8)/2
 4129    PROCshell_HeapBlockReturn(win_blk%)
 4130  ENDIF
 4131  fn1$=$(temp%!16)
 4132  IF fn1$<>"" THEN
 4133    *|ifdef TraceInit
 4134    PROCshell_Tracef0("HotKeyProcess:Calling Pre-Open FN '"+fn1$+"'")
 4135    *|endif
 4136    IF temp%!12>0 THEN
 4137      void%=EVAL("FN"+fn1$+"("+STR$temp%!12+")")
 4138    ELSE
 4139      void%=EVAL("FN"+fn1$+"("+STR$h%+")")
 4140    ENDIF
 4141  ELSE
 4142*|ifdef TraceInit
 4143  PROCshell_Tracef0("HotKeyProcess:No Pre-Open FN registered")
 4144*|endif
 4145  ENDIF
 4146    offset%=FNshell_SearchStatic(_U%!184,temp%!12)
 4147    IF offset%>-1 THEN
 4148      PROCshell_OpenWindowStatic(temp%!12)
 4149    ELSE
 4150      IF temp%!12>0 THEN
 4151        REM request to open a static window, but window handle
 4152        REM has not been registered with shell_CreateWindowStatic
 4153        ERROR 99,FNshell_MessageNoArgs("SHELLMSG09")
 4154      ELSE
 4155        REM must be a dynamic window then...
 4156        PROCshell_OpenWindowDynamic(h%,x_off%,y_off%)
 4157      ENDIF
 4158    ENDIF
 4159  fn2$=$(temp%!20)
 4160  IF fn2$<>"" THEN
 4161    *|ifdef TraceInit
 4162    PROCshell_Tracef0("HotKeyProcess:Calling Post-Open FN '"+fn2$+"'")
 4163    *|endif
 4164    IF temp%!12>0 THEN
 4165      void%=EVAL("FN"+fn1$+"("+STR$temp%!12+")")
 4166    ELSE
 4167      void%=EVAL("FN"+fn2$+"("+STR$h%+")")
 4168    ENDIF
 4169  ELSE
 4170    *|ifdef TraceInit
 4171    PROCshell_Tracef0("HotKeyProcess:No Post-Open FN registered")
 4172    *|endif
 4173  ENDIF
 4174  result%=TRUE
 4175ELSE
 4176  win$="":fn1$="":fn2$="":result%=FALSE
 4177ENDIF
 4178=result%
 4179:
 4180*|Stop FNshell_HotKeyProcess
 4181
 4182*|Start PROCshell_OpenWindowStaticNewView
 4183DEF PROCshell_OpenWindowStaticNewView(wh%)
 4184PROCshell_OpenWindow(wh%,FALSE,-1)
 4185ENDPROC
 4186:
 4187*|Stop PROCshell_OpenWindowStaticNewView
 4188*|Start PROCshell_OpenWindowStatic
 4189DEF PROCshell_OpenWindowStatic(handle%)
 4190IF FNshell_SearchStatic(_U%!184,handle%)>-1 THEN
 4191  PROCshell_OpenWindow(handle%,0,-1)
 4192ELSE
 4193  ERROR 99,FNshell_MessageNoArgs("SHELLMSG09")
 4194ENDIF
 4195ENDPROC
 4196:
 4197*|Stop PROCshell_OpenWindowStatic
 4198
 4199*|Start FNshell_SearchStatic
 4200DEF FNshell_SearchStatic(w_list%,handle%)
 4201REM search static window list by window handle
 4202LOCAL found%,ctr%
 4203found%=-1:ctr%=0
 4204IF w_list%<>0 THEN
 4205  WHILE w_list%!ctr%<>-1
 4206    IF w_list%!ctr%=handle% THEN found%=ctr%
 4207    ctr%+=4
 4208  ENDWHILE
 4209ENDIF
 4210=found%
 4211:
 4212*|Stop FNshell_SearchStatic
 4213
 4214*|Start PROCshell_CreateWindowStatic
 4215DEF PROCshell_CreateWindowStatic(ident$,RETURN handle%)
 4216LOCAL wb_ptr%,w_list%,temp%,offset%
 4217wb_ptr%=FNshell_GetWB(ident$)
 4218REM set 'sprite area' pointer to usersprites area
 4219wb_ptr%!64=_U%!16
 4220SYS "Wimp_CreateWindow",,wb_ptr% TO handle%
 4221w_list%=_U%!184
 4222IF w_list%=0 THEN
 4223  REM empty list
 4224*|ifdef TraceInit
 4225  PROCshell_Tracef0("CreateWindowStatic:Empty List")
 4226*|endif
 4227  _U%!184=FNshell_HeapBlockFetch(8)
 4228  w_list%=_U%!184
 4229  w_list%!0=handle%:w_list%!4=-1
 4230ELSE
 4231  REM search list for window handle
 4232*|ifdef TraceInit
 4233  PROCshell_Tracef0("CreateWindowStatic:Searching for window handle")
 4234*|endif
 4235  offset%=FNshell_SearchStatic(_U%!184,handle%)
 4236  IF offset%=-1 THEN
 4237    REM add window handle to static list
 4238*|ifdef TraceInit
 4239  PROCshell_Tracef0("CreateWindowStatic:Not found - adding window handle to list")
 4240*|endif
 4241    offset%=FNshell_SearchStatic(_U%!184,0)
 4242    IF offset%=-1 THEN
 4243*|ifdef TraceInit
 4244  PROCshell_Tracef0("CreateWindowStatic:Extending window handle list")
 4245*|endif
 4246      ctr%=0
 4247      WHILE w_list%!ctr%<>-1
 4248        ctr%+=4
 4249      ENDWHILE
 4250      _U%!184=FNshell_HeapBlockExtend(_U%!184,4)
 4251      w_list%=_U%!184
 4252    ELSE
 4253*|ifdef TraceInit
 4254  PROCshell_Tracef0("CreateWindowStatic:Found unused space in list")
 4255*|endif
 4256      ctr%=offset%
 4257    ENDIF
 4258    temp%=w_list%+ctr%
 4259    temp%!0=handle%:temp%!4=-1
 4260  ENDIF
 4261ENDIF
 4262ENDPROC
 4263:
 4264*|Stop PROCshell_CreateWindowStatic
 4265
 4266*|Start PROCshell_InitHelpSystem
 4267DEF PROCshell_InitHelpSystem(path$,die%)
 4268LOCAL tail$,pos%,OSVarBuff%,respath$,help_found%,abort%
 4269_U%!212=0:IF _U%!216<>0 THEN PROCshell_HeapBlockReturn(_U%!216)
 4270_U%!216=0:REM clear pending command buffer...
 4271PROCshell_ScanForHelp:REM check if StrongHlp is running...
 4272IF die% THEN tail$=" -DieWithTask" ELSE tail$=""
 4273*|ifdef Using_ResFind
 4274IF _U%!100 AND 1<<3 THEN
 4275  REM ResFind initialised, check ResPath..
 4276  path$=""
 4277  OSVarBuff%=FNshell_HeapBlockFetch(256)
 4278  respath$=FNshell_OSVarGetVal(OSVarBuff%,256,FNshell_GetAppName+"Res$Path",-1)
 4279  PROCshell_HeapBlockReturn(OSVarBuff%)
 4280  REPEAT
 4281    pos%=INSTR(respath$,",")
 4282    IF pos%>0 THEN
 4283      IF FNshell_FileExists(LEFT$(respath$,pos%-1)+FNshell_GetAppName) THEN
 4284        path$=LEFT$(respath$,pos%-1)+FNshell_GetAppName
 4285        help_found%=TRUE
 4286      ELSE
 4287        respath$=MID$(respath$,pos%+1)
 4288      ENDIF
 4289    ELSE
 4290      IF FNshell_FileExists(respath$+FNshell_GetAppName) THEN
 4291        path$=respath$+FNshell_GetAppName
 4292        help_found%=TRUE
 4293      ELSE
 4294        abort%=TRUE
 4295        PROCshell_OK(FNshell_MessageOneArg("SHELLMSG26",FNshell_GetAppName))
 4296      ENDIF
 4297    ENDIF
 4298  UNTIL path$<>"" OR help_found% OR abort%
 4299ENDIF
 4300*|endif
 4301IF abort%=0 THEN PROCshell_StrongHlpMsg("Help_Install "+path$+tail$)
 4302ENDPROC
 4303:
 4304*|Stop PROCshell_InitHelpSystem
 4305
 4306*|Start PROCshell_HelpWord
 4307DEF PROCshell_HelpWord(word$)
 4308LOCAL read%,temp%,buff%
 4309buff%=FNshell_HeapBlockFetch(512)
 4310IF _U%!208 = -1 THEN
 4311  REM  StrongHelp is not loaded. Try to run it..
 4312  IF FNshell_OSVarExists(buff%,"StrongHelp$Dir") THEN
 4313    REM Variable exists, so attempt to run StrongHlp..
 4314    SYS "XWimp_StartTask","<StrongHelp$Dir>"
 4315    IF _U%!216<>0 THEN PROCshell_HeapBlockReturn(_U%!216)
 4316    _U%!216=FNshell_HeapBlockFetch(LENword$+1)
 4317    temp%=_U%!216
 4318    $temp%=word$
 4319  ELSE
 4320    REM It doesn't, so complain, but first release buffer as an
 4321    REM error is about to be generated..
 4322    PROCshell_HeapBlockReturn(buff%)
 4323    PROCshell_OK(FNshell_MessageNoArgs("SHELLMSG11"))
 4324  ENDIF
 4325ELSE
 4326  PROCshell_StrongHlpMsg("Help_Word "+word$)
 4327ENDIF
 4328PROCshell_HeapBlockReturn(buff%)
 4329ENDPROC
 4330:
 4331*|Stop PROCshell_HelpWord
 4332*|Start PROCshell_StrongHlpMsg
 4333DEF PROCshell_StrongHlpMsg(msg$)
 4334PROCshell_BroadcastMessage(&43B00,msg$)
 4335ENDPROC
 4336:
 4337*|Stop PROCshell_StrongHlpMsg
 4338*|Start PROCshell_ScanForHelp
 4339DEF PROCshell_ScanForHelp
 4340LOCAL wrk%,owner_taskhandle%
 4341wrk%=FNshell_HeapBlockFetch(256):REM block for messages
 4342REM  Finds out if StrongHelp is already running.
 4343REM  Does this by scanning the tasks installed on the iconbar..
 4344REM  This again is done by getting the task's handle, and sending a
 4345REM  sending a TaskNameRq to the taskhandler. When this returns
 4346REM  (as a TaskNameIs message) we compare the string with "StrongHelp".
 4347REM  If not equal, this routine is called again to check next icon..
 4348
 4349REPEAT
 4350  REM  This Wimp_SendMessage does *not* send a message to the owner of
 4351  REM  the icon. It merely returns the taskhandle of the owner.
 4352  wrk%!12 = 0
 4353  SYS "Wimp_SendMessage",19,wrk%,-2,_U%!212 TO ,,owner_taskhandle%
 4354  _U%!212=_U%!212+1:REM icontry%
 4355UNTIL owner_taskhandle% <> -1 OR (_U%!212) > 64
 4356
 4357IF owner_taskhandle% <> -1 THEN
 4358  REM Send request for name of this task.
 4359  wrk%!0  = 24
 4360  wrk%!12 = 0
 4361  wrk%!16 = &400C6
 4362  wrk%!20 = owner_taskhandle%
 4363  SYS "Wimp_SendMessage",17,wrk%,0
 4364ENDIF
 4365PROCshell_HeapBlockReturn(wrk%)
 4366ENDPROC
 4367:
 4368*|Stop PROCshell_ScanForHelp
 4369*|Start PROCshell_BroadcastMessage
 4370DEF PROCshell_BroadcastMessage(reason_code%,msg$)
 4371LOCAL msg_blk%
 4372msg_blk%=FNshell_HeapBlockFetch(256)
 4373msg_blk%!12=0:msg_blk%!16=reason_code%
 4374$(msg_blk%+20)=msg$+CHR$(0)
 4375msg_blk%!0=256
 4376SYS "Wimp_SendMessage",17,msg_blk%,0:REM broadcast message
 4377PROCshell_HeapBlockReturn(msg_blk%)
 4378ENDPROC
 4379:
 4380*|Stop PROCshell_BroadcastMessage
 4381*|Start PROCshell_WindowToggleBackIcon
 4382DEF PROCshell_WindowToggleBackIcon(RETURN wh%)
 4383PROCshell_WindowToggleFlags(wh%,1<<24)
 4384ENDPROC
 4385:
 4386*|Stop PROCshell_WindowToggleBackIcon
 4387*|Start PROCshell_WindowToggleCloseIcon
 4388DEF PROCshell_WindowToggleCloseIcon(RETURN wh%)
 4389PROCshell_WindowToggleFlags(wh%,1<<25)
 4390ENDPROC
 4391:
 4392*|Stop PROCshell_WindowToggleCloseIcon
 4393*|Start PROCshell_WindowToggleTitleBar
 4394DEF PROCshell_WindowToggleTitleBar(RETURN wh%)
 4395PROCshell_WindowToggleFlags(wh%,1<<26)
 4396ENDPROC
 4397:
 4398*|Stop PROCshell_WindowToggleTitleBar
 4399*|Start PROCshell_WindowToggleToggleIcon
 4400DEF PROCshell_WindowToggleToggleIcon(RETURN wh%)
 4401PROCshell_WindowToggleFlags(wh%,1<<27)
 4402ENDPROC
 4403:
 4404*|Stop PROCshell_WindowToggleToggleIcon
 4405*|Start PROCshell_WindowToggleHScrollBar
 4406DEF PROCshell_WindowToggleHScrollBar(RETURN wh%)
 4407PROCshell_WindowToggleFlags(wh%,1<<30)
 4408ENDPROC
 4409:
 4410*|Stop PROCshell_WindowToggleHScrollBar
 4411*|Start PROCshell_WindowToggleAdjustSizeIcon
 4412DEF PROCshell_WindowToggleAdjustSizeIcon(RETURN wh%)
 4413PROCshell_WindowToggleFlags(wh%,1<<29)
 4414ENDPROC
 4415:
 4416*|Stop PROCshell_WindowToggleAdjustSizeIcon
 4417*|Start PROCshell_WindowToggleVScrollBar
 4418DEF PROCshell_WindowToggleVScrollBar(RETURN wh%)
 4419PROCshell_WindowToggleFlags(wh%,1<<28)
 4420ENDPROC
 4421:
 4422*|Stop PROCshell_WindowToggleVScrollBar
 4423*|Start PROCshell_WindowToggleFlags
 4424DEF PROCshell_WindowToggleFlags(RETURN wh%,mask%)
 4425LOCAL blk%,flags%,open%,handle%
 4426*|ifdef TraceInit
 4427PROCshell_Tracef0("WindowToggleFlags:wh%=&"+STR$~wh%)
 4428*|endif
 4429open%=FNshell_WindowIsOpen(wh%)
 4430blk%=FNshell_HeapBlockFetch(6000)
 4431blk%!0=wh%
 4432SYS "Wimp_GetWindowInfo",,blk%
 4433flags%=blk%!32
 4434flags%=(flags% EOR mask%)
 4435blk%!32=flags%
 4436SYS "Wimp_DeleteWindow",,blk%
 4437SYS "Wimp_CreateWindow",,blk%+4 TO handle%
 4438!blk%=handle%
 4439IF open% THEN
 4440  REM If window was open, open it again..
 4441  SYS "Wimp_OpenWindow",,blk%
 4442ENDIF
 4443PROCshell_HeapBlockReturn(blk%)
 4444IF handle%<>wh% THEN
 4445  PROCshell_UpdateWindowHandle(wh%,handle%)
 4446  wh%=handle%
 4447ENDIF
 4448ENDPROC
 4449:
 4450*|Stop PROCshell_WindowToggleFlags
 4451*|Start PROCshell_ListClickSelect
 4452DEF PROCshell_ListClickSelect
 4453LOCAL e_list%,ptr%,list_size%,temp%,temp2%
 4454e_list%=_U%!12
 4455list_size%=FNshell_HeapBlockInfo(e_list%)
 4456*|ifdef TraceInit
 4457PROCshell_Tracef0(" ")
 4458PROCshell_Tracef0("List of ClickSelect events:")
 4459*|endif
 4460ptr%=0
 4461REPEAT
 4462  temp%=e_list%!(ptr%+20):temp2%=e_list%+ptr%
 4463  IF FNshell_HeapBlockExists(temp%) THEN
 4464    IF $temp%<>"" THEN
 4465*|ifdef TraceInit
 4466  PROCshell_Tracef0("&"+FNshell_StringPadTrailing(STR$~temp2%!0," ",8)+" &"+FNshell_StringPadTrailing(STR$~temp2%!4," ",8)+"   "+$temp%)
 4467*|endif
 4468    ENDIF
 4469  ENDIF
 4470  ptr%+=48
 4471UNTIL (ptr%>=list_size%)
 4472*|ifdef TraceInit
 4473PROCshell_Tracef0(" ")
 4474*|endif
 4475ENDPROC
 4476:
 4477*|Stop PROCshell_ListClickSelect
 4478*|Start PROCshell_ListClickAdjust
 4479DEF PROCshell_ListClickAdjust
 4480LOCAL e_list%,ptr%,list_size%,temp%,temp2%
 4481e_list%=_U%!12
 4482list_size%=FNshell_HeapBlockInfo(e_list%)
 4483*|ifdef TraceInit
 4484PROCshell_Tracef0(" ")
 4485PROCshell_Tracef0("List of ClickAdjust events:")
 4486*|endif
 4487ptr%=0
 4488REPEAT
 4489  temp%=e_list%!(ptr%+24):temp2%=e_list%+ptr%
 4490  IF FNshell_HeapBlockExists(temp%) THEN
 4491    IF $temp%<>"" THEN
 4492*|ifdef TraceInit
 4493  PROCshell_Tracef0("&"+FNshell_StringPadTrailing(STR$~temp2%!0," ",8)+" &"+FNshell_StringPadTrailing(STR$~temp2%!4," ",8)+"   "+$temp%)
 4494*|endif
 4495    ENDIF
 4496  ENDIF
 4497  ptr%+=48
 4498UNTIL (ptr%>=list_size%)
 4499*|ifdef TraceInit
 4500PROCshell_Tracef0(" ")
 4501*|endif
 4502ENDPROC
 4503:
 4504*|Stop PROCshell_ListClickAdjust
 4505*|Start PROCshell_ListHelpTags
 4506DEF PROCshell_ListHelpTags
 4507LOCAL e_list%,ptr%,list_size%,temp%,temp2%
 4508e_list%=_U%!12
 4509list_size%=FNshell_HeapBlockInfo(e_list%)
 4510*|ifdef TraceInit
 4511PROCshell_Tracef0(" ")
 4512PROCshell_Tracef0("List of attached help tags:")
 4513*|endif
 4514ptr%=0
 4515REPEAT
 4516  temp%=e_list%!(ptr%+44):temp2%=e_list%+ptr%
 4517  IF FNshell_HeapBlockExists(temp%) THEN
 4518    IF $temp%<>"" THEN
 4519*|ifdef TraceInit
 4520  PROCshell_Tracef0("&"+FNshell_StringPadTrailing(STR$~temp2%!0," ",8)+" &"+FNshell_StringPadTrailing(STR$~temp2%!4," ",8)+"   "+$temp%)
 4521*|endif
 4522    ENDIF
 4523  ENDIF
 4524  ptr%+=48
 4525UNTIL (ptr%>=list_size%)
 4526*|ifdef TraceInit
 4527PROCshell_Tracef0(" ")
 4528*|endif
 4529ENDPROC
 4530:
 4531*|Stop PROCshell_ListHelpTags
 4532*|Start PROCshell_MemFill
 4533DEF PROCshell_MemFill(start%,nr_bytes%,value%)
 4534LOCAL I%,nr_words%,remainder%
 4535nr_words%=nr_bytes% DIV 4
 4536remainder%=nr_bytes% MOD 4
 4537IF nr_words%>0 THEN
 4538  FOR I%=1 TO (nr_words%*4) STEP 4
 4539    start%!(I%-1)=value%
 4540  NEXT I%
 4541ENDIF
 4542IF remainder%>0 THEN
 4543  start%=start%+(nr_words%*4)
 4544  FOR I%=0 TO remainder%-1
 4545    start%?I%=value%
 4546  NEXT I%
 4547ENDIF
 4548ENDPROC
 4549:
 4550*|Stop PROCshell_MemFill
 4551
 4552*|Start PROCshell_AttachFontMenu
 4553*|Define Using_FontMenu
 4554DEF PROCshell_AttachFontMenu(wh%,ih%,sel_fn$,maker_fn$)
 4555LOCAL menu%
 4556PROCshell_FontMenuInit
 4557SYS "FontMenu_Select",""+CHR$0,_U%!260 TO ,menu%
 4558REM Store menu ptr in shell memory..
 4559_U%!252=menu%
 4560PROCshell_EventAdd(wh%,ih%,0,-2,sel_fn$)
 4561*|ifdef PROCshell_TraceInit
 4562PROCshell_Tracef0("AttachFontMenu:Attaching font menu")
 4563*|endif
 4564IF maker_fn$<>"" THEN PROCshell_AttachMenuMaker(wh%,ih%,maker_fn$)
 4565ENDPROC
 4566:
 4567*|Stop PROCshell_AttachFontMenu
 4568
 4569*|Start PROCshell_AttachFontSubMenu
 4570*|Define Using_FontMenu
 4571DEF PROCshell_AttachFontSubMenu(item%,warn_fn$,sel_fn$)
 4572LOCAL itemstart%,menu%,temp%,ctr%
 4573PROCshell_FontMenuInit
 4574SYS "FontMenu_Select",""+CHR$0,_U%!260 TO ,menu%
 4575SYS "MenuUtil_SubMenu",item%,menu%
 4576SYS "MenuUtil_Warning",,TRUE
 4577REM Store menu ptr in shell memory..
 4578_U%!252=menu%
 4579PROCshell_EventListMenuWarn(item%,menu%,warn_fn$,sel_fn$)
 4580*|ifdef PROCshell_TraceInit
 4581PROCshell_Tracef0("AttachFontSubMenu:Attaching font menu &"+STR$~menu%)
 4582*|endif
 4583ENDPROC
 4584:
 4585*|Stop PROCshell_AttachFontSubMenu
 4586
 4587*|Start PROCshell_FontMenuInit
 4588DEF PROCshell_FontMenuInit
 4589OSCLI ("RMEnsure FontMenu 1.16 RMLoad <EvntShellSystem$Path>FontMenu")
 4590OSCLI ("RMEnsure FontMenu 1.16 Error Couldn't load FontMenu module")
 4591IF _U%!240=-1 THEN
 4592  REM The above flag ensures that the library knows that "FontMenu_Create"
 4593  REM has been called. It should only be called once in a program as it
 4594  REM registers the program as a FontMenu module user..
 4595  SYS "FontMenu_Create" TO _U%!240
 4596ENDIF
 4597PROCshell_FontMenuSelectFont("",TRUE)
 4598ENDPROC
 4599:
 4600*|Stop PROCshell_FontMenuInit
 4601*|Start PROCshell_FontMenuSelectFont
 4602DEF PROCshell_FontMenuSelectFont(fontname$,systemfont%)
 4603LOCAL temp%,f_menu%
 4604IF FNshell_HeapBlockExists(_U%!244) THEN PROCshell_HeapBlockReturn(_U%!244)
 4605_U%!244=FNshell_HeapBlockFetch(LENfontname$+1)
 4606temp%=_U%!244:$temp%=fontname$
 4607IF systemfont%<>0 THEN systemfont%=1
 4608_U%!260=systemfont%
 4609SYS "FontMenu_Select",fontname$,_U%!260 TO ,f_menu%
 4610IF f_menu%<>_U%!252 THEN
 4611  REM FontMenu ptr has changed..
 4612  PROCshell_FontMenuUpdatePtr(f_menu%)
 4613  _U%!252=f_menu%
 4614ENDIF
 4615*|ifdef TraceInit
 4616PROCshell_Tracef0("FontMenuSelectFont:Font is '"+fontname$+"'")
 4617*|endif
 4618ENDPROC
 4619:
 4620*|Stop PROCshell_FontMenuSelectFont
 4621*|Start FNshell_FontMenuGetLastSelectedFont
 4622DEF FNshell_FontMenuGetLastSelectedFont
 4623LOCAL temp%
 4624IF NOT FNshell_HeapBlockExists(_U%!244) THEN  =""
 4625temp%=_U%!244:=$temp%
 4626:
 4627*|Stop FNshell_FontMenuGetLastSelectedFont
 4628*|Start PROCshell_FontMenuUpdatePtr
 4629DEF PROCshell_FontMenuUpdatePtr(ptr%)
 4630LOCAL e_list%,ctr%
 4631*|ifdef TraceInit
 4632PROCshell_Tracef0("FontMenuUpdatePtr:Started..")
 4633*|endif
 4634IF FNshell_HeapBlockExists(_U%!220) THEN
 4635*|ifdef TraceInit
 4636  PROCshell_Tracef0("FontMenuUpdatePtr:HeapBlock found..")
 4637*|endif
 4638  e_list%=_U%!220:ctr%=0
 4639  REPEAT
 4640*|ifdef TraceInit
 4641  PROCshell_Tracef0("FontMenuUpdatePtr:Substituting ptr..")
 4642*|endif
 4643    e_list%!(ctr%+8)=ptr%
 4644    ctr%+=12
 4645  UNTIL e_list%!ctr%=-1
 4646ENDIF
 4647ENDPROC
 4648:
 4649*|Stop PROCshell_FontMenuUpdatePtr
 4650*|Start PROCshell_FindFont
 4651DEF PROCshell_FindFont(RETURN font$,x_pt%,y_pt%,RETURN font_handle%)
 4652IF NOT FNshell_FontIsAvailable(font$,x_pt%,y_pt%) THEN
 4653  font$="Trinity.Medium"
 4654ENDIF
 4655SYS "Font_FindFont",,font$,x_pt%*16,y_pt%*16,0,0 TO font_handle%
 4656ENDPROC
 4657:
 4658*|Stop PROCshell_FindFont
 4659*|Start FNshell_FontIsAvailable
 4660DEF FNshell_FontIsAvailable(font$,x_pt%,y_pt%)
 4661LOCAL ERROR
 4662ON ERROR LOCAL:RESTORE ERROR:=FALSE
 4663SYS "Font_FindFont",0,font$,x_pt%*16,y_pt%*16,0,0 TO font_handle%
 4664SYS "Font_LoseFont",font_handle%
 4665=TRUE
 4666:
 4667*|Stop FNshell_FontIsAvailable
 4668
 4669*|Start FNshell_CheckSelection
 4670DEF FNshell_CheckSelection(sel%)
 4671LOCAL temp%,ctr%
 4672temp%=_U%!256
 4673IF temp%=0 THEN =-1
 4674IF _U%!24=_U%!252 THEN =0
 4675REPEAT
 4676  IF sel%!ctr%<>temp%!ctr% THEN =-1
 4677  ctr%+=4
 4678UNTIL temp%!ctr%=-1
 4679=ctr%
 4680:
 4681*|Stop FNshell_CheckSelection
 4682
 4683*|Start FNshell_MenuGetItemAddress
 4684DEF FNshell_MenuGetItemAddress(menu%,selection%)
 4685LOCAL ctr%,item_addr%
 4686SYS "MenuUtil_Info",menu% TO menu%
 4687REPEAT
 4688  item_addr%=menu%+28+((selection%!ctr%)*24)
 4689  menu%=item_addr%!4:REM address of submenu..
 4690  ctr%+=4
 4691UNTIL selection%!ctr%=-1
 4692=item_addr%
 4693:
 4694*|Stop FNshell_MenuGetItemAddress
 4695
 4696*|Start FNshell_GetLastMouseXPos
 4697DEF FNshell_GetLastMouseXPos
 4698=_U%!272
 4699:
 4700*|Stop FNshell_GetLastMouseXPos
 4701*|Start FNshell_GetLastMouseYPos
 4702DEF FNshell_GetLastMouseYPos
 4703=_U%!276
 4704:
 4705*|Stop FNshell_GetLastMouseYPos
 4706*|Start PROCshell_UpdateWindowHandle
 4707DEF PROCshell_UpdateWindowHandle(old_handle%,new_handle%)
 4708*|ifdef TraceInit
 4709PROCshell_Tracef0("UpdateWindowHandle:Updating stored window handles")
 4710PROCshell_Tracef0("UpdateWindowHandle:old handle=&"+STR$~old_handle%)
 4711PROCshell_Tracef0("UpdateWindowHandle:new handle=&"+STR$~new_handle%)
 4712*|endif
 4713IF new_handle%<>old_handle% THEN
 4714  IF _U%!28=old_handle% THEN _U%!28=new_handle%
 4715  PROCshell_FixEventBlock(old_handle%,new_handle%,_U%!12,48):REM main event block
 4716  PROCshell_FixEventBlock(old_handle%,new_handle%,_U%!96,16):REM dataload events
 4717  PROCshell_FixEventBlock(old_handle%,new_handle%,_U%!72,24):REM datasave events
 4718  PROCshell_FixEventBlock(old_handle%,new_handle%,_U%!92,24):REM pane events
 4719  PROCshell_FixEventBlock(old_handle%,new_handle%,_U%!104,16):REM bump events
 4720  PROCshell_UpdateStaticWindows(old_handle%,new_handle%)
 4721ENDIF
 4722ENDPROC
 4723:
 4724*|Stop PROCshell_UpdateWindowHandle
 4725*|Start PROCshell_UpdateStaticWindows
 4726DEF PROCshell_UpdateStaticWindows(old_handle%,new_handle%)
 4727LOCAL offset%,w_list%
 4728*|ifdef TraceInit
 4729PROCshell_Tracef0("UpdateStaticWindows:Correcting static window list..")
 4730*|endif
 4731w_list%=_U%!184
 4732offset%=FNshell_SearchStatic(_U%!184,old_handle%)
 4733w_list%!offset%=new_handle%
 4734ENDPROC
 4735:
 4736*|Stop PROCshell_UpdateStaticWindows
 4737*|Start PROCshell_FixEventBlock
 4738DEF PROCshell_FixEventBlock(old_handle%,new_handle%,event_list%,offset%)
 4739LOCAL ptr%,list_size%
 4740IF FNshell_HeapBlockExists(event_list%) THEN
 4741  list_size%=FNshell_HeapBlockInfo(event_list%)-8
 4742  REPEAT
 4743    IF (event_list%!ptr%=old_handle%) THEN
 4744      event_list%!ptr%=new_handle%
 4745    ENDIF
 4746    ptr%+=offset%
 4747  UNTIL (ptr%>=list_size%)
 4748ENDIF
 4749ENDPROC
 4750:
 4751*|Stop PROCshell_FixEventBlock
 4752*|Start PROCshell_IconSelectAll
 4753DEF PROCshell_IconSelectAll(wh%)
 4754LOCAL blk%,I%
 4755blk%=FNshell_HeapBlockFetch(2000)
 4756I%=blk%+&40:!blk%=wh%
 4757blk%!8=1<<21:blk%!12=1<<21
 4758SYS "Wimp_WhichIcon",!blk%,I%,5<<21,0<<21
 4759WHILE !I%>-1
 4760  blk%!4=!I%
 4761  SYS "Wimp_SetIconState",,blk%
 4762  I%+=4
 4763ENDWHILE
 4764PROCshell_HeapBlockReturn(blk%)
 4765ENDPROC
 4766:
 4767*|Stop PROCshell_IconSelectAll
 4768*|Start PROCshell_IconDeselectAll
 4769DEF PROCshell_IconDeselectAll(wh%)
 4770LOCAL blk%,I%
 4771blk%=FNshell_HeapBlockFetch(2000)
 4772I%=blk%+&40:!blk%=wh%:blk%!8=0:blk%!12=1<<21
 4773SYS "Wimp_WhichIcon",!blk%,I%,5<<21,1<<21
 4774WHILE !I%>-1
 4775  blk%!4=!I%
 4776  SYS "Wimp_SetIconState",,blk%
 4777  I%+=4
 4778ENDWHILE
 4779PROCshell_HeapBlockReturn(blk%)
 4780ENDPROC
 4781:
 4782*|Stop PROCshell_IconDeselectAll
 4783
 4784*|Start PROCshell_Message_SaveDesktop
 4785DEF PROCshell_Message_SaveDesktop(Q%)
 4786LOCAL boot$
 4787boot$="Run "+FNshell_GetAppDir+CHR$10
 4788SYS "OS_GBPB",2,Q%!20,boot$,LENboot$
 4789ENDPROC
 4790:
 4791*|Stop PROCshell_Message_SaveDesktop
 4792
 4793*|Start PROCshell_MessagesInit
 4794DEF PROCshell_MessagesInit(filename$,RETURN m_filedesc%,RETURN m_buffer%)
 4795LOCAL size%,flags%
 4796LOCAL ERROR
 4797ON ERROR LOCAL RESTORE ERROR:ERROR 3,"Cannot open message file '"+filename$+"'"
 4798SYS "MessageTrans_FileInfo",,filename$ TO flags%,,size%
 4799IF flags% AND 1 THEN m_buffer%=0 ELSE m_buffer%=FNshell_HeapBlockFetch(size%)
 4800SYS "OS_Module",6,,,17+LEN(filename$) TO ,,m_filedesc%
 4801$(m_filedesc%+16)=filename$
 4802SYS "MessageTrans_OpenFile",m_filedesc%,m_filedesc%+16
 4803*|ifdef TraceInit
 4804PROCshell_Tracef0("MessagesInit:Message resource file '"+filename$+"' loaded")
 4805*|endif
 4806ENDPROC
 4807:
 4808*|Stop PROCshell_MessagesInit
 4809*|Start FNshell_PrinterOnLine
 4810DEF FNshell_PrinterOnLine
 4811LOCAL inbuf%,online%
 4812inbuf%=ADVAL(-4)
 4813VDU2,1,0,1,0,1,0
 4814TIME=0:REPEAT:UNTIL TIME>30
 4815online%=NOT(ADVAL(-4)<inbuf%)
 4816*FX21,3
 4817VDU3
 4818=online%
 4819:
 4820*|Stop FNshell_PrinterOnLine
 4821*|Start PROCshell_AttachBumpHandler
 4822DEF PROCshell_AttachBumpHandler(wh%,ih%,incr%,decr%,l_limit%,u_limit%,step%,wrap%,disp_fn$,decode_fn$)
 4823LOCAL e_blk%,offset%,temp%,temp2%,bump_info_blk%
 4824
 4825REM format of bump handler event block..
 4826REM +0  window handle
 4827REM +4  bump icon handle
 4828REM +8  step size (-ve for decr icon)
 4829REM +12 pointer to second info block
 4830REM
 4831REM format of second block..
 4832REM +0  display icon handle
 4833REM +4  lower limit
 4834REM +8  upper limit
 4835REM +12 pointer to display function
 4836REM +16 pointer to display decode function
 4837REM +20 flags (1 byte)
 4838REM     bit 0 wrap upper
 4839REM     bit 1 wrap lower
 4840
 4841REM deal with incr% icon event first..
 4842offset%=FNshell_GetEventListOffset(wh%,incr%,_U%+104,16,TRUE)
 4843e_blk%=_U%!104+offset%:REM pointer to event list..
 4844
 4845  e_blk%!0=wh%:e_blk%!4=incr%:e_blk%!8=step%
 4846  e_blk%!12=FNshell_HeapBlockFetch(24)
 4847  bump_info_blk%=e_blk%!12
 4848  bump_info_blk%!0=ih%
 4849  bump_info_blk%!4=l_limit%
 4850  bump_info_blk%!8=u_limit%
 4851  IF LENdisp_fn$>0 THEN
 4852    bump_info_blk%!12=FNshell_HeapBlockFetch((LENdisp_fn$)+1)
 4853    temp2%=bump_info_blk%!12:$temp2%=disp_fn$
 4854  ELSE
 4855    bump_info_blk%!12=0
 4856  ENDIF
 4857  IF LENdecode_fn$>0 THEN
 4858    bump_info_blk%!16=FNshell_HeapBlockFetch((LENdecode_fn$)+1)
 4859    temp2%=bump_info_blk%!16:$temp2%=decode_fn$
 4860  ELSE
 4861    bump_info_blk%!16=0
 4862  ENDIF
 4863  IF wrap%=-1 THEN bump_info_blk%!20=1 ELSE bump_info_blk%!20=0
 4864
 4865  offset%=FNshell_GetEventListOffset(wh%,decr%,_U%+104,16,TRUE)
 4866  e_blk%=_U%!104+offset%:REM pointer to event list..
 4867
 4868  e_blk%!0=wh%:e_blk%!4=decr%:e_blk%!8=step%*(-1)
 4869  e_blk%!12=bump_info_blk%
 4870
 4871ENDPROC
 4872:
 4873*|Stop PROCshell_AttachBumpHandler
 4874
 4875*|Start PROCshell_HandleBumpIcons
 4876DEF PROCshell_HandleBumpIcons(offset%,wh%,ih%)
 4877LOCAL display_ih%,info_blk%,e_blk%,curr_val%,_temp$,fn2%
 4878LOCAL new_val%,fn%
 4879e_blk%=_U%!104+offset%
 4880_U%!288=wh%:_U%!292=ih%:_U%!296=offset%
 4881REM e_blk%!8 holds step value
 4882info_blk%=e_blk%!12
 4883REM info_blk%!0  holds display icon handle
 4884REM info_blk%!4  holds lower limit
 4885REM info_blk%!8  holds upper limit
 4886REM info_blk%!20 holds wrap flag
 4887fn2%=info_blk%!16
 4888IF fn2%<>0 THEN
 4889  _temp$=FNshell_IconGetData(wh%,info_blk%!0)
 4890  curr_val%=EVAL("FN"+$fn2%+"(_temp$)")
 4891ELSE
 4892  curr_val%=VAL(FNshell_IconGetData(wh%,info_blk%!0))
 4893ENDIF
 4894_new_val%=curr_val%+e_blk%!8
 4895IF info_blk%!20=0 THEN
 4896  REM no wrap..
 4897  IF _new_val%>info_blk%!8 THEN _new_val%=info_blk%!8
 4898  IF _new_val%<info_blk%!4 THEN _new_val%=info_blk%!4
 4899ELSE
 4900  REM wrap..
 4901  IF _new_val%>info_blk%!8 THEN _new_val%=info_blk%!4
 4902  IF _new_val%<info_blk%!4 THEN _new_val%=info_blk%!8
 4903ENDIF
 4904fn%=info_blk%!12
 4905IF fn%<>0 THEN
 4906  _new_val$=EVAL("FN"+$fn%+"(_new_val%)")
 4907ELSE
 4908  _new_val$=STR$_new_val%
 4909ENDIF
 4910IF _new_val%<>curr_val% THEN
 4911  PROCshell_IconPutData(wh%,info_blk%!0,_new_val$,-1)
 4912ENDIF
 4913ENDPROC
 4914:
 4915*|Stop PROCshell_HandleBumpIcons
 4916
 4917*|Start FNshell_WindowSetSpriteArea
 4918DEF FNshell_WindowSetSpriteArea(h%,SpriteArea%)
 4919LOCAL blk%,new_handle%
 4920blk%=FNshell_HeapBlockFetch(6000)
 4921!blk%=h%
 4922SYS "Wimp_GetWindowInfo",,blk%
 4923blk%!68=SpriteArea%
 4924SYS "Wimp_DeleteWindow",,blk%
 4925SYS "Wimp_CreateWindow",,blk%+4 TO new_handle%
 4926IF new_handle%<>h% THEN PROCshell_UpdateWindowHandle(h%,new_handle%)
 4927PROCshell_HeapBlockReturn(blk%)
 4928=new_handle%
 4929:
 4930*|Stop FNshell_WindowSetSpriteArea
 4931
 4932*|Start FNshell_StrongHlpIsAvailable
 4933DEF FNshell_StrongHlpIsAvailable
 4934LOCAL r%,buff%
 4935buff%=FNshell_HeapBlockFetch(256)
 4936r%=FNshell_OSVarExists(buff%,"StrongHelp$Dir")
 4937PROCshell_HeapBlockReturn(buff%)
 4938=r%
 4939*|Stop FNshell_StrongHlpIsAvailable
 4940
 4941*|Start FNshell_MenuNew
 4942DEF FNshell_MenuNew(title$)
 4943LOCAL handle%
 4944SYS "MenuUtil_New",,title$ TO handle%
 4945=handle%
 4946:
 4947*|Stop FNshell_MenuNew
 4948
 4949*|Start FNshell_MenuAdd
 4950DEF FNshell_MenuAdd(handle%,item$,sel_fn$)
 4951LOCAL ret_handle%
 4952IF sel_fn$<>"" THEN 
 4953  SYS "MenuUtil_Add",handle%,item$,sel_fn$ TO ret_handle%
 4954ELSE
 4955  SYS "MenuUtil_Add",handle%,item$ TO ret_handle%
 4956ENDIF
 4957=ret_handle%
 4958:
 4959*|Stop FNshell_MenuAdd
 4960
 4961*|Start PROCshell_MenuTick
 4962DEF PROCshell_MenuTick(item_handle%,state%)
 4963SYS "MenuUtil_Tick",item_handle%,state%
 4964ENDPROC
 4965:
 4966*|Stop PROCshell_MenuTick
 4967
 4968*|Start PROCshell_MenuTickOnly1
 4969DEF PROCshell_MenuTickOnly1(menu_handle%,pos%)
 4970SYS "MenuUtil_TickOnly",menu_handle%,pos%
 4971ENDPROC
 4972:
 4973*|Stop PROCshell_MenuTickOnly1
 4974
 4975*|Start PROCshell_MenuTickOnly2
 4976DEF PROCshell_MenuTickOnly2(item_handle%)
 4977SYS "MenuUtil_TickOnly",item_handle%
 4978ENDPROC
 4979:
 4980*|Stop PROCshell_MenuTickOnly2
 4981
 4982*|Start PROCshell_MenuShade
 4983DEF PROCshell_MenuShade(handle%,state%)
 4984SYS "MenuUtil_Fade",handle%,state%
 4985ENDPROC
 4986:
 4987*|Stop PROCshell_MenuShade
 4988
 4989*|Start PROCshell_MenuDotted
 4990DEF PROCshell_MenuDotted(item_handle%,state%)
 4991SYS "MenuUtil_Dots",item_handle%,state%
 4992ENDPROC
 4993:
 4994*|Stop PROCshell_MenuDotted
 4995
 4996*|Start PROCshell_MenuColours
 4997DEF PROCshell_MenuColours(item_handle%,fg%,bg%)
 4998SYS "MenuUtil_Colours",item_handle%,fg%,bg%
 4999ENDPROC
 5000:
 5001*|Stop PROCshell_MenuColours
 5002
 5003*|Start PROCshell_MenuWritable
 5004DEF PROCshell_MenuWritable(item_handle%,state%,size%,valid$)
 5005SYS "MenuUtil_Writable",item_handle%,state%,size%,valid$
 5006ENDPROC
 5007:
 5008*|Stop PROCshell_MenuWritable
 5009
 5010*|Start PROCshell_MenuPutData
 5011DEF PROCshell_MenuPutData(item_handle%,data$)
 5012SYS "MenuUtil_Text",item_handle%,data$
 5013ENDPROC
 5014:
 5015*|Stop PROCshell_MenuPutData
 5016
 5017*|Start PROCshell_MenuCallHandler
 5018DEF PROCshell_MenuCallHandler(h%,_h_blk%)
 5019LOCAL ERROR
 5020ON ERROR LOCAL:RESTORE ERROR:ENDPROC
 5021IF EVAL("FN"+$h%+"(_h_blk%)")
 5022ENDPROC
 5023:
 5024*|Stop PROCshell_MenuCallHandler
 5025
 5026*|Start PROCshell_AttachOpenWindow
 5027DEF PROCshell_AttachOpenWindow(wh%,fn$)
 5028LOCAL blk%,temp%,offset%
 5029*|ifdef TraceInit
 5030PROCshell_Tracef0("AttachOpenWindow:Attaching OpenWindow Handler")
 5031*|endif
 5032IF wh%<0 THEN ERROR 99,PROCshell_MessageOneArg("SHELLMSG27","AttachOpenWindow")
 5033offset%=FNshell_GetEventListOffset(wh%,-1,_U%+304,12,TRUE)
 5034blk%=_U%!304+offset%
 5035blk%!0=wh%:blk%!4=-1
 5036blk%!8=FNshell_HeapBlockFetch(LEN(fn$)+1)
 5037temp%=blk%!8:$temp%=fn$
 5038ENDPROC
 5039:
 5040*|Stop PROCshell_AttachOpenWindow
 5041
 5042*|Start PROCshell_AttachCloseWindow
 5043DEF PROCshell_AttachCloseWindow(wh%,fn$)
 5044LOCAL blk%,temp%,offset%
 5045*|ifdef TraceInit
 5046PROCshell_Tracef0("AttachCloseWindow:Attaching CloseWindow Handler")
 5047*|endif
 5048IF wh%<0 THEN ERROR 99,PROCshell_MessageOneArg("SHELLMSG27","AttachCloseWindow")
 5049offset%=FNshell_GetEventListOffset(wh%,-1,_U%+308,12,TRUE)
 5050blk%=_U%!308+offset%
 5051blk%!0=wh%:blk%!4=-1
 5052blk%!8=FNshell_HeapBlockFetch(LEN(fn$)+1)
 5053temp%=blk%!8:$temp%=fn$
 5054ENDPROC
 5055:
 5056*|Stop PROCshell_AttachCloseWindow
 5057
 5058*|Start PROCshell_SpriteRename
 5059DEF PROCshell_SpriteRename(spritearea%,old$,new$)
 5060SYS "OS_SpriteOp",&200+26,spritearea%,FNshell_SpriteGetPtr(spritearea%,old$),new$
 5061ENDPROC
 5062:
 5063*|Stop PROCshell_SpriteRename
 5064
 5065*|Start PROCshell_SpriteAreaSave
 5066DEF PROCshell_SpriteAreaSave(spritearea%,filename$)
 5067SYS "OS_SpriteOp",&200+12,spritearea%,filename$
 5068ENDPROC
 5069:
 5070*|Stop PROCshell_SpriteAreaSave
 5071
 5072*|Start PROCshell_EnsurePoll
 5073DEF PROCshell_EnsurePoll
 5074LOCAL action%
 5075REPEAT
 5076  action%=FNshell_Poll_I(0,_U%!148)
 5077  PROCshell_Action(action%)
 5078UNTIL action%=0
 5079ENDPROC
 5080:
 5081*|Stop PROCshell_EnsurePoll
 5082
 5083*|Start FNshell_WimpGetVersion
 5084DEF FNshell_WimpGetVersion
 5085=_U%!316
 5086*|Stop FNshell_WimpGetVersion
 5087
 5088*|Start FNshell_OSCheckVersion
 5089DEF FNshell_OSCheckVersion(version%)
 5090=FNshell_OSModuleCheckVersion("UtilityModule",version%)
 5091*|Stop FNshell_OSCheckVersion
 5092
 5093*|Start FNshell_OSModuleCheckVersion
 5094DEF FNshell_OSModuleCheckVersion(module$,version%)
 5095LOCAL blk%,len%
 5096blk%=FNshell_HeapBlockFetch(256)
 5097OSCLI("Set AppName$RISCOS Y")
 5098OSCLI("RMEnsure "+module$+" "+STR$version%+" Set AppName$RISCOS N")
 5099SYS "XOS_ReadVarVal","AppName$RISCOS",blk%,256,0,0 TO ,,len%
 5100blk%?len%=13
 5101OSCLI("Unset AppName$RISCOS")
 5102PROCshell_HeapBlockReturn(blk%)
 5103IF $blk%="N" THEN =FALSE
 5104=TRUE
 5105*|Stop FNshell_OSModuleCheckVersion
 5106
"*|Start FNshell_LibraryVersion
� �shell_LibraryVersion

=1.20*100
:
!*|Stop FNshell_LibraryVersion

*|Start PROCshell_Error
� �shell_Error
	� _error_flag%=3 �

J  �shell_ErrorBox("Unexpected error:- "+�$+" Internal error code "+Þ)
  �shell_TraceOff
  �shell_TraceExit

�
  �shell_ErrorBox(�$)
�
_error_flag%=3
È™ "Hourglass_Smash"
�
:
*|Stop PROCshell_Error

*|Start PROCshell_OK
� �shell_OK(e$)
_error_flag%=1

� 1,e$
�
:
*|Stop PROCshell_OK
*|Start PROCshell_ErrorBox
� �shell_ErrorBox(r$)
� r%,err_blk%
 'err_blk%=�shell_HeapBlockFetch(260)
!%!err_blk%=�:$(err_blk%+4)=r$+�(0)
"Fș "Wimp_ReportError",err_blk%,_error_flag%,�shell_GetAppName � r%
#� r%=2 � _closedown%=�
$$�shell_HeapBlockReturn(err_blk%)
%�
&:
'*|Stop PROCshell_ErrorBox
()*|Start FNshell_GetLastSecureFileName
)"� �shell_GetLastSecureFileName
*� temp%
+temp%=_U%!80
,� temp%=0 � =""
-=$temp%
.:
/(*|Stop FNshell_GetLastSecureFileName
0*|Start FNshell_GetString
1 � �shell_GetString(Address%)
2� String$,Len%
3&ȕ ((Address%?Len%)>31 � Len%<255)
4  String$+=�(Address%?Len%)
5
  Len%+=1
6�
7=String$
8:
9*|Stop FNshell_GetString
:#*|Start FNshell_GetEventHandler
;-� �shell_GetEventHandler(wh%,ic%,e_type%)
<,� ptr%,event_list%,found%,list_size%,fn$
=� wh%=-1 � wh%=-2
>-list_size%=�shell_HeapBlockInfo(_U%!12)-8
?
ptr%=0
@found%=�
Aevent_list%=_U%!12
B
fn$=""
C�
D   � (event_list%!ptr%=wh%) �
E!    Ȏ event_list%!(ptr%+4) �
F    � -1
G2      � window handle found, icon handle is -1
HA      � check that a pointer has been defined to a heap block
I@      � containing a function name (if it is 0 then no event
J      � defined)...
K7      � event_list%!(ptr%+(12+(e_type%*4)))>&8000 �
L6        fn$=$(event_list%!(ptr%+(12+(e_type%*4))))
M        found%=�
N      �
O        ptr%+=48
P      �
Q	    
R7      � check icon handle in event block as well...
S&      � event_list%!(ptr%+4)=ic% �
T5        � window/icon handle event block found...
UC        � check that a pointer has been defined to a heap block
VB        � containing a function name (if it is 0 then no event
W        � defined)...
X9        � event_list%!(ptr%+(12+(e_type%*4)))>&8000 �
Y8          fn$=$(event_list%!(ptr%+(12+(e_type%*4))))
Z          found%=�
[
        �
\          ptr%+=48
]
        �
^      �
_        ptr%+=48
`      �
a	    �
b  �
c    ptr%+=48
d  �
e#� ((ptr%>=list_size%) � found%)
f=fn$
g:
h"*|Stop FNshell_GetEventHandler
i
j *|Start FNshell_GetEventMenu
k*� �shell_GetEventMenu(button%,wh%,ic%)
l.� ptr%,event_list%,found%,list_size%,menu%
m� wh%=-1 � wh%=-2
n-list_size%=�shell_HeapBlockInfo(_U%!12)-8
o
ptr%=0
pfound%=�
qevent_list%=_U%!12
r
fn$=""
s�
t   � (event_list%!ptr%=wh%) �
u&    � event_list%!(ptr%+4) = ic% �
v$      menu%=event_list%!(ptr%+8)
w$      � menu%=-2 � menu%=_U%!252
x      found%=�
y	    �
z'      � event_list%!(ptr%+4) = -1 �
{        � button%=2 �
|(          menu%=event_list%!(ptr%+8)
}(          � menu%=-2 � menu%=_U%!252
~          found%=�

        �
�          ptr%+=48
�
        �
�      �
�        ptr%+=48
�      �
�	    �
�  �
�    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%
?�shell_Tracef0("AttachDataLoad:Attaching DataLoad Handler")

� wh%=-1 � wh%=-2
$� no_load% � type%=type% � 1<<31
:offset%=�shell_GetEventListOffset(wh%,ih%,_U%+96,16,�)
>� modify above to set first two words to 0 to denote a new
� empty event block
blk%=_U%!96+offset%

� blk%!0=0 � blk%!4=0 �
!  � this is first event......
J  �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)
  temp%!4=-1
  temp%=temp%!0:$temp%=fn$
 �
!9  � adding new filetype/function to an existing event
"$  � extend filetype heapblock...
#H  �shell_Tracef0("AttachDataLoad:This is another DataLoad Event...")
$-  blk%!8=�shell_HeapBlockExtend(blk%!8,4)
%&  � and function name heapblock...
&/  blk%!12=�shell_HeapBlockExtend(blk%!12,4)
'4  � find out how many filetypes there are now...
(  ctr%=0:temp%=blk%!8
)  È• temp%!ctr%<>-1
*    ctr%+=4
+  �
,(  temp%!ctr%=type%:temp%!(ctr%+4)=-1
-  temp%=blk%!12
..  temp%!ctr%=�shell_HeapBlockFetch(�fn$+1)
/!  temp%=temp%!ctr%:$temp%=fn$
0�
1�
2:
3#*|Stop PROCshell_AttachDataLoad
4
5$*|Start PROCshell_AttachDataSave
6@� �shell_AttachDataSave(wh%,ih%,address%,type%,name_ic%,fn$)
7� blk%,temp%,offset%
8?� address%=0 � address%=100:� estimated size - wild guess..
9b�shell_Tracef0("AttachDataSave:Attaching DataSave Handler to icon "+�ih%+" in window &"+�~wh%)
:B�shell_Tracef0("AttachDataSave:Handler function is '"+fn$+"'")
;:offset%=�shell_GetEventListOffset(wh%,ih%,_U%+72,24,�)
<blk%=_U%!72+offset%
=7blk%!0=wh%:blk%!4=ih%:blk%!8=address%:blk%!12=type%
>blk%!16=name_ic%
?+blk%!20=�shell_HeapBlockFetch(�(fn$)+1)
@temp%=blk%!20:$temp%=fn$
AȎ type% �
B  � &FF9
C:    � kludge for sprite files as first word should not
D    � be saved
E    � address%>&8000 �
F2      _U%!136=�shell_HeapBlockInfo(address%)-8
G	    �
H      _U%!136=address%
I	    �
J  
K    � address%>&8000 �
L2      _U%!136=�shell_HeapBlockInfo(address%)-4
M	    �
N      _U%!136=address%
O	    �
P�
Q_U%!140=type%
RL� _U%!144 holds address of file heapblock buffer. If address%<&8000 then
SK� file is not in a buffer and address% is actually the estimated size..
T_U%!144=address%
U�
V:
W#*|Stop PROCshell_AttachDataSave
X
Y *|Start PROCshell_AttachMenu
Z8� �shell_AttachMenu(wh%,ic%,menu%,shift%,ctrl%,alt%)
[:� wh%>0 � ic%>=0 � �shell_IconSetButtonType(wh%,ic%,1)
\'�shell_EventAdd(wh%,ic%,0,menu%,"")
]�
^:
_*|Stop PROCshell_AttachMenu
`
a%*|Start PROCshell_AttachMenuMaker
b)� �shell_AttachMenuMaker(wh%,ic%,fn$)
cL�shell_Tracef0("AttachMenuMaker:Attaching menumaker function '"+fn$+"'")
d$�shell_EventAdd(wh%,ic%,1,0,fn$)
e�
f:
g$*|Stop PROCshell_AttachMenuMaker
h
i$*|Start PROCshell_AttachMenuDBox
jA� �shell_AttachMenuDBox(item%,window$,preopenfn$,postopenfn$)
k@� Check current submenu handle. We should release any memory
l@� allocated by previous calls (when I work out how to do it)
m� blk%,temp%,addr%
nV� � �shell_WindowLoaded(window$) � � 99,�shell_MessageOneArg("SHELLMSG03",window$)
o"blk%=�shell_HeapBlockFetch(12)
p,blk%!0=�shell_HeapBlockFetch(�window$+1)
qtemp%=blk%!0:$temp%=window$
r/blk%!4=�shell_HeapBlockFetch(�preopenfn$+1)
s"temp%=blk%!4:$temp%=preopenfn$
t0blk%!8=�shell_HeapBlockFetch(�postopenfn$+1)
u#temp%=blk%!8:$temp%=postopenfn$
v;� Store address of heapblock in submenu pointer word of
w/� menu item definition. Cunning huh........
x$È™ "MenuUtil_SubMenu",item%,blk%
yș "MenuUtil_Warning",,�
z�
{:
|#*|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%,old_handle%
�"blk%=�shell_HeapBlockFetch(40)
�,!blk%=wh%:ș "Wimp_GetWindowState",,blk%
�f%=blk%!32
� �shell_HeapBlockReturn(blk%)
�3�shell_Tracef0("AttachUserRedraw:flag%=&"+�~f%)
�� (f% � 1<<4) �
�:  �shell_Tracef0("AttachUserRedraw:auto redraw set!!")
�G  � store original handle in case the wimp allocates a new handle..
�  old_handle%=wh%
�(  �shell_WindowToggleFlags(wh%,1<<4)
�  � wh%<>old_handle% �
�2    �shell_UpdateWindowHandle(old_handle%,wh%)
�  �
��
�#�shell_EventAdd(wh%,-1,4,0,fn$)
��
�:
�%*|Stop PROCshell_AttachUserRedraw
�$*|Start PROCshell_AttachKeypress
�(� �shell_AttachKeypress(wh%,ic%,fn$)
�$�shell_EventAdd(wh%,ic%,5,0,fn$)
��
�:
�#*|Stop PROCshell_AttachKeypress
� *|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
��
�   � (event_list%!ptr%=wh%) �
�!    Ȏ event_list%!(ptr%+4) �
�    � -1
�      found%=�
�	    
�&      � 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
��
�   � (event_list%!ptr%=wh%) �
�    found%=�
�  �
�    ptr%+=48
�  �
�!� (ptr%>=list_size% � found%)
�� found% �
�  event_list%!(ptr%+0)=0
�  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%
�
:� remove all DataSave events for the current window...
0�shell_Tracef0("EventDeleteAll:wh%=&"+�~wh%)
	&�shell_DeleteEventDataSave(wh%,-1)

"�shell_DeleteEventBump(wh%,-1)
?� should reduce size of event list block if possible.......
�

:
#*|Stop PROCshell_EventDeleteAll
%*|Start PROCshell_DeleteEventBump
%� �shell_DeleteEventBump(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%!104
�
=  offset%=�shell_GetEventListOffset(wh%,ih%,_U%+104,16,�)
9  �shell_Tracef0("DeleteEventBump:offset%="+�offset%)
  � offset%>=0 �
    � ih%=-1 �
e  �shell_Tracef0("DeleteEventBump:Deleting Bump Event (all events for window handle &"+�~wh%+")")
	    �
w      �shell_Tracef0("DeleteEventBump:Deleting Bump Event (window handle was &"+�~wh%+" icon handle was "+�ih%+")")
	    �
 *    � event for window/icon is in list
!2    list_size%=�shell_HeapBlockInfo(_U%!104)-8
"!    � offset%=list_size%-16 �
#+      � it is the last one in this list
$      � offset%=0 �
%(        � only one event in the list
&$        info_blk%=event_list%!12
'        temp%=info_blk%!12
(,        �shell_HeapBlockReturn(temp%!12)
),        �shell_HeapBlockReturn(temp%!16)
*)        �shell_HeapBlockReturn(temp%)
++        �shell_HeapBlockReturn(_U%!104)
,        _U%!104=0
-O        �shell_Tracef0("DeleteEventDataSave:No Bump events now registered")
.      �
/-        � more than one event in the list
07        _U%!104=�shell_HeapBlockExtend(_U%!104,-16)
1      �
2	    �
3(      � not the last one in the list
4"      blk%=event_list%+offset%
5$      blk%!0=0:blk%!4=0:blk%!8=0
6      info_blk%=blk%!12
7.      �shell_HeapBlockReturn(info_blk%!12)
8.      �shell_HeapBlockReturn(info_blk%!16)
9+      �shell_HeapBlockReturn(info_blk%)
:	    �
;  �
<6  � repeat loop until offset%=-1 (event not found)
=1  � or offset%=-2 (event block doesn't exist)
>� offset%<0
?�
@:
A$*|Stop PROCshell_DeleteEventBump
B)*|Start PROCshell_DeleteEventDataSave
C)� �shell_DeleteEventDataSave(wh%,ih%)
DC� if I can find which words point to a heap block they could be
ED� automatically detected and released. A general purpose routine
F.� shell_DeleteEvent could then be written!
G7� If ih%=-1 remove all events for window handle wh%
H� offset%,blk%,list_size%
I=� PROCshell_Tracef0("DeleteEventDataSave:wh%=&"+STR$~wh%)
J;� PROCshell_Tracef0("DeleteEventDataSave:ih%="+STR$ih%)
K�
L<  offset%=�shell_GetEventListOffset(wh%,ih%,_U%+72,24,�)
ME  � PROCshell_Tracef0("DeleteEventDataSave:offset%="+STR$offset%)
N  � offset%>=0 �
O    � ih%=-1 �
Pm  �shell_Tracef0("DeleteEventDataSave:Deleting DataSave Event (all events for window handle &"+�~wh%+")")
Q	    �
R{  �shell_Tracef0("DeleteEventDataSave:Deleting DataSave Event (window handle was &"+�~wh%+" icon handle was "+�ih%+")")
S	    �
T*    � event for window/icon is in list
U1    list_size%=�shell_HeapBlockInfo(_U%!72)-8
V!    � offset%=list_size%-24 �
W+      � it is the last one in this list
X      � offset%=0 �
Y(        � only one event in the list
Z*        �shell_HeapBlockReturn(_U%!72)
[        _U%!72=0
\
]K�shell_Tracef0("DeleteEventDataSave:No DataSave events now registered")
^      �
_-        � more than one event in the list
`5        _U%!72=�shell_HeapBlockExtend(_U%!72,-24)
a      �
b	    �
c(      � not the last one in the list
d"      blk%=event_list%+offset%
e8      blk%!0=0:blk%!4=0:blk%!8=0:blk%!12=0:blk%!16=0
f3      �shell_HeapBlockReturn(blk%!20):blk%!20=0
g	    �
h  �
i6  � repeat loop until offset%=-1 (event not found)
j1  � or offset%=-2 (event block doesn't exist)
k� offset%<0
l�
m:
n(*|Stop PROCshell_DeleteEventDataSave
o!*|Start FNshell_MessageNoArgs
p � �shell_MessageNoArgs(tag$)
q%=�shell_MessageLookup(tag$,"","")
r:
s *|Stop FNshell_MessageNoArgs
t!*|Start FNshell_MessageOneArg
u&� �shell_MessageOneArg(tag$,arg1$)
v(=�shell_MessageLookup(tag$,arg1$,"")
w:
x *|Stop FNshell_MessageOneArg
y!*|Start FNshell_MessageLookup
z,� �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%!148=Taskid%
�=Taskid%
�:
�*|Stop FNshell_WimpInit
�
�*|Start FNshell_WimpInit_I
�+� �shell_WimpInit_I(Version%,TaskName$)
�Hș "Wimp_Initialise",Version%,&4B534154,TaskName$ � Version%,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 � ș "FontMenu_Release"
�*|endif
�)ș "Wimp_CloseDown",Taskid%,&4B534154
�$ș "Interface_CloseDown",Taskid%
�5� _U%!100 � 1<<2 � ș "Impulse_CloseDown",_U%!148
��
�:
�$*|Stop PROCshell_WimpCloseDown_I
�*|Start PROCWimpCloseDown
�� �WimpCloseDown(Taskid%)
��shell_LoseFonts
�*|ifdef Using_FontMenu
�)� _U%!240<>-1 � ș "FontMenu_Release"
�*|endif
�)ș "Wimp_CloseDown",Taskid%,&4B534154
�5� _U%!100 � 1<<2 � ș "Impulse_CloseDown",_U%!148
�  
��
�:
�*|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
�C� fontcounts%?f%>=255 � � 99,�shell_MessageNoArgs("SHELLMSG18")
�=f%
�:
�*|Stop FNshell_FindFont
�
�*|Start PROCshell_Init
�� �shell_Init
�� elist%,loop%,temp%
�� _U% 320,_shell_blk% 100
�#_Q%=�shell_HeapBlockFetch(3000)
�$elist%=�shell_HeapBlockFetch(48)
�elist%!0 =0
�elist%!12=0
�elist%!16=0
�elist%!20=0
�elist%!24=0
�elist%!28=0
�elist%!32=0
�elist%!36=0
�elist%!40=0
�elist%!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
�B_U%!28=0         :� last window clicked over (select & adjust)
�B_U%!32=0         :� last icon clicked over   (select & adjust)
�,_U%!36=0         :� last menu x position
�,_U%!40=0         :� last menu y position
�+_U%!44=-1        :� handle of tracefile
�8_U%!48=0         :� FALSE=not tracing,TRUE = tracing
�>_U%!52=0         :� last window clicked over (menu button)
�>_U%!56=0         :� last icon   clicked over (menu button)
�>_U%!60=0         :� pointer to 'HotKey' handler event list
�0_U%!64=0         :� pointer to message block
�0_U%!68=0         :� pointer to message block
�7_U%!72=0         :� pointer to datasave event block
�5_U%!76=�shell_HeapBlockFetch(256):� message block
�6_U%!80=0         :� pointer to last full file name
�8_U%!84=-1        :� store my_ref from save operation
�"_U%!88=0         :� ??????????
�;_U%!92=0         :� pointer to pane handler event block
�7_U%!96=0         :� pointer to dataload event block
�+_U%!100=0        :� EvntShell bit flags
�B                 :� bit 0  - DragASprite operation in progress
�=                 :� bit 1  - Top bit dataload in progress
�;                 :� bit 2  - Impulse module initialised
�5                 :� bit 3  - ResFind in operation
�;_U%!104=0        :� pointer to bump handler event block
� _U%!108=-1       :� ScrpRef%
� _U%!112=-1       :� FtchRef%
� _U%!116=-1       :� LoadRef%
 _U%!120=-1       :� SaveRef%
 _U%!124=-1       :� DragRef%
_U%!128=0        :� RAMPtr%
 _U%!132=0        :� RAMSize%
<_U%!136=-1       :� FileSize% from last datasave message
<_U%!140=-1       :� FileType% from last datasave message
<_U%!144=-1       :� FileBuff% from last datasave message
_U%!148=0        :� taskid%
B_U%!152=0        :� Buffer list of loaded files, -1 terminator
	E_U%!156=0        :� HeapBlock with copy of DataSave message block

3                 :� for when RAM transfer fails
<_U%!160=0        :� Pointer to ModeChange event function
?_U%!164=0        :� Pointer to PaletteChange event function

@_U%!168=0        :� Pointer to TaskInitialise event function
?_U%!172=0        :� Pointer to TaskCloseDown event function
5_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
0:_U%!300=0        :� pointer to PreQuit Handler routine
19_U%!304=0        :� pointer to OpenWindow event block
2:_U%!308=0        :� pointer to CloseWindow event block
3;_U%!312=0        :� pointer to Shutdown Handler routine
4D_U%!316=0        :� OS version nr as returned by Wimp_Initialise
5!�shell_MemFill(_U%!232,256,0)
6!�shell_MemFill(_U%!236,256,0)
7_error_flag%=3
8�
9:
:*|Stop PROCshell_Init
;
<*|Start FNshell_FileType
=� �shell_FileType(object$)
>� type%
?$ș "OS_File",5,object$ � ,,type%
@type%=(type% � &FFF00)>>>8
A
=type%
B:
C*|Stop FNshell_FileType
D
E*|Start FNshell_FileExists
F � �shell_FileExists(object$)
G0� �shell_CatInfoRead(object$)="Not Found":=�
H=�
I:
J*|Stop FNshell_FileExists
K
L*|Start FNshell_CatInfoRead
M!� �shell_CatInfoRead(object$)
N7� type%,load_addr%,exec_addr%,length%,atts%,string$
OGș "OS_File",5,object$ � type%,,load_addr%,exec_addr%,length%,atts%
P� type%=0 � = "Not Found"
Q � atts%=51  � string$+="WR "
R � atts%=187 � string$+="LWR"
S � atts%=136 � string$+="DL "
T<string$+=" "+�shell_StringPadLeading(�~load_addr%,"0",8)
U<string$+=" "+�shell_StringPadLeading(�~exec_addr%,"0",8)
V9string$+=" "+�shell_StringPadLeading(�~length%,"0",8)
W=string$
X:
Y*|Stop FNshell_CatInfoRead
Z*|Start FNshell_GetAppDir
[� �shell_GetAppDir
\� temp%
]temp%=_U%!188
^=$temp%
_:
`*|Stop FNshell_GetAppDir
a!*|Start FNshell_GetAppDataDir
b� �shell_GetAppDataDir
c� temp%
dtemp%=_U%!192
e=$temp%
f:
g *|Stop FNshell_GetAppDataDir
h*|Start FNshell_GetAppName
i� �shell_GetAppName
j� temp%
ktemp%=_U%!196
l=$temp%
m:
n*|Stop FNshell_GetAppName
o
p#*|Start PROCshell_ResourcesInit
q� �shell_ResourcesInit
r:� shell_AppDir$,shell_AppName$,shell_AppDataDir$,temp%
s� OSVarBuff%
t)OSVarBuff%=�shell_HeapBlockFetch(256)
uAshell_AppDir$=�shell_OSVarGetVal(OSVarBuff%,256,"Obey$Dir",1)
v1shell_AppName$=��shell_Leaf(shell_AppDir$),2)
w5_U%!188=�shell_HeapBlockFetch((�shell_AppDir$)+1)
x6_U%!196=�shell_HeapBlockFetch((�shell_AppName$)+1)
y&temp%=_U%!188:$temp%=shell_AppDir$
z'temp%=_U%!196:$temp%=shell_AppName$
{@� �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)
�  �
�D    �shell_MessagesInit("ShellSysRes:ShellMsgs",_U%!280,_U%!284)
�  �
�9  � �shell_FileExists(shell_AppName$+"Res:Sprites") �
�B    _U%!16=�shell_SpriteAreaLoad(shell_AppName$+"Res:Sprites")
�  �
�<    _U%!16=1:� use wimp sprite pool if no 'Sprites' file
�  �
�'  � check if templates need loading
�;  � �shell_FileExists(shell_AppName$+"Res:Templates") �
�<    �shell_TemplatesInit(shell_AppName$+"Res:Templates")
�  �
��
�!  � ResFind NOT initialised..
�6  � �shell_FileExists(shell_AppDir$+".Messages") �
�D    �shell_MessagesInit(shell_AppDir$+".Messages",_U%!68,_U%!64)
�  �
�7  � �shell_FileExists(shell_AppDir$+".ShellMsgs") �
�G    �shell_MessagesInit(shell_AppDir$+".ShellMsgs",_U%!280,_U%!284)
�  �
�D    �shell_MessagesInit("ShellSysRes:ShellMsgs",_U%!280,_U%!284)
�  �
�*  � check if user sprites need loading
�5  � �shell_FileExists(shell_AppDir$+".Sprites") �
�>    _U%!16=�shell_SpriteAreaLoad(shell_AppDir$+".Sprites")
�  �
�<    _U%!16=1:� use wimp sprite pool if no 'Sprites' file
�  �
�'  � check if templates need loading
�7  � �shell_FileExists(shell_AppDir$+".Templates") �
�8    �shell_TemplatesInit(shell_AppDir$+".Templates")
�  �
��
�ș "MenuUtil_Initialise"
��shell_HeapBlockReturn(_Q%)
�>_Q%=�shell_HeapBlockFetch(1024):� reduce global wimp block
�&�shell_HeapBlockReturn(OSVarBuff%)
��
�:
�"*|Stop PROCshell_ResourcesInit
�
�"*|Start FNshell_SpriteAreaLoad
�&� �shell_SpriteAreaLoad(filename$)
�� sp%,S%,T%
�%S%=� (filename$):T%=�#S%+16:� #S%
�!sp%=�shell_HeapBlockFetch(T%)
�!sp%=T%:sp%!4=0
�sp%!8=16:sp%!12=16
�ș "OS_SpriteOp",&209,sp%
�'ș "OS_SpriteOp",&20A,sp%,filename$
�*|ifdef TraceInit
�>�shell_Tracef0("SpriteLoad:Sprite file loaded at &"+�~sp%)
�*|endif
�=sp%
�:
�!*|Stop FNshell_SpriteAreaLoad
�
�#*|Start FNshell_UserSpritesBase
�� �shell_UserSpritesBase
�=_U%!16
�:
�"*|Stop FNshell_UserSpritesBase
�
� *|Start FNshell_SpriteGetPtr
�,� �shell_SpriteGetPtr(spritearea%,name$)
�� buffer%,ptr%
�%buffer%=�shell_HeapBlockFetch(21)
�$buffer%=name$
�6ș "OS_SpriteOp",&118,spritearea%,buffer% � ,,ptr%
�#�shell_HeapBlockReturn(buffer%)
�	=ptr%
�:
�*|Stop FNshell_SpriteGetPtr
�
�#*|Start PROCshell_TemplatesInit
�%� �shell_TemplatesInit(filename$)
�,� TemplatePtr%,IndirectPtr%,IndirectEnd%
�5� filelen% ,pos%,name_buffer%,name$,nr_templates%
�� name_buffer% 20
�ȕ (name_buffer% � 4)
�  name_buffer%+=1
��
�pos%=0:nr_templates%=0
�)filelen%=�shell_FileLength(filename$)
�*� reserve space for window definitions
�0TemplateBlk%=�shell_HeapBlockFetch(filelen%)
�TemplatePtr%=TemplateBlk%
�b� reserve a block to hold window identifiers (12 bytes) plus address of window block (4 bytes)
�&_U%!4=�shell_HeapBlockFetch(20*64)
�j� reserve space for indirected icon data. Note that too much is reserved as filelen% is the total size
�<� of the template file i.e. templates + indirected data!
�0IndirectBlk%=�shell_HeapBlockFetch(filelen%)
�IndirectPtr%=IndirectBlk%
�&IndirectEnd%=IndirectBlk%+filelen%
�%ș "Wimp_OpenTemplate",,filename$
��
�  $name_buffer%="*"
�|  ș "Wimp_LoadTemplate",,TemplatePtr%,IndirectPtr%,IndirectEnd%,_U%!232,name_buffer%,pos% � ,,IndirectPtr%,,,name$,pos%
�  � pos%<>0 �
�2    !((_U%!4)+(16*nr_templates%))=TemplatePtr%
�/    $(((_U%!4)+(16*nr_templates%))+4)=name$
�    *|ifdef Trace_Init
�A    �shell_Tracef0("TemplatesInit:  Template Loaded: "+name$)
�    *|endif
�/    TemplatePtr%+=(88+(TemplatePtr%!84)*32)
�    nr_templates%+=1
�  �
�� pos%=0
�ș "Wimp_CloseTemplate"
�_U%!0=nr_templates%
�*|ifdef Trace_Init
�x�shell_Tracef0("TemplatesInit:Templates resource file loaded at &"+�~TemplateBlk%+" ("+�nr_templates%+" templates)")
�*|endif
��
:
"*|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"
0'    � "d":s$+="Drag with ADJUST to"
15    � "G":s$+="This option is greyed out because"
2*    � "R":s$+="Move the pointer right"
3#    � "S":s$+="Click SELECT to"
4    � "s":s$+="SELECT"
5    � "T":s$+="This is the"
6"    � "W":s$+="This window is"
7    � "w":s$+="window"
8  
9    s$+="\"+m$
:  �
;�
<
=s$+h$
=:
>@� ----------------------------------------------------------
?:
@ *|Stop FNshell_MessageExpand
A
B
C
D
E*|Start PROCshell_OpenMenu
F� �shell_OpenMenu(x%,y%,m%)
G	� fn$
H/fn$=�shell_GetEventHandler(_U%!28,_U%!32,1)
I� fn$<>"" �
J  *|ifdef Trace_Init
KT  �shell_Tracef0("OpenMenu:About to call "+"FN"+fn$+"("+�_U%!28+","+�_U%!32+")")
L
  *|endif
M:  void%=�("FN"+fn$+"(_U%!28,_U%!32)"):� call menumaker
N�
OA  �shell_Tracef0("OpenMenu:no menumaker function registered")
P�
Q� m%<>_U%!24 �
RI  � If menu is not being re-opened by an adjust click, discard stored
S;  � 'SelectionSoFar' string used by FontMenu routines..
T)  � �shell_HeapBlockExists(_U%!256) �
U1    �shell_HeapBlockReturn(_U%!256):_U%!256=0
V  �
WB  � And the name of the currently selected font in this menu..
X*  � �shell_HeapBlockExists(_U%!244 ) �
Y1    �shell_HeapBlockReturn(_U%!244):_U%!244=0
Z  �
[�
\� m%=_U%!252 �
]$  È™ "Wimp_CreateMenu",,m%,x%,y%
^  _U%!264=1
_�
`  È™ "MenuUtil_Show",m%,_Q%
a  _U%!264=0
b�
c4_U%!24=m%:� store address of currently open menu
d%_U%!36=x%:� store menu x position
e%_U%!40=y%:� store menu y position
f _U%!52=_U%!28:� store window
g_U%!56=_U%!32:� store icon
h�
i:
j*|Stop PROCshell_OpenMenu
k
l *|Start FNshell_MenuLastXPos
m� �shell_MenuLastXPos
n=_U%!36
o:
p*|Stop FNshell_MenuLastXPos
q
r *|Start FNshell_MenuLastYPos
s� �shell_MenuLastYPos
t=_U%!40
u:
v*|Stop FNshell_MenuLastYPos
w
x$*|Start PROCshell_MenuAttachDbox
y"� �shell_MenuAttachDbox(menu$)
zM� attach a dummy window handle for now, just so that the sub window arrow
{� appears on the menu!
|;ș "Menu_SetSubHandle",_U%!8,�shell_MenuString(menu$),1
}D�shell_Tracef0("MenuAttachDbox:Dialog box ("+menu$+") attached")
~�
:
�#*|Stop PROCshell_MenuAttachDbox
�
�!*|Start FNshell_MessageWindow
�9� �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%
��
�5 ș "Wimp_ReportError",err_blk%,17,head$ � ,keys%
��
�$�shell_HeapBlockReturn(err_blk%)
�
=keys%
�:
� *|Stop FNshell_MessageWindow
�
�"*|Start PROCshell_CreateWindow
�+� �shell_CreateWindow(ident$,� handle%)
�
� wb_ptr%
� wb_ptr%=�shell_GetWB(ident$)
�3� set 'sprite area' pointer to usersprites area
�wb_ptr%!64=_U%!16
�-ș "Wimp_CreateWindow",,wb_ptr% � handle%
��
�:
�!*|Stop PROCshell_CreateWindow
�!*|Start FNshell_CreateWindow2
�N� �shell_CreateWindow2(title,flags%,fgcol%,bgcol%,maxx%,miny%,l%,b%,r%,t%)
�� Q%
�"Q%=�shell_HeapBlockFetch(3000)
�,Q%!0=l%:Q%!4=b%:Q%!8=r%:Q%!12=t%:Q%!16=0
�)Q%!20=0:Q%!24=-1:Q%!28=flags%:Q%?32=7
�%Q%?33=2:Q%?34=fgcol%:Q%?35=bgcol%
�Q%?36=3:Q%?37=1
�'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%
�:
� *|Stop FNshell_CreateWindow2
�%*|Start FNshell_WindowHasTitleBar
�#� �shell_WindowHasTitleBar(wh%)
�)=(�shell_WindowGetFlags(wh%) � 1<<26)
�:
�$*|Stop FNshell_WindowHasTitleBar
�$*|Start FNshell_WindowIsMoveable
�"� �shell_WindowIsMoveable(wh%)
�(=(�shell_WindowGetFlags(wh%) � 1<<1)
�:
�#*|Stop FNshell_WindowIsMoveable
�!*|Start FNshell_WindowIsAPane
�� �shell_WindowIsAPane(wh%)
�(=(�shell_WindowGetFlags(wh%) � 1<<5)
�:
� *|Stop FNshell_WindowIsAPane
�&*|Start FNshell_WindowIsNotBounded
�$� �shell_WindowIsNotBounded(wh%)
�(=(�shell_WindowGetFlags(wh%) � 1<<6)
�:
�%*|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_WindowTitleFlags
"� �shell_WindowTitleFlags(wh%)
� flags%,blk%
$blk%=�shell_HeapBlockFetch(3000)
blk%!0=wh%
!È™ "Wimp_GetWindowInfo",,blk%
flags%=blk%!60
	 �shell_HeapBlockReturn(blk%)

=flags%
:
� Hilke

#*|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)
/:
0(*|Stop FNshell_WindowTitleIsAAliased
1+*|Start FNshell_WindowTitleIsIndirected
2)� �shell_WindowTitleIsIndirected(wh%)
3*=(�shell_WindowTitleFlags(wh%) � 1<<8)
4:
5**|Stop FNshell_WindowTitleIsIndirected
6"*|Start FNshell_WindowGetTitle
7 � �shell_WindowGetTitle(wh%)
8� title$,blk%
9'� Check if window has a title bar..
:$blk%=�shell_HeapBlockFetch(3000)
;blk%!0=wh%
<!È™ "Wimp_GetWindowInfo",,blk%
=� (blk%!32 � 1<<26) �
>  � ((blk%!60) � &100)=0 �
?#    � Title is not indirected..
@    title$=$(blk%+76)
A  �
B    � Title is indirected..
C    title$=$(!(blk%+76))
D  �
E�
F �shell_HeapBlockReturn(blk%)
G=title$
H:
I!*|Stop FNshell_WindowGetTitle
J+*|Start FNshell_WindowTitleBufferLength
K)� �shell_WindowTitleBufferLength(wh%)
L� result%,blk%
M$blk%=�shell_HeapBlockFetch(3000)
Nblk%!0=wh%
O!È™ "Wimp_GetWindowInfo",,blk%
P  � ((blk%!60) � &100)=0 �
Q    result%=12
R  �
S    result%=blk%!84
T  �
U �shell_HeapBlockReturn(blk%)
V=result%
W:
X**|Stop FNshell_WindowTitleBufferLength
Y&*|Start PROCshell_WindowMoveToIcon
Z9� �shell_WindowMoveToIcon(wh%,iwh%,ih%,x_off%,y_off%)
[
� blk%
\"blk%=�shell_HeapBlockFetch(50)
]blk%!0=iwh%:blk%!4=ih%
^ È™ "Wimp_GetIconState",,blk%
_9�shell_WindowMoveTo(wh%,blk%!8+x_off%,blk%!20+y_off%)
` �shell_HeapBlockReturn(blk%)
a�
b:
c%*|Stop PROCshell_WindowMoveToIcon
d"*|Start PROCshell_WindowMoveTo
e$� �shell_WindowMoveTo(wh%,x%,y%)
f)� win_width%,win_height%,offset%,blk%
g$blk%=�shell_HeapBlockFetch(3000)
hblk%!0=wh%
i!È™ "Wimp_GetWindowInfo",,blk%
jwin_width% =blk%!12-blk%!4
kwin_height%=blk%!16-blk%!8
l
blk%!4=x%
m
blk%!8=y%
nblk%!12=x%+win_width%
oblk%!16=y%+win_height%
p;� this looks really silly, but is necessary to tell the
q@� window manager the new window coords. The shell_OpenWindow
r=� call sets up any panes and actually opens the window in
s� the new position
tÈ™ "Wimp_OpenWindow",,blk%
uÈ™ "Wimp_CloseWindow",,blk%
v,offset%=�shell_SearchStatic(_U%!184,wh%)
w� offset%>-1 �
x"  �shell_OpenWindowStatic(wh%)
y�
z'  �shell_OpenWindowDynamic(wh%,0,0)
{�
| �shell_HeapBlockReturn(blk%)
}�
~:
!*|Stop PROCshell_WindowMoveTo
�&*|Start PROCshell_WindowBringToTop
�"� �shell_WindowBringToTop(wh%)
�
� msg%
�#msg%=�shell_HeapBlockFetch(256)
�msg%!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_OpenWindowDynamic
�1� �shell_OpenWindowDynamic(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_OpenWindowDynamic
�!*|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%
�1� flag%,toggle%,t%,last_pane%,prev_pane%,res%
�:offset%=�shell_GetEventListOffset(wh%,-1,_U%+304,12,�)
�� offset%>=0 �
�  blk%=_U%!304+offset%
�  temp%=blk%!8
�  *|ifdef Trace_Init
�=  �shell_Tracef0("OpenWindow:About to call "+"FN"+$temp%)
�
  *|endif
�  res%=�("FN"+$temp%)
�  � res%=0 � �
��
�
toggle%=�
�,  t%=�shell_HeapBlockFetch(100):t%!0=wh%
�"  ș "Wimp_GetWindowState",,t%
�7  � (t%!32 � &80000)=&80000 � toggle%=� � toggle%=�
�   �shell_HeapBlockReturn(t%)
�  _Q%!0=wh%
�/  � � full% � ș "Wimp_GetWindowState",,_Q%
�  � toggle% �
�!    ș "Wimp_OpenWindow",,_Q%
�  �
�9offset%=�shell_GetEventListOffset(wh%,-1,_U%+92,24,�)
�� offset%>-1 �
�  blk%=(_U%!92)+offset%
�   � pane handler event found
�?  ptr8%=blk%!8:ptr12%=blk%!12:ptr16%=blk%!16:ptr20%=blk%!20
�  _Q%!0=wh%
�,  � front% � behind%=-1 � behind%=_Q%!28
�  � � full% �
�%    ș "Wimp_GetWindowState",,_Q%
�  �
�4  � reserve 1k as buffer - hope it's enough.....
�*  paneblk%=�shell_HeapBlockFetch(1024)
�  ctr%=0
�  ȕ ptr8%!ctr%<>-1
�0    paneblk%!0=ptr8%!ctr%:� handle of 'pane'
�0    � first_pane%=0 � first_pane%=paneblk%!0
�    last_pane%=paneblk%!0
�*    ș "Wimp_GetWindowState",,paneblk%
�0    � 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%
�1      paneblk%!16=_Q%!16             :� min y
�1      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
�/      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
.      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%
�
�
:
*|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 Trace_Init
(>  �shell_Tracef0("CloseWindow:About to call "+"FN"+$temp%)
)
  *|endif
*  res%=�("FN"+$temp%)
+  � res%=0 � �
,�
-&win_blk%=�shell_HeapBlockFetch(60)
.
� wh%>0 �
/;  offset%=�shell_GetEventListOffset(wh%,-1,_U%+92,24,�)
0  � offset%>-1 �
1    blk%=(_U%!92)+offset%
24    ptr12%=blk%!12:ptr16%=blk%!16:ptr20%=blk%!20
3    ctr%=0:ptr8%=blk%!8
4    È• ptr8%!ctr%<>-1
5      � close pane windows
6      win_blk%!0=ptr8%!ctr%
7)      È™ "Wimp_CloseWindow",,win_blk%
8      ctr%+=4
9	    �
:*    � PROCshell_HeapBlockReturn(ptr8%)
;+    � PROCshell_HeapBlockReturn(ptr12%)
<+    � PROCshell_HeapBlockReturn(ptr16%)
=+    � PROCshell_HeapBlockReturn(ptr20%)
>  �
?  � close parent window
@4  win_blk%!0=wh%:È™ "Wimp_CloseWindow",,win_blk%
A�
B$�shell_HeapBlockReturn(win_blk%)
C�
D:
E *|Stop PROCshell_CloseWindow
F
G *|Start FNshell_DeleteWindow
H"� �shell_DeleteWindow(handle%)
I� win_blk%
J&win_blk%=�shell_HeapBlockFetch(20)
K� handle%<>0 �
L  � �oktodeletew(handle%) �
M&    �shell_EventDeleteAll(handle%)
N#    � handle%=_U%!20 � _U%!20=0
O4    offset%=�shell_SearchStatic(_U%!184,handle%)
P    � offset%>-1 �
Q      temp%=_U%!184+offset%
R7      temp%!0=0:� wipe window handle in static list
S	    �
T.    � and now actually delete the window..
U    win_blk%!0=handle%
V(    È™ "Wimp_DeleteWindow",,win_blk%
W    handle%=0
X  �
Y�
Z$�shell_HeapBlockReturn(win_blk%)
[=handle%
\:
]*|Stop FNshell_DeleteWindow
^*|Start FNoktodeletew
_� �oktodeletew(handle%)
`=-1
a:
b*|Stop FNoktodeletew
c*|Start FNoktoclosew
d� �oktoclosew(handle%)
e=-1
f:
g*|Stop FNoktoclosew
h*|Start PROCcliprect
i*� �cliprect(b,� x1%,� y1%,� x2%,� y2%)
j
� x0%,y0%
k@�lwaorigin(b,x0%,y0%):x1%=b!24-x0%:y1%=b!28-y0%:x2%=b!32-x0%
ly2%=b!36-y0%
m�
n:
o*|Stop PROCcliprect
p*|Start FNpoll
q� �poll(mask%,task%)
r!ș "Wimp_Poll",mask%,_Q% � a%
s=a%
t:
u*|Stop FNpoll
v*|Start FNshell_Poll_I
w � �shell_Poll_I(mask%,task%)
x!ș "Wimp_Poll",mask%,_Q% � a%
y!È™ "Interface_Poll",a%,,task%
z=a%
{:
|*|Stop FNshell_Poll_I
}� �shell_DoBackgroundTask
~�
:
�#*|Start FNshell_IconIsDraggable
�%� �shell_IconIsDraggable(wh%,ih%)
�� flags%,temp%,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
�temp%=(flags% � &6000)
� �shell_HeapBlockReturn(blk%)
�� temp%=&6000 =� � =�
�=0
�:
�"*|Stop FNshell_IconIsDraggable
�!*|Start PROCshell_IconDragBox
�!� �shell_IconDragBox(wh%,ih%)
�I� blk%,wex,wey,e_offset%,flags%,f%,DragASprite%,spr_area%,valid%,spr$
�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 �
�0  � it has, so go ahead and allow the drag..
�&  blk%=�shell_HeapBlockFetch(6000)
�  !blk%=wh%
�#  ș "Wimp_GetWindowInfo",,blk%
�,  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%!8=blk%!8+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) �
�0      spr$=�shell_IconGetCommand(valid%,"s")
�	    �
�>    � (f% � 2)=0 � � 99,�shell_MessageNoArgs("SHELLMSG19")
�    � spr$<>"" �
�@      ș "DragASprite_Start",%10000101,spr_area%,spr$,blk%+8
�8      _U%!100=_U%!100 � 1:� set 'dragasprite' flag..
�	    �
�!      ș "Wimp_DragBox",,blk%
�	    �
�  �
�    ș "Wimp_DragBox",,blk%
�  �
�"  �shell_HeapBlockReturn(blk%)
��
�V  �shell_Tracef0("IconDragBox:WARNING! no drag handler registered for this icon!")
��
��
�:
� *|Stop PROCshell_IconDragBox
�
�(*|Start PROCshell_HandleAttachedMenu
�,� �shell_HandleAttachedMenu(_Q%,wh%,ih%)
�� menu%
�� �
�� � �:� �:�
�� ih%<>-1 � wh%>-1 �
�.  menu%=�shell_GetEventMenu(_Q%!8,wh%,ih%)
�  � menu%<>0 �
�-    �shell_OpenMenu(_Q%!0-64,_Q%!4,menu%)
�  �
��
��
�:
�'*|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% �
�(  *|ifdef PROCshell_DoBackgroundTask
�!  � 0:�shell_DoBackgroundTask
�
  *|endif
�$  � 1:�shell_RedrawWindow(_Q%!0)
�&  � 2:�shell_OpenWindow(_Q%!0,�,0)
�#  � 3:�shell_CloseWindow(_Q%!0)
�,  *|ifdef PROCshell_PointerLeavingWindow
�%  � 4:�shell_PointerLeavingWindow
�
  *|endif
�-  *|ifdef PROCshell_PointerEnteringWindow
�&  � 5:�shell_PointerEnteringWindow
�
  *|endif
�9  � 6:_U%!28=_Q%!12:_U%!32=_Q%!16:mx%=_Q%!0:my%=_Q%!4
�(         _U%!272=_Q%!0:_U%!276=_Q%!4
�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..
�<           �shell_HandleBumpIcons(_U%!296,_Q%!12,_Q%!16)
�         �
�/           _U%!288=-1:_U%!292=-1:_U%!296=-1
�           � _Q%!16>=0 �
�N             offset%=�shell_GetEventListOffset(_Q%!12,_Q%!16,_U%+104,16,0)
�M             � offset%>=0 � �shell_HandleBumpIcons(offset%,_Q%!12,_Q%!16)
�           �
�         �
�)         � 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
         �
F         _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
	8         fn$=�shell_GetEventHandler(_U%!28,_U%!32,6)

         � fn$<>"" �
N           �shell_Tracef0("Action:Drag event detected - function is "+fn$)
6           void%=�("FN"+fn$+"(_temp28%,_temp32%)")

         �
Q           �shell_Tracef0("Action:Drag event detected - no handler function")
(           � set up datasave message
1           �shell_SendDataSave(_U%!28,_U%!32)
         �

  � 8:
:         �shell_Tracef0("Action:keypress is="+�_Q%!24)
         Ȏ _Q%!24 �
         � &0D,398,399
G           claimed%=�shell_WriteableIconHandler(_Q%!0,_Q%!4,_Q%!24)
         
4           claimed%=�shell_HotKeyProcess(_Q%!24)
         �
         � � claimed% �
K           �shell_Tracef0("Action:Keypress not claimed, passing it on")
*           È™ "Wimp_ProcessKey",_Q%!24
         �
L           �shell_Tracef0("Action:Keypress claimed by this application")
         �
 &  � 9:�shell_ActionMenuSelect(_Q%)
!!  � 17,18:�shell_Receive(_Q%)
"0  � 19   :�shell_UserMessageAcknowledge(_Q%)
#�
$�
%:
&*|Stop PROCshell_Action
'
((*|Start PROCshell_ActionSelectButton
)� �shell_ActionSelectButton
*@�shell_Tracef0("ActionSelectButton:Mouse Button was SELECT")
+0�shell_HandleAttachedMenu(_Q%,_U%!28,_U%!32)
,/fn$=�shell_GetEventHandler(_U%!28,_U%!32,2)
-5� check filename in icon if datasave event exists
.� _U%!32=0 �
/  � icon was 0.....
0-  �shell_DataSaveCheckName(_U%!28,_U%!32)
1�
2� fn$<>"" �
3&  �shell_IconSlab(4,_U%!28,_U%!32)
4  *|ifdef Trace_Init
5b  �shell_Tracef0("ActionSelectButton:About to call "+"FN"+fn$+"("+�_temp28%+","+�_temp32%+")")
6
  *|endif
7-  void%=�("FN"+fn$+"(_temp28%,_temp32%)")
8�
9<� if icon was 0 and dbox is dynamic then close dbox/menu
:� _U%!32=0 �
;  � _U%!28=_U%!20 �
<     È™ "Wimp_CreateMenu",,-1
=  �
>�
?�
@'*|Stop PROCshell_ActionSelectButton
A
B&*|Start PROCshell_ActionMenuButton
C� �shell_ActionMenuButton
D� temp%,menu%
E*|ifdef PROCshell_TraceInit
F<�shell_Tracef0("ActionMenuButton:Mouse Button was MENU")
G*|endif
Htemp%=�
I2� �(-1) � temp%=�shiftmenuclick(_Q%!12,_Q%!16)
J
� temp% �
K?  �shell_Tracef0("ActionMenuButton:Checking menu events..")
L4  menu%=�shell_GetEventMenu(_Q%!8,_Q%!12,_Q%!16)
M?  �shell_Tracef0("ActionMenuButton:Menu handle is:"+�menu%)
N  � menu%<>0 �
O*    �shell_OpenMenu(_Q%!0,_Q%!4,menu%)
P    _U%!24=menu%
Q-    _U%!36=_Q%!00:� store menu x position
R-    _U%!40=_Q%!04:� store menu y position
S$    _U%!52=_U%!28:� store window
T"    _U%!56=_U%!32:� store icon
U  �
V�
W�
X:
Y%*|Stop PROCshell_ActionMenuButton
Z
[&*|Start PROCshell_ActionMenuSelect
\"� �shell_ActionMenuSelect(_Q%)
]C� handler%,menu_buffer%,CheckSelect%,fontmenuflag%,void%,h_blk%
^%h_blk%=�shell_HeapBlockFetch(256)
_*|ifdef PROCshell_TraceInit
`A�shell_Tracef0("ActionMenuSelect:Menu_Select event detected")
a*|endif
b)È™ "Wimp_GetPointerInfo",,_shell_blk%
c*|ifdef Using_FontMenu
d+menu_buffer%=�shell_HeapBlockFetch(256)
e� _U%!24=_U%!252 �
f"  � Current menu is FontMenu..
g  CheckSelect%=0:_U%!264=1
h�
i-  CheckSelect%=�shell_CheckSelection(_Q%)
j/  � CheckSelect%>-1 � _U%!264=1 � _U%!264=0
k�
l� _U%!264>0 �
mP  ș "FontMenu_DecodeFontMenu",_Q%+CheckSelect%,menu_buffer% � fontmenuflag%
n  � fontmenuflag%=1 �
o%    � 'sensible' selection made..
p#    *|ifdef PROCshell_TraceInit
qb    �shell_Tracef0("ActionMenuSelect:FontMenu selection ("+�shell_GetString(menu_buffer%)+")")
r    *|endif
sI    �shell_FontMenuSelectFont(�shell_GetString(menu_buffer%),_U%!260)
t$    � _shell_FontMenuSelFN$="" �
u7      È™ "Wimp_DecodeMenu",,_U%!24,_Q%,menu_buffer%
v5      fn$=�shell_GetEventHandler(_U%!52,_U%!56,0)
w      _temp%=menu_buffer%
x9      $_temp%=�shell_StringStripTrailing($_temp%," ")
y3      � fn$<>"" � void%=�("FN"+fn$+"($_temp%)")
z	    �
{'      � _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_Tracef0("HILKE::Adjust button")
�)  � �shell_HeapBlockExists(_U%!224) �
�6    �shell_Tracef0("HILKE::Stored warn_fn exists")
�    _temp%=_U%!224
�    � $_temp%<>"" �
�$      � Call last menuwarning fn
�E      �shell_Tracef0("HILKE::Calling last warn_fn ("+$_temp%+")")
�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
�4�shell_Tracef0("Action:Mouse Button was ADJUST")
�0�shell_HandleAttachedMenu(_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%)")
��
��
�'*|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
�!� �shell_PointerLeavingWindow
��
�:
�"� �shell_PointerEnteringWindow
��
�:
�"*|Start PROCshell_RedrawWindow
�"� �shell_RedrawWindow(handle%)
�� more%,fn$,x0%,y0%,blk%
�#blk%=�shell_HeapBlockFetch(100)
�,fn$=�shell_GetEventHandler(handle%,-1,4)
�blk%!0=handle%
�(ș "Wimp_RedrawWindow",,blk% � more%
�*x0%=blk%!4-blk%!20:y0%=blk%!16-blk%!24
�ȕ more%
�)  ș "Interface_Render3dWindow",,blk%
�C  � fn$<>"" � void%=�("FN"+fn$+"("+�blk%+","+�x0%+","+�y0%+")")
�*  ș "Wimp_GetRectangle",,blk% � more%
��
� �shell_HeapBlockReturn(blk%)
��
�:
�!*|Stop PROCshell_RedrawWindow
�
�*|Start PROCshell_Receive
�� �shell_Receive(_Q%)
�� temp%,void%
�Ȏ _Q%!16 �
�� 0     :�shell_Exit:�
�!� 1     :�shell_DataSave(_Q%)
�$� 2     :�shell_DataSaveAck(_Q%)
�#� 3     :�shell_DataLoad(_Q%,�)
�$� 4     :�shell_DataLoadAck(_Q%)
�#� 5     :�shell_DataLoad(_Q%,�)
�!� 6     :�shell_RAMFetch(_Q%)
�$� 7     :�shell_RAMTransmit(_Q%)
�(� 8     :�shell_Message_PreQuit(_Q%)
�� 9     :� _U%!164>0 �
�#              *|ifdef TraceInit
�J              �shell_Tracef0("Receive:PaletteChange message received")
�              *|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%)
�            �
�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
;            � �shell_GetString(_Q%+28) = "StrongHelp" �
D              _U%!208=_Q%!20:� store task handle of StrongHlp...
	            �

$              �shell_ScanForHelp
            �
)  :�shell_HandleUnknownMessage2(_Q%)

�
�
:
*|Stop PROCshell_Receive

(*|Start PROCshell_Message_ModeChange
$� �shell_Message_ModeChange(_Q%)
� _U%!160>0 �
F  �shell_Tracef0("Message_ModeChange:ModeChange message received")
  temp%=_U%!160
  void%=�("FN"+$temp%)
�
)� SYS "FontWindow_ModeChange",_U%!148
�
'*|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)
/0    � �message$,20)="EvntShellLib:TraceOn" �
0      �shell_TraceOn
1	    �
21    � �message$,21)="EvntShellLib:TraceOff" �
3      �shell_TraceOff
4	    �
58    � �message$,28)="EvntShellLib:ListClickSelect" �
6       �shell_ListClickSelect
7	    �
88    � �message$,28)="EvntShellLib:ListClickAdjust" �
9       �shell_ListClickAdjust
:	    �
;5    � �message$,25)="EvntShellLib:ListHelpTags" �
<      �shell_ListHelpTags
=	    �
>�
?;� Pass message block on in case the user wants it too..
@$�shell_HandleUnknownMessage(_Q%)
A�
B:
C**|Stop PROCshell_HandleUnknownMessage2
D
E**|Start PROCshell_HandleUnknownMessage
F&� �shell_HandleUnknownMessage(_Q%)
G�
H:
I)*|Stop PROCshell_HandleUnknownMessage
J
K**|Start PROCshell_AttachPreQuitHandler
L&� �shell_AttachPreQuitHandler(fn$)
M� temp%,void%
N1� _U%!300>0 � �shell_HeapBlockReturn(_U%!300)
O)_U%!300=�shell_HeapBlockFetch(�fn$+1)
Ptemp%=_U%!300:$temp%=fn$
Q�
R:
S)*|Stop PROCshell_AttachPreQuitHandler
T
U+*|Start PROCshell_AttachShutdownHandler
V'� �shell_AttachShutdownHandler(fn$)
W� temp%,void%
X1� _U%!312>0 � �shell_HeapBlockReturn(_U%!312)
Y)_U%!312=�shell_HeapBlockFetch(�fn$+1)
Ztemp%=_U%!312:$temp%=fn$
[�
\:
]**|Stop PROCshell_AttachShutdownHandler
^
_-*|Start PROCshell_AttachModeChangeHandler
`)� �shell_AttachModeChangeHandler(fn$)
a� temp%,void%
b1� _U%!160>0 � �shell_HeapBlockReturn(_U%!160)
c)_U%!160=�shell_HeapBlockFetch(�fn$+1)
dtemp%=_U%!160:$temp%=fn$
evoid%=�("FN"+fn$)
f�
g:
h,*|Stop PROCshell_AttachModeChangeHandler
i
j0*|Start PROCshell_AttachPaletteChangeHandler
k,� �shell_AttachPaletteChangeHandler(fn$)
l� temp%,void%
m1� _U%!164>0 � �shell_HeapBlockReturn(_U%!164)
n)_U%!164=�shell_HeapBlockFetch(�fn$+1)
otemp%=_U%!164:$temp%=fn$
pvoid%=�("FN"+fn$)
q�
r:
s/*|Stop PROCshell_AttachPaletteChangeHandler
t
u1*|Start PROCshell_AttachTaskInitialiseHandler
v-� �shell_AttachTaskInitialiseHandler(fn$)
w� temp%,void%
x1� _U%!168>0 � �shell_HeapBlockReturn(_U%!168)
y)_U%!168=�shell_HeapBlockFetch(�fn$+1)
ztemp%=_U%!168:$temp%=fn$
{�
|:
}0*|Stop PROCshell_AttachTaskInitialiseHandler
~
0*|Start PROCshell_AttachTaskCloseDownHandler
�,� �shell_AttachTaskCloseDownHandler(fn$)
�� temp%,void%
�1� _U%!172>0 � �shell_HeapBlockReturn(_U%!172)
�)_U%!172=�shell_HeapBlockFetch(�fn$+1)
�temp%=_U%!172:$temp%=fn$
��
�:
�/*|Stop PROCshell_AttachTaskCloseDownHandler
�
�*|Start PROCshell_RAMFetch
�� �shell_RAMFetch(_Q%)
�&� RAMFetch_buffer%,len_data%,done%
�done%=�
�F� If the address in the data save event block <&8000 then it is an
�I� estimated size and the file is not already present in a RAM buffer.
�K� In this case ignore RAMFetch message as the data will be written to a
�� file anyway..
�� _U%!144>&8000 �
�   � Send file to application
�#  � send RAMTransmit message...
�*|ifdef TraceInit
�2  �shell_Tracef0("RAMFetch:RAMFetch called..")
�*|endif
�  _Q%!12=_Q%!08
�+  _Q%!16=7:� message action RAMTransmit
�  � get buffer length..
�  len_data%=_U%!136
�  � _U%!140=&FF9 �
�H    � kludge for sprite files because when saving to a physical file
�I    � with "OS_SpriteOp" the first word is dropped. Hence for the RAM
�I    � save we have to incrememt the address the data is held at by 4!
�M    � The estimated size has already been kludged in shell_AttachDataSave
�    _U%!144+=4
�  �
�$  � (len_data%-_U%!128)<_Q%!24 �
�&    �  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
	0� found%<>-1 � =� � =�
	1:
	2*|Stop FNshell_CheckType
	3
	4*|Start PROCshell_Exit
	5� �shell_Exit
	6� ms_desc%
	7ms_desc%=_U%!68
	8)È™ "XMessageTrans_CloseFile",ms_desc%
	9È™ "XOS_Module",7,,ms_desc%
	:*|ifdef TraceInit
	;3�shell_Tracef0("Exit:Application closing down")
	<*|endif
	=�shell_TraceExit
	>È™ "Hourglass_Smash"
	?È™ "Wimp_DragBox",,-1
	@#�shell_WimpCloseDown_I(_U%!148)
	A�
	B:
	C*|Stop PROCshell_Exit
	D
	E*|Start PROCshell_DataLoad
	F$� �shell_DataLoad(_Q%,DataOpen%)
	G<� reference%,offset%,blk%,_temp%,type_list%,type%,fname$
	Htype%=_Q%!40
	I#fname$=�shell_GetString(_Q%+44)
	J*|ifdef TraceInit
	K8�shell_Tracef0("DataLoad:DataLoad message received")
	L*|endif
	M7� check my_file_type set up in shell_AttachDataLoad
	N?� only works when dragging a file as when DataOpen% is TRUE
	O+� the _Q% block is set up differently!!
	P� DataOpen% �
	Q  � double click load..
	R8  � check if there are any dataload events set up...
	S  � _U%!96<>0 �
	T8    offset%=0:� look at first dataload event only...
	U  �
	V!    offset%=-1:� ignore it...
	W  �
	X�
	Y9  � drag load, check for specific window/icon event..
	ZB  offset%=�shell_GetEventListOffset(_Q%!20,_Q%!24,_U%+96,16,�)
	[  � offset%=-1 �
	\,    � now check for window handle only..
	]@    offset%=�shell_GetEventListOffset(_Q%!20,-1,_U%+96,16,�)
	^  �
	_�
	`� offset%>-1 �
	a  � DataLoadEvent exists
	b  blk%=_U%!96+offset%
	c3  � �shell_CheckType(_Q%!40,blk%!8,DataOpen%) �
	d    � file type is ok...
	e    *|ifdef TraceInit
	fG    �shell_Tracef0("DataLoad:File type recognised (&"+�~_Q%!40+")")
	g    *|endif
	h    Reference%=_Q%!12
	i    _Q%!12=_Q%!8
	j    _Q%!16=4
	k*    È™ "Wimp_SendMessage",18,_Q%,_Q%!4
	l    � _U%!100 � 1<<1 �
	m      loadloc%=-1
	n       _U%!100=_U%!100 � 1<<1
	o	    �
	p6      loadloc%=�shell_LoadFile(Reference%=_U%!108)
	q	    �
	rG    �shell_UserFNLoadFile(type%,loadloc%,blk%!8,fname$,_Q%!36,blk%)
	s2    � return copy of datasave message block...
	t    � _U%!156<>0 �
	u)      �shell_HeapBlockReturn(_U%!156)
	v      _U%!156=0
	w	    �
	x  �
	y  *|ifdef TraceInit
	zI  �shell_Tracef0("DataLoad:File type NOT recognised (&"+�~_Q%!40+")")
	{
  *|endif
	|  �
	}�
	~
	�
	�:
	�*|Stop PROCshell_DataLoad
	�
	�$*|Start PROCshell_UserFNLoadFile
	�R� �shell_UserFNLoadFile(type%,loadloc%,type_list%,_filename$,_file_size%,blk%)
	�� 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$)
.�shell_Tracef0("DataSaveAck:task="+�_Q%!4)
2�shell_Tracef0("DataSaveAck:mytask="+�_U%!148)
*|endif
 @offset%=�shell_GetEventListOffset(_U%!28,_U%!32,_U%+72,24,�)
!G� offset%=-1 � offset%=-2 � � 99,�shell_MessageNoArgs("SHELLMSG05")
"blk%=(_U%!72)+offset%
#temp%=blk%!20
$,� now call the file saving routine......
%� $temp%<>"" �
&)  void%=�("FN"+$temp%+"(_fullname$)")
'�
(Q  � no file saving routine specified for this event, so check if data is in a
)  � heapblock..
*(  � �shell_HeapBlockExists(blk%!8) �
+G    � default save routine, just save the whole heapblock to disk..
,X    ș "OS_File",10,_fullname$,blk%!12,,blk%!8,blk%!8+�shell_HeapBlockInfo(blk%!8)+1
-  �
.:    � Whoops! not a heapblock - someone's screwed up..
//    � 99,�shell_MessageNoArgs("SHELLMSG21")
0  �
1�
2� _Q%!36>-1 �
3  � file is secure
42  � _U%!80<>0 � �shell_HeapBlockReturn(_U%!80)
51  _U%!80=�shell_HeapBlockFetch(�_fullname$+1)
6  temp%=_U%!80
7  $temp%=_fullname$
8�
9B_Q%!16=3:!_Q%=256:_Q%!20=_U%!200:_Q%!24=_U%!204:_Q%!40=_U%!140
:5_Q%!36=�shell_FileLength(_fullname$):_Q%!12=_Q%!8
;*|ifdef TraceInit
<B�shell_Tracef0("DataSaveAck:File length is "+�_Q%!36+" bytes")
=*|endif
>$(_Q%+44)=_fullname$+�(0)
?� send dataload message
@� store my_ref
A_U%!84=_Q%!8
B*|ifdef TraceInit
C:�shell_Tracef0("DataSaveAck:Sending DataLoad Message")
D*|endif
E.È™ "Wimp_SendMessage",18,_Q%,_Q%!20,_Q%!24
F?� now close window that save originated from if it is not a
G� 'dynamic' dbox
H� _U%!28<>_U%!20 �
I   �shell_CloseWindow(_U%!28)
J�
K3ș "Wimp_CreateMenu",,-1:� close any open menus
L�
M:
N *|Stop PROCshell_DataSaveAck
O'*|Start PROCshell_DataSaveCheckName
P'� �shell_DataSaveCheckName(wh%,ih%)
Q� offset%,blk%,list_size%
RF� Routine to check if a 'datasave' event exists in the window wh%.
SE� If it does then the filename is checked for a '.' character. An
TF� error is generated if no '.' is found. This routine is called by
U;� the library when a mouse click on icon 0 is detected.
Vblk%=_U%!72:offset%=0
W� blk%<>0 �
X-  list_size%=�shell_HeapBlockInfo(blk%)-8
Y8  � blk%<>0 therefore a datasave event list exists..
Z  �
[2    � check window handles of events in list..
\    � !(blk%+offset%)=wh% �
])      � check for a valid path name..
^1      name$=�shell_IconGetData(!blk%,blk%!16)
_I      � �name$,".")=0 � �shell_OK(�shell_MessageNoArgs("SHELLMSG01"))
`C      offset%=list_size%:� window handle found so abort check..
a	    �
b(    offset%+=24:� check next event..
c  � offset%>=list_size%
d�
e�
f:
g&*|Stop PROCshell_DataSaveCheckName
h!*|Start PROCshell_DataLoadAck
i� �shell_DataLoadAck(_Q%)
j*|ifdef TraceInit
kQ�shell_Tracef0("DataLoadAck:DataLoadAck message received (file received ok)")
l*|endif
m�
n:
o *|Stop PROCshell_DataLoadAck
p,*|Start PROCshell_UserMessageAcknowledge
q(� �shell_UserMessageAcknowledge(_Q%)
rȎ _Q%!16 �
s!  � 3:�shell_AckDataLoad(_Q%)
t!  � 6:�shell_AckRAMFetch(_Q%)
u�
v�
w:
x+*|Stop PROCshell_UserMessageAcknowledge
y!*|Start PROCshell_AckDataLoad
z� �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)
�  �7
�,  ș "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$<>"" �
+.  void%=�("FN"+warn_fn$+"(_U%!52,_U%!56)")
,!  *|ifdef PROCshell_TraceInit
-;  �shell_Tracef0("MenuWarnSubMenu:Calling FN"+warn_fn$)
.
  *|endif
/�
0*|ifdef Using_FontMenu
1� s_menu%=_U%!252 �
2"  � Submenu is FontMenu menu..
3!  *|ifdef PROCshell_TraceInit
4:  �shell_Tracef0("MenuWarnSubMenu:FontMenu opening..")
5
  *|endif
6I  � �shell_HeapBlockExists(_U%!256) � �shell_HeapBlockReturn(_U%!256)
78  � Store current menu selection for testing later..
8=  � First work out how many levels are in the selection..
92  ctr%=0:�:ctr%+=4:� !(_Q%+32+ctr%)=-1:ctr%+=4
:7  _U%!256=�shell_HeapBlockFetch(ctr%):temp%=_U%!256
;  ctr%=0
<  �
=!    temp%!ctr%=!(_Q%+32+ctr%)
>    ctr%+=4
?  � !(_Q%+32+ctr%)=-1
@  temp%!ctr%=!(_Q%+32+ctr%)
A  temp%=_U%!256
B!  *|ifdef PROCshell_TraceInit
Ch  �shell_Tracef0("MenuWarnSubMenu:Selecting '"+�shell_FontMenuGetLastSelectedFont+"' in FontMenu..")
D
  *|endif
EP  ș "FontMenu_Select",�shell_FontMenuGetLastSelectedFont,_U%!260 � ,f_menu%
F+  _U%!264=1:� Set 'FontMenuOpen' flag..
G  � f_menu%<>_U%!252 �
H$    � FontMenu ptr has changed..
I)    �shell_FontMenuUpdatePtr(f_menu%)
J'    _U%!252=f_menu%:s_menu%=f_menu%
K  �
L�
M-  _U%!264=0:� Clear 'FontMenuOpen' flag..
N�
O*|endif
P*È™ "Wimp_CreateSubMenu",,s_menu%,x%,y%
Q�
R:
S$*|Stop PROCshell_MenuWarnSubMenu
T
U#*|Start PROCshell_AttachSubMenu
V3� �shell_AttachSubMenu(item%,submenu%,warn_fn$)
W(È™ "MenuUtil_SubMenu",item%,submenu%
X� warn_fn$<>"" �
Y  ș "MenuUtil_Warning",,�
Z:  �shell_EventListMenuWarn(item%,submenu%,warn_fn$,"")
[�
\�
]:
^"*|Stop PROCshell_AttachSubMenu
_
`'*|Start PROCshell_EventListMenuWarn
aC� �shell_EventListMenuWarn(item%,submenu_ptr%,warn_fn$,sel_fn$)
b� temp%,temp2%,ctr%,e_list%
c� _U%!220=0 �
d  � Create event list..
e'  _U%!220=�shell_HeapBlockFetch(32)
f  temp%=_U%!220
g  temp%!0=item%
h0  temp%!4=�shell_HeapBlockFetch(�warn_fn$+1)
i  $(temp%!4)=warn_fn$
j  temp%!8=submenu_ptr%
k0  temp%!12=�shell_HeapBlockFetch(�sel_fn$+1)
l  $(temp%!12)=sel_fn$
m5  temp%!16=-1:temp%!20=-1:temp%!24=-1:temp%!28=-1
n�
o$  � Extend existing event list..
p0  e_list%=�shell_HeapBlockExtend(_U%!220,32)
q  _U%!220=e_list%:ctr%=0
r  �
s    ctr%+=16
t  � e_list%!ctr%=-1
u  temp%=_U%!220
v  temp%!ctr%=item%
w7  temp%!(ctr%+4)=�shell_HeapBlockFetch(�warn_fn$+1)
x.  temp2%=temp%!(ctr%+4):$(temp2%)=warn_fn$
y!  temp%!(ctr%+8)=submenu_ptr%
z7  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%)
�.� tag$,mess$,validation$,pos1%,pos2%,help$
�0tag$=�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%
�'icon_blk%=�shell_HeapBlockFetch(40)
�!!icon_blk%=h%:icon_blk%!4=in%
�%ș "Wimp_GetIconState",,icon_blk%
�$(icon_blk%!28)=s$
�Wș "Wimp_ForceRedraw",-1,icon_blk%!8-200,icon_blk%!12,icon_blk%!16+200,icon_blk%!20
�%�shell_HeapBlockReturn(icon_blk%)
��
�:
�#*|Stop PROCshell_IconbarSetText
�
�(*|Start FNshell_WriteableIconHandler
�/� �shell_WriteableIconHandler(wh%,ih%,key%)
�-� nr_icons%,first_write%,last_write%,ctr%
�8� before%,after%,index%,mx%,my%,temp_blk%,caret_blk%
�(caret_blk%=�shell_HeapBlockFetch(24)
�*ș "Wimp_GetCaretPosition",,caret_blk%
�� caret_blk%!0=-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%!0:ctr%=0
�
  � caret_blk%!ctr%=ih% �
>    before%=caret_blk%!(ctr%-4):after%=caret_blk%!(ctr%+4)
	  �


  ctr%+=4
� caret_blk%!ctr%=-1
#last_write%=caret_blk%!(ctr%-4)


Ȏ key% �
  � &0D  :� return
    � ih%=last_write% �
%      � fake a keypress on icon 0
"      È™ "Wimp_ProcessKey",&0D
-      � PROCshell_FakeMouseClick(wh%,0,4)
	    �
Z      ș "Wimp_SetCaretPosition",wh%,after%,-1,-1,-1,�(�shell_IconGetData(wh%,after%))
	    �
  � &18E :� cursor down
    � ih%=last_write% �
f      ș "Wimp_SetCaretPosition",wh%,first_write%,-1,-1,-1,�(�shell_IconGetData(wh%,first_write%))
	    �
Z      È™ "Wimp_SetCaretPosition",wh%,after%,-1,-1,-1,�(�shell_IconGetData(wh%,after%))
	    �
  � &18F :� cursor up
    � ih%=first_write% �
d      ș "Wimp_SetCaretPosition",wh%,last_write%,-1,-1,-1,�(�shell_IconGetData(wh%,last_write%))
	    �
 \      ș "Wimp_SetCaretPosition",wh%,before%,-1,-1,-1,�(�shell_IconGetData(wh%,before%))
!	    �
"�
#&�shell_HeapBlockReturn(caret_blk%)
$=�
%:
&'*|Stop FNshell_WriteableIconHandler
'$*|Start PROCshell_FakeMouseClick
(,� �shell_FakeMouseClick(wh%,ih%,button%)
)*ș "OS_Byte",15,1:� flush input buffer
*'_Q%!8=button%:_Q%!12=wh%:_Q%!16=ih%
+�shell_Action(6)
,�
-:
.#*|Stop PROCshell_FakeMouseClick
/*|Start FNshell_IconCreate
0X� �shell_IconCreate(wh%,minx%,miny%,w%,h%,fg%,bg%,flg%,data$,addr%,len%,validation$)
1!� i%,handle%,valid%,icon_blk%
2'icon_blk%=�shell_HeapBlockFetch(40)
3icon_blk%!0=wh%
4'icon_blk%!4=minx%:icon_blk%!8=miny%
5/icon_blk%!12=minx%+w%:icon_blk%!16=miny%+h%
6)icon_blk%!20=flg% � bg%<<28 � fg%<<24
7� icon_blk%!20 � &100 �
8  i%=�data$,",")
9  icon_blk%!24=addr%
:  � validation$<>"" �
;4    valid%=�shell_HeapBlockFetch(�validation$+1)
<    $valid%=validation$
=    icon_blk%!28=valid%
>  �
?    icon_blk%!28=-1
@  �
A  icon_blk%!32=len%
B�
C   $(icon_blk%+24)=�data$,11)
D�
E-ș "Wimp_CreateIcon",,icon_blk% � handle%
F%�shell_HeapBlockReturn(icon_blk%)
G=handle%
H:
I*|Stop FNshell_IconCreate
J *|Start PROCshell_IconDelete
K � �shell_IconDelete(wh%,ih%)
L"�shell_DoIconDelete(wh%,ih%,�)
M�
N:
O*|Stop PROCshell_IconDelete
P!*|Start PROCshell_IconDelete2
Q!� �shell_IconDelete2(wh%,ih%)
R"�shell_DoIconDelete(wh%,ih%,�)
S�
T:
U *|Stop PROCshell_IconDelete2
V"*|Start PROCshell_DoIconDelete
W*� �shell_DoIconDelete(wh%,ih%,redraw%)
X� blk%,x0%,y0%,x1%,y1%
Y"blk%=�shell_HeapBlockFetch(40)
Zblk%!0=wh%:blk%!4=ih%
[ È™ "Wimp_GetIconState",,blk%
\&È™ "Interface_BoundingBox",,blk%+8
]2x0%=blk%!8:y0%=blk%!12:x1%=blk%!16:y1%=blk%!20
^ È™ "Wimp_GetIconState",,blk%
_G� �shell_HeapBlockExists(blk%!28) � �shell_HeapBlockReturn(blk%!28)
`G� �shell_HeapBlockExists(blk%!32) � �shell_HeapBlockReturn(blk%!32)
aÈ™ "Wimp_DeleteIcon",,blk%
b� redraw% �
c/  È™ "Wimp_ForceRedraw",wh%,x0%,y0%,x1%,y1%
d�
e �shell_HeapBlockReturn(blk%)
f�
g:
h!*|Stop PROCshell_DoIconDelete
i!*|Start PROCshell_IconPutData
j8� �shell_IconPutData(whandle%,ihandle%,data$,redraw)
k
� blk%
l#blk%=�shell_HeapBlockFetch(50) 
mblk%!0=whandle%
nblk%!4=ihandle%
o È™ "Wimp_GetIconState",,blk%
p� (blk%!24 � (1<<8))<>0 �
q@  � �data$>blk%!36 � � 99,�shell_MessageNoArgs("SHELLMSG12")
r  $(blk%!28)=data$
s�
t  $(blk%+28)=�data$,11)
u�
v� redraw<>0 �
w  blk%!8=0:blk%!12=0
x"  È™ "Wimp_SetIconState",,blk%
yE  � Call wimp poll immediately in case the user program doesn't..
z  �shell_EnsurePoll
{�
| �shell_HeapBlockReturn(blk%)
}�
~:
 *|Stop PROCshell_IconPutData
�!*|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%
�   �
��
��
�:
�*|Stop PROCshell_GetMinXY
�"*|Start FNshell_IconGetCommand
�"� �shell_IconGetCommand(v%,c$)
�� I%,result$
�
� v%<=0 �

  result$=""

�

I  I%=�";"+�shell_StringUpperCase($v%),";"+�shell_StringUpperCase(c$))

  � I%=0 �

    result$=""

  �

/    result$=�$(v%+I%),�$(v%+I%)+";",";")-1)

  �

�

	=result$

:

!*|Stop FNshell_IconGetCommand

 *|Start PROCshell_IconRedraw


 � �shell_IconRedraw(wh%,ih%)


� blk%

"blk%=�shell_HeapBlockFetch(40)

!blk%=wh%:blk%!4=ih%

 È™ "Wimp_GetIconState",,blk%

&È™ "Interface_BoundingBox",,blk%+8

<È™ "Wimp_ForceRedraw",wh%,blk%!8,blk%!12,blk%!16,blk%!20

+�shell_Action(�shell_Poll_I(0,_U%!148))

 �shell_HeapBlockReturn(blk%)

�

:

*|Stop PROCshell_IconRedraw

%*|Start FNshell_IconGetValidation

'� �shell_IconGetValidation(wh%,ih%)

� blk%,validation$,flags%

� ih%=-1 � =""

validation$=""

#blk%=�shell_HeapBlockFetch(100)

blk%!0=wh%:blk%!4=ih%

  È™ "Wimp_GetIconState",,blk%

!*� check flags first to see if it has a

"� validation string!

#flags%=blk%!24

$� flags% � &100 �

%*  � blk%!32>0 � validation$=$(blk%!32)

&�

' �shell_HeapBlockReturn(blk%)

(=validation$

):

*$*|Stop FNshell_IconGetValidation

+'*|Start PROCshell_IconPutValidation

,.� �shell_IconPutValidation(wh%,ih%,valid$)

-� blk%,flags%

.#blk%=�shell_HeapBlockFetch(100)

/blk%!0=wh%:blk%!4=ih%

0 È™ "Wimp_GetIconState",,blk%

1flags%=blk%!24

2� flags% � &100 �

3  $(blk%!32)=valid$

4�

5 �shell_HeapBlockReturn(blk%)

6�

7:

8&*|Stop PROCshell_IconPutValidation

9"*|Start FNshell_IsIconSelected

:6� �shell_IsIconSelected(WindowHandle%,IconHandle%)

;� temp%

<2�shell_IconGetState(WindowHandle%,IconHandle%)

=flags%=_Q%!24

>temp%=(flags% � &200000)

?� temp%=0 � =�

@=�

A:

B!*|Stop FNshell_IsIconSelected

C

D *|Start PROCshell_IconSelect

E2� �shell_IconSelect(WindowHandle%,IconHandle%)

FB�shell_IconSetState(WindowHandle%,IconHandle%,&200000,&200000)

G�

H:

I*|Stop PROCshell_IconSelect

J

K"*|Start PROCshell_IconDeselect

L4� �shell_IconDeselect(WindowHandle%,IconHandle%)

M<�shell_IconSetState(WindowHandle%,IconHandle%,0,&200000)

N�

O:

P!*|Stop PROCshell_IconDeselect

Q

R"*|Start PROCshell_IconGetState

S4� �shell_IconGetState(WindowHandle%,IconHandle%)

T!_Q%=WindowHandle%

U_Q%!4=IconHandle%

VÈ™ "Wimp_GetIconState",,_Q%

W�

X:

Y!*|Stop PROCshell_IconGetState

Z

[%*|Start PROCshell_IconSetSelected

\,� �shell_IconSetSelected(wh%,ih%,state%)

]� state%=0 �

^"  �shell_IconDeselect(wh%,ih%)

_�

`   �shell_IconSelect(wh%,ih%)

a�

b�

c:

d$*|Stop PROCshell_IconSetSelected

e

f*|Start PROCshell_IconSet

g$� �shell_IconSet(wh%,ih%,state%)

h� state%=0 �

i"  �shell_IconDeselect(wh%,ih%)

j�

k   �shell_IconSelect(wh%,ih%)

l�

m�

n:

o*|Stop PROCshell_IconSet

p"*|Start PROCshell_IconSetState

qH� �shell_IconSetState(WindowHandle%,IconHandle%,EorWord%,ClearWord%)

r� icon_blk%

s'icon_blk%=�shell_HeapBlockFetch(16)

t!icon_blk%=WindowHandle%

uicon_blk%!04=IconHandle%

vicon_blk%!08=EorWord%

wicon_blk%!12=ClearWord%

x%È™ "Wimp_SetIconState",,icon_blk%

y%�shell_HeapBlockReturn(icon_blk%)

z�

{:

|!*|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%)

��

��

�:

�(*|Stop PROCshell_IconSetUnselectable

�

�#*|Start PROCshell_CaretSetRight

�#� �shell_CaretSetRight(wh%,ih%)

�Nș "Wimp_SetCaretPosition",wh%,ih%,-1,-1,-1,�(�shell_IconGetData(wh%,ih%))

��
:
"*|Stop PROCshell_CaretSetRight

*|Start PROCprint_text
� �print_text(X,Y,text$)
#� �in(X,Y-32,X+16*�(text$),Y) �
  � X,Y

  � text$
�
	�

:
*|Stop PROCprint_text
*|Start FNin

� �in(A%,B%,C%,D%)
� C%<gbx � =�
� A%>gtx � =�
� B%>gty � =�
� D%<gby � =�
=�
:
*|Stop FNin
*|Start PROCnewvals
� �newvals
gbx=_Q%!28:gby=_Q%!32
gtx=_Q%!36:gty=_Q%!40
wbx=_Q%!4:wby=_Q%!8
wtx=_Q%!12:wty=_Q%!16
xsc=_Q%!20:ysc=_Q%!24
!hp=wtx-wbx:vp=wty-wby:ebx=xsc
!etx=xsc+hp:ety=ysc:eby=ysc-vp
�
:
 *|Stop PROCnewvals
!� �max(a%,b%)
"� a%<b% � =b%
#=a%
$:
%*|Start FNshell_Leaf
&� �shell_Leaf(path$)
'ȕ �path$,".")
(!  path$=�path$,�path$,".")+1)
)�
*
=path$
+:
,*|Stop FNshell_Leaf
-*|Start FNshell_Branch
.� �shell_Branch(fname$)
/� pos%,br$,temp%
0� �fname$,".")=0 �
1  br$=""
2�
3
  temp%=0
4  �
5    pos%=temp%+1
6    temp%=�fname$,".",pos%)
7  � temp%=0
8  br$=�fname$,pos%-2)
9�
:=br$
;:
<*|Stop FNshell_Branch
=*|Start FNgname
>� �gname(ptr)
?	f$=""
@ȕ ?ptr<>0 � ?ptr<>13
A  f$=f$+�?ptr:ptr+=1
B�
C=f$
D:
E*|Stop FNgname
F"*|Start PROCshell_WindowResize
G9� �shell_WindowResize(whandle%,bx%,by%,tx%,ty%,open%)
H+!_Q%=bx%:_Q%!4=by%:_Q%!8=tx%:_Q%!12=ty%
I$È™ "Wimp_SetExtent",whandle%,_Q%
J
� open% �
K  _Q%!0=whandle%
L"  È™ "Wimp_GetWindowInfo",,_Q%
M  È™ "Wimp_OpenWindow",,_Q%
N�
O�
P:
Q!*|Stop PROCshell_WindowResize
R#*|Start PROCshell_WindowRetitle
S+� �shell_WindowRetitle(whandle%,title$)
T� temp%,win_blk%
U(win_blk%=�shell_HeapBlockFetch(6000)
Vwin_blk%!0=whandle%
W%È™ "Wimp_GetWindowInfo",,win_blk%
X � ((win_blk%!60) � &100)=0 �
Y(  � window title is not indirected..
Z  temp%=win_blk%+76
[  $temp%=�title$,11)
\&  È™ "Wimp_DeleteWindow",,win_blk%
](  È™ "Wimp_CreateWindow",,win_blk%+4
^�
_$  � window title is indirected..
`(  � should check buffer size here...
a  $(!(win_blk%+76))=title$
b&  � ((win_blk%!32) � (1<<16))<>0 �
cR    È™ "Wimp_ForceRedraw",-1,win_blk%!4,win_blk%!16,win_blk%!12,win_blk%!16+44
d  �
e$�shell_HeapBlockReturn(win_blk%)
f�
g�
h:
i"*|Stop PROCshell_WindowRetitle
j)*|Start FNshell_WindowTitleIndirected
k)� �shell_WindowTitleIndirected(flag%)
l"� (flag% � (1<<8))=(1<<8) � =�
m=�
n:
o(*|Stop FNshell_WindowTitleIndirected
p**|Start PROCshell_ScreenToWindowCoords
q5� �shell_ScreenToWindowCoords(WHandle%,� X%,� Y%)
r4� Temp%,WXMin%,WYMin%,XScroll%,YScroll%,Scratch%
s'Scratch%=�shell_HeapBlockFetch(600)
tTemp%=Scratch%
u!Temp%=WHandle%
v"È™ "Wimp_GetWindowInfo",,Temp%
wWXMin%=Scratch%!4
xWYMax%=Scratch%!16
yXScroll%=Scratch%!20
zYScroll%=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
� � �shell_ListEvents(wh%,ic%)
�� wh%=-1 � wh%=-2
�7�"MenuSelection="+�shell_GetEventHandler(wh%,ic%,0)
�7�"MenuMaker    ="+�shell_GetEventHandler(wh%,ic%,1)
�7�"ClickSelect  ="+�shell_GetEventHandler(wh%,ic%,2)
�7�"ClickAdjust  ="+�shell_GetEventHandler(wh%,ic%,3)
�7�"Redraw       ="+�shell_GetEventHandler(wh%,ic%,4)
�7�"Keypress     ="+�shell_GetEventHandler(wh%,ic%,5)
�7�"Drag         ="+�shell_GetEventHandler(wh%,ic%,6)
�7�"Menu Warning ="+�shell_GetEventHandler(wh%,ic%,7)
�7�"HelpTag      ="+�shell_GetEventHandler(wh%,ic%,8)
�(menu%=�shell_GetEventMenu(2,wh%,ic%)
��"Menu Address =";
�� menu%=0 �
�  �" None"
��
�  � �menu%
��
��
�:
�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)
�#� �shell_HeapBlockExtend(a%,b%)
�� heap_code%+12,a%,b%
�=a%
�"*|Stop FNshell_HeapBlockExtend
�"*|Start FNshell_HeapBlockFetch
�/*|!Function to allocate a block on the heap
�,*|!a% = size of block to fetch from heap
�)*|!returns address of allocated block
�� �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% = address of block to deallocate
�"� �shell_HeapBlockReturn(� a%)
�4� �shell_HeapBlockExists(a%) � � heap_code%+8,a%
�a%=0
��
�$*|Stop PROCshell_HeapBlockReturn
�!*|Start FNshell_HeapBlockInfo
�8*|!Function to return current length of a heap block
�*|!a% = addr of heap block
�� �shell_HeapBlockInfo(a%)
�� r3
.ș "OS_Heap",6,!(heap_code%+28),a% � ,,,r3
=r3
:
:
 *|Stop FNshell_HeapBlockInfo
*|Start FNshell_OSVarExists
*� �shell_OSVarExists(buffer%,varname$)
� nr_bytes
<ș "XOS_ReadVarVal",varname$,buffer%,-1,0,0 � ,,nr_bytes
	� nr_bytes<0 � =�

=�
:
*|Stop FNshell_OSVarExists

*|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%)
� loop%
=value$
:
*|Stop FNshell_OSVarGetVal
$*|Start FNshell_OSReadCommandArg
"� �shell_OSReadCommandArg(opt)
� pointer%,command$,offset%
command$="":offset%=0
ș "OS_GetEnv" � pointer%
È• pointer%?offset%<>0
#  command$+=�(pointer%?offset%)
  offset%+=1
�
 Ȏ opt �
!	  � 0
"	  � 1
#,    command$=�command$,�command$,�34)+1)
$,    command$=�command$,�command$,�34)+2)
%�
&
=command$
':
(#*|Stop FNshell_OSReadCommandArg
)'*|Start FNshell_StringStripTrailing
*/� �shell_StringStripTrailing(string$,char$)
+È• �string$,1) = char$
,(  string$ = �string$,�(string$) - 1)
-�
.
= string$
/:
0&*|Stop FNshell_StringStripTrailing
1&*|Start FNshell_StringStripLeading
2.� �shell_StringStripLeading(string$,char$)
3È• �string$,1) = char$
4  string$ = �string$,2)
5�
6
= string$
7:
8%*|Stop FNshell_StringStripLeading
9"*|Start FNshell_StringStripAll
:*� �shell_StringStripAll(string$,char$)
;� done,pos
<
done=�
=�
>  pos=�string$,char$)
?
  � pos �
@    done=�
A/    string$=�string$,pos-1)+�string$,pos+1)
B  �
C    done=�
D  �
E
� done
F=string$
G:
H!*|Stop FNshell_StringStripAll
I%*|Start FNshell_StringPadTrailing
J5� �shell_StringPadTrailing(string$,char$,length%)
Kȕ �(string$) < length%
L6  string$ = string$ + �length% - �(string$),char$)
M�
N
= string$
O:
P$*|Stop FNshell_StringPadTrailing
Q$*|Start FNshell_StringPadLeading
R4� �shell_StringPadLeading(string$,char$,length%)
Sȕ �(string$) < length%
T6  string$ = �length% - �(string$),char$) + string$
U�
V
= string$
W:
X#*|Stop FNshell_StringPadLeading
Y#*|Start FNshell_StringUpperCase
Z%� �shell_StringUpperCase(string$)
[� loop%
\� �(string$) > 0 �
] � loop% = 1 � �(string$)
^:   � �string$,loop%,1)>="a" � �string$,loop%,1)<="z" �
_:     �string$,loop%,1) = �(�(�string$,loop%,1)) � &DF)
`   �
a � loop%
b�
c
= string$
d:
e"*|Stop FNshell_StringUpperCase
f"*|Start FNshell_StringExchange
g1� �shell_StringExchange(string$,target$,sub$)
h� index%
i�  �string$,target$) �
j  index%=�string$,target$)
k?  string$=�string$,index%-1)+sub$+�string$,index%+�target$)
l�
m=string$
n:
o!*|Stop FNshell_StringExchange
p)*|Start FNshell_StringArrayGetLongest
q0� �shell_StringArrayGetLongest(array$(),nr%)
r� loop%,longest%
slongest% = 0
t� loop% = 0 � nr%
u%  � �(array$(loop%)) > longest% �
v#    longest% = �(array$(loop%))
w  �
x� loop%
y= longest%
z:
{(*|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%!48=�
�7�shell_BroadcastMessage(&43B00,"ShellDBug:TraceOn")
��
�:
�*|Stop PROCshell_TraceOn
�*|Start PROCshell_TraceOff
�� �shell_TraceOff
�_U%!48=�
�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(1024)
�<shell_AppDir$=�shell_OSVarGetVal(blk%,1024,"Obey$Dir",1)
�1shell_AppName$=��shell_Leaf(shell_AppDir$),2)
�3� should check first if ShellDBug is running...
�X�shell_BroadcastMessage(&43B00,"ShellDBug:Init Debug messages from "+shell_AppName$)
� �shell_HeapBlockReturn(blk%)
��
�:
�*|Stop PROCshell_TraceInit
�*|Start FNshell_TraceIsOn
�� �shell_TraceIsOn
�=_U%!48
�:
�*|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...
�G� _U%!148>0 � �shell_BroadcastMessage(&43B00,"ShellDBug:Trace "+a$)
��
�:
�*|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
��
�:
�*|Stop PROCshell_TraceExit
�"*|Start PROCshell_AttachHotKey
�G� �shell_AttachHotKey(key$,shift%,ctrl%,alt%,window$,wh%,fn1$,fn2$)
�.� e_list%,offset%,temp%,temp2%,key%,f_key%
�f_key%=�
�� _U%!60=0 �
�&  _U%!60=�shell_HeapBlockFetch(24)
�  offset%=0:_U%!180=1
��
�  offset%=_U%!180*24
�.  _U%!60=�shell_HeapBlockExtend(_U%!60,24)
�  _U%!180=(_U%!180)+1
��
�e_list%=_U%!60
�
Ȏ key$ �
�  � "F1" :key%=385
�  � "F2" :key%=386
�  � "F3" :key%=387
�  � "F4" :key%=388
�  � "F5" :key%=389
�  � "F6" :key%=390
�  � "F7" :key%=391
�  � "F8" :key%=392
�  � "F9" :key%=393
�  � "F10":key%=458
�  � "F11":key%=459
�
�  key%=(�key$)-64:f_key%=�
��
�� f_key% �
�  � shift% � key%+=16
�  � ctrl%  � key%+=32
��
�temp%=e_list%+offset%
�temp%!0=key%
�temp%?4=shift%:� shift flag
�temp%?5=ctrl% :� ctrl  flag
�temp%?6=alt%  :� alt   flag
�-temp%!8=�shell_HeapBlockFetch(�window$+1)
�"temp2%=temp%!8:$temp2%=window$
�
� wh%>0 �
�0  � 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$
�+temp%!20=�shell_HeapBlockFetch(�fn2$+1)
� temp2%=temp%!20:$temp2%=fn2$
��
�:
�!*|Stop PROCshell_AttachHotKey
�
!*|Start FNshell_HotKeyProcess
 � �shell_HotKeyProcess(key%)
6� e_list%,list_size%,found%,ptr%,h%,win$,fn1$,fn2$
>� ctrl%,shift%,alt%,x_off%,y_off%,flag%,key_flags%,offset%
� result%,win_blk%
e_list%=_U%!60
list_size%=_U%!180*24
found%=�:ptr%=0
�
	  � e_list%!ptr%=key% �

    found%=�
  �
    ptr%+=24

  �
� found% � ptr%>=list_size%
� found% �
  temp%=e_list%+ptr%
  win$=$(temp%!8)
  *|ifdef TraceInit
A  �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")
0*|endif
1  �
25    offset%=�shell_SearchStatic(_U%!184,temp%!12)
3    � offset%>-1 �
4+      �shell_OpenWindowStatic(temp%!12)
5	    �
6      � temp%!12>0 �
7@        � request to open a static window, but window handle
8C        � has not been registered with shell_CreateWindowStatic
93        � 99,�shell_MessageNoArgs("SHELLMSG09")
:      �
;.        � must be a dynamic window then...
<6        �shell_OpenWindowDynamic(h%,x_off%,y_off%)
=      �
>	    �
?  fn2$=$(temp%!20)
@  � fn2$<>"" �
A    *|ifdef TraceInit
BG    �shell_Tracef0("HotKeyProcess:Calling Post-Open FN '"+fn2$+"'")
C    *|endif
D    � temp%!12>0 �
E.      void%=�("FN"+fn1$+"("+�temp%!12+")")
F	    �
G(      void%=�("FN"+fn2$+"("+�h%+")")
H	    �
I  �
J    *|ifdef TraceInit
KB    �shell_Tracef0("HotKeyProcess:No Post-Open FN registered")
L    *|endif
M  �
N  result%=�
O�
P'  win$="":fn1$="":fn2$="":result%=�
Q�
R=result%
S:
T *|Stop FNshell_HotKeyProcess
U
V-*|Start PROCshell_OpenWindowStaticNewView
W)� �shell_OpenWindowStaticNewView(wh%)
X�shell_OpenWindow(wh%,�,-1)
Y�
Z:
[,*|Stop PROCshell_OpenWindowStaticNewView
\&*|Start PROCshell_OpenWindowStatic
]&� �shell_OpenWindowStatic(handle%)
^/� �shell_SearchStatic(_U%!184,handle%)>-1 �
_%  �shell_OpenWindow(handle%,0,-1)
`�
a-  � 99,�shell_MessageNoArgs("SHELLMSG09")
b�
c�
d:
e%*|Stop PROCshell_OpenWindowStatic
f
g *|Start FNshell_SearchStatic
h*� �shell_SearchStatic(w_list%,handle%)
i0� search static window list by window handle
j� found%,ctr%
kfound%=-1:ctr%=0
l� w_list%<>0 �
m  È• w_list%!ctr%<>-1
n,    � w_list%!ctr%=handle% � found%=ctr%
o    ctr%+=4
p  �
q�
r=found%
s:
t*|Stop FNshell_SearchStatic
u
v(*|Start PROCshell_CreateWindowStatic
w1� �shell_CreateWindowStatic(ident$,� handle%)
x#� wb_ptr%,w_list%,temp%,offset%
y wb_ptr%=�shell_GetWB(ident$)
z3� 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
�	    �
�*|ifdef TraceInit
�E  �shell_Tracef0("CreateWindowStatic:Found unused space in list")
�*|endif
�      ctr%=offset%
�	    �
�    temp%=w_list%+ctr%
�"    temp%!0=handle%:temp%!4=-1
�  �
��
��
�:
�'*|Stop PROCshell_CreateWindowStatic
�
�$*|Start PROCshell_InitHelpSystem
�'� �shell_InitHelpSystem(path$,die%)
�7� tail$,pos%,OSVarBuff%,respath$,help_found%,abort%
�<_U%!212=0:� _U%!216<>0 � �shell_HeapBlockReturn(_U%!216)
�/_U%!216=0:� clear pending command buffer...
�9�shell_ScanForHelp:� check if StrongHlp is running...
�-� die% � tail$=" -DieWithTask" � tail$=""
�*|ifdef Using_ResFind
�� _U%!100 � 1<<3 �
�,  � ResFind initialised, check ResPath..
�  path$=""
�+  OSVarBuff%=�shell_HeapBlockFetch(256)
�Q  respath$=�shell_OSVarGetVal(OSVarBuff%,256,�shell_GetAppName+"Res$Path",-1)
�(  �shell_HeapBlockReturn(OSVarBuff%)
�  �
�    pos%=�respath$,",")
�    � pos%>0 �
�D      � �shell_FileExists(�respath$,pos%-1)+�shell_GetAppName) �
�5        path$=�respath$,pos%-1)+�shell_GetAppName
�        help_found%=�
�      �
�&        respath$=�respath$,pos%+1)
�      �
�	    �
�;      � �shell_FileExists(respath$+�shell_GetAppName) �
�,        path$=respath$+�shell_GetAppName
�        help_found%=�
�      �
�        abort%=�
�K        �shell_OK(�shell_MessageOneArg("SHELLMSG26",�shell_GetAppName))
�      �
�	    �
�(  � path$<>"" � help_found% � abort%
��
�*|endif
�A� abort%=0 � �shell_StrongHlpMsg("Help_Install "+path$+tail$)
��
�:
�#*|Stop PROCshell_InitHelpSystem
�
�*|Start PROCshell_HelpWord
�� �shell_HelpWord(word$)
�� read%,temp%,buff%
�$buff%=�shell_HeapBlockFetch(512)
�� _U%!208 = -1 �
�2  �  StrongHelp is not loaded. Try to run it..
�4  � �shell_OSVarExists(buff%,"StrongHelp$Dir") �
�8    � Variable exists, so attempt to run StrongHlp..
�/    ș "XWimp_StartTask","<StrongHelp$Dir>"
�6    � _U%!216<>0 � �shell_HeapBlockReturn(_U%!216)
�/    _U%!216=�shell_HeapBlockFetch(�word$+1)
�    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$)
� msg_blk%
'msg_blk%=�shell_HeapBlockFetch(256)
*msg_blk%!12=0:msg_blk%!16=reason_code%
$(msg_blk%+20)=msg$+�(0)
msg_blk%!0=256
;ș "Wimp_SendMessage",17,msg_blk%,0:� broadcast message
$�shell_HeapBlockReturn(msg_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
0*� �shell_WindowToggleToggleIcon(� wh%)
1'�shell_WindowToggleFlags(wh%,1<<27)
2�
3:
4+*|Stop PROCshell_WindowToggleToggleIcon
5,*|Start PROCshell_WindowToggleHScrollBar
6*� �shell_WindowToggleHScrollBar(� wh%)
7'�shell_WindowToggleFlags(wh%,1<<30)
8�
9:
:+*|Stop PROCshell_WindowToggleHScrollBar
;0*|Start PROCshell_WindowToggleAdjustSizeIcon
<.� �shell_WindowToggleAdjustSizeIcon(� wh%)
='�shell_WindowToggleFlags(wh%,1<<29)
>�
?:
@/*|Stop PROCshell_WindowToggleAdjustSizeIcon
A,*|Start PROCshell_WindowToggleVScrollBar
B*� �shell_WindowToggleVScrollBar(� wh%)
C'�shell_WindowToggleFlags(wh%,1<<28)
D�
E:
F+*|Stop PROCshell_WindowToggleVScrollBar
G'*|Start PROCshell_WindowToggleFlags
H+� �shell_WindowToggleFlags(� wh%,mask%)
I� blk%,flags%,open%,handle%
J*|ifdef TraceInit
K3�shell_Tracef0("WindowToggleFlags:wh%=&"+�~wh%)
L*|endif
M"open%=�shell_WindowIsOpen(wh%)
N$blk%=�shell_HeapBlockFetch(6000)
Oblk%!0=wh%
P!È™ "Wimp_GetWindowInfo",,blk%
Qflags%=blk%!32
Rflags%=(flags% � mask%)
Sblk%!32=flags%
T È™ "Wimp_DeleteWindow",,blk%
U,ș "Wimp_CreateWindow",,blk%+4 � handle%
V!blk%=handle%
W
� open% �
X+  � If window was open, open it again..
Y   È™ "Wimp_OpenWindow",,blk%
Z�
[ �shell_HeapBlockReturn(blk%)
\� handle%<>wh% �
],  �shell_UpdateWindowHandle(wh%,handle%)
^  wh%=handle%
_�
`�
a:
b&*|Stop PROCshell_WindowToggleFlags
c%*|Start PROCshell_ListClickSelect
d� �shell_ListClickSelect
e*� e_list%,ptr%,list_size%,temp%,temp2%
fe_list%=_U%!12
g,list_size%=�shell_HeapBlockInfo(e_list%)
h*|ifdef TraceInit
i�shell_Tracef0(" ")
j1�shell_Tracef0("List of ClickSelect events:")
k*|endif
l
ptr%=0
m�
n1  temp%=e_list%!(ptr%+20):temp2%=e_list%+ptr%
o'  � �shell_HeapBlockExists(temp%) �
p    � $temp%<>"" �
q*|ifdef TraceInit
r�  �shell_Tracef0("&"+�shell_StringPadTrailing(�~temp2%!0," ",8)+" &"+�shell_StringPadTrailing(�~temp2%!4," ",8)+"   "+$temp%)
s*|endif
t	    �
u  �
v  ptr%+=48
w� (ptr%>=list_size%)
x*|ifdef TraceInit
y�shell_Tracef0(" ")
z*|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%
�'  � �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_ListClickAdjust
�"*|Start PROCshell_ListHelpTags
�� �shell_ListHelpTags
�*� 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 attached help tags:")
�*|endif
�
ptr%=0
��
�1  temp%=e_list%!(ptr%+44):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_ListHelpTags
�*|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
�    start%!(I%-1)=value%
�
  � I%
��
�� remainder%>0 �
�!  start%=start%+(nr_words%*4)
�  � I%=0 � remainder%-1
�    start%?I%=value%
�
  � I%
��
��
�:
�*|Stop PROCshell_MemFill
�
�$*|Start PROCshell_AttachFontMenu
�*|Define Using_FontMenu
�6� �shell_AttachFontMenu(wh%,ih%,sel_fn$,maker_fn$)
�� menu%
��shell_FontMenuInit
�/ș "FontMenu_Select",""+�0,_U%!260 � ,menu%
�&� Store menu ptr in shell memory..
�_U%!252=menu%
�)�shell_EventAdd(wh%,ih%,0,-2,sel_fn$)
�*|ifdef PROCshell_TraceInit
�8�shell_Tracef0("AttachFontMenu:Attaching font menu")
�*|endif
�?� 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
�F� ("RMEnsure FontMenu 1.16 RMLoad <EvntShellSystem$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_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%
0�
1:
2*|Stop PROCshell_FindFont
3#*|Start FNshell_FontIsAvailable
4/� �shell_FontIsAvailable(font$,x_pt%,y_pt%)
5� �
6� � �:� �:=�
7Cș "Font_FindFont",0,font$,x_pt%*16,y_pt%*16,0,0 � font_handle%
8#È™ "Font_LoseFont",font_handle%
9=�
::
;"*|Stop FNshell_FontIsAvailable
<
="*|Start FNshell_CheckSelection
>!� �shell_CheckSelection(sel%)
?� temp%,ctr%
@temp%=_U%!256
A� temp%=0 � =-1
B� _U%!24=_U%!252 � =0
C�
D#  � sel%!ctr%<>temp%!ctr% � =-1
E
  ctr%+=4
F� temp%!ctr%=-1
G	=ctr%
H:
I!*|Stop FNshell_CheckSelection
J
K&*|Start FNshell_MenuGetItemAddress
L1� �shell_MenuGetItemAddress(menu%,selection%)
M� ctr%,item_addr%
N$ș "MenuUtil_Info",menu% � menu%
O�
P0  item_addr%=menu%+28+((selection%!ctr%)*24)
Q/  menu%=item_addr%!4:� address of submenu..
R
  ctr%+=4
S� selection%!ctr%=-1
T=item_addr%
U:
V%*|Stop FNshell_MenuGetItemAddress
W
X$*|Start FNshell_GetLastMouseXPos
Y� �shell_GetLastMouseXPos
Z=_U%!272
[:
\#*|Stop FNshell_GetLastMouseXPos
]$*|Start FNshell_GetLastMouseYPos
^� �shell_GetLastMouseYPos
_=_U%!276
`:
a#*|Stop FNshell_GetLastMouseYPos
b(*|Start PROCshell_UpdateWindowHandle
c8� �shell_UpdateWindowHandle(old_handle%,new_handle%)
d*|ifdef TraceInit
eG�shell_Tracef0("UpdateWindowHandle:Updating stored window handles")
fC�shell_Tracef0("UpdateWindowHandle:old handle=&"+�~old_handle%)
gC�shell_Tracef0("UpdateWindowHandle:new handle=&"+�~new_handle%)
h*|endif
i � new_handle%<>old_handle% �
j/  � _U%!28=old_handle% � _U%!28=new_handle%
kP  �shell_FixEventBlock(old_handle%,new_handle%,_U%!12,48):� main event block
lO  �shell_FixEventBlock(old_handle%,new_handle%,_U%!96,16):� dataload events
mO  �shell_FixEventBlock(old_handle%,new_handle%,_U%!72,24):� datasave events
nK  �shell_FixEventBlock(old_handle%,new_handle%,_U%!92,24):� pane events
oL  �shell_FixEventBlock(old_handle%,new_handle%,_U%!104,16):� bump events
p9  �shell_UpdateStaticWindows(old_handle%,new_handle%)
q�
r�
s:
t'*|Stop PROCshell_UpdateWindowHandle
u)*|Start PROCshell_UpdateStaticWindows
v9� �shell_UpdateStaticWindows(old_handle%,new_handle%)
w� offset%,w_list%
x*|ifdef TraceInit
yI�shell_Tracef0("UpdateStaticWindows:Correcting static window list..")
z*|endif
{w_list%=_U%!184
|4offset%=�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%)
�� ptr%,list_size%
�+� �shell_HeapBlockExists(event_list%) �
�4  list_size%=�shell_HeapBlockInfo(event_list%)-8
�  �
�*    � (event_list%!ptr%=old_handle%) �
�&      event_list%!ptr%=new_handle%
�	    �
�    ptr%+=offset%
�  � (ptr%>=list_size%)
��
��
�:
�"*|Stop PROCshell_FixEventBlock
�#*|Start PROCshell_IconSelectAll
�� �shell_IconSelectAll(wh%)
�
� blk%,I%
�$blk%=�shell_HeapBlockFetch(2000)
�I%=blk%+&40:!blk%=wh%
�blk%!8=1<<21:blk%!12=1<<21
�,ș "Wimp_WhichIcon",!blk%,I%,5<<21,0<<21
�
È• !I%>-1
�  blk%!4=!I%
�"  ș "Wimp_SetIconState",,blk%
�  I%+=4
��
� �shell_HeapBlockReturn(blk%)
��
�:
�"*|Stop PROCshell_IconSelectAll
�%*|Start PROCshell_IconDeselectAll
�!� �shell_IconDeselectAll(wh%)
�
� blk%,I%
�$blk%=�shell_HeapBlockFetch(2000)
�0I%=blk%+&40:!blk%=wh%:blk%!8=0:blk%!12=1<<21
�,ș "Wimp_WhichIcon",!blk%,I%,5<<21,1<<21
�
È• !I%>-1
�  blk%!4=!I%
�"  ș "Wimp_SetIconState",,blk%
�  I%+=4
��
� �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..
�� +0  window handle
�� +4  bump icon handle
�'� +8  step size (-ve for decr icon)
�&� +12 pointer to second info block
��
�� format of second block..
�� +0  display icon handle
�� +4  lower limit
�� +8  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_GetEventListOffset(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_GetEventListOffset(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
-� �shell_HandleBumpIcons(offset%,wh%,ih%)

8� display_ih%,info_blk%,e_blk%,curr_val%,_temp$,fn2%
� new_val%,fn%
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 �
0  _temp$=�shell_IconGetData(wh%,info_blk%!0)
(  curr_val%=�("FN"+$fn2%+"(_temp$)")
�
6  curr_val%=�(�shell_IconGetData(wh%,info_blk%!0))
�
 _new_val%=curr_val%+e_blk%!8
� info_blk%!20=0 �
   � no wrap..
!5  � _new_val%>info_blk%!8 � _new_val%=info_blk%!8
"5  � _new_val%<info_blk%!4 � _new_val%=info_blk%!4
#�
$  � wrap..
%5  � _new_val%>info_blk%!8 � _new_val%=info_blk%!4
&5  � _new_val%<info_blk%!4 � _new_val%=info_blk%!8
'�
(fn%=info_blk%!12
)� fn%<>0 �
**  _new_val$=�("FN"+$fn%+"(_new_val%)")
+�
,  _new_val$=�_new_val%
-�
.� _new_val%<>curr_val% �
/6  �shell_IconPutData(wh%,info_blk%!0,_new_val$,-1)
0�
1�
2:
3$*|Stop PROCshell_HandleBumpIcons
4
5'*|Start FNshell_WindowSetSpriteArea
60� �shell_WindowSetSpriteArea(h%,SpriteArea%)
7� blk%,new_handle%
8$blk%=�shell_HeapBlockFetch(6000)
9!blk%=h%
:!È™ "Wimp_GetWindowInfo",,blk%
;blk%!68=SpriteArea%
< È™ "Wimp_DeleteWindow",,blk%
=0ș "Wimp_CreateWindow",,blk%+4 � new_handle%
>A� new_handle%<>h% � �shell_UpdateWindowHandle(h%,new_handle%)
? �shell_HeapBlockReturn(blk%)
@=new_handle%
A:
B&*|Stop FNshell_WindowSetSpriteArea
C
D(*|Start FNshell_StrongHlpIsAvailable
E!� �shell_StrongHlpIsAvailable
F� r%,buff%
G$buff%=�shell_HeapBlockFetch(256)
H1r%=�shell_OSVarExists(buff%,"StrongHelp$Dir")
I!�shell_HeapBlockReturn(buff%)
J=r%
K'*|Stop FNshell_StrongHlpIsAvailable
L
M*|Start FNshell_MenuNew
N� �shell_MenuNew(title$)
O
� handle%
P'ș "MenuUtil_New",,title$ � handle%
Q=handle%
R:
S*|Stop FNshell_MenuNew
T
U*|Start FNshell_MenuAdd
V+� �shell_MenuAdd(handle%,item$,sel_fn$)
W� ret_handle%
X� sel_fn$<>"" � 
Y;  ș "MenuUtil_Add",handle%,item$,sel_fn$ � ret_handle%
Z�
[3  ș "MenuUtil_Add",handle%,item$ � ret_handle%
\�
]=ret_handle%
^:
_*|Stop FNshell_MenuAdd
`
a*|Start PROCshell_MenuTick
b*� �shell_MenuTick(item_handle%,state%)
c*È™ "MenuUtil_Tick",item_handle%,state%
d�
e:
f*|Stop PROCshell_MenuTick
g
h#*|Start PROCshell_MenuTickOnly1
i-� �shell_MenuTickOnly1(menu_handle%,pos%)
j,È™ "MenuUtil_TickOnly",menu_handle%,pos%
k�
l:
m"*|Stop PROCshell_MenuTickOnly1
n
o#*|Start PROCshell_MenuTickOnly2
p(� �shell_MenuTickOnly2(item_handle%)
q'È™ "MenuUtil_TickOnly",item_handle%
r�
s:
t"*|Stop PROCshell_MenuTickOnly2
u
v*|Start PROCshell_MenuShade
w&� �shell_MenuShade(handle%,state%)
x%È™ "MenuUtil_Fade",handle%,state%
y�
z:
{*|Stop PROCshell_MenuShade
|
} *|Start PROCshell_MenuDotted
~,� �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_AttachCloseWindow
�'� �shell_AttachCloseWindow(wh%,fn$)
�� blk%,temp%,offset%
�*|ifdef TraceInit
�E�shell_Tracef0("AttachCloseWindow: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_AttachCloseWindow
�
�"*|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
�3� �shell_OSModuleCheckVersion(module$,version%)
�� blk%,len%
�#blk%=�shell_HeapBlockFetch(256)
��("Set AppName$RISCOS Y")
�@�("RMEnsure "+module$+" "+�version%+" Set AppName$RISCOS N")
�>ș "XOS_ReadVarVal","AppName$RISCOS",blk%,256,0,0 � ,,len%
�blk%?len%=13
��("Unset AppName$RISCOS")
� �shell_HeapBlockReturn(blk%)
�� $blk%="N" � =�
�=�
�'*|Stop FNshell_OSModuleCheckVersion
�
�
00000000  0d 00 01 22 2a 7c 53 74  61 72 74 20 46 4e 73 68  |..."*|Start FNsh|
00000010  65 6c 6c 5f 4c 69 62 72  61 72 79 56 65 72 73 69  |ell_LibraryVersi|
00000020  6f 6e 0d 00 02 1b dd 20  a4 73 68 65 6c 6c 5f 4c  |on..... .shell_L|
00000030  69 62 72 61 72 79 56 65  72 73 69 6f 6e 0d 00 03  |ibraryVersion...|
00000040  0d 3d 31 2e 32 30 2a 31  30 30 0d 00 04 05 3a 0d  |.=1.20*100....:.|
00000050  00 05 21 2a 7c 53 74 6f  70 20 46 4e 73 68 65 6c  |..!*|Stop FNshel|
00000060  6c 5f 4c 69 62 72 61 72  79 56 65 72 73 69 6f 6e  |l_LibraryVersion|
00000070  0d 00 06 04 0d 00 07 1b  2a 7c 53 74 61 72 74 20  |........*|Start |
00000080  50 52 4f 43 73 68 65 6c  6c 5f 45 72 72 6f 72 0d  |PROCshell_Error.|
00000090  00 08 12 dd 20 f2 73 68  65 6c 6c 5f 45 72 72 6f  |.... .shell_Erro|
000000a0  72 0d 00 09 16 e7 20 5f  65 72 72 6f 72 5f 66 6c  |r..... _error_fl|
000000b0  61 67 25 3d 33 20 8c 0d  00 0a 4a 20 20 f2 73 68  |ag%=3 ....J  .sh|
000000c0  65 6c 6c 5f 45 72 72 6f  72 42 6f 78 28 22 55 6e  |ell_ErrorBox("Un|
000000d0  65 78 70 65 63 74 65 64  20 65 72 72 6f 72 3a 2d  |expected error:-|
000000e0  20 22 2b f6 24 2b 22 20  49 6e 74 65 72 6e 61 6c  | "+.$+" Internal|
000000f0  20 65 72 72 6f 72 20 63  6f 64 65 20 22 2b c3 9e  | error code "+..|
00000100  29 0d 00 0b 15 20 20 f2  73 68 65 6c 6c 5f 54 72  |)....  .shell_Tr|
00000110  61 63 65 4f 66 66 0d 00  0c 16 20 20 f2 73 68 65  |aceOff....  .she|
00000120  6c 6c 5f 54 72 61 63 65  45 78 69 74 0d 00 0d 05  |ll_TraceExit....|
00000130  cc 0d 00 0e 19 20 20 f2  73 68 65 6c 6c 5f 45 72  |.....  .shell_Er|
00000140  72 6f 72 42 6f 78 28 f6  24 29 0d 00 0f 05 cd 0d  |rorBox(.$)......|
00000150  00 10 12 5f 65 72 72 6f  72 5f 66 6c 61 67 25 3d  |..._error_flag%=|
00000160  33 0d 00 11 18 c8 99 20  22 48 6f 75 72 67 6c 61  |3...... "Hourgla|
00000170  73 73 5f 53 6d 61 73 68  22 0d 00 12 05 e1 0d 00  |ss_Smash".......|
00000180  13 05 3a 0d 00 14 1a 2a  7c 53 74 6f 70 20 50 52  |..:....*|Stop PR|
00000190  4f 43 73 68 65 6c 6c 5f  45 72 72 6f 72 0d 00 15  |OCshell_Error...|
000001a0  04 0d 00 16 18 2a 7c 53  74 61 72 74 20 50 52 4f  |.....*|Start PRO|
000001b0  43 73 68 65 6c 6c 5f 4f  4b 0d 00 17 13 dd 20 f2  |Cshell_OK..... .|
000001c0  73 68 65 6c 6c 5f 4f 4b  28 65 24 29 0d 00 18 12  |shell_OK(e$)....|
000001d0  5f 65 72 72 6f 72 5f 66  6c 61 67 25 3d 31 0d 00  |_error_flag%=1..|
000001e0  19 0a 85 20 31 2c 65 24  0d 00 1a 05 e1 0d 00 1b  |... 1,e$........|
000001f0  05 3a 0d 00 1c 17 2a 7c  53 74 6f 70 20 50 52 4f  |.:....*|Stop PRO|
00000200  43 73 68 65 6c 6c 5f 4f  4b 0d 00 1d 1e 2a 7c 53  |Cshell_OK....*|S|
00000210  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 45  |tart PROCshell_E|
00000220  72 72 6f 72 42 6f 78 0d  00 1e 19 dd 20 f2 73 68  |rrorBox..... .sh|
00000230  65 6c 6c 5f 45 72 72 6f  72 42 6f 78 28 72 24 29  |ell_ErrorBox(r$)|
00000240  0d 00 1f 11 ea 20 72 25  2c 65 72 72 5f 62 6c 6b  |..... r%,err_blk|
00000250  25 0d 00 20 27 65 72 72  5f 62 6c 6b 25 3d a4 73  |%.. 'err_blk%=.s|
00000260  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 46 65  |hell_HeapBlockFe|
00000270  74 63 68 28 32 36 30 29  0d 00 21 25 21 65 72 72  |tch(260)..!%!err|
00000280  5f 62 6c 6b 25 3d 9f 3a  24 28 65 72 72 5f 62 6c  |_blk%=.:$(err_bl|
00000290  6b 25 2b 34 29 3d 72 24  2b bd 28 30 29 0d 00 22  |k%+4)=r$+.(0).."|
000002a0  46 c8 99 20 22 57 69 6d  70 5f 52 65 70 6f 72 74  |F.. "Wimp_Report|
000002b0  45 72 72 6f 72 22 2c 65  72 72 5f 62 6c 6b 25 2c  |Error",err_blk%,|
000002c0  5f 65 72 72 6f 72 5f 66  6c 61 67 25 2c a4 73 68  |_error_flag%,.sh|
000002d0  65 6c 6c 5f 47 65 74 41  70 70 4e 61 6d 65 20 b8  |ell_GetAppName .|
000002e0  20 72 25 0d 00 23 1a e7  20 72 25 3d 32 20 8c 20  | r%..#.. r%=2 . |
000002f0  5f 63 6c 6f 73 65 64 6f  77 6e 25 3d b9 0d 00 24  |_closedown%=...$|
00000300  24 f2 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |$.shell_HeapBloc|
00000310  6b 52 65 74 75 72 6e 28  65 72 72 5f 62 6c 6b 25  |kReturn(err_blk%|
00000320  29 0d 00 25 05 e1 0d 00  26 05 3a 0d 00 27 1d 2a  |)..%....&.:..'.*|
00000330  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
00000340  45 72 72 6f 72 42 6f 78  0d 00 28 29 2a 7c 53 74  |ErrorBox..()*|St|
00000350  61 72 74 20 46 4e 73 68  65 6c 6c 5f 47 65 74 4c  |art FNshell_GetL|
00000360  61 73 74 53 65 63 75 72  65 46 69 6c 65 4e 61 6d  |astSecureFileNam|
00000370  65 0d 00 29 22 dd 20 a4  73 68 65 6c 6c 5f 47 65  |e..)". .shell_Ge|
00000380  74 4c 61 73 74 53 65 63  75 72 65 46 69 6c 65 4e  |tLastSecureFileN|
00000390  61 6d 65 0d 00 2a 0b ea  20 74 65 6d 70 25 0d 00  |ame..*.. temp%..|
000003a0  2b 10 74 65 6d 70 25 3d  5f 55 25 21 38 30 0d 00  |+.temp%=_U%!80..|
000003b0  2c 13 e7 20 74 65 6d 70  25 3d 30 20 8c 20 3d 22  |,.. temp%=0 . ="|
000003c0  22 0d 00 2d 0b 3d 24 74  65 6d 70 25 0d 00 2e 05  |"..-.=$temp%....|
000003d0  3a 0d 00 2f 28 2a 7c 53  74 6f 70 20 46 4e 73 68  |:../(*|Stop FNsh|
000003e0  65 6c 6c 5f 47 65 74 4c  61 73 74 53 65 63 75 72  |ell_GetLastSecur|
000003f0  65 46 69 6c 65 4e 61 6d  65 0d 00 30 1d 2a 7c 53  |eFileName..0.*|S|
00000400  74 61 72 74 20 46 4e 73  68 65 6c 6c 5f 47 65 74  |tart FNshell_Get|
00000410  53 74 72 69 6e 67 0d 00  31 20 dd 20 a4 73 68 65  |String..1 . .she|
00000420  6c 6c 5f 47 65 74 53 74  72 69 6e 67 28 41 64 64  |ll_GetString(Add|
00000430  72 65 73 73 25 29 0d 00  32 12 ea 20 53 74 72 69  |ress%)..2.. Stri|
00000440  6e 67 24 2c 4c 65 6e 25  0d 00 33 26 c8 95 20 28  |ng$,Len%..3&.. (|
00000450  28 41 64 64 72 65 73 73  25 3f 4c 65 6e 25 29 3e  |(Address%?Len%)>|
00000460  33 31 20 80 20 4c 65 6e  25 3c 32 35 35 29 0d 00  |31 . Len%<255)..|
00000470  34 1f 20 20 53 74 72 69  6e 67 24 2b 3d bd 28 41  |4.  String$+=.(A|
00000480  64 64 72 65 73 73 25 3f  4c 65 6e 25 29 0d 00 35  |ddress%?Len%)..5|
00000490  0d 20 20 4c 65 6e 25 2b  3d 31 0d 00 36 05 ce 0d  |.  Len%+=1..6...|
000004a0  00 37 0c 3d 53 74 72 69  6e 67 24 0d 00 38 05 3a  |.7.=String$..8.:|
000004b0  0d 00 39 1c 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |..9.*|Stop FNshe|
000004c0  6c 6c 5f 47 65 74 53 74  72 69 6e 67 0d 00 3a 23  |ll_GetString..:#|
000004d0  2a 7c 53 74 61 72 74 20  46 4e 73 68 65 6c 6c 5f  |*|Start FNshell_|
000004e0  47 65 74 45 76 65 6e 74  48 61 6e 64 6c 65 72 0d  |GetEventHandler.|
000004f0  00 3b 2d dd 20 a4 73 68  65 6c 6c 5f 47 65 74 45  |.;-. .shell_GetE|
00000500  76 65 6e 74 48 61 6e 64  6c 65 72 28 77 68 25 2c  |ventHandler(wh%,|
00000510  69 63 25 2c 65 5f 74 79  70 65 25 29 0d 00 3c 2c  |ic%,e_type%)..<,|
00000520  ea 20 70 74 72 25 2c 65  76 65 6e 74 5f 6c 69 73  |. ptr%,event_lis|
00000530  74 25 2c 66 6f 75 6e 64  25 2c 6c 69 73 74 5f 73  |t%,found%,list_s|
00000540  69 7a 65 25 2c 66 6e 24  0d 00 3d 15 e7 20 77 68  |ize%,fn$..=.. wh|
00000550  25 3d 2d 31 20 8c 20 77  68 25 3d 2d 32 0d 00 3e  |%=-1 . wh%=-2..>|
00000560  2d 6c 69 73 74 5f 73 69  7a 65 25 3d a4 73 68 65  |-list_size%=.she|
00000570  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 49 6e 66 6f  |ll_HeapBlockInfo|
00000580  28 5f 55 25 21 31 32 29  2d 38 0d 00 3f 0a 70 74  |(_U%!12)-8..?.pt|
00000590  72 25 3d 30 0d 00 40 0c  66 6f 75 6e 64 25 3d a3  |r%=0..@.found%=.|
000005a0  0d 00 41 16 65 76 65 6e  74 5f 6c 69 73 74 25 3d  |..A.event_list%=|
000005b0  5f 55 25 21 31 32 0d 00  42 0a 66 6e 24 3d 22 22  |_U%!12..B.fn$=""|
000005c0  0d 00 43 05 f5 0d 00 44  20 20 20 e7 20 28 65 76  |..C....D   . (ev|
000005d0  65 6e 74 5f 6c 69 73 74  25 21 70 74 72 25 3d 77  |ent_list%!ptr%=w|
000005e0  68 25 29 20 8c 0d 00 45  21 20 20 20 20 c8 8e 20  |h%) ...E!    .. |
000005f0  65 76 65 6e 74 5f 6c 69  73 74 25 21 28 70 74 72  |event_list%!(ptr|
00000600  25 2b 34 29 20 ca 0d 00  46 0c 20 20 20 20 c9 20  |%+4) ...F.    . |
00000610  2d 31 0d 00 47 32 20 20  20 20 20 20 f4 20 77 69  |-1..G2      . wi|
00000620  6e 64 6f 77 20 68 61 6e  64 6c 65 20 66 6f 75 6e  |ndow handle foun|
00000630  64 2c 20 69 63 6f 6e 20  68 61 6e 64 6c 65 20 69  |d, icon handle i|
00000640  73 20 2d 31 0d 00 48 41  20 20 20 20 20 20 f4 20  |s -1..HA      . |
00000650  63 68 65 63 6b 20 74 68  61 74 20 61 20 70 6f 69  |check that a poi|
00000660  6e 74 65 72 20 68 61 73  20 62 65 65 6e 20 64 65  |nter has been de|
00000670  66 69 6e 65 64 20 74 6f  20 61 20 68 65 61 70 20  |fined to a heap |
00000680  62 6c 6f 63 6b 0d 00 49  40 20 20 20 20 20 20 f4  |block..I@      .|
00000690  20 63 6f 6e 74 61 69 6e  69 6e 67 20 61 20 66 75  | containing a fu|
000006a0  6e 63 74 69 6f 6e 20 6e  61 6d 65 20 28 69 66 20  |nction name (if |
000006b0  69 74 20 69 73 20 30 20  74 68 65 6e 20 6e 6f 20  |it is 0 then no |
000006c0  65 76 65 6e 74 0d 00 4a  17 20 20 20 20 20 20 f4  |event..J.      .|
000006d0  20 64 65 66 69 6e 65 64  29 2e 2e 2e 0d 00 4b 37  | defined).....K7|
000006e0  20 20 20 20 20 20 e7 20  65 76 65 6e 74 5f 6c 69  |      . event_li|
000006f0  73 74 25 21 28 70 74 72  25 2b 28 31 32 2b 28 65  |st%!(ptr%+(12+(e|
00000700  5f 74 79 70 65 25 2a 34  29 29 29 3e 26 38 30 30  |_type%*4)))>&800|
00000710  30 20 8c 0d 00 4c 36 20  20 20 20 20 20 20 20 66  |0 ...L6        f|
00000720  6e 24 3d 24 28 65 76 65  6e 74 5f 6c 69 73 74 25  |n$=$(event_list%|
00000730  21 28 70 74 72 25 2b 28  31 32 2b 28 65 5f 74 79  |!(ptr%+(12+(e_ty|
00000740  70 65 25 2a 34 29 29 29  29 0d 00 4d 14 20 20 20  |pe%*4))))..M.   |
00000750  20 20 20 20 20 66 6f 75  6e 64 25 3d b9 0d 00 4e  |     found%=...N|
00000760  0b 20 20 20 20 20 20 cc  0d 00 4f 14 20 20 20 20  |.      ...O.    |
00000770  20 20 20 20 70 74 72 25  2b 3d 34 38 0d 00 50 0b  |    ptr%+=48..P.|
00000780  20 20 20 20 20 20 cd 0d  00 51 09 20 20 20 20 7f  |      ...Q.    .|
00000790  0d 00 52 37 20 20 20 20  20 20 f4 20 63 68 65 63  |..R7      . chec|
000007a0  6b 20 69 63 6f 6e 20 68  61 6e 64 6c 65 20 69 6e  |k icon handle in|
000007b0  20 65 76 65 6e 74 20 62  6c 6f 63 6b 20 61 73 20  | event block as |
000007c0  77 65 6c 6c 2e 2e 2e 0d  00 53 26 20 20 20 20 20  |well.....S&     |
000007d0  20 e7 20 65 76 65 6e 74  5f 6c 69 73 74 25 21 28  | . event_list%!(|
000007e0  70 74 72 25 2b 34 29 3d  69 63 25 20 8c 0d 00 54  |ptr%+4)=ic% ...T|
000007f0  35 20 20 20 20 20 20 20  20 f4 20 77 69 6e 64 6f  |5        . windo|
00000800  77 2f 69 63 6f 6e 20 68  61 6e 64 6c 65 20 65 76  |w/icon handle ev|
00000810  65 6e 74 20 62 6c 6f 63  6b 20 66 6f 75 6e 64 2e  |ent block found.|
00000820  2e 2e 0d 00 55 43 20 20  20 20 20 20 20 20 f4 20  |....UC        . |
00000830  63 68 65 63 6b 20 74 68  61 74 20 61 20 70 6f 69  |check that a poi|
00000840  6e 74 65 72 20 68 61 73  20 62 65 65 6e 20 64 65  |nter has been de|
00000850  66 69 6e 65 64 20 74 6f  20 61 20 68 65 61 70 20  |fined to a heap |
00000860  62 6c 6f 63 6b 0d 00 56  42 20 20 20 20 20 20 20  |block..VB       |
00000870  20 f4 20 63 6f 6e 74 61  69 6e 69 6e 67 20 61 20  | . containing a |
00000880  66 75 6e 63 74 69 6f 6e  20 6e 61 6d 65 20 28 69  |function name (i|
00000890  66 20 69 74 20 69 73 20  30 20 74 68 65 6e 20 6e  |f it is 0 then n|
000008a0  6f 20 65 76 65 6e 74 0d  00 57 19 20 20 20 20 20  |o event..W.     |
000008b0  20 20 20 f4 20 64 65 66  69 6e 65 64 29 2e 2e 2e  |   . defined)...|
000008c0  0d 00 58 39 20 20 20 20  20 20 20 20 e7 20 65 76  |..X9        . ev|
000008d0  65 6e 74 5f 6c 69 73 74  25 21 28 70 74 72 25 2b  |ent_list%!(ptr%+|
000008e0  28 31 32 2b 28 65 5f 74  79 70 65 25 2a 34 29 29  |(12+(e_type%*4))|
000008f0  29 3e 26 38 30 30 30 20  8c 0d 00 59 38 20 20 20  |)>&8000 ...Y8   |
00000900  20 20 20 20 20 20 20 66  6e 24 3d 24 28 65 76 65  |       fn$=$(eve|
00000910  6e 74 5f 6c 69 73 74 25  21 28 70 74 72 25 2b 28  |nt_list%!(ptr%+(|
00000920  31 32 2b 28 65 5f 74 79  70 65 25 2a 34 29 29 29  |12+(e_type%*4)))|
00000930  29 0d 00 5a 16 20 20 20  20 20 20 20 20 20 20 66  |)..Z.          f|
00000940  6f 75 6e 64 25 3d b9 0d  00 5b 0d 20 20 20 20 20  |ound%=...[.     |
00000950  20 20 20 cc 0d 00 5c 16  20 20 20 20 20 20 20 20  |   ...\.        |
00000960  20 20 70 74 72 25 2b 3d  34 38 0d 00 5d 0d 20 20  |  ptr%+=48..].  |
00000970  20 20 20 20 20 20 cd 0d  00 5e 0b 20 20 20 20 20  |      ...^.     |
00000980  20 cc 0d 00 5f 14 20 20  20 20 20 20 20 20 70 74  | ..._.        pt|
00000990  72 25 2b 3d 34 38 0d 00  60 0b 20 20 20 20 20 20  |r%+=48..`.      |
000009a0  cd 0d 00 61 09 20 20 20  20 cb 0d 00 62 07 20 20  |...a.    ...b.  |
000009b0  cc 0d 00 63 10 20 20 20  20 70 74 72 25 2b 3d 34  |...c.    ptr%+=4|
000009c0  38 0d 00 64 07 20 20 cd  0d 00 65 23 fd 20 28 28  |8..d.  ...e#. ((|
000009d0  70 74 72 25 3e 3d 6c 69  73 74 5f 73 69 7a 65 25  |ptr%>=list_size%|
000009e0  29 20 84 20 66 6f 75 6e  64 25 29 0d 00 66 08 3d  |) . found%)..f.=|
000009f0  66 6e 24 0d 00 67 05 3a  0d 00 68 22 2a 7c 53 74  |fn$..g.:..h"*|St|
00000a00  6f 70 20 46 4e 73 68 65  6c 6c 5f 47 65 74 45 76  |op FNshell_GetEv|
00000a10  65 6e 74 48 61 6e 64 6c  65 72 0d 00 69 04 0d 00  |entHandler..i...|
00000a20  6a 20 2a 7c 53 74 61 72  74 20 46 4e 73 68 65 6c  |j *|Start FNshel|
00000a30  6c 5f 47 65 74 45 76 65  6e 74 4d 65 6e 75 0d 00  |l_GetEventMenu..|
00000a40  6b 2a dd 20 a4 73 68 65  6c 6c 5f 47 65 74 45 76  |k*. .shell_GetEv|
00000a50  65 6e 74 4d 65 6e 75 28  62 75 74 74 6f 6e 25 2c  |entMenu(button%,|
00000a60  77 68 25 2c 69 63 25 29  0d 00 6c 2e ea 20 70 74  |wh%,ic%)..l.. pt|
00000a70  72 25 2c 65 76 65 6e 74  5f 6c 69 73 74 25 2c 66  |r%,event_list%,f|
00000a80  6f 75 6e 64 25 2c 6c 69  73 74 5f 73 69 7a 65 25  |ound%,list_size%|
00000a90  2c 6d 65 6e 75 25 0d 00  6d 15 e7 20 77 68 25 3d  |,menu%..m.. wh%=|
00000aa0  2d 31 20 8c 20 77 68 25  3d 2d 32 0d 00 6e 2d 6c  |-1 . wh%=-2..n-l|
00000ab0  69 73 74 5f 73 69 7a 65  25 3d a4 73 68 65 6c 6c  |ist_size%=.shell|
00000ac0  5f 48 65 61 70 42 6c 6f  63 6b 49 6e 66 6f 28 5f  |_HeapBlockInfo(_|
00000ad0  55 25 21 31 32 29 2d 38  0d 00 6f 0a 70 74 72 25  |U%!12)-8..o.ptr%|
00000ae0  3d 30 0d 00 70 0c 66 6f  75 6e 64 25 3d a3 0d 00  |=0..p.found%=...|
00000af0  71 16 65 76 65 6e 74 5f  6c 69 73 74 25 3d 5f 55  |q.event_list%=_U|
00000b00  25 21 31 32 0d 00 72 0a  66 6e 24 3d 22 22 0d 00  |%!12..r.fn$=""..|
00000b10  73 05 f5 0d 00 74 20 20  20 e7 20 28 65 76 65 6e  |s....t   . (even|
00000b20  74 5f 6c 69 73 74 25 21  70 74 72 25 3d 77 68 25  |t_list%!ptr%=wh%|
00000b30  29 20 8c 0d 00 75 26 20  20 20 20 e7 20 65 76 65  |) ...u&    . eve|
00000b40  6e 74 5f 6c 69 73 74 25  21 28 70 74 72 25 2b 34  |nt_list%!(ptr%+4|
00000b50  29 20 3d 20 69 63 25 20  8c 0d 00 76 24 20 20 20  |) = ic% ...v$   |
00000b60  20 20 20 6d 65 6e 75 25  3d 65 76 65 6e 74 5f 6c  |   menu%=event_l|
00000b70  69 73 74 25 21 28 70 74  72 25 2b 38 29 0d 00 77  |ist%!(ptr%+8)..w|
00000b80  24 20 20 20 20 20 20 e7  20 6d 65 6e 75 25 3d 2d  |$      . menu%=-|
00000b90  32 20 8c 20 6d 65 6e 75  25 3d 5f 55 25 21 32 35  |2 . menu%=_U%!25|
00000ba0  32 0d 00 78 12 20 20 20  20 20 20 66 6f 75 6e 64  |2..x.      found|
00000bb0  25 3d b9 0d 00 79 09 20  20 20 20 cc 0d 00 7a 27  |%=...y.    ...z'|
00000bc0  20 20 20 20 20 20 e7 20  65 76 65 6e 74 5f 6c 69  |      . event_li|
00000bd0  73 74 25 21 28 70 74 72  25 2b 34 29 20 3d 20 2d  |st%!(ptr%+4) = -|
00000be0  31 20 8c 0d 00 7b 19 20  20 20 20 20 20 20 20 e7  |1 ...{.        .|
00000bf0  20 62 75 74 74 6f 6e 25  3d 32 20 8c 0d 00 7c 28  | button%=2 ...|(|
00000c00  20 20 20 20 20 20 20 20  20 20 6d 65 6e 75 25 3d  |          menu%=|
00000c10  65 76 65 6e 74 5f 6c 69  73 74 25 21 28 70 74 72  |event_list%!(ptr|
00000c20  25 2b 38 29 0d 00 7d 28  20 20 20 20 20 20 20 20  |%+8)..}(        |
00000c30  20 20 e7 20 6d 65 6e 75  25 3d 2d 32 20 8c 20 6d  |  . menu%=-2 . m|
00000c40  65 6e 75 25 3d 5f 55 25  21 32 35 32 0d 00 7e 16  |enu%=_U%!252..~.|
00000c50  20 20 20 20 20 20 20 20  20 20 66 6f 75 6e 64 25  |          found%|
00000c60  3d b9 0d 00 7f 0d 20 20  20 20 20 20 20 20 cc 0d  |=.....        ..|
00000c70  00 80 16 20 20 20 20 20  20 20 20 20 20 70 74 72  |...          ptr|
00000c80  25 2b 3d 34 38 0d 00 81  0d 20 20 20 20 20 20 20  |%+=48....       |
00000c90  20 cd 0d 00 82 0b 20 20  20 20 20 20 cc 0d 00 83  | .....      ....|
00000ca0  14 20 20 20 20 20 20 20  20 70 74 72 25 2b 3d 34  |.        ptr%+=4|
00000cb0  38 0d 00 84 0b 20 20 20  20 20 20 cd 0d 00 85 09  |8....      .....|
00000cc0  20 20 20 20 cd 0d 00 86  07 20 20 cc 0d 00 87 10  |    .....  .....|
00000cd0  20 20 20 20 70 74 72 25  2b 3d 34 38 0d 00 88 07  |    ptr%+=48....|
00000ce0  20 20 cd 0d 00 89 21 fd  20 28 70 74 72 25 3e 3d  |  ....!. (ptr%>=|
00000cf0  6c 69 73 74 5f 73 69 7a  65 25 20 84 20 66 6f 75  |list_size% . fou|
00000d00  6e 64 25 29 0d 00 8a 0a  3d 6d 65 6e 75 25 0d 00  |nd%)....=menu%..|
00000d10  8b 05 3a 0d 00 8c 1f 2a  7c 53 74 6f 70 20 46 4e  |..:....*|Stop FN|
00000d20  73 68 65 6c 6c 5f 47 65  74 45 76 65 6e 74 4d 65  |shell_GetEventMe|
00000d30  6e 75 0d 00 8d 04 0d 00  8e 26 2a 7c 53 74 61 72  |nu.......&*|Star|
00000d40  74 20 46 4e 73 68 65 6c  6c 5f 47 65 74 45 76 65  |t FNshell_GetEve|
00000d50  6e 74 4c 69 73 74 4f 66  66 73 65 74 0d 00 8f 43  |ntListOffset...C|
00000d60  dd 20 a4 73 68 65 6c 6c  5f 47 65 74 45 76 65 6e  |. .shell_GetEven|
00000d70  74 4c 69 73 74 4f 66 66  73 65 74 28 77 68 25 2c  |tListOffset(wh%,|
00000d80  69 68 25 2c 65 76 65 6e  74 5f 6c 69 73 74 25 2c  |ih%,event_list%,|
00000d90  72 65 63 5f 73 69 7a 65  25 2c 61 64 64 25 29 0d  |rec_size%,add%).|
00000da0  00 90 43 f4 20 66 69 6e  64 20 6f 66 66 73 65 74  |..C. find offset|
00000db0  20 6f 66 20 64 61 74 61  20 69 6e 20 65 76 65 6e  | of data in even|
00000dc0  74 20 6c 69 73 74 20 62  6c 6f 63 6b 20 67 69 76  |t list block giv|
00000dd0  65 6e 20 74 68 65 20 77  69 6e 64 6f 77 2f 69 63  |en the window/ic|
00000de0  6f 6e 0d 00 91 49 f4 20  68 61 6e 64 6c 65 73 2e  |on...I. handles.|
00000df0  20 72 65 74 75 72 6e 73  20 2d 31 20 69 66 20 6e  | returns -1 if n|
00000e00  6f 20 65 76 65 6e 74 73  20 66 6f 75 6e 64 2c 20  |o events found, |
00000e10  2d 32 20 69 66 20 68 65  61 70 62 6c 6f 63 6b 20  |-2 if heapblock |
00000e20  6e 6f 74 20 64 65 66 69  6e 65 64 0d 00 92 4a f4  |not defined...J.|
00000e30  20 69 66 20 61 64 64 25  20 69 73 20 46 41 4c 53  | if add% is FALS|
00000e40  45 2e 20 77 68 65 6e 20  61 64 64 20 69 73 20 54  |E. when add is T|
00000e50  52 55 45 20 74 68 65 6e  20 74 68 65 20 6c 69 73  |RUE then the lis|
00000e60  74 20 69 73 20 65 78 74  65 6e 64 65 64 20 61 6e  |t is extended an|
00000e70  64 20 74 68 65 0d 00 93  2b f4 20 6f 66 66 73 65  |d the...+. offse|
00000e80  74 20 74 6f 20 74 68 65  20 6e 65 77 20 72 65 63  |t to the new rec|
00000e90  6f 72 64 20 69 73 20 72  65 74 75 72 6e 65 64 2e  |ord is returned.|
00000ea0  0d 00 94 31 ea 20 6c 69  73 74 5f 73 69 7a 65 25  |...1. list_size%|
00000eb0  2c 70 74 72 25 2c 66 6f  75 6e 64 25 2c 6f 66 66  |,ptr%,found%,off|
00000ec0  73 65 74 25 2c 65 6d 70  74 79 25 2c 74 65 6d 70  |set%,empty%,temp|
00000ed0  25 0d 00 95 3c e7 20 28  21 65 76 65 6e 74 5f 6c  |%...<. (!event_l|
00000ee0  69 73 74 25 3d 30 20 80  20 61 64 64 25 3d a3 29  |ist%=0 . add%=.)|
00000ef0  20 8c 20 3d 2d 32 3a f4  20 6e 6f 20 68 65 61 70  | . =-2:. no heap|
00000f00  62 6c 6f 63 6b 20 64 65  66 69 6e 65 64 0d 00 96  |block defined...|
00000f10  18 e7 20 28 21 65 76 65  6e 74 5f 6c 69 73 74 25  |.. (!event_list%|
00000f20  3d 30 29 20 8c 0d 00 97  35 20 20 f4 20 6e 6f 20  |=0) ....5  . no |
00000f30  68 65 61 70 20 62 6c 6f  63 6b 20 64 65 66 69 6e  |heap block defin|
00000f40  65 64 20 61 6e 64 20 61  64 64 20 66 6c 61 67 20  |ed and add flag |
00000f50  69 73 20 74 72 75 65 2e  2e 2e 0d 00 98 33 20 20  |is true......3  |
00000f60  21 65 76 65 6e 74 5f 6c  69 73 74 25 3d a4 73 68  |!event_list%=.sh|
00000f70  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
00000f80  63 68 28 72 65 63 5f 73  69 7a 65 25 29 0d 00 99  |ch(rec_size%)...|
00000f90  2c 20 20 74 65 6d 70 25  3d 21 65 76 65 6e 74 5f  |,  temp%=!event_|
00000fa0  6c 69 73 74 25 3a 74 65  6d 70 25 21 30 3d 30 3a  |list%:temp%!0=0:|
00000fb0  74 65 6d 70 25 21 34 3d  30 0d 00 9a 08 20 20 3d  |temp%!4=0....  =|
00000fc0  30 0d 00 9b 05 cd 0d 00  9c 33 6c 69 73 74 5f 73  |0........3list_s|
00000fd0  69 7a 65 25 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |ize%=.shell_Heap|
00000fe0  42 6c 6f 63 6b 49 6e 66  6f 28 21 65 76 65 6e 74  |BlockInfo(!event|
00000ff0  5f 6c 69 73 74 25 29 2d  38 0d 00 9d 28 70 74 72  |_list%)-8...(ptr|
00001000  25 3d 30 3a 66 6f 75 6e  64 25 3d a3 3a 6f 66 66  |%=0:found%=.:off|
00001010  73 65 74 25 3d 2d 31 3a  65 6d 70 74 79 25 3d 2d  |set%=-1:empty%=-|
00001020  31 0d 00 9e 16 74 65 6d  70 25 3d 21 65 76 65 6e  |1....temp%=!even|
00001030  74 5f 6c 69 73 74 25 0d  00 9f 05 f5 0d 00 a0 4f  |t_list%........O|
00001040  20 20 f4 20 50 52 4f 43  73 68 65 6c 6c 5f 54 72  |  . PROCshell_Tr|
00001050  61 63 65 66 30 28 22 47  65 74 45 76 65 6e 74 4c  |acef0("GetEventL|
00001060  69 73 74 4f 66 66 73 65  74 3a 77 69 6e 64 6f 77  |istOffset:window|
00001070  20 68 61 6e 64 6c 65 3d  26 22 2b 53 54 52 24 7e  | handle=&"+STR$~|
00001080  74 65 6d 70 25 21 70 74  72 25 29 0d 00 a1 49 20  |temp%!ptr%)...I |
00001090  20 f4 20 77 68 65 6e 20  73 63 61 6e 6e 69 6e 67  | . when scanning|
000010a0  20 6c 69 73 74 20 6e 6f  74 65 20 6f 66 66 73 65  | list note offse|
000010b0  74 20 6f 66 20 66 69 72  73 74 20 65 6d 70 74 79  |t of first empty|
000010c0  20 72 65 63 6f 72 64 20  66 6f 72 20 75 73 65 20  | record for use |
000010d0  77 68 65 6e 0d 00 a2 45  20 20 f4 20 61 64 64 69  |when...E  . addi|
000010e0  6e 67 20 61 20 6e 65 77  20 65 76 65 6e 74 20 74  |ng a new event t|
000010f0  6f 20 74 68 65 20 6c 69  73 74 2e 20 45 6d 70 74  |o the list. Empt|
00001100  79 20 72 65 63 6f 72 64  73 20 68 61 76 65 20 30  |y records have 0|
00001110  20 66 6f 72 20 62 6f 74  68 0d 00 a3 1f 20 20 f4  | for both....  .|
00001120  20 77 69 6e 64 6f 77 20  61 6e 64 20 69 63 6f 6e  | window and icon|
00001130  20 68 61 6e 64 6c 65 73  0d 00 a4 12 20 20 e7 20  | handles....  . |
00001140  65 6d 70 74 79 25 3c 30  20 8c 0d 00 a5 37 20 20  |empty%<0 ....7  |
00001150  20 20 e7 20 28 74 65 6d  70 25 21 70 74 72 25 3d  |  . (temp%!ptr%=|
00001160  30 20 80 20 74 65 6d 70  25 21 70 74 72 25 2b 34  |0 . temp%!ptr%+4|
00001170  3d 30 29 20 8c 20 65 6d  70 74 79 25 3d 70 74 72  |=0) . empty%=ptr|
00001180  25 0d 00 a6 07 20 20 cd  0d 00 a7 1a 20 20 e7 20  |%....  .....  . |
00001190  28 74 65 6d 70 25 21 70  74 72 25 3d 77 68 25 29  |(temp%!ptr%=wh%)|
000011a0  20 8c 0d 00 a8 43 20 20  20 20 f4 20 65 76 65 6e  | ....C    . even|
000011b0  74 73 20 61 74 74 61 63  68 65 64 20 74 6f 20 6e  |ts attached to n|
000011c0  6f 20 70 61 72 74 69 63  75 6c 61 72 20 69 63 6f  |o particular ico|
000011d0  6e 20 61 72 65 20 72 65  67 69 73 74 65 72 65 64  |n are registered|
000011e0  20 77 69 74 68 0d 00 a9  1e 20 20 20 20 f4 20 61  | with....    . a|
000011f0  6e 20 69 63 6f 6e 20 68  61 6e 64 6c 65 20 6f 66  |n icon handle of|
00001200  20 2d 31 0d 00 aa 45 20  20 20 20 f4 20 50 52 4f  | -1...E    . PRO|
00001210  43 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |Cshell_Tracef0("|
00001220  47 65 74 45 76 65 6e 74  4c 69 73 74 4f 66 66 73  |GetEventListOffs|
00001230  65 74 3a 77 69 6e 64 6f  77 20 68 61 6e 64 6c 65  |et:window handle|
00001240  20 66 6f 75 6e 64 22 29  0d 00 ab 12 20 20 20 20  | found")....    |
00001250  e7 20 69 68 25 3d 2d 31  20 8c 0d 00 ac 36 20 20  |. ih%=-1 ....6  |
00001260  20 20 20 20 f4 20 69 63  6f 6e 20 68 61 6e 64 6c  |    . icon handl|
00001270  65 20 69 73 20 2d 31 2c  20 73 6f 20 65 76 65 6e  |e is -1, so even|
00001280  74 20 68 61 73 20 62 65  65 6e 20 66 6f 75 6e 64  |t has been found|
00001290  0d 00 ad 45 20 20 20 20  20 20 f4 20 50 52 4f 43  |...E      . PROC|
000012a0  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 47  |shell_Tracef0("G|
000012b0  65 74 45 76 65 6e 74 4c  69 73 74 4f 66 66 73 65  |etEventListOffse|
000012c0  74 3a 69 63 6f 6e 20 68  61 6e 64 6c 65 20 69 73  |t:icon handle is|
000012d0  20 2d 31 22 29 0d 00 ae  16 20 20 20 20 20 20 6f  | -1")....      o|
000012e0  66 66 73 65 74 25 3d 70  74 72 25 0d 00 af 12 20  |ffset%=ptr%.... |
000012f0  20 20 20 20 20 66 6f 75  6e 64 25 3d b9 0d 00 b0  |     found%=....|
00001300  09 20 20 20 20 cc 0d 00  b1 36 20 20 20 20 20 20  |.    ....6      |
00001310  f4 20 63 68 65 63 6b 20  69 63 6f 6e 20 68 61 6e  |. check icon han|
00001320  64 6c 65 20 69 6e 20 65  76 65 6e 74 20 62 6c 6f  |dle in event blo|
00001330  63 6b 20 61 73 20 77 65  6c 6c 2e 2e 0d 00 b2 25  |ck as well.....%|
00001340  20 20 20 20 20 20 2a 7c  69 66 64 65 66 20 50 52  |      *|ifdef PR|
00001350  4f 43 73 68 65 6c 6c 5f  54 72 61 63 65 49 6e 69  |OCshell_TraceIni|
00001360  74 0d 00 b3 44 20 20 20  20 20 20 f2 73 68 65 6c  |t...D      .shel|
00001370  6c 5f 54 72 61 63 65 66  30 28 22 47 65 74 45 76  |l_Tracef0("GetEv|
00001380  65 6e 74 4c 69 73 74 4f  66 66 73 65 74 3a 69 63  |entListOffset:ic|
00001390  6f 6e 20 68 61 6e 64 6c  65 20 69 73 20 6e 6f 74  |on handle is not|
000013a0  20 2d 31 22 29 0d 00 b4  11 20 20 20 20 20 20 2a  | -1")....      *|
000013b0  7c 65 6e 64 69 66 0d 00  b5 20 20 20 20 20 20 20  ||endif...       |
000013c0  e7 20 74 65 6d 70 25 21  28 70 74 72 25 2b 34 29  |. temp%!(ptr%+4)|
000013d0  3d 69 68 25 20 8c 0d 00  b6 1a 20 20 20 20 20 20  |=ih% .....      |
000013e0  20 20 20 20 6f 66 66 73  65 74 25 3d 70 74 72 25  |    offset%=ptr%|
000013f0  0d 00 b7 16 20 20 20 20  20 20 20 20 20 20 66 6f  |....          fo|
00001400  75 6e 64 25 3d b9 0d 00  b8 0b 20 20 20 20 20 20  |und%=.....      |
00001410  cc 0d 00 b9 1b 20 20 20  20 20 20 20 20 70 74 72  |.....        ptr|
00001420  25 2b 3d 72 65 63 5f 73  69 7a 65 25 0d 00 ba 0b  |%+=rec_size%....|
00001430  20 20 20 20 20 20 cd 0d  00 bb 09 20 20 20 20 cd  |      .....    .|
00001440  0d 00 bc 07 20 20 cc 0d  00 bd 29 20 20 20 20 f4  |....  ....)    .|
00001450  20 6e 6f 20 6d 61 74 63  68 2c 20 73 6f 20 63 68  | no match, so ch|
00001460  65 63 6b 20 6e 65 78 74  20 65 76 65 6e 74 2e 2e  |eck next event..|
00001470  0d 00 be 17 20 20 20 20  70 74 72 25 2b 3d 72 65  |....    ptr%+=re|
00001480  63 5f 73 69 7a 65 25 0d  00 bf 07 20 20 cd 0d 00  |c_size%....  ...|
00001490  c0 23 fd 20 28 28 70 74  72 25 3e 3d 6c 69 73 74  |.#. ((ptr%>=list|
000014a0  5f 73 69 7a 65 25 29 20  84 20 66 6f 75 6e 64 25  |_size%) . found%|
000014b0  29 0d 00 c1 0e e7 20 66  6f 75 6e 64 25 20 8c 0d  |)..... found% ..|
000014c0  00 c2 3b 20 20 f4 20 50  52 4f 43 73 68 65 6c 6c  |..;  . PROCshell|
000014d0  5f 54 72 61 63 65 66 30  28 22 47 65 74 45 76 65  |_Tracef0("GetEve|
000014e0  6e 74 4c 69 73 74 4f 66  66 73 65 74 3a 45 76 65  |ntListOffset:Eve|
000014f0  6e 74 20 66 6f 75 6e 64  22 29 0d 00 c3 05 cc 0d  |nt found")......|
00001500  00 c4 53 20 20 f4 20 50  52 4f 43 73 68 65 6c 6c  |..S  . PROCshell|
00001510  5f 54 72 61 63 65 66 30  28 22 47 65 74 45 76 65  |_Tracef0("GetEve|
00001520  6e 74 4c 69 73 74 4f 66  66 73 65 74 3a 45 6e 64  |ntListOffset:End|
00001530  20 6f 66 20 65 76 65 6e  74 20 6c 69 73 74 20 2d  | of event list -|
00001540  20 65 76 65 6e 74 20 6e  6f 74 20 66 6f 75 6e 64  | event not found|
00001550  22 29 0d 00 c5 05 cd 0d  00 c6 1b e7 20 28 6f 66  |").......... (of|
00001560  66 73 65 74 25 3d 2d 31  20 80 20 61 64 64 25 29  |fset%=-1 . add%)|
00001570  20 8c 0d 00 c7 12 20 20  e7 20 65 6d 70 74 79 25  | .....  . empty%|
00001580  3c 30 20 8c 0d 00 c8 37  20 20 20 20 f4 20 6e 6f  |<0 ....7    . no|
00001590  20 65 6d 70 74 79 20 72  65 63 6f 72 64 73 20 66  | empty records f|
000015a0  6f 75 6e 64 20 74 6f 20  75 73 65 20 66 6f 72 20  |ound to use for |
000015b0  74 68 65 20 6e 65 77 20  6f 6e 65 0d 00 c9 1a 20  |the new one.... |
000015c0  20 20 20 6f 66 66 73 65  74 25 3d 6c 69 73 74 5f  |   offset%=list_|
000015d0  73 69 7a 65 25 0d 00 ca  43 20 20 20 20 21 65 76  |size%...C    !ev|
000015e0  65 6e 74 5f 6c 69 73 74  25 3d a4 73 68 65 6c 6c  |ent_list%=.shell|
000015f0  5f 48 65 61 70 42 6c 6f  63 6b 45 78 74 65 6e 64  |_HeapBlockExtend|
00001600  28 21 65 76 65 6e 74 5f  6c 69 73 74 25 2c 72 65  |(!event_list%,re|
00001610  63 5f 73 69 7a 65 25 29  0d 00 cb 1a 20 20 20 20  |c_size%)....    |
00001620  74 65 6d 70 25 3d 21 65  76 65 6e 74 5f 6c 69 73  |temp%=!event_lis|
00001630  74 25 0d 00 cc 2a 20 20  20 20 74 65 6d 70 25 2b  |t%...*    temp%+|
00001640  3d 6f 66 66 73 65 74 25  3a 74 65 6d 70 25 21 30  |=offset%:temp%!0|
00001650  3d 30 3a 74 65 6d 70 25  21 34 3d 30 0d 00 cd 07  |=0:temp%!4=0....|
00001660  20 20 cc 0d 00 ce 22 20  20 20 20 f4 20 72 65 2d  |  ...."    . re-|
00001670  75 73 65 20 6f 6c 64 20  64 65 6c 65 74 65 64 20  |use old deleted |
00001680  65 76 65 6e 74 0d 00 cf  16 20 20 20 20 6f 66 66  |event....    off|
00001690  73 65 74 25 3d 65 6d 70  74 79 25 0d 00 d0 07 20  |set%=empty%.... |
000016a0  20 cd 0d 00 d1 05 cd 0d  00 d2 0c 3d 6f 66 66 73  | ..........=offs|
000016b0  65 74 25 0d 00 d3 05 3a  0d 00 d4 25 2a 7c 53 74  |et%....:...%*|St|
000016c0  6f 70 20 46 4e 73 68 65  6c 6c 5f 47 65 74 45 76  |op FNshell_GetEv|
000016d0  65 6e 74 4c 69 73 74 4f  66 66 73 65 74 0d 00 d5  |entListOffset...|
000016e0  20 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  | *|Start PROCshe|
000016f0  6c 6c 5f 41 74 74 61 63  68 50 61 6e 65 0d 00 d6  |ll_AttachPane...|
00001700  40 dd 20 f2 73 68 65 6c  6c 5f 41 74 74 61 63 68  |@. .shell_Attach|
00001710  50 61 6e 65 28 77 68 25  2c f8 20 70 61 6e 65 5f  |Pane(wh%,. pane_|
00001720  68 61 6e 64 6c 65 25 2c  66 6c 61 67 73 25 2c 78  |handle%,flags%,x|
00001730  5f 6f 66 66 25 2c 79 5f  6f 66 66 25 29 0d 00 d7  |_off%,y_off%)...|
00001740  34 ea 20 62 6c 6b 25 2c  6f 66 66 73 65 74 25 2c  |4. blk%,offset%,|
00001750  74 65 6d 70 25 2c 6e 72  5f 70 61 6e 65 5f 65 76  |temp%,nr_pane_ev|
00001760  65 6e 74 73 25 2c 70 61  6e 65 5f 66 6c 61 67 73  |ents%,pane_flags|
00001770  25 0d 00 d8 37 f2 73 68  65 6c 6c 5f 54 72 61 63  |%...7.shell_Trac|
00001780  65 66 30 28 22 41 74 74  61 63 68 50 61 6e 65 3a  |ef0("AttachPane:|
00001790  41 74 74 61 63 68 69 6e  67 20 50 61 6e 65 20 48  |Attaching Pane H|
000017a0  61 6e 64 6c 65 72 22 29  0d 00 d9 47 f4 20 66 69  |andler")...G. fi|
000017b0  72 73 74 20 63 68 65 63  6b 20 74 68 61 74 20 74  |rst check that t|
000017c0  68 65 20 66 6c 61 67 73  20 6f 66 20 74 68 65 20  |he flags of the |
000017d0  70 61 6e 65 20 77 69 6e  64 6f 77 20 61 72 65 20  |pane window are |
000017e0  63 6f 72 72 65 63 74 6c  79 20 73 65 74 2e 2e 0d  |correctly set...|
000017f0  00 da 33 70 61 6e 65 5f  66 6c 61 67 73 25 3d a4  |..3pane_flags%=.|
00001800  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 47 65 74 46  |shell_WindowGetF|
00001810  6c 61 67 73 28 70 61 6e  65 5f 68 61 6e 64 6c 65  |lags(pane_handle|
00001820  25 29 0d 00 db 1e e7 20  28 70 61 6e 65 5f 66 6c  |%)..... (pane_fl|
00001830  61 67 73 25 20 80 20 31  3c 3c 35 29 3d 30 20 8c  |ags% . 1<<5)=0 .|
00001840  0d 00 dc 51 20 20 f2 73  68 65 6c 6c 5f 54 72 61  |...Q  .shell_Tra|
00001850  63 65 66 30 28 22 41 74  74 61 63 68 50 61 6e 65  |cef0("AttachPane|
00001860  3a 27 50 61 6e 65 27 20  62 69 74 20 6f 66 20 70  |:'Pane' bit of p|
00001870  61 6e 65 20 77 69 6e 64  6f 77 20 69 73 20 6e 6f  |ane window is no|
00001880  74 20 73 65 74 2c 20 66  69 78 69 6e 67 2e 2e 22  |t set, fixing.."|
00001890  29 0d 00 dd 31 20 20 f2  73 68 65 6c 6c 5f 57 69  |)...1  .shell_Wi|
000018a0  6e 64 6f 77 54 6f 67 67  6c 65 46 6c 61 67 73 28  |ndowToggleFlags(|
000018b0  70 61 6e 65 5f 68 61 6e  64 6c 65 25 2c 31 3c 3c  |pane_handle%,1<<|
000018c0  35 29 0d 00 de 05 cd 0d  00 df 1c e7 20 28 70 61  |5).......... (pa|
000018d0  6e 65 5f 66 6c 61 67 73  25 20 80 20 31 3c 3c 31  |ne_flags% . 1<<1|
000018e0  29 20 8c 0d 00 e0 51 20  20 f2 73 68 65 6c 6c 5f  |) ....Q  .shell_|
000018f0  54 72 61 63 65 66 30 28  22 41 74 74 61 63 68 50  |Tracef0("AttachP|
00001900  61 6e 65 3a 27 4d 6f 76  65 61 62 6c 65 27 20 62  |ane:'Moveable' b|
00001910  69 74 20 6f 66 20 70 61  6e 65 20 77 69 6e 64 6f  |it of pane windo|
00001920  77 20 69 73 20 73 65 74  2c 20 66 69 78 69 6e 67  |w is set, fixing|
00001930  2e 2e 22 29 0d 00 e1 31  20 20 f2 73 68 65 6c 6c  |..")...1  .shell|
00001940  5f 57 69 6e 64 6f 77 54  6f 67 67 6c 65 46 6c 61  |_WindowToggleFla|
00001950  67 73 28 70 61 6e 65 5f  68 61 6e 64 6c 65 25 2c  |gs(pane_handle%,|
00001960  31 3c 3c 31 29 0d 00 e2  05 cd 0d 00 e3 39 6f 66  |1<<1)........9of|
00001970  66 73 65 74 25 3d a4 73  68 65 6c 6c 5f 47 65 74  |fset%=.shell_Get|
00001980  45 76 65 6e 74 4c 69 73  74 4f 66 66 73 65 74 28  |EventListOffset(|
00001990  77 68 25 2c 2d 31 2c 5f  55 25 2b 39 32 2c 32 34  |wh%,-1,_U%+92,24|
000019a0  2c a3 29 0d 00 e4 11 e7  20 6f 66 66 73 65 74 25  |,.)..... offset%|
000019b0  3c 30 20 8c 0d 00 e5 24  20 20 f4 20 6e 6f 20 65  |<0 ....$  . no e|
000019c0  78 69 73 74 69 6e 67 20  70 61 6e 65 20 65 76 65  |xisting pane eve|
000019d0  6e 74 20 62 6c 6f 63 6b  0d 00 e6 3c 20 20 f2 73  |nt block...<  .s|
000019e0  68 65 6c 6c 5f 54 72 61  63 65 66 30 28 22 41 74  |hell_Tracef0("At|
000019f0  74 61 63 68 50 61 6e 65  3a 43 72 65 61 74 69 6e  |tachPane:Creatin|
00001a00  67 20 70 61 6e 65 20 65  76 65 6e 74 20 62 6c 6f  |g pane event blo|
00001a10  63 6b 22 29 0d 00 e7 3b  20 20 6f 66 66 73 65 74  |ck")...;  offset|
00001a20  25 3d a4 73 68 65 6c 6c  5f 47 65 74 45 76 65 6e  |%=.shell_GetEven|
00001a30  74 4c 69 73 74 4f 66 66  73 65 74 28 77 68 25 2c  |tListOffset(wh%,|
00001a40  2d 31 2c 5f 55 25 2b 39  32 2c 32 34 2c b9 29 0d  |-1,_U%+92,24,.).|
00001a50  00 e8 19 20 20 62 6c 6b  25 3d 5f 55 25 21 39 32  |...  blk%=_U%!92|
00001a60  2b 6f 66 66 73 65 74 25  0d 00 e9 1a 20 20 62 6c  |+offset%....  bl|
00001a70  6b 25 21 30 3d 77 68 25  3a 62 6c 6b 25 21 34 3d  |k%!0=wh%:blk%!4=|
00001a80  2d 31 0d 00 ea 25 20 20  62 6c 6b 25 21 38 3d a4  |-1...%  blk%!8=.|
00001a90  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
00001aa0  65 74 63 68 28 34 29 0d  00 eb 26 20 20 62 6c 6b  |etch(4)...&  blk|
00001ab0  25 21 31 32 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |%!12=.shell_Heap|
00001ac0  42 6c 6f 63 6b 46 65 74  63 68 28 34 29 0d 00 ec  |BlockFetch(4)...|
00001ad0  26 20 20 62 6c 6b 25 21  31 36 3d a4 73 68 65 6c  |&  blk%!16=.shel|
00001ae0  6c 5f 48 65 61 70 42 6c  6f 63 6b 46 65 74 63 68  |l_HeapBlockFetch|
00001af0  28 34 29 0d 00 ed 26 20  20 62 6c 6b 25 21 32 30  |(4)...&  blk%!20|
00001b00  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
00001b10  6b 46 65 74 63 68 28 34  29 0d 00 ee 1c 20 20 74  |kFetch(4)....  t|
00001b20  65 6d 70 25 3d 62 6c 6b  25 21 38 3a 21 74 65 6d  |emp%=blk%!8:!tem|
00001b30  70 25 3d 2d 31 0d 00 ef  1d 20 20 74 65 6d 70 25  |p%=-1....  temp%|
00001b40  3d 62 6c 6b 25 21 31 32  3a 21 74 65 6d 70 25 3d  |=blk%!12:!temp%=|
00001b50  2d 31 0d 00 f0 1d 20 20  74 65 6d 70 25 3d 62 6c  |-1....  temp%=bl|
00001b60  6b 25 21 31 36 3a 21 74  65 6d 70 25 3d 2d 31 0d  |k%!16:!temp%=-1.|
00001b70  00 f1 1d 20 20 74 65 6d  70 25 3d 62 6c 6b 25 21  |...  temp%=blk%!|
00001b80  32 30 3a 21 74 65 6d 70  25 3d 2d 31 0d 00 f2 05  |20:!temp%=-1....|
00001b90  cd 0d 00 f3 17 62 6c 6b  25 3d 5f 55 25 21 39 32  |.....blk%=_U%!92|
00001ba0  2b 6f 66 66 73 65 74 25  0d 00 f4 29 74 65 6d 70  |+offset%...)temp|
00001bb0  25 3d 62 6c 6b 25 21 38  3a 63 74 72 25 3d 30 3a  |%=blk%!8:ctr%=0:|
00001bc0  6e 72 5f 70 61 6e 65 5f  65 76 65 6e 74 73 25 3d  |nr_pane_events%=|
00001bd0  30 0d 00 f5 15 c8 95 20  74 65 6d 70 25 21 63 74  |0...... temp%!ct|
00001be0  72 25 3c 3e 2d 31 0d 00  f6 0d 20 20 63 74 72 25  |r%<>-1....  ctr%|
00001bf0  2b 3d 34 0d 00 f7 18 20  20 6e 72 5f 70 61 6e 65  |+=4....  nr_pane|
00001c00  5f 65 76 65 6e 74 73 25  2b 3d 31 0d 00 f8 05 ce  |_events%+=1.....|
00001c10  0d 00 f9 2b 62 6c 6b 25  21 38 3d a4 73 68 65 6c  |...+blk%!8=.shel|
00001c20  6c 5f 48 65 61 70 42 6c  6f 63 6b 45 78 74 65 6e  |l_HeapBlockExten|
00001c30  64 28 62 6c 6b 25 21 38  2c 34 29 0d 00 fa 37 74  |d(blk%!8,4)...7t|
00001c40  65 6d 70 25 3d 62 6c 6b  25 21 38 3a 74 65 6d 70  |emp%=blk%!8:temp|
00001c50  25 21 28 6e 72 5f 70 61  6e 65 5f 65 76 65 6e 74  |%!(nr_pane_event|
00001c60  73 25 2a 34 29 3d 70 61  6e 65 5f 68 61 6e 64 6c  |s%*4)=pane_handl|
00001c70  65 25 0d 00 fb 24 74 65  6d 70 25 21 28 28 6e 72  |e%...$temp%!((nr|
00001c80  5f 70 61 6e 65 5f 65 76  65 6e 74 73 25 2b 31 29  |_pane_events%+1)|
00001c90  2a 34 29 3d 2d 31 0d 00  fc 2d 62 6c 6b 25 21 31  |*4)=-1...-blk%!1|
00001ca0  32 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |2=.shell_HeapBlo|
00001cb0  63 6b 45 78 74 65 6e 64  28 62 6c 6b 25 21 31 32  |ckExtend(blk%!12|
00001cc0  2c 34 29 0d 00 fd 32 74  65 6d 70 25 3d 62 6c 6b  |,4)...2temp%=blk|
00001cd0  25 21 31 32 3a 74 65 6d  70 25 21 28 6e 72 5f 70  |%!12:temp%!(nr_p|
00001ce0  61 6e 65 5f 65 76 65 6e  74 73 25 2a 34 29 3d 66  |ane_events%*4)=f|
00001cf0  6c 61 67 73 25 0d 00 fe  24 74 65 6d 70 25 21 28  |lags%...$temp%!(|
00001d00  28 6e 72 5f 70 61 6e 65  5f 65 76 65 6e 74 73 25  |(nr_pane_events%|
00001d10  2b 31 29 2a 34 29 3d 2d  31 0d 00 ff 2d 62 6c 6b  |+1)*4)=-1...-blk|
00001d20  25 21 31 36 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |%!16=.shell_Heap|
00001d30  42 6c 6f 63 6b 45 78 74  65 6e 64 28 62 6c 6b 25  |BlockExtend(blk%|
00001d40  21 31 36 2c 34 29 0d 01  00 32 74 65 6d 70 25 3d  |!16,4)...2temp%=|
00001d50  62 6c 6b 25 21 31 36 3a  74 65 6d 70 25 21 28 6e  |blk%!16:temp%!(n|
00001d60  72 5f 70 61 6e 65 5f 65  76 65 6e 74 73 25 2a 34  |r_pane_events%*4|
00001d70  29 3d 78 5f 6f 66 66 25  0d 01 01 24 74 65 6d 70  |)=x_off%...$temp|
00001d80  25 21 28 28 6e 72 5f 70  61 6e 65 5f 65 76 65 6e  |%!((nr_pane_even|
00001d90  74 73 25 2b 31 29 2a 34  29 3d 2d 31 0d 01 02 2d  |ts%+1)*4)=-1...-|
00001da0  62 6c 6b 25 21 32 30 3d  a4 73 68 65 6c 6c 5f 48  |blk%!20=.shell_H|
00001db0  65 61 70 42 6c 6f 63 6b  45 78 74 65 6e 64 28 62  |eapBlockExtend(b|
00001dc0  6c 6b 25 21 32 30 2c 34  29 0d 01 03 32 74 65 6d  |lk%!20,4)...2tem|
00001dd0  70 25 3d 62 6c 6b 25 21  32 30 3a 74 65 6d 70 25  |p%=blk%!20:temp%|
00001de0  21 28 6e 72 5f 70 61 6e  65 5f 65 76 65 6e 74 73  |!(nr_pane_events|
00001df0  25 2a 34 29 3d 79 5f 6f  66 66 25 0d 01 04 24 74  |%*4)=y_off%...$t|
00001e00  65 6d 70 25 21 28 28 6e  72 5f 70 61 6e 65 5f 65  |emp%!((nr_pane_e|
00001e10  76 65 6e 74 73 25 2b 31  29 2a 34 29 3d 2d 31 0d  |vents%+1)*4)=-1.|
00001e20  01 05 05 e1 0d 01 06 05  3a 0d 01 07 1f 2a 7c 53  |........:....*|S|
00001e30  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 41 74  |top PROCshell_At|
00001e40  74 61 63 68 50 61 6e 65  0d 01 08 04 0d 01 09 24  |tachPane.......$|
00001e50  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
00001e60  6c 5f 41 74 74 61 63 68  44 61 74 61 4c 6f 61 64  |l_AttachDataLoad|
00001e70  0d 01 0a 37 dd 20 f2 73  68 65 6c 6c 5f 41 74 74  |...7. .shell_Att|
00001e80  61 63 68 44 61 74 61 4c  6f 61 64 28 77 68 25 2c  |achDataLoad(wh%,|
00001e90  69 68 25 2c 74 79 70 65  25 2c 66 6e 24 2c 6e 6f  |ih%,type%,fn$,no|
00001ea0  5f 6c 6f 61 64 25 29 0d  01 0b 18 ea 20 62 6c 6b  |_load%)..... blk|
00001eb0  25 2c 74 65 6d 70 25 2c  6f 66 66 73 65 74 25 0d  |%,temp%,offset%.|
00001ec0  01 0c 3f f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |..?.shell_Tracef|
00001ed0  30 28 22 41 74 74 61 63  68 44 61 74 61 4c 6f 61  |0("AttachDataLoa|
00001ee0  64 3a 41 74 74 61 63 68  69 6e 67 20 44 61 74 61  |d:Attaching Data|
00001ef0  4c 6f 61 64 20 48 61 6e  64 6c 65 72 22 29 0d 01  |Load Handler")..|
00001f00  0d 15 e7 20 77 68 25 3d  2d 31 20 8c 20 77 68 25  |... wh%=-1 . wh%|
00001f10  3d 2d 32 0d 01 0e 24 e7  20 6e 6f 5f 6c 6f 61 64  |=-2...$. no_load|
00001f20  25 20 8c 20 74 79 70 65  25 3d 74 79 70 65 25 20  |% . type%=type% |
00001f30  84 20 31 3c 3c 33 31 0d  01 0f 3a 6f 66 66 73 65  |. 1<<31...:offse|
00001f40  74 25 3d a4 73 68 65 6c  6c 5f 47 65 74 45 76 65  |t%=.shell_GetEve|
00001f50  6e 74 4c 69 73 74 4f 66  66 73 65 74 28 77 68 25  |ntListOffset(wh%|
00001f60  2c 69 68 25 2c 5f 55 25  2b 39 36 2c 31 36 2c b9  |,ih%,_U%+96,16,.|
00001f70  29 0d 01 10 3e f4 20 6d  6f 64 69 66 79 20 61 62  |)...>. modify ab|
00001f80  6f 76 65 20 74 6f 20 73  65 74 20 66 69 72 73 74  |ove to set first|
00001f90  20 74 77 6f 20 77 6f 72  64 73 20 74 6f 20 30 20  | two words to 0 |
00001fa0  74 6f 20 64 65 6e 6f 74  65 20 61 20 6e 65 77 0d  |to denote a new.|
00001fb0  01 11 17 f4 20 65 6d 70  74 79 20 65 76 65 6e 74  |.... empty event|
00001fc0  20 62 6c 6f 63 6b 0d 01  12 17 62 6c 6b 25 3d 5f  | block....blk%=_|
00001fd0  55 25 21 39 36 2b 6f 66  66 73 65 74 25 0d 01 13  |U%!96+offset%...|
00001fe0  04 0d 01 14 1b e7 20 62  6c 6b 25 21 30 3d 30 20  |...... blk%!0=0 |
00001ff0  80 20 62 6c 6b 25 21 34  3d 30 20 8c 0d 01 15 21  |. blk%!4=0 ....!|
00002000  20 20 f4 20 74 68 69 73  20 69 73 20 66 69 72 73  |  . this is firs|
00002010  74 20 65 76 65 6e 74 2e  2e 2e 2e 2e 2e 0d 01 16  |t event.........|
00002020  4a 20 20 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |J  .shell_Tracef|
00002030  30 28 22 41 74 74 61 63  68 44 61 74 61 4c 6f 61  |0("AttachDataLoa|
00002040  64 3a 54 68 69 73 20 69  73 20 74 68 65 20 66 69  |d:This is the fi|
00002050  72 73 74 20 44 61 74 61  4c 6f 61 64 20 45 76 65  |rst DataLoad Eve|
00002060  6e 74 2e 2e 2e 22 29 0d  01 17 1b 20 20 62 6c 6b  |nt...")....  blk|
00002070  25 21 30 3d 77 68 25 3a  62 6c 6b 25 21 34 3d 69  |%!0=wh%:blk%!4=i|
00002080  68 25 0d 01 18 25 20 20  62 6c 6b 25 21 38 3d a4  |h%...%  blk%!8=.|
00002090  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
000020a0  65 74 63 68 28 38 29 0d  01 19 12 20 20 74 65 6d  |etch(8)....  tem|
000020b0  70 25 3d 62 6c 6b 25 21  38 0d 01 1a 1e 20 20 74  |p%=blk%!8....  t|
000020c0  65 6d 70 25 21 30 3d 74  79 70 65 25 3a 74 65 6d  |emp%!0=type%:tem|
000020d0  70 25 21 34 3d 2d 31 0d  01 1b 26 20 20 62 6c 6b  |p%!4=-1...&  blk|
000020e0  25 21 31 32 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |%!12=.shell_Heap|
000020f0  42 6c 6f 63 6b 46 65 74  63 68 28 38 29 0d 01 1c  |BlockFetch(8)...|
00002100  13 20 20 74 65 6d 70 25  3d 62 6c 6b 25 21 31 32  |.  temp%=blk%!12|
00002110  0d 01 1d 2d 20 20 74 65  6d 70 25 21 30 3d a4 73  |...-  temp%!0=.s|
00002120  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 46 65  |hell_HeapBlockFe|
00002130  74 63 68 28 a9 28 66 6e  24 29 2b 31 29 0d 01 1e  |tch(.(fn$)+1)...|
00002140  10 20 20 74 65 6d 70 25  21 34 3d 2d 31 0d 01 1f  |.  temp%!4=-1...|
00002150  1e 20 20 74 65 6d 70 25  3d 74 65 6d 70 25 21 30  |.  temp%=temp%!0|
00002160  3a 24 74 65 6d 70 25 3d  66 6e 24 0d 01 20 05 cc  |:$temp%=fn$.. ..|
00002170  0d 01 21 39 20 20 f4 20  61 64 64 69 6e 67 20 6e  |..!9  . adding n|
00002180  65 77 20 66 69 6c 65 74  79 70 65 2f 66 75 6e 63  |ew filetype/func|
00002190  74 69 6f 6e 20 74 6f 20  61 6e 20 65 78 69 73 74  |tion to an exist|
000021a0  69 6e 67 20 65 76 65 6e  74 0d 01 22 24 20 20 f4  |ing event.."$  .|
000021b0  20 65 78 74 65 6e 64 20  66 69 6c 65 74 79 70 65  | extend filetype|
000021c0  20 68 65 61 70 62 6c 6f  63 6b 2e 2e 2e 0d 01 23  | heapblock.....#|
000021d0  48 20 20 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |H  .shell_Tracef|
000021e0  30 28 22 41 74 74 61 63  68 44 61 74 61 4c 6f 61  |0("AttachDataLoa|
000021f0  64 3a 54 68 69 73 20 69  73 20 61 6e 6f 74 68 65  |d:This is anothe|
00002200  72 20 44 61 74 61 4c 6f  61 64 20 45 76 65 6e 74  |r DataLoad Event|
00002210  2e 2e 2e 22 29 0d 01 24  2d 20 20 62 6c 6b 25 21  |...")..$-  blk%!|
00002220  38 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |8=.shell_HeapBlo|
00002230  63 6b 45 78 74 65 6e 64  28 62 6c 6b 25 21 38 2c  |ckExtend(blk%!8,|
00002240  34 29 0d 01 25 26 20 20  f4 20 61 6e 64 20 66 75  |4)..%&  . and fu|
00002250  6e 63 74 69 6f 6e 20 6e  61 6d 65 20 68 65 61 70  |nction name heap|
00002260  62 6c 6f 63 6b 2e 2e 2e  0d 01 26 2f 20 20 62 6c  |block.....&/  bl|
00002270  6b 25 21 31 32 3d a4 73  68 65 6c 6c 5f 48 65 61  |k%!12=.shell_Hea|
00002280  70 42 6c 6f 63 6b 45 78  74 65 6e 64 28 62 6c 6b  |pBlockExtend(blk|
00002290  25 21 31 32 2c 34 29 0d  01 27 34 20 20 f4 20 66  |%!12,4)..'4  . f|
000022a0  69 6e 64 20 6f 75 74 20  68 6f 77 20 6d 61 6e 79  |ind out how many|
000022b0  20 66 69 6c 65 74 79 70  65 73 20 74 68 65 72 65  | filetypes there|
000022c0  20 61 72 65 20 6e 6f 77  2e 2e 2e 0d 01 28 19 20  | are now.....(. |
000022d0  20 63 74 72 25 3d 30 3a  74 65 6d 70 25 3d 62 6c  | ctr%=0:temp%=bl|
000022e0  6b 25 21 38 0d 01 29 17  20 20 c8 95 20 74 65 6d  |k%!8..).  .. tem|
000022f0  70 25 21 63 74 72 25 3c  3e 2d 31 0d 01 2a 0f 20  |p%!ctr%<>-1..*. |
00002300  20 20 20 63 74 72 25 2b  3d 34 0d 01 2b 07 20 20  |   ctr%+=4..+.  |
00002310  ce 0d 01 2c 28 20 20 74  65 6d 70 25 21 63 74 72  |...,(  temp%!ctr|
00002320  25 3d 74 79 70 65 25 3a  74 65 6d 70 25 21 28 63  |%=type%:temp%!(c|
00002330  74 72 25 2b 34 29 3d 2d  31 0d 01 2d 13 20 20 74  |tr%+4)=-1..-.  t|
00002340  65 6d 70 25 3d 62 6c 6b  25 21 31 32 0d 01 2e 2e  |emp%=blk%!12....|
00002350  20 20 74 65 6d 70 25 21  63 74 72 25 3d a4 73 68  |  temp%!ctr%=.sh|
00002360  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
00002370  63 68 28 a9 66 6e 24 2b  31 29 0d 01 2f 21 20 20  |ch(.fn$+1)../!  |
00002380  74 65 6d 70 25 3d 74 65  6d 70 25 21 63 74 72 25  |temp%=temp%!ctr%|
00002390  3a 24 74 65 6d 70 25 3d  66 6e 24 0d 01 30 05 cd  |:$temp%=fn$..0..|
000023a0  0d 01 31 05 e1 0d 01 32  05 3a 0d 01 33 23 2a 7c  |..1....2.:..3#*||
000023b0  53 74 6f 70 20 50 52 4f  43 73 68 65 6c 6c 5f 41  |Stop PROCshell_A|
000023c0  74 74 61 63 68 44 61 74  61 4c 6f 61 64 0d 01 34  |ttachDataLoad..4|
000023d0  04 0d 01 35 24 2a 7c 53  74 61 72 74 20 50 52 4f  |...5$*|Start PRO|
000023e0  43 73 68 65 6c 6c 5f 41  74 74 61 63 68 44 61 74  |Cshell_AttachDat|
000023f0  61 53 61 76 65 0d 01 36  40 dd 20 f2 73 68 65 6c  |aSave..6@. .shel|
00002400  6c 5f 41 74 74 61 63 68  44 61 74 61 53 61 76 65  |l_AttachDataSave|
00002410  28 77 68 25 2c 69 68 25  2c 61 64 64 72 65 73 73  |(wh%,ih%,address|
00002420  25 2c 74 79 70 65 25 2c  6e 61 6d 65 5f 69 63 25  |%,type%,name_ic%|
00002430  2c 66 6e 24 29 0d 01 37  18 ea 20 62 6c 6b 25 2c  |,fn$)..7.. blk%,|
00002440  74 65 6d 70 25 2c 6f 66  66 73 65 74 25 0d 01 38  |temp%,offset%..8|
00002450  3f e7 20 61 64 64 72 65  73 73 25 3d 30 20 8c 20  |?. address%=0 . |
00002460  61 64 64 72 65 73 73 25  3d 31 30 30 3a f4 20 65  |address%=100:. e|
00002470  73 74 69 6d 61 74 65 64  20 73 69 7a 65 20 2d 20  |stimated size - |
00002480  77 69 6c 64 20 67 75 65  73 73 2e 2e 0d 01 39 62  |wild guess....9b|
00002490  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
000024a0  41 74 74 61 63 68 44 61  74 61 53 61 76 65 3a 41  |AttachDataSave:A|
000024b0  74 74 61 63 68 69 6e 67  20 44 61 74 61 53 61 76  |ttaching DataSav|
000024c0  65 20 48 61 6e 64 6c 65  72 20 74 6f 20 69 63 6f  |e Handler to ico|
000024d0  6e 20 22 2b c3 69 68 25  2b 22 20 69 6e 20 77 69  |n "+.ih%+" in wi|
000024e0  6e 64 6f 77 20 26 22 2b  c3 7e 77 68 25 29 0d 01  |ndow &"+.~wh%)..|
000024f0  3a 42 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |:B.shell_Tracef0|
00002500  28 22 41 74 74 61 63 68  44 61 74 61 53 61 76 65  |("AttachDataSave|
00002510  3a 48 61 6e 64 6c 65 72  20 66 75 6e 63 74 69 6f  |:Handler functio|
00002520  6e 20 69 73 20 27 22 2b  66 6e 24 2b 22 27 22 29  |n is '"+fn$+"'")|
00002530  0d 01 3b 3a 6f 66 66 73  65 74 25 3d a4 73 68 65  |..;:offset%=.she|
00002540  6c 6c 5f 47 65 74 45 76  65 6e 74 4c 69 73 74 4f  |ll_GetEventListO|
00002550  66 66 73 65 74 28 77 68  25 2c 69 68 25 2c 5f 55  |ffset(wh%,ih%,_U|
00002560  25 2b 37 32 2c 32 34 2c  b9 29 0d 01 3c 17 62 6c  |%+72,24,.)..<.bl|
00002570  6b 25 3d 5f 55 25 21 37  32 2b 6f 66 66 73 65 74  |k%=_U%!72+offset|
00002580  25 0d 01 3d 37 62 6c 6b  25 21 30 3d 77 68 25 3a  |%..=7blk%!0=wh%:|
00002590  62 6c 6b 25 21 34 3d 69  68 25 3a 62 6c 6b 25 21  |blk%!4=ih%:blk%!|
000025a0  38 3d 61 64 64 72 65 73  73 25 3a 62 6c 6b 25 21  |8=address%:blk%!|
000025b0  31 32 3d 74 79 70 65 25  0d 01 3e 14 62 6c 6b 25  |12=type%..>.blk%|
000025c0  21 31 36 3d 6e 61 6d 65  5f 69 63 25 0d 01 3f 2b  |!16=name_ic%..?+|
000025d0  62 6c 6b 25 21 32 30 3d  a4 73 68 65 6c 6c 5f 48  |blk%!20=.shell_H|
000025e0  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 a9 28  |eapBlockFetch(.(|
000025f0  66 6e 24 29 2b 31 29 0d  01 40 1c 74 65 6d 70 25  |fn$)+1)..@.temp%|
00002600  3d 62 6c 6b 25 21 32 30  3a 24 74 65 6d 70 25 3d  |=blk%!20:$temp%=|
00002610  66 6e 24 0d 01 41 0e c8  8e 20 74 79 70 65 25 20  |fn$..A... type% |
00002620  ca 0d 01 42 0c 20 20 c9  20 26 46 46 39 0d 01 43  |...B.  . &FF9..C|
00002630  3a 20 20 20 20 f4 20 6b  6c 75 64 67 65 20 66 6f  |:    . kludge fo|
00002640  72 20 73 70 72 69 74 65  20 66 69 6c 65 73 20 61  |r sprite files a|
00002650  73 20 66 69 72 73 74 20  77 6f 72 64 20 73 68 6f  |s first word sho|
00002660  75 6c 64 20 6e 6f 74 0d  01 44 12 20 20 20 20 f4  |uld not..D.    .|
00002670  20 62 65 20 73 61 76 65  64 0d 01 45 1a 20 20 20  | be saved..E.   |
00002680  20 e7 20 61 64 64 72 65  73 73 25 3e 26 38 30 30  | . address%>&800|
00002690  30 20 8c 0d 01 46 32 20  20 20 20 20 20 5f 55 25  |0 ...F2      _U%|
000026a0  21 31 33 36 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |!136=.shell_Heap|
000026b0  42 6c 6f 63 6b 49 6e 66  6f 28 61 64 64 72 65 73  |BlockInfo(addres|
000026c0  73 25 29 2d 38 0d 01 47  09 20 20 20 20 cc 0d 01  |s%)-8..G.    ...|
000026d0  48 1a 20 20 20 20 20 20  5f 55 25 21 31 33 36 3d  |H.      _U%!136=|
000026e0  61 64 64 72 65 73 73 25  0d 01 49 09 20 20 20 20  |address%..I.    |
000026f0  cd 0d 01 4a 07 20 20 7f  0d 01 4b 1a 20 20 20 20  |...J.  ...K.    |
00002700  e7 20 61 64 64 72 65 73  73 25 3e 26 38 30 30 30  |. address%>&8000|
00002710  20 8c 0d 01 4c 32 20 20  20 20 20 20 5f 55 25 21  | ...L2      _U%!|
00002720  31 33 36 3d a4 73 68 65  6c 6c 5f 48 65 61 70 42  |136=.shell_HeapB|
00002730  6c 6f 63 6b 49 6e 66 6f  28 61 64 64 72 65 73 73  |lockInfo(address|
00002740  25 29 2d 34 0d 01 4d 09  20 20 20 20 cc 0d 01 4e  |%)-4..M.    ...N|
00002750  1a 20 20 20 20 20 20 5f  55 25 21 31 33 36 3d 61  |.      _U%!136=a|
00002760  64 64 72 65 73 73 25 0d  01 4f 09 20 20 20 20 cd  |ddress%..O.    .|
00002770  0d 01 50 05 cb 0d 01 51  11 5f 55 25 21 31 34 30  |..P....Q._U%!140|
00002780  3d 74 79 70 65 25 0d 01  52 4c f4 20 5f 55 25 21  |=type%..RL. _U%!|
00002790  31 34 34 20 68 6f 6c 64  73 20 61 64 64 72 65 73  |144 holds addres|
000027a0  73 20 6f 66 20 66 69 6c  65 20 68 65 61 70 62 6c  |s of file heapbl|
000027b0  6f 63 6b 20 62 75 66 66  65 72 2e 20 49 66 20 61  |ock buffer. If a|
000027c0  64 64 72 65 73 73 25 3c  26 38 30 30 30 20 74 68  |ddress%<&8000 th|
000027d0  65 6e 0d 01 53 4b f4 20  66 69 6c 65 20 69 73 20  |en..SK. file is |
000027e0  6e 6f 74 20 69 6e 20 61  20 62 75 66 66 65 72 20  |not in a buffer |
000027f0  61 6e 64 20 61 64 64 72  65 73 73 25 20 69 73 20  |and address% is |
00002800  61 63 74 75 61 6c 6c 79  20 74 68 65 20 65 73 74  |actually the est|
00002810  69 6d 61 74 65 64 20 73  69 7a 65 2e 2e 0d 01 54  |imated size....T|
00002820  14 5f 55 25 21 31 34 34  3d 61 64 64 72 65 73 73  |._U%!144=address|
00002830  25 0d 01 55 05 e1 0d 01  56 05 3a 0d 01 57 23 2a  |%..U....V.:..W#*|
00002840  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
00002850  41 74 74 61 63 68 44 61  74 61 53 61 76 65 0d 01  |AttachDataSave..|
00002860  58 04 0d 01 59 20 2a 7c  53 74 61 72 74 20 50 52  |X...Y *|Start PR|
00002870  4f 43 73 68 65 6c 6c 5f  41 74 74 61 63 68 4d 65  |OCshell_AttachMe|
00002880  6e 75 0d 01 5a 38 dd 20  f2 73 68 65 6c 6c 5f 41  |nu..Z8. .shell_A|
00002890  74 74 61 63 68 4d 65 6e  75 28 77 68 25 2c 69 63  |ttachMenu(wh%,ic|
000028a0  25 2c 6d 65 6e 75 25 2c  73 68 69 66 74 25 2c 63  |%,menu%,shift%,c|
000028b0  74 72 6c 25 2c 61 6c 74  25 29 0d 01 5b 3a e7 20  |trl%,alt%)..[:. |
000028c0  77 68 25 3e 30 20 80 20  69 63 25 3e 3d 30 20 8c  |wh%>0 . ic%>=0 .|
000028d0  20 f2 73 68 65 6c 6c 5f  49 63 6f 6e 53 65 74 42  | .shell_IconSetB|
000028e0  75 74 74 6f 6e 54 79 70  65 28 77 68 25 2c 69 63  |uttonType(wh%,ic|
000028f0  25 2c 31 29 0d 01 5c 27  f2 73 68 65 6c 6c 5f 45  |%,1)..\'.shell_E|
00002900  76 65 6e 74 41 64 64 28  77 68 25 2c 69 63 25 2c  |ventAdd(wh%,ic%,|
00002910  30 2c 6d 65 6e 75 25 2c  22 22 29 0d 01 5d 05 e1  |0,menu%,"")..]..|
00002920  0d 01 5e 05 3a 0d 01 5f  1f 2a 7c 53 74 6f 70 20  |..^.:.._.*|Stop |
00002930  50 52 4f 43 73 68 65 6c  6c 5f 41 74 74 61 63 68  |PROCshell_Attach|
00002940  4d 65 6e 75 0d 01 60 04  0d 01 61 25 2a 7c 53 74  |Menu..`...a%*|St|
00002950  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 41 74  |art PROCshell_At|
00002960  74 61 63 68 4d 65 6e 75  4d 61 6b 65 72 0d 01 62  |tachMenuMaker..b|
00002970  29 dd 20 f2 73 68 65 6c  6c 5f 41 74 74 61 63 68  |). .shell_Attach|
00002980  4d 65 6e 75 4d 61 6b 65  72 28 77 68 25 2c 69 63  |MenuMaker(wh%,ic|
00002990  25 2c 66 6e 24 29 0d 01  63 4c f2 73 68 65 6c 6c  |%,fn$)..cL.shell|
000029a0  5f 54 72 61 63 65 66 30  28 22 41 74 74 61 63 68  |_Tracef0("Attach|
000029b0  4d 65 6e 75 4d 61 6b 65  72 3a 41 74 74 61 63 68  |MenuMaker:Attach|
000029c0  69 6e 67 20 6d 65 6e 75  6d 61 6b 65 72 20 66 75  |ing menumaker fu|
000029d0  6e 63 74 69 6f 6e 20 27  22 2b 66 6e 24 2b 22 27  |nction '"+fn$+"'|
000029e0  22 29 0d 01 64 24 f2 73  68 65 6c 6c 5f 45 76 65  |")..d$.shell_Eve|
000029f0  6e 74 41 64 64 28 77 68  25 2c 69 63 25 2c 31 2c  |ntAdd(wh%,ic%,1,|
00002a00  30 2c 66 6e 24 29 0d 01  65 05 e1 0d 01 66 05 3a  |0,fn$)..e....f.:|
00002a10  0d 01 67 24 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |..g$*|Stop PROCs|
00002a20  68 65 6c 6c 5f 41 74 74  61 63 68 4d 65 6e 75 4d  |hell_AttachMenuM|
00002a30  61 6b 65 72 0d 01 68 04  0d 01 69 24 2a 7c 53 74  |aker..h...i$*|St|
00002a40  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 41 74  |art PROCshell_At|
00002a50  74 61 63 68 4d 65 6e 75  44 42 6f 78 0d 01 6a 41  |tachMenuDBox..jA|
00002a60  dd 20 f2 73 68 65 6c 6c  5f 41 74 74 61 63 68 4d  |. .shell_AttachM|
00002a70  65 6e 75 44 42 6f 78 28  69 74 65 6d 25 2c 77 69  |enuDBox(item%,wi|
00002a80  6e 64 6f 77 24 2c 70 72  65 6f 70 65 6e 66 6e 24  |ndow$,preopenfn$|
00002a90  2c 70 6f 73 74 6f 70 65  6e 66 6e 24 29 0d 01 6b  |,postopenfn$)..k|
00002aa0  40 f4 20 43 68 65 63 6b  20 63 75 72 72 65 6e 74  |@. Check current|
00002ab0  20 73 75 62 6d 65 6e 75  20 68 61 6e 64 6c 65 2e  | submenu handle.|
00002ac0  20 57 65 20 73 68 6f 75  6c 64 20 72 65 6c 65 61  | We should relea|
00002ad0  73 65 20 61 6e 79 20 6d  65 6d 6f 72 79 0d 01 6c  |se any memory..l|
00002ae0  40 f4 20 61 6c 6c 6f 63  61 74 65 64 20 62 79 20  |@. allocated by |
00002af0  70 72 65 76 69 6f 75 73  20 63 61 6c 6c 73 20 28  |previous calls (|
00002b00  77 68 65 6e 20 49 20 77  6f 72 6b 20 6f 75 74 20  |when I work out |
00002b10  68 6f 77 20 74 6f 20 64  6f 20 69 74 29 0d 01 6d  |how to do it)..m|
00002b20  16 ea 20 62 6c 6b 25 2c  74 65 6d 70 25 2c 61 64  |.. blk%,temp%,ad|
00002b30  64 72 25 0d 01 6e 56 e7  20 ac 20 a4 73 68 65 6c  |dr%..nV. . .shel|
00002b40  6c 5f 57 69 6e 64 6f 77  4c 6f 61 64 65 64 28 77  |l_WindowLoaded(w|
00002b50  69 6e 64 6f 77 24 29 20  8c 20 85 20 39 39 2c a4  |indow$) . . 99,.|
00002b60  73 68 65 6c 6c 5f 4d 65  73 73 61 67 65 4f 6e 65  |shell_MessageOne|
00002b70  41 72 67 28 22 53 48 45  4c 4c 4d 53 47 30 33 22  |Arg("SHELLMSG03"|
00002b80  2c 77 69 6e 64 6f 77 24  29 0d 01 6f 22 62 6c 6b  |,window$)..o"blk|
00002b90  25 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |%=.shell_HeapBlo|
00002ba0  63 6b 46 65 74 63 68 28  31 32 29 0d 01 70 2c 62  |ckFetch(12)..p,b|
00002bb0  6c 6b 25 21 30 3d a4 73  68 65 6c 6c 5f 48 65 61  |lk%!0=.shell_Hea|
00002bc0  70 42 6c 6f 63 6b 46 65  74 63 68 28 a9 77 69 6e  |pBlockFetch(.win|
00002bd0  64 6f 77 24 2b 31 29 0d  01 71 1f 74 65 6d 70 25  |dow$+1)..q.temp%|
00002be0  3d 62 6c 6b 25 21 30 3a  24 74 65 6d 70 25 3d 77  |=blk%!0:$temp%=w|
00002bf0  69 6e 64 6f 77 24 0d 01  72 2f 62 6c 6b 25 21 34  |indow$..r/blk%!4|
00002c00  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
00002c10  6b 46 65 74 63 68 28 a9  70 72 65 6f 70 65 6e 66  |kFetch(.preopenf|
00002c20  6e 24 2b 31 29 0d 01 73  22 74 65 6d 70 25 3d 62  |n$+1)..s"temp%=b|
00002c30  6c 6b 25 21 34 3a 24 74  65 6d 70 25 3d 70 72 65  |lk%!4:$temp%=pre|
00002c40  6f 70 65 6e 66 6e 24 0d  01 74 30 62 6c 6b 25 21  |openfn$..t0blk%!|
00002c50  38 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |8=.shell_HeapBlo|
00002c60  63 6b 46 65 74 63 68 28  a9 70 6f 73 74 6f 70 65  |ckFetch(.postope|
00002c70  6e 66 6e 24 2b 31 29 0d  01 75 23 74 65 6d 70 25  |nfn$+1)..u#temp%|
00002c80  3d 62 6c 6b 25 21 38 3a  24 74 65 6d 70 25 3d 70  |=blk%!8:$temp%=p|
00002c90  6f 73 74 6f 70 65 6e 66  6e 24 0d 01 76 3b f4 20  |ostopenfn$..v;. |
00002ca0  53 74 6f 72 65 20 61 64  64 72 65 73 73 20 6f 66  |Store address of|
00002cb0  20 68 65 61 70 62 6c 6f  63 6b 20 69 6e 20 73 75  | heapblock in su|
00002cc0  62 6d 65 6e 75 20 70 6f  69 6e 74 65 72 20 77 6f  |bmenu pointer wo|
00002cd0  72 64 20 6f 66 0d 01 77  2f f4 20 6d 65 6e 75 20  |rd of..w/. menu |
00002ce0  69 74 65 6d 20 64 65 66  69 6e 69 74 69 6f 6e 2e  |item definition.|
00002cf0  20 43 75 6e 6e 69 6e 67  20 68 75 68 2e 2e 2e 2e  | Cunning huh....|
00002d00  2e 2e 2e 2e 0d 01 78 24  c8 99 20 22 4d 65 6e 75  |......x$.. "Menu|
00002d10  55 74 69 6c 5f 53 75 62  4d 65 6e 75 22 2c 69 74  |Util_SubMenu",it|
00002d20  65 6d 25 2c 62 6c 6b 25  0d 01 79 1c c8 99 20 22  |em%,blk%..y... "|
00002d30  4d 65 6e 75 55 74 69 6c  5f 57 61 72 6e 69 6e 67  |MenuUtil_Warning|
00002d40  22 2c 2c b9 0d 01 7a 05  e1 0d 01 7b 05 3a 0d 01  |",,...z....{.:..|
00002d50  7c 23 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  ||#*|Stop PROCshe|
00002d60  6c 6c 5f 41 74 74 61 63  68 4d 65 6e 75 44 42 6f  |ll_AttachMenuDBo|
00002d70  78 0d 01 7d 04 0d 01 7e  27 2a 7c 53 74 61 72 74  |x..}...~'*|Start|
00002d80  20 50 52 4f 43 73 68 65  6c 6c 5f 41 74 74 61 63  | PROCshell_Attac|
00002d90  68 43 6c 69 63 6b 53 65  6c 65 63 74 0d 01 7f 2b  |hClickSelect...+|
00002da0  dd 20 f2 73 68 65 6c 6c  5f 41 74 74 61 63 68 43  |. .shell_AttachC|
00002db0  6c 69 63 6b 53 65 6c 65  63 74 28 77 68 25 2c 69  |lickSelect(wh%,i|
00002dc0  63 25 2c 66 6e 24 29 0d  01 80 24 f2 73 68 65 6c  |c%,fn$)...$.shel|
00002dd0  6c 5f 45 76 65 6e 74 41  64 64 28 77 68 25 2c 69  |l_EventAdd(wh%,i|
00002de0  63 25 2c 32 2c 30 2c 66  6e 24 29 0d 01 81 05 e1  |c%,2,0,fn$).....|
00002df0  0d 01 82 05 3a 0d 01 83  26 2a 7c 53 74 6f 70 20  |....:...&*|Stop |
00002e00  50 52 4f 43 73 68 65 6c  6c 5f 41 74 74 61 63 68  |PROCshell_Attach|
00002e10  43 6c 69 63 6b 53 65 6c  65 63 74 0d 01 84 27 2a  |ClickSelect...'*|
00002e20  7c 53 74 61 72 74 20 50  52 4f 43 73 68 65 6c 6c  ||Start PROCshell|
00002e30  5f 41 74 74 61 63 68 43  6c 69 63 6b 41 64 6a 75  |_AttachClickAdju|
00002e40  73 74 0d 01 85 2b dd 20  f2 73 68 65 6c 6c 5f 41  |st...+. .shell_A|
00002e50  74 74 61 63 68 43 6c 69  63 6b 41 64 6a 75 73 74  |ttachClickAdjust|
00002e60  28 77 68 25 2c 69 63 25  2c 66 6e 24 29 0d 01 86  |(wh%,ic%,fn$)...|
00002e70  24 f2 73 68 65 6c 6c 5f  45 76 65 6e 74 41 64 64  |$.shell_EventAdd|
00002e80  28 77 68 25 2c 69 63 25  2c 33 2c 30 2c 66 6e 24  |(wh%,ic%,3,0,fn$|
00002e90  29 0d 01 87 05 e1 0d 01  88 05 3a 0d 01 89 26 2a  |).........:...&*|
00002ea0  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
00002eb0  41 74 74 61 63 68 43 6c  69 63 6b 41 64 6a 75 73  |AttachClickAdjus|
00002ec0  74 0d 01 8a 26 2a 7c 53  74 61 72 74 20 50 52 4f  |t...&*|Start PRO|
00002ed0  43 73 68 65 6c 6c 5f 41  74 74 61 63 68 55 73 65  |Cshell_AttachUse|
00002ee0  72 52 65 64 72 61 77 0d  01 8b 28 dd 20 f2 73 68  |rRedraw...(. .sh|
00002ef0  65 6c 6c 5f 41 74 74 61  63 68 55 73 65 72 52 65  |ell_AttachUserRe|
00002f00  64 72 61 77 28 f8 20 77  68 25 2c 66 6e 24 29 0d  |draw(. wh%,fn$).|
00002f10  01 8c 19 ea 20 62 6c 6b  25 2c 66 25 2c 6f 6c 64  |.... blk%,f%,old|
00002f20  5f 68 61 6e 64 6c 65 25  0d 01 8d 22 62 6c 6b 25  |_handle%..."blk%|
00002f30  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
00002f40  6b 46 65 74 63 68 28 34  30 29 0d 01 8e 2c 21 62  |kFetch(40)...,!b|
00002f50  6c 6b 25 3d 77 68 25 3a  c8 99 20 22 57 69 6d 70  |lk%=wh%:.. "Wimp|
00002f60  5f 47 65 74 57 69 6e 64  6f 77 53 74 61 74 65 22  |_GetWindowState"|
00002f70  2c 2c 62 6c 6b 25 0d 01  8f 0e 66 25 3d 62 6c 6b  |,,blk%....f%=blk|
00002f80  25 21 33 32 0d 01 90 20  f2 73 68 65 6c 6c 5f 48  |%!32... .shell_H|
00002f90  65 61 70 42 6c 6f 63 6b  52 65 74 75 72 6e 28 62  |eapBlockReturn(b|
00002fa0  6c 6b 25 29 0d 01 91 33  f2 73 68 65 6c 6c 5f 54  |lk%)...3.shell_T|
00002fb0  72 61 63 65 66 30 28 22  41 74 74 61 63 68 55 73  |racef0("AttachUs|
00002fc0  65 72 52 65 64 72 61 77  3a 66 6c 61 67 25 3d 26  |erRedraw:flag%=&|
00002fd0  22 2b c3 7e 66 25 29 0d  01 92 13 e7 20 28 66 25  |"+.~f%)..... (f%|
00002fe0  20 80 20 31 3c 3c 34 29  20 8c 0d 01 93 3a 20 20  | . 1<<4) ....:  |
00002ff0  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
00003000  41 74 74 61 63 68 55 73  65 72 52 65 64 72 61 77  |AttachUserRedraw|
00003010  3a 61 75 74 6f 20 72 65  64 72 61 77 20 73 65 74  |:auto redraw set|
00003020  21 21 22 29 0d 01 94 47  20 20 f4 20 73 74 6f 72  |!!")...G  . stor|
00003030  65 20 6f 72 69 67 69 6e  61 6c 20 68 61 6e 64 6c  |e original handl|
00003040  65 20 69 6e 20 63 61 73  65 20 74 68 65 20 77 69  |e in case the wi|
00003050  6d 70 20 61 6c 6c 6f 63  61 74 65 73 20 61 20 6e  |mp allocates a n|
00003060  65 77 20 68 61 6e 64 6c  65 2e 2e 0d 01 95 15 20  |ew handle...... |
00003070  20 6f 6c 64 5f 68 61 6e  64 6c 65 25 3d 77 68 25  | old_handle%=wh%|
00003080  0d 01 96 28 20 20 f2 73  68 65 6c 6c 5f 57 69 6e  |...(  .shell_Win|
00003090  64 6f 77 54 6f 67 67 6c  65 46 6c 61 67 73 28 77  |dowToggleFlags(w|
000030a0  68 25 2c 31 3c 3c 34 29  0d 01 97 1a 20 20 e7 20  |h%,1<<4)....  . |
000030b0  77 68 25 3c 3e 6f 6c 64  5f 68 61 6e 64 6c 65 25  |wh%<>old_handle%|
000030c0  20 8c 0d 01 98 32 20 20  20 20 f2 73 68 65 6c 6c  | ....2    .shell|
000030d0  5f 55 70 64 61 74 65 57  69 6e 64 6f 77 48 61 6e  |_UpdateWindowHan|
000030e0  64 6c 65 28 6f 6c 64 5f  68 61 6e 64 6c 65 25 2c  |dle(old_handle%,|
000030f0  77 68 25 29 0d 01 99 07  20 20 cd 0d 01 9a 05 cd  |wh%)....  ......|
00003100  0d 01 9b 23 f2 73 68 65  6c 6c 5f 45 76 65 6e 74  |...#.shell_Event|
00003110  41 64 64 28 77 68 25 2c  2d 31 2c 34 2c 30 2c 66  |Add(wh%,-1,4,0,f|
00003120  6e 24 29 0d 01 9c 05 e1  0d 01 9d 05 3a 0d 01 9e  |n$).........:...|
00003130  25 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  |%*|Stop PROCshel|
00003140  6c 5f 41 74 74 61 63 68  55 73 65 72 52 65 64 72  |l_AttachUserRedr|
00003150  61 77 0d 01 9f 24 2a 7c  53 74 61 72 74 20 50 52  |aw...$*|Start PR|
00003160  4f 43 73 68 65 6c 6c 5f  41 74 74 61 63 68 4b 65  |OCshell_AttachKe|
00003170  79 70 72 65 73 73 0d 01  a0 28 dd 20 f2 73 68 65  |ypress...(. .she|
00003180  6c 6c 5f 41 74 74 61 63  68 4b 65 79 70 72 65 73  |ll_AttachKeypres|
00003190  73 28 77 68 25 2c 69 63  25 2c 66 6e 24 29 0d 01  |s(wh%,ic%,fn$)..|
000031a0  a1 24 f2 73 68 65 6c 6c  5f 45 76 65 6e 74 41 64  |.$.shell_EventAd|
000031b0  64 28 77 68 25 2c 69 63  25 2c 35 2c 30 2c 66 6e  |d(wh%,ic%,5,0,fn|
000031c0  24 29 0d 01 a2 05 e1 0d  01 a3 05 3a 0d 01 a4 23  |$).........:...#|
000031d0  2a 7c 53 74 6f 70 20 50  52 4f 43 73 68 65 6c 6c  |*|Stop PROCshell|
000031e0  5f 41 74 74 61 63 68 4b  65 79 70 72 65 73 73 0d  |_AttachKeypress.|
000031f0  01 a5 20 2a 7c 53 74 61  72 74 20 50 52 4f 43 73  |.. *|Start PROCs|
00003200  68 65 6c 6c 5f 41 74 74  61 63 68 44 72 61 67 0d  |hell_AttachDrag.|
00003210  01 a6 2e dd 20 f2 73 68  65 6c 6c 5f 41 74 74 61  |.... .shell_Atta|
00003220  63 68 44 72 61 67 28 77  68 25 2c 69 63 25 2c 65  |chDrag(wh%,ic%,e|
00003230  73 74 5f 73 69 7a 65 25  2c 66 6e 24 29 0d 01 a7  |st_size%,fn$)...|
00003240  24 f2 73 68 65 6c 6c 5f  45 76 65 6e 74 41 64 64  |$.shell_EventAdd|
00003250  28 77 68 25 2c 69 63 25  2c 36 2c 30 2c 66 6e 24  |(wh%,ic%,6,0,fn$|
00003260  29 0d 01 a8 05 e1 0d 01  a9 05 3a 0d 01 aa 1f 2a  |).........:....*|
00003270  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
00003280  41 74 74 61 63 68 44 72  61 67 0d 01 ab 23 2a 7c  |AttachDrag...#*||
00003290  53 74 61 72 74 20 50 52  4f 43 73 68 65 6c 6c 5f  |Start PROCshell_|
000032a0  41 74 74 61 63 68 48 65  6c 70 54 61 67 0d 01 ac  |AttachHelpTag...|
000032b0  28 dd 20 f2 73 68 65 6c  6c 5f 41 74 74 61 63 68  |(. .shell_Attach|
000032c0  48 65 6c 70 54 61 67 28  77 68 25 2c 69 63 25 2c  |HelpTag(wh%,ic%,|
000032d0  74 61 67 24 29 0d 01 ad  25 f2 73 68 65 6c 6c 5f  |tag$)...%.shell_|
000032e0  45 76 65 6e 74 41 64 64  28 77 68 25 2c 69 63 25  |EventAdd(wh%,ic%|
000032f0  2c 38 2c 30 2c 74 61 67  24 29 0d 01 ae 05 e1 0d  |,8,0,tag$)......|
00003300  01 af 05 3a 0d 01 b0 22  2a 7c 53 74 6f 70 20 50  |...:..."*|Stop P|
00003310  52 4f 43 73 68 65 6c 6c  5f 41 74 74 61 63 68 48  |ROCshell_AttachH|
00003320  65 6c 70 54 61 67 0d 01  b1 1e 2a 7c 53 74 61 72  |elpTag....*|Star|
00003330  74 20 50 52 4f 43 73 68  65 6c 6c 5f 45 76 65 6e  |t PROCshell_Even|
00003340  74 41 64 64 0d 01 b2 30  dd 20 f2 73 68 65 6c 6c  |tAdd...0. .shell|
00003350  5f 45 76 65 6e 74 41 64  64 28 77 68 25 2c 69 63  |_EventAdd(wh%,ic|
00003360  25 2c 65 5f 74 79 70 65  25 2c 6d 65 6e 75 25 2c  |%,e_type%,menu%,|
00003370  66 6e 24 29 0d 01 b3 2c  ea 20 70 74 72 25 2c 66  |fn$)...,. ptr%,f|
00003380  6e 25 2c 65 76 65 6e 74  5f 6c 69 73 74 25 2c 6c  |n%,event_list%,l|
00003390  69 73 74 5f 73 69 7a 65  25 2c 66 6f 75 6e 64 25  |ist_size%,found%|
000033a0  0d 01 b4 0e ea 20 66 6e  5f 61 64 64 72 25 0d 01  |..... fn_addr%..|
000033b0  b5 13 70 74 72 25 3d 30  3a 66 6f 75 6e 64 25 3d  |..ptr%=0:found%=|
000033c0  a3 0d 01 b6 15 e7 20 77  68 25 3d 2d 31 20 8c 20  |...... wh%=-1 . |
000033d0  77 68 25 3d 2d 32 0d 01  b7 2d 6c 69 73 74 5f 73  |wh%=-2...-list_s|
000033e0  69 7a 65 25 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |ize%=.shell_Heap|
000033f0  42 6c 6f 63 6b 49 6e 66  6f 28 5f 55 25 21 31 32  |BlockInfo(_U%!12|
00003400  29 2d 38 0d 01 b8 16 65  76 65 6e 74 5f 6c 69 73  |)-8....event_lis|
00003410  74 25 3d 5f 55 25 21 31  32 0d 01 b9 05 f5 0d 01  |t%=_U%!12.......|
00003420  ba 20 20 20 e7 20 28 65  76 65 6e 74 5f 6c 69 73  |.   . (event_lis|
00003430  74 25 21 70 74 72 25 3d  77 68 25 29 20 8c 0d 01  |t%!ptr%=wh%) ...|
00003440  bb 21 20 20 20 20 c8 8e  20 65 76 65 6e 74 5f 6c  |.!    .. event_l|
00003450  69 73 74 25 21 28 70 74  72 25 2b 34 29 20 ca 0d  |ist%!(ptr%+4) ..|
00003460  01 bc 0c 20 20 20 20 c9  20 2d 31 0d 01 bd 12 20  |...    . -1.... |
00003470  20 20 20 20 20 66 6f 75  6e 64 25 3d b9 0d 01 be  |     found%=....|
00003480  09 20 20 20 20 7f 0d 01  bf 26 20 20 20 20 20 20  |.    ....&      |
00003490  e7 20 65 76 65 6e 74 5f  6c 69 73 74 25 21 28 70  |. event_list%!(p|
000034a0  74 72 25 2b 34 29 3d 69  63 25 20 8c 0d 01 c0 14  |tr%+4)=ic% .....|
000034b0  20 20 20 20 20 20 20 20  66 6f 75 6e 64 25 3d b9  |        found%=.|
000034c0  0d 01 c1 0b 20 20 20 20  20 20 cc 0d 01 c2 14 20  |....      ..... |
000034d0  20 20 20 20 20 20 20 70  74 72 25 2b 3d 34 38 0d  |       ptr%+=48.|
000034e0  01 c3 0b 20 20 20 20 20  20 cd 0d 01 c4 09 20 20  |...      .....  |
000034f0  20 20 cb 0d 01 c5 07 20  20 cc 0d 01 c6 10 20 20  |  .....  .....  |
00003500  20 20 70 74 72 25 2b 3d  34 38 0d 01 c7 07 20 20  |  ptr%+=48....  |
00003510  cd 0d 01 c8 21 fd 20 28  70 74 72 25 3e 3d 6c 69  |....!. (ptr%>=li|
00003520  73 74 5f 73 69 7a 65 25  20 84 20 66 6f 75 6e 64  |st_size% . found|
00003530  25 29 0d 01 c9 10 e7 20  66 6f 75 6e 64 25 3d a3  |%)..... found%=.|
00003540  20 8c 0d 01 ca 0b 20 70  74 72 25 3d 30 0d 01 cb  | ..... ptr%=0...|
00003550  1e 20 c8 95 20 28 65 76  65 6e 74 5f 6c 69 73 74  |. .. (event_list|
00003560  25 21 70 74 72 25 3c 3e  30 20 29 0d 01 cc 0f 20  |%!ptr%<>0 ).... |
00003570  20 20 70 74 72 25 2b 3d  34 38 0d 01 cd 1b 20 20  |  ptr%+=48....  |
00003580  20 e7 20 70 74 72 25 3e  3d 6c 69 73 74 5f 73 69  | . ptr%>=list_si|
00003590  7a 65 25 20 8c 0d 01 ce  31 20 20 20 20 20 5f 55  |ze% ....1     _U|
000035a0  25 21 31 32 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |%!12=.shell_Heap|
000035b0  42 6c 6f 63 6b 45 78 74  65 6e 64 28 5f 55 25 21  |BlockExtend(_U%!|
000035c0  31 32 2c 34 38 29 0d 01  cf 1b 20 20 20 20 20 65  |12,48)....     e|
000035d0  76 65 6e 74 5f 6c 69 73  74 25 3d 5f 55 25 21 31  |vent_list%=_U%!1|
000035e0  32 0d 01 d0 1f 20 20 20  20 20 65 76 65 6e 74 5f  |2....     event_|
000035f0  6c 69 73 74 25 21 28 70  74 72 25 2b 30 29 3d 30  |list%!(ptr%+0)=0|
00003600  0d 01 d1 1f 20 20 20 20  20 65 76 65 6e 74 5f 6c  |....     event_l|
00003610  69 73 74 25 21 28 70 74  72 25 2b 34 29 3d 30 0d  |ist%!(ptr%+4)=0.|
00003620  01 d2 1f 20 20 20 20 20  65 76 65 6e 74 5f 6c 69  |...     event_li|
00003630  73 74 25 21 28 70 74 72  25 2b 38 29 3d 30 0d 01  |st%!(ptr%+8)=0..|
00003640  d3 20 20 20 20 20 20 65  76 65 6e 74 5f 6c 69 73  |.      event_lis|
00003650  74 25 21 28 70 74 72 25  2b 31 32 29 3d 30 0d 01  |t%!(ptr%+12)=0..|
00003660  d4 20 20 20 20 20 20 65  76 65 6e 74 5f 6c 69 73  |.      event_lis|
00003670  74 25 21 28 70 74 72 25  2b 31 36 29 3d 30 0d 01  |t%!(ptr%+16)=0..|
00003680  d5 20 20 20 20 20 20 65  76 65 6e 74 5f 6c 69 73  |.      event_lis|
00003690  74 25 21 28 70 74 72 25  2b 32 30 29 3d 30 0d 01  |t%!(ptr%+20)=0..|
000036a0  d6 20 20 20 20 20 20 65  76 65 6e 74 5f 6c 69 73  |.      event_lis|
000036b0  74 25 21 28 70 74 72 25  2b 32 34 29 3d 30 0d 01  |t%!(ptr%+24)=0..|
000036c0  d7 20 20 20 20 20 20 65  76 65 6e 74 5f 6c 69 73  |.      event_lis|
000036d0  74 25 21 28 70 74 72 25  2b 32 38 29 3d 30 0d 01  |t%!(ptr%+28)=0..|
000036e0  d8 20 20 20 20 20 20 65  76 65 6e 74 5f 6c 69 73  |.      event_lis|
000036f0  74 25 21 28 70 74 72 25  2b 33 32 29 3d 30 0d 01  |t%!(ptr%+32)=0..|
00003700  d9 20 20 20 20 20 20 65  76 65 6e 74 5f 6c 69 73  |.      event_lis|
00003710  74 25 21 28 70 74 72 25  2b 33 36 29 3d 30 0d 01  |t%!(ptr%+36)=0..|
00003720  da 20 20 20 20 20 20 65  76 65 6e 74 5f 6c 69 73  |.      event_lis|
00003730  74 25 21 28 70 74 72 25  2b 34 30 29 3d 30 0d 01  |t%!(ptr%+40)=0..|
00003740  db 20 20 20 20 20 20 65  76 65 6e 74 5f 6c 69 73  |.      event_lis|
00003750  74 25 21 28 70 74 72 25  2b 34 34 29 3d 30 0d 01  |t%!(ptr%+44)=0..|
00003760  dc 08 20 20 20 cd 0d 01  dd 06 20 ce 0d 01 de 05  |..   ..... .....|
00003770  cd 0d 01 df 1c 65 76 65  6e 74 5f 6c 69 73 74 25  |.....event_list%|
00003780  21 28 70 74 72 25 2b 30  29 3d 77 68 25 0d 01 e0  |!(ptr%+0)=wh%...|
00003790  1c 65 76 65 6e 74 5f 6c  69 73 74 25 21 28 70 74  |.event_list%!(pt|
000037a0  72 25 2b 34 29 3d 69 63  25 0d 01 e1 10 e7 20 6d  |r%+4)=ic%..... m|
000037b0  65 6e 75 25 3c 3e 30 20  8c 0d 01 e2 20 20 20 65  |enu%<>0 ....   e|
000037c0  76 65 6e 74 5f 6c 69 73  74 25 21 28 70 74 72 25  |vent_list%!(ptr%|
000037d0  2b 38 29 3d 6d 65 6e 75  25 0d 01 e3 05 cd 0d 01  |+8)=menu%.......|
000037e0  e4 22 66 6e 5f 61 64 64  72 25 3d 70 74 72 25 2b  |."fn_addr%=ptr%+|
000037f0  28 31 32 2b 28 65 5f 74  79 70 65 25 2a 34 29 29  |(12+(e_type%*4))|
00003800  0d 01 e5 1f e7 20 65 76  65 6e 74 5f 6c 69 73 74  |..... event_list|
00003810  25 21 66 6e 5f 61 64 64  72 25 3c 3e 30 20 8c 0d  |%!fn_addr%<>0 ..|
00003820  01 e6 32 20 20 f2 73 68  65 6c 6c 5f 48 65 61 70  |..2  .shell_Heap|
00003830  42 6c 6f 63 6b 52 65 74  75 72 6e 28 65 76 65 6e  |BlockReturn(even|
00003840  74 5f 6c 69 73 74 25 21  66 6e 5f 61 64 64 72 25  |t_list%!fn_addr%|
00003850  29 0d 01 e7 05 cd 0d 01  e8 25 66 6e 25 3d a4 73  |)........%fn%=.s|
00003860  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 46 65  |hell_HeapBlockFe|
00003870  74 63 68 28 a9 66 6e 24  2b 31 29 0d 01 e9 0c 24  |tch(.fn$+1)....$|
00003880  66 6e 25 3d 66 6e 24 0d  01 ea 1c 65 76 65 6e 74  |fn%=fn$....event|
00003890  5f 6c 69 73 74 25 21 66  6e 5f 61 64 64 72 25 3d  |_list%!fn_addr%=|
000038a0  66 6e 25 0d 01 eb 05 e1  0d 01 ec 05 3a 0d 01 ed  |fn%.........:...|
000038b0  1d 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  |.*|Stop PROCshel|
000038c0  6c 5f 45 76 65 6e 74 41  64 64 0d 01 ee 24 2a 7c  |l_EventAdd...$*||
000038d0  53 74 61 72 74 20 50 52  4f 43 73 68 65 6c 6c 5f  |Start PROCshell_|
000038e0  45 76 65 6e 74 44 65 6c  65 74 65 41 6c 6c 0d 01  |EventDeleteAll..|
000038f0  ef 20 dd 20 f2 73 68 65  6c 6c 5f 45 76 65 6e 74  |. . .shell_Event|
00003900  44 65 6c 65 74 65 41 6c  6c 28 77 68 25 29 0d 01  |DeleteAll(wh%)..|
00003910  f0 34 ea 20 70 74 72 25  2c 6d 65 6e 75 25 2c 66  |.4. ptr%,menu%,f|
00003920  6f 75 6e 64 25 2c 6c 69  73 74 5f 73 69 7a 65 25  |ound%,list_size%|
00003930  2c 65 76 65 6e 74 5f 6c  69 73 74 25 2c 6c 6f 6f  |,event_list%,loo|
00003940  70 25 0d 01 f1 1b 70 74  72 25 3d 30 3a 6d 65 6e  |p%....ptr%=0:men|
00003950  75 25 3d 30 3a 66 6f 75  6e 64 25 3d a3 0d 01 f2  |u%=0:found%=....|
00003960  15 e7 20 77 68 25 3d 2d  31 20 8c 20 77 68 25 3d  |.. wh%=-1 . wh%=|
00003970  2d 32 0d 01 f3 2d 6c 69  73 74 5f 73 69 7a 65 25  |-2...-list_size%|
00003980  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
00003990  6b 49 6e 66 6f 28 5f 55  25 21 31 32 29 2d 38 0d  |kInfo(_U%!12)-8.|
000039a0  01 f4 16 65 76 65 6e 74  5f 6c 69 73 74 25 3d 5f  |...event_list%=_|
000039b0  55 25 21 31 32 0d 01 f5  05 f5 0d 01 f6 20 20 20  |U%!12........   |
000039c0  e7 20 28 65 76 65 6e 74  5f 6c 69 73 74 25 21 70  |. (event_list%!p|
000039d0  74 72 25 3d 77 68 25 29  20 8c 0d 01 f7 10 20 20  |tr%=wh%) .....  |
000039e0  20 20 66 6f 75 6e 64 25  3d b9 0d 01 f8 07 20 20  |  found%=.....  |
000039f0  cc 0d 01 f9 10 20 20 20  20 70 74 72 25 2b 3d 34  |.....    ptr%+=4|
00003a00  38 0d 01 fa 07 20 20 cd  0d 01 fb 21 fd 20 28 70  |8....  ....!. (p|
00003a10  74 72 25 3e 3d 6c 69 73  74 5f 73 69 7a 65 25 20  |tr%>=list_size% |
00003a20  84 20 66 6f 75 6e 64 25  29 0d 01 fc 0e e7 20 66  |. found%)..... f|
00003a30  6f 75 6e 64 25 20 8c 0d  01 fd 1c 20 20 65 76 65  |ound% .....  eve|
00003a40  6e 74 5f 6c 69 73 74 25  21 28 70 74 72 25 2b 30  |nt_list%!(ptr%+0|
00003a50  29 3d 30 0d 01 fe 1c 20  20 65 76 65 6e 74 5f 6c  |)=0....  event_l|
00003a60  69 73 74 25 21 28 70 74  72 25 2b 34 29 3d 30 0d  |ist%!(ptr%+4)=0.|
00003a70  01 ff 1c 20 20 65 76 65  6e 74 5f 6c 69 73 74 25  |...  event_list%|
00003a80  21 28 70 74 72 25 2b 38  29 3d 30 0d 02 00 19 20  |!(ptr%+8)=0.... |
00003a90  20 e3 20 6c 6f 6f 70 25  3d 31 32 20 b8 20 34 34  | . loop%=12 . 44|
00003aa0  20 88 20 34 0d 02 01 27  20 20 20 20 e7 20 65 76  | . 4...'    . ev|
00003ab0  65 6e 74 5f 6c 69 73 74  25 21 28 70 74 72 25 2b  |ent_list%!(ptr%+|
00003ac0  6c 6f 6f 70 25 29 3c 3e  30 20 8c 0d 02 02 3a 20  |loop%)<>0 ....: |
00003ad0  20 20 20 20 20 f2 73 68  65 6c 6c 5f 48 65 61 70  |     .shell_Heap|
00003ae0  42 6c 6f 63 6b 52 65 74  75 72 6e 28 65 76 65 6e  |BlockReturn(even|
00003af0  74 5f 6c 69 73 74 25 21  28 70 74 72 25 2b 6c 6f  |t_list%!(ptr%+lo|
00003b00  6f 70 25 29 29 0d 02 03  24 20 20 20 20 20 20 65  |op%))...$      e|
00003b10  76 65 6e 74 5f 6c 69 73  74 25 21 28 70 74 72 25  |vent_list%!(ptr%|
00003b20  2b 6c 6f 6f 70 25 29 3d  30 0d 02 04 09 20 20 20  |+loop%)=0....   |
00003b30  20 cd 0d 02 05 0d 20 20  ed 20 6c 6f 6f 70 25 0d  | .....  . loop%.|
00003b40  02 06 05 cd 0d 02 07 3a  f4 20 72 65 6d 6f 76 65  |.......:. remove|
00003b50  20 61 6c 6c 20 44 61 74  61 53 61 76 65 20 65 76  | all DataSave ev|
00003b60  65 6e 74 73 20 66 6f 72  20 74 68 65 20 63 75 72  |ents for the cur|
00003b70  72 65 6e 74 20 77 69 6e  64 6f 77 2e 2e 2e 0d 02  |rent window.....|
00003b80  08 30 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |.0.shell_Tracef0|
00003b90  28 22 45 76 65 6e 74 44  65 6c 65 74 65 41 6c 6c  |("EventDeleteAll|
00003ba0  3a 77 68 25 3d 26 22 2b  c3 7e 77 68 25 29 0d 02  |:wh%=&"+.~wh%)..|
00003bb0  09 26 f2 73 68 65 6c 6c  5f 44 65 6c 65 74 65 45  |.&.shell_DeleteE|
00003bc0  76 65 6e 74 44 61 74 61  53 61 76 65 28 77 68 25  |ventDataSave(wh%|
00003bd0  2c 2d 31 29 0d 02 0a 22  f2 73 68 65 6c 6c 5f 44  |,-1)...".shell_D|
00003be0  65 6c 65 74 65 45 76 65  6e 74 42 75 6d 70 28 77  |eleteEventBump(w|
00003bf0  68 25 2c 2d 31 29 0d 02  0b 3f f4 20 73 68 6f 75  |h%,-1)...?. shou|
00003c00  6c 64 20 72 65 64 75 63  65 20 73 69 7a 65 20 6f  |ld reduce size o|
00003c10  66 20 65 76 65 6e 74 20  6c 69 73 74 20 62 6c 6f  |f event list blo|
00003c20  63 6b 20 69 66 20 70 6f  73 73 69 62 6c 65 2e 2e  |ck if possible..|
00003c30  2e 2e 2e 2e 2e 0d 02 0c  05 e1 0d 02 0d 05 3a 0d  |..............:.|
00003c40  02 0e 23 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |..#*|Stop PROCsh|
00003c50  65 6c 6c 5f 45 76 65 6e  74 44 65 6c 65 74 65 41  |ell_EventDeleteA|
00003c60  6c 6c 0d 02 0f 25 2a 7c  53 74 61 72 74 20 50 52  |ll...%*|Start PR|
00003c70  4f 43 73 68 65 6c 6c 5f  44 65 6c 65 74 65 45 76  |OCshell_DeleteEv|
00003c80  65 6e 74 42 75 6d 70 0d  02 10 25 dd 20 f2 73 68  |entBump...%. .sh|
00003c90  65 6c 6c 5f 44 65 6c 65  74 65 45 76 65 6e 74 42  |ell_DeleteEventB|
00003ca0  75 6d 70 28 77 68 25 2c  69 68 25 29 0d 02 11 43  |ump(wh%,ih%)...C|
00003cb0  f4 20 69 66 20 49 20 63  61 6e 20 66 69 6e 64 20  |. if I can find |
00003cc0  77 68 69 63 68 20 77 6f  72 64 73 20 70 6f 69 6e  |which words poin|
00003cd0  74 20 74 6f 20 61 20 68  65 61 70 20 62 6c 6f 63  |t to a heap bloc|
00003ce0  6b 20 74 68 65 79 20 63  6f 75 6c 64 20 62 65 0d  |k they could be.|
00003cf0  02 12 44 f4 20 61 75 74  6f 6d 61 74 69 63 61 6c  |..D. automatical|
00003d00  6c 79 20 64 65 74 65 63  74 65 64 20 61 6e 64 20  |ly detected and |
00003d10  72 65 6c 65 61 73 65 64  2e 20 41 20 67 65 6e 65  |released. A gene|
00003d20  72 61 6c 20 70 75 72 70  6f 73 65 20 72 6f 75 74  |ral purpose rout|
00003d30  69 6e 65 0d 02 13 2e f4  20 73 68 65 6c 6c 5f 44  |ine..... shell_D|
00003d40  65 6c 65 74 65 45 76 65  6e 74 20 63 6f 75 6c 64  |eleteEvent could|
00003d50  20 74 68 65 6e 20 62 65  20 77 72 69 74 74 65 6e  | then be written|
00003d60  21 0d 02 14 37 f4 20 49  66 20 69 68 25 3d 2d 31  |!...7. If ih%=-1|
00003d70  20 72 65 6d 6f 76 65 20  61 6c 6c 20 65 76 65 6e  | remove all even|
00003d80  74 73 20 66 6f 72 20 77  69 6e 64 6f 77 20 68 61  |ts for window ha|
00003d90  6e 64 6c 65 20 77 68 25  0d 02 15 2f ea 20 6f 66  |ndle wh%.../. of|
00003da0  66 73 65 74 25 2c 62 6c  6b 25 2c 6c 69 73 74 5f  |fset%,blk%,list_|
00003db0  73 69 7a 65 25 2c 65 76  65 6e 74 5f 6c 69 73 74  |size%,event_list|
00003dc0  25 2c 74 65 6d 70 25 0d  02 16 17 65 76 65 6e 74  |%,temp%....event|
00003dd0  5f 6c 69 73 74 25 3d 5f  55 25 21 31 30 34 0d 02  |_list%=_U%!104..|
00003de0  17 05 f5 0d 02 18 3d 20  20 6f 66 66 73 65 74 25  |......=  offset%|
00003df0  3d a4 73 68 65 6c 6c 5f  47 65 74 45 76 65 6e 74  |=.shell_GetEvent|
00003e00  4c 69 73 74 4f 66 66 73  65 74 28 77 68 25 2c 69  |ListOffset(wh%,i|
00003e10  68 25 2c 5f 55 25 2b 31  30 34 2c 31 36 2c a3 29  |h%,_U%+104,16,.)|
00003e20  0d 02 19 39 20 20 f2 73  68 65 6c 6c 5f 54 72 61  |...9  .shell_Tra|
00003e30  63 65 66 30 28 22 44 65  6c 65 74 65 45 76 65 6e  |cef0("DeleteEven|
00003e40  74 42 75 6d 70 3a 6f 66  66 73 65 74 25 3d 22 2b  |tBump:offset%="+|
00003e50  c3 6f 66 66 73 65 74 25  29 0d 02 1a 14 20 20 e7  |.offset%)....  .|
00003e60  20 6f 66 66 73 65 74 25  3e 3d 30 20 8c 0d 02 1b  | offset%>=0 ....|
00003e70  12 20 20 20 20 e7 20 69  68 25 3d 2d 31 20 8c 0d  |.    . ih%=-1 ..|
00003e80  02 1c 65 20 20 f2 73 68  65 6c 6c 5f 54 72 61 63  |..e  .shell_Trac|
00003e90  65 66 30 28 22 44 65 6c  65 74 65 45 76 65 6e 74  |ef0("DeleteEvent|
00003ea0  42 75 6d 70 3a 44 65 6c  65 74 69 6e 67 20 42 75  |Bump:Deleting Bu|
00003eb0  6d 70 20 45 76 65 6e 74  20 28 61 6c 6c 20 65 76  |mp Event (all ev|
00003ec0  65 6e 74 73 20 66 6f 72  20 77 69 6e 64 6f 77 20  |ents for window |
00003ed0  68 61 6e 64 6c 65 20 26  22 2b c3 7e 77 68 25 2b  |handle &"+.~wh%+|
00003ee0  22 29 22 29 0d 02 1d 09  20 20 20 20 cc 0d 02 1e  |")")....    ....|
00003ef0  77 20 20 20 20 20 20 f2  73 68 65 6c 6c 5f 54 72  |w      .shell_Tr|
00003f00  61 63 65 66 30 28 22 44  65 6c 65 74 65 45 76 65  |acef0("DeleteEve|
00003f10  6e 74 42 75 6d 70 3a 44  65 6c 65 74 69 6e 67 20  |ntBump:Deleting |
00003f20  42 75 6d 70 20 45 76 65  6e 74 20 28 77 69 6e 64  |Bump Event (wind|
00003f30  6f 77 20 68 61 6e 64 6c  65 20 77 61 73 20 26 22  |ow handle was &"|
00003f40  2b c3 7e 77 68 25 2b 22  20 69 63 6f 6e 20 68 61  |+.~wh%+" icon ha|
00003f50  6e 64 6c 65 20 77 61 73  20 22 2b c3 69 68 25 2b  |ndle was "+.ih%+|
00003f60  22 29 22 29 0d 02 1f 09  20 20 20 20 cd 0d 02 20  |")")....    ... |
00003f70  2a 20 20 20 20 f4 20 65  76 65 6e 74 20 66 6f 72  |*    . event for|
00003f80  20 77 69 6e 64 6f 77 2f  69 63 6f 6e 20 69 73 20  | window/icon is |
00003f90  69 6e 20 6c 69 73 74 0d  02 21 32 20 20 20 20 6c  |in list..!2    l|
00003fa0  69 73 74 5f 73 69 7a 65  25 3d a4 73 68 65 6c 6c  |ist_size%=.shell|
00003fb0  5f 48 65 61 70 42 6c 6f  63 6b 49 6e 66 6f 28 5f  |_HeapBlockInfo(_|
00003fc0  55 25 21 31 30 34 29 2d  38 0d 02 22 21 20 20 20  |U%!104)-8.."!   |
00003fd0  20 e7 20 6f 66 66 73 65  74 25 3d 6c 69 73 74 5f  | . offset%=list_|
00003fe0  73 69 7a 65 25 2d 31 36  20 8c 0d 02 23 2b 20 20  |size%-16 ...#+  |
00003ff0  20 20 20 20 f4 20 69 74  20 69 73 20 74 68 65 20  |    . it is the |
00004000  6c 61 73 74 20 6f 6e 65  20 69 6e 20 74 68 69 73  |last one in this|
00004010  20 6c 69 73 74 0d 02 24  17 20 20 20 20 20 20 e7  | list..$.      .|
00004020  20 6f 66 66 73 65 74 25  3d 30 20 8c 0d 02 25 28  | offset%=0 ...%(|
00004030  20 20 20 20 20 20 20 20  f4 20 6f 6e 6c 79 20 6f  |        . only o|
00004040  6e 65 20 65 76 65 6e 74  20 69 6e 20 74 68 65 20  |ne event in the |
00004050  6c 69 73 74 0d 02 26 24  20 20 20 20 20 20 20 20  |list..&$        |
00004060  69 6e 66 6f 5f 62 6c 6b  25 3d 65 76 65 6e 74 5f  |info_blk%=event_|
00004070  6c 69 73 74 25 21 31 32  0d 02 27 1e 20 20 20 20  |list%!12..'.    |
00004080  20 20 20 20 74 65 6d 70  25 3d 69 6e 66 6f 5f 62  |    temp%=info_b|
00004090  6c 6b 25 21 31 32 0d 02  28 2c 20 20 20 20 20 20  |lk%!12..(,      |
000040a0  20 20 f2 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |  .shell_HeapBlo|
000040b0  63 6b 52 65 74 75 72 6e  28 74 65 6d 70 25 21 31  |ckReturn(temp%!1|
000040c0  32 29 0d 02 29 2c 20 20  20 20 20 20 20 20 f2 73  |2)..),        .s|
000040d0  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 52 65  |hell_HeapBlockRe|
000040e0  74 75 72 6e 28 74 65 6d  70 25 21 31 36 29 0d 02  |turn(temp%!16)..|
000040f0  2a 29 20 20 20 20 20 20  20 20 f2 73 68 65 6c 6c  |*)        .shell|
00004100  5f 48 65 61 70 42 6c 6f  63 6b 52 65 74 75 72 6e  |_HeapBlockReturn|
00004110  28 74 65 6d 70 25 29 0d  02 2b 2b 20 20 20 20 20  |(temp%)..++     |
00004120  20 20 20 f2 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |   .shell_HeapBl|
00004130  6f 63 6b 52 65 74 75 72  6e 28 5f 55 25 21 31 30  |ockReturn(_U%!10|
00004140  34 29 0d 02 2c 15 20 20  20 20 20 20 20 20 5f 55  |4)..,.        _U|
00004150  25 21 31 30 34 3d 30 0d  02 2d 4f 20 20 20 20 20  |%!104=0..-O     |
00004160  20 20 20 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |   .shell_Tracef|
00004170  30 28 22 44 65 6c 65 74  65 45 76 65 6e 74 44 61  |0("DeleteEventDa|
00004180  74 61 53 61 76 65 3a 4e  6f 20 42 75 6d 70 20 65  |taSave:No Bump e|
00004190  76 65 6e 74 73 20 6e 6f  77 20 72 65 67 69 73 74  |vents now regist|
000041a0  65 72 65 64 22 29 0d 02  2e 0b 20 20 20 20 20 20  |ered")....      |
000041b0  cc 0d 02 2f 2d 20 20 20  20 20 20 20 20 f4 20 6d  |.../-        . m|
000041c0  6f 72 65 20 74 68 61 6e  20 6f 6e 65 20 65 76 65  |ore than one eve|
000041d0  6e 74 20 69 6e 20 74 68  65 20 6c 69 73 74 0d 02  |nt in the list..|
000041e0  30 37 20 20 20 20 20 20  20 20 5f 55 25 21 31 30  |07        _U%!10|
000041f0  34 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |4=.shell_HeapBlo|
00004200  63 6b 45 78 74 65 6e 64  28 5f 55 25 21 31 30 34  |ckExtend(_U%!104|
00004210  2c 2d 31 36 29 0d 02 31  0b 20 20 20 20 20 20 cd  |,-16)..1.      .|
00004220  0d 02 32 09 20 20 20 20  cc 0d 02 33 28 20 20 20  |..2.    ...3(   |
00004230  20 20 20 f4 20 6e 6f 74  20 74 68 65 20 6c 61 73  |   . not the las|
00004240  74 20 6f 6e 65 20 69 6e  20 74 68 65 20 6c 69 73  |t one in the lis|
00004250  74 0d 02 34 22 20 20 20  20 20 20 62 6c 6b 25 3d  |t..4"      blk%=|
00004260  65 76 65 6e 74 5f 6c 69  73 74 25 2b 6f 66 66 73  |event_list%+offs|
00004270  65 74 25 0d 02 35 24 20  20 20 20 20 20 62 6c 6b  |et%..5$      blk|
00004280  25 21 30 3d 30 3a 62 6c  6b 25 21 34 3d 30 3a 62  |%!0=0:blk%!4=0:b|
00004290  6c 6b 25 21 38 3d 30 0d  02 36 1b 20 20 20 20 20  |lk%!8=0..6.     |
000042a0  20 69 6e 66 6f 5f 62 6c  6b 25 3d 62 6c 6b 25 21  | info_blk%=blk%!|
000042b0  31 32 0d 02 37 2e 20 20  20 20 20 20 f2 73 68 65  |12..7.      .she|
000042c0  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 52 65 74 75  |ll_HeapBlockRetu|
000042d0  72 6e 28 69 6e 66 6f 5f  62 6c 6b 25 21 31 32 29  |rn(info_blk%!12)|
000042e0  0d 02 38 2e 20 20 20 20  20 20 f2 73 68 65 6c 6c  |..8.      .shell|
000042f0  5f 48 65 61 70 42 6c 6f  63 6b 52 65 74 75 72 6e  |_HeapBlockReturn|
00004300  28 69 6e 66 6f 5f 62 6c  6b 25 21 31 36 29 0d 02  |(info_blk%!16)..|
00004310  39 2b 20 20 20 20 20 20  f2 73 68 65 6c 6c 5f 48  |9+      .shell_H|
00004320  65 61 70 42 6c 6f 63 6b  52 65 74 75 72 6e 28 69  |eapBlockReturn(i|
00004330  6e 66 6f 5f 62 6c 6b 25  29 0d 02 3a 09 20 20 20  |nfo_blk%)..:.   |
00004340  20 cd 0d 02 3b 07 20 20  cd 0d 02 3c 36 20 20 f4  | ...;.  ...<6  .|
00004350  20 72 65 70 65 61 74 20  6c 6f 6f 70 20 75 6e 74  | repeat loop unt|
00004360  69 6c 20 6f 66 66 73 65  74 25 3d 2d 31 20 28 65  |il offset%=-1 (e|
00004370  76 65 6e 74 20 6e 6f 74  20 66 6f 75 6e 64 29 0d  |vent not found).|
00004380  02 3d 31 20 20 f4 20 6f  72 20 6f 66 66 73 65 74  |.=1  . or offset|
00004390  25 3d 2d 32 20 28 65 76  65 6e 74 20 62 6c 6f 63  |%=-2 (event bloc|
000043a0  6b 20 64 6f 65 73 6e 27  74 20 65 78 69 73 74 29  |k doesn't exist)|
000043b0  0d 02 3e 0f fd 20 6f 66  66 73 65 74 25 3c 30 0d  |..>.. offset%<0.|
000043c0  02 3f 05 e1 0d 02 40 05  3a 0d 02 41 24 2a 7c 53  |.?....@.:..A$*|S|
000043d0  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 44 65  |top PROCshell_De|
000043e0  6c 65 74 65 45 76 65 6e  74 42 75 6d 70 0d 02 42  |leteEventBump..B|
000043f0  29 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |)*|Start PROCshe|
00004400  6c 6c 5f 44 65 6c 65 74  65 45 76 65 6e 74 44 61  |ll_DeleteEventDa|
00004410  74 61 53 61 76 65 0d 02  43 29 dd 20 f2 73 68 65  |taSave..C). .she|
00004420  6c 6c 5f 44 65 6c 65 74  65 45 76 65 6e 74 44 61  |ll_DeleteEventDa|
00004430  74 61 53 61 76 65 28 77  68 25 2c 69 68 25 29 0d  |taSave(wh%,ih%).|
00004440  02 44 43 f4 20 69 66 20  49 20 63 61 6e 20 66 69  |.DC. if I can fi|
00004450  6e 64 20 77 68 69 63 68  20 77 6f 72 64 73 20 70  |nd which words p|
00004460  6f 69 6e 74 20 74 6f 20  61 20 68 65 61 70 20 62  |oint to a heap b|
00004470  6c 6f 63 6b 20 74 68 65  79 20 63 6f 75 6c 64 20  |lock they could |
00004480  62 65 0d 02 45 44 f4 20  61 75 74 6f 6d 61 74 69  |be..ED. automati|
00004490  63 61 6c 6c 79 20 64 65  74 65 63 74 65 64 20 61  |cally detected a|
000044a0  6e 64 20 72 65 6c 65 61  73 65 64 2e 20 41 20 67  |nd released. A g|
000044b0  65 6e 65 72 61 6c 20 70  75 72 70 6f 73 65 20 72  |eneral purpose r|
000044c0  6f 75 74 69 6e 65 0d 02  46 2e f4 20 73 68 65 6c  |outine..F.. shel|
000044d0  6c 5f 44 65 6c 65 74 65  45 76 65 6e 74 20 63 6f  |l_DeleteEvent co|
000044e0  75 6c 64 20 74 68 65 6e  20 62 65 20 77 72 69 74  |uld then be writ|
000044f0  74 65 6e 21 0d 02 47 37  f4 20 49 66 20 69 68 25  |ten!..G7. If ih%|
00004500  3d 2d 31 20 72 65 6d 6f  76 65 20 61 6c 6c 20 65  |=-1 remove all e|
00004510  76 65 6e 74 73 20 66 6f  72 20 77 69 6e 64 6f 77  |vents for window|
00004520  20 68 61 6e 64 6c 65 20  77 68 25 0d 02 48 1d ea  | handle wh%..H..|
00004530  20 6f 66 66 73 65 74 25  2c 62 6c 6b 25 2c 6c 69  | offset%,blk%,li|
00004540  73 74 5f 73 69 7a 65 25  0d 02 49 3d f4 20 50 52  |st_size%..I=. PR|
00004550  4f 43 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  |OCshell_Tracef0(|
00004560  22 44 65 6c 65 74 65 45  76 65 6e 74 44 61 74 61  |"DeleteEventData|
00004570  53 61 76 65 3a 77 68 25  3d 26 22 2b 53 54 52 24  |Save:wh%=&"+STR$|
00004580  7e 77 68 25 29 0d 02 4a  3b f4 20 50 52 4f 43 73  |~wh%)..J;. PROCs|
00004590  68 65 6c 6c 5f 54 72 61  63 65 66 30 28 22 44 65  |hell_Tracef0("De|
000045a0  6c 65 74 65 45 76 65 6e  74 44 61 74 61 53 61 76  |leteEventDataSav|
000045b0  65 3a 69 68 25 3d 22 2b  53 54 52 24 69 68 25 29  |e:ih%="+STR$ih%)|
000045c0  0d 02 4b 05 f5 0d 02 4c  3c 20 20 6f 66 66 73 65  |..K....L<  offse|
000045d0  74 25 3d a4 73 68 65 6c  6c 5f 47 65 74 45 76 65  |t%=.shell_GetEve|
000045e0  6e 74 4c 69 73 74 4f 66  66 73 65 74 28 77 68 25  |ntListOffset(wh%|
000045f0  2c 69 68 25 2c 5f 55 25  2b 37 32 2c 32 34 2c a3  |,ih%,_U%+72,24,.|
00004600  29 0d 02 4d 45 20 20 f4  20 50 52 4f 43 73 68 65  |)..ME  . PROCshe|
00004610  6c 6c 5f 54 72 61 63 65  66 30 28 22 44 65 6c 65  |ll_Tracef0("Dele|
00004620  74 65 45 76 65 6e 74 44  61 74 61 53 61 76 65 3a  |teEventDataSave:|
00004630  6f 66 66 73 65 74 25 3d  22 2b 53 54 52 24 6f 66  |offset%="+STR$of|
00004640  66 73 65 74 25 29 0d 02  4e 14 20 20 e7 20 6f 66  |fset%)..N.  . of|
00004650  66 73 65 74 25 3e 3d 30  20 8c 0d 02 4f 12 20 20  |fset%>=0 ...O.  |
00004660  20 20 e7 20 69 68 25 3d  2d 31 20 8c 0d 02 50 6d  |  . ih%=-1 ...Pm|
00004670  20 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |  .shell_Tracef0|
00004680  28 22 44 65 6c 65 74 65  45 76 65 6e 74 44 61 74  |("DeleteEventDat|
00004690  61 53 61 76 65 3a 44 65  6c 65 74 69 6e 67 20 44  |aSave:Deleting D|
000046a0  61 74 61 53 61 76 65 20  45 76 65 6e 74 20 28 61  |ataSave Event (a|
000046b0  6c 6c 20 65 76 65 6e 74  73 20 66 6f 72 20 77 69  |ll events for wi|
000046c0  6e 64 6f 77 20 68 61 6e  64 6c 65 20 26 22 2b c3  |ndow handle &"+.|
000046d0  7e 77 68 25 2b 22 29 22  29 0d 02 51 09 20 20 20  |~wh%+")")..Q.   |
000046e0  20 cc 0d 02 52 7b 20 20  f2 73 68 65 6c 6c 5f 54  | ...R{  .shell_T|
000046f0  72 61 63 65 66 30 28 22  44 65 6c 65 74 65 45 76  |racef0("DeleteEv|
00004700  65 6e 74 44 61 74 61 53  61 76 65 3a 44 65 6c 65  |entDataSave:Dele|
00004710  74 69 6e 67 20 44 61 74  61 53 61 76 65 20 45 76  |ting DataSave Ev|
00004720  65 6e 74 20 28 77 69 6e  64 6f 77 20 68 61 6e 64  |ent (window hand|
00004730  6c 65 20 77 61 73 20 26  22 2b c3 7e 77 68 25 2b  |le was &"+.~wh%+|
00004740  22 20 69 63 6f 6e 20 68  61 6e 64 6c 65 20 77 61  |" icon handle wa|
00004750  73 20 22 2b c3 69 68 25  2b 22 29 22 29 0d 02 53  |s "+.ih%+")")..S|
00004760  09 20 20 20 20 cd 0d 02  54 2a 20 20 20 20 f4 20  |.    ...T*    . |
00004770  65 76 65 6e 74 20 66 6f  72 20 77 69 6e 64 6f 77  |event for window|
00004780  2f 69 63 6f 6e 20 69 73  20 69 6e 20 6c 69 73 74  |/icon is in list|
00004790  0d 02 55 31 20 20 20 20  6c 69 73 74 5f 73 69 7a  |..U1    list_siz|
000047a0  65 25 3d a4 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |e%=.shell_HeapBl|
000047b0  6f 63 6b 49 6e 66 6f 28  5f 55 25 21 37 32 29 2d  |ockInfo(_U%!72)-|
000047c0  38 0d 02 56 21 20 20 20  20 e7 20 6f 66 66 73 65  |8..V!    . offse|
000047d0  74 25 3d 6c 69 73 74 5f  73 69 7a 65 25 2d 32 34  |t%=list_size%-24|
000047e0  20 8c 0d 02 57 2b 20 20  20 20 20 20 f4 20 69 74  | ...W+      . it|
000047f0  20 69 73 20 74 68 65 20  6c 61 73 74 20 6f 6e 65  | is the last one|
00004800  20 69 6e 20 74 68 69 73  20 6c 69 73 74 0d 02 58  | in this list..X|
00004810  17 20 20 20 20 20 20 e7  20 6f 66 66 73 65 74 25  |.      . offset%|
00004820  3d 30 20 8c 0d 02 59 28  20 20 20 20 20 20 20 20  |=0 ...Y(        |
00004830  f4 20 6f 6e 6c 79 20 6f  6e 65 20 65 76 65 6e 74  |. only one event|
00004840  20 69 6e 20 74 68 65 20  6c 69 73 74 0d 02 5a 2a  | in the list..Z*|
00004850  20 20 20 20 20 20 20 20  f2 73 68 65 6c 6c 5f 48  |        .shell_H|
00004860  65 61 70 42 6c 6f 63 6b  52 65 74 75 72 6e 28 5f  |eapBlockReturn(_|
00004870  55 25 21 37 32 29 0d 02  5b 14 20 20 20 20 20 20  |U%!72)..[.      |
00004880  20 20 5f 55 25 21 37 32  3d 30 0d 02 5c 04 0d 02  |  _U%!72=0..\...|
00004890  5d 4b f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |]K.shell_Tracef0|
000048a0  28 22 44 65 6c 65 74 65  45 76 65 6e 74 44 61 74  |("DeleteEventDat|
000048b0  61 53 61 76 65 3a 4e 6f  20 44 61 74 61 53 61 76  |aSave:No DataSav|
000048c0  65 20 65 76 65 6e 74 73  20 6e 6f 77 20 72 65 67  |e events now reg|
000048d0  69 73 74 65 72 65 64 22  29 0d 02 5e 0b 20 20 20  |istered")..^.   |
000048e0  20 20 20 cc 0d 02 5f 2d  20 20 20 20 20 20 20 20  |   ..._-        |
000048f0  f4 20 6d 6f 72 65 20 74  68 61 6e 20 6f 6e 65 20  |. more than one |
00004900  65 76 65 6e 74 20 69 6e  20 74 68 65 20 6c 69 73  |event in the lis|
00004910  74 0d 02 60 35 20 20 20  20 20 20 20 20 5f 55 25  |t..`5        _U%|
00004920  21 37 32 3d a4 73 68 65  6c 6c 5f 48 65 61 70 42  |!72=.shell_HeapB|
00004930  6c 6f 63 6b 45 78 74 65  6e 64 28 5f 55 25 21 37  |lockExtend(_U%!7|
00004940  32 2c 2d 32 34 29 0d 02  61 0b 20 20 20 20 20 20  |2,-24)..a.      |
00004950  cd 0d 02 62 09 20 20 20  20 cc 0d 02 63 28 20 20  |...b.    ...c(  |
00004960  20 20 20 20 f4 20 6e 6f  74 20 74 68 65 20 6c 61  |    . not the la|
00004970  73 74 20 6f 6e 65 20 69  6e 20 74 68 65 20 6c 69  |st one in the li|
00004980  73 74 0d 02 64 22 20 20  20 20 20 20 62 6c 6b 25  |st..d"      blk%|
00004990  3d 65 76 65 6e 74 5f 6c  69 73 74 25 2b 6f 66 66  |=event_list%+off|
000049a0  73 65 74 25 0d 02 65 38  20 20 20 20 20 20 62 6c  |set%..e8      bl|
000049b0  6b 25 21 30 3d 30 3a 62  6c 6b 25 21 34 3d 30 3a  |k%!0=0:blk%!4=0:|
000049c0  62 6c 6b 25 21 38 3d 30  3a 62 6c 6b 25 21 31 32  |blk%!8=0:blk%!12|
000049d0  3d 30 3a 62 6c 6b 25 21  31 36 3d 30 0d 02 66 33  |=0:blk%!16=0..f3|
000049e0  20 20 20 20 20 20 f2 73  68 65 6c 6c 5f 48 65 61  |      .shell_Hea|
000049f0  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 62 6c 6b  |pBlockReturn(blk|
00004a00  25 21 32 30 29 3a 62 6c  6b 25 21 32 30 3d 30 0d  |%!20):blk%!20=0.|
00004a10  02 67 09 20 20 20 20 cd  0d 02 68 07 20 20 cd 0d  |.g.    ...h.  ..|
00004a20  02 69 36 20 20 f4 20 72  65 70 65 61 74 20 6c 6f  |.i6  . repeat lo|
00004a30  6f 70 20 75 6e 74 69 6c  20 6f 66 66 73 65 74 25  |op until offset%|
00004a40  3d 2d 31 20 28 65 76 65  6e 74 20 6e 6f 74 20 66  |=-1 (event not f|
00004a50  6f 75 6e 64 29 0d 02 6a  31 20 20 f4 20 6f 72 20  |ound)..j1  . or |
00004a60  6f 66 66 73 65 74 25 3d  2d 32 20 28 65 76 65 6e  |offset%=-2 (even|
00004a70  74 20 62 6c 6f 63 6b 20  64 6f 65 73 6e 27 74 20  |t block doesn't |
00004a80  65 78 69 73 74 29 0d 02  6b 0f fd 20 6f 66 66 73  |exist)..k.. offs|
00004a90  65 74 25 3c 30 0d 02 6c  05 e1 0d 02 6d 05 3a 0d  |et%<0..l....m.:.|
00004aa0  02 6e 28 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |.n(*|Stop PROCsh|
00004ab0  65 6c 6c 5f 44 65 6c 65  74 65 45 76 65 6e 74 44  |ell_DeleteEventD|
00004ac0  61 74 61 53 61 76 65 0d  02 6f 21 2a 7c 53 74 61  |ataSave..o!*|Sta|
00004ad0  72 74 20 46 4e 73 68 65  6c 6c 5f 4d 65 73 73 61  |rt FNshell_Messa|
00004ae0  67 65 4e 6f 41 72 67 73  0d 02 70 20 dd 20 a4 73  |geNoArgs..p . .s|
00004af0  68 65 6c 6c 5f 4d 65 73  73 61 67 65 4e 6f 41 72  |hell_MessageNoAr|
00004b00  67 73 28 74 61 67 24 29  0d 02 71 25 3d a4 73 68  |gs(tag$)..q%=.sh|
00004b10  65 6c 6c 5f 4d 65 73 73  61 67 65 4c 6f 6f 6b 75  |ell_MessageLooku|
00004b20  70 28 74 61 67 24 2c 22  22 2c 22 22 29 0d 02 72  |p(tag$,"","")..r|
00004b30  05 3a 0d 02 73 20 2a 7c  53 74 6f 70 20 46 4e 73  |.:..s *|Stop FNs|
00004b40  68 65 6c 6c 5f 4d 65 73  73 61 67 65 4e 6f 41 72  |hell_MessageNoAr|
00004b50  67 73 0d 02 74 21 2a 7c  53 74 61 72 74 20 46 4e  |gs..t!*|Start FN|
00004b60  73 68 65 6c 6c 5f 4d 65  73 73 61 67 65 4f 6e 65  |shell_MessageOne|
00004b70  41 72 67 0d 02 75 26 dd  20 a4 73 68 65 6c 6c 5f  |Arg..u&. .shell_|
00004b80  4d 65 73 73 61 67 65 4f  6e 65 41 72 67 28 74 61  |MessageOneArg(ta|
00004b90  67 24 2c 61 72 67 31 24  29 0d 02 76 28 3d a4 73  |g$,arg1$)..v(=.s|
00004ba0  68 65 6c 6c 5f 4d 65 73  73 61 67 65 4c 6f 6f 6b  |hell_MessageLook|
00004bb0  75 70 28 74 61 67 24 2c  61 72 67 31 24 2c 22 22  |up(tag$,arg1$,""|
00004bc0  29 0d 02 77 05 3a 0d 02  78 20 2a 7c 53 74 6f 70  |)..w.:..x *|Stop|
00004bd0  20 46 4e 73 68 65 6c 6c  5f 4d 65 73 73 61 67 65  | FNshell_Message|
00004be0  4f 6e 65 41 72 67 0d 02  79 21 2a 7c 53 74 61 72  |OneArg..y!*|Star|
00004bf0  74 20 46 4e 73 68 65 6c  6c 5f 4d 65 73 73 61 67  |t FNshell_Messag|
00004c00  65 4c 6f 6f 6b 75 70 0d  02 7a 2c dd 20 a4 73 68  |eLookup..z,. .sh|
00004c10  65 6c 6c 5f 4d 65 73 73  61 67 65 4c 6f 6f 6b 75  |ell_MessageLooku|
00004c20  70 28 74 61 67 24 2c 61  72 67 31 24 2c 61 72 67  |p(tag$,arg1$,arg|
00004c30  32 24 29 0d 02 7b 24 ea  20 66 6c 61 67 73 25 2c  |2$)..{$. flags%,|
00004c40  4c 25 2c 6d 24 2c 6d 73  5f 74 65 78 74 25 2c 6d  |L%,m$,ms_text%,m|
00004c50  73 5f 64 65 73 63 25 0d  02 7c 1b e7 20 c0 74 61  |s_desc%..|.. .ta|
00004c60  67 24 2c 38 29 3d 22 53  48 45 4c 4c 4d 53 47 22  |g$,8)="SHELLMSG"|
00004c70  20 8c 0d 02 7d 27 20 20  6d 73 5f 74 65 78 74 25  | ...}'  ms_text%|
00004c80  3d 5f 55 25 21 32 38 34  3a 6d 73 5f 64 65 73 63  |=_U%!284:ms_desc|
00004c90  25 3d 5f 55 25 21 32 38  30 0d 02 7e 05 cc 0d 02  |%=_U%!280..~....|
00004ca0  7f 25 20 20 6d 73 5f 74  65 78 74 25 3d 5f 55 25  |.%  ms_text%=_U%|
00004cb0  21 36 34 3a 6d 73 5f 64  65 73 63 25 3d 5f 55 25  |!64:ms_desc%=_U%|
00004cc0  21 36 38 0d 02 80 05 cd  0d 02 81 53 c8 99 20 22  |!68........S.. "|
00004cd0  58 4d 65 73 73 61 67 65  54 72 61 6e 73 5f 4c 6f  |XMessageTrans_Lo|
00004ce0  6f 6b 75 70 22 2c 6d 73  5f 64 65 73 63 25 2c 74  |okup",ms_desc%,t|
00004cf0  61 67 24 2c 6d 73 5f 74  65 78 74 25 2c 32 35 36  |ag$,ms_text%,256|
00004d00  2c 61 72 67 31 24 2c 61  72 67 32 24 20 b8 20 2c  |,arg1$,arg2$ . ,|
00004d10  2c 2c 4c 25 3b 66 6c 61  67 73 25 0d 02 82 12 e7  |,,L%;flags%.....|
00004d20  20 66 6c 61 67 73 25 20  80 20 31 20 8c 0d 02 83  | flags% . 1 ....|
00004d30  3e 20 20 f4 20 6d 24 3d  22 4d 65 73 73 61 67 65  |>  . m$="Message|
00004d40  20 74 61 67 20 27 22 2b  74 61 67 24 2b 22 27 20  | tag '"+tag$+"' |
00004d50  6e 6f 74 20 66 6f 75 6e  64 20 69 6e 20 6d 65 73  |not found in mes|
00004d60  73 61 67 65 20 66 69 6c  65 21 22 0d 02 84 05 cc  |sage file!".....|
00004d70  0d 02 85 14 20 20 6d 73  5f 74 65 78 74 25 3f 4c  |....  ms_text%?L|
00004d80  25 3d 31 33 0d 02 86 14  20 20 6d 24 3d 24 28 6d  |%=13....  m$=$(m|
00004d90  73 5f 74 65 78 74 25 29  0d 02 87 05 cd 0d 02 88  |s_text%)........|
00004da0  07 3d 6d 24 0d 02 89 05  3a 0d 02 8a 20 2a 7c 53  |.=m$....:... *|S|
00004db0  74 6f 70 20 46 4e 73 68  65 6c 6c 5f 4d 65 73 73  |top FNshell_Mess|
00004dc0  61 67 65 4c 6f 6f 6b 75  70 0d 02 8b 04 0d 02 8c  |ageLookup.......|
00004dd0  1c 2a 7c 53 74 61 72 74  20 46 4e 73 68 65 6c 6c  |.*|Start FNshell|
00004de0  5f 57 69 6d 70 49 6e 69  74 0d 02 8d 29 dd 20 a4  |_WimpInit...). .|
00004df0  73 68 65 6c 6c 5f 57 69  6d 70 49 6e 69 74 28 56  |shell_WimpInit(V|
00004e00  65 72 73 69 6f 6e 25 2c  54 61 73 6b 4e 61 6d 65  |ersion%,TaskName|
00004e10  24 29 0d 02 8e 0d ea 20  54 61 73 6b 69 64 25 0d  |$)..... Taskid%.|
00004e20  02 8f 48 c8 99 20 22 57  69 6d 70 5f 49 6e 69 74  |..H.. "Wimp_Init|
00004e30  69 61 6c 69 73 65 22 2c  56 65 72 73 69 6f 6e 25  |ialise",Version%|
00004e40  2c 26 34 42 35 33 34 31  35 34 2c 54 61 73 6b 4e  |,&4B534154,TaskN|
00004e50  61 6d 65 24 20 b8 20 56  65 72 73 69 6f 6e 25 2c  |ame$ . Version%,|
00004e60  54 61 73 6b 69 64 25 0d  02 90 13 5f 55 25 21 31  |Taskid%...._U%!1|
00004e70  34 38 3d 54 61 73 6b 69  64 25 0d 02 91 0c 3d 54  |48=Taskid%....=T|
00004e80  61 73 6b 69 64 25 0d 02  92 05 3a 0d 02 93 1b 2a  |askid%....:....*|
00004e90  7c 53 74 6f 70 20 46 4e  73 68 65 6c 6c 5f 57 69  ||Stop FNshell_Wi|
00004ea0  6d 70 49 6e 69 74 0d 02  94 04 0d 02 95 1e 2a 7c  |mpInit........*||
00004eb0  53 74 61 72 74 20 46 4e  73 68 65 6c 6c 5f 57 69  |Start FNshell_Wi|
00004ec0  6d 70 49 6e 69 74 5f 49  0d 02 96 2b dd 20 a4 73  |mpInit_I...+. .s|
00004ed0  68 65 6c 6c 5f 57 69 6d  70 49 6e 69 74 5f 49 28  |hell_WimpInit_I(|
00004ee0  56 65 72 73 69 6f 6e 25  2c 54 61 73 6b 4e 61 6d  |Version%,TaskNam|
00004ef0  65 24 29 0d 02 97 48 c8  99 20 22 57 69 6d 70 5f  |e$)...H.. "Wimp_|
00004f00  49 6e 69 74 69 61 6c 69  73 65 22 2c 56 65 72 73  |Initialise",Vers|
00004f10  69 6f 6e 25 2c 26 34 42  35 33 34 31 35 34 2c 54  |ion%,&4B534154,T|
00004f20  61 73 6b 4e 61 6d 65 24  20 b8 20 56 65 72 73 69  |askName$ . Versi|
00004f30  6f 6e 25 2c 54 61 73 6b  69 64 25 0d 02 98 13 5f  |on%,Taskid%...._|
00004f40  55 25 21 31 34 38 3d 54  61 73 6b 69 64 25 0d 02  |U%!148=Taskid%..|
00004f50  99 25 c8 99 20 22 49 6e  74 65 72 66 61 63 65 5f  |.%.. "Interface_|
00004f60  49 6e 69 74 69 61 6c 69  73 65 22 2c 54 61 73 6b  |Initialise",Task|
00004f70  69 64 25 0d 02 9a 0c 3d  54 61 73 6b 69 64 25 0d  |id%....=Taskid%.|
00004f80  02 9b 05 3a 0d 02 9c 1d  2a 7c 53 74 6f 70 20 46  |...:....*|Stop F|
00004f90  4e 73 68 65 6c 6c 5f 57  69 6d 70 49 6e 69 74 5f  |Nshell_WimpInit_|
00004fa0  49 0d 02 9d 04 0d 02 9e  25 2a 7c 53 74 61 72 74  |I.......%*|Start|
00004fb0  20 50 52 4f 43 73 68 65  6c 6c 5f 57 69 6d 70 43  | PROCshell_WimpC|
00004fc0  6c 6f 73 65 44 6f 77 6e  5f 49 0d 02 9f 25 dd 20  |loseDown_I...%. |
00004fd0  f2 73 68 65 6c 6c 5f 57  69 6d 70 43 6c 6f 73 65  |.shell_WimpClose|
00004fe0  44 6f 77 6e 5f 49 28 54  61 73 6b 69 64 25 29 0d  |Down_I(Taskid%).|
00004ff0  02 a0 14 f2 73 68 65 6c  6c 5f 4c 6f 73 65 46 6f  |....shell_LoseFo|
00005000  6e 74 73 0d 02 a1 1a 2a  7c 69 66 64 65 66 20 55  |nts....*|ifdef U|
00005010  73 69 6e 67 5f 46 6f 6e  74 4d 65 6e 75 0d 02 a2  |sing_FontMenu...|
00005020  29 e7 20 5f 55 25 21 32  34 30 3c 3e 2d 31 20 8c  |). _U%!240<>-1 .|
00005030  20 c8 99 20 22 46 6f 6e  74 4d 65 6e 75 5f 52 65  | .. "FontMenu_Re|
00005040  6c 65 61 73 65 22 0d 02  a3 0b 2a 7c 65 6e 64 69  |lease"....*|endi|
00005050  66 0d 02 a4 29 c8 99 20  22 57 69 6d 70 5f 43 6c  |f...).. "Wimp_Cl|
00005060  6f 73 65 44 6f 77 6e 22  2c 54 61 73 6b 69 64 25  |oseDown",Taskid%|
00005070  2c 26 34 42 35 33 34 31  35 34 0d 02 a5 24 c8 99  |,&4B534154...$..|
00005080  20 22 49 6e 74 65 72 66  61 63 65 5f 43 6c 6f 73  | "Interface_Clos|
00005090  65 44 6f 77 6e 22 2c 54  61 73 6b 69 64 25 0d 02  |eDown",Taskid%..|
000050a0  a6 35 e7 20 5f 55 25 21  31 30 30 20 80 20 31 3c  |.5. _U%!100 . 1<|
000050b0  3c 32 20 8c 20 c8 99 20  22 49 6d 70 75 6c 73 65  |<2 . .. "Impulse|
000050c0  5f 43 6c 6f 73 65 44 6f  77 6e 22 2c 5f 55 25 21  |_CloseDown",_U%!|
000050d0  31 34 38 0d 02 a7 05 e1  0d 02 a8 05 3a 0d 02 a9  |148.........:...|
000050e0  24 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  |$*|Stop PROCshel|
000050f0  6c 5f 57 69 6d 70 43 6c  6f 73 65 44 6f 77 6e 5f  |l_WimpCloseDown_|
00005100  49 0d 02 aa 1d 2a 7c 53  74 61 72 74 20 50 52 4f  |I....*|Start PRO|
00005110  43 57 69 6d 70 43 6c 6f  73 65 44 6f 77 6e 0d 02  |CWimpCloseDown..|
00005120  ab 1d dd 20 f2 57 69 6d  70 43 6c 6f 73 65 44 6f  |... .WimpCloseDo|
00005130  77 6e 28 54 61 73 6b 69  64 25 29 0d 02 ac 14 f2  |wn(Taskid%).....|
00005140  73 68 65 6c 6c 5f 4c 6f  73 65 46 6f 6e 74 73 0d  |shell_LoseFonts.|
00005150  02 ad 1a 2a 7c 69 66 64  65 66 20 55 73 69 6e 67  |...*|ifdef Using|
00005160  5f 46 6f 6e 74 4d 65 6e  75 0d 02 ae 29 e7 20 5f  |_FontMenu...). _|
00005170  55 25 21 32 34 30 3c 3e  2d 31 20 8c 20 c8 99 20  |U%!240<>-1 . .. |
00005180  22 46 6f 6e 74 4d 65 6e  75 5f 52 65 6c 65 61 73  |"FontMenu_Releas|
00005190  65 22 0d 02 af 0b 2a 7c  65 6e 64 69 66 0d 02 b0  |e"....*|endif...|
000051a0  29 c8 99 20 22 57 69 6d  70 5f 43 6c 6f 73 65 44  |).. "Wimp_CloseD|
000051b0  6f 77 6e 22 2c 54 61 73  6b 69 64 25 2c 26 34 42  |own",Taskid%,&4B|
000051c0  35 33 34 31 35 34 0d 02  b1 35 e7 20 5f 55 25 21  |534154...5. _U%!|
000051d0  31 30 30 20 80 20 31 3c  3c 32 20 8c 20 c8 99 20  |100 . 1<<2 . .. |
000051e0  22 49 6d 70 75 6c 73 65  5f 43 6c 6f 73 65 44 6f  |"Impulse_CloseDo|
000051f0  77 6e 22 2c 5f 55 25 21  31 34 38 0d 02 b2 06 20  |wn",_U%!148.... |
00005200  20 0d 02 b3 05 e1 0d 02  b4 05 3a 0d 02 b5 1c 2a  | .........:....*|
00005210  7c 53 74 6f 70 20 50 52  4f 43 57 69 6d 70 43 6c  ||Stop PROCWimpCl|
00005220  6f 73 65 44 6f 77 6e 0d  02 b6 1f 2a 7c 53 74 61  |oseDown....*|Sta|
00005230  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 4c 6f 73  |rt PROCshell_Los|
00005240  65 46 6f 6e 74 73 0d 02  b7 16 dd 20 f2 73 68 65  |eFonts..... .she|
00005250  6c 6c 5f 4c 6f 73 65 46  6f 6e 74 73 0d 02 b8 11  |ll_LoseFonts....|
00005260  ea 20 6c 6f 6f 70 25 2c  74 65 6d 70 25 0d 02 b9  |. loop%,temp%...|
00005270  11 74 65 6d 70 25 3d 5f  55 25 21 32 33 32 0d 02  |.temp%=_U%!232..|
00005280  ba 13 e3 20 6c 6f 6f 70  25 3d 30 20 b8 20 32 35  |... loop%=0 . 25|
00005290  35 0d 02 bb 14 c8 95 20  74 65 6d 70 25 3f 6c 6f  |5...... temp%?lo|
000052a0  6f 70 25 3e 30 0d 02 bc  1e 20 20 c8 99 20 22 46  |op%>0....  .. "F|
000052b0  6f 6e 74 5f 4c 6f 73 65  46 6f 6e 74 22 2c 6c 6f  |ont_LoseFont",lo|
000052c0  6f 70 25 0d 02 bd 14 20  20 74 65 6d 70 25 3f 6c  |op%....  temp%?l|
000052d0  6f 6f 70 25 2d 3d 31 0d  02 be 05 ce 0d 02 bf 0b  |oop%-=1.........|
000052e0  ed 20 6c 6f 6f 70 25 0d  02 c0 05 e1 0d 02 c1 05  |. loop%.........|
000052f0  3a 0d 02 c2 1e 2a 7c 53  74 6f 70 20 50 52 4f 43  |:....*|Stop PROC|
00005300  73 68 65 6c 6c 5f 4c 6f  73 65 46 6f 6e 74 73 0d  |shell_LoseFonts.|
00005310  02 c3 1c 2a 7c 53 74 61  72 74 20 46 4e 73 68 65  |...*|Start FNshe|
00005320  6c 6c 5f 46 69 6e 64 46  6f 6e 74 0d 02 c4 27 dd  |ll_FindFont...'.|
00005330  20 a4 73 68 65 6c 6c 5f  46 69 6e 64 46 6f 6e 74  | .shell_FindFont|
00005340  28 66 6f 6e 74 24 2c 70  6f 69 6e 74 73 69 7a 65  |(font$,pointsize|
00005350  25 29 0d 02 c5 14 ea 20  66 25 2c 66 6f 6e 74 63  |%)..... f%,fontc|
00005360  6f 75 6e 74 73 25 0d 02  c6 17 66 6f 6e 74 63 6f  |ounts%....fontco|
00005370  75 6e 74 73 25 3d 5f 55  25 21 32 33 32 0d 02 c7  |unts%=_U%!232...|
00005380  39 c8 99 20 22 46 6f 6e  74 5f 46 69 6e 64 46 6f  |9.. "Font_FindFo|
00005390  6e 74 22 2c 2c 66 6f 6e  74 24 2c 70 6f 69 6e 74  |nt",,font$,point|
000053a0  73 69 7a 65 25 2a 31 36  2c 70 2a 31 36 2c 30 2c  |size%*16,p*16,0,|
000053b0  30 20 b8 20 66 25 0d 02  c8 15 66 6f 6e 74 63 6f  |0 . f%....fontco|
000053c0  75 6e 74 73 25 3f 66 25  2b 3d 31 0d 02 c9 43 e7  |unts%?f%+=1...C.|
000053d0  20 66 6f 6e 74 63 6f 75  6e 74 73 25 3f 66 25 3e  | fontcounts%?f%>|
000053e0  3d 32 35 35 20 8c 20 85  20 39 39 2c a4 73 68 65  |=255 . . 99,.she|
000053f0  6c 6c 5f 4d 65 73 73 61  67 65 4e 6f 41 72 67 73  |ll_MessageNoArgs|
00005400  28 22 53 48 45 4c 4c 4d  53 47 31 38 22 29 0d 02  |("SHELLMSG18")..|
00005410  ca 07 3d 66 25 0d 02 cb  05 3a 0d 02 cc 1b 2a 7c  |..=f%....:....*||
00005420  53 74 6f 70 20 46 4e 73  68 65 6c 6c 5f 46 69 6e  |Stop FNshell_Fin|
00005430  64 46 6f 6e 74 0d 02 cd  04 0d 02 ce 1a 2a 7c 53  |dFont........*|S|
00005440  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 49  |tart PROCshell_I|
00005450  6e 69 74 0d 02 cf 11 dd  20 f2 73 68 65 6c 6c 5f  |nit..... .shell_|
00005460  49 6e 69 74 0d 02 d0 18  ea 20 65 6c 69 73 74 25  |Init..... elist%|
00005470  2c 6c 6f 6f 70 25 2c 74  65 6d 70 25 0d 02 d1 1d  |,loop%,temp%....|
00005480  de 20 5f 55 25 20 33 32  30 2c 5f 73 68 65 6c 6c  |. _U% 320,_shell|
00005490  5f 62 6c 6b 25 20 31 30  30 0d 02 d2 23 5f 51 25  |_blk% 100...#_Q%|
000054a0  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
000054b0  6b 46 65 74 63 68 28 33  30 30 30 29 0d 02 d3 24  |kFetch(3000)...$|
000054c0  65 6c 69 73 74 25 3d a4  73 68 65 6c 6c 5f 48 65  |elist%=.shell_He|
000054d0  61 70 42 6c 6f 63 6b 46  65 74 63 68 28 34 38 29  |apBlockFetch(48)|
000054e0  0d 02 d4 0f 65 6c 69 73  74 25 21 30 20 3d 30 0d  |....elist%!0 =0.|
000054f0  02 d5 0f 65 6c 69 73 74  25 21 31 32 3d 30 0d 02  |...elist%!12=0..|
00005500  d6 0f 65 6c 69 73 74 25  21 31 36 3d 30 0d 02 d7  |..elist%!16=0...|
00005510  0f 65 6c 69 73 74 25 21  32 30 3d 30 0d 02 d8 0f  |.elist%!20=0....|
00005520  65 6c 69 73 74 25 21 32  34 3d 30 0d 02 d9 0f 65  |elist%!24=0....e|
00005530  6c 69 73 74 25 21 32 38  3d 30 0d 02 da 0f 65 6c  |list%!28=0....el|
00005540  69 73 74 25 21 33 32 3d  30 0d 02 db 0f 65 6c 69  |ist%!32=0....eli|
00005550  73 74 25 21 33 36 3d 30  0d 02 dc 0f 65 6c 69 73  |st%!36=0....elis|
00005560  74 25 21 34 30 3d 30 0d  02 dd 0f 65 6c 69 73 74  |t%!40=0....elist|
00005570  25 21 34 34 3d 30 0d 02  de 27 5f 55 25 21 30 3d  |%!44=0...'_U%!0=|
00005580  30 20 20 20 20 20 20 20  20 20 20 3a f4 20 6e 72  |0          :. nr|
00005590  20 6f 66 20 74 65 6d 70  6c 61 74 65 73 0d 02 df  | of templates...|
000055a0  30 5f 55 25 21 34 3d 30  20 20 20 20 20 20 20 20  |0_U%!4=0        |
000055b0  20 20 3a f4 20 70 6f 69  6e 74 65 72 20 74 6f 20  |  :. pointer to |
000055c0  77 69 6e 64 6f 77 20 62  6c 6f 63 6b 73 0d 02 e0  |window blocks...|
000055d0  2d 5f 55 25 21 38 3d 30  20 20 20 20 20 20 20 20  |-_U%!8=0        |
000055e0  20 20 3a f4 20 70 6f 69  6e 74 65 72 20 74 6f 20  |  :. pointer to |
000055f0  6d 65 6e 75 20 62 6c 6f  63 6b 0d 02 e1 2d 5f 55  |menu block...-_U|
00005600  25 21 31 32 3d 65 6c 69  73 74 25 20 20 20 20 3a  |%!12=elist%    :|
00005610  f4 20 70 6f 69 6e 74 65  72 20 74 6f 20 65 76 65  |. pointer to eve|
00005620  6e 74 20 6c 69 73 74 0d  02 e2 33 5f 55 25 21 31  |nt list...3_U%!1|
00005630  36 3d 31 20 20 20 20 20  20 20 20 20 3a f4 20 61  |6=1         :. a|
00005640  64 64 72 65 73 73 20 6f  66 20 75 73 65 72 20 73  |ddress of user s|
00005650  70 72 69 74 65 20 61 72  65 61 0d 02 e3 35 5f 55  |prite area...5_U|
00005660  25 21 32 30 3d 30 20 20  20 20 20 20 20 20 20 3a  |%!20=0         :|
00005670  f4 20 68 61 6e 64 6c 65  20 6f 66 20 6c 61 73 74  |. handle of last|
00005680  20 64 79 6e 61 6d 69 63  20 77 69 6e 64 6f 77 0d  | dynamic window.|
00005690  02 e4 2f 5f 55 25 21 32  34 3d 30 20 20 20 20 20  |../_U%!24=0     |
000056a0  20 20 20 20 3a f4 20 61  64 64 72 65 73 73 20 6f  |    :. address o|
000056b0  66 20 63 75 72 72 65 6e  74 20 6d 65 6e 75 0d 02  |f current menu..|
000056c0  e5 42 5f 55 25 21 32 38  3d 30 20 20 20 20 20 20  |.B_U%!28=0      |
000056d0  20 20 20 3a f4 20 6c 61  73 74 20 77 69 6e 64 6f  |   :. last windo|
000056e0  77 20 63 6c 69 63 6b 65  64 20 6f 76 65 72 20 28  |w clicked over (|
000056f0  73 65 6c 65 63 74 20 26  20 61 64 6a 75 73 74 29  |select & adjust)|
00005700  0d 02 e6 42 5f 55 25 21  33 32 3d 30 20 20 20 20  |...B_U%!32=0    |
00005710  20 20 20 20 20 3a f4 20  6c 61 73 74 20 69 63 6f  |     :. last ico|
00005720  6e 20 63 6c 69 63 6b 65  64 20 6f 76 65 72 20 20  |n clicked over  |
00005730  20 28 73 65 6c 65 63 74  20 26 20 61 64 6a 75 73  | (select & adjus|
00005740  74 29 0d 02 e7 2c 5f 55  25 21 33 36 3d 30 20 20  |t)...,_U%!36=0  |
00005750  20 20 20 20 20 20 20 3a  f4 20 6c 61 73 74 20 6d  |       :. last m|
00005760  65 6e 75 20 78 20 70 6f  73 69 74 69 6f 6e 0d 02  |enu x position..|
00005770  e8 2c 5f 55 25 21 34 30  3d 30 20 20 20 20 20 20  |.,_U%!40=0      |
00005780  20 20 20 3a f4 20 6c 61  73 74 20 6d 65 6e 75 20  |   :. last menu |
00005790  79 20 70 6f 73 69 74 69  6f 6e 0d 02 e9 2b 5f 55  |y position...+_U|
000057a0  25 21 34 34 3d 2d 31 20  20 20 20 20 20 20 20 3a  |%!44=-1        :|
000057b0  f4 20 68 61 6e 64 6c 65  20 6f 66 20 74 72 61 63  |. handle of trac|
000057c0  65 66 69 6c 65 0d 02 ea  38 5f 55 25 21 34 38 3d  |efile...8_U%!48=|
000057d0  30 20 20 20 20 20 20 20  20 20 3a f4 20 46 41 4c  |0         :. FAL|
000057e0  53 45 3d 6e 6f 74 20 74  72 61 63 69 6e 67 2c 54  |SE=not tracing,T|
000057f0  52 55 45 20 3d 20 74 72  61 63 69 6e 67 0d 02 eb  |RUE = tracing...|
00005800  3e 5f 55 25 21 35 32 3d  30 20 20 20 20 20 20 20  |>_U%!52=0       |
00005810  20 20 3a f4 20 6c 61 73  74 20 77 69 6e 64 6f 77  |  :. last window|
00005820  20 63 6c 69 63 6b 65 64  20 6f 76 65 72 20 28 6d  | clicked over (m|
00005830  65 6e 75 20 62 75 74 74  6f 6e 29 0d 02 ec 3e 5f  |enu button)...>_|
00005840  55 25 21 35 36 3d 30 20  20 20 20 20 20 20 20 20  |U%!56=0         |
00005850  3a f4 20 6c 61 73 74 20  69 63 6f 6e 20 20 20 63  |:. last icon   c|
00005860  6c 69 63 6b 65 64 20 6f  76 65 72 20 28 6d 65 6e  |licked over (men|
00005870  75 20 62 75 74 74 6f 6e  29 0d 02 ed 3e 5f 55 25  |u button)...>_U%|
00005880  21 36 30 3d 30 20 20 20  20 20 20 20 20 20 3a f4  |!60=0         :.|
00005890  20 70 6f 69 6e 74 65 72  20 74 6f 20 27 48 6f 74  | pointer to 'Hot|
000058a0  4b 65 79 27 20 68 61 6e  64 6c 65 72 20 65 76 65  |Key' handler eve|
000058b0  6e 74 20 6c 69 73 74 0d  02 ee 30 5f 55 25 21 36  |nt list...0_U%!6|
000058c0  34 3d 30 20 20 20 20 20  20 20 20 20 3a f4 20 70  |4=0         :. p|
000058d0  6f 69 6e 74 65 72 20 74  6f 20 6d 65 73 73 61 67  |ointer to messag|
000058e0  65 20 62 6c 6f 63 6b 0d  02 ef 30 5f 55 25 21 36  |e block...0_U%!6|
000058f0  38 3d 30 20 20 20 20 20  20 20 20 20 3a f4 20 70  |8=0         :. p|
00005900  6f 69 6e 74 65 72 20 74  6f 20 6d 65 73 73 61 67  |ointer to messag|
00005910  65 20 62 6c 6f 63 6b 0d  02 f0 37 5f 55 25 21 37  |e block...7_U%!7|
00005920  32 3d 30 20 20 20 20 20  20 20 20 20 3a f4 20 70  |2=0         :. p|
00005930  6f 69 6e 74 65 72 20 74  6f 20 64 61 74 61 73 61  |ointer to datasa|
00005940  76 65 20 65 76 65 6e 74  20 62 6c 6f 63 6b 0d 02  |ve event block..|
00005950  f1 35 5f 55 25 21 37 36  3d a4 73 68 65 6c 6c 5f  |.5_U%!76=.shell_|
00005960  48 65 61 70 42 6c 6f 63  6b 46 65 74 63 68 28 32  |HeapBlockFetch(2|
00005970  35 36 29 3a f4 20 6d 65  73 73 61 67 65 20 62 6c  |56):. message bl|
00005980  6f 63 6b 0d 02 f2 36 5f  55 25 21 38 30 3d 30 20  |ock...6_U%!80=0 |
00005990  20 20 20 20 20 20 20 20  3a f4 20 70 6f 69 6e 74  |        :. point|
000059a0  65 72 20 74 6f 20 6c 61  73 74 20 66 75 6c 6c 20  |er to last full |
000059b0  66 69 6c 65 20 6e 61 6d  65 0d 02 f3 38 5f 55 25  |file name...8_U%|
000059c0  21 38 34 3d 2d 31 20 20  20 20 20 20 20 20 3a f4  |!84=-1        :.|
000059d0  20 73 74 6f 72 65 20 6d  79 5f 72 65 66 20 66 72  | store my_ref fr|
000059e0  6f 6d 20 73 61 76 65 20  6f 70 65 72 61 74 69 6f  |om save operatio|
000059f0  6e 0d 02 f4 22 5f 55 25  21 38 38 3d 30 20 20 20  |n..."_U%!88=0   |
00005a00  20 20 20 20 20 20 3a f4  20 3f 3f 3f 3f 3f 3f 3f  |      :. ???????|
00005a10  3f 3f 3f 0d 02 f5 3b 5f  55 25 21 39 32 3d 30 20  |???...;_U%!92=0 |
00005a20  20 20 20 20 20 20 20 20  3a f4 20 70 6f 69 6e 74  |        :. point|
00005a30  65 72 20 74 6f 20 70 61  6e 65 20 68 61 6e 64 6c  |er to pane handl|
00005a40  65 72 20 65 76 65 6e 74  20 62 6c 6f 63 6b 0d 02  |er event block..|
00005a50  f6 37 5f 55 25 21 39 36  3d 30 20 20 20 20 20 20  |.7_U%!96=0      |
00005a60  20 20 20 3a f4 20 70 6f  69 6e 74 65 72 20 74 6f  |   :. pointer to|
00005a70  20 64 61 74 61 6c 6f 61  64 20 65 76 65 6e 74 20  | dataload event |
00005a80  62 6c 6f 63 6b 0d 02 f7  2b 5f 55 25 21 31 30 30  |block...+_U%!100|
00005a90  3d 30 20 20 20 20 20 20  20 20 3a f4 20 45 76 6e  |=0        :. Evn|
00005aa0  74 53 68 65 6c 6c 20 62  69 74 20 66 6c 61 67 73  |tShell bit flags|
00005ab0  0d 02 f8 42 20 20 20 20  20 20 20 20 20 20 20 20  |...B            |
00005ac0  20 20 20 20 20 3a f4 20  62 69 74 20 30 20 20 2d  |     :. bit 0  -|
00005ad0  20 44 72 61 67 41 53 70  72 69 74 65 20 6f 70 65  | DragASprite ope|
00005ae0  72 61 74 69 6f 6e 20 69  6e 20 70 72 6f 67 72 65  |ration in progre|
00005af0  73 73 0d 02 f9 3d 20 20  20 20 20 20 20 20 20 20  |ss...=          |
00005b00  20 20 20 20 20 20 20 3a  f4 20 62 69 74 20 31 20  |       :. bit 1 |
00005b10  20 2d 20 54 6f 70 20 62  69 74 20 64 61 74 61 6c  | - Top bit datal|
00005b20  6f 61 64 20 69 6e 20 70  72 6f 67 72 65 73 73 0d  |oad in progress.|
00005b30  02 fa 3b 20 20 20 20 20  20 20 20 20 20 20 20 20  |..;             |
00005b40  20 20 20 20 3a f4 20 62  69 74 20 32 20 20 2d 20  |    :. bit 2  - |
00005b50  49 6d 70 75 6c 73 65 20  6d 6f 64 75 6c 65 20 69  |Impulse module i|
00005b60  6e 69 74 69 61 6c 69 73  65 64 0d 02 fb 35 20 20  |nitialised...5  |
00005b70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3a  |               :|
00005b80  f4 20 62 69 74 20 33 20  20 2d 20 52 65 73 46 69  |. bit 3  - ResFi|
00005b90  6e 64 20 69 6e 20 6f 70  65 72 61 74 69 6f 6e 0d  |nd in operation.|
00005ba0  02 fc 3b 5f 55 25 21 31  30 34 3d 30 20 20 20 20  |..;_U%!104=0    |
00005bb0  20 20 20 20 3a f4 20 70  6f 69 6e 74 65 72 20 74  |    :. pointer t|
00005bc0  6f 20 62 75 6d 70 20 68  61 6e 64 6c 65 72 20 65  |o bump handler e|
00005bd0  76 65 6e 74 20 62 6c 6f  63 6b 0d 02 fd 20 5f 55  |vent block... _U|
00005be0  25 21 31 30 38 3d 2d 31  20 20 20 20 20 20 20 3a  |%!108=-1       :|
00005bf0  f4 20 53 63 72 70 52 65  66 25 0d 02 fe 20 5f 55  |. ScrpRef%... _U|
00005c00  25 21 31 31 32 3d 2d 31  20 20 20 20 20 20 20 3a  |%!112=-1       :|
00005c10  f4 20 46 74 63 68 52 65  66 25 0d 02 ff 20 5f 55  |. FtchRef%... _U|
00005c20  25 21 31 31 36 3d 2d 31  20 20 20 20 20 20 20 3a  |%!116=-1       :|
00005c30  f4 20 4c 6f 61 64 52 65  66 25 0d 03 00 20 5f 55  |. LoadRef%... _U|
00005c40  25 21 31 32 30 3d 2d 31  20 20 20 20 20 20 20 3a  |%!120=-1       :|
00005c50  f4 20 53 61 76 65 52 65  66 25 0d 03 01 20 5f 55  |. SaveRef%... _U|
00005c60  25 21 31 32 34 3d 2d 31  20 20 20 20 20 20 20 3a  |%!124=-1       :|
00005c70  f4 20 44 72 61 67 52 65  66 25 0d 03 02 1f 5f 55  |. DragRef%...._U|
00005c80  25 21 31 32 38 3d 30 20  20 20 20 20 20 20 20 3a  |%!128=0        :|
00005c90  f4 20 52 41 4d 50 74 72  25 0d 03 03 20 5f 55 25  |. RAMPtr%... _U%|
00005ca0  21 31 33 32 3d 30 20 20  20 20 20 20 20 20 3a f4  |!132=0        :.|
00005cb0  20 52 41 4d 53 69 7a 65  25 0d 03 04 3c 5f 55 25  | RAMSize%...<_U%|
00005cc0  21 31 33 36 3d 2d 31 20  20 20 20 20 20 20 3a f4  |!136=-1       :.|
00005cd0  20 46 69 6c 65 53 69 7a  65 25 20 66 72 6f 6d 20  | FileSize% from |
00005ce0  6c 61 73 74 20 64 61 74  61 73 61 76 65 20 6d 65  |last datasave me|
00005cf0  73 73 61 67 65 0d 03 05  3c 5f 55 25 21 31 34 30  |ssage...<_U%!140|
00005d00  3d 2d 31 20 20 20 20 20  20 20 3a f4 20 46 69 6c  |=-1       :. Fil|
00005d10  65 54 79 70 65 25 20 66  72 6f 6d 20 6c 61 73 74  |eType% from last|
00005d20  20 64 61 74 61 73 61 76  65 20 6d 65 73 73 61 67  | datasave messag|
00005d30  65 0d 03 06 3c 5f 55 25  21 31 34 34 3d 2d 31 20  |e...<_U%!144=-1 |
00005d40  20 20 20 20 20 20 3a f4  20 46 69 6c 65 42 75 66  |      :. FileBuf|
00005d50  66 25 20 66 72 6f 6d 20  6c 61 73 74 20 64 61 74  |f% from last dat|
00005d60  61 73 61 76 65 20 6d 65  73 73 61 67 65 0d 03 07  |asave message...|
00005d70  1f 5f 55 25 21 31 34 38  3d 30 20 20 20 20 20 20  |._U%!148=0      |
00005d80  20 20 3a f4 20 74 61 73  6b 69 64 25 0d 03 08 42  |  :. taskid%...B|
00005d90  5f 55 25 21 31 35 32 3d  30 20 20 20 20 20 20 20  |_U%!152=0       |
00005da0  20 3a f4 20 42 75 66 66  65 72 20 6c 69 73 74 20  | :. Buffer list |
00005db0  6f 66 20 6c 6f 61 64 65  64 20 66 69 6c 65 73 2c  |of loaded files,|
00005dc0  20 2d 31 20 74 65 72 6d  69 6e 61 74 6f 72 0d 03  | -1 terminator..|
00005dd0  09 45 5f 55 25 21 31 35  36 3d 30 20 20 20 20 20  |.E_U%!156=0     |
00005de0  20 20 20 3a f4 20 48 65  61 70 42 6c 6f 63 6b 20  |   :. HeapBlock |
00005df0  77 69 74 68 20 63 6f 70  79 20 6f 66 20 44 61 74  |with copy of Dat|
00005e00  61 53 61 76 65 20 6d 65  73 73 61 67 65 20 62 6c  |aSave message bl|
00005e10  6f 63 6b 0d 03 0a 33 20  20 20 20 20 20 20 20 20  |ock...3         |
00005e20  20 20 20 20 20 20 20 20  3a f4 20 66 6f 72 20 77  |        :. for w|
00005e30  68 65 6e 20 52 41 4d 20  74 72 61 6e 73 66 65 72  |hen RAM transfer|
00005e40  20 66 61 69 6c 73 0d 03  0b 3c 5f 55 25 21 31 36  | fails...<_U%!16|
00005e50  30 3d 30 20 20 20 20 20  20 20 20 3a f4 20 50 6f  |0=0        :. Po|
00005e60  69 6e 74 65 72 20 74 6f  20 4d 6f 64 65 43 68 61  |inter to ModeCha|
00005e70  6e 67 65 20 65 76 65 6e  74 20 66 75 6e 63 74 69  |nge event functi|
00005e80  6f 6e 0d 03 0c 3f 5f 55  25 21 31 36 34 3d 30 20  |on...?_U%!164=0 |
00005e90  20 20 20 20 20 20 20 3a  f4 20 50 6f 69 6e 74 65  |       :. Pointe|
00005ea0  72 20 74 6f 20 50 61 6c  65 74 74 65 43 68 61 6e  |r to PaletteChan|
00005eb0  67 65 20 65 76 65 6e 74  20 66 75 6e 63 74 69 6f  |ge event functio|
00005ec0  6e 0d 03 0d 40 5f 55 25  21 31 36 38 3d 30 20 20  |n...@_U%!168=0  |
00005ed0  20 20 20 20 20 20 3a f4  20 50 6f 69 6e 74 65 72  |      :. Pointer|
00005ee0  20 74 6f 20 54 61 73 6b  49 6e 69 74 69 61 6c 69  | to TaskInitiali|
00005ef0  73 65 20 65 76 65 6e 74  20 66 75 6e 63 74 69 6f  |se event functio|
00005f00  6e 0d 03 0e 3f 5f 55 25  21 31 37 32 3d 30 20 20  |n...?_U%!172=0  |
00005f10  20 20 20 20 20 20 3a f4  20 50 6f 69 6e 74 65 72  |      :. Pointer|
00005f20  20 74 6f 20 54 61 73 6b  43 6c 6f 73 65 44 6f 77  | to TaskCloseDow|
00005f30  6e 20 65 76 65 6e 74 20  66 75 6e 63 74 69 6f 6e  |n event function|
00005f40  0d 03 0f 35 5f 55 25 21  31 37 36 3d 30 20 20 20  |...5_U%!176=0   |
00005f50  20 20 20 20 20 3a f4 20  50 6f 69 6e 74 65 72 20  |     :. Pointer |
00005f60  74 6f 20 63 75 72 72 65  6e 74 20 6d 65 6e 75 20  |to current menu |
00005f70  74 69 74 6c 65 0d 03 10  38 5f 55 25 21 31 38 30  |title...8_U%!180|
00005f80  3d 30 20 20 20 20 20 20  20 20 3a f4 20 6e 72 20  |=0        :. nr |
00005f90  6f 66 20 27 68 6f 74 6b  65 79 27 20 65 76 65 6e  |of 'hotkey' even|
00005fa0  74 73 20 72 65 67 69 73  74 65 72 65 64 0d 03 11  |ts registered...|
00005fb0  39 5f 55 25 21 31 38 34  3d 30 20 20 20 20 20 20  |9_U%!184=0      |
00005fc0  20 20 3a f4 20 50 6f 69  6e 74 65 72 20 74 6f 20  |  :. Pointer to |
00005fd0  6c 69 73 74 20 6f 66 20  73 74 61 74 69 63 20 77  |list of static w|
00005fe0  69 6e 64 6f 77 73 0d 03  12 2f 5f 55 25 21 31 38  |indows.../_U%!18|
00005ff0  38 3d 30 20 20 20 20 20  20 20 20 3a f4 20 74 6f  |8=0        :. to|
00006000  20 73 68 65 6c 6c 5f 41  70 70 44 69 72 24 20 62  | shell_AppDir$ b|
00006010  75 66 66 65 72 0d 03 13  33 5f 55 25 21 31 39 32  |uffer...3_U%!192|
00006020  3d 30 20 20 20 20 20 20  20 20 3a f4 20 74 6f 20  |=0        :. to |
00006030  73 68 65 6c 6c 5f 41 70  70 44 61 74 61 44 69 72  |shell_AppDataDir|
00006040  24 20 62 75 66 66 65 72  0d 03 14 30 5f 55 25 21  |$ buffer...0_U%!|
00006050  31 39 36 3d 30 20 20 20  20 20 20 20 20 3a f4 20  |196=0        :. |
00006060  74 6f 20 73 68 65 6c 6c  5f 41 70 70 4e 61 6d 65  |to shell_AppName|
00006070  24 20 62 75 66 66 65 72  0d 03 15 40 5f 55 25 21  |$ buffer...@_U%!|
00006080  32 30 30 3d 30 20 20 20  20 20 20 20 20 3a f4 20  |200=0        :. |
00006090  77 69 6e 64 6f 77 20 68  61 6e 64 6c 65 20 66 72  |window handle fr|
000060a0  6f 6d 20 6c 61 73 74 20  44 61 74 61 53 61 76 65  |om last DataSave|
000060b0  20 6d 65 73 73 61 67 65  0d 03 16 3e 5f 55 25 21  | message...>_U%!|
000060c0  32 30 34 3d 30 20 20 20  20 20 20 20 20 3a f4 20  |204=0        :. |
000060d0  69 63 6f 6e 20 68 61 6e  64 6c 65 20 66 72 6f 6d  |icon handle from|
000060e0  20 6c 61 73 74 20 44 61  74 61 53 61 76 65 20 6d  | last DataSave m|
000060f0  65 73 73 61 67 65 0d 03  17 3e 5f 55 25 21 32 30  |essage...>_U%!20|
00006100  38 3d 2d 31 20 20 20 20  20 20 20 3a f4 20 68 65  |8=-1       :. he|
00006110  6c 70 68 61 6e 64 6c 65  25 20 28 74 61 73 6b 20  |lphandle% (task |
00006120  68 61 6e 64 6c 65 20 6f  66 20 53 74 72 6f 6e 67  |handle of Strong|
00006130  48 6c 70 29 0d 03 18 44  5f 55 25 21 32 31 32 3d  |Hlp)...D_U%!212=|
00006140  2d 31 20 20 20 20 20 20  20 3a f4 20 69 63 6f 6e  |-1       :. icon|
00006150  74 72 79 25 20 20 20 20  28 75 73 65 64 20 62 79  |try%    (used by|
00006160  20 53 74 72 6f 6e 67 48  6c 70 20 66 69 6e 64 20  | StrongHlp find |
00006170  72 6f 75 74 69 6e 65 29  0d 03 19 48 5f 55 25 21  |routine)...H_U%!|
00006180  32 31 36 3d 30 20 20 20  20 20 20 20 20 3a f4 20  |216=0        :. |
00006190  70 6f 69 6e 74 65 72 20  74 6f 20 70 65 6e 64 69  |pointer to pendi|
000061a0  6e 67 24 20 62 75 66 66  65 72 20 66 6f 72 20 53  |ng$ buffer for S|
000061b0  74 72 6f 6e 67 48 6c 70  20 63 6f 6d 6d 61 6e 64  |trongHlp command|
000061c0  0d 03 1a 3b 5f 55 25 21  32 32 30 3d 30 20 20 20  |...;_U%!220=0   |
000061d0  20 20 20 20 20 3a f4 20  70 6f 69 6e 74 65 72 20  |     :. pointer |
000061e0  74 6f 20 6d 65 6e 75 20  77 61 72 6e 69 6e 67 20  |to menu warning |
000061f0  65 76 65 6e 74 20 62 6c  6f 63 6b 0d 03 1b 3b 5f  |event block...;_|
00006200  55 25 21 32 32 34 3d 30  20 20 20 20 20 20 20 20  |U%!224=0        |
00006210  3a f4 20 70 6f 69 6e 74  65 72 20 74 6f 20 6c 61  |:. pointer to la|
00006220  73 74 20 6d 65 6e 75 5f  77 61 72 6e 20 66 6e 20  |st menu_warn fn |
00006230  63 61 6c 6c 65 64 0d 03  1c 49 5f 55 25 21 32 32  |called...I_U%!22|
00006240  38 3d 30 20 20 20 20 20  20 20 20 3a f4 20 68 61  |8=0        :. ha|
00006250  6e 64 6c 65 20 6f 66 20  77 61 72 6e 69 6e 67 20  |ndle of warning |
00006260  64 69 61 6c 6f 67 20 75  73 65 64 20 66 6f 72 20  |dialog used for |
00006270  6d 65 6e 75 20 69 74 65  6d 73 20 74 68 61 74 0d  |menu items that.|
00006280  03 1d 3a 20 20 20 20 20  20 20 20 20 20 20 20 20  |..:             |
00006290  20 20 20 20 3a f4 20 68  61 76 65 20 6e 6f 74 20  |    :. have not |
000062a0  68 61 64 20 61 20 64 69  61 6c 6f 67 20 62 6f 78  |had a dialog box|
000062b0  20 61 74 74 61 63 68 65  64 0d 03 1e 3c 5f 55 25  | attached...<_U%|
000062c0  21 32 33 32 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |!232=.shell_Heap|
000062d0  42 6c 6f 63 6b 46 65 74  63 68 28 32 35 36 29 3a  |BlockFetch(256):|
000062e0  f4 20 66 6f 6e 74 63 6f  75 6e 74 73 25 20 61 72  |. fontcounts% ar|
000062f0  72 61 79 2e 2e 0d 03 1f  3d 5f 55 25 21 32 33 36  |ray.....=_U%!236|
00006300  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
00006310  6b 46 65 74 63 68 28 32  35 36 29 3a f4 20 66 6f  |kFetch(256):. fo|
00006320  6e 74 62 69 6e 64 69 6e  67 25 20 61 72 72 61 79  |ntbinding% array|
00006330  2e 2e 0d 03 20 4e 5f 55  25 21 32 34 30 3d 2d 31  |.... N_U%!240=-1|
00006340  20 20 20 20 20 20 20 3a  f4 20 6e 72 20 6f 66 20  |       :. nr of |
00006350  6f 75 74 6c 69 6e 65 20  66 6f 6e 74 73 20 6f 6e  |outline fonts on|
00006360  20 73 79 73 74 65 6d 2c  20 2d 31 20 69 66 20 22  | system, -1 if "|
00006370  46 6f 6e 74 4d 65 6e 75  5f 43 72 65 61 74 65 22  |FontMenu_Create"|
00006380  0d 03 21 2b 20 20 20 20  20 20 20 20 20 20 20 20  |..!+            |
00006390  20 20 20 20 20 3a f4 20  68 61 73 20 6e 6f 74 20  |     :. has not |
000063a0  62 65 65 6e 20 63 61 6c  6c 65 64 0d 03 22 47 5f  |been called.."G_|
000063b0  55 25 21 32 34 34 3d 30  20 20 20 20 20 20 20 20  |U%!244=0        |
000063c0  3a f4 20 70 74 72 20 74  6f 20 63 75 72 72 65 6e  |:. ptr to curren|
000063d0  74 6c 79 20 73 65 6c 65  63 74 65 64 20 66 6f 6e  |tly selected fon|
000063e0  74 20 6e 61 6d 65 20 69  6e 20 46 6f 6e 74 4d 65  |t name in FontMe|
000063f0  6e 75 0d 03 23 33 5f 55  25 21 32 34 38 3d 30 20  |nu..#3_U%!248=0 |
00006400  20 20 20 20 20 20 20 3a  f4 20 70 74 72 20 74 6f  |       :. ptr to|
00006410  20 6c 61 73 74 20 6b 6e  6f 77 6e 20 46 6f 6e 74  | last known Font|
00006420  24 50 61 74 68 0d 03 24  3c 5f 55 25 21 32 35 32  |$Path..$<_U%!252|
00006430  3d 30 20 20 20 20 20 20  20 20 3a f4 20 6c 61 73  |=0        :. las|
00006440  74 20 6b 6e 6f 77 6e 20  70 74 72 20 74 6f 20 46  |t known ptr to F|
00006450  6f 6e 74 4d 65 6e 75 20  73 74 72 75 63 74 75 72  |ontMenu structur|
00006460  65 0d 03 25 4d 5f 55 25  21 32 35 36 3d 30 20 20  |e..%M_U%!256=0  |
00006470  20 20 20 20 20 20 3a f4  20 70 74 72 20 74 6f 20  |      :. ptr to |
00006480  68 65 61 70 62 6c 6f 63  6b 20 68 6f 6c 64 69 6e  |heapblock holdin|
00006490  67 20 27 4d 65 6e 75 73  53 65 6c 65 63 74 69 6f  |g 'MenusSelectio|
000064a0  6e 53 6f 46 61 72 27 20  73 74 72 69 6e 67 0d 03  |nSoFar' string..|
000064b0  26 4c 5f 55 25 21 32 36  30 3d 31 20 20 20 20 20  |&L_U%!260=1     |
000064c0  20 20 20 3a f4 20 53 79  73 74 65 6d 46 6f 6e 74  |   :. SystemFont|
000064d0  20 66 6c 61 67 20 66 6f  72 20 46 6f 6e 74 4d 65  | flag for FontMe|
000064e0  6e 75 20 30 20 6e 6f 20  73 79 73 66 6f 6e 74 2c  |nu 0 no sysfont,|
000064f0  20 31 20 73 79 73 66 6f  6e 74 0d 03 27 33 5f 55  | 1 sysfont..'3_U|
00006500  25 21 32 36 34 3d 30 20  20 20 20 20 20 20 20 3a  |%!264=0        :|
00006510  f4 20 46 6f 6e 74 4d 65  6e 75 20 69 73 20 6f 70  |. FontMenu is op|
00006520  65 6e 65 64 20 28 31 20  6f 72 20 30 29 0d 03 28  |ened (1 or 0)..(|
00006530  4a 5f 55 25 21 32 36 38  3d 30 20 20 20 20 20 20  |J_U%!268=0      |
00006540  20 20 3a f4 20 46 6f 6e  74 4d 65 6e 75 20 76 61  |  :. FontMenu va|
00006550  6c 69 64 20 73 65 6c 65  63 74 69 6f 6e 20 66 6c  |lid selection fl|
00006560  61 67 20 30 20 6e 6f 6e  20 76 61 6c 69 64 2c 20  |ag 0 non valid, |
00006570  31 20 76 61 6c 69 64 0d  03 29 40 5f 55 25 21 32  |1 valid..)@_U%!2|
00006580  37 32 3d 30 20 20 20 20  20 20 20 20 3a f4 20 78  |72=0        :. x|
00006590  20 63 6f 6f 72 64 20 6c  61 73 74 20 6d 6f 75 73  | coord last mous|
000065a0  65 20 63 6c 69 63 6b 20  28 73 63 72 65 65 6e 20  |e click (screen |
000065b0  63 6f 6f 72 64 73 29 0d  03 2a 40 5f 55 25 21 32  |coords)..*@_U%!2|
000065c0  37 36 3d 30 20 20 20 20  20 20 20 20 3a f4 20 79  |76=0        :. y|
000065d0  20 63 6f 6f 72 64 20 6c  61 73 74 20 6d 6f 75 73  | coord last mous|
000065e0  65 20 63 6c 69 63 6b 20  28 73 63 72 65 65 6e 20  |e click (screen |
000065f0  63 6f 6f 72 64 73 29 0d  03 2b 3b 5f 55 25 21 32  |coords)..+;_U%!2|
00006600  38 30 3d 30 20 20 20 20  20 20 20 20 3a f4 20 6d  |80=0        :. m|
00006610  5f 66 69 6c 65 64 65 73  63 25 20 66 6f 72 20 73  |_filedesc% for s|
00006620  79 73 74 65 6d 20 6d 65  73 73 61 67 65 20 66 69  |ystem message fi|
00006630  6c 65 0d 03 2c 3b 5f 55  25 21 32 38 34 3d 30 20  |le..,;_U%!284=0 |
00006640  20 20 20 20 20 20 20 3a  f4 20 6d 5f 62 75 66 66  |       :. m_buff|
00006650  65 72 25 20 20 20 66 6f  72 20 73 79 73 74 65 6d  |er%   for system|
00006660  20 6d 65 73 73 61 67 65  20 66 69 6c 65 0d 03 2d  | message file..-|
00006670  39 5f 55 25 21 32 38 38  3d 2d 31 20 20 20 20 20  |9_U%!288=-1     |
00006680  20 20 3a f4 20 77 69 6e  64 6f 77 20 68 61 6e 64  |  :. window hand|
00006690  6c 65 20 66 6f 72 20 6c  61 73 74 20 62 75 6d 70  |le for last bump|
000066a0  20 65 76 65 6e 74 0d 03  2e 37 5f 55 25 21 32 39  | event...7_U%!29|
000066b0  32 3d 2d 31 20 20 20 20  20 20 20 3a f4 20 69 63  |2=-1       :. ic|
000066c0  6f 6e 20 68 61 6e 64 6c  65 20 66 6f 72 20 6c 61  |on handle for la|
000066d0  73 74 20 62 75 6d 70 20  65 76 65 6e 74 0d 03 2f  |st bump event../|
000066e0  3a 5f 55 25 21 32 39 36  3d 2d 31 20 20 20 20 20  |:_U%!296=-1     |
000066f0  20 20 3a f4 20 6c 61 73  74 20 65 76 65 6e 74 20  |  :. last event |
00006700  6f 66 66 73 65 74 20 66  6f 72 20 62 75 6d 70 20  |offset for bump |
00006710  68 61 6e 64 6c 65 72 0d  03 30 3a 5f 55 25 21 33  |handler..0:_U%!3|
00006720  30 30 3d 30 20 20 20 20  20 20 20 20 3a f4 20 70  |00=0        :. p|
00006730  6f 69 6e 74 65 72 20 74  6f 20 50 72 65 51 75 69  |ointer to PreQui|
00006740  74 20 48 61 6e 64 6c 65  72 20 72 6f 75 74 69 6e  |t Handler routin|
00006750  65 0d 03 31 39 5f 55 25  21 33 30 34 3d 30 20 20  |e..19_U%!304=0  |
00006760  20 20 20 20 20 20 3a f4  20 70 6f 69 6e 74 65 72  |      :. pointer|
00006770  20 74 6f 20 4f 70 65 6e  57 69 6e 64 6f 77 20 65  | to OpenWindow e|
00006780  76 65 6e 74 20 62 6c 6f  63 6b 0d 03 32 3a 5f 55  |vent block..2:_U|
00006790  25 21 33 30 38 3d 30 20  20 20 20 20 20 20 20 3a  |%!308=0        :|
000067a0  f4 20 70 6f 69 6e 74 65  72 20 74 6f 20 43 6c 6f  |. pointer to Clo|
000067b0  73 65 57 69 6e 64 6f 77  20 65 76 65 6e 74 20 62  |seWindow event b|
000067c0  6c 6f 63 6b 0d 03 33 3b  5f 55 25 21 33 31 32 3d  |lock..3;_U%!312=|
000067d0  30 20 20 20 20 20 20 20  20 3a f4 20 70 6f 69 6e  |0        :. poin|
000067e0  74 65 72 20 74 6f 20 53  68 75 74 64 6f 77 6e 20  |ter to Shutdown |
000067f0  48 61 6e 64 6c 65 72 20  72 6f 75 74 69 6e 65 0d  |Handler routine.|
00006800  03 34 44 5f 55 25 21 33  31 36 3d 30 20 20 20 20  |.4D_U%!316=0    |
00006810  20 20 20 20 3a f4 20 4f  53 20 76 65 72 73 69 6f  |    :. OS versio|
00006820  6e 20 6e 72 20 61 73 20  72 65 74 75 72 6e 65 64  |n nr as returned|
00006830  20 62 79 20 57 69 6d 70  5f 49 6e 69 74 69 61 6c  | by Wimp_Initial|
00006840  69 73 65 0d 03 35 21 f2  73 68 65 6c 6c 5f 4d 65  |ise..5!.shell_Me|
00006850  6d 46 69 6c 6c 28 5f 55  25 21 32 33 32 2c 32 35  |mFill(_U%!232,25|
00006860  36 2c 30 29 0d 03 36 21  f2 73 68 65 6c 6c 5f 4d  |6,0)..6!.shell_M|
00006870  65 6d 46 69 6c 6c 28 5f  55 25 21 32 33 36 2c 32  |emFill(_U%!236,2|
00006880  35 36 2c 30 29 0d 03 37  12 5f 65 72 72 6f 72 5f  |56,0)..7._error_|
00006890  66 6c 61 67 25 3d 33 0d  03 38 05 e1 0d 03 39 05  |flag%=3..8....9.|
000068a0  3a 0d 03 3a 19 2a 7c 53  74 6f 70 20 50 52 4f 43  |:..:.*|Stop PROC|
000068b0  73 68 65 6c 6c 5f 49 6e  69 74 0d 03 3b 04 0d 03  |shell_Init..;...|
000068c0  3c 1c 2a 7c 53 74 61 72  74 20 46 4e 73 68 65 6c  |<.*|Start FNshel|
000068d0  6c 5f 46 69 6c 65 54 79  70 65 0d 03 3d 1e dd 20  |l_FileType..=.. |
000068e0  a4 73 68 65 6c 6c 5f 46  69 6c 65 54 79 70 65 28  |.shell_FileType(|
000068f0  6f 62 6a 65 63 74 24 29  0d 03 3e 0b ea 20 74 79  |object$)..>.. ty|
00006900  70 65 25 0d 03 3f 24 c8  99 20 22 4f 53 5f 46 69  |pe%..?$.. "OS_Fi|
00006910  6c 65 22 2c 35 2c 6f 62  6a 65 63 74 24 20 b8 20  |le",5,object$ . |
00006920  2c 2c 74 79 70 65 25 0d  03 40 1e 74 79 70 65 25  |,,type%..@.type%|
00006930  3d 28 74 79 70 65 25 20  80 20 26 46 46 46 30 30  |=(type% . &FFF00|
00006940  29 3e 3e 3e 38 0d 03 41  0a 3d 74 79 70 65 25 0d  |)>>>8..A.=type%.|
00006950  03 42 05 3a 0d 03 43 1b  2a 7c 53 74 6f 70 20 46  |.B.:..C.*|Stop F|
00006960  4e 73 68 65 6c 6c 5f 46  69 6c 65 54 79 70 65 0d  |Nshell_FileType.|
00006970  03 44 04 0d 03 45 1e 2a  7c 53 74 61 72 74 20 46  |.D...E.*|Start F|
00006980  4e 73 68 65 6c 6c 5f 46  69 6c 65 45 78 69 73 74  |Nshell_FileExist|
00006990  73 0d 03 46 20 dd 20 a4  73 68 65 6c 6c 5f 46 69  |s..F . .shell_Fi|
000069a0  6c 65 45 78 69 73 74 73  28 6f 62 6a 65 63 74 24  |leExists(object$|
000069b0  29 0d 03 47 30 e7 20 a4  73 68 65 6c 6c 5f 43 61  |)..G0. .shell_Ca|
000069c0  74 49 6e 66 6f 52 65 61  64 28 6f 62 6a 65 63 74  |tInfoRead(object|
000069d0  24 29 3d 22 4e 6f 74 20  46 6f 75 6e 64 22 3a 3d  |$)="Not Found":=|
000069e0  a3 0d 03 48 06 3d b9 0d  03 49 05 3a 0d 03 4a 1d  |...H.=...I.:..J.|
000069f0  2a 7c 53 74 6f 70 20 46  4e 73 68 65 6c 6c 5f 46  |*|Stop FNshell_F|
00006a00  69 6c 65 45 78 69 73 74  73 0d 03 4b 04 0d 03 4c  |ileExists..K...L|
00006a10  1f 2a 7c 53 74 61 72 74  20 46 4e 73 68 65 6c 6c  |.*|Start FNshell|
00006a20  5f 43 61 74 49 6e 66 6f  52 65 61 64 0d 03 4d 21  |_CatInfoRead..M!|
00006a30  dd 20 a4 73 68 65 6c 6c  5f 43 61 74 49 6e 66 6f  |. .shell_CatInfo|
00006a40  52 65 61 64 28 6f 62 6a  65 63 74 24 29 0d 03 4e  |Read(object$)..N|
00006a50  37 ea 20 74 79 70 65 25  2c 6c 6f 61 64 5f 61 64  |7. type%,load_ad|
00006a60  64 72 25 2c 65 78 65 63  5f 61 64 64 72 25 2c 6c  |dr%,exec_addr%,l|
00006a70  65 6e 67 74 68 25 2c 61  74 74 73 25 2c 73 74 72  |ength%,atts%,str|
00006a80  69 6e 67 24 0d 03 4f 47  c8 99 20 22 4f 53 5f 46  |ing$..OG.. "OS_F|
00006a90  69 6c 65 22 2c 35 2c 6f  62 6a 65 63 74 24 20 b8  |ile",5,object$ .|
00006aa0  20 74 79 70 65 25 2c 2c  6c 6f 61 64 5f 61 64 64  | type%,,load_add|
00006ab0  72 25 2c 65 78 65 63 5f  61 64 64 72 25 2c 6c 65  |r%,exec_addr%,le|
00006ac0  6e 67 74 68 25 2c 61 74  74 73 25 0d 03 50 1d e7  |ngth%,atts%..P..|
00006ad0  20 74 79 70 65 25 3d 30  20 8c 20 3d 20 22 4e 6f  | type%=0 . = "No|
00006ae0  74 20 46 6f 75 6e 64 22  0d 03 51 20 e7 20 61 74  |t Found"..Q . at|
00006af0  74 73 25 3d 35 31 20 20  8c 20 73 74 72 69 6e 67  |ts%=51  . string|
00006b00  24 2b 3d 22 57 52 20 22  0d 03 52 20 e7 20 61 74  |$+="WR "..R . at|
00006b10  74 73 25 3d 31 38 37 20  8c 20 73 74 72 69 6e 67  |ts%=187 . string|
00006b20  24 2b 3d 22 4c 57 52 22  0d 03 53 20 e7 20 61 74  |$+="LWR"..S . at|
00006b30  74 73 25 3d 31 33 36 20  8c 20 73 74 72 69 6e 67  |ts%=136 . string|
00006b40  24 2b 3d 22 44 4c 20 22  0d 03 54 3c 73 74 72 69  |$+="DL "..T<stri|
00006b50  6e 67 24 2b 3d 22 20 22  2b a4 73 68 65 6c 6c 5f  |ng$+=" "+.shell_|
00006b60  53 74 72 69 6e 67 50 61  64 4c 65 61 64 69 6e 67  |StringPadLeading|
00006b70  28 c3 7e 6c 6f 61 64 5f  61 64 64 72 25 2c 22 30  |(.~load_addr%,"0|
00006b80  22 2c 38 29 0d 03 55 3c  73 74 72 69 6e 67 24 2b  |",8)..U<string$+|
00006b90  3d 22 20 22 2b a4 73 68  65 6c 6c 5f 53 74 72 69  |=" "+.shell_Stri|
00006ba0  6e 67 50 61 64 4c 65 61  64 69 6e 67 28 c3 7e 65  |ngPadLeading(.~e|
00006bb0  78 65 63 5f 61 64 64 72  25 2c 22 30 22 2c 38 29  |xec_addr%,"0",8)|
00006bc0  0d 03 56 39 73 74 72 69  6e 67 24 2b 3d 22 20 22  |..V9string$+=" "|
00006bd0  2b a4 73 68 65 6c 6c 5f  53 74 72 69 6e 67 50 61  |+.shell_StringPa|
00006be0  64 4c 65 61 64 69 6e 67  28 c3 7e 6c 65 6e 67 74  |dLeading(.~lengt|
00006bf0  68 25 2c 22 30 22 2c 38  29 0d 03 57 0c 3d 73 74  |h%,"0",8)..W.=st|
00006c00  72 69 6e 67 24 0d 03 58  05 3a 0d 03 59 1e 2a 7c  |ring$..X.:..Y.*||
00006c10  53 74 6f 70 20 46 4e 73  68 65 6c 6c 5f 43 61 74  |Stop FNshell_Cat|
00006c20  49 6e 66 6f 52 65 61 64  0d 03 5a 1d 2a 7c 53 74  |InfoRead..Z.*|St|
00006c30  61 72 74 20 46 4e 73 68  65 6c 6c 5f 47 65 74 41  |art FNshell_GetA|
00006c40  70 70 44 69 72 0d 03 5b  16 dd 20 a4 73 68 65 6c  |ppDir..[.. .shel|
00006c50  6c 5f 47 65 74 41 70 70  44 69 72 0d 03 5c 0b ea  |l_GetAppDir..\..|
00006c60  20 74 65 6d 70 25 0d 03  5d 11 74 65 6d 70 25 3d  | temp%..].temp%=|
00006c70  5f 55 25 21 31 38 38 0d  03 5e 0b 3d 24 74 65 6d  |_U%!188..^.=$tem|
00006c80  70 25 0d 03 5f 05 3a 0d  03 60 1c 2a 7c 53 74 6f  |p%.._.:..`.*|Sto|
00006c90  70 20 46 4e 73 68 65 6c  6c 5f 47 65 74 41 70 70  |p FNshell_GetApp|
00006ca0  44 69 72 0d 03 61 21 2a  7c 53 74 61 72 74 20 46  |Dir..a!*|Start F|
00006cb0  4e 73 68 65 6c 6c 5f 47  65 74 41 70 70 44 61 74  |Nshell_GetAppDat|
00006cc0  61 44 69 72 0d 03 62 1a  dd 20 a4 73 68 65 6c 6c  |aDir..b.. .shell|
00006cd0  5f 47 65 74 41 70 70 44  61 74 61 44 69 72 0d 03  |_GetAppDataDir..|
00006ce0  63 0b ea 20 74 65 6d 70  25 0d 03 64 11 74 65 6d  |c.. temp%..d.tem|
00006cf0  70 25 3d 5f 55 25 21 31  39 32 0d 03 65 0b 3d 24  |p%=_U%!192..e.=$|
00006d00  74 65 6d 70 25 0d 03 66  05 3a 0d 03 67 20 2a 7c  |temp%..f.:..g *||
00006d10  53 74 6f 70 20 46 4e 73  68 65 6c 6c 5f 47 65 74  |Stop FNshell_Get|
00006d20  41 70 70 44 61 74 61 44  69 72 0d 03 68 1e 2a 7c  |AppDataDir..h.*||
00006d30  53 74 61 72 74 20 46 4e  73 68 65 6c 6c 5f 47 65  |Start FNshell_Ge|
00006d40  74 41 70 70 4e 61 6d 65  0d 03 69 17 dd 20 a4 73  |tAppName..i.. .s|
00006d50  68 65 6c 6c 5f 47 65 74  41 70 70 4e 61 6d 65 0d  |hell_GetAppName.|
00006d60  03 6a 0b ea 20 74 65 6d  70 25 0d 03 6b 11 74 65  |.j.. temp%..k.te|
00006d70  6d 70 25 3d 5f 55 25 21  31 39 36 0d 03 6c 0b 3d  |mp%=_U%!196..l.=|
00006d80  24 74 65 6d 70 25 0d 03  6d 05 3a 0d 03 6e 1d 2a  |$temp%..m.:..n.*|
00006d90  7c 53 74 6f 70 20 46 4e  73 68 65 6c 6c 5f 47 65  ||Stop FNshell_Ge|
00006da0  74 41 70 70 4e 61 6d 65  0d 03 6f 04 0d 03 70 23  |tAppName..o...p#|
00006db0  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
00006dc0  6c 5f 52 65 73 6f 75 72  63 65 73 49 6e 69 74 0d  |l_ResourcesInit.|
00006dd0  03 71 1a dd 20 f2 73 68  65 6c 6c 5f 52 65 73 6f  |.q.. .shell_Reso|
00006de0  75 72 63 65 73 49 6e 69  74 0d 03 72 3a ea 20 73  |urcesInit..r:. s|
00006df0  68 65 6c 6c 5f 41 70 70  44 69 72 24 2c 73 68 65  |hell_AppDir$,she|
00006e00  6c 6c 5f 41 70 70 4e 61  6d 65 24 2c 73 68 65 6c  |ll_AppName$,shel|
00006e10  6c 5f 41 70 70 44 61 74  61 44 69 72 24 2c 74 65  |l_AppDataDir$,te|
00006e20  6d 70 25 0d 03 73 10 ea  20 4f 53 56 61 72 42 75  |mp%..s.. OSVarBu|
00006e30  66 66 25 0d 03 74 29 4f  53 56 61 72 42 75 66 66  |ff%..t)OSVarBuff|
00006e40  25 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |%=.shell_HeapBlo|
00006e50  63 6b 46 65 74 63 68 28  32 35 36 29 0d 03 75 41  |ckFetch(256)..uA|
00006e60  73 68 65 6c 6c 5f 41 70  70 44 69 72 24 3d a4 73  |shell_AppDir$=.s|
00006e70  68 65 6c 6c 5f 4f 53 56  61 72 47 65 74 56 61 6c  |hell_OSVarGetVal|
00006e80  28 4f 53 56 61 72 42 75  66 66 25 2c 32 35 36 2c  |(OSVarBuff%,256,|
00006e90  22 4f 62 65 79 24 44 69  72 22 2c 31 29 0d 03 76  |"Obey$Dir",1)..v|
00006ea0  31 73 68 65 6c 6c 5f 41  70 70 4e 61 6d 65 24 3d  |1shell_AppName$=|
00006eb0  c1 a4 73 68 65 6c 6c 5f  4c 65 61 66 28 73 68 65  |..shell_Leaf(she|
00006ec0  6c 6c 5f 41 70 70 44 69  72 24 29 2c 32 29 0d 03  |ll_AppDir$),2)..|
00006ed0  77 35 5f 55 25 21 31 38  38 3d a4 73 68 65 6c 6c  |w5_U%!188=.shell|
00006ee0  5f 48 65 61 70 42 6c 6f  63 6b 46 65 74 63 68 28  |_HeapBlockFetch(|
00006ef0  28 a9 73 68 65 6c 6c 5f  41 70 70 44 69 72 24 29  |(.shell_AppDir$)|
00006f00  2b 31 29 0d 03 78 36 5f  55 25 21 31 39 36 3d a4  |+1)..x6_U%!196=.|
00006f10  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
00006f20  65 74 63 68 28 28 a9 73  68 65 6c 6c 5f 41 70 70  |etch((.shell_App|
00006f30  4e 61 6d 65 24 29 2b 31  29 0d 03 79 26 74 65 6d  |Name$)+1)..y&tem|
00006f40  70 25 3d 5f 55 25 21 31  38 38 3a 24 74 65 6d 70  |p%=_U%!188:$temp|
00006f50  25 3d 73 68 65 6c 6c 5f  41 70 70 44 69 72 24 0d  |%=shell_AppDir$.|
00006f60  03 7a 27 74 65 6d 70 25  3d 5f 55 25 21 31 39 36  |.z'temp%=_U%!196|
00006f70  3a 24 74 65 6d 70 25 3d  73 68 65 6c 6c 5f 41 70  |:$temp%=shell_Ap|
00006f80  70 4e 61 6d 65 24 0d 03  7b 40 e7 20 a4 73 68 65  |pName$..{@. .she|
00006f90  6c 6c 5f 4f 53 56 61 72  45 78 69 73 74 73 28 4f  |ll_OSVarExists(O|
00006fa0  53 56 61 72 42 75 66 66  25 2c 73 68 65 6c 6c 5f  |SVarBuff%,shell_|
00006fb0  41 70 70 4e 61 6d 65 24  2b 22 52 65 73 24 50 61  |AppName$+"Res$Pa|
00006fc0  74 68 22 29 20 8c 0d 03  7c 33 20 20 5f 55 25 21  |th") ...|3  _U%!|
00006fd0  31 30 30 3d 5f 55 25 21  31 30 30 20 84 20 31 3c  |100=_U%!100 . 1<|
00006fe0  3c 33 3a f4 20 73 65 74  20 27 52 65 73 46 69 6e  |<3:. set 'ResFin|
00006ff0  64 27 20 66 6c 61 67 2e  2e 0d 03 7d 05 cd 0d 03  |d' flag....}....|
00007000  7e 40 e7 20 a4 73 68 65  6c 6c 5f 4f 53 56 61 72  |~@. .shell_OSVar|
00007010  45 78 69 73 74 73 28 4f  53 56 61 72 42 75 66 66  |Exists(OSVarBuff|
00007020  25 2c 73 68 65 6c 6c 5f  41 70 70 4e 61 6d 65 24  |%,shell_AppName$|
00007030  2b 22 44 61 74 61 24 44  69 72 22 29 20 8c 0d 03  |+"Data$Dir") ...|
00007040  7f 56 20 20 73 68 65 6c  6c 5f 41 70 70 44 61 74  |.V  shell_AppDat|
00007050  61 44 69 72 24 3d a4 73  68 65 6c 6c 5f 4f 53 56  |aDir$=.shell_OSV|
00007060  61 72 47 65 74 56 61 6c  28 4f 53 56 61 72 42 75  |arGetVal(OSVarBu|
00007070  66 66 25 2c 32 35 36 2c  73 68 65 6c 6c 5f 41 70  |ff%,256,shell_Ap|
00007080  70 4e 61 6d 65 24 2b 22  44 61 74 61 24 44 69 72  |pName$+"Data$Dir|
00007090  22 2c 31 29 0d 03 80 3b  20 20 5f 55 25 21 31 39  |",1)...;  _U%!19|
000070a0  32 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |2=.shell_HeapBlo|
000070b0  63 6b 46 65 74 63 68 28  28 a9 73 68 65 6c 6c 5f  |ckFetch((.shell_|
000070c0  41 70 70 44 61 74 61 44  69 72 24 29 2b 31 29 0d  |AppDataDir$)+1).|
000070d0  03 81 2c 20 20 74 65 6d  70 25 3d 5f 55 25 21 31  |..,  temp%=_U%!1|
000070e0  39 32 3a 24 74 65 6d 70  25 3d 73 68 65 6c 6c 5f  |92:$temp%=shell_|
000070f0  41 70 70 44 61 74 61 44  69 72 24 0d 03 82 05 cc  |AppDataDir$.....|
00007100  0d 03 83 37 20 20 5f 55  25 21 31 39 32 3d a4 73  |...7  _U%!192=.s|
00007110  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 46 65  |hell_HeapBlockFe|
00007120  74 63 68 28 28 a9 73 68  65 6c 6c 5f 41 70 70 44  |tch((.shell_AppD|
00007130  69 72 24 29 2b 31 29 0d  03 84 28 20 20 74 65 6d  |ir$)+1)...(  tem|
00007140  70 25 3d 5f 55 25 21 31  39 32 3a 24 74 65 6d 70  |p%=_U%!192:$temp|
00007150  25 3d 73 68 65 6c 6c 5f  41 70 70 44 69 72 24 0d  |%=shell_AppDir$.|
00007160  03 85 05 cd 0d 03 86 16  e7 20 5f 55 25 21 31 30  |......... _U%!10|
00007170  30 20 80 20 31 3c 3c 33  20 8c 0d 03 87 1d 20 20  |0 . 1<<3 .....  |
00007180  f4 20 52 65 73 46 69 6e  64 20 69 6e 69 74 69 61  |. ResFind initia|
00007190  6c 69 73 65 64 2e 2e 0d  03 88 1c 20 20 2a 7c 64  |lised......  *|d|
000071a0  65 66 69 6e 65 20 55 73  69 6e 67 5f 52 65 73 46  |efine Using_ResF|
000071b0  69 6e 64 0d 03 89 3a 20  20 e7 20 a4 73 68 65 6c  |ind...:  . .shel|
000071c0  6c 5f 46 69 6c 65 45 78  69 73 74 73 28 73 68 65  |l_FileExists(she|
000071d0  6c 6c 5f 41 70 70 4e 61  6d 65 24 2b 22 52 65 73  |ll_AppName$+"Res|
000071e0  3a 4d 65 73 73 61 67 65  73 22 29 20 8c 0d 03 8a  |:Messages") ....|
000071f0  48 20 20 20 20 f2 73 68  65 6c 6c 5f 4d 65 73 73  |H    .shell_Mess|
00007200  61 67 65 73 49 6e 69 74  28 73 68 65 6c 6c 5f 41  |agesInit(shell_A|
00007210  70 70 4e 61 6d 65 24 2b  22 52 65 73 3a 4d 65 73  |ppName$+"Res:Mes|
00007220  73 61 67 65 73 22 2c 5f  55 25 21 36 38 2c 5f 55  |sages",_U%!68,_U|
00007230  25 21 36 34 29 0d 03 8b  07 20 20 cd 0d 03 8c 3b  |%!64)....  ....;|
00007240  20 20 e7 20 a4 73 68 65  6c 6c 5f 46 69 6c 65 45  |  . .shell_FileE|
00007250  78 69 73 74 73 28 73 68  65 6c 6c 5f 41 70 70 4e  |xists(shell_AppN|
00007260  61 6d 65 24 2b 22 52 65  73 3a 53 68 65 6c 6c 4d  |ame$+"Res:ShellM|
00007270  73 67 73 22 29 20 8c 0d  03 8d 4a 20 20 20 f2 73  |sgs") ....J   .s|
00007280  68 65 6c 6c 5f 4d 65 73  73 61 67 65 73 49 6e 69  |hell_MessagesIni|
00007290  74 28 73 68 65 6c 6c 5f  41 70 70 4e 61 6d 65 24  |t(shell_AppName$|
000072a0  2b 22 52 65 73 3a 53 68  65 6c 6c 4d 73 67 73 22  |+"Res:ShellMsgs"|
000072b0  2c 5f 55 25 21 32 38 30  2c 5f 55 25 21 32 38 34  |,_U%!280,_U%!284|
000072c0  29 0d 03 8e 07 20 20 cc  0d 03 8f 44 20 20 20 20  |)....  ....D    |
000072d0  f2 73 68 65 6c 6c 5f 4d  65 73 73 61 67 65 73 49  |.shell_MessagesI|
000072e0  6e 69 74 28 22 53 68 65  6c 6c 53 79 73 52 65 73  |nit("ShellSysRes|
000072f0  3a 53 68 65 6c 6c 4d 73  67 73 22 2c 5f 55 25 21  |:ShellMsgs",_U%!|
00007300  32 38 30 2c 5f 55 25 21  32 38 34 29 0d 03 90 07  |280,_U%!284)....|
00007310  20 20 cd 0d 03 91 39 20  20 e7 20 a4 73 68 65 6c  |  ....9  . .shel|
00007320  6c 5f 46 69 6c 65 45 78  69 73 74 73 28 73 68 65  |l_FileExists(she|
00007330  6c 6c 5f 41 70 70 4e 61  6d 65 24 2b 22 52 65 73  |ll_AppName$+"Res|
00007340  3a 53 70 72 69 74 65 73  22 29 20 8c 0d 03 92 42  |:Sprites") ....B|
00007350  20 20 20 20 5f 55 25 21  31 36 3d a4 73 68 65 6c  |    _U%!16=.shel|
00007360  6c 5f 53 70 72 69 74 65  41 72 65 61 4c 6f 61 64  |l_SpriteAreaLoad|
00007370  28 73 68 65 6c 6c 5f 41  70 70 4e 61 6d 65 24 2b  |(shell_AppName$+|
00007380  22 52 65 73 3a 53 70 72  69 74 65 73 22 29 0d 03  |"Res:Sprites")..|
00007390  93 07 20 20 cc 0d 03 94  3c 20 20 20 20 5f 55 25  |..  ....<    _U%|
000073a0  21 31 36 3d 31 3a f4 20  75 73 65 20 77 69 6d 70  |!16=1:. use wimp|
000073b0  20 73 70 72 69 74 65 20  70 6f 6f 6c 20 69 66 20  | sprite pool if |
000073c0  6e 6f 20 27 53 70 72 69  74 65 73 27 20 66 69 6c  |no 'Sprites' fil|
000073d0  65 0d 03 95 07 20 20 cd  0d 03 96 27 20 20 f4 20  |e....  ....'  . |
000073e0  63 68 65 63 6b 20 69 66  20 74 65 6d 70 6c 61 74  |check if templat|
000073f0  65 73 20 6e 65 65 64 20  6c 6f 61 64 69 6e 67 0d  |es need loading.|
00007400  03 97 3b 20 20 e7 20 a4  73 68 65 6c 6c 5f 46 69  |..;  . .shell_Fi|
00007410  6c 65 45 78 69 73 74 73  28 73 68 65 6c 6c 5f 41  |leExists(shell_A|
00007420  70 70 4e 61 6d 65 24 2b  22 52 65 73 3a 54 65 6d  |ppName$+"Res:Tem|
00007430  70 6c 61 74 65 73 22 29  20 8c 0d 03 98 3c 20 20  |plates") ....<  |
00007440  20 20 f2 73 68 65 6c 6c  5f 54 65 6d 70 6c 61 74  |  .shell_Templat|
00007450  65 73 49 6e 69 74 28 73  68 65 6c 6c 5f 41 70 70  |esInit(shell_App|
00007460  4e 61 6d 65 24 2b 22 52  65 73 3a 54 65 6d 70 6c  |Name$+"Res:Templ|
00007470  61 74 65 73 22 29 0d 03  99 07 20 20 cd 0d 03 9a  |ates")....  ....|
00007480  05 cc 0d 03 9b 21 20 20  f4 20 52 65 73 46 69 6e  |.....!  . ResFin|
00007490  64 20 4e 4f 54 20 69 6e  69 74 69 61 6c 69 73 65  |d NOT initialise|
000074a0  64 2e 2e 0d 03 9c 36 20  20 e7 20 a4 73 68 65 6c  |d.....6  . .shel|
000074b0  6c 5f 46 69 6c 65 45 78  69 73 74 73 28 73 68 65  |l_FileExists(she|
000074c0  6c 6c 5f 41 70 70 44 69  72 24 2b 22 2e 4d 65 73  |ll_AppDir$+".Mes|
000074d0  73 61 67 65 73 22 29 20  8c 0d 03 9d 44 20 20 20  |sages") ....D   |
000074e0  20 f2 73 68 65 6c 6c 5f  4d 65 73 73 61 67 65 73  | .shell_Messages|
000074f0  49 6e 69 74 28 73 68 65  6c 6c 5f 41 70 70 44 69  |Init(shell_AppDi|
00007500  72 24 2b 22 2e 4d 65 73  73 61 67 65 73 22 2c 5f  |r$+".Messages",_|
00007510  55 25 21 36 38 2c 5f 55  25 21 36 34 29 0d 03 9e  |U%!68,_U%!64)...|
00007520  07 20 20 cd 0d 03 9f 37  20 20 e7 20 a4 73 68 65  |.  ....7  . .she|
00007530  6c 6c 5f 46 69 6c 65 45  78 69 73 74 73 28 73 68  |ll_FileExists(sh|
00007540  65 6c 6c 5f 41 70 70 44  69 72 24 2b 22 2e 53 68  |ell_AppDir$+".Sh|
00007550  65 6c 6c 4d 73 67 73 22  29 20 8c 0d 03 a0 47 20  |ellMsgs") ....G |
00007560  20 20 20 f2 73 68 65 6c  6c 5f 4d 65 73 73 61 67  |   .shell_Messag|
00007570  65 73 49 6e 69 74 28 73  68 65 6c 6c 5f 41 70 70  |esInit(shell_App|
00007580  44 69 72 24 2b 22 2e 53  68 65 6c 6c 4d 73 67 73  |Dir$+".ShellMsgs|
00007590  22 2c 5f 55 25 21 32 38  30 2c 5f 55 25 21 32 38  |",_U%!280,_U%!28|
000075a0  34 29 0d 03 a1 07 20 20  cc 0d 03 a2 44 20 20 20  |4)....  ....D   |
000075b0  20 f2 73 68 65 6c 6c 5f  4d 65 73 73 61 67 65 73  | .shell_Messages|
000075c0  49 6e 69 74 28 22 53 68  65 6c 6c 53 79 73 52 65  |Init("ShellSysRe|
000075d0  73 3a 53 68 65 6c 6c 4d  73 67 73 22 2c 5f 55 25  |s:ShellMsgs",_U%|
000075e0  21 32 38 30 2c 5f 55 25  21 32 38 34 29 0d 03 a3  |!280,_U%!284)...|
000075f0  07 20 20 cd 0d 03 a4 2a  20 20 f4 20 63 68 65 63  |.  ....*  . chec|
00007600  6b 20 69 66 20 75 73 65  72 20 73 70 72 69 74 65  |k if user sprite|
00007610  73 20 6e 65 65 64 20 6c  6f 61 64 69 6e 67 0d 03  |s need loading..|
00007620  a5 35 20 20 e7 20 a4 73  68 65 6c 6c 5f 46 69 6c  |.5  . .shell_Fil|
00007630  65 45 78 69 73 74 73 28  73 68 65 6c 6c 5f 41 70  |eExists(shell_Ap|
00007640  70 44 69 72 24 2b 22 2e  53 70 72 69 74 65 73 22  |pDir$+".Sprites"|
00007650  29 20 8c 0d 03 a6 3e 20  20 20 20 5f 55 25 21 31  |) ....>    _U%!1|
00007660  36 3d a4 73 68 65 6c 6c  5f 53 70 72 69 74 65 41  |6=.shell_SpriteA|
00007670  72 65 61 4c 6f 61 64 28  73 68 65 6c 6c 5f 41 70  |reaLoad(shell_Ap|
00007680  70 44 69 72 24 2b 22 2e  53 70 72 69 74 65 73 22  |pDir$+".Sprites"|
00007690  29 0d 03 a7 07 20 20 cc  0d 03 a8 3c 20 20 20 20  |)....  ....<    |
000076a0  5f 55 25 21 31 36 3d 31  3a f4 20 75 73 65 20 77  |_U%!16=1:. use w|
000076b0  69 6d 70 20 73 70 72 69  74 65 20 70 6f 6f 6c 20  |imp sprite pool |
000076c0  69 66 20 6e 6f 20 27 53  70 72 69 74 65 73 27 20  |if no 'Sprites' |
000076d0  66 69 6c 65 0d 03 a9 07  20 20 cd 0d 03 aa 27 20  |file....  ....' |
000076e0  20 f4 20 63 68 65 63 6b  20 69 66 20 74 65 6d 70  | . check if temp|
000076f0  6c 61 74 65 73 20 6e 65  65 64 20 6c 6f 61 64 69  |lates need loadi|
00007700  6e 67 0d 03 ab 37 20 20  e7 20 a4 73 68 65 6c 6c  |ng...7  . .shell|
00007710  5f 46 69 6c 65 45 78 69  73 74 73 28 73 68 65 6c  |_FileExists(shel|
00007720  6c 5f 41 70 70 44 69 72  24 2b 22 2e 54 65 6d 70  |l_AppDir$+".Temp|
00007730  6c 61 74 65 73 22 29 20  8c 0d 03 ac 38 20 20 20  |lates") ....8   |
00007740  20 f2 73 68 65 6c 6c 5f  54 65 6d 70 6c 61 74 65  | .shell_Template|
00007750  73 49 6e 69 74 28 73 68  65 6c 6c 5f 41 70 70 44  |sInit(shell_AppD|
00007760  69 72 24 2b 22 2e 54 65  6d 70 6c 61 74 65 73 22  |ir$+".Templates"|
00007770  29 0d 03 ad 07 20 20 cd  0d 03 ae 05 cd 0d 03 af  |)....  .........|
00007780  1c c8 99 20 22 4d 65 6e  75 55 74 69 6c 5f 49 6e  |... "MenuUtil_In|
00007790  69 74 69 61 6c 69 73 65  22 0d 03 b0 1f f2 73 68  |itialise".....sh|
000077a0  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 52 65 74  |ell_HeapBlockRet|
000077b0  75 72 6e 28 5f 51 25 29  0d 03 b1 3e 5f 51 25 3d  |urn(_Q%)...>_Q%=|
000077c0  a4 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
000077d0  46 65 74 63 68 28 31 30  32 34 29 3a f4 20 72 65  |Fetch(1024):. re|
000077e0  64 75 63 65 20 67 6c 6f  62 61 6c 20 77 69 6d 70  |duce global wimp|
000077f0  20 62 6c 6f 63 6b 0d 03  b2 26 f2 73 68 65 6c 6c  | block...&.shell|
00007800  5f 48 65 61 70 42 6c 6f  63 6b 52 65 74 75 72 6e  |_HeapBlockReturn|
00007810  28 4f 53 56 61 72 42 75  66 66 25 29 0d 03 b3 05  |(OSVarBuff%)....|
00007820  e1 0d 03 b4 05 3a 0d 03  b5 22 2a 7c 53 74 6f 70  |.....:..."*|Stop|
00007830  20 50 52 4f 43 73 68 65  6c 6c 5f 52 65 73 6f 75  | PROCshell_Resou|
00007840  72 63 65 73 49 6e 69 74  0d 03 b6 04 0d 03 b7 22  |rcesInit......."|
00007850  2a 7c 53 74 61 72 74 20  46 4e 73 68 65 6c 6c 5f  |*|Start FNshell_|
00007860  53 70 72 69 74 65 41 72  65 61 4c 6f 61 64 0d 03  |SpriteAreaLoad..|
00007870  b8 26 dd 20 a4 73 68 65  6c 6c 5f 53 70 72 69 74  |.&. .shell_Sprit|
00007880  65 41 72 65 61 4c 6f 61  64 28 66 69 6c 65 6e 61  |eAreaLoad(filena|
00007890  6d 65 24 29 0d 03 b9 0f  ea 20 73 70 25 2c 53 25  |me$)..... sp%,S%|
000078a0  2c 54 25 0d 03 ba 25 53  25 3d 8e 20 28 66 69 6c  |,T%...%S%=. (fil|
000078b0  65 6e 61 6d 65 24 29 3a  54 25 3d a2 23 53 25 2b  |ename$):T%=.#S%+|
000078c0  31 36 3a d9 20 23 53 25  0d 03 bb 21 73 70 25 3d  |16:. #S%...!sp%=|
000078d0  a4 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
000078e0  46 65 74 63 68 28 54 25  29 0d 03 bc 13 21 73 70  |Fetch(T%)....!sp|
000078f0  25 3d 54 25 3a 73 70 25  21 34 3d 30 0d 03 bd 16  |%=T%:sp%!4=0....|
00007900  73 70 25 21 38 3d 31 36  3a 73 70 25 21 31 32 3d  |sp%!8=16:sp%!12=|
00007910  31 36 0d 03 be 1d c8 99  20 22 4f 53 5f 53 70 72  |16...... "OS_Spr|
00007920  69 74 65 4f 70 22 2c 26  32 30 39 2c 73 70 25 0d  |iteOp",&209,sp%.|
00007930  03 bf 27 c8 99 20 22 4f  53 5f 53 70 72 69 74 65  |..'.. "OS_Sprite|
00007940  4f 70 22 2c 26 32 30 41  2c 73 70 25 2c 66 69 6c  |Op",&20A,sp%,fil|
00007950  65 6e 61 6d 65 24 0d 03  c0 15 2a 7c 69 66 64 65  |ename$....*|ifde|
00007960  66 20 54 72 61 63 65 49  6e 69 74 0d 03 c1 3e f2  |f TraceInit...>.|
00007970  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 53  |shell_Tracef0("S|
00007980  70 72 69 74 65 4c 6f 61  64 3a 53 70 72 69 74 65  |priteLoad:Sprite|
00007990  20 66 69 6c 65 20 6c 6f  61 64 65 64 20 61 74 20  | file loaded at |
000079a0  26 22 2b c3 7e 73 70 25  29 0d 03 c2 0b 2a 7c 65  |&"+.~sp%)....*|e|
000079b0  6e 64 69 66 0d 03 c3 08  3d 73 70 25 0d 03 c4 05  |ndif....=sp%....|
000079c0  3a 0d 03 c5 21 2a 7c 53  74 6f 70 20 46 4e 73 68  |:...!*|Stop FNsh|
000079d0  65 6c 6c 5f 53 70 72 69  74 65 41 72 65 61 4c 6f  |ell_SpriteAreaLo|
000079e0  61 64 0d 03 c6 04 0d 03  c7 23 2a 7c 53 74 61 72  |ad.......#*|Star|
000079f0  74 20 46 4e 73 68 65 6c  6c 5f 55 73 65 72 53 70  |t FNshell_UserSp|
00007a00  72 69 74 65 73 42 61 73  65 0d 03 c8 1c dd 20 a4  |ritesBase..... .|
00007a10  73 68 65 6c 6c 5f 55 73  65 72 53 70 72 69 74 65  |shell_UserSprite|
00007a20  73 42 61 73 65 0d 03 c9  0b 3d 5f 55 25 21 31 36  |sBase....=_U%!16|
00007a30  0d 03 ca 05 3a 0d 03 cb  22 2a 7c 53 74 6f 70 20  |....:..."*|Stop |
00007a40  46 4e 73 68 65 6c 6c 5f  55 73 65 72 53 70 72 69  |FNshell_UserSpri|
00007a50  74 65 73 42 61 73 65 0d  03 cc 04 0d 03 cd 20 2a  |tesBase....... *|
00007a60  7c 53 74 61 72 74 20 46  4e 73 68 65 6c 6c 5f 53  ||Start FNshell_S|
00007a70  70 72 69 74 65 47 65 74  50 74 72 0d 03 ce 2c dd  |priteGetPtr...,.|
00007a80  20 a4 73 68 65 6c 6c 5f  53 70 72 69 74 65 47 65  | .shell_SpriteGe|
00007a90  74 50 74 72 28 73 70 72  69 74 65 61 72 65 61 25  |tPtr(spritearea%|
00007aa0  2c 6e 61 6d 65 24 29 0d  03 cf 12 ea 20 62 75 66  |,name$)..... buf|
00007ab0  66 65 72 25 2c 70 74 72  25 0d 03 d0 25 62 75 66  |fer%,ptr%...%buf|
00007ac0  66 65 72 25 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |fer%=.shell_Heap|
00007ad0  42 6c 6f 63 6b 46 65 74  63 68 28 32 31 29 0d 03  |BlockFetch(21)..|
00007ae0  d1 12 24 62 75 66 66 65  72 25 3d 6e 61 6d 65 24  |..$buffer%=name$|
00007af0  0d 03 d2 36 c8 99 20 22  4f 53 5f 53 70 72 69 74  |...6.. "OS_Sprit|
00007b00  65 4f 70 22 2c 26 31 31  38 2c 73 70 72 69 74 65  |eOp",&118,sprite|
00007b10  61 72 65 61 25 2c 62 75  66 66 65 72 25 20 b8 20  |area%,buffer% . |
00007b20  2c 2c 70 74 72 25 0d 03  d3 23 f2 73 68 65 6c 6c  |,,ptr%...#.shell|
00007b30  5f 48 65 61 70 42 6c 6f  63 6b 52 65 74 75 72 6e  |_HeapBlockReturn|
00007b40  28 62 75 66 66 65 72 25  29 0d 03 d4 09 3d 70 74  |(buffer%)....=pt|
00007b50  72 25 0d 03 d5 05 3a 0d  03 d6 1f 2a 7c 53 74 6f  |r%....:....*|Sto|
00007b60  70 20 46 4e 73 68 65 6c  6c 5f 53 70 72 69 74 65  |p FNshell_Sprite|
00007b70  47 65 74 50 74 72 0d 03  d7 04 0d 03 d8 23 2a 7c  |GetPtr.......#*||
00007b80  53 74 61 72 74 20 50 52  4f 43 73 68 65 6c 6c 5f  |Start PROCshell_|
00007b90  54 65 6d 70 6c 61 74 65  73 49 6e 69 74 0d 03 d9  |TemplatesInit...|
00007ba0  25 dd 20 f2 73 68 65 6c  6c 5f 54 65 6d 70 6c 61  |%. .shell_Templa|
00007bb0  74 65 73 49 6e 69 74 28  66 69 6c 65 6e 61 6d 65  |tesInit(filename|
00007bc0  24 29 0d 03 da 2c ea 20  54 65 6d 70 6c 61 74 65  |$)...,. Template|
00007bd0  50 74 72 25 2c 49 6e 64  69 72 65 63 74 50 74 72  |Ptr%,IndirectPtr|
00007be0  25 2c 49 6e 64 69 72 65  63 74 45 6e 64 25 0d 03  |%,IndirectEnd%..|
00007bf0  db 35 ea 20 66 69 6c 65  6c 65 6e 25 20 2c 70 6f  |.5. filelen% ,po|
00007c00  73 25 2c 6e 61 6d 65 5f  62 75 66 66 65 72 25 2c  |s%,name_buffer%,|
00007c10  6e 61 6d 65 24 2c 6e 72  5f 74 65 6d 70 6c 61 74  |name$,nr_templat|
00007c20  65 73 25 0d 03 dc 15 de  20 6e 61 6d 65 5f 62 75  |es%..... name_bu|
00007c30  66 66 65 72 25 20 32 30  0d 03 dd 19 c8 95 20 28  |ffer% 20...... (|
00007c40  6e 61 6d 65 5f 62 75 66  66 65 72 25 20 83 20 34  |name_buffer% . 4|
00007c50  29 0d 03 de 15 20 20 6e  61 6d 65 5f 62 75 66 66  |)....  name_buff|
00007c60  65 72 25 2b 3d 31 0d 03  df 05 ce 0d 03 e0 1a 70  |er%+=1.........p|
00007c70  6f 73 25 3d 30 3a 6e 72  5f 74 65 6d 70 6c 61 74  |os%=0:nr_templat|
00007c80  65 73 25 3d 30 0d 03 e1  29 66 69 6c 65 6c 65 6e  |es%=0...)filelen|
00007c90  25 3d a4 73 68 65 6c 6c  5f 46 69 6c 65 4c 65 6e  |%=.shell_FileLen|
00007ca0  67 74 68 28 66 69 6c 65  6e 61 6d 65 24 29 0d 03  |gth(filename$)..|
00007cb0  e2 2a f4 20 72 65 73 65  72 76 65 20 73 70 61 63  |.*. reserve spac|
00007cc0  65 20 66 6f 72 20 77 69  6e 64 6f 77 20 64 65 66  |e for window def|
00007cd0  69 6e 69 74 69 6f 6e 73  0d 03 e3 30 54 65 6d 70  |initions...0Temp|
00007ce0  6c 61 74 65 42 6c 6b 25  3d a4 73 68 65 6c 6c 5f  |lateBlk%=.shell_|
00007cf0  48 65 61 70 42 6c 6f 63  6b 46 65 74 63 68 28 66  |HeapBlockFetch(f|
00007d00  69 6c 65 6c 65 6e 25 29  0d 03 e4 1d 54 65 6d 70  |ilelen%)....Temp|
00007d10  6c 61 74 65 50 74 72 25  3d 54 65 6d 70 6c 61 74  |latePtr%=Templat|
00007d20  65 42 6c 6b 25 0d 03 e5  62 f4 20 72 65 73 65 72  |eBlk%...b. reser|
00007d30  76 65 20 61 20 62 6c 6f  63 6b 20 74 6f 20 68 6f  |ve a block to ho|
00007d40  6c 64 20 77 69 6e 64 6f  77 20 69 64 65 6e 74 69  |ld window identi|
00007d50  66 69 65 72 73 20 28 31  32 20 62 79 74 65 73 29  |fiers (12 bytes)|
00007d60  20 70 6c 75 73 20 61 64  64 72 65 73 73 20 6f 66  | plus address of|
00007d70  20 77 69 6e 64 6f 77 20  62 6c 6f 63 6b 20 28 34  | window block (4|
00007d80  20 62 79 74 65 73 29 0d  03 e6 26 5f 55 25 21 34  | bytes)...&_U%!4|
00007d90  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
00007da0  6b 46 65 74 63 68 28 32  30 2a 36 34 29 0d 03 e7  |kFetch(20*64)...|
00007db0  6a f4 20 72 65 73 65 72  76 65 20 73 70 61 63 65  |j. reserve space|
00007dc0  20 66 6f 72 20 69 6e 64  69 72 65 63 74 65 64 20  | for indirected |
00007dd0  69 63 6f 6e 20 64 61 74  61 2e 20 4e 6f 74 65 20  |icon data. Note |
00007de0  74 68 61 74 20 74 6f 6f  20 6d 75 63 68 20 69 73  |that too much is|
00007df0  20 72 65 73 65 72 76 65  64 20 61 73 20 66 69 6c  | reserved as fil|
00007e00  65 6c 65 6e 25 20 69 73  20 74 68 65 20 74 6f 74  |elen% is the tot|
00007e10  61 6c 20 73 69 7a 65 0d  03 e8 3c f4 20 6f 66 20  |al size...<. of |
00007e20  74 68 65 20 74 65 6d 70  6c 61 74 65 20 66 69 6c  |the template fil|
00007e30  65 20 69 2e 65 2e 20 74  65 6d 70 6c 61 74 65 73  |e i.e. templates|
00007e40  20 2b 20 69 6e 64 69 72  65 63 74 65 64 20 64 61  | + indirected da|
00007e50  74 61 21 0d 03 e9 30 49  6e 64 69 72 65 63 74 42  |ta!...0IndirectB|
00007e60  6c 6b 25 3d a4 73 68 65  6c 6c 5f 48 65 61 70 42  |lk%=.shell_HeapB|
00007e70  6c 6f 63 6b 46 65 74 63  68 28 66 69 6c 65 6c 65  |lockFetch(filele|
00007e80  6e 25 29 0d 03 ea 1d 49  6e 64 69 72 65 63 74 50  |n%)....IndirectP|
00007e90  74 72 25 3d 49 6e 64 69  72 65 63 74 42 6c 6b 25  |tr%=IndirectBlk%|
00007ea0  0d 03 eb 26 49 6e 64 69  72 65 63 74 45 6e 64 25  |...&IndirectEnd%|
00007eb0  3d 49 6e 64 69 72 65 63  74 42 6c 6b 25 2b 66 69  |=IndirectBlk%+fi|
00007ec0  6c 65 6c 65 6e 25 0d 03  ec 25 c8 99 20 22 57 69  |lelen%...%.. "Wi|
00007ed0  6d 70 5f 4f 70 65 6e 54  65 6d 70 6c 61 74 65 22  |mp_OpenTemplate"|
00007ee0  2c 2c 66 69 6c 65 6e 61  6d 65 24 0d 03 ed 05 f5  |,,filename$.....|
00007ef0  0d 03 ee 17 20 20 24 6e  61 6d 65 5f 62 75 66 66  |....  $name_buff|
00007f00  65 72 25 3d 22 2a 22 0d  03 ef 7c 20 20 c8 99 20  |er%="*"...|  .. |
00007f10  22 57 69 6d 70 5f 4c 6f  61 64 54 65 6d 70 6c 61  |"Wimp_LoadTempla|
00007f20  74 65 22 2c 2c 54 65 6d  70 6c 61 74 65 50 74 72  |te",,TemplatePtr|
00007f30  25 2c 49 6e 64 69 72 65  63 74 50 74 72 25 2c 49  |%,IndirectPtr%,I|
00007f40  6e 64 69 72 65 63 74 45  6e 64 25 2c 5f 55 25 21  |ndirectEnd%,_U%!|
00007f50  32 33 32 2c 6e 61 6d 65  5f 62 75 66 66 65 72 25  |232,name_buffer%|
00007f60  2c 70 6f 73 25 20 b8 20  2c 2c 49 6e 64 69 72 65  |,pos% . ,,Indire|
00007f70  63 74 50 74 72 25 2c 2c  2c 6e 61 6d 65 24 2c 70  |ctPtr%,,,name$,p|
00007f80  6f 73 25 0d 03 f0 11 20  20 e7 20 70 6f 73 25 3c  |os%....  . pos%<|
00007f90  3e 30 20 8c 0d 03 f1 32  20 20 20 20 21 28 28 5f  |>0 ....2    !((_|
00007fa0  55 25 21 34 29 2b 28 31  36 2a 6e 72 5f 74 65 6d  |U%!4)+(16*nr_tem|
00007fb0  70 6c 61 74 65 73 25 29  29 3d 54 65 6d 70 6c 61  |plates%))=Templa|
00007fc0  74 65 50 74 72 25 0d 03  f2 2f 20 20 20 20 24 28  |tePtr%.../    $(|
00007fd0  28 28 5f 55 25 21 34 29  2b 28 31 36 2a 6e 72 5f  |((_U%!4)+(16*nr_|
00007fe0  74 65 6d 70 6c 61 74 65  73 25 29 29 2b 34 29 3d  |templates%))+4)=|
00007ff0  6e 61 6d 65 24 0d 03 f3  1a 20 20 20 20 2a 7c 69  |name$....    *|i|
00008000  66 64 65 66 20 54 72 61  63 65 5f 49 6e 69 74 0d  |fdef Trace_Init.|
00008010  03 f4 41 20 20 20 20 f2  73 68 65 6c 6c 5f 54 72  |..A    .shell_Tr|
00008020  61 63 65 66 30 28 22 54  65 6d 70 6c 61 74 65 73  |acef0("Templates|
00008030  49 6e 69 74 3a 20 20 54  65 6d 70 6c 61 74 65 20  |Init:  Template |
00008040  4c 6f 61 64 65 64 3a 20  22 2b 6e 61 6d 65 24 29  |Loaded: "+name$)|
00008050  0d 03 f5 0f 20 20 20 20  2a 7c 65 6e 64 69 66 0d  |....    *|endif.|
00008060  03 f6 2f 20 20 20 20 54  65 6d 70 6c 61 74 65 50  |../    TemplateP|
00008070  74 72 25 2b 3d 28 38 38  2b 28 54 65 6d 70 6c 61  |tr%+=(88+(Templa|
00008080  74 65 50 74 72 25 21 38  34 29 2a 33 32 29 0d 03  |tePtr%!84)*32)..|
00008090  f7 18 20 20 20 20 6e 72  5f 74 65 6d 70 6c 61 74  |..    nr_templat|
000080a0  65 73 25 2b 3d 31 0d 03  f8 07 20 20 cd 0d 03 f9  |es%+=1....  ....|
000080b0  0c fd 20 70 6f 73 25 3d  30 0d 03 fa 1b c8 99 20  |.. pos%=0...... |
000080c0  22 57 69 6d 70 5f 43 6c  6f 73 65 54 65 6d 70 6c  |"Wimp_CloseTempl|
000080d0  61 74 65 22 0d 03 fb 17  5f 55 25 21 30 3d 6e 72  |ate"...._U%!0=nr|
000080e0  5f 74 65 6d 70 6c 61 74  65 73 25 0d 03 fc 16 2a  |_templates%....*|
000080f0  7c 69 66 64 65 66 20 54  72 61 63 65 5f 49 6e 69  ||ifdef Trace_Ini|
00008100  74 0d 03 fd 78 f2 73 68  65 6c 6c 5f 54 72 61 63  |t...x.shell_Trac|
00008110  65 66 30 28 22 54 65 6d  70 6c 61 74 65 73 49 6e  |ef0("TemplatesIn|
00008120  69 74 3a 54 65 6d 70 6c  61 74 65 73 20 72 65 73  |it:Templates res|
00008130  6f 75 72 63 65 20 66 69  6c 65 20 6c 6f 61 64 65  |ource file loade|
00008140  64 20 61 74 20 26 22 2b  c3 7e 54 65 6d 70 6c 61  |d at &"+.~Templa|
00008150  74 65 42 6c 6b 25 2b 22  20 28 22 2b c3 6e 72 5f  |teBlk%+" ("+.nr_|
00008160  74 65 6d 70 6c 61 74 65  73 25 2b 22 20 74 65 6d  |templates%+" tem|
00008170  70 6c 61 74 65 73 29 22  29 0d 03 fe 0b 2a 7c 65  |plates)")....*|e|
00008180  6e 64 69 66 0d 03 ff 05  e1 0d 04 00 05 3a 0d 04  |ndif.........:..|
00008190  01 22 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |."*|Stop PROCshe|
000081a0  6c 6c 5f 54 65 6d 70 6c  61 74 65 73 49 6e 69 74  |ll_TemplatesInit|
000081b0  0d 04 02 04 0d 04 03 20  2a 7c 53 74 61 72 74 20  |....... *|Start |
000081c0  46 4e 73 68 65 6c 6c 5f  57 69 6e 64 6f 77 4c 6f  |FNshell_WindowLo|
000081d0  61 64 65 64 0d 04 04 22  dd 20 a4 73 68 65 6c 6c  |aded...". .shell|
000081e0  5f 57 69 6e 64 6f 77 4c  6f 61 64 65 64 28 77 69  |_WindowLoaded(wi|
000081f0  6e 64 6f 77 24 29 0d 04  05 12 ea 20 6c 6f 6f 70  |ndow$)..... loop|
00008200  25 2c 66 6f 75 6e 64 25  0d 04 06 45 e7 20 a9 28  |%,found%...E. .(|
00008210  77 69 6e 64 6f 77 24 29  3e 31 32 20 8c 20 85 20  |window$)>12 . . |
00008220  39 39 2c a4 73 68 65 6c  6c 5f 4d 65 73 73 61 67  |99,.shell_Messag|
00008230  65 4f 6e 65 41 72 67 28  22 53 48 45 4c 4c 4d 53  |eOneArg("SHELLMS|
00008240  47 30 32 22 2c 77 69 6e  64 6f 77 24 29 0d 04 07  |G02",window$)...|
00008250  0c 66 6f 75 6e 64 25 3d  a3 0d 04 08 19 e3 20 6c  |.found%=...... l|
00008260  6f 6f 70 25 3d 30 20 b8  20 28 5f 55 25 21 30 29  |oop%=0 . (_U%!0)|
00008270  2d 31 0d 04 09 2b 20 20  e7 20 24 28 28 28 5f 55  |-1...+  . $(((_U|
00008280  25 21 34 29 2b 28 31 36  2a 6c 6f 6f 70 25 29 29  |%!4)+(16*loop%))|
00008290  2b 34 29 3d 77 69 6e 64  6f 77 24 20 8c 0d 04 0a  |+4)=window$ ....|
000082a0  20 20 20 20 20 66 6f 75  6e 64 25 3d b9 3a 6c 6f  |     found%=.:lo|
000082b0  6f 70 25 3d 28 5f 55 25  21 30 29 2d 31 0d 04 0b  |op%=(_U%!0)-1...|
000082c0  07 20 20 cd 0d 04 0c 0b  ed 20 6c 6f 6f 70 25 0d  |.  ...... loop%.|
000082d0  04 0d 0b 3d 66 6f 75 6e  64 25 0d 04 0e 05 3a 0d  |...=found%....:.|
000082e0  04 0f 1f 2a 7c 53 74 6f  70 20 46 4e 73 68 65 6c  |...*|Stop FNshel|
000082f0  6c 5f 57 69 6e 64 6f 77  4c 6f 61 64 65 64 0d 04  |l_WindowLoaded..|
00008300  10 19 2a 7c 53 74 61 72  74 20 46 4e 73 68 65 6c  |..*|Start FNshel|
00008310  6c 5f 47 65 74 57 42 0d  04 11 1b dd 20 a4 73 68  |l_GetWB..... .sh|
00008320  65 6c 6c 5f 47 65 74 57  42 28 77 69 6e 64 6f 77  |ell_GetWB(window|
00008330  24 29 0d 04 12 12 ea 20  6c 6f 6f 70 25 2c 66 6f  |$)..... loop%,fo|
00008340  75 6e 64 25 0d 04 13 45  e7 20 a9 28 77 69 6e 64  |und%...E. .(wind|
00008350  6f 77 24 29 3e 31 32 20  8c 20 85 20 39 39 2c a4  |ow$)>12 . . 99,.|
00008360  73 68 65 6c 6c 5f 4d 65  73 73 61 67 65 4f 6e 65  |shell_MessageOne|
00008370  41 72 67 28 22 53 48 45  4c 4c 4d 53 47 30 32 22  |Arg("SHELLMSG02"|
00008380  2c 77 69 6e 64 6f 77 24  29 0d 04 14 0d 66 6f 75  |,window$)....fou|
00008390  6e 64 25 3d 2d 31 0d 04  15 19 e3 20 6c 6f 6f 70  |nd%=-1..... loop|
000083a0  25 3d 30 20 b8 20 28 5f  55 25 21 30 29 2d 31 0d  |%=0 . (_U%!0)-1.|
000083b0  04 16 2b 20 20 e7 20 24  28 28 28 5f 55 25 21 34  |..+  . $(((_U%!4|
000083c0  29 2b 28 31 36 2a 6c 6f  6f 70 25 29 29 2b 34 29  |)+(16*loop%))+4)|
000083d0  3d 77 69 6e 64 6f 77 24  20 8c 0d 04 17 24 20 20  |=window$ ....$  |
000083e0  20 20 66 6f 75 6e 64 25  3d 6c 6f 6f 70 25 3a 6c  |  found%=loop%:l|
000083f0  6f 6f 70 25 3d 28 5f 55  25 21 30 29 2d 31 0d 04  |oop%=(_U%!0)-1..|
00008400  18 07 20 20 cd 0d 04 19  0b ed 20 6c 6f 6f 70 25  |..  ...... loop%|
00008410  0d 04 1a 11 e7 20 66 6f  75 6e 64 25 3e 2d 31 20  |..... found%>-1 |
00008420  8c 0d 04 1b 1d 20 20 3d  21 28 28 5f 55 25 21 34  |.....  =!((_U%!4|
00008430  29 2b 28 31 36 2a 66 6f  75 6e 64 25 29 29 0d 04  |)+(16*found%))..|
00008440  1c 05 cc 0d 04 1d 35 20  20 85 20 39 39 2c a4 73  |......5  . 99,.s|
00008450  68 65 6c 6c 5f 4d 65 73  73 61 67 65 4f 6e 65 41  |hell_MessageOneA|
00008460  72 67 28 22 53 48 45 4c  4c 4d 53 47 30 33 22 2c  |rg("SHELLMSG03",|
00008470  77 69 6e 64 6f 77 24 29  0d 04 1e 05 cd 0d 04 1f  |window$)........|
00008480  06 3d a3 0d 04 20 05 3a  0d 04 21 04 0d 04 22 18  |.=... .:..!...".|
00008490  2a 7c 53 74 6f 70 20 46  4e 73 68 65 6c 6c 5f 47  |*|Stop FNshell_G|
000084a0  65 74 57 42 0d 04 23 21  2a 7c 53 74 61 72 74 20  |etWB..#!*|Start |
000084b0  46 4e 73 68 65 6c 6c 5f  4d 65 73 73 61 67 65 45  |FNshell_MessageE|
000084c0  78 70 61 6e 64 0d 04 24  1e dd 20 a4 73 68 65 6c  |xpand..$.. .shel|
000084d0  6c 5f 4d 65 73 73 61 67  65 45 78 70 61 6e 64 28  |l_MessageExpand(|
000084e0  68 24 29 0d 04 25 14 ea  20 73 24 2c 20 6d 24 2c  |h$)..%.. s$, m$,|
000084f0  20 69 6e 64 65 78 25 0d  04 26 09 73 24 3d 22 22  | index%..&.s$=""|
00008500  0d 04 27 11 c8 95 20 a7  68 24 2c 22 5c 22 29 3e  |..'... .h$,"\")>|
00008510  30 0d 04 28 15 20 20 69  6e 64 65 78 25 3d a7 68  |0..(.  index%=.h|
00008520  24 2c 22 5c 22 29 0d 04  29 17 20 20 73 24 2b 3d  |$,"\")..).  s$+=|
00008530  c0 68 24 2c 69 6e 64 65  78 25 2d 31 29 0d 04 2a  |.h$,index%-1)..*|
00008540  18 20 20 6d 24 3d c1 68  24 2c 69 6e 64 65 78 25  |.  m$=.h$,index%|
00008550  2b 31 2c 31 29 0d 04 2b  16 20 20 68 24 3d c1 68  |+1,1)..+.  h$=.h|
00008560  24 2c 69 6e 64 65 78 25  2b 32 29 0d 04 2c 0d 20  |$,index%+2)..,. |
00008570  20 c8 8e 20 6d 24 20 ca  0d 04 2d 23 20 20 20 20  | .. m$ ...-#    |
00008580  c9 20 22 41 22 3a 73 24  2b 3d 22 43 6c 69 63 6b  |. "A":s$+="Click|
00008590  20 41 44 4a 55 53 54 20  74 6f 22 0d 04 2e 1a 20  | ADJUST to".... |
000085a0  20 20 20 c9 20 22 61 22  3a 73 24 2b 3d 22 41 44  |   . "a":s$+="AD|
000085b0  4a 55 53 54 22 0d 04 2f  27 20 20 20 20 c9 20 22  |JUST"../'    . "|
000085c0  44 22 3a 73 24 2b 3d 22  44 72 61 67 20 77 69 74  |D":s$+="Drag wit|
000085d0  68 20 53 45 4c 45 43 54  20 74 6f 22 0d 04 30 27  |h SELECT to"..0'|
000085e0  20 20 20 20 c9 20 22 64  22 3a 73 24 2b 3d 22 44  |    . "d":s$+="D|
000085f0  72 61 67 20 77 69 74 68  20 41 44 4a 55 53 54 20  |rag with ADJUST |
00008600  74 6f 22 0d 04 31 35 20  20 20 20 c9 20 22 47 22  |to"..15    . "G"|
00008610  3a 73 24 2b 3d 22 54 68  69 73 20 6f 70 74 69 6f  |:s$+="This optio|
00008620  6e 20 69 73 20 67 72 65  79 65 64 20 6f 75 74 20  |n is greyed out |
00008630  62 65 63 61 75 73 65 22  0d 04 32 2a 20 20 20 20  |because"..2*    |
00008640  c9 20 22 52 22 3a 73 24  2b 3d 22 4d 6f 76 65 20  |. "R":s$+="Move |
00008650  74 68 65 20 70 6f 69 6e  74 65 72 20 72 69 67 68  |the pointer righ|
00008660  74 22 0d 04 33 23 20 20  20 20 c9 20 22 53 22 3a  |t"..3#    . "S":|
00008670  73 24 2b 3d 22 43 6c 69  63 6b 20 53 45 4c 45 43  |s$+="Click SELEC|
00008680  54 20 74 6f 22 0d 04 34  1a 20 20 20 20 c9 20 22  |T to"..4.    . "|
00008690  73 22 3a 73 24 2b 3d 22  53 45 4c 45 43 54 22 0d  |s":s$+="SELECT".|
000086a0  04 35 1f 20 20 20 20 c9  20 22 54 22 3a 73 24 2b  |.5.    . "T":s$+|
000086b0  3d 22 54 68 69 73 20 69  73 20 74 68 65 22 0d 04  |="This is the"..|
000086c0  36 22 20 20 20 20 c9 20  22 57 22 3a 73 24 2b 3d  |6"    . "W":s$+=|
000086d0  22 54 68 69 73 20 77 69  6e 64 6f 77 20 69 73 22  |"This window is"|
000086e0  0d 04 37 1a 20 20 20 20  c9 20 22 77 22 3a 73 24  |..7.    . "w":s$|
000086f0  2b 3d 22 77 69 6e 64 6f  77 22 0d 04 38 07 20 20  |+="window"..8.  |
00008700  7f 0d 04 39 12 20 20 20  20 73 24 2b 3d 22 5c 22  |...9.    s$+="\"|
00008710  2b 6d 24 0d 04 3a 07 20  20 cb 0d 04 3b 05 ce 0d  |+m$..:.  ...;...|
00008720  04 3c 0a 3d 73 24 2b 68  24 0d 04 3d 05 3a 0d 04  |.<.=s$+h$..=.:..|
00008730  3e 40 f4 20 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |>@. ------------|
00008740  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00008760  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0d 04  |--------------..|
00008770  3f 05 3a 0d 04 40 20 2a  7c 53 74 6f 70 20 46 4e  |?.:..@ *|Stop FN|
00008780  73 68 65 6c 6c 5f 4d 65  73 73 61 67 65 45 78 70  |shell_MessageExp|
00008790  61 6e 64 0d 04 41 04 0d  04 42 04 0d 04 43 04 0d  |and..A...B...C..|
000087a0  04 44 04 0d 04 45 1e 2a  7c 53 74 61 72 74 20 50  |.D...E.*|Start P|
000087b0  52 4f 43 73 68 65 6c 6c  5f 4f 70 65 6e 4d 65 6e  |ROCshell_OpenMen|
000087c0  75 0d 04 46 1f dd 20 f2  73 68 65 6c 6c 5f 4f 70  |u..F.. .shell_Op|
000087d0  65 6e 4d 65 6e 75 28 78  25 2c 79 25 2c 6d 25 29  |enMenu(x%,y%,m%)|
000087e0  0d 04 47 09 ea 20 66 6e  24 0d 04 48 2f 66 6e 24  |..G.. fn$..H/fn$|
000087f0  3d a4 73 68 65 6c 6c 5f  47 65 74 45 76 65 6e 74  |=.shell_GetEvent|
00008800  48 61 6e 64 6c 65 72 28  5f 55 25 21 32 38 2c 5f  |Handler(_U%!28,_|
00008810  55 25 21 33 32 2c 31 29  0d 04 49 0f e7 20 66 6e  |U%!32,1)..I.. fn|
00008820  24 3c 3e 22 22 20 8c 0d  04 4a 18 20 20 2a 7c 69  |$<>"" ...J.  *|i|
00008830  66 64 65 66 20 54 72 61  63 65 5f 49 6e 69 74 0d  |fdef Trace_Init.|
00008840  04 4b 54 20 20 f2 73 68  65 6c 6c 5f 54 72 61 63  |.KT  .shell_Trac|
00008850  65 66 30 28 22 4f 70 65  6e 4d 65 6e 75 3a 41 62  |ef0("OpenMenu:Ab|
00008860  6f 75 74 20 74 6f 20 63  61 6c 6c 20 22 2b 22 46  |out to call "+"F|
00008870  4e 22 2b 66 6e 24 2b 22  28 22 2b c3 5f 55 25 21  |N"+fn$+"("+._U%!|
00008880  32 38 2b 22 2c 22 2b c3  5f 55 25 21 33 32 2b 22  |28+","+._U%!32+"|
00008890  29 22 29 0d 04 4c 0d 20  20 2a 7c 65 6e 64 69 66  |)")..L.  *|endif|
000088a0  0d 04 4d 3a 20 20 76 6f  69 64 25 3d a0 28 22 46  |..M:  void%=.("F|
000088b0  4e 22 2b 66 6e 24 2b 22  28 5f 55 25 21 32 38 2c  |N"+fn$+"(_U%!28,|
000088c0  5f 55 25 21 33 32 29 22  29 3a f4 20 63 61 6c 6c  |_U%!32)"):. call|
000088d0  20 6d 65 6e 75 6d 61 6b  65 72 0d 04 4e 05 cc 0d  | menumaker..N...|
000088e0  04 4f 41 20 20 f2 73 68  65 6c 6c 5f 54 72 61 63  |.OA  .shell_Trac|
000088f0  65 66 30 28 22 4f 70 65  6e 4d 65 6e 75 3a 6e 6f  |ef0("OpenMenu:no|
00008900  20 6d 65 6e 75 6d 61 6b  65 72 20 66 75 6e 63 74  | menumaker funct|
00008910  69 6f 6e 20 72 65 67 69  73 74 65 72 65 64 22 29  |ion registered")|
00008920  0d 04 50 05 cd 0d 04 51  12 e7 20 6d 25 3c 3e 5f  |..P....Q.. m%<>_|
00008930  55 25 21 32 34 20 8c 0d  04 52 49 20 20 f4 20 49  |U%!24 ...RI  . I|
00008940  66 20 6d 65 6e 75 20 69  73 20 6e 6f 74 20 62 65  |f menu is not be|
00008950  69 6e 67 20 72 65 2d 6f  70 65 6e 65 64 20 62 79  |ing re-opened by|
00008960  20 61 6e 20 61 64 6a 75  73 74 20 63 6c 69 63 6b  | an adjust click|
00008970  2c 20 64 69 73 63 61 72  64 20 73 74 6f 72 65 64  |, discard stored|
00008980  0d 04 53 3b 20 20 f4 20  27 53 65 6c 65 63 74 69  |..S;  . 'Selecti|
00008990  6f 6e 53 6f 46 61 72 27  20 73 74 72 69 6e 67 20  |onSoFar' string |
000089a0  75 73 65 64 20 62 79 20  46 6f 6e 74 4d 65 6e 75  |used by FontMenu|
000089b0  20 72 6f 75 74 69 6e 65  73 2e 2e 0d 04 54 29 20  | routines....T) |
000089c0  20 e7 20 a4 73 68 65 6c  6c 5f 48 65 61 70 42 6c  | . .shell_HeapBl|
000089d0  6f 63 6b 45 78 69 73 74  73 28 5f 55 25 21 32 35  |ockExists(_U%!25|
000089e0  36 29 20 8c 0d 04 55 31  20 20 20 20 f2 73 68 65  |6) ...U1    .she|
000089f0  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 52 65 74 75  |ll_HeapBlockRetu|
00008a00  72 6e 28 5f 55 25 21 32  35 36 29 3a 5f 55 25 21  |rn(_U%!256):_U%!|
00008a10  32 35 36 3d 30 0d 04 56  07 20 20 cd 0d 04 57 42  |256=0..V.  ...WB|
00008a20  20 20 f4 20 41 6e 64 20  74 68 65 20 6e 61 6d 65  |  . And the name|
00008a30  20 6f 66 20 74 68 65 20  63 75 72 72 65 6e 74 6c  | of the currentl|
00008a40  79 20 73 65 6c 65 63 74  65 64 20 66 6f 6e 74 20  |y selected font |
00008a50  69 6e 20 74 68 69 73 20  6d 65 6e 75 2e 2e 0d 04  |in this menu....|
00008a60  58 2a 20 20 e7 20 a4 73  68 65 6c 6c 5f 48 65 61  |X*  . .shell_Hea|
00008a70  70 42 6c 6f 63 6b 45 78  69 73 74 73 28 5f 55 25  |pBlockExists(_U%|
00008a80  21 32 34 34 20 29 20 8c  0d 04 59 31 20 20 20 20  |!244 ) ...Y1    |
00008a90  f2 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
00008aa0  52 65 74 75 72 6e 28 5f  55 25 21 32 34 34 29 3a  |Return(_U%!244):|
00008ab0  5f 55 25 21 32 34 34 3d  30 0d 04 5a 07 20 20 cd  |_U%!244=0..Z.  .|
00008ac0  0d 04 5b 05 cd 0d 04 5c  12 e7 20 6d 25 3d 5f 55  |..[....\.. m%=_U|
00008ad0  25 21 32 35 32 20 8c 0d  04 5d 24 20 20 c8 99 20  |%!252 ...]$  .. |
00008ae0  22 57 69 6d 70 5f 43 72  65 61 74 65 4d 65 6e 75  |"Wimp_CreateMenu|
00008af0  22 2c 2c 6d 25 2c 78 25  2c 79 25 0d 04 5e 0f 20  |",,m%,x%,y%..^. |
00008b00  20 5f 55 25 21 32 36 34  3d 31 0d 04 5f 05 cc 0d  | _U%!264=1.._...|
00008b10  04 60 1f 20 20 c8 99 20  22 4d 65 6e 75 55 74 69  |.`.  .. "MenuUti|
00008b20  6c 5f 53 68 6f 77 22 2c  6d 25 2c 5f 51 25 0d 04  |l_Show",m%,_Q%..|
00008b30  61 0f 20 20 5f 55 25 21  32 36 34 3d 30 0d 04 62  |a.  _U%!264=0..b|
00008b40  05 cd 0d 04 63 34 5f 55  25 21 32 34 3d 6d 25 3a  |....c4_U%!24=m%:|
00008b50  f4 20 73 74 6f 72 65 20  61 64 64 72 65 73 73 20  |. store address |
00008b60  6f 66 20 63 75 72 72 65  6e 74 6c 79 20 6f 70 65  |of currently ope|
00008b70  6e 20 6d 65 6e 75 0d 04  64 25 5f 55 25 21 33 36  |n menu..d%_U%!36|
00008b80  3d 78 25 3a f4 20 73 74  6f 72 65 20 6d 65 6e 75  |=x%:. store menu|
00008b90  20 78 20 70 6f 73 69 74  69 6f 6e 0d 04 65 25 5f  | x position..e%_|
00008ba0  55 25 21 34 30 3d 79 25  3a f4 20 73 74 6f 72 65  |U%!40=y%:. store|
00008bb0  20 6d 65 6e 75 20 79 20  70 6f 73 69 74 69 6f 6e  | menu y position|
00008bc0  0d 04 66 20 5f 55 25 21  35 32 3d 5f 55 25 21 32  |..f _U%!52=_U%!2|
00008bd0  38 3a f4 20 73 74 6f 72  65 20 77 69 6e 64 6f 77  |8:. store window|
00008be0  0d 04 67 1e 5f 55 25 21  35 36 3d 5f 55 25 21 33  |..g._U%!56=_U%!3|
00008bf0  32 3a f4 20 73 74 6f 72  65 20 69 63 6f 6e 0d 04  |2:. store icon..|
00008c00  68 05 e1 0d 04 69 05 3a  0d 04 6a 1d 2a 7c 53 74  |h....i.:..j.*|St|
00008c10  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 4f 70 65  |op PROCshell_Ope|
00008c20  6e 4d 65 6e 75 0d 04 6b  04 0d 04 6c 20 2a 7c 53  |nMenu..k...l *|S|
00008c30  74 61 72 74 20 46 4e 73  68 65 6c 6c 5f 4d 65 6e  |tart FNshell_Men|
00008c40  75 4c 61 73 74 58 50 6f  73 0d 04 6d 19 dd 20 a4  |uLastXPos..m.. .|
00008c50  73 68 65 6c 6c 5f 4d 65  6e 75 4c 61 73 74 58 50  |shell_MenuLastXP|
00008c60  6f 73 0d 04 6e 0b 3d 5f  55 25 21 33 36 0d 04 6f  |os..n.=_U%!36..o|
00008c70  05 3a 0d 04 70 1f 2a 7c  53 74 6f 70 20 46 4e 73  |.:..p.*|Stop FNs|
00008c80  68 65 6c 6c 5f 4d 65 6e  75 4c 61 73 74 58 50 6f  |hell_MenuLastXPo|
00008c90  73 0d 04 71 04 0d 04 72  20 2a 7c 53 74 61 72 74  |s..q...r *|Start|
00008ca0  20 46 4e 73 68 65 6c 6c  5f 4d 65 6e 75 4c 61 73  | FNshell_MenuLas|
00008cb0  74 59 50 6f 73 0d 04 73  19 dd 20 a4 73 68 65 6c  |tYPos..s.. .shel|
00008cc0  6c 5f 4d 65 6e 75 4c 61  73 74 59 50 6f 73 0d 04  |l_MenuLastYPos..|
00008cd0  74 0b 3d 5f 55 25 21 34  30 0d 04 75 05 3a 0d 04  |t.=_U%!40..u.:..|
00008ce0  76 1f 2a 7c 53 74 6f 70  20 46 4e 73 68 65 6c 6c  |v.*|Stop FNshell|
00008cf0  5f 4d 65 6e 75 4c 61 73  74 59 50 6f 73 0d 04 77  |_MenuLastYPos..w|
00008d00  04 0d 04 78 24 2a 7c 53  74 61 72 74 20 50 52 4f  |...x$*|Start PRO|
00008d10  43 73 68 65 6c 6c 5f 4d  65 6e 75 41 74 74 61 63  |Cshell_MenuAttac|
00008d20  68 44 62 6f 78 0d 04 79  22 dd 20 f2 73 68 65 6c  |hDbox..y". .shel|
00008d30  6c 5f 4d 65 6e 75 41 74  74 61 63 68 44 62 6f 78  |l_MenuAttachDbox|
00008d40  28 6d 65 6e 75 24 29 0d  04 7a 4d f4 20 61 74 74  |(menu$)..zM. att|
00008d50  61 63 68 20 61 20 64 75  6d 6d 79 20 77 69 6e 64  |ach a dummy wind|
00008d60  6f 77 20 68 61 6e 64 6c  65 20 66 6f 72 20 6e 6f  |ow handle for no|
00008d70  77 2c 20 6a 75 73 74 20  73 6f 20 74 68 61 74 20  |w, just so that |
00008d80  74 68 65 20 73 75 62 20  77 69 6e 64 6f 77 20 61  |the sub window a|
00008d90  72 72 6f 77 0d 04 7b 1a  f4 20 61 70 70 65 61 72  |rrow..{.. appear|
00008da0  73 20 6f 6e 20 74 68 65  20 6d 65 6e 75 21 0d 04  |s on the menu!..|
00008db0  7c 3b c8 99 20 22 4d 65  6e 75 5f 53 65 74 53 75  ||;.. "Menu_SetSu|
00008dc0  62 48 61 6e 64 6c 65 22  2c 5f 55 25 21 38 2c a4  |bHandle",_U%!8,.|
00008dd0  73 68 65 6c 6c 5f 4d 65  6e 75 53 74 72 69 6e 67  |shell_MenuString|
00008de0  28 6d 65 6e 75 24 29 2c  31 0d 04 7d 44 f2 73 68  |(menu$),1..}D.sh|
00008df0  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 4d 65 6e  |ell_Tracef0("Men|
00008e00  75 41 74 74 61 63 68 44  62 6f 78 3a 44 69 61 6c  |uAttachDbox:Dial|
00008e10  6f 67 20 62 6f 78 20 28  22 2b 6d 65 6e 75 24 2b  |og box ("+menu$+|
00008e20  22 29 20 61 74 74 61 63  68 65 64 22 29 0d 04 7e  |") attached")..~|
00008e30  05 e1 0d 04 7f 05 3a 0d  04 80 23 2a 7c 53 74 6f  |......:...#*|Sto|
00008e40  70 20 50 52 4f 43 73 68  65 6c 6c 5f 4d 65 6e 75  |p PROCshell_Menu|
00008e50  41 74 74 61 63 68 44 62  6f 78 0d 04 81 04 0d 04  |AttachDbox......|
00008e60  82 21 2a 7c 53 74 61 72  74 20 46 4e 73 68 65 6c  |.!*|Start FNshel|
00008e70  6c 5f 4d 65 73 73 61 67  65 57 69 6e 64 6f 77 0d  |l_MessageWindow.|
00008e80  04 83 39 dd 20 a4 73 68  65 6c 6c 5f 4d 65 73 73  |..9. .shell_Mess|
00008e90  61 67 65 57 69 6e 64 6f  77 28 74 65 78 74 24 2c  |ageWindow(text$,|
00008ea0  63 61 6e 63 65 6c 25 2c  70 72 6f 67 6e 61 6d 65  |cancel%,progname|
00008eb0  24 2c 68 65 61 64 24 29  0d 04 84 14 ea 20 6b 65  |$,head$)..... ke|
00008ec0  79 73 25 2c 65 72 72 5f  62 6c 6b 25 0d 04 85 27  |ys%,err_blk%...'|
00008ed0  65 72 72 5f 62 6c 6b 25  3d a4 73 68 65 6c 6c 5f  |err_blk%=.shell_|
00008ee0  48 65 61 70 42 6c 6f 63  6b 46 65 74 63 68 28 32  |HeapBlockFetch(2|
00008ef0  36 30 29 0d 04 86 28 21  65 72 72 5f 62 6c 6b 25  |60)...(!err_blk%|
00008f00  3d 30 3a 24 28 65 72 72  5f 62 6c 6b 25 2b 34 29  |=0:$(err_blk%+4)|
00008f10  3d 74 65 78 74 24 2b bd  28 30 29 0d 04 87 30 e7  |=text$+.(0)...0.|
00008f20  20 68 65 61 64 24 3d 22  22 20 8c 20 68 65 61 64  | head$="" . head|
00008f30  24 3d 22 4d 65 73 73 61  67 65 20 66 72 6f 6d 20  |$="Message from |
00008f40  22 2b 70 72 6f 67 6e 61  6d 65 24 0d 04 88 0f e7  |"+progname$.....|
00008f50  20 63 61 6e 63 65 6c 25  20 8c 0d 04 89 35 20 c8  | cancel% ....5 .|
00008f60  99 20 22 57 69 6d 70 5f  52 65 70 6f 72 74 45 72  |. "Wimp_ReportEr|
00008f70  72 6f 72 22 2c 65 72 72  5f 62 6c 6b 25 2c 31 39  |ror",err_blk%,19|
00008f80  2c 68 65 61 64 24 20 b8  20 2c 6b 65 79 73 25 0d  |,head$ . ,keys%.|
00008f90  04 8a 05 cc 0d 04 8b 35  20 c8 99 20 22 57 69 6d  |.......5 .. "Wim|
00008fa0  70 5f 52 65 70 6f 72 74  45 72 72 6f 72 22 2c 65  |p_ReportError",e|
00008fb0  72 72 5f 62 6c 6b 25 2c  31 37 2c 68 65 61 64 24  |rr_blk%,17,head$|
00008fc0  20 b8 20 2c 6b 65 79 73  25 0d 04 8c 05 cd 0d 04  | . ,keys%.......|
00008fd0  8d 24 f2 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |.$.shell_HeapBlo|
00008fe0  63 6b 52 65 74 75 72 6e  28 65 72 72 5f 62 6c 6b  |ckReturn(err_blk|
00008ff0  25 29 0d 04 8e 0a 3d 6b  65 79 73 25 0d 04 8f 05  |%)....=keys%....|
00009000  3a 0d 04 90 20 2a 7c 53  74 6f 70 20 46 4e 73 68  |:... *|Stop FNsh|
00009010  65 6c 6c 5f 4d 65 73 73  61 67 65 57 69 6e 64 6f  |ell_MessageWindo|
00009020  77 0d 04 91 04 0d 04 92  22 2a 7c 53 74 61 72 74  |w......."*|Start|
00009030  20 50 52 4f 43 73 68 65  6c 6c 5f 43 72 65 61 74  | PROCshell_Creat|
00009040  65 57 69 6e 64 6f 77 0d  04 93 2b dd 20 f2 73 68  |eWindow...+. .sh|
00009050  65 6c 6c 5f 43 72 65 61  74 65 57 69 6e 64 6f 77  |ell_CreateWindow|
00009060  28 69 64 65 6e 74 24 2c  f8 20 68 61 6e 64 6c 65  |(ident$,. handle|
00009070  25 29 0d 04 94 0d ea 20  77 62 5f 70 74 72 25 0d  |%)..... wb_ptr%.|
00009080  04 95 20 77 62 5f 70 74  72 25 3d a4 73 68 65 6c  |.. wb_ptr%=.shel|
00009090  6c 5f 47 65 74 57 42 28  69 64 65 6e 74 24 29 0d  |l_GetWB(ident$).|
000090a0  04 96 33 f4 20 73 65 74  20 27 73 70 72 69 74 65  |..3. set 'sprite|
000090b0  20 61 72 65 61 27 20 70  6f 69 6e 74 65 72 20 74  | area' pointer t|
000090c0  6f 20 75 73 65 72 73 70  72 69 74 65 73 20 61 72  |o usersprites ar|
000090d0  65 61 0d 04 97 15 77 62  5f 70 74 72 25 21 36 34  |ea....wb_ptr%!64|
000090e0  3d 5f 55 25 21 31 36 0d  04 98 2d c8 99 20 22 57  |=_U%!16...-.. "W|
000090f0  69 6d 70 5f 43 72 65 61  74 65 57 69 6e 64 6f 77  |imp_CreateWindow|
00009100  22 2c 2c 77 62 5f 70 74  72 25 20 b8 20 68 61 6e  |",,wb_ptr% . han|
00009110  64 6c 65 25 0d 04 99 05  e1 0d 04 9a 05 3a 0d 04  |dle%.........:..|
00009120  9b 21 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |.!*|Stop PROCshe|
00009130  6c 6c 5f 43 72 65 61 74  65 57 69 6e 64 6f 77 0d  |ll_CreateWindow.|
00009140  04 9c 21 2a 7c 53 74 61  72 74 20 46 4e 73 68 65  |..!*|Start FNshe|
00009150  6c 6c 5f 43 72 65 61 74  65 57 69 6e 64 6f 77 32  |ll_CreateWindow2|
00009160  0d 04 9d 4e dd 20 a4 73  68 65 6c 6c 5f 43 72 65  |...N. .shell_Cre|
00009170  61 74 65 57 69 6e 64 6f  77 32 28 74 69 74 6c 65  |ateWindow2(title|
00009180  2c 66 6c 61 67 73 25 2c  66 67 63 6f 6c 25 2c 62  |,flags%,fgcol%,b|
00009190  67 63 6f 6c 25 2c 6d 61  78 78 25 2c 6d 69 6e 79  |gcol%,maxx%,miny|
000091a0  25 2c 6c 25 2c 62 25 2c  72 25 2c 74 25 29 0d 04  |%,l%,b%,r%,t%)..|
000091b0  9e 08 ea 20 51 25 0d 04  9f 22 51 25 3d a4 73 68  |... Q%..."Q%=.sh|
000091c0  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
000091d0  63 68 28 33 30 30 30 29  0d 04 a0 2c 51 25 21 30  |ch(3000)...,Q%!0|
000091e0  3d 6c 25 3a 51 25 21 34  3d 62 25 3a 51 25 21 38  |=l%:Q%!4=b%:Q%!8|
000091f0  3d 72 25 3a 51 25 21 31  32 3d 74 25 3a 51 25 21  |=r%:Q%!12=t%:Q%!|
00009200  31 36 3d 30 0d 04 a1 29  51 25 21 32 30 3d 30 3a  |16=0...)Q%!20=0:|
00009210  51 25 21 32 34 3d 2d 31  3a 51 25 21 32 38 3d 66  |Q%!24=-1:Q%!28=f|
00009220  6c 61 67 73 25 3a 51 25  3f 33 32 3d 37 0d 04 a2  |lags%:Q%?32=7...|
00009230  25 51 25 3f 33 33 3d 32  3a 51 25 3f 33 34 3d 66  |%Q%?33=2:Q%?34=f|
00009240  67 63 6f 6c 25 3a 51 25  3f 33 35 3d 62 67 63 6f  |gcol%:Q%?35=bgco|
00009250  6c 25 0d 04 a3 13 51 25  3f 33 36 3d 33 3a 51 25  |l%....Q%?36=3:Q%|
00009260  3f 33 37 3d 31 0d 04 a4  27 51 25 3f 33 38 3d 32  |?37=1...'Q%?38=2|
00009270  3a 51 25 3f 33 39 3d 30  3a 51 25 21 34 30 3d 30  |:Q%?39=0:Q%!40=0|
00009280  3a 51 25 21 34 34 3d 6d  69 6e 79 25 0d 04 a5 2e  |:Q%!44=miny%....|
00009290  51 25 21 34 38 3d 6d 61  78 78 25 3a 51 25 21 35  |Q%!48=maxx%:Q%!5|
000092a0  32 3d 30 3a 51 25 21 35  36 3d 26 31 33 44 3a 51  |2=0:Q%!56=&13D:Q|
000092b0  25 21 36 30 3d 26 33 30  30 30 0d 04 a6 36 51 25  |%!60=&3000...6Q%|
000092c0  21 36 38 3d 31 3a 51 25  21 37 32 3d 74 69 74 6c  |!68=1:Q%!72=titl|
000092d0  65 3a 51 25 21 37 36 3d  2d 31 3a 51 25 21 38 30  |e:Q%!76=-1:Q%!80|
000092e0  3d a9 24 74 69 74 6c 65  3a 51 25 21 38 34 3d 30  |=.$title:Q%!84=0|
000092f0  0d 04 a7 28 c8 99 20 22  57 69 6d 70 5f 43 72 65  |...(.. "Wimp_Cre|
00009300  61 74 65 57 69 6e 64 6f  77 22 2c 2c 51 25 20 b8  |ateWindow",,Q% .|
00009310  20 68 61 6e 64 6c 65 25  0d 04 a8 1e f2 73 68 65  | handle%.....she|
00009320  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 52 65 74 75  |ll_HeapBlockRetu|
00009330  72 6e 28 51 25 29 0d 04  a9 0c 3d 68 61 6e 64 6c  |rn(Q%)....=handl|
00009340  65 25 0d 04 aa 05 3a 0d  04 ab 20 2a 7c 53 74 6f  |e%....:... *|Sto|
00009350  70 20 46 4e 73 68 65 6c  6c 5f 43 72 65 61 74 65  |p FNshell_Create|
00009360  57 69 6e 64 6f 77 32 0d  04 ac 25 2a 7c 53 74 61  |Window2...%*|Sta|
00009370  72 74 20 46 4e 73 68 65  6c 6c 5f 57 69 6e 64 6f  |rt FNshell_Windo|
00009380  77 48 61 73 54 69 74 6c  65 42 61 72 0d 04 ad 23  |wHasTitleBar...#|
00009390  dd 20 a4 73 68 65 6c 6c  5f 57 69 6e 64 6f 77 48  |. .shell_WindowH|
000093a0  61 73 54 69 74 6c 65 42  61 72 28 77 68 25 29 0d  |asTitleBar(wh%).|
000093b0  04 ae 29 3d 28 a4 73 68  65 6c 6c 5f 57 69 6e 64  |..)=(.shell_Wind|
000093c0  6f 77 47 65 74 46 6c 61  67 73 28 77 68 25 29 20  |owGetFlags(wh%) |
000093d0  80 20 31 3c 3c 32 36 29  0d 04 af 05 3a 0d 04 b0  |. 1<<26)....:...|
000093e0  24 2a 7c 53 74 6f 70 20  46 4e 73 68 65 6c 6c 5f  |$*|Stop FNshell_|
000093f0  57 69 6e 64 6f 77 48 61  73 54 69 74 6c 65 42 61  |WindowHasTitleBa|
00009400  72 0d 04 b1 24 2a 7c 53  74 61 72 74 20 46 4e 73  |r...$*|Start FNs|
00009410  68 65 6c 6c 5f 57 69 6e  64 6f 77 49 73 4d 6f 76  |hell_WindowIsMov|
00009420  65 61 62 6c 65 0d 04 b2  22 dd 20 a4 73 68 65 6c  |eable...". .shel|
00009430  6c 5f 57 69 6e 64 6f 77  49 73 4d 6f 76 65 61 62  |l_WindowIsMoveab|
00009440  6c 65 28 77 68 25 29 0d  04 b3 28 3d 28 a4 73 68  |le(wh%)...(=(.sh|
00009450  65 6c 6c 5f 57 69 6e 64  6f 77 47 65 74 46 6c 61  |ell_WindowGetFla|
00009460  67 73 28 77 68 25 29 20  80 20 31 3c 3c 31 29 0d  |gs(wh%) . 1<<1).|
00009470  04 b4 05 3a 0d 04 b5 23  2a 7c 53 74 6f 70 20 46  |...:...#*|Stop F|
00009480  4e 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 49 73 4d  |Nshell_WindowIsM|
00009490  6f 76 65 61 62 6c 65 0d  04 b6 21 2a 7c 53 74 61  |oveable...!*|Sta|
000094a0  72 74 20 46 4e 73 68 65  6c 6c 5f 57 69 6e 64 6f  |rt FNshell_Windo|
000094b0  77 49 73 41 50 61 6e 65  0d 04 b7 1f dd 20 a4 73  |wIsAPane..... .s|
000094c0  68 65 6c 6c 5f 57 69 6e  64 6f 77 49 73 41 50 61  |hell_WindowIsAPa|
000094d0  6e 65 28 77 68 25 29 0d  04 b8 28 3d 28 a4 73 68  |ne(wh%)...(=(.sh|
000094e0  65 6c 6c 5f 57 69 6e 64  6f 77 47 65 74 46 6c 61  |ell_WindowGetFla|
000094f0  67 73 28 77 68 25 29 20  80 20 31 3c 3c 35 29 0d  |gs(wh%) . 1<<5).|
00009500  04 b9 05 3a 0d 04 ba 20  2a 7c 53 74 6f 70 20 46  |...:... *|Stop F|
00009510  4e 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 49 73 41  |Nshell_WindowIsA|
00009520  50 61 6e 65 0d 04 bb 26  2a 7c 53 74 61 72 74 20  |Pane...&*|Start |
00009530  46 4e 73 68 65 6c 6c 5f  57 69 6e 64 6f 77 49 73  |FNshell_WindowIs|
00009540  4e 6f 74 42 6f 75 6e 64  65 64 0d 04 bc 24 dd 20  |NotBounded...$. |
00009550  a4 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 49 73 4e  |.shell_WindowIsN|
00009560  6f 74 42 6f 75 6e 64 65  64 28 77 68 25 29 0d 04  |otBounded(wh%)..|
00009570  bd 28 3d 28 a4 73 68 65  6c 6c 5f 57 69 6e 64 6f  |.(=(.shell_Windo|
00009580  77 47 65 74 46 6c 61 67  73 28 77 68 25 29 20 80  |wGetFlags(wh%) .|
00009590  20 31 3c 3c 36 29 0d 04  be 05 3a 0d 04 bf 25 2a  | 1<<6)....:...%*|
000095a0  7c 53 74 6f 70 20 46 4e  73 68 65 6c 6c 5f 57 69  ||Stop FNshell_Wi|
000095b0  6e 64 6f 77 49 73 4e 6f  74 42 6f 75 6e 64 65 64  |ndowIsNotBounded|
000095c0  0d 04 c0 26 2a 7c 53 74  61 72 74 20 46 4e 73 68  |...&*|Start FNsh|
000095d0  65 6c 6c 5f 57 69 6e 64  6f 77 54 72 61 70 73 48  |ell_WindowTrapsH|
000095e0  6f 74 4b 65 79 73 0d 04  c1 24 dd 20 a4 73 68 65  |otKeys...$. .she|
000095f0  6c 6c 5f 57 69 6e 64 6f  77 54 72 61 70 73 48 6f  |ll_WindowTrapsHo|
00009600  74 4b 65 79 73 28 77 68  25 29 0d 04 c2 29 3d 28  |tKeys(wh%)...)=(|
00009610  a4 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 47 65 74  |.shell_WindowGet|
00009620  46 6c 61 67 73 28 77 68  25 29 20 80 20 31 3c 3c  |Flags(wh%) . 1<<|
00009630  31 32 29 0d 04 c3 05 3a  0d 04 c4 25 2a 7c 53 74  |12)....:...%*|St|
00009640  6f 70 20 46 4e 73 68 65  6c 6c 5f 57 69 6e 64 6f  |op FNshell_Windo|
00009650  77 54 72 61 70 73 48 6f  74 4b 65 79 73 0d 04 c5  |wTrapsHotKeys...|
00009660  20 2a 7c 53 74 61 72 74  20 46 4e 73 68 65 6c 6c  | *|Start FNshell|
00009670  5f 57 69 6e 64 6f 77 49  73 4f 70 65 6e 0d 04 c6  |_WindowIsOpen...|
00009680  1e dd 20 a4 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |.. .shell_Window|
00009690  49 73 4f 70 65 6e 28 77  68 25 29 0d 04 c7 29 3d  |IsOpen(wh%)...)=|
000096a0  28 a4 73 68 65 6c 6c 5f  57 69 6e 64 6f 77 47 65  |(.shell_WindowGe|
000096b0  74 46 6c 61 67 73 28 77  68 25 29 20 80 20 31 3c  |tFlags(wh%) . 1<|
000096c0  3c 31 36 29 0d 04 c8 05  3a 0d 04 c9 1f 2a 7c 53  |<16)....:....*|S|
000096d0  74 6f 70 20 46 4e 73 68  65 6c 6c 5f 57 69 6e 64  |top FNshell_Wind|
000096e0  6f 77 49 73 4f 70 65 6e  0d 04 ca 21 2a 7c 53 74  |owIsOpen...!*|St|
000096f0  61 72 74 20 46 4e 73 68  65 6c 6c 5f 57 69 6e 64  |art FNshell_Wind|
00009700  6f 77 49 73 4f 6e 54 6f  70 0d 04 cb 1f dd 20 a4  |owIsOnTop..... .|
00009710  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 49 73 4f 6e  |shell_WindowIsOn|
00009720  54 6f 70 28 77 68 25 29  0d 04 cc 29 3d 28 a4 73  |Top(wh%)...)=(.s|
00009730  68 65 6c 6c 5f 57 69 6e  64 6f 77 47 65 74 46 6c  |hell_WindowGetFl|
00009740  61 67 73 28 77 68 25 29  20 80 20 31 3c 3c 31 37  |ags(wh%) . 1<<17|
00009750  29 0d 04 cd 05 3a 0d 04  ce 20 2a 7c 53 74 6f 70  |)....:... *|Stop|
00009760  20 46 4e 73 68 65 6c 6c  5f 57 69 6e 64 6f 77 49  | FNshell_WindowI|
00009770  73 4f 6e 54 6f 70 0d 04  cf 28 2a 7c 53 74 61 72  |sOnTop...(*|Star|
00009780  74 20 46 4e 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |t FNshell_Window|
00009790  48 61 73 42 65 65 6e 54  6f 67 67 6c 65 64 0d 04  |HasBeenToggled..|
000097a0  d0 26 dd 20 a4 73 68 65  6c 6c 5f 57 69 6e 64 6f  |.&. .shell_Windo|
000097b0  77 48 61 73 42 65 65 6e  54 6f 67 67 6c 65 64 28  |wHasBeenToggled(|
000097c0  77 68 25 29 0d 04 d1 29  3d 28 a4 73 68 65 6c 6c  |wh%)...)=(.shell|
000097d0  5f 57 69 6e 64 6f 77 47  65 74 46 6c 61 67 73 28  |_WindowGetFlags(|
000097e0  77 68 25 29 20 80 20 31  3c 3c 31 38 29 0d 04 d2  |wh%) . 1<<18)...|
000097f0  05 3a 0d 04 d3 27 2a 7c  53 74 6f 70 20 46 4e 73  |.:...'*|Stop FNs|
00009800  68 65 6c 6c 5f 57 69 6e  64 6f 77 48 61 73 42 65  |hell_WindowHasBe|
00009810  65 6e 54 6f 67 67 6c 65  64 0d 04 d4 27 2a 7c 53  |enToggled...'*|S|
00009820  74 61 72 74 20 46 4e 73  68 65 6c 6c 5f 57 69 6e  |tart FNshell_Win|
00009830  64 6f 77 48 61 73 49 6e  70 75 74 46 6f 63 75 73  |dowHasInputFocus|
00009840  0d 04 d5 25 dd 20 a4 73  68 65 6c 6c 5f 57 69 6e  |...%. .shell_Win|
00009850  64 6f 77 48 61 73 49 6e  70 75 74 46 6f 63 75 73  |dowHasInputFocus|
00009860  28 77 68 25 29 0d 04 d6  29 3d 28 a4 73 68 65 6c  |(wh%)...)=(.shel|
00009870  6c 5f 57 69 6e 64 6f 77  47 65 74 46 6c 61 67 73  |l_WindowGetFlags|
00009880  28 77 68 25 29 20 80 20  31 3c 3c 32 30 29 0d 04  |(wh%) . 1<<20)..|
00009890  d7 05 3a 0d 04 d8 26 2a  7c 53 74 6f 70 20 46 4e  |..:...&*|Stop FN|
000098a0  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 48 61 73 49  |shell_WindowHasI|
000098b0  6e 70 75 74 46 6f 63 75  73 0d 04 d9 25 2a 7c 53  |nputFocus...%*|S|
000098c0  74 61 72 74 20 46 4e 73  68 65 6c 6c 5f 57 69 6e  |tart FNshell_Win|
000098d0  64 6f 77 48 61 73 42 61  63 6b 49 63 6f 6e 0d 04  |dowHasBackIcon..|
000098e0  da 23 dd 20 a4 73 68 65  6c 6c 5f 57 69 6e 64 6f  |.#. .shell_Windo|
000098f0  77 48 61 73 42 61 63 6b  49 63 6f 6e 28 77 68 25  |wHasBackIcon(wh%|
00009900  29 0d 04 db 29 3d 28 a4  73 68 65 6c 6c 5f 57 69  |)...)=(.shell_Wi|
00009910  6e 64 6f 77 47 65 74 46  6c 61 67 73 28 77 68 25  |ndowGetFlags(wh%|
00009920  29 20 80 20 31 3c 3c 32  34 29 0d 04 dc 05 3a 0d  |) . 1<<24)....:.|
00009930  04 dd 24 2a 7c 53 74 6f  70 20 46 4e 73 68 65 6c  |..$*|Stop FNshel|
00009940  6c 5f 57 69 6e 64 6f 77  48 61 73 42 61 63 6b 49  |l_WindowHasBackI|
00009950  63 6f 6e 0d 04 de 26 2a  7c 53 74 61 72 74 20 46  |con...&*|Start F|
00009960  4e 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 48 61 73  |Nshell_WindowHas|
00009970  43 6c 6f 73 65 49 63 6f  6e 0d 04 df 24 dd 20 a4  |CloseIcon...$. .|
00009980  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 48 61 73 43  |shell_WindowHasC|
00009990  6c 6f 73 65 49 63 6f 6e  28 77 68 25 29 0d 04 e0  |loseIcon(wh%)...|
000099a0  29 3d 28 a4 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |)=(.shell_Window|
000099b0  47 65 74 46 6c 61 67 73  28 77 68 25 29 20 80 20  |GetFlags(wh%) . |
000099c0  31 3c 3c 32 35 29 0d 04  e1 05 3a 0d 04 e2 25 2a  |1<<25)....:...%*|
000099d0  7c 53 74 6f 70 20 46 4e  73 68 65 6c 6c 5f 57 69  ||Stop FNshell_Wi|
000099e0  6e 64 6f 77 48 61 73 43  6c 6f 73 65 49 63 6f 6e  |ndowHasCloseIcon|
000099f0  0d 04 e3 27 2a 7c 53 74  61 72 74 20 46 4e 73 68  |...'*|Start FNsh|
00009a00  65 6c 6c 5f 57 69 6e 64  6f 77 48 61 73 54 6f 67  |ell_WindowHasTog|
00009a10  67 6c 65 49 63 6f 6e 0d  04 e4 25 dd 20 a4 73 68  |gleIcon...%. .sh|
00009a20  65 6c 6c 5f 57 69 6e 64  6f 77 48 61 73 54 6f 67  |ell_WindowHasTog|
00009a30  67 6c 65 49 63 6f 6e 28  77 68 25 29 0d 04 e5 29  |gleIcon(wh%)...)|
00009a40  3d 28 a4 73 68 65 6c 6c  5f 57 69 6e 64 6f 77 47  |=(.shell_WindowG|
00009a50  65 74 46 6c 61 67 73 28  77 68 25 29 20 80 20 31  |etFlags(wh%) . 1|
00009a60  3c 3c 32 37 29 0d 04 e6  05 3a 0d 04 e7 26 2a 7c  |<<27)....:...&*||
00009a70  53 74 6f 70 20 46 4e 73  68 65 6c 6c 5f 57 69 6e  |Stop FNshell_Win|
00009a80  64 6f 77 48 61 73 54 6f  67 67 6c 65 49 63 6f 6e  |dowHasToggleIcon|
00009a90  0d 04 e8 27 2a 7c 53 74  61 72 74 20 46 4e 73 68  |...'*|Start FNsh|
00009aa0  65 6c 6c 5f 57 69 6e 64  6f 77 48 61 73 56 53 63  |ell_WindowHasVSc|
00009ab0  72 6f 6c 6c 42 61 72 0d  04 e9 25 dd 20 a4 73 68  |rollBar...%. .sh|
00009ac0  65 6c 6c 5f 57 69 6e 64  6f 77 48 61 73 56 53 63  |ell_WindowHasVSc|
00009ad0  72 6f 6c 6c 42 61 72 28  77 68 25 29 0d 04 ea 29  |rollBar(wh%)...)|
00009ae0  3d 28 a4 73 68 65 6c 6c  5f 57 69 6e 64 6f 77 47  |=(.shell_WindowG|
00009af0  65 74 46 6c 61 67 73 28  77 68 25 29 20 80 20 31  |etFlags(wh%) . 1|
00009b00  3c 3c 32 38 29 0d 04 eb  05 3a 0d 04 ec 26 2a 7c  |<<28)....:...&*||
00009b10  53 74 6f 70 20 46 4e 73  68 65 6c 6c 5f 57 69 6e  |Stop FNshell_Win|
00009b20  64 6f 77 48 61 73 56 53  63 72 6f 6c 6c 42 61 72  |dowHasVScrollBar|
00009b30  0d 04 ed 2b 2a 7c 53 74  61 72 74 20 46 4e 73 68  |...+*|Start FNsh|
00009b40  65 6c 6c 5f 57 69 6e 64  6f 77 48 61 73 41 64 6a  |ell_WindowHasAdj|
00009b50  75 73 74 53 69 7a 65 49  63 6f 6e 0d 04 ee 29 dd  |ustSizeIcon...).|
00009b60  20 a4 73 68 65 6c 6c 5f  57 69 6e 64 6f 77 48 61  | .shell_WindowHa|
00009b70  73 41 64 6a 75 73 74 53  69 7a 65 49 63 6f 6e 28  |sAdjustSizeIcon(|
00009b80  77 68 25 29 0d 04 ef 29  3d 28 a4 73 68 65 6c 6c  |wh%)...)=(.shell|
00009b90  5f 57 69 6e 64 6f 77 47  65 74 46 6c 61 67 73 28  |_WindowGetFlags(|
00009ba0  77 68 25 29 20 80 20 31  3c 3c 32 39 29 0d 04 f0  |wh%) . 1<<29)...|
00009bb0  05 3a 0d 04 f1 2a 2a 7c  53 74 6f 70 20 46 4e 73  |.:...**|Stop FNs|
00009bc0  68 65 6c 6c 5f 57 69 6e  64 6f 77 48 61 73 41 64  |hell_WindowHasAd|
00009bd0  6a 75 73 74 53 69 7a 65  49 63 6f 6e 0d 04 f2 27  |justSizeIcon...'|
00009be0  2a 7c 53 74 61 72 74 20  46 4e 73 68 65 6c 6c 5f  |*|Start FNshell_|
00009bf0  57 69 6e 64 6f 77 48 61  73 48 53 63 72 6f 6c 6c  |WindowHasHScroll|
00009c00  42 61 72 0d 04 f3 25 dd  20 a4 73 68 65 6c 6c 5f  |Bar...%. .shell_|
00009c10  57 69 6e 64 6f 77 48 61  73 48 53 63 72 6f 6c 6c  |WindowHasHScroll|
00009c20  42 61 72 28 77 68 25 29  0d 04 f4 29 3d 28 a4 73  |Bar(wh%)...)=(.s|
00009c30  68 65 6c 6c 5f 57 69 6e  64 6f 77 47 65 74 46 6c  |hell_WindowGetFl|
00009c40  61 67 73 28 77 68 25 29  20 80 20 31 3c 3c 33 30  |ags(wh%) . 1<<30|
00009c50  29 0d 04 f5 05 3a 0d 04  f6 26 2a 7c 53 74 6f 70  |)....:...&*|Stop|
00009c60  20 46 4e 73 68 65 6c 6c  5f 57 69 6e 64 6f 77 48  | FNshell_WindowH|
00009c70  61 73 48 53 63 72 6f 6c  6c 42 61 72 0d 04 f7 22  |asHScrollBar..."|
00009c80  2a 7c 53 74 61 72 74 20  46 4e 73 68 65 6c 6c 5f  |*|Start FNshell_|
00009c90  57 69 6e 64 6f 77 47 65  74 46 6c 61 67 73 0d 04  |WindowGetFlags..|
00009ca0  f8 20 dd 20 a4 73 68 65  6c 6c 5f 57 69 6e 64 6f  |. . .shell_Windo|
00009cb0  77 47 65 74 46 6c 61 67  73 28 77 68 25 29 0d 04  |wGetFlags(wh%)..|
00009cc0  f9 11 ea 20 66 6c 61 67  73 25 2c 62 6c 6b 25 0d  |... flags%,blk%.|
00009cd0  04 fa 22 62 6c 6b 25 3d  a4 73 68 65 6c 6c 5f 48  |.."blk%=.shell_H|
00009ce0  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 33 36  |eapBlockFetch(36|
00009cf0  29 0d 04 fb 0e 62 6c 6b  25 21 30 3d 77 68 25 0d  |)....blk%!0=wh%.|
00009d00  04 fc 22 c8 99 20 22 57  69 6d 70 5f 47 65 74 57  |..".. "Wimp_GetW|
00009d10  69 6e 64 6f 77 53 74 61  74 65 22 2c 2c 62 6c 6b  |indowState",,blk|
00009d20  25 0d 04 fd 12 66 6c 61  67 73 25 3d 62 6c 6b 25  |%....flags%=blk%|
00009d30  21 33 32 0d 04 fe 20 f2  73 68 65 6c 6c 5f 48 65  |!32... .shell_He|
00009d40  61 70 42 6c 6f 63 6b 52  65 74 75 72 6e 28 62 6c  |apBlockReturn(bl|
00009d50  6b 25 29 0d 04 ff 0b 3d  66 6c 61 67 73 25 0d 05  |k%)....=flags%..|
00009d60  00 05 3a 0d 05 01 21 2a  7c 53 74 6f 70 20 46 4e  |..:...!*|Stop FN|
00009d70  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 47 65 74 46  |shell_WindowGetF|
00009d80  6c 61 67 73 0d 05 02 24  2a 7c 53 74 61 72 74 20  |lags...$*|Start |
00009d90  46 4e 73 68 65 6c 6c 5f  57 69 6e 64 6f 77 54 69  |FNshell_WindowTi|
00009da0  74 6c 65 46 6c 61 67 73  0d 05 03 22 dd 20 a4 73  |tleFlags...". .s|
00009db0  68 65 6c 6c 5f 57 69 6e  64 6f 77 54 69 74 6c 65  |hell_WindowTitle|
00009dc0  46 6c 61 67 73 28 77 68  25 29 0d 05 04 11 ea 20  |Flags(wh%)..... |
00009dd0  66 6c 61 67 73 25 2c 62  6c 6b 25 0d 05 05 24 62  |flags%,blk%...$b|
00009de0  6c 6b 25 3d a4 73 68 65  6c 6c 5f 48 65 61 70 42  |lk%=.shell_HeapB|
00009df0  6c 6f 63 6b 46 65 74 63  68 28 33 30 30 30 29 0d  |lockFetch(3000).|
00009e00  05 06 0e 62 6c 6b 25 21  30 3d 77 68 25 0d 05 07  |...blk%!0=wh%...|
00009e10  21 c8 99 20 22 57 69 6d  70 5f 47 65 74 57 69 6e  |!.. "Wimp_GetWin|
00009e20  64 6f 77 49 6e 66 6f 22  2c 2c 62 6c 6b 25 0d 05  |dowInfo",,blk%..|
00009e30  08 12 66 6c 61 67 73 25  3d 62 6c 6b 25 21 36 30  |..flags%=blk%!60|
00009e40  0d 05 09 20 f2 73 68 65  6c 6c 5f 48 65 61 70 42  |... .shell_HeapB|
00009e50  6c 6f 63 6b 52 65 74 75  72 6e 28 62 6c 6b 25 29  |lockReturn(blk%)|
00009e60  0d 05 0a 0b 3d 66 6c 61  67 73 25 0d 05 0b 05 3a  |....=flags%....:|
00009e70  0d 05 0c 0b f4 20 48 69  6c 6b 65 0d 05 0d 23 2a  |..... Hilke...#*|
00009e80  7c 53 74 6f 70 20 46 4e  73 68 65 6c 6c 5f 57 69  ||Stop FNshell_Wi|
00009e90  6e 64 6f 77 54 69 74 6c  65 46 6c 61 67 73 0d 05  |ndowTitleFlags..|
00009ea0  0e 28 2a 7c 53 74 61 72  74 20 46 4e 73 68 65 6c  |.(*|Start FNshel|
00009eb0  6c 5f 57 69 6e 64 6f 77  54 69 74 6c 65 48 61 73  |l_WindowTitleHas|
00009ec0  42 6f 72 64 65 72 0d 05  0f 26 dd 20 a4 73 68 65  |Border...&. .she|
00009ed0  6c 6c 5f 57 69 6e 64 6f  77 54 69 74 6c 65 48 61  |ll_WindowTitleHa|
00009ee0  73 42 6f 72 64 65 72 28  77 68 25 29 0d 05 10 2a  |sBorder(wh%)...*|
00009ef0  3d 28 a4 73 68 65 6c 6c  5f 57 69 6e 64 6f 77 54  |=(.shell_WindowT|
00009f00  69 74 6c 65 46 6c 61 67  73 28 77 68 25 29 20 80  |itleFlags(wh%) .|
00009f10  20 31 3c 3c 32 29 0d 05  11 05 3a 0d 05 12 27 2a  | 1<<2)....:...'*|
00009f20  7c 53 74 6f 70 20 46 4e  73 68 65 6c 6c 5f 57 69  ||Stop FNshell_Wi|
00009f30  6e 64 6f 77 54 69 74 6c  65 48 61 73 42 6f 72 64  |ndowTitleHasBord|
00009f40  65 72 0d 05 13 27 2a 7c  53 74 61 72 74 20 46 4e  |er...'*|Start FN|
00009f50  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 54 69 74 6c  |shell_WindowTitl|
00009f60  65 49 73 53 70 72 69 74  65 0d 05 14 25 dd 20 a4  |eIsSprite...%. .|
00009f70  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 54 69 74 6c  |shell_WindowTitl|
00009f80  65 49 73 53 70 72 69 74  65 28 77 68 25 29 0d 05  |eIsSprite(wh%)..|
00009f90  15 2a 3d 28 a4 73 68 65  6c 6c 5f 57 69 6e 64 6f  |.*=(.shell_Windo|
00009fa0  77 54 69 74 6c 65 46 6c  61 67 73 28 77 68 25 29  |wTitleFlags(wh%)|
00009fb0  20 80 20 31 3c 3c 31 29  0d 05 16 05 3a 0d 05 17  | . 1<<1)....:...|
00009fc0  26 2a 7c 53 74 6f 70 20  46 4e 73 68 65 6c 6c 5f  |&*|Stop FNshell_|
00009fd0  57 69 6e 64 6f 77 54 69  74 6c 65 49 73 53 70 72  |WindowTitleIsSpr|
00009fe0  69 74 65 0d 05 18 25 2a  7c 53 74 61 72 74 20 46  |ite...%*|Start F|
00009ff0  4e 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 54 69 74  |Nshell_WindowTit|
0000a000  6c 65 49 73 54 65 78 74  0d 05 19 23 dd 20 a4 73  |leIsText...#. .s|
0000a010  68 65 6c 6c 5f 57 69 6e  64 6f 77 54 69 74 6c 65  |hell_WindowTitle|
0000a020  49 73 54 65 78 74 28 77  68 25 29 0d 05 1a 2a 3d  |IsText(wh%)...*=|
0000a030  28 a4 73 68 65 6c 6c 5f  57 69 6e 64 6f 77 54 69  |(.shell_WindowTi|
0000a040  74 6c 65 46 6c 61 67 73  28 77 68 25 29 20 80 20  |tleFlags(wh%) . |
0000a050  31 3c 3c 30 29 0d 05 1b  05 3a 0d 05 1c 24 2a 7c  |1<<0)....:...$*||
0000a060  53 74 6f 70 20 46 4e 73  68 65 6c 6c 5f 57 69 6e  |Stop FNshell_Win|
0000a070  64 6f 77 54 69 74 6c 65  49 73 54 65 78 74 0d 05  |dowTitleIsText..|
0000a080  1d 29 2a 7c 53 74 61 72  74 20 46 4e 73 68 65 6c  |.)*|Start FNshel|
0000a090  6c 5f 57 69 6e 64 6f 77  54 69 74 6c 65 49 73 48  |l_WindowTitleIsH|
0000a0a0  43 65 6e 74 72 65 64 0d  05 1e 27 dd 20 a4 73 68  |Centred...'. .sh|
0000a0b0  65 6c 6c 5f 57 69 6e 64  6f 77 54 69 74 6c 65 49  |ell_WindowTitleI|
0000a0c0  73 48 43 65 6e 74 72 65  64 28 77 68 25 29 0d 05  |sHCentred(wh%)..|
0000a0d0  1f 2a 3d 28 a4 73 68 65  6c 6c 5f 57 69 6e 64 6f  |.*=(.shell_Windo|
0000a0e0  77 54 69 74 6c 65 46 6c  61 67 73 28 77 68 25 29  |wTitleFlags(wh%)|
0000a0f0  20 80 20 31 3c 3c 33 29  0d 05 20 05 3a 0d 05 21  | . 1<<3).. .:..!|
0000a100  28 2a 7c 53 74 6f 70 20  46 4e 73 68 65 6c 6c 5f  |(*|Stop FNshell_|
0000a110  57 69 6e 64 6f 77 54 69  74 6c 65 49 73 48 43 65  |WindowTitleIsHCe|
0000a120  6e 74 72 65 64 0d 05 22  29 2a 7c 53 74 61 72 74  |ntred..")*|Start|
0000a130  20 46 4e 73 68 65 6c 6c  5f 57 69 6e 64 6f 77 54  | FNshell_WindowT|
0000a140  69 74 6c 65 49 73 56 43  65 6e 74 72 65 64 0d 05  |itleIsVCentred..|
0000a150  23 27 dd 20 a4 73 68 65  6c 6c 5f 57 69 6e 64 6f  |#'. .shell_Windo|
0000a160  77 54 69 74 6c 65 49 73  56 43 65 6e 74 72 65 64  |wTitleIsVCentred|
0000a170  28 77 68 25 29 0d 05 24  2a 3d 28 a4 73 68 65 6c  |(wh%)..$*=(.shel|
0000a180  6c 5f 57 69 6e 64 6f 77  54 69 74 6c 65 46 6c 61  |l_WindowTitleFla|
0000a190  67 73 28 77 68 25 29 20  80 20 31 3c 3c 34 29 0d  |gs(wh%) . 1<<4).|
0000a1a0  05 25 05 3a 0d 05 26 28  2a 7c 53 74 6f 70 20 46  |.%.:..&(*|Stop F|
0000a1b0  4e 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 54 69 74  |Nshell_WindowTit|
0000a1c0  6c 65 49 73 56 43 65 6e  74 72 65 64 0d 05 27 27  |leIsVCentred..''|
0000a1d0  2a 7c 53 74 61 72 74 20  46 4e 73 68 65 6c 6c 5f  |*|Start FNshell_|
0000a1e0  57 69 6e 64 6f 77 54 69  74 6c 65 49 73 46 69 6c  |WindowTitleIsFil|
0000a1f0  6c 65 64 0d 05 28 25 dd  20 a4 73 68 65 6c 6c 5f  |led..(%. .shell_|
0000a200  57 69 6e 64 6f 77 54 69  74 6c 65 49 73 46 69 6c  |WindowTitleIsFil|
0000a210  6c 65 64 28 77 68 25 29  0d 05 29 2a 3d 28 a4 73  |led(wh%)..)*=(.s|
0000a220  68 65 6c 6c 5f 57 69 6e  64 6f 77 54 69 74 6c 65  |hell_WindowTitle|
0000a230  46 6c 61 67 73 28 77 68  25 29 20 80 20 31 3c 3c  |Flags(wh%) . 1<<|
0000a240  35 29 0d 05 2a 05 3a 0d  05 2b 26 2a 7c 53 74 6f  |5)..*.:..+&*|Sto|
0000a250  70 20 46 4e 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |p FNshell_Window|
0000a260  54 69 74 6c 65 49 73 46  69 6c 6c 65 64 0d 05 2c  |TitleIsFilled..,|
0000a270  29 2a 7c 53 74 61 72 74  20 46 4e 73 68 65 6c 6c  |)*|Start FNshell|
0000a280  5f 57 69 6e 64 6f 77 54  69 74 6c 65 49 73 41 41  |_WindowTitleIsAA|
0000a290  6c 69 61 73 65 64 0d 05  2d 27 dd 20 a4 73 68 65  |liased..-'. .she|
0000a2a0  6c 6c 5f 57 69 6e 64 6f  77 54 69 74 6c 65 49 73  |ll_WindowTitleIs|
0000a2b0  41 41 6c 69 61 73 65 64  28 77 68 25 29 0d 05 2e  |AAliased(wh%)...|
0000a2c0  2a 3d 28 a4 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |*=(.shell_Window|
0000a2d0  54 69 74 6c 65 46 6c 61  67 73 28 77 68 25 29 20  |TitleFlags(wh%) |
0000a2e0  80 20 31 3c 3c 36 29 0d  05 2f 05 3a 0d 05 30 28  |. 1<<6)../.:..0(|
0000a2f0  2a 7c 53 74 6f 70 20 46  4e 73 68 65 6c 6c 5f 57  |*|Stop FNshell_W|
0000a300  69 6e 64 6f 77 54 69 74  6c 65 49 73 41 41 6c 69  |indowTitleIsAAli|
0000a310  61 73 65 64 0d 05 31 2b  2a 7c 53 74 61 72 74 20  |ased..1+*|Start |
0000a320  46 4e 73 68 65 6c 6c 5f  57 69 6e 64 6f 77 54 69  |FNshell_WindowTi|
0000a330  74 6c 65 49 73 49 6e 64  69 72 65 63 74 65 64 0d  |tleIsIndirected.|
0000a340  05 32 29 dd 20 a4 73 68  65 6c 6c 5f 57 69 6e 64  |.2). .shell_Wind|
0000a350  6f 77 54 69 74 6c 65 49  73 49 6e 64 69 72 65 63  |owTitleIsIndirec|
0000a360  74 65 64 28 77 68 25 29  0d 05 33 2a 3d 28 a4 73  |ted(wh%)..3*=(.s|
0000a370  68 65 6c 6c 5f 57 69 6e  64 6f 77 54 69 74 6c 65  |hell_WindowTitle|
0000a380  46 6c 61 67 73 28 77 68  25 29 20 80 20 31 3c 3c  |Flags(wh%) . 1<<|
0000a390  38 29 0d 05 34 05 3a 0d  05 35 2a 2a 7c 53 74 6f  |8)..4.:..5**|Sto|
0000a3a0  70 20 46 4e 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |p FNshell_Window|
0000a3b0  54 69 74 6c 65 49 73 49  6e 64 69 72 65 63 74 65  |TitleIsIndirecte|
0000a3c0  64 0d 05 36 22 2a 7c 53  74 61 72 74 20 46 4e 73  |d..6"*|Start FNs|
0000a3d0  68 65 6c 6c 5f 57 69 6e  64 6f 77 47 65 74 54 69  |hell_WindowGetTi|
0000a3e0  74 6c 65 0d 05 37 20 dd  20 a4 73 68 65 6c 6c 5f  |tle..7 . .shell_|
0000a3f0  57 69 6e 64 6f 77 47 65  74 54 69 74 6c 65 28 77  |WindowGetTitle(w|
0000a400  68 25 29 0d 05 38 11 ea  20 74 69 74 6c 65 24 2c  |h%)..8.. title$,|
0000a410  62 6c 6b 25 0d 05 39 27  f4 20 43 68 65 63 6b 20  |blk%..9'. Check |
0000a420  69 66 20 77 69 6e 64 6f  77 20 68 61 73 20 61 20  |if window has a |
0000a430  74 69 74 6c 65 20 62 61  72 2e 2e 0d 05 3a 24 62  |title bar....:$b|
0000a440  6c 6b 25 3d a4 73 68 65  6c 6c 5f 48 65 61 70 42  |lk%=.shell_HeapB|
0000a450  6c 6f 63 6b 46 65 74 63  68 28 33 30 30 30 29 0d  |lockFetch(3000).|
0000a460  05 3b 0e 62 6c 6b 25 21  30 3d 77 68 25 0d 05 3c  |.;.blk%!0=wh%..<|
0000a470  21 c8 99 20 22 57 69 6d  70 5f 47 65 74 57 69 6e  |!.. "Wimp_GetWin|
0000a480  64 6f 77 49 6e 66 6f 22  2c 2c 62 6c 6b 25 0d 05  |dowInfo",,blk%..|
0000a490  3d 19 e7 20 28 62 6c 6b  25 21 33 32 20 80 20 31  |=.. (blk%!32 . 1|
0000a4a0  3c 3c 32 36 29 20 8c 0d  05 3e 1e 20 20 e7 20 28  |<<26) ...>.  . (|
0000a4b0  28 62 6c 6b 25 21 36 30  29 20 80 20 26 31 30 30  |(blk%!60) . &100|
0000a4c0  29 3d 30 20 8c 0d 05 3f  23 20 20 20 20 f4 20 54  |)=0 ...?#    . T|
0000a4d0  69 74 6c 65 20 69 73 20  6e 6f 74 20 69 6e 64 69  |itle is not indi|
0000a4e0  72 65 63 74 65 64 2e 2e  0d 05 40 19 20 20 20 20  |rected....@.    |
0000a4f0  74 69 74 6c 65 24 3d 24  28 62 6c 6b 25 2b 37 36  |title$=$(blk%+76|
0000a500  29 0d 05 41 07 20 20 cc  0d 05 42 1f 20 20 20 20  |)..A.  ...B.    |
0000a510  f4 20 54 69 74 6c 65 20  69 73 20 69 6e 64 69 72  |. Title is indir|
0000a520  65 63 74 65 64 2e 2e 0d  05 43 1c 20 20 20 20 74  |ected....C.    t|
0000a530  69 74 6c 65 24 3d 24 28  21 28 62 6c 6b 25 2b 37  |itle$=$(!(blk%+7|
0000a540  36 29 29 0d 05 44 07 20  20 cd 0d 05 45 05 cd 0d  |6))..D.  ...E...|
0000a550  05 46 20 f2 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |.F .shell_HeapBl|
0000a560  6f 63 6b 52 65 74 75 72  6e 28 62 6c 6b 25 29 0d  |ockReturn(blk%).|
0000a570  05 47 0b 3d 74 69 74 6c  65 24 0d 05 48 05 3a 0d  |.G.=title$..H.:.|
0000a580  05 49 21 2a 7c 53 74 6f  70 20 46 4e 73 68 65 6c  |.I!*|Stop FNshel|
0000a590  6c 5f 57 69 6e 64 6f 77  47 65 74 54 69 74 6c 65  |l_WindowGetTitle|
0000a5a0  0d 05 4a 2b 2a 7c 53 74  61 72 74 20 46 4e 73 68  |..J+*|Start FNsh|
0000a5b0  65 6c 6c 5f 57 69 6e 64  6f 77 54 69 74 6c 65 42  |ell_WindowTitleB|
0000a5c0  75 66 66 65 72 4c 65 6e  67 74 68 0d 05 4b 29 dd  |ufferLength..K).|
0000a5d0  20 a4 73 68 65 6c 6c 5f  57 69 6e 64 6f 77 54 69  | .shell_WindowTi|
0000a5e0  74 6c 65 42 75 66 66 65  72 4c 65 6e 67 74 68 28  |tleBufferLength(|
0000a5f0  77 68 25 29 0d 05 4c 12  ea 20 72 65 73 75 6c 74  |wh%)..L.. result|
0000a600  25 2c 62 6c 6b 25 0d 05  4d 24 62 6c 6b 25 3d a4  |%,blk%..M$blk%=.|
0000a610  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
0000a620  65 74 63 68 28 33 30 30  30 29 0d 05 4e 0e 62 6c  |etch(3000)..N.bl|
0000a630  6b 25 21 30 3d 77 68 25  0d 05 4f 21 c8 99 20 22  |k%!0=wh%..O!.. "|
0000a640  57 69 6d 70 5f 47 65 74  57 69 6e 64 6f 77 49 6e  |Wimp_GetWindowIn|
0000a650  66 6f 22 2c 2c 62 6c 6b  25 0d 05 50 1e 20 20 e7  |fo",,blk%..P.  .|
0000a660  20 28 28 62 6c 6b 25 21  36 30 29 20 80 20 26 31  | ((blk%!60) . &1|
0000a670  30 30 29 3d 30 20 8c 0d  05 51 12 20 20 20 20 72  |00)=0 ...Q.    r|
0000a680  65 73 75 6c 74 25 3d 31  32 0d 05 52 07 20 20 cc  |esult%=12..R.  .|
0000a690  0d 05 53 17 20 20 20 20  72 65 73 75 6c 74 25 3d  |..S.    result%=|
0000a6a0  62 6c 6b 25 21 38 34 0d  05 54 07 20 20 cd 0d 05  |blk%!84..T.  ...|
0000a6b0  55 20 f2 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |U .shell_HeapBlo|
0000a6c0  63 6b 52 65 74 75 72 6e  28 62 6c 6b 25 29 0d 05  |ckReturn(blk%)..|
0000a6d0  56 0c 3d 72 65 73 75 6c  74 25 0d 05 57 05 3a 0d  |V.=result%..W.:.|
0000a6e0  05 58 2a 2a 7c 53 74 6f  70 20 46 4e 73 68 65 6c  |.X**|Stop FNshel|
0000a6f0  6c 5f 57 69 6e 64 6f 77  54 69 74 6c 65 42 75 66  |l_WindowTitleBuf|
0000a700  66 65 72 4c 65 6e 67 74  68 0d 05 59 26 2a 7c 53  |ferLength..Y&*|S|
0000a710  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 57  |tart PROCshell_W|
0000a720  69 6e 64 6f 77 4d 6f 76  65 54 6f 49 63 6f 6e 0d  |indowMoveToIcon.|
0000a730  05 5a 39 dd 20 f2 73 68  65 6c 6c 5f 57 69 6e 64  |.Z9. .shell_Wind|
0000a740  6f 77 4d 6f 76 65 54 6f  49 63 6f 6e 28 77 68 25  |owMoveToIcon(wh%|
0000a750  2c 69 77 68 25 2c 69 68  25 2c 78 5f 6f 66 66 25  |,iwh%,ih%,x_off%|
0000a760  2c 79 5f 6f 66 66 25 29  0d 05 5b 0a ea 20 62 6c  |,y_off%)..[.. bl|
0000a770  6b 25 0d 05 5c 22 62 6c  6b 25 3d a4 73 68 65 6c  |k%..\"blk%=.shel|
0000a780  6c 5f 48 65 61 70 42 6c  6f 63 6b 46 65 74 63 68  |l_HeapBlockFetch|
0000a790  28 35 30 29 0d 05 5d 1a  62 6c 6b 25 21 30 3d 69  |(50)..].blk%!0=i|
0000a7a0  77 68 25 3a 62 6c 6b 25  21 34 3d 69 68 25 0d 05  |wh%:blk%!4=ih%..|
0000a7b0  5e 20 c8 99 20 22 57 69  6d 70 5f 47 65 74 49 63  |^ .. "Wimp_GetIc|
0000a7c0  6f 6e 53 74 61 74 65 22  2c 2c 62 6c 6b 25 0d 05  |onState",,blk%..|
0000a7d0  5f 39 f2 73 68 65 6c 6c  5f 57 69 6e 64 6f 77 4d  |_9.shell_WindowM|
0000a7e0  6f 76 65 54 6f 28 77 68  25 2c 62 6c 6b 25 21 38  |oveTo(wh%,blk%!8|
0000a7f0  2b 78 5f 6f 66 66 25 2c  62 6c 6b 25 21 32 30 2b  |+x_off%,blk%!20+|
0000a800  79 5f 6f 66 66 25 29 0d  05 60 20 f2 73 68 65 6c  |y_off%)..` .shel|
0000a810  6c 5f 48 65 61 70 42 6c  6f 63 6b 52 65 74 75 72  |l_HeapBlockRetur|
0000a820  6e 28 62 6c 6b 25 29 0d  05 61 05 e1 0d 05 62 05  |n(blk%)..a....b.|
0000a830  3a 0d 05 63 25 2a 7c 53  74 6f 70 20 50 52 4f 43  |:..c%*|Stop PROC|
0000a840  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 4d 6f 76 65  |shell_WindowMove|
0000a850  54 6f 49 63 6f 6e 0d 05  64 22 2a 7c 53 74 61 72  |ToIcon..d"*|Star|
0000a860  74 20 50 52 4f 43 73 68  65 6c 6c 5f 57 69 6e 64  |t PROCshell_Wind|
0000a870  6f 77 4d 6f 76 65 54 6f  0d 05 65 24 dd 20 f2 73  |owMoveTo..e$. .s|
0000a880  68 65 6c 6c 5f 57 69 6e  64 6f 77 4d 6f 76 65 54  |hell_WindowMoveT|
0000a890  6f 28 77 68 25 2c 78 25  2c 79 25 29 0d 05 66 29  |o(wh%,x%,y%)..f)|
0000a8a0  ea 20 77 69 6e 5f 77 69  64 74 68 25 2c 77 69 6e  |. win_width%,win|
0000a8b0  5f 68 65 69 67 68 74 25  2c 6f 66 66 73 65 74 25  |_height%,offset%|
0000a8c0  2c 62 6c 6b 25 0d 05 67  24 62 6c 6b 25 3d a4 73  |,blk%..g$blk%=.s|
0000a8d0  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 46 65  |hell_HeapBlockFe|
0000a8e0  74 63 68 28 33 30 30 30  29 0d 05 68 0e 62 6c 6b  |tch(3000)..h.blk|
0000a8f0  25 21 30 3d 77 68 25 0d  05 69 21 c8 99 20 22 57  |%!0=wh%..i!.. "W|
0000a900  69 6d 70 5f 47 65 74 57  69 6e 64 6f 77 49 6e 66  |imp_GetWindowInf|
0000a910  6f 22 2c 2c 62 6c 6b 25  0d 05 6a 1e 77 69 6e 5f  |o",,blk%..j.win_|
0000a920  77 69 64 74 68 25 20 3d  62 6c 6b 25 21 31 32 2d  |width% =blk%!12-|
0000a930  62 6c 6b 25 21 34 0d 05  6b 1e 77 69 6e 5f 68 65  |blk%!4..k.win_he|
0000a940  69 67 68 74 25 3d 62 6c  6b 25 21 31 36 2d 62 6c  |ight%=blk%!16-bl|
0000a950  6b 25 21 38 0d 05 6c 0d  62 6c 6b 25 21 34 3d 78  |k%!8..l.blk%!4=x|
0000a960  25 0d 05 6d 0d 62 6c 6b  25 21 38 3d 79 25 0d 05  |%..m.blk%!8=y%..|
0000a970  6e 19 62 6c 6b 25 21 31  32 3d 78 25 2b 77 69 6e  |n.blk%!12=x%+win|
0000a980  5f 77 69 64 74 68 25 0d  05 6f 1a 62 6c 6b 25 21  |_width%..o.blk%!|
0000a990  31 36 3d 79 25 2b 77 69  6e 5f 68 65 69 67 68 74  |16=y%+win_height|
0000a9a0  25 0d 05 70 3b f4 20 74  68 69 73 20 6c 6f 6f 6b  |%..p;. this look|
0000a9b0  73 20 72 65 61 6c 6c 79  20 73 69 6c 6c 79 2c 20  |s really silly, |
0000a9c0  62 75 74 20 69 73 20 6e  65 63 65 73 73 61 72 79  |but is necessary|
0000a9d0  20 74 6f 20 74 65 6c 6c  20 74 68 65 0d 05 71 40  | to tell the..q@|
0000a9e0  f4 20 77 69 6e 64 6f 77  20 6d 61 6e 61 67 65 72  |. window manager|
0000a9f0  20 74 68 65 20 6e 65 77  20 77 69 6e 64 6f 77 20  | the new window |
0000aa00  63 6f 6f 72 64 73 2e 20  54 68 65 20 73 68 65 6c  |coords. The shel|
0000aa10  6c 5f 4f 70 65 6e 57 69  6e 64 6f 77 0d 05 72 3d  |l_OpenWindow..r=|
0000aa20  f4 20 63 61 6c 6c 20 73  65 74 73 20 75 70 20 61  |. call sets up a|
0000aa30  6e 79 20 70 61 6e 65 73  20 61 6e 64 20 61 63 74  |ny panes and act|
0000aa40  75 61 6c 6c 79 20 6f 70  65 6e 73 20 74 68 65 20  |ually opens the |
0000aa50  77 69 6e 64 6f 77 20 69  6e 0d 05 73 16 f4 20 74  |window in..s.. t|
0000aa60  68 65 20 6e 65 77 20 70  6f 73 69 74 69 6f 6e 0d  |he new position.|
0000aa70  05 74 1e c8 99 20 22 57  69 6d 70 5f 4f 70 65 6e  |.t... "Wimp_Open|
0000aa80  57 69 6e 64 6f 77 22 2c  2c 62 6c 6b 25 0d 05 75  |Window",,blk%..u|
0000aa90  1f c8 99 20 22 57 69 6d  70 5f 43 6c 6f 73 65 57  |... "Wimp_CloseW|
0000aaa0  69 6e 64 6f 77 22 2c 2c  62 6c 6b 25 0d 05 76 2c  |indow",,blk%..v,|
0000aab0  6f 66 66 73 65 74 25 3d  a4 73 68 65 6c 6c 5f 53  |offset%=.shell_S|
0000aac0  65 61 72 63 68 53 74 61  74 69 63 28 5f 55 25 21  |earchStatic(_U%!|
0000aad0  31 38 34 2c 77 68 25 29  0d 05 77 12 e7 20 6f 66  |184,wh%)..w.. of|
0000aae0  66 73 65 74 25 3e 2d 31  20 8c 0d 05 78 22 20 20  |fset%>-1 ...x"  |
0000aaf0  f2 73 68 65 6c 6c 5f 4f  70 65 6e 57 69 6e 64 6f  |.shell_OpenWindo|
0000ab00  77 53 74 61 74 69 63 28  77 68 25 29 0d 05 79 05  |wStatic(wh%)..y.|
0000ab10  cc 0d 05 7a 27 20 20 f2  73 68 65 6c 6c 5f 4f 70  |...z'  .shell_Op|
0000ab20  65 6e 57 69 6e 64 6f 77  44 79 6e 61 6d 69 63 28  |enWindowDynamic(|
0000ab30  77 68 25 2c 30 2c 30 29  0d 05 7b 05 cd 0d 05 7c  |wh%,0,0)..{....||
0000ab40  20 f2 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
0000ab50  6b 52 65 74 75 72 6e 28  62 6c 6b 25 29 0d 05 7d  |kReturn(blk%)..}|
0000ab60  05 e1 0d 05 7e 05 3a 0d  05 7f 21 2a 7c 53 74 6f  |....~.:...!*|Sto|
0000ab70  70 20 50 52 4f 43 73 68  65 6c 6c 5f 57 69 6e 64  |p PROCshell_Wind|
0000ab80  6f 77 4d 6f 76 65 54 6f  0d 05 80 26 2a 7c 53 74  |owMoveTo...&*|St|
0000ab90  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 57 69  |art PROCshell_Wi|
0000aba0  6e 64 6f 77 42 72 69 6e  67 54 6f 54 6f 70 0d 05  |ndowBringToTop..|
0000abb0  81 22 dd 20 f2 73 68 65  6c 6c 5f 57 69 6e 64 6f  |.". .shell_Windo|
0000abc0  77 42 72 69 6e 67 54 6f  54 6f 70 28 77 68 25 29  |wBringToTop(wh%)|
0000abd0  0d 05 82 0a ea 20 6d 73  67 25 0d 05 83 23 6d 73  |..... msg%...#ms|
0000abe0  67 25 3d a4 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |g%=.shell_HeapBl|
0000abf0  6f 63 6b 46 65 74 63 68  28 32 35 36 29 0d 05 84  |ockFetch(256)...|
0000ac00  0e 6d 73 67 25 21 30 3d  77 68 25 0d 05 85 22 c8  |.msg%!0=wh%...".|
0000ac10  99 20 22 57 69 6d 70 5f  47 65 74 57 69 6e 64 6f  |. "Wimp_GetWindo|
0000ac20  77 53 74 61 74 65 22 2c  2c 6d 73 67 25 0d 05 86  |wState",,msg%...|
0000ac30  0e 6d 73 67 25 21 32 38  3d 2d 31 0d 05 87 24 c8  |.msg%!28=-1...$.|
0000ac40  99 20 22 57 69 6d 70 5f  53 65 6e 64 4d 65 73 73  |. "Wimp_SendMess|
0000ac50  61 67 65 22 2c 32 2c 6d  73 67 25 2c 77 68 25 0d  |age",2,msg%,wh%.|
0000ac60  05 88 33 f4 20 6e 6f 77  20 63 61 6c 6c 20 77 69  |..3. now call wi|
0000ac70  6d 70 20 70 6f 6c 6c 20  61 73 20 74 68 69 73 20  |mp poll as this |
0000ac80  61 63 74 69 6f 6e 20 6d  75 73 74 20 68 61 70 70  |action must happ|
0000ac90  65 6e 0d 05 89 2b f4 20  77 69 74 68 6f 75 74 20  |en...+. without |
0000aca0  77 61 69 74 69 6e 67 20  66 6f 72 20 6e 65 78 74  |waiting for next|
0000acb0  20 77 69 6d 70 20 70 6f  6c 6c 2e 2e 2e 0d 05 8a  | wimp poll......|
0000acc0  19 c8 99 20 22 57 69 6d  70 5f 50 6f 6c 6c 22 2c  |... "Wimp_Poll",|
0000acd0  30 2c 6d 73 67 25 0d 05  8b 20 f2 73 68 65 6c 6c  |0,msg%... .shell|
0000ace0  5f 48 65 61 70 42 6c 6f  63 6b 52 65 74 75 72 6e  |_HeapBlockReturn|
0000acf0  28 6d 73 67 25 29 0d 05  8c 05 e1 0d 05 8d 05 3a  |(msg%).........:|
0000ad00  0d 05 8e 25 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |...%*|Stop PROCs|
0000ad10  68 65 6c 6c 5f 57 69 6e  64 6f 77 42 72 69 6e 67  |hell_WindowBring|
0000ad20  54 6f 54 6f 70 0d 05 8f  22 2a 7c 53 74 61 72 74  |ToTop..."*|Start|
0000ad30  20 50 52 4f 43 73 68 65  6c 6c 5f 55 70 64 61 74  | PROCshell_Updat|
0000ad40  65 57 69 6e 64 6f 77 0d  05 90 2e dd 20 f2 73 68  |eWindow..... .sh|
0000ad50  65 6c 6c 5f 55 70 64 61  74 65 57 69 6e 64 6f 77  |ell_UpdateWindow|
0000ad60  28 68 61 6e 64 6c 65 25  2c 6c 25 2c 62 25 2c 72  |(handle%,l%,b%,r|
0000ad70  25 2c 74 25 29 0d 05 91  0a ea 20 62 6c 6b 25 0d  |%,t%)..... blk%.|
0000ad80  05 92 24 62 6c 6b 25 3d  a4 73 68 65 6c 6c 5f 48  |..$blk%=.shell_H|
0000ad90  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 62 6c  |eapBlockFetch(bl|
0000ada0  6b 25 29 0d 05 93 3c 62  6c 6b 25 21 30 3d 68 61  |k%)...<blk%!0=ha|
0000adb0  6e 64 6c 65 25 3a 62 6c  6b 25 21 34 3d 6c 25 3a  |ndle%:blk%!4=l%:|
0000adc0  62 6c 6b 25 21 38 3d 62  25 3a 62 6c 6b 25 21 31  |blk%!8=b%:blk%!1|
0000add0  32 3d 72 25 3a 62 6c 6b  25 21 31 36 3d 74 25 0d  |2=r%:blk%!16=t%.|
0000ade0  05 94 28 c8 99 20 22 57  69 6d 70 5f 55 70 64 61  |..(.. "Wimp_Upda|
0000adf0  74 65 57 69 6e 64 6f 77  22 2c 2c 62 6c 6b 25 20  |teWindow",,blk% |
0000ae00  b8 20 6d 6f 72 65 25 0d  05 95 22 c8 99 20 22 57  |. more%...".. "W|
0000ae10  69 6d 70 5f 47 65 74 57  69 6e 64 6f 77 53 74 61  |imp_GetWindowSta|
0000ae20  74 65 22 2c 2c 62 6c 6b  25 0d 05 96 20 f2 73 68  |te",,blk%... .sh|
0000ae30  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 52 65 74  |ell_HeapBlockRet|
0000ae40  75 72 6e 28 62 6c 6b 25  29 0d 05 97 05 e1 0d 05  |urn(blk%).......|
0000ae50  98 05 3a 0d 05 99 21 2a  7c 53 74 6f 70 20 50 52  |..:...!*|Stop PR|
0000ae60  4f 43 73 68 65 6c 6c 5f  55 70 64 61 74 65 57 69  |OCshell_UpdateWi|
0000ae70  6e 64 6f 77 0d 05 9a 27  2a 7c 53 74 61 72 74 20  |ndow...'*|Start |
0000ae80  50 52 4f 43 73 68 65 6c  6c 5f 4f 70 65 6e 57 69  |PROCshell_OpenWi|
0000ae90  6e 64 6f 77 44 79 6e 61  6d 69 63 0d 05 9b 31 dd  |ndowDynamic...1.|
0000aea0  20 f2 73 68 65 6c 6c 5f  4f 70 65 6e 57 69 6e 64  | .shell_OpenWind|
0000aeb0  6f 77 44 79 6e 61 6d 69  63 28 77 68 25 2c 78 5f  |owDynamic(wh%,x_|
0000aec0  6f 66 66 25 2c 79 5f 6f  66 66 25 29 0d 05 9c 14  |off%,y_off%)....|
0000aed0  ea 20 76 6f 69 64 25 2c  70 74 72 5f 62 6c 6b 25  |. void%,ptr_blk%|
0000aee0  0d 05 9d 26 70 74 72 5f  62 6c 6b 25 3d a4 73 68  |...&ptr_blk%=.sh|
0000aef0  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
0000af00  63 68 28 32 30 29 0d 05  9e 0e 5f 55 25 21 32 30  |ch(20)...._U%!20|
0000af10  3d 77 68 25 0d 05 9f 26  c8 99 20 22 57 69 6d 70  |=wh%...&.. "Wimp|
0000af20  5f 47 65 74 50 6f 69 6e  74 65 72 49 6e 66 6f 22  |_GetPointerInfo"|
0000af30  2c 2c 70 74 72 5f 62 6c  6b 25 0d 05 a0 41 c8 99  |,,ptr_blk%...A..|
0000af40  20 22 57 69 6d 70 5f 43  72 65 61 74 65 4d 65 6e  | "Wimp_CreateMen|
0000af50  75 22 2c 2c 77 68 25 2c  70 74 72 5f 62 6c 6b 25  |u",,wh%,ptr_blk%|
0000af60  21 30 2b 78 5f 6f 66 66  25 2c 70 74 72 5f 62 6c  |!0+x_off%,ptr_bl|
0000af70  6b 25 21 34 2b 79 5f 6f  66 66 25 0d 05 a1 24 f2  |k%!4+y_off%...$.|
0000af80  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 52  |shell_HeapBlockR|
0000af90  65 74 75 72 6e 28 70 74  72 5f 62 6c 6b 25 29 0d  |eturn(ptr_blk%).|
0000afa0  05 a2 05 e1 0d 05 a3 05  3a 0d 05 a4 26 2a 7c 53  |........:...&*|S|
0000afb0  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 4f 70  |top PROCshell_Op|
0000afc0  65 6e 57 69 6e 64 6f 77  44 79 6e 61 6d 69 63 0d  |enWindowDynamic.|
0000afd0  05 a5 21 2a 7c 53 74 61  72 74 20 46 4e 73 68 65  |..!*|Start FNshe|
0000afe0  6c 6c 5f 43 6c 61 69 6d  4b 65 79 70 72 65 73 73  |ll_ClaimKeypress|
0000aff0  0d 05 a6 1a dd 20 a4 73  68 65 6c 6c 5f 43 6c 61  |..... .shell_Cla|
0000b000  69 6d 4b 65 79 70 72 65  73 73 0d 05 a7 43 f4 20  |imKeypress...C. |
0000b010  42 6f 64 67 65 20 74 6f  20 65 6e 73 75 72 65 20  |Bodge to ensure |
0000b020  74 68 61 74 20 73 68 65  6c 6c 5f 4f 70 65 6e 57  |that shell_OpenW|
0000b030  69 6e 64 6f 77 44 79 6e  61 6d 69 63 20 77 6f 72  |indowDynamic wor|
0000b040  6b 73 20 70 72 6f 70 65  72 6c 79 2e 2e 0d 05 a8  |ks properly.....|
0000b050  11 e7 20 5f 55 25 21 32  30 3c 3e 30 20 8c 0d 05  |.. _U%!20<>0 ...|
0000b060  a9 1e 20 20 c8 99 20 22  57 69 6d 70 5f 43 72 65  |..  .. "Wimp_Cre|
0000b070  61 74 65 4d 65 6e 75 22  2c 2c 2d 31 0d 05 aa 27  |ateMenu",,-1...'|
0000b080  20 20 76 6f 69 64 25 3d  a4 73 68 65 6c 6c 5f 44  |  void%=.shell_D|
0000b090  65 6c 65 74 65 57 69 6e  64 6f 77 28 5f 55 25 21  |eleteWindow(_U%!|
0000b0a0  32 30 29 0d 05 ab 0e 20  20 5f 55 25 21 32 30 3d  |20)....  _U%!20=|
0000b0b0  30 0d 05 ac 05 cd 0d 05  ad 06 3d b9 0d 05 ae 05  |0.........=.....|
0000b0c0  3a 0d 05 af 20 2a 7c 53  74 6f 70 20 46 4e 73 68  |:... *|Stop FNsh|
0000b0d0  65 6c 6c 5f 43 6c 61 69  6d 4b 65 79 70 72 65 73  |ell_ClaimKeypres|
0000b0e0  73 0d 05 b0 04 0d 05 b1  20 2a 7c 53 74 61 72 74  |s....... *|Start|
0000b0f0  20 50 52 4f 43 73 68 65  6c 6c 5f 4f 70 65 6e 57  | PROCshell_OpenW|
0000b100  69 6e 64 6f 77 0d 05 b2  29 dd 20 f2 73 68 65 6c  |indow...). .shel|
0000b110  6c 5f 4f 70 65 6e 57 69  6e 64 6f 77 28 77 68 25  |l_OpenWindow(wh%|
0000b120  2c 66 75 6c 6c 25 2c 66  72 6f 6e 74 25 29 0d 05  |,full%,front%)..|
0000b130  b3 43 ea 20 6f 66 66 73  65 74 25 2c 62 6c 6b 25  |.C. offset%,blk%|
0000b140  2c 70 61 6e 65 62 6c 6b  25 2c 63 74 72 25 2c 66  |,paneblk%,ctr%,f|
0000b150  69 72 73 74 5f 70 61 6e  65 25 2c 62 65 68 69 6e  |irst_pane%,behin|
0000b160  64 25 2c 68 65 69 67 68  74 25 2c 77 69 64 74 68  |d%,height%,width|
0000b170  25 0d 05 b4 31 ea 20 66  6c 61 67 25 2c 74 6f 67  |%...1. flag%,tog|
0000b180  67 6c 65 25 2c 74 25 2c  6c 61 73 74 5f 70 61 6e  |gle%,t%,last_pan|
0000b190  65 25 2c 70 72 65 76 5f  70 61 6e 65 25 2c 72 65  |e%,prev_pane%,re|
0000b1a0  73 25 0d 05 b5 3a 6f 66  66 73 65 74 25 3d a4 73  |s%...:offset%=.s|
0000b1b0  68 65 6c 6c 5f 47 65 74  45 76 65 6e 74 4c 69 73  |hell_GetEventLis|
0000b1c0  74 4f 66 66 73 65 74 28  77 68 25 2c 2d 31 2c 5f  |tOffset(wh%,-1,_|
0000b1d0  55 25 2b 33 30 34 2c 31  32 2c a3 29 0d 05 b6 12  |U%+304,12,.)....|
0000b1e0  e7 20 6f 66 66 73 65 74  25 3e 3d 30 20 8c 0d 05  |. offset%>=0 ...|
0000b1f0  b7 1a 20 20 62 6c 6b 25  3d 5f 55 25 21 33 30 34  |..  blk%=_U%!304|
0000b200  2b 6f 66 66 73 65 74 25  0d 05 b8 12 20 20 74 65  |+offset%....  te|
0000b210  6d 70 25 3d 62 6c 6b 25  21 38 0d 05 b9 18 20 20  |mp%=blk%!8....  |
0000b220  2a 7c 69 66 64 65 66 20  54 72 61 63 65 5f 49 6e  |*|ifdef Trace_In|
0000b230  69 74 0d 05 ba 3d 20 20  f2 73 68 65 6c 6c 5f 54  |it...=  .shell_T|
0000b240  72 61 63 65 66 30 28 22  4f 70 65 6e 57 69 6e 64  |racef0("OpenWind|
0000b250  6f 77 3a 41 62 6f 75 74  20 74 6f 20 63 61 6c 6c  |ow:About to call|
0000b260  20 22 2b 22 46 4e 22 2b  24 74 65 6d 70 25 29 0d  | "+"FN"+$temp%).|
0000b270  05 bb 0d 20 20 2a 7c 65  6e 64 69 66 0d 05 bc 19  |...  *|endif....|
0000b280  20 20 72 65 73 25 3d a0  28 22 46 4e 22 2b 24 74  |  res%=.("FN"+$t|
0000b290  65 6d 70 25 29 0d 05 bd  12 20 20 e7 20 72 65 73  |emp%)....  . res|
0000b2a0  25 3d 30 20 8c 20 e1 0d  05 be 05 cd 0d 05 bf 0d  |%=0 . ..........|
0000b2b0  74 6f 67 67 6c 65 25 3d  a3 0d 05 c0 2c 20 20 74  |toggle%=....,  t|
0000b2c0  25 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |%=.shell_HeapBlo|
0000b2d0  63 6b 46 65 74 63 68 28  31 30 30 29 3a 74 25 21  |ckFetch(100):t%!|
0000b2e0  30 3d 77 68 25 0d 05 c1  22 20 20 c8 99 20 22 57  |0=wh%..."  .. "W|
0000b2f0  69 6d 70 5f 47 65 74 57  69 6e 64 6f 77 53 74 61  |imp_GetWindowSta|
0000b300  74 65 22 2c 2c 74 25 0d  05 c2 37 20 20 e7 20 28  |te",,t%...7  . (|
0000b310  74 25 21 33 32 20 80 20  26 38 30 30 30 30 29 3d  |t%!32 . &80000)=|
0000b320  26 38 30 30 30 30 20 8c  20 74 6f 67 67 6c 65 25  |&80000 . toggle%|
0000b330  3d b9 20 8b 20 74 6f 67  67 6c 65 25 3d a3 0d 05  |=. . toggle%=...|
0000b340  c3 20 20 20 f2 73 68 65  6c 6c 5f 48 65 61 70 42  |.   .shell_HeapB|
0000b350  6c 6f 63 6b 52 65 74 75  72 6e 28 74 25 29 0d 05  |lockReturn(t%)..|
0000b360  c4 0f 20 20 5f 51 25 21  30 3d 77 68 25 0d 05 c5  |..  _Q%!0=wh%...|
0000b370  2f 20 20 e7 20 ac 20 66  75 6c 6c 25 20 8c 20 c8  |/  . . full% . .|
0000b380  99 20 22 57 69 6d 70 5f  47 65 74 57 69 6e 64 6f  |. "Wimp_GetWindo|
0000b390  77 53 74 61 74 65 22 2c  2c 5f 51 25 0d 05 c6 11  |wState",,_Q%....|
0000b3a0  20 20 e7 20 74 6f 67 67  6c 65 25 20 8c 0d 05 c7  |  . toggle% ....|
0000b3b0  21 20 20 20 20 c8 99 20  22 57 69 6d 70 5f 4f 70  |!    .. "Wimp_Op|
0000b3c0  65 6e 57 69 6e 64 6f 77  22 2c 2c 5f 51 25 0d 05  |enWindow",,_Q%..|
0000b3d0  c8 07 20 20 cd 0d 05 c9  39 6f 66 66 73 65 74 25  |..  ....9offset%|
0000b3e0  3d a4 73 68 65 6c 6c 5f  47 65 74 45 76 65 6e 74  |=.shell_GetEvent|
0000b3f0  4c 69 73 74 4f 66 66 73  65 74 28 77 68 25 2c 2d  |ListOffset(wh%,-|
0000b400  31 2c 5f 55 25 2b 39 32  2c 32 34 2c a3 29 0d 05  |1,_U%+92,24,.)..|
0000b410  ca 12 e7 20 6f 66 66 73  65 74 25 3e 2d 31 20 8c  |... offset%>-1 .|
0000b420  0d 05 cb 1b 20 20 62 6c  6b 25 3d 28 5f 55 25 21  |....  blk%=(_U%!|
0000b430  39 32 29 2b 6f 66 66 73  65 74 25 0d 05 cc 20 20  |92)+offset%...  |
0000b440  20 f4 20 70 61 6e 65 20  68 61 6e 64 6c 65 72 20  | . pane handler |
0000b450  65 76 65 6e 74 20 66 6f  75 6e 64 0d 05 cd 3f 20  |event found...? |
0000b460  20 70 74 72 38 25 3d 62  6c 6b 25 21 38 3a 70 74  | ptr8%=blk%!8:pt|
0000b470  72 31 32 25 3d 62 6c 6b  25 21 31 32 3a 70 74 72  |r12%=blk%!12:ptr|
0000b480  31 36 25 3d 62 6c 6b 25  21 31 36 3a 70 74 72 32  |16%=blk%!16:ptr2|
0000b490  30 25 3d 62 6c 6b 25 21  32 30 0d 05 ce 0f 20 20  |0%=blk%!20....  |
0000b4a0  5f 51 25 21 30 3d 77 68  25 0d 05 cf 2c 20 20 e7  |_Q%!0=wh%...,  .|
0000b4b0  20 66 72 6f 6e 74 25 20  8c 20 62 65 68 69 6e 64  | front% . behind|
0000b4c0  25 3d 2d 31 20 8b 20 62  65 68 69 6e 64 25 3d 5f  |%=-1 . behind%=_|
0000b4d0  51 25 21 32 38 0d 05 d0  11 20 20 e7 20 ac 20 66  |Q%!28....  . . f|
0000b4e0  75 6c 6c 25 20 8c 0d 05  d1 25 20 20 20 20 c8 99  |ull% ....%    ..|
0000b4f0  20 22 57 69 6d 70 5f 47  65 74 57 69 6e 64 6f 77  | "Wimp_GetWindow|
0000b500  53 74 61 74 65 22 2c 2c  5f 51 25 0d 05 d2 07 20  |State",,_Q%.... |
0000b510  20 cd 0d 05 d3 34 20 20  f4 20 72 65 73 65 72 76  | ....4  . reserv|
0000b520  65 20 31 6b 20 61 73 20  62 75 66 66 65 72 20 2d  |e 1k as buffer -|
0000b530  20 68 6f 70 65 20 69 74  27 73 20 65 6e 6f 75 67  | hope it's enoug|
0000b540  68 2e 2e 2e 2e 2e 0d 05  d4 2a 20 20 70 61 6e 65  |h........*  pane|
0000b550  62 6c 6b 25 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |blk%=.shell_Heap|
0000b560  42 6c 6f 63 6b 46 65 74  63 68 28 31 30 32 34 29  |BlockFetch(1024)|
0000b570  0d 05 d5 0c 20 20 63 74  72 25 3d 30 0d 05 d6 17  |....  ctr%=0....|
0000b580  20 20 c8 95 20 70 74 72  38 25 21 63 74 72 25 3c  |  .. ptr8%!ctr%<|
0000b590  3e 2d 31 0d 05 d7 30 20  20 20 20 70 61 6e 65 62  |>-1...0    paneb|
0000b5a0  6c 6b 25 21 30 3d 70 74  72 38 25 21 63 74 72 25  |lk%!0=ptr8%!ctr%|
0000b5b0  3a f4 20 68 61 6e 64 6c  65 20 6f 66 20 27 70 61  |:. handle of 'pa|
0000b5c0  6e 65 27 0d 05 d8 30 20  20 20 20 e7 20 66 69 72  |ne'...0    . fir|
0000b5d0  73 74 5f 70 61 6e 65 25  3d 30 20 8c 20 66 69 72  |st_pane%=0 . fir|
0000b5e0  73 74 5f 70 61 6e 65 25  3d 70 61 6e 65 62 6c 6b  |st_pane%=paneblk|
0000b5f0  25 21 30 0d 05 d9 1d 20  20 20 20 6c 61 73 74 5f  |%!0....    last_|
0000b600  70 61 6e 65 25 3d 70 61  6e 65 62 6c 6b 25 21 30  |pane%=paneblk%!0|
0000b610  0d 05 da 2a 20 20 20 20  c8 99 20 22 57 69 6d 70  |...*    .. "Wimp|
0000b620  5f 47 65 74 57 69 6e 64  6f 77 53 74 61 74 65 22  |_GetWindowState"|
0000b630  2c 2c 70 61 6e 65 62 6c  6b 25 0d 05 db 30 20 20  |,,paneblk%...0  |
0000b640  20 20 f4 20 43 68 65 63  6b 20 66 6c 61 67 20 77  |  . Check flag w|
0000b650  6f 72 64 20 69 6e 20 70  61 6e 65 20 65 76 65 6e  |ord in pane even|
0000b660  74 20 62 6c 6f 63 6b 2e  2e 2e 0d 05 dc 19 20 20  |t block.......  |
0000b670  20 20 66 6c 61 67 25 3d  70 74 72 31 32 25 21 63  |  flag%=ptr12%!c|
0000b680  74 72 25 0d 05 dd 12 20  20 20 20 c8 8e 20 66 6c  |tr%....    .. fl|
0000b690  61 67 25 20 ca 0d 05 de  0d 20 20 20 20 c9 20 30  |ag% .....    . 0|
0000b6a0  2c 31 0d 05 df 28 20 20  20 20 20 20 68 65 69 67  |,1...(      heig|
0000b6b0  68 74 25 3d 70 61 6e 65  62 6c 6b 25 21 31 36 2d  |ht%=paneblk%!16-|
0000b6c0  70 61 6e 65 62 6c 6b 25  21 38 0d 05 e0 27 20 20  |paneblk%!8...'  |
0000b6d0  20 20 20 20 77 69 64 74  68 25 3d 70 61 6e 65 62  |    width%=paneb|
0000b6e0  6c 6b 25 21 31 32 2d 70  61 6e 65 62 6c 6b 25 21  |lk%!12-paneblk%!|
0000b6f0  34 0d 05 e1 26 20 20 20  20 20 20 70 61 6e 65 62  |4...&      paneb|
0000b700  6c 6b 25 21 34 3d 5f 51  25 21 34 2b 70 74 72 31  |lk%!4=_Q%!4+ptr1|
0000b710  36 25 21 63 74 72 25 0d  05 e2 27 20 20 20 20 20  |6%!ctr%...'     |
0000b720  20 70 61 6e 65 62 6c 6b  25 21 31 32 3d 70 61 6e  | paneblk%!12=pan|
0000b730  65 62 6c 6b 25 21 34 2b  77 69 64 74 68 25 0d 05  |eblk%!4+width%..|
0000b740  e3 28 20 20 20 20 20 20  70 61 6e 65 62 6c 6b 25  |.(      paneblk%|
0000b750  21 31 36 3d 5f 51 25 21  31 36 2b 70 74 72 32 30  |!16=_Q%!16+ptr20|
0000b760  25 21 63 74 72 25 0d 05  e4 28 20 20 20 20 20 20  |%!ctr%...(      |
0000b770  70 61 6e 65 62 6c 6b 25  21 38 3d 70 61 6e 65 62  |paneblk%!8=paneb|
0000b780  6c 6b 25 21 31 36 2d 68  65 69 67 68 74 25 0d 05  |lk%!16-height%..|
0000b790  e5 0b 20 20 20 20 c9 20  32 0d 05 e6 25 20 20 20  |..    . 2...%   |
0000b7a0  20 20 20 f4 20 41 74 74  61 63 68 65 64 20 74 6f  |   . Attached to|
0000b7b0  20 74 6f 70 20 65 64 67  65 2e 2e 2e 2e 2e 0d 05  | top edge.......|
0000b7c0  e7 28 20 20 20 20 20 20  68 65 69 67 68 74 25 3d  |.(      height%=|
0000b7d0  70 61 6e 65 62 6c 6b 25  21 31 36 2d 70 61 6e 65  |paneblk%!16-pane|
0000b7e0  62 6c 6b 25 21 38 0d 05  e8 1d 20 20 20 20 20 20  |blk%!8....      |
0000b7f0  77 69 64 74 68 25 3d 5f  51 25 21 31 32 2d 5f 51  |width%=_Q%!12-_Q|
0000b800  25 21 34 0d 05 e9 26 20  20 20 20 20 20 70 61 6e  |%!4...&      pan|
0000b810  65 62 6c 6b 25 21 34 3d  5f 51 25 21 34 2b 70 74  |eblk%!4=_Q%!4+pt|
0000b820  72 31 36 25 21 63 74 72  25 0d 05 ea 1c 20 20 20  |r16%!ctr%....   |
0000b830  20 20 20 70 61 6e 65 62  6c 6b 25 21 31 32 3d 5f  |   paneblk%!12=_|
0000b840  51 25 21 31 32 0d 05 eb  28 20 20 20 20 20 20 70  |Q%!12...(      p|
0000b850  61 6e 65 62 6c 6b 25 21  31 36 3d 5f 51 25 21 31  |aneblk%!16=_Q%!1|
0000b860  36 2b 70 74 72 32 30 25  21 63 74 72 25 0d 05 ec  |6+ptr20%!ctr%...|
0000b870  28 20 20 20 20 20 20 70  61 6e 65 62 6c 6b 25 21  |(      paneblk%!|
0000b880  38 3d 70 61 6e 65 62 6c  6b 25 21 31 36 2d 68 65  |8=paneblk%!16-he|
0000b890  69 67 68 74 25 0d 05 ed  0b 20 20 20 20 c9 20 33  |ight%....    . 3|
0000b8a0  0d 05 ee 24 20 20 20 20  20 20 f4 20 41 74 74 61  |...$      . Atta|
0000b8b0  63 68 65 64 20 74 6f 20  6c 65 66 74 20 65 64 67  |ched to left edg|
0000b8c0  65 2e 2e 2e 0d 05 ef 1e  20 20 20 20 20 20 68 65  |e.......      he|
0000b8d0  69 67 68 74 25 3d 5f 51  25 21 31 36 2d 5f 51 25  |ight%=_Q%!16-_Q%|
0000b8e0  21 38 0d 05 f0 27 20 20  20 20 20 20 77 69 64 74  |!8...'      widt|
0000b8f0  68 25 3d 70 61 6e 65 62  6c 6b 25 21 31 32 2d 70  |h%=paneblk%!12-p|
0000b900  61 6e 65 62 6c 6b 25 21  34 0d 05 f1 26 20 20 20  |aneblk%!4...&   |
0000b910  20 20 20 70 61 6e 65 62  6c 6b 25 21 34 3d 5f 51  |   paneblk%!4=_Q|
0000b920  25 21 34 2b 70 74 72 31  36 25 21 63 74 72 25 0d  |%!4+ptr16%!ctr%.|
0000b930  05 f2 27 20 20 20 20 20  20 70 61 6e 65 62 6c 6b  |..'      paneblk|
0000b940  25 21 31 32 3d 70 61 6e  65 62 6c 6b 25 21 34 2b  |%!12=paneblk%!4+|
0000b950  77 69 64 74 68 25 0d 05  f3 31 20 20 20 20 20 20  |width%...1      |
0000b960  70 61 6e 65 62 6c 6b 25  21 31 36 3d 5f 51 25 21  |paneblk%!16=_Q%!|
0000b970  31 36 20 20 20 20 20 20  20 20 20 20 20 20 20 3a  |16             :|
0000b980  f4 20 6d 69 6e 20 79 0d  05 f4 31 20 20 20 20 20  |. min y...1     |
0000b990  20 70 61 6e 65 62 6c 6b  25 21 38 3d 5f 51 25 21  | paneblk%!8=_Q%!|
0000b9a0  38 2b 70 74 72 32 30 25  21 63 74 72 25 20 20 20  |8+ptr20%!ctr%   |
0000b9b0  3a f4 20 6d 61 78 20 79  0d 05 f5 0b 20 20 20 20  |:. max y....    |
0000b9c0  c9 20 34 0d 05 f6 26 20  20 20 20 20 20 f4 20 41  |. 4...&      . A|
0000b9d0  74 74 61 63 68 65 64 20  74 6f 20 62 6f 74 74 6f  |ttached to botto|
0000b9e0  6d 20 65 64 67 65 2e 2e  2e 0d 05 f7 28 20 20 20  |m edge......(   |
0000b9f0  20 20 20 68 65 69 67 68  74 25 3d 70 61 6e 65 62  |   height%=paneb|
0000ba00  6c 6b 25 21 31 36 2d 70  61 6e 65 62 6c 6b 25 21  |lk%!16-paneblk%!|
0000ba10  38 0d 05 f8 1d 20 20 20  20 20 20 77 69 64 74 68  |8....      width|
0000ba20  25 3d 5f 51 25 21 31 32  2d 5f 51 25 21 34 0d 05  |%=_Q%!12-_Q%!4..|
0000ba30  f9 26 20 20 20 20 20 20  70 61 6e 65 62 6c 6b 25  |.&      paneblk%|
0000ba40  21 34 3d 5f 51 25 21 34  2b 70 74 72 31 36 25 21  |!4=_Q%!4+ptr16%!|
0000ba50  63 74 72 25 0d 05 fa 1c  20 20 20 20 20 20 70 61  |ctr%....      pa|
0000ba60  6e 65 62 6c 6b 25 21 31  32 3d 5f 51 25 21 31 32  |neblk%!12=_Q%!12|
0000ba70  0d 05 fb 2f 20 20 20 20  20 20 70 61 6e 65 62 6c  |.../      panebl|
0000ba80  6b 25 21 31 36 3d 5f 51  25 21 38 2b 68 65 69 67  |k%!16=_Q%!8+heig|
0000ba90  68 74 25 2b 70 74 72 32  30 25 21 63 74 72 25 0d  |ht%+ptr20%!ctr%.|
0000baa0  05 fc 28 20 20 20 20 20  20 70 61 6e 65 62 6c 6b  |..(      paneblk|
0000bab0  25 21 38 3d 70 61 6e 65  62 6c 6b 25 21 31 36 2b  |%!8=paneblk%!16+|
0000bac0  68 65 69 67 68 74 25 0d  05 fd 0b 20 20 20 20 c9  |height%....    .|
0000bad0  20 35 0d 05 fe 25 20 20  20 20 20 20 f4 20 41 74  | 5...%      . At|
0000bae0  74 61 63 68 65 64 20 74  6f 20 72 69 67 68 74 20  |tached to right |
0000baf0  65 64 67 65 2e 2e 2e 0d  05 ff 1e 20 20 20 20 20  |edge.......     |
0000bb00  20 68 65 69 67 68 74 25  3d 5f 51 25 21 31 36 2d  | height%=_Q%!16-|
0000bb10  5f 51 25 21 38 0d 06 00  27 20 20 20 20 20 20 77  |_Q%!8...'      w|
0000bb20  69 64 74 68 25 3d 70 61  6e 65 62 6c 6b 25 21 31  |idth%=paneblk%!1|
0000bb30  32 2d 70 61 6e 65 62 6c  6b 25 21 34 0d 06 01 2e  |2-paneblk%!4....|
0000bb40  20 20 20 20 20 20 70 61  6e 65 62 6c 6b 25 21 34  |      paneblk%!4|
0000bb50  3d 5f 51 25 21 31 32 2d  77 69 64 74 68 25 2b 70  |=_Q%!12-width%+p|
0000bb60  74 72 31 36 25 21 63 74  72 25 0d 06 02 27 20 20  |tr16%!ctr%...'  |
0000bb70  20 20 20 20 70 61 6e 65  62 6c 6b 25 21 31 32 3d  |    paneblk%!12=|
0000bb80  70 61 6e 65 62 6c 6b 25  21 34 2b 77 69 64 74 68  |paneblk%!4+width|
0000bb90  25 0d 06 03 25 20 20 20  20 20 20 70 61 6e 65 62  |%...%      paneb|
0000bba0  6c 6b 25 21 31 36 3d 5f  51 25 21 31 36 20 3a f4  |lk%!16=_Q%!16 :.|
0000bbb0  20 6d 69 6e 20 79 0d 06  04 25 20 20 20 20 20 20  | min y...%      |
0000bbc0  70 61 6e 65 62 6c 6b 25  21 38 3d 5f 51 25 21 38  |paneblk%!8=_Q%!8|
0000bbd0  20 20 20 3a f4 20 6d 61  78 20 79 0d 06 05 09 20  |   :. max y.... |
0000bbe0  20 20 20 cb 0d 06 06 12  20 20 20 20 e7 20 63 74  |   .....    . ct|
0000bbf0  72 25 3d 30 20 8c 0d 06  07 1d 20 20 20 20 20 20  |r%=0 .....      |
0000bc00  70 61 6e 65 62 6c 6b 25  21 32 38 3d 62 65 68 69  |paneblk%!28=behi|
0000bc10  6e 64 25 0d 06 08 09 20  20 20 20 cc 0d 06 09 20  |nd%....    .... |
0000bc20  20 20 20 20 20 20 70 61  6e 65 62 6c 6b 25 21 32  |      paneblk%!2|
0000bc30  38 3d 70 72 65 76 5f 70  61 6e 65 25 0d 06 0a 09  |8=prev_pane%....|
0000bc40  20 20 20 20 cd 0d 06 0b  26 20 20 20 20 c8 99 20  |    ....&    .. |
0000bc50  22 57 69 6d 70 5f 4f 70  65 6e 57 69 6e 64 6f 77  |"Wimp_OpenWindow|
0000bc60  22 2c 2c 70 61 6e 65 62  6c 6b 25 0d 06 0c 1d 20  |",,paneblk%.... |
0000bc70  20 20 20 70 72 65 76 5f  70 61 6e 65 25 3d 70 61  |   prev_pane%=pa|
0000bc80  6e 65 62 6c 6b 25 21 30  0d 06 0d 0f 20 20 20 20  |neblk%!0....    |
0000bc90  63 74 72 25 2b 3d 34 0d  06 0e 07 20 20 ce 0d 06  |ctr%+=4....  ...|
0000bca0  0f 13 20 20 e7 20 ac 20  74 6f 67 67 6c 65 25 20  |..  . . toggle% |
0000bcb0  8c 0d 06 10 19 20 20 20  20 5f 51 25 21 32 38 3d  |.....    _Q%!28=|
0000bcc0  6c 61 73 74 5f 70 61 6e  65 25 0d 06 11 21 20 20  |last_pane%...!  |
0000bcd0  20 20 c8 99 20 22 57 69  6d 70 5f 4f 70 65 6e 57  |  .. "Wimp_OpenW|
0000bce0  69 6e 64 6f 77 22 2c 2c  5f 51 25 0d 06 12 07 20  |indow",,_Q%.... |
0000bcf0  20 cd 0d 06 13 26 20 20  f2 73 68 65 6c 6c 5f 48  | ....&  .shell_H|
0000bd00  65 61 70 42 6c 6f 63 6b  52 65 74 75 72 6e 28 70  |eapBlockReturn(p|
0000bd10  61 6e 65 62 6c 6b 25 29  0d 06 14 05 cc 0d 06 15  |aneblk%)........|
0000bd20  18 20 20 f4 20 6e 6f 20  70 61 6e 65 20 65 76 65  |.  . no pane eve|
0000bd30  6e 74 2e 2e 2e 0d 06 16  0f 20 20 5f 51 25 21 30  |nt.......  _Q%!0|
0000bd40  3d 77 68 25 0d 06 17 2f  20 20 e7 20 ac 20 66 75  |=wh%.../  . . fu|
0000bd50  6c 6c 25 20 8c 20 c8 99  20 22 57 69 6d 70 5f 47  |ll% . .. "Wimp_G|
0000bd60  65 74 57 69 6e 64 6f 77  53 74 61 74 65 22 2c 2c  |etWindowState",,|
0000bd70  5f 51 25 0d 06 18 1e 20  20 e7 20 62 65 68 69 6e  |_Q%....  . behin|
0000bd80  64 25 3d 2d 32 20 8c 20  5f 51 25 21 32 38 3d 2d  |d%=-2 . _Q%!28=-|
0000bd90  32 0d 06 19 1d 20 20 e7  20 66 72 6f 6e 74 25 3d  |2....  . front%=|
0000bda0  2d 31 20 8c 20 5f 51 25  21 32 38 3d 2d 31 0d 06  |-1 . _Q%!28=-1..|
0000bdb0  1a 1f 20 20 c8 99 20 22  57 69 6d 70 5f 4f 70 65  |..  .. "Wimp_Ope|
0000bdc0  6e 57 69 6e 64 6f 77 22  2c 2c 5f 51 25 0d 06 1b  |nWindow",,_Q%...|
0000bdd0  05 cd 0d 06 1c 05 e1 0d  06 1d 05 3a 0d 06 1e 1f  |...........:....|
0000bde0  2a 7c 53 74 6f 70 20 50  52 4f 43 73 68 65 6c 6c  |*|Stop PROCshell|
0000bdf0  5f 4f 70 65 6e 57 69 6e  64 6f 77 0d 06 1f 04 0d  |_OpenWindow.....|
0000be00  06 20 21 2a 7c 53 74 61  72 74 20 50 52 4f 43 73  |. !*|Start PROCs|
0000be10  68 65 6c 6c 5f 43 6c 6f  73 65 57 69 6e 64 6f 77  |hell_CloseWindow|
0000be20  0d 06 21 1d dd 20 f2 73  68 65 6c 6c 5f 43 6c 6f  |..!.. .shell_Clo|
0000be30  73 65 57 69 6e 64 6f 77  28 77 68 25 29 0d 06 22  |seWindow(wh%).."|
0000be40  3b ea 20 6f 66 66 73 65  74 25 2c 62 6c 6b 25 2c  |;. offset%,blk%,|
0000be50  70 74 72 38 25 2c 70 74  72 31 32 25 2c 70 74 72  |ptr8%,ptr12%,ptr|
0000be60  31 36 25 2c 70 74 72 32  30 25 2c 77 69 6e 5f 62  |16%,ptr20%,win_b|
0000be70  6c 6b 25 2c 72 65 73 25  0d 06 23 3a 6f 66 66 73  |lk%,res%..#:offs|
0000be80  65 74 25 3d a4 73 68 65  6c 6c 5f 47 65 74 45 76  |et%=.shell_GetEv|
0000be90  65 6e 74 4c 69 73 74 4f  66 66 73 65 74 28 77 68  |entListOffset(wh|
0000bea0  25 2c 2d 31 2c 5f 55 25  2b 33 30 38 2c 31 32 2c  |%,-1,_U%+308,12,|
0000beb0  a3 29 0d 06 24 12 e7 20  6f 66 66 73 65 74 25 3e  |.)..$.. offset%>|
0000bec0  3d 30 20 8c 0d 06 25 1a  20 20 62 6c 6b 25 3d 5f  |=0 ...%.  blk%=_|
0000bed0  55 25 21 33 30 38 2b 6f  66 66 73 65 74 25 0d 06  |U%!308+offset%..|
0000bee0  26 12 20 20 74 65 6d 70  25 3d 62 6c 6b 25 21 38  |&.  temp%=blk%!8|
0000bef0  0d 06 27 18 20 20 2a 7c  69 66 64 65 66 20 54 72  |..'.  *|ifdef Tr|
0000bf00  61 63 65 5f 49 6e 69 74  0d 06 28 3e 20 20 f2 73  |ace_Init..(>  .s|
0000bf10  68 65 6c 6c 5f 54 72 61  63 65 66 30 28 22 43 6c  |hell_Tracef0("Cl|
0000bf20  6f 73 65 57 69 6e 64 6f  77 3a 41 62 6f 75 74 20  |oseWindow:About |
0000bf30  74 6f 20 63 61 6c 6c 20  22 2b 22 46 4e 22 2b 24  |to call "+"FN"+$|
0000bf40  74 65 6d 70 25 29 0d 06  29 0d 20 20 2a 7c 65 6e  |temp%)..).  *|en|
0000bf50  64 69 66 0d 06 2a 19 20  20 72 65 73 25 3d a0 28  |dif..*.  res%=.(|
0000bf60  22 46 4e 22 2b 24 74 65  6d 70 25 29 0d 06 2b 12  |"FN"+$temp%)..+.|
0000bf70  20 20 e7 20 72 65 73 25  3d 30 20 8c 20 e1 0d 06  |  . res%=0 . ...|
0000bf80  2c 05 cd 0d 06 2d 26 77  69 6e 5f 62 6c 6b 25 3d  |,....-&win_blk%=|
0000bf90  a4 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
0000bfa0  46 65 74 63 68 28 36 30  29 0d 06 2e 0d e7 20 77  |Fetch(60)..... w|
0000bfb0  68 25 3e 30 20 8c 0d 06  2f 3b 20 20 6f 66 66 73  |h%>0 .../;  offs|
0000bfc0  65 74 25 3d a4 73 68 65  6c 6c 5f 47 65 74 45 76  |et%=.shell_GetEv|
0000bfd0  65 6e 74 4c 69 73 74 4f  66 66 73 65 74 28 77 68  |entListOffset(wh|
0000bfe0  25 2c 2d 31 2c 5f 55 25  2b 39 32 2c 32 34 2c a3  |%,-1,_U%+92,24,.|
0000bff0  29 0d 06 30 14 20 20 e7  20 6f 66 66 73 65 74 25  |)..0.  . offset%|
0000c000  3e 2d 31 20 8c 0d 06 31  1d 20 20 20 20 62 6c 6b  |>-1 ...1.    blk|
0000c010  25 3d 28 5f 55 25 21 39  32 29 2b 6f 66 66 73 65  |%=(_U%!92)+offse|
0000c020  74 25 0d 06 32 34 20 20  20 20 70 74 72 31 32 25  |t%..24    ptr12%|
0000c030  3d 62 6c 6b 25 21 31 32  3a 70 74 72 31 36 25 3d  |=blk%!12:ptr16%=|
0000c040  62 6c 6b 25 21 31 36 3a  70 74 72 32 30 25 3d 62  |blk%!16:ptr20%=b|
0000c050  6c 6b 25 21 32 30 0d 06  33 1b 20 20 20 20 63 74  |lk%!20..3.    ct|
0000c060  72 25 3d 30 3a 70 74 72  38 25 3d 62 6c 6b 25 21  |r%=0:ptr8%=blk%!|
0000c070  38 0d 06 34 19 20 20 20  20 c8 95 20 70 74 72 38  |8..4.    .. ptr8|
0000c080  25 21 63 74 72 25 3c 3e  2d 31 0d 06 35 1e 20 20  |%!ctr%<>-1..5.  |
0000c090  20 20 20 20 f4 20 63 6c  6f 73 65 20 70 61 6e 65  |    . close pane|
0000c0a0  20 77 69 6e 64 6f 77 73  0d 06 36 1f 20 20 20 20  | windows..6.    |
0000c0b0  20 20 77 69 6e 5f 62 6c  6b 25 21 30 3d 70 74 72  |  win_blk%!0=ptr|
0000c0c0  38 25 21 63 74 72 25 0d  06 37 29 20 20 20 20 20  |8%!ctr%..7)     |
0000c0d0  20 c8 99 20 22 57 69 6d  70 5f 43 6c 6f 73 65 57  | .. "Wimp_CloseW|
0000c0e0  69 6e 64 6f 77 22 2c 2c  77 69 6e 5f 62 6c 6b 25  |indow",,win_blk%|
0000c0f0  0d 06 38 11 20 20 20 20  20 20 63 74 72 25 2b 3d  |..8.      ctr%+=|
0000c100  34 0d 06 39 09 20 20 20  20 ce 0d 06 3a 2a 20 20  |4..9.    ...:*  |
0000c110  20 20 f4 20 50 52 4f 43  73 68 65 6c 6c 5f 48 65  |  . PROCshell_He|
0000c120  61 70 42 6c 6f 63 6b 52  65 74 75 72 6e 28 70 74  |apBlockReturn(pt|
0000c130  72 38 25 29 0d 06 3b 2b  20 20 20 20 f4 20 50 52  |r8%)..;+    . PR|
0000c140  4f 43 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |OCshell_HeapBloc|
0000c150  6b 52 65 74 75 72 6e 28  70 74 72 31 32 25 29 0d  |kReturn(ptr12%).|
0000c160  06 3c 2b 20 20 20 20 f4  20 50 52 4f 43 73 68 65  |.<+    . PROCshe|
0000c170  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 52 65 74 75  |ll_HeapBlockRetu|
0000c180  72 6e 28 70 74 72 31 36  25 29 0d 06 3d 2b 20 20  |rn(ptr16%)..=+  |
0000c190  20 20 f4 20 50 52 4f 43  73 68 65 6c 6c 5f 48 65  |  . PROCshell_He|
0000c1a0  61 70 42 6c 6f 63 6b 52  65 74 75 72 6e 28 70 74  |apBlockReturn(pt|
0000c1b0  72 32 30 25 29 0d 06 3e  07 20 20 cd 0d 06 3f 1b  |r20%)..>.  ...?.|
0000c1c0  20 20 f4 20 63 6c 6f 73  65 20 70 61 72 65 6e 74  |  . close parent|
0000c1d0  20 77 69 6e 64 6f 77 0d  06 40 34 20 20 77 69 6e  | window..@4  win|
0000c1e0  5f 62 6c 6b 25 21 30 3d  77 68 25 3a c8 99 20 22  |_blk%!0=wh%:.. "|
0000c1f0  57 69 6d 70 5f 43 6c 6f  73 65 57 69 6e 64 6f 77  |Wimp_CloseWindow|
0000c200  22 2c 2c 77 69 6e 5f 62  6c 6b 25 0d 06 41 05 cd  |",,win_blk%..A..|
0000c210  0d 06 42 24 f2 73 68 65  6c 6c 5f 48 65 61 70 42  |..B$.shell_HeapB|
0000c220  6c 6f 63 6b 52 65 74 75  72 6e 28 77 69 6e 5f 62  |lockReturn(win_b|
0000c230  6c 6b 25 29 0d 06 43 05  e1 0d 06 44 05 3a 0d 06  |lk%)..C....D.:..|
0000c240  45 20 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |E *|Stop PROCshe|
0000c250  6c 6c 5f 43 6c 6f 73 65  57 69 6e 64 6f 77 0d 06  |ll_CloseWindow..|
0000c260  46 04 0d 06 47 20 2a 7c  53 74 61 72 74 20 46 4e  |F...G *|Start FN|
0000c270  73 68 65 6c 6c 5f 44 65  6c 65 74 65 57 69 6e 64  |shell_DeleteWind|
0000c280  6f 77 0d 06 48 22 dd 20  a4 73 68 65 6c 6c 5f 44  |ow..H". .shell_D|
0000c290  65 6c 65 74 65 57 69 6e  64 6f 77 28 68 61 6e 64  |eleteWindow(hand|
0000c2a0  6c 65 25 29 0d 06 49 0e  ea 20 77 69 6e 5f 62 6c  |le%)..I.. win_bl|
0000c2b0  6b 25 0d 06 4a 26 77 69  6e 5f 62 6c 6b 25 3d a4  |k%..J&win_blk%=.|
0000c2c0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
0000c2d0  65 74 63 68 28 32 30 29  0d 06 4b 12 e7 20 68 61  |etch(20)..K.. ha|
0000c2e0  6e 64 6c 65 25 3c 3e 30  20 8c 0d 06 4c 1f 20 20  |ndle%<>0 ...L.  |
0000c2f0  e7 20 a4 6f 6b 74 6f 64  65 6c 65 74 65 77 28 68  |. .oktodeletew(h|
0000c300  61 6e 64 6c 65 25 29 20  8c 0d 06 4d 26 20 20 20  |andle%) ...M&   |
0000c310  20 f2 73 68 65 6c 6c 5f  45 76 65 6e 74 44 65 6c  | .shell_EventDel|
0000c320  65 74 65 41 6c 6c 28 68  61 6e 64 6c 65 25 29 0d  |eteAll(handle%).|
0000c330  06 4e 23 20 20 20 20 e7  20 68 61 6e 64 6c 65 25  |.N#    . handle%|
0000c340  3d 5f 55 25 21 32 30 20  8c 20 5f 55 25 21 32 30  |=_U%!20 . _U%!20|
0000c350  3d 30 0d 06 4f 34 20 20  20 20 6f 66 66 73 65 74  |=0..O4    offset|
0000c360  25 3d a4 73 68 65 6c 6c  5f 53 65 61 72 63 68 53  |%=.shell_SearchS|
0000c370  74 61 74 69 63 28 5f 55  25 21 31 38 34 2c 68 61  |tatic(_U%!184,ha|
0000c380  6e 64 6c 65 25 29 0d 06  50 16 20 20 20 20 e7 20  |ndle%)..P.    . |
0000c390  6f 66 66 73 65 74 25 3e  2d 31 20 8c 0d 06 51 1f  |offset%>-1 ...Q.|
0000c3a0  20 20 20 20 20 20 74 65  6d 70 25 3d 5f 55 25 21  |      temp%=_U%!|
0000c3b0  31 38 34 2b 6f 66 66 73  65 74 25 0d 06 52 37 20  |184+offset%..R7 |
0000c3c0  20 20 20 20 20 74 65 6d  70 25 21 30 3d 30 3a f4  |     temp%!0=0:.|
0000c3d0  20 77 69 70 65 20 77 69  6e 64 6f 77 20 68 61 6e  | wipe window han|
0000c3e0  64 6c 65 20 69 6e 20 73  74 61 74 69 63 20 6c 69  |dle in static li|
0000c3f0  73 74 0d 06 53 09 20 20  20 20 cd 0d 06 54 2e 20  |st..S.    ...T. |
0000c400  20 20 20 f4 20 61 6e 64  20 6e 6f 77 20 61 63 74  |   . and now act|
0000c410  75 61 6c 6c 79 20 64 65  6c 65 74 65 20 74 68 65  |ually delete the|
0000c420  20 77 69 6e 64 6f 77 2e  2e 0d 06 55 1a 20 20 20  | window....U.   |
0000c430  20 77 69 6e 5f 62 6c 6b  25 21 30 3d 68 61 6e 64  | win_blk%!0=hand|
0000c440  6c 65 25 0d 06 56 28 20  20 20 20 c8 99 20 22 57  |le%..V(    .. "W|
0000c450  69 6d 70 5f 44 65 6c 65  74 65 57 69 6e 64 6f 77  |imp_DeleteWindow|
0000c460  22 2c 2c 77 69 6e 5f 62  6c 6b 25 0d 06 57 11 20  |",,win_blk%..W. |
0000c470  20 20 20 68 61 6e 64 6c  65 25 3d 30 0d 06 58 07  |   handle%=0..X.|
0000c480  20 20 cd 0d 06 59 05 cd  0d 06 5a 24 f2 73 68 65  |  ...Y....Z$.she|
0000c490  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 52 65 74 75  |ll_HeapBlockRetu|
0000c4a0  72 6e 28 77 69 6e 5f 62  6c 6b 25 29 0d 06 5b 0c  |rn(win_blk%)..[.|
0000c4b0  3d 68 61 6e 64 6c 65 25  0d 06 5c 05 3a 0d 06 5d  |=handle%..\.:..]|
0000c4c0  1f 2a 7c 53 74 6f 70 20  46 4e 73 68 65 6c 6c 5f  |.*|Stop FNshell_|
0000c4d0  44 65 6c 65 74 65 57 69  6e 64 6f 77 0d 06 5e 19  |DeleteWindow..^.|
0000c4e0  2a 7c 53 74 61 72 74 20  46 4e 6f 6b 74 6f 64 65  |*|Start FNoktode|
0000c4f0  6c 65 74 65 77 0d 06 5f  1b dd 20 a4 6f 6b 74 6f  |letew.._.. .okto|
0000c500  64 65 6c 65 74 65 77 28  68 61 6e 64 6c 65 25 29  |deletew(handle%)|
0000c510  0d 06 60 07 3d 2d 31 0d  06 61 05 3a 0d 06 62 18  |..`.=-1..a.:..b.|
0000c520  2a 7c 53 74 6f 70 20 46  4e 6f 6b 74 6f 64 65 6c  |*|Stop FNoktodel|
0000c530  65 74 65 77 0d 06 63 18  2a 7c 53 74 61 72 74 20  |etew..c.*|Start |
0000c540  46 4e 6f 6b 74 6f 63 6c  6f 73 65 77 0d 06 64 1a  |FNoktoclosew..d.|
0000c550  dd 20 a4 6f 6b 74 6f 63  6c 6f 73 65 77 28 68 61  |. .oktoclosew(ha|
0000c560  6e 64 6c 65 25 29 0d 06  65 07 3d 2d 31 0d 06 66  |ndle%)..e.=-1..f|
0000c570  05 3a 0d 06 67 17 2a 7c  53 74 6f 70 20 46 4e 6f  |.:..g.*|Stop FNo|
0000c580  6b 74 6f 63 6c 6f 73 65  77 0d 06 68 18 2a 7c 53  |ktoclosew..h.*|S|
0000c590  74 61 72 74 20 50 52 4f  43 63 6c 69 70 72 65 63  |tart PROCcliprec|
0000c5a0  74 0d 06 69 2a dd 20 f2  63 6c 69 70 72 65 63 74  |t..i*. .cliprect|
0000c5b0  28 62 2c f8 20 78 31 25  2c f8 20 79 31 25 2c f8  |(b,. x1%,. y1%,.|
0000c5c0  20 78 32 25 2c f8 20 79  32 25 29 0d 06 6a 0d ea  | x2%,. y2%)..j..|
0000c5d0  20 78 30 25 2c 79 30 25  0d 06 6b 40 f2 6c 77 61  | x0%,y0%..k@.lwa|
0000c5e0  6f 72 69 67 69 6e 28 62  2c 78 30 25 2c 79 30 25  |origin(b,x0%,y0%|
0000c5f0  29 3a 78 31 25 3d 62 21  32 34 2d 78 30 25 3a 79  |):x1%=b!24-x0%:y|
0000c600  31 25 3d 62 21 32 38 2d  79 30 25 3a 78 32 25 3d  |1%=b!28-y0%:x2%=|
0000c610  62 21 33 32 2d 78 30 25  0d 06 6c 10 79 32 25 3d  |b!32-x0%..l.y2%=|
0000c620  62 21 33 36 2d 79 30 25  0d 06 6d 05 e1 0d 06 6e  |b!36-y0%..m....n|
0000c630  05 3a 0d 06 6f 17 2a 7c  53 74 6f 70 20 50 52 4f  |.:..o.*|Stop PRO|
0000c640  43 63 6c 69 70 72 65 63  74 0d 06 70 12 2a 7c 53  |Ccliprect..p.*|S|
0000c650  74 61 72 74 20 46 4e 70  6f 6c 6c 0d 06 71 18 dd  |tart FNpoll..q..|
0000c660  20 a4 70 6f 6c 6c 28 6d  61 73 6b 25 2c 74 61 73  | .poll(mask%,tas|
0000c670  6b 25 29 0d 06 72 21 c8  99 20 22 57 69 6d 70 5f  |k%)..r!.. "Wimp_|
0000c680  50 6f 6c 6c 22 2c 6d 61  73 6b 25 2c 5f 51 25 20  |Poll",mask%,_Q% |
0000c690  b8 20 61 25 0d 06 73 07  3d 61 25 0d 06 74 05 3a  |. a%..s.=a%..t.:|
0000c6a0  0d 06 75 11 2a 7c 53 74  6f 70 20 46 4e 70 6f 6c  |..u.*|Stop FNpol|
0000c6b0  6c 0d 06 76 1a 2a 7c 53  74 61 72 74 20 46 4e 73  |l..v.*|Start FNs|
0000c6c0  68 65 6c 6c 5f 50 6f 6c  6c 5f 49 0d 06 77 20 dd  |hell_Poll_I..w .|
0000c6d0  20 a4 73 68 65 6c 6c 5f  50 6f 6c 6c 5f 49 28 6d  | .shell_Poll_I(m|
0000c6e0  61 73 6b 25 2c 74 61 73  6b 25 29 0d 06 78 21 c8  |ask%,task%)..x!.|
0000c6f0  99 20 22 57 69 6d 70 5f  50 6f 6c 6c 22 2c 6d 61  |. "Wimp_Poll",ma|
0000c700  73 6b 25 2c 5f 51 25 20  b8 20 61 25 0d 06 79 21  |sk%,_Q% . a%..y!|
0000c710  c8 99 20 22 49 6e 74 65  72 66 61 63 65 5f 50 6f  |.. "Interface_Po|
0000c720  6c 6c 22 2c 61 25 2c 2c  74 61 73 6b 25 0d 06 7a  |ll",a%,,task%..z|
0000c730  07 3d 61 25 0d 06 7b 05  3a 0d 06 7c 19 2a 7c 53  |.=a%..{.:..|.*|S|
0000c740  74 6f 70 20 46 4e 73 68  65 6c 6c 5f 50 6f 6c 6c  |top FNshell_Poll|
0000c750  5f 49 0d 06 7d 1d dd 20  f2 73 68 65 6c 6c 5f 44  |_I..}.. .shell_D|
0000c760  6f 42 61 63 6b 67 72 6f  75 6e 64 54 61 73 6b 0d  |oBackgroundTask.|
0000c770  06 7e 05 e1 0d 06 7f 05  3a 0d 06 80 23 2a 7c 53  |.~......:...#*|S|
0000c780  74 61 72 74 20 46 4e 73  68 65 6c 6c 5f 49 63 6f  |tart FNshell_Ico|
0000c790  6e 49 73 44 72 61 67 67  61 62 6c 65 0d 06 81 25  |nIsDraggable...%|
0000c7a0  dd 20 a4 73 68 65 6c 6c  5f 49 63 6f 6e 49 73 44  |. .shell_IconIsD|
0000c7b0  72 61 67 67 61 62 6c 65  28 77 68 25 2c 69 68 25  |raggable(wh%,ih%|
0000c7c0  29 0d 06 82 17 ea 20 66  6c 61 67 73 25 2c 74 65  |)..... flags%,te|
0000c7d0  6d 70 25 2c 62 6c 6b 25  0d 06 83 3e f4 20 63 6c  |mp%,blk%...>. cl|
0000c7e0  61 69 6d 20 61 20 62 6c  6f 63 6b 20 61 73 20 74  |aim a block as t|
0000c7f0  65 6d 70 6f 72 61 72 79  20 77 6f 72 6b 73 70 61  |emporary workspa|
0000c800  63 65 20 62 69 67 20 65  6e 6f 75 67 68 20 66 6f  |ce big enough fo|
0000c810  72 20 64 61 74 61 0d 06  84 31 f4 20 72 65 74 75  |r data...1. retu|
0000c820  72 6e 65 64 20 62 79 20  53 57 49 20 63 61 6c 6c  |rned by SWI call|
0000c830  20 28 69 63 6f 6e 20 62  6c 6f 63 6b 20 2b 20 38  | (icon block + 8|
0000c840  20 62 79 74 65 73 29 0d  06 85 22 62 6c 6b 25 3d  | bytes)..."blk%=|
0000c850  a4 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
0000c860  46 65 74 63 68 28 35 30  29 0d 06 86 19 62 6c 6b  |Fetch(50)....blk|
0000c870  25 21 30 3d 77 68 25 3a  62 6c 6b 25 21 34 3d 69  |%!0=wh%:blk%!4=i|
0000c880  68 25 0d 06 87 20 c8 99  20 22 57 69 6d 70 5f 47  |h%... .. "Wimp_G|
0000c890  65 74 49 63 6f 6e 53 74  61 74 65 22 2c 2c 62 6c  |etIconState",,bl|
0000c8a0  6b 25 0d 06 88 12 66 6c  61 67 73 25 3d 62 6c 6b  |k%....flags%=blk|
0000c8b0  25 21 32 34 0d 06 89 1a  74 65 6d 70 25 3d 28 66  |%!24....temp%=(f|
0000c8c0  6c 61 67 73 25 20 80 20  26 36 30 30 30 29 0d 06  |lags% . &6000)..|
0000c8d0  8a 20 f2 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |. .shell_HeapBlo|
0000c8e0  63 6b 52 65 74 75 72 6e  28 62 6c 6b 25 29 0d 06  |ckReturn(blk%)..|
0000c8f0  8b 19 e7 20 74 65 6d 70  25 3d 26 36 30 30 30 20  |... temp%=&6000 |
0000c900  3d b9 20 8b 20 3d a3 0d  06 8c 06 3d 30 0d 06 8d  |=. . =.....=0...|
0000c910  05 3a 0d 06 8e 22 2a 7c  53 74 6f 70 20 46 4e 73  |.:..."*|Stop FNs|
0000c920  68 65 6c 6c 5f 49 63 6f  6e 49 73 44 72 61 67 67  |hell_IconIsDragg|
0000c930  61 62 6c 65 0d 06 8f 21  2a 7c 53 74 61 72 74 20  |able...!*|Start |
0000c940  50 52 4f 43 73 68 65 6c  6c 5f 49 63 6f 6e 44 72  |PROCshell_IconDr|
0000c950  61 67 42 6f 78 0d 06 90  21 dd 20 f2 73 68 65 6c  |agBox...!. .shel|
0000c960  6c 5f 49 63 6f 6e 44 72  61 67 42 6f 78 28 77 68  |l_IconDragBox(wh|
0000c970  25 2c 69 68 25 29 0d 06  91 49 ea 20 62 6c 6b 25  |%,ih%)...I. blk%|
0000c980  2c 77 65 78 2c 77 65 79  2c 65 5f 6f 66 66 73 65  |,wex,wey,e_offse|
0000c990  74 25 2c 66 6c 61 67 73  25 2c 66 25 2c 44 72 61  |t%,flags%,f%,Dra|
0000c9a0  67 41 53 70 72 69 74 65  25 2c 73 70 72 5f 61 72  |gASprite%,spr_ar|
0000c9b0  65 61 25 2c 76 61 6c 69  64 25 2c 73 70 72 24 0d  |ea%,valid%,spr$.|
0000c9c0  06 92 44 f4 20 63 68 65  63 6b 20 69 66 20 61 6e  |..D. check if an|
0000c9d0  20 65 76 65 6e 74 20 68  61 73 20 62 65 65 6e 20  | event has been |
0000c9e0  72 65 67 69 73 74 65 72  65 64 20 66 6f 72 20 77  |registered for w|
0000c9f0  68 65 6e 20 74 68 65 20  64 72 61 67 20 65 6e 64  |hen the drag end|
0000ca00  73 2e 2e 0d 06 93 3c 65  5f 6f 66 66 73 65 74 25  |s.....<e_offset%|
0000ca10  3d a4 73 68 65 6c 6c 5f  47 65 74 45 76 65 6e 74  |=.shell_GetEvent|
0000ca20  4c 69 73 74 4f 66 66 73  65 74 28 77 68 25 2c 69  |ListOffset(wh%,i|
0000ca30  68 25 2c 5f 55 25 2b 37  32 2c 32 34 2c a3 29 0d  |h%,_U%+72,24,.).|
0000ca40  06 94 14 e7 20 65 5f 6f  66 66 73 65 74 25 3e 3d  |.... e_offset%>=|
0000ca50  30 20 8c 0d 06 95 30 20  20 f4 20 69 74 20 68 61  |0 ....0  . it ha|
0000ca60  73 2c 20 73 6f 20 67 6f  20 61 68 65 61 64 20 61  |s, so go ahead a|
0000ca70  6e 64 20 61 6c 6c 6f 77  20 74 68 65 20 64 72 61  |nd allow the dra|
0000ca80  67 2e 2e 0d 06 96 26 20  20 62 6c 6b 25 3d a4 73  |g.....&  blk%=.s|
0000ca90  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 46 65  |hell_HeapBlockFe|
0000caa0  74 63 68 28 36 30 30 30  29 0d 06 97 0f 20 20 21  |tch(6000)....  !|
0000cab0  62 6c 6b 25 3d 77 68 25  0d 06 98 23 20 20 c8 99  |blk%=wh%...#  ..|
0000cac0  20 22 57 69 6d 70 5f 47  65 74 57 69 6e 64 6f 77  | "Wimp_GetWindow|
0000cad0  49 6e 66 6f 22 2c 2c 62  6c 6b 25 0d 06 99 2c 20  |Info",,blk%..., |
0000cae0  20 77 65 78 3d 62 6c 6b  25 21 34 2d 62 6c 6b 25  | wex=blk%!4-blk%|
0000caf0  21 32 30 3a 77 65 79 3d  62 6c 6b 25 21 31 36 2d  |!20:wey=blk%!16-|
0000cb00  62 6c 6b 25 21 32 34 0d  06 9a 17 20 20 73 70 72  |blk%!24....  spr|
0000cb10  5f 61 72 65 61 25 3d 62  6c 6b 25 21 36 38 0d 06  |_area%=blk%!68..|
0000cb20  9b 10 20 20 62 6c 6b 25  21 34 3d 69 68 25 0d 06  |..  blk%!4=ih%..|
0000cb30  9c 22 20 20 c8 99 20 22  57 69 6d 70 5f 47 65 74  |."  .. "Wimp_Get|
0000cb40  49 63 6f 6e 53 74 61 74  65 22 2c 2c 62 6c 6b 25  |IconState",,blk%|
0000cb50  0d 06 9d 36 20 20 21 62  6c 6b 25 3d 77 68 25 3a  |...6  !blk%=wh%:|
0000cb60  62 6c 6b 25 21 34 3d 35  3a 66 6c 61 67 73 25 3d  |blk%!4=5:flags%=|
0000cb70  62 6c 6b 25 21 32 34 3a  76 61 6c 69 64 25 3d 62  |blk%!24:valid%=b|
0000cb80  6c 6b 25 21 33 32 0d 06  9e 17 20 20 62 6c 6b 25  |lk%!32....  blk%|
0000cb90  21 38 3d 62 6c 6b 25 21  38 2b 77 65 78 0d 06 9f  |!8=blk%!8+wex...|
0000cba0  19 20 20 62 6c 6b 25 21  31 32 3d 62 6c 6b 25 21  |.  blk%!12=blk%!|
0000cbb0  31 32 2b 77 65 79 0d 06  a0 19 20 20 62 6c 6b 25  |12+wey....  blk%|
0000cbc0  21 31 36 3d 62 6c 6b 25  21 31 36 2b 77 65 78 0d  |!16=blk%!16+wex.|
0000cbd0  06 a1 19 20 20 62 6c 6b  25 21 32 30 3d 62 6c 6b  |...  blk%!20=blk|
0000cbe0  25 21 32 30 2b 77 65 79  0d 06 a2 19 20 20 62 6c  |%!20+wey....  bl|
0000cbf0  6b 25 21 32 34 3d 30 3a  62 6c 6b 25 21 32 38 3d  |k%!24=0:blk%!28=|
0000cc00  30 0d 06 a3 29 20 20 62  6c 6b 25 21 33 32 3d 26  |0...)  blk%!32=&|
0000cc10  37 46 46 46 46 46 46 46  3a 62 6c 6b 25 21 33 36  |7FFFFFFF:blk%!36|
0000cc20  3d 26 37 46 46 46 46 46  46 46 0d 06 a4 2b 20 20  |=&7FFFFFFF...+  |
0000cc30  f4 20 63 68 65 63 6b 20  64 72 61 67 61 73 70 72  |. check dragaspr|
0000cc40  69 74 65 20 62 69 74 20  69 6e 20 43 4d 4f 53 20  |ite bit in CMOS |
0000cc50  52 41 4d 2e 2e 0d 06 a5  20 20 20 c8 99 20 22 4f  |RAM.....   .. "O|
0000cc60  53 5f 42 79 74 65 22 2c  31 36 31 2c 32 38 20 b8  |S_Byte",161,28 .|
0000cc70  20 2c 2c 66 25 0d 06 a6  1f 20 20 44 72 61 67 41  | ,,f%....  DragA|
0000cc80  53 70 72 69 74 65 25 3d  28 28 66 25 20 80 20 32  |Sprite%=((f% . 2|
0000cc90  29 3d 32 29 0d 06 a7 16  20 20 e7 20 44 72 61 67  |)=2)....  . Drag|
0000cca0  41 53 70 72 69 74 65 25  20 8c 0d 06 a8 11 20 20  |ASprite% .....  |
0000ccb0  20 20 66 25 3d 66 6c 61  67 73 25 0d 06 a9 17 20  |  f%=flags%.... |
0000ccc0  20 20 20 e7 20 28 66 25  20 80 20 26 31 30 30 29  |   . (f% . &100)|
0000ccd0  20 8c 0d 06 aa 30 20 20  20 20 20 20 73 70 72 24  | ....0      spr$|
0000cce0  3d a4 73 68 65 6c 6c 5f  49 63 6f 6e 47 65 74 43  |=.shell_IconGetC|
0000ccf0  6f 6d 6d 61 6e 64 28 76  61 6c 69 64 25 2c 22 73  |ommand(valid%,"s|
0000cd00  22 29 0d 06 ab 09 20 20  20 20 cd 0d 06 ac 3e 20  |")....    ....> |
0000cd10  20 20 20 e7 20 28 66 25  20 80 20 32 29 3d 30 20  |   . (f% . 2)=0 |
0000cd20  8c 20 85 20 39 39 2c a4  73 68 65 6c 6c 5f 4d 65  |. . 99,.shell_Me|
0000cd30  73 73 61 67 65 4e 6f 41  72 67 73 28 22 53 48 45  |ssageNoArgs("SHE|
0000cd40  4c 4c 4d 53 47 31 39 22  29 0d 06 ad 14 20 20 20  |LLMSG19")....   |
0000cd50  20 e7 20 73 70 72 24 3c  3e 22 22 20 8c 0d 06 ae  | . spr$<>"" ....|
0000cd60  40 20 20 20 20 20 20 c8  99 20 22 44 72 61 67 41  |@      .. "DragA|
0000cd70  53 70 72 69 74 65 5f 53  74 61 72 74 22 2c 25 31  |Sprite_Start",%1|
0000cd80  30 30 30 30 31 30 31 2c  73 70 72 5f 61 72 65 61  |0000101,spr_area|
0000cd90  25 2c 73 70 72 24 2c 62  6c 6b 25 2b 38 0d 06 af  |%,spr$,blk%+8...|
0000cda0  38 20 20 20 20 20 20 5f  55 25 21 31 30 30 3d 5f  |8      _U%!100=_|
0000cdb0  55 25 21 31 30 30 20 84  20 31 3a f4 20 73 65 74  |U%!100 . 1:. set|
0000cdc0  20 27 64 72 61 67 61 73  70 72 69 74 65 27 20 66  | 'dragasprite' f|
0000cdd0  6c 61 67 2e 2e 0d 06 b0  09 20 20 20 20 cc 0d 06  |lag......    ...|
0000cde0  b1 21 20 20 20 20 20 20  c8 99 20 22 57 69 6d 70  |.!      .. "Wimp|
0000cdf0  5f 44 72 61 67 42 6f 78  22 2c 2c 62 6c 6b 25 0d  |_DragBox",,blk%.|
0000ce00  06 b2 09 20 20 20 20 cd  0d 06 b3 07 20 20 cc 0d  |...    .....  ..|
0000ce10  06 b4 1f 20 20 20 20 c8  99 20 22 57 69 6d 70 5f  |...    .. "Wimp_|
0000ce20  44 72 61 67 42 6f 78 22  2c 2c 62 6c 6b 25 0d 06  |DragBox",,blk%..|
0000ce30  b5 07 20 20 cd 0d 06 b6  22 20 20 f2 73 68 65 6c  |..  ...."  .shel|
0000ce40  6c 5f 48 65 61 70 42 6c  6f 63 6b 52 65 74 75 72  |l_HeapBlockRetur|
0000ce50  6e 28 62 6c 6b 25 29 0d  06 b7 05 cc 0d 06 b8 56  |n(blk%)........V|
0000ce60  20 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |  .shell_Tracef0|
0000ce70  28 22 49 63 6f 6e 44 72  61 67 42 6f 78 3a 57 41  |("IconDragBox:WA|
0000ce80  52 4e 49 4e 47 21 20 6e  6f 20 64 72 61 67 20 68  |RNING! no drag h|
0000ce90  61 6e 64 6c 65 72 20 72  65 67 69 73 74 65 72 65  |andler registere|
0000cea0  64 20 66 6f 72 20 74 68  69 73 20 69 63 6f 6e 21  |d for this icon!|
0000ceb0  22 29 0d 06 b9 05 cd 0d  06 ba 05 e1 0d 06 bb 05  |")..............|
0000cec0  3a 0d 06 bc 20 2a 7c 53  74 6f 70 20 50 52 4f 43  |:... *|Stop PROC|
0000ced0  73 68 65 6c 6c 5f 49 63  6f 6e 44 72 61 67 42 6f  |shell_IconDragBo|
0000cee0  78 0d 06 bd 04 0d 06 be  28 2a 7c 53 74 61 72 74  |x.......(*|Start|
0000cef0  20 50 52 4f 43 73 68 65  6c 6c 5f 48 61 6e 64 6c  | PROCshell_Handl|
0000cf00  65 41 74 74 61 63 68 65  64 4d 65 6e 75 0d 06 bf  |eAttachedMenu...|
0000cf10  2c dd 20 f2 73 68 65 6c  6c 5f 48 61 6e 64 6c 65  |,. .shell_Handle|
0000cf20  41 74 74 61 63 68 65 64  4d 65 6e 75 28 5f 51 25  |AttachedMenu(_Q%|
0000cf30  2c 77 68 25 2c 69 68 25  29 0d 06 c0 0b ea 20 6d  |,wh%,ih%)..... m|
0000cf40  65 6e 75 25 0d 06 c1 07  ea 20 85 0d 06 c2 0f ee  |enu%..... ......|
0000cf50  20 85 20 ea 3a f7 20 85  3a e1 0d 06 c3 18 e7 20  | . .:. .:...... |
0000cf60  69 68 25 3c 3e 2d 31 20  80 20 77 68 25 3e 2d 31  |ih%<>-1 . wh%>-1|
0000cf70  20 8c 0d 06 c4 2e 20 20  6d 65 6e 75 25 3d a4 73  | .....  menu%=.s|
0000cf80  68 65 6c 6c 5f 47 65 74  45 76 65 6e 74 4d 65 6e  |hell_GetEventMen|
0000cf90  75 28 5f 51 25 21 38 2c  77 68 25 2c 69 68 25 29  |u(_Q%!8,wh%,ih%)|
0000cfa0  0d 06 c5 12 20 20 e7 20  6d 65 6e 75 25 3c 3e 30  |....  . menu%<>0|
0000cfb0  20 8c 0d 06 c6 2d 20 20  20 20 f2 73 68 65 6c 6c  | ....-    .shell|
0000cfc0  5f 4f 70 65 6e 4d 65 6e  75 28 5f 51 25 21 30 2d  |_OpenMenu(_Q%!0-|
0000cfd0  36 34 2c 5f 51 25 21 34  2c 6d 65 6e 75 25 29 0d  |64,_Q%!4,menu%).|
0000cfe0  06 c7 07 20 20 cd 0d 06  c8 05 cd 0d 06 c9 05 e1  |...  ...........|
0000cff0  0d 06 ca 05 3a 0d 06 cb  27 2a 7c 53 74 6f 70 20  |....:...'*|Stop |
0000d000  50 52 4f 43 73 68 65 6c  6c 5f 48 61 6e 64 6c 65  |PROCshell_Handle|
0000d010  41 74 74 61 63 68 65 64  4d 65 6e 75 0d 06 cc 04  |AttachedMenu....|
0000d020  0d 06 cd 1c 2a 7c 53 74  61 72 74 20 50 52 4f 43  |....*|Start PROC|
0000d030  73 68 65 6c 6c 5f 41 63  74 69 6f 6e 0d 06 ce 1a  |shell_Action....|
0000d040  dd 20 f2 73 68 65 6c 6c  5f 41 63 74 69 6f 6e 28  |. .shell_Action(|
0000d050  65 76 6e 74 25 29 0d 06  cf 3b ea 20 66 6e 24 2c  |evnt%)...;. fn$,|
0000d060  6d 65 6e 75 25 2c 6d 65  6e 75 24 2c 73 65 6c 65  |menu%,menu$,sele|
0000d070  63 74 24 2c 6d 65 6e 75  5f 62 75 66 66 65 72 25  |ct$,menu_buffer%|
0000d080  2c 6d 78 25 2c 6d 79 25  2c 63 6c 61 69 6d 65 64  |,mx%,my%,claimed|
0000d090  25 0d 06 d0 43 ea 20 77  68 25 2c 69 68 25 2c 76  |%...C. wh%,ih%,v|
0000d0a0  6f 69 64 25 2c 5f 74 65  6d 70 32 38 25 2c 5f 74  |oid%,_temp28%,_t|
0000d0b0  65 6d 70 33 32 25 2c 5f  74 65 6d 70 32 34 25 2c  |emp32%,_temp24%,|
0000d0c0  5f 74 65 6d 70 25 2c 66  6f 6e 74 6d 65 6e 75 66  |_temp%,fontmenuf|
0000d0d0  6c 61 67 25 0d 06 d1 1a  ea 20 43 68 65 63 6b 53  |lag%..... CheckS|
0000d0e0  65 6c 65 63 74 25 2c 6f  66 66 73 65 74 25 0d 06  |elect%,offset%..|
0000d0f0  d2 0e c8 8e 20 65 76 6e  74 25 20 ca 0d 06 d3 28  |.... evnt% ....(|
0000d100  20 20 2a 7c 69 66 64 65  66 20 50 52 4f 43 73 68  |  *|ifdef PROCsh|
0000d110  65 6c 6c 5f 44 6f 42 61  63 6b 67 72 6f 75 6e 64  |ell_DoBackground|
0000d120  54 61 73 6b 0d 06 d4 21  20 20 c9 20 30 3a f2 73  |Task...!  . 0:.s|
0000d130  68 65 6c 6c 5f 44 6f 42  61 63 6b 67 72 6f 75 6e  |hell_DoBackgroun|
0000d140  64 54 61 73 6b 0d 06 d5  0d 20 20 2a 7c 65 6e 64  |dTask....  *|end|
0000d150  69 66 0d 06 d6 24 20 20  c9 20 31 3a f2 73 68 65  |if...$  . 1:.she|
0000d160  6c 6c 5f 52 65 64 72 61  77 57 69 6e 64 6f 77 28  |ll_RedrawWindow(|
0000d170  5f 51 25 21 30 29 0d 06  d7 26 20 20 c9 20 32 3a  |_Q%!0)...&  . 2:|
0000d180  f2 73 68 65 6c 6c 5f 4f  70 65 6e 57 69 6e 64 6f  |.shell_OpenWindo|
0000d190  77 28 5f 51 25 21 30 2c  b9 2c 30 29 0d 06 d8 23  |w(_Q%!0,.,0)...#|
0000d1a0  20 20 c9 20 33 3a f2 73  68 65 6c 6c 5f 43 6c 6f  |  . 3:.shell_Clo|
0000d1b0  73 65 57 69 6e 64 6f 77  28 5f 51 25 21 30 29 0d  |seWindow(_Q%!0).|
0000d1c0  06 d9 2c 20 20 2a 7c 69  66 64 65 66 20 50 52 4f  |..,  *|ifdef PRO|
0000d1d0  43 73 68 65 6c 6c 5f 50  6f 69 6e 74 65 72 4c 65  |Cshell_PointerLe|
0000d1e0  61 76 69 6e 67 57 69 6e  64 6f 77 0d 06 da 25 20  |avingWindow...% |
0000d1f0  20 c9 20 34 3a f2 73 68  65 6c 6c 5f 50 6f 69 6e  | . 4:.shell_Poin|
0000d200  74 65 72 4c 65 61 76 69  6e 67 57 69 6e 64 6f 77  |terLeavingWindow|
0000d210  0d 06 db 0d 20 20 2a 7c  65 6e 64 69 66 0d 06 dc  |....  *|endif...|
0000d220  2d 20 20 2a 7c 69 66 64  65 66 20 50 52 4f 43 73  |-  *|ifdef PROCs|
0000d230  68 65 6c 6c 5f 50 6f 69  6e 74 65 72 45 6e 74 65  |hell_PointerEnte|
0000d240  72 69 6e 67 57 69 6e 64  6f 77 0d 06 dd 26 20 20  |ringWindow...&  |
0000d250  c9 20 35 3a f2 73 68 65  6c 6c 5f 50 6f 69 6e 74  |. 5:.shell_Point|
0000d260  65 72 45 6e 74 65 72 69  6e 67 57 69 6e 64 6f 77  |erEnteringWindow|
0000d270  0d 06 de 0d 20 20 2a 7c  65 6e 64 69 66 0d 06 df  |....  *|endif...|
0000d280  39 20 20 c9 20 36 3a 5f  55 25 21 32 38 3d 5f 51  |9  . 6:_U%!28=_Q|
0000d290  25 21 31 32 3a 5f 55 25  21 33 32 3d 5f 51 25 21  |%!12:_U%!32=_Q%!|
0000d2a0  31 36 3a 6d 78 25 3d 5f  51 25 21 30 3a 6d 79 25  |16:mx%=_Q%!0:my%|
0000d2b0  3d 5f 51 25 21 34 0d 06  e0 28 20 20 20 20 20 20  |=_Q%!4...(      |
0000d2c0  20 20 20 5f 55 25 21 32  37 32 3d 5f 51 25 21 30  |   _U%!272=_Q%!0|
0000d2d0  3a 5f 55 25 21 32 37 36  3d 5f 51 25 21 34 0d 06  |:_U%!276=_Q%!4..|
0000d2e0  e1 37 20 20 20 20 20 20  20 20 20 5f 74 65 6d 70  |.7         _temp|
0000d2f0  32 38 25 3d 5f 51 25 21  31 32 3a 5f 74 65 6d 70  |28%=_Q%!12:_temp|
0000d300  33 32 25 3d 5f 51 25 21  31 36 3a 69 68 25 3d 5f  |32%=_Q%!16:ih%=_|
0000d310  51 25 21 31 36 0d 06 e2  1e 20 20 20 20 20 20 20  |Q%!16....       |
0000d320  20 20 2a 7c 69 66 64 65  66 20 54 72 61 63 65 49  |  *|ifdef TraceI|
0000d330  6e 69 74 0d 06 e3 40 20  20 20 20 20 20 20 20 20  |nit...@         |
0000d340  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
0000d350  41 63 74 69 6f 6e 3a 4d  6f 75 73 65 5f 43 6c 69  |Action:Mouse_Cli|
0000d360  63 6b 20 65 76 65 6e 74  20 64 65 74 65 63 74 65  |ck event detecte|
0000d370  64 22 29 0d 06 e4 5e 20  20 20 20 20 20 20 20 20  |d")...^         |
0000d380  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
0000d390  41 63 74 69 6f 6e 3a 57  69 6e 64 6f 77 20 48 61  |Action:Window Ha|
0000d3a0  6e 64 6c 65 20 77 61 73  20 26 22 2b c3 7e 5f 51  |ndle was &"+.~_Q|
0000d3b0  25 21 31 32 2b 22 20 49  63 6f 6e 20 48 61 6e 64  |%!12+" Icon Hand|
0000d3c0  6c 65 20 77 61 73 20 22  2b c3 5f 51 25 21 31 36  |le was "+._Q%!16|
0000d3d0  29 0d 06 e5 14 20 20 20  20 20 20 20 20 20 2a 7c  |)....         *||
0000d3e0  65 6e 64 69 66 0d 06 e6  30 20 20 20 20 20 20 20  |endif...0       |
0000d3f0  20 20 e7 20 5f 51 25 21  31 32 3d 5f 55 25 21 32  |  . _Q%!12=_U%!2|
0000d400  38 38 20 80 20 5f 51 25  21 31 36 3d 5f 55 25 21  |88 . _Q%!16=_U%!|
0000d410  32 39 32 20 8c 0d 06 e7  43 20 20 20 20 20 20 20  |292 ....C       |
0000d420  20 20 20 20 f4 20 73 61  6d 65 20 69 63 6f 6e 20  |    . same icon |
0000d430  70 72 65 73 73 65 64 20  61 67 61 69 6e 2c 20 75  |pressed again, u|
0000d440  73 65 20 73 74 6f 72 65  64 20 65 76 65 6e 74 20  |se stored event |
0000d450  6f 66 66 73 65 74 2e 2e  0d 06 e8 3c 20 20 20 20  |offset.....<    |
0000d460  20 20 20 20 20 20 20 f2  73 68 65 6c 6c 5f 48 61  |       .shell_Ha|
0000d470  6e 64 6c 65 42 75 6d 70  49 63 6f 6e 73 28 5f 55  |ndleBumpIcons(_U|
0000d480  25 21 32 39 36 2c 5f 51  25 21 31 32 2c 5f 51 25  |%!296,_Q%!12,_Q%|
0000d490  21 31 36 29 0d 06 e9 0e  20 20 20 20 20 20 20 20  |!16)....        |
0000d4a0  20 cc 0d 06 ea 2f 20 20  20 20 20 20 20 20 20 20  | ..../          |
0000d4b0  20 5f 55 25 21 32 38 38  3d 2d 31 3a 5f 55 25 21  | _U%!288=-1:_U%!|
0000d4c0  32 39 32 3d 2d 31 3a 5f  55 25 21 32 39 36 3d 2d  |292=-1:_U%!296=-|
0000d4d0  31 0d 06 eb 1c 20 20 20  20 20 20 20 20 20 20 20  |1....           |
0000d4e0  e7 20 5f 51 25 21 31 36  3e 3d 30 20 8c 0d 06 ec  |. _Q%!16>=0 ....|
0000d4f0  4e 20 20 20 20 20 20 20  20 20 20 20 20 20 6f 66  |N             of|
0000d500  66 73 65 74 25 3d a4 73  68 65 6c 6c 5f 47 65 74  |fset%=.shell_Get|
0000d510  45 76 65 6e 74 4c 69 73  74 4f 66 66 73 65 74 28  |EventListOffset(|
0000d520  5f 51 25 21 31 32 2c 5f  51 25 21 31 36 2c 5f 55  |_Q%!12,_Q%!16,_U|
0000d530  25 2b 31 30 34 2c 31 36  2c 30 29 0d 06 ed 4d 20  |%+104,16,0)...M |
0000d540  20 20 20 20 20 20 20 20  20 20 20 20 e7 20 6f 66  |            . of|
0000d550  66 73 65 74 25 3e 3d 30  20 8c 20 f2 73 68 65 6c  |fset%>=0 . .shel|
0000d560  6c 5f 48 61 6e 64 6c 65  42 75 6d 70 49 63 6f 6e  |l_HandleBumpIcon|
0000d570  73 28 6f 66 66 73 65 74  25 2c 5f 51 25 21 31 32  |s(offset%,_Q%!12|
0000d580  2c 5f 51 25 21 31 36 29  0d 06 ee 10 20 20 20 20  |,_Q%!16)....    |
0000d590  20 20 20 20 20 20 20 cd  0d 06 ef 0e 20 20 20 20  |       .....    |
0000d5a0  20 20 20 20 20 cd 0d 06  f0 29 20 20 20 20 20 20  |     ....)      |
0000d5b0  20 20 20 f4 20 63 68 65  63 6b 20 66 69 72 73 74  |   . check first|
0000d5c0  20 66 6f 72 20 64 72 61  67 20 66 6c 61 67 21 0d  | for drag flag!.|
0000d5d0  06 f1 1b 20 20 20 20 20  20 20 20 20 e7 20 28 5f  |...         . (_|
0000d5e0  51 25 21 38 3d 36 34 29  20 8c 0d 06 f2 39 20 20  |Q%!8=64) ....9  |
0000d5f0  20 20 20 20 20 20 20 20  20 f4 20 6f 6e 6c 79 20  |         . only |
0000d600  63 68 65 63 6b 20 66 6f  72 20 53 45 4c 45 43 54  |check for SELECT|
0000d610  20 61 6e 64 20 41 44 4a  55 53 54 20 62 75 74 74  | and ADJUST butt|
0000d620  6f 6e 73 0d 06 f3 3c 20  20 20 20 20 20 20 20 20  |ons...<         |
0000d630  20 20 72 65 73 75 6c 74  25 3d a4 73 68 65 6c 6c  |  result%=.shell|
0000d640  5f 49 63 6f 6e 49 73 44  72 61 67 67 61 62 6c 65  |_IconIsDraggable|
0000d650  28 5f 51 25 21 31 32 2c  5f 51 25 21 31 36 29 0d  |(_Q%!12,_Q%!16).|
0000d660  06 f4 1a 20 20 20 20 20  20 20 20 20 20 20 e7 20  |...           . |
0000d670  72 65 73 75 6c 74 25 20  8c 0d 06 f5 2a 20 20 20  |result% ....*   |
0000d680  20 20 20 20 20 20 20 20  20 20 6d 65 73 73 24 3d  |          mess$=|
0000d690  22 49 63 6f 6e 20 69 73  20 64 72 61 67 67 61 62  |"Icon is draggab|
0000d6a0  6c 65 22 0d 06 f6 2b 20  20 20 20 20 20 20 20 20  |le"...+         |
0000d6b0  20 20 20 20 f4 20 73 6f  20 6e 6f 77 20 64 72 61  |    . so now dra|
0000d6c0  77 20 74 68 65 20 64 72  61 67 20 62 6f 78 0d 06  |w the drag box..|
0000d6d0  f7 32 20 20 20 20 20 20  20 20 20 20 20 20 20 f2  |.2             .|
0000d6e0  73 68 65 6c 6c 5f 49 63  6f 6e 44 72 61 67 42 6f  |shell_IconDragBo|
0000d6f0  78 28 5f 51 25 21 31 32  2c 5f 51 25 21 31 36 29  |x(_Q%!12,_Q%!16)|
0000d700  0d 06 f8 10 20 20 20 20  20 20 20 20 20 20 20 cc  |....           .|
0000d710  0d 06 f9 2e 20 20 20 20  20 20 20 20 20 20 20 20  |....            |
0000d720  20 6d 65 73 73 24 3d 22  49 63 6f 6e 20 69 73 20  | mess$="Icon is |
0000d730  6e 6f 74 20 64 72 61 67  67 61 62 6c 65 22 0d 06  |not draggable"..|
0000d740  fa 10 20 20 20 20 20 20  20 20 20 20 20 cd 0d 06  |..           ...|
0000d750  fb 2e 20 20 20 20 20 20  20 20 20 20 20 f2 73 68  |..           .sh|
0000d760  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 41 63 74  |ell_Tracef0("Act|
0000d770  69 6f 6e 3a 22 2b 6d 65  73 73 24 29 0d 06 fc 0e  |ion:"+mess$)....|
0000d780  20 20 20 20 20 20 20 20  20 cd 0d 06 fd 17 20 20  |         .....  |
0000d790  20 20 20 20 20 20 20 c8  8e 20 5f 51 25 21 38 20  |       .. _Q%!8 |
0000d7a0  ca 0d 06 fe 2c 20 20 20  20 20 20 20 20 20 20 20  |....,           |
0000d7b0  c9 20 34 3a f2 73 68 65  6c 6c 5f 41 63 74 69 6f  |. 4:.shell_Actio|
0000d7c0  6e 53 65 6c 65 63 74 42  75 74 74 6f 6e 0d 06 ff  |nSelectButton...|
0000d7d0  2a 20 20 20 20 20 20 20  20 20 20 20 c9 20 32 3a  |*           . 2:|
0000d7e0  f2 73 68 65 6c 6c 5f 41  63 74 69 6f 6e 4d 65 6e  |.shell_ActionMen|
0000d7f0  75 42 75 74 74 6f 6e 0d  07 00 2c 20 20 20 20 20  |uButton...,     |
0000d800  20 20 20 20 20 20 c9 20  31 3a f2 73 68 65 6c 6c  |      . 1:.shell|
0000d810  5f 41 63 74 69 6f 6e 41  64 6a 75 73 74 42 75 74  |_ActionAdjustBut|
0000d820  74 6f 6e 0d 07 01 0e 20  20 20 20 20 20 20 20 20  |ton....         |
0000d830  cb 0d 07 02 19 20 20 c9  20 37 3a e7 20 5f 55 25  |.....  . 7:. _U%|
0000d840  21 31 30 30 20 80 20 31  20 8c 0d 07 03 24 20 20  |!100 . 1 ....$  |
0000d850  20 20 20 20 20 20 20 20  20 c8 99 20 22 44 72 61  |         .. "Dra|
0000d860  67 41 53 70 72 69 74 65  5f 53 74 6f 70 22 0d 07  |gASprite_Stop"..|
0000d870  04 22 20 20 20 20 20 20  20 20 20 20 20 5f 55 25  |."           _U%|
0000d880  21 31 30 30 3d 5f 55 25  21 31 30 30 20 82 20 31  |!100=_U%!100 . 1|
0000d890  0d 07 05 0e 20 20 20 20  20 20 20 20 20 cd 0d 07  |....         ...|
0000d8a0  06 46 20 20 20 20 20 20  20 20 20 5f 55 25 21 31  |.F         _U%!1|
0000d8b0  32 38 3d 30 3a f4 20 73  65 74 20 52 41 4d 50 74  |28=0:. set RAMPt|
0000d8c0  72 25 20 74 6f 20 30 20  69 6e 20 63 61 73 65 20  |r% to 0 in case |
0000d8d0  61 20 52 41 4d 46 65 74  63 68 20 66 6f 6c 6c 6f  |a RAMFetch follo|
0000d8e0  77 73 2e 2e 0d 07 07 45  20 20 20 20 20 20 20 20  |ws.....E        |
0000d8f0  20 f4 20 68 61 76 65 20  74 6f 20 75 73 65 20 6c  | . have to use l|
0000d900  61 73 74 20 77 69 6e 64  6f 77 2f 69 63 6f 6e 20  |ast window/icon |
0000d910  68 61 6e 64 6c 65 73 20  66 72 6f 6d 20 5f 55 25  |handles from _U%|
0000d920  20 62 6c 6f 63 6b 20 61  73 0d 07 08 3f 20 20 20  | block as...?   |
0000d930  20 20 20 20 20 20 f4 20  5f 51 25 20 62 6c 6f 63  |      . _Q% bloc|
0000d940  6b 20 63 6f 75 6c 64 20  62 65 20 63 6f 72 72 75  |k could be corru|
0000d950  70 74 65 64 20 62 79 20  6f 74 68 65 72 20 70 6f  |pted by other po|
0000d960  6c 6c 20 63 61 6c 6c 73  0d 07 09 38 20 20 20 20  |ll calls...8    |
0000d970  20 20 20 20 20 66 6e 24  3d a4 73 68 65 6c 6c 5f  |     fn$=.shell_|
0000d980  47 65 74 45 76 65 6e 74  48 61 6e 64 6c 65 72 28  |GetEventHandler(|
0000d990  5f 55 25 21 32 38 2c 5f  55 25 21 33 32 2c 36 29  |_U%!28,_U%!32,6)|
0000d9a0  0d 07 0a 18 20 20 20 20  20 20 20 20 20 e7 20 66  |....         . f|
0000d9b0  6e 24 3c 3e 22 22 20 8c  0d 07 0b 4e 20 20 20 20  |n$<>"" ....N    |
0000d9c0  20 20 20 20 20 20 20 f2  73 68 65 6c 6c 5f 54 72  |       .shell_Tr|
0000d9d0  61 63 65 66 30 28 22 41  63 74 69 6f 6e 3a 44 72  |acef0("Action:Dr|
0000d9e0  61 67 20 65 76 65 6e 74  20 64 65 74 65 63 74 65  |ag event detecte|
0000d9f0  64 20 2d 20 66 75 6e 63  74 69 6f 6e 20 69 73 20  |d - function is |
0000da00  22 2b 66 6e 24 29 0d 07  0c 36 20 20 20 20 20 20  |"+fn$)...6      |
0000da10  20 20 20 20 20 76 6f 69  64 25 3d a0 28 22 46 4e  |     void%=.("FN|
0000da20  22 2b 66 6e 24 2b 22 28  5f 74 65 6d 70 32 38 25  |"+fn$+"(_temp28%|
0000da30  2c 5f 74 65 6d 70 33 32  25 29 22 29 0d 07 0d 0e  |,_temp32%)")....|
0000da40  20 20 20 20 20 20 20 20  20 cc 0d 07 0e 51 20 20  |         ....Q  |
0000da50  20 20 20 20 20 20 20 20  20 f2 73 68 65 6c 6c 5f  |         .shell_|
0000da60  54 72 61 63 65 66 30 28  22 41 63 74 69 6f 6e 3a  |Tracef0("Action:|
0000da70  44 72 61 67 20 65 76 65  6e 74 20 64 65 74 65 63  |Drag event detec|
0000da80  74 65 64 20 2d 20 6e 6f  20 68 61 6e 64 6c 65 72  |ted - no handler|
0000da90  20 66 75 6e 63 74 69 6f  6e 22 29 0d 07 0f 28 20  | function")...( |
0000daa0  20 20 20 20 20 20 20 20  20 20 f4 20 73 65 74 20  |          . set |
0000dab0  75 70 20 64 61 74 61 73  61 76 65 20 6d 65 73 73  |up datasave mess|
0000dac0  61 67 65 0d 07 10 31 20  20 20 20 20 20 20 20 20  |age...1         |
0000dad0  20 20 f2 73 68 65 6c 6c  5f 53 65 6e 64 44 61 74  |  .shell_SendDat|
0000dae0  61 53 61 76 65 28 5f 55  25 21 32 38 2c 5f 55 25  |aSave(_U%!28,_U%|
0000daf0  21 33 32 29 0d 07 11 0e  20 20 20 20 20 20 20 20  |!32)....        |
0000db00  20 cd 0d 07 12 0a 20 20  c9 20 38 3a 0d 07 13 3a  | .....  . 8:...:|
0000db10  20 20 20 20 20 20 20 20  20 f2 73 68 65 6c 6c 5f  |         .shell_|
0000db20  54 72 61 63 65 66 30 28  22 41 63 74 69 6f 6e 3a  |Tracef0("Action:|
0000db30  6b 65 79 70 72 65 73 73  20 69 73 3d 22 2b c3 5f  |keypress is="+._|
0000db40  51 25 21 32 34 29 0d 07  14 18 20 20 20 20 20 20  |Q%!24)....      |
0000db50  20 20 20 c8 8e 20 5f 51  25 21 32 34 20 ca 0d 07  |   .. _Q%!24 ...|
0000db60  15 1a 20 20 20 20 20 20  20 20 20 c9 20 26 30 44  |..         . &0D|
0000db70  2c 33 39 38 2c 33 39 39  0d 07 16 47 20 20 20 20  |,398,399...G    |
0000db80  20 20 20 20 20 20 20 63  6c 61 69 6d 65 64 25 3d  |       claimed%=|
0000db90  a4 73 68 65 6c 6c 5f 57  72 69 74 65 61 62 6c 65  |.shell_Writeable|
0000dba0  49 63 6f 6e 48 61 6e 64  6c 65 72 28 5f 51 25 21  |IconHandler(_Q%!|
0000dbb0  30 2c 5f 51 25 21 34 2c  5f 51 25 21 32 34 29 0d  |0,_Q%!4,_Q%!24).|
0000dbc0  07 17 0e 20 20 20 20 20  20 20 20 20 7f 0d 07 18  |...         ....|
0000dbd0  34 20 20 20 20 20 20 20  20 20 20 20 63 6c 61 69  |4           clai|
0000dbe0  6d 65 64 25 3d a4 73 68  65 6c 6c 5f 48 6f 74 4b  |med%=.shell_HotK|
0000dbf0  65 79 50 72 6f 63 65 73  73 28 5f 51 25 21 32 34  |eyProcess(_Q%!24|
0000dc00  29 0d 07 19 0e 20 20 20  20 20 20 20 20 20 cb 0d  |)....         ..|
0000dc10  07 1a 1b 20 20 20 20 20  20 20 20 20 e7 20 ac 20  |...         . . |
0000dc20  63 6c 61 69 6d 65 64 25  20 8c 0d 07 1b 4b 20 20  |claimed% ....K  |
0000dc30  20 20 20 20 20 20 20 20  20 f2 73 68 65 6c 6c 5f  |         .shell_|
0000dc40  54 72 61 63 65 66 30 28  22 41 63 74 69 6f 6e 3a  |Tracef0("Action:|
0000dc50  4b 65 79 70 72 65 73 73  20 6e 6f 74 20 63 6c 61  |Keypress not cla|
0000dc60  69 6d 65 64 2c 20 70 61  73 73 69 6e 67 20 69 74  |imed, passing it|
0000dc70  20 6f 6e 22 29 0d 07 1c  2a 20 20 20 20 20 20 20  | on")...*       |
0000dc80  20 20 20 20 c8 99 20 22  57 69 6d 70 5f 50 72 6f  |    .. "Wimp_Pro|
0000dc90  63 65 73 73 4b 65 79 22  2c 5f 51 25 21 32 34 0d  |cessKey",_Q%!24.|
0000dca0  07 1d 0e 20 20 20 20 20  20 20 20 20 cc 0d 07 1e  |...         ....|
0000dcb0  4c 20 20 20 20 20 20 20  20 20 20 20 f2 73 68 65  |L           .she|
0000dcc0  6c 6c 5f 54 72 61 63 65  66 30 28 22 41 63 74 69  |ll_Tracef0("Acti|
0000dcd0  6f 6e 3a 4b 65 79 70 72  65 73 73 20 63 6c 61 69  |on:Keypress clai|
0000dce0  6d 65 64 20 62 79 20 74  68 69 73 20 61 70 70 6c  |med by this appl|
0000dcf0  69 63 61 74 69 6f 6e 22  29 0d 07 1f 0e 20 20 20  |ication")....   |
0000dd00  20 20 20 20 20 20 cd 0d  07 20 26 20 20 c9 20 39  |      ... &  . 9|
0000dd10  3a f2 73 68 65 6c 6c 5f  41 63 74 69 6f 6e 4d 65  |:.shell_ActionMe|
0000dd20  6e 75 53 65 6c 65 63 74  28 5f 51 25 29 0d 07 21  |nuSelect(_Q%)..!|
0000dd30  21 20 20 c9 20 31 37 2c  31 38 3a f2 73 68 65 6c  |!  . 17,18:.shel|
0000dd40  6c 5f 52 65 63 65 69 76  65 28 5f 51 25 29 0d 07  |l_Receive(_Q%)..|
0000dd50  22 30 20 20 c9 20 31 39  20 20 20 3a f2 73 68 65  |"0  . 19   :.she|
0000dd60  6c 6c 5f 55 73 65 72 4d  65 73 73 61 67 65 41 63  |ll_UserMessageAc|
0000dd70  6b 6e 6f 77 6c 65 64 67  65 28 5f 51 25 29 0d 07  |knowledge(_Q%)..|
0000dd80  23 05 cb 0d 07 24 05 e1  0d 07 25 05 3a 0d 07 26  |#....$....%.:..&|
0000dd90  1b 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  |.*|Stop PROCshel|
0000dda0  6c 5f 41 63 74 69 6f 6e  0d 07 27 04 0d 07 28 28  |l_Action..'...((|
0000ddb0  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
0000ddc0  6c 5f 41 63 74 69 6f 6e  53 65 6c 65 63 74 42 75  |l_ActionSelectBu|
0000ddd0  74 74 6f 6e 0d 07 29 1f  dd 20 f2 73 68 65 6c 6c  |tton..).. .shell|
0000dde0  5f 41 63 74 69 6f 6e 53  65 6c 65 63 74 42 75 74  |_ActionSelectBut|
0000ddf0  74 6f 6e 0d 07 2a 40 f2  73 68 65 6c 6c 5f 54 72  |ton..*@.shell_Tr|
0000de00  61 63 65 66 30 28 22 41  63 74 69 6f 6e 53 65 6c  |acef0("ActionSel|
0000de10  65 63 74 42 75 74 74 6f  6e 3a 4d 6f 75 73 65 20  |ectButton:Mouse |
0000de20  42 75 74 74 6f 6e 20 77  61 73 20 53 45 4c 45 43  |Button was SELEC|
0000de30  54 22 29 0d 07 2b 30 f2  73 68 65 6c 6c 5f 48 61  |T")..+0.shell_Ha|
0000de40  6e 64 6c 65 41 74 74 61  63 68 65 64 4d 65 6e 75  |ndleAttachedMenu|
0000de50  28 5f 51 25 2c 5f 55 25  21 32 38 2c 5f 55 25 21  |(_Q%,_U%!28,_U%!|
0000de60  33 32 29 0d 07 2c 2f 66  6e 24 3d a4 73 68 65 6c  |32)..,/fn$=.shel|
0000de70  6c 5f 47 65 74 45 76 65  6e 74 48 61 6e 64 6c 65  |l_GetEventHandle|
0000de80  72 28 5f 55 25 21 32 38  2c 5f 55 25 21 33 32 2c  |r(_U%!28,_U%!32,|
0000de90  32 29 0d 07 2d 35 f4 20  63 68 65 63 6b 20 66 69  |2)..-5. check fi|
0000dea0  6c 65 6e 61 6d 65 20 69  6e 20 69 63 6f 6e 20 69  |lename in icon i|
0000deb0  66 20 64 61 74 61 73 61  76 65 20 65 76 65 6e 74  |f datasave event|
0000dec0  20 65 78 69 73 74 73 0d  07 2e 10 e7 20 5f 55 25  | exists..... _U%|
0000ded0  21 33 32 3d 30 20 8c 0d  07 2f 17 20 20 f4 20 69  |!32=0 .../.  . i|
0000dee0  63 6f 6e 20 77 61 73 20  30 2e 2e 2e 2e 2e 0d 07  |con was 0.......|
0000def0  30 2d 20 20 f2 73 68 65  6c 6c 5f 44 61 74 61 53  |0-  .shell_DataS|
0000df00  61 76 65 43 68 65 63 6b  4e 61 6d 65 28 5f 55 25  |aveCheckName(_U%|
0000df10  21 32 38 2c 5f 55 25 21  33 32 29 0d 07 31 05 cd  |!28,_U%!32)..1..|
0000df20  0d 07 32 0f e7 20 66 6e  24 3c 3e 22 22 20 8c 0d  |..2.. fn$<>"" ..|
0000df30  07 33 26 20 20 f2 73 68  65 6c 6c 5f 49 63 6f 6e  |.3&  .shell_Icon|
0000df40  53 6c 61 62 28 34 2c 5f  55 25 21 32 38 2c 5f 55  |Slab(4,_U%!28,_U|
0000df50  25 21 33 32 29 0d 07 34  18 20 20 2a 7c 69 66 64  |%!32)..4.  *|ifd|
0000df60  65 66 20 54 72 61 63 65  5f 49 6e 69 74 0d 07 35  |ef Trace_Init..5|
0000df70  62 20 20 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |b  .shell_Tracef|
0000df80  30 28 22 41 63 74 69 6f  6e 53 65 6c 65 63 74 42  |0("ActionSelectB|
0000df90  75 74 74 6f 6e 3a 41 62  6f 75 74 20 74 6f 20 63  |utton:About to c|
0000dfa0  61 6c 6c 20 22 2b 22 46  4e 22 2b 66 6e 24 2b 22  |all "+"FN"+fn$+"|
0000dfb0  28 22 2b c3 5f 74 65 6d  70 32 38 25 2b 22 2c 22  |("+._temp28%+","|
0000dfc0  2b c3 5f 74 65 6d 70 33  32 25 2b 22 29 22 29 0d  |+._temp32%+")").|
0000dfd0  07 36 0d 20 20 2a 7c 65  6e 64 69 66 0d 07 37 2d  |.6.  *|endif..7-|
0000dfe0  20 20 76 6f 69 64 25 3d  a0 28 22 46 4e 22 2b 66  |  void%=.("FN"+f|
0000dff0  6e 24 2b 22 28 5f 74 65  6d 70 32 38 25 2c 5f 74  |n$+"(_temp28%,_t|
0000e000  65 6d 70 33 32 25 29 22  29 0d 07 38 05 cd 0d 07  |emp32%)")..8....|
0000e010  39 3c f4 20 69 66 20 69  63 6f 6e 20 77 61 73 20  |9<. if icon was |
0000e020  30 20 61 6e 64 20 64 62  6f 78 20 69 73 20 64 79  |0 and dbox is dy|
0000e030  6e 61 6d 69 63 20 74 68  65 6e 20 63 6c 6f 73 65  |namic then close|
0000e040  20 64 62 6f 78 2f 6d 65  6e 75 0d 07 3a 10 e7 20  | dbox/menu..:.. |
0000e050  5f 55 25 21 33 32 3d 30  20 8c 0d 07 3b 17 20 20  |_U%!32=0 ...;.  |
0000e060  e7 20 5f 55 25 21 32 38  3d 5f 55 25 21 32 30 20  |. _U%!28=_U%!20 |
0000e070  8c 0d 07 3c 20 20 20 20  20 c8 99 20 22 57 69 6d  |...<     .. "Wim|
0000e080  70 5f 43 72 65 61 74 65  4d 65 6e 75 22 2c 2c 2d  |p_CreateMenu",,-|
0000e090  31 0d 07 3d 07 20 20 cd  0d 07 3e 05 cd 0d 07 3f  |1..=.  ...>....?|
0000e0a0  05 e1 0d 07 40 27 2a 7c  53 74 6f 70 20 50 52 4f  |....@'*|Stop PRO|
0000e0b0  43 73 68 65 6c 6c 5f 41  63 74 69 6f 6e 53 65 6c  |Cshell_ActionSel|
0000e0c0  65 63 74 42 75 74 74 6f  6e 0d 07 41 04 0d 07 42  |ectButton..A...B|
0000e0d0  26 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |&*|Start PROCshe|
0000e0e0  6c 6c 5f 41 63 74 69 6f  6e 4d 65 6e 75 42 75 74  |ll_ActionMenuBut|
0000e0f0  74 6f 6e 0d 07 43 1d dd  20 f2 73 68 65 6c 6c 5f  |ton..C.. .shell_|
0000e100  41 63 74 69 6f 6e 4d 65  6e 75 42 75 74 74 6f 6e  |ActionMenuButton|
0000e110  0d 07 44 11 ea 20 74 65  6d 70 25 2c 6d 65 6e 75  |..D.. temp%,menu|
0000e120  25 0d 07 45 1f 2a 7c 69  66 64 65 66 20 50 52 4f  |%..E.*|ifdef PRO|
0000e130  43 73 68 65 6c 6c 5f 54  72 61 63 65 49 6e 69 74  |Cshell_TraceInit|
0000e140  0d 07 46 3c f2 73 68 65  6c 6c 5f 54 72 61 63 65  |..F<.shell_Trace|
0000e150  66 30 28 22 41 63 74 69  6f 6e 4d 65 6e 75 42 75  |f0("ActionMenuBu|
0000e160  74 74 6f 6e 3a 4d 6f 75  73 65 20 42 75 74 74 6f  |tton:Mouse Butto|
0000e170  6e 20 77 61 73 20 4d 45  4e 55 22 29 0d 07 47 0b  |n was MENU")..G.|
0000e180  2a 7c 65 6e 64 69 66 0d  07 48 0b 74 65 6d 70 25  |*|endif..H.temp%|
0000e190  3d b9 0d 07 49 32 e7 20  a6 28 2d 31 29 20 8c 20  |=...I2. .(-1) . |
0000e1a0  74 65 6d 70 25 3d a4 73  68 69 66 74 6d 65 6e 75  |temp%=.shiftmenu|
0000e1b0  63 6c 69 63 6b 28 5f 51  25 21 31 32 2c 5f 51 25  |click(_Q%!12,_Q%|
0000e1c0  21 31 36 29 0d 07 4a 0d  e7 20 74 65 6d 70 25 20  |!16)..J.. temp% |
0000e1d0  8c 0d 07 4b 3f 20 20 f2  73 68 65 6c 6c 5f 54 72  |...K?  .shell_Tr|
0000e1e0  61 63 65 66 30 28 22 41  63 74 69 6f 6e 4d 65 6e  |acef0("ActionMen|
0000e1f0  75 42 75 74 74 6f 6e 3a  43 68 65 63 6b 69 6e 67  |uButton:Checking|
0000e200  20 6d 65 6e 75 20 65 76  65 6e 74 73 2e 2e 22 29  | menu events..")|
0000e210  0d 07 4c 34 20 20 6d 65  6e 75 25 3d a4 73 68 65  |..L4  menu%=.she|
0000e220  6c 6c 5f 47 65 74 45 76  65 6e 74 4d 65 6e 75 28  |ll_GetEventMenu(|
0000e230  5f 51 25 21 38 2c 5f 51  25 21 31 32 2c 5f 51 25  |_Q%!8,_Q%!12,_Q%|
0000e240  21 31 36 29 0d 07 4d 3f  20 20 f2 73 68 65 6c 6c  |!16)..M?  .shell|
0000e250  5f 54 72 61 63 65 66 30  28 22 41 63 74 69 6f 6e  |_Tracef0("Action|
0000e260  4d 65 6e 75 42 75 74 74  6f 6e 3a 4d 65 6e 75 20  |MenuButton:Menu |
0000e270  68 61 6e 64 6c 65 20 69  73 3a 22 2b c3 6d 65 6e  |handle is:"+.men|
0000e280  75 25 29 0d 07 4e 12 20  20 e7 20 6d 65 6e 75 25  |u%)..N.  . menu%|
0000e290  3c 3e 30 20 8c 0d 07 4f  2a 20 20 20 20 f2 73 68  |<>0 ...O*    .sh|
0000e2a0  65 6c 6c 5f 4f 70 65 6e  4d 65 6e 75 28 5f 51 25  |ell_OpenMenu(_Q%|
0000e2b0  21 30 2c 5f 51 25 21 34  2c 6d 65 6e 75 25 29 0d  |!0,_Q%!4,menu%).|
0000e2c0  07 50 14 20 20 20 20 5f  55 25 21 32 34 3d 6d 65  |.P.    _U%!24=me|
0000e2d0  6e 75 25 0d 07 51 2d 20  20 20 20 5f 55 25 21 33  |nu%..Q-    _U%!3|
0000e2e0  36 3d 5f 51 25 21 30 30  3a f4 20 73 74 6f 72 65  |6=_Q%!00:. store|
0000e2f0  20 6d 65 6e 75 20 78 20  70 6f 73 69 74 69 6f 6e  | menu x position|
0000e300  0d 07 52 2d 20 20 20 20  5f 55 25 21 34 30 3d 5f  |..R-    _U%!40=_|
0000e310  51 25 21 30 34 3a f4 20  73 74 6f 72 65 20 6d 65  |Q%!04:. store me|
0000e320  6e 75 20 79 20 70 6f 73  69 74 69 6f 6e 0d 07 53  |nu y position..S|
0000e330  24 20 20 20 20 5f 55 25  21 35 32 3d 5f 55 25 21  |$    _U%!52=_U%!|
0000e340  32 38 3a f4 20 73 74 6f  72 65 20 77 69 6e 64 6f  |28:. store windo|
0000e350  77 0d 07 54 22 20 20 20  20 5f 55 25 21 35 36 3d  |w..T"    _U%!56=|
0000e360  5f 55 25 21 33 32 3a f4  20 73 74 6f 72 65 20 69  |_U%!32:. store i|
0000e370  63 6f 6e 0d 07 55 07 20  20 cd 0d 07 56 05 cd 0d  |con..U.  ...V...|
0000e380  07 57 05 e1 0d 07 58 05  3a 0d 07 59 25 2a 7c 53  |.W....X.:..Y%*|S|
0000e390  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 41 63  |top PROCshell_Ac|
0000e3a0  74 69 6f 6e 4d 65 6e 75  42 75 74 74 6f 6e 0d 07  |tionMenuButton..|
0000e3b0  5a 04 0d 07 5b 26 2a 7c  53 74 61 72 74 20 50 52  |Z...[&*|Start PR|
0000e3c0  4f 43 73 68 65 6c 6c 5f  41 63 74 69 6f 6e 4d 65  |OCshell_ActionMe|
0000e3d0  6e 75 53 65 6c 65 63 74  0d 07 5c 22 dd 20 f2 73  |nuSelect..\". .s|
0000e3e0  68 65 6c 6c 5f 41 63 74  69 6f 6e 4d 65 6e 75 53  |hell_ActionMenuS|
0000e3f0  65 6c 65 63 74 28 5f 51  25 29 0d 07 5d 43 ea 20  |elect(_Q%)..]C. |
0000e400  68 61 6e 64 6c 65 72 25  2c 6d 65 6e 75 5f 62 75  |handler%,menu_bu|
0000e410  66 66 65 72 25 2c 43 68  65 63 6b 53 65 6c 65 63  |ffer%,CheckSelec|
0000e420  74 25 2c 66 6f 6e 74 6d  65 6e 75 66 6c 61 67 25  |t%,fontmenuflag%|
0000e430  2c 76 6f 69 64 25 2c 68  5f 62 6c 6b 25 0d 07 5e  |,void%,h_blk%..^|
0000e440  25 68 5f 62 6c 6b 25 3d  a4 73 68 65 6c 6c 5f 48  |%h_blk%=.shell_H|
0000e450  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 32 35  |eapBlockFetch(25|
0000e460  36 29 0d 07 5f 1f 2a 7c  69 66 64 65 66 20 50 52  |6).._.*|ifdef PR|
0000e470  4f 43 73 68 65 6c 6c 5f  54 72 61 63 65 49 6e 69  |OCshell_TraceIni|
0000e480  74 0d 07 60 41 f2 73 68  65 6c 6c 5f 54 72 61 63  |t..`A.shell_Trac|
0000e490  65 66 30 28 22 41 63 74  69 6f 6e 4d 65 6e 75 53  |ef0("ActionMenuS|
0000e4a0  65 6c 65 63 74 3a 4d 65  6e 75 5f 53 65 6c 65 63  |elect:Menu_Selec|
0000e4b0  74 20 65 76 65 6e 74 20  64 65 74 65 63 74 65 64  |t event detected|
0000e4c0  22 29 0d 07 61 0b 2a 7c  65 6e 64 69 66 0d 07 62  |")..a.*|endif..b|
0000e4d0  29 c8 99 20 22 57 69 6d  70 5f 47 65 74 50 6f 69  |).. "Wimp_GetPoi|
0000e4e0  6e 74 65 72 49 6e 66 6f  22 2c 2c 5f 73 68 65 6c  |nterInfo",,_shel|
0000e4f0  6c 5f 62 6c 6b 25 0d 07  63 1a 2a 7c 69 66 64 65  |l_blk%..c.*|ifde|
0000e500  66 20 55 73 69 6e 67 5f  46 6f 6e 74 4d 65 6e 75  |f Using_FontMenu|
0000e510  0d 07 64 2b 6d 65 6e 75  5f 62 75 66 66 65 72 25  |..d+menu_buffer%|
0000e520  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
0000e530  6b 46 65 74 63 68 28 32  35 36 29 0d 07 65 16 e7  |kFetch(256)..e..|
0000e540  20 5f 55 25 21 32 34 3d  5f 55 25 21 32 35 32 20  | _U%!24=_U%!252 |
0000e550  8c 0d 07 66 22 20 20 f4  20 43 75 72 72 65 6e 74  |...f"  . Current|
0000e560  20 6d 65 6e 75 20 69 73  20 46 6f 6e 74 4d 65 6e  | menu is FontMen|
0000e570  75 2e 2e 0d 07 67 1e 20  20 43 68 65 63 6b 53 65  |u....g.  CheckSe|
0000e580  6c 65 63 74 25 3d 30 3a  5f 55 25 21 32 36 34 3d  |lect%=0:_U%!264=|
0000e590  31 0d 07 68 05 cc 0d 07  69 2d 20 20 43 68 65 63  |1..h....i-  Chec|
0000e5a0  6b 53 65 6c 65 63 74 25  3d a4 73 68 65 6c 6c 5f  |kSelect%=.shell_|
0000e5b0  43 68 65 63 6b 53 65 6c  65 63 74 69 6f 6e 28 5f  |CheckSelection(_|
0000e5c0  51 25 29 0d 07 6a 2f 20  20 e7 20 43 68 65 63 6b  |Q%)..j/  . Check|
0000e5d0  53 65 6c 65 63 74 25 3e  2d 31 20 8c 20 5f 55 25  |Select%>-1 . _U%|
0000e5e0  21 32 36 34 3d 31 20 8b  20 5f 55 25 21 32 36 34  |!264=1 . _U%!264|
0000e5f0  3d 30 0d 07 6b 05 cd 0d  07 6c 11 e7 20 5f 55 25  |=0..k....l.. _U%|
0000e600  21 32 36 34 3e 30 20 8c  0d 07 6d 50 20 20 c8 99  |!264>0 ...mP  ..|
0000e610  20 22 46 6f 6e 74 4d 65  6e 75 5f 44 65 63 6f 64  | "FontMenu_Decod|
0000e620  65 46 6f 6e 74 4d 65 6e  75 22 2c 5f 51 25 2b 43  |eFontMenu",_Q%+C|
0000e630  68 65 63 6b 53 65 6c 65  63 74 25 2c 6d 65 6e 75  |heckSelect%,menu|
0000e640  5f 62 75 66 66 65 72 25  20 b8 20 66 6f 6e 74 6d  |_buffer% . fontm|
0000e650  65 6e 75 66 6c 61 67 25  0d 07 6e 19 20 20 e7 20  |enuflag%..n.  . |
0000e660  66 6f 6e 74 6d 65 6e 75  66 6c 61 67 25 3d 31 20  |fontmenuflag%=1 |
0000e670  8c 0d 07 6f 25 20 20 20  20 f4 20 27 73 65 6e 73  |...o%    . 'sens|
0000e680  69 62 6c 65 27 20 73 65  6c 65 63 74 69 6f 6e 20  |ible' selection |
0000e690  6d 61 64 65 2e 2e 0d 07  70 23 20 20 20 20 2a 7c  |made....p#    *||
0000e6a0  69 66 64 65 66 20 50 52  4f 43 73 68 65 6c 6c 5f  |ifdef PROCshell_|
0000e6b0  54 72 61 63 65 49 6e 69  74 0d 07 71 62 20 20 20  |TraceInit..qb   |
0000e6c0  20 f2 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  | .shell_Tracef0(|
0000e6d0  22 41 63 74 69 6f 6e 4d  65 6e 75 53 65 6c 65 63  |"ActionMenuSelec|
0000e6e0  74 3a 46 6f 6e 74 4d 65  6e 75 20 73 65 6c 65 63  |t:FontMenu selec|
0000e6f0  74 69 6f 6e 20 28 22 2b  a4 73 68 65 6c 6c 5f 47  |tion ("+.shell_G|
0000e700  65 74 53 74 72 69 6e 67  28 6d 65 6e 75 5f 62 75  |etString(menu_bu|
0000e710  66 66 65 72 25 29 2b 22  29 22 29 0d 07 72 0f 20  |ffer%)+")")..r. |
0000e720  20 20 20 2a 7c 65 6e 64  69 66 0d 07 73 49 20 20  |   *|endif..sI  |
0000e730  20 20 f2 73 68 65 6c 6c  5f 46 6f 6e 74 4d 65 6e  |  .shell_FontMen|
0000e740  75 53 65 6c 65 63 74 46  6f 6e 74 28 a4 73 68 65  |uSelectFont(.she|
0000e750  6c 6c 5f 47 65 74 53 74  72 69 6e 67 28 6d 65 6e  |ll_GetString(men|
0000e760  75 5f 62 75 66 66 65 72  25 29 2c 5f 55 25 21 32  |u_buffer%),_U%!2|
0000e770  36 30 29 0d 07 74 24 20  20 20 20 e7 20 5f 73 68  |60)..t$    . _sh|
0000e780  65 6c 6c 5f 46 6f 6e 74  4d 65 6e 75 53 65 6c 46  |ell_FontMenuSelF|
0000e790  4e 24 3d 22 22 20 8c 0d  07 75 37 20 20 20 20 20  |N$="" ...u7     |
0000e7a0  20 c8 99 20 22 57 69 6d  70 5f 44 65 63 6f 64 65  | .. "Wimp_Decode|
0000e7b0  4d 65 6e 75 22 2c 2c 5f  55 25 21 32 34 2c 5f 51  |Menu",,_U%!24,_Q|
0000e7c0  25 2c 6d 65 6e 75 5f 62  75 66 66 65 72 25 0d 07  |%,menu_buffer%..|
0000e7d0  76 35 20 20 20 20 20 20  66 6e 24 3d a4 73 68 65  |v5      fn$=.she|
0000e7e0  6c 6c 5f 47 65 74 45 76  65 6e 74 48 61 6e 64 6c  |ll_GetEventHandl|
0000e7f0  65 72 28 5f 55 25 21 35  32 2c 5f 55 25 21 35 36  |er(_U%!52,_U%!56|
0000e800  2c 30 29 0d 07 77 1d 20  20 20 20 20 20 5f 74 65  |,0)..w.      _te|
0000e810  6d 70 25 3d 6d 65 6e 75  5f 62 75 66 66 65 72 25  |mp%=menu_buffer%|
0000e820  0d 07 78 39 20 20 20 20  20 20 24 5f 74 65 6d 70  |..x9      $_temp|
0000e830  25 3d a4 73 68 65 6c 6c  5f 53 74 72 69 6e 67 53  |%=.shell_StringS|
0000e840  74 72 69 70 54 72 61 69  6c 69 6e 67 28 24 5f 74  |tripTrailing($_t|
0000e850  65 6d 70 25 2c 22 20 22  29 0d 07 79 33 20 20 20  |emp%," ")..y3   |
0000e860  20 20 20 e7 20 66 6e 24  3c 3e 22 22 20 8c 20 76  |   . fn$<>"" . v|
0000e870  6f 69 64 25 3d a0 28 22  46 4e 22 2b 66 6e 24 2b  |oid%=.("FN"+fn$+|
0000e880  22 28 24 5f 74 65 6d 70  25 29 22 29 0d 07 7a 09  |"($_temp%)")..z.|
0000e890  20 20 20 20 cc 0d 07 7b  27 20 20 20 20 20 20 e7  |    ...{'      .|
0000e8a0  20 5f 73 68 65 6c 6c 5f  46 6f 6e 74 4d 65 6e 75  | _shell_FontMenu|
0000e8b0  53 65 6c 46 4e 24 3c 3e  22 22 20 8c 0d 07 7c 57  |SelFN$<>"" ...|W|
0000e8c0  20 20 20 20 20 20 20 20  76 6f 69 64 25 3d a0 28  |        void%=.(|
0000e8d0  22 46 4e 22 2b 5f 73 68  65 6c 6c 5f 46 6f 6e 74  |"FN"+_shell_Font|
0000e8e0  4d 65 6e 75 53 65 6c 46  4e 24 2b 22 28 46 4e 73  |MenuSelFN$+"(FNs|
0000e8f0  68 65 6c 6c 5f 46 6f 6e  74 4d 65 6e 75 47 65 74  |hell_FontMenuGet|
0000e900  4c 61 73 74 53 65 6c 65  63 74 65 64 46 6f 6e 74  |LastSelectedFont|
0000e910  29 22 29 0d 07 7d 0b 20  20 20 20 20 20 cd 0d 07  |)")..}.      ...|
0000e920  7e 09 20 20 20 20 cd 0d  07 7f 07 20 20 cd 0d 07  |~.    .....  ...|
0000e930  80 05 cd 0d 07 81 28 f2  73 68 65 6c 6c 5f 48 65  |......(.shell_He|
0000e940  61 70 42 6c 6f 63 6b 52  65 74 75 72 6e 28 6d 65  |apBlockReturn(me|
0000e950  6e 75 5f 62 75 66 66 65  72 25 29 0d 07 82 0b 2a  |nu_buffer%)....*|
0000e960  7c 65 6e 64 69 66 0d 07  83 11 e7 20 5f 55 25 21  ||endif..... _U%!|
0000e970  32 36 34 3d 30 20 8c 0d  07 84 38 20 20 c8 99 20  |264=0 ....8  .. |
0000e980  22 4d 65 6e 75 55 74 69  6c 5f 44 65 63 6f 64 65  |"MenuUtil_Decode|
0000e990  22 2c 5f 55 25 21 32 34  2c 5f 51 25 20 b8 20 68  |",_U%!24,_Q% . h|
0000e9a0  61 6e 64 6c 65 72 25 2c  2c 68 5f 62 6c 6b 25 0d  |andler%,,h_blk%.|
0000e9b0  07 85 3a 20 20 e7 20 68  61 6e 64 6c 65 72 25 20  |..:  . handler% |
0000e9c0  8c 20 f2 73 68 65 6c 6c  5f 4d 65 6e 75 43 61 6c  |. .shell_MenuCal|
0000e9d0  6c 48 61 6e 64 6c 65 72  28 68 61 6e 64 6c 65 72  |lHandler(handler|
0000e9e0  25 2c 68 5f 62 6c 6b 25  29 0d 07 86 05 cd 0d 07  |%,h_blk%).......|
0000e9f0  87 17 e7 20 5f 73 68 65  6c 6c 5f 62 6c 6b 25 21  |... _shell_blk%!|
0000ea00  38 3d 31 20 8c 0d 07 88  2c 20 20 f2 73 68 65 6c  |8=1 ....,  .shel|
0000ea10  6c 5f 54 72 61 63 65 66  30 28 22 48 49 4c 4b 45  |l_Tracef0("HILKE|
0000ea20  3a 3a 41 64 6a 75 73 74  20 62 75 74 74 6f 6e 22  |::Adjust button"|
0000ea30  29 0d 07 89 29 20 20 e7  20 a4 73 68 65 6c 6c 5f  |)...)  . .shell_|
0000ea40  48 65 61 70 42 6c 6f 63  6b 45 78 69 73 74 73 28  |HeapBlockExists(|
0000ea50  5f 55 25 21 32 32 34 29  20 8c 0d 07 8a 36 20 20  |_U%!224) ....6  |
0000ea60  20 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |  .shell_Tracef0|
0000ea70  28 22 48 49 4c 4b 45 3a  3a 53 74 6f 72 65 64 20  |("HILKE::Stored |
0000ea80  77 61 72 6e 5f 66 6e 20  65 78 69 73 74 73 22 29  |warn_fn exists")|
0000ea90  0d 07 8b 16 20 20 20 20  5f 74 65 6d 70 25 3d 5f  |....    _temp%=_|
0000eaa0  55 25 21 32 32 34 0d 07  8c 17 20 20 20 20 e7 20  |U%!224....    . |
0000eab0  24 5f 74 65 6d 70 25 3c  3e 22 22 20 8c 0d 07 8d  |$_temp%<>"" ....|
0000eac0  24 20 20 20 20 20 20 f4  20 43 61 6c 6c 20 6c 61  |$      . Call la|
0000ead0  73 74 20 6d 65 6e 75 77  61 72 6e 69 6e 67 20 66  |st menuwarning f|
0000eae0  6e 0d 07 8e 45 20 20 20  20 20 20 f2 73 68 65 6c  |n...E      .shel|
0000eaf0  6c 5f 54 72 61 63 65 66  30 28 22 48 49 4c 4b 45  |l_Tracef0("HILKE|
0000eb00  3a 3a 43 61 6c 6c 69 6e  67 20 6c 61 73 74 20 77  |::Calling last w|
0000eb10  61 72 6e 5f 66 6e 20 28  22 2b 24 5f 74 65 6d 70  |arn_fn ("+$_temp|
0000eb20  25 2b 22 29 22 29 0d 07  8f 31 20 20 20 20 20 20  |%+")")...1      |
0000eb30  76 6f 69 64 25 3d a0 28  22 46 4e 22 2b 24 5f 74  |void%=.("FN"+$_t|
0000eb40  65 6d 70 25 2b 22 28 5f  55 25 21 35 32 2c 5f 55  |emp%+"(_U%!52,_U|
0000eb50  25 21 35 36 29 22 29 0d  07 90 09 20 20 20 20 cd  |%!56)")....    .|
0000eb60  0d 07 91 07 20 20 cd 0d  07 92 2b 20 20 f2 73 68  |....  ....+  .sh|
0000eb70  65 6c 6c 5f 4f 70 65 6e  4d 65 6e 75 28 5f 55 25  |ell_OpenMenu(_U%|
0000eb80  21 33 36 2c 5f 55 25 21  34 30 2c 5f 55 25 21 32  |!36,_U%!40,_U%!2|
0000eb90  34 29 0d 07 93 05 cc 0d  07 94 1e 20 20 5f 73 68  |4).........  _sh|
0000eba0  65 6c 6c 5f 46 6f 6e 74  4d 65 6e 75 53 65 6c 46  |ell_FontMenuSelF|
0000ebb0  4e 24 3d 22 22 0d 07 95  05 cd 0d 07 96 22 f2 73  |N$=""........".s|
0000ebc0  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 52 65  |hell_HeapBlockRe|
0000ebd0  74 75 72 6e 28 68 5f 62  6c 6b 25 29 0d 07 97 05  |turn(h_blk%)....|
0000ebe0  e1 0d 07 98 05 3a 0d 07  99 25 2a 7c 53 74 6f 70  |.....:...%*|Stop|
0000ebf0  20 50 52 4f 43 73 68 65  6c 6c 5f 41 63 74 69 6f  | PROCshell_Actio|
0000ec00  6e 4d 65 6e 75 53 65 6c  65 63 74 0d 07 9a 04 0d  |nMenuSelect.....|
0000ec10  07 9b 28 2a 7c 53 74 61  72 74 20 50 52 4f 43 73  |..(*|Start PROCs|
0000ec20  68 65 6c 6c 5f 41 63 74  69 6f 6e 41 64 6a 75 73  |hell_ActionAdjus|
0000ec30  74 42 75 74 74 6f 6e 0d  07 9c 1f dd 20 f2 73 68  |tButton..... .sh|
0000ec40  65 6c 6c 5f 41 63 74 69  6f 6e 41 64 6a 75 73 74  |ell_ActionAdjust|
0000ec50  42 75 74 74 6f 6e 0d 07  9d 34 f2 73 68 65 6c 6c  |Button...4.shell|
0000ec60  5f 54 72 61 63 65 66 30  28 22 41 63 74 69 6f 6e  |_Tracef0("Action|
0000ec70  3a 4d 6f 75 73 65 20 42  75 74 74 6f 6e 20 77 61  |:Mouse Button wa|
0000ec80  73 20 41 44 4a 55 53 54  22 29 0d 07 9e 30 f2 73  |s ADJUST")...0.s|
0000ec90  68 65 6c 6c 5f 48 61 6e  64 6c 65 41 74 74 61 63  |hell_HandleAttac|
0000eca0  68 65 64 4d 65 6e 75 28  5f 51 25 2c 5f 55 25 21  |hedMenu(_Q%,_U%!|
0000ecb0  32 38 2c 5f 55 25 21 33  32 29 0d 07 9f 2f 66 6e  |28,_U%!32).../fn|
0000ecc0  24 3d a4 73 68 65 6c 6c  5f 47 65 74 45 76 65 6e  |$=.shell_GetEven|
0000ecd0  74 48 61 6e 64 6c 65 72  28 5f 55 25 21 32 38 2c  |tHandler(_U%!28,|
0000ece0  5f 55 25 21 33 32 2c 33  29 0d 07 a0 0f e7 20 66  |_U%!32,3)..... f|
0000ecf0  6e 24 3c 3e 22 22 20 8c  0d 07 a1 26 20 20 f2 73  |n$<>"" ....&  .s|
0000ed00  68 65 6c 6c 5f 49 63 6f  6e 53 6c 61 62 28 31 2c  |hell_IconSlab(1,|
0000ed10  5f 55 25 21 32 38 2c 5f  55 25 21 33 32 29 0d 07  |_U%!28,_U%!32)..|
0000ed20  a2 2d 20 20 76 6f 69 64  25 3d a0 28 22 46 4e 22  |.-  void%=.("FN"|
0000ed30  2b 66 6e 24 2b 22 28 5f  74 65 6d 70 32 38 25 2c  |+fn$+"(_temp28%,|
0000ed40  5f 74 65 6d 70 33 32 25  29 22 29 0d 07 a3 05 cd  |_temp32%)").....|
0000ed50  0d 07 a4 05 e1 0d 07 a5  27 2a 7c 53 74 6f 70 20  |........'*|Stop |
0000ed60  50 52 4f 43 73 68 65 6c  6c 5f 41 63 74 69 6f 6e  |PROCshell_Action|
0000ed70  41 64 6a 75 73 74 42 75  74 74 6f 6e 0d 07 a6 1c  |AdjustButton....|
0000ed80  2a 7c 53 74 61 72 74 20  46 4e 73 68 69 66 74 6d  |*|Start FNshiftm|
0000ed90  65 6e 75 63 6c 69 63 6b  0d 07 a7 1e dd 20 a4 73  |enuclick..... .s|
0000eda0  68 69 66 74 6d 65 6e 75  63 6c 69 63 6b 28 77 68  |hiftmenuclick(wh|
0000edb0  25 2c 69 68 25 29 0d 07  a8 06 3d b9 0d 07 a9 05  |%,ih%)....=.....|
0000edc0  3a 0d 07 aa 1b 2a 7c 53  74 6f 70 20 46 4e 73 68  |:....*|Stop FNsh|
0000edd0  69 66 74 6d 65 6e 75 63  6c 69 63 6b 0d 07 ab 1e  |iftmenuclick....|
0000ede0  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
0000edf0  6c 5f 49 63 6f 6e 53 6c  61 62 0d 07 ac 26 dd 20  |l_IconSlab...&. |
0000ee00  f2 73 68 65 6c 6c 5f 49  63 6f 6e 53 6c 61 62 28  |.shell_IconSlab(|
0000ee10  62 75 74 74 6f 6e 25 2c  77 68 25 2c 69 68 25 29  |button%,wh%,ih%)|
0000ee20  0d 07 ad 0a ea 20 62 6c  6b 25 0d 07 ae 22 62 6c  |..... blk%..."bl|
0000ee30  6b 25 3d a4 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |k%=.shell_HeapBl|
0000ee40  6f 63 6b 46 65 74 63 68  28 35 30 29 0d 07 af 2a  |ockFetch(50)...*|
0000ee50  62 6c 6b 25 21 38 3d 62  75 74 74 6f 6e 25 3a 62  |blk%!8=button%:b|
0000ee60  6c 6b 25 21 31 32 3d 77  68 25 3a 62 6c 6b 25 21  |lk%!12=wh%:blk%!|
0000ee70  31 36 3d 69 68 25 0d 07  b0 23 c8 99 20 22 49 6e  |16=ih%...#.. "In|
0000ee80  74 65 72 66 61 63 65 5f  53 6c 61 62 42 75 74 74  |terface_SlabButt|
0000ee90  6f 6e 22 2c 2c 62 6c 6b  25 0d 07 b1 0c 62 6c 6b  |on",,blk%....blk|
0000eea0  25 21 38 3d 30 0d 07 b2  23 c8 99 20 22 49 6e 74  |%!8=0...#.. "Int|
0000eeb0  65 72 66 61 63 65 5f 53  6c 61 62 42 75 74 74 6f  |erface_SlabButto|
0000eec0  6e 22 2c 2c 62 6c 6b 25  0d 07 b3 20 f2 73 68 65  |n",,blk%... .she|
0000eed0  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 52 65 74 75  |ll_HeapBlockRetu|
0000eee0  72 6e 28 62 6c 6b 25 29  0d 07 b4 05 e1 0d 07 b5  |rn(blk%)........|
0000eef0  05 3a 0d 07 b6 1d 2a 7c  53 74 6f 70 20 50 52 4f  |.:....*|Stop PRO|
0000ef00  43 73 68 65 6c 6c 5f 49  63 6f 6e 53 6c 61 62 0d  |Cshell_IconSlab.|
0000ef10  07 b7 21 dd 20 f2 73 68  65 6c 6c 5f 50 6f 69 6e  |..!. .shell_Poin|
0000ef20  74 65 72 4c 65 61 76 69  6e 67 57 69 6e 64 6f 77  |terLeavingWindow|
0000ef30  0d 07 b8 05 e1 0d 07 b9  05 3a 0d 07 ba 22 dd 20  |.........:...". |
0000ef40  f2 73 68 65 6c 6c 5f 50  6f 69 6e 74 65 72 45 6e  |.shell_PointerEn|
0000ef50  74 65 72 69 6e 67 57 69  6e 64 6f 77 0d 07 bb 05  |teringWindow....|
0000ef60  e1 0d 07 bc 05 3a 0d 07  bd 22 2a 7c 53 74 61 72  |.....:..."*|Star|
0000ef70  74 20 50 52 4f 43 73 68  65 6c 6c 5f 52 65 64 72  |t PROCshell_Redr|
0000ef80  61 77 57 69 6e 64 6f 77  0d 07 be 22 dd 20 f2 73  |awWindow...". .s|
0000ef90  68 65 6c 6c 5f 52 65 64  72 61 77 57 69 6e 64 6f  |hell_RedrawWindo|
0000efa0  77 28 68 61 6e 64 6c 65  25 29 0d 07 bf 1c ea 20  |w(handle%)..... |
0000efb0  6d 6f 72 65 25 2c 66 6e  24 2c 78 30 25 2c 79 30  |more%,fn$,x0%,y0|
0000efc0  25 2c 62 6c 6b 25 0d 07  c0 23 62 6c 6b 25 3d a4  |%,blk%...#blk%=.|
0000efd0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
0000efe0  65 74 63 68 28 31 30 30  29 0d 07 c1 2c 66 6e 24  |etch(100)...,fn$|
0000eff0  3d a4 73 68 65 6c 6c 5f  47 65 74 45 76 65 6e 74  |=.shell_GetEvent|
0000f000  48 61 6e 64 6c 65 72 28  68 61 6e 64 6c 65 25 2c  |Handler(handle%,|
0000f010  2d 31 2c 34 29 0d 07 c2  12 62 6c 6b 25 21 30 3d  |-1,4)....blk%!0=|
0000f020  68 61 6e 64 6c 65 25 0d  07 c3 28 c8 99 20 22 57  |handle%...(.. "W|
0000f030  69 6d 70 5f 52 65 64 72  61 77 57 69 6e 64 6f 77  |imp_RedrawWindow|
0000f040  22 2c 2c 62 6c 6b 25 20  b8 20 6d 6f 72 65 25 0d  |",,blk% . more%.|
0000f050  07 c4 2a 78 30 25 3d 62  6c 6b 25 21 34 2d 62 6c  |..*x0%=blk%!4-bl|
0000f060  6b 25 21 32 30 3a 79 30  25 3d 62 6c 6b 25 21 31  |k%!20:y0%=blk%!1|
0000f070  36 2d 62 6c 6b 25 21 32  34 0d 07 c5 0c c8 95 20  |6-blk%!24...... |
0000f080  6d 6f 72 65 25 0d 07 c6  29 20 20 c8 99 20 22 49  |more%...)  .. "I|
0000f090  6e 74 65 72 66 61 63 65  5f 52 65 6e 64 65 72 33  |nterface_Render3|
0000f0a0  64 57 69 6e 64 6f 77 22  2c 2c 62 6c 6b 25 0d 07  |dWindow",,blk%..|
0000f0b0  c7 43 20 20 e7 20 66 6e  24 3c 3e 22 22 20 8c 20  |.C  . fn$<>"" . |
0000f0c0  76 6f 69 64 25 3d a0 28  22 46 4e 22 2b 66 6e 24  |void%=.("FN"+fn$|
0000f0d0  2b 22 28 22 2b c3 62 6c  6b 25 2b 22 2c 22 2b c3  |+"("+.blk%+","+.|
0000f0e0  78 30 25 2b 22 2c 22 2b  c3 79 30 25 2b 22 29 22  |x0%+","+.y0%+")"|
0000f0f0  29 0d 07 c8 2a 20 20 c8  99 20 22 57 69 6d 70 5f  |)...*  .. "Wimp_|
0000f100  47 65 74 52 65 63 74 61  6e 67 6c 65 22 2c 2c 62  |GetRectangle",,b|
0000f110  6c 6b 25 20 b8 20 6d 6f  72 65 25 0d 07 c9 05 ce  |lk% . more%.....|
0000f120  0d 07 ca 20 f2 73 68 65  6c 6c 5f 48 65 61 70 42  |... .shell_HeapB|
0000f130  6c 6f 63 6b 52 65 74 75  72 6e 28 62 6c 6b 25 29  |lockReturn(blk%)|
0000f140  0d 07 cb 05 e1 0d 07 cc  05 3a 0d 07 cd 21 2a 7c  |.........:...!*||
0000f150  53 74 6f 70 20 50 52 4f  43 73 68 65 6c 6c 5f 52  |Stop PROCshell_R|
0000f160  65 64 72 61 77 57 69 6e  64 6f 77 0d 07 ce 04 0d  |edrawWindow.....|
0000f170  07 cf 1d 2a 7c 53 74 61  72 74 20 50 52 4f 43 73  |...*|Start PROCs|
0000f180  68 65 6c 6c 5f 52 65 63  65 69 76 65 0d 07 d0 19  |hell_Receive....|
0000f190  dd 20 f2 73 68 65 6c 6c  5f 52 65 63 65 69 76 65  |. .shell_Receive|
0000f1a0  28 5f 51 25 29 0d 07 d1  11 ea 20 74 65 6d 70 25  |(_Q%)..... temp%|
0000f1b0  2c 76 6f 69 64 25 0d 07  d2 0f c8 8e 20 5f 51 25  |,void%...... _Q%|
0000f1c0  21 31 36 20 ca 0d 07 d3  1a c9 20 30 20 20 20 20  |!16 ...... 0    |
0000f1d0  20 3a f2 73 68 65 6c 6c  5f 45 78 69 74 3a e0 0d  | :.shell_Exit:..|
0000f1e0  07 d4 21 c9 20 31 20 20  20 20 20 3a f2 73 68 65  |..!. 1     :.she|
0000f1f0  6c 6c 5f 44 61 74 61 53  61 76 65 28 5f 51 25 29  |ll_DataSave(_Q%)|
0000f200  0d 07 d5 24 c9 20 32 20  20 20 20 20 3a f2 73 68  |...$. 2     :.sh|
0000f210  65 6c 6c 5f 44 61 74 61  53 61 76 65 41 63 6b 28  |ell_DataSaveAck(|
0000f220  5f 51 25 29 0d 07 d6 23  c9 20 33 20 20 20 20 20  |_Q%)...#. 3     |
0000f230  3a f2 73 68 65 6c 6c 5f  44 61 74 61 4c 6f 61 64  |:.shell_DataLoad|
0000f240  28 5f 51 25 2c a3 29 0d  07 d7 24 c9 20 34 20 20  |(_Q%,.)...$. 4  |
0000f250  20 20 20 3a f2 73 68 65  6c 6c 5f 44 61 74 61 4c  |   :.shell_DataL|
0000f260  6f 61 64 41 63 6b 28 5f  51 25 29 0d 07 d8 23 c9  |oadAck(_Q%)...#.|
0000f270  20 35 20 20 20 20 20 3a  f2 73 68 65 6c 6c 5f 44  | 5     :.shell_D|
0000f280  61 74 61 4c 6f 61 64 28  5f 51 25 2c b9 29 0d 07  |ataLoad(_Q%,.)..|
0000f290  d9 21 c9 20 36 20 20 20  20 20 3a f2 73 68 65 6c  |.!. 6     :.shel|
0000f2a0  6c 5f 52 41 4d 46 65 74  63 68 28 5f 51 25 29 0d  |l_RAMFetch(_Q%).|
0000f2b0  07 da 24 c9 20 37 20 20  20 20 20 3a f2 73 68 65  |..$. 7     :.she|
0000f2c0  6c 6c 5f 52 41 4d 54 72  61 6e 73 6d 69 74 28 5f  |ll_RAMTransmit(_|
0000f2d0  51 25 29 0d 07 db 28 c9  20 38 20 20 20 20 20 3a  |Q%)...(. 8     :|
0000f2e0  f2 73 68 65 6c 6c 5f 4d  65 73 73 61 67 65 5f 50  |.shell_Message_P|
0000f2f0  72 65 51 75 69 74 28 5f  51 25 29 0d 07 dc 1a c9  |reQuit(_Q%).....|
0000f300  20 39 20 20 20 20 20 3a  e7 20 5f 55 25 21 31 36  | 9     :. _U%!16|
0000f310  34 3e 30 20 8c 0d 07 dd  23 20 20 20 20 20 20 20  |4>0 ....#       |
0000f320  20 20 20 20 20 20 20 2a  7c 69 66 64 65 66 20 54  |       *|ifdef T|
0000f330  72 61 63 65 49 6e 69 74  0d 07 de 4a 20 20 20 20  |raceInit...J    |
0000f340  20 20 20 20 20 20 20 20  20 20 f2 73 68 65 6c 6c  |          .shell|
0000f350  5f 54 72 61 63 65 66 30  28 22 52 65 63 65 69 76  |_Tracef0("Receiv|
0000f360  65 3a 50 61 6c 65 74 74  65 43 68 61 6e 67 65 20  |e:PaletteChange |
0000f370  6d 65 73 73 61 67 65 20  72 65 63 65 69 76 65 64  |message received|
0000f380  22 29 0d 07 df 19 20 20  20 20 20 20 20 20 20 20  |")....          |
0000f390  20 20 20 20 2a 7c 65 6e  64 69 66 0d 07 e0 1f 20  |    *|endif.... |
0000f3a0  20 20 20 20 20 20 20 20  20 20 20 20 20 74 65 6d  |             tem|
0000f3b0  70 25 3d 5f 55 25 21 31  36 34 0d 07 e1 26 20 20  |p%=_U%!164...&  |
0000f3c0  20 20 20 20 20 20 20 20  20 20 20 20 76 6f 69 64  |            void|
0000f3d0  25 3d a0 28 22 46 4e 22  2b 24 74 65 6d 70 25 29  |%=.("FN"+$temp%)|
0000f3e0  0d 07 e2 11 20 20 20 20  20 20 20 20 20 20 20 20  |....            |
0000f3f0  cd 0d 07 e3 2c c9 20 31  30 20 20 20 20 3a f2 73  |....,. 10    :.s|
0000f400  68 65 6c 6c 5f 4d 65 73  73 61 67 65 5f 53 61 76  |hell_Message_Sav|
0000f410  65 44 65 73 6b 74 6f 70  28 5f 51 25 29 0d 07 e4  |eDesktop(_Q%)...|
0000f420  29 c9 20 31 34 20 20 20  20 3a f2 73 68 65 6c 6c  |). 14    :.shell|
0000f430  5f 4d 65 73 73 61 67 65  5f 53 68 75 74 64 6f 77  |_Message_Shutdow|
0000f440  6e 28 5f 51 25 29 0d 07  e5 28 c9 20 26 35 30 32  |n(_Q%)...(. &502|
0000f450  20 20 3a f2 73 68 65 6c  6c 5f 49 6e 74 65 72 61  |  :.shell_Intera|
0000f460  63 74 69 76 65 48 65 6c  70 28 5f 51 25 29 0d 07  |ctiveHelp(_Q%)..|
0000f470  e6 24 c9 20 26 34 30 30  43 30 3a f2 73 68 65 6c  |.$. &400C0:.shel|
0000f480  6c 5f 4d 65 6e 75 57 61  72 6e 69 6e 67 28 5f 51  |l_MenuWarning(_Q|
0000f490  25 29 0d 07 e7 2b c9 20  26 34 30 30 43 31 3a f2  |%)...+. &400C1:.|
0000f4a0  73 68 65 6c 6c 5f 4d 65  73 73 61 67 65 5f 4d 6f  |shell_Message_Mo|
0000f4b0  64 65 43 68 61 6e 67 65  28 5f 51 25 29 0d 07 e8  |deChange(_Q%)...|
0000f4c0  1d c9 20 26 34 30 30 43  32 3a f4 20 54 61 73 6b  |.. &400C2:. Task|
0000f4d0  49 6e 69 74 69 61 6c 69  73 65 0d 07 e9 1d 20 20  |Initialise....  |
0000f4e0  20 20 20 20 20 20 20 20  20 20 e7 20 5f 55 25 21  |          . _U%!|
0000f4f0  31 36 38 3e 30 20 8c 0d  07 ea 23 20 20 20 20 20  |168>0 ....#     |
0000f500  20 20 20 20 20 20 20 20  20 2a 7c 69 66 64 65 66  |         *|ifdef|
0000f510  20 54 72 61 63 65 49 6e  69 74 0d 07 eb 4b 20 20  | TraceInit...K  |
0000f520  20 20 20 20 20 20 20 20  20 20 20 20 f2 73 68 65  |            .she|
0000f530  6c 6c 5f 54 72 61 63 65  66 30 28 22 52 65 63 65  |ll_Tracef0("Rece|
0000f540  69 76 65 3a 54 61 73 6b  49 6e 69 74 69 61 6c 69  |ive:TaskInitiali|
0000f550  73 65 20 6d 65 73 73 61  67 65 20 72 65 63 65 69  |se message recei|
0000f560  76 65 64 22 29 0d 07 ec  19 20 20 20 20 20 20 20  |ved")....       |
0000f570  20 20 20 20 20 20 20 2a  7c 65 6e 64 69 66 0d 07  |       *|endif..|
0000f580  ed 1f 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |..              |
0000f590  74 65 6d 70 25 3d 5f 55  25 21 31 36 38 0d 07 ee  |temp%=_U%!168...|
0000f5a0  26 20 20 20 20 20 20 20  20 20 20 20 20 20 20 76  |&              v|
0000f5b0  6f 69 64 25 3d a0 28 22  46 4e 22 2b 24 74 65 6d  |oid%=.("FN"+$tem|
0000f5c0  70 25 29 0d 07 ef 11 20  20 20 20 20 20 20 20 20  |p%)....         |
0000f5d0  20 20 20 cd 0d 07 f0 46  20 20 20 20 20 20 20 20  |   ....F        |
0000f5e0  20 20 20 20 e7 20 5f 55  25 21 32 30 38 3d 2d 31  |    . _U%!208=-1|
0000f5f0  20 80 20 a4 73 68 65 6c  6c 5f 47 65 74 53 74 72  | . .shell_GetStr|
0000f600  69 6e 67 28 5f 51 25 2b  32 38 29 3d 22 53 74 72  |ing(_Q%+28)="Str|
0000f610  6f 6e 67 48 65 6c 70 22  20 8c 0d 07 f1 1f 20 20  |ongHelp" .....  |
0000f620  20 20 20 20 20 20 20 20  20 20 20 20 5f 55 25 21  |            _U%!|
0000f630  32 30 38 3d 5f 51 25 21  34 0d 07 f2 6a 20 20 20  |208=_Q%!4...j   |
0000f640  20 20 20 20 20 20 20 20  20 20 20 f2 73 68 65 6c  |           .shel|
0000f650  6c 5f 53 74 72 6f 6e 67  48 6c 70 4d 73 67 28 22  |l_StrongHlpMsg("|
0000f660  48 65 6c 70 5f 49 6e 73  74 61 6c 6c 20 2d 44 69  |Help_Install -Di|
0000f670  65 57 69 74 68 54 61 73  6b 20 22 2b a4 73 68 65  |eWithTask "+.she|
0000f680  6c 6c 5f 47 65 74 41 70  70 44 69 72 2b 22 2e 22  |ll_GetAppDir+"."|
0000f690  2b a4 73 68 65 6c 6c 5f  47 65 74 41 70 70 4e 61  |+.shell_GetAppNa|
0000f6a0  6d 65 29 0d 07 f3 1f 20  20 20 20 20 20 20 20 20  |me)....         |
0000f6b0  20 20 20 20 20 74 65 6d  70 25 3d 5f 55 25 21 32  |     temp%=_U%!2|
0000f6c0  31 36 0d 07 f4 20 20 20  20 20 20 20 20 20 20 20  |16...           |
0000f6d0  20 20 20 20 e7 20 24 74  65 6d 70 25 3c 3e 22 22  |    . $temp%<>""|
0000f6e0  20 8c 0d 07 f5 2b 20 20  20 20 20 20 20 20 20 20  | ....+          |
0000f6f0  20 20 20 20 20 20 f2 73  68 65 6c 6c 5f 48 65 6c  |      .shell_Hel|
0000f700  70 57 6f 72 64 28 24 74  65 6d 70 25 29 0d 07 f6  |pWord($temp%)...|
0000f710  33 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |3               |
0000f720  20 f2 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
0000f730  6b 52 65 74 75 72 6e 28  5f 55 25 21 32 31 36 29  |kReturn(_U%!216)|
0000f740  0d 07 f7 1d 20 20 20 20  20 20 20 20 20 20 20 20  |....            |
0000f750  20 20 20 20 5f 55 25 21  32 31 36 3d 30 0d 07 f8  |    _U%!216=0...|
0000f760  13 20 20 20 20 20 20 20  20 20 20 20 20 20 20 cd  |.              .|
0000f770  0d 07 f9 11 20 20 20 20  20 20 20 20 20 20 20 20  |....            |
0000f780  cd 0d 07 fa 1c c9 20 26  34 30 30 43 33 3a f4 20  |...... &400C3:. |
0000f790  54 61 73 6b 43 6c 6f 73  65 44 6f 77 6e 0d 07 fb  |TaskCloseDown...|
0000f7a0  1d 20 20 20 20 20 20 20  20 20 20 20 20 e7 20 5f  |.            . _|
0000f7b0  55 25 21 31 37 32 3e 30  20 8c 0d 07 fc 15 2a 7c  |U%!172>0 .....*||
0000f7c0  69 66 64 65 66 20 54 72  61 63 65 49 6e 69 74 0d  |ifdef TraceInit.|
0000f7d0  07 fd 3e 20 20 f2 73 68  65 6c 6c 5f 54 72 61 63  |..>  .shell_Trac|
0000f7e0  65 66 30 28 22 52 65 63  65 69 76 65 3a 54 61 73  |ef0("Receive:Tas|
0000f7f0  6b 43 6c 6f 73 65 44 6f  77 6e 20 6d 65 73 73 61  |kCloseDown messa|
0000f800  67 65 20 72 65 63 65 69  76 65 64 22 29 0d 07 fe  |ge received")...|
0000f810  0b 2a 7c 65 6e 64 69 66  0d 07 ff 1f 20 20 20 20  |.*|endif....    |
0000f820  20 20 20 20 20 20 20 20  20 20 74 65 6d 70 25 3d  |          temp%=|
0000f830  5f 55 25 21 31 37 32 0d  08 00 26 20 20 20 20 20  |_U%!172...&     |
0000f840  20 20 20 20 20 20 20 20  20 76 6f 69 64 25 3d a0  |         void%=.|
0000f850  28 22 46 4e 22 2b 24 74  65 6d 70 25 29 0d 08 01  |("FN"+$temp%)...|
0000f860  11 20 20 20 20 20 20 20  20 20 20 20 20 cd 0d 08  |.            ...|
0000f870  02 2c 20 20 20 20 20 20  20 20 20 20 20 20 e7 20  |.,            . |
0000f880  5f 51 25 21 34 3d 5f 55  25 21 32 30 38 20 8c 20  |_Q%!4=_U%!208 . |
0000f890  5f 55 25 21 32 30 38 3d  2d 31 0d 08 03 19 c9 20  |_U%!208=-1..... |
0000f8a0  26 34 30 30 43 37 3a f4  20 54 61 73 6b 4e 61 6d  |&400C7:. TaskNam|
0000f8b0  65 49 73 0d 08 04 15 2a  7c 69 66 64 65 66 20 54  |eIs....*|ifdef T|
0000f8c0  72 61 63 65 49 6e 69 74  0d 08 05 3b 20 20 f2 73  |raceInit...;  .s|
0000f8d0  68 65 6c 6c 5f 54 72 61  63 65 66 30 28 22 52 65  |hell_Tracef0("Re|
0000f8e0  63 65 69 76 65 3a 54 61  73 6b 4e 61 6d 65 49 73  |ceive:TaskNameIs|
0000f8f0  20 6d 65 73 73 61 67 65  20 72 65 63 65 69 76 65  | message receive|
0000f900  64 22 29 0d 08 06 0b 2a  7c 65 6e 64 69 66 0d 08  |d")....*|endif..|
0000f910  07 3b 20 20 20 20 20 20  20 20 20 20 20 20 e7 20  |.;            . |
0000f920  a4 73 68 65 6c 6c 5f 47  65 74 53 74 72 69 6e 67  |.shell_GetString|
0000f930  28 5f 51 25 2b 32 38 29  20 3d 20 22 53 74 72 6f  |(_Q%+28) = "Stro|
0000f940  6e 67 48 65 6c 70 22 20  8c 0d 08 08 44 20 20 20  |ngHelp" ....D   |
0000f950  20 20 20 20 20 20 20 20  20 20 20 5f 55 25 21 32  |           _U%!2|
0000f960  30 38 3d 5f 51 25 21 32  30 3a f4 20 73 74 6f 72  |08=_Q%!20:. stor|
0000f970  65 20 74 61 73 6b 20 68  61 6e 64 6c 65 20 6f 66  |e task handle of|
0000f980  20 53 74 72 6f 6e 67 48  6c 70 2e 2e 2e 0d 08 09  | StrongHlp......|
0000f990  11 20 20 20 20 20 20 20  20 20 20 20 20 cc 0d 08  |.            ...|
0000f9a0  0a 24 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.$              |
0000f9b0  f2 73 68 65 6c 6c 5f 53  63 61 6e 46 6f 72 48 65  |.shell_ScanForHe|
0000f9c0  6c 70 0d 08 0b 11 20 20  20 20 20 20 20 20 20 20  |lp....          |
0000f9d0  20 20 cd 0d 08 0c 29 7f  20 20 3a f2 73 68 65 6c  |  ....).  :.shel|
0000f9e0  6c 5f 48 61 6e 64 6c 65  55 6e 6b 6e 6f 77 6e 4d  |l_HandleUnknownM|
0000f9f0  65 73 73 61 67 65 32 28  5f 51 25 29 0d 08 0d 05  |essage2(_Q%)....|
0000fa00  cb 0d 08 0e 05 e1 0d 08  0f 05 3a 0d 08 10 1c 2a  |..........:....*|
0000fa10  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
0000fa20  52 65 63 65 69 76 65 0d  08 11 04 0d 08 12 28 2a  |Receive.......(*|
0000fa30  7c 53 74 61 72 74 20 50  52 4f 43 73 68 65 6c 6c  ||Start PROCshell|
0000fa40  5f 4d 65 73 73 61 67 65  5f 4d 6f 64 65 43 68 61  |_Message_ModeCha|
0000fa50  6e 67 65 0d 08 13 24 dd  20 f2 73 68 65 6c 6c 5f  |nge...$. .shell_|
0000fa60  4d 65 73 73 61 67 65 5f  4d 6f 64 65 43 68 61 6e  |Message_ModeChan|
0000fa70  67 65 28 5f 51 25 29 0d  08 14 11 e7 20 5f 55 25  |ge(_Q%)..... _U%|
0000fa80  21 31 36 30 3e 30 20 8c  0d 08 15 46 20 20 f2 73  |!160>0 ....F  .s|
0000fa90  68 65 6c 6c 5f 54 72 61  63 65 66 30 28 22 4d 65  |hell_Tracef0("Me|
0000faa0  73 73 61 67 65 5f 4d 6f  64 65 43 68 61 6e 67 65  |ssage_ModeChange|
0000fab0  3a 4d 6f 64 65 43 68 61  6e 67 65 20 6d 65 73 73  |:ModeChange mess|
0000fac0  61 67 65 20 72 65 63 65  69 76 65 64 22 29 0d 08  |age received")..|
0000fad0  16 13 20 20 74 65 6d 70  25 3d 5f 55 25 21 31 36  |..  temp%=_U%!16|
0000fae0  30 0d 08 17 1a 20 20 76  6f 69 64 25 3d a0 28 22  |0....  void%=.("|
0000faf0  46 4e 22 2b 24 74 65 6d  70 25 29 0d 08 18 05 cd  |FN"+$temp%).....|
0000fb00  0d 08 19 29 f4 20 53 59  53 20 22 46 6f 6e 74 57  |...). SYS "FontW|
0000fb10  69 6e 64 6f 77 5f 4d 6f  64 65 43 68 61 6e 67 65  |indow_ModeChange|
0000fb20  22 2c 5f 55 25 21 31 34  38 0d 08 1a 05 e1 0d 08  |",_U%!148.......|
0000fb30  1b 27 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |.'*|Stop PROCshe|
0000fb40  6c 6c 5f 4d 65 73 73 61  67 65 5f 4d 6f 64 65 43  |ll_Message_ModeC|
0000fb50  68 61 6e 67 65 0d 08 1c  04 0d 08 1d 26 2a 7c 53  |hange.......&*|S|
0000fb60  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 4d  |tart PROCshell_M|
0000fb70  65 73 73 61 67 65 5f 53  68 75 74 64 6f 77 6e 0d  |essage_Shutdown.|
0000fb80  08 1e 22 dd 20 f2 73 68  65 6c 6c 5f 4d 65 73 73  |..". .shell_Mess|
0000fb90  61 67 65 5f 53 68 75 74  64 6f 77 6e 28 5f 51 25  |age_Shutdown(_Q%|
0000fba0  29 0d 08 1f 11 e7 20 5f  55 25 21 33 31 32 3e 30  |)..... _U%!312>0|
0000fbb0  20 8c 0d 08 20 42 20 20  f2 73 68 65 6c 6c 5f 54  | ... B  .shell_T|
0000fbc0  72 61 63 65 66 30 28 22  4d 65 73 73 61 67 65 5f  |racef0("Message_|
0000fbd0  53 68 75 74 64 6f 77 6e  3a 53 68 75 74 64 6f 77  |Shutdown:Shutdow|
0000fbe0  6e 20 6d 65 73 73 61 67  65 20 72 65 63 65 69 76  |n message receiv|
0000fbf0  65 64 22 29 0d 08 21 13  20 20 74 65 6d 70 25 3d  |ed")..!.  temp%=|
0000fc00  5f 55 25 21 33 31 32 0d  08 22 1a 20 20 76 6f 69  |_U%!312..".  voi|
0000fc10  64 25 3d a0 28 22 46 4e  22 2b 24 74 65 6d 70 25  |d%=.("FN"+$temp%|
0000fc20  29 0d 08 23 05 cd 0d 08  24 05 e1 0d 08 25 25 2a  |)..#....$....%%*|
0000fc30  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
0000fc40  4d 65 73 73 61 67 65 5f  53 68 75 74 64 6f 77 6e  |Message_Shutdown|
0000fc50  0d 08 26 04 0d 08 27 2b  2a 7c 53 74 61 72 74 20  |..&...'+*|Start |
0000fc60  50 52 4f 43 73 68 65 6c  6c 5f 48 61 6e 64 6c 65  |PROCshell_Handle|
0000fc70  55 6e 6b 6e 6f 77 6e 4d  65 73 73 61 67 65 32 0d  |UnknownMessage2.|
0000fc80  08 28 27 dd 20 f2 73 68  65 6c 6c 5f 48 61 6e 64  |.('. .shell_Hand|
0000fc90  6c 65 55 6e 6b 6e 6f 77  6e 4d 65 73 73 61 67 65  |leUnknownMessage|
0000fca0  32 28 5f 51 25 29 0d 08  29 0e ea 20 6d 65 73 73  |2(_Q%)..).. mess|
0000fcb0  61 67 65 24 0d 08 2a 3a  f4 20 49 20 77 61 6e 74  |age$..*:. I want|
0000fcc0  20 74 6f 20 68 61 6e 64  6c 65 20 6d 65 73 73 61  | to handle messa|
0000fcd0  67 65 20 26 34 33 42 30  30 20 68 65 72 65 20 61  |ge &43B00 here a|
0000fce0  73 20 49 20 75 73 65 20  69 74 20 66 6f 72 0d 08  |s I use it for..|
0000fcf0  2b 35 f4 20 63 6f 6d 6d  75 6e 69 63 61 74 69 6f  |+5. communicatio|
0000fd00  6e 73 20 62 65 74 77 65  65 6e 20 45 76 6e 74 53  |ns between EvntS|
0000fd10  68 65 6c 6c 20 61 70 70  6c 69 63 61 74 69 6f 6e  |hell application|
0000fd20  73 2e 2e 0d 08 2c 0f c8  8e 20 5f 51 25 21 31 36  |s....,... _Q%!16|
0000fd30  20 ca 0d 08 2d 2e 20 20  c9 20 26 34 33 42 30 30  | ...-.  . &43B00|
0000fd40  3a f4 20 69 6e 63 6f 6d  69 6e 67 20 45 76 6e 74  |:. incoming Evnt|
0000fd50  53 68 65 6c 6c 20 6d 65  73 73 61 67 65 2e 2e 2e  |Shell message...|
0000fd60  0d 08 2e 1a 20 20 20 20  6d 65 73 73 61 67 65 24  |....    message$|
0000fd70  3d 24 28 5f 51 25 2b 32  30 29 0d 08 2f 30 20 20  |=$(_Q%+20)../0  |
0000fd80  20 20 e7 20 c0 6d 65 73  73 61 67 65 24 2c 32 30  |  . .message$,20|
0000fd90  29 3d 22 45 76 6e 74 53  68 65 6c 6c 4c 69 62 3a  |)="EvntShellLib:|
0000fda0  54 72 61 63 65 4f 6e 22  20 8c 0d 08 30 18 20 20  |TraceOn" ...0.  |
0000fdb0  20 20 20 20 f2 73 68 65  6c 6c 5f 54 72 61 63 65  |    .shell_Trace|
0000fdc0  4f 6e 0d 08 31 09 20 20  20 20 cd 0d 08 32 31 20  |On..1.    ...21 |
0000fdd0  20 20 20 e7 20 c0 6d 65  73 73 61 67 65 24 2c 32  |   . .message$,2|
0000fde0  31 29 3d 22 45 76 6e 74  53 68 65 6c 6c 4c 69 62  |1)="EvntShellLib|
0000fdf0  3a 54 72 61 63 65 4f 66  66 22 20 8c 0d 08 33 19  |:TraceOff" ...3.|
0000fe00  20 20 20 20 20 20 f2 73  68 65 6c 6c 5f 54 72 61  |      .shell_Tra|
0000fe10  63 65 4f 66 66 0d 08 34  09 20 20 20 20 cd 0d 08  |ceOff..4.    ...|
0000fe20  35 38 20 20 20 20 e7 20  c0 6d 65 73 73 61 67 65  |58    . .message|
0000fe30  24 2c 32 38 29 3d 22 45  76 6e 74 53 68 65 6c 6c  |$,28)="EvntShell|
0000fe40  4c 69 62 3a 4c 69 73 74  43 6c 69 63 6b 53 65 6c  |Lib:ListClickSel|
0000fe50  65 63 74 22 20 8c 0d 08  36 20 20 20 20 20 20 20  |ect" ...6       |
0000fe60  f2 73 68 65 6c 6c 5f 4c  69 73 74 43 6c 69 63 6b  |.shell_ListClick|
0000fe70  53 65 6c 65 63 74 0d 08  37 09 20 20 20 20 cd 0d  |Select..7.    ..|
0000fe80  08 38 38 20 20 20 20 e7  20 c0 6d 65 73 73 61 67  |.88    . .messag|
0000fe90  65 24 2c 32 38 29 3d 22  45 76 6e 74 53 68 65 6c  |e$,28)="EvntShel|
0000fea0  6c 4c 69 62 3a 4c 69 73  74 43 6c 69 63 6b 41 64  |lLib:ListClickAd|
0000feb0  6a 75 73 74 22 20 8c 0d  08 39 20 20 20 20 20 20  |just" ...9      |
0000fec0  20 f2 73 68 65 6c 6c 5f  4c 69 73 74 43 6c 69 63  | .shell_ListClic|
0000fed0  6b 41 64 6a 75 73 74 0d  08 3a 09 20 20 20 20 cd  |kAdjust..:.    .|
0000fee0  0d 08 3b 35 20 20 20 20  e7 20 c0 6d 65 73 73 61  |..;5    . .messa|
0000fef0  67 65 24 2c 32 35 29 3d  22 45 76 6e 74 53 68 65  |ge$,25)="EvntShe|
0000ff00  6c 6c 4c 69 62 3a 4c 69  73 74 48 65 6c 70 54 61  |llLib:ListHelpTa|
0000ff10  67 73 22 20 8c 0d 08 3c  1d 20 20 20 20 20 20 f2  |gs" ...<.      .|
0000ff20  73 68 65 6c 6c 5f 4c 69  73 74 48 65 6c 70 54 61  |shell_ListHelpTa|
0000ff30  67 73 0d 08 3d 09 20 20  20 20 cd 0d 08 3e 05 cb  |gs..=.    ...>..|
0000ff40  0d 08 3f 3b f4 20 50 61  73 73 20 6d 65 73 73 61  |..?;. Pass messa|
0000ff50  67 65 20 62 6c 6f 63 6b  20 6f 6e 20 69 6e 20 63  |ge block on in c|
0000ff60  61 73 65 20 74 68 65 20  75 73 65 72 20 77 61 6e  |ase the user wan|
0000ff70  74 73 20 69 74 20 74 6f  6f 2e 2e 0d 08 40 24 f2  |ts it too....@$.|
0000ff80  73 68 65 6c 6c 5f 48 61  6e 64 6c 65 55 6e 6b 6e  |shell_HandleUnkn|
0000ff90  6f 77 6e 4d 65 73 73 61  67 65 28 5f 51 25 29 0d  |ownMessage(_Q%).|
0000ffa0  08 41 05 e1 0d 08 42 05  3a 0d 08 43 2a 2a 7c 53  |.A....B.:..C**|S|
0000ffb0  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 48 61  |top PROCshell_Ha|
0000ffc0  6e 64 6c 65 55 6e 6b 6e  6f 77 6e 4d 65 73 73 61  |ndleUnknownMessa|
0000ffd0  67 65 32 0d 08 44 04 0d  08 45 2a 2a 7c 53 74 61  |ge2..D...E**|Sta|
0000ffe0  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 48 61 6e  |rt PROCshell_Han|
0000fff0  64 6c 65 55 6e 6b 6e 6f  77 6e 4d 65 73 73 61 67  |dleUnknownMessag|
00010000  65 0d 08 46 26 dd 20 f2  73 68 65 6c 6c 5f 48 61  |e..F&. .shell_Ha|
00010010  6e 64 6c 65 55 6e 6b 6e  6f 77 6e 4d 65 73 73 61  |ndleUnknownMessa|
00010020  67 65 28 5f 51 25 29 0d  08 47 05 e1 0d 08 48 05  |ge(_Q%)..G....H.|
00010030  3a 0d 08 49 29 2a 7c 53  74 6f 70 20 50 52 4f 43  |:..I)*|Stop PROC|
00010040  73 68 65 6c 6c 5f 48 61  6e 64 6c 65 55 6e 6b 6e  |shell_HandleUnkn|
00010050  6f 77 6e 4d 65 73 73 61  67 65 0d 08 4a 04 0d 08  |ownMessage..J...|
00010060  4b 2a 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |K**|Start PROCsh|
00010070  65 6c 6c 5f 41 74 74 61  63 68 50 72 65 51 75 69  |ell_AttachPreQui|
00010080  74 48 61 6e 64 6c 65 72  0d 08 4c 26 dd 20 f2 73  |tHandler..L&. .s|
00010090  68 65 6c 6c 5f 41 74 74  61 63 68 50 72 65 51 75  |hell_AttachPreQu|
000100a0  69 74 48 61 6e 64 6c 65  72 28 66 6e 24 29 0d 08  |itHandler(fn$)..|
000100b0  4d 11 ea 20 74 65 6d 70  25 2c 76 6f 69 64 25 0d  |M.. temp%,void%.|
000100c0  08 4e 31 e7 20 5f 55 25  21 33 30 30 3e 30 20 8c  |.N1. _U%!300>0 .|
000100d0  20 f2 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
000100e0  6b 52 65 74 75 72 6e 28  5f 55 25 21 33 30 30 29  |kReturn(_U%!300)|
000100f0  0d 08 4f 29 5f 55 25 21  33 30 30 3d a4 73 68 65  |..O)_U%!300=.she|
00010100  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 46 65 74 63  |ll_HeapBlockFetc|
00010110  68 28 a9 66 6e 24 2b 31  29 0d 08 50 1c 74 65 6d  |h(.fn$+1)..P.tem|
00010120  70 25 3d 5f 55 25 21 33  30 30 3a 24 74 65 6d 70  |p%=_U%!300:$temp|
00010130  25 3d 66 6e 24 0d 08 51  05 e1 0d 08 52 05 3a 0d  |%=fn$..Q....R.:.|
00010140  08 53 29 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |.S)*|Stop PROCsh|
00010150  65 6c 6c 5f 41 74 74 61  63 68 50 72 65 51 75 69  |ell_AttachPreQui|
00010160  74 48 61 6e 64 6c 65 72  0d 08 54 04 0d 08 55 2b  |tHandler..T...U+|
00010170  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
00010180  6c 5f 41 74 74 61 63 68  53 68 75 74 64 6f 77 6e  |l_AttachShutdown|
00010190  48 61 6e 64 6c 65 72 0d  08 56 27 dd 20 f2 73 68  |Handler..V'. .sh|
000101a0  65 6c 6c 5f 41 74 74 61  63 68 53 68 75 74 64 6f  |ell_AttachShutdo|
000101b0  77 6e 48 61 6e 64 6c 65  72 28 66 6e 24 29 0d 08  |wnHandler(fn$)..|
000101c0  57 11 ea 20 74 65 6d 70  25 2c 76 6f 69 64 25 0d  |W.. temp%,void%.|
000101d0  08 58 31 e7 20 5f 55 25  21 33 31 32 3e 30 20 8c  |.X1. _U%!312>0 .|
000101e0  20 f2 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
000101f0  6b 52 65 74 75 72 6e 28  5f 55 25 21 33 31 32 29  |kReturn(_U%!312)|
00010200  0d 08 59 29 5f 55 25 21  33 31 32 3d a4 73 68 65  |..Y)_U%!312=.she|
00010210  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 46 65 74 63  |ll_HeapBlockFetc|
00010220  68 28 a9 66 6e 24 2b 31  29 0d 08 5a 1c 74 65 6d  |h(.fn$+1)..Z.tem|
00010230  70 25 3d 5f 55 25 21 33  31 32 3a 24 74 65 6d 70  |p%=_U%!312:$temp|
00010240  25 3d 66 6e 24 0d 08 5b  05 e1 0d 08 5c 05 3a 0d  |%=fn$..[....\.:.|
00010250  08 5d 2a 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |.]**|Stop PROCsh|
00010260  65 6c 6c 5f 41 74 74 61  63 68 53 68 75 74 64 6f  |ell_AttachShutdo|
00010270  77 6e 48 61 6e 64 6c 65  72 0d 08 5e 04 0d 08 5f  |wnHandler..^..._|
00010280  2d 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |-*|Start PROCshe|
00010290  6c 6c 5f 41 74 74 61 63  68 4d 6f 64 65 43 68 61  |ll_AttachModeCha|
000102a0  6e 67 65 48 61 6e 64 6c  65 72 0d 08 60 29 dd 20  |ngeHandler..`). |
000102b0  f2 73 68 65 6c 6c 5f 41  74 74 61 63 68 4d 6f 64  |.shell_AttachMod|
000102c0  65 43 68 61 6e 67 65 48  61 6e 64 6c 65 72 28 66  |eChangeHandler(f|
000102d0  6e 24 29 0d 08 61 11 ea  20 74 65 6d 70 25 2c 76  |n$)..a.. temp%,v|
000102e0  6f 69 64 25 0d 08 62 31  e7 20 5f 55 25 21 31 36  |oid%..b1. _U%!16|
000102f0  30 3e 30 20 8c 20 f2 73  68 65 6c 6c 5f 48 65 61  |0>0 . .shell_Hea|
00010300  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 5f 55 25  |pBlockReturn(_U%|
00010310  21 31 36 30 29 0d 08 63  29 5f 55 25 21 31 36 30  |!160)..c)_U%!160|
00010320  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
00010330  6b 46 65 74 63 68 28 a9  66 6e 24 2b 31 29 0d 08  |kFetch(.fn$+1)..|
00010340  64 1c 74 65 6d 70 25 3d  5f 55 25 21 31 36 30 3a  |d.temp%=_U%!160:|
00010350  24 74 65 6d 70 25 3d 66  6e 24 0d 08 65 15 76 6f  |$temp%=fn$..e.vo|
00010360  69 64 25 3d a0 28 22 46  4e 22 2b 66 6e 24 29 0d  |id%=.("FN"+fn$).|
00010370  08 66 05 e1 0d 08 67 05  3a 0d 08 68 2c 2a 7c 53  |.f....g.:..h,*|S|
00010380  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 41 74  |top PROCshell_At|
00010390  74 61 63 68 4d 6f 64 65  43 68 61 6e 67 65 48 61  |tachModeChangeHa|
000103a0  6e 64 6c 65 72 0d 08 69  04 0d 08 6a 30 2a 7c 53  |ndler..i...j0*|S|
000103b0  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 41  |tart PROCshell_A|
000103c0  74 74 61 63 68 50 61 6c  65 74 74 65 43 68 61 6e  |ttachPaletteChan|
000103d0  67 65 48 61 6e 64 6c 65  72 0d 08 6b 2c dd 20 f2  |geHandler..k,. .|
000103e0  73 68 65 6c 6c 5f 41 74  74 61 63 68 50 61 6c 65  |shell_AttachPale|
000103f0  74 74 65 43 68 61 6e 67  65 48 61 6e 64 6c 65 72  |tteChangeHandler|
00010400  28 66 6e 24 29 0d 08 6c  11 ea 20 74 65 6d 70 25  |(fn$)..l.. temp%|
00010410  2c 76 6f 69 64 25 0d 08  6d 31 e7 20 5f 55 25 21  |,void%..m1. _U%!|
00010420  31 36 34 3e 30 20 8c 20  f2 73 68 65 6c 6c 5f 48  |164>0 . .shell_H|
00010430  65 61 70 42 6c 6f 63 6b  52 65 74 75 72 6e 28 5f  |eapBlockReturn(_|
00010440  55 25 21 31 36 34 29 0d  08 6e 29 5f 55 25 21 31  |U%!164)..n)_U%!1|
00010450  36 34 3d a4 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |64=.shell_HeapBl|
00010460  6f 63 6b 46 65 74 63 68  28 a9 66 6e 24 2b 31 29  |ockFetch(.fn$+1)|
00010470  0d 08 6f 1c 74 65 6d 70  25 3d 5f 55 25 21 31 36  |..o.temp%=_U%!16|
00010480  34 3a 24 74 65 6d 70 25  3d 66 6e 24 0d 08 70 15  |4:$temp%=fn$..p.|
00010490  76 6f 69 64 25 3d a0 28  22 46 4e 22 2b 66 6e 24  |void%=.("FN"+fn$|
000104a0  29 0d 08 71 05 e1 0d 08  72 05 3a 0d 08 73 2f 2a  |)..q....r.:..s/*|
000104b0  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
000104c0  41 74 74 61 63 68 50 61  6c 65 74 74 65 43 68 61  |AttachPaletteCha|
000104d0  6e 67 65 48 61 6e 64 6c  65 72 0d 08 74 04 0d 08  |ngeHandler..t...|
000104e0  75 31 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |u1*|Start PROCsh|
000104f0  65 6c 6c 5f 41 74 74 61  63 68 54 61 73 6b 49 6e  |ell_AttachTaskIn|
00010500  69 74 69 61 6c 69 73 65  48 61 6e 64 6c 65 72 0d  |itialiseHandler.|
00010510  08 76 2d dd 20 f2 73 68  65 6c 6c 5f 41 74 74 61  |.v-. .shell_Atta|
00010520  63 68 54 61 73 6b 49 6e  69 74 69 61 6c 69 73 65  |chTaskInitialise|
00010530  48 61 6e 64 6c 65 72 28  66 6e 24 29 0d 08 77 11  |Handler(fn$)..w.|
00010540  ea 20 74 65 6d 70 25 2c  76 6f 69 64 25 0d 08 78  |. temp%,void%..x|
00010550  31 e7 20 5f 55 25 21 31  36 38 3e 30 20 8c 20 f2  |1. _U%!168>0 . .|
00010560  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 52  |shell_HeapBlockR|
00010570  65 74 75 72 6e 28 5f 55  25 21 31 36 38 29 0d 08  |eturn(_U%!168)..|
00010580  79 29 5f 55 25 21 31 36  38 3d a4 73 68 65 6c 6c  |y)_U%!168=.shell|
00010590  5f 48 65 61 70 42 6c 6f  63 6b 46 65 74 63 68 28  |_HeapBlockFetch(|
000105a0  a9 66 6e 24 2b 31 29 0d  08 7a 1c 74 65 6d 70 25  |.fn$+1)..z.temp%|
000105b0  3d 5f 55 25 21 31 36 38  3a 24 74 65 6d 70 25 3d  |=_U%!168:$temp%=|
000105c0  66 6e 24 0d 08 7b 05 e1  0d 08 7c 05 3a 0d 08 7d  |fn$..{....|.:..}|
000105d0  30 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  |0*|Stop PROCshel|
000105e0  6c 5f 41 74 74 61 63 68  54 61 73 6b 49 6e 69 74  |l_AttachTaskInit|
000105f0  69 61 6c 69 73 65 48 61  6e 64 6c 65 72 0d 08 7e  |ialiseHandler..~|
00010600  04 0d 08 7f 30 2a 7c 53  74 61 72 74 20 50 52 4f  |....0*|Start PRO|
00010610  43 73 68 65 6c 6c 5f 41  74 74 61 63 68 54 61 73  |Cshell_AttachTas|
00010620  6b 43 6c 6f 73 65 44 6f  77 6e 48 61 6e 64 6c 65  |kCloseDownHandle|
00010630  72 0d 08 80 2c dd 20 f2  73 68 65 6c 6c 5f 41 74  |r...,. .shell_At|
00010640  74 61 63 68 54 61 73 6b  43 6c 6f 73 65 44 6f 77  |tachTaskCloseDow|
00010650  6e 48 61 6e 64 6c 65 72  28 66 6e 24 29 0d 08 81  |nHandler(fn$)...|
00010660  11 ea 20 74 65 6d 70 25  2c 76 6f 69 64 25 0d 08  |.. temp%,void%..|
00010670  82 31 e7 20 5f 55 25 21  31 37 32 3e 30 20 8c 20  |.1. _U%!172>0 . |
00010680  f2 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
00010690  52 65 74 75 72 6e 28 5f  55 25 21 31 37 32 29 0d  |Return(_U%!172).|
000106a0  08 83 29 5f 55 25 21 31  37 32 3d a4 73 68 65 6c  |..)_U%!172=.shel|
000106b0  6c 5f 48 65 61 70 42 6c  6f 63 6b 46 65 74 63 68  |l_HeapBlockFetch|
000106c0  28 a9 66 6e 24 2b 31 29  0d 08 84 1c 74 65 6d 70  |(.fn$+1)....temp|
000106d0  25 3d 5f 55 25 21 31 37  32 3a 24 74 65 6d 70 25  |%=_U%!172:$temp%|
000106e0  3d 66 6e 24 0d 08 85 05  e1 0d 08 86 05 3a 0d 08  |=fn$.........:..|
000106f0  87 2f 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |./*|Stop PROCshe|
00010700  6c 6c 5f 41 74 74 61 63  68 54 61 73 6b 43 6c 6f  |ll_AttachTaskClo|
00010710  73 65 44 6f 77 6e 48 61  6e 64 6c 65 72 0d 08 88  |seDownHandler...|
00010720  04 0d 08 89 1e 2a 7c 53  74 61 72 74 20 50 52 4f  |.....*|Start PRO|
00010730  43 73 68 65 6c 6c 5f 52  41 4d 46 65 74 63 68 0d  |Cshell_RAMFetch.|
00010740  08 8a 1a dd 20 f2 73 68  65 6c 6c 5f 52 41 4d 46  |.... .shell_RAMF|
00010750  65 74 63 68 28 5f 51 25  29 0d 08 8b 26 ea 20 52  |etch(_Q%)...&. R|
00010760  41 4d 46 65 74 63 68 5f  62 75 66 66 65 72 25 2c  |AMFetch_buffer%,|
00010770  6c 65 6e 5f 64 61 74 61  25 2c 64 6f 6e 65 25 0d  |len_data%,done%.|
00010780  08 8c 0b 64 6f 6e 65 25  3d a3 0d 08 8d 46 f4 20  |...done%=....F. |
00010790  49 66 20 74 68 65 20 61  64 64 72 65 73 73 20 69  |If the address i|
000107a0  6e 20 74 68 65 20 64 61  74 61 20 73 61 76 65 20  |n the data save |
000107b0  65 76 65 6e 74 20 62 6c  6f 63 6b 20 3c 26 38 30  |event block <&80|
000107c0  30 30 20 74 68 65 6e 20  69 74 20 69 73 20 61 6e  |00 then it is an|
000107d0  0d 08 8e 49 f4 20 65 73  74 69 6d 61 74 65 64 20  |...I. estimated |
000107e0  73 69 7a 65 20 61 6e 64  20 74 68 65 20 66 69 6c  |size and the fil|
000107f0  65 20 69 73 20 6e 6f 74  20 61 6c 72 65 61 64 79  |e is not already|
00010800  20 70 72 65 73 65 6e 74  20 69 6e 20 61 20 52 41  | present in a RA|
00010810  4d 20 62 75 66 66 65 72  2e 0d 08 8f 4b f4 20 49  |M buffer....K. I|
00010820  6e 20 74 68 69 73 20 63  61 73 65 20 69 67 6e 6f  |n this case igno|
00010830  72 65 20 52 41 4d 46 65  74 63 68 20 6d 65 73 73  |re RAMFetch mess|
00010840  61 67 65 20 61 73 20 74  68 65 20 64 61 74 61 20  |age as the data |
00010850  77 69 6c 6c 20 62 65 20  77 72 69 74 74 65 6e 20  |will be written |
00010860  74 6f 20 61 0d 08 90 13  f4 20 66 69 6c 65 20 61  |to a..... file a|
00010870  6e 79 77 61 79 2e 2e 0d  08 91 15 e7 20 5f 55 25  |nyway....... _U%|
00010880  21 31 34 34 3e 26 38 30  30 30 20 8c 0d 08 92 20  |!144>&8000 .... |
00010890  20 20 f4 20 53 65 6e 64  20 66 69 6c 65 20 74 6f  |  . Send file to|
000108a0  20 61 70 70 6c 69 63 61  74 69 6f 6e 0d 08 93 23  | application...#|
000108b0  20 20 f4 20 73 65 6e 64  20 52 41 4d 54 72 61 6e  |  . send RAMTran|
000108c0  73 6d 69 74 20 6d 65 73  73 61 67 65 2e 2e 2e 0d  |smit message....|
000108d0  08 94 15 2a 7c 69 66 64  65 66 20 54 72 61 63 65  |...*|ifdef Trace|
000108e0  49 6e 69 74 0d 08 95 32  20 20 f2 73 68 65 6c 6c  |Init...2  .shell|
000108f0  5f 54 72 61 63 65 66 30  28 22 52 41 4d 46 65 74  |_Tracef0("RAMFet|
00010900  63 68 3a 52 41 4d 46 65  74 63 68 20 63 61 6c 6c  |ch:RAMFetch call|
00010910  65 64 2e 2e 22 29 0d 08  96 0b 2a 7c 65 6e 64 69  |ed..")....*|endi|
00010920  66 0d 08 97 13 20 20 5f  51 25 21 31 32 3d 5f 51  |f....  _Q%!12=_Q|
00010930  25 21 30 38 0d 08 98 2b  20 20 5f 51 25 21 31 36  |%!08...+  _Q%!16|
00010940  3d 37 3a f4 20 6d 65 73  73 61 67 65 20 61 63 74  |=7:. message act|
00010950  69 6f 6e 20 52 41 4d 54  72 61 6e 73 6d 69 74 0d  |ion RAMTransmit.|
00010960  08 99 1b 20 20 f4 20 67  65 74 20 62 75 66 66 65  |...  . get buffe|
00010970  72 20 6c 65 6e 67 74 68  2e 2e 0d 08 9a 17 20 20  |r length......  |
00010980  6c 65 6e 5f 64 61 74 61  25 3d 5f 55 25 21 31 33  |len_data%=_U%!13|
00010990  36 0d 08 9b 16 20 20 e7  20 5f 55 25 21 31 34 30  |6....  . _U%!140|
000109a0  3d 26 46 46 39 20 8c 0d  08 9c 48 20 20 20 20 f4  |=&FF9 ....H    .|
000109b0  20 6b 6c 75 64 67 65 20  66 6f 72 20 73 70 72 69  | kludge for spri|
000109c0  74 65 20 66 69 6c 65 73  20 62 65 63 61 75 73 65  |te files because|
000109d0  20 77 68 65 6e 20 73 61  76 69 6e 67 20 74 6f 20  | when saving to |
000109e0  61 20 70 68 79 73 69 63  61 6c 20 66 69 6c 65 0d  |a physical file.|
000109f0  08 9d 49 20 20 20 20 f4  20 77 69 74 68 20 22 4f  |..I    . with "O|
00010a00  53 5f 53 70 72 69 74 65  4f 70 22 20 74 68 65 20  |S_SpriteOp" the |
00010a10  66 69 72 73 74 20 77 6f  72 64 20 69 73 20 64 72  |first word is dr|
00010a20  6f 70 70 65 64 2e 20 48  65 6e 63 65 20 66 6f 72  |opped. Hence for|
00010a30  20 74 68 65 20 52 41 4d  0d 08 9e 49 20 20 20 20  | the RAM...I    |
00010a40  f4 20 73 61 76 65 20 77  65 20 68 61 76 65 20 74  |. save we have t|
00010a50  6f 20 69 6e 63 72 65 6d  65 6d 74 20 74 68 65 20  |o incrememt the |
00010a60  61 64 64 72 65 73 73 20  74 68 65 20 64 61 74 61  |address the data|
00010a70  20 69 73 20 68 65 6c 64  20 61 74 20 62 79 20 34  | is held at by 4|
00010a80  21 0d 08 9f 4d 20 20 20  20 f4 20 54 68 65 20 65  |!...M    . The e|
00010a90  73 74 69 6d 61 74 65 64  20 73 69 7a 65 20 68 61  |stimated size ha|
00010aa0  73 20 61 6c 72 65 61 64  79 20 62 65 65 6e 20 6b  |s already been k|
00010ab0  6c 75 64 67 65 64 20 69  6e 20 73 68 65 6c 6c 5f  |ludged in shell_|
00010ac0  41 74 74 61 63 68 44 61  74 61 53 61 76 65 0d 08  |AttachDataSave..|
00010ad0  a0 12 20 20 20 20 5f 55  25 21 31 34 34 2b 3d 34  |..    _U%!144+=4|
00010ae0  0d 08 a1 07 20 20 cd 0d  08 a2 24 20 20 e7 20 28  |....  ....$  . (|
00010af0  6c 65 6e 5f 64 61 74 61  25 2d 5f 55 25 21 31 32  |len_data%-_U%!12|
00010b00  38 29 3c 5f 51 25 21 32  34 20 8c 0d 08 a3 26 20  |8)<_Q%!24 ....& |
00010b10  20 20 20 f4 20 20 54 68  69 73 20 77 69 6c 6c 20  |   .  This will |
00010b20  62 65 20 74 68 65 20 6c  61 73 74 20 62 6c 6f 63  |be the last bloc|
00010b30  6b 0d 08 a4 20 20 20 20  20 5f 51 25 21 32 34 3d  |k...     _Q%!24=|
00010b40  6c 65 6e 5f 64 61 74 61  25 2d 5f 55 25 21 31 32  |len_data%-_U%!12|
00010b50  38 0d 08 a5 0f 20 20 20  20 64 6f 6e 65 25 3d b9  |8....    done%=.|
00010b60  0d 08 a6 07 20 20 cc 0d  08 a7 15 2a 7c 69 66 64  |....  .....*|ifd|
00010b70  65 66 20 54 72 61 63 65  49 6e 69 74 0d 08 a8 2e  |ef TraceInit....|
00010b80  20 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |  .shell_Tracef0|
00010b90  28 22 52 41 4d 46 65 74  63 68 3a 53 65 6e 64 69  |("RAMFetch:Sendi|
00010ba0  6e 67 20 62 6c 6f 63 6b  22 29 0d 08 a9 0b 2a 7c  |ng block")....*||
00010bb0  65 6e 64 69 66 0d 08 aa  07 20 20 cd 0d 08 ab 4a  |endif....  ....J|
00010bc0  20 20 c8 99 20 22 57 69  6d 70 5f 54 72 61 6e 73  |  .. "Wimp_Trans|
00010bd0  66 65 72 42 6c 6f 63 6b  22 2c 5f 55 25 21 31 34  |ferBlock",_U%!14|
00010be0  38 2c 5f 55 25 21 31 34  34 2b 5f 55 25 21 31 32  |8,_U%!144+_U%!12|
00010bf0  38 2c 5f 51 25 21 30 34  2c 5f 51 25 21 32 30 2c  |8,_Q%!04,_Q%!20,|
00010c00  5f 51 25 21 32 34 0d 08  ac 29 20 20 c8 99 20 22  |_Q%!24...)  .. "|
00010c10  57 69 6d 70 5f 53 65 6e  64 4d 65 73 73 61 67 65  |Wimp_SendMessage|
00010c20  22 2c 31 37 2c 5f 51 25  2c 5f 51 25 21 30 34 0d  |",17,_Q%,_Q%!04.|
00010c30  08 ad 20 20 20 5f 55 25  21 31 32 30 3d 5f 51 25  |..   _U%!120=_Q%|
00010c40  21 38 20 20 3a f4 20 53  61 76 65 52 65 66 25 0d  |!8  :. SaveRef%.|
00010c50  08 ae 1f 20 20 5f 55 25  21 31 32 38 2b 3d 5f 51  |...  _U%!128+=_Q|
00010c60  25 21 32 34 3a f4 20 52  41 4d 50 74 72 25 0d 08  |%!24:. RAMPtr%..|
00010c70  af 19 20 20 e7 20 64 6f  6e 65 25 20 8c 20 5f 55  |..  . done% . _U|
00010c80  25 21 31 32 38 3d 30 0d  08 b0 05 cd 0d 08 b1 05  |%!128=0.........|
00010c90  e1 0d 08 b2 05 3a 0d 08  b3 1d 2a 7c 53 74 6f 70  |.....:....*|Stop|
00010ca0  20 50 52 4f 43 73 68 65  6c 6c 5f 52 41 4d 46 65  | PROCshell_RAMFe|
00010cb0  74 63 68 0d 08 b4 21 2a  7c 53 74 61 72 74 20 50  |tch...!*|Start P|
00010cc0  52 4f 43 73 68 65 6c 6c  5f 52 41 4d 54 72 61 6e  |ROCshell_RAMTran|
00010cd0  73 6d 69 74 0d 08 b5 1d  dd 20 f2 73 68 65 6c 6c  |smit..... .shell|
00010ce0  5f 52 41 4d 54 72 61 6e  73 6d 69 74 28 5f 51 25  |_RAMTransmit(_Q%|
00010cf0  29 0d 08 b6 20 ea 20 6f  66 66 73 65 74 25 2c 62  |)... . offset%,b|
00010d00  6c 6b 25 2c 66 5f 6e 61  6d 65 24 2c 74 65 6d 70  |lk%,f_name$,temp|
00010d10  25 0d 08 b7 36 f4 20 52  65 63 65 69 76 65 20 66  |%...6. Receive f|
00010d20  69 6c 65 20 66 72 6f 6d  20 61 70 70 6c 69 63 61  |ile from applica|
00010d30  74 69 6f 6e 20 76 69 61  20 52 41 4d 20 74 72 61  |tion via RAM tra|
00010d40  6e 73 66 65 72 2e 2e 0d  08 b8 16 e7 20 5f 51 25  |nsfer....... _Q%|
00010d50  21 31 32 3d 5f 55 25 21  31 31 32 20 8c 0d 08 b9  |!12=_U%!112 ....|
00010d60  15 20 20 5f 55 25 21 31  32 38 2b 3d 5f 51 25 21  |.  _U%!128+=_Q%!|
00010d70  32 34 0d 08 ba 18 20 20  e7 20 5f 51 25 21 32 34  |24....  . _Q%!24|
00010d80  3c 5f 55 25 21 31 33 32  20 8c 0d 08 bb 21 20 20  |<_U%!132 ....!  |
00010d90  20 20 f4 20 54 68 69 73  20 77 61 73 20 74 68 65  |  . This was the|
00010da0  20 6c 61 73 74 20 62 6c  6f 63 6b 0d 08 bc 15 2a  | last block....*|
00010db0  7c 69 66 64 65 66 20 54  72 61 63 65 49 6e 69 74  ||ifdef TraceInit|
00010dc0  0d 08 bd 37 20 20 f2 73  68 65 6c 6c 5f 54 72 61  |...7  .shell_Tra|
00010dd0  63 65 66 30 28 22 52 41  4d 54 72 61 6e 73 6d 69  |cef0("RAMTransmi|
00010de0  74 3a 4c 61 73 74 20 62  6c 6f 63 6b 20 72 65 63  |t:Last block rec|
00010df0  65 69 76 65 64 22 29 0d  08 be 0b 2a 7c 65 6e 64  |eived")....*|end|
00010e00  69 66 0d 08 bf 44 20 20  20 20 6f 66 66 73 65 74  |if...D    offset|
00010e10  25 3d a4 73 68 65 6c 6c  5f 47 65 74 45 76 65 6e  |%=.shell_GetEven|
00010e20  74 4c 69 73 74 4f 66 66  73 65 74 28 5f 55 25 21  |tListOffset(_U%!|
00010e30  32 38 2c 5f 55 25 21 33  32 2c 5f 55 25 2b 39 36  |28,_U%!32,_U%+96|
00010e40  2c 31 36 2c a3 29 0d 08  c0 1b 20 20 20 20 62 6c  |,16,.)....    bl|
00010e50  6b 25 3d 5f 55 25 21 39  36 2b 6f 66 66 73 65 74  |k%=_U%!96+offset|
00010e60  25 0d 08 c1 17 20 20 2a  7c 69 66 64 65 66 20 54  |%....  *|ifdef T|
00010e70  72 61 63 65 49 6e 69 74  0d 08 c2 33 20 20 f2 73  |raceInit...3  .s|
00010e80  68 65 6c 6c 5f 54 72 61  63 65 66 30 28 22 52 41  |hell_Tracef0("RA|
00010e90  4d 54 72 61 6e 73 6d 69  74 3a 5f 55 25 21 32 38  |MTransmit:_U%!28|
00010ea0  3d 22 2b c3 5f 55 25 21  32 38 29 0d 08 c3 33 20  |="+._U%!28)...3 |
00010eb0  20 f2 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  | .shell_Tracef0(|
00010ec0  22 52 41 4d 54 72 61 6e  73 6d 69 74 3a 5f 55 25  |"RAMTransmit:_U%|
00010ed0  21 33 32 3d 22 2b c3 5f  55 25 21 33 32 29 0d 08  |!32="+._U%!32)..|
00010ee0  c4 35 20 20 f2 73 68 65  6c 6c 5f 54 72 61 63 65  |.5  .shell_Trace|
00010ef0  66 30 28 22 52 41 4d 54  72 61 6e 73 6d 69 74 3a  |f0("RAMTransmit:|
00010f00  6f 66 66 73 65 74 25 3d  22 2b c3 6f 66 66 73 65  |offset%="+.offse|
00010f10  74 25 29 0d 08 c5 0d 20  20 2a 7c 65 6e 64 69 66  |t%)....  *|endif|
00010f20  0d 08 c6 33 20 20 20 20  f4 20 6e 6f 77 20 63 61  |...3    . now ca|
00010f30  6c 6c 20 75 73 65 72 20  66 75 6e 63 74 69 6f 6e  |ll user function|
00010f40  20 61 66 74 65 72 20 66  69 6c 65 20 6c 6f 61 64  | after file load|
00010f50  2e 2e 2e 0d 08 c7 4c 20  20 20 20 f4 20 75 73 65  |......L    . use|
00010f60  20 63 6f 70 79 20 6f 66  20 64 61 74 61 73 61 76  | copy of datasav|
00010f70  65 20 6d 65 73 73 61 67  65 20 62 6c 6f 63 6b 20  |e message block |
00010f80  74 6f 20 66 69 6e 64 20  66 69 6c 65 20 74 79 70  |to find file typ|
00010f90  65 2c 20 66 69 6c 65 20  6e 61 6d 65 2e 2e 2e 0d  |e, file name....|
00010fa0  08 c8 15 20 20 20 20 74  65 6d 70 25 3d 5f 55 25  |...    temp%=_U%|
00010fb0  21 31 35 36 0d 08 c9 2a  20 20 20 20 66 5f 6e 61  |!156...*    f_na|
00010fc0  6d 65 24 3d a4 73 68 65  6c 6c 5f 47 65 74 53 74  |me$=.shell_GetSt|
00010fd0  72 69 6e 67 28 74 65 6d  70 25 2b 34 34 29 0d 08  |ring(temp%+44)..|
00010fe0  ca 4b 20 20 20 20 f2 73  68 65 6c 6c 5f 55 73 65  |.K    .shell_Use|
00010ff0  72 46 4e 4c 6f 61 64 46  69 6c 65 28 74 65 6d 70  |rFNLoadFile(temp|
00011000  25 21 34 30 2c 5f 55 25  21 31 35 32 2c 62 6c 6b  |%!40,_U%!152,blk|
00011010  25 21 38 2c 66 5f 6e 61  6d 65 24 2c 5f 55 25 21  |%!8,f_name$,_U%!|
00011020  31 33 32 2c 62 6c 6b 25  29 0d 08 cb 07 20 20 cc  |132,blk%)....  .|
00011030  0d 08 cc 27 20 20 20 20  f4 20 54 68 65 72 65 20  |...'    . There |
00011040  61 72 65 20 6d 6f 72 65  20 62 6c 6f 63 6b 73 20  |are more blocks |
00011050  74 6f 20 63 6f 6d 65 0d  08 cd 15 2a 7c 69 66 64  |to come....*|ifd|
00011060  65 66 20 54 72 61 63 65  49 6e 69 74 0d 08 ce 32  |ef TraceInit...2|
00011070  20 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |  .shell_Tracef0|
00011080  28 22 52 41 4d 54 72 61  6e 73 6d 69 74 3a 42 6c  |("RAMTransmit:Bl|
00011090  6f 63 6b 20 72 65 63 65  69 76 65 64 22 29 0d 08  |ock received")..|
000110a0  cf 0b 2a 7c 65 6e 64 69  66 0d 08 d0 3d 20 20 20  |..*|endif...=   |
000110b0  20 f4 20 63 68 65 63 6b  20 73 69 7a 65 20 6f 66  | . check size of|
000110c0  20 69 6e 63 6f 6d 69 6e  67 20 62 6c 6f 63 6b 20  | incoming block |
000110d0  61 6e 64 20 69 6e 63 72  65 61 73 65 20 62 75 66  |and increase buf|
000110e0  66 65 72 20 69 66 0d 08  d1 15 20 20 20 20 f4 20  |fer if....    . |
000110f0  72 65 71 75 69 72 65 64  2e 2e 2e 0d 08 d2 1b 20  |required....... |
00011100  20 20 20 e7 20 5f 55 25  21 31 32 38 3e 5f 55 25  |   . _U%!128>_U%|
00011110  21 31 33 32 20 8c 0d 08  d3 15 2a 7c 69 66 64 65  |!132 .....*|ifde|
00011120  66 20 54 72 61 63 65 49  6e 69 74 0d 08 d4 3c 20  |f TraceInit...< |
00011130  20 f2 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  | .shell_Tracef0(|
00011140  22 52 41 4d 54 72 61 6e  73 6d 69 74 3a 49 6e 63  |"RAMTransmit:Inc|
00011150  72 65 61 73 69 6e 67 20  62 75 66 66 65 72 20 73  |reasing buffer s|
00011160  69 7a 65 2e 2e 22 29 0d  08 d5 0b 2a 7c 65 6e 64  |ize..")....*|end|
00011170  69 66 0d 08 d6 41 20 20  20 20 20 20 5f 55 25 21  |if...A      _U%!|
00011180  31 35 32 3d a4 73 68 65  6c 6c 5f 48 65 61 70 42  |152=.shell_HeapB|
00011190  6c 6f 63 6b 45 78 74 65  6e 64 28 5f 55 25 21 31  |lockExtend(_U%!1|
000111a0  35 32 2c 5f 55 25 21 31  32 38 2c 5f 55 25 21 31  |52,_U%!128,_U%!1|
000111b0  33 32 29 0d 08 d7 09 20  20 20 20 cd 0d 08 d8 15  |32)....    .....|
000111c0  20 20 20 20 5f 51 25 21  31 32 3d 5f 51 25 21 30  |    _Q%!12=_Q%!0|
000111d0  38 0d 08 d9 10 20 20 20  20 5f 51 25 21 31 36 3d  |8....    _Q%!16=|
000111e0  36 0d 08 da 1e 20 20 20  20 5f 51 25 21 32 30 3d  |6....    _Q%!20=|
000111f0  5f 55 25 21 31 35 32 2b  5f 55 25 21 31 32 38 0d  |_U%!152+_U%!128.|
00011200  08 db 16 20 20 20 20 5f  51 25 21 32 34 3d 5f 55  |...    _Q%!24=_U|
00011210  25 21 31 33 32 0d 08 dc  2b 20 20 20 20 c8 99 20  |%!132...+    .. |
00011220  22 57 69 6d 70 5f 53 65  6e 64 4d 65 73 73 61 67  |"Wimp_SendMessag|
00011230  65 22 2c 31 38 2c 5f 51  25 2c 5f 51 25 21 30 34  |e",18,_Q%,_Q%!04|
00011240  0d 08 dd 16 20 20 20 20  5f 55 25 21 31 31 32 3d  |....    _U%!112=|
00011250  5f 51 25 21 30 38 0d 08  de 07 20 20 cd 0d 08 df  |_Q%!08....  ....|
00011260  05 cc 0d 08 e0 1d 20 20  f4 20 74 6f 6f 20 6d 75  |......  . too mu|
00011270  63 68 20 64 61 74 61 20  73 65 6e 74 2e 2e 2e 0d  |ch data sent....|
00011280  08 e1 25 20 20 f2 73 68  65 6c 6c 5f 48 65 61 70  |..%  .shell_Heap|
00011290  42 6c 6f 63 6b 52 65 74  75 72 6e 28 5f 55 25 21  |BlockReturn(_U%!|
000112a0  31 35 32 29 0d 08 e2 0f  20 20 5f 55 25 21 31 35  |152)....  _U%!15|
000112b0  32 3d 30 0d 08 e3 33 20  20 f2 73 68 65 6c 6c 5f  |2=0...3  .shell_|
000112c0  4f 4b 28 a4 73 68 65 6c  6c 5f 4d 65 73 73 61 67  |OK(.shell_Messag|
000112d0  65 4e 6f 41 72 67 73 28  22 53 48 45 4c 4c 4d 53  |eNoArgs("SHELLMS|
000112e0  47 31 35 22 29 29 0d 08  e4 05 cd 0d 08 e5 05 e1  |G15"))..........|
000112f0  0d 08 e6 05 3a 0d 08 e7  20 2a 7c 53 74 6f 70 20  |....:... *|Stop |
00011300  50 52 4f 43 73 68 65 6c  6c 5f 52 41 4d 54 72 61  |PROCshell_RAMTra|
00011310  6e 73 6d 69 74 0d 08 e8  1c 2a 7c 53 74 61 72 74  |nsmit....*|Start|
00011320  20 46 4e 73 68 65 6c 6c  5f 4c 6f 61 64 46 69 6c  | FNshell_LoadFil|
00011330  65 0d 08 e9 1d dd 20 a4  73 68 65 6c 6c 5f 4c 6f  |e..... .shell_Lo|
00011340  61 64 46 69 6c 65 28 53  63 72 61 70 25 29 0d 08  |adFile(Scrap%)..|
00011350  ea 25 ea 20 4e 61 6d 65  24 2c 46 69 6c 65 53 69  |.%. Name$,FileSi|
00011360  7a 65 25 2c 46 6c 61 67  73 25 2c 6c 6f 61 64 6c  |ze%,Flags%,loadl|
00011370  6f 63 25 0d 08 eb 22 4e  61 6d 65 24 3d a4 73 68  |oc%..."Name$=.sh|
00011380  65 6c 6c 5f 47 65 74 53  74 72 69 6e 67 28 5f 51  |ell_GetString(_Q|
00011390  25 2b 34 34 29 0d 08 ec  26 46 69 6c 65 53 69 7a  |%+44)...&FileSiz|
000113a0  65 25 3d a4 73 68 65 6c  6c 5f 46 69 6c 65 4c 65  |e%=.shell_FileLe|
000113b0  6e 67 74 68 28 4e 61 6d  65 24 29 0d 08 ed 41 e7  |ngth(Name$)...A.|
000113c0  20 46 69 6c 65 53 69 7a  65 25 3c 30 20 8c 20 f2  | FileSize%<0 . .|
000113d0  73 68 65 6c 6c 5f 4f 4b  28 a4 73 68 65 6c 6c 5f  |shell_OK(.shell_|
000113e0  4d 65 73 73 61 67 65 4e  6f 41 72 67 73 28 22 53  |MessageNoArgs("S|
000113f0  48 45 4c 4c 4d 53 47 31  36 22 29 29 0d 08 ee 2d  |HELLMSG16"))...-|
00011400  6c 6f 61 64 6c 6f 63 25  3d a4 73 68 65 6c 6c 5f  |loadloc%=.shell_|
00011410  48 65 61 70 42 6c 6f 63  6b 46 65 74 63 68 28 46  |HeapBlockFetch(F|
00011420  69 6c 65 53 69 7a 65 25  29 0d 08 ef 2f c8 99 20  |ileSize%).../.. |
00011430  22 58 4f 53 5f 46 69 6c  65 22 2c 31 36 2c 4e 61  |"XOS_File",16,Na|
00011440  6d 65 24 2c 6c 6f 61 64  6c 6f 63 25 2c 30 20 b8  |me$,loadloc%,0 .|
00011450  20 3b 46 6c 61 67 73 25  0d 08 f0 1c e7 20 a4 73  | ;Flags%..... .s|
00011460  68 65 6c 6c 5f 56 46 6c  61 67 28 46 6c 61 67 73  |hell_VFlag(Flags|
00011470  25 29 20 8c 0d 08 f1 26  20 20 f2 73 68 65 6c 6c  |%) ....&  .shell|
00011480  5f 48 65 61 70 42 6c 6f  63 6b 52 65 74 75 72 6e  |_HeapBlockReturn|
00011490  28 6c 6f 61 64 6c 6f 63  25 29 0d 08 f2 33 20 20  |(loadloc%)...3  |
000114a0  f2 73 68 65 6c 6c 5f 4f  4b 28 a4 73 68 65 6c 6c  |.shell_OK(.shell|
000114b0  5f 4d 65 73 73 61 67 65  4e 6f 41 72 67 73 28 22  |_MessageNoArgs("|
000114c0  53 48 45 4c 4c 4d 53 47  31 37 22 29 29 0d 08 f3  |SHELLMSG17"))...|
000114d0  05 cc 0d 08 f4 15 2a 7c  69 66 64 65 66 20 54 72  |......*|ifdef Tr|
000114e0  61 63 65 49 6e 69 74 0d  08 f5 49 20 20 f2 73 68  |aceInit...I  .sh|
000114f0  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 4c 6f 61  |ell_Tracef0("Loa|
00011500  64 46 69 6c 65 3a 46 69  6c 65 20 22 2b 4e 61 6d  |dFile:File "+Nam|
00011510  65 24 2b 22 20 6c 6f 61  64 65 64 20 6f 6b 20 61  |e$+" loaded ok a|
00011520  74 20 26 22 2b c3 7e 6c  6f 61 64 6c 6f 63 25 29  |t &"+.~loadloc%)|
00011530  0d 08 f6 0b 2a 7c 65 6e  64 69 66 0d 08 f7 05 cd  |....*|endif.....|
00011540  0d 08 f8 27 f4 20 53 74  75 66 66 20 66 6f 72 20  |...'. Stuff for |
00011550  66 69 6c 65 69 6e 66 6f  20 62 6f 78 2e 2e 2e 2e  |fileinfo box....|
00011560  2e 2e 2e 2e 2e 2e 2e 0d  08 f9 28 f4 20 50 52 4f  |..........(. PRO|
00011570  43 44 61 74 65 28 46 4e  46 69 6c 65 54 69 6d 65  |CDate(FNFileTime|
00011580  41 6e 64 44 61 74 65 28  4e 61 6d 65 24 29 29 0d  |AndDate(Name$)).|
00011590  08 fa 14 f4 20 49 46 20  53 63 72 61 70 25 20 54  |.... IF Scrap% T|
000115a0  48 45 4e 0d 08 fb 2a f4  20 20 20 53 59 53 20 22  |HEN...*.   SYS "|
000115b0  58 4f 53 5f 46 53 43 6f  6e 74 72 6f 6c 22 2c 32  |XOS_FSControl",2|
000115c0  37 2c 28 5f 51 25 2b 34  34 29 2c 2c 32 0d 08 fc  |7,(_Q%+44),,2...|
000115d0  1a f4 20 20 20 50 52 4f  43 4d 6f 64 69 66 69 65  |..   PROCModifie|
000115e0  64 28 54 52 55 45 29 0d  08 fd 0a f4 20 45 4c 53  |d(TRUE)..... ELS|
000115f0  45 0d 08 fe 17 f4 20 20  20 50 52 4f 43 4e 61 6d  |E.....   PROCNam|
00011600  65 28 4e 61 6d 65 24 29  0d 08 ff 18 f4 20 20 20  |e(Name$).....   |
00011610  50 52 4f 43 54 79 70 65  28 5f 51 25 21 34 30 29  |PROCType(_Q%!40)|
00011620  0d 09 00 1b f4 20 20 20  50 52 4f 43 4d 6f 64 69  |.....   PROCModi|
00011630  66 69 65 64 28 46 41 4c  53 45 29 0d 09 01 0b f4  |fied(FALSE).....|
00011640  20 45 4e 44 49 46 0d 09  02 11 f4 20 50 52 4f 43  | ENDIF..... PROC|
00011650  4e 65 77 46 69 6c 65 0d  09 03 0d 3d 6c 6f 61 64  |NewFile....=load|
00011660  6c 6f 63 25 0d 09 04 05  3a 0d 09 05 1b 2a 7c 53  |loc%....:....*|S|
00011670  74 6f 70 20 46 4e 73 68  65 6c 6c 5f 4c 6f 61 64  |top FNshell_Load|
00011680  46 69 6c 65 0d 09 06 04  0d 09 07 19 2a 7c 53 74  |File........*|St|
00011690  61 72 74 20 46 4e 73 68  65 6c 6c 5f 56 46 6c 61  |art FNshell_VFla|
000116a0  67 0d 09 08 1a dd 20 a4  73 68 65 6c 6c 5f 56 46  |g..... .shell_VF|
000116b0  6c 61 67 28 46 6c 61 67  73 25 29 0d 09 09 1d 3d  |lag(Flags%)....=|
000116c0  28 28 46 6c 61 67 73 25  20 80 20 25 30 30 30 31  |((Flags% . %0001|
000116d0  29 3d 25 30 30 30 31 29  0d 09 0a 05 3a 0d 09 0b  |)=%0001)....:...|
000116e0  18 2a 7c 53 74 6f 70 20  46 4e 73 68 65 6c 6c 5f  |.*|Stop FNshell_|
000116f0  56 46 6c 61 67 0d 09 0c  04 0d 09 0d 1d 2a 7c 53  |VFlag........*|S|
00011700  74 61 72 74 20 46 4e 73  68 65 6c 6c 5f 43 68 65  |tart FNshell_Che|
00011710  63 6b 54 79 70 65 0d 09  0e 32 dd 20 a4 73 68 65  |ckType...2. .she|
00011720  6c 6c 5f 43 68 65 63 6b  54 79 70 65 28 74 79 70  |ll_CheckType(typ|
00011730  65 25 2c 74 79 70 65 5f  6c 69 73 74 25 2c 44 61  |e%,type_list%,Da|
00011740  74 61 4f 70 65 6e 25 29  0d 09 0f 39 f4 20 45 78  |taOpen%)...9. Ex|
00011750  63 6c 75 64 65 20 64 69  72 65 63 74 6f 72 69 65  |clude directorie|
00011760  73 2c 20 61 70 70 6c 69  63 61 74 69 6f 6e 73 20  |s, applications |
00011770  26 20 75 6e 73 74 61 6d  70 65 64 20 66 69 6c 65  |& unstamped file|
00011780  73 0d 09 10 37 f4 20 74  79 70 65 5f 6c 69 73 74  |s...7. type_list|
00011790  25 20 69 73 20 61 64 64  72 65 73 73 20 6f 66 20  |% is address of |
000117a0  68 65 61 70 62 6c 6f 63  6b 20 68 6f 6c 64 69 6e  |heapblock holdin|
000117b0  67 20 61 20 6c 69 73 74  0d 09 11 2f f4 20 6f 66  |g a list.../. of|
000117c0  20 61 6c 6c 6f 77 61 62  6c 65 20 66 69 6c 65 74  | allowable filet|
000117d0  79 70 65 73 20 74 65 72  6d 69 6e 61 74 65 64 20  |ypes terminated |
000117e0  62 79 20 2d 31 2e 2e 0d  09 12 28 ea 20 4f 6b 25  |by -1.....(. Ok%|
000117f0  2c 63 74 72 25 2c 66 6f  75 6e 64 25 2c 74 65 6d  |,ctr%,found%,tem|
00011800  70 25 2c 74 6f 70 62 69  74 5f 6c 6f 61 64 25 0d  |p%,topbit_load%.|
00011810  09 13 23 63 74 72 25 3d  30 3a 66 6f 75 6e 64 25  |..#ctr%=0:found%|
00011820  3d 2d 31 3a 74 6f 70 62  69 74 5f 6c 6f 61 64 25  |=-1:topbit_load%|
00011830  3d a3 0d 09 14 2d e7 20  5f 55 25 21 31 30 30 20  |=....-. _U%!100 |
00011840  80 20 31 3c 3c 31 20 8c  20 5f 55 25 21 31 30 30  |. 1<<1 . _U%!100|
00011850  3d 5f 55 25 21 31 30 30  20 82 20 31 3c 3c 31 0d  |=_U%!100 . 1<<1.|
00011860  09 15 1a c8 95 20 74 79  70 65 5f 6c 69 73 74 25  |..... type_list%|
00011870  21 63 74 72 25 3c 3e 2d  31 0d 09 16 1b 20 20 74  |!ctr%<>-1....  t|
00011880  65 6d 70 25 3d 74 79 70  65 5f 6c 69 73 74 25 21  |emp%=type_list%!|
00011890  63 74 72 25 0d 09 17 17  20 20 e7 20 74 65 6d 70  |ctr%....  . temp|
000118a0  25 20 80 20 31 3c 3c 33  31 20 8c 0d 09 18 1b 20  |% . 1<<31 ..... |
000118b0  20 20 20 74 65 6d 70 25  3d 74 65 6d 70 25 20 82  |   temp%=temp% .|
000118c0  20 31 3c 3c 33 31 0d 09  19 16 20 20 20 20 74 6f  | 1<<31....    to|
000118d0  70 62 69 74 5f 6c 6f 61  64 25 3d b9 0d 09 1a 07  |pbit_load%=.....|
000118e0  20 20 cc 0d 09 1b 16 20  20 20 20 74 6f 70 62 69  |  .....    topbi|
000118f0  74 5f 6c 6f 61 64 25 3d  a3 0d 09 1c 07 20 20 cd  |t_load%=.....  .|
00011900  0d 09 1d 15 20 20 e7 20  74 65 6d 70 25 3d 74 79  |....  . temp%=ty|
00011910  70 65 25 20 8c 0d 09 1e  13 20 20 20 20 66 6f 75  |pe% .....    fou|
00011920  6e 64 25 3d 63 74 72 25  0d 09 1f 18 20 20 20 20  |nd%=ctr%....    |
00011930  e7 20 74 6f 70 62 69 74  5f 6c 6f 61 64 25 20 8c  |. topbit_load% .|
00011940  0d 09 20 20 20 20 20 20  20 20 5f 55 25 21 31 30  |..        _U%!10|
00011950  30 3d 5f 55 25 21 31 30  30 20 84 20 31 3c 3c 31  |0=_U%!100 . 1<<1|
00011960  0d 09 21 1b 20 20 20 20  20 20 2a 7c 69 66 64 65  |..!.      *|ifde|
00011970  66 20 54 72 61 63 65 49  6e 69 74 0d 09 22 3d 20  |f TraceInit.."= |
00011980  20 20 20 20 20 f2 73 68  65 6c 6c 5f 54 72 61 63  |     .shell_Trac|
00011990  65 66 30 28 22 43 68 65  63 6b 54 79 70 65 3a 54  |ef0("CheckType:T|
000119a0  6f 70 20 42 69 74 20 4c  6f 61 64 20 64 65 74 65  |op Bit Load dete|
000119b0  63 74 65 64 2e 2e 22 29  0d 09 23 11 20 20 20 20  |cted..")..#.    |
000119c0  20 20 2a 7c 65 6e 64 69  66 0d 09 24 09 20 20 20  |  *|endif..$.   |
000119d0  20 cd 0d 09 25 07 20 20  cd 0d 09 26 0d 20 20 63  | ...%.  ...&.  c|
000119e0  74 72 25 2b 3d 34 0d 09  27 05 ce 0d 09 28 2c e7  |tr%+=4..'....(,.|
000119f0  20 44 61 74 61 4f 70 65  6e 25 20 80 20 28 74 79  | DataOpen% . (ty|
00011a00  70 65 25 3e 3d 26 31 30  30 30 29 20 8c 20 66 6f  |pe%>=&1000) . fo|
00011a10  75 6e 64 25 3d 2d 31 0d  09 29 15 2a 7c 69 66 64  |und%=-1..).*|ifd|
00011a20  65 66 20 54 72 61 63 65  49 6e 69 74 0d 09 2a 11  |ef TraceInit..*.|
00011a30  e7 20 66 6f 75 6e 64 25  3e 2d 31 20 8c 0d 09 2b  |. found%>-1 ...+|
00011a40  43 20 20 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |C  .shell_Tracef|
00011a50  30 28 22 43 68 65 63 6b  54 79 70 65 3a 46 69 6c  |0("CheckType:Fil|
00011a60  65 20 74 79 70 65 20 4f  4b 20 22 2b c3 7e 74 79  |e type OK "+.~ty|
00011a70  70 65 5f 6c 69 73 74 25  21 66 6f 75 6e 64 25 29  |pe_list%!found%)|
00011a80  0d 09 2c 05 cc 0d 09 2d  3b 20 20 f2 73 68 65 6c  |..,....-;  .shel|
00011a90  6c 5f 54 72 61 63 65 66  30 28 22 43 68 65 63 6b  |l_Tracef0("Check|
00011aa0  54 79 70 65 3a 46 69 6c  65 20 74 79 70 65 20 4e  |Type:File type N|
00011ab0  4f 54 20 6f 6b 20 22 2b  c3 7e 74 79 70 65 25 29  |OT ok "+.~type%)|
00011ac0  0d 09 2e 05 cd 0d 09 2f  0b 2a 7c 65 6e 64 69 66  |......./.*|endif|
00011ad0  0d 09 30 1a e7 20 66 6f  75 6e 64 25 3c 3e 2d 31  |..0.. found%<>-1|
00011ae0  20 8c 20 3d b9 20 8b 20  3d a3 0d 09 31 05 3a 0d  | . =. . =...1.:.|
00011af0  09 32 1c 2a 7c 53 74 6f  70 20 46 4e 73 68 65 6c  |.2.*|Stop FNshel|
00011b00  6c 5f 43 68 65 63 6b 54  79 70 65 0d 09 33 04 0d  |l_CheckType..3..|
00011b10  09 34 1a 2a 7c 53 74 61  72 74 20 50 52 4f 43 73  |.4.*|Start PROCs|
00011b20  68 65 6c 6c 5f 45 78 69  74 0d 09 35 11 dd 20 f2  |hell_Exit..5.. .|
00011b30  73 68 65 6c 6c 5f 45 78  69 74 0d 09 36 0e ea 20  |shell_Exit..6.. |
00011b40  6d 73 5f 64 65 73 63 25  0d 09 37 13 6d 73 5f 64  |ms_desc%..7.ms_d|
00011b50  65 73 63 25 3d 5f 55 25  21 36 38 0d 09 38 29 c8  |esc%=_U%!68..8).|
00011b60  99 20 22 58 4d 65 73 73  61 67 65 54 72 61 6e 73  |. "XMessageTrans|
00011b70  5f 43 6c 6f 73 65 46 69  6c 65 22 2c 6d 73 5f 64  |_CloseFile",ms_d|
00011b80  65 73 63 25 0d 09 39 1f  c8 99 20 22 58 4f 53 5f  |esc%..9... "XOS_|
00011b90  4d 6f 64 75 6c 65 22 2c  37 2c 2c 6d 73 5f 64 65  |Module",7,,ms_de|
00011ba0  73 63 25 0d 09 3a 15 2a  7c 69 66 64 65 66 20 54  |sc%..:.*|ifdef T|
00011bb0  72 61 63 65 49 6e 69 74  0d 09 3b 33 f2 73 68 65  |raceInit..;3.she|
00011bc0  6c 6c 5f 54 72 61 63 65  66 30 28 22 45 78 69 74  |ll_Tracef0("Exit|
00011bd0  3a 41 70 70 6c 69 63 61  74 69 6f 6e 20 63 6c 6f  |:Application clo|
00011be0  73 69 6e 67 20 64 6f 77  6e 22 29 0d 09 3c 0b 2a  |sing down")..<.*|
00011bf0  7c 65 6e 64 69 66 0d 09  3d 14 f2 73 68 65 6c 6c  ||endif..=..shell|
00011c00  5f 54 72 61 63 65 45 78  69 74 0d 09 3e 18 c8 99  |_TraceExit..>...|
00011c10  20 22 48 6f 75 72 67 6c  61 73 73 5f 53 6d 61 73  | "Hourglass_Smas|
00011c20  68 22 0d 09 3f 19 c8 99  20 22 57 69 6d 70 5f 44  |h"..?... "Wimp_D|
00011c30  72 61 67 42 6f 78 22 2c  2c 2d 31 0d 09 40 23 f2  |ragBox",,-1..@#.|
00011c40  73 68 65 6c 6c 5f 57 69  6d 70 43 6c 6f 73 65 44  |shell_WimpCloseD|
00011c50  6f 77 6e 5f 49 28 5f 55  25 21 31 34 38 29 0d 09  |own_I(_U%!148)..|
00011c60  41 05 e1 0d 09 42 05 3a  0d 09 43 19 2a 7c 53 74  |A....B.:..C.*|St|
00011c70  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 45 78 69  |op PROCshell_Exi|
00011c80  74 0d 09 44 04 0d 09 45  1e 2a 7c 53 74 61 72 74  |t..D...E.*|Start|
00011c90  20 50 52 4f 43 73 68 65  6c 6c 5f 44 61 74 61 4c  | PROCshell_DataL|
00011ca0  6f 61 64 0d 09 46 24 dd  20 f2 73 68 65 6c 6c 5f  |oad..F$. .shell_|
00011cb0  44 61 74 61 4c 6f 61 64  28 5f 51 25 2c 44 61 74  |DataLoad(_Q%,Dat|
00011cc0  61 4f 70 65 6e 25 29 0d  09 47 3c ea 20 72 65 66  |aOpen%)..G<. ref|
00011cd0  65 72 65 6e 63 65 25 2c  6f 66 66 73 65 74 25 2c  |erence%,offset%,|
00011ce0  62 6c 6b 25 2c 5f 74 65  6d 70 25 2c 74 79 70 65  |blk%,_temp%,type|
00011cf0  5f 6c 69 73 74 25 2c 74  79 70 65 25 2c 66 6e 61  |_list%,type%,fna|
00011d00  6d 65 24 0d 09 48 10 74  79 70 65 25 3d 5f 51 25  |me$..H.type%=_Q%|
00011d10  21 34 30 0d 09 49 23 66  6e 61 6d 65 24 3d a4 73  |!40..I#fname$=.s|
00011d20  68 65 6c 6c 5f 47 65 74  53 74 72 69 6e 67 28 5f  |hell_GetString(_|
00011d30  51 25 2b 34 34 29 0d 09  4a 15 2a 7c 69 66 64 65  |Q%+44)..J.*|ifde|
00011d40  66 20 54 72 61 63 65 49  6e 69 74 0d 09 4b 38 f2  |f TraceInit..K8.|
00011d50  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 44  |shell_Tracef0("D|
00011d60  61 74 61 4c 6f 61 64 3a  44 61 74 61 4c 6f 61 64  |ataLoad:DataLoad|
00011d70  20 6d 65 73 73 61 67 65  20 72 65 63 65 69 76 65  | message receive|
00011d80  64 22 29 0d 09 4c 0b 2a  7c 65 6e 64 69 66 0d 09  |d")..L.*|endif..|
00011d90  4d 37 f4 20 63 68 65 63  6b 20 6d 79 5f 66 69 6c  |M7. check my_fil|
00011da0  65 5f 74 79 70 65 20 73  65 74 20 75 70 20 69 6e  |e_type set up in|
00011db0  20 73 68 65 6c 6c 5f 41  74 74 61 63 68 44 61 74  | shell_AttachDat|
00011dc0  61 4c 6f 61 64 0d 09 4e  3f f4 20 6f 6e 6c 79 20  |aLoad..N?. only |
00011dd0  77 6f 72 6b 73 20 77 68  65 6e 20 64 72 61 67 67  |works when dragg|
00011de0  69 6e 67 20 61 20 66 69  6c 65 20 61 73 20 77 68  |ing a file as wh|
00011df0  65 6e 20 44 61 74 61 4f  70 65 6e 25 20 69 73 20  |en DataOpen% is |
00011e00  54 52 55 45 0d 09 4f 2b  f4 20 74 68 65 20 5f 51  |TRUE..O+. the _Q|
00011e10  25 20 62 6c 6f 63 6b 20  69 73 20 73 65 74 20 75  |% block is set u|
00011e20  70 20 64 69 66 66 65 72  65 6e 74 6c 79 21 21 0d  |p differently!!.|
00011e30  09 50 11 e7 20 44 61 74  61 4f 70 65 6e 25 20 8c  |.P.. DataOpen% .|
00011e40  0d 09 51 1b 20 20 f4 20  64 6f 75 62 6c 65 20 63  |..Q.  . double c|
00011e50  6c 69 63 6b 20 6c 6f 61  64 2e 2e 0d 09 52 38 20  |lick load....R8 |
00011e60  20 f4 20 63 68 65 63 6b  20 69 66 20 74 68 65 72  | . check if ther|
00011e70  65 20 61 72 65 20 61 6e  79 20 64 61 74 61 6c 6f  |e are any datalo|
00011e80  61 64 20 65 76 65 6e 74  73 20 73 65 74 20 75 70  |ad events set up|
00011e90  2e 2e 2e 0d 09 53 13 20  20 e7 20 5f 55 25 21 39  |.....S.  . _U%!9|
00011ea0  36 3c 3e 30 20 8c 0d 09  54 38 20 20 20 20 6f 66  |6<>0 ...T8    of|
00011eb0  66 73 65 74 25 3d 30 3a  f4 20 6c 6f 6f 6b 20 61  |fset%=0:. look a|
00011ec0  74 20 66 69 72 73 74 20  64 61 74 61 6c 6f 61 64  |t first dataload|
00011ed0  20 65 76 65 6e 74 20 6f  6e 6c 79 2e 2e 2e 0d 09  | event only.....|
00011ee0  55 07 20 20 cc 0d 09 56  21 20 20 20 20 6f 66 66  |U.  ...V!    off|
00011ef0  73 65 74 25 3d 2d 31 3a  f4 20 69 67 6e 6f 72 65  |set%=-1:. ignore|
00011f00  20 69 74 2e 2e 2e 0d 09  57 07 20 20 cd 0d 09 58  | it.....W.  ...X|
00011f10  05 cc 0d 09 59 39 20 20  f4 20 64 72 61 67 20 6c  |....Y9  . drag l|
00011f20  6f 61 64 2c 20 63 68 65  63 6b 20 66 6f 72 20 73  |oad, check for s|
00011f30  70 65 63 69 66 69 63 20  77 69 6e 64 6f 77 2f 69  |pecific window/i|
00011f40  63 6f 6e 20 65 76 65 6e  74 2e 2e 0d 09 5a 42 20  |con event....ZB |
00011f50  20 6f 66 66 73 65 74 25  3d a4 73 68 65 6c 6c 5f  | offset%=.shell_|
00011f60  47 65 74 45 76 65 6e 74  4c 69 73 74 4f 66 66 73  |GetEventListOffs|
00011f70  65 74 28 5f 51 25 21 32  30 2c 5f 51 25 21 32 34  |et(_Q%!20,_Q%!24|
00011f80  2c 5f 55 25 2b 39 36 2c  31 36 2c a3 29 0d 09 5b  |,_U%+96,16,.)..[|
00011f90  14 20 20 e7 20 6f 66 66  73 65 74 25 3d 2d 31 20  |.  . offset%=-1 |
00011fa0  8c 0d 09 5c 2c 20 20 20  20 f4 20 6e 6f 77 20 63  |...\,    . now c|
00011fb0  68 65 63 6b 20 66 6f 72  20 77 69 6e 64 6f 77 20  |heck for window |
00011fc0  68 61 6e 64 6c 65 20 6f  6e 6c 79 2e 2e 0d 09 5d  |handle only....]|
00011fd0  40 20 20 20 20 6f 66 66  73 65 74 25 3d a4 73 68  |@    offset%=.sh|
00011fe0  65 6c 6c 5f 47 65 74 45  76 65 6e 74 4c 69 73 74  |ell_GetEventList|
00011ff0  4f 66 66 73 65 74 28 5f  51 25 21 32 30 2c 2d 31  |Offset(_Q%!20,-1|
00012000  2c 5f 55 25 2b 39 36 2c  31 36 2c a3 29 0d 09 5e  |,_U%+96,16,.)..^|
00012010  07 20 20 cd 0d 09 5f 05  cd 0d 09 60 12 e7 20 6f  |.  ..._....`.. o|
00012020  66 66 73 65 74 25 3e 2d  31 20 8c 0d 09 61 1c 20  |ffset%>-1 ...a. |
00012030  20 f4 20 44 61 74 61 4c  6f 61 64 45 76 65 6e 74  | . DataLoadEvent|
00012040  20 65 78 69 73 74 73 0d  09 62 19 20 20 62 6c 6b  | exists..b.  blk|
00012050  25 3d 5f 55 25 21 39 36  2b 6f 66 66 73 65 74 25  |%=_U%!96+offset%|
00012060  0d 09 63 33 20 20 e7 20  a4 73 68 65 6c 6c 5f 43  |..c3  . .shell_C|
00012070  68 65 63 6b 54 79 70 65  28 5f 51 25 21 34 30 2c  |heckType(_Q%!40,|
00012080  62 6c 6b 25 21 38 2c 44  61 74 61 4f 70 65 6e 25  |blk%!8,DataOpen%|
00012090  29 20 8c 0d 09 64 1c 20  20 20 20 f4 20 66 69 6c  |) ...d.    . fil|
000120a0  65 20 74 79 70 65 20 69  73 20 6f 6b 2e 2e 2e 0d  |e type is ok....|
000120b0  09 65 19 20 20 20 20 2a  7c 69 66 64 65 66 20 54  |.e.    *|ifdef T|
000120c0  72 61 63 65 49 6e 69 74  0d 09 66 47 20 20 20 20  |raceInit..fG    |
000120d0  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
000120e0  44 61 74 61 4c 6f 61 64  3a 46 69 6c 65 20 74 79  |DataLoad:File ty|
000120f0  70 65 20 72 65 63 6f 67  6e 69 73 65 64 20 28 26  |pe recognised (&|
00012100  22 2b c3 7e 5f 51 25 21  34 30 2b 22 29 22 29 0d  |"+.~_Q%!40+")").|
00012110  09 67 0f 20 20 20 20 2a  7c 65 6e 64 69 66 0d 09  |.g.    *|endif..|
00012120  68 19 20 20 20 20 52 65  66 65 72 65 6e 63 65 25  |h.    Reference%|
00012130  3d 5f 51 25 21 31 32 0d  09 69 14 20 20 20 20 5f  |=_Q%!12..i.    _|
00012140  51 25 21 31 32 3d 5f 51  25 21 38 0d 09 6a 10 20  |Q%!12=_Q%!8..j. |
00012150  20 20 20 5f 51 25 21 31  36 3d 34 0d 09 6b 2a 20  |   _Q%!16=4..k* |
00012160  20 20 20 c8 99 20 22 57  69 6d 70 5f 53 65 6e 64  |   .. "Wimp_Send|
00012170  4d 65 73 73 61 67 65 22  2c 31 38 2c 5f 51 25 2c  |Message",18,_Q%,|
00012180  5f 51 25 21 34 0d 09 6c  1a 20 20 20 20 e7 20 5f  |_Q%!4..l.    . _|
00012190  55 25 21 31 30 30 20 80  20 31 3c 3c 31 20 8c 0d  |U%!100 . 1<<1 ..|
000121a0  09 6d 15 20 20 20 20 20  20 6c 6f 61 64 6c 6f 63  |.m.      loadloc|
000121b0  25 3d 2d 31 0d 09 6e 20  20 20 20 20 20 20 5f 55  |%=-1..n       _U|
000121c0  25 21 31 30 30 3d 5f 55  25 21 31 30 30 20 82 20  |%!100=_U%!100 . |
000121d0  31 3c 3c 31 0d 09 6f 09  20 20 20 20 cc 0d 09 70  |1<<1..o.    ...p|
000121e0  36 20 20 20 20 20 20 6c  6f 61 64 6c 6f 63 25 3d  |6      loadloc%=|
000121f0  a4 73 68 65 6c 6c 5f 4c  6f 61 64 46 69 6c 65 28  |.shell_LoadFile(|
00012200  52 65 66 65 72 65 6e 63  65 25 3d 5f 55 25 21 31  |Reference%=_U%!1|
00012210  30 38 29 0d 09 71 09 20  20 20 20 cd 0d 09 72 47  |08)..q.    ...rG|
00012220  20 20 20 20 f2 73 68 65  6c 6c 5f 55 73 65 72 46  |    .shell_UserF|
00012230  4e 4c 6f 61 64 46 69 6c  65 28 74 79 70 65 25 2c  |NLoadFile(type%,|
00012240  6c 6f 61 64 6c 6f 63 25  2c 62 6c 6b 25 21 38 2c  |loadloc%,blk%!8,|
00012250  66 6e 61 6d 65 24 2c 5f  51 25 21 33 36 2c 62 6c  |fname$,_Q%!36,bl|
00012260  6b 25 29 0d 09 73 32 20  20 20 20 f4 20 72 65 74  |k%)..s2    . ret|
00012270  75 72 6e 20 63 6f 70 79  20 6f 66 20 64 61 74 61  |urn copy of data|
00012280  73 61 76 65 20 6d 65 73  73 61 67 65 20 62 6c 6f  |save message blo|
00012290  63 6b 2e 2e 2e 0d 09 74  16 20 20 20 20 e7 20 5f  |ck.....t.    . _|
000122a0  55 25 21 31 35 36 3c 3e  30 20 8c 0d 09 75 29 20  |U%!156<>0 ...u) |
000122b0  20 20 20 20 20 f2 73 68  65 6c 6c 5f 48 65 61 70  |     .shell_Heap|
000122c0  42 6c 6f 63 6b 52 65 74  75 72 6e 28 5f 55 25 21  |BlockReturn(_U%!|
000122d0  31 35 36 29 0d 09 76 13  20 20 20 20 20 20 5f 55  |156)..v.      _U|
000122e0  25 21 31 35 36 3d 30 0d  09 77 09 20 20 20 20 cd  |%!156=0..w.    .|
000122f0  0d 09 78 07 20 20 cc 0d  09 79 17 20 20 2a 7c 69  |..x.  ...y.  *|i|
00012300  66 64 65 66 20 54 72 61  63 65 49 6e 69 74 0d 09  |fdef TraceInit..|
00012310  7a 49 20 20 f2 73 68 65  6c 6c 5f 54 72 61 63 65  |zI  .shell_Trace|
00012320  66 30 28 22 44 61 74 61  4c 6f 61 64 3a 46 69 6c  |f0("DataLoad:Fil|
00012330  65 20 74 79 70 65 20 4e  4f 54 20 72 65 63 6f 67  |e type NOT recog|
00012340  6e 69 73 65 64 20 28 26  22 2b c3 7e 5f 51 25 21  |nised (&"+.~_Q%!|
00012350  34 30 2b 22 29 22 29 0d  09 7b 0d 20 20 2a 7c 65  |40+")")..{.  *|e|
00012360  6e 64 69 66 0d 09 7c 07  20 20 cd 0d 09 7d 05 cd  |ndif..|.  ...}..|
00012370  0d 09 7e 04 0d 09 7f 05  e1 0d 09 80 05 3a 0d 09  |..~..........:..|
00012380  81 1d 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |..*|Stop PROCshe|
00012390  6c 6c 5f 44 61 74 61 4c  6f 61 64 0d 09 82 04 0d  |ll_DataLoad.....|
000123a0  09 83 24 2a 7c 53 74 61  72 74 20 50 52 4f 43 73  |..$*|Start PROCs|
000123b0  68 65 6c 6c 5f 55 73 65  72 46 4e 4c 6f 61 64 46  |hell_UserFNLoadF|
000123c0  69 6c 65 0d 09 84 52 dd  20 f2 73 68 65 6c 6c 5f  |ile...R. .shell_|
000123d0  55 73 65 72 46 4e 4c 6f  61 64 46 69 6c 65 28 74  |UserFNLoadFile(t|
000123e0  79 70 65 25 2c 6c 6f 61  64 6c 6f 63 25 2c 74 79  |ype%,loadloc%,ty|
000123f0  70 65 5f 6c 69 73 74 25  2c 5f 66 69 6c 65 6e 61  |pe_list%,_filena|
00012400  6d 65 24 2c 5f 66 69 6c  65 5f 73 69 7a 65 25 2c  |me$,_file_size%,|
00012410  62 6c 6b 25 29 0d 09 85  1d ea 20 63 74 72 25 2c  |blk%)..... ctr%,|
00012420  66 6f 75 6e 64 25 2c 74  65 6d 70 25 2c 76 6f 69  |found%,temp%,voi|
00012430  64 25 0d 09 86 2e f4 20  63 61 6c 6c 20 75 73 65  |d%..... call use|
00012440  72 20 66 75 6e 63 74 69  6f 6e 20 61 66 74 65 72  |r function after|
00012450  20 6c 6f 61 64 69 6e 67  20 66 69 6c 65 2e 2e 2e  | loading file...|
00012460  0d 09 87 14 63 74 72 25  3d 30 3a 66 6f 75 6e 64  |....ctr%=0:found|
00012470  25 3d 2d 31 0d 09 88 1a  c8 95 20 74 79 70 65 5f  |%=-1...... type_|
00012480  6c 69 73 74 25 21 63 74  72 25 3c 3e 2d 31 0d 09  |list%!ctr%<>-1..|
00012490  89 1b 20 20 74 65 6d 70  25 3d 74 79 70 65 5f 6c  |..  temp%=type_l|
000124a0  69 73 74 25 21 63 74 72  25 0d 09 8a 2b 20 20 e7  |ist%!ctr%...+  .|
000124b0  20 74 65 6d 70 25 20 80  20 31 3c 3c 33 31 20 8c  | temp% . 1<<31 .|
000124c0  20 74 65 6d 70 25 3d 74  65 6d 70 25 20 82 20 31  | temp%=temp% . 1|
000124d0  3c 3c 33 31 0d 09 8b 21  20 20 e7 20 74 65 6d 70  |<<31...!  . temp|
000124e0  25 3d 74 79 70 65 25 20  8c 20 66 6f 75 6e 64 25  |%=type% . found%|
000124f0  3d 63 74 72 25 0d 09 8c  0d 20 20 63 74 72 25 2b  |=ctr%....  ctr%+|
00012500  3d 34 0d 09 8d 05 ce 0d  09 8e 11 74 65 6d 70 25  |=4.........temp%|
00012510  3d 62 6c 6b 25 21 31 32  0d 09 8f 5a 76 6f 69 64  |=blk%!12...Zvoid|
00012520  25 3d a0 28 22 46 4e 22  2b 24 28 74 65 6d 70 25  |%=.("FN"+$(temp%|
00012530  21 66 6f 75 6e 64 25 29  2b 22 28 22 2b c3 6c 6f  |!found%)+"("+.lo|
00012540  61 64 6c 6f 63 25 2b 22  2c 22 2b c3 74 79 70 65  |adloc%+","+.type|
00012550  25 2b 22 2c 5f 66 69 6c  65 6e 61 6d 65 24 2c 22  |%+",_filename$,"|
00012560  2b c3 5f 66 69 6c 65 5f  73 69 7a 65 25 2b 22 29  |+._file_size%+")|
00012570  22 29 0d 09 90 05 e1 0d  09 91 05 3a 0d 09 92 23  |").........:...#|
00012580  2a 7c 53 74 6f 70 20 50  52 4f 43 73 68 65 6c 6c  |*|Stop PROCshell|
00012590  5f 55 73 65 72 46 4e 4c  6f 61 64 46 69 6c 65 0d  |_UserFNLoadFile.|
000125a0  09 93 04 0d 09 94 1e 2a  7c 53 74 61 72 74 20 50  |.......*|Start P|
000125b0  52 4f 43 73 68 65 6c 6c  5f 44 61 74 61 53 61 76  |ROCshell_DataSav|
000125c0  65 0d 09 95 1a dd 20 f2  73 68 65 6c 6c 5f 44 61  |e..... .shell_Da|
000125d0  74 61 53 61 76 65 28 5f  51 25 29 0d 09 96 1e ea  |taSave(_Q%).....|
000125e0  20 74 65 6d 70 25 2c 6f  66 66 73 65 74 25 2c 62  | temp%,offset%,b|
000125f0  6c 6b 25 2c 6c 6f 6f 70  25 0d 09 97 45 f4 20 43  |lk%,loop%...E. C|
00012600  61 6c 6c 65 64 20 77 68  65 6e 20 61 6e 6f 74 68  |alled when anoth|
00012610  65 72 20 61 70 70 6c 69  63 61 74 69 6f 6e 20 77  |er application w|
00012620  61 6e 74 73 20 74 6f 20  73 61 76 65 20 64 61 74  |ants to save dat|
00012630  61 20 74 6f 20 6f 75 72  20 6f 6e 65 2e 2e 0d 09  |a to our one....|
00012640  98 15 2a 7c 69 66 64 65  66 20 54 72 61 63 65 49  |..*|ifdef TraceI|
00012650  6e 69 74 0d 09 99 38 f2  73 68 65 6c 6c 5f 54 72  |nit...8.shell_Tr|
00012660  61 63 65 66 30 28 22 44  61 74 61 53 61 76 65 3a  |acef0("DataSave:|
00012670  44 61 74 61 53 61 76 65  20 6d 65 73 73 61 67 65  |DataSave message|
00012680  20 72 65 63 65 69 76 65  64 22 29 0d 09 9a 0b 2a  | received")....*|
00012690  7c 65 6e 64 69 66 0d 09  9b 49 f4 20 52 65 63 65  ||endif...I. Rece|
000126a0  69 76 65 20 66 69 6c 65  20 66 72 6f 6d 20 61 70  |ive file from ap|
000126b0  70 6c 69 63 61 74 69 6f  6e 2c 20 62 75 74 20 63  |plication, but c|
000126c0  68 65 63 6b 20 66 69 72  73 74 20 69 74 20 64 69  |heck first it di|
000126d0  64 6e 27 74 20 63 6f 6d  65 20 66 72 6f 6d 20 0d  |dn't come from .|
000126e0  09 9c 0f f4 20 74 68 69  73 20 6f 6e 65 21 0d 09  |.... this one!..|
000126f0  9d 17 e7 20 5f 51 25 21  30 34 3c 3e 5f 55 25 21  |... _Q%!04<>_U%!|
00012700  31 34 38 20 8c 0d 09 9e  3d 20 20 f4 20 63 68 65  |148 ....=  . che|
00012710  63 6b 20 65 76 65 6e 74  20 6c 69 73 74 20 66 6f  |ck event list fo|
00012720  72 20 77 69 6e 64 6f 77  2f 69 63 6f 6e 20 61 74  |r window/icon at|
00012730  20 74 68 69 73 20 70 6f  69 6e 74 20 74 6f 20 73  | this point to s|
00012740  65 65 0d 09 9f 24 20 20  f4 20 77 68 69 63 68 20  |ee...$  . which |
00012750  66 69 6c 65 74 79 70 65  73 20 61 72 65 20 76 61  |filetypes are va|
00012760  6c 69 64 2e 2e 2e 0d 09  a0 42 20 20 6f 66 66 73  |lid......B  offs|
00012770  65 74 25 3d a4 73 68 65  6c 6c 5f 47 65 74 45 76  |et%=.shell_GetEv|
00012780  65 6e 74 4c 69 73 74 4f  66 66 73 65 74 28 5f 51  |entListOffset(_Q|
00012790  25 21 32 30 2c 5f 51 25  21 32 34 2c 5f 55 25 2b  |%!20,_Q%!24,_U%+|
000127a0  39 36 2c 31 36 2c a3 29  0d 09 a1 14 20 20 e7 20  |96,16,.)....  . |
000127b0  6f 66 66 73 65 74 25 3e  2d 31 20 8c 0d 09 a2 1b  |offset%>-1 .....|
000127c0  20 20 20 20 62 6c 6b 25  3d 5f 55 25 21 39 36 2b  |    blk%=_U%!96+|
000127d0  6f 66 66 73 65 74 25 0d  09 a3 2d 20 20 20 20 e7  |offset%...-    .|
000127e0  20 a4 73 68 65 6c 6c 5f  43 68 65 63 6b 54 79 70  | .shell_CheckTyp|
000127f0  65 28 5f 51 25 21 34 30  2c 62 6c 6b 25 21 38 2c  |e(_Q%!40,blk%!8,|
00012800  a3 29 20 8c 0d 09 a4 1b  20 20 20 20 20 20 2a 7c  |.) .....      *||
00012810  69 66 64 65 66 20 54 72  61 63 65 49 6e 69 74 0d  |ifdef TraceInit.|
00012820  09 a5 48 20 20 20 20 20  20 f2 73 68 65 6c 6c 5f  |..H      .shell_|
00012830  54 72 61 63 65 66 30 28  22 44 61 74 61 53 61 76  |Tracef0("DataSav|
00012840  65 3a 46 69 6c 65 74 79  70 65 20 72 65 63 6f 67  |e:Filetype recog|
00012850  6e 69 7a 65 64 20 28 26  22 2b c3 7e 5f 51 25 21  |nized (&"+.~_Q%!|
00012860  34 30 2b 22 29 22 29 0d  09 a6 11 20 20 20 20 20  |40+")")....     |
00012870  20 2a 7c 65 6e 64 69 66  0d 09 a7 29 20 20 20 20  | *|endif...)    |
00012880  20 20 e7 20 a4 73 68 65  6c 6c 5f 54 6f 70 42 69  |  . .shell_TopBi|
00012890  74 4c 6f 61 64 49 6e 50  72 6f 67 72 65 73 73 20  |tLoadInProgress |
000128a0  8c 0d 09 a8 4e 20 20 20  20 20 20 20 20 f4 20 27  |....N        . '|
000128b0  6e 6f 20 6c 6f 61 64 27  20 6c 6f 61 64 20 74 61  |no load' load ta|
000128c0  6b 69 6e 67 20 70 6c 61  63 65 2c 20 6a 75 73 74  |king place, just|
000128d0  20 6e 65 65 64 20 74 68  65 20 66 75 6c 6c 20 66  | need the full f|
000128e0  69 6c 65 6e 61 6d 65 20  73 6f 20 74 68 61 74 0d  |ilename so that.|
000128f0  09 a9 4f 20 20 20 20 20  20 20 20 f4 20 74 68 65  |..O        . the|
00012900  20 75 73 65 72 20 61 70  70 20 63 61 6e 20 64 6f  | user app can do|
00012910  20 74 68 65 20 6c 6f 61  64 20 2d 20 74 68 65 72  | the load - ther|
00012920  65 66 6f 72 65 20 73 65  6e 64 20 4d 65 73 73 61  |efore send Messa|
00012930  67 65 5f 44 61 74 61 53  61 76 65 41 63 6b 0d 09  |ge_DataSaveAck..|
00012940  aa 2f 20 20 20 20 20 20  20 20 f4 20 77 69 74 68  |./        . with|
00012950  20 57 69 6d 70 24 53 63  72 61 70 20 61 73 20 74  | Wimp$Scrap as t|
00012960  68 65 20 66 69 6c 65 6e  61 6d 65 2e 2e 0d 09 ab  |he filename.....|
00012970  1d 20 20 20 20 20 20 20  20 2a 7c 69 66 64 65 66  |.        *|ifdef|
00012980  20 54 72 61 63 65 49 6e  69 74 0d 09 ac 39 20 20  | TraceInit...9  |
00012990  20 20 20 20 20 20 f2 73  68 65 6c 6c 5f 54 72 61  |      .shell_Tra|
000129a0  63 65 66 30 28 22 44 61  74 61 53 61 76 65 3a 27  |cef0("DataSave:'|
000129b0  6e 6f 20 6c 6f 61 64 27  20 66 6c 61 67 20 73 65  |no load' flag se|
000129c0  74 22 29 0d 09 ad 42 20  20 20 20 20 20 20 20 f2  |t")...B        .|
000129d0  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 44  |shell_Tracef0("D|
000129e0  61 74 61 53 61 76 65 3a  53 65 6e 64 69 6e 67 20  |ataSave:Sending |
000129f0  4d 65 73 73 61 67 65 5f  44 61 74 61 53 61 76 65  |Message_DataSave|
00012a00  41 63 6b 22 29 0d 09 ae  13 20 20 20 20 20 20 20  |Ack")....       |
00012a10  20 2a 7c 65 6e 64 69 66  0d 09 af 16 20 20 20 20  | *|endif....    |
00012a20  20 20 20 20 5f 51 25 21  30 30 3d 32 35 36 0d 09  |    _Q%!00=256..|
00012a30  b0 42 20 20 20 20 20 20  20 20 5f 51 25 21 31 32  |.B        _Q%!12|
00012a40  3d 5f 51 25 21 30 38 3a  5f 51 25 21 33 36 3d 2d  |=_Q%!08:_Q%!36=-|
00012a50  31 3a 5f 51 25 21 31 36  3d 32 3a f4 20 4d 65 73  |1:_Q%!16=2:. Mes|
00012a60  73 61 67 65 5f 44 61 74  61 53 61 76 65 41 63 6b  |sage_DataSaveAck|
00012a70  0d 09 b1 36 20 20 20 20  20 20 20 20 24 28 5f 51  |...6        $(_Q|
00012a80  25 2b 34 34 29 3d a4 73  68 65 6c 6c 5f 47 65 74  |%+44)=.shell_Get|
00012a90  41 70 70 44 69 72 2b 22  2e 53 63 72 61 70 46 69  |AppDir+".ScrapFi|
00012aa0  6c 65 22 2b bd 30 0d 09  b2 2e 20 20 20 20 20 20  |le"+.0....      |
00012ab0  20 c8 99 20 22 57 69 6d  70 5f 53 65 6e 64 4d 65  | .. "Wimp_SendMe|
00012ac0  73 73 61 67 65 22 2c 31  38 2c 5f 51 25 2c 5f 51  |ssage",18,_Q%,_Q|
00012ad0  25 21 30 34 0d 09 b3 0b  20 20 20 20 20 20 cc 0d  |%!04....      ..|
00012ae0  09 b4 4d 20 20 20 20 20  20 20 20 f4 20 4e 6f 72  |..M        . Nor|
00012af0  6d 61 6c 20 6c 6f 61 64  20 66 72 6f 6d 20 61 6e  |mal load from an|
00012b00  6f 74 68 65 72 20 61 70  70 6c 69 63 61 74 69 6f  |other applicatio|
00012b10  6e 20 74 68 65 72 65 66  6f 72 65 20 6f 66 66 65  |n therefore offe|
00012b20  72 20 74 6f 20 70 65 72  66 6f 72 6d 0d 09 b5 39  |r to perform...9|
00012b30  20 20 20 20 20 20 20 20  f4 20 61 20 52 41 4d 20  |        . a RAM |
00012b40  66 69 6c 65 20 74 72 61  6e 73 66 65 72 20 77 69  |file transfer wi|
00012b50  74 68 20 4d 65 73 73 61  67 65 5f 52 41 4d 46 65  |th Message_RAMFe|
00012b60  74 63 68 2e 2e 0d 09 b6  4d 20 20 20 20 20 20 20  |tch.....M       |
00012b70  20 f4 20 4d 61 6b 65 20  61 20 63 6f 70 79 20 6f  | . Make a copy o|
00012b80  66 20 74 68 65 20 6d 65  73 73 61 67 65 20 62 6c  |f the message bl|
00012b90  6f 63 6b 20 61 73 20 49  20 6e 65 65 64 20 69 74  |ock as I need it|
00012ba0  20 77 68 65 6e 20 52 41  4d 20 74 72 61 6e 73 66  | when RAM transf|
00012bb0  65 72 0d 09 b7 3c 20 20  20 20 20 20 20 20 f4 20  |er...<        . |
00012bc0  69 73 20 6e 6f 74 20 73  75 70 70 6f 72 74 65 64  |is not supported|
00012bd0  20 62 79 20 74 68 65 20  73 65 6e 64 65 72 20 6f  | by the sender o|
00012be0  66 20 74 68 69 73 20 6d  65 73 73 61 67 65 0d 09  |f this message..|
00012bf0  b8 47 20 20 20 20 20 20  20 20 f2 73 68 65 6c 6c  |.G        .shell|
00012c00  5f 48 65 61 70 42 6c 6f  63 6b 52 65 74 75 72 6e  |_HeapBlockReturn|
00012c10  28 5f 55 25 21 31 35 36  29 3a f4 20 72 65 74 75  |(_U%!156):. retu|
00012c20  72 6e 20 74 65 6d 70 20  6d 65 73 73 61 67 65 20  |rn temp message |
00012c30  62 6c 6b 2e 2e 0d 09 b9  34 20 20 20 20 20 20 20  |blk.....4       |
00012c40  20 5f 55 25 21 31 35 36  3d a4 73 68 65 6c 6c 5f  | _U%!156=.shell_|
00012c50  48 65 61 70 42 6c 6f 63  6b 46 65 74 63 68 28 28  |HeapBlockFetch((|
00012c60  5f 51 25 21 30 29 2b 38  29 0d 09 ba 19 20 20 20  |_Q%!0)+8)....   |
00012c70  20 20 20 20 20 74 65 6d  70 25 3d 5f 55 25 21 31  |     temp%=_U%!1|
00012c80  35 36 0d 09 bb 39 20 20  20 20 20 20 20 20 e3 20  |56...9        . |
00012c90  6c 6f 6f 70 25 3d 30 20  b8 20 5f 51 25 21 30 20  |loop%=0 . _Q%!0 |
00012ca0  88 20 34 3a f4 20 66 69  72 73 74 20 77 6f 72 64  |. 4:. first word|
00012cb0  20 69 73 20 73 69 7a 65  2e 2e 2e 0d 09 bc 23 20  | is size......# |
00012cc0  20 20 20 20 20 20 20 20  20 74 65 6d 70 25 21 6c  |         temp%!l|
00012cd0  6f 6f 70 25 3d 5f 51 25  21 6c 6f 6f 70 25 0d 09  |oop%=_Q%!loop%..|
00012ce0  bd 13 20 20 20 20 20 20  20 20 ed 20 6c 6f 6f 70  |..        . loop|
00012cf0  25 0d 09 be 40 20 20 20  20 20 20 20 20 f4 20 73  |%...@        . s|
00012d00  74 6f 72 65 20 64 65 73  74 69 6e 61 74 69 6f 6e  |tore destination|
00012d10  20 77 69 6e 64 6f 77 2f  69 63 6f 6e 20 68 61 6e  | window/icon han|
00012d20  64 6c 65 73 20 66 6f 72  20 6c 61 74 65 72 2e 2e  |dles for later..|
00012d30  2e 0d 09 bf 27 20 20 20  20 20 20 20 20 5f 55 25  |....'        _U%|
00012d40  21 32 38 3d 5f 51 25 21  32 30 3a 5f 55 25 21 33  |!28=_Q%!20:_U%!3|
00012d50  32 3d 5f 51 25 21 32 34  0d 09 c0 15 20 20 20 20  |2=_Q%!24....    |
00012d60  20 20 20 20 5f 55 25 21  31 32 38 3d 30 0d 09 c1  |    _U%!128=0...|
00012d70  2f 20 20 20 20 20 20 20  20 5f 55 25 21 31 33 32  |/        _U%!132|
00012d80  3d 5f 51 25 21 33 36 3a  f4 20 52 41 4d 53 69 7a  |=_Q%!36:. RAMSiz|
00012d90  65 25 3d 65 73 74 5f 73  69 7a 65 25 0d 09 c2 35  |e%=est_size%...5|
00012da0  20 20 20 20 20 20 20 20  f4 20 73 65 74 20 75 70  |        . set up|
00012db0  20 68 65 61 70 62 6c 6f  63 6b 20 74 6f 20 68 6f  | heapblock to ho|
00012dc0  6c 64 20 6c 6f 61 64 65  64 20 66 69 6c 65 2e 2e  |ld loaded file..|
00012dd0  2e 0d 09 c3 31 20 20 20  20 20 20 20 20 5f 55 25  |....1        _U%|
00012de0  21 31 35 32 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |!152=.shell_Heap|
00012df0  42 6c 6f 63 6b 46 65 74  63 68 28 5f 51 25 21 33  |BlockFetch(_Q%!3|
00012e00  36 29 0d 09 c4 1e 20 20  20 20 20 20 20 20 f4 20  |6)....        . |
00012e10  41 6e 64 20 68 65 72 65  20 77 65 20 67 6f 20 21  |And here we go !|
00012e20  0d 09 c5 15 20 20 20 20  20 20 20 20 5f 51 25 21  |....        _Q%!|
00012e30  30 30 3d 32 38 0d 09 c6  19 20 20 20 20 20 20 20  |00=28....       |
00012e40  20 5f 51 25 21 31 32 3d  5f 51 25 21 30 38 0d 09  | _Q%!12=_Q%!08..|
00012e50  c7 29 20 20 20 20 20 20  20 20 5f 51 25 21 31 36  |.)        _Q%!16|
00012e60  3d 36 3a f4 20 4d 65 73  73 61 67 65 5f 52 41 4d  |=6:. Message_RAM|
00012e70  46 65 74 63 68 2e 2e 0d  09 c8 22 20 20 20 20 20  |Fetch....."     |
00012e80  20 20 20 5f 51 25 21 32  30 3d 5f 55 25 21 31 35  |   _Q%!20=_U%!15|
00012e90  32 2b 5f 55 25 21 31 32  38 0d 09 c9 1a 20 20 20  |2+_U%!128....   |
00012ea0  20 20 20 20 20 5f 51 25  21 32 34 3d 5f 55 25 21  |     _Q%!24=_U%!|
00012eb0  31 33 32 0d 09 ca 2f 20  20 20 20 20 20 20 20 c8  |132.../        .|
00012ec0  99 20 22 57 69 6d 70 5f  53 65 6e 64 4d 65 73 73  |. "Wimp_SendMess|
00012ed0  61 67 65 22 2c 31 38 2c  5f 51 25 2c 5f 51 25 21  |age",18,_Q%,_Q%!|
00012ee0  30 34 0d 09 cb 1a 20 20  20 20 20 20 20 20 5f 55  |04....        _U|
00012ef0  25 21 31 31 32 3d 5f 51  25 21 30 38 0d 09 cc 1d  |%!112=_Q%!08....|
00012f00  20 20 20 20 20 20 20 20  2a 7c 69 66 64 65 66 20  |        *|ifdef |
00012f10  54 72 61 63 65 49 6e 69  74 0d 09 cd 3f 20 20 20  |TraceInit...?   |
00012f20  20 20 20 20 20 f2 73 68  65 6c 6c 5f 54 72 61 63  |     .shell_Trac|
00012f30  65 66 30 28 22 44 61 74  61 53 61 76 65 3a 53 65  |ef0("DataSave:Se|
00012f40  6e 64 69 6e 67 20 4d 65  73 73 61 67 65 5f 52 41  |nding Message_RA|
00012f50  4d 46 65 74 63 68 22 29  0d 09 ce 13 20 20 20 20  |MFetch")....    |
00012f60  20 20 20 20 2a 7c 65 6e  64 69 66 0d 09 cf 0b 20  |    *|endif.... |
00012f70  20 20 20 20 20 cd 0d 09  d0 09 20 20 20 20 cc 0d  |     .....    ..|
00012f80  09 d1 1b 20 20 20 20 20  20 2a 7c 69 66 64 65 66  |...      *|ifdef|
00012f90  20 54 72 61 63 65 49 6e  69 74 0d 09 d2 3c 20 20  | TraceInit...<  |
00012fa0  20 20 20 20 f2 73 68 65  6c 6c 5f 54 72 61 63 65  |    .shell_Trace|
00012fb0  66 30 28 22 44 61 74 61  53 61 76 65 3a 46 69 6c  |f0("DataSave:Fil|
00012fc0  65 74 79 70 65 20 4e 4f  54 20 72 65 63 6f 67 6e  |etype NOT recogn|
00012fd0  69 7a 65 64 22 29 0d 09  d3 11 20 20 20 20 20 20  |ized")....      |
00012fe0  2a 7c 65 6e 64 69 66 0d  09 d4 09 20 20 20 20 cd  |*|endif....    .|
00012ff0  0d 09 d5 07 20 20 cd 0d  09 d6 05 cd 0d 09 d7 05  |....  ..........|
00013000  e1 0d 09 d8 05 3a 0d 09  d9 1d 2a 7c 53 74 6f 70  |.....:....*|Stop|
00013010  20 50 52 4f 43 73 68 65  6c 6c 5f 44 61 74 61 53  | PROCshell_DataS|
00013020  61 76 65 0d 09 da 04 0d  09 db 33 f4 20 53 65 74  |ave.......3. Set|
00013030  20 61 6c 6c 20 74 68 69  73 20 73 74 75 66 66 20  | all this stuff |
00013040  62 65 66 6f 72 65 68 61  6e 64 20 61 73 20 52 41  |beforehand as RA|
00013050  4d 20 74 72 61 6e 73 66  65 72 0d 09 dc 30 f4 20  |M transfer...0. |
00013060  70 72 6f 63 65 64 75 72  65 73 20 6d 61 79 20 62  |procedures may b|
00013070  65 20 65 6e 74 65 72 65  64 20 6d 6f 72 65 20 74  |e entered more t|
00013080  68 61 6e 20 6f 6e 63 65  20 21 0d 09 dd 30 f4 20  |han once !...0. |
00013090  50 52 4f 43 4e 61 6d 65  28 46 4e 4c 65 61 66 28  |PROCName(FNLeaf(|
000130a0  46 4e 47 65 74 53 74 72  69 6e 67 28 50 6f 6c 6c  |FNGetString(Poll|
000130b0  50 74 72 25 2b 34 34 29  29 29 0d 09 de 1b f4 20  |Ptr%+44)))..... |
000130c0  50 52 4f 43 54 79 70 65  28 50 6f 6c 6c 50 74 72  |PROCType(PollPtr|
000130d0  25 21 34 30 29 0d 09 df  18 f4 20 50 52 4f 43 4d  |%!40)..... PROCM|
000130e0  6f 64 69 66 69 65 64 28  54 52 55 45 29 0d 09 e0  |odified(TRUE)...|
000130f0  24 f4 20 50 52 4f 43 44  61 74 65 28 46 4e 43 75  |$. PROCDate(FNCu|
00013100  72 72 65 6e 74 54 69 6d  65 41 6e 64 44 61 74 65  |rrentTimeAndDate|
00013110  29 0d 09 e1 28 2a 7c 53  74 61 72 74 20 46 4e 73  |)...(*|Start FNs|
00013120  68 65 6c 6c 5f 54 6f 70  42 69 74 4c 6f 61 64 49  |hell_TopBitLoadI|
00013130  6e 50 72 6f 67 72 65 73  73 0d 09 e2 21 dd 20 a4  |nProgress...!. .|
00013140  73 68 65 6c 6c 5f 54 6f  70 42 69 74 4c 6f 61 64  |shell_TopBitLoad|
00013150  49 6e 50 72 6f 67 72 65  73 73 0d 09 e3 1e e7 20  |InProgress..... |
00013160  5f 55 25 21 31 30 30 20  80 20 31 3c 3c 31 20 8c  |_U%!100 . 1<<1 .|
00013170  20 3d b9 20 8b 20 3d a3  0d 09 e4 05 3a 0d 09 e5  | =. . =.....:...|
00013180  28 2a 7c 53 74 6f 70 20  20 46 4e 73 68 65 6c 6c  |(*|Stop  FNshell|
00013190  5f 54 6f 70 42 69 74 4c  6f 61 64 49 6e 50 72 6f  |_TopBitLoadInPro|
000131a0  67 72 65 73 73 0d 09 e6  22 2a 7c 53 74 61 72 74  |gress..."*|Start|
000131b0  20 50 52 4f 43 73 68 65  6c 6c 5f 53 65 6e 64 44  | PROCshell_SendD|
000131c0  61 74 61 53 61 76 65 0d  09 e7 22 dd 20 f2 73 68  |ataSave...". .sh|
000131d0  65 6c 6c 5f 53 65 6e 64  44 61 74 61 53 61 76 65  |ell_SendDataSave|
000131e0  28 77 68 25 2c 69 68 25  29 0d 09 e8 32 ea 20 62  |(wh%,ih%)...2. b|
000131f0  6c 6b 25 2c 6d 73 67 62  6c 6b 25 2c 74 6d 70 62  |lk%,msgblk%,tmpb|
00013200  6c 6b 25 2c 6f 66 66 73  65 74 25 2c 46 69 6c 65  |lk%,offset%,File|
00013210  53 69 7a 65 25 2c 76 6f  69 64 25 0d 09 e9 25 74  |Size%,void%...%t|
00013220  6d 70 62 6c 6b 25 3d a4  73 68 65 6c 6c 5f 48 65  |mpblk%=.shell_He|
00013230  61 70 42 6c 6f 63 6b 46  65 74 63 68 28 33 30 29  |apBlockFetch(30)|
00013240  0d 09 ea 46 f4 20 72 65  74 72 69 65 76 65 20 63  |...F. retrieve c|
00013250  75 72 72 65 6e 74 20 70  6f 73 69 74 69 6f 6e 20  |urrent position |
00013260  6f 66 20 70 6f 69 6e 74  65 72 20 28 77 69 6e 64  |of pointer (wind|
00013270  6f 77 20 61 6e 64 20 69  63 6f 6e 20 6f 76 65 72  |ow and icon over|
00013280  20 77 68 69 63 68 0d 09  eb 31 f4 20 74 68 65 20  | which...1. the |
00013290  64 72 61 67 20 65 76 65  6e 74 20 65 6e 64 65 64  |drag event ended|
000132a0  20 70 6c 75 73 20 70 6f  69 6e 74 65 72 20 70 6f  | plus pointer po|
000132b0  73 69 74 69 6f 6e 29 0d  09 ec 25 c8 99 20 22 57  |sition)...%.. "W|
000132c0  69 6d 70 5f 47 65 74 50  6f 69 6e 74 65 72 49 6e  |imp_GetPointerIn|
000132d0  66 6f 22 2c 2c 74 6d 70  62 6c 6b 25 0d 09 ed 3a  |fo",,tmpblk%...:|
000132e0  6f 66 66 73 65 74 25 3d  a4 73 68 65 6c 6c 5f 47  |offset%=.shell_G|
000132f0  65 74 45 76 65 6e 74 4c  69 73 74 4f 66 66 73 65  |etEventListOffse|
00013300  74 28 77 68 25 2c 69 68  25 2c 5f 55 25 2b 37 32  |t(wh%,ih%,_U%+72|
00013310  2c 32 34 2c a3 29 0d 09  ee 1f e7 20 6f 66 66 73  |,24,.)..... offs|
00013320  65 74 25 3d 2d 31 20 84  20 6f 66 66 73 65 74 25  |et%=-1 . offset%|
00013330  3d 2d 32 20 8c 0d 09 ef  69 20 20 76 6f 69 64 25  |=-2 ....i  void%|
00013340  3d a4 73 68 65 6c 6c 5f  4d 65 73 73 61 67 65 57  |=.shell_MessageW|
00013350  69 6e 64 6f 77 28 a4 73  68 65 6c 6c 5f 4d 65 73  |indow(.shell_Mes|
00013360  73 61 67 65 4e 6f 41 72  67 73 28 22 53 48 45 4c  |sageNoArgs("SHEL|
00013370  4c 4d 53 47 31 33 22 29  2c 30 2c 22 22 2c a4 73  |LMSG13"),0,"",.s|
00013380  68 65 6c 6c 5f 4d 65 73  73 61 67 65 4e 6f 41 72  |hell_MessageNoAr|
00013390  67 73 28 22 77 61 72 6e  69 6e 67 22 29 29 0d 09  |gs("warning"))..|
000133a0  f0 05 cc 0d 09 f1 1b 20  20 62 6c 6b 25 3d 28 5f  |.......  blk%=(_|
000133b0  55 25 21 37 32 29 2b 6f  66 66 73 65 74 25 0d 09  |U%!72)+offset%..|
000133c0  f2 16 20 20 e7 20 62 6c  6b 25 21 38 3e 26 38 30  |..  . blk%!8>&80|
000133d0  30 30 20 8c 0d 09 f3 30  20 20 20 20 46 69 6c 65  |00 ....0    File|
000133e0  53 69 7a 65 25 3d a4 73  68 65 6c 6c 5f 48 65 61  |Size%=.shell_Hea|
000133f0  70 42 6c 6f 63 6b 49 6e  66 6f 28 62 6c 6b 25 21  |pBlockInfo(blk%!|
00013400  38 29 2d 34 0d 09 f4 07  20 20 cc 0d 09 f5 18 20  |8)-4....  ..... |
00013410  20 20 20 46 69 6c 65 53  69 7a 65 25 3d 62 6c 6b  |   FileSize%=blk|
00013420  25 21 38 0d 09 f6 07 20  20 cd 0d 09 f7 14 20 20  |%!8....  .....  |
00013430  6d 73 67 62 6c 6b 25 3d  5f 55 25 21 37 36 0d 09  |msgblk%=_U%!76..|
00013440  f8 35 20 20 6d 73 67 62  6c 6b 25 21 30 20 3d 32  |.5  msgblk%!0 =2|
00013450  35 36 20 20 20 20 20 20  20 3a f4 20 6c 65 6e 67  |56       :. leng|
00013460  74 68 20 6f 66 20 6d 65  73 73 61 67 65 20 62 6c  |th of message bl|
00013470  6f 63 6b 0d 09 f9 31 20  20 6d 73 67 62 6c 6b 25  |ock...1  msgblk%|
00013480  21 31 32 3d 30 20 20 20  20 20 20 20 20 20 3a f4  |!12=0         :.|
00013490  20 6d 79 72 65 66 20 30  3d 6f 72 69 67 69 6e 61  | myref 0=origina|
000134a0  74 69 6e 67 0d 09 fa 2c  20 20 6d 73 67 62 6c 6b  |ting...,  msgblk|
000134b0  25 21 31 36 3d 31 20 20  20 20 20 20 20 20 20 3a  |%!16=1         :|
000134c0  f4 20 6d 65 73 73 61 67  65 20 61 63 74 69 6f 6e  |. message action|
000134d0  0d 09 fb 37 20 20 6d 73  67 62 6c 6b 25 21 32 30  |...7  msgblk%!20|
000134e0  3d 74 6d 70 62 6c 6b 25  21 31 32 3a f4 20 64 65  |=tmpblk%!12:. de|
000134f0  73 74 69 6e 61 74 69 6f  6e 20 77 69 6e 64 6f 77  |stination window|
00013500  20 68 61 6e 64 6c 65 0d  09 fc 35 20 20 6d 73 67  | handle...5  msg|
00013510  62 6c 6b 25 21 32 34 3d  74 6d 70 62 6c 6b 25 21  |blk%!24=tmpblk%!|
00013520  31 36 3a f4 20 64 65 73  74 69 6e 61 74 69 6f 6e  |16:. destination|
00013530  20 69 63 6f 6e 20 68 61  6e 64 6c 65 0d 09 fd 2b  | icon handle...+|
00013540  20 20 6d 73 67 62 6c 6b  25 21 32 38 3d 74 6d 70  |  msgblk%!28=tmp|
00013550  62 6c 6b 25 21 30 20 3a  f4 20 6d 6f 75 73 65 20  |blk%!0 :. mouse |
00013560  78 20 63 6f 6f 72 64 0d  09 fe 2b 20 20 6d 73 67  |x coord...+  msg|
00013570  62 6c 6b 25 21 33 32 3d  74 6d 70 62 6c 6b 25 21  |blk%!32=tmpblk%!|
00013580  34 20 3a f4 20 6d 6f 75  73 65 20 79 20 63 6f 6f  |4 :. mouse y coo|
00013590  72 64 0d 09 ff 34 20 20  6d 73 67 62 6c 6b 25 21  |rd...4  msgblk%!|
000135a0  33 36 3d 46 69 6c 65 53  69 7a 65 25 20 3a f4 20  |36=FileSize% :. |
000135b0  65 73 74 69 6d 61 74 65  64 20 73 69 7a 65 20 6f  |estimated size o|
000135c0  66 20 66 69 6c 65 0d 0a  00 27 20 20 6d 73 67 62  |f file...'  msgb|
000135d0  6c 6b 25 21 34 30 3d 62  6c 6b 25 21 31 32 20 20  |lk%!40=blk%!12  |
000135e0  20 3a f4 20 66 69 6c 65  20 74 79 70 65 0d 0a 01  | :. file type...|
000135f0  40 20 20 24 28 6d 73 67  62 6c 6b 25 2b 34 34 29  |@  $(msgblk%+44)|
00013600  3d a4 73 68 65 6c 6c 5f  4c 65 61 66 28 a4 73 68  |=.shell_Leaf(.sh|
00013610  65 6c 6c 5f 49 63 6f 6e  47 65 74 44 61 74 61 28  |ell_IconGetData(|
00013620  77 68 25 2c 62 6c 6b 25  21 31 36 29 29 0d 0a 02  |wh%,blk%!16))...|
00013630  3c 20 20 c8 99 20 22 57  69 6d 70 5f 53 65 6e 64  |<  .. "Wimp_Send|
00013640  4d 65 73 73 61 67 65 22  2c 31 38 2c 6d 73 67 62  |Message",18,msgb|
00013650  6c 6b 25 2c 6d 73 67 62  6c 6b 25 21 32 30 2c 6d  |lk%,msgblk%!20,m|
00013660  73 67 62 6c 6b 25 21 32  34 0d 0a 03 13 20 20 5f  |sgblk%!24....  _|
00013670  55 25 21 31 32 30 3d 5f  51 25 21 38 0d 0a 04 24  |U%!120=_Q%!8...$|
00013680  20 20 5f 55 25 21 31 33  36 3d 46 69 6c 65 53 69  |  _U%!136=FileSi|
00013690  7a 65 25 20 3a f4 20 46  69 6c 65 53 69 7a 65 25  |ze% :. FileSize%|
000136a0  0d 0a 05 24 20 20 5f 55  25 21 31 34 30 3d 62 6c  |...$  _U%!140=bl|
000136b0  6b 25 21 31 32 20 20 20  3a f4 20 46 69 6c 65 54  |k%!12   :. FileT|
000136c0  79 70 65 25 0d 0a 06 24  20 20 5f 55 25 21 31 34  |ype%...$  _U%!14|
000136d0  34 3d 62 6c 6b 25 21 38  20 20 20 20 3a f4 20 46  |4=blk%!8    :. F|
000136e0  69 6c 65 42 75 66 66 25  0d 0a 07 26 20 20 5f 55  |ileBuff%...&  _U|
000136f0  25 21 31 35 36 3d 62 6c  6b 25 21 34 20 20 20 20  |%!156=blk%!4    |
00013700  3a f4 20 54 61 73 6b 48  61 6e 64 6c 65 25 0d 0a  |:. TaskHandle%..|
00013710  08 28 20 20 5f 55 25 21  32 30 30 3d 6d 73 67 62  |.(  _U%!200=msgb|
00013720  6c 6b 25 21 32 30 3a f4  20 77 69 6e 64 6f 77 20  |lk%!20:. window |
00013730  68 61 6e 64 6c 65 0d 0a  09 26 20 20 5f 55 25 21  |handle...&  _U%!|
00013740  32 30 34 3d 6d 73 67 62  6c 6b 25 21 32 34 3a f4  |204=msgblk%!24:.|
00013750  20 69 63 6f 6e 20 68 61  6e 64 6c 65 0d 0a 0a 05  | icon handle....|
00013760  cd 0d 0a 0b 23 f2 73 68  65 6c 6c 5f 48 65 61 70  |....#.shell_Heap|
00013770  42 6c 6f 63 6b 52 65 74  75 72 6e 28 74 6d 70 62  |BlockReturn(tmpb|
00013780  6c 6b 25 29 0d 0a 0c 05  e1 0d 0a 0d 05 3a 0d 0a  |lk%).........:..|
00013790  0e 21 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |.!*|Stop PROCshe|
000137a0  6c 6c 5f 53 65 6e 64 44  61 74 61 53 61 76 65 0d  |ll_SendDataSave.|
000137b0  0a 0f 21 2a 7c 53 74 61  72 74 20 50 52 4f 43 73  |..!*|Start PROCs|
000137c0  68 65 6c 6c 5f 44 61 74  61 53 61 76 65 41 63 6b  |hell_DataSaveAck|
000137d0  0d 0a 10 1d dd 20 f2 73  68 65 6c 6c 5f 44 61 74  |..... .shell_Dat|
000137e0  61 53 61 76 65 41 63 6b  28 5f 51 25 29 0d 0a 11  |aSaveAck(_Q%)...|
000137f0  27 ea 20 5f 66 75 6c 6c  6e 61 6d 65 24 2c 61 25  |'. _fullname$,a%|
00013800  2c 62 25 2c 62 6c 6b 25  2c 74 65 6d 70 25 2c 76  |,b%,blk%,temp%,v|
00013810  6f 69 64 25 0d 0a 12 15  2a 7c 69 66 64 65 66 20  |oid%....*|ifdef |
00013820  54 72 61 63 65 49 6e 69  74 0d 0a 13 3e f2 73 68  |TraceInit...>.sh|
00013830  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 44 61 74  |ell_Tracef0("Dat|
00013840  61 53 61 76 65 41 63 6b  3a 44 61 74 61 53 61 76  |aSaveAck:DataSav|
00013850  65 41 63 6b 20 6d 65 73  73 61 67 65 20 72 65 63  |eAck message rec|
00013860  65 69 76 65 64 22 29 0d  0a 14 0b 2a 7c 65 6e 64  |eived")....*|end|
00013870  69 66 0d 0a 15 17 61 25  3d 30 3a 62 25 3d 5f 51  |if....a%=0:b%=_Q|
00013880  25 3f 28 34 34 2b 61 25  29 0d 0a 16 0c c8 95 20  |%?(44+a%)...... |
00013890  62 25 3c 3e 30 0d 0a 17  17 20 20 5f 66 75 6c 6c  |b%<>0....  _full|
000138a0  6e 61 6d 65 24 2b 3d bd  28 62 25 29 0d 0a 18 0b  |name$+=.(b%)....|
000138b0  20 20 61 25 2b 3d 31 0d  0a 19 14 20 20 62 25 3d  |  a%+=1....  b%=|
000138c0  5f 51 25 3f 28 34 34 2b  61 25 29 0d 0a 1a 05 ce  |_Q%?(44+a%).....|
000138d0  0d 0a 1b 15 2a 7c 69 66  64 65 66 20 54 72 61 63  |....*|ifdef Trac|
000138e0  65 49 6e 69 74 0d 0a 1c  40 f2 73 68 65 6c 6c 5f  |eInit...@.shell_|
000138f0  54 72 61 63 65 66 30 28  22 44 61 74 61 53 61 76  |Tracef0("DataSav|
00013900  65 41 63 6b 3a 46 75 6c  6c 20 73 61 76 65 20 6e  |eAck:Full save n|
00013910  61 6d 65 20 69 73 3a 20  22 2b 5f 66 75 6c 6c 6e  |ame is: "+_fulln|
00013920  61 6d 65 24 29 0d 0a 1d  2e f2 73 68 65 6c 6c 5f  |ame$).....shell_|
00013930  54 72 61 63 65 66 30 28  22 44 61 74 61 53 61 76  |Tracef0("DataSav|
00013940  65 41 63 6b 3a 74 61 73  6b 3d 22 2b c3 5f 51 25  |eAck:task="+._Q%|
00013950  21 34 29 0d 0a 1e 32 f2  73 68 65 6c 6c 5f 54 72  |!4)...2.shell_Tr|
00013960  61 63 65 66 30 28 22 44  61 74 61 53 61 76 65 41  |acef0("DataSaveA|
00013970  63 6b 3a 6d 79 74 61 73  6b 3d 22 2b c3 5f 55 25  |ck:mytask="+._U%|
00013980  21 31 34 38 29 0d 0a 1f  0b 2a 7c 65 6e 64 69 66  |!148)....*|endif|
00013990  0d 0a 20 40 6f 66 66 73  65 74 25 3d a4 73 68 65  |.. @offset%=.she|
000139a0  6c 6c 5f 47 65 74 45 76  65 6e 74 4c 69 73 74 4f  |ll_GetEventListO|
000139b0  66 66 73 65 74 28 5f 55  25 21 32 38 2c 5f 55 25  |ffset(_U%!28,_U%|
000139c0  21 33 32 2c 5f 55 25 2b  37 32 2c 32 34 2c a3 29  |!32,_U%+72,24,.)|
000139d0  0d 0a 21 47 e7 20 6f 66  66 73 65 74 25 3d 2d 31  |..!G. offset%=-1|
000139e0  20 84 20 6f 66 66 73 65  74 25 3d 2d 32 20 8c 20  | . offset%=-2 . |
000139f0  85 20 39 39 2c a4 73 68  65 6c 6c 5f 4d 65 73 73  |. 99,.shell_Mess|
00013a00  61 67 65 4e 6f 41 72 67  73 28 22 53 48 45 4c 4c  |ageNoArgs("SHELL|
00013a10  4d 53 47 30 35 22 29 0d  0a 22 19 62 6c 6b 25 3d  |MSG05")..".blk%=|
00013a20  28 5f 55 25 21 37 32 29  2b 6f 66 66 73 65 74 25  |(_U%!72)+offset%|
00013a30  0d 0a 23 11 74 65 6d 70  25 3d 62 6c 6b 25 21 32  |..#.temp%=blk%!2|
00013a40  30 0d 0a 24 2c f4 20 6e  6f 77 20 63 61 6c 6c 20  |0..$,. now call |
00013a50  74 68 65 20 66 69 6c 65  20 73 61 76 69 6e 67 20  |the file saving |
00013a60  72 6f 75 74 69 6e 65 2e  2e 2e 2e 2e 2e 0d 0a 25  |routine........%|
00013a70  12 e7 20 24 74 65 6d 70  25 3c 3e 22 22 20 8c 0d  |.. $temp%<>"" ..|
00013a80  0a 26 29 20 20 76 6f 69  64 25 3d a0 28 22 46 4e  |.&)  void%=.("FN|
00013a90  22 2b 24 74 65 6d 70 25  2b 22 28 5f 66 75 6c 6c  |"+$temp%+"(_full|
00013aa0  6e 61 6d 65 24 29 22 29  0d 0a 27 05 cc 0d 0a 28  |name$)")..'....(|
00013ab0  51 20 20 f4 20 6e 6f 20  66 69 6c 65 20 73 61 76  |Q  . no file sav|
00013ac0  69 6e 67 20 72 6f 75 74  69 6e 65 20 73 70 65 63  |ing routine spec|
00013ad0  69 66 69 65 64 20 66 6f  72 20 74 68 69 73 20 65  |ified for this e|
00013ae0  76 65 6e 74 2c 20 73 6f  20 63 68 65 63 6b 20 69  |vent, so check i|
00013af0  66 20 64 61 74 61 20 69  73 20 69 6e 20 61 0d 0a  |f data is in a..|
00013b00  29 13 20 20 f4 20 68 65  61 70 62 6c 6f 63 6b 2e  |).  . heapblock.|
00013b10  2e 0d 0a 2a 28 20 20 e7  20 a4 73 68 65 6c 6c 5f  |...*(  . .shell_|
00013b20  48 65 61 70 42 6c 6f 63  6b 45 78 69 73 74 73 28  |HeapBlockExists(|
00013b30  62 6c 6b 25 21 38 29 20  8c 0d 0a 2b 47 20 20 20  |blk%!8) ...+G   |
00013b40  20 f4 20 64 65 66 61 75  6c 74 20 73 61 76 65 20  | . default save |
00013b50  72 6f 75 74 69 6e 65 2c  20 6a 75 73 74 20 73 61  |routine, just sa|
00013b60  76 65 20 74 68 65 20 77  68 6f 6c 65 20 68 65 61  |ve the whole hea|
00013b70  70 62 6c 6f 63 6b 20 74  6f 20 64 69 73 6b 2e 2e  |pblock to disk..|
00013b80  0d 0a 2c 58 20 20 20 20  c8 99 20 22 4f 53 5f 46  |..,X    .. "OS_F|
00013b90  69 6c 65 22 2c 31 30 2c  5f 66 75 6c 6c 6e 61 6d  |ile",10,_fullnam|
00013ba0  65 24 2c 62 6c 6b 25 21  31 32 2c 2c 62 6c 6b 25  |e$,blk%!12,,blk%|
00013bb0  21 38 2c 62 6c 6b 25 21  38 2b a4 73 68 65 6c 6c  |!8,blk%!8+.shell|
00013bc0  5f 48 65 61 70 42 6c 6f  63 6b 49 6e 66 6f 28 62  |_HeapBlockInfo(b|
00013bd0  6c 6b 25 21 38 29 2b 31  0d 0a 2d 07 20 20 cc 0d  |lk%!8)+1..-.  ..|
00013be0  0a 2e 3a 20 20 20 20 f4  20 57 68 6f 6f 70 73 21  |..:    . Whoops!|
00013bf0  20 6e 6f 74 20 61 20 68  65 61 70 62 6c 6f 63 6b  | not a heapblock|
00013c00  20 2d 20 73 6f 6d 65 6f  6e 65 27 73 20 73 63 72  | - someone's scr|
00013c10  65 77 65 64 20 75 70 2e  2e 0d 0a 2f 2f 20 20 20  |ewed up....//   |
00013c20  20 85 20 39 39 2c a4 73  68 65 6c 6c 5f 4d 65 73  | . 99,.shell_Mes|
00013c30  73 61 67 65 4e 6f 41 72  67 73 28 22 53 48 45 4c  |sageNoArgs("SHEL|
00013c40  4c 4d 53 47 32 31 22 29  0d 0a 30 07 20 20 cd 0d  |LMSG21")..0.  ..|
00013c50  0a 31 05 cd 0d 0a 32 11  e7 20 5f 51 25 21 33 36  |.1....2.. _Q%!36|
00013c60  3e 2d 31 20 8c 0d 0a 33  16 20 20 f4 20 66 69 6c  |>-1 ...3.  . fil|
00013c70  65 20 69 73 20 73 65 63  75 72 65 0d 0a 34 32 20  |e is secure..42 |
00013c80  20 e7 20 5f 55 25 21 38  30 3c 3e 30 20 8c 20 f2  | . _U%!80<>0 . .|
00013c90  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 52  |shell_HeapBlockR|
00013ca0  65 74 75 72 6e 28 5f 55  25 21 38 30 29 0d 0a 35  |eturn(_U%!80)..5|
00013cb0  31 20 20 5f 55 25 21 38  30 3d a4 73 68 65 6c 6c  |1  _U%!80=.shell|
00013cc0  5f 48 65 61 70 42 6c 6f  63 6b 46 65 74 63 68 28  |_HeapBlockFetch(|
00013cd0  a9 5f 66 75 6c 6c 6e 61  6d 65 24 2b 31 29 0d 0a  |._fullname$+1)..|
00013ce0  36 12 20 20 74 65 6d 70  25 3d 5f 55 25 21 38 30  |6.  temp%=_U%!80|
00013cf0  0d 0a 37 17 20 20 24 74  65 6d 70 25 3d 5f 66 75  |..7.  $temp%=_fu|
00013d00  6c 6c 6e 61 6d 65 24 0d  0a 38 05 cd 0d 0a 39 42  |llname$..8....9B|
00013d10  5f 51 25 21 31 36 3d 33  3a 21 5f 51 25 3d 32 35  |_Q%!16=3:!_Q%=25|
00013d20  36 3a 5f 51 25 21 32 30  3d 5f 55 25 21 32 30 30  |6:_Q%!20=_U%!200|
00013d30  3a 5f 51 25 21 32 34 3d  5f 55 25 21 32 30 34 3a  |:_Q%!24=_U%!204:|
00013d40  5f 51 25 21 34 30 3d 5f  55 25 21 31 34 30 0d 0a  |_Q%!40=_U%!140..|
00013d50  3a 35 5f 51 25 21 33 36  3d a4 73 68 65 6c 6c 5f  |:5_Q%!36=.shell_|
00013d60  46 69 6c 65 4c 65 6e 67  74 68 28 5f 66 75 6c 6c  |FileLength(_full|
00013d70  6e 61 6d 65 24 29 3a 5f  51 25 21 31 32 3d 5f 51  |name$):_Q%!12=_Q|
00013d80  25 21 38 0d 0a 3b 15 2a  7c 69 66 64 65 66 20 54  |%!8..;.*|ifdef T|
00013d90  72 61 63 65 49 6e 69 74  0d 0a 3c 42 f2 73 68 65  |raceInit..<B.she|
00013da0  6c 6c 5f 54 72 61 63 65  66 30 28 22 44 61 74 61  |ll_Tracef0("Data|
00013db0  53 61 76 65 41 63 6b 3a  46 69 6c 65 20 6c 65 6e  |SaveAck:File len|
00013dc0  67 74 68 20 69 73 20 22  2b c3 5f 51 25 21 33 36  |gth is "+._Q%!36|
00013dd0  2b 22 20 62 79 74 65 73  22 29 0d 0a 3d 0b 2a 7c  |+" bytes")..=.*||
00013de0  65 6e 64 69 66 0d 0a 3e  1d 24 28 5f 51 25 2b 34  |endif..>.$(_Q%+4|
00013df0  34 29 3d 5f 66 75 6c 6c  6e 61 6d 65 24 2b bd 28  |4)=_fullname$+.(|
00013e00  30 29 0d 0a 3f 1b f4 20  73 65 6e 64 20 64 61 74  |0)..?.. send dat|
00013e10  61 6c 6f 61 64 20 6d 65  73 73 61 67 65 0d 0a 40  |aload message..@|
00013e20  12 f4 20 73 74 6f 72 65  20 6d 79 5f 72 65 66 0d  |.. store my_ref.|
00013e30  0a 41 10 5f 55 25 21 38  34 3d 5f 51 25 21 38 0d  |.A._U%!84=_Q%!8.|
00013e40  0a 42 15 2a 7c 69 66 64  65 66 20 54 72 61 63 65  |.B.*|ifdef Trace|
00013e50  49 6e 69 74 0d 0a 43 3a  f2 73 68 65 6c 6c 5f 54  |Init..C:.shell_T|
00013e60  72 61 63 65 66 30 28 22  44 61 74 61 53 61 76 65  |racef0("DataSave|
00013e70  41 63 6b 3a 53 65 6e 64  69 6e 67 20 44 61 74 61  |Ack:Sending Data|
00013e80  4c 6f 61 64 20 4d 65 73  73 61 67 65 22 29 0d 0a  |Load Message")..|
00013e90  44 0b 2a 7c 65 6e 64 69  66 0d 0a 45 2e c8 99 20  |D.*|endif..E... |
00013ea0  22 57 69 6d 70 5f 53 65  6e 64 4d 65 73 73 61 67  |"Wimp_SendMessag|
00013eb0  65 22 2c 31 38 2c 5f 51  25 2c 5f 51 25 21 32 30  |e",18,_Q%,_Q%!20|
00013ec0  2c 5f 51 25 21 32 34 0d  0a 46 3f f4 20 6e 6f 77  |,_Q%!24..F?. now|
00013ed0  20 63 6c 6f 73 65 20 77  69 6e 64 6f 77 20 74 68  | close window th|
00013ee0  61 74 20 73 61 76 65 20  6f 72 69 67 69 6e 61 74  |at save originat|
00013ef0  65 64 20 66 72 6f 6d 20  69 66 20 69 74 20 69 73  |ed from if it is|
00013f00  20 6e 6f 74 20 61 0d 0a  47 14 f4 20 27 64 79 6e  | not a..G.. 'dyn|
00013f10  61 6d 69 63 27 20 64 62  6f 78 0d 0a 48 16 e7 20  |amic' dbox..H.. |
00013f20  5f 55 25 21 32 38 3c 3e  5f 55 25 21 32 30 20 8c  |_U%!28<>_U%!20 .|
00013f30  0d 0a 49 20 20 20 f2 73  68 65 6c 6c 5f 43 6c 6f  |..I   .shell_Clo|
00013f40  73 65 57 69 6e 64 6f 77  28 5f 55 25 21 32 38 29  |seWindow(_U%!28)|
00013f50  0d 0a 4a 05 cd 0d 0a 4b  33 c8 99 20 22 57 69 6d  |..J....K3.. "Wim|
00013f60  70 5f 43 72 65 61 74 65  4d 65 6e 75 22 2c 2c 2d  |p_CreateMenu",,-|
00013f70  31 3a f4 20 63 6c 6f 73  65 20 61 6e 79 20 6f 70  |1:. close any op|
00013f80  65 6e 20 6d 65 6e 75 73  0d 0a 4c 05 e1 0d 0a 4d  |en menus..L....M|
00013f90  05 3a 0d 0a 4e 20 2a 7c  53 74 6f 70 20 50 52 4f  |.:..N *|Stop PRO|
00013fa0  43 73 68 65 6c 6c 5f 44  61 74 61 53 61 76 65 41  |Cshell_DataSaveA|
00013fb0  63 6b 0d 0a 4f 27 2a 7c  53 74 61 72 74 20 50 52  |ck..O'*|Start PR|
00013fc0  4f 43 73 68 65 6c 6c 5f  44 61 74 61 53 61 76 65  |OCshell_DataSave|
00013fd0  43 68 65 63 6b 4e 61 6d  65 0d 0a 50 27 dd 20 f2  |CheckName..P'. .|
00013fe0  73 68 65 6c 6c 5f 44 61  74 61 53 61 76 65 43 68  |shell_DataSaveCh|
00013ff0  65 63 6b 4e 61 6d 65 28  77 68 25 2c 69 68 25 29  |eckName(wh%,ih%)|
00014000  0d 0a 51 1d ea 20 6f 66  66 73 65 74 25 2c 62 6c  |..Q.. offset%,bl|
00014010  6b 25 2c 6c 69 73 74 5f  73 69 7a 65 25 0d 0a 52  |k%,list_size%..R|
00014020  46 f4 20 52 6f 75 74 69  6e 65 20 74 6f 20 63 68  |F. Routine to ch|
00014030  65 63 6b 20 69 66 20 61  20 27 64 61 74 61 73 61  |eck if a 'datasa|
00014040  76 65 27 20 65 76 65 6e  74 20 65 78 69 73 74 73  |ve' event exists|
00014050  20 69 6e 20 74 68 65 20  77 69 6e 64 6f 77 20 77  | in the window w|
00014060  68 25 2e 0d 0a 53 45 f4  20 49 66 20 69 74 20 64  |h%...SE. If it d|
00014070  6f 65 73 20 74 68 65 6e  20 74 68 65 20 66 69 6c  |oes then the fil|
00014080  65 6e 61 6d 65 20 69 73  20 63 68 65 63 6b 65 64  |ename is checked|
00014090  20 66 6f 72 20 61 20 27  2e 27 20 63 68 61 72 61  | for a '.' chara|
000140a0  63 74 65 72 2e 20 41 6e  0d 0a 54 46 f4 20 65 72  |cter. An..TF. er|
000140b0  72 6f 72 20 69 73 20 67  65 6e 65 72 61 74 65 64  |ror is generated|
000140c0  20 69 66 20 6e 6f 20 27  2e 27 20 69 73 20 66 6f  | if no '.' is fo|
000140d0  75 6e 64 2e 20 54 68 69  73 20 72 6f 75 74 69 6e  |und. This routin|
000140e0  65 20 69 73 20 63 61 6c  6c 65 64 20 62 79 0d 0a  |e is called by..|
000140f0  55 3b f4 20 74 68 65 20  6c 69 62 72 61 72 79 20  |U;. the library |
00014100  77 68 65 6e 20 61 20 6d  6f 75 73 65 20 63 6c 69  |when a mouse cli|
00014110  63 6b 20 6f 6e 20 69 63  6f 6e 20 30 20 69 73 20  |ck on icon 0 is |
00014120  64 65 74 65 63 74 65 64  2e 0d 0a 56 19 62 6c 6b  |detected...V.blk|
00014130  25 3d 5f 55 25 21 37 32  3a 6f 66 66 73 65 74 25  |%=_U%!72:offset%|
00014140  3d 30 0d 0a 57 0f e7 20  62 6c 6b 25 3c 3e 30 20  |=0..W.. blk%<>0 |
00014150  8c 0d 0a 58 2d 20 20 6c  69 73 74 5f 73 69 7a 65  |...X-  list_size|
00014160  25 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |%=.shell_HeapBlo|
00014170  63 6b 49 6e 66 6f 28 62  6c 6b 25 29 2d 38 0d 0a  |ckInfo(blk%)-8..|
00014180  59 38 20 20 f4 20 62 6c  6b 25 3c 3e 30 20 74 68  |Y8  . blk%<>0 th|
00014190  65 72 65 66 6f 72 65 20  61 20 64 61 74 61 73 61  |erefore a datasa|
000141a0  76 65 20 65 76 65 6e 74  20 6c 69 73 74 20 65 78  |ve event list ex|
000141b0  69 73 74 73 2e 2e 0d 0a  5a 07 20 20 f5 0d 0a 5b  |ists....Z.  ...[|
000141c0  32 20 20 20 20 f4 20 63  68 65 63 6b 20 77 69 6e  |2    . check win|
000141d0  64 6f 77 20 68 61 6e 64  6c 65 73 20 6f 66 20 65  |dow handles of e|
000141e0  76 65 6e 74 73 20 69 6e  20 6c 69 73 74 2e 2e 0d  |vents in list...|
000141f0  0a 5c 1f 20 20 20 20 e7  20 21 28 62 6c 6b 25 2b  |.\.    . !(blk%+|
00014200  6f 66 66 73 65 74 25 29  3d 77 68 25 20 8c 0d 0a  |offset%)=wh% ...|
00014210  5d 29 20 20 20 20 20 20  f4 20 63 68 65 63 6b 20  |])      . check |
00014220  66 6f 72 20 61 20 76 61  6c 69 64 20 70 61 74 68  |for a valid path|
00014230  20 6e 61 6d 65 2e 2e 0d  0a 5e 31 20 20 20 20 20  | name....^1     |
00014240  20 6e 61 6d 65 24 3d a4  73 68 65 6c 6c 5f 49 63  | name$=.shell_Ic|
00014250  6f 6e 47 65 74 44 61 74  61 28 21 62 6c 6b 25 2c  |onGetData(!blk%,|
00014260  62 6c 6b 25 21 31 36 29  0d 0a 5f 49 20 20 20 20  |blk%!16).._I    |
00014270  20 20 e7 20 a7 6e 61 6d  65 24 2c 22 2e 22 29 3d  |  . .name$,".")=|
00014280  30 20 8c 20 f2 73 68 65  6c 6c 5f 4f 4b 28 a4 73  |0 . .shell_OK(.s|
00014290  68 65 6c 6c 5f 4d 65 73  73 61 67 65 4e 6f 41 72  |hell_MessageNoAr|
000142a0  67 73 28 22 53 48 45 4c  4c 4d 53 47 30 31 22 29  |gs("SHELLMSG01")|
000142b0  29 0d 0a 60 43 20 20 20  20 20 20 6f 66 66 73 65  |)..`C      offse|
000142c0  74 25 3d 6c 69 73 74 5f  73 69 7a 65 25 3a f4 20  |t%=list_size%:. |
000142d0  77 69 6e 64 6f 77 20 68  61 6e 64 6c 65 20 66 6f  |window handle fo|
000142e0  75 6e 64 20 73 6f 20 61  62 6f 72 74 20 63 68 65  |und so abort che|
000142f0  63 6b 2e 2e 0d 0a 61 09  20 20 20 20 cd 0d 0a 62  |ck....a.    ...b|
00014300  28 20 20 20 20 6f 66 66  73 65 74 25 2b 3d 32 34  |(    offset%+=24|
00014310  3a f4 20 63 68 65 63 6b  20 6e 65 78 74 20 65 76  |:. check next ev|
00014320  65 6e 74 2e 2e 0d 0a 63  1b 20 20 fd 20 6f 66 66  |ent....c.  . off|
00014330  73 65 74 25 3e 3d 6c 69  73 74 5f 73 69 7a 65 25  |set%>=list_size%|
00014340  0d 0a 64 05 cd 0d 0a 65  05 e1 0d 0a 66 05 3a 0d  |..d....e....f.:.|
00014350  0a 67 26 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |.g&*|Stop PROCsh|
00014360  65 6c 6c 5f 44 61 74 61  53 61 76 65 43 68 65 63  |ell_DataSaveChec|
00014370  6b 4e 61 6d 65 0d 0a 68  21 2a 7c 53 74 61 72 74  |kName..h!*|Start|
00014380  20 50 52 4f 43 73 68 65  6c 6c 5f 44 61 74 61 4c  | PROCshell_DataL|
00014390  6f 61 64 41 63 6b 0d 0a  69 1d dd 20 f2 73 68 65  |oadAck..i.. .she|
000143a0  6c 6c 5f 44 61 74 61 4c  6f 61 64 41 63 6b 28 5f  |ll_DataLoadAck(_|
000143b0  51 25 29 0d 0a 6a 15 2a  7c 69 66 64 65 66 20 54  |Q%)..j.*|ifdef T|
000143c0  72 61 63 65 49 6e 69 74  0d 0a 6b 51 f2 73 68 65  |raceInit..kQ.she|
000143d0  6c 6c 5f 54 72 61 63 65  66 30 28 22 44 61 74 61  |ll_Tracef0("Data|
000143e0  4c 6f 61 64 41 63 6b 3a  44 61 74 61 4c 6f 61 64  |LoadAck:DataLoad|
000143f0  41 63 6b 20 6d 65 73 73  61 67 65 20 72 65 63 65  |Ack message rece|
00014400  69 76 65 64 20 28 66 69  6c 65 20 72 65 63 65 69  |ived (file recei|
00014410  76 65 64 20 6f 6b 29 22  29 0d 0a 6c 0b 2a 7c 65  |ved ok)")..l.*|e|
00014420  6e 64 69 66 0d 0a 6d 05  e1 0d 0a 6e 05 3a 0d 0a  |ndif..m....n.:..|
00014430  6f 20 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |o *|Stop PROCshe|
00014440  6c 6c 5f 44 61 74 61 4c  6f 61 64 41 63 6b 0d 0a  |ll_DataLoadAck..|
00014450  70 2c 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |p,*|Start PROCsh|
00014460  65 6c 6c 5f 55 73 65 72  4d 65 73 73 61 67 65 41  |ell_UserMessageA|
00014470  63 6b 6e 6f 77 6c 65 64  67 65 0d 0a 71 28 dd 20  |cknowledge..q(. |
00014480  f2 73 68 65 6c 6c 5f 55  73 65 72 4d 65 73 73 61  |.shell_UserMessa|
00014490  67 65 41 63 6b 6e 6f 77  6c 65 64 67 65 28 5f 51  |geAcknowledge(_Q|
000144a0  25 29 0d 0a 72 0f c8 8e  20 5f 51 25 21 31 36 20  |%)..r... _Q%!16 |
000144b0  ca 0d 0a 73 21 20 20 c9  20 33 3a f2 73 68 65 6c  |...s!  . 3:.shel|
000144c0  6c 5f 41 63 6b 44 61 74  61 4c 6f 61 64 28 5f 51  |l_AckDataLoad(_Q|
000144d0  25 29 0d 0a 74 21 20 20  c9 20 36 3a f2 73 68 65  |%)..t!  . 6:.she|
000144e0  6c 6c 5f 41 63 6b 52 41  4d 46 65 74 63 68 28 5f  |ll_AckRAMFetch(_|
000144f0  51 25 29 0d 0a 75 05 cb  0d 0a 76 05 e1 0d 0a 77  |Q%)..u....v....w|
00014500  05 3a 0d 0a 78 2b 2a 7c  53 74 6f 70 20 50 52 4f  |.:..x+*|Stop PRO|
00014510  43 73 68 65 6c 6c 5f 55  73 65 72 4d 65 73 73 61  |Cshell_UserMessa|
00014520  67 65 41 63 6b 6e 6f 77  6c 65 64 67 65 0d 0a 79  |geAcknowledge..y|
00014530  21 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |!*|Start PROCshe|
00014540  6c 6c 5f 41 63 6b 44 61  74 61 4c 6f 61 64 0d 0a  |ll_AckDataLoad..|
00014550  7a 1d dd 20 f2 73 68 65  6c 6c 5f 41 63 6b 44 61  |z.. .shell_AckDa|
00014560  74 61 4c 6f 61 64 28 5f  51 25 29 0d 0a 7b 16 e7  |taLoad(_Q%)..{..|
00014570  20 5f 51 25 21 31 32 3c  3e 5f 55 25 21 38 34 20  | _Q%!12<>_U%!84 |
00014580  8c 0d 0a 7c 26 20 20 f4  20 52 65 66 65 72 65 6e  |...|&  . Referen|
00014590  63 65 20 68 61 73 6e 27  74 20 62 65 65 6e 20 75  |ce hasn't been u|
000145a0  70 64 61 74 65 64 2c 0d  0a 7d 2b 20 20 f4 20 74  |pdated,..}+  . t|
000145b0  68 65 72 65 66 6f 72 65  20 74 68 65 20 57 69 6d  |herefore the Wim|
000145c0  70 20 72 65 74 75 72 6e  65 64 20 6d 79 20 63 61  |p returned my ca|
000145d0  6c 6c 0d 0a 7e 35 20 20  f4 20 54 68 65 20 72 65  |ll..~5  . The re|
000145e0  63 65 69 76 65 72 20 64  69 64 6e 27 74 20 75 6e  |ceiver didn't un|
000145f0  64 65 72 73 74 61 6e 64  20 73 63 72 61 70 20 74  |derstand scrap t|
00014600  72 61 6e 73 66 65 72 0d  0a 7f 24 20 20 c8 99 20  |ransfer...$  .. |
00014610  22 58 4f 53 5f 46 69 6c  65 22 2c 36 2c 22 3c 57  |"XOS_File",6,"<W|
00014620  69 6d 70 24 53 63 72 61  70 3e 22 0d 0a 80 31 20  |imp$Scrap>"...1 |
00014630  20 85 20 32 35 35 2c 22  44 61 74 61 20 54 72 61  | . 255,"Data Tra|
00014640  6e 73 66 65 72 20 66 61  69 6c 65 64 3a 20 52 65  |nsfer failed: Re|
00014650  63 65 69 76 65 72 20 64  69 65 64 22 0d 0a 81 05  |ceiver died"....|
00014660  cd 0d 0a 82 05 e1 0d 0a  83 05 3a 0d 0a 84 20 2a  |..........:... *|
00014670  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
00014680  41 63 6b 44 61 74 61 4c  6f 61 64 0d 0a 85 21 2a  |AckDataLoad...!*|
00014690  7c 53 74 61 72 74 20 50  52 4f 43 73 68 65 6c 6c  ||Start PROCshell|
000146a0  5f 41 63 6b 52 41 4d 46  65 74 63 68 0d 0a 86 1d  |_AckRAMFetch....|
000146b0  dd 20 f2 73 68 65 6c 6c  5f 41 63 6b 52 41 4d 46  |. .shell_AckRAMF|
000146c0  65 74 63 68 28 5f 51 25  29 0d 0a 87 12 ea 20 45  |etch(_Q%)..... E|
000146d0  78 69 73 74 25 2c 74 65  6d 70 25 0d 0a 88 11 74  |xist%,temp%....t|
000146e0  65 6d 70 25 3d 5f 55 25  21 31 35 36 0d 0a 89 15  |emp%=_U%!156....|
000146f0  2a 7c 69 66 64 65 66 20  54 72 61 63 65 49 6e 69  |*|ifdef TraceIni|
00014700  74 0d 0a 8a 38 f2 73 68  65 6c 6c 5f 54 72 61 63  |t...8.shell_Trac|
00014710  65 66 30 28 22 41 63 6b  52 41 4d 46 65 74 63 68  |ef0("AckRAMFetch|
00014720  3a 41 63 6b 52 41 4d 46  65 74 63 68 20 63 61 6c  |:AckRAMFetch cal|
00014730  6c 65 64 2e 2e 2e 2e 22  29 0d 0a 8b 0b 2a 7c 65  |led....")....*|e|
00014740  6e 64 69 66 0d 0a 8c 17  e7 20 5f 51 25 21 31 32  |ndif..... _Q%!12|
00014750  3c 3e 5f 55 25 21 31 31  32 20 8c 0d 0a 8d 26 20  |<>_U%!112 ....& |
00014760  20 f4 20 52 65 66 65 72  65 6e 63 65 20 68 61 73  | . Reference has|
00014770  6e 27 74 20 62 65 65 6e  20 75 70 64 61 74 65 64  |n't been updated|
00014780  2c 0d 0a 8e 2b 20 20 f4  20 74 68 65 72 65 66 6f  |,...+  . therefo|
00014790  72 65 20 74 68 65 20 57  69 6d 70 20 72 65 74 75  |re the Wimp retu|
000147a0  72 6e 65 64 20 6d 79 20  63 61 6c 6c 0d 0a 8f 13  |rned my call....|
000147b0  20 20 e7 20 5f 55 25 21  31 32 38 3d 30 20 8c 0d  |  . _U%!128=0 ..|
000147c0  0a 90 32 20 20 20 20 f4  20 54 68 65 20 72 65 63  |..2    . The rec|
000147d0  65 69 76 65 72 20 64 69  64 6e 27 74 20 73 75 70  |eiver didn't sup|
000147e0  70 6f 72 74 20 52 41 4d  20 74 72 61 6e 73 66 65  |port RAM transfe|
000147f0  72 0d 0a 91 15 2a 7c 69  66 64 65 66 20 54 72 61  |r....*|ifdef Tra|
00014800  63 65 49 6e 69 74 0d 0a  92 4a 20 20 f2 73 68 65  |ceInit...J  .she|
00014810  6c 6c 5f 54 72 61 63 65  66 30 28 22 41 63 6b 52  |ll_Tracef0("AckR|
00014820  41 4d 46 65 74 63 68 3a  52 65 63 65 69 76 65 72  |AMFetch:Receiver|
00014830  20 64 6f 65 73 20 6e 6f  74 20 73 75 70 70 6f 72  | does not suppor|
00014840  74 20 52 41 4d 20 74 72  61 6e 73 66 65 72 22 29  |t RAM transfer")|
00014850  0d 0a 93 0b 2a 7c 65 6e  64 69 66 0d 0a 94 3b 20  |....*|endif...; |
00014860  20 20 20 c8 99 20 22 58  4f 53 5f 52 65 61 64 56  |   .. "XOS_ReadV|
00014870  61 72 56 61 6c 22 2c 22  57 69 6d 70 24 53 63 72  |arVal","Wimp$Scr|
00014880  61 70 22 2c 2c 2d 31 2c  30 2c 33 20 b8 20 2c 2c  |ap",,-1,0,3 . ,,|
00014890  45 78 69 73 74 25 0d 0a  95 15 20 20 20 20 e7 20  |Exist%....    . |
000148a0  45 78 69 73 74 25 3c 3e  30 20 8c 0d 0a 96 29 20  |Exist%<>0 ....) |
000148b0  20 20 20 20 20 24 28 74  65 6d 70 25 2b 34 34 29  |     $(temp%+44)|
000148c0  3d 22 3c 57 69 6d 70 24  53 63 72 61 70 3e 22 2b  |="<Wimp$Scrap>"+|
000148d0  bd 28 30 29 0d 0a 97 38  20 20 20 20 20 20 74 65  |.(0)...8      te|
000148e0  6d 70 25 21 30 30 3d 28  34 39 2b a9 28 a4 73 68  |mp%!00=(49+.(.sh|
000148f0  65 6c 6c 5f 47 65 74 53  74 72 69 6e 67 28 74 65  |ell_GetString(te|
00014900  6d 70 25 2b 34 34 29 29  29 80 ac 33 0d 0a 98 1b  |mp%+44)))..3....|
00014910  20 20 20 20 20 20 74 65  6d 70 25 21 31 32 3d 74  |      temp%!12=t|
00014920  65 6d 70 25 21 30 38 0d  0a 99 14 20 20 20 20 20  |emp%!08....     |
00014930  20 74 65 6d 70 25 21 31  36 3d 32 0d 0a 9a 15 20  | temp%!16=2.... |
00014940  20 20 20 20 20 74 65 6d  70 25 21 33 36 3d 2d 31  |     temp%!36=-1|
00014950  0d 0a 9b 30 20 20 20 20  20 20 c8 99 20 22 57 69  |...0      .. "Wi|
00014960  6d 70 5f 53 65 6e 64 4d  65 73 73 61 67 65 22 2c  |mp_SendMessage",|
00014970  31 38 2c 74 65 6d 70 25  2c 74 65 6d 70 25 21 34  |18,temp%,temp%!4|
00014980  0d 0a 9c 1a 20 20 20 20  20 20 5f 55 25 21 31 30  |....      _U%!10|
00014990  38 3d 74 65 6d 70 25 21  30 38 0d 0a 9d 09 20 20  |8=temp%!08....  |
000149a0  20 20 cc 0d 0a 9e 38 20  20 20 20 20 20 20 f2 73  |  ....8       .s|
000149b0  68 65 6c 6c 5f 4f 4b 28  a4 73 68 65 6c 6c 5f 4d  |hell_OK(.shell_M|
000149c0  65 73 73 61 67 65 4e 6f  41 72 67 73 28 22 53 48  |essageNoArgs("SH|
000149d0  45 4c 4c 4d 53 47 31 34  22 29 29 0d 0a 9f 09 20  |ELLMSG14")).... |
000149e0  20 20 20 cd 0d 0a a0 07  20 20 cc 0d 0a a1 3b 20  |   .....  ....; |
000149f0  20 20 20 f4 20 54 68 65  20 72 65 63 65 69 76 65  |   . The receive|
00014a00  72 20 68 61 73 20 69 6e  69 74 69 61 74 65 64 20  |r has initiated |
00014a10  52 41 4d 20 74 72 61 6e  73 66 65 72 2c 20 61 6e  |RAM transfer, an|
00014a20  64 20 74 68 69 73 0d 0a  a2 3f 20 20 20 20 f4 20  |d this...?    . |
00014a30  77 61 73 20 73 75 63 63  65 73 73 66 75 6c 20 6f  |was successful o|
00014a40  6e 63 65 2c 20 62 75 74  20 49 20 65 78 70 65 63  |nce, but I expec|
00014a50  74 65 64 20 6d 6f 72 65  20 64 61 74 61 20 74 6f  |ted more data to|
00014a60  20 63 6f 6d 65 0d 0a a3  15 2a 7c 69 66 64 65 66  | come....*|ifdef|
00014a70  20 54 72 61 63 65 49 6e  69 74 0d 0a a4 60 20 20  | TraceInit...`  |
00014a80  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
00014a90  41 63 6b 52 41 4d 46 65  74 63 68 3a 52 41 4d 20  |AckRAMFetch:RAM |
00014aa0  74 72 61 6e 73 66 65 72  20 73 74 61 72 74 65 64  |transfer started|
00014ab0  2c 20 62 75 74 20 6e 6f  74 20 65 6e 6f 75 67 68  |, but not enough|
00014ac0  20 64 61 74 61 20 73 65  6e 74 2e 20 53 65 6e 64  | data sent. Send|
00014ad0  65 72 20 64 69 65 64 3f  22 29 0d 0a a5 0b 2a 7c  |er died?")....*||
00014ae0  65 6e 64 69 66 0d 0a a6  27 20 20 20 20 f2 73 68  |endif...'    .sh|
00014af0  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 52 65 74  |ell_HeapBlockRet|
00014b00  75 72 6e 28 5f 55 25 21  31 35 32 29 0d 0a a7 11  |urn(_U%!152)....|
00014b10  20 20 20 20 5f 55 25 21  31 35 32 3d 30 0d 0a a8  |    _U%!152=0...|
00014b20  1f 20 20 20 20 f2 73 68  65 6c 6c 5f 4f 4b 28 22  |.    .shell_OK("|
00014b30  53 48 45 4c 4c 4d 53 47  30 36 22 29 0d 0a a9 07  |SHELLMSG06")....|
00014b40  20 20 cd 0d 0a aa 05 cd  0d 0a ab 05 e1 0d 0a ac  |  ..............|
00014b50  05 3a 0d 0a ad 20 2a 7c  53 74 6f 70 20 50 52 4f  |.:... *|Stop PRO|
00014b60  43 73 68 65 6c 6c 5f 41  63 6b 52 41 4d 46 65 74  |Cshell_AckRAMFet|
00014b70  63 68 0d 0a ae 04 0d 0a  af 21 2a 7c 53 74 61 72  |ch.......!*|Star|
00014b80  74 20 50 52 4f 43 73 68  65 6c 6c 5f 4d 65 6e 75  |t PROCshell_Menu|
00014b90  57 61 72 6e 69 6e 67 0d  0a b0 1d dd 20 f2 73 68  |Warning..... .sh|
00014ba0  65 6c 6c 5f 4d 65 6e 75  57 61 72 6e 69 6e 67 28  |ell_MenuWarning(|
00014bb0  5f 51 25 29 0d 0a b1 45  ea 20 66 6e 24 2c 6d 65  |_Q%)...E. fn$,me|
00014bc0  6e 75 5f 62 75 66 66 65  72 25 2c 78 25 2c 79 25  |nu_buffer%,x%,y%|
00014bd0  2c 76 6f 69 64 25 2c 5f  74 65 6d 70 25 2c 61 25  |,void%,_temp%,a%|
00014be0  2c 77 61 72 6e 5f 66 6e  24 2c 69 74 65 6d 5f 61  |,warn_fn$,item_a|
00014bf0  64 64 72 25 2c 62 6c 6b  25 0d 0a b2 21 78 25 3d  |ddr%,blk%...!x%=|
00014c00  5f 51 25 21 32 34 3a 79  25 3d 5f 51 25 21 32 38  |_Q%!24:y%=_Q%!28|
00014c10  3a 5f 55 25 21 32 36 34  3d 30 0d 0a b3 11 e7 20  |:_U%!264=0..... |
00014c20  5f 55 25 21 32 30 3c 3e  30 20 8c 0d 0a b4 21 20  |_U%!20<>0 ....! |
00014c30  20 2a 7c 69 66 64 65 66  20 50 52 4f 43 73 68 65  | *|ifdef PROCshe|
00014c40  6c 6c 5f 54 72 61 63 65  49 6e 69 74 0d 0a b5 55  |ll_TraceInit...U|
00014c50  20 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |  .shell_Tracef0|
00014c60  28 22 4d 65 6e 75 57 61  72 6e 69 6e 67 3a 52 65  |("MenuWarning:Re|
00014c70  6d 6f 76 69 6e 67 20 6c  61 73 74 20 64 79 6e 61  |moving last dyna|
00014c80  6d 69 63 20 64 62 6f 78  20 28 68 61 6e 64 6c 65  |mic dbox (handle|
00014c90  3d 26 22 2b c3 7e 5f 55  25 21 32 30 2b 22 29 22  |=&"+.~_U%!20+")"|
00014ca0  29 0d 0a b6 0d 20 20 2a  7c 65 6e 64 69 66 0d 0a  |)....  *|endif..|
00014cb0  b7 27 20 20 76 6f 69 64  25 3d a4 73 68 65 6c 6c  |.'  void%=.shell|
00014cc0  5f 44 65 6c 65 74 65 57  69 6e 64 6f 77 28 5f 55  |_DeleteWindow(_U|
00014cd0  25 21 32 30 29 0d 0a b8  21 20 20 2a 7c 69 66 64  |%!20)...!  *|ifd|
00014ce0  65 66 20 50 52 4f 43 73  68 65 6c 6c 5f 54 72 61  |ef PROCshell_Tra|
00014cf0  63 65 49 6e 69 74 0d 0a  b9 3d 20 20 f2 73 68 65  |ceInit...=  .she|
00014d00  6c 6c 5f 54 72 61 63 65  66 30 28 22 4d 65 6e 75  |ll_Tracef0("Menu|
00014d10  57 61 72 6e 69 6e 67 3a  4c 61 73 74 20 64 79 6e  |Warning:Last dyn|
00014d20  61 6d 69 63 20 64 62 6f  78 20 72 65 6d 6f 76 65  |amic dbox remove|
00014d30  64 22 29 0d 0a ba 0d 20  20 2a 7c 65 6e 64 69 66  |d")....  *|endif|
00014d40  0d 0a bb 05 cd 0d 0a bc  39 f4 20 43 68 65 63 6b  |........9. Check|
00014d50  20 73 75 62 6d 65 6e 75  20 70 6f 69 6e 74 65 72  | submenu pointer|
00014d60  20 61 6e 64 20 63 72 65  61 74 65 20 77 69 6e 64  | and create wind|
00014d70  6f 77 20 66 6f 75 6e 64  20 74 68 65 72 65 0d 0a  |ow found there..|
00014d80  bd 25 f4 20 54 68 65 6e  20 63 61 6c 6c 20 70 72  |.%. Then call pr|
00014d90  65 20 61 6e 64 20 70 6f  73 74 20 6f 70 65 6e 20  |e and post open |
00014da0  46 4e 73 0d 0a be 4a f4  20 49 66 20 73 75 62 6d  |FNs...J. If subm|
00014db0  65 6e 75 20 70 6f 69 6e  74 65 72 20 69 73 20 74  |enu pointer is t|
00014dc0  68 65 20 77 61 72 6e 69  6e 67 20 77 69 6e 64 6f  |he warning windo|
00014dd0  77 2c 20 6f 70 65 6e 20  69 74 20 74 6f 20 72 65  |w, open it to re|
00014de0  6d 69 6e 64 20 74 68 65  20 75 73 65 72 0d 0a bf  |mind the user...|
00014df0  39 f4 20 74 68 61 74 20  6e 6f 20 64 62 6f 78 20  |9. that no dbox |
00014e00  68 61 73 20 62 65 65 6e  20 61 74 74 61 63 68 65  |has been attache|
00014e10  64 20 74 6f 20 74 68 69  73 20 6d 65 6e 75 20 65  |d to this menu e|
00014e20  6e 74 72 79 2e 2e 0d 0a  c0 0f c8 8e 20 5f 51 25  |ntry........ _Q%|
00014e30  21 32 30 20 ca 0d 0a c1  28 c9 20 5f 55 25 21 32  |!20 ....(. _U%!2|
00014e40  32 38 3a f4 20 68 61 6e  64 6c 65 20 6f 66 20 77  |28:. handle of w|
00014e50  61 72 6e 69 6e 67 20 64  62 6f 78 2e 2e 0d 0a c2  |arning dbox.....|
00014e60  44 20 20 f4 20 77 6f 6e  27 74 20 6e 65 65 64 20  |D  . won't need |
00014e70  74 6f 20 64 6f 20 74 68  69 73 20 69 66 20 74 69  |to do this if ti|
00014e80  74 6c 65 2f 69 63 6f 6e  20 6d 65 73 73 61 67 65  |tle/icon message|
00014e90  73 20 61 72 65 20 73 75  62 73 74 69 74 75 74 65  |s are substitute|
00014ea0  64 0d 0a c3 22 20 20 f4  20 77 68 65 6e 20 6c 6f  |d..."  . when lo|
00014eb0  61 64 69 6e 67 20 74 68  65 20 74 65 6d 70 6c 61  |ading the templa|
00014ec0  74 65 73 0d 0a c4 43 20  20 f2 73 68 65 6c 6c 5f  |tes...C  .shell_|
00014ed0  57 69 6e 64 6f 77 52 65  74 69 74 6c 65 28 5f 55  |WindowRetitle(_U|
00014ee0  25 21 32 32 38 2c a4 73  68 65 6c 6c 5f 4d 65 73  |%!228,.shell_Mes|
00014ef0  73 61 67 65 4e 6f 41 72  67 73 28 22 77 61 72 6e  |sageNoArgs("warn|
00014f00  69 6e 67 22 29 29 0d 0a  c5 32 20 20 f4 20 73 74  |ing"))...2  . st|
00014f10  69 6c 6c 20 6e 65 65 64  20 74 6f 20 73 65 74 20  |ill need to set |
00014f20  75 70 20 74 68 65 20 6d  65 73 73 61 67 65 20 74  |up the message t|
00014f30  68 6f 75 67 68 2e 2e 2e  0d 0a c6 48 20 20 f2 73  |hough......H  .s|
00014f40  68 65 6c 6c 5f 49 63 6f  6e 50 75 74 44 61 74 61  |hell_IconPutData|
00014f50  28 5f 55 25 21 32 32 38  2c 31 2c a4 73 68 65 6c  |(_U%!228,1,.shel|
00014f60  6c 5f 4d 65 73 73 61 67  65 4e 6f 41 72 67 73 28  |l_MessageNoArgs(|
00014f70  22 53 48 45 4c 4c 4d 53  47 30 37 22 29 2c 30 29  |"SHELLMSG07"),0)|
00014f80  0d 0a c7 08 20 20 ef 37  0d 0a c8 2c 20 20 c8 99  |....  .7...,  ..|
00014f90  20 22 57 69 6d 70 5f 43  72 65 61 74 65 53 75 62  | "Wimp_CreateSub|
00014fa0  4d 65 6e 75 22 2c 2c 5f  55 25 21 32 32 38 2c 78  |Menu",,_U%!228,x|
00014fb0  25 2c 79 25 0d 0a c9 05  7f 0d 0a ca 34 20 20 f4  |%,y%........4  .|
00014fc0  20 53 75 62 20 6d 65 6e  75 20 69 73 20 65 69 74  | Sub menu is eit|
00014fd0  68 65 72 20 61 20 64 69  61 6c 6f 67 20 62 6f 78  |her a dialog box|
00014fe0  2c 20 6f 72 20 61 20 6d  65 6e 75 21 21 0d 0a cb  |, or a menu!!...|
00014ff0  39 20 20 69 74 65 6d 5f  61 64 64 72 25 3d a4 73  |9  item_addr%=.s|
00015000  68 65 6c 6c 5f 4d 65 6e  75 47 65 74 49 74 65 6d  |hell_MenuGetItem|
00015010  41 64 64 72 65 73 73 28  5f 55 25 21 32 34 2c 5f  |Address(_U%!24,_|
00015020  51 25 2b 33 32 29 0d 0a  cc 2e 20 20 e7 20 a4 73  |Q%+32)....  . .s|
00015030  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 45 78  |hell_HeapBlockEx|
00015040  69 73 74 73 28 69 74 65  6d 5f 61 64 64 72 25 21  |ists(item_addr%!|
00015050  34 29 20 8c 0d 0a cd 1c  20 20 20 20 f4 20 44 42  |4) .....    . DB|
00015060  6f 78 20 69 73 20 61 74  74 61 63 68 65 64 2e 2e  |ox is attached..|
00015070  0d 0a ce 2d 20 20 20 20  f2 73 68 65 6c 6c 5f 4d  |...-    .shell_M|
00015080  65 6e 75 57 61 72 6e 44  42 6f 78 28 69 74 65 6d  |enuWarnDBox(item|
00015090  5f 61 64 64 72 25 2c 78  25 2c 79 25 29 0d 0a cf  |_addr%,x%,y%)...|
000150a0  07 20 20 cc 0d 0a d0 1c  20 20 20 20 f4 20 53 75  |.  .....    . Su|
000150b0  62 6d 65 6e 75 20 61 74  74 61 63 68 65 64 2e 2e  |bmenu attached..|
000150c0  0d 0a d1 26 20 20 20 20  62 6c 6b 25 3d a4 73 68  |...&    blk%=.sh|
000150d0  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
000150e0  63 68 28 33 32 29 0d 0a  d2 33 20 20 20 20 c8 99  |ch(32)...3    ..|
000150f0  20 22 4d 65 6e 75 55 74  69 6c 5f 44 65 63 6f 64  | "MenuUtil_Decod|
00015100  65 22 2c 5f 55 25 21 32  34 2c 5f 51 25 2b 33 32  |e",_U%!24,_Q%+32|
00015110  20 b8 20 2c 2c 62 6c 6b  25 0d 0a d3 39 20 20 20  | . ,,blk%...9   |
00015120  20 f2 73 68 65 6c 6c 5f  46 69 6e 64 4d 65 6e 75  | .shell_FindMenu|
00015130  57 61 72 6e 45 76 65 6e  74 28 62 6c 6b 25 21 38  |WarnEvent(blk%!8|
00015140  2c 77 61 72 6e 5f 66 6e  24 2c 73 65 6c 5f 66 6e  |,warn_fn$,sel_fn|
00015150  24 29 0d 0a d4 24 20 20  20 20 f2 73 68 65 6c 6c  |$)...$    .shell|
00015160  5f 48 65 61 70 42 6c 6f  63 6b 52 65 74 75 72 6e  |_HeapBlockReturn|
00015170  28 62 6c 6b 25 29 0d 0a  d5 3d 20 20 20 20 f2 73  |(blk%)...=    .s|
00015180  68 65 6c 6c 5f 4d 65 6e  75 57 61 72 6e 53 75 62  |hell_MenuWarnSub|
00015190  4d 65 6e 75 28 5f 51 25  21 32 30 2c 78 25 2c 79  |Menu(_Q%!20,x%,y|
000151a0  25 2c 77 61 72 6e 5f 66  6e 24 2c 73 65 6c 5f 66  |%,warn_fn$,sel_f|
000151b0  6e 24 29 0d 0a d6 07 20  20 cd 0d 0a d7 05 cb 0d  |n$)....  .......|
000151c0  0a d8 05 e1 0d 0a d9 05  3a 0d 0a da 20 2a 7c 53  |........:... *|S|
000151d0  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 4d 65  |top PROCshell_Me|
000151e0  6e 75 57 61 72 6e 69 6e  67 0d 0a db 04 0d 0a dc  |nuWarning.......|
000151f0  22 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |"*|Start PROCshe|
00015200  6c 6c 5f 4d 65 6e 75 57  61 72 6e 44 42 6f 78 0d  |ll_MenuWarnDBox.|
00015210  0a dd 26 dd 20 f2 73 68  65 6c 6c 5f 4d 65 6e 75  |..&. .shell_Menu|
00015220  57 61 72 6e 44 42 6f 78  28 61 64 64 72 25 2c 78  |WarnDBox(addr%,x|
00015230  25 2c 79 25 29 0d 0a de  14 ea 20 74 65 6d 70 25  |%,y%)..... temp%|
00015240  2c 68 25 2c 76 6f 69 64  25 0d 0a df 07 ea 20 85  |,h%,void%..... .|
00015250  0d 0a e0 0f ee 20 85 20  ea 3a f7 20 85 3a e1 0d  |..... . .:. .:..|
00015260  0a e1 11 74 65 6d 70 25  3d 61 64 64 72 25 21 34  |...temp%=addr%!4|
00015270  0d 0a e2 24 f2 73 68 65  6c 6c 5f 43 72 65 61 74  |...$.shell_Creat|
00015280  65 57 69 6e 64 6f 77 28  24 74 65 6d 70 25 21 30  |eWindow($temp%!0|
00015290  2c 68 25 29 0d 0a e3 07  f7 20 85 0d 0a e4 15 2a  |,h%)..... .....*|
000152a0  7c 69 66 64 65 66 20 54  72 61 63 65 49 6e 69 74  ||ifdef TraceInit|
000152b0  0d 0a e5 4f f2 73 68 65  6c 6c 5f 54 72 61 63 65  |...O.shell_Trace|
000152c0  66 30 28 22 4d 65 6e 75  57 61 72 6e 44 42 6f 78  |f0("MenuWarnDBox|
000152d0  3a 43 72 65 61 74 69 6e  67 20 6e 65 77 20 64 79  |:Creating new dy|
000152e0  6e 61 6d 69 63 20 64 62  6f 78 20 28 68 61 6e 64  |namic dbox (hand|
000152f0  6c 65 3d 26 22 2b c3 7e  68 25 2b 22 29 22 29 0d  |le=&"+.~h%+")").|
00015300  0a e6 0b 2a 7c 65 6e 64  69 66 0d 0a e7 14 e7 20  |...*|endif..... |
00015310  24 74 65 6d 70 25 21 34  3c 3e 22 22 20 8c 0d 0a  |$temp%!4<>"" ...|
00015320  e8 17 20 20 2a 7c 69 66  64 65 66 20 54 72 61 63  |..  *|ifdef Trac|
00015330  65 49 6e 69 74 0d 0a e9  46 20 20 f2 73 68 65 6c  |eInit...F  .shel|
00015340  6c 5f 54 72 61 63 65 66  30 28 22 4d 65 6e 75 57  |l_Tracef0("MenuW|
00015350  61 72 6e 44 42 6f 78 3a  43 61 6c 6c 69 6e 67 20  |arnDBox:Calling |
00015360  70 72 65 6f 70 65 6e 20  46 4e 20 27 22 2b 24 74  |preopen FN '"+$t|
00015370  65 6d 70 25 21 34 2b 22  27 22 29 0d 0a ea 0d 20  |emp%!4+"'").... |
00015380  20 2a 7c 65 6e 64 69 66  0d 0a eb 28 20 20 76 6f  | *|endif...(  vo|
00015390  69 64 25 3d a0 28 22 46  4e 22 2b 24 74 65 6d 70  |id%=.("FN"+$temp|
000153a0  25 21 34 2b 22 28 22 2b  c3 68 25 2b 22 29 22 29  |%!4+"("+.h%+")")|
000153b0  0d 0a ec 05 cd 0d 0a ed  14 e7 20 24 74 65 6d 70  |.......... $temp|
000153c0  25 21 38 3c 3e 22 22 20  8c 0d 0a ee 17 20 20 2a  |%!8<>"" .....  *|
000153d0  7c 69 66 64 65 66 20 54  72 61 63 65 49 6e 69 74  ||ifdef TraceInit|
000153e0  0d 0a ef 47 20 20 f2 73  68 65 6c 6c 5f 54 72 61  |...G  .shell_Tra|
000153f0  63 65 66 30 28 22 4d 65  6e 75 57 61 72 6e 44 42  |cef0("MenuWarnDB|
00015400  6f 78 3a 43 61 6c 6c 69  6e 67 20 70 6f 73 74 6f  |ox:Calling posto|
00015410  70 65 6e 20 46 4e 20 27  22 2b 24 74 65 6d 70 25  |pen FN '"+$temp%|
00015420  21 38 2b 22 27 22 29 0d  0a f0 0d 20 20 2a 7c 65  |!8+"'")....  *|e|
00015430  6e 64 69 66 0d 0a f1 28  20 20 76 6f 69 64 25 3d  |ndif...(  void%=|
00015440  a0 28 22 46 4e 22 2b 24  74 65 6d 70 25 21 38 2b  |.("FN"+$temp%!8+|
00015450  22 28 22 2b c3 68 25 2b  22 29 22 29 0d 0a f2 05  |"("+.h%+")")....|
00015460  cd 0d 0a f3 21 f4 20 68  25 20 69 73 20 6e 65 77  |....!. h% is new|
00015470  20 77 69 6e 64 6f 77 20  68 61 6e 64 6c 65 2e 2e  | window handle..|
00015480  2e 2e 0d 0a f4 25 c8 99  20 22 57 69 6d 70 5f 43  |.....%.. "Wimp_C|
00015490  72 65 61 74 65 53 75 62  4d 65 6e 75 22 2c 2c 68  |reateSubMenu",,h|
000154a0  25 2c 78 25 2c 79 25 0d  0a f5 0d 5f 55 25 21 32  |%,x%,y%...._U%!2|
000154b0  30 3d 68 25 0d 0a f6 05  e1 0d 0a f7 05 3a 0d 0a  |0=h%.........:..|
000154c0  f8 21 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |.!*|Stop PROCshe|
000154d0  6c 6c 5f 4d 65 6e 75 57  61 72 6e 44 42 6f 78 0d  |ll_MenuWarnDBox.|
000154e0  0a f9 04 0d 0a fa 27 2a  7c 53 74 61 72 74 20 50  |......'*|Start P|
000154f0  52 4f 43 73 68 65 6c 6c  5f 46 69 6e 64 4d 65 6e  |ROCshell_FindMen|
00015500  75 57 61 72 6e 45 76 65  6e 74 0d 0a fb 41 dd 20  |uWarnEvent...A. |
00015510  f2 73 68 65 6c 6c 5f 46  69 6e 64 4d 65 6e 75 57  |.shell_FindMenuW|
00015520  61 72 6e 45 76 65 6e 74  28 69 74 65 6d 5f 68 61  |arnEvent(item_ha|
00015530  6e 64 6c 65 25 2c f8 20  77 61 72 6e 5f 66 6e 24  |ndle%,. warn_fn$|
00015540  2c f8 20 73 65 6c 5f 66  6e 24 29 0d 0a fc 41 ea  |,. sel_fn$)...A.|
00015550  20 72 65 73 75 6c 74 25  2c 65 5f 6c 69 73 74 25  | result%,e_list%|
00015560  2c 74 65 6d 70 25 2c 6f  66 66 73 65 74 25 2c 66  |,temp%,offset%,f|
00015570  6f 75 6e 64 25 2c 6c 69  73 74 5f 73 69 7a 65 25  |ound%,list_size%|
00015580  2c 74 65 6d 70 32 25 2c  63 74 72 25 0d 0a fd 0e  |,temp2%,ctr%....|
00015590  ea 20 73 75 62 6d 65 6e  75 25 0d 0a fe 3b 73 75  |. submenu%...;su|
000155a0  62 6d 65 6e 75 25 3d 30  3a f4 20 49 66 20 73 74  |bmenu%=0:. If st|
000155b0  69 6c 6c 20 30 20 6f 6e  20 72 65 74 75 72 6e 20  |ill 0 on return |
000155c0  74 68 65 6e 20 6e 6f 20  65 76 65 6e 74 20 66 6f  |then no event fo|
000155d0  75 6e 64 2e 2e 0d 0a ff  3d 65 5f 6c 69 73 74 25  |und.....=e_list%|
000155e0  3d 5f 55 25 21 32 32 30  3a 6f 66 66 73 65 74 25  |=_U%!220:offset%|
000155f0  3d 30 3a 66 6f 75 6e 64  25 3d a3 3a 77 61 72 6e  |=0:found%=.:warn|
00015600  5f 66 6e 24 3d 22 22 3a  73 75 62 6d 65 6e 75 25  |_fn$="":submenu%|
00015610  3d 30 0d 0b 00 27 e7 20  a4 73 68 65 6c 6c 5f 48  |=0...'. .shell_H|
00015620  65 61 70 42 6c 6f 63 6b  45 78 69 73 74 73 28 65  |eapBlockExists(e|
00015630  5f 6c 69 73 74 25 29 20  8c 0d 0b 01 07 20 20 f5  |_list%) .....  .|
00015640  0d 0b 02 0f 20 20 20 20  63 74 72 25 2b 3d 34 0d  |....    ctr%+=4.|
00015650  0b 03 17 20 20 fd 20 65  5f 6c 69 73 74 25 21 63  |...  . e_list%!c|
00015660  74 72 25 3d 2d 31 0d 0b  04 1c 20 20 6c 69 73 74  |tr%=-1....  list|
00015670  5f 73 69 7a 65 25 3d 63  74 72 25 3a 63 74 72 25  |_size%=ctr%:ctr%|
00015680  3d 30 0d 0b 05 21 20 20  2a 7c 69 66 64 65 66 20  |=0...!  *|ifdef |
00015690  50 52 4f 43 73 68 65 6c  6c 5f 54 72 61 63 65 49  |PROCshell_TraceI|
000156a0  6e 69 74 0d 0b 06 41 20  20 f2 73 68 65 6c 6c 5f  |nit...A  .shell_|
000156b0  54 72 61 63 65 66 30 28  22 46 69 6e 64 4d 65 6e  |Tracef0("FindMen|
000156c0  75 57 61 72 6e 45 76 65  6e 74 3a 6c 69 73 74 5f  |uWarnEvent:list_|
000156d0  73 69 7a 65 25 3d 22 2b  c3 6c 69 73 74 5f 73 69  |size%="+.list_si|
000156e0  7a 65 25 29 0d 0b 07 0d  20 20 2a 7c 65 6e 64 69  |ze%)....  *|endi|
000156f0  66 0d 0b 08 07 20 20 f5  0d 0b 09 22 20 20 20 20  |f....  ...."    |
00015700  74 65 6d 70 25 3d 21 28  65 5f 6c 69 73 74 25 2b  |temp%=!(e_list%+|
00015710  6f 66 66 73 65 74 25 2b  30 29 0d 0b 0a 15 20 20  |offset%+0)....  |
00015720  20 20 e7 20 74 65 6d 70  25 3c 3e 2d 31 20 8c 0d  |  . temp%<>-1 ..|
00015730  0b 0b 20 20 20 20 20 20  20 e7 20 74 65 6d 70 25  |..       . temp%|
00015740  3d 69 74 65 6d 5f 68 61  6e 64 6c 65 25 20 8c 0d  |=item_handle% ..|
00015750  0b 0c 14 20 20 20 20 20  20 20 20 66 6f 75 6e 64  |...        found|
00015760  25 3d b9 0d 0b 0d 37 20  20 20 20 20 20 20 20 74  |%=....7        t|
00015770  65 6d 70 32 25 3d 65 5f  6c 69 73 74 25 21 28 6f  |emp2%=e_list%!(o|
00015780  66 66 73 65 74 25 2b 34  29 3a 77 61 72 6e 5f 66  |ffset%+4):warn_f|
00015790  6e 24 3d 24 74 65 6d 70  32 25 0d 0b 0e 28 20 20  |n$=$temp2%...(  |
000157a0  20 20 20 20 20 20 73 75  62 6d 65 6e 75 25 3d 65  |      submenu%=e|
000157b0  5f 6c 69 73 74 25 21 28  6f 66 66 73 65 74 25 2b  |_list%!(offset%+|
000157c0  38 29 0d 0b 0f 37 20 20  20 20 20 20 20 20 74 65  |8)...7        te|
000157d0  6d 70 32 25 3d 65 5f 6c  69 73 74 25 21 28 6f 66  |mp2%=e_list%!(of|
000157e0  66 73 65 74 25 2b 31 32  29 3a 73 65 6c 5f 66 6e  |fset%+12):sel_fn|
000157f0  24 3d 24 74 65 6d 70 32  25 0d 0b 10 21 20 20 2a  |$=$temp2%...!  *|
00015800  7c 69 66 64 65 66 20 50  52 4f 43 73 68 65 6c 6c  ||ifdef PROCshell|
00015810  5f 54 72 61 63 65 49 6e  69 74 0d 0b 11 37 20 20  |_TraceInit...7  |
00015820  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
00015830  46 69 6e 64 4d 65 6e 75  57 61 72 6e 45 76 65 6e  |FindMenuWarnEven|
00015840  74 3a 73 75 62 6d 65 6e  75 20 66 6f 75 6e 64 22  |t:submenu found"|
00015850  29 0d 0b 12 0d 20 20 2a  7c 65 6e 64 69 66 0d 0b  |)....  *|endif..|
00015860  13 0b 20 20 20 20 20 20  cd 0d 0b 14 15 20 20 20  |..      .....   |
00015870  20 20 20 6f 66 66 73 65  74 25 2b 3d 31 36 0d 0b  |   offset%+=16..|
00015880  15 09 20 20 20 20 cc 0d  0b 16 1c 20 20 20 20 20  |..    .....     |
00015890  20 6f 66 66 73 65 74 25  3d 6c 69 73 74 5f 73 69  | offset%=list_si|
000158a0  7a 65 25 0d 0b 17 09 20  20 20 20 cd 0d 0b 18 24  |ze%....    ....$|
000158b0  20 20 fd 20 66 6f 75 6e  64 25 20 84 20 6f 66 66  |  . found% . off|
000158c0  73 65 74 25 3e 3d 6c 69  73 74 5f 73 69 7a 65 25  |set%>=list_size%|
000158d0  0d 0b 19 05 cc 0d 0b 1a  1c 20 20 77 61 72 6e 5f  |.........  warn_|
000158e0  66 6e 24 3d 22 22 3a 73  65 6c 5f 66 6e 24 3d 22  |fn$="":sel_fn$="|
000158f0  22 0d 0b 1b 05 cd 0d 0b  1c 1f 2a 7c 69 66 64 65  |".........*|ifde|
00015900  66 20 50 52 4f 43 73 68  65 6c 6c 5f 54 72 61 63  |f PROCshell_Trac|
00015910  65 49 6e 69 74 0d 0b 1d  4a e7 20 73 75 62 6d 65  |eInit...J. subme|
00015920  6e 75 25 3d 30 20 8c 20  f2 73 68 65 6c 6c 5f 54  |nu%=0 . .shell_T|
00015930  72 61 63 65 66 30 28 22  46 69 6e 64 4d 65 6e 75  |racef0("FindMenu|
00015940  57 61 72 6e 45 76 65 6e  74 3a 77 61 72 6e 20 66  |WarnEvent:warn f|
00015950  6e 20 6e 6f 74 20 66 6f  75 6e 64 2e 2e 22 29 0d  |n not found..").|
00015960  0b 1e 0b 2a 7c 65 6e 64  69 66 0d 0b 1f 05 e1 0d  |...*|endif......|
00015970  0b 20 05 3a 0d 0b 21 26  2a 7c 53 74 6f 70 20 50  |. .:..!&*|Stop P|
00015980  52 4f 43 73 68 65 6c 6c  5f 46 69 6e 64 4d 65 6e  |ROCshell_FindMen|
00015990  75 57 61 72 6e 45 76 65  6e 74 0d 0b 22 04 0d 0b  |uWarnEvent.."...|
000159a0  23 25 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |#%*|Start PROCsh|
000159b0  65 6c 6c 5f 4d 65 6e 75  57 61 72 6e 53 75 62 4d  |ell_MenuWarnSubM|
000159c0  65 6e 75 0d 0b 24 3c dd  20 f2 73 68 65 6c 6c 5f  |enu..$<. .shell_|
000159d0  4d 65 6e 75 57 61 72 6e  53 75 62 4d 65 6e 75 28  |MenuWarnSubMenu(|
000159e0  73 5f 6d 65 6e 75 25 2c  78 25 2c 79 25 2c 77 61  |s_menu%,x%,y%,wa|
000159f0  72 6e 5f 66 6e 24 2c 73  65 6c 5f 66 6e 24 29 0d  |rn_fn$,sel_fn$).|
00015a00  0b 25 1e ea 20 76 6f 69  64 25 2c 74 65 6d 70 25  |.%.. void%,temp%|
00015a10  2c 66 5f 6d 65 6e 75 25  2c 63 74 72 25 0d 0b 26  |,f_menu%,ctr%..&|
00015a20  21 5f 73 68 65 6c 6c 5f  46 6f 6e 74 4d 65 6e 75  |!_shell_FontMenu|
00015a30  53 65 6c 46 4e 24 3d 73  65 6c 5f 66 6e 24 0d 0b  |SelFN$=sel_fn$..|
00015a40  27 47 e7 20 a4 73 68 65  6c 6c 5f 48 65 61 70 42  |'G. .shell_HeapB|
00015a50  6c 6f 63 6b 45 78 69 73  74 73 28 5f 55 25 21 32  |lockExists(_U%!2|
00015a60  32 34 29 20 8c 20 f2 73  68 65 6c 6c 5f 48 65 61  |24) . .shell_Hea|
00015a70  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 5f 55 25  |pBlockReturn(_U%|
00015a80  21 32 32 34 29 0d 0b 28  2e 5f 55 25 21 32 32 34  |!224)..(._U%!224|
00015a90  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
00015aa0  6b 46 65 74 63 68 28 a9  77 61 72 6e 5f 66 6e 24  |kFetch(.warn_fn$|
00015ab0  2b 31 29 0d 0b 29 21 74  65 6d 70 25 3d 5f 55 25  |+1)..)!temp%=_U%|
00015ac0  21 32 32 34 3a 24 74 65  6d 70 25 3d 77 61 72 6e  |!224:$temp%=warn|
00015ad0  5f 66 6e 24 0d 0b 2a 14  e7 20 77 61 72 6e 5f 66  |_fn$..*.. warn_f|
00015ae0  6e 24 3c 3e 22 22 20 8c  0d 0b 2b 2e 20 20 76 6f  |n$<>"" ...+.  vo|
00015af0  69 64 25 3d a0 28 22 46  4e 22 2b 77 61 72 6e 5f  |id%=.("FN"+warn_|
00015b00  66 6e 24 2b 22 28 5f 55  25 21 35 32 2c 5f 55 25  |fn$+"(_U%!52,_U%|
00015b10  21 35 36 29 22 29 0d 0b  2c 21 20 20 2a 7c 69 66  |!56)")..,!  *|if|
00015b20  64 65 66 20 50 52 4f 43  73 68 65 6c 6c 5f 54 72  |def PROCshell_Tr|
00015b30  61 63 65 49 6e 69 74 0d  0b 2d 3b 20 20 f2 73 68  |aceInit..-;  .sh|
00015b40  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 4d 65 6e  |ell_Tracef0("Men|
00015b50  75 57 61 72 6e 53 75 62  4d 65 6e 75 3a 43 61 6c  |uWarnSubMenu:Cal|
00015b60  6c 69 6e 67 20 46 4e 22  2b 77 61 72 6e 5f 66 6e  |ling FN"+warn_fn|
00015b70  24 29 0d 0b 2e 0d 20 20  2a 7c 65 6e 64 69 66 0d  |$)....  *|endif.|
00015b80  0b 2f 05 cd 0d 0b 30 1a  2a 7c 69 66 64 65 66 20  |./....0.*|ifdef |
00015b90  55 73 69 6e 67 5f 46 6f  6e 74 4d 65 6e 75 0d 0b  |Using_FontMenu..|
00015ba0  31 17 e7 20 73 5f 6d 65  6e 75 25 3d 5f 55 25 21  |1.. s_menu%=_U%!|
00015bb0  32 35 32 20 8c 0d 0b 32  22 20 20 f4 20 53 75 62  |252 ...2"  . Sub|
00015bc0  6d 65 6e 75 20 69 73 20  46 6f 6e 74 4d 65 6e 75  |menu is FontMenu|
00015bd0  20 6d 65 6e 75 2e 2e 0d  0b 33 21 20 20 2a 7c 69  | menu....3!  *|i|
00015be0  66 64 65 66 20 50 52 4f  43 73 68 65 6c 6c 5f 54  |fdef PROCshell_T|
00015bf0  72 61 63 65 49 6e 69 74  0d 0b 34 3a 20 20 f2 73  |raceInit..4:  .s|
00015c00  68 65 6c 6c 5f 54 72 61  63 65 66 30 28 22 4d 65  |hell_Tracef0("Me|
00015c10  6e 75 57 61 72 6e 53 75  62 4d 65 6e 75 3a 46 6f  |nuWarnSubMenu:Fo|
00015c20  6e 74 4d 65 6e 75 20 6f  70 65 6e 69 6e 67 2e 2e  |ntMenu opening..|
00015c30  22 29 0d 0b 35 0d 20 20  2a 7c 65 6e 64 69 66 0d  |")..5.  *|endif.|
00015c40  0b 36 49 20 20 e7 20 a4  73 68 65 6c 6c 5f 48 65  |.6I  . .shell_He|
00015c50  61 70 42 6c 6f 63 6b 45  78 69 73 74 73 28 5f 55  |apBlockExists(_U|
00015c60  25 21 32 35 36 29 20 8c  20 f2 73 68 65 6c 6c 5f  |%!256) . .shell_|
00015c70  48 65 61 70 42 6c 6f 63  6b 52 65 74 75 72 6e 28  |HeapBlockReturn(|
00015c80  5f 55 25 21 32 35 36 29  0d 0b 37 38 20 20 f4 20  |_U%!256)..78  . |
00015c90  53 74 6f 72 65 20 63 75  72 72 65 6e 74 20 6d 65  |Store current me|
00015ca0  6e 75 20 73 65 6c 65 63  74 69 6f 6e 20 66 6f 72  |nu selection for|
00015cb0  20 74 65 73 74 69 6e 67  20 6c 61 74 65 72 2e 2e  | testing later..|
00015cc0  0d 0b 38 3d 20 20 f4 20  46 69 72 73 74 20 77 6f  |..8=  . First wo|
00015cd0  72 6b 20 6f 75 74 20 68  6f 77 20 6d 61 6e 79 20  |rk out how many |
00015ce0  6c 65 76 65 6c 73 20 61  72 65 20 69 6e 20 74 68  |levels are in th|
00015cf0  65 20 73 65 6c 65 63 74  69 6f 6e 2e 2e 0d 0b 39  |e selection....9|
00015d00  32 20 20 63 74 72 25 3d  30 3a f5 3a 63 74 72 25  |2  ctr%=0:.:ctr%|
00015d10  2b 3d 34 3a fd 20 21 28  5f 51 25 2b 33 32 2b 63  |+=4:. !(_Q%+32+c|
00015d20  74 72 25 29 3d 2d 31 3a  63 74 72 25 2b 3d 34 0d  |tr%)=-1:ctr%+=4.|
00015d30  0b 3a 37 20 20 5f 55 25  21 32 35 36 3d a4 73 68  |.:7  _U%!256=.sh|
00015d40  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
00015d50  63 68 28 63 74 72 25 29  3a 74 65 6d 70 25 3d 5f  |ch(ctr%):temp%=_|
00015d60  55 25 21 32 35 36 0d 0b  3b 0c 20 20 63 74 72 25  |U%!256..;.  ctr%|
00015d70  3d 30 0d 0b 3c 07 20 20  f5 0d 0b 3d 21 20 20 20  |=0..<.  ...=!   |
00015d80  20 74 65 6d 70 25 21 63  74 72 25 3d 21 28 5f 51  | temp%!ctr%=!(_Q|
00015d90  25 2b 33 32 2b 63 74 72  25 29 0d 0b 3e 0f 20 20  |%+32+ctr%)..>.  |
00015da0  20 20 63 74 72 25 2b 3d  34 0d 0b 3f 19 20 20 fd  |  ctr%+=4..?.  .|
00015db0  20 21 28 5f 51 25 2b 33  32 2b 63 74 72 25 29 3d  | !(_Q%+32+ctr%)=|
00015dc0  2d 31 0d 0b 40 1f 20 20  74 65 6d 70 25 21 63 74  |-1..@.  temp%!ct|
00015dd0  72 25 3d 21 28 5f 51 25  2b 33 32 2b 63 74 72 25  |r%=!(_Q%+32+ctr%|
00015de0  29 0d 0b 41 13 20 20 74  65 6d 70 25 3d 5f 55 25  |)..A.  temp%=_U%|
00015df0  21 32 35 36 0d 0b 42 21  20 20 2a 7c 69 66 64 65  |!256..B!  *|ifde|
00015e00  66 20 50 52 4f 43 73 68  65 6c 6c 5f 54 72 61 63  |f PROCshell_Trac|
00015e10  65 49 6e 69 74 0d 0b 43  68 20 20 f2 73 68 65 6c  |eInit..Ch  .shel|
00015e20  6c 5f 54 72 61 63 65 66  30 28 22 4d 65 6e 75 57  |l_Tracef0("MenuW|
00015e30  61 72 6e 53 75 62 4d 65  6e 75 3a 53 65 6c 65 63  |arnSubMenu:Selec|
00015e40  74 69 6e 67 20 27 22 2b  a4 73 68 65 6c 6c 5f 46  |ting '"+.shell_F|
00015e50  6f 6e 74 4d 65 6e 75 47  65 74 4c 61 73 74 53 65  |ontMenuGetLastSe|
00015e60  6c 65 63 74 65 64 46 6f  6e 74 2b 22 27 20 69 6e  |lectedFont+"' in|
00015e70  20 46 6f 6e 74 4d 65 6e  75 2e 2e 22 29 0d 0b 44  | FontMenu..")..D|
00015e80  0d 20 20 2a 7c 65 6e 64  69 66 0d 0b 45 50 20 20  |.  *|endif..EP  |
00015e90  c8 99 20 22 46 6f 6e 74  4d 65 6e 75 5f 53 65 6c  |.. "FontMenu_Sel|
00015ea0  65 63 74 22 2c a4 73 68  65 6c 6c 5f 46 6f 6e 74  |ect",.shell_Font|
00015eb0  4d 65 6e 75 47 65 74 4c  61 73 74 53 65 6c 65 63  |MenuGetLastSelec|
00015ec0  74 65 64 46 6f 6e 74 2c  5f 55 25 21 32 36 30 20  |tedFont,_U%!260 |
00015ed0  b8 20 2c 66 5f 6d 65 6e  75 25 0d 0b 46 2b 20 20  |. ,f_menu%..F+  |
00015ee0  5f 55 25 21 32 36 34 3d  31 3a f4 20 53 65 74 20  |_U%!264=1:. Set |
00015ef0  27 46 6f 6e 74 4d 65 6e  75 4f 70 65 6e 27 20 66  |'FontMenuOpen' f|
00015f00  6c 61 67 2e 2e 0d 0b 47  1a 20 20 e7 20 66 5f 6d  |lag....G.  . f_m|
00015f10  65 6e 75 25 3c 3e 5f 55  25 21 32 35 32 20 8c 0d  |enu%<>_U%!252 ..|
00015f20  0b 48 24 20 20 20 20 f4  20 46 6f 6e 74 4d 65 6e  |.H$    . FontMen|
00015f30  75 20 70 74 72 20 68 61  73 20 63 68 61 6e 67 65  |u ptr has change|
00015f40  64 2e 2e 0d 0b 49 29 20  20 20 20 f2 73 68 65 6c  |d....I)    .shel|
00015f50  6c 5f 46 6f 6e 74 4d 65  6e 75 55 70 64 61 74 65  |l_FontMenuUpdate|
00015f60  50 74 72 28 66 5f 6d 65  6e 75 25 29 0d 0b 4a 27  |Ptr(f_menu%)..J'|
00015f70  20 20 20 20 5f 55 25 21  32 35 32 3d 66 5f 6d 65  |    _U%!252=f_me|
00015f80  6e 75 25 3a 73 5f 6d 65  6e 75 25 3d 66 5f 6d 65  |nu%:s_menu%=f_me|
00015f90  6e 75 25 0d 0b 4b 07 20  20 cd 0d 0b 4c 05 cc 0d  |nu%..K.  ...L...|
00015fa0  0b 4d 2d 20 20 5f 55 25  21 32 36 34 3d 30 3a f4  |.M-  _U%!264=0:.|
00015fb0  20 43 6c 65 61 72 20 27  46 6f 6e 74 4d 65 6e 75  | Clear 'FontMenu|
00015fc0  4f 70 65 6e 27 20 66 6c  61 67 2e 2e 0d 0b 4e 05  |Open' flag....N.|
00015fd0  cd 0d 0b 4f 0b 2a 7c 65  6e 64 69 66 0d 0b 50 2a  |...O.*|endif..P*|
00015fe0  c8 99 20 22 57 69 6d 70  5f 43 72 65 61 74 65 53  |.. "Wimp_CreateS|
00015ff0  75 62 4d 65 6e 75 22 2c  2c 73 5f 6d 65 6e 75 25  |ubMenu",,s_menu%|
00016000  2c 78 25 2c 79 25 0d 0b  51 05 e1 0d 0b 52 05 3a  |,x%,y%..Q....R.:|
00016010  0d 0b 53 24 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |..S$*|Stop PROCs|
00016020  68 65 6c 6c 5f 4d 65 6e  75 57 61 72 6e 53 75 62  |hell_MenuWarnSub|
00016030  4d 65 6e 75 0d 0b 54 04  0d 0b 55 23 2a 7c 53 74  |Menu..T...U#*|St|
00016040  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 41 74  |art PROCshell_At|
00016050  74 61 63 68 53 75 62 4d  65 6e 75 0d 0b 56 33 dd  |tachSubMenu..V3.|
00016060  20 f2 73 68 65 6c 6c 5f  41 74 74 61 63 68 53 75  | .shell_AttachSu|
00016070  62 4d 65 6e 75 28 69 74  65 6d 25 2c 73 75 62 6d  |bMenu(item%,subm|
00016080  65 6e 75 25 2c 77 61 72  6e 5f 66 6e 24 29 0d 0b  |enu%,warn_fn$)..|
00016090  57 28 c8 99 20 22 4d 65  6e 75 55 74 69 6c 5f 53  |W(.. "MenuUtil_S|
000160a0  75 62 4d 65 6e 75 22 2c  69 74 65 6d 25 2c 73 75  |ubMenu",item%,su|
000160b0  62 6d 65 6e 75 25 0d 0b  58 14 e7 20 77 61 72 6e  |bmenu%..X.. warn|
000160c0  5f 66 6e 24 3c 3e 22 22  20 8c 0d 0b 59 1e 20 20  |_fn$<>"" ...Y.  |
000160d0  c8 99 20 22 4d 65 6e 75  55 74 69 6c 5f 57 61 72  |.. "MenuUtil_War|
000160e0  6e 69 6e 67 22 2c 2c b9  0d 0b 5a 3a 20 20 f2 73  |ning",,...Z:  .s|
000160f0  68 65 6c 6c 5f 45 76 65  6e 74 4c 69 73 74 4d 65  |hell_EventListMe|
00016100  6e 75 57 61 72 6e 28 69  74 65 6d 25 2c 73 75 62  |nuWarn(item%,sub|
00016110  6d 65 6e 75 25 2c 77 61  72 6e 5f 66 6e 24 2c 22  |menu%,warn_fn$,"|
00016120  22 29 0d 0b 5b 05 cd 0d  0b 5c 05 e1 0d 0b 5d 05  |")..[....\....].|
00016130  3a 0d 0b 5e 22 2a 7c 53  74 6f 70 20 50 52 4f 43  |:..^"*|Stop PROC|
00016140  73 68 65 6c 6c 5f 41 74  74 61 63 68 53 75 62 4d  |shell_AttachSubM|
00016150  65 6e 75 0d 0b 5f 04 0d  0b 60 27 2a 7c 53 74 61  |enu.._...`'*|Sta|
00016160  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 45 76 65  |rt PROCshell_Eve|
00016170  6e 74 4c 69 73 74 4d 65  6e 75 57 61 72 6e 0d 0b  |ntListMenuWarn..|
00016180  61 43 dd 20 f2 73 68 65  6c 6c 5f 45 76 65 6e 74  |aC. .shell_Event|
00016190  4c 69 73 74 4d 65 6e 75  57 61 72 6e 28 69 74 65  |ListMenuWarn(ite|
000161a0  6d 25 2c 73 75 62 6d 65  6e 75 5f 70 74 72 25 2c  |m%,submenu_ptr%,|
000161b0  77 61 72 6e 5f 66 6e 24  2c 73 65 6c 5f 66 6e 24  |warn_fn$,sel_fn$|
000161c0  29 0d 0b 62 1f ea 20 74  65 6d 70 25 2c 74 65 6d  |)..b.. temp%,tem|
000161d0  70 32 25 2c 63 74 72 25  2c 65 5f 6c 69 73 74 25  |p2%,ctr%,e_list%|
000161e0  0d 0b 63 11 e7 20 5f 55  25 21 32 32 30 3d 30 20  |..c.. _U%!220=0 |
000161f0  8c 0d 0b 64 1b 20 20 f4  20 43 72 65 61 74 65 20  |...d.  . Create |
00016200  65 76 65 6e 74 20 6c 69  73 74 2e 2e 0d 0b 65 27  |event list....e'|
00016210  20 20 5f 55 25 21 32 32  30 3d a4 73 68 65 6c 6c  |  _U%!220=.shell|
00016220  5f 48 65 61 70 42 6c 6f  63 6b 46 65 74 63 68 28  |_HeapBlockFetch(|
00016230  33 32 29 0d 0b 66 13 20  20 74 65 6d 70 25 3d 5f  |32)..f.  temp%=_|
00016240  55 25 21 32 32 30 0d 0b  67 13 20 20 74 65 6d 70  |U%!220..g.  temp|
00016250  25 21 30 3d 69 74 65 6d  25 0d 0b 68 30 20 20 74  |%!0=item%..h0  t|
00016260  65 6d 70 25 21 34 3d a4  73 68 65 6c 6c 5f 48 65  |emp%!4=.shell_He|
00016270  61 70 42 6c 6f 63 6b 46  65 74 63 68 28 a9 77 61  |apBlockFetch(.wa|
00016280  72 6e 5f 66 6e 24 2b 31  29 0d 0b 69 19 20 20 24  |rn_fn$+1)..i.  $|
00016290  28 74 65 6d 70 25 21 34  29 3d 77 61 72 6e 5f 66  |(temp%!4)=warn_f|
000162a0  6e 24 0d 0b 6a 1a 20 20  74 65 6d 70 25 21 38 3d  |n$..j.  temp%!8=|
000162b0  73 75 62 6d 65 6e 75 5f  70 74 72 25 0d 0b 6b 30  |submenu_ptr%..k0|
000162c0  20 20 74 65 6d 70 25 21  31 32 3d a4 73 68 65 6c  |  temp%!12=.shel|
000162d0  6c 5f 48 65 61 70 42 6c  6f 63 6b 46 65 74 63 68  |l_HeapBlockFetch|
000162e0  28 a9 73 65 6c 5f 66 6e  24 2b 31 29 0d 0b 6c 19  |(.sel_fn$+1)..l.|
000162f0  20 20 24 28 74 65 6d 70  25 21 31 32 29 3d 73 65  |  $(temp%!12)=se|
00016300  6c 5f 66 6e 24 0d 0b 6d  35 20 20 74 65 6d 70 25  |l_fn$..m5  temp%|
00016310  21 31 36 3d 2d 31 3a 74  65 6d 70 25 21 32 30 3d  |!16=-1:temp%!20=|
00016320  2d 31 3a 74 65 6d 70 25  21 32 34 3d 2d 31 3a 74  |-1:temp%!24=-1:t|
00016330  65 6d 70 25 21 32 38 3d  2d 31 0d 0b 6e 05 cc 0d  |emp%!28=-1..n...|
00016340  0b 6f 24 20 20 f4 20 45  78 74 65 6e 64 20 65 78  |.o$  . Extend ex|
00016350  69 73 74 69 6e 67 20 65  76 65 6e 74 20 6c 69 73  |isting event lis|
00016360  74 2e 2e 0d 0b 70 30 20  20 65 5f 6c 69 73 74 25  |t....p0  e_list%|
00016370  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
00016380  6b 45 78 74 65 6e 64 28  5f 55 25 21 32 32 30 2c  |kExtend(_U%!220,|
00016390  33 32 29 0d 0b 71 1c 20  20 5f 55 25 21 32 32 30  |32)..q.  _U%!220|
000163a0  3d 65 5f 6c 69 73 74 25  3a 63 74 72 25 3d 30 0d  |=e_list%:ctr%=0.|
000163b0  0b 72 07 20 20 f5 0d 0b  73 10 20 20 20 20 63 74  |.r.  ...s.    ct|
000163c0  72 25 2b 3d 31 36 0d 0b  74 17 20 20 fd 20 65 5f  |r%+=16..t.  . e_|
000163d0  6c 69 73 74 25 21 63 74  72 25 3d 2d 31 0d 0b 75  |list%!ctr%=-1..u|
000163e0  13 20 20 74 65 6d 70 25  3d 5f 55 25 21 32 32 30  |.  temp%=_U%!220|
000163f0  0d 0b 76 16 20 20 74 65  6d 70 25 21 63 74 72 25  |..v.  temp%!ctr%|
00016400  3d 69 74 65 6d 25 0d 0b  77 37 20 20 74 65 6d 70  |=item%..w7  temp|
00016410  25 21 28 63 74 72 25 2b  34 29 3d a4 73 68 65 6c  |%!(ctr%+4)=.shel|
00016420  6c 5f 48 65 61 70 42 6c  6f 63 6b 46 65 74 63 68  |l_HeapBlockFetch|
00016430  28 a9 77 61 72 6e 5f 66  6e 24 2b 31 29 0d 0b 78  |(.warn_fn$+1)..x|
00016440  2e 20 20 74 65 6d 70 32  25 3d 74 65 6d 70 25 21  |.  temp2%=temp%!|
00016450  28 63 74 72 25 2b 34 29  3a 24 28 74 65 6d 70 32  |(ctr%+4):$(temp2|
00016460  25 29 3d 77 61 72 6e 5f  66 6e 24 0d 0b 79 21 20  |%)=warn_fn$..y! |
00016470  20 74 65 6d 70 25 21 28  63 74 72 25 2b 38 29 3d  | temp%!(ctr%+8)=|
00016480  73 75 62 6d 65 6e 75 5f  70 74 72 25 0d 0b 7a 37  |submenu_ptr%..z7|
00016490  20 20 74 65 6d 70 25 21  28 63 74 72 25 2b 31 32  |  temp%!(ctr%+12|
000164a0  29 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |)=.shell_HeapBlo|
000164b0  63 6b 46 65 74 63 68 28  a9 73 65 6c 5f 66 6e 24  |ckFetch(.sel_fn$|
000164c0  2b 31 29 0d 0b 7b 2e 20  20 74 65 6d 70 32 25 3d  |+1)..{.  temp2%=|
000164d0  74 65 6d 70 25 21 28 63  74 72 25 2b 31 32 29 3a  |temp%!(ctr%+12):|
000164e0  24 28 74 65 6d 70 32 25  29 3d 73 65 6c 5f 66 6e  |$(temp2%)=sel_fn|
000164f0  24 0d 0b 7c 3e 20 20 74  65 6d 70 25 21 28 63 74  |$..|>  temp%!(ct|
00016500  72 25 2b 31 36 29 3d 2d  31 3a 74 65 6d 70 25 21  |r%+16)=-1:temp%!|
00016510  28 63 74 72 25 2b 32 30  29 3d 2d 31 3a 74 65 6d  |(ctr%+20)=-1:tem|
00016520  70 25 21 28 63 74 72 25  2b 32 34 29 3d 2d 31 0d  |p%!(ctr%+24)=-1.|
00016530  0b 7d 18 20 20 74 65 6d  70 25 21 28 63 74 72 25  |.}.  temp%!(ctr%|
00016540  2b 32 38 29 3d 2d 31 0d  0b 7e 05 cd 0d 0b 7f 05  |+28)=-1..~......|
00016550  e1 0d 0b 80 05 3a 0d 0b  81 26 2a 7c 53 74 6f 70  |.....:...&*|Stop|
00016560  20 50 52 4f 43 73 68 65  6c 6c 5f 45 76 65 6e 74  | PROCshell_Event|
00016570  4c 69 73 74 4d 65 6e 75  57 61 72 6e 0d 0b 82 04  |ListMenuWarn....|
00016580  0d 0b 83 25 2a 7c 53 74  61 72 74 20 50 52 4f 43  |...%*|Start PROC|
00016590  73 68 65 6c 6c 5f 49 6e  74 65 72 61 63 74 69 76  |shell_Interactiv|
000165a0  65 48 65 6c 70 0d 0b 84  21 dd 20 f2 73 68 65 6c  |eHelp...!. .shel|
000165b0  6c 5f 49 6e 74 65 72 61  63 74 69 76 65 48 65 6c  |l_InteractiveHel|
000165c0  70 28 5f 51 25 29 0d 0b  85 2e ea 20 74 61 67 24  |p(_Q%)..... tag$|
000165d0  2c 6d 65 73 73 24 2c 76  61 6c 69 64 61 74 69 6f  |,mess$,validatio|
000165e0  6e 24 2c 70 6f 73 31 25  2c 70 6f 73 32 25 2c 68  |n$,pos1%,pos2%,h|
000165f0  65 6c 70 24 0d 0b 86 30  74 61 67 24 3d a4 73 68  |elp$...0tag$=.sh|
00016600  65 6c 6c 5f 47 65 74 45  76 65 6e 74 48 61 6e 64  |ell_GetEventHand|
00016610  6c 65 72 28 5f 51 25 21  33 32 2c 5f 51 25 21 33  |ler(_Q%!32,_Q%!3|
00016620  36 2c 38 29 0d 0b 87 42  f4 20 63 68 65 63 6b 20  |6,8)...B. check |
00016630  76 61 6c 69 64 61 74 69  6f 6e 20 73 74 72 69 6e  |validation strin|
00016640  67 20 2d 20 74 68 69 73  20 6f 76 65 72 72 69 64  |g - this overrid|
00016650  65 73 20 61 74 74 61 63  68 65 64 20 68 65 6c 70  |es attached help|
00016660  20 74 61 67 73 21 0d 0b  88 37 76 61 6c 69 64 61  | tags!...7valida|
00016670  74 69 6f 6e 24 3d a4 73  68 65 6c 6c 5f 49 63 6f  |tion$=.shell_Ico|
00016680  6e 47 65 74 56 61 6c 69  64 61 74 69 6f 6e 28 5f  |nGetValidation(_|
00016690  51 25 21 33 32 2c 5f 51  25 21 33 36 29 0d 0b 89  |Q%!32,_Q%!36)...|
000166a0  17 e7 20 76 61 6c 69 64  61 74 69 6f 6e 24 3c 3e  |.. validation$<>|
000166b0  22 22 20 8c 0d 0b 8a 35  20 20 e7 20 a4 73 68 65  |"" ....5  . .she|
000166c0  6c 6c 5f 53 74 72 69 6e  67 55 70 70 65 72 43 61  |ll_StringUpperCa|
000166d0  73 65 28 c0 76 61 6c 69  64 61 74 69 6f 6e 24 2c  |se(.validation$,|
000166e0  31 29 29 3d 22 49 22 20  8c 0d 0b 8b 1f 20 20 20  |1))="I" .....   |
000166f0  20 70 6f 73 31 25 3d a7  76 61 6c 69 64 61 74 69  | pos1%=.validati|
00016700  6f 6e 24 2c 22 3b 22 29  0d 0b 8c 1d 20 20 20 20  |on$,";")....    |
00016710  f4 20 69 20 69 73 20 66  69 72 73 74 20 6d 6f 64  |. i is first mod|
00016720  69 66 69 65 72 0d 0b 8d  13 20 20 20 20 e7 20 70  |ifier....    . p|
00016730  6f 73 31 25 3d 30 20 8c  0d 0b 8e 1e 20 20 20 20  |os1%=0 .....    |
00016740  20 20 74 61 67 24 3d c1  76 61 6c 69 64 61 74 69  |  tag$=.validati|
00016750  6f 6e 24 2c 32 29 0d 0b  8f 09 20 20 20 20 cc 0d  |on$,2)....    ..|
00016760  0b 90 26 20 20 20 20 20  20 74 61 67 24 3d c1 76  |..&      tag$=.v|
00016770  61 6c 69 64 61 74 69 6f  6e 24 2c 32 2c 70 6f 73  |alidation$,2,pos|
00016780  31 25 2d 32 29 0d 0b 91  09 20 20 20 20 cd 0d 0b  |1%-2)....    ...|
00016790  92 07 20 20 cc 0d 0b 93  50 20 20 20 20 70 6f 73  |..  ....P    pos|
000167a0  31 25 3d a7 a4 73 68 65  6c 6c 5f 53 74 72 69 6e  |1%=..shell_Strin|
000167b0  67 55 70 70 65 72 43 61  73 65 28 76 61 6c 69 64  |gUpperCase(valid|
000167c0  61 74 69 6f 6e 24 29 2c  a4 73 68 65 6c 6c 5f 53  |ation$),.shell_S|
000167d0  74 72 69 6e 67 55 70 70  65 72 43 61 73 65 28 22  |tringUpperCase("|
000167e0  3b 69 22 29 29 0d 0b 94  57 20 20 20 20 70 6f 73  |;i"))...W    pos|
000167f0  32 25 3d a7 a4 73 68 65  6c 6c 5f 53 74 72 69 6e  |2%=..shell_Strin|
00016800  67 55 70 70 65 72 43 61  73 65 28 76 61 6c 69 64  |gUpperCase(valid|
00016810  61 74 69 6f 6e 24 29 2c  a4 73 68 65 6c 6c 5f 53  |ation$),.shell_S|
00016820  74 72 69 6e 67 55 70 70  65 72 43 61 73 65 28 22  |tringUpperCase("|
00016830  3b 22 29 2c 70 6f 73 31  25 2b 31 29 0d 0b 95 13  |;"),pos1%+1)....|
00016840  20 20 20 20 e7 20 70 6f  73 31 25 3e 30 20 8c 0d  |    . pos1%>0 ..|
00016850  0b 96 15 20 20 20 20 20  20 e7 20 70 6f 73 32 25  |...      . pos2%|
00016860  3e 30 20 8c 0d 0b 97 34  20 20 20 20 20 20 20 20  |>0 ....4        |
00016870  74 61 67 24 3d c1 76 61  6c 69 64 61 74 69 6f 6e  |tag$=.validation|
00016880  24 2c 70 6f 73 31 25 2b  32 2c 70 6f 73 32 25 2d  |$,pos1%+2,pos2%-|
00016890  70 6f 73 31 25 2d 32 29  0d 0b 98 0b 20 20 20 20  |pos1%-2)....    |
000168a0  20 20 cc 0d 0b 99 26 20  20 20 20 20 20 20 20 74  |  ....&        t|
000168b0  61 67 24 3d c1 76 61 6c  69 64 61 74 69 6f 6e 24  |ag$=.validation$|
000168c0  2c 70 6f 73 31 25 2b 32  29 0d 0b 9a 0b 20 20 20  |,pos1%+2)....   |
000168d0  20 20 20 cd 0d 0b 9b 09  20 20 20 20 cd 0d 0b 9c  |   .....    ....|
000168e0  07 20 20 cd 0d 0b 9d 05  cd 0d 0b 9e 10 e7 20 74  |.  ........... t|
000168f0  61 67 24 3c 3e 22 22 20  8c 0d 0b 9f 1e 20 20 5f  |ag$<>"" .....  _|
00016900  51 25 21 31 36 3d 26 35  30 33 3a 5f 51 25 21 31  |Q%!16=&503:_Q%!1|
00016910  32 3d 5f 51 25 21 38 0d  0b a0 2c 20 20 6d 65 73  |2=_Q%!8...,  mes|
00016920  73 24 3d a4 73 68 65 6c  6c 5f 4d 65 73 73 61 67  |s$=.shell_Messag|
00016930  65 4c 6f 6f 6b 75 70 28  74 61 67 24 2c 22 22 2c  |eLookup(tag$,"",|
00016940  22 22 29 0d 0b a1 27 20  20 6d 65 73 73 24 3d a4  |"")...'  mess$=.|
00016950  73 68 65 6c 6c 5f 4d 65  73 73 61 67 65 45 78 70  |shell_MessageExp|
00016960  61 6e 64 28 6d 65 73 73  24 29 0d 0b a2 15 20 20  |and(mess$)....  |
00016970  24 28 5f 51 25 2b 32 30  29 3d 6d 65 73 73 24 0d  |$(_Q%+20)=mess$.|
00016980  0b a3 1c 20 20 21 5f 51  25 3d 28 a9 6d 65 73 73  |...  !_Q%=(.mess|
00016990  24 2b 32 35 29 20 80 20  ac 20 33 0d 0b a4 28 20  |$+25) . . 3...( |
000169a0  20 c8 99 20 22 57 69 6d  70 5f 53 65 6e 64 4d 65  | .. "Wimp_SendMe|
000169b0  73 73 61 67 65 22 2c 31  37 2c 5f 51 25 2c 5f 51  |ssage",17,_Q%,_Q|
000169c0  25 21 34 0d 0b a5 05 cd  0d 0b a6 05 e1 0d 0b a7  |%!4.............|
000169d0  05 3a 0d 0b a8 24 2a 7c  53 74 6f 70 20 50 52 4f  |.:...$*|Stop PRO|
000169e0  43 73 68 65 6c 6c 5f 49  6e 74 65 72 61 63 74 69  |Cshell_Interacti|
000169f0  76 65 48 65 6c 70 0d 0b  a9 13 2a 7c 53 74 61 72  |veHelp....*|Star|
00016a00  74 20 50 52 4f 43 61 63  6b 0d 0b aa 0a dd 20 f2  |t PROCack..... .|
00016a10  61 63 6b 0d 0b ab 05 e1  0d 0b ac 05 3a 0d 0b ad  |ack.........:...|
00016a20  12 2a 7c 53 74 6f 70 20  50 52 4f 43 61 63 6b 0d  |.*|Stop PROCack.|
00016a30  0b ae 04 0d 0b af 25 2a  7c 53 74 61 72 74 20 50  |......%*|Start P|
00016a40  52 4f 43 73 68 65 6c 6c  5f 4d 65 73 73 61 67 65  |ROCshell_Message|
00016a50  5f 50 72 65 51 75 69 74  0d 0b b0 21 dd 20 f2 73  |_PreQuit...!. .s|
00016a60  68 65 6c 6c 5f 4d 65 73  73 61 67 65 5f 50 72 65  |hell_Message_Pre|
00016a70  51 75 69 74 28 5f 51 25  29 0d 0b b1 2c ea 20 74  |Quit(_Q%)...,. t|
00016a80  65 6d 70 25 2c 71 75 69  74 73 65 6e 64 65 72 25  |emp%,quitsender%|
00016a90  2c 62 6c 6b 25 2c 6c 6f  6f 70 25 2c 66 6c 61 67  |,blk%,loop%,flag|
00016aa0  77 6f 72 64 25 0d 0b b2  11 e7 20 5f 55 25 21 33  |word%..... _U%!3|
00016ab0  30 30 3e 30 20 8c 0d 0b  b3 25 20 20 62 6c 6b 25  |00>0 ....%  blk%|
00016ac0  3d a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |=.shell_HeapBloc|
00016ad0  6b 46 65 74 63 68 28 32  35 36 29 0d 0b b4 2c 20  |kFetch(256)..., |
00016ae0  20 f4 20 63 6f 70 79 20  6d 65 73 73 61 67 65 20  | . copy message |
00016af0  62 6c 6f 63 6b 20 74 6f  20 70 72 69 76 61 74 65  |block to private|
00016b00  20 61 72 65 61 2e 2e 0d  0b b5 33 20 20 e3 20 6c  | area.....3  . l|
00016b10  6f 6f 70 25 3d 30 20 b8  20 5f 51 25 21 30 20 88  |oop%=0 . _Q%!0 .|
00016b20  20 34 3a f4 20 66 69 72  73 74 20 77 6f 72 64 20  | 4:. first word |
00016b30  69 73 20 73 69 7a 65 2e  2e 2e 0d 0b b6 1c 20 20  |is size.......  |
00016b40  20 20 62 6c 6b 25 21 6c  6f 6f 70 25 3d 5f 51 25  |  blk%!loop%=_Q%|
00016b50  21 6c 6f 6f 70 25 0d 0b  b7 0d 20 20 ed 20 6c 6f  |!loop%....  . lo|
00016b60  6f 70 25 0d 0b b8 17 20  20 2a 7c 69 66 64 65 66  |op%....  *|ifdef|
00016b70  20 54 72 61 63 65 49 6e  69 74 0d 0b b9 40 20 20  | TraceInit...@  |
00016b80  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
00016b90  4d 65 73 73 61 67 65 5f  50 72 65 51 75 69 74 3a  |Message_PreQuit:|
00016ba0  50 72 65 51 75 69 74 20  6d 65 73 73 61 67 65 20  |PreQuit message |
00016bb0  72 65 63 65 69 76 65 64  22 29 0d 0b ba 0d 20 20  |received")....  |
00016bc0  2a 7c 65 6e 64 69 66 0d  0b bb 13 20 20 74 65 6d  |*|endif....  tem|
00016bd0  70 25 3d 5f 55 25 21 33  30 30 0d 0b bc 18 20 20  |p%=_U%!300....  |
00016be0  71 75 69 74 73 65 6e 64  65 72 25 3d 62 6c 6b 25  |quitsender%=blk%|
00016bf0  21 34 0d 0b bd 32 20 20  e7 20 21 62 6c 6b 25 3c  |!4...2  . !blk%<|
00016c00  32 34 20 8c 20 66 6c 61  67 77 6f 72 64 25 3d 30  |24 . flagword%=0|
00016c10  20 8b 20 66 6c 61 67 77  6f 72 64 25 3d 62 6c 6b  | . flagword%=blk|
00016c20  25 21 32 30 0d 0b be 34  20 20 f4 20 61 63 6b 6e  |%!20...4  . ackn|
00016c30  6f 77 6c 65 64 67 65 20  6d 65 73 73 61 67 65 20  |owledge message |
00016c40  2d 20 74 68 69 73 20 61  62 6f 72 74 73 20 73 68  |- this aborts sh|
00016c50  75 74 64 6f 77 6e 2e 2e  0d 0b bf 3e 20 20 62 6c  |utdown.....>  bl|
00016c60  6b 25 21 31 32 3d 62 6c  6b 25 21 38 3a c8 99 20  |k%!12=blk%!8:.. |
00016c70  22 57 69 6d 70 5f 53 65  6e 64 4d 65 73 73 61 67  |"Wimp_SendMessag|
00016c80  65 22 2c 31 39 2c 62 6c  6b 25 2c 71 75 69 74 73  |e",19,blk%,quits|
00016c90  65 6e 64 65 72 25 0d 0b  c0 1b 20 20 e7 20 a0 28  |ender%....  . .(|
00016ca0  22 46 4e 22 2b 24 74 65  6d 70 25 29 3c 3e 30 20  |"FN"+$temp%)<>0 |
00016cb0  8c 0d 0b c1 16 20 20 20  20 f4 20 6f 6b 20 74 6f  |.....    . ok to|
00016cc0  20 71 75 69 74 2e 2e 0d  0b c2 19 20 20 20 20 e7  | quit......    .|
00016cd0  20 66 6c 61 67 77 6f 72  64 25 20 80 20 31 20 8c  | flagword% . 1 .|
00016ce0  0d 0b c3 21 20 20 20 20  20 20 f4 20 71 75 69 74  |...!      . quit|
00016cf0  20 6a 75 73 74 20 74 68  69 73 20 74 61 73 6b 2e  | just this task.|
00016d00  2e 0d 0b c4 17 20 20 20  20 20 20 5f 63 6c 6f 73  |.....      _clos|
00016d10  65 64 6f 77 6e 25 3d b9  0d 0b c5 09 20 20 20 20  |edown%=.....    |
00016d20  cc 0d 0b c6 1e 20 20 20  20 20 20 f4 20 73 68 75  |.....      . shu|
00016d30  74 64 6f 77 6e 20 64 65  73 6b 74 6f 70 2e 2e 0d  |tdown desktop...|
00016d40  0b c7 1f 20 20 20 20 20  20 21 62 6c 6b 25 3d 32  |...      !blk%=2|
00016d50  34 3a 62 6c 6b 25 21 32  34 3d 26 31 46 43 0d 0b  |4:blk%!24=&1FC..|
00016d60  c8 32 20 20 20 20 20 20  c8 99 20 22 57 69 6d 70  |.2      .. "Wimp|
00016d70  5f 53 65 6e 64 4d 65 73  73 61 67 65 22 2c 38 2c  |_SendMessage",8,|
00016d80  62 6c 6b 25 2c 71 75 69  74 73 65 6e 64 65 72 25  |blk%,quitsender%|
00016d90  0d 0b c9 17 20 20 20 20  20 20 5f 63 6c 6f 73 65  |....      _close|
00016da0  64 6f 77 6e 25 3d b9 0d  0b ca 09 20 20 20 20 cd  |down%=.....    .|
00016db0  0d 0b cb 07 20 20 cd 0d  0b cc 22 20 20 f2 73 68  |....  ...."  .sh|
00016dc0  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 52 65 74  |ell_HeapBlockRet|
00016dd0  75 72 6e 28 62 6c 6b 25  29 0d 0b cd 05 cd 0d 0b  |urn(blk%).......|
00016de0  ce 05 e1 0d 0b cf 05 3a  0d 0b d0 24 2a 7c 53 74  |.......:...$*|St|
00016df0  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 4d 65 73  |op PROCshell_Mes|
00016e00  73 61 67 65 5f 50 72 65  51 75 69 74 0d 0b d1 04  |sage_PreQuit....|
00016e10  0d 0b d2 19 2a 7c 53 74  61 72 74 20 50 52 4f 43  |....*|Start PROC|
00016e20  6c 77 61 6f 72 69 67 69  6e 0d 0b d3 1d dd 20 f2  |lwaorigin..... .|
00016e30  6c 77 61 6f 72 69 67 69  6e 28 62 2c f8 20 78 25  |lwaorigin(b,. x%|
00016e40  2c f8 20 79 25 29 0d 0b  d4 1c 78 25 3d 62 21 30  |,. y%)....x%=b!0|
00016e50  2d 62 21 31 36 3a 79 25  3d 62 21 31 32 2d 62 21  |-b!16:y%=b!12-b!|
00016e60  32 30 0d 0b d5 05 e1 0d  0b d6 05 3a 0d 0b d7 18  |20.........:....|
00016e70  2a 7c 53 74 6f 70 20 50  52 4f 43 6c 77 61 6f 72  |*|Stop PROClwaor|
00016e80  69 67 69 6e 0d 0b d8 04  0d 0b d9 1b 2a 7c 53 74  |igin........*|St|
00016e90  61 72 74 20 46 4e 73 68  65 6c 6c 5f 49 63 6f 6e  |art FNshell_Icon|
00016ea0  62 61 72 0d 0b da 42 dd  20 a4 73 68 65 6c 6c 5f  |bar...B. .shell_|
00016eb0  49 63 6f 6e 62 61 72 28  70 6f 73 25 2c 73 6e 61  |Iconbar(pos%,sna|
00016ec0  6d 65 24 2c 74 65 78 74  24 2c 77 25 2c 6d 65 6e  |me$,text$,w%,men|
00016ed0  75 25 2c 73 68 69 66 74  25 2c 63 74 72 6c 25 2c  |u%,shift%,ctrl%,|
00016ee0  61 6c 74 25 29 0d 0b db  0d ea 20 68 61 6e 64 6c  |alt%)..... handl|
00016ef0  65 25 0d 0b dc 10 e7 20  74 65 78 74 24 3d 22 22  |e%..... text$=""|
00016f00  20 8c 0d 0b dd 51 20 20  21 5f 51 25 3d 70 6f 73  | ....Q  !_Q%=pos|
00016f10  25 3a 5f 51 25 21 34 3d  30 3a 5f 51 25 21 38 3d  |%:_Q%!4=0:_Q%!8=|
00016f20  30 3a 5f 51 25 21 31 32  3d 37 30 3a 5f 51 25 21  |0:_Q%!12=70:_Q%!|
00016f30  31 36 3d 37 30 3a 5f 51  25 21 32 30 3d 26 33 30  |16=70:_Q%!20=&30|
00016f40  31 41 3a 24 28 5f 51 25  2b 32 34 29 3d 73 6e 61  |1A:$(_Q%+24)=sna|
00016f50  6d 65 24 0d 0b de 05 cc  0d 0b df 46 20 20 21 5f  |me$........F  !_|
00016f60  51 25 3d 70 6f 73 25 3a  5f 51 25 21 34 3d 30 3a  |Q%=pos%:_Q%!4=0:|
00016f70  5f 51 25 21 38 3d 2d 31  36 3a 5f 51 25 21 31 32  |_Q%!8=-16:_Q%!12|
00016f80  3d 77 25 3a 5f 51 25 21  31 36 3d 39 30 3a 5f 51  |=w%:_Q%!16=90:_Q|
00016f90  25 21 32 30 3d 26 31 37  30 30 32 31 30 42 0d 0b  |%!20=&1700210B..|
00016fa0  e0 11 20 20 de 20 5f 51  25 21 32 34 20 31 32 0d  |..  . _Q%!24 12.|
00016fb0  0b e1 1a 20 20 de 20 5f  51 25 21 32 38 20 a9 28  |...  . _Q%!28 .(|
00016fc0  73 6e 61 6d 65 24 29 2b  32 0d 0b e2 15 20 20 24  |sname$)+2....  $|
00016fd0  28 5f 51 25 21 32 34 29  3d 74 65 78 74 24 0d 0b  |(_Q%!24)=text$..|
00016fe0  e3 1a 20 20 24 28 5f 51  25 21 32 38 29 3d 22 53  |..  $(_Q%!28)="S|
00016ff0  22 2b 73 6e 61 6d 65 24  0d 0b e4 0f 20 20 5f 51  |"+sname$....  _Q|
00017000  25 21 33 32 3d 31 32 0d  0b e5 05 cd 0d 0b e6 27  |%!32=12........'|
00017010  c8 99 20 22 57 69 6d 70  5f 43 72 65 61 74 65 49  |.. "Wimp_CreateI|
00017020  63 6f 6e 22 2c 2c 5f 51  25 20 b8 20 68 61 6e 64  |con",,_Q% . hand|
00017030  6c 65 25 0d 0b e7 39 f2  73 68 65 6c 6c 5f 41 74  |le%...9.shell_At|
00017040  74 61 63 68 4d 65 6e 75  28 2d 32 2c 68 61 6e 64  |tachMenu(-2,hand|
00017050  6c 65 25 2c 6d 65 6e 75  25 2c 73 68 69 66 74 25  |le%,menu%,shift%|
00017060  2c 63 74 72 6c 25 2c 61  6c 74 25 29 0d 0b e8 0c  |,ctrl%,alt%)....|
00017070  3d 68 61 6e 64 6c 65 25  0d 0b e9 05 3a 0d 0b ea  |=handle%....:...|
00017080  1a 2a 7c 53 74 6f 70 20  46 4e 73 68 65 6c 6c 5f  |.*|Stop FNshell_|
00017090  49 63 6f 6e 62 61 72 0d  0b eb 04 0d 0b ec 24 2a  |Iconbar.......$*|
000170a0  7c 53 74 61 72 74 20 50  52 4f 43 73 68 65 6c 6c  ||Start PROCshell|
000170b0  5f 49 63 6f 6e 62 61 72  53 65 74 54 65 78 74 0d  |_IconbarSetText.|
000170c0  0b ed 26 dd 20 f2 73 68  65 6c 6c 5f 49 63 6f 6e  |..&. .shell_Icon|
000170d0  62 61 72 53 65 74 54 65  78 74 28 68 25 2c 69 6e  |barSetText(h%,in|
000170e0  25 2c 73 24 29 0d 0b ee  0f ea 20 69 63 6f 6e 5f  |%,s$)..... icon_|
000170f0  62 6c 6b 25 0d 0b ef 27  69 63 6f 6e 5f 62 6c 6b  |blk%...'icon_blk|
00017100  25 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |%=.shell_HeapBlo|
00017110  63 6b 46 65 74 63 68 28  34 30 29 0d 0b f0 21 21  |ckFetch(40)...!!|
00017120  69 63 6f 6e 5f 62 6c 6b  25 3d 68 25 3a 69 63 6f  |icon_blk%=h%:ico|
00017130  6e 5f 62 6c 6b 25 21 34  3d 69 6e 25 0d 0b f1 25  |n_blk%!4=in%...%|
00017140  c8 99 20 22 57 69 6d 70  5f 47 65 74 49 63 6f 6e  |.. "Wimp_GetIcon|
00017150  53 74 61 74 65 22 2c 2c  69 63 6f 6e 5f 62 6c 6b  |State",,icon_blk|
00017160  25 0d 0b f2 16 24 28 69  63 6f 6e 5f 62 6c 6b 25  |%....$(icon_blk%|
00017170  21 32 38 29 3d 73 24 0d  0b f3 57 c8 99 20 22 57  |!28)=s$...W.. "W|
00017180  69 6d 70 5f 46 6f 72 63  65 52 65 64 72 61 77 22  |imp_ForceRedraw"|
00017190  2c 2d 31 2c 69 63 6f 6e  5f 62 6c 6b 25 21 38 2d  |,-1,icon_blk%!8-|
000171a0  32 30 30 2c 69 63 6f 6e  5f 62 6c 6b 25 21 31 32  |200,icon_blk%!12|
000171b0  2c 69 63 6f 6e 5f 62 6c  6b 25 21 31 36 2b 32 30  |,icon_blk%!16+20|
000171c0  30 2c 69 63 6f 6e 5f 62  6c 6b 25 21 32 30 0d 0b  |0,icon_blk%!20..|
000171d0  f4 25 f2 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |.%.shell_HeapBlo|
000171e0  63 6b 52 65 74 75 72 6e  28 69 63 6f 6e 5f 62 6c  |ckReturn(icon_bl|
000171f0  6b 25 29 0d 0b f5 05 e1  0d 0b f6 05 3a 0d 0b f7  |k%).........:...|
00017200  23 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  |#*|Stop PROCshel|
00017210  6c 5f 49 63 6f 6e 62 61  72 53 65 74 54 65 78 74  |l_IconbarSetText|
00017220  0d 0b f8 04 0d 0b f9 28  2a 7c 53 74 61 72 74 20  |.......(*|Start |
00017230  46 4e 73 68 65 6c 6c 5f  57 72 69 74 65 61 62 6c  |FNshell_Writeabl|
00017240  65 49 63 6f 6e 48 61 6e  64 6c 65 72 0d 0b fa 2f  |eIconHandler.../|
00017250  dd 20 a4 73 68 65 6c 6c  5f 57 72 69 74 65 61 62  |. .shell_Writeab|
00017260  6c 65 49 63 6f 6e 48 61  6e 64 6c 65 72 28 77 68  |leIconHandler(wh|
00017270  25 2c 69 68 25 2c 6b 65  79 25 29 0d 0b fb 2d ea  |%,ih%,key%)...-.|
00017280  20 6e 72 5f 69 63 6f 6e  73 25 2c 66 69 72 73 74  | nr_icons%,first|
00017290  5f 77 72 69 74 65 25 2c  6c 61 73 74 5f 77 72 69  |_write%,last_wri|
000172a0  74 65 25 2c 63 74 72 25  0d 0b fc 38 ea 20 62 65  |te%,ctr%...8. be|
000172b0  66 6f 72 65 25 2c 61 66  74 65 72 25 2c 69 6e 64  |fore%,after%,ind|
000172c0  65 78 25 2c 6d 78 25 2c  6d 79 25 2c 74 65 6d 70  |ex%,mx%,my%,temp|
000172d0  5f 62 6c 6b 25 2c 63 61  72 65 74 5f 62 6c 6b 25  |_blk%,caret_blk%|
000172e0  0d 0b fd 28 63 61 72 65  74 5f 62 6c 6b 25 3d a4  |...(caret_blk%=.|
000172f0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
00017300  65 74 63 68 28 32 34 29  0d 0b fe 2a c8 99 20 22  |etch(24)...*.. "|
00017310  57 69 6d 70 5f 47 65 74  43 61 72 65 74 50 6f 73  |Wimp_GetCaretPos|
00017320  69 74 69 6f 6e 22 2c 2c  63 61 72 65 74 5f 62 6c  |ition",,caret_bl|
00017330  6b 25 0d 0b ff 17 e7 20  63 61 72 65 74 5f 62 6c  |k%..... caret_bl|
00017340  6b 25 21 30 3d 2d 31 20  8c 0d 0c 00 28 20 20 f2  |k%!0=-1 ....(  .|
00017350  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 52  |shell_HeapBlockR|
00017360  65 74 75 72 6e 28 63 61  72 65 74 5f 62 6c 6b 25  |eturn(caret_blk%|
00017370  29 0d 0c 01 1d 20 20 3d  a3 20 3a f4 20 6e 6f 20  |)....  =. :. no |
00017380  63 61 72 65 74 20 73 6f  20 61 62 6f 72 74 0d 0c  |caret so abort..|
00017390  02 05 cd 0d 0c 03 39 f4  20 6d 75 73 74 20 62 65  |......9. must be|
000173a0  20 69 63 6f 6e 73 20 69  6e 20 74 68 65 20 77 69  | icons in the wi|
000173b0  6e 64 6f 77 20 61 73 20  74 68 65 20 63 61 72 65  |ndow as the care|
000173c0  74 20 69 73 20 70 72 65  73 65 6e 74 0d 0c 04 3a  |t is present...:|
000173d0  c8 99 20 22 57 69 6d 70  5f 57 68 69 63 68 49 63  |.. "Wimp_WhichIc|
000173e0  6f 6e 22 2c 77 68 25 2c  63 61 72 65 74 5f 62 6c  |on",wh%,caret_bl|
000173f0  6b 25 2c 26 30 30 34 30  45 30 30 30 2c 26 30 30  |k%,&0040E000,&00|
00017400  30 30 45 30 30 30 0d 0c  05 24 66 69 72 73 74 5f  |00E000...$first_|
00017410  77 72 69 74 65 25 3d 63  61 72 65 74 5f 62 6c 6b  |write%=caret_blk|
00017420  25 21 30 3a 63 74 72 25  3d 30 0d 0c 06 05 f5 0d  |%!0:ctr%=0......|
00017430  0c 07 1d 20 20 e7 20 63  61 72 65 74 5f 62 6c 6b  |...  . caret_blk|
00017440  25 21 63 74 72 25 3d 69  68 25 20 8c 0d 0c 08 3e  |%!ctr%=ih% ....>|
00017450  20 20 20 20 62 65 66 6f  72 65 25 3d 63 61 72 65  |    before%=care|
00017460  74 5f 62 6c 6b 25 21 28  63 74 72 25 2d 34 29 3a  |t_blk%!(ctr%-4):|
00017470  61 66 74 65 72 25 3d 63  61 72 65 74 5f 62 6c 6b  |after%=caret_blk|
00017480  25 21 28 63 74 72 25 2b  34 29 0d 0c 09 07 20 20  |%!(ctr%+4)....  |
00017490  cd 0d 0c 0a 0d 20 20 63  74 72 25 2b 3d 34 0d 0c  |.....  ctr%+=4..|
000174a0  0b 18 fd 20 63 61 72 65  74 5f 62 6c 6b 25 21 63  |... caret_blk%!c|
000174b0  74 72 25 3d 2d 31 0d 0c  0c 23 6c 61 73 74 5f 77  |tr%=-1...#last_w|
000174c0  72 69 74 65 25 3d 63 61  72 65 74 5f 62 6c 6b 25  |rite%=caret_blk%|
000174d0  21 28 63 74 72 25 2d 34  29 0d 0c 0d 0d c8 8e 20  |!(ctr%-4)...... |
000174e0  6b 65 79 25 20 ca 0d 0c  0e 16 20 20 c9 20 26 30  |key% .....  . &0|
000174f0  44 20 20 3a f4 20 72 65  74 75 72 6e 0d 0c 0f 1b  |D  :. return....|
00017500  20 20 20 20 e7 20 69 68  25 3d 6c 61 73 74 5f 77  |    . ih%=last_w|
00017510  72 69 74 65 25 20 8c 0d  0c 10 25 20 20 20 20 20  |rite% ....%     |
00017520  20 f4 20 66 61 6b 65 20  61 20 6b 65 79 70 72 65  | . fake a keypre|
00017530  73 73 20 6f 6e 20 69 63  6f 6e 20 30 0d 0c 11 22  |ss on icon 0..."|
00017540  20 20 20 20 20 20 c8 99  20 22 57 69 6d 70 5f 50  |      .. "Wimp_P|
00017550  72 6f 63 65 73 73 4b 65  79 22 2c 26 30 44 0d 0c  |rocessKey",&0D..|
00017560  12 2d 20 20 20 20 20 20  f4 20 50 52 4f 43 73 68  |.-      . PROCsh|
00017570  65 6c 6c 5f 46 61 6b 65  4d 6f 75 73 65 43 6c 69  |ell_FakeMouseCli|
00017580  63 6b 28 77 68 25 2c 30  2c 34 29 0d 0c 13 09 20  |ck(wh%,0,4).... |
00017590  20 20 20 cc 0d 0c 14 5a  20 20 20 20 20 20 c8 99  |   ....Z      ..|
000175a0  20 22 57 69 6d 70 5f 53  65 74 43 61 72 65 74 50  | "Wimp_SetCaretP|
000175b0  6f 73 69 74 69 6f 6e 22  2c 77 68 25 2c 61 66 74  |osition",wh%,aft|
000175c0  65 72 25 2c 2d 31 2c 2d  31 2c 2d 31 2c a9 28 a4  |er%,-1,-1,-1,.(.|
000175d0  73 68 65 6c 6c 5f 49 63  6f 6e 47 65 74 44 61 74  |shell_IconGetDat|
000175e0  61 28 77 68 25 2c 61 66  74 65 72 25 29 29 0d 0c  |a(wh%,after%))..|
000175f0  15 09 20 20 20 20 cd 0d  0c 16 1b 20 20 c9 20 26  |..    .....  . &|
00017600  31 38 45 20 3a f4 20 63  75 72 73 6f 72 20 64 6f  |18E :. cursor do|
00017610  77 6e 0d 0c 17 1b 20 20  20 20 e7 20 69 68 25 3d  |wn....    . ih%=|
00017620  6c 61 73 74 5f 77 72 69  74 65 25 20 8c 0d 0c 18  |last_write% ....|
00017630  66 20 20 20 20 20 20 c8  99 20 22 57 69 6d 70 5f  |f      .. "Wimp_|
00017640  53 65 74 43 61 72 65 74  50 6f 73 69 74 69 6f 6e  |SetCaretPosition|
00017650  22 2c 77 68 25 2c 66 69  72 73 74 5f 77 72 69 74  |",wh%,first_writ|
00017660  65 25 2c 2d 31 2c 2d 31  2c 2d 31 2c a9 28 a4 73  |e%,-1,-1,-1,.(.s|
00017670  68 65 6c 6c 5f 49 63 6f  6e 47 65 74 44 61 74 61  |hell_IconGetData|
00017680  28 77 68 25 2c 66 69 72  73 74 5f 77 72 69 74 65  |(wh%,first_write|
00017690  25 29 29 0d 0c 19 09 20  20 20 20 cc 0d 0c 1a 5a  |%))....    ....Z|
000176a0  20 20 20 20 20 20 c8 99  20 22 57 69 6d 70 5f 53  |      .. "Wimp_S|
000176b0  65 74 43 61 72 65 74 50  6f 73 69 74 69 6f 6e 22  |etCaretPosition"|
000176c0  2c 77 68 25 2c 61 66 74  65 72 25 2c 2d 31 2c 2d  |,wh%,after%,-1,-|
000176d0  31 2c 2d 31 2c a9 28 a4  73 68 65 6c 6c 5f 49 63  |1,-1,.(.shell_Ic|
000176e0  6f 6e 47 65 74 44 61 74  61 28 77 68 25 2c 61 66  |onGetData(wh%,af|
000176f0  74 65 72 25 29 29 0d 0c  1b 09 20 20 20 20 cd 0d  |ter%))....    ..|
00017700  0c 1c 19 20 20 c9 20 26  31 38 46 20 3a f4 20 63  |...  . &18F :. c|
00017710  75 72 73 6f 72 20 75 70  0d 0c 1d 1c 20 20 20 20  |ursor up....    |
00017720  e7 20 69 68 25 3d 66 69  72 73 74 5f 77 72 69 74  |. ih%=first_writ|
00017730  65 25 20 8c 0d 0c 1e 64  20 20 20 20 20 20 c8 99  |e% ....d      ..|
00017740  20 22 57 69 6d 70 5f 53  65 74 43 61 72 65 74 50  | "Wimp_SetCaretP|
00017750  6f 73 69 74 69 6f 6e 22  2c 77 68 25 2c 6c 61 73  |osition",wh%,las|
00017760  74 5f 77 72 69 74 65 25  2c 2d 31 2c 2d 31 2c 2d  |t_write%,-1,-1,-|
00017770  31 2c a9 28 a4 73 68 65  6c 6c 5f 49 63 6f 6e 47  |1,.(.shell_IconG|
00017780  65 74 44 61 74 61 28 77  68 25 2c 6c 61 73 74 5f  |etData(wh%,last_|
00017790  77 72 69 74 65 25 29 29  0d 0c 1f 09 20 20 20 20  |write%))....    |
000177a0  cc 0d 0c 20 5c 20 20 20  20 20 20 c8 99 20 22 57  |... \      .. "W|
000177b0  69 6d 70 5f 53 65 74 43  61 72 65 74 50 6f 73 69  |imp_SetCaretPosi|
000177c0  74 69 6f 6e 22 2c 77 68  25 2c 62 65 66 6f 72 65  |tion",wh%,before|
000177d0  25 2c 2d 31 2c 2d 31 2c  2d 31 2c a9 28 a4 73 68  |%,-1,-1,-1,.(.sh|
000177e0  65 6c 6c 5f 49 63 6f 6e  47 65 74 44 61 74 61 28  |ell_IconGetData(|
000177f0  77 68 25 2c 62 65 66 6f  72 65 25 29 29 0d 0c 21  |wh%,before%))..!|
00017800  09 20 20 20 20 cd 0d 0c  22 05 cb 0d 0c 23 26 f2  |.    ..."....#&.|
00017810  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 52  |shell_HeapBlockR|
00017820  65 74 75 72 6e 28 63 61  72 65 74 5f 62 6c 6b 25  |eturn(caret_blk%|
00017830  29 0d 0c 24 06 3d b9 0d  0c 25 05 3a 0d 0c 26 27  |)..$.=...%.:..&'|
00017840  2a 7c 53 74 6f 70 20 46  4e 73 68 65 6c 6c 5f 57  |*|Stop FNshell_W|
00017850  72 69 74 65 61 62 6c 65  49 63 6f 6e 48 61 6e 64  |riteableIconHand|
00017860  6c 65 72 0d 0c 27 24 2a  7c 53 74 61 72 74 20 50  |ler..'$*|Start P|
00017870  52 4f 43 73 68 65 6c 6c  5f 46 61 6b 65 4d 6f 75  |ROCshell_FakeMou|
00017880  73 65 43 6c 69 63 6b 0d  0c 28 2c dd 20 f2 73 68  |seClick..(,. .sh|
00017890  65 6c 6c 5f 46 61 6b 65  4d 6f 75 73 65 43 6c 69  |ell_FakeMouseCli|
000178a0  63 6b 28 77 68 25 2c 69  68 25 2c 62 75 74 74 6f  |ck(wh%,ih%,butto|
000178b0  6e 25 29 0d 0c 29 2a c8  99 20 22 4f 53 5f 42 79  |n%)..)*.. "OS_By|
000178c0  74 65 22 2c 31 35 2c 31  3a f4 20 66 6c 75 73 68  |te",15,1:. flush|
000178d0  20 69 6e 70 75 74 20 62  75 66 66 65 72 0d 0c 2a  | input buffer..*|
000178e0  27 5f 51 25 21 38 3d 62  75 74 74 6f 6e 25 3a 5f  |'_Q%!8=button%:_|
000178f0  51 25 21 31 32 3d 77 68  25 3a 5f 51 25 21 31 36  |Q%!12=wh%:_Q%!16|
00017900  3d 69 68 25 0d 0c 2b 14  f2 73 68 65 6c 6c 5f 41  |=ih%..+..shell_A|
00017910  63 74 69 6f 6e 28 36 29  0d 0c 2c 05 e1 0d 0c 2d  |ction(6)..,....-|
00017920  05 3a 0d 0c 2e 23 2a 7c  53 74 6f 70 20 50 52 4f  |.:...#*|Stop PRO|
00017930  43 73 68 65 6c 6c 5f 46  61 6b 65 4d 6f 75 73 65  |Cshell_FakeMouse|
00017940  43 6c 69 63 6b 0d 0c 2f  1e 2a 7c 53 74 61 72 74  |Click../.*|Start|
00017950  20 46 4e 73 68 65 6c 6c  5f 49 63 6f 6e 43 72 65  | FNshell_IconCre|
00017960  61 74 65 0d 0c 30 58 dd  20 a4 73 68 65 6c 6c 5f  |ate..0X. .shell_|
00017970  49 63 6f 6e 43 72 65 61  74 65 28 77 68 25 2c 6d  |IconCreate(wh%,m|
00017980  69 6e 78 25 2c 6d 69 6e  79 25 2c 77 25 2c 68 25  |inx%,miny%,w%,h%|
00017990  2c 66 67 25 2c 62 67 25  2c 66 6c 67 25 2c 64 61  |,fg%,bg%,flg%,da|
000179a0  74 61 24 2c 61 64 64 72  25 2c 6c 65 6e 25 2c 76  |ta$,addr%,len%,v|
000179b0  61 6c 69 64 61 74 69 6f  6e 24 29 0d 0c 31 21 ea  |alidation$)..1!.|
000179c0  20 69 25 2c 68 61 6e 64  6c 65 25 2c 76 61 6c 69  | i%,handle%,vali|
000179d0  64 25 2c 69 63 6f 6e 5f  62 6c 6b 25 0d 0c 32 27  |d%,icon_blk%..2'|
000179e0  69 63 6f 6e 5f 62 6c 6b  25 3d a4 73 68 65 6c 6c  |icon_blk%=.shell|
000179f0  5f 48 65 61 70 42 6c 6f  63 6b 46 65 74 63 68 28  |_HeapBlockFetch(|
00017a00  34 30 29 0d 0c 33 13 69  63 6f 6e 5f 62 6c 6b 25  |40)..3.icon_blk%|
00017a10  21 30 3d 77 68 25 0d 0c  34 27 69 63 6f 6e 5f 62  |!0=wh%..4'icon_b|
00017a20  6c 6b 25 21 34 3d 6d 69  6e 78 25 3a 69 63 6f 6e  |lk%!4=minx%:icon|
00017a30  5f 62 6c 6b 25 21 38 3d  6d 69 6e 79 25 0d 0c 35  |_blk%!8=miny%..5|
00017a40  2f 69 63 6f 6e 5f 62 6c  6b 25 21 31 32 3d 6d 69  |/icon_blk%!12=mi|
00017a50  6e 78 25 2b 77 25 3a 69  63 6f 6e 5f 62 6c 6b 25  |nx%+w%:icon_blk%|
00017a60  21 31 36 3d 6d 69 6e 79  25 2b 68 25 0d 0c 36 29  |!16=miny%+h%..6)|
00017a70  69 63 6f 6e 5f 62 6c 6b  25 21 32 30 3d 66 6c 67  |icon_blk%!20=flg|
00017a80  25 20 84 20 62 67 25 3c  3c 32 38 20 84 20 66 67  |% . bg%<<28 . fg|
00017a90  25 3c 3c 32 34 0d 0c 37  1b e7 20 69 63 6f 6e 5f  |%<<24..7.. icon_|
00017aa0  62 6c 6b 25 21 32 30 20  80 20 26 31 30 30 20 8c  |blk%!20 . &100 .|
00017ab0  0d 0c 38 14 20 20 69 25  3d a7 64 61 74 61 24 2c  |..8.  i%=.data$,|
00017ac0  22 2c 22 29 0d 0c 39 18  20 20 69 63 6f 6e 5f 62  |",")..9.  icon_b|
00017ad0  6c 6b 25 21 32 34 3d 61  64 64 72 25 0d 0c 3a 19  |lk%!24=addr%..:.|
00017ae0  20 20 e7 20 76 61 6c 69  64 61 74 69 6f 6e 24 3c  |  . validation$<|
00017af0  3e 22 22 20 8c 0d 0c 3b  34 20 20 20 20 76 61 6c  |>"" ...;4    val|
00017b00  69 64 25 3d a4 73 68 65  6c 6c 5f 48 65 61 70 42  |id%=.shell_HeapB|
00017b10  6c 6f 63 6b 46 65 74 63  68 28 a9 76 61 6c 69 64  |lockFetch(.valid|
00017b20  61 74 69 6f 6e 24 2b 31  29 0d 0c 3c 1b 20 20 20  |ation$+1)..<.   |
00017b30  20 24 76 61 6c 69 64 25  3d 76 61 6c 69 64 61 74  | $valid%=validat|
00017b40  69 6f 6e 24 0d 0c 3d 1b  20 20 20 20 69 63 6f 6e  |ion$..=.    icon|
00017b50  5f 62 6c 6b 25 21 32 38  3d 76 61 6c 69 64 25 0d  |_blk%!28=valid%.|
00017b60  0c 3e 07 20 20 cc 0d 0c  3f 17 20 20 20 20 69 63  |.>.  ...?.    ic|
00017b70  6f 6e 5f 62 6c 6b 25 21  32 38 3d 2d 31 0d 0c 40  |on_blk%!28=-1..@|
00017b80  07 20 20 cd 0d 0c 41 17  20 20 69 63 6f 6e 5f 62  |.  ...A.  icon_b|
00017b90  6c 6b 25 21 33 32 3d 6c  65 6e 25 0d 0c 42 05 cc  |lk%!32=len%..B..|
00017ba0  0d 0c 43 20 20 20 24 28  69 63 6f 6e 5f 62 6c 6b  |..C   $(icon_blk|
00017bb0  25 2b 32 34 29 3d c0 64  61 74 61 24 2c 31 31 29  |%+24)=.data$,11)|
00017bc0  0d 0c 44 05 cd 0d 0c 45  2d c8 99 20 22 57 69 6d  |..D....E-.. "Wim|
00017bd0  70 5f 43 72 65 61 74 65  49 63 6f 6e 22 2c 2c 69  |p_CreateIcon",,i|
00017be0  63 6f 6e 5f 62 6c 6b 25  20 b8 20 68 61 6e 64 6c  |con_blk% . handl|
00017bf0  65 25 0d 0c 46 25 f2 73  68 65 6c 6c 5f 48 65 61  |e%..F%.shell_Hea|
00017c00  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 69 63 6f  |pBlockReturn(ico|
00017c10  6e 5f 62 6c 6b 25 29 0d  0c 47 0c 3d 68 61 6e 64  |n_blk%)..G.=hand|
00017c20  6c 65 25 0d 0c 48 05 3a  0d 0c 49 1d 2a 7c 53 74  |le%..H.:..I.*|St|
00017c30  6f 70 20 46 4e 73 68 65  6c 6c 5f 49 63 6f 6e 43  |op FNshell_IconC|
00017c40  72 65 61 74 65 0d 0c 4a  20 2a 7c 53 74 61 72 74  |reate..J *|Start|
00017c50  20 50 52 4f 43 73 68 65  6c 6c 5f 49 63 6f 6e 44  | PROCshell_IconD|
00017c60  65 6c 65 74 65 0d 0c 4b  20 dd 20 f2 73 68 65 6c  |elete..K . .shel|
00017c70  6c 5f 49 63 6f 6e 44 65  6c 65 74 65 28 77 68 25  |l_IconDelete(wh%|
00017c80  2c 69 68 25 29 0d 0c 4c  22 f2 73 68 65 6c 6c 5f  |,ih%)..L".shell_|
00017c90  44 6f 49 63 6f 6e 44 65  6c 65 74 65 28 77 68 25  |DoIconDelete(wh%|
00017ca0  2c 69 68 25 2c a3 29 0d  0c 4d 05 e1 0d 0c 4e 05  |,ih%,.)..M....N.|
00017cb0  3a 0d 0c 4f 1f 2a 7c 53  74 6f 70 20 50 52 4f 43  |:..O.*|Stop PROC|
00017cc0  73 68 65 6c 6c 5f 49 63  6f 6e 44 65 6c 65 74 65  |shell_IconDelete|
00017cd0  0d 0c 50 21 2a 7c 53 74  61 72 74 20 50 52 4f 43  |..P!*|Start PROC|
00017ce0  73 68 65 6c 6c 5f 49 63  6f 6e 44 65 6c 65 74 65  |shell_IconDelete|
00017cf0  32 0d 0c 51 21 dd 20 f2  73 68 65 6c 6c 5f 49 63  |2..Q!. .shell_Ic|
00017d00  6f 6e 44 65 6c 65 74 65  32 28 77 68 25 2c 69 68  |onDelete2(wh%,ih|
00017d10  25 29 0d 0c 52 22 f2 73  68 65 6c 6c 5f 44 6f 49  |%)..R".shell_DoI|
00017d20  63 6f 6e 44 65 6c 65 74  65 28 77 68 25 2c 69 68  |conDelete(wh%,ih|
00017d30  25 2c b9 29 0d 0c 53 05  e1 0d 0c 54 05 3a 0d 0c  |%,.)..S....T.:..|
00017d40  55 20 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |U *|Stop PROCshe|
00017d50  6c 6c 5f 49 63 6f 6e 44  65 6c 65 74 65 32 0d 0c  |ll_IconDelete2..|
00017d60  56 22 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |V"*|Start PROCsh|
00017d70  65 6c 6c 5f 44 6f 49 63  6f 6e 44 65 6c 65 74 65  |ell_DoIconDelete|
00017d80  0d 0c 57 2a dd 20 f2 73  68 65 6c 6c 5f 44 6f 49  |..W*. .shell_DoI|
00017d90  63 6f 6e 44 65 6c 65 74  65 28 77 68 25 2c 69 68  |conDelete(wh%,ih|
00017da0  25 2c 72 65 64 72 61 77  25 29 0d 0c 58 1a ea 20  |%,redraw%)..X.. |
00017db0  62 6c 6b 25 2c 78 30 25  2c 79 30 25 2c 78 31 25  |blk%,x0%,y0%,x1%|
00017dc0  2c 79 31 25 0d 0c 59 22  62 6c 6b 25 3d a4 73 68  |,y1%..Y"blk%=.sh|
00017dd0  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
00017de0  63 68 28 34 30 29 0d 0c  5a 19 62 6c 6b 25 21 30  |ch(40)..Z.blk%!0|
00017df0  3d 77 68 25 3a 62 6c 6b  25 21 34 3d 69 68 25 0d  |=wh%:blk%!4=ih%.|
00017e00  0c 5b 20 c8 99 20 22 57  69 6d 70 5f 47 65 74 49  |.[ .. "Wimp_GetI|
00017e10  63 6f 6e 53 74 61 74 65  22 2c 2c 62 6c 6b 25 0d  |conState",,blk%.|
00017e20  0c 5c 26 c8 99 20 22 49  6e 74 65 72 66 61 63 65  |.\&.. "Interface|
00017e30  5f 42 6f 75 6e 64 69 6e  67 42 6f 78 22 2c 2c 62  |_BoundingBox",,b|
00017e40  6c 6b 25 2b 38 0d 0c 5d  32 78 30 25 3d 62 6c 6b  |lk%+8..]2x0%=blk|
00017e50  25 21 38 3a 79 30 25 3d  62 6c 6b 25 21 31 32 3a  |%!8:y0%=blk%!12:|
00017e60  78 31 25 3d 62 6c 6b 25  21 31 36 3a 79 31 25 3d  |x1%=blk%!16:y1%=|
00017e70  62 6c 6b 25 21 32 30 0d  0c 5e 20 c8 99 20 22 57  |blk%!20..^ .. "W|
00017e80  69 6d 70 5f 47 65 74 49  63 6f 6e 53 74 61 74 65  |imp_GetIconState|
00017e90  22 2c 2c 62 6c 6b 25 0d  0c 5f 47 e7 20 a4 73 68  |",,blk%.._G. .sh|
00017ea0  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 45 78 69  |ell_HeapBlockExi|
00017eb0  73 74 73 28 62 6c 6b 25  21 32 38 29 20 8c 20 f2  |sts(blk%!28) . .|
00017ec0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 52  |shell_HeapBlockR|
00017ed0  65 74 75 72 6e 28 62 6c  6b 25 21 32 38 29 0d 0c  |eturn(blk%!28)..|
00017ee0  60 47 e7 20 a4 73 68 65  6c 6c 5f 48 65 61 70 42  |`G. .shell_HeapB|
00017ef0  6c 6f 63 6b 45 78 69 73  74 73 28 62 6c 6b 25 21  |lockExists(blk%!|
00017f00  33 32 29 20 8c 20 f2 73  68 65 6c 6c 5f 48 65 61  |32) . .shell_Hea|
00017f10  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 62 6c 6b  |pBlockReturn(blk|
00017f20  25 21 33 32 29 0d 0c 61  1e c8 99 20 22 57 69 6d  |%!32)..a... "Wim|
00017f30  70 5f 44 65 6c 65 74 65  49 63 6f 6e 22 2c 2c 62  |p_DeleteIcon",,b|
00017f40  6c 6b 25 0d 0c 62 0f e7  20 72 65 64 72 61 77 25  |lk%..b.. redraw%|
00017f50  20 8c 0d 0c 63 2f 20 20  c8 99 20 22 57 69 6d 70  | ...c/  .. "Wimp|
00017f60  5f 46 6f 72 63 65 52 65  64 72 61 77 22 2c 77 68  |_ForceRedraw",wh|
00017f70  25 2c 78 30 25 2c 79 30  25 2c 78 31 25 2c 79 31  |%,x0%,y0%,x1%,y1|
00017f80  25 0d 0c 64 05 cd 0d 0c  65 20 f2 73 68 65 6c 6c  |%..d....e .shell|
00017f90  5f 48 65 61 70 42 6c 6f  63 6b 52 65 74 75 72 6e  |_HeapBlockReturn|
00017fa0  28 62 6c 6b 25 29 0d 0c  66 05 e1 0d 0c 67 05 3a  |(blk%)..f....g.:|
00017fb0  0d 0c 68 21 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |..h!*|Stop PROCs|
00017fc0  68 65 6c 6c 5f 44 6f 49  63 6f 6e 44 65 6c 65 74  |hell_DoIconDelet|
00017fd0  65 0d 0c 69 21 2a 7c 53  74 61 72 74 20 50 52 4f  |e..i!*|Start PRO|
00017fe0  43 73 68 65 6c 6c 5f 49  63 6f 6e 50 75 74 44 61  |Cshell_IconPutDa|
00017ff0  74 61 0d 0c 6a 38 dd 20  f2 73 68 65 6c 6c 5f 49  |ta..j8. .shell_I|
00018000  63 6f 6e 50 75 74 44 61  74 61 28 77 68 61 6e 64  |conPutData(whand|
00018010  6c 65 25 2c 69 68 61 6e  64 6c 65 25 2c 64 61 74  |le%,ihandle%,dat|
00018020  61 24 2c 72 65 64 72 61  77 29 0d 0c 6b 0a ea 20  |a$,redraw)..k.. |
00018030  62 6c 6b 25 0d 0c 6c 23  62 6c 6b 25 3d a4 73 68  |blk%..l#blk%=.sh|
00018040  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
00018050  63 68 28 35 30 29 20 0d  0c 6d 13 62 6c 6b 25 21  |ch(50) ..m.blk%!|
00018060  30 3d 77 68 61 6e 64 6c  65 25 0d 0c 6e 13 62 6c  |0=whandle%..n.bl|
00018070  6b 25 21 34 3d 69 68 61  6e 64 6c 65 25 0d 0c 6f  |k%!4=ihandle%..o|
00018080  20 c8 99 20 22 57 69 6d  70 5f 47 65 74 49 63 6f  | .. "Wimp_GetIco|
00018090  6e 53 74 61 74 65 22 2c  2c 62 6c 6b 25 0d 0c 70  |nState",,blk%..p|
000180a0  1d e7 20 28 62 6c 6b 25  21 32 34 20 80 20 28 31  |.. (blk%!24 . (1|
000180b0  3c 3c 38 29 29 3c 3e 30  20 8c 0d 0c 71 40 20 20  |<<8))<>0 ...q@  |
000180c0  e7 20 a9 64 61 74 61 24  3e 62 6c 6b 25 21 33 36  |. .data$>blk%!36|
000180d0  20 8c 20 85 20 39 39 2c  a4 73 68 65 6c 6c 5f 4d  | . . 99,.shell_M|
000180e0  65 73 73 61 67 65 4e 6f  41 72 67 73 28 22 53 48  |essageNoArgs("SH|
000180f0  45 4c 4c 4d 53 47 31 32  22 29 0d 0c 72 16 20 20  |ELLMSG12")..r.  |
00018100  24 28 62 6c 6b 25 21 32  38 29 3d 64 61 74 61 24  |$(blk%!28)=data$|
00018110  0d 0c 73 05 cc 0d 0c 74  1b 20 20 24 28 62 6c 6b  |..s....t.  $(blk|
00018120  25 2b 32 38 29 3d c0 64  61 74 61 24 2c 31 31 29  |%+28)=.data$,11)|
00018130  0d 0c 75 05 cd 0d 0c 76  11 e7 20 72 65 64 72 61  |..u....v.. redra|
00018140  77 3c 3e 30 20 8c 0d 0c  77 18 20 20 62 6c 6b 25  |w<>0 ...w.  blk%|
00018150  21 38 3d 30 3a 62 6c 6b  25 21 31 32 3d 30 0d 0c  |!8=0:blk%!12=0..|
00018160  78 22 20 20 c8 99 20 22  57 69 6d 70 5f 53 65 74  |x"  .. "Wimp_Set|
00018170  49 63 6f 6e 53 74 61 74  65 22 2c 2c 62 6c 6b 25  |IconState",,blk%|
00018180  0d 0c 79 45 20 20 f4 20  43 61 6c 6c 20 77 69 6d  |..yE  . Call wim|
00018190  70 20 70 6f 6c 6c 20 69  6d 6d 65 64 69 61 74 65  |p poll immediate|
000181a0  6c 79 20 69 6e 20 63 61  73 65 20 74 68 65 20 75  |ly in case the u|
000181b0  73 65 72 20 70 72 6f 67  72 61 6d 20 64 6f 65 73  |ser program does|
000181c0  6e 27 74 2e 2e 0d 0c 7a  17 20 20 f2 73 68 65 6c  |n't....z.  .shel|
000181d0  6c 5f 45 6e 73 75 72 65  50 6f 6c 6c 0d 0c 7b 05  |l_EnsurePoll..{.|
000181e0  cd 0d 0c 7c 20 f2 73 68  65 6c 6c 5f 48 65 61 70  |...| .shell_Heap|
000181f0  42 6c 6f 63 6b 52 65 74  75 72 6e 28 62 6c 6b 25  |BlockReturn(blk%|
00018200  29 0d 0c 7d 05 e1 0d 0c  7e 05 3a 0d 0c 7f 20 2a  |)..}....~.:... *|
00018210  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
00018220  49 63 6f 6e 50 75 74 44  61 74 61 0d 0c 80 21 2a  |IconPutData...!*|
00018230  7c 53 74 61 72 74 20 46  4e 73 68 65 6c 6c 5f 49  ||Start FNshell_I|
00018240  63 6f 6e 4e 65 77 53 70  72 69 74 65 0d 0c 81 3d  |conNewSprite...=|
00018250  dd 20 a4 73 68 65 6c 6c  5f 49 63 6f 6e 4e 65 77  |. .shell_IconNew|
00018260  53 70 72 69 74 65 28 77  68 61 6e 64 6c 65 25 2c  |Sprite(whandle%,|
00018270  69 68 61 6e 64 6c 65 25  2c 6e 65 77 6e 61 6d 65  |ihandle%,newname|
00018280  24 2c 72 65 64 72 61 77  29 0d 0c 82 0f ea 20 69  |$,redraw)..... i|
00018290  63 6f 6e 5f 62 6c 6b 25  0d 0c 83 27 69 63 6f 6e  |con_blk%...'icon|
000182a0  5f 62 6c 6b 25 3d a4 73  68 65 6c 6c 5f 48 65 61  |_blk%=.shell_Hea|
000182b0  70 42 6c 6f 63 6b 46 65  74 63 68 28 34 30 29 0d  |pBlockFetch(40).|
000182c0  0c 84 2d 69 63 6f 6e 5f  62 6c 6b 25 21 30 3d 77  |..-icon_blk%!0=w|
000182d0  68 61 6e 64 6c 65 25 3a  69 63 6f 6e 5f 62 6c 6b  |handle%:icon_blk|
000182e0  25 21 34 3d 69 68 61 6e  64 6c 65 25 0d 0c 85 25  |%!4=ihandle%...%|
000182f0  c8 99 20 22 57 69 6d 70  5f 47 65 74 49 63 6f 6e  |.. "Wimp_GetIcon|
00018300  53 74 61 74 65 22 2c 2c  69 63 6f 6e 5f 62 6c 6b  |State",,icon_blk|
00018310  25 0d 0c 86 23 c8 99 20  22 57 69 6d 70 5f 44 65  |%...#.. "Wimp_De|
00018320  6c 65 74 65 49 63 6f 6e  22 2c 2c 69 63 6f 6e 5f  |leteIcon",,icon_|
00018330  62 6c 6b 25 0d 0c 87 4e  69 63 6f 6e 5f 62 6c 6b  |blk%...Nicon_blk|
00018340  25 21 34 3d 69 63 6f 6e  5f 62 6c 6b 25 21 38 3a  |%!4=icon_blk%!8:|
00018350  69 63 6f 6e 5f 62 6c 6b  25 21 38 3d 69 63 6f 6e  |icon_blk%!8=icon|
00018360  5f 62 6c 6b 25 21 31 32  3a 69 63 6f 6e 5f 62 6c  |_blk%!12:icon_bl|
00018370  6b 25 21 31 32 3d 69 63  6f 6e 5f 62 6c 6b 25 21  |k%!12=icon_blk%!|
00018380  31 36 0d 0c 88 50 69 63  6f 6e 5f 62 6c 6b 25 21  |16...Picon_blk%!|
00018390  31 36 3d 69 63 6f 6e 5f  62 6c 6b 25 21 32 30 3a  |16=icon_blk%!20:|
000183a0  69 63 6f 6e 5f 62 6c 6b  25 21 32 30 3d 69 63 6f  |icon_blk%!20=ico|
000183b0  6e 5f 62 6c 6b 25 21 32  34 3a 24 28 69 63 6f 6e  |n_blk%!24:$(icon|
000183c0  5f 62 6c 6b 25 2b 32 34  29 3d 6e 65 77 6e 61 6d  |_blk%+24)=newnam|
000183d0  65 24 0d 0c 89 2e c8 99  20 22 57 69 6d 70 5f 43  |e$...... "Wimp_C|
000183e0  72 65 61 74 65 49 63 6f  6e 22 2c 2c 69 63 6f 6e  |reateIcon",,icon|
000183f0  5f 62 6c 6b 25 20 b8 20  69 68 61 6e 64 6c 65 25  |_blk% . ihandle%|
00018400  0d 0c 8a 62 e7 20 72 65  64 72 61 77 20 8c 20 c8  |...b. redraw . .|
00018410  99 20 22 57 69 6d 70 5f  46 6f 72 63 65 52 65 64  |. "Wimp_ForceRed|
00018420  72 61 77 22 2c 69 63 6f  6e 5f 62 6c 6b 25 21 30  |raw",icon_blk%!0|
00018430  2c 69 63 6f 6e 5f 62 6c  6b 25 21 34 2c 69 63 6f  |,icon_blk%!4,ico|
00018440  6e 5f 62 6c 6b 25 21 38  2c 69 63 6f 6e 5f 62 6c  |n_blk%!8,icon_bl|
00018450  6b 25 21 31 32 2c 69 63  6f 6e 5f 62 6c 6b 25 21  |k%!12,icon_blk%!|
00018460  31 36 0d 0c 8b 25 f2 73  68 65 6c 6c 5f 48 65 61  |16...%.shell_Hea|
00018470  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 69 63 6f  |pBlockReturn(ico|
00018480  6e 5f 62 6c 6b 25 29 0d  0c 8c 0d 3d 69 68 61 6e  |n_blk%)....=ihan|
00018490  64 6c 65 25 0d 0c 8d 05  3a 0d 0c 8e 20 2a 7c 53  |dle%....:... *|S|
000184a0  74 6f 70 20 46 4e 73 68  65 6c 6c 5f 49 63 6f 6e  |top FNshell_Icon|
000184b0  4e 65 77 53 70 72 69 74  65 0d 0c 8f 1f 2a 7c 53  |NewSprite....*|S|
000184c0  74 61 72 74 20 46 4e 73  68 65 6c 6c 5f 49 63 6f  |tart FNshell_Ico|
000184d0  6e 47 65 74 44 61 74 61  0d 0c 90 2b dd 20 a4 73  |nGetData...+. .s|
000184e0  68 65 6c 6c 5f 49 63 6f  6e 47 65 74 44 61 74 61  |hell_IconGetData|
000184f0  28 77 68 61 6e 64 6c 65  25 2c 69 68 61 6e 64 6c  |(whandle%,ihandl|
00018500  65 25 29 0d 0c 91 17 ea  20 72 65 73 75 6c 74 24  |e%)..... result$|
00018510  2c 69 63 6f 6e 5f 62 6c  6b 25 0d 0c 92 27 69 63  |,icon_blk%...'ic|
00018520  6f 6e 5f 62 6c 6b 25 3d  a4 73 68 65 6c 6c 5f 48  |on_blk%=.shell_H|
00018530  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 34 30  |eapBlockFetch(40|
00018540  29 0d 0c 93 18 69 63 6f  6e 5f 62 6c 6b 25 21 30  |)....icon_blk%!0|
00018550  3d 77 68 61 6e 64 6c 65  25 0d 0c 94 18 69 63 6f  |=whandle%....ico|
00018560  6e 5f 62 6c 6b 25 21 34  3d 69 68 61 6e 64 6c 65  |n_blk%!4=ihandle|
00018570  25 0d 0c 95 25 c8 99 20  22 57 69 6d 70 5f 47 65  |%...%.. "Wimp_Ge|
00018580  74 49 63 6f 6e 53 74 61  74 65 22 2c 2c 69 63 6f  |tIconState",,ico|
00018590  6e 5f 62 6c 6b 25 0d 0c  96 54 e7 20 28 69 63 6f  |n_blk%...T. (ico|
000185a0  6e 5f 62 6c 6b 25 21 32  34 20 80 20 28 31 3c 3c  |n_blk%!24 . (1<<|
000185b0  38 29 29 3c 3e 30 20 8c  20 72 65 73 75 6c 74 24  |8))<>0 . result$|
000185c0  3d 24 28 69 63 6f 6e 5f  62 6c 6b 25 21 32 38 29  |=$(icon_blk%!28)|
000185d0  20 8b 20 72 65 73 75 6c  74 24 3d 24 28 69 63 6f  | . result$=$(ico|
000185e0  6e 5f 62 6c 6b 25 2b 32  38 29 0d 0c 97 25 f2 73  |n_blk%+28)...%.s|
000185f0  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 52 65  |hell_HeapBlockRe|
00018600  74 75 72 6e 28 69 63 6f  6e 5f 62 6c 6b 25 29 0d  |turn(icon_blk%).|
00018610  0c 98 0c 3d 72 65 73 75  6c 74 24 0d 0c 99 05 3a  |...=result$....:|
00018620  0d 0c 9a 1e 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |....*|Stop FNshe|
00018630  6c 6c 5f 49 63 6f 6e 47  65 74 44 61 74 61 0d 0c  |ll_IconGetData..|
00018640  9b 1d 2a 7c 53 74 61 72  74 20 46 4e 73 68 65 6c  |..*|Start FNshel|
00018650  6c 5f 49 63 6f 6e 4d 6f  76 65 32 0d 0c 9c 29 dd  |l_IconMove2...).|
00018660  20 a4 73 68 65 6c 6c 5f  49 63 6f 6e 4d 6f 76 65  | .shell_IconMove|
00018670  32 28 77 68 25 2c 69 68  25 2c 64 5f 78 25 2c 64  |2(wh%,ih%,d_x%,d|
00018680  5f 79 25 29 0d 0c 9d 0c  ea 20 6d 5f 62 6c 6b 25  |_y%)..... m_blk%|
00018690  0d 0c 9e 24 6d 5f 62 6c  6b 25 3d a4 73 68 65 6c  |...$m_blk%=.shel|
000186a0  6c 5f 48 65 61 70 42 6c  6f 63 6b 46 65 74 63 68  |l_HeapBlockFetch|
000186b0  28 34 30 29 0d 0c 9f 1c  21 6d 5f 62 6c 6b 25 3d  |(40)....!m_blk%=|
000186c0  77 68 25 3a 6d 5f 62 6c  6b 25 21 34 3d 69 68 25  |wh%:m_blk%!4=ih%|
000186d0  0d 0c a0 22 c8 99 20 22  57 69 6d 70 5f 47 65 74  |...".. "Wimp_Get|
000186e0  49 63 6f 6e 53 74 61 74  65 22 2c 2c 6d 5f 62 6c  |IconState",,m_bl|
000186f0  6b 25 0d 0c a1 22 6d 5f  62 6c 6b 25 21 38 2b 3d  |k%..."m_blk%!8+=|
00018700  64 5f 78 25 3a 6d 5f 62  6c 6b 25 21 31 36 2b 3d  |d_x%:m_blk%!16+=|
00018710  64 5f 78 25 0d 0c a2 23  6d 5f 62 6c 6b 25 21 31  |d_x%...#m_blk%!1|
00018720  32 2b 3d 64 5f 79 25 3a  6d 5f 62 6c 6b 25 21 32  |2+=d_y%:m_blk%!2|
00018730  30 2b 3d 64 5f 79 25 0d  0c a3 47 69 68 25 3d a4  |0+=d_y%...Gih%=.|
00018740  73 68 65 6c 6c 5f 49 63  6f 6e 4d 6f 76 65 28 77  |shell_IconMove(w|
00018750  68 25 2c 69 68 25 2c 6d  5f 62 6c 6b 25 21 38 2c  |h%,ih%,m_blk%!8,|
00018760  6d 5f 62 6c 6b 25 21 31  32 2c 6d 5f 62 6c 6b 25  |m_blk%!12,m_blk%|
00018770  21 31 36 2c 6d 5f 62 6c  6b 25 21 32 30 29 0d 0c  |!16,m_blk%!20)..|
00018780  a4 22 f2 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |.".shell_HeapBlo|
00018790  63 6b 52 65 74 75 72 6e  28 6d 5f 62 6c 6b 25 29  |ckReturn(m_blk%)|
000187a0  0d 0c a5 08 3d 69 68 25  0d 0c a6 05 3a 0d 0c a7  |....=ih%....:...|
000187b0  1c 2a 7c 53 74 6f 70 20  46 4e 73 68 65 6c 6c 5f  |.*|Stop FNshell_|
000187c0  49 63 6f 6e 4d 6f 76 65  32 0d 0c a8 1e 2a 7c 53  |IconMove2....*|S|
000187d0  74 61 72 74 20 46 4e 73  68 65 6c 6c 5f 49 63 6f  |tart FNshell_Ico|
000187e0  6e 52 65 73 69 7a 65 0d  0c a9 30 dd 20 a4 73 68  |nResize...0. .sh|
000187f0  65 6c 6c 5f 49 63 6f 6e  52 65 73 69 7a 65 28 77  |ell_IconResize(w|
00018800  68 25 2c 69 68 25 2c 78  30 25 2c 79 30 25 2c 78  |h%,ih%,x0%,y0%,x|
00018810  31 25 2c 79 31 25 29 0d  0c aa 2d 3d a4 73 68 65  |1%,y1%)...-=.she|
00018820  6c 6c 5f 49 63 6f 6e 4d  6f 76 65 28 77 68 25 2c  |ll_IconMove(wh%,|
00018830  69 68 25 2c 78 30 25 2c  79 30 25 2c 78 31 25 2c  |ih%,x0%,y0%,x1%,|
00018840  79 31 25 29 0d 0c ab 05  3a 0d 0c ac 1d 2a 7c 53  |y1%)....:....*|S|
00018850  74 6f 70 20 46 4e 73 68  65 6c 6c 5f 49 63 6f 6e  |top FNshell_Icon|
00018860  52 65 73 69 7a 65 0d 0c  ad 1c 2a 7c 53 74 61 72  |Resize....*|Star|
00018870  74 20 46 4e 73 68 65 6c  6c 5f 49 63 6f 6e 4d 6f  |t FNshell_IconMo|
00018880  76 65 0d 0c ae 2e dd 20  a4 73 68 65 6c 6c 5f 49  |ve..... .shell_I|
00018890  63 6f 6e 4d 6f 76 65 28  77 68 25 2c 69 68 25 2c  |conMove(wh%,ih%,|
000188a0  78 30 25 2c 79 30 25 2c  78 31 25 2c 79 31 25 29  |x0%,y0%,x1%,y1%)|
000188b0  0d 0c af 27 ea 20 69 5f  62 6c 6b 25 2c 69 5f 66  |...'. i_blk%,i_f|
000188c0  6c 61 67 73 25 2c 69 5f  64 61 74 61 25 2c 62 64  |lags%,i_data%,bd|
000188d0  72 25 2c 62 6c 6b 25 0d  0c b0 21 ea 20 6f 6c 64  |r%,blk%...!. old|
000188e0  66 6c 61 67 73 25 2c 6f  64 74 30 25 2c 6f 64 74  |flags%,odt0%,odt|
000188f0  31 25 2c 6f 64 74 32 25  0d 0c b1 24 69 5f 62 6c  |1%,odt2%...$i_bl|
00018900  6b 25 3d a4 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |k%=.shell_HeapBl|
00018910  6f 63 6b 46 65 74 63 68  28 34 30 29 0d 0c b2 22  |ockFetch(40)..."|
00018920  62 6c 6b 25 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |blk%=.shell_Heap|
00018930  42 6c 6f 63 6b 46 65 74  63 68 28 34 30 29 0d 0c  |BlockFetch(40)..|
00018940  b3 3b 21 69 5f 62 6c 6b  25 3d 77 68 25 3a 69 5f  |.;!i_blk%=wh%:i_|
00018950  62 6c 6b 25 21 34 3d 69  68 25 3a c8 99 20 22 57  |blk%!4=ih%:.. "W|
00018960  69 6d 70 5f 47 65 74 49  63 6f 6e 53 74 61 74 65  |imp_GetIconState|
00018970  22 2c 2c 69 5f 62 6c 6b  25 0d 0c b4 18 21 62 6c  |",,i_blk%....!bl|
00018980  6b 25 3d 77 68 25 3a 62  6c 6b 25 21 34 3d 69 68  |k%=wh%:blk%!4=ih|
00018990  25 0d 0c b5 20 c8 99 20  22 57 69 6d 70 5f 47 65  |%... .. "Wimp_Ge|
000189a0  74 49 63 6f 6e 53 74 61  74 65 22 2c 2c 62 6c 6b  |tIconState",,blk|
000189b0  25 0d 0c b6 26 c8 99 20  22 49 6e 74 65 72 66 61  |%...&.. "Interfa|
000189c0  63 65 5f 42 6f 75 6e 64  69 6e 67 42 6f 78 22 2c  |ce_BoundingBox",|
000189d0  2c 62 6c 6b 25 2b 38 0d  0c b7 26 69 66 6c 61 67  |,blk%+8...&iflag|
000189e0  73 25 3d 69 5f 62 6c 6b  25 21 32 34 3a 69 64 61  |s%=i_blk%!24:ida|
000189f0  74 61 25 3d 69 5f 62 6c  6b 25 2b 32 38 0d 0c b8  |ta%=i_blk%+28...|
00018a00  42 6f 6c 64 66 6c 61 67  73 25 3d 69 66 6c 61 67  |Boldflags%=iflag|
00018a10  73 25 3a 6f 64 74 30 25  3d 69 64 61 74 61 25 21  |s%:odt0%=idata%!|
00018a20  30 3a 6f 64 74 31 25 3d  69 64 61 74 61 25 21 34  |0:odt1%=idata%!4|
00018a30  3a 6f 64 74 32 25 3d 69  64 61 74 61 25 21 38 0d  |:odt2%=idata%!8.|
00018a40  0c b9 18 62 64 72 25 3d  69 5f 62 6c 6b 25 21 38  |...bdr%=i_blk%!8|
00018a50  2d 62 6c 6b 25 21 38 0d  0c ba 20 c8 99 20 22 57  |-blk%!8... .. "W|
00018a60  69 6d 70 5f 44 65 6c 65  74 65 49 63 6f 6e 22 2c  |imp_DeleteIcon",|
00018a70  2c 69 5f 62 6c 6b 25 0d  0c bb 5c c8 99 20 22 57  |,i_blk%...\.. "W|
00018a80  69 6d 70 5f 46 6f 72 63  65 52 65 64 72 61 77 22  |imp_ForceRedraw"|
00018a90  2c 21 69 5f 62 6c 6b 25  2c 69 5f 62 6c 6b 25 21  |,!i_blk%,i_blk%!|
00018aa0  38 2d 62 64 72 25 2c 69  5f 62 6c 6b 25 21 31 32  |8-bdr%,i_blk%!12|
00018ab0  2d 62 64 72 25 2c 69 5f  62 6c 6b 25 21 31 36 2b  |-bdr%,i_blk%!16+|
00018ac0  62 64 72 25 2c 69 5f 62  6c 6b 25 21 32 30 2b 62  |bdr%,i_blk%!20+b|
00018ad0  64 72 25 0d 0c bc 50 69  68 25 3d a4 73 68 65 6c  |dr%...Pih%=.shel|
00018ae0  6c 5f 43 72 65 61 74 65  49 63 6f 6e 32 28 77 68  |l_CreateIcon2(wh|
00018af0  25 2c 78 30 25 2c 79 30  25 2c 78 31 25 2c 79 31  |%,x0%,y0%,x1%,y1|
00018b00  25 2c 6f 6c 64 66 6c 61  67 73 25 2c 6f 64 74 30  |%,oldflags%,odt0|
00018b10  25 2c 6f 64 74 31 25 2c  6f 64 74 32 25 2c 62 64  |%,odt1%,odt2%,bd|
00018b20  72 25 29 0d 0c bd 22 f2  73 68 65 6c 6c 5f 48 65  |r%)...".shell_He|
00018b30  61 70 42 6c 6f 63 6b 52  65 74 75 72 6e 28 69 5f  |apBlockReturn(i_|
00018b40  62 6c 6b 25 29 0d 0c be  20 f2 73 68 65 6c 6c 5f  |blk%)... .shell_|
00018b50  48 65 61 70 42 6c 6f 63  6b 52 65 74 75 72 6e 28  |HeapBlockReturn(|
00018b60  62 6c 6b 25 29 0d 0c bf  08 3d 69 68 25 0d 0c c0  |blk%)....=ih%...|
00018b70  05 3a 0d 0c c1 1b 2a 7c  53 74 6f 70 20 46 4e 73  |.:....*|Stop FNs|
00018b80  68 65 6c 6c 5f 49 63 6f  6e 4d 6f 76 65 0d 0c c2  |hell_IconMove...|
00018b90  1f 2a 7c 53 74 61 72 74  20 46 4e 73 68 65 6c 6c  |.*|Start FNshell|
00018ba0  5f 43 72 65 61 74 65 49  63 6f 6e 32 0d 0c c3 4c  |_CreateIcon2...L|
00018bb0  dd 20 a4 73 68 65 6c 6c  5f 43 72 65 61 74 65 49  |. .shell_CreateI|
00018bc0  63 6f 6e 32 28 68 61 6e  64 6c 65 25 2c 78 30 25  |con2(handle%,x0%|
00018bd0  2c 79 30 25 2c 78 31 25  2c 79 31 25 2c 66 6c 61  |,y0%,x1%,y1%,fla|
00018be0  67 73 25 2c 64 74 30 25  2c 64 74 31 25 2c 64 74  |gs%,dt0%,dt1%,dt|
00018bf0  32 25 2c 62 64 72 25 29  0d 0c c4 26 ea 20 69 63  |2%,bdr%)...&. ic|
00018c00  25 2c 71 25 2c 74 65 78  74 24 2c 73 70 72 69 74  |%,q%,text$,sprit|
00018c10  65 24 2c 6d 69 6e 78 25  2c 6d 69 6e 79 25 0d 0c  |e$,minx%,miny%..|
00018c20  c5 20 71 25 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |. q%=.shell_Heap|
00018c30  42 6c 6f 63 6b 46 65 74  63 68 28 36 30 29 0d 0c  |BlockFetch(60)..|
00018c40  c6 0f 21 71 25 3d 68 61  6e 64 6c 65 25 0d 0c c7  |..!q%=handle%...|
00018c50  31 71 25 21 32 30 3d 66  6c 61 67 73 25 3a 71 25  |1q%!20=flags%:q%|
00018c60  21 32 34 3d 64 74 30 25  3a 71 25 21 32 38 3d 64  |!24=dt0%:q%!28=d|
00018c70  74 31 25 3a 71 25 21 33  32 3d 64 74 32 25 0d 0c  |t1%:q%!32=dt2%..|
00018c80  c8 17 74 65 78 74 24 3d  22 22 3a 73 70 72 69 74  |..text$="":sprit|
00018c90  65 24 3d 22 22 0d 0c c9  12 e7 20 66 6c 61 67 73  |e$=""..... flags|
00018ca0  25 20 80 20 31 20 8c 0d  0c ca 34 20 e7 20 66 6c  |% . 1 ....4 . fl|
00018cb0  61 67 73 25 20 80 20 26  31 30 30 20 74 65 78 74  |ags% . &100 text|
00018cc0  24 3d 24 28 71 25 21 32  34 29 20 8b 20 74 65 78  |$=$(q%!24) . tex|
00018cd0  74 24 3d 24 28 71 25 2b  32 34 29 0d 0c cb 05 cd  |t$=$(q%+24).....|
00018ce0  0d 0c cc 12 e7 20 66 6c  61 67 73 25 20 80 20 32  |..... flags% . 2|
00018cf0  20 8c 0d 0c cd 16 20 e7  20 66 6c 61 67 73 25 20  | ..... . flags% |
00018d00  80 20 26 31 30 30 20 8c  0d 0c ce 2e 20 20 73 70  |. &100 .....  sp|
00018d10  72 69 74 65 24 3d a4 73  68 65 6c 6c 5f 49 63 6f  |rite$=.shell_Ico|
00018d20  6e 47 65 74 43 6f 6d 6d  61 6e 64 28 71 25 21 32  |nGetCommand(q%!2|
00018d30  38 2c 22 53 22 29 0d 0c  cf 06 20 cc 0d 0c d0 16  |8,"S").... .....|
00018d40  20 20 73 70 72 69 74 65  24 3d 24 28 71 25 2b 32  |  sprite$=$(q%+2|
00018d50  34 29 0d 0c d1 06 20 cd  0d 0c d2 05 cd 0d 0c d3  |4).... .........|
00018d60  29 f2 73 68 65 6c 6c 5f  47 65 74 4d 69 6e 58 59  |).shell_GetMinXY|
00018d70  28 66 6c 61 67 73 25 2c  74 65 78 74 24 2c 73 70  |(flags%,text$,sp|
00018d80  72 69 74 65 24 29 0d 0c  d4 23 e7 20 78 31 25 2d  |rite$)...#. x1%-|
00018d90  78 30 25 3c 6d 69 6e 78  25 20 8c 20 78 31 25 3d  |x0%<minx% . x1%=|
00018da0  78 30 25 2b 6d 69 6e 78  25 0d 0c d5 23 e7 20 79  |x0%+minx%...#. y|
00018db0  31 25 2d 79 30 25 3c 6d  69 6e 79 25 20 8c 20 79  |1%-y0%<miny% . y|
00018dc0  31 25 3d 79 30 25 2b 6d  69 6e 79 25 0d 0c d6 29  |1%=y0%+miny%...)|
00018dd0  71 25 21 34 3d 78 30 25  3a 71 25 21 38 3d 79 30  |q%!4=x0%:q%!8=y0|
00018de0  25 3a 71 25 21 31 32 3d  78 31 25 3a 71 25 21 31  |%:q%!12=x1%:q%!1|
00018df0  36 3d 79 31 25 0d 0c d7  22 c8 99 20 22 57 69 6d  |6=y1%...".. "Wim|
00018e00  70 5f 43 72 65 61 74 65  49 63 6f 6e 22 2c 2c 71  |p_CreateIcon",,q|
00018e10  25 20 b8 20 69 63 25 0d  0c d8 47 c8 99 20 22 57  |% . ic%...G.. "W|
00018e20  69 6d 70 5f 46 6f 72 63  65 52 65 64 72 61 77 22  |imp_ForceRedraw"|
00018e30  2c 21 71 25 2c 71 25 21  34 2d 62 64 72 25 2c 71  |,!q%,q%!4-bdr%,q|
00018e40  25 21 38 2d 62 64 72 25  2c 71 25 21 31 32 2b 62  |%!8-bdr%,q%!12+b|
00018e50  64 72 25 2c 71 25 21 31  36 2b 62 64 72 25 0d 0c  |dr%,q%!16+bdr%..|
00018e60  d9 22 c8 99 20 22 57 69  6d 70 5f 47 65 74 43 61  |.".. "Wimp_GetCa|
00018e70  72 65 74 50 6f 73 69 74  69 6f 6e 22 2c 2c 71 25  |retPosition",,q%|
00018e80  0d 0c da 4b e7 20 21 71  25 3d 68 61 6e 64 6c 65  |...K. !q%=handle|
00018e90  25 3a e7 71 25 21 34 3d  69 63 25 3a c8 99 20 22  |%:.q%!4=ic%:.. "|
00018ea0  57 69 6d 70 5f 53 65 74  43 61 72 65 74 50 6f 73  |Wimp_SetCaretPos|
00018eb0  69 74 69 6f 6e 22 2c 68  61 6e 64 6c 65 25 2c 69  |ition",handle%,i|
00018ec0  63 25 2c 30 2c 30 2c 2d  31 2c 30 0d 0c db 1e f2  |c%,0,0,-1,0.....|
00018ed0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 52  |shell_HeapBlockR|
00018ee0  65 74 75 72 6e 28 71 25  29 0d 0c dc 08 3d 69 63  |eturn(q%)....=ic|
00018ef0  25 0d 0c dd 05 3a 0d 0c  de 1e 2a 7c 53 74 6f 70  |%....:....*|Stop|
00018f00  20 46 4e 73 68 65 6c 6c  5f 43 72 65 61 74 65 49  | FNshell_CreateI|
00018f10  63 6f 6e 32 0d 0c df 1e  2a 7c 53 74 61 72 74 20  |con2....*|Start |
00018f20  50 52 4f 43 73 68 65 6c  6c 5f 47 65 74 4d 69 6e  |PROCshell_GetMin|
00018f30  58 59 0d 0c e0 2b dd 20  f2 73 68 65 6c 6c 5f 47  |XY...+. .shell_G|
00018f40  65 74 4d 69 6e 58 59 28  66 6c 61 67 73 25 2c 74  |etMinXY(flags%,t|
00018f50  65 78 74 24 2c 73 70 72  69 74 65 24 29 0d 0c e1  |ext$,sprite$)...|
00018f60  1d ea 20 78 30 25 2c 79  30 25 2c 78 31 25 2c 79  |.. x0%,y0%,x1%,y|
00018f70  31 25 2c 6d 78 25 2c 6d  79 25 0d 0c e2 13 6d 69  |1%,mx%,my%....mi|
00018f80  6e 78 25 3d 30 3a 6d 69  6e 79 25 3d 30 0d 0c e3  |nx%=0:miny%=0...|
00018f90  1e e7 20 66 6c 61 67 73  25 80 26 30 31 20 80 20  |.. flags%.&01 . |
00018fa0  74 65 78 74 24 3c 3e 22  22 20 8c 0d 0c e4 14 20  |text$<>"" ..... |
00018fb0  20 e7 20 66 6c 61 67 73  25 80 26 34 30 20 8c 0d  | . flags%.&40 ..|
00018fc0  0c e5 35 20 20 20 20 20  20 20 c8 99 20 22 46 6f  |..5       .. "Fo|
00018fd0  6e 74 5f 52 65 61 64 49  6e 66 6f 22 2c 66 6c 61  |nt_ReadInfo",fla|
00018fe0  67 73 25 3e 3e 32 34 20  b8 20 2c 2c 79 30 25 2c  |gs%>>24 . ,,y0%,|
00018ff0  2c 79 31 25 0d 0c e6 44  20 20 20 20 20 20 20 c8  |,y1%...D       .|
00019000  99 20 22 46 6f 6e 74 5f  53 74 72 69 6e 67 42 42  |. "Font_StringBB|
00019010  6f 78 22 2c 2c bd 32 36  2b bd 28 66 6c 61 67 73  |ox",,.26+.(flags|
00019020  25 3e 3e 32 34 29 2b 74  65 78 74 24 20 b8 20 2c  |%>>24)+text$ . ,|
00019030  78 30 25 2c 2c 78 31 25  0d 0c e7 2c 20 20 20 20  |x0%,,x1%...,    |
00019040  20 20 20 c8 99 20 22 46  6f 6e 74 5f 43 6f 6e 76  |   .. "Font_Conv|
00019050  65 72 74 74 6f 4f 53 22  2c 2c 78 30 25 20 b8 20  |erttoOS",,x0% . |
00019060  2c 78 30 25 0d 0c e8 2c  20 20 20 20 20 20 20 c8  |,x0%...,       .|
00019070  99 20 22 46 6f 6e 74 5f  43 6f 6e 76 65 72 74 74  |. "Font_Convertt|
00019080  6f 4f 53 22 2c 2c 78 31  25 20 b8 20 2c 78 31 25  |oOS",,x1% . ,x1%|
00019090  0d 0c e9 26 20 20 20 20  20 20 20 6d 69 6e 78 25  |...&       minx%|
000190a0  3d 78 31 25 2d 78 30 25  3a 6d 69 6e 79 25 3d 79  |=x1%-x0%:miny%=y|
000190b0  31 25 2d 79 30 25 0d 0c  ea 26 20 20 cc 20 6d 69  |1%-y0%...&  . mi|
000190c0  6e 78 25 3d 36 2a 64 78  25 2b 31 36 2a a9 74 65  |nx%=6*dx%+16*.te|
000190d0  78 74 24 3a 6d 69 6e 79  25 3d 33 32 0d 0c eb 07  |xt$:miny%=32....|
000190e0  20 20 cd 0d 0c ec 1f 20  20 e7 20 66 6c 61 67 73  |  .....  . flags|
000190f0  25 80 26 30 34 20 6d 69  6e 79 25 2b 3d 32 2a 64  |%.&04 miny%+=2*d|
00019100  79 25 0d 0c ed 05 cd 0d  0c ee 20 e7 20 66 6c 61  |y%........ . fla|
00019110  67 73 25 80 26 30 32 20  80 20 73 70 72 69 74 65  |gs%.&02 . sprite|
00019120  24 3c 3e 22 22 20 8c 0d  0c ef 54 20 20 20 c8 99  |$<>"" ....T   ..|
00019130  20 22 58 4f 53 5f 53 70  72 69 74 65 4f 70 22 2c  | "XOS_SpriteOp",|
00019140  26 31 32 38 2c a4 73 68  65 6c 6c 5f 55 73 65 72  |&128,.shell_User|
00019150  53 70 72 69 74 65 73 42  61 73 65 2c 73 70 72 69  |SpritesBase,spri|
00019160  74 65 24 20 b8 20 2c 2c  2c 6d 78 25 2c 6d 79 25  |te$ . ,,,mx%,my%|
00019170  2c 2c 73 70 6d 25 20 3b  20 50 25 0d 0c f0 13 20  |,,spm% ; P%.... |
00019180  20 20 e7 20 28 50 25 80  31 29 3d 30 20 8c 0d 0c  |  . (P%.1)=0 ...|
00019190  f1 41 20 20 20 20 20 20  c8 99 20 22 58 4f 53 5f  |.A      .. "XOS_|
000191a0  52 65 61 64 4d 6f 64 65  56 61 72 69 61 62 6c 65  |ReadModeVariable|
000191b0  22 2c 73 70 6d 25 2c 34  20 b8 20 2c 2c 73 70 78  |",spm%,4 . ,,spx|
000191c0  25 3a 6d 78 25 3d 6d 78  25 3c 3c 73 70 78 25 0d  |%:mx%=mx%<<spx%.|
000191d0  0c f2 41 20 20 20 20 20  20 c8 99 20 22 58 4f 53  |..A      .. "XOS|
000191e0  5f 52 65 61 64 4d 6f 64  65 56 61 72 69 61 62 6c  |_ReadModeVariabl|
000191f0  65 22 2c 73 70 6d 25 2c  35 20 b8 20 2c 2c 73 70  |e",spm%,5 . ,,sp|
00019200  79 25 3a 6d 79 25 3d 6d  79 25 3c 3c 73 70 79 25  |y%:my%=my%<<spy%|
00019210  0d 0c f3 2b 20 20 20 20  20 20 e7 20 66 6c 61 67  |...+      . flag|
00019220  73 25 80 26 38 30 30 20  6d 78 25 3d 6d 78 25 2f  |s%.&800 mx%=mx%/|
00019230  32 3a 6d 79 25 3d 6d 79  25 2f 32 0d 0c f4 42 20  |2:my%=my%/2...B |
00019240  20 20 20 20 20 e7 20 28  66 6c 61 67 73 25 80 26  |     . (flags%.&|
00019250  32 31 42 29 3d 26 31 33  20 6d 78 25 3d 6d 69 6e  |21B)=&13 mx%=min|
00019260  78 25 2b 6d 78 25 20 3a  f4 20 73 70 72 69 74 65  |x%+mx% :. sprite|
00019270  2b 74 65 78 74 20 28 56  7e 48 7e 52 29 0d 0c f5  |+text (V~H~R)...|
00019280  1f 20 20 20 20 20 20 e7  20 6d 78 25 3e 6d 69 6e  |.      . mx%>min|
00019290  78 25 20 6d 69 6e 78 25  3d 6d 78 25 0d 0c f6 1f  |x% minx%=mx%....|
000192a0  20 20 20 20 20 20 e7 20  6d 79 25 3e 6d 69 6e 79  |      . my%>miny|
000192b0  25 20 6d 69 6e 79 25 3d  6d 79 25 0d 0c f7 08 20  |% miny%=my%.... |
000192c0  20 20 cd 0d 0c f8 05 cd  0d 0c f9 05 e1 0d 0c fa  |  ..............|
000192d0  05 3a 0d 0c fb 1d 2a 7c  53 74 6f 70 20 50 52 4f  |.:....*|Stop PRO|
000192e0  43 73 68 65 6c 6c 5f 47  65 74 4d 69 6e 58 59 0d  |Cshell_GetMinXY.|
000192f0  0c fc 22 2a 7c 53 74 61  72 74 20 46 4e 73 68 65  |.."*|Start FNshe|
00019300  6c 6c 5f 49 63 6f 6e 47  65 74 43 6f 6d 6d 61 6e  |ll_IconGetComman|
00019310  64 0d 0c fd 22 dd 20 a4  73 68 65 6c 6c 5f 49 63  |d...". .shell_Ic|
00019320  6f 6e 47 65 74 43 6f 6d  6d 61 6e 64 28 76 25 2c  |onGetCommand(v%,|
00019330  63 24 29 0d 0c fe 10 ea  20 49 25 2c 72 65 73 75  |c$)..... I%,resu|
00019340  6c 74 24 0d 0c ff 0d e7  20 76 25 3c 3d 30 20 8c  |lt$..... v%<=0 .|
00019350  0d 0d 00 10 20 20 72 65  73 75 6c 74 24 3d 22 22  |....  result$=""|
00019360  0d 0d 01 05 cc 0d 0d 02  49 20 20 49 25 3d a7 22  |........I  I%=."|
00019370  3b 22 2b a4 73 68 65 6c  6c 5f 53 74 72 69 6e 67  |;"+.shell_String|
00019380  55 70 70 65 72 43 61 73  65 28 24 76 25 29 2c 22  |UpperCase($v%),"|
00019390  3b 22 2b a4 73 68 65 6c  6c 5f 53 74 72 69 6e 67  |;"+.shell_String|
000193a0  55 70 70 65 72 43 61 73  65 28 63 24 29 29 0d 0d  |UpperCase(c$))..|
000193b0  03 0e 20 20 e7 20 49 25  3d 30 20 8c 0d 0d 04 12  |..  . I%=0 .....|
000193c0  20 20 20 20 72 65 73 75  6c 74 24 3d 22 22 0d 0d  |    result$=""..|
000193d0  05 07 20 20 cc 0d 0d 06  2f 20 20 20 20 72 65 73  |..  ..../    res|
000193e0  75 6c 74 24 3d c0 24 28  76 25 2b 49 25 29 2c a7  |ult$=.$(v%+I%),.|
000193f0  24 28 76 25 2b 49 25 29  2b 22 3b 22 2c 22 3b 22  |$(v%+I%)+";",";"|
00019400  29 2d 31 29 0d 0d 07 07  20 20 cd 0d 0d 08 05 cd  |)-1)....  ......|
00019410  0d 0d 09 0c 3d 72 65 73  75 6c 74 24 0d 0d 0a 05  |....=result$....|
00019420  3a 0d 0d 0b 21 2a 7c 53  74 6f 70 20 46 4e 73 68  |:...!*|Stop FNsh|
00019430  65 6c 6c 5f 49 63 6f 6e  47 65 74 43 6f 6d 6d 61  |ell_IconGetComma|
00019440  6e 64 0d 0d 0c 20 2a 7c  53 74 61 72 74 20 50 52  |nd... *|Start PR|
00019450  4f 43 73 68 65 6c 6c 5f  49 63 6f 6e 52 65 64 72  |OCshell_IconRedr|
00019460  61 77 0d 0d 0d 20 dd 20  f2 73 68 65 6c 6c 5f 49  |aw... . .shell_I|
00019470  63 6f 6e 52 65 64 72 61  77 28 77 68 25 2c 69 68  |conRedraw(wh%,ih|
00019480  25 29 0d 0d 0e 0a ea 20  62 6c 6b 25 0d 0d 0f 22  |%)..... blk%..."|
00019490  62 6c 6b 25 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |blk%=.shell_Heap|
000194a0  42 6c 6f 63 6b 46 65 74  63 68 28 34 30 29 0d 0d  |BlockFetch(40)..|
000194b0  10 18 21 62 6c 6b 25 3d  77 68 25 3a 62 6c 6b 25  |..!blk%=wh%:blk%|
000194c0  21 34 3d 69 68 25 0d 0d  11 20 c8 99 20 22 57 69  |!4=ih%... .. "Wi|
000194d0  6d 70 5f 47 65 74 49 63  6f 6e 53 74 61 74 65 22  |mp_GetIconState"|
000194e0  2c 2c 62 6c 6b 25 0d 0d  12 26 c8 99 20 22 49 6e  |,,blk%...&.. "In|
000194f0  74 65 72 66 61 63 65 5f  42 6f 75 6e 64 69 6e 67  |terface_Bounding|
00019500  42 6f 78 22 2c 2c 62 6c  6b 25 2b 38 0d 0d 13 3c  |Box",,blk%+8...<|
00019510  c8 99 20 22 57 69 6d 70  5f 46 6f 72 63 65 52 65  |.. "Wimp_ForceRe|
00019520  64 72 61 77 22 2c 77 68  25 2c 62 6c 6b 25 21 38  |draw",wh%,blk%!8|
00019530  2c 62 6c 6b 25 21 31 32  2c 62 6c 6b 25 21 31 36  |,blk%!12,blk%!16|
00019540  2c 62 6c 6b 25 21 32 30  0d 0d 14 2b f2 73 68 65  |,blk%!20...+.she|
00019550  6c 6c 5f 41 63 74 69 6f  6e 28 a4 73 68 65 6c 6c  |ll_Action(.shell|
00019560  5f 50 6f 6c 6c 5f 49 28  30 2c 5f 55 25 21 31 34  |_Poll_I(0,_U%!14|
00019570  38 29 29 0d 0d 15 20 f2  73 68 65 6c 6c 5f 48 65  |8))... .shell_He|
00019580  61 70 42 6c 6f 63 6b 52  65 74 75 72 6e 28 62 6c  |apBlockReturn(bl|
00019590  6b 25 29 0d 0d 16 05 e1  0d 0d 17 05 3a 0d 0d 18  |k%).........:...|
000195a0  1f 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  |.*|Stop PROCshel|
000195b0  6c 5f 49 63 6f 6e 52 65  64 72 61 77 0d 0d 19 25  |l_IconRedraw...%|
000195c0  2a 7c 53 74 61 72 74 20  46 4e 73 68 65 6c 6c 5f  |*|Start FNshell_|
000195d0  49 63 6f 6e 47 65 74 56  61 6c 69 64 61 74 69 6f  |IconGetValidatio|
000195e0  6e 0d 0d 1a 27 dd 20 a4  73 68 65 6c 6c 5f 49 63  |n...'. .shell_Ic|
000195f0  6f 6e 47 65 74 56 61 6c  69 64 61 74 69 6f 6e 28  |onGetValidation(|
00019600  77 68 25 2c 69 68 25 29  0d 0d 1b 1d ea 20 62 6c  |wh%,ih%)..... bl|
00019610  6b 25 2c 76 61 6c 69 64  61 74 69 6f 6e 24 2c 66  |k%,validation$,f|
00019620  6c 61 67 73 25 0d 0d 1c  12 e7 20 69 68 25 3d 2d  |lags%..... ih%=-|
00019630  31 20 8c 20 3d 22 22 0d  0d 1d 12 76 61 6c 69 64  |1 . =""....valid|
00019640  61 74 69 6f 6e 24 3d 22  22 0d 0d 1e 23 62 6c 6b  |ation$=""...#blk|
00019650  25 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |%=.shell_HeapBlo|
00019660  63 6b 46 65 74 63 68 28  31 30 30 29 0d 0d 1f 19  |ckFetch(100)....|
00019670  62 6c 6b 25 21 30 3d 77  68 25 3a 62 6c 6b 25 21  |blk%!0=wh%:blk%!|
00019680  34 3d 69 68 25 0d 0d 20  20 c8 99 20 22 57 69 6d  |4=ih%..  .. "Wim|
00019690  70 5f 47 65 74 49 63 6f  6e 53 74 61 74 65 22 2c  |p_GetIconState",|
000196a0  2c 62 6c 6b 25 0d 0d 21  2a f4 20 63 68 65 63 6b  |,blk%..!*. check|
000196b0  20 66 6c 61 67 73 20 66  69 72 73 74 20 74 6f 20  | flags first to |
000196c0  73 65 65 20 69 66 20 69  74 20 68 61 73 20 61 0d  |see if it has a.|
000196d0  0d 22 18 f4 20 76 61 6c  69 64 61 74 69 6f 6e 20  |.".. validation |
000196e0  73 74 72 69 6e 67 21 0d  0d 23 12 66 6c 61 67 73  |string!..#.flags|
000196f0  25 3d 62 6c 6b 25 21 32  34 0d 0d 24 15 e7 20 66  |%=blk%!24..$.. f|
00019700  6c 61 67 73 25 20 80 20  26 31 30 30 20 8c 0d 0d  |lags% . &100 ...|
00019710  25 2a 20 20 e7 20 62 6c  6b 25 21 33 32 3e 30 20  |%*  . blk%!32>0 |
00019720  8c 20 76 61 6c 69 64 61  74 69 6f 6e 24 3d 24 28  |. validation$=$(|
00019730  62 6c 6b 25 21 33 32 29  0d 0d 26 05 cd 0d 0d 27  |blk%!32)..&....'|
00019740  20 f2 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
00019750  6b 52 65 74 75 72 6e 28  62 6c 6b 25 29 0d 0d 28  |kReturn(blk%)..(|
00019760  10 3d 76 61 6c 69 64 61  74 69 6f 6e 24 0d 0d 29  |.=validation$..)|
00019770  05 3a 0d 0d 2a 24 2a 7c  53 74 6f 70 20 46 4e 73  |.:..*$*|Stop FNs|
00019780  68 65 6c 6c 5f 49 63 6f  6e 47 65 74 56 61 6c 69  |hell_IconGetVali|
00019790  64 61 74 69 6f 6e 0d 0d  2b 27 2a 7c 53 74 61 72  |dation..+'*|Star|
000197a0  74 20 50 52 4f 43 73 68  65 6c 6c 5f 49 63 6f 6e  |t PROCshell_Icon|
000197b0  50 75 74 56 61 6c 69 64  61 74 69 6f 6e 0d 0d 2c  |PutValidation..,|
000197c0  2e dd 20 f2 73 68 65 6c  6c 5f 49 63 6f 6e 50 75  |.. .shell_IconPu|
000197d0  74 56 61 6c 69 64 61 74  69 6f 6e 28 77 68 25 2c  |tValidation(wh%,|
000197e0  69 68 25 2c 76 61 6c 69  64 24 29 0d 0d 2d 11 ea  |ih%,valid$)..-..|
000197f0  20 62 6c 6b 25 2c 66 6c  61 67 73 25 0d 0d 2e 23  | blk%,flags%...#|
00019800  62 6c 6b 25 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |blk%=.shell_Heap|
00019810  42 6c 6f 63 6b 46 65 74  63 68 28 31 30 30 29 0d  |BlockFetch(100).|
00019820  0d 2f 19 62 6c 6b 25 21  30 3d 77 68 25 3a 62 6c  |./.blk%!0=wh%:bl|
00019830  6b 25 21 34 3d 69 68 25  0d 0d 30 20 c8 99 20 22  |k%!4=ih%..0 .. "|
00019840  57 69 6d 70 5f 47 65 74  49 63 6f 6e 53 74 61 74  |Wimp_GetIconStat|
00019850  65 22 2c 2c 62 6c 6b 25  0d 0d 31 12 66 6c 61 67  |e",,blk%..1.flag|
00019860  73 25 3d 62 6c 6b 25 21  32 34 0d 0d 32 15 e7 20  |s%=blk%!24..2.. |
00019870  66 6c 61 67 73 25 20 80  20 26 31 30 30 20 8c 0d  |flags% . &100 ..|
00019880  0d 33 17 20 20 24 28 62  6c 6b 25 21 33 32 29 3d  |.3.  $(blk%!32)=|
00019890  76 61 6c 69 64 24 0d 0d  34 05 cd 0d 0d 35 20 f2  |valid$..4....5 .|
000198a0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 52  |shell_HeapBlockR|
000198b0  65 74 75 72 6e 28 62 6c  6b 25 29 0d 0d 36 05 e1  |eturn(blk%)..6..|
000198c0  0d 0d 37 05 3a 0d 0d 38  26 2a 7c 53 74 6f 70 20  |..7.:..8&*|Stop |
000198d0  50 52 4f 43 73 68 65 6c  6c 5f 49 63 6f 6e 50 75  |PROCshell_IconPu|
000198e0  74 56 61 6c 69 64 61 74  69 6f 6e 0d 0d 39 22 2a  |tValidation..9"*|
000198f0  7c 53 74 61 72 74 20 46  4e 73 68 65 6c 6c 5f 49  ||Start FNshell_I|
00019900  73 49 63 6f 6e 53 65 6c  65 63 74 65 64 0d 0d 3a  |sIconSelected..:|
00019910  36 dd 20 a4 73 68 65 6c  6c 5f 49 73 49 63 6f 6e  |6. .shell_IsIcon|
00019920  53 65 6c 65 63 74 65 64  28 57 69 6e 64 6f 77 48  |Selected(WindowH|
00019930  61 6e 64 6c 65 25 2c 49  63 6f 6e 48 61 6e 64 6c  |andle%,IconHandl|
00019940  65 25 29 0d 0d 3b 0b ea  20 74 65 6d 70 25 0d 0d  |e%)..;.. temp%..|
00019950  3c 32 f2 73 68 65 6c 6c  5f 49 63 6f 6e 47 65 74  |<2.shell_IconGet|
00019960  53 74 61 74 65 28 57 69  6e 64 6f 77 48 61 6e 64  |State(WindowHand|
00019970  6c 65 25 2c 49 63 6f 6e  48 61 6e 64 6c 65 25 29  |le%,IconHandle%)|
00019980  0d 0d 3d 11 66 6c 61 67  73 25 3d 5f 51 25 21 32  |..=.flags%=_Q%!2|
00019990  34 0d 0d 3e 1c 74 65 6d  70 25 3d 28 66 6c 61 67  |4..>.temp%=(flag|
000199a0  73 25 20 80 20 26 32 30  30 30 30 30 29 0d 0d 3f  |s% . &200000)..?|
000199b0  12 e7 20 74 65 6d 70 25  3d 30 20 8c 20 3d a3 0d  |.. temp%=0 . =..|
000199c0  0d 40 06 3d b9 0d 0d 41  05 3a 0d 0d 42 21 2a 7c  |.@.=...A.:..B!*||
000199d0  53 74 6f 70 20 46 4e 73  68 65 6c 6c 5f 49 73 49  |Stop FNshell_IsI|
000199e0  63 6f 6e 53 65 6c 65 63  74 65 64 0d 0d 43 04 0d  |conSelected..C..|
000199f0  0d 44 20 2a 7c 53 74 61  72 74 20 50 52 4f 43 73  |.D *|Start PROCs|
00019a00  68 65 6c 6c 5f 49 63 6f  6e 53 65 6c 65 63 74 0d  |hell_IconSelect.|
00019a10  0d 45 32 dd 20 f2 73 68  65 6c 6c 5f 49 63 6f 6e  |.E2. .shell_Icon|
00019a20  53 65 6c 65 63 74 28 57  69 6e 64 6f 77 48 61 6e  |Select(WindowHan|
00019a30  64 6c 65 25 2c 49 63 6f  6e 48 61 6e 64 6c 65 25  |dle%,IconHandle%|
00019a40  29 0d 0d 46 42 f2 73 68  65 6c 6c 5f 49 63 6f 6e  |)..FB.shell_Icon|
00019a50  53 65 74 53 74 61 74 65  28 57 69 6e 64 6f 77 48  |SetState(WindowH|
00019a60  61 6e 64 6c 65 25 2c 49  63 6f 6e 48 61 6e 64 6c  |andle%,IconHandl|
00019a70  65 25 2c 26 32 30 30 30  30 30 2c 26 32 30 30 30  |e%,&200000,&2000|
00019a80  30 30 29 0d 0d 47 05 e1  0d 0d 48 05 3a 0d 0d 49  |00)..G....H.:..I|
00019a90  1f 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  |.*|Stop PROCshel|
00019aa0  6c 5f 49 63 6f 6e 53 65  6c 65 63 74 0d 0d 4a 04  |l_IconSelect..J.|
00019ab0  0d 0d 4b 22 2a 7c 53 74  61 72 74 20 50 52 4f 43  |..K"*|Start PROC|
00019ac0  73 68 65 6c 6c 5f 49 63  6f 6e 44 65 73 65 6c 65  |shell_IconDesele|
00019ad0  63 74 0d 0d 4c 34 dd 20  f2 73 68 65 6c 6c 5f 49  |ct..L4. .shell_I|
00019ae0  63 6f 6e 44 65 73 65 6c  65 63 74 28 57 69 6e 64  |conDeselect(Wind|
00019af0  6f 77 48 61 6e 64 6c 65  25 2c 49 63 6f 6e 48 61  |owHandle%,IconHa|
00019b00  6e 64 6c 65 25 29 0d 0d  4d 3c f2 73 68 65 6c 6c  |ndle%)..M<.shell|
00019b10  5f 49 63 6f 6e 53 65 74  53 74 61 74 65 28 57 69  |_IconSetState(Wi|
00019b20  6e 64 6f 77 48 61 6e 64  6c 65 25 2c 49 63 6f 6e  |ndowHandle%,Icon|
00019b30  48 61 6e 64 6c 65 25 2c  30 2c 26 32 30 30 30 30  |Handle%,0,&20000|
00019b40  30 29 0d 0d 4e 05 e1 0d  0d 4f 05 3a 0d 0d 50 21  |0)..N....O.:..P!|
00019b50  2a 7c 53 74 6f 70 20 50  52 4f 43 73 68 65 6c 6c  |*|Stop PROCshell|
00019b60  5f 49 63 6f 6e 44 65 73  65 6c 65 63 74 0d 0d 51  |_IconDeselect..Q|
00019b70  04 0d 0d 52 22 2a 7c 53  74 61 72 74 20 50 52 4f  |...R"*|Start PRO|
00019b80  43 73 68 65 6c 6c 5f 49  63 6f 6e 47 65 74 53 74  |Cshell_IconGetSt|
00019b90  61 74 65 0d 0d 53 34 dd  20 f2 73 68 65 6c 6c 5f  |ate..S4. .shell_|
00019ba0  49 63 6f 6e 47 65 74 53  74 61 74 65 28 57 69 6e  |IconGetState(Win|
00019bb0  64 6f 77 48 61 6e 64 6c  65 25 2c 49 63 6f 6e 48  |dowHandle%,IconH|
00019bc0  61 6e 64 6c 65 25 29 0d  0d 54 16 21 5f 51 25 3d  |andle%)..T.!_Q%=|
00019bd0  57 69 6e 64 6f 77 48 61  6e 64 6c 65 25 0d 0d 55  |WindowHandle%..U|
00019be0  15 5f 51 25 21 34 3d 49  63 6f 6e 48 61 6e 64 6c  |._Q%!4=IconHandl|
00019bf0  65 25 0d 0d 56 1f c8 99  20 22 57 69 6d 70 5f 47  |e%..V... "Wimp_G|
00019c00  65 74 49 63 6f 6e 53 74  61 74 65 22 2c 2c 5f 51  |etIconState",,_Q|
00019c10  25 0d 0d 57 05 e1 0d 0d  58 05 3a 0d 0d 59 21 2a  |%..W....X.:..Y!*|
00019c20  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
00019c30  49 63 6f 6e 47 65 74 53  74 61 74 65 0d 0d 5a 04  |IconGetState..Z.|
00019c40  0d 0d 5b 25 2a 7c 53 74  61 72 74 20 50 52 4f 43  |..[%*|Start PROC|
00019c50  73 68 65 6c 6c 5f 49 63  6f 6e 53 65 74 53 65 6c  |shell_IconSetSel|
00019c60  65 63 74 65 64 0d 0d 5c  2c dd 20 f2 73 68 65 6c  |ected..\,. .shel|
00019c70  6c 5f 49 63 6f 6e 53 65  74 53 65 6c 65 63 74 65  |l_IconSetSelecte|
00019c80  64 28 77 68 25 2c 69 68  25 2c 73 74 61 74 65 25  |d(wh%,ih%,state%|
00019c90  29 0d 0d 5d 10 e7 20 73  74 61 74 65 25 3d 30 20  |)..].. state%=0 |
00019ca0  8c 0d 0d 5e 22 20 20 f2  73 68 65 6c 6c 5f 49 63  |...^"  .shell_Ic|
00019cb0  6f 6e 44 65 73 65 6c 65  63 74 28 77 68 25 2c 69  |onDeselect(wh%,i|
00019cc0  68 25 29 0d 0d 5f 05 cc  0d 0d 60 20 20 20 f2 73  |h%).._....`   .s|
00019cd0  68 65 6c 6c 5f 49 63 6f  6e 53 65 6c 65 63 74 28  |hell_IconSelect(|
00019ce0  77 68 25 2c 69 68 25 29  0d 0d 61 05 cd 0d 0d 62  |wh%,ih%)..a....b|
00019cf0  05 e1 0d 0d 63 05 3a 0d  0d 64 24 2a 7c 53 74 6f  |....c.:..d$*|Sto|
00019d00  70 20 50 52 4f 43 73 68  65 6c 6c 5f 49 63 6f 6e  |p PROCshell_Icon|
00019d10  53 65 74 53 65 6c 65 63  74 65 64 0d 0d 65 04 0d  |SetSelected..e..|
00019d20  0d 66 1d 2a 7c 53 74 61  72 74 20 50 52 4f 43 73  |.f.*|Start PROCs|
00019d30  68 65 6c 6c 5f 49 63 6f  6e 53 65 74 0d 0d 67 24  |hell_IconSet..g$|
00019d40  dd 20 f2 73 68 65 6c 6c  5f 49 63 6f 6e 53 65 74  |. .shell_IconSet|
00019d50  28 77 68 25 2c 69 68 25  2c 73 74 61 74 65 25 29  |(wh%,ih%,state%)|
00019d60  0d 0d 68 10 e7 20 73 74  61 74 65 25 3d 30 20 8c  |..h.. state%=0 .|
00019d70  0d 0d 69 22 20 20 f2 73  68 65 6c 6c 5f 49 63 6f  |..i"  .shell_Ico|
00019d80  6e 44 65 73 65 6c 65 63  74 28 77 68 25 2c 69 68  |nDeselect(wh%,ih|
00019d90  25 29 0d 0d 6a 05 cc 0d  0d 6b 20 20 20 f2 73 68  |%)..j....k   .sh|
00019da0  65 6c 6c 5f 49 63 6f 6e  53 65 6c 65 63 74 28 77  |ell_IconSelect(w|
00019db0  68 25 2c 69 68 25 29 0d  0d 6c 05 cd 0d 0d 6d 05  |h%,ih%)..l....m.|
00019dc0  e1 0d 0d 6e 05 3a 0d 0d  6f 1c 2a 7c 53 74 6f 70  |...n.:..o.*|Stop|
00019dd0  20 50 52 4f 43 73 68 65  6c 6c 5f 49 63 6f 6e 53  | PROCshell_IconS|
00019de0  65 74 0d 0d 70 22 2a 7c  53 74 61 72 74 20 50 52  |et..p"*|Start PR|
00019df0  4f 43 73 68 65 6c 6c 5f  49 63 6f 6e 53 65 74 53  |OCshell_IconSetS|
00019e00  74 61 74 65 0d 0d 71 48  dd 20 f2 73 68 65 6c 6c  |tate..qH. .shell|
00019e10  5f 49 63 6f 6e 53 65 74  53 74 61 74 65 28 57 69  |_IconSetState(Wi|
00019e20  6e 64 6f 77 48 61 6e 64  6c 65 25 2c 49 63 6f 6e  |ndowHandle%,Icon|
00019e30  48 61 6e 64 6c 65 25 2c  45 6f 72 57 6f 72 64 25  |Handle%,EorWord%|
00019e40  2c 43 6c 65 61 72 57 6f  72 64 25 29 0d 0d 72 0f  |,ClearWord%)..r.|
00019e50  ea 20 69 63 6f 6e 5f 62  6c 6b 25 0d 0d 73 27 69  |. icon_blk%..s'i|
00019e60  63 6f 6e 5f 62 6c 6b 25  3d a4 73 68 65 6c 6c 5f  |con_blk%=.shell_|
00019e70  48 65 61 70 42 6c 6f 63  6b 46 65 74 63 68 28 31  |HeapBlockFetch(1|
00019e80  36 29 0d 0d 74 1c 21 69  63 6f 6e 5f 62 6c 6b 25  |6)..t.!icon_blk%|
00019e90  3d 57 69 6e 64 6f 77 48  61 6e 64 6c 65 25 0d 0d  |=WindowHandle%..|
00019ea0  75 1c 69 63 6f 6e 5f 62  6c 6b 25 21 30 34 3d 49  |u.icon_blk%!04=I|
00019eb0  63 6f 6e 48 61 6e 64 6c  65 25 0d 0d 76 19 69 63  |conHandle%..v.ic|
00019ec0  6f 6e 5f 62 6c 6b 25 21  30 38 3d 45 6f 72 57 6f  |on_blk%!08=EorWo|
00019ed0  72 64 25 0d 0d 77 1b 69  63 6f 6e 5f 62 6c 6b 25  |rd%..w.icon_blk%|
00019ee0  21 31 32 3d 43 6c 65 61  72 57 6f 72 64 25 0d 0d  |!12=ClearWord%..|
00019ef0  78 25 c8 99 20 22 57 69  6d 70 5f 53 65 74 49 63  |x%.. "Wimp_SetIc|
00019f00  6f 6e 53 74 61 74 65 22  2c 2c 69 63 6f 6e 5f 62  |onState",,icon_b|
00019f10  6c 6b 25 0d 0d 79 25 f2  73 68 65 6c 6c 5f 48 65  |lk%..y%.shell_He|
00019f20  61 70 42 6c 6f 63 6b 52  65 74 75 72 6e 28 69 63  |apBlockReturn(ic|
00019f30  6f 6e 5f 62 6c 6b 25 29  0d 0d 7a 05 e1 0d 0d 7b  |on_blk%)..z....{|
00019f40  05 3a 0d 0d 7c 21 2a 7c  53 74 6f 70 20 50 52 4f  |.:..|!*|Stop PRO|
00019f50  43 73 68 65 6c 6c 5f 49  63 6f 6e 53 65 74 53 74  |Cshell_IconSetSt|
00019f60  61 74 65 0d 0d 7d 26 2a  7c 53 74 61 72 74 20 50  |ate..}&*|Start P|
00019f70  52 4f 43 73 68 65 6c 6c  5f 49 63 6f 6e 55 6e 73  |ROCshell_IconUns|
00019f80  65 6c 65 63 74 61 62 6c  65 0d 0d 7e 2c dd 20 f2  |electable..~,. .|
00019f90  73 68 65 6c 6c 5f 49 63  6f 6e 55 6e 73 65 6c 65  |shell_IconUnsele|
00019fa0  63 74 61 62 6c 65 28 68  61 6e 64 6c 65 25 2c 69  |ctable(handle%,i|
00019fb0  63 6f 6e 25 29 0d 0d 7f  35 f2 73 68 65 6c 6c 5f  |con%)...5.shell_|
00019fc0  49 63 6f 6e 53 65 74 53  74 61 74 65 28 68 61 6e  |IconSetState(han|
00019fd0  64 6c 65 25 2c 69 63 6f  6e 25 2c 26 34 30 30 30  |dle%,icon%,&4000|
00019fe0  30 30 2c 26 34 30 30 30  30 29 0d 0d 80 05 e1 0d  |00,&40000)......|
00019ff0  0d 81 05 3a 0d 0d 82 25  2a 7c 53 74 6f 70 20 50  |...:...%*|Stop P|
0001a000  52 4f 43 73 68 65 6c 6c  5f 49 63 6f 6e 55 6e 73  |ROCshell_IconUns|
0001a010  65 6c 65 63 74 61 62 6c  65 0d 0d 83 25 2a 7c 53  |electable...%*|S|
0001a020  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 49  |tart PROCshell_I|
0001a030  63 6f 6e 53 65 74 42 47  43 6f 6c 6f 75 72 0d 0d  |conSetBGColour..|
0001a040  84 2a dd 20 f2 73 68 65  6c 6c 5f 49 63 6f 6e 53  |.*. .shell_IconS|
0001a050  65 74 42 47 43 6f 6c 6f  75 72 28 77 68 25 2c 69  |etBGColour(wh%,i|
0001a060  68 25 2c 63 6f 6c 25 29  0d 0d 85 5c e7 20 63 6f  |h%,col%)...\. co|
0001a070  6c 25 3c 30 20 84 20 63  6f 6c 25 3e 31 35 20 8c  |l%<0 . col%>15 .|
0001a080  20 85 20 39 39 2c a4 73  68 65 6c 6c 5f 4d 65 73  | . 99,.shell_Mes|
0001a090  73 61 67 65 4f 6e 65 41  72 67 28 22 53 48 45 4c  |sageOneArg("SHEL|
0001a0a0  4c 4d 53 47 32 34 22 2c  22 50 52 4f 43 73 68 65  |LMSG24","PROCshe|
0001a0b0  6c 6c 5f 49 63 6f 6e 53  65 74 42 47 43 6f 6c 6f  |ll_IconSetBGColo|
0001a0c0  75 72 22 29 0d 0d 86 33  f2 73 68 65 6c 6c 5f 49  |ur")...3.shell_I|
0001a0d0  63 6f 6e 53 65 74 53 74  61 74 65 28 77 68 25 2c  |conSetState(wh%,|
0001a0e0  69 68 25 2c 63 6f 6c 25  3c 3c 32 38 2c 26 46 30  |ih%,col%<<28,&F0|
0001a0f0  30 30 30 30 30 30 29 0d  0d 87 05 e1 0d 0d 88 05  |000000).........|
0001a100  3a 0d 0d 89 24 2a 7c 53  74 6f 70 20 50 52 4f 43  |:...$*|Stop PROC|
0001a110  73 68 65 6c 6c 5f 49 63  6f 6e 53 65 74 42 47 43  |shell_IconSetBGC|
0001a120  6f 6c 6f 75 72 0d 0d 8a  25 2a 7c 53 74 61 72 74  |olour...%*|Start|
0001a130  20 50 52 4f 43 73 68 65  6c 6c 5f 49 63 6f 6e 53  | PROCshell_IconS|
0001a140  65 74 46 47 43 6f 6c 6f  75 72 0d 0d 8b 2a dd 20  |etFGColour...*. |
0001a150  f2 73 68 65 6c 6c 5f 49  63 6f 6e 53 65 74 46 47  |.shell_IconSetFG|
0001a160  43 6f 6c 6f 75 72 28 77  68 25 2c 69 68 25 2c 63  |Colour(wh%,ih%,c|
0001a170  6f 6c 25 29 0d 0d 8c 5c  e7 20 63 6f 6c 25 3c 30  |ol%)...\. col%<0|
0001a180  20 84 20 63 6f 6c 25 3e  31 35 20 8c 20 85 20 39  | . col%>15 . . 9|
0001a190  39 2c a4 73 68 65 6c 6c  5f 4d 65 73 73 61 67 65  |9,.shell_Message|
0001a1a0  4f 6e 65 41 72 67 28 22  53 48 45 4c 4c 4d 53 47  |OneArg("SHELLMSG|
0001a1b0  32 34 22 2c 22 50 52 4f  43 73 68 65 6c 6c 5f 49  |24","PROCshell_I|
0001a1c0  63 6f 6e 53 65 74 46 47  43 6f 6c 6f 75 72 22 29  |conSetFGColour")|
0001a1d0  0d 0d 8d 33 f2 73 68 65  6c 6c 5f 49 63 6f 6e 53  |...3.shell_IconS|
0001a1e0  65 74 53 74 61 74 65 28  77 68 25 2c 69 68 25 2c  |etState(wh%,ih%,|
0001a1f0  63 6f 6c 25 3c 3c 32 34  2c 26 30 46 30 30 30 30  |col%<<24,&0F0000|
0001a200  30 30 29 0d 0d 8e 05 e1  0d 0d 8f 05 3a 0d 0d 90  |00).........:...|
0001a210  24 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  |$*|Stop PROCshel|
0001a220  6c 5f 49 63 6f 6e 53 65  74 46 47 43 6f 6c 6f 75  |l_IconSetFGColou|
0001a230  72 0d 0d 91 04 0d 0d 92  26 2a 7c 53 74 61 72 74  |r.......&*|Start|
0001a240  20 50 52 4f 43 73 68 65  6c 6c 5f 43 61 72 65 74  | PROCshell_Caret|
0001a250  53 65 74 50 6f 73 69 74  69 6f 6e 0d 0d 93 4b dd  |SetPosition...K.|
0001a260  20 f2 73 68 65 6c 6c 5f  43 61 72 65 74 53 65 74  | .shell_CaretSet|
0001a270  50 6f 73 69 74 69 6f 6e  28 77 68 61 6e 64 6c 65  |Position(whandle|
0001a280  25 2c 69 68 61 6e 64 6c  65 25 2c 78 6f 66 66 25  |%,ihandle%,xoff%|
0001a290  2c 79 6f 66 66 25 2c 68  65 69 67 68 74 25 2c 69  |,yoff%,height%,i|
0001a2a0  6e 64 65 78 25 29 0d 0d  94 4b c8 99 20 22 57 69  |ndex%)...K.. "Wi|
0001a2b0  6d 70 5f 53 65 74 43 61  72 65 74 50 6f 73 69 74  |mp_SetCaretPosit|
0001a2c0  69 6f 6e 22 2c 77 68 61  6e 64 6c 65 25 2c 69 68  |ion",whandle%,ih|
0001a2d0  61 6e 64 6c 65 25 2c 78  6f 66 66 25 2c 79 6f 66  |andle%,xoff%,yof|
0001a2e0  66 25 2c 68 65 69 67 68  74 25 2c 69 6e 64 65 78  |f%,height%,index|
0001a2f0  25 0d 0d 95 05 e1 0d 0d  96 05 3a 0d 0d 97 25 2a  |%.........:...%*|
0001a300  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
0001a310  43 61 72 65 74 53 65 74  50 6f 73 69 74 69 6f 6e  |CaretSetPosition|
0001a320  0d 0d 98 04 0d 0d 99 27  2a 7c 53 74 61 72 74 20  |.......'*|Start |
0001a330  50 52 4f 43 73 68 65 6c  6c 5f 49 63 6f 6e 53 65  |PROCshell_IconSe|
0001a340  74 42 75 74 74 6f 6e 54  79 70 65 0d 0d 9a 34 dd  |tButtonType...4.|
0001a350  20 f2 73 68 65 6c 6c 5f  49 63 6f 6e 53 65 74 42  | .shell_IconSetB|
0001a360  75 74 74 6f 6e 54 79 70  65 28 77 68 25 2c 69 68  |uttonType(wh%,ih|
0001a370  25 2c 62 75 74 74 6f 6e  5f 74 79 70 65 25 29 0d  |%,button_type%).|
0001a380  0d 9b 6f e7 20 62 75 74  74 6f 6e 5f 74 79 70 65  |..o. button_type|
0001a390  25 3d 31 32 20 84 20 62  75 74 74 6f 6e 5f 74 79  |%=12 . button_ty|
0001a3a0  70 65 25 3d 31 33 20 8c  20 85 20 39 39 2c a4 73  |pe%=13 . . 99,.s|
0001a3b0  68 65 6c 6c 5f 4d 65 73  73 61 67 65 4f 6e 65 41  |hell_MessageOneA|
0001a3c0  72 67 28 22 53 48 45 4c  4c 4d 53 47 32 33 22 2c  |rg("SHELLMSG23",|
0001a3d0  22 50 52 4f 43 73 68 65  6c 6c 5f 49 63 6f 6e 53  |"PROCshell_IconS|
0001a3e0  65 74 42 75 74 74 6f 6e  54 79 70 65 22 29 0d 0d  |etButtonType")..|
0001a3f0  9c 6e e7 20 62 75 74 74  6f 6e 5f 74 79 70 65 25  |.n. button_type%|
0001a400  3c 30 20 84 20 62 75 74  74 6f 6e 5f 74 79 70 65  |<0 . button_type|
0001a410  25 3e 31 35 20 8c 20 85  20 39 39 2c a4 73 68 65  |%>15 . . 99,.she|
0001a420  6c 6c 5f 4d 65 73 73 61  67 65 4f 6e 65 41 72 67  |ll_MessageOneArg|
0001a430  28 22 53 48 45 4c 4c 4d  53 47 32 32 22 2c 22 50  |("SHELLMSG22","P|
0001a440  52 4f 43 73 68 65 6c 6c  5f 49 63 6f 6e 53 65 74  |ROCshell_IconSet|
0001a450  42 75 74 74 6f 6e 54 79  70 65 22 29 0d 0d 9d 37  |ButtonType")...7|
0001a460  f2 73 68 65 6c 6c 5f 49  63 6f 6e 53 65 74 53 74  |.shell_IconSetSt|
0001a470  61 74 65 28 77 68 25 2c  69 68 25 2c 62 75 74 74  |ate(wh%,ih%,butt|
0001a480  6f 6e 5f 74 79 70 65 25  3c 3c 31 32 2c 26 46 30  |on_type%<<12,&F0|
0001a490  30 30 29 0d 0d 9e 05 e1  0d 0d 9f 05 3a 0d 0d a0  |00).........:...|
0001a4a0  26 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  |&*|Stop PROCshel|
0001a4b0  6c 5f 49 63 6f 6e 53 65  74 42 75 74 74 6f 6e 54  |l_IconSetButtonT|
0001a4c0  79 70 65 0d 0d a1 20 2a  7c 53 74 61 72 74 20 50  |ype... *|Start P|
0001a4d0  52 4f 43 73 68 65 6c 6c  5f 49 63 6f 6e 53 65 74  |ROCshell_IconSet|
0001a4e0  45 53 47 0d 0d a2 25 dd  20 f2 73 68 65 6c 6c 5f  |ESG...%. .shell_|
0001a4f0  49 63 6f 6e 53 65 74 45  53 47 28 77 68 25 2c 69  |IconSetESG(wh%,i|
0001a500  68 25 2c 65 73 67 25 29  0d 0d a3 57 e7 20 65 73  |h%,esg%)...W. es|
0001a510  67 25 3c 30 20 84 20 65  73 67 25 3e 33 31 20 8c  |g%<0 . esg%>31 .|
0001a520  20 85 20 39 39 2c a4 73  68 65 6c 6c 5f 4d 65 73  | . 99,.shell_Mes|
0001a530  73 61 67 65 4f 6e 65 41  72 67 28 22 53 48 45 4c  |sageOneArg("SHEL|
0001a540  4c 4d 53 47 32 35 22 2c  22 50 52 4f 43 73 68 65  |LMSG25","PROCshe|
0001a550  6c 6c 5f 49 63 6f 6e 53  65 74 45 53 47 22 29 0d  |ll_IconSetESG").|
0001a560  0d a4 31 f2 73 68 65 6c  6c 5f 49 63 6f 6e 53 65  |..1.shell_IconSe|
0001a570  74 53 74 61 74 65 28 77  68 25 2c 69 68 25 2c 65  |tState(wh%,ih%,e|
0001a580  73 67 25 3c 3c 31 36 2c  26 31 46 30 30 30 30 29  |sg%<<16,&1F0000)|
0001a590  0d 0d a5 05 e1 0d 0d a6  05 3a 0d 0d a7 1f 2a 7c  |.........:....*||
0001a5a0  53 74 6f 70 20 50 52 4f  43 73 68 65 6c 6c 5f 49  |Stop PROCshell_I|
0001a5b0  63 6f 6e 53 65 74 45 53  47 0d 0d a8 04 0d 0d a9  |conSetESG.......|
0001a5c0  21 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |!*|Start PROCshe|
0001a5d0  6c 6c 5f 49 63 6f 6e 53  65 74 54 65 78 74 0d 0d  |ll_IconSetText..|
0001a5e0  aa 29 dd 20 f2 73 68 65  6c 6c 5f 49 63 6f 6e 53  |.). .shell_IconS|
0001a5f0  65 74 54 65 78 74 28 77  68 25 2c 69 68 25 2c 61  |etText(wh%,ih%,a|
0001a600  63 74 69 6f 6e 25 29 0d  0d ab 1f e7 20 61 63 74  |ction%)..... act|
0001a610  69 6f 6e 25 3c 3e 30 20  8c 20 61 63 74 69 6f 6e  |ion%<>0 . action|
0001a620  25 3d 31 3c 3c 30 0d 0d  ac 2d f2 73 68 65 6c 6c  |%=1<<0...-.shell|
0001a630  5f 49 63 6f 6e 53 65 74  53 74 61 74 65 28 77 68  |_IconSetState(wh|
0001a640  25 2c 69 68 25 2c 61 63  74 69 6f 6e 25 2c 31 3c  |%,ih%,action%,1<|
0001a650  3c 30 29 0d 0d ad 05 e1  0d 0d ae 05 3a 0d 0d af  |<0).........:...|
0001a660  20 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  | *|Stop PROCshel|
0001a670  6c 5f 49 63 6f 6e 53 65  74 54 65 78 74 0d 0d b0  |l_IconSetText...|
0001a680  04 0d 0d b1 23 2a 7c 53  74 61 72 74 20 50 52 4f  |....#*|Start PRO|
0001a690  43 73 68 65 6c 6c 5f 49  63 6f 6e 53 65 74 53 70  |Cshell_IconSetSp|
0001a6a0  72 69 74 65 0d 0d b2 2b  dd 20 f2 73 68 65 6c 6c  |rite...+. .shell|
0001a6b0  5f 49 63 6f 6e 53 65 74  53 70 72 69 74 65 28 77  |_IconSetSprite(w|
0001a6c0  68 25 2c 69 68 25 2c 61  63 74 69 6f 6e 25 29 0d  |h%,ih%,action%).|
0001a6d0  0d b3 1f e7 20 61 63 74  69 6f 6e 25 3c 3e 30 20  |.... action%<>0 |
0001a6e0  8c 20 61 63 74 69 6f 6e  25 3d 31 3c 3c 31 0d 0d  |. action%=1<<1..|
0001a6f0  b4 2d f2 73 68 65 6c 6c  5f 49 63 6f 6e 53 65 74  |.-.shell_IconSet|
0001a700  53 74 61 74 65 28 77 68  25 2c 69 68 25 2c 61 63  |State(wh%,ih%,ac|
0001a710  74 69 6f 6e 25 2c 31 3c  3c 31 29 0d 0d b5 05 e1  |tion%,1<<1).....|
0001a720  0d 0d b6 05 3a 0d 0d b7  22 2a 7c 53 74 6f 70 20  |....:..."*|Stop |
0001a730  50 52 4f 43 73 68 65 6c  6c 5f 49 63 6f 6e 53 65  |PROCshell_IconSe|
0001a740  74 53 70 72 69 74 65 0d  0d b8 23 2a 7c 53 74 61  |tSprite...#*|Sta|
0001a750  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 49 63 6f  |rt PROCshell_Ico|
0001a760  6e 53 65 74 42 6f 72 64  65 72 0d 0d b9 2b dd 20  |nSetBorder...+. |
0001a770  f2 73 68 65 6c 6c 5f 49  63 6f 6e 53 65 74 42 6f  |.shell_IconSetBo|
0001a780  72 64 65 72 28 77 68 25  2c 69 68 25 2c 61 63 74  |rder(wh%,ih%,act|
0001a790  69 6f 6e 25 29 0d 0d ba  1f e7 20 61 63 74 69 6f  |ion%)..... actio|
0001a7a0  6e 25 3c 3e 30 20 8c 20  61 63 74 69 6f 6e 25 3d  |n%<>0 . action%=|
0001a7b0  31 3c 3c 32 0d 0d bb 2d  f2 73 68 65 6c 6c 5f 49  |1<<2...-.shell_I|
0001a7c0  63 6f 6e 53 65 74 53 74  61 74 65 28 77 68 25 2c  |conSetState(wh%,|
0001a7d0  69 68 25 2c 61 63 74 69  6f 6e 25 2c 31 3c 3c 32  |ih%,action%,1<<2|
0001a7e0  29 0d 0d bc 05 e1 0d 0d  bd 05 3a 0d 0d be 22 2a  |).........:..."*|
0001a7f0  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
0001a800  49 63 6f 6e 53 65 74 42  6f 72 64 65 72 0d 0d bf  |IconSetBorder...|
0001a810  04 0d 0d c0 25 2a 7c 53  74 61 72 74 20 50 52 4f  |....%*|Start PRO|
0001a820  43 73 68 65 6c 6c 5f 49  63 6f 6e 53 65 74 48 43  |Cshell_IconSetHC|
0001a830  65 6e 74 72 65 64 0d 0d  c1 2d dd 20 f2 73 68 65  |entred...-. .she|
0001a840  6c 6c 5f 49 63 6f 6e 53  65 74 48 43 65 6e 74 72  |ll_IconSetHCentr|
0001a850  65 64 28 77 68 25 2c 69  68 25 2c 61 63 74 69 6f  |ed(wh%,ih%,actio|
0001a860  6e 25 29 0d 0d c2 46 f2  73 68 65 6c 6c 5f 49 63  |n%)...F.shell_Ic|
0001a870  6f 6e 53 65 74 53 74 61  74 65 28 77 68 25 2c 69  |onSetState(wh%,i|
0001a880  68 25 2c 30 2c 31 3c 3c  39 29 3a f4 20 75 6e 73  |h%,0,1<<9):. uns|
0001a890  65 74 20 72 69 67 68 74  20 6a 75 73 74 69 66 69  |et right justifi|
0001a8a0  65 64 20 62 69 74 2e 2e  2e 0d 0d c3 1f e7 20 61  |ed bit........ a|
0001a8b0  63 74 69 6f 6e 25 3c 3e  30 20 8c 20 61 63 74 69  |ction%<>0 . acti|
0001a8c0  6f 6e 25 3d 31 3c 3c 33  0d 0d c4 2d f2 73 68 65  |on%=1<<3...-.she|
0001a8d0  6c 6c 5f 49 63 6f 6e 53  65 74 53 74 61 74 65 28  |ll_IconSetState(|
0001a8e0  77 68 25 2c 69 68 25 2c  61 63 74 69 6f 6e 25 2c  |wh%,ih%,action%,|
0001a8f0  31 3c 3c 33 29 0d 0d c5  05 e1 0d 0d c6 05 3a 0d  |1<<3).........:.|
0001a900  0d c7 24 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |..$*|Stop PROCsh|
0001a910  65 6c 6c 5f 49 63 6f 6e  53 65 74 48 43 65 6e 74  |ell_IconSetHCent|
0001a920  72 65 64 0d 0d c8 04 0d  0d c9 25 2a 7c 53 74 61  |red.......%*|Sta|
0001a930  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 49 63 6f  |rt PROCshell_Ico|
0001a940  6e 53 65 74 56 43 65 6e  74 72 65 64 0d 0d ca 2d  |nSetVCentred...-|
0001a950  dd 20 f2 73 68 65 6c 6c  5f 49 63 6f 6e 53 65 74  |. .shell_IconSet|
0001a960  56 43 65 6e 74 72 65 64  28 77 68 25 2c 69 68 25  |VCentred(wh%,ih%|
0001a970  2c 61 63 74 69 6f 6e 25  29 0d 0d cb 1f e7 20 61  |,action%)..... a|
0001a980  63 74 69 6f 6e 25 3c 3e  30 20 8c 20 61 63 74 69  |ction%<>0 . acti|
0001a990  6f 6e 25 3d 31 3c 3c 34  0d 0d cc 2d f2 73 68 65  |on%=1<<4...-.she|
0001a9a0  6c 6c 5f 49 63 6f 6e 53  65 74 53 74 61 74 65 28  |ll_IconSetState(|
0001a9b0  77 68 25 2c 69 68 25 2c  61 63 74 69 6f 6e 25 2c  |wh%,ih%,action%,|
0001a9c0  31 3c 3c 34 29 0d 0d cd  05 e1 0d 0d ce 05 3a 0d  |1<<4).........:.|
0001a9d0  0d cf 24 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |..$*|Stop PROCsh|
0001a9e0  65 6c 6c 5f 49 63 6f 6e  53 65 74 56 43 65 6e 74  |ell_IconSetVCent|
0001a9f0  72 65 64 0d 0d d0 04 0d  0d d1 23 2a 7c 53 74 61  |red.......#*|Sta|
0001aa00  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 49 63 6f  |rt PROCshell_Ico|
0001aa10  6e 53 65 74 46 69 6c 6c  65 64 0d 0d d2 2b dd 20  |nSetFilled...+. |
0001aa20  f2 73 68 65 6c 6c 5f 49  63 6f 6e 53 65 74 46 69  |.shell_IconSetFi|
0001aa30  6c 6c 65 64 28 77 68 25  2c 69 68 25 2c 61 63 74  |lled(wh%,ih%,act|
0001aa40  69 6f 6e 25 29 0d 0d d3  1f e7 20 61 63 74 69 6f  |ion%)..... actio|
0001aa50  6e 25 3c 3e 30 20 8c 20  61 63 74 69 6f 6e 25 3d  |n%<>0 . action%=|
0001aa60  31 3c 3c 35 0d 0d d4 2d  f2 73 68 65 6c 6c 5f 49  |1<<5...-.shell_I|
0001aa70  63 6f 6e 53 65 74 53 74  61 74 65 28 77 68 25 2c  |conSetState(wh%,|
0001aa80  69 68 25 2c 61 63 74 69  6f 6e 25 2c 31 3c 3c 35  |ih%,action%,1<<5|
0001aa90  29 0d 0d d5 05 e1 0d 0d  d6 05 3a 0d 0d d7 22 2a  |).........:..."*|
0001aaa0  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
0001aab0  49 63 6f 6e 53 65 74 46  69 6c 6c 65 64 0d 0d d8  |IconSetFilled...|
0001aac0  04 0d 0d d9 26 2a 7c 53  74 61 72 74 20 50 52 4f  |....&*|Start PRO|
0001aad0  43 73 68 65 6c 6c 5f 49  63 6f 6e 53 65 74 52 69  |Cshell_IconSetRi|
0001aae0  67 68 74 4a 75 73 74 0d  0d da 2e dd 20 f2 73 68  |ghtJust..... .sh|
0001aaf0  65 6c 6c 5f 49 63 6f 6e  53 65 74 52 69 67 68 74  |ell_IconSetRight|
0001ab00  4a 75 73 74 28 77 68 25  2c 69 68 25 2c 61 63 74  |Just(wh%,ih%,act|
0001ab10  69 6f 6e 25 29 0d 0d db  25 f2 73 68 65 6c 6c 5f  |ion%)...%.shell_|
0001ab20  49 63 6f 6e 53 65 74 48  43 65 6e 74 72 65 64 28  |IconSetHCentred(|
0001ab30  77 68 25 2c 69 68 25 2c  30 29 0d 0d dc 1f e7 20  |wh%,ih%,0)..... |
0001ab40  61 63 74 69 6f 6e 25 3c  3e 30 20 8c 20 61 63 74  |action%<>0 . act|
0001ab50  69 6f 6e 25 3d 31 3c 3c  39 0d 0d dd 2d f2 73 68  |ion%=1<<9...-.sh|
0001ab60  65 6c 6c 5f 49 63 6f 6e  53 65 74 53 74 61 74 65  |ell_IconSetState|
0001ab70  28 77 68 25 2c 69 68 25  2c 61 63 74 69 6f 6e 25  |(wh%,ih%,action%|
0001ab80  2c 31 3c 3c 39 29 0d 0d  de 05 e1 0d 0d df 05 3a  |,1<<9).........:|
0001ab90  0d 0d e0 25 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |...%*|Stop PROCs|
0001aba0  68 65 6c 6c 5f 49 63 6f  6e 53 65 74 52 69 67 68  |hell_IconSetRigh|
0001abb0  74 4a 75 73 74 0d 0d e1  04 0d 0d e2 25 2a 7c 53  |tJust.......%*|S|
0001abc0  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 49  |tart PROCshell_I|
0001abd0  63 6f 6e 53 65 74 4c 65  66 74 4a 75 73 74 0d 0d  |conSetLeftJust..|
0001abe0  e3 25 dd 20 f2 73 68 65  6c 6c 5f 49 63 6f 6e 53  |.%. .shell_IconS|
0001abf0  65 74 4c 65 66 74 4a 75  73 74 28 77 68 25 2c 69  |etLeftJust(wh%,i|
0001ac00  68 25 29 0d 0d e4 25 f2  73 68 65 6c 6c 5f 49 63  |h%)...%.shell_Ic|
0001ac10  6f 6e 53 65 74 48 43 65  6e 74 72 65 64 28 77 68  |onSetHCentred(wh|
0001ac20  25 2c 69 68 25 2c 30 29  0d 0d e5 26 f2 73 68 65  |%,ih%,0)...&.she|
0001ac30  6c 6c 5f 49 63 6f 6e 53  65 74 52 69 67 68 74 4a  |ll_IconSetRightJ|
0001ac40  75 73 74 28 77 68 25 2c  69 68 25 2c 30 29 0d 0d  |ust(wh%,ih%,0)..|
0001ac50  e6 05 e1 0d 0d e7 05 3a  0d 0d e8 24 2a 7c 53 74  |.......:...$*|St|
0001ac60  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 49 63 6f  |op PROCshell_Ico|
0001ac70  6e 53 65 74 4c 65 66 74  4a 75 73 74 0d 0d e9 04  |nSetLeftJust....|
0001ac80  0d 0d ea 29 2a 7c 53 74  61 72 74 20 50 52 4f 43  |...)*|Start PROC|
0001ac90  73 68 65 6c 6c 5f 49 63  6f 6e 53 65 74 55 6e 73  |shell_IconSetUns|
0001aca0  65 6c 65 63 74 61 62 6c  65 0d 0d eb 30 dd 20 f2  |electable...0. .|
0001acb0  73 68 65 6c 6c 5f 49 63  6f 6e 53 65 74 55 6e 73  |shell_IconSetUns|
0001acc0  65 6c 65 63 74 61 62 6c  65 28 77 68 25 2c 69 68  |electable(wh%,ih|
0001acd0  25 2c 73 74 61 74 65 25  29 0d 0d ec 10 ea 20 63  |%,state%)..... c|
0001ace0  61 72 65 74 5f 62 6c 6b  25 0d 0d ed 1e e7 20 73  |aret_blk%..... s|
0001acf0  74 61 74 65 25 3c 3e 30  20 8c 20 73 74 61 74 65  |tate%<>0 . state|
0001ad00  25 3d 31 3c 3c 32 32 0d  0d ee 2d f2 73 68 65 6c  |%=1<<22...-.shel|
0001ad10  6c 5f 49 63 6f 6e 53 65  74 53 74 61 74 65 28 77  |l_IconSetState(w|
0001ad20  68 25 2c 69 68 25 2c 73  74 61 74 65 25 2c 31 3c  |h%,ih%,state%,1<|
0001ad30  3c 32 32 29 0d 0d ef 11  e7 20 73 74 61 74 65 25  |<22)..... state%|
0001ad40  3c 3e 30 20 8c 0d 0d f0  38 20 20 f4 20 63 68 65  |<>0 ....8  . che|
0001ad50  63 6b 20 69 66 20 69 63  6f 6e 20 68 61 73 20 74  |ck if icon has t|
0001ad60  68 65 20 63 61 72 65 74  2c 20 6c 6f 73 65 20 69  |he caret, lose i|
0001ad70  74 20 69 66 20 69 74 20  68 61 73 2e 2e 0d 0d f1  |t if it has.....|
0001ad80  2a 20 20 63 61 72 65 74  5f 62 6c 6b 25 3d a4 73  |*  caret_blk%=.s|
0001ad90  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 46 65  |hell_HeapBlockFe|
0001ada0  74 63 68 28 32 34 29 0d  0d f2 2c 20 20 c8 99 20  |tch(24)...,  .. |
0001adb0  22 57 69 6d 70 5f 47 65  74 43 61 72 65 74 50 6f  |"Wimp_GetCaretPo|
0001adc0  73 69 74 69 6f 6e 22 2c  2c 63 61 72 65 74 5f 62  |sition",,caret_b|
0001add0  6c 6b 25 0d 0d f3 2c 20  20 e7 20 21 63 61 72 65  |lk%...,  . !care|
0001ade0  74 5f 62 6c 6b 25 3d 77  68 25 20 80 20 63 61 72  |t_blk%=wh% . car|
0001adf0  65 74 5f 62 6c 6b 25 21  34 3d 69 68 25 20 8c 0d  |et_blk%!4=ih% ..|
0001ae00  0d f4 25 20 20 20 20 c8  99 20 22 57 69 6d 70 5f  |..%    .. "Wimp_|
0001ae10  53 65 74 43 61 72 65 74  50 6f 73 69 74 69 6f 6e  |SetCaretPosition|
0001ae20  22 2c 2d 31 0d 0d f5 07  20 20 cd 0d 0d f6 28 20  |",-1....  ....( |
0001ae30  20 f2 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
0001ae40  6b 52 65 74 75 72 6e 28  63 61 72 65 74 5f 62 6c  |kReturn(caret_bl|
0001ae50  6b 25 29 0d 0d f7 05 cd  0d 0d f8 05 e1 0d 0d f9  |k%).............|
0001ae60  05 3a 0d 0d fa 28 2a 7c  53 74 6f 70 20 50 52 4f  |.:...(*|Stop PRO|
0001ae70  43 73 68 65 6c 6c 5f 49  63 6f 6e 53 65 74 55 6e  |Cshell_IconSetUn|
0001ae80  73 65 6c 65 63 74 61 62  6c 65 0d 0d fb 04 0d 0d  |selectable......|
0001ae90  fc 23 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |.#*|Start PROCsh|
0001aea0  65 6c 6c 5f 43 61 72 65  74 53 65 74 52 69 67 68  |ell_CaretSetRigh|
0001aeb0  74 0d 0d fd 23 dd 20 f2  73 68 65 6c 6c 5f 43 61  |t...#. .shell_Ca|
0001aec0  72 65 74 53 65 74 52 69  67 68 74 28 77 68 25 2c  |retSetRight(wh%,|
0001aed0  69 68 25 29 0d 0d fe 4e  c8 99 20 22 57 69 6d 70  |ih%)...N.. "Wimp|
0001aee0  5f 53 65 74 43 61 72 65  74 50 6f 73 69 74 69 6f  |_SetCaretPositio|
0001aef0  6e 22 2c 77 68 25 2c 69  68 25 2c 2d 31 2c 2d 31  |n",wh%,ih%,-1,-1|
0001af00  2c 2d 31 2c a9 28 a4 73  68 65 6c 6c 5f 49 63 6f  |,-1,.(.shell_Ico|
0001af10  6e 47 65 74 44 61 74 61  28 77 68 25 2c 69 68 25  |nGetData(wh%,ih%|
0001af20  29 29 0d 0d ff 05 e1 0d  0e 00 05 3a 0d 0e 01 22  |)).........:..."|
0001af30  2a 7c 53 74 6f 70 20 50  52 4f 43 73 68 65 6c 6c  |*|Stop PROCshell|
0001af40  5f 43 61 72 65 74 53 65  74 52 69 67 68 74 0d 0e  |_CaretSetRight..|
0001af50  02 04 0d 0e 03 1a 2a 7c  53 74 61 72 74 20 50 52  |......*|Start PR|
0001af60  4f 43 70 72 69 6e 74 5f  74 65 78 74 0d 0e 04 1c  |OCprint_text....|
0001af70  dd 20 f2 70 72 69 6e 74  5f 74 65 78 74 28 58 2c  |. .print_text(X,|
0001af80  59 2c 74 65 78 74 24 29  0d 0e 05 23 e7 20 a4 69  |Y,text$)...#. .i|
0001af90  6e 28 58 2c 59 2d 33 32  2c 58 2b 31 36 2a a9 28  |n(X,Y-32,X+16*.(|
0001afa0  74 65 78 74 24 29 2c 59  29 20 8c 0d 0e 06 0b 20  |text$),Y) ..... |
0001afb0  20 ec 20 58 2c 59 0d 0e  07 0d 20 20 f1 20 74 65  | . X,Y....  . te|
0001afc0  78 74 24 0d 0e 08 05 cd  0d 0e 09 05 e1 0d 0e 0a  |xt$.............|
0001afd0  05 3a 0d 0e 0b 19 2a 7c  53 74 6f 70 20 50 52 4f  |.:....*|Stop PRO|
0001afe0  43 70 72 69 6e 74 5f 74  65 78 74 0d 0e 0c 10 2a  |Cprint_text....*|
0001aff0  7c 53 74 61 72 74 20 46  4e 69 6e 0d 0e 0d 16 dd  ||Start FNin.....|
0001b000  20 a4 69 6e 28 41 25 2c  42 25 2c 43 25 2c 44 25  | .in(A%,B%,C%,D%|
0001b010  29 0d 0e 0e 11 e7 20 43  25 3c 67 62 78 20 8c 20  |)..... C%<gbx . |
0001b020  3d a3 0d 0e 0f 11 e7 20  41 25 3e 67 74 78 20 8c  |=...... A%>gtx .|
0001b030  20 3d a3 0d 0e 10 11 e7  20 42 25 3e 67 74 79 20  | =...... B%>gty |
0001b040  8c 20 3d a3 0d 0e 11 11  e7 20 44 25 3c 67 62 79  |. =...... D%<gby|
0001b050  20 8c 20 3d a3 0d 0e 12  06 3d b9 0d 0e 13 05 3a  | . =.....=.....:|
0001b060  0d 0e 14 0f 2a 7c 53 74  6f 70 20 46 4e 69 6e 0d  |....*|Stop FNin.|
0001b070  0e 15 17 2a 7c 53 74 61  72 74 20 50 52 4f 43 6e  |...*|Start PROCn|
0001b080  65 77 76 61 6c 73 0d 0e  16 0e dd 20 f2 6e 65 77  |ewvals..... .new|
0001b090  76 61 6c 73 0d 0e 17 19  67 62 78 3d 5f 51 25 21  |vals....gbx=_Q%!|
0001b0a0  32 38 3a 67 62 79 3d 5f  51 25 21 33 32 0d 0e 18  |28:gby=_Q%!32...|
0001b0b0  19 67 74 78 3d 5f 51 25  21 33 36 3a 67 74 79 3d  |.gtx=_Q%!36:gty=|
0001b0c0  5f 51 25 21 34 30 0d 0e  19 17 77 62 78 3d 5f 51  |_Q%!40....wbx=_Q|
0001b0d0  25 21 34 3a 77 62 79 3d  5f 51 25 21 38 0d 0e 1a  |%!4:wby=_Q%!8...|
0001b0e0  19 77 74 78 3d 5f 51 25  21 31 32 3a 77 74 79 3d  |.wtx=_Q%!12:wty=|
0001b0f0  5f 51 25 21 31 36 0d 0e  1b 19 78 73 63 3d 5f 51  |_Q%!16....xsc=_Q|
0001b100  25 21 32 30 3a 79 73 63  3d 5f 51 25 21 32 34 0d  |%!20:ysc=_Q%!24.|
0001b110  0e 1c 21 68 70 3d 77 74  78 2d 77 62 78 3a 76 70  |..!hp=wtx-wbx:vp|
0001b120  3d 77 74 79 2d 77 62 79  3a 65 62 78 3d 78 73 63  |=wty-wby:ebx=xsc|
0001b130  0d 0e 1d 21 65 74 78 3d  78 73 63 2b 68 70 3a 65  |...!etx=xsc+hp:e|
0001b140  74 79 3d 79 73 63 3a 65  62 79 3d 79 73 63 2d 76  |ty=ysc:eby=ysc-v|
0001b150  70 0d 0e 1e 05 e1 0d 0e  1f 05 3a 0d 0e 20 16 2a  |p.........:.. .*|
0001b160  7c 53 74 6f 70 20 50 52  4f 43 6e 65 77 76 61 6c  ||Stop PROCnewval|
0001b170  73 0d 0e 21 11 dd 20 a4  6d 61 78 28 61 25 2c 62  |s..!.. .max(a%,b|
0001b180  25 29 0d 0e 22 11 e7 20  61 25 3c 62 25 20 8c 20  |%)..".. a%<b% . |
0001b190  3d 62 25 0d 0e 23 07 3d  61 25 0d 0e 24 05 3a 0d  |=b%..#.=a%..$.:.|
0001b1a0  0e 25 18 2a 7c 53 74 61  72 74 20 46 4e 73 68 65  |.%.*|Start FNshe|
0001b1b0  6c 6c 5f 4c 65 61 66 0d  0e 26 18 dd 20 a4 73 68  |ll_Leaf..&.. .sh|
0001b1c0  65 6c 6c 5f 4c 65 61 66  28 70 61 74 68 24 29 0d  |ell_Leaf(path$).|
0001b1d0  0e 27 12 c8 95 20 a7 70  61 74 68 24 2c 22 2e 22  |.'... .path$,"."|
0001b1e0  29 0d 0e 28 21 20 20 70  61 74 68 24 3d c1 70 61  |)..(!  path$=.pa|
0001b1f0  74 68 24 2c a7 70 61 74  68 24 2c 22 2e 22 29 2b  |th$,.path$,".")+|
0001b200  31 29 0d 0e 29 05 ce 0d  0e 2a 0a 3d 70 61 74 68  |1)..)....*.=path|
0001b210  24 0d 0e 2b 05 3a 0d 0e  2c 17 2a 7c 53 74 6f 70  |$..+.:..,.*|Stop|
0001b220  20 46 4e 73 68 65 6c 6c  5f 4c 65 61 66 0d 0e 2d  | FNshell_Leaf..-|
0001b230  1a 2a 7c 53 74 61 72 74  20 46 4e 73 68 65 6c 6c  |.*|Start FNshell|
0001b240  5f 42 72 61 6e 63 68 0d  0e 2e 1b dd 20 a4 73 68  |_Branch..... .sh|
0001b250  65 6c 6c 5f 42 72 61 6e  63 68 28 66 6e 61 6d 65  |ell_Branch(fname|
0001b260  24 29 0d 0e 2f 14 ea 20  70 6f 73 25 2c 62 72 24  |$)../.. pos%,br$|
0001b270  2c 74 65 6d 70 25 0d 0e  30 16 e7 20 a7 66 6e 61  |,temp%..0.. .fna|
0001b280  6d 65 24 2c 22 2e 22 29  3d 30 20 8c 0d 0e 31 0c  |me$,".")=0 ...1.|
0001b290  20 20 62 72 24 3d 22 22  0d 0e 32 05 cc 0d 0e 33  |  br$=""..2....3|
0001b2a0  0d 20 20 74 65 6d 70 25  3d 30 0d 0e 34 07 20 20  |.  temp%=0..4.  |
0001b2b0  f5 0d 0e 35 14 20 20 20  20 70 6f 73 25 3d 74 65  |...5.    pos%=te|
0001b2c0  6d 70 25 2b 31 0d 0e 36  1f 20 20 20 20 74 65 6d  |mp%+1..6.    tem|
0001b2d0  70 25 3d a7 66 6e 61 6d  65 24 2c 22 2e 22 2c 70  |p%=.fname$,".",p|
0001b2e0  6f 73 25 29 0d 0e 37 0f  20 20 fd 20 74 65 6d 70  |os%)..7.  . temp|
0001b2f0  25 3d 30 0d 0e 38 19 20  20 62 72 24 3d c0 66 6e  |%=0..8.  br$=.fn|
0001b300  61 6d 65 24 2c 70 6f 73  25 2d 32 29 0d 0e 39 05  |ame$,pos%-2)..9.|
0001b310  cd 0d 0e 3a 08 3d 62 72  24 0d 0e 3b 05 3a 0d 0e  |...:.=br$..;.:..|
0001b320  3c 19 2a 7c 53 74 6f 70  20 46 4e 73 68 65 6c 6c  |<.*|Stop FNshell|
0001b330  5f 42 72 61 6e 63 68 0d  0e 3d 13 2a 7c 53 74 61  |_Branch..=.*|Sta|
0001b340  72 74 20 46 4e 67 6e 61  6d 65 0d 0e 3e 11 dd 20  |rt FNgname..>.. |
0001b350  a4 67 6e 61 6d 65 28 70  74 72 29 0d 0e 3f 09 66  |.gname(ptr)..?.f|
0001b360  24 3d 22 22 0d 0e 40 19  c8 95 20 3f 70 74 72 3c  |$=""..@... ?ptr<|
0001b370  3e 30 20 80 20 3f 70 74  72 3c 3e 31 33 0d 0e 41  |>0 . ?ptr<>13..A|
0001b380  18 20 20 66 24 3d 66 24  2b bd 3f 70 74 72 3a 70  |.  f$=f$+.?ptr:p|
0001b390  74 72 2b 3d 31 0d 0e 42  05 ce 0d 0e 43 07 3d 66  |tr+=1..B....C.=f|
0001b3a0  24 0d 0e 44 05 3a 0d 0e  45 12 2a 7c 53 74 6f 70  |$..D.:..E.*|Stop|
0001b3b0  20 46 4e 67 6e 61 6d 65  0d 0e 46 22 2a 7c 53 74  | FNgname..F"*|St|
0001b3c0  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 57 69  |art PROCshell_Wi|
0001b3d0  6e 64 6f 77 52 65 73 69  7a 65 0d 0e 47 39 dd 20  |ndowResize..G9. |
0001b3e0  f2 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 52 65 73  |.shell_WindowRes|
0001b3f0  69 7a 65 28 77 68 61 6e  64 6c 65 25 2c 62 78 25  |ize(whandle%,bx%|
0001b400  2c 62 79 25 2c 74 78 25  2c 74 79 25 2c 6f 70 65  |,by%,tx%,ty%,ope|
0001b410  6e 25 29 0d 0e 48 2b 21  5f 51 25 3d 62 78 25 3a  |n%)..H+!_Q%=bx%:|
0001b420  5f 51 25 21 34 3d 62 79  25 3a 5f 51 25 21 38 3d  |_Q%!4=by%:_Q%!8=|
0001b430  74 78 25 3a 5f 51 25 21  31 32 3d 74 79 25 0d 0e  |tx%:_Q%!12=ty%..|
0001b440  49 24 c8 99 20 22 57 69  6d 70 5f 53 65 74 45 78  |I$.. "Wimp_SetEx|
0001b450  74 65 6e 74 22 2c 77 68  61 6e 64 6c 65 25 2c 5f  |tent",whandle%,_|
0001b460  51 25 0d 0e 4a 0d e7 20  6f 70 65 6e 25 20 8c 0d  |Q%..J.. open% ..|
0001b470  0e 4b 14 20 20 5f 51 25  21 30 3d 77 68 61 6e 64  |.K.  _Q%!0=whand|
0001b480  6c 65 25 0d 0e 4c 22 20  20 c8 99 20 22 57 69 6d  |le%..L"  .. "Wim|
0001b490  70 5f 47 65 74 57 69 6e  64 6f 77 49 6e 66 6f 22  |p_GetWindowInfo"|
0001b4a0  2c 2c 5f 51 25 0d 0e 4d  1f 20 20 c8 99 20 22 57  |,,_Q%..M.  .. "W|
0001b4b0  69 6d 70 5f 4f 70 65 6e  57 69 6e 64 6f 77 22 2c  |imp_OpenWindow",|
0001b4c0  2c 5f 51 25 0d 0e 4e 05  cd 0d 0e 4f 05 e1 0d 0e  |,_Q%..N....O....|
0001b4d0  50 05 3a 0d 0e 51 21 2a  7c 53 74 6f 70 20 50 52  |P.:..Q!*|Stop PR|
0001b4e0  4f 43 73 68 65 6c 6c 5f  57 69 6e 64 6f 77 52 65  |OCshell_WindowRe|
0001b4f0  73 69 7a 65 0d 0e 52 23  2a 7c 53 74 61 72 74 20  |size..R#*|Start |
0001b500  50 52 4f 43 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |PROCshell_Window|
0001b510  52 65 74 69 74 6c 65 0d  0e 53 2b dd 20 f2 73 68  |Retitle..S+. .sh|
0001b520  65 6c 6c 5f 57 69 6e 64  6f 77 52 65 74 69 74 6c  |ell_WindowRetitl|
0001b530  65 28 77 68 61 6e 64 6c  65 25 2c 74 69 74 6c 65  |e(whandle%,title|
0001b540  24 29 0d 0e 54 14 ea 20  74 65 6d 70 25 2c 77 69  |$)..T.. temp%,wi|
0001b550  6e 5f 62 6c 6b 25 0d 0e  55 28 77 69 6e 5f 62 6c  |n_blk%..U(win_bl|
0001b560  6b 25 3d a4 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |k%=.shell_HeapBl|
0001b570  6f 63 6b 46 65 74 63 68  28 36 30 30 30 29 0d 0e  |ockFetch(6000)..|
0001b580  56 17 77 69 6e 5f 62 6c  6b 25 21 30 3d 77 68 61  |V.win_blk%!0=wha|
0001b590  6e 64 6c 65 25 0d 0e 57  25 c8 99 20 22 57 69 6d  |ndle%..W%.. "Wim|
0001b5a0  70 5f 47 65 74 57 69 6e  64 6f 77 49 6e 66 6f 22  |p_GetWindowInfo"|
0001b5b0  2c 2c 77 69 6e 5f 62 6c  6b 25 0d 0e 58 20 e7 20  |,,win_blk%..X . |
0001b5c0  28 28 77 69 6e 5f 62 6c  6b 25 21 36 30 29 20 80  |((win_blk%!60) .|
0001b5d0  20 26 31 30 30 29 3d 30  20 8c 0d 0e 59 28 20 20  | &100)=0 ...Y(  |
0001b5e0  f4 20 77 69 6e 64 6f 77  20 74 69 74 6c 65 20 69  |. window title i|
0001b5f0  73 20 6e 6f 74 20 69 6e  64 69 72 65 63 74 65 64  |s not indirected|
0001b600  2e 2e 0d 0e 5a 17 20 20  74 65 6d 70 25 3d 77 69  |....Z.  temp%=wi|
0001b610  6e 5f 62 6c 6b 25 2b 37  36 0d 0e 5b 18 20 20 24  |n_blk%+76..[.  $|
0001b620  74 65 6d 70 25 3d c0 74  69 74 6c 65 24 2c 31 31  |temp%=.title$,11|
0001b630  29 0d 0e 5c 26 20 20 c8  99 20 22 57 69 6d 70 5f  |)..\&  .. "Wimp_|
0001b640  44 65 6c 65 74 65 57 69  6e 64 6f 77 22 2c 2c 77  |DeleteWindow",,w|
0001b650  69 6e 5f 62 6c 6b 25 0d  0e 5d 28 20 20 c8 99 20  |in_blk%..](  .. |
0001b660  22 57 69 6d 70 5f 43 72  65 61 74 65 57 69 6e 64  |"Wimp_CreateWind|
0001b670  6f 77 22 2c 2c 77 69 6e  5f 62 6c 6b 25 2b 34 0d  |ow",,win_blk%+4.|
0001b680  0e 5e 05 cc 0d 0e 5f 24  20 20 f4 20 77 69 6e 64  |.^...._$  . wind|
0001b690  6f 77 20 74 69 74 6c 65  20 69 73 20 69 6e 64 69  |ow title is indi|
0001b6a0  72 65 63 74 65 64 2e 2e  0d 0e 60 28 20 20 f4 20  |rected....`(  . |
0001b6b0  73 68 6f 75 6c 64 20 63  68 65 63 6b 20 62 75 66  |should check buf|
0001b6c0  66 65 72 20 73 69 7a 65  20 68 65 72 65 2e 2e 2e  |fer size here...|
0001b6d0  0d 0e 61 1e 20 20 24 28  21 28 77 69 6e 5f 62 6c  |..a.  $(!(win_bl|
0001b6e0  6b 25 2b 37 36 29 29 3d  74 69 74 6c 65 24 0d 0e  |k%+76))=title$..|
0001b6f0  62 26 20 20 e7 20 28 28  77 69 6e 5f 62 6c 6b 25  |b&  . ((win_blk%|
0001b700  21 33 32 29 20 80 20 28  31 3c 3c 31 36 29 29 3c  |!32) . (1<<16))<|
0001b710  3e 30 20 8c 0d 0e 63 52  20 20 20 20 c8 99 20 22  |>0 ...cR    .. "|
0001b720  57 69 6d 70 5f 46 6f 72  63 65 52 65 64 72 61 77  |Wimp_ForceRedraw|
0001b730  22 2c 2d 31 2c 77 69 6e  5f 62 6c 6b 25 21 34 2c  |",-1,win_blk%!4,|
0001b740  77 69 6e 5f 62 6c 6b 25  21 31 36 2c 77 69 6e 5f  |win_blk%!16,win_|
0001b750  62 6c 6b 25 21 31 32 2c  77 69 6e 5f 62 6c 6b 25  |blk%!12,win_blk%|
0001b760  21 31 36 2b 34 34 0d 0e  64 07 20 20 cd 0d 0e 65  |!16+44..d.  ...e|
0001b770  24 f2 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  |$.shell_HeapBloc|
0001b780  6b 52 65 74 75 72 6e 28  77 69 6e 5f 62 6c 6b 25  |kReturn(win_blk%|
0001b790  29 0d 0e 66 05 cd 0d 0e  67 05 e1 0d 0e 68 05 3a  |)..f....g....h.:|
0001b7a0  0d 0e 69 22 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |..i"*|Stop PROCs|
0001b7b0  68 65 6c 6c 5f 57 69 6e  64 6f 77 52 65 74 69 74  |hell_WindowRetit|
0001b7c0  6c 65 0d 0e 6a 29 2a 7c  53 74 61 72 74 20 46 4e  |le..j)*|Start FN|
0001b7d0  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 54 69 74 6c  |shell_WindowTitl|
0001b7e0  65 49 6e 64 69 72 65 63  74 65 64 0d 0e 6b 29 dd  |eIndirected..k).|
0001b7f0  20 a4 73 68 65 6c 6c 5f  57 69 6e 64 6f 77 54 69  | .shell_WindowTi|
0001b800  74 6c 65 49 6e 64 69 72  65 63 74 65 64 28 66 6c  |tleIndirected(fl|
0001b810  61 67 25 29 0d 0e 6c 22  e7 20 28 66 6c 61 67 25  |ag%)..l". (flag%|
0001b820  20 80 20 28 31 3c 3c 38  29 29 3d 28 31 3c 3c 38  | . (1<<8))=(1<<8|
0001b830  29 20 8c 20 3d b9 0d 0e  6d 06 3d a3 0d 0e 6e 05  |) . =...m.=...n.|
0001b840  3a 0d 0e 6f 28 2a 7c 53  74 6f 70 20 46 4e 73 68  |:..o(*|Stop FNsh|
0001b850  65 6c 6c 5f 57 69 6e 64  6f 77 54 69 74 6c 65 49  |ell_WindowTitleI|
0001b860  6e 64 69 72 65 63 74 65  64 0d 0e 70 2a 2a 7c 53  |ndirected..p**|S|
0001b870  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 53  |tart PROCshell_S|
0001b880  63 72 65 65 6e 54 6f 57  69 6e 64 6f 77 43 6f 6f  |creenToWindowCoo|
0001b890  72 64 73 0d 0e 71 35 dd  20 f2 73 68 65 6c 6c 5f  |rds..q5. .shell_|
0001b8a0  53 63 72 65 65 6e 54 6f  57 69 6e 64 6f 77 43 6f  |ScreenToWindowCo|
0001b8b0  6f 72 64 73 28 57 48 61  6e 64 6c 65 25 2c f8 20  |ords(WHandle%,. |
0001b8c0  58 25 2c f8 20 59 25 29  0d 0e 72 34 ea 20 54 65  |X%,. Y%)..r4. Te|
0001b8d0  6d 70 25 2c 57 58 4d 69  6e 25 2c 57 59 4d 69 6e  |mp%,WXMin%,WYMin|
0001b8e0  25 2c 58 53 63 72 6f 6c  6c 25 2c 59 53 63 72 6f  |%,XScroll%,YScro|
0001b8f0  6c 6c 25 2c 53 63 72 61  74 63 68 25 0d 0e 73 27  |ll%,Scratch%..s'|
0001b900  53 63 72 61 74 63 68 25  3d a4 73 68 65 6c 6c 5f  |Scratch%=.shell_|
0001b910  48 65 61 70 42 6c 6f 63  6b 46 65 74 63 68 28 36  |HeapBlockFetch(6|
0001b920  30 30 29 0d 0e 74 12 54  65 6d 70 25 3d 53 63 72  |00)..t.Temp%=Scr|
0001b930  61 74 63 68 25 0d 0e 75  13 21 54 65 6d 70 25 3d  |atch%..u.!Temp%=|
0001b940  57 48 61 6e 64 6c 65 25  0d 0e 76 22 c8 99 20 22  |WHandle%..v".. "|
0001b950  57 69 6d 70 5f 47 65 74  57 69 6e 64 6f 77 49 6e  |Wimp_GetWindowIn|
0001b960  66 6f 22 2c 2c 54 65 6d  70 25 0d 0e 77 15 57 58  |fo",,Temp%..w.WX|
0001b970  4d 69 6e 25 3d 53 63 72  61 74 63 68 25 21 34 0d  |Min%=Scratch%!4.|
0001b980  0e 78 16 57 59 4d 61 78  25 3d 53 63 72 61 74 63  |.x.WYMax%=Scratc|
0001b990  68 25 21 31 36 0d 0e 79  18 58 53 63 72 6f 6c 6c  |h%!16..y.XScroll|
0001b9a0  25 3d 53 63 72 61 74 63  68 25 21 32 30 0d 0e 7a  |%=Scratch%!20..z|
0001b9b0  18 59 53 63 72 6f 6c 6c  25 3d 53 63 72 61 74 63  |.YScroll%=Scratc|
0001b9c0  68 25 21 32 34 0d 0e 7b  1b 58 25 3d 58 25 2b 28  |h%!24..{.X%=X%+(|
0001b9d0  58 53 63 72 6f 6c 6c 25  2d 57 58 4d 69 6e 25 29  |XScroll%-WXMin%)|
0001b9e0  0d 0e 7c 1b 59 25 3d 59  25 2b 28 59 53 63 72 6f  |..|.Y%=Y%+(YScro|
0001b9f0  6c 6c 25 2d 57 59 4d 61  78 25 29 0d 0e 7d 24 f2  |ll%-WYMax%)..}$.|
0001ba00  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 52  |shell_HeapBlockR|
0001ba10  65 74 75 72 6e 28 53 63  72 61 74 63 68 25 29 0d  |eturn(Scratch%).|
0001ba20  0e 7e 05 e1 0d 0e 7f 05  3a 0d 0e 80 29 2a 7c 53  |.~......:...)*|S|
0001ba30  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 53 63  |top PROCshell_Sc|
0001ba40  72 65 65 6e 54 6f 57 69  6e 64 6f 77 43 6f 6f 72  |reenToWindowCoor|
0001ba50  64 73 0d 0e 81 23 2a 7c  53 74 61 72 74 20 46 4e  |ds...#*|Start FN|
0001ba60  73 68 65 6c 6c 5f 57 69  6d 70 53 6c 6f 74 52 65  |shell_WimpSlotRe|
0001ba70  61 64 45 6e 64 0d 0e 82  1c dd 20 a4 73 68 65 6c  |adEnd..... .shel|
0001ba80  6c 5f 57 69 6d 70 53 6c  6f 74 52 65 61 64 45 6e  |l_WimpSlotReadEn|
0001ba90  64 0d 0e 83 0a ea 20 6d  65 6d 25 0d 0e 84 23 c8  |d..... mem%...#.|
0001baa0  99 20 22 57 69 6d 70 5f  53 6c 6f 74 53 69 7a 65  |. "Wimp_SlotSize|
0001bab0  22 2c 2d 31 2c 2d 31 20  b8 20 6d 65 6d 25 0d 0e  |",-1,-1 . mem%..|
0001bac0  85 09 3d 6d 65 6d 25 0d  0e 86 05 3a 0d 0e 87 22  |..=mem%....:..."|
0001bad0  2a 7c 53 74 6f 70 20 46  4e 73 68 65 6c 6c 5f 57  |*|Stop FNshell_W|
0001bae0  69 6d 70 53 6c 6f 74 52  65 61 64 45 6e 64 0d 0e  |impSlotReadEnd..|
0001baf0  88 27 2a 7c 53 74 61 72  74 20 46 4e 73 68 65 6c  |.'*|Start FNshel|
0001bb00  6c 5f 57 69 6d 70 53 6c  6f 74 43 6c 61 69 6d 4d  |l_WimpSlotClaimM|
0001bb10  65 6d 6f 72 79 0d 0e 89  2c dd 20 a4 73 68 65 6c  |emory...,. .shel|
0001bb20  6c 5f 57 69 6d 70 53 6c  6f 74 43 6c 61 69 6d 4d  |l_WimpSlotClaimM|
0001bb30  65 6d 6f 72 79 28 6d 65  6d 25 2c 73 69 7a 65 25  |emory(mem%,size%|
0001bb40  29 0d 0e 8a 0c ea 20 73  73 69 7a 65 25 0d 0e 8b  |)..... ssize%...|
0001bb50  2d c8 99 20 22 57 69 6d  70 5f 53 6c 6f 74 53 69  |-.. "Wimp_SlotSi|
0001bb60  7a 65 22 2c 6d 65 6d 25  2b 73 69 7a 65 25 2c 2d  |ze",mem%+size%,-|
0001bb70  31 20 b8 20 73 73 69 7a  65 25 0d 0e 8c 1d e7 20  |1 . ssize%..... |
0001bb80  73 73 69 7a 65 25 3c 6d  65 6d 25 2b 73 69 7a 65  |ssize%<mem%+size|
0001bb90  25 20 8c 20 3d 2d 31 0d  0e 8d 0c 3d 20 73 73 69  |% . =-1....= ssi|
0001bba0  7a 65 25 0d 0e 8e 05 3a  0d 0e 8f 26 2a 7c 53 74  |ze%....:...&*|St|
0001bbb0  6f 70 20 46 4e 73 68 65  6c 6c 5f 57 69 6d 70 53  |op FNshell_WimpS|
0001bbc0  6c 6f 74 43 6c 61 69 6d  4d 65 6d 6f 72 79 0d 0e  |lotClaimMemory..|
0001bbd0  90 2b 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |.+*|Start PROCsh|
0001bbe0  65 6c 6c 5f 57 69 6d 70  53 6c 6f 74 52 65 6c 65  |ell_WimpSlotRele|
0001bbf0  61 73 65 4d 65 6d 6f 72  79 0d 0e 91 22 dd 20 f2  |aseMemory...". .|
0001bc00  73 68 65 6c 6c 5f 57 69  6d 70 53 6c 6f 74 52 65  |shell_WimpSlotRe|
0001bc10  6c 65 61 73 65 4d 65 6d  6f 72 79 0d 0e 92 1e c8  |leaseMemory.....|
0001bc20  99 20 22 57 69 6d 70 5f  53 6c 6f 74 53 69 7a 65  |. "Wimp_SlotSize|
0001bc30  22 2c 6d 65 6d 25 2c 2d  31 0d 0e 93 05 e1 0d 0e  |",mem%,-1.......|
0001bc40  94 05 3a 0d 0e 95 2a 2a  7c 53 74 6f 70 20 50 52  |..:...**|Stop PR|
0001bc50  4f 43 73 68 65 6c 6c 5f  57 69 6d 70 53 6c 6f 74  |OCshell_WimpSlot|
0001bc60  52 65 6c 65 61 73 65 4d  65 6d 6f 72 79 0d 0e 96  |ReleaseMemory...|
0001bc70  20 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  | *|Start PROCshe|
0001bc80  6c 6c 5f 4d 6f 75 73 65  4c 69 6d 69 74 0d 0e 97  |ll_MouseLimit...|
0001bc90  23 dd 20 f2 73 68 65 6c  6c 5f 4d 6f 75 73 65 4c  |#. .shell_MouseL|
0001bca0  69 6d 69 74 28 62 2c 77  68 61 6e 64 6c 65 25 29  |imit(b,whandle%)|
0001bcb0  0d 0e 98 2c 62 21 30 3d  77 68 61 6e 64 6c 65 25  |...,b!0=whandle%|
0001bcc0  3a c8 99 20 22 57 69 6d  70 5f 47 65 74 57 69 6e  |:.. "Wimp_GetWin|
0001bcd0  64 6f 77 53 74 61 74 65  22 2c 2c 62 0d 0e 99 2f  |dowState",,b.../|
0001bce0  f2 6d 6f 75 73 65 5f 72  65 63 74 61 6e 67 6c 65  |.mouse_rectangle|
0001bcf0  28 62 21 34 2c 62 21 38  2c 62 21 31 32 2d 62 21  |(b!4,b!8,b!12-b!|
0001bd00  34 2c 62 21 31 36 2d 62  21 38 29 0d 0e 9a 05 e1  |4,b!16-b!8).....|
0001bd10  0d 0e 9b 05 3a 0d 0e 9c  1f 2a 7c 53 74 6f 70 20  |....:....*|Stop |
0001bd20  50 52 4f 43 73 68 65 6c  6c 5f 4d 6f 75 73 65 4c  |PROCshell_MouseL|
0001bd30  69 6d 69 74 0d 0e 9d 25  2a 7c 53 74 61 72 74 20  |imit...%*|Start |
0001bd40  46 4e 73 68 65 6c 6c 5f  4e 61 6d 65 4f 66 46 69  |FNshell_NameOfFi|
0001bd50  72 73 74 53 70 72 69 74  65 0d 0e 9e 25 dd 20 a4  |rstSprite...%. .|
0001bd60  73 68 65 6c 6c 5f 4e 61  6d 65 4f 66 46 69 72 73  |shell_NameOfFirs|
0001bd70  74 53 70 72 69 74 65 28  46 69 6c 65 24 29 0d 0e  |tSprite(File$)..|
0001bd80  9f 0e ea 20 58 25 2c 4e  25 2c 53 24 0d 0e a0 0f  |... X%,N%,S$....|
0001bd90  58 25 3d 8e 28 46 69 6c  65 24 29 0d 0e a1 0a cf  |X%=.(File$).....|
0001bda0  23 58 25 3d 34 0d 0e a2  0b 4e 25 3d 9a 23 58 25  |#X%=4....N%=.#X%|
0001bdb0  0d 0e a3 11 4e 25 2b 3d  9a 23 58 25 2a 26 31 30  |....N%+=.#X%*&10|
0001bdc0  30 0d 0e a4 13 4e 25 2b  3d 9a 23 58 25 2a 26 31  |0....N%+=.#X%*&1|
0001bdd0  30 30 30 30 0d 0e a5 15  4e 25 2b 3d 9a 23 58 25  |0000....N%+=.#X%|
0001bde0  2a 26 31 30 30 30 30 30  30 0d 0e a6 0b cf 23 58  |*&1000000.....#X|
0001bdf0  25 3d 4e 25 0d 0e a7 09  53 24 3d 22 22 0d 0e a8  |%=N%....S$=""...|
0001be00  0f e3 20 4e 25 3d 30 20  b8 20 31 31 0d 0e a9 0f  |.. N%=0 . 11....|
0001be10  53 24 2b 3d bd 28 9a 23  58 25 29 0d 0e aa 05 ed  |S$+=.(.#X%).....|
0001be20  0d 0e ab 08 d9 23 58 25  0d 0e ac 07 3d 53 24 0d  |.....#X%....=S$.|
0001be30  0e ad 05 3a 0d 0e ae 24  2a 7c 53 74 6f 70 20 46  |...:...$*|Stop F|
0001be40  4e 73 68 65 6c 6c 5f 4e  61 6d 65 4f 66 46 69 72  |Nshell_NameOfFir|
0001be50  73 74 53 70 72 69 74 65  0d 0e af 24 2a 7c 53 74  |stSprite...$*|St|
0001be60  61 72 74 20 50 52 4f 43  49 6e 69 74 69 61 6c 69  |art PROCInitiali|
0001be70  73 65 53 70 72 69 74 65  41 72 65 61 0d 0e b0 27  |seSpriteArea...'|
0001be80  dd 20 f2 49 6e 69 74 69  61 6c 69 73 65 53 70 72  |. .InitialiseSpr|
0001be90  69 74 65 41 72 65 61 28  53 25 2c 4c 65 6e 67 74  |iteArea(S%,Lengt|
0001bea0  68 25 29 0d 0e b1 0f 21  53 25 3d 4c 65 6e 67 74  |h%)....!S%=Lengt|
0001beb0  68 25 0d 0e b2 0b 53 25  21 38 3d 31 36 0d 0e b3  |h%....S%!8=16...|
0001bec0  1d c8 99 20 22 4f 53 5f  53 70 72 69 74 65 4f 70  |... "OS_SpriteOp|
0001bed0  22 2c 39 2b 32 35 36 2c  53 25 0d 0e b4 05 e1 0d  |",9+256,S%......|
0001bee0  0e b5 05 3a 0d 0e b6 23  2a 7c 53 74 6f 70 20 50  |...:...#*|Stop P|
0001bef0  52 4f 43 49 6e 69 74 69  61 6c 69 73 65 53 70 72  |ROCInitialiseSpr|
0001bf00  69 74 65 41 72 65 61 0d  0e b7 20 dd 20 f2 73 68  |iteArea... . .sh|
0001bf10  65 6c 6c 5f 4c 69 73 74  45 76 65 6e 74 73 28 77  |ell_ListEvents(w|
0001bf20  68 25 2c 69 63 25 29 0d  0e b8 15 e7 20 77 68 25  |h%,ic%)..... wh%|
0001bf30  3d 2d 31 20 8c 20 77 68  25 3d 2d 32 0d 0e b9 37  |=-1 . wh%=-2...7|
0001bf40  f1 22 4d 65 6e 75 53 65  6c 65 63 74 69 6f 6e 3d  |."MenuSelection=|
0001bf50  22 2b a4 73 68 65 6c 6c  5f 47 65 74 45 76 65 6e  |"+.shell_GetEven|
0001bf60  74 48 61 6e 64 6c 65 72  28 77 68 25 2c 69 63 25  |tHandler(wh%,ic%|
0001bf70  2c 30 29 0d 0e ba 37 f1  22 4d 65 6e 75 4d 61 6b  |,0)...7."MenuMak|
0001bf80  65 72 20 20 20 20 3d 22  2b a4 73 68 65 6c 6c 5f  |er    ="+.shell_|
0001bf90  47 65 74 45 76 65 6e 74  48 61 6e 64 6c 65 72 28  |GetEventHandler(|
0001bfa0  77 68 25 2c 69 63 25 2c  31 29 0d 0e bb 37 f1 22  |wh%,ic%,1)...7."|
0001bfb0  43 6c 69 63 6b 53 65 6c  65 63 74 20 20 3d 22 2b  |ClickSelect  ="+|
0001bfc0  a4 73 68 65 6c 6c 5f 47  65 74 45 76 65 6e 74 48  |.shell_GetEventH|
0001bfd0  61 6e 64 6c 65 72 28 77  68 25 2c 69 63 25 2c 32  |andler(wh%,ic%,2|
0001bfe0  29 0d 0e bc 37 f1 22 43  6c 69 63 6b 41 64 6a 75  |)...7."ClickAdju|
0001bff0  73 74 20 20 3d 22 2b a4  73 68 65 6c 6c 5f 47 65  |st  ="+.shell_Ge|
0001c000  74 45 76 65 6e 74 48 61  6e 64 6c 65 72 28 77 68  |tEventHandler(wh|
0001c010  25 2c 69 63 25 2c 33 29  0d 0e bd 37 f1 22 52 65  |%,ic%,3)...7."Re|
0001c020  64 72 61 77 20 20 20 20  20 20 20 3d 22 2b a4 73  |draw       ="+.s|
0001c030  68 65 6c 6c 5f 47 65 74  45 76 65 6e 74 48 61 6e  |hell_GetEventHan|
0001c040  64 6c 65 72 28 77 68 25  2c 69 63 25 2c 34 29 0d  |dler(wh%,ic%,4).|
0001c050  0e be 37 f1 22 4b 65 79  70 72 65 73 73 20 20 20  |..7."Keypress   |
0001c060  20 20 3d 22 2b a4 73 68  65 6c 6c 5f 47 65 74 45  |  ="+.shell_GetE|
0001c070  76 65 6e 74 48 61 6e 64  6c 65 72 28 77 68 25 2c  |ventHandler(wh%,|
0001c080  69 63 25 2c 35 29 0d 0e  bf 37 f1 22 44 72 61 67  |ic%,5)...7."Drag|
0001c090  20 20 20 20 20 20 20 20  20 3d 22 2b a4 73 68 65  |         ="+.she|
0001c0a0  6c 6c 5f 47 65 74 45 76  65 6e 74 48 61 6e 64 6c  |ll_GetEventHandl|
0001c0b0  65 72 28 77 68 25 2c 69  63 25 2c 36 29 0d 0e c0  |er(wh%,ic%,6)...|
0001c0c0  37 f1 22 4d 65 6e 75 20  57 61 72 6e 69 6e 67 20  |7."Menu Warning |
0001c0d0  3d 22 2b a4 73 68 65 6c  6c 5f 47 65 74 45 76 65  |="+.shell_GetEve|
0001c0e0  6e 74 48 61 6e 64 6c 65  72 28 77 68 25 2c 69 63  |ntHandler(wh%,ic|
0001c0f0  25 2c 37 29 0d 0e c1 37  f1 22 48 65 6c 70 54 61  |%,7)...7."HelpTa|
0001c100  67 20 20 20 20 20 20 3d  22 2b a4 73 68 65 6c 6c  |g      ="+.shell|
0001c110  5f 47 65 74 45 76 65 6e  74 48 61 6e 64 6c 65 72  |_GetEventHandler|
0001c120  28 77 68 25 2c 69 63 25  2c 38 29 0d 0e c2 28 6d  |(wh%,ic%,8)...(m|
0001c130  65 6e 75 25 3d a4 73 68  65 6c 6c 5f 47 65 74 45  |enu%=.shell_GetE|
0001c140  76 65 6e 74 4d 65 6e 75  28 32 2c 77 68 25 2c 69  |ventMenu(2,wh%,i|
0001c150  63 25 29 0d 0e c3 16 f1  22 4d 65 6e 75 20 41 64  |c%)....."Menu Ad|
0001c160  64 72 65 73 73 20 3d 22  3b 0d 0e c4 0f e7 20 6d  |dress =";..... m|
0001c170  65 6e 75 25 3d 30 20 8c  0d 0e c5 0e 20 20 f1 22  |enu%=0 .....  ."|
0001c180  20 4e 6f 6e 65 22 0d 0e  c6 05 cc 0d 0e c7 0e 20  | None"......... |
0001c190  20 f1 20 c3 6d 65 6e 75  25 0d 0e c8 05 cd 0d 0e  | . .menu%.......|
0001c1a0  c9 05 e1 0d 0e ca 05 3a  0d 0e cb 4c f4 20 2d 2d  |.......:...L. --|
0001c1b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 20 48 65 61 70 20 4d  |--------- Heap M|
0001c1c0  61 6e 61 67 65 72 20 52  6f 75 74 69 6e 65 73 20  |anager Routines |
0001c1d0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0001c1f0  2d 2d 2d 2d 0d 0e cc 04  0d 0e cd 30 f4 20 46 75  |----.......0. Fu|
0001c200  6e 63 74 69 6f 6e 20 74  6f 20 6c 6f 61 64 20 68  |nction to load h|
0001c210  65 61 70 20 6d 61 6e 61  67 65 72 20 6d 61 63 68  |eap manager mach|
0001c220  69 6e 65 20 63 6f 64 65  0d 0e ce 04 0d 0e cf 25  |ine code.......%|
0001c230  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
0001c240  6c 5f 48 65 61 70 4d 61  6e 61 67 65 72 49 6e 69  |l_HeapManagerIni|
0001c250  74 0d 0e d0 2a dd 20 f2  73 68 65 6c 6c 5f 48 65  |t...*. .shell_He|
0001c260  61 70 4d 61 6e 61 67 65  72 49 6e 69 74 28 70 61  |apManagerInit(pa|
0001c270  74 68 24 2c 73 70 61 63  65 25 29 0d 0e d1 14 de  |th$,space%).....|
0001c280  20 68 65 61 70 5f 63 6f  64 65 25 20 39 30 30 0d  | heap_code% 900.|
0001c290  0e d2 2d ff 28 22 4c 4f  41 44 20 22 2b 70 61 74  |..-.("LOAD "+pat|
0001c2a0  68 24 2b 22 68 65 61 70  63 6f 64 65 20 22 2b c3  |h$+"heapcode "+.|
0001c2b0  7e 68 65 61 70 5f 63 6f  64 65 25 29 0d 0e d3 19  |~heap_code%)....|
0001c2c0  d6 20 68 65 61 70 5f 63  6f 64 65 25 2b 30 2c 73  |. heap_code%+0,s|
0001c2d0  70 61 63 65 25 0d 0e d4  05 e1 0d 0e d5 05 3a 0d  |pace%.........:.|
0001c2e0  0e d6 24 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |..$*|Stop PROCsh|
0001c2f0  65 6c 6c 5f 48 65 61 70  4d 61 6e 61 67 65 72 49  |ell_HeapManagerI|
0001c300  6e 69 74 0d 0e d7 23 2a  7c 53 74 61 72 74 20 46  |nit...#*|Start F|
0001c310  4e 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |Nshell_HeapBlock|
0001c320  45 78 69 73 74 73 0d 0e  d8 23 dd 20 a4 73 68 65  |Exists...#. .she|
0001c330  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 45 78 69 73  |ll_HeapBlockExis|
0001c340  74 73 28 61 64 64 72 25  29 0d 0e d9 0b ea 20 76  |ts(addr%)..... v|
0001c350  6f 69 64 25 0d 0e da 07  ea 20 85 0d 0e db 10 ee  |oid%..... ......|
0001c360  20 85 20 ea 3a f7 20 85  3a 3d a3 0d 0e dc 3f e7  | . .:. .:=....?.|
0001c370  20 61 64 64 72 25 3c 26  38 30 30 30 20 8c 20 85  | addr%<&8000 . .|
0001c380  20 39 39 2c 22 4e 6f 20  68 65 61 70 62 6c 6f 63  | 99,"No heapbloc|
0001c390  6b 20 64 65 66 69 6e 65  64 20 61 74 20 74 68 69  |k defined at thi|
0001c3a0  73 20 61 64 64 72 65 73  73 22 0d 0e dd 25 76 6f  |s address"...%vo|
0001c3b0  69 64 25 3d a4 73 68 65  6c 6c 5f 48 65 61 70 42  |id%=.shell_HeapB|
0001c3c0  6c 6f 63 6b 49 6e 66 6f  28 61 64 64 72 25 29 0d  |lockInfo(addr%).|
0001c3d0  0e de 0a f7 20 85 3a 3d  b9 0d 0e df 22 2a 7c 53  |.... .:=...."*|S|
0001c3e0  74 6f 70 20 46 4e 73 68  65 6c 6c 5f 48 65 61 70  |top FNshell_Heap|
0001c3f0  42 6c 6f 63 6b 45 78 69  73 74 73 0d 0e e0 05 3a  |BlockExists....:|
0001c400  0d 0e e1 23 2a 7c 53 74  61 72 74 20 46 4e 73 68  |...#*|Start FNsh|
0001c410  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 45 78 74  |ell_HeapBlockExt|
0001c420  65 6e 64 0d 0e e2 37 2a  7c 21 46 75 6e 63 74 69  |end...7*|!Functi|
0001c430  6f 6e 20 74 6f 20 65 78  74 65 6e 64 20 61 6c 72  |on to extend alr|
0001c440  65 61 64 79 20 61 6c 6c  6f 63 61 74 65 64 20 68  |eady allocated h|
0001c450  65 61 70 20 62 6c 6f 63  6b 2e 0d 0e e3 24 2a 7c  |eap block....$*||
0001c460  21 61 25 20 3d 20 63 75  72 72 65 6e 74 20 61 64  |!a% = current ad|
0001c470  64 72 65 73 73 20 6f 66  20 62 6c 6f 63 6b 0d 0e  |dress of block..|
0001c480  e4 4a 2a 7c 21 62 25 20  3d 20 61 6d 6f 75 6e 74  |.J*|!b% = amount|
0001c490  20 74 6f 20 69 6e 63 72  65 61 73 65 20 6f 72 20  | to increase or |
0001c4a0  64 65 63 72 65 61 73 65  20 62 6c 6f 63 6b 20 73  |decrease block s|
0001c4b0  69 7a 65 20 62 79 20 28  2d 76 65 20 74 6f 20 64  |ize by (-ve to d|
0001c4c0  65 63 72 65 61 73 65 29  0d 0e e5 34 2a 7c 21 72  |ecrease)...4*|!r|
0001c4d0  65 74 75 72 6e 73 20 61  64 64 72 65 73 73 20 6f  |eturns address o|
0001c4e0  66 20 62 6c 6f 63 6b 20  28 62 6c 6f 63 6b 20 6d  |f block (block m|
0001c4f0  61 79 20 62 65 20 6d 6f  76 65 64 29 0d 0e e6 23  |ay be moved)...#|
0001c500  dd 20 a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |. .shell_HeapBlo|
0001c510  63 6b 45 78 74 65 6e 64  28 61 25 2c 62 25 29 0d  |ckExtend(a%,b%).|
0001c520  0e e7 19 d6 20 68 65 61  70 5f 63 6f 64 65 25 2b  |.... heap_code%+|
0001c530  31 32 2c 61 25 2c 62 25  0d 0e e8 07 3d 61 25 0d  |12,a%,b%....=a%.|
0001c540  0e e9 22 2a 7c 53 74 6f  70 20 46 4e 73 68 65 6c  |.."*|Stop FNshel|
0001c550  6c 5f 48 65 61 70 42 6c  6f 63 6b 45 78 74 65 6e  |l_HeapBlockExten|
0001c560  64 0d 0e ea 22 2a 7c 53  74 61 72 74 20 46 4e 73  |d..."*|Start FNs|
0001c570  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 46 65  |hell_HeapBlockFe|
0001c580  74 63 68 0d 0e eb 2f 2a  7c 21 46 75 6e 63 74 69  |tch.../*|!Functi|
0001c590  6f 6e 20 74 6f 20 61 6c  6c 6f 63 61 74 65 20 61  |on to allocate a|
0001c5a0  20 62 6c 6f 63 6b 20 6f  6e 20 74 68 65 20 68 65  | block on the he|
0001c5b0  61 70 0d 0e ec 2c 2a 7c  21 61 25 20 3d 20 73 69  |ap...,*|!a% = si|
0001c5c0  7a 65 20 6f 66 20 62 6c  6f 63 6b 20 74 6f 20 66  |ze of block to f|
0001c5d0  65 74 63 68 20 66 72 6f  6d 20 68 65 61 70 0d 0e  |etch from heap..|
0001c5e0  ed 29 2a 7c 21 72 65 74  75 72 6e 73 20 61 64 64  |.)*|!returns add|
0001c5f0  72 65 73 73 20 6f 66 20  61 6c 6c 6f 63 61 74 65  |ress of allocate|
0001c600  64 20 62 6c 6f 63 6b 0d  0e ee 1f dd 20 a4 73 68  |d block..... .sh|
0001c610  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
0001c620  63 68 28 61 25 29 0d 0e  ef 0b ea 20 61 64 64 72  |ch(a%)..... addr|
0001c630  25 0d 0e f0 1b d6 20 68  65 61 70 5f 63 6f 64 65  |%..... heap_code|
0001c640  25 2b 34 2c 61 64 64 72  25 2c 61 25 0d 0e f1 0a  |%+4,addr%,a%....|
0001c650  3d 61 64 64 72 25 0d 0e  f2 21 2a 7c 53 74 6f 70  |=addr%...!*|Stop|
0001c660  20 46 4e 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  | FNshell_HeapBlo|
0001c670  63 6b 46 65 74 63 68 0d  0e f3 25 2a 7c 53 74 61  |ckFetch...%*|Sta|
0001c680  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 48 65 61  |rt PROCshell_Hea|
0001c690  70 42 6c 6f 63 6b 52 65  74 75 72 6e 0d 0e f4 33  |pBlockReturn...3|
0001c6a0  2a 7c 21 50 72 6f 63 65  64 75 72 65 20 74 6f 20  |*|!Procedure to |
0001c6b0  72 65 74 75 72 6e 20 61  20 68 65 61 70 20 62 6c  |return a heap bl|
0001c6c0  6f 63 6b 20 74 6f 20 74  68 65 20 68 65 61 70 0d  |ock to the heap.|
0001c6d0  0e f5 2a 2a 7c 21 61 25  20 3d 20 61 64 64 72 65  |..**|!a% = addre|
0001c6e0  73 73 20 6f 66 20 62 6c  6f 63 6b 20 74 6f 20 64  |ss of block to d|
0001c6f0  65 61 6c 6c 6f 63 61 74  65 0d 0e f6 22 dd 20 f2  |eallocate...". .|
0001c700  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 52  |shell_HeapBlockR|
0001c710  65 74 75 72 6e 28 f8 20  61 25 29 0d 0e f7 34 e7  |eturn(. a%)...4.|
0001c720  20 a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
0001c730  6b 45 78 69 73 74 73 28  61 25 29 20 8c 20 d6 20  |kExists(a%) . . |
0001c740  68 65 61 70 5f 63 6f 64  65 25 2b 38 2c 61 25 0d  |heap_code%+8,a%.|
0001c750  0e f8 08 61 25 3d 30 0d  0e f9 05 e1 0d 0e fa 24  |...a%=0........$|
0001c760  2a 7c 53 74 6f 70 20 50  52 4f 43 73 68 65 6c 6c  |*|Stop PROCshell|
0001c770  5f 48 65 61 70 42 6c 6f  63 6b 52 65 74 75 72 6e  |_HeapBlockReturn|
0001c780  0d 0e fb 21 2a 7c 53 74  61 72 74 20 46 4e 73 68  |...!*|Start FNsh|
0001c790  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 49 6e 66  |ell_HeapBlockInf|
0001c7a0  6f 0d 0e fc 38 2a 7c 21  46 75 6e 63 74 69 6f 6e  |o...8*|!Function|
0001c7b0  20 74 6f 20 72 65 74 75  72 6e 20 63 75 72 72 65  | to return curre|
0001c7c0  6e 74 20 6c 65 6e 67 74  68 20 6f 66 20 61 20 68  |nt length of a h|
0001c7d0  65 61 70 20 62 6c 6f 63  6b 0d 0e fd 1e 2a 7c 21  |eap block....*|!|
0001c7e0  61 25 20 3d 20 61 64 64  72 20 6f 66 20 68 65 61  |a% = addr of hea|
0001c7f0  70 20 62 6c 6f 63 6b 0d  0e fe 1e dd 20 a4 73 68  |p block..... .sh|
0001c800  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 49 6e 66  |ell_HeapBlockInf|
0001c810  6f 28 61 25 29 0d 0e ff  08 ea 20 72 33 0d 0f 00  |o(a%)..... r3...|
0001c820  2e c8 99 20 22 4f 53 5f  48 65 61 70 22 2c 36 2c  |... "OS_Heap",6,|
0001c830  21 28 68 65 61 70 5f 63  6f 64 65 25 2b 32 38 29  |!(heap_code%+28)|
0001c840  2c 61 25 20 b8 20 2c 2c  2c 72 33 0d 0f 01 07 3d  |,a% . ,,,r3....=|
0001c850  72 33 0d 0f 02 05 3a 0d  0f 03 05 3a 0d 0f 04 20  |r3....:....:... |
0001c860  2a 7c 53 74 6f 70 20 46  4e 73 68 65 6c 6c 5f 48  |*|Stop FNshell_H|
0001c870  65 61 70 42 6c 6f 63 6b  49 6e 66 6f 0d 0f 05 1f  |eapBlockInfo....|
0001c880  2a 7c 53 74 61 72 74 20  46 4e 73 68 65 6c 6c 5f  |*|Start FNshell_|
0001c890  4f 53 56 61 72 45 78 69  73 74 73 0d 0f 06 2a dd  |OSVarExists...*.|
0001c8a0  20 a4 73 68 65 6c 6c 5f  4f 53 56 61 72 45 78 69  | .shell_OSVarExi|
0001c8b0  73 74 73 28 62 75 66 66  65 72 25 2c 76 61 72 6e  |sts(buffer%,varn|
0001c8c0  61 6d 65 24 29 0d 0f 07  0e ea 20 6e 72 5f 62 79  |ame$)..... nr_by|
0001c8d0  74 65 73 0d 0f 08 3c c8  99 20 22 58 4f 53 5f 52  |tes...<.. "XOS_R|
0001c8e0  65 61 64 56 61 72 56 61  6c 22 2c 76 61 72 6e 61  |eadVarVal",varna|
0001c8f0  6d 65 24 2c 62 75 66 66  65 72 25 2c 2d 31 2c 30  |me$,buffer%,-1,0|
0001c900  2c 30 20 b8 20 2c 2c 6e  72 5f 62 79 74 65 73 0d  |,0 . ,,nr_bytes.|
0001c910  0f 09 15 e7 20 6e 72 5f  62 79 74 65 73 3c 30 20  |.... nr_bytes<0 |
0001c920  8c 20 3d b9 0d 0f 0a 06  3d a3 0d 0f 0b 05 3a 0d  |. =.....=.....:.|
0001c930  0f 0c 1e 2a 7c 53 74 6f  70 20 46 4e 73 68 65 6c  |...*|Stop FNshel|
0001c940  6c 5f 4f 53 56 61 72 45  78 69 73 74 73 0d 0f 0d  |l_OSVarExists...|
0001c950  1f 2a 7c 53 74 61 72 74  20 46 4e 73 68 65 6c 6c  |.*|Start FNshell|
0001c960  5f 4f 53 56 61 72 47 65  74 56 61 6c 0d 0f 0e 37  |_OSVarGetVal...7|
0001c970  dd 20 a4 73 68 65 6c 6c  5f 4f 53 56 61 72 47 65  |. .shell_OSVarGe|
0001c980  74 56 61 6c 28 62 75 66  66 65 72 25 2c 73 69 7a  |tVal(buffer%,siz|
0001c990  65 25 2c 76 61 72 6e 61  6d 65 24 2c 65 78 70 61  |e%,varname$,expa|
0001c9a0  6e 64 29 0d 0f 0f 1e ea  20 76 61 6c 75 65 24 2c  |nd)..... value$,|
0001c9b0  6e 72 5f 62 79 74 65 73  2c 6e 61 6d 65 70 74 72  |nr_bytes,nameptr|
0001c9c0  25 0d 0f 10 5a c8 99 20  22 58 4f 53 5f 52 65 61  |%...Z.. "XOS_Rea|
0001c9d0  64 56 61 72 56 61 6c 22  2c 76 61 72 6e 61 6d 65  |dVarVal",varname|
0001c9e0  24 2c 62 75 66 66 65 72  25 2c 73 69 7a 65 25 2c  |$,buffer%,size%,|
0001c9f0  30 2c 2d 33 2a 28 65 78  70 61 6e 64 3d b9 29 20  |0,-3*(expand=.) |
0001ca00  b8 20 2c 2c 6e 72 5f 62  79 74 65 73 2c 6e 61 6d  |. ,,nr_bytes,nam|
0001ca10  65 70 74 72 25 2c 74 79  70 65 25 0d 0f 11 1a e3  |eptr%,type%.....|
0001ca20  20 6c 6f 6f 70 25 3d 30  20 b8 20 6e 72 5f 62 79  | loop%=0 . nr_by|
0001ca30  74 65 73 2d 31 0d 0f 12  24 20 20 76 61 6c 75 65  |tes-1...$  value|
0001ca40  24 3d 76 61 6c 75 65 24  2b bd 28 62 75 66 66 65  |$=value$+.(buffe|
0001ca50  72 25 3f 6c 6f 6f 70 25  29 0d 0f 13 0b ed 20 6c  |r%?loop%)..... l|
0001ca60  6f 6f 70 25 0d 0f 14 0b  3d 76 61 6c 75 65 24 0d  |oop%....=value$.|
0001ca70  0f 15 05 3a 0d 0f 16 1e  2a 7c 53 74 6f 70 20 46  |...:....*|Stop F|
0001ca80  4e 73 68 65 6c 6c 5f 4f  53 56 61 72 47 65 74 56  |Nshell_OSVarGetV|
0001ca90  61 6c 0d 0f 17 24 2a 7c  53 74 61 72 74 20 46 4e  |al...$*|Start FN|
0001caa0  73 68 65 6c 6c 5f 4f 53  52 65 61 64 43 6f 6d 6d  |shell_OSReadComm|
0001cab0  61 6e 64 41 72 67 0d 0f  18 22 dd 20 a4 73 68 65  |andArg...". .she|
0001cac0  6c 6c 5f 4f 53 52 65 61  64 43 6f 6d 6d 61 6e 64  |ll_OSReadCommand|
0001cad0  41 72 67 28 6f 70 74 29  0d 0f 19 1f ea 20 70 6f  |Arg(opt)..... po|
0001cae0  69 6e 74 65 72 25 2c 63  6f 6d 6d 61 6e 64 24 2c  |inter%,command$,|
0001caf0  6f 66 66 73 65 74 25 0d  0f 1a 19 63 6f 6d 6d 61  |offset%....comma|
0001cb00  6e 64 24 3d 22 22 3a 6f  66 66 73 65 74 25 3d 30  |nd$="":offset%=0|
0001cb10  0d 0f 1b 1d c8 99 20 22  4f 53 5f 47 65 74 45 6e  |...... "OS_GetEn|
0001cb20  76 22 20 b8 20 70 6f 69  6e 74 65 72 25 0d 0f 1c  |v" . pointer%...|
0001cb30  1a c8 95 20 70 6f 69 6e  74 65 72 25 3f 6f 66 66  |... pointer%?off|
0001cb40  73 65 74 25 3c 3e 30 0d  0f 1d 23 20 20 63 6f 6d  |set%<>0...#  com|
0001cb50  6d 61 6e 64 24 2b 3d bd  28 70 6f 69 6e 74 65 72  |mand$+=.(pointer|
0001cb60  25 3f 6f 66 66 73 65 74  25 29 0d 0f 1e 10 20 20  |%?offset%)....  |
0001cb70  6f 66 66 73 65 74 25 2b  3d 31 0d 0f 1f 05 ce 0d  |offset%+=1......|
0001cb80  0f 20 0c c8 8e 20 6f 70  74 20 ca 0d 0f 21 09 20  |. ... opt ...!. |
0001cb90  20 c9 20 30 0d 0f 22 09  20 20 c9 20 31 0d 0f 23  | . 0..".  . 1..#|
0001cba0  2c 20 20 20 20 63 6f 6d  6d 61 6e 64 24 3d c1 63  |,    command$=.c|
0001cbb0  6f 6d 6d 61 6e 64 24 2c  a7 63 6f 6d 6d 61 6e 64  |ommand$,.command|
0001cbc0  24 2c bd 33 34 29 2b 31  29 0d 0f 24 2c 20 20 20  |$,.34)+1)..$,   |
0001cbd0  20 63 6f 6d 6d 61 6e 64  24 3d c1 63 6f 6d 6d 61  | command$=.comma|
0001cbe0  6e 64 24 2c a7 63 6f 6d  6d 61 6e 64 24 2c bd 33  |nd$,.command$,.3|
0001cbf0  34 29 2b 32 29 0d 0f 25  05 cb 0d 0f 26 0d 3d 63  |4)+2)..%....&.=c|
0001cc00  6f 6d 6d 61 6e 64 24 0d  0f 27 05 3a 0d 0f 28 23  |ommand$..'.:..(#|
0001cc10  2a 7c 53 74 6f 70 20 46  4e 73 68 65 6c 6c 5f 4f  |*|Stop FNshell_O|
0001cc20  53 52 65 61 64 43 6f 6d  6d 61 6e 64 41 72 67 0d  |SReadCommandArg.|
0001cc30  0f 29 27 2a 7c 53 74 61  72 74 20 46 4e 73 68 65  |.)'*|Start FNshe|
0001cc40  6c 6c 5f 53 74 72 69 6e  67 53 74 72 69 70 54 72  |ll_StringStripTr|
0001cc50  61 69 6c 69 6e 67 0d 0f  2a 2f dd 20 a4 73 68 65  |ailing..*/. .she|
0001cc60  6c 6c 5f 53 74 72 69 6e  67 53 74 72 69 70 54 72  |ll_StringStripTr|
0001cc70  61 69 6c 69 6e 67 28 73  74 72 69 6e 67 24 2c 63  |ailing(string$,c|
0001cc80  68 61 72 24 29 0d 0f 2b  1a c8 95 20 c2 73 74 72  |har$)..+... .str|
0001cc90  69 6e 67 24 2c 31 29 20  3d 20 63 68 61 72 24 0d  |ing$,1) = char$.|
0001cca0  0f 2c 28 20 20 73 74 72  69 6e 67 24 20 3d 20 c0  |.,(  string$ = .|
0001ccb0  73 74 72 69 6e 67 24 2c  a9 28 73 74 72 69 6e 67  |string$,.(string|
0001ccc0  24 29 20 2d 20 31 29 0d  0f 2d 05 ce 0d 0f 2e 0d  |$) - 1)..-......|
0001ccd0  3d 20 73 74 72 69 6e 67  24 0d 0f 2f 05 3a 0d 0f  |= string$../.:..|
0001cce0  30 26 2a 7c 53 74 6f 70  20 46 4e 73 68 65 6c 6c  |0&*|Stop FNshell|
0001ccf0  5f 53 74 72 69 6e 67 53  74 72 69 70 54 72 61 69  |_StringStripTrai|
0001cd00  6c 69 6e 67 0d 0f 31 26  2a 7c 53 74 61 72 74 20  |ling..1&*|Start |
0001cd10  46 4e 73 68 65 6c 6c 5f  53 74 72 69 6e 67 53 74  |FNshell_StringSt|
0001cd20  72 69 70 4c 65 61 64 69  6e 67 0d 0f 32 2e dd 20  |ripLeading..2.. |
0001cd30  a4 73 68 65 6c 6c 5f 53  74 72 69 6e 67 53 74 72  |.shell_StringStr|
0001cd40  69 70 4c 65 61 64 69 6e  67 28 73 74 72 69 6e 67  |ipLeading(string|
0001cd50  24 2c 63 68 61 72 24 29  0d 0f 33 1a c8 95 20 c0  |$,char$)..3... .|
0001cd60  73 74 72 69 6e 67 24 2c  31 29 20 3d 20 63 68 61  |string$,1) = cha|
0001cd70  72 24 0d 0f 34 1b 20 20  73 74 72 69 6e 67 24 20  |r$..4.  string$ |
0001cd80  3d 20 c1 73 74 72 69 6e  67 24 2c 32 29 0d 0f 35  |= .string$,2)..5|
0001cd90  05 ce 0d 0f 36 0d 3d 20  73 74 72 69 6e 67 24 0d  |....6.= string$.|
0001cda0  0f 37 05 3a 0d 0f 38 25  2a 7c 53 74 6f 70 20 46  |.7.:..8%*|Stop F|
0001cdb0  4e 73 68 65 6c 6c 5f 53  74 72 69 6e 67 53 74 72  |Nshell_StringStr|
0001cdc0  69 70 4c 65 61 64 69 6e  67 0d 0f 39 22 2a 7c 53  |ipLeading..9"*|S|
0001cdd0  74 61 72 74 20 46 4e 73  68 65 6c 6c 5f 53 74 72  |tart FNshell_Str|
0001cde0  69 6e 67 53 74 72 69 70  41 6c 6c 0d 0f 3a 2a dd  |ingStripAll..:*.|
0001cdf0  20 a4 73 68 65 6c 6c 5f  53 74 72 69 6e 67 53 74  | .shell_StringSt|
0001ce00  72 69 70 41 6c 6c 28 73  74 72 69 6e 67 24 2c 63  |ripAll(string$,c|
0001ce10  68 61 72 24 29 0d 0f 3b  0e ea 20 64 6f 6e 65 2c  |har$)..;.. done,|
0001ce20  70 6f 73 0d 0f 3c 0a 64  6f 6e 65 3d b9 0d 0f 3d  |pos..<.done=...=|
0001ce30  05 f5 0d 0f 3e 19 20 20  70 6f 73 3d a7 73 74 72  |....>.  pos=.str|
0001ce40  69 6e 67 24 2c 63 68 61  72 24 29 0d 0f 3f 0d 20  |ing$,char$)..?. |
0001ce50  20 e7 20 70 6f 73 20 8c  0d 0f 40 0e 20 20 20 20  | . pos ...@.    |
0001ce60  64 6f 6e 65 3d a3 0d 0f  41 2f 20 20 20 20 73 74  |done=...A/    st|
0001ce70  72 69 6e 67 24 3d c0 73  74 72 69 6e 67 24 2c 70  |ring$=.string$,p|
0001ce80  6f 73 2d 31 29 2b c1 73  74 72 69 6e 67 24 2c 70  |os-1)+.string$,p|
0001ce90  6f 73 2b 31 29 0d 0f 42  07 20 20 cc 0d 0f 43 0e  |os+1)..B.  ...C.|
0001cea0  20 20 20 20 64 6f 6e 65  3d b9 0d 0f 44 07 20 20  |    done=...D.  |
0001ceb0  cd 0d 0f 45 0a fd 20 64  6f 6e 65 0d 0f 46 0c 3d  |...E.. done..F.=|
0001cec0  73 74 72 69 6e 67 24 0d  0f 47 05 3a 0d 0f 48 21  |string$..G.:..H!|
0001ced0  2a 7c 53 74 6f 70 20 46  4e 73 68 65 6c 6c 5f 53  |*|Stop FNshell_S|
0001cee0  74 72 69 6e 67 53 74 72  69 70 41 6c 6c 0d 0f 49  |tringStripAll..I|
0001cef0  25 2a 7c 53 74 61 72 74  20 46 4e 73 68 65 6c 6c  |%*|Start FNshell|
0001cf00  5f 53 74 72 69 6e 67 50  61 64 54 72 61 69 6c 69  |_StringPadTraili|
0001cf10  6e 67 0d 0f 4a 35 dd 20  a4 73 68 65 6c 6c 5f 53  |ng..J5. .shell_S|
0001cf20  74 72 69 6e 67 50 61 64  54 72 61 69 6c 69 6e 67  |tringPadTrailing|
0001cf30  28 73 74 72 69 6e 67 24  2c 63 68 61 72 24 2c 6c  |(string$,char$,l|
0001cf40  65 6e 67 74 68 25 29 0d  0f 4b 1b c8 95 20 a9 28  |ength%)..K... .(|
0001cf50  73 74 72 69 6e 67 24 29  20 3c 20 6c 65 6e 67 74  |string$) < lengt|
0001cf60  68 25 0d 0f 4c 36 20 20  73 74 72 69 6e 67 24 20  |h%..L6  string$ |
0001cf70  3d 20 73 74 72 69 6e 67  24 20 2b 20 c4 6c 65 6e  |= string$ + .len|
0001cf80  67 74 68 25 20 2d 20 a9  28 73 74 72 69 6e 67 24  |gth% - .(string$|
0001cf90  29 2c 63 68 61 72 24 29  0d 0f 4d 05 ce 0d 0f 4e  |),char$)..M....N|
0001cfa0  0d 3d 20 73 74 72 69 6e  67 24 0d 0f 4f 05 3a 0d  |.= string$..O.:.|
0001cfb0  0f 50 24 2a 7c 53 74 6f  70 20 46 4e 73 68 65 6c  |.P$*|Stop FNshel|
0001cfc0  6c 5f 53 74 72 69 6e 67  50 61 64 54 72 61 69 6c  |l_StringPadTrail|
0001cfd0  69 6e 67 0d 0f 51 24 2a  7c 53 74 61 72 74 20 46  |ing..Q$*|Start F|
0001cfe0  4e 73 68 65 6c 6c 5f 53  74 72 69 6e 67 50 61 64  |Nshell_StringPad|
0001cff0  4c 65 61 64 69 6e 67 0d  0f 52 34 dd 20 a4 73 68  |Leading..R4. .sh|
0001d000  65 6c 6c 5f 53 74 72 69  6e 67 50 61 64 4c 65 61  |ell_StringPadLea|
0001d010  64 69 6e 67 28 73 74 72  69 6e 67 24 2c 63 68 61  |ding(string$,cha|
0001d020  72 24 2c 6c 65 6e 67 74  68 25 29 0d 0f 53 1b c8  |r$,length%)..S..|
0001d030  95 20 a9 28 73 74 72 69  6e 67 24 29 20 3c 20 6c  |. .(string$) < l|
0001d040  65 6e 67 74 68 25 0d 0f  54 36 20 20 73 74 72 69  |ength%..T6  stri|
0001d050  6e 67 24 20 3d 20 c4 6c  65 6e 67 74 68 25 20 2d  |ng$ = .length% -|
0001d060  20 a9 28 73 74 72 69 6e  67 24 29 2c 63 68 61 72  | .(string$),char|
0001d070  24 29 20 2b 20 73 74 72  69 6e 67 24 0d 0f 55 05  |$) + string$..U.|
0001d080  ce 0d 0f 56 0d 3d 20 73  74 72 69 6e 67 24 0d 0f  |...V.= string$..|
0001d090  57 05 3a 0d 0f 58 23 2a  7c 53 74 6f 70 20 46 4e  |W.:..X#*|Stop FN|
0001d0a0  73 68 65 6c 6c 5f 53 74  72 69 6e 67 50 61 64 4c  |shell_StringPadL|
0001d0b0  65 61 64 69 6e 67 0d 0f  59 23 2a 7c 53 74 61 72  |eading..Y#*|Star|
0001d0c0  74 20 46 4e 73 68 65 6c  6c 5f 53 74 72 69 6e 67  |t FNshell_String|
0001d0d0  55 70 70 65 72 43 61 73  65 0d 0f 5a 25 dd 20 a4  |UpperCase..Z%. .|
0001d0e0  73 68 65 6c 6c 5f 53 74  72 69 6e 67 55 70 70 65  |shell_StringUppe|
0001d0f0  72 43 61 73 65 28 73 74  72 69 6e 67 24 29 0d 0f  |rCase(string$)..|
0001d100  5b 0b ea 20 6c 6f 6f 70  25 0d 0f 5c 16 e7 20 a9  |[.. loop%..\.. .|
0001d110  28 73 74 72 69 6e 67 24  29 20 3e 20 30 20 8c 0d  |(string$) > 0 ..|
0001d120  0f 5d 1d 20 e3 20 6c 6f  6f 70 25 20 3d 20 31 20  |.]. . loop% = 1 |
0001d130  b8 20 a9 28 73 74 72 69  6e 67 24 29 0d 0f 5e 3a  |. .(string$)..^:|
0001d140  20 20 20 e7 20 c1 73 74  72 69 6e 67 24 2c 6c 6f  |   . .string$,lo|
0001d150  6f 70 25 2c 31 29 3e 3d  22 61 22 20 80 20 c1 73  |op%,1)>="a" . .s|
0001d160  74 72 69 6e 67 24 2c 6c  6f 6f 70 25 2c 31 29 3c  |tring$,loop%,1)<|
0001d170  3d 22 7a 22 20 8c 0d 0f  5f 3a 20 20 20 20 20 c1  |="z" ..._:     .|
0001d180  73 74 72 69 6e 67 24 2c  6c 6f 6f 70 25 2c 31 29  |string$,loop%,1)|
0001d190  20 3d 20 bd 28 97 28 c1  73 74 72 69 6e 67 24 2c  | = .(.(.string$,|
0001d1a0  6c 6f 6f 70 25 2c 31 29  29 20 80 20 26 44 46 29  |loop%,1)) . &DF)|
0001d1b0  0d 0f 60 08 20 20 20 cd  0d 0f 61 0c 20 ed 20 6c  |..`.   ...a. . l|
0001d1c0  6f 6f 70 25 0d 0f 62 05  cd 0d 0f 63 0d 3d 20 73  |oop%..b....c.= s|
0001d1d0  74 72 69 6e 67 24 0d 0f  64 05 3a 0d 0f 65 22 2a  |tring$..d.:..e"*|
0001d1e0  7c 53 74 6f 70 20 46 4e  73 68 65 6c 6c 5f 53 74  ||Stop FNshell_St|
0001d1f0  72 69 6e 67 55 70 70 65  72 43 61 73 65 0d 0f 66  |ringUpperCase..f|
0001d200  22 2a 7c 53 74 61 72 74  20 46 4e 73 68 65 6c 6c  |"*|Start FNshell|
0001d210  5f 53 74 72 69 6e 67 45  78 63 68 61 6e 67 65 0d  |_StringExchange.|
0001d220  0f 67 31 dd 20 a4 73 68  65 6c 6c 5f 53 74 72 69  |.g1. .shell_Stri|
0001d230  6e 67 45 78 63 68 61 6e  67 65 28 73 74 72 69 6e  |ngExchange(strin|
0001d240  67 24 2c 74 61 72 67 65  74 24 2c 73 75 62 24 29  |g$,target$,sub$)|
0001d250  0d 0f 68 0c ea 20 69 6e  64 65 78 25 0d 0f 69 1a  |..h.. index%..i.|
0001d260  e7 20 20 a7 73 74 72 69  6e 67 24 2c 74 61 72 67  |.  .string$,targ|
0001d270  65 74 24 29 20 8c 0d 0f  6a 1e 20 20 69 6e 64 65  |et$) ...j.  inde|
0001d280  78 25 3d a7 73 74 72 69  6e 67 24 2c 74 61 72 67  |x%=.string$,targ|
0001d290  65 74 24 29 0d 0f 6b 3f  20 20 73 74 72 69 6e 67  |et$)..k?  string|
0001d2a0  24 3d c0 73 74 72 69 6e  67 24 2c 69 6e 64 65 78  |$=.string$,index|
0001d2b0  25 2d 31 29 2b 73 75 62  24 2b c1 73 74 72 69 6e  |%-1)+sub$+.strin|
0001d2c0  67 24 2c 69 6e 64 65 78  25 2b a9 74 61 72 67 65  |g$,index%+.targe|
0001d2d0  74 24 29 0d 0f 6c 05 cd  0d 0f 6d 0c 3d 73 74 72  |t$)..l....m.=str|
0001d2e0  69 6e 67 24 0d 0f 6e 05  3a 0d 0f 6f 21 2a 7c 53  |ing$..n.:..o!*|S|
0001d2f0  74 6f 70 20 46 4e 73 68  65 6c 6c 5f 53 74 72 69  |top FNshell_Stri|
0001d300  6e 67 45 78 63 68 61 6e  67 65 0d 0f 70 29 2a 7c  |ngExchange..p)*||
0001d310  53 74 61 72 74 20 46 4e  73 68 65 6c 6c 5f 53 74  |Start FNshell_St|
0001d320  72 69 6e 67 41 72 72 61  79 47 65 74 4c 6f 6e 67  |ringArrayGetLong|
0001d330  65 73 74 0d 0f 71 30 dd  20 a4 73 68 65 6c 6c 5f  |est..q0. .shell_|
0001d340  53 74 72 69 6e 67 41 72  72 61 79 47 65 74 4c 6f  |StringArrayGetLo|
0001d350  6e 67 65 73 74 28 61 72  72 61 79 24 28 29 2c 6e  |ngest(array$(),n|
0001d360  72 25 29 0d 0f 72 14 ea  20 6c 6f 6f 70 25 2c 6c  |r%)..r.. loop%,l|
0001d370  6f 6e 67 65 73 74 25 0d  0f 73 10 6c 6f 6e 67 65  |ongest%..s.longe|
0001d380  73 74 25 20 3d 20 30 0d  0f 74 15 e3 20 6c 6f 6f  |st% = 0..t.. loo|
0001d390  70 25 20 3d 20 30 20 b8  20 6e 72 25 0d 0f 75 25  |p% = 0 . nr%..u%|
0001d3a0  20 20 e7 20 a9 28 61 72  72 61 79 24 28 6c 6f 6f  |  . .(array$(loo|
0001d3b0  70 25 29 29 20 3e 20 6c  6f 6e 67 65 73 74 25 20  |p%)) > longest% |
0001d3c0  8c 0d 0f 76 23 20 20 20  20 6c 6f 6e 67 65 73 74  |...v#    longest|
0001d3d0  25 20 3d 20 a9 28 61 72  72 61 79 24 28 6c 6f 6f  |% = .(array$(loo|
0001d3e0  70 25 29 29 0d 0f 77 07  20 20 cd 0d 0f 78 0b ed  |p%))..w.  ...x..|
0001d3f0  20 6c 6f 6f 70 25 0d 0f  79 0e 3d 20 6c 6f 6e 67  | loop%..y.= long|
0001d400  65 73 74 25 0d 0f 7a 05  3a 0d 0f 7b 28 2a 7c 53  |est%..z.:..{(*|S|
0001d410  74 6f 70 20 46 4e 73 68  65 6c 6c 5f 53 74 72 69  |top FNshell_Stri|
0001d420  6e 67 41 72 72 61 79 47  65 74 4c 6f 6e 67 65 73  |ngArrayGetLonges|
0001d430  74 0d 0f 7c 1b 2a 7c 53  74 61 72 74 20 46 4e 6d  |t..|.*|Start FNm|
0001d440  65 6d 5f 74 6f 5f 73 74  72 69 6e 67 0d 0f 7d 2a  |em_to_string..}*|
0001d450  dd 20 a4 6d 65 6d 5f 74  6f 5f 73 74 72 69 6e 67  |. .mem_to_string|
0001d460  28 62 6c 6f 63 6b 25 2c  6f 66 66 73 65 74 25 2c  |(block%,offset%,|
0001d470  74 65 72 6d 25 29 0d 0f  7e 0d ea 20 73 74 72 69  |term%)..~.. stri|
0001d480  6e 67 24 0d 0f 7f 1c c8  95 20 62 6c 6f 63 6b 25  |ng$...... block%|
0001d490  3f 6f 66 66 73 65 74 25  3c 3e 74 65 72 6d 25 0d  |?offset%<>term%.|
0001d4a0  0f 80 20 20 20 73 74 72  69 6e 67 24 2b 3d bd 28  |..   string$+=.(|
0001d4b0  62 6c 6f 63 6b 25 3f 6f  66 66 73 65 74 25 29 0d  |block%?offset%).|
0001d4c0  0f 81 10 20 20 6f 66 66  73 65 74 25 2b 3d 31 0d  |...  offset%+=1.|
0001d4d0  0f 82 05 ce 0d 0f 83 0c  3d 73 74 72 69 6e 67 24  |........=string$|
0001d4e0  0d 0f 84 05 3a 0d 0f 85  1a 2a 7c 53 74 6f 70 20  |....:....*|Stop |
0001d4f0  46 4e 6d 65 6d 5f 74 6f  5f 73 74 72 69 6e 67 0d  |FNmem_to_string.|
0001d500  0f 86 1e 2a 7c 53 74 61  72 74 20 46 4e 73 68 65  |...*|Start FNshe|
0001d510  6c 6c 5f 46 69 6c 65 4c  65 6e 67 74 68 0d 0f 87  |ll_FileLength...|
0001d520  20 dd 20 a4 73 68 65 6c  6c 5f 46 69 6c 65 4c 65  | . .shell_FileLe|
0001d530  6e 67 74 68 28 6f 62 6a  65 63 74 24 29 0d 0f 88  |ngth(object$)...|
0001d540  37 ea 20 74 79 70 65 25  2c 6c 6f 61 64 5f 61 64  |7. type%,load_ad|
0001d550  64 72 25 2c 65 78 65 63  5f 61 64 64 72 25 2c 6c  |dr%,exec_addr%,l|
0001d560  65 6e 67 74 68 25 2c 61  74 74 73 25 2c 73 74 72  |ength%,atts%,str|
0001d570  69 6e 67 24 0d 0f 89 47  c8 99 20 22 4f 53 5f 46  |ing$...G.. "OS_F|
0001d580  69 6c 65 22 2c 35 2c 6f  62 6a 65 63 74 24 20 b8  |ile",5,object$ .|
0001d590  20 74 79 70 65 25 2c 2c  6c 6f 61 64 5f 61 64 64  | type%,,load_add|
0001d5a0  72 25 2c 65 78 65 63 5f  61 64 64 72 25 2c 6c 65  |r%,exec_addr%,le|
0001d5b0  6e 67 74 68 25 2c 61 74  74 73 25 0d 0f 8a 0c 3d  |ngth%,atts%....=|
0001d5c0  6c 65 6e 67 74 68 25 0d  0f 8b 05 3a 0d 0f 8c 1d  |length%....:....|
0001d5d0  2a 7c 53 74 6f 70 20 46  4e 73 68 65 6c 6c 5f 46  |*|Stop FNshell_F|
0001d5e0  69 6c 65 4c 65 6e 67 74  68 0d 0f 8d 1d 2a 7c 53  |ileLength....*|S|
0001d5f0  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 54  |tart PROCshell_T|
0001d600  72 61 63 65 4f 6e 0d 0f  8e 14 dd 20 f2 73 68 65  |raceOn..... .she|
0001d610  6c 6c 5f 54 72 61 63 65  4f 6e 0d 0f 8f 0c 5f 55  |ll_TraceOn...._U|
0001d620  25 21 34 38 3d b9 0d 0f  90 37 f2 73 68 65 6c 6c  |%!48=....7.shell|
0001d630  5f 42 72 6f 61 64 63 61  73 74 4d 65 73 73 61 67  |_BroadcastMessag|
0001d640  65 28 26 34 33 42 30 30  2c 22 53 68 65 6c 6c 44  |e(&43B00,"ShellD|
0001d650  42 75 67 3a 54 72 61 63  65 4f 6e 22 29 0d 0f 91  |Bug:TraceOn")...|
0001d660  05 e1 0d 0f 92 05 3a 0d  0f 93 1c 2a 7c 53 74 6f  |......:....*|Sto|
0001d670  70 20 50 52 4f 43 73 68  65 6c 6c 5f 54 72 61 63  |p PROCshell_Trac|
0001d680  65 4f 6e 0d 0f 94 1e 2a  7c 53 74 61 72 74 20 50  |eOn....*|Start P|
0001d690  52 4f 43 73 68 65 6c 6c  5f 54 72 61 63 65 4f 66  |ROCshell_TraceOf|
0001d6a0  66 0d 0f 95 15 dd 20 f2  73 68 65 6c 6c 5f 54 72  |f..... .shell_Tr|
0001d6b0  61 63 65 4f 66 66 0d 0f  96 0c 5f 55 25 21 34 38  |aceOff...._U%!48|
0001d6c0  3d a3 0d 0f 97 38 f2 73  68 65 6c 6c 5f 42 72 6f  |=....8.shell_Bro|
0001d6d0  61 64 63 61 73 74 4d 65  73 73 61 67 65 28 26 34  |adcastMessage(&4|
0001d6e0  33 42 30 30 2c 22 53 68  65 6c 6c 44 42 75 67 3a  |3B00,"ShellDBug:|
0001d6f0  54 72 61 63 65 4f 66 66  22 29 0d 0f 98 05 e1 0d  |TraceOff")......|
0001d700  0f 99 05 3a 0d 0f 9a 1d  2a 7c 53 74 6f 70 20 50  |...:....*|Stop P|
0001d710  52 4f 43 73 68 65 6c 6c  5f 54 72 61 63 65 4f 66  |ROCshell_TraceOf|
0001d720  66 0d 0f 9b 1f 2a 7c 53  74 61 72 74 20 50 52 4f  |f....*|Start PRO|
0001d730  43 73 68 65 6c 6c 5f 54  72 61 63 65 49 6e 69 74  |Cshell_TraceInit|
0001d740  0d 0f 9c 16 2a 7c 44 65  66 69 6e 65 20 54 72 61  |....*|Define Tra|
0001d750  63 65 49 6e 69 74 0d 0f  9d 1d dd 20 f2 73 68 65  |ceInit..... .she|
0001d760  6c 6c 5f 54 72 61 63 65  49 6e 69 74 28 66 69 6c  |ll_TraceInit(fil|
0001d770  65 24 29 0d 0f 9e 2a ea  20 66 25 2c 62 6c 6b 25  |e$)...*. f%,blk%|
0001d780  2c 73 68 65 6c 6c 5f 41  70 70 4e 61 6d 65 24 2c  |,shell_AppName$,|
0001d790  73 68 65 6c 6c 5f 41 70  70 44 69 72 24 0d 0f 9f  |shell_AppDir$...|
0001d7a0  11 e7 20 66 69 6c 65 24  3c 3e 22 22 20 8c 0d 0f  |.. file$<>"" ...|
0001d7b0  a0 11 20 20 66 25 3d ae  28 66 69 6c 65 24 29 0d  |..  f%=.(file$).|
0001d7c0  0f a1 0f 20 20 5f 55 25  21 34 34 3d 66 25 0d 0f  |...  _U%!44=f%..|
0001d7d0  a2 05 cd 0d 0f a3 24 62  6c 6b 25 3d a4 73 68 65  |......$blk%=.she|
0001d7e0  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 46 65 74 63  |ll_HeapBlockFetc|
0001d7f0  68 28 31 30 32 34 29 0d  0f a4 3c 73 68 65 6c 6c  |h(1024)...<shell|
0001d800  5f 41 70 70 44 69 72 24  3d a4 73 68 65 6c 6c 5f  |_AppDir$=.shell_|
0001d810  4f 53 56 61 72 47 65 74  56 61 6c 28 62 6c 6b 25  |OSVarGetVal(blk%|
0001d820  2c 31 30 32 34 2c 22 4f  62 65 79 24 44 69 72 22  |,1024,"Obey$Dir"|
0001d830  2c 31 29 0d 0f a5 31 73  68 65 6c 6c 5f 41 70 70  |,1)...1shell_App|
0001d840  4e 61 6d 65 24 3d c1 a4  73 68 65 6c 6c 5f 4c 65  |Name$=..shell_Le|
0001d850  61 66 28 73 68 65 6c 6c  5f 41 70 70 44 69 72 24  |af(shell_AppDir$|
0001d860  29 2c 32 29 0d 0f a6 33  f4 20 73 68 6f 75 6c 64  |),2)...3. should|
0001d870  20 63 68 65 63 6b 20 66  69 72 73 74 20 69 66 20  | check first if |
0001d880  53 68 65 6c 6c 44 42 75  67 20 69 73 20 72 75 6e  |ShellDBug is run|
0001d890  6e 69 6e 67 2e 2e 2e 0d  0f a7 58 f2 73 68 65 6c  |ning......X.shel|
0001d8a0  6c 5f 42 72 6f 61 64 63  61 73 74 4d 65 73 73 61  |l_BroadcastMessa|
0001d8b0  67 65 28 26 34 33 42 30  30 2c 22 53 68 65 6c 6c  |ge(&43B00,"Shell|
0001d8c0  44 42 75 67 3a 49 6e 69  74 20 44 65 62 75 67 20  |DBug:Init Debug |
0001d8d0  6d 65 73 73 61 67 65 73  20 66 72 6f 6d 20 22 2b  |messages from "+|
0001d8e0  73 68 65 6c 6c 5f 41 70  70 4e 61 6d 65 24 29 0d  |shell_AppName$).|
0001d8f0  0f a8 20 f2 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |.. .shell_HeapBl|
0001d900  6f 63 6b 52 65 74 75 72  6e 28 62 6c 6b 25 29 0d  |ockReturn(blk%).|
0001d910  0f a9 05 e1 0d 0f aa 05  3a 0d 0f ab 1e 2a 7c 53  |........:....*|S|
0001d920  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 54 72  |top PROCshell_Tr|
0001d930  61 63 65 49 6e 69 74 0d  0f ac 1d 2a 7c 53 74 61  |aceInit....*|Sta|
0001d940  72 74 20 46 4e 73 68 65  6c 6c 5f 54 72 61 63 65  |rt FNshell_Trace|
0001d950  49 73 4f 6e 0d 0f ad 16  dd 20 a4 73 68 65 6c 6c  |IsOn..... .shell|
0001d960  5f 54 72 61 63 65 49 73  4f 6e 0d 0f ae 0b 3d 5f  |_TraceIsOn....=_|
0001d970  55 25 21 34 38 0d 0f af  05 3a 0d 0f b0 1c 2a 7c  |U%!48....:....*||
0001d980  53 74 6f 70 20 46 4e 73  68 65 6c 6c 5f 54 72 61  |Stop FNshell_Tra|
0001d990  63 65 49 73 4f 6e 0d 0f  b1 1d 2a 7c 53 74 61 72  |ceIsOn....*|Star|
0001d9a0  74 20 50 52 4f 43 73 68  65 6c 6c 5f 54 72 61 63  |t PROCshell_Trac|
0001d9b0  65 66 30 0d 0f b2 18 dd  20 f2 73 68 65 6c 6c 5f  |ef0..... .shell_|
0001d9c0  54 72 61 63 65 66 30 28  61 24 29 0d 0f b3 08 ea  |Tracef0(a$).....|
0001d9d0  20 66 25 0d 0f b4 1d e7  20 ac 28 a4 73 68 65 6c  | f%..... .(.shel|
0001d9e0  6c 5f 54 72 61 63 65 49  73 4f 6e 29 20 8c 20 e1  |l_TraceIsOn) . .|
0001d9f0  0d 0f b5 12 e7 20 5f 55  25 21 34 34 3c 3e 2d 31  |..... _U%!44<>-1|
0001da00  20 8c 0d 0f b6 0f 20 20  66 25 3d 5f 55 25 21 34  | .....  f%=_U%!4|
0001da10  34 0d 0f b7 0d 20 20 d5  23 66 25 2c 61 24 0d 0f  |4....  .#f%,a$..|
0001da20  b8 05 cd 0d 0f b9 29 f4  20 63 68 65 63 6b 20 69  |......). check i|
0001da30  66 20 74 61 73 6b 20 69  64 20 68 61 73 20 62 65  |f task id has be|
0001da40  65 6e 20 73 65 74 20 75  70 2e 2e 2e 0d 0f ba 47  |en set up......G|
0001da50  e7 20 5f 55 25 21 31 34  38 3e 30 20 8c 20 f2 73  |. _U%!148>0 . .s|
0001da60  68 65 6c 6c 5f 42 72 6f  61 64 63 61 73 74 4d 65  |hell_BroadcastMe|
0001da70  73 73 61 67 65 28 26 34  33 42 30 30 2c 22 53 68  |ssage(&43B00,"Sh|
0001da80  65 6c 6c 44 42 75 67 3a  54 72 61 63 65 20 22 2b  |ellDBug:Trace "+|
0001da90  61 24 29 0d 0f bb 05 e1  0d 0f bc 05 3a 0d 0f bd  |a$).........:...|
0001daa0  1c 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  |.*|Stop PROCshel|
0001dab0  6c 5f 54 72 61 63 65 66  30 0d 0f be 1d 2a 7c 53  |l_Tracef0....*|S|
0001dac0  74 61 72 74 20 50 52 4f  43 73 68 65 6c 6c 5f 54  |tart PROCshell_T|
0001dad0  72 61 63 65 66 32 0d 0f  bf 1b dd 20 f2 73 68 65  |racef2..... .she|
0001dae0  6c 6c 5f 54 72 61 63 65  66 32 28 61 64 64 72 25  |ll_Tracef2(addr%|
0001daf0  29 0d 0f c0 17 ff 28 22  4d 45 44 49 54 20 22 2b  |).....("MEDIT "+|
0001db00  c3 7e 61 64 64 72 25 29  0d 0f c1 05 e1 0d 0f c2  |.~addr%)........|
0001db10  05 3a 0d 0f c3 1c 2a 7c  53 74 6f 70 20 50 52 4f  |.:....*|Stop PRO|
0001db20  43 73 68 65 6c 6c 5f 54  72 61 63 65 66 32 0d 0f  |Cshell_Tracef2..|
0001db30  c4 1f 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |..*|Start PROCsh|
0001db40  65 6c 6c 5f 54 72 61 63  65 45 78 69 74 0d 0f c5  |ell_TraceExit...|
0001db50  16 dd 20 f2 73 68 65 6c  6c 5f 54 72 61 63 65 45  |.. .shell_TraceE|
0001db60  78 69 74 0d 0f c6 27 e7  20 5f 55 25 21 34 34 3c  |xit...'. _U%!44<|
0001db70  3e 2d 31 20 8c 20 d9 23  28 5f 55 25 21 34 34 29  |>-1 . .#(_U%!44)|
0001db80  3a 5f 55 25 21 34 34 3d  2d 31 0d 0f c7 1c f4 20  |:_U%!44=-1..... |
0001db90  5f 55 25 21 34 34 3d 2d  31 3a 5f 55 25 21 34 38  |_U%!44=-1:_U%!48|
0001dba0  3d 46 41 4c 53 45 0d 0f  c8 05 e1 0d 0f c9 05 3a  |=FALSE.........:|
0001dbb0  0d 0f ca 1e 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |....*|Stop PROCs|
0001dbc0  68 65 6c 6c 5f 54 72 61  63 65 45 78 69 74 0d 0f  |hell_TraceExit..|
0001dbd0  cb 22 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |."*|Start PROCsh|
0001dbe0  65 6c 6c 5f 41 74 74 61  63 68 48 6f 74 4b 65 79  |ell_AttachHotKey|
0001dbf0  0d 0f cc 47 dd 20 f2 73  68 65 6c 6c 5f 41 74 74  |...G. .shell_Att|
0001dc00  61 63 68 48 6f 74 4b 65  79 28 6b 65 79 24 2c 73  |achHotKey(key$,s|
0001dc10  68 69 66 74 25 2c 63 74  72 6c 25 2c 61 6c 74 25  |hift%,ctrl%,alt%|
0001dc20  2c 77 69 6e 64 6f 77 24  2c 77 68 25 2c 66 6e 31  |,window$,wh%,fn1|
0001dc30  24 2c 66 6e 32 24 29 0d  0f cd 2e ea 20 65 5f 6c  |$,fn2$)..... e_l|
0001dc40  69 73 74 25 2c 6f 66 66  73 65 74 25 2c 74 65 6d  |ist%,offset%,tem|
0001dc50  70 25 2c 74 65 6d 70 32  25 2c 6b 65 79 25 2c 66  |p%,temp2%,key%,f|
0001dc60  5f 6b 65 79 25 0d 0f ce  0c 66 5f 6b 65 79 25 3d  |_key%....f_key%=|
0001dc70  b9 0d 0f cf 10 e7 20 5f  55 25 21 36 30 3d 30 20  |...... _U%!60=0 |
0001dc80  8c 0d 0f d0 26 20 20 5f  55 25 21 36 30 3d a4 73  |....&  _U%!60=.s|
0001dc90  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 46 65  |hell_HeapBlockFe|
0001dca0  74 63 68 28 32 34 29 0d  0f d1 19 20 20 6f 66 66  |tch(24)....  off|
0001dcb0  73 65 74 25 3d 30 3a 5f  55 25 21 31 38 30 3d 31  |set%=0:_U%!180=1|
0001dcc0  0d 0f d2 05 cc 0d 0f d3  18 20 20 6f 66 66 73 65  |.........  offse|
0001dcd0  74 25 3d 5f 55 25 21 31  38 30 2a 32 34 0d 0f d4  |t%=_U%!180*24...|
0001dce0  2e 20 20 5f 55 25 21 36  30 3d a4 73 68 65 6c 6c  |.  _U%!60=.shell|
0001dcf0  5f 48 65 61 70 42 6c 6f  63 6b 45 78 74 65 6e 64  |_HeapBlockExtend|
0001dd00  28 5f 55 25 21 36 30 2c  32 34 29 0d 0f d5 19 20  |(_U%!60,24).... |
0001dd10  20 5f 55 25 21 31 38 30  3d 28 5f 55 25 21 31 38  | _U%!180=(_U%!18|
0001dd20  30 29 2b 31 0d 0f d6 05  cd 0d 0f d7 12 65 5f 6c  |0)+1.........e_l|
0001dd30  69 73 74 25 3d 5f 55 25  21 36 30 0d 0f d8 0d c8  |ist%=_U%!60.....|
0001dd40  8e 20 6b 65 79 24 20 ca  0d 0f d9 16 20 20 c9 20  |. key$ .....  . |
0001dd50  22 46 31 22 20 3a 6b 65  79 25 3d 33 38 35 0d 0f  |"F1" :key%=385..|
0001dd60  da 16 20 20 c9 20 22 46  32 22 20 3a 6b 65 79 25  |..  . "F2" :key%|
0001dd70  3d 33 38 36 0d 0f db 16  20 20 c9 20 22 46 33 22  |=386....  . "F3"|
0001dd80  20 3a 6b 65 79 25 3d 33  38 37 0d 0f dc 16 20 20  | :key%=387....  |
0001dd90  c9 20 22 46 34 22 20 3a  6b 65 79 25 3d 33 38 38  |. "F4" :key%=388|
0001dda0  0d 0f dd 16 20 20 c9 20  22 46 35 22 20 3a 6b 65  |....  . "F5" :ke|
0001ddb0  79 25 3d 33 38 39 0d 0f  de 16 20 20 c9 20 22 46  |y%=389....  . "F|
0001ddc0  36 22 20 3a 6b 65 79 25  3d 33 39 30 0d 0f df 16  |6" :key%=390....|
0001ddd0  20 20 c9 20 22 46 37 22  20 3a 6b 65 79 25 3d 33  |  . "F7" :key%=3|
0001dde0  39 31 0d 0f e0 16 20 20  c9 20 22 46 38 22 20 3a  |91....  . "F8" :|
0001ddf0  6b 65 79 25 3d 33 39 32  0d 0f e1 16 20 20 c9 20  |key%=392....  . |
0001de00  22 46 39 22 20 3a 6b 65  79 25 3d 33 39 33 0d 0f  |"F9" :key%=393..|
0001de10  e2 16 20 20 c9 20 22 46  31 30 22 3a 6b 65 79 25  |..  . "F10":key%|
0001de20  3d 34 35 38 0d 0f e3 16  20 20 c9 20 22 46 31 31  |=458....  . "F11|
0001de30  22 3a 6b 65 79 25 3d 34  35 39 0d 0f e4 05 7f 0d  |":key%=459......|
0001de40  0f e5 1e 20 20 6b 65 79  25 3d 28 97 6b 65 79 24  |...  key%=(.key$|
0001de50  29 2d 36 34 3a 66 5f 6b  65 79 25 3d a3 0d 0f e6  |)-64:f_key%=....|
0001de60  05 cb 0d 0f e7 0e e7 20  66 5f 6b 65 79 25 20 8c  |....... f_key% .|
0001de70  0d 0f e8 19 20 20 e7 20  73 68 69 66 74 25 20 8c  |....  . shift% .|
0001de80  20 6b 65 79 25 2b 3d 31  36 0d 0f e9 19 20 20 e7  | key%+=16....  .|
0001de90  20 63 74 72 6c 25 20 20  8c 20 6b 65 79 25 2b 3d  | ctrl%  . key%+=|
0001dea0  33 32 0d 0f ea 05 cd 0d  0f eb 19 74 65 6d 70 25  |32.........temp%|
0001deb0  3d 65 5f 6c 69 73 74 25  2b 6f 66 66 73 65 74 25  |=e_list%+offset%|
0001dec0  0d 0f ec 10 74 65 6d 70  25 21 30 3d 6b 65 79 25  |....temp%!0=key%|
0001ded0  0d 0f ed 1f 74 65 6d 70  25 3f 34 3d 73 68 69 66  |....temp%?4=shif|
0001dee0  74 25 3a f4 20 73 68 69  66 74 20 66 6c 61 67 0d  |t%:. shift flag.|
0001def0  0f ee 1f 74 65 6d 70 25  3f 35 3d 63 74 72 6c 25  |...temp%?5=ctrl%|
0001df00  20 3a f4 20 63 74 72 6c  20 20 66 6c 61 67 0d 0f  | :. ctrl  flag..|
0001df10  ef 1f 74 65 6d 70 25 3f  36 3d 61 6c 74 25 20 20  |..temp%?6=alt%  |
0001df20  3a f4 20 61 6c 74 20 20  20 66 6c 61 67 0d 0f f0  |:. alt   flag...|
0001df30  2d 74 65 6d 70 25 21 38  3d a4 73 68 65 6c 6c 5f  |-temp%!8=.shell_|
0001df40  48 65 61 70 42 6c 6f 63  6b 46 65 74 63 68 28 a9  |HeapBlockFetch(.|
0001df50  77 69 6e 64 6f 77 24 2b  31 29 0d 0f f1 22 74 65  |window$+1)..."te|
0001df60  6d 70 32 25 3d 74 65 6d  70 25 21 38 3a 24 74 65  |mp2%=temp%!8:$te|
0001df70  6d 70 32 25 3d 77 69 6e  64 6f 77 24 0d 0f f2 0d  |mp2%=window$....|
0001df80  e7 20 77 68 25 3e 30 20  8c 0d 0f f3 30 20 20 f4  |. wh%>0 ....0  .|
0001df90  20 63 68 65 63 6b 20 77  69 6e 64 6f 77 20 68 61  | check window ha|
0001dfa0  6e 64 6c 65 20 69 73 20  69 6e 20 73 74 61 74 69  |ndle is in stati|
0001dfb0  63 20 6c 69 73 74 2e 2e  2e 0d 0f f4 2e 20 20 6f  |c list.......  o|
0001dfc0  66 66 73 65 74 25 3d a4  73 68 65 6c 6c 5f 53 65  |ffset%=.shell_Se|
0001dfd0  61 72 63 68 53 74 61 74  69 63 28 5f 55 25 21 31  |archStatic(_U%!1|
0001dfe0  38 34 2c 77 68 25 29 0d  0f f5 3c 20 20 e7 20 6f  |84,wh%)...<  . o|
0001dff0  66 66 73 65 74 25 3d 2d  31 20 8c 20 85 20 39 39  |ffset%=-1 . . 99|
0001e000  2c a4 73 68 65 6c 6c 5f  4d 65 73 73 61 67 65 4e  |,.shell_MessageN|
0001e010  6f 41 72 67 73 28 22 53  48 45 4c 4c 4d 53 47 30  |oArgs("SHELLMSG0|
0001e020  39 22 29 0d 0f f6 05 cd  0d 0f f7 3f 74 65 6d 70  |9")........?temp|
0001e030  25 21 31 32 3d 77 68 25  3a f4 20 3e 30 20 64 65  |%!12=wh%:. >0 de|
0001e040  6e 6f 74 65 73 20 61 20  77 69 6e 64 6f 77 20 68  |notes a window h|
0001e050  61 6e 64 6c 65 20 74 6f  20 6f 70 65 6e 20 61 73  |andle to open as|
0001e060  20 73 74 61 74 69 63 0d  0f f8 2b 74 65 6d 70 25  | static...+temp%|
0001e070  21 31 36 3d a4 73 68 65  6c 6c 5f 48 65 61 70 42  |!16=.shell_HeapB|
0001e080  6c 6f 63 6b 46 65 74 63  68 28 a9 66 6e 31 24 2b  |lockFetch(.fn1$+|
0001e090  31 29 0d 0f f9 20 74 65  6d 70 32 25 3d 74 65 6d  |1)... temp2%=tem|
0001e0a0  70 25 21 31 36 3a 24 74  65 6d 70 32 25 3d 66 6e  |p%!16:$temp2%=fn|
0001e0b0  31 24 0d 0f fa 2b 74 65  6d 70 25 21 32 30 3d a4  |1$...+temp%!20=.|
0001e0c0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
0001e0d0  65 74 63 68 28 a9 66 6e  32 24 2b 31 29 0d 0f fb  |etch(.fn2$+1)...|
0001e0e0  20 74 65 6d 70 32 25 3d  74 65 6d 70 25 21 32 30  | temp2%=temp%!20|
0001e0f0  3a 24 74 65 6d 70 32 25  3d 66 6e 32 24 0d 0f fc  |:$temp2%=fn2$...|
0001e100  05 e1 0d 0f fd 05 3a 0d  0f fe 21 2a 7c 53 74 6f  |......:...!*|Sto|
0001e110  70 20 50 52 4f 43 73 68  65 6c 6c 5f 41 74 74 61  |p PROCshell_Atta|
0001e120  63 68 48 6f 74 4b 65 79  0d 0f ff 04 0d 10 00 21  |chHotKey.......!|
0001e130  2a 7c 53 74 61 72 74 20  46 4e 73 68 65 6c 6c 5f  |*|Start FNshell_|
0001e140  48 6f 74 4b 65 79 50 72  6f 63 65 73 73 0d 10 01  |HotKeyProcess...|
0001e150  20 dd 20 a4 73 68 65 6c  6c 5f 48 6f 74 4b 65 79  | . .shell_HotKey|
0001e160  50 72 6f 63 65 73 73 28  6b 65 79 25 29 0d 10 02  |Process(key%)...|
0001e170  36 ea 20 65 5f 6c 69 73  74 25 2c 6c 69 73 74 5f  |6. e_list%,list_|
0001e180  73 69 7a 65 25 2c 66 6f  75 6e 64 25 2c 70 74 72  |size%,found%,ptr|
0001e190  25 2c 68 25 2c 77 69 6e  24 2c 66 6e 31 24 2c 66  |%,h%,win$,fn1$,f|
0001e1a0  6e 32 24 0d 10 03 3e ea  20 63 74 72 6c 25 2c 73  |n2$...>. ctrl%,s|
0001e1b0  68 69 66 74 25 2c 61 6c  74 25 2c 78 5f 6f 66 66  |hift%,alt%,x_off|
0001e1c0  25 2c 79 5f 6f 66 66 25  2c 66 6c 61 67 25 2c 6b  |%,y_off%,flag%,k|
0001e1d0  65 79 5f 66 6c 61 67 73  25 2c 6f 66 66 73 65 74  |ey_flags%,offset|
0001e1e0  25 0d 10 04 16 ea 20 72  65 73 75 6c 74 25 2c 77  |%..... result%,w|
0001e1f0  69 6e 5f 62 6c 6b 25 0d  10 05 12 65 5f 6c 69 73  |in_blk%....e_lis|
0001e200  74 25 3d 5f 55 25 21 36  30 0d 10 06 19 6c 69 73  |t%=_U%!60....lis|
0001e210  74 5f 73 69 7a 65 25 3d  5f 55 25 21 31 38 30 2a  |t_size%=_U%!180*|
0001e220  32 34 0d 10 07 13 66 6f  75 6e 64 25 3d a3 3a 70  |24....found%=.:p|
0001e230  74 72 25 3d 30 0d 10 08  05 f5 0d 10 09 1b 20 20  |tr%=0.........  |
0001e240  e7 20 65 5f 6c 69 73 74  25 21 70 74 72 25 3d 6b  |. e_list%!ptr%=k|
0001e250  65 79 25 20 8c 0d 10 0a  10 20 20 20 20 66 6f 75  |ey% .....    fou|
0001e260  6e 64 25 3d b9 0d 10 0b  07 20 20 cc 0d 10 0c 10  |nd%=.....  .....|
0001e270  20 20 20 20 70 74 72 25  2b 3d 32 34 0d 10 0d 07  |    ptr%+=24....|
0001e280  20 20 cd 0d 10 0e 1f fd  20 66 6f 75 6e 64 25 20  |  ...... found% |
0001e290  84 20 70 74 72 25 3e 3d  6c 69 73 74 5f 73 69 7a  |. ptr%>=list_siz|
0001e2a0  65 25 0d 10 0f 0e e7 20  66 6f 75 6e 64 25 20 8c  |e%..... found% .|
0001e2b0  0d 10 10 18 20 20 74 65  6d 70 25 3d 65 5f 6c 69  |....  temp%=e_li|
0001e2c0  73 74 25 2b 70 74 72 25  0d 10 11 15 20 20 77 69  |st%+ptr%....  wi|
0001e2d0  6e 24 3d 24 28 74 65 6d  70 25 21 38 29 0d 10 12  |n$=$(temp%!8)...|
0001e2e0  17 20 20 2a 7c 69 66 64  65 66 20 54 72 61 63 65  |.  *|ifdef Trace|
0001e2f0  49 6e 69 74 0d 10 13 41  20 20 f2 73 68 65 6c 6c  |Init...A  .shell|
0001e300  5f 54 72 61 63 65 66 30  28 22 48 6f 74 4b 65 79  |_Tracef0("HotKey|
0001e310  50 72 6f 63 65 73 73 3a  54 65 6d 70 6c 61 74 65  |Process:Template|
0001e320  20 6e 61 6d 65 20 69 73  20 27 22 2b 77 69 6e 24  | name is '"+win$|
0001e330  2b 22 27 22 29 0d 10 14  0d 20 20 2a 7c 65 6e 64  |+"'")....  *|end|
0001e340  69 66 0d 10 15 21 20 20  e7 20 28 77 69 6e 24 3c  |if...!  . (win$<|
0001e350  3e 22 22 20 80 20 74 65  6d 70 25 21 31 32 3d 30  |>"" . temp%!12=0|
0001e360  29 20 8c 0d 10 16 35 20  20 20 20 f4 20 6f 6e 6c  |) ....5    . onl|
0001e370  79 20 63 72 65 61 74 65  20 61 20 77 69 6e 64 6f  |y create a windo|
0001e380  77 20 69 66 20 69 74 20  69 73 20 61 20 64 79 6e  |w if it is a dyn|
0001e390  61 6d 69 63 20 6f 6e 65  0d 10 17 32 20 20 20 20  |amic one...2    |
0001e3a0  f4 20 73 74 61 74 69 63  20 77 69 6e 64 6f 77 73  |. static windows|
0001e3b0  20 68 61 76 65 20 61 6c  72 65 61 64 79 20 62 65  | have already be|
0001e3c0  65 6e 20 63 72 65 61 74  65 64 0d 10 18 24 20 20  |en created...$  |
0001e3d0  20 20 f2 73 68 65 6c 6c  5f 43 72 65 61 74 65 57  |  .shell_CreateW|
0001e3e0  69 6e 64 6f 77 28 77 69  6e 24 2c 68 25 29 0d 10  |indow(win$,h%)..|
0001e3f0  19 19 20 20 20 20 2a 7c  69 66 64 65 66 20 54 72  |..    *|ifdef Tr|
0001e400  61 63 65 49 6e 69 74 0d  10 1a 59 20 20 20 20 f2  |aceInit...Y    .|
0001e410  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 48  |shell_Tracef0("H|
0001e420  6f 74 4b 65 79 50 72 6f  63 65 73 73 3a 43 72 65  |otKeyProcess:Cre|
0001e430  61 74 69 6e 67 20 6e 65  77 20 64 79 6e 61 6d 69  |ating new dynami|
0001e440  63 20 77 69 6e 64 6f 77  20 28 68 61 6e 64 6c 65  |c window (handle|
0001e450  20 69 73 20 26 22 2b c3  7e 68 25 2b 22 29 22 29  | is &"+.~h%+")")|
0001e460  0d 10 1b 0f 20 20 20 20  2a 7c 65 6e 64 69 66 0d  |....    *|endif.|
0001e470  10 1c 2a 20 20 20 20 77  69 6e 5f 62 6c 6b 25 3d  |..*    win_blk%=|
0001e480  a4 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
0001e490  46 65 74 63 68 28 33 36  29 0d 10 1d 15 20 20 20  |Fetch(36)....   |
0001e4a0  20 77 69 6e 5f 62 6c 6b  25 21 30 3d 68 25 0d 10  | win_blk%!0=h%..|
0001e4b0  1e 2a 20 20 20 20 c8 99  20 22 57 69 6d 70 5f 47  |.*    .. "Wimp_G|
0001e4c0  65 74 57 69 6e 64 6f 77  53 74 61 74 65 22 2c 2c  |etWindowState",,|
0001e4d0  77 69 6e 5f 62 6c 6b 25  0d 10 1f 29 20 20 20 20  |win_blk%...)    |
0001e4e0  78 5f 6f 66 66 25 3d 28  77 69 6e 5f 62 6c 6b 25  |x_off%=(win_blk%|
0001e4f0  21 34 2d 77 69 6e 5f 62  6c 6b 25 21 31 32 29 2f  |!4-win_blk%!12)/|
0001e500  32 0d 10 20 29 20 20 20  20 79 5f 6f 66 66 25 3d  |2.. )    y_off%=|
0001e510  28 77 69 6e 5f 62 6c 6b  25 21 31 36 2d 77 69 6e  |(win_blk%!16-win|
0001e520  5f 62 6c 6b 25 21 38 29  2f 32 0d 10 21 28 20 20  |_blk%!8)/2..!(  |
0001e530  20 20 f2 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |  .shell_HeapBlo|
0001e540  63 6b 52 65 74 75 72 6e  28 77 69 6e 5f 62 6c 6b  |ckReturn(win_blk|
0001e550  25 29 0d 10 22 07 20 20  cd 0d 10 23 16 20 20 66  |%)..".  ...#.  f|
0001e560  6e 31 24 3d 24 28 74 65  6d 70 25 21 31 36 29 0d  |n1$=$(temp%!16).|
0001e570  10 24 12 20 20 e7 20 66  6e 31 24 3c 3e 22 22 20  |.$.  . fn1$<>"" |
0001e580  8c 0d 10 25 19 20 20 20  20 2a 7c 69 66 64 65 66  |...%.    *|ifdef|
0001e590  20 54 72 61 63 65 49 6e  69 74 0d 10 26 46 20 20  | TraceInit..&F  |
0001e5a0  20 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |  .shell_Tracef0|
0001e5b0  28 22 48 6f 74 4b 65 79  50 72 6f 63 65 73 73 3a  |("HotKeyProcess:|
0001e5c0  43 61 6c 6c 69 6e 67 20  50 72 65 2d 4f 70 65 6e  |Calling Pre-Open|
0001e5d0  20 46 4e 20 27 22 2b 66  6e 31 24 2b 22 27 22 29  | FN '"+fn1$+"'")|
0001e5e0  0d 10 27 0f 20 20 20 20  2a 7c 65 6e 64 69 66 0d  |..'.    *|endif.|
0001e5f0  10 28 16 20 20 20 20 e7  20 74 65 6d 70 25 21 31  |.(.    . temp%!1|
0001e600  32 3e 30 20 8c 0d 10 29  2e 20 20 20 20 20 20 76  |2>0 ...).      v|
0001e610  6f 69 64 25 3d a0 28 22  46 4e 22 2b 66 6e 31 24  |oid%=.("FN"+fn1$|
0001e620  2b 22 28 22 2b c3 74 65  6d 70 25 21 31 32 2b 22  |+"("+.temp%!12+"|
0001e630  29 22 29 0d 10 2a 09 20  20 20 20 cc 0d 10 2b 28  |)")..*.    ...+(|
0001e640  20 20 20 20 20 20 76 6f  69 64 25 3d a0 28 22 46  |      void%=.("F|
0001e650  4e 22 2b 66 6e 31 24 2b  22 28 22 2b c3 68 25 2b  |N"+fn1$+"("+.h%+|
0001e660  22 29 22 29 0d 10 2c 09  20 20 20 20 cd 0d 10 2d  |")")..,.    ...-|
0001e670  07 20 20 cc 0d 10 2e 15  2a 7c 69 66 64 65 66 20  |.  .....*|ifdef |
0001e680  54 72 61 63 65 49 6e 69  74 0d 10 2f 3f 20 20 f2  |TraceInit../?  .|
0001e690  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 48  |shell_Tracef0("H|
0001e6a0  6f 74 4b 65 79 50 72 6f  63 65 73 73 3a 4e 6f 20  |otKeyProcess:No |
0001e6b0  50 72 65 2d 4f 70 65 6e  20 46 4e 20 72 65 67 69  |Pre-Open FN regi|
0001e6c0  73 74 65 72 65 64 22 29  0d 10 30 0b 2a 7c 65 6e  |stered")..0.*|en|
0001e6d0  64 69 66 0d 10 31 07 20  20 cd 0d 10 32 35 20 20  |dif..1.  ...25  |
0001e6e0  20 20 6f 66 66 73 65 74  25 3d a4 73 68 65 6c 6c  |  offset%=.shell|
0001e6f0  5f 53 65 61 72 63 68 53  74 61 74 69 63 28 5f 55  |_SearchStatic(_U|
0001e700  25 21 31 38 34 2c 74 65  6d 70 25 21 31 32 29 0d  |%!184,temp%!12).|
0001e710  10 33 16 20 20 20 20 e7  20 6f 66 66 73 65 74 25  |.3.    . offset%|
0001e720  3e 2d 31 20 8c 0d 10 34  2b 20 20 20 20 20 20 f2  |>-1 ...4+      .|
0001e730  73 68 65 6c 6c 5f 4f 70  65 6e 57 69 6e 64 6f 77  |shell_OpenWindow|
0001e740  53 74 61 74 69 63 28 74  65 6d 70 25 21 31 32 29  |Static(temp%!12)|
0001e750  0d 10 35 09 20 20 20 20  cc 0d 10 36 18 20 20 20  |..5.    ...6.   |
0001e760  20 20 20 e7 20 74 65 6d  70 25 21 31 32 3e 30 20  |   . temp%!12>0 |
0001e770  8c 0d 10 37 40 20 20 20  20 20 20 20 20 f4 20 72  |...7@        . r|
0001e780  65 71 75 65 73 74 20 74  6f 20 6f 70 65 6e 20 61  |equest to open a|
0001e790  20 73 74 61 74 69 63 20  77 69 6e 64 6f 77 2c 20  | static window, |
0001e7a0  62 75 74 20 77 69 6e 64  6f 77 20 68 61 6e 64 6c  |but window handl|
0001e7b0  65 0d 10 38 43 20 20 20  20 20 20 20 20 f4 20 68  |e..8C        . h|
0001e7c0  61 73 20 6e 6f 74 20 62  65 65 6e 20 72 65 67 69  |as not been regi|
0001e7d0  73 74 65 72 65 64 20 77  69 74 68 20 73 68 65 6c  |stered with shel|
0001e7e0  6c 5f 43 72 65 61 74 65  57 69 6e 64 6f 77 53 74  |l_CreateWindowSt|
0001e7f0  61 74 69 63 0d 10 39 33  20 20 20 20 20 20 20 20  |atic..93        |
0001e800  85 20 39 39 2c a4 73 68  65 6c 6c 5f 4d 65 73 73  |. 99,.shell_Mess|
0001e810  61 67 65 4e 6f 41 72 67  73 28 22 53 48 45 4c 4c  |ageNoArgs("SHELL|
0001e820  4d 53 47 30 39 22 29 0d  10 3a 0b 20 20 20 20 20  |MSG09")..:.     |
0001e830  20 cc 0d 10 3b 2e 20 20  20 20 20 20 20 20 f4 20  | ...;.        . |
0001e840  6d 75 73 74 20 62 65 20  61 20 64 79 6e 61 6d 69  |must be a dynami|
0001e850  63 20 77 69 6e 64 6f 77  20 74 68 65 6e 2e 2e 2e  |c window then...|
0001e860  0d 10 3c 36 20 20 20 20  20 20 20 20 f2 73 68 65  |..<6        .she|
0001e870  6c 6c 5f 4f 70 65 6e 57  69 6e 64 6f 77 44 79 6e  |ll_OpenWindowDyn|
0001e880  61 6d 69 63 28 68 25 2c  78 5f 6f 66 66 25 2c 79  |amic(h%,x_off%,y|
0001e890  5f 6f 66 66 25 29 0d 10  3d 0b 20 20 20 20 20 20  |_off%)..=.      |
0001e8a0  cd 0d 10 3e 09 20 20 20  20 cd 0d 10 3f 16 20 20  |...>.    ...?.  |
0001e8b0  66 6e 32 24 3d 24 28 74  65 6d 70 25 21 32 30 29  |fn2$=$(temp%!20)|
0001e8c0  0d 10 40 12 20 20 e7 20  66 6e 32 24 3c 3e 22 22  |..@.  . fn2$<>""|
0001e8d0  20 8c 0d 10 41 19 20 20  20 20 2a 7c 69 66 64 65  | ...A.    *|ifde|
0001e8e0  66 20 54 72 61 63 65 49  6e 69 74 0d 10 42 47 20  |f TraceInit..BG |
0001e8f0  20 20 20 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |   .shell_Tracef|
0001e900  30 28 22 48 6f 74 4b 65  79 50 72 6f 63 65 73 73  |0("HotKeyProcess|
0001e910  3a 43 61 6c 6c 69 6e 67  20 50 6f 73 74 2d 4f 70  |:Calling Post-Op|
0001e920  65 6e 20 46 4e 20 27 22  2b 66 6e 32 24 2b 22 27  |en FN '"+fn2$+"'|
0001e930  22 29 0d 10 43 0f 20 20  20 20 2a 7c 65 6e 64 69  |")..C.    *|endi|
0001e940  66 0d 10 44 16 20 20 20  20 e7 20 74 65 6d 70 25  |f..D.    . temp%|
0001e950  21 31 32 3e 30 20 8c 0d  10 45 2e 20 20 20 20 20  |!12>0 ...E.     |
0001e960  20 76 6f 69 64 25 3d a0  28 22 46 4e 22 2b 66 6e  | void%=.("FN"+fn|
0001e970  31 24 2b 22 28 22 2b c3  74 65 6d 70 25 21 31 32  |1$+"("+.temp%!12|
0001e980  2b 22 29 22 29 0d 10 46  09 20 20 20 20 cc 0d 10  |+")")..F.    ...|
0001e990  47 28 20 20 20 20 20 20  76 6f 69 64 25 3d a0 28  |G(      void%=.(|
0001e9a0  22 46 4e 22 2b 66 6e 32  24 2b 22 28 22 2b c3 68  |"FN"+fn2$+"("+.h|
0001e9b0  25 2b 22 29 22 29 0d 10  48 09 20 20 20 20 cd 0d  |%+")")..H.    ..|
0001e9c0  10 49 07 20 20 cc 0d 10  4a 19 20 20 20 20 2a 7c  |.I.  ...J.    *||
0001e9d0  69 66 64 65 66 20 54 72  61 63 65 49 6e 69 74 0d  |ifdef TraceInit.|
0001e9e0  10 4b 42 20 20 20 20 f2  73 68 65 6c 6c 5f 54 72  |.KB    .shell_Tr|
0001e9f0  61 63 65 66 30 28 22 48  6f 74 4b 65 79 50 72 6f  |acef0("HotKeyPro|
0001ea00  63 65 73 73 3a 4e 6f 20  50 6f 73 74 2d 4f 70 65  |cess:No Post-Ope|
0001ea10  6e 20 46 4e 20 72 65 67  69 73 74 65 72 65 64 22  |n FN registered"|
0001ea20  29 0d 10 4c 0f 20 20 20  20 2a 7c 65 6e 64 69 66  |)..L.    *|endif|
0001ea30  0d 10 4d 07 20 20 cd 0d  10 4e 0f 20 20 72 65 73  |..M.  ...N.  res|
0001ea40  75 6c 74 25 3d b9 0d 10  4f 05 cc 0d 10 50 27 20  |ult%=...O....P' |
0001ea50  20 77 69 6e 24 3d 22 22  3a 66 6e 31 24 3d 22 22  | win$="":fn1$=""|
0001ea60  3a 66 6e 32 24 3d 22 22  3a 72 65 73 75 6c 74 25  |:fn2$="":result%|
0001ea70  3d a3 0d 10 51 05 cd 0d  10 52 0c 3d 72 65 73 75  |=...Q....R.=resu|
0001ea80  6c 74 25 0d 10 53 05 3a  0d 10 54 20 2a 7c 53 74  |lt%..S.:..T *|St|
0001ea90  6f 70 20 46 4e 73 68 65  6c 6c 5f 48 6f 74 4b 65  |op FNshell_HotKe|
0001eaa0  79 50 72 6f 63 65 73 73  0d 10 55 04 0d 10 56 2d  |yProcess..U...V-|
0001eab0  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
0001eac0  6c 5f 4f 70 65 6e 57 69  6e 64 6f 77 53 74 61 74  |l_OpenWindowStat|
0001ead0  69 63 4e 65 77 56 69 65  77 0d 10 57 29 dd 20 f2  |icNewView..W). .|
0001eae0  73 68 65 6c 6c 5f 4f 70  65 6e 57 69 6e 64 6f 77  |shell_OpenWindow|
0001eaf0  53 74 61 74 69 63 4e 65  77 56 69 65 77 28 77 68  |StaticNewView(wh|
0001eb00  25 29 0d 10 58 1f f2 73  68 65 6c 6c 5f 4f 70 65  |%)..X..shell_Ope|
0001eb10  6e 57 69 6e 64 6f 77 28  77 68 25 2c a3 2c 2d 31  |nWindow(wh%,.,-1|
0001eb20  29 0d 10 59 05 e1 0d 10  5a 05 3a 0d 10 5b 2c 2a  |)..Y....Z.:..[,*|
0001eb30  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
0001eb40  4f 70 65 6e 57 69 6e 64  6f 77 53 74 61 74 69 63  |OpenWindowStatic|
0001eb50  4e 65 77 56 69 65 77 0d  10 5c 26 2a 7c 53 74 61  |NewView..\&*|Sta|
0001eb60  72 74 20 50 52 4f 43 73  68 65 6c 6c 5f 4f 70 65  |rt PROCshell_Ope|
0001eb70  6e 57 69 6e 64 6f 77 53  74 61 74 69 63 0d 10 5d  |nWindowStatic..]|
0001eb80  26 dd 20 f2 73 68 65 6c  6c 5f 4f 70 65 6e 57 69  |&. .shell_OpenWi|
0001eb90  6e 64 6f 77 53 74 61 74  69 63 28 68 61 6e 64 6c  |ndowStatic(handl|
0001eba0  65 25 29 0d 10 5e 2f e7  20 a4 73 68 65 6c 6c 5f  |e%)..^/. .shell_|
0001ebb0  53 65 61 72 63 68 53 74  61 74 69 63 28 5f 55 25  |SearchStatic(_U%|
0001ebc0  21 31 38 34 2c 68 61 6e  64 6c 65 25 29 3e 2d 31  |!184,handle%)>-1|
0001ebd0  20 8c 0d 10 5f 25 20 20  f2 73 68 65 6c 6c 5f 4f  | ..._%  .shell_O|
0001ebe0  70 65 6e 57 69 6e 64 6f  77 28 68 61 6e 64 6c 65  |penWindow(handle|
0001ebf0  25 2c 30 2c 2d 31 29 0d  10 60 05 cc 0d 10 61 2d  |%,0,-1)..`....a-|
0001ec00  20 20 85 20 39 39 2c a4  73 68 65 6c 6c 5f 4d 65  |  . 99,.shell_Me|
0001ec10  73 73 61 67 65 4e 6f 41  72 67 73 28 22 53 48 45  |ssageNoArgs("SHE|
0001ec20  4c 4c 4d 53 47 30 39 22  29 0d 10 62 05 cd 0d 10  |LLMSG09")..b....|
0001ec30  63 05 e1 0d 10 64 05 3a  0d 10 65 25 2a 7c 53 74  |c....d.:..e%*|St|
0001ec40  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 4f 70 65  |op PROCshell_Ope|
0001ec50  6e 57 69 6e 64 6f 77 53  74 61 74 69 63 0d 10 66  |nWindowStatic..f|
0001ec60  04 0d 10 67 20 2a 7c 53  74 61 72 74 20 46 4e 73  |...g *|Start FNs|
0001ec70  68 65 6c 6c 5f 53 65 61  72 63 68 53 74 61 74 69  |hell_SearchStati|
0001ec80  63 0d 10 68 2a dd 20 a4  73 68 65 6c 6c 5f 53 65  |c..h*. .shell_Se|
0001ec90  61 72 63 68 53 74 61 74  69 63 28 77 5f 6c 69 73  |archStatic(w_lis|
0001eca0  74 25 2c 68 61 6e 64 6c  65 25 29 0d 10 69 30 f4  |t%,handle%)..i0.|
0001ecb0  20 73 65 61 72 63 68 20  73 74 61 74 69 63 20 77  | search static w|
0001ecc0  69 6e 64 6f 77 20 6c 69  73 74 20 62 79 20 77 69  |indow list by wi|
0001ecd0  6e 64 6f 77 20 68 61 6e  64 6c 65 0d 10 6a 11 ea  |ndow handle..j..|
0001ece0  20 66 6f 75 6e 64 25 2c  63 74 72 25 0d 10 6b 14  | found%,ctr%..k.|
0001ecf0  66 6f 75 6e 64 25 3d 2d  31 3a 63 74 72 25 3d 30  |found%=-1:ctr%=0|
0001ed00  0d 10 6c 12 e7 20 77 5f  6c 69 73 74 25 3c 3e 30  |..l.. w_list%<>0|
0001ed10  20 8c 0d 10 6d 19 20 20  c8 95 20 77 5f 6c 69 73  | ...m.  .. w_lis|
0001ed20  74 25 21 63 74 72 25 3c  3e 2d 31 0d 10 6e 2c 20  |t%!ctr%<>-1..n, |
0001ed30  20 20 20 e7 20 77 5f 6c  69 73 74 25 21 63 74 72  |   . w_list%!ctr|
0001ed40  25 3d 68 61 6e 64 6c 65  25 20 8c 20 66 6f 75 6e  |%=handle% . foun|
0001ed50  64 25 3d 63 74 72 25 0d  10 6f 0f 20 20 20 20 63  |d%=ctr%..o.    c|
0001ed60  74 72 25 2b 3d 34 0d 10  70 07 20 20 ce 0d 10 71  |tr%+=4..p.  ...q|
0001ed70  05 cd 0d 10 72 0b 3d 66  6f 75 6e 64 25 0d 10 73  |....r.=found%..s|
0001ed80  05 3a 0d 10 74 1f 2a 7c  53 74 6f 70 20 46 4e 73  |.:..t.*|Stop FNs|
0001ed90  68 65 6c 6c 5f 53 65 61  72 63 68 53 74 61 74 69  |hell_SearchStati|
0001eda0  63 0d 10 75 04 0d 10 76  28 2a 7c 53 74 61 72 74  |c..u...v(*|Start|
0001edb0  20 50 52 4f 43 73 68 65  6c 6c 5f 43 72 65 61 74  | PROCshell_Creat|
0001edc0  65 57 69 6e 64 6f 77 53  74 61 74 69 63 0d 10 77  |eWindowStatic..w|
0001edd0  31 dd 20 f2 73 68 65 6c  6c 5f 43 72 65 61 74 65  |1. .shell_Create|
0001ede0  57 69 6e 64 6f 77 53 74  61 74 69 63 28 69 64 65  |WindowStatic(ide|
0001edf0  6e 74 24 2c f8 20 68 61  6e 64 6c 65 25 29 0d 10  |nt$,. handle%)..|
0001ee00  78 23 ea 20 77 62 5f 70  74 72 25 2c 77 5f 6c 69  |x#. wb_ptr%,w_li|
0001ee10  73 74 25 2c 74 65 6d 70  25 2c 6f 66 66 73 65 74  |st%,temp%,offset|
0001ee20  25 0d 10 79 20 77 62 5f  70 74 72 25 3d a4 73 68  |%..y wb_ptr%=.sh|
0001ee30  65 6c 6c 5f 47 65 74 57  42 28 69 64 65 6e 74 24  |ell_GetWB(ident$|
0001ee40  29 0d 10 7a 33 f4 20 73  65 74 20 27 73 70 72 69  |)..z3. set 'spri|
0001ee50  74 65 20 61 72 65 61 27  20 70 6f 69 6e 74 65 72  |te area' pointer|
0001ee60  20 74 6f 20 75 73 65 72  73 70 72 69 74 65 73 20  | to usersprites |
0001ee70  61 72 65 61 0d 10 7b 15  77 62 5f 70 74 72 25 21  |area..{.wb_ptr%!|
0001ee80  36 34 3d 5f 55 25 21 31  36 0d 10 7c 2d c8 99 20  |64=_U%!16..|-.. |
0001ee90  22 57 69 6d 70 5f 43 72  65 61 74 65 57 69 6e 64  |"Wimp_CreateWind|
0001eea0  6f 77 22 2c 2c 77 62 5f  70 74 72 25 20 b8 20 68  |ow",,wb_ptr% . h|
0001eeb0  61 6e 64 6c 65 25 0d 10  7d 13 77 5f 6c 69 73 74  |andle%..}.w_list|
0001eec0  25 3d 5f 55 25 21 31 38  34 0d 10 7e 11 e7 20 77  |%=_U%!184..~.. w|
0001eed0  5f 6c 69 73 74 25 3d 30  20 8c 0d 10 7f 12 20 20  |_list%=0 .....  |
0001eee0  f4 20 65 6d 70 74 79 20  6c 69 73 74 0d 10 80 15  |. empty list....|
0001eef0  2a 7c 69 66 64 65 66 20  54 72 61 63 65 49 6e 69  |*|ifdef TraceIni|
0001ef00  74 0d 10 81 35 20 20 f2  73 68 65 6c 6c 5f 54 72  |t...5  .shell_Tr|
0001ef10  61 63 65 66 30 28 22 43  72 65 61 74 65 57 69 6e  |acef0("CreateWin|
0001ef20  64 6f 77 53 74 61 74 69  63 3a 45 6d 70 74 79 20  |dowStatic:Empty |
0001ef30  4c 69 73 74 22 29 0d 10  82 0b 2a 7c 65 6e 64 69  |List")....*|endi|
0001ef40  66 0d 10 83 26 20 20 5f  55 25 21 31 38 34 3d a4  |f...&  _U%!184=.|
0001ef50  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
0001ef60  65 74 63 68 28 38 29 0d  10 84 15 20 20 77 5f 6c  |etch(8)....  w_l|
0001ef70  69 73 74 25 3d 5f 55 25  21 31 38 34 0d 10 85 24  |ist%=_U%!184...$|
0001ef80  20 20 77 5f 6c 69 73 74  25 21 30 3d 68 61 6e 64  |  w_list%!0=hand|
0001ef90  6c 65 25 3a 77 5f 6c 69  73 74 25 21 34 3d 2d 31  |le%:w_list%!4=-1|
0001efa0  0d 10 86 05 cc 0d 10 87  25 20 20 f4 20 73 65 61  |........%  . sea|
0001efb0  72 63 68 20 6c 69 73 74  20 66 6f 72 20 77 69 6e  |rch list for win|
0001efc0  64 6f 77 20 68 61 6e 64  6c 65 0d 10 88 15 2a 7c  |dow handle....*||
0001efd0  69 66 64 65 66 20 54 72  61 63 65 49 6e 69 74 0d  |ifdef TraceInit.|
0001efe0  10 89 46 20 20 f2 73 68  65 6c 6c 5f 54 72 61 63  |..F  .shell_Trac|
0001eff0  65 66 30 28 22 43 72 65  61 74 65 57 69 6e 64 6f  |ef0("CreateWindo|
0001f000  77 53 74 61 74 69 63 3a  53 65 61 72 63 68 69 6e  |wStatic:Searchin|
0001f010  67 20 66 6f 72 20 77 69  6e 64 6f 77 20 68 61 6e  |g for window han|
0001f020  64 6c 65 22 29 0d 10 8a  0b 2a 7c 65 6e 64 69 66  |dle")....*|endif|
0001f030  0d 10 8b 32 20 20 6f 66  66 73 65 74 25 3d a4 73  |...2  offset%=.s|
0001f040  68 65 6c 6c 5f 53 65 61  72 63 68 53 74 61 74 69  |hell_SearchStati|
0001f050  63 28 5f 55 25 21 31 38  34 2c 68 61 6e 64 6c 65  |c(_U%!184,handle|
0001f060  25 29 0d 10 8c 14 20 20  e7 20 6f 66 66 73 65 74  |%)....  . offset|
0001f070  25 3d 2d 31 20 8c 0d 10  8d 2a 20 20 20 20 f4 20  |%=-1 ....*    . |
0001f080  61 64 64 20 77 69 6e 64  6f 77 20 68 61 6e 64 6c  |add window handl|
0001f090  65 20 74 6f 20 73 74 61  74 69 63 20 6c 69 73 74  |e to static list|
0001f0a0  0d 10 8e 15 2a 7c 69 66  64 65 66 20 54 72 61 63  |....*|ifdef Trac|
0001f0b0  65 49 6e 69 74 0d 10 8f  53 20 20 f2 73 68 65 6c  |eInit...S  .shel|
0001f0c0  6c 5f 54 72 61 63 65 66  30 28 22 43 72 65 61 74  |l_Tracef0("Creat|
0001f0d0  65 57 69 6e 64 6f 77 53  74 61 74 69 63 3a 4e 6f  |eWindowStatic:No|
0001f0e0  74 20 66 6f 75 6e 64 20  2d 20 61 64 64 69 6e 67  |t found - adding|
0001f0f0  20 77 69 6e 64 6f 77 20  68 61 6e 64 6c 65 20 74  | window handle t|
0001f100  6f 20 6c 69 73 74 22 29  0d 10 90 0b 2a 7c 65 6e  |o list")....*|en|
0001f110  64 69 66 0d 10 91 2e 20  20 20 20 6f 66 66 73 65  |dif....    offse|
0001f120  74 25 3d a4 73 68 65 6c  6c 5f 53 65 61 72 63 68  |t%=.shell_Search|
0001f130  53 74 61 74 69 63 28 5f  55 25 21 31 38 34 2c 30  |Static(_U%!184,0|
0001f140  29 0d 10 92 16 20 20 20  20 e7 20 6f 66 66 73 65  |)....    . offse|
0001f150  74 25 3d 2d 31 20 8c 0d  10 93 15 2a 7c 69 66 64  |t%=-1 .....*|ifd|
0001f160  65 66 20 54 72 61 63 65  49 6e 69 74 0d 10 94 47  |ef TraceInit...G|
0001f170  20 20 f2 73 68 65 6c 6c  5f 54 72 61 63 65 66 30  |  .shell_Tracef0|
0001f180  28 22 43 72 65 61 74 65  57 69 6e 64 6f 77 53 74  |("CreateWindowSt|
0001f190  61 74 69 63 3a 45 78 74  65 6e 64 69 6e 67 20 77  |atic:Extending w|
0001f1a0  69 6e 64 6f 77 20 68 61  6e 64 6c 65 20 6c 69 73  |indow handle lis|
0001f1b0  74 22 29 0d 10 95 0b 2a  7c 65 6e 64 69 66 0d 10  |t")....*|endif..|
0001f1c0  96 10 20 20 20 20 20 20  63 74 72 25 3d 30 0d 10  |..      ctr%=0..|
0001f1d0  97 1d 20 20 20 20 20 20  c8 95 20 77 5f 6c 69 73  |..      .. w_lis|
0001f1e0  74 25 21 63 74 72 25 3c  3e 2d 31 0d 10 98 13 20  |t%!ctr%<>-1.... |
0001f1f0  20 20 20 20 20 20 20 63  74 72 25 2b 3d 34 0d 10  |       ctr%+=4..|
0001f200  99 0b 20 20 20 20 20 20  ce 0d 10 9a 33 20 20 20  |..      ....3   |
0001f210  20 20 20 5f 55 25 21 31  38 34 3d a4 73 68 65 6c  |   _U%!184=.shel|
0001f220  6c 5f 48 65 61 70 42 6c  6f 63 6b 45 78 74 65 6e  |l_HeapBlockExten|
0001f230  64 28 5f 55 25 21 31 38  34 2c 34 29 0d 10 9b 19  |d(_U%!184,4)....|
0001f240  20 20 20 20 20 20 77 5f  6c 69 73 74 25 3d 5f 55  |      w_list%=_U|
0001f250  25 21 31 38 34 0d 10 9c  09 20 20 20 20 cc 0d 10  |%!184....    ...|
0001f260  9d 15 2a 7c 69 66 64 65  66 20 54 72 61 63 65 49  |..*|ifdef TraceI|
0001f270  6e 69 74 0d 10 9e 45 20  20 f2 73 68 65 6c 6c 5f  |nit...E  .shell_|
0001f280  54 72 61 63 65 66 30 28  22 43 72 65 61 74 65 57  |Tracef0("CreateW|
0001f290  69 6e 64 6f 77 53 74 61  74 69 63 3a 46 6f 75 6e  |indowStatic:Foun|
0001f2a0  64 20 75 6e 75 73 65 64  20 73 70 61 63 65 20 69  |d unused space i|
0001f2b0  6e 20 6c 69 73 74 22 29  0d 10 9f 0b 2a 7c 65 6e  |n list")....*|en|
0001f2c0  64 69 66 0d 10 a0 16 20  20 20 20 20 20 63 74 72  |dif....      ctr|
0001f2d0  25 3d 6f 66 66 73 65 74  25 0d 10 a1 09 20 20 20  |%=offset%....   |
0001f2e0  20 cd 0d 10 a2 1a 20 20  20 20 74 65 6d 70 25 3d  | .....    temp%=|
0001f2f0  77 5f 6c 69 73 74 25 2b  63 74 72 25 0d 10 a3 22  |w_list%+ctr%..."|
0001f300  20 20 20 20 74 65 6d 70  25 21 30 3d 68 61 6e 64  |    temp%!0=hand|
0001f310  6c 65 25 3a 74 65 6d 70  25 21 34 3d 2d 31 0d 10  |le%:temp%!4=-1..|
0001f320  a4 07 20 20 cd 0d 10 a5  05 cd 0d 10 a6 05 e1 0d  |..  ............|
0001f330  10 a7 05 3a 0d 10 a8 27  2a 7c 53 74 6f 70 20 50  |...:...'*|Stop P|
0001f340  52 4f 43 73 68 65 6c 6c  5f 43 72 65 61 74 65 57  |ROCshell_CreateW|
0001f350  69 6e 64 6f 77 53 74 61  74 69 63 0d 10 a9 04 0d  |indowStatic.....|
0001f360  10 aa 24 2a 7c 53 74 61  72 74 20 50 52 4f 43 73  |..$*|Start PROCs|
0001f370  68 65 6c 6c 5f 49 6e 69  74 48 65 6c 70 53 79 73  |hell_InitHelpSys|
0001f380  74 65 6d 0d 10 ab 27 dd  20 f2 73 68 65 6c 6c 5f  |tem...'. .shell_|
0001f390  49 6e 69 74 48 65 6c 70  53 79 73 74 65 6d 28 70  |InitHelpSystem(p|
0001f3a0  61 74 68 24 2c 64 69 65  25 29 0d 10 ac 37 ea 20  |ath$,die%)...7. |
0001f3b0  74 61 69 6c 24 2c 70 6f  73 25 2c 4f 53 56 61 72  |tail$,pos%,OSVar|
0001f3c0  42 75 66 66 25 2c 72 65  73 70 61 74 68 24 2c 68  |Buff%,respath$,h|
0001f3d0  65 6c 70 5f 66 6f 75 6e  64 25 2c 61 62 6f 72 74  |elp_found%,abort|
0001f3e0  25 0d 10 ad 3c 5f 55 25  21 32 31 32 3d 30 3a e7  |%...<_U%!212=0:.|
0001f3f0  20 5f 55 25 21 32 31 36  3c 3e 30 20 8c 20 f2 73  | _U%!216<>0 . .s|
0001f400  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 52 65  |hell_HeapBlockRe|
0001f410  74 75 72 6e 28 5f 55 25  21 32 31 36 29 0d 10 ae  |turn(_U%!216)...|
0001f420  2f 5f 55 25 21 32 31 36  3d 30 3a f4 20 63 6c 65  |/_U%!216=0:. cle|
0001f430  61 72 20 70 65 6e 64 69  6e 67 20 63 6f 6d 6d 61  |ar pending comma|
0001f440  6e 64 20 62 75 66 66 65  72 2e 2e 2e 0d 10 af 39  |nd buffer......9|
0001f450  f2 73 68 65 6c 6c 5f 53  63 61 6e 46 6f 72 48 65  |.shell_ScanForHe|
0001f460  6c 70 3a f4 20 63 68 65  63 6b 20 69 66 20 53 74  |lp:. check if St|
0001f470  72 6f 6e 67 48 6c 70 20  69 73 20 72 75 6e 6e 69  |rongHlp is runni|
0001f480  6e 67 2e 2e 2e 0d 10 b0  2d e7 20 64 69 65 25 20  |ng......-. die% |
0001f490  8c 20 74 61 69 6c 24 3d  22 20 2d 44 69 65 57 69  |. tail$=" -DieWi|
0001f4a0  74 68 54 61 73 6b 22 20  8b 20 74 61 69 6c 24 3d  |thTask" . tail$=|
0001f4b0  22 22 0d 10 b1 19 2a 7c  69 66 64 65 66 20 55 73  |""....*|ifdef Us|
0001f4c0  69 6e 67 5f 52 65 73 46  69 6e 64 0d 10 b2 16 e7  |ing_ResFind.....|
0001f4d0  20 5f 55 25 21 31 30 30  20 80 20 31 3c 3c 33 20  | _U%!100 . 1<<3 |
0001f4e0  8c 0d 10 b3 2c 20 20 f4  20 52 65 73 46 69 6e 64  |....,  . ResFind|
0001f4f0  20 69 6e 69 74 69 61 6c  69 73 65 64 2c 20 63 68  | initialised, ch|
0001f500  65 63 6b 20 52 65 73 50  61 74 68 2e 2e 0d 10 b4  |eck ResPath.....|
0001f510  0e 20 20 70 61 74 68 24  3d 22 22 0d 10 b5 2b 20  |.  path$=""...+ |
0001f520  20 4f 53 56 61 72 42 75  66 66 25 3d a4 73 68 65  | OSVarBuff%=.she|
0001f530  6c 6c 5f 48 65 61 70 42  6c 6f 63 6b 46 65 74 63  |ll_HeapBlockFetc|
0001f540  68 28 32 35 36 29 0d 10  b6 51 20 20 72 65 73 70  |h(256)...Q  resp|
0001f550  61 74 68 24 3d a4 73 68  65 6c 6c 5f 4f 53 56 61  |ath$=.shell_OSVa|
0001f560  72 47 65 74 56 61 6c 28  4f 53 56 61 72 42 75 66  |rGetVal(OSVarBuf|
0001f570  66 25 2c 32 35 36 2c a4  73 68 65 6c 6c 5f 47 65  |f%,256,.shell_Ge|
0001f580  74 41 70 70 4e 61 6d 65  2b 22 52 65 73 24 50 61  |tAppName+"Res$Pa|
0001f590  74 68 22 2c 2d 31 29 0d  10 b7 28 20 20 f2 73 68  |th",-1)...(  .sh|
0001f5a0  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 52 65 74  |ell_HeapBlockRet|
0001f5b0  75 72 6e 28 4f 53 56 61  72 42 75 66 66 25 29 0d  |urn(OSVarBuff%).|
0001f5c0  10 b8 07 20 20 f5 0d 10  b9 1b 20 20 20 20 70 6f  |...  .....    po|
0001f5d0  73 25 3d a7 72 65 73 70  61 74 68 24 2c 22 2c 22  |s%=.respath$,","|
0001f5e0  29 0d 10 ba 12 20 20 20  20 e7 20 70 6f 73 25 3e  |)....    . pos%>|
0001f5f0  30 20 8c 0d 10 bb 44 20  20 20 20 20 20 e7 20 a4  |0 ....D      . .|
0001f600  73 68 65 6c 6c 5f 46 69  6c 65 45 78 69 73 74 73  |shell_FileExists|
0001f610  28 c0 72 65 73 70 61 74  68 24 2c 70 6f 73 25 2d  |(.respath$,pos%-|
0001f620  31 29 2b a4 73 68 65 6c  6c 5f 47 65 74 41 70 70  |1)+.shell_GetApp|
0001f630  4e 61 6d 65 29 20 8c 0d  10 bc 35 20 20 20 20 20  |Name) ....5     |
0001f640  20 20 20 70 61 74 68 24  3d c0 72 65 73 70 61 74  |   path$=.respat|
0001f650  68 24 2c 70 6f 73 25 2d  31 29 2b a4 73 68 65 6c  |h$,pos%-1)+.shel|
0001f660  6c 5f 47 65 74 41 70 70  4e 61 6d 65 0d 10 bd 19  |l_GetAppName....|
0001f670  20 20 20 20 20 20 20 20  68 65 6c 70 5f 66 6f 75  |        help_fou|
0001f680  6e 64 25 3d b9 0d 10 be  0b 20 20 20 20 20 20 cc  |nd%=.....      .|
0001f690  0d 10 bf 26 20 20 20 20  20 20 20 20 72 65 73 70  |...&        resp|
0001f6a0  61 74 68 24 3d c1 72 65  73 70 61 74 68 24 2c 70  |ath$=.respath$,p|
0001f6b0  6f 73 25 2b 31 29 0d 10  c0 0b 20 20 20 20 20 20  |os%+1)....      |
0001f6c0  cd 0d 10 c1 09 20 20 20  20 cc 0d 10 c2 3b 20 20  |.....    ....;  |
0001f6d0  20 20 20 20 e7 20 a4 73  68 65 6c 6c 5f 46 69 6c  |    . .shell_Fil|
0001f6e0  65 45 78 69 73 74 73 28  72 65 73 70 61 74 68 24  |eExists(respath$|
0001f6f0  2b a4 73 68 65 6c 6c 5f  47 65 74 41 70 70 4e 61  |+.shell_GetAppNa|
0001f700  6d 65 29 20 8c 0d 10 c3  2c 20 20 20 20 20 20 20  |me) ....,       |
0001f710  20 70 61 74 68 24 3d 72  65 73 70 61 74 68 24 2b  | path$=respath$+|
0001f720  a4 73 68 65 6c 6c 5f 47  65 74 41 70 70 4e 61 6d  |.shell_GetAppNam|
0001f730  65 0d 10 c4 19 20 20 20  20 20 20 20 20 68 65 6c  |e....        hel|
0001f740  70 5f 66 6f 75 6e 64 25  3d b9 0d 10 c5 0b 20 20  |p_found%=.....  |
0001f750  20 20 20 20 cc 0d 10 c6  14 20 20 20 20 20 20 20  |    .....       |
0001f760  20 61 62 6f 72 74 25 3d  b9 0d 10 c7 4b 20 20 20  | abort%=....K   |
0001f770  20 20 20 20 20 f2 73 68  65 6c 6c 5f 4f 4b 28 a4  |     .shell_OK(.|
0001f780  73 68 65 6c 6c 5f 4d 65  73 73 61 67 65 4f 6e 65  |shell_MessageOne|
0001f790  41 72 67 28 22 53 48 45  4c 4c 4d 53 47 32 36 22  |Arg("SHELLMSG26"|
0001f7a0  2c a4 73 68 65 6c 6c 5f  47 65 74 41 70 70 4e 61  |,.shell_GetAppNa|
0001f7b0  6d 65 29 29 0d 10 c8 0b  20 20 20 20 20 20 cd 0d  |me))....      ..|
0001f7c0  10 c9 09 20 20 20 20 cd  0d 10 ca 28 20 20 fd 20  |...    ....(  . |
0001f7d0  70 61 74 68 24 3c 3e 22  22 20 84 20 68 65 6c 70  |path$<>"" . help|
0001f7e0  5f 66 6f 75 6e 64 25 20  84 20 61 62 6f 72 74 25  |_found% . abort%|
0001f7f0  0d 10 cb 05 cd 0d 10 cc  0b 2a 7c 65 6e 64 69 66  |.........*|endif|
0001f800  0d 10 cd 41 e7 20 61 62  6f 72 74 25 3d 30 20 8c  |...A. abort%=0 .|
0001f810  20 f2 73 68 65 6c 6c 5f  53 74 72 6f 6e 67 48 6c  | .shell_StrongHl|
0001f820  70 4d 73 67 28 22 48 65  6c 70 5f 49 6e 73 74 61  |pMsg("Help_Insta|
0001f830  6c 6c 20 22 2b 70 61 74  68 24 2b 74 61 69 6c 24  |ll "+path$+tail$|
0001f840  29 0d 10 ce 05 e1 0d 10  cf 05 3a 0d 10 d0 23 2a  |).........:...#*|
0001f850  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
0001f860  49 6e 69 74 48 65 6c 70  53 79 73 74 65 6d 0d 10  |InitHelpSystem..|
0001f870  d1 04 0d 10 d2 1e 2a 7c  53 74 61 72 74 20 50 52  |......*|Start PR|
0001f880  4f 43 73 68 65 6c 6c 5f  48 65 6c 70 57 6f 72 64  |OCshell_HelpWord|
0001f890  0d 10 d3 1c dd 20 f2 73  68 65 6c 6c 5f 48 65 6c  |..... .shell_Hel|
0001f8a0  70 57 6f 72 64 28 77 6f  72 64 24 29 0d 10 d4 17  |pWord(word$)....|
0001f8b0  ea 20 72 65 61 64 25 2c  74 65 6d 70 25 2c 62 75  |. read%,temp%,bu|
0001f8c0  66 66 25 0d 10 d5 24 62  75 66 66 25 3d a4 73 68  |ff%...$buff%=.sh|
0001f8d0  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
0001f8e0  63 68 28 35 31 32 29 0d  10 d6 14 e7 20 5f 55 25  |ch(512)..... _U%|
0001f8f0  21 32 30 38 20 3d 20 2d  31 20 8c 0d 10 d7 32 20  |!208 = -1 ....2 |
0001f900  20 f4 20 20 53 74 72 6f  6e 67 48 65 6c 70 20 69  | .  StrongHelp i|
0001f910  73 20 6e 6f 74 20 6c 6f  61 64 65 64 2e 20 54 72  |s not loaded. Tr|
0001f920  79 20 74 6f 20 72 75 6e  20 69 74 2e 2e 0d 10 d8  |y to run it.....|
0001f930  34 20 20 e7 20 a4 73 68  65 6c 6c 5f 4f 53 56 61  |4  . .shell_OSVa|
0001f940  72 45 78 69 73 74 73 28  62 75 66 66 25 2c 22 53  |rExists(buff%,"S|
0001f950  74 72 6f 6e 67 48 65 6c  70 24 44 69 72 22 29 20  |trongHelp$Dir") |
0001f960  8c 0d 10 d9 38 20 20 20  20 f4 20 56 61 72 69 61  |....8    . Varia|
0001f970  62 6c 65 20 65 78 69 73  74 73 2c 20 73 6f 20 61  |ble exists, so a|
0001f980  74 74 65 6d 70 74 20 74  6f 20 72 75 6e 20 53 74  |ttempt to run St|
0001f990  72 6f 6e 67 48 6c 70 2e  2e 0d 10 da 2f 20 20 20  |rongHlp...../   |
0001f9a0  20 c8 99 20 22 58 57 69  6d 70 5f 53 74 61 72 74  | .. "XWimp_Start|
0001f9b0  54 61 73 6b 22 2c 22 3c  53 74 72 6f 6e 67 48 65  |Task","<StrongHe|
0001f9c0  6c 70 24 44 69 72 3e 22  0d 10 db 36 20 20 20 20  |lp$Dir>"...6    |
0001f9d0  e7 20 5f 55 25 21 32 31  36 3c 3e 30 20 8c 20 f2  |. _U%!216<>0 . .|
0001f9e0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 52  |shell_HeapBlockR|
0001f9f0  65 74 75 72 6e 28 5f 55  25 21 32 31 36 29 0d 10  |eturn(_U%!216)..|
0001fa00  dc 2f 20 20 20 20 5f 55  25 21 32 31 36 3d a4 73  |./    _U%!216=.s|
0001fa10  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 46 65  |hell_HeapBlockFe|
0001fa20  74 63 68 28 a9 77 6f 72  64 24 2b 31 29 0d 10 dd  |tch(.word$+1)...|
0001fa30  15 20 20 20 20 74 65 6d  70 25 3d 5f 55 25 21 32  |.    temp%=_U%!2|
0001fa40  31 36 0d 10 de 14 20 20  20 20 24 74 65 6d 70 25  |16....    $temp%|
0001fa50  3d 77 6f 72 64 24 0d 10  df 07 20 20 cc 0d 10 e0  |=word$....  ....|
0001fa60  41 20 20 20 20 f4 20 49  74 20 64 6f 65 73 6e 27  |A    . It doesn'|
0001fa70  74 2c 20 73 6f 20 63 6f  6d 70 6c 61 69 6e 2c 20  |t, so complain, |
0001fa80  62 75 74 20 66 69 72 73  74 20 72 65 6c 65 61 73  |but first releas|
0001fa90  65 20 62 75 66 66 65 72  20 61 73 20 61 6e 0d 10  |e buffer as an..|
0001faa0  e1 2a 20 20 20 20 f4 20  65 72 72 6f 72 20 69 73  |.*    . error is|
0001fab0  20 61 62 6f 75 74 20 74  6f 20 62 65 20 67 65 6e  | about to be gen|
0001fac0  65 72 61 74 65 64 2e 2e  0d 10 e2 25 20 20 20 20  |erated.....%    |
0001fad0  f2 73 68 65 6c 6c 5f 48  65 61 70 42 6c 6f 63 6b  |.shell_HeapBlock|
0001fae0  52 65 74 75 72 6e 28 62  75 66 66 25 29 0d 10 e3  |Return(buff%)...|
0001faf0  35 20 20 20 20 f2 73 68  65 6c 6c 5f 4f 4b 28 a4  |5    .shell_OK(.|
0001fb00  73 68 65 6c 6c 5f 4d 65  73 73 61 67 65 4e 6f 41  |shell_MessageNoA|
0001fb10  72 67 73 28 22 53 48 45  4c 4c 4d 53 47 31 31 22  |rgs("SHELLMSG11"|
0001fb20  29 29 0d 10 e4 07 20 20  cd 0d 10 e5 05 cc 0d 10  |))....  ........|
0001fb30  e6 2d 20 20 f2 73 68 65  6c 6c 5f 53 74 72 6f 6e  |.-  .shell_Stron|
0001fb40  67 48 6c 70 4d 73 67 28  22 48 65 6c 70 5f 57 6f  |gHlpMsg("Help_Wo|
0001fb50  72 64 20 22 2b 77 6f 72  64 24 29 0d 10 e7 05 cd  |rd "+word$).....|
0001fb60  0d 10 e8 21 f2 73 68 65  6c 6c 5f 48 65 61 70 42  |...!.shell_HeapB|
0001fb70  6c 6f 63 6b 52 65 74 75  72 6e 28 62 75 66 66 25  |lockReturn(buff%|
0001fb80  29 0d 10 e9 05 e1 0d 10  ea 05 3a 0d 10 eb 1d 2a  |).........:....*|
0001fb90  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
0001fba0  48 65 6c 70 57 6f 72 64  0d 10 ec 22 2a 7c 53 74  |HelpWord..."*|St|
0001fbb0  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 53 74  |art PROCshell_St|
0001fbc0  72 6f 6e 67 48 6c 70 4d  73 67 0d 10 ed 1f dd 20  |rongHlpMsg..... |
0001fbd0  f2 73 68 65 6c 6c 5f 53  74 72 6f 6e 67 48 6c 70  |.shell_StrongHlp|
0001fbe0  4d 73 67 28 6d 73 67 24  29 0d 10 ee 28 f2 73 68  |Msg(msg$)...(.sh|
0001fbf0  65 6c 6c 5f 42 72 6f 61  64 63 61 73 74 4d 65 73  |ell_BroadcastMes|
0001fc00  73 61 67 65 28 26 34 33  42 30 30 2c 6d 73 67 24  |sage(&43B00,msg$|
0001fc10  29 0d 10 ef 05 e1 0d 10  f0 05 3a 0d 10 f1 21 2a  |).........:...!*|
0001fc20  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
0001fc30  53 74 72 6f 6e 67 48 6c  70 4d 73 67 0d 10 f2 21  |StrongHlpMsg...!|
0001fc40  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
0001fc50  6c 5f 53 63 61 6e 46 6f  72 48 65 6c 70 0d 10 f3  |l_ScanForHelp...|
0001fc60  18 dd 20 f2 73 68 65 6c  6c 5f 53 63 61 6e 46 6f  |.. .shell_ScanFo|
0001fc70  72 48 65 6c 70 0d 10 f4  1c ea 20 77 72 6b 25 2c  |rHelp..... wrk%,|
0001fc80  6f 77 6e 65 72 5f 74 61  73 6b 68 61 6e 64 6c 65  |owner_taskhandle|
0001fc90  25 0d 10 f5 38 77 72 6b  25 3d a4 73 68 65 6c 6c  |%...8wrk%=.shell|
0001fca0  5f 48 65 61 70 42 6c 6f  63 6b 46 65 74 63 68 28  |_HeapBlockFetch(|
0001fcb0  32 35 36 29 3a f4 20 62  6c 6f 63 6b 20 66 6f 72  |256):. block for|
0001fcc0  20 6d 65 73 73 61 67 65  73 0d 10 f6 32 f4 20 20  | messages...2.  |
0001fcd0  46 69 6e 64 73 20 6f 75  74 20 69 66 20 53 74 72  |Finds out if Str|
0001fce0  6f 6e 67 48 65 6c 70 20  69 73 20 61 6c 72 65 61  |ongHelp is alrea|
0001fcf0  64 79 20 72 75 6e 6e 69  6e 67 2e 0d 10 f7 41 f4  |dy running....A.|
0001fd00  20 20 44 6f 65 73 20 74  68 69 73 20 62 79 20 73  |  Does this by s|
0001fd10  63 61 6e 6e 69 6e 67 20  74 68 65 20 74 61 73 6b  |canning the task|
0001fd20  73 20 69 6e 73 74 61 6c  6c 65 64 20 6f 6e 20 74  |s installed on t|
0001fd30  68 65 20 69 63 6f 6e 62  61 72 2e 2e 0d 10 f8 45  |he iconbar.....E|
0001fd40  f4 20 20 54 68 69 73 20  61 67 61 69 6e 20 69 73  |.  This again is|
0001fd50  20 64 6f 6e 65 20 62 79  20 67 65 74 74 69 6e 67  | done by getting|
0001fd60  20 74 68 65 20 74 61 73  6b 27 73 20 68 61 6e 64  | the task's hand|
0001fd70  6c 65 2c 20 61 6e 64 20  73 65 6e 64 69 6e 67 20  |le, and sending |
0001fd80  61 0d 10 f9 41 f4 20 20  73 65 6e 64 69 6e 67 20  |a...A.  sending |
0001fd90  61 20 54 61 73 6b 4e 61  6d 65 52 71 20 74 6f 20  |a TaskNameRq to |
0001fda0  74 68 65 20 74 61 73 6b  68 61 6e 64 6c 65 72 2e  |the taskhandler.|
0001fdb0  20 57 68 65 6e 20 74 68  69 73 20 72 65 74 75 72  | When this retur|
0001fdc0  6e 73 0d 10 fa 49 f4 20  20 28 61 73 20 61 20 54  |ns...I.  (as a T|
0001fdd0  61 73 6b 4e 61 6d 65 49  73 20 6d 65 73 73 61 67  |askNameIs messag|
0001fde0  65 29 20 77 65 20 63 6f  6d 70 61 72 65 20 74 68  |e) we compare th|
0001fdf0  65 20 73 74 72 69 6e 67  20 77 69 74 68 20 22 53  |e string with "S|
0001fe00  74 72 6f 6e 67 48 65 6c  70 22 2e 0d 10 fb 46 f4  |trongHelp"....F.|
0001fe10  20 20 49 66 20 6e 6f 74  20 65 71 75 61 6c 2c 20  |  If not equal, |
0001fe20  74 68 69 73 20 72 6f 75  74 69 6e 65 20 69 73 20  |this routine is |
0001fe30  63 61 6c 6c 65 64 20 61  67 61 69 6e 20 74 6f 20  |called again to |
0001fe40  63 68 65 63 6b 20 6e 65  78 74 20 69 63 6f 6e 2e  |check next icon.|
0001fe50  2e 0d 10 fc 04 0d 10 fd  05 f5 0d 10 fe 48 20 20  |.............H  |
0001fe60  f4 20 20 54 68 69 73 20  57 69 6d 70 5f 53 65 6e  |.  This Wimp_Sen|
0001fe70  64 4d 65 73 73 61 67 65  20 64 6f 65 73 20 2a 6e  |dMessage does *n|
0001fe80  6f 74 2a 20 73 65 6e 64  20 61 20 6d 65 73 73 61  |ot* send a messa|
0001fe90  67 65 20 74 6f 20 74 68  65 20 6f 77 6e 65 72 20  |ge to the owner |
0001fea0  6f 66 0d 10 ff 41 20 20  f4 20 20 74 68 65 20 69  |of...A  .  the i|
0001feb0  63 6f 6e 2e 20 49 74 20  6d 65 72 65 6c 79 20 72  |con. It merely r|
0001fec0  65 74 75 72 6e 73 20 74  68 65 20 74 61 73 6b 68  |eturns the taskh|
0001fed0  61 6e 64 6c 65 20 6f 66  20 74 68 65 20 6f 77 6e  |andle of the own|
0001fee0  65 72 2e 0d 11 00 11 20  20 77 72 6b 25 21 31 32  |er.....  wrk%!12|
0001fef0  20 3d 20 30 0d 11 01 44  20 20 c8 99 20 22 57 69  | = 0...D  .. "Wi|
0001ff00  6d 70 5f 53 65 6e 64 4d  65 73 73 61 67 65 22 2c  |mp_SendMessage",|
0001ff10  31 39 2c 77 72 6b 25 2c  2d 32 2c 5f 55 25 21 32  |19,wrk%,-2,_U%!2|
0001ff20  31 32 20 b8 20 2c 2c 6f  77 6e 65 72 5f 74 61 73  |12 . ,,owner_tas|
0001ff30  6b 68 61 6e 64 6c 65 25  0d 11 02 22 20 20 5f 55  |khandle%..."  _U|
0001ff40  25 21 32 31 32 3d 5f 55  25 21 32 31 32 2b 31 3a  |%!212=_U%!212+1:|
0001ff50  f4 20 69 63 6f 6e 74 72  79 25 0d 11 03 2e fd 20  |. icontry%..... |
0001ff60  6f 77 6e 65 72 5f 74 61  73 6b 68 61 6e 64 6c 65  |owner_taskhandle|
0001ff70  25 20 3c 3e 20 2d 31 20  84 20 28 5f 55 25 21 32  |% <> -1 . (_U%!2|
0001ff80  31 32 29 20 3e 20 36 34  0d 11 04 04 0d 11 05 1f  |12) > 64........|
0001ff90  e7 20 6f 77 6e 65 72 5f  74 61 73 6b 68 61 6e 64  |. owner_taskhand|
0001ffa0  6c 65 25 20 3c 3e 20 2d  31 20 8c 0d 11 06 2b 20  |le% <> -1 ....+ |
0001ffb0  20 f4 20 53 65 6e 64 20  72 65 71 75 65 73 74 20  | . Send request |
0001ffc0  66 6f 72 20 6e 61 6d 65  20 6f 66 20 74 68 69 73  |for name of this|
0001ffd0  20 74 61 73 6b 2e 0d 11  07 12 20 20 77 72 6b 25  | task.....  wrk%|
0001ffe0  21 30 20 20 3d 20 32 34  0d 11 08 11 20 20 77 72  |!0  = 24....  wr|
0001fff0  6b 25 21 31 32 20 3d 20  30 0d 11 09 16 20 20 77  |k%!12 = 0....  w|
00020000  72 6b 25 21 31 36 20 3d  20 26 34 30 30 43 36 0d  |rk%!16 = &400C6.|
00020010  11 0a 21 20 20 77 72 6b  25 21 32 30 20 3d 20 6f  |..!  wrk%!20 = o|
00020020  77 6e 65 72 5f 74 61 73  6b 68 61 6e 64 6c 65 25  |wner_taskhandle%|
00020030  0d 11 0b 25 20 20 c8 99  20 22 57 69 6d 70 5f 53  |...%  .. "Wimp_S|
00020040  65 6e 64 4d 65 73 73 61  67 65 22 2c 31 37 2c 77  |endMessage",17,w|
00020050  72 6b 25 2c 30 0d 11 0c  05 cd 0d 11 0d 20 f2 73  |rk%,0........ .s|
00020060  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 52 65  |hell_HeapBlockRe|
00020070  74 75 72 6e 28 77 72 6b  25 29 0d 11 0e 05 e1 0d  |turn(wrk%)......|
00020080  11 0f 05 3a 0d 11 10 20  2a 7c 53 74 6f 70 20 50  |...:... *|Stop P|
00020090  52 4f 43 73 68 65 6c 6c  5f 53 63 61 6e 46 6f 72  |ROCshell_ScanFor|
000200a0  48 65 6c 70 0d 11 11 26  2a 7c 53 74 61 72 74 20  |Help...&*|Start |
000200b0  50 52 4f 43 73 68 65 6c  6c 5f 42 72 6f 61 64 63  |PROCshell_Broadc|
000200c0  61 73 74 4d 65 73 73 61  67 65 0d 11 12 30 dd 20  |astMessage...0. |
000200d0  f2 73 68 65 6c 6c 5f 42  72 6f 61 64 63 61 73 74  |.shell_Broadcast|
000200e0  4d 65 73 73 61 67 65 28  72 65 61 73 6f 6e 5f 63  |Message(reason_c|
000200f0  6f 64 65 25 2c 6d 73 67  24 29 0d 11 13 0e ea 20  |ode%,msg$)..... |
00020100  6d 73 67 5f 62 6c 6b 25  0d 11 14 27 6d 73 67 5f  |msg_blk%...'msg_|
00020110  62 6c 6b 25 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |blk%=.shell_Heap|
00020120  42 6c 6f 63 6b 46 65 74  63 68 28 32 35 36 29 0d  |BlockFetch(256).|
00020130  11 15 2a 6d 73 67 5f 62  6c 6b 25 21 31 32 3d 30  |..*msg_blk%!12=0|
00020140  3a 6d 73 67 5f 62 6c 6b  25 21 31 36 3d 72 65 61  |:msg_blk%!16=rea|
00020150  73 6f 6e 5f 63 6f 64 65  25 0d 11 16 1c 24 28 6d  |son_code%....$(m|
00020160  73 67 5f 62 6c 6b 25 2b  32 30 29 3d 6d 73 67 24  |sg_blk%+20)=msg$|
00020170  2b bd 28 30 29 0d 11 17  12 6d 73 67 5f 62 6c 6b  |+.(0)....msg_blk|
00020180  25 21 30 3d 32 35 36 0d  11 18 3b c8 99 20 22 57  |%!0=256...;.. "W|
00020190  69 6d 70 5f 53 65 6e 64  4d 65 73 73 61 67 65 22  |imp_SendMessage"|
000201a0  2c 31 37 2c 6d 73 67 5f  62 6c 6b 25 2c 30 3a f4  |,17,msg_blk%,0:.|
000201b0  20 62 72 6f 61 64 63 61  73 74 20 6d 65 73 73 61  | broadcast messa|
000201c0  67 65 0d 11 19 24 f2 73  68 65 6c 6c 5f 48 65 61  |ge...$.shell_Hea|
000201d0  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 6d 73 67  |pBlockReturn(msg|
000201e0  5f 62 6c 6b 25 29 0d 11  1a 05 e1 0d 11 1b 05 3a  |_blk%).........:|
000201f0  0d 11 1c 25 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |...%*|Stop PROCs|
00020200  68 65 6c 6c 5f 42 72 6f  61 64 63 61 73 74 4d 65  |hell_BroadcastMe|
00020210  73 73 61 67 65 0d 11 1d  2a 2a 7c 53 74 61 72 74  |ssage...**|Start|
00020220  20 50 52 4f 43 73 68 65  6c 6c 5f 57 69 6e 64 6f  | PROCshell_Windo|
00020230  77 54 6f 67 67 6c 65 42  61 63 6b 49 63 6f 6e 0d  |wToggleBackIcon.|
00020240  11 1e 28 dd 20 f2 73 68  65 6c 6c 5f 57 69 6e 64  |..(. .shell_Wind|
00020250  6f 77 54 6f 67 67 6c 65  42 61 63 6b 49 63 6f 6e  |owToggleBackIcon|
00020260  28 f8 20 77 68 25 29 0d  11 1f 27 f2 73 68 65 6c  |(. wh%)...'.shel|
00020270  6c 5f 57 69 6e 64 6f 77  54 6f 67 67 6c 65 46 6c  |l_WindowToggleFl|
00020280  61 67 73 28 77 68 25 2c  31 3c 3c 32 34 29 0d 11  |ags(wh%,1<<24)..|
00020290  20 05 e1 0d 11 21 05 3a  0d 11 22 29 2a 7c 53 74  | ....!.:..")*|St|
000202a0  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 57 69 6e  |op PROCshell_Win|
000202b0  64 6f 77 54 6f 67 67 6c  65 42 61 63 6b 49 63 6f  |dowToggleBackIco|
000202c0  6e 0d 11 23 2b 2a 7c 53  74 61 72 74 20 50 52 4f  |n..#+*|Start PRO|
000202d0  43 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 54 6f 67  |Cshell_WindowTog|
000202e0  67 6c 65 43 6c 6f 73 65  49 63 6f 6e 0d 11 24 29  |gleCloseIcon..$)|
000202f0  dd 20 f2 73 68 65 6c 6c  5f 57 69 6e 64 6f 77 54  |. .shell_WindowT|
00020300  6f 67 67 6c 65 43 6c 6f  73 65 49 63 6f 6e 28 f8  |oggleCloseIcon(.|
00020310  20 77 68 25 29 0d 11 25  27 f2 73 68 65 6c 6c 5f  | wh%)..%'.shell_|
00020320  57 69 6e 64 6f 77 54 6f  67 67 6c 65 46 6c 61 67  |WindowToggleFlag|
00020330  73 28 77 68 25 2c 31 3c  3c 32 35 29 0d 11 26 05  |s(wh%,1<<25)..&.|
00020340  e1 0d 11 27 05 3a 0d 11  28 2a 2a 7c 53 74 6f 70  |...'.:..(**|Stop|
00020350  20 50 52 4f 43 73 68 65  6c 6c 5f 57 69 6e 64 6f  | PROCshell_Windo|
00020360  77 54 6f 67 67 6c 65 43  6c 6f 73 65 49 63 6f 6e  |wToggleCloseIcon|
00020370  0d 11 29 2a 2a 7c 53 74  61 72 74 20 50 52 4f 43  |..)**|Start PROC|
00020380  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 54 6f 67 67  |shell_WindowTogg|
00020390  6c 65 54 69 74 6c 65 42  61 72 0d 11 2a 28 dd 20  |leTitleBar..*(. |
000203a0  f2 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 54 6f 67  |.shell_WindowTog|
000203b0  67 6c 65 54 69 74 6c 65  42 61 72 28 f8 20 77 68  |gleTitleBar(. wh|
000203c0  25 29 0d 11 2b 27 f2 73  68 65 6c 6c 5f 57 69 6e  |%)..+'.shell_Win|
000203d0  64 6f 77 54 6f 67 67 6c  65 46 6c 61 67 73 28 77  |dowToggleFlags(w|
000203e0  68 25 2c 31 3c 3c 32 36  29 0d 11 2c 05 e1 0d 11  |h%,1<<26)..,....|
000203f0  2d 05 3a 0d 11 2e 29 2a  7c 53 74 6f 70 20 50 52  |-.:...)*|Stop PR|
00020400  4f 43 73 68 65 6c 6c 5f  57 69 6e 64 6f 77 54 6f  |OCshell_WindowTo|
00020410  67 67 6c 65 54 69 74 6c  65 42 61 72 0d 11 2f 2c  |ggleTitleBar../,|
00020420  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
00020430  6c 5f 57 69 6e 64 6f 77  54 6f 67 67 6c 65 54 6f  |l_WindowToggleTo|
00020440  67 67 6c 65 49 63 6f 6e  0d 11 30 2a dd 20 f2 73  |ggleIcon..0*. .s|
00020450  68 65 6c 6c 5f 57 69 6e  64 6f 77 54 6f 67 67 6c  |hell_WindowToggl|
00020460  65 54 6f 67 67 6c 65 49  63 6f 6e 28 f8 20 77 68  |eToggleIcon(. wh|
00020470  25 29 0d 11 31 27 f2 73  68 65 6c 6c 5f 57 69 6e  |%)..1'.shell_Win|
00020480  64 6f 77 54 6f 67 67 6c  65 46 6c 61 67 73 28 77  |dowToggleFlags(w|
00020490  68 25 2c 31 3c 3c 32 37  29 0d 11 32 05 e1 0d 11  |h%,1<<27)..2....|
000204a0  33 05 3a 0d 11 34 2b 2a  7c 53 74 6f 70 20 50 52  |3.:..4+*|Stop PR|
000204b0  4f 43 73 68 65 6c 6c 5f  57 69 6e 64 6f 77 54 6f  |OCshell_WindowTo|
000204c0  67 67 6c 65 54 6f 67 67  6c 65 49 63 6f 6e 0d 11  |ggleToggleIcon..|
000204d0  35 2c 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |5,*|Start PROCsh|
000204e0  65 6c 6c 5f 57 69 6e 64  6f 77 54 6f 67 67 6c 65  |ell_WindowToggle|
000204f0  48 53 63 72 6f 6c 6c 42  61 72 0d 11 36 2a dd 20  |HScrollBar..6*. |
00020500  f2 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 54 6f 67  |.shell_WindowTog|
00020510  67 6c 65 48 53 63 72 6f  6c 6c 42 61 72 28 f8 20  |gleHScrollBar(. |
00020520  77 68 25 29 0d 11 37 27  f2 73 68 65 6c 6c 5f 57  |wh%)..7'.shell_W|
00020530  69 6e 64 6f 77 54 6f 67  67 6c 65 46 6c 61 67 73  |indowToggleFlags|
00020540  28 77 68 25 2c 31 3c 3c  33 30 29 0d 11 38 05 e1  |(wh%,1<<30)..8..|
00020550  0d 11 39 05 3a 0d 11 3a  2b 2a 7c 53 74 6f 70 20  |..9.:..:+*|Stop |
00020560  50 52 4f 43 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |PROCshell_Window|
00020570  54 6f 67 67 6c 65 48 53  63 72 6f 6c 6c 42 61 72  |ToggleHScrollBar|
00020580  0d 11 3b 30 2a 7c 53 74  61 72 74 20 50 52 4f 43  |..;0*|Start PROC|
00020590  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 54 6f 67 67  |shell_WindowTogg|
000205a0  6c 65 41 64 6a 75 73 74  53 69 7a 65 49 63 6f 6e  |leAdjustSizeIcon|
000205b0  0d 11 3c 2e dd 20 f2 73  68 65 6c 6c 5f 57 69 6e  |..<.. .shell_Win|
000205c0  64 6f 77 54 6f 67 67 6c  65 41 64 6a 75 73 74 53  |dowToggleAdjustS|
000205d0  69 7a 65 49 63 6f 6e 28  f8 20 77 68 25 29 0d 11  |izeIcon(. wh%)..|
000205e0  3d 27 f2 73 68 65 6c 6c  5f 57 69 6e 64 6f 77 54  |='.shell_WindowT|
000205f0  6f 67 67 6c 65 46 6c 61  67 73 28 77 68 25 2c 31  |oggleFlags(wh%,1|
00020600  3c 3c 32 39 29 0d 11 3e  05 e1 0d 11 3f 05 3a 0d  |<<29)..>....?.:.|
00020610  11 40 2f 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |.@/*|Stop PROCsh|
00020620  65 6c 6c 5f 57 69 6e 64  6f 77 54 6f 67 67 6c 65  |ell_WindowToggle|
00020630  41 64 6a 75 73 74 53 69  7a 65 49 63 6f 6e 0d 11  |AdjustSizeIcon..|
00020640  41 2c 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |A,*|Start PROCsh|
00020650  65 6c 6c 5f 57 69 6e 64  6f 77 54 6f 67 67 6c 65  |ell_WindowToggle|
00020660  56 53 63 72 6f 6c 6c 42  61 72 0d 11 42 2a dd 20  |VScrollBar..B*. |
00020670  f2 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 54 6f 67  |.shell_WindowTog|
00020680  67 6c 65 56 53 63 72 6f  6c 6c 42 61 72 28 f8 20  |gleVScrollBar(. |
00020690  77 68 25 29 0d 11 43 27  f2 73 68 65 6c 6c 5f 57  |wh%)..C'.shell_W|
000206a0  69 6e 64 6f 77 54 6f 67  67 6c 65 46 6c 61 67 73  |indowToggleFlags|
000206b0  28 77 68 25 2c 31 3c 3c  32 38 29 0d 11 44 05 e1  |(wh%,1<<28)..D..|
000206c0  0d 11 45 05 3a 0d 11 46  2b 2a 7c 53 74 6f 70 20  |..E.:..F+*|Stop |
000206d0  50 52 4f 43 73 68 65 6c  6c 5f 57 69 6e 64 6f 77  |PROCshell_Window|
000206e0  54 6f 67 67 6c 65 56 53  63 72 6f 6c 6c 42 61 72  |ToggleVScrollBar|
000206f0  0d 11 47 27 2a 7c 53 74  61 72 74 20 50 52 4f 43  |..G'*|Start PROC|
00020700  73 68 65 6c 6c 5f 57 69  6e 64 6f 77 54 6f 67 67  |shell_WindowTogg|
00020710  6c 65 46 6c 61 67 73 0d  11 48 2b dd 20 f2 73 68  |leFlags..H+. .sh|
00020720  65 6c 6c 5f 57 69 6e 64  6f 77 54 6f 67 67 6c 65  |ell_WindowToggle|
00020730  46 6c 61 67 73 28 f8 20  77 68 25 2c 6d 61 73 6b  |Flags(. wh%,mask|
00020740  25 29 0d 11 49 1f ea 20  62 6c 6b 25 2c 66 6c 61  |%)..I.. blk%,fla|
00020750  67 73 25 2c 6f 70 65 6e  25 2c 68 61 6e 64 6c 65  |gs%,open%,handle|
00020760  25 0d 11 4a 15 2a 7c 69  66 64 65 66 20 54 72 61  |%..J.*|ifdef Tra|
00020770  63 65 49 6e 69 74 0d 11  4b 33 f2 73 68 65 6c 6c  |ceInit..K3.shell|
00020780  5f 54 72 61 63 65 66 30  28 22 57 69 6e 64 6f 77  |_Tracef0("Window|
00020790  54 6f 67 67 6c 65 46 6c  61 67 73 3a 77 68 25 3d  |ToggleFlags:wh%=|
000207a0  26 22 2b c3 7e 77 68 25  29 0d 11 4c 0b 2a 7c 65  |&"+.~wh%)..L.*|e|
000207b0  6e 64 69 66 0d 11 4d 22  6f 70 65 6e 25 3d a4 73  |ndif..M"open%=.s|
000207c0  68 65 6c 6c 5f 57 69 6e  64 6f 77 49 73 4f 70 65  |hell_WindowIsOpe|
000207d0  6e 28 77 68 25 29 0d 11  4e 24 62 6c 6b 25 3d a4  |n(wh%)..N$blk%=.|
000207e0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 46  |shell_HeapBlockF|
000207f0  65 74 63 68 28 36 30 30  30 29 0d 11 4f 0e 62 6c  |etch(6000)..O.bl|
00020800  6b 25 21 30 3d 77 68 25  0d 11 50 21 c8 99 20 22  |k%!0=wh%..P!.. "|
00020810  57 69 6d 70 5f 47 65 74  57 69 6e 64 6f 77 49 6e  |Wimp_GetWindowIn|
00020820  66 6f 22 2c 2c 62 6c 6b  25 0d 11 51 12 66 6c 61  |fo",,blk%..Q.fla|
00020830  67 73 25 3d 62 6c 6b 25  21 33 32 0d 11 52 1b 66  |gs%=blk%!32..R.f|
00020840  6c 61 67 73 25 3d 28 66  6c 61 67 73 25 20 82 20  |lags%=(flags% . |
00020850  6d 61 73 6b 25 29 0d 11  53 12 62 6c 6b 25 21 33  |mask%)..S.blk%!3|
00020860  32 3d 66 6c 61 67 73 25  0d 11 54 20 c8 99 20 22  |2=flags%..T .. "|
00020870  57 69 6d 70 5f 44 65 6c  65 74 65 57 69 6e 64 6f  |Wimp_DeleteWindo|
00020880  77 22 2c 2c 62 6c 6b 25  0d 11 55 2c c8 99 20 22  |w",,blk%..U,.. "|
00020890  57 69 6d 70 5f 43 72 65  61 74 65 57 69 6e 64 6f  |Wimp_CreateWindo|
000208a0  77 22 2c 2c 62 6c 6b 25  2b 34 20 b8 20 68 61 6e  |w",,blk%+4 . han|
000208b0  64 6c 65 25 0d 11 56 11  21 62 6c 6b 25 3d 68 61  |dle%..V.!blk%=ha|
000208c0  6e 64 6c 65 25 0d 11 57  0d e7 20 6f 70 65 6e 25  |ndle%..W.. open%|
000208d0  20 8c 0d 11 58 2b 20 20  f4 20 49 66 20 77 69 6e  | ...X+  . If win|
000208e0  64 6f 77 20 77 61 73 20  6f 70 65 6e 2c 20 6f 70  |dow was open, op|
000208f0  65 6e 20 69 74 20 61 67  61 69 6e 2e 2e 0d 11 59  |en it again....Y|
00020900  20 20 20 c8 99 20 22 57  69 6d 70 5f 4f 70 65 6e  |   .. "Wimp_Open|
00020910  57 69 6e 64 6f 77 22 2c  2c 62 6c 6b 25 0d 11 5a  |Window",,blk%..Z|
00020920  05 cd 0d 11 5b 20 f2 73  68 65 6c 6c 5f 48 65 61  |....[ .shell_Hea|
00020930  70 42 6c 6f 63 6b 52 65  74 75 72 6e 28 62 6c 6b  |pBlockReturn(blk|
00020940  25 29 0d 11 5c 14 e7 20  68 61 6e 64 6c 65 25 3c  |%)..\.. handle%<|
00020950  3e 77 68 25 20 8c 0d 11  5d 2c 20 20 f2 73 68 65  |>wh% ...],  .she|
00020960  6c 6c 5f 55 70 64 61 74  65 57 69 6e 64 6f 77 48  |ll_UpdateWindowH|
00020970  61 6e 64 6c 65 28 77 68  25 2c 68 61 6e 64 6c 65  |andle(wh%,handle|
00020980  25 29 0d 11 5e 11 20 20  77 68 25 3d 68 61 6e 64  |%)..^.  wh%=hand|
00020990  6c 65 25 0d 11 5f 05 cd  0d 11 60 05 e1 0d 11 61  |le%.._....`....a|
000209a0  05 3a 0d 11 62 26 2a 7c  53 74 6f 70 20 50 52 4f  |.:..b&*|Stop PRO|
000209b0  43 73 68 65 6c 6c 5f 57  69 6e 64 6f 77 54 6f 67  |Cshell_WindowTog|
000209c0  67 6c 65 46 6c 61 67 73  0d 11 63 25 2a 7c 53 74  |gleFlags..c%*|St|
000209d0  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 4c 69  |art PROCshell_Li|
000209e0  73 74 43 6c 69 63 6b 53  65 6c 65 63 74 0d 11 64  |stClickSelect..d|
000209f0  1c dd 20 f2 73 68 65 6c  6c 5f 4c 69 73 74 43 6c  |.. .shell_ListCl|
00020a00  69 63 6b 53 65 6c 65 63  74 0d 11 65 2a ea 20 65  |ickSelect..e*. e|
00020a10  5f 6c 69 73 74 25 2c 70  74 72 25 2c 6c 69 73 74  |_list%,ptr%,list|
00020a20  5f 73 69 7a 65 25 2c 74  65 6d 70 25 2c 74 65 6d  |_size%,temp%,tem|
00020a30  70 32 25 0d 11 66 12 65  5f 6c 69 73 74 25 3d 5f  |p2%..f.e_list%=_|
00020a40  55 25 21 31 32 0d 11 67  2c 6c 69 73 74 5f 73 69  |U%!12..g,list_si|
00020a50  7a 65 25 3d a4 73 68 65  6c 6c 5f 48 65 61 70 42  |ze%=.shell_HeapB|
00020a60  6c 6f 63 6b 49 6e 66 6f  28 65 5f 6c 69 73 74 25  |lockInfo(e_list%|
00020a70  29 0d 11 68 15 2a 7c 69  66 64 65 66 20 54 72 61  |)..h.*|ifdef Tra|
00020a80  63 65 49 6e 69 74 0d 11  69 17 f2 73 68 65 6c 6c  |ceInit..i..shell|
00020a90  5f 54 72 61 63 65 66 30  28 22 20 22 29 0d 11 6a  |_Tracef0(" ")..j|
00020aa0  31 f2 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  |1.shell_Tracef0(|
00020ab0  22 4c 69 73 74 20 6f 66  20 43 6c 69 63 6b 53 65  |"List of ClickSe|
00020ac0  6c 65 63 74 20 65 76 65  6e 74 73 3a 22 29 0d 11  |lect events:")..|
00020ad0  6b 0b 2a 7c 65 6e 64 69  66 0d 11 6c 0a 70 74 72  |k.*|endif..l.ptr|
00020ae0  25 3d 30 0d 11 6d 05 f5  0d 11 6e 31 20 20 74 65  |%=0..m....n1  te|
00020af0  6d 70 25 3d 65 5f 6c 69  73 74 25 21 28 70 74 72  |mp%=e_list%!(ptr|
00020b00  25 2b 32 30 29 3a 74 65  6d 70 32 25 3d 65 5f 6c  |%+20):temp2%=e_l|
00020b10  69 73 74 25 2b 70 74 72  25 0d 11 6f 27 20 20 e7  |ist%+ptr%..o'  .|
00020b20  20 a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
00020b30  6b 45 78 69 73 74 73 28  74 65 6d 70 25 29 20 8c  |kExists(temp%) .|
00020b40  0d 11 70 16 20 20 20 20  e7 20 24 74 65 6d 70 25  |..p.    . $temp%|
00020b50  3c 3e 22 22 20 8c 0d 11  71 15 2a 7c 69 66 64 65  |<>"" ...q.*|ifde|
00020b60  66 20 54 72 61 63 65 49  6e 69 74 0d 11 72 81 20  |f TraceInit..r. |
00020b70  20 f2 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  | .shell_Tracef0(|
00020b80  22 26 22 2b a4 73 68 65  6c 6c 5f 53 74 72 69 6e  |"&"+.shell_Strin|
00020b90  67 50 61 64 54 72 61 69  6c 69 6e 67 28 c3 7e 74  |gPadTrailing(.~t|
00020ba0  65 6d 70 32 25 21 30 2c  22 20 22 2c 38 29 2b 22  |emp2%!0," ",8)+"|
00020bb0  20 26 22 2b a4 73 68 65  6c 6c 5f 53 74 72 69 6e  | &"+.shell_Strin|
00020bc0  67 50 61 64 54 72 61 69  6c 69 6e 67 28 c3 7e 74  |gPadTrailing(.~t|
00020bd0  65 6d 70 32 25 21 34 2c  22 20 22 2c 38 29 2b 22  |emp2%!4," ",8)+"|
00020be0  20 20 20 22 2b 24 74 65  6d 70 25 29 0d 11 73 0b  |   "+$temp%)..s.|
00020bf0  2a 7c 65 6e 64 69 66 0d  11 74 09 20 20 20 20 cd  |*|endif..t.    .|
00020c00  0d 11 75 07 20 20 cd 0d  11 76 0e 20 20 70 74 72  |..u.  ...v.  ptr|
00020c10  25 2b 3d 34 38 0d 11 77  18 fd 20 28 70 74 72 25  |%+=48..w.. (ptr%|
00020c20  3e 3d 6c 69 73 74 5f 73  69 7a 65 25 29 0d 11 78  |>=list_size%)..x|
00020c30  15 2a 7c 69 66 64 65 66  20 54 72 61 63 65 49 6e  |.*|ifdef TraceIn|
00020c40  69 74 0d 11 79 17 f2 73  68 65 6c 6c 5f 54 72 61  |it..y..shell_Tra|
00020c50  63 65 66 30 28 22 20 22  29 0d 11 7a 0b 2a 7c 65  |cef0(" ")..z.*|e|
00020c60  6e 64 69 66 0d 11 7b 05  e1 0d 11 7c 05 3a 0d 11  |ndif..{....|.:..|
00020c70  7d 24 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |}$*|Stop PROCshe|
00020c80  6c 6c 5f 4c 69 73 74 43  6c 69 63 6b 53 65 6c 65  |ll_ListClickSele|
00020c90  63 74 0d 11 7e 25 2a 7c  53 74 61 72 74 20 50 52  |ct..~%*|Start PR|
00020ca0  4f 43 73 68 65 6c 6c 5f  4c 69 73 74 43 6c 69 63  |OCshell_ListClic|
00020cb0  6b 41 64 6a 75 73 74 0d  11 7f 1c dd 20 f2 73 68  |kAdjust..... .sh|
00020cc0  65 6c 6c 5f 4c 69 73 74  43 6c 69 63 6b 41 64 6a  |ell_ListClickAdj|
00020cd0  75 73 74 0d 11 80 2a ea  20 65 5f 6c 69 73 74 25  |ust...*. e_list%|
00020ce0  2c 70 74 72 25 2c 6c 69  73 74 5f 73 69 7a 65 25  |,ptr%,list_size%|
00020cf0  2c 74 65 6d 70 25 2c 74  65 6d 70 32 25 0d 11 81  |,temp%,temp2%...|
00020d00  12 65 5f 6c 69 73 74 25  3d 5f 55 25 21 31 32 0d  |.e_list%=_U%!12.|
00020d10  11 82 2c 6c 69 73 74 5f  73 69 7a 65 25 3d a4 73  |..,list_size%=.s|
00020d20  68 65 6c 6c 5f 48 65 61  70 42 6c 6f 63 6b 49 6e  |hell_HeapBlockIn|
00020d30  66 6f 28 65 5f 6c 69 73  74 25 29 0d 11 83 15 2a  |fo(e_list%)....*|
00020d40  7c 69 66 64 65 66 20 54  72 61 63 65 49 6e 69 74  ||ifdef TraceInit|
00020d50  0d 11 84 17 f2 73 68 65  6c 6c 5f 54 72 61 63 65  |.....shell_Trace|
00020d60  66 30 28 22 20 22 29 0d  11 85 31 f2 73 68 65 6c  |f0(" ")...1.shel|
00020d70  6c 5f 54 72 61 63 65 66  30 28 22 4c 69 73 74 20  |l_Tracef0("List |
00020d80  6f 66 20 43 6c 69 63 6b  41 64 6a 75 73 74 20 65  |of ClickAdjust e|
00020d90  76 65 6e 74 73 3a 22 29  0d 11 86 0b 2a 7c 65 6e  |vents:")....*|en|
00020da0  64 69 66 0d 11 87 0a 70  74 72 25 3d 30 0d 11 88  |dif....ptr%=0...|
00020db0  05 f5 0d 11 89 31 20 20  74 65 6d 70 25 3d 65 5f  |.....1  temp%=e_|
00020dc0  6c 69 73 74 25 21 28 70  74 72 25 2b 32 34 29 3a  |list%!(ptr%+24):|
00020dd0  74 65 6d 70 32 25 3d 65  5f 6c 69 73 74 25 2b 70  |temp2%=e_list%+p|
00020de0  74 72 25 0d 11 8a 27 20  20 e7 20 a4 73 68 65 6c  |tr%...'  . .shel|
00020df0  6c 5f 48 65 61 70 42 6c  6f 63 6b 45 78 69 73 74  |l_HeapBlockExist|
00020e00  73 28 74 65 6d 70 25 29  20 8c 0d 11 8b 16 20 20  |s(temp%) .....  |
00020e10  20 20 e7 20 24 74 65 6d  70 25 3c 3e 22 22 20 8c  |  . $temp%<>"" .|
00020e20  0d 11 8c 15 2a 7c 69 66  64 65 66 20 54 72 61 63  |....*|ifdef Trac|
00020e30  65 49 6e 69 74 0d 11 8d  81 20 20 f2 73 68 65 6c  |eInit....  .shel|
00020e40  6c 5f 54 72 61 63 65 66  30 28 22 26 22 2b a4 73  |l_Tracef0("&"+.s|
00020e50  68 65 6c 6c 5f 53 74 72  69 6e 67 50 61 64 54 72  |hell_StringPadTr|
00020e60  61 69 6c 69 6e 67 28 c3  7e 74 65 6d 70 32 25 21  |ailing(.~temp2%!|
00020e70  30 2c 22 20 22 2c 38 29  2b 22 20 26 22 2b a4 73  |0," ",8)+" &"+.s|
00020e80  68 65 6c 6c 5f 53 74 72  69 6e 67 50 61 64 54 72  |hell_StringPadTr|
00020e90  61 69 6c 69 6e 67 28 c3  7e 74 65 6d 70 32 25 21  |ailing(.~temp2%!|
00020ea0  34 2c 22 20 22 2c 38 29  2b 22 20 20 20 22 2b 24  |4," ",8)+"   "+$|
00020eb0  74 65 6d 70 25 29 0d 11  8e 0b 2a 7c 65 6e 64 69  |temp%)....*|endi|
00020ec0  66 0d 11 8f 09 20 20 20  20 cd 0d 11 90 07 20 20  |f....    .....  |
00020ed0  cd 0d 11 91 0e 20 20 70  74 72 25 2b 3d 34 38 0d  |.....  ptr%+=48.|
00020ee0  11 92 18 fd 20 28 70 74  72 25 3e 3d 6c 69 73 74  |.... (ptr%>=list|
00020ef0  5f 73 69 7a 65 25 29 0d  11 93 15 2a 7c 69 66 64  |_size%)....*|ifd|
00020f00  65 66 20 54 72 61 63 65  49 6e 69 74 0d 11 94 17  |ef TraceInit....|
00020f10  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
00020f20  20 22 29 0d 11 95 0b 2a  7c 65 6e 64 69 66 0d 11  | ")....*|endif..|
00020f30  96 05 e1 0d 11 97 05 3a  0d 11 98 24 2a 7c 53 74  |.......:...$*|St|
00020f40  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 4c 69 73  |op PROCshell_Lis|
00020f50  74 43 6c 69 63 6b 41 64  6a 75 73 74 0d 11 99 22  |tClickAdjust..."|
00020f60  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
00020f70  6c 5f 4c 69 73 74 48 65  6c 70 54 61 67 73 0d 11  |l_ListHelpTags..|
00020f80  9a 19 dd 20 f2 73 68 65  6c 6c 5f 4c 69 73 74 48  |... .shell_ListH|
00020f90  65 6c 70 54 61 67 73 0d  11 9b 2a ea 20 65 5f 6c  |elpTags...*. e_l|
00020fa0  69 73 74 25 2c 70 74 72  25 2c 6c 69 73 74 5f 73  |ist%,ptr%,list_s|
00020fb0  69 7a 65 25 2c 74 65 6d  70 25 2c 74 65 6d 70 32  |ize%,temp%,temp2|
00020fc0  25 0d 11 9c 12 65 5f 6c  69 73 74 25 3d 5f 55 25  |%....e_list%=_U%|
00020fd0  21 31 32 0d 11 9d 2c 6c  69 73 74 5f 73 69 7a 65  |!12...,list_size|
00020fe0  25 3d a4 73 68 65 6c 6c  5f 48 65 61 70 42 6c 6f  |%=.shell_HeapBlo|
00020ff0  63 6b 49 6e 66 6f 28 65  5f 6c 69 73 74 25 29 0d  |ckInfo(e_list%).|
00021000  11 9e 15 2a 7c 69 66 64  65 66 20 54 72 61 63 65  |...*|ifdef Trace|
00021010  49 6e 69 74 0d 11 9f 17  f2 73 68 65 6c 6c 5f 54  |Init.....shell_T|
00021020  72 61 63 65 66 30 28 22  20 22 29 0d 11 a0 31 f2  |racef0(" ")...1.|
00021030  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 4c  |shell_Tracef0("L|
00021040  69 73 74 20 6f 66 20 61  74 74 61 63 68 65 64 20  |ist of attached |
00021050  68 65 6c 70 20 74 61 67  73 3a 22 29 0d 11 a1 0b  |help tags:")....|
00021060  2a 7c 65 6e 64 69 66 0d  11 a2 0a 70 74 72 25 3d  |*|endif....ptr%=|
00021070  30 0d 11 a3 05 f5 0d 11  a4 31 20 20 74 65 6d 70  |0........1  temp|
00021080  25 3d 65 5f 6c 69 73 74  25 21 28 70 74 72 25 2b  |%=e_list%!(ptr%+|
00021090  34 34 29 3a 74 65 6d 70  32 25 3d 65 5f 6c 69 73  |44):temp2%=e_lis|
000210a0  74 25 2b 70 74 72 25 0d  11 a5 27 20 20 e7 20 a4  |t%+ptr%...'  . .|
000210b0  73 68 65 6c 6c 5f 48 65  61 70 42 6c 6f 63 6b 45  |shell_HeapBlockE|
000210c0  78 69 73 74 73 28 74 65  6d 70 25 29 20 8c 0d 11  |xists(temp%) ...|
000210d0  a6 16 20 20 20 20 e7 20  24 74 65 6d 70 25 3c 3e  |..    . $temp%<>|
000210e0  22 22 20 8c 0d 11 a7 15  2a 7c 69 66 64 65 66 20  |"" .....*|ifdef |
000210f0  54 72 61 63 65 49 6e 69  74 0d 11 a8 81 20 20 f2  |TraceInit....  .|
00021100  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 26  |shell_Tracef0("&|
00021110  22 2b a4 73 68 65 6c 6c  5f 53 74 72 69 6e 67 50  |"+.shell_StringP|
00021120  61 64 54 72 61 69 6c 69  6e 67 28 c3 7e 74 65 6d  |adTrailing(.~tem|
00021130  70 32 25 21 30 2c 22 20  22 2c 38 29 2b 22 20 26  |p2%!0," ",8)+" &|
00021140  22 2b a4 73 68 65 6c 6c  5f 53 74 72 69 6e 67 50  |"+.shell_StringP|
00021150  61 64 54 72 61 69 6c 69  6e 67 28 c3 7e 74 65 6d  |adTrailing(.~tem|
00021160  70 32 25 21 34 2c 22 20  22 2c 38 29 2b 22 20 20  |p2%!4," ",8)+"  |
00021170  20 22 2b 24 74 65 6d 70  25 29 0d 11 a9 0b 2a 7c  | "+$temp%)....*||
00021180  65 6e 64 69 66 0d 11 aa  09 20 20 20 20 cd 0d 11  |endif....    ...|
00021190  ab 07 20 20 cd 0d 11 ac  0e 20 20 70 74 72 25 2b  |..  .....  ptr%+|
000211a0  3d 34 38 0d 11 ad 18 fd  20 28 70 74 72 25 3e 3d  |=48..... (ptr%>=|
000211b0  6c 69 73 74 5f 73 69 7a  65 25 29 0d 11 ae 15 2a  |list_size%)....*|
000211c0  7c 69 66 64 65 66 20 54  72 61 63 65 49 6e 69 74  ||ifdef TraceInit|
000211d0  0d 11 af 17 f2 73 68 65  6c 6c 5f 54 72 61 63 65  |.....shell_Trace|
000211e0  66 30 28 22 20 22 29 0d  11 b0 0b 2a 7c 65 6e 64  |f0(" ")....*|end|
000211f0  69 66 0d 11 b1 05 e1 0d  11 b2 05 3a 0d 11 b3 21  |if.........:...!|
00021200  2a 7c 53 74 6f 70 20 50  52 4f 43 73 68 65 6c 6c  |*|Stop PROCshell|
00021210  5f 4c 69 73 74 48 65 6c  70 54 61 67 73 0d 11 b4  |_ListHelpTags...|
00021220  1d 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |.*|Start PROCshe|
00021230  6c 6c 5f 4d 65 6d 46 69  6c 6c 0d 11 b5 2d dd 20  |ll_MemFill...-. |
00021240  f2 73 68 65 6c 6c 5f 4d  65 6d 46 69 6c 6c 28 73  |.shell_MemFill(s|
00021250  74 61 72 74 25 2c 6e 72  5f 62 79 74 65 73 25 2c  |tart%,nr_bytes%,|
00021260  76 61 6c 75 65 25 29 0d  11 b6 1d ea 20 49 25 2c  |value%)..... I%,|
00021270  6e 72 5f 77 6f 72 64 73  25 2c 72 65 6d 61 69 6e  |nr_words%,remain|
00021280  64 65 72 25 0d 11 b7 1b  6e 72 5f 77 6f 72 64 73  |der%....nr_words|
00021290  25 3d 6e 72 5f 62 79 74  65 73 25 20 81 20 34 0d  |%=nr_bytes% . 4.|
000212a0  11 b8 1c 72 65 6d 61 69  6e 64 65 72 25 3d 6e 72  |...remainder%=nr|
000212b0  5f 62 79 74 65 73 25 20  83 20 34 0d 11 b9 13 e7  |_bytes% . 4.....|
000212c0  20 6e 72 5f 77 6f 72 64  73 25 3e 30 20 8c 0d 11  | nr_words%>0 ...|
000212d0  ba 20 20 20 e3 20 49 25  3d 31 20 b8 20 28 6e 72  |.   . I%=1 . (nr|
000212e0  5f 77 6f 72 64 73 25 2a  34 29 20 88 20 34 0d 11  |_words%*4) . 4..|
000212f0  bb 1c 20 20 20 20 73 74  61 72 74 25 21 28 49 25  |..    start%!(I%|
00021300  2d 31 29 3d 76 61 6c 75  65 25 0d 11 bc 0a 20 20  |-1)=value%....  |
00021310  ed 20 49 25 0d 11 bd 05  cd 0d 11 be 14 e7 20 72  |. I%.......... r|
00021320  65 6d 61 69 6e 64 65 72  25 3e 30 20 8c 0d 11 bf  |emainder%>0 ....|
00021330  21 20 20 73 74 61 72 74  25 3d 73 74 61 72 74 25  |!  start%=start%|
00021340  2b 28 6e 72 5f 77 6f 72  64 73 25 2a 34 29 0d 11  |+(nr_words%*4)..|
00021350  c0 1b 20 20 e3 20 49 25  3d 30 20 b8 20 72 65 6d  |..  . I%=0 . rem|
00021360  61 69 6e 64 65 72 25 2d  31 0d 11 c1 18 20 20 20  |ainder%-1....   |
00021370  20 73 74 61 72 74 25 3f  49 25 3d 76 61 6c 75 65  | start%?I%=value|
00021380  25 0d 11 c2 0a 20 20 ed  20 49 25 0d 11 c3 05 cd  |%....  . I%.....|
00021390  0d 11 c4 05 e1 0d 11 c5  05 3a 0d 11 c6 1c 2a 7c  |.........:....*||
000213a0  53 74 6f 70 20 50 52 4f  43 73 68 65 6c 6c 5f 4d  |Stop PROCshell_M|
000213b0  65 6d 46 69 6c 6c 0d 11  c7 04 0d 11 c8 24 2a 7c  |emFill.......$*||
000213c0  53 74 61 72 74 20 50 52  4f 43 73 68 65 6c 6c 5f  |Start PROCshell_|
000213d0  41 74 74 61 63 68 46 6f  6e 74 4d 65 6e 75 0d 11  |AttachFontMenu..|
000213e0  c9 1b 2a 7c 44 65 66 69  6e 65 20 55 73 69 6e 67  |..*|Define Using|
000213f0  5f 46 6f 6e 74 4d 65 6e  75 0d 11 ca 36 dd 20 f2  |_FontMenu...6. .|
00021400  73 68 65 6c 6c 5f 41 74  74 61 63 68 46 6f 6e 74  |shell_AttachFont|
00021410  4d 65 6e 75 28 77 68 25  2c 69 68 25 2c 73 65 6c  |Menu(wh%,ih%,sel|
00021420  5f 66 6e 24 2c 6d 61 6b  65 72 5f 66 6e 24 29 0d  |_fn$,maker_fn$).|
00021430  11 cb 0b ea 20 6d 65 6e  75 25 0d 11 cc 17 f2 73  |.... menu%.....s|
00021440  68 65 6c 6c 5f 46 6f 6e  74 4d 65 6e 75 49 6e 69  |hell_FontMenuIni|
00021450  74 0d 11 cd 2f c8 99 20  22 46 6f 6e 74 4d 65 6e  |t.../.. "FontMen|
00021460  75 5f 53 65 6c 65 63 74  22 2c 22 22 2b bd 30 2c  |u_Select",""+.0,|
00021470  5f 55 25 21 32 36 30 20  b8 20 2c 6d 65 6e 75 25  |_U%!260 . ,menu%|
00021480  0d 11 ce 26 f4 20 53 74  6f 72 65 20 6d 65 6e 75  |...&. Store menu|
00021490  20 70 74 72 20 69 6e 20  73 68 65 6c 6c 20 6d 65  | ptr in shell me|
000214a0  6d 6f 72 79 2e 2e 0d 11  cf 11 5f 55 25 21 32 35  |mory......_U%!25|
000214b0  32 3d 6d 65 6e 75 25 0d  11 d0 29 f2 73 68 65 6c  |2=menu%...).shel|
000214c0  6c 5f 45 76 65 6e 74 41  64 64 28 77 68 25 2c 69  |l_EventAdd(wh%,i|
000214d0  68 25 2c 30 2c 2d 32 2c  73 65 6c 5f 66 6e 24 29  |h%,0,-2,sel_fn$)|
000214e0  0d 11 d1 1f 2a 7c 69 66  64 65 66 20 50 52 4f 43  |....*|ifdef PROC|
000214f0  73 68 65 6c 6c 5f 54 72  61 63 65 49 6e 69 74 0d  |shell_TraceInit.|
00021500  11 d2 38 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |..8.shell_Tracef|
00021510  30 28 22 41 74 74 61 63  68 46 6f 6e 74 4d 65 6e  |0("AttachFontMen|
00021520  75 3a 41 74 74 61 63 68  69 6e 67 20 66 6f 6e 74  |u:Attaching font|
00021530  20 6d 65 6e 75 22 29 0d  11 d3 0b 2a 7c 65 6e 64  | menu")....*|end|
00021540  69 66 0d 11 d4 3f e7 20  6d 61 6b 65 72 5f 66 6e  |if...?. maker_fn|
00021550  24 3c 3e 22 22 20 8c 20  f2 73 68 65 6c 6c 5f 41  |$<>"" . .shell_A|
00021560  74 74 61 63 68 4d 65 6e  75 4d 61 6b 65 72 28 77  |ttachMenuMaker(w|
00021570  68 25 2c 69 68 25 2c 6d  61 6b 65 72 5f 66 6e 24  |h%,ih%,maker_fn$|
00021580  29 0d 11 d5 05 e1 0d 11  d6 05 3a 0d 11 d7 23 2a  |).........:...#*|
00021590  7c 53 74 6f 70 20 50 52  4f 43 73 68 65 6c 6c 5f  ||Stop PROCshell_|
000215a0  41 74 74 61 63 68 46 6f  6e 74 4d 65 6e 75 0d 11  |AttachFontMenu..|
000215b0  d8 04 0d 11 d9 27 2a 7c  53 74 61 72 74 20 50 52  |.....'*|Start PR|
000215c0  4f 43 73 68 65 6c 6c 5f  41 74 74 61 63 68 46 6f  |OCshell_AttachFo|
000215d0  6e 74 53 75 62 4d 65 6e  75 0d 11 da 1b 2a 7c 44  |ntSubMenu....*|D|
000215e0  65 66 69 6e 65 20 55 73  69 6e 67 5f 46 6f 6e 74  |efine Using_Font|
000215f0  4d 65 6e 75 0d 11 db 36  dd 20 f2 73 68 65 6c 6c  |Menu...6. .shell|
00021600  5f 41 74 74 61 63 68 46  6f 6e 74 53 75 62 4d 65  |_AttachFontSubMe|
00021610  6e 75 28 69 74 65 6d 25  2c 77 61 72 6e 5f 66 6e  |nu(item%,warn_fn|
00021620  24 2c 73 65 6c 5f 66 6e  24 29 0d 11 dc 21 ea 20  |$,sel_fn$)...!. |
00021630  69 74 65 6d 73 74 61 72  74 25 2c 6d 65 6e 75 25  |itemstart%,menu%|
00021640  2c 74 65 6d 70 25 2c 63  74 72 25 0d 11 dd 17 f2  |,temp%,ctr%.....|
00021650  73 68 65 6c 6c 5f 46 6f  6e 74 4d 65 6e 75 49 6e  |shell_FontMenuIn|
00021660  69 74 0d 11 de 2f c8 99  20 22 46 6f 6e 74 4d 65  |it.../.. "FontMe|
00021670  6e 75 5f 53 65 6c 65 63  74 22 2c 22 22 2b bd 30  |nu_Select",""+.0|
00021680  2c 5f 55 25 21 32 36 30  20 b8 20 2c 6d 65 6e 75  |,_U%!260 . ,menu|
00021690  25 0d 11 df 25 c8 99 20  22 4d 65 6e 75 55 74 69  |%...%.. "MenuUti|
000216a0  6c 5f 53 75 62 4d 65 6e  75 22 2c 69 74 65 6d 25  |l_SubMenu",item%|
000216b0  2c 6d 65 6e 75 25 0d 11  e0 1c c8 99 20 22 4d 65  |,menu%...... "Me|
000216c0  6e 75 55 74 69 6c 5f 57  61 72 6e 69 6e 67 22 2c  |nuUtil_Warning",|
000216d0  2c b9 0d 11 e1 26 f4 20  53 74 6f 72 65 20 6d 65  |,....&. Store me|
000216e0  6e 75 20 70 74 72 20 69  6e 20 73 68 65 6c 6c 20  |nu ptr in shell |
000216f0  6d 65 6d 6f 72 79 2e 2e  0d 11 e2 11 5f 55 25 21  |memory......_U%!|
00021700  32 35 32 3d 6d 65 6e 75  25 0d 11 e3 3a f2 73 68  |252=menu%...:.sh|
00021710  65 6c 6c 5f 45 76 65 6e  74 4c 69 73 74 4d 65 6e  |ell_EventListMen|
00021720  75 57 61 72 6e 28 69 74  65 6d 25 2c 6d 65 6e 75  |uWarn(item%,menu|
00021730  25 2c 77 61 72 6e 5f 66  6e 24 2c 73 65 6c 5f 66  |%,warn_fn$,sel_f|
00021740  6e 24 29 0d 11 e4 1f 2a  7c 69 66 64 65 66 20 50  |n$)....*|ifdef P|
00021750  52 4f 43 73 68 65 6c 6c  5f 54 72 61 63 65 49 6e  |ROCshell_TraceIn|
00021760  69 74 0d 11 e5 45 f2 73  68 65 6c 6c 5f 54 72 61  |it...E.shell_Tra|
00021770  63 65 66 30 28 22 41 74  74 61 63 68 46 6f 6e 74  |cef0("AttachFont|
00021780  53 75 62 4d 65 6e 75 3a  41 74 74 61 63 68 69 6e  |SubMenu:Attachin|
00021790  67 20 66 6f 6e 74 20 6d  65 6e 75 20 26 22 2b c3  |g font menu &"+.|
000217a0  7e 6d 65 6e 75 25 29 0d  11 e6 0b 2a 7c 65 6e 64  |~menu%)....*|end|
000217b0  69 66 0d 11 e7 05 e1 0d  11 e8 05 3a 0d 11 e9 26  |if.........:...&|
000217c0  2a 7c 53 74 6f 70 20 50  52 4f 43 73 68 65 6c 6c  |*|Stop PROCshell|
000217d0  5f 41 74 74 61 63 68 46  6f 6e 74 53 75 62 4d 65  |_AttachFontSubMe|
000217e0  6e 75 0d 11 ea 04 0d 11  eb 22 2a 7c 53 74 61 72  |nu......."*|Star|
000217f0  74 20 50 52 4f 43 73 68  65 6c 6c 5f 46 6f 6e 74  |t PROCshell_Font|
00021800  4d 65 6e 75 49 6e 69 74  0d 11 ec 19 dd 20 f2 73  |MenuInit..... .s|
00021810  68 65 6c 6c 5f 46 6f 6e  74 4d 65 6e 75 49 6e 69  |hell_FontMenuIni|
00021820  74 0d 11 ed 46 ff 20 28  22 52 4d 45 6e 73 75 72  |t...F. ("RMEnsur|
00021830  65 20 46 6f 6e 74 4d 65  6e 75 20 31 2e 31 36 20  |e FontMenu 1.16 |
00021840  52 4d 4c 6f 61 64 20 3c  45 76 6e 74 53 68 65 6c  |RMLoad <EvntShel|
00021850  6c 53 79 73 74 65 6d 24  50 61 74 68 3e 46 6f 6e  |lSystem$Path>Fon|
00021860  74 4d 65 6e 75 22 29 0d  11 ee 44 ff 20 28 22 52  |tMenu")...D. ("R|
00021870  4d 45 6e 73 75 72 65 20  46 6f 6e 74 4d 65 6e 75  |MEnsure FontMenu|
00021880  20 31 2e 31 36 20 45 72  72 6f 72 20 43 6f 75 6c  | 1.16 Error Coul|
00021890  64 6e 27 74 20 6c 6f 61  64 20 46 6f 6e 74 4d 65  |dn't load FontMe|
000218a0  6e 75 20 6d 6f 64 75 6c  65 22 29 0d 11 ef 12 e7  |nu module").....|
000218b0  20 5f 55 25 21 32 34 30  3d 2d 31 20 8c 0d 11 f0  | _U%!240=-1 ....|
000218c0  4c 20 20 f4 20 54 68 65  20 61 62 6f 76 65 20 66  |L  . The above f|
000218d0  6c 61 67 20 65 6e 73 75  72 65 73 20 74 68 61 74  |lag ensures that|
000218e0  20 74 68 65 20 6c 69 62  72 61 72 79 20 6b 6e 6f  | the library kno|
000218f0  77 73 20 74 68 61 74 20  22 46 6f 6e 74 4d 65 6e  |ws that "FontMen|
00021900  75 5f 43 72 65 61 74 65  22 0d 11 f1 49 20 20 f4  |u_Create"...I  .|
00021910  20 68 61 73 20 62 65 65  6e 20 63 61 6c 6c 65 64  | has been called|
00021920  2e 20 49 74 20 73 68 6f  75 6c 64 20 6f 6e 6c 79  |. It should only|
00021930  20 62 65 20 63 61 6c 6c  65 64 20 6f 6e 63 65 20  | be called once |
00021940  69 6e 20 61 20 70 72 6f  67 72 61 6d 20 61 73 20  |in a program as |
00021950  69 74 0d 11 f2 39 20 20  f4 20 72 65 67 69 73 74  |it...9  . regist|
00021960  65 72 73 20 74 68 65 20  70 72 6f 67 72 61 6d 20  |ers the program |
00021970  61 73 20 61 20 46 6f 6e  74 4d 65 6e 75 20 6d 6f  |as a FontMenu mo|
00021980  64 75 6c 65 20 75 73 65  72 2e 2e 0d 11 f3 24 20  |dule user.....$ |
00021990  20 c8 99 20 22 46 6f 6e  74 4d 65 6e 75 5f 43 72  | .. "FontMenu_Cr|
000219a0  65 61 74 65 22 20 b8 20  5f 55 25 21 32 34 30 0d  |eate" . _U%!240.|
000219b0  11 f4 05 cd 0d 11 f5 23  f2 73 68 65 6c 6c 5f 46  |.......#.shell_F|
000219c0  6f 6e 74 4d 65 6e 75 53  65 6c 65 63 74 46 6f 6e  |ontMenuSelectFon|
000219d0  74 28 22 22 2c b9 29 0d  11 f6 05 e1 0d 11 f7 05  |t("",.).........|
000219e0  3a 0d 11 f8 21 2a 7c 53  74 6f 70 20 50 52 4f 43  |:...!*|Stop PROC|
000219f0  73 68 65 6c 6c 5f 46 6f  6e 74 4d 65 6e 75 49 6e  |shell_FontMenuIn|
00021a00  69 74 0d 11 f9 28 2a 7c  53 74 61 72 74 20 50 52  |it...(*|Start PR|
00021a10  4f 43 73 68 65 6c 6c 5f  46 6f 6e 74 4d 65 6e 75  |OCshell_FontMenu|
00021a20  53 65 6c 65 63 74 46 6f  6e 74 0d 11 fa 36 dd 20  |SelectFont...6. |
00021a30  f2 73 68 65 6c 6c 5f 46  6f 6e 74 4d 65 6e 75 53  |.shell_FontMenuS|
00021a40  65 6c 65 63 74 46 6f 6e  74 28 66 6f 6e 74 6e 61  |electFont(fontna|
00021a50  6d 65 24 2c 73 79 73 74  65 6d 66 6f 6e 74 25 29  |me$,systemfont%)|
00021a60  0d 11 fb 13 ea 20 74 65  6d 70 25 2c 66 5f 6d 65  |..... temp%,f_me|
00021a70  6e 75 25 0d 11 fc 47 e7  20 a4 73 68 65 6c 6c 5f  |nu%...G. .shell_|
00021a80  48 65 61 70 42 6c 6f 63  6b 45 78 69 73 74 73 28  |HeapBlockExists(|
00021a90  5f 55 25 21 32 34 34 29  20 8c 20 f2 73 68 65 6c  |_U%!244) . .shel|
00021aa0  6c 5f 48 65 61 70 42 6c  6f 63 6b 52 65 74 75 72  |l_HeapBlockRetur|
00021ab0  6e 28 5f 55 25 21 32 34  34 29 0d 11 fd 2f 5f 55  |n(_U%!244).../_U|
00021ac0  25 21 32 34 34 3d a4 73  68 65 6c 6c 5f 48 65 61  |%!244=.shell_Hea|
00021ad0  70 42 6c 6f 63 6b 46 65  74 63 68 28 a9 66 6f 6e  |pBlockFetch(.fon|
00021ae0  74 6e 61 6d 65 24 2b 31  29 0d 11 fe 22 74 65 6d  |tname$+1)..."tem|
00021af0  70 25 3d 5f 55 25 21 32  34 34 3a 24 74 65 6d 70  |p%=_U%!244:$temp|
00021b00  25 3d 66 6f 6e 74 6e 61  6d 65 24 0d 11 ff 24 e7  |%=fontname$...$.|
00021b10  20 73 79 73 74 65 6d 66  6f 6e 74 25 3c 3e 30 20  | systemfont%<>0 |
00021b20  8c 20 73 79 73 74 65 6d  66 6f 6e 74 25 3d 31 0d  |. systemfont%=1.|
00021b30  12 00 17 5f 55 25 21 32  36 30 3d 73 79 73 74 65  |..._U%!260=syste|
00021b40  6d 66 6f 6e 74 25 0d 12  01 35 c8 99 20 22 46 6f  |mfont%...5.. "Fo|
00021b50  6e 74 4d 65 6e 75 5f 53  65 6c 65 63 74 22 2c 66  |ntMenu_Select",f|
00021b60  6f 6e 74 6e 61 6d 65 24  2c 5f 55 25 21 32 36 30  |ontname$,_U%!260|
00021b70  20 b8 20 2c 66 5f 6d 65  6e 75 25 0d 12 02 18 e7  | . ,f_menu%.....|
00021b80  20 66 5f 6d 65 6e 75 25  3c 3e 5f 55 25 21 32 35  | f_menu%<>_U%!25|
00021b90  32 20 8c 0d 12 03 22 20  20 f4 20 46 6f 6e 74 4d  |2 ...."  . FontM|
00021ba0  65 6e 75 20 70 74 72 20  68 61 73 20 63 68 61 6e  |enu ptr has chan|
00021bb0  67 65 64 2e 2e 0d 12 04  27 20 20 f2 73 68 65 6c  |ged.....'  .shel|
00021bc0  6c 5f 46 6f 6e 74 4d 65  6e 75 55 70 64 61 74 65  |l_FontMenuUpdate|
00021bd0  50 74 72 28 66 5f 6d 65  6e 75 25 29 0d 12 05 15  |Ptr(f_menu%)....|
00021be0  20 20 5f 55 25 21 32 35  32 3d 66 5f 6d 65 6e 75  |  _U%!252=f_menu|
00021bf0  25 0d 12 06 05 cd 0d 12  07 15 2a 7c 69 66 64 65  |%.........*|ifde|
00021c00  66 20 54 72 61 63 65 49  6e 69 74 0d 12 08 40 f2  |f TraceInit...@.|
00021c10  73 68 65 6c 6c 5f 54 72  61 63 65 66 30 28 22 46  |shell_Tracef0("F|
00021c20  6f 6e 74 4d 65 6e 75 53  65 6c 65 63 74 46 6f 6e  |ontMenuSelectFon|
00021c30  74 3a 46 6f 6e 74 20 69  73 20 27 22 2b 66 6f 6e  |t:Font is '"+fon|
00021c40  74 6e 61 6d 65 24 2b 22  27 22 29 0d 12 09 0b 2a  |tname$+"'")....*|
00021c50  7c 65 6e 64 69 66 0d 12  0a 05 e1 0d 12 0b 05 3a  ||endif.........:|
00021c60  0d 12 0c 27 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |...'*|Stop PROCs|
00021c70  68 65 6c 6c 5f 46 6f 6e  74 4d 65 6e 75 53 65 6c  |hell_FontMenuSel|
00021c80  65 63 74 46 6f 6e 74 0d  12 0d 2f 2a 7c 53 74 61  |ectFont.../*|Sta|
00021c90  72 74 20 46 4e 73 68 65  6c 6c 5f 46 6f 6e 74 4d  |rt FNshell_FontM|
00021ca0  65 6e 75 47 65 74 4c 61  73 74 53 65 6c 65 63 74  |enuGetLastSelect|
00021cb0  65 64 46 6f 6e 74 0d 12  0e 28 dd 20 a4 73 68 65  |edFont...(. .she|
00021cc0  6c 6c 5f 46 6f 6e 74 4d  65 6e 75 47 65 74 4c 61  |ll_FontMenuGetLa|
00021cd0  73 74 53 65 6c 65 63 74  65 64 46 6f 6e 74 0d 12  |stSelectedFont..|
00021ce0  0f 0b ea 20 74 65 6d 70  25 0d 12 10 2e e7 20 ac  |... temp%..... .|
00021cf0  20 a4 73 68 65 6c 6c 5f  48 65 61 70 42 6c 6f 63  | .shell_HeapBloc|
00021d00  6b 45 78 69 73 74 73 28  5f 55 25 21 32 34 34 29  |kExists(_U%!244)|
00021d10  20 8c 20 20 3d 22 22 0d  12 11 19 74 65 6d 70 25  | .  =""....temp%|
00021d20  3d 5f 55 25 21 32 34 34  3a 3d 24 74 65 6d 70 25  |=_U%!244:=$temp%|
00021d30  0d 12 12 05 3a 0d 12 13  2e 2a 7c 53 74 6f 70 20  |....:....*|Stop |
00021d40  46 4e 73 68 65 6c 6c 5f  46 6f 6e 74 4d 65 6e 75  |FNshell_FontMenu|
00021d50  47 65 74 4c 61 73 74 53  65 6c 65 63 74 65 64 46  |GetLastSelectedF|
00021d60  6f 6e 74 0d 12 14 27 2a  7c 53 74 61 72 74 20 50  |ont...'*|Start P|
00021d70  52 4f 43 73 68 65 6c 6c  5f 46 6f 6e 74 4d 65 6e  |ROCshell_FontMen|
00021d80  75 55 70 64 61 74 65 50  74 72 0d 12 15 24 dd 20  |uUpdatePtr...$. |
00021d90  f2 73 68 65 6c 6c 5f 46  6f 6e 74 4d 65 6e 75 55  |.shell_FontMenuU|
00021da0  70 64 61 74 65 50 74 72  28 70 74 72 25 29 0d 12  |pdatePtr(ptr%)..|
00021db0  16 12 ea 20 65 5f 6c 69  73 74 25 2c 63 74 72 25  |... e_list%,ctr%|
00021dc0  0d 12 17 15 2a 7c 69 66  64 65 66 20 54 72 61 63  |....*|ifdef Trac|
00021dd0  65 49 6e 69 74 0d 12 18  31 f2 73 68 65 6c 6c 5f  |eInit...1.shell_|
00021de0  54 72 61 63 65 66 30 28  22 46 6f 6e 74 4d 65 6e  |Tracef0("FontMen|
00021df0  75 55 70 64 61 74 65 50  74 72 3a 53 74 61 72 74  |uUpdatePtr:Start|
00021e00  65 64 2e 2e 22 29 0d 12  19 0b 2a 7c 65 6e 64 69  |ed..")....*|endi|
00021e10  66 0d 12 1a 27 e7 20 a4  73 68 65 6c 6c 5f 48 65  |f...'. .shell_He|
00021e20  61 70 42 6c 6f 63 6b 45  78 69 73 74 73 28 5f 55  |apBlockExists(_U|
00021e30  25 21 32 32 30 29 20 8c  0d 12 1b 15 2a 7c 69 66  |%!220) .....*|if|
00021e40  64 65 66 20 54 72 61 63  65 49 6e 69 74 0d 12 1c  |def TraceInit...|
00021e50  3b 20 20 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |;  .shell_Tracef|
00021e60  30 28 22 46 6f 6e 74 4d  65 6e 75 55 70 64 61 74  |0("FontMenuUpdat|
00021e70  65 50 74 72 3a 48 65 61  70 42 6c 6f 63 6b 20 66  |ePtr:HeapBlock f|
00021e80  6f 75 6e 64 2e 2e 22 29  0d 12 1d 0b 2a 7c 65 6e  |ound..")....*|en|
00021e90  64 69 66 0d 12 1e 1c 20  20 65 5f 6c 69 73 74 25  |dif....  e_list%|
00021ea0  3d 5f 55 25 21 32 32 30  3a 63 74 72 25 3d 30 0d  |=_U%!220:ctr%=0.|
00021eb0  12 1f 07 20 20 f5 0d 12  20 15 2a 7c 69 66 64 65  |...  ... .*|ifde|
00021ec0  66 20 54 72 61 63 65 49  6e 69 74 0d 12 21 3c 20  |f TraceInit..!< |
00021ed0  20 f2 73 68 65 6c 6c 5f  54 72 61 63 65 66 30 28  | .shell_Tracef0(|
00021ee0  22 46 6f 6e 74 4d 65 6e  75 55 70 64 61 74 65 50  |"FontMenuUpdateP|
00021ef0  74 72 3a 53 75 62 73 74  69 74 75 74 69 6e 67 20  |tr:Substituting |
00021f00  70 74 72 2e 2e 22 29 0d  12 22 0b 2a 7c 65 6e 64  |ptr..")..".*|end|
00021f10  69 66 0d 12 23 1d 20 20  20 20 65 5f 6c 69 73 74  |if..#.    e_list|
00021f20  25 21 28 63 74 72 25 2b  38 29 3d 70 74 72 25 0d  |%!(ctr%+8)=ptr%.|
00021f30  12 24 10 20 20 20 20 63  74 72 25 2b 3d 31 32 0d  |.$.    ctr%+=12.|
00021f40  12 25 17 20 20 fd 20 65  5f 6c 69 73 74 25 21 63  |.%.  . e_list%!c|
00021f50  74 72 25 3d 2d 31 0d 12  26 05 cd 0d 12 27 05 e1  |tr%=-1..&....'..|
00021f60  0d 12 28 05 3a 0d 12 29  26 2a 7c 53 74 6f 70 20  |..(.:..)&*|Stop |
00021f70  50 52 4f 43 73 68 65 6c  6c 5f 46 6f 6e 74 4d 65  |PROCshell_FontMe|
00021f80  6e 75 55 70 64 61 74 65  50 74 72 0d 12 2a 1e 2a  |nuUpdatePtr..*.*|
00021f90  7c 53 74 61 72 74 20 50  52 4f 43 73 68 65 6c 6c  ||Start PROCshell|
00021fa0  5f 46 69 6e 64 46 6f 6e  74 0d 12 2b 39 dd 20 f2  |_FindFont..+9. .|
00021fb0  73 68 65 6c 6c 5f 46 69  6e 64 46 6f 6e 74 28 f8  |shell_FindFont(.|
00021fc0  20 66 6f 6e 74 24 2c 78  5f 70 74 25 2c 79 5f 70  | font$,x_pt%,y_p|
00021fd0  74 25 2c f8 20 66 6f 6e  74 5f 68 61 6e 64 6c 65  |t%,. font_handle|
00021fe0  25 29 0d 12 2c 33 e7 20  ac 20 a4 73 68 65 6c 6c  |%)..,3. . .shell|
00021ff0  5f 46 6f 6e 74 49 73 41  76 61 69 6c 61 62 6c 65  |_FontIsAvailable|
00022000  28 66 6f 6e 74 24 2c 78  5f 70 74 25 2c 79 5f 70  |(font$,x_pt%,y_p|
00022010  74 25 29 20 8c 0d 12 2d  1c 20 20 66 6f 6e 74 24  |t%) ...-.  font$|
00022020  3d 22 54 72 69 6e 69 74  79 2e 4d 65 64 69 75 6d  |="Trinity.Medium|
00022030  22 0d 12 2e 05 cd 0d 12  2f 42 c8 99 20 22 46 6f  |"......./B.. "Fo|
00022040  6e 74 5f 46 69 6e 64 46  6f 6e 74 22 2c 2c 66 6f  |nt_FindFont",,fo|
00022050  6e 74 24 2c 78 5f 70 74  25 2a 31 36 2c 79 5f 70  |nt$,x_pt%*16,y_p|
00022060  74 25 2a 31 36 2c 30 2c  30 20 b8 20 66 6f 6e 74  |t%*16,0,0 . font|
00022070  5f 68 61 6e 64 6c 65 25  0d 12 30 05 e1 0d 12 31  |_handle%..0....1|
00022080  05 3a 0d 12 32 1d 2a 7c  53 74 6f 70 20 50 52 4f  |.:..2.*|Stop PRO|
00022090  43 73 68 65 6c 6c 5f 46  69 6e 64 46 6f 6e 74 0d  |Cshell_FindFont.|
000220a0  12 33 23 2a 7c 53 74 61  72 74 20 46 4e 73 68 65  |.3#*|Start FNshe|
000220b0  6c 6c 5f 46 6f 6e 74 49  73 41 76 61 69 6c 61 62  |ll_FontIsAvailab|
000220c0  6c 65 0d 12 34 2f dd 20  a4 73 68 65 6c 6c 5f 46  |le..4/. .shell_F|
000220d0  6f 6e 74 49 73 41 76 61  69 6c 61 62 6c 65 28 66  |ontIsAvailable(f|
000220e0  6f 6e 74 24 2c 78 5f 70  74 25 2c 79 5f 70 74 25  |ont$,x_pt%,y_pt%|
000220f0  29 0d 12 35 07 ea 20 85  0d 12 36 10 ee 20 85 20  |)..5.. ...6.. . |
00022100  ea 3a f7 20 85 3a 3d a3  0d 12 37 43 c8 99 20 22  |.:. .:=...7C.. "|
00022110  46 6f 6e 74 5f 46 69 6e  64 46 6f 6e 74 22 2c 30  |Font_FindFont",0|
00022120  2c 66 6f 6e 74 24 2c 78  5f 70 74 25 2a 31 36 2c  |,font$,x_pt%*16,|
00022130  79 5f 70 74 25 2a 31 36  2c 30 2c 30 20 b8 20 66  |y_pt%*16,0,0 . f|
00022140  6f 6e 74 5f 68 61 6e 64  6c 65 25 0d 12 38 23 c8  |ont_handle%..8#.|
00022150  99 20 22 46 6f 6e 74 5f  4c 6f 73 65 46 6f 6e 74  |. "Font_LoseFont|
00022160  22 2c 66 6f 6e 74 5f 68  61 6e 64 6c 65 25 0d 12  |",font_handle%..|
00022170  39 06 3d b9 0d 12 3a 05  3a 0d 12 3b 22 2a 7c 53  |9.=...:.:..;"*|S|
00022180  74 6f 70 20 46 4e 73 68  65 6c 6c 5f 46 6f 6e 74  |top FNshell_Font|
00022190  49 73 41 76 61 69 6c 61  62 6c 65 0d 12 3c 04 0d  |IsAvailable..<..|
000221a0  12 3d 22 2a 7c 53 74 61  72 74 20 46 4e 73 68 65  |.="*|Start FNshe|
000221b0  6c 6c 5f 43 68 65 63 6b  53 65 6c 65 63 74 69 6f  |ll_CheckSelectio|
000221c0  6e 0d 12 3e 21 dd 20 a4  73 68 65 6c 6c 5f 43 68  |n..>!. .shell_Ch|
000221d0  65 63 6b 53 65 6c 65 63  74 69 6f 6e 28 73 65 6c  |eckSelection(sel|
000221e0  25 29 0d 12 3f 10 ea 20  74 65 6d 70 25 2c 63 74  |%)..?.. temp%,ct|
000221f0  72 25 0d 12 40 11 74 65  6d 70 25 3d 5f 55 25 21  |r%..@.temp%=_U%!|
00022200  32 35 36 0d 12 41 13 e7  20 74 65 6d 70 25 3d 30  |256..A.. temp%=0|
00022210  20 8c 20 3d 2d 31 0d 12  42 19 e7 20 5f 55 25 21  | . =-1..B.. _U%!|
00022220  32 34 3d 5f 55 25 21 32  35 32 20 8c 20 3d 30 0d  |24=_U%!252 . =0.|
00022230  12 43 05 f5 0d 12 44 23  20 20 e7 20 73 65 6c 25  |.C....D#  . sel%|
00022240  21 63 74 72 25 3c 3e 74  65 6d 70 25 21 63 74 72  |!ctr%<>temp%!ctr|
00022250  25 20 8c 20 3d 2d 31 0d  12 45 0d 20 20 63 74 72  |% . =-1..E.  ctr|
00022260  25 2b 3d 34 0d 12 46 13  fd 20 74 65 6d 70 25 21  |%+=4..F.. temp%!|
00022270  63 74 72 25 3d 2d 31 0d  12 47 09 3d 63 74 72 25  |ctr%=-1..G.=ctr%|
00022280  0d 12 48 05 3a 0d 12 49  21 2a 7c 53 74 6f 70 20  |..H.:..I!*|Stop |
00022290  46 4e 73 68 65 6c 6c 5f  43 68 65 63 6b 53 65 6c  |FNshell_CheckSel|
000222a0  65 63 74 69 6f 6e 0d 12  4a 04 0d 12 4b 26 2a 7c  |ection..J...K&*||
000222b0  53 74 61 72 74 20 46 4e  73 68 65 6c 6c 5f 4d 65  |Start FNshell_Me|
000222c0  6e 75 47 65 74 49 74 65  6d 41 64 64 72 65 73 73  |nuGetItemAddress|
000222d0  0d 12 4c 31 dd 20 a4 73  68 65 6c 6c 5f 4d 65 6e  |..L1. .shell_Men|
000222e0  75 47 65 74 49 74 65 6d  41 64 64 72 65 73 73 28  |uGetItemAddress(|
000222f0  6d 65 6e 75 25 2c 73 65  6c 65 63 74 69 6f 6e 25  |menu%,selection%|
00022300  29 0d 12 4d 15 ea 20 63  74 72 25 2c 69 74 65 6d  |)..M.. ctr%,item|
00022310  5f 61 64 64 72 25 0d 12  4e 24 c8 99 20 22 4d 65  |_addr%..N$.. "Me|
00022320  6e 75 55 74 69 6c 5f 49  6e 66 6f 22 2c 6d 65 6e  |nuUtil_Info",men|
00022330  75 25 20 b8 20 6d 65 6e  75 25 0d 12 4f 05 f5 0d  |u% . menu%..O...|
00022340  12 50 30 20 20 69 74 65  6d 5f 61 64 64 72 25 3d  |.P0  item_addr%=|
00022350  6d 65 6e 75 25 2b 32 38  2b 28 28 73 65 6c 65 63  |menu%+28+((selec|
00022360  74 69 6f 6e 25 21 63 74  72 25 29 2a 32 34 29 0d  |tion%!ctr%)*24).|
00022370  12 51 2f 20 20 6d 65 6e  75 25 3d 69 74 65 6d 5f  |.Q/  menu%=item_|
00022380  61 64 64 72 25 21 34 3a  f4 20 61 64 64 72 65 73  |addr%!4:. addres|
00022390  73 20 6f 66 20 73 75 62  6d 65 6e 75 2e 2e 0d 12  |s of submenu....|
000223a0  52 0d 20 20 63 74 72 25  2b 3d 34 0d 12 53 18 fd  |R.  ctr%+=4..S..|
000223b0  20 73 65 6c 65 63 74 69  6f 6e 25 21 63 74 72 25  | selection%!ctr%|
000223c0  3d 2d 31 0d 12 54 0f 3d  69 74 65 6d 5f 61 64 64  |=-1..T.=item_add|
000223d0  72 25 0d 12 55 05 3a 0d  12 56 25 2a 7c 53 74 6f  |r%..U.:..V%*|Sto|
000223e0  70 20 46 4e 73 68 65 6c  6c 5f 4d 65 6e 75 47 65  |p FNshell_MenuGe|
000223f0  74 49 74 65 6d 41 64 64  72 65 73 73 0d 12 57 04  |tItemAddress..W.|
00022400  0d 12 58 24 2a 7c 53 74  61 72 74 20 46 4e 73 68  |..X$*|Start FNsh|
00022410  65 6c 6c 5f 47 65 74 4c  61 73 74 4d 6f 75 73 65  |ell_GetLastMouse|
00022420  58 50 6f 73 0d 12 59 1d  dd 20 a4 73 68 65 6c 6c  |XPos..Y.. .shell|
00022430  5f 47 65 74 4c 61 73 74  4d 6f 75 73 65 58 50 6f  |_GetLastMouseXPo|
00022440  73 0d 12 5a 0c 3d 5f 55  25 21 32 37 32 0d 12 5b  |s..Z.=_U%!272..[|
00022450  05 3a 0d 12 5c 23 2a 7c  53 74 6f 70 20 46 4e 73  |.:..\#*|Stop FNs|
00022460  68 65 6c 6c 5f 47 65 74  4c 61 73 74 4d 6f 75 73  |hell_GetLastMous|
00022470  65 58 50 6f 73 0d 12 5d  24 2a 7c 53 74 61 72 74  |eXPos..]$*|Start|
00022480  20 46 4e 73 68 65 6c 6c  5f 47 65 74 4c 61 73 74  | FNshell_GetLast|
00022490  4d 6f 75 73 65 59 50 6f  73 0d 12 5e 1d dd 20 a4  |MouseYPos..^.. .|
000224a0  73 68 65 6c 6c 5f 47 65  74 4c 61 73 74 4d 6f 75  |shell_GetLastMou|
000224b0  73 65 59 50 6f 73 0d 12  5f 0c 3d 5f 55 25 21 32  |seYPos.._.=_U%!2|
000224c0  37 36 0d 12 60 05 3a 0d  12 61 23 2a 7c 53 74 6f  |76..`.:..a#*|Sto|
000224d0  70 20 46 4e 73 68 65 6c  6c 5f 47 65 74 4c 61 73  |p FNshell_GetLas|
000224e0  74 4d 6f 75 73 65 59 50  6f 73 0d 12 62 28 2a 7c  |tMouseYPos..b(*||
000224f0  53 74 61 72 74 20 50 52  4f 43 73 68 65 6c 6c 5f  |Start PROCshell_|
00022500  55 70 64 61 74 65 57 69  6e 64 6f 77 48 61 6e 64  |UpdateWindowHand|
00022510  6c 65 0d 12 63 38 dd 20  f2 73 68 65 6c 6c 5f 55  |le..c8. .shell_U|
00022520  70 64 61 74 65 57 69 6e  64 6f 77 48 61 6e 64 6c  |pdateWindowHandl|
00022530  65 28 6f 6c 64 5f 68 61  6e 64 6c 65 25 2c 6e 65  |e(old_handle%,ne|
00022540  77 5f 68 61 6e 64 6c 65  25 29 0d 12 64 15 2a 7c  |w_handle%)..d.*||
00022550  69 66 64 65 66 20 54 72  61 63 65 49 6e 69 74 0d  |ifdef TraceInit.|
00022560  12 65 47 f2 73 68 65 6c  6c 5f 54 72 61 63 65 66  |.eG.shell_Tracef|
00022570  30 28 22 55 70 64 61 74  65 57 69 6e 64 6f 77 48  |0("UpdateWindowH|
00022580  61 6e 64 6c 65 3a 55 70  64 61 74 69 6e 67 20 73  |andle:Updating s|
00022590  74 6f 72 65 64 20 77 69  6e 64 6f 77 20 68 61 6e  |tored window han|
000225a0  64 6c 65 73 22 29 0d 12  66 43 f2 73 68 65 6c 6c  |dles")..fC.shell|
000225b0  5f 54 72 61 63 65 66 30  28 22 55 70 64 61 74 65  |_Tracef0("Update|
000225c0  57 69 6e 64 6f 77 48 61  6e 64 6c 65 3a 6f 6c 64  |WindowHandle:old|
000225d0  20 68 61 6e 64 6c 65 3d  26 22 2b c3 7e 6f 6c 64  | handle=&"+.~old|
000225e0  5f 68 61 6e 64 6c 65 25  29 0d 12 67 43 f2 73 68  |_handle%)..gC.sh|
000225f0  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 55 70 64  |ell_Tracef0("Upd|
00022600  61 74 65 57 69 6e 64 6f  77 48 61 6e 64 6c 65 3a  |ateWindowHandle:|
00022610  6e 65 77 20 68 61 6e 64  6c 65 3d 26 22 2b c3 7e  |new handle=&"+.~|
00022620  6e 65 77 5f 68 61 6e 64  6c 65 25 29 0d 12 68 0b  |new_handle%)..h.|
00022630  2a 7c 65 6e 64 69 66 0d  12 69 20 e7 20 6e 65 77  |*|endif..i . new|
00022640  5f 68 61 6e 64 6c 65 25  3c 3e 6f 6c 64 5f 68 61  |_handle%<>old_ha|
00022650  6e 64 6c 65 25 20 8c 0d  12 6a 2f 20 20 e7 20 5f  |ndle% ...j/  . _|
00022660  55 25 21 32 38 3d 6f 6c  64 5f 68 61 6e 64 6c 65  |U%!28=old_handle|
00022670  25 20 8c 20 5f 55 25 21  32 38 3d 6e 65 77 5f 68  |% . _U%!28=new_h|
00022680  61 6e 64 6c 65 25 0d 12  6b 50 20 20 f2 73 68 65  |andle%..kP  .she|
00022690  6c 6c 5f 46 69 78 45 76  65 6e 74 42 6c 6f 63 6b  |ll_FixEventBlock|
000226a0  28 6f 6c 64 5f 68 61 6e  64 6c 65 25 2c 6e 65 77  |(old_handle%,new|
000226b0  5f 68 61 6e 64 6c 65 25  2c 5f 55 25 21 31 32 2c  |_handle%,_U%!12,|
000226c0  34 38 29 3a f4 20 6d 61  69 6e 20 65 76 65 6e 74  |48):. main event|
000226d0  20 62 6c 6f 63 6b 0d 12  6c 4f 20 20 f2 73 68 65  | block..lO  .she|
000226e0  6c 6c 5f 46 69 78 45 76  65 6e 74 42 6c 6f 63 6b  |ll_FixEventBlock|
000226f0  28 6f 6c 64 5f 68 61 6e  64 6c 65 25 2c 6e 65 77  |(old_handle%,new|
00022700  5f 68 61 6e 64 6c 65 25  2c 5f 55 25 21 39 36 2c  |_handle%,_U%!96,|
00022710  31 36 29 3a f4 20 64 61  74 61 6c 6f 61 64 20 65  |16):. dataload e|
00022720  76 65 6e 74 73 0d 12 6d  4f 20 20 f2 73 68 65 6c  |vents..mO  .shel|
00022730  6c 5f 46 69 78 45 76 65  6e 74 42 6c 6f 63 6b 28  |l_FixEventBlock(|
00022740  6f 6c 64 5f 68 61 6e 64  6c 65 25 2c 6e 65 77 5f  |old_handle%,new_|
00022750  68 61 6e 64 6c 65 25 2c  5f 55 25 21 37 32 2c 32  |handle%,_U%!72,2|
00022760  34 29 3a f4 20 64 61 74  61 73 61 76 65 20 65 76  |4):. datasave ev|
00022770  65 6e 74 73 0d 12 6e 4b  20 20 f2 73 68 65 6c 6c  |ents..nK  .shell|
00022780  5f 46 69 78 45 76 65 6e  74 42 6c 6f 63 6b 28 6f  |_FixEventBlock(o|
00022790  6c 64 5f 68 61 6e 64 6c  65 25 2c 6e 65 77 5f 68  |ld_handle%,new_h|
000227a0  61 6e 64 6c 65 25 2c 5f  55 25 21 39 32 2c 32 34  |andle%,_U%!92,24|
000227b0  29 3a f4 20 70 61 6e 65  20 65 76 65 6e 74 73 0d  |):. pane events.|
000227c0  12 6f 4c 20 20 f2 73 68  65 6c 6c 5f 46 69 78 45  |.oL  .shell_FixE|
000227d0  76 65 6e 74 42 6c 6f 63  6b 28 6f 6c 64 5f 68 61  |ventBlock(old_ha|
000227e0  6e 64 6c 65 25 2c 6e 65  77 5f 68 61 6e 64 6c 65  |ndle%,new_handle|
000227f0  25 2c 5f 55 25 21 31 30  34 2c 31 36 29 3a f4 20  |%,_U%!104,16):. |
00022800  62 75 6d 70 20 65 76 65  6e 74 73 0d 12 70 39 20  |bump events..p9 |
00022810  20 f2 73 68 65 6c 6c 5f  55 70 64 61 74 65 53 74  | .shell_UpdateSt|
00022820  61 74 69 63 57 69 6e 64  6f 77 73 28 6f 6c 64 5f  |aticWindows(old_|
00022830  68 61 6e 64 6c 65 25 2c  6e 65 77 5f 68 61 6e 64  |handle%,new_hand|
00022840  6c 65 25 29 0d 12 71 05  cd 0d 12 72 05 e1 0d 12  |le%)..q....r....|
00022850  73 05 3a 0d 12 74 27 2a  7c 53 74 6f 70 20 50 52  |s.:..t'*|Stop PR|
00022860  4f 43 73 68 65 6c 6c 5f  55 70 64 61 74 65 57 69  |OCshell_UpdateWi|
00022870  6e 64 6f 77 48 61 6e 64  6c 65 0d 12 75 29 2a 7c  |ndowHandle..u)*||
00022880  53 74 61 72 74 20 50 52  4f 43 73 68 65 6c 6c 5f  |Start PROCshell_|
00022890  55 70 64 61 74 65 53 74  61 74 69 63 57 69 6e 64  |UpdateStaticWind|
000228a0  6f 77 73 0d 12 76 39 dd  20 f2 73 68 65 6c 6c 5f  |ows..v9. .shell_|
000228b0  55 70 64 61 74 65 53 74  61 74 69 63 57 69 6e 64  |UpdateStaticWind|
000228c0  6f 77 73 28 6f 6c 64 5f  68 61 6e 64 6c 65 25 2c  |ows(old_handle%,|
000228d0  6e 65 77 5f 68 61 6e 64  6c 65 25 29 0d 12 77 15  |new_handle%)..w.|
000228e0  ea 20 6f 66 66 73 65 74  25 2c 77 5f 6c 69 73 74  |. offset%,w_list|
000228f0  25 0d 12 78 15 2a 7c 69  66 64 65 66 20 54 72 61  |%..x.*|ifdef Tra|
00022900  63 65 49 6e 69 74 0d 12  79 49 f2 73 68 65 6c 6c  |ceInit..yI.shell|
00022910  5f 54 72 61 63 65 66 30  28 22 55 70 64 61 74 65  |_Tracef0("Update|
00022920  53 74 61 74 69 63 57 69  6e 64 6f 77 73 3a 43 6f  |StaticWindows:Co|
00022930  72 72 65 63 74 69 6e 67  20 73 74 61 74 69 63 20  |rrecting static |
00022940  77 69 6e 64 6f 77 20 6c  69 73 74 2e 2e 22 29 0d  |window list..").|
00022950  12 7a 0b 2a 7c 65 6e 64  69 66 0d 12 7b 13 77 5f  |.z.*|endif..{.w_|
00022960  6c 69 73 74 25 3d 5f 55  25 21 31 38 34 0d 12 7c  |list%=_U%!184..||
00022970  34 6f 66 66 73 65 74 25  3d a4 73 68 65 6c 6c 5f  |4offset%=.shell_|
00022980  53 65 61 72 63 68 53 74  61 74 69 63 28 5f 55 25  |SearchStatic(_U%|
00022990  21 31 38 34 2c 6f 6c 64  5f 68 61 6e 64 6c 65 25  |!184,old_handle%|
000229a0  29 0d 12 7d 1f 77 5f 6c  69 73 74 25 21 6f 66 66  |)..}.w_list%!off|
000229b0  73 65 74 25 3d 6e 65 77  5f 68 61 6e 64 6c 65 25  |set%=new_handle%|
000229c0  0d 12 7e 05 e1 0d 12 7f  05 3a 0d 12 80 28 2a 7c  |..~......:...(*||
000229d0  53 74 6f 70 20 50 52 4f  43 73 68 65 6c 6c 5f 55  |Stop PROCshell_U|
000229e0  70 64 61 74 65 53 74 61  74 69 63 57 69 6e 64 6f  |pdateStaticWindo|
000229f0  77 73 0d 12 81 23 2a 7c  53 74 61 72 74 20 50 52  |ws...#*|Start PR|
00022a00  4f 43 73 68 65 6c 6c 5f  46 69 78 45 76 65 6e 74  |OCshell_FixEvent|
00022a10  42 6c 6f 63 6b 0d 12 82  47 dd 20 f2 73 68 65 6c  |Block...G. .shel|
00022a20  6c 5f 46 69 78 45 76 65  6e 74 42 6c 6f 63 6b 28  |l_FixEventBlock(|
00022a30  6f 6c 64 5f 68 61 6e 64  6c 65 25 2c 6e 65 77 5f  |old_handle%,new_|
00022a40  68 61 6e 64 6c 65 25 2c  65 76 65 6e 74 5f 6c 69  |handle%,event_li|
00022a50  73 74 25 2c 6f 66 66 73  65 74 25 29 0d 12 83 15  |st%,offset%)....|
00022a60  ea 20 70 74 72 25 2c 6c  69 73 74 5f 73 69 7a 65  |. ptr%,list_size|
00022a70  25 0d 12 84 2b e7 20 a4  73 68 65 6c 6c 5f 48 65  |%...+. .shell_He|
00022a80  61 70 42 6c 6f 63 6b 45  78 69 73 74 73 28 65 76  |apBlockExists(ev|
00022a90  65 6e 74 5f 6c 69 73 74  25 29 20 8c 0d 12 85 34  |ent_list%) ....4|
00022aa0  20 20 6c 69 73 74 5f 73  69 7a 65 25 3d a4 73 68  |  list_size%=.sh|
00022ab0  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 49 6e 66  |ell_HeapBlockInf|
00022ac0  6f 28 65 76 65 6e 74 5f  6c 69 73 74 25 29 2d 38  |o(event_list%)-8|
00022ad0  0d 12 86 07 20 20 f5 0d  12 87 2a 20 20 20 20 e7  |....  ....*    .|
00022ae0  20 28 65 76 65 6e 74 5f  6c 69 73 74 25 21 70 74  | (event_list%!pt|
00022af0  72 25 3d 6f 6c 64 5f 68  61 6e 64 6c 65 25 29 20  |r%=old_handle%) |
00022b00  8c 0d 12 88 26 20 20 20  20 20 20 65 76 65 6e 74  |....&      event|
00022b10  5f 6c 69 73 74 25 21 70  74 72 25 3d 6e 65 77 5f  |_list%!ptr%=new_|
00022b20  68 61 6e 64 6c 65 25 0d  12 89 09 20 20 20 20 cd  |handle%....    .|
00022b30  0d 12 8a 15 20 20 20 20  70 74 72 25 2b 3d 6f 66  |....    ptr%+=of|
00022b40  66 73 65 74 25 0d 12 8b  1a 20 20 fd 20 28 70 74  |fset%....  . (pt|
00022b50  72 25 3e 3d 6c 69 73 74  5f 73 69 7a 65 25 29 0d  |r%>=list_size%).|
00022b60  12 8c 05 cd 0d 12 8d 05  e1 0d 12 8e 05 3a 0d 12  |.............:..|
00022b70  8f 22 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |."*|Stop PROCshe|
00022b80  6c 6c 5f 46 69 78 45 76  65 6e 74 42 6c 6f 63 6b  |ll_FixEventBlock|
00022b90  0d 12 90 23 2a 7c 53 74  61 72 74 20 50 52 4f 43  |...#*|Start PROC|
00022ba0  73 68 65 6c 6c 5f 49 63  6f 6e 53 65 6c 65 63 74  |shell_IconSelect|
00022bb0  41 6c 6c 0d 12 91 1f dd  20 f2 73 68 65 6c 6c 5f  |All..... .shell_|
00022bc0  49 63 6f 6e 53 65 6c 65  63 74 41 6c 6c 28 77 68  |IconSelectAll(wh|
00022bd0  25 29 0d 12 92 0d ea 20  62 6c 6b 25 2c 49 25 0d  |%)..... blk%,I%.|
00022be0  12 93 24 62 6c 6b 25 3d  a4 73 68 65 6c 6c 5f 48  |..$blk%=.shell_H|
00022bf0  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 32 30  |eapBlockFetch(20|
00022c00  30 30 29 0d 12 94 19 49  25 3d 62 6c 6b 25 2b 26  |00)....I%=blk%+&|
00022c10  34 30 3a 21 62 6c 6b 25  3d 77 68 25 0d 12 95 1e  |40:!blk%=wh%....|
00022c20  62 6c 6b 25 21 38 3d 31  3c 3c 32 31 3a 62 6c 6b  |blk%!8=1<<21:blk|
00022c30  25 21 31 32 3d 31 3c 3c  32 31 0d 12 96 2c c8 99  |%!12=1<<21...,..|
00022c40  20 22 57 69 6d 70 5f 57  68 69 63 68 49 63 6f 6e  | "Wimp_WhichIcon|
00022c50  22 2c 21 62 6c 6b 25 2c  49 25 2c 35 3c 3c 32 31  |",!blk%,I%,5<<21|
00022c60  2c 30 3c 3c 32 31 0d 12  97 0d c8 95 20 21 49 25  |,0<<21...... !I%|
00022c70  3e 2d 31 0d 12 98 10 20  20 62 6c 6b 25 21 34 3d  |>-1....  blk%!4=|
00022c80  21 49 25 0d 12 99 22 20  20 c8 99 20 22 57 69 6d  |!I%..."  .. "Wim|
00022c90  70 5f 53 65 74 49 63 6f  6e 53 74 61 74 65 22 2c  |p_SetIconState",|
00022ca0  2c 62 6c 6b 25 0d 12 9a  0b 20 20 49 25 2b 3d 34  |,blk%....  I%+=4|
00022cb0  0d 12 9b 05 ce 0d 12 9c  20 f2 73 68 65 6c 6c 5f  |........ .shell_|
00022cc0  48 65 61 70 42 6c 6f 63  6b 52 65 74 75 72 6e 28  |HeapBlockReturn(|
00022cd0  62 6c 6b 25 29 0d 12 9d  05 e1 0d 12 9e 05 3a 0d  |blk%).........:.|
00022ce0  12 9f 22 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |.."*|Stop PROCsh|
00022cf0  65 6c 6c 5f 49 63 6f 6e  53 65 6c 65 63 74 41 6c  |ell_IconSelectAl|
00022d00  6c 0d 12 a0 25 2a 7c 53  74 61 72 74 20 50 52 4f  |l...%*|Start PRO|
00022d10  43 73 68 65 6c 6c 5f 49  63 6f 6e 44 65 73 65 6c  |Cshell_IconDesel|
00022d20  65 63 74 41 6c 6c 0d 12  a1 21 dd 20 f2 73 68 65  |ectAll...!. .she|
00022d30  6c 6c 5f 49 63 6f 6e 44  65 73 65 6c 65 63 74 41  |ll_IconDeselectA|
00022d40  6c 6c 28 77 68 25 29 0d  12 a2 0d ea 20 62 6c 6b  |ll(wh%)..... blk|
00022d50  25 2c 49 25 0d 12 a3 24  62 6c 6b 25 3d a4 73 68  |%,I%...$blk%=.sh|
00022d60  65 6c 6c 5f 48 65 61 70  42 6c 6f 63 6b 46 65 74  |ell_HeapBlockFet|
00022d70  63 68 28 32 30 30 30 29  0d 12 a4 30 49 25 3d 62  |ch(2000)...0I%=b|
00022d80  6c 6b 25 2b 26 34 30 3a  21 62 6c 6b 25 3d 77 68  |lk%+&40:!blk%=wh|
00022d90  25 3a 62 6c 6b 25 21 38  3d 30 3a 62 6c 6b 25 21  |%:blk%!8=0:blk%!|
00022da0  31 32 3d 31 3c 3c 32 31  0d 12 a5 2c c8 99 20 22  |12=1<<21...,.. "|
00022db0  57 69 6d 70 5f 57 68 69  63 68 49 63 6f 6e 22 2c  |Wimp_WhichIcon",|
00022dc0  21 62 6c 6b 25 2c 49 25  2c 35 3c 3c 32 31 2c 31  |!blk%,I%,5<<21,1|
00022dd0  3c 3c 32 31 0d 12 a6 0d  c8 95 20 21 49 25 3e 2d  |<<21...... !I%>-|
00022de0  31 0d 12 a7 10 20 20 62  6c 6b 25 21 34 3d 21 49  |1....  blk%!4=!I|
00022df0  25 0d 12 a8 22 20 20 c8  99 20 22 57 69 6d 70 5f  |%..."  .. "Wimp_|
00022e00  53 65 74 49 63 6f 6e 53  74 61 74 65 22 2c 2c 62  |SetIconState",,b|
00022e10  6c 6b 25 0d 12 a9 0b 20  20 49 25 2b 3d 34 0d 12  |lk%....  I%+=4..|
00022e20  aa 05 ce 0d 12 ab 20 f2  73 68 65 6c 6c 5f 48 65  |...... .shell_He|
00022e30  61 70 42 6c 6f 63 6b 52  65 74 75 72 6e 28 62 6c  |apBlockReturn(bl|
00022e40  6b 25 29 0d 12 ac 05 e1  0d 12 ad 05 3a 0d 12 ae  |k%).........:...|
00022e50  24 2a 7c 53 74 6f 70 20  50 52 4f 43 73 68 65 6c  |$*|Stop PROCshel|
00022e60  6c 5f 49 63 6f 6e 44 65  73 65 6c 65 63 74 41 6c  |l_IconDeselectAl|
00022e70  6c 0d 12 af 04 0d 12 b0  29 2a 7c 53 74 61 72 74  |l.......)*|Start|
00022e80  20 50 52 4f 43 73 68 65  6c 6c 5f 4d 65 73 73 61  | PROCshell_Messa|
00022e90  67 65 5f 53 61 76 65 44  65 73 6b 74 6f 70 0d 12  |ge_SaveDesktop..|
00022ea0  b1 24 dd 20 f2 73 68 65  6c 6c 5f 4d 65 73 73 61  |.$. .shell_Messa|
00022eb0  67 65 5f 53 61 76 65 44  65 73 6b 74 6f 70 28 51  |ge_SaveDesktop(Q|
00022ec0  25 29 0d 12 b2 0b ea 20  62 6f 6f 74 24 0d 12 b3  |%)..... boot$...|
00022ed0  25 62 6f 6f 74 24 3d 22  52 75 6e 20 22 2b a4 73  |%boot$="Run "+.s|
00022ee0  68 65 6c 6c 5f 47 65 74  41 70 70 44 69 72 2b bd  |hell_GetAppDir+.|
00022ef0  31 30 0d 12 b4 25 c8 99  20 22 4f 53 5f 47 42 50  |10...%.. "OS_GBP|
00022f00  42 22 2c 32 2c 51 25 21  32 30 2c 62 6f 6f 74 24  |B",2,Q%!20,boot$|
00022f10  2c a9 62 6f 6f 74 24 0d  12 b5 05 e1 0d 12 b6 05  |,.boot$.........|
00022f20  3a 0d 12 b7 28 2a 7c 53  74 6f 70 20 50 52 4f 43  |:...(*|Stop PROC|
00022f30  73 68 65 6c 6c 5f 4d 65  73 73 61 67 65 5f 53 61  |shell_Message_Sa|
00022f40  76 65 44 65 73 6b 74 6f  70 0d 12 b8 04 0d 12 b9  |veDesktop.......|
00022f50  22 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |"*|Start PROCshe|
00022f60  6c 6c 5f 4d 65 73 73 61  67 65 73 49 6e 69 74 0d  |ll_MessagesInit.|
00022f70  12 ba 3e dd 20 f2 73 68  65 6c 6c 5f 4d 65 73 73  |..>. .shell_Mess|
00022f80  61 67 65 73 49 6e 69 74  28 66 69 6c 65 6e 61 6d  |agesInit(filenam|
00022f90  65 24 2c f8 20 6d 5f 66  69 6c 65 64 65 73 63 25  |e$,. m_filedesc%|
00022fa0  2c f8 20 6d 5f 62 75 66  66 65 72 25 29 0d 12 bb  |,. m_buffer%)...|
00022fb0  12 ea 20 73 69 7a 65 25  2c 66 6c 61 67 73 25 0d  |.. size%,flags%.|
00022fc0  12 bc 07 ea 20 85 0d 12  bd 3c ee 20 85 20 ea 20  |.... ....<. . . |
00022fd0  f7 20 85 3a 85 20 33 2c  22 43 61 6e 6e 6f 74 20  |. .:. 3,"Cannot |
00022fe0  6f 70 65 6e 20 6d 65 73  73 61 67 65 20 66 69 6c  |open message fil|
00022ff0  65 20 27 22 2b 66 69 6c  65 6e 61 6d 65 24 2b 22  |e '"+filename$+"|
00023000  27 22 0d 12 be 39 c8 99  20 22 4d 65 73 73 61 67  |'"...9.. "Messag|
00023010  65 54 72 61 6e 73 5f 46  69 6c 65 49 6e 66 6f 22  |eTrans_FileInfo"|
00023020  2c 2c 66 69 6c 65 6e 61  6d 65 24 20 b8 20 66 6c  |,,filename$ . fl|
00023030  61 67 73 25 2c 2c 73 69  7a 65 25 0d 12 bf 47 e7  |ags%,,size%...G.|
00023040  20 66 6c 61 67 73 25 20  80 20 31 20 8c 20 6d 5f  | flags% . 1 . m_|
00023050  62 75 66 66 65 72 25 3d  30 20 8b 20 6d 5f 62 75  |buffer%=0 . m_bu|
00023060  66 66 65 72 25 3d a4 73  68 65 6c 6c 5f 48 65 61  |ffer%=.shell_Hea|
00023070  70 42 6c 6f 63 6b 46 65  74 63 68 28 73 69 7a 65  |pBlockFetch(size|
00023080  25 29 0d 12 c0 36 c8 99  20 22 4f 53 5f 4d 6f 64  |%)...6.. "OS_Mod|
00023090  75 6c 65 22 2c 36 2c 2c  2c 31 37 2b a9 28 66 69  |ule",6,,,17+.(fi|
000230a0  6c 65 6e 61 6d 65 24 29  20 b8 20 2c 2c 6d 5f 66  |lename$) . ,,m_f|
000230b0  69 6c 65 64 65 73 63 25  0d 12 c1 1f 24 28 6d 5f  |iledesc%....$(m_|
000230c0  66 69 6c 65 64 65 73 63  25 2b 31 36 29 3d 66 69  |filedesc%+16)=fi|
000230d0  6c 65 6e 61 6d 65 24 0d  12 c2 39 c8 99 20 22 4d  |lename$...9.. "M|
000230e0  65 73 73 61 67 65 54 72  61 6e 73 5f 4f 70 65 6e  |essageTrans_Open|
000230f0  46 69 6c 65 22 2c 6d 5f  66 69 6c 65 64 65 73 63  |File",m_filedesc|
00023100  25 2c 6d 5f 66 69 6c 65  64 65 73 63 25 2b 31 36  |%,m_filedesc%+16|
00023110  0d 12 c3 15 2a 7c 69 66  64 65 66 20 54 72 61 63  |....*|ifdef Trac|
00023120  65 49 6e 69 74 0d 12 c4  4f f2 73 68 65 6c 6c 5f  |eInit...O.shell_|
00023130  54 72 61 63 65 66 30 28  22 4d 65 73 73 61 67 65  |Tracef0("Message|
00023140  73 49 6e 69 74 3a 4d 65  73 73 61 67 65 20 72 65  |sInit:Message re|
00023150  73 6f 75 72 63 65 20 66  69 6c 65 20 27 22 2b 66  |source file '"+f|
00023160  69 6c 65 6e 61 6d 65 24  2b 22 27 20 6c 6f 61 64  |ilename$+"' load|
00023170  65 64 22 29 0d 12 c5 0b  2a 7c 65 6e 64 69 66 0d  |ed")....*|endif.|
00023180  12 c6 05 e1 0d 12 c7 05  3a 0d 12 c8 21 2a 7c 53  |........:...!*|S|
00023190  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 4d 65  |top PROCshell_Me|
000231a0  73 73 61 67 65 73 49 6e  69 74 0d 12 c9 21 2a 7c  |ssagesInit...!*||
000231b0  53 74 61 72 74 20 46 4e  73 68 65 6c 6c 5f 50 72  |Start FNshell_Pr|
000231c0  69 6e 74 65 72 4f 6e 4c  69 6e 65 0d 12 ca 1a dd  |interOnLine.....|
000231d0  20 a4 73 68 65 6c 6c 5f  50 72 69 6e 74 65 72 4f  | .shell_PrinterO|
000231e0  6e 4c 69 6e 65 0d 12 cb  14 ea 20 69 6e 62 75 66  |nLine..... inbuf|
000231f0  25 2c 6f 6e 6c 69 6e 65  25 0d 12 cc 10 69 6e 62  |%,online%....inb|
00023200  75 66 25 3d 96 28 2d 34  29 0d 12 cd 12 ef 32 2c  |uf%=.(-4).....2,|
00023210  31 2c 30 2c 31 2c 30 2c  31 2c 30 0d 12 ce 10 d1  |1,0,1,0,1,0.....|
00023220  3d 30 3a f5 3a fd 20 91  3e 33 30 0d 12 cf 1b 6f  |=0:.:. .>30....o|
00023230  6e 6c 69 6e 65 25 3d ac  28 96 28 2d 34 29 3c 69  |nline%=.(.(-4)<i|
00023240  6e 62 75 66 25 29 0d 12  d0 0b 2a 46 58 32 31 2c  |nbuf%)....*FX21,|
00023250  33 0d 12 d1 06 ef 33 0d  12 d2 0c 3d 6f 6e 6c 69  |3.....3....=onli|
00023260  6e 65 25 0d 12 d3 05 3a  0d 12 d4 20 2a 7c 53 74  |ne%....:... *|St|
00023270  6f 70 20 46 4e 73 68 65  6c 6c 5f 50 72 69 6e 74  |op FNshell_Print|
00023280  65 72 4f 6e 4c 69 6e 65  0d 12 d5 27 2a 7c 53 74  |erOnLine...'*|St|
00023290  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 41 74  |art PROCshell_At|
000232a0  74 61 63 68 42 75 6d 70  48 61 6e 64 6c 65 72 0d  |tachBumpHandler.|
000232b0  12 d6 65 dd 20 f2 73 68  65 6c 6c 5f 41 74 74 61  |..e. .shell_Atta|
000232c0  63 68 42 75 6d 70 48 61  6e 64 6c 65 72 28 77 68  |chBumpHandler(wh|
000232d0  25 2c 69 68 25 2c 69 6e  63 72 25 2c 64 65 63 72  |%,ih%,incr%,decr|
000232e0  25 2c 6c 5f 6c 69 6d 69  74 25 2c 75 5f 6c 69 6d  |%,l_limit%,u_lim|
000232f0  69 74 25 2c 73 74 65 70  25 2c 77 72 61 70 25 2c  |it%,step%,wrap%,|
00023300  64 69 73 70 5f 66 6e 24  2c 64 65 63 6f 64 65 5f  |disp_fn$,decode_|
00023310  66 6e 24 29 0d 12 d7 30  ea 20 65 5f 62 6c 6b 25  |fn$)...0. e_blk%|
00023320  2c 6f 66 66 73 65 74 25  2c 74 65 6d 70 25 2c 74  |,offset%,temp%,t|
00023330  65 6d 70 32 25 2c 62 75  6d 70 5f 69 6e 66 6f 5f  |emp2%,bump_info_|
00023340  62 6c 6b 25 0d 12 d8 04  0d 12 d9 2a f4 20 66 6f  |blk%.......*. fo|
00023350  72 6d 61 74 20 6f 66 20  62 75 6d 70 20 68 61 6e  |rmat of bump han|
00023360  64 6c 65 72 20 65 76 65  6e 74 20 62 6c 6f 63 6b  |dler event block|
00023370  2e 2e 0d 12 da 17 f4 20  2b 30 20 20 77 69 6e 64  |....... +0  wind|
00023380  6f 77 20 68 61 6e 64 6c  65 0d 12 db 1a f4 20 2b  |ow handle..... +|
00023390  34 20 20 62 75 6d 70 20  69 63 6f 6e 20 68 61 6e  |4  bump icon han|
000233a0  64 6c 65 0d 12 dc 27 f4  20 2b 38 20 20 73 74 65  |dle...'. +8  ste|
000233b0  70 20 73 69 7a 65 20 28  2d 76 65 20 66 6f 72 20  |p size (-ve for |
000233c0  64 65 63 72 20 69 63 6f  6e 29 0d 12 dd 26 f4 20  |decr icon)...&. |
000233d0  2b 31 32 20 70 6f 69 6e  74 65 72 20 74 6f 20 73  |+12 pointer to s|
000233e0  65 63 6f 6e 64 20 69 6e  66 6f 20 62 6c 6f 63 6b  |econd info block|
000233f0  0d 12 de 05 f4 0d 12 df  1e f4 20 66 6f 72 6d 61  |.......... forma|
00023400  74 20 6f 66 20 73 65 63  6f 6e 64 20 62 6c 6f 63  |t of second bloc|
00023410  6b 2e 2e 0d 12 e0 1d f4  20 2b 30 20 20 64 69 73  |k....... +0  dis|
00023420  70 6c 61 79 20 69 63 6f  6e 20 68 61 6e 64 6c 65  |play icon handle|
00023430  0d 12 e1 15 f4 20 2b 34  20 20 6c 6f 77 65 72 20  |..... +4  lower |
00023440  6c 69 6d 69 74 0d 12 e2  15 f4 20 2b 38 20 20 75  |limit..... +8  u|
00023450  70 70 65 72 20 6c 69 6d  69 74 0d 12 e3 25 f4 20  |pper limit...%. |
00023460  2b 31 32 20 70 6f 69 6e  74 65 72 20 74 6f 20 64  |+12 pointer to d|
00023470  69 73 70 6c 61 79 20 66  75 6e 63 74 69 6f 6e 0d  |isplay function.|
00023480  12 e4 2c f4 20 2b 31 36  20 70 6f 69 6e 74 65 72  |..,. +16 pointer|
00023490  20 74 6f 20 64 69 73 70  6c 61 79 20 64 65 63 6f  | to display deco|
000234a0  64 65 20 66 75 6e 63 74  69 6f 6e 0d 12 e5 18 f4  |de function.....|
000234b0  20 2b 32 30 20 66 6c 61  67 73 20 28 31 20 62 79  | +20 flags (1 by|
000234c0  74 65 29 0d 12 e6 1a f4  20 20 20 20 20 62 69 74  |te).....     bit|
000234d0  20 30 20 77 72 61 70 20  75 70 70 65 72 0d 12 e7  | 0 wrap upper...|
000234e0  1a f4 20 20 20 20 20 62  69 74 20 31 20 77 72 61  |..     bit 1 wra|
000234f0  70 20 6c 6f 77 65 72 0d  12 e8 04 0d 12 e9 28 f4  |p lower.......(.|
00023500  20 64 65 61 6c 20 77 69  74 68 20 69 6e 63 72 25  | deal with incr%|
00023510  20 69 63 6f 6e 20 65 76  65 6e 74 20 66 69 72 73  | icon event firs|
00023520  74 2e 2e 0d 12 ea 3d 6f  66 66 73 65 74 25 3d a4  |t.....=offset%=.|
00023530  73 68 65 6c 6c 5f 47 65  74 45 76 65 6e 74 4c 69  |shell_GetEventLi|
00023540  73 74 4f 66 66 73 65 74  28 77 68 25 2c 69 6e 63  |stOffset(wh%,inc|
00023550  72 25 2c 5f 55 25 2b 31  30 34 2c 31 36 2c b9 29  |r%,_U%+104,16,.)|
00023560  0d 12 eb 34 65 5f 62 6c  6b 25 3d 5f 55 25 21 31  |...4e_blk%=_U%!1|
00023570  30 34 2b 6f 66 66 73 65  74 25 3a f4 20 70 6f 69  |04+offset%:. poi|
00023580  6e 74 65 72 20 74 6f 20  65 76 65 6e 74 20 6c 69  |nter to event li|
00023590  73 74 2e 2e 0d 12 ec 04  0d 12 ed 30 20 20 65 5f  |st.........0  e_|
000235a0  62 6c 6b 25 21 30 3d 77  68 25 3a 65 5f 62 6c 6b  |blk%!0=wh%:e_blk|
000235b0  25 21 34 3d 69 6e 63 72  25 3a 65 5f 62 6c 6b 25  |%!4=incr%:e_blk%|
000235c0  21 38 3d 73 74 65 70 25  0d 12 ee 29 20 20 65 5f  |!8=step%...)  e_|
000235d0  62 6c 6b 25 21 31 32 3d  a4 73 68 65 6c 6c 5f 48  |blk%!12=.shell_H|
000235e0  65 61 70 42 6c 6f 63 6b  46 65 74 63 68 28 32 34  |eapBlockFetch(24|
000235f0  29 0d 12 ef 1e 20 20 62  75 6d 70 5f 69 6e 66 6f  |)....  bump_info|
00023600  5f 62 6c 6b 25 3d 65 5f  62 6c 6b 25 21 31 32 0d  |_blk%=e_blk%!12.|
00023610  12 f0 1a 20 20 62 75 6d  70 5f 69 6e 66 6f 5f 62  |...  bump_info_b|
00023620  6c 6b 25 21 30 3d 69 68  25 0d 12 f1 1f 20 20 62  |lk%!0=ih%....  b|
00023630  75 6d 70 5f 69 6e 66 6f  5f 62 6c 6b 25 21 34 3d  |ump_info_blk%!4=|
00023640  6c 5f 6c 69 6d 69 74 25  0d 12 f2 1f 20 20 62 75  |l_limit%....  bu|
00023650  6d 70 5f 69 6e 66 6f 5f  62 6c 6b 25 21 38 3d 75  |mp_info_blk%!8=u|
00023660  5f 6c 69 6d 69 74 25 0d  12 f3 15 20 20 e7 20 a9  |_limit%....  . .|
00023670  64 69 73 70 5f 66 6e 24  3e 30 20 8c 0d 12 f4 3e  |disp_fn$>0 ....>|
00023680  20 20 20 20 62 75 6d 70  5f 69 6e 66 6f 5f 62 6c  |    bump_info_bl|
00023690  6b 25 21 31 32 3d a4 73  68 65 6c 6c 5f 48 65 61  |k%!12=.shell_Hea|
000236a0  70 42 6c 6f 63 6b 46 65  74 63 68 28 28 a9 64 69  |pBlockFetch((.di|
000236b0  73 70 5f 66 6e 24 29 2b  31 29 0d 12 f5 31 20 20  |sp_fn$)+1)...1  |
000236c0  20 20 74 65 6d 70 32 25  3d 62 75 6d 70 5f 69 6e  |  temp2%=bump_in|
000236d0  66 6f 5f 62 6c 6b 25 21  31 32 3a 24 74 65 6d 70  |fo_blk%!12:$temp|
000236e0  32 25 3d 64 69 73 70 5f  66 6e 24 0d 12 f6 07 20  |2%=disp_fn$.... |
000236f0  20 cc 0d 12 f7 1b 20 20  20 20 62 75 6d 70 5f 69  | .....    bump_i|
00023700  6e 66 6f 5f 62 6c 6b 25  21 31 32 3d 30 0d 12 f8  |nfo_blk%!12=0...|
00023710  07 20 20 cd 0d 12 f9 17  20 20 e7 20 a9 64 65 63  |.  .....  . .dec|
00023720  6f 64 65 5f 66 6e 24 3e  30 20 8c 0d 12 fa 40 20  |ode_fn$>0 ....@ |
00023730  20 20 20 62 75 6d 70 5f  69 6e 66 6f 5f 62 6c 6b  |   bump_info_blk|
00023740  25 21 31 36 3d a4 73 68  65 6c 6c 5f 48 65 61 70  |%!16=.shell_Heap|
00023750  42 6c 6f 63 6b 46 65 74  63 68 28 28 a9 64 65 63  |BlockFetch((.dec|
00023760  6f 64 65 5f 66 6e 24 29  2b 31 29 0d 12 fb 33 20  |ode_fn$)+1)...3 |
00023770  20 20 20 74 65 6d 70 32  25 3d 62 75 6d 70 5f 69  |   temp2%=bump_i|
00023780  6e 66 6f 5f 62 6c 6b 25  21 31 36 3a 24 74 65 6d  |nfo_blk%!16:$tem|
00023790  70 32 25 3d 64 65 63 6f  64 65 5f 66 6e 24 0d 12  |p2%=decode_fn$..|
000237a0  fc 07 20 20 cc 0d 12 fd  1b 20 20 20 20 62 75 6d  |..  .....    bum|
000237b0  70 5f 69 6e 66 6f 5f 62  6c 6b 25 21 31 36 3d 30  |p_info_blk%!16=0|
000237c0  0d 12 fe 07 20 20 cd 0d  12 ff 3c 20 20 e7 20 77  |....  ....<  . w|
000237d0  72 61 70 25 3d 2d 31 20  8c 20 62 75 6d 70 5f 69  |rap%=-1 . bump_i|
000237e0  6e 66 6f 5f 62 6c 6b 25  21 32 30 3d 31 20 8b 20  |nfo_blk%!20=1 . |
000237f0  62 75 6d 70 5f 69 6e 66  6f 5f 62 6c 6b 25 21 32  |bump_info_blk%!2|
00023800  30 3d 30 0d 13 00 04 0d  13 01 3f 20 20 6f 66 66  |0=0.......?  off|
00023810  73 65 74 25 3d a4 73 68  65 6c 6c 5f 47 65 74 45  |set%=.shell_GetE|
00023820  76 65 6e 74 4c 69 73 74  4f 66 66 73 65 74 28 77  |ventListOffset(w|
00023830  68 25 2c 64 65 63 72 25  2c 5f 55 25 2b 31 30 34  |h%,decr%,_U%+104|
00023840  2c 31 36 2c b9 29 0d 13  02 36 20 20 65 5f 62 6c  |,16,.)...6  e_bl|
00023850  6b 25 3d 5f 55 25 21 31  30 34 2b 6f 66 66 73 65  |k%=_U%!104+offse|
00023860  74 25 3a f4 20 70 6f 69  6e 74 65 72 20 74 6f 20  |t%:. pointer to |
00023870  65 76 65 6e 74 20 6c 69  73 74 2e 2e 0d 13 03 04  |event list......|
00023880  0d 13 04 35 20 20 65 5f  62 6c 6b 25 21 30 3d 77  |...5  e_blk%!0=w|
00023890  68 25 3a 65 5f 62 6c 6b  25 21 34 3d 64 65 63 72  |h%:e_blk%!4=decr|
000238a0  25 3a 65 5f 62 6c 6b 25  21 38 3d 73 74 65 70 25  |%:e_blk%!8=step%|
000238b0  2a 28 2d 31 29 0d 13 05  1e 20 20 65 5f 62 6c 6b  |*(-1)....  e_blk|
000238c0  25 21 31 32 3d 62 75 6d  70 5f 69 6e 66 6f 5f 62  |%!12=bump_info_b|
000238d0  6c 6b 25 0d 13 06 04 0d  13 07 05 e1 0d 13 08 05  |lk%.............|
000238e0  3a 0d 13 09 26 2a 7c 53  74 6f 70 20 50 52 4f 43  |:...&*|Stop PROC|
000238f0  73 68 65 6c 6c 5f 41 74  74 61 63 68 42 75 6d 70  |shell_AttachBump|
00023900  48 61 6e 64 6c 65 72 0d  13 0a 04 0d 13 0b 25 2a  |Handler.......%*|
00023910  7c 53 74 61 72 74 20 50  52 4f 43 73 68 65 6c 6c  ||Start PROCshell|
00023920  5f 48 61 6e 64 6c 65 42  75 6d 70 49 63 6f 6e 73  |_HandleBumpIcons|
00023930  0d 13 0c 2d dd 20 f2 73  68 65 6c 6c 5f 48 61 6e  |...-. .shell_Han|
00023940  64 6c 65 42 75 6d 70 49  63 6f 6e 73 28 6f 66 66  |dleBumpIcons(off|
00023950  73 65 74 25 2c 77 68 25  2c 69 68 25 29 0d 13 0d  |set%,wh%,ih%)...|
00023960  38 ea 20 64 69 73 70 6c  61 79 5f 69 68 25 2c 69  |8. display_ih%,i|
00023970  6e 66 6f 5f 62 6c 6b 25  2c 65 5f 62 6c 6b 25 2c  |nfo_blk%,e_blk%,|
00023980  63 75 72 72 5f 76 61 6c  25 2c 5f 74 65 6d 70 24  |curr_val%,_temp$|
00023990  2c 66 6e 32 25 0d 13 0e  12 ea 20 6e 65 77 5f 76  |,fn2%..... new_v|
000239a0  61 6c 25 2c 66 6e 25 0d  13 0f 1a 65 5f 62 6c 6b  |al%,fn%....e_blk|
000239b0  25 3d 5f 55 25 21 31 30  34 2b 6f 66 66 73 65 74  |%=_U%!104+offset|
000239c0  25 0d 13 10 2b 5f 55 25  21 32 38 38 3d 77 68 25  |%...+_U%!288=wh%|
000239d0  3a 5f 55 25 21 32 39 32  3d 69 68 25 3a 5f 55 25  |:_U%!292=ih%:_U%|
000239e0  21 32 39 36 3d 6f 66 66  73 65 74 25 0d 13 11 1f  |!296=offset%....|
000239f0  f4 20 65 5f 62 6c 6b 25  21 38 20 68 6f 6c 64 73  |. e_blk%!8 holds|
00023a00  20 73 74 65 70 20 76 61  6c 75 65 0d 13 12 17 69  | step value....i|
00023a10  6e 66 6f 5f 62 6c 6b 25  3d 65 5f 62 6c 6b 25 21  |nfo_blk%=e_blk%!|
00023a20  31 32 0d 13 13 2c f4 20  69 6e 66 6f 5f 62 6c 6b  |12...,. info_blk|
00023a30  25 21 30 20 20 68 6f 6c  64 73 20 64 69 73 70 6c  |%!0  holds displ|
00023a40  61 79 20 69 63 6f 6e 20  68 61 6e 64 6c 65 0d 13  |ay icon handle..|
00023a50  14 24 f4 20 69 6e 66 6f  5f 62 6c 6b 25 21 34 20  |.$. info_blk%!4 |
00023a60  20 68 6f 6c 64 73 20 6c  6f 77 65 72 20 6c 69 6d  | holds lower lim|
00023a70  69 74 0d 13 15 24 f4 20  69 6e 66 6f 5f 62 6c 6b  |it...$. info_blk|
00023a80  25 21 38 20 20 68 6f 6c  64 73 20 75 70 70 65 72  |%!8  holds upper|
00023a90  20 6c 69 6d 69 74 0d 13  16 22 f4 20 69 6e 66 6f  | limit...". info|
00023aa0  5f 62 6c 6b 25 21 32 30  20 68 6f 6c 64 73 20 77  |_blk%!20 holds w|
00023ab0  72 61 70 20 66 6c 61 67  0d 13 17 15 66 6e 32 25  |rap flag....fn2%|
00023ac0  3d 69 6e 66 6f 5f 62 6c  6b 25 21 31 36 0d 13 18  |=info_blk%!16...|
00023ad0  0f e7 20 66 6e 32 25 3c  3e 30 20 8c 0d 13 19 30  |.. fn2%<>0 ....0|
00023ae0  20 20 5f 74 65 6d 70 24  3d a4 73 68 65 6c 6c 5f  |  _temp$=.shell_|
00023af0  49 63 6f 6e 47 65 74 44  61 74 61 28 77 68 25 2c  |IconGetData(wh%,|
00023b00  69 6e 66 6f 5f 62 6c 6b  25 21 30 29 0d 13 1a 28  |info_blk%!0)...(|
00023b10  20 20 63 75 72 72 5f 76  61 6c 25 3d a0 28 22 46  |  curr_val%=.("F|
00023b20  4e 22 2b 24 66 6e 32 25  2b 22 28 5f 74 65 6d 70  |N"+$fn2%+"(_temp|
00023b30  24 29 22 29 0d 13 1b 05  cc 0d 13 1c 36 20 20 63  |$)")........6  c|
00023b40  75 72 72 5f 76 61 6c 25  3d bb 28 a4 73 68 65 6c  |urr_val%=.(.shel|
00023b50  6c 5f 49 63 6f 6e 47 65  74 44 61 74 61 28 77 68  |l_IconGetData(wh|
00023b60  25 2c 69 6e 66 6f 5f 62  6c 6b 25 21 30 29 29 0d  |%,info_blk%!0)).|
00023b70  13 1d 05 cd 0d 13 1e 20  5f 6e 65 77 5f 76 61 6c  |....... _new_val|
00023b80  25 3d 63 75 72 72 5f 76  61 6c 25 2b 65 5f 62 6c  |%=curr_val%+e_bl|
00023b90  6b 25 21 38 0d 13 1f 16  e7 20 69 6e 66 6f 5f 62  |k%!8..... info_b|
00023ba0  6c 6b 25 21 32 30 3d 30  20 8c 0d 13 20 11 20 20  |lk%!20=0 ... .  |
00023bb0  f4 20 6e 6f 20 77 72 61  70 2e 2e 0d 13 21 35 20  |. no wrap....!5 |
00023bc0  20 e7 20 5f 6e 65 77 5f  76 61 6c 25 3e 69 6e 66  | . _new_val%>inf|
00023bd0  6f 5f 62 6c 6b 25 21 38  20 8c 20 5f 6e 65 77 5f  |o_blk%!8 . _new_|
00023be0  76 61 6c 25 3d 69 6e 66  6f 5f 62 6c 6b 25 21 38  |val%=info_blk%!8|
00023bf0  0d 13 22 35 20 20 e7 20  5f 6e 65 77 5f 76 61 6c  |.."5  . _new_val|
00023c00  25 3c 69 6e 66 6f 5f 62  6c 6b 25 21 34 20 8c 20  |%<info_blk%!4 . |
00023c10  5f 6e 65 77 5f 76 61 6c  25 3d 69 6e 66 6f 5f 62  |_new_val%=info_b|
00023c20  6c 6b 25 21 34 0d 13 23  05 cc 0d 13 24 0e 20 20  |lk%!4..#....$.  |
00023c30  f4 20 77 72 61 70 2e 2e  0d 13 25 35 20 20 e7 20  |. wrap....%5  . |
00023c40  5f 6e 65 77 5f 76 61 6c  25 3e 69 6e 66 6f 5f 62  |_new_val%>info_b|
00023c50  6c 6b 25 21 38 20 8c 20  5f 6e 65 77 5f 76 61 6c  |lk%!8 . _new_val|
00023c60  25 3d 69 6e 66 6f 5f 62  6c 6b 25 21 34 0d 13 26  |%=info_blk%!4..&|
00023c70  35 20 20 e7 20 5f 6e 65  77 5f 76 61 6c 25 3c 69  |5  . _new_val%<i|
00023c80  6e 66 6f 5f 62 6c 6b 25  21 34 20 8c 20 5f 6e 65  |nfo_blk%!4 . _ne|
00023c90  77 5f 76 61 6c 25 3d 69  6e 66 6f 5f 62 6c 6b 25  |w_val%=info_blk%|
00023ca0  21 38 0d 13 27 05 cd 0d  13 28 14 66 6e 25 3d 69  |!8..'....(.fn%=i|
00023cb0  6e 66 6f 5f 62 6c 6b 25  21 31 32 0d 13 29 0e e7  |nfo_blk%!12..)..|
00023cc0  20 66 6e 25 3c 3e 30 20  8c 0d 13 2a 2a 20 20 5f  | fn%<>0 ...**  _|
00023cd0  6e 65 77 5f 76 61 6c 24  3d a0 28 22 46 4e 22 2b  |new_val$=.("FN"+|
00023ce0  24 66 6e 25 2b 22 28 5f  6e 65 77 5f 76 61 6c 25  |$fn%+"(_new_val%|
00023cf0  29 22 29 0d 13 2b 05 cc  0d 13 2c 1a 20 20 5f 6e  |)")..+....,.  _n|
00023d00  65 77 5f 76 61 6c 24 3d  c3 5f 6e 65 77 5f 76 61  |ew_val$=._new_va|
00023d10  6c 25 0d 13 2d 05 cd 0d  13 2e 1c e7 20 5f 6e 65  |l%..-....... _ne|
00023d20  77 5f 76 61 6c 25 3c 3e  63 75 72 72 5f 76 61 6c  |w_val%<>curr_val|
00023d30  25 20 8c 0d 13 2f 36 20  20 f2 73 68 65 6c 6c 5f  |% .../6  .shell_|
00023d40  49 63 6f 6e 50 75 74 44  61 74 61 28 77 68 25 2c  |IconPutData(wh%,|
00023d50  69 6e 66 6f 5f 62 6c 6b  25 21 30 2c 5f 6e 65 77  |info_blk%!0,_new|
00023d60  5f 76 61 6c 24 2c 2d 31  29 0d 13 30 05 cd 0d 13  |_val$,-1)..0....|
00023d70  31 05 e1 0d 13 32 05 3a  0d 13 33 24 2a 7c 53 74  |1....2.:..3$*|St|
00023d80  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 48 61 6e  |op PROCshell_Han|
00023d90  64 6c 65 42 75 6d 70 49  63 6f 6e 73 0d 13 34 04  |dleBumpIcons..4.|
00023da0  0d 13 35 27 2a 7c 53 74  61 72 74 20 46 4e 73 68  |..5'*|Start FNsh|
00023db0  65 6c 6c 5f 57 69 6e 64  6f 77 53 65 74 53 70 72  |ell_WindowSetSpr|
00023dc0  69 74 65 41 72 65 61 0d  13 36 30 dd 20 a4 73 68  |iteArea..60. .sh|
00023dd0  65 6c 6c 5f 57 69 6e 64  6f 77 53 65 74 53 70 72  |ell_WindowSetSpr|
00023de0  69 74 65 41 72 65 61 28  68 25 2c 53 70 72 69 74  |iteArea(h%,Sprit|
00023df0  65 41 72 65 61 25 29 0d  13 37 16 ea 20 62 6c 6b  |eArea%)..7.. blk|
00023e00  25 2c 6e 65 77 5f 68 61  6e 64 6c 65 25 0d 13 38  |%,new_handle%..8|
00023e10  24 62 6c 6b 25 3d a4 73  68 65 6c 6c 5f 48 65 61  |$blk%=.shell_Hea|
00023e20  70 42 6c 6f 63 6b 46 65  74 63 68 28 36 30 30 30  |pBlockFetch(6000|
00023e30  29 0d 13 39 0c 21 62 6c  6b 25 3d 68 25 0d 13 3a  |)..9.!blk%=h%..:|
00023e40  21 c8 99 20 22 57 69 6d  70 5f 47 65 74 57 69 6e  |!.. "Wimp_GetWin|
00023e50  64 6f 77 49 6e 66 6f 22  2c 2c 62 6c 6b 25 0d 13  |dowInfo",,blk%..|
00023e60  3b 17 62 6c 6b 25 21 36  38 3d 53 70 72 69 74 65  |;.blk%!68=Sprite|
00023e70  41 72 65 61 25 0d 13 3c  20 c8 99 20 22 57 69 6d  |Area%..< .. "Wim|
00023e80  70 5f 44 65 6c 65 74 65  57 69 6e 64 6f 77 22 2c  |p_DeleteWindow",|
00023e90  2c 62 6c 6b 25 0d 13 3d  30 c8 99 20 22 57 69 6d  |,blk%..=0.. "Wim|
00023ea0  70 5f 43 72 65 61 74 65  57 69 6e 64 6f 77 22 2c  |p_CreateWindow",|
00023eb0  2c 62 6c 6b 25 2b 34 20  b8 20 6e 65 77 5f 68 61  |,blk%+4 . new_ha|
00023ec0  6e 64 6c 65 25 0d 13 3e  41 e7 20 6e 65 77 5f 68  |ndle%..>A. new_h|
00023ed0  61 6e 64 6c 65 25 3c 3e  68 25 20 8c 20 f2 73 68  |andle%<>h% . .sh|
00023ee0  65 6c 6c 5f 55 70 64 61  74 65 57 69 6e 64 6f 77  |ell_UpdateWindow|
00023ef0  48 61 6e 64 6c 65 28 68  25 2c 6e 65 77 5f 68 61  |Handle(h%,new_ha|
00023f00  6e 64 6c 65 25 29 0d 13  3f 20 f2 73 68 65 6c 6c  |ndle%)..? .shell|
00023f10  5f 48 65 61 70 42 6c 6f  63 6b 52 65 74 75 72 6e  |_HeapBlockReturn|
00023f20  28 62 6c 6b 25 29 0d 13  40 10 3d 6e 65 77 5f 68  |(blk%)..@.=new_h|
00023f30  61 6e 64 6c 65 25 0d 13  41 05 3a 0d 13 42 26 2a  |andle%..A.:..B&*|
00023f40  7c 53 74 6f 70 20 46 4e  73 68 65 6c 6c 5f 57 69  ||Stop FNshell_Wi|
00023f50  6e 64 6f 77 53 65 74 53  70 72 69 74 65 41 72 65  |ndowSetSpriteAre|
00023f60  61 0d 13 43 04 0d 13 44  28 2a 7c 53 74 61 72 74  |a..C...D(*|Start|
00023f70  20 46 4e 73 68 65 6c 6c  5f 53 74 72 6f 6e 67 48  | FNshell_StrongH|
00023f80  6c 70 49 73 41 76 61 69  6c 61 62 6c 65 0d 13 45  |lpIsAvailable..E|
00023f90  21 dd 20 a4 73 68 65 6c  6c 5f 53 74 72 6f 6e 67  |!. .shell_Strong|
00023fa0  48 6c 70 49 73 41 76 61  69 6c 61 62 6c 65 0d 13  |HlpIsAvailable..|
00023fb0  46 0e ea 20 72 25 2c 62  75 66 66 25 0d 13 47 24  |F.. r%,buff%..G$|
00023fc0  62 75 66 66 25 3d a4 73  68 65 6c 6c 5f 48 65 61  |buff%=.shell_Hea|
00023fd0  70 42 6c 6f 63 6b 46 65  74 63 68 28 32 35 36 29  |pBlockFetch(256)|
00023fe0  0d 13 48 31 72 25 3d a4  73 68 65 6c 6c 5f 4f 53  |..H1r%=.shell_OS|
00023ff0  56 61 72 45 78 69 73 74  73 28 62 75 66 66 25 2c  |VarExists(buff%,|
00024000  22 53 74 72 6f 6e 67 48  65 6c 70 24 44 69 72 22  |"StrongHelp$Dir"|
00024010  29 0d 13 49 21 f2 73 68  65 6c 6c 5f 48 65 61 70  |)..I!.shell_Heap|
00024020  42 6c 6f 63 6b 52 65 74  75 72 6e 28 62 75 66 66  |BlockReturn(buff|
00024030  25 29 0d 13 4a 07 3d 72  25 0d 13 4b 27 2a 7c 53  |%)..J.=r%..K'*|S|
00024040  74 6f 70 20 46 4e 73 68  65 6c 6c 5f 53 74 72 6f  |top FNshell_Stro|
00024050  6e 67 48 6c 70 49 73 41  76 61 69 6c 61 62 6c 65  |ngHlpIsAvailable|
00024060  0d 13 4c 04 0d 13 4d 1b  2a 7c 53 74 61 72 74 20  |..L...M.*|Start |
00024070  46 4e 73 68 65 6c 6c 5f  4d 65 6e 75 4e 65 77 0d  |FNshell_MenuNew.|
00024080  13 4e 1c dd 20 a4 73 68  65 6c 6c 5f 4d 65 6e 75  |.N.. .shell_Menu|
00024090  4e 65 77 28 74 69 74 6c  65 24 29 0d 13 4f 0d ea  |New(title$)..O..|
000240a0  20 68 61 6e 64 6c 65 25  0d 13 50 27 c8 99 20 22  | handle%..P'.. "|
000240b0  4d 65 6e 75 55 74 69 6c  5f 4e 65 77 22 2c 2c 74  |MenuUtil_New",,t|
000240c0  69 74 6c 65 24 20 b8 20  68 61 6e 64 6c 65 25 0d  |itle$ . handle%.|
000240d0  13 51 0c 3d 68 61 6e 64  6c 65 25 0d 13 52 05 3a  |.Q.=handle%..R.:|
000240e0  0d 13 53 1a 2a 7c 53 74  6f 70 20 46 4e 73 68 65  |..S.*|Stop FNshe|
000240f0  6c 6c 5f 4d 65 6e 75 4e  65 77 0d 13 54 04 0d 13  |ll_MenuNew..T...|
00024100  55 1b 2a 7c 53 74 61 72  74 20 46 4e 73 68 65 6c  |U.*|Start FNshel|
00024110  6c 5f 4d 65 6e 75 41 64  64 0d 13 56 2b dd 20 a4  |l_MenuAdd..V+. .|
00024120  73 68 65 6c 6c 5f 4d 65  6e 75 41 64 64 28 68 61  |shell_MenuAdd(ha|
00024130  6e 64 6c 65 25 2c 69 74  65 6d 24 2c 73 65 6c 5f  |ndle%,item$,sel_|
00024140  66 6e 24 29 0d 13 57 11  ea 20 72 65 74 5f 68 61  |fn$)..W.. ret_ha|
00024150  6e 64 6c 65 25 0d 13 58  14 e7 20 73 65 6c 5f 66  |ndle%..X.. sel_f|
00024160  6e 24 3c 3e 22 22 20 8c  20 0d 13 59 3b 20 20 c8  |n$<>"" . ..Y;  .|
00024170  99 20 22 4d 65 6e 75 55  74 69 6c 5f 41 64 64 22  |. "MenuUtil_Add"|
00024180  2c 68 61 6e 64 6c 65 25  2c 69 74 65 6d 24 2c 73  |,handle%,item$,s|
00024190  65 6c 5f 66 6e 24 20 b8  20 72 65 74 5f 68 61 6e  |el_fn$ . ret_han|
000241a0  64 6c 65 25 0d 13 5a 05  cc 0d 13 5b 33 20 20 c8  |dle%..Z....[3  .|
000241b0  99 20 22 4d 65 6e 75 55  74 69 6c 5f 41 64 64 22  |. "MenuUtil_Add"|
000241c0  2c 68 61 6e 64 6c 65 25  2c 69 74 65 6d 24 20 b8  |,handle%,item$ .|
000241d0  20 72 65 74 5f 68 61 6e  64 6c 65 25 0d 13 5c 05  | ret_handle%..\.|
000241e0  cd 0d 13 5d 10 3d 72 65  74 5f 68 61 6e 64 6c 65  |...].=ret_handle|
000241f0  25 0d 13 5e 05 3a 0d 13  5f 1a 2a 7c 53 74 6f 70  |%..^.:.._.*|Stop|
00024200  20 46 4e 73 68 65 6c 6c  5f 4d 65 6e 75 41 64 64  | FNshell_MenuAdd|
00024210  0d 13 60 04 0d 13 61 1e  2a 7c 53 74 61 72 74 20  |..`...a.*|Start |
00024220  50 52 4f 43 73 68 65 6c  6c 5f 4d 65 6e 75 54 69  |PROCshell_MenuTi|
00024230  63 6b 0d 13 62 2a dd 20  f2 73 68 65 6c 6c 5f 4d  |ck..b*. .shell_M|
00024240  65 6e 75 54 69 63 6b 28  69 74 65 6d 5f 68 61 6e  |enuTick(item_han|
00024250  64 6c 65 25 2c 73 74 61  74 65 25 29 0d 13 63 2a  |dle%,state%)..c*|
00024260  c8 99 20 22 4d 65 6e 75  55 74 69 6c 5f 54 69 63  |.. "MenuUtil_Tic|
00024270  6b 22 2c 69 74 65 6d 5f  68 61 6e 64 6c 65 25 2c  |k",item_handle%,|
00024280  73 74 61 74 65 25 0d 13  64 05 e1 0d 13 65 05 3a  |state%..d....e.:|
00024290  0d 13 66 1d 2a 7c 53 74  6f 70 20 50 52 4f 43 73  |..f.*|Stop PROCs|
000242a0  68 65 6c 6c 5f 4d 65 6e  75 54 69 63 6b 0d 13 67  |hell_MenuTick..g|
000242b0  04 0d 13 68 23 2a 7c 53  74 61 72 74 20 50 52 4f  |...h#*|Start PRO|
000242c0  43 73 68 65 6c 6c 5f 4d  65 6e 75 54 69 63 6b 4f  |Cshell_MenuTickO|
000242d0  6e 6c 79 31 0d 13 69 2d  dd 20 f2 73 68 65 6c 6c  |nly1..i-. .shell|
000242e0  5f 4d 65 6e 75 54 69 63  6b 4f 6e 6c 79 31 28 6d  |_MenuTickOnly1(m|
000242f0  65 6e 75 5f 68 61 6e 64  6c 65 25 2c 70 6f 73 25  |enu_handle%,pos%|
00024300  29 0d 13 6a 2c c8 99 20  22 4d 65 6e 75 55 74 69  |)..j,.. "MenuUti|
00024310  6c 5f 54 69 63 6b 4f 6e  6c 79 22 2c 6d 65 6e 75  |l_TickOnly",menu|
00024320  5f 68 61 6e 64 6c 65 25  2c 70 6f 73 25 0d 13 6b  |_handle%,pos%..k|
00024330  05 e1 0d 13 6c 05 3a 0d  13 6d 22 2a 7c 53 74 6f  |....l.:..m"*|Sto|
00024340  70 20 50 52 4f 43 73 68  65 6c 6c 5f 4d 65 6e 75  |p PROCshell_Menu|
00024350  54 69 63 6b 4f 6e 6c 79  31 0d 13 6e 04 0d 13 6f  |TickOnly1..n...o|
00024360  23 2a 7c 53 74 61 72 74  20 50 52 4f 43 73 68 65  |#*|Start PROCshe|
00024370  6c 6c 5f 4d 65 6e 75 54  69 63 6b 4f 6e 6c 79 32  |ll_MenuTickOnly2|
00024380  0d 13 70 28 dd 20 f2 73  68 65 6c 6c 5f 4d 65 6e  |..p(. .shell_Men|
00024390  75 54 69 63 6b 4f 6e 6c  79 32 28 69 74 65 6d 5f  |uTickOnly2(item_|
000243a0  68 61 6e 64 6c 65 25 29  0d 13 71 27 c8 99 20 22  |handle%)..q'.. "|
000243b0  4d 65 6e 75 55 74 69 6c  5f 54 69 63 6b 4f 6e 6c  |MenuUtil_TickOnl|
000243c0  79 22 2c 69 74 65 6d 5f  68 61 6e 64 6c 65 25 0d  |y",item_handle%.|
000243d0  13 72 05 e1 0d 13 73 05  3a 0d 13 74 22 2a 7c 53  |.r....s.:..t"*|S|
000243e0  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 4d 65  |top PROCshell_Me|
000243f0  6e 75 54 69 63 6b 4f 6e  6c 79 32 0d 13 75 04 0d  |nuTickOnly2..u..|
00024400  13 76 1f 2a 7c 53 74 61  72 74 20 50 52 4f 43 73  |.v.*|Start PROCs|
00024410  68 65 6c 6c 5f 4d 65 6e  75 53 68 61 64 65 0d 13  |hell_MenuShade..|
00024420  77 26 dd 20 f2 73 68 65  6c 6c 5f 4d 65 6e 75 53  |w&. .shell_MenuS|
00024430  68 61 64 65 28 68 61 6e  64 6c 65 25 2c 73 74 61  |hade(handle%,sta|
00024440  74 65 25 29 0d 13 78 25  c8 99 20 22 4d 65 6e 75  |te%)..x%.. "Menu|
00024450  55 74 69 6c 5f 46 61 64  65 22 2c 68 61 6e 64 6c  |Util_Fade",handl|
00024460  65 25 2c 73 74 61 74 65  25 0d 13 79 05 e1 0d 13  |e%,state%..y....|
00024470  7a 05 3a 0d 13 7b 1e 2a  7c 53 74 6f 70 20 50 52  |z.:..{.*|Stop PR|
00024480  4f 43 73 68 65 6c 6c 5f  4d 65 6e 75 53 68 61 64  |OCshell_MenuShad|
00024490  65 0d 13 7c 04 0d 13 7d  20 2a 7c 53 74 61 72 74  |e..|...} *|Start|
000244a0  20 50 52 4f 43 73 68 65  6c 6c 5f 4d 65 6e 75 44  | PROCshell_MenuD|
000244b0  6f 74 74 65 64 0d 13 7e  2c dd 20 f2 73 68 65 6c  |otted..~,. .shel|
000244c0  6c 5f 4d 65 6e 75 44 6f  74 74 65 64 28 69 74 65  |l_MenuDotted(ite|
000244d0  6d 5f 68 61 6e 64 6c 65  25 2c 73 74 61 74 65 25  |m_handle%,state%|
000244e0  29 0d 13 7f 2a c8 99 20  22 4d 65 6e 75 55 74 69  |)...*.. "MenuUti|
000244f0  6c 5f 44 6f 74 73 22 2c  69 74 65 6d 5f 68 61 6e  |l_Dots",item_han|
00024500  64 6c 65 25 2c 73 74 61  74 65 25 0d 13 80 05 e1  |dle%,state%.....|
00024510  0d 13 81 05 3a 0d 13 82  1f 2a 7c 53 74 6f 70 20  |....:....*|Stop |
00024520  50 52 4f 43 73 68 65 6c  6c 5f 4d 65 6e 75 44 6f  |PROCshell_MenuDo|
00024530  74 74 65 64 0d 13 83 04  0d 13 84 21 2a 7c 53 74  |tted.......!*|St|
00024540  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 4d 65  |art PROCshell_Me|
00024550  6e 75 43 6f 6c 6f 75 72  73 0d 13 85 2e dd 20 f2  |nuColours..... .|
00024560  73 68 65 6c 6c 5f 4d 65  6e 75 43 6f 6c 6f 75 72  |shell_MenuColour|
00024570  73 28 69 74 65 6d 5f 68  61 6e 64 6c 65 25 2c 66  |s(item_handle%,f|
00024580  67 25 2c 62 67 25 29 0d  13 86 2e c8 99 20 22 4d  |g%,bg%)...... "M|
00024590  65 6e 75 55 74 69 6c 5f  43 6f 6c 6f 75 72 73 22  |enuUtil_Colours"|
000245a0  2c 69 74 65 6d 5f 68 61  6e 64 6c 65 25 2c 66 67  |,item_handle%,fg|
000245b0  25 2c 62 67 25 0d 13 87  05 e1 0d 13 88 05 3a 0d  |%,bg%.........:.|
000245c0  13 89 20 2a 7c 53 74 6f  70 20 50 52 4f 43 73 68  |.. *|Stop PROCsh|
000245d0  65 6c 6c 5f 4d 65 6e 75  43 6f 6c 6f 75 72 73 0d  |ell_MenuColours.|
000245e0  13 8a 04 0d 13 8b 22 2a  7c 53 74 61 72 74 20 50  |......"*|Start P|
000245f0  52 4f 43 73 68 65 6c 6c  5f 4d 65 6e 75 57 72 69  |ROCshell_MenuWri|
00024600  74 61 62 6c 65 0d 13 8c  3b dd 20 f2 73 68 65 6c  |table...;. .shel|
00024610  6c 5f 4d 65 6e 75 57 72  69 74 61 62 6c 65 28 69  |l_MenuWritable(i|
00024620  74 65 6d 5f 68 61 6e 64  6c 65 25 2c 73 74 61 74  |tem_handle%,stat|
00024630  65 25 2c 73 69 7a 65 25  2c 76 61 6c 69 64 24 29  |e%,size%,valid$)|
00024640  0d 13 8d 3b c8 99 20 22  4d 65 6e 75 55 74 69 6c  |...;.. "MenuUtil|
00024650  5f 57 72 69 74 61 62 6c  65 22 2c 69 74 65 6d 5f  |_Writable",item_|
00024660  68 61 6e 64 6c 65 25 2c  73 74 61 74 65 25 2c 73  |handle%,state%,s|
00024670  69 7a 65 25 2c 76 61 6c  69 64 24 0d 13 8e 05 e1  |ize%,valid$.....|
00024680  0d 13 8f 05 3a 0d 13 90  21 2a 7c 53 74 6f 70 20  |....:...!*|Stop |
00024690  50 52 4f 43 73 68 65 6c  6c 5f 4d 65 6e 75 57 72  |PROCshell_MenuWr|
000246a0  69 74 61 62 6c 65 0d 13  91 04 0d 13 92 21 2a 7c  |itable.......!*||
000246b0  53 74 61 72 74 20 50 52  4f 43 73 68 65 6c 6c 5f  |Start PROCshell_|
000246c0  4d 65 6e 75 50 75 74 44  61 74 61 0d 13 93 2c dd  |MenuPutData...,.|
000246d0  20 f2 73 68 65 6c 6c 5f  4d 65 6e 75 50 75 74 44  | .shell_MenuPutD|
000246e0  61 74 61 28 69 74 65 6d  5f 68 61 6e 64 6c 65 25  |ata(item_handle%|
000246f0  2c 64 61 74 61 24 29 0d  13 94 29 c8 99 20 22 4d  |,data$)...).. "M|
00024700  65 6e 75 55 74 69 6c 5f  54 65 78 74 22 2c 69 74  |enuUtil_Text",it|
00024710  65 6d 5f 68 61 6e 64 6c  65 25 2c 64 61 74 61 24  |em_handle%,data$|
00024720  0d 13 95 05 e1 0d 13 96  05 3a 0d 13 97 20 2a 7c  |.........:... *||
00024730  53 74 6f 70 20 50 52 4f  43 73 68 65 6c 6c 5f 4d  |Stop PROCshell_M|
00024740  65 6e 75 50 75 74 44 61  74 61 0d 13 98 04 0d 13  |enuPutData......|
00024750  99 25 2a 7c 53 74 61 72  74 20 50 52 4f 43 73 68  |.%*|Start PROCsh|
00024760  65 6c 6c 5f 4d 65 6e 75  43 61 6c 6c 48 61 6e 64  |ell_MenuCallHand|
00024770  6c 65 72 0d 13 9a 28 dd  20 f2 73 68 65 6c 6c 5f  |ler...(. .shell_|
00024780  4d 65 6e 75 43 61 6c 6c  48 61 6e 64 6c 65 72 28  |MenuCallHandler(|
00024790  68 25 2c 5f 68 5f 62 6c  6b 25 29 0d 13 9b 07 ea  |h%,_h_blk%).....|
000247a0  20 85 0d 13 9c 0f ee 20  85 20 ea 3a f7 20 85 3a  | ...... . .:. .:|
000247b0  e1 0d 13 9d 1d e7 20 a0  28 22 46 4e 22 2b 24 68  |...... .("FN"+$h|
000247c0  25 2b 22 28 5f 68 5f 62  6c 6b 25 29 22 29 0d 13  |%+"(_h_blk%)")..|
000247d0  9e 05 e1 0d 13 9f 05 3a  0d 13 a0 24 2a 7c 53 74  |.......:...$*|St|
000247e0  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 4d 65 6e  |op PROCshell_Men|
000247f0  75 43 61 6c 6c 48 61 6e  64 6c 65 72 0d 13 a1 04  |uCallHandler....|
00024800  0d 13 a2 26 2a 7c 53 74  61 72 74 20 50 52 4f 43  |...&*|Start PROC|
00024810  73 68 65 6c 6c 5f 41 74  74 61 63 68 4f 70 65 6e  |shell_AttachOpen|
00024820  57 69 6e 64 6f 77 0d 13  a3 26 dd 20 f2 73 68 65  |Window...&. .she|
00024830  6c 6c 5f 41 74 74 61 63  68 4f 70 65 6e 57 69 6e  |ll_AttachOpenWin|
00024840  64 6f 77 28 77 68 25 2c  66 6e 24 29 0d 13 a4 18  |dow(wh%,fn$)....|
00024850  ea 20 62 6c 6b 25 2c 74  65 6d 70 25 2c 6f 66 66  |. blk%,temp%,off|
00024860  73 65 74 25 0d 13 a5 15  2a 7c 69 66 64 65 66 20  |set%....*|ifdef |
00024870  54 72 61 63 65 49 6e 69  74 0d 13 a6 43 f2 73 68  |TraceInit...C.sh|
00024880  65 6c 6c 5f 54 72 61 63  65 66 30 28 22 41 74 74  |ell_Tracef0("Att|
00024890  61 63 68 4f 70 65 6e 57  69 6e 64 6f 77 3a 41 74  |achOpenWindow:At|
000248a0  74 61 63 68 69 6e 67 20  4f 70 65 6e 57 69 6e 64  |taching OpenWind|
000248b0  6f 77 20 48 61 6e 64 6c  65 72 22 29 0d 13 a7 0b  |ow Handler")....|
000248c0  2a 7c 65 6e 64 69 66 0d  13 a8 48 e7 20 77 68 25  |*|endif...H. wh%|
000248d0  3c 30 20 8c 20 85 20 39  39 2c f2 73 68 65 6c 6c  |<0 . . 99,.shell|
000248e0  5f 4d 65 73 73 61 67 65  4f 6e 65 41 72 67 28 22  |_MessageOneArg("|
000248f0  53 48 45 4c 4c 4d 53 47  32 37 22 2c 22 41 74 74  |SHELLMSG27","Att|
00024900  61 63 68 4f 70 65 6e 57  69 6e 64 6f 77 22 29 0d  |achOpenWindow").|
00024910  13 a9 3a 6f 66 66 73 65  74 25 3d a4 73 68 65 6c  |..:offset%=.shel|
00024920  6c 5f 47 65 74 45 76 65  6e 74 4c 69 73 74 4f 66  |l_GetEventListOf|
00024930  66 73 65 74 28 77 68 25  2c 2d 31 2c 5f 55 25 2b  |fset(wh%,-1,_U%+|
00024940  33 30 34 2c 31 32 2c b9  29 0d 13 aa 18 62 6c 6b  |304,12,.)....blk|
00024950  25 3d 5f 55 25 21 33 30  34 2b 6f 66 66 73 65 74  |%=_U%!304+offset|
00024960  25 0d 13 ab 18 62 6c 6b  25 21 30 3d 77 68 25 3a  |%....blk%!0=wh%:|
00024970  62 6c 6b 25 21 34 3d 2d  31 0d 13 ac 2a 62 6c 6b  |blk%!4=-1...*blk|
00024980  25 21 38 3d a4 73 68 65  6c 6c 5f 48 65 61 70 42  |%!8=.shell_HeapB|
00024990  6c 6f 63 6b 46 65 74 63  68 28 a9 28 66 6e 24 29  |lockFetch(.(fn$)|
000249a0  2b 31 29 0d 13 ad 1b 74  65 6d 70 25 3d 62 6c 6b  |+1)....temp%=blk|
000249b0  25 21 38 3a 24 74 65 6d  70 25 3d 66 6e 24 0d 13  |%!8:$temp%=fn$..|
000249c0  ae 05 e1 0d 13 af 05 3a  0d 13 b0 25 2a 7c 53 74  |.......:...%*|St|
000249d0  6f 70 20 50 52 4f 43 73  68 65 6c 6c 5f 41 74 74  |op PROCshell_Att|
000249e0  61 63 68 4f 70 65 6e 57  69 6e 64 6f 77 0d 13 b1  |achOpenWindow...|
000249f0  04 0d 13 b2 27 2a 7c 53  74 61 72 74 20 50 52 4f  |....'*|Start PRO|
00024a00  43 73 68 65 6c 6c 5f 41  74 74 61 63 68 43 6c 6f  |Cshell_AttachClo|
00024a10  73 65 57 69 6e 64 6f 77  0d 13 b3 27 dd 20 f2 73  |seWindow...'. .s|
00024a20  68 65 6c 6c 5f 41 74 74  61 63 68 43 6c 6f 73 65  |hell_AttachClose|
00024a30  57 69 6e 64 6f 77 28 77  68 25 2c 66 6e 24 29 0d  |Window(wh%,fn$).|
00024a40  13 b4 18 ea 20 62 6c 6b  25 2c 74 65 6d 70 25 2c  |.... blk%,temp%,|
00024a50  6f 66 66 73 65 74 25 0d  13 b5 15 2a 7c 69 66 64  |offset%....*|ifd|
00024a60  65 66 20 54 72 61 63 65  49 6e 69 74 0d 13 b6 45  |ef TraceInit...E|
00024a70  f2 73 68 65 6c 6c 5f 54  72 61 63 65 66 30 28 22  |.shell_Tracef0("|
00024a80  41 74 74 61 63 68 43 6c  6f 73 65 57 69 6e 64 6f  |AttachCloseWindo|
00024a90  77 3a 41 74 74 61 63 68  69 6e 67 20 43 6c 6f 73  |w:Attaching Clos|
00024aa0  65 57 69 6e 64 6f 77 20  48 61 6e 64 6c 65 72 22  |eWindow Handler"|
00024ab0  29 0d 13 b7 0b 2a 7c 65  6e 64 69 66 0d 13 b8 49  |)....*|endif...I|
00024ac0  e7 20 77 68 25 3c 30 20  8c 20 85 20 39 39 2c f2  |. wh%<0 . . 99,.|
00024ad0  73 68 65 6c 6c 5f 4d 65  73 73 61 67 65 4f 6e 65  |shell_MessageOne|
00024ae0  41 72 67 28 22 53 48 45  4c 4c 4d 53 47 32 37 22  |Arg("SHELLMSG27"|
00024af0  2c 22 41 74 74 61 63 68  43 6c 6f 73 65 57 69 6e  |,"AttachCloseWin|
00024b00  64 6f 77 22 29 0d 13 b9  3a 6f 66 66 73 65 74 25  |dow")...:offset%|
00024b10  3d a4 73 68 65 6c 6c 5f  47 65 74 45 76 65 6e 74  |=.shell_GetEvent|
00024b20  4c 69 73 74 4f 66 66 73  65 74 28 77 68 25 2c 2d  |ListOffset(wh%,-|
00024b30  31 2c 5f 55 25 2b 33 30  38 2c 31 32 2c b9 29 0d  |1,_U%+308,12,.).|
00024b40  13 ba 18 62 6c 6b 25 3d  5f 55 25 21 33 30 38 2b  |...blk%=_U%!308+|
00024b50  6f 66 66 73 65 74 25 0d  13 bb 18 62 6c 6b 25 21  |offset%....blk%!|
00024b60  30 3d 77 68 25 3a 62 6c  6b 25 21 34 3d 2d 31 0d  |0=wh%:blk%!4=-1.|
00024b70  13 bc 2a 62 6c 6b 25 21  38 3d a4 73 68 65 6c 6c  |..*blk%!8=.shell|
00024b80  5f 48 65 61 70 42 6c 6f  63 6b 46 65 74 63 68 28  |_HeapBlockFetch(|
00024b90  a9 28 66 6e 24 29 2b 31  29 0d 13 bd 1b 74 65 6d  |.(fn$)+1)....tem|
00024ba0  70 25 3d 62 6c 6b 25 21  38 3a 24 74 65 6d 70 25  |p%=blk%!8:$temp%|
00024bb0  3d 66 6e 24 0d 13 be 05  e1 0d 13 bf 05 3a 0d 13  |=fn$.........:..|
00024bc0  c0 26 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |.&*|Stop PROCshe|
00024bd0  6c 6c 5f 41 74 74 61 63  68 43 6c 6f 73 65 57 69  |ll_AttachCloseWi|
00024be0  6e 64 6f 77 0d 13 c1 04  0d 13 c2 22 2a 7c 53 74  |ndow......."*|St|
00024bf0  61 72 74 20 50 52 4f 43  73 68 65 6c 6c 5f 53 70  |art PROCshell_Sp|
00024c00  72 69 74 65 52 65 6e 61  6d 65 0d 13 c3 30 dd 20  |riteRename...0. |
00024c10  f2 73 68 65 6c 6c 5f 53  70 72 69 74 65 52 65 6e  |.shell_SpriteRen|
00024c20  61 6d 65 28 73 70 72 69  74 65 61 72 65 61 25 2c  |ame(spritearea%,|
00024c30  6f 6c 64 24 2c 6e 65 77  24 29 0d 13 c4 53 c8 99  |old$,new$)...S..|
00024c40  20 22 4f 53 5f 53 70 72  69 74 65 4f 70 22 2c 26  | "OS_SpriteOp",&|
00024c50  32 30 30 2b 32 36 2c 73  70 72 69 74 65 61 72 65  |200+26,spriteare|
00024c60  61 25 2c a4 73 68 65 6c  6c 5f 53 70 72 69 74 65  |a%,.shell_Sprite|
00024c70  47 65 74 50 74 72 28 73  70 72 69 74 65 61 72 65  |GetPtr(spriteare|
00024c80  61 25 2c 6f 6c 64 24 29  2c 6e 65 77 24 0d 13 c5  |a%,old$),new$...|
00024c90  05 e1 0d 13 c6 05 3a 0d  13 c7 21 2a 7c 53 74 6f  |......:...!*|Sto|
00024ca0  70 20 50 52 4f 43 73 68  65 6c 6c 5f 53 70 72 69  |p PROCshell_Spri|
00024cb0  74 65 52 65 6e 61 6d 65  0d 13 c8 04 0d 13 c9 24  |teRename.......$|
00024cc0  2a 7c 53 74 61 72 74 20  50 52 4f 43 73 68 65 6c  |*|Start PROCshel|
00024cd0  6c 5f 53 70 72 69 74 65  41 72 65 61 53 61 76 65  |l_SpriteAreaSave|
00024ce0  0d 13 ca 32 dd 20 f2 73  68 65 6c 6c 5f 53 70 72  |...2. .shell_Spr|
00024cf0  69 74 65 41 72 65 61 53  61 76 65 28 73 70 72 69  |iteAreaSave(spri|
00024d00  74 65 61 72 65 61 25 2c  66 69 6c 65 6e 61 6d 65  |tearea%,filename|
00024d10  24 29 0d 13 cb 32 c8 99  20 22 4f 53 5f 53 70 72  |$)...2.. "OS_Spr|
00024d20  69 74 65 4f 70 22 2c 26  32 30 30 2b 31 32 2c 73  |iteOp",&200+12,s|
00024d30  70 72 69 74 65 61 72 65  61 25 2c 66 69 6c 65 6e  |pritearea%,filen|
00024d40  61 6d 65 24 0d 13 cc 05  e1 0d 13 cd 05 3a 0d 13  |ame$.........:..|
00024d50  ce 23 2a 7c 53 74 6f 70  20 50 52 4f 43 73 68 65  |.#*|Stop PROCshe|
00024d60  6c 6c 5f 53 70 72 69 74  65 41 72 65 61 53 61 76  |ll_SpriteAreaSav|
00024d70  65 0d 13 cf 04 0d 13 d0  20 2a 7c 53 74 61 72 74  |e....... *|Start|
00024d80  20 50 52 4f 43 73 68 65  6c 6c 5f 45 6e 73 75 72  | PROCshell_Ensur|
00024d90  65 50 6f 6c 6c 0d 13 d1  17 dd 20 f2 73 68 65 6c  |ePoll..... .shel|
00024da0  6c 5f 45 6e 73 75 72 65  50 6f 6c 6c 0d 13 d2 0d  |l_EnsurePoll....|
00024db0  ea 20 61 63 74 69 6f 6e  25 0d 13 d3 05 f5 0d 13  |. action%.......|
00024dc0  d4 26 20 20 61 63 74 69  6f 6e 25 3d a4 73 68 65  |.&  action%=.she|
00024dd0  6c 6c 5f 50 6f 6c 6c 5f  49 28 30 2c 5f 55 25 21  |ll_Poll_I(0,_U%!|
00024de0  31 34 38 29 0d 13 d5 1c  20 20 f2 73 68 65 6c 6c  |148)....  .shell|
00024df0  5f 41 63 74 69 6f 6e 28  61 63 74 69 6f 6e 25 29  |_Action(action%)|
00024e00  0d 13 d6 0f fd 20 61 63  74 69 6f 6e 25 3d 30 0d  |..... action%=0.|
00024e10  13 d7 05 e1 0d 13 d8 05  3a 0d 13 d9 1f 2a 7c 53  |........:....*|S|
00024e20  74 6f 70 20 50 52 4f 43  73 68 65 6c 6c 5f 45 6e  |top PROCshell_En|
00024e30  73 75 72 65 50 6f 6c 6c  0d 13 da 04 0d 13 db 22  |surePoll......."|
00024e40  2a 7c 53 74 61 72 74 20  46 4e 73 68 65 6c 6c 5f  |*|Start FNshell_|
00024e50  57 69 6d 70 47 65 74 56  65 72 73 69 6f 6e 0d 13  |WimpGetVersion..|
00024e60  dc 1b dd 20 a4 73 68 65  6c 6c 5f 57 69 6d 70 47  |... .shell_WimpG|
00024e70  65 74 56 65 72 73 69 6f  6e 0d 13 dd 0c 3d 5f 55  |etVersion....=_U|
00024e80  25 21 33 31 36 0d 13 de  21 2a 7c 53 74 6f 70 20  |%!316...!*|Stop |
00024e90  46 4e 73 68 65 6c 6c 5f  57 69 6d 70 47 65 74 56  |FNshell_WimpGetV|
00024ea0  65 72 73 69 6f 6e 0d 13  df 04 0d 13 e0 22 2a 7c  |ersion......."*||
00024eb0  53 74 61 72 74 20 46 4e  73 68 65 6c 6c 5f 4f 53  |Start FNshell_OS|
00024ec0  43 68 65 63 6b 56 65 72  73 69 6f 6e 0d 13 e1 25  |CheckVersion...%|
00024ed0  dd 20 a4 73 68 65 6c 6c  5f 4f 53 43 68 65 63 6b  |. .shell_OSCheck|
00024ee0  56 65 72 73 69 6f 6e 28  76 65 72 73 69 6f 6e 25  |Version(version%|
00024ef0  29 0d 13 e2 3a 3d a4 73  68 65 6c 6c 5f 4f 53 4d  |)...:=.shell_OSM|
00024f00  6f 64 75 6c 65 43 68 65  63 6b 56 65 72 73 69 6f  |oduleCheckVersio|
00024f10  6e 28 22 55 74 69 6c 69  74 79 4d 6f 64 75 6c 65  |n("UtilityModule|
00024f20  22 2c 76 65 72 73 69 6f  6e 25 29 0d 13 e3 21 2a  |",version%)...!*|
00024f30  7c 53 74 6f 70 20 46 4e  73 68 65 6c 6c 5f 4f 53  ||Stop FNshell_OS|
00024f40  43 68 65 63 6b 56 65 72  73 69 6f 6e 0d 13 e4 04  |CheckVersion....|
00024f50  0d 13 e5 28 2a 7c 53 74  61 72 74 20 46 4e 73 68  |...(*|Start FNsh|
00024f60  65 6c 6c 5f 4f 53 4d 6f  64 75 6c 65 43 68 65 63  |ell_OSModuleChec|
00024f70  6b 56 65 72 73 69 6f 6e  0d 13 e6 33 dd 20 a4 73  |kVersion...3. .s|
00024f80  68 65 6c 6c 5f 4f 53 4d  6f 64 75 6c 65 43 68 65  |hell_OSModuleChe|
00024f90  63 6b 56 65 72 73 69 6f  6e 28 6d 6f 64 75 6c 65  |ckVersion(module|
00024fa0  24 2c 76 65 72 73 69 6f  6e 25 29 0d 13 e7 0f ea  |$,version%).....|
00024fb0  20 62 6c 6b 25 2c 6c 65  6e 25 0d 13 e8 23 62 6c  | blk%,len%...#bl|
00024fc0  6b 25 3d a4 73 68 65 6c  6c 5f 48 65 61 70 42 6c  |k%=.shell_HeapBl|
00024fd0  6f 63 6b 46 65 74 63 68  28 32 35 36 29 0d 13 e9  |ockFetch(256)...|
00024fe0  1d ff 28 22 53 65 74 20  41 70 70 4e 61 6d 65 24  |..("Set AppName$|
00024ff0  52 49 53 43 4f 53 20 59  22 29 0d 13 ea 40 ff 28  |RISCOS Y")...@.(|
00025000  22 52 4d 45 6e 73 75 72  65 20 22 2b 6d 6f 64 75  |"RMEnsure "+modu|
00025010  6c 65 24 2b 22 20 22 2b  c3 76 65 72 73 69 6f 6e  |le$+" "+.version|
00025020  25 2b 22 20 53 65 74 20  41 70 70 4e 61 6d 65 24  |%+" Set AppName$|
00025030  52 49 53 43 4f 53 20 4e  22 29 0d 13 eb 3e c8 99  |RISCOS N")...>..|
00025040  20 22 58 4f 53 5f 52 65  61 64 56 61 72 56 61 6c  | "XOS_ReadVarVal|
00025050  22 2c 22 41 70 70 4e 61  6d 65 24 52 49 53 43 4f  |","AppName$RISCO|
00025060  53 22 2c 62 6c 6b 25 2c  32 35 36 2c 30 2c 30 20  |S",blk%,256,0,0 |
00025070  b8 20 2c 2c 6c 65 6e 25  0d 13 ec 10 62 6c 6b 25  |. ,,len%....blk%|
00025080  3f 6c 65 6e 25 3d 31 33  0d 13 ed 1d ff 28 22 55  |?len%=13.....("U|
00025090  6e 73 65 74 20 41 70 70  4e 61 6d 65 24 52 49 53  |nset AppName$RIS|
000250a0  43 4f 53 22 29 0d 13 ee  20 f2 73 68 65 6c 6c 5f  |COS")... .shell_|
000250b0  48 65 61 70 42 6c 6f 63  6b 52 65 74 75 72 6e 28  |HeapBlockReturn(|
000250c0  62 6c 6b 25 29 0d 13 ef  14 e7 20 24 62 6c 6b 25  |blk%)..... $blk%|
000250d0  3d 22 4e 22 20 8c 20 3d  a3 0d 13 f0 06 3d b9 0d  |="N" . =.....=..|
000250e0  13 f1 27 2a 7c 53 74 6f  70 20 46 4e 73 68 65 6c  |..'*|Stop FNshel|
000250f0  6c 5f 4f 53 4d 6f 64 75  6c 65 43 68 65 63 6b 56  |l_OSModuleCheckV|
00025100  65 72 73 69 6f 6e 0d 13  f2 04 0d ff              |ersion......|
0002510c