home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 3
/
PDCD_3.iso
/
education
/
verbmaster
/
!VerbMast
/
ShellLibRT
(
.txt
)
< prev
Wrap
RISC OS BBC BASIC V Source
|
1995-06-28
|
110KB
|
3,976 lines
>EvntShell:ShellLib
Squished by Lofty's !Shrink vsn 3.01 on 28-Jun-95
shell_LibraryVersion:=1.45*&64
shell_DefineConstants:_ERRNR_NONFATAL=&D00:_ERRNR_CLAIMMEM=&903:_MSE_SELECTBUT=4:_MSE_MENUBUT=2:_MSE_ADJUSTBUT=1:_EVENT_NULL=0:_EVENT_REDRAWWIN=1:_EVENT_OPENWIN=2:_EVENT_CLOSEWIN=3:_MESSAGE_QUIT=0:_MESSAGE_DATASAVE=1:_MESSAGE_DATASAVEACK=2
_MESSAGE_DATALOAD=3:_MESSAGE_DATALOADACK=4:_MESSAGE_RAMFETCH=6:_MESSAGE_RAMTRANSMIT=7:_MESSAGE_PREQUIT=8:_MESSAGE_PALETTECHANGE=9:_MESSAGE_SAVEDESKTOP=&A:_MESSAGE_SHUTDOWN=&E:_MESSAGE_HELP=&502:_MESSAGE_MENUWARNING=&400C0:_MESSAGE_MODECHANGE=&400C1
_MESSAGE_TASKINIT=&400C2:_MESSAGE_TASKCLOSEDOWN=&400C3:_MESSAGE_TASKNAMEIS=&400C7:_POPUP_TYPE_TEXT=0:_POPUP_TYPE_WIMPCOLOUR=1:_POPUP_TYPE_DATEPICK=2:_POPUP_TYPE_FONTPICK=4:_POPUP_TYPE_COLOUR24=8:
shell_Error:
GA%,GA$:
&606C2:
<>_ERRNR_NONFATAL
<>_ERRNR_CLAIMMEM
1<<31)
shell_FatalError
shell_OSCheckVersion(3)
shell_FileExists("Resources:$.Resources.Edit.ThrowBack")
("Set Basic$File <"+
shell_GetAppName+"$BasicFile>"):
"Edit:ThrowBack"
shell_ErrorBox("Unexpected error:- "+
$+" (Internal error code "+
+")")
$:GA%=
$,"in "+
34+"EvntShell:ShellLib"):
GA%>0
$,GA%-1)
shell_ErrorBox(GA$)
shell_OK(qA$):
_ERRNR_NONFATAL,qA$
shell_FatalError:
&606C2:
shell_OSCheckVersion(3)
shell_FileExists("Resources:$.Resources.Edit.ThrowBack")
1<<31)
shell_Exit
("Set Basic$File <"+
shell_GetAppName+"$BasicFile>"):
"Edit:ThrowBack"
shell_ErrorBox("Unexpected error:- "+
$+" Internal error code "+
shell_ErrorBox(sA$):
YB%,FB%:FB%=_shell_blk%:!FB%=
:$(FB%+4)=sA$+
=_ERRNR_NONFATAL
=_ERRNR_CLAIMMEM
&600DF,FB%,17,"XMessage from "+
shell_GetAppName
&600DF,FB%,1,
shell_GetAppName
shell_GetLastSecureFileName:
c%:c%=_U%!80:
shell_GetString(wF%):
bA$,lD%:
((wF%?lD%)>31
lD%<&FF):bA$+=
(wF%?lD%):lD%+=1:
:=bA$
shell_GetEventHandler(b%,AA%,WC%):
e%,i%,j%,p%,A$:
b%=-1
b%=-2
shell_HeapBlockInfo(_U%!&C)-8:e%=0:j%=
:i%=_U%!&C:A$="":
(i%!e%=b%)
i%!(e%+4)
i%!(e%+(&C+(WC%*4)))>&8000
#A$=$(i%!(e%+(&C+(WC%*4)))):j%=
e%+=48
i%!(e%+4)=AA%
i%!(e%+(&C+(WC%*4)))>&8000
#A$=$(i%!(e%+(&C+(WC%*4)))):j%=
e%+=48
e%+=48
e%+=48
((e%>=p%)
j%):=A$
shell_GetEventMenu(vB%,b%,AA%):
e%,i%,j%,p%,m%:
b%=-1
b%=-2
shell_HeapBlockInfo(_U%!&C)-8:e%=0:j%=
:i%=_U%!&C:A$="":
(i%!e%=b%)
shell_Tracef0("GetEventMenu:window handle matched.."):
i%!(e%+4)=AA%
"m%=i%!(e%+8):
m%=-2
m%=_U%!&FC
:e%+=48:
(e%>=p%
j%):=m%
shell_GetEventListOffset(b%,f%,i%,MB%,CD%):
p%,e%,j%,d%,NB%,c%:
(!i%=0
(!i%=0)
>:!i%=
shell_HeapBlockFetch(MB%):c%=!i%:c%!0=0:c%!4=0:=0
shell_HeapBlockInfo(!i%)-8:e%=0:j%=
:d%=-1:NB%=-1:c%=!i%:
NB%<0
(c%!e%=0
c%!e%+4=0)
NB%=e%
(c%!e%=b%)
f%=-1
d%=e%:j%=
shell_Tracef0("GetEventListOffset:icon handle is not -1"):
c%!(e%+4)=f%
d%=e%:j%=
e%+=MB%
e%+=MB%
((e%>=p%)
(d%=-1
NB%<0
oId%=p%:!i%=
shell_HeapBlockExtend(!i%,MB%):c%=!i%:c%+=d%:c%!0=0:c%!4=0
d%=NB%
shell_AttachPane(b%,
HD%,l%,pA%,rA%):
a%,d%,c%,VB%,IE%:
shell_Tracef0("AttachPane:Attaching Pane Handler"):IE%=
shell_WindowGetFlags(HD%):
1<<5)=0
shell_Tracef0("AttachPane:'Pane' bit of pane window is not set, fixing.."):
shell_WindowToggleFlags(HD%,1<<5)
1<<1)
shell_Tracef0("AttachPane:'Moveable' bit of pane window is set, fixing.."):
shell_WindowToggleFlags(HD%,1<<1)
shell_GetEventListOffset(b%,-1,_U%+92,24,
shell_Tracef0("AttachPane:Creating pane event block"):d%=
shell_GetEventListOffset(b%,-1,_U%+92,24,
):a%=_U%!92+d%:a%!0=b%:a%!4=-1:a%!8=
shell_HeapBlockFetch(4):a%!&C=
shell_HeapBlockFetch(4):a%!16=
shell_HeapBlockFetch(4)
aa%!20=
shell_HeapBlockFetch(4):c%=a%!8:!c%=-1:c%=a%!&C:!c%=-1:c%=a%!16:!c%=-1:c%=a%!20:!c%=-1
:a%=_U%!92+d%:c%=a%!8:g%=0:VB%=0:
c%!g%<>-1:g%+=4:VB%+=1:
:a%!8=
shell_HeapBlockExtend(a%!8,4):c%=a%!8:c%!(VB%*4)=HD%:c%!((VB%+1)*4)=-1:a%!&C=
shell_HeapBlockExtend(a%!&C,4):c%=a%!&C:c%!(VB%*4)=l%:c%!((VB%+1)*4)=-1
a%!16=
shell_HeapBlockExtend(a%!16,4):c%=a%!16:c%!(VB%*4)=pA%:c%!((VB%+1)*4)=-1:a%!20=
shell_HeapBlockExtend(a%!20,4):c%=a%!20:c%!(VB%*4)=rA%:c%!((VB%+1)*4)=-1:
shell_AttachDataLoad(b%,f%,x%,A$,gF%):
a%,c%,d%,P$:
shell_Tracef0("AttachDataLoad:Attaching DataLoad Handler"):
b%=-1
b%=-2
x%=x%
1<<31
x%=-1
shell_GetEventListOffset(b%,f%,_U%+96,16,
):a%=_U%!96+d%:
a%!0=0
a%!4=0
shell_Tracef0("AttachDataLoad:This is the first DataLoad Event..."):a%!0=b%:a%!4=f%:
x%<>-1
9a%!8=
shell_HeapBlockFetch(8):c%=a%!8:c%!0=x%:c%!4=-1
a%!8=-1
:a%!&C=
shell_HeapBlockFetch(8):c%=a%!&C:c%!0=
shell_HeapBlockFetch(
(A$)+1):c%!4=-1:c%=c%!0:$c%=A$
shell_Tracef0("AttachDataLoad:This is another DataLoad Event..."):
x%=-1
shell_HeapBlockReturn(a%!8):
shell_HeapBlockReturn(a%!&C):a%!8=-1:c%=a%!&C:!c%=
shell_HeapBlockFetch(
A$+1):c%=!c%:$c%=A$
a%!8=
shell_HeapBlockExtend(a%!8,4):a%!&C=
shell_HeapBlockExtend(a%!&C,4):g%=0:c%=a%!8:
c%!g%<>-1:g%+=4:
:c%!g%=x%:c%!(g%+4)=-1:c%=a%!&C:c%!g%=
shell_HeapBlockFetch(
A$+1):c%=c%!g%:$c%=A$
shell_GetCmdLineArgs:
shell_Tracef0("AttachDataLoad:cmdline ="+P$):
shell_Tracef0("AttachDataLoad:flag bit ="+
((_U%!&64
1<<5))):
shell_Tracef0("AttachDataLoad:wh% ="+
~b%):
shell_Tracef0("AttachDataLoad:type% ="+
P$<>""
(_U%!&64
1<<5)
1<<31
c%=x%
1<<31
c%=x%
shell_FileType(P$)=c%
shell_Tracef0("AttachDataLoad:Loading file.."):
shell_MessageSendDataLoad(c%,P$):_U%!&64=_U%!&64
(1<<5)
shell_AttachDataSave(b%,f%,XB%,x%,HC%,A$):
a%,c%,d%:
shell_IconIsSprite(b%,f%)
shell_OK(
shell_MessageNoArgs("SHELLMSG29"))
shell_IconSetButtonType(b%,f%,6):
XB%=0
XB%=&64
shell_Tracef0("AttachDataSave:Attaching DataSave Handler to icon "+
f%+" in window &"+
~b%):
shell_Tracef0("AttachDataSave:Handler function is '"+A$+"'"):d%=
shell_GetEventListOffset(b%,f%,_U%+72,24,
):a%=_U%!72+d%:a%!0=b%:a%!4=f%:a%!8=XB%:a%!&C=x%
Ha%!16=HC%:a%!20=
shell_HeapBlockFetch(
(A$)+1):c%=a%!20:$c%=A$:
&FF9:
XB%>&8000
'_U%!&88=
shell_HeapBlockInfo(XB%)-8
_U%!&88=XB%
XB%>&8000
%'_U%!&88=
shell_HeapBlockInfo(XB%)-4
_U%!&88=XB%
:_U%!&8C=x%:_U%!&90=XB%:
shell_AttachMenu(b%,AA%,m%,GB%,IB%,BC%):
AA%>=0
shell_IconSetButtonType(b%,AA%,3)
shell_IsWindowStatic(b%)=
shell_OK(
shell_MessageNoArgs("SHELLMSG30"))
shell_Tracef0("AttachMenu:Attaching menu handle &"+
~m%+" to window handle &"+
~b%):
shell_EventAdd(b%,AA%,0,m%,""):
shell_AttachMenuMaker(b%,AA%,A$):
shell_Tracef0("AttachMenuMaker:Attaching menumaker function '"+A$+"'"):
shell_EventAdd(b%,AA%,1,0,A$):
shell_AttachMenuDBox(ZB%,e$,cA$,WA$):
a%,c%,JB%:
shell_WindowLoaded(e$)
shell_MessageOneArg("SHELLMSG03",e$)
shell_HeapBlockFetch(&C):a%!0=
shell_HeapBlockFetch(
e$+1):c%=a%!0:$c%=e$:a%!4=
shell_HeapBlockFetch(
cA$+1):c%=a%!4:$c%=cA$:a%!8=
shell_HeapBlockFetch(
WA$+1):c%=a%!8:$c%=WA$:
&45BCE,ZB%,a%:
&45BCC,,
shell_AttachClickSelect(b%,AA%,A$):
shell_EventAdd(b%,AA%,2,0,A$):
shell_AttachClickAdjust(b%,AA%,A$):
shell_EventAdd(b%,AA%,3,0,A$):
shell_AttachUserRedraw(
b%,A$):
a%,XA%:a%=
shell_HeapBlockFetch(40):!a%=b%:
&400CB,,a%:XA%=a%!32:
shell_HeapBlockReturn(a%):
1<<4)
shell_Tracef0("AttachUserRedraw:auto redraw set!!"):
shell_WindowToggleFlags(b%,1<<4)
shell_EventAdd(b%,-1,4,0,A$):
shell_AttachDrag(b%,AA%,ZH%,A$):
shell_EventAdd(b%,AA%,6,0,A$):
shell_AttachHelpTag(b%,AA%,G$):
shell_EventAdd(b%,AA%,8,0,G$):
shell_EventAdd(b%,AA%,WC%,m%,A$):
e%,FC%,i%,p%,j%:
TD%:e%=0:j%=
b%=-1
b%=-2
shell_HeapBlockInfo(_U%!&C)-8:i%=_U%!&C:
(i%!e%=b%)
i%!(e%+4)=AA%
e%+=48
e%+=48
(e%>=p%
%e%=0:
(i%!e%<>0):e%+=48:
e%>=p%
_U%!&C=
shell_HeapBlockExtend(_U%!&C,48):i%=_U%!&C:i%!(e%+0)=0:i%!(e%+4)=0:i%!(e%+8)=0:i%!(e%+&C)=0:i%!(e%+16)=0:i%!(e%+20)=0:i%!(e%+24)=0:i%!(e%+28)=0:i%!(e%+32)=0:i%!(e%+36)=0:i%!(e%+40)=0:i%!(e%+44)=0
:i%!(e%+0)=b%:i%!(e%+4)=AA%:
m%<>0
i%!(e%+8)=m%
:TD%=e%+(&C+(WC%*4)):
i%!TD%<>0
shell_HeapBlockReturn(i%!TD%)
:FC%=
shell_HeapBlockFetch(
A$+1):$FC%=A$:i%!TD%=FC%:
shell_EventDeleteAll(b%):
e%,m%,j%,p%,i%,_%:e%=0:m%=0:j%=
b%=-1
b%=-2
shell_HeapBlockInfo(_U%!&C)-8:i%=_U%!&C:
(i%!e%=b%)
e%+=48
(e%>=p%
Ci%!(e%+0)=0:i%!(e%+4)=0:i%!(e%+8)=0:
_%=&C
i%!(e%+_%)<>0
shell_HeapBlockReturn(i%!(e%+_%)):i%!(e%+_%)=0
shell_Tracef0("EventDeleteAll:wh%=&"+
~b%):
shell_DeleteEventDataSave(b%,-1):
shell_DeleteEventBump(b%,-1):
shell_DeleteEventSlider(b%,-1):
shell_DeleteEventBump(b%,f%):
d%,a%,p%,i%,c%:i%=_U%!&68:
shell_GetEventListOffset(b%,f%,_U%+&68,16,
shell_Tracef0("DeleteEventBump:offset%="+
d%>=0
f%=-1
shell_Tracef0("DeleteEventBump:Deleting Bump Event (all events for window handle &"+
~b%+")")
shell_Tracef0("DeleteEventBump:Deleting Bump Event (window handle was &"+
~b%+" icon handle was "+
f%+")")
shell_HeapBlockInfo(_U%!&68)-8:
d%=p%-16
UA%=i%!&C:c%=UA%!&C:
shell_HeapBlockReturn(c%!&C):
shell_HeapBlockReturn(c%!16):
shell_HeapBlockReturn(c%):
shell_HeapBlockReturn(_U%!&68):_U%!&68=0:
shell_Tracef0("DeleteEventBump:No Bump events now registered")
_U%!&68=
shell_HeapBlockExtend(_U%!&68,-16)
a%=i%+d%:a%!0=0:a%!4=0:a%!8=0:UA%=a%!&C:
shell_HeapBlockReturn(UA%!&C):
shell_HeapBlockReturn(UA%!16):
shell_HeapBlockReturn(UA%)
d%<0:
shell_DeleteEventDataSave(b%,f%):
d%,a%,p%:
shell_GetEventListOffset(b%,f%,_U%+72,24,
d%>=0
f%=-1
shell_Tracef0("DeleteEventDataSave:Deleting DataSave Event (all events for window handle &"+
~b%+")")
shell_Tracef0("DeleteEventDataSave:Deleting DataSave Event (window handle was &"+
~b%+" icon handle was "+
f%+")")
shell_HeapBlockInfo(_U%!72)-8:
d%=p%-24
shell_HeapBlockReturn(_U%!72):_U%!72=0:
shell_Tracef0("DeleteEventDataSave:No DataSave events now registered")
_U%!72=
shell_HeapBlockExtend(_U%!72,-24)
a%=i%+d%:a%!0=0:a%!4=0:a%!8=0:a%!&C=0:a%!16=0:
shell_HeapBlockReturn(a%!20):a%!20=0
d%<0:
shell_MessageNoArgs(G$):=
shell_MessageLookup(G$,"","")
shell_MessageOneArg(G$,o$):=
shell_MessageLookup(G$,o$,"")
shell_MessageTwoArgs(G$,o$,DA$):=
shell_MessageLookup(G$,o$,DA$)
shell_MessageLookup(G$,o$,DA$):
l%,L%,k$,gC%,QC%:
G$,8)="SHELLMSG"
gC%=_U%!284:QC%=_U%!280
gC%=_U%!64:QC%=_U%!68
&61502,QC%,G$,gC%,256,o$,DA$
,,,L%;l%:
gC%?L%=&D:k$=$(gC%)
shell_WimpInit(hC%,SA$):
&400C0,hC%,&4B534154,SA$
hC%,kA%:
_U%!&64
"WimpExt_Initialise",&E,kA%
:_U%!&94=kA%:=kA%
shell_WimpInit_I(hC%,SA$):
&400C0,hC%,&4B534154,SA$
hC%,kA%:
_U%!&64
"WimpExt_Initialise",&E,kA%
:_U%!&94=kA%:
&81682,kA%:=kA%
shell_WimpCloseDown_I(kA%):
shell_LoseFonts:
_U%!&F0<>-1
"XFontMenu_Release"
_U%!&64
"WimpExt_Initialise",&E,kA%
&600DD,kA%,&4B534154:
&A1683,kA%:
_U%!&64
&628C5,_U%!&94
WimpCloseDown(kA%):
shell_LoseFonts:
_U%!&F0<>-1
"XFontMenu_Release"
_U%!&64
"WimpExt_Initialise",&E,kA%
&600DD,kA%,&4B534154:
_U%!&64
&628C5,_U%!&94
("Unset "+_shell_AppName$+"$BasicFile"):
shell_LoseFonts:
_%,c%:c%=_U%!&E8:
c%?_%>0:
&40082,_%:c%?_%-=1:
shell_FindFont(f$,lG%):
XA%,oD%:oD%=_U%!&E8:
&40081,,f$,lG%*16,d*16,0,0
XA%:oD%?XA%+=1:
oD%?XA%>=&FF
shell_OK(
shell_MessageNoArgs("SHELLMSG18"))
shell_Init:
tA%,_%,c%,P$:
xA%,C$,D$,UD%:
shell_DefineConstants:_SHELL_SENDDATALOAD_MY_REF%=0:_SHELL_SENDDATALOAD_FILE$="":
_U%360,_shell_blk%260:_Q%=
shell_HeapBlockFetch(&BB8):tA%=
shell_HeapBlockFetch(48):tA%!0=0:tA%!4=0:tA%!8=0:tA%!&C=0:tA%!16=0
tA%!20=0:tA%!24=0:tA%!28=0:tA%!32=0:tA%!36=0:tA%!40=0:tA%!44=0:_U%!0=0:_U%!4=0:_U%!8=0:_U%!&C=tA%:_U%!16=1:_U%!20=0:_U%!24=0:_U%!28=0:_U%!32=-1:_U%!36=0:_U%!40=0:_U%!44=-1:_U%!48=0:_U%!52=0:_U%!56=0:_U%!60=0:_U%!64=0:_U%!68=0:_U%!72=0
_U%!76=
shell_HeapBlockFetch(256):_U%!80=0:_U%!84=-1:_U%!88=0:_U%!92=0:_U%!96=0:_U%!&64=0:_U%!&68=0:_U%!&6C=-1:_U%!&70=-1:_U%!&74=-1:_U%!&78=-1:_U%!&7C=-1:_U%!&80=0:_U%!&84=0:_U%!&88=-1:_U%!&8C=-1:_U%!&90=-1:_U%!&94=0:_U%!&98=0:_U%!&9C=0:_U%!&A0=0
_U%!&A4=0:_U%!&A8=0:_U%!&AC=0:_U%!&B0=0:_U%!&B4=0:_U%!&B8=0:_U%!&BC=0:_U%!&C0=0:_U%!&C4=0:_U%!&C8=0:_U%!&CC=0:_U%!&D0=-1:_U%!&D4=-1:_U%!&D8=0:_U%!&DC=0:_U%!&E0=0:_U%!&E4=0:_U%!&E8=
shell_HeapBlockFetch(256):_U%!&EC=
shell_HeapBlockFetch(256)
_U%!&F0=-1:_U%!&F4=0:_U%!&F8=0:_U%!&FC=0:_U%!256=0:_U%!260=1:_U%!264=0:_U%!268=0:_U%!272=0:_U%!276=0:_U%!280=0:_U%!284=0:_U%!288=-1:_U%!292=-1:_U%!296=-1:_U%!300=0:_U%!304=0:_U%!308=0:_U%!312=0:_U%!316=0:_U%!320=0:_U%!324=0:_U%!328=0:_U%!332=0
_U%!336=0:_U%!340=0:_U%!344=0:
shell_MemFill(_U%!&E8,256,0):
shell_MemFill(_U%!&EC,256,0):xA%=
shell_HeapBlockFetch(256):C$=
shell_OSVarGetVal(xA%,256,"Obey$Dir",1):
shell_HeapBlockReturn(xA%):D$=
shell_Leaf(C$),2)
_U%!&BC=
shell_HeapBlockFetch((
C$)+1):_U%!&C4=
shell_HeapBlockFetch((
D$)+1):c%=_U%!&BC:$c%=C$:c%=_U%!&C4:$c%=D$:P$=
shell_OSReadCommandArg(1):
P$<>""
dL_U%!&64=_U%!&64
1<<5:c%=
shell_HeapBlockFetch(
P$+1):$(c%)=P$:_U%!324=c%
shell_OSModuleCheckVersion("WimpExtension",1.98):
_U%!&64=_U%!&64
n/c%=
RO3_Present:
_U%!&64=_U%!&64
1<<&A
_U%!&64=_U%!&64
1<<&C:UD%=&64:
shell_PollSetInterval(UD%):
shell_PollSetPrevInterval(UD%):
jD%:jD%+=UD%:
shell_InitModules:
shell_InitModules:
k%:k%=
_shell_StaticList_Init:
shell_GetCmdLineArgs:
_U%!324<>0
P$=$(_U%!324)
shell_Tracef0("GetCmdLineArgs:cmdline was "+P$):=P$
shell_FileType(a$):
8,5,a$
,,x%:x%=(x%
&FFF00)>>>8:=x%
shell_FileExists(a$):
x%,C:C=5:
8,C,a$
shell_CatInfoRead(a$):
x%,ND%,YD%,LB%,ZC%,B$:
8,5,a$
x%,,ND%,YD%,LB%,ZC%:
="Not Found"
ZC%=51
B$+="WR "
ZC%=&BB
B$+="LWR"
ZC%=&88
B$+="DL "
B$+=" "+
shell_StringPadLeading(
~ND%,"0",8):B$+=" "+
shell_StringPadLeading(
~YD%,"0",8):B$+=" "+
shell_StringPadLeading(
~LB%,"0",8):=B$
shell_FileGetDateStamp(a$):
x%,iF%,C:C=5:
8,C,a$
x%,,,iF%:
shell_GetAppDir:
c%:c%=_U%!&BC:=$c%
shell_GetAppDataDir:
c%:c%=_U%!&C0:=$c%
shell_GetAppName:
c%:c%=_U%!&C4:=$c%
shell_ResourcesInit:
IA$,c%,D$,C$,iD%:
xA%,PC%,wC%:D$=
shell_GetAppName:C$=
shell_GetAppDir:xA%=
shell_HeapBlockFetch(256):
shell_OSVarExists(xA%,D$+"Res$Path")
_U%!&64=_U%!&64
shell_OSVarExists(xA%,D$+"Data$Dir")
nIA$=
shell_OSVarGetVal(xA%,256,D$+"Data$Dir",1):_U%!&C0=
shell_HeapBlockFetch((
IA$)+1):c%=_U%!&C0:$c%=IA$
_U%!&C0=
shell_HeapBlockFetch((
C$)+1):c%=_U%!&C0:$c%=C$
_U%!&64
shell_FileExists(D$+"Res:Messages")
shell_MessagesInit(D$+"Res:Messages",_U%!68,_U%!64)
shell_FileExists(D$+"Res:ShellMsgs")
shell_MessagesInit(D$+"Res:ShellMsgs",_U%!280,_U%!284)
shell_MessagesInit("EvntShellRes:ShellMsgs",_U%!280,_U%!284)
&20035,-1,4
,,wC%:
&20035,-1,5
,,PC%:
PC%=1
shell_FileExists(D$+"Res:Sprites22")
4_U%!16=
shell_SpriteAreaLoad(D$+"Res:Sprites22")
shell_FileExists(D$+"Res:Sprites")
2_U%!16=
shell_SpriteAreaLoad(D$+"Res:Sprites")
_U%!16=1
:iD%=
shell_3DEnabled:
shell_FileExists(D$+"Res:Templates3")
shell_TemplatesInit(D$+"Res:Templates3",k%)
shell_FileExists(D$+"Res:Templates")
shell_TemplatesInit(D$+"Res:Templates",k%)
shell_FileExists(C$+".Messages")
shell_MessagesInit(C$+".Messages",_U%!68,_U%!64)
shell_FileExists(C$+".ShellMsgs")
shell_MessagesInit(C$+".ShellMsgs",_U%!280,_U%!284)
shell_MessagesInit("EvntShellRes:ShellMsgs",_U%!280,_U%!284)
&20035,-1,4
,,wC%:
&20035,-1,5
,,PC%:
PC%=1
shell_FileExists(C$+".Sprites22")
41_U%!16=
shell_SpriteAreaLoad(C$+".Sprites22")
shell_FileExists(C$+".Sprites")
7/_U%!16=
shell_SpriteAreaLoad(C$+".Sprites")
_U%!16=1
:iD%=
shell_3DEnabled:
shell_FileExists(C$+".Templates3")
shell_TemplatesInit(C$+".Templates3",k%)
shell_FileExists(C$+".Templates")
shell_TemplatesInit(C$+".Templates",k%)
&45BC0:
shell_HeapBlockReturn(_Q%):_Q%=
shell_HeapBlockFetch(&400):
shell_HeapBlockReturn(xA%):
shell_SpriteAreaLoad(I$):
nB%,S%,T%:S%=
(I$):T%=
#S%+16:
#S%:nB%=
shell_HeapBlockFetch(T%):!nB%=T%:nB%!4=0:nB%!8=16:nB%!&C=16:
46,521,nB%:
46,522,nB%,I$:
shell_Tracef0("SpriteLoad:Sprite file loaded at &"+
~nB%):=nB%
shell_UserSpritesBase:=_U%!16
shell_SpriteGetPtr(aC%,R$):
gB%,e%:gB%=
shell_HeapBlockFetch(21):$gB%=R$:
46,280,aC%,gB%
,,e%:
shell_HeapBlockReturn(gB%):=e%
shell_MessageExpand(h$):
L$,k$,CB%:L$="":
h$,"\")>0:CB%=
h$,"\"):L$+=
h$,CB%-1):k$=
h$,CB%+1,1):h$=
h$,CB%+2):
"A":L$+="Click ADJUST to"
"a":L$+="ADJUST"
"D":L$+="Drag with SELECT to"
"d":L$+="Drag with ADJUST to"
"G":L$+="This option is greyed out because"
"R":L$+="Move the pointer right"
"S":L$+="Click SELECT to"
"s":L$+="SELECT"
"T":L$+="This is the"
"W":L$+="This window is"
"w":L$+="window"
L$+="\"+k$
:=L$+h$
shell_OpenMenu(NA%,TA%,DB%):
A$:A$=
shell_GetEventHandler(_U%!28,_U%!32,1):
A$<>""
shell_Tracef0("OpenMenu:About to call "+"FN"+A$+"("+
_U%!28+","+
_U%!32+")"):k%=
("FN"+A$+"(_U%!28,_U%!32)")
shell_Tracef0("OpenMenu:no menumaker function registered")
DB%<>_U%!24
shell_HeapBlockExists(_U%!256)
shell_HeapBlockReturn(_U%!256):_U%!256=0
shell_HeapBlockExists(_U%!&F4)
shell_HeapBlockReturn(_U%!&F4):_U%!&F4=0
DB%=_U%!&FC
&400D4,,DB%,NA%-64,TA%:_U%!264=1
_Q%!0=NA%:_Q%!4=TA%:
&45BC5,DB%,_Q%:_U%!264=0
:_U%!24=DB%:_U%!36=NA%:_U%!40=TA%:_U%!52=_U%!28:_U%!56=_U%!32:
shell_MenuLastXPos:=_U%!36
shell_MenuLastYPos:=_U%!40
shell_MenuAttachDbox(i$):
"Menu_SetSubHandle",_U%!8,
shell_MenuString(i$),1:
shell_Tracef0("MenuAttachDbox:Dialog box ("+i$+") attached"):
shell_MessageWindow(H$,qG%,pA$,v$):
JE%,FB%:FB%=
shell_HeapBlockFetch(260):!FB%=0:$(FB%+4)=H$+
v$=""
v$="Message from "+pA$
&400DF,FB%,19,v$
&400DF,FB%,17,v$
shell_HeapBlockReturn(FB%):=JE%
shell_CreateWindow(gA$,
OC%:OC%=
shell_GetWB(gA$):OC%!64=_U%!16:
&400C1,,OC%
shell_CreateWindow2(N,l%,WH%,jG%,MH%,uA%,qD%,nA%,YB%,kB%):
Q%:Q%=
shell_HeapBlockFetch(&BB8):Q%!0=qD%:Q%!4=nA%:Q%!8=YB%:Q%!&C=kB%:Q%!16=0:Q%!20=0:Q%!24=-1:Q%!28=l%:Q%?32=7:Q%?33=2:Q%?34=WH%:Q%?35=jG%:Q%?36=3:Q%?37=1:Q%?38=2:Q%?39=0:Q%!40=0:Q%!44=uA%
Q%!48=MH%:Q%!52=0:Q%!56=317:Q%!60=&3000:Q%!68=1:Q%!72=N:Q%!76=-1:Q%!80=
$N:Q%!84=0:
&400C1,,Q%
shell_HeapBlockReturn(Q%):=h%
shell_WindowHasTitleBar(b%):=(
shell_WindowGetFlags(b%)
1<<26)
shell_WindowIsMoveable(b%):=(
shell_WindowGetFlags(b%)
1<<1)
shell_WindowIsAPane(b%):=(
shell_WindowGetFlags(b%)
1<<5)
shell_WindowIsNotBounded(b%):=(
shell_WindowGetFlags(b%)
1<<6)
shell_WindowTrapsHotKeys(b%):=(
shell_WindowGetFlags(b%)
1<<&C)
shell_WindowIsOpen(b%):=(
shell_WindowGetFlags(b%)
1<<16)
shell_WindowIsOnTop(b%):=(
shell_WindowGetFlags(b%)
1<<17)
shell_WindowHasBeenToggled(b%):=(
shell_WindowGetFlags(b%)
1<<18)
shell_WindowHasInputFocus(b%):=(
shell_WindowGetFlags(b%)
1<<20)
shell_WindowHasBackIcon(b%):=(
shell_WindowGetFlags(b%)
1<<24)
shell_WindowHasCloseIcon(b%):=(
shell_WindowGetFlags(b%)
1<<25)
shell_WindowHasToggleIcon(b%):=(
shell_WindowGetFlags(b%)
1<<27)
shell_WindowHasVScrollBar(b%):=(
shell_WindowGetFlags(b%)
1<<28)
shell_WindowHasAdjustSizeIcon(b%):=(
shell_WindowGetFlags(b%)
1<<29)
shell_WindowHasHScrollBar(b%):=(
shell_WindowGetFlags(b%)
1<<30)
shell_WindowGetFlags(b%):
l%,a%:a%=
shell_HeapBlockFetch(36):a%!0=b%:
&400CB,,a%:l%=a%!32:
shell_HeapBlockReturn(a%):=l%
shell_WindowGetTitleFlags(b%):
l%,a%:a%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):a%!0=b%:
&400CC,,a%:l%=a%!60:
shell_HeapBlockReturn(a%):=l%
shell_IconGetFlags(b%,f%):
l%,a%:a%=
shell_HeapBlockFetch(50):a%!0=b%:a%!4=f%:
&400CE,,a%:l%=a%!24:
shell_HeapBlockReturn(a%):=l%
shell_WindowTitleFlags(b%):
l%,a%:a%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):a%!0=b%:
&400CC,,a%:l%=a%!60:
shell_HeapBlockReturn(a%):=l%
shell_WindowTitleHasBorder(b%):=(
shell_WindowTitleFlags(b%)
1<<2)
shell_WindowTitleIsSprite(b%):=(
shell_WindowTitleFlags(b%)
1<<1)
shell_WindowTitleIsText(b%):=(
shell_WindowTitleFlags(b%)
1<<0)
shell_WindowTitleIsHCentred(b%):=(
shell_WindowTitleFlags(b%)
1<<3)
shell_WindowTitleIsVCentred(b%):=(
shell_WindowTitleFlags(b%)
1<<4)
shell_WindowTitleIsFilled(b%):=(
shell_WindowTitleFlags(b%)
1<<5)
shell_WindowTitleIsAAliased(b%):=(
shell_WindowTitleFlags(b%)
1<<6)
shell_WindowTitleIsIndirected(b%):=(
shell_WindowTitleFlags(b%)
1<<8)
shell_WindowGetTitle(b%):
T$,a%:a%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):a%!0=b%:
&400CC,,a%:
(a%!32
1<<26)
((a%!60)
256)=0
T$=$(a%+76)
T$=$(!(a%+76))
shell_HeapBlockReturn(a%):=T$
shell_WindowTitleBufferLength(b%):
y%,a%:a%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):a%!0=b%:
&400CC,,a%:
((a%!60)
256)=0
y%=&C
y%=a%!84
shell_HeapBlockReturn(a%):=y%
shell_WindowMoveToIcon(b%,sE%,f%,pA%,rA%):
r%,o%:r%=
shell_HeapBlockFetch(50):o%=
shell_HeapBlockFetch(36):o%!20=0:
shell_OSCheckVersion(3)
sE%=-1
!o%=-2
!o%=sE%
&400CB,,o%
:r%!0=sE%:r%!4=f%:
&400CE,,r%:
shell_WindowMoveTo(b%,r%!8+pA%-o%!20,r%!20+rA%):
shell_HeapBlockReturn(r%):
shell_HeapBlockReturn(o%):
shell_WindowMoveTo(b%,NA%,TA%):
sF%,qF%,d%,a%:a%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):a%!0=b%:
&400CC,,a%:sF%=a%!&C-a%!4:qF%=a%!16-a%!8:a%!4=NA%:a%!8=TA%:a%!&C=NA%+sF%:a%!16=TA%+qF%:
&400C5,,a%:
&400C6,,a%
shell_IsWindowStatic(b%)
shell_OpenWindowStatic(b%)
shell_OpenWindowDynamic2(b%,0,0)
shell_HeapBlockReturn(a%):
shell_WindowBringToTop(b%):
MC%:MC%=
shell_HeapBlockFetch(256):MC%!0=b%:
&400CB,,MC%:MC%!28=-1:
&400E7,2,MC%,b%:
&400C7,0,MC%:
shell_HeapBlockReturn(MC%):
shell_UpdateWindow(h%,qD%,nA%,YB%,kB%):
a%:a%=
shell_HeapBlockFetch(60):a%!0=h%:a%!4=qD%:a%!8=nA%:a%!&C=YB%:a%!16=kB%:
&400C9,,a%
&400CB,,a%:
shell_HeapBlockReturn(a%):
shell_OpenWindowDynamic2(b%,pA%,rA%):
k%,SB%:SB%=
shell_HeapBlockFetch(20):_U%!20=b%:
&400CF,,SB%:
&400D4,,b%,SB%!0+pA%,SB%!4+rA%:
shell_HeapBlockReturn(SB%):
shell_ClaimKeypress:
_U%!20<>0
&400D4,,-1:k%=
shell_DeleteWindow(_U%!20):_U%!20=0
shell_OpenWindow(b%,uE%,fC%):
d%,a%,w%,g%,QG%,KB%,dA%,vA%:
SC%,eC%,kB%,zF%,MF%,nC%,oC%:d%=
shell_GetEventListOffset(b%,-1,_U%+304,&C,
d%>=0
Gga%=_U%!304+d%:c%=a%!8:
shell_Tracef0("OpenWindow:About to call "+"FN"+$c%):nC%=
("FN"+$c%):
nC%=0
:eC%=
:kB%=
shell_HeapBlockFetch(40):kB%!0=b%:
&400CB,,kB%:
(kB%!32
&80000)=&80000
shell_HeapBlockReturn(kB%):oC%=
shell_HeapBlockFetch(20):
&400CF,,oC%:_Q%!0=b%:
&400CB,,_Q%
&400C5,,_Q%
shell_GetEventListOffset(b%,-1,_U%+92,24,
d%>-1
aJa%=(_U%!92)+d%:VC%=a%!8:_D%=a%!&C:JC%=a%!16:bC%=a%!20:_Q%!0=b%:
fC%>0
KB%=fC%
KB%=-1
KB%=_Q%!28
&400C5,,_Q%:
&400CB,,_Q%:
&400C6,,_Q%
shell_HeapBlockFetch(40):g%=0:
VC%!g%<>-1:w%!0=VC%!g%:
QG%=0
QG%=w%!0
{7zF%=w%!0:
&400CB,,w%:
oC%!16=-9
oC%!16>-5
SC%=_D%!g%:
0,1:dA%=w%!16-w%!8:vA%=w%!&C-w%!4:w%!4=_Q%!4+JC%!g%:w%!&C=w%!4+vA%:w%!16=_Q%!16+bC%!g%:w%!8=w%!16-dA%
2:dA%=w%!16-w%!8:vA%=_Q%!&C-_Q%!4:w%!4=_Q%!4+JC%!g%:w%!&C=_Q%!&C:w%!16=_Q%!16+bC%!g%:w%!8=w%!16-dA%
3:dA%=_Q%!16-_Q%!8:vA%=w%!&C-w%!4:w%!4=_Q%!4+JC%!g%:w%!&C=w%!4+vA%:w%!16=_Q%!16:w%!8=_Q%!8+bC%!g%
4:dA%=w%!16-w%!8:vA%=_Q%!&C-_Q%!4:w%!4=_Q%!4+JC%!g%:w%!&C=_Q%!&C:w%!16=_Q%!8+dA%+bC%!g%:w%!8=w%!16+dA%
5:dA%=_Q%!16-_Q%!8:vA%=w%!&C-w%!4:w%!4=_Q%!&C-vA%+JC%!g%:w%!&C=w%!4+vA%:w%!16=_Q%!16:w%!8=_Q%!8
w%!28=KB%
w%!28=MF%
&400C5,,w%
:MF%=w%!0:g%+=4:
_Q%!28=zF%:
&400C5,,_Q%
shell_HeapBlockReturn(w%)
_Q%!0=b%:
&400CB,,_Q%
KB%=-2
_Q%!28=-2
fC%=-1
_Q%!28=-1
&400C5,,_Q%
shell_HeapBlockReturn(oC%):
shell_CloseWindow(b%):
d%,a%,VC%,_D%,JC%,bC%,q%,nC%:d%=
shell_GetEventListOffset(b%,-1,_U%+308,&C,
d%>=0
ha%=_U%!308+d%:c%=a%!8:
shell_Tracef0("CloseWindow:About to call "+"FN"+$c%):nC%=
("FN"+$c%):
nC%=0
shell_HeapBlockFetch(60):
shell_GetEventListOffset(b%,-1,_U%+92,24,
d%>-1
la%=(_U%!92)+d%:_D%=a%!&C:JC%=a%!16:bC%=a%!20:g%=0:VC%=a%!8:
VC%!g%<>-1:q%!0=VC%!g%:
&400C6,,q%:g%+=4:
:q%!0=b%:
&400C6,,q%
shell_HeapBlockReturn(q%):
shell_GetDynamicWindowHandle:=_U%!20
shell_DeleteWindow(h%):
q%:q%=
shell_HeapBlockFetch(20):
h%<>0
oktodeletew(h%)
shell_EventDeleteAll(h%):
shell_RemoveHandleFromWindowList(h%):
h%=_U%!20
_U%!20=0
shell_RemoveStaticWindowFromList(h%)
:q%!0=h%:
&400C3,,q%:h%=0
shell_HeapBlockReturn(q%):=h%
oktodeletew(h%):=-1
oktoclosew(h%):=-1
cliprect(A,
oG%):
SA%,VA%:
lwaorigin(A,SA%,VA%):eA%=A!24-SA%:oA%=A!28-VA%:UH%=A!32-SA%:oG%=A!36-VA%:
poll(NC%,LE%):
_U%!&64
"WimpExt_PrePoll"
&400C7,NC%,_Q%
_U%!&64
"WimpExt_Action",_U%!&94,_Q%,RA%
shell_Poll_I(NC%,LE%):
_U%!&64
"WimpExt_PrePoll"
&400C7,NC%,_Q%
_U%!&64
"WimpExt_Action",_U%!&94,_Q%,xB%
&81686,xB%,,LE%:=xB%
shell_PollIdle(NC%,LE%):
_U%!&64
"WimpExt_PrePoll"
&400E1,NC%,_Q%,jD%
_U%!&64
"WimpExt_Action",_U%!&94,_Q%,xB%
shell_PollSetInterval(aE%):jF%=aE%:
shell_PollSetPrevInterval(aE%):JH%=aE%:
shell_PollReadInterval:=jF%
shell_PollReadPrevInterval:=JH%
shell_DoBackgroundTask:
shell_IconIsDraggable(b%,f%):
l%:l%=
shell_IconGetFlags(b%,f%):c%=(l%
&6000):
c%=&6000=
shell_IconIsSprite(b%,f%):
l%,c%:l%=
shell_IconGetFlags(b%,f%):c%=(l%
1<<1):
c%=(1<<1)
shell_IconDragBox(b%,f%):
a%,I,J,wA%,l%,XA%,hF%,UF%,XC%,FA$:
HC%,R$:wA%=
shell_GetEventListOffset(b%,f%,_U%+72,24,
wA%>=0
na%=_U%!72+wA%:HC%=a%!16:R$=
shell_IconGetData(b%,HC%):
R$=""
shell_OK(
shell_MessageNoArgs("SHELLMSG28"))
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):!a%=b%:
&400CC,,a%:I=a%!4-a%!20:J=a%!16-a%!24:UF%=a%!68:a%!4=f%:
&400CE,,a%:!a%=b%:a%!4=5:l%=a%!24:XC%=a%!32:a%!8=a%!8+I:a%!&C=a%!&C+J:a%!16=a%!16+I:a%!20=a%!20+J:a%!24=0:a%!28=0
Ja%!32=&7FFFFFFF:a%!36=&7FFFFFFF:
6,&A1,28
,,XA%:hF%=((XA%
2)=2):
XA%=l%:
&FA$=
shell_IconGetCommand(XC%,"s")
shell_OK(
shell_MessageNoArgs("SHELLMSG19"))
FA$<>""
&42400,&85,UF%,FA$,a%+8:_U%!&64=_U%!&64
&400D0,,a%
&400D0,,a%
shell_HeapBlockReturn(a%)
shell_Tracef0("IconDragBox:WARNING! no user drag handler registered for this icon!"):
shell_Tracef0("IconDragBox:now checking for a slider drag event.."):wA%=
shell_GetEventListOffset2(b%,f%,_U%+332,32,
shell_Tracef0("IconDragBox:event offset is "+
wA%):
wA%>=0
shell_HandleSlider(b%,f%,wA%)
shell_HandleAttachedMenu(_Q%,b%,f%):
f%<>-1
b%>-1
shell_GetEventMenu(_Q%!8,b%,f%):
m%<>0
shell_HandleMenuOpen(_Q%,m%,b%,f%,
shell_DoOLEHandling:
shell_OLEInProgress
shell_OLEScanLinkedFiles
shell_Action(mG%):
A$,m%,i$,tA$,bB%,EB%,TB%,XE%:
b%,f%,k%,_temp28%,_temp32%,_temp24%,_temp%,YE%:
yC%,d%,vF%:
_EVENT_NULL:
(vF%-jD%)>0:jD%+=jF%:
shell_DoOLEHandling:
shell_DoBackgroundTask:
(_U%!&64
1<<&B)
shell_Slider
_EVENT_REDRAWWIN:
shell_RedrawWindow(_Q%!0)
_EVENT_OPENWIN:
shell_OpenWindow(_Q%!0,
_EVENT_CLOSEWIN:
shell_CloseWindow(_Q%!0)
shell_PointerLeavingWindow(_Q%)
shell_PointerEnteringWindow(_Q%)
6:_U%!28=_Q%!&C:_U%!32=_Q%!16:EB%=_Q%!0:TB%=_Q%!4:_U%!272=_Q%!0:_U%!276=_Q%!4:_U%!320=_Q%!8:_temp28%=_Q%!&C:_temp32%=_Q%!16:f%=_Q%!16:
shell_Tracef0("Action:Mouse_Click event detected")
shell_Tracef0("Action:Window Handle was &"+
~_Q%!&C+" Icon Handle was "+
_Q%!16):
_Q%!&C=_U%!288
_Q%!16=_U%!292
shell_HandleBumpIcons(_U%!296,_Q%!&C,_Q%!16,_Q%!8)
_U%!288=-1:_U%!292=-1:_U%!296=-1:
_Q%!16>=0
shell_GetEventListOffset2(_Q%!&C,_Q%!16,_U%+&68,16,0):
shell_Tracef0("DEBUG::bump event offset is "+
d%>=0
shell_HandleBumpIcons(d%,_Q%!&C,_Q%!16,_Q%!8)
(_Q%!8=64)
shell_IconIsDraggable(_Q%!&C,_Q%!16):
<b$="Icon is draggable":
shell_IconDragBox(_Q%!&C,_Q%!16)
b$="Icon is not draggable"
shell_Tracef0("Action:"+b$)
_Q%!8
shell_ActionSelectButton
shell_ActionMenuButton
shell_ActionAdjustButton
_U%!&64
&42401:_U%!&64=_U%!&64
:_U%!&80=0:
(_U%!&64
1<<&B)=0
.7A$=
shell_GetEventHandler(_U%!28,_U%!32,6):
A$<>""
shell_Tracef0("Action:Drag event detected - function is "+A$):k%=
("FN"+A$+"(_temp28%,_temp32%)")
shell_Tracef0("Action:Drag event detected - no handler function"):
shell_SendDataSave(_U%!28,_U%!32)
_U%!&64=_U%!&64
1<<&B
shell_Tracef0("Action:keypress is="+
_Q%!24):
_Q%!24
&D,394,398,399,410,430,431:XE%=
shell_WritableIconHandler(_Q%!0,_Q%!4,_Q%!24)
shell_HotKeyProcess(_Q%!24)
shell_Tracef0("Action:Keypress not claimed, passing it on"):
&400DC,_Q%!24
shell_Tracef0("Action:Keypress claimed by this application")
shell_ActionMenuSelect(_Q%)
shell_IconEnsureVisible(_Q%!0,_Q%!4)
17,18:
shell_Receive(_Q%)
shell_UserMessageAcknowledge(_Q%)
shell_ActionSelectButton:
d%,PA%,S$,dG%:
shell_Tracef0("ActionSelectButton:Mouse Button was SELECT"):
_U%!32>=0
Z=d%=
shell_GetEventListOffset2(_Q%!&C,_Q%!16,_U%+340,24,
d%=-1
d%>=0
dG%=!(_U%!340+d%+16):
_POPUP_TYPE_DATEPICK:PA%=_U%!340+d%:
PA%!&C=-1
S$=""
S$=$(PA%!&C)
shell_DatePickerOpen(PA%!0,PA%!8,PA%!4,S$)
_POPUP_TYPE_FONTPICK:PA%=_U%!340+d%:
PA%!&C=-1
S$=""
S$=$(PA%!&C)
shell_FontPickerOpen(PA%!0,PA%!8,PA%!4,S$)
_POPUP_TYPE_COLOUR24:PA%=_U%!340+d%:
PA%!&C=-1
S$=""
S$=$(PA%!&C)
shell_ColourPickerOpen(PA%!0,PA%!8,PA%!4,S$)
_POPUP_TYPE_TEXT:
shell_HandleMenuOpen(_Q%,!(_U%!340+d%+20),_Q%!&C,_Q%!16,
_POPUP_TYPE_WIMPCOLOUR:
shell_MenuTickOnly1(!(_U%!340+d%+20),
shell_IconGetBGColour(_Q%!&C,!(_U%!340+d%+8))):
shell_HandleMenuOpen(_Q%,!(_U%!340+d%+20),_Q%!&C,_Q%!16,
99,"Unknown popup type detected"
shell_HandleAttachedMenu(_Q%,_U%!28,_U%!32):
_U%!32=0
shell_HandleAttachedDataSave(_Q%,_U%!28,_U%!32)
shell_GetEventHandler(_U%!28,_U%!32,2):
A$<>""
shell_IconSlab(4,_U%!28,_U%!32):
shell_Tracef0("ActionSelectButton:About to call "+"FN"+A$+"(&"+
~_temp28%+","+
_temp32%+")"):k%=
("FN"+A$+"(_temp28%,_temp32%)")
_U%!32=0
_U%!28=_U%!20
&400D4,,-1
shell_ActionMenuButton:
c%,m%,xC%,d%:xC%=
shell_Tracef0("ActionMenuButton:Mouse Button was MENU"):
_Q%!16>=0
shell_GetEventListOffset2(_Q%!&C,_Q%!16,_U%+340,24,
!(_U%!340+d%+16)=1
shell_MenuTickOnly1(!(_U%!340+d%+20),
shell_IconGetBGColour(_Q%!&C,!(_U%!340+d%+8)))
!(_U%!340+d%+16)=2
0PA%=_U%!340+d%:
PA%!&C=-1
S$=""
S$=$(PA%!&C)
shell_DatePickerOpen(PA%!0,PA%!8,PA%!4,S$)
shell_HandleMenuOpen(_Q%,!(_U%!340+d%+20),_Q%!&C,_Q%!16,
shiftmenuclick(_Q%!&C,_Q%!16)
shell_Tracef0("ActionMenuButton:Checking menu events.."):
shell_Tracef0("ActionMenuButton:button="+
_Q%!8+" _Q%!12="+
_Q%!&C+" _Q%!16="+
_Q%!16):
_Q%!16>=0
shell_GetEventMenu(_Q%!8,_Q%!&C,_Q%!16)
(m%<>0
_Q%!&C>0
_Q%!16>=0)
shell_GetEventMenu(_Q%!8,_Q%!&C,-1)
shell_Tracef0("ActionMenuButton:Menu handle is:&"+
~m%):
m%<>0
shell_HandleMenuOpen(_Q%,m%,_Q%!&C,_Q%!16,xC%)
shell_HandleMenuOpen(_Q%,m%,b%,f%,xC%):
r%,o%:
shell_OpenMenu(_Q%!0,_Q%!4,m%)
shell_HeapBlockFetch(50):o%=
shell_HeapBlockFetch(36):r%!0=b%:r%!4=f%:
&400CE,,r%:o%!0=b%:
&400CB,,o%:
shell_OpenMenu(o%!4+r%!16+64,_Q%!4,m%):
o%!4+r%!16+64,_Q%!4:
shell_HeapBlockReturn(r%):
shell_HeapBlockReturn(o%)
shell_ActionMenuSelect(_Q%):
jE%,bB%,yC%,YE%,k%,cD%,d%:d%=
shell_GetEventListOffset2(_U%!28,_U%!32,_U%+340,24,
d%>=0
shell_DoPopupSelect(_Q%,d%)
shell_HeapBlockFetch(256):
shell_Tracef0("ActionMenuSelect:Menu_Select event detected"):
&400CF,,_shell_blk%:bB%=
shell_HeapBlockFetch(256):
_U%!24=_U%!&FC
yC%=0:_U%!264=1
shell_CheckSelection(_Q%):
yC%>-1
_U%!264=1
_U%!264=0
_U%!264>0
"FontMenu_DecodeFontMenu",_Q%+yC%,bB%
YE%=1
shell_Tracef0("ActionMenuSelect:FontMenu selection ("+
shell_GetString(bB%)+")"):
shell_FontMenuSelectFont(
shell_GetString(bB%),_U%!260):
_shell_FontMenuSelFN$=""
&400D5,,_U%!24,_Q%,bB%:A$=
shell_GetEventHandler(_U%!52,_U%!56,0):_temp%=bB%:$_temp%=
shell_StringStripTrailing($_temp%," "):
A$<>""
("FN"+A$+"($_temp%)")
_shell_FontMenuSelFN$<>""
("FN"+_shell_FontMenuSelFN$+"(FNshell_FontMenuGetLastSelectedFont)")
shell_HeapBlockReturn(bB%):
_U%!264=0
&45BC4,_U%!24,_Q%
jE%,,cD%:
shell_MenuCallHandler(jE%,cD%)
_shell_blk%!8=1
shell_HeapBlockExists(_U%!&E0)
_temp%=_U%!&E0:
$_temp%<>""
"(k%=
("FN"+$_temp%+"(_U%!52,_U%!56)")
shell_OpenMenu(_U%!36,_U%!40,_U%!24)
_shell_FontMenuSelFN$=""
shell_HeapBlockReturn(cD%):
shell_ActionAdjustButton:
l%,A$,k%,tC%,g%:tC%=
shell_HeapBlockFetch(&C+(
shell_WindowCountIcons(_U%!28)*32)):
shell_Tracef0("Action:Mouse Button was ADJUST"):
_U%!28>0
&400D6,_U%!28,tC%,&F000,&B000:g%=0:
tC%!g%<>-1:
tC%!g%=_U%!32
shell_IconSet(_U%!28,_U%!32,1)
g%+=4:
_U%!32=0
shell_HandleAttachedDataSave(_Q%,_U%!28,_U%!32)
C7A$=
shell_GetEventHandler(_U%!28,_U%!32,3):
A$<>""
shell_IconSlab(1,_U%!28,_U%!32):k%=
("FN"+A$+"(_temp28%,_temp32%)")
shell_HeapBlockReturn(tC%):
shiftmenuclick(b%,f%):=
shell_IconSlab(vB%,b%,f%):
a%:a%=
shell_HeapBlockFetch(50):a%!8=vB%:a%!&C=b%:a%!16=f%:
&81680,,a%:a%!8=0:
&81680,,a%:
shell_HeapBlockReturn(a%):
shell_PointerLeavingWindow(_Q%):
r%,k%:r%=
shell_HeapBlockFetch(&C):
&400D6,!_Q%,r%,&3F0000,&F<<16:
!r%<>-1
e+k%=
("FN"+
shell_IconGetData(!_Q%,!r%))
shell_HeapBlockReturn(r%):
shell_PointerEnteringWindow(_Q%):
r%,k%,b%:b%=_Q%!0:r%=
shell_HeapBlockFetch(&C):
&400D6,b%,r%,&3F0000,&E<<16:
!r%<>-1
u)k%=
("FN"+
shell_IconGetData(b%,!r%))
shell_HeapBlockReturn(r%):
shell_RedrawWindow(h%):
ZD%,A$,SA%,VA%,a%,r%:
shell_HeapBlockFetch(&C):
&400D6,h%,r%,&3F0000,&D<<16:
!r%<>-1
shell_IconGetData(h%,!r%)
shell_HeapBlockReturn(r%):a%=
shell_HeapBlockFetch(&64):
A$=""
shell_GetEventHandler(h%,-1,4)
shell_FatalError
Wa%!0=h%:
&400C8,,a%
ZD%:SA%=a%!4-a%!20:VA%=a%!16-a%!24:
&81681,,a%:
A$<>""
("FN"+A$+"("+
a%+","+
SA%+","+
VA%+")")
&400CA,,a%
shell_HeapBlockReturn(a%):
shell_Receive(_Q%):
c%,k%:
_Q%!16
_MESSAGE_QUIT:
shell_Exit:
_MESSAGE_DATASAVE:
shell_DataSave(_Q%)
_MESSAGE_DATASAVEACK:
shell_DataSaveAck(_Q%)
_MESSAGE_DATALOAD:
shell_DataLoad(_Q%,
_MESSAGE_DATALOADACK:
shell_DataLoadAck(_Q%)
shell_DataLoad(_Q%,
_MESSAGE_RAMFETCH:
shell_RAMFetch(_Q%)
_MESSAGE_RAMTRANSMIT:
shell_RAMTransmit(_Q%)
_MESSAGE_PREQUIT:
shell_Message_PreQuit(_Q%)
_MESSAGE_PALETTECHANGE:
_U%!&A4>0
shell_Tracef0("Receive:PaletteChange message received"):c%=_U%!&A4:k%=
("FN"+$c%)
_MESSAGE_SAVEDESKTOP:
shell_Message_SaveDesktop(_Q%)
_MESSAGE_SHUTDOWN:
shell_Message_Shutdown(_Q%)
_MESSAGE_HELP:
shell_InteractiveHelp(_Q%)
_MESSAGE_MENUWARNING:
shell_MenuWarning(_Q%)
_MESSAGE_MODECHANGE:
shell_Message_ModeChange(_Q%)
_MESSAGE_TASKINIT:
_U%!&A8>0
shell_Tracef0("Receive:TaskInitialise message received"):c%=_U%!&A8:k%=
("FN"+$c%+"("+
(_Q%!4)+","+
shell_GetString(_Q%+28)+
34+")")
_U%!&D0=-1
shell_GetString(_Q%+28)="StrongHelp"
_U%!&D0=_Q%!4:
shell_StrongHlpMsg("Help_Install -DieWithTask "+
shell_GetAppDir+"."+
shell_GetAppName):c%=_U%!&D8:
$c%<>""
shell_HelpWord($c%):
shell_HeapBlockReturn(_U%!&D8):_U%!&D8=0
_MESSAGE_TASKCLOSEDOWN:
_U%!&AC>0
shell_Tracef0("Receive:TaskCloseDown message received"):c%=_U%!&AC:k%=
("FN"+$c%)
_Q%!4=_U%!&D0
_U%!&D0=-1
_MESSAGE_TASKNAMEIS:
shell_Tracef0("Receive:TaskNameIs message received"):
shell_GetString(_Q%+28)="StrongHelp"
_U%!&D0=_Q%!20
shell_ScanForHelp
&80140:
shell_HandlePrintFile(_Q%)
&80143:
shell_HandlePrintError(_Q%)
&80145:
shell_HandlePrintTypeOdd(_Q%)
&80147:
shell_HandleSetPrinter(_Q%)
shell_HandleUnknownMessage2(_Q%)
shell_Message_ModeChange(_Q%):
d%,g%,_B%,o%:_B%=_U%!&B8:
_U%!&A0>0
shell_Tracef0("Message_ModeChange:ModeChange message received"):c%=_U%!&A0:k%=
("FN"+$c%)
shell_HeapBlockFetch(&64):
_B%<>0
shell_Tracef0("Message_ModeChange:Checking static window list for pane events"):
_B%!g%<>-1:d%=
shell_GetEventListOffset(_B%!g%,-1,_U%+92,24,
d%>-1
shell_Tracef0("Message_ModeChange:Static window handle found"):
shell_WindowIsOpen(_B%!g%)
shell_Tracef0("Message_ModeChange:Window is open.."):!o%=_B%!g%:
&400C6,,o%:
shell_OpenWindow(_B%!g%,0,-1)
:g%+=4:
shell_HeapBlockReturn(o%):
shell_Message_Shutdown(_Q%):
_U%!312>0
shell_Tracef0("Message_Shutdown:Shutdown message received"):c%=_U%!312:k%=
("FN"+$c%)
shell_HandleUnknownMessage2(_Q%):
_Q%!16
&43B00:c$=$(_Q%+20):
c$,30)="EvntShellLib:ShellDBug started"
_U%!&64
Yr_U%!&64=(_U%!&64
1<<4):
shell_BroadcastMessage(&43B00,"ShellDBug:Init Debug messages from "+
shell_GetAppName)
c$,25)="EvntShellLib:TraceInitAck"
_U%!&64=(_U%!&64
1<<4)
c$,20)="EvntShellLib:TraceOn"
shell_TraceOn
c$,21)="EvntShellLib:TraceOff"
shell_TraceOff
c$,28)="EvntShellLib:ListClickSelect"
shell_ListClickSelect
c$,28)="EvntShellLib:ListClickAdjust"
shell_ListClickAdjust
c$,25)="EvntShellLib:ListHelpTags"
shell_ListHelpTags
shell_HandleUnknownMessage(_Q%):
shell_HandleUnknownMessage(_Q%):
shell_AttachPreQuitHandler(A$):
c%,k%:
_U%!300>0
shell_HeapBlockReturn(_U%!300)
<_U%!300=
shell_HeapBlockFetch(
A$+1):c%=_U%!300:$c%=A$:
shell_AttachShutdownHandler(A$):
c%,k%:
_U%!312>0
shell_HeapBlockReturn(_U%!312)
<_U%!312=
shell_HeapBlockFetch(
A$+1):c%=_U%!312:$c%=A$:
shell_AttachModeChangeHandler(A$):
c%,k%:
_U%!&A0>0
shell_HeapBlockReturn(_U%!&A0)
J_U%!&A0=
shell_HeapBlockFetch(
A$+1):c%=_U%!&A0:$c%=A$:k%=
("FN"+A$):
shell_AttachPaletteChangeHandler(A$):
c%,k%:
_U%!&A4>0
shell_HeapBlockReturn(_U%!&A4)
J_U%!&A4=
shell_HeapBlockFetch(
A$+1):c%=_U%!&A4:$c%=A$:k%=
("FN"+A$):
shell_AttachTaskInitialiseHandler(A$):
c%,k%:
_U%!&A8>0
shell_HeapBlockReturn(_U%!&A8)
<_U%!&A8=
shell_HeapBlockFetch(
A$+1):c%=_U%!&A8:$c%=A$:
shell_AttachTaskCloseDownHandler(A$):
c%,k%:
_U%!&AC>0
shell_HeapBlockReturn(_U%!&AC)
<_U%!&AC=
shell_HeapBlockFetch(
A$+1):c%=_U%!&AC:$c%=A$:
shell_RAMFetch(_Q%):
jH%,tD%,vD%:vD%=
_U%!&90>&8000
shell_Tracef0("RAMFetch:RAMFetch called.."):_Q%!&C=_Q%!8:_Q%!16=7:tD%=_U%!&88:
_U%!&8C=&FF9
_U%!&90+=4
(tD%-_U%!&80)<_Q%!24
_Q%!24=tD%-_U%!&80:vD%=
shell_Tracef0("RAMFetch:Sending block")
&400F1,_U%!&94,_U%!&90+_U%!&80,_Q%!4,_Q%!20,_Q%!24:
&400E7,17,_Q%,_Q%!4:_U%!&78=_Q%!8:_U%!&80+=_Q%!24:
_U%!&80=0
shell_RAMTransmit(_Q%):
d%,a%,YA$,c%:
_Q%!&C=_U%!&70
$_U%!&80+=_Q%!24:
_Q%!24<_U%!&84
shell_Tracef0("RAMTransmit:Last block received"):d%=
shell_GetEventListOffset(_U%!28,_U%!32,_U%+96,16,
):a%=_U%!96+d%:
shell_Tracef0("RAMTransmit:_U%!28="+
_U%!28):
shell_Tracef0("RAMTransmit:_U%!32="+
_U%!32)
shell_Tracef0("RAMTransmit:offset%="+
d%):c%=_U%!&9C:YA$=
shell_GetString(c%+44):
shell_UserFNLoadFile(c%!40,_U%!&98,a%!8,YA$,_U%!&84,a%)
shell_Tracef0("RAMTransmit:Block received"):
_U%!&80>_U%!&84
shell_Tracef0("RAMTransmit:Increasing buffer size.."):_U%!&98=
shell_HeapBlockExtend(_U%!&98,_U%!&80,_U%!&84)
:_Q%!&C=_Q%!8:_Q%!16=6:_Q%!20=_U%!&98+_U%!&80:_Q%!24=_U%!&84:
&400E7,18,_Q%,_Q%!4:_U%!&70=_Q%!8
shell_HeapBlockReturn(_U%!&98):_U%!&98=0:
shell_OK(
shell_MessageNoArgs("SHELLMSG15"))
shell_LoadFile(aH%):
u$,pB%,KD%,UB%:u$=
shell_GetString(_Q%+44):pB%=
shell_FileLength(u$):
pB%<0
shell_OK(
shell_MessageNoArgs("SHELLMSG16"))
-PUB%=
shell_HeapBlockFetch(pB%):
&20008,16,u$,UB%,0
;KD%:
shell_VFlag(KD%)
shell_HeapBlockReturn(UB%):
shell_OK(
shell_MessageNoArgs("SHELLMSG17"))
shell_Tracef0("LoadFile:File "+u$+" loaded ok at &"+
~UB%)
:=UB%
shell_VFlag(KD%):=((KD%
1)=1)
shell_CheckType(x%,cB%,AC%):
cH%,g%,j%,c%,bD%:g%=0:j%=-1:bD%=
_U%!&64
_U%!&64=_U%!&64
cB%<>-1
cB%!g%<>-1:c%=cB%!g%:
1<<31
c%=c%
1<<31:bD%=
c%=x%
j%=g%:
_L_U%!&64=_U%!&64
1<<1:
shell_Tracef0("CheckType:Top Bit Load detected..")
:g%+=4:
(x%>=4096)
j%=-1
j%=0:_U%!&64=_U%!&64
j%>-1
shell_Tracef0("CheckType:File type OK "+
~cB%!j%)
shell_Tracef0("CheckType:File type NOT ok "+
j%<>-1
shell_Exit:
QC%:QC%=_U%!68:
&61504,QC%:
&2001E,7,,QC%:
shell_Tracef0("Exit:Application closing down"):
shell_TraceExit:
&606C2:
&600D0,,-1:
shell_WimpCloseDown_I(_U%!&94):
shell_DataLoad(_Q%,AC%):
oH%,d%,a%,_temp%,cB%,x%,j$:
shell_DataOpenOKToLoad(AC%,_Q%!40)
dx%=_Q%!40:j$=
shell_GetString(_Q%+44):
shell_Tracef0("DataLoad:DataLoad message received"):
_U%!96<>0
d%=-1
shell_GetEventListOffset(_Q%!20,_Q%!24,_U%+96,16,
d%=-1
shell_GetEventListOffset(_Q%!20,-1,_U%+96,16,
d%>-1
4a%=_U%!96+d%:
shell_CheckType(_Q%!40,a%!8,AC%)
shell_Tracef0("DataLoad:File type recognised (&"+
~_Q%!40+")"):PH%=_Q%!&C:_Q%!&C=_Q%!8:_Q%!16=4:
&400E7,18,_Q%,_Q%!4:
_U%!&64
UB%=-1:_U%!&64=_U%!&64
shell_LoadFile(PH%=_U%!&6C)
shell_UserFNLoadFile(x%,UB%,a%!8,j$,_Q%!36,a%):
_U%!&9C<>0
shell_HeapBlockReturn(_U%!&9C):_U%!&9C=0
shell_Tracef0("DataLoad:File type NOT recognised (&"+
~_Q%!40+")")
shell_DataOpenOKToLoad(AC%,x%):
y%,hE%,RA$,TA$:
shell_Tracef0("DataOpenOKToLoad:Message reason code was 3, normal drag load..")
shell_Tracef0("DataOpenOKToLoad:Message reason code was 5, double click load.."):hE%=
shell_HeapBlockFetch(256):RA$=
shell_OSVarGetVal(hE%,256,"Alias$@RunType_"+
~x%,1):
shell_Tracef0("DataOpenOKToLoad:Alias$@RunType="+RA$)
shell_HeapBlockReturn(hE%):TA$=
shell_Branch(RA$):
shell_Tracef0("DataOpenOKToLoad:dbug "+TA$):
shell_Leaf(TA$)="!"+
shell_GetAppName
shell_UserFNLoadFile(x%,UB%,cB%,_filename$,_file_size%,a%):
g%,j%,c%,k%:g%=0:j%=-1:
cB%<>-1
cB%!g%<>-1:c%=cB%!g%:
1<<31
c%=c%
1<<31
c%=x%
j%=g%
g%+=4:
:c%=a%!&C:k%=
("FN"+$(c%!j%)+"("+
UB%+","+
x%+",_filename$,"+
_file_size%+")"):
shell_DataSave(_Q%):
c%,d%,a%,_%:
shell_Tracef0("DataSave:DataSave message received"):
_Q%!4<>_U%!&94
shell_GetEventListOffset(_Q%!20,_Q%!24,_U%+96,16,
d%>-1
2a%=_U%!96+d%:
shell_CheckType(_Q%!40,a%!8,
shell_Tracef0("DataSave:Filetype recognized (&"+
~_Q%!40+")"):
shell_TopBitLoadInProgress
shell_Tracef0("DataSave:'no load' flag set"):
shell_Tracef0("DataSave:Sending Message_DataSaveAck"):_Q%!0=256:_Q%!&C=_Q%!8:_Q%!36=-1:_Q%!16=2:$(_Q%+44)=
shell_GetAppDir+".ScrapFile"+
&400E7,18,_Q%,_Q%!4
shell_HeapBlockReturn(_U%!&9C):_U%!&9C=
shell_HeapBlockFetch((_Q%!0)+8):c%=_U%!&9C:
_Q%!0
4:c%!_%=_Q%!_%:
_%:_U%!28=_Q%!20:_U%!32=_Q%!24:_U%!&80=0:_U%!&84=_Q%!36:_U%!&98=
shell_HeapBlockFetch(_Q%!36):_Q%!0=28:_Q%!&C=_Q%!8:_Q%!16=6
_Q%!20=_U%!&98+_U%!&80:_Q%!24=_U%!&84:
&400E7,18,_Q%,_Q%!4:_U%!&70=_Q%!8:
shell_Tracef0("DataSave:Sending Message_RAMFetch")
shell_Tracef0("DataSave:Filetype NOT recognized")
shell_TopBitLoadInProgress:
_U%!&64
shell_SendDataSave(b%,f%):
a%,HA%,CC%,d%,pB%,k%:CC%=
shell_HeapBlockFetch(30):
&400CF,,CC%:d%=
shell_GetEventListOffset(b%,f%,_U%+72,24,
d%=-1
d%=-2
Mdk%=
shell_MessageWindow(
shell_MessageNoArgs("SHELLMSG13"),0,"",
shell_MessageNoArgs("warning"))
a%=(_U%!72)+d%:
a%!8>&8000
Q$pB%=
shell_HeapBlockInfo(a%!8)-4
pB%=a%!8
:HA%=_U%!76:HA%!0=256:HA%!&C=0:HA%!16=1:HA%!20=CC%!&C:HA%!24=CC%!16:HA%!28=CC%!0:HA%!32=CC%!4:HA%!36=pB%:HA%!40=a%!&C:$(HA%+44)=
shell_Leaf(
shell_IconGetData(b%,a%!16)):
&400E7,18,HA%,HA%!20,HA%!24:_U%!&78=_Q%!8:_U%!&88=pB%:_U%!&8C=a%!&C
d;_U%!&90=a%!8:_U%!&9C=a%!4:_U%!&C8=HA%!20:_U%!&CC=HA%!24
shell_HeapBlockReturn(CC%):
shell_DataSaveAck(_Q%):
_fullname$,RA%,nA%,a%,c%,k%:
shell_Tracef0("DataSaveAck:DataSaveAck message received"):RA%=0:nA%=_Q%?(44+RA%):
nA%<>0:_fullname$+=
(nA%):RA%+=1:nA%=_Q%?(44+RA%):
shell_Tracef0("DataSaveAck:Full save name is: "+_fullname$)
shell_Tracef0("DataSaveAck:task = &"+
_Q%!4):
shell_Tracef0("DataSaveAck:mytask = &"+
_U%!&94):d%=
shell_GetEventListOffset(_U%!28,_U%!32,_U%+72,24,
shell_Tracef0("DataSaveAck:offset% = "+
d%>=0
%a%=(_U%!72)+d%:c%=a%!20:
$c%<>""
("FN"+$c%+"(_fullname$)")
shell_HeapBlockExists(a%!8)
8,&A,_fullname$,a%!&C,,a%!8,a%!8+
shell_HeapBlockInfo(a%!8)+1
shell_MessageNoArgs("SHELLMSG21")
_Q%!36>-1
_U%!80<>0
shell_HeapBlockReturn(_U%!80)
H_U%!80=
shell_HeapBlockFetch(
_fullname$+1):c%=_U%!80:$c%=_fullname$
:_Q%!16=3:!_Q%=256:_Q%!20=_U%!&C8:_Q%!24=_U%!&CC:_Q%!40=_U%!&8C:_Q%!36=
shell_FileLength(_fullname$):_Q%!&C=_Q%!8:
shell_Tracef0("DataSaveAck:File length is "+
_Q%!36+" bytes"):$(_Q%+44)=_fullname$+
(0):_U%!84=_Q%!8
shell_Tracef0("DataSaveAck:Sending DataLoad Message"):
&400E7,18,_Q%,_Q%!20,_Q%!24:
_U%!28<>_U%!20
shell_CloseWindow(_U%!28)
&400D4,,-1
shell_PrintSave(_fullname$,_Q%!20,_Q%!24,_Q%!8,_Q%!40):
shell_Tracef0("DEBUG:: copies = "+
(_U%!336)):
_U%!336>0
+_U%!336-=1:
shell_DoSendPrintSave(&FFF)
shell_DataSaveCheckName(b%,f%):
d%,a%,p%:a%=_U%!72:d%=0:
a%<>0
shell_HeapBlockInfo(a%)-8:
!(a%+d%)=b%
shell_IconGetData(!a%,a%!16):
R$,".")=0
shell_OK(
shell_MessageNoArgs("SHELLMSG01"))
d%=p%
:d%+=24:
d%>=p%
shell_DataLoadAck(_Q%):
shell_Tracef0("DataLoadAck:DataLoadAck message received (file received ok)"):
shell_UserMessageAcknowledge(_Q%):
_Q%!16
shell_AckDataLoad(_Q%)
shell_AckRAMFetch(_Q%)
_Q%!8=_SHELL_SENDDATALOAD_MY_REF%
RO3_Present
("Filer_Run "+_SHELL_SENDDATALOAD_FILE$)
("Run "+_SHELL_SENDDATALOAD_FILE$)
shell_AckDataLoad(_Q%):
_Q%!&C<>_U%!84
&20008,6,"<Wimp$Scrap>":
&FF,"Data Transfer failed: Receiver died"
shell_AckRAMFetch(_Q%):
RF%,c%:c%=_U%!&9C:
shell_Tracef0("AckRAMFetch:AckRAMFetch called...."):
_Q%!&C<>_U%!&70
_U%!&80=0
shell_Tracef0("AckRAMFetch:Receiver does not support RAM transfer"):
&20023,"Wimp$Scrap",,-1,0,3
,,RF%:
RF%<>0
$(c%+44)="<Wimp$Scrap>"+
(0):c%!0=(49+
shell_GetString(c%+44)))
3:c%!&C=c%!8:c%!16=2:c%!36=-1:
&400E7,18,c%,c%!4:_U%!&6C=c%!8
shell_OK(
shell_MessageNoArgs("SHELLMSG14"))
shell_Tracef0("AckRAMFetch:RAM transfer started, but not enough data sent. Sender died?"):
shell_HeapBlockReturn(_U%!&98):_U%!&98=0:
shell_OK("SHELLMSG06")
shell_MenuWarning(_Q%):
A$,bB%,NA%,TA%,k%,_temp%,RA%,E$,DC%,a%:NA%=_Q%!24:TA%=_Q%!28:_U%!264=0:
_U%!20<>0
shell_Tracef0("MenuWarning:Removing last dynamic dbox (handle=&"+
~_U%!20+")"):k%=
shell_DeleteWindow(_U%!20):
shell_Tracef0("MenuWarning:Last dynamic dbox removed")
_Q%!20
_U%!&E4:
shell_WindowRetitle(_U%!&E4,
shell_MessageNoArgs("warning")):
shell_IconPutData(_U%!&E4,1,
shell_MessageNoArgs("SHELLMSG07"),0):
&400E8,,_U%!&E4,NA%,TA%
shell_MenuGetItemAddress(_U%!24,_Q%+32):
shell_HeapBlockExists(DC%!4)
shell_MenuWarnDBox(DC%,NA%,TA%)
shell_HeapBlockFetch(32):
&45BC4,_U%!24,_Q%+32
,,a%:
shell_FindMenuWarnEvent(a%!8,E$,J$):
shell_HeapBlockReturn(a%):
shell_MenuWarnSubMenu(_Q%!20,NA%,TA%,E$,J$)
shell_MenuWarnDBox(JB%,NA%,TA%):
c%,u%,k%:
c%=JB%!4:
shell_CreateWindow($c%!0,u%):
shell_Tracef0("MenuWarnDBox:Creating new dynamic dbox (handle=&"+
~u%+")"):
$c%!4<>""
shell_Tracef0("MenuWarnDBox:Calling preopen FN '"+$c%!4+"'"):k%=
("FN"+$c%!4+"("+
u%+")")
$c%!8<>""
shell_Tracef0("MenuWarnDBox:Calling postopen FN '"+$c%!8+"'"):k%=
("FN"+$c%!8+"("+
u%+")")
shell_Tracef0("MenuWarnDBox:Opening dbox.."):_U%!20=u%:
&400E8,,u%,NA%,TA%:
shell_FindMenuWarnEvent(fA%,
y%,z%,c%,d%,j%,p%,CA%,g%:
EC%:EC%=0:z%=_U%!&DC:d%=0:j%=
:E$="":EC%=0:
shell_HeapBlockExists(z%)
:g%+=4:
z%!g%=-1:p%=g%:g%=0:
shell_Tracef0("FindMenuWarnEvent:list_size%="+
:c%=!(z%+d%+0):
c%<>-1
c%=fA%
:CA%=z%!(d%+4):E$=$CA%:EC%=z%!(d%+8):CA%=z%!(d%+&C):J$=$CA%:
shell_Tracef0("FindMenuWarnEvent:submenu found")
:d%+=16
d%=p%
d%>=p%
E$="":J$=""
EC%=0
shell_Tracef0("FindMenuWarnEvent:warn fn not found..")
shell_MenuWarnSubMenu(gE%,NA%,TA%,E$,J$):
k%,c%,WB%,g%:_shell_FontMenuSelFN$=J$:
shell_HeapBlockExists(_U%!&E0)
shell_HeapBlockReturn(_U%!&E0)
C_U%!&E0=
shell_HeapBlockFetch(
E$+1):c%=_U%!&E0:$c%=E$:
E$<>""
("FN"+E$+"(_U%!52,_U%!56)"):
shell_Tracef0("MenuWarnSubMenu:Calling FN"+E$)
gE%=_U%!&FC
shell_Tracef0("MenuWarnSubMenu:FontMenu opening.."):
shell_HeapBlockExists(_U%!256)
shell_HeapBlockReturn(_U%!256)
g%=0:
:g%+=4:
!(_Q%+32+g%)=-1:g%+=4:_U%!256=
shell_HeapBlockFetch(g%):c%=_U%!256:g%=0:
:c%!g%=!(_Q%+32+g%):g%+=4:
!(_Q%+32+g%)=-1:c%!g%=!(_Q%+32+g%):c%=_U%!256
shell_Tracef0("MenuWarnSubMenu:Selecting '"+
shell_FontMenuGetLastSelectedFont+"' in FontMenu.."):
"FontMenu_Select",
shell_FontMenuGetLastSelectedFont,_U%!260
,WB%:_U%!264=1:
WB%<>_U%!&FC
shell_FontMenuUpdatePtr(WB%):_U%!&FC=WB%:gE%=WB%
_U%!264=0
&400E8,,gE%,NA%,TA%:
shell_AttachSubMenu(ZB%,EC%,E$):
&45BCE,ZB%,EC%:
E$<>""
&45BCC,,
shell_EventListMenuWarn(ZB%,EC%,E$,"")
shell_EventListMenuWarn(ZB%,KG%,E$,J$):
c%,CA%,g%,z%:
_U%!&DC=0
_U%!&DC=
shell_HeapBlockFetch(32):c%=_U%!&DC:c%!0=ZB%:c%!4=
shell_HeapBlockFetch(
E$+1):$(c%!4)=E$:c%!8=KG%:c%!&C=
shell_HeapBlockFetch(
J$+1):$(c%!&C)=J$:c%!16=-1:c%!20=-1:c%!24=-1:c%!28=-1
shell_HeapBlockExtend(_U%!&DC,32):_U%!&DC=z%:g%=0:
:g%+=16:
z%!g%=-1:c%=_U%!&DC:c%!g%=ZB%:c%!(g%+4)=
shell_HeapBlockFetch(
E$+1):CA%=c%!(g%+4):$(CA%)=E$:c%!(g%+8)=KG%:c%!(g%+&C)=
shell_HeapBlockFetch(
J$+1):CA%=c%!(g%+&C):$(CA%)=J$
;c%!(g%+16)=-1:c%!(g%+20)=-1:c%!(g%+24)=-1:c%!(g%+28)=-1
shell_InteractiveHelp(_Q%):
G$,b$,K$,dB%,nD%,uA$,r%,l%:r%=
shell_HeapBlockFetch(&C):
&600D6,_Q%!32,r%,&3F0000,&C<<16
!r%<>-1
shell_IconGetData(_Q%!32,!r%)
shell_HeapBlockReturn(r%):
G$=""
shell_GetEventHandler(_Q%!32,_Q%!36,8)
shell_IconGetValidation(_Q%!32,_Q%!36):
K$<>""
shell_StringUpperCase(
K$,1))="I"
K$,";"):
dB%=0
K$,2)
K$,2,dB%-2)
shell_StringUpperCase(K$),
shell_StringUpperCase(";i")):nD%=
shell_StringUpperCase(K$),
shell_StringUpperCase(";"),dB%+1):
dB%>0
nD%>0
K$,dB%+2,nD%-dB%-2)
K$,dB%+2)
G$<>""
_Q%!16=&503:_Q%!&C=_Q%!8:b$=
shell_MessageLookup(G$,"",""):b$=
shell_MessageExpand(b$):$(_Q%+20)=b$:!_Q%=(
b$+25)
&400E7,17,_Q%,_Q%!4
shell_Message_PreQuit(_Q%):
c%,pD%,a%,_%,rD%:
_U%!300>0
shell_HeapBlockFetch(256):
_Q%!0
4:a%!_%=_Q%!_%:
shell_Tracef0("Message_PreQuit:PreQuit message received"):c%=_U%!300:pD%=a%!4:
!a%<24
rD%=0
rD%=a%!20
J2a%!&C=a%!8:
&400E7,19,a%,pD%:
("FN"+$c%)<>0
_closedown%=
!a%=24:a%!24=508:
&400E7,8,a%,pD%:_closedown%=
shell_HeapBlockReturn(a%)
lwaorigin(A,
TA%):NA%=A!0-A!16:TA%=A!&C-A!20:
shell_Iconbar(GA%,ZA$,H$,vA%,m%,GB%,IB%,BC%):
h%,aA%,sD%,zD%:aA%=
shell_HeapBlockFetch(36):
sD%20:
zD%20:!aA%=GA%:aA%!4=0:aA%!&C=96:
H$<>""
r$aA%!8=-16:aA%!16=92:aA%!32=
aA%!8=0:aA%!16=70:aA%!32=&C
:aA%!20=&1700310B:aA%!24=sD%:aA%!28=zD%:$sD%=H$:$zD%=ZA$:
&400C2,,aA%
shell_AttachMenu(-2,h%,m%,GB%,IB%,BC%):
shell_HeapBlockReturn(aA%):=
shell_IconNewSprite(GA%,h%,ZA$)
shell_IconbarSetText(v%,bA%,iA$):
t%:t%=
shell_HeapBlockFetch(40):!t%=v%:t%!4=bA%:
&400CE,,t%:$(t%!28)=iA$:
shell_IconRedraw(v%,bA%):
shell_HeapBlockReturn(t%):
shell_WritableIconHandler(b%,f%,KA%):
qA%,qB%,rB%,g%:
dD%,fD%,CB%,EB%,TB%,bH%,s%:s%=
shell_HeapBlockFetch(&400):
&400D3,,s%:
!s%=-1
shell_HeapBlockReturn(s%):=
&400D6,b%,s%,&40E000,&E000:qB%=!s%:g%=0:
s%!g%=f%
dD%=s%!(g%-4):fD%=s%!(g%+4)
:g%+=4:
s%!g%=-1:rB%=s%!(g%-4):
shell_FakeMouseClick(b%,0,4)
398,394:
f%=rB%
&400D2,b%,qB%,-1,-1,-1,
shell_IconGetData(b%,qB%)):
shell_IconEnsureVisible(b%,qB%)
&400D2,b%,fD%,-1,-1,-1,
shell_IconGetData(b%,fD%)):
shell_IconEnsureVisible(b%,fD%)
399,410:
f%=qB%
&400D2,b%,rB%,-1,-1,-1,
shell_IconGetData(b%,rB%)):
shell_IconEnsureVisible(b%,rB%)
&400D2,b%,dD%,-1,-1,-1,
shell_IconGetData(b%,dD%)):
shell_IconEnsureVisible(b%,dD%)
&400D2,b%,qB%,-1,-1,-1,
shell_IconGetData(b%,qB%)):
shell_IconEnsureVisible(b%,qB%)
&400D2,b%,rB%,-1,-1,-1,
shell_IconGetData(b%,rB%)):
shell_IconEnsureVisible(b%,rB%)
shell_HeapBlockReturn(s%):=
shell_FakeMouseClick(b%,f%,vB%):
6,&F,1:_Q%!8=vB%:_Q%!&C=b%:_Q%!16=f%:
shell_Action(6):
shell_IconHasCaret(v%,bA%):
s%,gA%,MA%:s%=
shell_HeapBlockFetch(24):
&400D3,,s%:MA%=s%!0:gA%=s%!4:
shell_HeapBlockReturn(s%):
(gA%=bA%
MA%=v%)
shell_IconCreate(b%,OB%,uA%,CH%,u%,qE%,tE%,AH%,O$,JB%,GC%,K$):
BH%,h%,XC%,t%:t%=
shell_HeapBlockFetch(40):t%!0=b%:t%!4=OB%:t%!8=uA%:t%!&C=OB%+CH%:t%!16=uA%+u%:t%!20=AH%
tE%<<28
qE%<<24:
t%!20
#BH%=
O$,","):t%!24=JB%:
K$<>""
6XC%=
shell_HeapBlockFetch(
K$+1):$XC%=K$:t%!28=XC%
t%!28=-1
:t%!32=GC%
$(t%+24)=
O$,&B)
&400C2,,t%
shell_HeapBlockReturn(t%):=h%
shell_IconDelete(b%,f%):
shell_DoIconDelete(b%,f%,
shell_IconDelete2(b%,f%):
shell_DoIconDelete(b%,f%,
shell_DoIconDelete(b%,f%,IH%):
a%,SA%,VA%,eA%,oA%:a%=
shell_HeapBlockFetch(40):a%!0=b%:a%!4=f%:
&400CE,,a%:
&8168A,,a%+8:SA%=a%!8:VA%=a%!&C:eA%=a%!16:oA%=a%!20:
&400CE,,a%:
shell_HeapBlockExists(a%!28)
shell_HeapBlockReturn(a%!28)
shell_HeapBlockExists(a%!32)
shell_HeapBlockReturn(a%!32)
&400C4,,a%:
&400D1,b%,SA%,VA%,eA%,oA%
shell_HeapBlockReturn(a%):
shell_IconRadioSelection(v%,sB%):
fF%,DD%,lF%,pF%:DD%=
shell_HeapBlockFetch(8):fF%=(sB%<<16)+(1<<21):pF%=(31<<16)+(1<<21):
&400D6,v%,DD%,pF%,fF%:lF%=!DD%:
shell_HeapBlockReturn(DD%):=lF%
shell_IconPutData(MA%,gA%,O$,Z):
a%,dA$:
_U%!&64
"WimpExt_SetIconString",,,MA%,gA%,O$+
shell_IconGetData(MA%,gA%):
O$<>dA$
]Sa%=
shell_HeapBlockFetch(40):a%!0=MA%:a%!4=gA%:
&400CE,,a%:
(a%!24
(1<<8))<>0
O$>a%!36
shell_MessageNoArgs("SHELLMSG12")
$(a%!28)=O$
$(a%+28)=
O$,&B)
a%!8=0:a%!&C=0:
&400CD,,a%
shell_HeapBlockReturn(a%)
shell_IconPutDataNow(MA%,gA%,O$):
a%:a%=
shell_HeapBlockFetch(50):a%!0=MA%:a%!4=gA%:
&400CE,,a%:
(a%!24
(1<<8))<>0
O$>a%!36
shell_MessageNoArgs("SHELLMSG12")
$(a%!28)=O$
$(a%+28)=
O$,&B)
:a%!8=0:a%!&C=0:
&400CD,,a%:
shell_EnsurePoll:
shell_HeapBlockReturn(a%):
shell_IconNewSprite(v%,bA%,U$):
DA%,ED%,BE%,DE%,GE%:DA%=
shell_HeapBlockFetch(40):DA%!0=v%:DA%!4=bA%:
&400CE,,DA%:
(DA%!24
(1<<1))
BE%=
(DA%!24
DE%=
(DA%!24
(1<<8))
GE%=
DA%!24
$(DA%!32)="S"+U$
$(DA%!28)=U$:DA%!36=
:ED%=bA%
&400C4,,DA%:DA%!4=DA%!8:DA%!8=DA%!&C:DA%!&C=DA%!16:DA%!16=DA%!20:DA%!20=DA%!24:$(DA%+24)=U$:
&400C2,,DA%
shell_IconRedraw(v%,ED%):
shell_HeapBlockReturn(DA%):=ED%
shell_IconGetData(MA%,gA%):
M$,t%:
gA%<0
MA%<-2
_U%!&64
"WimpExt_GetIcon",,,MA%,gA%
,,,M$
shell_HeapBlockFetch(40):t%!0=MA%:t%!4=gA%:
&400CE,,t%:
(t%!24
(1<<8))<>0
M$=$(t%!28)
M$=$(t%+28)
shell_HeapBlockReturn(t%)
shell_IconMove2(b%,f%,YG%,FF%):
BA%:BA%=
shell_HeapBlockFetch(40):!BA%=b%:BA%!4=f%:
&400CE,,BA%:BA%!8+=YG%:BA%!16+=YG%:BA%!&C+=FF%:BA%!20+=FF%:f%=
shell_IconMove(b%,f%,BA%!8,BA%!&C,BA%!16,BA%!20):
shell_HeapBlockReturn(BA%):=f%
shell_IconResize(b%,f%,SA%,VA%,eA%,oA%):=
shell_IconMove(b%,f%,SA%,VA%,eA%,oA%)
shell_IconMove(b%,f%,SA%,VA%,eA%,oA%):
r%,iH%,eH%,PB%,a%:
WF%,ZF%,bF%,dF%:r%=
shell_HeapBlockFetch(40):a%=
shell_HeapBlockFetch(40):!r%=b%:r%!4=f%:
&400CE,,r%:!a%=b%:a%!4=f%:
&400CE,,a%:
&8168A,,a%+8:tG%=r%!24:ZE%=r%+28
WF%=tG%:ZF%=ZE%!0:bF%=ZE%!4:dF%=ZE%!8:PB%=r%!8-a%!8:
&400C4,,r%:
&400D1,!r%,r%!8-PB%,r%!&C-PB%,r%!16+PB%,r%!20+PB%:f%=
shell_CreateIcon2(b%,SA%,VA%,eA%,oA%,WF%,ZF%,bF%,dF%,PB%):
shell_HeapBlockReturn(r%):
shell_HeapBlockReturn(a%):=f%
shell_CreateIcon2(h%,SA%,VA%,eA%,oA%,l%,HH%,NH%,OH%,PB%):
AA%,QA%,H$,g$,OB%,uA%:QA%=
shell_HeapBlockFetch(60):!QA%=h%:QA%!20=l%:QA%!24=HH%:QA%!28=NH%:QA%!32=OH%:H$="":g$="":
256H$=$(QA%!24)
H$=$(QA%+24)
4(g$=
shell_IconGetCommand(QA%!28,"S")
g$=$(QA%+24)
shell_GetMinXY(l%,H$,g$):
eA%-SA%<OB%
eA%=SA%+OB%
oA%-VA%<uA%
oA%=VA%+uA%
QA%!4=SA%:QA%!8=VA%:QA%!&C=eA%:QA%!16=oA%:
&400C2,,QA%
&400D1,!QA%,QA%!4-PB%,QA%!8-PB%,QA%!&C+PB%,QA%!16+PB%:
&400D3,,QA%:
!QA%=h%:
QA%!4=AA%:
&400D2,h%,AA%,0,0,-1,0
shell_HeapBlockReturn(QA%):=AA%
shell_GetMinXY(l%,H$,g$):
SA%,VA%,eA%,oA%,EB%,TB%:OB%=0:uA%=0:
H$<>""
&40084,l%>>24
,,VA%,,oA%:
&40097,,
(l%>>24)+H$
,SA%,,eA%:
&40088,,SA%
,SA%:
&40088,,eA%
,eA%:OB%=eA%-SA%:uA%=oA%-VA%
OB%=6*pH%+16*
H$:uA%=32
4uA%+=2*hH%
g$<>""
&2002E,296,
shell_UserSpritesBase,g$
,,,EB%,TB%,,EG%;P%:
&20035,EG%,4
,,wG%:EB%=EB%<<wG%:
&20035,EG%,5
,,yG%:TB%=TB%<<yG%:
&800 EB%=EB%/2:TB%=TB%/2
539)=19EB%=OB%+EB%
EB%>OB%OB%=EB%
TB%>uA%uA%=TB%
shell_IconGetCommand(FD%,fA$):
I%,M$:
FD%<=0
h M$=""
shell_StringUpperCase($FD%),";"+
shell_StringUpperCase(fA$)):
l M$=""
$(FD%+I%),
$(FD%+I%)+";",";")-1)
shell_IconRedraw(v%,bA%):
shell_IconSetState(v%,bA%,0,0):
shell_IconGetValidation(b%,f%):
a%,K$,l%:
f%=-1
UK$="":a%=
shell_HeapBlockFetch(40):a%!0=b%:a%!4=f%:
&400CE,,a%:l%=a%!24:
a%!32>0
K$=$(a%!32)
shell_HeapBlockReturn(a%):=K$
shell_IconPutValidation(b%,f%,y$):
a%,l%:a%=
shell_HeapBlockFetch(&64):a%!0=b%:a%!4=f%:
&400CE,,a%:l%=a%!24:
$(a%!32)=y$
shell_HeapBlockReturn(a%):
shell_IsIconSelected(eB%,fB%):
shell_IconGetState(eB%,fB%):l%=_Q%!24:c%=(l%
&200000):
shell_IconSelect(eB%,fB%):
shell_IconSetState(eB%,fB%,&200000,&200000):
shell_IconDeselect(eB%,fB%):
shell_IconSetState(eB%,fB%,0,&200000):
shell_IconGetState(eB%,fB%):!_Q%=eB%:_Q%!4=fB%:
&400CE,,_Q%:
shell_IconSetSelected(b%,f%,lA%):
lA%=0
shell_IconDeselect(b%,f%)
shell_IconSelect(b%,f%)
shell_IconSet(b%,f%,lA%):
lA%=0
shell_IconDeselect(b%,f%)
shell_IconSelect(b%,f%)
shell_IconSetState(eB%,fB%,SH%,pG%):
t%:t%=
shell_HeapBlockFetch(16):!t%=eB%:t%!4=fB%:t%!8=SH%:t%!&C=pG%:
&400CD,,t%:
shell_HeapBlockReturn(t%):
shell_IconUnselectable(h%,iC%):
shell_IconSetState(h%,iC%,&400000,&40000):
shell_IconSetBGColour(b%,f%,yA%):
yA%<0
yA%>&F
shell_MessageOneArg("SHELLMSG24","PROCshell_IconSetBGColour")
shell_IconSetState(b%,f%,yA%<<28,&F0000000):
shell_IconSetFGColour(b%,f%,yA%):
yA%<0
yA%>&F
shell_MessageOneArg("SHELLMSG24","PROCshell_IconSetFGColour")
shell_IconSetState(b%,f%,yA%<<24,&F000000):
shell_CaretSetPosition(MA%,gA%,TH%,hG%,dA%,CB%):
&400D2,MA%,gA%,TH%,hG%,dA%,CB%:
shell_IconEnsureVisible(MA%,gA%):
shell_CaretReadPosition(
CB%):
s%:s%=
shell_HeapBlockFetch(24):
&400D3,,s%:MA%=s%!0:gA%=s%!4:jC%=s%!8:kC%=s%!&C:CB%=s%!20:
shell_HeapBlockReturn(s%):
shell_IconSetButtonType(b%,f%,lC%):
lC%=&C
lC%=&D
shell_MessageOneArg("SHELLMSG23","PROCshell_IconSetButtonType")
lC%<0
lC%>&F
shell_MessageOneArg("SHELLMSG22","PROCshell_IconSetButtonType")
shell_IconSetState(b%,f%,lC%<<&C,&F000):
shell_IconSetESG(b%,f%,sB%):
sB%<0
sB%>31
shell_MessageOneArg("SHELLMSG25","PROCshell_IconSetESG")
shell_IconSetState(b%,f%,sB%<<16,&1F0000):
shell_IconSetText(b%,f%,EA%):
EA%<>0
EA%=1<<0
shell_IconSetState(b%,f%,EA%,1<<0):
shell_IconSetSprite(v%,bA%,EA%):
EA%<>0
EA%=1<<1
shell_IconSetState(v%,bA%,EA%,1<<1):
shell_IconSetBorder(v%,bA%,EA%):
EA%<>0
EA%=1<<2
shell_IconSetState(v%,bA%,EA%,1<<2):
shell_IconSetHCentred(b%,f%,EA%):
shell_IconSetState(b%,f%,0,1<<9):
EA%<>0
EA%=1<<3
shell_IconSetState(b%,f%,EA%,1<<3):
shell_IconSetVCentred(b%,f%,EA%):
EA%<>0
EA%=1<<4
shell_IconSetState(b%,f%,EA%,1<<4):
shell_IconSetFilled(b%,f%,EA%):
EA%<>0
EA%=1<<5
shell_IconSetState(b%,f%,EA%,1<<5):
shell_IconSetRightJust(b%,f%,EA%):
shell_IconSetHCentred(b%,f%,0):
EA%<>0
EA%=1<<9
shell_IconSetState(b%,f%,EA%,1<<9):
shell_IconSetLeftJust(b%,f%):
shell_IconSetHCentred(b%,f%,0):
shell_IconSetRightJust(b%,f%,0):
shell_IconSetUnselectable(b%,f%,lA%):
lA%<>0
lA%=1<<22
shell_IconSetState(b%,f%,lA%,1<<22):
lA%<>0
shell_HeapBlockFetch(24):
&400D3,,s%:
!s%=b%
s%!4=f%
&400D2,-1
shell_HeapBlockReturn(s%)
shell_CaretSetRight(b%,f%):
&400D2,b%,f%,-1,-1,-1,
shell_IconGetData(b%,f%)):
print_text(G,H,H$):
in(G,H-32,G+16*
(H$),H)
in(A%,B%,C%,D%):
newvals:a=_Q%!28:U=_Q%!32:Q=_Q%!36:R=_Q%!40:W=_Q%!4:c=_Q%!8:V=_Q%!&C:P=_Q%!16:K=_Q%!20:L=_Q%!24:S=V-W:T=P-c:e=K:f=K+S:g=L:h=L-T:
max(RA%,nA%):
RA%<nA%
shell_Leaf(F$):
F$,"."):F$=
F$,".")+1):
shell_Branch(j$):
GA%,z$,c%:
j$,".")=0
z$=""
c%=0:
:GA%=c%+1:c%=
j$,".",GA%):
c%=0:z$=
j$,GA%-2)
gname(D):_$="":
?D<>0
?D<>&D:_$=_$+
?D:D+=1:
shell_WindowResize(MA%,YH%,fG%,uG%,EH%,GD%):!_Q%=YH%:_Q%!4=fG%:_Q%!8=uG%:_Q%!&C=EH%:
&400D7,MA%,_Q%:
)_Q%!0=MA%:
&400CC,,_Q%:
&400C5,,_Q%
shell_WindowRetitle(
MA%,T$):
c%,q%,h%,PG%:q%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(MA%)*32)):q%!0=MA%:
&400CC,,q%:
((q%!60)
256)=0
Ac%=q%+76:$c%=
T$,&B):
&400C3,,q%:
&400C1,,q%+4
h%<>MA%
shell_UpdateWindowHandle(MA%,h%):MA%=h%
PG%=q%!84:$(!(q%+76))=
T$,PG%-1):
((q%!32)
(1<<16))<>0
&400D1,-1,q%!4,q%!16,q%!&C,q%!16+44
shell_HeapBlockReturn(q%)
shell_WindowTitleIndirected(SC%):
(1<<8))=(1<<8)
shell_ScreenToWindowCoords(VG%,
uD%,bG%,nH%,NF%,OF%,IC%:IC%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(VG%)*32)):uD%=IC%:!uD%=VG%:
&400CC,,uD%:bG%=IC%!4:kG%=IC%!16:NF%=IC%!20:OF%=IC%!24:X%=X%+(NF%-bG%):Y%=Y%+(OF%-kG%)
shell_HeapBlockReturn(IC%):
shell_WimpSlotReadEnd:
&400EC,-1,-1
YC%:=YC%
shell_WimpSlotClaimMemory(YC%,sA%):
&400EC,YC%+sA%,-1
wD%<YC%+sA%
shell_WimpSlotReleaseMemory:
&400EC,YC%,-1:
shell_MouseLimit(A,MA%):A!0=MA%:
&400CB,,A:
mouse_rectangle(A!4,A!8,A!&C-A!4,A!16-A!8):
shell_NameOfFirstSprite(rA$):
X%,N%,AA$:X%=
(rA$):
#X%=4:N%=
#X%:N%+=
#X%*256:N%+=
#X%*65536:N%+=
#X%*&1000000:
#X%=N%:AA$="":
&B:AA$+=
#X%):
#X%:=AA$
InitialiseSpriteArea(S%,_G%):!S%=_G%:S%!8=16:
46,9+256,S%:
shell_ListEvents(b%,AA%):
m%,i$:
b%=-1
b%=-2
shell_Tracef0("MenuSelection="+
shell_GetEventHandler(b%,AA%,0)):
shell_Tracef0("MenuMaker ="+
shell_GetEventHandler(b%,AA%,1)):
shell_Tracef0("ClickSelect ="+
shell_GetEventHandler(b%,AA%,2))
shell_Tracef0("ClickAdjust ="+
shell_GetEventHandler(b%,AA%,3)):
shell_Tracef0("Redraw ="+
shell_GetEventHandler(b%,AA%,4)):
shell_Tracef0("Keypress ="+
shell_GetEventHandler(b%,AA%,5))
shell_Tracef0("Drag ="+
shell_GetEventHandler(b%,AA%,6)):
shell_Tracef0("Menu Warning ="+
shell_GetEventHandler(b%,AA%,7)):
shell_Tracef0("HelpTag ="+
shell_GetEventHandler(b%,AA%,8)):m%=
shell_GetEventMenu(2,b%,AA%):
i$="None"
shell_Tracef0("Menu handle =&"+i$):
shell_HeapManagerInit(F$,LH%):
_heap_code%900:
("LOAD "+F$+"heapcode "+
~_heap_code%):
_heap_code%+0,LH%:
shell_HeapBlockExtend(PF%,xD%):
_heap_code%+&C,PF%,xD%:=PF%
shell_HeapBlockFetch(xD%):
_heap_code%+4,JB%,xD%:=JB%
shell_HeapBlockReturn(
RA%):
shell_HeapBlockExists(RA%)
_heap_code%+8,RA%
RA%=0:
shell_HeapBlockExists(JB%):
JB%<&8000
99,"No heapblock defined at this address"
shell_HeapBlockInfo(JB%):
shell_HeapBlockInfo(RA%):
29,6,!(_heap_code%+28),RA%
,,,M:=M
shell_HeapBlockExtendMid(RA%,nA%,SF%):
VF%:VF%=
shell_HeapBlockInfo(RA%):
_heap_code%+&C,RA%,nA%:
&400F1,_U%!&94,RA%+SF%,_U%!&94,RA%+SF%+nA%,VF%-nA%:=RA%
shell_OSVarExists(gB%,BA$):
&20023,BA$,gB%,-1,0,0
shell_OSVarGetVal(gB%,sA%,BA$,X):
CA$,B,iG%:
&20023,BA$,gB%,sA%,0,-3*(X=
,,B,iG%,x%:
B-1:CA$=CA$+
(gB%?_%):
_%:=CA$
shell_OSReadCommandArg(Y):
yD%,W$,d%:W$="":d%=0:
yD%?d%<>0:W$+=
(yD%?d%):d%+=1:
1:W$=
34)+1):W$=
34)+2)
shell_StringStripTrailing(B$,X$):
B$,1)=X$:B$=
(B$)-1):
shell_StringStripLeading(B$,X$):
B$,1)=X$:B$=
B$,2):
shell_StringStripAll(B$,X$):
E,F:E=
B$,X$):
B$,F-1)+
B$,F+1)
E:=B$
shell_StringPadTrailing(B$,X$,LB%):
(B$)<LB%:B$=B$+
(B$),X$):
shell_StringPadLeading(B$,X$,LB%):
(B$)<LB%:B$=
(B$),X$)+B$:
shell_StringUpperCase(B$):
(B$)>0
(B$):
B$,_%,1)>="a"
B$,_%,1)<="z"
B$,_%,1)=
B$,_%,1))
shell_StringExchange(B$,EA$,kA$):
B$,EA$)
P0CB%=
B$,EA$):B$=
B$,CB%-1)+kA$+
B$,CB%+
shell_StringArrayGetLongest(A$(),ID%):
_%,JD%:JD%=0:
(A$(_%))>JD%
(A$(_%))
_%:=JD%
mem_to_string(aA%,d%,FH%):
aA%?d%<>FH%:B$+=
(aA%?d%):d%+=1:
shell_FileLength(a$):
x%,ND%,YD%,LB%,ZC%,B$:
8,5,a$
x%,,ND%,YD%,LB%,ZC%:=LB%
shell_TraceOn:_U%!&64=_U%!&64
1<<9:
shell_BroadcastMessage(&43B00,"ShellDBug:TraceOn"):
shell_TraceOff:
(_U%!&64
(1<<9))
_U%!&64=_U%!&64
(1<<9)
shell_BroadcastMessage(&43B00,"ShellDBug:TraceOff"):
shell_TraceInit(p$):
XA%,a%,D$,C$:
p$<>""
(p$):_U%!44=XA%
shell_HeapBlockFetch(256):C$=
shell_OSVarGetVal(a%,256,"Obey$Dir",1):D$=
shell_Leaf(C$),2):
shell_BroadcastMessage(&43B00,"ShellDBug:Init Debug messages from "+D$):
shell_HeapBlockReturn(a%):
_U%!&64
_U%!&64=(_U%!&64
1<<4)
shell_TraceIsOn:
_U%!&64
(1<<9)
shell_Tracef0(VA$):
shell_TraceIsOn)
_U%!44<>-1
XA%=_U%!44:
#XA%,VA$
_U%!&94>0
shell_BroadcastMessage(&43B00,"ShellDBug:Trace "+VA$)
shell_Tracef2(JB%):
("MEDIT "+
~JB%):
shell_TraceExit:
_U%!44<>-1
#(_U%!44):_U%!44=-1
shell_AttachHotKey(XA$,GB%,IB%,BC%,e$,b%,Y$,Z$):
z%,d%,c%,CA%,KA%,KC%,tB%:tB%=0:
GB%<>0
tB%=tB%
IB%<>0
tB%=tB%
(1<<1)
BC%<>0
tB%=tB%
(1<<2)
_U%!60=0
3_U%!60=
shell_HeapBlockFetch(24):d%=0:_U%!&B4=1
d%=_U%!&B4*24:_U%!60=
shell_HeapBlockExtend(_U%!60,24):_U%!&B4=(_U%!&B4)+1
:z%=_U%!60:
"F1":KA%=385
"F2":KA%=386
"F3":KA%=387
"F4":KA%=388
"F5":KA%=389
"F6":KA%=390
"F7":KA%=391
"F8":KA%=392
"F9":KA%=393
"F10":KA%=458
"F11":KA%=459
"PRINT":KA%=384
"INSERT":KA%=461
"HOME":KA%=30:KC%=
"PAGEUP":KC%=
:KA%=415:
KA%=431
KA%=399
KA%=447
"PAGEDOWN":KC%=
:KA%=414:
KA%=430
KA%=398
KA%=446
"DELETE":KA%=&7F:KC%=
KA%=(
XA$)-64:KC%=
KA%+=16
KA%+=32
:c%=z%+d%:c%!0=KA%:c%!4=tB%:c%!8=
shell_HeapBlockFetch(
e$+1):CA%=c%!8:$CA%=e$:
shell_IsWindowStatic(b%)=
shell_MessageNoArgs("SHELLMSG09")
:c%!&C=b%:c%!16=
shell_HeapBlockFetch(
Y$+1):CA%=c%!16:$CA%=Y$:c%!20=
shell_HeapBlockFetch(
Z$+1):CA%=c%!20:$CA%=Z$:
shell_HotKeyProcess(KA%):
z%,p%,j%,e%,u%,q$,Y$,Z$:
IB%,GB%,BC%,pA%,rA%,SC%,lH%,d%:
y%,q%,LC%:GB%=
(-1):IB%=
(-2):BC%=
(-3):
LC%=LC%
LC%=LC%
(1<<1)
LC%=LC%
(1<<2)
Az%=_U%!60:p%=_U%!&B4*24:j%=
:e%=0:
z%!e%=KA%
z%!(e%+4)=LC%
e%+=24
e%>=p%:
&dc%=z%+e%:q$=$(c%!8):
shell_Tracef0("HotKeyProcess:Template name is '"+q$+"'"):
(q$<>""
c%!&C=0)
shell_CreateWindow(q$,u%):
shell_Tracef0("HotKeyProcess:Creating new dynamic window (handle is &"+
~u%+")"):q%=
shell_HeapBlockFetch(36):q%!0=u%:
&400CB,,q%:pA%=(q%!4-q%!&C)/2:rA%=(q%!16-q%!8)/2:
shell_HeapBlockReturn(q%)
:Y$=$(c%!16):
Y$<>""
shell_Tracef0("HotKeyProcess:Calling Pre-Open FN '"+Y$+"'"):
c%!&C>0
9 k%=
("FN"+Y$+"("+
c%!&C+")")
("FN"+Y$+"("+
u%+")")
shell_Tracef0("HotKeyProcess:No Pre-Open FN registered")
shell_IsWindowStatic(c%!&C)
shell_OpenWindowStatic(c%!&C)
c%!&C>0
shell_MessageNoArgs("SHELLMSG09")
shell_OpenWindowDynamic2(u%,pA%,rA%)
:Z$=$(c%!20):
Z$<>""
shell_Tracef0("HotKeyProcess:Calling Post-Open FN '"+Z$+"'"):
c%!&C>0
P k%=
("FN"+Z$+"("+
c%!&C+")")
("FN"+Z$+"("+
u%+")")
shell_Tracef0("HotKeyProcess:No Post-Open FN registered")
q$="":Y$="":Z$="":y%=
shell_WindowCentreOnPointer(u%):
o%,mC%,pA%,rA%:mC%=
shell_HeapBlockFetch(20):
&400CF,,mC%:q%=
shell_HeapBlockFetch(36):q%!0=u%:
&400CB,,q%:pA%=(q%!4-q%!&C)/2:rA%=(q%!16-q%!8)/2:
shell_WindowMoveTo(u%,mC%!0+pA%,mC%!4-rA%)
shell_HeapBlockReturn(q%):
shell_HeapBlockReturn(mC%):
shell_WindowCentreOnScreen(u%):
o%,LD%,MD%,vA%,dA%,wC%,PC%:
&20035,-1,4
,,wC%:
&20035,-1,5
,,PC%:
&20035,-1,&B
,,LD%:
&20035,-1,&C
,,MD%:LD%=LD%<<wC%:MD%=MD%<<PC%:q%=
shell_HeapBlockFetch(36):q%!0=u%:
&400CB,,q%:vA%=(q%!&C-q%!4)
edA%=(q%!16-q%!8):
shell_WindowMoveTo(u%,(LD%/2)-(vA%/2),(MD%-dA%)/2):
shell_HeapBlockReturn(q%):
shell_OpenWindowStaticNewView(b%):
shell_OpenWindow(b%,
,-1):
shell_OpenWindowStatic(h%):
shell_IsWindowStatic(h%)=
shell_OpenWindow(h%,0,-1)
shell_InitHelpSystem(F$,eG%):
HA$,GA%,xA%,d$,AE%,uB%:_U%!&D4=0:
_U%!&D8<>0
shell_HeapBlockReturn(_U%!&D8)
@_U%!&D8=0:
shell_ScanForHelp:
HA$=" -DieWithTask"
HA$=""
_U%!&64
F$="":xA%=
shell_HeapBlockFetch(256):d$=
shell_OSVarGetVal(xA%,256,
shell_GetAppName+"Res$Path",-1):
shell_HeapBlockReturn(xA%):
:GA%=
d$,","):
GA%>0
shell_FileExists(
d$,GA%-1)+
shell_GetAppName)
d$,GA%-1)+
shell_GetAppName:
shell_StrongHlpChkFiles(F$)
d$,GA%+1)
shell_FileExists(d$+
shell_GetAppName)
?F$=d$+
shell_GetAppName:
shell_StrongHlpChkFiles(F$)
shell_OK(
shell_MessageOneArg("SHELLMSG26",
shell_GetAppName))
F$<>""
shell_FileExists(F$)
shell_StrongHlpChkFiles(F$)
shell_MessageOneArg("SHELLMSG33",F$)
uB%=0
shell_StrongHlpMsg("Help_Install "+F$+HA$):_U%!&64=_U%!&64
shell_HelpWord(JA$):
fH%,c%,FA%:FA%=
shell_HeapBlockFetch(512):
_U%!&D0=-1
shell_OSVarExists(FA%,"StrongHelp$Dir")
&600DE,"<StrongHelp$Dir>":
_U%!&D8<>0
shell_HeapBlockReturn(_U%!&D8)
<_U%!&D8=
shell_HeapBlockFetch(
JA$+1):c%=_U%!&D8:$c%=JA$
shell_HeapBlockReturn(FA%):
shell_OK(
shell_MessageNoArgs("SHELLMSG11"))
shell_StrongHlpMsg("Help_Word "+JA$)
shell_HeapBlockReturn(FA%):
shell_StrongHlpMsg(w$):
shell_BroadcastMessage(&43B00,w$):
shell_ScanForHelp:
hB%,OD%:hB%=
shell_HeapBlockFetch(256):
:hB%!&C=0:
&400E7,19,hB%,-2,_U%!&D4
,,OD%:_U%!&D4=_U%!&D4+1:
OD%<>-1
(_U%!&D4)>64:
OD%<>-1
@hB%!0=24:hB%!&C=0:hB%!16=&400C6:hB%!20=OD%:
&400E7,17,hB%,0
shell_HeapBlockReturn(hB%):
shell_BroadcastMessage(zG%,w$):
BA%,CE%:CE%=(
w$+30)
3:BA%=
shell_HeapBlockFetch(CE%):BA%!&C=0:BA%!16=zG%:$(BA%+20)=w$+
(0):BA%!0=CE%:
&600E7,17,BA%,0:
shell_HeapBlockReturn(BA%):
shell_WindowToggleBackIcon(
shell_WindowToggleFlags(b%,1<<24):
shell_WindowToggleCloseIcon(
shell_WindowToggleFlags(b%,1<<25):
shell_WindowToggleTitleBar(
shell_WindowToggleFlags(b%,1<<26):
shell_WindowToggleToggleIcon(
shell_WindowToggleFlags(b%,1<<27):
shell_WindowToggleHScrollBar(
shell_WindowToggleFlags(b%,1<<30):
shell_WindowToggleAdjustSizeIcon(
shell_WindowToggleFlags(b%,1<<29):
shell_WindowToggleVScrollBar(
shell_WindowToggleFlags(b%,1<<28):
shell_WindowToggleFlags(
b%,NC%):
a%,l%,GD%,h%:
shell_Tracef0("WindowToggleFlags:wh%=&"+
~b%):GD%=
shell_WindowIsOpen(b%):a%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):a%!0=b%:
&400CC,,a%:l%=a%!32:l%=(l%
NC%):a%!32=l%:
&400C3,,a%
&400C1,,a%+4
h%:!a%=h%:
&400C5,,a%
shell_HeapBlockReturn(a%):
h%<>b%
shell_UpdateWindowHandle(b%,h%):b%=h%
shell_ListClickSelect:
z%,e%,p%,c%,CA%:z%=_U%!&C:p%=
shell_HeapBlockInfo(z%):
shell_Tracef0(" "):
shell_Tracef0("List of ClickSelect events:"):
shell_Tracef0(" "):
shell_Tracef0("Window Icon FN")
shell_Tracef0("-----------------------------------------------------------"):e%=0:
:c%=z%!(e%+20):CA%=z%+e%:
shell_HeapBlockExists(c%)
$c%<>""
shell_Tracef0(
shell_StringPadTrailing(
shell_GetWindowIdentifier(CA%!0),".",&C)+" "+
shell_StringPadLeading(
CA%!4," ",6)+" "+$c%)
:e%+=48:
(e%>=p%):
shell_Tracef0(" "):
shell_ListClickAdjust:
z%,e%,p%,c%,CA%:z%=_U%!&C:p%=
shell_HeapBlockInfo(z%):
shell_Tracef0(" "):
shell_Tracef0("List of ClickAdjust events:"):
shell_Tracef0(" "):
shell_Tracef0("Window Icon FN")
shell_Tracef0("-----------------------------------------------------------"):e%=0:
:c%=z%!(e%+24):CA%=z%+e%:
shell_HeapBlockExists(c%)
$c%<>""
shell_Tracef0(
shell_StringPadTrailing(
shell_GetWindowIdentifier(CA%!0),".",&C)+" "+
shell_StringPadLeading(
CA%!4," ",6)+" "+$c%)
:e%+=48:
(e%>=p%):
shell_Tracef0(" "):
shell_ListHelpTags:
z%,e%,p%,c%,CA%:z%=_U%!&C:p%=
shell_HeapBlockInfo(z%):
shell_Tracef0(" "):
shell_Tracef0("List of attached help tags:"):
shell_Tracef0(" "):
shell_Tracef0("Window Icon Tag")
shell_Tracef0("-----------------------------------------------------------"):e%=0:
:c%=z%!(e%+44):CA%=z%+e%:
shell_HeapBlockExists(c%)
$c%<>""
shell_Tracef0(
shell_StringPadTrailing(
shell_GetWindowIdentifier(CA%!0),".",&C)+" "+
shell_StringPadLeading(
CA%!4," ",6)+" "+$c%)
:e%+=48:
(e%>=p%):
shell_Tracef0(" "):
shell_MemFill(pC%,LG%,MG%):
I%,PD%,EE%:PD%=LG%
4:EE%=LG%
PD%>0
(PD%*4)
4:pC%!(I%-1)=MG%:
EE%>0
.pC%=pC%+(PD%*4):
EE%-1:pC%?I%=MG%:
shell_AttachFontMenu(b%,f%,J$,UA$):
shell_FontMenuInit:
"FontMenu_Select",""+
0,_U%!260
,m%:_U%!&FC=m%:
shell_EventAdd(b%,f%,0,-2,J$):
shell_Tracef0("AttachFontMenu:Attaching font menu"):
UA$<>""
shell_AttachMenuMaker(b%,f%,UA$)
shell_AttachFontSubMenu(ZB%,E$,J$):
dH%,m%,c%,g%:
shell_FontMenuInit:
"FontMenu_Select",""+
0,_U%!260
&45BCE,ZB%,m%:
&45BCC,,
:_U%!&FC=m%:
shell_EventListMenuWarn(ZB%,m%,E$,J$):
shell_Tracef0("AttachFontSubMenu:Attaching font menu &"+
~m%):
shell_FontMenuInit:
("RMEnsure FontMenu 1.16 RMLoad <EvntShell$Path>FontMenu"):
("RMEnsure FontMenu 1.16 Error Couldn't load FontMenu module"):
_U%!&F0=-1
"FontMenu_Create"
_U%!&F0
shell_FontMenuSelectFont("",
shell_FontMenuSelectFont(x$,FE%):
c%,WB%:
shell_HeapBlockExists(_U%!&F4)
shell_HeapBlockReturn(_U%!&F4)
H_U%!&F4=
shell_HeapBlockFetch(
x$+1):c%=_U%!&F4:$c%=x$:
FE%<>0
FE%=1
B_U%!260=FE%:
"FontMenu_Select",x$,_U%!260
,WB%:
WB%<>_U%!&FC
shell_FontMenuUpdatePtr(WB%):_U%!&FC=WB%
shell_Tracef0("FontMenuSelectFont:Font is '"+x$+"'"):
shell_FontMenuGetLastSelectedFont:
shell_HeapBlockExists(_U%!&F4)
c%=_U%!&F4:=$c%
shell_FontMenuUpdatePtr(e%):
z%,g%:
shell_Tracef0("FontMenuUpdatePtr:Started.."):
shell_HeapBlockExists(_U%!&DC)
shell_Tracef0("FontMenuUpdatePtr:HeapBlock found.."):z%=_U%!&DC:g%=0:
shell_Tracef0("FontMenuUpdatePtr:Substituting ptr.."):z%!(g%+8)=e%:g%+=&C:
z%!g%=-1
shell_MenuUpdateHandle(WG%,XG%):
p%,e%,i%,m%:p%=
shell_HeapBlockInfo(_U%!&C)-8:e%=0:j%=
:i%=_U%!&C:
:m%=i%!(e%+8):
m%=WG%
i%!(e%+8)=XG%
?+e%+=48:
(e%>=p%):
_U%!24=WG%
_U%!24=XG%
shell_FindFont(
f$,QD%,RD%,
HE%):
shell_FontIsAvailable(f$,QD%,RD%)
f$="Trinity.Medium"
&40081,,f$,QD%*16,RD%*16,0,0
shell_FontIsAvailable(f$,QD%,RD%):
&40081,0,f$,QD%*16,RD%*16,0,0
&40082,HE%:=
shell_CheckSelection(XH%):
c%,g%:c%=_U%!256:
_U%!24=_U%!&FC
XH%!g%<>c%!g%
g%+=4:
c%!g%=-1:=g%
shell_MenuGetItemAddress(m%,cG%):
g%,DC%:
&45BC7,m%
:DC%=m%+28+((cG%!g%)*24):m%=DC%!4:g%+=4:
cG%!g%=-1:=DC%
shell_GetLastMouseXPos:=_U%!272
shell_GetLastMouseYPos:=_U%!276
shell_UpdateWindowHandle(WA%,OA%):
shell_Tracef0("UpdateWindowHandle:Updating stored window handles"):
shell_Tracef0("UpdateWindowHandle:old handle=&"+
~WA%):
shell_Tracef0("UpdateWindowHandle:new handle=&"+
~OA%):
OA%<>WA%
_U%!28=WA%
_U%!28=OA%
!_Q%=WA%
!_Q%=OA%
shell_FixEventBlock(WA%,OA%,_U%!&C,48):
shell_FixEventBlock(WA%,OA%,_U%!96,16):
shell_FixEventBlock(WA%,OA%,_U%!72,24):
shell_FixEventBlock(WA%,OA%,_U%!92,24):
shell_FixEventBlock2(WA%,OA%,_U%!&68,16):
shell_FixEventBlock2(WA%,OA%,_U%!332,32)
shell_UpdateStaticWindowHandle(WA%,OA%):
shell_UpdateWindowHandleList(WA%,OA%)
shell_FixEventBlock(WA%,OA%,i%,d%):
e%,p%:
shell_HeapBlockExists(i%)
shell_HeapBlockInfo(i%)-8:
(i%!e%=WA%)
i%!e%=OA%
:e%+=d%:
(e%>=p%)
shell_FixEventBlock2(WA%,OA%,i%,d%):
e%,p%:e%=4:
shell_HeapBlockExists(i%)
p%=!i%:
(i%!e%=WA%)
i%!e%=OA%
:e%+=d%:
(e%>=p%)
shell_IconSelectAll(b%):
a%,I%:a%=
shell_HeapBlockFetch(&7D0):I%=a%+64:!a%=b%:a%!8=1<<21:a%!&C=1<<21:
&400D6,!a%,I%,5<<21,0<<21:
!I%>-1:a%!4=!I%:
&400CD,,a%:I%+=4:
shell_HeapBlockReturn(a%):
shell_IconDeselectAll(b%):
a%,I%:a%=
shell_HeapBlockFetch(&7D0):I%=a%+64:!a%=b%:a%!8=0:a%!&C=1<<21:
&400D6,!a%,I%,5<<21,1<<21:
!I%>-1:a%!4=!I%:
&400CD,,a%:I%+=4:
shell_HeapBlockReturn(a%):
shell_Message_SaveDesktop(Q%):
KA$:KA$="Run "+
shell_GetAppDir+
&C,2,Q%!20,KA$,
shell_MessagesInit(I$,
GF%):
sA%,l%:
3,"Cannot open message file '"+I$+"'"
&41500,,I$
l%,,sA%:
GF%=0
shell_HeapBlockFetch(sA%)
30,6,,,17+
,,SD%:$(SD%+16)=I$:
&41501,SD%,SD%+16:
shell_Tracef0("MessagesInit:Message resource file '"+I$+"' loaded"):
shell_PrinterOnLine:
HF%,IF%:HF%=
(-4):
2,1,0,1,0,1,0:
>30:IF%=
(-4)<HF%):*FX21,3
3:=IF%
shell_AttachBumpHandler(b%,f%,JF%,KF%,RH%,VH%,LF%,QH%,LA$,MA$):
n%,d%,c%,CA%,zA%:d%=
shell_GetEventListOffset2(b%,JF%,_U%+&68,16,
):n%=_U%!&68+d%:n%!0=b%:n%!4=JF%:n%!8=LF%:n%!&C=
shell_HeapBlockFetch(24):zA%=n%!&C:zA%!0=f%:zA%!4=RH%:zA%!8=VH%
LA$>0
>zA%!&C=
shell_HeapBlockFetch((
LA$)+1):CA%=zA%!&C:$CA%=LA$
zA%!&C=0
MA$>0
&>zA%!16=
shell_HeapBlockFetch((
MA$)+1):CA%=zA%!16:$CA%=MA$
zA%!16=0
QH%=-1
zA%!20=1
zA%!20=0
-od%=
shell_GetEventListOffset2(b%,KF%,_U%+&68,16,
):n%=_U%!&68+d%:n%!0=b%:n%!4=KF%:n%!8=LF%*(-1):n%!&C=zA%:
shell_HandleBumpIcons(d%,b%,f%,_button%):
kH%,UA%,n%,qC%,_temp$,KE%:
iB%,ME%,NE%:
mH%,FC%:
_button%<>2
=Yn%=_U%!&68+d%:_U%!288=b%:_U%!292=f%:_U%!296=d%:iB%=n%!8:ME%=
(-1):NE%=
(-2):
iB%=iB%*8
iB%=iB%*2
iB%=iB%*4
:UA%=n%!&C:KE%=UA%!16:
KE%<>0
OC_temp$=
shell_IconGetData(b%,UA%!0):qC%=
("FN"+$KE%+"(_temp$)")
shell_IconGetData(b%,UA%!0))
_button%=1
_new_val%=qC%+((iB%)*(-1))
_new_val%=qC%+iB%
UA%!20=0
_new_val%>UA%!8
_new_val%=UA%!8
_new_val%<UA%!4
_new_val%=UA%!4
_new_val%>UA%!8
_new_val%=UA%!4
_new_val%<UA%!4
_new_val%=UA%!8
:FC%=UA%!&C:
FC%<>0
e1_new_val$=
("FN"+$FC%+"(_new_val%,_button%)")
_new_val$=
_new_val%
_new_val%<>qC%
shell_IconPutData(b%,UA%!0,_new_val$,-1)
shell_WindowSetSpriteArea(u%,OE%):
a%,OA%,iC%,PE%:a%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(u%)*32)):!a%=u%:
&400CC,,a%:a%!68=OE%:
shell_IconSetSpriteArea(a%!60,a%+76,OE%):
(a%!88)>0
iC%=0
(a%!88)-1:PE%=a%+92+iC%*32:
shell_IconSetSpriteArea(PE%!16,PE%+20,OE%):
&400C3,,a%:
&400C1,,a%+4
OA%<>u%
shell_UpdateWindowHandle(u%,OA%):u%=OA%
shell_HeapBlockReturn(a%):=u%
shell_IconSetSpriteArea(l%,rC%,rG%):
3)=2)
256)<>0)
rC%!4=rG%
shell_StrongHlpIsAvailable:
YB%,FA%:YB%=
_U%!&64
kFA%=
shell_HeapBlockFetch(256):YB%=
shell_OSVarExists(FA%,"StrongHelp$Dir"):
shell_HeapBlockReturn(FA%)
:=YB%
shell_MenuNew(T$):
shell_Tracef0("MenuNew:Creating new menu (title is '"+T$+"')"):
&45BC1,,T$
h%:=h%
shell_MenuAdd(h%,NA$,J$):
shell_Tracef0("MenuAdd:Adding item ("+NA$+")"):
J$<>""
&45BC2,h%,NA$,J$
&45BC2,h%,NA$
:=fA%
shell_MenuTick(fA%,lA%):
&45BC9,fA%,lA%:
shell_MenuTickOnly1(YA%,GA%):
&45BD1,YA%,GA%:
shell_MenuTickOnly2(fA%):
&45BD1,fA%:
shell_MenuShade(h%,lA%):
&45BCB,h%,lA%:
shell_MenuDotted(fA%,lA%):
&45BCA,fA%,lA%:
shell_MenuColours(fA%,qE%,tE%):
&45BD0,fA%,qE%,tE%:
shell_MenuWritable(fA%,lA%,sA%,y$):
&45BCD,fA%,lA%,sA%,y$:
shell_MenuPutData(fA%,O$):
&45BC8,fA%,O$:
shell_MenuCallHandler(u%,_h_blk%):
("FN"+$u%+"(_h_blk%)")
shell_AttachOpenWindow(b%,A$):
a%,c%,d%:
shell_Tracef0("AttachOpenWindow:Attaching OpenWindow Handler"):
shell_MessageOneArg("SHELLMSG27","AttachOpenWindow")
shell_GetEventListOffset(b%,-1,_U%+304,&C,
):a%=_U%!304+d%:a%!0=b%:a%!4=-1:a%!8=
shell_HeapBlockFetch(
(A$)+1):c%=a%!8:$c%=A$:
shell_AttachCloseWindowHandler(b%,A$):
a%,c%,d%:
shell_Tracef0("AttachCloseWindowHandler:Attaching CloseWindow Handler"):
shell_MessageOneArg("SHELLMSG27","AttachCloseWindow")
shell_GetEventListOffset(b%,-1,_U%+308,&C,
):a%=_U%!308+d%:a%!0=b%:a%!4=-1:a%!8=
shell_HeapBlockFetch(
(A$)+1):c%=a%!8:$c%=A$:
shell_SpriteRename(aC%,lA$,nA$):
46,512+26,aC%,
shell_SpriteGetPtr(aC%,lA$),nA$:
shell_SpriteAreaSave(aC%,I$):
46,512+&C,aC%,I$:
shell_EnsurePoll:
:EA%=
shell_Poll_I(0,_U%!&94):
shell_Action(EA%):
EA%=0:
shell_WimpGetVersion:=_U%!316
shell_OSCheckVersion(sG%):=
shell_OSModuleCheckVersion("UtilityModule",sG%)
shell_OSModuleCheckVersion(oA$,b):
a%,GC%,M$:a%=
shell_HeapBlockFetch(256):
("Set Module$Check Y"):
("RMEnsure "+oA$+" "+
b+" Set Module$Check N"):
35,"Module$Check",a%,256,0,0
,,GC%:a%?GC%=&D:
("Unset Module$Check"):M$=$a%
shell_HeapBlockReturn(a%):
M$="N"
shell_MessageSendDataLoad(x%,R$):
BA%:BA%=
shell_HeapBlockFetch(256):BA%!0=256:BA%!4=0:BA%!&C=0:BA%!16=5:BA%!20=0:BA%!28=0:BA%!32=0:BA%!36=0:BA%!40=x%:$(BA%+44)=R$+
&400E7,18,BA%,0:_SHELL_SENDDATALOAD_MY_REF%=BA%!8:_SHELL_SENDDATALOAD_FILE$=R$
shell_HeapBlockReturn(BA%):
shell_MenuMakeFromFile(T$,jA$,p$):
h%,X%,B$,k%:
shell_FileExists(p$)
iTh%=
shell_MenuNew(T$):X%=
(p$):
#X%:k%=
shell_MenuAdd(h%,B$,jA$):
shell_BinarySearch(_search_term$,eA$,l$,vG%,QE%):
_pos%,DB%,_wp$,VD%,gH%,RE%,SE%,QF%,j%,TE%:QE%+=1:TE%=
:DB%=QE%:VD%=0:_pos%=DB%
2:SE%=vG%-1:RE%=QE%:
:_wp$=
("FN"+eA$+"(_pos%)"):UE%=_pos%:
_search_term$=_wp$
("FN"+l$+"(_search_term$,_wp$)")
+RE%=_pos%:DB%=_pos%-SE%:_pos%=DB%
2+VD%
SE%=_pos%:VD%=_pos%:DB%=RE%-_pos%:_pos%=DB%
2+VD%
QF%=UE%
!QF%=UE%:
shell_IconLastClicked:=_U%!32
shell_MenuGetNrItems(YA%):
m%,y%,TF%:
&45BC7,YA%
m%:m%+=28:
:y%=(m%?0
&80):TF%+=1:m%+=24:
y%:=TF%
shell_MenuGetNrDotted(YA%):
m%,y%,ID%:
&45BC7,YA%
m%:m%+=28:
:y%=(m%?0
&80):
(m%?0
ID%+=1
m%+=24:
y%=-1:=ID%
shell_MenuGetItemHandler(YA%,sC%):
hA%,e%,OA$:hA%=
shell_HeapBlockFetch(8):hA%!0=sC%:hA%!4=-1:
&45BC4,YA%,hA%
OA$=""
OA$=$(e%)
shell_HeapBlockReturn(hA%):=OA$
shell_MenuGetItemText(YA%,sC%):
hA%,e%,H$:hA%=
shell_HeapBlockFetch(8):hA%!0=sC%:hA%!4=-1:
&45BC4,YA%,hA%
,,e%:H$=$(e%!&C):
shell_HeapBlockReturn(hA%):=H$
shell_MenuGetItemHandle(YA%,sC%):
hA%,e%,h%:hA%=
shell_HeapBlockFetch(8):hA%!0=sC%:hA%!4=-1:
&45BC4,YA%,hA%
,,e%:h%=e%!8:
shell_HeapBlockReturn(hA%):=h%
shell_MenuGetItemHeight(YA%):
&45BC7,YA%
m%:=m%!20
shell_MenuCalculateHeight(YA%):
dA%:dA%=
shell_MenuGetNrItems(YA%)*
shell_MenuGetItemHeight(YA%):=dA%+(
shell_MenuGetNrDotted(YA%)*24)
shell_MenuSortItems(m%,hA$,gG%,pC%,VE%):
WE%:WE%=
shell_MenuGetNrItems(m%)-1:_shell_MS_handle%=m%:
VE%>WE%
VE%=WE%
&406C0:
shell_QuickSort(hA$,"_shell_MS_swap",gG%,0,VE%):
&406C1:
shell_QuickSort(l$,r$,_asc%,_start%,_end%):
_lo%,_h%,_F%,_temp%,k%:_lo%=_start%:_hi%=_end%:_F%=
:_temp%=_lo%-1+
(_hi%+1-_lo%):k%=
("FN"+r$+"(_lo%,_temp%)"):
_asc%=0
("FN"+l$+"(_lo%,_hi%)")
("FN"+r$+"(_lo%,_hi%)"):_F%=
("FN"+l$+"(_hi%,_lo%)")
("FN"+r$+"(_hi%,_lo%)"):_F%=
_hi%=_hi%-1
_lo%=_lo%+1
_lo%=_hi%:
_start%<_lo%-1
shell_QuickSort(l$,r$,_asc%,_start%,_lo%-1)
_hi%+1<_end%
shell_QuickSort(l$,r$,_asc%,_hi%+1,_end%)
_shell_MS_swap(WD%,XD%):
s$,t$,XF%,YF%:s$=
shell_MenuGetItemText(_shell_MS_handle%,WD%):t$=
shell_MenuGetItemText(_shell_MS_handle%,XD%):XF%=
shell_MenuGetItemHandle(_shell_MS_handle%,WD%):YF%=
shell_MenuGetItemHandle(_shell_MS_handle%,XD%)
shell_MenuPutData(XF%,t$):
shell_MenuPutData(YF%,s$):=0
_shell_MS_comp(WD%,XD%):
s$,t$:s$=
shell_MenuGetItemText(_shell_MS_handle%,WD%):t$=
shell_MenuGetItemText(_shell_MS_handle%,XD%):
shell_WindowSetTitleRightJust(
o%,cA%,h%,wB%:wB%=
shell_WindowIsOpen(b%):o%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):!o%=b%:
&400CC,,o%:cA%=o%!60:
(1<<3))
shell_Tracef0("WindowSetTitleRightJust:title flags = &"+
~cA%):
shell_Tracef0("WindowSetTitleRightJust:Horizontally centred bit set.."):
shell_Tracef0("WindowSetTitleRightJust:Unsetting horizontally centred bit.."):cA%=cA%
(1<<3)
shell_Tracef0("WindowSetTitleRightJust:title flags = &"+
~cA%)
shell_Tracef0("WindowSetTitleRightJust:Horizontally centred bit NOT set..")
shell_Tracef0("WindowSetTitleRightJust:Setting right justified bit.."):cA%=cA%
(1<<9):o%!60=cA%:
&400C3,,o%:
&400C1,,o%+4
b%<>h%
shell_Tracef0("WindowSetTitleRightJust:Updating window handle..."):
shell_UpdateWindowHandle(b%,h%):b%=h%
shell_OpenWindow(h%,0,0)
shell_HeapBlockReturn(o%):
shell_WindowSetTitleCentreJust(
o%,cA%,h%,wB%:wB%=
shell_WindowIsOpen(b%):o%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):!o%=b%:
&400CC,,o%:cA%=o%!60:
shell_Tracef0("WindowSetTitleCentreJust:title flags = &"+
~cA%)
shell_Tracef0("WindowSetTitleCentreJust:t_flags% AND (1 << 3) = "+
~(cA%
(1<<3))):
(1<<3))=0
shell_Tracef0("WindowSetTitleCentreJust:Horizontally centred bit not set.."):
shell_Tracef0("WindowSetTitleCentreJust:Setting horizontally centred bit.."):cA%=cA%
(1<<3):
shell_Tracef0("WindowSetTitleCentreJust:title flags = &"+
~cA%):o%!60=cA%
&400C3,,o%:
&400C1,,o%+4
b%<>h%
shell_Tracef0("WindowSetTitleCentreJust:Updating window handle..."):
shell_UpdateWindowHandle(b%,h%):b%=h%
shell_OpenWindow(h%,0,0)
shell_HeapBlockReturn(o%):
shell_IconGetSelectedIcons(b%,sB%,
aF%:aF%=(sB%<<16)+(1<<21):
&400D6,b%,r%,aF%,(sB%<<16)+(1<<21):
shell_GetLastMouseButton:=_U%!320
shell_GetLastWindowClicked:=_U%!28
shell_GetLastIconClicked:=_U%!32
shell_IconIndirSize(HB%,l%,rC%,X%):
sA%,cF%,g%,aD%:
&800100)=256
"sA%=rC%!8:
(rC%!4<>-1)
AcF%=rC%!4:
#X%=HB%+cF%:g%=0:
:aD%=
#X%:g%+=1:
aD%<32:sA%+=+g%
sA%=0
:=sA%
shell_StrongHlpChkFiles(F$):
shell_FileExists(F$+".HelpData")
<uB%=-1:
shell_MessageOneArg("SHELLMSG32","HelpData")
shell_FileExists(F$+".Index")
9uB%=-1:
shell_MessageOneArg("SHELLMSG32","Index")
shell_CaretMoveCaret(b%,EA%):
s%,eF%,g%,e%,jB%:g%=0:e%=0:s%=
shell_HeapBlockFetch(&800):
&400D3,,s%:
s%!4<>-1
<eF%=s%!4:
&400D6,b%,s%,&40E000,&E000:
s%!g%=eF%
e%=g%
g%+=4:
s%!g%=-1:
0:jB%=!s%
1:jB%=s%!(g%-4)
s%!(e%+4)<>-1
jB%=s%!(e%+4)
jB%=!s%
jB%=s%!(e%-4)
jB%=s%!(g%-4)
&400D2,b%,jB%,-1,-1,-1,
shell_IconGetData(b%,jB%)):
shell_IconEnsureVisible(b%,jB%)
shell_HeapBlockReturn(s%):
shell_CaretPutFirstIcon(b%):
s%:s%=
shell_HeapBlockFetch(&800):
&400D6,b%,s%,&40E000,&E000:
!s%<>-1
shell_CaretSetRight(b%,!s%):
shell_IconEnsureVisible(b%,!s%)
shell_HeapBlockReturn(s%):
shell_CaretPutLastIcon(b%):
shell_CaretMoveCaret(b%,1):
shell_CaretPutNextIcon(b%):
shell_CaretMoveCaret(b%,2):
shell_CaretPutPrevIcon(b%):
shell_CaretMoveCaret(b%,3):
shell_TemplateFileInfo(I$,
cC%:cC%=
RO3_Present:
shell_TemplateFileInfo3(I$,_A%,IA%,y%)
shell_TemplateFileInfo2(I$,_A%,IA%,y%)
shell_TemplateFileInfo2(I$,
GA%,RC%,lB%:
FA%,X%,bE%,GH%:
g%,aD%,cE%,qA%,uC%,l%:GA%=0:IA%=0:RC%=0:lB%=0:y%=0:
shell_FileExists(I$)
y%=-1
shell_FileType(I$)<>&FEC
y%=-2
:UFA%=
shell_HeapBlockFetch(&D):X%=
(I$):
#X%=16:
&C,4,X%,FA%,4:HB%=!FA%:
HB%>0
IA%+=1:dE%=0:
&C,4,X%,FA%,4:bE%=!FA%:
&C,4,X%,FA%,4:GH%=!FA%:
&C,4,X%,FA%,&C:cE%=
#X%=HB%+56:
&C,4,X%,FA%,4:l%=!FA%:
#X%=HB%+72:
&C,4,X%,FA%,&C:dE%+=
shell_IconIndirSize(HB%,l%,FA%,X%):
#X%=HB%+84:
&C,4,X%,FA%,4:qA%=!FA%:
qA%>0
uC%=0
qA%-1:
#X%=HB%+88+(uC%*32)+16:
&C,4,X%,FA%,4:l%=!FA%:
#X%=HB%+88+(uC%*32)+20:
&C,4,X%,FA%,&C:dE%+=
shell_IconIndirSize(HB%,l%,FA%,X%):
#X%=cE%:RC%+=dE%:
bE%>lB%
lB%=bE%
HB%=0:
shell_HeapBlockReturn(FA%):_A%=lB%+RC%
shell_TemplateFileInfo3(I$,
GA%,RC%,lB%,HB%:
g%,aD%,cE%,qA%,uC%,l%:GA%=0:IA%=0:RC%=0:lB%=0:FA%=
shell_HeapBlockFetch(&D):
&400D9,,I$:
:$FA%="*":
&400DB,,-1,,,,FA%,GA%
,_A%,KH%,,,,GA%:
GA%<>0
_A%>lB%
lB%=_A%
RC%+=KH%:IA%+=1
GA%=0:
&400DA:_A%=lB%+RC%:
shell_HeapBlockReturn(FA%):
RO3_Present:
a%,GC%,M$:a%=
shell_HeapBlockFetch(256):
("Set RO3$Check Y"):
("RMEnsure UtilityModule 3.00 Set RO3$Check N"):
35,"RO3$Check",a%,256,0,0
,,GC%:a%?GC%=&D:
("Unset RO3$Check"):M$=$a%:
shell_HeapBlockReturn(a%):
M$="N"
shell_WindowCountIcons(b%):
mB%,cC%,qA%:
(_U%!&64
1<<&A)
shell_Tracef0("WindowCountIcons:RISC OS 3 detected.."):
b%=-1
b%=-2
ymB%=
shell_HeapBlockFetch(88):!mB%=b%:
&400CC,,mB%+1:qA%=mB%!88:
shell_Tracef0("WindowCountIcons:nr_icons% = "+
shell_Tracef0("WindowCountIcons:RISC OS 3 NOT found.."):mB%=
shell_HeapBlockFetch(6000):
$!mB%=b%:
&400CC,,mB%:qA%=mB%!88
shell_Tracef0("WindowCountIcons:nr_icons% = "+
shell_HeapBlockReturn(mB%):=qA%
shell_SliderGetValue(h%):=(_U%!332+h%)!28
shell_HandleSlider(b%,f%,wA%):
LA%,NA%,TA%,a%,n%:
shell_Tracef0("HandleSlider:slider drag event found.."):n%=_U%!332+wA%:LA%=
shell_HeapBlockFetch(50):LA%!0=b%:LA%!4=n%!8:
&400CE,,LA%:a%=_U%!328:a%!0=0:a%!4=LA%!16-LA%!8:a%!8=f%:a%!&C=n%!&C:a%!16=n%
a%!24=n%!24:LA%!0=b%:
&400CB,,LA%:NA%=LA%!4-LA%!20:TA%=LA%!16-LA%!24:LA%!4=f%:
&400CE,,LA%:LA%!4=7:LA%!8+=NA%:LA%!&C+=TA%:LA%!16+=NA%:LA%!20+=TA%:LA%!24=LA%!8:LA%!28=LA%!&C:LA%!32=LA%!24+a%!4:LA%!36=LA%!20:
&400D0,,LA%:
shell_HeapBlockReturn(LA%)
_U%!&64=_U%!&64
1<<&B:
shell_Slider:
SB%,a%,eD%,vC%,b%,NA%,aA$,QB%,_value%,k%:SB%=
shell_HeapBlockFetch(20):QB%=_U%!328:
&400CF,,SB%:b%=SB%!&C:vC%=QB%!8:eD%=!SB%:
eD%<>!QB%
shell_HeapBlockFetch(50):!a%=b%:
&400CB,,a%:NA%=eD%-a%!4:a%!4=vC%:
&400CE,,a%:
&400C4,,a%:a%!4=b%:a%!16=NA%:
&400C2,,a%+4:
&400D1,b%,a%!8,a%!&C,a%!8+QB%!4,a%!20:_value%=
(((NA%-a%!8)*&64)/QB%!4):c%=QB%!16:c%!28=_value%:
QB%!24<>-1
("FN"+$(QB%!24)+"(_value%)")
QB%!&C>=0
7aA$=
(_value%):
shell_IconPutData(b%,QB%!&C,aA$,-1)
:!QB%=eD%:
shell_HeapBlockReturn(a%)
shell_HeapBlockReturn(SB%):
shell_GetEventListOffset2(b%,f%,i%,MB%,CD%):
p%,e%,j%,d%,NB%,c%:
(!i%=0
(!i%=0)
!E!i%=
shell_HeapBlockFetch(MB%+4):c%=!i%:c%!0=MB%:c%!4=0:c%!8=0:=4
:c%=!i%:p%=!c%:
shell_Tracef0("GetEventListOffset2:list size is "+
p%):e%=4:j%=
:d%=-1:NB%=-1:c%=!i%:
shell_Tracef0("GetEventListOffset2:window handle=&"+
~c%!e%):
NB%<0
(c%!e%=0
c%!e%+4=0)
NB%=e%
(c%!e%=b%)
f%=-1
d%=e%:j%=
c%!(e%+4)=f%
d%=e%:j%=
e%+=MB%
e%+=MB%
((e%>=(p%+4))
(d%=-1
NB%<0
[Ud%=p%+4:!i%=
shell_HeapBlockExtend(!i%,MB%):c%=!i%:c%!0+=MB%:c%+=d%:c%!4=0:c%!8=0
d%=NB%
shell_SliderSetValue(h%,_value%):
n%,vC%,a%,kF%,eE%,fE%,gD%:
mF%,nF%:n%=_U%!332+h%:vC%=n%!4:b%=n%!0:kF%=n%!8:fE%=n%!&C:a%=
shell_HeapBlockFetch(50):a%!0=b%:a%!4=kF%:
&400CE,,a%:eE%=a%!16:gD%=a%!8:mF%=a%!&C:nF%=a%!20:a%!4=vC%:
&400CE,,a%
&400C4,,a%:a%!4=b%:
_value%>&64
_value%=&64
_value%<=0
_value%=0:a%!16=a%!8
a%!16=gD%+(eE%*(_value%/&64))-(gD%*(_value%/&64))
:n%!28=_value%:
&400C2,,a%+4:
&400D1,b%,gD%,mF%,eE%,nF%:
n%!24<>-1
("FN"+$(n%!24)+"(_value%)")
fE%>=0
shell_IconPutData(b%,fE%,
_value%,
shell_HeapBlockReturn(a%):
shell_AttachSliderHandler(b%,oF%,dC%,TC%,hD%,iE%,Q$):
n%,d%:d%=
shell_GetEventListOffset2(b%,dC%,_U%+332,32,
):n%=_U%!332+d%:n%!0=b%:n%!4=dC%:n%!8=oF%:n%!&C=TC%:n%!16=hD%:n%!20=iE%:
Q$<>""
2n%!24=
shell_HeapBlockFetch(
Q$+1):$(n%!24)=Q$
n%!24=-1
:n%!28=0:
_U%!328=0
_U%!328=
shell_HeapBlockFetch(24)
shell_AttachClickSelect(b%,dC%,"_shell_icondrag"):
shell_AttachClickSelect(b%,oF%,"_shell_icondrag2"):
hD%>=0
shell_AttachClickSelect(b%,hD%,"_shell_sliderbumpupS"):
shell_AttachClickSelect(b%,iE%,"_shell_sliderbumpdownS"):
shell_AttachClickAdjust(b%,hD%,"_shell_sliderbumpdownA"):
shell_AttachClickAdjust(b%,iE%,"_shell_sliderbumpupA")
_shell_icondrag(b%,f%):
shell_IconDragBox(b%,f%):=0
_shell_icondrag2(b%,f%):
RB%,n%,iA%,j%,dC%:n%=_U%!332:RB%=!n%:iA%=4:
shell_Tracef0("Event block size is "+
RB%):
n%!(iA%+8)=f%
:dC%=n%!(iA%+4)
:iA%+=32:
iA%>=RB%
shell_IconDragBox(b%,dC%):=0
_shell_sliderbumpupS(b%,f%):
k%:k%=
_shell_sliderbumpup(b%,f%,4):=0
_shell_sliderbumpupA(b%,f%):
k%:k%=
_shell_sliderbumpup(b%,f%,1):=0
_shell_sliderbumpdownS(b%,f%):
k%:k%=
_shell_sliderbumpdown(b%,f%,4):=0
_shell_sliderbumpdownA(b%,f%):
k%:k%=
_shell_sliderbumpdown(b%,f%,1):=0
_shell_sliderbumpup(b%,f%,vB%):
RB%,n%,iA%,j%,e%,_value%,UC%:
shell_Tracef0("In sliderbumpup routine"):n%=_U%!332:RB%=!n%:iA%=4:
shell_Tracef0("Event block size is "+
RB%):
vB%=4
UC%=16
UC%=20
n%!(iA%+UC%)=f%
:e%=iA%:_value%=n%!(e%+28):
shell_Tracef0("Current slider value = "+
_value%):
shell_Tracef0("Slider handle is = "+
:iA%+=32:
iA%>=RB%
shell_SliderSetValue(e%,_value%+1)
_shell_sliderbumpdown(b%,f%,vB%):
RB%,n%,iA%,j%,e%,_value%,UC%:
shell_Tracef0("In sliderbumpdown routine"):n%=_U%!332:RB%=!n%:iA%=4:
shell_Tracef0("Event block size is "+
RB%):
vB%=4
UC%=20
UC%=16
n%!(iA%+UC%)=f%
:e%=iA%:_value%=n%!(e%+28):
shell_Tracef0("Current slider value = "+
_value%):
shell_Tracef0("Slider handle is = "+
:iA%+=32:
iA%>=RB%
shell_SliderSetValue(e%,_value%-1)
shell_DeleteEventSlider(b%,f%):
d%,a%,p%,i%,c%,rF%:i%=_U%!332:
shell_GetEventListOffset2(b%,f%,_U%+332,32,
shell_Tracef0("DeleteEventSlider:offset% = "+
d%>=0
f%=-1
shell_Tracef0("DeleteEventSlider:Deleting Slider Event (all events for window handle &"+
~b%+")")
shell_Tracef0("DeleteEventSlider:Deleting Slider Event (window handle was &"+
~b%+" icon handle was "+
f%+")")
:p%=!i%:
d%=p%-32
shell_HeapBlockReturn(i%+d%+24):
shell_HeapBlockReturn(_U%!332):_U%!332=0:
shell_Tracef0("DeleteEventSlider:No Slider events now registered")
_U%!332=
shell_HeapBlockExtend(_U%!332,-32):i%=_U%!332:!i%-=32
a%=i%+d%:a%!0=0:a%!4=0:rF%=a%+24:
shell_HeapBlockReturn(rF%)
d%<0:
shell_OpenWindowDynamic(mA$,PA$,QA$):
u%,pA%,rA%,q%:
shell_CreateWindow(mA$,u%):
shell_Tracef0("OpenWindowDynamic:Creating new dynamic window (handle is &"+
~u%+")"):q%=
shell_HeapBlockFetch(36):q%!0=u%:
&400CB,,q%:pA%=(q%!4-q%!&C)/2
y=rA%=(q%!16-q%!8)/2:
shell_HeapBlockReturn(q%):
_U%!20<>0
&400D4,,-1:k%=
shell_DeleteWindow(_U%!20)
:_U%!20=b%:
PA$<>""
shell_Tracef0("OpenWindowDynamic:Calling Pre-Open FN '"+PA$+"'"):k%=
("FN"+PA$+"("+
u%+")")
shell_Tracef0("OpenWindowDynamic:No Pre-Open FN")
shell_OpenWindowDynamic2(u%,pA%,rA%):
QA$<>""
shell_Tracef0("OpenWindowDynamic:Calling Post-Open FN '"+QA$+"'"):k%=
("FN"+QA$+"("+
u%+")")
shell_Tracef0("OpenWindowDynamic:No Post-Open FN")
shell_InteractiveHelpOn:
(_U%!&64
1<<&C)<>0
_U%!&64=_U%!&64
1<<&C
shell_InteractiveHelpOff:
(_U%!&64
1<<&C)<>0
_U%!&64=_U%!&64
1<<&C
shell_MessageSendPrintSave(kE%,tF%):
tF%>1
_U%!336=tF%-1
_U%!336=0
shell_DoSendPrintSave(kE%):
shell_DoSendPrintSave(kE%):
HA%:HA%=
shell_HeapBlockFetch(256):HA%!0=256:HA%!&C=0:HA%!16=&80142:HA%!20=0:HA%!24=0:HA%!28=0:HA%!32=0:HA%!36=256:HA%!40=kE%:$(HA%+44)="PrintOut"+
shell_Tracef0("MessageSendPrintSave:Sending PrintSave message..")
&400E7,18,HA%,HA%!20,HA%!24:
shell_HeapBlockReturn(HA%):
shell_HandlePrintFile(_Q%):
shell_Tracef0("HandlePrintFile:Message_PrintFile received"):
shell_HandlePrintError(_Q%):
shell_Tracef0("HandlePrintError:Message_PrintError received"):
shell_HandlePrintTypeOdd(_Q%):
shell_Tracef0("HandlePrintTypeOdd:Message_PrintTypeOdd received"):
shell_HandleSetPrinter(_Q%):
shell_Tracef0("HandleSetPrinter:Message_SetPrinter received"):
shell_PrinterDriverLoaded:
&A0140
;yB%:
shell_PrinterDriverGetName:
yB%,uF%:
&A0140
,,,,uF%;yB%:
shell_GetString(uF%)
shell_IconGetBGColour(b%,f%):
yA%,t%:t%=
shell_HeapBlockFetch(40):t%!0=b%:t%!4=f%:
&400CE,,t%:yA%=(t%!24>>28)
shell_HeapBlockReturn(t%):=yA%
shell_IconGetFGColour(b%,f%):
yA%,t%:t%=
shell_HeapBlockFetch(40):t%!0=b%:t%!4=f%:
&400CE,,t%:yA%=(t%!24>>24)
shell_HeapBlockReturn(t%):=yA%
shell_AttachPopupMenu(b%,zB%,TC%,m%,Q$):
shell_DoAttachPopupHandler(b%,zB%,TC%,m%,Q$,0):
shell_AttachColourPopupMenu(b%,zB%,TC%,m%,Q$):
shell_DoAttachPopupHandler(b%,zB%,TC%,m%,Q$,1):
shell_DoAttachPopupHandler(b%,zB%,TC%,m%,Q$,SC%):
n%,d%:d%=
shell_GetEventListOffset2(b%,zB%,_U%+340,24,
):n%=_U%!340+d%:n%!0=b%:n%!4=zB%:n%!8=TC%:
Q$<>""
B2n%!&C=
shell_HeapBlockFetch(
Q$+1):$(n%!&C)=Q$
n%!&C=-1
:n%!16=SC%:n%!20=m%:
zB%>=0
shell_IconSetButtonType(b%,zB%,3)
shell_DoPopupSelect(_Q%,d%):
n%,Q$,_item_text$,y%,zC%:
v%,lE%,mE%:n%=_U%!340+d%:v%=!n%:zC%=n%!8:nE%=n%!&C:lE%=n%!16:YA%=n%!20:mE%=!_Q%:_item_text$=
shell_MenuGetItemText(YA%,mE%):y%=0:
nE%<>-1
s<Q$=$(nE%):y%=
("FN"+Q$+"("+
v%+","+
zC%+",_item_text$)")
y%<>0
nE%=-1
zC%>=0
_POPUP_TYPE_TEXT:
shell_IconPutData(v%,zC%,_item_text$,
_POPUP_TYPE_WIMPCOLOUR:
shell_IconSetBGColour(v%,zC%,mE%)
99,"Unknown Popup type in DoPopupSelect (type was "+
lE%+")"
shell_3DEnabled:
xF%,_3d%:
_U%!&64
(1<<&A)
6,&A1,&8C
,,xF%:
_3d%=
_3d%=
_3d%=
:=_3d%
shell_MenuDelete(h%,nG%):
e%,p%,i%:
h%<>0
&65BC3,h%,nG%:p%=
shell_HeapBlockInfo(_U%!&C)-8:i%=_U%!&C:
(i%!(e%+8)=h%)
i%!(e%+8)=0
e%+=48
(e%>=p%)
shell_HandleAttachedDataSave(_Q%,b%,f%):
wA%,a%,HC%,_name$,c%,k%:
shell_DataSaveCheckName(b%,f%):wA%=
shell_GetEventListOffset(b%,-1,_U%+72,24,
wA%>=0
ia%=_U%!72+wA%:HC%=a%!16:_name$=
shell_IconGetData(b%,HC%):c%=a%!20:
$c%<>""
("FN"+$c%+"(_name$)")
shell_WindowMoveToPopUpPos(v%,bA%,yF%):
DA%,AB%,_F%,AG%,BG%,CG%:
DG%:DA%=
shell_HeapBlockFetch(40):DA%!0=v%:DA%!4=bA%:
&400CE,,DA%:_F%=DA%!16:AG%=DA%!20:AB%=
shell_HeapBlockFetch(40):AB%!0=v%:
&400CB,,AB%:BG%=AB%!4:CG%=AB%!16:AB%!0=yF%
&400CB,,AB%:DG%=AB%!16-AB%!8:
shell_WindowMoveTo(yF%,BG%+_F%,CG%+AG%-(DG%/2)):
shell_HeapBlockReturn(DA%):
shell_HeapBlockReturn(AB%):
shell_WindowScrollTo(v%,jC%,kC%):
ZA%:ZA%=
shell_HeapBlockFetch(36):!ZA%=v%:
&400CB,,ZA%:ZA%!20=jC%:ZA%!24=kC%:
shell_WindowIsOpen(v%)
&400C5,,ZA%
&400C5,,ZA%:
&400C6,,ZA%
shell_HeapBlockReturn(ZA%):
shell_WindowScrollBy(v%,jC%,kC%):
ZA%:ZA%=
shell_HeapBlockFetch(36):!ZA%=v%:
&400CB,,ZA%:ZA%!20+=jC%:ZA%!24+=kC%:
shell_WindowIsOpen(v%)
&400C5,,ZA%
&400C5,,ZA%:
&400C6,,ZA%
shell_HeapBlockReturn(ZA%):
shell_WindowSetBackgroundColour(
u%,oE%):
o%,h%,FG%,KB%,qA%:qA%=
shell_WindowCountIcons(u%):FG%=
shell_WindowIsOpen(u%):o%=
shell_HeapBlockFetch(&64+(qA%*32)):o%!0=u%:
&400CC,,o%:o%?39=oE%:_shell_open_behind%=o%!28:KB%=o%!28:
&400C3,,o%
&400C1,,o%+4
h%:o%!0=h%:
&400CC,,o%:
u%<>h%
shell_UpdateWindowHandle(u%,h%):u%=h%
shell_OpenWindow(h%,0,KB%)
shell_HeapBlockReturn(o%):
shell_WindowSetForegroundColour(
u%,oE%):
o%,h%,wB%,KB%:wB%=
shell_WindowIsOpen(b%):o%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(u%)*32)):o%!0=u%:
&400CC,,o%:o%?38=oE%:_shell_open_behind%=o%!28:KB%=o%!28:
&400C3,,o%:
&400C1,,o%+4
u%<>h%
shell_Tracef0("WindowSetForegroundColour:Updating window handle..."):
shell_UpdateWindowHandle(u%,h%):u%=h%
shell_OpenWindow(h%,0,KB%)
shell_HeapBlockReturn(o%):
shell_InstallLib(V$):
kD%:kD%=
(V$):
kD%=0
#kD%:
1,"Unable to install "+V$
#kD%:
V$:V$=
V$,&A):
V$,"."):V$=
V$,".")+1):
("FN_shell_"+V$+"Init")
shell_TemplatesInit(m$,
xG%):
_C%,pE%,GG%,_A%:
HG%,GA%,mD%,R$,IA%,yB%,y%:
IG%,AD%:mD%=
shell_HeapBlockFetch(&C):GA%=0:IA%=0:HG%=
shell_FileLength(m$):DH%=
shell_HeapBlockFetch(HG%):_C%=DH%:
shell_TemplateFileInfo(m$,_A%,IA%,y%):
shell_HeapBlockFetch(4+(20*IA%)):_U%!4=BD%:JG%=
shell_HeapBlockFetch(_A%):pE%=JG%:GG%=JG%+_A%:IA%=0:AD%=4:
&600D9,,m$
;yB%:
shell_MessageTwoArgs("SHELLMSG34","template",m$)
:$mD%="*":
&400DB,,_C%,pE%,GG%,_U%!&E8,mD%,GA%
,,pE%,,,R$,GA%:
GA%<>0
BD%!AD%=_C%:$(BD%+AD%+4)=R$:BD%!(AD%+16)=-1:AD%+=20:
shell_Tracef0("TemplatesInit: Template Loaded: "+R$):IG%=(_C%!84)*32:_C%+=(88+IG%):IA%+=1
GA%=0:
&400DA:_U%!0=IA%
shell_MessageTwoArgs("SHELLMSG35","template",m$)
shell_MessageTwoArgs("SHELLMSG36",m$,"template")
shell_HeapBlockReturn(mD%):xG%=0:!BD%=IA%:
shell_WindowLoaded(N$):
d%,rE%:d%=
shell_GetWindowListOffset(N$):
d%>=0
shell_GetWindowListOffset(N$):
d%,IA%,BB%,g%:
(N$)>&B
shell_MessageOneArg("SHELLMSG02",N$)
iIA%=
shell_GetNrTemplatesLoaded:BB%=
shell_WindowListGetAddr+4:g%=0:d%=-1:
$(((BB%)+(20*g%))+4)=N$
d%=g%*20
:g%+=1:
d%<>-1
g%>(IA%-1):=d%
shell_GetWB(N$):
d%,AB%,BB%:d%=
shell_GetWindowListOffset(N$):BB%=
shell_WindowListGetAddr+4:
d%>=0
AB%=BB%!d%
shell_MessageOneArg("SHELLMSG03",N$)
:=AB%
shell_GetWindowHandleList(N$):
d%,mA%,BB%:d%=
shell_GetWindowListOffset(N$):BB%=
shell_WindowListGetAddr+4:
d%>=0
mA%=!(BB%+d%+16)
shell_MessageOneArg("SHELLMSG03",N$)
:=mA%
shell_CreateWindowStatic(N$,
OC%:OC%=
shell_GetWB(N$):OC%!64=_U%!16:
&400C1,,OC%
shell_StaticWindowListAddHandle(v%):
shell_WindowListAddHandle(v%):
shell_WindowListAddHandle(v%):
NG%,JA%,e%:
BB%:NG%=
shell_GetWindowListOffset(N$)+16:JA%=
shell_WindowListGetAddr+4+NG%:
!JA%=-1
%9!JA%=
shell_HeapBlockFetch(8):e%=!JA%:e%!0=v%:e%!4=-1
shell_Tracef0("DEBUG::Extending window handle list for window '"+N$+"'"):
shell_Tracef0("DEBUG::Window handle is &"+
v%):!JA%=
shell_HeapBlockExtend(!JA%,4):BB%=!JA%:e%=0:
BB%!e%<>-1:e%+=4:
:BB%!(e%+0)=v%:BB%!(e%+4)=-1
shell_GetWindowIdentifier(h%):
JA%,IA%,e%,g%,n$:IA%=
shell_GetNrTemplatesLoaded:JA%=
shell_WindowListGetAddr+4:n$="":
-1,-2:n$="iconbar"
JA%!16<>-1
K7mA%=JA%!16:e%=0:
mA%!e%<>-1:
mA%!e%=h%
n$=$(JA%+4)
e%+=4:
:g%+=1:JA%+=20:
n$<>""
g%=IA%
n$=""
shell_MessageOneArg("SHELLMSG38",
shell_RemoveHandleFromWindowList(h%):
JA%,IA%,I%,e%:IA%=
shell_GetNrTemplatesLoaded:JA%=
shell_WindowListGetAddr+4:
JA%!16<>-1
e4mA%=JA%!16:e%=0:
mA%!e%<>-1:
mA%!e%=h%
mA%!e%=0
e%+=4:
:JA%+=20:
shell_UpdateWindowHandleList(WA%,OA%):
JA%,IA%,I%,e%:IA%=
shell_GetNrTemplatesLoaded:JA%=
shell_WindowListGetAddr+4:
JA%!16<>-1
z7mA%=JA%!16:e%=0:
mA%!e%<>-1:
mA%!e%=WA%
mA%!e%=OA%
e%+=4:
:JA%+=20:
shell_GetNrTemplatesLoaded:
JA%:JA%=
shell_WindowListGetAddr:=!JA%
shell_WindowListGetAddr:=_U%!4
shell_WindowListPrint:
JA%,IA%,I%,e%:IA%=
shell_GetNrTemplatesLoaded:
shell_TraceOn:JA%=
shell_WindowListGetAddr+4:
shell_Tracef0(""):
shell_Tracef0("Current Window List ("+
(IA%)+" templates)")
shell_Tracef0("-----------------------------------------"):
shell_Tracef0($(JA%+4)+":"):
JA%!16=-1
shell_Tracef0("No windows defined for this identifier")
mA%=JA%!16:e%=0:
mA%!e%<>-1:
shell_Tracef0(" window handle &"+
~(mA%!e%)):e%+=4:
:JA%+=20:
shell_Tracef0(""):
shell_TraceOff:
_shell_StaticList_Init:jA%=0:=0
shell_StaticWindowListAddHandle(h%):
d%,g%,c%:
jA%=0
shell_Tracef0("StaticWindowListAddHandle:Creating new list"):
shell_Tracef0("StaticWindowListAddHandle:Window handle is &"+
~h%):jA%=
shell_HeapBlockFetch(8):jA%!0=h%:jA%!4=-1
shell_Tracef0("StaticWindowListAddHandle:Searching for window handle &"+
~h%):d%=
shell_SearchStatic(h%):
d%=-1
shell_Tracef0("StaticWindowListAddHandle:Not found - adding window handle to list"):
shell_Tracef0("StaticWindowListAddHandle:Window handle is &"+
~h%):d%=
shell_SearchStatic(0):
d%=-1
shell_Tracef0("StaticWindowListAddHandle:Extending window handle list"):g%=0:
jA%!g%<>-1:g%+=4:
:jA%=
shell_HeapBlockExtend(jA%,4):c%=jA%+g%:c%!0=h%:c%!4=-1
shell_Tracef0("StaticWindowListAddHandle:Found unused space in list"):c%=jA%+d%:c%!0=h%
shell_RemoveStaticWindowFromList(v%):
d%,g%,j%:j%=
:g%=0:
jA%>0
jA%!g%=v%
:jA%!g%=0
:g%+=4:
jA%!g%<>-1
shell_UpdateStaticWindowHandle(WA%,OA%):
shell_Tracef0("UpdateStaticWindowHandle:Correcting static window list.."):d%=
shell_SearchStatic(WA%):jA%!d%=OA%:
shell_SearchStatic(h%):
j%,g%:j%=-1:g%=0:
jA%<>0
jA%!g%<>-1:
jA%!g%=h%
j%=g%:=j%
:g%+=4:
shell_IsWindowStatic(v%):
-1,-2:y%=
_U%!20:y%=
shell_SearchStatic(v%)>-1
shell_SpriteExists(OG%,U$):
OG%=1
vE%=40
vE%=256+40
46,vE%,OG%,
shell_StringLowerCase(U$):=
shell_SpriteExists
shell_SpriteExistsInUserArea(U$):=
shell_SpriteExists(
shell_UserSpritesBase,U$):|*O
shell_SpriteExistsInUserArea
shell_SpriteExistsInWimpPool(U$):=
shell_SpriteExists(1,U$):|*O
shell_SpriteExistsInWimpPool
shell_IconEnsureVisible(v%,bA%):
aB%,oB%,RG%:
SG%,TG%,UG%:
wE%,xE%,yE%,zE%:
_E%,AF%:
ZG%,aG%:
BF%,CF%:
DF%,EF%:
bA%>=0
shell_HeapBlockFetch(36):oB%=
shell_HeapBlockFetch(40):!aB%=v%:
&400CB,,aB%:RG%=aB%!4:SG%=aB%!8:TG%=aB%!&C:UG%=aB%!16:_E%=aB%!20:AF%=aB%!24:aG%=TG%-RG%:ZG%=UG%-SG%:oB%!0=v%:oB%!4=bA%:
&400CE,,oB%:wE%=oB%!8:xE%=oB%!&C:yE%=oB%!16:zE%=oB%!20
5BF%=_E%:EF%=AF%:DF%=_E%+aG%:CF%=AF%-ZG%:
xE%<CF%
shell_WindowScrollBy(v%,0,xE%-CF%)
zE%>EF%
shell_WindowScrollBy(v%,0,zE%-EF%)
yE%>DF%
shell_WindowScrollBy(v%,yE%-DF%,0)
wE%<BF%
shell_WindowScrollBy(v%,wE%-BF%,0)
shell_HeapBlockReturn(aB%):
shell_HeapBlockReturn(oB%)