********************************************************************
* NOTE: This file is generated automatically from the event * definition file Bresenham.evt. ********************************************************************<* PRAGMA LL *> MODULEevent handling methods:; <*NOWARN*> IMPORT TextPort, Rd, ZeusClass, Filter, TextEditVBT; <*NOWARN*> IMPORT Fmt, ZFmt, Wr, ZeusPanel, FormsVBT; <*NOWARN*> IMPORT BresenhamViewClass, 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; oeSetup := Setup; oeNewLine := NewLine; oeErrorInit := ErrorInit; oeShowPixel := ShowPixel; oeFindError := FindError; oeChangeError := ChangeError; oeCompareError := CompareError; oeShowNextPixel := ShowNextPixel; oeMove := Move; END; PROCEDURE BresenhamTranscriptView TViewInit (view: T): T = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "init"); RETURN BresenhamViewClass.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("BresenhamTranscriptView.fv"); view.te := FormsVBT.GetVBT(view.fv, "transcript"); TViewZTrace (view, "install"); FormsVBT.AttachProc(view.fv, "clear", Clear, view); EVAL Filter.Replace (view, view.fv); BresenhamViewClass.T.install (view); END TViewInstall; PROCEDURETViewDelete (view: T) = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "delete"); BresenhamViewClass.T.delete (view); END TViewDelete; PROCEDURETViewSnapshot (view: T; wr: Wr.T) RAISES {ZeusClass.Error} = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "snapshot"); BresenhamViewClass.T.snapshot (view, wr); END TViewSnapshot; PROCEDURETViewRestore (view: T; rd: Rd.T) RAISES {ZeusClass.Error} = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "restore"); BresenhamViewClass.T.restore (view, rd); END TViewRestore; PROCEDURETViewConfig ( view: T; state: ZeusClass.StateChange; o: ZeusClass.T) = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "config"); BresenhamViewClass.T.config (view, state, o); END TViewConfig; PROCEDURETViewReactivity (view: T; <*UNUSED*> on: BOOLEAN) = <* LL = VBT.mu *> BEGIN TViewZTrace(view, "reactivity"); BresenhamViewClass.T.reactivity (view, TRUE); END TViewReactivity; PROCEDURETViewStartrun (view: T) = <* LL = {} *> BEGIN TViewZTrace (view, "startrun"); BresenhamViewClass.T.startrun (view); END TViewStartrun; PROCEDURETViewEndrun (view: T) = <* LL = {} *> BEGIN TViewZTrace (view, "endrun"); BresenhamViewClass.T.endrun (view); END TViewEndrun;PROCEDURESetup (view: T; width, height: 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, "Setup ...") ELSE TViewTrace (view, "Setup " & Fmt.Int(width) & " " & Fmt.Int(height) & " " & Fmt.Bool(show) ) END END END END Setup; PROCEDURENewLine (view: T; x0, y0, x1, y1: INTEGER) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "NewLine ...") ELSE TViewTrace (view, "NewLine " & Fmt.Int(x0) & " " & Fmt.Int(y0) & " " & Fmt.Int(x1) & " " & Fmt.Int(y1) ) END END END END NewLine; PROCEDUREErrorInit (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, "ErrorInit ...") ELSE TViewTrace (view, "ErrorInit " ) END END END END ErrorInit; PROCEDUREShowPixel (view: T; x, y, p1, p2: INTEGER) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "ShowPixel ...") ELSE TViewTrace (view, "ShowPixel " & Fmt.Int(x) & " " & Fmt.Int(y) & " " & Fmt.Int(p1) & " " & Fmt.Int(p2) ) END END END END ShowPixel; PROCEDUREFindError (view: T; p: INTEGER) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "FindError ...") ELSE TViewTrace (view, "FindError " & Fmt.Int(p) ) END END END END FindError; PROCEDUREChangeError (view: T; p: INTEGER) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "ChangeError ...") ELSE TViewTrace (view, "ChangeError " & Fmt.Int(p) ) END END END END ChangeError; PROCEDURECompareError (view: T; p: INTEGER) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "CompareError ...") ELSE TViewTrace (view, "CompareError " & Fmt.Int(p) ) END END END END CompareError; PROCEDUREShowNextPixel (view: T; p: INTEGER) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "ShowNextPixel ...") ELSE TViewTrace (view, "ShowNextPixel " & Fmt.Int(p) ) END END END END ShowNextPixel; PROCEDUREMove (view: T; p: INTEGER) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "Move ...") ELSE TViewTrace (view, "Move " & Fmt.Int(p) ) END END END END Move; 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, "Bresenham Transcript View", "Bresenham"); END BresenhamTranscriptView.