This is gtkada_rm.info, produced by makeinfo version 4.5 from
gtkada_rm.texi.

INFO-DIR-SECTION User Interface Toolkit
START-INFO-DIR-ENTRY
* GtkAda_Rm: (gtkada_rm).           Ada95 graphical tookit based on GTK+ (Reference Manual)
END-INFO-DIR-ENTRY


File: gtkada_rm.info,  Node: Gtk.Extra.Plot_Canvas Signals,  Next: Gtk.Extra.Plot_Canvas Types,  Prev: Gtk.Extra.Plot_Canvas Widget Hierarchy,  Up: Package_Gtk.Extra.Plot_Canvas

Signals
=======

   * "changed"

     procedure Handler (Canvas : access Gtk_Plot_Canvas_Record'Class);
     Called when the contents of the canvas has changed (an item was
     moved interactively by the user).

     A region of the canvas was selected by the user.

   * "delete_item"

     procedure Handler (Canvas : access Gtk_Plot_Canvas_Record'Class;
     Item   : Gtk_Plot_Canvas_Child);
     Called when an item is being removed from the canvas

   * "move_item"

     function Handler (Canvas : access Gtk_Plot_Canvas_Record'Class;
     Item   : Gtk_Plot_Canvas_Child;
     New_X  : Gdouble;
     New_Y  : Gdouble)
     return Boolean;
     An item was moved on the canvas.  Its coordinates have not changed
     yet, but if the handler returns True they will become (New_X,
     New_Y). If the handler returns False, nothing happens.

   * "resize_item"

     function Handler (Canvas     : access Gtk_Plot_Canvas_Record'Class;
     Item       : Gtk_Plot_Canvas_Child;
     New_Width  : Gdouble;
     New_Height : Gdouble)
     return Boolean;
     An item is being resized.  Its size has not changed yet, but if
     the handler returns True it will become (New_Width, New_Height).
     If the handler returns False, nothing happens.

   * "select_item"

     function Handler (Canvas : access Gtk_Plot_Canvas_Record'Class;
     Event  : Gdk_Button_Event;
     Item   : Gtk_Plot_Canvas_Child)
     return Boolean;
     Called when an item was selected.  An item can be anything, from a
     text to a plot When this signal is called, the item was simply
     selected, but not dragged.  The handler should return False if the
     item can not be selected.

   * "select_region"

     procedure Handler (Canvas : access Gtk_Plot_Canvas_Record'Class;
     X_Min  : Gdouble;
     Y_Min  : Gdouble;
     X_Max  : Gdouble;
     Y_Max  : Gdouble);


File: gtkada_rm.info,  Node: Gtk.Extra.Plot_Canvas Types,  Next: Gtk.Extra.Plot_Canvas Subprograms,  Prev: Gtk.Extra.Plot_Canvas Signals,  Up: Package_Gtk.Extra.Plot_Canvas

Types
=====

type Child_Draw_Func is access procedure
         (Canvas : System.Address;
          Child  : Gtk_Plot_Canvas_Child);

Generic format of functions used to draw a child of the canvas.
Canvas is a System.Address since these functions are called directly
from C and GtkAda can't insert its hooks. However, you can use the
Convert function below to convert to a Gtk_Plot_Canvas.
type Gtk_Plot_Canvas_Child is new Gdk.C_Proxy;


type Plot_Canvas_Action is
         (Action_Inactive,
          Action_Selection,
          Action_Drag,
          Action_Resize);

The action being performed on the canvas.     pragma Convention (C,
Plot_Canvas_Action);
type Plot_Canvas_Arrow is new Gint;


type Plot_Canvas_Flag is new Gint;


type Plot_Canvas_Pos is
         (Canvas_Out,
          Canvas_In,
          Canvas_Left,
          Canvas_Right,
          Canvas_Top,
          Canvas_Bottom,
          Canvas_Top_Left,
          Canvas_Top_Right,
          Canvas_Bottom_Left,
          Canvas_Bottom_Right);

The position of the items in the canvas.     pragma Convention (C,
Plot_Canvas_Pos);
type Plot_Canvas_Type is
         (None,
          Plot,
          Axis,
          Legends,
          Title,
          Text,
          Data,
          Line,
          Rectangle,
          Ellipse,
          Custom);

The type of data that can be put in a canvas.   Plot is only for a
Gtk.Extra.Plot.Gtk_Plot widget.     pragma Convention (C,
Plot_Canvas_Type);

File: gtkada_rm.info,  Node: Gtk.Extra.Plot_Canvas Subprograms,  Prev: Gtk.Extra.Plot_Canvas Types,  Up: Package_Gtk.Extra.Plot_Canvas

Subprograms
===========

Creating and manipulating the canvas
------------------------------------

procedure Gtk_New
       (Widget             : out    Gtk_Plot_Canvas;
        Width              : in     Gint;
        Height             : in     Gint;
        Magnification      : in     Gdouble := 1.0);

Create a new Gtk_Plot_Canvas, with a specific screen size.
Since the widget can have an unlimited internal size, it does not try
to set its size to accommodate all of its children.
function Get_Type              return Gtk.Gtk_Type;


Return the internal value associated with a Gtk_Plot_Canvas.
function Child_Get_Type        return Gtk.Gtk_Type;


Return the internal value associated with a Gtk_Plot_Canvas_Child.
procedure Refresh
       (Canvas             : access Gtk_Plot_Canvas_Record);

Force a refresh of the canvas on the screen. The screen is updated from
the contents of the double-buffer.
procedure Paint
       (Canvas             : access Gtk_Plot_Canvas_Record);

Redraw each of the items included in the canvas. The painting is done
in the double-buffer, and must be drawn on the screen with Refresh.
procedure Freeze
       (Canvas             : access Gtk_Plot_Canvas_Record);

Freeze all graphical updates to the screen. This significanly speeds up
the updates to the plot
procedure Thaw
       (Canvas             : access Gtk_Plot_Canvas_Record);

Reactivate all graphical updates to the screen
function Get_Pixmap
       (Canvas             : access Gtk_Plot_Canvas_Record)
        return Gdk.Pixmap.Gdk_Pixmap;

Return the pixmap associated with the Canvas.
If you add your own items on the canvas (see Child_New below), you  can
draw them on this pixmap to make them visible on the canvas. You  need
to call Refresh to send this pixmap to the screen.
procedure Grid_Set_Visible
       (Canvas             : access Gtk_Plot_Canvas_Record;
        Visible            : in     Boolean);

Indicate whether the grid should be visible or not.
procedure Grid_Set_Step
       (Canvas             : access Gtk_Plot_Canvas_Record;
        Step               : in     Gint);

Set the space between two lines of the grid.
procedure Grid_Set_Attributes
       (Canvas             : access Gtk_Plot_Canvas_Record;
        Style              : in     Gtk.Extra.Plot_Data.Plot_Line_Style;
        Width              : in     Gint;
        Color              : in     Gdk.Color.Gdk_Color);

Set the attributes of the grid.
procedure Add_Plot
       (Plot_Canvas        : access Gtk_Plot_Canvas_Record;
        Plot               : access Gtk.Extra.Plot.Gtk_Plot_Record'Class;
        X                  : in     Gdouble;
        Y                  : in     Gdouble);

Add a new plot to the list handled by the canvas.
The canvas will then provide drag-and-drop functionalities for that
plot.   The plot is displayed at the relative screen coordinates (X, Y).
Plot becomes the new active plot, and its associated pixmap becomes the
Plot_Canvas itself.
procedure Set_Active_Plot
       (Plot_Canvas        : access Gtk_Plot_Canvas_Record;
        Plot               : access Gtk.Extra.Plot.Gtk_Plot_Record'Class);

Modify the active plot in the canvas.
The active plot is generally the one that received the last click
event (drag-and-drop, etc.). This should be set before emitting any  of
the signals in this class.
procedure Cancel_Action
       (Plot_Canvas        : access Gtk_Plot_Canvas_Record);

Cancel the current action.
This can be called in the user callbacks to ignore temporarily some of
the signals below.
function Get_Active_Plot
       (Canvas             : access Gtk_Plot_Canvas_Record)
        return Gtk.Extra.Plot.Gtk_Plot;

Return the active plot.
In the callbacks for the signals below, this is the widget that got
the signal.
function Get_Active_Data
       (Canvas             : access Gtk_Plot_Canvas_Record)
        return Gtk.Extra.Plot_Data.Gtk_Plot_Data;

Return the active dataset (which of course belongs to the active plot).
This is the dataset that was last clicked on.
procedure Get_Active_Point
       (Canvas             : access Gtk_Plot_Canvas_Record;
        X                  : out    Gdouble;
        Y                  : out    Gdouble;
        Index              : out    Gint);

Return the relative coordinates of the active point in the
active dataset. Index will contain the index of the active point in the
list of the canvas'children, or -1 if there is no active point.   This
is the index in the coordinates arrays of Get_Active_Data.   This is
the one that was last clicked on.
procedure Set_Size
       (Canvas             : access Gtk_Plot_Canvas_Record;
        Width              : in     Gint;
        Height             : in     Gint);

Modify the size allocated for the canvas, and the size of the pixmap
the plots are displayed on.
procedure Unselect
       (Canvas             : access Gtk_Plot_Canvas_Record);

Unselect the currently selected item.
procedure Set_Magnification
       (Canvas             : access Gtk_Plot_Canvas_Record;
        Magnification      :        Gdouble := 1.0);

Changes the magnification for the canvas.
1.0 is the default value. Higher values will zoom in, while lower values
will zoom out.
procedure Set_Background
       (Canvas             : access Gtk_Plot_Canvas_Record;
        Background         :        Gdk.Color.Gdk_Color);

Set the background color for the canvas.
procedure Set_Transparent
       (Canvas             : access Gtk_Plot_Canvas_Record;
        Transparent        :        Boolean);

Whether the canvas should be transparent. If Transparent is True, all
background attributes are ignored
function Transparent
       (Canvas             : access Gtk_Plot_Canvas_Record)
        return Boolean;

Whether the canvas is currently transparent
procedure Get_Pixel
       (Canvas             : access Gtk_Plot_Canvas_Record;
        Px                 : in     Gdouble;
        Py                 : in     Gdouble;
        X                  : out    Gint;
        Y                  : out    Gint);

Convert from relative coordinates to absolute ones.
procedure Get_Position
       (Canvas             : access Gtk_Plot_Canvas_Record;
        X                  : in     Gint;
        Y                  : in     Gint;
        Px                 : out    Gdouble;
        Py                 : out    Gdouble);

Convert from absolute coordinates to relative ones.
Canvas items
------------

There are several different types of items that can be put on the
canvas, and then manipulated interactively by the user.

function Convert
       (Canvas             :        System.Address)
        return Gtk_Plot_Canvas;

Convert from a System.Address returned by C to a real Gtk_Plot_Canvas
structure.
procedure Set_Draw_Func
       (Child              :        Gtk_Plot_Canvas_Child;
        Draw               :        Child_Draw_Func);

Set the function used to draw the item.
This should be used only for items whose type is Custom, since other
items have their own drawing functions.
function Get_Active_Item
       (Canvas             : access Gtk_Plot_Canvas_Record)
        return Gtk_Plot_Canvas_Child;

Return the currently selected item.
procedure Remove_Child
       (Canvas             : access Gtk_Plot_Canvas_Record;
        Child              :        Gtk_Plot_Canvas_Child);

Remove a child from the canvas
function Put_Text
       (Canvas             : access Gtk_Plot_Canvas_Record;
        X                  : in     Gdouble;
        Y                  : in     Gdouble;
        Ps_Font            : in     String;
        Height             : in     Gint;
        Angle              : in     Gint;
        Fg                 : in     Gdk.Color.Gdk_Color;
        Bg                 : in     Gdk.Color.Gdk_Color;
        Transparent        : in     Boolean;
        Justification      : in     Gtk.Enums.Gtk_Justification;
        Text               : in     String)
        return Gtk_Plot_Canvas_Child;

Put an arbitrary text in the layout.
Ps_Font should be the name of a postscript font.   (X, Y) are the
relative coordinates to which the text should be drawn.   The only
legal values for Angle are 0, 90, 180 and 270 degrees.

   Text can contain some special characters, that change is renderering.
They all begin with a '\' (backslash) character, followed by one of:
   * '0' .. '9' : Change the font (take the nth font in the family

   * 'g' : Select the "Symbol" font

   * 'B' : Activate bold characters.

   * 'i' : Activate italic characters.

   * 'S' or '^' : Activate superscripts.

   * 's' or '_' : Activate subscripts.

   * '+' : Increment the fontsize by 3 pixels.

   * '-' : Decrement the fontsize by 3 pixels.

   * 'N' : Restore the default characteristics of the font.

   * 'b' : Move back one character.

function Put_Line
       (Canvas             : access Gtk_Plot_Canvas_Record;
        X1                 :        Gdouble;
        Y1                 :        Gdouble;
        X2                 :        Gdouble;
        Y2                 :        Gdouble;
        Style              :        Gtk.Extra.Plot_Data.Plot_Line_Style;
        Width              :        Gfloat;
        Color              :        Gdk.Color.Gdk_Color;
        Arrow_Mask         :        Plot_Canvas_Arrow)
        return Gtk_Plot_Canvas_Child;

Draw a line in the background of the canvas.
function Put_Rectangle
       (Canvas             : access Gtk_Plot_Canvas_Record;
        X1                 :        Gdouble;
        Y1                 :        Gdouble;
        X2                 :        Gdouble;
        Y2                 :        Gdouble;
        Style              :        Gtk.Extra.Plot_Data.Plot_Line_Style;
        Width              :        Gfloat;
        Fg                 :        Gdk.Color.Gdk_Color;
        Bg                 :        Gdk.Color.Gdk_Color;
        Border             :        Gtk.Extra.Plot.Plot_Border_Style;
        Fill               :        Boolean := False)
        return Gtk_Plot_Canvas_Child;

Draw a rectangle in the canvas.
function Put_Ellipse
       (Canvas             : access Gtk_Plot_Canvas_Record;
        X1                 :        Gdouble;
        Y1                 :        Gdouble;
        X2                 :        Gdouble;
        Y2                 :        Gdouble;
        Style              :        Gtk.Extra.Plot_Data.Plot_Line_Style;
        Width              :        Gfloat;
        Fg                 :        Gdk.Color.Gdk_Color;
        Bg                 :        Gdk.Color.Gdk_Color;
        Fill               :        Boolean := False)
        return Gtk_Plot_Canvas_Child;

Draw an ellipse in the canvas.
function Put_Pixmap
       (Canvas             : access Gtk_Plot_Canvas_Record;
        Pixmap             :        Gdk.Pixmap.Gdk_Pixmap;
        X1, Y1             :        Gdouble)
        return Gtk_Plot_Canvas_Child;

Draw a pixmap
procedure Line_Set_Attributes
       (Child              :        Gtk_Plot_Canvas_Child;
        Style              :        Gtk.Extra.Plot_Data.Plot_Line_Style;
        Width              :        Gfloat;
        Color              :        Gdk.Color.Gdk_Color;
        Mask               :        Plot_Canvas_Arrow);

Change the attributes of a line.
procedure Rectangle_Set_Attributes
       (Child              :        Gtk_Plot_Canvas_Child;
        Style              :        Gtk.Extra.Plot_Data.Plot_Line_Style;
        Width              :        Gfloat;
        Fg                 :        Gdk.Color.Gdk_Color;
        Bg                 :        Gdk.Color.Gdk_Color;
        Border             :        Gtk.Extra.Plot.Plot_Border_Style;
        Fill               :        Boolean := False);

Change the attributes of a rectangle.
procedure Ellipse_Set_Attributes
       (Child              :        Gtk_Plot_Canvas_Child;
        Style              :        Gtk.Extra.Plot_Data.Plot_Line_Style;
        Width              :        Gfloat;
        Fg                 :        Gdk.Color.Gdk_Color;
        Bg                 :        Gdk.Color.Gdk_Color;
        Fill               :        Boolean := False);

Change the attributes for an ellipse.
Custom children
---------------

You can insert your own items in a canvas.
While the canvas will take care of moving the item, it is your
responsability to provide a visual rendering for it.

function Child_New
       (Child_Type         :        Plot_Canvas_Type := Custom)
        return Gtk_Plot_Canvas_Child;

Create a new child.
procedure Put_Child
       (Canvas             : access Gtk_Plot_Canvas_Record;
        Child              :        Gtk_Plot_Canvas_Child;
        X1                 :        Gdouble;
        Y1                 :        Gdouble;
        X2                 :        Gdouble;
        Y2                 :        Gdouble);

Insert a new item in the canvas. It will occupy the area defined by
the four coordinates.
procedure Child_Move
       (Canvas             : access Gtk_Plot_Canvas_Record;
        Child              :        Gtk_Plot_Canvas_Child;
        X1                 :        Gdouble;
        Y1                 :        Gdouble);

Move an item, but does not change its size.
procedure Child_Move_Resize
       (Canvas             : access Gtk_Plot_Canvas_Record;
        Child              :        Gtk_Plot_Canvas_Child;
        X1                 :        Gdouble;
        Y1                 :        Gdouble;
        X2                 :        Gdouble;
        Y2                 :        Gdouble);

Move an resize an item in the canvas.
function Get_Item_Type
       (Item               :        Gtk_Plot_Canvas_Child)
        return Plot_Canvas_Type;

Return the type of the item.
function Get_Allocation_Width
       (Child              :        Gtk_Plot_Canvas_Child)
        return Guint;

Return the current width of the child.
function Get_Allocation_Height
       (Child              :        Gtk_Plot_Canvas_Child)
        return Guint;

Return the current height of the child.
function Get_Allocation_X
       (Child              :        Gtk_Plot_Canvas_Child)
        return Gint;

Return the current position of the child, relative to its canvas.
function Get_Allocation_Y
       (Child              :        Gtk_Plot_Canvas_Child)
        return Gint;

Return the current position of the child, relative to its canvas.
function Get_Flags
       (Child              :        Gtk_Plot_Canvas_Child)
        return Plot_Canvas_Flag;

Return the list of actions currently possible on the child.
procedure Set_Flags
       (Child              :        Gtk_Plot_Canvas_Child;
        Flags              :        Plot_Canvas_Flag);

Modify the list of actions possible for a child.
Flags
-----

Some flags are defined for this widget. You can not access them through
the usual interface in Gtk.Object.Flag_Is_Set since this widget is not
part of the standard gtk+ packages. Instead, use the functions below.

   * "can_select"    True if it is possible to select a region of the
     canvas

   * "can_select_item"    True if it is possible to select any of the
     item on the canvas.

   * "can_select_point"    True if the individual points in the plots
     can be selected and    interactively moved by the user.

   * "can_dnd"    True if it is possible to drag an item on the canvas.

   * "can_dnd_point"    True if the points of the plots can be moved
     interactively.

function Plot_Canvas_Flag_Is_Set
       (Plot_Canvas        : access Gtk_Plot_Canvas_Record;
        Flag               : in     Guint16)
        return Boolean;

Test whether one of the flags for a Gtk_Plot_Canvas widget or its
children is set.
procedure Plot_Canvas_Set_Flags
       (Plot_Canvas        : access Gtk_Plot_Canvas_Record;
        Flags              : in     Guint16);

Set the flags for a Gtk_Plot_Canvas widget or its children.
Note that the flags currently set are not touched by this function.
This can only be used for the flags defined in the
Gtk.Extra.Gtk_Plot_Canvas package.
procedure Plot_Canvas_Unset_Flags
       (Plot_Canvas        : access Gtk_Plot_Canvas_Record;
        Flags              : in     Guint16);

Unset the flags for a Gtk_Plot_Canvas.

File: gtkada_rm.info,  Node: Package_Gtk.Extra.Plot_Data,  Next: Package_Gtk.Extra.Plot_Polar,  Prev: Package_Gtk.Extra.Plot_Canvas,  Up: Top

Package Gtk.Extra.Plot`_'Data
*****************************

This package defines the root of the plot hierarchy. It defines several
display strategies that can be used to show scientific data on the
screen (see the children for 3D, polar, bars,...)

   All coordinates are in percent of the total size allocates for the
data  set (ie the actual position is (x * width, y * height), where (x,
y) is  the value stored in the data set and (width, height) its
allocated screen  size.

* Menu:

* Gtk.Extra.Plot_Data Widget Hierarchy::
* Gtk.Extra.Plot_Data Types::
* Gtk.Extra.Plot_Data Subprograms::


File: gtkada_rm.info,  Node: Gtk.Extra.Plot_Data Widget Hierarchy,  Next: Gtk.Extra.Plot_Data Types,  Up: Package_Gtk.Extra.Plot_Data

Widget Hierarchy
================

     GObject                       (*note Package_Glib.Object::)
     Gtk_Object                    (*note Package_Gtk.Object::)
        \___ Gtk_Widget            (*note Package_Gtk.Widget::)
           \___ Gtk_Plot_Data      (*note Package_Gtk.Extra.Plot_Data::)


File: gtkada_rm.info,  Node: Gtk.Extra.Plot_Data Types,  Next: Gtk.Extra.Plot_Data Subprograms,  Prev: Gtk.Extra.Plot_Data Widget Hierarchy,  Up: Package_Gtk.Extra.Plot_Data

Types
=====

type Gdouble_Array_Access is access all Glib.Gdouble_Array;


The reason we use this type in the functions below is because
gtk+-extra does not keep a copy of the arrays, but points to the one
given in argument. Thus, the Ada arrays should not be allocated on the
stack, or at least they should be at library level. Using this 'Access
will force the compiler to do the check for us.
type Gtk_Plot_Marker is new Glib.C_Proxy;


type No_Range_Gdouble_Array is array (Natural) of Gdouble;


An array of values.   This is used to represent the data values
displayed in the plot.   This array does not have any range information
(so that it can be  easily returned from a C function, without
requiring an extra  copy of the table). You can not use 'Range on this
array.
type No_Range_Gdouble_Array_Access is access all No_Range_Gdouble_Array;


An access to a flat array.
type Plot_Connector is
         (Connect_None,
             -- No connection
     
          Connect_Straight,
             -- straight line
     
          Connect_Spline,
             -- spline or Bezier curve
     
          Connect_Hv_Step,
             -- Horizontal then vertical
     
          Connect_Vh_Step,
             -- Vertical then horizontal
     
          Connect_Middle_Step
             -- Split in the middle
          );

The type of connection between two adjacent points in a graph.
pragma Convention (C, Plot_Connector);
type Plot_Function is access function
         (Plot  : System.Address;

type Plot_Gradient is new Integer;


Indicate which color components vary along the gradient
type Plot_Label_Style is
         (Label_Float, Label_Exp, Label_Pow);

The style of labels (floating point, or scientific notation)    pragma
Convention (C, Plot_Label_Style);
type Plot_Line_Style is
         (Line_None,
          Line_Solid,
          Line_Dotted,
          Line_Dashed,
          Line_Dot_Dash,
          Line_Dot_Dot_Dash,
          Line_Dot_Dash_Dash);

Lines used to connect two adjacent points in a graph.     pragma
Convention (C, Plot_Line_Style);
type Plot_Scale is
         (Scale_Linear, Scale_Log10);

Type of scale used for each axis of a graph.     pragma Convention (C,
Plot_Scale);
type Plot_Symbol_Style is
         (Symbol_Empty,
          Symbol_Filled,
          Symbol_Opaque);

Style used to draw the points in a graph.     pragma Convention (C,
Plot_Symbol_Style);
type Plot_Symbol_Type is
         (Symbol_None,
          Symbol_Square,
          Symbol_Circle,
          Symbol_Up_Triangle,
          Symbol_Down_Triangle,
          Symbol_Right_Triangle,
          Symbol_Left_Triangle,
          Symbol_Diamond,
          Symbol_Plus,
          Symbol_Cross,
          Symbol_Star,
          Symbol_Dot,
          Symbol_Impulse);

Type of symbol used to represent the points in a graph.     pragma
Convention (C, Plot_Symbol_Type);
type Points_Array is record
         Points     : No_Range_Gdouble_Array_Access;
         Num_Points : Gint := 0;
         end record;

The points are indexed from 0 to Num_Points-1.   Note that you can't
use 'Range, 'First or 'Last on Points.

File: gtkada_rm.info,  Node: Gtk.Extra.Plot_Data Subprograms,  Prev: Gtk.Extra.Plot_Data Types,  Up: Package_Gtk.Extra.Plot_Data

Subprograms
===========

Creating a Data set
-------------------

procedure Gtk_New
       (Data               : out    Gtk_Plot_Data;
        Func               :        Plot_Function := null);

Creates a new data set. Its values can either be generated automatically
from Func, or will have to be set explicitely using the other
subprograms in this package.
function Get_Type              return Gtk.Gtk_Type;


Return the internal value associated with a Gtk_Plot_Data.
procedure Set_Name
       (Data               : access Gtk_Plot_Data_Record;
        Name               :        String);

Set the name used internally for that dataset.
This name does not appear anywhere on the screen, but it is easier to
find the dataset afterward by using this name.
Drawing a set
-------------

Although a set is basically a list of values, it is closely associated
with its representation on the screen (see the children of Gtk_Plot_Data
for various possible representations).   The Gtk.Extra packages are
designed so that the drawing can be done  either to the screen (through
a Gdk adapter), to a postscript file for  easy printing, or to any
other media.

procedure Paint
       (Data               : access Gtk_Plot_Data_Record);

Emits the "draw_data" signal to request a redrawing of the data set.
procedure Update
       (Data               : access Gtk_Plot_Data_Record);

Indicates that the data has changed, and the graphical view should
reflect this.
procedure Draw_Points
       (Data               : access Gtk_Plot_Data_Record;
        N                  :        Gint);

Draw the N last (most recent) values of the Data set on the screen.
If N is greater than the actual number of values in Data, then they are
all displayed. This subprogram should be used when you want to
periodically update the contents of a dataset (you would then modify
the number of points in the dataset with a call to Set_Numpoints, then
register the new points with Set_X and Set_Y, and finally refresh the
dataset with a call to Draw_Points and Gtk.Plot.Refresh).
procedure Draw_Symbol
       (Data               : access Gtk_Plot_Data_Record;
        X, Y               :        Gdouble);

Draw the current symbol (see Set_Symbol) at specific coordinates on
the screen.
Manipulating values
-------------------

procedure Set_Points
       (Data               : access Gtk_Plot_Data_Record;
        X                  :        Gdouble_Array_Access;
        Y                  :        Gdouble_Array_Access;
        Dx                 :        Gdouble_Array_Access;
        Dy                 :        Gdouble_Array_Access);

Set some explicit points in the set.
Note that the set must not be associated with a function, or the points
will simply be ignored.   All of the arrays must have the same length,
the behavior is undefined  otherwise.   X and Y are the list of
coordinates of the points.   Dx and Dy are the list of size (precision)
of these points. A bigger  symbol will be displayed for the point whose
(Dx, Dy) value is bigger.
procedure Get_Points
       (Data               : access Gtk_Plot_Data_Record;
        X                  : out    Points_Array;
        Y                  : out    Points_Array;
        Dx                 : out    Points_Array;
        Dy                 : out    Points_Array);

Return the value of the points in the set.
Null-length arrays are returned if the set is associated with a
function, since no explicit point has been set.   See Set_Points for a
definition of X, Y, Dx and Dy.
procedure Set_X
       (Data               : access Gtk_Plot_Data_Record;
        X                  :        Gdouble_Array_Access);

procedure Set_Z
       (Data               : access Gtk_Plot_Data_Record;
        Z                  :        Gdouble_Array_Access);

procedure Set_A_Scale
       (Data               : access Gtk_Plot_Data_Record;
        A_Scale            :        Gdouble);

procedure Set_Dx
       (Data               : access Gtk_Plot_Data_Record;
        Dx                 :        Gdouble_Array_Access);

procedure Set_Dz
       (Data               : access Gtk_Plot_Data_Record;
        Dz                 :        Gdouble_Array_Access);

Set the precision of the points in the set. A bigger symbol is displayed
for the points whose (Dx, Dy, Dz) is bigger.   The array must have a
length of Get_Numpoints (if GtkAda was  compiled with assertions
enabled, an exception will be raised if the  length are different).
No copy of the array is made for efficiency reasons, thus modifying
the array content later on will also modify the plot.
procedure Set_Da
       (Data               : access Gtk_Plot_Data_Record;
        Da                 :        Gdouble_Array_Access);

Specifies the colors to use for the points.
The color of the symbols is detemined using the gradient. the gradient
has (min, max) values, and corresponding colors. The symbol's color is
interpolated between these values using hue/saturation/value depending
on the gradient_mask.
function Get_X
       (Data               : access Gtk_Plot_Data_Record)
        return Points_Array;

function Get_Z
       (Data               : access Gtk_Plot_Data_Record)
        return Points_Array;

function Get_Dx
       (Data               : access Gtk_Plot_Data_Record)
        return Points_Array;

function Get_Dz
       (Data               : access Gtk_Plot_Data_Record)
        return Points_Array;

procedure Set_Numpoints
       (Data               : access Gtk_Plot_Data_Record;
        Num                :        Gint);

Set the number of points that should be expected in the graph.
Note that this does not automatically resize all the internal structure,
it just indicates what size the parameters to Set_X, Set_Y,... should
have.
function Get_Numpoints
       (Data               : access Gtk_Plot_Data_Record)
        return Gint;

Return the number of points expected in the graph.
Labels
------

Each point in the data set can be associated with a label that describes
it. This is only relevant for data sets where you explicitely give
values, not when the values are generated by a function.

procedure Set_Labels
       (Data               : access Gtk_Plot_Data_Record;
        Labels             :        Gtkada.Types.Chars_Ptr_Array);

Set the labels associated which each point in the canvas.
There must be at least Get_Numpoints elements in Labels, or the
behavior is undefined
function Get_Labels
       (Data               : access Gtk_Plot_Data_Record)
        return Gtkada.Types.Chars_Ptr_Array;

Return the labels associated with the points in the data set.
Note that this returns a *copy* of the actual array, and thus might  be
expensive to call.
procedure Show_Labels
       (Data               : access Gtk_Plot_Data_Record;
        Show               :        Boolean);

Indicate whether the labels should be displayed next to each point in
the data set. This has no effect if no labels were specified.
procedure Labels_Set_Attributes
       (Data               : access Gtk_Plot_Data_Record;
        Font               :        String;
        Height             :        Gint;
        Angle              :        Gint;
        Foreground         :        Gdk.Color.Gdk_Color;
        Background         :        Gdk.Color.Gdk_Color);

Set the properties of the labels
Symbols and Connectors
----------------------

Each point that is explicitely set in the data set through the
Set_X, Set_Y,... subprograms is visually associated with a symbol. There
are several representations for the symbols.

   All these symbols are then connected by a line, a curve or any other
link. These are called connectors.

   Each symbol, in addition to being connected to the next one with a
connector, can also be linked to the axis X=0, Y=0 or Z=0 so that it is
easier to read its coordinates. These are called errbars, and they must
be explicitely shown.

procedure Set_Symbol
       (Data               : access Gtk_Plot_Data_Record;
        The_Type           :        Plot_Symbol_Type;
        Style              :        Plot_Symbol_Style;
        Size               :        Gint;
        Line_Width         :        Gfloat;
        Color              :        Gdk.Color.Gdk_Color;
        Border_Color       :        Gdk.Color.Gdk_Color);

Set the visual aspect of the symbols.
procedure Get_Symbol
       (Data               : access Gtk_Plot_Data_Record;
        The_Type           : out    Plot_Symbol_Type;
        Style              : out    Plot_Symbol_Style;
        Size               : out    Gint;
        Line_Width         : out    Gint;
        Color              : out    Gdk.Color.Gdk_Color;
        Border_Color       : out    Gdk.Color.Gdk_Color);

Return the visual characteristics of the symbols.
procedure Set_Connector
       (Data               : access Gtk_Plot_Data_Record;
        Connector          :        Plot_Connector);

Set the style of the connectors.
function Get_Connector
       (Data               : access Gtk_Plot_Data_Record)
        return Plot_Connector;

Return the connector style used for the data set.
procedure Set_Line_Attributes
       (Data               : access Gtk_Plot_Data_Record;
        Style              :        Plot_Line_Style;
        Cap_Style          :        Gdk.GC.Gdk_Cap_Style;
        Join_Style         :        Gdk.GC.Gdk_Join_Style;
        Width              :        Gfloat;
        Color              :        Gdk.Color.Gdk_Color);

Set the line style used for the connectors.
procedure Get_Line_Attributes
       (Data               : access Gtk_Plot_Data_Record;
        Style              : out    Plot_Line_Style;
        Cap_Style          : out    Gdk.GC.Gdk_Cap_Style;
        Join_Style         : out    Gdk.GC.Gdk_Join_Style;
        Width              : out    Gfloat;
        Color              : out    Gdk.Color.Gdk_Color);

Return the line attributes used for the connectors.
procedure Set_X_Attributes
       (Data               : access Gtk_Plot_Data_Record;
        Style              :        Plot_Line_Style;
        Cap_Style          :        Gdk.GC.Gdk_Cap_Style;
        Join_Style         :        Gdk.GC.Gdk_Join_Style;
        Width              :        Gfloat;
        Color              :        Gdk.Color.Gdk_Color);

Set the style of the lines used to connect the symbols to the X axis.
procedure Set_Y_Attributes
       (Data               : access Gtk_Plot_Data_Record;
        Style              :        Plot_Line_Style;
        Cap_Style          :        Gdk.GC.Gdk_Cap_Style;
        Join_Style         :        Gdk.GC.Gdk_Join_Style;
        Width              :        Gfloat;
        Color              :        Gdk.Color.Gdk_Color);

Set the style of the lines used to connect the symbols to the Y axis.
procedure Set_Z_Attributes
       (Data               : access Gtk_Plot_Data_Record;
        Style              :        Plot_Line_Style;
        Cap_Style          :        Gdk.GC.Gdk_Cap_Style;
        Join_Style         :        Gdk.GC.Gdk_Join_Style;
        Width              :        Gfloat;
        Color              :        Gdk.Color.Gdk_Color);

Set the style of the lines used to connect the symbols to the Z axis.
procedure Show_Xerrbars
       (Data               : access Gtk_Plot_Data_Record);

procedure Show_Zerrbars
       (Data               : access Gtk_Plot_Data_Record);

Indicate that each symbol should be connected to the various axis
procedure Hide_Xerrbars
       (Data               : access Gtk_Plot_Data_Record);

procedure Hide_Zerrbars
       (Data               : access Gtk_Plot_Data_Record);

Indicate the the symbol should not be connected to the axis.
procedure Fill_Area
       (Data               : access Gtk_Plot_Data_Record;
        Fill               :        Boolean);

Indicate whether the area between two points should be filled or not.
function Area_Is_Filled
       (Data               : access Gtk_Plot_Data_Record)
        return Boolean;

Indicate whether the area between two points is filled.
Legends
-------

In addition to the drawing corresponding to the data set, it is possible
to display a box that contains a legend. This is particulary useful when
multiple data sets are displayed on the same plot.

procedure Set_Legend
       (Data               : access Gtk_Plot_Data_Record;
        Legend             :        String);

Set the string printed in the legend for that data set.
Note that an entry can exist in the legend even if there is no name
associated with the graph.
procedure Show_Legend
       (Data               : access Gtk_Plot_Data_Record);

An entry will be made in the plot's legend for that dataset.
procedure Hide_Legend
       (Data               : access Gtk_Plot_Data_Record);

No entry will appear in the plot's legend for that dataset.
procedure Set_Legend_Precision
       (Data               : access Gtk_Plot_Data_Record;
        Precision          :        Gint);

Number of digits to display when the legends is associated with values,
as is the case for gradients.
function Get_Legend_Precision
       (Data               : access Gtk_Plot_Data_Record)
        return Gint;

Return the number of digits used for values in the legend
Gradients
---------

The symbols displayed in the plot can be assigned specific colors. But
they can also compute their own color by picking it in a gradient,
depending on the value.

procedure Reset_Gradient
       (Data               : access Gtk_Plot_Data_Record);

Reset the gradient to its default value
procedure Reset_Gradient_Colors
       (Data               : access Gtk_Plot_Data_Record);

Reset the colors of the gradient to their default values
procedure Set_Gradient_Mask
       (Data               : access Gtk_Plot_Data_Record;
        Mask               :        Plot_Gradient);

Indicates which component of the colors vary along the gradient.
function Get_Gradient_Mask
       (Data               : access Gtk_Plot_Data_Record)
        return Plot_Gradient;

Return the mask used for the gradient.
procedure Gradient_Set_Visible
       (Data               : access Gtk_Plot_Data_Record;
        Visible            :        Boolean);

Indicates whether the gradient should be visible
function Gradient_Visible
       (Data               : access Gtk_Plot_Data_Record)
        return Boolean;

Return True if the gradient is currently visible
procedure Set_Gradient_Colors
       (Data               : access Gtk_Plot_Data_Record;
        Min, Max           :        Gdk.Color.Gdk_Color);

Set the colors that define the gradient. The colors will vary from
Min to Max along the components specified in Set_Gradient_Mask.
procedure Get_Gradient_Colors
       (Data               : access Gtk_Plot_Data_Record;
        Min, Max           : out    Gdk.Color.Gdk_Color);

Return the colors that define the range
procedure Set_Gradient_Nth_Color
       (Data               : access Gtk_Plot_Data_Record;
        Level              :        Guint;
        Color              :        Gdk.Color.Gdk_Color);

Set the nth color in the gradient
function Get_Gradient_Nth_Color
       (Data               : access Gtk_Plot_Data_Record;
        Level              :        Guint)
        return Gdk.Color.Gdk_Color;

Get the nth color of the gradient
procedure Set_Gradient_Outer_Colors
       (Data               : access Gtk_Plot_Data_Record;
        Min, Max           :        Gdk.Color.Gdk_Color);

Set the outer colors for the gradient
procedure Set_Gradient
       (Data               : access Gtk_Plot_Data_Record;
        Min, Max           :        Gdouble;
        Nlevels            :        Gint);

Define the values associated with the minimal color and the maximal
color. Any value in between will have a color computed in between.
Nlevels is the number of ticks to display in the gradient.
procedure Get_Gradient
       (Data               : access Gtk_Plot_Data_Record;
        Min, Max           : out    Gdouble;
        Nlevels            : out    Gint);

Return the values associated with the minimal and maximal colors.
procedure Get_Gradient_Level
       (Data               : access Gtk_Plot_Data_Record;
        Level              :        Gdouble;
        Color              : out    Gdk.Color.Gdk_Color);

Return the color associated with a specific level.
The color depends on the parameters to Set_Gradient and
Set_Gradient_Colors.
procedure Draw_Gradient
       (Data               : access Gtk_Plot_Data_Record;
        X, Y               :        Gint);

Draw the gradient ast specific coordinates
procedure Gradient_Autoscale_A
       (Data               : access Gtk_Plot_Data_Record);

???
procedure Gradient_Autoscale_Da
       (Data               : access Gtk_Plot_Data_Record);

???
procedure Gradient_Autoscale_Z
       (Data               : access Gtk_Plot_Data_Record);

???
procedure Gradient_Set_Style
       (Data               : access Gtk_Plot_Data_Record;
        Style              :        Plot_Label_Style;
        Precision          :        Gint);

???
procedure Gradient_Set_Scale
       (Data               : access Gtk_Plot_Data_Record;
        Scale              :        Plot_Scale);

Set the scale of the gradient
Markers
-------

function Add_Marker
       (Data               : access Gtk_Plot_Data_Record;
        Point              :        Guint)
        return Gtk_Plot_Marker;

Add a new marker
procedure Remove_Marker
       (Data               : access Gtk_Plot_Data_Record;
        Marker             :        Gtk_Plot_Marker);

Remove a marker from the plot
procedure Remove_Markers
       (Data               : access Gtk_Plot_Data_Record);

Remove all markers
procedure Show_Markers
       (Data               : access Gtk_Plot_Data_Record;
        Show               :        Boolean);

Whether markers should be shown
function Markers_Visible
       (Data               : access Gtk_Plot_Data_Record)
        return Boolean;

Whether markers are currently visible
User Data
---------

It is possible to associated your own user data with a plot. This is
the mechanism provided by the C version of gtkextra. However, the best
way to do this in Ada is to inherit from Gtk_Plot_Data_Record (or one
of its children), and add your own fields.

procedure Set_Link
       (Data               : access Gtk_Plot_Data_Record;
        Link               :        System.Address);

Associate some user data with Data.
It is the responsability of the user to do some convert conversion to
System.Address.
function Get_Link
       (Data               : access Gtk_Plot_Data_Record)
        return System.Address;

Return the user data associated with Data, or Null_Address if there is
none.
procedure Remove_Link
       (Data               : access Gtk_Plot_Data_Record);

Remove the user data associated with Data.

File: gtkada_rm.info,  Node: Package_Gtk.Extra.Plot_Polar,  Next: Package_Gtk.Extra.Plot_Ps,  Prev: Package_Gtk.Extra.Plot_Data,  Up: Top

Package Gtk.Extra.Plot`_'Polar
******************************

This special type of data set displays itself in polar coordinates.

* Menu:

* Gtk.Extra.Plot_Polar Widget Hierarchy::
* Gtk.Extra.Plot_Polar Subprograms::


File: gtkada_rm.info,  Node: Gtk.Extra.Plot_Polar Widget Hierarchy,  Next: Gtk.Extra.Plot_Polar Subprograms,  Up: Package_Gtk.Extra.Plot_Polar

Widget Hierarchy
================

     GObject                       (*note Package_Glib.Object::)
     Gtk_Object                    (*note Package_Gtk.Object::)
        \___ Gtk_Widget            (*note Package_Gtk.Widget::)
           \___ Gtk_Plot           (*note Package_Gtk.Extra.Plot::)
              \___ Gtk_Plot_Polar  (*note Package_Gtk.Extra.Plot_Polar::)


File: gtkada_rm.info,  Node: Gtk.Extra.Plot_Polar Subprograms,  Prev: Gtk.Extra.Plot_Polar Widget Hierarchy,  Up: Package_Gtk.Extra.Plot_Polar

Subprograms
===========

procedure Gtk_New
       (Polar              : out    Gtk_Plot_Polar;
        Drawable           :        Gdk.Drawable.Gdk_Drawable
                            := null;
        Width, Height      :        Gdouble := 0.0);

Create a new polar plot.
If Width and Height are 0, they are left unspecified when calling the
C function.
function Get_Type              return Gtk.Gtk_Type;


Return the internal value associated with a Gtk_Box
procedure Rotate
       (Polar              : access Gtk_Plot_Polar_Record;
        Angle              :        Gdouble);

Rotate the graph by a given amount of radians.
function Get_Angle
       (Polar              : access Gtk_Plot_Polar_Record)
        return Gdouble;

Return the current angle for the polar plot

File: gtkada_rm.info,  Node: Package_Gtk.Extra.Plot_Ps,  Next: Package_Gtk.Extra.Plot_Surface,  Prev: Package_Gtk.Extra.Plot_Polar,  Up: Top

Package Gtk.Extra.Plot`_'Ps
***************************

This package does not implement any new widget.   Instead, if provides
postscript support for Gtk_Plot widgets, and can  create a postscript
file from any Gtk_Plot widget.

* Menu:

* Gtk.Extra.Plot_Ps Types::
* Gtk.Extra.Plot_Ps Subprograms::


File: gtkada_rm.info,  Node: Gtk.Extra.Plot_Ps Types,  Next: Gtk.Extra.Plot_Ps Subprograms,  Up: Package_Gtk.Extra.Plot_Ps

Types
=====

type Ps_Orientation is
         (Plot_Portrait, Plot_Landscape);

Portrait format means that the vertical size is longer than  the
horizontal size. Landscape is the reverse.     pragma Convention (C,
Ps_Orientation);
type Ps_Page_Size is
         (Plot_Letter,
          Plot_Legal,
          Plot_A4,
          Plot_Executive,
          Plot_Custom);

The formats that can be used for paper sizes.     pragma Convention (C,
Ps_Page_Size);
type Ps_Units is
         (Plot_Inches, Plot_Mm, Plot_Cm, Plot_Pspoints);

Units of measure for paper sizes.     pragma Convention (C, Ps_Units);

File: gtkada_rm.info,  Node: Gtk.Extra.Plot_Ps Subprograms,  Prev: Gtk.Extra.Plot_Ps Types,  Up: Package_Gtk.Extra.Plot_Ps

Subprograms
===========

procedure Plot_Export_Ps
       (Plot               : access Gtk.Extra.Plot.Gtk_Plot_Record'Class;
        Psfile             : in     String;
        Orientation        : in     Ps_Orientation;
        Epsflag            : in     Boolean;
        Page_Size          : in     Ps_Page_Size);

Create a new postscript file PsFile with the content of Plot.
Epsflag should be true if the generated file should be in  Encapsulated
Postscript format instead of simple Postscript.
procedure Plot_Export_Ps_With_Size
       (Plot               : access Gtk.Extra.Plot.Gtk_Plot_Record'Class;
        Psfile             : in     String;
        Orientation        : in     Ps_Orientation;
        Epsflag            : in     Boolean;
        Units              : in     Ps_Units;
        Width              : in     Gint;
        Height             : in     Gint);

Create a new postscript file PsFile with the content of Plot.
Epsflag should be true if the generated file should be in  Encapsulated
Postscript format instead of simple Postscript.   The page has a custom
size.
procedure Plot_Canvas_Export_Ps
       (Canvas             : access Gtk_Plot_Canvas_Record'Class;
        File_Name          : in     String;
        Orientation        : in     Ps_Orientation;
        Epsflag            : in     Boolean;
        Page_Size          : in     Ps_Page_Size);

Create a new postscript file PsFile with the content of Canvas.
Every plot on it is exported to the postscript file.   Epsflag should
be true if the generated file should be in  Encapsulated Postscript
format instead of simple Postscript.
procedure Plot_Canvas_Export_Ps_With_Size
       (Canvas             : access Gtk_Plot_Canvas_Record'Class;
        File_Name          : in     String;
        Orientation        : in     Ps_Orientation;
        Epsflag            : in     Boolean;
        Units              : in     Ps_Units;
        Width              : in     Gint;
        Height             : in     Gint);

Create a new postscript file PsFile with the content of Canvas.
Every plot on it is exported to the postscript file.   Epsflag should
be true if the generated file should be in  Encapsulated Postscript
format instead of simple Postscript.   The page has a custom size.

File: gtkada_rm.info,  Node: Package_Gtk.Extra.Plot_Surface,  Next: Package_Gtk.Extra.Sheet,  Prev: Package_Gtk.Extra.Plot_Ps,  Up: Top

Package Gtk.Extra.Plot`_'Surface
********************************

A special kind of data set that stores three-dimensional data.

* Menu:

* Gtk.Extra.Plot_Surface Widget Hierarchy::
* Gtk.Extra.Plot_Surface Subprograms::


File: gtkada_rm.info,  Node: Gtk.Extra.Plot_Surface Widget Hierarchy,  Next: Gtk.Extra.Plot_Surface Subprograms,  Up: Package_Gtk.Extra.Plot_Surface

Widget Hierarchy
================

     GObject                       (*note Package_Glib.Object::)
     Gtk_Object                    (*note Package_Gtk.Object::)
        \___ Gtk_Widget            (*note Package_Gtk.Widget::)
           \___ Gtk_Plot_Data      (*note Package_Gtk.Extra.Plot_Data::)
              \___ Gtk_Plot_Surface (*note Package_Gtk.Extra.Plot_Surface::)

