1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --                Copyright (C) 2000-2006 AdaCore                    -- 
  5. --                                                                   -- 
  6. -- This library is free software; you can redistribute it and/or     -- 
  7. -- modify it under the terms of the GNU General Public               -- 
  8. -- License as published by the Free Software Foundation; either      -- 
  9. -- version 2 of the License, or (at your option) any later version.  -- 
  10. --                                                                   -- 
  11. -- This library is distributed in the hope that it will be useful,   -- 
  12. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  13. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  14. -- General Public License for more details.                          -- 
  15. --                                                                   -- 
  16. -- You should have received a copy of the GNU General Public         -- 
  17. -- License along with this library; if not, write to the             -- 
  18. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  19. -- Boston, MA 02111-1307, USA.                                       -- 
  20. --                                                                   -- 
  21. -- As a special exception, if other files instantiate generics from  -- 
  22. -- this unit, or you link this unit with other files to produce an   -- 
  23. -- executable, this  unit  does not  by itself cause  the resulting  -- 
  24. -- executable to be covered by the GNU General Public License. This  -- 
  25. -- exception does not however invalidate any other reasons why the   -- 
  26. -- executable file  might be covered by the  GNU Public License.     -- 
  27. ----------------------------------------------------------------------- 
  28.  
  29. --  <description> 
  30. --  A special kind of child that can be put in a Gtk_Plot_Canvas. 
  31. --  </description> 
  32. --  <c_version>gtkextra 2.1.1</c_version> 
  33. --  <group>Plotting Data</group> 
  34.  
  35. with Gtk.Extra.Plot; 
  36. with Gtk.Extra.Plot_Data; 
  37.  
  38. package Gtk.Extra.Plot_Canvas.Plot is 
  39.  
  40.    type Gtk_Plot_Canvas_Plot_Record is new Gtk_Plot_Canvas_Child_Record 
  41.      with private; 
  42.    type Gtk_Plot_Canvas_Plot is access all Gtk_Plot_Canvas_Plot_Record'Class; 
  43.  
  44.    type Plot_Canvas_Plot_Pos is 
  45.      (Plot_Out, 
  46.       Plot_In_Plot, 
  47.       Plot_In_Legends, 
  48.       Plot_In_Title, 
  49.       Plot_In_Axis, 
  50.       Plot_In_Data, 
  51.       Plot_In_Gradient, 
  52.       Plot_In_Marker); 
  53.    --  The various parts of a plot in which a user can click 
  54.  
  55.    procedure Gtk_New 
  56.      (Child    : out Gtk_Plot_Canvas_Plot; 
  57.       Plot     : access Gtk.Extra.Plot.Gtk_Plot_Record'Class); 
  58.    --  Create a new plot child, wrapping Plot 
  59.  
  60.    function Get_Pos 
  61.      (Child : access Gtk_Plot_Canvas_Plot_Record) return Plot_Canvas_Plot_Pos; 
  62.    --  Return the position in the plot where the user has last clicked 
  63.  
  64.    function Get_Data 
  65.      (Child : access Gtk_Plot_Canvas_Plot_Record) 
  66.       return Gtk.Extra.Plot_Data.Gtk_Plot_Data; 
  67.    --  Return the data associated with Child 
  68.  
  69.    function Get_Datapoint 
  70.      (Child : access Gtk_Plot_Canvas_Plot_Record) return Gint; 
  71.    --  Return the point in the plot data that was selected by the user 
  72.  
  73.    type Plot_Canvas_Plot_Flags is mod 2 ** 8; 
  74.    Flags_Select_Point : constant Plot_Canvas_Plot_Flags := 2 ** 0; 
  75.    Flags_Dnd_Point    : constant Plot_Canvas_Plot_Flags := 2 ** 1; 
  76.    --  Flags specific to a Gtk_Plot_Canvas_Plot 
  77.  
  78.    procedure Set_Flags 
  79.      (Child : access Gtk_Plot_Canvas_Plot_Record; 
  80.       Flags : Plot_Canvas_Plot_Flags); 
  81.    procedure Unset_Flags 
  82.      (Child : access Gtk_Plot_Canvas_Plot_Record; 
  83.       Flags : Plot_Canvas_Plot_Flags); 
  84.    --  Set or Unset specific flags from Child 
  85.  
  86. private 
  87.    pragma Convention (C, Plot_Canvas_Plot_Pos); 
  88.  
  89.    type Gtk_Plot_Canvas_Plot_Record is new Gtk_Plot_Canvas_Child_Record 
  90.      with null record; 
  91. end Gtk.Extra.Plot_Canvas.Plot;