GwyRectSelectionLabels

GwyRectSelectionLabels — Rectangular selection helper

Functions

Types and Values

Includes

#include <libgwyapp/gwyapp.h>

Description

Functions

gwy_rect_selection_labels_new()

GwyRectSelectionLabels *
gwy_rect_selection_labels_new (gboolean none_is_full,
                               GCallback callback,
                               gpointer cbdata);

Creates a table displaying rectangular selection information.

The returned object will destroy itself when the table is destroyed.

Parameters

none_is_full

TRUE to treat unselected state as full data selected.

 

callback

Callback to call when the selection is edited.

 

cbdata

Data to pass to callback (as the first argument).

 

Returns

The newly created rectangular selection information, as an opaque pointer. The table widget can be obtained with gwy_rect_selection_labels_get_table().


gwy_rect_selection_labels_get_table()

GtkWidget *
gwy_rect_selection_labels_get_table (GwyRectSelectionLabels *rlabels);

Gets the table widget of a rectangular selection information.

Parameters

rlabels

Rectangular selection information table.

 

Returns

The table as a GtkWidget.


gwy_rect_selection_labels_select()

void
gwy_rect_selection_labels_select (GwyRectSelectionLabels *rlabels,
                                  GwySelection *selection,
                                  GwyField *field);

Updates selection data using rectangular selection information table.

Parameters

rlabels

Rectangular selection information table.

 

selection

A rectangular selection to fill information into.

 

field

A data field to use for real/pixel coordinate transforms.

 

gwy_rect_selection_labels_fill()

gboolean
gwy_rect_selection_labels_fill (GwyRectSelectionLabels *rlabels,
                                GwySelection *selection,
                                GwyField *field,
                                gdouble *selreal,
                                gint *selpix);

Updates rectangular selection info display.

It is possible to pass NULL field but non-NULL selection . This can lead to TRUE return value (if the selection is non-empty), but the labels will be still cleared as there is no way to convert between real and pixel coordinates.

Parameters

rlabels

Rectangular selection info table.

 

selection

A rectangular selection to fill information from. It can be NULL to clear the labels.

 

field

A data field to use for real/pixel coordinate transforms. It can be NULL to clear the labels.

 

selreal

If not NULL, must be an array of size at least 4 and will be filled with selection data xmin, ymin, xmax, ymax in physical units.

 

selpix

If not NULL, must be an array of size at least 4 and will be filled with selection data xmin, ymin, xmax, ymax in pixels.

 

Returns

TRUE if a selection is present, FALSE otherwise.

Types and Values

GwyRectSelectionLabels

typedef struct _GwyRectSelectionLabels GwyRectSelectionLabels;