Geany dev
Functions
main.h File Reference

Main program-related commands. More...

Functions

gboolean geany_is_closing_all_documents (void)
 Checks whether Geany is 'closing all' documents right now. More...
 
gboolean main_is_realized (void)
 Checks whether the main window has been realized. More...
 
void main_locale_init (const gchar *locale_dir, const gchar *gettext_package)
 Initialises the gettext translation system. More...
 
void main_reload_configuration (void)
 Reloads most of Geany's configuration files without restarting. More...
 

Detailed Description

Main program-related commands.

Handles program initialization and cleanup.

Function Documentation

◆ geany_is_closing_all_documents()

gboolean geany_is_closing_all_documents ( void  )

Checks whether Geany is 'closing all' documents right now.

Returns
TRUE if the Geany is 'closing all' documents right now or FALSE otherwise.

◆ main_is_realized()

gboolean main_is_realized ( void  )

Checks whether the main window has been realized.

This is an easy indicator whether Geany is right now starting up (main window is not yet realized) or whether it has finished the startup process (main window is realized). This is because the main window is realized (i.e. actually drawn on the screen) at the end of the startup process.

Note
Maybe you want to use the "geany-startup-complete" signal to get notified about the completed startup process.
Returns
TRUE if the Geany main window has been realized or FALSE otherwise.
Since
0.19

◆ main_locale_init()

void main_locale_init ( const gchar *  locale_dir,
const gchar *  package 
)

Initialises the gettext translation system.

This is a convenience function to set up gettext for internationalisation support in external plugins. You should call this function early in plugin_init(). If the macro HAVE_LOCALE_H is defined, setlocale(LC_ALL, "") is called. The codeset for the message translations is set to UTF-8.

Note that this function only setups the gettext textdomain for you. You still have to adjust the build system of your plugin to get internationalisation support working properly.

If you have already used PLUGIN_SET_TRANSLATABLE_INFO() you don't need to call main_locale_init() again as it has already been done.

Parameters
locale_dirThe location where the translation files should be searched. This is usually the LOCALEDIR macro, defined by the build system. E.g. $prefix/share/locale. Only used on non-Windows systems. On Windows, the directory is determined by g_win32_get_package_installation_directory().
packageThe package name, usually this is the GETTEXT_PACKAGE macro, defined by the build system.
Since
0.16

◆ main_reload_configuration()

void main_reload_configuration ( void  )

Reloads most of Geany's configuration files without restarting.

Currently the following files are reloaded: all template files, also new file templates and the 'New (with template)' menus will be updated, Snippets (snippets.conf), filetype extensions (filetype_extensions.conf), and 'settings' and 'build_settings' sections of the filetype definition files.

Plugins may call this function if they changed any of these files (e.g. a configuration file editor plugin).

Since
0.15