********************************************************************
* NOTE: This file is generated automatically from the event * definition file Euclid.evt. ********************************************************************<* PRAGMA LL *> MODULEevent handling methods:; <*NOWARN*> IMPORT EuclidViewClass, TextPort, Rd, ZeusClass, Filter; <*NOWARN*> IMPORT TextEditVBT, Fmt, ZFmt, Wr, ZeusPanel, FormsVBT; <*NOWARN*> IMPORT Euclid, VBT, View; <* FATAL FormsVBT.Error, FormsVBT.Unimplemented *> REVEAL T = Public BRANDED OBJECT fv: FormsVBT.T := NIL; te: TextEditVBT.T := NIL; OVERRIDES init := TViewInit; install := TViewInstall; delete := TViewDelete; snapshot := TViewSnapshot; restore := TViewRestore; config := TViewConfig; reactivity := TViewReactivity; startrun := TViewStartrun; endrun := TViewEndrun; oeSetupTriangle := SetupTriangle; oeSetupSquare := SetupSquare; oeLineAL := LineAL; oeTriangle := Triangle; oeQuad := Quad; oeShear := Shear; oeRotateTriangle := RotateTriangle; oeRotateLine := RotateLine; oeRotateAngle := RotateAngle; oeHighlightLine := HighlightLine; oeHighlightAngle := HighlightAngle; oeRemove := Remove; oeStep := Step; END; PROCEDURE EuclidTranscriptView TViewInit (view: T): T = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "init"); RETURN EuclidViewClass.T.init (view, NIL); END TViewInit; PROCEDUREClear (<* UNUSED *> fv : FormsVBT.T; <* UNUSED *> name: TEXT; cl : REFANY; <* UNUSED *> time: VBT.TimeStamp) = BEGIN TextPort.SetText(NARROW(cl, T).te.tp, "") END Clear; PROCEDURETViewInstall (view: T) = <* LL = VBT.mu *> BEGIN view.fv := ZeusPanel.NewForm("EuclidTranscriptView.fv"); view.te := FormsVBT.GetVBT(view.fv, "transcript"); TViewZTrace (view, "install"); FormsVBT.AttachProc(view.fv, "clear", Clear, view); EVAL Filter.Replace (view, view.fv); EuclidViewClass.T.install (view); END TViewInstall; PROCEDURETViewDelete (view: T) = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "delete"); EuclidViewClass.T.delete (view); END TViewDelete; PROCEDURETViewSnapshot (view: T; wr: Wr.T) RAISES {ZeusClass.Error} = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "snapshot"); EuclidViewClass.T.snapshot (view, wr); END TViewSnapshot; PROCEDURETViewRestore (view: T; rd: Rd.T) RAISES {ZeusClass.Error} = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "restore"); EuclidViewClass.T.restore (view, rd); END TViewRestore; PROCEDURETViewConfig ( view: T; state: ZeusClass.StateChange; o: ZeusClass.T) = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "config"); EuclidViewClass.T.config (view, state, o); END TViewConfig; PROCEDURETViewReactivity (view: T; <*UNUSED*> on: BOOLEAN) = <* LL = VBT.mu *> BEGIN TViewZTrace(view, "reactivity"); EuclidViewClass.T.reactivity (view, TRUE); END TViewReactivity; PROCEDURETViewStartrun (view: T) = <* LL = {} *> BEGIN TViewZTrace (view, "startrun"); EuclidViewClass.T.startrun (view); END TViewStartrun; PROCEDURETViewEndrun (view: T) = <* LL = {} *> BEGIN TViewZTrace (view, "endrun"); EuclidViewClass.T.endrun (view); END TViewEndrun;PROCEDURESetupTriangle (view: T; a, b: REAL) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "SetupTriangle ...") ELSE TViewTrace (view, "SetupTriangle " & Fmt.Real(a) & " " & Fmt.Real(b) ) END END END END SetupTriangle; PROCEDURESetupSquare (view: T; p1, p2, p3, p4: Euclid.Id) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "SetupSquare ...") ELSE TViewTrace (view, "SetupSquare " & Fmt.Int(p1) & " " & Fmt.Int(p2) & " " & Fmt.Int(p3) & " " & Fmt.Int(p4) ) END END END END SetupSquare; PROCEDURELineAL (view: T; show: BOOLEAN) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "LineAL ...") ELSE TViewTrace (view, "LineAL " & Fmt.Bool(show) ) END END END END LineAL; PROCEDURETriangle (view: T; p1, p2, p3: Euclid.Id; color: INTEGER) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "Triangle ...") ELSE TViewTrace (view, "Triangle " & Fmt.Int(p1) & " " & Fmt.Int(p2) & " " & Fmt.Int(p3) & " " & Fmt.Int(color) ) END END END END Triangle; PROCEDUREQuad (view: T; p1, p2, p3, p4: Euclid.Id; color: INTEGER) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "Quad ...") ELSE TViewTrace (view, "Quad " & Fmt.Int(p1) & " " & Fmt.Int(p2) & " " & Fmt.Int(p3) & " " & Fmt.Int(p4) & " " & Fmt.Int(color) ) END END END END Quad; PROCEDUREShear (view: T; p1, p2, from, to: Euclid.Id) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "Shear ...") ELSE TViewTrace (view, "Shear " & Fmt.Int(p1) & " " & Fmt.Int(p2) & " " & Fmt.Int(from) & " " & Fmt.Int(to) ) END END END END Shear; PROCEDURERotateTriangle (view: T; pivot, p1From, p1To, p2From, pt2To: Euclid.Id) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "RotateTriangle ...") ELSE TViewTrace (view, "RotateTriangle " & Fmt.Int(pivot) & " " & Fmt.Int(p1From) & " " & Fmt.Int(p1To) & " " & Fmt.Int(p2From) & " " & Fmt.Int(pt2To) ) END END END END RotateTriangle; PROCEDURERotateLine (view: T; pivot, pFrom, pTo: Euclid.Id) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "RotateLine ...") ELSE TViewTrace (view, "RotateLine " & Fmt.Int(pivot) & " " & Fmt.Int(pFrom) & " " & Fmt.Int(pTo) ) END END END END RotateLine; PROCEDURERotateAngle (view: T; pivot, p1From, p1To, p2From, pt2To: Euclid.Id) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "RotateAngle ...") ELSE TViewTrace (view, "RotateAngle " & Fmt.Int(pivot) & " " & Fmt.Int(p1From) & " " & Fmt.Int(p1To) & " " & Fmt.Int(p2From) & " " & Fmt.Int(pt2To) ) END END END END RotateAngle; PROCEDUREHighlightLine (view: T; p1, p2: Euclid.Id; value: INTEGER; show: BOOLEAN) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "HighlightLine ...") ELSE TViewTrace (view, "HighlightLine " & Fmt.Int(p1) & " " & Fmt.Int(p2) & " " & Fmt.Int(value) & " " & Fmt.Bool(show) ) END END END END HighlightLine; PROCEDUREHighlightAngle (view: T; p1, vertex, p2: Euclid.Id; value: INTEGER; show: BOOLEAN) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "HighlightAngle ...") ELSE TViewTrace (view, "HighlightAngle " & Fmt.Int(p1) & " " & Fmt.Int(vertex) & " " & Fmt.Int(p2) & " " & Fmt.Int(value) & " " & Fmt.Bool(show) ) END END END END HighlightAngle; PROCEDURERemove (view: T; p1, p2, p3, p4: Euclid.Id; show: BOOLEAN) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "Remove ...") ELSE TViewTrace (view, "Remove " & Fmt.Int(p1) & " " & Fmt.Int(p2) & " " & Fmt.Int(p3) & " " & Fmt.Int(p4) & " " & Fmt.Bool(show) ) END END END END Remove; PROCEDUREStep (view: T; ) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "Step ...") ELSE TViewTrace (view, "Step " ) END END END END Step; PROCEDURETViewZTrace (view: T; t: TEXT) = BEGIN IF view.fv # NIL THEN IF FormsVBT.GetBoolean(view.fv, "zeus") THEN TextPort.PutText(view.te.tp, "**zeus: " & t & "\n"); TextPort.Normalize(view.te.tp, LAST(INTEGER)) END END END TViewZTrace; PROCEDURETViewTrace (view: T; t: TEXT) = BEGIN TextPort.PutText(view.te.tp, "--event: " & t & "\n"); TextPort.Normalize(view.te.tp, LAST(INTEGER)) END TViewTrace; PROCEDURETViewNew (): View.T = BEGIN RETURN NEW(T).init() END TViewNew; BEGIN ZeusPanel.RegisterView (TViewNew, "Euclid Transcript View", "Euclid"); END EuclidTranscriptView.