![]() |
![]() |
Gwyddion Application Library Reference Manual | ![]() |
|
---|---|---|---|---|
enum GwyAppWhat; enum GwyDataItem; enum GwyVisibilityResetType; void (*GwyAppDataForeachFunc) (GwyContainer *data, gpointer user_data); void gwy_app_data_browser_add (GwyContainer *data); void gwy_app_data_browser_remove (GwyContainer *data); gboolean gwy_app_data_browser_reset_visibility (GwyContainer *data, GwyVisibilityResetType reset_type); void gwy_app_data_browser_set_keep_invisible (GwyContainer *data, gboolean keep_invisible); gboolean gwy_app_data_browser_get_keep_invisible (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_browser_get_data_ids (GwyContainer *data); gint* gwy_app_data_browser_get_graph_ids (GwyContainer *data); void gwy_app_data_clear_selections (GwyContainer *data, gint id); void gwy_app_data_browser_foreach (GwyAppDataForeachFunc function, gpointer user_data); void gwy_app_copy_data_items (GwyContainer *source, GwyContainer *dest, gint from_id, gint to_id, ...); GQuark gwy_app_get_data_key_for_id (gint id); GQuark gwy_app_get_mask_key_for_id (gint id); GQuark gwy_app_get_show_key_for_id (gint id); void gwy_app_set_data_field_title (GwyContainer *data, gint id, const gchar *name); gchar* gwy_app_get_data_field_title (GwyContainer *data, gint id); GtkWidget* gwy_app_data_browser_get_window (void); void gwy_app_data_browser_shut_down (void); GdkPixbuf* gwy_app_get_channel_thumbnail (GwyContainer *data, gint id, gint max_width, gint max_height); void gwy_app_data_browser_select_data_field (GwyContainer *data, gint id); void gwy_app_data_browser_select_graph_model (GwyContainer *data, gint id); void gwy_app_data_browser_show_3d (GwyContainer *data, gint id); GtkWindow* gwy_app_find_window_for_channel (GwyContainer *data, gint id);
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;
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_REAL_SQUARE, /* GWY_DATA_ITEM_SELECTION: Current, all? */ } GwyDataItem;
typedef enum { GWY_VISIBILITY_RESET_DEFAULT, GWY_VISIBILITY_RESET_RESTORE, GWY_VISIBILITY_RESET_SHOW_ALL, GWY_VISIBILITY_RESET_HIDE_ALL } GwyVisibilityResetType;
Data object visibility reset type.
The precise behaviour of GWY_VISIBILITY_RESET_DEFAULT
may be subject of
further changes. It indicates the wish to restore saved visibilities
and do something reasonable when there are no visibilities to restore.
void (*GwyAppDataForeachFunc) (GwyContainer *data, gpointer user_data);
data : |
|
user_data : |
void gwy_app_data_browser_add (GwyContainer *data);
Adds a data container to the application data browser.
data : |
A data container. |
void gwy_app_data_browser_remove (GwyContainer *data);
Removed a data container from the application data browser.
data : |
A data container. |
gboolean gwy_app_data_browser_reset_visibility (GwyContainer *data, GwyVisibilityResetType reset_type);
Resets visibility of all data objects in a container.
data : |
A data container. |
reset_type : |
Type of visibility reset. |
Returns : | TRUE if anything is visible after the reset.
|
void gwy_app_data_browser_set_keep_invisible (GwyContainer *data, gboolean keep_invisible);
Sets data browser behaviour for inaccessible data.
Normally, when all visual objects belonging to a file are closed the
container is removed from the data browser and dereferenced, leading to
its finalization. By setting keep_invisible
to TRUE
the container can be
made to sit in the browser indefinitely.
gboolean gwy_app_data_browser_get_keep_invisible (GwyContainer *data);
Gets data browser behaviour for inaccessible data.
data : |
A data container. |
Returns : | See gwy_app_data_browser_set_keep_invisible() .
|
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.
gint gwy_app_data_browser_add_graph_model (GwyGraphModel *gmodel, GwyContainer *data, gboolean showit);
Adds a graph model to a data 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.
what : |
First information about current objects to obtain. |
... : |
pointer to store the information to (object pointer for objects, GQuark pointer for keys, gint pointer for id's), followed by 0-terminated list of GwyAppWhat, pointer couples. |
gint* gwy_app_data_browser_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_browser_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_data_clear_selections (GwyContainer *data, gint id);
Clears all selections associated with a data channel.
This is the preferred selection handling after changes in data geometry as they have generally unpredictable effects on selections. Selection should not be removed because this is likely to make the current tool stop working.
data : |
A data container. |
id : |
Data channel id. |
void gwy_app_data_browser_foreach (GwyAppDataForeachFunc function, gpointer user_data);
Calls a function for each data container managed by data browser.
function : |
Function to run on each data container. |
user_data : |
Data to pass as second argument of function .
|
void gwy_app_copy_data_items (GwyContainer *source, GwyContainer *dest, gint from_id, gint to_id, ...);
Copy auxiliary data items between data containers.
Items that do not exist in source
are removed from dest
. Therefore the
operation is more of a synchronization than a copy.
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_data_key_for_id (gint id);
Calculates data field quark identifier from its id.
id : |
Data number in container. |
Returns : | The quark key identifying mask number id .
|
GQuark gwy_app_get_mask_key_for_id (gint id);
Calculates mask field quark identifier from its id.
id : |
Data number in container. |
Returns : | The quark key identifying mask number id .
|
GQuark gwy_app_get_show_key_for_id (gint id);
Calculates presentation field 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).
|
gchar* gwy_app_get_data_field_title (GwyContainer *data, gint id);
Gets a data channel title.
This function should return a reasoanble title for untitled channels, channels with old titles, channels with and without a file, etc.
data : |
A data container. |
id : |
Data channel id. |
Returns : | The channel title as a newly allocated string. |
GtkWidget* gwy_app_data_browser_get_window (void);
Gets the data browser window.
If the window does not exist, it is created (though not shown) as a side effect.
Returns : | The data browser window. |
GdkPixbuf* gwy_app_get_channel_thumbnail (GwyContainer *data, gint id, gint max_width, gint max_height);
data : |
|
id : |
|
max_width : |
|
max_height : |
|
Returns : |
void gwy_app_data_browser_select_data_field (GwyContainer *data, gint id);
data : |
|
id : |
void gwy_app_data_browser_select_graph_model (GwyContainer *data, gint id);
data : |
|
id : |
void gwy_app_data_browser_show_3d (GwyContainer *data, gint id);
data : |
|
id : |
GtkWindow* gwy_app_find_window_for_channel (GwyContainer *data, gint id);
Finds the window displaying a data channel.
data : |
A data container to find window for. |
id : |
Data channel id. It can be -1 to find any data window displaying
a channel from data .
|
Returns : | The window if found, NULL if no data window displays the
requested channel.
|