data-browser

data-browser — Data browser

Synopsis




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);

Description

Details

enum GwyAppWhat

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;


enum GwyDataItem

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;


enum GwyVisibilityResetType

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.

GWY_VISIBILITY_RESET_DEFAULT Restore visibilities from container and if nothing would be visible, make an arbitrary data object visible.
GWY_VISIBILITY_RESET_RESTORE Restore visibilities from container.
GWY_VISIBILITY_RESET_SHOW_ALL Show all data objects.
GWY_VISIBILITY_RESET_HIDE_ALL Hide all data objects. This normally makes the file inaccessible.

GwyAppDataForeachFunc ()

void        (*GwyAppDataForeachFunc)        (GwyContainer *data,
                                             gpointer user_data);

data :
user_data :

gwy_app_data_browser_add ()

void        gwy_app_data_browser_add        (GwyContainer *data);

Adds a data container to the application data browser.

data : A data container.

gwy_app_data_browser_remove ()

void        gwy_app_data_browser_remove     (GwyContainer *data);

Removed a data container from the application data browser.

data : A data container.

gwy_app_data_browser_reset_visibility ()

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.

gwy_app_data_browser_set_keep_invisible ()

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.

data : A data container.
keep_invisible : TRUE to retain data in the browser even when it becomes inaccessible, FALSE to dispose of it.

gwy_app_data_browser_get_keep_invisible ()

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().

gwy_app_data_browser_select_data_view ()

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.

gwy_app_data_browser_select_graph ()

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.

gwy_app_data_browser_add_data_field ()

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.

gwy_app_data_browser_add_graph_model ()

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.

gwy_app_data_browser_get_current ()

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.

gwy_app_data_browser_get_data_ids ()

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.

gwy_app_data_browser_get_graph_ids ()

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.

gwy_app_data_clear_selections ()

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.

gwy_app_data_browser_foreach ()

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.

gwy_app_copy_data_items ()

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.

gwy_app_get_data_key_for_id ()

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.

gwy_app_get_mask_key_for_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.

gwy_app_get_show_key_for_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.

gwy_app_set_data_field_title ()

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).

gwy_app_get_data_field_title ()

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.

gwy_app_data_browser_get_window ()

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.

gwy_app_data_browser_shut_down ()

void        gwy_app_data_browser_shut_down  (void);


gwy_app_get_channel_thumbnail ()

GdkPixbuf*  gwy_app_get_channel_thumbnail   (GwyContainer *data,
                                             gint id,
                                             gint max_width,
                                             gint max_height);

data :
id :
max_width :
max_height :
Returns :

gwy_app_data_browser_select_data_field ()

void        gwy_app_data_browser_select_data_field
                                            (GwyContainer *data,
                                             gint id);

data :
id :

gwy_app_data_browser_select_graph_model ()

void        gwy_app_data_browser_select_graph_model
                                            (GwyContainer *data,
                                             gint id);

data :
id :

gwy_app_data_browser_show_3d ()

void        gwy_app_data_browser_show_3d    (GwyContainer *data,
                                             gint id);

data :
id :

gwy_app_find_window_for_channel ()

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.