------------------------------------------------------------------------------
--                                                                          --
--                An Ada2005 binding to the Qt C++ framework                --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
-- Copyright © 2009-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.                                      --
--                                                                          --
------------------------------------------------------------------------------
--  $Revision: 3777 $ $Date: 2010-10-24 11:16:05 +0400 (Sun, 24 Oct 2010) $
------------------------------------------------------------------------------

package body Qt4.Paint_Devices is

   function c_depth
    (Self : not null Qt_Ada.Internals.Paint_Devices.QPaintDevice_Access)
       return Qt4.Q_Integer;
   pragma Import (C, c_depth, "__QtAda_QPaintDevice_depth_C");

   function c_height
    (Self : not null Qt_Ada.Internals.Paint_Devices.QPaintDevice_Access)
       return Qt4.Q_Integer;
   pragma Import (C, c_height, "__QtAda_QPaintDevice_height_C");

   function heightMM
    (Self : not null Qt_Ada.Internals.Paint_Devices.QPaintDevice_Access)
       return Qt4.Q_Integer;
   pragma Import (C, heightMM, "__QtAda_QPaintDevice_heightMM_C");

   function logicalDpiX
    (Self : not null Qt_Ada.Internals.Paint_Devices.QPaintDevice_Access)
       return Qt4.Q_Integer;
   pragma Import (C, logicalDpiX, "__QtAda_QPaintDevice_logicalDpiX_C");

   function logicalDpiY
    (Self : not null Qt_Ada.Internals.Paint_Devices.QPaintDevice_Access)
       return Qt4.Q_Integer;
   pragma Import (C, logicalDpiY, "__QtAda_QPaintDevice_logicalDpiY_C");

   function numColors
    (Self : not null Qt_Ada.Internals.Paint_Devices.QPaintDevice_Access)
       return Qt4.Q_Integer;
   pragma Import (C, numColors, "__QtAda_QPaintDevice_numColors_C");

   function paintingActive
    (Self : not null Qt_Ada.Internals.Paint_Devices.QPaintDevice_Access)
       return Interfaces.C.int;
   pragma Import (C, paintingActive, "__QtAda_QPaintDevice_paintingActive_C");

   function physicalDpiX
    (Self : not null Qt_Ada.Internals.Paint_Devices.QPaintDevice_Access)
       return Qt4.Q_Integer;
   pragma Import (C, physicalDpiX, "__QtAda_QPaintDevice_physicalDpiX_C");

   function physicalDpiY
    (Self : not null Qt_Ada.Internals.Paint_Devices.QPaintDevice_Access)
       return Qt4.Q_Integer;
   pragma Import (C, physicalDpiY, "__QtAda_QPaintDevice_physicalDpiY_C");

   function c_width
    (Self : not null Qt_Ada.Internals.Paint_Devices.QPaintDevice_Access)
       return Qt4.Q_Integer;
   pragma Import (C, c_width, "__QtAda_QPaintDevice_width_C");

   function widthMM
    (Self : not null Qt_Ada.Internals.Paint_Devices.QPaintDevice_Access)
       return Qt4.Q_Integer;
   pragma Import (C, widthMM, "__QtAda_QPaintDevice_widthMM_C");

   -----------
   -- Depth --
   -----------

   function Depth
    (Self : not null access constant Q_Paint_Device'Class)
       return Qt4.Q_Integer
   is
   begin
      return c_depth (Self.QPaintDevice_View);
   end Depth;

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

   function Height
    (Self : not null access constant Q_Paint_Device'Class)
       return Qt4.Q_Integer
   is
   begin
      return c_height (Self.QPaintDevice_View);
   end Height;

   ---------------
   -- Height_MM --
   ---------------

   function Height_MM
    (Self : not null access constant Q_Paint_Device'Class)
       return Qt4.Q_Integer
   is
   begin
      return heightMM (Self.QPaintDevice_View);
   end Height_MM;

   -------------------
   -- Logical_Dpi_X --
   -------------------

   function Logical_Dpi_X
    (Self : not null access constant Q_Paint_Device'Class)
       return Qt4.Q_Integer
   is
   begin
      return logicalDpiX (Self.QPaintDevice_View);
   end Logical_Dpi_X;

   -------------------
   -- Logical_Dpi_Y --
   -------------------

   function Logical_Dpi_Y
    (Self : not null access constant Q_Paint_Device'Class)
       return Qt4.Q_Integer
   is
   begin
      return logicalDpiY (Self.QPaintDevice_View);
   end Logical_Dpi_Y;

   ----------------
   -- Num_Colors --
   ----------------

   function Num_Colors
    (Self : not null access constant Q_Paint_Device'Class)
       return Qt4.Q_Integer
   is
   begin
      return numColors (Self.QPaintDevice_View);
   end Num_Colors;

   ---------------------
   -- Painting_Active --
   ---------------------

   function Painting_Active
    (Self : not null access constant Q_Paint_Device'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (paintingActive (Self.QPaintDevice_View), 0);
   end Painting_Active;

   --------------------
   -- Physical_Dpi_X --
   --------------------

   function Physical_Dpi_X
    (Self : not null access constant Q_Paint_Device'Class)
       return Qt4.Q_Integer
   is
   begin
      return physicalDpiX (Self.QPaintDevice_View);
   end Physical_Dpi_X;

   --------------------
   -- Physical_Dpi_Y --
   --------------------

   function Physical_Dpi_Y
    (Self : not null access constant Q_Paint_Device'Class)
       return Qt4.Q_Integer
   is
   begin
      return physicalDpiY (Self.QPaintDevice_View);
   end Physical_Dpi_Y;

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

   function Width
    (Self : not null access constant Q_Paint_Device'Class)
       return Qt4.Q_Integer
   is
   begin
      return c_width (Self.QPaintDevice_View);
   end Width;

   --------------
   -- Width_MM --
   --------------

   function Width_MM
    (Self : not null access constant Q_Paint_Device'Class)
       return Qt4.Q_Integer
   is
   begin
      return widthMM (Self.QPaintDevice_View);
   end Width_MM;

end Qt4.Paint_Devices;
