![]() | ![]() | ![]() | Gwyddion Widgets Library Reference Manual | ![]() |
---|
GwyDataView — Data field displaying area
struct GwyDataView; struct GwyDataViewClass; 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); GdkPixbuf* gwy_data_view_get_pixbuf (GwyDataView *data_view, gint max_width, gint max_height); void gwy_data_view_update (GwyDataView *data_view);
"redrawn" void user_function (GwyDataView *gwydataview, gpointer user_data); "updated" void user_function (GwyDataView *gwydataview, gpointer user_data);
struct GwyDataViewClass { GtkWidgetClass parent_class; void (*updated)(GwyDataView *data_view); void (*redrawn)(GwyDataView *data_view); gpointer reserved2; };
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
gdouble gwy_data_view_get_zoom (GwyDataView *data_view);
Returns current zoom of data_view.
When a resize is queued, the new zoom value is returned.
data_view : | A GwyDataView. |
Returns : | The zoom. |
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. |
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. |
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. |
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. |
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. |
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. |
GdkPixbuf* gwy_data_view_get_thumbnail (GwyDataView *data_view, gint size);
Creates and returns a thumbnail of the data view.
If the data is not square, it is centered onto the pixbuf, with transparent borders. The returned pixbuf always has an alpha channel, even if it fits exactly.
data_view : | A GwyDataView. |
size : | Requested thumbnail size. |
Returns : | The thumbnail as a newly created GdkPixbuf, which should be freed when no longer needed. |
GdkPixbuf* gwy_data_view_get_pixbuf (GwyDataView *data_view, gint max_width, gint max_height);
Creates and returns a pixbuf from the data view.
If the data is not square, the resulting pixbuf is also nonsquare, this is different from gwy_data_view_get_thumbnail(). The returned pixbuf also never has alpha channel.
data_view : | A GwyDataView. |
max_width : | Pixbuf width that should not be exceeeded. Value smaller than 1 means unlimited size. |
max_height : | Pixbuf height that should not be exceeeded. Value smaller than 1 means unlimited size. |
Returns : | The pixbuf as a newly created GdkPixbuf, it should be freed when no longer needed. It is never larger than the actual data size, as max_width and max_height are only upper limits. |
Since 1.5
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. |
void user_function (GwyDataView *gwydataview, gpointer user_data);
The ::redrawn signal is emitted when GwyDataView actually redraws itself after an update.
gwydataview : | The GwyDataView which received the signal. |
user_data : | User data set when the signal handler was connected. |
user_data : | user data set when the signal handler was connected. |
void user_function (GwyDataView *gwydataview, gpointer user_data);
The ::updated signal is emitted when the displayed data, or the way they are displayed, changes. However, actual redraw takes place later in the main Gtk+ loop, so if you want to e.g. actualize a thumbnail, connect to ::redrawn instead.
gwydataview : | The GwyDataView which received the signal. |
user_data : | User data set when the signal handler was connected. |
user_data : | user data set when the signal handler was connected. |
<< GwyDataWindow | GwyDataViewLayer >> |