-- EDWIN Specs Included
#OPTION -LISTING

-- This is a mapping of EDWIN subroutine calls onto an occam channel.
-- It is used like Terminal, as desribed in the documentation for Terminal.

-- Briefly, no draw a line from (10,15) to (100,239):

--       Edwin ! Edwin.Move.Abs; 10;15 ; Edwin.Line.Abs; 100;239

-- Edwin is automatically initialised to the default device type when first
-- used.   Note that the command SETUP EDWIN must be issued before OS is run
-- on an Edwin program.

CHAN Edwin AT 24:

--    Function Name                    Parameters

DEF Edwin.Move.Abs = 0,             -- X;Y
    Edwin.Move.Rel = 1,             -- X;Y
    Edwin.Line.Abs = 2,             -- X;Y
    Edwin.Line.Rel = 3,             -- X;Y
    Edwin.Marker.Abs = 4,           -- X;Y
    Edwin.Marker.Rel = 5,           -- X;Y
    Edwin.Character = 6,            -- Char           see also Edwin.Text at end
    Edwin.New.Frame = 7,            --                None
    Edwin.Window = 8,               -- XL;YL ; XU;YU        n.b. different order
    Edwin.View.Port = 9,            -- XL;YL ; XU;YU        from real Edwin
    Edwin.Set.Colour = 10,          -- Number
    Edwin.Set.Line.Style = 11,      -- Number
    Edwin.Set.Char.Size = 12,       -- Size
    Edwin.Set.Char.Rot = 13,        -- Angle
    Edwin.Set.Char.Quality = 14,    -- 0 or 1
    Edwin.Set.Char.Font = 15,       -- Herhsy Number
    Edwin.Set.Colour.Map = 16,      -- Colour Number; Red; Blue; Green
    Edwin.Arc = 17,                 -- OX;OY ; Radius; Start Angle; End Angle
    Edwin.Sector = 18,              -- OX;OY ; Radius; Start Angle; End Angle
    Edwin.Circle = 19,              -- Radius
    Edwin.Rectangle = 20:           -- XL;YL ; XL;YL

PROC Edwin.Text (VALUE s []) =
  SEQ i = [1 FOR s [BYTE 0]]
    Edwin ! Edwin.Character; s [BYTE i]:

#OPTION +LISTING
