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. --  Glib.Menu.Gmenu is a simple implementation of Glib.Menu_Model.Gmenu_Model. 
  26. --  You populate a Glib.Menu.Gmenu by adding Glib.Menu.Gmenu_Item instances to 
  27. --  it. 
  28. -- 
  29. --  There are some convenience functions to allow you to directly add items 
  30. --  (avoiding Glib.Menu.Gmenu_Item) for the common cases. To add a regular 
  31. --  item, use Glib.Menu.Insert. To add a section, use Glib.Menu.Insert_Section. 
  32. --  To add a submenu, use Glib.Menu.Insert_Submenu. 
  33. -- 
  34. --  </description> 
  35. pragma Ada_2005; 
  36.  
  37. pragma Warnings (Off, "*is already use-visible*"); 
  38. with Glib;            use Glib; 
  39. with Glib.Menu_Model; use Glib.Menu_Model; 
  40. with Glib.Object;     use Glib.Object; 
  41. with Glib.Variant;    use Glib.Variant; 
  42.  
  43. package Glib.Menu is 
  44.  
  45.    type Gmenu_Record is new Gmenu_Model_Record with null record; 
  46.    type Gmenu is access all Gmenu_Record'Class; 
  47.  
  48.    type Gmenu_Item_Record is new GObject_Record with null record; 
  49.    type Gmenu_Item is access all Gmenu_Item_Record'Class; 
  50.  
  51.    ------------------ 
  52.    -- Constructors -- 
  53.    ------------------ 
  54.  
  55.    procedure G_New (Self : out Gmenu); 
  56.    --  Creates a new Glib.Menu.Gmenu. 
  57.    --  The new menu has no items. 
  58.    --  Since: gtk+ 2.32 
  59.  
  60.    procedure Initialize (Self : not null access Gmenu_Record'Class); 
  61.    --  Creates a new Glib.Menu.Gmenu. 
  62.    --  The new menu has no items. 
  63.    --  Since: gtk+ 2.32 
  64.  
  65.    function Gmenu_New return Gmenu; 
  66.    --  Creates a new Glib.Menu.Gmenu. 
  67.    --  The new menu has no items. 
  68.    --  Since: gtk+ 2.32 
  69.  
  70.    function Get_Type_Menu return Glib.GType; 
  71.    pragma Import (C, Get_Type_Menu, "g_menu_get_type"); 
  72.  
  73.    procedure G_New 
  74.       (Self            : out Gmenu_Item; 
  75.        Label           : UTF8_String := ""; 
  76.        Detailed_Action : UTF8_String := ""); 
  77.    --  Creates a new Glib.Menu.Gmenu_Item. 
  78.    --  If Label is non-null it is used to set the "label" attribute of the new 
  79.    --  item. 
  80.    --  If Detailed_Action is non-null it is used to set the "action" and 
  81.    --  possibly the "target" attribute of the new item. See 
  82.    --  Glib.Menu.Set_Detailed_Action for more information. 
  83.    --  Since: gtk+ 2.32 
  84.    --  "label": the section label, or null 
  85.    --  "detailed_action": the detailed action string, or null 
  86.  
  87.    procedure Initialize 
  88.       (Self            : not null access Gmenu_Item_Record'Class; 
  89.        Label           : UTF8_String := ""; 
  90.        Detailed_Action : UTF8_String := ""); 
  91.    --  Creates a new Glib.Menu.Gmenu_Item. 
  92.    --  If Label is non-null it is used to set the "label" attribute of the new 
  93.    --  item. 
  94.    --  If Detailed_Action is non-null it is used to set the "action" and 
  95.    --  possibly the "target" attribute of the new item. See 
  96.    --  Glib.Menu.Set_Detailed_Action for more information. 
  97.    --  Since: gtk+ 2.32 
  98.    --  "label": the section label, or null 
  99.    --  "detailed_action": the detailed action string, or null 
  100.  
  101.    function Gmenu_Item_New 
  102.       (Label           : UTF8_String := ""; 
  103.        Detailed_Action : UTF8_String := "") return Gmenu_Item; 
  104.    --  Creates a new Glib.Menu.Gmenu_Item. 
  105.    --  If Label is non-null it is used to set the "label" attribute of the new 
  106.    --  item. 
  107.    --  If Detailed_Action is non-null it is used to set the "action" and 
  108.    --  possibly the "target" attribute of the new item. See 
  109.    --  Glib.Menu.Set_Detailed_Action for more information. 
  110.    --  Since: gtk+ 2.32 
  111.    --  "label": the section label, or null 
  112.    --  "detailed_action": the detailed action string, or null 
  113.  
  114.    procedure G_New_From_Model 
  115.       (Self       : out Gmenu_Item; 
  116.        Model      : not null access Glib.Menu_Model.Gmenu_Model_Record'Class; 
  117.        Item_Index : Gint); 
  118.    --  Creates a Glib.Menu.Gmenu_Item as an exact copy of an existing menu 
  119.    --  item in a Glib.Menu_Model.Gmenu_Model. 
  120.    --  Item_Index must be valid (ie: be sure to call 
  121.    --  Glib.Menu_Model.Get_N_Items first). 
  122.    --  Since: gtk+ 2.34 
  123.    --  "model": a Glib.Menu_Model.Gmenu_Model 
  124.    --  "item_index": the index of an item in Model 
  125.  
  126.    procedure Initialize_From_Model 
  127.       (Self       : not null access Gmenu_Item_Record'Class; 
  128.        Model      : not null access Glib.Menu_Model.Gmenu_Model_Record'Class; 
  129.        Item_Index : Gint); 
  130.    --  Creates a Glib.Menu.Gmenu_Item as an exact copy of an existing menu 
  131.    --  item in a Glib.Menu_Model.Gmenu_Model. 
  132.    --  Item_Index must be valid (ie: be sure to call 
  133.    --  Glib.Menu_Model.Get_N_Items first). 
  134.    --  Since: gtk+ 2.34 
  135.    --  "model": a Glib.Menu_Model.Gmenu_Model 
  136.    --  "item_index": the index of an item in Model 
  137.  
  138.    function Gmenu_Item_New_From_Model 
  139.       (Model      : not null access Glib.Menu_Model.Gmenu_Model_Record'Class; 
  140.        Item_Index : Gint) return Gmenu_Item; 
  141.    --  Creates a Glib.Menu.Gmenu_Item as an exact copy of an existing menu 
  142.    --  item in a Glib.Menu_Model.Gmenu_Model. 
  143.    --  Item_Index must be valid (ie: be sure to call 
  144.    --  Glib.Menu_Model.Get_N_Items first). 
  145.    --  Since: gtk+ 2.34 
  146.    --  "model": a Glib.Menu_Model.Gmenu_Model 
  147.    --  "item_index": the index of an item in Model 
  148.  
  149.    procedure G_New_Section 
  150.       (Self    : out Gmenu_Item; 
  151.        Label   : UTF8_String := ""; 
  152.        Section : not null access Glib.Menu_Model.Gmenu_Model_Record'Class); 
  153.    --  Creates a new Glib.Menu.Gmenu_Item representing a section. 
  154.    --  This is a convenience API around Glib.Menu.G_New and 
  155.    --  Glib.Menu.Set_Section. 
  156.    --  The effect of having one menu appear as a section of another is exactly 
  157.    --  as it sounds: the items from Section become a direct part of the menu 
  158.    --  that Menu_Item is added to. 
  159.    --  Visual separation is typically displayed between two non-empty 
  160.    --  sections. If Label is non-null then it will be encorporated into this 
  161.    --  visual indication. This allows for labeled subsections of a menu. 
  162.    --  As a simple example, consider a typical "Edit" menu from a simple 
  163.    --  program. It probably contains an "Undo" and "Redo" item, followed by a 
  164.    --  separator, followed by "Cut", "Copy" and "Paste". 
  165.    --  This would be accomplished by creating three Glib.Menu.Gmenu instances. 
  166.    --  The first would be populated with the "Undo" and "Redo" items, and the 
  167.    --  second with the "Cut", "Copy" and "Paste" items. The first and second 
  168.    --  menus would then be added as submenus of the third. In XML format, this 
  169.    --  would look something like the following: 
  170.    --    <menu id='edit-menu'> 
  171.    --    <section> 
  172.    --    <item label='Undo'/> 
  173.    --    <item label='Redo'/> 
  174.    --    </section> 
  175.    --    <section> 
  176.    --    <item label='Cut'/> 
  177.    --    <item label='Copy'/> 
  178.    --    <item label='Paste'/> 
  179.    --    </section> 
  180.    --    </menu> 
  181.    --  The following example is exactly equivalent. It is more illustrative of 
  182.    --  the exact relationship between the menus and items (keeping in mind that 
  183.    --  the 'link' element defines a new menu that is linked to the containing 
  184.    --  one). The style of the second example is more verbose and difficult to 
  185.    --  read (and therefore not recommended except for the purpose of 
  186.    --  understanding what is really going on). 
  187.    --    <menu id='edit-menu'> 
  188.    --    <item> 
  189.    --    <link name='section'> 
  190.    --    <item label='Undo'/> 
  191.    --    <item label='Redo'/> 
  192.    --    </link> 
  193.    --    </item> 
  194.    --    <item> 
  195.    --    <link name='section'> 
  196.    --    <item label='Cut'/> 
  197.    --    <item label='Copy'/> 
  198.    --    <item label='Paste'/> 
  199.    --    </link> 
  200.    --    </item> 
  201.    --    </menu> 
  202.    --  Since: gtk+ 2.32 
  203.    --  "label": the section label, or null 
  204.    --  "section": a Glib.Menu_Model.Gmenu_Model with the items of the section 
  205.  
  206.    procedure Initialize_Section 
  207.       (Self    : not null access Gmenu_Item_Record'Class; 
  208.        Label   : UTF8_String := ""; 
  209.        Section : not null access Glib.Menu_Model.Gmenu_Model_Record'Class); 
  210.    --  Creates a new Glib.Menu.Gmenu_Item representing a section. 
  211.    --  This is a convenience API around Glib.Menu.G_New and 
  212.    --  Glib.Menu.Set_Section. 
  213.    --  The effect of having one menu appear as a section of another is exactly 
  214.    --  as it sounds: the items from Section become a direct part of the menu 
  215.    --  that Menu_Item is added to. 
  216.    --  Visual separation is typically displayed between two non-empty 
  217.    --  sections. If Label is non-null then it will be encorporated into this 
  218.    --  visual indication. This allows for labeled subsections of a menu. 
  219.    --  As a simple example, consider a typical "Edit" menu from a simple 
  220.    --  program. It probably contains an "Undo" and "Redo" item, followed by a 
  221.    --  separator, followed by "Cut", "Copy" and "Paste". 
  222.    --  This would be accomplished by creating three Glib.Menu.Gmenu instances. 
  223.    --  The first would be populated with the "Undo" and "Redo" items, and the 
  224.    --  second with the "Cut", "Copy" and "Paste" items. The first and second 
  225.    --  menus would then be added as submenus of the third. In XML format, this 
  226.    --  would look something like the following: 
  227.    --    <menu id='edit-menu'> 
  228.    --    <section> 
  229.    --    <item label='Undo'/> 
  230.    --    <item label='Redo'/> 
  231.    --    </section> 
  232.    --    <section> 
  233.    --    <item label='Cut'/> 
  234.    --    <item label='Copy'/> 
  235.    --    <item label='Paste'/> 
  236.    --    </section> 
  237.    --    </menu> 
  238.    --  The following example is exactly equivalent. It is more illustrative of 
  239.    --  the exact relationship between the menus and items (keeping in mind that 
  240.    --  the 'link' element defines a new menu that is linked to the containing 
  241.    --  one). The style of the second example is more verbose and difficult to 
  242.    --  read (and therefore not recommended except for the purpose of 
  243.    --  understanding what is really going on). 
  244.    --    <menu id='edit-menu'> 
  245.    --    <item> 
  246.    --    <link name='section'> 
  247.    --    <item label='Undo'/> 
  248.    --    <item label='Redo'/> 
  249.    --    </link> 
  250.    --    </item> 
  251.    --    <item> 
  252.    --    <link name='section'> 
  253.    --    <item label='Cut'/> 
  254.    --    <item label='Copy'/> 
  255.    --    <item label='Paste'/> 
  256.    --    </link> 
  257.    --    </item> 
  258.    --    </menu> 
  259.    --  Since: gtk+ 2.32 
  260.    --  "label": the section label, or null 
  261.    --  "section": a Glib.Menu_Model.Gmenu_Model with the items of the section 
  262.  
  263.    function Gmenu_Item_New_Section 
  264.       (Label   : UTF8_String := ""; 
  265.        Section : not null access Glib.Menu_Model.Gmenu_Model_Record'Class) 
  266.        return Gmenu_Item; 
  267.    --  Creates a new Glib.Menu.Gmenu_Item representing a section. 
  268.    --  This is a convenience API around Glib.Menu.G_New and 
  269.    --  Glib.Menu.Set_Section. 
  270.    --  The effect of having one menu appear as a section of another is exactly 
  271.    --  as it sounds: the items from Section become a direct part of the menu 
  272.    --  that Menu_Item is added to. 
  273.    --  Visual separation is typically displayed between two non-empty 
  274.    --  sections. If Label is non-null then it will be encorporated into this 
  275.    --  visual indication. This allows for labeled subsections of a menu. 
  276.    --  As a simple example, consider a typical "Edit" menu from a simple 
  277.    --  program. It probably contains an "Undo" and "Redo" item, followed by a 
  278.    --  separator, followed by "Cut", "Copy" and "Paste". 
  279.    --  This would be accomplished by creating three Glib.Menu.Gmenu instances. 
  280.    --  The first would be populated with the "Undo" and "Redo" items, and the 
  281.    --  second with the "Cut", "Copy" and "Paste" items. The first and second 
  282.    --  menus would then be added as submenus of the third. In XML format, this 
  283.    --  would look something like the following: 
  284.    --    <menu id='edit-menu'> 
  285.    --    <section> 
  286.    --    <item label='Undo'/> 
  287.    --    <item label='Redo'/> 
  288.    --    </section> 
  289.    --    <section> 
  290.    --    <item label='Cut'/> 
  291.    --    <item label='Copy'/> 
  292.    --    <item label='Paste'/> 
  293.    --    </section> 
  294.    --    </menu> 
  295.    --  The following example is exactly equivalent. It is more illustrative of 
  296.    --  the exact relationship between the menus and items (keeping in mind that 
  297.    --  the 'link' element defines a new menu that is linked to the containing 
  298.    --  one). The style of the second example is more verbose and difficult to 
  299.    --  read (and therefore not recommended except for the purpose of 
  300.    --  understanding what is really going on). 
  301.    --    <menu id='edit-menu'> 
  302.    --    <item> 
  303.    --    <link name='section'> 
  304.    --    <item label='Undo'/> 
  305.    --    <item label='Redo'/> 
  306.    --    </link> 
  307.    --    </item> 
  308.    --    <item> 
  309.    --    <link name='section'> 
  310.    --    <item label='Cut'/> 
  311.    --    <item label='Copy'/> 
  312.    --    <item label='Paste'/> 
  313.    --    </link> 
  314.    --    </item> 
  315.    --    </menu> 
  316.    --  Since: gtk+ 2.32 
  317.    --  "label": the section label, or null 
  318.    --  "section": a Glib.Menu_Model.Gmenu_Model with the items of the section 
  319.  
  320.    procedure G_New_Submenu 
  321.       (Self    : out Gmenu_Item; 
  322.        Label   : UTF8_String := ""; 
  323.        Submenu : not null access Glib.Menu_Model.Gmenu_Model_Record'Class); 
  324.    --  Creates a new Glib.Menu.Gmenu_Item representing a submenu. 
  325.    --  This is a convenience API around Glib.Menu.G_New and 
  326.    --  Glib.Menu.Set_Submenu. 
  327.    --  Since: gtk+ 2.32 
  328.    --  "label": the section label, or null 
  329.    --  "submenu": a Glib.Menu_Model.Gmenu_Model with the items of the submenu 
  330.  
  331.    procedure Initialize_Submenu 
  332.       (Self    : not null access Gmenu_Item_Record'Class; 
  333.        Label   : UTF8_String := ""; 
  334.        Submenu : not null access Glib.Menu_Model.Gmenu_Model_Record'Class); 
  335.    --  Creates a new Glib.Menu.Gmenu_Item representing a submenu. 
  336.    --  This is a convenience API around Glib.Menu.G_New and 
  337.    --  Glib.Menu.Set_Submenu. 
  338.    --  Since: gtk+ 2.32 
  339.    --  "label": the section label, or null 
  340.    --  "submenu": a Glib.Menu_Model.Gmenu_Model with the items of the submenu 
  341.  
  342.    function Gmenu_Item_New_Submenu 
  343.       (Label   : UTF8_String := ""; 
  344.        Submenu : not null access Glib.Menu_Model.Gmenu_Model_Record'Class) 
  345.        return Gmenu_Item; 
  346.    --  Creates a new Glib.Menu.Gmenu_Item representing a submenu. 
  347.    --  This is a convenience API around Glib.Menu.G_New and 
  348.    --  Glib.Menu.Set_Submenu. 
  349.    --  Since: gtk+ 2.32 
  350.    --  "label": the section label, or null 
  351.    --  "submenu": a Glib.Menu_Model.Gmenu_Model with the items of the submenu 
  352.  
  353.    function Get_Type_Menu_Item return Glib.GType; 
  354.    pragma Import (C, Get_Type_Menu_Item, "g_menu_item_get_type"); 
  355.  
  356.    ------------- 
  357.    -- Methods -- 
  358.    ------------- 
  359.  
  360.    procedure Append 
  361.       (Self            : not null access Gmenu_Record; 
  362.        Label           : UTF8_String := ""; 
  363.        Detailed_Action : UTF8_String := ""); 
  364.    --  Convenience function for appending a normal menu item to the end of 
  365.    --  Menu. Combine Glib.Menu.G_New and Glib.Menu.Insert_Item for a more 
  366.    --  flexible alternative. 
  367.    --  Since: gtk+ 2.32 
  368.    --  "label": the section label, or null 
  369.    --  "detailed_action": the detailed action string, or null 
  370.  
  371.    procedure Append_Item 
  372.       (Self : not null access Gmenu_Record; 
  373.        Item : not null access Gmenu_Item_Record'Class); 
  374.    --  Appends Item to the end of Menu. 
  375.    --  See Glib.Menu.Insert_Item for more information. 
  376.    --  Since: gtk+ 2.32 
  377.    --  "item": a Glib.Menu.Gmenu_Item to append 
  378.  
  379.    procedure Append_Section 
  380.       (Self    : not null access Gmenu_Record; 
  381.        Label   : UTF8_String := ""; 
  382.        Section : not null access Glib.Menu_Model.Gmenu_Model_Record'Class); 
  383.    --  Convenience function for appending a section menu item to the end of 
  384.    --  Menu. Combine Glib.Menu.G_New_Section and Glib.Menu.Insert_Item for a 
  385.    --  more flexible alternative. 
  386.    --  Since: gtk+ 2.32 
  387.    --  "label": the section label, or null 
  388.    --  "section": a Glib.Menu_Model.Gmenu_Model with the items of the section 
  389.  
  390.    procedure Append_Submenu 
  391.       (Self    : not null access Gmenu_Record; 
  392.        Label   : UTF8_String := ""; 
  393.        Submenu : not null access Glib.Menu_Model.Gmenu_Model_Record'Class); 
  394.    --  Convenience function for appending a submenu menu item to the end of 
  395.    --  Menu. Combine Glib.Menu.G_New_Submenu and Glib.Menu.Insert_Item for a 
  396.    --  more flexible alternative. 
  397.    --  Since: gtk+ 2.32 
  398.    --  "label": the section label, or null 
  399.    --  "submenu": a Glib.Menu_Model.Gmenu_Model with the items of the submenu 
  400.  
  401.    procedure Freeze (Self : not null access Gmenu_Record); 
  402.    --  Marks Menu as frozen. 
  403.    --  After the menu is frozen, it is an error to attempt to make any changes 
  404.    --  to it. In effect this means that the Glib.Menu.Gmenu API must no longer 
  405.    --  be used. 
  406.    --  This function causes Glib.Menu_Model.Is_Mutable to begin returning 
  407.    --  False, which has some positive performance implications. 
  408.    --  Since: gtk+ 2.32 
  409.  
  410.    procedure Insert 
  411.       (Self            : not null access Gmenu_Record; 
  412.        Position        : Gint; 
  413.        Label           : UTF8_String := ""; 
  414.        Detailed_Action : UTF8_String := ""); 
  415.    --  Convenience function for inserting a normal menu item into Menu. 
  416.    --  Combine Glib.Menu.G_New and Glib.Menu.Insert_Item for a more flexible 
  417.    --  alternative. 
  418.    --  Since: gtk+ 2.32 
  419.    --  "position": the position at which to insert the item 
  420.    --  "label": the section label, or null 
  421.    --  "detailed_action": the detailed action string, or null 
  422.  
  423.    procedure Insert_Item 
  424.       (Self     : not null access Gmenu_Record; 
  425.        Position : Gint; 
  426.        Item     : not null access Gmenu_Item_Record'Class); 
  427.    --  Inserts Item into Menu. 
  428.    --  The "insertion" is actually done by copying all of the attribute and 
  429.    --  link values of Item and using them to form a new item within Menu. As 
  430.    --  such, Item itself is not really inserted, but rather, a menu item that 
  431.    --  is exactly the same as the one presently described by Item. 
  432.    --  This means that Item is essentially useless after the insertion occurs. 
  433.    --  Any changes you make to it are ignored unless it is inserted again (at 
  434.    --  which point its updated values will be copied). 
  435.    --  You should probably just free Item once you're done. 
  436.    --  There are many convenience functions to take care of common cases. See 
  437.    --  Glib.Menu.Insert, Glib.Menu.Insert_Section and Glib.Menu.Insert_Submenu 
  438.    --  as well as "prepend" and "append" variants of each of these functions. 
  439.    --  Since: gtk+ 2.32 
  440.    --  "position": the position at which to insert the item 
  441.    --  "item": the Glib.Menu.Gmenu_Item to insert 
  442.  
  443.    procedure Insert_Section 
  444.       (Self     : not null access Gmenu_Record; 
  445.        Position : Gint; 
  446.        Label    : UTF8_String := ""; 
  447.        Section  : not null access Glib.Menu_Model.Gmenu_Model_Record'Class); 
  448.    --  Convenience function for inserting a section menu item into Menu. 
  449.    --  Combine Glib.Menu.G_New_Section and Glib.Menu.Insert_Item for a more 
  450.    --  flexible alternative. 
  451.    --  Since: gtk+ 2.32 
  452.    --  "position": the position at which to insert the item 
  453.    --  "label": the section label, or null 
  454.    --  "section": a Glib.Menu_Model.Gmenu_Model with the items of the section 
  455.  
  456.    procedure Insert_Submenu 
  457.       (Self     : not null access Gmenu_Record; 
  458.        Position : Gint; 
  459.        Label    : UTF8_String := ""; 
  460.        Submenu  : not null access Glib.Menu_Model.Gmenu_Model_Record'Class); 
  461.    --  Convenience function for inserting a submenu menu item into Menu. 
  462.    --  Combine Glib.Menu.G_New_Submenu and Glib.Menu.Insert_Item for a more 
  463.    --  flexible alternative. 
  464.    --  Since: gtk+ 2.32 
  465.    --  "position": the position at which to insert the item 
  466.    --  "label": the section label, or null 
  467.    --  "submenu": a Glib.Menu_Model.Gmenu_Model with the items of the submenu 
  468.  
  469.    procedure Prepend 
  470.       (Self            : not null access Gmenu_Record; 
  471.        Label           : UTF8_String := ""; 
  472.        Detailed_Action : UTF8_String := ""); 
  473.    --  Convenience function for prepending a normal menu item to the start of 
  474.    --  Menu. Combine Glib.Menu.G_New and Glib.Menu.Insert_Item for a more 
  475.    --  flexible alternative. 
  476.    --  Since: gtk+ 2.32 
  477.    --  "label": the section label, or null 
  478.    --  "detailed_action": the detailed action string, or null 
  479.  
  480.    procedure Prepend_Item 
  481.       (Self : not null access Gmenu_Record; 
  482.        Item : not null access Gmenu_Item_Record'Class); 
  483.    --  Prepends Item to the start of Menu. 
  484.    --  See Glib.Menu.Insert_Item for more information. 
  485.    --  Since: gtk+ 2.32 
  486.    --  "item": a Glib.Menu.Gmenu_Item to prepend 
  487.  
  488.    procedure Prepend_Section 
  489.       (Self    : not null access Gmenu_Record; 
  490.        Label   : UTF8_String := ""; 
  491.        Section : not null access Glib.Menu_Model.Gmenu_Model_Record'Class); 
  492.    --  Convenience function for prepending a section menu item to the start of 
  493.    --  Menu. Combine Glib.Menu.G_New_Section and Glib.Menu.Insert_Item for a 
  494.    --  more flexible alternative. 
  495.    --  Since: gtk+ 2.32 
  496.    --  "label": the section label, or null 
  497.    --  "section": a Glib.Menu_Model.Gmenu_Model with the items of the section 
  498.  
  499.    procedure Prepend_Submenu 
  500.       (Self    : not null access Gmenu_Record; 
  501.        Label   : UTF8_String := ""; 
  502.        Submenu : not null access Glib.Menu_Model.Gmenu_Model_Record'Class); 
  503.    --  Convenience function for prepending a submenu menu item to the start of 
  504.    --  Menu. Combine Glib.Menu.G_New_Submenu and Glib.Menu.Insert_Item for a 
  505.    --  more flexible alternative. 
  506.    --  Since: gtk+ 2.32 
  507.    --  "label": the section label, or null 
  508.    --  "submenu": a Glib.Menu_Model.Gmenu_Model with the items of the submenu 
  509.  
  510.    procedure Remove (Self : not null access Gmenu_Record; Position : Gint); 
  511.    --  Removes an item from the menu. 
  512.    --  Position gives the index of the item to remove. 
  513.    --  It is an error if position is not in range the range from 0 to one less 
  514.    --  than the number of items in the menu. 
  515.    --  It is not possible to remove items by identity since items are added to 
  516.    --  the menu simply by copying their links and attributes (ie: identity of 
  517.    --  the item itself is not preserved). 
  518.    --  Since: gtk+ 2.32 
  519.    --  "position": the position of the item to remove 
  520.  
  521.    function Get_Attribute_Value 
  522.       (Self          : not null access Gmenu_Item_Record; 
  523.        Attribute     : UTF8_String; 
  524.        Expected_Type : Glib.Variant.Gvariant_Type) 
  525.        return Glib.Variant.Gvariant; 
  526.    --  Queries the named Attribute on Menu_Item. 
  527.    --  If Expected_Type is specified and the attribute does not have this 
  528.    --  type, null is returned. null is also returned if the attribute simply 
  529.    --  does not exist. 
  530.    --  Since: gtk+ 2.34 
  531.    --  "attribute": the attribute name to query 
  532.    --  "expected_type": the expected type of the attribute 
  533.  
  534.    procedure Set_Attribute_Value 
  535.       (Self      : not null access Gmenu_Item_Record; 
  536.        Attribute : UTF8_String; 
  537.        Value     : Glib.Variant.Gvariant); 
  538.    --  Sets or unsets an attribute on Menu_Item. 
  539.    --  The attribute to set or unset is specified by Attribute. This can be 
  540.    --  one of the standard attribute names G_MENU_ATTRIBUTE_LABEL, 
  541.    --  G_MENU_ATTRIBUTE_ACTION, G_MENU_ATTRIBUTE_TARGET, or a custom attribute 
  542.    --  name. Attribute names are restricted to lowercase characters, numbers 
  543.    --  and '-'. Furthermore, the names must begin with a lowercase character, 
  544.    --  must not end with a '-', and must not contain consecutive dashes. 
  545.    --  must consist only of lowercase ASCII characters, digits and '-'. 
  546.    --  If Value is non-null then it is used as the new value for the 
  547.    --  attribute. If Value is null then the attribute is unset. If the Value 
  548.    --  Glib.Variant.Gvariant is floating, it is consumed. 
  549.    --  See also g_menu_item_set_attribute for a more convenient way to do the 
  550.    --  same. 
  551.    --  Since: gtk+ 2.32 
  552.    --  "attribute": the attribute to set 
  553.    --  "value": a Glib.Variant.Gvariant to use as the value, or null 
  554.  
  555.    function Get_Link 
  556.       (Self : not null access Gmenu_Item_Record; 
  557.        Link : UTF8_String) return Glib.Menu_Model.Gmenu_Model; 
  558.    --  Queries the named Link on Menu_Item. 
  559.    --  Since: gtk+ 2.34 
  560.    --  "link": the link name to query 
  561.  
  562.    procedure Set_Link 
  563.       (Self  : not null access Gmenu_Item_Record; 
  564.        Link  : UTF8_String; 
  565.        Model : access Glib.Menu_Model.Gmenu_Model_Record'Class); 
  566.    --  Creates a link from Menu_Item to Model if non-null, or unsets it. 
  567.    --  Links are used to establish a relationship between a particular menu 
  568.    --  item and another menu. For example, G_MENU_LINK_SUBMENU is used to 
  569.    --  associate a submenu with a particular menu item, and G_MENU_LINK_SECTION 
  570.    --  is used to create a section. Other types of link can be used, but there 
  571.    --  is no guarantee that clients will be able to make sense of them. Link 
  572.    --  types are restricted to lowercase characters, numbers and '-'. 
  573.    --  Furthermore, the names must begin with a lowercase character, must not 
  574.    --  end with a '-', and must not contain consecutive dashes. 
  575.    --  Since: gtk+ 2.32 
  576.    --  "link": type of link to establish or unset 
  577.    --  "model": the Glib.Menu_Model.Gmenu_Model to link to (or null to unset) 
  578.  
  579.    procedure Set_Action_And_Target_Value 
  580.       (Self         : not null access Gmenu_Item_Record; 
  581.        Action       : UTF8_String := ""; 
  582.        Target_Value : Glib.Variant.Gvariant); 
  583.    --  Sets or unsets the "action" and "target" attributes of Menu_Item. 
  584.    --  If Action is null then both the "action" and "target" attributes are 
  585.    --  unset (and Target_Value is ignored). 
  586.    --  If Action is non-null then the "action" attribute is set. The "target" 
  587.    --  attribute is then set to the value of Target_Value if it is non-null or 
  588.    --  unset otherwise. 
  589.    --  Normal menu items (ie: not submenu, section or other custom item types) 
  590.    --  are expected to have the "action" attribute set to identify the action 
  591.    --  that they are associated with. The state type of the action help to 
  592.    --  determine the disposition of the menu item. See Glib.Action.Gaction and 
  593.    --  Glib.Action_Group.Gaction_Group for an overview of actions. 
  594.    --  In general, clicking on the menu item will result in activation of the 
  595.    --  named action with the "target" attribute given as the parameter to the 
  596.    --  action invocation. If the "target" attribute is not set then the action 
  597.    --  is invoked with no parameter. 
  598.    --  If the action has no state then the menu item is usually drawn as a 
  599.    --  plain menu item (ie: with no additional decoration). 
  600.    --  If the action has a boolean state then the menu item is usually drawn 
  601.    --  as a toggle menu item (ie: with a checkmark or equivalent indication). 
  602.    --  The item should be marked as 'toggled' or 'checked' when the boolean 
  603.    --  state is True. 
  604.    --  If the action has a string state then the menu item is usually drawn as 
  605.    --  a radio menu item (ie: with a radio bullet or equivalent indication). 
  606.    --  The item should be marked as 'selected' when the string state is equal 
  607.    --  to the value of the Target property. 
  608.    --  See g_menu_item_set_action_and_target or Glib.Menu.Set_Detailed_Action 
  609.    --  for two equivalent calls that are probably more convenient for most 
  610.    --  uses. 
  611.    --  Since: gtk+ 2.32 
  612.    --  "action": the name of the action for this item 
  613.    --  "target_value": a Glib.Variant.Gvariant to use as the action target 
  614.  
  615.    procedure Set_Detailed_Action 
  616.       (Self            : not null access Gmenu_Item_Record; 
  617.        Detailed_Action : UTF8_String); 
  618.    --  Sets the "action" and possibly the "target" attribute of Menu_Item. 
  619.    --  If Detailed_Action contains a double colon ("::") then it is used as a 
  620.    --  separator between an action name and a target string. In this case, this 
  621.    --  call is equivalent to calling g_menu_item_set_action_and_target with the 
  622.    --  part before the "::" and with a string-type Glib.Variant.Gvariant 
  623.    --  containing the part following the "::". 
  624.    --  If Detailed_Action doesn't contain "::" then the action is set to the 
  625.    --  given string (verbatim) and the target value is unset. 
  626.    --  See g_menu_item_set_action_and_target or 
  627.    --  Glib.Menu.Set_Action_And_Target_Value for more flexible (but slightly 
  628.    --  less convenient) alternatives. 
  629.    --  See also Glib.Menu.Set_Action_And_Target_Value for a description of the 
  630.    --  semantics of the action and target attributes. 
  631.    --  Since: gtk+ 2.32 
  632.    --  "detailed_action": the "detailed" action string 
  633.  
  634.    procedure Set_Label 
  635.       (Self  : not null access Gmenu_Item_Record; 
  636.        Label : UTF8_String := ""); 
  637.    --  Sets or unsets the "label" attribute of Menu_Item. 
  638.    --  If Label is non-null it is used as the label for the menu item. If it 
  639.    --  is null then the label attribute is unset. 
  640.    --  Since: gtk+ 2.32 
  641.    --  "label": the label to set, or null to unset 
  642.  
  643.    procedure Set_Section 
  644.       (Self    : not null access Gmenu_Item_Record; 
  645.        Section : access Glib.Menu_Model.Gmenu_Model_Record'Class); 
  646.    --  Sets or unsets the "section" link of Menu_Item to Section. 
  647.    --  The effect of having one menu appear as a section of another is exactly 
  648.    --  as it sounds: the items from Section become a direct part of the menu 
  649.    --  that Menu_Item is added to. See Glib.Menu.G_New_Section for more 
  650.    --  information about what it means for a menu item to be a section. 
  651.    --  Since: gtk+ 2.32 
  652.    --  "section": a Glib.Menu_Model.Gmenu_Model, or null 
  653.  
  654.    procedure Set_Submenu 
  655.       (Self    : not null access Gmenu_Item_Record; 
  656.        Submenu : access Glib.Menu_Model.Gmenu_Model_Record'Class); 
  657.    --  Sets or unsets the "submenu" link of Menu_Item to Submenu. 
  658.    --  If Submenu is non-null, it is linked to. If it is null then the link is 
  659.    --  unset. 
  660.    --  The effect of having one menu appear as a submenu of another is exactly 
  661.    --  as it sounds. 
  662.    --  Since: gtk+ 2.32 
  663.    --  "submenu": a Glib.Menu_Model.Gmenu_Model, or null 
  664.  
  665. end Glib.Menu;