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.Bin.Gtk_Bin widget is a container with just one child. It is not 
  26. --  very useful itself, but it is useful for deriving subclasses, since it 
  27. --  provides common code needed for handling a single child widget. 
  28. -- 
  29. --  Many GTK+ widgets are subclasses of Gtk.Bin.Gtk_Bin, including 
  30. --  Gtk.Window.Gtk_Window, Gtk.Button.Gtk_Button, Gtk.Frame.Gtk_Frame, 
  31. --  Gtk.Handle_Box.Gtk_Handle_Box or Gtk.Scrolled_Window.Gtk_Scrolled_Window. 
  32. -- 
  33. --  </description> 
  34. --  <group>Abstract base classes</group> 
  35. pragma Ada_2005; 
  36.  
  37. pragma Warnings (Off, "*is already use-visible*"); 
  38. with Glib;          use Glib; 
  39. with Glib.Types;    use Glib.Types; 
  40. with Gtk.Buildable; use Gtk.Buildable; 
  41. with Gtk.Container; use Gtk.Container; 
  42. with Gtk.Widget;    use Gtk.Widget; 
  43.  
  44. package Gtk.Bin is 
  45.  
  46.    type Gtk_Bin_Record is new Gtk_Container_Record with null record; 
  47.    type Gtk_Bin is access all Gtk_Bin_Record'Class; 
  48.  
  49.    ------------------ 
  50.    -- Constructors -- 
  51.    ------------------ 
  52.  
  53.    function Get_Type return Glib.GType; 
  54.    pragma Import (C, Get_Type, "gtk_bin_get_type"); 
  55.  
  56.    ------------- 
  57.    -- Methods -- 
  58.    ------------- 
  59.  
  60.    function Get_Child 
  61.       (Bin : not null access Gtk_Bin_Record) return Gtk.Widget.Gtk_Widget; 
  62.    --  Gets the child of the Gtk.Bin.Gtk_Bin, or null if the bin contains no 
  63.    --  child widget. The returned widget does not have a reference added, so 
  64.    --  you do not need to unref it. 
  65.  
  66.    ---------------- 
  67.    -- Interfaces -- 
  68.    ---------------- 
  69.    --  This class implements several interfaces. See Glib.Types 
  70.    -- 
  71.    --  - "Buildable" 
  72.  
  73.    package Implements_Gtk_Buildable is new Glib.Types.Implements 
  74.      (Gtk.Buildable.Gtk_Buildable, Gtk_Bin_Record, Gtk_Bin); 
  75.    function "+" 
  76.      (Widget : access Gtk_Bin_Record'Class) 
  77.    return Gtk.Buildable.Gtk_Buildable 
  78.    renames Implements_Gtk_Buildable.To_Interface; 
  79.    function "-" 
  80.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  81.    return Gtk_Bin 
  82.    renames Implements_Gtk_Buildable.To_Object; 
  83.  
  84. end Gtk.Bin;