app

app — Core application interface.

Synopsis




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

Description

Details

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

gwy_app_data_window_get_current ()

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.

gwy_app_data_window_set_current ()

void        gwy_app_data_window_set_current (GwyDataWindow *window);

Makes a data window active, including tool switch, etc.

Eventually adds window it to the data window list if it isn't present there.

window: A data window.

gwy_app_data_window_remove ()

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.

gwy_app_data_window_foreach ()

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.

gwy_app_data_window_create ()

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.

gwy_app_data_window_set_untitled ()

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

gwy_app_data_view_update ()

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.

gwy_app_change_mask_color_cb ()

void        gwy_app_change_mask_color_cb    (gpointer unused,
                                             gboolean defaultc);

unused:
defaultc:

gwy_app_graph_window_get_current ()

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.

gwy_app_graph_window_set_current ()

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.

gwy_app_graph_window_remove ()

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.

gwy_app_graph_window_create ()

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.

gwy_app_tool_use_cb ()

void        gwy_app_tool_use_cb             (const gchar *toolname,
                                             GtkWidget *button);

toolname:
button:

gwy_app_zoom_set_cb ()

void        gwy_app_zoom_set_cb             (gpointer data);

data:

gwy_app_mask_kill_cb ()

void        gwy_app_mask_kill_cb            (void);


gwy_app_show_kill_cb ()

void        gwy_app_show_kill_cb            (void);


gwy_app_main_window_get ()

GtkWidget*  gwy_app_main_window_get         (void);

Returns Gwyddion main application window (toolbox).

Returns : The Gwyddion toolbox.

gwy_app_main_window_set ()

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.

gwy_app_quit ()

gboolean    gwy_app_quit                    (void);

Returns :

gwy_app_clean_up_data ()

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.