------------------------------------------------------------------------------
--                                                                          --
--                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.     --
------------------------------------------------------------------------------
private with Ada.Finalization;
with Qt4.Points;
with Qt4.Rects;
private with Qt_Ada.Internals.Value_Class_Sizes;
with System;

package Qt4.Polygons is

   type Q_Polygon is tagged private;

   function Create
    (Size : Qt4.Q_Integer)
       return Q_Polygon;

   function Create
    (R : Qt4.Rects.Q_Rect'Class;
     Closed : Boolean
       := False)
       return Q_Polygon;

   function Bounding_Rect
    (Self : Q_Polygon'Class)
       return Qt4.Rects.Q_Rect;

   function Contains_Point
    (Self : Q_Polygon'Class;
     Pt : Qt4.Points.Q_Point'Class;
     Fill_Rule : Qt4.Fill_Rule)
       return Boolean;

   function Intersected
    (Self : Q_Polygon'Class;
     R : Q_Polygon'Class)
       return Q_Polygon;

   procedure Point
    (Self : Q_Polygon'Class;
     I : Qt4.Q_Integer;
     X : out Qt4.Q_Integer;
     Y : out Qt4.Q_Integer);

   function Point
    (Self : Q_Polygon'Class;
     I : Qt4.Q_Integer)
       return Qt4.Points.Q_Point;

   procedure Put_Points
    (Self : in out Q_Polygon'Class;
     Index : Qt4.Q_Integer;
     N_Points : Qt4.Q_Integer;
     From : Q_Polygon'Class;
     From_Index : Qt4.Q_Integer
       := 0);

   procedure Set_Point
    (Self : in out Q_Polygon'Class;
     Index : Qt4.Q_Integer;
     X : Qt4.Q_Integer;
     Y : Qt4.Q_Integer);

   procedure Set_Point
    (Self : in out Q_Polygon'Class;
     Index : Qt4.Q_Integer;
     P : Qt4.Points.Q_Point'Class);

   function Subtracted
    (Self : Q_Polygon'Class;
     R : Q_Polygon'Class)
       return Q_Polygon;

   procedure Translate
    (Self : in out Q_Polygon'Class;
     Dx : Qt4.Q_Integer;
     Dy : Qt4.Q_Integer);

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

   function United
    (Self : Q_Polygon'Class;
     R : Q_Polygon'Class)
       return Q_Polygon;

   package Internals is

      type QPolygon is private;

      type QPolygon_Access is access all QPolygon;
      pragma Convention (C, QPolygon_Access);

      function QPolygon_View
       (Item : Q_Polygon'Class)
          return QPolygon_Access;
      pragma Inline (QPolygon_View);

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

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

      function Create_Wrapper
       (Item : Internals.QPolygon_Access)
          return Q_Polygon;

   private

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

   end Internals;

private

   type Q_Polygon is new Ada.Finalization.Controlled with record
      Storage : aliased Internals.QPolygon;
      Object  : Internals.QPolygon_Access := null;
      Wrapper : Boolean := False;
   end record;

   overriding
   procedure Adjust (Self : in out Q_Polygon);

   overriding
   procedure Finalize (Self : in out Q_Polygon);

   overriding
   procedure Initialize (Self : in out Q_Polygon);

end Qt4.Polygons;
