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.Radio_Tool_Button.Gtk_Radio_Tool_Button is a 
  26. --  Gtk.Tool_Item.Gtk_Tool_Item that contains a radio button, that is, a button 
  27. --  that is part of a group of toggle buttons where only one button can be 
  28. --  active at a time. 
  29. -- 
  30. --  Use Gtk.Radio_Tool_Button.Gtk_New to create a new 
  31. --  Gtk.Radio_Tool_Button.Gtk_Radio_Tool_Button. Use 
  32. --  gtk_radio_tool_button_new_from_widget to create a new 
  33. --  Gtk.Radio_Tool_Button.Gtk_Radio_Tool_Button that is part of the same group 
  34. --  as an existing Gtk.Radio_Tool_Button.Gtk_Radio_Tool_Button. Use 
  35. --  Gtk.Radio_Tool_Button.Gtk_New_From_Stock or 
  36. --  gtk_radio_tool_button_new_with_stock_from_widget create a new 
  37. --  Gtk.Radio_Tool_Button.Gtk_Radio_Tool_Button containing a stock item. 
  38. -- 
  39. --  </description> 
  40. pragma Ada_2005; 
  41.  
  42. pragma Warnings (Off, "*is already use-visible*"); 
  43. with Glib;                   use Glib; 
  44. with Glib.Properties;        use Glib.Properties; 
  45. with Glib.Types;             use Glib.Types; 
  46. with Glib.Variant;           use Glib.Variant; 
  47. with Gtk.Action;             use Gtk.Action; 
  48. with Gtk.Actionable;         use Gtk.Actionable; 
  49. with Gtk.Activatable;        use Gtk.Activatable; 
  50. with Gtk.Buildable;          use Gtk.Buildable; 
  51. with Gtk.Toggle_Tool_Button; use Gtk.Toggle_Tool_Button; 
  52. with Gtk.Widget;             use Gtk.Widget; 
  53.  
  54. package Gtk.Radio_Tool_Button is 
  55.  
  56.    type Gtk_Radio_Tool_Button_Record is new Gtk_Toggle_Tool_Button_Record with null record; 
  57.    type Gtk_Radio_Tool_Button is access all Gtk_Radio_Tool_Button_Record'Class; 
  58.  
  59.    ------------------ 
  60.    -- Constructors -- 
  61.    ------------------ 
  62.  
  63.    procedure Gtk_New 
  64.       (Self  : out Gtk_Radio_Tool_Button; 
  65.        Group : Gtk.Widget.Widget_SList.GSlist); 
  66.    procedure Initialize 
  67.       (Self  : not null access Gtk_Radio_Tool_Button_Record'Class; 
  68.        Group : Gtk.Widget.Widget_SList.GSlist); 
  69.    --  Creates a new Gtk.Radio_Tool_Button.Gtk_Radio_Tool_Button, adding it to 
  70.    --  Group. 
  71.    --  Since: gtk+ 2.4 
  72.    --  "group": An existing radio button group, or null if you are creating a 
  73.    --  new group 
  74.  
  75.    function Gtk_Radio_Tool_Button_New 
  76.       (Group : Gtk.Widget.Widget_SList.GSlist) return Gtk_Radio_Tool_Button; 
  77.    --  Creates a new Gtk.Radio_Tool_Button.Gtk_Radio_Tool_Button, adding it to 
  78.    --  Group. 
  79.    --  Since: gtk+ 2.4 
  80.    --  "group": An existing radio button group, or null if you are creating a 
  81.    --  new group 
  82.  
  83.    procedure Gtk_New_From_Stock 
  84.       (Self     : out Gtk_Radio_Tool_Button; 
  85.        Group    : Gtk.Widget.Widget_SList.GSlist; 
  86.        Stock_Id : UTF8_String); 
  87.    procedure Initialize_From_Stock 
  88.       (Self     : not null access Gtk_Radio_Tool_Button_Record'Class; 
  89.        Group    : Gtk.Widget.Widget_SList.GSlist; 
  90.        Stock_Id : UTF8_String); 
  91.    --  Creates a new Gtk.Radio_Tool_Button.Gtk_Radio_Tool_Button, adding it to 
  92.    --  Group. The new Gtk.Radio_Tool_Button.Gtk_Radio_Tool_Button will contain 
  93.    --  an icon and label from the stock item indicated by Stock_Id. 
  94.    --  Since: gtk+ 2.4 
  95.    --  "group": an existing radio button group, or null if you are creating a 
  96.    --  new group 
  97.    --  "stock_id": the name of a stock item 
  98.  
  99.    function Gtk_Radio_Tool_Button_New_From_Stock 
  100.       (Group    : Gtk.Widget.Widget_SList.GSlist; 
  101.        Stock_Id : UTF8_String) return Gtk_Radio_Tool_Button; 
  102.    --  Creates a new Gtk.Radio_Tool_Button.Gtk_Radio_Tool_Button, adding it to 
  103.    --  Group. The new Gtk.Radio_Tool_Button.Gtk_Radio_Tool_Button will contain 
  104.    --  an icon and label from the stock item indicated by Stock_Id. 
  105.    --  Since: gtk+ 2.4 
  106.    --  "group": an existing radio button group, or null if you are creating a 
  107.    --  new group 
  108.    --  "stock_id": the name of a stock item 
  109.  
  110.    function Get_Type return Glib.GType; 
  111.    pragma Import (C, Get_Type, "gtk_radio_tool_button_get_type"); 
  112.  
  113.    ------------- 
  114.    -- Methods -- 
  115.    ------------- 
  116.  
  117.    function Get_Group 
  118.       (Self : not null access Gtk_Radio_Tool_Button_Record) 
  119.        return Gtk.Widget.Widget_SList.GSlist; 
  120.    --  Returns the radio button group Button belongs to. 
  121.    --  Since: gtk+ 2.4 
  122.  
  123.    procedure Set_Group 
  124.       (Self  : not null access Gtk_Radio_Tool_Button_Record; 
  125.        Group : Gtk.Widget.Widget_SList.GSlist); 
  126.    --  Adds Button to Group, removing it from the group it belonged to before. 
  127.    --  Since: gtk+ 2.4 
  128.    --  "group": an existing radio button group 
  129.  
  130.    --------------------------------------------- 
  131.    -- Inherited subprograms (from interfaces) -- 
  132.    --------------------------------------------- 
  133.    --  Methods inherited from the Buildable interface are not duplicated here 
  134.    --  since they are meant to be used by tools, mostly. If you need to call 
  135.    --  them, use an explicit cast through the "-" operator below. 
  136.  
  137.    function Get_Action_Name 
  138.       (Self : not null access Gtk_Radio_Tool_Button_Record) 
  139.        return UTF8_String; 
  140.  
  141.    procedure Set_Action_Name 
  142.       (Self        : not null access Gtk_Radio_Tool_Button_Record; 
  143.        Action_Name : UTF8_String); 
  144.  
  145.    function Get_Action_Target_Value 
  146.       (Self : not null access Gtk_Radio_Tool_Button_Record) 
  147.        return Glib.Variant.Gvariant; 
  148.  
  149.    procedure Set_Action_Target_Value 
  150.       (Self         : not null access Gtk_Radio_Tool_Button_Record; 
  151.        Target_Value : Glib.Variant.Gvariant); 
  152.  
  153.    procedure Set_Detailed_Action_Name 
  154.       (Self                 : not null access Gtk_Radio_Tool_Button_Record; 
  155.        Detailed_Action_Name : UTF8_String); 
  156.  
  157.    procedure Do_Set_Related_Action 
  158.       (Self   : not null access Gtk_Radio_Tool_Button_Record; 
  159.        Action : not null access Gtk.Action.Gtk_Action_Record'Class); 
  160.  
  161.    function Get_Related_Action 
  162.       (Self : not null access Gtk_Radio_Tool_Button_Record) 
  163.        return Gtk.Action.Gtk_Action; 
  164.  
  165.    procedure Set_Related_Action 
  166.       (Self   : not null access Gtk_Radio_Tool_Button_Record; 
  167.        Action : not null access Gtk.Action.Gtk_Action_Record'Class); 
  168.  
  169.    function Get_Use_Action_Appearance 
  170.       (Self : not null access Gtk_Radio_Tool_Button_Record) return Boolean; 
  171.  
  172.    procedure Set_Use_Action_Appearance 
  173.       (Self           : not null access Gtk_Radio_Tool_Button_Record; 
  174.        Use_Appearance : Boolean); 
  175.  
  176.    procedure Sync_Action_Properties 
  177.       (Self   : not null access Gtk_Radio_Tool_Button_Record; 
  178.        Action : access Gtk.Action.Gtk_Action_Record'Class); 
  179.  
  180.    ---------------- 
  181.    -- Properties -- 
  182.    ---------------- 
  183.    --  The following properties are defined for this widget. See 
  184.    --  Glib.Properties for more information on properties) 
  185.  
  186.    Group_Property : constant Glib.Properties.Property_Object; 
  187.    --  Type: Gtk_Radio_Tool_Button 
  188.    --  Flags: write 
  189.    --  Sets a new group for a radio tool button. 
  190.  
  191.    ---------------- 
  192.    -- Interfaces -- 
  193.    ---------------- 
  194.    --  This class implements several interfaces. See Glib.Types 
  195.    -- 
  196.    --  - "Actionable" 
  197.    -- 
  198.    --  - "Activatable" 
  199.    -- 
  200.    --  - "Buildable" 
  201.  
  202.    package Implements_Gtk_Actionable is new Glib.Types.Implements 
  203.      (Gtk.Actionable.Gtk_Actionable, Gtk_Radio_Tool_Button_Record, Gtk_Radio_Tool_Button); 
  204.    function "+" 
  205.      (Widget : access Gtk_Radio_Tool_Button_Record'Class) 
  206.    return Gtk.Actionable.Gtk_Actionable 
  207.    renames Implements_Gtk_Actionable.To_Interface; 
  208.    function "-" 
  209.      (Interf : Gtk.Actionable.Gtk_Actionable) 
  210.    return Gtk_Radio_Tool_Button 
  211.    renames Implements_Gtk_Actionable.To_Object; 
  212.  
  213.    package Implements_Gtk_Activatable is new Glib.Types.Implements 
  214.      (Gtk.Activatable.Gtk_Activatable, Gtk_Radio_Tool_Button_Record, Gtk_Radio_Tool_Button); 
  215.    function "+" 
  216.      (Widget : access Gtk_Radio_Tool_Button_Record'Class) 
  217.    return Gtk.Activatable.Gtk_Activatable 
  218.    renames Implements_Gtk_Activatable.To_Interface; 
  219.    function "-" 
  220.      (Interf : Gtk.Activatable.Gtk_Activatable) 
  221.    return Gtk_Radio_Tool_Button 
  222.    renames Implements_Gtk_Activatable.To_Object; 
  223.  
  224.    package Implements_Gtk_Buildable is new Glib.Types.Implements 
  225.      (Gtk.Buildable.Gtk_Buildable, Gtk_Radio_Tool_Button_Record, Gtk_Radio_Tool_Button); 
  226.    function "+" 
  227.      (Widget : access Gtk_Radio_Tool_Button_Record'Class) 
  228.    return Gtk.Buildable.Gtk_Buildable 
  229.    renames Implements_Gtk_Buildable.To_Interface; 
  230.    function "-" 
  231.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  232.    return Gtk_Radio_Tool_Button 
  233.    renames Implements_Gtk_Buildable.To_Object; 
  234.  
  235. private 
  236.    Group_Property : constant Glib.Properties.Property_Object := 
  237.      Glib.Properties.Build ("group"); 
  238. end Gtk.Radio_Tool_Button;