GwyGraphArea

GwyGraphArea — Layout for drawing graph curves.

Synopsis




            GwyGraphStatus_PointData;
            GwyGraphStatus_CursorData;
            GwyGraphStatus_ZoomData;
            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_selection    (GwyGraphArea *area,
                                             GwyGraphStatusType status,
                                             gdouble *selection,
                                             gint n_of_selections);
void        gwy_graph_area_set_selection_limit
                                            (GwyGraphArea *area,
                                             gint limit);
gint        gwy_graph_area_get_selection_limit
                                            (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_clear_selection  (GwyGraphArea *area);
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);

Object Hierarchy


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

Implemented Interfaces

GwyGraphArea implements AtkImplementorIface.

Signal Prototypes


"mouse-moved"
            void        user_function      (GwyGraphArea *gwygrapharea,
                                            gpointer user_data);
"selected"  void        user_function      (GwyGraphArea *gwygrapharea,
                                            gpointer user_data);
"zoomed"    void        user_function      (GwyGraphArea *gwygrapharea,
                                            gpointer user_data);

Description

This widget is a part of GwyGraph widget. It is recommended to use it within the GwyGraph widget, however, it can be used separately. It plots a set of data curves with a given plot properties.

Details

GwyGraphStatus_PointData

typedef struct {
  GwyGraphDataPoint data_point;
} GwyGraphStatus_PointData;


GwyGraphStatus_CursorData

typedef struct {
  GwyGraphDataPoint data_point;
} GwyGraphStatus_CursorData;


GwyGraphStatus_ZoomData

typedef struct {
  gdouble xmin;
  gdouble ymin;
  gdouble width;
  gdouble height;
} GwyGraphStatus_ZoomData;


GwyGraphAreaCurve

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

    gpointer reserved;
} GwyGraphAreaCurve;


GwyGraphArea

typedef struct _GwyGraphArea GwyGraphArea;


GwyGraphAreaClass

typedef struct {
    GtkLayoutClass parent_class;

    GdkCursor *cross_cursor;
    GdkCursor *arrow_cursor;
    void (*selected)(GwyGraphArea *area);
    void (*zoomed)(GwyGraphArea *area);
    void (*mouse_moved)(GwyGraphArea *area);


    gpointer reserved1;
    gpointer reserved2;
} GwyGraphAreaClass;


gwy_graph_area_new ()

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

hadjustment :
vadjustment :
Returns :

gwy_graph_area_get_label ()

GtkWidget*  gwy_graph_area_get_label        (GwyGraphArea *area);

area : graph area
Returns : graph area label

gwy_graph_area_refresh ()

void        gwy_graph_area_refresh          (GwyGraphArea *area);

area :

gwy_graph_area_set_selection ()

void        gwy_graph_area_set_selection    (GwyGraphArea *area,
                                             GwyGraphStatusType status,
                                             gdouble *selection,
                                             gint n_of_selections);

Set selection data for given values and status. Refresh graph area after doing this to see any change.

area : graph area
status : status of selection to be set
selection : selection data field
n_of_selections : number of selections to be set

gwy_graph_area_set_selection_limit ()

void        gwy_graph_area_set_selection_limit
                                            (GwyGraphArea *area,
                                             gint limit);

Set maximum number of selections done by mouse

area : graph area
limit : maximum muber of selections

gwy_graph_area_get_selection_limit ()

gint        gwy_graph_area_get_selection_limit
                                            (GwyGraphArea *area);

area : graph area
Returns : maximum number of selections done by mouse

gwy_graph_area_set_model ()

void        gwy_graph_area_set_model        (GwyGraphArea *area,
                                             gpointer gmodel);

Changes the graph model. Calls refresh afterwards.

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);

drawable :
gc :
x :
y :
width :
height :
area :

gwy_graph_area_export_vector ()

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

area :
x :
y :
width :
height :
Returns :

gwy_graph_area_clear_selection ()

void        gwy_graph_area_clear_selection  (GwyGraphArea *area);

Clear all the selections. If you use grapher area as a part of GwyGrapher use the GwyGrapher clear selection function preferably.

area : graph area

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 by 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 withing 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);

area :
grid_data :

gwy_graph_area_set_y_grid_data ()

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

area :
grid_data :

gwy_graph_area_get_x_grid_data ()

const GArray* gwy_graph_area_get_x_grid_data
                                            (GwyGraphArea *area);

area :
Returns :

gwy_graph_area_get_y_grid_data ()

const GArray* gwy_graph_area_get_y_grid_data
                                            (GwyGraphArea *area);

area :
Returns :

Signals

The "mouse-moved" signal

void        user_function                  (GwyGraphArea *gwygrapharea,
                                            gpointer user_data);

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

The "selected" signal

void        user_function                  (GwyGraphArea *gwygrapharea,
                                            gpointer user_data);

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

The "zoomed" signal

void        user_function                  (GwyGraphArea *gwygrapharea,
                                            gpointer user_data);

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