1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --      Copyright (C) 2000 E. Briot, J. Brobecker and A. Charlet     -- 
  5. --                Copyright (C) 2000-2006 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. -- 
  32. --  This package implements a high-level, general purpose plotting widget. 
  33. --  You can display any set of data (set of points, curve defined by a 
  34. --  parametric function, ...). This widget can automatically display them 
  35. --  as a curve, along with labelled axis, axis tic marks, legends,... 
  36. -- 
  37. --  This is the base class, that provides 2D graphics. Some children provide 
  38. --  polar-coordinates and 3D graphics in addition. 
  39. -- 
  40. --  It fully supports the drag-and-drop protocol for all of its children, 
  41. --  which means that the user can interactively move them in the Gtk_Plot 
  42. --  area. 
  43. -- 
  44. --  A Gtk_Plot is closely associated with a Gdk_Drawable, on which all the 
  45. --  drawings are done. It can be done anywhere within that drawable, its 
  46. --  "position" is indicated by a tuple (X, Y), which are two values between 
  47. --  0.0 and 1.0 (from left to right, or from top to bottom). 
  48. --  Its size is also given as a ratio other the drawable's size. 
  49. -- 
  50. --  Most points in the plot have also this relative coordinates systems, which 
  51. --  makes it really easy to handle resizing of a plot window. 
  52. -- 
  53. --  See the package Gtk.Extra.Plot_Ps for a way to easily print a Gtk_Plot to 
  54. --  a postscript file. 
  55. -- 
  56. --  In this package, font parameters are sometimes required. Here is the 
  57. --  list of possible fonts used by Gtk.Extra: 
  58. -- 
  59. --   - "Times-Roman", 
  60. --   - "Times-Italic", 
  61. --   - "Times-Bold", 
  62. --   - "Times-BoldItalic", 
  63. --   - "AvantGarde-Book", 
  64. --   - "AvantGarde-BookOblique", 
  65. --   - "AvantGarde-Demi", 
  66. --   - "AvantGarde-DemiOblique", 
  67. --   - "Bookman-Light", 
  68. --   - "Bookman-LightItalic", 
  69. --   - "Bookman-Demi", 
  70. --   - "Bookman-DemiItalic", 
  71. --   - "Courier", 
  72. --   - "Courier-Oblique", 
  73. --   - "Courier-Bold", 
  74. --   - "Courier-BoldOblique", 
  75. --   - "Helvetica", 
  76. --   - "Helvetica-Oblique", 
  77. --   - "Helvetica-Bold", 
  78. --   - "Helvetica-BoldOblique", 
  79. --   - "Helvetica-Narrow", 
  80. --   - "Helvetica-Narrow-Oblique", 
  81. --   - "Helvetica-Narrow-Bold", 
  82. --   - "Helvetica-Narrow-BoldOblique", 
  83. --   - "NewCenturySchoolbook-Roman", 
  84. --   - "NewCenturySchoolbook-Italic", 
  85. --   - "NewCenturySchoolbook-Bold", 
  86. --   - "NewCenturySchoolbook-BoldItalic", 
  87. --   - "Palatino-Roman", 
  88. --   - "Palatino-Italic", 
  89. --   - "Palatino-Bold", 
  90. --   - "Palatino-BoldItalic", 
  91. --   - "Symbol", 
  92. --   - "ZapfChancery-MediumItalic", 
  93. --   - "ZapfDingbats", 
  94. -- 
  95. --  </description> 
  96. --  <c_version>gtkextra 2.1.1</c_version> 
  97. --  <group>Plotting Data</group> 
  98. --  <testgtk>create_plot.adb</testgtk> 
  99. --  <screenshot>gtk-plot</screenshot> 
  100.  
  101. with System; 
  102. with Gdk.Color; 
  103. with Gdk.Drawable; 
  104. with Gdk.Pixmap; 
  105. with Gdk.Rectangle; 
  106. with Gtk.Enums; 
  107. with Gtk.Extra.Plot_Data;   use Gtk.Extra.Plot_Data; 
  108. with Gtk.Object; 
  109. with Gtk.Widget; 
  110.  
  111. package Gtk.Extra.Plot is 
  112.  
  113.    type Gtk_Plot_Record is new Gtk.Widget.Gtk_Widget_Record with private; 
  114.    type Gtk_Plot is access all Gtk_Plot_Record'Class; 
  115.  
  116.    type Gtk_Plot_Axis_Record is new Gtk.Object.Gtk_Object_Record with private; 
  117.    type Gtk_Plot_Axis is access all Gtk_Plot_Axis_Record'Class; 
  118.    --  One of the axis of the plot. 
  119.    --  There are up to six axis for each plot, one on each side. They can have 
  120.    --  ticks, labels, etc. 
  121.  
  122.    type Gtk_Plot_Text is new Gdk.C_Proxy; 
  123.    --  A text that can be displayed anywhere on the plot. 
  124.  
  125.    type Gtk_Plot_Line is new Gdk.C_Proxy; 
  126.    --  A simple line drawn on the plot. 
  127.  
  128.    type Gtk_Plot_Symbol is new Gdk.C_Proxy; 
  129.    type Gtk_Plot_Tick   is new Gdk.C_Proxy; 
  130.    type Gtk_Plot_Ticks  is new Gdk.C_Proxy; 
  131.  
  132.    type Plot_Vector is record 
  133.       X, Y, Z : Gdouble; 
  134.    end record; 
  135.  
  136.    ---------------- 
  137.    -- Enum types -- 
  138.    ---------------- 
  139.  
  140.    type Plot_Border_Style is 
  141.      (Border_None, 
  142.       --  No border is drawn 
  143.  
  144.       Border_Line, 
  145.       --  A simple line on each side 
  146.  
  147.       Border_Shadow 
  148.       --  The right and bottom lines are 
  149.       --  thicker 
  150.      ); 
  151.    --  Border types used for legends. 
  152.    pragma Convention (C, Plot_Border_Style); 
  153.  
  154.    --     subtype Plot_Scale        is Gtk.Extra.Plot_Data.Plot_Scale; 
  155.    --     subtype Plot_Label_Style  is Gtk.Extra.Plot_Data.Plot_Label_Style; 
  156.    --     subtype Plot_Symbol_Style is Gtk.Extra.Plot_Data.Plot_Symbol_Style; 
  157.    --     subtype Plot_Symbol_Type  is Gtk.Extra.Plot_Data.Plot_Symbol_Type; 
  158.    --     subtype Plot_Line_Style   is Gtk.Extra.Plot_Data.Plot_Line_Style; 
  159.    --     subtype Plot_Connector    is Gtk.Extra.Plot_Data.Plot_Connector; 
  160.  
  161.    --  In C, these types are declared in gtkplot.h. However, because of type 
  162.    --  circularity, we need to define them in Gtk.Extra.Plot_Data, and have 
  163.    --  subtypes here. This would lead to unnecessary required qualification in 
  164.    --  user code though... 
  165.  
  166.    type Plot_Label_Pos is new Integer; 
  167.    --  Position of labels along an axis. 
  168.  
  169.    Label_None   : constant Plot_Label_Pos; 
  170.    Label_In     : constant Plot_Label_Pos; 
  171.    Label_Out    : constant Plot_Label_Pos; 
  172.  
  173.    type Plot_Error is (Error_Div_Zero, Error_Log_Neg); 
  174.    --  Errors that can be encountered while calculating a graph. 
  175.    pragma Convention (C, Plot_Error); 
  176.  
  177.    type Plot_Axis_Pos is (Axis_Left, Axis_Right, Axis_Top, Axis_Bottom); 
  178.    --  Where the axis should be put 
  179.    pragma Convention (C, Plot_Axis_Pos); 
  180.  
  181.    type Plot_Orientation is (Axis_X, Axis_Y, Axis_Z); 
  182.    --  How to reference axis in 3D plots 
  183.    pragma Convention (C, Plot_Orientation); 
  184.  
  185.    type Plot_Ticks_Pos is new Integer; 
  186.    --  The position and orientation of the ticks along an axis. 
  187.    --  See the constants below for the possible values. 
  188.    --  Note also that not all the values are valid with all types of axis. 
  189.  
  190.    Ticks_None  : constant Plot_Ticks_Pos; 
  191.    Ticks_In    : constant Plot_Ticks_Pos; 
  192.    Ticks_Out   : constant Plot_Ticks_Pos; 
  193.  
  194.    --------------------- 
  195.    -- Creating a plot -- 
  196.    --------------------- 
  197.  
  198.    procedure Gtk_New 
  199.      (Plot     : out Gtk_Plot; 
  200.       Drawable : Gdk.Drawable.Gdk_Drawable := Gdk.Drawable.Null_Drawable); 
  201.    --  Create a new plot, that will be displayed in Drawable. 
  202.    --  All the dataset, labels, axis,... associated with the plot will be drawn 
  203.    --  in that drawable, which must have been created beforehand. 
  204.    --  Note that the drawable can also be set later with Set_Drawable. 
  205.  
  206.    procedure Gtk_New 
  207.      (Plot     : out Gtk_Plot; 
  208.       Width    : Gdouble; 
  209.       Height   : Gdouble; 
  210.       Drawable : Gdk.Drawable.Gdk_Drawable := Gdk.Drawable.Null_Drawable); 
  211.    --  Create a new plot with a specific size. 
  212.  
  213.    procedure Initialize 
  214.      (Plot     : access Gtk_Plot_Record'Class; 
  215.       Drawable : Gdk.Drawable.Gdk_Drawable); 
  216.    --  Internal initialization function. 
  217.    --  See the section "Creating your own widgets" in the documentation. 
  218.  
  219.    procedure Initialize 
  220.      (Plot     : access Gtk_Plot_Record'Class; 
  221.       Drawable : Gdk.Drawable.Gdk_Drawable; 
  222.       Width    : Gdouble; 
  223.       Height   : Gdouble); 
  224.    --  Internal initialization function. 
  225.    --  See the section "Creating your own widgets" in the documentation. 
  226.  
  227.    function Get_Type return Gtk.Gtk_Type; 
  228.    --  Return the internal value associated with a Gtk_Plot. 
  229.  
  230.    procedure Set_Drawable 
  231.      (Plot     : access Gtk_Plot_Record; 
  232.       Drawable : Gdk.Drawable.Gdk_Drawable); 
  233.    --  Modify the drawable on which the graphs are displayed. 
  234.    --  From now on, all the drawings will be done on that drawable. Note that 
  235.    --  they are not automatically copied to the new Drawable until the Plot 
  236.    --  needs to be redrawn. 
  237.  
  238.    function Get_Drawable 
  239.      (Plot : access Gtk_Plot_Record) return Gdk.Drawable.Gdk_Drawable; 
  240.    --  Return the drawable on which the graphs are plotted. 
  241.  
  242.    procedure Set_Background 
  243.      (Plot       : access Gtk_Plot_Record; 
  244.       Background : Gdk.Color.Gdk_Color); 
  245.    --  Change the background for the plot. 
  246.    --  Note that this has no effect if the plot has been set to transparent 
  247.    --  (see the flags below). 
  248.    --  The Plot is also redrawn as soon as you modify this color. 
  249.  
  250.    procedure Set_Background_Pixmap 
  251.      (Plot : access Gtk_Plot_Record; Pixmap : Gdk.Pixmap.Gdk_Pixmap); 
  252.    --  Specificy a background pixmap to use for the plot 
  253.  
  254.    procedure Set_Transparent 
  255.      (Plot : access Gtk_Plot_Record; Transparent : Boolean); 
  256.    --  Whether the plot is transparent. If Transparent is True, all background 
  257.    --  attributes are ignored (pixmap, color,...) 
  258.  
  259.    function Is_Transparent (Plot : access Gtk_Plot_Record) return Boolean; 
  260.    --  Whether the plot is current transparent 
  261.  
  262.    procedure Paint (Plot : access Gtk_Plot_Record); 
  263.    --  Force an immediate repaint of the widget in its pixmap. 
  264.    --  The modification won't appear on the screen until you call Refresh. 
  265.    --  It is probably not a good idea to call this function directly, and it 
  266.    --  is more efficient to queue a draw request (see the Gtk.Widget package 
  267.    --  for related functions). 
  268.  
  269.    procedure Refresh 
  270.      (Plot : access Gtk_Plot_Record; 
  271.       Area : Gdk.Rectangle.Gdk_Rectangle); 
  272.    --  Copy the plot's pixmap to the screen. 
  273.    --  The same comment as for Paint applies here, and you probably don't 
  274.    --  have to call this function yourself, since queuing a draw request is 
  275.    --  more efficient. 
  276.  
  277.    ---------------------------- 
  278.    --  Coordinates and sizes -- 
  279.    ---------------------------- 
  280.  
  281.    procedure Get_Position 
  282.      (Plot : access Gtk_Plot_Record; 
  283.       X    : out Gdouble; 
  284.       Y    : out Gdouble); 
  285.    --  Return the position of the Plot within its drawable. 
  286.    --  X and Y are in the range 0.0 .. 1.0, where (0.0, 0.0) is the top-left 
  287.    --  corner and (1.0, 1.0) the bottom-right corner. The position can be 
  288.    --  modified by Move below. 
  289.  
  290.    procedure Get_Size 
  291.      (Plot   : access Gtk_Plot_Record; 
  292.       Width  : out Gdouble; 
  293.       Height : out Gdouble); 
  294.    --  Return the size of the Plot. 
  295.    --  Width and Height are both in the range 0.0 .. 1.0, where 1.0 means they 
  296.    --  occupy all the space available in the Drawable, 0.5 means they only 
  297.    --  occupy half of it. 
  298.  
  299.    function Get_Internal_Allocation 
  300.      (Plot : access Gtk_Plot_Record) return Gtk.Widget.Gtk_Allocation; 
  301.    --  Return the real position/size of the plot inside its parent container. 
  302.    --  You should use this function instead of converting yourself the result 
  303.    --  of Get_Position and Get_Size. 
  304.  
  305.    procedure Set_Magnification 
  306.      (Plot          : access Gtk_Plot_Record; 
  307.       Magnification : Gdouble); 
  308.    --  Change the magnification level of the plot. 
  309.    --  1.0 is the default magnification, higher values will zoom in while lower 
  310.    --  values will zoom out. 
  311.  
  312.    procedure Move 
  313.      (Plot : access Gtk_Plot_Record; 
  314.       X    : Gdouble; 
  315.       Y    : Gdouble); 
  316.    --  Move the plot widget inside its drawable. 
  317.    --  X and Y should both be in the range 0.0 .. 1.0 (from top-left corner 
  318.    --  to bottom-right corner). 
  319.  
  320.    procedure Resize 
  321.      (Plot   : access Gtk_Plot_Record; 
  322.       Width  : Gdouble; 
  323.       Height : Gdouble); 
  324.    --  Resize the widget. 
  325.    --  Width and Height should both be in the range 0.0 .. 1.0, this indicates 
  326.    --  which ratio of the drawable's screen real-estate they should use. 
  327.  
  328.    procedure Move_Resize 
  329.      (Plot   : access Gtk_Plot_Record; 
  330.       X      : Gdouble; 
  331.       Y      : Gdouble; 
  332.       Width  : Gdouble; 
  333.       Height : Gdouble); 
  334.    --  Move and resize the widget in a single operation. 
  335.    --  This is faster than doing each operation separately. 
  336.  
  337.    procedure Get_Pixel 
  338.      (Plot : access Gtk_Plot_Record; 
  339.       Xx   : Gdouble; 
  340.       Yy   : Gdouble; 
  341.       X    : out Gdouble; 
  342.       Y    : out Gdouble); 
  343.    --  Get the screen coordinate (relative to Plot's parent) of a point. 
  344.    --  The initial coordinates (Xx, Yy) should be in the range 0.0 .. 1.0. 
  345.  
  346.    procedure Clip_Data (Plot : access Gtk_Plot_Record; Clip : Boolean); 
  347.    --  If Clip is True, any drawing of a Gtk_Plot_Data will be limited to the 
  348.    --  area occupied by Plot. Otherwise, it might draw outside of Plot. 
  349.  
  350.    procedure Get_Point 
  351.      (Plot : access Gtk_Plot_Record; 
  352.       X    : Gint; 
  353.       Y    : Gint; 
  354.       Xx   : out Gdouble; 
  355.       Yy   : out Gdouble); 
  356.    --  Convert from an absolute screen coordinate to a relative one. 
  357.    --  (X, Y) should be relative to Plot's parent. 
  358.    --  This function is the opposite of Get_Pixel. 
  359.  
  360.    procedure Set_Xrange 
  361.      (Plot : access Gtk_Plot_Record; 
  362.       Xmin : Gdouble := 0.0; 
  363.       Xmax : Gdouble := 1.0); 
  364.    --  Set the range of visible points for this plot. 
  365.    --  Only the points of the graph those coordinates are in the range 
  366.    --  Xmin .. Xmax will be visible. 
  367.  
  368.    procedure Set_Yrange 
  369.      (Plot : access Gtk_Plot_Record; 
  370.       Ymin : Gdouble := 0.0; 
  371.       Ymax : Gdouble := 1.0); 
  372.    --  Set the range of visible points for this plot. 
  373.    --  Only the points of the graph those coordinates are in the range 
  374.    --  Xmin .. Xmax will be visible. 
  375.  
  376.    procedure Set_Range 
  377.      (Plot : access Gtk_Plot_Record; 
  378.       Xmin : Gdouble := 0.0; 
  379.       Xmax : Gdouble := 1.0; 
  380.       Ymin : Gdouble := 0.0; 
  381.       Ymax : Gdouble := 1.0); 
  382.    --  Set both ranges at the same time 
  383.  
  384.    procedure Autoscale (Plot : access Gtk_Plot_Record); 
  385.    --  Calculate automically the appropriate ranges for the plot. 
  386.  
  387.    procedure Get_Xrange 
  388.      (Plot : access Gtk_Plot_Record; 
  389.       Xmin : out Gdouble; 
  390.       Xmax : out Gdouble); 
  391.    --  Get the current range for the X axis. 
  392.  
  393.    procedure Get_Yrange 
  394.      (Plot : access Gtk_Plot_Record; 
  395.       Ymin : out Gdouble; 
  396.       Ymax : out Gdouble); 
  397.    --  Get the current range for the X axis. 
  398.  
  399.    procedure Set_Xscale 
  400.      (Plot       : access Gtk_Plot_Record; 
  401.       Scale_Type : Plot_Scale); 
  402.    --  Set the type of the X axis (logarithmic, linear, ...). 
  403.  
  404.    procedure Set_Yscale 
  405.      (Plot       : access Gtk_Plot_Record; 
  406.       Scale_Type : Plot_Scale); 
  407.    --  Set the type of the Y axis (logarithmic, linear, ...). 
  408.  
  409.    function Get_Xscale 
  410.      (Plot : access Gtk_Plot_Record) return Plot_Scale; 
  411.    --  Get the type of the X axis. 
  412.  
  413.    function Get_Yscale 
  414.      (Plot : access Gtk_Plot_Record) return Plot_Scale; 
  415.    --  Get the type of the Y axis. 
  416.  
  417.    procedure Reflect_X (Plot : access Gtk_Plot_Record; Reflect : Boolean); 
  418.    --  Reverse the direction of the X axis 
  419.  
  420.    function Is_X_Reflected (Plot : access Gtk_Plot_Record) return Boolean; 
  421.    --  Whether the X axis is currently reflected 
  422.  
  423.    procedure Reflect_Y (Plot : access Gtk_Plot_Record; Reflect : Boolean); 
  424.    --  Reverse the direction of the Y axis 
  425.  
  426.    function Is_Y_Reflected (Plot : access Gtk_Plot_Record) return Boolean; 
  427.    --  Whether the Y axis is currently reflected 
  428.  
  429.    ---------- 
  430.    -- Text -- 
  431.    ---------- 
  432.  
  433.    function Put_Text 
  434.      (Plot          : access Gtk_Plot_Record; 
  435.       X             : Gdouble; 
  436.       Y             : Gdouble; 
  437.       Font          : String := ""; 
  438.       Font_Height   : Gint := 10; 
  439.       Angle         : Plot_Angle; 
  440.       Foreground    : Gdk.Color.Gdk_Color := Gdk.Color.Null_Color; 
  441.       Background    : Gdk.Color.Gdk_Color := Gdk.Color.Null_Color; 
  442.       Transparent   : Boolean := False; 
  443.       Justification : Gtk.Enums.Gtk_Justification := Gtk.Enums.Justify_Center; 
  444.       Text          : String := "") return Gtk_Plot_Text; 
  445.    --  Print some text in Plot. 
  446.    --  The text will be drawn at the relative coordinates (X, Y), with a 
  447.    --  specified Angle. 
  448.    --  If Font is the empty string, a default font and default Font_Height 
  449.    --  will be used. Likewise, default colors will be used if you don't 
  450.    --  specify any. Font should be the name of a postscript font, the list of 
  451.    --  which can be found in Gtk.Plot.Psfont. 
  452.    --  If Transparent is True, then no background will be drawn for the text. 
  453.  
  454.    procedure Remove_Text 
  455.      (Plot : access Gtk_Plot_Record; 
  456.       Text : Gtk_Plot_Text); 
  457.    --  Remove some text that is currently visible on the plot. 
  458.    --  Nothing is done if Text is currently not visible. 
  459.  
  460.    procedure Text_Get_Area 
  461.      (Text          : Gtk_Plot_Text; 
  462.       Angle         : Plot_Angle; 
  463.       Just          : Gtk.Enums.Gtk_Justification; 
  464.       Font_Name     : String; 
  465.       Font_Size     : Gint; 
  466.       X             : out Gint; 
  467.       Y             : out Gint; 
  468.       Width         : out Gint; 
  469.       Height        : out Gint); 
  470.    --  Return the area currently occupied by a text. 
  471.    --  The coordinates are relative to the top-left corner of the plot in 
  472.    --  which the text was put. 
  473.  
  474.    procedure Text_Get_Size 
  475.      (Text          : Gtk_Plot_Text; 
  476.       Angle         : Plot_Angle; 
  477.       Font_Name     : String; 
  478.       Font_Size     : Gint; 
  479.       Width         : out Gint; 
  480.       Height        : out Gint; 
  481.       Ascent        : out Gint; 
  482.       Descent       : out Gint); 
  483.    --  Return the size in pixels occupied by a text in the plot. 
  484.    --  See Gtk.Extra.Plot_Canvas for a function that returns a Gtk_Plot_Text. 
  485.  
  486.    procedure Text_Set_Attributes 
  487.      (Text          : Gtk_Plot_Text; 
  488.       Font          : String; 
  489.       Height        : Gint; 
  490.       Angle         : Plot_Angle; 
  491.       Fg            : Gdk.Color.Gdk_Color; 
  492.       Bg            : Gdk.Color.Gdk_Color; 
  493.       Transparent   : Boolean := False; 
  494.       Justification : Gtk.Enums.Gtk_Justification := Gtk.Enums.Justify_Center; 
  495.       Str           : String := ""); 
  496.    --  Change the attributes of Text. 
  497.  
  498.    procedure Text_Set_Border 
  499.      (Text         : Gtk_Plot_Text; 
  500.       Border       : Plot_Border_Style; 
  501.       Border_Space : Gint; 
  502.       Border_Width : Gint; 
  503.       Shadow_Width : Gint); 
  504.    --  Set the border attributes for the text 
  505.  
  506.    procedure Draw_Text 
  507.      (Plot : access Gtk_Plot_Record; 
  508.       Text : Gtk_Plot_Text); 
  509.    --  Draw the text 
  510.  
  511.    ----------- 
  512.    -- Lines -- 
  513.    ----------- 
  514.  
  515.    procedure Draw_Line 
  516.      (Plot           : access Gtk_Plot_Record; 
  517.       Line           : Gtk_Plot_Line; 
  518.       X1, Y1, X2, Y2 : Gdouble); 
  519.    --  Draw a line on the plot 
  520.  
  521.    procedure Set_Line_Attributes 
  522.      (Plot : access Gtk_Plot_Record; 
  523.       Line : Gtk_Plot_Line); 
  524.  
  525.    ---------- 
  526.    -- Axis -- 
  527.    ---------- 
  528.    --  A Gtk_Plot has four axis, one one each of its sides. These axis can 
  529.    --  have ticks, labels for ticks, titles, ... associated with them. 
  530.  
  531.    procedure Set_Ticks 
  532.      (Plot        : access Gtk_Plot_Record; 
  533.       Orientation : Plot_Orientation; 
  534.       Major_Step  : Gdouble; 
  535.       Num_Minor   : Gint); 
  536.    --  Set up ticks for a specific orientation. 
  537.    --  A horizontal orientation will match the left and right sides, whereas 
  538.    --  a vertical orientation will match the top and bottom sides. 
  539.    --  Major_Step is a value between 0.0 and 1.0 which indicates the 
  540.    --  proportion of the total axis length between successive big ticks. 
  541.    --  For instance, if Major_Step has a value of 0.2, there will be 5 big 
  542.    --  ticks drawn along the axis. 
  543.    --  Num_Minor is the number of minor ticks between each major one. 
  544.  
  545.    procedure Set_Major_Ticks 
  546.      (Plot        : access Gtk_Plot_Record; 
  547.       Orientation : Plot_Orientation; 
  548.       Major_Step  : Gdouble); 
  549.    --  Modify the step for major ticks. 
  550.    --  Major_Step is a value between 0.0 and 1.0 which indicates the 
  551.    --  proportion of the total axis length between successive big ticks. 
  552.    --  For instance, if Major_Step has a value of 0.2, there will be 5 big 
  553.    --  ticks drawn along the axis. 
  554.    --  See also Set_Ticks. 
  555.  
  556.    procedure Set_Minor_Ticks 
  557.      (Plot        : access Gtk_Plot_Record; 
  558.       Orientation : Plot_Orientation; 
  559.       Num_Minor   : Gint); 
  560.    --  Modify the number of minor ticks between each major one. 
  561.    --  See also Axis_Set_Ticks. 
  562.  
  563.    procedure Set_Ticks_Limits 
  564.      (Plot        : access Gtk_Plot_Record; 
  565.       Orientation : Plot_Orientation; 
  566.       Ticks_Begin : Gdouble; 
  567.       Ticks_End   : Gdouble); 
  568.    --  Indicate the area of the axis that should have ticks. 
  569.    --  Ticks will be displayed only from Ticks_Beg to Ticks_End. 
  570.  
  571.    procedure Unset_Ticks_Limits 
  572.      (Plot        : access Gtk_Plot_Record; 
  573.       Orientation : Plot_Orientation); 
  574.    --  Cancel the ticks limits set by a previous call to 
  575.    --  Axis_Set_Ticks_Limits. 
  576.  
  577.    procedure Set_Break 
  578.      (Plot         : access Gtk_Plot_Record; 
  579.       Orient       : Plot_Orientation; 
  580.       Min, Max     : Gdouble; 
  581.       Step_After   : Gdouble; 
  582.       Nminor_After : Gint; 
  583.       Scale_After  : Plot_Scale; 
  584.       Pos          : Gdouble); 
  585.    --  ??? 
  586.  
  587.    procedure Remove_Break 
  588.      (Plot : access Gtk_Plot_Record; Orient : Plot_Orientation); 
  589.    --  ??? 
  590.  
  591.    procedure Gtk_New 
  592.      (Axis        : out Gtk_Plot_Axis; 
  593.       Orientation : Plot_Orientation); 
  594.    --  Create a new axis 
  595.  
  596.    procedure Initialize 
  597.      (Axis        : access Gtk_Plot_Axis_Record'Class; 
  598.       Orientation : Plot_Orientation); 
  599.    --  Internal initialization function. 
  600.    --  See the section "Creating your own widgets" in the documentation. 
  601.  
  602.    function Axis_Get_Type return Gtk_Type; 
  603.    --  Return the internal value associated with a Gtk_Plot_Axis. 
  604.  
  605.    function Get_Axis 
  606.      (Plot   : access Gtk_Plot_Record; 
  607.       Axis   : Plot_Axis_Pos) return Gtk_Plot_Axis; 
  608.    --  Get a pointer to an axis. 
  609.  
  610.    function Gradient 
  611.      (Data : access Gtk_Plot_Data_Record'Class) return Gtk_Plot_Axis; 
  612.    --  Return the gradient associated with Data. 
  613.    -- 
  614.    --  This function cannot be defined in Gtk.Plot_Data, since Gtk_Plot_Axis 
  615.    --  must be defined in the same package as its primitive operations, ie 
  616.    --  Gtk.Plot 
  617.  
  618.    procedure Axis_Set_Visible 
  619.      (Axis    : access Gtk_Plot_Axis_Record; 
  620.       Visible : Boolean); 
  621.    --  Indicate whether the axis should be visible or not. 
  622.  
  623.    function Axis_Visible 
  624.      (Axis    : access Gtk_Plot_Axis_Record) return Boolean; 
  625.    --  Return the visibility state of the axis 
  626.  
  627.    procedure Axis_Set_Title 
  628.      (Axis  : access Gtk_Plot_Axis_Record; 
  629.       Title : String); 
  630.    --  Modify the title of the axis. 
  631.    --  Each axis has a title that is displayed along its line (vertically 
  632.    --  for the left and right sides). 
  633.  
  634.    procedure Axis_Show_Title 
  635.      (Axis : access Gtk_Plot_Axis_Record); 
  636.    --  Show the title associated with the axis. 
  637.  
  638.    procedure Axis_Hide_Title 
  639.      (Axis : access Gtk_Plot_Axis_Record); 
  640.    --  Hide the title associated with the axis. 
  641.  
  642.    procedure Axis_Move_Title 
  643.      (Axis  : access Gtk_Plot_Axis_Record; 
  644.       Angle : Plot_Angle; 
  645.       X     : Gdouble; 
  646.       Y     : Gdouble); 
  647.    --  Modify the position and orientation of the axis' title. 
  648.    --  X and Y indicate a position relative to the location of the axis (0.0 
  649.    --  to display it to the left (resp. top) of the axis, 1.0 to display it 
  650.    --  to the right (resp. bottom) of the axis. 
  651.  
  652.    procedure Axis_Justify_Title 
  653.      (Axis          : access Gtk_Plot_Axis_Record; 
  654.       Justification : Gtk.Enums.Gtk_Justification); 
  655.    --  Modify the justification for the axis. 
  656.  
  657.    procedure Axis_Set_Attributes 
  658.      (Axis  : access Gtk_Plot_Axis_Record; 
  659.       Width : Gfloat; 
  660.       Color : Gdk.Color.Gdk_Color); 
  661.    --  Modify the attributes of the lines of the axis. 
  662.  
  663.    procedure Axis_Get_Attributes 
  664.      (Axis  : access Gtk_Plot_Axis_Record; 
  665.       Width : out    Gfloat; 
  666.       Color : out    Gdk.Color.Gdk_Color); 
  667.    --  Get the attributes of the axis. 
  668.  
  669.    procedure Axis_Set_Ticks 
  670.      (Axis        : access Gtk_Plot_Axis_Record; 
  671.       Major_Step  : Gdouble; 
  672.       Num_Minor   : Gint); 
  673.    --  Set up ticks for a specific orientation. 
  674.    --  A horizontal orientation will match the left and right sides, whereas 
  675.    --  a vertical orientation will match the top and bottom sides. 
  676.    --  Major_Step is a value between 0.0 and 1.0 which indicates the 
  677.    --  proportion of the total axis length between successive big ticks. 
  678.    --  For instance, if Major_Step has a value of 0.2, there will be 5 big 
  679.    --  ticks drawn along the axis. 
  680.  
  681.    procedure Axis_Set_Major_Ticks 
  682.      (Axis        : access Gtk_Plot_Axis_Record; 
  683.       Major_Step  : Gdouble); 
  684.    --  Modify the step for major ticks. 
  685.    --  Major_Step is a value between 0.0 and 1.0 which indicates the 
  686.    --  proportion of the total axis length between successive big ticks. 
  687.    --  For instance, if Major_Step has a value of 0.2, there will be 5 big 
  688.    --  ticks drawn along the axis. 
  689.    --  See also Axis_Set_Ticks. 
  690.  
  691.    procedure Axis_Set_Minor_Ticks 
  692.      (Axis        : access Gtk_Plot_Axis_Record; 
  693.       Num_Minor   : Gint); 
  694.    --  Modify the number of minor ticks between each major one. 
  695.    --  See also Axis_Set_Ticks. 
  696.  
  697.    procedure Axis_Set_Ticks_Length 
  698.      (Axis   : access Gtk_Plot_Axis_Record; 
  699.       Length : Gint); 
  700.    --  Set the length (in pixels) of the big ticks. 
  701.    --  The small ticks will have half this length. 
  702.  
  703.    procedure Axis_Set_Ticks_Width 
  704.      (Axis  : access Gtk_Plot_Axis_Record; 
  705.       Width : Gfloat); 
  706.    --  Set the width (in pixels) of the ticks. 
  707.    --  This width is common to both the long and short ticks. 
  708.  
  709.    procedure Axis_Show_Ticks 
  710.      (Axis       : access Gtk_Plot_Axis_Record; 
  711.       Major_Mask : Plot_Ticks_Pos; 
  712.       Minor_Mask : Plot_Ticks_Pos); 
  713.    --  Set the style of the ticks. 
  714.  
  715.    procedure Axis_Set_Ticks_Limits 
  716.      (Axis        : access Gtk_Plot_Axis_Record; 
  717.       Ticks_Begin : Gdouble; 
  718.       Ticks_End   : Gdouble); 
  719.    --  Indicate the area of the axis that should have ticks. 
  720.    --  Ticks will be displayed only from Ticks_Beg to Ticks_End. 
  721.  
  722.    procedure Axis_Unset_Ticks_Limits 
  723.      (Axis        : access Gtk_Plot_Axis_Record); 
  724.    --  Cancel the ticks limits set by a previous call to 
  725.    --  Axis_Set_Ticks_Limits. 
  726.  
  727.    procedure Axis_Set_Break 
  728.      (Axis         : access Gtk_Plot_Axis_Record; 
  729.       Min, Max     : Gdouble; 
  730.       Step_After   : Gdouble; 
  731.       Nminor_After : Gint; 
  732.       Scale_After  : Plot_Scale; 
  733.       Pos          : Gdouble); 
  734.    --  ??? 
  735.  
  736.    procedure Axis_Remove_Break (Axis : access Gtk_Plot_Axis_Record); 
  737.    --  ??? 
  738.  
  739.    procedure Axis_Show_Labels 
  740.      (Axis        : access Gtk_Plot_Axis_Record; 
  741.       Labels_Mask : Plot_Label_Pos); 
  742.    --  Indicate whether a label should be drawn at each ticks to indicate 
  743.    --  its value. 
  744.    --  Not all values of Labels_Mask are relevant for all axis. For instance, 
  745.    --  for a vertical axis, the relevant values are Axis_Right and Axis_Left. 
  746.  
  747.    procedure Axis_Title_Set_Attributes 
  748.      (Axis          : access Gtk_Plot_Axis_Record; 
  749.       Font          : String; 
  750.       Height        : Gint; 
  751.       Angle         : Plot_Angle; 
  752.       Foreground    : Gdk.Color.Gdk_Color; 
  753.       Background    : Gdk.Color.Gdk_Color; 
  754.       Transparent   : Boolean; 
  755.       Justification : Gtk.Enums.Gtk_Justification); 
  756.    --  Set the attributes to be used for the title of the axis. 
  757.    --  Font is a postscript font name (as listed in the beginning of this 
  758.    --  package). 
  759.  
  760.    procedure Axis_Set_Labels_Attributes 
  761.      (Axis          : access Gtk_Plot_Axis_Record; 
  762.       Font          : String; 
  763.       Height        : Gint; 
  764.       Angle         : Plot_Angle; 
  765.       Foreground    : Gdk.Color.Gdk_Color; 
  766.       Background    : Gdk.Color.Gdk_Color; 
  767.       Transparent   : Boolean; 
  768.       Justification : Gtk.Enums.Gtk_Justification); 
  769.    --  Set the attributes to be used for the ticks labels. 
  770.  
  771.    procedure Axis_Set_Labels_Offset 
  772.      (Axis   : access Gtk_Plot_Axis_Record; 
  773.       Offset : Gint); 
  774.    --  Set the distance between the axis and its labels 
  775.  
  776.    function Axis_Get_Labels_Offset 
  777.      (Axis : access Gtk_Plot_Axis_Record) return Gint; 
  778.    --  Get the distance between the axis and its labels. 
  779.  
  780.    procedure Axis_Set_Labels_Style 
  781.      (Axis      : access Gtk_Plot_Axis_Record; 
  782.       Style     : Plot_Label_Style; 
  783.       Precision : Gint); 
  784.    --  Set the style of labels. 
  785.    --  This indicates whether the labels should be displayed as floating 
  786.    --  point values or in the scientific notation. 
  787.    --  Precision is the number of digits to be printed. 
  788.  
  789.    procedure Axis_Use_Custom_Tick_Labels 
  790.      (Axis   : access Gtk_Plot_Axis_Record; 
  791.       Custom : Boolean := True); 
  792.    --  Indicate which kind of labels should be used for major ticks. 
  793.    --  If Custom is True, then the labels set by Axis_Set_Tick_Labels will 
  794.    --  be used. 
  795.  
  796.    procedure Axis_Set_Labels_Suffix 
  797.      (Axis : access Gtk_Plot_Axis_Record; 
  798.       Text : String); 
  799.    --  Defines a suffix to add after each label on the axis 
  800.  
  801.    procedure Axis_Set_Labels_Prefix 
  802.      (Axis : access Gtk_Plot_Axis_Record; 
  803.       Text : String); 
  804.    --  Defines a prefix to add before each label on the axis 
  805.  
  806.    function Axis_Get_Labels_Suffix 
  807.      (Axis : access Gtk_Plot_Axis_Record) return String; 
  808.    --  Return the suffix added to each label. 
  809.  
  810.    function Axis_Get_Labels_Prefix 
  811.      (Axis : access Gtk_Plot_Axis_Record) return String; 
  812.    --  Return the prefix added to each label. 
  813.  
  814.    procedure Axis_Ticks_Recalc (Axis : access Gtk_Plot_Axis_Record); 
  815.  
  816.    function Axis_Ticks_Transform 
  817.      (Axis : access Gtk_Plot_Axis_Record; 
  818.       Y    : Gdouble) return Gdouble; 
  819.  
  820.    function Axis_Ticks_Inverse 
  821.      (Axis : access Gtk_Plot_Axis_Record; 
  822.       X    : Gdouble) return Gdouble; 
  823.  
  824.    procedure Axis_Parse_Label 
  825.      (Axis      : access Gtk_Plot_Axis_Record; 
  826.       Val       : Gdouble; 
  827.       Precision : Gint; 
  828.       Style     : Gint; 
  829.       Label     : String); 
  830.  
  831.    ----------- 
  832.    -- Grids -- 
  833.    ----------- 
  834.    --  A grid can be displayed in the graph. 
  835.    --  This makes it easier to understand a graphics in some situations. 
  836.    --  The grid has two simultaneous line styles, each with its own specific 
  837.    --  step (minor and major steps). 
  838.    -- 
  839.    --  There are two special lines in the grid, that you can display even if 
  840.    --  you don't display the rest of the line. These are the origin of the 
  841.    --  coordinates system, ie the lines at X=0 and Y=0. 
  842.  
  843.    procedure X0_Set_Visible 
  844.      (Plot    : access Gtk_Plot_Record; 
  845.       Visible : Boolean); 
  846.    --  Indicate whether the line at X=0 should be displayed. 
  847.  
  848.    function X0_Visible 
  849.      (Plot : access Gtk_Plot_Record) return Boolean; 
  850.    --  Return the visibility state of the line at X=0 
  851.  
  852.    procedure Y0_Set_Visible 
  853.      (Plot    : access Gtk_Plot_Record; 
  854.       Visible : Boolean); 
  855.    --  Indicate whether the line at Y=0 should be displayed. 
  856.  
  857.    function Y0_Visible 
  858.      (Plot   : access Gtk_Plot_Record) return Boolean; 
  859.    --  Return the visibility state of the line at Y=0 
  860.  
  861.    procedure X0line_Set_Attributes 
  862.      (Plot  : access Gtk_Plot_Record; 
  863.       Style : Plot_Line_Style; 
  864.       Width : Gfloat; 
  865.       Color : Gdk.Color.Gdk_Color); 
  866.    --  Set the attributes of the line at X=0 
  867.  
  868.    procedure Y0line_Set_Attributes 
  869.      (Plot  : access Gtk_Plot_Record; 
  870.       Style : Plot_Line_Style; 
  871.       Width : Gfloat; 
  872.       Color : Gdk.Color.Gdk_Color); 
  873.    --  Set the attributes of the line at Y=0 
  874.  
  875.    procedure Grids_Set_On_Top 
  876.      (Plot : access Gtk_Plot_Record; On_Top : Boolean); 
  877.    --  Whether the grid should be displayed on top of the plots 
  878.  
  879.    function Grids_On_Top (Plot : access Gtk_Plot_Record) return Boolean; 
  880.    --  Whether the gris is currently displayed on top of the plots 
  881.  
  882.    procedure Grids_Set_Visible 
  883.      (Plot   : access Gtk_Plot_Record; 
  884.       Vmajor : Boolean; 
  885.       Vminor : Boolean; 
  886.       Hmajor : Boolean; 
  887.       Hminor : Boolean); 
  888.    --  Indicate whether the lines of the grids should be displayed. 
  889.    --  You can decide separately whether the major and minor lines should 
  890.    --  be displayed. 
  891.  
  892.    procedure Grids_Visible 
  893.      (Plot   : access Gtk_Plot_Record; 
  894.       Vmajor : out Boolean; 
  895.       Vminor : out Boolean; 
  896.       Hmajor : out Boolean; 
  897.       Hminor : out Boolean); 
  898.    --  Return the visibility state of the grid. 
  899.  
  900.    procedure Major_Hgrid_Set_Attributes 
  901.      (Plot  : access Gtk_Plot_Record; 
  902.       Style : Plot_Line_Style; 
  903.       Width : Gfloat; 
  904.       Color : Gdk.Color.Gdk_Color); 
  905.    --  Set the attributes for the major horizontal lines in the grid. 
  906.  
  907.    procedure Major_Vgrid_Set_Attributes 
  908.      (Plot  : access Gtk_Plot_Record; 
  909.       Style : Plot_Line_Style; 
  910.       Width : Gfloat; 
  911.       Color : Gdk.Color.Gdk_Color); 
  912.    --  Set the attributes for the major vertical lines in the grid. 
  913.  
  914.    procedure Minor_Hgrid_Set_Attributes 
  915.      (Plot  : access Gtk_Plot_Record; 
  916.       Style : Plot_Line_Style; 
  917.       Width : Gfloat; 
  918.       Color : Gdk.Color.Gdk_Color); 
  919.    --  Set the attributes for the minor horizontal lines in the grid. 
  920.  
  921.    procedure Minor_Vgrid_Set_Attributes 
  922.      (Plot  : access Gtk_Plot_Record; 
  923.       Style : Plot_Line_Style; 
  924.       Width : Gfloat; 
  925.       Color : Gdk.Color.Gdk_Color); 
  926.    --  Set the attributes for the minor vertical lines in the grid. 
  927.  
  928.    ------------- 
  929.    -- Legends -- 
  930.    ------------- 
  931.    --  Each graph is associated with one legend, that is supposed to 
  932.    --  indicate what the plot represents. 
  933.  
  934.    procedure Show_Legends (Plot : access Gtk_Plot_Record); 
  935.    --  Indicate that the legend should be displayed. 
  936.  
  937.    procedure Hide_Legends (Plot : access Gtk_Plot_Record); 
  938.    --  Indicate that the legend should not be displayed. 
  939.  
  940.    procedure Set_Legends_Border 
  941.      (Plot         : access Gtk_Plot_Record; 
  942.       Border       : Plot_Border_Style; 
  943.       Shadow_Width : Gint); 
  944.    --  Modify the way the borders of the legend look like. 
  945.  
  946.    procedure Legends_Move 
  947.      (Plot : access Gtk_Plot_Record; 
  948.       X    : Gdouble; 
  949.       Y    : Gdouble); 
  950.    --  Move the legend relative to the widget's area. 
  951.    --  X and Y are percentage values. (0.0, 0.0) indicates the top-left 
  952.    --  corner of the plot, (1.0, 1.0) indicates the bottom-right corner. 
  953.  
  954.    procedure Legends_Get_Position 
  955.      (Plot : access Gtk_Plot_Record; 
  956.       X    : out Gdouble; 
  957.       Y    : out Gdouble); 
  958.    --  Return the current position of the legend. 
  959.  
  960.    function Legends_Get_Allocation 
  961.      (Plot   : access Gtk_Plot_Record) return Gtk.Widget.Gtk_Allocation; 
  962.    --  Return the exact coordinates and size in pixels of the legend. 
  963.    --  The coordinates are relative to the widget's parent container. 
  964.  
  965.    procedure Legends_Set_Attributes 
  966.      (Plot       : access Gtk_Plot_Record; 
  967.       Ps_Font    : String; 
  968.       Height     : Gint; 
  969.       Foreground : Gdk.Color.Gdk_Color; 
  970.       Background : Gdk.Color.Gdk_Color); 
  971.    --  Set the attributes to use when displaying the legend. 
  972.  
  973.    -------------- 
  974.    -- Datasets -- 
  975.    -------------- 
  976.    --  A dataset is a set of points, either given explicitly by your 
  977.    --  application or calculated with a specific function, and that can be 
  978.    --  plotted on the screen. 
  979.    --  In Gtk_Plot, such a set is represented with symbols (special points in 
  980.    --  the graph, that can be manipulated interactively if you so wish), linked 
  981.    --  by connectors, which are either straight lines, splines, sets, ... 
  982.    --  Multiple data sets can of course be printed on a single graph. 
  983.  
  984.    --  <doc_ignore> 
  985.    generic 
  986.       with function Func (Plot  : access Gtk_Plot_Record'Class; 
  987.                           Set   : in     Gtk_Plot_Data; 
  988.                           X     : in     Gdouble; 
  989.                           Error : access Boolean) 
  990.                          return Gdouble; 
  991.    function Generic_Plot_Function (Plot  : System.Address; 
  992.                                    Set   : Gtk_Plot_Data; 
  993.                                    X     : Gdouble; 
  994.                                    Error : access Gboolean) 
  995.                                   return Gdouble; 
  996.    --  Generic function that can be instantiated for Plot_Function below. 
  997.    --  </doc_ignore> 
  998.  
  999.    --  <doc_ignore> 
  1000.    generic 
  1001.       with function Func (Plot  : access Gtk_Plot_Record'Class; 
  1002.                           Set   : in     Gtk_Plot_Data; 
  1003.                           X     : in     Gdouble; 
  1004.                           Y     : in     Gdouble; 
  1005.                           Error : access Boolean) 
  1006.                          return Gdouble; 
  1007.    function Generic_Plot3D_Function (Plot  : System.Address; 
  1008.                                      Set   : Gtk_Plot_Data; 
  1009.                                      X     : Gdouble; 
  1010.                                      Y     : Gdouble; 
  1011.                                      Error : access Gboolean) 
  1012.                                     return Gdouble; 
  1013.    --  Generic function that can be instanciated for Plot3D_Function below. 
  1014.    --  </doc_ignore> 
  1015.  
  1016.    type Plot3D_Function is access function 
  1017.      (Plot  : System.Address; 
  1018.       Set   : Gtk_Plot_Data; 
  1019.       X     : Gdouble; 
  1020.       Y     : Gdouble; 
  1021.       Error : access Gboolean) return Gdouble; 
  1022.    --  Function used for plotting 3D graphs. 
  1023.    --  It should return the value associated with (X, Y) in its graph, and set 
  1024.    --  Error to True if there was an error while calculating the value. 
  1025.  
  1026.    pragma Convention (C, Generic_Plot_Function); 
  1027.    pragma Convention (C, Generic_Plot3D_Function); 
  1028.    pragma Convention (C, Plot3D_Function); 
  1029.  
  1030.    procedure Add_Data 
  1031.      (Plot : access Gtk_Plot_Record; 
  1032.       Data : access Gtk_Plot_Data_Record'Class); 
  1033.    --  Add an existing set of data to the plot. 
  1034.    --  This set will automatically be drawn the next time the Plot itself is 
  1035.    --  drawn. 
  1036.  
  1037.    function Remove_Data 
  1038.      (Plot : access Gtk_Plot_Record; 
  1039.       Data : access Gtk_Plot_Data_Record'Class) 
  1040.       return Boolean; 
  1041.    --  Remove the dataset from Plot. 
  1042.    --  This function returns True if the dataset was indeed found and could be 
  1043.    --  removed, False otherwise. 
  1044.  
  1045.    function Add_Function 
  1046.      (Plot   : access Gtk_Plot_Record; 
  1047.       Func   : Plot_Function) 
  1048.       return  Gtk_Plot_Data; 
  1049.    --  Allocate a new dataset, whose point are automatically calculated. 
  1050.    --  Func is a function that takes the X coordinate value, and should return 
  1051.    --  the Y coordinate value. 
  1052.    --  The newly allocated set should be freed by calling Free above. 
  1053.    --  The set is automatically added to the plot, so you don't need to 
  1054.    --  explicitly call Add_Dataset. 
  1055.  
  1056.    ------------- 
  1057.    -- Signals -- 
  1058.    ------------- 
  1059.  
  1060.    --  <signals> 
  1061.    --  The following new signals are defined for this widget: 
  1062.    -- 
  1063.    --  - "changed" 
  1064.    --    procedure Handler (Plot : access Gtk_Plot_Record'Class); 
  1065.    -- 
  1066.    --    Called every time some property of the widget is changed, or the 
  1067.    --    widget is moved or resized. 
  1068.    -- 
  1069.    --  - "moved" 
  1070.    --    function Handler (Plot : access Gtk_Plot_Record'Class; 
  1071.    --                      X    : Gdouble; 
  1072.    --                      Y    : Gdouble) 
  1073.    --                     return Boolean; 
  1074.    -- 
  1075.    --    Called when the widget has been moved relative to its drawable. 
  1076.    --    Its new position is given in parameters. 
  1077.    -- 
  1078.    --  - "resized" 
  1079.    --    function Handler (Plot   : access Gtk_Plot_Record'Class; 
  1080.    --                      Width  : Gdouble; 
  1081.    --                      Height : Gdouble) 
  1082.    --                     return Boolean; 
  1083.    -- 
  1084.    --    Called when the widget has been resized relative to its drawable. 
  1085.    --    Its new size is given in parameters. 
  1086.    -- 
  1087.    --  - "tick_label" 
  1088.    --    function Handler (Axis  : access Gtk_Plot_Axis_Record'Class; 
  1089.    --                      Tick  : Gdouble_Access; 
  1090.    --                      Label : Interfaces.C.Strings.chars_ptr) 
  1091.    --                     return Boolean; 
  1092.    -- 
  1093.    --     Called when a label should be drawn. You can modify the contents 
  1094.    --     of Label (up to 100 characters) a 
  1095.    -- 
  1096.    --  </signals> 
  1097.  
  1098. private 
  1099.    type Gtk_Plot_Record is new Gtk.Widget.Gtk_Widget_Record with null record; 
  1100.    type Gtk_Plot_Axis_Record is new Gtk.Object.Gtk_Object_Record with 
  1101.      null record; 
  1102.  
  1103.    Label_None   : constant Plot_Label_Pos := 0; 
  1104.    Label_In     : constant Plot_Label_Pos := 1; 
  1105.    Label_Out    : constant Plot_Label_Pos := 2; 
  1106.  
  1107.    Ticks_None  : constant Plot_Ticks_Pos := 0; 
  1108.    Ticks_In    : constant Plot_Ticks_Pos := 1; 
  1109.    Ticks_Out   : constant Plot_Ticks_Pos := 2; 
  1110.  
  1111.    pragma Import (C, Get_Type, "gtk_plot_get_type"); 
  1112.    pragma Import (C, Axis_Get_Type, "gtk_plot_axis_get_type"); 
  1113.    pragma Import (C, Text_Set_Border, "gtk_plot_text_set_border"); 
  1114. end Gtk.Extra.Plot; 
  1115.  
  1116. --  Unbound: 
  1117. --    gtk_plot_set_pc 
  1118. --    gtk_plot_axis_set_tick_labels 
  1119. --    gtk_plot_axis_ticks_autoscale