------------------------------------------------------------------------------
--                                                                          --
--                An Ada2005 binding to the Qt C++ framework                --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
-- Copyright © 2007-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.                                      --
--                                                                          --
------------------------------------------------------------------------------
--    This file has been generated automatically. Please don't edit it.     --
------------------------------------------------------------------------------
pragma Style_Checks ("NM32766");
with System.Address_To_Access_Conversions;

package body Qt4.Matrices is

   function initialize_QMatrix
    (Storage : System.Address)
      return Internals.QMatrix_Access;
   pragma Import (C, initialize_QMatrix, "__QtAda_inititialize_QMatrix");

   function initialize_QMatrix_qreal_qreal_qreal_qreal_qreal_qreal
    (Storage : System.Address;
     M_11 : Qt4.Q_Real;
     M_12 : Qt4.Q_Real;
     M_21 : Qt4.Q_Real;
     M_22 : Qt4.Q_Real;
     Dx : Qt4.Q_Real;
     Dy : Qt4.Q_Real)
      return Internals.QMatrix_Access;
   pragma Import (C, initialize_QMatrix_qreal_qreal_qreal_qreal_qreal_qreal, "__QtAda_inititialize_QMatrix_qreal_qreal_qreal_qreal_qreal_qreal");

   function adjust_QMatrix
    (Storage : System.Address;
     From    : Internals.QMatrix_Access)
       return Internals.QMatrix_Access;
   pragma Import (C, adjust_QMatrix, "__QtAda_adjust_QMatrix");

   procedure finalize_QMatrix (Object : Internals.QMatrix_Access);
   pragma Import (C, finalize_QMatrix, "__QtAda_finalize_QMatrix");

   function QMatrix_m11
    (Self : Internals.QMatrix_Access)
       return Qt4.Q_Real;
   pragma Import (C, QMatrix_m11, "__QtAda_QMatrix_m11_Q");

   function QMatrix_m12
    (Self : Internals.QMatrix_Access)
       return Qt4.Q_Real;
   pragma Import (C, QMatrix_m12, "__QtAda_QMatrix_m12_Q");

   function QMatrix_m21
    (Self : Internals.QMatrix_Access)
       return Qt4.Q_Real;
   pragma Import (C, QMatrix_m21, "__QtAda_QMatrix_m21_Q");

   function QMatrix_m22
    (Self : Internals.QMatrix_Access)
       return Qt4.Q_Real;
   pragma Import (C, QMatrix_m22, "__QtAda_QMatrix_m22_Q");

   function QMatrix_det
    (Self : Internals.QMatrix_Access)
       return Qt4.Q_Real;
   pragma Import (C, QMatrix_det, "__QtAda_QMatrix_det_Q");

   function QMatrix_dx
    (Self : Internals.QMatrix_Access)
       return Qt4.Q_Real;
   pragma Import (C, QMatrix_dx, "__QtAda_QMatrix_dx_Q");

   function QMatrix_dy
    (Self : Internals.QMatrix_Access)
       return Qt4.Q_Real;
   pragma Import (C, QMatrix_dy, "__QtAda_QMatrix_dy_Q");

   procedure QMatrix_inverted
    (Returns : Internals.QMatrix_Access;
     Self : Internals.QMatrix_Access);
   pragma Import (C, QMatrix_inverted, "__QtAda_QMatrix_inverted_Q");

   function QMatrix_isIdentity
    (Self : Internals.QMatrix_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QMatrix_isIdentity, "__QtAda_QMatrix_isIdentity_Q");

   function QMatrix_isInvertible
    (Self : Internals.QMatrix_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QMatrix_isInvertible, "__QtAda_QMatrix_isInvertible_Q");

   procedure QMatrix_map_qreal_qreal_qrealP_qrealP
    (Self : Internals.QMatrix_Access;
     X : Qt4.Q_Real;
     Y : Qt4.Q_Real;
     Tx : out Qt4.Q_Real;
     Ty : out Qt4.Q_Real);
   pragma Import (C, QMatrix_map_qreal_qreal_qrealP_qrealP, "__QtAda_QMatrix_map_qreal_qreal_qrealP_qrealP_Q");

   procedure QMatrix_map_int_int_intP_intP
    (Self : Internals.QMatrix_Access;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Tx : out Qt4.Q_Integer;
     Ty : out Qt4.Q_Integer);
   pragma Import (C, QMatrix_map_int_int_intP_intP, "__QtAda_QMatrix_map_int_int_intP_intP_Q");

   procedure QMatrix_map_QPointCR
    (Returns : Qt4.Points.Internals.QPoint_Access;
     Self : Internals.QMatrix_Access;
     P : Qt4.Points.Internals.QPoint_Access);
   pragma Import (C, QMatrix_map_QPointCR, "__QtAda_QMatrix_map_QPointCR_Q");

   procedure QMatrix_map_QPointFCR
    (Returns : Qt4.Point_Fs.Internals.QPointF_Access;
     Self : Internals.QMatrix_Access;
     P : Qt4.Point_Fs.Internals.QPointF_Access);
   pragma Import (C, QMatrix_map_QPointFCR, "__QtAda_QMatrix_map_QPointFCR_Q");

   procedure QMatrix_map_QLineCR
    (Returns : Qt4.Lines.Internals.QLine_Access;
     Self : Internals.QMatrix_Access;
     P : Qt4.Lines.Internals.QLine_Access);
   pragma Import (C, QMatrix_map_QLineCR, "__QtAda_QMatrix_map_QLineCR_Q");

   procedure QMatrix_map_QLineFCR
    (Returns : Qt4.Line_Fs.Internals.QLineF_Access;
     Self : Internals.QMatrix_Access;
     P : Qt4.Line_Fs.Internals.QLineF_Access);
   pragma Import (C, QMatrix_map_QLineFCR, "__QtAda_QMatrix_map_QLineFCR_Q");

   procedure QMatrix_map_QPolygonCR
    (Returns : Qt4.Polygons.Internals.QPolygon_Access;
     Self : Internals.QMatrix_Access;
     P : Qt4.Polygons.Internals.QPolygon_Access);
   pragma Import (C, QMatrix_map_QPolygonCR, "__QtAda_QMatrix_map_QPolygonCR_Q");

   procedure QMatrix_map_QPolygonFCR
    (Returns : Qt4.Polygon_Fs.Internals.QPolygonF_Access;
     Self : Internals.QMatrix_Access;
     P : Qt4.Polygon_Fs.Internals.QPolygonF_Access);
   pragma Import (C, QMatrix_map_QPolygonFCR, "__QtAda_QMatrix_map_QPolygonFCR_Q");

   procedure QMatrix_map_QRegionCR
    (Returns : Qt4.Regions.Internals.QRegion_Access;
     Self : Internals.QMatrix_Access;
     P : Qt4.Regions.Internals.QRegion_Access);
   pragma Import (C, QMatrix_map_QRegionCR, "__QtAda_QMatrix_map_QRegionCR_Q");

--   procedure QMatrix_map_QPainterPathCR
--    (Returns : Qt4.Painter_Paths.Internals.QPainterPath_Access;
--     Self : Internals.QMatrix_Access;
--     P : Qt4.Painter_Paths.Internals.QPainterPath_Access);
--   pragma Import (C, QMatrix_map_QPainterPathCR, "__QtAda_QMatrix_map_QPainterPathCR_Q");

   procedure QMatrix_mapRect_QRectCR
    (Returns : Qt4.Rects.Internals.QRect_Access;
     Self : Internals.QMatrix_Access;
     P : Qt4.Rects.Internals.QRect_Access);
   pragma Import (C, QMatrix_mapRect_QRectCR, "__QtAda_QMatrix_mapRect_QRectCR_Q");

   procedure QMatrix_mapRect_QRectFCR
    (Returns : Qt4.Rect_Fs.Internals.QRectF_Access;
     Self : Internals.QMatrix_Access;
     P : Qt4.Rect_Fs.Internals.QRectF_Access);
   pragma Import (C, QMatrix_mapRect_QRectFCR, "__QtAda_QMatrix_mapRect_QRectFCR_Q");

   procedure QMatrix_mapToPolygon_QRectCR
    (Returns : Qt4.Polygons.Internals.QPolygon_Access;
     Self : Internals.QMatrix_Access;
     P : Qt4.Rects.Internals.QRect_Access);
   pragma Import (C, QMatrix_mapToPolygon_QRectCR, "__QtAda_QMatrix_mapToPolygon_QRectCR_Q");

   procedure QMatrix_reset
    (Self : Internals.QMatrix_Access);
   pragma Import (C, QMatrix_reset, "__QtAda_QMatrix_reset");

   procedure QMatrix_rotate_qreal
    (Self : Internals.QMatrix_Access;
     A : Qt4.Q_Real);
   pragma Import (C, QMatrix_rotate_qreal, "__QtAda_QMatrix_rotate_qreal");

   procedure QMatrix_scale_qreal_qreal
    (Self : Internals.QMatrix_Access;
     Sx : Qt4.Q_Real;
     Sy : Qt4.Q_Real);
   pragma Import (C, QMatrix_scale_qreal_qreal, "__QtAda_QMatrix_scale_qreal_qreal");

   procedure QMatrix_setMatrix_qreal_qreal_qreal_qreal_qreal_qreal
    (Self : Internals.QMatrix_Access;
     M_11 : Qt4.Q_Real;
     M_12 : Qt4.Q_Real;
     M_21 : Qt4.Q_Real;
     M_22 : Qt4.Q_Real;
     Dx : Qt4.Q_Real;
     Dy : Qt4.Q_Real);
   pragma Import (C, QMatrix_setMatrix_qreal_qreal_qreal_qreal_qreal_qreal, "__QtAda_QMatrix_setMatrix_qreal_qreal_qreal_qreal_qreal_qreal");

   procedure QMatrix_shear_qreal_qreal
    (Self : Internals.QMatrix_Access;
     Sh : Qt4.Q_Real;
     Sv : Qt4.Q_Real);
   pragma Import (C, QMatrix_shear_qreal_qreal, "__QtAda_QMatrix_shear_qreal_qreal");

   procedure QMatrix_translate_qreal_qreal
    (Self : Internals.QMatrix_Access;
     Dx : Qt4.Q_Real;
     Dy : Qt4.Q_Real);
   pragma Import (C, QMatrix_translate_qreal_qreal, "__QtAda_QMatrix_translate_qreal_qreal");

   function eq_QMatrixCR
    (Self : Internals.QMatrix_Access;
     Matrix : Internals.QMatrix_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, eq_QMatrixCR, "__QtAda_QMatrix_eq_QMatrixCR_Q");

   procedure multiplication_QMatrixCR
    (Returns : Internals.QMatrix_Access;
     Self : Internals.QMatrix_Access;
     O : Internals.QMatrix_Access);
   pragma Import (C, multiplication_QMatrixCR, "__QtAda_QMatrix_multiplication_QMatrixCR_Q");

   procedure multiplication_QPointCR_QMatrixCR
    (Returns : Qt4.Points.Internals.QPoint_Access;
     P : Qt4.Points.Internals.QPoint_Access;
     M : Internals.QMatrix_Access);
   pragma Import (C, multiplication_QPointCR_QMatrixCR, "__QtAda_multiplication_QPointCR_QMatrixCR");

   procedure multiplication_QPointFCR_QMatrixCR
    (Returns : Qt4.Point_Fs.Internals.QPointF_Access;
     P : Qt4.Point_Fs.Internals.QPointF_Access;
     M : Internals.QMatrix_Access);
   pragma Import (C, multiplication_QPointFCR_QMatrixCR, "__QtAda_multiplication_QPointFCR_QMatrixCR");

   procedure multiplication_QLineCR_QMatrixCR
    (Returns : Qt4.Lines.Internals.QLine_Access;
     P : Qt4.Lines.Internals.QLine_Access;
     M : Internals.QMatrix_Access);
   pragma Import (C, multiplication_QLineCR_QMatrixCR, "__QtAda_multiplication_QLineCR_QMatrixCR");

   procedure multiplication_QLineFCR_QMatrixCR
    (Returns : Qt4.Line_Fs.Internals.QLineF_Access;
     P : Qt4.Line_Fs.Internals.QLineF_Access;
     M : Internals.QMatrix_Access);
   pragma Import (C, multiplication_QLineFCR_QMatrixCR, "__QtAda_multiplication_QLineFCR_QMatrixCR");

   procedure multiplication_QPolygonCR_QMatrixCR
    (Returns : Qt4.Polygons.Internals.QPolygon_Access;
     P : Qt4.Polygons.Internals.QPolygon_Access;
     M : Internals.QMatrix_Access);
   pragma Import (C, multiplication_QPolygonCR_QMatrixCR, "__QtAda_multiplication_QPolygonCR_QMatrixCR");

   procedure multiplication_QPolygonFCR_QMatrixCR
    (Returns : Qt4.Polygon_Fs.Internals.QPolygonF_Access;
     P : Qt4.Polygon_Fs.Internals.QPolygonF_Access;
     M : Internals.QMatrix_Access);
   pragma Import (C, multiplication_QPolygonFCR_QMatrixCR, "__QtAda_multiplication_QPolygonFCR_QMatrixCR");

   procedure multiplication_QRegionCR_QMatrixCR
    (Returns : Qt4.Regions.Internals.QRegion_Access;
     P : Qt4.Regions.Internals.QRegion_Access;
     M : Internals.QMatrix_Access);
   pragma Import (C, multiplication_QRegionCR_QMatrixCR, "__QtAda_multiplication_QRegionCR_QMatrixCR");

--   procedure multiplication_QPainterPathCR_QMatrixCR
--    (Returns : Qt4.Painter_Paths.Internals.QPainterPath_Access;
--     P : Qt4.Painter_Paths.Internals.QPainterPath_Access;
--     M : Internals.QMatrix_Access);
--   pragma Import (C, multiplication_QPainterPathCR_QMatrixCR, "__QtAda_multiplication_QPainterPathCR_QMatrixCR");

   ------------
   -- Adjust --
   ------------

   overriding
   procedure Adjust (Self : in out Q_Matrix) is
   begin
      Self.Object := adjust_QMatrix (Self.Storage'Address, Self.Object);
      Self.Wrapper := False;
   end Adjust;

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

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

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

   overriding
   procedure Initialize (Self : in out Q_Matrix) is
      use type Internals.QMatrix_Access;

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

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

   function Create return Q_Matrix is
   begin
      return Self : Q_Matrix
        := (Ada.Finalization.Controlled with others => <>)
      do
         Self.Object := initialize_QMatrix (Self.Storage'Address);
      end return;
   end Create;

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

   function Create
    (M_11 : Qt4.Q_Real;
     M_12 : Qt4.Q_Real;
     M_21 : Qt4.Q_Real;
     M_22 : Qt4.Q_Real;
     Dx : Qt4.Q_Real;
     Dy : Qt4.Q_Real)
       return Q_Matrix
   is
   begin
      return Self : Q_Matrix
        := (Ada.Finalization.Controlled with others => <>)
      do
         Self.Object := initialize_QMatrix_qreal_qreal_qreal_qreal_qreal_qreal (Self.Storage'Address, M_11, M_12, M_21, M_22, Dx, Dy);
      end return;
   end Create;

   ----------
   -- M_11 --
   ----------

   function M_11
    (Self : Q_Matrix'Class)
       return Qt4.Q_Real
   is
   begin
      return QMatrix_m11 (Self.Object);
   end M_11;

   ----------
   -- M_12 --
   ----------

   function M_12
    (Self : Q_Matrix'Class)
       return Qt4.Q_Real
   is
   begin
      return QMatrix_m12 (Self.Object);
   end M_12;

   ----------
   -- M_21 --
   ----------

   function M_21
    (Self : Q_Matrix'Class)
       return Qt4.Q_Real
   is
   begin
      return QMatrix_m21 (Self.Object);
   end M_21;

   ----------
   -- M_22 --
   ----------

   function M_22
    (Self : Q_Matrix'Class)
       return Qt4.Q_Real
   is
   begin
      return QMatrix_m22 (Self.Object);
   end M_22;

   ---------
   -- Det --
   ---------

   function Det
    (Self : Q_Matrix'Class)
       return Qt4.Q_Real
   is
   begin
      return QMatrix_det (Self.Object);
   end Det;

   --------
   -- Dx --
   --------

   function Dx
    (Self : Q_Matrix'Class)
       return Qt4.Q_Real
   is
   begin
      return QMatrix_dx (Self.Object);
   end Dx;

   --------
   -- Dy --
   --------

   function Dy
    (Self : Q_Matrix'Class)
       return Qt4.Q_Real
   is
   begin
      return QMatrix_dy (Self.Object);
   end Dy;

   --------------
   -- Inverted --
   --------------

   function Inverted
    (Self : Q_Matrix'Class)
       return Q_Matrix
   is
   begin
      return Returns : Q_Matrix do
         QMatrix_inverted (Returns.Object, Self.Object);
      end return;
   end Inverted;

   -----------------
   -- Is_Identity --
   -----------------

   function Is_Identity
    (Self : Q_Matrix'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QMatrix_isIdentity (Self.Object), 0);
   end Is_Identity;

   -------------------
   -- Is_Invertible --
   -------------------

   function Is_Invertible
    (Self : Q_Matrix'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QMatrix_isInvertible (Self.Object), 0);
   end Is_Invertible;

   ---------
   -- Map --
   ---------

   procedure Map
    (Self : Q_Matrix'Class;
     X : Qt4.Q_Real;
     Y : Qt4.Q_Real;
     Tx : out Qt4.Q_Real;
     Ty : out Qt4.Q_Real)
   is
   begin
      QMatrix_map_qreal_qreal_qrealP_qrealP (Self.Object, X, Y, Tx, Ty);
   end Map;

   ---------
   -- Map --
   ---------

   procedure Map
    (Self : Q_Matrix'Class;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer;
     Tx : out Qt4.Q_Integer;
     Ty : out Qt4.Q_Integer)
   is
   begin
      QMatrix_map_int_int_intP_intP (Self.Object, X, Y, Tx, Ty);
   end Map;

   ---------
   -- Map --
   ---------

   function Map
    (Self : Q_Matrix'Class;
     P : Qt4.Points.Q_Point'Class)
       return Qt4.Points.Q_Point
   is
   begin
      return Returns : Qt4.Points.Q_Point do
         QMatrix_map_QPointCR (Qt4.Points.Internals.QPoint_View (Returns), Self.Object, Qt4.Points.Internals.QPoint_View (P));
      end return;
   end Map;

   ---------
   -- Map --
   ---------

   function Map
    (Self : Q_Matrix'Class;
     P : Qt4.Point_Fs.Q_Point_F'Class)
       return Qt4.Point_Fs.Q_Point_F
   is
   begin
      return Returns : Qt4.Point_Fs.Q_Point_F do
         QMatrix_map_QPointFCR (Qt4.Point_Fs.Internals.QPointF_View (Returns), Self.Object, Qt4.Point_Fs.Internals.QPointF_View (P));
      end return;
   end Map;

   ---------
   -- Map --
   ---------

   function Map
    (Self : Q_Matrix'Class;
     P : Qt4.Lines.Q_Line'Class)
       return Qt4.Lines.Q_Line
   is
   begin
      return Returns : Qt4.Lines.Q_Line do
         QMatrix_map_QLineCR (Qt4.Lines.Internals.QLine_View (Returns), Self.Object, Qt4.Lines.Internals.QLine_View (P));
      end return;
   end Map;

   ---------
   -- Map --
   ---------

   function Map
    (Self : Q_Matrix'Class;
     P : Qt4.Line_Fs.Q_Line_F'Class)
       return Qt4.Line_Fs.Q_Line_F
   is
   begin
      return Returns : Qt4.Line_Fs.Q_Line_F do
         QMatrix_map_QLineFCR (Qt4.Line_Fs.Internals.QLineF_View (Returns), Self.Object, Qt4.Line_Fs.Internals.QLineF_View (P));
      end return;
   end Map;

   ---------
   -- Map --
   ---------

   function Map
    (Self : Q_Matrix'Class;
     P : Qt4.Polygons.Q_Polygon'Class)
       return Qt4.Polygons.Q_Polygon
   is
   begin
      return Returns : Qt4.Polygons.Q_Polygon do
         QMatrix_map_QPolygonCR (Qt4.Polygons.Internals.QPolygon_View (Returns), Self.Object, Qt4.Polygons.Internals.QPolygon_View (P));
      end return;
   end Map;

   ---------
   -- Map --
   ---------

   function Map
    (Self : Q_Matrix'Class;
     P : Qt4.Polygon_Fs.Q_Polygon_F'Class)
       return Qt4.Polygon_Fs.Q_Polygon_F
   is
   begin
      return Returns : Qt4.Polygon_Fs.Q_Polygon_F do
         QMatrix_map_QPolygonFCR (Qt4.Polygon_Fs.Internals.QPolygonF_View (Returns), Self.Object, Qt4.Polygon_Fs.Internals.QPolygonF_View (P));
      end return;
   end Map;

   ---------
   -- Map --
   ---------

   function Map
    (Self : Q_Matrix'Class;
     P : Qt4.Regions.Q_Region'Class)
       return Qt4.Regions.Q_Region
   is
   begin
      return Returns : Qt4.Regions.Q_Region do
         QMatrix_map_QRegionCR (Qt4.Regions.Internals.QRegion_View (Returns), Self.Object, Qt4.Regions.Internals.QRegion_View (P));
      end return;
   end Map;

--   ---------
--   -- Map --
--   ---------
--
--   function Map
--    (Self : Q_Matrix'Class;
--     P : Qt4.Painter_Paths.Q_Painter_Path'Class)
--       return Qt4.Painter_Paths.Q_Painter_Path
--   is
--   begin
--      return Returns : Qt4.Painter_Paths.Q_Painter_Path do
--         QMatrix_map_QPainterPathCR (Qt4.Painter_Paths.Internals.QPainterPath_View (Returns), Self.Object, Qt4.Painter_Paths.Internals.QPainterPath_View (P));
--      end return;
--   end Map;

   --------------
   -- Map_Rect --
   --------------

   function Map_Rect
    (Self : Q_Matrix'Class;
     P : Qt4.Rects.Q_Rect'Class)
       return Qt4.Rects.Q_Rect
   is
   begin
      return Returns : Qt4.Rects.Q_Rect do
         QMatrix_mapRect_QRectCR (Qt4.Rects.Internals.QRect_View (Returns), Self.Object, Qt4.Rects.Internals.QRect_View (P));
      end return;
   end Map_Rect;

   --------------
   -- Map_Rect --
   --------------

   function Map_Rect
    (Self : Q_Matrix'Class;
     P : Qt4.Rect_Fs.Q_Rect_F'Class)
       return Qt4.Rect_Fs.Q_Rect_F
   is
   begin
      return Returns : Qt4.Rect_Fs.Q_Rect_F do
         QMatrix_mapRect_QRectFCR (Qt4.Rect_Fs.Internals.QRectF_View (Returns), Self.Object, Qt4.Rect_Fs.Internals.QRectF_View (P));
      end return;
   end Map_Rect;

   --------------------
   -- Map_To_Polygon --
   --------------------

   function Map_To_Polygon
    (Self : Q_Matrix'Class;
     P : Qt4.Rects.Q_Rect'Class)
       return Qt4.Polygons.Q_Polygon
   is
   begin
      return Returns : Qt4.Polygons.Q_Polygon do
         QMatrix_mapToPolygon_QRectCR (Qt4.Polygons.Internals.QPolygon_View (Returns), Self.Object, Qt4.Rects.Internals.QRect_View (P));
      end return;
   end Map_To_Polygon;

   -----------
   -- Reset --
   -----------

   procedure Reset
    (Self : in out Q_Matrix'Class)
   is
   begin
      QMatrix_reset (Self.Object);
   end Reset;

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

   procedure Rotate
    (Self : in out Q_Matrix'Class;
     A : Qt4.Q_Real)
   is
   begin
      QMatrix_rotate_qreal (Self.Object, A);
   end Rotate;

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

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

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

   procedure Set_Matrix
    (Self : in out Q_Matrix'Class;
     M_11 : Qt4.Q_Real;
     M_12 : Qt4.Q_Real;
     M_21 : Qt4.Q_Real;
     M_22 : Qt4.Q_Real;
     Dx : Qt4.Q_Real;
     Dy : Qt4.Q_Real)
   is
   begin
      QMatrix_setMatrix_qreal_qreal_qreal_qreal_qreal_qreal (Self.Object, M_11, M_12, M_21, M_22, Dx, Dy);
   end Set_Matrix;

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

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

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

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

   ---------
   -- "=" --
   ---------

   function "="
    (Self : Q_Matrix;
     Matrix : Q_Matrix)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (eq_QMatrixCR (Self.Object, Matrix.Object), 0);
   end "=";

   ---------
   -- "*" --
   ---------

   function "*"
    (Self : Q_Matrix;
     O : Q_Matrix)
       return Q_Matrix
   is
   begin
      return Returns : Q_Matrix do
         multiplication_QMatrixCR (Returns.Object, Self.Object, O.Object);
      end return;
   end "*";

   ---------
   -- "*" --
   ---------

   function "*"
    (P : Qt4.Points.Q_Point'Class;
     M : Q_Matrix)
       return Qt4.Points.Q_Point
   is
   begin
      return Returns : Qt4.Points.Q_Point do
         multiplication_QPointCR_QMatrixCR (Qt4.Points.Internals.QPoint_View (Returns), Qt4.Points.Internals.QPoint_View (P), M.Object);
      end return;
   end "*";

   ---------
   -- "*" --
   ---------

   function "*"
    (P : Qt4.Point_Fs.Q_Point_F'Class;
     M : Q_Matrix)
       return Qt4.Point_Fs.Q_Point_F
   is
   begin
      return Returns : Qt4.Point_Fs.Q_Point_F do
         multiplication_QPointFCR_QMatrixCR (Qt4.Point_Fs.Internals.QPointF_View (Returns), Qt4.Point_Fs.Internals.QPointF_View (P), M.Object);
      end return;
   end "*";

   ---------
   -- "*" --
   ---------

   function "*"
    (P : Qt4.Lines.Q_Line'Class;
     M : Q_Matrix)
       return Qt4.Lines.Q_Line
   is
   begin
      return Returns : Qt4.Lines.Q_Line do
         multiplication_QLineCR_QMatrixCR (Qt4.Lines.Internals.QLine_View (Returns), Qt4.Lines.Internals.QLine_View (P), M.Object);
      end return;
   end "*";

   ---------
   -- "*" --
   ---------

   function "*"
    (P : Qt4.Line_Fs.Q_Line_F'Class;
     M : Q_Matrix)
       return Qt4.Line_Fs.Q_Line_F
   is
   begin
      return Returns : Qt4.Line_Fs.Q_Line_F do
         multiplication_QLineFCR_QMatrixCR (Qt4.Line_Fs.Internals.QLineF_View (Returns), Qt4.Line_Fs.Internals.QLineF_View (P), M.Object);
      end return;
   end "*";

   ---------
   -- "*" --
   ---------

   function "*"
    (P : Qt4.Polygons.Q_Polygon'Class;
     M : Q_Matrix)
       return Qt4.Polygons.Q_Polygon
   is
   begin
      return Returns : Qt4.Polygons.Q_Polygon do
         multiplication_QPolygonCR_QMatrixCR (Qt4.Polygons.Internals.QPolygon_View (Returns), Qt4.Polygons.Internals.QPolygon_View (P), M.Object);
      end return;
   end "*";

   ---------
   -- "*" --
   ---------

   function "*"
    (P : Qt4.Polygon_Fs.Q_Polygon_F'Class;
     M : Q_Matrix)
       return Qt4.Polygon_Fs.Q_Polygon_F
   is
   begin
      return Returns : Qt4.Polygon_Fs.Q_Polygon_F do
         multiplication_QPolygonFCR_QMatrixCR (Qt4.Polygon_Fs.Internals.QPolygonF_View (Returns), Qt4.Polygon_Fs.Internals.QPolygonF_View (P), M.Object);
      end return;
   end "*";

   ---------
   -- "*" --
   ---------

   function "*"
    (P : Qt4.Regions.Q_Region'Class;
     M : Q_Matrix)
       return Qt4.Regions.Q_Region
   is
   begin
      return Returns : Qt4.Regions.Q_Region do
         multiplication_QRegionCR_QMatrixCR (Qt4.Regions.Internals.QRegion_View (Returns), Qt4.Regions.Internals.QRegion_View (P), M.Object);
      end return;
   end "*";

--   ---------
--   -- "*" --
--   ---------
--
--   function "*"
--    (P : Qt4.Painter_Paths.Q_Painter_Path'Class;
--     M : Q_Matrix)
--       return Qt4.Painter_Paths.Q_Painter_Path
--   is
--   begin
--      return Returns : Qt4.Painter_Paths.Q_Painter_Path do
--         multiplication_QPainterPathCR_QMatrixCR (Qt4.Painter_Paths.Internals.QPainterPath_View (Returns), Qt4.Painter_Paths.Internals.QPainterPath_View (P), M.Object);
--      end return;
--   end "*";

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

   package body Internals is

   ------------------
   -- QMatrix_View --
   ------------------

      function QMatrix_View
       (Item : Q_Matrix'Class)
          return QMatrix_Access
      is
      begin
         return Item.Object;
      end QMatrix_View;

      package QMatrix_Conversions is
        new System.Address_To_Access_Conversions
             (QMatrix);

   -----------------------
   -- QMatrixTo_Pointer --
   -----------------------

      function To_Pointer
       (Address : System.Address)
          return QMatrix_Access
      is
      begin
         return
           QMatrix_Access
            (QMatrix_Conversions.To_Pointer
            (Address));
      end To_Pointer;

   -----------------------
   -- QMatrixTo_Address --
   -----------------------

      function To_Address
       (Pointer : QMatrix_Access)
          return System.Address
      is
      begin
         return
           QMatrix_Conversions.To_Address
            (QMatrix_Conversions.Object_Pointer
              (Pointer));
      end To_Address;

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

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

   end Internals;

end Qt4.Matrices;
