home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 5
/
DATAFILE_PDCD5.iso
/
utilities
/
s
/
strip
/
!Strip
/
ShellLibRT
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
1994-05-29
|
98KB
|
3,555 lines
>EvntShell:ShellLib
Squished by Lofty's !Shrink vsn 3.01 on 29-May-94
shell_LibraryVersion:=1.33*&64
shell_Error:
FA%,VA$:
<>&D00
<>&903
&606C2:
shell_OSCheckVersion(3)
shell_FileExists("Resources:$.Resources.Edit.ThrowBack")
shell_Exit:
("Set Basic$File <"+
shell_GetAppName+"$BasicFile>"):
"Edit:ThrowBack"
shell_ErrorBox("Unexpected error:- "+
$+" Internal error code "+
$,"in "+
34+"EvntShell:ShellLib"):
FA%>0
$,FA%-1)
shell_ErrorBox(VA$)
&606C2:
shell_OK(YA$):
&D00,YA$
shell_ErrorBox(fA$):
LB%,wA%:wA%=_shell_blk%:!wA%=
:$(wA%+4)=fA$+
=&D00
=&903
&600DF,wA%,17,"Message from "+
shell_GetAppName
&600DF,wA%,1,
shell_GetAppName
shell_GetLastSecureFileName:
c%:c%=_U%!80:
shell_GetString(cE%):
SA$,hC%:
((cE%?hC%)>31
hC%<&FF):SA$+=
(cE%?hC%):hC%+=1:
:=SA$
shell_GetEventHandler(b%,y%,IC%):
e%,h%,j%,p%,A$:
b%=-1
b%=-2
ZNp%=
shell_HeapBlockInfo(_U%!&C)-8:e%=0:j%=
:h%=_U%!&C:A$="":
(h%!e%=b%)
h%!(e%+4)
h%!(e%+(&C+(IC%*4)))>&8000
h#A$=$(h%!(e%+(&C+(IC%*4)))):j%=
e%+=48
h%!(e%+4)=y%
h%!(e%+(&C+(IC%*4)))>&8000
u#A$=$(h%!(e%+(&C+(IC%*4)))):j%=
e%+=48
e%+=48
e%+=48
((e%>=p%)
j%):=A$
shell_GetEventMenu(YB%,b%,y%):
e%,h%,j%,p%,m%:
b%=-1
b%=-2
shell_HeapBlockInfo(_U%!&C)-8:e%=0:j%=
:h%=_U%!&C:A$="":
(h%!e%=b%)
shell_Tracef0("GetEventMenu:window handle matched.."):
h%!(e%+4)=y%
"m%=h%!(e%+8):
m%=-2
m%=_U%!&FC
:e%+=48:
(e%>=p%
j%):=m%
shell_GetEventListOffset(b%,f%,h%,_A%,MC%):
p%,e%,j%,d%,yA%,c%:
(!h%=0
(!h%=0)
:!h%=
shell_HeapBlockFetch(_A%):c%=!h%:c%!0=0:c%!4=0:=0
shell_HeapBlockInfo(!h%)-8:e%=0:j%=
:d%=-1:yA%=-1:c%=!h%:
yA%<0
(c%!e%=0
c%!e%+4=0)
yA%=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%+=_A%
e%+=_A%
((e%>=p%)
(d%=-1
yA%<0
Id%=p%:!h%=
shell_HeapBlockExtend(!h%,_A%):c%=!h%:c%+=d%:c%!0=0:c%!4=0
d%=yA%
shell_AttachPane(b%,
lC%,n%,gA%,fA%):
a%,d%,c%,KB%,qD%:
shell_Tracef0("AttachPane:Attaching Pane Handler"):qD%=
shell_WindowGetFlags(lC%):
1<<5)=0
shell_Tracef0("AttachPane:'Pane' bit of pane window is not set, fixing.."):
shell_WindowToggleFlags(lC%,1<<5)
1<<1)
shell_Tracef0("AttachPane:'Moveable' bit of pane window is set, fixing.."):
shell_WindowToggleFlags(lC%,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:KB%=0:
c%!g%<>-1:g%+=4:KB%+=1:
:a%!8=
shell_HeapBlockExtend(a%!8,4):c%=a%!8:c%!(KB%*4)=lC%:c%!((KB%+1)*4)=-1:a%!&C=
shell_HeapBlockExtend(a%!&C,4):c%=a%!&C:c%!(KB%*4)=n%:c%!((KB%+1)*4)=-1
a%!16=
shell_HeapBlockExtend(a%!16,4):c%=a%!16:c%!(KB%*4)=gA%:c%!((KB%+1)*4)=-1:a%!20=
shell_HeapBlockExtend(a%!20,4):c%=a%!20:c%!(KB%*4)=fA%:c%!((KB%+1)*4)=-1:
shell_AttachDataLoad(b%,f%,w%,A$,zF%):
a%,c%,d%,N$:
shell_Tracef0("AttachDataLoad:Attaching DataLoad Handler"):
b%=-1
b%=-2
w%=w%
1<<31
2Pd%=
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%:a%!8=
shell_HeapBlockFetch(8):c%=a%!8:c%!0=w%:c%!4=-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..."):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%=w%:c%!(g%+4)=-1:c%=a%!&C:c%!g%=
shell_HeapBlockFetch(
A$+1)
c%=c%!g%:$c%=A$
shell_GetCmdLineArgs:
shell_Tracef0("AttachDataLoad:cmdline ="+N$):
shell_Tracef0("AttachDataLoad:flag bit ="+
((_U%!&64
1<<5))):
shell_Tracef0("AttachDataLoad:wh% ="+
~b%):
shell_Tracef0("AttachDataLoad:type% ="+
N$<>""
(_U%!&64
1<<5)
1<<31
c%=w%
1<<31
c%=w%
shell_FileType(N$)=c%
shell_Tracef0("AttachDataLoad:Loading file.."):
shell_MessageSendDataLoad(c%,N$):_U%!&64=_U%!&64
(1<<5)
shell_AttachDataSave(b%,f%,MB%,w%,iB%,A$):
a%,c%,d%:
shell_IconIsSprite(b%,f%)
shell_OK(
shell_MessageNoArgs("SHELLMSG29"))
shell_IconSetButtonType(b%,f%,6):
MB%=0
MB%=&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=MB%:a%!&C=w%
wHa%!16=iB%:a%!20=
shell_HeapBlockFetch(
(A$)+1):c%=a%!20:$c%=A$:
&FF9:
MB%>&8000
'_U%!&88=
shell_HeapBlockInfo(MB%)-8
_U%!&88=MB%
MB%>&8000
'_U%!&88=
shell_HeapBlockInfo(MB%)-4
_U%!&88=MB%
:_U%!&8C=w%:_U%!&90=MB%:
shell_AttachMenu(b%,y%,m%,_B%,HC%,gC%):
y%>=0
shell_IconSetButtonType(b%,y%,3)
shell_SearchStatic(_U%!&B8,b%):
d%=-1
shell_OK(
shell_MessageNoArgs("SHELLMSG30"))
shell_Tracef0("AttachMenu:Attaching menu handle &"+
~m%+" to window handle &"+
~b%):
shell_EventAdd(b%,y%,0,m%,""):
shell_AttachMenuMaker(b%,y%,A$):
shell_Tracef0("AttachMenuMaker:Attaching menumaker function '"+A$+"'"):
shell_EventAdd(b%,y%,1,0,A$):
shell_AttachMenuDBox(GB%,M$,TA$,QA$):
a%,c%,vA%:
shell_WindowLoaded(M$)
shell_MessageOneArg("SHELLMSG03",M$)
shell_HeapBlockFetch(&C):a%!0=
shell_HeapBlockFetch(
M$+1):c%=a%!0:$c%=M$:a%!4=
shell_HeapBlockFetch(
TA$+1):c%=a%!4:$c%=TA$:a%!8=
shell_HeapBlockFetch(
QA$+1):c%=a%!8:$c%=QA$:
&45BCE,GB%,a%:
&45BCC,,
shell_AttachClickSelect(b%,y%,A$):
shell_EventAdd(b%,y%,2,0,A$):
shell_AttachClickAdjust(b%,y%,A$):
shell_EventAdd(b%,y%,3,0,A$):
shell_AttachUserRedraw(
b%,A$):
a%,QA%:a%=
shell_HeapBlockFetch(40):!a%=b%:
&400CB,,a%:QA%=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%,y%,FG%,A$):
shell_EventAdd(b%,y%,6,0,A$):
shell_AttachHelpTag(b%,y%,I$):
shell_EventAdd(b%,y%,8,0,I$):
shell_EventAdd(b%,y%,IC%,m%,A$):
e%,eB%,h%,p%,j%:
iC%:e%=0:j%=
b%=-1
b%=-2
shell_HeapBlockInfo(_U%!&C)-8:h%=_U%!&C:
(h%!e%=b%)
h%!(e%+4)=y%
e%+=48
e%+=48
(e%>=p%
%e%=0:
(h%!e%<>0):e%+=48:
e%>=p%
_U%!&C=
shell_HeapBlockExtend(_U%!&C,48):h%=_U%!&C:h%!(e%+0)=0:h%!(e%+4)=0:h%!(e%+8)=0:h%!(e%+&C)=0:h%!(e%+16)=0:h%!(e%+20)=0:h%!(e%+24)=0:h%!(e%+28)=0:h%!(e%+32)=0:h%!(e%+36)=0:h%!(e%+40)=0:h%!(e%+44)=0
:h%!(e%+0)=b%:h%!(e%+4)=y%:
m%<>0
h%!(e%+8)=m%
:iC%=e%+(&C+(IC%*4)):
h%!iC%<>0
shell_HeapBlockReturn(h%!iC%)
:eB%=
shell_HeapBlockFetch(
A$+1):$eB%=A$:h%!iC%=eB%:
shell_EventDeleteAll(b%):
e%,m%,j%,p%,h%,s%:e%=0:m%=0:j%=
b%=-1
b%=-2
.>p%=
shell_HeapBlockInfo(_U%!&C)-8:h%=_U%!&C:
(h%!e%=b%)
e%+=48
(e%>=p%
8Ch%!(e%+0)=0:h%!(e%+4)=0:h%!(e%+8)=0:
s%=&C
h%!(e%+s%)<>0
shell_HeapBlockReturn(h%!(e%+s%)):h%!(e%+s%)=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%,h%,c%:h%=_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
LA%=h%!&C:c%=LA%!&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%=h%+d%:a%!0=0:a%!4=0:a%!8=0:LA%=a%!&C:
shell_HeapBlockReturn(LA%!&C):
shell_HeapBlockReturn(LA%!16):
shell_HeapBlockReturn(LA%)
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%=h%+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(I$):=
shell_MessageLookup(I$,"","")
shell_MessageOneArg(I$,IA$):=
shell_MessageLookup(I$,IA$,"")
shell_MessageLookup(I$,IA$,jA$):
n%,L%,g$,bC%,mB%:
I$,8)="SHELLMSG"
bC%=_U%!284:mB%=_U%!280
bC%=_U%!64:mB%=_U%!68
&61502,mB%,I$,bC%,256,IA$,jA$
,,,L%;n%:
bC%?L%=&D:g$=$(bC%)
shell_WimpInit(QC%,DA$):
&400C0,QC%,&4B534154,DA$
QC%,bA%:
_U%!&64
"WimpExt_Initialise",&E,bA%
:_U%!&94=bA%:=bA%
shell_WimpInit_I(QC%,DA$):
&400C0,QC%,&4B534154,DA$
QC%,bA%:
_U%!&64
"WimpExt_Initialise",&E,bA%
:_U%!&94=bA%:
&81682,bA%:=bA%
shell_WimpCloseDown_I(bA%):
shell_LoseFonts:
_U%!&F0<>-1
"XFontMenu_Release"
_U%!&64
"WimpExt_Initialise",&E,bA%
&600DD,bA%,&4B534154:
&A1683,bA%:
_U%!&64
"XImpulse_CloseDown",_U%!&94
WimpCloseDown(bA%):
shell_LoseFonts:
_U%!&F0<>-1
"XFontMenu_Release"
_U%!&64
"WimpExt_Initialise",&E,bA%
&600DD,bA%,&4B534154:
_U%!&64
"XImpulse_CloseDown",_U%!&94
("Unset "+_shell_AppName$+"$BasicFile"):
shell_LoseFonts:
s%,c%:c%=_U%!&E8:
c%?s%>0:
&40082,s%:c%?s%-=1:
shell_FindFont(b$,tF%):
QA%,vD%:vD%=_U%!&E8:
&40081,,b$,tF%*16,c*16,0,0
QA%:vD%?QA%+=1:
vD%?QA%>=&FF
shell_OK(
shell_MessageNoArgs("SHELLMSG18"))
shell_Init:
iA%,s%,c%,N$:
qA%,D$,E$:
_U%360,_shell_blk%260:_Q%=
shell_HeapBlockFetch(&BB8):iA%=
shell_HeapBlockFetch(48):iA%!0=0:iA%!4=0:iA%!8=0:iA%!&C=0:iA%!16=0:iA%!20=0:iA%!24=0:iA%!28=0:iA%!32=0:iA%!36=0:iA%!40=0:iA%!44=0:_U%!0=0:_U%!4=0:_U%!8=0
_U%!&C=iA%:_U%!16=1:_U%!20=0:_U%!24=0:_U%!28=0:_U%!32=0:_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)
shell_HeapBlockFetch(256):D$=
shell_OSVarGetVal(qA%,256,"Obey$Dir",1):
shell_HeapBlockReturn(qA%):E$=
shell_Leaf(D$),2):_U%!&BC=
shell_HeapBlockFetch((
D$)+1):_U%!&C4=
shell_HeapBlockFetch((
E$)+1):c%=_U%!&BC:$c%=D$:c%=_U%!&C4:$c%=E$
shell_OSReadCommandArg(1):
N$<>""
L_U%!&64=_U%!&64
1<<5:c%=
shell_HeapBlockFetch(
N$+1):$(c%)=N$:_U%!324=c%
shell_OSModuleCheckVersion("WimpExtension",1.98):
_U%!&64=_U%!&64
RO3_Present:
_U%!&64=_U%!&64
1<<&A
_U%!&64=_U%!&64
1<<&C:
shell_GetCmdLineArgs:
_U%!324<>0
N$=$(_U%!324)
shell_Tracef0("GetCmdLineArgs:cmdline was "+N$):=N$
shell_FileType(d$):
8,5,d$
,,w%:w%=(w%
&FFF00)>>>8:=w%
shell_FileExists(d$):
shell_CatInfoRead(d$)="Not Found":=
shell_CatInfoRead(d$):
w%,JD%,kC%,DB%,FC%,B$:
8,5,d$
w%,,JD%,kC%,DB%,FC%:
="Not Found"
FC%=51
B$+="WR "
FC%=&BB
B$+="LWR"
FC%=&88
B$+="DL "
B$+=" "+
shell_StringPadLeading(
~JD%,"0",8):B$+=" "+
shell_StringPadLeading(
~kC%,"0",8):B$+=" "+
shell_StringPadLeading(
~DB%,"0",8):=B$
shell_GetAppDir:
c%:c%=_U%!&BC:=$c%
shell_GetAppDataDir:
c%:c%=_U%!&C0:=$c%
shell_GetAppName:
c%:c%=_U%!&C4:=$c%
shell_ResourcesInit:
AA$,c%,E$,D$,nC%:
qA%,qB%,OC%:E$=
shell_GetAppName:D$=
shell_GetAppDir:qA%=
shell_HeapBlockFetch(256):
shell_OSVarExists(qA%,E$+"Res$Path")
_U%!&64=_U%!&64
shell_OSVarExists(qA%,E$+"Data$Dir")
nAA$=
shell_OSVarGetVal(qA%,256,E$+"Data$Dir",1):_U%!&C0=
shell_HeapBlockFetch((
AA$)+1):c%=_U%!&C0:$c%=AA$
_U%!&C0=
shell_HeapBlockFetch((
D$)+1):c%=_U%!&C0:$c%=D$
_U%!&64
shell_FileExists(E$+"Res:Messages")
shell_MessagesInit(E$+"Res:Messages",_U%!68,_U%!64)
shell_FileExists(E$+"Res:ShellMsgs")
shell_MessagesInit(E$+"Res:ShellMsgs",_U%!280,_U%!284)
shell_MessagesInit("EvntShellRes:ShellMsgs",_U%!280,_U%!284)
&20035,-1,4
,,OC%:
&20035,-1,5
,,qB%:
qB%=1
shell_FileExists(E$+"Res:Sprites22")
#4_U%!16=
shell_SpriteAreaLoad(E$+"Res:Sprites22")
shell_FileExists(E$+"Res:Sprites")
'2_U%!16=
shell_SpriteAreaLoad(E$+"Res:Sprites")
_U%!16=1
:nC%=
shell_3DEnabled:
shell_FileExists(E$+"Res:Templates3")
shell_TemplatesInit(E$+"Res:Templates3")
shell_FileExists(E$+"Res:Templates")
shell_TemplatesInit(E$+"Res:Templates")
shell_FileExists(D$+".Messages")
shell_MessagesInit(D$+".Messages",_U%!68,_U%!64)
shell_FileExists(D$+".ShellMsgs")
shell_MessagesInit(D$+".ShellMsgs",_U%!280,_U%!284)
shell_MessagesInit("EvntShellRes:ShellMsgs",_U%!280,_U%!284)
&20035,-1,4
,,OC%:
&20035,-1,5
,,qB%:
qB%=1
shell_FileExists(D$+".Sprites22")
E1_U%!16=
shell_SpriteAreaLoad(D$+".Sprites22")
shell_FileExists(D$+".Sprites")
H/_U%!16=
shell_SpriteAreaLoad(D$+".Sprites")
_U%!16=1
:nC%=
shell_3DEnabled:
shell_FileExists(D$+".Templates3")
shell_TemplatesInit(D$+".Templates3")
shell_FileExists(D$+".Templates")
shell_TemplatesInit(D$+".Templates")
&45BC0:
shell_HeapBlockReturn(_Q%):_Q%=
shell_HeapBlockFetch(&400):
shell_HeapBlockReturn(qA%):
shell_SpriteAreaLoad(C$):
OB%,S%,T%:S%=
(C$):T%=
#S%+16:
#S%:OB%=
shell_HeapBlockFetch(T%):!OB%=T%:OB%!4=0:OB%!8=16:OB%!&C=16:
46,521,OB%:
46,522,OB%,C$:
shell_Tracef0("SpriteLoad:Sprite file loaded at &"+
~OB%):=OB%
shell_UserSpritesBase:=_U%!16
shell_SpriteGetPtr(CC%,R$):
TB%,e%:TB%=
shell_HeapBlockFetch(21):$TB%=R$:
46,280,CC%,TB%
,,e%:
shell_HeapBlockReturn(TB%):=e%
shell_TemplatesInit(C$):
WC%,WD%,RE%,X%,e%,eA%:
eE%,FA%,HD%,R$,SA%,aB%,_%:
jA%,DD%,LE%,NC%,pA$,AA%:HD%=
shell_HeapBlockFetch(20):FA%=0:SA%=0:eE%=
shell_FileLength(C$):VE%=
shell_HeapBlockFetch(eE%):WC%=VE%:
shell_TemplateFileInfo(C$,eA%,SA%,_%)
|_U%!4=
shell_HeapBlockFetch(20*SA%):fE%=
shell_HeapBlockFetch(eA%):WD%=fE%:RE%=fE%+eA%:SA%=0:
&600D9,,C$
;aB%:
shell_MessageTwoArgs("SHELLMSG34","template",C$)
:$HD%="*":
&400DB,,WC%,WD%,RE%,_U%!&E8,HD%,FA%
,,WD%,,,R$,FA%:
FA%<>0
!((_U%!4)+(16*SA%))=WC%:$(((_U%!4)+(16*SA%))+4)=R$:
shell_Tracef0("TemplatesInit: Template Loaded: "+R$):WC%+=(88+(WC%!84)*32):SA%+=1
FA%=0:
&400DA:_U%!0=SA%:
shell_Tracef0("TemplatesInit:Templates resource file loaded at &"+
~VE%+" ("+
SA%+" templates)"):
shell_Tracef0("TemplatesInit:Indirected buffer size used for loading &"+
~eA%)
shell_MessageTwoArgs("SHELLMSG35","template",C$)
shell_MessageTwoArgs("SHELLMSG36",C$,"template")
shell_HeapBlockReturn(HD%):
shell_WindowLoaded(M$):
s%,j%:
(M$)>&C
shell_MessageOneArg("SHELLMSG02",M$)
(_U%!0)-1:
$(((_U%!4)+(16*s%))+4)=M$
:s%=(_U%!0)-1
s%:=j%
shell_GetWB(M$):
s%,j%:
(M$)>&C
shell_MessageOneArg("SHELLMSG02",M$)
5j%=-1:
(_U%!0)-1:
$(((_U%!4)+(16*s%))+4)=M$
j%=s%:s%=(_U%!0)-1
j%>-1
=!((_U%!4)+(16*j%))
shell_MessageOneArg("SHELLMSG03",M$)
shell_MessageExpand(a$):
L$,g$,xA%:L$="":
a$,"\")>0:xA%=
a$,"\"):L$+=
a$,xA%-1):g$=
a$,xA%+1,1):a$=
a$,xA%+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$+="\"+g$
:=L$+a$
shell_OpenMenu(IA%,MA%,rA%):
A$:A$=
shell_GetEventHandler(_U%!28,_U%!32,1):
A$<>""
shell_Tracef0("OpenMenu:About to call "+"FN"+A$+"("+
_U%!28+","+
_U%!32+")"):o%=
("FN"+A$+"(_U%!28,_U%!32)")
shell_Tracef0("OpenMenu:no menumaker function registered")
rA%<>_U%!24
shell_HeapBlockExists(_U%!256)
shell_HeapBlockReturn(_U%!256):_U%!256=0
shell_HeapBlockExists(_U%!&F4)
shell_HeapBlockReturn(_U%!&F4):_U%!&F4=0
rA%=_U%!&FC
&400D4,,rA%,IA%-64,MA%:_U%!264=1
_Q%!0=IA%:_Q%!4=MA%:
&45BC5,rA%,_Q%:_U%!264=0
:_U%!24=rA%:_U%!36=IA%:_U%!40=MA%:_U%!52=_U%!28:_U%!56=_U%!32:
shell_MenuLastXPos:=_U%!36
shell_MenuLastYPos:=_U%!40
shell_MenuAttachDbox(e$):
"Menu_SetSubHandle",_U%!8,
shell_MenuString(e$),1:
shell_Tracef0("MenuAttachDbox:Dialog box ("+e$+") attached"):
shell_MessageWindow(H$,SF%,iA$,n$):
fD%,wA%:wA%=
shell_HeapBlockFetch(260):!wA%=0:$(wA%+4)=H$+
n$=""
n$="Message from "+iA$
&400DF,wA%,19,n$
&400DF,wA%,17,n$
shell_HeapBlockReturn(wA%):=fD%
shell_CreateWindow(z$,
tB%:tB%=
shell_GetWB(z$):tB%!64=_U%!16:
&400C1,,tB%
shell_CreateWindow2(N,n%,iF%,hF%,QF%,kA%,LD%,lA%,LB%,SB%):
Q%:Q%=
shell_HeapBlockFetch(&BB8):Q%!0=LD%:Q%!4=lA%:Q%!8=LB%:Q%!&C=SB%:Q%!16=0:Q%!20=0:Q%!24=-1:Q%!28=n%:Q%?32=7:Q%?33=2:Q%?34=iF%:Q%?35=hF%:Q%?36=3:Q%?37=1:Q%?38=2:Q%?39=0:Q%!40=0:Q%!44=kA%
Q%!48=QF%: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%):=i%
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%):
n%,a%:a%=
shell_HeapBlockFetch(36):a%!0=b%:
&400CB,,a%:n%=a%!32:
shell_HeapBlockReturn(a%):=n%
shell_WindowGetTitleFlags(b%):
n%,a%:a%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):a%!0=b%:
&400CC,,a%:n%=a%!60:
shell_HeapBlockReturn(a%):=n%
shell_IconGetFlags(b%,f%):
n%,a%:a%=
shell_HeapBlockFetch(50):a%!0=b%:a%!4=f%:
&400CE,,a%:n%=a%!24:
shell_HeapBlockReturn(a%):=n%
shell_WindowTitleFlags(b%):
n%,a%:a%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):a%!0=b%:
&400CC,,a%:n%=a%!60:
shell_HeapBlockReturn(a%):=n%
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%):
S$,a%:a%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):a%!0=b%:
&400CC,,a%:
(a%!32
1<<26)
((a%!60)
256)=0
S$=$(a%+76)
S$=$(!(a%+76))
shell_HeapBlockReturn(a%):=S$
shell_WindowTitleBufferLength(b%):
_%,a%:a%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):a%!0=b%:
&400CC,,a%:
((a%!60)
256)=0
< _%=&C
_%=a%!84
shell_HeapBlockReturn(a%):=_%
shell_WindowMoveToIcon(b%,YD%,f%,gA%,fA%):
r%,t%:r%=
shell_HeapBlockFetch(50):t%=
shell_HeapBlockFetch(36):t%!20=0:
shell_OSCheckVersion(3)
YD%=-1
!t%=-2
!t%=YD%
&400CB,,t%
:r%!0=YD%:r%!4=f%:
&400CE,,r%:
shell_WindowMoveTo(b%,r%!8+gA%-t%!20,r%!20+fA%):
shell_HeapBlockReturn(r%):
shell_HeapBlockReturn(t%):
shell_WindowMoveTo(b%,IA%,MA%):
SE%,UE%,d%,a%:a%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):a%!0=b%:
&400CC,,a%:SE%=a%!&C-a%!4:UE%=a%!16-a%!8:a%!4=IA%:a%!8=MA%:a%!&C=IA%+SE%:a%!16=MA%+UE%:
&400C5,,a%:
&400C6,,a%
k.d%=
shell_SearchStatic(_U%!&B8,b%):
d%>-1
shell_OpenWindowStatic(b%)
shell_OpenWindowDynamic2(b%,0,0)
shell_HeapBlockReturn(a%):
shell_WindowBringToTop(b%):
oB%:oB%=
shell_HeapBlockFetch(256):oB%!0=b%:
&400CB,,oB%:oB%!28=-1:
&400E7,2,oB%,b%:
&400C7,0,oB%:
shell_HeapBlockReturn(oB%):
shell_UpdateWindow(i%,LD%,lA%,LB%,SB%):
a%:a%=
shell_HeapBlockFetch(a%):a%!0=i%:a%!4=LD%:a%!8=lA%:a%!&C=LB%:a%!16=SB%:
&400C9,,a%
&400CB,,a%:
shell_HeapBlockReturn(a%):
shell_OpenWindowDynamic2(b%,gA%,fA%):
o%,zA%:zA%=
shell_HeapBlockFetch(20):_U%!20=b%:
&400CF,,zA%:
&400D4,,b%,zA%!0+gA%,zA%!4+fA%:
shell_HeapBlockReturn(zA%):
shell_ClaimKeypress:
_U%!20<>0
&400D4,,-1:o%=
shell_DeleteWindow(_U%!20):_U%!20=0
shell_OpenWindow(b%,xD%,_D%):
d%,a%,u%,g%,yE%,uC%,UA%,sA%:
vB%,yB%,SB%,KE%,JE%,KC%,LC%:d%=
shell_GetEventListOffset(b%,-1,_U%+304,&C,
d%>=0
ga%=_U%!304+d%:c%=a%!8:
shell_Tracef0("OpenWindow:About to call "+"FN"+$c%):KC%=
("FN"+$c%):
KC%=0
:yB%=
:SB%=
shell_HeapBlockFetch(40):SB%!0=b%:
&400CB,,SB%:
(SB%!32
&80000)=&80000
shell_HeapBlockReturn(SB%):LC%=
shell_HeapBlockFetch(20):
&400CF,,LC%:_Q%!0=b%:
&400CB,,_Q%
&400C5,,_Q%
shell_GetEventListOffset(b%,-1,_U%+92,24,
d%>-1
Ya%=(_U%!92)+d%:xB%=a%!8:wD%=a%!&C:dB%=a%!16:zB%=a%!20:_Q%!0=b%:
uC%=-1
uC%=_Q%!28
&400C5,,_Q%:
&400CB,,_Q%:
&400C6,,_Q%
shell_HeapBlockFetch(40):g%=0:
xB%!g%<>-1:u%!0=xB%!g%:
yE%=0
yE%=u%!0
7KE%=u%!0:
&400CB,,u%:
LC%!16=-9
LC%!16>-5
vB%=wD%!g%:
0,1:UA%=u%!16-u%!8:sA%=u%!&C-u%!4:u%!4=_Q%!4+dB%!g%:u%!&C=u%!4+sA%:u%!16=_Q%!16+zB%!g%:u%!8=u%!16-UA%
2:UA%=u%!16-u%!8:sA%=_Q%!&C-_Q%!4:u%!4=_Q%!4+dB%!g%:u%!&C=_Q%!&C:u%!16=_Q%!16+zB%!g%:u%!8=u%!16-UA%
3:UA%=_Q%!16-_Q%!8:sA%=u%!&C-u%!4:u%!4=_Q%!4+dB%!g%:u%!&C=u%!4+sA%:u%!16=_Q%!16:u%!8=_Q%!8+zB%!g%
4:UA%=u%!16-u%!8:sA%=_Q%!&C-_Q%!4:u%!4=_Q%!4+dB%!g%:u%!&C=_Q%!&C:u%!16=_Q%!8+UA%+zB%!g%:u%!8=u%!16+UA%
5:UA%=_Q%!16-_Q%!8:sA%=u%!&C-u%!4:u%!4=_Q%!&C-sA%+dB%!g%:u%!&C=u%!4+sA%:u%!16=_Q%!16:u%!8=_Q%!8
u%!28=uC%
u%!28=JE%
&400C5,,u%
:JE%=u%!0:g%+=4:
_Q%!28=KE%:
&400C5,,_Q%
shell_HeapBlockReturn(u%)
_Q%!0=b%:
&400CB,,_Q%
uC%=-2
_Q%!28=-2
_D%=-1
_Q%!28=-1
&400C5,,_Q%
shell_HeapBlockReturn(LC%):
shell_CloseWindow(b%):
d%,a%,xB%,wD%,dB%,zB%,q%,KC%: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%):KC%=
("FN"+$c%):
KC%=0
shell_HeapBlockFetch(60):
5;d%=
shell_GetEventListOffset(b%,-1,_U%+92,24,
d%>-1
7la%=(_U%!92)+d%:wD%=a%!&C:dB%=a%!16:zB%=a%!20:g%=0:xB%=a%!8:
xB%!g%<>-1:q%!0=xB%!g%:
&400C6,,q%:g%+=4:
:q%!0=b%:
&400C6,,q%
shell_HeapBlockReturn(q%):
shell_DeleteWindow(i%):
q%:q%=
shell_HeapBlockFetch(20):
i%<>0
oktodeletew(i%)
shell_EventDeleteAll(i%):
i%=_U%!20
_U%!20=0
U.d%=
shell_SearchStatic(_U%!&B8,i%):
d%>-1
c%=_U%!&B8+d%:c%!0=0
:q%!0=i%:
&400C3,,q%:i%=0
shell_HeapBlockReturn(q%):=i%
oktodeletew(i%):=-1
oktoclosew(i%):=-1
cliprect(A,
fF%):
KA%,PA%:
lwaorigin(A,KA%,PA%):VA%=A!24-KA%:cA%=A!28-PA%:qF%=A!32-KA%:fF%=A!36-PA%:
poll(fC%,FF%):
_U%!&64
"WimpExt_PrePoll"
&400C7,fC%,_Q%
_U%!&64
"WimpExt_Action",_U%!&94,_Q%,HA%
shell_Poll_I(fC%,FF%):
_U%!&64
"WimpExt_PrePoll"
&400C7,fC%,_Q%
_U%!&64
"WimpExt_Action",_U%!&94,_Q%,HA%
&81686,HA%,,FF%:=HA%
shell_DoBackgroundTask:
shell_IconIsDraggable(b%,f%):
n%:n%=
shell_IconGetFlags(b%,f%):c%=(n%
&6000):
c%=&6000=
shell_IconIsSprite(b%,f%):
n%,c%:n%=
shell_IconGetFlags(b%,f%):c%=(n%
1<<1):
c%=(1<<1)
shell_IconDragBox(b%,f%):
a%,H,J,mA%,n%,QA%,mE%,vE%,wB%,JA$:
iB%,R$:mA%=
shell_GetEventListOffset(b%,f%,_U%+72,24,
mA%>=0
na%=_U%!72+mA%:iB%=a%!16:R$=
shell_IconGetData(b%,iB%):
R$=""
shell_OK(
shell_MessageNoArgs("SHELLMSG28"))
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):!a%=b%:
&400CC,,a%:H=a%!4-a%!20:J=a%!16-a%!24:vE%=a%!68:a%!4=f%:
&400CE,,a%:!a%=b%:a%!4=5:n%=a%!24:wB%=a%!32:a%!8=a%!8+H:a%!&C=a%!&C+J:a%!16=a%!16+H:a%!20=a%!20+J:a%!24=0:a%!28=0
Ja%!32=&7FFFFFFF:a%!36=&7FFFFFFF:
6,&A1,28
,,QA%:mE%=((QA%
2)=2):
QA%=n%:
&JA$=
shell_IconGetCommand(wB%,"s")
shell_OK(
shell_MessageNoArgs("SHELLMSG19"))
JA$<>""
&42400,&85,vE%,JA$,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.."):mA%=
shell_GetEventListOffset2(b%,f%,_U%+332,32,
shell_Tracef0("IconDragBox:event offset is "+
mA%):
mA%>=0
shell_HandleSlider(b%,f%,mA%)
shell_HandleAttachedMenu(_Q%,b%,f%):
f%<>-1
b%>-1
shell_GetEventMenu(_Q%!8,b%,f%):
m%<>0
shell_HandleMenuOpen(_Q%,m%,b%,f%,
shell_Action(kF%):
A$,m%,e$,oA$,NB%,tA%,HB%,ND%:
b%,f%,o%,_temp28%,_temp32%,_temp24%,_temp%,RD%:
YC%,d%:
shell_DoBackgroundTask:
(_U%!&64
1<<&B)
shell_Slider
shell_RedrawWindow(_Q%!0)
shell_OpenWindow(_Q%!0,
shell_CloseWindow(_Q%!0)
shell_PointerLeavingWindow(_Q%)
shell_PointerEnteringWindow(_Q%)
6:_U%!28=_Q%!&C:_U%!32=_Q%!16:tA%=_Q%!0:HB%=_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):
<W$="Icon is draggable":
shell_IconDragBox(_Q%!&C,_Q%!16)
W$="Icon is not draggable"
shell_Tracef0("Action:"+W$)
_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$):o%=
("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:ND%=
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%)
17,18:
shell_Receive(_Q%)
shell_UserMessageAcknowledge(_Q%)
shell_ActionSelectButton:
shell_Tracef0("ActionSelectButton:Mouse Button was SELECT"):
_U%!32>=0
Z=d%=
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)))
shell_HandleMenuOpen(_Q%,!(_U%!340+d%+20),_Q%!&C,_Q%!16,
shell_HandleAttachedMenu(_Q%,_U%!28,_U%!32):
_U%!32=0
shell_HandleAttachedDataSave(_Q%,_U%!28,_U%!32)
f7A$=
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%+")"):o%=
("FN"+A$+"(_temp28%,_temp32%)")
_U%!32=0
_U%!28=_U%!20
&400D4,,-1
shell_ActionMenuButton:
c%,m%,aC%,d%:aC%=
shell_Tracef0("ActionMenuButton:Mouse Button was MENU"):
_Q%!16>=0
shell_GetEventListOffset2(_Q%!&C,_Q%!16,_U%+340,24,
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,aC%)
shell_HandleMenuOpen(_Q%,m%,b%,f%,aC%):
r%,t%:
shell_OpenMenu(_Q%!0,_Q%!4,m%)
shell_HeapBlockFetch(50):t%=
shell_HeapBlockFetch(36):r%!0=b%:r%!4=f%:
&400CE,,r%:t%!0=b%:
&400CB,,t%:
shell_OpenMenu(t%!4+r%!16+64,_Q%!4,m%):
t%!4+r%!16+64,_Q%!4:
shell_HeapBlockReturn(r%):
shell_HeapBlockReturn(t%)
shell_ActionMenuSelect(_Q%):
AE%,NB%,YC%,RD%,o%,FD%,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%:NB%=
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%,NB%
RD%=1
shell_Tracef0("ActionMenuSelect:FontMenu selection ("+
shell_GetString(NB%)+")"):
shell_FontMenuSelectFont(
shell_GetString(NB%),_U%!260):
_shell_FontMenuSelFN$=""
&400D5,,_U%!24,_Q%,NB%:A$=
shell_GetEventHandler(_U%!52,_U%!56,0):_temp%=NB%:$_temp%=
shell_StringStripTrailing($_temp%," "):
A$<>""
("FN"+A$+"($_temp%)")
_shell_FontMenuSelFN$<>""
("FN"+_shell_FontMenuSelFN$+"(FNshell_FontMenuGetLastSelectedFont)")
shell_HeapBlockReturn(NB%):
_U%!264=0
&45BC4,_U%!24,_Q%
AE%,,FD%:
shell_MenuCallHandler(AE%,FD%)
_shell_blk%!8=1
shell_HeapBlockExists(_U%!&E0)
_temp%=_U%!&E0:
$_temp%<>""
("FN"+$_temp%+"(_U%!52,_U%!56)")
shell_OpenMenu(_U%!36,_U%!40,_U%!24)
_shell_FontMenuSelFN$=""
shell_HeapBlockReturn(FD%):
shell_ActionAdjustButton:
n%,A$,o%,eC%,g%:eC%=
shell_HeapBlockFetch(&C+(
shell_WindowCountIcons(_U%!28)*32)):
shell_Tracef0("Action:Mouse Button was ADJUST"):
_U%!28>0
&400D6,_U%!28,eC%,&F000,&B000:g%=0:
eC%!g%<>-1:
eC%!g%=_U%!32
shell_IconSet(_U%!28,_U%!32,1)
g%+=4:
_U%!32=0
shell_HandleAttachedDataSave(_Q%,_U%!28,_U%!32)
shell_GetEventHandler(_U%!28,_U%!32,3):
A$<>""
shell_IconSlab(1,_U%!28,_U%!32):o%=
("FN"+A$+"(_temp28%,_temp32%)")
shell_HeapBlockReturn(eC%):
shiftmenuclick(b%,f%):=
shell_IconSlab(YB%,b%,f%):
a%:a%=
shell_HeapBlockFetch(50):a%!8=YB%:a%!&C=b%:a%!16=f%:
&81680,,a%:a%!8=0:
&81680,,a%:
shell_HeapBlockReturn(a%):
shell_PointerLeavingWindow(_Q%):
r%,o%:r%=
shell_HeapBlockFetch(&C):
&400D6,!_Q%,r%,&3F0000,&F<<16:
!r%<>-1
5+o%=
("FN"+
shell_IconGetData(!_Q%,!r%))
shell_HeapBlockReturn(r%):
shell_PointerEnteringWindow(_Q%):
r%,o%,b%:b%=_Q%!0:r%=
shell_HeapBlockFetch(&C):
&400D6,b%,r%,&3F0000,&E<<16:
!r%<>-1
E)o%=
("FN"+
shell_IconGetData(b%,!r%))
shell_HeapBlockReturn(r%):
shell_RedrawWindow(i%):
pC%,A$,KA%,PA%,a%,r%:r%=
shell_HeapBlockFetch(&C):
&400D6,i%,r%,&3F0000,&D<<16:
!r%<>-1
T!A$=
shell_IconGetData(i%,!r%)
shell_HeapBlockReturn(r%):a%=
shell_HeapBlockFetch(&64):
A$=""
[&A$=
shell_GetEventHandler(i%,-1,4)
:a%!0=i%:
&400C8,,a%
pC%:KA%=a%!4-a%!20:PA%=a%!16-a%!24:
&81681,,a%:
A$<>""
("FN"+A$+"("+
a%+","+
KA%+","+
PA%+")")
&400CA,,a%
shell_HeapBlockReturn(a%):
shell_Receive(_Q%):
c%,o%:
_Q%!16
shell_Exit:
shell_DataSave(_Q%)
shell_DataSaveAck(_Q%)
shell_DataLoad(_Q%,
shell_DataLoadAck(_Q%)
shell_DataLoad(_Q%,
shell_RAMFetch(_Q%)
shell_RAMTransmit(_Q%)
shell_Message_PreQuit(_Q%)
_U%!&A4>0
shell_Tracef0("Receive:PaletteChange message received"):c%=_U%!&A4:o%=
("FN"+$c%)
shell_Message_SaveDesktop(_Q%)
shell_Message_Shutdown(_Q%)
&502:
shell_InteractiveHelp(_Q%)
&400C0:
shell_MenuWarning(_Q%)
&400C1:
shell_Message_ModeChange(_Q%)
&400C2:
_U%!&A8>0
shell_Tracef0("Receive:TaskInitialise message received"):c%=_U%!&A8:o%=
("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
&400C3:
_U%!&AC>0
shell_Tracef0("Receive:TaskCloseDown message received"):c%=_U%!&AC:o%=
("FN"+$c%)
_Q%!4=_U%!&D0
_U%!&D0=-1
&400C7:
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%,fB%,t%:fB%=_U%!&B8:
_U%!&A0>0
shell_Tracef0("Message_ModeChange:ModeChange message received"):c%=_U%!&A0:o%=
("FN"+$c%)
shell_HeapBlockFetch(&64):
fB%<>0
shell_Tracef0("Message_ModeChange:Checking static window list for pane events"):
fB%!g%<>-1:d%=
shell_GetEventListOffset(fB%!g%,-1,_U%+92,24,
d%>-1
shell_Tracef0("Message_ModeChange:Static window handle found"):
shell_WindowIsOpen(fB%!g%)
shell_Tracef0("Message_ModeChange:Window is open.."):!t%=fB%!g%:
&400C6,,t%:
shell_OpenWindow(fB%!g%,0,-1)
:g%+=4:
shell_HeapBlockReturn(t%):
shell_Message_Shutdown(_Q%):
_U%!312>0
shell_Tracef0("Message_Shutdown:Shutdown message received"):c%=_U%!312:o%=
("FN"+$c%)
shell_HandleUnknownMessage2(_Q%):
_Q%!16
&43B00:X$=$(_Q%+20):
X$,30)="EvntShellLib:ShellDBug started"
_U%!&64
r_U%!&64=(_U%!&64
1<<4):
shell_BroadcastMessage(&43B00,"ShellDBug:Init Debug messages from "+
shell_GetAppName)
X$,25)="EvntShellLib:TraceInitAck"
_U%!&64=(_U%!&64
1<<4)
X$,20)="EvntShellLib:TraceOn"
shell_TraceOn
X$,21)="EvntShellLib:TraceOff"
shell_TraceOff
X$,28)="EvntShellLib:ListClickSelect"
shell_ListClickSelect
X$,28)="EvntShellLib:ListClickAdjust"
shell_ListClickAdjust
X$,25)="EvntShellLib:ListHelpTags"
shell_ListHelpTags
shell_HandleUnknownMessage(_Q%):
shell_HandleUnknownMessage(_Q%):
shell_AttachPreQuitHandler(A$):
c%,o%:
_U%!300>0
shell_HeapBlockReturn(_U%!300)
&<_U%!300=
shell_HeapBlockFetch(
A$+1):c%=_U%!300:$c%=A$:
shell_AttachShutdownHandler(A$):
c%,o%:
_U%!312>0
shell_HeapBlockReturn(_U%!312)
0<_U%!312=
shell_HeapBlockFetch(
A$+1):c%=_U%!312:$c%=A$:
shell_AttachModeChangeHandler(A$):
c%,o%:
_U%!&A0>0
shell_HeapBlockReturn(_U%!&A0)
:J_U%!&A0=
shell_HeapBlockFetch(
A$+1):c%=_U%!&A0:$c%=A$:o%=
("FN"+A$):
shell_AttachPaletteChangeHandler(A$):
c%,o%:
_U%!&A4>0
shell_HeapBlockReturn(_U%!&A4)
EJ_U%!&A4=
shell_HeapBlockFetch(
A$+1):c%=_U%!&A4:$c%=A$:o%=
("FN"+A$):
shell_AttachTaskInitialiseHandler(A$):
c%,o%:
_U%!&A8>0
shell_HeapBlockReturn(_U%!&A8)
P<_U%!&A8=
shell_HeapBlockFetch(
A$+1):c%=_U%!&A8:$c%=A$:
shell_AttachTaskCloseDownHandler(A$):
c%,o%:
_U%!&AC>0
shell_HeapBlockReturn(_U%!&AC)
Z<_U%!&AC=
shell_HeapBlockFetch(
A$+1):c%=_U%!&AC:$c%=A$:
shell_RAMFetch(_Q%):
CG%,GE%,EE%:EE%=
_U%!&90>&8000
shell_Tracef0("RAMFetch:RAMFetch called.."):_Q%!&C=_Q%!8:_Q%!16=7:GE%=_U%!&88:
_U%!&8C=&FF9
_U%!&90+=4
(GE%-_U%!&80)<_Q%!24
_Q%!24=GE%-_U%!&80:EE%=
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%,NA$,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:NA$=
shell_GetString(c%+44):
shell_UserFNLoadFile(c%!40,_U%!&98,a%!8,NA$,_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(LG%):
q$,XB%,mC%,IB%:q$=
shell_GetString(_Q%+44):XB%=
shell_FileLength(q$):
XB%<0
shell_OK(
shell_MessageNoArgs("SHELLMSG16"))
PIB%=
shell_HeapBlockFetch(XB%):
&20008,16,q$,IB%,0
;mC%:
shell_VFlag(mC%)
shell_HeapBlockReturn(IB%):
shell_OK(
shell_MessageNoArgs("SHELLMSG17"))
shell_Tracef0("LoadFile:File "+q$+" loaded ok at &"+
~IB%)
:=IB%
shell_VFlag(mC%):=((mC%
1)=1)
shell_CheckType(w%,gB%,hB%):
JG%,g%,j%,c%,_C%:g%=0:j%=-1:_C%=
_U%!&64
_U%!&64=_U%!&64
gB%!g%<>-1:c%=gB%!g%:
1<<31
c%=c%
1<<31:_C%=
c%=w%
j%=g%:
L_U%!&64=_U%!&64
1<<1:
shell_Tracef0("CheckType:Top Bit Load detected..")
:g%+=4:
(w%>=4096)
j%=-1
j%>-1
shell_Tracef0("CheckType:File type OK "+
~gB%!j%)
shell_Tracef0("CheckType:File type NOT ok "+
j%<>-1
shell_Exit:
mB%:mB%=_U%!68:
&61504,mB%:
&2001E,7,,mB%:
shell_Tracef0("Exit:Application closing down"):
shell_TraceExit:
&606C2:
&600D0,,-1:
shell_WimpCloseDown_I(_U%!&94):
shell_DataLoad(_Q%,hB%):
KG%,d%,a%,_temp%,gB%,w%,f$:
shell_DataOpenOKToLoad(hB%,_Q%!40)
dw%=_Q%!40:f$=
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
57d%=
shell_GetEventListOffset(_Q%!20,-1,_U%+96,16,
d%>-1
:4a%=_U%!96+d%:
shell_CheckType(_Q%!40,a%!8,hB%)
shell_Tracef0("DataLoad:File type recognised (&"+
~_Q%!40+")"):UF%=_Q%!&C:_Q%!&C=_Q%!8:_Q%!16=4:
&400E7,18,_Q%,_Q%!4:
_U%!&64
IB%=-1:_U%!&64=_U%!&64
shell_LoadFile(UF%=_U%!&6C)
shell_UserFNLoadFile(w%,IB%,a%!8,f$,_Q%!36,a%):
_U%!&9C<>0
shell_HeapBlockReturn(_U%!&9C):_U%!&9C=0
shell_Tracef0("DataLoad:File type NOT recognised (&"+
~_Q%!40+")")
shell_DataOpenOKToLoad(hB%,w%):
_%,uD%,KA$,s$:
dY_%=
shell_Tracef0("DataOpenOKToLoad:Message reason code was 3, normal drag load..")
shell_Tracef0("DataOpenOKToLoad:Message reason code was 5, double click load.."):uD%=
shell_HeapBlockFetch(256):KA$=
shell_OSVarGetVal(uD%,256,"Alias$@RunType_"+
~w%,1):
shell_Tracef0("DataOpenOKToLoad:Alias$@RunType="+KA$)
shell_HeapBlockReturn(uD%):s$=
shell_Branch(KA$):
shell_Tracef0("DataOpenOKToLoad:dbug "+s$):
shell_Leaf(s$)="!"+
shell_GetAppName
shell_UserFNLoadFile(w%,IB%,gB%,_filename$,_file_size%,a%):
g%,j%,c%,o%:g%=0:j%=-1:
gB%!g%<>-1:c%=gB%!g%:
1<<31
c%=c%
1<<31
c%=w%
j%=g%
[g%+=4:
:c%=a%!&C:o%=
("FN"+$(c%!j%)+"("+
IB%+","+
w%+",_filename$,"+
_file_size%+")"):
shell_DataSave(_Q%):
c%,d%,a%,s%:
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%!s%=_Q%!s%:
s%:_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%,EA%,jB%,d%,XB%,o%:jB%=
shell_HeapBlockFetch(30):
&400CF,,jB%:d%=
shell_GetEventListOffset(b%,f%,_U%+72,24,
d%=-1
d%=-2
shell_MessageWindow(
shell_MessageNoArgs("SHELLMSG13"),0,"",
shell_MessageNoArgs("warning"))
a%=(_U%!72)+d%:
a%!8>&8000
$XB%=
shell_HeapBlockInfo(a%!8)-4
XB%=a%!8
:EA%=_U%!76:EA%!0=256:EA%!&C=0:EA%!16=1:EA%!20=jB%!&C:EA%!24=jB%!16:EA%!28=jB%!0:EA%!32=jB%!4:EA%!36=XB%:EA%!40=a%!&C:$(EA%+44)=
shell_Leaf(
shell_IconGetData(b%,a%!16)):
&400E7,18,EA%,EA%!20,EA%!24:_U%!&78=_Q%!8:_U%!&88=XB%:_U%!&8C=a%!&C
;_U%!&90=a%!8:_U%!&9C=a%!4:_U%!&C8=EA%!20:_U%!&CC=EA%!24
shell_HeapBlockReturn(jB%):
shell_DataSaveAck(_Q%):
_fullname$,HA%,lA%,a%,c%,o%:
shell_Tracef0("DataSaveAck:DataSaveAck message received"):HA%=0:lA%=_Q%?(44+HA%):
lA%<>0:_fullname$+=
(lA%):HA%+=1:lA%=_Q%?(44+HA%):
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
I+_U%!336-=1:
shell_DoSendPrintSave(&FFF)
shell_DataSaveCheckName(b%,f%):
d%,a%,p%:a%=_U%!72:d%=0:
a%<>0
Z1p%=
shell_HeapBlockInfo(a%)-8:
!(a%+d%)=b%
`^R$=
shell_IconGetData(!a%,a%!16):
R$,".")=0
shell_OK(
shell_MessageNoArgs("SHELLMSG01"))
b 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%)
shell_AckDataLoad(_Q%):
_Q%!&C<>_U%!84
&20008,6,"<Wimp$Scrap>":
&FF,"Data Transfer failed: Receiver died"
shell_AckRAMFetch(_Q%):
sE%,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
,,sE%:
sE%<>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$,NB%,IA%,MA%,o%,_temp%,HA%,F$,kB%,a%:IA%=_Q%!24:MA%=_Q%!28:_U%!264=0:
_U%!20<>0
shell_Tracef0("MenuWarning:Removing last dynamic dbox (handle=&"+
~_U%!20+")"):o%=
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,IA%,MA%
shell_MenuGetItemAddress(_U%!24,_Q%+32):
shell_HeapBlockExists(kB%!4)
shell_MenuWarnDBox(kB%,IA%,MA%)
shell_HeapBlockFetch(32):
&45BC4,_U%!24,_Q%+32
,,a%:
shell_FindMenuWarnEvent(a%!8,F$,J$):
shell_HeapBlockReturn(a%):
shell_MenuWarnSubMenu(_Q%!20,IA%,MA%,F$,J$)
shell_MenuWarnDBox(vA%,IA%,MA%):
c%,v%,o%:
c%=vA%!4:
shell_CreateWindow($c%!0,v%):
shell_Tracef0("MenuWarnDBox:Creating new dynamic dbox (handle=&"+
~v%+")"):
$c%!4<>""
shell_Tracef0("MenuWarnDBox:Calling preopen FN '"+$c%!4+"'"):o%=
("FN"+$c%!4+"("+
v%+")")
$c%!8<>""
shell_Tracef0("MenuWarnDBox:Calling postopen FN '"+$c%!8+"'"):o%=
("FN"+$c%!8+"("+
v%+")")
&400E8,,v%,IA%,MA%:_U%!20=v%:
shell_FindMenuWarnEvent(nA%,
_%,x%,c%,d%,j%,p%,CA%,g%:
lB%:lB%=0:x%=_U%!&DC:d%=0:j%=
:F$="":lB%=0:
shell_HeapBlockExists(x%)
:g%+=4:
x%!g%=-1:p%=g%:g%=0:
shell_Tracef0("FindMenuWarnEvent:list_size%="+
:c%=!(x%+d%+0):
c%<>-1
c%=nA%
:CA%=x%!(d%+4):F$=$CA%:lB%=x%!(d%+8):CA%=x%!(d%+&C):J$=$CA%:
shell_Tracef0("FindMenuWarnEvent:submenu found")
:d%+=16
d%=p%
d%>=p%
F$="":J$=""
lB%=0
shell_Tracef0("FindMenuWarnEvent:warn fn not found..")
shell_MenuWarnSubMenu(DE%,IA%,MA%,F$,J$):
o%,c%,JB%,g%:_shell_FontMenuSelFN$=J$:
shell_HeapBlockExists(_U%!&E0)
shell_HeapBlockReturn(_U%!&E0)
-C_U%!&E0=
shell_HeapBlockFetch(
F$+1):c%=_U%!&E0:$c%=F$:
F$<>""
0So%=
("FN"+F$+"(_U%!52,_U%!56)"):
shell_Tracef0("MenuWarnSubMenu:Calling FN"+F$)
DE%=_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
,JB%:_U%!264=1:
JB%<>_U%!&FC
shell_FontMenuUpdatePtr(JB%):_U%!&FC=JB%:DE%=JB%
_U%!264=0
&400E8,,DE%,IA%,MA%:
shell_AttachSubMenu(GB%,lB%,F$):
&45BCE,GB%,lB%:
F$<>""
&45BCC,,
shell_EventListMenuWarn(GB%,lB%,F$,"")
shell_EventListMenuWarn(GB%,dE%,F$,J$):
c%,CA%,g%,x%:
_U%!&DC=0
_U%!&DC=
shell_HeapBlockFetch(32):c%=_U%!&DC:c%!0=GB%:c%!4=
shell_HeapBlockFetch(
F$+1):$(c%!4)=F$:c%!8=dE%: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=x%:g%=0:
:g%+=16:
x%!g%=-1:c%=_U%!&DC:c%!g%=GB%:c%!(g%+4)=
shell_HeapBlockFetch(
F$+1):CA%=c%!(g%+4):$(CA%)=F$:c%!(g%+8)=dE%: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%):
I$,W$,K$,PB%,MD%,nA$,r%:r%=
shell_HeapBlockFetch(&C):
&400D6,_Q%!32,r%,&3F0000,&C<<16:
!r%<>-1
shell_IconGetData(_Q%!32,!r%)
shell_HeapBlockReturn(r%):
I$=""
shell_GetEventHandler(_Q%!32,_Q%!36,8)
shell_IconGetValidation(_Q%!32,_Q%!36):
K$<>""
shell_StringUpperCase(
K$,1))="I"
K$,";"):
PB%=0
K$,2)
K$,2,PB%-2)
shell_StringUpperCase(K$),
shell_StringUpperCase(";i")):MD%=
shell_StringUpperCase(K$),
shell_StringUpperCase(";"),PB%+1):
PB%>0
MD%>0
K$,PB%+2,MD%-PB%-2)
K$,PB%+2)
I$<>""
_Q%!16=&503:_Q%!&C=_Q%!8:W$=
shell_MessageLookup(I$,"",""):W$=
shell_MessageExpand(W$):$(_Q%+20)=W$:!_Q%=(
W$+25)
&400E7,17,_Q%,_Q%!4
shell_Message_PreQuit(_Q%):
c%,OD%,a%,s%,PD%:
_U%!300>0
shell_HeapBlockFetch(256):
_Q%!0
4:a%!s%=_Q%!s%:
shell_Tracef0("Message_PreQuit:PreQuit message received"):c%=_U%!300:OD%=a%!4:
!a%<24
PD%=0
PD%=a%!20
2a%!&C=a%!8:
&400E7,19,a%,OD%:
("FN"+$c%)<>0
_closedown%=
!a%=24:a%!24=508:
&400E7,8,a%,OD%:_closedown%=
shell_HeapBlockReturn(a%)
lwaorigin(A,
MA%):IA%=A!0-A!16:MA%=A!&C-A!20:
shell_Iconbar(FA%,r$,H$,SD%,m%,_B%,HC%,gC%):
H$=""
J!_Q%=FA%:_Q%!4=0:_Q%!8=0:_Q%!&C=70:_Q%!16=70:_Q%!20=&301A:$(_Q%+24)=r$
!_Q%=FA%:_Q%!4=0:_Q%!8=-16:_Q%!&C=SD%:_Q%!16=90:_Q%!20=&1700210B:
_Q%!24&C:
_Q%!28
(r$)+2:$(_Q%!24)=H$:$(_Q%!28)="S"+r$:_Q%!32=&C
&400C2,,_Q%
shell_AttachMenu(-2,i%,m%,_B%,HC%,gC%):=i%
shell_IconbarSetText(v%,cF%,L$):
k%,t%:k%=
shell_HeapBlockFetch(40):t%=
shell_HeapBlockFetch(36):t%!20=0:
shell_OSCheckVersion(3)
v%=-1
!t%=-2
!t%=v%
&400CB,,t%
:!k%=v%:k%!4=cF%:
&400CE,,k%:$(k%!28)=L$:
&400D1,-1,k%!8-&64-t%!20,k%!&C,k%!16+&64-t%!20,k%!20:
shell_HeapBlockReturn(k%):
shell_HeapBlockReturn(t%):
shell_WritableIconHandler(b%,f%,RA%):
AB%,AC%,BC%,g%:
aD%,dD%,xA%,tA%,HB%,QG%,BA%:BA%=
shell_HeapBlockFetch(&400):
&400D3,,BA%:
!BA%=-1
shell_HeapBlockReturn(BA%):=
&400D6,b%,BA%,&40E000,&E000:AC%=!BA%:g%=0:
BA%!g%=f%
!!aD%=BA%!(g%-4):dD%=BA%!(g%+4)
:g%+=4:
BA%!g%=-1:BC%=BA%!(g%-4):
shell_FakeMouseClick(b%,0,4)
398,394:
f%=BC%
&400D2,b%,AC%,-1,-1,-1,
shell_IconGetData(b%,AC%))
&400D2,b%,dD%,-1,-1,-1,
shell_IconGetData(b%,dD%))
399,410:
f%=AC%
&400D2,b%,BC%,-1,-1,-1,
shell_IconGetData(b%,BC%))
&400D2,b%,aD%,-1,-1,-1,
shell_IconGetData(b%,aD%))
&400D2,b%,AC%,-1,-1,-1,
shell_IconGetData(b%,AC%))
&400D2,b%,BC%,-1,-1,-1,
shell_IconGetData(b%,BC%))
shell_HeapBlockReturn(BA%):=
shell_FakeMouseClick(b%,f%,YB%):
6,&F,1:_Q%!8=YB%:_Q%!&C=b%:_Q%!16=f%:
shell_Action(6):
shell_IconCreate(b%,BB%,kA%,SD%,v%,lD%,tD%,aF%,P$,vA%,nB%,K$):
mF%,i%,wB%,k%:k%=
shell_HeapBlockFetch(40):k%!0=b%:k%!4=BB%:k%!8=kA%:k%!&C=BB%+SD%:k%!16=kA%+v%:k%!20=aF%
tD%<<28
lD%<<24:
k%!20
R#mF%=
P$,","):k%!24=vA%:
K$<>""
U6wB%=
shell_HeapBlockFetch(
K$+1):$wB%=K$:k%!28=wB%
k%!28=-1
:k%!32=nB%
$(k%+24)=
P$,&B)
&400C2,,k%
shell_HeapBlockReturn(k%):=i%
shell_IconDelete(b%,f%):
shell_DoIconDelete(b%,f%,
shell_IconDelete2(b%,f%):
shell_DoIconDelete(b%,f%,
shell_DoIconDelete(b%,f%,oF%):
a%,KA%,PA%,VA%,cA%:a%=
shell_HeapBlockFetch(40):a%!0=b%:a%!4=f%:
&400CE,,a%:
&8168A,,a%+8:KA%=a%!8:PA%=a%!&C:VA%=a%!16:cA%=a%!20:
&400CE,,a%:
shell_HeapBlockExists(a%!28)
shell_HeapBlockReturn(a%!28)
shell_HeapBlockExists(a%!32)
shell_HeapBlockReturn(a%!32)
&400C4,,a%:
&400D1,b%,KA%,PA%,VA%,cA%
shell_HeapBlockReturn(a%):
shell_IconPutData(NA%,uA%,P$,I):
a%,OA$:OA$=
shell_IconGetData(NA%,uA%):
P$<>OA$
shell_HeapBlockFetch(40):a%!0=NA%:a%!4=uA%:
&400CE,,a%:
(a%!24
(1<<8))<>0
P$>a%!36
shell_MessageNoArgs("SHELLMSG12")
$(a%!28)=P$
$(a%+28)=
P$,&B)
a%!8=0:a%!&C=0:
&400CD,,a%
shell_HeapBlockReturn(a%)
shell_IconPutDataNow(NA%,uA%,P$):
a%:a%=
shell_HeapBlockFetch(50):a%!0=NA%:a%!4=uA%:
&400CE,,a%:
(a%!24
(1<<8))<>0
P$>a%!36
shell_MessageNoArgs("SHELLMSG12")
$(a%!28)=P$
$(a%+28)=
P$,&B)
:a%!8=0:a%!&C=0:
&400CD,,a%:
shell_EnsurePoll:
shell_HeapBlockReturn(a%):
shell_IconNewSprite(NA%,uA%,kA$,I):
k%:k%=
shell_HeapBlockFetch(40):k%!0=NA%:k%!4=uA%:
&400CE,,k%:
&400C4,,k%:k%!4=k%!8:k%!8=k%!&C:k%!&C=k%!16:k%!16=k%!20:k%!20=k%!24:$(k%+24)=kA$:
&400C2,,k%
&400D1,k%!0,k%!4,k%!8,k%!&C,k%!16
shell_HeapBlockReturn(k%):=uA%
shell_IconGetData(NA%,uA%):
O$,k%:k%=
shell_HeapBlockFetch(40):k%!0=NA%:k%!4=uA%:
&400CE,,k%:
(k%!24
(1<<8))<>0
O$=$(k%!28)
O$=$(k%+28)
shell_HeapBlockReturn(k%):=O$
shell_IconMove2(b%,f%,DF%,EF%):
z%:z%=
shell_HeapBlockFetch(40):!z%=b%:z%!4=f%:
&400CE,,z%:z%!8+=DF%:z%!16+=DF%:z%!&C+=EF%:z%!20+=EF%:f%=
shell_IconMove(b%,f%,z%!8,z%!&C,z%!16,z%!20):
shell_HeapBlockReturn(z%):=f%
shell_IconResize(b%,f%,KA%,PA%,VA%,cA%):=
shell_IconMove(b%,f%,KA%,PA%,VA%,cA%)
shell_IconMove(b%,f%,KA%,PA%,VA%,cA%):
r%,HG%,DG%,CB%,a%:
hE%,lE%,tE%,_E%: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:uF%=r%!24:KD%=r%+28
hE%=uF%:lE%=KD%!0:tE%=KD%!4:_E%=KD%!8:CB%=r%!8-a%!8:
&400C4,,r%:
&400D1,!r%,r%!8-CB%,r%!&C-CB%,r%!16+CB%,r%!20+CB%:f%=
shell_CreateIcon2(b%,KA%,PA%,VA%,cA%,hE%,lE%,tE%,_E%,CB%):
shell_HeapBlockReturn(r%):
shell_HeapBlockReturn(a%):=f%
shell_CreateIcon2(i%,KA%,PA%,VA%,cA%,n%,bF%,KF%,dF%,CB%):
y%,JA%,H$,c$,BB%,kA%:JA%=
shell_HeapBlockFetch(60):!JA%=i%:JA%!20=n%:JA%!24=bF%:JA%!28=KF%:JA%!32=dF%:H$="":c$="":
256H$=$(JA%!24)
H$=$(JA%+24)
shell_IconGetCommand(JA%!28,"S")
c$=$(JA%+24)
shell_GetMinXY(n%,H$,c$):
VA%-KA%<BB%
VA%=KA%+BB%
cA%-PA%<kA%
cA%=PA%+kA%
JA%!4=KA%:JA%!8=PA%:JA%!&C=VA%:JA%!16=cA%:
&400C2,,JA%
&400D1,!JA%,JA%!4-CB%,JA%!8-CB%,JA%!&C+CB%,JA%!16+CB%:
&400D3,,JA%:
!JA%=i%:
JA%!4=y%:
&400D2,i%,y%,0,0,-1,0
shell_HeapBlockReturn(JA%):=y%
shell_GetMinXY(n%,H$,c$):
KA%,PA%,VA%,cA%,tA%,HB%:BB%=0:kA%=0:
H$<>""
&40084,n%>>24
,,PA%,,cA%:
&40097,,
(n%>>24)+H$
,KA%,,VA%:
&40088,,KA%
,KA%:
&40088,,VA%
,VA%:BB%=VA%-KA%:kA%=cA%-PA%
BB%=6*OG%+16*
H$:kA%=32
4kA%+=2*RG%
c$<>""
&2002E,296,
shell_UserSpritesBase,c$
,,,tA%,HB%,,OE%;P%:
&20035,OE%,4
,,RF%:tA%=tA%<<RF%:
&20035,OE%,5
,,TF%:HB%=HB%<<TF%:
&800tA%=tA%/2:HB%=HB%/2
539)=19tA%=BB%+tA%
tA%>BB%BB%=tA%
HB%>kA%kA%=HB%
shell_IconGetCommand(jC%,mA$):
I%,O$:
jC%<=0
6 O$=""
shell_StringUpperCase($jC%),";"+
shell_StringUpperCase(mA$)):
: O$=""
$(jC%+I%),
$(jC%+I%)+";",";")-1)
shell_IconRedraw(b%,f%):
a%:a%=
shell_HeapBlockFetch(40):!a%=b%:a%!4=f%:
&400CE,,a%:
&8168A,,a%+8:
&400D1,b%,a%!8,a%!&C,a%!16,a%!20:
shell_Action(
shell_Poll_I(0,_U%!&94)):
shell_HeapBlockReturn(a%):
shell_IconGetValidation(b%,f%):
a%,K$,n%:
f%=-1
SVK$="":a%=
shell_HeapBlockFetch(&64):a%!0=b%:a%!4=f%:
&400CE,,a%:n%=a%!24:
a%!32>0
K$=$(a%!32)
shell_HeapBlockReturn(a%):=K$
shell_IconPutValidation(b%,f%,t$):
a%,n%:a%=
shell_HeapBlockFetch(&64):a%!0=b%:a%!4=f%:
&400CE,,a%:n%=a%!24:
$(a%!32)=t$
shell_HeapBlockReturn(a%):
shell_IsIconSelected(QB%,RB%):
shell_IconGetState(QB%,RB%):n%=_Q%!24:c%=(n%
&200000):
shell_IconSelect(QB%,RB%):
shell_IconSetState(QB%,RB%,&200000,&200000):
shell_IconDeselect(QB%,RB%):
shell_IconSetState(QB%,RB%,0,&200000):
shell_IconGetState(QB%,RB%):!_Q%=QB%:_Q%!4=RB%:
&400CE,,_Q%:
shell_IconSetSelected(b%,f%,ZA%):
ZA%=0
shell_IconDeselect(b%,f%)
shell_IconSelect(b%,f%)
shell_IconSet(b%,f%,ZA%):
ZA%=0
shell_IconDeselect(b%,f%)
shell_IconSelect(b%,f%)
shell_IconSetState(QB%,RB%,yF%,_F%):
k%:k%=
shell_HeapBlockFetch(16):!k%=QB%:k%!4=RB%:k%!8=yF%:k%!&C=_F%:
&400CD,,k%:
shell_HeapBlockReturn(k%):
shell_IconUnselectable(i%,PC%):
shell_IconSetState(i%,PC%,&400000,&40000):
shell_IconSetBGColour(b%,f%,oA%):
oA%<0
oA%>&F
shell_MessageOneArg("SHELLMSG24","PROCshell_IconSetBGColour")
shell_IconSetState(b%,f%,oA%<<28,&F0000000):
shell_IconSetFGColour(b%,f%,oA%):
oA%<0
oA%>&F
shell_MessageOneArg("SHELLMSG24","PROCshell_IconSetFGColour")
shell_IconSetState(b%,f%,oA%<<24,&F000000):
shell_CaretSetPosition(NA%,uA%,OF%,PF%,UA%,xA%):
&400D2,NA%,uA%,OF%,PF%,UA%,xA%:
shell_IconSetButtonType(b%,f%,RC%):
RC%=&C
RC%=&D
shell_MessageOneArg("SHELLMSG23","PROCshell_IconSetButtonType")
RC%<0
RC%>&F
shell_MessageOneArg("SHELLMSG22","PROCshell_IconSetButtonType")
shell_IconSetState(b%,f%,RC%<<&C,&F000):
shell_IconSetESG(b%,f%,DC%):
DC%<0
DC%>31
shell_MessageOneArg("SHELLMSG25","PROCshell_IconSetESG")
shell_IconSetState(b%,f%,DC%<<16,&1F0000):
shell_IconSetText(b%,f%,DA%):
DA%<>0
DA%=1<<0
shell_IconSetState(b%,f%,DA%,1<<0):
shell_IconSetSprite(b%,f%,DA%):
DA%<>0
DA%=1<<1
shell_IconSetState(b%,f%,DA%,1<<1):
shell_IconSetBorder(b%,f%,DA%):
DA%<>0
DA%=1<<2
shell_IconSetState(b%,f%,DA%,1<<2):
shell_IconSetHCentred(b%,f%,DA%):
shell_IconSetState(b%,f%,0,1<<9):
DA%<>0
DA%=1<<3
shell_IconSetState(b%,f%,DA%,1<<3):
shell_IconSetVCentred(b%,f%,DA%):
DA%<>0
DA%=1<<4
shell_IconSetState(b%,f%,DA%,1<<4):
shell_IconSetFilled(b%,f%,DA%):
DA%<>0
DA%=1<<5
shell_IconSetState(b%,f%,DA%,1<<5):
shell_IconSetRightJust(b%,f%,DA%):
shell_IconSetHCentred(b%,f%,0):
DA%<>0
DA%=1<<9
shell_IconSetState(b%,f%,DA%,1<<9):
shell_IconSetLeftJust(b%,f%):
shell_IconSetHCentred(b%,f%,0):
shell_IconSetRightJust(b%,f%,0):
shell_IconSetUnselectable(b%,f%,ZA%):
ZA%<>0
ZA%=1<<22
shell_IconSetState(b%,f%,ZA%,1<<22):
ZA%<>0
*BBA%=
shell_HeapBlockFetch(24):
&400D3,,BA%:
!BA%=b%
BA%!4=f%
&400D2,-1
shell_HeapBlockReturn(BA%)
shell_CaretSetRight(b%,f%):
&400D2,b%,f%,-1,-1,-1,
shell_IconGetData(b%,f%)):
print_text(F,G,H$):
in(F,G-32,F+16*
(H$),G)
in(A%,B%,C%,D%):
newvals:Y=_Q%!28:Q=_Q%!32:Z=_Q%!36:P=_Q%!40:T=_Q%!4:V=_Q%!8:U=_Q%!&C:O=_Q%!16:K=_Q%!20:L=_Q%!24:R=U-T:S=O-V:d=K:e=K+R:f=L:b=L-S:
max(HA%,lA%):
HA%<lA%
shell_Leaf(G$):
G$,"."):G$=
G$,".")+1):
shell_Branch(f$):
FA%,u$,c%:
f$,".")=0
j u$=""
c%=0:
:FA%=c%+1:c%=
f$,".",FA%):
c%=0:u$=
f$,FA%-2)
gname(C):v$="":
?C<>0
?C<>&D:v$=v$+
?C:C+=1:
shell_WindowResize(NA%,VF%,XF%,YF%,ZF%,oC%):!_Q%=VF%:_Q%!4=XF%:_Q%!8=YF%:_Q%!&C=ZF%:
&400D7,NA%,_Q%:
)_Q%!0=NA%:
&400CC,,_Q%:
&400C5,,_Q%
shell_WindowRetitle(
NA%,S$):
c%,q%,i%,qE%:q%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(NA%)*32)):q%!0=NA%:
&400CC,,q%:
((q%!60)
256)=0
Ac%=q%+76:$c%=
S$,&B):
&400C3,,q%:
&400C1,,q%+4
i%<>NA%
shell_UpdateWindowHandle(NA%,i%):NA%=i%
qE%=q%!84:$(!(q%+76))=
S$,qE%-1):
((q%!32)
(1<<16))<>0
&400D1,-1,q%!4,q%!16,q%!&C,q%!16+44
shell_HeapBlockReturn(q%)
shell_WindowTitleIndirected(vB%):
(1<<8))=(1<<8)
shell_ScreenToWindowCoords(rE%,
QD%,uE%,BG%,wE%,xE%,pB%:pB%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(rE%)*32)):QD%=pB%:!QD%=rE%:
&400CC,,QD%:uE%=pB%!4:rF%=pB%!16:wE%=pB%!20:xE%=pB%!24:X%=X%+(wE%-uE%):Y%=Y%+(xE%-rF%)
shell_HeapBlockReturn(pB%):
shell_WimpSlotReadEnd:
&400EC,-1,-1
EC%:=EC%
shell_WimpSlotClaimMemory(EC%,hA%):
&400EC,EC%+hA%,-1
TD%<EC%+hA%
shell_WimpSlotReleaseMemory:
&400EC,EC%,-1:
shell_MouseLimit(A,NA%):A!0=NA%:
&400CB,,A:
mouse_rectangle(A!4,A!8,A!&C-A!4,A!16-A!8):
shell_NameOfFirstSprite(eA$):
X%,N%,w$:X%=
(eA$):
#X%=4:N%=
#X%:N%+=
#X%*256:N%+=
#X%*65536:N%+=
#X%*&1000000:
#X%=N%:w$="":
&B:w$+=
#X%):
#X%:=w$
InitialiseSpriteArea(S%,vF%):!S%=vF%:S%!8=16:
46,9+256,S%:
shell_ListEvents(b%,y%):
m%,e$:
b%=-1
b%=-2
shell_Tracef0("MenuSelection="+
shell_GetEventHandler(b%,y%,0)):
shell_Tracef0("MenuMaker ="+
shell_GetEventHandler(b%,y%,1)):
shell_Tracef0("ClickSelect ="+
shell_GetEventHandler(b%,y%,2))
shell_Tracef0("ClickAdjust ="+
shell_GetEventHandler(b%,y%,3)):
shell_Tracef0("Redraw ="+
shell_GetEventHandler(b%,y%,4)):
shell_Tracef0("Keypress ="+
shell_GetEventHandler(b%,y%,5))
shell_Tracef0("Drag ="+
shell_GetEventHandler(b%,y%,6)):
shell_Tracef0("Menu Warning ="+
shell_GetEventHandler(b%,y%,7)):
shell_Tracef0("HelpTag ="+
shell_GetEventHandler(b%,y%,8)):m%=
shell_GetEventMenu(2,b%,y%):
e$="None"
shell_Tracef0("Menu handle =&"+e$):
shell_HeapManagerInit(G$,xF%):
_heap_code%900:
("LOAD "+G$+"heapcode "+
~_heap_code%):
_heap_code%+0,xF%:
shell_HeapBlockExists(vA%):
vA%<&8000
99,"No heapblock defined at this address"
%&o%=
shell_HeapBlockInfo(vA%):
shell_HeapBlockExtend(HA%,lA%):
_heap_code%+&C,HA%,lA%:=HA%
shell_HeapBlockFetch(HA%):
_heap_code%+4,vA%,HA%:=vA%
shell_HeapBlockReturn(
HA%):
shell_HeapBlockExists(HA%)
_heap_code%+8,HA%
HA%=0:
shell_HeapBlockInfo(HA%):
29,6,!(_heap_code%+28),HA%
,,,M:=M
shell_OSVarExists(TB%,x$):
&20023,x$,TB%,-1,0,0
shell_OSVarGetVal(TB%,hA%,x$,W):
y$,B,wF%:
&20023,x$,TB%,hA%,0,-3*(W=
,,B,wF%,w%:
B-1:y$=y$+
(TB%?s%):
s%:=y$
shell_OSReadCommandArg(X):
UD%,U$,d%:U$="":d%=0:
UD%?d%<>0:U$+=
(UD%?d%):d%+=1:
1:U$=
34)+1):U$=
34)+2)
shell_StringStripTrailing(B$,V$):
B$,1)=V$:B$=
(B$)-1):
shell_StringStripLeading(B$,V$):
B$,1)=V$:B$=
B$,2):
shell_StringStripAll(B$,V$):
D,E:D=
B$,V$):
B$,E-1)+
B$,E+1)
D:=B$
shell_StringPadTrailing(B$,V$,DB%):
(B$)<DB%:B$=B$+
(B$),V$):
shell_StringPadLeading(B$,V$,DB%):
(B$)<DB%:B$=
(B$),V$)+B$:
shell_StringUpperCase(B$):
(B$)>0
(B$):
B$,s%,1)>="a"
B$,s%,1)<="z"
B$,s%,1)=
B$,s%,1))
shell_StringExchange(B$,_$,hA$):
B$,_$)
.xA%=
B$,_$):B$=
B$,xA%-1)+hA$+
B$,xA%+
shell_StringArrayGetLongest(A$(),qC%):
s%,rC%:rC%=0:
(A$(s%))>rC%
(A$(s%))
s%:=rC%
mem_to_string(IE%,d%,MF%):
IE%?d%<>MF%:B$+=
(IE%?d%):d%+=1:
shell_FileLength(d$):
w%,JD%,kC%,DB%,FC%,B$:
8,5,d$
w%,,JD%,kC%,DB%,FC%:=DB%
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(i$):
QA%,a%,E$,D$:
i$<>""
(i$):_U%!44=QA%
shell_HeapBlockFetch(256):D$=
shell_OSVarGetVal(a%,256,"Obey$Dir",1):E$=
shell_Leaf(D$),2):
shell_BroadcastMessage(&43B00,"ShellDBug:Init Debug messages from "+E$):
shell_HeapBlockReturn(a%):
_U%!&64
_U%!&64=(_U%!&64
1<<4)
shell_TraceIsOn:
_U%!&64
(1<<9)
shell_Tracef0(WA$):
shell_TraceIsOn)
_U%!44<>-1
QA%=_U%!44:
#QA%,WA$
_U%!&94>0
shell_BroadcastMessage(&43B00,"ShellDBug:Trace "+WA$)
shell_Tracef2(vA%):
("MEDIT "+
~vA%):
shell_TraceExit:
_U%!44<>-1
#(_U%!44):_U%!44=-1
shell_AttachHotKey(XA$,_B%,HC%,gC%,M$,b%,T$,Y$):
x%,d%,c%,CA%,RA%,VD%:VD%=
_U%!60=0
73_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
:x%=_U%!60:
"F1":RA%=385
"F2":RA%=386
"F3":RA%=387
"F4":RA%=388
"F5":RA%=389
"F6":RA%=390
"F7":RA%=391
"F8":RA%=392
"F9":RA%=393
"F10":RA%=458
"F11":RA%=459
RA%=(
XA$)-64:VD%=
RA%+=16
RA%+=32
:c%=x%+d%:c%!0=RA%:c%?4=_B%:c%?5=HC%:c%?6=gC%:c%!8=
shell_HeapBlockFetch(
M$+1):CA%=c%!8:$CA%=M$:
[Td%=
shell_SearchStatic(_U%!&B8,b%):
d%=-1
shell_MessageNoArgs("SHELLMSG09")
:c%!&C=b%:c%!16=
shell_HeapBlockFetch(
T$+1):CA%=c%!16:$CA%=T$:c%!20=
shell_HeapBlockFetch(
Y$+1):CA%=c%!20:$CA%=Y$:
shell_HotKeyProcess(RA%):
x%,p%,j%,e%,v%,j$,T$,Y$:
HC%,_B%,gC%,gA%,fA%,vB%,IG%,d%:
_%,q%:x%=_U%!60:p%=_U%!&B4*24:j%=
:e%=0:
x%!e%=RA%
e%+=24
e%>=p%:
wdc%=x%+e%:j$=$(c%!8):
shell_Tracef0("HotKeyProcess:Template name is '"+j$+"'"):
(j$<>""
c%!&C=0)
shell_CreateWindow(j$,v%):
shell_Tracef0("HotKeyProcess:Creating new dynamic window (handle is &"+
~v%+")"):q%=
shell_HeapBlockFetch(36):q%!0=v%:
&400CB,,q%:gA%=(q%!4-q%!&C)/2:fA%=(q%!16-q%!8)/2:
shell_HeapBlockReturn(q%)
:T$=$(c%!16):
T$<>""
shell_Tracef0("HotKeyProcess:Calling Pre-Open FN '"+T$+"'"):
c%!&C>0
("FN"+T$+"("+
c%!&C+")")
("FN"+T$+"("+
v%+")")
shell_Tracef0("HotKeyProcess:No Pre-Open FN registered")
shell_SearchStatic(_U%!&B8,c%!&C):
d%>-1
shell_OpenWindowStatic(c%!&C)
c%!&C>0
shell_MessageNoArgs("SHELLMSG09")
shell_OpenWindowDynamic2(v%,gA%,fA%)
:Y$=$(c%!20):
Y$<>""
shell_Tracef0("HotKeyProcess:Calling Post-Open FN '"+Y$+"'"):
c%!&C>0
("FN"+T$+"("+
c%!&C+")")
("FN"+Y$+"("+
v%+")")
shell_Tracef0("HotKeyProcess:No Post-Open FN registered")
j$="":T$="":Y$="":_%=
shell_WindowCentreOnPointer(v%):
t%,SC%,gA%,fA%:SC%=
shell_HeapBlockFetch(20):
&400CF,,SC%:q%=
shell_HeapBlockFetch(36):q%!0=v%:
&400CB,,q%:gA%=(q%!4-q%!&C)/2:fA%=(q%!16-q%!8)/2:
shell_WindowMoveTo(v%,SC%!0+gA%,SC%!4-fA%)
shell_HeapBlockReturn(q%):
shell_HeapBlockReturn(SC%):
shell_WindowCentreOnScreen(v%):
t%,sC%,tC%,sA%,UA%,OC%,qB%:
&20035,-1,4
,,OC%:
&20035,-1,5
,,qB%:
&20035,-1,&B
,,sC%:
&20035,-1,&C
,,tC%:sC%=sC%<<OC%:tC%=tC%<<qB%:q%=
shell_HeapBlockFetch(36):q%!0=v%:
&400CB,,q%:sA%=(q%!&C-q%!4)
eUA%=(q%!16-q%!8):
shell_WindowMoveTo(v%,(sC%/2)-(sA%/2),(tC%-UA%)/2):
shell_HeapBlockReturn(q%):
shell_OpenWindowStaticNewView(b%):
shell_OpenWindow(b%,
,-1):
shell_OpenWindowStatic(i%):
shell_SearchStatic(_U%!&B8,i%)>-1
shell_OpenWindow(i%,0,-1)
shell_SearchStatic(dA%,i%):
j%,g%:j%=-1:g%=0:
dA%<>0
dA%!g%<>-1:
dA%!g%=i%
j%=g%:=j%
:g%+=4:
shell_CreateWindowStatic(z$,
tB%,dA%,c%,d%:tB%=
shell_GetWB(z$):tB%!64=_U%!16:
&400C1,,tB%
i%:dA%=_U%!&B8:
dA%=0
shell_Tracef0("CreateWindowStatic:Empty List"):_U%!&B8=
shell_HeapBlockFetch(8):dA%=_U%!&B8:dA%!0=i%:dA%!4=-1
shell_Tracef0("CreateWindowStatic:Searching for window handle"):d%=
shell_SearchStatic(_U%!&B8,i%):
d%=-1
shell_Tracef0("CreateWindowStatic:Not found - adding window handle to list"):d%=
shell_SearchStatic(_U%!&B8,0):
d%=-1
shell_Tracef0("CreateWindowStatic:Extending window handle list"):g%=0:
dA%!g%<>-1:g%+=4:
:_U%!&B8=
shell_HeapBlockExtend(_U%!&B8,4):dA%=_U%!&B8
shell_Tracef0("CreateWindowStatic:Found unused space in list"):g%=d%
:c%=dA%+g%:c%!0=i%:c%!4=-1
shell_InitHelpSystem(G$,gF%):
BA$,FA%,qA%,Z$,XD%,ZB%:_U%!&D4=0:
_U%!&D8<>0
shell_HeapBlockReturn(_U%!&D8)
B@_U%!&D8=0:
shell_ScanForHelp:
BA$=" -DieWithTask"
BA$=""
_U%!&64
G$="":qA%=
shell_HeapBlockFetch(256):Z$=
shell_OSVarGetVal(qA%,256,
shell_GetAppName+"Res$Path",-1):
shell_HeapBlockReturn(qA%):
:FA%=
Z$,","):
FA%>0
shell_FileExists(
Z$,FA%-1)+
shell_GetAppName)
OGG$=
Z$,FA%-1)+
shell_GetAppName:
shell_StrongHlpChkFiles(G$)
Z$,FA%+1)
shell_FileExists(Z$+
shell_GetAppName)
V?G$=Z$+
shell_GetAppName:
shell_StrongHlpChkFiles(G$)
shell_OK(
shell_MessageOneArg("SHELLMSG26",
shell_GetAppName))
G$<>""
shell_FileExists(G$)
shell_StrongHlpChkFiles(G$)
shell_MessageOneArg("SHELLMSG33",G$)
ZB%=0
shell_StrongHlpMsg("Help_Install "+G$+BA$):_U%!&64=_U%!&64
shell_HelpWord(CA$):
PG%,c%,AA%:AA%=
shell_HeapBlockFetch(512):
_U%!&D0=-1
shell_OSVarExists(AA%,"StrongHelp$Dir")
&600DE,"<StrongHelp$Dir>":
_U%!&D8<>0
shell_HeapBlockReturn(_U%!&D8)
y<_U%!&D8=
shell_HeapBlockFetch(
CA$+1):c%=_U%!&D8:$c%=CA$
shell_HeapBlockReturn(AA%):
shell_OK(
shell_MessageNoArgs("SHELLMSG11"))
shell_StrongHlpMsg("Help_Word "+CA$)
shell_HeapBlockReturn(AA%):
shell_StrongHlpMsg(o$):
shell_BroadcastMessage(&43B00,o$):
shell_ScanForHelp:
UB%,vC%:UB%=
shell_HeapBlockFetch(256):
:UB%!&C=0:
&400E7,19,UB%,-2,_U%!&D4
,,vC%:_U%!&D4=_U%!&D4+1:
vC%<>-1
(_U%!&D4)>64:
vC%<>-1
@UB%!0=24:UB%!&C=0:UB%!16=&400C6:UB%!20=vC%:
&400E7,17,UB%,0
shell_HeapBlockReturn(UB%):
shell_BroadcastMessage(lF%,o$):
z%,ZD%:ZD%=(
o$+30)
3:z%=
shell_HeapBlockFetch(ZD%):z%!&C=0:z%!16=lF%:$(z%+20)=o$+
(0):z%!0=ZD%:
&600E7,17,z%,0:
shell_HeapBlockReturn(z%):
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%,fC%):
a%,n%,oC%,i%:
shell_Tracef0("WindowToggleFlags:wh%=&"+
~b%):oC%=
shell_WindowIsOpen(b%):a%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):a%!0=b%:
&400CC,,a%:n%=a%!32:n%=(n%
fC%):a%!32=n%:
&400C3,,a%
&400C1,,a%+4
i%:!a%=i%:
&400C5,,a%
shell_HeapBlockReturn(a%):
i%<>b%
shell_UpdateWindowHandle(b%,i%):b%=i%
shell_ListClickSelect:
x%,e%,p%,c%,CA%:x%=_U%!&C:p%=
shell_HeapBlockInfo(x%):
shell_Tracef0(" "):
shell_Tracef0("List of ClickSelect events:"):e%=0:
:c%=x%!(e%+20):CA%=x%+e%:
shell_HeapBlockExists(c%)
$c%<>""
shell_Tracef0("&"+
shell_StringPadTrailing(
~CA%!0," ",8)+" &"+
shell_StringPadTrailing(
~CA%!4," ",8)+" "+$c%)
:e%+=48:
(e%>=p%):
shell_Tracef0(" "):
shell_ListClickAdjust:
x%,e%,p%,c%,CA%:x%=_U%!&C:p%=
shell_HeapBlockInfo(x%):
shell_Tracef0(" "):
shell_Tracef0("List of ClickAdjust events:"):e%=0:
:c%=x%!(e%+24):CA%=x%+e%:
shell_HeapBlockExists(c%)
$c%<>""
shell_Tracef0("&"+
shell_StringPadTrailing(
~CA%!0," ",8)+" &"+
shell_StringPadTrailing(
~CA%!4," ",8)+" "+$c%)
:e%+=48:
(e%>=p%):
shell_Tracef0(" "):
shell_ListHelpTags:
x%,e%,p%,c%,CA%:x%=_U%!&C:p%=
shell_HeapBlockInfo(x%):
shell_Tracef0(" "):
shell_Tracef0("List of attached help tags:"):e%=0:
:c%=x%!(e%+44):CA%=x%+e%:
shell_HeapBlockExists(c%)
$c%<>""
shell_Tracef0("&"+
shell_StringPadTrailing(
~CA%!0," ",8)+" &"+
shell_StringPadTrailing(
~CA%!4," ",8)+" "+$c%)
:e%+=48:
(e%>=p%):
shell_Tracef0(" "):
shell_MemFill(TC%,ME%,NE%):
I%,wC%,bD%:wC%=ME%
4:bD%=ME%
wC%>0
(wC%*4)
4:TC%!(I%-1)=NE%:
bD%>0
e.TC%=TC%+(wC%*4):
bD%-1:TC%?I%=NE%:
shell_AttachFontMenu(b%,f%,J$,PA$):
shell_FontMenuInit:
"FontMenu_Select",""+
0,_U%!260
,m%:_U%!&FC=m%:
shell_EventAdd(b%,f%,0,-2,J$):
shell_Tracef0("AttachFontMenu:Attaching font menu"):
PA$<>""
shell_AttachMenuMaker(b%,f%,PA$)
shell_AttachFontSubMenu(GB%,F$,J$):
EG%,m%,c%,g%:
shell_FontMenuInit:
"FontMenu_Select",""+
0,_U%!260
&45BCE,GB%,m%:
&45BCC,,
:_U%!&FC=m%:
shell_EventListMenuWarn(GB%,m%,F$,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(p$,cD%):
c%,JB%:
shell_HeapBlockExists(_U%!&F4)
shell_HeapBlockReturn(_U%!&F4)
H_U%!&F4=
shell_HeapBlockFetch(
p$+1):c%=_U%!&F4:$c%=p$:
cD%<>0
cD%=1
B_U%!260=cD%:
"FontMenu_Select",p$,_U%!260
,JB%:
JB%<>_U%!&FC
shell_FontMenuUpdatePtr(JB%):_U%!&FC=JB%
shell_Tracef0("FontMenuSelectFont:Font is '"+p$+"'"):
shell_FontMenuGetLastSelectedFont:
shell_HeapBlockExists(_U%!&F4)
c%=_U%!&F4:=$c%
shell_FontMenuUpdatePtr(e%):
x%,g%:
shell_Tracef0("FontMenuUpdatePtr:Started.."):
shell_HeapBlockExists(_U%!&DC)
shell_Tracef0("FontMenuUpdatePtr:HeapBlock found.."):x%=_U%!&DC:g%=0:
shell_Tracef0("FontMenuUpdatePtr:Substituting ptr.."):x%!(g%+8)=e%:g%+=&C:
x%!g%=-1
shell_MenuUpdateHandle(PE%,QE%):
p%,e%,h%,m%:p%=
shell_HeapBlockInfo(_U%!&C)-8:e%=0:j%=
:h%=_U%!&C:
:m%=h%!(e%+8):
m%=PE%
h%!(e%+8)=QE%
+e%+=48:
(e%>=p%):
_U%!24=PE%
_U%!24=QE%
shell_FindFont(
b$,xC%,yC%,
eD%):
shell_FontIsAvailable(b$,xC%,yC%)
b$="Trinity.Medium"
&40081,,b$,xC%*16,yC%*16,0,0
shell_FontIsAvailable(b$,xC%,yC%):
&40081,0,b$,xC%*16,yC%*16,0,0
&40082,eD%:=
shell_CheckSelection(eF%):
c%,g%:c%=_U%!256:
_U%!24=_U%!&FC
eF%!g%<>c%!g%
g%+=4:
c%!g%=-1:=g%
shell_MenuGetItemAddress(m%,TE%):
g%,kB%:
&45BC7,m%
:kB%=m%+28+((TE%!g%)*24):m%=kB%!4:g%+=4:
TE%!g%=-1:=kB%
shell_GetLastMouseXPos:=_U%!272
shell_GetLastMouseYPos:=_U%!276
shell_UpdateWindowHandle(aA%,OA%):
shell_Tracef0("UpdateWindowHandle:Updating stored window handles"):
shell_Tracef0("UpdateWindowHandle:old handle=&"+
~aA%):
shell_Tracef0("UpdateWindowHandle:new handle=&"+
~OA%):
OA%<>aA%
_U%!28=aA%
_U%!28=OA%
shell_FixEventBlock(aA%,OA%,_U%!&C,48):
shell_FixEventBlock(aA%,OA%,_U%!96,16):
shell_FixEventBlock(aA%,OA%,_U%!72,24):
shell_FixEventBlock(aA%,OA%,_U%!92,24):
shell_FixEventBlock2(aA%,OA%,_U%!&68,16):
shell_FixEventBlock2(aA%,OA%,_U%!332,32)
shell_UpdateStaticWindows(aA%,OA%)
shell_UpdateStaticWindows(aA%,OA%):
d%,dA%:
shell_Tracef0("UpdateStaticWindows:Correcting static window list.."):dA%=_U%!&B8:d%=
shell_SearchStatic(_U%!&B8,aA%):dA%!d%=OA%:
shell_FixEventBlock(aA%,OA%,h%,d%):
e%,p%:
shell_HeapBlockExists(h%)
C1p%=
shell_HeapBlockInfo(h%)-8:
(h%!e%=aA%)
h%!e%=OA%
:e%+=d%:
(e%>=p%)
shell_FixEventBlock2(aA%,OA%,h%,d%):
e%,p%:e%=4:
shell_HeapBlockExists(h%)
p%=!h%:
(h%!e%=aA%)
h%!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%):
EA$:EA$="Run "+
shell_GetAppDir+
&C,2,Q%!20,EA$,
shell_MessagesInit(C$,
WE%):
hA%,n%:
3,"Cannot open message file '"+C$+"'"
&41500,,C$
n%,,hA%:
WE%=0
shell_HeapBlockFetch(hA%)
30,6,,,17+
,,zC%:$(zC%+16)=C$:
&41501,zC%,zC%+16:
shell_Tracef0("MessagesInit:Message resource file '"+C$+"' loaded"):
shell_PrinterOnLine:
XE%,YE%:XE%=
(-4):
2,1,0,1,0,1,0:
>30:YE%=
(-4)<XE%):*FX21,3
3:=YE%
shell_AttachBumpHandler(b%,f%,ZE%,aE%,nF%,pF%,bE%,sF%,FA$,GA$):
l%,d%,c%,CA%,pA%:d%=
shell_GetEventListOffset2(b%,ZE%,_U%+&68,16,
):l%=_U%!&68+d%:l%!0=b%:l%!4=ZE%:l%!8=bE%:l%!&C=
shell_HeapBlockFetch(24):pA%=l%!&C:pA%!0=f%:pA%!4=nF%:pA%!8=pF%
FA$>0
>pA%!&C=
shell_HeapBlockFetch((
FA$)+1):CA%=pA%!&C:$CA%=FA$
pA%!&C=0
GA$>0
>pA%!16=
shell_HeapBlockFetch((
GA$)+1):CA%=pA%!16:$CA%=GA$
pA%!16=0
sF%=-1
pA%!20=1
pA%!20=0
shell_GetEventListOffset2(b%,aE%,_U%+&68,16,
):l%=_U%!&68+d%:l%!0=b%:l%!4=aE%:l%!8=bE%*(-1):l%!&C=pA%:
shell_HandleBumpIcons(d%,b%,f%,_button%):
GG%,LA%,l%,UC%,_temp$,gD%:
MG%,eB%:
_button%<>2
Pl%=_U%!&68+d%:_U%!288=b%:_U%!292=f%:_U%!296=d%:LA%=l%!&C:gD%=LA%!16:
gD%<>0
C_temp$=
shell_IconGetData(b%,LA%!0):UC%=
("FN"+$gD%+"(_temp$)")
shell_IconGetData(b%,LA%!0))
_button%=1
_new_val%=UC%+((l%!8)*(-1))
_new_val%=UC%+l%!8
LA%!20=0
_new_val%>LA%!8
_new_val%=LA%!8
_new_val%<LA%!4
_new_val%=LA%!4
_new_val%>LA%!8
_new_val%=LA%!4
_new_val%<LA%!4
_new_val%=LA%!8
:eB%=LA%!&C:
eB%<>0
1_new_val$=
("FN"+$eB%+"(_new_val%,_button%)")
_new_val$=
_new_val%
_new_val%<>UC%
shell_IconPutData(b%,LA%!0,_new_val$,-1)
shell_WindowSetSpriteArea(v%,hD%):
a%,OA%,PC%,iD%:a%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(v%)*32)):!a%=v%:
&400CC,,a%:a%!68=hD%:
shell_IconSetSpriteArea(a%!60,a%+76,hD%):
(a%!88)>0
PC%=0
(a%!88)-1:iD%=a%+92+PC%*32:
shell_IconSetSpriteArea(iD%!16,iD%+20,hD%):
&400C3,,a%:
&400C1,,a%+4
OA%<>v%
shell_UpdateWindowHandle(v%,OA%):v%=OA%
shell_HeapBlockReturn(a%):=v%
shell_IconSetSpriteArea(n%,VC%,JF%):
3)=2)
256)<>0)
VC%!4=JF%
shell_StrongHlpIsAvailable:
LB%,AA%:LB%=
_U%!&64
5kAA%=
shell_HeapBlockFetch(256):LB%=
shell_OSVarExists(AA%,"StrongHelp$Dir"):
shell_HeapBlockReturn(AA%)
:=LB%
shell_MenuNew(S$):
&45BC1,,S$
i%:=i%
shell_MenuAdd(i%,RA$,J$):
J$<>""
&45BC2,i%,RA$,J$
&45BC2,i%,RA$
:=jD%
shell_MenuTick(nA%,ZA%):
&45BC9,nA%,ZA%:
shell_MenuTickOnly1(WA%,FA%):
&45BD1,WA%,FA%:
shell_MenuTickOnly2(nA%):
&45BD1,nA%:
shell_MenuShade(i%,ZA%):
&45BCB,i%,ZA%:
shell_MenuDotted(nA%,ZA%):
&45BCA,nA%,ZA%:
shell_MenuColours(nA%,lD%,tD%):
&45BD0,nA%,lD%,tD%:
shell_MenuWritable(nA%,ZA%,hA%,t$):
&45BCD,nA%,ZA%,hA%,t$:
shell_MenuPutData(nA%,P$):
&45BC8,nA%,P$:
shell_MenuCallHandler(v%,_h_blk%):
("FN"+$v%+"(_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(CC%,ZA$,aA$):
46,512+26,CC%,
shell_SpriteGetPtr(CC%,ZA$),aA$:
shell_SpriteAreaSave(CC%,C$):
46,512+&C,CC%,C$:
shell_EnsurePoll:
:DA%=
shell_Poll_I(0,_U%!&94):
shell_Action(DA%):
DA%=0:
shell_WimpGetVersion:=_U%!316
shell_OSCheckVersion(LF%):=
shell_OSModuleCheckVersion("UtilityModule",LF%)
shell_OSModuleCheckVersion(bA$,a):
a%,nB%,O$:a%=
shell_HeapBlockFetch(256):
("Set Module$Check Y"):
("RMEnsure "+bA$+" "+
a+" Set Module$Check N"):
35,"Module$Check",a%,256,0,0
,,nB%:a%?nB%=&D:
("Unset Module$Check"):O$=$a%
shell_HeapBlockReturn(a%):
O$="N"
shell_MessageSendDataLoad(w%,R$):
z%:z%=
shell_HeapBlockFetch(256):z%!0=256:z%!4=0:z%!&C=0:z%!16=5:z%!20=0:z%!28=0:z%!32=0:z%!36=0:z%!40=w%:$(z%+44)=R$+
&400E7,17,z%,0:
shell_HeapBlockReturn(z%):
shell_MenuMakeFromFile(S$,cA$,i$):
i%,X%,B$,o%:
shell_FileExists(i$)
shell_MenuNew(S$):X%=
(i$):
#X%:o%=
shell_MenuAdd(i%,B$,cA$):
shell_BinarySearch(_search_term$,dA$,h$,NF%,kD%):
_pos%,rA%,_wp$,AD%,NG%,mD%,nD%,gE%,j%,oD%:kD%+=1:oD%=
:rA%=kD%:AD%=0:_pos%=rA%
2:nD%=NF%-1:mD%=kD%:
:_wp$=
("FN"+dA$+"(_pos%)"):pD%=_pos%:
_search_term$=_wp$
("FN"+h$+"(_search_term$,_wp$)")
!+mD%=_pos%:rA%=_pos%-nD%:_pos%=rA%
2+AD%
nD%=_pos%:AD%=_pos%:rA%=mD%-_pos%:_pos%=rA%
2+AD%
gE%=pD%
-!gE%=pD%:
shell_IconLastClicked:=_U%!32
shell_MenuGetNrItems(WA%):
m%,_%,iE%:
&45BC7,WA%
m%:m%+=28:
:_%=(m%?0
&80):iE%+=1:m%+=24:
_%:=iE%
shell_MenuGetNrDotted(WA%):
m%,_%,qC%:
&45BC7,WA%
m%:m%+=28:
:_%=(m%?0
&80):
(m%?0
qC%+=1
m%+=24:
_%=-1:=qC%
shell_MenuGetItemHandler(WA%,XC%):
XA%,e%,HA$:XA%=
shell_HeapBlockFetch(8):XA%!0=XC%:XA%!4=-1:
&45BC4,WA%,XA%
HA$=""
HA$=$(e%)
shell_HeapBlockReturn(XA%):=HA$
shell_MenuGetItemText(WA%,XC%):
XA%,e%,H$:XA%=
shell_HeapBlockFetch(8):XA%!0=XC%:XA%!4=-1:
&45BC4,WA%,XA%
,,e%:H$=$(e%!&C):
shell_HeapBlockReturn(XA%):=H$
shell_MenuGetItemHandle(WA%,XC%):
XA%,e%,i%:XA%=
shell_HeapBlockFetch(8):XA%!0=XC%:XA%!4=-1:
&45BC4,WA%,XA%
,,e%:i%=e%!8:
shell_HeapBlockReturn(XA%):=i%
shell_MenuGetItemHeight(WA%):
&45BC7,WA%
m%:=m%!20
shell_MenuCalculateHeight(WA%):
UA%:UA%=
shell_MenuGetNrItems(WA%)*
shell_MenuGetItemHeight(WA%):=UA%+(
shell_MenuGetNrDotted(WA%)*24)
shell_MenuSortItems(m%,gA$,WF%,TC%,rD%):
sD%:sD%=
shell_MenuGetNrItems(m%)-1:_shell_MS_handle%=m%:
rD%>sD%
rD%=sD%
&406C0:
shell_QuickSort(gA$,"_shell_MS_swap",WF%,0,rD%):
&406C1:
shell_QuickSort(h$,k$,_asc%,_start%,_end%):
_lo%,_h%,_F%,_temp%,o%:_lo%=_start%:_hi%=_end%:_F%=
:_temp%=_lo%-1+
(_hi%+1-_lo%):o%=
("FN"+k$+"(_lo%,_temp%)"):
_asc%=0
("FN"+h$+"(_lo%,_hi%)")
("FN"+k$+"(_lo%,_hi%)"):_F%=
("FN"+h$+"(_hi%,_lo%)")
("FN"+k$+"(_hi%,_lo%)"):_F%=
_hi%=_hi%-1
_lo%=_lo%+1
_lo%=_hi%:
_start%<_lo%-1
shell_QuickSort(h$,k$,_asc%,_start%,_lo%-1)
_hi%+1<_end%
shell_QuickSort(h$,k$,_asc%,_hi%+1,_end%)
_shell_MS_swap(BD%,CD%):
l$,m$,jE%,kE%:l$=
shell_MenuGetItemText(_shell_MS_handle%,BD%):m$=
shell_MenuGetItemText(_shell_MS_handle%,CD%):jE%=
shell_MenuGetItemHandle(_shell_MS_handle%,BD%):kE%=
shell_MenuGetItemHandle(_shell_MS_handle%,CD%)
shell_MenuPutData(jE%,m$):
shell_MenuPutData(kE%,l$):=0
_shell_MS_comp(BD%,CD%):
l$,m$:l$=
shell_MenuGetItemText(_shell_MS_handle%,BD%):m$=
shell_MenuGetItemText(_shell_MS_handle%,CD%):
shell_WindowSetTitleRightJust(
t%,TA%,i%,ZC%:ZC%=
shell_WindowIsOpen(b%):t%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):!t%=b%:
&400CC,,t%:TA%=t%!60:
(1<<3))
shell_Tracef0("WindowSetTitleRightJust:title flags = &"+
~TA%):
shell_Tracef0("WindowSetTitleRightJust:Horizontally centred bit set.."):
shell_Tracef0("WindowSetTitleRightJust:Unsetting horizontally centred bit.."):TA%=TA%
(1<<3)
shell_Tracef0("WindowSetTitleRightJust:title flags = &"+
~TA%)
shell_Tracef0("WindowSetTitleRightJust:Horizontally centred bit NOT set..")
shell_Tracef0("WindowSetTitleRightJust:Setting right justified bit.."):TA%=TA%
(1<<9):t%!60=TA%:
&400C3,,t%:
&400C1,,t%+4
b%<>i%
shell_Tracef0("WindowSetTitleRightJust:Updating window handle..."):
shell_UpdateWindowHandle(b%,i%):b%=i%
shell_OpenWindow(i%,0,0)
shell_HeapBlockReturn(t%):
shell_WindowSetTitleCentreJust(
t%,TA%,i%,ZC%:ZC%=
shell_WindowIsOpen(b%):t%=
shell_HeapBlockFetch(&64+(
shell_WindowCountIcons(b%)*32)):!t%=b%:
&400CC,,t%:TA%=t%!60:
shell_Tracef0("WindowSetTitleCentreJust:title flags = &"+
~TA%)
shell_Tracef0("WindowSetTitleCentreJust:t_flags% AND (1 << 3) = "+
~(TA%
(1<<3))):
(1<<3))=0
shell_Tracef0("WindowSetTitleCentreJust:Horizontally centred bit not set.."):
shell_Tracef0("WindowSetTitleCentreJust:Setting horizontally centred bit.."):TA%=TA%
(1<<3):
shell_Tracef0("WindowSetTitleCentreJust:title flags = &"+
~TA%):t%!60=TA%
&400C3,,t%:
&400C1,,t%+4
b%<>i%
shell_Tracef0("WindowSetTitleCentreJust:Updating window handle..."):
shell_UpdateWindowHandle(b%,i%):b%=i%
shell_OpenWindow(i%,0,0)
shell_HeapBlockReturn(t%):
shell_IconGetSelectedIcons(b%,DC%,
nE%:nE%=(DC%<<16)+(1<<21):
&400D6,b%,r%,nE%,(DC%<<16)+(1<<21):
shell_GetLastMouseButton:=_U%!320
shell_GetLastWindowClicked:=_U%!28
shell_GetLastIconClicked:=_U%!32
shell_IconIndirSize(jA%,n%,VC%,X%):
hA%,oE%,g%,NC%:
&800100)=256
<"hA%=VC%!8:
(VC%!4<>-1)
>AoE%=VC%!4:
#X%=jA%+oE%:g%=0:
:NC%=
#X%:g%+=1:
NC%<32:hA%+=+g%
hA%=0
:=hA%
shell_StrongHlpChkFiles(G$):
shell_FileExists(G$+".HelpData")
S<ZB%=-1:
shell_MessageOneArg("SHELLMSG32","HelpData")
shell_FileExists(G$+".Index")
X9ZB%=-1:
shell_MessageOneArg("SHELLMSG32","Index")
shell_CaretMoveCaret(b%,DA%):
BA%,pE%,g%,e%,bB%:g%=0:e%=0:BA%=
shell_HeapBlockFetch(&800):
&400D3,,BA%:
BA%!4<>-1
h?pE%=BA%!4:
&400D6,b%,BA%,&40E000,&E000:
BA%!g%=pE%
e%=g%
g%+=4:
BA%!g%=-1:
0:bB%=!BA%
1:bB%=BA%!(g%-4)
BA%!(e%+4)<>-1
bB%=BA%!(e%+4)
bB%=!BA%
bB%=BA%!(e%-4)
bB%=BA%!(g%-4)
&400D2,b%,bB%,-1,-1,-1,
shell_IconGetData(b%,bB%))
shell_HeapBlockReturn(BA%):
shell_CaretPutFirstIcon(b%):
shell_CaretMoveCaret(b%,0):
shell_CaretPutLastIcon(b%):
shell_CaretMoveCaret(b%,1):
shell_CaretPutNextIcon(b%):
shell_CaretMoveCaret(b%,2):
shell_CaretPutPrevIcon(b%):
shell_CaretMoveCaret(b%,3):
shell_TemplateFileInfo(C$,
GC%:GC%=
RO3_Present:
shell_TemplateFileInfo3(C$,eA%,SA%,_%)
shell_TemplateFileInfo2(C$,eA%,SA%,_%)
shell_TemplateFileInfo2(C$,
FA%,rB%,VB%:
AA%,X%,DD%,LE%:
g%,NC%,yD%,AB%,cC%,n%:FA%=0:SA%=0:rB%=0:VB%=0:_%=0:
shell_FileExists(C$)
_%=-1
shell_FileType(C$)<>&FEC
_%=-2
UAA%=
shell_HeapBlockFetch(&D):X%=
(C$):
#X%=16:
&C,4,X%,AA%,4:jA%=!AA%:
jA%>0
SA%+=1:zD%=0:
&C,4,X%,AA%,4:DD%=!AA%:
&C,4,X%,AA%,4:LE%=!AA%:
&C,4,X%,AA%,&C:yD%=
#X%=jA%+56:
&C,4,X%,AA%,4:n%=!AA%:
#X%=jA%+72:
&C,4,X%,AA%,&C:zD%+=
shell_IconIndirSize(jA%,n%,AA%,X%):
#X%=jA%+84:
&C,4,X%,AA%,4:AB%=!AA%:
AB%>0
cC%=0
AB%-1:
#X%=jA%+88+(cC%*32)+16:
&C,4,X%,AA%,4:n%=!AA%:
#X%=jA%+88+(cC%*32)+20:
&C,4,X%,AA%,&C:zD%+=
shell_IconIndirSize(jA%,n%,AA%,X%):
#X%=yD%:rB%+=zD%:
DD%>VB%
VB%=DD%
jA%=0:
shell_HeapBlockReturn(AA%):eA%=VB%+rB%
shell_TemplateFileInfo3(C$,
FA%,rB%,VB%,jA%:
g%,NC%,yD%,AB%,cC%,n%:FA%=0:SA%=0:rB%=0:VB%=0:AA%=
shell_HeapBlockFetch(&D):
&400D9,,C$:
:$AA%="*":
&400DB,,-1,,,,AA%,FA%
,eA%,jF%,,,,FA%:
FA%<>0
eA%>VB%
VB%=eA%
rB%+=jF%:SA%+=1
FA%=0:
&400DA:eA%=VB%+rB%:
shell_HeapBlockReturn(AA%):
RO3_Present:
a%,nB%,O$:a%=
shell_HeapBlockFetch(256):
("Set RO3$Check Y"):
("RMEnsure UtilityModule 3.00 Set RO3$Check N"):
35,"RO3$Check",a%,256,0,0
,,nB%:a%?nB%=&D:
("Unset RO3$Check"):O$=$a%:
shell_HeapBlockReturn(a%):
O$="N"
shell_WindowCountIcons(b%):
WB%,GC%,AB%:
(_U%!&64
1<<&A)
shell_Tracef0("WindowCountIcons:RISC OS 3 detected.."):
b%=-1
b%=-2
0yWB%=
shell_HeapBlockFetch(88):!WB%=b%:
&400CC,,WB%+1:AB%=WB%!88:
shell_Tracef0("WindowCountIcons:nr_icons% = "+
shell_Tracef0("WindowCountIcons:RISC OS 3 NOT found.."):WB%=
shell_HeapBlockFetch(6000):
=$!WB%=b%:
&400CC,,WB%:AB%=WB%!88
shell_Tracef0("WindowCountIcons:nr_icons% = "+
shell_HeapBlockReturn(WB%):=AB%
shell_SliderGetValue(i%):=(_U%!332+i%)!28
shell_HandleSlider(b%,f%,mA%):
GA%,IA%,MA%,a%,l%:
shell_Tracef0("HandleSlider:slider drag event found.."):l%=_U%!332+mA%:GA%=
shell_HeapBlockFetch(50):GA%!0=b%:GA%!4=l%!8:
&400CE,,GA%:a%=_U%!328:a%!0=0:a%!4=GA%!16-GA%!8:a%!8=f%:a%!&C=l%!&C:a%!16=l%
a%!24=l%!24:GA%!0=b%:
&400CB,,GA%:IA%=GA%!4-GA%!20:MA%=GA%!16-GA%!24:GA%!4=f%:
&400CE,,GA%:GA%!4=7:GA%!8+=IA%:GA%!&C+=MA%:GA%!16+=IA%:GA%!20+=MA%:GA%!24=GA%!8:GA%!28=GA%!&C:GA%!32=GA%!24+a%!4:GA%!36=GA%!20:
&400D0,,GA%:
shell_HeapBlockReturn(GA%)
_U%!&64=_U%!&64
1<<&B:
shell_Slider:
zA%,a%,ED%,dC%,b%,IA%,UA$,EB%,_value%,o%:zA%=
shell_HeapBlockFetch(20):EB%=_U%!328:
&400CF,,zA%:b%=zA%!&C:dC%=EB%!8:ED%=!zA%:
ED%<>!EB%
shell_HeapBlockFetch(50):!a%=b%:
&400CB,,a%:IA%=ED%-a%!4:a%!4=dC%:
&400CE,,a%:
&400C4,,a%:a%!4=b%:a%!16=IA%:
&400C2,,a%+4:
&400D1,b%,a%!8,a%!&C,a%!8+EB%!4,a%!20:_value%=
(((IA%-a%!8)*&64)/EB%!4):c%=EB%!16:c%!28=_value%:
EB%!24<>-1
("FN"+$(EB%!24)+"(_value%)")
EB%!&C>=0
7UA$=
(_value%):
shell_IconPutData(b%,EB%!&C,UA$,-1)
:!EB%=ED%:
shell_HeapBlockReturn(a%)
shell_HeapBlockReturn(zA%):
shell_GetEventListOffset2(b%,f%,h%,_A%,MC%):
p%,e%,j%,d%,yA%,c%:
(!h%=0
(!h%=0)
E!h%=
shell_HeapBlockFetch(_A%+4):c%=!h%:c%!0=_A%:c%!4=0:c%!8=0:=4
:c%=!h%:p%=!c%:
shell_Tracef0("GetEventListOffset2:list size is "+
p%):e%=4:j%=
:d%=-1:yA%=-1:c%=!h%:
shell_Tracef0("GetEventListOffset2:window handle=&"+
~c%!e%):
yA%<0
(c%!e%=0
c%!e%+4=0)
yA%=e%
(c%!e%=b%)
f%=-1
d%=e%:j%=
c%!(e%+4)=f%
d%=e%:j%=
e%+=_A%
e%+=_A%
((e%>=(p%+4))
(d%=-1
yA%<0
Ud%=p%+4:!h%=
shell_HeapBlockExtend(!h%,_A%):c%=!h%:c%!0+=_A%:c%+=d%:c%!4=0:c%!8=0
d%=yA%
shell_SliderSetValue(i%,_value%):
l%,dC%,a%,zE%,BE%,CE%,GD%:
AF%,BF%:l%=_U%!332+i%:dC%=l%!4:b%=l%!0:zE%=l%!8:CE%=l%!&C:a%=
shell_HeapBlockFetch(50):a%!0=b%:a%!4=zE%:
&400CE,,a%:BE%=a%!16:GD%=a%!8:AF%=a%!&C:BF%=a%!20:a%!4=dC%:
&400CE,,a%
&400C4,,a%:a%!4=b%:
_value%>&64
_value%=&64
_value%<=0
_value%=0:a%!16=a%!8
a%!16=GD%+(BE%*(_value%/&64))-(GD%*(_value%/&64))
:l%!28=_value%:
&400C2,,a%+4:
&400D1,b%,GD%,AF%,BE%,BF%:
l%!24<>-1
("FN"+$(l%!24)+"(_value%)")
CE%>=0
shell_IconPutData(b%,CE%,
_value%,
shell_HeapBlockReturn(a%):
shell_AttachSliderHandler(b%,CF%,JC%,sB%,ID%,FE%,Q$):
l%,d%:d%=
shell_GetEventListOffset2(b%,JC%,_U%+332,32,
):l%=_U%!332+d%:l%!0=b%:l%!4=JC%:l%!8=CF%:l%!&C=sB%:l%!16=ID%:l%!20=FE%:
Q$<>""
=2l%!24=
shell_HeapBlockFetch(
Q$+1):$(l%!24)=Q$
l%!24=-1
:l%!28=0:
_U%!328=0
_U%!328=
shell_HeapBlockFetch(24)
shell_AttachClickSelect(b%,JC%,"_shell_icondrag"):
shell_AttachClickSelect(b%,CF%,"_shell_icondrag2"):
ID%>=0
shell_AttachClickSelect(b%,ID%,"_shell_sliderbumpupS"):
shell_AttachClickSelect(b%,FE%,"_shell_sliderbumpdownS"):
shell_AttachClickAdjust(b%,ID%,"_shell_sliderbumpdownA"):
shell_AttachClickAdjust(b%,FE%,"_shell_sliderbumpupA")
_shell_icondrag(b%,f%):
shell_IconDragBox(b%,f%):=0
_shell_icondrag2(b%,f%):
FB%,l%,YA%,j%,JC%:l%=_U%!332:FB%=!l%:YA%=4:
shell_Tracef0("Event block size is "+
FB%):
l%!(YA%+8)=f%
:JC%=l%!(YA%+4)
:YA%+=32:
YA%>=FB%
shell_IconDragBox(b%,JC%):=0
_shell_sliderbumpupS(b%,f%):
o%:o%=
_shell_sliderbumpup(b%,f%,4):=0
_shell_sliderbumpupA(b%,f%):
o%:o%=
_shell_sliderbumpup(b%,f%,1):=0
_shell_sliderbumpdownS(b%,f%):
o%:o%=
_shell_sliderbumpdown(b%,f%,4):=0
_shell_sliderbumpdownA(b%,f%):
o%:o%=
_shell_sliderbumpdown(b%,f%,1):=0
_shell_sliderbumpup(b%,f%,YB%):
FB%,l%,YA%,j%,e%,_value%,uB%:
shell_Tracef0("In sliderbumpup routine"):l%=_U%!332:FB%=!l%:YA%=4:
shell_Tracef0("Event block size is "+
FB%):
YB%=4
uB%=16
uB%=20
l%!(YA%+uB%)=f%
:e%=YA%:_value%=l%!(e%+28):
shell_Tracef0("Current slider value = "+
_value%):
shell_Tracef0("Slider handle is = "+
:YA%+=32:
YA%>=FB%
shell_SliderSetValue(e%,_value%+1)
_shell_sliderbumpdown(b%,f%,YB%):
FB%,l%,YA%,j%,e%,_value%,uB%:
shell_Tracef0("In sliderbumpdown routine"):l%=_U%!332:FB%=!l%:YA%=4:
shell_Tracef0("Event block size is "+
FB%):
YB%=4
uB%=20
uB%=16
l%!(YA%+uB%)=f%
:e%=YA%:_value%=l%!(e%+28):
shell_Tracef0("Current slider value = "+
_value%):
shell_Tracef0("Slider handle is = "+
:YA%+=32:
YA%>=FB%
shell_SliderSetValue(e%,_value%-1)
shell_DeleteEventSlider(b%,f%):
d%,a%,p%,h%,c%:h%=_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%=!h%:
d%=p%-32
shell_HeapBlockReturn(h%+d%+24):
shell_HeapBlockReturn(_U%!332):_U%!332=0:
shell_Tracef0("DeleteEventSlider:No Slider events now registered")
_U%!332=
shell_HeapBlockExtend(_U%!332,-32):h%=_U%!332:!h%-=32
a%=h%+d%:a%!0=0:a%!4=0:
shell_HeapBlockReturn(a%+24)
d%<0:
shell_OpenWindowDynamic(lA$,LA$,MA$):
v%,gA%,fA%,q%:
shell_CreateWindow(lA$,v%):
shell_Tracef0("OpenWindowDynamic:Creating new dynamic window (handle is &"+
~v%+")"):q%=
shell_HeapBlockFetch(36):q%!0=v%:
&400CB,,q%:gA%=(q%!4-q%!&C)/2
=fA%=(q%!16-q%!8)/2:
shell_HeapBlockReturn(q%):
_U%!20<>0
&400D4,,-1:o%=
shell_DeleteWindow(_U%!20)
:_U%!20=b%:
LA$<>""
shell_Tracef0("OpenWindowDynamic:Calling Pre-Open FN '"+LA$+"'"):o%=
("FN"+LA$+"("+
v%+")")
shell_Tracef0("OpenWindowDynamic:No Pre-Open FN")
shell_OpenWindowDynamic2(v%,gA%,fA%):
MA$<>""
shell_Tracef0("OpenWindowDynamic:Calling Post-Open FN '"+MA$+"'"):o%=
("FN"+MA$+"("+
v%+")")
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(HE%,GF%):
GF%>1
_U%!336=GF%-1
_U%!336=0
shell_DoSendPrintSave(HE%):
shell_DoSendPrintSave(HE%):
EA%:EA%=
shell_HeapBlockFetch(256):EA%!0=256:EA%!&C=0:EA%!16=&80142:EA%!20=0:EA%!24=0:EA%!28=0:EA%!32=0:EA%!36=256:EA%!40=HE%:$(EA%+44)="PrintOut"+
shell_Tracef0("MessageSendPrintSave:Sending PrintSave message..")
&400E7,18,EA%,EA%!20,EA%!24:
shell_HeapBlockReturn(EA%):
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
;aB%:
shell_PrinterDriverGetName:
aB%,HF%:
&A0140
,,,,HF%;aB%:
shell_GetString(HF%)
shell_IconGetBGColour(b%,f%):
oA%,k%:k%=
shell_HeapBlockFetch(40):k%!0=b%:k%!4=f%:
&400CE,,k%:oA%=(k%!24>>28)
shell_HeapBlockReturn(k%):=oA%
shell_IconGetFGColour(b%,f%):
oA%,k%:k%=
shell_HeapBlockFetch(40):k%!0=b%:k%!4=f%:
&400CE,,k%:oA%=(k%!24>>24)
shell_HeapBlockReturn(k%):=oA%
shell_AttachPopupMenu(b%,cB%,sB%,m%,Q$):
shell_DoAttachPopupHandler(b%,cB%,sB%,m%,Q$,0):
shell_AttachColourPopupMenu(b%,cB%,sB%,m%,Q$):
shell_DoAttachPopupHandler(b%,cB%,sB%,m%,Q$,1):
shell_DoAttachPopupHandler(b%,cB%,sB%,m%,Q$,vB%):
l%,d%:d%=
shell_GetEventListOffset2(b%,cB%,_U%+340,24,
):l%=_U%!340+d%:l%!0=b%:l%!4=cB%:l%!8=sB%:
Q$<>""
2l%!&C=
shell_HeapBlockFetch(
Q$+1):$(l%!&C)=Q$
l%!&C=-1
:l%!16=vB%:l%!20=m%:
cB%>=0
shell_IconSetButtonType(b%,cB%,3)
shell_DoPopupSelect(_Q%,d%):
l%,Q$:l%=_U%!340+d%:
l%!&C=-1
l%!16=0
shell_IconPutData(!l%,l%!8,
shell_MenuGetItemText(l%!20,!_Q%),
shell_IconSetBGColour(!l%,l%!8,!_Q%)
Q$=$(l%!&C)
shell_3DEnabled:
IF%,_3d%:
_U%!&64
(1<<&A)
6,&A1,&8C
,,IF%:
_3d%=
_3d%=
_3d%=
:=_3d%
shell_MenuDelete(i%,AG%):
e%,p%,h%:
i%<>0
&65BC3,i%,AG%:p%=
shell_HeapBlockInfo(_U%!&C)-8:h%=_U%!&C:
(h%!(e%+8)=i%)
h%!(e%+8)=0
e%+=48
(e%>=p%)
shell_HandleAttachedDataSave(_Q%,b%,f%):
mA%,a%,iB%,_name$,c%,o%:
shell_DataSaveCheckName(b%,f%):mA%=
shell_GetEventListOffset(b%,-1,_U%+72,24,
mA%>=0
ia%=_U%!72+mA%:iB%=a%!16:_name$=
shell_IconGetData(b%,iB%):c%=a%!20:
$c%<>""
("FN"+$c%+"(_name$)")