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-2013, 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 for 
  32. --  other widgets. 
  33. -- 
  34. --  </description> 
  35. --  <group>Obsolescent widgets</group> 
  36.  
  37. pragma Warnings (Off, "*is already use-visible*"); 
  38. with Glib;            use Glib; 
  39. with Glib.Properties; use Glib.Properties; 
  40. with Glib.Types;      use Glib.Types; 
  41. with Gtk.Adjustment;  use Gtk.Adjustment; 
  42. with Gtk.Buildable;   use Gtk.Buildable; 
  43. with Gtk.Widget;      use Gtk.Widget; 
  44.  
  45. package Gtk.Progress is 
  46.  
  47.    pragma Obsolescent; 
  48.  
  49.    type Gtk_Progress_Record is new Gtk_Widget_Record with null record; 
  50.    type Gtk_Progress is access all Gtk_Progress_Record'Class; 
  51.  
  52.    ------------------ 
  53.    -- Constructors -- 
  54.    ------------------ 
  55.  
  56.    function Get_Type return Glib.GType; 
  57.    pragma Import (C, Get_Type, "gtk_progress_get_type"); 
  58.  
  59.    ------------- 
  60.    -- Methods -- 
  61.    ------------- 
  62.  
  63.    procedure Configure 
  64.       (Progress : access Gtk_Progress_Record; 
  65.        Value    : Gdouble; 
  66.        Min      : Gdouble; 
  67.        Max      : Gdouble); 
  68.  
  69.    function Get_Current_Percentage 
  70.       (Progress : access Gtk_Progress_Record) return Gdouble; 
  71.  
  72.    function Get_Current_Text 
  73.       (Progress : access Gtk_Progress_Record) return UTF8_String; 
  74.  
  75.    function Get_Percentage_From_Value 
  76.       (Progress : access Gtk_Progress_Record; 
  77.        Value    : Gdouble) return Gdouble; 
  78.  
  79.    function Get_Text_From_Value 
  80.       (Progress : access Gtk_Progress_Record; 
  81.        Value    : Gdouble) return UTF8_String; 
  82.  
  83.    function Get_Value (Progress : access Gtk_Progress_Record) return Gdouble; 
  84.    procedure Set_Value 
  85.       (Progress : access Gtk_Progress_Record; 
  86.        Value    : Gdouble); 
  87.  
  88.    procedure Set_Activity_Mode 
  89.       (Progress      : access Gtk_Progress_Record; 
  90.        Activity_Mode : Boolean); 
  91.  
  92.    procedure Set_Adjustment 
  93.       (Progress   : access Gtk_Progress_Record; 
  94.        Adjustment : access Gtk.Adjustment.Gtk_Adjustment_Record'Class); 
  95.  
  96.    procedure Set_Format_String 
  97.       (Progress : access Gtk_Progress_Record; 
  98.        Format   : UTF8_String); 
  99.  
  100.    procedure Set_Percentage 
  101.       (Progress   : access Gtk_Progress_Record; 
  102.        Percentage : Gdouble); 
  103.  
  104.    procedure Set_Show_Text 
  105.       (Progress  : access Gtk_Progress_Record; 
  106.        Show_Text : Boolean); 
  107.  
  108.    procedure Set_Text_Alignment 
  109.       (Progress : access Gtk_Progress_Record; 
  110.        X_Align  : Gfloat; 
  111.        Y_Align  : Gfloat); 
  112.  
  113.    ------------ 
  114.    -- Fields -- 
  115.    ------------ 
  116.  
  117.    function Get_Adjustment 
  118.       (Progress : access Gtk_Progress_Record) 
  119.        return Gtk.Adjustment.Gtk_Adjustment; 
  120.  
  121.    function Get_Activity_Mode 
  122.       (Progress : access Gtk_Progress_Record) return Guint; 
  123.  
  124.    ---------------- 
  125.    -- Interfaces -- 
  126.    ---------------- 
  127.    --  This class implements several interfaces. See Glib.Types 
  128.    -- 
  129.    --  - "Buildable" 
  130.  
  131.    package Implements_Buildable is new Glib.Types.Implements 
  132.      (Gtk.Buildable.Gtk_Buildable, Gtk_Progress_Record, Gtk_Progress); 
  133.    function "+" 
  134.      (Widget : access Gtk_Progress_Record'Class) 
  135.    return Gtk.Buildable.Gtk_Buildable 
  136.    renames Implements_Buildable.To_Interface; 
  137.    function "-" 
  138.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  139.    return Gtk_Progress 
  140.    renames Implements_Buildable.To_Object; 
  141.  
  142.    ---------------- 
  143.    -- Properties -- 
  144.    ---------------- 
  145.    --  The following properties are defined for this widget. See 
  146.    --  Glib.Properties for more information on properties) 
  147.    -- 
  148.    --  Name: Activity_Mode_Property 
  149.    --  Type: Boolean 
  150.    --  Flags: read-write 
  151.    -- 
  152.    --  Name: Show_Text_Property 
  153.    --  Type: Boolean 
  154.    --  Flags: read-write 
  155.    -- 
  156.    --  Name: Text_Xalign_Property 
  157.    --  Type: Gfloat 
  158.    --  Flags: read-write 
  159.    -- 
  160.    --  Name: Text_Yalign_Property 
  161.    --  Type: Gfloat 
  162.    --  Flags: read-write 
  163.  
  164.    Activity_Mode_Property : constant Glib.Properties.Property_Boolean; 
  165.    Show_Text_Property : constant Glib.Properties.Property_Boolean; 
  166.    Text_Xalign_Property : constant Glib.Properties.Property_Float; 
  167.    Text_Yalign_Property : constant Glib.Properties.Property_Float; 
  168.  
  169. private 
  170.    Activity_Mode_Property : constant Glib.Properties.Property_Boolean := 
  171.      Glib.Properties.Build ("activity-mode"); 
  172.    Show_Text_Property : constant Glib.Properties.Property_Boolean := 
  173.      Glib.Properties.Build ("show-text"); 
  174.    Text_Xalign_Property : constant Glib.Properties.Property_Float := 
  175.      Glib.Properties.Build ("text-xalign"); 
  176.    Text_Yalign_Property : constant Glib.Properties.Property_Float := 
  177.      Glib.Properties.Build ("text-yalign"); 
  178. end Gtk.Progress;