GwyGraphArea

GwyGraphArea — Layout for drawing graph curves

Synopsis




            GwyGraphStatus_CursorData;
            GwyGraphAreaCurve;
            GwyGraphArea;
            GwyGraphAreaClass;
GtkWidget*  gwy_graph_area_new              (GtkAdjustment *hadjustment,
                                             GtkAdjustment *vadjustment);
GtkWidget*  gwy_graph_area_get_label        (GwyGraphArea *area);
void        gwy_graph_area_refresh          (GwyGraphArea *area);
void        gwy_graph_area_set_model        (GwyGraphArea *area,
                                             gpointer gmodel);
void        gwy_graph_area_draw_area_on_drawable
                                            (GdkDrawable *drawable,
                                             GdkGC *gc,
                                             gint x,
                                             gint y,
                                             gint width,
                                             gint height,
                                             GwyGraphArea *area);
GString*    gwy_graph_area_export_vector    (GwyGraphArea *area,
                                             gint x,
                                             gint y,
                                             gint width,
                                             gint height);
void        gwy_graph_area_enable_user_input
                                            (GwyGraphArea *area,
                                             gboolean enable);
void        gwy_graph_area_get_cursor       (GwyGraphArea *area,
                                             gdouble *x_cursor,
                                             gdouble *y_cursor);
void        gwy_graph_area_set_x_grid_data  (GwyGraphArea *area,
                                             GArray *grid_data);
void        gwy_graph_area_set_y_grid_data  (GwyGraphArea *area,
                                             GArray *grid_data);
const GArray* gwy_graph_area_get_x_grid_data
                                            (GwyGraphArea *area);
const GArray* gwy_graph_area_get_y_grid_data
                                            (GwyGraphArea *area);
GwySelection* gwy_graph_area_get_selection  (GwyGraphArea *area,
                                             GwyGraphStatusType status_type);
void        gwy_graph_area_set_status       (GwyGraphArea *area,
                                             GwyGraphStatusType status_type);

Object Hierarchy


  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkLayout
                                 +----GwyGraphArea

Implemented Interfaces

GwyGraphArea implements AtkImplementorIface.

Signals


"status-changed"
            void        user_function      (GwyGraphArea *gwygrapharea,
                                            gint          arg1,
                                            gpointer      user_data)         : Run first

Description

GwyGraphArea is the central part of GwyGraph widget. It plots a set of data curves with the given plot properties.

It is recommended to use it within GwyGraph, however, it can also be used separately.

Details

GwyGraphStatus_CursorData

typedef struct {
    GwyGraphDataPoint data_point;
} GwyGraphStatus_CursorData;


GwyGraphAreaCurve

typedef struct {
    GdkPoint *points;           /*points to be directly plotted*/

    gpointer reserved;
} GwyGraphAreaCurve;


GwyGraphArea

typedef struct _GwyGraphArea GwyGraphArea;


GwyGraphAreaClass

typedef struct {
    GtkLayoutClass parent_class;

    void (*status_changed)(GwyGraphArea *area, gint i);

    gpointer reserved1;
    gpointer reserved2;
} GwyGraphAreaClass;


gwy_graph_area_new ()

GtkWidget*  gwy_graph_area_new              (GtkAdjustment *hadjustment,
                                             GtkAdjustment *vadjustment);

Creates a graph area widget.

hadjustment : horizontal adjustment (assigns lower and upper bounds as well as increments to the horizontal axis of the new graph area)
vadjustment : vertical adjustment (assigns lower and upper bounds as well as increments to the vertical axis of the new graph area)
Returns : new GwyGraphArea widget.

gwy_graph_area_get_label ()

GtkWidget*  gwy_graph_area_get_label        (GwyGraphArea *area);

area : graph area
Returns : the GwyGraphLabel within area (do not free).

gwy_graph_area_refresh ()

void        gwy_graph_area_refresh          (GwyGraphArea *area);

Refreshes the area with respect to graph model.

area : graph area

gwy_graph_area_set_model ()

void        gwy_graph_area_set_model        (GwyGraphArea *area,
                                             gpointer gmodel);

Changes the graph model. Calls refresh afterwards. gmodel is duplicated.

area : graph area
gmodel : new graph model

gwy_graph_area_draw_area_on_drawable ()

void        gwy_graph_area_draw_area_on_drawable
                                            (GdkDrawable *drawable,
                                             GdkGC *gc,
                                             gint x,
                                             gint y,
                                             gint width,
                                             gint height,
                                             GwyGraphArea *area);

Draws the graph area to a GdkDrawable.

drawable : a GdkDrawable (destination for graphics operations)
gc : a GdkGC graphics context
x : X position in drawable where the graph area should be drawn
y : Y position in drawable where the graph area should be drawn
width : width of the graph area on the drawable
height : height of the graph area on the drawable
area : the graph area to draw

gwy_graph_area_export_vector ()

GString*    gwy_graph_area_export_vector    (GwyGraphArea *area,
                                             gint x,
                                             gint y,
                                             gint width,
                                             gint height);

area : the graph area to export
x :
y :
width :
height :
Returns :

gwy_graph_area_enable_user_input ()

void        gwy_graph_area_enable_user_input
                                            (GwyGraphArea *area,
                                             gboolean enable);

Enables/disables all the user input dialogs (to be invoked by clicking the mouse).

area : graph area
enable : enable/disable user input

gwy_graph_area_get_cursor ()

void        gwy_graph_area_get_cursor       (GwyGraphArea *area,
                                             gdouble *x_cursor,
                                             gdouble *y_cursor);

Gets mouse cursor related values within graph area.

area : graph area
x_cursor : x value corresponding to cursor position
y_cursor : y value corresponding to cursor position

gwy_graph_area_set_x_grid_data ()

void        gwy_graph_area_set_x_grid_data  (GwyGraphArea *area,
                                             GArray *grid_data);

Sets the grid data on the x-axis of the graph area

area : graph area
grid_data : array of grid data on the x axis

gwy_graph_area_set_y_grid_data ()

void        gwy_graph_area_set_y_grid_data  (GwyGraphArea *area,
                                             GArray *grid_data);

Sets the grid data on the y-axis of the graph area

area : graph area
grid_data : array of grid data on the y axis

gwy_graph_area_get_x_grid_data ()

const GArray* gwy_graph_area_get_x_grid_data
                                            (GwyGraphArea *area);

area : graph area
Returns : the grid data on the x-axis of the graph area as a GArray (do not free).

gwy_graph_area_get_y_grid_data ()

const GArray* gwy_graph_area_get_y_grid_data
                                            (GwyGraphArea *area);

area : graph area
Returns : the grid data on the y-axis of the graph area as a GArray (do not free).

gwy_graph_area_get_selection ()

GwySelection* gwy_graph_area_get_selection  (GwyGraphArea *area,
                                             GwyGraphStatusType status_type);

area :
status_type :
Returns :

gwy_graph_area_set_status ()

void        gwy_graph_area_set_status       (GwyGraphArea *area,
                                             GwyGraphStatusType status_type);

area :
status_type :

Signal Details

The "status-changed" signal

void        user_function                  (GwyGraphArea *gwygrapharea,
                                            gint          arg1,
                                            gpointer      user_data)         : Run first

gwygrapharea : the object which received the signal.
arg1 :
user_data : user data set when the signal handler was connected.