------------------------------------------------------------------------------
--                                                                          --
--                An Ada2005 binding to the Qt C++ framework                --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
-- Copyright © 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.                                      --
--                                                                          --
------------------------------------------------------------------------------
--  $Revision: 3712 $ $Date: 2010-01-22 12:54:51 +0300 (Fri, 22 Jan 2010) $
------------------------------------------------------------------------------

package Qt4.Rgbs is

   type Q_Rgb is private;

   function Create
    (R : Qt4.Q_Unsigned_Integer;
     G : Qt4.Q_Unsigned_Integer;
     B : Qt4.Q_Unsigned_Integer)
       return Q_Rgb;

   function Create
    (R : Qt4.Q_Unsigned_Integer;
     G : Qt4.Q_Unsigned_Integer;
     B : Qt4.Q_Unsigned_Integer;
     A : Qt4.Q_Unsigned_Integer)
       return Q_Rgb;

   function To_Unsigned_Integer (Self : Q_Rgb) return Qt4.Q_Unsigned_Integer;

   function From_Unsigned_Integer (Item : Qt4.Q_Unsigned_Integer) return Q_Rgb;

   function Q_Alpha (Self : Q_Rgb) return Qt4.Q_Unsigned_Integer;

   function Q_Blue (Self : Q_Rgb) return Qt4.Q_Unsigned_Integer;

   function Q_Gray
    (R : Qt4.Q_Unsigned_Integer;
     G : Qt4.Q_Unsigned_Integer;
     B : Qt4.Q_Unsigned_Integer)
       return Qt4.Q_Unsigned_Integer;

   function Q_Gray (Self : Q_Rgb) return Qt4.Q_Unsigned_Integer;

   function Q_Green (Self : Q_Rgb) return Qt4.Q_Unsigned_Integer;

   function Q_Red (Self : Q_Rgb) return Qt4.Q_Unsigned_Integer;

private

   type Q_Rgb is new Qt4.Q_Unsigned_Integer;
   pragma Convention (C, Q_Rgb);

   function qGray_int_int_int
    (R : Qt4.Q_Unsigned_Integer;
     G : Qt4.Q_Unsigned_Integer;
     B : Qt4.Q_Unsigned_Integer)
       return Qt4.Q_Unsigned_Integer;
   pragma Import (C, qGray_int_int_int, "__QtAda_qGray_int_int_int");

   function qGray_QRgb (Self : Q_Rgb) return Qt4.Q_Unsigned_Integer;
   pragma Import (C, qGray_QRgb, "__QtAda_qGray_QRgb");

   function Q_Gray
    (R : Qt4.Q_Unsigned_Integer;
     G : Qt4.Q_Unsigned_Integer;
     B : Qt4.Q_Unsigned_Integer)
       return Qt4.Q_Unsigned_Integer
         renames qGray_int_int_int;

   function Q_Gray (Self : Q_Rgb) return Qt4.Q_Unsigned_Integer
     renames qGray_QRgb;

   function qRgb
    (R : Qt4.Q_Unsigned_Integer;
     G : Qt4.Q_Unsigned_Integer;
     B : Qt4.Q_Unsigned_Integer)
       return Q_Rgb;
   pragma Import (C, qRgb, "__QtAda_qRgb");

   function qRgba
    (R : Qt4.Q_Unsigned_Integer;
     G : Qt4.Q_Unsigned_Integer;
     B : Qt4.Q_Unsigned_Integer;
     A : Qt4.Q_Unsigned_Integer)
       return Q_Rgb;
   pragma Import (C, qRgba, "__QtAda_qRgba");

   function Create
    (R : Qt4.Q_Unsigned_Integer;
     G : Qt4.Q_Unsigned_Integer;
     B : Qt4.Q_Unsigned_Integer)
       return Q_Rgb
         renames qRgb;

   function Create
    (R : Qt4.Q_Unsigned_Integer;
     G : Qt4.Q_Unsigned_Integer;
     B : Qt4.Q_Unsigned_Integer;
     A : Qt4.Q_Unsigned_Integer)
       return Q_Rgb
         renames qRgba;

   pragma Import (C, Q_Alpha, "__QtAda_qAlpha");
   pragma Import (C, Q_Blue, "__QtAda_qBlue");
   pragma Import (C, Q_Green, "__QtAda_qGreen");
   pragma Import (C, Q_Red, "__QtAda_qRed");

end Qt4.Rgbs;
