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-2006 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 package is deprecated. It now only acts as an abstract base class 
  32. --  for other widgets. 
  33. --  </description> 
  34. --  <c_version>2.8.17</c_version> 
  35. --  <group>Obsolescent widgets</group> 
  36.  
  37. with Gtk.Adjustment; 
  38. with Gtk.Widget; 
  39. with Glib.Properties; 
  40.  
  41. package Gtk.Progress is 
  42.    pragma Obsolescent; --  Gtk.Progress 
  43.  
  44.    type Gtk_Progress_Record is new Gtk.Widget.Gtk_Widget_Record with private; 
  45.    type Gtk_Progress is access all Gtk_Progress_Record'Class; 
  46.  
  47.    function Get_Type return Glib.GType; 
  48.    --  Return the internal value associated with a Gtk_Progress. 
  49.  
  50.    function Get_Current_Percentage 
  51.      (Progress : access Gtk_Progress_Record) return Gdouble; 
  52.  
  53.    function Get_Current_Text 
  54.      (Progress : access Gtk_Progress_Record) return UTF8_String; 
  55.  
  56.    function Get_Percentage_From_Value 
  57.      (Progress : access Gtk_Progress_Record; 
  58.       Value    : Gdouble) return Gdouble; 
  59.  
  60.    function Get_Text_From_Value 
  61.      (Progress : access Gtk_Progress_Record; 
  62.       Value    : Gdouble) return UTF8_String; 
  63.  
  64.    function Get_Value (Progress : access Gtk_Progress_Record) return Gdouble; 
  65.  
  66.    function Get_Adjustment 
  67.      (Widget : access Gtk_Progress_Record) 
  68.       return Gtk.Adjustment.Gtk_Adjustment; 
  69.  
  70.    procedure Configure 
  71.      (Progress : access Gtk_Progress_Record; 
  72.       Value    : Gdouble; 
  73.       Min      : Gdouble; 
  74.       Max      : Gdouble); 
  75.  
  76.    procedure Set_Activity_Mode 
  77.      (Progress      : access Gtk_Progress_Record; 
  78.       Activity_Mode : Boolean); 
  79.  
  80.    function Get_Activity_Mode 
  81.      (Progress : access Gtk_Progress_Record) return Boolean; 
  82.  
  83.    procedure Set_Adjustment 
  84.      (Progress   : access Gtk_Progress_Record; 
  85.       Adjustment : Gtk.Adjustment.Gtk_Adjustment); 
  86.  
  87.    procedure Set_Format_String 
  88.      (Progress : access Gtk_Progress_Record; 
  89.       Format   : UTF8_String); 
  90.  
  91.    procedure Set_Percentage 
  92.      (Progress   : access Gtk_Progress_Record; 
  93.       Percentage : Gdouble); 
  94.  
  95.    procedure Set_Show_Text 
  96.      (Progress  : access Gtk_Progress_Record; 
  97.       Show_Text : Boolean); 
  98.  
  99.    procedure Set_Text_Alignment 
  100.      (Progress : access Gtk_Progress_Record; 
  101.       X_Align  : Gfloat; 
  102.       Y_Align  : Gfloat); 
  103.  
  104.    procedure Set_Value 
  105.      (Progress : access Gtk_Progress_Record; 
  106.       Value    : Gdouble); 
  107.  
  108.    ---------------- 
  109.    -- Properties -- 
  110.    ---------------- 
  111.  
  112.    --  <properties> 
  113.    --  The following properties are defined for this widget. See 
  114.    --  Glib.Properties for more information on properties. 
  115.    -- 
  116.    --  - Name:  Activity_Mode_Property 
  117.    --    Type:  Boolean 
  118.    --    Flags: read-write 
  119.    --    Descr: If true the Gtk_Progress is in activity mode, meaning that 
  120.    --           it signals something is happening, but not how much of the 
  121.    --           activity is finished. This is used when you're doing something 
  122.    --           that you don't know how long it will take. 
  123.    --    See also: Set_Activity_Mode and Get_Activity_Mode 
  124.    -- 
  125.    --  - Name:  Show_Text_Property 
  126.    --    Type:  Boolean 
  127.    --    Flags: read-write 
  128.    --    Descr: Whether the progress is shown as text 
  129.    --    See also: Set_Show_Text 
  130.    -- 
  131.    --  - Name:  Text_Xalign_Property 
  132.    --    Type:  Gfloat 
  133.    --    Flags: read-write 
  134.    --    Descr: A number between 0.0 and 1.0 specifying the horizontal 
  135.    --           alignment of the text in the progress widget 
  136.    --    See also: Set_Set_Text_Alignment 
  137.    -- 
  138.    --  - Name:  Text_Yalign_Property 
  139.    --    Type:  Gfloat 
  140.    --    Flags: read-write 
  141.    --    Descr: A number between 0.0 and 1.0 specifying the vertical alignment 
  142.    --           of the text in the progress widget 
  143.    --    See also: Set_Set_Text_Alignment 
  144.    -- 
  145.    --  </properties> 
  146.  
  147.    Activity_Mode_Property : constant Glib.Properties.Property_Boolean; 
  148.    Show_Text_Property     : constant Glib.Properties.Property_Boolean; 
  149.    Text_Xalign_Property   : constant Glib.Properties.Property_Float; 
  150.    Text_Yalign_Property   : constant Glib.Properties.Property_Float; 
  151.  
  152. private 
  153.    type Gtk_Progress_Record is new Gtk.Widget.Gtk_Widget_Record 
  154.      with null record; 
  155.  
  156.    Activity_Mode_Property : constant Glib.Properties.Property_Boolean := 
  157.      Glib.Properties.Build ("activity_mode"); 
  158.    Show_Text_Property     : constant Glib.Properties.Property_Boolean := 
  159.      Glib.Properties.Build ("show_text"); 
  160.    Text_Xalign_Property   : constant Glib.Properties.Property_Float := 
  161.      Glib.Properties.Build ("text_xalign"); 
  162.    Text_Yalign_Property   : constant Glib.Properties.Property_Float := 
  163.      Glib.Properties.Build ("text_xalign"); 
  164.  
  165.    pragma Import (C, Get_Type, "gtk_progress_get_type"); 
  166. end Gtk.Progress;