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. --  Gtk.Cell_Renderer_Progress.Gtk_Cell_Renderer_Progress renders a numeric 
  26. --  value as a progress par in a cell. Additionally, it can display a text on 
  27. --  top of the progress bar. 
  28. -- 
  29. --  The Gtk.Cell_Renderer_Progress.Gtk_Cell_Renderer_Progress cell renderer 
  30. --  was added in GTK+ 2.6. 
  31. -- 
  32. --  </description> 
  33. pragma Ada_2005; 
  34.  
  35. pragma Warnings (Off, "*is already use-visible*"); 
  36. with Glib;              use Glib; 
  37. with Glib.Properties;   use Glib.Properties; 
  38. with Glib.Types;        use Glib.Types; 
  39. with Gtk.Cell_Renderer; use Gtk.Cell_Renderer; 
  40. with Gtk.Enums;         use Gtk.Enums; 
  41. with Gtk.Orientable;    use Gtk.Orientable; 
  42.  
  43. package Gtk.Cell_Renderer_Progress is 
  44.  
  45.    type Gtk_Cell_Renderer_Progress_Record is new Gtk_Cell_Renderer_Record with null record; 
  46.    type Gtk_Cell_Renderer_Progress is access all Gtk_Cell_Renderer_Progress_Record'Class; 
  47.  
  48.    ------------------ 
  49.    -- Constructors -- 
  50.    ------------------ 
  51.  
  52.    procedure Gtk_New (Self : out Gtk_Cell_Renderer_Progress); 
  53.    procedure Initialize 
  54.       (Self : not null access Gtk_Cell_Renderer_Progress_Record'Class); 
  55.    --  Creates a new Gtk.Cell_Renderer_Progress.Gtk_Cell_Renderer_Progress. 
  56.    --  Since: gtk+ 2.6 
  57.  
  58.    function Gtk_Cell_Renderer_Progress_New return Gtk_Cell_Renderer_Progress; 
  59.    --  Creates a new Gtk.Cell_Renderer_Progress.Gtk_Cell_Renderer_Progress. 
  60.    --  Since: gtk+ 2.6 
  61.  
  62.    function Get_Type return Glib.GType; 
  63.    pragma Import (C, Get_Type, "gtk_cell_renderer_progress_get_type"); 
  64.  
  65.    --------------------------------------------- 
  66.    -- Inherited subprograms (from interfaces) -- 
  67.    --------------------------------------------- 
  68.  
  69.    function Get_Orientation 
  70.       (Self : not null access Gtk_Cell_Renderer_Progress_Record) 
  71.        return Gtk.Enums.Gtk_Orientation; 
  72.  
  73.    procedure Set_Orientation 
  74.       (Self        : not null access Gtk_Cell_Renderer_Progress_Record; 
  75.        Orientation : Gtk.Enums.Gtk_Orientation); 
  76.  
  77.    ---------------- 
  78.    -- Properties -- 
  79.    ---------------- 
  80.    --  The following properties are defined for this widget. See 
  81.    --  Glib.Properties for more information on properties) 
  82.  
  83.    Inverted_Property : constant Glib.Properties.Property_Boolean; 
  84.  
  85.    Pulse_Property : constant Glib.Properties.Property_Int; 
  86.    --  Setting this to a non-negative value causes the cell renderer to enter 
  87.    --  "activity mode", where a block bounces back and forth to indicate that 
  88.    --  some progress is made, without specifying exactly how much. 
  89.    -- 
  90.    --  Each increment of the property causes the block to move by a little 
  91.    --  bit. 
  92.    -- 
  93.    --  To indicate that the activity has not started yet, set the property to 
  94.    --  zero. To indicate completion, set the property to G_MAXINT. 
  95.  
  96.    Text_Property : constant Glib.Properties.Property_String; 
  97.    --  The "text" property determines the label which will be drawn over the 
  98.    --  progress bar. Setting this property to null causes the default label to 
  99.    --  be displayed. Setting this property to an empty string causes no label 
  100.    --  to be displayed. 
  101.  
  102.    Text_Xalign_Property : constant Glib.Properties.Property_Float; 
  103.    --  The "text-xalign" property controls the horizontal alignment of the 
  104.    --  text in the progress bar. Valid values range from 0 (left) to 1 (right). 
  105.    --  Reserved for RTL layouts. 
  106.  
  107.    Text_Yalign_Property : constant Glib.Properties.Property_Float; 
  108.    --  The "text-yalign" property controls the vertical alignment of the text 
  109.    --  in the progress bar. Valid values range from 0 (top) to 1 (bottom). 
  110.  
  111.    Value_Property : constant Glib.Properties.Property_Int; 
  112.    --  The "value" property determines the percentage to which the progress 
  113.    --  bar will be "filled in". 
  114.  
  115.    ---------------- 
  116.    -- Interfaces -- 
  117.    ---------------- 
  118.    --  This class implements several interfaces. See Glib.Types 
  119.    -- 
  120.    --  - "Orientable" 
  121.  
  122.    package Implements_Gtk_Orientable is new Glib.Types.Implements 
  123.      (Gtk.Orientable.Gtk_Orientable, Gtk_Cell_Renderer_Progress_Record, Gtk_Cell_Renderer_Progress); 
  124.    function "+" 
  125.      (Widget : access Gtk_Cell_Renderer_Progress_Record'Class) 
  126.    return Gtk.Orientable.Gtk_Orientable 
  127.    renames Implements_Gtk_Orientable.To_Interface; 
  128.    function "-" 
  129.      (Interf : Gtk.Orientable.Gtk_Orientable) 
  130.    return Gtk_Cell_Renderer_Progress 
  131.    renames Implements_Gtk_Orientable.To_Object; 
  132.  
  133. private 
  134.    Value_Property : constant Glib.Properties.Property_Int := 
  135.      Glib.Properties.Build ("value"); 
  136.    Text_Yalign_Property : constant Glib.Properties.Property_Float := 
  137.      Glib.Properties.Build ("text-yalign"); 
  138.    Text_Xalign_Property : constant Glib.Properties.Property_Float := 
  139.      Glib.Properties.Build ("text-xalign"); 
  140.    Text_Property : constant Glib.Properties.Property_String := 
  141.      Glib.Properties.Build ("text"); 
  142.    Pulse_Property : constant Glib.Properties.Property_Int := 
  143.      Glib.Properties.Build ("pulse"); 
  144.    Inverted_Property : constant Glib.Properties.Property_Boolean := 
  145.      Glib.Properties.Build ("inverted"); 
  146. end Gtk.Cell_Renderer_Progress;