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-2009, 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 from 
  33. --  Gtk_Misc, it can be padded and/or aligned, to fill exactly the space you 
  34. --  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. --  </description> 
  39. --  <c_version>2.14</c_version> 
  40. --  <testgtk>create_arrow.adb</testgtk> 
  41. --  <screenshot>gtk-arrow</screenshot> 
  42.  
  43. with Glib.Properties; 
  44. with Gtk.Enums; 
  45. with Gtk.Misc; 
  46.  
  47. package Gtk.Arrow is 
  48.  
  49.    type Gtk_Arrow_Record is new Gtk.Misc.Gtk_Misc_Record with private; 
  50.    type Gtk_Arrow is access all Gtk_Arrow_Record'Class; 
  51.  
  52.    procedure Gtk_New 
  53.      (Arrow       : out Gtk_Arrow; 
  54.       Arrow_Type  : Gtk.Enums.Gtk_Arrow_Type; 
  55.       Shadow_Type : Gtk.Enums.Gtk_Shadow_Type); 
  56.    --  Create a new arrow widget. 
  57.  
  58.    procedure Initialize 
  59.      (Arrow       : access Gtk_Arrow_Record'Class; 
  60.       Arrow_Type  : Gtk.Enums.Gtk_Arrow_Type; 
  61.       Shadow_Type : Gtk.Enums.Gtk_Shadow_Type); 
  62.    --  Internal initialization function. 
  63.    --  See the section "Creating your own widgets" in the documentation. 
  64.  
  65.    function Get_Type return Gtk.Gtk_Type; 
  66.    --  Return the internal value associated with a Gtk_Arrow. 
  67.  
  68.    procedure Set 
  69.      (Arrow       : access Gtk_Arrow_Record; 
  70.       Arrow_Type  : Gtk.Enums.Gtk_Arrow_Type; 
  71.       Shadow_Type : Gtk.Enums.Gtk_Shadow_Type); 
  72.    --  Set the direction and style of the Arrow. 
  73.  
  74.    ---------------- 
  75.    -- Properties -- 
  76.    ---------------- 
  77.  
  78.    --  <properties> 
  79.    --  The following properties are defined for this widget. See 
  80.    --  Glib.Properties for more information on properties. 
  81.    -- 
  82.    --  Name:  Arrow_Type_Property 
  83.    --  Type:  Gtk_Arrow_Type 
  84.    --  Flags: read-write 
  85.    --  Descr: The direction the arrow should point 
  86.    --  See also: Set 
  87.    -- 
  88.    --  Name:  Shadow_Type_Property 
  89.    --  Type:  Gtk_Shadow_Type 
  90.    --  Flags: read-write 
  91.    --  Descr: Appearance of the shadow surrounding the arrow 
  92.    --  See also: Set 
  93.    -- 
  94.    --  Name:  Arrow_Scaling_Property 
  95.    --  Type:  Float 
  96.    --  Descr: Amount of space used up by arrow 
  97.    -- 
  98.    --  </properties> 
  99.  
  100.    Arrow_Scaling_Property : constant Glib.Properties.Property_Float; 
  101.    Arrow_Type_Property : constant Gtk.Enums.Property_Gtk_Arrow_Type; 
  102.    Shadow_Type_Property : constant Gtk.Enums.Property_Gtk_Shadow_Type; 
  103.  
  104.    ------------- 
  105.    -- Signals -- 
  106.    ------------- 
  107.  
  108.    --  <signals> 
  109.    --  The following new signals are defined for this widget: 
  110.    --  </signals> 
  111.  
  112. private 
  113.    type Gtk_Arrow_Record is new Gtk.Misc.Gtk_Misc_Record with null record; 
  114.  
  115.    Arrow_Scaling_Property : constant Glib.Properties.Property_Float := 
  116.      Glib.Properties.Build ("arrow-scaling"); 
  117.    Arrow_Type_Property : constant Gtk.Enums.Property_Gtk_Arrow_Type := 
  118.      Gtk.Enums.Build ("arrow_type"); 
  119.    Shadow_Type_Property : constant Gtk.Enums.Property_Gtk_Shadow_Type := 
  120.      Gtk.Enums.Build ("shadow_type"); 
  121.  
  122.    pragma Import (C, Get_Type, "gtk_arrow_get_type"); 
  123. end Gtk.Arrow;