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. --  GtkArrow should be used to draw simple arrows that need to point in one of 
  26. --  the four cardinal directions (up, down, left, or right). The style of the 
  27. --  arrow can be one of shadow in, shadow out, etched in, or etched out. Note 
  28. --  that these directions and style types may be ammended in versions of GTK+ 
  29. --  to come. 
  30. -- 
  31. --  GtkArrow will fill any space alloted to it, but since it is inherited from 
  32. --  Gtk.Misc.Gtk_Misc, it can be padded and/or aligned, to fill exactly the 
  33. --  space the programmer desires. 
  34. -- 
  35. --  Arrows are created with a call to Gtk.Arrow.Gtk_New. The direction or 
  36. --  style of an arrow can be changed after creation by using Gtk.Arrow.Set. 
  37. -- 
  38. --  </description> 
  39. --  <screenshot>gtk-arrow</screenshot> 
  40. --  <testgtk>create_arrow.adb</testgtk> 
  41. pragma Ada_2005; 
  42.  
  43. pragma Warnings (Off, "*is already use-visible*"); 
  44. with Glib;          use Glib; 
  45. with Glib.Types;    use Glib.Types; 
  46. with Gtk.Buildable; use Gtk.Buildable; 
  47. with Gtk.Enums;     use Gtk.Enums; 
  48. with Gtk.Misc;      use Gtk.Misc; 
  49.  
  50. package Gtk.Arrow is 
  51.  
  52.    type Gtk_Arrow_Record is new Gtk_Misc_Record with null record; 
  53.    type Gtk_Arrow is access all Gtk_Arrow_Record'Class; 
  54.  
  55.    ------------------ 
  56.    -- Constructors -- 
  57.    ------------------ 
  58.  
  59.    procedure Gtk_New 
  60.       (Arrow       : out Gtk_Arrow; 
  61.        Arrow_Type  : Gtk.Enums.Gtk_Arrow_Type; 
  62.        Shadow_Type : Gtk.Enums.Gtk_Shadow_Type); 
  63.    procedure Initialize 
  64.       (Arrow       : not null access Gtk_Arrow_Record'Class; 
  65.        Arrow_Type  : Gtk.Enums.Gtk_Arrow_Type; 
  66.        Shadow_Type : Gtk.Enums.Gtk_Shadow_Type); 
  67.    --  Creates a new Gtk.Arrow.Gtk_Arrow widget. 
  68.    --  "arrow_type": a valid Gtk.Enums.Gtk_Arrow_Type. 
  69.    --  "shadow_type": a valid Gtk.Enums.Gtk_Shadow_Type. 
  70.  
  71.    function Gtk_Arrow_New 
  72.       (Arrow_Type  : Gtk.Enums.Gtk_Arrow_Type; 
  73.        Shadow_Type : Gtk.Enums.Gtk_Shadow_Type) return Gtk_Arrow; 
  74.    --  Creates a new Gtk.Arrow.Gtk_Arrow widget. 
  75.    --  "arrow_type": a valid Gtk.Enums.Gtk_Arrow_Type. 
  76.    --  "shadow_type": a valid Gtk.Enums.Gtk_Shadow_Type. 
  77.  
  78.    function Get_Type return Glib.GType; 
  79.    pragma Import (C, Get_Type, "gtk_arrow_get_type"); 
  80.  
  81.    ------------- 
  82.    -- Methods -- 
  83.    ------------- 
  84.  
  85.    procedure Set 
  86.       (Arrow       : not null access Gtk_Arrow_Record; 
  87.        Arrow_Type  : Gtk.Enums.Gtk_Arrow_Type; 
  88.        Shadow_Type : Gtk.Enums.Gtk_Shadow_Type); 
  89.    --  Sets the direction and style of the Gtk.Arrow.Gtk_Arrow, Arrow. 
  90.    --  "arrow_type": a valid Gtk.Enums.Gtk_Arrow_Type. 
  91.    --  "shadow_type": a valid Gtk.Enums.Gtk_Shadow_Type. 
  92.  
  93.    ---------------- 
  94.    -- Properties -- 
  95.    ---------------- 
  96.    --  The following properties are defined for this widget. See 
  97.    --  Glib.Properties for more information on properties) 
  98.  
  99.    Arrow_Type_Property : constant Gtk.Enums.Property_Gtk_Arrow_Type; 
  100.  
  101.    Shadow_Type_Property : constant Gtk.Enums.Property_Gtk_Shadow_Type; 
  102.  
  103.    ---------------- 
  104.    -- Interfaces -- 
  105.    ---------------- 
  106.    --  This class implements several interfaces. See Glib.Types 
  107.    -- 
  108.    --  - "Buildable" 
  109.  
  110.    package Implements_Gtk_Buildable is new Glib.Types.Implements 
  111.      (Gtk.Buildable.Gtk_Buildable, Gtk_Arrow_Record, Gtk_Arrow); 
  112.    function "+" 
  113.      (Widget : access Gtk_Arrow_Record'Class) 
  114.    return Gtk.Buildable.Gtk_Buildable 
  115.    renames Implements_Gtk_Buildable.To_Interface; 
  116.    function "-" 
  117.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  118.    return Gtk_Arrow 
  119.    renames Implements_Gtk_Buildable.To_Object; 
  120.  
  121. private 
  122.    Shadow_Type_Property : constant Gtk.Enums.Property_Gtk_Shadow_Type := 
  123.      Gtk.Enums.Build ("shadow-type"); 
  124.    Arrow_Type_Property : constant Gtk.Enums.Property_Gtk_Arrow_Type := 
  125.      Gtk.Enums.Build ("arrow-type"); 
  126. end Gtk.Arrow;