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. --  The Gtk.Menu_Bar.Gtk_Menu_Bar is a subclass of 
  26. --  Gtk.Menu_Shell.Gtk_Menu_Shell which contains one or more Gtk_Menu_Items. 
  27. --  The result is a standard menu bar which can hold many menu items. 
  28. -- 
  29. --  </description> 
  30. pragma Ada_2005; 
  31.  
  32. pragma Warnings (Off, "*is already use-visible*"); 
  33. with Glib;            use Glib; 
  34. with Glib.Menu_Model; use Glib.Menu_Model; 
  35. with Glib.Types;      use Glib.Types; 
  36. with Gtk.Buildable;   use Gtk.Buildable; 
  37. with Gtk.Enums;       use Gtk.Enums; 
  38. with Gtk.Menu_Shell;  use Gtk.Menu_Shell; 
  39.  
  40. package Gtk.Menu_Bar is 
  41.  
  42.    type Gtk_Menu_Bar_Record is new Gtk_Menu_Shell_Record with null record; 
  43.    type Gtk_Menu_Bar is access all Gtk_Menu_Bar_Record'Class; 
  44.  
  45.    ------------------ 
  46.    -- Constructors -- 
  47.    ------------------ 
  48.  
  49.    procedure Gtk_New (Menu_Bar : out Gtk_Menu_Bar); 
  50.    procedure Initialize 
  51.       (Menu_Bar : not null access Gtk_Menu_Bar_Record'Class); 
  52.    --  Creates a new Gtk.Menu_Bar.Gtk_Menu_Bar 
  53.  
  54.    function Gtk_Menu_Bar_New return Gtk_Menu_Bar; 
  55.    --  Creates a new Gtk.Menu_Bar.Gtk_Menu_Bar 
  56.  
  57.    procedure Gtk_New_From_Model 
  58.       (Menu_Bar : out Gtk_Menu_Bar; 
  59.        Model    : not null access Glib.Menu_Model.Gmenu_Model_Record'Class); 
  60.    procedure Initialize_From_Model 
  61.       (Menu_Bar : not null access Gtk_Menu_Bar_Record'Class; 
  62.        Model    : not null access Glib.Menu_Model.Gmenu_Model_Record'Class); 
  63.    --  Creates a new Gtk.Menu_Bar.Gtk_Menu_Bar and populates it with menu 
  64.    --  items and submenus according to Model. 
  65.    --  The created menu items are connected to actions found in the 
  66.    --  Gtk.Application_Window.Gtk_Application_Window to which the menu bar 
  67.    --  belongs - typically by means of being contained within the 
  68.    --  Gtk_Application_Windows widget hierarchy. 
  69.    --  Since: gtk+ 3.4 
  70.    --  "model": a Glib.Menu_Model.Gmenu_Model 
  71.  
  72.    function Gtk_Menu_Bar_New_From_Model 
  73.       (Model : not null access Glib.Menu_Model.Gmenu_Model_Record'Class) 
  74.        return Gtk_Menu_Bar; 
  75.    --  Creates a new Gtk.Menu_Bar.Gtk_Menu_Bar and populates it with menu 
  76.    --  items and submenus according to Model. 
  77.    --  The created menu items are connected to actions found in the 
  78.    --  Gtk.Application_Window.Gtk_Application_Window to which the menu bar 
  79.    --  belongs - typically by means of being contained within the 
  80.    --  Gtk_Application_Windows widget hierarchy. 
  81.    --  Since: gtk+ 3.4 
  82.    --  "model": a Glib.Menu_Model.Gmenu_Model 
  83.  
  84.    function Get_Type return Glib.GType; 
  85.    pragma Import (C, Get_Type, "gtk_menu_bar_get_type"); 
  86.  
  87.    ------------- 
  88.    -- Methods -- 
  89.    ------------- 
  90.  
  91.    function Get_Child_Pack_Direction 
  92.       (Menu_Bar : not null access Gtk_Menu_Bar_Record) 
  93.        return Gtk.Enums.Gtk_Pack_Direction; 
  94.    --  Retrieves the current child pack direction of the menubar. See 
  95.    --  Gtk.Menu_Bar.Set_Child_Pack_Direction. 
  96.    --  Since: gtk+ 2.8 
  97.  
  98.    procedure Set_Child_Pack_Direction 
  99.       (Menu_Bar       : not null access Gtk_Menu_Bar_Record; 
  100.        Child_Pack_Dir : Gtk.Enums.Gtk_Pack_Direction); 
  101.    --  Sets how widgets should be packed inside the children of a menubar. 
  102.    --  Since: gtk+ 2.8 
  103.    --  "child_pack_dir": a new Gtk.Enums.Gtk_Pack_Direction 
  104.  
  105.    function Get_Pack_Direction 
  106.       (Menu_Bar : not null access Gtk_Menu_Bar_Record) 
  107.        return Gtk.Enums.Gtk_Pack_Direction; 
  108.    --  Retrieves the current pack direction of the menubar. See 
  109.    --  Gtk.Menu_Bar.Set_Pack_Direction. 
  110.    --  Since: gtk+ 2.8 
  111.  
  112.    procedure Set_Pack_Direction 
  113.       (Menu_Bar : not null access Gtk_Menu_Bar_Record; 
  114.        Pack_Dir : Gtk.Enums.Gtk_Pack_Direction); 
  115.    --  Sets how items should be packed inside a menubar. 
  116.    --  Since: gtk+ 2.8 
  117.    --  "pack_dir": a new Gtk.Enums.Gtk_Pack_Direction 
  118.  
  119.    ---------------- 
  120.    -- Properties -- 
  121.    ---------------- 
  122.    --  The following properties are defined for this widget. See 
  123.    --  Glib.Properties for more information on properties) 
  124.  
  125.    Child_Pack_Direction_Property : constant Gtk.Enums.Property_Gtk_Pack_Direction; 
  126.    --  The child pack direction of the menubar. It determines how the widgets 
  127.    --  contained in child menuitems are arranged. 
  128.  
  129.    Pack_Direction_Property : constant Gtk.Enums.Property_Gtk_Pack_Direction; 
  130.    --  The pack direction of the menubar. It determines how menuitems are 
  131.    --  arranged in the menubar. 
  132.  
  133.    ---------------- 
  134.    -- Interfaces -- 
  135.    ---------------- 
  136.    --  This class implements several interfaces. See Glib.Types 
  137.    -- 
  138.    --  - "Buildable" 
  139.  
  140.    package Implements_Gtk_Buildable is new Glib.Types.Implements 
  141.      (Gtk.Buildable.Gtk_Buildable, Gtk_Menu_Bar_Record, Gtk_Menu_Bar); 
  142.    function "+" 
  143.      (Widget : access Gtk_Menu_Bar_Record'Class) 
  144.    return Gtk.Buildable.Gtk_Buildable 
  145.    renames Implements_Gtk_Buildable.To_Interface; 
  146.    function "-" 
  147.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  148.    return Gtk_Menu_Bar 
  149.    renames Implements_Gtk_Buildable.To_Object; 
  150.  
  151. private 
  152.    Pack_Direction_Property : constant Gtk.Enums.Property_Gtk_Pack_Direction := 
  153.      Gtk.Enums.Build ("pack-direction"); 
  154.    Child_Pack_Direction_Property : constant Gtk.Enums.Property_Gtk_Pack_Direction := 
  155.      Gtk.Enums.Build ("child-pack-direction"); 
  156. end Gtk.Menu_Bar;