| Top |
| void | gwy_app_init_widget_styles () |
| void | gwy_app_init () |
| const gchar * | gwy_app_get_tree_model_kind () |
| void | gwy_app_set_tree_model_kind () |
void
gwy_app_init_widget_styles (GdkScreen *screen);
Sets up style properties for special Gwyddion widgets.
Usually it is done as a part of gwy_app_init(). It exists for the case when you need to do the initialisation steps
separately.
void gwy_app_init (gboolean for_gui,const gchar *option,...);
Performs common initialisations useful for programs utilising Gwyddion libraries.
Regardless of the value of for_gui
, the function initialises gwyddion libraries, loads resources, loads settings
and imports modules (see below for pygwy). It also disables undo and GUI for the data browser as they are unlikely
to be useful outside Gwyddion itself.
If for_gui
is TRUE the function initialises GTK+ as follows
1 |
gtk_init(NULL, NULL); |
GUI programs which wish to initialise GTK+ differently need to call gtk_init() or some other GTK+ initialisation
function explicitly prior to calling gwy_app_init(), making the default call no-op. It also sets up
Gwyddion-specific widget styles.
If for_gui
is FALSE the function sets up logging to console (see also below) and does additional setup for for
non-GUI operation. In particular, it disables GUI for waiting.
There are currently the following options:
"enable-threads" with gboolean value. If TRUE or FALSE is passed gwy_threads_set_enabled() will be called with
this settings. By default, the multithread processing state is unchanged.
"enable-pygwy" with gboolean value. If TRUE is passed then pygwy will not be prevented from loading. Passing
FALSE is the same as not setting the option at all and will result in pygwy being prevented from loading using
gwy_module_disable_registration().
"no-logging-setup" with gboolean value. If TRUE is passed then logging setup is unchanged. Passing FALSE is the
same as not setting the option at all and will set up logging to console in non-GUI mode.
So, for instance a program non-GUI wanting to enable multithread processing in Gwyddion functions (provided it is built in) can run
1 |
gwy_app_init(FALSE, "enable-threads", TRUE, NULL); |
const gchar *
gwy_app_get_tree_model_kind (GtkTreeModel *model);
Identifies the kind of tree model.
Receivers of tree model drag data can use this function to see if the source is a known Gwyddion DnD data source. The known kinds include data browser lists "image", "graph", "spectra", "volume", "xyz" and "cmap". However, these lists store only to internal data browser structures, making them useful drag sources only within libgwyapp itself.
Graph window curve lists are of "graph-curves" kind and the selection manager tool selection list is "image-selections".
void gwy_app_set_tree_model_kind (GtkTreeModel *model,const gchar *kind);
Sets the kind of a tree model.
You should almost never need this function because all standard tree models usable as drag sources set the kind
themselves. See also gwy_app_get_tree_model_kind().