GwyGraphArea

GwyGraphArea — Layout for drawing graph curves.

Synopsis




            GwyGraphStatus_PointData;
            GwyGraphStatus_CursorData;
            GwyGraphStatus_PointsData;
            GwyGraphStatus_AreaData;
            GwyGraphStatus_AreasData;
            GwyGraphStatus_ZoomData;
            GwyGraphAreaCurve;
            GwyGraphArea;
            GwyGraphAreaClass;
GtkWidget*  gwy_graph_area_new              (GtkAdjustment *hadjustment,
                                             GtkAdjustment *vadjustment);
void        gwy_graph_area_signal_selected  (GwyGraphArea *area);
void        gwy_graph_area_signal_zoomed    (GwyGraphArea *area);
void        gwy_graph_area_signal_mouse_moved
                                            (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_change_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);

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_PointsData

typedef struct {
  GArray *data_points;
} GwyGraphStatus_PointsData;


GwyGraphStatus_AreaData

typedef struct {
  GwyGraphDataArea data_area;
} GwyGraphStatus_AreaData;


GwyGraphStatus_AreasData

typedef struct {
  GArray *data_areas;
} GwyGraphStatus_AreasData;


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_signal_selected ()

void        gwy_graph_area_signal_selected  (GwyGraphArea *area);

emit signal that something was selected by mouse. "Something" depends on the actual graph status (points, horizontal selection, etc.).

area : graph area

gwy_graph_area_signal_zoomed ()

void        gwy_graph_area_signal_zoomed    (GwyGraphArea *area);

emit signal that user finished drawing zoom rectangle by mouse.

area : graph area

gwy_graph_area_signal_mouse_moved ()

void        gwy_graph_area_signal_mouse_moved
                                            (GwyGraphArea *area);

emit signal that user moved mouse over graph area.

area : grapher area

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_change_model ()

void        gwy_graph_area_change_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

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.