------------------------------------------------------------------------------
--                                                                          --
--                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: 3784 $ $Date: 2010-10-27 01:42:11 +0400 (Wed, 27 Oct 2010) $
------------------------------------------------------------------------------
pragma Style_Checks ("M32766");
with Qt4.Colors;
with Qt4.Images;
with Qt4.Line_Fs;
with Qt4.Lines;
with Qt4.Pixmaps;
with Qt4.Point_Fs;
with Qt4.Polygon_Fs;
with Qt4.Polygons;
with Qt4.Strings;
with Qt_Ada.Internals.Boolean_Conversions;
with Qt_Ada.Internals.Paint_Devices;
with System.Address_To_Access_Conversions;

package body Qt4.Painters is

   function initialize_QPainter
    (Storage : System.Address)
      return Internals.QPainter_Access;
   pragma Import (C, initialize_QPainter, "__QtAda_inititialize_QPainter");

   function initialize_QPainter_QPaintDevice
    (Storage : System.Address;
     Device  : not null access Qt_Ada.Internals.Paint_Devices.QPaintDevice)
      return Internals.QPainter_Access;
   pragma Import (C, initialize_QPainter_QPaintDevice, "__QtAda_inititialize_QPainter_QPaintDevice");

   procedure finalize_QPainter (Object : Internals.QPainter_Access);
   pragma Import (C, finalize_QPainter, "__QtAda_finalize_QPainter");

   procedure QPainter_background
    (Returns : Qt4.Brushes.Internals.QBrush_Access;
     Self : Internals.QPainter_Access);
   pragma Import (C, QPainter_background, "__QtAda_QPainter_background_Q");

   function QPainter_backgroundMode
    (Self : Internals.QPainter_Access)
       return Qt4.BG_Mode;
   pragma Import (C, QPainter_backgroundMode, "__QtAda_QPainter_backgroundMode_Q");

   function QPainter_begin
    (Self : Internals.QPainter_Access;
     Device  : not null access Qt_Ada.Internals.Paint_Devices.QPaintDevice)
       return Interfaces.C.unsigned;
   pragma Import (C, QPainter_begin, "__QtAda_QPainter_begin_QPaintDevice");

   procedure QPainter_boundingRect_QRectFCR_QStringCR_QTextOptionCR
    (Returns : Qt4.Rect_Fs.Internals.QRectF_Access;
     Self : Internals.QPainter_Access;
     Rect : Qt4.Rect_Fs.Internals.QRectF_Access;
     Text : Qt4.Strings.Internals.QString_Access;
     Option : Qt4.Text_Options.Internals.QTextOption_Access);
   pragma Import (C, QPainter_boundingRect_QRectFCR_QStringCR_QTextOptionCR, "__QtAda_QPainter_boundingRect_QRectFCR_QStringCR_QTextOptionCR");

   procedure QPainter_brush
    (Returns : Qt4.Brushes.Internals.QBrush_Access;
     Self : Internals.QPainter_Access);
   pragma Import (C, QPainter_brush, "__QtAda_QPainter_brush_Q");

   procedure QPainter_brushOrigin
    (Returns : Qt4.Points.Internals.QPoint_Access;
     Self : Internals.QPainter_Access);
   pragma Import (C, QPainter_brushOrigin, "__QtAda_QPainter_brushOrigin_Q");

   procedure QPainter_clipPath
    (Returns : Qt4.Painter_Paths.Internals.QPainterPath_Access;
     Self : Internals.QPainter_Access);
   pragma Import (C, QPainter_clipPath, "__QtAda_QPainter_clipPath_Q");

   procedure QPainter_clipRegion
    (Returns : Qt4.Regions.Internals.QRegion_Access;
     Self : Internals.QPainter_Access);
   pragma Import (C, QPainter_clipRegion, "__QtAda_QPainter_clipRegion_Q");

   procedure QPainter_combinedMatrix
    (Returns : Qt4.Matrices.Internals.QMatrix_Access;
     Self : Internals.QPainter_Access);
   pragma Import (C, QPainter_combinedMatrix, "__QtAda_QPainter_combinedMatrix_Q");

   procedure QPainter_combinedTransform
    (Returns : Qt4.Transforms.Internals.QTransform_Access;
     Self : Internals.QPainter_Access);
   pragma Import (C, QPainter_combinedTransform, "__QtAda_QPainter_combinedTransform_Q");

   function QPainter_compositionMode
    (Self : Internals.QPainter_Access)
       return Painter_Composition_Mode;
   pragma Import (C, QPainter_compositionMode, "__QtAda_QPainter_compositionMode_Q");

   procedure QPainter_deviceMatrix
    (Returns : Qt4.Matrices.Internals.QMatrix_Access;
     Self : Internals.QPainter_Access);
   pragma Import (C, QPainter_deviceMatrix, "__QtAda_QPainter_deviceMatrix_Q");

   procedure QPainter_deviceTransform
    (Returns : Qt4.Transforms.Internals.QTransform_Access;
     Self : Internals.QPainter_Access);
   pragma Import (C, QPainter_deviceTransform, "__QtAda_QPainter_deviceTransform_Q");

   procedure QPainter_drawArc_QRectFCR_int_int
    (Self : Internals.QPainter_Access;
     Rect : Qt4.Rect_Fs.Internals.QRectF_Access;
     Start_Angle : Qt4.Q_Integer;
     Span_Angle : Qt4.Q_Integer);
   pragma Import (C, QPainter_drawArc_QRectFCR_int_int, "__QtAda_QPainter_drawArc_QRectFCR_int_int");

   procedure QPainter_drawArc_QRectCR_int_int
    (Self : Internals.QPainter_Access;
     Rect : Qt4.Rects.Internals.QRect_Access;
     Start_Angle : Qt4.Q_Integer;
     Span_Angle : Qt4.Q_Integer);
   pragma Import (C, QPainter_drawArc_QRectCR_int_int, "__QtAda_QPainter_drawArc_QRectCR_int_int");

   procedure QPainter_drawArc_int_int_int_int_int_int
    (Self : Internals.QPainter_Access;
     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);
   pragma Import (C, QPainter_drawArc_int_int_int_int_int_int, "__QtAda_QPainter_drawArc_int_int_int_int_int_int");

   procedure QPainter_drawChord_QRectFCR_int_int
    (Self : Internals.QPainter_Access;
     Rect : Qt4.Rect_Fs.Internals.QRectF_Access;
     Start_Angle : Qt4.Q_Integer;
     Span_Angle : Qt4.Q_Integer);
   pragma Import (C, QPainter_drawChord_QRectFCR_int_int, "__QtAda_QPainter_drawChord_QRectFCR_int_int");

   procedure QPainter_drawChord_QRectCR_int_int
    (Self : Internals.QPainter_Access;
     Rect : Qt4.Rects.Internals.QRect_Access;
     Start_Angle : Qt4.Q_Integer;
     Span_Angle : Qt4.Q_Integer);
   pragma Import (C, QPainter_drawChord_QRectCR_int_int, "__QtAda_QPainter_drawChord_QRectCR_int_int");

   procedure QPainter_drawChord_int_int_int_int_int_int
    (Self : Internals.QPainter_Access;
     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);
   pragma Import (C, QPainter_drawChord_int_int_int_int_int_int, "__QtAda_QPainter_drawChord_int_int_int_int_int_int");

   procedure QPainter_drawConvexPolygon_QPolygonFCR
    (Self : Internals.QPainter_Access;
     Polygon : Qt4.Polygon_Fs.Internals.QPolygonF_Access);
   pragma Import (C, QPainter_drawConvexPolygon_QPolygonFCR, "__QtAda_QPainter_drawConvexPolygon_QPolygonFCR");

   procedure QPainter_drawConvexPolygon_QPolygonCR
    (Self : Internals.QPainter_Access;
     Polygon : Qt4.Polygons.Internals.QPolygon_Access);
   pragma Import (C, QPainter_drawConvexPolygon_QPolygonCR, "__QtAda_QPainter_drawConvexPolygon_QPolygonCR");

   procedure QPainter_drawEllipse_QRectFCR
    (Self : Internals.QPainter_Access;
     R : Qt4.Rect_Fs.Internals.QRectF_Access);
   pragma Import (C, QPainter_drawEllipse_QRectFCR, "__QtAda_QPainter_drawEllipse_QRectFCR");

   procedure QPainter_drawEllipse_QRectCR
    (Self : Internals.QPainter_Access;
     R : Qt4.Rects.Internals.QRect_Access);
   pragma Import (C, QPainter_drawEllipse_QRectCR, "__QtAda_QPainter_drawEllipse_QRectCR");

   procedure QPainter_drawEllipse_int_int_int_int
    (Self : Internals.QPainter_Access;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Width : Qt4.Q_Integer;
     Height : Qt4.Q_Integer);
   pragma Import (C, QPainter_drawEllipse_int_int_int_int, "__QtAda_QPainter_drawEllipse_int_int_int_int");

   procedure QPainter_drawImage_QRectFCR_QImageCR_QRectFCR_Qt_ImageConversionFlags
    (Self : Internals.QPainter_Access;
     Target : Qt4.Rect_Fs.Internals.QRectF_Access;
     Image : Qt4.Images.Internals.QImage_Access;
     Source : Qt4.Rect_Fs.Internals.QRectF_Access;
     Flags : Qt4.Image_Conversion_Flags);
   pragma Import (C, QPainter_drawImage_QRectFCR_QImageCR_QRectFCR_Qt_ImageConversionFlags, "__QtAda_QPainter_drawImage_QRectFCR_QImageCR_QRectFCR_Qt_ImageConversionFlags");

   procedure QPainter_drawImage_QRectCR_QImageCR_QRectCR_Qt_ImageConversionFlags
    (Self : Internals.QPainter_Access;
     Target : Qt4.Rects.Internals.QRect_Access;
     Image : Qt4.Images.Internals.QImage_Access;
     Source : Qt4.Rects.Internals.QRect_Access;
     Flags : Qt4.Image_Conversion_Flags);
   pragma Import (C, QPainter_drawImage_QRectCR_QImageCR_QRectCR_Qt_ImageConversionFlags, "__QtAda_QPainter_drawImage_QRectCR_QImageCR_QRectCR_Qt_ImageConversionFlags");

   procedure QPainter_drawImage_QPointFCR_QImageCR
    (Self : Internals.QPainter_Access;
     Point : Qt4.Point_Fs.Internals.QPointF_Access;
     Image : Qt4.Images.Internals.QImage_Access);
   pragma Import (C, QPainter_drawImage_QPointFCR_QImageCR, "__QtAda_QPainter_drawImage_QPointFCR_QImageCR");

   procedure QPainter_drawImage_QPointCR_QImageCR
    (Self : Internals.QPainter_Access;
     Point : Qt4.Points.Internals.QPoint_Access;
     Image : Qt4.Images.Internals.QImage_Access);
   pragma Import (C, QPainter_drawImage_QPointCR_QImageCR, "__QtAda_QPainter_drawImage_QPointCR_QImageCR");

   procedure QPainter_drawImage_QPointFCR_QImageCR_QRectFCR_Qt_ImageConversionFlags
    (Self : Internals.QPainter_Access;
     Point : Qt4.Point_Fs.Internals.QPointF_Access;
     Image : Qt4.Images.Internals.QImage_Access;
     Source : Qt4.Rect_Fs.Internals.QRectF_Access;
     Flags : Qt4.Image_Conversion_Flags);
   pragma Import (C, QPainter_drawImage_QPointFCR_QImageCR_QRectFCR_Qt_ImageConversionFlags, "__QtAda_QPainter_drawImage_QPointFCR_QImageCR_QRectFCR_Qt_ImageConversionFlags");

   procedure QPainter_drawImage_QPointCR_QImageCR_QRectCR_Qt_ImageConversionFlags
    (Self : Internals.QPainter_Access;
     Point : Qt4.Points.Internals.QPoint_Access;
     Image : Qt4.Images.Internals.QImage_Access;
     Source : Qt4.Rects.Internals.QRect_Access;
     Flags : Qt4.Image_Conversion_Flags);
   pragma Import (C, QPainter_drawImage_QPointCR_QImageCR_QRectCR_Qt_ImageConversionFlags, "__QtAda_QPainter_drawImage_QPointCR_QImageCR_QRectCR_Qt_ImageConversionFlags");

   procedure QPainter_drawImage_QRectFCR_QImageCR
    (Self : Internals.QPainter_Access;
     Rectangle : Qt4.Rect_Fs.Internals.QRectF_Access;
     Image : Qt4.Images.Internals.QImage_Access);
   pragma Import (C, QPainter_drawImage_QRectFCR_QImageCR, "__QtAda_QPainter_drawImage_QRectFCR_QImageCR");

   procedure QPainter_drawImage_QRectCR_QImageCR
    (Self : Internals.QPainter_Access;
     Rectangle : Qt4.Rects.Internals.QRect_Access;
     Image : Qt4.Images.Internals.QImage_Access);
   pragma Import (C, QPainter_drawImage_QRectCR_QImageCR, "__QtAda_QPainter_drawImage_QRectCR_QImageCR");

   procedure QPainter_drawImage_int_int_QImageCR_int_int_int_int_Qt_ImageConversionFlags
    (Self : Internals.QPainter_Access;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Image : Qt4.Images.Internals.QImage_Access;
     Sx : Qt4.Q_Integer;
     Sy : Qt4.Q_Integer;
     Sw : Qt4.Q_Integer;
     Sh : Qt4.Q_Integer;
     Flags : Qt4.Image_Conversion_Flags);
   pragma Import (C, QPainter_drawImage_int_int_QImageCR_int_int_int_int_Qt_ImageConversionFlags, "__QtAda_QPainter_drawImage_int_int_QImageCR_int_int_int_int_Qt_ImageConversionFlags");

   procedure QPainter_drawLine_QLineFCR
    (Self : Internals.QPainter_Access;
     Line : Qt4.Line_Fs.Internals.QLineF_Access);
   pragma Import (C, QPainter_drawLine_QLineFCR, "__QtAda_QPainter_drawLine_QLineFCR");

   procedure QPainter_drawLine_QLineCR
    (Self : Internals.QPainter_Access;
     Line : Qt4.Lines.Internals.QLine_Access);
   pragma Import (C, QPainter_drawLine_QLineCR, "__QtAda_QPainter_drawLine_QLineCR");

   procedure QPainter_drawLine_QPointCR_QPointCR
    (Self : Internals.QPainter_Access;
     P_1 : Qt4.Points.Internals.QPoint_Access;
     P_2 : Qt4.Points.Internals.QPoint_Access);
   pragma Import (C, QPainter_drawLine_QPointCR_QPointCR, "__QtAda_QPainter_drawLine_QPointCR_QPointCR");

   procedure QPainter_drawLine_QPointFCR_QPointFCR
    (Self : Internals.QPainter_Access;
     P_1 : Qt4.Point_Fs.Internals.QPointF_Access;
     P_2 : Qt4.Point_Fs.Internals.QPointF_Access);
   pragma Import (C, QPainter_drawLine_QPointFCR_QPointFCR, "__QtAda_QPainter_drawLine_QPointFCR_QPointFCR");

   procedure QPainter_drawLine_int_int_int_int
    (Self : Internals.QPainter_Access;
     X_1 : Qt4.Q_Integer;
     Y_1 : Qt4.Q_Integer;
     X_2 : Qt4.Q_Integer;
     Y_2 : Qt4.Q_Integer);
   pragma Import (C, QPainter_drawLine_int_int_int_int, "__QtAda_QPainter_drawLine_int_int_int_int");

   procedure QPainter_drawPath_QPainterPathCR
    (Self : Internals.QPainter_Access;
     Path : Qt4.Painter_Paths.Internals.QPainterPath_Access);
   pragma Import (C, QPainter_drawPath_QPainterPathCR, "__QtAda_QPainter_drawPath_QPainterPathCR");

   procedure QPainter_drawPie_QRectFCR_int_int
    (Self : Internals.QPainter_Access;
     Rect : Qt4.Rect_Fs.Internals.QRectF_Access;
     Start_Angle : Qt4.Q_Integer;
     Span_Angle : Qt4.Q_Integer);
   pragma Import (C, QPainter_drawPie_QRectFCR_int_int, "__QtAda_QPainter_drawPie_QRectFCR_int_int");

   procedure QPainter_drawPie_QRectCR_int_int
    (Self : Internals.QPainter_Access;
     Rect : Qt4.Rects.Internals.QRect_Access;
     Start_Angle : Qt4.Q_Integer;
     Span_Angle : Qt4.Q_Integer);
   pragma Import (C, QPainter_drawPie_QRectCR_int_int, "__QtAda_QPainter_drawPie_QRectCR_int_int");

   procedure QPainter_drawPie_int_int_int_int_int_int
    (Self : Internals.QPainter_Access;
     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);
   pragma Import (C, QPainter_drawPie_int_int_int_int_int_int, "__QtAda_QPainter_drawPie_int_int_int_int_int_int");

   procedure QPainter_drawPixmap_QRectFCR_QPixmapCR_QRectFCR
    (Self : Internals.QPainter_Access;
     Target_Rect : Qt4.Rect_Fs.Internals.QRectF_Access;
     Pixmap : Qt4.Pixmaps.Internals.QPixmap_Access;
     Source_Rect : Qt4.Rect_Fs.Internals.QRectF_Access);
   pragma Import (C, QPainter_drawPixmap_QRectFCR_QPixmapCR_QRectFCR, "__QtAda_QPainter_drawPixmap_QRectFCR_QPixmapCR_QRectFCR");

   procedure QPainter_drawPixmap_QRectCR_QPixmapCR_QRectCR
    (Self : Internals.QPainter_Access;
     Target_Rect : Qt4.Rects.Internals.QRect_Access;
     Pixmap : Qt4.Pixmaps.Internals.QPixmap_Access;
     Source_Rect : Qt4.Rects.Internals.QRect_Access);
   pragma Import (C, QPainter_drawPixmap_QRectCR_QPixmapCR_QRectCR, "__QtAda_QPainter_drawPixmap_QRectCR_QPixmapCR_QRectCR");

   procedure QPainter_drawPixmap_QPointFCR_QPixmapCR_QRectFCR
    (Self : Internals.QPainter_Access;
     Point : Qt4.Point_Fs.Internals.QPointF_Access;
     Pixmap : Qt4.Pixmaps.Internals.QPixmap_Access;
     Source : Qt4.Rect_Fs.Internals.QRectF_Access);
   pragma Import (C, QPainter_drawPixmap_QPointFCR_QPixmapCR_QRectFCR, "__QtAda_QPainter_drawPixmap_QPointFCR_QPixmapCR_QRectFCR");

   procedure QPainter_drawPixmap_QPointCR_QPixmapCR_QRectCR
    (Self : Internals.QPainter_Access;
     Point : Qt4.Points.Internals.QPoint_Access;
     Pixmap : Qt4.Pixmaps.Internals.QPixmap_Access;
     Source : Qt4.Rects.Internals.QRect_Access);
   pragma Import (C, QPainter_drawPixmap_QPointCR_QPixmapCR_QRectCR, "__QtAda_QPainter_drawPixmap_QPointCR_QPixmapCR_QRectCR");

   procedure QPainter_drawPixmap_QPointFCR_QPixmapCR
    (Self : Internals.QPainter_Access;
     Point : Qt4.Point_Fs.Internals.QPointF_Access;
     Pixmap : Qt4.Pixmaps.Internals.QPixmap_Access);
   pragma Import (C, QPainter_drawPixmap_QPointFCR_QPixmapCR, "__QtAda_QPainter_drawPixmap_QPointFCR_QPixmapCR");

   procedure QPainter_drawPixmap_QPointCR_QPixmapCR
    (Self : Internals.QPainter_Access;
     Point : Qt4.Points.Internals.QPoint_Access;
     Pixmap : Qt4.Pixmaps.Internals.QPixmap_Access);
   pragma Import (C, QPainter_drawPixmap_QPointCR_QPixmapCR, "__QtAda_QPainter_drawPixmap_QPointCR_QPixmapCR");

   procedure QPainter_drawPixmap_int_int_QPixmapCR
    (Self : Internals.QPainter_Access;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Pixmap : Qt4.Pixmaps.Internals.QPixmap_Access);
   pragma Import (C, QPainter_drawPixmap_int_int_QPixmapCR, "__QtAda_QPainter_drawPixmap_int_int_QPixmapCR");

   procedure QPainter_drawPixmap_QRectCR_QPixmapCR
    (Self : Internals.QPainter_Access;
     Rectangle : Qt4.Rects.Internals.QRect_Access;
     Pixmap : Qt4.Pixmaps.Internals.QPixmap_Access);
   pragma Import (C, QPainter_drawPixmap_QRectCR_QPixmapCR, "__QtAda_QPainter_drawPixmap_QRectCR_QPixmapCR");

   procedure QPainter_drawPixmap_int_int_int_int_QPixmapCR
    (Self : Internals.QPainter_Access;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     W : Qt4.Q_Integer;
     H : Qt4.Q_Integer;
     Pixmap : Qt4.Pixmaps.Internals.QPixmap_Access);
   pragma Import (C, QPainter_drawPixmap_int_int_int_int_QPixmapCR, "__QtAda_QPainter_drawPixmap_int_int_int_int_QPixmapCR");

   procedure QPainter_drawPixmap_int_int_int_int_QPixmapCR_int_int_int_int
    (Self : Internals.QPainter_Access;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     W : Qt4.Q_Integer;
     H : Qt4.Q_Integer;
     Pixmap : Qt4.Pixmaps.Internals.QPixmap_Access;
     Sx : Qt4.Q_Integer;
     Sy : Qt4.Q_Integer;
     Sw : Qt4.Q_Integer;
     Sh : Qt4.Q_Integer);
   pragma Import (C, QPainter_drawPixmap_int_int_int_int_QPixmapCR_int_int_int_int, "__QtAda_QPainter_drawPixmap_int_int_int_int_QPixmapCR_int_int_int_int");

   procedure QPainter_drawPixmap_int_int_QPixmapCR_int_int_int_int
    (Self : Internals.QPainter_Access;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Pixmap : Qt4.Pixmaps.Internals.QPixmap_Access;
     Sx : Qt4.Q_Integer;
     Sy : Qt4.Q_Integer;
     Sw : Qt4.Q_Integer;
     Sh : Qt4.Q_Integer);
   pragma Import (C, QPainter_drawPixmap_int_int_QPixmapCR_int_int_int_int, "__QtAda_QPainter_drawPixmap_int_int_QPixmapCR_int_int_int_int");

   procedure QPainter_drawPoint_QPointFCR
    (Self : Internals.QPainter_Access;
     Position : Qt4.Point_Fs.Internals.QPointF_Access);
   pragma Import (C, QPainter_drawPoint_QPointFCR, "__QtAda_QPainter_drawPoint_QPointFCR");

   procedure QPainter_drawPoint_QPointCR
    (Self : Internals.QPainter_Access;
     Position : Qt4.Points.Internals.QPoint_Access);
   pragma Import (C, QPainter_drawPoint_QPointCR, "__QtAda_QPainter_drawPoint_QPointCR");

   procedure QPainter_drawPoint_int_int
    (Self : Internals.QPainter_Access;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer);
   pragma Import (C, QPainter_drawPoint_int_int, "__QtAda_QPainter_drawPoint_int_int");

   procedure QPainter_drawPoints_QPolygonFCR
    (Self : Internals.QPainter_Access;
     Points : Qt4.Polygon_Fs.Internals.QPolygonF_Access);
   pragma Import (C, QPainter_drawPoints_QPolygonFCR, "__QtAda_QPainter_drawPoints_QPolygonFCR");

   procedure QPainter_drawPoints_QPolygonCR
    (Self : Internals.QPainter_Access;
     Points : Qt4.Polygons.Internals.QPolygon_Access);
   pragma Import (C, QPainter_drawPoints_QPolygonCR, "__QtAda_QPainter_drawPoints_QPolygonCR");

   procedure QPainter_drawPolygon_QPolygonFCR_FillRule
    (Self : Internals.QPainter_Access;
     Polygon : Qt4.Polygon_Fs.Internals.QPolygonF_Access;
     Fill_Rule : Qt4.Fill_Rule);
   pragma Import (C, QPainter_drawPolygon_QPolygonFCR_FillRule, "__QtAda_QPainter_drawPolygon_QPolygonFCR_FillRule");

   procedure QPainter_drawPolygon_QPolygonCR_FillRule
    (Self : Internals.QPainter_Access;
     Polygon : Qt4.Polygons.Internals.QPolygon_Access;
     Fill_Rule : Qt4.Fill_Rule);
   pragma Import (C, QPainter_drawPolygon_QPolygonCR_FillRule, "__QtAda_QPainter_drawPolygon_QPolygonCR_FillRule");

   procedure QPainter_drawPolyline_QPolygonFCR
    (Self : Internals.QPainter_Access;
     Points : Qt4.Polygon_Fs.Internals.QPolygonF_Access);
   pragma Import (C, QPainter_drawPolyline_QPolygonFCR, "__QtAda_QPainter_drawPolyline_QPolygonFCR");

   procedure QPainter_drawPolyline_QPolygonCR
    (Self : Internals.QPainter_Access;
     Points : Qt4.Polygons.Internals.QPolygon_Access);
   pragma Import (C, QPainter_drawPolyline_QPolygonCR, "__QtAda_QPainter_drawPolyline_QPolygonCR");

   procedure QPainter_drawRect_QRectFCR
    (Self : Internals.QPainter_Access;
     Rect : Qt4.Rect_Fs.Internals.QRectF_Access);
   pragma Import (C, QPainter_drawRect_QRectFCR, "__QtAda_QPainter_drawRect_QRectFCR");

   procedure QPainter_drawRect_QRectCR
    (Self : Internals.QPainter_Access;
     Rect : Qt4.Rects.Internals.QRect_Access);
   pragma Import (C, QPainter_drawRect_QRectCR, "__QtAda_QPainter_drawRect_QRectCR");

   procedure QPainter_drawRect_int_int_int_int
    (Self : Internals.QPainter_Access;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Width : Qt4.Q_Integer;
     Height : Qt4.Q_Integer);
   pragma Import (C, QPainter_drawRect_int_int_int_int, "__QtAda_QPainter_drawRect_int_int_int_int");

   procedure QPainter_drawRoundRect_QRectFCR_int_int
    (Self : Internals.QPainter_Access;
     Rect : Qt4.Rect_Fs.Internals.QRectF_Access;
     Xround : Qt4.Q_Integer;
     Yround : Qt4.Q_Integer);
   pragma Import (C, QPainter_drawRoundRect_QRectFCR_int_int, "__QtAda_QPainter_drawRoundRect_QRectFCR_int_int");

   procedure QPainter_drawRoundRect_QRectCR_int_int
    (Self : Internals.QPainter_Access;
     Rect : Qt4.Rects.Internals.QRect_Access;
     Xround : Qt4.Q_Integer;
     Yround : Qt4.Q_Integer);
   pragma Import (C, QPainter_drawRoundRect_QRectCR_int_int, "__QtAda_QPainter_drawRoundRect_QRectCR_int_int");

   procedure QPainter_drawRoundRect_int_int_int_int_int_int
    (Self : Internals.QPainter_Access;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Width : Qt4.Q_Integer;
     Height : Qt4.Q_Integer;
     Xround : Qt4.Q_Integer;
     Yround : Qt4.Q_Integer);
   pragma Import (C, QPainter_drawRoundRect_int_int_int_int_int_int, "__QtAda_QPainter_drawRoundRect_int_int_int_int_int_int");

   procedure QPainter_drawText_QPointFCR_QStringCR
    (Self : Internals.QPainter_Access;
     Position : Qt4.Point_Fs.Internals.QPointF_Access;
     Text : Qt4.Strings.Internals.QString_Access);
   pragma Import (C, QPainter_drawText_QPointFCR_QStringCR, "__QtAda_QPainter_drawText_QPointFCR_QStringCR");

   procedure QPainter_drawText_QPointCR_QStringCR
    (Self : Internals.QPainter_Access;
     Position : Qt4.Points.Internals.QPoint_Access;
     Text : Qt4.Strings.Internals.QString_Access);
   pragma Import (C, QPainter_drawText_QPointCR_QStringCR, "__QtAda_QPainter_drawText_QPointCR_QStringCR");

   procedure QPainter_drawText_int_int_QStringCR
    (Self : Internals.QPainter_Access;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Test : Qt4.Strings.Internals.QString_Access);
   pragma Import (C, QPainter_drawText_int_int_QStringCR, "__QtAda_QPainter_drawText_int_int_QStringCR");

   procedure QPainter_drawText_QRectFCR_QStringCR_QTextOptionCR
    (Self : Internals.QPainter_Access;
     Rectangle : Qt4.Rect_Fs.Internals.QRectF_Access;
     Text : Qt4.Strings.Internals.QString_Access;
     Option : Qt4.Text_Options.Internals.QTextOption_Access);
   pragma Import (C, QPainter_drawText_QRectFCR_QStringCR_QTextOptionCR, "__QtAda_QPainter_drawText_QRectFCR_QStringCR_QTextOptionCR");

   procedure QPainter_drawTiledPixmap_QRectFCR_QPixmapCR_QPointFCR
    (Self : Internals.QPainter_Access;
     Rectangle : Qt4.Rect_Fs.Internals.QRectF_Access;
     Pixmap : Qt4.Pixmaps.Internals.QPixmap_Access;
     Position : Qt4.Point_Fs.Internals.QPointF_Access);
   pragma Import (C, QPainter_drawTiledPixmap_QRectFCR_QPixmapCR_QPointFCR, "__QtAda_QPainter_drawTiledPixmap_QRectFCR_QPixmapCR_QPointFCR");

   procedure QPainter_drawTiledPixmap_QRectCR_QPixmapCR_QPointCR
    (Self : Internals.QPainter_Access;
     Rectangle : Qt4.Rects.Internals.QRect_Access;
     Pixmap : Qt4.Pixmaps.Internals.QPixmap_Access;
     Position : Qt4.Points.Internals.QPoint_Access);
   pragma Import (C, QPainter_drawTiledPixmap_QRectCR_QPixmapCR_QPointCR, "__QtAda_QPainter_drawTiledPixmap_QRectCR_QPixmapCR_QPointCR");

   procedure QPainter_drawTiledPixmap_int_int_int_int_QPixmapCR_int_int
    (Self : Internals.QPainter_Access;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Width : Qt4.Q_Integer;
     Height : Qt4.Q_Integer;
     Pixmap : Qt4.Pixmaps.Internals.QPixmap_Access;
     Sx : Qt4.Q_Integer;
     Sy : Qt4.Q_Integer);
   pragma Import (C, QPainter_drawTiledPixmap_int_int_int_int_QPixmapCR_int_int, "__QtAda_QPainter_drawTiledPixmap_int_int_int_int_QPixmapCR_int_int");

   function QPainter_end
    (Self : Internals.QPainter_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QPainter_end, "__QtAda_QPainter_end");

   procedure QPainter_eraseRect_QRectFCR
    (Self : Internals.QPainter_Access;
     Rectangle : Qt4.Rect_Fs.Internals.QRectF_Access);
   pragma Import (C, QPainter_eraseRect_QRectFCR, "__QtAda_QPainter_eraseRect_QRectFCR");

   procedure QPainter_eraseRect_QRectCR
    (Self : Internals.QPainter_Access;
     Rectangle : Qt4.Rects.Internals.QRect_Access);
   pragma Import (C, QPainter_eraseRect_QRectCR, "__QtAda_QPainter_eraseRect_QRectCR");

   procedure QPainter_eraseRect_int_int_int_int
    (Self : Internals.QPainter_Access;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Width : Qt4.Q_Integer;
     Height : Qt4.Q_Integer);
   pragma Import (C, QPainter_eraseRect_int_int_int_int, "__QtAda_QPainter_eraseRect_int_int_int_int");

   procedure QPainter_fillPath_QPainterPathCR_QBrushCR
    (Self : Internals.QPainter_Access;
     Path : Qt4.Painter_Paths.Internals.QPainterPath_Access;
     Brush : Qt4.Brushes.Internals.QBrush_Access);
   pragma Import (C, QPainter_fillPath_QPainterPathCR_QBrushCR, "__QtAda_QPainter_fillPath_QPainterPathCR_QBrushCR");

   procedure QPainter_fillRect_QRectFCR_QBrushCR
    (Self : Internals.QPainter_Access;
     Rectangle : Qt4.Rect_Fs.Internals.QRectF_Access;
     Brush : Qt4.Brushes.Internals.QBrush_Access);
   pragma Import (C, QPainter_fillRect_QRectFCR_QBrushCR, "__QtAda_QPainter_fillRect_QRectFCR_QBrushCR");

   procedure QPainter_fillRect_QRectCR_QBrushCR
    (Self : Internals.QPainter_Access;
     Rectangle : Qt4.Rects.Internals.QRect_Access;
     Brush : Qt4.Brushes.Internals.QBrush_Access);
   pragma Import (C, QPainter_fillRect_QRectCR_QBrushCR, "__QtAda_QPainter_fillRect_QRectCR_QBrushCR");

   procedure QPainter_fillRect_int_int_int_int_QBrushCR
    (Self : Internals.QPainter_Access;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Width : Qt4.Q_Integer;
     Height : Qt4.Q_Integer;
     Brush : Qt4.Brushes.Internals.QBrush_Access);
   pragma Import (C, QPainter_fillRect_int_int_int_int_QBrushCR, "__QtAda_QPainter_fillRect_int_int_int_int_QBrushCR");

   procedure QPainter_font
    (Returns : Qt4.Fonts.Internals.QFont_Access;
     Self : Internals.QPainter_Access);
   pragma Import (C, QPainter_font, "__QtAda_QPainter_font_Q");

   function QPainter_fontInfo
    (Self : Internals.QPainter_Access;
     Storage : System.Address)
       return Qt4.Font_Infos.Internals.QFontInfo_Access;
   pragma Import (C, QPainter_fontInfo, "__QtAda_QPainter_fontInfo_Q");

   function QPainter_fontMetrics
    (Self : Internals.QPainter_Access;
     Storage : System.Address)
       return Qt4.Font_Metrics.Internals.QFontMetrics_Access;
   pragma Import (C, QPainter_fontMetrics, "__QtAda_QPainter_fontMetrics_Q");

   function QPainter_hasClipping
    (Self : Internals.QPainter_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QPainter_hasClipping, "__QtAda_QPainter_hasClipping_Q");

   function QPainter_isActive
    (Self : Internals.QPainter_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QPainter_isActive, "__QtAda_QPainter_isActive_Q");

   function QPainter_layoutDirection
    (Self : Internals.QPainter_Access)
       return Qt4.Layout_Direction;
   pragma Import (C, QPainter_layoutDirection, "__QtAda_QPainter_layoutDirection_Q");

   procedure QPainter_matrix
    (Returns : Qt4.Matrices.Internals.QMatrix_Access;
     Self : Internals.QPainter_Access);
   pragma Import (C, QPainter_matrix, "__QtAda_QPainter_matrix_Q");

   function QPainter_matrixEnabled
    (Self : Internals.QPainter_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QPainter_matrixEnabled, "__QtAda_QPainter_matrixEnabled_Q");

   function QPainter_opacity
    (Self : Internals.QPainter_Access)
       return Qt4.Q_Real;
   pragma Import (C, QPainter_opacity, "__QtAda_QPainter_opacity_Q");

   procedure QPainter_pen
    (Returns : Qt4.Pens.Internals.QPen_Access;
     Self : Internals.QPainter_Access);
   pragma Import (C, QPainter_pen, "__QtAda_QPainter_pen_Q");

   procedure QPainter_resetMatrix
    (Self : Internals.QPainter_Access);
   pragma Import (C, QPainter_resetMatrix, "__QtAda_QPainter_resetMatrix");

   procedure QPainter_resetTransform
    (Self : Internals.QPainter_Access);
   pragma Import (C, QPainter_resetTransform, "__QtAda_QPainter_resetTransform");

   procedure QPainter_restore
    (Self : Internals.QPainter_Access);
   pragma Import (C, QPainter_restore, "__QtAda_QPainter_restore");

   procedure QPainter_rotate_qreal
    (Self : Internals.QPainter_Access;
     Angle : Qt4.Q_Real);
   pragma Import (C, QPainter_rotate_qreal, "__QtAda_QPainter_rotate_qreal");

   procedure QPainter_save
    (Self : Internals.QPainter_Access);
   pragma Import (C, QPainter_save, "__QtAda_QPainter_save");

   procedure QPainter_scale_qreal_qreal
    (Self : Internals.QPainter_Access;
     Sx : Qt4.Q_Real;
     Sy : Qt4.Q_Real);
   pragma Import (C, QPainter_scale_qreal_qreal, "__QtAda_QPainter_scale_qreal_qreal");

   procedure QPainter_setBackground_QBrushCR
    (Self : Internals.QPainter_Access;
     Brush : Qt4.Brushes.Internals.QBrush_Access);
   pragma Import (C, QPainter_setBackground_QBrushCR, "__QtAda_QPainter_setBackground_QBrushCR");

   procedure QPainter_setBackgroundMode_BGMode
    (Self : Internals.QPainter_Access;
     Mode : Qt4.BG_Mode);
   pragma Import (C, QPainter_setBackgroundMode_BGMode, "__QtAda_QPainter_setBackgroundMode_BGMode");

   procedure QPainter_setBrush_QBrushCR
    (Self : Internals.QPainter_Access;
     Brush : Qt4.Brushes.Internals.QBrush_Access);
   pragma Import (C, QPainter_setBrush_QBrushCR, "__QtAda_QPainter_setBrush_QBrushCR");

   procedure QPainter_setBrush_BrushStyle
    (Self : Internals.QPainter_Access;
     Style : Qt4.Brush_Style);
   pragma Import (C, QPainter_setBrush_BrushStyle, "__QtAda_QPainter_setBrush_BrushStyle");

   procedure QPainter_setBrushOrigin_QPointFCR
    (Self : Internals.QPainter_Access;
     Position : Qt4.Point_Fs.Internals.QPointF_Access);
   pragma Import (C, QPainter_setBrushOrigin_QPointFCR, "__QtAda_QPainter_setBrushOrigin_QPointFCR");

   procedure QPainter_setBrushOrigin_QPointCR
    (Self : Internals.QPainter_Access;
     Position : Qt4.Points.Internals.QPoint_Access);
   pragma Import (C, QPainter_setBrushOrigin_QPointCR, "__QtAda_QPainter_setBrushOrigin_QPointCR");

   procedure QPainter_setBrushOrigin_int_int
    (Self : Internals.QPainter_Access;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer);
   pragma Import (C, QPainter_setBrushOrigin_int_int, "__QtAda_QPainter_setBrushOrigin_int_int");

   procedure QPainter_setClipPath_QPainterPathCR_ClipOperation
    (Self : Internals.QPainter_Access;
     Path : Qt4.Painter_Paths.Internals.QPainterPath_Access;
     Operation : Qt4.Clip_Operation);
   pragma Import (C, QPainter_setClipPath_QPainterPathCR_ClipOperation, "__QtAda_QPainter_setClipPath_QPainterPathCR_ClipOperation");

   procedure QPainter_setClipRect_QRectFCR_ClipOperation
    (Self : Internals.QPainter_Access;
     Rectangle : Qt4.Rect_Fs.Internals.QRectF_Access;
     Operation : Qt4.Clip_Operation);
   pragma Import (C, QPainter_setClipRect_QRectFCR_ClipOperation, "__QtAda_QPainter_setClipRect_QRectFCR_ClipOperation");

   procedure QPainter_setClipRect_int_int_int_int_ClipOperation
    (Self : Internals.QPainter_Access;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Width : Qt4.Q_Integer;
     Height : Qt4.Q_Integer;
     Operation : Qt4.Clip_Operation);
   pragma Import (C, QPainter_setClipRect_int_int_int_int_ClipOperation, "__QtAda_QPainter_setClipRect_int_int_int_int_ClipOperation");

   procedure QPainter_setClipRect_QRectCR_ClipOperation
    (Self : Internals.QPainter_Access;
     Rectangle : Qt4.Rects.Internals.QRect_Access;
     Operation : Qt4.Clip_Operation);
   pragma Import (C, QPainter_setClipRect_QRectCR_ClipOperation, "__QtAda_QPainter_setClipRect_QRectCR_ClipOperation");

   procedure QPainter_setClipRegion_QRegionCR_ClipOperation
    (Self : Internals.QPainter_Access;
     Region : Qt4.Regions.Internals.QRegion_Access;
     Operation : Qt4.Clip_Operation);
   pragma Import (C, QPainter_setClipRegion_QRegionCR_ClipOperation, "__QtAda_QPainter_setClipRegion_QRegionCR_ClipOperation");

   procedure QPainter_setClipping_bool
    (Self : Internals.QPainter_Access;
     Enable : Interfaces.C.unsigned);
   pragma Import (C, QPainter_setClipping_bool, "__QtAda_QPainter_setClipping_bool");

   procedure QPainter_setCompositionMode_CompositionMode
    (Self : Internals.QPainter_Access;
     Mode : Painter_Composition_Mode);
   pragma Import (C, QPainter_setCompositionMode_CompositionMode, "__QtAda_QPainter_setCompositionMode_CompositionMode");

   procedure QPainter_setFont_QFontCR
    (Self : Internals.QPainter_Access;
     Font : Qt4.Fonts.Internals.QFont_Access);
   pragma Import (C, QPainter_setFont_QFontCR, "__QtAda_QPainter_setFont_QFontCR");

   procedure QPainter_setLayoutDirection_LayoutDirection
    (Self : Internals.QPainter_Access;
     Direction : Qt4.Layout_Direction);
   pragma Import (C, QPainter_setLayoutDirection_LayoutDirection, "__QtAda_QPainter_setLayoutDirection_LayoutDirection");

   procedure QPainter_setOpacity_qreal
    (Self : Internals.QPainter_Access;
     Opacity : Qt4.Q_Real);
   pragma Import (C, QPainter_setOpacity_qreal, "__QtAda_QPainter_setOpacity_qreal");

   procedure QPainter_setPen_QPenCR
    (Self : Internals.QPainter_Access;
     Pen : Qt4.Pens.Internals.QPen_Access);
   pragma Import (C, QPainter_setPen_QPenCR, "__QtAda_QPainter_setPen_QPenCR");

   procedure QPainter_setPen_QColorCR
    (Self : Internals.QPainter_Access;
     Color : Qt4.Colors.Internals.QColor_Access);
   pragma Import (C, QPainter_setPen_QColorCR, "__QtAda_QPainter_setPen_QColorCR");

   procedure QPainter_setPen_PenStyle
    (Self : Internals.QPainter_Access;
     Style : Qt4.Pen_Style);
   pragma Import (C, QPainter_setPen_PenStyle, "__QtAda_QPainter_setPen_PenStyle");

   procedure QPainter_setRenderHint_RenderHint_bool
    (Self : Internals.QPainter_Access;
     Hint : Render_Hint;
     Enable : Interfaces.C.unsigned);
   pragma Import (C, QPainter_setRenderHint_RenderHint_bool, "__QtAda_QPainter_setRenderHint_RenderHint_bool");

   procedure QPainter_setMatrix_QMatrixCR_bool
    (Self : Internals.QPainter_Access;
     Matrix : Qt4.Matrices.Internals.QMatrix_Access;
     Combine : Interfaces.C.unsigned);
   pragma Import (C, QPainter_setMatrix_QMatrixCR_bool, "__QtAda_QPainter_setMatrix_QMatrixCR_bool");

   procedure QPainter_setMatrixEnabled_bool
    (Self : Internals.QPainter_Access;
     Enable : Interfaces.C.unsigned);
   pragma Import (C, QPainter_setMatrixEnabled_bool, "__QtAda_QPainter_setMatrixEnabled_bool");

   procedure QPainter_setTransform_QTransformCR_bool
    (Self : Internals.QPainter_Access;
     Transform : Qt4.Transforms.Internals.QTransform_Access;
     Combine : Interfaces.C.unsigned);
   pragma Import (C, QPainter_setTransform_QTransformCR_bool, "__QtAda_QPainter_setTransform_QTransformCR_bool");

   procedure QPainter_setViewTransformEnabled_bool
    (Self : Internals.QPainter_Access;
     Enable : Interfaces.C.unsigned);
   pragma Import (C, QPainter_setViewTransformEnabled_bool, "__QtAda_QPainter_setViewTransformEnabled_bool");

   procedure QPainter_setViewport_QRectCR
    (Self : Internals.QPainter_Access;
     Viewport : Qt4.Rects.Internals.QRect_Access);
   pragma Import (C, QPainter_setViewport_QRectCR, "__QtAda_QPainter_setViewport_QRectCR");

   procedure QPainter_setViewport_int_int_int_int
    (Self : Internals.QPainter_Access;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Width : Qt4.Q_Integer;
     Height : Qt4.Q_Integer);
   pragma Import (C, QPainter_setViewport_int_int_int_int, "__QtAda_QPainter_setViewport_int_int_int_int");

   procedure QPainter_setWindow_QRectCR
    (Self : Internals.QPainter_Access;
     Window : Qt4.Rects.Internals.QRect_Access);
   pragma Import (C, QPainter_setWindow_QRectCR, "__QtAda_QPainter_setWindow_QRectCR");

   procedure QPainter_setWindow_int_int_int_int
    (Self : Internals.QPainter_Access;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Width : Qt4.Q_Integer;
     Height : Qt4.Q_Integer);
   pragma Import (C, QPainter_setWindow_int_int_int_int, "__QtAda_QPainter_setWindow_int_int_int_int");

   procedure QPainter_setWorldMatrix_QMatrixCR_bool
    (Self : Internals.QPainter_Access;
     Matrix : Qt4.Matrices.Internals.QMatrix_Access;
     Combine : Interfaces.C.unsigned);
   pragma Import (C, QPainter_setWorldMatrix_QMatrixCR_bool, "__QtAda_QPainter_setWorldMatrix_QMatrixCR_bool");

   procedure QPainter_setWorldMatrixEnabled_bool
    (Self : Internals.QPainter_Access;
     Enable : Interfaces.C.unsigned);
   pragma Import (C, QPainter_setWorldMatrixEnabled_bool, "__QtAda_QPainter_setWorldMatrixEnabled_bool");

   procedure QPainter_setWorldTransform_QTransformCR_bool
    (Self : Internals.QPainter_Access;
     Matrix : Qt4.Transforms.Internals.QTransform_Access;
     Combine : Interfaces.C.unsigned);
   pragma Import (C, QPainter_setWorldTransform_QTransformCR_bool, "__QtAda_QPainter_setWorldTransform_QTransformCR_bool");

   procedure QPainter_shear_qreal_qreal
    (Self : Internals.QPainter_Access;
     Sh : Qt4.Q_Real;
     Sv : Qt4.Q_Real);
   pragma Import (C, QPainter_shear_qreal_qreal, "__QtAda_QPainter_shear_qreal_qreal");

   procedure QPainter_strokePath_QPainterPathCR_QPenCR
    (Self : Internals.QPainter_Access;
     Path : Qt4.Painter_Paths.Internals.QPainterPath_Access;
     Pen : Qt4.Pens.Internals.QPen_Access);
   pragma Import (C, QPainter_strokePath_QPainterPathCR_QPenCR, "__QtAda_QPainter_strokePath_QPainterPathCR_QPenCR");

   function QPainter_testRenderHint_RenderHint
    (Self : Internals.QPainter_Access;
     Hint : Render_Hint)
       return Interfaces.C.unsigned;
   pragma Import (C, QPainter_testRenderHint_RenderHint, "__QtAda_QPainter_testRenderHint_RenderHint_Q");

   procedure QPainter_transform
    (Returns : Qt4.Transforms.Internals.QTransform_Access;
     Self : Internals.QPainter_Access);
   pragma Import (C, QPainter_transform, "__QtAda_QPainter_transform_Q");

   procedure QPainter_translate_QPointFCR
    (Self : Internals.QPainter_Access;
     Offset : Qt4.Point_Fs.Internals.QPointF_Access);
   pragma Import (C, QPainter_translate_QPointFCR, "__QtAda_QPainter_translate_QPointFCR");

   procedure QPainter_translate_QPointCR
    (Self : Internals.QPainter_Access;
     Offset : Qt4.Points.Internals.QPoint_Access);
   pragma Import (C, QPainter_translate_QPointCR, "__QtAda_QPainter_translate_QPointCR");

   procedure QPainter_translate_qreal_qreal
    (Self : Internals.QPainter_Access;
     Dx : Qt4.Q_Real;
     Dy : Qt4.Q_Real);
   pragma Import (C, QPainter_translate_qreal_qreal, "__QtAda_QPainter_translate_qreal_qreal");

   function QPainter_viewTransformEnabled
    (Self : Internals.QPainter_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QPainter_viewTransformEnabled, "__QtAda_QPainter_viewTransformEnabled_Q");

   procedure QPainter_viewport
    (Returns : Qt4.Rects.Internals.QRect_Access;
     Self : Internals.QPainter_Access);
   pragma Import (C, QPainter_viewport, "__QtAda_QPainter_viewport_Q");

   procedure QPainter_window
    (Returns : Qt4.Rects.Internals.QRect_Access;
     Self : Internals.QPainter_Access);
   pragma Import (C, QPainter_window, "__QtAda_QPainter_window_Q");

   procedure QPainter_worldMatrix
    (Returns : Qt4.Matrices.Internals.QMatrix_Access;
     Self : Internals.QPainter_Access);
   pragma Import (C, QPainter_worldMatrix, "__QtAda_QPainter_worldMatrix_Q");

   function QPainter_worldMatrixEnabled
    (Self : Internals.QPainter_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QPainter_worldMatrixEnabled, "__QtAda_QPainter_worldMatrixEnabled_Q");

   procedure QPainter_worldTransform
    (Returns : Qt4.Transforms.Internals.QTransform_Access;
     Self : Internals.QPainter_Access);
   pragma Import (C, QPainter_worldTransform, "__QtAda_QPainter_worldTransform_Q");

   procedure drawText_null_boundingRect_wrapper
    (Self      : Internals.QPainter_Access;
     Rectangle : not null Qt4.Rects.Internals.QRect_Access;
     Flags     : Qt4.Alignment;
     Text      : not null Qt4.Strings.Internals.QString_Access);
   pragma Import (C,
                  drawText_null_boundingRect_wrapper,
                  "__Qt4Ada_QPainter_drawText_null_boundingRect_wrapper");

   --------------
   -- Finalize --
   --------------

   overriding
   procedure Finalize (Self : in out Q_Painter) is
   begin
      if not Self.Wrapper then
         finalize_QPainter (Self.Object);
      end if;
   end Finalize;

   ----------------
   -- Initialize --
   ----------------

   overriding
   procedure Initialize (Self : in out Q_Painter) is
      use type Internals.QPainter_Access;

   begin
      if Self.Object = null then
         Self.Object := initialize_QPainter (Self.Storage'Address);
      end if;
   end Initialize;

   ------------
   -- Create --
   ------------

   function Create
    (Device : not null access Qt4.Paint_Devices.Q_Paint_Device'Class)
       return Q_Painter
   is
   begin
      return Result : aliased Q_Painter
        := (Ada.Finalization.Limited_Controlled with others => <>)
      do
         Result.Object :=
           initialize_QPainter_QPaintDevice
            (Result.Storage'Address,
             Device.QPaintDevice_View);
      end return;
   end Create;

   ----------------
   -- Background --
   ----------------

   function Background
    (Self : Q_Painter'Class)
       return Qt4.Brushes.Q_Brush
   is
   begin
      return Returns : Qt4.Brushes.Q_Brush do
         QPainter_background (Qt4.Brushes.Internals.QBrush_View (Returns), Self.Object);
      end return;
   end Background;

   ---------------------
   -- Background_Mode --
   ---------------------

   function Background_Mode
    (Self : Q_Painter'Class)
       return Qt4.BG_Mode
   is
   begin
      return QPainter_backgroundMode (Self.Object);
   end Background_Mode;

   -------------------
   -- Bounding_Rect --
   -------------------

   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
   is
   begin
      return Returns : Qt4.Rect_Fs.Q_Rect_F do
         QPainter_boundingRect_QRectFCR_QStringCR_QTextOptionCR
          (Qt4.Rect_Fs.Internals.QRectF_View (Returns),
           Self.Object,
           Qt4.Rect_Fs.Internals.QRectF_View (Rect),
           Qt4.Strings.Internals.QString_View (Text),
           Qt4.Text_Options.Internals.QTextOption_View (Option));
      end return;
   end Bounding_Rect;

   -----------------
   -- Begin_Paint --
   -----------------

   function Begin_Paint
    (Self   : not null access Q_Painter'Class;
     Device : not null access Qt4.Paint_Devices.Q_Paint_Device'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QPainter_begin (Self.Object, Device.QPaintDevice_View), 0);
   end Begin_Paint;

   -----------
   -- Brush --
   -----------

   function Brush
    (Self : Q_Painter'Class)
       return Qt4.Brushes.Q_Brush
   is
   begin
      return Returns : Qt4.Brushes.Q_Brush do
         QPainter_brush (Qt4.Brushes.Internals.QBrush_View (Returns), Self.Object);
      end return;
   end Brush;

   ------------------
   -- Brush_Origin --
   ------------------

   function Brush_Origin
    (Self : Q_Painter'Class)
       return Qt4.Points.Q_Point
   is
   begin
      return Returns : Qt4.Points.Q_Point do
         QPainter_brushOrigin (Qt4.Points.Internals.QPoint_View (Returns), Self.Object);
      end return;
   end Brush_Origin;

   ---------------
   -- Clip_Path --
   ---------------

   function Clip_Path
    (Self : Q_Painter'Class)
       return Qt4.Painter_Paths.Q_Painter_Path
   is
   begin
      return Returns : Qt4.Painter_Paths.Q_Painter_Path do
         QPainter_clipPath (Qt4.Painter_Paths.Internals.QPainterPath_View (Returns), Self.Object);
      end return;
   end Clip_Path;

   -----------------
   -- Clip_Region --
   -----------------

   function Clip_Region
    (Self : Q_Painter'Class)
       return Qt4.Regions.Q_Region
   is
   begin
      return Returns : Qt4.Regions.Q_Region do
         QPainter_clipRegion (Qt4.Regions.Internals.QRegion_View (Returns), Self.Object);
      end return;
   end Clip_Region;

   ---------------------
   -- Combined_Matrix --
   ---------------------

   function Combined_Matrix
    (Self : Q_Painter'Class)
       return Qt4.Matrices.Q_Matrix
   is
   begin
      return Returns : Qt4.Matrices.Q_Matrix do
         QPainter_combinedMatrix (Qt4.Matrices.Internals.QMatrix_View (Returns), Self.Object);
      end return;
   end Combined_Matrix;

   ------------------------
   -- Combined_Transform --
   ------------------------

   function Combined_Transform
    (Self : Q_Painter'Class)
       return Qt4.Transforms.Q_Transform
   is
   begin
      return Returns : Qt4.Transforms.Q_Transform do
         QPainter_combinedTransform (Qt4.Transforms.Internals.QTransform_View (Returns), Self.Object);
      end return;
   end Combined_Transform;

   ----------------------
   -- Composition_Mode --
   ----------------------

   function Composition_Mode
    (Self : Q_Painter'Class)
       return Painter_Composition_Mode
   is
   begin
      return QPainter_compositionMode (Self.Object);
   end Composition_Mode;

   -------------------
   -- Device_Matrix --
   -------------------

   function Device_Matrix
    (Self : Q_Painter'Class)
       return Qt4.Matrices.Q_Matrix
   is
   begin
      return Returns : Qt4.Matrices.Q_Matrix do
         QPainter_deviceMatrix (Qt4.Matrices.Internals.QMatrix_View (Returns), Self.Object);
      end return;
   end Device_Matrix;

   ----------------------
   -- Device_Transform --
   ----------------------

   function Device_Transform
    (Self : Q_Painter'Class)
       return Qt4.Transforms.Q_Transform
   is
   begin
      return Returns : Qt4.Transforms.Q_Transform do
         QPainter_deviceTransform (Qt4.Transforms.Internals.QTransform_View (Returns), Self.Object);
      end return;
   end Device_Transform;

   --------------
   -- Draw_Arc --
   --------------

   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)
   is
   begin
      QPainter_drawArc_QRectFCR_int_int (Self.Object, Qt4.Rect_Fs.Internals.QRectF_View (Rect), Start_Angle, Span_Angle);
   end Draw_Arc;

   --------------
   -- Draw_Arc --
   --------------

   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)
   is
   begin
      QPainter_drawArc_QRectCR_int_int (Self.Object, Qt4.Rects.Internals.QRect_View (Rect), Start_Angle, Span_Angle);
   end Draw_Arc;

   --------------
   -- Draw_Arc --
   --------------

   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)
   is
   begin
      QPainter_drawArc_int_int_int_int_int_int (Self.Object, X, Y, Width, Height, Start_Angle, Span_Angle);
   end Draw_Arc;

   ----------------
   -- Draw_Chord --
   ----------------

   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)
   is
   begin
      QPainter_drawChord_QRectFCR_int_int (Self.Object, Qt4.Rect_Fs.Internals.QRectF_View (Rect), Start_Angle, Span_Angle);
   end Draw_Chord;

   ----------------
   -- Draw_Chord --
   ----------------

   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)
   is
   begin
      QPainter_drawChord_QRectCR_int_int (Self.Object, Qt4.Rects.Internals.QRect_View (Rect), Start_Angle, Span_Angle);
   end Draw_Chord;

   ----------------
   -- Draw_Chord --
   ----------------

   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)
   is
   begin
      QPainter_drawChord_int_int_int_int_int_int (Self.Object, X, Y, Width, Height, Start_Angle, Span_Angle);
   end Draw_Chord;

   -------------------------
   -- Draw_Convex_Polygon --
   -------------------------

   procedure Draw_Convex_Polygon
    (Self : in out Q_Painter'Class;
     Polygon : Qt4.Polygon_Fs.Q_Polygon_F'Class)
   is
   begin
      QPainter_drawConvexPolygon_QPolygonFCR (Self.Object, Qt4.Polygon_Fs.Internals.QPolygonF_View (Polygon));
   end Draw_Convex_Polygon;

   -------------------------
   -- Draw_Convex_Polygon --
   -------------------------

   procedure Draw_Convex_Polygon
    (Self : in out Q_Painter'Class;
     Polygon : Qt4.Polygons.Q_Polygon'Class)
   is
   begin
      QPainter_drawConvexPolygon_QPolygonCR (Self.Object, Qt4.Polygons.Internals.QPolygon_View (Polygon));
   end Draw_Convex_Polygon;

   ------------------
   -- Draw_Ellipse --
   ------------------

   procedure Draw_Ellipse
    (Self : in out Q_Painter'Class;
     R : Qt4.Rect_Fs.Q_Rect_F'Class)
   is
   begin
      QPainter_drawEllipse_QRectFCR (Self.Object, Qt4.Rect_Fs.Internals.QRectF_View (R));
   end Draw_Ellipse;

   ------------------
   -- Draw_Ellipse --
   ------------------

   procedure Draw_Ellipse
    (Self : in out Q_Painter'Class;
     R : Qt4.Rects.Q_Rect'Class)
   is
   begin
      QPainter_drawEllipse_QRectCR (Self.Object, Qt4.Rects.Internals.QRect_View (R));
   end Draw_Ellipse;

   ------------------
   -- Draw_Ellipse --
   ------------------

   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)
   is
   begin
      QPainter_drawEllipse_int_int_int_int (Self.Object, X, Y, Width, Height);
   end Draw_Ellipse;

   ----------------
   -- Draw_Image --
   ----------------

   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)
   is
   begin
      QPainter_drawImage_QRectFCR_QImageCR_QRectFCR_Qt_ImageConversionFlags (Self.Object, Qt4.Rect_Fs.Internals.QRectF_View (Target), Qt4.Images.Internals.QImage_View (Image), Qt4.Rect_Fs.Internals.QRectF_View (Source), Flags);
   end Draw_Image;

   ----------------
   -- Draw_Image --
   ----------------

   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)
   is
   begin
      QPainter_drawImage_QRectCR_QImageCR_QRectCR_Qt_ImageConversionFlags (Self.Object, Qt4.Rects.Internals.QRect_View (Target), Qt4.Images.Internals.QImage_View (Image), Qt4.Rects.Internals.QRect_View (Source), Flags);
   end Draw_Image;

   ----------------
   -- Draw_Image --
   ----------------

   procedure Draw_Image
    (Self : in out Q_Painter'Class;
     Point : Qt4.Point_Fs.Q_Point_F'Class;
     Image : Qt4.Images.Q_Image'Class)
   is
   begin
      QPainter_drawImage_QPointFCR_QImageCR (Self.Object, Qt4.Point_Fs.Internals.QPointF_View (Point), Qt4.Images.Internals.QImage_View (Image));
   end Draw_Image;

   ----------------
   -- Draw_Image --
   ----------------

   procedure Draw_Image
    (Self : in out Q_Painter'Class;
     Point : Qt4.Points.Q_Point'Class;
     Image : Qt4.Images.Q_Image'Class)
   is
   begin
      QPainter_drawImage_QPointCR_QImageCR (Self.Object, Qt4.Points.Internals.QPoint_View (Point), Qt4.Images.Internals.QImage_View (Image));
   end Draw_Image;

   ----------------
   -- Draw_Image --
   ----------------

   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)
   is
   begin
      QPainter_drawImage_QPointFCR_QImageCR_QRectFCR_Qt_ImageConversionFlags (Self.Object, Qt4.Point_Fs.Internals.QPointF_View (Point), Qt4.Images.Internals.QImage_View (Image), Qt4.Rect_Fs.Internals.QRectF_View (Source), Flags);
   end Draw_Image;

   ----------------
   -- Draw_Image --
   ----------------

   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)
   is
   begin
      QPainter_drawImage_QPointCR_QImageCR_QRectCR_Qt_ImageConversionFlags (Self.Object, Qt4.Points.Internals.QPoint_View (Point), Qt4.Images.Internals.QImage_View (Image), Qt4.Rects.Internals.QRect_View (Source), Flags);
   end Draw_Image;

   ----------------
   -- Draw_Image --
   ----------------

   procedure Draw_Image
    (Self : in out Q_Painter'Class;
     Rectangle : Qt4.Rect_Fs.Q_Rect_F'Class;
     Image : Qt4.Images.Q_Image'Class)
   is
   begin
      QPainter_drawImage_QRectFCR_QImageCR (Self.Object, Qt4.Rect_Fs.Internals.QRectF_View (Rectangle), Qt4.Images.Internals.QImage_View (Image));
   end Draw_Image;

   ----------------
   -- Draw_Image --
   ----------------

   procedure Draw_Image
    (Self : in out Q_Painter'Class;
     Rectangle : Qt4.Rects.Q_Rect'Class;
     Image : Qt4.Images.Q_Image'Class)
   is
   begin
      QPainter_drawImage_QRectCR_QImageCR (Self.Object, Qt4.Rects.Internals.QRect_View (Rectangle), Qt4.Images.Internals.QImage_View (Image));
   end Draw_Image;

   ----------------
   -- Draw_Image --
   ----------------

   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)
   is
   begin
      QPainter_drawImage_int_int_QImageCR_int_int_int_int_Qt_ImageConversionFlags (Self.Object, X, Y, Qt4.Images.Internals.QImage_View (Image), Sx, Sy, Sw, Sh, Flags);
   end Draw_Image;

   ---------------
   -- Draw_Line --
   ---------------

   procedure Draw_Line
    (Self : in out Q_Painter'Class;
     Line : Qt4.Line_Fs.Q_Line_F'Class)
   is
   begin
      QPainter_drawLine_QLineFCR (Self.Object, Qt4.Line_Fs.Internals.QLineF_View (Line));
   end Draw_Line;

   ---------------
   -- Draw_Line --
   ---------------

   procedure Draw_Line
    (Self : in out Q_Painter'Class;
     Line : Qt4.Lines.Q_Line'Class)
   is
   begin
      QPainter_drawLine_QLineCR (Self.Object, Qt4.Lines.Internals.QLine_View (Line));
   end Draw_Line;

   ---------------
   -- Draw_Line --
   ---------------

   procedure Draw_Line
    (Self : in out Q_Painter'Class;
     P_1 : Qt4.Points.Q_Point'Class;
     P_2 : Qt4.Points.Q_Point'Class)
   is
   begin
      QPainter_drawLine_QPointCR_QPointCR (Self.Object, Qt4.Points.Internals.QPoint_View (P_1), Qt4.Points.Internals.QPoint_View (P_2));
   end Draw_Line;

   ---------------
   -- Draw_Line --
   ---------------

   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)
   is
   begin
      QPainter_drawLine_QPointFCR_QPointFCR (Self.Object, Qt4.Point_Fs.Internals.QPointF_View (P_1), Qt4.Point_Fs.Internals.QPointF_View (P_2));
   end Draw_Line;

   ---------------
   -- Draw_Line --
   ---------------

   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)
   is
   begin
      QPainter_drawLine_int_int_int_int (Self.Object, X_1, Y_1, X_2, Y_2);
   end Draw_Line;

   ---------------
   -- Draw_Path --
   ---------------

   procedure Draw_Path
    (Self : in out Q_Painter'Class;
     Path : Qt4.Painter_Paths.Q_Painter_Path'Class)
   is
   begin
      QPainter_drawPath_QPainterPathCR (Self.Object, Qt4.Painter_Paths.Internals.QPainterPath_View (Path));
   end Draw_Path;

   --------------
   -- Draw_Pie --
   --------------

   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)
   is
   begin
      QPainter_drawPie_QRectFCR_int_int (Self.Object, Qt4.Rect_Fs.Internals.QRectF_View (Rect), Start_Angle, Span_Angle);
   end Draw_Pie;

   --------------
   -- Draw_Pie --
   --------------

   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)
   is
   begin
      QPainter_drawPie_QRectCR_int_int (Self.Object, Qt4.Rects.Internals.QRect_View (Rect), Start_Angle, Span_Angle);
   end Draw_Pie;

   --------------
   -- Draw_Pie --
   --------------

   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)
   is
   begin
      QPainter_drawPie_int_int_int_int_int_int (Self.Object, X, Y, Width, Height, Start_Angle, Span_Angle);
   end Draw_Pie;

   -----------------
   -- Draw_Pixmap --
   -----------------

   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)
   is
   begin
      QPainter_drawPixmap_QRectFCR_QPixmapCR_QRectFCR (Self.Object, Qt4.Rect_Fs.Internals.QRectF_View (Target_Rect), Qt4.Pixmaps.Internals.QPixmap_View (Pixmap), Qt4.Rect_Fs.Internals.QRectF_View (Source_Rect));
   end Draw_Pixmap;

   -----------------
   -- Draw_Pixmap --
   -----------------

   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)
   is
   begin
      QPainter_drawPixmap_QRectCR_QPixmapCR_QRectCR (Self.Object, Qt4.Rects.Internals.QRect_View (Target_Rect), Qt4.Pixmaps.Internals.QPixmap_View (Pixmap), Qt4.Rects.Internals.QRect_View (Source_Rect));
   end Draw_Pixmap;

   -----------------
   -- Draw_Pixmap --
   -----------------

   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)
   is
   begin
      QPainter_drawPixmap_QPointFCR_QPixmapCR_QRectFCR (Self.Object, Qt4.Point_Fs.Internals.QPointF_View (Point), Qt4.Pixmaps.Internals.QPixmap_View (Pixmap), Qt4.Rect_Fs.Internals.QRectF_View (Source));
   end Draw_Pixmap;

   -----------------
   -- Draw_Pixmap --
   -----------------

   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)
   is
   begin
      QPainter_drawPixmap_QPointCR_QPixmapCR_QRectCR (Self.Object, Qt4.Points.Internals.QPoint_View (Point), Qt4.Pixmaps.Internals.QPixmap_View (Pixmap), Qt4.Rects.Internals.QRect_View (Source));
   end Draw_Pixmap;

   -----------------
   -- Draw_Pixmap --
   -----------------

   procedure Draw_Pixmap
    (Self : in out Q_Painter'Class;
     Point : Qt4.Point_Fs.Q_Point_F'Class;
     Pixmap : Qt4.Pixmaps.Q_Pixmap'Class)
   is
   begin
      QPainter_drawPixmap_QPointFCR_QPixmapCR (Self.Object, Qt4.Point_Fs.Internals.QPointF_View (Point), Qt4.Pixmaps.Internals.QPixmap_View (Pixmap));
   end Draw_Pixmap;

   -----------------
   -- Draw_Pixmap --
   -----------------

   procedure Draw_Pixmap
    (Self : in out Q_Painter'Class;
     Point : Qt4.Points.Q_Point'Class;
     Pixmap : Qt4.Pixmaps.Q_Pixmap'Class)
   is
   begin
      QPainter_drawPixmap_QPointCR_QPixmapCR (Self.Object, Qt4.Points.Internals.QPoint_View (Point), Qt4.Pixmaps.Internals.QPixmap_View (Pixmap));
   end Draw_Pixmap;

   -----------------
   -- Draw_Pixmap --
   -----------------

   procedure Draw_Pixmap
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Pixmap : Qt4.Pixmaps.Q_Pixmap'Class)
   is
   begin
      QPainter_drawPixmap_int_int_QPixmapCR (Self.Object, X, Y, Qt4.Pixmaps.Internals.QPixmap_View (Pixmap));
   end Draw_Pixmap;

   -----------------
   -- Draw_Pixmap --
   -----------------

   procedure Draw_Pixmap
    (Self : in out Q_Painter'Class;
     Rectangle : Qt4.Rects.Q_Rect'Class;
     Pixmap : Qt4.Pixmaps.Q_Pixmap'Class)
   is
   begin
      QPainter_drawPixmap_QRectCR_QPixmapCR (Self.Object, Qt4.Rects.Internals.QRect_View (Rectangle), Qt4.Pixmaps.Internals.QPixmap_View (Pixmap));
   end Draw_Pixmap;

   -----------------
   -- Draw_Pixmap --
   -----------------

   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)
   is
   begin
      QPainter_drawPixmap_int_int_int_int_QPixmapCR (Self.Object, X, Y, W, H, Qt4.Pixmaps.Internals.QPixmap_View (Pixmap));
   end Draw_Pixmap;

   -----------------
   -- Draw_Pixmap --
   -----------------

   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)
   is
   begin
      QPainter_drawPixmap_int_int_int_int_QPixmapCR_int_int_int_int (Self.Object, X, Y, W, H, Qt4.Pixmaps.Internals.QPixmap_View (Pixmap), Sx, Sy, Sw, Sh);
   end Draw_Pixmap;

   -----------------
   -- Draw_Pixmap --
   -----------------

   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)
   is
   begin
      QPainter_drawPixmap_int_int_QPixmapCR_int_int_int_int (Self.Object, X, Y, Qt4.Pixmaps.Internals.QPixmap_View (Pixmap), Sx, Sy, Sw, Sh);
   end Draw_Pixmap;

   ----------------
   -- Draw_Point --
   ----------------

   procedure Draw_Point
    (Self : in out Q_Painter'Class;
     Position : Qt4.Point_Fs.Q_Point_F'Class)
   is
   begin
      QPainter_drawPoint_QPointFCR (Self.Object, Qt4.Point_Fs.Internals.QPointF_View (Position));
   end Draw_Point;

   ----------------
   -- Draw_Point --
   ----------------

   procedure Draw_Point
    (Self : in out Q_Painter'Class;
     Position : Qt4.Points.Q_Point'Class)
   is
   begin
      QPainter_drawPoint_QPointCR (Self.Object, Qt4.Points.Internals.QPoint_View (Position));
   end Draw_Point;

   ----------------
   -- Draw_Point --
   ----------------

   procedure Draw_Point
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer)
   is
   begin
      QPainter_drawPoint_int_int (Self.Object, X, Y);
   end Draw_Point;

   -----------------
   -- Draw_Points --
   -----------------

   procedure Draw_Points
    (Self : in out Q_Painter'Class;
     Points : Qt4.Polygon_Fs.Q_Polygon_F'Class)
   is
   begin
      QPainter_drawPoints_QPolygonFCR (Self.Object, Qt4.Polygon_Fs.Internals.QPolygonF_View (Points));
   end Draw_Points;

   -----------------
   -- Draw_Points --
   -----------------

   procedure Draw_Points
    (Self : in out Q_Painter'Class;
     Points : Qt4.Polygons.Q_Polygon'Class)
   is
   begin
      QPainter_drawPoints_QPolygonCR (Self.Object, Qt4.Polygons.Internals.QPolygon_View (Points));
   end Draw_Points;

   ------------------
   -- Draw_Polygon --
   ------------------

   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)
   is
   begin
      QPainter_drawPolygon_QPolygonFCR_FillRule (Self.Object, Qt4.Polygon_Fs.Internals.QPolygonF_View (Polygon), Fill_Rule);
   end Draw_Polygon;

   ------------------
   -- Draw_Polygon --
   ------------------

   procedure Draw_Polygon
    (Self : in out Q_Painter'Class;
     Polygon : Qt4.Polygons.Q_Polygon'Class;
     Fill_Rule : Qt4.Fill_Rule
       := Odd_Even_Fill)
   is
   begin
      QPainter_drawPolygon_QPolygonCR_FillRule (Self.Object, Qt4.Polygons.Internals.QPolygon_View (Polygon), Fill_Rule);
   end Draw_Polygon;

   -------------------
   -- Draw_Polyline --
   -------------------

   procedure Draw_Polyline
    (Self : in out Q_Painter'Class;
     Points : Qt4.Polygon_Fs.Q_Polygon_F'Class)
   is
   begin
      QPainter_drawPolyline_QPolygonFCR (Self.Object, Qt4.Polygon_Fs.Internals.QPolygonF_View (Points));
   end Draw_Polyline;

   -------------------
   -- Draw_Polyline --
   -------------------

   procedure Draw_Polyline
    (Self : in out Q_Painter'Class;
     Points : Qt4.Polygons.Q_Polygon'Class)
   is
   begin
      QPainter_drawPolyline_QPolygonCR (Self.Object, Qt4.Polygons.Internals.QPolygon_View (Points));
   end Draw_Polyline;

   ---------------
   -- Draw_Rect --
   ---------------

   procedure Draw_Rect
    (Self : in out Q_Painter'Class;
     Rect : Qt4.Rect_Fs.Q_Rect_F'Class)
   is
   begin
      QPainter_drawRect_QRectFCR (Self.Object, Qt4.Rect_Fs.Internals.QRectF_View (Rect));
   end Draw_Rect;

   ---------------
   -- Draw_Rect --
   ---------------

   procedure Draw_Rect
    (Self : in out Q_Painter'Class;
     Rect : Qt4.Rects.Q_Rect'Class)
   is
   begin
      QPainter_drawRect_QRectCR (Self.Object, Qt4.Rects.Internals.QRect_View (Rect));
   end Draw_Rect;

   ---------------
   -- Draw_Rect --
   ---------------

   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)
   is
   begin
      QPainter_drawRect_int_int_int_int (Self.Object, X, Y, Width, Height);
   end Draw_Rect;

   ---------------------
   -- Draw_Round_Rect --
   ---------------------

   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)
   is
   begin
      QPainter_drawRoundRect_QRectFCR_int_int (Self.Object, Qt4.Rect_Fs.Internals.QRectF_View (Rect), Xround, Yround);
   end Draw_Round_Rect;

   ---------------------
   -- Draw_Round_Rect --
   ---------------------

   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)
   is
   begin
      QPainter_drawRoundRect_QRectCR_int_int (Self.Object, Qt4.Rects.Internals.QRect_View (Rect), Xround, Yround);
   end Draw_Round_Rect;

   ---------------------
   -- Draw_Round_Rect --
   ---------------------

   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)
   is
   begin
      QPainter_drawRoundRect_int_int_int_int_int_int (Self.Object, X, Y, Width, Height, Xround, Yround);
   end Draw_Round_Rect;

   ---------------
   -- Draw_Text --
   ---------------

   procedure Draw_Text
    (Self : in out Q_Painter'Class;
     Position : Qt4.Point_Fs.Q_Point_F'Class;
     Text : Qt4.Strings.Q_String'Class)
   is
   begin
      QPainter_drawText_QPointFCR_QStringCR (Self.Object, Qt4.Point_Fs.Internals.QPointF_View (Position), Qt4.Strings.Internals.QString_View (Text));
   end Draw_Text;

   ---------------
   -- Draw_Text --
   ---------------

   procedure Draw_Text
    (Self : in out Q_Painter'Class;
     Position : Qt4.Points.Q_Point'Class;
     Text : Qt4.Strings.Q_String'Class)
   is
   begin
      QPainter_drawText_QPointCR_QStringCR (Self.Object, Qt4.Points.Internals.QPoint_View (Position), Qt4.Strings.Internals.QString_View (Text));
   end Draw_Text;

   ---------------
   -- Draw_Text --
   ---------------

   procedure Draw_Text
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Text : Qt4.Strings.Q_String'Class)
   is
   begin
      QPainter_drawText_int_int_QStringCR (Self.Object, X, Y, Qt4.Strings.Internals.QString_View (Text));
   end Draw_Text;

   ---------------
   -- Draw_Text --
   ---------------

   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)
   is
   begin
      QPainter_drawText_QRectFCR_QStringCR_QTextOptionCR (Self.Object, Qt4.Rect_Fs.Internals.QRectF_View (Rectangle), Qt4.Strings.Internals.QString_View (Text), Qt4.Text_Options.Internals.QTextOption_View (Option));
   end Draw_Text;

   ---------------
   -- Draw_Text --
   ---------------

   procedure Draw_Text
    (Self      : in out Q_Painter'Class;
     Rectangle : Qt4.Rects.Q_Rect'Class;
     Flags     : Qt4.Alignment;
     Text      : Qt4.Strings.Q_String'Class)
   is
   begin
      drawText_null_boundingRect_wrapper
       (Internals.QPainter_View (Self),
        Qt4.Rects.Internals.QRect_View (Rectangle),
        Flags,
        Qt4.Strings.Internals.QString_View (Text));
   end Draw_Text;

   -----------------------
   -- Draw_Tiled_Pixmap --
   -----------------------

   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)
   is
   begin
      QPainter_drawTiledPixmap_QRectFCR_QPixmapCR_QPointFCR (Self.Object, Qt4.Rect_Fs.Internals.QRectF_View (Rectangle), Qt4.Pixmaps.Internals.QPixmap_View (Pixmap), Qt4.Point_Fs.Internals.QPointF_View (Position));
   end Draw_Tiled_Pixmap;

   -----------------------
   -- Draw_Tiled_Pixmap --
   -----------------------

   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)
   is
   begin
      QPainter_drawTiledPixmap_QRectCR_QPixmapCR_QPointCR (Self.Object, Qt4.Rects.Internals.QRect_View (Rectangle), Qt4.Pixmaps.Internals.QPixmap_View (Pixmap), Qt4.Points.Internals.QPoint_View (Position));
   end Draw_Tiled_Pixmap;

   -----------------------
   -- Draw_Tiled_Pixmap --
   -----------------------

   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)
   is
   begin
      QPainter_drawTiledPixmap_int_int_int_int_QPixmapCR_int_int (Self.Object, X, Y, Width, Height, Qt4.Pixmaps.Internals.QPixmap_View (Pixmap), Sx, Sy);
   end Draw_Tiled_Pixmap;

   ---------------
   -- End_Paint --
   ---------------

   function End_Paint
    (Self : not null access Q_Painter'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QPainter_end (Self.Object), 0);
   end End_Paint;

   ----------------
   -- Erase_Rect --
   ----------------

   procedure Erase_Rect
    (Self : in out Q_Painter'Class;
     Rectangle : Qt4.Rect_Fs.Q_Rect_F'Class)
   is
   begin
      QPainter_eraseRect_QRectFCR (Self.Object, Qt4.Rect_Fs.Internals.QRectF_View (Rectangle));
   end Erase_Rect;

   ----------------
   -- Erase_Rect --
   ----------------

   procedure Erase_Rect
    (Self : in out Q_Painter'Class;
     Rectangle : Qt4.Rects.Q_Rect'Class)
   is
   begin
      QPainter_eraseRect_QRectCR (Self.Object, Qt4.Rects.Internals.QRect_View (Rectangle));
   end Erase_Rect;

   ----------------
   -- Erase_Rect --
   ----------------

   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)
   is
   begin
      QPainter_eraseRect_int_int_int_int (Self.Object, X, Y, Width, Height);
   end Erase_Rect;

   ---------------
   -- Fill_Path --
   ---------------

   procedure Fill_Path
    (Self : in out Q_Painter'Class;
     Path : Qt4.Painter_Paths.Q_Painter_Path'Class;
     Brush : Qt4.Brushes.Q_Brush'Class)
   is
   begin
      QPainter_fillPath_QPainterPathCR_QBrushCR (Self.Object, Qt4.Painter_Paths.Internals.QPainterPath_View (Path), Qt4.Brushes.Internals.QBrush_View (Brush));
   end Fill_Path;

   ---------------
   -- Fill_Rect --
   ---------------

   procedure Fill_Rect
    (Self : in out Q_Painter'Class;
     Rectangle : Qt4.Rect_Fs.Q_Rect_F'Class;
     Brush : Qt4.Brushes.Q_Brush'Class)
   is
   begin
      QPainter_fillRect_QRectFCR_QBrushCR (Self.Object, Qt4.Rect_Fs.Internals.QRectF_View (Rectangle), Qt4.Brushes.Internals.QBrush_View (Brush));
   end Fill_Rect;

   ---------------
   -- Fill_Rect --
   ---------------

   procedure Fill_Rect
    (Self : in out Q_Painter'Class;
     Rectangle : Qt4.Rects.Q_Rect'Class;
     Brush : Qt4.Brushes.Q_Brush'Class)
   is
   begin
      QPainter_fillRect_QRectCR_QBrushCR (Self.Object, Qt4.Rects.Internals.QRect_View (Rectangle), Qt4.Brushes.Internals.QBrush_View (Brush));
   end Fill_Rect;

   ---------------
   -- Fill_Rect --
   ---------------

   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)
   is
   begin
      QPainter_fillRect_int_int_int_int_QBrushCR (Self.Object, X, Y, Width, Height, Qt4.Brushes.Internals.QBrush_View (Brush));
   end Fill_Rect;

   ----------
   -- Font --
   ----------

   function Font
    (Self : Q_Painter'Class)
       return Qt4.Fonts.Q_Font
   is
   begin
      return Returns : Qt4.Fonts.Q_Font do
         QPainter_font (Qt4.Fonts.Internals.QFont_View (Returns), Self.Object);
      end return;
   end Font;

   ---------------
   -- Font_Info --
   ---------------

   function Font_Info
    (Self : Q_Painter'Class)
       return Qt4.Font_Infos.Q_Font_Info
   is
   begin
      return Returns : Qt4.Font_Infos.Q_Font_Info
        := Qt4.Font_Infos.Internals.Create_Uninitialized
      do
         Qt4.Font_Infos.Internals.Set_QFontInfo_View
          (Returns,
           QPainter_fontInfo
            (Self.Object,
             Qt4.Font_Infos.Internals.Storage (Returns)));
      end return;
   end Font_Info;

   ------------------
   -- Font_Metrics --
   ------------------

   function Font_Metrics
    (Self : Q_Painter'Class)
       return Qt4.Font_Metrics.Q_Font_Metrics
   is
   begin
      return Returns : Qt4.Font_Metrics.Q_Font_Metrics
        := Qt4.Font_Metrics.Internals.Create_Uninitialized
      do
         Qt4.Font_Metrics.Internals.Set_QFontMetrics_View
          (Returns,
           QPainter_fontMetrics
            (Self.Object, Qt4.Font_Metrics.Internals.Storage (Returns)));
      end return;
   end Font_Metrics;

   ------------------
   -- Has_Clipping --
   ------------------

   function Has_Clipping
    (Self : Q_Painter'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QPainter_hasClipping (Self.Object), 0);
   end Has_Clipping;

   ---------------
   -- Is_Active --
   ---------------

   function Is_Active
    (Self : Q_Painter'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QPainter_isActive (Self.Object), 0);
   end Is_Active;

   ----------------------
   -- Layout_Direction --
   ----------------------

   function Layout_Direction
    (Self : Q_Painter'Class)
       return Qt4.Layout_Direction
   is
   begin
      return QPainter_layoutDirection (Self.Object);
   end Layout_Direction;

   ------------
   -- Matrix --
   ------------

   function Matrix
    (Self : Q_Painter'Class)
       return Qt4.Matrices.Q_Matrix
   is
   begin
      return Returns : Qt4.Matrices.Q_Matrix do
         QPainter_matrix (Qt4.Matrices.Internals.QMatrix_View (Returns), Self.Object);
      end return;
   end Matrix;

   --------------------
   -- Matrix_Enabled --
   --------------------

   function Matrix_Enabled
    (Self : Q_Painter'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QPainter_matrixEnabled (Self.Object), 0);
   end Matrix_Enabled;

   -------------
   -- Opacity --
   -------------

   function Opacity
    (Self : Q_Painter'Class)
       return Qt4.Q_Real
   is
   begin
      return QPainter_opacity (Self.Object);
   end Opacity;

   ---------
   -- Pen --
   ---------

   function Pen
    (Self : Q_Painter'Class)
       return Qt4.Pens.Q_Pen
   is
   begin
      return Returns : Qt4.Pens.Q_Pen do
         QPainter_pen (Qt4.Pens.Internals.QPen_View (Returns), Self.Object);
      end return;
   end Pen;

   ------------------
   -- Reset_Matrix --
   ------------------

   procedure Reset_Matrix
    (Self : in out Q_Painter'Class)
   is
   begin
      QPainter_resetMatrix (Self.Object);
   end Reset_Matrix;

   ---------------------
   -- Reset_Transform --
   ---------------------

   procedure Reset_Transform
    (Self : in out Q_Painter'Class)
   is
   begin
      QPainter_resetTransform (Self.Object);
   end Reset_Transform;

   -------------
   -- Restore --
   -------------

   procedure Restore
    (Self : in out Q_Painter'Class)
   is
   begin
      QPainter_restore (Self.Object);
   end Restore;

   ------------
   -- Rotate --
   ------------

   procedure Rotate
    (Self : in out Q_Painter'Class;
     Angle : Qt4.Q_Real)
   is
   begin
      QPainter_rotate_qreal (Self.Object, Angle);
   end Rotate;

   ----------
   -- Save --
   ----------

   procedure Save
    (Self : in out Q_Painter'Class)
   is
   begin
      QPainter_save (Self.Object);
   end Save;

   -----------
   -- Scale --
   -----------

   procedure Scale
    (Self : in out Q_Painter'Class;
     Sx : Qt4.Q_Real;
     Sy : Qt4.Q_Real)
   is
   begin
      QPainter_scale_qreal_qreal (Self.Object, Sx, Sy);
   end Scale;

   --------------------
   -- Set_Background --
   --------------------

   procedure Set_Background
    (Self : in out Q_Painter'Class;
     Brush : Qt4.Brushes.Q_Brush'Class)
   is
   begin
      QPainter_setBackground_QBrushCR (Self.Object, Qt4.Brushes.Internals.QBrush_View (Brush));
   end Set_Background;

   -------------------------
   -- Set_Background_Mode --
   -------------------------

   procedure Set_Background_Mode
    (Self : in out Q_Painter'Class;
     Mode : Qt4.BG_Mode)
   is
   begin
      QPainter_setBackgroundMode_BGMode (Self.Object, Mode);
   end Set_Background_Mode;

   ---------------
   -- Set_Brush --
   ---------------

   procedure Set_Brush
    (Self : in out Q_Painter'Class;
     Brush : Qt4.Brushes.Q_Brush'Class)
   is
   begin
      QPainter_setBrush_QBrushCR (Self.Object, Qt4.Brushes.Internals.QBrush_View (Brush));
   end Set_Brush;

   ---------------
   -- Set_Brush --
   ---------------

   procedure Set_Brush
    (Self : in out Q_Painter'Class;
     Style : Qt4.Brush_Style)
   is
   begin
      QPainter_setBrush_BrushStyle (Self.Object, Style);
   end Set_Brush;

   ----------------------
   -- Set_Brush_Origin --
   ----------------------

   procedure Set_Brush_Origin
    (Self : in out Q_Painter'Class;
     Position : Qt4.Point_Fs.Q_Point_F'Class)
   is
   begin
      QPainter_setBrushOrigin_QPointFCR (Self.Object, Qt4.Point_Fs.Internals.QPointF_View (Position));
   end Set_Brush_Origin;

   ----------------------
   -- Set_Brush_Origin --
   ----------------------

   procedure Set_Brush_Origin
    (Self : in out Q_Painter'Class;
     Position : Qt4.Points.Q_Point'Class)
   is
   begin
      QPainter_setBrushOrigin_QPointCR (Self.Object, Qt4.Points.Internals.QPoint_View (Position));
   end Set_Brush_Origin;

   ----------------------
   -- Set_Brush_Origin --
   ----------------------

   procedure Set_Brush_Origin
    (Self : in out Q_Painter'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer)
   is
   begin
      QPainter_setBrushOrigin_int_int (Self.Object, X, Y);
   end Set_Brush_Origin;

   -------------------
   -- Set_Clip_Path --
   -------------------

   procedure Set_Clip_Path
    (Self : in out Q_Painter'Class;
     Path : Qt4.Painter_Paths.Q_Painter_Path'Class;
     Operation : Qt4.Clip_Operation
       := Replace_Clip)
   is
   begin
      QPainter_setClipPath_QPainterPathCR_ClipOperation (Self.Object, Qt4.Painter_Paths.Internals.QPainterPath_View (Path), Operation);
   end Set_Clip_Path;

   -------------------
   -- Set_Clip_Rect --
   -------------------

   procedure Set_Clip_Rect
    (Self : in out Q_Painter'Class;
     Rectangle : Qt4.Rect_Fs.Q_Rect_F'Class;
     Operation : Qt4.Clip_Operation
       := Replace_Clip)
   is
   begin
      QPainter_setClipRect_QRectFCR_ClipOperation (Self.Object, Qt4.Rect_Fs.Internals.QRectF_View (Rectangle), Operation);
   end Set_Clip_Rect;

   -------------------
   -- Set_Clip_Rect --
   -------------------

   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)
   is
   begin
      QPainter_setClipRect_int_int_int_int_ClipOperation (Self.Object, X, Y, Width, Height, Operation);
   end Set_Clip_Rect;

   -------------------
   -- Set_Clip_Rect --
   -------------------

   procedure Set_Clip_Rect
    (Self : in out Q_Painter'Class;
     Rectangle : Qt4.Rects.Q_Rect'Class;
     Operation : Qt4.Clip_Operation
       := Replace_Clip)
   is
   begin
      QPainter_setClipRect_QRectCR_ClipOperation (Self.Object, Qt4.Rects.Internals.QRect_View (Rectangle), Operation);
   end Set_Clip_Rect;

   ---------------------
   -- Set_Clip_Region --
   ---------------------

   procedure Set_Clip_Region
    (Self : in out Q_Painter'Class;
     Region : Qt4.Regions.Q_Region'Class;
     Operation : Qt4.Clip_Operation
       := Replace_Clip)
   is
   begin
      QPainter_setClipRegion_QRegionCR_ClipOperation (Self.Object, Qt4.Regions.Internals.QRegion_View (Region), Operation);
   end Set_Clip_Region;

   ------------------
   -- Set_Clipping --
   ------------------

   procedure Set_Clipping
    (Self : in out Q_Painter'Class;
     Enable : Boolean)
   is
   begin
      QPainter_setClipping_bool (Self.Object, Qt_Ada.Internals.Boolean_Conversions.To_unsigned (Enable));
   end Set_Clipping;

   --------------------------
   -- Set_Composition_Mode --
   --------------------------

   procedure Set_Composition_Mode
    (Self : in out Q_Painter'Class;
     Mode : Painter_Composition_Mode)
   is
   begin
      QPainter_setCompositionMode_CompositionMode (Self.Object, Mode);
   end Set_Composition_Mode;

   --------------
   -- Set_Font --
   --------------

   procedure Set_Font
    (Self : in out Q_Painter'Class;
     Font : Qt4.Fonts.Q_Font'Class)
   is
   begin
      QPainter_setFont_QFontCR (Self.Object, Qt4.Fonts.Internals.QFont_View (Font));
   end Set_Font;

   --------------------------
   -- Set_Layout_Direction --
   --------------------------

   procedure Set_Layout_Direction
    (Self : in out Q_Painter'Class;
     Direction : Qt4.Layout_Direction)
   is
   begin
      QPainter_setLayoutDirection_LayoutDirection (Self.Object, Direction);
   end Set_Layout_Direction;

   -----------------
   -- Set_Opacity --
   -----------------

   procedure Set_Opacity
    (Self : in out Q_Painter'Class;
     Opacity : Qt4.Q_Real)
   is
   begin
      QPainter_setOpacity_qreal (Self.Object, Opacity);
   end Set_Opacity;

   -------------
   -- Set_Pen --
   -------------

   procedure Set_Pen
    (Self : in out Q_Painter'Class;
     Pen : Qt4.Pens.Q_Pen'Class)
   is
   begin
      QPainter_setPen_QPenCR (Self.Object, Qt4.Pens.Internals.QPen_View (Pen));
   end Set_Pen;

   -------------
   -- Set_Pen --
   -------------

   procedure Set_Pen
    (Self : in out Q_Painter'Class;
     Color : Qt4.Colors.Q_Color'Class)
   is
   begin
      QPainter_setPen_QColorCR (Self.Object, Qt4.Colors.Internals.QColor_View (Color));
   end Set_Pen;

   -------------
   -- Set_Pen --
   -------------

   procedure Set_Pen
    (Self : in out Q_Painter'Class;
     Style : Qt4.Pen_Style)
   is
   begin
      QPainter_setPen_PenStyle (Self.Object, Style);
   end Set_Pen;

   ---------------------
   -- Set_Render_Hint --
   ---------------------

   procedure Set_Render_Hint
    (Self : in out Q_Painter'Class;
     Hint : Render_Hint;
     Enable : Boolean
       := True)
   is
   begin
      QPainter_setRenderHint_RenderHint_bool (Self.Object, Hint, Qt_Ada.Internals.Boolean_Conversions.To_unsigned (Enable));
   end Set_Render_Hint;

   ----------------
   -- Set_Matrix --
   ----------------

   procedure Set_Matrix
    (Self : in out Q_Painter'Class;
     Matrix : Qt4.Matrices.Q_Matrix'Class;
     Combine : Boolean
       := False)
   is
   begin
      QPainter_setMatrix_QMatrixCR_bool (Self.Object, Qt4.Matrices.Internals.QMatrix_View (Matrix), Qt_Ada.Internals.Boolean_Conversions.To_unsigned (Combine));
   end Set_Matrix;

   ------------------------
   -- Set_Matrix_Enabled --
   ------------------------

   procedure Set_Matrix_Enabled
    (Self : in out Q_Painter'Class;
     Enable : Boolean)
   is
   begin
      QPainter_setMatrixEnabled_bool (Self.Object, Qt_Ada.Internals.Boolean_Conversions.To_unsigned (Enable));
   end Set_Matrix_Enabled;

   -------------------
   -- Set_Transform --
   -------------------

   procedure Set_Transform
    (Self : in out Q_Painter'Class;
     Transform : Qt4.Transforms.Q_Transform'Class;
     Combine : Boolean
       := False)
   is
   begin
      QPainter_setTransform_QTransformCR_bool (Self.Object, Qt4.Transforms.Internals.QTransform_View (Transform), Qt_Ada.Internals.Boolean_Conversions.To_unsigned (Combine));
   end Set_Transform;

   --------------------------------
   -- Set_View_Transform_Enabled --
   --------------------------------

   procedure Set_View_Transform_Enabled
    (Self : in out Q_Painter'Class;
     Enable : Boolean)
   is
   begin
      QPainter_setViewTransformEnabled_bool (Self.Object, Qt_Ada.Internals.Boolean_Conversions.To_unsigned (Enable));
   end Set_View_Transform_Enabled;

   ------------------
   -- Set_Viewport --
   ------------------

   procedure Set_Viewport
    (Self : in out Q_Painter'Class;
     Viewport : Qt4.Rects.Q_Rect'Class)
   is
   begin
      QPainter_setViewport_QRectCR (Self.Object, Qt4.Rects.Internals.QRect_View (Viewport));
   end Set_Viewport;

   ------------------
   -- Set_Viewport --
   ------------------

   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)
   is
   begin
      QPainter_setViewport_int_int_int_int (Self.Object, X, Y, Width, Height);
   end Set_Viewport;

   ----------------
   -- Set_Window --
   ----------------

   procedure Set_Window
    (Self : in out Q_Painter'Class;
     Window : Qt4.Rects.Q_Rect'Class)
   is
   begin
      QPainter_setWindow_QRectCR (Self.Object, Qt4.Rects.Internals.QRect_View (Window));
   end Set_Window;

   ----------------
   -- Set_Window --
   ----------------

   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)
   is
   begin
      QPainter_setWindow_int_int_int_int (Self.Object, X, Y, Width, Height);
   end Set_Window;

   ----------------------
   -- Set_World_Matrix --
   ----------------------

   procedure Set_World_Matrix
    (Self : in out Q_Painter'Class;
     Matrix : Qt4.Matrices.Q_Matrix'Class;
     Combine : Boolean
       := False)
   is
   begin
      QPainter_setWorldMatrix_QMatrixCR_bool (Self.Object, Qt4.Matrices.Internals.QMatrix_View (Matrix), Qt_Ada.Internals.Boolean_Conversions.To_unsigned (Combine));
   end Set_World_Matrix;

   ------------------------------
   -- Set_World_Matrix_Enabled --
   ------------------------------

   procedure Set_World_Matrix_Enabled
    (Self : in out Q_Painter'Class;
     Enable : Boolean)
   is
   begin
      QPainter_setWorldMatrixEnabled_bool (Self.Object, Qt_Ada.Internals.Boolean_Conversions.To_unsigned (Enable));
   end Set_World_Matrix_Enabled;

   -------------------------
   -- Set_World_Transform --
   -------------------------

   procedure Set_World_Transform
    (Self : in out Q_Painter'Class;
     Matrix : Qt4.Transforms.Q_Transform'Class;
     Combine : Boolean
       := False)
   is
   begin
      QPainter_setWorldTransform_QTransformCR_bool (Self.Object, Qt4.Transforms.Internals.QTransform_View (Matrix), Qt_Ada.Internals.Boolean_Conversions.To_unsigned (Combine));
   end Set_World_Transform;

   -----------
   -- Shear --
   -----------

   procedure Shear
    (Self : in out Q_Painter'Class;
     Sh : Qt4.Q_Real;
     Sv : Qt4.Q_Real)
   is
   begin
      QPainter_shear_qreal_qreal (Self.Object, Sh, Sv);
   end Shear;

   -----------------
   -- Stroke_Path --
   -----------------

   procedure Stroke_Path
    (Self : in out Q_Painter'Class;
     Path : Qt4.Painter_Paths.Q_Painter_Path'Class;
     Pen : Qt4.Pens.Q_Pen'Class)
   is
   begin
      QPainter_strokePath_QPainterPathCR_QPenCR (Self.Object, Qt4.Painter_Paths.Internals.QPainterPath_View (Path), Qt4.Pens.Internals.QPen_View (Pen));
   end Stroke_Path;

   ----------------------
   -- Test_Render_Hint --
   ----------------------

   function Test_Render_Hint
    (Self : Q_Painter'Class;
     Hint : Render_Hint)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QPainter_testRenderHint_RenderHint (Self.Object, Hint), 0);
   end Test_Render_Hint;

   ---------------
   -- Transform --
   ---------------

   function Transform
    (Self : Q_Painter'Class)
       return Qt4.Transforms.Q_Transform
   is
   begin
      return Returns : Qt4.Transforms.Q_Transform do
         QPainter_transform (Qt4.Transforms.Internals.QTransform_View (Returns), Self.Object);
      end return;
   end Transform;

   ---------------
   -- Translate --
   ---------------

   procedure Translate
    (Self : in out Q_Painter'Class;
     Offset : Qt4.Point_Fs.Q_Point_F'Class)
   is
   begin
      QPainter_translate_QPointFCR (Self.Object, Qt4.Point_Fs.Internals.QPointF_View (Offset));
   end Translate;

   ---------------
   -- Translate --
   ---------------

   procedure Translate
    (Self : in out Q_Painter'Class;
     Offset : Qt4.Points.Q_Point'Class)
   is
   begin
      QPainter_translate_QPointCR (Self.Object, Qt4.Points.Internals.QPoint_View (Offset));
   end Translate;

   ---------------
   -- Translate --
   ---------------

   procedure Translate
    (Self : in out Q_Painter'Class;
     Dx : Qt4.Q_Real;
     Dy : Qt4.Q_Real)
   is
   begin
      QPainter_translate_qreal_qreal (Self.Object, Dx, Dy);
   end Translate;

   ----------------------------
   -- View_Transform_Enabled --
   ----------------------------

   function View_Transform_Enabled
    (Self : Q_Painter'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QPainter_viewTransformEnabled (Self.Object), 0);
   end View_Transform_Enabled;

   --------------
   -- Viewport --
   --------------

   function Viewport
    (Self : Q_Painter'Class)
       return Qt4.Rects.Q_Rect
   is
   begin
      return Returns : Qt4.Rects.Q_Rect do
         QPainter_viewport (Qt4.Rects.Internals.QRect_View (Returns), Self.Object);
      end return;
   end Viewport;

   ------------
   -- Window --
   ------------

   function Window
    (Self : Q_Painter'Class)
       return Qt4.Rects.Q_Rect
   is
   begin
      return Returns : Qt4.Rects.Q_Rect do
         QPainter_window (Qt4.Rects.Internals.QRect_View (Returns), Self.Object);
      end return;
   end Window;

   ------------------
   -- World_Matrix --
   ------------------

   function World_Matrix
    (Self : Q_Painter'Class)
       return Qt4.Matrices.Q_Matrix
   is
   begin
      return Returns : Qt4.Matrices.Q_Matrix do
         QPainter_worldMatrix (Qt4.Matrices.Internals.QMatrix_View (Returns), Self.Object);
      end return;
   end World_Matrix;

   --------------------------
   -- World_Matrix_Enabled --
   --------------------------

   function World_Matrix_Enabled
    (Self : Q_Painter'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QPainter_worldMatrixEnabled (Self.Object), 0);
   end World_Matrix_Enabled;

   ---------------------
   -- World_Transform --
   ---------------------

   function World_Transform
    (Self : Q_Painter'Class)
       return Qt4.Transforms.Q_Transform
   is
   begin
      return Returns : Qt4.Transforms.Q_Transform do
         QPainter_worldTransform (Qt4.Transforms.Internals.QTransform_View (Returns), Self.Object);
      end return;
   end World_Transform;

   ---------------
   -- Internals --
   ---------------

   package body Internals is

   -------------------
   -- QPainter_View --
   -------------------

      function QPainter_View
       (Item : Q_Painter'Class)
          return QPainter_Access
      is
      begin
         return Item.Object;
      end QPainter_View;

      package QPainter_Conversions is
        new System.Address_To_Access_Conversions
             (QPainter);

   ------------------------
   -- QPainterTo_Pointer --
   ------------------------

      function To_Pointer
       (Address : System.Address)
          return QPainter_Access
      is
      begin
         return
           QPainter_Access
            (QPainter_Conversions.To_Pointer
            (Address));
      end To_Pointer;

   ------------------------
   -- QPainterTo_Address --
   ------------------------

      function To_Address
       (Pointer : QPainter_Access)
          return System.Address
      is
      begin
         return
           QPainter_Conversions.To_Address
            (QPainter_Conversions.Object_Pointer
              (Pointer));
      end To_Address;

   --------------------
   -- Create_Wrapper --
   --------------------

      function Create_Wrapper
       (Item : Internals.QPainter_Access)
          return Q_Painter
      is
      begin
         return Q_Painter'
          (Ada.Finalization.Limited_Controlled with
             Object  => Item,
             Wrapper => True,
             others  => <>);
      end Create_Wrapper;

   end Internals;

end Qt4.Painters;
