-- $Date: 2004/03/08 10:52:58 $
-- $Revision: 1.34 $
-- $Author: jcrocholl $
-- $Hash: 18f95fbd33e383c14ae6c8db93f8d0e8 $

-- This file was automatically created with ado.php.
-- Manual changes will be lost when it is updated.

with Lists;
with Outlines; use Outlines;
with Glyph_Images; use Glyph_Images;
with Real_Numbers; use Real_Numbers;
with Real_Vectors; use Real_Vectors;

package Glyphs is

   package Outline_Lists is new Lists(Outlines.Outline_Access);
   subtype Outline_List is Outline_Lists.List;
   subtype Outline_List_Access is Outline_Lists.List_Access;

   -- Public representation.
   type Glyph is limited private;

   -- Pointer to representation data.
   type Glyph_Access is access all Glyph;

   -- Constructor for instances.
   function Create
     return Glyph_Access-- The newly created glyph.

   -- Accessor to read the bounds of a glyph.
   function Get_Bounds
     (This : access Glyph-- The glyph to read from.
     return Rectangle;     -- The bounds of that glyph.

   -- Accessor to read the outlines of a glyph.
   function Get_Outlines
     (This : access Glyph)       -- The glyph to read from.
     return Outline_List_Access-- The outlines of that glyph.

   -- Add an outline to a glyph.
   procedure Add_Outline
     (This : access Glyph;       -- The glyph object instance.
      Add  : in Outline_Access); -- Add this outline to the glyph.

   -- Make sure that the cached raster image is up to date.
   procedure Update_Image
     (This         : access Glyph-- The glyph object instance.
      Staff_Height : in Real;      -- Zoom factor.
      Aspect_Ratio : in Real;      -- Extra horizontal zoom factor.
      Anti_Alias   : in Positive); -- Factor for vertical anti-alias.

   -- Get a raster image of this glyph. Create one if not cached.
   function Get_Image
     (This         : access Glyph-- The glyph object instance.
      Staff_Height : in Real;      -- Zoom factor.
      Aspect_Ratio : in Real;      -- Extra horizontal zoom factor.
      Anti_Alias   : in Positive)  -- Factor for vertical anti-alias.
     return Glyph_Image_Access;    -- The image of the glyph.

   -- Update the bounding box of the glyph.
   procedure Set_Bounds
     (This          : access Glyph-- The glyph object instance.
      Left, Top     : in Real;      -- Coordinate minima.
      Right, Bottom : in Real);     -- Coordinate maxima.

   -- Calculate the width of this glyph's bounding box.
   function Get_Width
     (This : access Glyph-- The glyph object instance.
     return Real;          -- The width of the glyph.

   -- Calculate the height of this glyph's bounding box.
   function Get_Height
     (This : access Glyph-- The glyph object instance.
     return Real;          -- The height of the glyph.

   procedure Print
     (This   : access Glyph;       -- The glyph object instance.
      Image  : access Glyph_Image-- Render into this image.
      Center : in Vector);         -- Pixel center coordinates.

private

   -- Private representation.
   type Glyph is limited record
      Bounds   : Rectangle;           -- Dimensions of the glyph.
      Outlines : Outline_List_Access-- Defining the glyph's appearance.
      Image    : Glyph_Image_Access;  -- Cached raster image of the glyph.
   end record;

end Glyphs;