JaMMickeyMouseImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Last edited by: Mik Lamming - April 25, 1986 3:51:20 pm PST
DIRECTORY MickeyMouse, JaM, JaMIPrivate, Imager, Rope;
JaMMickeyMouseImpl: CEDAR MONITOR
IMPORTS MickeyMouse, JaM, JaMIPrivate, Imager
~ BEGIN
ApplyCreate: PROC [self: JaM.State] ~ {
file: Rope.ROPE ← JaM.PopRope[self];
ref: MickeyMouse.Ref ← MickeyMouse.Create[file];
JaM.Push[self, ref];
};
ApplyDrawFrame: PROC [self: JaM.State] ~ {
GetContext: PROC [self: JaM.State] RETURNS [Imager.Context] ~ {
info: JaMIPrivate.Info ← JaMIPrivate.GetInfo[self];
IF info = NIL THEN ERROR;
IF info.ipenabled THEN RETURN [info.ipdc];
RETURN[info.vdc];
};
Action: PROC ~ {
Imager.ScaleT[context, 1.0/Imager.metersPerPoint];
MickeyMouse.DrawFrame[ref, context]
};
ref: MickeyMouse.Ref ← NARROW[JaM.Pop[self]];
info: JaMIPrivate.Info ← JaMIPrivate.GetInfo[self];
context: Imager.Context ~ GetContext[self];
Imager.DoSaveAll[context, Action];
};
ApplyNextFrame: PROC [self: JaM.State] ~ {
ref: MickeyMouse.Ref ← NARROW[JaM.Pop[self]];
MickeyMouse.NextFrame[ref];
};
RegisterMickeyMouse: PUBLIC PROC [self: JaM.State] ~ {
-- called with (JaMMickeyMouseImpl) .callinit
JaM.Register[self, ".mickeymousemakehandle", ApplyCreate];
JaM.Register[self, ".mickeymousedrawframe", ApplyDrawFrame];
JaM.Register[self, ".mickeymousenextframe", ApplyNextFrame];
};
Init: PROC [] RETURNS [] ~ {
JaM.RegisterInit["JaMMickeyMouseImpl", RegisterMickeyMouse];
};
Init[];
END.