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. --  Actions are organised into groups. An action group is essentially a map 
  26. --  from names to Gtk.Action.Gtk_Action objects. 
  27. -- 
  28. --  All actions that would make sense to use in a particular context should be 
  29. --  in a single group. Multiple action groups may be used for a particular user 
  30. --  interface. In fact, it is expected that most nontrivial applications will 
  31. --  make use of multiple groups. For example, in an application that can edit 
  32. --  multiple documents, one group holding global actions (e.g. quit, about, 
  33. --  new), and one group per document holding actions that act on that document 
  34. --  (eg. save, cut/copy/paste, etc). Each window's menus would be constructed 
  35. --  from a combination of two action groups. 
  36. -- 
  37. --  <para id="Action-Accel"> Accelerators are handled by the GTK+ accelerator 
  38. --  map. All actions are assigned an accelerator path (which normally has the 
  39. --  form '<Actions>/group-name/action-name') and a shortcut is associated with 
  40. --  this accelerator path. All menuitems and toolitems take on this accelerator 
  41. --  path. The GTK+ accelerator map code makes sure that the correct shortcut is 
  42. --  displayed next to the menu item. 
  43. --  == GtkActionGroup as GtkBuildable == 
  44. -- 
  45. --  The Gtk.Action_Group.Gtk_Action_Group implementation of the 
  46. --  Gtk.Buildable.Gtk_Buildable interface accepts Gtk.Action.Gtk_Action objects 
  47. --  as <child> elements in UI definitions. 
  48. -- 
  49. --  Note that it is probably more common to define actions and action groups 
  50. --  in the code, since they are directly related to what the code can do. 
  51. -- 
  52. --  The GtkActionGroup implementation of the GtkBuildable interface supports a 
  53. --  custom <accelerator> element, which has attributes named key and modifiers 
  54. --  and allows to specify accelerators. This is similar to the <accelerator> 
  55. --  element of Gtk.Widget.Gtk_Widget, the main difference is that it doesn't 
  56. --  allow you to specify a signal. 
  57. -- 
  58. --  == A Gtk.Dialog.Gtk_Dialog UI definition fragment. == 
  59. -- 
  60. --    <object class="GtkActionGroup" id="actiongroup"> 
  61. --    <child> 
  62. --    <object class="GtkAction" id="About"> 
  63. --    <property name="name">About</property> 
  64. --    <property name="stock_id">gtk-about</property> 
  65. --    <signal handler="about_activate" name="activate"/> 
  66. --    </object> 
  67. --    <accelerator key="F1" modifiers="GDK_CONTROL_MASK | GDK_SHIFT_MASK"/> 
  68. --    </child> 
  69. --    </object> 
  70. --  </description> 
  71. pragma Ada_2005; 
  72.  
  73. pragma Warnings (Off, "*is already use-visible*"); 
  74. with Glib;                 use Glib; 
  75. with Glib.Glist;           use Glib.Glist; 
  76. with Glib.Object;          use Glib.Object; 
  77. with Glib.Properties;      use Glib.Properties; 
  78. with Glib.Types;           use Glib.Types; 
  79. with Gtk.Accel_Group;      use Gtk.Accel_Group; 
  80. with Gtk.Action;           use Gtk.Action; 
  81. with Gtk.Buildable;        use Gtk.Buildable; 
  82. with Gtk.Widget;           use Gtk.Widget; 
  83. with Interfaces.C.Strings; use Interfaces.C.Strings; 
  84.  
  85. package Gtk.Action_Group is 
  86.  
  87.    type Gtk_Action_Group_Record is new GObject_Record with null record; 
  88.    type Gtk_Action_Group is access all Gtk_Action_Group_Record'Class; 
  89.  
  90.    function Convert (R : Gtk.Action.Gtk_Action) return System.Address; 
  91.    function Convert (R : System.Address) return Gtk.Action.Gtk_Action; 
  92.    package Action_List is new Generic_List (Gtk.Action.Gtk_Action); 
  93.  
  94.    --------------- 
  95.    -- Callbacks -- 
  96.    --------------- 
  97.  
  98.    type Gtk_Translate_Func is access function (Path : UTF8_String) return UTF8_String; 
  99.  
  100.    ------------------ 
  101.    -- Constructors -- 
  102.    ------------------ 
  103.  
  104.    procedure Gtk_New 
  105.       (Action_Group : out Gtk_Action_Group; 
  106.        Name         : UTF8_String); 
  107.    procedure Initialize 
  108.       (Action_Group : not null access Gtk_Action_Group_Record'Class; 
  109.        Name         : UTF8_String); 
  110.    --  Creates a new Gtk.Action_Group.Gtk_Action_Group object. The name of the 
  111.    --  action group is used when associating <link 
  112.    --  linkend="Action-Accel">keybindings</link> with the actions. 
  113.    --  Since: gtk+ 2.4 
  114.    --  "name": the name of the action group. 
  115.  
  116.    function Gtk_Action_Group_New 
  117.       (Name : UTF8_String) return Gtk_Action_Group; 
  118.    --  Creates a new Gtk.Action_Group.Gtk_Action_Group object. The name of the 
  119.    --  action group is used when associating <link 
  120.    --  linkend="Action-Accel">keybindings</link> with the actions. 
  121.    --  Since: gtk+ 2.4 
  122.    --  "name": the name of the action group. 
  123.  
  124.    function Get_Type return Glib.GType; 
  125.    pragma Import (C, Get_Type, "gtk_action_group_get_type"); 
  126.  
  127.    ------------- 
  128.    -- Methods -- 
  129.    ------------- 
  130.  
  131.    procedure Add_Action 
  132.       (Action_Group : not null access Gtk_Action_Group_Record; 
  133.        Action       : not null access Gtk.Action.Gtk_Action_Record'Class); 
  134.    --  Adds an action object to the action group. Note that this function does 
  135.    --  not set up the accel path of the action, which can lead to problems if a 
  136.    --  user tries to modify the accelerator of a menuitem associated with the 
  137.    --  action. Therefore you must either set the accel path yourself with 
  138.    --  Gtk.Action.Set_Accel_Path, or use 
  139.    --  'gtk_action_group_add_action_with_accel (..., NULL)'. 
  140.    --  Since: gtk+ 2.4 
  141.    --  "action": an action 
  142.  
  143.    procedure Add_Action_With_Accel 
  144.       (Action_Group : not null access Gtk_Action_Group_Record; 
  145.        Action       : not null access Gtk.Action.Gtk_Action_Record'Class; 
  146.        Accelerator  : UTF8_String := ""); 
  147.    --  Adds an action object to the action group and sets up the accelerator. 
  148.    --  If Accelerator is null, attempts to use the accelerator associated with 
  149.    --  the stock_id of the action. 
  150.    --  Accel paths are set to 
  151.    --  '<Actions>/<replaceable>group-name</replaceable>/<replaceable>action-name</replaceable>'. 
  152.    --  Since: gtk+ 2.4 
  153.    --  "action": the action to add 
  154.    --  "accelerator": the accelerator for the action, in the format understood 
  155.    --  by Gtk.Accel_Group.Accelerator_Parse, or "" for no accelerator, or null 
  156.    --  to use the stock accelerator 
  157.  
  158.    function Get_Accel_Group 
  159.       (Action_Group : not null access Gtk_Action_Group_Record) 
  160.        return Gtk.Accel_Group.Gtk_Accel_Group; 
  161.    --  Gets the accelerator group. 
  162.    --  Since: gtk+ 3.6 
  163.  
  164.    procedure Set_Accel_Group 
  165.       (Action_Group : not null access Gtk_Action_Group_Record; 
  166.        Accel_Group  : access Gtk.Accel_Group.Gtk_Accel_Group_Record'Class); 
  167.    --  Sets the accelerator group to be used by every action in this group. 
  168.    --  Since: gtk+ 3.6 
  169.    --  "accel_group": a Gtk.Accel_Group.Gtk_Accel_Group to set or null 
  170.  
  171.    function Get_Action 
  172.       (Action_Group : not null access Gtk_Action_Group_Record; 
  173.        Action_Name  : UTF8_String) return Gtk.Action.Gtk_Action; 
  174.    --  Looks up an action in the action group by name. 
  175.    --  Since: gtk+ 2.4 
  176.    --  "action_name": the name of the action 
  177.  
  178.    function Get_Name 
  179.       (Action_Group : not null access Gtk_Action_Group_Record) 
  180.        return UTF8_String; 
  181.    --  Gets the name of the action group. 
  182.    --  Since: gtk+ 2.4 
  183.  
  184.    function Get_Sensitive 
  185.       (Action_Group : not null access Gtk_Action_Group_Record) 
  186.        return Boolean; 
  187.    --  Returns True if the group is sensitive. The constituent actions can 
  188.    --  only be logically sensitive (see Gtk.Action.Is_Sensitive) if they are 
  189.    --  sensitive (see Gtk.Action.Get_Sensitive) and their group is sensitive. 
  190.    --  Since: gtk+ 2.4 
  191.  
  192.    procedure Set_Sensitive 
  193.       (Action_Group : not null access Gtk_Action_Group_Record; 
  194.        Sensitive    : Boolean); 
  195.    --  Changes the sensitivity of Action_Group 
  196.    --  Since: gtk+ 2.4 
  197.    --  "sensitive": new sensitivity 
  198.  
  199.    function Get_Visible 
  200.       (Action_Group : not null access Gtk_Action_Group_Record) 
  201.        return Boolean; 
  202.    --  Returns True if the group is visible. The constituent actions can only 
  203.    --  be logically visible (see Gtk.Action.Is_Visible) if they are visible 
  204.    --  (see Gtk.Action.Get_Visible) and their group is visible. 
  205.    --  Since: gtk+ 2.4 
  206.  
  207.    procedure Set_Visible 
  208.       (Action_Group : not null access Gtk_Action_Group_Record; 
  209.        Visible      : Boolean); 
  210.    --  Changes the visible of Action_Group. 
  211.    --  Since: gtk+ 2.4 
  212.    --  "visible": new visiblity 
  213.  
  214.    function List_Actions 
  215.       (Action_Group : not null access Gtk_Action_Group_Record) 
  216.        return Action_List.Glist; 
  217.    --  Lists the actions in the action group. 
  218.    --  Since: gtk+ 2.4 
  219.  
  220.    procedure Remove_Action 
  221.       (Action_Group : not null access Gtk_Action_Group_Record; 
  222.        Action       : not null access Gtk.Action.Gtk_Action_Record'Class); 
  223.    --  Removes an action object from the action group. 
  224.    --  Since: gtk+ 2.4 
  225.    --  "action": an action 
  226.  
  227.    procedure Set_Translate_Func 
  228.       (Action_Group : not null access Gtk_Action_Group_Record; 
  229.        Func         : Gtk_Translate_Func; 
  230.        Notify       : Glib.G_Destroy_Notify_Address); 
  231.    --  Sets a function to be used for translating the Label and Tooltip of 
  232.    --  Gtk_Action_Entry<!-- -->s added by gtk_action_group_add_actions. 
  233.    --  If you're using gettext, it is enough to set the translation domain 
  234.    --  with Gtk.Action_Group.Set_Translation_Domain. 
  235.    --  Since: gtk+ 2.4 
  236.    --  "func": a Gtk_Translate_Func 
  237.    --  "notify": a Glib.G_Destroy_Notify_Address function to be called when 
  238.    --  Action_Group is destroyed and when the translation function is changed 
  239.    --  again 
  240.  
  241.    generic 
  242.       type User_Data_Type (<>) is private; 
  243.       with procedure Destroy (Data : in out User_Data_Type) is null; 
  244.    package Set_Translate_Func_User_Data is 
  245.  
  246.       type Gtk_Translate_Func is access function 
  247.         (Path      : UTF8_String; 
  248.          Func_Data : User_Data_Type) return UTF8_String; 
  249.  
  250.       procedure Set_Translate_Func 
  251.          (Action_Group : not null access Gtk.Action_Group.Gtk_Action_Group_Record'Class; 
  252.           Func         : Gtk_Translate_Func; 
  253.           Data         : User_Data_Type; 
  254.           Notify       : Glib.G_Destroy_Notify_Address); 
  255.       --  Sets a function to be used for translating the Label and Tooltip of 
  256.       --  Gtk_Action_Entry<!-- -->s added by gtk_action_group_add_actions. 
  257.       --  If you're using gettext, it is enough to set the translation domain 
  258.       --  with Gtk.Action_Group.Set_Translation_Domain. 
  259.       --  Since: gtk+ 2.4 
  260.       --  "func": a Gtk_Translate_Func 
  261.       --  "data": data to be passed to Func and Notify 
  262.       --  "notify": a Glib.G_Destroy_Notify_Address function to be called when 
  263.       --  Action_Group is destroyed and when the translation function is 
  264.       --  changed again 
  265.  
  266.    end Set_Translate_Func_User_Data; 
  267.  
  268.    procedure Set_Translation_Domain 
  269.       (Action_Group : not null access Gtk_Action_Group_Record; 
  270.        Domain       : UTF8_String := ""); 
  271.    --  Sets the translation domain and uses g_dgettext for translating the 
  272.    --  Label and Tooltip of Gtk_Action_Entry<!-- -->s added by 
  273.    --  gtk_action_group_add_actions. 
  274.    --  If you're not using gettext for localization, see 
  275.    --  Gtk.Action_Group.Set_Translate_Func. 
  276.    --  Since: gtk+ 2.4 
  277.    --  "domain": the translation domain to use for g_dgettext calls, or null 
  278.    --  to use the domain set with textdomain 
  279.  
  280.    function Translate_String 
  281.       (Action_Group : not null access Gtk_Action_Group_Record; 
  282.        String       : UTF8_String) return UTF8_String; 
  283.    --  Translates a string using the function set with 
  284.    --  Gtk.Action_Group.Set_Translate_Func. This is mainly intended for 
  285.    --  language bindings. 
  286.    --  Since: gtk+ 2.6 
  287.    --  "string": a string 
  288.  
  289.    ---------------------- 
  290.    -- GtkAda additions -- 
  291.    ---------------------- 
  292.  
  293.    type Action_Callback is access procedure 
  294.      (Action : System.Address; User_Data : System.Address); 
  295.    pragma Convention (C, Action_Callback); 
  296.    --  Profile of callbacks when an action is activated. You must convert 
  297.    --  Action to a Gtk_Action through: 
  298.    --      Act : constant Gtk_Action := Convert (Action); 
  299.  
  300.    type Action_Entry is record 
  301.       Name         : Interfaces.C.Strings.chars_ptr; 
  302.       Stock_Id     : Interfaces.C.Strings.chars_ptr; 
  303.       Label        : Interfaces.C.Strings.chars_ptr; 
  304.       Accelerator  : Interfaces.C.Strings.chars_ptr; 
  305.       Tooltip      : Interfaces.C.Strings.chars_ptr; 
  306.       Callback     : Action_Callback; 
  307.    end record; 
  308.    pragma Convention (C, Action_Entry); 
  309.  
  310.    type Radio_Action_Entry is record 
  311.       Name         : Interfaces.C.Strings.chars_ptr; 
  312.       Stock_Id     : Interfaces.C.Strings.chars_ptr; 
  313.       Label        : Interfaces.C.Strings.chars_ptr; 
  314.       Accelerator  : Interfaces.C.Strings.chars_ptr; 
  315.       Tooltip      : Interfaces.C.Strings.chars_ptr; 
  316.       Value        : Glib.Gint; 
  317.    end record; 
  318.    pragma Convention (C, Radio_Action_Entry); 
  319.  
  320.    type Toggle_Action_Entry is record 
  321.       Name         : Interfaces.C.Strings.chars_ptr; 
  322.       Stock_Id     : Interfaces.C.Strings.chars_ptr; 
  323.       Label        : Interfaces.C.Strings.chars_ptr; 
  324.       Accelerator  : Interfaces.C.Strings.chars_ptr; 
  325.       Tooltip      : Interfaces.C.Strings.chars_ptr; 
  326.       Callback     : Action_Callback; 
  327.       Is_Active    : Glib.Gboolean; 
  328.    end record; 
  329.    pragma Convention (C, Toggle_Action_Entry); 
  330.    --  An opaque structure describing an action entry 
  331.  
  332.    type Action_Entry_Array is array (Natural range <>) of Action_Entry; 
  333.    type Radio_Action_Entry_Array 
  334.    is array (Natural range <>) of Radio_Action_Entry; 
  335.    type Toggle_Action_Entry_Array 
  336.    is array (Natural range <>) of Toggle_Action_Entry; 
  337.  
  338.    type Radio_Action_Callback is access procedure 
  339.      (Group     : access Gtk.Action.Gtk_Action_Record'Class; 
  340.       Current   : access Gtk.Action.Gtk_Action_Record'Class; 
  341.       User_Data : System.Address); 
  342.    --   Called when an element of the Gtk_Radio_Action group is selected 
  343.  
  344.    function Create 
  345.      (Name        : String; 
  346.       Label       : String := ""; 
  347.       Stock_Id    : String := ""; 
  348.       Accelerator : String := ""; 
  349.       Tooltip     : String := ""; 
  350.       Callback    : Action_Callback := null) return Action_Entry; 
  351.    --  Create a new Action_Entry. The returned value must be freed by the 
  352.    --  caller. 
  353.  
  354.    function Create 
  355.      (Name        : String; 
  356.       Label       : String := ""; 
  357.       Stock_Id    : String := ""; 
  358.       Accelerator : String := ""; 
  359.       Tooltip     : String := ""; 
  360.       Callback    : Action_Callback := null; 
  361.       Is_Active   : Boolean := True) return Toggle_Action_Entry; 
  362.    --  Create a new Action_Entry. The returned value must be freed by the 
  363.    --  caller. Is_Active is the initial state of the button. 
  364.  
  365.    function Create 
  366.      (Name        : String; 
  367.       Label       : String; 
  368.       Stock_Id    : String := ""; 
  369.       Accelerator : String := ""; 
  370.       Tooltip     : String := ""; 
  371.       Value       : Glib.Gint) return Radio_Action_Entry; 
  372.    --  Create a new Radio_Action_Entry. Value is the value set on the radio 
  373.    --  action (see Gtk.Radio_Action.Get_Current_Value) 
  374.  
  375.    procedure Free (Action  : in out Action_Entry); 
  376.    procedure Free (Actions : in out Action_Entry_Array); 
  377.    procedure Free (Action  : in out Radio_Action_Entry); 
  378.    procedure Free (Actions : in out Radio_Action_Entry_Array); 
  379.    procedure Free (Action  : in out Toggle_Action_Entry); 
  380.    procedure Free (Actions : in out Toggle_Action_Entry_Array); 
  381.    --  Free Action and Actions 
  382.  
  383.    procedure Add_Actions 
  384.      (Action_Group : access Gtk_Action_Group_Record; 
  385.       Entries      : Action_Entry_Array; 
  386.       User_Data    : System.Address := System.Null_Address; 
  387.       Destroy      : Glib.G_Destroy_Notify_Address := null); 
  388.    --  This is a convenience function to create a number of actions and add 
  389.    --  them to the action group. 
  390.    --  Destroy is called when User_Data is no longer needed. 
  391.    -- 
  392.    --  The "activate" signals of the actions are connected to the callbacks in 
  393.    --  Entries, and their accel paths are set to 
  394.    --  <Actions>/group-name/action-name. 
  395.  
  396.    procedure Add_Radio_Actions 
  397.      (Action_Group : access Gtk_Action_Group_Record; 
  398.       Entries      : Radio_Action_Entry_Array; 
  399.       Value        : Glib.Gint; 
  400.       On_Change    : Radio_Action_Callback; 
  401.       User_Data    : System.Address := System.Null_Address; 
  402.       Destroy      : Glib.G_Destroy_Notify_Address := null); 
  403.    --  This is a convenience routine to create a group of radio actions and 
  404.    --  add them to the action group. 
  405.    -- 
  406.    --  The "changed" signal of the first radio action is connected to the 
  407.    --  On_Change callback and the accel paths of the actions are set to 
  408.    --    <Actions>/group-name/action-name 
  409.    -- 
  410.    --  Value is the value of the action to activate initially, or -1 if no 
  411.    --  action should be activated. 
  412.    --  Destroy is called when User_Data is no longer necessary. 
  413.  
  414.    procedure Add_Toggle_Actions 
  415.      (Action_Group : access Gtk_Action_Group_Record; 
  416.       Entries      : Toggle_Action_Entry_Array; 
  417.       User_Data    : System.Address := System.Null_Address; 
  418.       Destroy      : Glib.G_Destroy_Notify_Address := null); 
  419.    --  This is a convenience function to create a number of toggle actions and 
  420.    --  add them to the action group. 
  421.    --  The "activate" signals of the actions are connected to the callbacks and 
  422.    --  their accel paths are set to <Actions>/group-name/action-name. 
  423.    --  Destroy is called when User_Data is no longer necessary. 
  424.  
  425.    ---------------- 
  426.    -- Properties -- 
  427.    ---------------- 
  428.    --  The following properties are defined for this widget. See 
  429.    --  Glib.Properties for more information on properties) 
  430.  
  431.    Accel_Group_Property : constant Glib.Properties.Property_Object; 
  432.    --  Type: Gtk.Accel_Group.Gtk_Accel_Group 
  433.  
  434.    Name_Property : constant Glib.Properties.Property_String; 
  435.  
  436.    Sensitive_Property : constant Glib.Properties.Property_Boolean; 
  437.  
  438.    Visible_Property : constant Glib.Properties.Property_Boolean; 
  439.  
  440.    ------------- 
  441.    -- Signals -- 
  442.    ------------- 
  443.  
  444.    type Cb_Gtk_Action_Group_Gtk_Action_Gtk_Widget_Void is not null access procedure 
  445.      (Self   : access Gtk_Action_Group_Record'Class; 
  446.       Action : not null access Gtk.Action.Gtk_Action_Record'Class; 
  447.       Proxy  : not null access Gtk.Widget.Gtk_Widget_Record'Class); 
  448.  
  449.    type Cb_GObject_Gtk_Action_Gtk_Widget_Void is not null access procedure 
  450.      (Self   : access Glib.Object.GObject_Record'Class; 
  451.       Action : not null access Gtk.Action.Gtk_Action_Record'Class; 
  452.       Proxy  : not null access Gtk.Widget.Gtk_Widget_Record'Class); 
  453.  
  454.    Signal_Connect_Proxy : constant Glib.Signal_Name := "connect-proxy"; 
  455.    procedure On_Connect_Proxy 
  456.       (Self  : not null access Gtk_Action_Group_Record; 
  457.        Call  : Cb_Gtk_Action_Group_Gtk_Action_Gtk_Widget_Void; 
  458.        After : Boolean := False); 
  459.    procedure On_Connect_Proxy 
  460.       (Self  : not null access Gtk_Action_Group_Record; 
  461.        Call  : Cb_GObject_Gtk_Action_Gtk_Widget_Void; 
  462.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  463.        After : Boolean := False); 
  464.    --  The ::connect-proxy signal is emitted after connecting a proxy to an 
  465.    --  action in the group. Note that the proxy may have been connected to a 
  466.    --  different action before. 
  467.    -- 
  468.    --  This is intended for simple customizations for which a custom action 
  469.    --  class would be too clumsy, e.g. showing tooltips for menuitems in the 
  470.    --  statusbar. 
  471.    -- 
  472.    --  Gtk.UI_Manager.Gtk_UI_Manager proxies the signal and provides global 
  473.    --  notification just before any action is connected to a proxy, which is 
  474.    --  probably more convenient to use. 
  475.    --  
  476.    --  Callback parameters: 
  477.    --    --  "action": the action 
  478.    --    --  "proxy": the proxy 
  479.  
  480.    Signal_Disconnect_Proxy : constant Glib.Signal_Name := "disconnect-proxy"; 
  481.    procedure On_Disconnect_Proxy 
  482.       (Self  : not null access Gtk_Action_Group_Record; 
  483.        Call  : Cb_Gtk_Action_Group_Gtk_Action_Gtk_Widget_Void; 
  484.        After : Boolean := False); 
  485.    procedure On_Disconnect_Proxy 
  486.       (Self  : not null access Gtk_Action_Group_Record; 
  487.        Call  : Cb_GObject_Gtk_Action_Gtk_Widget_Void; 
  488.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  489.        After : Boolean := False); 
  490.    --  The ::disconnect-proxy signal is emitted after disconnecting a proxy 
  491.    --  from an action in the group. 
  492.    -- 
  493.    --  Gtk.UI_Manager.Gtk_UI_Manager proxies the signal and provides global 
  494.    --  notification just before any action is connected to a proxy, which is 
  495.    --  probably more convenient to use. 
  496.    --  
  497.    --  Callback parameters: 
  498.    --    --  "action": the action 
  499.    --    --  "proxy": the proxy 
  500.  
  501.    type Cb_Gtk_Action_Group_Gtk_Action_Void is not null access procedure 
  502.      (Self   : access Gtk_Action_Group_Record'Class; 
  503.       Action : not null access Gtk.Action.Gtk_Action_Record'Class); 
  504.  
  505.    type Cb_GObject_Gtk_Action_Void is not null access procedure 
  506.      (Self   : access Glib.Object.GObject_Record'Class; 
  507.       Action : not null access Gtk.Action.Gtk_Action_Record'Class); 
  508.  
  509.    Signal_Post_Activate : constant Glib.Signal_Name := "post-activate"; 
  510.    procedure On_Post_Activate 
  511.       (Self  : not null access Gtk_Action_Group_Record; 
  512.        Call  : Cb_Gtk_Action_Group_Gtk_Action_Void; 
  513.        After : Boolean := False); 
  514.    procedure On_Post_Activate 
  515.       (Self  : not null access Gtk_Action_Group_Record; 
  516.        Call  : Cb_GObject_Gtk_Action_Void; 
  517.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  518.        After : Boolean := False); 
  519.    --  The ::post-activate signal is emitted just after the Action in the 
  520.    --  Action_Group is activated 
  521.    -- 
  522.    --  This is intended for Gtk.UI_Manager.Gtk_UI_Manager to proxy the signal 
  523.    --  and provide global notification just after any action is activated. 
  524.  
  525.    Signal_Pre_Activate : constant Glib.Signal_Name := "pre-activate"; 
  526.    procedure On_Pre_Activate 
  527.       (Self  : not null access Gtk_Action_Group_Record; 
  528.        Call  : Cb_Gtk_Action_Group_Gtk_Action_Void; 
  529.        After : Boolean := False); 
  530.    procedure On_Pre_Activate 
  531.       (Self  : not null access Gtk_Action_Group_Record; 
  532.        Call  : Cb_GObject_Gtk_Action_Void; 
  533.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  534.        After : Boolean := False); 
  535.    --  The ::pre-activate signal is emitted just before the Action in the 
  536.    --  Action_Group is activated 
  537.    -- 
  538.    --  This is intended for Gtk.UI_Manager.Gtk_UI_Manager to proxy the signal 
  539.    --  and provide global notification just before any action is activated. 
  540.  
  541.    ---------------- 
  542.    -- Interfaces -- 
  543.    ---------------- 
  544.    --  This class implements several interfaces. See Glib.Types 
  545.    -- 
  546.    --  - "Buildable" 
  547.  
  548.    package Implements_Gtk_Buildable is new Glib.Types.Implements 
  549.      (Gtk.Buildable.Gtk_Buildable, Gtk_Action_Group_Record, Gtk_Action_Group); 
  550.    function "+" 
  551.      (Widget : access Gtk_Action_Group_Record'Class) 
  552.    return Gtk.Buildable.Gtk_Buildable 
  553.    renames Implements_Gtk_Buildable.To_Interface; 
  554.    function "-" 
  555.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  556.    return Gtk_Action_Group 
  557.    renames Implements_Gtk_Buildable.To_Object; 
  558.  
  559. private 
  560.    Visible_Property : constant Glib.Properties.Property_Boolean := 
  561.      Glib.Properties.Build ("visible"); 
  562.    Sensitive_Property : constant Glib.Properties.Property_Boolean := 
  563.      Glib.Properties.Build ("sensitive"); 
  564.    Name_Property : constant Glib.Properties.Property_String := 
  565.      Glib.Properties.Build ("name"); 
  566.    Accel_Group_Property : constant Glib.Properties.Property_Object := 
  567.      Glib.Properties.Build ("accel-group"); 
  568. end Gtk.Action_Group;