-- $Date: 2004/01/02 05:07:53 $
-- $Revision: 1.23 $
-- $Author: jcrocholl $

-- 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;

with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;

package Glyphs is

   -- Type for instance variables.
   type Glyph is private;

   -- Internal package for lists of outlines.
   package Outline_Lists is new Lists(Outlines.Outline);

   -- A list of outlines to store a glyph's appearance.
   subtype Outline_List is Outline_Lists.List;

   -- Constructor for instances.
   function Create
     (Name : in String-- The initial name.
     return Glyph;      -- The newly created glyph.

   -- Accessor to read the name of a glyph.
   function Get_Name
     (This : in Glyph-- The glyph to read from.
     return String;    -- The name of that glyph.

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

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

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

   -- Get a raster image of this glyph. Create one if not cached.
   function Get_Image
     (This         : in Glyph;    -- The glyph object instance.
      Staff_Height : in Real;     -- Height of staff in pixels.
      Aspect_Ratio : in Real;     -- Zoom factor for X resolution.
      Anti_Alias   : in Positive-- Factor for vertical anti-alias.
     return Glyph_Image;          -- The image of the glyph.

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

   -- Calculate the width of this glyph's bounding box.
   function Get_Width
     (This : in 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 : in Glyph-- The glyph object instance.
     return Real;      -- The height of the glyph.

private

   -- Private representation.
   type Glyph_Record is record
      Name     : Unbounded_String-- Unique name, used for file name.
      Bounds   : Box;              -- Dimensions of the glyph.
      Outlines : Outline_List;     -- Defining the glyph's appearance.
      Image    : Glyph_Image;      -- Cached raster image of the glyph.
   end record;

   -- Pointer to representation data.
   type Glyph is access Glyph_Record;

end Glyphs;