------------------------------------------------------------------------------
--                                                                          --
--                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.Line_Fs is

   procedure Q_Line_F_Image (Item : Q_Line_F);
   pragma Export (Ada, Q_Line_F_Image, "q_line_f_image");

   function initialize_QLineF
    (Storage : in System.Address)
      return Internals.QLineF_Access;
   pragma Import (C, initialize_QLineF, "__QtAda_inititialize_QLineF");

   function initialize_QLineF_QPointFCR_QPointFCR
    (Storage : in System.Address;
     Pt_1 : in Qt4.Point_Fs.Internals.QPointF_Access;
     Pt_2 : in Qt4.Point_Fs.Internals.QPointF_Access)
      return Internals.QLineF_Access;
   pragma Import (C, initialize_QLineF_QPointFCR_QPointFCR, "__QtAda_inititialize_QLineF_QPointFCR_QPointFCR");

   function initialize_QLineF_qreal_qreal_qreal_qreal
    (Storage : in System.Address;
     X_1 : in Qt4.Q_Real;
     Y_1 : in Qt4.Q_Real;
     X_2 : in Qt4.Q_Real;
     Y_2 : in Qt4.Q_Real)
      return Internals.QLineF_Access;
   pragma Import (C, initialize_QLineF_qreal_qreal_qreal_qreal, "__QtAda_inititialize_QLineF_qreal_qreal_qreal_qreal");

   function initialize_QLineF_QLineCR
    (Storage : in System.Address;
     Line : in Qt4.Lines.Internals.QLine_Access)
      return Internals.QLineF_Access;
   pragma Import (C, initialize_QLineF_QLineCR, "__QtAda_inititialize_QLineF_QLineCR");

   function adjust_QLineF
    (Storage : in System.Address;
     From    : in Internals.QLineF_Access)
       return Internals.QLineF_Access;
   pragma Import (C, adjust_QLineF, "__QtAda_adjust_QLineF");

   procedure finalize_QLineF (Object : in Internals.QLineF_Access);
   pragma Import (C, finalize_QLineF, "__QtAda_finalize_QLineF");

   function QLineF_angle_QLineFCR
    (Self : in Internals.QLineF_Access;
     L : in Internals.QLineF_Access)
       return Qt4.Q_Real;
   pragma Import (C, QLineF_angle_QLineFCR, "__QtAda_QLineF_angle_QLineFCR_Q");

   function QLineF_dx
    (Self : in Internals.QLineF_Access)
       return Qt4.Q_Real;
   pragma Import (C, QLineF_dx, "__QtAda_QLineF_dx_Q");

   function QLineF_dy
    (Self : in Internals.QLineF_Access)
       return Qt4.Q_Real;
   pragma Import (C, QLineF_dy, "__QtAda_QLineF_dy_Q");

   function QLineF_isNull
    (Self : in Internals.QLineF_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QLineF_isNull, "__QtAda_QLineF_isNull_Q");

   function QLineF_length
    (Self : in Internals.QLineF_Access)
       return Qt4.Q_Real;
   pragma Import (C, QLineF_length, "__QtAda_QLineF_length_Q");

   procedure QLineF_normalVector
    (Returns : in Internals.QLineF_Access;
     Self : in Internals.QLineF_Access);
   pragma Import (C, QLineF_normalVector, "__QtAda_QLineF_normalVector_Q");

   procedure QLineF_p1
    (Returns : in Qt4.Point_Fs.Internals.QPointF_Access;
     Self : in Internals.QLineF_Access);
   pragma Import (C, QLineF_p1, "__QtAda_QLineF_p1_Q");

   procedure QLineF_p2
    (Returns : in Qt4.Point_Fs.Internals.QPointF_Access;
     Self : in Internals.QLineF_Access);
   pragma Import (C, QLineF_p2, "__QtAda_QLineF_p2_Q");

   procedure QLineF_pointAt_qreal
    (Returns : in Qt4.Point_Fs.Internals.QPointF_Access;
     Self : in Internals.QLineF_Access;
     T : in Qt4.Q_Real);
   pragma Import (C, QLineF_pointAt_qreal, "__QtAda_QLineF_pointAt_qreal_Q");

   procedure QLineF_setLength_qreal
    (Self : in Internals.QLineF_Access;
     Len : in Qt4.Q_Real);
   pragma Import (C, QLineF_setLength_qreal, "__QtAda_QLineF_setLength_qreal");

   procedure QLineF_toLine
    (Returns : in Qt4.Lines.Internals.QLine_Access;
     Self : in Internals.QLineF_Access);
   pragma Import (C, QLineF_toLine, "__QtAda_QLineF_toLine_Q");

   procedure QLineF_translate_QPointFCR
    (Self : in Internals.QLineF_Access;
     P : in Qt4.Point_Fs.Internals.QPointF_Access);
   pragma Import (C, QLineF_translate_QPointFCR, "__QtAda_QLineF_translate_QPointFCR");

   procedure QLineF_translate_qreal_qreal
    (Self : in Internals.QLineF_Access;
     Dx : in Qt4.Q_Real;
     Dy : in Qt4.Q_Real);
   pragma Import (C, QLineF_translate_qreal_qreal, "__QtAda_QLineF_translate_qreal_qreal");

   procedure QLineF_unitVector
    (Returns : in Internals.QLineF_Access;
     Self : in Internals.QLineF_Access);
   pragma Import (C, QLineF_unitVector, "__QtAda_QLineF_unitVector_Q");

   function QLineF_x1
    (Self : in Internals.QLineF_Access)
       return Qt4.Q_Real;
   pragma Import (C, QLineF_x1, "__QtAda_QLineF_x1_Q");

   function QLineF_x2
    (Self : in Internals.QLineF_Access)
       return Qt4.Q_Real;
   pragma Import (C, QLineF_x2, "__QtAda_QLineF_x2_Q");

   function QLineF_y1
    (Self : in Internals.QLineF_Access)
       return Qt4.Q_Real;
   pragma Import (C, QLineF_y1, "__QtAda_QLineF_y1_Q");

   function QLineF_y2
    (Self : in Internals.QLineF_Access)
       return Qt4.Q_Real;
   pragma Import (C, QLineF_y2, "__QtAda_QLineF_y2_Q");

   function eq_QLineFCR
    (Self : in Internals.QLineF_Access;
     D : in Internals.QLineF_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, eq_QLineFCR, "__QtAda_QLineF_eq_QLineFCR_Q");

   --------------------
   -- Q_Line_F_Image --
   --------------------

   procedure Q_Line_F_Image (Item : Q_Line_F) is
   begin
      Qt4_Debug.Output
       ("(x1 => "
          & Q_Real_Image (Item.X_1)
          & ", y1 => "
          & Q_Real_Image (Item.Y_1)
          & ", x2 => "
          & Q_Real_Image (Item.X_2)
          & ", y2 => "
          & Q_Real_Image (Item.Y_2)
          & ')');
   end Q_Line_F_Image;

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

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

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

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

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

   overriding
   procedure Initialize (Self : in out Q_Line_F) is
      use type Internals.QLineF_Access;

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

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

   function Create
    (Pt_1 : in Qt4.Point_Fs.Q_Point_F'Class;
     Pt_2 : in Qt4.Point_Fs.Q_Point_F'Class)
       return Q_Line_F
   is
   begin
      return Self : Q_Line_F
        := (Ada.Finalization.Controlled with others => <>)
      do
         Self.Object := initialize_QLineF_QPointFCR_QPointFCR (Self.Storage'Address, Qt4.Point_Fs.Internals.QPointF_View (Pt_1), Qt4.Point_Fs.Internals.QPointF_View (Pt_2));
      end return;
   end Create;

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

   function Create
    (X_1 : in Qt4.Q_Real;
     Y_1 : in Qt4.Q_Real;
     X_2 : in Qt4.Q_Real;
     Y_2 : in Qt4.Q_Real)
       return Q_Line_F
   is
   begin
      return Self : Q_Line_F
        := (Ada.Finalization.Controlled with others => <>)
      do
         Self.Object := initialize_QLineF_qreal_qreal_qreal_qreal (Self.Storage'Address, X_1, Y_1, X_2, Y_2);
      end return;
   end Create;

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

   function Create
    (Line : in Qt4.Lines.Q_Line'Class)
       return Q_Line_F
   is
   begin
      return Self : Q_Line_F
        := (Ada.Finalization.Controlled with others => <>)
      do
         Self.Object := initialize_QLineF_QLineCR (Self.Storage'Address, Qt4.Lines.Internals.QLine_View (Line));
      end return;
   end Create;

   -----------
   -- Angle --
   -----------

   function Angle
    (Self : in Q_Line_F'Class;
     L : in Q_Line_F'Class)
       return Qt4.Q_Real
   is
   begin
      return QLineF_angle_QLineFCR (Self.Object, L.Object);
   end Angle;

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

   function Dx
    (Self : in Q_Line_F'Class)
       return Qt4.Q_Real
   is
   begin
      return QLineF_dx (Self.Object);
   end Dx;

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

   function Dy
    (Self : in Q_Line_F'Class)
       return Qt4.Q_Real
   is
   begin
      return QLineF_dy (Self.Object);
   end Dy;

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

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

   ------------
   -- Length --
   ------------

   function Length
    (Self : in Q_Line_F'Class)
       return Qt4.Q_Real
   is
   begin
      return QLineF_length (Self.Object);
   end Length;

   -------------------
   -- Normal_Vector --
   -------------------

   function Normal_Vector
    (Self : in Q_Line_F'Class)
       return Q_Line_F
   is
   begin
      return Returns : Q_Line_F do
         QLineF_normalVector (Returns.Object, Self.Object);
      end return;
   end Normal_Vector;

   ---------
   -- P_1 --
   ---------

   function P_1
    (Self : in Q_Line_F'Class)
       return Qt4.Point_Fs.Q_Point_F
   is
   begin
      return Returns : Qt4.Point_Fs.Q_Point_F do
         QLineF_p1 (Qt4.Point_Fs.Internals.QPointF_View (Returns), Self.Object);
      end return;
   end P_1;

   ---------
   -- P_2 --
   ---------

   function P_2
    (Self : in Q_Line_F'Class)
       return Qt4.Point_Fs.Q_Point_F
   is
   begin
      return Returns : Qt4.Point_Fs.Q_Point_F do
         QLineF_p2 (Qt4.Point_Fs.Internals.QPointF_View (Returns), Self.Object);
      end return;
   end P_2;

   --------------
   -- Point_At --
   --------------

   function Point_At
    (Self : in Q_Line_F'Class;
     T : in Qt4.Q_Real)
       return Qt4.Point_Fs.Q_Point_F
   is
   begin
      return Returns : Qt4.Point_Fs.Q_Point_F do
         QLineF_pointAt_qreal (Qt4.Point_Fs.Internals.QPointF_View (Returns), Self.Object, T);
      end return;
   end Point_At;

   ----------------
   -- Set_Length --
   ----------------

   procedure Set_Length
    (Self : in out Q_Line_F'Class;
     Len : in Qt4.Q_Real)
   is
   begin
      QLineF_setLength_qreal (Self.Object, Len);
   end Set_Length;

   -------------
   -- To_Line --
   -------------

   function To_Line
    (Self : in Q_Line_F'Class)
       return Qt4.Lines.Q_Line
   is
   begin
      return Returns : Qt4.Lines.Q_Line do
         QLineF_toLine (Qt4.Lines.Internals.QLine_View (Returns), Self.Object);
      end return;
   end To_Line;

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

   procedure Translate
    (Self : in out Q_Line_F'Class;
     P : in Qt4.Point_Fs.Q_Point_F'Class)
   is
   begin
      QLineF_translate_QPointFCR (Self.Object, Qt4.Point_Fs.Internals.QPointF_View (P));
   end Translate;

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

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

   -----------------
   -- Unit_Vector --
   -----------------

   function Unit_Vector
    (Self : in Q_Line_F'Class)
       return Q_Line_F
   is
   begin
      return Returns : Q_Line_F do
         QLineF_unitVector (Returns.Object, Self.Object);
      end return;
   end Unit_Vector;

   ---------
   -- X_1 --
   ---------

   function X_1
    (Self : in Q_Line_F'Class)
       return Qt4.Q_Real
   is
   begin
      return QLineF_x1 (Self.Object);
   end X_1;

   ---------
   -- X_2 --
   ---------

   function X_2
    (Self : in Q_Line_F'Class)
       return Qt4.Q_Real
   is
   begin
      return QLineF_x2 (Self.Object);
   end X_2;

   ---------
   -- Y_1 --
   ---------

   function Y_1
    (Self : in Q_Line_F'Class)
       return Qt4.Q_Real
   is
   begin
      return QLineF_y1 (Self.Object);
   end Y_1;

   ---------
   -- Y_2 --
   ---------

   function Y_2
    (Self : in Q_Line_F'Class)
       return Qt4.Q_Real
   is
   begin
      return QLineF_y2 (Self.Object);
   end Y_2;

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

   function "="
    (Self : in Q_Line_F;
     D : in Q_Line_F)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (eq_QLineFCR (Self.Object, D.Object), 0);
   end "=";

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

   package body Internals is

   -----------------
   -- QLineF_View --
   -----------------

      function QLineF_View
       (Item : in Q_Line_F'Class)
          return QLineF_Access
      is
      begin
         return Item.Object;
      end QLineF_View;

      package QLineF_Conversions is
        new System.Address_To_Access_Conversions
             (QLineF);

   ----------------------
   -- QLineFTo_Pointer --
   ----------------------

      function To_Pointer
       (Address : in System.Address)
          return QLineF_Access
      is
      begin
         return
           QLineF_Access
            (QLineF_Conversions.To_Pointer
            (Address));
      end To_Pointer;

   ----------------------
   -- QLineFTo_Address --
   ----------------------

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

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

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

   end Internals;

end Qt4.Line_Fs;
