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.Scrollbar.Gtk_Scrollbar widget is a horizontal or vertical 
  26. --  scrollbar, depending on the value of the 
  27. --  Gtk.Orientable.Gtk_Orientable:orientation property. 
  28. -- 
  29. --  The position of the thumb in a scrollbar is controlled by the scroll 
  30. --  adjustments. See Gtk.Adjustment.Gtk_Adjustment for the fields in an 
  31. --  adjustment - for Gtk.Scrollbar.Gtk_Scrollbar, the 
  32. --  Gtk.Adjustment.Gtk_Adjustment:value field represents the position of the 
  33. --  scrollbar, which must be between the Gtk.Adjustment.Gtk_Adjustment:lower 
  34. --  field and Gtk.Adjustment.Gtk_Adjustment:upper - 
  35. --  Gtk.Adjustment.Gtk_Adjustment:page-size. The 
  36. --  Gtk.Adjustment.Gtk_Adjustment:page-size field represents the size of the 
  37. --  visible scrollable area. The Gtk.Adjustment.Gtk_Adjustment:step-increment 
  38. --  and Gtk.Adjustment.Gtk_Adjustment:page-increment fields are properties when 
  39. --  the user asks to step down (using the small stepper arrows) or page down 
  40. --  (using for example the 'PageDown' key). 
  41. -- 
  42. --  </description> 
  43. pragma Ada_2005; 
  44.  
  45. pragma Warnings (Off, "*is already use-visible*"); 
  46. with Glib;           use Glib; 
  47. with Glib.Types;     use Glib.Types; 
  48. with Gtk.Adjustment; use Gtk.Adjustment; 
  49. with Gtk.Buildable;  use Gtk.Buildable; 
  50. with Gtk.Enums;      use Gtk.Enums; 
  51. with Gtk.GRange;     use Gtk.GRange; 
  52. with Gtk.Orientable; use Gtk.Orientable; 
  53.  
  54. package Gtk.Scrollbar is 
  55.  
  56.    type Gtk_Scrollbar_Record is new Gtk_Range_Record with null record; 
  57.    type Gtk_Scrollbar is access all Gtk_Scrollbar_Record'Class; 
  58.  
  59.    subtype Gtk_Hscrollbar_Record is Gtk_Scrollbar_Record; 
  60.    subtype Gtk_Hscrollbar is Gtk_Scrollbar; 
  61.  
  62.    subtype Gtk_Vscrollbar_Record is Gtk_Scrollbar_Record; 
  63.    subtype Gtk_Vscrollbar is Gtk_Scrollbar; 
  64.  
  65.    ------------------ 
  66.    -- Constructors -- 
  67.    ------------------ 
  68.  
  69.    procedure Gtk_New 
  70.       (Scrollbar   : out Gtk_Scrollbar; 
  71.        Orientation : Gtk.Enums.Gtk_Orientation; 
  72.        Adjustment  : access Gtk.Adjustment.Gtk_Adjustment_Record'Class); 
  73.    procedure Initialize 
  74.       (Scrollbar   : not null access Gtk_Scrollbar_Record'Class; 
  75.        Orientation : Gtk.Enums.Gtk_Orientation; 
  76.        Adjustment  : access Gtk.Adjustment.Gtk_Adjustment_Record'Class); 
  77.    --  Creates a new scrollbar with the given orientation. 
  78.    --  Since: gtk+ 3.0 
  79.    --  "orientation": the scrollbar's orientation. 
  80.    --  "adjustment": the Gtk.Adjustment.Gtk_Adjustment to use, or null to 
  81.    --  create a new adjustment. 
  82.  
  83.    function Gtk_Scrollbar_New 
  84.       (Orientation : Gtk.Enums.Gtk_Orientation; 
  85.        Adjustment  : access Gtk.Adjustment.Gtk_Adjustment_Record'Class) 
  86.        return Gtk_Scrollbar; 
  87.    --  Creates a new scrollbar with the given orientation. 
  88.    --  Since: gtk+ 3.0 
  89.    --  "orientation": the scrollbar's orientation. 
  90.    --  "adjustment": the Gtk.Adjustment.Gtk_Adjustment to use, or null to 
  91.    --  create a new adjustment. 
  92.  
  93.    function Get_Type return Glib.GType; 
  94.    pragma Import (C, Get_Type, "gtk_scrollbar_get_type"); 
  95.  
  96.    procedure Gtk_New_Hscrollbar 
  97.       (Scrollbar  : out Gtk_Hscrollbar; 
  98.        Adjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class); 
  99.    procedure Initialize_Hscrollbar 
  100.       (Scrollbar  : not null access Gtk_Hscrollbar_Record'Class; 
  101.        Adjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class); 
  102.    --  Creates a new horizontal scrollbar. 
  103.    --  "adjustment": the Gtk.Adjustment.Gtk_Adjustment to use, or null to 
  104.    --  create a new adjustment 
  105.  
  106.    function Gtk_Hscrollbar_New 
  107.       (Adjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class) 
  108.        return Gtk_Hscrollbar; 
  109.    --  Creates a new horizontal scrollbar. 
  110.    --  "adjustment": the Gtk.Adjustment.Gtk_Adjustment to use, or null to 
  111.    --  create a new adjustment 
  112.  
  113.    function Hscrollbar_Get_Type return Glib.GType; 
  114.    pragma Import (C, Hscrollbar_Get_Type, "gtk_hscrollbar_get_type"); 
  115.  
  116.    procedure Gtk_New_Vscrollbar 
  117.       (Scrollbar  : out Gtk_Vscrollbar; 
  118.        Adjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class); 
  119.    procedure Initialize_Vscrollbar 
  120.       (Scrollbar  : not null access Gtk_Vscrollbar_Record'Class; 
  121.        Adjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class); 
  122.    --  Creates a new vertical scrollbar. 
  123.    --  "adjustment": the Gtk.Adjustment.Gtk_Adjustment to use, or null to 
  124.    --  create a new adjustment 
  125.  
  126.    function Gtk_Vscrollbar_New 
  127.       (Adjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class) 
  128.        return Gtk_Vscrollbar; 
  129.    --  Creates a new vertical scrollbar. 
  130.    --  "adjustment": the Gtk.Adjustment.Gtk_Adjustment to use, or null to 
  131.    --  create a new adjustment 
  132.  
  133.    function Vscrollbar_Get_Type return Glib.GType; 
  134.    pragma Import (C, Vscrollbar_Get_Type, "gtk_vscrollbar_get_type"); 
  135.  
  136.    --------------------------------------------- 
  137.    -- Inherited subprograms (from interfaces) -- 
  138.    --------------------------------------------- 
  139.    --  Methods inherited from the Buildable interface are not duplicated here 
  140.    --  since they are meant to be used by tools, mostly. If you need to call 
  141.    --  them, use an explicit cast through the "-" operator below. 
  142.  
  143.    function Get_Orientation 
  144.       (Self : not null access Gtk_Scrollbar_Record) 
  145.        return Gtk.Enums.Gtk_Orientation; 
  146.  
  147.    procedure Set_Orientation 
  148.       (Self        : not null access Gtk_Scrollbar_Record; 
  149.        Orientation : Gtk.Enums.Gtk_Orientation); 
  150.  
  151.    ---------------- 
  152.    -- Interfaces -- 
  153.    ---------------- 
  154.    --  This class implements several interfaces. See Glib.Types 
  155.    -- 
  156.    --  - "Buildable" 
  157.    -- 
  158.    --  - "Orientable" 
  159.  
  160.    package Implements_Gtk_Buildable is new Glib.Types.Implements 
  161.      (Gtk.Buildable.Gtk_Buildable, Gtk_Scrollbar_Record, Gtk_Scrollbar); 
  162.    function "+" 
  163.      (Widget : access Gtk_Scrollbar_Record'Class) 
  164.    return Gtk.Buildable.Gtk_Buildable 
  165.    renames Implements_Gtk_Buildable.To_Interface; 
  166.    function "-" 
  167.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  168.    return Gtk_Scrollbar 
  169.    renames Implements_Gtk_Buildable.To_Object; 
  170.  
  171.    package Implements_Gtk_Orientable is new Glib.Types.Implements 
  172.      (Gtk.Orientable.Gtk_Orientable, Gtk_Scrollbar_Record, Gtk_Scrollbar); 
  173.    function "+" 
  174.      (Widget : access Gtk_Scrollbar_Record'Class) 
  175.    return Gtk.Orientable.Gtk_Orientable 
  176.    renames Implements_Gtk_Orientable.To_Interface; 
  177.    function "-" 
  178.      (Interf : Gtk.Orientable.Gtk_Orientable) 
  179.    return Gtk_Scrollbar 
  180.    renames Implements_Gtk_Orientable.To_Object; 
  181.  
  182. end Gtk.Scrollbar;