From 9e2abbc9ba5d8edf3f43060122d683d0c6ae2525 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 11 Feb 2015 00:09:45 +0100 Subject: FileBrowser: Editable Bookmarks. Bookmarks are now editable (i.e. you can rename them, and reorder them). They are also listed in regular UILists, so you can filter/sort them as usual too. Also, FileBrowser 'T' side area is changed to something similar to 3DView one, in this case because we need op panel to remain at the bottom, and later because we'll more than likely need tabs here! Thanks to Campbell and Sergey for reviews. Differential Revision: https://developer.blender.org/D1093 --- source/blender/editors/include/ED_fileselect.h | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'source/blender/editors/include/ED_fileselect.h') diff --git a/source/blender/editors/include/ED_fileselect.h b/source/blender/editors/include/ED_fileselect.h index f2a6ce0b129..b81ea55cca8 100644 --- a/source/blender/editors/include/ED_fileselect.h +++ b/source/blender/editors/include/ED_fileselect.h @@ -108,5 +108,40 @@ int ED_file_extension_icon(const char *relname); void ED_file_read_bookmarks(void); +void ED_file_change_dir(struct bContext *C, const bool checkdir); + +/* File menu stuff */ + +typedef enum FSMenuCategory { + FS_CATEGORY_SYSTEM, + FS_CATEGORY_SYSTEM_BOOKMARKS, + FS_CATEGORY_BOOKMARKS, + FS_CATEGORY_RECENT +} FSMenuCategory; + +typedef enum FSMenuInsert { + FS_INSERT_SORTED = (1 << 0), + FS_INSERT_SAVE = (1 << 1), + FS_INSERT_FIRST = (1 << 2), /* moves the item to the front of the list when its not already there */ + FS_INSERT_LAST = (1 << 3), /* just append to preseve delivered order */ +} FSMenuInsert; + +struct FSMenu; +struct FSMenuEntry; + +struct FSMenu *ED_fsmenu_get(void); +struct FSMenuEntry *ED_fsmenu_get_category(struct FSMenu *fsmenu, FSMenuCategory category); +void ED_fsmenu_set_category(struct FSMenu *fsmenu, FSMenuCategory category, struct FSMenuEntry *fsm_head); + +int ED_fsmenu_get_nentries(struct FSMenu *fsmenu, FSMenuCategory category); + +struct FSMenuEntry *ED_fsmenu_get_entry(struct FSMenu *fsmenu, FSMenuCategory category, int index); + +char *ED_fsmenu_entry_get_path(struct FSMenuEntry *fsentry); +void ED_fsmenu_entry_set_path(struct FSMenuEntry *fsentry, const char *path); + +char *ED_fsmenu_entry_get_name(struct FSMenuEntry *fsentry); +void ED_fsmenu_entry_set_name(struct FSMenuEntry *fsentry, const char *name); + #endif /* __ED_FILESELECT_H__ */ -- cgit v1.2.3 From f69e9681fa32f6f9baafd2aa4a70427864ce6bb5 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 19 Aug 2015 22:41:39 +0200 Subject: Final 'FileBrowser First Stage' merge. It basically rewrites most of filelist.c, with some more limited changes in other areas of filebrowser. From user perspective, it: * Removes some info in 'long' drawing mode (owner, permissions) - OS-specific data that do not really matter in Blender! * Makes short/long display 'fixed' size (among four choices, like thumbnails mode). * Allows to list several layers of dirtree at once, in a flat way (inside .blend files and/or real directories). * Consequently, adds datablocks types filtering. * Uses way less RAM when listing big directories, especially in thumbnail mode (we are talking of several hundred of MiB spared). * Generates thumbnails way faster. From code perspective, it: * Is ready for asset engine needs (on data structure level in filebrowser's listing). * Simplifies and makes 'generic' file listing much lighter. * Separates file listing in three different aspects: ** 'generic' filelisting (in BLI), which becomes a shallow wrapper around stat struct. ** 'filebrowser drawing' filelisting, which only contains current visible subset of the whole list (sliding window), with extra drawing data (strings for size, date/time, preview, etc.). ** 'asset-ready' filelisting, which is used for operations common to 'basic' filehandling and future asset-related one. * Uses uuid's to handle file selection/state in the browser, instead of using flags in filelisting items. * Uses much lighter BLI_task handling for previews, instead of heavy 'job' system (using the new 'notifier' timer to handle UI refresh, in similar way to jobs). * Moves .blend datablocks preview handling to IMB_thumbnail (necessary to avoid storing all datablock previews at once, and gives better consistency and performances too). Revision: https://developer.blender.org/D1316 Thanks to Campbell & Sergey for the reviews. :) --- source/blender/editors/include/ED_fileselect.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/include/ED_fileselect.h') diff --git a/source/blender/editors/include/ED_fileselect.h b/source/blender/editors/include/ED_fileselect.h index b81ea55cca8..186a2a26825 100644 --- a/source/blender/editors/include/ED_fileselect.h +++ b/source/blender/editors/include/ED_fileselect.h @@ -33,6 +33,7 @@ struct ARegion; struct FileSelectParams; +struct ScrArea; struct SpaceFile; struct bContext; struct wmWindowManager; @@ -40,17 +41,13 @@ struct wmWindowManager; #define FILE_LAYOUT_HOR 1 #define FILE_LAYOUT_VER 2 -#define MAX_FILE_COLUMN 8 +#define MAX_FILE_COLUMN 4 typedef enum FileListColumns { COLUMN_NAME = 0, COLUMN_DATE, COLUMN_TIME, COLUMN_SIZE, - COLUMN_MODE1, - COLUMN_MODE2, - COLUMN_MODE3, - COLUMN_OWNER } FileListColumns; typedef struct FileLayout { @@ -71,6 +68,9 @@ typedef struct FileLayout { int dirty; int textheight; float column_widths[MAX_FILE_COLUMN]; + + /* When we change display size, we may have to update static strings like size of files... */ + short curr_size; } FileLayout; typedef struct FileSelection { @@ -100,9 +100,9 @@ void ED_fileselect_layout_tilepos(FileLayout *layout, int tile, int *x, int *y); void ED_operatormacros_file(void); -void ED_fileselect_clear(struct wmWindowManager *wm, struct SpaceFile *sfile); +void ED_fileselect_clear(struct wmWindowManager *wm, struct ScrArea *sa, struct SpaceFile *sfile); -void ED_fileselect_exit(struct wmWindowManager *wm, struct SpaceFile *sfile); +void ED_fileselect_exit(struct wmWindowManager *wm, struct ScrArea *sa, struct SpaceFile *sfile); int ED_file_extension_icon(const char *relname); -- cgit v1.2.3