mentor/derived/logoIE.m3


 Copyright (C) 1995, Digital Equipment Corporation.       
 All rights reserved.                                     
 See the file COPYRIGHT for a full description.           
                                                          
 Last modified on Thu Feb  9 08:50:48 PST 1995 by kalsow  
      modified on Sun Jun  5 21:59:57 PDT 1994 by mhb     
      modified on Wed Feb 17 16:46:47 PST 1993 by johnh   

********************************************************************

      *  NOTE: This file is generated automatically from the event
      *        definition file logo.evt.
      ********************************************************************


<* PRAGMA LL *>

MODULE logoIE;

<*NOWARN*> IMPORT logoAlgClass, ZeusClass, Zeus, logoViewClass;
<*NOWARN*> IMPORT Algorithm, View, Thread, AlgorithmClass;

<* FATAL Zeus.Error, Zeus.Locked *>
If you get either of these errors, contact a Zeus implementor.

TYPE
  InitArgs = BRANDED REF RECORD
    text: TEXT;
  END;

  RandomStepArgs = BRANDED REF RECORD
    delta: REAL;
  END;

  ShiftArgs = BRANDED REF RECORD
  END;

  MarqueeArgs = BRANDED REF RECORD
    side: INTEGER;
  END;

  MarqueeSpotsArgs = BRANDED REF RECORD
  END;
Zeus calls the following to invoke vbt v's event handler:

<*NOWARN*> PROCEDURE OEDispatcher(v: ZeusClass.T; evt: REFANY) RAISES {Thread.Alerted} =
  <* LL <= VBT.mu *>
  (* LL = {} if event style is output, LL = VBT.mu if event style is update. *)
  BEGIN
    TYPECASE v OF
    | logoViewClass.T (view) => <*NOWARN*>
      TYPECASE evt OF
      | InitArgs(varInitArgs) => <*NOWARN*>
          view.oeInit (
              varInitArgs.text
              )
      | RandomStepArgs(varRandomStepArgs) => <*NOWARN*>
          view.oeRandomStep (
              varRandomStepArgs.delta
              )
      | ShiftArgs(varShiftArgs) => <*NOWARN*>
          view.oeShift (
              )
      | MarqueeArgs(varMarqueeArgs) => <*NOWARN*>
          view.oeMarquee (
              varMarqueeArgs.side
              )
      | MarqueeSpotsArgs(varMarqueeSpotsArgs) => <*NOWARN*>
          view.oeMarqueeSpots (
              )
      ELSE <* ASSERT FALSE *>
      END;
    ELSE (* this view isn't a logoViewClass, so just ignore *)
    END
  END OEDispatcher;

<*NOWARN*> PROCEDURE FEDispatcher(v: ZeusClass.T; evt: REFANY) =
  <* LL = VBT.mu *>
  BEGIN
    TYPECASE v OF
    | logoAlgClass.T (alg) => <*NOWARN*>
      TYPECASE evt OF
      ELSE <* ASSERT FALSE *>
      END;
    ELSE (* this alg isn't a logoAlgClass, so just ignore *)
    END
  END FEDispatcher;

PROCEDURE Init (
      initiator: Algorithm.T;
       text: TEXT
    ) RAISES {Thread.Alerted} =
  <* LL = {} *>
  VAR zumeArgRec := NEW(InitArgs
               , text := text
      );
      alg := NARROW(initiator, logoAlgClass.T);
  BEGIN
    LOCK alg.evtMu DO
      INC(alg.eventDataRec.ctOfInit);
      alg.stopAtEvent := alg.eventDataRec.stopAtInit;
      alg.waitAtEvent := alg.eventDataRec.waitAtInit;
      Zeus.Dispatch(initiator, Zeus.EventStyle.Output, 1,
                    "Init", OEDispatcher, zumeArgRec);
    END;
  END Init;

PROCEDURE RandomStep (
      initiator: Algorithm.T;
       delta: REAL
    ) RAISES {Thread.Alerted} =
  <* LL = {} *>
  VAR zumeArgRec := NEW(RandomStepArgs
               , delta := delta
      );
      alg := NARROW(initiator, logoAlgClass.T);
  BEGIN
    LOCK alg.evtMu DO
      INC(alg.eventDataRec.ctOfRandomStep);
      alg.stopAtEvent := alg.eventDataRec.stopAtRandomStep;
      alg.waitAtEvent := alg.eventDataRec.waitAtRandomStep;
      Zeus.Dispatch(initiator, Zeus.EventStyle.Output, 1,
                    "RandomStep", OEDispatcher, zumeArgRec);
    END;
  END RandomStep;

PROCEDURE Shift (
      initiator: Algorithm.T;

    ) RAISES {Thread.Alerted} =
  <* LL = {} *>
  VAR zumeArgRec := NEW(ShiftArgs
      );
      alg := NARROW(initiator, logoAlgClass.T);
  BEGIN
    LOCK alg.evtMu DO
      INC(alg.eventDataRec.ctOfShift);
      alg.stopAtEvent := alg.eventDataRec.stopAtShift;
      alg.waitAtEvent := alg.eventDataRec.waitAtShift;
      Zeus.Dispatch(initiator, Zeus.EventStyle.Output, 1,
                    "Shift", OEDispatcher, zumeArgRec);
    END;
  END Shift;

PROCEDURE Marquee (
      initiator: Algorithm.T;
       side: INTEGER
    ) RAISES {Thread.Alerted} =
  <* LL = {} *>
  VAR zumeArgRec := NEW(MarqueeArgs
               , side := side
      );
      alg := NARROW(initiator, logoAlgClass.T);
  BEGIN
    LOCK alg.evtMu DO
      INC(alg.eventDataRec.ctOfMarquee);
      alg.stopAtEvent := alg.eventDataRec.stopAtMarquee;
      alg.waitAtEvent := alg.eventDataRec.waitAtMarquee;
      Zeus.Dispatch(initiator, Zeus.EventStyle.Output, 1,
                    "Marquee", OEDispatcher, zumeArgRec);
    END;
  END Marquee;

PROCEDURE MarqueeSpots (
      initiator: Algorithm.T;

    ) RAISES {Thread.Alerted} =
  <* LL = {} *>
  VAR zumeArgRec := NEW(MarqueeSpotsArgs
      );
      alg := NARROW(initiator, logoAlgClass.T);
  BEGIN
    LOCK alg.evtMu DO
      INC(alg.eventDataRec.ctOfMarqueeSpots);
      alg.stopAtEvent := alg.eventDataRec.stopAtMarqueeSpots;
      alg.waitAtEvent := alg.eventDataRec.waitAtMarqueeSpots;
      Zeus.Dispatch(initiator, Zeus.EventStyle.Output, 1,
                    "MarqueeSpots", OEDispatcher, zumeArgRec);
    END;
  END MarqueeSpots;

BEGIN
END logoIE.

interface View is in: