Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
aplteam committed Mar 4, 2018
0 parents commit 1f6e792
Show file tree
Hide file tree
Showing 798 changed files with 18,732 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Auto detect text files and perform LF normalization
* text=auto

*.function linguist-language=apl
*.operator linguist-language=apl
*.class linguist-language=apl
*.script linguist-language=apl
*.charstring linguist-language=apl
*.charList linguist-language=apl
*.dws linguist-language=apl
*.dyapp linguist-language=apl
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.acre
Dest/
441 changes: 441 additions & 0 deletions APLSource/APLTreeUtils-8f.script

Large diffs are not rendered by default.

1,059 changes: 1,059 additions & 0 deletions APLSource/FilesAndDirs-121.class

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions APLSource/Fire-1/ADOC_Doc-2f.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ADOC_Doc
How to install Fire
There is a file "HowToInstall.html" with details.
2 changes: 2 additions & 0 deletions APLSource/Fire-1/About-1.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rAbout
rVersion
12 changes: 12 additions & 0 deletions APLSource/Fire-1/AddPidToCaption-149.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
AddPidToCaption{
⍵ is what is going to be the caption of a dialog box etc.
This functions adds the ID of the current process (PID) to the beginning if the
Windows Registry key for $DYALOG$\Captions\Messagebox is suppoed to show "{PID}".
If so we return that PID, otherwise we return an empty vector.
Used in Fire to show the PID in the same way.
rkGetDyalogRegKey
rk,'\Captions\MessageBox'
caption##.WinReg.GetString rk
0=+/'{PID}'caption:
(##.OS.GetPID),' ',
}
36 changes: 36 additions & 0 deletions APLSource/Fire-1/AssignRegistryValuesTo-104041.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
GAssignRegistryValuesTo G;p;wsid
Reads values from Windows Registry and assigns them to G.
[1] is "State"
[2] is "Active"
pGetFireRegistryKey
wsid1A.SplitPath ⎕WSID

Main GUI
G.LookForList''R.GetString p,wsid,'\LookForList'
:If (,'#')G.LookIn,''R.GetString p,wsid,'\LookIn'
:AndIf ~0G.LookIn
:AndIf 0⎕NC G.LookIn
G.LookIn''
:EndIf

G.Case0'0 1'R.GetString p,'Case'
G.APL_Name1'0'R.GetString p,'APL_Name' Not "Active"

G.Code0'1 1'R.GetString p,'Code'
G.Vars0'1 1'R.GetString p,'Vars'
G.NamesOnly1'1 0'R.GetString p,'NamesOnly'

G.APL_Code0'1 1'R.GetString p,'APL_Code'
G.Comments0'1 1'R.GetString p,'Comments'
G.Text0'1 1'R.GetString p,'Text'

G.SearchIsRegEx0('0 1'R.GetString p,'SearchIsRegEx'),0
G.DotAll0('0 0'R.GetString p,'DotAll'),0
G.Greedy0('0 0'R.GetString p,'Greedy'),0
G.UCP0('0 0'R.GetString p,'UCP'),0

Replace dialog
G.ReplaceBy''R.GetString p,'ReplaceBy'
G.DetailedReport0 R.GetValue p,'DetailedReport'
G.SimpleReport1 R.GetValue p,'SimpleReport'
Done
1 change: 1 addition & 0 deletions APLSource/Fire-1/Build-1.charstring
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 2 additions & 0 deletions APLSource/Fire-1/CR-3.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rCR
r⎕UCS 13
16 changes: 16 additions & 0 deletions APLSource/Fire-1/CleanRegistry-21.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
CleanRegistry;rk;t;this;lsd;today
Deletes workspace specific entries from the Registry older than one year.
rkGetFireRegistryKey Get Registry key
:If R.DoesKeyExist rk
t1 R.GetTree rk Get tree with all keys, but only one level
t((2+'\'+.=rk)=(t[;1])+.='\')t
t(t[;0]=2)t[;1]
today2 ⎕NQ'.' 'DateToIdn'(3⎕TS)
:For this :In t
lsd¨(1+4 2 2/3)'00000000'R.GetString this,'LastSaveDate'
lsd2 ⎕NQ'.' 'DateToIdn'lsd
:If 365<today-lsd
R.DeleteSubKeyTree this
:EndIf
:EndFor
:EndIf
10 changes: 10 additions & 0 deletions APLSource/Fire-1/Cleanup-1.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{r}Cleanup;_
Tidy up
r''
:Trap 0 _GUI.n.Form.Close :EndTrap
:Trap 6 SetCursorObj G.saveCursorObj :EndTrap
:Trap 0 ⎕NQ GUI.n.Form'Close' :EndTrap
⎕EX¨'AWRG'
⎕EX¨'GUI.n' 'GUI.TheIcon'
(¨⎕NL-9).(⎕EX¨⎕WN'')
Done
11 changes: 11 additions & 0 deletions APLSource/Fire-1/CompileFireFunctions-881.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{r}CompileFireFunctions dummy;GetFnsOpr;list;containers
r
:If 14.1{(//)⎕VFI 2>+\'.'=}(1+⎕IO)'#'⎕WG'APLVersion'
GetFnsOpr{(' ',⎕THIS),¨' '~¨.⎕NL 3 4}
listGetFnsOpr ⎕THIS
containers' '~¨⎕NL 9.1
containers((⎕THIS){¨()¨}¨¨containers)/containers
containers{/~'['¨¨¨}containers
list,,/{0l().⎕NL 3 4:'' (,'.'),¨l}¨containers
{}compile list
:EndIf
5 changes: 5 additions & 0 deletions APLSource/Fire-1/CompileHits-81.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CompileHits{
Returns a vector of hits, each with a line number in the first item
and the index of any hits in the second item.
{0<¨[;1]}(),[0.5]
}
7 changes: 7 additions & 0 deletions APLSource/Fire-1/CompileNamespaceList-10081.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CompileNamespaceList{
Returns containers.
Compiles always a complete tree and then throws away unwanted stuff. Fast anyway.
ref0
flag1
List ref flag Get full list.
}
7 changes: 7 additions & 0 deletions APLSource/Fire-1/ConvertToPixel-281.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
rConvertToPixel ref;save
Treats size of "ref" as "Prop" and converts in into "Pixel'
"ref" must be a ref to any GUI control
saveref.Coord
ref.Coord'Pixel'
rref.Size
ref.Coordsave
6 changes: 6 additions & 0 deletions APLSource/Fire-1/CopySearchFor2ReplaceBy-204411.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{r}CopySearchFor2ReplaceBy n;∆SendMessage;EM_REPLACESEL
r0
{}'∆SendMessage'⎕NA'U USER32|SendMessage* P U P <0T[]'
EM_REPLACESEL194 x00c3
{}∆SendMessage n.ReplaceBy.Handle EM_REPLACESEL 0 n.SearchFor.Text
Done
17 changes: 17 additions & 0 deletions APLSource/Fire-1/CreateGuiRefContainer-1241.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
rCreateGuiRefContainer;fns
Creates an empty namespace and populates it with a method useful to list refs.
The purpose of that namespace is to hold refs pointing to GUI controls
r(0⎕RSI).⎕NS''
fns'r←{noOfCols}∆List sortByCol;n;refs'
fns,'⍝ Returns a matrix with all refs and there type and there caption and style (if any)'
fns,'⍝ sortByCol can be 0 (default anyway) or 1 which makes List sort'
fns,'⍝ the matrix by Type rather than name.'
fns,'⍝ You can restrict the number of columns by specifying a left argument (default=4)'
fns,'noOfCols←{0<⎕NC ⍵:⍎⍵ ⋄ 4}''noOfCols'''
fns,'refs←⍎¨n←⎕NL-9' The refs and the names
fns,'r←n,[0.5]refs.Type' The "Type"
fns,'r,←{0::'''' ⋄ ⍵.Style}¨refs' The "Style", if any
fns,'r,←{0::'''' ⋄ ⍵.Caption}¨refs' The "Caption", if any
fns,'r,←↓{{⍵↓[1]⍨+/∧\∧⌿⍵=[1]⍵[0;]}⊃⍵}⍕¨refs' Add real names
fns,'r←r[⍋⊃r[;sortByCol];⍳noOfCols]' Sort and take requested number of cols
r.⎕FX fns
6 changes: 6 additions & 0 deletions APLSource/Fire-1/CreateRefs-41.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CreateRefs
Create refs if possible at all.
Tries to find needs stuff in ## first, then in ⎕SE, then it gives up.
AGetRefTo'APLTreeUtils'
FGetRefTo'FilesAndDirs'
RGetRefTo'WinReg'
3 changes: 3 additions & 0 deletions APLSource/Fire-1/DQ-3.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DQ y
2 ⎕NQ GUI.n.SearchFor'GotFocus' ⎕DQ y
Done
6 changes: 6 additions & 0 deletions APLSource/Fire-1/DisableProgressbar-81.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
DisableProgressbar{
GUI.n.PB.Visible0
GUI.n.PB_Text.Visible0
GUI.n.Info.Visible1
1:r
}
5 changes: 5 additions & 0 deletions APLSource/Fire-1/DropComments-11.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
DropComments{
Drop comments from ⍵ which is supposed to be a sinmple vector of APL code.
(~''):
''
}
3 changes: 3 additions & 0 deletions APLSource/Fire-1/DropDoublesFromHitList-48811.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DropDoublesFromHitList{
({()=}GlueNames )
}
4 changes: 4 additions & 0 deletions APLSource/Fire-1/DropRefsFrom-111.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DropRefsFrom{
(0):
(~IsUnnameNamespace¨0¨[;0])
}
10 changes: 10 additions & 0 deletions APLSource/Fire-1/EnableProgressbar-41.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
EnableProgressbar{
Makes the Progressbar visible. ⍵ is number of items to be processed.
GUI.n.PB.Thumb1
GUI.n.PB.Limits0,
GUI.n.PB.Visible~GUI.n.Info.Visible0
GUI.n.PB_Text.Text
GUI.n.PB_Text.Visible1
GUI.n.PB_Text.Points[1]0.5×GUI.n.PB.Size[1]-1GUI.n.Form.GetTextSize GUI.n.PB_Text.Text
1:r
}
4 changes: 4 additions & 0 deletions APLSource/Fire-1/EnvVars-9.script
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
:Namespace EnvVars
##.⎕IO0
##.⎕ML3
:EndNamespace
6 changes: 6 additions & 0 deletions APLSource/Fire-1/EstablishNamedIbeams-4201.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{r}EstablishNamedIbeams dummy
name some useful I-beams
r
iscompiled1(400)
compile2(400)
uncompile3(400)
26 changes: 26 additions & 0 deletions APLSource/Fire-1/FindFireReadMe-1111.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
pFindFireReadMe dummy;rk;v;thisPath;if;regData
Returns the path to the Fire ReadMe.html file or an empty vector.
Don't use refs pointing to APLTreeUtils, WinReg and FilesAndDirs here: this stops a certain test case!
p''
:If ##.FilesAndDirs.Exists'Fire/ReadMe.html'
p'Fire/ReadMe.html'
:Else
rkGetRegKeyForSALT,'CommandFolder'
regData##.WinReg.GetString rk
((regData'∘°')/regData)';'
v';'##.APLTreeUtils.Split regData
:For thisPath :In v
:If ##.FilesAndDirs.Exists thisPath,'Fire/ReadMe.html'
pthisPath,'Fire/ReadMe.html'
:Leave
:EndIf
:EndFor
:If 0p
if2 ⎕NQ'.' 'GetEnvironment' 'dyalog' Get the install folder
:If ~##.FilesAndDirs.Exists pif,'/Fire/ReadMe.html'
rkGetFireRegistryKey,'HelpFileFolder'
p##.WinReg.GetString rk
:EndIf
:EndIf
pF.NormalizePath p
:EndIf
11 changes: 11 additions & 0 deletions APLSource/Fire-1/FindScript-11.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
refFindScript name
Tries to find `name` and returns a ref pointing to it or ⍬
if it cannot find the script in question.
ref
:If 9=##.⎕NC name
ref##.name
:ElseIf (1⎕RSI).⎕NC name
ref(1⎕RSI).name
:Else #.⎕NC name
ref#.name
:EndIf
1 change: 1 addition & 0 deletions APLSource/Fire-1/FirstCharOfName-a21.charstring
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_∆⍙#
60 changes: 60 additions & 0 deletions APLSource/Fire-1/FormatDateTime-441.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
r{length}FormatDateTime ts;ts2;formatstring;bool;⎕IO;⎕ML;buffer
Formats the right argument (defaults to `⎕TS` if empty) as a string with:\\
'YYYY-MM-DD HH:MM:SS.MILLISECOND\\
The right argument can be one of:
* A single float (like 20120102030405) representing date and time.
* A simple vector of length 6 or 7 representing a timestamp (`⎕TS`).
* A matrix of either floats or vectors (length 6 or 7) representing a DateTime.
Note that you cannot mix floats and time stamps.\\
If the right argument has not 7 but 6 or 3 elements, formatting is done accordingly.\\
Via the left argument the length of the right argument can be set to
⍬, 3, 6 or 7; default is 6; ⍬ Accepts any length of the right argument which is 3, 6 or 7.\\
If the right argument is a...
* simple vector, a string is returned.
* matrix, a matrix is returned.
⎕IO⎕ML1
:If 645⎕DR ts
:If (⍴⍴ts)0 1
:If 1=,ts
ts{0,: ⎕ML3 ¨(4 2 2 2 2 2/6)14 0}ts
:EndIf
:Else
ts,{0=:60 v14 0 ⎕ML3 ¨(4 2 2 2 2 2/6)v}¨ts
:EndIf
:EndIf
:If length{2=⎕NC : 6}'length'
length''¯1ts
:EndIf
:If ~0ts
:If 2=⍴⍴ts
buffer{/0<¨~¨' ' 0}ts
'Invalid right argument: must be integer'⎕SIGNAL 11/~326 163⎕DR¨buffer
'Invalid right argument: must not be negative'⎕SIGNAL 11//¯1¨×¨buffer
'Invalid right argument: must be simple'⎕SIGNAL 11/1¨buffer
:Else
'Invalid right argument: must be integer'⎕SIGNAL 11/~326 163⎕DR ts
'Invalid right argument: must not be negative'⎕SIGNAL 11/¯1×,ts
'Invalid right argument: must be simple'⎕SIGNAL 11/1ts
:EndIf
:EndIf
:If 2=⍴⍴ts
ts2length[2]ts
:Else
ts2,[0.5]length{0:⎕TS ts}ts
:EndIf
:Select length
:Case 3
formatstring'ZI4,<->,ZI2,<->,ZI2'
:CaseList 6 7
formatstring'ZI4,<->,ZI2,<->,ZI2,< >,ZI2,<:>,ZI2,<:>,ZI2'
:Else
'Invalid left argument'⎕SIGNAL 11
:EndSelect
bool(ts2.' ')ts2.0
rboolformatstring ⎕FMT(6length)[2]boolts2
:If 7=2ts2
r(r),¨{0=:'' 0~' ':'' '.',}¨ts2[;7]
:EndIf
:If 2⍴⍴ts
r,r
:EndIf
9 changes: 9 additions & 0 deletions APLSource/Fire-1/GUI-7/About-1.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
About{
Show the "About" information
msg'Fire version ',{,' - ',}/1##.Version
msg,''
msg,'Written by Kai Jaeger ⋄ APL Software Ltd'
msg,''
msg,'http://aplwiki.com/Fire'
##.Question.ShowMsg msg
}
15 changes: 15 additions & 0 deletions APLSource/Fire-1/GUI-7/CenterIn-41.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CenterIn{
ref Ref to the parent or to all monitors
sz Size of the form to be centered.
(pp ps)ref.(Posn Size) Posn & Size of "parent" window.
mhGetSystemMetrics 15 Menu height in pixels; 15=SM_CYMENU.
miMonitorInfo Monitor info.
nppp-mh,0 New Posn inside main app: start with "parent" pos.
np+0(ps-sz)÷2 Center it.
buf30 10 Buffer; Used to force the Dlg away from the brim.
max(+2 2mi)-sz+buf Calc max value.
minmi[0 1]+buf Calc min value.
npmin(np+buf)max Calc result.
np
Returns a vector useful to center dialog ⍺ within ⍵ (size).
}
26 changes: 26 additions & 0 deletions APLSource/Fire-1/GUI-7/CenterOnMonitor-141.function
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
CenterOnMonitor{
⍺: the handle of parent form!
0::0 On any error get out!
.Type'Form':z0 Don't fool with SubForms, Groups, etc.
{0=⎕NC'#.CAS.rF':0 #.CAS.rF.Handle}''

.NET Reference
⎕USING'' 'System' 'System.Windows.Forms.Screen,System.Windows.Forms.dll'

Make pointer object.
6::z0 break out on value error.
ptr⎕NEW IntPtr

Do positioning.
scrSystem.Windows.Forms.Screen.FromHandle ptr
xLscr.WorkingArea.X
xR+/scr.WorkingArea.(X Width)
yTscr.WorkingArea.Y
yB+/scr.WorkingArea.(Y Height)
byB xR bottom-right
tyT xL top-left

.Posnt+00.5×(b-t)-.Size Center

1:z1
}
Loading

0 comments on commit 1f6e792

Please sign in to comment.