-- $Date: 2004/03/08 10:39:48 $
-- $Revision: 1.10 $
-- $Author: jcrocholl $
-- $Hash: 4ddfa4e818d1421f5f8ca9a00e8fabd0 $

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

with Ada.Tags; use Ada.Tags;
with Font_Loaders; use Font_Loaders;
with Glyphs; use Glyphs;
with Printers; use Printers;
with Music.Notes; use Music.Notes;
with Lists;
with Boxes.Note_Heads; use Boxes.Note_Heads;

package Boxes.Chords is

   package Head_Lists is new Lists(Note_Head_Box_Access);
   subtype Head_List is Head_Lists.List;
   subtype Head_List_Access is Head_Lists.List_Access;

   subtype High is Integer range 3 .. 9;
   type High_Ledger_Array is array(High) of Glyph_Access;

   subtype Low is Integer range -9 .. -3;
   type Low_Ledger_Array is array(Low) of Glyph_Access;

   -- Public representation.
   type Chord_Box is new Box with private;

   -- Work-around for GNAT bug.
   Chord_Box_Tag : constant String;

   -- Pointer to representation data.
   type Chord_Box_Access is access all Chord_Box;

   -- Constructor for instances.
   function Create
     return Chord_Box_Access-- The newly created chord box.

   procedure Add_Note
     (This     : access Chord_Box-- The chord box object instance.
      Add      : access Note;      -- Add this note.
      Middle_C : in Integer);      -- Clef in use in this measure.

   procedure Layout_Note_Heads
     (This : access Chord_Box;    -- The chord box object instance.
      Font : access Font_Loader); -- Use this font loader.

   procedure Layout_Stem_Down
     (This : access Chord_Box;    -- The chord box object instance.
      Font : access Font_Loader); -- Use this font loader.

   procedure Layout_Stem_Up
     (This : access Chord_Box;    -- The chord box object instance.
      Font : access Font_Loader); -- Use this font loader.

   procedure Layout_Dots
     (This : access Chord_Box;    -- The chord box object instance.
      Font : access Font_Loader); -- Use this font loader.

   procedure Layout_Ledger
     (This : access Chord_Box;    -- The chord box object instance.
      Font : access Font_Loader); -- Use this font loader.

   procedure Layout
     (This : access Chord_Box;    -- The chord box object instance.
      Font : access Font_Loader); -- Use this font loader.

   procedure Print
     (This   : access Chord_Box;          -- The chord box object instance.
      To     : access Printer'Class-- Render to this printer.
      Center : in Vector);                -- Center of container.

private

   -- Private representation.
   type Chord_Box is
     new Box with
      record
         Note_Heads  : Head_List_Access;  -- The note heads in this box.
         Highest     : Integer;           -- Vertical offset of highest note.
         Lowest      : Integer;           -- Vertical offset of lowest note.
         Stem        : Boolean;           -- Draw a stem or not?
         Stem_Down   : Boolean;           -- Stem direction.
         Stem_Box    : Rectangle;         -- Stem outline.
         Note_Type   : Note_Type_Enum;    -- Fraction type of notes.
         Flag        : Glyph_Access;      -- Glyph for flags.
         Flag_Offset : Vector;            -- Position of flags.
         Dots        : Natural;           -- Number of augmentation dots.
         High_Ledger : High_Ledger_Array-- Ledger lines above staff.
         Low_Ledger  : Low_Ledger_Array;  -- Ledger lines below staff.
      end record;

   -- Work-around for GNAT bug.
   Chord_Box_Tag : constant String := "boxes.chords.chord_box";

end Boxes.Chords;