![]() |
![]() |
Gwyddion Application Library Reference Manual | ![]() |
---|
data-browserdata-browser — Data browser |
enum GwyDataItem; void gwy_app_data_browser_add (GwyContainer *data); void gwy_app_data_browser_select_data_view (GwyDataView *data_view); void gwy_app_data_browser_select_graph (GwyGraph *graph); gint gwy_app_data_browser_add_data_field (GwyDataField *dfield, GwyContainer *data, gboolean showit); gint gwy_app_data_browser_add_graph_model (GwyGraphModel *gmodel, GwyContainer *data, gboolean showit); void gwy_app_data_browser_get_current (GwyAppWhat what, ...); gint* gwy_app_data_broswer_get_data_ids (GwyContainer *data); gint* gwy_app_data_broswer_get_graph_ids (GwyContainer *data); void gwy_app_copy_data_items (GwyContainer *source, GwyContainer *dest, gint from_id, gint to_id, ...); GQuark gwy_app_get_mask_key_for_id (gint id); GQuark gwy_app_get_presentation_key_for_id (gint id); void gwy_app_set_data_field_title (GwyContainer *data, gint id, const gchar *name); void gwy_app_data_browser_shut_down (void);
typedef enum { GWY_APP_CONTAINER = 1, GWY_APP_DATA_VIEW, GWY_APP_GRAPH, GWY_APP_DATA_FIELD, GWY_APP_DATA_FIELD_KEY, GWY_APP_DATA_FIELD_ID, GWY_APP_MASK_FIELD, GWY_APP_MASK_FIELD_KEY, GWY_APP_SHOW_FIELD, GWY_APP_SHOW_FIELD_KEY, GWY_APP_GRAPH_MODEL, GWY_APP_GRAPH_MODEL_KEY, GWY_APP_GRAPH_MODEL_ID, } GwyAppWhat; /* XXX: silly name */ typedef enum { GWY_DATA_ITEM_GRADIENT = 1, GWY_DATA_ITEM_PALETTE = GWY_DATA_ITEM_GRADIENT, GWY_DATA_ITEM_RANGE, GWY_DATA_ITEM_RANGE_TYPE, GWY_DATA_ITEM_MASK_COLOR, /* GWY_DATA_ITEM_SELECTION: Current, all? */ } GwyDataItem;
void gwy_app_data_browser_add (GwyContainer *data);
Adds a data container to application data browser.
The container is then managed by the data browser until it's destroyed. Since the data browser does not add any reference, the container is normally destroyed when there is no view (any: channel, graph) showing its contents. Make sure such a view exists before you release your reference to data.
data : | A data container. |
void gwy_app_data_browser_select_data_view (GwyDataView *data_view);
Switches application data browser to display container of data_view's data and selects data_view's data in the channel list.
data_view : | A data view widget. |
void gwy_app_data_browser_select_graph (GwyGraph *graph);
Switches application data browser to display container of graph's data and selects graph's data in the graph list.
graph : | A graph widget. |
gint gwy_app_data_browser_add_data_field (GwyDataField *dfield, GwyContainer *data, gboolean showit);
Adds a data field to a data container.
dfield : | A data field to add. |
data : | A data container to add dfield to. It can be NULL to add the data field to current data container. |
showit : | TRUE to display it immediately, FALSE to just add it. |
Returns : | The id of the data field in the container. |
gint gwy_app_data_browser_add_graph_model (GwyGraphModel *gmodel, GwyContainer *data, gboolean showit);
Adds a graph model to a data container.
gmodel : | A graph model to add. |
data : | A data container to add gmodel to. It can be NULL to add the graph model to current data container. |
showit : | TRUE to display it immediately, FALSE to just add it. |
Returns : | The id of the graph model in the container. |
void gwy_app_data_browser_get_current (GwyAppWhat what, ...);
Gets information about current objects.
All output arguments are always set to some value, even if the requested object does not exist. Object arguments are set to pointer to the object if it exists (no reference added), or cleared to NULL if no such object exists.
Quark arguments are set to the corresponding key even if no such object is actually present (use object arguments to check for object presence) but the location where it would be stored is known. This is commond with presentations and masks. They are be set to 0 if no corresponding location exists -- for example, when current mask key is requested but the current data contain no data field (or there is no current data at all).
The rules for id arguments are similar to quarks, except they are set to -1 to indicate undefined result.
gint* gwy_app_data_broswer_get_data_ids (GwyContainer *data);
Gets the list of all channels in a data container.
The container must be known to the data browser.
data : | A data container. |
Returns : | A newly allocated array with channels ids, -1 terminated. |
gint* gwy_app_data_broswer_get_graph_ids (GwyContainer *data);
Gets the list of all graphs in a data container.
The container must be known to the data browser.
data : | A data container. |
Returns : | A newly allocated array with graph ids, -1 terminated. |
void gwy_app_copy_data_items (GwyContainer *source, GwyContainer *dest, gint from_id, gint to_id, ...);
Copy auxiliary data items between data containers.
source : | Source container. |
dest : | Target container (may be identical to source). |
from_id : | Data number to copy items from. |
to_id : | Data number to copy items to. |
... : | 0-terminated list of GwyDataItem values defining the items to copy. |
GQuark gwy_app_get_mask_key_for_id (gint id);
Calculates mask quark identifier from its id.
id : | Data number in container. |
Returns : | The quark key identifying mask number id. |
GQuark gwy_app_get_presentation_key_for_id (gint id);
Calculates presentation quark identifier from its id.
id : | Data number in container. |
Returns : | The quark key identifying presentation number id. |
void gwy_app_set_data_field_title (GwyContainer *data, gint id, const gchar *name);
Sets channel title.
data : | A data container. |
id : | The data channel id. |
name : | The title to set. It can be NULL to use somthing like "Untitled". The id will be appended to it or (replaced in it if it already ends with digits). |
<< app | settings >> |