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.UI_Manager.Gtk_UI_Manager constructs a user interface (menus and 
  26. --  toolbars) from one or more UI definitions, which reference actions from one 
  27. --  or more action groups. 
  28. -- 
  29. --  == UI Definitions == 
  30. -- 
  31. --  The UI definitions are specified in an XML format which can be roughly 
  32. --  described by the following DTD. 
  33. -- 
  34. --  Note: 
  35. -- 
  36. --  Do not confuse the GtkUIManager UI Definitions described here with the 
  37. --  similarly named <link linkend="BUILDER-UI">GtkBuilder UI 
  38. --  Definitions</link>. 
  39. -- 
  40. --    <!ELEMENT ui          (menubar|toolbar|popup|accelerator)* > 
  41. --    <!ELEMENT menubar     (menuitem|separator|placeholder|menu)* > 
  42. --    <!ELEMENT menu        (menuitem|separator|placeholder|menu)* > 
  43. --    <!ELEMENT popup       (menuitem|separator|placeholder|menu)* > 
  44. --    <!ELEMENT toolbar     (toolitem|separator|placeholder)* > 
  45. --    <!ELEMENT placeholder (menuitem|toolitem|separator|placeholder|menu)* > 
  46. --    <!ELEMENT menuitem     EMPTY > 
  47. --    <!ELEMENT toolitem     (menu?) > 
  48. --    <!ELEMENT separator    EMPTY > 
  49. --    <!ELEMENT accelerator  EMPTY > 
  50. --    <!ATTLIST menubar      name                      IMPLIED 
  51. --    action                    IMPLIED > 
  52. --    <!ATTLIST toolbar      name                      IMPLIED 
  53. --    action                    IMPLIED > 
  54. --    <!ATTLIST popup        name                      IMPLIED 
  55. --    action                    IMPLIED 
  56. --    accelerators (true|false) IMPLIED > 
  57. --    <!ATTLIST placeholder  name                      IMPLIED 
  58. --    action                    IMPLIED > 
  59. --    <!ATTLIST separator    name                      IMPLIED 
  60. --    action                    IMPLIED 
  61. --    expand       (true|false) IMPLIED > 
  62. --    <!ATTLIST menu         name                      IMPLIED 
  63. --    action                    REQUIRED 
  64. --    position     (top|bot)    IMPLIED > 
  65. --    <!ATTLIST menuitem     name                      IMPLIED 
  66. --    action                    REQUIRED 
  67. --    position     (top|bot)    IMPLIED 
  68. --    always-show-image (true|false) IMPLIED > 
  69. --    <!ATTLIST toolitem     name                      IMPLIED 
  70. --    action                    REQUIRED 
  71. --    position     (top|bot)    IMPLIED > 
  72. --    <!ATTLIST accelerator  name                      IMPLIED 
  73. --    action                    REQUIRED > 
  74. --  There are some additional restrictions beyond those specified in the DTD, 
  75. --  e.g. every toolitem must have a toolbar in its anchestry and every menuitem 
  76. --  must have a menubar or popup in its anchestry. Since a GMarkup parser is 
  77. --  used to parse the UI description, it must not only be valid XML, but valid 
  78. --  GMarkup. 
  79. -- 
  80. --  If a name is not specified, it defaults to the action. If an action is not 
  81. --  specified either, the element name is used. The name and action attributes 
  82. --  must not contain '/' characters after parsing (since that would mess up 
  83. --  path lookup) and must be usable as XML attributes when enclosed in 
  84. --  doublequotes, thus they must not '"' characters or references to the &quot; 
  85. --  entity. 
  86. -- 
  87. --  == A UI definition == 
  88. -- 
  89. --    <ui> 
  90. --    <menubar> 
  91. --    <menu name="FileMenu" action="FileMenuAction"> 
  92. --    <menuitem name="New" action="New2Action" /> 
  93. --    <placeholder name="FileMenuAdditions" /> 
  94. --    </menu> 
  95. --    <menu name="JustifyMenu" action="JustifyMenuAction"> 
  96. --    <menuitem name="Left" action="justify-left"/> 
  97. --    <menuitem name="Centre" action="justify-center"/> 
  98. --    <menuitem name="Right" action="justify-right"/> 
  99. --    <menuitem name="Fill" action="justify-fill"/> 
  100. --    </menu> 
  101. --    </menubar> 
  102. --    <toolbar action="toolbar1"> 
  103. --    <placeholder name="JustifyToolItems"> 
  104. --    <separator/> 
  105. --    <toolitem name="Left" action="justify-left"/> 
  106. --    <toolitem name="Centre" action="justify-center"/> 
  107. --    <toolitem name="Right" action="justify-right"/> 
  108. --    <toolitem name="Fill" action="justify-fill"/> 
  109. --    <separator/> 
  110. --    </placeholder> 
  111. --    </toolbar> 
  112. --    </ui> 
  113. --  The constructed widget hierarchy is very similar to the element tree of 
  114. --  the XML, with the exception that placeholders are merged into their 
  115. --  parents. The correspondence of XML elements to widgets should be almost 
  116. --  obvious: 
  117. -- 
  118. --  'menubar' 
  119. -- 
  120. --     * a Gtk.Menu_Bar.Gtk_Menu_Bar 
  121. -- 
  122. --  'toolbar' 
  123. -- 
  124. --     * a Gtk.Toolbar.Gtk_Toolbar 
  125. -- 
  126. --  'popup' 
  127. -- 
  128. --     * a toplevel Gtk.Menu.Gtk_Menu 
  129. -- 
  130. --  'menu' 
  131. -- 
  132. --     * a Gtk.Menu.Gtk_Menu attached to a menuitem 
  133. -- 
  134. --  'menuitem' 
  135. -- 
  136. --     * a Gtk.Menu_Item.Gtk_Menu_Item subclass, the exact type depends on the 
  137. --  action 
  138. -- 
  139. --  'toolitem' 
  140. -- 
  141. --     * a Gtk.Tool_Item.Gtk_Tool_Item subclass, the exact type depends on the 
  142. --  action. Note that toolitem elements may contain a menu element, but only if 
  143. --  their associated action specifies a 
  144. --  Gtk.Menu_Tool_Button.Gtk_Menu_Tool_Button as proxy. 
  145. -- 
  146. --  'separator' 
  147. -- 
  148. --     * a Gtk.Separator_Menu_Item.Gtk_Separator_Menu_Item or 
  149. --  Gtk.Separator_Tool_Item.Gtk_Separator_Tool_Item 
  150. -- 
  151. --  'accelerator' 
  152. -- 
  153. --     * a keyboard accelerator 
  154. -- 
  155. --  The "position" attribute determines where a constructed widget is 
  156. --  positioned wrt. to its siblings in the partially constructed tree. If it is 
  157. --  "top", the widget is prepended, otherwise it is appended. 
  158. -- 
  159. --  == UI Merging == 
  160. -- 
  161. --  The most remarkable feature of Gtk.UI_Manager.Gtk_UI_Manager is that it 
  162. --  can overlay a set of menuitems and toolitems over another one, and demerge 
  163. --  them later. 
  164. -- 
  165. --  Merging is done based on the names of the XML elements. Each element is 
  166. --  identified by a path which consists of the names of its anchestors, 
  167. --  separated by slashes. For example, the menuitem named "Left" in the example 
  168. --  above has the path '/ui/menubar/JustifyMenu/Left' and the toolitem with the 
  169. --  same name has path '/ui/toolbar1/JustifyToolItems/Left'. 
  170. -- 
  171. --  == Accelerators == 
  172. -- 
  173. --  Every action has an accelerator path. Accelerators are installed together 
  174. --  with menuitem proxies, but they can also be explicitly added with 
  175. --  <accelerator> elements in the UI definition. This makes it possible to have 
  176. --  accelerators for actions even if they have no visible proxies. 
  177. -- 
  178. --  == Smart Separators == 
  179. -- 
  180. --  The separators created by Gtk.UI_Manager.Gtk_UI_Manager are "smart", i.e. 
  181. --  they do not show up in the UI unless they end up between two visible menu 
  182. --  or tool items. Separators which are located at the very beginning or end of 
  183. --  the menu or toolbar containing them, or multiple separators next to each 
  184. --  other, are hidden. This is a useful feature, since the merging of UI 
  185. --  elements from multiple sources can make it hard or impossible to determine 
  186. --  in advance whether a separator will end up in such an unfortunate position. 
  187. -- 
  188. --  For separators in toolbars, you can set 'expand="true"' to turn them from 
  189. --  a small, visible separator to an expanding, invisible one. Toolitems 
  190. --  following an expanding separator are effectively right-aligned. 
  191. -- 
  192. --  == Empty Menus == 
  193. -- 
  194. --  Submenus pose similar problems to separators inconnection with merging. It 
  195. --  is impossible to know in advance whether they will end up empty after 
  196. --  merging. Gtk.UI_Manager.Gtk_UI_Manager offers two ways to treat empty 
  197. --  submenus: 
  198. -- 
  199. --     * make them disappear by hiding the menu item they're attached to 
  200. -- 
  201. --     * add an insensitive "Empty" item 
  202. -- 
  203. --  The behaviour is chosen based on the "hide_if_empty" property of the 
  204. --  action to which the submenu is associated. 
  205. -- 
  206. --  == GtkUIManager as GtkBuildable == 
  207. -- 
  208. --  The GtkUIManager implementation of the GtkBuildable interface accepts 
  209. --  GtkActionGroup objects as <child> elements in UI definitions. 
  210. -- 
  211. --  A GtkUIManager UI definition as described above can be embedded in an 
  212. --  GtkUIManager <object> element in a GtkBuilder UI definition. 
  213. -- 
  214. --  The widgets that are constructed by a GtkUIManager can be embedded in 
  215. --  other parts of the constructed user interface with the help of the 
  216. --  "constructor" attribute. See the example below. 
  217. -- 
  218. --  == An embedded GtkUIManager UI definition == 
  219. -- 
  220. --    <object class="GtkUIManager" id="uiman"> 
  221. --    <child> 
  222. --    <object class="GtkActionGroup" id="actiongroup"> 
  223. --    <child> 
  224. --    <object class="GtkAction" id="file"> 
  225. --    <property name="label">_File</property> 
  226. --    </object> 
  227. --    </child> 
  228. --    </object> 
  229. --    </child> 
  230. --    <ui> 
  231. --    <menubar name="menubar1"> 
  232. --    <menu action="file"> 
  233. --    </menu> 
  234. --    </menubar> 
  235. --    </ui> 
  236. --    </object> 
  237. --    <object class="GtkWindow" id="main-window"> 
  238. --    <child> 
  239. --    <object class="GtkMenuBar" id="menubar1" constructor="uiman"/> 
  240. --    </child> 
  241. --    </object> 
  242. --  </description> 
  243. pragma Ada_2005; 
  244.  
  245. pragma Warnings (Off, "*is already use-visible*"); 
  246. with Glib;                    use Glib; 
  247. with Glib.Error;              use Glib.Error; 
  248. with Glib.Generic_Properties; use Glib.Generic_Properties; 
  249. with Glib.Object;             use Glib.Object; 
  250. with Glib.Properties;         use Glib.Properties; 
  251. with Glib.Types;              use Glib.Types; 
  252. with Gtk.Accel_Group;         use Gtk.Accel_Group; 
  253. with Gtk.Action;              use Gtk.Action; 
  254. with Gtk.Action_Group;        use Gtk.Action_Group; 
  255. with Gtk.Buildable;           use Gtk.Buildable; 
  256. with Gtk.Widget;              use Gtk.Widget; 
  257.  
  258. package Gtk.UI_Manager is 
  259.  
  260.    type Gtk_UI_Manager_Record is new GObject_Record with null record; 
  261.    type Gtk_UI_Manager is access all Gtk_UI_Manager_Record'Class; 
  262.  
  263.    type Manager_Item_Type is mod 2 ** Integer'Size; 
  264.    pragma Convention (C, Manager_Item_Type); 
  265.    --  These enumeration values are used by Gtk.UI_Manager.Add_UI to determine 
  266.    --  what UI element to create. 
  267.  
  268.    Manager_Auto : constant Manager_Item_Type := 0; 
  269.    Manager_Menubar : constant Manager_Item_Type := 1; 
  270.    Manager_Menu : constant Manager_Item_Type := 2; 
  271.    Manager_Toolbar : constant Manager_Item_Type := 4; 
  272.    Manager_Placeholder : constant Manager_Item_Type := 8; 
  273.    Manager_Popup : constant Manager_Item_Type := 16; 
  274.    Manager_Menuitem : constant Manager_Item_Type := 32; 
  275.    Manager_Toolitem : constant Manager_Item_Type := 64; 
  276.    Manager_Separator : constant Manager_Item_Type := 128; 
  277.    Manager_Accelerator : constant Manager_Item_Type := 256; 
  278.    Manager_Popup_With_Accels : constant Manager_Item_Type := 512; 
  279.  
  280.    ---------------------------- 
  281.    -- Enumeration Properties -- 
  282.    ---------------------------- 
  283.  
  284.    package Manager_Item_Type_Properties is 
  285.       new Generic_Internal_Discrete_Property (Manager_Item_Type); 
  286.    type Property_Manager_Item_Type is new Manager_Item_Type_Properties.Property; 
  287.  
  288.    ------------------ 
  289.    -- Constructors -- 
  290.    ------------------ 
  291.  
  292.    procedure Gtk_New (Self : out Gtk_UI_Manager); 
  293.    procedure Initialize (Self : not null access Gtk_UI_Manager_Record'Class); 
  294.    --  Creates a new ui manager object. 
  295.    --  Since: gtk+ 2.4 
  296.  
  297.    function Gtk_UI_Manager_New return Gtk_UI_Manager; 
  298.    --  Creates a new ui manager object. 
  299.    --  Since: gtk+ 2.4 
  300.  
  301.    function Get_Type return Glib.GType; 
  302.    pragma Import (C, Get_Type, "gtk_ui_manager_get_type"); 
  303.  
  304.    ------------- 
  305.    -- Methods -- 
  306.    ------------- 
  307.  
  308.    procedure Add_UI 
  309.       (Self     : not null access Gtk_UI_Manager_Record; 
  310.        Merge_Id : Guint; 
  311.        Path     : UTF8_String; 
  312.        Name     : UTF8_String; 
  313.        Action   : UTF8_String := ""; 
  314.        The_Type : Manager_Item_Type := Manager_Auto; 
  315.        Top      : Boolean := False); 
  316.    --  Adds a UI element to the current contents of Manager. 
  317.    --  If Type is Gtk.UI_Manager.Manager_Auto, GTK+ inserts a menuitem, 
  318.    --  toolitem or separator if such an element can be inserted at the place 
  319.    --  determined by Path. Otherwise Type must indicate an element that can be 
  320.    --  inserted at the place determined by Path. 
  321.    --  If Path points to a menuitem or toolitem, the new element will be 
  322.    --  inserted before or after this item, depending on Top. 
  323.    --  Since: gtk+ 2.4 
  324.    --  "merge_id": the merge id for the merged UI, see 
  325.    --  Gtk.UI_Manager.New_Merge_Id 
  326.    --  "path": a path 
  327.    --  "name": the name for the added UI element 
  328.    --  "action": the name of the action to be proxied, or null to add a 
  329.    --  separator 
  330.    --  "type": the type of UI element to add. 
  331.    --  "top": if True, the UI element is added before its siblings, otherwise 
  332.    --  it is added after its siblings. 
  333.  
  334.    function Add_UI_From_File 
  335.       (Self     : not null access Gtk_UI_Manager_Record; 
  336.        Filename : UTF8_String; 
  337.        Error    : access Glib.Error.GError) return Guint; 
  338.    --  Parses a file containing a <link linkend="XML-UI">UI definition</link> 
  339.    --  and merges it with the current contents of Manager. 
  340.    --  Since: gtk+ 2.4 
  341.    --  "filename": the name of the file to parse 
  342.  
  343.    function Add_UI_From_Resource 
  344.       (Self          : not null access Gtk_UI_Manager_Record; 
  345.        Resource_Path : UTF8_String; 
  346.        Error         : access Glib.Error.GError) return Guint; 
  347.    --  Parses a resource file containing a <link linkend="XML-UI">UI 
  348.    --  definition</link> and merges it with the current contents of Manager. 
  349.    --  Since: gtk+ 3.4 
  350.    --  "resource_path": the resource path of the file to parse 
  351.  
  352.    function Add_UI_From_String 
  353.       (Self   : not null access Gtk_UI_Manager_Record; 
  354.        Buffer : UTF8_String; 
  355.        Error  : access Glib.Error.GError) return Guint; 
  356.    --  Parses a string containing a <link linkend="XML-UI">UI 
  357.    --  definition</link> and merges it with the current contents of Manager. An 
  358.    --  enclosing <ui> element is added if it is missing. 
  359.    --  Since: gtk+ 2.4 
  360.    --  "buffer": the string to parse 
  361.  
  362.    procedure Ensure_Update (Self : not null access Gtk_UI_Manager_Record); 
  363.    --  Makes sure that all pending updates to the UI have been completed. 
  364.    --  This may occasionally be necessary, since Gtk.UI_Manager.Gtk_UI_Manager 
  365.    --  updates the UI in an idle function. A typical example where this 
  366.    --  function is useful is to enforce that the menubar and toolbar have been 
  367.    --  added to the main window before showing it: |[ gtk_container_add 
  368.    --  (GTK_CONTAINER (window), vbox); g_signal_connect (merge, "add-widget", 
  369.    --  G_CALLBACK (add_widget), vbox); gtk_ui_manager_add_ui_from_file (merge, 
  370.    --  "my-menus"); gtk_ui_manager_add_ui_from_file (merge, "my-toolbars"); 
  371.    --  gtk_ui_manager_ensure_update (merge); gtk_widget_show (window); ]| 
  372.    --  Since: gtk+ 2.4 
  373.  
  374.    function Get_Accel_Group 
  375.       (Self : not null access Gtk_UI_Manager_Record) 
  376.        return Gtk.Accel_Group.Gtk_Accel_Group; 
  377.    --  Returns the Gtk.Accel_Group.Gtk_Accel_Group associated with Manager. 
  378.    --  Since: gtk+ 2.4 
  379.  
  380.    function Get_Action 
  381.       (Self : not null access Gtk_UI_Manager_Record; 
  382.        Path : UTF8_String) return Gtk.Action.Gtk_Action; 
  383.    --  Looks up an action by following a path. See Gtk.UI_Manager.Get_Widget 
  384.    --  for more information about paths. 
  385.    --  Since: gtk+ 2.4 
  386.    --  "path": a path 
  387.  
  388.    function Get_Action_Groups 
  389.       (Self : not null access Gtk_UI_Manager_Record) 
  390.        return Glib.Object.Object_Simple_List.Glist; 
  391.    --  Returns the list of action groups associated with Manager. 
  392.    --  Since: gtk+ 2.4 
  393.  
  394.    function Get_Add_Tearoffs 
  395.       (Self : not null access Gtk_UI_Manager_Record) return Boolean; 
  396.    pragma Obsolescent (Get_Add_Tearoffs); 
  397.    --  Returns whether menus generated by this Gtk.UI_Manager.Gtk_UI_Manager 
  398.    --  will have tearoff menu items. 
  399.    --  Since: gtk+ 2.4 
  400.    --  Deprecated since 3.4, Tearoff menus are deprecated and should not be 
  401.    --  used in newly written code. 
  402.  
  403.    procedure Set_Add_Tearoffs 
  404.       (Self         : not null access Gtk_UI_Manager_Record; 
  405.        Add_Tearoffs : Boolean); 
  406.    pragma Obsolescent (Set_Add_Tearoffs); 
  407.    --  Sets the "add_tearoffs" property, which controls whether menus 
  408.    --  generated by this Gtk.UI_Manager.Gtk_UI_Manager will have tearoff menu 
  409.    --  items. 
  410.    --  Note that this only affects regular menus. Generated popup menus never 
  411.    --  have tearoff menu items. 
  412.    --  Since: gtk+ 2.4 
  413.    --  Deprecated since 3.4, Tearoff menus are deprecated and should not be 
  414.    --  used in newly written code. 
  415.    --  "add_tearoffs": whether tearoff menu items are added 
  416.  
  417.    function Get_Toplevels 
  418.       (Self  : not null access Gtk_UI_Manager_Record; 
  419.        Types : Manager_Item_Type) return Gtk.Widget.Widget_SList.GSlist; 
  420.    --  Obtains a list of all toplevel widgets of the requested types. 
  421.    --  Since: gtk+ 2.4 
  422.    --  "types": specifies the types of toplevel widgets to include. Allowed 
  423.    --  types are GTK_UI_MANAGER_MENUBAR, GTK_UI_MANAGER_TOOLBAR and 
  424.    --  GTK_UI_MANAGER_POPUP. 
  425.  
  426.    function Get_Ui 
  427.       (Self : not null access Gtk_UI_Manager_Record) return UTF8_String; 
  428.    --  Creates a <link linkend="XML-UI">UI definition</link> of the merged UI. 
  429.    --  Since: gtk+ 2.4 
  430.  
  431.    function Get_Widget 
  432.       (Self : not null access Gtk_UI_Manager_Record; 
  433.        Path : UTF8_String) return Gtk.Widget.Gtk_Widget; 
  434.    --  Looks up a widget by following a path. The path consists of the names 
  435.    --  specified in the XML description of the UI. separated by '/'. Elements 
  436.    --  which don't have a name or action attribute in the XML (e.g. <popup>) 
  437.    --  can be addressed by their XML element name (e.g. "popup"). The root 
  438.    --  element ("/ui") can be omitted in the path. 
  439.    --  Note that the widget found by following a path that ends in a <menu> 
  440.    --  element is the menuitem to which the menu is attached, not the menu 
  441.    --  itmanager. 
  442.    --  Also note that the widgets constructed by a ui manager are not tied to 
  443.    --  the lifecycle of the ui manager. If you add the widgets returned by this 
  444.    --  function to some container or explicitly ref them, they will survive the 
  445.    --  destruction of the ui manager. 
  446.    --  Since: gtk+ 2.4 
  447.    --  "path": a path 
  448.  
  449.    procedure Insert_Action_Group 
  450.       (Self         : not null access Gtk_UI_Manager_Record; 
  451.        Action_Group : not null access Gtk.Action_Group.Gtk_Action_Group_Record'Class; 
  452.        Pos          : Gint); 
  453.    --  Inserts an action group into the list of action groups associated with 
  454.    --  Manager. Actions in earlier groups hide actions with the same name in 
  455.    --  later groups. 
  456.    --  If Pos is larger than the number of action groups in Manager, or 
  457.    --  negative, Action_Group will be inserted at the end of the internal list. 
  458.    --  Since: gtk+ 2.4 
  459.    --  "action_group": the action group to be inserted 
  460.    --  "pos": the position at which the group will be inserted. 
  461.  
  462.    function New_Merge_Id 
  463.       (Self : not null access Gtk_UI_Manager_Record) return Guint; 
  464.    --  Returns an unused merge id, suitable for use with 
  465.    --  Gtk.UI_Manager.Add_UI. 
  466.    --  Since: gtk+ 2.4 
  467.  
  468.    procedure Remove_Action_Group 
  469.       (Self         : not null access Gtk_UI_Manager_Record; 
  470.        Action_Group : not null access Gtk.Action_Group.Gtk_Action_Group_Record'Class); 
  471.    --  Removes an action group from the list of action groups associated with 
  472.    --  Manager. 
  473.    --  Since: gtk+ 2.4 
  474.    --  "action_group": the action group to be removed 
  475.  
  476.    procedure Remove_UI 
  477.       (Self     : not null access Gtk_UI_Manager_Record; 
  478.        Merge_Id : Guint); 
  479.    --  Unmerges the part of Manager<!-- -->s content identified by Merge_Id. 
  480.    --  Since: gtk+ 2.4 
  481.    --  "merge_id": a merge id as returned by Gtk.UI_Manager.Add_UI_From_String 
  482.  
  483.    ---------------- 
  484.    -- Properties -- 
  485.    ---------------- 
  486.    --  The following properties are defined for this widget. See 
  487.    --  Glib.Properties for more information on properties) 
  488.  
  489.    Add_Tearoffs_Property : constant Glib.Properties.Property_Boolean; 
  490.    --  The "add-tearoffs" property controls whether generated menus have 
  491.    --  tearoff menu items. 
  492.    -- 
  493.    --  Note that this only affects regular menus. Generated popup menus never 
  494.    --  have tearoff menu items. 
  495.  
  496.    Ui_Property : constant Glib.Properties.Property_String; 
  497.  
  498.    ------------- 
  499.    -- Signals -- 
  500.    ------------- 
  501.  
  502.    type Cb_Gtk_UI_Manager_Void is not null access procedure (Self : access Gtk_UI_Manager_Record'Class); 
  503.  
  504.    type Cb_GObject_Void is not null access procedure 
  505.      (Self : access Glib.Object.GObject_Record'Class); 
  506.  
  507.    Signal_Actions_Changed : constant Glib.Signal_Name := "actions-changed"; 
  508.    procedure On_Actions_Changed 
  509.       (Self  : not null access Gtk_UI_Manager_Record; 
  510.        Call  : Cb_Gtk_UI_Manager_Void; 
  511.        After : Boolean := False); 
  512.    procedure On_Actions_Changed 
  513.       (Self  : not null access Gtk_UI_Manager_Record; 
  514.        Call  : Cb_GObject_Void; 
  515.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  516.        After : Boolean := False); 
  517.    --  The ::actions-changed signal is emitted whenever the set of actions 
  518.    --  changes. 
  519.  
  520.    type Cb_Gtk_UI_Manager_Gtk_Widget_Void is not null access procedure 
  521.      (Self   : access Gtk_UI_Manager_Record'Class; 
  522.       Widget : not null access Gtk.Widget.Gtk_Widget_Record'Class); 
  523.  
  524.    type Cb_GObject_Gtk_Widget_Void is not null access procedure 
  525.      (Self   : access Glib.Object.GObject_Record'Class; 
  526.       Widget : not null access Gtk.Widget.Gtk_Widget_Record'Class); 
  527.  
  528.    Signal_Add_Widget : constant Glib.Signal_Name := "add-widget"; 
  529.    procedure On_Add_Widget 
  530.       (Self  : not null access Gtk_UI_Manager_Record; 
  531.        Call  : Cb_Gtk_UI_Manager_Gtk_Widget_Void; 
  532.        After : Boolean := False); 
  533.    procedure On_Add_Widget 
  534.       (Self  : not null access Gtk_UI_Manager_Record; 
  535.        Call  : Cb_GObject_Gtk_Widget_Void; 
  536.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  537.        After : Boolean := False); 
  538.    --  The ::add-widget signal is emitted for each generated menubar and 
  539.    --  toolbar. It is not emitted for generated popup menus, which can be 
  540.    --  obtained by Gtk.UI_Manager.Get_Widget. 
  541.  
  542.    type Cb_Gtk_UI_Manager_Gtk_Action_Gtk_Widget_Void is not null access procedure 
  543.      (Self   : access Gtk_UI_Manager_Record'Class; 
  544.       Action : not null access Gtk.Action.Gtk_Action_Record'Class; 
  545.       Proxy  : not null access Gtk.Widget.Gtk_Widget_Record'Class); 
  546.  
  547.    type Cb_GObject_Gtk_Action_Gtk_Widget_Void is not null access procedure 
  548.      (Self   : access Glib.Object.GObject_Record'Class; 
  549.       Action : not null access Gtk.Action.Gtk_Action_Record'Class; 
  550.       Proxy  : not null access Gtk.Widget.Gtk_Widget_Record'Class); 
  551.  
  552.    Signal_Connect_Proxy : constant Glib.Signal_Name := "connect-proxy"; 
  553.    procedure On_Connect_Proxy 
  554.       (Self  : not null access Gtk_UI_Manager_Record; 
  555.        Call  : Cb_Gtk_UI_Manager_Gtk_Action_Gtk_Widget_Void; 
  556.        After : Boolean := False); 
  557.    procedure On_Connect_Proxy 
  558.       (Self  : not null access Gtk_UI_Manager_Record; 
  559.        Call  : Cb_GObject_Gtk_Action_Gtk_Widget_Void; 
  560.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  561.        After : Boolean := False); 
  562.    --  The ::connect-proxy signal is emitted after connecting a proxy to an 
  563.    --  action in the group. 
  564.    -- 
  565.    --  This is intended for simple customizations for which a custom action 
  566.    --  class would be too clumsy, e.g. showing tooltips for menuitems in the 
  567.    --  statusbar. 
  568.    --  
  569.    --  Callback parameters: 
  570.    --    --  "action": the action 
  571.    --    --  "proxy": the proxy 
  572.  
  573.    Signal_Disconnect_Proxy : constant Glib.Signal_Name := "disconnect-proxy"; 
  574.    procedure On_Disconnect_Proxy 
  575.       (Self  : not null access Gtk_UI_Manager_Record; 
  576.        Call  : Cb_Gtk_UI_Manager_Gtk_Action_Gtk_Widget_Void; 
  577.        After : Boolean := False); 
  578.    procedure On_Disconnect_Proxy 
  579.       (Self  : not null access Gtk_UI_Manager_Record; 
  580.        Call  : Cb_GObject_Gtk_Action_Gtk_Widget_Void; 
  581.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  582.        After : Boolean := False); 
  583.    --  The ::disconnect-proxy signal is emitted after disconnecting a proxy 
  584.    --  from an action in the group. 
  585.    --  
  586.    --  Callback parameters: 
  587.    --    --  "action": the action 
  588.    --    --  "proxy": the proxy 
  589.  
  590.    type Cb_Gtk_UI_Manager_Gtk_Action_Void is not null access procedure 
  591.      (Self   : access Gtk_UI_Manager_Record'Class; 
  592.       Action : not null access Gtk.Action.Gtk_Action_Record'Class); 
  593.  
  594.    type Cb_GObject_Gtk_Action_Void is not null access procedure 
  595.      (Self   : access Glib.Object.GObject_Record'Class; 
  596.       Action : not null access Gtk.Action.Gtk_Action_Record'Class); 
  597.  
  598.    Signal_Post_Activate : constant Glib.Signal_Name := "post-activate"; 
  599.    procedure On_Post_Activate 
  600.       (Self  : not null access Gtk_UI_Manager_Record; 
  601.        Call  : Cb_Gtk_UI_Manager_Gtk_Action_Void; 
  602.        After : Boolean := False); 
  603.    procedure On_Post_Activate 
  604.       (Self  : not null access Gtk_UI_Manager_Record; 
  605.        Call  : Cb_GObject_Gtk_Action_Void; 
  606.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  607.        After : Boolean := False); 
  608.    --  The ::post-activate signal is emitted just after the Action is 
  609.    --  activated. 
  610.    -- 
  611.    --  This is intended for applications to get notification just after any 
  612.    --  action is activated. 
  613.  
  614.    Signal_Pre_Activate : constant Glib.Signal_Name := "pre-activate"; 
  615.    procedure On_Pre_Activate 
  616.       (Self  : not null access Gtk_UI_Manager_Record; 
  617.        Call  : Cb_Gtk_UI_Manager_Gtk_Action_Void; 
  618.        After : Boolean := False); 
  619.    procedure On_Pre_Activate 
  620.       (Self  : not null access Gtk_UI_Manager_Record; 
  621.        Call  : Cb_GObject_Gtk_Action_Void; 
  622.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  623.        After : Boolean := False); 
  624.    --  The ::pre-activate signal is emitted just before the Action is 
  625.    --  activated. 
  626.    -- 
  627.    --  This is intended for applications to get notification just before any 
  628.    --  action is activated. 
  629.  
  630.    ---------------- 
  631.    -- Interfaces -- 
  632.    ---------------- 
  633.    --  This class implements several interfaces. See Glib.Types 
  634.    -- 
  635.    --  - "Buildable" 
  636.  
  637.    package Implements_Gtk_Buildable is new Glib.Types.Implements 
  638.      (Gtk.Buildable.Gtk_Buildable, Gtk_UI_Manager_Record, Gtk_UI_Manager); 
  639.    function "+" 
  640.      (Widget : access Gtk_UI_Manager_Record'Class) 
  641.    return Gtk.Buildable.Gtk_Buildable 
  642.    renames Implements_Gtk_Buildable.To_Interface; 
  643.    function "-" 
  644.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  645.    return Gtk_UI_Manager 
  646.    renames Implements_Gtk_Buildable.To_Object; 
  647.  
  648. private 
  649.    Ui_Property : constant Glib.Properties.Property_String := 
  650.      Glib.Properties.Build ("ui"); 
  651.    Add_Tearoffs_Property : constant Glib.Properties.Property_Boolean := 
  652.      Glib.Properties.Build ("add-tearoffs"); 
  653. end Gtk.UI_Manager;