-- COGTest.mesa Test of Cedar graphics
-- Last changed by Stolfi - September 13, 1983 9:35 am
DIRECTORY
Graphics USING [SetCP, DrawRope, Scale, Save, Restore, Mark],
GraphicsBasic USING [MapperRef],
GraphicsOps USING [GetMapper, SetMapper],
ViewerClasses USING [Viewer, PaintProc, ViewerClassRec],
ViewerOps USING [CreateViewer, RegisterViewerClass],
Rope USING [ROPE];
COGTest: CEDAR PROGRAM
IMPORTS GraphicsOps, Graphics, ViewerOps =
BEGIN OPEN GrB: GraphicsBasic, GrOp: GraphicsOps, Graphics, ViewerClasses, ViewerOps;
MyPainter: PaintProc =
BEGIN
mk: Mark;
mp: GrB.MapperRef ← GrOp.GetMapper[context];
SetCP[context, 50,50];
DrawRope[context, "Bananas"];
Scale[context, 2.33, 2.33];
DrawRope[context, "Pitombas"];
mk ← Save[context];
SetCP[context, 40,40];
DrawRope[context, "XXX"];
GrOp.SetMapper[context, mp];
DrawRope[context, "YYY"];
Restore[context, mk];
DrawRope[context, "ZZZ"];
END;
v: Viewer;
RegisterViewerClass[$Blah, NEW[ViewerClassRec ← [paint: MyPainter]]];
v ← CreateViewer[$Blah, [name: "Blah", iconic: FALSE, data: NIL], TRUE];

END.