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. --  A Gtk.Check_Button.Gtk_Check_Button places a discrete 
  26. --  Gtk.Toggle_Button.Gtk_Toggle_Button next to a widget, (usually a 
  27. --  Gtk.Label.Gtk_Label). See the section on 
  28. --  Gtk.Toggle_Button.Gtk_Toggle_Button widgets for more information about 
  29. --  toggle/check buttons. 
  30. -- 
  31. --  The important signal ( Gtk.Toggle_Button.Gtk_Toggle_Button::toggled ) is 
  32. --  also inherited from Gtk.Toggle_Button.Gtk_Toggle_Button. 
  33. -- 
  34. --  </description> 
  35. --  <screenshot>gtk-check_button</screenshot> 
  36. --  <group>Buttons and Toggles</group> 
  37. --  <testgtk>create_check_buttons.adb</testgtk> 
  38. pragma Ada_2005; 
  39.  
  40. pragma Warnings (Off, "*is already use-visible*"); 
  41. with Glib;              use Glib; 
  42. with Glib.Types;        use Glib.Types; 
  43. with Glib.Variant;      use Glib.Variant; 
  44. with Gtk.Action;        use Gtk.Action; 
  45. with Gtk.Actionable;    use Gtk.Actionable; 
  46. with Gtk.Activatable;   use Gtk.Activatable; 
  47. with Gtk.Buildable;     use Gtk.Buildable; 
  48. with Gtk.Toggle_Button; use Gtk.Toggle_Button; 
  49.  
  50. package Gtk.Check_Button is 
  51.  
  52.    type Gtk_Check_Button_Record is new Gtk_Toggle_Button_Record with null record; 
  53.    type Gtk_Check_Button is access all Gtk_Check_Button_Record'Class; 
  54.  
  55.    ------------------ 
  56.    -- Constructors -- 
  57.    ------------------ 
  58.  
  59.    procedure Gtk_New 
  60.       (Check_Button : out Gtk_Check_Button; 
  61.        Label        : UTF8_String := ""); 
  62.    procedure Initialize 
  63.       (Check_Button : not null access Gtk_Check_Button_Record'Class; 
  64.        Label        : UTF8_String := ""); 
  65.    --  Create a check button. if Label is null, then no widget is associated 
  66.    --  with the button, and any widget can be added to the button (with 
  67.    --  Gtk.Container.Add). 
  68.    --  "label": the text for the check button. 
  69.  
  70.    function Gtk_Check_Button_New_With_Label 
  71.       (Label : UTF8_String := "") return Gtk_Check_Button; 
  72.    --  Create a check button. if Label is null, then no widget is associated 
  73.    --  with the button, and any widget can be added to the button (with 
  74.    --  Gtk.Container.Add). 
  75.    --  "label": the text for the check button. 
  76.  
  77.    procedure Gtk_New_With_Mnemonic 
  78.       (Check_Button : out Gtk_Check_Button; 
  79.        Label        : UTF8_String); 
  80.    procedure Initialize_With_Mnemonic 
  81.       (Check_Button : not null access Gtk_Check_Button_Record'Class; 
  82.        Label        : UTF8_String); 
  83.    --  Creates a new Gtk.Check_Button.Gtk_Check_Button containing a label. The 
  84.    --  label will be created using Gtk.Label.Gtk_New_With_Mnemonic, so 
  85.    --  underscores in Label indicate the mnemonic for the check button. 
  86.    --  "label": The text of the button, with an underscore in front of the 
  87.    --  mnemonic character 
  88.  
  89.    function Gtk_Check_Button_New_With_Mnemonic 
  90.       (Label : UTF8_String) return Gtk_Check_Button; 
  91.    --  Creates a new Gtk.Check_Button.Gtk_Check_Button containing a label. The 
  92.    --  label will be created using Gtk.Label.Gtk_New_With_Mnemonic, so 
  93.    --  underscores in Label indicate the mnemonic for the check button. 
  94.    --  "label": The text of the button, with an underscore in front of the 
  95.    --  mnemonic character 
  96.  
  97.    function Get_Type return Glib.GType; 
  98.    pragma Import (C, Get_Type, "gtk_check_button_get_type"); 
  99.  
  100.    --------------------------------------------- 
  101.    -- Inherited subprograms (from interfaces) -- 
  102.    --------------------------------------------- 
  103.    --  Methods inherited from the Buildable interface are not duplicated here 
  104.    --  since they are meant to be used by tools, mostly. If you need to call 
  105.    --  them, use an explicit cast through the "-" operator below. 
  106.  
  107.    function Get_Action_Name 
  108.       (Self : not null access Gtk_Check_Button_Record) return UTF8_String; 
  109.  
  110.    procedure Set_Action_Name 
  111.       (Self        : not null access Gtk_Check_Button_Record; 
  112.        Action_Name : UTF8_String); 
  113.  
  114.    function Get_Action_Target_Value 
  115.       (Self : not null access Gtk_Check_Button_Record) 
  116.        return Glib.Variant.Gvariant; 
  117.  
  118.    procedure Set_Action_Target_Value 
  119.       (Self         : not null access Gtk_Check_Button_Record; 
  120.        Target_Value : Glib.Variant.Gvariant); 
  121.  
  122.    procedure Set_Detailed_Action_Name 
  123.       (Self                 : not null access Gtk_Check_Button_Record; 
  124.        Detailed_Action_Name : UTF8_String); 
  125.  
  126.    procedure Do_Set_Related_Action 
  127.       (Self   : not null access Gtk_Check_Button_Record; 
  128.        Action : not null access Gtk.Action.Gtk_Action_Record'Class); 
  129.  
  130.    function Get_Related_Action 
  131.       (Self : not null access Gtk_Check_Button_Record) 
  132.        return Gtk.Action.Gtk_Action; 
  133.  
  134.    procedure Set_Related_Action 
  135.       (Self   : not null access Gtk_Check_Button_Record; 
  136.        Action : not null access Gtk.Action.Gtk_Action_Record'Class); 
  137.  
  138.    function Get_Use_Action_Appearance 
  139.       (Self : not null access Gtk_Check_Button_Record) return Boolean; 
  140.  
  141.    procedure Set_Use_Action_Appearance 
  142.       (Self           : not null access Gtk_Check_Button_Record; 
  143.        Use_Appearance : Boolean); 
  144.  
  145.    procedure Sync_Action_Properties 
  146.       (Self   : not null access Gtk_Check_Button_Record; 
  147.        Action : access Gtk.Action.Gtk_Action_Record'Class); 
  148.  
  149.    ---------------- 
  150.    -- Interfaces -- 
  151.    ---------------- 
  152.    --  This class implements several interfaces. See Glib.Types 
  153.    -- 
  154.    --  - "Actionable" 
  155.    -- 
  156.    --  - "Activatable" 
  157.    -- 
  158.    --  - "Buildable" 
  159.  
  160.    package Implements_Gtk_Actionable is new Glib.Types.Implements 
  161.      (Gtk.Actionable.Gtk_Actionable, Gtk_Check_Button_Record, Gtk_Check_Button); 
  162.    function "+" 
  163.      (Widget : access Gtk_Check_Button_Record'Class) 
  164.    return Gtk.Actionable.Gtk_Actionable 
  165.    renames Implements_Gtk_Actionable.To_Interface; 
  166.    function "-" 
  167.      (Interf : Gtk.Actionable.Gtk_Actionable) 
  168.    return Gtk_Check_Button 
  169.    renames Implements_Gtk_Actionable.To_Object; 
  170.  
  171.    package Implements_Gtk_Activatable is new Glib.Types.Implements 
  172.      (Gtk.Activatable.Gtk_Activatable, Gtk_Check_Button_Record, Gtk_Check_Button); 
  173.    function "+" 
  174.      (Widget : access Gtk_Check_Button_Record'Class) 
  175.    return Gtk.Activatable.Gtk_Activatable 
  176.    renames Implements_Gtk_Activatable.To_Interface; 
  177.    function "-" 
  178.      (Interf : Gtk.Activatable.Gtk_Activatable) 
  179.    return Gtk_Check_Button 
  180.    renames Implements_Gtk_Activatable.To_Object; 
  181.  
  182.    package Implements_Gtk_Buildable is new Glib.Types.Implements 
  183.      (Gtk.Buildable.Gtk_Buildable, Gtk_Check_Button_Record, Gtk_Check_Button); 
  184.    function "+" 
  185.      (Widget : access Gtk_Check_Button_Record'Class) 
  186.    return Gtk.Buildable.Gtk_Buildable 
  187.    renames Implements_Gtk_Buildable.To_Interface; 
  188.    function "-" 
  189.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  190.    return Gtk_Check_Button 
  191.    renames Implements_Gtk_Buildable.To_Object; 
  192.  
  193. end Gtk.Check_Button;