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. --  The Gtk.Color_Chooser_Dialog.Gtk_Color_Chooser_Dialog widget is a dialog 
  26. --  for choosing a color. It implements the Gtk.Color_Chooser.Gtk_Color_Chooser 
  27. --  interface. 
  28. -- 
  29. --  </description> 
  30. pragma Ada_2005; 
  31.  
  32. pragma Warnings (Off, "*is already use-visible*"); 
  33. with Gdk.RGBA;          use Gdk.RGBA; 
  34. with Glib;              use Glib; 
  35. with Glib.Properties;   use Glib.Properties; 
  36. with Glib.Types;        use Glib.Types; 
  37. with Gtk.Buildable;     use Gtk.Buildable; 
  38. with Gtk.Color_Chooser; use Gtk.Color_Chooser; 
  39. with Gtk.Dialog;        use Gtk.Dialog; 
  40. with Gtk.Enums;         use Gtk.Enums; 
  41. with Gtk.Window;        use Gtk.Window; 
  42.  
  43. package Gtk.Color_Chooser_Dialog is 
  44.  
  45.    type Gtk_Color_Chooser_Dialog_Record is new Gtk_Dialog_Record with null record; 
  46.    type Gtk_Color_Chooser_Dialog is access all Gtk_Color_Chooser_Dialog_Record'Class; 
  47.  
  48.    ------------------ 
  49.    -- Constructors -- 
  50.    ------------------ 
  51.  
  52.    procedure Gtk_New 
  53.       (Self   : out Gtk_Color_Chooser_Dialog; 
  54.        Title  : UTF8_String := ""; 
  55.        Parent : access Gtk.Window.Gtk_Window_Record'Class); 
  56.    procedure Initialize 
  57.       (Self   : not null access Gtk_Color_Chooser_Dialog_Record'Class; 
  58.        Title  : UTF8_String := ""; 
  59.        Parent : access Gtk.Window.Gtk_Window_Record'Class); 
  60.    --  Creates a new Gtk.Color_Chooser_Dialog.Gtk_Color_Chooser_Dialog. 
  61.    --  Since: gtk+ 3.4 
  62.    --  "title": Title of the dialog, or null 
  63.    --  "parent": Transient parent of the dialog, or null 
  64.  
  65.    function Gtk_Color_Chooser_Dialog_New 
  66.       (Title  : UTF8_String := ""; 
  67.        Parent : access Gtk.Window.Gtk_Window_Record'Class) 
  68.        return Gtk_Color_Chooser_Dialog; 
  69.    --  Creates a new Gtk.Color_Chooser_Dialog.Gtk_Color_Chooser_Dialog. 
  70.    --  Since: gtk+ 3.4 
  71.    --  "title": Title of the dialog, or null 
  72.    --  "parent": Transient parent of the dialog, or null 
  73.  
  74.    function Get_Type return Glib.GType; 
  75.    pragma Import (C, Get_Type, "gtk_color_chooser_dialog_get_type"); 
  76.  
  77.    --------------------------------------------- 
  78.    -- Inherited subprograms (from interfaces) -- 
  79.    --------------------------------------------- 
  80.    --  Methods inherited from the Buildable interface are not duplicated here 
  81.    --  since they are meant to be used by tools, mostly. If you need to call 
  82.    --  them, use an explicit cast through the "-" operator below. 
  83.  
  84.    procedure Add_Palette 
  85.       (Self            : not null access Gtk_Color_Chooser_Dialog_Record; 
  86.        Orientation     : Gtk.Enums.Gtk_Orientation; 
  87.        Colors_Per_Line : Gint; 
  88.        N_Colors        : Gint; 
  89.        Colors          : array_of_Gdk_RGBA); 
  90.  
  91.    procedure Get_Rgba 
  92.       (Self  : not null access Gtk_Color_Chooser_Dialog_Record; 
  93.        Color : out Gdk.RGBA.Gdk_RGBA); 
  94.  
  95.    procedure Set_Rgba 
  96.       (Self  : not null access Gtk_Color_Chooser_Dialog_Record; 
  97.        Color : Gdk.RGBA.Gdk_RGBA); 
  98.  
  99.    function Get_Use_Alpha 
  100.       (Self : not null access Gtk_Color_Chooser_Dialog_Record) 
  101.        return Boolean; 
  102.  
  103.    procedure Set_Use_Alpha 
  104.       (Self      : not null access Gtk_Color_Chooser_Dialog_Record; 
  105.        Use_Alpha : Boolean); 
  106.  
  107.    ---------------- 
  108.    -- Properties -- 
  109.    ---------------- 
  110.    --  The following properties are defined for this widget. See 
  111.    --  Glib.Properties for more information on properties) 
  112.  
  113.    Show_Editor_Property : constant Glib.Properties.Property_Boolean; 
  114.  
  115.    ---------------- 
  116.    -- Interfaces -- 
  117.    ---------------- 
  118.    --  This class implements several interfaces. See Glib.Types 
  119.    -- 
  120.    --  - "Buildable" 
  121.    -- 
  122.    --  - "ColorChooser" 
  123.  
  124.    package Implements_Gtk_Buildable is new Glib.Types.Implements 
  125.      (Gtk.Buildable.Gtk_Buildable, Gtk_Color_Chooser_Dialog_Record, Gtk_Color_Chooser_Dialog); 
  126.    function "+" 
  127.      (Widget : access Gtk_Color_Chooser_Dialog_Record'Class) 
  128.    return Gtk.Buildable.Gtk_Buildable 
  129.    renames Implements_Gtk_Buildable.To_Interface; 
  130.    function "-" 
  131.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  132.    return Gtk_Color_Chooser_Dialog 
  133.    renames Implements_Gtk_Buildable.To_Object; 
  134.  
  135.    package Implements_Gtk_Color_Chooser is new Glib.Types.Implements 
  136.      (Gtk.Color_Chooser.Gtk_Color_Chooser, Gtk_Color_Chooser_Dialog_Record, Gtk_Color_Chooser_Dialog); 
  137.    function "+" 
  138.      (Widget : access Gtk_Color_Chooser_Dialog_Record'Class) 
  139.    return Gtk.Color_Chooser.Gtk_Color_Chooser 
  140.    renames Implements_Gtk_Color_Chooser.To_Interface; 
  141.    function "-" 
  142.      (Interf : Gtk.Color_Chooser.Gtk_Color_Chooser) 
  143.    return Gtk_Color_Chooser_Dialog 
  144.    renames Implements_Gtk_Color_Chooser.To_Object; 
  145.  
  146. private 
  147.    Show_Editor_Property : constant Glib.Properties.Property_Boolean := 
  148.      Glib.Properties.Build ("show-editor"); 
  149. end Gtk.Color_Chooser_Dialog;