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