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