![]() |
![]() |
Gwyddion Application Library Reference Manual | ![]() |
---|
appapp — Core application interface, window management |
enum GwyAppWindowType; GwyContainer* gwy_app_get_current_data (void); GwyDataWindow* gwy_app_data_window_get_current (void); gboolean 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); gulong gwy_app_data_window_list_add_hook (gpointer func, gpointer data); gboolean gwy_app_data_window_list_remove_hook (gulong hook_id); GwyDataWindow* gwy_app_data_window_get_for_data (GwyContainer *data); GtkWidget* gwy_app_graph_window_create (GwyGraph *graph, GwyContainer *data); void gwy_app_graph_window_remove (GtkWidget *window); void gwy_app_graph_window_foreach (GFunc func, gpointer user_data); GtkWidget* gwy_app_graph_window_get_current (void); gboolean gwy_app_graph_window_set_current (GtkWidget *window); GtkWidget* gwy_app_3d_window_create (GwyDataWindow *data_window); void gwy_app_3d_window_remove (GtkWidget *window); GtkWidget* gwy_app_3d_window_get_current (void); gboolean gwy_app_3d_window_set_current (GtkWidget *window); GtkWidget* gwy_app_get_current_window (GwyAppWindowType type); gint gwy_app_data_window_set_untitled (GwyDataWindow *window, const gchar *templ); void gwy_app_add_main_accel_group (GtkWindow *window); void gwy_app_save_window_position (GtkWindow *window, const gchar *prefix, gboolean position, gboolean size); void gwy_app_restore_window_position (GtkWindow *window, const gchar *prefix, gboolean grow_only); GtkWidget* gwy_app_main_window_get (void); gboolean gwy_app_quit (void); void gwy_app_data_window_setup (GwyDataWindow *data_window);
typedef enum { GWY_APP_WINDOW_TYPE_DATA = 1, GWY_APP_WINDOW_TYPE_GRAPH = 2, GWY_APP_WINDOW_TYPE_3D = 4, GWY_APP_WINDOW_TYPE_ANY = 7 } GwyAppWindowType;
Application window types.
GWY_APP_WINDOW_TYPE_DATA | Normal 2D data window. |
GWY_APP_WINDOW_TYPE_GRAPH | Graph window. |
GWY_APP_WINDOW_TYPE_3D | 3D view window. |
GWY_APP_WINDOW_TYPE_ANY | Window of any type. |
GwyContainer* gwy_app_get_current_data (void);
gwy_app_get_current_data is deprecated and should not be used in newly-written code.
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);
gwy_app_data_window_get_current is deprecated and should not be used in newly-written code.
Returns the currently active data window, may be NULL if none is active.
Returns : | The active data window as a GwyDataWindow. |
gboolean gwy_app_data_window_set_current (GwyDataWindow *window);
gwy_app_data_window_set_current is deprecated and should not be used in newly-written code.
Makes a data window current, including tool switch, etc.
The window must be present in the list.
window : | A data window. |
Returns : | Always FALSE, no matter what (to be usable as an event handler). |
void gwy_app_data_window_remove (GwyDataWindow *window);
gwy_app_data_window_remove is deprecated and should not be used in newly-written code.
Removes the data window window from the list of data windows.
All associated structures are freed, active tool gets switched to NULL window. But the widget itself is NOT destroyed by this function. It just makes the application `forget' about the window.
window : | A data window. |
void gwy_app_data_window_foreach (GFunc func, gpointer user_data);
gwy_app_data_window_foreach is deprecated and should not be used in newly-written code.
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);
gwy_app_data_window_create is deprecated and should not be used in newly-written code.
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. |
gulong gwy_app_data_window_list_add_hook (gpointer func, gpointer data);
gwy_app_data_window_list_add_hook is deprecated and should not be used in newly-written code.
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(). |
gboolean gwy_app_data_window_list_remove_hook (gulong hook_id);
gwy_app_data_window_list_remove_hook is deprecated and should not be used in newly-written code.
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. |
GwyDataWindow* gwy_app_data_window_get_for_data (GwyContainer *data);
gwy_app_data_window_get_for_data is deprecated and should not be used in newly-written code.
Finds a data window displaying given data.
data : | A data container. |
Returns : | Data window displaying given data, or NULL if there is no such data window. |
GtkWidget* gwy_app_graph_window_create (GwyGraph *graph, GwyContainer *data);
gwy_app_graph_window_create is deprecated and should not be used in newly-written code.
Creates a new graph window showing a graph and does some basic setup.
It calls gwy_app_graph_list_add() and does not assume a reference on the graph model, so you usually wish to unreference it after this call.
Also calls gtk_window_present() on the newly created window, associates it with a data window, and sets its title.
graph : | A graph widget. |
data : | A data container to put the graph model to. |
Returns : | The newly created graph window. |
void gwy_app_graph_window_remove (GtkWidget *window);
gwy_app_graph_window_remove is deprecated and should not be used in newly-written code.
Removes the graph window window from the list of graph windows.
All associated structures are freed, but the widget itself is NOT destroyed by this function. It just makes the application `forget' about the window.
window : | A graph window. |
void gwy_app_graph_window_foreach (GFunc func, gpointer user_data);
gwy_app_graph_window_foreach is deprecated and should not be used in newly-written code.
Calls func on each graph window, in no particular order.
The function should not create or remove graph windows.
func : | A function to call on each graph window. |
user_data : | Data to pass to func. |
GtkWidget* gwy_app_graph_window_get_current (void);
gwy_app_graph_window_get_current is deprecated and should not be used in newly-written code.
Returns the currently active graph window.
Returns : | The active graph window as a GtkWidget. May return NULL if none is currently active. |
gboolean gwy_app_graph_window_set_current (GtkWidget *window);
gwy_app_graph_window_set_current is deprecated and should not be used in newly-written code.
Makes a graph window current.
Eventually adds window it to the graph window list if it isn't present there.
window : | A graph window. |
Returns : | Always FALSE, no matter what (to be usable as an event handler). |
GtkWidget* gwy_app_3d_window_create (GwyDataWindow *data_window);
gwy_app_3d_window_create is deprecated and should not be used in newly-written code.
Creates a new 3D view window showing the same data as data_window.
Also does some housekeeping and calls gtk_window_present() on it.
data_window : | A data window to create associated 3D view for. |
Returns : | The newly created 3D view window. |
void gwy_app_3d_window_remove (GtkWidget *window);
gwy_app_3d_window_remove is deprecated and should not be used in newly-written code.
Removes the 3D view window window from the list of 3D view windows.
All associated structures are freed, but the widget itself is NOT destroyed by this function. It just makes the application `forget' about the window.
window : | A 3D view window. |
GtkWidget* gwy_app_3d_window_get_current (void);
gwy_app_3d_window_get_current is deprecated and should not be used in newly-written code.
Returns the currently active 3D view window.
Returns : | The active 3D view window as a GtkWidget. May return NULL if none is currently active. |
gboolean gwy_app_3d_window_set_current (GtkWidget *window);
gwy_app_3d_window_set_current is deprecated and should not be used in newly-written code.
Makes a 3D view window current.
Eventually adds window it to the 3D view window list if it isn't present there.
window : | A 3D view window. |
Returns : | Always FALSE, no matter what (to be usable as an event handler). |
GtkWidget* gwy_app_get_current_window (GwyAppWindowType type);
gwy_app_get_current_window is deprecated and should not be used in newly-written code.
Returns the currently active window of a given type.
type : | Type of window to return. |
Returns : | The window, or NULL if there is no such window. |
gint gwy_app_data_window_set_untitled (GwyDataWindow *window, const gchar *templ);
gwy_app_data_window_set_untitled is deprecated and should not be used in newly-written code.
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_add_main_accel_group (GtkWindow *window);
Adds main (global) application accelerator group to a window.
window : | A window. |
void gwy_app_save_window_position (GtkWindow *window, const gchar *prefix, gboolean position, gboolean size);
Saves position and/or size of a window to settings.
Some sanity checks are included, therefore if window position and/or size is too suspicious, it is not saved.
window : | A window to save position of. |
prefix : | Unique prefix in settings to store the information under. |
position : | TRUE to save position information. |
size : | TRUE to save size information. |
void gwy_app_restore_window_position (GtkWindow *window, const gchar *prefix, gboolean grow_only);
Restores a window position and/or size from settings.
Unlike gwy_app_save_window_position(), this function has no position and size arguments, it simply restores all attributes that were saved.
Note to restore position (not size) it should be called twice for each window to accommodate sloppy window managers: once before the window is shown, second time immediately after showing the window.
Some sanity checks are included, therefore if saved window position and/or size is too suspicious, it is not restored.
window : | A window to restore position of. |
prefix : | Unique prefix in settings to get the information from (the same as in gwy_app_save_window_position()). |
grow_only : | TRUE to only attempt set the window default size bigger than it requests, never smaller. |
GtkWidget* gwy_app_main_window_get (void);
Returns Gwyddion main application window (toolbox).
Returns : | The Gwyddion toolbox. |
void gwy_app_data_window_setup (GwyDataWindow *data_window);
data_window : |
<< Gwyddion Application Library Reference Manual | data-browser >> |