Syntax10.Scn.Fnt Syntax10i.Scn.Fnt StampElems Alloc 15 Mar 96 Syntax10b.Scn.Fnt FoldElems Syntax10.Scn.Fnt Oberon.CurTask.time := Oberon.Time()+75 MODULE XEInstaller; (** SHML 5 Dec 91/ (** Exchange TextFrames.Handler in visible viewers with XE.Handler **) (* !!! IMPORTANT !!!! Before compiling, delete one of the two folds in procedure Exchange to adjust the delay. You can simply search for the following: CHANGE IMPORT Input, Display, Viewers, TF := TextFrames, MV := MenuViewers, Oberon; exchanger: Oberon.Task; tfHandle, xeHandle: Display.Handler; PROCEDURE GetXEHandler; VAR save, par: Oberon.ParList; res: INTEGER; BEGIN save := Oberon.Par; NEW(par); NEW(par.frame); par.frame.X := 0; par.frame.Y := 0; par.pos := -210566; (* magic *) Oberon.Call("XE.GetHandler", par, FALSE, res); IF res = 0 THEN xeHandle := Oberon.Par.frame.handle ELSE xeHandle := NIL END; Oberon.Par := save END GetXEHandler; PROCEDURE Change(x, y: INTEGER); (* change handler for textframes in viewer x, y *) VAR v: Viewers.Viewer; BEGIN v := Viewers.This(x, y); IF (v # NIL) & (v IS MV.Viewer) THEN (* v # NIL necessary for startup *) IF (v.dsc IS TF.Frame) & (v.dsc.handle = tfHandle) THEN v.dsc.handle := xeHandle END; IF (v.dsc.next IS TF.Frame) & (v.dsc.next.handle = tfHandle) THEN v.dsc.next.handle := xeHandle END END END Change; PROCEDURE Exchange; (* Inspect viewer at mouse and caret position and exchange TextFrames with XE handler *) BEGIN Change(Oberon.Mouse.X, Oberon.Mouse.Y); IF Oberon.FocusViewer # NIL THEN Change(Oberon.FocusViewer.X, Oberon.FocusViewer.Y) END; (* CHANGE *) (* delay for 250 ms: Ceres, MacOberon *) Oberon.CurTask.time := Oberon.Time()+Input.TimeUnit DIV 4 (* delay for 250 ms: other Oberons *) END Exchange; PROCEDURE Start*; BEGIN Oberon.Remove(exchanger); GetXEHandler; IF xeHandle # NIL THEN Oberon.Install(exchanger) END END Start; PROCEDURE Stop*; BEGIN Oberon.Remove(exchanger) END Stop; BEGIN NEW(exchanger); exchanger.safe := FALSE; exchanger.handle := Exchange; tfHandle := TF.Handle END XEInstaller. XEInstaller.Start XEInstaller.Stop