1. ------------------------------------------------------------------------------ 
  2. --                                                                          -- 
  3. --      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       -- 
  4. --                     Copyright (C) 2000-2014, AdaCore                     -- 
  5. --                                                                          -- 
  6. -- This library is free software;  you can redistribute it and/or modify it -- 
  7. -- under terms of the  GNU General Public License  as published by the Free -- 
  8. -- Software  Foundation;  either version 3,  or (at your  option) any later -- 
  9. -- version. This library is distributed in the hope that it will be useful, -- 
  10. -- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- -- 
  11. -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            -- 
  12. --                                                                          -- 
  13. -- As a special exception under Section 7 of GPL version 3, you are granted -- 
  14. -- additional permissions described in the GCC Runtime Library Exception,   -- 
  15. -- version 3.1, as published by the Free Software Foundation.               -- 
  16. --                                                                          -- 
  17. -- You should have received a copy of the GNU General Public License and    -- 
  18. -- a copy of the GCC Runtime Library Exception along with this program;     -- 
  19. -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    -- 
  20. -- <http://www.gnu.org/licenses/>.                                          -- 
  21. --                                                                          -- 
  22. ------------------------------------------------------------------------------ 
  23.  
  24. --  <description> 
  25. --  Gtk.Hsv.Gtk_Hsv is the 'color wheel' part of a complete color selector 
  26. --  widget. It allows to select a color by determining its HSV components in an 
  27. --  intuitive way. Moving the selection around the outer ring changes the hue, 
  28. --  and moving the selection point inside the inner triangle changes value and 
  29. --  saturation. 
  30. -- 
  31. --  Gtk.Hsv.Gtk_Hsv has been deprecated together with 
  32. --  Gtk.Color_Selection.Gtk_Color_Selection, where it was used. 
  33. -- 
  34. --  </description> 
  35. pragma Ada_2005; 
  36.  
  37. pragma Warnings (Off, "*is already use-visible*"); 
  38. with Glib;          use Glib; 
  39. with Glib.Object;   use Glib.Object; 
  40. with Glib.Types;    use Glib.Types; 
  41. with Gtk.Buildable; use Gtk.Buildable; 
  42. with Gtk.Enums;     use Gtk.Enums; 
  43. with Gtk.Widget;    use Gtk.Widget; 
  44.  
  45. package Gtk.Hsv is 
  46.  
  47.    type Gtk_Hsv_Record is new Gtk_Widget_Record with null record; 
  48.    type Gtk_Hsv is access all Gtk_Hsv_Record'Class; 
  49.  
  50.    ------------------ 
  51.    -- Constructors -- 
  52.    ------------------ 
  53.  
  54.    procedure Gtk_New (Self : out Gtk_Hsv); 
  55.    procedure Initialize (Self : not null access Gtk_Hsv_Record'Class); 
  56.    --  Creates a new HSV color selector. 
  57.    --  Since: gtk+ 2.14 
  58.  
  59.    function Gtk_Hsv_New return Gtk_Hsv; 
  60.    --  Creates a new HSV color selector. 
  61.    --  Since: gtk+ 2.14 
  62.  
  63.    function Get_Type return Glib.GType; 
  64.    pragma Import (C, Get_Type, "gtk_hsv_get_type"); 
  65.  
  66.    ------------- 
  67.    -- Methods -- 
  68.    ------------- 
  69.  
  70.    procedure Get_Color 
  71.       (Self : not null access Gtk_Hsv_Record; 
  72.        H    : out Gdouble; 
  73.        S    : out Gdouble; 
  74.        V    : out Gdouble); 
  75.    --  Queries the current color in an HSV color selector. Returned values 
  76.    --  will be in the [0.0, 1.0] range. 
  77.    --  Since: gtk+ 2.14 
  78.    --  "h": Return value for the hue 
  79.    --  "s": Return value for the saturation 
  80.    --  "v": Return value for the value 
  81.  
  82.    procedure Set_Color 
  83.       (Self : not null access Gtk_Hsv_Record; 
  84.        H    : Gdouble; 
  85.        S    : Gdouble; 
  86.        V    : Gdouble); 
  87.    --  Sets the current color in an HSV color selector. Color component values 
  88.    --  must be in the [0.0, 1.0] range. 
  89.    --  Since: gtk+ 2.14 
  90.    --  "h": Hue 
  91.    --  "s": Saturation 
  92.    --  "v": Value 
  93.  
  94.    procedure Get_Metrics 
  95.       (Self       : not null access Gtk_Hsv_Record; 
  96.        Size       : out Gint; 
  97.        Ring_Width : out Gint); 
  98.    --  Queries the size and ring width of an HSV color selector. 
  99.    --  Since: gtk+ 2.14 
  100.    --  "size": Return value for the diameter of the hue ring 
  101.    --  "ring_width": Return value for the width of the hue ring 
  102.  
  103.    procedure Set_Metrics 
  104.       (Self       : not null access Gtk_Hsv_Record; 
  105.        Size       : Gint; 
  106.        Ring_Width : Gint); 
  107.    --  Sets the size and ring width of an HSV color selector. 
  108.    --  Since: gtk+ 2.14 
  109.    --  "size": Diameter for the hue ring 
  110.    --  "ring_width": Width of the hue ring 
  111.  
  112.    function Is_Adjusting 
  113.       (Self : not null access Gtk_Hsv_Record) return Boolean; 
  114.    --  An HSV color selector can be said to be adjusting if multiple rapid 
  115.    --  changes are being made to its value, for example, when the user is 
  116.    --  adjusting the value with the mouse. This function queries whether the 
  117.    --  HSV color selector is being adjusted or not. 
  118.    --  Since: gtk+ 2.14 
  119.  
  120.    --------------- 
  121.    -- Functions -- 
  122.    --------------- 
  123.  
  124.    procedure To_Rgb 
  125.       (H : Gdouble; 
  126.        S : Gdouble; 
  127.        V : Gdouble; 
  128.        R : out Gdouble; 
  129.        G : out Gdouble; 
  130.        B : out Gdouble); 
  131.    --  Converts a color from HSV space to RGB. 
  132.    --  Input values must be in the [0.0, 1.0] range; output values will be in 
  133.    --  the same range. 
  134.    --  Since: gtk+ 2.14 
  135.    --  "h": Hue 
  136.    --  "s": Saturation 
  137.    --  "v": Value 
  138.    --  "r": Return value for the red component 
  139.    --  "g": Return value for the green component 
  140.    --  "b": Return value for the blue component 
  141.  
  142.    ------------- 
  143.    -- Signals -- 
  144.    ------------- 
  145.  
  146.    type Cb_Gtk_Hsv_Void is not null access procedure (Self : access Gtk_Hsv_Record'Class); 
  147.  
  148.    type Cb_GObject_Void is not null access procedure 
  149.      (Self : access Glib.Object.GObject_Record'Class); 
  150.  
  151.    Signal_Changed : constant Glib.Signal_Name := "changed"; 
  152.    procedure On_Changed 
  153.       (Self  : not null access Gtk_Hsv_Record; 
  154.        Call  : Cb_Gtk_Hsv_Void; 
  155.        After : Boolean := False); 
  156.    procedure On_Changed 
  157.       (Self  : not null access Gtk_Hsv_Record; 
  158.        Call  : Cb_GObject_Void; 
  159.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  160.        After : Boolean := False); 
  161.  
  162.    type Cb_Gtk_Hsv_Gtk_Direction_Type_Void is not null access procedure 
  163.      (Self   : access Gtk_Hsv_Record'Class; 
  164.       Object : Gtk.Enums.Gtk_Direction_Type); 
  165.  
  166.    type Cb_GObject_Gtk_Direction_Type_Void is not null access procedure 
  167.      (Self   : access Glib.Object.GObject_Record'Class; 
  168.       Object : Gtk.Enums.Gtk_Direction_Type); 
  169.  
  170.    Signal_Move : constant Glib.Signal_Name := "move"; 
  171.    procedure On_Move 
  172.       (Self  : not null access Gtk_Hsv_Record; 
  173.        Call  : Cb_Gtk_Hsv_Gtk_Direction_Type_Void; 
  174.        After : Boolean := False); 
  175.    procedure On_Move 
  176.       (Self  : not null access Gtk_Hsv_Record; 
  177.        Call  : Cb_GObject_Gtk_Direction_Type_Void; 
  178.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  179.        After : Boolean := False); 
  180.  
  181.    ---------------- 
  182.    -- Interfaces -- 
  183.    ---------------- 
  184.    --  This class implements several interfaces. See Glib.Types 
  185.    -- 
  186.    --  - "Buildable" 
  187.  
  188.    package Implements_Gtk_Buildable is new Glib.Types.Implements 
  189.      (Gtk.Buildable.Gtk_Buildable, Gtk_Hsv_Record, Gtk_Hsv); 
  190.    function "+" 
  191.      (Widget : access Gtk_Hsv_Record'Class) 
  192.    return Gtk.Buildable.Gtk_Buildable 
  193.    renames Implements_Gtk_Buildable.To_Interface; 
  194.    function "-" 
  195.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  196.    return Gtk_Hsv 
  197.    renames Implements_Gtk_Buildable.To_Object; 
  198.  
  199. end Gtk.Hsv;