1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   -- 
  5. --                Copyright (C) 2000-2007 AdaCore                    -- 
  6. --                                                                   -- 
  7. -- This library is free software; you can redistribute it and/or     -- 
  8. -- modify it under the terms of the GNU General Public               -- 
  9. -- License as published by the Free Software Foundation; either      -- 
  10. -- version 2 of the License, or (at your option) any later version.  -- 
  11. --                                                                   -- 
  12. -- This library is distributed in the hope that it will be useful,   -- 
  13. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  14. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  15. -- General Public License for more details.                          -- 
  16. --                                                                   -- 
  17. -- You should have received a copy of the GNU General Public         -- 
  18. -- License along with this library; if not, write to the             -- 
  19. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  20. -- Boston, MA 02111-1307, USA.                                       -- 
  21. --                                                                   -- 
  22. -- As a special exception, if other files instantiate generics from  -- 
  23. -- this unit, or you link this unit with other files to produce an   -- 
  24. -- executable, this  unit  does not  by itself cause  the resulting  -- 
  25. -- executable to be covered by the GNU General Public License. This  -- 
  26. -- exception does not however invalidate any other reasons why the   -- 
  27. -- executable file  might be covered by the  GNU Public License.     -- 
  28. ----------------------------------------------------------------------- 
  29.  
  30. --  <description> 
  31. --  This widget is an adapter: it can contain any child, and will make it 
  32. --  scrollable. Its use is not necessary inside a Gtk_Scrolled_Window, which 
  33. --  automatically uses a Gtk_Viewport when necessary. 
  34. --  </description> 
  35. --  <c_version>2.8.17</c_version> 
  36. --  <group>Scrolling</group> 
  37.  
  38. with Glib.Properties; 
  39. with Glib; 
  40. with Gdk; 
  41. with Gtk.Adjustment; 
  42. with Gtk.Bin; 
  43. with Gtk.Enums; use Gtk.Enums; 
  44.  
  45. package Gtk.Viewport is 
  46.  
  47.    type Gtk_Viewport_Record is new Gtk.Bin.Gtk_Bin_Record with private; 
  48.    type Gtk_Viewport is access all Gtk_Viewport_Record'Class; 
  49.  
  50.    procedure Gtk_New 
  51.      (Viewport    : out Gtk_Viewport; 
  52.       Hadjustment : Adjustment.Gtk_Adjustment := null; 
  53.       Vadjustment : Adjustment.Gtk_Adjustment := null); 
  54.    procedure Initialize 
  55.      (Viewport    : access Gtk_Viewport_Record'Class; 
  56.       Hadjustment : Gtk.Adjustment.Gtk_Adjustment; 
  57.       Vadjustment : Gtk.Adjustment.Gtk_Adjustment); 
  58.    --  Create or initialize a new viewport 
  59.  
  60.    function Get_Type return Glib.GType; 
  61.    --  Return the internal value associated with a Gtk_Viewport. 
  62.  
  63.    function Get_Bin_Window 
  64.      (Widget : access Gtk_Viewport_Record) return Gdk.Gdk_Window; 
  65.    --  Return the window associated with the viewport. 
  66.    --  You should use this one rather than Gtk.Widget.Get_Window. 
  67.  
  68.    procedure Set_Hadjustment 
  69.      (Viewport   : access Gtk_Viewport_Record; 
  70.       Adjustment : Gtk.Adjustment.Gtk_Adjustment); 
  71.    function Get_Hadjustment 
  72.      (Viewport : access Gtk_Viewport_Record) return Adjustment.Gtk_Adjustment; 
  73.    --  Sets or gets the Gtk_Adjustment used for horizontal scrolling 
  74.  
  75.    procedure Set_Vadjustment 
  76.      (Viewport   : access Gtk_Viewport_Record; 
  77.       Adjustment : Gtk.Adjustment.Gtk_Adjustment); 
  78.    function Get_Vadjustment 
  79.      (Viewport : access Gtk_Viewport_Record) return Adjustment.Gtk_Adjustment; 
  80.    --  Sets or gets the Gtk_Adjustment used for vertical scrolling 
  81.  
  82.    procedure Set_Shadow_Type 
  83.      (Viewport : access Gtk_Viewport_Record; 
  84.       The_Type : Gtk_Shadow_Type); 
  85.    function Get_Shadow_Type 
  86.      (Viewport : access Gtk_Viewport_Record) return Gtk_Shadow_Type; 
  87.    --  Sets or gets the visual rendering of the viewport 
  88.  
  89.    ------------- 
  90.    -- Signals -- 
  91.    ------------- 
  92.  
  93.    --  <signals> 
  94.    --  The following new signals are defined for this widget: 
  95.    -- 
  96.    --  - "set_scroll_adjustments" 
  97.    --    procedure Handler 
  98.    --      (Viewport   : access Gtk_Viewport_Record'Class; 
  99.    --       Hadj, Vadj : access Gtk_Adjustment_Record'Class); 
  100.    --    You should emit this signal to request a change of adjustments for the 
  101.    --    viewport. Seldom used, it is simpler to use Set_Vadjusment and 
  102.    --    Set_Hadjustment. 
  103.    -- 
  104.    --  </signals> 
  105.  
  106.    Signal_Set_Scroll_Adjustments : constant Glib.Signal_Name := 
  107.                                      "set_scroll_adjustments"; 
  108.  
  109.    ---------------- 
  110.    -- Properties -- 
  111.    ---------------- 
  112.  
  113.    --  <properties> 
  114.    --  The following properties are defined for this widget. See 
  115.    --  Glib.Properties for more information on properties. 
  116.    -- 
  117.    --  - Name:  Hadjustment_Property 
  118.    --    Type:  Gtk_Adjustment_Record'Class 
  119.    --    Flags: read-write 
  120.    --    Descr: The Gtk_Adjustment that determines the values of the horizontal 
  121.    --           position for this viewport 
  122.    --    See also:  Set_Hadjustment and Get_Hadjustment 
  123.    -- 
  124.    --  - Name:  Vadjustment_Property 
  125.    --    Type:  Gtk_Adjustment_Record'Class 
  126.    --    Flags: read-write 
  127.    --    Descr: The Gtk_Adjustment that determines the values of the vertical 
  128.    --           position for this viewport 
  129.    --    See also:  Set_Vadjustment and Get_Vadjustment 
  130.    -- 
  131.    --  - Name:  Shadow_Type_Property 
  132.    --    Type:  Gtk_Shadow_Type 
  133.    --    Flags: read-write 
  134.    --    Descr: Determines how the shadowed box around the viewport is drawn. 
  135.    --    See also:  Set_Shadow_Type 
  136.    -- 
  137.    --  </properties> 
  138.  
  139.    Hadjustment_Property : constant Glib.Properties.Property_Object; 
  140.    Vadjustment_Property : constant Glib.Properties.Property_Object; 
  141.    Shadow_Type_Property : constant Gtk.Enums.Property_Gtk_Shadow_Type; 
  142.  
  143. private 
  144.    type Gtk_Viewport_Record is new Gtk.Bin.Gtk_Bin_Record with null record; 
  145.  
  146.    Hadjustment_Property : constant Glib.Properties.Property_Object := 
  147.      Glib.Properties.Build ("hadjustment"); 
  148.    Vadjustment_Property : constant Glib.Properties.Property_Object := 
  149.      Glib.Properties.Build ("vadjustment"); 
  150.    Shadow_Type_Property : constant Gtk.Enums.Property_Gtk_Shadow_Type := 
  151.      Gtk.Enums.Build ("shadow_type"); 
  152.  
  153.    pragma Import (C, Get_Type, "gtk_viewport_get_type"); 
  154. end Gtk.Viewport;