|
Blender V5.0
|
#include <algorithm>#include <cstdlib>#include <cstring>#include <ctime>#include <memory>#include <optional>#include <sys/stat.h>#include <unistd.h>#include "AS_asset_library.hh"#include "AS_asset_representation.hh"#include "MEM_guardedalloc.h"#include "BLF_api.hh"#include "BLI_fileops.h"#include "BLI_fileops_types.h"#include "BLI_ghash.h"#include "BLI_linklist.h"#include "BLI_listbase.h"#include "BLI_math_vector.h"#include "BLI_path_utils.hh"#include "BLI_stack.h"#include "BLI_string.h"#include "BLI_string_utils.hh"#include "BLI_task.h"#include "BLI_threads.h"#include "BLI_utildefines.h"#include "BKE_asset.hh"#include "BKE_blendfile.hh"#include "BKE_context.hh"#include "BKE_global.hh"#include "BKE_icons.h"#include "BKE_idtype.hh"#include "BKE_main.hh"#include "BKE_preferences.h"#include "BKE_preview_image.hh"#include "DNA_asset_types.h"#include "DNA_space_types.h"#include "DNA_userdef_types.h"#include "ED_fileselect.hh"#include "IMB_imbuf.hh"#include "IMB_imbuf_types.hh"#include "IMB_thumbs.hh"#include "MOV_util.hh"#include "WM_api.hh"#include "WM_types.hh"#include "UI_interface_icons.hh"#include "UI_resources.hh"#include "atomic_ops.h"#include "../file_indexer.hh"#include "../file_intern.hh"#include "../filelist.hh"#include "filelist_intern.hh"Go to the source code of this file.
Classes | |
| struct | TodoDir |
| struct | FileListReadJob |
| struct | FileIndexer |
Macros | |
| #define | FILE_UID_UNSET 0 |
Enumerations | |
| enum | ListLibOptions { LIST_LIB_OPTION_NONE = 0 , LIST_LIB_RECURSIVE = (1 << 0) , LIST_LIB_ASSETS_ONLY = (1 << 1) , LIST_LIB_ADD_PARENT = (1 << 2) } |
Variables | |
| static ImBuf * | gSpecialFileImages [int(SpecialFileImages::_Max)] |
| #define FILE_UID_UNSET 0 |
Definition at line 1356 of file filelist.cc.
Referenced by filelist_uid_unset().
| enum ListLibOptions |
| Enumerator | |
|---|---|
| LIST_LIB_OPTION_NONE | |
| LIST_LIB_RECURSIVE | |
| LIST_LIB_ASSETS_ONLY | |
| LIST_LIB_ADD_PARENT | |
Definition at line 2242 of file filelist.cc.
|
static |
Definition at line 3273 of file filelist.cc.
References filelist_readjob_startjob().
Referenced by filelist_readjob_start_ex().
|
static |
Append filename (or even a path inside of a .blend, like Material/Material.001), to the current relative path being read within the filelist root. The returned string needs freeing with MEM_freeN().
Definition at line 2122 of file filelist.cc.
References ALTSEP, BLI_assert, BLI_path_is_rel(), BLI_strdup(), BLI_string_join, FileListReadJob::cur_relbase, ELEM, FILE_MAX_LIBEXTRA, and SEP.
Referenced by filelist_readjob_list_dir(), filelist_readjob_list_lib_add_datablock(), filelist_readjob_list_lib_group_create(), filelist_readjob_list_lib_navigate_to_parent_entry_create(), and filelist_readjob_main_assets_add_items().
| int ED_file_extension_icon | ( | const char * | path | ) |
Definition at line 1869 of file filelist.cc.
References ED_path_extension_type(), FILE_TYPE_ALEMBIC, FILE_TYPE_ARCHIVE, FILE_TYPE_BLENDER, FILE_TYPE_BLENDER_BACKUP, FILE_TYPE_BTX, FILE_TYPE_FTFONT, FILE_TYPE_IMAGE, FILE_TYPE_MOVIE, FILE_TYPE_OBJECT_IO, FILE_TYPE_PYSCRIPT, FILE_TYPE_SOUND, FILE_TYPE_TEXT, and FILE_TYPE_VOLUME.
Referenced by ghost_event_proc(), and blender::ed::outliner::tree_element_get_icon_from_id().
| int ED_file_icon | ( | const FileDirEntry * | file | ) |
Definition at line 397 of file filelist.cc.
References filelist_geticon_file_type_ex(), and FileDirEntry::preview_icon_id.
| int ED_path_extension_type | ( | const char * | path | ) |
Definition at line 1786 of file filelist.cc.
References BKE_blendfile_extension_check(), BLI_path_extension_check(), BLI_path_extension_check_array(), BLI_path_extension_check_n(), file_is_blend_backup(), FILE_TYPE_ALEMBIC, FILE_TYPE_ARCHIVE, FILE_TYPE_BLENDER, FILE_TYPE_BLENDER_BACKUP, FILE_TYPE_BTX, FILE_TYPE_BUNDLE, FILE_TYPE_FTFONT, FILE_TYPE_IMAGE, FILE_TYPE_MOVIE, FILE_TYPE_OBJECT_IO, FILE_TYPE_PYSCRIPT, FILE_TYPE_SOUND, FILE_TYPE_TEXT, FILE_TYPE_USD, FILE_TYPE_VOLUME, imb_ext_audio, imb_ext_image, imb_ext_movie, and MOV_is_movie_file().
Referenced by ED_file_extension_icon(), filelist_readjob_list_dir(), and WM_drag_create_path_data().
| ENUM_OPERATORS | ( | ListLibOptions | , |
| LIST_LIB_ADD_PARENT | ) |
References LIST_LIB_ADD_PARENT.
|
static |
Definition at line 1759 of file filelist.cc.
References b, BLI_strcasestr(), and str.
Referenced by ED_path_extension_type().
|
static |
Definition at line 1050 of file filelist.cc.
References BKE_blendfile_library_path_explode(), BLF_display_name_from_file(), BLI_assert, BLI_path_basename(), BLI_path_join, BLI_strdup(), BLI_strdupn(), blender::StringRefNull::c_str(), FILE_MAX_LIBEXTRA, FILE_TYPE_BLENDERLIB, FILE_TYPE_DIR, FILE_TYPE_FTFONT, FileListInternEntry::get_asset(), name, FileListInternEntry::relpath, blender::StringRefBase::size(), and FileListInternEntry::typeflag.
Referenced by filelist_readjob_recursive_dir_add_items().
| blender::asset_system::AssetLibrary * filelist_asset_library | ( | FileList * | filelist | ) |
Definition at line 1027 of file filelist.cc.
References FileList::asset_library.
Referenced by blender::ed::asset::list::AssetList::asset_library(), ED_fileselect_active_asset_library_get(), and file_panel_asset_catalog_buttons_draw().
| void filelist_cache_clear | ( | FileListEntryCache * | cache, |
| size_t | new_size ) |
Definition at line 817 of file filelist.cc.
References BLI_ghash_clear_ex(), BLI_listbase_clear(), FileListEntryCache::block_center_index, FileListEntryCache::block_cursor, FileListEntryCache::block_end_index, FileListEntryCache::block_entries, FileListEntryCache::block_start_index, FileListEntryCache::cached_entries, copy_vn_i(), filelist_cache_previews_clear(), filelist_entry_free(), LISTBASE_FOREACH_MUTABLE, MEM_reallocN, FileListEntryCache::misc_entries, FileListEntryCache::misc_entries_indices, FileListEntryCache::size, and FileListEntryCache::uids.
Referenced by filelist_clear_ex(), filelist_clear_main_files(), filelist_file_cache_slidingwindow_set(), and filelist_filter().
|
static |
Definition at line 1228 of file filelist.cc.
References BLI_ghash_lookup(), FileListEntryCache::block_cursor, FileListEntryCache::block_entries, FileListEntryCache::block_start_index, FileListEntryCache::misc_entries, POINTER_FROM_INT, and FileListEntryCache::size.
Referenced by filelist_file_ex().
|
static |
Definition at line 631 of file filelist.cc.
References BLI_task_pool_create_background(), BLI_thread_queue_init(), IMB_thumb_locks_acquire(), FileListEntryCache::previews_done, FileListEntryCache::previews_pool, FileListEntryCache::previews_todo_count, and TASK_PRIORITY_LOW.
Referenced by filelist_cache_previews_push().
|
static |
Definition at line 618 of file filelist.cc.
References MEM_freeN(), and FileListEntryPreviewTaskData::preview.
Referenced by filelist_cache_previews_push().
|
static |
Definition at line 566 of file filelist.cc.
References BKE_icon_imbuf_create(), BLI_assert, BLI_task_pool_user_data(), BLI_thread_queue_push(), BLI_THREAD_QUEUE_WORK_PRIORITY_NORMAL, FILE_TYPE_BLENDER, FILE_TYPE_BLENDER_BACKUP, FILE_TYPE_BLENDERLIB, FILE_TYPE_FTFONT, FILE_TYPE_IMAGE, FILE_TYPE_MOVIE, FILE_TYPE_OBJECT_IO, FileListEntryPreview::filepath, FileListEntryPreview::flags, FileListEntryPreview::icon_id, IMB_thumb_manage(), IMB_thumb_path_lock(), IMB_thumb_path_unlock(), FileListEntryPreviewTaskData::preview, FileListEntryCache::previews_done, THB_LARGE, THB_SOURCE_BLEND, THB_SOURCE_FONT, THB_SOURCE_IMAGE, THB_SOURCE_MOVIE, and THB_SOURCE_OBJECT_IO.
Referenced by filelist_cache_previews_push().
|
static |
Definition at line 642 of file filelist.cc.
References BKE_icon_delete(), BLI_task_pool_cancel(), BLI_thread_queue_pop_timeout(), FileListEntryCache::cached_entries, FILE_ENTRY_PREVIEW_LOADING, FileListEntryPreview::icon_id, LISTBASE_FOREACH, MEM_freeN(), FileListEntryCache::previews_done, FileListEntryCache::previews_pool, and FileListEntryCache::previews_todo_count.
Referenced by filelist_cache_clear(), filelist_cache_previews_free(), and filelist_file_cache_block().
| bool filelist_cache_previews_done | ( | FileList * | filelist | ) |
Definition at line 1746 of file filelist.cc.
References FileList::filelist_cache, FileListEntryCache::flags, FLC_PREVIEWS_ACTIVE, FileListEntryCache::previews_done, FileListEntryCache::previews_pool, and FileListEntryCache::previews_todo_count.
Referenced by file_draw_list().
|
static |
Definition at line 666 of file filelist.cc.
References BLI_task_pool_free(), BLI_thread_queue_free(), BLI_thread_queue_nowait(), filelist_cache_previews_clear(), FileListEntryCache::flags, FLC_PREVIEWS_ACTIVE, IMB_thumb_locks_release(), FileListEntryCache::previews_done, FileListEntryCache::previews_pool, and FileListEntryCache::previews_todo_count.
Referenced by filelist_cache_previews_set(), and FileListEntryCache::~FileListEntryCache().
|
static |
Definition at line 726 of file filelist.cc.
References BKE_icon_imbuf_create(), BKE_previewimg_is_finished(), BKE_previewimg_to_imbuf(), BLI_assert, BLI_strncpy(), BLI_task_pool_push(), BLI_thread_queue_push(), BLI_THREAD_QUEUE_WORK_PRIORITY_NORMAL, FILE_ENTRY_PREVIEW_LOADING, FILE_MAXDIR, FileList::filelist_cache, filelist_cache_preview_ensure_running(), filelist_cache_preview_freef(), filelist_cache_preview_runf(), filelist_file_get_full_path(), filelist_file_preview_load_poll(), FileList::filelist_intern, FileListEntryPreview::filepath, FileListIntern::filtered, FileDirEntry::flags, FileListEntryCache::flags, FileListEntryPreview::flags, FLC_PREVIEWS_ACTIVE, FileListEntryPreview::icon_id, ICON_SIZE_PREVIEW, FileListEntryPreview::index, FileListInternEntry::local_data, MEM_callocN(), FileListEntryPreviewTaskData::preview, FileDirEntry::preview_icon_id, FileListInternEntry::preview_image, FileListEntryCache::previews_done, FileListEntryCache::previews_pool, FileListEntryCache::previews_todo_count, FileDirEntry::redirection_path, and FileDirEntry::typeflag.
Referenced by filelist_file_cache_block(), and filelist_file_ex().
| bool filelist_cache_previews_running | ( | FileList * | filelist | ) |
Definition at line 1739 of file filelist.cc.
References FileList::filelist_cache, and FileListEntryCache::previews_pool.
Referenced by file_draw_list().
| void filelist_cache_previews_set | ( | FileList * | filelist, |
| const bool | use_previews ) |
Definition at line 1656 of file filelist.cc.
References BLI_assert, FileList::filelist_cache, filelist_cache_previews_free(), FL_IS_READY, FileList::flags, FileListEntryCache::flags, FLC_PREVIEWS_ACTIVE, FileListEntryCache::previews_done, FileListEntryCache::previews_pool, and FileListEntryCache::previews_todo_count.
Referenced by file_refresh().
| bool filelist_cache_previews_update | ( | FileList * | filelist | ) |
Definition at line 1681 of file filelist.cc.
References BKE_icon_delete(), BLI_assert_msg, BLI_thread_queue_is_empty(), BLI_thread_queue_pop(), FILE_ENTRY_INVALID_PREVIEW, FILE_ENTRY_PREVIEW_LOADING, FileList::filelist_cache, filelist_file_ex(), FileDirEntry::flags, FileListEntryPreview::icon_id, FileListEntryPreview::index, MEM_freeN(), FileDirEntry::preview_icon_id, FileListEntryCache::previews_done, FileListEntryCache::previews_pool, and FileListEntryCache::previews_todo_count.
Referenced by file_draw_list(), file_listener(), and filelist_file_cache_block().
|
static |
Definition at line 424 of file filelist.cc.
References BLI_is_dir(), BLI_path_is_abs_from_cwd(), FILE_MAX_LIBEXTRA, and parent_dir_until_exists_or_default_root().
Referenced by filelist_settype().
|
static |
Definition at line 439 of file filelist.cc.
References BKE_blendfile_library_path_explode(), BLI_is_dir(), BLI_is_file(), FILE_MAX_LIBEXTRA, name, and parent_dir_until_exists_or_default_root().
Referenced by filelist_checkdir_main(), and filelist_settype().
|
static |
Definition at line 458 of file filelist.cc.
References FILE_MAX_LIBEXTRA, and filelist_checkdir_lib().
Referenced by filelist_settype().
|
static |
Definition at line 466 of file filelist.cc.
References FILE_MAX_LIBEXTRA.
Referenced by filelist_settype().
| void filelist_clear | ( | FileList * | filelist | ) |
Definition at line 983 of file filelist.cc.
References filelist_clear_ex().
Referenced by blender::ed::asset::list::AssetList::clear(), ED_fileselect_clear(), and filelist_clear_from_reset_tag().
|
static |
Definition at line 912 of file filelist.cc.
References FileListFilter::asset_catalog_filter, FileList::asset_library, and FileList::filter_data.
Referenced by filelist_clear_ex(), and filelist_clear_main_files().
| void filelist_clear_ex | ( | FileList * | filelist, |
| const bool | do_asset_library, | ||
| const bool | do_cache, | ||
| const bool | do_selection ) |
Definition at line 919 of file filelist.cc.
References BLI_ghash_clear(), FileList::filelist, FileList::filelist_cache, filelist_cache_clear(), filelist_clear_asset_library(), filelist_direntryarr_free(), filelist_intern_free(), filelist_tag_needs_filtering(), FileList::selection_state, and FileListEntryCache::size.
Referenced by filelist_clear(), filelist_free(), and filelist_readjob_update().
| void filelist_clear_from_reset_tag | ( | FileList * | filelist | ) |
A "smarter" version of filelist_clear() that calls partial clearing based on the filelist force-reset flags.
Definition at line 988 of file filelist.cc.
References filelist_clear(), filelist_clear_main_files(), FL_FORCE_RESET, FL_FORCE_RESET_MAIN_FILES, and FileList::flags.
Referenced by blender::ed::asset::list::AssetList::clear_current_file_assets(), ED_fileselect_clear_main_assets(), blender::ed::asset::list::AssetList::ensure_blocking(), blender::ed::asset::list::AssetList::fetch(), and file_refresh().
|
static |
Definition at line 947 of file filelist.cc.
References BLI_assert, BLI_ghash_clear(), FileDirEntryArr::entries_filtered_num, FileDirEntryArr::entries_num, FILEDIR_NBR_ENTRIES_UNSET, FileList::filelist, FileList::filelist_cache, filelist_cache_clear(), filelist_clear_asset_library(), filelist_intern_free_main_files(), filelist_tag_needs_filtering(), FILELIST_TAGS_USES_MAIN_DATA, FileList::selection_state, FileListEntryCache::size, and FileList::tags.
Referenced by filelist_clear_from_reset_tag().
|
static |
Checks two libraries for equality.
Definition at line 149 of file filelist.cc.
References ASSET_LIBRARY_CUSTOM, BKE_preferences_asset_library_find_index(), AssetLibraryReference::custom_library_index, AssetLibraryReference::type, and U.
Referenced by filelist_setlibrary().
Check if bmain is stored within the root path of filelist. This means either directly or in some nested directory. In other words, it checks if the filelist root path is contained in the path to bmain. This is irrespective of the recursion level displayed, it basically assumes unlimited recursion levels.
Definition at line 3008 of file filelist.cc.
References ASSET_LIBRARY_ALL, FileList::asset_library_ref, BKE_main_blendfile_path(), BLI_path_contains(), FileList::filelist, FileDirEntryArr::root, and AssetLibraryReference::type.
Referenced by filelist_readjob_asset_library().
| const char * filelist_dir | ( | const FileList * | filelist | ) |
Get the root path of the file list. To get the full path for a file, use filelist_file_get_full_path().
Definition at line 1095 of file filelist.cc.
References FileList::filelist, and FileDirEntryArr::root.
Referenced by ED_file_change_dir_ex(), file_external_operation_exec(), file_os_operations_menu_draw(), and filelist_file_get_full_path().
|
static |
Definition at line 496 of file filelist.cc.
References BLI_assert, BLI_listbase_clear(), BLI_listbase_is_empty(), FILEDIR_NBR_ENTRIES_UNSET, filelist_entry_free(), and FileDirEntry::next.
Referenced by filelist_clear_ex().
|
static |
Definition at line 242 of file filelist.cc.
References gSpecialFileImages, and UI_svg_icon_bitmap().
Referenced by filelist_geticon_special_file_image_ex().
| void filelist_entries_select_index_range_set | ( | FileList * | filelist, |
| FileSelection * | sel, | ||
| FileSelType | select, | ||
| const eDirEntry_SelectFlag | flag, | ||
| FileCheckType | check ) |
Definition at line 1972 of file filelist.cc.
References FileDirEntryArr::entries_filtered_num, FileList::filelist, filelist_entry_select_index_set(), FileSelection::first, flag, FileSelection::last, and select.
Referenced by file_box_select_modal(), file_select(), file_select_all_exec(), file_select_deselect_all(), and file_walk_select_selection_set().
|
static |
Definition at line 473 of file filelist.cc.
References BKE_icon_delete(), FILE_ENTRY_NAME_FREE, FileDirEntry::flags, MEM_freeN(), FileDirEntry::name, FileDirEntry::preview_icon_id, FileDirEntry::redirection_path, and FileDirEntry::relpath.
Referenced by filelist_entry_free().
|
static |
Definition at line 490 of file filelist.cc.
References filelist_entry_clear(), and MEM_freeN().
Referenced by filelist_cache_clear(), filelist_direntryarr_free(), filelist_file_release_entry(), and FileListEntryCache::~FileListEntryCache().
| asset_system::AssetRepresentation * filelist_entry_get_asset_representation | ( | const FileList * | filelist, |
| const int | index ) |
Definition at line 1338 of file filelist.cc.
References filelist_entry_intern_get(), and FileListInternEntry::get_asset().
Referenced by blender::ed::asset::list::AssetList::iterate().
Same as filelist_file_get_id(), but gets the file by index (doesn't require the file to be cached, uses FileListInternEntry only).
Definition at line 1332 of file filelist.cc.
References filelist_entry_intern_get(), FileListInternEntry::id, and FileListInternEntry::local_data.
Referenced by file_context().
| const char * filelist_entry_get_relpath | ( | const FileList * | filelist, |
| int | index ) |
Get the FileDirEntry.relpath value without requiring the FileDirEntry to be available (doesn't require the file to be cached, uses FileListInternEntry only).
Definition at line 1350 of file filelist.cc.
References filelist_entry_intern_get(), and FileListInternEntry::relpath.
Referenced by autocomplete_file(), and file_select_match().
|
static |
Definition at line 1326 of file filelist.cc.
References BLI_assert, FileList::filelist_intern, and FileListIntern::filtered.
Referenced by filelist_entry_get_asset_representation(), filelist_entry_get_id(), and filelist_entry_get_relpath().
| bool filelist_entry_is_selected | ( | FileList * | filelist, |
| const int | index ) |
Definition at line 2020 of file filelist.cc.
References BLI_assert, BLI_ghash_lookup(), FileList::filelist_intern, FileListIntern::filtered, POINTER_AS_UINT, POINTER_FROM_UINT, FileList::selection_state, and FileListInternEntry::uid.
Referenced by ED_fileselect_selected_files_full_paths(), file_context(), and file_current_selection_range_get().
| void filelist_entry_parent_select_set | ( | FileList * | filelist, |
| FileSelType | select, | ||
| eDirEntry_SelectFlag | flag, | ||
| FileCheckType | check ) |
Set selection of the '..' parent entry, but only if it's actually visible.
Definition at line 2033 of file filelist.cc.
References filelist_entry_select_index_set(), FileList::filter_data, flag, FileListFilter::flags, FLF_HIDE_PARENT, and select.
Referenced by file_box_select_exec(), file_select_exec(), and file_walk_select_selection_set().
| eDirEntry_SelectFlag filelist_entry_select_get | ( | FileList * | filelist, |
| FileDirEntry * | entry, | ||
| FileCheckType | check ) |
Definition at line 1989 of file filelist.cc.
References BLI_assert, BLI_ghash_lookup(), CHECK_ALL, CHECK_DIRS, CHECK_FILES, ELEM, FILE_TYPE_DIR, POINTER_AS_UINT, POINTER_FROM_UINT, FileList::selection_state, FileDirEntry::typeflag, and FileDirEntry::uid.
Referenced by file_draw_list(), file_rename_state_activate(), and filelist_entry_select_index_get().
| eDirEntry_SelectFlag filelist_entry_select_index_get | ( | FileList * | filelist, |
| const int | index, | ||
| FileCheckType | check ) |
Definition at line 2007 of file filelist.cc.
References filelist_entry_select_get(), and filelist_file().
Referenced by file_delete_exec(), file_delete_poll(), file_external_operation_exec(), file_is_any_selected(), file_os_operations_menu_draw(), file_os_operations_menu_poll(), file_select(), file_select_all_exec(), file_select_exec(), file_selection_get(), file_sfile_to_operator_ex(), file_smoothscroll_invoke(), and file_walk_select_selection_set().
| void filelist_entry_select_index_set | ( | FileList * | filelist, |
| const int | index, | ||
| FileSelType | select, | ||
| const eDirEntry_SelectFlag | flag, | ||
| FileCheckType | check ) |
Definition at line 1959 of file filelist.cc.
References filelist_entry_select_set(), filelist_file(), flag, and select.
Referenced by file_rename_state_activate(), file_select_match(), file_walk_select_selection_set(), filelist_entries_select_index_range_set(), and filelist_entry_parent_select_set().
| uint filelist_entry_select_set | ( | const FileList * | filelist, |
| const FileDirEntry * | entry, | ||
| FileSelType | select, | ||
| const eDirEntry_SelectFlag | flag, | ||
| FileCheckType | check ) |
Definition at line 1910 of file filelist.cc.
References BLI_assert, BLI_ghash_insert(), BLI_ghash_lookup_p(), BLI_ghash_remove(), CHECK_ALL, CHECK_DIRS, CHECK_FILES, ELEM, FILE_SEL_ADD, FILE_SEL_REMOVE, FILE_SEL_TOGGLE, FILE_TYPE_DIR, flag, POINTER_AS_UINT, POINTER_FROM_UINT, select, FileList::selection_state, FileDirEntry::typeflag, and FileDirEntry::uid.
Referenced by ED_fileselect_activate_by_id(), ED_fileselect_activate_by_relpath(), file_box_select_modal(), file_params_rename_end(), file_params_renamefile_activate(), and filelist_entry_select_index_set().
| FileDirEntry * filelist_file | ( | FileList * | filelist, |
| int | index ) |
Request a file from the file browser cache, adding it to the cache if necessary.
As a rule of thumb, this can be used for operations on individual files (e.g. selection, active, renaming, etc.). But avoid calling this on many files (like when iterating the entire list), to not create a bunch of cache entries for a single operation. While a bit against the point of "intern" entries, in this case it's probably better to have queries like filelist_entry_get_id(), that take a file index and return data directly from the FileListInternEntry.
Definition at line 1285 of file filelist.cc.
References filelist_file_ex().
Referenced by ED_fileselect_activate_by_relpath(), ED_fileselect_active_asset_get(), ED_fileselect_selected_files_full_paths(), file_box_select_modal(), file_context(), file_delete_exec(), file_draw_list(), file_execute(), file_external_operation_exec(), file_os_operations_menu_draw(), file_params_renamefile_activate(), file_rename_state_activate(), file_select_do(), file_sfile_to_operator_ex(), filelist_entry_select_index_get(), filelist_entry_select_index_set(), filelist_geticon_get_file(), and fileselect_file_set().
| bool filelist_file_cache_block | ( | FileList * | filelist, |
| int | index ) |
Load in cache all entries "around" given index (as much as block cache may hold).
Definition at line 1440 of file filelist.cc.
References BLI_assert, FileListEntryCache::block_center_index, FileListEntryCache::block_cursor, FileListEntryCache::block_end_index, FileListEntryCache::block_entries, FileListEntryCache::block_start_index, FileDirEntryArr::entries_filtered_num, FileList::filelist, FileList::filelist_cache, filelist_cache_previews_clear(), filelist_cache_previews_push(), filelist_cache_previews_update(), filelist_file_cache_block_create(), filelist_file_cache_block_release(), FL_IS_READY, FileList::flags, FileListEntryCache::flags, FLC_PREVIEWS_ACTIVE, i, max_ii(), min_ii(), printf, and FileListEntryCache::size.
Referenced by file_draw_list().
|
static |
Definition at line 1395 of file filelist.cc.
References BLI_ghash_insert(), BLI_ghash_popkey(), FileListEntryCache::block_entries, FileList::filelist_cache, filelist_file_create_entry(), i, FileListEntryCache::misc_entries, POINTER_FROM_INT, POINTER_FROM_UINT, size(), FileDirEntry::uid, and FileListEntryCache::uids.
Referenced by filelist_file_cache_block().
|
static |
Definition at line 1419 of file filelist.cc.
References BLI_ghash_remove(), FileListEntryCache::block_entries, FileList::filelist_cache, filelist_file_release_entry(), i, POINTER_FROM_UINT, printf, size(), FileDirEntry::uid, and FileListEntryCache::uids.
Referenced by filelist_file_cache_block().
| void filelist_file_cache_slidingwindow_set | ( | FileList * | filelist, |
| size_t | window_size ) |
Definition at line 1378 of file filelist.cc.
References FileList::filelist_cache, filelist_cache_clear(), FileListEntryCache::size, and size().
Referenced by file_draw_list().
|
static |
Definition at line 1178 of file filelist.cc.
References FileListInternEntry::attributes, BKE_icon_imbuf_create(), BKE_previewimg_is_finished(), BKE_previewimg_to_imbuf(), FileListInternEntry::blenderlib_has_no_preview, FileListInternEntry::blentype, BLI_addtail(), BLI_strdup(), FileListEntryCache::cached_entries, FILE_ENTRY_BLENDERLIB_NO_PREVIEW, FILE_ENTRY_NAME_FREE, FileList::filelist_cache, FileList::filelist_intern, FileListIntern::filtered, FileListInternEntry::free_name, FileListInternEntry::get_asset(), ICON_SIZE_PREVIEW, FileListInternEntry::id, FileListInternEntry::local_data, MEM_callocN(), FileListInternEntry::name, FileListInternEntry::preview_image, FileListInternEntry::redirection_path, FileListInternEntry::relpath, ret, FileListInternEntry::st, FileListInternEntry::typeflag, and FileListInternEntry::uid.
Referenced by filelist_file_cache_block_create(), and filelist_file_ex().
| FileDirEntry * filelist_file_ex | ( | FileList * | filelist, |
| const int | index, | ||
| const bool | use_request ) |
Definition at line 1241 of file filelist.cc.
References BLI_ghash_insert(), BLI_ghash_popkey(), BLI_ghash_remove(), FileDirEntryArr::entries_filtered_num, FileList::filelist, FileList::filelist_cache, filelist_cache_file_lookup(), filelist_cache_previews_push(), filelist_file_create_entry(), filelist_file_release_entry(), FileListEntryCache::misc_cursor, FileListEntryCache::misc_entries, FileListEntryCache::misc_entries_indices, POINTER_FROM_INT, POINTER_FROM_UINT, FileListEntryCache::previews_pool, ret, FileListEntryCache::size, and FileListEntryCache::uids.
Referenced by ED_fileselect_activate_by_id(), filelist_cache_previews_update(), and filelist_file().
Find a file representing id.
Definition at line 1310 of file filelist.cc.
References FileDirEntryArr::entries_filtered_num, FILEDIR_NBR_ENTRIES_UNSET, FileList::filelist, FileList::filelist_intern, FileListIntern::filtered, FileListInternEntry::id, and FileListInternEntry::local_data.
Referenced by ED_fileselect_activate_by_id(), and file_params_find_renamed().
| int filelist_file_find_path | ( | FileList * | filelist, |
| const char * | filename ) |
Find a file from a file name, or more precisely, its file-list relative path, inside the filtered items.
Definition at line 1290 of file filelist.cc.
References FileDirEntryArr::entries_filtered_num, FILEDIR_NBR_ENTRIES_UNSET, FileList::filelist, FileList::filelist_intern, FileListIntern::filtered, FileListInternEntry::relpath, and STREQ.
Referenced by file_params_find_renamed().
| void filelist_file_get_full_path | ( | const FileList * | filelist, |
| const FileDirEntry * | file, | ||
| char | r_filepath[FILE_MAX_LIBEXTRA] ) |
Definition at line 201 of file filelist.cc.
References FileDirEntry::asset, BLI_path_join, BLI_strncpy(), FILE_MAX_LIBEXTRA, filelist_dir(), and FileDirEntry::relpath.
Referenced by filelist_cache_previews_push(), and filelist_geticon_file_type_ex().
| ID * filelist_file_get_id | ( | const FileDirEntry * | file | ) |
Get the ID a file represents (if any). For FILE_MAIN, FILE_MAIN_ASSET.
Definition at line 1345 of file filelist.cc.
References FileDirEntry::id.
Referenced by ED_fileselect_active_asset_get(), file_but_enable_drag(), file_context(), and file_draw_indicator_icons().
| ImBuf * filelist_file_get_preview_image | ( | const FileDirEntry * | file | ) |
Definition at line 237 of file filelist.cc.
References BKE_icon_imbuf_get_buffer(), and FileDirEntry::preview_icon_id.
Referenced by file_draw_tooltip_custom_func().
| bool filelist_file_is_preview_pending | ( | const FileList * | filelist, |
| const FileDirEntry * | file ) |
Definition at line 215 of file filelist.cc.
References FILE_ENTRY_PREVIEW_LOADING, filelist_is_ready(), and FileDirEntry::flags.
Referenced by file_draw_indicator_icons(), and file_draw_list().
|
static |
Check if a preview for entry may be requested. Further conditions may apply, this just helps to skip plenty of entries where it's easy to tell that no valid preview will be available or is being loaded already.
Definition at line 690 of file filelist.cc.
References FILE_ENTRY_BLENDERLIB_NO_PREVIEW, FILE_ENTRY_INVALID_PREVIEW, FILE_ENTRY_PREVIEW_LOADING, FILE_TYPE_BLENDER, FILE_TYPE_BLENDER_BACKUP, FILE_TYPE_BLENDERLIB, FILE_TYPE_DIR, FILE_TYPE_FTFONT, FILE_TYPE_IMAGE, FILE_TYPE_MOVIE, FILE_TYPE_OBJECT_IO, FileDirEntry::flags, and FileDirEntry::typeflag.
Referenced by filelist_cache_previews_push().
|
static |
Definition at line 1222 of file filelist.cc.
References BLI_remlink(), FileListEntryCache::cached_entries, FileList::filelist_cache, and filelist_entry_free().
Referenced by filelist_file_cache_block_release(), and filelist_file_ex().
| int filelist_files_ensure | ( | FileList * | filelist | ) |
Limited version of full update done by space_file's file_refresh(), to be used by operators and such. Ensures given filelist is ready to be used (i.e. it is filtered and sorted), unless it is tagged for a full refresh.
Definition at line 1168 of file filelist.cc.
References FileDirEntryArr::entries_filtered_num, FileList::filelist, filelist_filter(), filelist_needs_force_reset(), filelist_needs_reading(), and filelist_sort().
Referenced by autocomplete_file(), ED_fileselect_activate_by_relpath(), ED_fileselect_init_layout(), ED_fileselect_selected_files_full_paths(), file_context(), file_current_selection_range_get(), file_delete_exec(), file_delete_poll(), file_draw_list(), file_external_operation_exec(), file_highlight_set(), file_is_any_selected(), file_os_operations_menu_draw(), file_os_operations_menu_poll(), file_rename_state_activate(), file_select_all_exec(), file_select_deselect_all(), file_select_do(), file_select_exec(), file_select_match(), file_selection_get(), file_sfile_to_operator_ex(), file_smoothscroll_invoke(), file_walk_select_do(), blender::ed::asset::list::AssetList::iterate(), and blender::ed::asset::list::AssetList::size().
| int filelist_files_num_entries | ( | FileList * | filelist | ) |
Return the total raw number of entries listed in the given filelist, whether they are filtered out or not.
Definition at line 1045 of file filelist.cc.
References FileDirEntryArr::entries_num, and FileList::filelist.
Referenced by file_draw_hint_if_invalid().
| void filelist_free | ( | FileList * | filelist | ) |
Definition at line 1002 of file filelist.cc.
References FileList::asset_library_ref, BLI_ghash_free(), FileList::filelist_cache, filelist_clear_ex(), FileList::filter_data, FL_NEED_FILTERING, FL_NEED_SORTING, FileList::flags, MEM_freeN(), MEM_SAFE_FREE, printf, and FileList::selection_state.
Referenced by ED_fileselect_exit(), file_free(), and filelist_readjob_free().
| void filelist_free_icons | ( | ) |
Definition at line 191 of file filelist.cc.
References _Max, BLI_assert, G, gSpecialFileImages, i, and IMB_freeImBuf().
Referenced by ED_file_exit().
| void filelist_freelib | ( | FileList * | filelist | ) |
Definition at line 1032 of file filelist.cc.
References BLO_blendhandle_close(), and FileList::libfiledata.
Referenced by blender::ed::asset::list::AssetList::clear(), blender::ed::asset::list::AssetList::clear_current_file_assets(), ED_fileselect_clear(), ED_fileselect_clear_main_assets(), file_free(), and filelist_readjob_free().
Definition at line 230 of file filelist.cc.
References BKE_icon_imbuf_get_buffer(), filelist_geticon_get_file(), and FileDirEntry::preview_icon_id.
Referenced by file_draw_list().
| int filelist_geticon_file_type | ( | FileList * | filelist, |
| const int | index, | ||
| const bool | is_main ) |
Definition at line 390 of file filelist.cc.
References filelist_geticon_file_type_ex(), and filelist_geticon_get_file().
Referenced by file_draw_list().
|
static |
Definition at line 276 of file filelist.cc.
References ARRAY_SIZE, FileDirEntry::attributes, FileDirEntry::blentype, BLI_path_slash_ensure(), ED_fsmenu_get(), ED_fsmenu_get_category(), FILE_ATTR_ANY_LINK, FILE_ATTR_OFFLINE, FILE_ATTR_SYSTEM, FILE_ATTR_TEMPORARY, FILE_MAX_LIBEXTRA, FILE_TYPE_ALEMBIC, FILE_TYPE_ARCHIVE, FILE_TYPE_BLENDER, FILE_TYPE_BLENDER_BACKUP, FILE_TYPE_BLENDERLIB, FILE_TYPE_BTX, FILE_TYPE_BUNDLE, FILE_TYPE_DIR, FILE_TYPE_FTFONT, FILE_TYPE_IMAGE, FILE_TYPE_MOVIE, FILE_TYPE_OBJECT_IO, FILE_TYPE_PYSCRIPT, FILE_TYPE_SOUND, FILE_TYPE_TEXT, FILE_TYPE_USD, FILE_TYPE_VOLUME, filelist_file_get_full_path(), FILENAME_IS_PARENT, FS_CATEGORY_OTHER, FS_CATEGORY_SYSTEM, FS_CATEGORY_SYSTEM_BOOKMARKS, i, FSMenuEntry::icon, FSMenuEntry::next, FSMenuEntry::path, FileDirEntry::preview_icon_id, FileDirEntry::redirection_path, FileDirEntry::relpath, ret, STREQ, FileDirEntry::typeflag, and UI_icon_from_idcode().
Referenced by ED_file_icon(), and filelist_geticon_file_type().
|
static |
Definition at line 223 of file filelist.cc.
References BLI_assert, filelist_file(), and G.
Referenced by filelist_get_preview_image(), filelist_geticon_file_type(), and filelist_geticon_special_file_image().
Get one of the larger document icons as image. E.g. a folder or file icon. A file type icon can be overlaid on top then.
Definition at line 270 of file filelist.cc.
References filelist_geticon_get_file(), and filelist_geticon_special_file_image_ex().
| ImBuf * filelist_geticon_special_file_image_ex | ( | const FileDirEntry * | file | ) |
Definition at line 251 of file filelist.cc.
References Document, FILE_TYPE_DIR, filelist_ensure_special_file_image(), FILENAME_IS_PARENT, Folder, Parent, FileDirEntry::relpath, and FileDirEntry::typeflag.
Referenced by file_add_preview_drag_but(), and filelist_geticon_special_file_image().
|
static |
Definition at line 513 of file filelist.cc.
References FileListInternEntry::asset, FileList::asset_library, BLI_assert, FileListInternEntry::free_name, MEM_freeN(), FileListInternEntry::name, FileListInternEntry::redirection_path, FileListInternEntry::relpath, and blender::asset_system::AssetLibrary::remove_asset().
Referenced by filelist_intern_free(), and filelist_intern_free_main_files().
| bool filelist_intern_entry_is_main_file | ( | const FileListInternEntry * | intern_entry | ) |
Definition at line 403 of file filelist.cc.
References FileListInternEntry::id, and FileListInternEntry::local_data.
Referenced by filelist_intern_free_main_files(), and is_filtered_asset_library().
|
static |
Definition at line 532 of file filelist.cc.
References BLI_listbase_clear(), FileListIntern::entries, FileList::filelist_intern, filelist_intern_entry_free(), FileListIntern::filtered, LISTBASE_FOREACH_MUTABLE, and MEM_SAFE_FREE.
Referenced by filelist_clear_ex().
|
static |
Definition at line 546 of file filelist.cc.
References BLI_remlink(), FileListIntern::entries, FileList::filelist_intern, filelist_intern_entry_free(), filelist_intern_entry_is_main_file(), FileListIntern::filtered, LISTBASE_FOREACH_MUTABLE, and MEM_SAFE_FREE.
Referenced by filelist_clear_main_files().
| bool filelist_is_dir | ( | const FileList * | filelist, |
| const char * | path ) |
Definition at line 1100 of file filelist.cc.
References FileList::check_dir_fn.
Referenced by ED_file_change_dir_ex(), file_directory_enter_handle(), file_draw_hint_if_invalid(), file_filename_enter_handle(), and filelist_readjob_start_ex().
| bool filelist_is_ready | ( | const FileList * | filelist | ) |
Definition at line 1153 of file filelist.cc.
References FL_IS_READY, and FileList::flags.
Referenced by file_draw_hint_if_invalid(), file_draw_list(), file_params_renamefile_activate(), file_smoothscroll_invoke(), filelist_file_is_preview_pending(), and blender::ed::asset::list::AssetList::is_loaded().
| bool filelist_islibrary | ( | FileList * | filelist, |
| char * | dir, | ||
| char ** | r_group ) |
| dir | Must be FILE_MAX_LIBEXTRA long! |
Definition at line 2043 of file filelist.cc.
References FileList::asset_library, BKE_blendfile_library_path_explode(), FileList::filelist, and FileDirEntryArr::root.
Referenced by file_delete_poll(), file_draw_hint_if_invalid(), file_external_operation_exec(), file_os_operations_menu_draw(), file_os_operations_menu_poll(), and filelist_filter().
|
static |
Definition at line 3263 of file filelist.cc.
References FileList::asset_library_ref, WM_JOB_TYPE_ASSET_LIBRARY_LOAD, and WM_JOB_TYPE_FILESEL_READDIR.
Referenced by filelist_readjob_running(), filelist_readjob_start_ex(), and filelist_readjob_stop().
| BlendHandle * filelist_lib | ( | FileList * | filelist | ) |
Definition at line 1040 of file filelist.cc.
References FileList::libfiledata.
Referenced by ED_file_path_button().
| bool filelist_needs_force_reset | ( | const FileList * | filelist | ) |
Definition at line 1130 of file filelist.cc.
References FL_FORCE_RESET, FL_FORCE_RESET_MAIN_FILES, and FileList::flags.
Referenced by ED_fileselect_activate_by_id(), ED_fileselect_activate_by_relpath(), blender::ed::asset::list::AssetList::ensure_blocking(), blender::ed::asset::list::AssetList::fetch(), file_refresh(), filelist_files_ensure(), filelist_needs_reading(), and blender::ed::asset::list::AssetList::needs_refetch().
| int filelist_needs_reading | ( | const FileList * | filelist | ) |
Definition at line 1904 of file filelist.cc.
References FileDirEntryArr::entries_num, FILEDIR_NBR_ENTRIES_UNSET, FileList::filelist, and filelist_needs_force_reset().
Referenced by blender::ed::asset::list::AssetList::ensure_blocking(), blender::ed::asset::list::AssetList::fetch(), file_main_region_needs_refresh_before_draw(), file_refresh(), filelist_files_ensure(), and blender::ed::asset::list::AssetList::needs_refetch().
| bool filelist_needs_reset_on_main_changes | ( | const FileList * | filelist | ) |
Definition at line 1163 of file filelist.cc.
References FILELIST_TAGS_USES_MAIN_DATA, and FileList::tags.
Referenced by file_main_region_needs_refresh_before_draw(), file_refresh(), file_reset_filelist_showing_main_data(), and blender::ed::asset::list::AssetList::tag_main_data_dirty().
| FileList * filelist_new | ( | short | type | ) |
Definition at line 845 of file filelist.cc.
References BLI_ghash_new(), BLI_ghashutil_intcmp(), BLI_ghashutil_inthash_p(), FileDirEntryArr::entries_num, FILEDIR_NBR_ENTRIES_UNSET, FileList::filelist, FileList::filelist_cache, filelist_settype(), MEM_callocN(), and FileList::selection_state.
Referenced by file_duplicate(), file_refresh(), and blender::ed::asset::list::FileListWrapper::FileListWrapper().
| bool filelist_pending | ( | const FileList * | filelist | ) |
Definition at line 1158 of file filelist.cc.
References FL_IS_PENDING, and FileList::flags.
Referenced by ED_fileselect_activate_by_id(), ED_fileselect_activate_by_relpath(), blender::ed::asset::list::AssetList::fetch(), and file_refresh().
|
static |
Definition at line 3074 of file filelist.cc.
References AS_asset_library_load(), FileList::asset_library, ASSET_LIBRARY_LOCAL, BLI_assert, BLI_listbase_is_empty(), blender::StringRefNull::c_str(), FileListReadJob::current_main, AssetLibraryReference::custom_library_index, FileDirEntryArr::entries, FileDirEntryArr::entries_num, FILEDIR_NBR_ENTRIES_UNSET, FileList::filelist, filelist_readjob_load_asset_library_data(), filelist_readjob_main_assets_add_items(), filelist_readjob_recursive_dir_add_items(), float, blender::asset_system::AssetLibrary::foreach_loaded(), blender::StringRefBase::is_empty(), FileListReadJob::load_asset_library, FileListReadJob::only_main_data, FileDirEntryArr::root, blender::asset_system::AssetLibrary::root_path(), STRNCPY(), FileListReadJob::tmp_filelist, and AssetLibraryReference::type.
Referenced by filelist_settype().
|
static |
Definition at line 2688 of file filelist.cc.
References BLI_assert, BLI_listbase_count(), BLI_movelisttolist(), FileDirEntryArr::entries, FileDirEntryArr::entries_num, FileList::filelist, FileListReadJob::lock, lock, and FileListReadJob::tmp_filelist.
Referenced by filelist_readjob_recursive_dir_add_items().
|
static |
Definition at line 3018 of file filelist.cc.
References AS_asset_library_load(), FileList::asset_library_ref, BLI_assert, BLI_listbase_is_empty(), blender::asset_system::current_file_library_reference(), FileListReadJob::current_main, FileDirEntryArr::entries, FileDirEntryArr::entries_num, FILEDIR_NBR_ENTRIES_UNSET, FileList::filelist, FileListReadJob::filelist, filelist_contains_main(), filelist_readjob_load_asset_library_data(), filelist_readjob_main_assets_add_items(), filelist_readjob_recursive_dir_add_items(), FileListReadJob::load_asset_library, FileListReadJob::only_main_data, and FileListReadJob::tmp_filelist.
Referenced by filelist_settype().
Forcibly run the job as a blocking task on the main thread.
Definition at line 3351 of file filelist.cc.
References C, and filelist_readjob_start_ex().
Referenced by blender::ed::asset::list::AssetList::ensure_blocking().
|
static |
Definition at line 2905 of file filelist.cc.
References filelist_readjob_do().
Referenced by filelist_readjob_main(), and filelist_settype().
|
static |
Definition at line 2887 of file filelist.cc.
References BLI_assert, BLI_listbase_is_empty(), FileDirEntryArr::entries, FileDirEntryArr::entries_num, FILEDIR_NBR_ENTRIES_UNSET, FileList::filelist, filelist_readjob_recursive_dir_add_items(), and FileListReadJob::tmp_filelist.
Referenced by filelist_readjob_dir(), and filelist_readjob_lib().
|
static |
Definition at line 3234 of file filelist.cc.
References FileListReadJob::filelist, filelist_readjob_update(), FL_IS_PENDING, FL_IS_READY, and FileList::flags.
Referenced by filelist_readjob_start_ex().
|
static |
Definition at line 3245 of file filelist.cc.
References BLI_assert, BLI_listbase_is_empty(), FileDirEntryArr::entries, FileDirEntryArr::entries_num, FileList::filelist, filelist_free(), filelist_freelib(), and FileListReadJob::tmp_filelist.
Referenced by filelist_readjob_start_ex().
|
static |
Check if the read-job is requesting a partial reread of the file list only.
Definition at line 3142 of file filelist.cc.
References FileListReadJob::only_main_data.
Referenced by filelist_readjob_startjob().
|
static |
Definition at line 2913 of file filelist.cc.
References filelist_readjob_do().
Referenced by filelist_settype().
|
static |
Definition at line 2145 of file filelist.cc.
References FileListInternEntry::attributes, BKE_blendfile_extension_check(), BLI_addtail(), BLI_file_alias_target(), BLI_file_attributes(), BLI_filelist_dir_contents(), BLI_filelist_free(), BLI_is_dir(), BLI_path_cmp, BLI_path_extension_check_glob(), BLI_path_extension_strip(), BLI_path_has_hidden_component(), BLI_path_join, BLI_path_slash_ensure(), current_relpath_append(), ED_path_extension_type(), FILE_ATTR_ALIAS, FILE_ATTR_HIDDEN, FILE_MAX, FILE_MAXDIR, FILE_TYPE_BLENDER, FILE_TYPE_BUNDLE, FILE_TYPE_DIR, FILE_TYPE_OPERATOR, FILENAME_IS_CURRPAR, i, MEM_calloc_arrayN(), MEM_freeN(), FileListInternEntry::redirection_path, FileListInternEntry::relpath, direntry::s, S_ISDIR, FileListInternEntry::st, and FileListInternEntry::typeflag.
Referenced by filelist_readjob_recursive_dir_add_items().
|
static |
Definition at line 2392 of file filelist.cc.
References BKE_blendfile_library_path_explode(), BLI_addtail(), BLI_assert, BLI_linklist_count(), BLI_linklist_freeN(), BLO_blendhandle_close(), BLO_blendhandle_from_file(), BLO_blendhandle_get_datablock_info(), BLO_blendhandle_get_linkable_groups(), BLO_datablock_info_linklist_free(), FileIndexer::callbacks, ED_file_indexer_entries_clear(), ED_file_indexer_entries_extend_from_datablock_infos(), FILE_INDEXER_ENTRIES_LOADED, FILE_MAX_LIBEXTRA, filelist_readjob_list_lib_add_datablocks(), filelist_readjob_list_lib_group_create(), filelist_readjob_list_lib_navigate_to_parent_entry_create(), filelist_readjob_list_lib_populate_from_index(), groupname_to_code(), LIST_LIB_ADD_PARENT, LIST_LIB_ASSETS_ONLY, LIST_LIB_RECURSIVE, LinkNode::next, options, FileIndexerType::read_index, FileIndexerType::update_index, and FileIndexer::user_data.
Referenced by filelist_readjob_recursive_dir_add_items().
|
static |
Definition at line 2271 of file filelist.cc.
References blender::asset_system::AssetLibrary::add_external_asset(), FileListInternEntry::asset, BLODataBlockInfo::asset_data, FileListInternEntry::attributes, FileListInternEntry::blenderlib_has_no_preview, FileListInternEntry::blentype, BLI_addtail(), current_relpath_append(), FILE_ATTR_HIDDEN, FILE_TYPE_ASSET, FILE_TYPE_BLENDERLIB, BLODataBlockInfo::free_asset_data, FileListReadJob::load_asset_library, BLODataBlockInfo::name, BLODataBlockInfo::no_preview_found, FileListInternEntry::relpath, SEP_STR, and FileListInternEntry::typeflag.
Referenced by filelist_readjob_list_lib_add_datablocks(), and filelist_readjob_list_lib_add_from_indexer_entries().
|
static |
Definition at line 2317 of file filelist.cc.
References filelist_readjob_list_lib_add_datablock(), and LinkNode::next.
Referenced by filelist_readjob_list_lib().
|
static |
Definition at line 2331 of file filelist.cc.
References BKE_idtype_idcode_to_name(), FileIndexerEntry::datablock_info, FileIndexerEntries::entries, filelist_readjob_list_lib_add_datablock(), FileIndexerEntry::idcode, and LinkNode::next.
Referenced by filelist_readjob_list_lib_populate_from_index().
|
static |
Definition at line 2257 of file filelist.cc.
References FileListInternEntry::blentype, current_relpath_append(), FILE_TYPE_BLENDERLIB, FILE_TYPE_DIR, FileListInternEntry::relpath, and FileListInternEntry::typeflag.
Referenced by filelist_readjob_list_lib().
|
static |
Definition at line 2349 of file filelist.cc.
References current_relpath_append(), FILE_TYPE_BLENDERLIB, FILE_TYPE_DIR, FILENAME_PARENT, FileListInternEntry::relpath, and FileListInternEntry::typeflag.
Referenced by filelist_readjob_list_lib(), and filelist_readjob_list_lib_populate_from_index().
|
static |
Definition at line 2370 of file filelist.cc.
References BLI_addtail(), filelist_readjob_list_lib_add_from_indexer_entries(), filelist_readjob_list_lib_navigate_to_parent_entry_create(), LIST_LIB_ADD_PARENT, and options.
Referenced by filelist_readjob_list_lib().
|
static |
Load asset library data, which currently means loading the asset catalogs for the library.
Definition at line 2924 of file filelist.cc.
References AS_asset_library_load(), FileList::asset_library, FileList::asset_library_ref, FileListReadJob::current_main, FileListReadJob::filelist, FileListReadJob::load_asset_library, FileListReadJob::reload_asset_library, and FileListReadJob::tmp_filelist.
Referenced by filelist_readjob_all_asset_library(), filelist_readjob_asset_library(), and filelist_readjob_main_assets().
|
static |
Definition at line 3048 of file filelist.cc.
References filelist_readjob_dir().
Referenced by filelist_settype().
|
static |
Definition at line 3057 of file filelist.cc.
References BLI_assert, BLI_listbase_is_empty(), FileDirEntryArr::entries, FileDirEntryArr::entries_num, FILEDIR_NBR_ENTRIES_UNSET, FileList::filelist, filelist_readjob_load_asset_library_data(), filelist_readjob_main_assets_add_items(), and FileListReadJob::tmp_filelist.
Referenced by filelist_settype().
|
static |
Definition at line 2948 of file filelist.cc.
References blender::asset_system::AssetLibrary::add_local_id_asset(), FileListInternEntry::asset, ID::asset_data, BKE_asset_metadata_preview_get_from_id(), BKE_idtype_idcode_to_name(), BKE_main_lock(), BKE_main_unlock(), FileListInternEntry::blentype, BLI_addtail(), BLI_movelisttolist(), FileListReadJob::current_main, current_relpath_append(), FileDirEntryArr::entries, FileDirEntryArr::entries_filtered_num, FileDirEntryArr::entries_num, FILE_TYPE_ASSET, FILE_TYPE_BLENDERLIB, FileList::filelist, filelist_uid_generate(), FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, FileListInternEntry::free_name, GS, FileListInternEntry::id, ID_IS_LINKED, FileListReadJob::load_asset_library, FileListInternEntry::local_data, FileListInternEntry::name, ID::name, FileListInternEntry::preview_image, FileListInternEntry::relpath, SEP_STR, FileListReadJob::tmp_filelist, FileListInternEntry::typeflag, and FileListInternEntry::uid.
Referenced by filelist_readjob_all_asset_library(), filelist_readjob_asset_library(), and filelist_readjob_main_assets().
|
static |
Definition at line 2742 of file filelist.cc.
References BLI_is_dir(), BLI_path_abs(), BLI_path_normalize_dir(), BLI_path_rel(), BLI_stack_discard(), BLI_stack_free(), BLI_stack_is_empty(), BLI_stack_new, BLI_stack_peek(), BLI_stack_push_r(), BLI_strdup(), BLI_string_join, FileIndexer::callbacks, FileListReadJob::cur_relbase, TodoDir::dir, FILE_MAX_LIBEXTRA, FILE_MAXFILE, fileentry_uiname(), FileList::filelist, FileIndexerType::filelist_finished, filelist_readjob_append_entries(), filelist_readjob_list_dir(), filelist_readjob_list_lib(), filelist_readjob_should_recurse_into_entry(), filelist_uid_generate(), FileList::filter_data, FileListFilter::filter_glob, float, FileIndexerType::free_user_data, FileList::indexer, FileIndexerType::init_user_data, TodoDir::level, LIST_LIB_ADD_PARENT, LIST_LIB_ASSETS_ONLY, LIST_LIB_OPTION_NONE, LIST_LIB_RECURSIVE, LISTBASE_FOREACH, FileListReadJob::load_asset_library, FileListReadJob::main_filepath, FileList::max_recursion, MEM_freeN(), FileDirEntryArr::root, STRNCPY(), FileListReadJob::tmp_filelist, and FileIndexer::user_data.
Referenced by filelist_readjob_all_asset_library(), filelist_readjob_asset_library(), and filelist_readjob_do().
| int filelist_readjob_running | ( | FileList * | filelist, |
| wmWindowManager * | wm ) |
Definition at line 3361 of file filelist.cc.
References filelist_jobtype_get(), and WM_jobs_test().
|
static |
Definition at line 2705 of file filelist.cc.
References FILE_TYPE_BLENDER, FILE_TYPE_BLENDER_BACKUP, FILE_TYPE_BLENDERLIB, FILE_TYPE_DIR, FILENAME_IS_CURRPAR, FileListInternEntry::relpath, and FileListInternEntry::typeflag.
Referenced by filelist_readjob_recursive_dir_add_items().
May run the job in either the main thread or asynchronously.
Definition at line 3346 of file filelist.cc.
References C, and filelist_readjob_start_ex().
Referenced by blender::ed::asset::list::AssetList::fetch(), and file_refresh().
|
static |
Definition at line 3278 of file filelist.cc.
References FileList::asset_library_ref, assetlibrary_readjob_startjob(), BKE_main_blendfile_path(), C, CTX_data_main(), CTX_wm_manager(), CTX_wm_window(), FileListReadJob::current_main, FileDirEntryArr::entries_num, FILEDIR_NBR_ENTRIES_UNSET, FileList::filelist, FileListReadJob::filelist, filelist_is_dir(), filelist_jobtype_get(), filelist_readjob_endjob(), filelist_readjob_free(), filelist_readjob_startjob(), filelist_readjob_update(), FILELIST_TAGS_NO_THREADS, FL_FORCE_RESET, FL_FORCE_RESET_MAIN_FILES, FL_IS_PENDING, FL_IS_READY, FL_RELOAD_ASSET_LIBRARY, FileList::flags, FileListReadJob::main_filepath, NA_JOB_FINISHED, FileListReadJob::only_main_data, FileListReadJob::reload_asset_library, FileDirEntryArr::root, STRNCPY(), FileList::tags, WM_event_add_notifier(), WM_JOB_PROGRESS, WM_jobs_callbacks(), WM_jobs_customdata_set(), WM_jobs_get(), WM_jobs_start(), and WM_jobs_timer().
Referenced by filelist_readjob_blocking_run(), and filelist_readjob_start().
|
static |
Definition at line 3152 of file filelist.cc.
References FileListFilter::asset_catalog_filter, FileList::asset_library_ref, BLI_assert, BLI_listbase_clear(), FileListIntern::curr_uid, wmJobWorkerStatus::do_update, FileDirEntryArr::entries, FileListIntern::entries, FileDirEntryArr::entries_num, FILEDIR_NBR_ENTRIES_UNSET, FileList::filelist, FileListReadJob::filelist, FileList::filelist_cache, FileList::filelist_intern, filelist_readjob_is_partial_read(), filelist_uid_unset(), FileList::filter_data, FileListIntern::filtered, FileList::libfiledata, FileListReadJob::lock, lock, MEM_dupallocN(), wmJobWorkerStatus::progress, FileList::read_job_fn, FileList::selection_state, wmJobWorkerStatus::stop, and FileListReadJob::tmp_filelist.
Referenced by assetlibrary_readjob_startjob(), and filelist_readjob_start_ex().
| void filelist_readjob_stop | ( | FileList * | filelist, |
| wmWindowManager * | wm ) |
Definition at line 3356 of file filelist.cc.
References filelist_jobtype_get(), and WM_jobs_kill_type().
Referenced by blender::ed::asset::list::AssetList::clear(), blender::ed::asset::list::AssetList::clear_current_file_assets(), ED_fileselect_clear(), ED_fileselect_clear_main_assets(), blender::ed::asset::list::AssetList::fetch(), and file_refresh().
|
static |
Definition at line 3193 of file filelist.cc.
References FileList::asset_library, BLI_movelisttolist(), FileListIntern::curr_uid, FileDirEntryArr::entries, FileListIntern::entries, FileDirEntryArr::entries_num, FileList::filelist, FileListReadJob::filelist, filelist_clear_ex(), FileList::filelist_intern, FL_NEED_FILTERING, FL_NEED_SORTING, FileList::flags, FileListReadJob::lock, lock, and FileListReadJob::tmp_filelist.
Referenced by filelist_readjob_endjob(), and filelist_readjob_start_ex().
| void filelist_set_asset_catalog_filter_options | ( | FileList * | filelist, |
| eFileSel_Params_AssetCatalogVisibility | catalog_visibility, | ||
| const ::bUUID * | catalog_id ) |
Definition at line 126 of file filelist.cc.
References FileListFilter::asset_catalog_filter, blender::ed::asset_browser::file_create_asset_catalog_filter_settings(), filelist_tag_needs_filtering(), and FileList::filter_data.
| void filelist_setdir | ( | FileList * | filelist, |
| char | dirpath[FILE_MAX_LIBEXTRA] ) |
Definition at line 1105 of file filelist.cc.
References FileList::asset_library_ref, BKE_main_blendfile_path_from_global(), BLI_assert, BLI_path_abs(), BLI_path_normalize_dir(), FileList::check_dir_fn, FILE_MAX_LIBEXTRA, FileList::filelist, FL_FORCE_RESET, FileList::flags, FileDirEntryArr::root, STREQ, STRNCPY(), and UNUSED_VARS_NDEBUG.
| void filelist_setindexer | ( | FileList * | filelist, |
| const FileIndexerType * | indexer ) |
Set the indexer to be used by the filelist.
The given indexer allocation should be handled by the caller or defined statically.
Definition at line 118 of file filelist.cc.
References BLI_assert, and FileList::indexer.
Referenced by file_refresh(), and blender::ed::asset::list::AssetList::setup().
| void filelist_setlibrary | ( | FileList * | filelist, |
| const AssetLibraryReference * | asset_library_ref ) |
| asset_library_ref | May be NULL to unset the library. |
Definition at line 166 of file filelist.cc.
References FileList::asset_library_ref, filelist_compare_asset_libraries(), FL_FORCE_RESET, FileList::flags, MEM_callocN(), and MEM_SAFE_FREE.
Referenced by file_refresh(), and blender::ed::asset::list::AssetList::setup().
| void filelist_setrecursion | ( | FileList * | filelist, |
| const int | recursion_level ) |
Definition at line 1122 of file filelist.cc.
References FL_FORCE_RESET, FileList::flags, and FileList::max_recursion.
Referenced by file_parent_exec(), file_refresh(), file_select_do(), and blender::ed::asset::list::AssetList::setup().
| void filelist_settype | ( | FileList * | filelist, |
| short | type ) |
Definition at line 858 of file filelist.cc.
References FileList::check_dir_fn, FILE_ASSET_LIBRARY, FILE_ASSET_LIBRARY_ALL, file_indexer_noop, FILE_LOADLIB, FILE_MAIN, FILE_MAIN_ASSET, filelist_checkdir_dir(), filelist_checkdir_lib(), filelist_checkdir_main(), filelist_checkdir_return_always_valid(), filelist_readjob_all_asset_library(), filelist_readjob_asset_library(), filelist_readjob_dir(), filelist_readjob_lib(), filelist_readjob_main(), filelist_readjob_main_assets(), FILELIST_TAGS_NO_THREADS, FILELIST_TAGS_USES_MAIN_DATA, FileList::filter_fn, FL_FORCE_RESET, FileList::flags, FileList::indexer, is_filtered_asset_library(), is_filtered_file(), is_filtered_lib(), is_filtered_main(), is_filtered_main_assets(), prepare_filter_asset_library(), FileList::prepare_filter_fn, FileList::read_job_fn, FileList::tags, and FileList::type.
Referenced by file_refresh(), and filelist_new().
| void filelist_tag_force_reset | ( | FileList * | filelist | ) |
Definition at line 1135 of file filelist.cc.
References FL_FORCE_RESET, and FileList::flags.
Referenced by blender::ed::asset::list::AssetList::clear().
| void filelist_tag_force_reset_mainfiles | ( | FileList * | filelist | ) |
Definition at line 1140 of file filelist.cc.
References FILELIST_TAGS_USES_MAIN_DATA, FL_FORCE_RESET_MAIN_FILES, FileList::flags, and FileList::tags.
Referenced by blender::ed::asset::list::AssetList::clear_current_file_assets(), ED_fileselect_clear_main_assets(), file_refresh(), file_reset_filelist_showing_main_data(), and blender::ed::asset::list::AssetList::tag_main_data_dirty().
| void filelist_tag_reload_asset_library | ( | FileList * | filelist | ) |
Definition at line 1148 of file filelist.cc.
References FL_RELOAD_ASSET_LIBRARY, and FileList::flags.
Referenced by blender::ed::asset::list::AssetList::clear_current_file_assets(), and ED_fileselect_clear_main_assets().
Definition at line 1358 of file filelist.cc.
References atomic_add_and_fetch_uint32(), FileListIntern::curr_uid, and FileList::filelist_intern.
Referenced by filelist_readjob_main_assets_add_items(), and filelist_readjob_recursive_dir_add_items().
| bool filelist_uid_is_set | ( | const FileUID | uid | ) |
Definition at line 1366 of file filelist.cc.
References filelist_uid_unset().
| void filelist_uid_unset | ( | FileUID * | r_uid | ) |
Definition at line 1373 of file filelist.cc.
References FILE_UID_UNSET.
Referenced by filelist_readjob_startjob(), and filelist_uid_is_set().
|
static |
Definition at line 2051 of file filelist.cc.
References BKE_idtype_idcode_from_name(), BLI_assert, BLI_path_slash_rfind(), BLO_GROUP_MAX, and STRNCPY().
Referenced by filelist_readjob_list_lib().
|
static |
Definition at line 410 of file filelist.cc.
References ARRAY_SET_ITEMS, BLI_path_is_abs_from_cwd(), BLI_path_parent_dir_until_exists(), and BLI_windows_get_default_root_dir().
Referenced by filelist_checkdir_dir(), and filelist_checkdir_lib().
|
static |
Definition at line 88 of file filelist.cc.
Referenced by filelist_ensure_special_file_image(), and filelist_free_icons().