------------------------------------------------------------------------------
--                                                                          --
--                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;

package body Qt4.Size_Fs is

   procedure Q_Size_F_Image (Item : Q_Size_F);
   pragma Export (Ada, Q_Size_F_Image, "q_size_f_image");

   function initialize_QSizeF
    (Storage : in System.Address)
      return Internals.QSizeF_Access;
   pragma Import (C, initialize_QSizeF, "__QtAda_inititialize_QSizeF");

   function initialize_QSizeF_QSizeCR
    (Storage : in System.Address;
     Sz : in Qt4.Sizes.Internals.QSize_Access)
      return Internals.QSizeF_Access;
   pragma Import (C, initialize_QSizeF_QSizeCR, "__QtAda_inititialize_QSizeF_QSizeCR");

   function initialize_QSizeF_qreal_qreal
    (Storage : in System.Address;
     W : in Qt4.Q_Real;
     H : in Qt4.Q_Real)
      return Internals.QSizeF_Access;
   pragma Import (C, initialize_QSizeF_qreal_qreal, "__QtAda_inititialize_QSizeF_qreal_qreal");

   function adjust_QSizeF
    (Storage : in System.Address;
     From    : in Internals.QSizeF_Access)
       return Internals.QSizeF_Access;
   pragma Import (C, adjust_QSizeF, "__QtAda_adjust_QSizeF");

   procedure finalize_QSizeF (Object : in Internals.QSizeF_Access);
   pragma Import (C, finalize_QSizeF, "__QtAda_finalize_QSizeF");

   procedure QSizeF_boundedTo_QSizeFCR
    (Returns : in Internals.QSizeF_Access;
     Self : in Internals.QSizeF_Access;
     Other_Size : in Internals.QSizeF_Access);
   pragma Import (C, QSizeF_boundedTo_QSizeFCR, "__QtAda_QSizeF_boundedTo_QSizeFCR_Q");

   procedure QSizeF_expandedTo_QSizeFCR
    (Returns : in Internals.QSizeF_Access;
     Self : in Internals.QSizeF_Access;
     Other_Size : in Internals.QSizeF_Access);
   pragma Import (C, QSizeF_expandedTo_QSizeFCR, "__QtAda_QSizeF_expandedTo_QSizeFCR_Q");

   function QSizeF_height
    (Self : in Internals.QSizeF_Access)
       return Qt4.Q_Real;
   pragma Import (C, QSizeF_height, "__QtAda_QSizeF_height_Q");

   function QSizeF_isEmpty
    (Self : in Internals.QSizeF_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QSizeF_isEmpty, "__QtAda_QSizeF_isEmpty_Q");

   function QSizeF_isNull
    (Self : in Internals.QSizeF_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QSizeF_isNull, "__QtAda_QSizeF_isNull_Q");

   function QSizeF_isValid
    (Self : in Internals.QSizeF_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QSizeF_isValid, "__QtAda_QSizeF_isValid_Q");

   procedure QSizeF_scale_qreal_qreal_AspectRatioMode
    (Self : in Internals.QSizeF_Access;
     W : in Qt4.Q_Real;
     H : in Qt4.Q_Real;
     Mode : in Qt4.Aspect_Ratio_Mode);
   pragma Import (C, QSizeF_scale_qreal_qreal_AspectRatioMode, "__QtAda_QSizeF_scale_qreal_qreal_AspectRatioMode");

   procedure QSizeF_scale_QSizeFCR_AspectRatioMode
    (Self : in Internals.QSizeF_Access;
     H : in Internals.QSizeF_Access;
     Mode : in Qt4.Aspect_Ratio_Mode);
   pragma Import (C, QSizeF_scale_QSizeFCR_AspectRatioMode, "__QtAda_QSizeF_scale_QSizeFCR_AspectRatioMode");

   procedure QSizeF_setHeight_qreal
    (Self : in Internals.QSizeF_Access;
     H : in Qt4.Q_Real);
   pragma Import (C, QSizeF_setHeight_qreal, "__QtAda_QSizeF_setHeight_qreal");

   procedure QSizeF_setWidth_qreal
    (Self : in Internals.QSizeF_Access;
     W : in Qt4.Q_Real);
   pragma Import (C, QSizeF_setWidth_qreal, "__QtAda_QSizeF_setWidth_qreal");

   procedure QSizeF_toSize
    (Returns : in Qt4.Sizes.Internals.QSize_Access;
     Self : in Internals.QSizeF_Access);
   pragma Import (C, QSizeF_toSize, "__QtAda_QSizeF_toSize_Q");

   procedure QSizeF_transpose
    (Self : in Internals.QSizeF_Access);
   pragma Import (C, QSizeF_transpose, "__QtAda_QSizeF_transpose");

   function QSizeF_width
    (Self : in Internals.QSizeF_Access)
       return Qt4.Q_Real;
   pragma Import (C, QSizeF_width, "__QtAda_QSizeF_width_Q");

   function eq_QSizeFCR_QSizeFCR
    (S_1 : in Internals.QSizeF_Access;
     S_2 : in Internals.QSizeF_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, eq_QSizeFCR_QSizeFCR, "__QtAda_eq_QSizeFCR_QSizeFCR");

   procedure plus_QSizeFCR_QSizeFCR
    (Returns : in Internals.QSizeF_Access;
     S_1 : in Internals.QSizeF_Access;
     S_2 : in Internals.QSizeF_Access);
   pragma Import (C, plus_QSizeFCR_QSizeFCR, "__QtAda_plus_QSizeFCR_QSizeFCR");

   procedure minus_QSizeFCR_QSizeFCR
    (Returns : in Internals.QSizeF_Access;
     S_1 : in Internals.QSizeF_Access;
     S_2 : in Internals.QSizeF_Access);
   pragma Import (C, minus_QSizeFCR_QSizeFCR, "__QtAda_minus_QSizeFCR_QSizeFCR");

   procedure multiplication_QSizeFCR_qreal
    (Returns : in Internals.QSizeF_Access;
     S : in Internals.QSizeF_Access;
     Factor : in Qt4.Q_Real);
   pragma Import (C, multiplication_QSizeFCR_qreal, "__QtAda_multiplication_QSizeFCR_qreal");

   procedure multiplication_qreal_QSizeFCR
    (Returns : in Internals.QSizeF_Access;
     Factor : in Qt4.Q_Real;
     S : in Internals.QSizeF_Access);
   pragma Import (C, multiplication_qreal_QSizeFCR, "__QtAda_multiplication_qreal_QSizeFCR");

   procedure division_QSizeFCR_qreal
    (Returns : in Internals.QSizeF_Access;
     S : in Internals.QSizeF_Access;
     Factor : in Qt4.Q_Real);
   pragma Import (C, division_QSizeFCR_qreal, "__QtAda_division_QSizeFCR_qreal");

   --------------------
   -- Q_Size_F_Image --
   --------------------

   procedure Q_Size_F_Image (Item : Q_Size_F) is
   begin
      Qt4_Debug.Output
       ("(width => "
          & Q_Real_Image (Item.Width)
          & ", height => "
          & Q_Real_Image (Item.Height)
          & ')');
   end Q_Size_F_Image;

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

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

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

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

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

   overriding
   procedure Initialize (Self : in out Q_Size_F) is
      use type Internals.QSizeF_Access;

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

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

   function Create
    (Sz : in Qt4.Sizes.Q_Size'Class)
       return Q_Size_F
   is
   begin
      return Self : Q_Size_F
        := (Ada.Finalization.Controlled with others => <>)
      do
         Self.Object := initialize_QSizeF_QSizeCR (Self.Storage'Address, Qt4.Sizes.Internals.QSize_View (Sz));
      end return;
   end Create;

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

   function Create
    (W : in Qt4.Q_Real;
     H : in Qt4.Q_Real)
       return Q_Size_F
   is
   begin
      return Self : Q_Size_F
        := (Ada.Finalization.Controlled with others => <>)
      do
         Self.Object := initialize_QSizeF_qreal_qreal (Self.Storage'Address, W, H);
      end return;
   end Create;

   ----------------
   -- Bounded_To --
   ----------------

   function Bounded_To
    (Self : in Q_Size_F'Class;
     Other_Size : in Q_Size_F'Class)
       return Q_Size_F
   is
   begin
      return Returns : Q_Size_F do
         QSizeF_boundedTo_QSizeFCR (Returns.Object, Self.Object, Other_Size.Object);
      end return;
   end Bounded_To;

   -----------------
   -- Expanded_To --
   -----------------

   function Expanded_To
    (Self : in Q_Size_F'Class;
     Other_Size : in Q_Size_F'Class)
       return Q_Size_F
   is
   begin
      return Returns : Q_Size_F do
         QSizeF_expandedTo_QSizeFCR (Returns.Object, Self.Object, Other_Size.Object);
      end return;
   end Expanded_To;

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

   function Height
    (Self : in Q_Size_F'Class)
       return Qt4.Q_Real
   is
   begin
      return QSizeF_height (Self.Object);
   end Height;

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

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

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

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

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

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

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

   procedure Scale
    (Self : in out Q_Size_F'Class;
     W : in Qt4.Q_Real;
     H : in Qt4.Q_Real;
     Mode : in Qt4.Aspect_Ratio_Mode)
   is
   begin
      QSizeF_scale_qreal_qreal_AspectRatioMode (Self.Object, W, H, Mode);
   end Scale;

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

   procedure Scale
    (Self : in out Q_Size_F'Class;
     H : in Q_Size_F'Class;
     Mode : in Qt4.Aspect_Ratio_Mode)
   is
   begin
      QSizeF_scale_QSizeFCR_AspectRatioMode (Self.Object, H.Object, Mode);
   end Scale;

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

   procedure Set_Height
    (Self : in out Q_Size_F'Class;
     H : in Qt4.Q_Real)
   is
   begin
      QSizeF_setHeight_qreal (Self.Object, H);
   end Set_Height;

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

   procedure Set_Width
    (Self : in out Q_Size_F'Class;
     W : in Qt4.Q_Real)
   is
   begin
      QSizeF_setWidth_qreal (Self.Object, W);
   end Set_Width;

   -------------
   -- To_Size --
   -------------

   function To_Size
    (Self : in Q_Size_F'Class)
       return Qt4.Sizes.Q_Size
   is
   begin
      return Returns : Qt4.Sizes.Q_Size do
         QSizeF_toSize (Qt4.Sizes.Internals.QSize_View (Returns), Self.Object);
      end return;
   end To_Size;

   ---------------
   -- Transpose --
   ---------------

   procedure Transpose
    (Self : in out Q_Size_F'Class)
   is
   begin
      QSizeF_transpose (Self.Object);
   end Transpose;

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

   function Width
    (Self : in Q_Size_F'Class)
       return Qt4.Q_Real
   is
   begin
      return QSizeF_width (Self.Object);
   end Width;

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

   function "="
    (S_1 : in Q_Size_F;
     S_2 : in Q_Size_F)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (eq_QSizeFCR_QSizeFCR (S_1.Object, S_2.Object), 0);
   end "=";

   ---------
   -- "+" --
   ---------

   function "+"
    (S_1 : in Q_Size_F;
     S_2 : in Q_Size_F)
       return Q_Size_F
   is
   begin
      return Returns : Q_Size_F do
         plus_QSizeFCR_QSizeFCR (Returns.Object, S_1.Object, S_2.Object);
      end return;
   end "+";

   ---------
   -- "-" --
   ---------

   function "-"
    (S_1 : in Q_Size_F;
     S_2 : in Q_Size_F)
       return Q_Size_F
   is
   begin
      return Returns : Q_Size_F do
         minus_QSizeFCR_QSizeFCR (Returns.Object, S_1.Object, S_2.Object);
      end return;
   end "-";

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

   function "*"
    (S : in Q_Size_F;
     Factor : in Qt4.Q_Real)
       return Q_Size_F
   is
   begin
      return Returns : Q_Size_F do
         multiplication_QSizeFCR_qreal (Returns.Object, S.Object, Factor);
      end return;
   end "*";

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

   function "*"
    (Factor : in Qt4.Q_Real;
     S : in Q_Size_F)
       return Q_Size_F
   is
   begin
      return Returns : Q_Size_F do
         multiplication_qreal_QSizeFCR (Returns.Object, Factor, S.Object);
      end return;
   end "*";

   ---------
   -- "/" --
   ---------

   function "/"
    (S : in Q_Size_F;
     Factor : in Qt4.Q_Real)
       return Q_Size_F
   is
   begin
      return Returns : Q_Size_F do
         division_QSizeFCR_qreal (Returns.Object, S.Object, Factor);
      end return;
   end "/";

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

   package body Internals is

   -----------------
   -- QSizeF_View --
   -----------------

      function QSizeF_View
       (Item : in Q_Size_F'Class)
          return QSizeF_Access
      is
      begin
         return Item.Object;
      end QSizeF_View;

      package QSizeF_Conversions is
        new System.Address_To_Access_Conversions
             (QSizeF);

   ----------------------
   -- QSizeFTo_Pointer --
   ----------------------

      function To_Pointer
       (Address : in System.Address)
          return QSizeF_Access
      is
      begin
         return
           QSizeF_Access
            (QSizeF_Conversions.To_Pointer
            (Address));
      end To_Pointer;

   ----------------------
   -- QSizeFTo_Address --
   ----------------------

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

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

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

   end Internals;

end Qt4.Size_Fs;
