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);
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);
GtkWidget*  gwy_app_main_window_get         (void);
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.

The window must be present in the list.

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

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.


gwy_app_data_window_list_remove_hook ()

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.


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

GtkWidget*  gwy_app_main_window_get         (void);

Returns Gwyddion main application window (toolbox).

Returns : The Gwyddion toolbox.

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.