Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
path-prefix.h File Reference

TODO: insert short description here. More...

Go to the source code of this file.

Functions

char const * get_inkscape_datadir ()
 Determine the location of the Inkscape data directory (typically the share/ folder from where Inkscape should be loading resources).
 
char const * get_program_name ()
 Gets the the currently running program's executable name (including full path)
 
char const * get_program_dir ()
 Gets the the full path to the directory containing the currently running program's executable.
 
char const * get_user_config_dir ()
 Get the user configuration directory.
 
void set_xdg_env ()
 Sets environment variables for a relocatable application bundle.
 

Detailed Description

TODO: insert short description here.

Definition in file path-prefix.h.

Function Documentation

◆ get_inkscape_datadir()

char const * get_inkscape_datadir ( )

Determine the location of the Inkscape data directory (typically the share/ folder from where Inkscape should be loading resources).

The data directory is the first of:

  • Environment variable $INKSCAPE_DATADIR if not empty
  • If a bundle is detected: "<bundle-prefix>/share"
  • Compile time value of INKSCAPE_DATADIR

Definition at line 79 of file path-prefix.cpp.

References _get_bundle_prefix_dir().

Referenced by Inkscape::IO::Resource::_get_path(), Inkscape::initialize_gettext(), Inkscape::UI::Dialog::InkscapePreferences::initPageSystem(), InkscapeApplication::on_handle_local_options(), print_system_data_directory(), set_themes_env(), and set_xdg_env().

◆ get_program_dir()

char const * get_program_dir ( )

Gets the the full path to the directory containing the currently running program's executable.

Returns
full path to directory encoded in native encoding, or NULL if it can't be determined

Definition at line 256 of file path-prefix.cpp.

References get_program_name().

Referenced by _get_bundle_prefix_dir(), main(), and set_extensions_env().

◆ get_program_name()

char const * get_program_name ( )

Gets the the currently running program's executable name (including full path)

Returns
executable name (including full path) encoded as UTF-8 or NULL if it can't be determined

Definition at line 193 of file path-prefix.cpp.

References buf, bufsize, len, name, and program_name.

Referenced by get_program_dir().

◆ get_user_config_dir()

char const * get_user_config_dir ( )

Get the user configuration directory.

Definition at line 181 of file path-prefix.cpp.

References set_xdg_env().

Referenced by Inkscape::IO::Resource::profile_path().

◆ set_xdg_env()

void set_xdg_env ( )

Sets environment variables for a relocatable application bundle.

Only does work on the first call, follow-up calls immediately return.

Only sets environment variables if this actually looks like a relocatable bundle.

Currently only handles macOS. Windows and Linux (AppImage) use alternative solutions.

Definition at line 112 of file path-prefix.cpp.

References get_inkscape_datadir(), and ready.

Referenced by get_user_config_dir(), and main().