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