-- GraphicsImportImpl.mesa
-- Last edited by Doug Wyatt, August 30, 1982 5:32 pm

-- Compile this module and bind it together with the GraphicsPackage to
-- verify that GraphicsPackage exports everything that this module imports.
-- This module is not intended to be executed.

DIRECTORY Graphics, GraphicsOps, GraphicsColor,
CGBitmapDeviceExtras, File, Rope;

GraphicsImportImpl: CEDAR PROGRAM
IMPORTS Graphics, GraphicsOps, GraphicsColor,
CGBitmapDeviceExtras = {

Test: PROC = {
context, other: Graphics.Context;
path: Graphics.Path;
image: Graphics.ImageRef;
font: Graphics.FontRef;
rope: Rope.ROPE ← "foo";
text: REF READONLY TEXT ← "foo";
string: STRING ← "foo";
mark: Graphics.Mark;
bitmap: GraphicsOps.BitmapRef;
file: File.Capability;
proc: PROC[PROC[CHAR] RETURNS[BOOL]] = { };
mapper: GraphicsOps.MapperRef;
clipper: GraphicsOps.ClipperRef;
color: GraphicsColor.Color;

context ← Graphics.NewContext[];
other ← Graphics.CopyContext[context];
[] ← context.GetCP[];
context.SetCP[0,0];
path ← Graphics.NewPath[];
[] ← Graphics.LastPoint[path];
Graphics.FlushPath[path];
Graphics.MoveTo[path, 0,0];
Graphics.LineTo[path, 0,0];
Graphics.CurveTo[path, 0,0,0,0,0,0];
Graphics.Rectangle[path, 0,0,0,0];
context.DrawTo[0,0];
context.DrawStroke[path];
context.DrawArea[path];
context.DrawBox[[0,0,0,0]];
image ← GraphicsOps.NewAisImage[rope];
context.DrawImage[image];
context.Translate[0,0];
context.Scale[0,0];
context.Rotate[0];
context.Concat[0,0,0,0];
[] ← context.Map[other, 0,0];
[] ← context.WorldToUser[0,0];
[] ← context.UserToWorld[0,0];
context.SetColor[Graphics.black];
[] ← context.GetColor[];
context.SetStipple[0];
[] ← context.SetPaintMode[opaque];
[] ← context.SetFat[TRUE];
font ← Graphics.MakeFont[rope];
[] ← context.GetDefaultFont[];
context.SetDefaultFont[font];
context.DrawRope[rope];
context.DrawChar['x];
[] ← Graphics.RopeBox[font, rope];
[] ← Graphics.RopeWidth[font, rope];
[] ← Graphics.CharBox[font, 'x];
[] ← Graphics.CharWidth[font, 'x];
[] ← Graphics.FontBox[font];
context.ClipArea[path];
context.ClipBox[[0,0,0,0]];
[] ← context.IsPointVisible[0,0];
[] ← context.IsRectangular[];
[] ← context.GetBounds[];
[] ← context.Visible[];
mark ← context.Save[];
context.Restore[mark];

bitmap ← GraphicsOps.NewBitmap[0,0];
[] ← GraphicsOps.NewContextFromBitmap[bitmap];
GraphicsOps.SetTargetBitmap[context, bitmap];
TRUSTED { GraphicsOps.DrawBitmap[context, bitmap, 0, 0] };
[] ← GraphicsOps.ScreenBitmap[];
image ← GraphicsOps.NewAisImageFromCapability[file];
[] ← GraphicsOps.ImageBox[image];
font ← GraphicsOps.DefaultFont[];
GraphicsOps.DrawTextFromProc[context, proc];
GraphicsOps.DrawText[context, text];
[] ← GraphicsOps.TextBox[font, text];
[] ← GraphicsOps.TextWidth[font, text];
[] ← GraphicsOps.UserToDevice[context, 0,0];
[] ← GraphicsOps.DeviceToUser[context, 0,0];
mapper ← GraphicsOps.GetMapper[context];
GraphicsOps.SetMapper[context, mapper];
clipper ← GraphicsOps.GetClipper[context];
GraphicsOps.SetClipper[context, clipper];
[] ← GraphicsOps.TestVisible[mapper,clipper,0,0];
[] ← GraphicsOps.TestBounds[mapper,clipper];
GraphicsOps.BeginBox[context];
[] ← GraphicsOps.EndBox[context];
[] ← GraphicsOps.GetYMode[context];
GraphicsOps.SetYMode[context, bottomUp];
GraphicsOps.DrawTexturedBox[context, [0,0,0,0],ALL[0]];
GraphicsOps.Disable[context];
GraphicsOps.MoveDeviceRectangle[context, 0, 0, 0, 0, 0, 0];
TRUSTED {font ← GraphicsOps.UnsafeNewFont[NIL]};

color ← GraphicsColor.IntensityToColor[0];
color ← GraphicsColor.HSVToColor[0,0,0];
color ← GraphicsColor.RGBToColor[0,0,0];
[] ← GraphicsColor.ColorToRGB[color];
[] ← GraphicsColor.ColorToHSV[color];
[] ← GraphicsColor.ColorToIntensity[color];

CGBitmapDeviceExtras.SetBrick[0,0,0,NIL];
CGBitmapDeviceExtras.ResetBrick[];
CGBitmapDeviceExtras.SetMap[NIL];
};

}.