gimpenv

Name

gimpenv -- Functions to access the GIMP environment.

Synopsis



gchar*      gimp_directory                  (void);
gchar*      gimp_personal_rc_file           (gchar *basename);
gchar*      gimp_data_directory             (void);
gchar*      gimp_gtkrc                      (void);

Description

A set of functions to find the locations of GIMP's data directories and configuration files.

Details

gimp_directory ()

gchar*      gimp_directory                  (void);

Returns the user-specific GIMP settings directory. If the environment variable GIMP_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 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 GIMP_DIRECTORY environment variable exists, and then we use the GIMPDIR subdirectory of the home directory. If no home directory exists, we use a per-user subdirectory of gimp_data_directory(). In any case, we always return some non-empty string, whether it corresponds to an existing directory or not.

The returned string is allocated just once, and should *NOT* be freed with g_free().

Returns : The user-specific GIMP settings directory.


gimp_personal_rc_file ()

gchar*      gimp_personal_rc_file           (gchar *basename);

Returns the name of a file in the user-specific GIMP settings directory.

The returned string is allocated dynamically and *SHOULD* be freed with g_free() after use.

basename : The basename of a rc_file.
Returns : The name of a file in the user-specific GIMP settings directory.


gimp_data_directory ()

gchar*      gimp_data_directory             (void);

Returns the top directory for GIMP data. If the environment variable GIMP_DATADIR exists, that is used. It should be an absolute pathname. Otherwise, on Unix the compile-time defined directory is used. On Win32, the installation directory as deduced from the executable's name is used.

The returned string is allocated just once, and should *NOT* be freed with g_free().

Returns : The top directory for GIMP data.


gimp_gtkrc ()

gchar*      gimp_gtkrc                      (void);

Returns the name of the GIMP's application-specific gtkrc file.

The returned string is allocated just once, and should *NOT* be freed with g_free().

Returns : The name of the GIMP's application-specific gtkrc file.