with Claw;
package Claw.Canvas.Paint is
    --
    -- CLAW - Class Library for Ada and Windows.
    --
    -- This package contains paint canvas objects and operations.
    --
    -- Copyright 1996, 1997  R.R. Software, Inc.
    -- P.O. Box 1512, Madison WI  53701
    -- All rights reserved.
    --

    pragma Elaborate_Body; -- Insure that the body is elaborated before anyone
			   -- can call CLAW.

    type Paint_Canvas_Type is new Basic_Canvas_Type with private;
	-- Implementation note: Destroy does a EndPaint on the underlying DC.

    procedure Create (Easel : in out Paint_Canvas_Type;
		      Window : in Root_Window_Type'Class);
	-- Create a Paint Canvas into Easel for Window.
	-- This routine should be called only in response to a WM_PAINT
	-- message; Paint_Canvas objects should only be created by CLAW.
	-- Raises:
	--	Not_Valid_Error if Window is not an open window.
	--	Windows_Error if Windows cannot make the canvas.

    -- Inherits all of the Choose flavors, Is_Valid, and Get_Handle.

    procedure Destroy (Easel : in out Paint_Canvas_Type);
	-- Destroy the given Canvas.
	-- Raises:
	--	Not_Valid_Error if Easel is not an open canvas.

    function Erase_Background (Easel : in Paint_Canvas_Type) return Boolean;
	-- Returns true if the application must repaint the background
	-- for Easel.
	-- Raises:
	--	Not_Valid_Error if Easel is not an open canvas.

    function Area (Easel : in Paint_Canvas_Type) return Rectangle_Type;
	-- Returns the area being repainted.
	-- Raises:
	--	Not_Valid_Error if Easel is not an open canvas.

private

    type Paint_Canvas_Type is new Basic_Canvas_Type with record
	Paint_Rec : aliased CLAW.Paint_Record;
	Wnd : Claw.Win32.HWnd;
    end record;

    procedure Finalize   (Easel : in out Paint_Canvas_Type);
	-- Finalize Canvas (for Controlled types; this routine need not
	-- be called explicitly).

end Claw.Canvas.Paint;