------------------------------------------------------------------------------
--                                                                          --
--                An Ada2005 binding to the Qt C++ framework                --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
-- Copyright © 2008-2010 Vadim Godunko <vgodunko@gmail.com>                 --
--                                                                          --
-- QtAda is free software;  you can  redistribute it and/or modify it under --
-- terms of the  GNU General Public License as published  by the Free Soft- --
-- ware  Foundation;  either version 2,  or (at your option) any later ver- --
-- sion. QtAda is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
-- for  more details.  You should have  received  a copy of the GNU General --
-- Public License distributed with QtAda;  see file COPYING.  If not, write --
-- to  the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, --
-- Boston, MA 02110-1301, USA.                                              --
--                                                                          --
-- As a special exception,  if other files  instantiate  generics from this --
-- unit, or you link  this unit with other files  to produce an executable, --
-- this  unit  does not  by itself cause  the resulting  executable  to  be --
-- covered  by the  GNU  General  Public  License.  This exception does not --
-- however invalidate  any other reasons why  the executable file  might be --
-- covered by the  GNU Public License.                                      --
--                                                                          --
------------------------------------------------------------------------------
--  $Revision: 3764 $ $Date: 2010-10-23 23:13:39 +0400 (Sat, 23 Oct 2010) $
------------------------------------------------------------------------------
private with Ada.Finalization;
with Interfaces.C;
with Qt4.Brushes;
limited with Qt4.Colors;
with Qt4.Font_Infos;
with Qt4.Font_Metrics;
with Qt4.Fonts;
limited with Qt4.Images;
limited with Qt4.Line_Fs;
limited with Qt4.Lines;
with Qt4.Matrices;
with Qt4.Paint_Devices;
with Qt4.Painter_Paths;
with Qt4.Pens;
limited with Qt4.Pixmaps;
limited with Qt4.Point_Fs;
with Qt4.Points;
limited with Qt4.Polygon_Fs;
limited with Qt4.Polygons;
with Qt4.Rect_Fs;
with Qt4.Rects;
with Qt4.Regions;
limited with Qt4.Strings;
with Qt4.Text_Options;
with Qt4.Transforms;
with Qt_Ada.Internals.Generic_Q_Flags;
private with Qt_Ada.Internals.Value_Class_Sizes;
with System;

package Qt4.Painters is

   --  QPainter::CompositionMode

   type Painter_Composition_Mode is
    (Composition_Mode_Source_Over,
     Composition_Mode_Destination_Over,
     Composition_Mode_Clear,
     Composition_Mode_Source,
     Composition_Mode_Destination,
     Composition_Mode_Source_In,
     Composition_Mode_Destination_In,
     Composition_Mode_Source_Out,
     Composition_Mode_Destination_Out,
     Composition_Mode_Source_Atop,
     Composition_Mode_Destination_Atop,
     Composition_Mode_Xor,
     Composition_Mode_Plus,
     Composition_Mode_Multiply,
     Composition_Mode_Screen,
     Composition_Mode_Overlay,
     Composition_Mode_Darken,
     Composition_Mode_Lighten,
     Composition_Mode_Color_Dodge,
     Composition_Mode_Color_Burn,
     Composition_Mode_Hard_Light,
     Composition_Mode_Soft_Light,
     Composition_Mode_Difference,
     Composition_Mode_Exclusion);
   pragma Convention (C, Painter_Composition_Mode);
   for Painter_Composition_Mode'Size use Interfaces.C.unsigned'Size;

   --  QPainter::RenderHint

   type Render_Hint is
    (Antialiasing,
     Text_Antialiasing,
     Smooth_Pixmap_Transform,
     High_Quality_Antialiasing);
   pragma Convention (C, Render_Hint);
   for Render_Hint'Size use Interfaces.C.unsigned'Size;
   for Render_Hint use
    (Antialiasing              => 1,
     Text_Antialiasing         => 2,
     Smooth_Pixmap_Transform   => 4,
     High_Quality_Antialiasing => 8);

   --  Qt::RenderHints

   package Q_Flags_Of_Render_Hint is
     new Qt_Ada.Internals.Generic_Q_Flags (Render_Hint);

   type Render_Hints is new Q_Flags_Of_Render_Hint.Flags;

   type Q_Painter is tagged limited private;

   function Create
    (Device : not null access Qt4.Paint_Devices.Q_Paint_Device'Class)
       return Q_Painter;

   function Background
    (Self : Q_Painter'Class)
       return Qt4.Brushes.Q_Brush;

   function Background_Mode
    (Self : Q_Painter'Class)
       return Qt4.BG_Mode;

   function Begin_Paint
    (Self   : not null access Q_Painter'Class;
     Device : not null access Qt4.Paint_Devices.Q_Paint_Device'Class)
       return Boolean;

   function Bounding_Rect
    (Self : not null access Q_Painter'Class;
     Rect : Qt4.Rect_Fs.Q_Rect_F'Class;
     Text : Qt4.Strings.Q_String'Class;
     Option : Qt4.Text_Options.Q_Text_Option'Class)
       return Qt4.Rect_Fs.Q_Rect_F;

   function Brush
    (Self : Q_Painter'Class)
       return Qt4.Brushes.Q_Brush;

   function Brush_Origin
    (Self : Q_Painter'Class)
       return Qt4.Points.Q_Point;

   function Clip_Path
    (Self : Q_Painter'Class)
       return Qt4.Painter_Paths.Q_Painter_Path;

   function Clip_Region
    (Self : Q_Painter'Class)
       return Qt4.Regions.Q_Region;

   function Combined_Matrix
    (Self : Q_Painter'Class)
       return Qt4.Matrices.Q_Matrix;

   function Combined_Transform
    (Self : Q_Painter'Class)
       return Qt4.Transforms.Q_Transform;

   function Composition_Mode
    (Self : Q_Painter'Class)
       return Painter_Composition_Mode;

   function Device_Matrix
    (Self : Q_Painter'Class)
       return Qt4.Matrices.Q_Matrix;

   function Device_Transform
    (Self : Q_Painter'Class)
       return Qt4.Transforms.Q_Transform;

   procedure Draw_Arc
    (Self : in out Q_Painter'Class;
     Rect : Qt4.Rect_Fs.Q_Rect_F'Class;
     Start_Angle : Qt4.Q_Integer;
     Span_Angle : Qt4.Q_Integer);

   procedure Draw_Arc
    (Self : in out Q_Painter'Class;
     Rect : Qt4.Rects.Q_Rect'Class;
     Start_Angle : Qt4.Q_Integer;
     Span_Angle : Qt4.Q_Integer);

   procedure Draw_Arc
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Width : Qt4.Q_Integer;
     Height : Qt4.Q_Integer;
     Start_Angle : Qt4.Q_Integer;
     Span_Angle : Qt4.Q_Integer);

   procedure Draw_Chord
    (Self : in out Q_Painter'Class;
     Rect : Qt4.Rect_Fs.Q_Rect_F'Class;
     Start_Angle : Qt4.Q_Integer;
     Span_Angle : Qt4.Q_Integer);

   procedure Draw_Chord
    (Self : in out Q_Painter'Class;
     Rect : Qt4.Rects.Q_Rect'Class;
     Start_Angle : Qt4.Q_Integer;
     Span_Angle : Qt4.Q_Integer);

   procedure Draw_Chord
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Width : Qt4.Q_Integer;
     Height : Qt4.Q_Integer;
     Start_Angle : Qt4.Q_Integer;
     Span_Angle : Qt4.Q_Integer);

   procedure Draw_Convex_Polygon
    (Self : in out Q_Painter'Class;
     Polygon : Qt4.Polygon_Fs.Q_Polygon_F'Class);

   procedure Draw_Convex_Polygon
    (Self : in out Q_Painter'Class;
     Polygon : Qt4.Polygons.Q_Polygon'Class);

   procedure Draw_Ellipse
    (Self : in out Q_Painter'Class;
     R : Qt4.Rect_Fs.Q_Rect_F'Class);

   procedure Draw_Ellipse
    (Self : in out Q_Painter'Class;
     R : Qt4.Rects.Q_Rect'Class);

   procedure Draw_Ellipse
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Width : Qt4.Q_Integer;
     Height : Qt4.Q_Integer);

   procedure Draw_Image
    (Self : in out Q_Painter'Class;
     Target : Qt4.Rect_Fs.Q_Rect_F'Class;
     Image : Qt4.Images.Q_Image'Class;
     Source : Qt4.Rect_Fs.Q_Rect_F'Class;
     Flags : Qt4.Image_Conversion_Flags
       := Qt4.Auto_Color);

   procedure Draw_Image
    (Self : in out Q_Painter'Class;
     Target : Qt4.Rects.Q_Rect'Class;
     Image : Qt4.Images.Q_Image'Class;
     Source : Qt4.Rects.Q_Rect'Class;
     Flags : Qt4.Image_Conversion_Flags
       := Qt4.Auto_Color);

   procedure Draw_Image
    (Self : in out Q_Painter'Class;
     Point : Qt4.Point_Fs.Q_Point_F'Class;
     Image : Qt4.Images.Q_Image'Class);

   procedure Draw_Image
    (Self : in out Q_Painter'Class;
     Point : Qt4.Points.Q_Point'Class;
     Image : Qt4.Images.Q_Image'Class);

   procedure Draw_Image
    (Self : in out Q_Painter'Class;
     Point : Qt4.Point_Fs.Q_Point_F'Class;
     Image : Qt4.Images.Q_Image'Class;
     Source : Qt4.Rect_Fs.Q_Rect_F'Class;
     Flags : Qt4.Image_Conversion_Flags
       := Qt4.Auto_Color);

   procedure Draw_Image
    (Self : in out Q_Painter'Class;
     Point : Qt4.Points.Q_Point'Class;
     Image : Qt4.Images.Q_Image'Class;
     Source : Qt4.Rects.Q_Rect'Class;
     Flags : Qt4.Image_Conversion_Flags
       := Qt4.Auto_Color);

   procedure Draw_Image
    (Self : in out Q_Painter'Class;
     Rectangle : Qt4.Rect_Fs.Q_Rect_F'Class;
     Image : Qt4.Images.Q_Image'Class);

   procedure Draw_Image
    (Self : in out Q_Painter'Class;
     Rectangle : Qt4.Rects.Q_Rect'Class;
     Image : Qt4.Images.Q_Image'Class);

   procedure Draw_Image
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Image : Qt4.Images.Q_Image'Class;
     Sx : Qt4.Q_Integer
       := 0;
     Sy : Qt4.Q_Integer
       := 0;
     Sw : Qt4.Q_Integer
       := -1;
     Sh : Qt4.Q_Integer
       := -1;
     Flags : Qt4.Image_Conversion_Flags
       := Qt4.Auto_Color);

   procedure Draw_Line
    (Self : in out Q_Painter'Class;
     Line : Qt4.Line_Fs.Q_Line_F'Class);

   procedure Draw_Line
    (Self : in out Q_Painter'Class;
     Line : Qt4.Lines.Q_Line'Class);

   procedure Draw_Line
    (Self : in out Q_Painter'Class;
     P_1 : Qt4.Points.Q_Point'Class;
     P_2 : Qt4.Points.Q_Point'Class);

   procedure Draw_Line
    (Self : in out Q_Painter'Class;
     P_1 : Qt4.Point_Fs.Q_Point_F'Class;
     P_2 : Qt4.Point_Fs.Q_Point_F'Class);

   procedure Draw_Line
    (Self : in out Q_Painter'Class;
     X_1 : Qt4.Q_Integer;
     Y_1 : Qt4.Q_Integer;
     X_2 : Qt4.Q_Integer;
     Y_2 : Qt4.Q_Integer);

   procedure Draw_Path
    (Self : in out Q_Painter'Class;
     Path : Qt4.Painter_Paths.Q_Painter_Path'Class);

   procedure Draw_Pie
    (Self : in out Q_Painter'Class;
     Rect : Qt4.Rect_Fs.Q_Rect_F'Class;
     Start_Angle : Qt4.Q_Integer;
     Span_Angle : Qt4.Q_Integer);

   procedure Draw_Pie
    (Self : in out Q_Painter'Class;
     Rect : Qt4.Rects.Q_Rect'Class;
     Start_Angle : Qt4.Q_Integer;
     Span_Angle : Qt4.Q_Integer);

   procedure Draw_Pie
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Width : Qt4.Q_Integer;
     Height : Qt4.Q_Integer;
     Start_Angle : Qt4.Q_Integer;
     Span_Angle : Qt4.Q_Integer);

   procedure Draw_Pixmap
    (Self : in out Q_Painter'Class;
     Target_Rect : Qt4.Rect_Fs.Q_Rect_F'Class;
     Pixmap : Qt4.Pixmaps.Q_Pixmap'Class;
     Source_Rect : Qt4.Rect_Fs.Q_Rect_F'Class);

   procedure Draw_Pixmap
    (Self : in out Q_Painter'Class;
     Target_Rect : Qt4.Rects.Q_Rect'Class;
     Pixmap : Qt4.Pixmaps.Q_Pixmap'Class;
     Source_Rect : Qt4.Rects.Q_Rect'Class);

   procedure Draw_Pixmap
    (Self : in out Q_Painter'Class;
     Point : Qt4.Point_Fs.Q_Point_F'Class;
     Pixmap : Qt4.Pixmaps.Q_Pixmap'Class;
     Source : Qt4.Rect_Fs.Q_Rect_F'Class);

   procedure Draw_Pixmap
    (Self : in out Q_Painter'Class;
     Point : Qt4.Points.Q_Point'Class;
     Pixmap : Qt4.Pixmaps.Q_Pixmap'Class;
     Source : Qt4.Rects.Q_Rect'Class);

   procedure Draw_Pixmap
    (Self : in out Q_Painter'Class;
     Point : Qt4.Point_Fs.Q_Point_F'Class;
     Pixmap : Qt4.Pixmaps.Q_Pixmap'Class);

   procedure Draw_Pixmap
    (Self : in out Q_Painter'Class;
     Point : Qt4.Points.Q_Point'Class;
     Pixmap : Qt4.Pixmaps.Q_Pixmap'Class);

   procedure Draw_Pixmap
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Pixmap : Qt4.Pixmaps.Q_Pixmap'Class);

   procedure Draw_Pixmap
    (Self : in out Q_Painter'Class;
     Rectangle : Qt4.Rects.Q_Rect'Class;
     Pixmap : Qt4.Pixmaps.Q_Pixmap'Class);

   procedure Draw_Pixmap
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     W : Qt4.Q_Integer;
     H : Qt4.Q_Integer;
     Pixmap : Qt4.Pixmaps.Q_Pixmap'Class);

   procedure Draw_Pixmap
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     W : Qt4.Q_Integer;
     H : Qt4.Q_Integer;
     Pixmap : Qt4.Pixmaps.Q_Pixmap'Class;
     Sx : Qt4.Q_Integer;
     Sy : Qt4.Q_Integer;
     Sw : Qt4.Q_Integer;
     Sh : Qt4.Q_Integer);

   procedure Draw_Pixmap
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Pixmap : Qt4.Pixmaps.Q_Pixmap'Class;
     Sx : Qt4.Q_Integer;
     Sy : Qt4.Q_Integer;
     Sw : Qt4.Q_Integer;
     Sh : Qt4.Q_Integer);

   procedure Draw_Point
    (Self : in out Q_Painter'Class;
     Position : Qt4.Point_Fs.Q_Point_F'Class);

   procedure Draw_Point
    (Self : in out Q_Painter'Class;
     Position : Qt4.Points.Q_Point'Class);

   procedure Draw_Point
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer);

   procedure Draw_Points
    (Self : in out Q_Painter'Class;
     Points : Qt4.Polygon_Fs.Q_Polygon_F'Class);

   procedure Draw_Points
    (Self : in out Q_Painter'Class;
     Points : Qt4.Polygons.Q_Polygon'Class);

   procedure Draw_Polygon
    (Self : in out Q_Painter'Class;
     Polygon : Qt4.Polygon_Fs.Q_Polygon_F'Class;
     Fill_Rule : Qt4.Fill_Rule
       := Odd_Even_Fill);

   procedure Draw_Polygon
    (Self : in out Q_Painter'Class;
     Polygon : Qt4.Polygons.Q_Polygon'Class;
     Fill_Rule : Qt4.Fill_Rule
       := Odd_Even_Fill);

   procedure Draw_Polyline
    (Self : in out Q_Painter'Class;
     Points : Qt4.Polygon_Fs.Q_Polygon_F'Class);

   procedure Draw_Polyline
    (Self : in out Q_Painter'Class;
     Points : Qt4.Polygons.Q_Polygon'Class);

   procedure Draw_Rect
    (Self : in out Q_Painter'Class;
     Rect : Qt4.Rect_Fs.Q_Rect_F'Class);

   procedure Draw_Rect
    (Self : in out Q_Painter'Class;
     Rect : Qt4.Rects.Q_Rect'Class);

   procedure Draw_Rect
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Width : Qt4.Q_Integer;
     Height : Qt4.Q_Integer);

   procedure Draw_Round_Rect
    (Self : in out Q_Painter'Class;
     Rect : Qt4.Rect_Fs.Q_Rect_F'Class;
     Xround : Qt4.Q_Integer
       := 25;
     Yround : Qt4.Q_Integer
       := 25);

   procedure Draw_Round_Rect
    (Self : in out Q_Painter'Class;
     Rect : Qt4.Rects.Q_Rect'Class;
     Xround : Qt4.Q_Integer
       := 25;
     Yround : Qt4.Q_Integer
       := 25);

   procedure Draw_Round_Rect
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Width : Qt4.Q_Integer;
     Height : Qt4.Q_Integer;
     Xround : Qt4.Q_Integer
       := 25;
     Yround : Qt4.Q_Integer
       := 25);

   procedure Draw_Text
    (Self : in out Q_Painter'Class;
     Position : Qt4.Point_Fs.Q_Point_F'Class;
     Text : Qt4.Strings.Q_String'Class);

   procedure Draw_Text
    (Self : in out Q_Painter'Class;
     Position : Qt4.Points.Q_Point'Class;
     Text : Qt4.Strings.Q_String'Class);

   procedure Draw_Text
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Text : Qt4.Strings.Q_String'Class);

   procedure Draw_Text
    (Self : in out Q_Painter'Class;
     Rectangle : Qt4.Rect_Fs.Q_Rect_F'Class;
     Text : Qt4.Strings.Q_String'Class;
     Option : Qt4.Text_Options.Q_Text_Option'Class
       := Qt4.Text_Options.Create);

   procedure Draw_Text
    (Self      : in out Q_Painter'Class;
     Rectangle : Qt4.Rects.Q_Rect'Class;
     Flags     : Qt4.Alignment;
     Text      : Qt4.Strings.Q_String'Class);

   procedure Draw_Tiled_Pixmap
    (Self : in out Q_Painter'Class;
     Rectangle : Qt4.Rect_Fs.Q_Rect_F'Class;
     Pixmap : Qt4.Pixmaps.Q_Pixmap'Class;
     Position : Qt4.Point_Fs.Q_Point_F'Class);

   procedure Draw_Tiled_Pixmap
    (Self : in out Q_Painter'Class;
     Rectangle : Qt4.Rects.Q_Rect'Class;
     Pixmap : Qt4.Pixmaps.Q_Pixmap'Class;
     Position : Qt4.Points.Q_Point'Class);

   procedure Draw_Tiled_Pixmap
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Width : Qt4.Q_Integer;
     Height : Qt4.Q_Integer;
     Pixmap : Qt4.Pixmaps.Q_Pixmap'Class;
     Sx : Qt4.Q_Integer
       := 0;
     Sy : Qt4.Q_Integer
       := 0);

   function End_Paint
    (Self : not null access Q_Painter'Class)
       return Boolean;

   procedure Erase_Rect
    (Self : in out Q_Painter'Class;
     Rectangle : Qt4.Rect_Fs.Q_Rect_F'Class);

   procedure Erase_Rect
    (Self : in out Q_Painter'Class;
     Rectangle : Qt4.Rects.Q_Rect'Class);

   procedure Erase_Rect
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Width : Qt4.Q_Integer;
     Height : Qt4.Q_Integer);

   procedure Fill_Path
    (Self : in out Q_Painter'Class;
     Path : Qt4.Painter_Paths.Q_Painter_Path'Class;
     Brush : Qt4.Brushes.Q_Brush'Class);

   procedure Fill_Rect
    (Self : in out Q_Painter'Class;
     Rectangle : Qt4.Rect_Fs.Q_Rect_F'Class;
     Brush : Qt4.Brushes.Q_Brush'Class);

   procedure Fill_Rect
    (Self : in out Q_Painter'Class;
     Rectangle : Qt4.Rects.Q_Rect'Class;
     Brush : Qt4.Brushes.Q_Brush'Class);

   procedure Fill_Rect
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Width : Qt4.Q_Integer;
     Height : Qt4.Q_Integer;
     Brush : Qt4.Brushes.Q_Brush'Class);

   function Font
    (Self : Q_Painter'Class)
       return Qt4.Fonts.Q_Font;

   function Font_Info
    (Self : Q_Painter'Class)
       return Qt4.Font_Infos.Q_Font_Info;

   function Font_Metrics
    (Self : Q_Painter'Class)
       return Qt4.Font_Metrics.Q_Font_Metrics;

   function Has_Clipping
    (Self : Q_Painter'Class)
       return Boolean;

   function Is_Active
    (Self : Q_Painter'Class)
       return Boolean;

   function Layout_Direction
    (Self : Q_Painter'Class)
       return Qt4.Layout_Direction;

   function Matrix
    (Self : Q_Painter'Class)
       return Qt4.Matrices.Q_Matrix;

   function Matrix_Enabled
    (Self : Q_Painter'Class)
       return Boolean;

   function Opacity
    (Self : Q_Painter'Class)
       return Qt4.Q_Real;

   function Pen
    (Self : Q_Painter'Class)
       return Qt4.Pens.Q_Pen;

   procedure Reset_Matrix
    (Self : in out Q_Painter'Class);

   procedure Reset_Transform
    (Self : in out Q_Painter'Class);

   procedure Restore
    (Self : in out Q_Painter'Class);

   procedure Rotate
    (Self : in out Q_Painter'Class;
     Angle : Qt4.Q_Real);

   procedure Save
    (Self : in out Q_Painter'Class);

   procedure Scale
    (Self : in out Q_Painter'Class;
     Sx : Qt4.Q_Real;
     Sy : Qt4.Q_Real);

   procedure Set_Background
    (Self : in out Q_Painter'Class;
     Brush : Qt4.Brushes.Q_Brush'Class);

   procedure Set_Background_Mode
    (Self : in out Q_Painter'Class;
     Mode : Qt4.BG_Mode);

   procedure Set_Brush
    (Self : in out Q_Painter'Class;
     Brush : Qt4.Brushes.Q_Brush'Class);

   procedure Set_Brush
    (Self : in out Q_Painter'Class;
     Style : Qt4.Brush_Style);

   procedure Set_Brush_Origin
    (Self : in out Q_Painter'Class;
     Position : Qt4.Point_Fs.Q_Point_F'Class);

   procedure Set_Brush_Origin
    (Self : in out Q_Painter'Class;
     Position : Qt4.Points.Q_Point'Class);

   procedure Set_Brush_Origin
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer);

   procedure Set_Clip_Path
    (Self : in out Q_Painter'Class;
     Path : Qt4.Painter_Paths.Q_Painter_Path'Class;
     Operation : Qt4.Clip_Operation
       := Replace_Clip);

   procedure Set_Clip_Rect
    (Self : in out Q_Painter'Class;
     Rectangle : Qt4.Rect_Fs.Q_Rect_F'Class;
     Operation : Qt4.Clip_Operation
       := Replace_Clip);

   procedure Set_Clip_Rect
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Width : Qt4.Q_Integer;
     Height : Qt4.Q_Integer;
     Operation : Qt4.Clip_Operation
       := Replace_Clip);

   procedure Set_Clip_Rect
    (Self : in out Q_Painter'Class;
     Rectangle : Qt4.Rects.Q_Rect'Class;
     Operation : Qt4.Clip_Operation
       := Replace_Clip);

   procedure Set_Clip_Region
    (Self : in out Q_Painter'Class;
     Region : Qt4.Regions.Q_Region'Class;
     Operation : Qt4.Clip_Operation
       := Replace_Clip);

   procedure Set_Clipping
    (Self : in out Q_Painter'Class;
     Enable : Boolean);

   procedure Set_Composition_Mode
    (Self : in out Q_Painter'Class;
     Mode : Painter_Composition_Mode);

   procedure Set_Font
    (Self : in out Q_Painter'Class;
     Font : Qt4.Fonts.Q_Font'Class);

   procedure Set_Layout_Direction
    (Self : in out Q_Painter'Class;
     Direction : Qt4.Layout_Direction);

   procedure Set_Opacity
    (Self : in out Q_Painter'Class;
     Opacity : Qt4.Q_Real);

   procedure Set_Pen
    (Self : in out Q_Painter'Class;
     Pen : Qt4.Pens.Q_Pen'Class);

   procedure Set_Pen
    (Self : in out Q_Painter'Class;
     Color : Qt4.Colors.Q_Color'Class);

   procedure Set_Pen
    (Self : in out Q_Painter'Class;
     Style : Qt4.Pen_Style);

   procedure Set_Render_Hint
    (Self : in out Q_Painter'Class;
     Hint : Render_Hint;
     Enable : Boolean
       := True);

   procedure Set_Matrix
    (Self : in out Q_Painter'Class;
     Matrix : Qt4.Matrices.Q_Matrix'Class;
     Combine : Boolean
       := False);

   procedure Set_Matrix_Enabled
    (Self : in out Q_Painter'Class;
     Enable : Boolean);

   procedure Set_Transform
    (Self : in out Q_Painter'Class;
     Transform : Qt4.Transforms.Q_Transform'Class;
     Combine : Boolean
       := False);

   procedure Set_View_Transform_Enabled
    (Self : in out Q_Painter'Class;
     Enable : Boolean);

   procedure Set_Viewport
    (Self : in out Q_Painter'Class;
     Viewport : Qt4.Rects.Q_Rect'Class);

   procedure Set_Viewport
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Width : Qt4.Q_Integer;
     Height : Qt4.Q_Integer);

   procedure Set_Window
    (Self : in out Q_Painter'Class;
     Window : Qt4.Rects.Q_Rect'Class);

   procedure Set_Window
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Width : Qt4.Q_Integer;
     Height : Qt4.Q_Integer);

   procedure Set_World_Matrix
    (Self : in out Q_Painter'Class;
     Matrix : Qt4.Matrices.Q_Matrix'Class;
     Combine : Boolean
       := False);

   procedure Set_World_Matrix_Enabled
    (Self : in out Q_Painter'Class;
     Enable : Boolean);

   procedure Set_World_Transform
    (Self : in out Q_Painter'Class;
     Matrix : Qt4.Transforms.Q_Transform'Class;
     Combine : Boolean
       := False);

   procedure Shear
    (Self : in out Q_Painter'Class;
     Sh : Qt4.Q_Real;
     Sv : Qt4.Q_Real);

   procedure Stroke_Path
    (Self : in out Q_Painter'Class;
     Path : Qt4.Painter_Paths.Q_Painter_Path'Class;
     Pen : Qt4.Pens.Q_Pen'Class);

   function Test_Render_Hint
    (Self : Q_Painter'Class;
     Hint : Render_Hint)
       return Boolean;

   function Transform
    (Self : Q_Painter'Class)
       return Qt4.Transforms.Q_Transform;

   procedure Translate
    (Self : in out Q_Painter'Class;
     Offset : Qt4.Point_Fs.Q_Point_F'Class);

   procedure Translate
    (Self : in out Q_Painter'Class;
     Offset : Qt4.Points.Q_Point'Class);

   procedure Translate
    (Self : in out Q_Painter'Class;
     Dx : Qt4.Q_Real;
     Dy : Qt4.Q_Real);

   function View_Transform_Enabled
    (Self : Q_Painter'Class)
       return Boolean;

   function Viewport
    (Self : Q_Painter'Class)
       return Qt4.Rects.Q_Rect;

   function Window
    (Self : Q_Painter'Class)
       return Qt4.Rects.Q_Rect;

   function World_Matrix
    (Self : Q_Painter'Class)
       return Qt4.Matrices.Q_Matrix;

   function World_Matrix_Enabled
    (Self : Q_Painter'Class)
       return Boolean;

   function World_Transform
    (Self : Q_Painter'Class)
       return Qt4.Transforms.Q_Transform;

   package Internals is

      type QPainter is private;

      type QPainter_Access is access all QPainter;
      pragma Convention (C, QPainter_Access);

      function QPainter_View
       (Item : Q_Painter'Class)
          return QPainter_Access;
      pragma Inline (QPainter_View);

      function To_Pointer
       (Address : System.Address)
          return QPainter_Access;
      pragma Inline (To_Pointer);

      function To_Address
       (Pointer : QPainter_Access)
          return System.Address;
      pragma Inline (To_Address);

      function Create_Wrapper
       (Item : Internals.QPainter_Access)
          return Q_Painter;

   private

      type QPainter is record
         Placeholder : Interfaces.C.char_array (1 .. Qt_Ada.Internals.Value_Class_Sizes.QPainter_C_Size_Of);
      end record;
      pragma Convention (C, QPainter);

   end Internals;

private

   type Q_Painter is new Ada.Finalization.Limited_Controlled with record
      Storage : aliased Internals.QPainter;
      Object  : Internals.QPainter_Access := null;
      Wrapper : Boolean := False;
   end record;

   overriding
   procedure Finalize (Self : in out Q_Painter);

   overriding
   procedure Initialize (Self : in out Q_Painter);

end Qt4.Painters;
