ð÷^Syntax10.Scn.Fnt†¨ÿÿÿ€8ÀÔFoldElemsNew#Syntax10.Scn.Fnt66 pattern: ARRAY 256 OF CHAR; noCase: BOOLEAN END;ÿÿÿÿ€8ÀÔ Øÿÿÿ€8ÀÔ#Syntax10.Scn.Fnt END;ÿÿÿÿ€8ÀÔÇÿÿÿ€8ÀÔ#Syntax10.Scn.Fnt index: BOOLEAN END;ÿÿÿÿ€8ÀÔØÿÿÿ€8ÀÔ#Syntax10.Scn.Fnt END;ÿÿÿÿ€8ÀÔ Øÿÿÿ€8ÀÔ#Syntax10.Scn.Fnt END;ÿÿÿÿ€8ÀÔ#Øÿÿÿ€8ÀÔ#Syntax10.Scn.Fnt END;ÿÿÿÿ€8ÀÔ‚ÿÿÿ€8ÀÔ#Syntax10.Scn.Fnt\\ ElemDesc = RECORD (FoldElems.ElemDesc) name: ARRAY 230 OF CHAR; text: Texts.Text END;ÿÿÿÿ€8ÀÔ#[ÿÿÿ€8ÀÔ#Syntax10.Scn.Fntƒƒ TaskDesc = RECORD (Oberon.TaskDesc) text : Web.Text; name: ARRAY 230 OF CHAR; frame: TextFrames.Frame; pos: LONGINT END;ÿÿÿÿ€8ÀÔ7%öÿÿ€8ÀÔ Syntax10.Scn.Fnt•§ÿÿÿ€8ÀÔFoldElemsNew#Syntax10.Scn.Fnt77 BEGIN FoldElems.ExpandAll(t, 0, TRUE) END PrepareText;ÿÿÿÿ€8ÀÔ>?þÿÿ€8ÀÔ#Syntax10.Scn.FntŸŸ VAR fe: Elem; BEGIN fe := e(Elem); IF (m IS FoldElems.PrepSwitchMsg) & (fe.mode = FoldElems.colLeft) THEN Expand(fe); IF fe.hidden.len = 1 THEN NEW(fe.hidden); Texts.OpenBuf(fe.hidden); Texts.Write(w, 9X); Texts.WriteString(w, "search pattern is within a text element"); Texts.WriteLn(w); Texts.Copy(w.buf, fe.hidden); Texts.OpenWriter(w) END END; FoldElems.FoldHandler(e, m) END FoldHandler;ÿÿÿÿ€8ÀÔ0;ÿÿÿ€8ÀÔ#Syntax10.Scn.Fnt££ VAR e: Elem; BEGIN NEW(e); e.mode := mode; e.W := FoldElems.elemW; e.H := FoldElems.elemH; e.handle := FoldHandler; e.visible := TRUE; RETURN e END GetFoldElem;ÿÿÿÿ€8ÀÔ?¯þÿÿ€8ÀÔ#Syntax10.Scn.Fnt// VAR i, j: INTEGER; BEGIN i := Strings.Length(fullName)-1; j := 0; WHILE (i>=0) & (fullName[i] # "/") DO DEC(i) END; IF i < 0 THEN COPY(fullName, fileName) ELSE INC(i); WHILE fullName[i] # 0X DO fileName[j] := fullName[i]; INC(j); INC(i) END; fileName[j] := 0X END END GetFileName;ÿÿÿÿ€8ÀÔJþÿÿ€8ÀÔ#Syntax10.Scn.FntNN VAR e: Elem; i, j: INTEGER; BEGIN e := GetFoldElem(FoldElems.colLeft); e.text := t; IF fileName # "" THEN GetFileName(fileName, e.name); Texts.WriteString(w, e.name); Texts.Write(w, ' ') END; Texts.WriteElem(w, e); Texts.WriteElem(w, GetFoldElem(FoldElems.colRight)); Texts.WriteLn(w); Texts.Append(hits, w.buf) END AddHit;ÿÿÿÿ€8ÀÔ9·þÿÿ€8ÀÔ#Syntax10.Scn.Fnt'' VAR x, y: INTEGER; f, m: TextFrames.Frame; v: MenuViewers.Viewer; BEGIN f := TextFrames.NewText(text, 0); Oberon.AllocateUserViewer(Oberon.Mouse.X, x, y); m := TextFrames.NewMenu("Search results", "^Edit.Menu.Text"); v := MenuViewers.New(m, f, TextFrames.menuH, x, y); RETURN f END OpenTF;ÿÿÿÿ€8ÀÔÒ PROCEDURE^ DetailSearch (t: Texts.Text; fileName: ARRAY OF CHAR; pos: LONGINT); PROCEDURE^ Expand (e: Elem); PROCEDURE PrepareText (t: Texts.Text); PROCEDURE FoldHandler (e: Texts.Elem; VAR m: Texts.ElemMsg); PROCEDURE GetFoldElem (mode: SHORTINT) : Elem; PROCEDURE GetFileName(VAR fullName, fileName: ARRAY OF CHAR); PROCEDURE AddHit (t: Texts.Text; fileName: ARRAY OF CHAR; pos: LONGINT); PROCEDURE OpenTF (text: Texts.Text) : TextFrames.Frame;  ÿÿÿÿ€8ÀÔÛÿÿ€8ÀÔëSyntax10.Scn.FntIªþÿÿ€8ÀÔFoldElemsNew#Syntax10.Scn.Fnt44 VAR i, j, k: INTEGER; BEGIN i := 0; WHILE line[i] # 0X DO k := i; j := 0; WHILE (d.pattern[j] # 0X) & ((d.noCase & (d.pattern[j] = CAP(line[k]))) OR ((~d.noCase) & (d.pattern[j] = line[k]))) DO INC(j); INC(k) END; IF d.pattern[j] = 0X THEN RETURN i END; INC(i) END; RETURN -1 END MatchLine;ÿÿÿÿ€8ÀÔPFúÿÿ€8ÀÔ#Syntax10.Scn.Fnt˜˜ CONST bufSize = 31744; (*2**15 - 1024*) VAR r: Files.Rider; n, pos: LONGINT; i, j, i0, m: INTEGER; ch, patj: CHAR; tab: ARRAY 265 OF SHORTINT; text: ARRAY bufSize OF CHAR; BEGIN (*----- open file *) pos := 0; m := Strings.Length(d.pattern); (*----- initialize tab *) FOR i := 0 TO 255 DO tab[i] := SHORT(m) END; FOR i := 0 TO m-2 DO tab[ORD(d.pattern[i])] := SHORT(m - i - 1) END; patj := d.pattern[m-1]; LOOP (*----- read text[0..n-1] *) n := Files.Length(f) - pos; IF n > bufSize THEN n := bufSize END; IF n < m THEN EXIT END; Files.Set(r, f, pos); Files.ReadBytes(r, text, n); (*----- search pat in text[0..n-1] *) i := m - 1; j := i; WHILE i < n DO ch := text[i]; IF d.noCase & ("a" <= ch) & (ch <= "z") THEN ch := CAP(ch) END; IF ch = patj THEN i0 := i; REPEAT DEC(i); DEC(j); ch := text[i]; IF d.noCase & ("a" <= ch) & (ch <= "z") THEN ch := CAP(ch) END UNTIL (j < 0) OR (ch # d.pattern[j]); IF j < 0 THEN (*------ found: print result *) addHit(NIL, name, pos+i); RETURN ELSE ch := text[i]; IF d.noCase & ("a" <= ch) & (ch <= "z") THEN ch := CAP(ch) END; i := i + tab[ORD(ch)] END; IF i <= i0 THEN i := i0 + 1 END; j := m - 1 ELSE ch := text[i]; IF d.noCase & ("a" <= ch) & (ch <= "z") THEN ch := CAP(ch) END; i := i + tab[ORD(ch)] END END; pos := pos + i - m + 1 END; END SearchFile;ÿÿÿÿ€8ÀÔ`pùÿÿ€8ÀÔ#Syntax10.Scn.Fntnn CONST bufSize = 31744; (*2**15 - 1024*) VAR m: INTEGER; r: Texts.Reader; n, pos: LONGINT; i, j, i0: INTEGER; ch, patj: CHAR; tab: ARRAY 265 OF SHORTINT; text: ARRAY bufSize OF CHAR; BEGIN m := Strings.Length(d.pattern); (*----- open file *) pos := 0; (*----- initialize tab *) FOR i := 0 TO 255 DO tab[i] := SHORT(m) END; FOR i := 0 TO m-2 DO tab[ORD(d.pattern[i])] := SHORT(m - i - 1) END; patj := d.pattern[m-1]; LOOP (*----- read text[0..n-1] *) n := t.len - pos; IF n > bufSize THEN n := bufSize END; IF n < m THEN EXIT END; Texts.OpenReader(r, t, pos); i := 0; WHILE i < n DO Texts.Read(r, text[i]); INC(i) END; (*----- search pat in text[0..n-1] *) i := m - 1; j := i; WHILE i < n DO ch := text[i]; IF d.noCase & ("a" <= ch) & (ch <= "z") THEN ch := CAP(ch) END; IF ch = patj THEN i0 := i; REPEAT DEC(i); DEC(j); ch := text[i]; IF d.noCase & ("a" <= ch) & (ch <= "z") THEN ch := CAP(ch) END UNTIL (j < 0) OR (ch # d.pattern[j]); IF j < 0 THEN (*------ found: print result *) WHILE (i >= 0) & (text[i] # CR) & (text[i] >= 09X) DO DEC(i) END; INC(i); addHit(t, name, pos+i); IF onlyFirst THEN RETURN ELSE Texts.OpenReader(r, t, pos + i) END ELSE ch := text[i]; IF d.noCase & ("a" <= ch) & (ch <= "z") THEN ch := CAP(ch) END; i := i + tab[ORD(ch)] END; IF i <= i0 THEN i := i0 + 1 END; j := m - 1 ELSE ch := text[i]; IF d.noCase & ("a" <= ch) & (ch <= "z") THEN ch := CAP(ch) END; i := i + tab[ORD(ch)] END END; pos := pos + i - m + 1 END END SearchText; ÿÿÿÿ€8ÀÔ[`ÿÿÿ€8ÀÔ#Syntax10.Scn.Fnt~~ BEGIN COPY(pattern, d.pattern); d.noCase := ~caseSensitive; IF d.noCase THEN Strings.Cap(d.pattern) END END PrepareSearch;ÿÿÿÿ€8ÀÔ^×ýÿÿ€8ÀÔ#Syntax10.Scn.Fnt VAR t: Texts.Text; s: Texts.Scanner; fileName: ARRAY 1024 OF CHAR; pos: LONGINT; found: BOOLEAN; BEGIN d.PrepareSearch^(pattern, caseSensitive); IF d.index THEN t := TextFrames.Text("ModIdx.hlp"); Texts.OpenScanner(s, t, 0); Texts.Scan(s); WHILE ~s.eot DO COPY(s.s, fileName); Texts.Scan(s); found := FALSE; WHILE s.s # "" DO pos := d.MatchLine(s.s); IF (pos >= 0) & ~found THEN AddHit(NIL, fileName, 0); found := TRUE END; Texts.Scan(s) END; Texts.Scan(s) END END END PrepareSearch;ÿÿÿÿ€8ÀÔbGþÿÿ€8ÀÔ#Syntax10.Scn.Fnt—— VAR t: Texts.Text; s: Texts.Scanner; pos: LONGINT; BEGIN d.PrepareSearch^(pattern, caseSensitive); t := TextFrames.Text("BalloonIdx.hlp"); Texts.OpenScanner(s, t, 0); Texts.Scan(s); Texts.Scan(s); WHILE ~s.eot DO pos := d.MatchLine(s.s); IF pos >= 0 THEN AddHit(NIL, "Balloon help text", 0); RETURN END; Texts.Scan(s); IF s.s="" THEN Texts.Scan(s); Texts.Scan(s) END END END PrepareSearch;ÿÿÿÿ€8ÀÔPÌÿÿÿ€8ÀÔ#Syntax10.Scn.Fnt BEGIN END Search;ÿÿÿÿ€8ÀÔT=ÿÿÿ€8ÀÔ#Syntax10.Scn.Fnt¡¡ BEGIN IF Strings.Match(name, "*.Text") OR Strings.Match(name, "*.Tool") THEN IF f=NIL THEN f := Files.Old(name) END; d.SearchFile(name, f) END END Search;ÿÿÿÿ€8ÀÔS_ÿÿÿ€8ÀÔ#Syntax10.Scn.Fnt BEGIN IF Strings.Match(name, "*.Mod") THEN IF f=NIL THEN f := Files.Old(name) END; d.SearchFile(name, f) END END Search;ÿÿÿÿ€8ÀÔS ÿÿÿ€8ÀÔ#Syntax10.Scn.FntÔÔ VAR tt: Texts.Text; n: ARRAY 256 OF CHAR; BEGIN IF Strings.Match(name, "*.Sym") THEN GetFileName(name, n); tt := TextFrames.Text(""); Browser.WriteDef(tt, n); d.SearchText(name, tt, TRUE) END END Search;ÿÿÿÿ€8ÀÔT^ÿÿÿ€8ÀÔ#Syntax10.Scn.Fnt€€ BEGIN IF Strings.Match(name, "*.html") THEN IF f=NIL THEN f := Files.Old(name) END; d.SearchFile(name, f) END END Search;ÿÿÿÿ€8ÀÔCÿÿÿÿ€8ÀÔ’ÿÿÿÿ€8ÀÔÀÿÿÿÿ€8ÀÔÿÿÿÿ€8ÀÔ Syntax10b.Scn.Fntÿÿÿÿ€8ÀÔpÿÿÿÿ€8ÀÔþ PROCEDURE (VAR d: Domain) MatchLine (VAR line: ARRAY OF CHAR) : INTEGER; PROCEDURE (VAR d: Domain) SearchFile (VAR name: ARRAY OF CHAR; f: Files.File); PROCEDURE (VAR d: Domain) SearchText (name: ARRAY OF CHAR; t: Texts.Text; onlyFirst: BOOLEAN); PROCEDURE (VAR d: Domain) PrepareSearch (pattern: ARRAY OF CHAR; caseSensitive: BOOLEAN); PROCEDURE (VAR d: ModDomain) PrepareSearch (pattern: ARRAY OF CHAR; caseSensitive: BOOLEAN); PROCEDURE (VAR d: BalloonDomain) PrepareSearch (pattern: ARRAY OF CHAR; caseSensitive: BOOLEAN); PROCEDURE (VAR d: Domain) Search (VAR name: ARRAY OF CHAR; VAR f: Files.File); PROCEDURE (VAR d: TextDomain) Search (VAR name: ARRAY OF CHAR; VAR f: Files.File); PROCEDURE (VAR d: ModDomain) Search (VAR name: ARRAY OF CHAR; VAR f: Files.File); PROCEDURE (VAR d: DefDomain) Search (VAR name: ARRAY OF CHAR; VAR f: Files.File); PROCEDURE (VAR d: HTMLDomain) Search (VAR name: ARRAY OF CHAR; VAR f: Files.File); PROCEDURE GetArgs (VAR pattern: ARRAY OF CHAR; VAR options: SET); VAR s: Texts.Scanner; ch: CHAR; opt: ARRAY 32 OF CHAR; text: Texts.Text; beg, end,time: LONGINT; PROCEDURE ScanOptions(VAR opt: ARRAY OF CHAR); VAR i: INTEGER; BEGIN i := 0; WHILE opt[i]#0X DO IF opt[i]='h' THEN EXCL(options, doHTML) END; IF opt[i]='t' THEN EXCL(options, doText) END; IF opt[i]='m' THEN EXCL(options, doMod) END; IF opt[i]='d' THEN INCL(options, doDef) END; IF opt[i]='b' THEN EXCL(options, doBalloon) END; IF opt[i]='c' THEN EXCL(options, optCaseSensitive) END; IF opt[i]='f' THEN EXCL(options, optModIdx) END; INC(i) END END ScanOptions; BEGIN options := defaultOpt; pattern[0] := 0X; Texts.OpenScanner(s, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(s); IF (s.class=Texts.Char) & (s.c='\') THEN Texts.Scan(s); IF s.class#Texts.Name THEN RETURN END; ScanOptions(s.s); Texts.Scan(s) END; IF (s.class = Texts.Char) & (s.c = "^") THEN Oberon.GetSelection(text, beg, end, time); IF time >= 0 THEN Texts.OpenScanner(s, text, beg); Texts.Scan(s) END END; IF (s.class#Texts.Name) & (s.class#Texts.String) THEN RETURN END; COPY(s.s, pattern) END GetArgs; PROCEDURE Search*; VAR pattern: ARRAY 256 OF CHAR; t: Texts.Text; s: Texts.Scanner; frame: TextFrames.Frame; f: Files.File; options: SET; caseSensitive: BOOLEAN; BEGIN GetArgs(pattern, options); IF pattern="" THEN RETURN END; md.index := (optModIdx IN options); caseSensitive := (optCaseSensitive IN options); hits := TextFrames.Text(""); frame := OpenTF(hits); addHit := AddHit; IF doText IN options THEN td.PrepareSearch(pattern, caseSensitive) END; IF doMod IN options THEN md.PrepareSearch(pattern, caseSensitive) END; IF doDef IN options THEN dd.PrepareSearch(pattern, caseSensitive) END; IF doHTML IN options THEN hd.PrepareSearch(pattern, caseSensitive) END; IF doBalloon IN options THEN bd.PrepareSearch(pattern, caseSensitive) END; t := TextFrames.Text("FilesAll.hlp"); Texts.OpenScanner(s, t, 0); Texts.Scan(s); WHILE ~s.eot DO f := NIL; IF doText IN options THEN td.Search(s.s, f) END; IF (doMod IN options) & ~md.index THEN md.Search(s.s, f) END; IF doDef IN options THEN dd.Search(s.s, f) END; IF doHTML IN options THEN hd.Search(s.s, f) END; Texts.Scan(s) END; hits := NIL; addHit := DetailSearch END Search;  ÿÿÿÿ€8ÀÔ&ïÿÿ€8ÀÔ¸Syntax10.Scn.FntW4ýÿÿ€8ÀÔFoldElemsNew#Syntax10.Scn.Fntªª VAR r: Texts.Reader; ch: CHAR; line: ARRAY 256 OF CHAR; i: INTEGER; out: Texts.Text; BEGIN Texts.Write(w, '"'); Texts.WriteString(w, name); Texts.Write(w, '"'); Texts.WriteLn(w); Texts.OpenReader(r, t, 0); Texts.Read(r, ch); WHILE ~r.eot DO IF ch = '"' THEN i := 0; Texts.Read(r, ch); WHILE ch # '"' DO line[i] := ch; INC(i); Texts.Read(r, ch) END; line[i] := 0X; Texts.Write(w, '"'); Texts.WriteString(w, line); Texts.Write(w, '"'); Texts.WriteLn(w) END; Texts.Read(r, ch) END; Texts.WriteString(w, '""'); Texts.WriteLn(w); out := TextFrames.Text("BalloonIdx.hlp"); Texts.Append(out, w.buf); Texts.Close(out, "BalloonIdx.hlp") END ScanBalloon;ÿÿÿÿ€8ÀÔBËÿÿÿ€8ÀÔ#Syntax10.Scn.Fnt BEGIN END MakeIdx;ÿÿÿÿ€8ÀÔEÛûÿÿ€8ÀÔ#Syntax10.Scn.Fnt VAR s: Texts.Scanner; t, out: Texts.Text; BEGIN IF Strings.Match(fileName, "*.Mod") THEN Texts.Write(w, '"'); Texts.WriteString(w, fileName); Texts.Write(w, '"'); Texts.WriteLn(w); t := TextFrames.Text(fileName); PrepareText(t); Texts.OpenScanner(s, t, 0); Texts.Scan(s); WHILE ~s.eot DO IF (s.class = Texts.Name) & (s.s = "PROCEDURE") THEN Texts.Scan(s); WHILE (s.class=Texts.Char) & (s.c=Texts.ElemChar) DO Texts.Scan(s) END; IF (s.class=Texts.Char) & (s.c='(') THEN (* type bound proc *) REPEAT Texts.Scan(s) UNTIL s.eot OR ((s.class=Texts.Char) & (s.c=')')); Texts.Scan(s); WHILE (s.class=Texts.Char) & (s.c=Texts.ElemChar) DO Texts.Scan(s) END; END; IF s.class=Texts.Name THEN Texts.Write(w, '"'); Texts.WriteString(w, s.s); Texts.Write(w, '"'); Texts.WriteLn(w) END END; Texts.Scan(s) END; Texts.WriteString(w, '""'); Texts.WriteLn(w); out := TextFrames.Text("ModIdx.hlp"); Texts.Append(out, w.buf); Texts.Close(out, "ModIdx.hlp") END END MakeIdx;ÿÿÿÿ€8ÀÔIöýÿÿ€8ÀÔ#Syntax10.Scn.Fntèè VAR r: Texts.Reader; t: Texts.Text; BEGIN IF Strings.Match(fileName, "*.Mod") OR Strings.Match(fileName, "*.Text") THEN t := TextFrames.Text(fileName); PrepareText(t); Texts.OpenReader(r, t, 0); Texts.ReadElem(r); WHILE ~r.eot DO IF r.elem IS BalloonElems.Elem THEN d.ScanBalloon(fileName, r.elem(BalloonElems.Elem).menu) END; Texts.ReadElem(r) END END; IF Strings.Match(fileName, "*Balloon.Text") THEN d.ScanBalloon(fileName, TextFrames.Text(fileName)) END END MakeIdx;ÿÿÿÿ€8ÀÔlgþÿÿ€8ÀÔ#Syntax10.Scn.Fntww VAR path: ARRAY 256 OF CHAR; BEGIN IF ~isDir THEN COPY (d.path, path); IF Strings.Pos(startup.path, path, 0) = 0 THEN Strings.Delete(path, 0, Strings.Length(startup.path)-1); path[0] := '$' END; Texts.Write(w, '"'); Texts.WriteString(w, path); Texts.Write(w, '/'); Texts.WriteString(w, name); Texts.Write(w, '"'); Texts.WriteLn(w) END END ShowFile;ÿÿÿÿ€8ÀÔB‘ÿÿÿ€8ÀÔ#Syntax10.Scn.FntMM BEGIN Directories.Enumerate(Directories.This(path), ShowFile) END ScanDirs;ÿÿÿÿ€8ÀÔ'ˆÿÿÿ€8ÀÔ#Syntax10.Scn.FntVV BEGIN Directories.EnumeratePaths(ScanDirs); Texts.Append(t, w.buf) END GetFileList;ÿÿÿÿ€8ÀÔ Syntax10b.Scn.Fnt‰þÿÿ€8ÀÔ#Syntax10.Scn.FntUU VAR t: Texts.Text; s: Texts.Scanner; res: INTEGER; BEGIN Files.Delete("ModIdx.hlp", res); Files.Delete("BalloonIdx.hlp", res); t := TextFrames.Text(""); GetFileList(t); Texts.OpenScanner(s, t, 0); Texts.Scan(s); WHILE ~s.eot DO md.MakeIdx(s.s); bd.MakeIdx(s.s); Texts.Scan(s) END; Texts.Close(t, "FilesAll.hlp") END BuildIdx;ÿÿÿÿ€8ÀÔ# PROCEDURE (VAR d: BalloonDomain) ScanBalloon (VAR name: ARRAY OF CHAR; t: Texts.Text); PROCEDURE (VAR d: Domain) MakeIdx (VAR fileName: ARRAY OF CHAR); PROCEDURE (VAR d: ModDomain) MakeIdx (VAR fileName: ARRAY OF CHAR); PROCEDURE (VAR d: BalloonDomain) MakeIdx (VAR fileName: ARRAY OF CHAR); PROCEDURE ShowFile (d: Directories.Directory; name: ARRAY OF CHAR; isDir: BOOLEAN; VAR continue: BOOLEAN); PROCEDURE ScanDirs (path: ARRAY OF CHAR; VAR continue: BOOLEAN); PROCEDURE GetFileList(t: Texts.Text); PROCEDURE BuildIdx*; ÿÿÿÿ€8ÀÔ'åÿÿ€8ÀÔ%Syntax10.Scn.FntD ÿÿÿ€8ÀÔFoldElemsNew#Syntax10.Scn.FntÑÑ VAR s: Texts.Scanner; BEGIN Texts.OpenScanner(s, t, 0); Texts.Scan(s); WHILE ~s.eot DO IF (s.class = Texts.String) & (s.s = key) THEN RETURN Texts.Pos(s) END; Texts.Scan(s) END; RETURN -1 END FindKey;ÿÿÿÿ€8ÀÔ7 ýÿÿ€8ÀÔ#Syntax10.Scn.FntÕÕ VAR r: Texts.Reader; t: Texts.Text; pos: LONGINT; ch: CHAR; buf: Texts.Buffer; tf: TextFrames.Frame; BEGIN t := TextFrames.Text(name); IF name # "Balloon.Text" THEN Texts.OpenReader(r, t, 0); Texts.ReadElem(r); pos := -1; WHILE ~r.eot & (pos<0) DO IF r.elem IS BalloonElems.Elem THEN t := r.elem(BalloonElems.Elem).menu; pos := FindKey(t, key) END; Texts.ReadElem(r) END; ELSE pos := FindKey(t, key); END; IF pos >= 0 THEN Texts.OpenReader(r, t, pos+1); Texts.Read(r, ch); WHILE ~r.eot & (ch # '"') DO Texts.Read(r, ch) END; NEW(buf); Texts.OpenBuf(buf); Texts.Save(t, pos, Texts.Pos(r)-2, buf); t := TextFrames.Text(""); Texts.Append(t, buf); tf := OpenTF(t) END END ShowBalloon;ÿÿÿÿ€8ÀÔ>Äüÿÿ€8ÀÔ#Syntax10.Scn.Fnt VAR t: Texts.Text; res: INTEGER; uV, sV, new : Viewers.Viewer; uX, uY, sX, sY : INTEGER; n: ARRAY 256 OF CHAR; BEGIN GetFileName(name, n); Oberon.AllocateUserViewer(Oberon.Mouse.X, uX, uY); uV := Viewers.This(uX, uY); DEC(uY); Oberon.AllocateSystemViewer(Oberon.Mouse.X, sX, sY); sV := Viewers.This(sX, sY); DEC(sY); t := TextFrames.Text(""); Texts.Write(w, '"'); Texts.WriteString(w, n); Texts.Write(w, '"'); Texts.Append(t, w.buf); Oberon.Par.text := t; Oberon.Par.pos := 0; Oberon.Call("Documents.Open", Oberon.Par, FALSE, res); new := Viewers.This(uX, uY); IF (new = NIL) OR (new.state = 1) OR (new = uV) THEN new := Viewers.This(sX, sY); IF (new.state = 1) OR (new = sV) THEN new := NIL END END; IF new # NIL THEN RETURN new.dsc.next(TextFrames.Frame) END END OpenView;ÿÿÿÿ€8ÀÔþþÿÿ€8ÀÔ#Syntax10.Scn.Fntàà VAR task : HTMLTask; BEGIN task := Oberon.CurTask(HTMLTask); IF task.frame.text(Web.Text).loading THEN task.time := Oberon.Time() + 50 ELSE TextFrames.Show(task.frame, task.pos); Oberon.Remove(task) END END Wait2;ÿÿÿÿ€8ÀÔ=}üÿÿ€8ÀÔ#Syntax10.Scn.Fntaa VAR r: Texts.Reader; fe: Elem; f: TextFrames.Frame; task: HTMLTask; s: Texts.Scanner; BEGIN IF m IS LinkElems.FollowMsg THEN Texts.OpenReader(r, Texts.ElemBase(e), Texts.ElemPos(e)-1); Texts.ReadPrevElem(r); WHILE ~(r.elem IS Elem) DO Texts.ReadPrevElem(r) END; fe := r.elem(Elem); IF fe.name = "Balloon help text" THEN Texts.OpenScanner(s, Texts.ElemBase(e), Texts.ElemPos(e)+1); Texts.Scan(s); ShowBalloon(e(LinkElems.Elem).file, s.s) ELSE f := OpenView(fe.name); IF f # NIL THEN IF (f.text.len = 1) & (f.text IS Web.Text) THEN NEW(task); task.frame := f; task.pos := e(LinkElems.Elem).key; task.time := Oberon.Time() + 500; task.handle := Wait2; Oberon.Install(task); ELSE PrepareText(f.text); TextFrames.Show(f, e(LinkElems.Elem).key) END END END ELSE LinkElems.Handle(e, m) END END LinkHandle;ÿÿÿÿ€8ÀÔPþÿÿ€8ÀÔ#Syntax10.Scn.FntÉÉ VAR e: LinkElems.Elem; r: Texts.Reader; ch: CHAR; BEGIN e := LinkElems.New("", pos); e.handle := LinkHandle; Texts.Write(w, 09X); Texts.WriteElem(w, e); REPEAT Texts.OpenReader(r, t, pos); Texts.Read(r, ch); DEC(pos) UNTIL (pos<0) OR (ch=CR); IF pos<0 THEN Texts.OpenReader(r, t, 0) END; Texts.Read(r, ch); pos := 0; WHILE ~r.eot & (ch#CR) & (pos<80) DO Texts.Write(w, ch); INC(pos); Texts.Read(r, ch) END; Texts.WriteLn(w) END DetailSearch;ÿÿÿÿ€8ÀÔ©þÿÿ€8ÀÔ#Syntax10.Scn.Fnt55 VAR task : HTMLTask; BEGIN task := Oberon.CurTask(HTMLTask); IF task.text.loading THEN task.time := Oberon.Time() + 100 ELSE PrepareText(task.text); md.SearchText(task.name, task.text, FALSE); Texts.Insert(delayedText, delayedPos+1, w.buf); delayedText := NIL; Oberon.Remove(task) END END Wait;ÿÿÿÿ€8ÀÔÉüÿÿ€8ÀÔ#Syntax10.Scn.Fnt VAR t: Texts.Text; s: Texts.Scanner; e: LinkElems.Elem; fileName: ARRAY 256 OF CHAR; pos: LONGINT; name: ARRAY 32 OF CHAR; i, j: INTEGER; BEGIN t := TextFrames.Text("BalloonIdx.hlp"); Texts.OpenScanner(s, t, 0); Texts.Scan(s); WHILE ~s.eot DO COPY(s.s, fileName); Texts.Scan(s); WHILE s.s#"" DO pos := bd.MatchLine(s.s); IF pos >= 0 THEN i := Strings.Length(fileName); WHILE (i >=0) & (fileName[i]#'/') DO DEC(i) END; INC(i); j := 0; WHILE fileName[i] # 0X DO name[j] := fileName[i]; INC(i); INC(j) END; name[j] := 0X; e := LinkElems.New(name, 0); e.handle := LinkHandle; Texts.Write(w, 09X); Texts.WriteElem(w, e); Texts.WriteString(w, s.s); Texts.WriteLn(w) END; Texts.Scan(s) END; Texts.Scan(s) END END CollectBalloons;ÿÿÿÿ€8ÀÔ˜úÿÿ€8ÀÔ#Syntax10.Scn.FntFF VAR ready: BOOLEAN; t: Texts.Text; n: ARRAY 128 OF CHAR; mod: Modules.Module; fi : Web.FileInfo; stack : Web.UrlStack; task : HTMLTask; f: Files.File; BEGIN t := e.text; ready := TRUE; IF t = NIL THEN IF Strings.Match(e.name, "*.Sym") THEN t := TextFrames.Text(""); GetFileName(e.name, n); Browser.WriteDef(t, n) ELSIF Strings.Match(e.name, "*.html") THEN mod := Modules.ThisMod("HTML"); f := Files.Old(e.name); NEW(task); task.time := Oberon.Time() + 500; task.handle := Wait; task.text := Web.NewText(""); task.text.display := FALSE; COPY(e.name, task.name); NEW(fi); Files.Set(fi.r, f, 0); fi.local := TRUE; fi.coding := ""; NEW(fi.len); fi.len.def := Files.Length(f); fi.len.act := fi.len.def; NEW(stack); NEW(stack.url); stack.meth := ""; stack.body := NIL; stack.org := 0; Web.OpenPresentator(fi, stack, task.text, NIL); Oberon.Install(task); ready := FALSE ELSIF e.name = "Balloon help text" THEN Texts.WriteLn(w); CollectBalloons; NEW(e.hidden); Texts.OpenBuf(e.hidden); Texts.Copy(w.buf, e.hidden); Texts.OpenWriter(w); RETURN ELSE t := TextFrames.Text(e.name) END END; Texts.WriteLn(w); IF ready THEN PrepareText(t); md.SearchText(e.name, t, FALSE) ELSE delayedText := Texts.ElemBase(e); delayedPos := Texts.ElemPos(e)+1 END; e.hidden := w.buf END Expand;ÿÿÿÿ€8ÀÔµ PROCEDURE FindKey(t: Texts.Text; VAR key: ARRAY OF CHAR) : LONGINT; PROCEDURE ShowBalloon (VAR name, key: ARRAY OF CHAR); PROCEDURE OpenView (name: ARRAY OF CHAR) : TextFrames.Frame; PROCEDURE Wait2; PROCEDURE LinkHandle (e: Texts.Elem; VAR m: Texts.ElemMsg); PROCEDURE DetailSearch (t: Texts.Text; fileName: ARRAY OF CHAR; pos: LONGINT); PROCEDURE Wait; PROCEDURE CollectBalloons; PROCEDURE Expand (e: Elem);  ÿÿÿÿ€8ÀÔžŠMODULE Help; IMPORT Directories, Texts, Strings, TextFrames, FoldElems, BalloonElems, MarkElems, Browser, Files, MenuViewers, Oberon, Modules, Web, LinkElems, Viewers, In, Out; CONST CR = 0DX; doHTML=0; doText=1; doMod=2; doDef=3; doBalloon=4; optModIdx=31; optCaseSensitive=30; defaultOpt={doHTML, doText, doMod, doBalloon, optModIdx, optCaseSensitive}; TYPE Domain = RECORD TextDomain = RECORD (Domain) ModDomain = RECORD (Domain) DefDomain = RECORD (Domain) HTMLDomain = RECORD (Domain) BalloonDomain = RECORD (Domain) Elem = POINTER TO ElemDesc; HTMLTask = POINTER TO TaskDesc; HitProc = PROCEDURE (t: Texts.Text; name: ARRAY OF CHAR; pos: LONGINT); VAR w: Texts.Writer; startup: Directories.Directory; hits: Texts.Text; addHit: HitProc; delayedText: Texts.Text; delayedPos: LONGINT; td: TextDomain; md: ModDomain; dd: DefDomain; hd: HTMLDomain; bd: BalloonDomain;  helpers   search full   Index building   one liners  BEGIN Texts.OpenWriter(w); startup := Directories.Startup() END Help. Help.Search UserTrack Help.Search AttrMsg Help.BuildIdx *.hlp\s System.State Help ~