GrafX2 2.9.3227
The ultimate 256-color painting program
|
Functions that determine where grafx2 is running, finds its data, and reads and writes configuration files. More...
Macros | |
#define | FONTS_SUBDIRECTORY "fonts" |
Name of the subdirectory containing fonts, under the data directory (Get_data_directory()) More... | |
#define | SKINS_SUBDIRECTORY "skins" |
Name of the subdirectory containing fonts, under the data directory (Get_data_directory()) More... | |
#define | SCRIPTS_SUBDIRECTORY "scripts" |
Name of the subdirectory containing scripts. More... | |
#define | LUALIB_SUBDIRECTORY "libs" |
LUA directory prefix. More... | |
#define | CONFIG_FILENAME "gfx2.cfg" |
Name of the binary file containing some configuration settings. More... | |
#define | INI_FILENAME "gfx2.ini" |
Name of the text file containing some settings in INI format. More... | |
#define | INISAVE_FILENAME "gfx2.$$$" |
Name of the backup of the INI file. More... | |
#define | INIDEF_FILENAME "gfx2def.ini" |
Name of the default .INI file (read-only: gives .INI format and defaults) More... | |
#define | DEFAULTPAL_FILENAME "default.pal" |
Name of the default palette file. More... | |
#define | SAFETYBACKUP_PREFIX_A "a" |
Prefix for filenames of safety backups (main) More... | |
#define | SAFETYBACKUP_PREFIX_B "b" |
Prefix for filenames of safety backups (spare) More... | |
#define | GFX2_ICON_FILENAME "gfx2.gif" |
Name of the image file that serves as an application icon. More... | |
#define | DEFAULT_SKIN_FILENAME "skin_DPaint.png" |
Name of the image file for the default (and fallback) GUI skin. More... | |
#define | DEFAULT_FONT_FILENAME "font_DPaint.png" |
Name of the image file for the default (and fallback) 8x8 font. More... | |
#define | BACKUP_FILE_EXTENSION ".bkp" |
File extension for safety backups. More... | |
#define | FONT_PREFIX "font_" |
File prefix for fonts. More... | |
#define | SKIN_PREFIX "skin_" |
File prefix for skins. More... | |
Functions | |
char * | Get_program_directory (const char *argv0) |
Determine which directory contains the executable. More... | |
char * | Get_data_directory (const char *program_dir) |
Determine which directory contains the read-only data. More... | |
char * | Get_config_directory (const char *program_dir) |
Determine which directory should store the user's configuration. More... | |
Functions that determine where grafx2 is running, finds its data, and reads and writes configuration files.
#define FONTS_SUBDIRECTORY "fonts" |
Name of the subdirectory containing fonts, under the data directory (Get_data_directory())
#define SKINS_SUBDIRECTORY "skins" |
Name of the subdirectory containing fonts, under the data directory (Get_data_directory())
#define SCRIPTS_SUBDIRECTORY "scripts" |
Name of the subdirectory containing scripts.
#define LUALIB_SUBDIRECTORY "libs" |
LUA directory prefix.
#define CONFIG_FILENAME "gfx2.cfg" |
Name of the binary file containing some configuration settings.
#define INI_FILENAME "gfx2.ini" |
Name of the text file containing some settings in INI format.
#define INISAVE_FILENAME "gfx2.$$$" |
Name of the backup of the INI file.
#define INIDEF_FILENAME "gfx2def.ini" |
Name of the default .INI file (read-only: gives .INI format and defaults)
#define DEFAULTPAL_FILENAME "default.pal" |
Name of the default palette file.
#define SAFETYBACKUP_PREFIX_A "a" |
Prefix for filenames of safety backups (main)
#define SAFETYBACKUP_PREFIX_B "b" |
Prefix for filenames of safety backups (spare)
#define GFX2_ICON_FILENAME "gfx2.gif" |
Name of the image file that serves as an application icon.
#define DEFAULT_SKIN_FILENAME "skin_DPaint.png" |
Name of the image file for the default (and fallback) GUI skin.
#define DEFAULT_FONT_FILENAME "font_DPaint.png" |
Name of the image file for the default (and fallback) 8x8 font.
#define BACKUP_FILE_EXTENSION ".bkp" |
File extension for safety backups.
#define FONT_PREFIX "font_" |
File prefix for fonts.
#define SKIN_PREFIX "skin_" |
File prefix for skins.
char * Get_program_directory | ( | const char * | argv0 | ) |
Determine which directory contains the executable.
argv0 | Main's argv[0], some platforms need it, some don't. |
References Extract_path(), Get_current_directory(), GFX2_DEBUG, GFX2_Log(), GFX2_WARNING, haiku_get_app_path(), MAX_PATH_CHARACTERS, NULL, PATH_MAX, and PATH_SEPARATOR.
Referenced by Init_program().
char * Get_data_directory | ( | const char * | program_dir | ) |
Determine which directory contains the read-only data.
program_dir | The directory containing the executable |
References Filepath_append_to_dir(), Get_data_directory(), and PATH_MAX.
Referenced by Get_data_directory(), and Init_program().
char * Get_config_directory | ( | const char * | program_dir | ) |
Determine which directory should store the user's configuration.
For most Unix and Windows platforms: If a config file already exists in program_dir, it will return it in priority (Useful for development, and possibly for upgrading from DOS version) If the standard directory doesn't exist yet, this function will attempt to create it (/root/.grafx2, or APPDATA%\GrafX2) If it cannot be created, this function will return the executable's own directory.
program_dir | The directory containing the executable |
References CONFIG_FILENAME, Directory_create(), Directory_exists(), File_exists(), Filepath_append_to_dir(), GFX2_INFO, GFX2_Log(), GFX2_WARNING, MAX_PATH_CHARACTERS, PATH_SEPARATOR, and Portable_Installation_Detected.
Referenced by Init_program().