with Claw;
package Claw.Brushes is
--
-- CLAW - Class Library for Ada and Windows.
--
-- This package contains brush objects and operations.
--
-- Copyright 1996, 1997 R.R. Software, Inc.
-- P.O. Box 1512, Madison WI 53701
-- All rights reserved.
--
-- Simplified for Demo.
type Brush_Type is new Claw.Root_Tool_Type with private;
-- Normally one would declare objects like
-- Broad_Brush : constant Brush_Type := Create(...);
type Stock_Type is (White, Light_Gray, Gray, Dark_Gray,
Black, Null_Brush);
for Stock_Type use (White => 0, Light_Gray => 1, Gray => 2,
Dark_Gray => 3, Black => 4, Null_Brush => 5);
type Hatch_Type is (Horizontal, Vertical, Forward_Diagonal, Backward_Diagonal,
Cross, Diagonal_Cross, Forward_Diagonal_1, Backward_Diagonal_1, Solid,
Dense1, Dense2, Dense3, Dense4, Dense5, Dense6, Dense7, Dense8,
No_Shade, Halftone, Solid_Color, Dithered_Color, Solid_Text_Color,
Dithered_Text_Color, Solid_Background_Color, Dithered_Background_Color);
for Hatch_Type use (Horizontal => 0, Vertical => 1, Forward_Diagonal => 2,
Backward_Diagonal => 3, Cross => 4, Diagonal_Cross => 5,
Forward_Diagonal_1 => 6, Backward_Diagonal_1 => 7, Solid => 8,
Dense1 => 9, Dense2 => 10, Dense3 => 11, Dense4 => 12, Dense5 => 13,
Dense6 => 14, Dense7 => 15, Dense8 => 16, No_Shade => 17, Halftone => 18,
Solid_Color => 19, Dithered_Color => 20, Solid_Text_Color => 21,
Dithered_Text_Color => 22, Solid_Background_Color => 23,
Dithered_Background_Color => 24);
function Create (Stock : in Stock_Type) return Brush_Type;
-- Create a Brush Object for the specified stock brush.
-- Raises:
-- Windows_Error if Windows returns an error.
function Create (Color : in Claw.Colors.Color_Type) return Brush_Type;
-- Create a solid Brush Object with the specified color.
-- Raises:
-- Windows_Error if Windows returns an error.
function Create (Hatch : in Hatch_Type;
Color : in Claw.Colors.Color_Type) return Brush_Type;
-- Create a hatched Brush Object with the specified color.
-- Raises:
-- Windows_Error if Windows returns an error.
procedure Destroy (Brush : in out Brush_Type);
-- Destroy a Brush object, deselecting it from any Canvases it is
-- in use in. The Brush object will be invalid after this call.
-- Raises:
-- Not_Valid_Error if the Brush is not valid.
-- Windows_Error if Windows returns an error.
procedure Initialize (Brush : in out Brush_Type);
-- Initialize Brush (for Controlled types; this routine need not
-- be called explicitly).
procedure Adjust (Brush : in out Brush_Type);
-- Adjust Brush (for Controlled types; this routine need not
-- be called explicitly).
procedure Finalize (Brush : in out Brush_Type);
-- Finalize Brush (for Controlled types; this routine need not
-- be called explicitly).
function Get_Handle (Brush : in Brush_Type) return Claw.Win32.HBrush;
-- Returns the Brush handle for Brush.
-- Use this to get a handle in order to directly call the Win32 API.
-- Use of this routine is discouraged.
-- Raises:
-- Not_Valid_Error if Brush does not have a valid (Windows) Brush.
private
type Brush_Type is new Claw.Root_Tool_Type with record
Is_Stock : Boolean := False;
end record;
end Claw.Brushes;