------------------------------------------------------------------------------
--                                                                          --
--                An Ada2005 binding to the Qt C++ framework                --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
-- Copyright © 2007-2009 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;

with Qt4_Debug;
with Qt_Ada.Internals.Boolean_Conversions;

package body Qt4.Rects is

   procedure Q_Rect_Image (Item : Q_Rect);
   pragma Export (Ada, Q_Rect_Image, "q_rect_image");

   function initialize_QRect
    (Storage : in System.Address)
      return Internals.QRect_Access;
   pragma Import (C, initialize_QRect, "__QtAda_inititialize_QRect");

   function initialize_QRect_QPointCR_QPointCR
    (Storage : in System.Address;
     Topleft : in Qt4.Points.Internals.QPoint_Access;
     Bottomright : in Qt4.Points.Internals.QPoint_Access)
      return Internals.QRect_Access;
   pragma Import (C, initialize_QRect_QPointCR_QPointCR, "__QtAda_inititialize_QRect_QPointCR_QPointCR");

   function initialize_QRect_QPointCR_QSizeCR
    (Storage : in System.Address;
     Topleft : in Qt4.Points.Internals.QPoint_Access;
     Size : in Qt4.Sizes.Internals.QSize_Access)
      return Internals.QRect_Access;
   pragma Import (C, initialize_QRect_QPointCR_QSizeCR, "__QtAda_inititialize_QRect_QPointCR_QSizeCR");

   function initialize_QRect_int_int_int_int
    (Storage : in System.Address;
     Left : in Qt4.Q_Integer;
     Top : in Qt4.Q_Integer;
     Width : in Qt4.Q_Integer;
     Height : in Qt4.Q_Integer)
      return Internals.QRect_Access;
   pragma Import (C, initialize_QRect_int_int_int_int, "__QtAda_inititialize_QRect_int_int_int_int");

   function adjust_QRect
    (Storage : in System.Address;
     From    : in Internals.QRect_Access)
       return Internals.QRect_Access;
   pragma Import (C, adjust_QRect, "__QtAda_adjust_QRect");

   procedure finalize_QRect (Object : in Internals.QRect_Access);
   pragma Import (C, finalize_QRect, "__QtAda_finalize_QRect");

   procedure QRect_adjust_int_int_int_int
    (Self : in Internals.QRect_Access;
     X_1 : in Qt4.Q_Integer;
     Y_1 : in Qt4.Q_Integer;
     X_2 : in Qt4.Q_Integer;
     Y_2 : in Qt4.Q_Integer);
   pragma Import (C, QRect_adjust_int_int_int_int, "__QtAda_QRect_adjust_int_int_int_int");

   procedure QRect_adjusted_int_int_int_int
    (Returns : in Internals.QRect_Access;
     Self : in Internals.QRect_Access;
     X_1 : in Qt4.Q_Integer;
     Y_1 : in Qt4.Q_Integer;
     X_2 : in Qt4.Q_Integer;
     Y_2 : in Qt4.Q_Integer);
   pragma Import (C, QRect_adjusted_int_int_int_int, "__QtAda_QRect_adjusted_int_int_int_int_Q");

   function QRect_bottom
    (Self : in Internals.QRect_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QRect_bottom, "__QtAda_QRect_bottom_Q");

   procedure QRect_bottomRight
    (Returns : in Qt4.Points.Internals.QPoint_Access;
     Self : in Internals.QRect_Access);
   pragma Import (C, QRect_bottomRight, "__QtAda_QRect_bottomRight_Q");

   procedure QRect_bottomLeft
    (Returns : in Qt4.Points.Internals.QPoint_Access;
     Self : in Internals.QRect_Access);
   pragma Import (C, QRect_bottomLeft, "__QtAda_QRect_bottomLeft_Q");

   procedure QRect_center
    (Returns : in Qt4.Points.Internals.QPoint_Access;
     Self : in Internals.QRect_Access);
   pragma Import (C, QRect_center, "__QtAda_QRect_center_Q");

   function QRect_contains_QPointCR_bool
    (Self : in Internals.QRect_Access;
     P : in Qt4.Points.Internals.QPoint_Access;
     Proper : in Interfaces.C.unsigned)
       return Interfaces.C.unsigned;
   pragma Import (C, QRect_contains_QPointCR_bool, "__QtAda_QRect_contains_QPointCR_bool_Q");

   function QRect_contains_int_int
    (Self : in Internals.QRect_Access;
     X : in Qt4.Q_Integer;
     Y : in Qt4.Q_Integer)
       return Interfaces.C.unsigned;
   pragma Import (C, QRect_contains_int_int, "__QtAda_QRect_contains_int_int_Q");

   function QRect_contains_int_int_bool
    (Self : in Internals.QRect_Access;
     X : in Qt4.Q_Integer;
     Y : in Qt4.Q_Integer;
     Proper : in Interfaces.C.unsigned)
       return Interfaces.C.unsigned;
   pragma Import (C, QRect_contains_int_int_bool, "__QtAda_QRect_contains_int_int_bool_Q");

   function QRect_contains_QRectCR_bool
    (Self : in Internals.QRect_Access;
     R : in Internals.QRect_Access;
     Proper : in Interfaces.C.unsigned)
       return Interfaces.C.unsigned;
   pragma Import (C, QRect_contains_QRectCR_bool, "__QtAda_QRect_contains_QRectCR_bool_Q");

   procedure QRect_getCoords_intP_intP_intP_intP
    (Self : in Internals.QRect_Access;
     X_1 : out Qt4.Q_Integer;
     Y_1 : out Qt4.Q_Integer;
     X_2 : out Qt4.Q_Integer;
     Y_2 : out Qt4.Q_Integer);
   pragma Import (C, QRect_getCoords_intP_intP_intP_intP, "__QtAda_QRect_getCoords_intP_intP_intP_intP_Q");

   procedure QRect_getRect_intP_intP_intP_intP
    (Self : in Internals.QRect_Access;
     X : out Qt4.Q_Integer;
     Y : out Qt4.Q_Integer;
     W : out Qt4.Q_Integer;
     H : out Qt4.Q_Integer);
   pragma Import (C, QRect_getRect_intP_intP_intP_intP, "__QtAda_QRect_getRect_intP_intP_intP_intP_Q");

   function QRect_height
    (Self : in Internals.QRect_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QRect_height, "__QtAda_QRect_height_Q");

   procedure QRect_intersected_QRectCR
    (Returns : in Internals.QRect_Access;
     Self : in Internals.QRect_Access;
     Other : in Internals.QRect_Access);
   pragma Import (C, QRect_intersected_QRectCR, "__QtAda_QRect_intersected_QRectCR_Q");

   function QRect_intersects_QRectCR
    (Self : in Internals.QRect_Access;
     R : in Internals.QRect_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QRect_intersects_QRectCR, "__QtAda_QRect_intersects_QRectCR_Q");

   function QRect_isEmpty
    (Self : in Internals.QRect_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QRect_isEmpty, "__QtAda_QRect_isEmpty_Q");

   function QRect_isNull
    (Self : in Internals.QRect_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QRect_isNull, "__QtAda_QRect_isNull_Q");

   function QRect_isValid
    (Self : in Internals.QRect_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QRect_isValid, "__QtAda_QRect_isValid_Q");

   function QRect_left
    (Self : in Internals.QRect_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QRect_left, "__QtAda_QRect_left_Q");

   procedure QRect_moveBottom_int
    (Self : in Internals.QRect_Access;
     Pos : in Qt4.Q_Integer);
   pragma Import (C, QRect_moveBottom_int, "__QtAda_QRect_moveBottom_int");

   procedure QRect_moveBottomLeft_QPointCR
    (Self : in Internals.QRect_Access;
     P : in Qt4.Points.Internals.QPoint_Access);
   pragma Import (C, QRect_moveBottomLeft_QPointCR, "__QtAda_QRect_moveBottomLeft_QPointCR");

   procedure QRect_moveBottomRight_QPointCR
    (Self : in Internals.QRect_Access;
     P : in Qt4.Points.Internals.QPoint_Access);
   pragma Import (C, QRect_moveBottomRight_QPointCR, "__QtAda_QRect_moveBottomRight_QPointCR");

   procedure QRect_moveCenter_QPointCR
    (Self : in Internals.QRect_Access;
     P : in Qt4.Points.Internals.QPoint_Access);
   pragma Import (C, QRect_moveCenter_QPointCR, "__QtAda_QRect_moveCenter_QPointCR");

   procedure QRect_moveLeft_int
    (Self : in Internals.QRect_Access;
     Pos : in Qt4.Q_Integer);
   pragma Import (C, QRect_moveLeft_int, "__QtAda_QRect_moveLeft_int");

   procedure QRect_moveRight_int
    (Self : in Internals.QRect_Access;
     Pos : in Qt4.Q_Integer);
   pragma Import (C, QRect_moveRight_int, "__QtAda_QRect_moveRight_int");

   procedure QRect_moveTo_int_int
    (Self : in Internals.QRect_Access;
     X : in Qt4.Q_Integer;
     Y : in Qt4.Q_Integer);
   pragma Import (C, QRect_moveTo_int_int, "__QtAda_QRect_moveTo_int_int");

   procedure QRect_moveTo_QPointCR
    (Self : in Internals.QRect_Access;
     P : in Qt4.Points.Internals.QPoint_Access);
   pragma Import (C, QRect_moveTo_QPointCR, "__QtAda_QRect_moveTo_QPointCR");

   procedure QRect_moveTop_int
    (Self : in Internals.QRect_Access;
     Pos : in Qt4.Q_Integer);
   pragma Import (C, QRect_moveTop_int, "__QtAda_QRect_moveTop_int");

   procedure QRect_moveTopLeft_QPointCR
    (Self : in Internals.QRect_Access;
     P : in Qt4.Points.Internals.QPoint_Access);
   pragma Import (C, QRect_moveTopLeft_QPointCR, "__QtAda_QRect_moveTopLeft_QPointCR");

   procedure QRect_moveTopRight_QPointCR
    (Self : in Internals.QRect_Access;
     P : in Qt4.Points.Internals.QPoint_Access);
   pragma Import (C, QRect_moveTopRight_QPointCR, "__QtAda_QRect_moveTopRight_QPointCR");

   procedure QRect_normalized
    (Returns : in Internals.QRect_Access;
     Self : in Internals.QRect_Access);
   pragma Import (C, QRect_normalized, "__QtAda_QRect_normalized_Q");

   function QRect_right
    (Self : in Internals.QRect_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QRect_right, "__QtAda_QRect_right_Q");

   procedure QRect_setBottom_int
    (Self : in Internals.QRect_Access;
     Pos : in Qt4.Q_Integer);
   pragma Import (C, QRect_setBottom_int, "__QtAda_QRect_setBottom_int");

   procedure QRect_setBottomLeft_QPointCR
    (Self : in Internals.QRect_Access;
     P : in Qt4.Points.Internals.QPoint_Access);
   pragma Import (C, QRect_setBottomLeft_QPointCR, "__QtAda_QRect_setBottomLeft_QPointCR");

   procedure QRect_setBottomRight_QPointCR
    (Self : in Internals.QRect_Access;
     P : in Qt4.Points.Internals.QPoint_Access);
   pragma Import (C, QRect_setBottomRight_QPointCR, "__QtAda_QRect_setBottomRight_QPointCR");

   procedure QRect_setCoords_int_int_int_int
    (Self : in Internals.QRect_Access;
     X_1 : in Qt4.Q_Integer;
     Y_1 : in Qt4.Q_Integer;
     X_2 : in Qt4.Q_Integer;
     Y_2 : in Qt4.Q_Integer);
   pragma Import (C, QRect_setCoords_int_int_int_int, "__QtAda_QRect_setCoords_int_int_int_int");

   procedure QRect_setHeight_int
    (Self : in Internals.QRect_Access;
     H : in Qt4.Q_Integer);
   pragma Import (C, QRect_setHeight_int, "__QtAda_QRect_setHeight_int");

   procedure QRect_setLeft_int
    (Self : in Internals.QRect_Access;
     Pos : in Qt4.Q_Integer);
   pragma Import (C, QRect_setLeft_int, "__QtAda_QRect_setLeft_int");

   procedure QRect_setRect_int_int_int_int
    (Self : in Internals.QRect_Access;
     X : in Qt4.Q_Integer;
     Y : in Qt4.Q_Integer;
     W : in Qt4.Q_Integer;
     H : in Qt4.Q_Integer);
   pragma Import (C, QRect_setRect_int_int_int_int, "__QtAda_QRect_setRect_int_int_int_int");

   procedure QRect_setRight_int
    (Self : in Internals.QRect_Access;
     Pos : in Qt4.Q_Integer);
   pragma Import (C, QRect_setRight_int, "__QtAda_QRect_setRight_int");

   procedure QRect_setSize_QSizeCR
    (Self : in Internals.QRect_Access;
     S : in Qt4.Sizes.Internals.QSize_Access);
   pragma Import (C, QRect_setSize_QSizeCR, "__QtAda_QRect_setSize_QSizeCR");

   procedure QRect_setTop_int
    (Self : in Internals.QRect_Access;
     Pos : in Qt4.Q_Integer);
   pragma Import (C, QRect_setTop_int, "__QtAda_QRect_setTop_int");

   procedure QRect_setTopLeft_QPointCR
    (Self : in Internals.QRect_Access;
     P : in Qt4.Points.Internals.QPoint_Access);
   pragma Import (C, QRect_setTopLeft_QPointCR, "__QtAda_QRect_setTopLeft_QPointCR");

   procedure QRect_setTopRight_QPointCR
    (Self : in Internals.QRect_Access;
     P : in Qt4.Points.Internals.QPoint_Access);
   pragma Import (C, QRect_setTopRight_QPointCR, "__QtAda_QRect_setTopRight_QPointCR");

   procedure QRect_setWidth_int
    (Self : in Internals.QRect_Access;
     W : in Qt4.Q_Integer);
   pragma Import (C, QRect_setWidth_int, "__QtAda_QRect_setWidth_int");

   procedure QRect_setX_int
    (Self : in Internals.QRect_Access;
     X : in Qt4.Q_Integer);
   pragma Import (C, QRect_setX_int, "__QtAda_QRect_setX_int");

   procedure QRect_setY_int
    (Self : in Internals.QRect_Access;
     Y : in Qt4.Q_Integer);
   pragma Import (C, QRect_setY_int, "__QtAda_QRect_setY_int");

   procedure QRect_size
    (Returns : in Qt4.Sizes.Internals.QSize_Access;
     Self : in Internals.QRect_Access);
   pragma Import (C, QRect_size, "__QtAda_QRect_size_Q");

   function QRect_top
    (Self : in Internals.QRect_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QRect_top, "__QtAda_QRect_top_Q");

   procedure QRect_topLeft
    (Returns : in Qt4.Points.Internals.QPoint_Access;
     Self : in Internals.QRect_Access);
   pragma Import (C, QRect_topLeft, "__QtAda_QRect_topLeft_Q");

   procedure QRect_topRight
    (Returns : in Qt4.Points.Internals.QPoint_Access;
     Self : in Internals.QRect_Access);
   pragma Import (C, QRect_topRight, "__QtAda_QRect_topRight_Q");

   procedure QRect_translate_int_int
    (Self : in Internals.QRect_Access;
     Dx : in Qt4.Q_Integer;
     Dy : in Qt4.Q_Integer);
   pragma Import (C, QRect_translate_int_int, "__QtAda_QRect_translate_int_int");

   procedure QRect_translate_QPointCR
    (Self : in Internals.QRect_Access;
     P : in Qt4.Points.Internals.QPoint_Access);
   pragma Import (C, QRect_translate_QPointCR, "__QtAda_QRect_translate_QPointCR");

   procedure QRect_translated_int_int
    (Returns : in Internals.QRect_Access;
     Self : in Internals.QRect_Access;
     Dx : in Qt4.Q_Integer;
     Dy : in Qt4.Q_Integer);
   pragma Import (C, QRect_translated_int_int, "__QtAda_QRect_translated_int_int_Q");

   procedure QRect_translated_QPointCR
    (Returns : in Internals.QRect_Access;
     Self : in Internals.QRect_Access;
     P : in Qt4.Points.Internals.QPoint_Access);
   pragma Import (C, QRect_translated_QPointCR, "__QtAda_QRect_translated_QPointCR_Q");

   procedure QRect_united_QRectCR
    (Returns : in Internals.QRect_Access;
     Self : in Internals.QRect_Access;
     Other : in Internals.QRect_Access);
   pragma Import (C, QRect_united_QRectCR, "__QtAda_QRect_united_QRectCR_Q");

   function QRect_width
    (Self : in Internals.QRect_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QRect_width, "__QtAda_QRect_width_Q");

   function QRect_x
    (Self : in Internals.QRect_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QRect_x, "__QtAda_QRect_x_Q");

   function QRect_y
    (Self : in Internals.QRect_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QRect_y, "__QtAda_QRect_y_Q");

   function eq_QRectCR_QRectCR
    (R_1 : in Internals.QRect_Access;
     R_2 : in Internals.QRect_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, eq_QRectCR_QRectCR, "__QtAda_eq_QRectCR_QRectCR");

   ------------------
   -- Q_Rect_Image --
   ------------------

   procedure Q_Rect_Image (Item : Q_Rect) is
   begin
      Qt4_Debug.Output
       ("(x => "
          & Q_Integer_Image (Item.X)
          & ", y => "
          & Q_Integer_Image (Item.Y)
          & ", width => "
          & Q_Integer_Image (Item.Width)
          & ", height => "
          & Q_Integer_Image (Item.Height)
          & ')');
   end Q_Rect_Image;

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

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

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

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

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

   overriding
   procedure Initialize (Self : in out Q_Rect) is
      use type Internals.QRect_Access;

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

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

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

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

   function Create
    (Topleft : in Qt4.Points.Q_Point'Class;
     Bottomright : in Qt4.Points.Q_Point'Class)
       return Q_Rect
   is
   begin
      return Self : Q_Rect
        := (Ada.Finalization.Controlled with others => <>)
      do
         Self.Object := initialize_QRect_QPointCR_QPointCR (Self.Storage'Address, Qt4.Points.Internals.QPoint_View (Topleft), Qt4.Points.Internals.QPoint_View (Bottomright));
      end return;
   end Create;

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

   function Create
    (Topleft : in Qt4.Points.Q_Point'Class;
     Size : in Qt4.Sizes.Q_Size'Class)
       return Q_Rect
   is
   begin
      return Self : Q_Rect
        := (Ada.Finalization.Controlled with others => <>)
      do
         Self.Object := initialize_QRect_QPointCR_QSizeCR (Self.Storage'Address, Qt4.Points.Internals.QPoint_View (Topleft), Qt4.Sizes.Internals.QSize_View (Size));
      end return;
   end Create;

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

   function Create
    (Left : in Qt4.Q_Integer;
     Top : in Qt4.Q_Integer;
     Width : in Qt4.Q_Integer;
     Height : in Qt4.Q_Integer)
       return Q_Rect
   is
   begin
      return Self : Q_Rect
        := (Ada.Finalization.Controlled with others => <>)
      do
         Self.Object := initialize_QRect_int_int_int_int (Self.Storage'Address, Left, Top, Width, Height);
      end return;
   end Create;

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

   procedure Adjust
    (Self : in out Q_Rect'Class;
     X_1 : in Qt4.Q_Integer;
     Y_1 : in Qt4.Q_Integer;
     X_2 : in Qt4.Q_Integer;
     Y_2 : in Qt4.Q_Integer)
   is
   begin
      QRect_adjust_int_int_int_int (Self.Object, X_1, Y_1, X_2, Y_2);
   end Adjust;

   --------------
   -- Adjusted --
   --------------

   function Adjusted
    (Self : in Q_Rect'Class;
     X_1 : in Qt4.Q_Integer;
     Y_1 : in Qt4.Q_Integer;
     X_2 : in Qt4.Q_Integer;
     Y_2 : in Qt4.Q_Integer)
       return Q_Rect
   is
   begin
      return Returns : Q_Rect do
         QRect_adjusted_int_int_int_int (Returns.Object, Self.Object, X_1, Y_1, X_2, Y_2);
      end return;
   end Adjusted;

   ------------
   -- Bottom --
   ------------

   function Bottom
    (Self : in Q_Rect'Class)
       return Qt4.Q_Integer
   is
   begin
      return QRect_bottom (Self.Object);
   end Bottom;

   ------------------
   -- Bottom_Right --
   ------------------

   function Bottom_Right
    (Self : in Q_Rect'Class)
       return Qt4.Points.Q_Point
   is
   begin
      return Returns : Qt4.Points.Q_Point do
         QRect_bottomRight (Qt4.Points.Internals.QPoint_View (Returns), Self.Object);
      end return;
   end Bottom_Right;

   -----------------
   -- Bottom_Left --
   -----------------

   function Bottom_Left
    (Self : in Q_Rect'Class)
       return Qt4.Points.Q_Point
   is
   begin
      return Returns : Qt4.Points.Q_Point do
         QRect_bottomLeft (Qt4.Points.Internals.QPoint_View (Returns), Self.Object);
      end return;
   end Bottom_Left;

   ------------
   -- Center --
   ------------

   function Center
    (Self : in Q_Rect'Class)
       return Qt4.Points.Q_Point
   is
   begin
      return Returns : Qt4.Points.Q_Point do
         QRect_center (Qt4.Points.Internals.QPoint_View (Returns), Self.Object);
      end return;
   end Center;

   --------------
   -- Contains --
   --------------

   function Contains
    (Self : in Q_Rect'Class;
     P : in Qt4.Points.Q_Point'Class;
     Proper : in Boolean
       := False)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QRect_contains_QPointCR_bool (Self.Object, Qt4.Points.Internals.QPoint_View (P), Qt_Ada.Internals.Boolean_Conversions.To_unsigned (Proper)), 0);
   end Contains;

   --------------
   -- Contains --
   --------------

   function Contains
    (Self : in Q_Rect'Class;
     X : in Qt4.Q_Integer;
     Y : in Qt4.Q_Integer)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QRect_contains_int_int (Self.Object, X, Y), 0);
   end Contains;

   --------------
   -- Contains --
   --------------

   function Contains
    (Self : in Q_Rect'Class;
     X : in Qt4.Q_Integer;
     Y : in Qt4.Q_Integer;
     Proper : in Boolean)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QRect_contains_int_int_bool (Self.Object, X, Y, Qt_Ada.Internals.Boolean_Conversions.To_unsigned (Proper)), 0);
   end Contains;

   --------------
   -- Contains --
   --------------

   function Contains
    (Self : in Q_Rect'Class;
     R : in Q_Rect'Class;
     Proper : in Boolean
       := False)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QRect_contains_QRectCR_bool (Self.Object, R.Object, Qt_Ada.Internals.Boolean_Conversions.To_unsigned (Proper)), 0);
   end Contains;

   ----------------
   -- Get_Coords --
   ----------------

   procedure Get_Coords
    (Self : in Q_Rect'Class;
     X_1 : out Qt4.Q_Integer;
     Y_1 : out Qt4.Q_Integer;
     X_2 : out Qt4.Q_Integer;
     Y_2 : out Qt4.Q_Integer)
   is
   begin
      QRect_getCoords_intP_intP_intP_intP (Self.Object, X_1, Y_1, X_2, Y_2);
   end Get_Coords;

   --------------
   -- Get_Rect --
   --------------

   procedure Get_Rect
    (Self : in Q_Rect'Class;
     X : out Qt4.Q_Integer;
     Y : out Qt4.Q_Integer;
     W : out Qt4.Q_Integer;
     H : out Qt4.Q_Integer)
   is
   begin
      QRect_getRect_intP_intP_intP_intP (Self.Object, X, Y, W, H);
   end Get_Rect;

   ------------
   -- Height --
   ------------

   function Height
    (Self : in Q_Rect'Class)
       return Qt4.Q_Integer
   is
   begin
      return QRect_height (Self.Object);
   end Height;

   -----------------
   -- Intersected --
   -----------------

   function Intersected
    (Self : in Q_Rect'Class;
     Other : in Q_Rect'Class)
       return Q_Rect
   is
   begin
      return Returns : Q_Rect do
         QRect_intersected_QRectCR (Returns.Object, Self.Object, Other.Object);
      end return;
   end Intersected;

   ----------------
   -- Intersects --
   ----------------

   function Intersects
    (Self : in Q_Rect'Class;
     R : in Q_Rect'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QRect_intersects_QRectCR (Self.Object, R.Object), 0);
   end Intersects;

   --------------
   -- Is_Empty --
   --------------

   function Is_Empty
    (Self : in Q_Rect'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QRect_isEmpty (Self.Object), 0);
   end Is_Empty;

   -------------
   -- Is_Null --
   -------------

   function Is_Null
    (Self : in Q_Rect'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QRect_isNull (Self.Object), 0);
   end Is_Null;

   --------------
   -- Is_Valid --
   --------------

   function Is_Valid
    (Self : in Q_Rect'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QRect_isValid (Self.Object), 0);
   end Is_Valid;

   ----------
   -- Left --
   ----------

   function Left
    (Self : in Q_Rect'Class)
       return Qt4.Q_Integer
   is
   begin
      return QRect_left (Self.Object);
   end Left;

   -----------------
   -- Move_Bottom --
   -----------------

   procedure Move_Bottom
    (Self : in out Q_Rect'Class;
     Pos : in Qt4.Q_Integer)
   is
   begin
      QRect_moveBottom_int (Self.Object, Pos);
   end Move_Bottom;

   ----------------------
   -- Move_Bottom_Left --
   ----------------------

   procedure Move_Bottom_Left
    (Self : in out Q_Rect'Class;
     P : in Qt4.Points.Q_Point'Class)
   is
   begin
      QRect_moveBottomLeft_QPointCR (Self.Object, Qt4.Points.Internals.QPoint_View (P));
   end Move_Bottom_Left;

   -----------------------
   -- Move_Bottom_Right --
   -----------------------

   procedure Move_Bottom_Right
    (Self : in out Q_Rect'Class;
     P : in Qt4.Points.Q_Point'Class)
   is
   begin
      QRect_moveBottomRight_QPointCR (Self.Object, Qt4.Points.Internals.QPoint_View (P));
   end Move_Bottom_Right;

   -----------------
   -- Move_Center --
   -----------------

   procedure Move_Center
    (Self : in out Q_Rect'Class;
     P : in Qt4.Points.Q_Point'Class)
   is
   begin
      QRect_moveCenter_QPointCR (Self.Object, Qt4.Points.Internals.QPoint_View (P));
   end Move_Center;

   ---------------
   -- Move_Left --
   ---------------

   procedure Move_Left
    (Self : in out Q_Rect'Class;
     Pos : in Qt4.Q_Integer)
   is
   begin
      QRect_moveLeft_int (Self.Object, Pos);
   end Move_Left;

   ----------------
   -- Move_Right --
   ----------------

   procedure Move_Right
    (Self : in out Q_Rect'Class;
     Pos : in Qt4.Q_Integer)
   is
   begin
      QRect_moveRight_int (Self.Object, Pos);
   end Move_Right;

   -------------
   -- Move_To --
   -------------

   procedure Move_To
    (Self : in out Q_Rect'Class;
     X : in Qt4.Q_Integer;
     Y : in Qt4.Q_Integer)
   is
   begin
      QRect_moveTo_int_int (Self.Object, X, Y);
   end Move_To;

   -------------
   -- Move_To --
   -------------

   procedure Move_To
    (Self : in out Q_Rect'Class;
     P : in Qt4.Points.Q_Point'Class)
   is
   begin
      QRect_moveTo_QPointCR (Self.Object, Qt4.Points.Internals.QPoint_View (P));
   end Move_To;

   --------------
   -- Move_Top --
   --------------

   procedure Move_Top
    (Self : in out Q_Rect'Class;
     Pos : in Qt4.Q_Integer)
   is
   begin
      QRect_moveTop_int (Self.Object, Pos);
   end Move_Top;

   -------------------
   -- Move_Top_Left --
   -------------------

   procedure Move_Top_Left
    (Self : in out Q_Rect'Class;
     P : in Qt4.Points.Q_Point'Class)
   is
   begin
      QRect_moveTopLeft_QPointCR (Self.Object, Qt4.Points.Internals.QPoint_View (P));
   end Move_Top_Left;

   --------------------
   -- Move_Top_Right --
   --------------------

   procedure Move_Top_Right
    (Self : in out Q_Rect'Class;
     P : in Qt4.Points.Q_Point'Class)
   is
   begin
      QRect_moveTopRight_QPointCR (Self.Object, Qt4.Points.Internals.QPoint_View (P));
   end Move_Top_Right;

   ----------------
   -- Normalized --
   ----------------

   function Normalized
    (Self : in Q_Rect'Class)
       return Q_Rect
   is
   begin
      return Returns : Q_Rect do
         QRect_normalized (Returns.Object, Self.Object);
      end return;
   end Normalized;

   -----------
   -- Right --
   -----------

   function Right
    (Self : in Q_Rect'Class)
       return Qt4.Q_Integer
   is
   begin
      return QRect_right (Self.Object);
   end Right;

   ----------------
   -- Set_Bottom --
   ----------------

   procedure Set_Bottom
    (Self : in out Q_Rect'Class;
     Pos : in Qt4.Q_Integer)
   is
   begin
      QRect_setBottom_int (Self.Object, Pos);
   end Set_Bottom;

   ---------------------
   -- Set_Bottom_Left --
   ---------------------

   procedure Set_Bottom_Left
    (Self : in out Q_Rect'Class;
     P : in Qt4.Points.Q_Point'Class)
   is
   begin
      QRect_setBottomLeft_QPointCR (Self.Object, Qt4.Points.Internals.QPoint_View (P));
   end Set_Bottom_Left;

   ----------------------
   -- Set_Bottom_Right --
   ----------------------

   procedure Set_Bottom_Right
    (Self : in out Q_Rect'Class;
     P : in Qt4.Points.Q_Point'Class)
   is
   begin
      QRect_setBottomRight_QPointCR (Self.Object, Qt4.Points.Internals.QPoint_View (P));
   end Set_Bottom_Right;

   ----------------
   -- Set_Coords --
   ----------------

   procedure Set_Coords
    (Self : in out Q_Rect'Class;
     X_1 : in Qt4.Q_Integer;
     Y_1 : in Qt4.Q_Integer;
     X_2 : in Qt4.Q_Integer;
     Y_2 : in Qt4.Q_Integer)
   is
   begin
      QRect_setCoords_int_int_int_int (Self.Object, X_1, Y_1, X_2, Y_2);
   end Set_Coords;

   ----------------
   -- Set_Height --
   ----------------

   procedure Set_Height
    (Self : in out Q_Rect'Class;
     H : in Qt4.Q_Integer)
   is
   begin
      QRect_setHeight_int (Self.Object, H);
   end Set_Height;

   --------------
   -- Set_Left --
   --------------

   procedure Set_Left
    (Self : in out Q_Rect'Class;
     Pos : in Qt4.Q_Integer)
   is
   begin
      QRect_setLeft_int (Self.Object, Pos);
   end Set_Left;

   --------------
   -- Set_Rect --
   --------------

   procedure Set_Rect
    (Self : in out Q_Rect'Class;
     X : in Qt4.Q_Integer;
     Y : in Qt4.Q_Integer;
     W : in Qt4.Q_Integer;
     H : in Qt4.Q_Integer)
   is
   begin
      QRect_setRect_int_int_int_int (Self.Object, X, Y, W, H);
   end Set_Rect;

   ---------------
   -- Set_Right --
   ---------------

   procedure Set_Right
    (Self : in out Q_Rect'Class;
     Pos : in Qt4.Q_Integer)
   is
   begin
      QRect_setRight_int (Self.Object, Pos);
   end Set_Right;

   --------------
   -- Set_Size --
   --------------

   procedure Set_Size
    (Self : in out Q_Rect'Class;
     S : in Qt4.Sizes.Q_Size'Class)
   is
   begin
      QRect_setSize_QSizeCR (Self.Object, Qt4.Sizes.Internals.QSize_View (S));
   end Set_Size;

   -------------
   -- Set_Top --
   -------------

   procedure Set_Top
    (Self : in out Q_Rect'Class;
     Pos : in Qt4.Q_Integer)
   is
   begin
      QRect_setTop_int (Self.Object, Pos);
   end Set_Top;

   ------------------
   -- Set_Top_Left --
   ------------------

   procedure Set_Top_Left
    (Self : in out Q_Rect'Class;
     P : in Qt4.Points.Q_Point'Class)
   is
   begin
      QRect_setTopLeft_QPointCR (Self.Object, Qt4.Points.Internals.QPoint_View (P));
   end Set_Top_Left;

   -------------------
   -- Set_Top_Right --
   -------------------

   procedure Set_Top_Right
    (Self : in out Q_Rect'Class;
     P : in Qt4.Points.Q_Point'Class)
   is
   begin
      QRect_setTopRight_QPointCR (Self.Object, Qt4.Points.Internals.QPoint_View (P));
   end Set_Top_Right;

   ---------------
   -- Set_Width --
   ---------------

   procedure Set_Width
    (Self : in out Q_Rect'Class;
     W : in Qt4.Q_Integer)
   is
   begin
      QRect_setWidth_int (Self.Object, W);
   end Set_Width;

   -----------
   -- Set_X --
   -----------

   procedure Set_X
    (Self : in out Q_Rect'Class;
     X : in Qt4.Q_Integer)
   is
   begin
      QRect_setX_int (Self.Object, X);
   end Set_X;

   -----------
   -- Set_Y --
   -----------

   procedure Set_Y
    (Self : in out Q_Rect'Class;
     Y : in Qt4.Q_Integer)
   is
   begin
      QRect_setY_int (Self.Object, Y);
   end Set_Y;

   ----------
   -- Size --
   ----------

   function Size
    (Self : in Q_Rect'Class)
       return Qt4.Sizes.Q_Size
   is
   begin
      return Returns : Qt4.Sizes.Q_Size do
         QRect_size (Qt4.Sizes.Internals.QSize_View (Returns), Self.Object);
      end return;
   end Size;

   ---------
   -- Top --
   ---------

   function Top
    (Self : in Q_Rect'Class)
       return Qt4.Q_Integer
   is
   begin
      return QRect_top (Self.Object);
   end Top;

   --------------
   -- Top_Left --
   --------------

   function Top_Left
    (Self : in Q_Rect'Class)
       return Qt4.Points.Q_Point
   is
   begin
      return Returns : Qt4.Points.Q_Point do
         QRect_topLeft (Qt4.Points.Internals.QPoint_View (Returns), Self.Object);
      end return;
   end Top_Left;

   ---------------
   -- Top_Right --
   ---------------

   function Top_Right
    (Self : in Q_Rect'Class)
       return Qt4.Points.Q_Point
   is
   begin
      return Returns : Qt4.Points.Q_Point do
         QRect_topRight (Qt4.Points.Internals.QPoint_View (Returns), Self.Object);
      end return;
   end Top_Right;

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

   procedure Translate
    (Self : in out Q_Rect'Class;
     Dx : in Qt4.Q_Integer;
     Dy : in Qt4.Q_Integer)
   is
   begin
      QRect_translate_int_int (Self.Object, Dx, Dy);
   end Translate;

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

   procedure Translate
    (Self : in out Q_Rect'Class;
     P : in Qt4.Points.Q_Point'Class)
   is
   begin
      QRect_translate_QPointCR (Self.Object, Qt4.Points.Internals.QPoint_View (P));
   end Translate;

   ----------------
   -- Translated --
   ----------------

   function Translated
    (Self : in Q_Rect'Class;
     Dx : in Qt4.Q_Integer;
     Dy : in Qt4.Q_Integer)
       return Q_Rect
   is
   begin
      return Returns : Q_Rect do
         QRect_translated_int_int (Returns.Object, Self.Object, Dx, Dy);
      end return;
   end Translated;

   ----------------
   -- Translated --
   ----------------

   function Translated
    (Self : in Q_Rect'Class;
     P : in Qt4.Points.Q_Point'Class)
       return Q_Rect
   is
   begin
      return Returns : Q_Rect do
         QRect_translated_QPointCR (Returns.Object, Self.Object, Qt4.Points.Internals.QPoint_View (P));
      end return;
   end Translated;

   ------------
   -- United --
   ------------

   function United
    (Self : in Q_Rect'Class;
     Other : in Q_Rect'Class)
       return Q_Rect
   is
   begin
      return Returns : Q_Rect do
         QRect_united_QRectCR (Returns.Object, Self.Object, Other.Object);
      end return;
   end United;

   -----------
   -- Width --
   -----------

   function Width
    (Self : in Q_Rect'Class)
       return Qt4.Q_Integer
   is
   begin
      return QRect_width (Self.Object);
   end Width;

   -------
   -- X --
   -------

   function X
    (Self : in Q_Rect'Class)
       return Qt4.Q_Integer
   is
   begin
      return QRect_x (Self.Object);
   end X;

   -------
   -- Y --
   -------

   function Y
    (Self : in Q_Rect'Class)
       return Qt4.Q_Integer
   is
   begin
      return QRect_y (Self.Object);
   end Y;

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

   function "="
    (R_1 : in Q_Rect;
     R_2 : in Q_Rect)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (eq_QRectCR_QRectCR (R_1.Object, R_2.Object), 0);
   end "=";

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

   package body Internals is

   ----------------
   -- QRect_View --
   ----------------

      function QRect_View
       (Item : in Q_Rect'Class)
          return QRect_Access
      is
      begin
         return Item.Object;
      end QRect_View;

      package QRect_Conversions is
        new System.Address_To_Access_Conversions
             (QRect);

   ---------------------
   -- QRectTo_Pointer --
   ---------------------

      function To_Pointer
       (Address : in System.Address)
          return QRect_Access
      is
      begin
         return
           QRect_Access
            (QRect_Conversions.To_Pointer
            (Address));
      end To_Pointer;

   ---------------------
   -- QRectTo_Address --
   ---------------------

      function To_Address
       (Pointer : in QRect_Access)
          return System.Address
      is
      begin
         return
           QRect_Conversions.To_Address
            (QRect_Conversions.Object_Pointer
              (Pointer));
      end To_Address;

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

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

   end Internals;

end Qt4.Rects;
