Top |
void | gimp_env_init () |
const gchar * | gimp_directory () |
const gchar * | gimp_installation_directory () |
const gchar * | gimp_data_directory () |
const gchar * | gimp_locale_directory () |
const gchar * | gimp_plug_in_directory () |
const gchar * | gimp_sysconf_directory () |
const gchar * | gimp_cache_directory () |
const gchar * | gimp_temp_directory () |
GFile * | gimp_directory_file () |
GFile * | gimp_installation_directory_file () |
GFile * | gimp_data_directory_file () |
GFile * | gimp_locale_directory_file () |
GFile * | gimp_sysconf_directory_file () |
GFile * | gimp_plug_in_directory_file () |
const gchar * | gimp_user_directory () |
gchar * | gimp_personal_rc_file () |
const gchar * | gimp_gtkrc () |
GList * | gimp_path_parse () |
gchar * | gimp_path_to_str () |
void | gimp_path_free () |
gchar * | gimp_path_get_user_writable_dir () |
A set of functions to find the locations of GIMP's data directories and configuration files.
void
gimp_env_init (gboolean plug_in
);
You don't need to care about this function. It is being called for
you automatically (by means of the MAIN()
macro that every plug-in
runs). Calling it again will cause a fatal error.
Since: 2.4
const gchar *
gimp_directory (void
);
Returns the user-specific GIMP settings directory. If the
environment variable GIMP2_DIRECTORY exists, it is used. If it is
an absolute path, it is used as is. If it is a relative path, it
is taken to be a subdirectory of the home directory. If it is a
relative path, and no home directory can be determined, it is taken
to be a subdirectory of gimp_data_directory()
.
The usual case is that no GIMP2_DIRECTORY environment variable exists, and then we use the GIMPDIR subdirectory of the local configuration directory:
UNIX: $XDG_CONFIG_HOME (defaults to $HOME/.config/)
Windows: CSIDL_APPDATA
OSX (UNIX exception): the Application Support Directory.
If neither the configuration nor home directory exist,
g_get_user_config_dir()
will return {tmp}/{user_name}/.config/ where
the temporary directory {tmp} and the {user_name} are determined
according to platform rules.
In any case, we always return some non-empty string, whether it corresponds to an existing directory or not.
In config files such as gimprc, the string ${gimp_dir} expands to this directory.
The returned string is owned by GIMP and must not be modified or freed. The returned string is in the encoding used for filenames by GLib, which isn't necessarily UTF-8 (on Windows it is always UTF-8.)
const gchar *
gimp_installation_directory (void
);
Returns the top installation directory of GIMP. On Unix the compile-time defined installation prefix is used. On Windows, the installation directory as deduced from the executable's full filename is used. On OSX we ask [NSBundle mainBundle] for the resource path to check if GIMP is part of a relocatable bundle.
In config files such as gimprc, the string ${gimp_installation_dir} expands to this directory.
The returned string is owned by GIMP and must not be modified or freed. The returned string is in the encoding used for filenames by GLib, which isn't necessarily UTF-8. (On Windows it always is UTF-8.)
Since: 2.8
const gchar *
gimp_data_directory (void
);
Returns the default top directory for GIMP data. If the environment variable GIMP2_DATADIR exists, that is used. It should be an absolute pathname. Otherwise, on Unix the compile-time defined directory is used. On Windows, the installation directory as deduced from the executable's full filename is used.
Note that the actual directories used for GIMP data files can be overridden by the user in the preferences dialog.
In config files such as gimprc, the string ${gimp_data_dir} expands to this directory.
The returned string is owned by GIMP and must not be modified or freed. The returned string is in the encoding used for filenames by GLib, which isn't necessarily UTF-8. (On Windows it always is UTF-8.)
const gchar *
gimp_locale_directory (void
);
Returns the top directory for GIMP locale files. If the environment variable GIMP2_LOCALEDIR exists, that is used. It should be an absolute pathname. Otherwise, on Unix the compile-time defined directory is used. On Windows, the installation directory as deduced from the executable's full filename is used.
The returned string is owned by GIMP and must not be modified or
freed. The returned string is in the encoding used for filenames by
the C library, which isn't necessarily UTF-8. (On Windows, unlike
the other similar functions here, the return value from this
function is in the system codepage, never in UTF-8. It can thus be
passed directly to the bindtextdomain()
function from libintl which
does not handle UTF-8.)
const gchar *
gimp_plug_in_directory (void
);
Returns the default top directory for GIMP plug-ins and modules. If the environment variable GIMP2_PLUGINDIR exists, that is used. It should be an absolute pathname. Otherwise, on Unix the compile-time defined directory is used. On Windows, the installation directory as deduced from the executable's full filename is used.
Note that the actual directories used for GIMP plug-ins and modules can be overridden by the user in the preferences dialog.
In config files such as gimprc, the string ${gimp_plug_in_dir} expands to this directory.
The returned string is owned by GIMP and must not be modified or freed. The returned string is in the encoding used for filenames by GLib, which isn't necessarily UTF-8. (On Windows it always is UTF-8.)
const gchar *
gimp_sysconf_directory (void
);
Returns the top directory for GIMP config files. If the environment variable GIMP2_SYSCONFDIR exists, that is used. It should be an absolute pathname. Otherwise, on Unix the compile-time defined directory is used. On Windows, the installation directory as deduced from the executable's full filename is used.
In config files such as gimprc, the string ${gimp_sysconf_dir} expands to this directory.
The returned string is owned by GIMP and must not be modified or freed. The returned string is in the encoding used for filenames by GLib, which isn't necessarily UTF-8. (On Windows it always is UTF-8.).
const gchar *
gimp_cache_directory (void
);
Returns the default top directory for GIMP cached files. If the
environment variable GIMP2_CACHEDIR exists, that is used. It
should be an absolute pathname. Otherwise, a subdirectory of the
directory returned by g_get_user_cache_dir()
is used.
Note that the actual directories used for GIMP caches files can be overridden by the user in the preferences dialog.
In config files such as gimprc, the string ${gimp_cache_dir} expands to this directory.
The returned string is owned by GIMP and must not be modified or freed. The returned string is in the encoding used for filenames by GLib, which isn't necessarily UTF-8. (On Windows it always is UTF-8.).
Since: 2.10.10
const gchar *
gimp_temp_directory (void
);
Returns the default top directory for GIMP temporary files. If the
environment variable GIMP2_TEMPDIR exists, that is used. It
should be an absolute pathname. Otherwise, a subdirectory of the
directory returned by g_get_tmp_dir()
is used.
In config files such as gimprc, the string ${gimp_temp_dir} expands to this directory.
Note that the actual directories used for GIMP temporary files can be overridden by the user in the preferences dialog.
The returned string is owned by GIMP and must not be modified or freed. The returned string is in the encoding used for filenames by GLib, which isn't necessarily UTF-8. (On Windows it always is UTF-8.).
Since: 2.10.10
GFile * gimp_directory_file (const gchar *first_element
,...
);
Returns a GFile in the user's GIMP directory, or the data
directory itself if first_element
is NULL
.
See also: gimp_directory()
.
first_element |
the first element of a path to a file in the
user's GIMP directory, or |
|
... |
a |
Since: 2.10
GFile * gimp_installation_directory_file (const gchar *first_element
,...
);
Returns a GFile in the installation directory, or the installation
directory itself if first_element
is NULL
.
See also: gimp_installation_directory()
.
first_element |
the first element of a path to a file in the
top installation directory, or |
|
... |
a |
Since: 2.10.10
GFile * gimp_data_directory_file (const gchar *first_element
,...
);
Returns a GFile in the data directory, or the data directory
itself if first_element
is NULL
.
See also: gimp_data_directory()
.
first_element |
the first element of a path to a file in the
data directory, or |
|
... |
a |
Since: 2.10
GFile * gimp_locale_directory_file (const gchar *first_element
,...
);
Returns a GFile in the locale directory, or the locale directory
itself if first_element
is NULL
.
See also: gimp_locale_directory()
.
first_element |
the first element of a path to a file in the
locale directory, or |
|
... |
a |
Since: 2.10
GFile * gimp_sysconf_directory_file (const gchar *first_element
,...
);
Returns a GFile in the sysconf directory, or the sysconf directory
itself if first_element
is NULL
.
See also: gimp_sysconf_directory()
.
first_element |
the first element of a path to a file in the
sysconf directory, or |
|
... |
a |
Since: 2.10
GFile * gimp_plug_in_directory_file (const gchar *first_element
,...
);
Returns a GFile in the plug-in directory, or the plug-in directory
itself if first_element
is NULL
.
See also: gimp_plug_in_directory()
.
first_element |
the first element of a path to a file in the
plug-in directory, or |
|
... |
a |
Since: 2.10
const gchar *
gimp_user_directory (GimpUserDirectory type
);
gimp_user_directory
is deprecated and should not be used in newly-written code.
This procedure is deprecated! Use g_get_user_special_dir()
instead.
Since: 2.4
gchar *
gimp_personal_rc_file (const gchar *basename
);
Returns the name of a file in the user-specific GIMP settings directory.
The returned string is newly allocated and should be freed with
g_free()
after use. The returned string is in the encoding used for
filenames by GLib, which isn't necessarily UTF-8. (On Windows it
always is UTF-8.)
const gchar *
gimp_gtkrc (void
);
Returns the name of GIMP's application-specific gtkrc file.
The returned string is owned by GIMP and must not be modified or freed. The returned string is in the encoding used for filenames by GLib, which isn't necessarily UTF-8. (On Windows it always is UTF-8.)
GList * gimp_path_parse (const gchar *path
,gint max_paths
,gboolean check
,GList **check_failed
);
void
gimp_path_free (GList *path
);
This function frees the memory allocated for the list and the strings it contains.