![]() | ![]() | ![]() | Gwyddion Application Library Reference Manual | ![]() |
---|
app — Core application interface.
GwyContainer* gwy_app_get_current_data (void); GwyDataWindow* gwy_app_data_window_get_current (void); void gwy_app_data_window_set_current (GwyDataWindow *window); void gwy_app_data_window_remove (GwyDataWindow *window); void gwy_app_data_window_foreach (GFunc func, gpointer user_data); GtkWidget* gwy_app_data_window_create (GwyContainer *data); gint gwy_app_data_window_set_untitled (GwyDataWindow *window, const gchar *templ); void gwy_app_data_view_update (GtkWidget *data_view); void gwy_app_change_mask_color_cb (gpointer unused, gboolean defaultc); gulong gwy_app_data_window_list_add_hook (gpointer func, gpointer data); gboolean gwy_app_data_window_list_remove_hook (gulong hook_id); GtkWidget* gwy_app_graph_window_get_current (void); void gwy_app_graph_window_set_current (GtkWidget *window); void gwy_app_graph_window_remove (GtkWidget *window); GtkWidget* gwy_app_graph_window_create (GtkWidget *graph); void gwy_app_tool_use_cb (const gchar *toolname, GtkWidget *button); void gwy_app_zoom_set_cb (gpointer data); void gwy_app_mask_kill_cb (void); void gwy_app_show_kill_cb (void); GtkWidget* gwy_app_main_window_get (void); void gwy_app_main_window_set (GtkWidget *window); gboolean gwy_app_quit (void); void gwy_app_clean_up_data (GwyContainer *data);
GwyContainer* gwy_app_get_current_data (void);
Returns the data of currently active data window.
Returns : | The current data as a GwyContainer. May return NULL if none is currently active. |
GwyDataWindow* gwy_app_data_window_get_current (void);
Returns the currently active data window, may be NULL if none is active.
Returns : | The active data window as a GwyDataWindow. |
void gwy_app_data_window_set_current (GwyDataWindow *window);
Makes a data window active, including tool switch, etc.
The window must be present in the list.
window: | A data window. |
void gwy_app_data_window_remove (GwyDataWindow *window);
Removes the data window window from the list of data windows.
All associated structures are freed, active tool gets switch to NULL window.
window: | A data window. |
void gwy_app_data_window_foreach (GFunc func, gpointer user_data);
Calls func on each data window, in no particular order.
The function should not create or remove data windows.
func: | A function to call on each data window. |
user_data: | Data to pass to func. |
GtkWidget* gwy_app_data_window_create (GwyContainer *data);
Creates a new data window showing data and does some basic setup.
Also calls gtk_window_present() on it.
data: | A data container. |
Returns : | The newly created data window. |
gint gwy_app_data_window_set_untitled (GwyDataWindow *window, const gchar *templ);
Clears any file name for window and sets its "/filename/untitled" data.
The template tring templ can be either NULL, the window then gets a title like "Untitled 37", or a string "Foo" not containing `%', the window then gets a title like "Foo 42", or a string "Bar %d" containing a single '%d', the window then gets a title like "Bar 666".
window: | A data window. |
templ: | A title template string. |
Returns : | The number that will appear in the title (probably useless). |
void gwy_app_data_view_update (GtkWidget *data_view);
Repaints a data view.
Use this function instead of gwy_data_view_update() if you want to automatically show (hide) the mask layer if present (missing).
data_view: | A GwyDataView. |
void gwy_app_change_mask_color_cb (gpointer unused, gboolean defaultc);
unused: | |
defaultc: |
gulong gwy_app_data_window_list_add_hook (gpointer func, gpointer data);
Adds a hook function called just after a data window is created or destroyed.
func: | Function to be called (with data as its only argument). |
data: | Data passed to func. |
Returns : | Hook id to be used in gwy_app_data_window_list_remove_hook(). |
Since 1.2.
gboolean gwy_app_data_window_list_remove_hook (gulong hook_id);
Removes a data window list hook function added by gwy_app_data_window_list_add_hook().
hook_id: | Hook id, as returned by gwy_app_data_window_list_add_hook(). |
Returns : | Whether such a hook was found and removed. |
Since 1.2.
GtkWidget* gwy_app_graph_window_get_current (void);
Returns the currently active graph window.
Returns : | The active graph window as a GtkWidget. May return NULL if none is currently active. |
void gwy_app_graph_window_set_current (GtkWidget *window);
Makes a graph window active.
Eventually adds window it to the graph window list if it isn't present there.
window: | A graph window. |
void gwy_app_graph_window_remove (GtkWidget *window);
Removes the graph window window from the list of graph windows.
All associated structures are freed.
window: | A data window. |
GtkWidget* gwy_app_graph_window_create (GtkWidget *graph);
Creates a new graph window showing data and does some basic setup.
Also calls gtk_window_present() on it.
graph: | A GwyGraph; |
Returns : | The newly created graph window. |
void gwy_app_tool_use_cb (const gchar *toolname, GtkWidget *button);
toolname: | |
button: |
GtkWidget* gwy_app_main_window_get (void);
Returns Gwyddion main application window (toolbox).
Returns : | The Gwyddion toolbox. |
void gwy_app_main_window_set (GtkWidget *window);
Sets Gwyddion main application window (toolbox) for gwy_app_main_window_get().
This function can be called only once and should be called at Gwyddion startup so, ignore it.
window: | A window. |
void gwy_app_clean_up_data (GwyContainer *data);
Cleans-up a data container.
XXX: Generally, it should remove some things that you might not want to copy to the new data window. Currently it removes selection.
data: | A data container. |
<< Gwyddion Application Library | file >> |