GwyDataView

GwyDataView — Data field displaying area

Synopsis




struct      GwyDataView;
GtkWidget*  gwy_data_view_new               (GwyContainer *data);
GwyPixmapLayer* gwy_data_view_get_base_layer
                                            (GwyDataView *data_view);
GwyPixmapLayer* gwy_data_view_get_alpha_layer
                                            (GwyDataView *data_view);
GwyVectorLayer* gwy_data_view_get_top_layer (GwyDataView *data_view);
void        gwy_data_view_set_base_layer    (GwyDataView *data_view,
                                             GwyPixmapLayer *layer);
void        gwy_data_view_set_alpha_layer   (GwyDataView *data_view,
                                             GwyPixmapLayer *layer);
void        gwy_data_view_set_top_layer     (GwyDataView *data_view,
                                             GwyVectorLayer *layer);
gdouble     gwy_data_view_get_hexcess       (GwyDataView *data_view);
gdouble     gwy_data_view_get_vexcess       (GwyDataView *data_view);
void        gwy_data_view_set_zoom          (GwyDataView *data_view,
                                             gdouble zoom);
gdouble     gwy_data_view_get_zoom          (GwyDataView *data_view);
GwyContainer* gwy_data_view_get_data        (GwyDataView *data_view);
void        gwy_data_view_coords_xy_clamp   (GwyDataView *data_view,
                                             gint *xscr,
                                             gint *yscr);
void        gwy_data_view_coords_xy_to_real (GwyDataView *data_view,
                                             gint xscr,
                                             gint yscr,
                                             gdouble *xreal,
                                             gdouble *yreal);
void        gwy_data_view_coords_real_to_xy (GwyDataView *data_view,
                                             gdouble xreal,
                                             gdouble yreal,
                                             gint *xscr,
                                             gint *yscr);
gdouble     gwy_data_view_get_xmeasure      (GwyDataView *data_view);
gdouble     gwy_data_view_get_ymeasure      (GwyDataView *data_view);
GdkPixbuf*  gwy_data_view_get_thumbnail     (GwyDataView *data_view,
                                             gint size);
void        gwy_data_view_update            (GwyDataView *data_view);

Object Hierarchy


  GObject
   +----GtkObject
         +----GtkWidget
               +----GwyDataView

Implemented Interfaces

GwyDataView implements AtkImplementorIface.

Signal Prototypes


"updated"   void        user_function      (GwyDataView *gwydataview,
                                            gpointer user_data);

Description

Details

struct GwyDataView

struct GwyDataView;


gwy_data_view_new ()

GtkWidget*  gwy_data_view_new               (GwyContainer *data);

Creates a new data-displaying widget for data.

A newly created GwyDataView doesn't display anything. You have to add some layers to it, at least a base layer with gwy_data_view_set_base_layer(), and possibly others with gwy_data_view_set_alpha_layer() and gwy_data_view_set_top_layer().

The top layer is special. It must be a vector layer and can receive mouse and keyboard events.

The base layer it also special. It must be always present, and must not be transparent or vector.

data: A GwyContainer containing the data to display.
Returns : A newly created data view as a GtkWidget.

gwy_data_view_get_base_layer ()

GwyPixmapLayer* gwy_data_view_get_base_layer
                                            (GwyDataView *data_view);

Returns the base layer this data view currently uses.

A base layer should be always present.

data_view: A GwyDataView.
Returns : The currently used base layer.

gwy_data_view_get_alpha_layer ()

GwyPixmapLayer* gwy_data_view_get_alpha_layer
                                            (GwyDataView *data_view);

Returns the alpha layer this data view currently uses, or NULL if none is present.

data_view: A GwyDataView.
Returns : The currently used alpha layer.

gwy_data_view_get_top_layer ()

GwyVectorLayer* gwy_data_view_get_top_layer (GwyDataView *data_view);

Returns the top layer this data view currently uses, or NULL if none is present.

data_view: A GwyDataView.
Returns : The currently used top layer.

gwy_data_view_set_base_layer ()

void        gwy_data_view_set_base_layer    (GwyDataView *data_view,
                                             GwyPixmapLayer *layer);

Plugs layer to data_view as the base layer.

If another base layer is present, it's unplugged.

The layer must not be a vector layer. Theoretically, it can be NULL to use no base layer, but then data_view will probably display garbage.

data_view: A GwyDataView.
layer: A layer to be used as the base layer for data_view.

gwy_data_view_set_alpha_layer ()

void        gwy_data_view_set_alpha_layer   (GwyDataView *data_view,
                                             GwyPixmapLayer *layer);

Plugs layer to data_view as the alpha layer.

If another alpha layer is present, it's unplugged.

The layer must not be a vector layer. It can be NULL, meaning no alpha layer is to be used.

data_view: A GwyDataView.
layer: A layer to be used as the alpha layer for data_view.

gwy_data_view_set_top_layer ()

void        gwy_data_view_set_top_layer     (GwyDataView *data_view,
                                             GwyVectorLayer *layer);

Plugs layer to data_view as the top layer.

If another top layer is present, it's unplugged.

The layer must be a vector layer. It can be NULL, meaning no top layer is to be used.

data_view: A GwyDataView.
layer: A layer to be used as the top layer for data_view.

gwy_data_view_get_hexcess ()

gdouble     gwy_data_view_get_hexcess       (GwyDataView *data_view);

Return the horizontal excess of widget size to data size.

Do not use. Only useful for GwyDataWindow implementation.

data_view: A GwyDataView.
Returns : The execess.

gwy_data_view_get_vexcess ()

gdouble     gwy_data_view_get_vexcess       (GwyDataView *data_view);

Return the vertical excess of widget size to data size.

Do not use. Only useful for GwyDataWindow implementation.

data_view: A GwyDataView.
Returns : The execess.

gwy_data_view_set_zoom ()

void        gwy_data_view_set_zoom          (GwyDataView *data_view,
                                             gdouble zoom);

Sets zoom of data_view to zoom.

Zoom greater than 1 means larger image on screen and vice versa.

Note window manager can prevent the window from resize and thus the zoom from change.

data_view: A GwyDataView.
zoom: A new zoom value.

gwy_data_view_get_zoom ()

gdouble     gwy_data_view_get_zoom          (GwyDataView *data_view);

Returns current zoom of data_view.

data_view: A GwyDataView.
Returns : The zoom.

gwy_data_view_get_data ()

GwyContainer* gwy_data_view_get_data        (GwyDataView *data_view);

Returns the data container used by data_view.

data_view: A GwyDataView.
Returns : The data as a GwyContainer.

gwy_data_view_coords_xy_clamp ()

void        gwy_data_view_coords_xy_clamp   (GwyDataView *data_view,
                                             gint *xscr,
                                             gint *yscr);

Fixes screen coordinates xscr and yscr to be inside the data-displaying area (which can be smaller than widget size).

data_view: A GwyDataView.
xscr: A screen x-coordinate relative to widget origin.
yscr: A screen y-coordinate relative to widget origin.

gwy_data_view_coords_xy_to_real ()

void        gwy_data_view_coords_xy_to_real (GwyDataView *data_view,
                                             gint xscr,
                                             gint yscr,
                                             gdouble *xreal,
                                             gdouble *yreal);

Recomputes screen coordinates relative to widget origin to physical coordinates in the sample.

data_view: A GwyDataView.
xscr: A screen x-coordinate relative to widget origin.
yscr: A screen y-coordinate relative to widget origin.
xreal: Where the physical x-coordinate in the data sample should be stored.
yreal: Where the physical y-coordinate in the data sample should be stored.

gwy_data_view_coords_real_to_xy ()

void        gwy_data_view_coords_real_to_xy (GwyDataView *data_view,
                                             gdouble xreal,
                                             gdouble yreal,
                                             gint *xscr,
                                             gint *yscr);

Recomputes physical coordinate in the sample to screen coordinate relative to widget origin.

data_view: A GwyDataView.
xreal: A physical x-coordinate in the data sample..
yreal: A physical y-coordinate in the data sample.
xscr: Where the screen x-coordinate relative to widget origin should be stored.
yscr: Where the screen y-coordinate relative to widget origin should be stored.

gwy_data_view_get_xmeasure ()

gdouble     gwy_data_view_get_xmeasure      (GwyDataView *data_view);

Returns the ratio between horizontal physical lengths and horizontal screen lengths in pixels.

data_view: A GwyDataView.
Returns : The horizontal measure.

gwy_data_view_get_ymeasure ()

gdouble     gwy_data_view_get_ymeasure      (GwyDataView *data_view);

Returns the ratio between vertical physical lengths and horizontal screen lengths in pixels.

data_view: A GwyDataView.
Returns : The vertical measure.

gwy_data_view_get_thumbnail ()

GdkPixbuf*  gwy_data_view_get_thumbnail     (GwyDataView *data_view,
                                             gint size);

Creates and returns a thumbnail of the data view.

If the data are not square, they are centered onto the pixbuf.

data_view: A GwyDataView.
size: Requested thumbnail size.
Returns : The thumbnail as a newly create GdkPixbuf, to be freed when no longer necessary.

gwy_data_view_update ()

void        gwy_data_view_update            (GwyDataView *data_view);

Instructs a data view to update self and repaint.

It causes "updated" signal emission, among other things.

FIXME: This function exists because it's impossible [now?] to watch changes of datafields (and other things) properly. Call it when you changed data and want the view to reflect the change.

data_view: A GwyDataView.

Signals

The "updated" signal

void        user_function                  (GwyDataView *gwydataview,
                                            gpointer user_data);

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