-- $Date: 2004/03/08 10:50:56 $
-- $Revision: 1.6 $
-- $Author: jcrocholl $
-- $Hash: ddfecbabd96488b21f8e7bb252d0944c $

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

with Ada.Tags; use Ada.Tags;
with Messages; use Messages;
with Real_Numbers; use Real_Numbers;
with Real_Vectors; use Real_Vectors;
with Font_Loaders; use Font_Loaders;
with Glyphs; use Glyphs;
with Glyph_Images; use Glyph_Images;
with PGM; use PGM;

with Strings; use Strings;

package Printers.PGM is

   -- Public representation.
   type PGM_Printer is new Printer with private;

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

   -- Pointer to representation data.
   type PGM_Printer_Access is access all PGM_Printer;

   -- Constructor for instances.
   function Create
     (Filename : in String)     -- The initial filename.
     return PGM_Printer_Access-- The newly created pgm printer.

   function Get_Format
     (This : access PGM_Printer-- The pgm printer object instance.
     return String;              -- Maximum of four characters.

   procedure Set_Bounds
     (This         : access PGM_Printer-- The pgm printer object instance.
      Bounds       : in Rectangle;       -- The new bounding box.
      Staff_Height : in Real);           -- Output zoom factor.

   procedure Print_Staff_Lines
     (This : access PGM_Printer); -- The pgm printer object instance.

   procedure Print
     (This   : access PGM_Printer-- The pgm printer object instance.
      Add    : access Glyph;       -- Add this glyph.
      Center : in Vector);         -- Center coordinates.

   procedure To_Pixels
     (This   : access PGM_Printer-- The pgm printer object instance.
      Box    : in Rectangle;       -- Convert this box.
      Left   : out Integer;        -- Horizontal minimum.
      Top    : out Integer;        -- Vertical minimum.
      Right  : out Integer;        -- Horizontal maximum.
      Bottom : out Integer);       -- Vertical maximum.

   procedure Darken_Pixel
     (This  : access PGM_Printer-- The pgm printer object instance.
      Y, X  : in Integer;         -- Darken this pixel.
      Color : in Gray_Pixel);     -- Desired color.

   procedure Frame_Box
     (This  : access PGM_Printer-- The pgm printer object instance.
      Box   : in Rectangle;       -- Box coordinates.
      Color : in Gray_Pixel);     -- Use this color.

   procedure Fill_Box
     (This  : access PGM_Printer-- The pgm printer object instance.
      Box   : in Rectangle;       -- Box coordinates.
      Color : in Gray_Pixel);     -- Use this color.

   procedure Write
     (This : access PGM_Printer); -- The pgm printer object instance.

private

   -- Private representation.
   type PGM_Printer is
     new Printer with
      record
         Image : Glyph_Image_Access-- Resulting gray raster image.
      end record;

   -- Work-around for GNAT bug.
   PGM_Printer_Tag : constant String := "printers.pgm.pgm_printer";

end Printers.PGM;