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. -- -- -- -- -- -- -- -- -- -- -- --
  22. ----------------------------------------------------------------------- 
  23.  
  24. --  <description> 
  25. --  A special kind of child that can be put in a Gtk_Plot_Canvas. 
  26. --  </description> 
  27. --  <c_version>gtkextra 2.1.1</c_version> 
  28. --  <group>Plotting Data</group> 
  29.  
  30. with Gtk.Extra.Plot; 
  31. with Gtk.Extra.Plot_Data; 
  32.  
  33. package Gtk.Extra.Plot_Canvas.Plot is 
  34.  
  35.    type Gtk_Plot_Canvas_Plot_Record is new Gtk_Plot_Canvas_Child_Record 
  36.      with private; 
  37.    type Gtk_Plot_Canvas_Plot is access all Gtk_Plot_Canvas_Plot_Record'Class; 
  38.  
  39.    type Plot_Canvas_Plot_Pos is 
  40.      (Plot_Out, 
  41.       Plot_In_Plot, 
  42.       Plot_In_Legends, 
  43.       Plot_In_Title, 
  44.       Plot_In_Axis, 
  45.       Plot_In_Data, 
  46.       Plot_In_Gradient, 
  47.       Plot_In_Marker); 
  48.    --  The various parts of a plot in which a user can click 
  49.  
  50.    procedure Gtk_New 
  51.      (Child    : out Gtk_Plot_Canvas_Plot; 
  52.       Plot     : access Gtk.Extra.Plot.Gtk_Plot_Record'Class); 
  53.    --  Create a new plot child, wrapping Plot 
  54.  
  55.    function Get_Pos 
  56.      (Child : access Gtk_Plot_Canvas_Plot_Record) return Plot_Canvas_Plot_Pos; 
  57.    --  Return the position in the plot where the user has last clicked 
  58.  
  59.    function Get_Data 
  60.      (Child : access Gtk_Plot_Canvas_Plot_Record) 
  61.       return Gtk.Extra.Plot_Data.Gtk_Plot_Data; 
  62.    --  Return the data associated with Child 
  63.  
  64.    function Get_Datapoint 
  65.      (Child : access Gtk_Plot_Canvas_Plot_Record) return Gint; 
  66.    --  Return the point in the plot data that was selected by the user 
  67.  
  68.    type Plot_Canvas_Plot_Flags is mod 2 ** 8; 
  69.    Flags_Select_Point : constant Plot_Canvas_Plot_Flags := 2 ** 0; 
  70.    Flags_Dnd_Point    : constant Plot_Canvas_Plot_Flags := 2 ** 1; 
  71.    --  Flags specific to a Gtk_Plot_Canvas_Plot 
  72.  
  73.    procedure Set_Flags 
  74.      (Child : access Gtk_Plot_Canvas_Plot_Record; 
  75.       Flags : Plot_Canvas_Plot_Flags); 
  76.    procedure Unset_Flags 
  77.      (Child : access Gtk_Plot_Canvas_Plot_Record; 
  78.       Flags : Plot_Canvas_Plot_Flags); 
  79.    --  Set or Unset specific flags from Child 
  80.  
  81. private 
  82.    pragma Convention (C, Plot_Canvas_Plot_Pos); 
  83.  
  84.    type Gtk_Plot_Canvas_Plot_Record is new Gtk_Plot_Canvas_Child_Record 
  85.      with null record; 
  86. end Gtk.Extra.Plot_Canvas.Plot;