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. -- -- -- -- -- -- -- -- -- -- -- --
  23. ----------------------------------------------------------------------- 
  24.  
  25. --  <description> 
  26. --  This widget is an adapter: it can contain any child, and will make it 
  27. --  scrollable. Its use is not necessary inside a Gtk_Scrolled_Window, which 
  28. --  automatically uses a Gtk_Viewport when necessary. 
  29. --  </description> 
  30. --  <c_version>2.8.17</c_version> 
  31. --  <group>Scrolling</group> 
  32.  
  33. with Glib.Properties; 
  34. with Glib; 
  35. with Gdk; 
  36. with Gtk.Adjustment; 
  37. with Gtk.Bin; 
  38. with Gtk.Enums; use Gtk.Enums; 
  39.  
  40. package Gtk.Viewport is 
  41.  
  42.    type Gtk_Viewport_Record is new Gtk.Bin.Gtk_Bin_Record with private; 
  43.    type Gtk_Viewport is access all Gtk_Viewport_Record'Class; 
  44.  
  45.    procedure Gtk_New 
  46.      (Viewport    : out Gtk_Viewport; 
  47.       Hadjustment : Adjustment.Gtk_Adjustment := null; 
  48.       Vadjustment : Adjustment.Gtk_Adjustment := null); 
  49.    procedure Initialize 
  50.      (Viewport    : access Gtk_Viewport_Record'Class; 
  51.       Hadjustment : Gtk.Adjustment.Gtk_Adjustment; 
  52.       Vadjustment : Gtk.Adjustment.Gtk_Adjustment); 
  53.    --  Create or initialize a new viewport 
  54.  
  55.    function Get_Type return Glib.GType; 
  56.    --  Return the internal value associated with a Gtk_Viewport. 
  57.  
  58.    function Get_Bin_Window 
  59.      (Widget : access Gtk_Viewport_Record) return Gdk.Gdk_Window; 
  60.    --  Return the window associated with the viewport. 
  61.    --  You should use this one rather than Gtk.Widget.Get_Window. 
  62.  
  63.    procedure Set_Hadjustment 
  64.      (Viewport   : access Gtk_Viewport_Record; 
  65.       Adjustment : Gtk.Adjustment.Gtk_Adjustment); 
  66.    function Get_Hadjustment 
  67.      (Viewport : access Gtk_Viewport_Record) return Adjustment.Gtk_Adjustment; 
  68.    --  Sets or gets the Gtk_Adjustment used for horizontal scrolling 
  69.  
  70.    procedure Set_Vadjustment 
  71.      (Viewport   : access Gtk_Viewport_Record; 
  72.       Adjustment : Gtk.Adjustment.Gtk_Adjustment); 
  73.    function Get_Vadjustment 
  74.      (Viewport : access Gtk_Viewport_Record) return Adjustment.Gtk_Adjustment; 
  75.    --  Sets or gets the Gtk_Adjustment used for vertical scrolling 
  76.  
  77.    procedure Set_Shadow_Type 
  78.      (Viewport : access Gtk_Viewport_Record; 
  79.       The_Type : Gtk_Shadow_Type); 
  80.    function Get_Shadow_Type 
  81.      (Viewport : access Gtk_Viewport_Record) return Gtk_Shadow_Type; 
  82.    --  Sets or gets the visual rendering of the viewport 
  83.  
  84.    ------------- 
  85.    -- Signals -- 
  86.    ------------- 
  87.  
  88.    --  <signals> 
  89.    --  The following new signals are defined for this widget: 
  90.    -- 
  91.    --  - "set_scroll_adjustments" 
  92.    --    procedure Handler 
  93.    --      (Viewport   : access Gtk_Viewport_Record'Class; 
  94.    --       Hadj, Vadj : access Gtk_Adjustment_Record'Class); 
  95.    --    You should emit this signal to request a change of adjustments for the 
  96.    --    viewport. Seldom used, it is simpler to use Set_Vadjusment and 
  97.    --    Set_Hadjustment. 
  98.    -- 
  99.    --  </signals> 
  100.  
  101.    Signal_Set_Scroll_Adjustments : constant Glib.Signal_Name := 
  102.                                      "set_scroll_adjustments"; 
  103.  
  104.    ---------------- 
  105.    -- Properties -- 
  106.    ---------------- 
  107.  
  108.    --  <properties> 
  109.    --  The following properties are defined for this widget. See 
  110.    --  Glib.Properties for more information on properties. 
  111.    -- 
  112.    --  - Name:  Hadjustment_Property 
  113.    --    Type:  Gtk_Adjustment_Record'Class 
  114.    --    Flags: read-write 
  115.    --    Descr: The Gtk_Adjustment that determines the values of the horizontal 
  116.    --           position for this viewport 
  117.    --    See also:  Set_Hadjustment and Get_Hadjustment 
  118.    -- 
  119.    --  - Name:  Vadjustment_Property 
  120.    --    Type:  Gtk_Adjustment_Record'Class 
  121.    --    Flags: read-write 
  122.    --    Descr: The Gtk_Adjustment that determines the values of the vertical 
  123.    --           position for this viewport 
  124.    --    See also:  Set_Vadjustment and Get_Vadjustment 
  125.    -- 
  126.    --  - Name:  Shadow_Type_Property 
  127.    --    Type:  Gtk_Shadow_Type 
  128.    --    Flags: read-write 
  129.    --    Descr: Determines how the shadowed box around the viewport is drawn. 
  130.    --    See also:  Set_Shadow_Type 
  131.    -- 
  132.    --  </properties> 
  133.  
  134.    Hadjustment_Property : constant Glib.Properties.Property_Object; 
  135.    Vadjustment_Property : constant Glib.Properties.Property_Object; 
  136.    Shadow_Type_Property : constant Gtk.Enums.Property_Gtk_Shadow_Type; 
  137.  
  138. private 
  139.    type Gtk_Viewport_Record is new Gtk.Bin.Gtk_Bin_Record with null record; 
  140.  
  141.    Hadjustment_Property : constant Glib.Properties.Property_Object := 
  142.      Glib.Properties.Build ("hadjustment"); 
  143.    Vadjustment_Property : constant Glib.Properties.Property_Object := 
  144.      Glib.Properties.Build ("vadjustment"); 
  145.    Shadow_Type_Property : constant Gtk.Enums.Property_Gtk_Shadow_Type := 
  146.      Gtk.Enums.Build ("shadow_type"); 
  147.  
  148.    pragma Import (C, Get_Type, "gtk_viewport_get_type"); 
  149. end Gtk.Viewport;