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