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