diff options
author | Andrea Weikert <elubie@gmx.net> | 2010-07-04 19:35:23 +0400 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2010-07-04 19:35:23 +0400 |
commit | ca81aa704e958a73a55e79654f70eaa9a0fad85a (patch) | |
tree | 8b40e3a7613df4e707fcc8efb3a099f9445ac350 /source/blender/blenlib/BLI_path_util.h | |
parent | 3ca7b160a664e74c6815056a4a8596bb4c2b70be (diff) |
Patch [#22339] File/installation paths changes
Patch Tracker: http://projects.blender.org/tracker/?func=detail&aid=22339&group_id=9&atid=127
This patch implements the proposal outlined here:
http://wiki.blender.org/index.php/Dev:2.5/Source/Installation/Proposal
Original patch by Matt Ebb.
Contributions by Nathan Letwory, Damien Plisson and Andrea Weikert
NOTE:
This is a work in progress commit, some work still needs to be done on the SCons and CMake files for this to work properly, but at least should compile and the files should be created in the right directory.
Commit discussed on IRC with Ton and Campbell.
Diffstat (limited to 'source/blender/blenlib/BLI_path_util.h')
-rw-r--r-- | source/blender/blenlib/BLI_path_util.h | 61 |
1 files changed, 52 insertions, 9 deletions
diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h index fb30e991200..24b74b40a37 100644 --- a/source/blender/blenlib/BLI_path_util.h +++ b/source/blender/blenlib/BLI_path_util.h @@ -45,6 +45,58 @@ char *BLI_gethome_folder(char *folder_name, int flag); #define BLI_GETHOME_USER 1<<3 /* home folder ~/.blender */ #define BLI_GETHOME_ALL (BLI_GETHOME_SYSTEM|BLI_GETHOME_LOCAL|BLI_GETHOME_USER) + +#ifdef __APPLE__ +typedef enum { + BasePath_Temporary = 1, + BasePath_BlenderShared, + BasePath_BlenderUser, + BasePath_ApplicationBundle +} basePathesTypes; + +/** + * Gets the base path. The path may not exist. + * Note that return string must be copied as its persistence is not guaranteed + * + * @return base path of pathType + */ +const char* BLI_osx_getBasePath(basePathesTypes pathType); +#endif + +char *BLI_get_folder(int folder_id, char *subfolder); +char *BLI_get_folder_create(int folder_id, char *subfolder); + +/* folder_id */ + +/* general, will find baserd on user/local/system priority */ +#define BLENDER_CONFIG 1 +#define BLENDER_DATAFILES 2 +#define BLENDER_SCRIPTS 3 +#define BLENDER_PLUGINS 4 +#define BLENDER_PYTHON 5 + +/* user-specific */ +#define BLENDER_USER_CONFIG 31 +#define BLENDER_USER_DATAFILES 32 +#define BLENDER_USER_SCRIPTS 33 +#define BLENDER_USER_PLUGINS 34 + +/* system */ +#define BLENDER_SYSTEM_CONFIG 51 /* optional */ +#define BLENDER_SYSTEM_DATAFILES 52 +#define BLENDER_SYSTEM_SCRIPTS 53 +#define BLENDER_SYSTEM_PLUGINS 54 +#define BLENDER_SYSTEM_PYTHON 54 + +#define BLENDER_TEMP 80 + +#define BLENDER_USERFOLDER(id) (id >= BLENDER_USER_CONFIG && id <= BLENDER_USER_PLUGINS) + +#define BLENDER_STARTUP_FILE "startup.blend" +#define BLENDER_BOOKMARK_FILE "bookmarks.txt" +#define BLENDER_HISTORY_FILE "recent-files.txt" + + void BLI_setenv(const char *env, const char *val); void BLI_setenv_if_new(const char *env, const char* val); @@ -135,15 +187,6 @@ char *get_install_dir(void); void BLI_where_is_temp(char *fullname, int usertemp); - /** - * determines the full path to the application bundle on OS X - * - * @return path to application bundle - */ -#ifdef __APPLE__ -char* BLI_getbundle(void); -#endif - #ifdef WITH_ICONV void BLI_string_to_utf8(char *original, char *utf_8, const char *code); #endif |